@decocms/mesh 1.0.0-alpha.3 → 1.0.0-alpha.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/README.md +287 -0
- package/dist/client/assets/{alert-dialog-Caf0mgW9.js → alert-dialog-lT7fjsnS.js} +3 -3
- package/dist/client/assets/app-name-gTETL9So.js +1 -0
- package/dist/client/assets/{auth-CGqqbEan.js → auth-B4DV4YJb.js} +1 -1
- package/dist/client/assets/{auth-catchall-Bw-KJI1v.js → auth-catchall-BXXli3-E.js} +1 -1
- package/dist/client/assets/{avatar-CdPaDOIs.js → avatar-DrbrX3Fb.js} +1 -1
- package/dist/client/assets/{badge-j-myHF25.js → badge-Sw-5Fjm_.js} +1 -1
- package/dist/client/assets/{button-DnKGwZ1P.js → button-De8TtfIc.js} +1 -1
- package/dist/client/assets/{card-I0CWqn2J.js → card-Clgs1Ler.js} +1 -1
- package/dist/client/assets/{checkbox-v3iP8MNg.js → checkbox-BZTG8MjG.js} +1 -1
- package/dist/client/assets/{circle-alert-CpqBZI3V.js → circle-alert-Bo6PdNJA.js} +1 -1
- package/dist/client/assets/collection-detail-bCm7IhzQ.js +1 -0
- package/dist/client/assets/collection-display-button-CANVxM78.js +1 -0
- package/dist/client/assets/collection-header-DWpT3ZvE.js +1 -0
- package/dist/client/assets/{collection-page-CkAonVNX.js → collection-page-BDYpmZx2.js} +1 -1
- package/dist/client/assets/{collection-search-Bd4XQ4_K.js → collection-search-7dvS8CPU.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Dv4rgxdy.js → collection-table-wrapper-DFImlrAn.js} +1 -1
- package/dist/client/assets/connection-card-Dgd2qOAx.js +1 -0
- package/dist/client/assets/connection-detail-B5XIo4jJ.js +1 -0
- package/dist/client/assets/connections-DgVq2Zi4.js +1 -0
- package/dist/client/assets/core-6UZH86ZU.js +6 -0
- package/dist/client/assets/{create-organization-dialog-CWgFMDXV.js → create-organization-dialog-DpintAfW.js} +1 -1
- package/dist/client/assets/dialog-CcWkQ3-q.js +1 -0
- package/dist/client/assets/{dropdown-menu-BIeRR6rM.js → dropdown-menu-BMBTO1aI.js} +1 -1
- package/dist/client/assets/{empty-state-DV83eIhT.js → empty-state-WuOT2hFn.js} +1 -1
- package/dist/client/assets/{error-boundary-qOVcoWbq.js → error-boundary-Sj1-czrQ.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DzgXoQyz.js → extract-connection-data-q7cQAIMM.js} +1 -1
- package/dist/client/assets/{form-0C1lYHJ2.js → form-CTTDgzck.js} +1 -1
- package/dist/client/assets/gateway-detail-DrTM5RUx.js +1 -0
- package/dist/client/assets/gateways-C0TCQRt5.js +1 -0
- package/dist/client/assets/{home-B1IT0slW.js → home-Dy-_EeTf.js} +1 -1
- package/dist/client/assets/{icon-C1glN-Ga.js → icon-Dk9j-Z4d.js} +1 -1
- package/dist/client/assets/index-BMLzl8gY.css +1 -0
- package/dist/client/assets/index-BSuuYE7a.js +32 -0
- package/dist/client/assets/index-DIXLDBVl.js +118 -0
- package/dist/client/assets/{index-Chpp7zg0.js → index-Dss36SHE.js} +1 -1
- package/dist/client/assets/{index-D2ODleHN.js → index-GY3GXADp.js} +1 -1
- package/dist/client/assets/{input-DpAKmHHm.js → input-ByJBGfq3.js} +1 -1
- package/dist/client/assets/json-B2EH3aa6.js +1 -0
- package/dist/client/assets/json-BESjz4hO.js +1 -0
- package/dist/client/assets/layout-DRBUzMK7.js +1 -0
- package/dist/client/assets/lazy-highlighter-BZ3JTPPT.js +4 -0
- package/dist/client/assets/{localstorage-keys-DC7ymQmZ.js → localstorage-keys-CrXjwcSZ.js} +1 -1
- package/dist/client/assets/login-baVguqcM.js +1 -0
- package/dist/client/assets/mcp-oauth-Chn8Vl6o.js +1 -0
- package/dist/client/assets/members-BL6-e_ID.js +3 -0
- package/dist/client/assets/monitoring-DSGI33MK.js +1 -0
- package/dist/client/assets/oauth-callback-BxWJgxm-.js +1 -0
- package/dist/client/assets/page-BZV40eAE.css +1 -0
- package/dist/client/assets/page-D0r-m9VX.js +21 -0
- package/dist/client/assets/{popover-TCQphQTw.js → popover-C_H6Z3YS.js} +1 -1
- package/dist/client/assets/prism-light-CKU-zSUS.js +1 -0
- package/dist/client/assets/resource-tabs-Dptn276z.js +1 -0
- package/dist/client/assets/{schema-BLzWyGtx.js → schema-iWDGcZfv.js} +1 -1
- package/dist/client/assets/{select-fvQCifl4.js → select-KKeuY_8A.js} +1 -1
- package/dist/client/assets/settings-DOQRUeGN.js +1 -0
- package/dist/client/assets/shell-layout-DxFvs5RE.js +124 -0
- package/dist/client/assets/slugify-CEUa2lfQ.js +1 -0
- package/dist/client/assets/{spinner-Cck765yW.js → spinner-C5mTiECQ.js} +1 -1
- package/dist/client/assets/store-BsHJOv3r.js +1 -0
- package/dist/client/assets/store-app-detail-D8K1UJ66.js +1 -0
- package/dist/client/assets/switch-BN3gNP3v.js +1 -0
- package/dist/client/assets/{textarea--4iImQiq.js → textarea-DYrEFGVo.js} +1 -1
- package/dist/client/assets/tool-set-selector-BU0xXwDF.js +1 -0
- package/dist/client/assets/{tooltip-DjXyjtiH.js → tooltip-ZzCYSPeH.js} +1 -1
- package/dist/client/assets/types-DndJPAWa.js +45 -0
- package/dist/client/assets/{upload-DkfUhTLj.js → upload-CsXE0eHm.js} +1 -1
- package/dist/client/assets/{use-binding-BLIUV5ER.js → use-binding-CIVQUW9t.js} +2 -2
- package/dist/client/assets/use-connection-CgusccPZ.js +2 -0
- package/dist/client/assets/use-gateway-iwW9W997.js +1 -0
- package/dist/client/assets/{use-list-state-Bas0EIwN.js → use-list-state-B2svGg01.js} +1 -1
- package/dist/client/assets/use-mcp-ByPLvFZj.js +1 -0
- package/dist/client/assets/use-members-dzf6tzsH.js +1 -0
- package/dist/client/assets/{use-mobile-CxX0wu31.js → use-mobile-BqnROvZt.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CpvpbwdB.js → use-organization-settings-DYa2j-qu.js} +1 -1
- package/dist/client/assets/{use-tool-call-p0lqBezD.js → use-tool-call-CFjw03Kh.js} +1 -1
- package/dist/client/assets/useQuery-B5H-PpIX.js +1 -0
- package/dist/client/assets/utils-Ny57I_y6.js +1 -0
- package/dist/client/assets/well-known-mcp-Dg77mwx9.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +191 -211
- package/dist/server/migrate.js +204 -204
- package/dist/server/server.js +245 -267
- package/package.json +7 -5
- package/dist/client/assets/app-name-DQPOjnhR.js +0 -1
- package/dist/client/assets/chunk-2RRQPJJO-DGhxLrrR.js +0 -1
- package/dist/client/assets/collection-detail-BSfYYwzG.js +0 -1
- package/dist/client/assets/collection-display-button-Cws3c2TG.js +0 -1
- package/dist/client/assets/collection-header-CJC3zXGa.js +0 -1
- package/dist/client/assets/connection-card-CgJm9r5i.js +0 -1
- package/dist/client/assets/connection-detail-HAGAOVY9.js +0 -1
- package/dist/client/assets/connections-C8Z338-P.js +0 -1
- package/dist/client/assets/dialog-Qusr5Dgc.js +0 -1
- package/dist/client/assets/gateway-detail-mD14k5vr.js +0 -1
- package/dist/client/assets/gateways-BSGLH5Mc.js +0 -1
- package/dist/client/assets/index-B5e6fytH.js +0 -118
- package/dist/client/assets/index-C1xA8jg5.js +0 -1
- package/dist/client/assets/index-DqmRoUE9.js +0 -32
- package/dist/client/assets/index-feMggVqN.css +0 -1
- package/dist/client/assets/integration-icon-C_Dk6BbN.js +0 -1
- package/dist/client/assets/layout-BMHVtK0w.js +0 -1
- package/dist/client/assets/lazy-highlighter-9rAB2zZq.js +0 -1
- package/dist/client/assets/login-BMjQy3tL.js +0 -1
- package/dist/client/assets/members-k_V-Gxfi.js +0 -1
- package/dist/client/assets/monitoring-BG-rBDyv.js +0 -1
- package/dist/client/assets/monitoring-stats-row-PYfuhQHX.js +0 -42
- package/dist/client/assets/oauth-callback-CQ4D18kW.js +0 -10
- package/dist/client/assets/page-h-kmS-QS.js +0 -1
- package/dist/client/assets/prism-CcSucC56.js +0 -9
- package/dist/client/assets/resource-tabs-E4yf0eYT.js +0 -1
- package/dist/client/assets/settings-Bjk195Z6.js +0 -1
- package/dist/client/assets/shell-layout-B8oNCzSa.js +0 -124
- package/dist/client/assets/store-DD1aCoWU.js +0 -1
- package/dist/client/assets/store-app-detail-DZvzqAVf.js +0 -1
- package/dist/client/assets/tool-set-selector-Fu1vBXWK.js +0 -1
- package/dist/client/assets/use-connection-IMyxygAc.js +0 -2
- package/dist/client/assets/use-gateway-CuMrhcvh.js +0 -1
- package/dist/client/assets/use-members-DHcrnzKP.js +0 -1
- package/dist/client/assets/useQuery-BO2jzwkw.js +0 -1
- package/dist/client/assets/utils-BLBjpUfr.js +0 -1
- package/dist/client/assets/well-known-mcp-Dq2j3ucM.js +0 -1
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lazy-highlighter-BZ3JTPPT.js","assets/index-DIXLDBVl.js","assets/index-BMLzl8gY.css","assets/core-6UZH86ZU.js","assets/json-BESjz4hO.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{$ as z,f as Rh,n as fa,g as ha,e as Dr,h as Oh,i as Ae,k as Ls,p as un,l as mi,m as gi,o as Lh,q as Dh,s as _l,t as yl,v as Qn,w as Ds,x as Ph,y as Mh,z as hr,B as Ar,C as Bh,D as pa,E as kl,F as Fh,G as ne,c as F,H as zh,I as jh,J as Uh,_ as Hh,K as $h,L as Zh,M as Yh,O as qh,P as Vh,Q as Wh,R as Gh,T as Kh,U as Qh,V as Al,W as Xh,Z as pe,X as ma,r as D,j as m,Y as zn,a0 as Sl,a1 as Cl,a2 as ot,a3 as ga,a4 as Jh,a5 as Pr,a6 as ai,a as Mr,a7 as ep,a8 as tp,a9 as np,aa as rp,ab as ip,ac as sp,ad as ap,ae as op,af as up,ag as lp,d as Il,ah as cp,ai as dp,aj as fp,ak as hp,S as Nl,al as pp,am as mp,N as gp,an as bp,ao as wl}from"./index-DIXLDBVl.js";import{E as Ep}from"./empty-state-WuOT2hFn.js";import{U as xp,u as Tp,c as _p,I as bi,a as yp,b as kp}from"./use-connection-CgusccPZ.js";import{u as Ap}from"./use-gateway-iwW9W997.js";import{E as Sp,u as Cp}from"./use-binding-CIVQUW9t.js";import{u as Dn,L as Br}from"./localstorage-keys-CrXjwcSZ.js";import{c as Ip,T as vl,a as Rl,b as Ol,u as vt,d as Np,L as oo,P as wp,O as vp}from"./tooltip-ZzCYSPeH.js";import{B as ut,u as ln}from"./button-De8TtfIc.js";import{I as ge}from"./icon-Dk9j-Z4d.js";import{S as Rp,a as Op,b as Lp,c as Dp}from"./select-KKeuY_8A.js";import{c as X}from"./utils-Ny57I_y6.js";import{u as jn}from"./use-mobile-BqnROvZt.js";import{T as Pp}from"./textarea-DYrEFGVo.js";import{C as Mp}from"./connection-card-Dgd2qOAx.js";import{E as Ps}from"./error-boundary-Sj1-czrQ.js";import{X as Bp,D as Ll,a as Dl,b as Pl,c as Ml,d as Bl}from"./dialog-CcWkQ3-q.js";import{u as Fl,a as Fp}from"./use-organization-settings-DYa2j-qu.js";import{C as zp}from"./create-organization-dialog-DpintAfW.js";import{I as jp}from"./input-ByJBGfq3.js";import{P as Up,a as Hp,b as $p}from"./popover-C_H6Z3YS.js";import{A as Un}from"./avatar-DrbrX3Fb.js";import{D as Zp,a as Yp,b as qp,c as Vp,d as uo}from"./dropdown-menu-BMBTO1aI.js";import"./auth-B4DV4YJb.js";import"./useQuery-B5H-PpIX.js";import"./card-Clgs1Ler.js";import"./alert-dialog-lT7fjsnS.js";import"./form-CTTDgzck.js";import"./spinner-C5mTiECQ.js";const Wp=/^[cC][^\s-]{8,}$/,Gp=/^[0-9a-z]+$/,Kp=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Qp=/^[0-9a-vA-V]{20}$/,Xp=/^[A-Za-z0-9]{27}$/,Jp=/^[a-zA-Z0-9_-]{21}$/,em=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,tm=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,lo=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,nm=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,rm="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function im(){return new RegExp(rm,"u")}const sm=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,am=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,om=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,um=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,lm=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,zl=/^[A-Za-z0-9_-]*$/,cm=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,dm=/^\+(?:[0-9]){6,14}[0-9]$/,jl="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",fm=new RegExp(`^${jl}$`);function Ul(t){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function hm(t){return new RegExp(`^${Ul(t)}$`)}function pm(t){const e=Ul({precision:t.precision}),n=["Z"];t.local&&n.push(""),t.offset&&n.push("([+-]\\d{2}:\\d{2})");const r=`${e}(?:${n.join("|")})`;return new RegExp(`^${jl}T(?:${r})$`)}const mm=t=>{const e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},gm=/^\d+$/,bm=/^-?\d+(?:\.\d+)?/i,Em=/true|false/i,xm=/null/i,Tm=/^[^A-Z]*$/,_m=/^[^a-z]*$/,lt=z("$ZodCheck",(t,e)=>{var n;t._zod??(t._zod={}),t._zod.def=e,(n=t._zod).onattach??(n.onattach=[])}),Hl={number:"number",bigint:"bigint",object:"date"},$l=z("$ZodCheckLessThan",(t,e)=>{lt.init(t,e);const n=Hl[typeof e.value];t._zod.onattach.push(r=>{const i=r._zod.bag,s=(e.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<s&&(e.inclusive?i.maximum=e.value:i.exclusiveMaximum=e.value)}),t._zod.check=r=>{(e.inclusive?r.value<=e.value:r.value<e.value)||r.issues.push({origin:n,code:"too_big",maximum:e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Zl=z("$ZodCheckGreaterThan",(t,e)=>{lt.init(t,e);const n=Hl[typeof e.value];t._zod.onattach.push(r=>{const i=r._zod.bag,s=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),t._zod.check=r=>{(e.inclusive?r.value>=e.value:r.value>e.value)||r.issues.push({origin:n,code:"too_small",minimum:e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),ym=z("$ZodCheckMultipleOf",(t,e)=>{lt.init(t,e),t._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=e.value)}),t._zod.check=n=>{if(typeof n.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%e.value===BigInt(0):Rh(n.value,e.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:e.value,input:n.value,inst:t,continue:!e.abort})}}),km=z("$ZodCheckNumberFormat",(t,e)=>{lt.init(t,e),e.format=e.format||"float64";const n=e.format?.includes("int"),r=n?"int":"number",[i,s]=Oh[e.format];t._zod.onattach.push(a=>{const o=a._zod.bag;o.format=e.format,o.minimum=i,o.maximum=s,n&&(o.pattern=gm)}),t._zod.check=a=>{const o=a.value;if(n){if(!Number.isInteger(o)){a.issues.push({expected:r,format:e.format,code:"invalid_type",input:o,inst:t});return}if(!Number.isSafeInteger(o)){o>0?a.issues.push({input:o,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,continue:!e.abort}):a.issues.push({input:o,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,continue:!e.abort});return}}o<i&&a.issues.push({origin:"number",input:o,code:"too_small",minimum:i,inclusive:!0,inst:t,continue:!e.abort}),o>s&&a.issues.push({origin:"number",input:o,code:"too_big",maximum:s,inst:t})}}),Am=z("$ZodCheckMaxLength",(t,e)=>{var n;lt.init(t,e),(n=t._zod.def).when??(n.when=r=>{const i=r.value;return!fa(i)&&i.length!==void 0}),t._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(r._zod.bag.maximum=e.maximum)}),t._zod.check=r=>{const i=r.value;if(i.length<=e.maximum)return;const a=ha(i);r.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),Sm=z("$ZodCheckMinLength",(t,e)=>{var n;lt.init(t,e),(n=t._zod.def).when??(n.when=r=>{const i=r.value;return!fa(i)&&i.length!==void 0}),t._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(r._zod.bag.minimum=e.minimum)}),t._zod.check=r=>{const i=r.value;if(i.length>=e.minimum)return;const a=ha(i);r.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),Cm=z("$ZodCheckLengthEquals",(t,e)=>{var n;lt.init(t,e),(n=t._zod.def).when??(n.when=r=>{const i=r.value;return!fa(i)&&i.length!==void 0}),t._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=e.length,i.maximum=e.length,i.length=e.length}),t._zod.check=r=>{const i=r.value,s=i.length;if(s===e.length)return;const a=ha(i),o=s>e.length;r.issues.push({origin:a,...o?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),Ri=z("$ZodCheckStringFormat",(t,e)=>{var n,r;lt.init(t,e),t._zod.onattach.push(i=>{const s=i._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(n=t._zod).check??(n.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(r=t._zod).check??(r.check=()=>{})}),Im=z("$ZodCheckRegex",(t,e)=>{Ri.init(t,e),t._zod.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),Nm=z("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Tm),Ri.init(t,e)}),wm=z("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=_m),Ri.init(t,e)}),vm=z("$ZodCheckIncludes",(t,e)=>{lt.init(t,e);const n=Dr(e.includes),r=new RegExp(typeof e.position=="number"?`^.{${e.position}}${n}`:n);e.pattern=r,t._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),t._zod.check=i=>{i.value.includes(e.includes,e.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:i.value,inst:t,continue:!e.abort})}}),Rm=z("$ZodCheckStartsWith",(t,e)=>{lt.init(t,e);const n=new RegExp(`^${Dr(e.prefix)}.*`);e.pattern??(e.pattern=n),t._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),t._zod.check=r=>{r.value.startsWith(e.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:r.value,inst:t,continue:!e.abort})}}),Om=z("$ZodCheckEndsWith",(t,e)=>{lt.init(t,e);const n=new RegExp(`.*${Dr(e.suffix)}$`);e.pattern??(e.pattern=n),t._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),t._zod.check=r=>{r.value.endsWith(e.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:r.value,inst:t,continue:!e.abort})}}),Lm=z("$ZodCheckOverwrite",(t,e)=>{lt.init(t,e),t._zod.check=n=>{n.value=e.tx(n.value)}});class Dm{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const r=e.split(`
|
|
3
|
+
`).filter(a=>a),i=Math.min(...r.map(a=>a.length-a.trimStart().length)),s=r.map(a=>a.slice(i)).map(a=>" ".repeat(this.indent*2)+a);for(const a of s)this.content.push(a)}compile(){const e=Function,n=this?.args,i=[...(this?.content??[""]).map(s=>` ${s}`)];return new e(...n,i.join(`
|
|
4
|
+
`))}}const Pm={major:4,minor:0,patch:0},Oe=z("$ZodType",(t,e)=>{var n;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Pm;const r=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&r.unshift(t);for(const i of r)for(const s of i._zod.onattach)s(t);if(r.length===0)(n=t._zod).deferred??(n.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{const i=(s,a,o)=>{let u=hr(s),l;for(const d of a){if(d._zod.def.when){if(!d._zod.def.when(s))continue}else if(u)continue;const c=s.issues.length,h=d._zod.check(s);if(h instanceof Promise&&o?.async===!1)throw new Ds;if(l||h instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await h,s.issues.length!==c&&(u||(u=hr(s,c)))});else{if(s.issues.length===c)continue;u||(u=hr(s,c))}}return l?l.then(()=>s):s};t._zod.run=(s,a)=>{const o=t._zod.parse(s,a);if(o instanceof Promise){if(a.async===!1)throw new Ds;return o.then(u=>i(u,r,a))}return i(o,r,a)}}t["~standard"]={validate:i=>{try{const s=Ph(t,i);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Mh(t,i).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}}),ba=z("$ZodString",(t,e)=>{Oe.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??mm(t._zod.bag),t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:t}),n}}),Be=z("$ZodStringFormat",(t,e)=>{Ri.init(t,e),ba.init(t,e)}),Mm=z("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=tm),Be.init(t,e)}),Bm=z("$ZodUUID",(t,e)=>{if(e.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(r===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=lo(r))}else e.pattern??(e.pattern=lo());Be.init(t,e)}),Fm=z("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=nm),Be.init(t,e)}),zm=z("$ZodURL",(t,e)=>{Be.init(t,e),t._zod.check=n=>{try{const r=n.value,i=new URL(r),s=i.href;e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:cm.source,input:n.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:n.value,inst:t,continue:!e.abort})),!r.endsWith("/")&&s.endsWith("/")?n.value=s.slice(0,-1):n.value=s;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!e.abort})}}}),jm=z("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=im()),Be.init(t,e)}),Um=z("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Jp),Be.init(t,e)}),Hm=z("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Wp),Be.init(t,e)}),$m=z("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Gp),Be.init(t,e)}),Zm=z("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Kp),Be.init(t,e)}),Ym=z("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Qp),Be.init(t,e)}),qm=z("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Xp),Be.init(t,e)}),Vm=z("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=pm(e)),Be.init(t,e)}),Wm=z("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=fm),Be.init(t,e)}),Gm=z("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=hm(e)),Be.init(t,e)}),Km=z("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=em),Be.init(t,e)}),Qm=z("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=sm),Be.init(t,e),t._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv4"})}),Xm=z("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=am),Be.init(t,e),t._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv6"}),t._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:t,continue:!e.abort})}}}),Jm=z("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=om),Be.init(t,e)}),e0=z("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=um),Be.init(t,e),t._zod.check=n=>{const[r,i]=n.value.split("/");try{if(!i)throw new Error;const s=Number(i);if(`${s}`!==i)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:t,continue:!e.abort})}}});function Yl(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}const t0=z("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=lm),Be.init(t,e),t._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),t._zod.check=n=>{Yl(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!e.abort})}});function n0(t){if(!zl.test(t))return!1;const e=t.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=e.padEnd(Math.ceil(e.length/4)*4,"=");return Yl(n)}const r0=z("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=zl),Be.init(t,e),t._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),t._zod.check=n=>{n0(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!e.abort})}}),i0=z("$ZodE164",(t,e)=>{e.pattern??(e.pattern=dm),Be.init(t,e)});function s0(t,e=null){try{const n=t.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||e&&(!("alg"in i)||i.alg!==e))}catch{return!1}}const a0=z("$ZodJWT",(t,e)=>{Be.init(t,e),t._zod.check=n=>{s0(n.value,e.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!e.abort})}}),ql=z("$ZodNumber",(t,e)=>{Oe.init(t,e),t._zod.pattern=t._zod.bag.pattern??bm,t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...s?{received:s}:{}}),n}}),o0=z("$ZodNumber",(t,e)=>{km.init(t,e),ql.init(t,e)}),u0=z("$ZodBoolean",(t,e)=>{Oe.init(t,e),t._zod.pattern=Em,t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:t}),n}}),l0=z("$ZodNull",(t,e)=>{Oe.init(t,e),t._zod.pattern=xm,t._zod.values=new Set([null]),t._zod.parse=(n,r)=>{const i=n.value;return i===null||n.issues.push({expected:"null",code:"invalid_type",input:i,inst:t}),n}}),c0=z("$ZodUnknown",(t,e)=>{Oe.init(t,e),t._zod.parse=n=>n}),d0=z("$ZodNever",(t,e)=>{Oe.init(t,e),t._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:t}),n)});function co(t,e,n){t.issues.length&&e.issues.push(...un(n,t.issues)),e.value[n]=t.value}const f0=z("$ZodArray",(t,e)=>{Oe.init(t,e),t._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:t}),n;n.value=Array(i.length);const s=[];for(let a=0;a<i.length;a++){const o=i[a],u=e.element._zod.run({value:o,issues:[]},r);u instanceof Promise?s.push(u.then(l=>co(l,n,a))):co(u,n,a)}return s.length?Promise.all(s).then(()=>n):n}});function Kr(t,e,n){t.issues.length&&e.issues.push(...un(n,t.issues)),e.value[n]=t.value}function fo(t,e,n,r){t.issues.length?r[n]===void 0?n in r?e.value[n]=void 0:e.value[n]=t.value:e.issues.push(...un(n,t.issues)):t.value===void 0?n in r&&(e.value[n]=void 0):e.value[n]=t.value}const h0=z("$ZodObject",(t,e)=>{Oe.init(t,e);const n=_l(()=>{const c=Object.keys(e.shape);for(const p of c)if(!(e.shape[p]instanceof Oe))throw new Error(`Invalid element at key "${p}": expected a Zod schema`);const h=Bh(e.shape);return{shape:e.shape,keys:c,keySet:new Set(c),numKeys:c.length,optionalKeys:new Set(h)}});Ae(t._zod,"propValues",()=>{const c=e.shape,h={};for(const p in c){const g=c[p]._zod;if(g.values){h[p]??(h[p]=new Set);for(const E of g.values)h[p].add(E)}}return h});const r=c=>{const h=new Dm(["shape","payload","ctx"]),p=n.value,g=_=>{const b=Qn(_);return`shape[${b}]._zod.run({ value: input[${b}], issues: [] }, ctx)`};h.write("const input = payload.value;");const E=Object.create(null);let T=0;for(const _ of p.keys)E[_]=`key_${T++}`;h.write("const newResult = {}");for(const _ of p.keys)if(p.optionalKeys.has(_)){const b=E[_];h.write(`const ${b} = ${g(_)};`);const C=Qn(_);h.write(`
|
|
5
|
+
if (${b}.issues.length) {
|
|
6
|
+
if (input[${C}] === undefined) {
|
|
7
|
+
if (${C} in input) {
|
|
8
|
+
newResult[${C}] = undefined;
|
|
9
|
+
}
|
|
10
|
+
} else {
|
|
11
|
+
payload.issues = payload.issues.concat(
|
|
12
|
+
${b}.issues.map((iss) => ({
|
|
13
|
+
...iss,
|
|
14
|
+
path: iss.path ? [${C}, ...iss.path] : [${C}],
|
|
15
|
+
}))
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
} else if (${b}.value === undefined) {
|
|
19
|
+
if (${C} in input) newResult[${C}] = undefined;
|
|
20
|
+
} else {
|
|
21
|
+
newResult[${C}] = ${b}.value;
|
|
22
|
+
}
|
|
23
|
+
`)}else{const b=E[_];h.write(`const ${b} = ${g(_)};`),h.write(`
|
|
24
|
+
if (${b}.issues.length) payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
|
|
25
|
+
...iss,
|
|
26
|
+
path: iss.path ? [${Qn(_)}, ...iss.path] : [${Qn(_)}]
|
|
27
|
+
})));`),h.write(`newResult[${Qn(_)}] = ${b}.value`)}h.write("payload.value = newResult;"),h.write("return payload;");const x=h.compile();return(_,b)=>x(c,_,b)};let i;const s=yl,a=!Lh.jitless,u=a&&Dh.value,l=e.catchall;let d;t._zod.parse=(c,h)=>{d??(d=n.value);const p=c.value;if(!s(p))return c.issues.push({expected:"object",code:"invalid_type",input:p,inst:t}),c;const g=[];if(a&&u&&h?.async===!1&&h.jitless!==!0)i||(i=r(e.shape)),c=i(c,h);else{c.value={};const b=d.shape;for(const C of d.keys){const w=b[C],k=w._zod.run({value:p[C],issues:[]},h),v=w._zod.optin==="optional"&&w._zod.optout==="optional";k instanceof Promise?g.push(k.then(O=>v?fo(O,c,C,p):Kr(O,c,C))):v?fo(k,c,C,p):Kr(k,c,C)}}if(!l)return g.length?Promise.all(g).then(()=>c):c;const E=[],T=d.keySet,x=l._zod,_=x.def.type;for(const b of Object.keys(p)){if(T.has(b))continue;if(_==="never"){E.push(b);continue}const C=x.run({value:p[b],issues:[]},h);C instanceof Promise?g.push(C.then(w=>Kr(w,c,b))):Kr(C,c,b)}return E.length&&c.issues.push({code:"unrecognized_keys",keys:E,input:p,inst:t}),g.length?Promise.all(g).then(()=>c):c}});function ho(t,e,n,r){for(const i of t)if(i.issues.length===0)return e.value=i.value,e;return e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(i=>i.issues.map(s=>mi(s,r,gi())))}),e}const Vl=z("$ZodUnion",(t,e)=>{Oe.init(t,e),Ae(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),Ae(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Ae(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),Ae(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){const n=e.options.map(r=>r._zod.pattern);return new RegExp(`^(${n.map(r=>pa(r.source)).join("|")})$`)}}),t._zod.parse=(n,r)=>{let i=!1;const s=[];for(const a of e.options){const o=a._zod.run({value:n.value,issues:[]},r);if(o instanceof Promise)s.push(o),i=!0;else{if(o.issues.length===0)return o;s.push(o)}}return i?Promise.all(s).then(a=>ho(a,n,t,r)):ho(s,n,t,r)}}),p0=z("$ZodDiscriminatedUnion",(t,e)=>{Vl.init(t,e);const n=t._zod.parse;Ae(t._zod,"propValues",()=>{const i={};for(const s of e.options){const a=s._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(const[o,u]of Object.entries(a)){i[o]||(i[o]=new Set);for(const l of u)i[o].add(l)}}return i});const r=_l(()=>{const i=e.options,s=new Map;for(const a of i){const o=a._zod.propValues[e.discriminator];if(!o||o.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(a)}"`);for(const u of o){if(s.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);s.set(u,a)}}return s});t._zod.parse=(i,s)=>{const a=i.value;if(!yl(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:t}),i;const o=r.value.get(a?.[e.discriminator]);return o?o._zod.run(i,s):e.unionFallback?n(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:a,path:[e.discriminator],inst:t}),i)}}),m0=z("$ZodIntersection",(t,e)=>{Oe.init(t,e),t._zod.parse=(n,r)=>{const i=n.value,s=e.left._zod.run({value:i,issues:[]},r),a=e.right._zod.run({value:i,issues:[]},r);return s instanceof Promise||a instanceof Promise?Promise.all([s,a]).then(([u,l])=>po(n,u,l)):po(n,s,a)}});function Ms(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(Ls(t)&&Ls(e)){const n=Object.keys(e),r=Object.keys(t).filter(s=>n.indexOf(s)!==-1),i={...t,...e};for(const s of r){const a=Ms(t[s],e[s]);if(!a.valid)return{valid:!1,mergeErrorPath:[s,...a.mergeErrorPath]};i[s]=a.data}return{valid:!0,data:i}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<t.length;r++){const i=t[r],s=e[r],a=Ms(i,s);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function po(t,e,n){if(e.issues.length&&t.issues.push(...e.issues),n.issues.length&&t.issues.push(...n.issues),hr(t))return t;const r=Ms(e.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return t.value=r.data,t}const g0=z("$ZodRecord",(t,e)=>{Oe.init(t,e),t._zod.parse=(n,r)=>{const i=n.value;if(!Ls(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),n;const s=[];if(e.keyType._zod.values){const a=e.keyType._zod.values;n.value={};for(const u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){const l=e.valueType._zod.run({value:i[u],issues:[]},r);l instanceof Promise?s.push(l.then(d=>{d.issues.length&&n.issues.push(...un(u,d.issues)),n.value[u]=d.value})):(l.issues.length&&n.issues.push(...un(u,l.issues)),n.value[u]=l.value)}let o;for(const u in i)a.has(u)||(o=o??[],o.push(u));o&&o.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:o})}else{n.value={};for(const a of Reflect.ownKeys(i)){if(a==="__proto__")continue;const o=e.keyType._zod.run({value:a,issues:[]},r);if(o instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(o.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:o.issues.map(l=>mi(l,r,gi())),input:a,path:[a],inst:t}),n.value[o.value]=o.value;continue}const u=e.valueType._zod.run({value:i[a],issues:[]},r);u instanceof Promise?s.push(u.then(l=>{l.issues.length&&n.issues.push(...un(a,l.issues)),n.value[o.value]=l.value})):(u.issues.length&&n.issues.push(...un(a,u.issues)),n.value[o.value]=u.value)}}return s.length?Promise.all(s).then(()=>n):n}}),b0=z("$ZodEnum",(t,e)=>{Oe.init(t,e);const n=kl(e.entries);t._zod.values=new Set(n),t._zod.pattern=new RegExp(`^(${n.filter(r=>Fh.has(typeof r)).map(r=>typeof r=="string"?Dr(r):r.toString()).join("|")})$`),t._zod.parse=(r,i)=>{const s=r.value;return t._zod.values.has(s)||r.issues.push({code:"invalid_value",values:n,input:s,inst:t}),r}}),E0=z("$ZodLiteral",(t,e)=>{Oe.init(t,e),t._zod.values=new Set(e.values),t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?Dr(n):n?n.toString():String(n)).join("|")})$`),t._zod.parse=(n,r)=>{const i=n.value;return t._zod.values.has(i)||n.issues.push({code:"invalid_value",values:e.values,input:i,inst:t}),n}}),x0=z("$ZodTransform",(t,e)=>{Oe.init(t,e),t._zod.parse=(n,r)=>{const i=e.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(a=>(n.value=a,n));if(i instanceof Promise)throw new Ds;return n.value=i,n}}),T0=z("$ZodOptional",(t,e)=>{Oe.init(t,e),t._zod.optin="optional",t._zod.optout="optional",Ae(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Ae(t._zod,"pattern",()=>{const n=e.innerType._zod.pattern;return n?new RegExp(`^(${pa(n.source)})?$`):void 0}),t._zod.parse=(n,r)=>e.innerType._zod.optin==="optional"?e.innerType._zod.run(n,r):n.value===void 0?n:e.innerType._zod.run(n,r)}),_0=z("$ZodNullable",(t,e)=>{Oe.init(t,e),Ae(t._zod,"optin",()=>e.innerType._zod.optin),Ae(t._zod,"optout",()=>e.innerType._zod.optout),Ae(t._zod,"pattern",()=>{const n=e.innerType._zod.pattern;return n?new RegExp(`^(${pa(n.source)}|null)$`):void 0}),Ae(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(n,r)=>n.value===null?n:e.innerType._zod.run(n,r)}),y0=z("$ZodDefault",(t,e)=>{Oe.init(t,e),t._zod.optin="optional",Ae(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>{if(n.value===void 0)return n.value=e.defaultValue,n;const i=e.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>mo(s,e)):mo(i,e)}});function mo(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}const k0=z("$ZodPrefault",(t,e)=>{Oe.init(t,e),t._zod.optin="optional",Ae(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>(n.value===void 0&&(n.value=e.defaultValue),e.innerType._zod.run(n,r))}),A0=z("$ZodNonOptional",(t,e)=>{Oe.init(t,e),Ae(t._zod,"values",()=>{const n=e.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),t._zod.parse=(n,r)=>{const i=e.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>go(s,t)):go(i,t)}});function go(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}const S0=z("$ZodCatch",(t,e)=>{Oe.init(t,e),t._zod.optin="optional",Ae(t._zod,"optout",()=>e.innerType._zod.optout),Ae(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>{const i=e.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>(n.value=s.value,s.issues.length&&(n.value=e.catchValue({...n,error:{issues:s.issues.map(a=>mi(a,r,gi()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=e.catchValue({...n,error:{issues:i.issues.map(s=>mi(s,r,gi()))},input:n.value}),n.issues=[]),n)}}),C0=z("$ZodPipe",(t,e)=>{Oe.init(t,e),Ae(t._zod,"values",()=>e.in._zod.values),Ae(t._zod,"optin",()=>e.in._zod.optin),Ae(t._zod,"optout",()=>e.out._zod.optout),t._zod.parse=(n,r)=>{const i=e.in._zod.run(n,r);return i instanceof Promise?i.then(s=>bo(s,e,r)):bo(i,e,r)}});function bo(t,e,n){return hr(t)?t:e.out._zod.run({value:t.value,issues:t.issues},n)}const I0=z("$ZodReadonly",(t,e)=>{Oe.init(t,e),Ae(t._zod,"propValues",()=>e.innerType._zod.propValues),Ae(t._zod,"values",()=>e.innerType._zod.values),Ae(t._zod,"optin",()=>e.innerType._zod.optin),Ae(t._zod,"optout",()=>e.innerType._zod.optout),t._zod.parse=(n,r)=>{const i=e.innerType._zod.run(n,r);return i instanceof Promise?i.then(Eo):Eo(i)}});function Eo(t){return t.value=Object.freeze(t.value),t}const N0=z("$ZodLazy",(t,e)=>{Oe.init(t,e),Ae(t._zod,"innerType",()=>e.getter()),Ae(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),Ae(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),Ae(t._zod,"optin",()=>t._zod.innerType._zod.optin),Ae(t._zod,"optout",()=>t._zod.innerType._zod.optout),t._zod.parse=(n,r)=>t._zod.innerType._zod.run(n,r)}),w0=z("$ZodCustom",(t,e)=>{lt.init(t,e),Oe.init(t,e),t._zod.parse=(n,r)=>n,t._zod.check=n=>{const r=n.value,i=e.fn(r);if(i instanceof Promise)return i.then(s=>xo(s,n,r,t));xo(i,n,r,t)}});function xo(t,e,n,r){if(!t){const i={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),e.issues.push(Ar(i))}}class Wl{constructor(){this._map=new Map,this._idmap=new Map}add(e,...n){const r=n[0];if(this._map.set(e,r),r&&typeof r=="object"&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){const n=this._map.get(e);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(e),this}get(e){const n=e._zod.parent;if(n){const r={...this.get(n)??{}};return delete r.id,{...r,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}}function v0(){return new Wl}const ar=v0();function R0(t,e){return new t({type:"string",...ne(e)})}function O0(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...ne(e)})}function To(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...ne(e)})}function L0(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...ne(e)})}function D0(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ne(e)})}function P0(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ne(e)})}function M0(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ne(e)})}function B0(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...ne(e)})}function F0(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...ne(e)})}function z0(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...ne(e)})}function j0(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...ne(e)})}function U0(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...ne(e)})}function H0(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...ne(e)})}function $0(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...ne(e)})}function Z0(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...ne(e)})}function Y0(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...ne(e)})}function q0(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...ne(e)})}function V0(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ne(e)})}function W0(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ne(e)})}function G0(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...ne(e)})}function K0(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...ne(e)})}function Q0(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...ne(e)})}function X0(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...ne(e)})}function J0(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ne(e)})}function e1(t,e){return new t({type:"string",format:"date",check:"string_format",...ne(e)})}function t1(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...ne(e)})}function n1(t,e){return new t({type:"string",format:"duration",check:"string_format",...ne(e)})}function r1(t,e){return new t({type:"number",checks:[],...ne(e)})}function i1(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...ne(e)})}function s1(t,e){return new t({type:"boolean",...ne(e)})}function a1(t,e){return new t({type:"null",...ne(e)})}function o1(t){return new t({type:"unknown"})}function u1(t,e){return new t({type:"never",...ne(e)})}function _o(t,e){return new $l({check:"less_than",...ne(e),value:t,inclusive:!1})}function ts(t,e){return new $l({check:"less_than",...ne(e),value:t,inclusive:!0})}function yo(t,e){return new Zl({check:"greater_than",...ne(e),value:t,inclusive:!1})}function ns(t,e){return new Zl({check:"greater_than",...ne(e),value:t,inclusive:!0})}function ko(t,e){return new ym({check:"multiple_of",...ne(e),value:t})}function Gl(t,e){return new Am({check:"max_length",...ne(e),maximum:t})}function Ei(t,e){return new Sm({check:"min_length",...ne(e),minimum:t})}function Kl(t,e){return new Cm({check:"length_equals",...ne(e),length:t})}function l1(t,e){return new Im({check:"string_format",format:"regex",...ne(e),pattern:t})}function c1(t){return new Nm({check:"string_format",format:"lowercase",...ne(t)})}function d1(t){return new wm({check:"string_format",format:"uppercase",...ne(t)})}function f1(t,e){return new vm({check:"string_format",format:"includes",...ne(e),includes:t})}function h1(t,e){return new Rm({check:"string_format",format:"starts_with",...ne(e),prefix:t})}function p1(t,e){return new Om({check:"string_format",format:"ends_with",...ne(e),suffix:t})}function Fr(t){return new Lm({check:"overwrite",tx:t})}function m1(t){return Fr(e=>e.normalize(t))}function g1(){return Fr(t=>t.trim())}function b1(){return Fr(t=>t.toLowerCase())}function E1(){return Fr(t=>t.toUpperCase())}function x1(t,e,n){return new t({type:"array",element:e,...ne(n)})}function T1(t,e,n){const r=ne(n);return r.abort??(r.abort=!0),new t({type:"custom",check:"custom",fn:e,...r})}function _1(t,e,n){return new t({type:"custom",check:"custom",fn:e,...ne(n)})}class Ao{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??ar,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,n={path:[],schemaPath:[]}){var r;const i=e._zod.def,s={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},a=this.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};this.seen.set(e,o);const u=e._zod.toJSONSchema?.();if(u)o.schema=u;else{const c={...n,schemaPath:[...n.schemaPath,e],path:n.path},h=e._zod.parent;if(h)o.ref=h,this.process(h,c),this.seen.get(h).isParent=!0;else{const p=o.schema;switch(i.type){case"string":{const g=p;g.type="string";const{minimum:E,maximum:T,format:x,patterns:_,contentEncoding:b}=e._zod.bag;if(typeof E=="number"&&(g.minLength=E),typeof T=="number"&&(g.maxLength=T),x&&(g.format=s[x]??x,g.format===""&&delete g.format),b&&(g.contentEncoding=b),_&&_.size>0){const C=[..._];C.length===1?g.pattern=C[0].source:C.length>1&&(o.schema.allOf=[...C.map(w=>({...this.target==="draft-7"?{type:"string"}:{},pattern:w.source}))])}break}case"number":{const g=p,{minimum:E,maximum:T,format:x,multipleOf:_,exclusiveMaximum:b,exclusiveMinimum:C}=e._zod.bag;typeof x=="string"&&x.includes("int")?g.type="integer":g.type="number",typeof C=="number"&&(g.exclusiveMinimum=C),typeof E=="number"&&(g.minimum=E,typeof C=="number"&&(C>=E?delete g.minimum:delete g.exclusiveMinimum)),typeof b=="number"&&(g.exclusiveMaximum=b),typeof T=="number"&&(g.maximum=T,typeof b=="number"&&(b<=T?delete g.maximum:delete g.exclusiveMaximum)),typeof _=="number"&&(g.multipleOf=_);break}case"boolean":{const g=p;g.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{p.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{p.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{const g=p,{minimum:E,maximum:T}=e._zod.bag;typeof E=="number"&&(g.minItems=E),typeof T=="number"&&(g.maxItems=T),g.type="array",g.items=this.process(i.element,{...c,path:[...c.path,"items"]});break}case"object":{const g=p;g.type="object",g.properties={};const E=i.shape;for(const _ in E)g.properties[_]=this.process(E[_],{...c,path:[...c.path,"properties",_]});const T=new Set(Object.keys(E)),x=new Set([...T].filter(_=>{const b=i.shape[_]._zod;return this.io==="input"?b.optin===void 0:b.optout===void 0}));x.size>0&&(g.required=Array.from(x)),i.catchall?._zod.def.type==="never"?g.additionalProperties=!1:i.catchall?i.catchall&&(g.additionalProperties=this.process(i.catchall,{...c,path:[...c.path,"additionalProperties"]})):this.io==="output"&&(g.additionalProperties=!1);break}case"union":{const g=p;g.anyOf=i.options.map((E,T)=>this.process(E,{...c,path:[...c.path,"anyOf",T]}));break}case"intersection":{const g=p,E=this.process(i.left,{...c,path:[...c.path,"allOf",0]}),T=this.process(i.right,{...c,path:[...c.path,"allOf",1]}),x=b=>"allOf"in b&&Object.keys(b).length===1,_=[...x(E)?E.allOf:[E],...x(T)?T.allOf:[T]];g.allOf=_;break}case"tuple":{const g=p;g.type="array";const E=i.items.map((_,b)=>this.process(_,{...c,path:[...c.path,"prefixItems",b]}));if(this.target==="draft-2020-12"?g.prefixItems=E:g.items=E,i.rest){const _=this.process(i.rest,{...c,path:[...c.path,"items"]});this.target==="draft-2020-12"?g.items=_:g.additionalItems=_}i.rest&&(g.items=this.process(i.rest,{...c,path:[...c.path,"items"]}));const{minimum:T,maximum:x}=e._zod.bag;typeof T=="number"&&(g.minItems=T),typeof x=="number"&&(g.maxItems=x);break}case"record":{const g=p;g.type="object",g.propertyNames=this.process(i.keyType,{...c,path:[...c.path,"propertyNames"]}),g.additionalProperties=this.process(i.valueType,{...c,path:[...c.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{const g=p,E=kl(i.entries);E.every(T=>typeof T=="number")&&(g.type="number"),E.every(T=>typeof T=="string")&&(g.type="string"),g.enum=E;break}case"literal":{const g=p,E=[];for(const T of i.values)if(T===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof T=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");E.push(Number(T))}else E.push(T);if(E.length!==0)if(E.length===1){const T=E[0];g.type=T===null?"null":typeof T,g.const=T}else E.every(T=>typeof T=="number")&&(g.type="number"),E.every(T=>typeof T=="string")&&(g.type="string"),E.every(T=>typeof T=="boolean")&&(g.type="string"),E.every(T=>T===null)&&(g.type="null"),g.enum=E;break}case"file":{const g=p,E={type:"string",format:"binary",contentEncoding:"binary"},{minimum:T,maximum:x,mime:_}=e._zod.bag;T!==void 0&&(E.minLength=T),x!==void 0&&(E.maxLength=x),_?_.length===1?(E.contentMediaType=_[0],Object.assign(g,E)):g.anyOf=_.map(b=>({...E,contentMediaType:b})):Object.assign(g,E);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{const g=this.process(i.innerType,c);p.anyOf=[g,{type:"null"}];break}case"nonoptional":{this.process(i.innerType,c),o.ref=i.innerType;break}case"success":{const g=p;g.type="boolean";break}case"default":{this.process(i.innerType,c),o.ref=i.innerType,p.default=JSON.parse(JSON.stringify(i.defaultValue));break}case"prefault":{this.process(i.innerType,c),o.ref=i.innerType,this.io==="input"&&(p._prefault=JSON.parse(JSON.stringify(i.defaultValue)));break}case"catch":{this.process(i.innerType,c),o.ref=i.innerType;let g;try{g=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}p.default=g;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{const g=p,E=e._zod.pattern;if(!E)throw new Error("Pattern not found in template literal");g.type="string",g.pattern=E.source;break}case"pipe":{const g=this.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;this.process(g,c),o.ref=g;break}case"readonly":{this.process(i.innerType,c),o.ref=i.innerType,p.readOnly=!0;break}case"promise":{this.process(i.innerType,c),o.ref=i.innerType;break}case"optional":{this.process(i.innerType,c),o.ref=i.innerType;break}case"lazy":{const g=e._zod.innerType;this.process(g,c),o.ref=g;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}}}}const l=this.metadataRegistry.get(e);return l&&Object.assign(o.schema,l),this.io==="input"&&Ye(e)&&(delete o.schema.examples,delete o.schema.default),this.io==="input"&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,this.seen.get(e).schema}emit(e,n){const r={cycles:n?.cycles??"ref",reused:n?.reused??"inline",external:n?.external??void 0},i=this.seen.get(e);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=d=>{const c=this.target==="draft-2020-12"?"$defs":"definitions";if(r.external){const E=r.external.registry.get(d[0])?.id,T=r.external.uri??(_=>_);if(E)return{ref:T(E)};const x=d[1].defId??d[1].schema.id??`schema${this.counter++}`;return d[1].defId=x,{defId:x,ref:`${T("__shared")}#/${c}/${x}`}}if(d[1]===i)return{ref:"#"};const p=`#/${c}/`,g=d[1].schema.id??`__schema${this.counter++}`;return{defId:g,ref:p+g}},a=d=>{if(d[1].schema.$ref)return;const c=d[1],{ref:h,defId:p}=s(d);c.def={...c.schema},p&&(c.defId=p);const g=c.schema;for(const E in g)delete g[E];g.$ref=h};if(r.cycles==="throw")for(const d of this.seen.entries()){const c=d[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
28
|
+
|
|
29
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of this.seen.entries()){const c=d[1];if(e===d[0]){a(d);continue}if(r.external){const p=r.external.registry.get(d[0])?.id;if(e!==d[0]&&p){a(d);continue}}if(this.metadataRegistry.get(d[0])?.id){a(d);continue}if(c.cycle){a(d);continue}if(c.count>1&&r.reused==="ref"){a(d);continue}}const o=(d,c)=>{const h=this.seen.get(d),p=h.def??h.schema,g={...p};if(h.ref===null)return;const E=h.ref;if(h.ref=null,E){o(E,c);const T=this.seen.get(E).schema;T.$ref&&c.target==="draft-7"?(p.allOf=p.allOf??[],p.allOf.push(T)):(Object.assign(p,T),Object.assign(p,g))}h.isParent||this.override({zodSchema:d,jsonSchema:p,path:h.path??[]})};for(const d of[...this.seen.entries()].reverse())o(d[0],{target:this.target});const u={};if(this.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?u.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),r.external?.uri){const d=r.external.registry.get(e)?.id;if(!d)throw new Error("Schema is missing an `id` property");u.$id=r.external.uri(d)}Object.assign(u,i.def);const l=r.external?.defs??{};for(const d of this.seen.entries()){const c=d[1];c.def&&c.defId&&(l[c.defId]=c.def)}r.external||Object.keys(l).length>0&&(this.target==="draft-2020-12"?u.$defs=l:u.definitions=l);try{return JSON.parse(JSON.stringify(u))}catch{throw new Error("Error converting schema to JSON.")}}}function y1(t,e){if(t instanceof Wl){const r=new Ao(e),i={};for(const o of t._idmap.entries()){const[u,l]=o;r.process(l)}const s={},a={registry:t,uri:e?.uri,defs:i};for(const o of t._idmap.entries()){const[u,l]=o;s[u]=r.emit(l,{...e,external:a})}if(Object.keys(i).length>0){const o=r.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[o]:i}}return{schemas:s}}const n=new Ao(e);return n.process(t),n.emit(t,e)}function Ye(t,e){const n=e??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);const i=t._zod.def;switch(i.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return Ye(i.element,n);case"object":{for(const s in i.shape)if(Ye(i.shape[s],n))return!0;return!1}case"union":{for(const s of i.options)if(Ye(s,n))return!0;return!1}case"intersection":return Ye(i.left,n)||Ye(i.right,n);case"tuple":{for(const s of i.items)if(Ye(s,n))return!0;return!!(i.rest&&Ye(i.rest,n))}case"record":return Ye(i.keyType,n)||Ye(i.valueType,n);case"map":return Ye(i.keyType,n)||Ye(i.valueType,n);case"set":return Ye(i.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return Ye(i.innerType,n);case"lazy":return Ye(i.getter(),n);case"default":return Ye(i.innerType,n);case"prefault":return Ye(i.innerType,n);case"custom":return!1;case"transform":return!0;case"pipe":return Ye(i.in,n)||Ye(i.out,n);case"success":return!1;case"catch":return!1}throw new Error(`Unknown schema type: ${i.type}`)}function k1(t,e){const n=F.c(4);let r;n[0]!==e?(r={},n[0]=e,n[1]=r):r=n[1];const i=r,s=t??xp;let a;return n[2]!==s?(a=_p(s),n[2]=s,n[3]=a):a=n[3],Tp(s,"LLM",a,i)}function Oi(){const t=F.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=Br.decoChatOpen(),t[0]=e):e=t[0];const[n,r]=Dn(e,A1);let i;return t[1]!==n||t[2]!==r?(i=[n,r],t[1]=n,t[2]=r,t[3]=i):i=t[3],i}function A1(t){return!!(t??!1)}var Ql="vercel.ai.error",S1=Symbol.for(Ql),So,Co,Gt=class Xl extends(Co=Error,So=S1,Co){constructor({name:e,message:n,cause:r}){super(n),this[So]=!0,this.name=e,this.cause=r}static isInstance(e){return Xl.hasMarker(e,Ql)}static hasMarker(e,n){const r=Symbol.for(n);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function Jl(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var ec="AI_InvalidArgumentError",tc=`vercel.ai.error.${ec}`,C1=Symbol.for(tc),Io,No,I1=class extends(No=Gt,Io=C1,No){constructor({message:t,cause:e,argument:n}){super({name:ec,message:t,cause:e}),this[Io]=!0,this.argument=n}static isInstance(t){return Gt.hasMarker(t,tc)}},nc="AI_JSONParseError",rc=`vercel.ai.error.${nc}`,N1=Symbol.for(rc),wo,vo,Ro=class extends(vo=Gt,wo=N1,vo){constructor({text:t,cause:e}){super({name:nc,message:`JSON parsing failed: Text: ${t}.
|
|
30
|
+
Error message: ${Jl(e)}`,cause:e}),this[wo]=!0,this.text=t}static isInstance(t){return Gt.hasMarker(t,rc)}},ic="AI_TypeValidationError",sc=`vercel.ai.error.${ic}`,w1=Symbol.for(sc),Oo,Lo,Pn=class Bs extends(Lo=Gt,Oo=w1,Lo){constructor({value:e,cause:n}){super({name:ic,message:`Type validation failed: Value: ${JSON.stringify(e)}.
|
|
31
|
+
Error message: ${Jl(n)}`,cause:n}),this[Oo]=!0,this.value=e}static isInstance(e){return Gt.hasMarker(e,sc)}static wrap({value:e,cause:n}){return Bs.isInstance(n)&&n.value===e?n:new Bs({value:e,cause:n})}};const v1=z("ZodISODateTime",(t,e)=>{Vm.init(t,e),ze.init(t,e)});function R1(t){return J0(v1,t)}const O1=z("ZodISODate",(t,e)=>{Wm.init(t,e),ze.init(t,e)});function L1(t){return e1(O1,t)}const D1=z("ZodISOTime",(t,e)=>{Gm.init(t,e),ze.init(t,e)});function P1(t){return t1(D1,t)}const M1=z("ZodISODuration",(t,e)=>{Km.init(t,e),ze.init(t,e)});function B1(t){return n1(M1,t)}const F1=(t,e)=>{zh.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:n=>Uh(t,n)},flatten:{value:n=>jh(t,n)},addIssue:{value:n=>t.issues.push(n)},addIssues:{value:n=>t.issues.push(...n)},isEmpty:{get(){return t.issues.length===0}}})},Li=z("ZodError",F1,{Parent:Error}),z1=$h(Li),j1=Yh(Li),U1=Zh(Li),ac=Hh(Li),Fe=z("ZodType",(t,e)=>(Oe.init(t,e),t.def=e,Object.defineProperty(t,"_def",{value:e}),t.check=(...n)=>t.clone({...e,checks:[...e.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),t.clone=(n,r)=>Xh(t,n,r),t.brand=()=>t,t.register=((n,r)=>(n.add(t,r),t)),t.parse=(n,r)=>z1(t,n,r,{callee:t.parse}),t.safeParse=(n,r)=>U1(t,n,r),t.parseAsync=async(n,r)=>j1(t,n,r,{callee:t.parseAsync}),t.safeParseAsync=async(n,r)=>ac(t,n,r),t.spa=t.safeParseAsync,t.refine=(n,r)=>t.check(Mg(n,r)),t.superRefine=n=>t.check(Bg(n)),t.overwrite=n=>t.check(Fr(n)),t.optional=()=>Mo(t),t.nullable=()=>Bo(t),t.nullish=()=>Mo(Bo(t)),t.nonoptional=n=>Ig(t,n),t.array=()=>Hn(t),t.or=n=>rt([t,n]),t.and=n=>bg(t,n),t.transform=n=>Fo(t,_g(n)),t.default=n=>Ag(t,n),t.prefault=n=>Cg(t,n),t.catch=n=>wg(t,n),t.pipe=n=>Fo(t,n),t.readonly=()=>Og(t),t.describe=n=>{const r=t.clone();return ar.add(r,{description:n}),r},Object.defineProperty(t,"description",{get(){return ar.get(t)?.description},configurable:!0}),t.meta=(...n)=>{if(n.length===0)return ar.get(t);const r=t.clone();return ar.add(r,n[0]),r},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),oc=z("_ZodString",(t,e)=>{ba.init(t,e),Fe.init(t,e);const n=t._zod.bag;t.format=n.format??null,t.minLength=n.minimum??null,t.maxLength=n.maximum??null,t.regex=(...r)=>t.check(l1(...r)),t.includes=(...r)=>t.check(f1(...r)),t.startsWith=(...r)=>t.check(h1(...r)),t.endsWith=(...r)=>t.check(p1(...r)),t.min=(...r)=>t.check(Ei(...r)),t.max=(...r)=>t.check(Gl(...r)),t.length=(...r)=>t.check(Kl(...r)),t.nonempty=(...r)=>t.check(Ei(1,...r)),t.lowercase=r=>t.check(c1(r)),t.uppercase=r=>t.check(d1(r)),t.trim=()=>t.check(g1()),t.normalize=(...r)=>t.check(m1(...r)),t.toLowerCase=()=>t.check(b1()),t.toUpperCase=()=>t.check(E1())}),H1=z("ZodString",(t,e)=>{ba.init(t,e),oc.init(t,e),t.email=n=>t.check(O0($1,n)),t.url=n=>t.check(B0(Z1,n)),t.jwt=n=>t.check(X0(sg,n)),t.emoji=n=>t.check(F0(Y1,n)),t.guid=n=>t.check(To(Do,n)),t.uuid=n=>t.check(L0(Qr,n)),t.uuidv4=n=>t.check(D0(Qr,n)),t.uuidv6=n=>t.check(P0(Qr,n)),t.uuidv7=n=>t.check(M0(Qr,n)),t.nanoid=n=>t.check(z0(q1,n)),t.guid=n=>t.check(To(Do,n)),t.cuid=n=>t.check(j0(V1,n)),t.cuid2=n=>t.check(U0(W1,n)),t.ulid=n=>t.check(H0(G1,n)),t.base64=n=>t.check(G0(ng,n)),t.base64url=n=>t.check(K0(rg,n)),t.xid=n=>t.check($0(K1,n)),t.ksuid=n=>t.check(Z0(Q1,n)),t.ipv4=n=>t.check(Y0(X1,n)),t.ipv6=n=>t.check(q0(J1,n)),t.cidrv4=n=>t.check(V0(eg,n)),t.cidrv6=n=>t.check(W0(tg,n)),t.e164=n=>t.check(Q0(ig,n)),t.datetime=n=>t.check(R1(n)),t.date=n=>t.check(L1(n)),t.time=n=>t.check(P1(n)),t.duration=n=>t.check(B1(n))});function G(t){return R0(H1,t)}const ze=z("ZodStringFormat",(t,e)=>{Be.init(t,e),oc.init(t,e)}),$1=z("ZodEmail",(t,e)=>{Fm.init(t,e),ze.init(t,e)}),Do=z("ZodGUID",(t,e)=>{Mm.init(t,e),ze.init(t,e)}),Qr=z("ZodUUID",(t,e)=>{Bm.init(t,e),ze.init(t,e)}),Z1=z("ZodURL",(t,e)=>{zm.init(t,e),ze.init(t,e)}),Y1=z("ZodEmoji",(t,e)=>{jm.init(t,e),ze.init(t,e)}),q1=z("ZodNanoID",(t,e)=>{Um.init(t,e),ze.init(t,e)}),V1=z("ZodCUID",(t,e)=>{Hm.init(t,e),ze.init(t,e)}),W1=z("ZodCUID2",(t,e)=>{$m.init(t,e),ze.init(t,e)}),G1=z("ZodULID",(t,e)=>{Zm.init(t,e),ze.init(t,e)}),K1=z("ZodXID",(t,e)=>{Ym.init(t,e),ze.init(t,e)}),Q1=z("ZodKSUID",(t,e)=>{qm.init(t,e),ze.init(t,e)}),X1=z("ZodIPv4",(t,e)=>{Qm.init(t,e),ze.init(t,e)}),J1=z("ZodIPv6",(t,e)=>{Xm.init(t,e),ze.init(t,e)}),eg=z("ZodCIDRv4",(t,e)=>{Jm.init(t,e),ze.init(t,e)}),tg=z("ZodCIDRv6",(t,e)=>{e0.init(t,e),ze.init(t,e)}),ng=z("ZodBase64",(t,e)=>{t0.init(t,e),ze.init(t,e)}),rg=z("ZodBase64URL",(t,e)=>{r0.init(t,e),ze.init(t,e)}),ig=z("ZodE164",(t,e)=>{i0.init(t,e),ze.init(t,e)}),sg=z("ZodJWT",(t,e)=>{a0.init(t,e),ze.init(t,e)}),uc=z("ZodNumber",(t,e)=>{ql.init(t,e),Fe.init(t,e),t.gt=(r,i)=>t.check(yo(r,i)),t.gte=(r,i)=>t.check(ns(r,i)),t.min=(r,i)=>t.check(ns(r,i)),t.lt=(r,i)=>t.check(_o(r,i)),t.lte=(r,i)=>t.check(ts(r,i)),t.max=(r,i)=>t.check(ts(r,i)),t.int=r=>t.check(Po(r)),t.safe=r=>t.check(Po(r)),t.positive=r=>t.check(yo(0,r)),t.nonnegative=r=>t.check(ns(0,r)),t.negative=r=>t.check(_o(0,r)),t.nonpositive=r=>t.check(ts(0,r)),t.multipleOf=(r,i)=>t.check(ko(r,i)),t.step=(r,i)=>t.check(ko(r,i)),t.finite=()=>t;const n=t._zod.bag;t.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),t.isFinite=!0,t.format=n.format??null});function ag(t){return r1(uc,t)}const og=z("ZodNumberFormat",(t,e)=>{o0.init(t,e),uc.init(t,e)});function Po(t){return i1(og,t)}const ug=z("ZodBoolean",(t,e)=>{u0.init(t,e),Fe.init(t,e)});function et(t){return s1(ug,t)}const lg=z("ZodNull",(t,e)=>{l0.init(t,e),Fe.init(t,e)});function cg(t){return a1(lg,t)}const dg=z("ZodUnknown",(t,e)=>{c0.init(t,e),Fe.init(t,e)});function Nt(){return o1(dg)}const fg=z("ZodNever",(t,e)=>{d0.init(t,e),Fe.init(t,e)});function lc(t){return u1(fg,t)}const hg=z("ZodArray",(t,e)=>{f0.init(t,e),Fe.init(t,e),t.element=e.element,t.min=(n,r)=>t.check(Ei(n,r)),t.nonempty=n=>t.check(Ei(1,n)),t.max=(n,r)=>t.check(Gl(n,r)),t.length=(n,r)=>t.check(Kl(n,r)),t.unwrap=()=>t.element});function Hn(t,e){return x1(hg,t,e)}const cc=z("ZodObject",(t,e)=>{h0.init(t,e),Fe.init(t,e),Ae(t,"shape",()=>e.shape),t.keyof=()=>fc(Object.keys(t._zod.def.shape)),t.catchall=n=>t.clone({...t._zod.def,catchall:n}),t.passthrough=()=>t.clone({...t._zod.def,catchall:Nt()}),t.loose=()=>t.clone({...t._zod.def,catchall:Nt()}),t.strict=()=>t.clone({...t._zod.def,catchall:lc()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=n=>qh(t,n),t.merge=n=>Vh(t,n),t.pick=n=>Wh(t,n),t.omit=n=>Gh(t,n),t.partial=(...n)=>Kh(hc,t,n[0]),t.required=(...n)=>Qh(pc,t,n[0])});function we(t,e){const n={type:"object",get shape(){return Al(this,"shape",{...t}),this.shape},...ne(e)};return new cc(n)}function Le(t,e){return new cc({type:"object",get shape(){return Al(this,"shape",{...t}),this.shape},catchall:lc(),...ne(e)})}const dc=z("ZodUnion",(t,e)=>{Vl.init(t,e),Fe.init(t,e),t.options=e.options});function rt(t,e){return new dc({type:"union",options:t,...ne(e)})}const pg=z("ZodDiscriminatedUnion",(t,e)=>{dc.init(t,e),p0.init(t,e)});function mg(t,e,n){return new pg({type:"union",options:e,discriminator:t,...ne(n)})}const gg=z("ZodIntersection",(t,e)=>{m0.init(t,e),Fe.init(t,e)});function bg(t,e){return new gg({type:"intersection",left:t,right:e})}const Eg=z("ZodRecord",(t,e)=>{g0.init(t,e),Fe.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function Sr(t,e,n){return new Eg({type:"record",keyType:t,valueType:e,...ne(n)})}const Fs=z("ZodEnum",(t,e)=>{b0.init(t,e),Fe.init(t,e),t.enum=e.entries,t.options=Object.values(e.entries);const n=new Set(Object.keys(e.entries));t.extract=(r,i)=>{const s={};for(const a of r)if(n.has(a))s[a]=e.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Fs({...e,checks:[],...ne(i),entries:s})},t.exclude=(r,i)=>{const s={...e.entries};for(const a of r)if(n.has(a))delete s[a];else throw new Error(`Key ${a} not found in enum`);return new Fs({...e,checks:[],...ne(i),entries:s})}});function fc(t,e){const n=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new Fs({type:"enum",entries:n,...ne(e)})}const xg=z("ZodLiteral",(t,e)=>{E0.init(t,e),Fe.init(t,e),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function oe(t,e){return new xg({type:"literal",values:Array.isArray(t)?t:[t],...ne(e)})}const Tg=z("ZodTransform",(t,e)=>{x0.init(t,e),Fe.init(t,e),t._zod.parse=(n,r)=>{n.addIssue=s=>{if(typeof s=="string")n.issues.push(Ar(s,n.value,e));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=t),a.continue??(a.continue=!0),n.issues.push(Ar(a))}};const i=e.transform(n.value,n);return i instanceof Promise?i.then(s=>(n.value=s,n)):(n.value=i,n)}});function _g(t){return new Tg({type:"transform",transform:t})}const hc=z("ZodOptional",(t,e)=>{T0.init(t,e),Fe.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Mo(t){return new hc({type:"optional",innerType:t})}const yg=z("ZodNullable",(t,e)=>{_0.init(t,e),Fe.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Bo(t){return new yg({type:"nullable",innerType:t})}const kg=z("ZodDefault",(t,e)=>{y0.init(t,e),Fe.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function Ag(t,e){return new kg({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}const Sg=z("ZodPrefault",(t,e)=>{k0.init(t,e),Fe.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Cg(t,e){return new Sg({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}const pc=z("ZodNonOptional",(t,e)=>{A0.init(t,e),Fe.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Ig(t,e){return new pc({type:"nonoptional",innerType:t,...ne(e)})}const Ng=z("ZodCatch",(t,e)=>{S0.init(t,e),Fe.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function wg(t,e){return new Ng({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}const vg=z("ZodPipe",(t,e)=>{C0.init(t,e),Fe.init(t,e),t.in=e.in,t.out=e.out});function Fo(t,e){return new vg({type:"pipe",in:t,out:e})}const Rg=z("ZodReadonly",(t,e)=>{I0.init(t,e),Fe.init(t,e)});function Og(t){return new Rg({type:"readonly",innerType:t})}const Lg=z("ZodLazy",(t,e)=>{N0.init(t,e),Fe.init(t,e),t.unwrap=()=>t._zod.def.getter()});function Dg(t){return new Lg({type:"lazy",getter:t})}const Ea=z("ZodCustom",(t,e)=>{w0.init(t,e),Fe.init(t,e)});function Pg(t){const e=new lt({check:"custom"});return e._zod.check=t,e}function mc(t,e){return T1(Ea,t??(()=>!0),e)}function Mg(t,e={}){return _1(Ea,t,e)}function Bg(t){const e=Pg(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Ar(r,n.value,e._zod.def));else{const i=r;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=e),i.continue??(i.continue=!e._zod.def.abort),n.issues.push(Ar(i))}},t(n.value,n)));return e}function xi(t,e={error:`Input not instance of ${t.name}`}){const n=new Ea({type:"custom",check:"custom",fn:r=>r instanceof t,abort:!0,...ne(e)});return n._zod.bag.Class=t,n}var zr=({prefix:t,size:e=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const i=()=>{const s=n.length,a=new Array(e);for(let o=0;o<e;o++)a[o]=n[Math.random()*s|0];return a.join("")};if(t==null)return i;if(n.includes(r))throw new I1({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${t}${r}${i()}`},Fg=zr();function zo(t=globalThis){var e,n,r;return t.window?"runtime/browser":(e=t.navigator)!=null&&e.userAgent?`runtime/${t.navigator.userAgent.toLowerCase()}`:(r=(n=t.process)==null?void 0:n.versions)!=null&&r.node?`runtime/node.js/${t.process.version.substring(0)}`:t.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function an(t){if(t==null)return{};const e={};if(t instanceof Headers)t.forEach((n,r)=>{e[r.toLowerCase()]=n});else{Array.isArray(t)||(t=Object.entries(t));for(const[n,r]of t)r!=null&&(e[n.toLowerCase()]=r)}return e}function jo(t,...e){const n=new Headers(an(t)),r=n.get("user-agent")||"";return n.set("user-agent",[r,...e].filter(Boolean).join(" ")),Object.fromEntries(n.entries())}var zg=/"__proto__"\s*:/,jg=/"constructor"\s*:/;function Uo(t){const e=JSON.parse(t);return e===null||typeof e!="object"||zg.test(t)===!1&&jg.test(t)===!1?e:Ug(e)}function Ug(t){let e=[t];for(;e.length;){const n=e;e=[];for(const r of n){if(Object.prototype.hasOwnProperty.call(r,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(r,"constructor")&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const i in r){const s=r[i];s&&typeof s=="object"&&e.push(s)}}}return t}function Hg(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return Uo(t)}try{return Uo(t)}finally{Error.stackTraceLimit=e}}function oi(t){if(t.type==="object"){t.additionalProperties=!1;const e=t.properties;if(e!=null)for(const n in e)e[n]=oi(e[n])}return t.type==="array"&&t.items!=null&&(Array.isArray(t.items)?t.items=t.items.map(e=>oi(e)):t.items=oi(t.items)),t}var $g=Symbol("Let zodToJsonSchema decide on which parser to use"),Ho={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},Zg=t=>typeof t=="string"?{...Ho,name:t}:{...Ho,...t};function mt(){return{}}function Yg(t,e){var n,r,i;const s={type:"array"};return(n=t.type)!=null&&n._def&&((i=(r=t.type)==null?void 0:r._def)==null?void 0:i.typeName)!==pe.ZodAny&&(s.items=Ie(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(s.minItems=t.minLength.value),t.maxLength&&(s.maxItems=t.maxLength.value),t.exactLength&&(s.minItems=t.exactLength.value,s.maxItems=t.exactLength.value),s}function qg(t){const e={type:"integer",format:"int64"};if(!t.checks)return e;for(const n of t.checks)switch(n.kind){case"min":n.inclusive?e.minimum=n.value:e.exclusiveMinimum=n.value;break;case"max":n.inclusive?e.maximum=n.value:e.exclusiveMaximum=n.value;break;case"multipleOf":e.multipleOf=n.value;break}return e}function Vg(){return{type:"boolean"}}function gc(t,e){return Ie(t.type._def,e)}var Wg=(t,e)=>Ie(t.innerType._def,e);function bc(t,e,n){const r=n??e.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((i,s)=>bc(t,e,i))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Gg(t)}}var Gg=t=>{const e={type:"integer",format:"unix-time"};for(const n of t.checks)switch(n.kind){case"min":e.minimum=n.value;break;case"max":e.maximum=n.value;break}return e};function Kg(t,e){return{...Ie(t.innerType._def,e),default:t.defaultValue()}}function Qg(t,e){return e.effectStrategy==="input"?Ie(t.schema._def,e):mt()}function Xg(t){return{type:"string",enum:Array.from(t.values)}}var Jg=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function eb(t,e){const n=[Ie(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),Ie(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(i=>!!i),r=[];return n.forEach(i=>{if(Jg(i))r.push(...i.allOf);else{let s=i;if("additionalProperties"in i&&i.additionalProperties===!1){const{additionalProperties:a,...o}=i;s=o}r.push(s)}}),r.length?{allOf:r}:void 0}function tb(t){const e=typeof t.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(t.value)?"array":"object"}:{type:e==="bigint"?"integer":e,const:t.value}}var rs=void 0,Tt={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(rs===void 0&&(rs=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),rs),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function Ec(t,e){const n={type:"string"};if(t.checks)for(const r of t.checks)switch(r.kind){case"min":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value;break;case"max":n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"email":switch(e.emailStrategy){case"format:email":_t(n,"email",r.message,e);break;case"format:idn-email":_t(n,"idn-email",r.message,e);break;case"pattern:zod":Je(n,Tt.email,r.message,e);break}break;case"url":_t(n,"uri",r.message,e);break;case"uuid":_t(n,"uuid",r.message,e);break;case"regex":Je(n,r.regex,r.message,e);break;case"cuid":Je(n,Tt.cuid,r.message,e);break;case"cuid2":Je(n,Tt.cuid2,r.message,e);break;case"startsWith":Je(n,RegExp(`^${is(r.value,e)}`),r.message,e);break;case"endsWith":Je(n,RegExp(`${is(r.value,e)}$`),r.message,e);break;case"datetime":_t(n,"date-time",r.message,e);break;case"date":_t(n,"date",r.message,e);break;case"time":_t(n,"time",r.message,e);break;case"duration":_t(n,"duration",r.message,e);break;case"length":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value,n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"includes":{Je(n,RegExp(is(r.value,e)),r.message,e);break}case"ip":{r.version!=="v6"&&_t(n,"ipv4",r.message,e),r.version!=="v4"&&_t(n,"ipv6",r.message,e);break}case"base64url":Je(n,Tt.base64url,r.message,e);break;case"jwt":Je(n,Tt.jwt,r.message,e);break;case"cidr":{r.version!=="v6"&&Je(n,Tt.ipv4Cidr,r.message,e),r.version!=="v4"&&Je(n,Tt.ipv6Cidr,r.message,e);break}case"emoji":Je(n,Tt.emoji(),r.message,e);break;case"ulid":{Je(n,Tt.ulid,r.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{_t(n,"binary",r.message,e);break}case"contentEncoding:base64":{n.contentEncoding="base64";break}case"pattern:zod":{Je(n,Tt.base64,r.message,e);break}}break}case"nanoid":Je(n,Tt.nanoid,r.message,e)}return n}function is(t,e){return e.patternStrategy==="escape"?rb(t):t}var nb=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function rb(t){let e="";for(let n=0;n<t.length;n++)nb.has(t[n])||(e+="\\"),e+=t[n];return e}function _t(t,e,n,r){var i;t.format||(i=t.anyOf)!=null&&i.some(s=>s.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...n&&r.errorMessages&&{errorMessage:{format:n}}})):t.format=e}function Je(t,e,n,r){var i;t.pattern||(i=t.allOf)!=null&&i.some(s=>s.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:$o(e,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):t.pattern=$o(e,r)}function $o(t,e){var n;if(!e.applyRegexFlags||!t.flags)return t.source;const r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},i=r.i?t.source.toLowerCase():t.source;let s="",a=!1,o=!1,u=!1;for(let l=0;l<i.length;l++){if(a){s+=i[l],a=!1;continue}if(r.i){if(o){if(i[l].match(/[a-z]/)){u?(s+=i[l],s+=`${i[l-2]}-${i[l]}`.toUpperCase(),u=!1):i[l+1]==="-"&&((n=i[l+2])!=null&&n.match(/[a-z]/))?(s+=i[l],u=!0):s+=`${i[l]}${i[l].toUpperCase()}`;continue}}else if(i[l].match(/[a-z]/)){s+=`[${i[l]}${i[l].toUpperCase()}]`;continue}}if(r.m){if(i[l]==="^"){s+=`(^|(?<=[\r
|
|
32
|
+
]))`;continue}else if(i[l]==="$"){s+=`($|(?=[\r
|
|
33
|
+
]))`;continue}}if(r.s&&i[l]==="."){s+=o?`${i[l]}\r
|
|
34
|
+
`:`[${i[l]}\r
|
|
35
|
+
]`;continue}s+=i[l],i[l]==="\\"?a=!0:o&&i[l]==="]"?o=!1:!o&&i[l]==="["&&(o=!0)}try{new RegExp(s)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return s}function xc(t,e){var n,r,i,s,a,o;const u={type:"object",additionalProperties:(n=Ie(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]}))!=null?n:e.allowedAdditionalProperties};if(((r=t.keyType)==null?void 0:r._def.typeName)===pe.ZodString&&((i=t.keyType._def.checks)!=null&&i.length)){const{type:l,...d}=Ec(t.keyType._def,e);return{...u,propertyNames:d}}else{if(((s=t.keyType)==null?void 0:s._def.typeName)===pe.ZodEnum)return{...u,propertyNames:{enum:t.keyType._def.values}};if(((a=t.keyType)==null?void 0:a._def.typeName)===pe.ZodBranded&&t.keyType._def.type._def.typeName===pe.ZodString&&((o=t.keyType._def.type._def.checks)!=null&&o.length)){const{type:l,...d}=gc(t.keyType._def,e);return{...u,propertyNames:d}}}return u}function ib(t,e){if(e.mapStrategy==="record")return xc(t,e);const n=Ie(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||mt(),r=Ie(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||mt();return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function sb(t){const e=t.values,r=Object.keys(t.values).filter(s=>typeof e[e[s]]!="number").map(s=>e[s]),i=Array.from(new Set(r.map(s=>typeof s)));return{type:i.length===1?i[0]==="string"?"string":"number":["string","number"],enum:r}}function ab(){return{not:mt()}}function ob(){return{type:"null"}}var zs={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function ub(t,e){const n=t.options instanceof Map?Array.from(t.options.values()):t.options;if(n.every(r=>r._def.typeName in zs&&(!r._def.checks||!r._def.checks.length))){const r=n.reduce((i,s)=>{const a=zs[s._def.typeName];return a&&!i.includes(a)?[...i,a]:i},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){const r=n.reduce((i,s)=>{const a=typeof s._def.value;switch(a){case"string":case"number":case"boolean":return[...i,a];case"bigint":return[...i,"integer"];case"object":if(s._def.value===null)return[...i,"null"];default:return i}},[]);if(r.length===n.length){const i=r.filter((s,a,o)=>o.indexOf(s)===a);return{type:i.length>1?i:i[0],enum:n.reduce((s,a)=>s.includes(a._def.value)?s:[...s,a._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,i)=>[...r,...i._def.values.filter(s=>!r.includes(s))],[])};return lb(t,e)}var lb=(t,e)=>{const n=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((r,i)=>Ie(r._def,{...e,currentPath:[...e.currentPath,"anyOf",`${i}`]})).filter(r=>!!r&&(!e.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return n.length?{anyOf:n}:void 0};function cb(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return{type:[zs[t.innerType._def.typeName],"null"]};const n=Ie(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function db(t){const e={type:"number"};if(!t.checks)return e;for(const n of t.checks)switch(n.kind){case"int":e.type="integer";break;case"min":n.inclusive?e.minimum=n.value:e.exclusiveMinimum=n.value;break;case"max":n.inclusive?e.maximum=n.value:e.exclusiveMaximum=n.value;break;case"multipleOf":e.multipleOf=n.value;break}return e}function fb(t,e){const n={type:"object",properties:{}},r=[],i=t.shape();for(const a in i){let o=i[a];if(o===void 0||o._def===void 0)continue;const u=pb(o),l=Ie(o._def,{...e,currentPath:[...e.currentPath,"properties",a],propertyPath:[...e.currentPath,"properties",a]});l!==void 0&&(n.properties[a]=l,u||r.push(a))}r.length&&(n.required=r);const s=hb(t,e);return s!==void 0&&(n.additionalProperties=s),n}function hb(t,e){if(t.catchall._def.typeName!=="ZodNever")return Ie(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function pb(t){try{return t.isOptional()}catch{return!0}}var mb=(t,e)=>{var n;if(e.currentPath.toString()===((n=e.propertyPath)==null?void 0:n.toString()))return Ie(t.innerType._def,e);const r=Ie(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:mt()},r]}:mt()},gb=(t,e)=>{if(e.pipeStrategy==="input")return Ie(t.in._def,e);if(e.pipeStrategy==="output")return Ie(t.out._def,e);const n=Ie(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),r=Ie(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(i=>i!==void 0)}};function bb(t,e){return Ie(t.type._def,e)}function Eb(t,e){const r={type:"array",uniqueItems:!0,items:Ie(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&(r.minItems=t.minSize.value),t.maxSize&&(r.maxItems=t.maxSize.value),r}function xb(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((n,r)=>Ie(n._def,{...e,currentPath:[...e.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:Ie(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((n,r)=>Ie(n._def,{...e,currentPath:[...e.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function Tb(){return{not:mt()}}function _b(){return mt()}var yb=(t,e)=>Ie(t.innerType._def,e),kb=(t,e,n)=>{switch(e){case pe.ZodString:return Ec(t,n);case pe.ZodNumber:return db(t);case pe.ZodObject:return fb(t,n);case pe.ZodBigInt:return qg(t);case pe.ZodBoolean:return Vg();case pe.ZodDate:return bc(t,n);case pe.ZodUndefined:return Tb();case pe.ZodNull:return ob();case pe.ZodArray:return Yg(t,n);case pe.ZodUnion:case pe.ZodDiscriminatedUnion:return ub(t,n);case pe.ZodIntersection:return eb(t,n);case pe.ZodTuple:return xb(t,n);case pe.ZodRecord:return xc(t,n);case pe.ZodLiteral:return tb(t);case pe.ZodEnum:return Xg(t);case pe.ZodNativeEnum:return sb(t);case pe.ZodNullable:return cb(t,n);case pe.ZodOptional:return mb(t,n);case pe.ZodMap:return ib(t,n);case pe.ZodSet:return Eb(t,n);case pe.ZodLazy:return()=>t.getter()._def;case pe.ZodPromise:return bb(t,n);case pe.ZodNaN:case pe.ZodNever:return ab();case pe.ZodEffects:return Qg(t,n);case pe.ZodAny:return mt();case pe.ZodUnknown:return _b();case pe.ZodDefault:return Kg(t,n);case pe.ZodBranded:return gc(t,n);case pe.ZodReadonly:return yb(t,n);case pe.ZodCatch:return Wg(t,n);case pe.ZodPipeline:return gb(t,n);case pe.ZodFunction:case pe.ZodVoid:case pe.ZodSymbol:return;default:return(r=>{})()}},Ab=(t,e)=>{let n=0;for(;n<t.length&&n<e.length&&t[n]===e[n];n++);return[(t.length-n).toString(),...e.slice(n)].join("/")};function Ie(t,e,n=!1){var r;const i=e.seen.get(t);if(e.override){const u=(r=e.override)==null?void 0:r.call(e,t,e,i,n);if(u!==$g)return u}if(i&&!n){const u=Sb(i,e);if(u!==void 0)return u}const s={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,s);const a=kb(t,t.typeName,e),o=typeof a=="function"?Ie(a(),e):a;if(o&&Cb(t,e,o),e.postProcess){const u=e.postProcess(o,t,e);return s.jsonSchema=o,u}return s.jsonSchema=o,o}var Sb=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:Ab(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((n,r)=>e.currentPath[r]===n)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),mt()):e.$refStrategy==="seen"?mt():void 0}},Cb=(t,e,n)=>(t.description&&(n.description=t.description),n),Ib=t=>{const e=Zg(t),n=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([r,i])=>[i._def,{def:i._def,path:[...e.basePath,e.definitionPath,r],jsonSchema:void 0}]))}},Nb=(t,e)=>{var n;const r=Ib(e);let i=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((l,[d,c])=>{var h;return{...l,[d]:(h=Ie(c._def,{...r,currentPath:[...r.basePath,r.definitionPath,d]},!0))!=null?h:mt()}},{}):void 0;const s=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,a=(n=Ie(t._def,s===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,s]},!1))!=null?n:mt(),o=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;o!==void 0&&(a.title=o);const u=s===void 0?i?{...a,[r.definitionPath]:i}:a:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,s].join("/"),[r.definitionPath]:{...i,[s]:a}};return u.$schema="http://json-schema.org/draft-07/schema#",u},js=Symbol.for("vercel.ai.schema");function wb(t){let e;return()=>(e==null&&(e=t()),e)}function Di(t,{validate:e}={}){return{[js]:!0,_type:void 0,get jsonSchema(){return typeof t=="function"&&(t=t()),t},validate:e}}function vb(t){return typeof t=="object"&&t!==null&&js in t&&t[js]===!0&&"jsonSchema"in t&&"validate"in t}function xa(t){return t==null?Di({properties:{},additionalProperties:!1}):vb(t)?t:"~standard"in t?t["~standard"].vendor==="zod"?Tc(t):Rb(t):t()}function Rb(t){return Di(()=>t["~standard"].jsonSchema.input({target:"draft-07"}),{validate:async e=>{const n=await t["~standard"].validate(e);return"value"in n?{success:!0,value:n.value}:{success:!1,error:new Pn({value:e,cause:n.issues})}}})}function Ob(t,e){var n;const r=(n=void 0)!=null?n:!1;return Di(()=>Nb(t,{$refStrategy:r?"root":"none"}),{validate:async i=>{const s=await t.safeParseAsync(i);return s.success?{success:!0,value:s.data}:{success:!1,error:s.error}}})}function Lb(t,e){var n;const r=(n=void 0)!=null?n:!1;return Di(()=>oi(y1(t,{target:"draft-7",io:"input",reused:r?"ref":"inline"})),{validate:async i=>{const s=await ac(t,i);return s.success?{success:!0,value:s.data}:{success:!1,error:s.error}}})}function Db(t){return"_zod"in t}function Tc(t,e){return Db(t)?Lb(t):Ob(t)}async function Zo({value:t,schema:e}){const n=await Cr({value:t,schema:e});if(!n.success)throw Pn.wrap({value:t,cause:n.error});return n.value}async function Cr({value:t,schema:e}){const n=xa(e);try{if(n.validate==null)return{success:!0,value:t,rawValue:t};const r=await n.validate(t);return r.success?{success:!0,value:r.value,rawValue:t}:{success:!1,error:Pn.wrap({value:t,cause:r.error}),rawValue:t}}catch(r){return{success:!1,error:Pn.wrap({value:t,cause:r}),rawValue:t}}}async function hn({text:t,schema:e}){try{const n=Hg(t);return e==null?{success:!0,value:n,rawValue:n}:await Cr({value:n,schema:e})}catch(n){return{success:!1,error:Ro.isInstance(n)?n:new Ro({text:t,cause:n}),rawValue:void 0}}}function Pb({stream:t,schema:e}){return t.pipeThrough(new TextDecoderStream).pipeThrough(new Sp).pipeThrough(new TransformStream({async transform({data:n},r){n!=="[DONE]"&&r.enqueue(await hn({text:n,schema:e}))}}))}async function Yt(t){return typeof t=="function"&&(t=t()),Promise.resolve(t)}var Mb=Object.defineProperty,Bb=(t,e)=>{for(var n in e)Mb(t,n,{get:e[n],enumerable:!0})},_c="AI_NoObjectGeneratedError",yc=`vercel.ai.error.${_c}`,Fb=Symbol.for(yc),kc,Wt=class extends Gt{constructor({message:t="No object generated.",cause:e,text:n,response:r,usage:i,finishReason:s}){super({name:_c,message:t,cause:e}),this[kc]=!0,this.text=n,this.response=r,this.usage=i,this.finishReason=s}static isInstance(t){return Gt.hasMarker(t,yc)}};kc=Fb;var Yo="6.0.3",Ac=rt([G(),xi(Uint8Array),xi(ArrayBuffer),mc(t=>{var e,n;return(n=(e=globalThis.Buffer)==null?void 0:e.isBuffer(t))!=null?n:!1},{message:"Must be a Buffer"})]),Ir=Dg(()=>rt([cg(),G(),ag(),et(),Sr(G(),Ir.optional()),Hn(Ir)])),_e=Sr(G(),Sr(G(),Ir.optional())),Sc=we({type:oe("text"),text:G(),providerOptions:_e.optional()}),zb=we({type:oe("image"),image:rt([Ac,xi(URL)]),mediaType:G().optional(),providerOptions:_e.optional()}),Cc=we({type:oe("file"),data:rt([Ac,xi(URL)]),filename:G().optional(),mediaType:G(),providerOptions:_e.optional()}),jb=we({type:oe("reasoning"),text:G(),providerOptions:_e.optional()}),Ub=we({type:oe("tool-call"),toolCallId:G(),toolName:G(),input:Nt(),providerOptions:_e.optional(),providerExecuted:et().optional()}),Hb=mg("type",[we({type:oe("text"),value:G(),providerOptions:_e.optional()}),we({type:oe("json"),value:Ir,providerOptions:_e.optional()}),we({type:oe("execution-denied"),reason:G().optional(),providerOptions:_e.optional()}),we({type:oe("error-text"),value:G(),providerOptions:_e.optional()}),we({type:oe("error-json"),value:Ir,providerOptions:_e.optional()}),we({type:oe("content"),value:Hn(rt([we({type:oe("text"),text:G(),providerOptions:_e.optional()}),we({type:oe("media"),data:G(),mediaType:G()}),we({type:oe("file-data"),data:G(),mediaType:G(),filename:G().optional(),providerOptions:_e.optional()}),we({type:oe("file-url"),url:G(),providerOptions:_e.optional()}),we({type:oe("file-id"),fileId:rt([G(),Sr(G(),G())]),providerOptions:_e.optional()}),we({type:oe("image-data"),data:G(),mediaType:G(),providerOptions:_e.optional()}),we({type:oe("image-url"),url:G(),providerOptions:_e.optional()}),we({type:oe("image-file-id"),fileId:rt([G(),Sr(G(),G())]),providerOptions:_e.optional()}),we({type:oe("custom"),providerOptions:_e.optional()})]))})]),Ic=we({type:oe("tool-result"),toolCallId:G(),toolName:G(),output:Hb,providerOptions:_e.optional()}),$b=we({type:oe("tool-approval-request"),approvalId:G(),toolCallId:G()}),Zb=we({type:oe("tool-approval-response"),approvalId:G(),approved:et(),reason:G().optional()}),Yb=we({role:oe("system"),content:G(),providerOptions:_e.optional()}),qb=we({role:oe("user"),content:rt([G(),Hn(rt([Sc,zb,Cc]))]),providerOptions:_e.optional()}),Vb=we({role:oe("assistant"),content:rt([G(),Hn(rt([Sc,Cc,jb,Ub,Ic,$b]))]),providerOptions:_e.optional()}),Wb=we({role:oe("tool"),content:Hn(rt([Ic,Zb])),providerOptions:_e.optional()});rt([Yb,qb,Vb,Wb]);function Nc(t,e){if(t===void 0&&e===void 0)return;if(t===void 0)return e;if(e===void 0)return t;const n={...t};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const i=e[r];if(i===void 0)continue;const s=r in t?t[r]:void 0,a=i!==null&&typeof i=="object"&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp),o=s!=null&&typeof s=="object"&&!Array.isArray(s)&&!(s instanceof Date)&&!(s instanceof RegExp);a&&o?n[r]=Nc(s,i):n[r]=i}return n}var Gb={};Bb(Gb,{array:()=>Jb,choice:()=>eE,json:()=>tE,object:()=>Xb,text:()=>Qb});function Kb(t){const e=["ROOT"];let n=-1,r=null;function i(u,l,d){switch(u){case'"':{n=l,e.pop(),e.push(d),e.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=l,r=l,e.pop(),e.push(d),e.push("INSIDE_LITERAL");break}case"-":{e.pop(),e.push(d),e.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=l,e.pop(),e.push(d),e.push("INSIDE_NUMBER");break}case"{":{n=l,e.pop(),e.push(d),e.push("INSIDE_OBJECT_START");break}case"[":{n=l,e.pop(),e.push(d),e.push("INSIDE_ARRAY_START");break}}}function s(u,l){switch(u){case",":{e.pop(),e.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=l,e.pop();break}}}function a(u,l){switch(u){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=l,e.pop();break}}}for(let u=0;u<t.length;u++){const l=t[u];switch(e[e.length-1]){case"ROOT":i(l,u,"FINISH");break;case"INSIDE_OBJECT_START":{switch(l){case'"':{e.pop(),e.push("INSIDE_OBJECT_KEY");break}case"}":{n=u,e.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{l==='"'&&(e.pop(),e.push("INSIDE_OBJECT_KEY"));break}case"INSIDE_OBJECT_KEY":{l==='"'&&(e.pop(),e.push("INSIDE_OBJECT_AFTER_KEY"));break}case"INSIDE_OBJECT_AFTER_KEY":{l===":"&&(e.pop(),e.push("INSIDE_OBJECT_BEFORE_VALUE"));break}case"INSIDE_OBJECT_BEFORE_VALUE":{i(l,u,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{s(l,u);break}case"INSIDE_STRING":{switch(l){case'"':{e.pop(),n=u;break}case"\\":{e.push("INSIDE_STRING_ESCAPE");break}default:n=u}break}case"INSIDE_ARRAY_START":{l==="]"?(n=u,e.pop()):(n=u,i(l,u,"INSIDE_ARRAY_AFTER_VALUE"));break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(l){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=u,e.pop();break}default:{n=u;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{i(l,u,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{e.pop(),n=u;break}case"INSIDE_NUMBER":{switch(l){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=u;break}case"e":case"E":case"-":case".":break;case",":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(l,u),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&s(l,u);break}case"}":{e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&s(l,u);break}case"]":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(l,u);break}default:{e.pop();break}}break}case"INSIDE_LITERAL":{const c=t.substring(r,u+1);!"false".startsWith(c)&&!"true".startsWith(c)&&!"null".startsWith(c)?(e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?s(l,u):e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(l,u)):n=u;break}}}let o=t.slice(0,n+1);for(let u=e.length-1;u>=0;u--)switch(e[u]){case"INSIDE_STRING":{o+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{o+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{o+="]";break}case"INSIDE_LITERAL":{const d=t.substring(r,t.length);"true".startsWith(d)?o+="true".slice(d.length):"false".startsWith(d)?o+="false".slice(d.length):"null".startsWith(d)&&(o+="null".slice(d.length))}}return o}async function jr(t){if(t===void 0)return{value:void 0,state:"undefined-input"};let e=await hn({text:t});return e.success?{value:e.value,state:"successful-parse"}:(e=await hn({text:Kb(t)}),e.success?{value:e.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var Qb=()=>({responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:t}){return t},async parsePartialOutput({text:t}){return{partial:t}}}),Xb=({schema:t,name:e,description:n})=>{const r=xa(t);return{responseFormat:Yt(r.jsonSchema).then(i=>({type:"json",schema:i,...e!=null&&{name:e},...n!=null&&{description:n}})),async parseCompleteOutput({text:i},s){const a=await hn({text:i});if(!a.success)throw new Wt({message:"No object generated: could not parse the response.",cause:a.error,text:i,response:s.response,usage:s.usage,finishReason:s.finishReason});const o=await Cr({value:a.value,schema:r});if(!o.success)throw new Wt({message:"No object generated: response did not match schema.",cause:o.error,text:i,response:s.response,usage:s.usage,finishReason:s.finishReason});return o.value},async parsePartialOutput({text:i}){const s=await jr(i);switch(s.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:s.value}}}}},Jb=({element:t,name:e,description:n})=>{const r=xa(t);return{responseFormat:Yt(r.jsonSchema).then(i=>{const{$schema:s,...a}=i;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:a}},required:["elements"],additionalProperties:!1},...e!=null&&{name:e},...n!=null&&{description:n}}}),async parseCompleteOutput({text:i},s){const a=await hn({text:i});if(!a.success)throw new Wt({message:"No object generated: could not parse the response.",cause:a.error,text:i,response:s.response,usage:s.usage,finishReason:s.finishReason});const o=a.value;if(o==null||typeof o!="object"||!("elements"in o)||!Array.isArray(o.elements))throw new Wt({message:"No object generated: response did not match schema.",cause:new Pn({value:o,cause:"response must be an object with an elements array"}),text:i,response:s.response,usage:s.usage,finishReason:s.finishReason});for(const u of o.elements){const l=await Cr({value:u,schema:r});if(!l.success)throw new Wt({message:"No object generated: response did not match schema.",cause:l.error,text:i,response:s.response,usage:s.usage,finishReason:s.finishReason})}return o.elements},async parsePartialOutput({text:i}){const s=await jr(i);switch(s.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const a=s.value;if(a==null||typeof a!="object"||!("elements"in a)||!Array.isArray(a.elements))return;const o=s.state==="repaired-parse"&&a.elements.length>0?a.elements.slice(0,-1):a.elements,u=[];for(const l of o){const d=await Cr({value:l,schema:r});d.success&&u.push(d.value)}return{partial:u}}}}}},eE=({options:t,name:e,description:n})=>({responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:t}},required:["result"],additionalProperties:!1},...e!=null&&{name:e},...n!=null&&{description:n}}),async parseCompleteOutput({text:r},i){const s=await hn({text:r});if(!s.success)throw new Wt({message:"No object generated: could not parse the response.",cause:s.error,text:r,response:i.response,usage:i.usage,finishReason:i.finishReason});const a=s.value;if(a==null||typeof a!="object"||!("result"in a)||typeof a.result!="string"||!t.includes(a.result))throw new Wt({message:"No object generated: response did not match schema.",cause:new Pn({value:a,cause:"response must be an object that contains a choice value."}),text:r,response:i.response,usage:i.usage,finishReason:i.finishReason});return a.result},async parsePartialOutput({text:r}){const i=await jr(r);switch(i.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const s=i.value;if(s==null||typeof s!="object"||!("result"in s)||typeof s.result!="string")return;const a=t.filter(o=>o.startsWith(s.result));return i.state==="successful-parse"?a.includes(s.result)?{partial:s.result}:void 0:a.length===1?{partial:a[0]}:void 0}}}}),tE=({name:t,description:e}={})=>({responseFormat:Promise.resolve({type:"json",...t!=null&&{name:t},...e!=null&&{description:e}}),async parseCompleteOutput({text:n},r){const i=await hn({text:n});if(!i.success)throw new Wt({message:"No object generated: could not parse the response.",cause:i.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});return i.value},async parsePartialOutput({text:n}){const r=await jr(n);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return r.value===void 0?void 0:{partial:r.value}}}});zr({prefix:"aitxt",size:24});(class extends TransformStream{constructor(){super({transform(t,e){e.enqueue(`data: ${JSON.stringify(t)}
|
|
36
|
+
|
|
37
|
+
`)},flush(t){t.enqueue(`data: [DONE]
|
|
38
|
+
|
|
39
|
+
`)}})}});var nE=wb(()=>Tc(rt([Le({type:oe("text-start"),id:G(),providerMetadata:_e.optional()}),Le({type:oe("text-delta"),id:G(),delta:G(),providerMetadata:_e.optional()}),Le({type:oe("text-end"),id:G(),providerMetadata:_e.optional()}),Le({type:oe("error"),errorText:G()}),Le({type:oe("tool-input-start"),toolCallId:G(),toolName:G(),providerExecuted:et().optional(),dynamic:et().optional(),title:G().optional()}),Le({type:oe("tool-input-delta"),toolCallId:G(),inputTextDelta:G()}),Le({type:oe("tool-input-available"),toolCallId:G(),toolName:G(),input:Nt(),providerExecuted:et().optional(),providerMetadata:_e.optional(),dynamic:et().optional(),title:G().optional()}),Le({type:oe("tool-input-error"),toolCallId:G(),toolName:G(),input:Nt(),providerExecuted:et().optional(),providerMetadata:_e.optional(),dynamic:et().optional(),errorText:G(),title:G().optional()}),Le({type:oe("tool-approval-request"),approvalId:G(),toolCallId:G()}),Le({type:oe("tool-output-available"),toolCallId:G(),output:Nt(),providerExecuted:et().optional(),dynamic:et().optional(),preliminary:et().optional()}),Le({type:oe("tool-output-error"),toolCallId:G(),errorText:G(),providerExecuted:et().optional(),dynamic:et().optional()}),Le({type:oe("tool-output-denied"),toolCallId:G()}),Le({type:oe("reasoning-start"),id:G(),providerMetadata:_e.optional()}),Le({type:oe("reasoning-delta"),id:G(),delta:G(),providerMetadata:_e.optional()}),Le({type:oe("reasoning-end"),id:G(),providerMetadata:_e.optional()}),Le({type:oe("source-url"),sourceId:G(),url:G(),title:G().optional(),providerMetadata:_e.optional()}),Le({type:oe("source-document"),sourceId:G(),mediaType:G(),title:G(),filename:G().optional(),providerMetadata:_e.optional()}),Le({type:oe("file"),url:G(),mediaType:G(),providerMetadata:_e.optional()}),Le({type:mc(t=>typeof t=="string"&&t.startsWith("data-"),{message:'Type must start with "data-"'}),id:G().optional(),data:Nt(),transient:et().optional()}),Le({type:oe("start-step")}),Le({type:oe("finish-step")}),Le({type:oe("start"),messageId:G().optional(),messageMetadata:Nt().optional()}),Le({type:oe("finish"),finishReason:fc(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:Nt().optional()}),Le({type:oe("abort")}),Le({type:oe("message-metadata"),messageMetadata:Nt()})])));function rE(t){return t.type.startsWith("data-")}function Us(t){return t.type.startsWith("tool-")}function iE(t){return t.type==="dynamic-tool"}function Hs(t){return Us(t)||iE(t)}function qo(t){return t.type.split("-").slice(1).join("-")}function sE({lastMessage:t,messageId:e}){return{message:t?.role==="assistant"?t:{id:e,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function aE({stream:t,messageMetadataSchema:e,dataPartSchemas:n,runUpdateMessageJob:r,onError:i,onToolCall:s,onData:a}){return t.pipeThrough(new TransformStream({async transform(o,u){await r(async({state:l,write:d})=>{var c,h,p,g;function E(b){const w=l.message.parts.filter(Hs).find(k=>k.toolCallId===b);if(w==null)throw new Error(`no tool invocation found for tool call ${b}`);return w}function T(b){var C;const w=l.message.parts.find(O=>Us(O)&&O.toolCallId===b.toolCallId),k=b,v=w;w!=null?(w.state=b.state,v.input=k.input,v.output=k.output,v.errorText=k.errorText,v.rawInput=k.rawInput,v.preliminary=k.preliminary,b.title!==void 0&&(v.title=b.title),v.providerExecuted=(C=k.providerExecuted)!=null?C:w.providerExecuted,k.providerMetadata!=null&&w.state==="input-available"&&(w.callProviderMetadata=k.providerMetadata)):l.message.parts.push({type:`tool-${b.toolName}`,toolCallId:b.toolCallId,state:b.state,title:b.title,input:k.input,output:k.output,rawInput:k.rawInput,errorText:k.errorText,providerExecuted:k.providerExecuted,preliminary:k.preliminary,...k.providerMetadata!=null?{callProviderMetadata:k.providerMetadata}:{}})}function x(b){var C,w;const k=l.message.parts.find(P=>P.type==="dynamic-tool"&&P.toolCallId===b.toolCallId),v=b,O=k;k!=null?(k.state=b.state,O.toolName=b.toolName,O.input=v.input,O.output=v.output,O.errorText=v.errorText,O.rawInput=(C=v.rawInput)!=null?C:O.rawInput,O.preliminary=v.preliminary,b.title!==void 0&&(O.title=b.title),O.providerExecuted=(w=v.providerExecuted)!=null?w:k.providerExecuted,v.providerMetadata!=null&&k.state==="input-available"&&(k.callProviderMetadata=v.providerMetadata)):l.message.parts.push({type:"dynamic-tool",toolName:b.toolName,toolCallId:b.toolCallId,state:b.state,input:v.input,output:v.output,errorText:v.errorText,preliminary:v.preliminary,providerExecuted:v.providerExecuted,title:b.title,...v.providerMetadata!=null?{callProviderMetadata:v.providerMetadata}:{}})}async function _(b){if(b!=null){const C=l.message.metadata!=null?Nc(l.message.metadata,b):b;e!=null&&await Zo({value:C,schema:e}),l.message.metadata=C}}switch(o.type){case"text-start":{const b={type:"text",text:"",providerMetadata:o.providerMetadata,state:"streaming"};l.activeTextParts[o.id]=b,l.message.parts.push(b),d();break}case"text-delta":{const b=l.activeTextParts[o.id];b.text+=o.delta,b.providerMetadata=(c=o.providerMetadata)!=null?c:b.providerMetadata,d();break}case"text-end":{const b=l.activeTextParts[o.id];b.state="done",b.providerMetadata=(h=o.providerMetadata)!=null?h:b.providerMetadata,delete l.activeTextParts[o.id],d();break}case"reasoning-start":{const b={type:"reasoning",text:"",providerMetadata:o.providerMetadata,state:"streaming"};l.activeReasoningParts[o.id]=b,l.message.parts.push(b),d();break}case"reasoning-delta":{const b=l.activeReasoningParts[o.id];b.text+=o.delta,b.providerMetadata=(p=o.providerMetadata)!=null?p:b.providerMetadata,d();break}case"reasoning-end":{const b=l.activeReasoningParts[o.id];b.providerMetadata=(g=o.providerMetadata)!=null?g:b.providerMetadata,b.state="done",delete l.activeReasoningParts[o.id],d();break}case"file":{l.message.parts.push({type:"file",mediaType:o.mediaType,url:o.url}),d();break}case"source-url":{l.message.parts.push({type:"source-url",sourceId:o.sourceId,url:o.url,title:o.title,providerMetadata:o.providerMetadata}),d();break}case"source-document":{l.message.parts.push({type:"source-document",sourceId:o.sourceId,mediaType:o.mediaType,title:o.title,filename:o.filename,providerMetadata:o.providerMetadata}),d();break}case"tool-input-start":{const b=l.message.parts.filter(Us);l.partialToolCalls[o.toolCallId]={text:"",toolName:o.toolName,index:b.length,dynamic:o.dynamic,title:o.title},o.dynamic?x({toolCallId:o.toolCallId,toolName:o.toolName,state:"input-streaming",input:void 0,providerExecuted:o.providerExecuted,title:o.title}):T({toolCallId:o.toolCallId,toolName:o.toolName,state:"input-streaming",input:void 0,providerExecuted:o.providerExecuted,title:o.title}),d();break}case"tool-input-delta":{const b=l.partialToolCalls[o.toolCallId];b.text+=o.inputTextDelta;const{value:C}=await jr(b.text);b.dynamic?x({toolCallId:o.toolCallId,toolName:b.toolName,state:"input-streaming",input:C,title:b.title}):T({toolCallId:o.toolCallId,toolName:b.toolName,state:"input-streaming",input:C,title:b.title}),d();break}case"tool-input-available":{o.dynamic?x({toolCallId:o.toolCallId,toolName:o.toolName,state:"input-available",input:o.input,providerExecuted:o.providerExecuted,providerMetadata:o.providerMetadata,title:o.title}):T({toolCallId:o.toolCallId,toolName:o.toolName,state:"input-available",input:o.input,providerExecuted:o.providerExecuted,providerMetadata:o.providerMetadata,title:o.title}),d(),s&&!o.providerExecuted&&await s({toolCall:o});break}case"tool-input-error":{o.dynamic?x({toolCallId:o.toolCallId,toolName:o.toolName,state:"output-error",input:o.input,errorText:o.errorText,providerExecuted:o.providerExecuted,providerMetadata:o.providerMetadata}):T({toolCallId:o.toolCallId,toolName:o.toolName,state:"output-error",input:void 0,rawInput:o.input,errorText:o.errorText,providerExecuted:o.providerExecuted,providerMetadata:o.providerMetadata}),d();break}case"tool-approval-request":{const b=E(o.toolCallId);b.state="approval-requested",b.approval={id:o.approvalId},d();break}case"tool-output-denied":{const b=E(o.toolCallId);b.state="output-denied",d();break}case"tool-output-available":{const b=E(o.toolCallId);b.type==="dynamic-tool"?x({toolCallId:o.toolCallId,toolName:b.toolName,state:"output-available",input:b.input,output:o.output,preliminary:o.preliminary,providerExecuted:o.providerExecuted,title:b.title}):T({toolCallId:o.toolCallId,toolName:qo(b),state:"output-available",input:b.input,output:o.output,providerExecuted:o.providerExecuted,preliminary:o.preliminary,title:b.title}),d();break}case"tool-output-error":{const b=E(o.toolCallId);b.type==="dynamic-tool"?x({toolCallId:o.toolCallId,toolName:b.toolName,state:"output-error",input:b.input,errorText:o.errorText,providerExecuted:o.providerExecuted,title:b.title}):T({toolCallId:o.toolCallId,toolName:qo(b),state:"output-error",input:b.input,rawInput:b.rawInput,errorText:o.errorText,providerExecuted:o.providerExecuted,title:b.title}),d();break}case"start-step":{l.message.parts.push({type:"step-start"});break}case"finish-step":{l.activeTextParts={},l.activeReasoningParts={};break}case"start":{o.messageId!=null&&(l.message.id=o.messageId),await _(o.messageMetadata),(o.messageId!=null||o.messageMetadata!=null)&&d();break}case"finish":{o.finishReason!=null&&(l.finishReason=o.finishReason),await _(o.messageMetadata),o.messageMetadata!=null&&d();break}case"message-metadata":{await _(o.messageMetadata),o.messageMetadata!=null&&d();break}case"error":{i?.(new Error(o.errorText));break}default:if(rE(o)){n?.[o.type]!=null&&await Zo({value:o.data,schema:n[o.type]});const b=o;if(b.transient){a?.(b);break}const C=b.id!=null?l.message.parts.find(w=>b.type===w.type&&b.id===w.id):void 0;C!=null?C.data=b.data:l.message.parts.push(b),a?.(b),d()}}u.enqueue(o)})}}))}async function oE({stream:t,onError:e}){const n=t.getReader();try{for(;;){const{done:r}=await n.read();if(r)break}}catch(r){e?.(r)}finally{n.releaseLock()}}zr({prefix:"aitxt",size:24});zr({prefix:"aiobj",size:24});var uE=class{constructor(){this.queue=[],this.isProcessing=!1}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.queue.length>0;)await this.queue[0](),this.queue.shift();this.isProcessing=!1}}async run(t){return new Promise((e,n)=>{this.queue.push(async()=>{try{await t(),e()}catch(r){n(r)}}),this.processQueue()})}};zr({prefix:"aiobj",size:24});async function lE(t){if(t==null)return[];if(!globalThis.FileList||!(t instanceof globalThis.FileList))throw new Error("FileList is not supported in the current environment");return Promise.all(Array.from(t).map(async e=>{const{name:n,type:r}=e,i=await new Promise((s,a)=>{const o=new FileReader;o.onload=u=>{var l;s((l=u.target)==null?void 0:l.result)},o.onerror=u=>a(u),o.readAsDataURL(e)});return{type:"file",mediaType:r,filename:n,url:i}}))}var cE=class{constructor({api:t="/api/chat",credentials:e,headers:n,body:r,fetch:i,prepareSendMessagesRequest:s,prepareReconnectToStreamRequest:a}){this.api=t,this.credentials=e,this.headers=n,this.body=r,this.fetch=i,this.prepareSendMessagesRequest=s,this.prepareReconnectToStreamRequest=a}async sendMessages({abortSignal:t,...e}){var n,r,i,s,a;const o=await Yt(this.body),u=await Yt(this.headers),l=await Yt(this.credentials),d={...an(u),...an(e.headers)},c=await((n=this.prepareSendMessagesRequest)==null?void 0:n.call(this,{api:this.api,id:e.chatId,messages:e.messages,body:{...o,...e.body},headers:d,credentials:l,requestMetadata:e.metadata,trigger:e.trigger,messageId:e.messageId})),h=(r=c?.api)!=null?r:this.api,p=c?.headers!==void 0?an(c.headers):d,g=c?.body!==void 0?c.body:{...o,...e.body,id:e.chatId,messages:e.messages,trigger:e.trigger,messageId:e.messageId},E=(i=c?.credentials)!=null?i:l,x=await((s=this.fetch)!=null?s:globalThis.fetch)(h,{method:"POST",headers:jo({"Content-Type":"application/json",...p},`ai-sdk/${Yo}`,zo()),body:JSON.stringify(g),credentials:E,signal:t});if(!x.ok)throw new Error((a=await x.text())!=null?a:"Failed to fetch the chat response.");if(!x.body)throw new Error("The response body is empty.");return this.processResponseStream(x.body)}async reconnectToStream(t){var e,n,r,i,s;const a=await Yt(this.body),o=await Yt(this.headers),u=await Yt(this.credentials),l={...an(o),...an(t.headers)},d=await((e=this.prepareReconnectToStreamRequest)==null?void 0:e.call(this,{api:this.api,id:t.chatId,body:{...a,...t.body},headers:l,credentials:u,requestMetadata:t.metadata})),c=(n=d?.api)!=null?n:`${this.api}/${t.chatId}/stream`,h=d?.headers!==void 0?an(d.headers):l,p=(r=d?.credentials)!=null?r:u,E=await((i=this.fetch)!=null?i:globalThis.fetch)(c,{method:"GET",headers:jo(h,`ai-sdk/${Yo}`,zo()),credentials:p});if(E.status===204)return null;if(!E.ok)throw new Error((s=await E.text())!=null?s:"Failed to fetch the chat response.");if(!E.body)throw new Error("The response body is empty.");return this.processResponseStream(E.body)}},wc=class extends cE{constructor(t={}){super(t)}processResponseStream(t){return Pb({stream:t,schema:nE}).pipeThrough(new TransformStream({async transform(e,n){if(!e.success)throw e.error;n.enqueue(e.value)}}))}},dE=class{constructor({generateId:t=Fg,id:e=t(),transport:n=new wc,messageMetadataSchema:r,dataPartSchemas:i,state:s,onError:a,onToolCall:o,onFinish:u,onData:l,sendAutomaticallyWhen:d}){this.activeResponse=void 0,this.jobExecutor=new uE,this.sendMessage=async(c,h)=>{var p,g,E,T;if(c==null){await this.makeRequest({trigger:"submit-message",messageId:(p=this.lastMessage)==null?void 0:p.id,...h});return}let x;if("text"in c||"files"in c?x={parts:[...Array.isArray(c.files)?c.files:await lE(c.files),..."text"in c&&c.text!=null?[{type:"text",text:c.text}]:[]]}:x=c,c.messageId!=null){const _=this.state.messages.findIndex(b=>b.id===c.messageId);if(_===-1)throw new Error(`message with id ${c.messageId} not found`);if(this.state.messages[_].role!=="user")throw new Error(`message with id ${c.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,_+1),this.state.replaceMessage(_,{...x,id:c.messageId,role:(g=x.role)!=null?g:"user",metadata:c.metadata})}else this.state.pushMessage({...x,id:(E=x.id)!=null?E:this.generateId(),role:(T=x.role)!=null?T:"user",metadata:c.metadata});await this.makeRequest({trigger:"submit-message",messageId:c.messageId,...h})},this.regenerate=async({messageId:c,...h}={})=>{const p=c==null?this.state.messages.length-1:this.state.messages.findIndex(g=>g.id===c);if(p===-1)throw new Error(`message ${c} not found`);this.state.messages=this.state.messages.slice(0,this.messages[p].role==="assistant"?p:p+1),await this.makeRequest({trigger:"regenerate-message",messageId:c,...h})},this.resumeStream=async(c={})=>{await this.makeRequest({trigger:"resume-stream",...c})},this.clearError=()=>{this.status==="error"&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolApprovalResponse=async({id:c,approved:h,reason:p})=>this.jobExecutor.run(async()=>{var g,E;const T=this.state.messages,x=T[T.length-1],_=b=>Hs(b)&&b.state==="approval-requested"&&b.approval.id===c?{...b,state:"approval-responded",approval:{id:c,approved:h,reason:p}}:b;this.state.replaceMessage(T.length-1,{...x,parts:x.parts.map(_)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(_)),this.status!=="streaming"&&this.status!=="submitted"&&((g=this.sendAutomaticallyWhen)!=null&&g.call(this,{messages:this.state.messages}))&&this.makeRequest({trigger:"submit-message",messageId:(E=this.lastMessage)==null?void 0:E.id})}),this.addToolOutput=async({state:c="output-available",tool:h,toolCallId:p,output:g,errorText:E})=>this.jobExecutor.run(async()=>{var T,x;const _=this.state.messages,b=_[_.length-1],C=w=>Hs(w)&&w.toolCallId===p?{...w,state:c,output:g,errorText:E}:w;this.state.replaceMessage(_.length-1,{...b,parts:b.parts.map(C)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(C)),this.status!=="streaming"&&this.status!=="submitted"&&((T=this.sendAutomaticallyWhen)!=null&&T.call(this,{messages:this.state.messages}))&&this.makeRequest({trigger:"submit-message",messageId:(x=this.lastMessage)==null?void 0:x.id})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var c;this.status!=="streaming"&&this.status!=="submitted"||(c=this.activeResponse)!=null&&c.abortController&&this.activeResponse.abortController.abort()},this.id=e,this.transport=n,this.generateId=t,this.messageMetadataSchema=r,this.dataPartSchemas=i,this.state=s,this.onError=a,this.onToolCall=o,this.onFinish=u,this.onData=l,this.sendAutomaticallyWhen=d}get status(){return this.state.status}setStatus({status:t,error:e}){this.status!==t&&(this.state.status=t,this.state.error=e)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}set messages(t){this.state.messages=t}async makeRequest({trigger:t,metadata:e,headers:n,body:r,messageId:i}){var s,a,o,u;this.setStatus({status:"submitted",error:void 0});const l=this.lastMessage;let d=!1,c=!1,h=!1;try{const p={state:sE({lastMessage:this.state.snapshot(l),messageId:this.generateId()}),abortController:new AbortController};p.abortController.signal.addEventListener("abort",()=>{d=!0}),this.activeResponse=p;let g;if(t==="resume-stream"){const T=await this.transport.reconnectToStream({chatId:this.id,metadata:e,headers:n,body:r});if(T==null){this.setStatus({status:"ready"});return}g=T}else g=await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:p.abortController.signal,metadata:e,headers:n,body:r,trigger:t,messageId:i});const E=T=>this.jobExecutor.run(()=>T({state:p.state,write:()=>{var x;this.setStatus({status:"streaming"}),p.state.message.id===((x=this.lastMessage)==null?void 0:x.id)?this.state.replaceMessage(this.state.messages.length-1,p.state.message):this.state.pushMessage(p.state.message)}}));await oE({stream:aE({stream:g,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:E,onError:T=>{throw T}}),onError:T=>{throw T}}),this.setStatus({status:"ready"})}catch(p){if(d||p.name==="AbortError")return d=!0,this.setStatus({status:"ready"}),null;h=!0,p instanceof TypeError&&(p.message.toLowerCase().includes("fetch")||p.message.toLowerCase().includes("network"))&&(c=!0),this.onError&&p instanceof Error&&this.onError(p),this.setStatus({status:"error",error:p})}finally{try{(a=this.onFinish)==null||a.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:d,isDisconnect:c,isError:h,finishReason:(s=this.activeResponse)==null?void 0:s.state.finishReason})}catch(p){console.error(p)}this.activeResponse=void 0}(o=this.sendAutomaticallyWhen)!=null&&o.call(this,{messages:this.state.messages})&&!h&&await this.makeRequest({trigger:"submit-message",messageId:(u=this.lastMessage)==null?void 0:u.id,metadata:e,headers:n,body:r})}},ss,Vo;function fE(){if(Vo)return ss;Vo=1;function t(e,n){if(typeof e!="function")throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let r,i=0;return function(...a){clearTimeout(r);const o=Date.now(),u=o-i,l=n-u;l<=0?(i=o,e.apply(this,a)):r=setTimeout(()=>{i=Date.now(),e.apply(this,a)},l)}}return ss=t,ss}var hE=fE();const pE=ma(hE);var vc=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},De=(t,e,n)=>(vc(t,e,"read from private field"),n?n.call(t):e.get(t)),St=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Ht=(t,e,n,r)=>(vc(t,e,"write to private field"),e.set(t,n),n);function mE(t,e){return e!=null?pE(t,e):t}var gt,ui,li,or,ur,lr,Cn,$s,Zs,gE=class{constructor(t=[]){St(this,gt,void 0),St(this,ui,"ready"),St(this,li,void 0),St(this,or,new Set),St(this,ur,new Set),St(this,lr,new Set),this.pushMessage=e=>{Ht(this,gt,De(this,gt).concat(e)),De(this,Cn).call(this)},this.popMessage=()=>{Ht(this,gt,De(this,gt).slice(0,-1)),De(this,Cn).call(this)},this.replaceMessage=(e,n)=>{Ht(this,gt,[...De(this,gt).slice(0,e),this.snapshot(n),...De(this,gt).slice(e+1)]),De(this,Cn).call(this)},this.snapshot=e=>structuredClone(e),this["~registerMessagesCallback"]=(e,n)=>{const r=n?mE(e,n):e;return De(this,or).add(r),()=>{De(this,or).delete(r)}},this["~registerStatusCallback"]=e=>(De(this,ur).add(e),()=>{De(this,ur).delete(e)}),this["~registerErrorCallback"]=e=>(De(this,lr).add(e),()=>{De(this,lr).delete(e)}),St(this,Cn,()=>{De(this,or).forEach(e=>e())}),St(this,$s,()=>{De(this,ur).forEach(e=>e())}),St(this,Zs,()=>{De(this,lr).forEach(e=>e())}),Ht(this,gt,t)}get status(){return De(this,ui)}set status(t){Ht(this,ui,t),De(this,$s).call(this)}get error(){return De(this,li)}set error(t){Ht(this,li,t),De(this,Zs).call(this)}get messages(){return De(this,gt)}set messages(t){Ht(this,gt,[...t]),De(this,Cn).call(this)}};gt=new WeakMap;ui=new WeakMap;li=new WeakMap;or=new WeakMap;ur=new WeakMap;lr=new WeakMap;Cn=new WeakMap;$s=new WeakMap;Zs=new WeakMap;var In,Wo=class extends dE{constructor({messages:t,...e}){const n=new gE(t);super({...e,state:n}),St(this,In,void 0),this["~registerMessagesCallback"]=(r,i)=>De(this,In)["~registerMessagesCallback"](r,i),this["~registerStatusCallback"]=r=>De(this,In)["~registerStatusCallback"](r),this["~registerErrorCallback"]=r=>De(this,In)["~registerErrorCallback"](r),Ht(this,In,n)}};In=new WeakMap;function bE({experimental_throttle:t,resume:e=!1,...n}={}){const r=D.useRef("chat"in n?n.chat:new Wo(n));("chat"in n&&n.chat!==r.current||"id"in n&&r.current.id!==n.id)&&(r.current="chat"in n?n.chat:new Wo(n));const s=D.useCallback(d=>r.current["~registerMessagesCallback"](d,t),[t,r.current.id]),a=D.useSyncExternalStore(s,()=>r.current.messages,()=>r.current.messages),o=D.useSyncExternalStore(r.current["~registerStatusCallback"],()=>r.current.status,()=>r.current.status),u=D.useSyncExternalStore(r.current["~registerErrorCallback"],()=>r.current.error,()=>r.current.error),l=D.useCallback(d=>{typeof d=="function"&&(d=d(r.current.messages)),r.current.messages=d},[r]);return D.useEffect(()=>{e&&r.current.resumeStream()},[e,r]),{id:r.current.id,messages:a,setMessages:l,sendMessage:r.current.sendMessage,regenerate:r.current.regenerate,clearError:r.current.clearError,stop:r.current.stop,error:u,resumeStream:r.current.resumeStream,status:o,addToolResult:r.current.addToolOutput,addToolOutput:r.current.addToolOutput,addToolApprovalResponse:r.current.addToolApprovalResponse}}const EE=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],xE=Ip("grip-vertical",EE);function Rc(t){const e=F.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(zn.Root,{"data-slot":"drawer",...n}),e[2]=n,e[3]=r):r=e[3],r}function Oc(t){const e=F.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(zn.Trigger,{"data-slot":"drawer-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function TE(t){const e=F.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(zn.Portal,{"data-slot":"drawer-portal",...n}),e[2]=n,e[3]=r):r=e[3],r}function _E(t){const e=F.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=X("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx(zn.Overlay,{"data-slot":"drawer-overlay",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function Lc(t){const e=F.c(12);let n,r,i;e[0]!==t?({className:r,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx(_E,{}),e[4]=s):s=e[4];let a;e[5]!==r?(a=X("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",r),e[5]=r,e[6]=a):a=e[6];let o;e[7]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=o):o=e[7];let u;return e[8]!==n||e[9]!==i||e[10]!==a?(u=m.jsxs(TE,{"data-slot":"drawer-portal",children:[s,m.jsxs(zn.Content,{"data-slot":"drawer-content",className:a,...i,children:[o,n]})]}),e[8]=n,e[9]=i,e[10]=a,e[11]=u):u=e[11],u}function Dc(t){const e=F.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=X("flex flex-col gap-1.5 px-4 py-2",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx("div",{"data-slot":"drawer-header",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function Pc(t){const e=F.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=X("text-foreground font-semibold",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx(zn.Title,{"data-slot":"drawer-title",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function Ys({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,i]=yE({defaultProp:e,onChange:n}),s=t!==void 0,a=s?t:r,o=Sl(n),u=D.useCallback(l=>{if(s){const c=typeof l=="function"?l(t):l;c!==t&&o(c)}else i(l)},[s,t,i,o]);return[a,u]}function yE({defaultProp:t,onChange:e}){const n=D.useState(t),[r]=n,i=D.useRef(r),s=Sl(e);return D.useEffect(()=>{i.current!==r&&(s(r),i.current=r)},[r,i,s]),n}const Mc=D.createContext({isMobile:!1,setValue:()=>{}}),Ta=()=>D.useContext(Mc),Bc=t=>{const e=F.c(37);let n,r,i,s,a,o,u,l;e[0]!==t?({children:n,defaultOpen:r,open:o,onOpenChange:s,defaultValue:i,value:l,onValueChange:a,...u}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=s,e[5]=a,e[6]=o,e[7]=u,e[8]=l):(n=e[1],r=e[2],i=e[3],s=e[4],a=e[5],o=e[6],u=e[7],l=e[8]);const d=jn(),c=r??!1;let h;e[9]!==s||e[10]!==o||e[11]!==c?(h={prop:o,defaultProp:c,onChange:s},e[9]=s,e[10]=o,e[11]=c,e[12]=h):h=e[12];const[p,g]=Ys(h);let E;e[13]!==i||e[14]!==a||e[15]!==l?(E={prop:l,defaultProp:i,onChange:a},e[13]=i,e[14]=a,e[15]=l,e[16]=E):E=e[16];const[T,x]=Ys(E);let _;e[17]!==x?(_=O=>{O&&x(O)},e[17]=x,e[18]=_):_=e[18];const b=_;let C;e[19]!==d||e[20]!==b?(C={isMobile:d,setValue:b},e[19]=d,e[20]=b,e[21]=C):C=e[21];let w;e[22]!==n||e[23]!==p||e[24]!==u||e[25]!==g?(w=m.jsx(Rc,{open:p,onOpenChange:g,...u,children:n}),e[22]=n,e[23]=p,e[24]=u,e[25]=g,e[26]=w):w=e[26];let k;e[27]!==p||e[28]!==u||e[29]!==g||e[30]!==b||e[31]!==w||e[32]!==T?(k=m.jsx(Dp,{open:p,onOpenChange:g,value:T,onValueChange:b,...u,children:w}),e[27]=p,e[28]=u,e[29]=g,e[30]=b,e[31]=w,e[32]=T,e[33]=k):k=e[33];let v;return e[34]!==C||e[35]!==k?(v=m.jsx(Mc.Provider,{value:C,children:k}),e[34]=C,e[35]=k,e[36]=v):v=e[36],v},Fc=t=>{const{children:e,title:n,headerActions:r,...i}=t,{isMobile:s}=Ta(),{className:a,...o}=i;return s?m.jsxs(Lc,{...o,children:[m.jsxs(Dc,{className:X(r?"flex flex-row items-center justify-between":"hidden"),children:[m.jsx(Pc,{children:n}),r]}),m.jsx("div",{className:X("flex flex-col gap-2 p-2 py-4",a),children:e})]}):m.jsx(Lp,{...i,children:e})},zc=t=>{const e=F.c(7);let n,r;e[0]!==t?({children:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);const{isMobile:i}=Ta();let s;return e[3]!==n||e[4]!==i||e[5]!==r?(s=i?m.jsx(Oc,{asChild:!0,children:m.jsx(ut,{variant:"outline",...r,children:n})}):m.jsx(Op,{...r,children:n}),e[3]=n,e[4]=i,e[5]=r,e[6]=s):s=e[6],s},jc=t=>{const e=F.c(7);let n,r;e[0]!==t?({children:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);const{isMobile:i}=Ta();let s;return e[3]!==n||e[4]!==i||e[5]!==r?(s=i?m.jsx("span",{...r,children:n}):m.jsx(Rp,{...r,children:n}),e[3]=n,e[4]=i,e[5]=r,e[6]=s):s=e[6],s};function kE(t){const e=F.c(22),{gateway:n,isSelected:r}=t,i=r&&"bg-accent";let s;e[0]!==i?(s=X("flex items-start gap-3 py-3 px-3 hover:bg-accent cursor-pointer rounded-xl",i),e[0]=i,e[1]=s):s=e[1];const a=n.fallbackIcon||"network_node";let o;e[2]!==n.icon||e[3]!==n.title||e[4]!==a?(o=m.jsx(bi,{icon:n.icon,name:n.title,size:"sm",fallbackIcon:a,className:"size-10"}),e[2]=n.icon,e[3]=n.title,e[4]=a,e[5]=o):o=e[5];let u;e[6]!==n.title?(u=m.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[6]=n.title,e[7]=u):u=e[7];let l;e[8]!==r?(l=r&&m.jsx(ge,{name:"check",size:16,className:"text-foreground shrink-0"}),e[8]=r,e[9]=l):l=e[9];let d;e[10]!==u||e[11]!==l?(d=m.jsxs("div",{className:"flex items-center justify-between",children:[u,l]}),e[10]=u,e[11]=l,e[12]=d):d=e[12];let c;e[13]!==n.description?(c=n.description&&m.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2 leading-relaxed",children:n.description}),e[13]=n.description,e[14]=c):c=e[14];let h;e[15]!==d||e[16]!==c?(h=m.jsxs("div",{className:"flex flex-col flex-1 min-w-0 gap-0.5",children:[d,c]}),e[15]=d,e[16]=c,e[17]=h):h=e[17];let p;return e[18]!==s||e[19]!==o||e[20]!==h?(p=m.jsxs("div",{className:s,children:[o,h]}),e[18]=s,e[19]=o,e[20]=h,e[21]=p):p=e[21],p}function AE(t){const e=F.c(10),{gateway:n}=t;if(!n){let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx("span",{className:"text-sm text-muted-foreground",children:"Select gateway"}),e[0]=o):o=e[0],o}const r=n.fallbackIcon||"network_node";let i;e[1]!==n.icon||e[2]!==n.title||e[3]!==r?(i=m.jsx(bi,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:r,className:"size-5"}),e[1]=n.icon,e[2]=n.title,e[3]=r,e[4]=i):i=e[4];let s;e[5]!==n.title?(s=m.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[5]=n.title,e[6]=s):s=e[6];let a;return e[7]!==i||e[8]!==s?(a=m.jsxs("div",{className:"flex items-center gap-2",children:[i,s]}),e[7]=i,e[8]=s,e[9]=a):a=e[9],a}function SE(t){const e=F.c(37),{gateways:n,selectedGatewayId:r,onGatewayChange:i,variant:s,className:a,placeholder:o}=t,u=s===void 0?"bordered":s,l=o===void 0?"Select gateway":o,[d,c]=D.useState(!1);let h;if(e[0]!==n||e[1]!==r){let B;e[3]!==r?(B=j=>j.id===r,e[3]=r,e[4]=B):B=e[4],h=n.find(B),e[0]=n,e[1]=r,e[2]=h}else h=e[2];const p=h;let g;e[5]!==i?(g=B=>{i(B),c(!1)},e[5]=i,e[6]=g):g=e[6];const E=g;if(n.length===0)return null;const T=r||"",x=u==="borderless"?"border-0 md:border-none":"border";let _;e[7]!==a||e[8]!==x?(_=X("h-8! text-sm hover:bg-accent rounded-lg py-1 px-2 gap-1 shadow-none cursor-pointer group focus-visible:ring-0 focus-visible:ring-offset-0",x,a),e[7]=a,e[8]=x,e[9]=_):_=e[9];let b;e[10]!==p?(b=m.jsx(AE,{gateway:p}),e[10]=p,e[11]=b):b=e[11];let C;e[12]!==l||e[13]!==b?(C=m.jsx(jc,{placeholder:l,children:b}),e[12]=l,e[13]=b,e[14]=C):C=e[14];let w;e[15]!==_||e[16]!==C?(w=m.jsx(zc,{className:_,children:C}),e[15]=_,e[16]=C,e[17]=w):w=e[17];let k;e[18]===Symbol.for("react.memo_cache_sentinel")?(k=m.jsx("div",{className:"border-b px-4 py-3 bg-background/95 backdrop-blur sticky top-0 z-10",children:m.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[m.jsx(ge,{name:"search",size:16}),m.jsx("span",{className:"text-sm",children:"Search for a gateway..."})]})}),e[18]=k):k=e[18];let v;if(e[19]!==n||e[20]!==E||e[21]!==r){let B;e[23]!==E||e[24]!==r?(B=j=>m.jsx("div",{onClick:()=>E(j.id),className:"outline-none",children:m.jsx(kE,{gateway:j,isSelected:j.id===r})},j.id),e[23]=E,e[24]=r,e[25]=B):B=e[25],v=n.map(B),e[19]=n,e[20]=E,e[21]=r,e[22]=v}else v=e[22];let O;e[26]!==v?(O=m.jsxs("div",{className:"flex flex-col max-h-[400px]",children:[k,m.jsx("div",{className:"overflow-y-auto p-2 flex flex-col gap-1",children:v})]}),e[26]=v,e[27]=O):O=e[27];let P;e[28]!==l||e[29]!==O?(P=m.jsx(Fc,{title:l,className:"w-full md:w-[400px] p-0",children:O}),e[28]=l,e[29]=O,e[30]=P):P=e[30];let R;return e[31]!==E||e[32]!==d||e[33]!==w||e[34]!==P||e[35]!==T?(R=m.jsxs(Bc,{open:d,onOpenChange:c,value:T,onValueChange:E,children:[w,P]}),e[31]=E,e[32]=d,e[33]=w,e[34]=P,e[35]=T,e[36]=R):R=e[36],R}function CE(t){const e=F.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=X("flex flex-col h-full w-full bg-sidebar transform-[translateZ(0)]",r),e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==n||e[3]!==i?(s=m.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s}function IE(t){const e=F.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=X("flex h-12 items-center justify-between border-b border-border px-2 flex-none",r),e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==n||e[3]!==i?(s=m.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s}function NE(t){const e=F.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=X("flex-1 min-h-0 overflow-y-auto",r),e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==n||e[3]!==i?(s=m.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s}function wE(t){const e=F.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=X("flex-none w-full mx-auto p-2",r),e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==n||e[3]!==i?(s=m.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s}const nn=Object.assign(CE,{Header:IE,Content:NE,Footer:wE});function vE(t){const e=F.c(14),{title:n,description:r,avatar:i,avatarNode:s,className:a}=t,o=n===void 0?"Start a conversation":n;let u;e[0]!==a?(u=X("flex flex-col items-center justify-center gap-4 p-8 text-center",a),e[0]=a,e[1]=u):u=e[1];let l;e[2]!==i||e[3]!==s?(l=s||i&&m.jsx("img",{src:i,alt:"Chat avatar",className:"size-[60px] rounded-[18px] border-[1.875px] border-border/10"}),e[2]=i,e[3]=s,e[4]=l):l=e[4];let d;e[5]!==o?(d=o&&m.jsx("h3",{className:"text-xl font-medium text-foreground",children:o}),e[5]=o,e[6]=d):d=e[6];let c;e[7]!==r?(c=r&&m.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:r}),e[7]=r,e[8]=c):c=e[8];let h;return e[9]!==u||e[10]!==l||e[11]!==d||e[12]!==c?(h=m.jsxs("div",{className:u,children:[l,d,c]}),e[9]=u,e[10]=l,e[11]=d,e[12]=c,e[13]=h):h=e[13],h}function RE(t){const e=F.c(68),{value:n,onChange:r,onSubmit:i,onStop:s,disabled:a,isStreaming:o,placeholder:u,className:l,centered:d,contextContent:c,leftActions:h,rightActions:p,maxTextHeight:g}=t,E=u===void 0?"Ask anything or @ for context":u,T=d===void 0?!1:d,x=g===void 0?"164px":g;let _;e[0]!==a||e[1]!==o||e[2]!==n?(_=!a&&!o&&n.trim().length>0,e[0]=a,e[1]=o,e[2]=n,e[3]=_):_=e[3];const b=_;let C;e[4]!==b||e[5]!==o||e[6]!==s||e[7]!==i?(C=Ze=>{Ze.preventDefault(),o&&s?s():b&&i()},e[4]=b,e[5]=o,e[6]=s,e[7]=i,e[8]=C):C=e[8];const w=C;let k;e[9]!==b||e[10]!==i?(k=Ze=>{Ze.key==="Enter"&&!Ze.shiftKey&&(Ze.preventDefault(),b&&i())},e[9]=b,e[10]=i,e[11]=k):k=e[11];const v=k;let O;e[12]!==l?(O=X("w-full",l),e[12]=l,e[13]=O):O=e[13];const P=T?"shadow-md":"shadow-sm";let R;e[14]!==P?(R=X("relative rounded-xl border border-border bg-background w-full min-h-[130px] flex flex-col",P),e[14]=P,e[15]=R):R=e[15];let B;e[16]!==c?(B=c&&m.jsx("div",{className:"mb-1",children:c}),e[16]=c,e[17]=B):B=e[17];let j;e[18]!==x?(j={maxHeight:x},e[18]=x,e[19]=j):j=e[19];let J;e[20]!==r?(J=Ze=>r(Ze.target.value),e[20]=r,e[21]=J):J=e[21];const Y=a||o;let H;e[22]===Symbol.for("react.memo_cache_sentinel")?(H=X("placeholder:text-muted-foreground resize-none focus-visible:ring-0 border-0 p-2 text-sm min-h-[20px] w-full","rounded-none shadow-none"),e[22]=H):H=e[22];let Q;e[23]===Symbol.for("react.memo_cache_sentinel")?(Q={minHeight:"20px",height:"auto",overflow:"hidden"},e[23]=Q):Q=e[23];let ue;e[24]!==v||e[25]!==E||e[26]!==J||e[27]!==Y||e[28]!==n?(ue=m.jsx(Pp,{value:n,onChange:J,onKeyDown:v,placeholder:E,disabled:Y,className:H,rows:1,style:Q}),e[24]=v,e[25]=E,e[26]=J,e[27]=Y,e[28]=n,e[29]=ue):ue=e[29];let ce;e[30]!==j||e[31]!==ue?(ce=m.jsx("div",{className:"overflow-y-auto relative flex-1",style:j,children:ue}),e[30]=j,e[31]=ue,e[32]=ce):ce=e[32];let fe;e[33]!==B||e[34]!==ce?(fe=m.jsxs("div",{className:"relative flex flex-col gap-2 p-2.5 flex-1",children:[B,ce]}),e[33]=B,e[34]=ce,e[35]=fe):fe=e[35];let N;e[36]!==h?(N=m.jsx("div",{className:"flex items-center",children:h}),e[36]=h,e[37]=N):N=e[37];const V=o?"button":"submit";let se;e[38]!==o||e[39]!==s?(se=Ze=>{o&&(Ze.preventDefault(),Ze.stopPropagation(),s?.())},e[38]=o,e[39]=s,e[40]=se):se=e[40];const A=b||o?"default":"ghost",te=!b&&!o,ie=!b&&!o&&"bg-muted text-muted-foreground hover:bg-muted hover:text-muted-foreground cursor-not-allowed";let K;e[41]!==ie?(K=X("size-8 rounded-full transition-all",ie),e[41]=ie,e[42]=K):K=e[42];const ee=o?"Stop generating":"Send message (Enter)",re=o?"stop":"arrow_upward";let le;e[43]!==o||e[44]!==re?(le=m.jsx(ge,{name:re,size:20,filled:o}),e[43]=o,e[44]=re,e[45]=le):le=e[45];let be;e[46]!==V||e[47]!==se||e[48]!==A||e[49]!==te||e[50]!==K||e[51]!==ee||e[52]!==le?(be=m.jsx(ut,{type:V,onClick:se,variant:A,size:"icon",disabled:te,className:K,title:ee,children:le}),e[46]=V,e[47]=se,e[48]=A,e[49]=te,e[50]=K,e[51]=ee,e[52]=le,e[53]=be):be=e[53];let Pe;e[54]!==p||e[55]!==be?(Pe=m.jsxs("div",{className:"flex items-center gap-1",children:[p,be]}),e[54]=p,e[55]=be,e[56]=Pe):Pe=e[56];let $e;e[57]!==N||e[58]!==Pe?($e=m.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2.5",children:[N,Pe]}),e[57]=N,e[58]=Pe,e[59]=$e):$e=e[59];let ke;e[60]!==fe||e[61]!==$e||e[62]!==R?(ke=m.jsxs("div",{className:R,children:[fe,$e]}),e[60]=fe,e[61]=$e,e[62]=R,e[63]=ke):ke=e[63];let qe;return e[64]!==w||e[65]!==ke||e[66]!==O?(qe=m.jsx("form",{onSubmit:w,className:O,children:ke}),e[64]=w,e[65]=ke,e[66]=O,e[67]=qe):qe=e[67],qe}const OE={reasoning:{icon:"neurology",bg:"bg-purple-100",text:"text-purple-700",label:"Reasoning"},"image-upload":{icon:"image",bg:"bg-teal-100",text:"text-teal-700",label:"Can analyze images"},"file-upload":{icon:"description",bg:"bg-blue-100",text:"text-blue-700",label:"Can analyze files"},"web-search":{icon:"search",bg:"bg-amber-100",text:"text-amber-700",label:"Can search the web to answer questions"}},Uc=D.memo(function(e){const n=F.c(14),{capability:r}=e,i=OE[r];let s;n[0]!==r||n[1]!==i?(s=i||{icon:"check",bg:"bg-slate-200",text:"text-slate-700",label:r},n[0]=r,n[1]=i,n[2]=s):s=n[2];const a=s,o=`flex items-center justify-center h-6 w-6 rounded-sm ${a.bg}`;let u;n[3]!==a.icon||n[4]!==a.text?(u=m.jsx(ge,{name:a.icon,className:a.text}),n[3]=a.icon,n[4]=a.text,n[5]=u):u=n[5];let l;n[6]!==o||n[7]!==u?(l=m.jsx(Rl,{asChild:!0,children:m.jsx("div",{className:o,children:u})}),n[6]=o,n[7]=u,n[8]=l):l=n[8];let d;n[9]!==a.label?(d=m.jsx(vl,{children:m.jsx("p",{children:a.label})}),n[9]=a.label,n[10]=d):d=n[10];let c;return n[11]!==l||n[12]!==d?(c=m.jsxs(Ol,{children:[l,d]}),n[11]=l,n[12]=d,n[13]=c):c=n[13],c}),Go=D.memo(function(e){const n=F.c(54),{model:r,compact:i}=e,s=i===void 0?!1:i;if(!r){let x;return n[0]===Symbol.for("react.memo_cache_sentinel")?(x=m.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),n[0]=x):x=n[0],x}const a=r.contextWindow||r.inputCost||r.outputCost||r.outputLimit;if(!a&&!s){let x;n[1]!==r.logo||n[2]!==r.name?(x=r.logo&&m.jsx("img",{src:r.logo,className:"w-6 h-6",alt:r.name}),n[1]=r.logo,n[2]=r.name,n[3]=x):x=n[3];let _;n[4]!==r.name?(_=m.jsx("p",{className:"text-lg font-medium leading-7",children:r.name}),n[4]=r.name,n[5]=_):_=n[5];let b;n[6]!==x||n[7]!==_?(b=m.jsxs("div",{className:"flex items-center gap-3 py-2 px-0",children:[x,_]}),n[6]=x,n[7]=_,n[8]=b):b=n[8];let C;n[9]!==r.description?(C=r.description&&m.jsx("p",{className:"text-sm text-muted-foreground",children:r.description}),n[9]=r.description,n[10]=C):C=n[10];let w;return n[11]!==b||n[12]!==C?(w=m.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[b,C]}),n[11]=b,n[12]=C,n[13]=w):w=n[13],w}if(!a&&s)return null;if(s){let x;n[14]!==r.contextWindow?(x=r.contextWindow&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Context"}),m.jsxs("span",{className:"text-foreground font-medium",children:[r.contextWindow.toLocaleString()," tokens"]})]}),n[14]=r.contextWindow,n[15]=x):x=n[15];let _;n[16]!==r.inputCost?(_=r.inputCost&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Input cost"}),m.jsxs("span",{className:"text-foreground font-medium",children:["$",r.inputCost.toFixed(2)," / 1M"]})]}),n[16]=r.inputCost,n[17]=_):_=n[17];let b;n[18]!==r.outputCost?(b=r.outputCost&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Output cost"}),m.jsxs("span",{className:"text-foreground font-medium",children:["$",r.outputCost.toFixed(2)," / 1M"]})]}),n[18]=r.outputCost,n[19]=b):b=n[19];let C;n[20]!==r.outputLimit?(C=r.outputLimit&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Output limit"}),m.jsxs("span",{className:"text-foreground font-medium",children:[r.outputLimit.toLocaleString()," tokens"]})]}),n[20]=r.outputLimit,n[21]=C):C=n[21];let w;return n[22]!==x||n[23]!==_||n[24]!==b||n[25]!==C?(w=m.jsxs("div",{className:"flex flex-col gap-2.5 pt-3 pb-3 px-3 rounded-b-xl text-xs",children:[x,_,b,C]}),n[22]=x,n[23]=_,n[24]=b,n[25]=C,n[26]=w):w=n[26],w}let o;n[27]!==r.logo||n[28]!==r.name?(o=r.logo&&m.jsx("img",{src:r.logo,className:"w-6 h-6",alt:r.name}),n[27]=r.logo,n[28]=r.name,n[29]=o):o=n[29];let u;n[30]!==r.name?(u=m.jsx("p",{className:"text-lg font-medium leading-7",children:r.name}),n[30]=r.name,n[31]=u):u=n[31];let l;n[32]!==o||n[33]!==u?(l=m.jsxs("div",{className:"flex items-center gap-3",children:[o,u]}),n[32]=o,n[33]=u,n[34]=l):l=n[34];let d;n[35]!==r.capabilities?(d=r.capabilities&&r.capabilities.length>0&&m.jsx("div",{className:"flex items-center gap-2",children:r.capabilities.map(ME)}),n[35]=r.capabilities,n[36]=d):d=n[36];let c;n[37]!==l||n[38]!==d?(c=m.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[l,d]}),n[37]=l,n[38]=d,n[39]=c):c=n[39];let h;n[40]!==r.contextWindow?(h=r.contextWindow&&m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(ge,{name:"widgets",className:"w-3.5 h-3.5 text-muted-foreground"}),m.jsx("p",{className:"text-sm text-foreground",children:"Context window"})]}),m.jsxs("p",{className:"text-sm text-muted-foreground",children:[r.contextWindow.toLocaleString()," tokens"]})]}),n[40]=r.contextWindow,n[41]=h):h=n[41];let p;n[42]!==r.inputCost||n[43]!==r.outputCost?(p=(r.inputCost||r.outputCost)&&m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(ge,{name:"attach_money",className:"w-3.5 h-3.5 text-muted-foreground"}),m.jsx("p",{className:"text-sm text-foreground",children:"Costs"})]}),m.jsxs("div",{className:"flex flex-col gap-0.5",children:[r.inputCost!==null&&r.inputCost!==void 0&&m.jsxs("p",{className:"text-sm text-muted-foreground",children:["$",r.inputCost.toFixed(2)," / 1M tokens (input)"]}),r.outputCost!==null&&r.outputCost!==void 0&&m.jsxs("p",{className:"text-sm text-muted-foreground",children:["$",r.outputCost.toFixed(2)," / 1M tokens (output)"]})]})]}),n[42]=r.inputCost,n[43]=r.outputCost,n[44]=p):p=n[44];let g;n[45]!==r.outputLimit?(g=r.outputLimit&&m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(ge,{name:"output",className:"w-4.5 h-4.5 text-muted-foreground/70"}),m.jsx("p",{className:"text-sm text-foreground",children:"Output limit"})]}),m.jsxs("p",{className:"text-sm text-muted-foreground",children:[r.outputLimit.toLocaleString()," token limit"]})]}),n[45]=r.outputLimit,n[46]=g):g=n[46];let E;n[47]!==h||n[48]!==p||n[49]!==g?(E=m.jsxs("div",{className:"flex flex-col gap-4",children:[h,p,g]}),n[47]=h,n[48]=p,n[49]=g,n[50]=E):E=n[50];let T;return n[51]!==E||n[52]!==c?(T=m.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[c,E]}),n[51]=E,n[52]=c,n[53]=T):T=n[53],T}),LE=D.memo(function(e){const n=F.c(27),{model:r,onHover:i,isSelected:s,hasExpandedInfo:a}=e,o=a?"rounded-t-xl":"rounded-xl";let u;n[0]!==o?(u=X("flex items-center gap-2 h-10 py-4 px-3 hover:bg-accent cursor-pointer",o),n[0]=o,n[1]=u):u=n[1];let l;n[2]!==r||n[3]!==i?(l=()=>i(r),n[2]=r,n[3]=i,n[4]=l):l=n[4];let d;n[5]!==r.logo||n[6]!==r.name?(d=r.logo&&m.jsx("img",{src:r.logo,className:"w-5 h-5 shrink-0",alt:r.name}),n[5]=r.logo,n[6]=r.name,n[7]=d):d=n[7];let c;n[8]!==r.name?(c=m.jsx("span",{className:"text-sm text-foreground",children:r.name}),n[8]=r.name,n[9]=c):c=n[9];let h;n[10]!==a||n[11]!==r.capabilities?(h=a&&r.capabilities&&r.capabilities.length>0&&m.jsx("div",{className:"md:hidden flex items-center gap-1.5 ml-auto",children:r.capabilities.map(BE)}),n[10]=a,n[11]=r.capabilities,n[12]=h):h=n[12];let p;n[13]!==a||n[14]!==s?(p=s&&!a&&m.jsx(ge,{name:"check",className:"w-4 h-4 text-foreground ml-auto"}),n[13]=a,n[14]=s,n[15]=p):p=n[15];let g;n[16]!==a||n[17]!==s?(g=s&&a&&m.jsx(ge,{name:"check",className:"w-4 h-4 text-foreground ml-2 shrink-0"}),n[16]=a,n[17]=s,n[18]=g):g=n[18];let E;return n[19]!==u||n[20]!==l||n[21]!==d||n[22]!==c||n[23]!==h||n[24]!==p||n[25]!==g?(E=m.jsxs("div",{className:u,onMouseEnter:l,children:[d,c,h,p,g]}),n[19]=u,n[20]=l,n[21]=d,n[22]=c,n[23]=h,n[24]=p,n[25]=g,n[26]=E):E=n[26],E});function DE(t){const e=F.c(9),{model:n}=t;if(!n){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx("span",{className:"text-sm text-muted-foreground",children:"Select model"}),e[0]=a):a=e[0],a}let r;e[1]!==n.logo||e[2]!==n.name?(r=n.logo&&m.jsx("img",{src:n.logo,className:"w-4 h-4",alt:n.name}),e[1]=n.logo,e[2]=n.name,e[3]=r):r=e[3];let i;e[4]!==n.name?(i=m.jsx("span",{className:"text-sm text-muted-foreground group-hover:text-foreground transition-colors",children:n.name}),e[4]=n.name,e[5]=i):i=e[5];let s;return e[6]!==r||e[7]!==i?(s=m.jsxs("div",{className:"flex items-center gap-2",children:[r,i]}),e[6]=r,e[7]=i,e[8]=s):s=e[8],s}function PE(t){const e=F.c(53),{models:n,selectedModelId:r,onModelChange:i,variant:s,className:a,placeholder:o}=t,u=s===void 0?"borderless":s,l=o===void 0?"Select model":o,[d,c]=D.useState(!1),[h,p]=D.useState(null),[g,E]=D.useState(!1);let T;if(e[0]!==n||e[1]!==r){let se;e[3]!==r?(se=A=>A.id===r,e[3]=r,e[4]=se):se=e[4],T=n.find(se),e[0]=n,e[1]=r,e[2]=T}else T=e[2];const x=T;let _;e[5]!==i?(_=se=>{i(se),c(!1)},e[5]=i,e[6]=_):_=e[6];const b=_;if(n.length===0)return null;const C=r||"",w=u==="borderless"&&"md:border-none";let k;e[7]!==a||e[8]!==w?(k=X("h-8! text-sm hover:bg-accent rounded-lg py-1 px-2 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0",w,a),e[7]=a,e[8]=w,e[9]=k):k=e[9];let v;e[10]!==x?(v=m.jsx(DE,{model:x}),e[10]=x,e[11]=v):v=e[11];let O;e[12]!==l||e[13]!==v?(O=m.jsx(jc,{placeholder:l,children:v}),e[12]=l,e[13]=v,e[14]=O):O=e[14];let P;e[15]!==k||e[16]!==O?(P=m.jsx(zc,{className:k,children:O}),e[15]=k,e[16]=O,e[17]=P):P=e[17];let R;e[18]!==g?(R=()=>E(!g),e[18]=g,e[19]=R):R=e[19];const B=g?"text-foreground":"text-muted-foreground";let j;e[20]!==B?(j=X("w-5 h-5 transition-colors",B),e[20]=B,e[21]=j):j=e[21];let J;e[22]!==j?(J=m.jsx(ge,{name:"info",className:j}),e[22]=j,e[23]=J):J=e[23];let Y;e[24]!==R||e[25]!==J?(Y=m.jsx("button",{type:"button",onClick:R,className:"md:hidden flex items-center justify-center h-8 w-8 rounded-lg hover:bg-accent transition-colors","aria-label":"Toggle model info",children:J}),e[24]=R,e[25]=J,e[26]=Y):Y=e[26];let H;if(e[27]!==b||e[28]!==n||e[29]!==r||e[30]!==g){let se;e[32]!==b||e[33]!==r||e[34]!==g?(se=A=>m.jsxs("div",{onClick:()=>b(A.id),className:X("rounded-xl mb-1",A.id===r&&"bg-accent"),children:[m.jsx(LE,{model:A,onHover:p,isSelected:A.id===r,hasExpandedInfo:g}),g&&m.jsx("div",{className:"md:hidden",children:m.jsx(Go,{model:A,compact:!0})})]},A.id),e[32]=b,e[33]=r,e[34]=g,e[35]=se):se=e[35],H=n.map(se),e[27]=b,e[28]=n,e[29]=r,e[30]=g,e[31]=H}else H=e[31];let Q;e[36]!==H?(Q=m.jsx("div",{className:"flex-1 overflow-y-auto px-0.5 md:border-r",children:H}),e[36]=H,e[37]=Q):Q=e[37];const ue=h||x||null;let ce;e[38]!==ue?(ce=m.jsx("div",{className:"hidden md:block md:w-[300px] p-3",children:m.jsx(Go,{model:ue})}),e[38]=ue,e[39]=ce):ce=e[39];let fe;e[40]!==Q||e[41]!==ce?(fe=m.jsxs("div",{className:"flex flex-col md:flex-row h-[350px]",children:[Q,ce]}),e[40]=Q,e[41]=ce,e[42]=fe):fe=e[42];let N;e[43]!==l||e[44]!==Y||e[45]!==fe?(N=m.jsx(Fc,{title:l,className:"w-full md:w-auto md:min-w-[600px] [&_button[aria-label='Scroll down']]:!hidden [&_button[aria-label='Scroll up']]:!hidden",headerActions:Y,children:fe}),e[43]=l,e[44]=Y,e[45]=fe,e[46]=N):N=e[46];let V;return e[47]!==b||e[48]!==d||e[49]!==P||e[50]!==N||e[51]!==C?(V=m.jsxs(Bc,{open:d,onOpenChange:c,value:C,onValueChange:b,children:[P,N]}),e[47]=b,e[48]=d,e[49]=P,e[50]=N,e[51]=C,e[52]=V):V=e[52],V}function ME(t){return m.jsx(Uc,{capability:t},t)}function BE(t){return m.jsx(Uc,{capability:t},t)}function pn(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}function FE(t,e){let n;const r=()=>{if(n)return n;const i=indexedDB.open(t);return i.onupgradeneeded=()=>i.result.createObjectStore(e),n=pn(i),n.then(s=>{s.onclose=()=>n=void 0},()=>{}),n};return(i,s)=>r().then(a=>s(a.transaction(e,i).objectStore(e)))}let as;function Pi(){return as||(as=FE("keyval-store","keyval")),as}function _a(t,e=Pi()){return e("readonly",n=>pn(n.get(t)))}function pr(t,e,n=Pi()){return n("readwrite",r=>(r.put(e,t),pn(r.transaction)))}function Hc(t,e=Pi()){return e("readwrite",n=>(n.delete(t),pn(n.transaction)))}function zE(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},pn(t.transaction)}function $c(t=Pi()){return t("readonly",e=>{if(e.getAll&&e.getAllKeys)return Promise.all([pn(e.getAllKeys()),pn(e.getAll())]).then(([r,i])=>r.map((s,a)=>[s,i[a]]));const n=[];return t("readonly",r=>zE(r,i=>n.push([i.key,i.value])).then(()=>n))})}function jE(t){const e=`${t}:threads:`;return $c().then(n=>n.filter(([r])=>typeof r=="string"&&r.startsWith(e)).map(([,r])=>r))}async function UE(t,e){const n=`${t}:threads:${e}`;return await _a(n)??null}function HE(t,e){const n=`${t}:messages:`;return $c().then(r=>r.filter(([s])=>typeof s=="string"&&s.startsWith(n)).map(([,s])=>s).filter(s=>s.metadata?.thread_id===e||s.threadId===e).sort((s,a)=>{const o=s.metadata?.created_at||s.createdAt||"",u=a.metadata?.created_at||a.createdAt||"";return String(o).localeCompare(String(u))}))}function $E(){const t=F.c(7),{locator:e}=vt();let n;t[0]!==e?(n=ot.threads(e),t[0]=e,t[1]=n):n=t[1];let r;t[2]!==e?(r=()=>jE(e),t[2]=e,t[3]=r):r=t[3];let i;t[4]!==n||t[5]!==r?(i={queryKey:n,queryFn:r,staleTime:3e4},t[4]=n,t[5]=r,t[6]=i):i=t[6];const{data:s}=ga(i);return s}function ZE(t){const e=F.c(11),{locator:n}=vt();let r;e[0]!==n||e[1]!==t?(r=ot.threadMessages(n,t),e[0]=n,e[1]=t,e[2]=r):r=e[2];let i;e[3]!==n||e[4]!==t?(i=()=>HE(n,t),e[3]=n,e[4]=t,e[5]=i):i=e[5];let s;e[6]!==r||e[7]!==i?(s={queryKey:r,queryFn:i,staleTime:3e4},e[6]=r,e[7]=i,e[8]=s):s=e[8];const{data:a}=ga(s);let o;return e[9]!==a?(o=a??[],e[9]=a,e[10]=o):o=e[10],o}function Zc(){const t=F.c(28),{locator:e}=vt(),n=Cl();let r;t[0]!==e?(r=async T=>{const x=`${e}:threads:${T.id}`;return await pr(x,T),T},t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e||t[3]!==n?(i=()=>{n.invalidateQueries({queryKey:ot.threads(e)})},t[2]=e,t[3]=n,t[4]=i):i=t[4];let s;t[5]!==r||t[6]!==i?(s={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=s):s=t[7];const a=ln(s);let o;t[8]!==e?(o=async T=>{const{id:x,updates:_}=T,b=`${e}:threads:${x}`,C=await _a(b);if(!C)throw new Error(`Thread ${x} not found`);const w={...C,..._};return await pr(b,w),w},t[8]=e,t[9]=o):o=t[9];let u;t[10]!==e||t[11]!==n?(u=T=>{n.invalidateQueries({queryKey:ot.threads(e)}),n.invalidateQueries({queryKey:ot.thread(e,T.id)})},t[10]=e,t[11]=n,t[12]=u):u=t[12];let l;t[13]!==o||t[14]!==u?(l={mutationFn:o,onSuccess:u},t[13]=o,t[14]=u,t[15]=l):l=t[15];const d=ln(l);let c;t[16]!==e?(c=async T=>{const x=`${e}:threads:${T}`;return await Hc(x),T},t[16]=e,t[17]=c):c=t[17];let h;t[18]!==e||t[19]!==n?(h=()=>{n.invalidateQueries({queryKey:ot.threads(e)})},t[18]=e,t[19]=n,t[20]=h):h=t[20];let p;t[21]!==c||t[22]!==h?(p={mutationFn:c,onSuccess:h},t[21]=c,t[22]=h,t[23]=p):p=t[23];const g=ln(p);let E;return t[24]!==g||t[25]!==a||t[26]!==d?(E={insert:a,update:d,delete:g},t[24]=g,t[25]=a,t[26]=d,t[27]=E):E=t[27],E}function YE(){const t=F.c(37),{locator:e}=vt(),n=Cl();let r;t[0]!==e?(r=async C=>{const w=`${e}:messages:${C.id}`;return await pr(w,C),C},t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e||t[3]!==n?(i=C=>{const w=C.metadata?.thread_id||C.threadId;w&&n.invalidateQueries({queryKey:ot.threadMessages(e,w)}),n.invalidateQueries({queryKey:ot.messages(e)})},t[2]=e,t[3]=n,t[4]=i):i=t[4];let s;t[5]!==r||t[6]!==i?(s={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=s):s=t[7];const a=ln(s);let o;t[8]!==e?(o=async C=>(await Promise.all(C.map(w=>{const k=`${e}:messages:${w.id}`;return pr(k,w)})),C),t[8]=e,t[9]=o):o=t[9];let u;t[10]!==e||t[11]!==n?(u=C=>{const w=new Set;for(const k of C){const v=k.metadata?.thread_id||k.threadId;v&&w.add(v)}for(const k of w)n.invalidateQueries({queryKey:ot.threadMessages(e,k)});n.invalidateQueries({queryKey:ot.messages(e)})},t[10]=e,t[11]=n,t[12]=u):u=t[12];let l;t[13]!==o||t[14]!==u?(l={mutationFn:o,onSuccess:u},t[13]=o,t[14]=u,t[15]=l):l=t[15];const d=ln(l);let c;t[16]!==e?(c=async C=>{const{id:w,updates:k}=C,v=`${e}:messages:${w}`,O=await _a(v);if(!O)throw new Error(`Message ${w} not found`);const P={...O,...k};return await pr(v,P),P},t[16]=e,t[17]=c):c=t[17];let h;t[18]!==e||t[19]!==n?(h=C=>{const w=C.metadata?.thread_id||C.threadId;w&&n.invalidateQueries({queryKey:ot.threadMessages(e,w)}),n.invalidateQueries({queryKey:ot.messages(e)})},t[18]=e,t[19]=n,t[20]=h):h=t[20];let p;t[21]!==c||t[22]!==h?(p={mutationFn:c,onSuccess:h},t[21]=c,t[22]=h,t[23]=p):p=t[23];const g=ln(p);let E;t[24]!==e?(E=async C=>{const w=`${e}:messages:${C}`;return await Hc(w),C},t[24]=e,t[25]=E):E=t[25];let T;t[26]!==e||t[27]!==n?(T=()=>{n.invalidateQueries({queryKey:ot.messages(e)})},t[26]=e,t[27]=n,t[28]=T):T=t[28];let x;t[29]!==T||t[30]!==E?(x={mutationFn:E,onSuccess:T},t[29]=T,t[30]=E,t[31]=x):x=t[31];const _=ln(x);let b;return t[32]!==_||t[33]!==a||t[34]!==d||t[35]!==g?(b={insert:a,insertMany:d,update:g,delete:_},t[32]=_,t[33]=a,t[34]=d,t[35]=g,t[36]=b):b=t[36],b}const Yc=()=>crypto.randomUUID(),qc=D.createContext(null);function qE(t){const e=F.c(15),{children:n}=t,{locator:r}=vt(),i=Zc(),[s,a]=Dn(Br.threadManagerState(r)+":active-id",VE);let o;e[0]!==a||e[1]!==i?(o=g=>{const E=g?.id||crypto.randomUUID(),T=new Date().toISOString(),x={id:E,title:g?.title||"",created_at:g?.created_at||T,updated_at:g?.updated_at||T,hidden:g?.hidden??!1};return i.insert.mutate(x),a(E),x},e[0]=a,e[1]=i,e[2]=o):o=e[2];const u=o;let l;e[3]!==s||e[4]!==a||e[5]!==i?(l=g=>{i.update.mutate({id:g,updates:{hidden:!0,updated_at:new Date().toISOString()}}),s===g&&a(Yc())},e[3]=s,e[4]=a,e[5]=i,e[6]=l):l=e[6];const d=l;let c;e[7]!==s||e[8]!==u||e[9]!==d||e[10]!==a?(c={activeThreadId:s,createThread:u,setActiveThreadId:a,hideThread:d},e[7]=s,e[8]=u,e[9]=d,e[10]=a,e[11]=c):c=e[11];const h=c;let p;return e[12]!==n||e[13]!==h?(p=m.jsx(qc.Provider,{value:h,children:n}),e[12]=n,e[13]=h,e[14]=p):p=e[14],p}function VE(t){return t||Yc()}function ya(){const t=D.useContext(qc);if(!t)throw new Error("useChat must be used within a ChatProvider");return t}function ka(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var En=ka();function Vc(t){En=t}var mr={exec:()=>null};function Se(t,e=""){let n=typeof t=="string"?t:t.source;const r={replace:(i,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(nt.caret,"$1"),n=n.replace(i,a),r},getRegex:()=>new RegExp(n,e)};return r}var nt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},WE=/^(?:[ \t]*(?:\n|$))+/,GE=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,KE=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ur=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,QE=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Aa=/(?:[*+-]|\d{1,9}[.)])/,Wc=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Gc=Se(Wc).replace(/bull/g,Aa).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),XE=Se(Wc).replace(/bull/g,Aa).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Sa=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,JE=/^[^\n]+/,Ca=/(?!\s*\])(?:\\.|[^\[\]\\])+/,e2=Se(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ca).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),t2=Se(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Aa).getRegex(),Mi="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ia=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,n2=Se("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ia).replace("tag",Mi).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Kc=Se(Sa).replace("hr",Ur).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Mi).getRegex(),r2=Se(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Kc).getRegex(),Na={blockquote:r2,code:GE,def:e2,fences:KE,heading:QE,hr:Ur,html:n2,lheading:Gc,list:t2,newline:WE,paragraph:Kc,table:mr,text:JE},Ko=Se("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ur).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Mi).getRegex(),i2={...Na,lheading:XE,table:Ko,paragraph:Se(Sa).replace("hr",Ur).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ko).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Mi).getRegex()},s2={...Na,html:Se(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ia).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:mr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Se(Sa).replace("hr",Ur).replace("heading",` *#{1,6} *[^
|
|
40
|
+
]`).replace("lheading",Gc).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},a2=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,o2=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Qc=/^( {2,}|\\)\n(?!\s*$)/,u2=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Bi=/[\p{P}\p{S}]/u,wa=/[\s\p{P}\p{S}]/u,Xc=/[^\s\p{P}\p{S}]/u,l2=Se(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,wa).getRegex(),Jc=/(?!~)[\p{P}\p{S}]/u,c2=/(?!~)[\s\p{P}\p{S}]/u,d2=/(?:[^\s\p{P}\p{S}]|~)/u,f2=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,ed=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,h2=Se(ed,"u").replace(/punct/g,Bi).getRegex(),p2=Se(ed,"u").replace(/punct/g,Jc).getRegex(),td="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",m2=Se(td,"gu").replace(/notPunctSpace/g,Xc).replace(/punctSpace/g,wa).replace(/punct/g,Bi).getRegex(),g2=Se(td,"gu").replace(/notPunctSpace/g,d2).replace(/punctSpace/g,c2).replace(/punct/g,Jc).getRegex(),b2=Se("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Xc).replace(/punctSpace/g,wa).replace(/punct/g,Bi).getRegex(),E2=Se(/\\(punct)/,"gu").replace(/punct/g,Bi).getRegex(),x2=Se(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),T2=Se(Ia).replace("(?:-->|$)","-->").getRegex(),_2=Se("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",T2).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ti=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,y2=Se(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Ti).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),nd=Se(/^!?\[(label)\]\[(ref)\]/).replace("label",Ti).replace("ref",Ca).getRegex(),rd=Se(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ca).getRegex(),k2=Se("reflink|nolink(?!\\()","g").replace("reflink",nd).replace("nolink",rd).getRegex(),va={_backpedal:mr,anyPunctuation:E2,autolink:x2,blockSkip:f2,br:Qc,code:o2,del:mr,emStrongLDelim:h2,emStrongRDelimAst:m2,emStrongRDelimUnd:b2,escape:a2,link:y2,nolink:rd,punctuation:l2,reflink:nd,reflinkSearch:k2,tag:_2,text:u2,url:mr},A2={...va,link:Se(/^!?\[(label)\]\((.*?)\)/).replace("label",Ti).getRegex(),reflink:Se(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ti).getRegex()},qs={...va,emStrongRDelimAst:g2,emStrongLDelim:p2,url:Se(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},S2={...qs,br:Se(Qc).replace("{2,}","*").getRegex(),text:Se(qs.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Xr={normal:Na,gfm:i2,pedantic:s2},Xn={normal:va,gfm:qs,breaks:S2,pedantic:A2},C2={"&":"&","<":"<",">":">",'"':""","'":"'"},Qo=t=>C2[t];function Ct(t,e){if(e){if(nt.escapeTest.test(t))return t.replace(nt.escapeReplace,Qo)}else if(nt.escapeTestNoEncode.test(t))return t.replace(nt.escapeReplaceNoEncode,Qo);return t}function Xo(t){try{t=encodeURI(t).replace(nt.percentDecode,"%")}catch{return null}return t}function Jo(t,e){const n=t.replace(nt.findPipe,(s,a,o)=>{let u=!1,l=a;for(;--l>=0&&o[l]==="\\";)u=!u;return u?"|":" |"}),r=n.split(nt.splitPipe);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(nt.slashPipe,"|");return r}function Jn(t,e,n){const r=t.length;if(r===0)return"";let i=0;for(;i<r&&t.charAt(r-i-1)===e;)i++;return t.slice(0,r-i)}function I2(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])n++;else if(t[r]===e[1]&&(n--,n<0))return r;return n>0?-2:-1}function eu(t,e,n,r,i){const s=e.href,a=e.title||null,o=t[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;const u={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:a,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,u}function N2(t,e,n){const r=t.match(n.other.indentCodeCompensation);if(r===null)return e;const i=r[1];return e.split(`
|
|
41
|
+
`).map(s=>{const a=s.match(n.other.beginningSpace);if(a===null)return s;const[o]=a;return o.length>=i.length?s.slice(i.length):s}).join(`
|
|
42
|
+
`)}var _i=class{options;rules;lexer;constructor(t){this.options=t||En}space(t){const e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){const e=this.rules.block.code.exec(t);if(e){const n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Jn(n,`
|
|
43
|
+
`)}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const n=e[0],r=N2(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){const e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){const r=Jn(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){const e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:Jn(e[0],`
|
|
44
|
+
`)}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){let n=Jn(e[0],`
|
|
45
|
+
`).split(`
|
|
46
|
+
`),r="",i="";const s=[];for(;n.length>0;){let a=!1;const o=[];let u;for(u=0;u<n.length;u++)if(this.rules.other.blockquoteStart.test(n[u]))o.push(n[u]),a=!0;else if(!a)o.push(n[u]);else break;n=n.slice(u);const l=o.join(`
|
|
47
|
+
`),d=l.replace(this.rules.other.blockquoteSetextReplace,`
|
|
48
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
49
|
+
${l}`:l,i=i?`${i}
|
|
50
|
+
${d}`:d;const c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,s,!0),this.lexer.state.top=c,n.length===0)break;const h=s.at(-1);if(h?.type==="code")break;if(h?.type==="blockquote"){const p=h,g=p.raw+`
|
|
51
|
+
`+n.join(`
|
|
52
|
+
`),E=this.blockquote(g);s[s.length-1]=E,r=r.substring(0,r.length-p.raw.length)+E.raw,i=i.substring(0,i.length-p.text.length)+E.text;break}else if(h?.type==="list"){const p=h,g=p.raw+`
|
|
53
|
+
`+n.join(`
|
|
54
|
+
`),E=this.list(g);s[s.length-1]=E,r=r.substring(0,r.length-h.raw.length)+E.raw,i=i.substring(0,i.length-p.raw.length)+E.raw,n=g.substring(s.at(-1).raw.length).split(`
|
|
55
|
+
`);continue}}return{type:"blockquote",raw:r,tokens:s,text:i}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim();const r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const s=this.rules.other.listItemRegex(n);let a=!1;for(;t;){let u=!1,l="",d="";if(!(e=s.exec(t))||this.rules.block.hr.test(t))break;l=e[0],t=t.substring(l.length);let c=e[2].split(`
|
|
56
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,x=>" ".repeat(3*x.length)),h=t.split(`
|
|
57
|
+
`,1)[0],p=!c.trim(),g=0;if(this.options.pedantic?(g=2,d=c.trimStart()):p?g=e[1].length+1:(g=e[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,d=c.slice(g),g+=e[1].length),p&&this.rules.other.blankLine.test(h)&&(l+=h+`
|
|
58
|
+
`,t=t.substring(h.length+1),u=!0),!u){const x=this.rules.other.nextBulletRegex(g),_=this.rules.other.hrRegex(g),b=this.rules.other.fencesBeginRegex(g),C=this.rules.other.headingBeginRegex(g),w=this.rules.other.htmlBeginRegex(g);for(;t;){const k=t.split(`
|
|
59
|
+
`,1)[0];let v;if(h=k,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),v=h):v=h.replace(this.rules.other.tabCharGlobal," "),b.test(h)||C.test(h)||w.test(h)||x.test(h)||_.test(h))break;if(v.search(this.rules.other.nonSpaceChar)>=g||!h.trim())d+=`
|
|
60
|
+
`+v.slice(g);else{if(p||c.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||b.test(c)||C.test(c)||_.test(c))break;d+=`
|
|
61
|
+
`+h}!p&&!h.trim()&&(p=!0),l+=k+`
|
|
62
|
+
`,t=t.substring(k.length+1),c=v.slice(g)}}i.loose||(a?i.loose=!0:this.rules.other.doubleBlankLine.test(l)&&(a=!0));let E=null,T;this.options.gfm&&(E=this.rules.other.listIsTask.exec(d),E&&(T=E[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:l,task:!!E,checked:T,loose:!1,text:d,tokens:[]}),i.raw+=l}const o=i.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let u=0;u<i.items.length;u++)if(this.lexer.state.top=!1,i.items[u].tokens=this.lexer.blockTokens(i.items[u].text,[]),!i.loose){const l=i.items[u].tokens.filter(c=>c.type==="space"),d=l.length>0&&l.some(c=>this.rules.other.anyLine.test(c.raw));i.loose=d}if(i.loose)for(let u=0;u<i.items.length;u++)i.items[u].loose=!0;return i}}html(t){const e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){const e=this.rules.block.def.exec(t);if(e){const n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:r,title:i}}}table(t){const e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;const n=Jo(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
63
|
+
`):[],s={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const a of r)this.rules.other.tableAlignRight.test(a)?s.align.push("right"):this.rules.other.tableAlignCenter.test(a)?s.align.push("center"):this.rules.other.tableAlignLeft.test(a)?s.align.push("left"):s.align.push(null);for(let a=0;a<n.length;a++)s.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:s.align[a]});for(const a of i)s.rows.push(Jo(a,s.header.length).map((o,u)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:s.align[u]})));return s}}lheading(t){const e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){const e=this.rules.block.paragraph.exec(t);if(e){const n=e[1].charAt(e[1].length-1)===`
|
|
64
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){const e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){const e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){const e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){const e=this.rules.inline.link.exec(t);if(e){const n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const s=Jn(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{const s=I2(e[2],"()");if(s===-2)return;if(s>-1){const o=(e[0].indexOf("!")===0?5:4)+e[1].length+s;e[2]=e[2].substring(0,s),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let r=e[2],i="";if(this.options.pedantic){const s=this.rules.other.pedanticHrefTitle.exec(r);s&&(r=s[1],i=s[3])}else i=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),eu(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){const r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[r.toLowerCase()];if(!i){const s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return eu(n,i,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const s=[...r[0]].length-1;let a,o,u=s,l=0;const d=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*t.length+s);(r=d.exec(e))!=null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){u+=o;continue}else if((r[5]||r[6])&&s%3&&!((s+o)%3)){l+=o;continue}if(u-=o,u>0)continue;o=Math.min(o,o+u+l);const c=[...r[0]][0].length,h=t.slice(0,s+r.index+c+o);if(Math.min(s,o)%2){const g=h.slice(1,-1);return{type:"em",raw:h,text:g,tokens:this.lexer.inlineTokens(g)}}const p=h.slice(2,-2);return{type:"strong",raw:h,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(t){const e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){const e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){const e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){const e=this.rules.inline.autolink.exec(t);if(e){let n,r;return e[2]==="@"?(n=e[1],r="mailto:"+n):(n=e[1],r=n),{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,r;if(e[2]==="@")n=e[0],r="mailto:"+n;else{let i;do i=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(i!==e[0]);n=e[0],e[1]==="www."?r="http://"+e[0]:r=e[0]}return{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){const e=this.rules.inline.text.exec(t);if(e){const n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},Bt=class Vs{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||En,this.options.tokenizer=this.options.tokenizer||new _i,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={other:nt,block:Xr.normal,inline:Xn.normal};this.options.pedantic?(n.block=Xr.pedantic,n.inline=Xn.pedantic):this.options.gfm&&(n.block=Xr.gfm,this.options.breaks?n.inline=Xn.breaks:n.inline=Xn.gfm),this.tokenizer.rules=n}static get rules(){return{block:Xr,inline:Xn}}static lex(e,n){return new Vs(n).lex(e)}static lexInline(e,n){return new Vs(n).inlineTokens(e)}lex(e){e=e.replace(nt.carriageReturn,`
|
|
65
|
+
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){const r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],r=!1){for(this.options.pedantic&&(e=e.replace(nt.tabCharGlobal," ").replace(nt.spaceLine,""));e;){let i;if(this.options.extensions?.block?.some(a=>(i=a.call({lexer:this},e,n))?(e=e.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);const a=n.at(-1);i.raw.length===1&&a!==void 0?a.raw+=`
|
|
66
|
+
`:n.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);const a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=`
|
|
67
|
+
`+i.raw,a.text+=`
|
|
68
|
+
`+i.text,this.inlineQueue.at(-1).src=a.text):n.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);const a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=`
|
|
69
|
+
`+i.raw,a.text+=`
|
|
70
|
+
`+i.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),n.push(i);continue}let s=e;if(this.options.extensions?.startBlock){let a=1/0;const o=e.slice(1);let u;this.options.extensions.startBlock.forEach(l=>{u=l.call({lexer:this},o),typeof u=="number"&&u>=0&&(a=Math.min(a,u))}),a<1/0&&a>=0&&(s=e.substring(0,a+1))}if(this.state.top&&(i=this.tokenizer.paragraph(s))){const a=n.at(-1);r&&a?.type==="paragraph"?(a.raw+=`
|
|
71
|
+
`+i.raw,a.text+=`
|
|
72
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(i),r=s.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);const a=n.at(-1);a?.type==="text"?(a.raw+=`
|
|
73
|
+
`+i.raw,a.text+=`
|
|
74
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(i);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){let r=e,i=null;if(this.tokens.links){const o=Object.keys(this.tokens.links);if(o.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)o.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let s=!1,a="";for(;e;){s||(a=""),s=!1;let o;if(this.options.extensions?.inline?.some(l=>(o=l.call({lexer:this},e,n))?(e=e.substring(o.raw.length),n.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);const l=n.at(-1);o.type==="text"&&l?.type==="text"?(l.raw+=o.raw,l.text+=o.text):n.push(o);continue}if(o=this.tokenizer.emStrong(e,r,a)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.del(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),n.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),n.push(o);continue}let u=e;if(this.options.extensions?.startInline){let l=1/0;const d=e.slice(1);let c;this.options.extensions.startInline.forEach(h=>{c=h.call({lexer:this},d),typeof c=="number"&&c>=0&&(l=Math.min(l,c))}),l<1/0&&l>=0&&(u=e.substring(0,l+1))}if(o=this.tokenizer.inlineText(u)){e=e.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(a=o.raw.slice(-1)),s=!0;const l=n.at(-1);l?.type==="text"?(l.raw+=o.raw,l.text+=o.text):n.push(o);continue}if(e){const l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return n}},yi=class{options;parser;constructor(t){this.options=t||En}space(t){return""}code({text:t,lang:e,escaped:n}){const r=(e||"").match(nt.notSpaceStart)?.[0],i=t.replace(nt.endingNewline,"")+`
|
|
75
|
+
`;return r?'<pre><code class="language-'+Ct(r)+'">'+(n?i:Ct(i,!0))+`</code></pre>
|
|
76
|
+
`:"<pre><code>"+(n?i:Ct(i,!0))+`</code></pre>
|
|
77
|
+
`}blockquote({tokens:t}){return`<blockquote>
|
|
78
|
+
${this.parser.parse(t)}</blockquote>
|
|
79
|
+
`}html({text:t}){return t}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
|
|
80
|
+
`}hr(t){return`<hr>
|
|
81
|
+
`}list(t){const e=t.ordered,n=t.start;let r="";for(let a=0;a<t.items.length;a++){const o=t.items[a];r+=this.listitem(o)}const i=e?"ol":"ul",s=e&&n!==1?' start="'+n+'"':"";return"<"+i+s+`>
|
|
82
|
+
`+r+"</"+i+`>
|
|
83
|
+
`}listitem(t){let e="";if(t.task){const n=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=n+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=n+" "+Ct(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):e+=n+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`<li>${e}</li>
|
|
84
|
+
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
85
|
+
`}table(t){let e="",n="";for(let i=0;i<t.header.length;i++)n+=this.tablecell(t.header[i]);e+=this.tablerow({text:n});let r="";for(let i=0;i<t.rows.length;i++){const s=t.rows[i];n="";for(let a=0;a<s.length;a++)n+=this.tablecell(s[a]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|
86
|
+
<thead>
|
|
87
|
+
`+e+`</thead>
|
|
88
|
+
`+r+`</table>
|
|
89
|
+
`}tablerow({text:t}){return`<tr>
|
|
90
|
+
${t}</tr>
|
|
91
|
+
`}tablecell(t){const e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|
92
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Ct(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){const r=this.parser.parseInline(n),i=Xo(t);if(i===null)return r;t=i;let s='<a href="'+t+'"';return e&&(s+=' title="'+Ct(e)+'"'),s+=">"+r+"</a>",s}image({href:t,title:e,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));const i=Xo(t);if(i===null)return Ct(n);t=i;let s=`<img src="${t}" alt="${n}"`;return e&&(s+=` title="${Ct(e)}"`),s+=">",s}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Ct(t.text)}},Ra=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},Ft=class Ws{options;renderer;textRenderer;constructor(e){this.options=e||En,this.options.renderer=this.options.renderer||new yi,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ra}static parse(e,n){return new Ws(n).parse(e)}static parseInline(e,n){return new Ws(n).parseInline(e)}parse(e,n=!0){let r="";for(let i=0;i<e.length;i++){const s=e[i];if(this.options.extensions?.renderers?.[s.type]){const o=s,u=this.options.extensions.renderers[o.type].call({parser:this},o);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(o.type)){r+=u||"";continue}}const a=s;switch(a.type){case"space":{r+=this.renderer.space(a);continue}case"hr":{r+=this.renderer.hr(a);continue}case"heading":{r+=this.renderer.heading(a);continue}case"code":{r+=this.renderer.code(a);continue}case"table":{r+=this.renderer.table(a);continue}case"blockquote":{r+=this.renderer.blockquote(a);continue}case"list":{r+=this.renderer.list(a);continue}case"html":{r+=this.renderer.html(a);continue}case"paragraph":{r+=this.renderer.paragraph(a);continue}case"text":{let o=a,u=this.renderer.text(o);for(;i+1<e.length&&e[i+1].type==="text";)o=e[++i],u+=`
|
|
93
|
+
`+this.renderer.text(o);n?r+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):r+=u;continue}default:{const o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return r}parseInline(e,n=this.renderer){let r="";for(let i=0;i<e.length;i++){const s=e[i];if(this.options.extensions?.renderers?.[s.type]){const o=this.options.extensions.renderers[s.type].call({parser:this},s);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){r+=o||"";continue}}const a=s;switch(a.type){case"escape":{r+=n.text(a);break}case"html":{r+=n.html(a);break}case"link":{r+=n.link(a);break}case"image":{r+=n.image(a);break}case"strong":{r+=n.strong(a);break}case"em":{r+=n.em(a);break}case"codespan":{r+=n.codespan(a);break}case"br":{r+=n.br(a);break}case"del":{r+=n.del(a);break}case"text":{r+=n.text(a);break}default:{const o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return r}},ci=class{options;block;constructor(t){this.options=t||En}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?Bt.lex:Bt.lexInline}provideParser(){return this.block?Ft.parse:Ft.parseInline}},w2=class{defaults=ka();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Ft;Renderer=yi;TextRenderer=Ra;Lexer=Bt;Tokenizer=_i;Hooks=ci;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(const r of t)switch(n=n.concat(e.call(this,r)),r.type){case"table":{const i=r;for(const s of i.header)n=n.concat(this.walkTokens(s.tokens,e));for(const s of i.rows)for(const a of s)n=n.concat(this.walkTokens(a.tokens,e));break}case"list":{const i=r;n=n.concat(this.walkTokens(i.items,e));break}default:{const i=r;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(s=>{const a=i[s].flat(1/0);n=n.concat(this.walkTokens(a,e))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,e)))}}return n}use(...t){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{const r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){const s=e.renderers[i.name];s?e.renderers[i.name]=function(...a){let o=i.renderer.apply(this,a);return o===!1&&(o=s.apply(this,a)),o}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const s=e[i.level];s?s.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),r.extensions=e),n.renderer){const i=this.defaults.renderer||new yi(this.defaults);for(const s in n.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;const a=s,o=n.renderer[a],u=i[a];i[a]=(...l)=>{let d=o.apply(i,l);return d===!1&&(d=u.apply(i,l)),d||""}}r.renderer=i}if(n.tokenizer){const i=this.defaults.tokenizer||new _i(this.defaults);for(const s in n.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;const a=s,o=n.tokenizer[a],u=i[a];i[a]=(...l)=>{let d=o.apply(i,l);return d===!1&&(d=u.apply(i,l)),d}}r.tokenizer=i}if(n.hooks){const i=this.defaults.hooks||new ci;for(const s in n.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;const a=s,o=n.hooks[a],u=i[a];ci.passThroughHooks.has(s)?i[a]=l=>{if(this.defaults.async)return Promise.resolve(o.call(i,l)).then(c=>u.call(i,c));const d=o.call(i,l);return u.call(i,d)}:i[a]=(...l)=>{let d=o.apply(i,l);return d===!1&&(d=u.apply(i,l)),d}}r.hooks=i}if(n.walkTokens){const i=this.defaults.walkTokens,s=n.walkTokens;r.walkTokens=function(a){let o=[];return o.push(s.call(this,a)),i&&(o=o.concat(i.call(this,a))),o}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return Bt.lex(t,e??this.defaults)}parser(t,e){return Ft.parse(t,e??this.defaults)}parseMarkdown(t){return(n,r)=>{const i={...r},s={...this.defaults,...i},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&i.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));s.hooks&&(s.hooks.options=s,s.hooks.block=t);const o=s.hooks?s.hooks.provideLexer():t?Bt.lex:Bt.lexInline,u=s.hooks?s.hooks.provideParser():t?Ft.parse:Ft.parseInline;if(s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(n):n).then(l=>o(l,s)).then(l=>s.hooks?s.hooks.processAllTokens(l):l).then(l=>s.walkTokens?Promise.all(this.walkTokens(l,s.walkTokens)).then(()=>l):l).then(l=>u(l,s)).then(l=>s.hooks?s.hooks.postprocess(l):l).catch(a);try{s.hooks&&(n=s.hooks.preprocess(n));let l=o(n,s);s.hooks&&(l=s.hooks.processAllTokens(l)),s.walkTokens&&this.walkTokens(l,s.walkTokens);let d=u(l,s);return s.hooks&&(d=s.hooks.postprocess(d)),d}catch(l){return a(l)}}}onError(t,e){return n=>{if(n.message+=`
|
|
94
|
+
Please report this to https://github.com/markedjs/marked.`,t){const r="<p>An error occurred:</p><pre>"+Ct(n.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},mn=new w2;function Ce(t,e){return mn.parse(t,e)}Ce.options=Ce.setOptions=function(t){return mn.setOptions(t),Ce.defaults=mn.defaults,Vc(Ce.defaults),Ce};Ce.getDefaults=ka;Ce.defaults=En;Ce.use=function(...t){return mn.use(...t),Ce.defaults=mn.defaults,Vc(Ce.defaults),Ce};Ce.walkTokens=function(t,e){return mn.walkTokens(t,e)};Ce.parseInline=mn.parseInline;Ce.Parser=Ft;Ce.parser=Ft.parse;Ce.Renderer=yi;Ce.TextRenderer=Ra;Ce.Lexer=Bt;Ce.lexer=Bt.lex;Ce.Tokenizer=_i;Ce.Hooks=ci;Ce.parse=Ce;Ce.options;Ce.setOptions;Ce.use;Ce.walkTokens;Ce.parseInline;Ft.parse;Bt.lex;function tu(t){const e=[],n=String(t||"");let r=n.indexOf(","),i=0,s=!1;for(;!s;){r===-1&&(r=n.length,s=!0);const a=n.slice(i,r).trim();(a||!s)&&e.push(a),i=r+1,r=n.indexOf(",",i)}return e}function id(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const v2=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,R2=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,O2={};function nu(t,e){return(O2.jsx?R2:v2).test(t)}const L2=/[ \t\n\f\r]/g;function D2(t){return typeof t=="object"?t.type==="text"?ru(t.value):!1:ru(t)}function ru(t){return t.replace(L2,"")===""}class Hr{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}Hr.prototype.normal={};Hr.prototype.property={};Hr.prototype.space=void 0;function sd(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new Hr(n,r,e)}function Nr(t){return t.toLowerCase()}class ct{constructor(e,n){this.attribute=n,this.property=e}}ct.prototype.attribute="";ct.prototype.booleanish=!1;ct.prototype.boolean=!1;ct.prototype.commaOrSpaceSeparated=!1;ct.prototype.commaSeparated=!1;ct.prototype.defined=!1;ct.prototype.mustUseProperty=!1;ct.prototype.number=!1;ct.prototype.overloadedBoolean=!1;ct.prototype.property="";ct.prototype.spaceSeparated=!1;ct.prototype.space=void 0;let P2=0;const he=xn(),He=xn(),Gs=xn(),q=xn(),Re=xn(),On=xn(),ft=xn();function xn(){return 2**++P2}const Ks=Object.freeze(Object.defineProperty({__proto__:null,boolean:he,booleanish:He,commaOrSpaceSeparated:ft,commaSeparated:On,number:q,overloadedBoolean:Gs,spaceSeparated:Re},Symbol.toStringTag,{value:"Module"})),os=Object.keys(Ks);class Oa extends ct{constructor(e,n,r,i){let s=-1;if(super(e,n),iu(this,"space",i),typeof r=="number")for(;++s<os.length;){const a=os[s];iu(this,os[s],(r&Ks[a])===Ks[a])}}}Oa.prototype.defined=!0;function iu(t,e,n){n&&(t[e]=n)}function $n(t){const e={},n={};for(const[r,i]of Object.entries(t.properties)){const s=new Oa(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),e[r]=s,n[Nr(r)]=r,n[Nr(s.attribute)]=r}return new Hr(e,n,t.space)}const ad=$n({properties:{ariaActiveDescendant:null,ariaAtomic:He,ariaAutoComplete:null,ariaBusy:He,ariaChecked:He,ariaColCount:q,ariaColIndex:q,ariaColSpan:q,ariaControls:Re,ariaCurrent:null,ariaDescribedBy:Re,ariaDetails:null,ariaDisabled:He,ariaDropEffect:Re,ariaErrorMessage:null,ariaExpanded:He,ariaFlowTo:Re,ariaGrabbed:He,ariaHasPopup:null,ariaHidden:He,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Re,ariaLevel:q,ariaLive:null,ariaModal:He,ariaMultiLine:He,ariaMultiSelectable:He,ariaOrientation:null,ariaOwns:Re,ariaPlaceholder:null,ariaPosInSet:q,ariaPressed:He,ariaReadOnly:He,ariaRelevant:null,ariaRequired:He,ariaRoleDescription:Re,ariaRowCount:q,ariaRowIndex:q,ariaRowSpan:q,ariaSelected:He,ariaSetSize:q,ariaSort:null,ariaValueMax:q,ariaValueMin:q,ariaValueNow:q,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function od(t,e){return e in t?t[e]:e}function ud(t,e){return od(t,e.toLowerCase())}const M2=$n({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:On,acceptCharset:Re,accessKey:Re,action:null,allow:null,allowFullScreen:he,allowPaymentRequest:he,allowUserMedia:he,alt:null,as:null,async:he,autoCapitalize:null,autoComplete:Re,autoFocus:he,autoPlay:he,blocking:Re,capture:null,charSet:null,checked:he,cite:null,className:Re,cols:q,colSpan:null,content:null,contentEditable:He,controls:he,controlsList:Re,coords:q|On,crossOrigin:null,data:null,dateTime:null,decoding:null,default:he,defer:he,dir:null,dirName:null,disabled:he,download:Gs,draggable:He,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:he,formTarget:null,headers:Re,height:q,hidden:Gs,high:q,href:null,hrefLang:null,htmlFor:Re,httpEquiv:Re,id:null,imageSizes:null,imageSrcSet:null,inert:he,inputMode:null,integrity:null,is:null,isMap:he,itemId:null,itemProp:Re,itemRef:Re,itemScope:he,itemType:Re,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:he,low:q,manifest:null,max:null,maxLength:q,media:null,method:null,min:null,minLength:q,multiple:he,muted:he,name:null,nonce:null,noModule:he,noValidate:he,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:he,optimum:q,pattern:null,ping:Re,placeholder:null,playsInline:he,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:he,referrerPolicy:null,rel:Re,required:he,reversed:he,rows:q,rowSpan:q,sandbox:Re,scope:null,scoped:he,seamless:he,selected:he,shadowRootClonable:he,shadowRootDelegatesFocus:he,shadowRootMode:null,shape:null,size:q,sizes:null,slot:null,span:q,spellCheck:He,src:null,srcDoc:null,srcLang:null,srcSet:null,start:q,step:null,style:null,tabIndex:q,target:null,title:null,translate:null,type:null,typeMustMatch:he,useMap:null,value:He,width:q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Re,axis:null,background:null,bgColor:null,border:q,borderColor:null,bottomMargin:q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:he,declare:he,event:null,face:null,frame:null,frameBorder:null,hSpace:q,leftMargin:q,link:null,longDesc:null,lowSrc:null,marginHeight:q,marginWidth:q,noResize:he,noHref:he,noShade:he,noWrap:he,object:null,profile:null,prompt:null,rev:null,rightMargin:q,rules:null,scheme:null,scrolling:He,standby:null,summary:null,text:null,topMargin:q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:q,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:he,disableRemotePlayback:he,prefix:null,property:null,results:q,security:null,unselectable:null},space:"html",transform:ud}),B2=$n({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ft,accentHeight:q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:q,amplitude:q,arabicForm:null,ascent:q,attributeName:null,attributeType:null,azimuth:q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:q,by:null,calcMode:null,capHeight:q,className:Re,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:q,diffuseConstant:q,direction:null,display:null,dur:null,divisor:q,dominantBaseline:null,download:he,dx:null,dy:null,edgeMode:null,editable:null,elevation:q,enableBackground:null,end:null,event:null,exponent:q,externalResourcesRequired:null,fill:null,fillOpacity:q,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:On,g2:On,glyphName:On,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:q,horizOriginX:q,horizOriginY:q,id:null,ideographic:q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:q,k:q,k1:q,k2:q,k3:q,k4:q,kernelMatrix:ft,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:q,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:q,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:q,overlineThickness:q,paintOrder:null,panose1:null,path:null,pathLength:q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Re,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:q,pointsAtY:q,pointsAtZ:q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ft,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ft,rev:ft,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ft,requiredFeatures:ft,requiredFonts:ft,requiredFormats:ft,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:q,specularExponent:q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:q,strikethroughThickness:q,string:null,stroke:null,strokeDashArray:ft,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:q,strokeOpacity:q,strokeWidth:null,style:null,surfaceScale:q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ft,tabIndex:q,tableValues:null,target:null,targetX:q,targetY:q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ft,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:q,underlineThickness:q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:q,values:null,vAlphabetic:q,vMathematical:q,vectorEffect:null,vHanging:q,vIdeographic:q,version:null,vertAdvY:q,vertOriginX:q,vertOriginY:q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:od}),ld=$n({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),cd=$n({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ud}),dd=$n({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),F2={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},z2=/[A-Z]/g,su=/-[a-z]/g,j2=/^data[-\w.:]+$/i;function Fi(t,e){const n=Nr(e);let r=e,i=ct;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&j2.test(e)){if(e.charAt(4)==="-"){const s=e.slice(5).replace(su,H2);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=e.slice(4);if(!su.test(s)){let a=s.replace(z2,U2);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}i=Oa}return new i(r,e)}function U2(t){return"-"+t.toLowerCase()}function H2(t){return t.charAt(1).toUpperCase()}const $r=sd([ad,M2,ld,cd,dd],"html"),Kt=sd([ad,B2,ld,cd,dd],"svg");function au(t){const e=String(t||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function fd(t){return t.join(" ").trim()}var kn={},us,ou;function $2(){if(ou)return us;ou=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,o=/^\s+|\s+$/g,u=`
|
|
95
|
+
`,l="/",d="*",c="",h="comment",p="declaration";function g(T,x){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];x=x||{};var _=1,b=1;function C(Y){var H=Y.match(e);H&&(_+=H.length);var Q=Y.lastIndexOf(u);b=~Q?Y.length-Q:b+Y.length}function w(){var Y={line:_,column:b};return function(H){return H.position=new k(Y),P(),H}}function k(Y){this.start=Y,this.end={line:_,column:b},this.source=x.source}k.prototype.content=T;function v(Y){var H=new Error(x.source+":"+_+":"+b+": "+Y);if(H.reason=Y,H.filename=x.source,H.line=_,H.column=b,H.source=T,!x.silent)throw H}function O(Y){var H=Y.exec(T);if(H){var Q=H[0];return C(Q),T=T.slice(Q.length),H}}function P(){O(n)}function R(Y){var H;for(Y=Y||[];H=B();)H!==!1&&Y.push(H);return Y}function B(){var Y=w();if(!(l!=T.charAt(0)||d!=T.charAt(1))){for(var H=2;c!=T.charAt(H)&&(d!=T.charAt(H)||l!=T.charAt(H+1));)++H;if(H+=2,c===T.charAt(H-1))return v("End of comment missing");var Q=T.slice(2,H-2);return b+=2,C(Q),T=T.slice(H),b+=2,Y({type:h,comment:Q})}}function j(){var Y=w(),H=O(r);if(H){if(B(),!O(i))return v("property missing ':'");var Q=O(s),ue=Y({type:p,property:E(H[0].replace(t,c)),value:Q?E(Q[0].replace(t,c)):c});return O(a),ue}}function J(){var Y=[];R(Y);for(var H;H=j();)H!==!1&&(Y.push(H),R(Y));return Y}return P(),J()}function E(T){return T?T.replace(o,c):c}return us=g,us}var uu;function Z2(){if(uu)return kn;uu=1;var t=kn&&kn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(kn,"__esModule",{value:!0}),kn.default=n;const e=t($2());function n(r,i){let s=null;if(!r||typeof r!="string")return s;const a=(0,e.default)(r),o=typeof i=="function";return a.forEach(u=>{if(u.type!=="declaration")return;const{property:l,value:d}=u;o?i(l,d,u):d&&(s=s||{},s[l]=d)}),s}return kn}var er={},lu;function Y2(){if(lu)return er;lu=1,Object.defineProperty(er,"__esModule",{value:!0}),er.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(l){return!l||n.test(l)||t.test(l)},a=function(l,d){return d.toUpperCase()},o=function(l,d){return"".concat(d,"-")},u=function(l,d){return d===void 0&&(d={}),s(l)?l:(l=l.toLowerCase(),d.reactCompat?l=l.replace(i,o):l=l.replace(r,o),l.replace(e,a))};return er.camelCase=u,er}var tr,cu;function q2(){if(cu)return tr;cu=1;var t=tr&&tr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},e=t(Z2()),n=Y2();function r(i,s){var a={};return!i||typeof i!="string"||(0,e.default)(i,function(o,u){o&&u&&(a[(0,n.camelCase)(o,s)]=u)}),a}return r.default=r,tr=r,tr}var V2=q2();const W2=ma(V2),zi=hd("end"),Rt=hd("start");function hd(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function G2(t){const e=Rt(t),n=zi(t);if(e&&n)return{start:e,end:n}}function gr(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?du(t.position):"start"in t||"end"in t?du(t):"line"in t||"column"in t?Qs(t):""}function Qs(t){return fu(t&&t.line)+":"+fu(t&&t.column)}function du(t){return Qs(t&&t.start)+"-"+Qs(t&&t.end)}function fu(t){return t&&typeof t=="number"?t:1}class Qe extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof e=="string"?i=e:!s.cause&&e&&(a=!0,i=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?s.ruleId=r:(s.source=r.slice(0,u),s.ruleId=r.slice(u+1))}if(!s.place&&s.ancestors&&s.ancestors){const u=s.ancestors[s.ancestors.length-1];u&&(s.place=u.position)}const o=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=gr(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Qe.prototype.file="";Qe.prototype.name="";Qe.prototype.reason="";Qe.prototype.message="";Qe.prototype.stack="";Qe.prototype.column=void 0;Qe.prototype.line=void 0;Qe.prototype.ancestors=void 0;Qe.prototype.cause=void 0;Qe.prototype.fatal=void 0;Qe.prototype.place=void 0;Qe.prototype.ruleId=void 0;Qe.prototype.source=void 0;const La={}.hasOwnProperty,K2=new Map,Q2=/[A-Z]/g,X2=new Set(["table","tbody","thead","tfoot","tr"]),J2=new Set(["td","th"]),pd="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ex(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=ux(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=ox(n,e.jsx,e.jsxs)}const i={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Kt:$r,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},s=md(i,t,void 0);return s&&typeof s!="string"?s:i.create(t,i.Fragment,{children:s||void 0},void 0)}function md(t,e,n){if(e.type==="element")return tx(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return nx(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return ix(t,e,n);if(e.type==="mdxjsEsm")return rx(t,e);if(e.type==="root")return sx(t,e,n);if(e.type==="text")return ax(t,e)}function tx(t,e,n){const r=t.schema;let i=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Kt,t.schema=i),t.ancestors.push(e);const s=bd(t,e.tagName,!1),a=lx(t,e);let o=Pa(t,e);return X2.has(e.tagName)&&(o=o.filter(function(u){return typeof u=="string"?!D2(u):!0})),gd(t,a,s,e),Da(a,o),t.ancestors.pop(),t.schema=r,t.create(e,s,a,n)}function nx(t,e){if(e.data&&e.data.estree&&t.evaluater){const r=e.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}wr(t,e.position)}function rx(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);wr(t,e.position)}function ix(t,e,n){const r=t.schema;let i=r;e.name==="svg"&&r.space==="html"&&(i=Kt,t.schema=i),t.ancestors.push(e);const s=e.name===null?t.Fragment:bd(t,e.name,!0),a=cx(t,e),o=Pa(t,e);return gd(t,a,s,e),Da(a,o),t.ancestors.pop(),t.schema=r,t.create(e,s,a,n)}function sx(t,e,n){const r={};return Da(r,Pa(t,e)),t.create(e,t.Fragment,r,n)}function ax(t,e){return e.value}function gd(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function Da(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function ox(t,e,n){return r;function r(i,s,a,o){const l=Array.isArray(a.children)?n:e;return o?l(s,a,o):l(s,a)}}function ux(t,e){return n;function n(r,i,s,a){const o=Array.isArray(s.children),u=Rt(r);return e(i,s,a,o,{columnNumber:u?u.column-1:void 0,fileName:t,lineNumber:u?u.line:void 0},void 0)}}function lx(t,e){const n={};let r,i;for(i in e.properties)if(i!=="children"&&La.call(e.properties,i)){const s=dx(t,i,e.properties[i]);if(s){const[a,o]=s;t.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&J2.has(e.tagName)?r=o:n[a]=o}}if(r){const s=n.style||(n.style={});s[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function cx(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const s=r.data.estree.body[0];s.type;const a=s.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,t.evaluater.evaluateExpression(o.argument))}else wr(t,e.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const o=r.value.data.estree.body[0];o.type,s=t.evaluater.evaluateExpression(o.expression)}else wr(t,e.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function Pa(t,e){const n=[];let r=-1;const i=t.passKeys?new Map:K2;for(;++r<e.children.length;){const s=e.children[r];let a;if(t.passKeys){const u=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(u){const l=i.get(u)||0;a=u+"-"+l,i.set(u,l+1)}}const o=md(t,s,a);o!==void 0&&n.push(o)}return n}function dx(t,e,n){const r=Fi(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?id(n):fd(n)),r.property==="style"){let i=typeof n=="object"?n:fx(t,String(n));return t.stylePropertyNameCase==="css"&&(i=hx(i)),["style",i]}return[t.elementAttributeNameCase==="react"&&r.space?F2[r.property]||r.property:r.attribute,n]}}function fx(t,e){try{return W2(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const r=n,i=new Qe("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=t.filePath||void 0,i.url=pd+"#cannot-parse-style-attribute",i}}function bd(t,e,n){let r;if(!n)r={type:"Literal",value:e};else if(e.includes(".")){const i=e.split(".");let s=-1,a;for(;++s<i.length;){const o=nu(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};a=a?{type:"MemberExpression",object:a,property:o,computed:!!(s&&o.type==="Literal"),optional:!1}:o}r=a}else r=nu(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const i=r.value;return La.call(t.components,i)?t.components[i]:i}if(t.evaluater)return t.evaluater.evaluateExpression(r);wr(t)}function wr(t,e){const n=new Qe("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=pd+"#cannot-handle-mdx-estrees-without-createevaluater",n}function hx(t){const e={};let n;for(n in t)La.call(t,n)&&(e[px(n)]=t[n]);return e}function px(t){let e=t.replace(Q2,mx);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function mx(t){return"-"+t.toLowerCase()}const ls={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},gx={};function Ma(t,e){const n=gx,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Ed(t,r,i)}function Ed(t,e,n){if(bx(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return hu(t.children,e,n)}return Array.isArray(t)?hu(t,e,n):""}function hu(t,e,n){const r=[];let i=-1;for(;++i<t.length;)r[i]=Ed(t[i],e,n);return r.join("")}function bx(t){return!!(t&&typeof t=="object")}const pu=document.createElement("i");function Ba(t){const e="&"+t+";";pu.innerHTML=e;const n=pu.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function pt(t,e,n,r){const i=t.length;let s=0,a;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(e,n),t.splice(...a);else for(n&&t.splice(e,n);s<r.length;)a=r.slice(s,s+1e4),a.unshift(e,0),t.splice(...a),s+=1e4,e+=1e4}function bt(t,e){return t.length>0?(pt(t,t.length,0,e),t):e}const mu={}.hasOwnProperty;function xd(t){const e={};let n=-1;for(;++n<t.length;)Ex(e,t[n]);return e}function Ex(t,e){let n;for(n in e){const i=(mu.call(t,n)?t[n]:void 0)||(t[n]={}),s=e[n];let a;if(s)for(a in s){mu.call(i,a)||(i[a]=[]);const o=s[a];xx(i[a],Array.isArray(o)?o:o?[o]:[])}}}function xx(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);pt(t,0,0,r)}function Td(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function yt(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const tt=Qt(/[A-Za-z]/),Ke=Qt(/[\dA-Za-z]/),Tx=Qt(/[#-'*+\--9=?A-Z^-~]/);function ki(t){return t!==null&&(t<32||t===127)}const Xs=Qt(/\d/),_x=Qt(/[\dA-Fa-f]/),yx=Qt(/[!-/:-@[-`{-~]/);function ae(t){return t!==null&&t<-2}function ve(t){return t!==null&&(t<0||t===32)}function xe(t){return t===-2||t===-1||t===32}const ji=Qt(new RegExp("\\p{P}|\\p{S}","u")),gn=Qt(/\s/);function Qt(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Zn(t){const e=[];let n=-1,r=0,i=0;for(;++n<t.length;){const s=t.charCodeAt(n);let a="";if(s===37&&Ke(t.charCodeAt(n+1))&&Ke(t.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(a=String.fromCharCode(s));else if(s>55295&&s<57344){const o=t.charCodeAt(n+1);s<56320&&o>56319&&o<57344?(a=String.fromCharCode(s,o),i=1):a="�"}else a=String.fromCharCode(s);a&&(e.push(t.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function ye(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(u){return xe(u)?(t.enter(n),o(u)):e(u)}function o(u){return xe(u)&&s++<i?(t.consume(u),o):(t.exit(n),e(u))}}const kx={tokenize:Ax};function Ax(t){const e=t.attempt(this.parser.constructs.contentInitial,r,i);let n;return e;function r(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),ye(t,e,"linePrefix")}function i(o){return t.enter("paragraph"),s(o)}function s(o){const u=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,a(o)}function a(o){if(o===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(o);return}return ae(o)?(t.consume(o),t.exit("chunkText"),s):(t.consume(o),a)}}const Sx={tokenize:Cx},gu={tokenize:Ix};function Cx(t){const e=this,n=[];let r=0,i,s,a;return o;function o(b){if(r<n.length){const C=n[r];return e.containerState=C[1],t.attempt(C[0].continuation,u,l)(b)}return l(b)}function u(b){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&_();const C=e.events.length;let w=C,k;for(;w--;)if(e.events[w][0]==="exit"&&e.events[w][1].type==="chunkFlow"){k=e.events[w][1].end;break}x(r);let v=C;for(;v<e.events.length;)e.events[v][1].end={...k},v++;return pt(e.events,w+1,0,e.events.slice(C)),e.events.length=v,l(b)}return o(b)}function l(b){if(r===n.length){if(!i)return h(b);if(i.currentConstruct&&i.currentConstruct.concrete)return g(b);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(gu,d,c)(b)}function d(b){return i&&_(),x(r),h(b)}function c(b){return e.parser.lazy[e.now().line]=r!==n.length,a=e.now().offset,g(b)}function h(b){return e.containerState={},t.attempt(gu,p,g)(b)}function p(b){return r++,n.push([e.currentConstruct,e.containerState]),h(b)}function g(b){if(b===null){i&&_(),x(0),t.consume(b);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),E(b)}function E(b){if(b===null){T(t.exit("chunkFlow"),!0),x(0),t.consume(b);return}return ae(b)?(t.consume(b),T(t.exit("chunkFlow")),r=0,e.interrupt=void 0,o):(t.consume(b),E)}function T(b,C){const w=e.sliceStream(b);if(C&&w.push(null),b.previous=s,s&&(s.next=b),s=b,i.defineSkip(b.start),i.write(w),e.parser.lazy[b.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<a&&(!i.events[k][1].end||i.events[k][1].end.offset>a))return;const v=e.events.length;let O=v,P,R;for(;O--;)if(e.events[O][0]==="exit"&&e.events[O][1].type==="chunkFlow"){if(P){R=e.events[O][1].end;break}P=!0}for(x(r),k=v;k<e.events.length;)e.events[k][1].end={...R},k++;pt(e.events,O+1,0,e.events.slice(v)),e.events.length=k}}function x(b){let C=n.length;for(;C-- >b;){const w=n[C];e.containerState=w[1],w[0].exit.call(e,t)}n.length=b}function _(){i.write([null]),s=void 0,i=void 0,e.containerState._closeFlow=void 0}}function Ix(t,e,n){return ye(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Mn(t){if(t===null||ve(t)||gn(t))return 1;if(ji(t))return 2}function Ui(t,e,n){const r=[];let i=-1;for(;++i<t.length;){const s=t[i].resolveAll;s&&!r.includes(s)&&(e=s(e,n),r.push(s))}return e}const Js={name:"attention",resolveAll:Nx,tokenize:wx};function Nx(t,e){let n=-1,r,i,s,a,o,u,l,d;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(r=n;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&e.sliceSerialize(t[r][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[r][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;u=t[r][1].end.offset-t[r][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const c={...t[r][1].end},h={...t[n][1].start};bu(c,-u),bu(h,u),a={type:u>1?"strongSequence":"emphasisSequence",start:c,end:{...t[r][1].end}},o={type:u>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:h},s={type:u>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},t[r][1].end={...a.start},t[n][1].start={...o.end},l=[],t[r][1].end.offset-t[r][1].start.offset&&(l=bt(l,[["enter",t[r][1],e],["exit",t[r][1],e]])),l=bt(l,[["enter",i,e],["enter",a,e],["exit",a,e],["enter",s,e]]),l=bt(l,Ui(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),l=bt(l,[["exit",s,e],["enter",o,e],["exit",o,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(d=2,l=bt(l,[["enter",t[n][1],e],["exit",t[n][1],e]])):d=0,pt(t,r-1,n-r+3,l),n=r+l.length-d-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function wx(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Mn(r);let s;return a;function a(u){return s=u,t.enter("attentionSequence"),o(u)}function o(u){if(u===s)return t.consume(u),o;const l=t.exit("attentionSequence"),d=Mn(u),c=!d||d===2&&i||n.includes(u),h=!i||i===2&&d||n.includes(r);return l._open=!!(s===42?c:c&&(i||!h)),l._close=!!(s===42?h:h&&(d||!c)),e(u)}}function bu(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const vx={name:"autolink",tokenize:Rx};function Rx(t,e,n){let r=0;return i;function i(p){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(p),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),s}function s(p){return tt(p)?(t.consume(p),a):p===64?n(p):l(p)}function a(p){return p===43||p===45||p===46||Ke(p)?(r=1,o(p)):l(p)}function o(p){return p===58?(t.consume(p),r=0,u):(p===43||p===45||p===46||Ke(p))&&r++<32?(t.consume(p),o):(r=0,l(p))}function u(p){return p===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(p),t.exit("autolinkMarker"),t.exit("autolink"),e):p===null||p===32||p===60||ki(p)?n(p):(t.consume(p),u)}function l(p){return p===64?(t.consume(p),d):Tx(p)?(t.consume(p),l):n(p)}function d(p){return Ke(p)?c(p):n(p)}function c(p){return p===46?(t.consume(p),r=0,d):p===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(p),t.exit("autolinkMarker"),t.exit("autolink"),e):h(p)}function h(p){if((p===45||Ke(p))&&r++<63){const g=p===45?h:c;return t.consume(p),g}return n(p)}}const Zr={partial:!0,tokenize:Ox};function Ox(t,e,n){return r;function r(s){return xe(s)?ye(t,i,"linePrefix")(s):i(s)}function i(s){return s===null||ae(s)?e(s):n(s)}}const _d={continuation:{tokenize:Dx},exit:Px,name:"blockQuote",tokenize:Lx};function Lx(t,e,n){const r=this;return i;function i(a){if(a===62){const o=r.containerState;return o.open||(t.enter("blockQuote",{_container:!0}),o.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(a),t.exit("blockQuoteMarker"),s}return n(a)}function s(a){return xe(a)?(t.enter("blockQuotePrefixWhitespace"),t.consume(a),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(a))}}function Dx(t,e,n){const r=this;return i;function i(a){return xe(a)?ye(t,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return t.attempt(_d,e,n)(a)}}function Px(t){t.exit("blockQuote")}const yd={name:"characterEscape",tokenize:Mx};function Mx(t,e,n){return r;function r(s){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(s),t.exit("escapeMarker"),i}function i(s){return yx(s)?(t.enter("characterEscapeValue"),t.consume(s),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(s)}}const kd={name:"characterReference",tokenize:Bx};function Bx(t,e,n){const r=this;let i=0,s,a;return o;function o(c){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(c),t.exit("characterReferenceMarker"),u}function u(c){return c===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(c),t.exit("characterReferenceMarkerNumeric"),l):(t.enter("characterReferenceValue"),s=31,a=Ke,d(c))}function l(c){return c===88||c===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(c),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),s=6,a=_x,d):(t.enter("characterReferenceValue"),s=7,a=Xs,d(c))}function d(c){if(c===59&&i){const h=t.exit("characterReferenceValue");return a===Ke&&!Ba(r.sliceSerialize(h))?n(c):(t.enter("characterReferenceMarker"),t.consume(c),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return a(c)&&i++<s?(t.consume(c),d):n(c)}}const Eu={partial:!0,tokenize:zx},xu={concrete:!0,name:"codeFenced",tokenize:Fx};function Fx(t,e,n){const r=this,i={partial:!0,tokenize:w};let s=0,a=0,o;return u;function u(k){return l(k)}function l(k){const v=r.events[r.events.length-1];return s=v&&v[1].type==="linePrefix"?v[2].sliceSerialize(v[1],!0).length:0,o=k,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),d(k)}function d(k){return k===o?(a++,t.consume(k),d):a<3?n(k):(t.exit("codeFencedFenceSequence"),xe(k)?ye(t,c,"whitespace")(k):c(k))}function c(k){return k===null||ae(k)?(t.exit("codeFencedFence"),r.interrupt?e(k):t.check(Eu,E,C)(k)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),h(k))}function h(k){return k===null||ae(k)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),c(k)):xe(k)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),ye(t,p,"whitespace")(k)):k===96&&k===o?n(k):(t.consume(k),h)}function p(k){return k===null||ae(k)?c(k):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),g(k))}function g(k){return k===null||ae(k)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),c(k)):k===96&&k===o?n(k):(t.consume(k),g)}function E(k){return t.attempt(i,C,T)(k)}function T(k){return t.enter("lineEnding"),t.consume(k),t.exit("lineEnding"),x}function x(k){return s>0&&xe(k)?ye(t,_,"linePrefix",s+1)(k):_(k)}function _(k){return k===null||ae(k)?t.check(Eu,E,C)(k):(t.enter("codeFlowValue"),b(k))}function b(k){return k===null||ae(k)?(t.exit("codeFlowValue"),_(k)):(t.consume(k),b)}function C(k){return t.exit("codeFenced"),e(k)}function w(k,v,O){let P=0;return R;function R(H){return k.enter("lineEnding"),k.consume(H),k.exit("lineEnding"),B}function B(H){return k.enter("codeFencedFence"),xe(H)?ye(k,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):j(H)}function j(H){return H===o?(k.enter("codeFencedFenceSequence"),J(H)):O(H)}function J(H){return H===o?(P++,k.consume(H),J):P>=a?(k.exit("codeFencedFenceSequence"),xe(H)?ye(k,Y,"whitespace")(H):Y(H)):O(H)}function Y(H){return H===null||ae(H)?(k.exit("codeFencedFence"),v(H)):O(H)}}}function zx(t,e,n){const r=this;return i;function i(a){return a===null?n(a):(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}const cs={name:"codeIndented",tokenize:Ux},jx={partial:!0,tokenize:Hx};function Ux(t,e,n){const r=this;return i;function i(l){return t.enter("codeIndented"),ye(t,s,"linePrefix",5)(l)}function s(l){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(l):n(l)}function a(l){return l===null?u(l):ae(l)?t.attempt(jx,a,u)(l):(t.enter("codeFlowValue"),o(l))}function o(l){return l===null||ae(l)?(t.exit("codeFlowValue"),a(l)):(t.consume(l),o)}function u(l){return t.exit("codeIndented"),e(l)}}function Hx(t,e,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):ae(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i):ye(t,s,"linePrefix",5)(a)}function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(a):ae(a)?i(a):n(a)}}const $x={name:"codeText",previous:Yx,resolve:Zx,tokenize:qx};function Zx(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)i===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(i=r):(r===e||t[r][1].type==="lineEnding")&&(t[i][1].type="codeTextData",r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),e-=r-i-2,r=i+2),i=void 0);return t}function Yx(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function qx(t,e,n){let r=0,i,s;return a;function a(c){return t.enter("codeText"),t.enter("codeTextSequence"),o(c)}function o(c){return c===96?(t.consume(c),r++,o):(t.exit("codeTextSequence"),u(c))}function u(c){return c===null?n(c):c===32?(t.enter("space"),t.consume(c),t.exit("space"),u):c===96?(s=t.enter("codeTextSequence"),i=0,d(c)):ae(c)?(t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),u):(t.enter("codeTextData"),l(c))}function l(c){return c===null||c===32||c===96||ae(c)?(t.exit("codeTextData"),u(c)):(t.consume(c),l)}function d(c){return c===96?(t.consume(c),i++,d):i===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(c)):(s.type="codeTextData",l(c))}}class Vx{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const i=n||0;this.setCursor(Math.trunc(e));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&nr(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),nr(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),nr(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);nr(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);nr(this.left,n.reverse())}}}function nr(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function Ad(t){const e={};let n=-1,r,i,s,a,o,u,l;const d=new Vx(t);for(;++n<d.length;){for(;n in e;)n=e[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,s=0,s<u.length&&u[s][1].type==="lineEndingBlank"&&(s+=2),s<u.length&&u[s][1].type==="content"))for(;++s<u.length&&u[s][1].type!=="content";)u[s][1].type==="chunkText"&&(u[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,Wx(d,n)),n=e[n],l=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(a=d.get(s),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=s);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...d.get(i)[1].start},o=d.slice(i,n),o.unshift(r),d.splice(i,n-i+1,o))}}return pt(t,0,Number.POSITIVE_INFINITY,d.slice(0)),!l}function Wx(t,e){const n=t.get(e)[1],r=t.get(e)[2];let i=e-1;const s=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const o=a.events,u=[],l={};let d,c,h=-1,p=n,g=0,E=0;const T=[E];for(;p;){for(;t.get(++i)[1]!==p;);s.push(i),p._tokenizer||(d=r.sliceStream(p),p.next||d.push(null),c&&a.defineSkip(p.start),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(d),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),c=p,p=p.next}for(p=n;++h<o.length;)o[h][0]==="exit"&&o[h-1][0]==="enter"&&o[h][1].type===o[h-1][1].type&&o[h][1].start.line!==o[h][1].end.line&&(E=h+1,T.push(E),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(a.events=[],p?(p._tokenizer=void 0,p.previous=void 0):T.pop(),h=T.length;h--;){const x=o.slice(T[h],T[h+1]),_=s.pop();u.push([_,_+x.length-1]),t.splice(_,2,x)}for(u.reverse(),h=-1;++h<u.length;)l[g+u[h][0]]=g+u[h][1],g+=u[h][1]-u[h][0]-1;return l}const Gx={resolve:Qx,tokenize:Xx},Kx={partial:!0,tokenize:Jx};function Qx(t){return Ad(t),t}function Xx(t,e){let n;return r;function r(o){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?s(o):ae(o)?t.check(Kx,a,s)(o):(t.consume(o),i)}function s(o){return t.exit("chunkContent"),t.exit("content"),e(o)}function a(o){return t.consume(o),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Jx(t,e,n){const r=this;return i;function i(a){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),ye(t,s,"linePrefix")}function s(a){if(a===null||ae(a))return n(a);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(a):t.interrupt(r.parser.constructs.flow,n,e)(a)}}function Sd(t,e,n,r,i,s,a,o,u){const l=u||Number.POSITIVE_INFINITY;let d=0;return c;function c(x){return x===60?(t.enter(r),t.enter(i),t.enter(s),t.consume(x),t.exit(s),h):x===null||x===32||x===41||ki(x)?n(x):(t.enter(r),t.enter(a),t.enter(o),t.enter("chunkString",{contentType:"string"}),E(x))}function h(x){return x===62?(t.enter(s),t.consume(x),t.exit(s),t.exit(i),t.exit(r),e):(t.enter(o),t.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===62?(t.exit("chunkString"),t.exit(o),h(x)):x===null||x===60||ae(x)?n(x):(t.consume(x),x===92?g:p)}function g(x){return x===60||x===62||x===92?(t.consume(x),p):p(x)}function E(x){return!d&&(x===null||x===41||ve(x))?(t.exit("chunkString"),t.exit(o),t.exit(a),t.exit(r),e(x)):d<l&&x===40?(t.consume(x),d++,E):x===41?(t.consume(x),d--,E):x===null||x===32||x===40||ki(x)?n(x):(t.consume(x),x===92?T:E)}function T(x){return x===40||x===41||x===92?(t.consume(x),E):E(x)}}function Cd(t,e,n,r,i,s){const a=this;let o=0,u;return l;function l(p){return t.enter(r),t.enter(i),t.consume(p),t.exit(i),t.enter(s),d}function d(p){return o>999||p===null||p===91||p===93&&!u||p===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(p):p===93?(t.exit(s),t.enter(i),t.consume(p),t.exit(i),t.exit(r),e):ae(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),d):(t.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===null||p===91||p===93||ae(p)||o++>999?(t.exit("chunkString"),d(p)):(t.consume(p),u||(u=!xe(p)),p===92?h:c)}function h(p){return p===91||p===92||p===93?(t.consume(p),o++,c):c(p)}}function Id(t,e,n,r,i,s){let a;return o;function o(h){return h===34||h===39||h===40?(t.enter(r),t.enter(i),t.consume(h),t.exit(i),a=h===40?41:h,u):n(h)}function u(h){return h===a?(t.enter(i),t.consume(h),t.exit(i),t.exit(r),e):(t.enter(s),l(h))}function l(h){return h===a?(t.exit(s),u(a)):h===null?n(h):ae(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),ye(t,l,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===a||h===null||ae(h)?(t.exit("chunkString"),l(h)):(t.consume(h),h===92?c:d)}function c(h){return h===a||h===92?(t.consume(h),d):d(h)}}function br(t,e){let n;return r;function r(i){return ae(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):xe(i)?ye(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const eT={name:"definition",tokenize:nT},tT={partial:!0,tokenize:rT};function nT(t,e,n){const r=this;let i;return s;function s(p){return t.enter("definition"),a(p)}function a(p){return Cd.call(r,t,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function o(p){return i=yt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(t.enter("definitionMarker"),t.consume(p),t.exit("definitionMarker"),u):n(p)}function u(p){return ve(p)?br(t,l)(p):l(p)}function l(p){return Sd(t,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return t.attempt(tT,c,c)(p)}function c(p){return xe(p)?ye(t,h,"whitespace")(p):h(p)}function h(p){return p===null||ae(p)?(t.exit("definition"),r.parser.defined.push(i),e(p)):n(p)}}function rT(t,e,n){return r;function r(o){return ve(o)?br(t,i)(o):n(o)}function i(o){return Id(t,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return xe(o)?ye(t,a,"whitespace")(o):a(o)}function a(o){return o===null||ae(o)?e(o):n(o)}}const iT={name:"hardBreakEscape",tokenize:sT};function sT(t,e,n){return r;function r(s){return t.enter("hardBreakEscape"),t.consume(s),i}function i(s){return ae(s)?(t.exit("hardBreakEscape"),e(s)):n(s)}}const aT={name:"headingAtx",resolve:oT,tokenize:uT};function oT(t,e){let n=t.length-2,r=3,i,s;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},s={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},pt(t,r,n-r+1,[["enter",i,e],["enter",s,e],["exit",s,e],["exit",i,e]])),t}function uT(t,e,n){let r=0;return i;function i(d){return t.enter("atxHeading"),s(d)}function s(d){return t.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&r++<6?(t.consume(d),a):d===null||ve(d)?(t.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(t.enter("atxHeadingSequence"),u(d)):d===null||ae(d)?(t.exit("atxHeading"),e(d)):xe(d)?ye(t,o,"whitespace")(d):(t.enter("atxHeadingText"),l(d))}function u(d){return d===35?(t.consume(d),u):(t.exit("atxHeadingSequence"),o(d))}function l(d){return d===null||d===35||ve(d)?(t.exit("atxHeadingText"),o(d)):(t.consume(d),l)}}const lT=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Tu=["pre","script","style","textarea"],cT={concrete:!0,name:"htmlFlow",resolveTo:hT,tokenize:pT},dT={partial:!0,tokenize:gT},fT={partial:!0,tokenize:mT};function hT(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function pT(t,e,n){const r=this;let i,s,a,o,u;return l;function l(A){return d(A)}function d(A){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(A),c}function c(A){return A===33?(t.consume(A),h):A===47?(t.consume(A),s=!0,E):A===63?(t.consume(A),i=3,r.interrupt?e:N):tt(A)?(t.consume(A),a=String.fromCharCode(A),T):n(A)}function h(A){return A===45?(t.consume(A),i=2,p):A===91?(t.consume(A),i=5,o=0,g):tt(A)?(t.consume(A),i=4,r.interrupt?e:N):n(A)}function p(A){return A===45?(t.consume(A),r.interrupt?e:N):n(A)}function g(A){const te="CDATA[";return A===te.charCodeAt(o++)?(t.consume(A),o===te.length?r.interrupt?e:j:g):n(A)}function E(A){return tt(A)?(t.consume(A),a=String.fromCharCode(A),T):n(A)}function T(A){if(A===null||A===47||A===62||ve(A)){const te=A===47,ie=a.toLowerCase();return!te&&!s&&Tu.includes(ie)?(i=1,r.interrupt?e(A):j(A)):lT.includes(a.toLowerCase())?(i=6,te?(t.consume(A),x):r.interrupt?e(A):j(A)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(A):s?_(A):b(A))}return A===45||Ke(A)?(t.consume(A),a+=String.fromCharCode(A),T):n(A)}function x(A){return A===62?(t.consume(A),r.interrupt?e:j):n(A)}function _(A){return xe(A)?(t.consume(A),_):R(A)}function b(A){return A===47?(t.consume(A),R):A===58||A===95||tt(A)?(t.consume(A),C):xe(A)?(t.consume(A),b):R(A)}function C(A){return A===45||A===46||A===58||A===95||Ke(A)?(t.consume(A),C):w(A)}function w(A){return A===61?(t.consume(A),k):xe(A)?(t.consume(A),w):b(A)}function k(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(t.consume(A),u=A,v):xe(A)?(t.consume(A),k):O(A)}function v(A){return A===u?(t.consume(A),u=null,P):A===null||ae(A)?n(A):(t.consume(A),v)}function O(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||ve(A)?w(A):(t.consume(A),O)}function P(A){return A===47||A===62||xe(A)?b(A):n(A)}function R(A){return A===62?(t.consume(A),B):n(A)}function B(A){return A===null||ae(A)?j(A):xe(A)?(t.consume(A),B):n(A)}function j(A){return A===45&&i===2?(t.consume(A),Q):A===60&&i===1?(t.consume(A),ue):A===62&&i===4?(t.consume(A),V):A===63&&i===3?(t.consume(A),N):A===93&&i===5?(t.consume(A),fe):ae(A)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(dT,se,J)(A)):A===null||ae(A)?(t.exit("htmlFlowData"),J(A)):(t.consume(A),j)}function J(A){return t.check(fT,Y,se)(A)}function Y(A){return t.enter("lineEnding"),t.consume(A),t.exit("lineEnding"),H}function H(A){return A===null||ae(A)?J(A):(t.enter("htmlFlowData"),j(A))}function Q(A){return A===45?(t.consume(A),N):j(A)}function ue(A){return A===47?(t.consume(A),a="",ce):j(A)}function ce(A){if(A===62){const te=a.toLowerCase();return Tu.includes(te)?(t.consume(A),V):j(A)}return tt(A)&&a.length<8?(t.consume(A),a+=String.fromCharCode(A),ce):j(A)}function fe(A){return A===93?(t.consume(A),N):j(A)}function N(A){return A===62?(t.consume(A),V):A===45&&i===2?(t.consume(A),N):j(A)}function V(A){return A===null||ae(A)?(t.exit("htmlFlowData"),se(A)):(t.consume(A),V)}function se(A){return t.exit("htmlFlow"),e(A)}}function mT(t,e,n){const r=this;return i;function i(a){return ae(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s):n(a)}function s(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}function gT(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Zr,e,n)}}const bT={name:"htmlText",tokenize:ET};function ET(t,e,n){const r=this;let i,s,a;return o;function o(N){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(N),u}function u(N){return N===33?(t.consume(N),l):N===47?(t.consume(N),w):N===63?(t.consume(N),b):tt(N)?(t.consume(N),O):n(N)}function l(N){return N===45?(t.consume(N),d):N===91?(t.consume(N),s=0,g):tt(N)?(t.consume(N),_):n(N)}function d(N){return N===45?(t.consume(N),p):n(N)}function c(N){return N===null?n(N):N===45?(t.consume(N),h):ae(N)?(a=c,ue(N)):(t.consume(N),c)}function h(N){return N===45?(t.consume(N),p):c(N)}function p(N){return N===62?Q(N):N===45?h(N):c(N)}function g(N){const V="CDATA[";return N===V.charCodeAt(s++)?(t.consume(N),s===V.length?E:g):n(N)}function E(N){return N===null?n(N):N===93?(t.consume(N),T):ae(N)?(a=E,ue(N)):(t.consume(N),E)}function T(N){return N===93?(t.consume(N),x):E(N)}function x(N){return N===62?Q(N):N===93?(t.consume(N),x):E(N)}function _(N){return N===null||N===62?Q(N):ae(N)?(a=_,ue(N)):(t.consume(N),_)}function b(N){return N===null?n(N):N===63?(t.consume(N),C):ae(N)?(a=b,ue(N)):(t.consume(N),b)}function C(N){return N===62?Q(N):b(N)}function w(N){return tt(N)?(t.consume(N),k):n(N)}function k(N){return N===45||Ke(N)?(t.consume(N),k):v(N)}function v(N){return ae(N)?(a=v,ue(N)):xe(N)?(t.consume(N),v):Q(N)}function O(N){return N===45||Ke(N)?(t.consume(N),O):N===47||N===62||ve(N)?P(N):n(N)}function P(N){return N===47?(t.consume(N),Q):N===58||N===95||tt(N)?(t.consume(N),R):ae(N)?(a=P,ue(N)):xe(N)?(t.consume(N),P):Q(N)}function R(N){return N===45||N===46||N===58||N===95||Ke(N)?(t.consume(N),R):B(N)}function B(N){return N===61?(t.consume(N),j):ae(N)?(a=B,ue(N)):xe(N)?(t.consume(N),B):P(N)}function j(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(t.consume(N),i=N,J):ae(N)?(a=j,ue(N)):xe(N)?(t.consume(N),j):(t.consume(N),Y)}function J(N){return N===i?(t.consume(N),i=void 0,H):N===null?n(N):ae(N)?(a=J,ue(N)):(t.consume(N),J)}function Y(N){return N===null||N===34||N===39||N===60||N===61||N===96?n(N):N===47||N===62||ve(N)?P(N):(t.consume(N),Y)}function H(N){return N===47||N===62||ve(N)?P(N):n(N)}function Q(N){return N===62?(t.consume(N),t.exit("htmlTextData"),t.exit("htmlText"),e):n(N)}function ue(N){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(N),t.exit("lineEnding"),ce}function ce(N){return xe(N)?ye(t,fe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):fe(N)}function fe(N){return t.enter("htmlTextData"),a(N)}}const Fa={name:"labelEnd",resolveAll:yT,resolveTo:kT,tokenize:AT},xT={tokenize:ST},TT={tokenize:CT},_T={tokenize:IT};function yT(t){let e=-1;const n=[];for(;++e<t.length;){const r=t[e][1];if(n.push(t[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",e+=i}}return t.length!==n.length&&pt(t,0,t.length,n),t}function kT(t,e){let n=t.length,r=0,i,s,a,o;for(;n--;)if(i=t[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;t[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(t[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const u={type:t[s][1].type==="labelLink"?"link":"image",start:{...t[s][1].start},end:{...t[t.length-1][1].end}},l={type:"label",start:{...t[s][1].start},end:{...t[a][1].end}},d={type:"labelText",start:{...t[s+r+2][1].end},end:{...t[a-2][1].start}};return o=[["enter",u,e],["enter",l,e]],o=bt(o,t.slice(s+1,s+r+3)),o=bt(o,[["enter",d,e]]),o=bt(o,Ui(e.parser.constructs.insideSpan.null,t.slice(s+r+4,a-3),e)),o=bt(o,[["exit",d,e],t[a-2],t[a-1],["exit",l,e]]),o=bt(o,t.slice(a+1)),o=bt(o,[["exit",u,e]]),pt(t,s,t.length,o),t}function AT(t,e,n){const r=this;let i=r.events.length,s,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return o;function o(h){return s?s._inactive?c(h):(a=r.parser.defined.includes(yt(r.sliceSerialize({start:s.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(h),t.exit("labelMarker"),t.exit("labelEnd"),u):n(h)}function u(h){return h===40?t.attempt(xT,d,a?d:c)(h):h===91?t.attempt(TT,d,a?l:c)(h):a?d(h):c(h)}function l(h){return t.attempt(_T,d,c)(h)}function d(h){return e(h)}function c(h){return s._balanced=!0,n(h)}}function ST(t,e,n){return r;function r(c){return t.enter("resource"),t.enter("resourceMarker"),t.consume(c),t.exit("resourceMarker"),i}function i(c){return ve(c)?br(t,s)(c):s(c)}function s(c){return c===41?d(c):Sd(t,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function a(c){return ve(c)?br(t,u)(c):d(c)}function o(c){return n(c)}function u(c){return c===34||c===39||c===40?Id(t,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):d(c)}function l(c){return ve(c)?br(t,d)(c):d(c)}function d(c){return c===41?(t.enter("resourceMarker"),t.consume(c),t.exit("resourceMarker"),t.exit("resource"),e):n(c)}}function CT(t,e,n){const r=this;return i;function i(o){return Cd.call(r,t,s,a,"reference","referenceMarker","referenceString")(o)}function s(o){return r.parser.defined.includes(yt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(o):n(o)}function a(o){return n(o)}}function IT(t,e,n){return r;function r(s){return t.enter("reference"),t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),i}function i(s){return s===93?(t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),t.exit("reference"),e):n(s)}}const NT={name:"labelStartImage",resolveAll:Fa.resolveAll,tokenize:wT};function wT(t,e,n){const r=this;return i;function i(o){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(o),t.exit("labelImageMarker"),s}function s(o){return o===91?(t.enter("labelMarker"),t.consume(o),t.exit("labelMarker"),t.exit("labelImage"),a):n(o)}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):e(o)}}const vT={name:"labelStartLink",resolveAll:Fa.resolveAll,tokenize:RT};function RT(t,e,n){const r=this;return i;function i(a){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelLink"),s}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):e(a)}}const ds={name:"lineEnding",tokenize:OT};function OT(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),ye(t,e,"linePrefix")}}const di={name:"thematicBreak",tokenize:LT};function LT(t,e,n){let r=0,i;return s;function s(l){return t.enter("thematicBreak"),a(l)}function a(l){return i=l,o(l)}function o(l){return l===i?(t.enter("thematicBreakSequence"),u(l)):r>=3&&(l===null||ae(l))?(t.exit("thematicBreak"),e(l)):n(l)}function u(l){return l===i?(t.consume(l),r++,u):(t.exit("thematicBreakSequence"),xe(l)?ye(t,o,"whitespace")(l):o(l))}}const st={continuation:{tokenize:BT},exit:zT,name:"list",tokenize:MT},DT={partial:!0,tokenize:jT},PT={partial:!0,tokenize:FT};function MT(t,e,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return o;function o(p){const g=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Xs(p)){if(r.containerState.type||(r.containerState.type=g,t.enter(g,{_container:!0})),g==="listUnordered")return t.enter("listItemPrefix"),p===42||p===45?t.check(di,n,l)(p):l(p);if(!r.interrupt||p===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),u(p)}return n(p)}function u(p){return Xs(p)&&++a<10?(t.consume(p),u):(!r.interrupt||a<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(t.exit("listItemValue"),l(p)):n(p)}function l(p){return t.enter("listItemMarker"),t.consume(p),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,t.check(Zr,r.interrupt?n:d,t.attempt(DT,h,c))}function d(p){return r.containerState.initialBlankLine=!0,s++,h(p)}function c(p){return xe(p)?(t.enter("listItemPrefixWhitespace"),t.consume(p),t.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=s+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(p)}}function BT(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(Zr,i,s);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ye(t,e,"listItemIndent",r.containerState.size+1)(o)}function s(o){return r.containerState.furtherBlankLines||!xe(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(PT,e,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,ye(t,t.attempt(st,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function FT(t,e,n){const r=this;return ye(t,i,"listItemIndent",r.containerState.size+1);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?e(s):n(s)}}function zT(t){t.exit(this.containerState.type)}function jT(t,e,n){const r=this;return ye(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=r.events[r.events.length-1];return!xe(s)&&a&&a[1].type==="listItemPrefixWhitespace"?e(s):n(s)}}const _u={name:"setextUnderline",resolveTo:UT,tokenize:HT};function UT(t,e){let n=t.length,r,i,s;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!s&&t[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",s?(t.splice(i,0,["enter",a,e]),t.splice(s+1,0,["exit",t[r][1],e]),t[r][1].end={...t[s][1].end}):t[r][1]=a,t.push(["exit",a,e]),t}function HT(t,e,n){const r=this;let i;return s;function s(l){let d=r.events.length,c;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){c=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(t.enter("setextHeadingLine"),i=l,a(l)):n(l)}function a(l){return t.enter("setextHeadingLineSequence"),o(l)}function o(l){return l===i?(t.consume(l),o):(t.exit("setextHeadingLineSequence"),xe(l)?ye(t,u,"lineSuffix")(l):u(l))}function u(l){return l===null||ae(l)?(t.exit("setextHeadingLine"),e(l)):n(l)}}const $T={tokenize:ZT};function ZT(t){const e=this,n=t.attempt(Zr,r,t.attempt(this.parser.constructs.flowInitial,i,ye(t,t.attempt(this.parser.constructs.flow,i,t.attempt(Gx,i)),"linePrefix")));return n;function r(s){if(s===null){t.consume(s);return}return t.enter("lineEndingBlank"),t.consume(s),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const YT={resolveAll:wd()},qT=Nd("string"),VT=Nd("text");function Nd(t){return{resolveAll:wd(t==="text"?WT:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],s=n.attempt(i,a,o);return a;function a(d){return l(d)?s(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),u}function u(d){return l(d)?(n.exit("data"),s(d)):(n.consume(d),u)}function l(d){if(d===null)return!0;const c=i[d];let h=-1;if(c)for(;++h<c.length;){const p=c[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function wd(t){return e;function e(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return t?t(n,r):n}}function WT(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const r=t[n-1][1],i=e.sliceStream(r);let s=i.length,a=-1,o=0,u;for(;s--;){const l=i[s];if(typeof l=="string"){for(a=l.length;l.charCodeAt(a-1)===32;)o++,a--;if(a)break;a=-1}else if(l===-2)u=!0,o++;else if(l!==-1){s++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(o=0),o){const l={type:n===t.length||u||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:r.start._bufferIndex+a,_index:r.start._index+s,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...l.start},r.start.offset===r.end.offset?Object.assign(r,l):(t.splice(n,0,["enter",l,e],["exit",l,e]),n+=2)}n++}return t}const GT={42:st,43:st,45:st,48:st,49:st,50:st,51:st,52:st,53:st,54:st,55:st,56:st,57:st,62:_d},KT={91:eT},QT={[-2]:cs,[-1]:cs,32:cs},XT={35:aT,42:di,45:[_u,di],60:cT,61:_u,95:di,96:xu,126:xu},JT={38:kd,92:yd},e_={[-5]:ds,[-4]:ds,[-3]:ds,33:NT,38:kd,42:Js,60:[vx,bT],91:vT,92:[iT,yd],93:Fa,95:Js,96:$x},t_={null:[Js,YT]},n_={null:[42,95]},r_={null:[]},i_=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:n_,contentInitial:KT,disable:r_,document:GT,flow:XT,flowInitial:QT,insideSpan:t_,string:JT,text:e_},Symbol.toStringTag,{value:"Module"}));function s_(t,e,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let a=[],o=[];const u={attempt:v(w),check:v(k),consume:_,enter:b,exit:C,interrupt:v(k,{interrupt:!0})},l={code:null,containerState:{},defineSkip:E,events:[],now:g,parser:t,previous:null,sliceSerialize:h,sliceStream:p,write:c};let d=e.tokenize.call(l,u);return e.resolveAll&&s.push(e),l;function c(B){return a=bt(a,B),T(),a[a.length-1]!==null?[]:(O(e,0),l.events=Ui(s,l.events,l),l.events)}function h(B,j){return o_(p(B),j)}function p(B){return a_(a,B)}function g(){const{_bufferIndex:B,_index:j,line:J,column:Y,offset:H}=r;return{_bufferIndex:B,_index:j,line:J,column:Y,offset:H}}function E(B){i[B.line]=B.column,R()}function T(){let B;for(;r._index<a.length;){const j=a[r._index];if(typeof j=="string")for(B=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===B&&r._bufferIndex<j.length;)x(j.charCodeAt(r._bufferIndex));else x(j)}}function x(B){d=d(B)}function _(B){ae(B)?(r.line++,r.column=1,r.offset+=B===-3?2:1,R()):B!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=B}function b(B,j){const J=j||{};return J.type=B,J.start=g(),l.events.push(["enter",J,l]),o.push(J),J}function C(B){const j=o.pop();return j.end=g(),l.events.push(["exit",j,l]),j}function w(B,j){O(B,j.from)}function k(B,j){j.restore()}function v(B,j){return J;function J(Y,H,Q){let ue,ce,fe,N;return Array.isArray(Y)?se(Y):"tokenize"in Y?se([Y]):V(Y);function V(K){return ee;function ee(re){const le=re!==null&&K[re],be=re!==null&&K.null,Pe=[...Array.isArray(le)?le:le?[le]:[],...Array.isArray(be)?be:be?[be]:[]];return se(Pe)(re)}}function se(K){return ue=K,ce=0,K.length===0?Q:A(K[ce])}function A(K){return ee;function ee(re){return N=P(),fe=K,K.partial||(l.currentConstruct=K),K.name&&l.parser.constructs.disable.null.includes(K.name)?ie():K.tokenize.call(j?Object.assign(Object.create(l),j):l,u,te,ie)(re)}}function te(K){return B(fe,N),H}function ie(K){return N.restore(),++ce<ue.length?A(ue[ce]):Q}}}function O(B,j){B.resolveAll&&!s.includes(B)&&s.push(B),B.resolve&&pt(l.events,j,l.events.length-j,B.resolve(l.events.slice(j),l)),B.resolveTo&&(l.events=B.resolveTo(l.events,l))}function P(){const B=g(),j=l.previous,J=l.currentConstruct,Y=l.events.length,H=Array.from(o);return{from:Y,restore:Q};function Q(){r=B,l.previous=j,l.currentConstruct=J,l.events.length=Y,o=H,R()}}function R(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function a_(t,e){const n=e.start._index,r=e.start._bufferIndex,i=e.end._index,s=e.end._bufferIndex;let a;if(n===i)a=[t[n].slice(r,s)];else{if(a=t.slice(n,i),r>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}s>0&&a.push(t[i].slice(0,s))}return a}function o_(t,e){let n=-1;const r=[];let i;for(;++n<t.length;){const s=t[n];let a;if(typeof s=="string")a=s;else switch(s){case-5:{a="\r";break}case-4:{a=`
|
|
96
|
+
`;break}case-3:{a=`\r
|
|
97
|
+
`;break}case-2:{a=e?" ":" ";break}case-1:{if(!e&&i)continue;a=" ";break}default:a=String.fromCharCode(s)}i=s===-2,r.push(a)}return r.join("")}function u_(t){const r={constructs:xd([i_,...(t||{}).extensions||[]]),content:i(kx),defined:[],document:i(Sx),flow:i($T),lazy:{},string:i(qT),text:i(VT)};return r;function i(s){return a;function a(o){return s_(r,s,o)}}}function l_(t){for(;!Ad(t););return t}const yu=/[\0\t\n\r]/g;function c_(){let t=1,e="",n=!0,r;return i;function i(s,a,o){const u=[];let l,d,c,h,p;for(s=e+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),c=0,e="",n&&(s.charCodeAt(0)===65279&&c++,n=void 0);c<s.length;){if(yu.lastIndex=c,l=yu.exec(s),h=l&&l.index!==void 0?l.index:s.length,p=s.charCodeAt(h),!l){e=s.slice(c);break}if(p===10&&c===h&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),c<h&&(u.push(s.slice(c,h)),t+=h-c),p){case 0:{u.push(65533),t++;break}case 9:{for(d=Math.ceil(t/4)*4,u.push(-2);t++<d;)u.push(-1);break}case 10:{u.push(-4),t=1;break}default:r=!0,t=1}c=h+1}return o&&(r&&u.push(-5),e&&u.push(e),u.push(null)),u}}const d_=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function f_(t){return t.replace(d_,h_)}function h_(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return Td(n.slice(s?2:1),s?16:10)}return Ba(n)||t}const vd={}.hasOwnProperty;function p_(t,e,n){return typeof e!="string"&&(n=e,e=void 0),m_(n)(l_(u_(n).document().write(c_()(t,e,!0))))}function m_(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Wn),autolinkProtocol:P,autolinkEmail:P,atxHeading:s(Ze),blockQuote:s(be),characterEscape:P,characterReference:P,codeFenced:s(Pe),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(Pe,a),codeText:s($e,a),codeTextData:P,data:P,codeFlowValue:P,definition:s(ke),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(qe),hardBreakEscape:s(Jt),hardBreakTrailing:s(Jt),htmlFlow:s(_n,a),htmlFlowData:P,htmlText:s(_n,a),htmlTextData:P,image:s(Ge),label:a,link:s(Wn),listItem:s(en),listItemValue:h,listOrdered:s(Wr,c),listUnordered:s(Wr),paragraph:s(Gr),reference:A,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(Ze),strong:s(es),thematicBreak:s(vh)},exit:{atxHeading:u(),atxHeadingSequence:w,autolink:u(),autolinkEmail:le,autolinkProtocol:re,blockQuote:u(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:ie,characterReferenceMarkerNumeric:ie,characterReferenceValue:K,characterReference:ee,codeFenced:u(T),codeFencedFence:E,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:R,codeIndented:u(x),codeText:u(H),codeTextData:R,data:R,definition:u(),definitionDestinationString:C,definitionLabelString:_,definitionTitleString:b,emphasis:u(),hardBreakEscape:u(j),hardBreakTrailing:u(j),htmlFlow:u(J),htmlFlowData:R,htmlText:u(Y),htmlTextData:R,image:u(ue),label:fe,labelText:ce,lineEnding:B,link:u(Q),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:te,resourceDestinationString:N,resourceTitleString:V,resource:se,setextHeading:u(O),setextHeadingLineSequence:v,setextHeadingText:k,strong:u(),thematicBreak:u()}};Rd(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(U){let W={type:"root",children:[]};const de={stack:[W],tokenStack:[],config:e,enter:o,exit:l,buffer:a,resume:d,data:n},Te=[];let Ne=-1;for(;++Ne<U.length;)if(U[Ne][1].type==="listOrdered"||U[Ne][1].type==="listUnordered")if(U[Ne][0]==="enter")Te.push(Ne);else{const xt=Te.pop();Ne=i(U,xt,Ne)}for(Ne=-1;++Ne<U.length;){const xt=e[U[Ne][0]];vd.call(xt,U[Ne][1].type)&&xt[U[Ne][1].type].call(Object.assign({sliceSerialize:U[Ne][2].sliceSerialize},de),U[Ne][1])}if(de.tokenStack.length>0){const xt=de.tokenStack[de.tokenStack.length-1];(xt[1]||ku).call(de,void 0,xt[0])}for(W.position={start:jt(U.length>0?U[0][1].start:{line:1,column:1,offset:0}),end:jt(U.length>0?U[U.length-2][1].end:{line:1,column:1,offset:0})},Ne=-1;++Ne<e.transforms.length;)W=e.transforms[Ne](W)||W;return W}function i(U,W,de){let Te=W-1,Ne=-1,xt=!1,tn,Lt,Gn,Kn;for(;++Te<=de;){const dt=U[Te];switch(dt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{dt[0]==="enter"?Ne++:Ne--,Kn=void 0;break}case"lineEndingBlank":{dt[0]==="enter"&&(tn&&!Kn&&!Ne&&!Gn&&(Gn=Te),Kn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Kn=void 0}if(!Ne&&dt[0]==="enter"&&dt[1].type==="listItemPrefix"||Ne===-1&&dt[0]==="exit"&&(dt[1].type==="listUnordered"||dt[1].type==="listOrdered")){if(tn){let yn=Te;for(Lt=void 0;yn--;){const Dt=U[yn];if(Dt[1].type==="lineEnding"||Dt[1].type==="lineEndingBlank"){if(Dt[0]==="exit")continue;Lt&&(U[Lt][1].type="lineEndingBlank",xt=!0),Dt[1].type="lineEnding",Lt=yn}else if(!(Dt[1].type==="linePrefix"||Dt[1].type==="blockQuotePrefix"||Dt[1].type==="blockQuotePrefixWhitespace"||Dt[1].type==="blockQuoteMarker"||Dt[1].type==="listItemIndent"))break}Gn&&(!Lt||Gn<Lt)&&(tn._spread=!0),tn.end=Object.assign({},Lt?U[Lt][1].start:dt[1].end),U.splice(Lt||Te,0,["exit",tn,dt[2]]),Te++,de++}if(dt[1].type==="listItemPrefix"){const yn={type:"listItem",_spread:!1,start:Object.assign({},dt[1].start),end:void 0};tn=yn,U.splice(Te,0,["enter",yn,dt[2]]),Te++,de++,Gn=void 0,Kn=!0}}}return U[W][1]._spread=xt,de}function s(U,W){return de;function de(Te){o.call(this,U(Te),Te),W&&W.call(this,Te)}}function a(){this.stack.push({type:"fragment",children:[]})}function o(U,W,de){this.stack[this.stack.length-1].children.push(U),this.stack.push(U),this.tokenStack.push([W,de||void 0]),U.position={start:jt(W.start),end:void 0}}function u(U){return W;function W(de){U&&U.call(this,de),l.call(this,de)}}function l(U,W){const de=this.stack.pop(),Te=this.tokenStack.pop();if(Te)Te[0].type!==U.type&&(W?W.call(this,U,Te[0]):(Te[1]||ku).call(this,U,Te[0]));else throw new Error("Cannot close `"+U.type+"` ("+gr({start:U.start,end:U.end})+"): it’s not open");de.position.end=jt(U.end)}function d(){return Ma(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function h(U){if(this.data.expectingFirstListItemValue){const W=this.stack[this.stack.length-2];W.start=Number.parseInt(this.sliceSerialize(U),10),this.data.expectingFirstListItemValue=void 0}}function p(){const U=this.resume(),W=this.stack[this.stack.length-1];W.lang=U}function g(){const U=this.resume(),W=this.stack[this.stack.length-1];W.meta=U}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function T(){const U=this.resume(),W=this.stack[this.stack.length-1];W.value=U.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const U=this.resume(),W=this.stack[this.stack.length-1];W.value=U.replace(/(\r?\n|\r)$/g,"")}function _(U){const W=this.resume(),de=this.stack[this.stack.length-1];de.label=W,de.identifier=yt(this.sliceSerialize(U)).toLowerCase()}function b(){const U=this.resume(),W=this.stack[this.stack.length-1];W.title=U}function C(){const U=this.resume(),W=this.stack[this.stack.length-1];W.url=U}function w(U){const W=this.stack[this.stack.length-1];if(!W.depth){const de=this.sliceSerialize(U).length;W.depth=de}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function v(U){const W=this.stack[this.stack.length-1];W.depth=this.sliceSerialize(U).codePointAt(0)===61?1:2}function O(){this.data.setextHeadingSlurpLineEnding=void 0}function P(U){const de=this.stack[this.stack.length-1].children;let Te=de[de.length-1];(!Te||Te.type!=="text")&&(Te=wh(),Te.position={start:jt(U.start),end:void 0},de.push(Te)),this.stack.push(Te)}function R(U){const W=this.stack.pop();W.value+=this.sliceSerialize(U),W.position.end=jt(U.end)}function B(U){const W=this.stack[this.stack.length-1];if(this.data.atHardBreak){const de=W.children[W.children.length-1];de.position.end=jt(U.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(W.type)&&(P.call(this,U),R.call(this,U))}function j(){this.data.atHardBreak=!0}function J(){const U=this.resume(),W=this.stack[this.stack.length-1];W.value=U}function Y(){const U=this.resume(),W=this.stack[this.stack.length-1];W.value=U}function H(){const U=this.resume(),W=this.stack[this.stack.length-1];W.value=U}function Q(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const W=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=W,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function ue(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const W=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=W,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function ce(U){const W=this.sliceSerialize(U),de=this.stack[this.stack.length-2];de.label=f_(W),de.identifier=yt(W).toLowerCase()}function fe(){const U=this.stack[this.stack.length-1],W=this.resume(),de=this.stack[this.stack.length-1];if(this.data.inReference=!0,de.type==="link"){const Te=U.children;de.children=Te}else de.alt=W}function N(){const U=this.resume(),W=this.stack[this.stack.length-1];W.url=U}function V(){const U=this.resume(),W=this.stack[this.stack.length-1];W.title=U}function se(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function te(U){const W=this.resume(),de=this.stack[this.stack.length-1];de.label=W,de.identifier=yt(this.sliceSerialize(U)).toLowerCase(),this.data.referenceType="full"}function ie(U){this.data.characterReferenceType=U.type}function K(U){const W=this.sliceSerialize(U),de=this.data.characterReferenceType;let Te;de?(Te=Td(W,de==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Te=Ba(W);const Ne=this.stack[this.stack.length-1];Ne.value+=Te}function ee(U){const W=this.stack.pop();W.position.end=jt(U.end)}function re(U){R.call(this,U);const W=this.stack[this.stack.length-1];W.url=this.sliceSerialize(U)}function le(U){R.call(this,U);const W=this.stack[this.stack.length-1];W.url="mailto:"+this.sliceSerialize(U)}function be(){return{type:"blockquote",children:[]}}function Pe(){return{type:"code",lang:null,meta:null,value:""}}function $e(){return{type:"inlineCode",value:""}}function ke(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function qe(){return{type:"emphasis",children:[]}}function Ze(){return{type:"heading",depth:0,children:[]}}function Jt(){return{type:"break"}}function _n(){return{type:"html",value:""}}function Ge(){return{type:"image",title:null,url:"",alt:null}}function Wn(){return{type:"link",title:null,url:"",children:[]}}function Wr(U){return{type:"list",ordered:U.type==="listOrdered",start:null,spread:U._spread,children:[]}}function en(U){return{type:"listItem",spread:U._spread,checked:null,children:[]}}function Gr(){return{type:"paragraph",children:[]}}function es(){return{type:"strong",children:[]}}function wh(){return{type:"text",value:""}}function vh(){return{type:"thematicBreak"}}}function jt(t){return{line:t.line,column:t.column,offset:t.offset}}function Rd(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?Rd(t,r):g_(t,r)}}function g_(t,e){let n;for(n in e)if(vd.call(e,n))switch(n){case"canContainEols":{const r=e[n];r&&t[n].push(...r);break}case"transforms":{const r=e[n];r&&t[n].push(...r);break}case"enter":case"exit":{const r=e[n];r&&Object.assign(t[n],r);break}}}function ku(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+gr({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+gr({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+gr({start:e.start,end:e.end})+") is still open")}function b_(t){const e=this;e.parser=n;function n(r){return p_(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function E_(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function x_(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
|
|
98
|
+
`}]}function T_(t,e){const n=e.value?e.value+`
|
|
99
|
+
`:"",r={},i=e.lang?e.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return e.meta&&(s.data={meta:e.meta}),t.patch(e,s),s=t.applyData(e,s),s={type:"element",tagName:"pre",properties:{},children:[s]},t.patch(e,s),s}function __(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function y_(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function k_(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=String(e.identifier).toUpperCase(),i=Zn(r.toLowerCase()),s=t.footnoteOrder.indexOf(r);let a,o=t.footnoteCounts.get(r);o===void 0?(o=0,t.footnoteOrder.push(r),a=t.footnoteOrder.length):a=s+1,o+=1,t.footnoteCounts.set(r,o);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};t.patch(e,u);const l={type:"element",tagName:"sup",properties:{},children:[u]};return t.patch(e,l),t.applyData(e,l)}function A_(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function S_(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function Od(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const i=t.all(e),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function C_(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return Od(t,e);const i={src:Zn(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,s),t.applyData(e,s)}function I_(t,e){const n={src:Zn(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function N_(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function w_(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return Od(t,e);const i={href:Zn(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,s),t.applyData(e,s)}function v_(t,e){const n={href:Zn(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function R_(t,e,n){const r=t.all(e),i=n?O_(n):Ld(e),s={},a=[];if(typeof e.checked=="boolean"){const d=r[0];let c;d&&d.type==="element"&&d.tagName==="p"?c=d:(c={type:"element",tagName:"p",properties:{},children:[]},r.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const d=r[o];(i||o!==0||d.type!=="element"||d.tagName!=="p")&&a.push({type:"text",value:`
|
|
100
|
+
`}),d.type==="element"&&d.tagName==="p"&&!i?a.push(...d.children):a.push(d)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&a.push({type:"text",value:`
|
|
101
|
+
`});const l={type:"element",tagName:"li",properties:s,children:a};return t.patch(e,l),t.applyData(e,l)}function O_(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r<n.length;)e=Ld(n[r])}return e}function Ld(t){const e=t.spread;return e??t.children.length>1}function L_(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(r,!0)};return t.patch(e,s),t.applyData(e,s)}function D_(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function P_(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function M_(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function B_(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},o=Rt(e.children[1]),u=zi(e.children[e.children.length-1]);o&&u&&(a.position={start:o,end:u}),i.push(a)}const s={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,s),t.applyData(e,s)}function F_(t,e,n){const r=n?n.children:void 0,s=(r?r.indexOf(e):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:e.children.length;let u=-1;const l=[];for(;++u<o;){const c=e.children[u],h={},p=a?a[u]:void 0;p&&(h.align=p);let g={type:"element",tagName:s,properties:h,children:[]};c&&(g.children=t.all(c),t.patch(c,g),g=t.applyData(c,g)),l.push(g)}const d={type:"element",tagName:"tr",properties:{},children:t.wrap(l,!0)};return t.patch(e,d),t.applyData(e,d)}function z_(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const Au=9,Su=32;function j_(t){const e=String(t),n=/\r?\n|\r/g;let r=n.exec(e),i=0;const s=[];for(;r;)s.push(Cu(e.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return s.push(Cu(e.slice(i),i>0,!1)),s.join("")}function Cu(t,e,n){let r=0,i=t.length;if(e){let s=t.codePointAt(r);for(;s===Au||s===Su;)r++,s=t.codePointAt(r)}if(n){let s=t.codePointAt(i-1);for(;s===Au||s===Su;)i--,s=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function U_(t,e){const n={type:"text",value:j_(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function H_(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const $_={blockquote:E_,break:x_,code:T_,delete:__,emphasis:y_,footnoteReference:k_,heading:A_,html:S_,imageReference:C_,image:I_,inlineCode:N_,linkReference:w_,link:v_,listItem:R_,list:L_,paragraph:D_,root:P_,strong:M_,table:B_,tableCell:z_,tableRow:F_,text:U_,thematicBreak:H_,toml:Jr,yaml:Jr,definition:Jr,footnoteDefinition:Jr};function Jr(){}const Dd=-1,Hi=0,Er=1,Ai=2,za=3,ja=4,Ua=5,Ha=6,Pd=7,Md=8,Iu=typeof self=="object"?self:globalThis,Z_=(t,e)=>{const n=(i,s)=>(t.set(s,i),i),r=i=>{if(t.has(i))return t.get(i);const[s,a]=e[i];switch(s){case Hi:case Dd:return n(a,i);case Er:{const o=n([],i);for(const u of a)o.push(r(u));return o}case Ai:{const o=n({},i);for(const[u,l]of a)o[r(u)]=r(l);return o}case za:return n(new Date(a),i);case ja:{const{source:o,flags:u}=a;return n(new RegExp(o,u),i)}case Ua:{const o=n(new Map,i);for(const[u,l]of a)o.set(r(u),r(l));return o}case Ha:{const o=n(new Set,i);for(const u of a)o.add(r(u));return o}case Pd:{const{name:o,message:u}=a;return n(new Iu[o](u),i)}case Md:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return n(new DataView(o),a)}}return n(new Iu[s](a),i)};return r},Nu=t=>Z_(new Map,t)(0),An="",{toString:Y_}={},{keys:q_}=Object,rr=t=>{const e=typeof t;if(e!=="object"||!t)return[Hi,e];const n=Y_.call(t).slice(8,-1);switch(n){case"Array":return[Er,An];case"Object":return[Ai,An];case"Date":return[za,An];case"RegExp":return[ja,An];case"Map":return[Ua,An];case"Set":return[Ha,An];case"DataView":return[Er,n]}return n.includes("Array")?[Er,n]:n.includes("Error")?[Pd,n]:[Ai,n]},ei=([t,e])=>t===Hi&&(e==="function"||e==="symbol"),V_=(t,e,n,r)=>{const i=(a,o)=>{const u=r.push(a)-1;return n.set(o,u),u},s=a=>{if(n.has(a))return n.get(a);let[o,u]=rr(a);switch(o){case Hi:{let d=a;switch(u){case"bigint":o=Md,d=a.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+u);d=null;break;case"undefined":return i([Dd],a)}return i([o,d],a)}case Er:{if(u){let h=a;return u==="DataView"?h=new Uint8Array(a.buffer):u==="ArrayBuffer"&&(h=new Uint8Array(a)),i([u,[...h]],a)}const d=[],c=i([o,d],a);for(const h of a)d.push(s(h));return c}case Ai:{if(u)switch(u){case"BigInt":return i([u,a.toString()],a);case"Boolean":case"Number":case"String":return i([u,a.valueOf()],a)}if(e&&"toJSON"in a)return s(a.toJSON());const d=[],c=i([o,d],a);for(const h of q_(a))(t||!ei(rr(a[h])))&&d.push([s(h),s(a[h])]);return c}case za:return i([o,a.toISOString()],a);case ja:{const{source:d,flags:c}=a;return i([o,{source:d,flags:c}],a)}case Ua:{const d=[],c=i([o,d],a);for(const[h,p]of a)(t||!(ei(rr(h))||ei(rr(p))))&&d.push([s(h),s(p)]);return c}case Ha:{const d=[],c=i([o,d],a);for(const h of a)(t||!ei(rr(h)))&&d.push(s(h));return c}}const{message:l}=a;return i([o,{name:u,message:l}],a)};return s},wu=(t,{json:e,lossy:n}={})=>{const r=[];return V_(!(e||n),!!e,new Map,r)(t),r},Bn=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?Nu(wu(t,e)):structuredClone(t):(t,e)=>Nu(wu(t,e));function W_(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function G_(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function K_(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||W_,r=t.options.footnoteBackLabel||G_,i=t.options.footnoteLabel||"Footnotes",s=t.options.footnoteLabelTagName||"h2",a=t.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let u=-1;for(;++u<t.footnoteOrder.length;){const l=t.footnoteById.get(t.footnoteOrder[u]);if(!l)continue;const d=t.all(l),c=String(l.identifier).toUpperCase(),h=Zn(c.toLowerCase());let p=0;const g=[],E=t.footnoteCounts.get(c);for(;E!==void 0&&++p<=E;){g.length>0&&g.push({type:"text",value:" "});let _=typeof n=="string"?n:n(u,p);typeof _=="string"&&(_={type:"text",value:_}),g.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,p),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const T=d[d.length-1];if(T&&T.type==="element"&&T.tagName==="p"){const _=T.children[T.children.length-1];_&&_.type==="text"?_.value+=" ":T.children.push({type:"text",value:" "}),T.children.push(...g)}else d.push(...g);const x={type:"element",tagName:"li",properties:{id:e+"fn-"+h},children:t.wrap(d,!0)};t.patch(l,x),o.push(x)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Bn(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
102
|
+
`},{type:"element",tagName:"ol",properties:{},children:t.wrap(o,!0)},{type:"text",value:`
|
|
103
|
+
`}]}}const $i=(function(t){if(t==null)return ey;if(typeof t=="function")return Zi(t);if(typeof t=="object")return Array.isArray(t)?Q_(t):X_(t);if(typeof t=="string")return J_(t);throw new Error("Expected function, string, or object as test")});function Q_(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=$i(t[n]);return Zi(r);function r(...i){let s=-1;for(;++s<e.length;)if(e[s].apply(this,i))return!0;return!1}}function X_(t){const e=t;return Zi(n);function n(r){const i=r;let s;for(s in t)if(i[s]!==e[s])return!1;return!0}}function J_(t){return Zi(e);function e(n){return n&&n.type===t}}function Zi(t){return e;function e(n,r,i){return!!(ty(n)&&t.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function ey(){return!0}function ty(t){return t!==null&&typeof t=="object"&&"type"in t}const Bd=[],ny=!0,ea=!1,ry="skip";function Fd(t,e,n,r){let i;typeof e=="function"&&typeof n!="function"?(r=n,n=e):i=e;const s=$i(i),a=r?-1:1;o(t,void 0,[])();function o(u,l,d){const c=u&&typeof u=="object"?u:{};if(typeof c.type=="string"){const p=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(u.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=Bd,g,E,T;if((!e||s(u,l,d[d.length-1]||void 0))&&(p=iy(n(u,d)),p[0]===ea))return p;if("children"in u&&u.children){const x=u;if(x.children&&p[0]!==ry)for(E=(r?x.children.length:-1)+a,T=d.concat(x);E>-1&&E<x.children.length;){const _=x.children[E];if(g=o(_,E,T)(),g[0]===ea)return g;E=typeof g[1]=="number"?g[1]:E+a}}return p}}}function iy(t){return Array.isArray(t)?t:typeof t=="number"?[ny,t]:t==null?Bd:[t]}function Yi(t,e,n,r){let i,s,a;typeof e=="function"&&typeof n!="function"?(s=void 0,a=e,i=n):(s=e,a=n,i=r),Fd(t,s,o,i);function o(u,l){const d=l[l.length-1],c=d?d.children.indexOf(u):void 0;return a(u,c,d)}}const ta={}.hasOwnProperty,sy={};function ay(t,e){const n=e||sy,r=new Map,i=new Map,s=new Map,a={...$_,...n.handlers},o={all:l,applyData:uy,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:a,one:u,options:n,patch:oy,wrap:cy};return Yi(t,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const c=d.type==="definition"?r:i,h=String(d.identifier).toUpperCase();c.has(h)||c.set(h,d)}}),o;function u(d,c){const h=d.type,p=o.handlers[h];if(ta.call(o.handlers,h)&&p)return p(o,d,c);if(o.options.passThrough&&o.options.passThrough.includes(h)){if("children"in d){const{children:E,...T}=d,x=Bn(T);return x.children=o.all(d),x}return Bn(d)}return(o.options.unknownHandler||ly)(o,d,c)}function l(d){const c=[];if("children"in d){const h=d.children;let p=-1;for(;++p<h.length;){const g=o.one(h[p],d);if(g){if(p&&h[p-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=vu(g.value)),!Array.isArray(g)&&g.type==="element")){const E=g.children[0];E&&E.type==="text"&&(E.value=vu(E.value))}Array.isArray(g)?c.push(...g):c.push(g)}}}return c}}function oy(t,e){t.position&&(e.position=G2(t))}function uy(t,e){let n=e;if(t&&t.data){const r=t.data.hName,i=t.data.hChildren,s=t.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&s&&Object.assign(n.properties,Bn(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function ly(t,e){const n=e.data||{},r="value"in e&&!(ta.call(n,"hProperties")||ta.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function cy(t,e){const n=[];let r=-1;for(e&&n.push({type:"text",value:`
|
|
104
|
+
`});++r<t.length;)r&&n.push({type:"text",value:`
|
|
105
|
+
`}),n.push(t[r]);return e&&t.length>0&&n.push({type:"text",value:`
|
|
106
|
+
`}),n}function vu(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function Ru(t,e){const n=ay(t,e),r=n.one(t,void 0),i=K_(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
|
|
107
|
+
`},i),s}function dy(t,e){return t&&"run"in t?async function(n,r){const i=Ru(n,{file:r,...e});await t.run(i,r)}:function(n,r){return Ru(n,{file:r,...t||e})}}function Ou(t){if(t)throw t}var fs,Lu;function fy(){if(Lu)return fs;Lu=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(l){return typeof Array.isArray=="function"?Array.isArray(l):e.call(l)==="[object Array]"},s=function(l){if(!l||e.call(l)!=="[object Object]")return!1;var d=t.call(l,"constructor"),c=l.constructor&&l.constructor.prototype&&t.call(l.constructor.prototype,"isPrototypeOf");if(l.constructor&&!d&&!c)return!1;var h;for(h in l);return typeof h>"u"||t.call(l,h)},a=function(l,d){n&&d.name==="__proto__"?n(l,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):l[d.name]=d.newValue},o=function(l,d){if(d==="__proto__")if(t.call(l,d)){if(r)return r(l,d).value}else return;return l[d]};return fs=function u(){var l,d,c,h,p,g,E=arguments[0],T=1,x=arguments.length,_=!1;for(typeof E=="boolean"&&(_=E,E=arguments[1]||{},T=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});T<x;++T)if(l=arguments[T],l!=null)for(d in l)c=o(E,d),h=o(l,d),E!==h&&(_&&h&&(s(h)||(p=i(h)))?(p?(p=!1,g=c&&i(c)?c:[]):g=c&&s(c)?c:{},a(E,{name:d,newValue:u(_,g,h)})):typeof h<"u"&&a(E,{name:d,newValue:h}));return E},fs}var hy=fy();const hs=ma(hy);function na(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function py(){const t=[],e={run:n,use:r};return e;function n(...i){let s=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);o(null,...i);function o(u,...l){const d=t[++s];let c=-1;if(u){a(u);return}for(;++c<i.length;)(l[c]===null||l[c]===void 0)&&(l[c]=i[c]);i=l,d?my(d,o)(...l):a(null,...l)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return t.push(i),e}}function my(t,e){let n;return r;function r(...a){const o=t.length>a.length;let u;o&&a.push(i);try{u=t.apply(this,a)}catch(l){const d=l;if(o&&n)throw d;return i(d)}o||(u&&u.then&&typeof u.then=="function"?u.then(s,i):u instanceof Error?i(u):s(u))}function i(a,...o){n||(n=!0,e(a,...o))}function s(a){i(null,a)}}const It={basename:gy,dirname:by,extname:Ey,join:xy,sep:"/"};function gy(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');Yr(t);let n=0,r=-1,i=t.length,s;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let a=-1,o=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),o>-1&&(t.codePointAt(i)===e.codePointAt(o--)?o<0&&(r=i):(o=-1,r=a));return n===r?r=a:r<0&&(r=t.length),t.slice(n,r)}function by(t){if(Yr(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function Ey(t){Yr(t);let e=t.length,n=-1,r=0,i=-1,s=0,a;for(;e--;){const o=t.codePointAt(e);if(o===47){if(a){r=e+1;break}continue}n<0&&(a=!0,n=e+1),o===46?i<0?i=e:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function xy(...t){let e=-1,n;for(;++e<t.length;)Yr(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":Ty(n)}function Ty(t){Yr(t);const e=t.codePointAt(0)===47;let n=_y(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function _y(t,e){let n="",r=0,i=-1,s=0,a=-1,o,u;for(;++a<=t.length;){if(a<t.length)o=t.codePointAt(a);else{if(o===47)break;o=47}if(o===47){if(!(i===a-1||s===1))if(i!==a-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=a,s=0;continue}}else if(n.length>0){n="",r=0,i=a,s=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,a):n=t.slice(i+1,a),r=a-i-1;i=a,s=0}else o===46&&s>-1?s++:s=-1}return n}function Yr(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const yy={cwd:ky};function ky(){return"/"}function ra(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function Ay(t){if(typeof t=="string")t=new URL(t);else if(!ra(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return Sy(t)}function Sy(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const r=e.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(e)}const ps=["history","path","basename","stem","extname","dirname"];class zd{constructor(e){let n;e?ra(e)?n={path:e}:typeof e=="string"||Cy(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":yy.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ps.length;){const s=ps[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)ps.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?It.basename(this.path):void 0}set basename(e){gs(e,"basename"),ms(e,"basename"),this.path=It.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?It.dirname(this.path):void 0}set dirname(e){Du(this.basename,"dirname"),this.path=It.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?It.extname(this.path):void 0}set extname(e){if(ms(e,"extname"),Du(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=It.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){ra(e)&&(e=Ay(e)),gs(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?It.basename(this.path,this.extname):void 0}set stem(e){gs(e,"stem"),ms(e,"stem"),this.path=It.join(this.dirname||"",e+(this.extname||""))}fail(e,n,r){const i=this.message(e,n,r);throw i.fatal=!0,i}info(e,n,r){const i=this.message(e,n,r);return i.fatal=void 0,i}message(e,n,r){const i=new Qe(e,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function ms(t,e){if(t&&t.includes(It.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+It.sep+"`")}function gs(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function Du(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function Cy(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Iy=(function(t){const r=this.constructor.prototype,i=r[t],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),Ny={}.hasOwnProperty;class $a extends Iy{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=py()}copy(){const e=new $a;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(hs(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(xs("data",this.frozen),this.namespace[e]=n,this):Ny.call(this.namespace,e)&&this.namespace[e]||void 0:e?(xs("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(e,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=ti(e),r=this.parser||this.Parser;return bs("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),bs("process",this.parser||this.Parser),Es("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,a){const o=ti(e),u=r.parse(o);r.run(u,o,function(d,c,h){if(d||!c||!h)return l(d);const p=c,g=r.stringify(p,h);Ry(g)?h.value=g:h.result=g,l(d,h)});function l(d,c){d||!c?a(d):s?s(c):n(void 0,c)}}}processSync(e){let n=!1,r;return this.freeze(),bs("processSync",this.parser||this.Parser),Es("processSync",this.compiler||this.Compiler),this.process(e,i),Mu("processSync","process",n),r;function i(s,a){n=!0,Ou(s),r=a}}run(e,n,r){Pu(e),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(a,o){const u=ti(n);i.run(e,u,l);function l(d,c,h){const p=c||e;d?o(d):a?a(p):r(void 0,p,h)}}}runSync(e,n){let r=!1,i;return this.run(e,n,s),Mu("runSync","run",r),i;function s(a,o){Ou(a),i=o,r=!0}}stringify(e,n){this.freeze();const r=ti(n),i=this.compiler||this.Compiler;return Es("stringify",i),Pu(e),i(e,r)}use(e,...n){const r=this.attachers,i=this.namespace;if(xs("use",this.frozen),e!=null)if(typeof e=="function")u(e,n);else if(typeof e=="object")Array.isArray(e)?o(e):a(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function s(l){if(typeof l=="function")u(l,[]);else if(typeof l=="object")if(Array.isArray(l)){const[d,...c]=l;u(d,c)}else a(l);else throw new TypeError("Expected usable value, not `"+l+"`")}function a(l){if(!("plugins"in l)&&!("settings"in l))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(l.plugins),l.settings&&(i.settings=hs(!0,i.settings,l.settings))}function o(l){let d=-1;if(l!=null)if(Array.isArray(l))for(;++d<l.length;){const c=l[d];s(c)}else throw new TypeError("Expected a list of plugins, not `"+l+"`")}function u(l,d){let c=-1,h=-1;for(;++c<r.length;)if(r[c][0]===l){h=c;break}if(h===-1)r.push([l,...d]);else if(d.length>0){let[p,...g]=d;const E=r[h][1];na(E)&&na(p)&&(p=hs(!0,E,p)),r[h]=[l,p,...g]}}}}const wy=new $a().freeze();function bs(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Es(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function xs(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Pu(t){if(!na(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Mu(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function ti(t){return vy(t)?t:new zd(t)}function vy(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function Ry(t){return typeof t=="string"||Oy(t)}function Oy(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Ly="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Bu=[],Fu={allowDangerousHtml:!0},Dy=/^(https?|ircs?|mailto|xmpp)$/i,Py=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function My(t){const e=By(t),n=Fy(t);return zy(e.runSync(e.parse(n),n),t)}function By(t){const e=t.rehypePlugins||Bu,n=t.remarkPlugins||Bu,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...Fu}:Fu;return wy().use(b_).use(n).use(dy,r).use(e)}function Fy(t){const e=t.children||"",n=new zd;return typeof e=="string"&&(n.value=e),n}function zy(t,e){const n=e.allowedElements,r=e.allowElement,i=e.components,s=e.disallowedElements,a=e.skipHtml,o=e.unwrapDisallowed,u=e.urlTransform||jy;for(const d of Py)Object.hasOwn(e,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+Ly+d.id,void 0);return e.className&&(t={type:"element",tagName:"div",properties:{className:e.className},children:t.type==="root"?t.children:[t]}),Yi(t,l),ex(t,{Fragment:m.Fragment,components:i,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0});function l(d,c,h){if(d.type==="raw"&&h&&typeof c=="number")return a?h.children.splice(c,1):h.children[c]={type:"text",value:d.value},c;if(d.type==="element"){let p;for(p in ls)if(Object.hasOwn(ls,p)&&Object.hasOwn(d.properties,p)){const g=d.properties[p],E=ls[p];(E===null||E.includes(d.tagName))&&(d.properties[p]=u(String(g||""),p,d))}}if(d.type==="element"){let p=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!p&&r&&typeof c=="number"&&(p=!r(d,c,h)),p&&h&&typeof c=="number")return o&&d.children?h.children.splice(c,1,...d.children):h.children.splice(c,1),c}}}function jy(t){const e=t.indexOf(":"),n=t.indexOf("?"),r=t.indexOf("#"),i=t.indexOf("/");return e===-1||i!==-1&&e>i||n!==-1&&e>n||r!==-1&&e>r||Dy.test(t.slice(0,e))?t:""}const zu=/[#.]/g;function Uy(t,e){const n=t||"",r={};let i=0,s,a;for(;i<n.length;){zu.lastIndex=i;const o=zu.exec(n),u=n.slice(i,o?o.index:n.length);u&&(s?s==="#"?r.id=u:Array.isArray(r.className)?r.className.push(u):r.className=[u]:a=u,i+=u.length),o&&(s=o[0],i++)}return{type:"element",tagName:a||e||"div",properties:r,children:[]}}function jd(t,e,n){const r=n?Yy(n):void 0;function i(s,a,...o){let u;if(s==null){u={type:"root",children:[]};const l=a;o.unshift(l)}else{u=Uy(s,e);const l=u.tagName.toLowerCase(),d=r?r.get(l):void 0;if(u.tagName=d||l,Hy(a))o.unshift(a);else for(const[c,h]of Object.entries(a))$y(t,u.properties,c,h)}for(const l of o)ia(u.children,l);return u.type==="element"&&u.tagName==="template"&&(u.content={type:"root",children:u.children},u.children=[]),u}return i}function Hy(t){if(t===null||typeof t!="object"||Array.isArray(t))return!0;if(typeof t.type!="string")return!1;const e=t,n=Object.keys(t);for(const r of n){const i=e[r];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const s=i;for(const a of s)if(typeof a!="number"&&typeof a!="string")return!0}}return!!("children"in t&&Array.isArray(t.children))}function $y(t,e,n,r){const i=Fi(t,n);let s;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;s=r}else typeof r=="boolean"?s=r:typeof r=="string"?i.spaceSeparated?s=au(r):i.commaSeparated?s=tu(r):i.commaOrSpaceSeparated?s=au(tu(r).join(" ")):s=ju(i,i.property,r):Array.isArray(r)?s=[...r]:s=i.property==="style"?Zy(r):String(r);if(Array.isArray(s)){const a=[];for(const o of s)a.push(ju(i,i.property,o));s=a}i.property==="className"&&Array.isArray(e.className)&&(s=e.className.concat(s)),e[i.property]=s}}function ia(t,e){if(e!=null)if(typeof e=="number"||typeof e=="string")t.push({type:"text",value:String(e)});else if(Array.isArray(e))for(const n of e)ia(t,n);else if(typeof e=="object"&&"type"in e)e.type==="root"?ia(t,e.children):t.push(e);else throw new Error("Expected node, nodes, or string, got `"+e+"`")}function ju(t,e,n){if(typeof n=="string"){if(t.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((t.boolean||t.overloadedBoolean)&&(n===""||Nr(n)===Nr(e)))return!0}return n}function Zy(t){const e=[];for(const[n,r]of Object.entries(t))e.push([n,r].join(": "));return e.join("; ")}function Yy(t){const e=new Map;for(const n of t)e.set(n.toLowerCase(),n);return e}const qy=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],Vy=jd($r,"div"),Wy=jd(Kt,"g",qy);function Gy(t){const e=String(t),n=[];return{toOffset:i,toPoint:r};function r(s){if(typeof s=="number"&&s>-1&&s<=e.length){let a=0;for(;;){let o=n[a];if(o===void 0){const u=Uu(e,n[a-1]);o=u===-1?e.length+1:u+1,n[a]=o}if(o>s)return{line:a+1,column:s-(a>0?n[a-1]:0)+1,offset:s};a++}}}function i(s){if(s&&typeof s.line=="number"&&typeof s.column=="number"&&!Number.isNaN(s.line)&&!Number.isNaN(s.column)){for(;n.length<s.line;){const o=n[n.length-1],u=Uu(e,o),l=u===-1?e.length+1:u+1;if(o===l)break;n.push(l)}const a=(s.line>1?n[s.line-2]:0)+s.column-1;if(a<n[s.line-1])return a}}}function Uu(t,e){const n=t.indexOf("\r",e),r=t.indexOf(`
|
|
108
|
+
`,e);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const cn={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},Ud={}.hasOwnProperty,Ky=Object.prototype;function Qy(t,e){const n=e||{};return Za({file:n.file||void 0,location:!1,schema:n.space==="svg"?Kt:$r,verbose:n.verbose||!1},t)}function Za(t,e){let n;switch(e.nodeName){case"#comment":{const r=e;return n={type:"comment",value:r.data},fi(t,r,n),n}case"#document":case"#document-fragment":{const r=e,i="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:Hd(t,e.childNodes),data:{quirksMode:i}},t.file&&t.location){const s=String(t.file),a=Gy(s),o=a.toPoint(0),u=a.toPoint(s.length);n.position={start:o,end:u}}return n}case"#documentType":{const r=e;return n={type:"doctype"},fi(t,r,n),n}case"#text":{const r=e;return n={type:"text",value:r.value},fi(t,r,n),n}default:return n=Xy(t,e),n}}function Hd(t,e){let n=-1;const r=[];for(;++n<e.length;){const i=Za(t,e[n]);r.push(i)}return r}function Xy(t,e){const n=t.schema;t.schema=e.namespaceURI===cn.svg?Kt:$r;let r=-1;const i={};for(;++r<e.attrs.length;){const o=e.attrs[r],u=(o.prefix?o.prefix+":":"")+o.name;Ud.call(Ky,u)||(i[u]=o.value)}const a=(t.schema.space==="svg"?Wy:Vy)(e.tagName,i,Hd(t,e.childNodes));if(fi(t,e,a),a.tagName==="template"){const o=e,u=o.sourceCodeLocation,l=u&&u.startTag&&vn(u.startTag),d=u&&u.endTag&&vn(u.endTag),c=Za(t,o.content);l&&d&&t.file&&(c.position={start:l.end,end:d.start}),a.content=c}return t.schema=n,a}function fi(t,e,n){if("sourceCodeLocation"in e&&e.sourceCodeLocation&&t.file){const r=Jy(t,n,e.sourceCodeLocation);r&&(t.location=!0,n.position=r)}}function Jy(t,e,n){const r=vn(n);if(e.type==="element"){const i=e.children[e.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),t.verbose){const s={};let a;if(n.attrs)for(a in n.attrs)Ud.call(n.attrs,a)&&(s[Fi(t.schema,a).property]=vn(n.attrs[a]));n.startTag;const o=vn(n.startTag),u=n.endTag?vn(n.endTag):void 0,l={opening:o};u&&(l.closing=u),l.properties=s,e.data={position:l}}}return r}function vn(t){const e=Hu({line:t.startLine,column:t.startCol,offset:t.startOffset}),n=Hu({line:t.endLine,column:t.endCol,offset:t.endOffset});return e||n?{start:e,end:n}:void 0}function Hu(t){return t.line&&t.column?t:void 0}const $u={}.hasOwnProperty;function $d(t,e){const n=e||{};function r(i,...s){let a=r.invalid;const o=r.handlers;if(i&&$u.call(i,t)){const u=String(i[t]);a=$u.call(o,u)?o[u]:r.unknown}if(a)return a.call(this,i,...s)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const e3={},t3={}.hasOwnProperty,Zd=$d("type",{handlers:{root:r3,element:u3,text:a3,comment:o3,doctype:s3}});function n3(t,e){const r=(e||e3).space;return Zd(t,r==="svg"?Kt:$r)}function r3(t,e){const n={nodeName:"#document",mode:(t.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=Ya(t.children,n,e),Yn(t,n),n}function i3(t,e){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=Ya(t.children,n,e),Yn(t,n),n}function s3(t){const e={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Yn(t,e),e}function a3(t){const e={nodeName:"#text",value:t.value,parentNode:null};return Yn(t,e),e}function o3(t){const e={nodeName:"#comment",data:t.value,parentNode:null};return Yn(t,e),e}function u3(t,e){const n=e;let r=n;t.type==="element"&&t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=Kt);const i=[];let s;if(t.properties){for(s in t.properties)if(s!=="children"&&t3.call(t.properties,s)){const u=l3(r,s,t.properties[s]);u&&i.push(u)}}const a=r.space,o={nodeName:t.tagName,tagName:t.tagName,attrs:i,namespaceURI:cn[a],childNodes:[],parentNode:null};return o.childNodes=Ya(t.children,o,r),Yn(t,o),t.tagName==="template"&&t.content&&(o.content=i3(t.content,r)),o}function l3(t,e,n){const r=Fi(t,e);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?id(n):fd(n));const i={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const s=i.name.indexOf(":");s<0?i.prefix="":(i.name=i.name.slice(s+1),i.prefix=r.attribute.slice(0,s)),i.namespace=cn[r.space]}return i}function Ya(t,e,n){let r=-1;const i=[];if(t)for(;++r<t.length;){const s=Zd(t[r],n);s.parentNode=e,i.push(s)}return i}function Yn(t,e){const n=t.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,e.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const c3=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],d3=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Me="�";var y;(function(t){t[t.EOF=-1]="EOF",t[t.NULL=0]="NULL",t[t.TABULATION=9]="TABULATION",t[t.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",t[t.LINE_FEED=10]="LINE_FEED",t[t.FORM_FEED=12]="FORM_FEED",t[t.SPACE=32]="SPACE",t[t.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",t[t.QUOTATION_MARK=34]="QUOTATION_MARK",t[t.AMPERSAND=38]="AMPERSAND",t[t.APOSTROPHE=39]="APOSTROPHE",t[t.HYPHEN_MINUS=45]="HYPHEN_MINUS",t[t.SOLIDUS=47]="SOLIDUS",t[t.DIGIT_0=48]="DIGIT_0",t[t.DIGIT_9=57]="DIGIT_9",t[t.SEMICOLON=59]="SEMICOLON",t[t.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",t[t.EQUALS_SIGN=61]="EQUALS_SIGN",t[t.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",t[t.QUESTION_MARK=63]="QUESTION_MARK",t[t.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",t[t.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",t[t.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",t[t.GRAVE_ACCENT=96]="GRAVE_ACCENT",t[t.LATIN_SMALL_A=97]="LATIN_SMALL_A",t[t.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(y||(y={}));const it={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function Yd(t){return t>=55296&&t<=57343}function f3(t){return t>=56320&&t<=57343}function h3(t,e){return(t-55296)*1024+9216+e}function qd(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&t>=1&&t<=31||t>=127&&t<=159}function Vd(t){return t>=64976&&t<=65007||d3.has(t)}var M;(function(t){t.controlCharacterInInputStream="control-character-in-input-stream",t.noncharacterInInputStream="noncharacter-in-input-stream",t.surrogateInInputStream="surrogate-in-input-stream",t.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",t.endTagWithAttributes="end-tag-with-attributes",t.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",t.unexpectedSolidusInTag="unexpected-solidus-in-tag",t.unexpectedNullCharacter="unexpected-null-character",t.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",t.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",t.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",t.missingEndTagName="missing-end-tag-name",t.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",t.unknownNamedCharacterReference="unknown-named-character-reference",t.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",t.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",t.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",t.eofBeforeTagName="eof-before-tag-name",t.eofInTag="eof-in-tag",t.missingAttributeValue="missing-attribute-value",t.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",t.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",t.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",t.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",t.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",t.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",t.missingDoctypePublicIdentifier="missing-doctype-public-identifier",t.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",t.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",t.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",t.cdataInHtmlContent="cdata-in-html-content",t.incorrectlyOpenedComment="incorrectly-opened-comment",t.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",t.eofInDoctype="eof-in-doctype",t.nestedComment="nested-comment",t.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",t.eofInComment="eof-in-comment",t.incorrectlyClosedComment="incorrectly-closed-comment",t.eofInCdata="eof-in-cdata",t.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",t.nullCharacterReference="null-character-reference",t.surrogateCharacterReference="surrogate-character-reference",t.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",t.controlCharacterReference="control-character-reference",t.noncharacterCharacterReference="noncharacter-character-reference",t.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",t.missingDoctypeName="missing-doctype-name",t.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",t.duplicateAttribute="duplicate-attribute",t.nonConformingDoctype="non-conforming-doctype",t.missingDoctype="missing-doctype",t.misplacedDoctype="misplaced-doctype",t.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",t.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",t.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",t.openElementsLeftAfterEof="open-elements-left-after-eof",t.abandonedHeadElementChild="abandoned-head-element-child",t.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",t.nestedNoscriptInHead="nested-noscript-in-head",t.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(M||(M={}));const p3=65536;class m3{constructor(e){this.handler=e,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=p3,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,n){const{line:r,col:i,offset:s}=this,a=i+n,o=s+n;return{code:e,startLine:r,endLine:r,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(f3(n))return this.pos++,this._addGap(),h3(e,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,y.EOF;return this._err(M.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,n){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,n){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(e,this.pos);for(let r=0;r<e.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==e.charCodeAt(r))return!1;return!0}peek(e){const n=this.pos+e;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,y.EOF;const r=this.html.charCodeAt(n);return r===y.CARRIAGE_RETURN?y.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,y.EOF;let e=this.html.charCodeAt(this.pos);return e===y.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,y.LINE_FEED):e===y.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Yd(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===y.LINE_FEED||e===y.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){qd(e)?this._err(M.controlCharacterInInputStream):Vd(e)&&this._err(M.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var Ee;(function(t){t[t.CHARACTER=0]="CHARACTER",t[t.NULL_CHARACTER=1]="NULL_CHARACTER",t[t.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",t[t.START_TAG=3]="START_TAG",t[t.END_TAG=4]="END_TAG",t[t.COMMENT=5]="COMMENT",t[t.DOCTYPE=6]="DOCTYPE",t[t.EOF=7]="EOF",t[t.HIBERNATION=8]="HIBERNATION"})(Ee||(Ee={}));function Wd(t,e){for(let n=t.attrs.length-1;n>=0;n--)if(t.attrs[n].name===e)return t.attrs[n].value;return null}const g3=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),b3=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function E3(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=b3.get(t))!==null&&e!==void 0?e:t}var We;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(We||(We={}));const x3=32;var Vt;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Vt||(Vt={}));function sa(t){return t>=We.ZERO&&t<=We.NINE}function T3(t){return t>=We.UPPER_A&&t<=We.UPPER_F||t>=We.LOWER_A&&t<=We.LOWER_F}function _3(t){return t>=We.UPPER_A&&t<=We.UPPER_Z||t>=We.LOWER_A&&t<=We.LOWER_Z||sa(t)}function y3(t){return t===We.EQUALS||_3(t)}var Ve;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(Ve||(Ve={}));var Pt;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(Pt||(Pt={}));class k3{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=Ve.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Pt.Strict}startEntity(e){this.decodeMode=e,this.state=Ve.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case Ve.EntityStart:return e.charCodeAt(n)===We.NUM?(this.state=Ve.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=Ve.NamedEntity,this.stateNamedEntity(e,n));case Ve.NumericStart:return this.stateNumericStart(e,n);case Ve.NumericDecimal:return this.stateNumericDecimal(e,n);case Ve.NumericHex:return this.stateNumericHex(e,n);case Ve.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|x3)===We.LOWER_X?(this.state=Ve.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=Ve.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,i){if(n!==r){const s=r-n;this.result=this.result*Math.pow(i,s)+Number.parseInt(e.substr(n,s),i),this.consumed+=s}}stateNumericHex(e,n){const r=n;for(;n<e.length;){const i=e.charCodeAt(n);if(sa(i)||T3(i))n+=1;else return this.addToNumericResult(e,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(e,r,n,16),-1}stateNumericDecimal(e,n){const r=n;for(;n<e.length;){const i=e.charCodeAt(n);if(sa(i))n+=1;else return this.addToNumericResult(e,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(e,r,n,10),-1}emitNumericEntity(e,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===We.SEMI)this.consumed+=1;else if(this.decodeMode===Pt.Strict)return 0;return this.emitCodePoint(E3(this.result),this.consumed),this.errors&&(e!==We.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let i=r[this.treeIndex],s=(i&Vt.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const a=e.charCodeAt(n);if(this.treeIndex=A3(r,i,this.treeIndex+Math.max(1,s),a),this.treeIndex<0)return this.result===0||this.decodeMode===Pt.Attribute&&(s===0||y3(a))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],s=(i&Vt.VALUE_LENGTH)>>14,s!==0){if(a===We.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Pt.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,i=(r[n]&Vt.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[e]&~Vt.VALUE_LENGTH:i[e+1],r),n===3&&this.emitCodePoint(i[e+2],r),r}end(){var e;switch(this.state){case Ve.NamedEntity:return this.result!==0&&(this.decodeMode!==Pt.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Ve.NumericDecimal:return this.emitNumericEntity(0,2);case Ve.NumericHex:return this.emitNumericEntity(0,3);case Ve.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Ve.EntityStart:return 0}}}function A3(t,e,n,r){const i=(e&Vt.BRANCH_LENGTH)>>7,s=e&Vt.JUMP_TABLE;if(i===0)return s!==0&&r===s?n:-1;if(s){const u=r-s;return u<0||u>=i?-1:t[n+u]-1}let a=n,o=a+i-1;for(;a<=o;){const u=a+o>>>1,l=t[u];if(l<r)a=u+1;else if(l>r)o=u-1;else return t[u+i]}return-1}var $;(function(t){t.HTML="http://www.w3.org/1999/xhtml",t.MATHML="http://www.w3.org/1998/Math/MathML",t.SVG="http://www.w3.org/2000/svg",t.XLINK="http://www.w3.org/1999/xlink",t.XML="http://www.w3.org/XML/1998/namespace",t.XMLNS="http://www.w3.org/2000/xmlns/"})($||($={}));var dn;(function(t){t.TYPE="type",t.ACTION="action",t.ENCODING="encoding",t.PROMPT="prompt",t.NAME="name",t.COLOR="color",t.FACE="face",t.SIZE="size"})(dn||(dn={}));var Et;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(Et||(Et={}));var L;(function(t){t.A="a",t.ADDRESS="address",t.ANNOTATION_XML="annotation-xml",t.APPLET="applet",t.AREA="area",t.ARTICLE="article",t.ASIDE="aside",t.B="b",t.BASE="base",t.BASEFONT="basefont",t.BGSOUND="bgsound",t.BIG="big",t.BLOCKQUOTE="blockquote",t.BODY="body",t.BR="br",t.BUTTON="button",t.CAPTION="caption",t.CENTER="center",t.CODE="code",t.COL="col",t.COLGROUP="colgroup",t.DD="dd",t.DESC="desc",t.DETAILS="details",t.DIALOG="dialog",t.DIR="dir",t.DIV="div",t.DL="dl",t.DT="dt",t.EM="em",t.EMBED="embed",t.FIELDSET="fieldset",t.FIGCAPTION="figcaption",t.FIGURE="figure",t.FONT="font",t.FOOTER="footer",t.FOREIGN_OBJECT="foreignObject",t.FORM="form",t.FRAME="frame",t.FRAMESET="frameset",t.H1="h1",t.H2="h2",t.H3="h3",t.H4="h4",t.H5="h5",t.H6="h6",t.HEAD="head",t.HEADER="header",t.HGROUP="hgroup",t.HR="hr",t.HTML="html",t.I="i",t.IMG="img",t.IMAGE="image",t.INPUT="input",t.IFRAME="iframe",t.KEYGEN="keygen",t.LABEL="label",t.LI="li",t.LINK="link",t.LISTING="listing",t.MAIN="main",t.MALIGNMARK="malignmark",t.MARQUEE="marquee",t.MATH="math",t.MENU="menu",t.META="meta",t.MGLYPH="mglyph",t.MI="mi",t.MO="mo",t.MN="mn",t.MS="ms",t.MTEXT="mtext",t.NAV="nav",t.NOBR="nobr",t.NOFRAMES="noframes",t.NOEMBED="noembed",t.NOSCRIPT="noscript",t.OBJECT="object",t.OL="ol",t.OPTGROUP="optgroup",t.OPTION="option",t.P="p",t.PARAM="param",t.PLAINTEXT="plaintext",t.PRE="pre",t.RB="rb",t.RP="rp",t.RT="rt",t.RTC="rtc",t.RUBY="ruby",t.S="s",t.SCRIPT="script",t.SEARCH="search",t.SECTION="section",t.SELECT="select",t.SOURCE="source",t.SMALL="small",t.SPAN="span",t.STRIKE="strike",t.STRONG="strong",t.STYLE="style",t.SUB="sub",t.SUMMARY="summary",t.SUP="sup",t.TABLE="table",t.TBODY="tbody",t.TEMPLATE="template",t.TEXTAREA="textarea",t.TFOOT="tfoot",t.TD="td",t.TH="th",t.THEAD="thead",t.TITLE="title",t.TR="tr",t.TRACK="track",t.TT="tt",t.U="u",t.UL="ul",t.SVG="svg",t.VAR="var",t.WBR="wbr",t.XMP="xmp"})(L||(L={}));var f;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.A=1]="A",t[t.ADDRESS=2]="ADDRESS",t[t.ANNOTATION_XML=3]="ANNOTATION_XML",t[t.APPLET=4]="APPLET",t[t.AREA=5]="AREA",t[t.ARTICLE=6]="ARTICLE",t[t.ASIDE=7]="ASIDE",t[t.B=8]="B",t[t.BASE=9]="BASE",t[t.BASEFONT=10]="BASEFONT",t[t.BGSOUND=11]="BGSOUND",t[t.BIG=12]="BIG",t[t.BLOCKQUOTE=13]="BLOCKQUOTE",t[t.BODY=14]="BODY",t[t.BR=15]="BR",t[t.BUTTON=16]="BUTTON",t[t.CAPTION=17]="CAPTION",t[t.CENTER=18]="CENTER",t[t.CODE=19]="CODE",t[t.COL=20]="COL",t[t.COLGROUP=21]="COLGROUP",t[t.DD=22]="DD",t[t.DESC=23]="DESC",t[t.DETAILS=24]="DETAILS",t[t.DIALOG=25]="DIALOG",t[t.DIR=26]="DIR",t[t.DIV=27]="DIV",t[t.DL=28]="DL",t[t.DT=29]="DT",t[t.EM=30]="EM",t[t.EMBED=31]="EMBED",t[t.FIELDSET=32]="FIELDSET",t[t.FIGCAPTION=33]="FIGCAPTION",t[t.FIGURE=34]="FIGURE",t[t.FONT=35]="FONT",t[t.FOOTER=36]="FOOTER",t[t.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",t[t.FORM=38]="FORM",t[t.FRAME=39]="FRAME",t[t.FRAMESET=40]="FRAMESET",t[t.H1=41]="H1",t[t.H2=42]="H2",t[t.H3=43]="H3",t[t.H4=44]="H4",t[t.H5=45]="H5",t[t.H6=46]="H6",t[t.HEAD=47]="HEAD",t[t.HEADER=48]="HEADER",t[t.HGROUP=49]="HGROUP",t[t.HR=50]="HR",t[t.HTML=51]="HTML",t[t.I=52]="I",t[t.IMG=53]="IMG",t[t.IMAGE=54]="IMAGE",t[t.INPUT=55]="INPUT",t[t.IFRAME=56]="IFRAME",t[t.KEYGEN=57]="KEYGEN",t[t.LABEL=58]="LABEL",t[t.LI=59]="LI",t[t.LINK=60]="LINK",t[t.LISTING=61]="LISTING",t[t.MAIN=62]="MAIN",t[t.MALIGNMARK=63]="MALIGNMARK",t[t.MARQUEE=64]="MARQUEE",t[t.MATH=65]="MATH",t[t.MENU=66]="MENU",t[t.META=67]="META",t[t.MGLYPH=68]="MGLYPH",t[t.MI=69]="MI",t[t.MO=70]="MO",t[t.MN=71]="MN",t[t.MS=72]="MS",t[t.MTEXT=73]="MTEXT",t[t.NAV=74]="NAV",t[t.NOBR=75]="NOBR",t[t.NOFRAMES=76]="NOFRAMES",t[t.NOEMBED=77]="NOEMBED",t[t.NOSCRIPT=78]="NOSCRIPT",t[t.OBJECT=79]="OBJECT",t[t.OL=80]="OL",t[t.OPTGROUP=81]="OPTGROUP",t[t.OPTION=82]="OPTION",t[t.P=83]="P",t[t.PARAM=84]="PARAM",t[t.PLAINTEXT=85]="PLAINTEXT",t[t.PRE=86]="PRE",t[t.RB=87]="RB",t[t.RP=88]="RP",t[t.RT=89]="RT",t[t.RTC=90]="RTC",t[t.RUBY=91]="RUBY",t[t.S=92]="S",t[t.SCRIPT=93]="SCRIPT",t[t.SEARCH=94]="SEARCH",t[t.SECTION=95]="SECTION",t[t.SELECT=96]="SELECT",t[t.SOURCE=97]="SOURCE",t[t.SMALL=98]="SMALL",t[t.SPAN=99]="SPAN",t[t.STRIKE=100]="STRIKE",t[t.STRONG=101]="STRONG",t[t.STYLE=102]="STYLE",t[t.SUB=103]="SUB",t[t.SUMMARY=104]="SUMMARY",t[t.SUP=105]="SUP",t[t.TABLE=106]="TABLE",t[t.TBODY=107]="TBODY",t[t.TEMPLATE=108]="TEMPLATE",t[t.TEXTAREA=109]="TEXTAREA",t[t.TFOOT=110]="TFOOT",t[t.TD=111]="TD",t[t.TH=112]="TH",t[t.THEAD=113]="THEAD",t[t.TITLE=114]="TITLE",t[t.TR=115]="TR",t[t.TRACK=116]="TRACK",t[t.TT=117]="TT",t[t.U=118]="U",t[t.UL=119]="UL",t[t.SVG=120]="SVG",t[t.VAR=121]="VAR",t[t.WBR=122]="WBR",t[t.XMP=123]="XMP"})(f||(f={}));const S3=new Map([[L.A,f.A],[L.ADDRESS,f.ADDRESS],[L.ANNOTATION_XML,f.ANNOTATION_XML],[L.APPLET,f.APPLET],[L.AREA,f.AREA],[L.ARTICLE,f.ARTICLE],[L.ASIDE,f.ASIDE],[L.B,f.B],[L.BASE,f.BASE],[L.BASEFONT,f.BASEFONT],[L.BGSOUND,f.BGSOUND],[L.BIG,f.BIG],[L.BLOCKQUOTE,f.BLOCKQUOTE],[L.BODY,f.BODY],[L.BR,f.BR],[L.BUTTON,f.BUTTON],[L.CAPTION,f.CAPTION],[L.CENTER,f.CENTER],[L.CODE,f.CODE],[L.COL,f.COL],[L.COLGROUP,f.COLGROUP],[L.DD,f.DD],[L.DESC,f.DESC],[L.DETAILS,f.DETAILS],[L.DIALOG,f.DIALOG],[L.DIR,f.DIR],[L.DIV,f.DIV],[L.DL,f.DL],[L.DT,f.DT],[L.EM,f.EM],[L.EMBED,f.EMBED],[L.FIELDSET,f.FIELDSET],[L.FIGCAPTION,f.FIGCAPTION],[L.FIGURE,f.FIGURE],[L.FONT,f.FONT],[L.FOOTER,f.FOOTER],[L.FOREIGN_OBJECT,f.FOREIGN_OBJECT],[L.FORM,f.FORM],[L.FRAME,f.FRAME],[L.FRAMESET,f.FRAMESET],[L.H1,f.H1],[L.H2,f.H2],[L.H3,f.H3],[L.H4,f.H4],[L.H5,f.H5],[L.H6,f.H6],[L.HEAD,f.HEAD],[L.HEADER,f.HEADER],[L.HGROUP,f.HGROUP],[L.HR,f.HR],[L.HTML,f.HTML],[L.I,f.I],[L.IMG,f.IMG],[L.IMAGE,f.IMAGE],[L.INPUT,f.INPUT],[L.IFRAME,f.IFRAME],[L.KEYGEN,f.KEYGEN],[L.LABEL,f.LABEL],[L.LI,f.LI],[L.LINK,f.LINK],[L.LISTING,f.LISTING],[L.MAIN,f.MAIN],[L.MALIGNMARK,f.MALIGNMARK],[L.MARQUEE,f.MARQUEE],[L.MATH,f.MATH],[L.MENU,f.MENU],[L.META,f.META],[L.MGLYPH,f.MGLYPH],[L.MI,f.MI],[L.MO,f.MO],[L.MN,f.MN],[L.MS,f.MS],[L.MTEXT,f.MTEXT],[L.NAV,f.NAV],[L.NOBR,f.NOBR],[L.NOFRAMES,f.NOFRAMES],[L.NOEMBED,f.NOEMBED],[L.NOSCRIPT,f.NOSCRIPT],[L.OBJECT,f.OBJECT],[L.OL,f.OL],[L.OPTGROUP,f.OPTGROUP],[L.OPTION,f.OPTION],[L.P,f.P],[L.PARAM,f.PARAM],[L.PLAINTEXT,f.PLAINTEXT],[L.PRE,f.PRE],[L.RB,f.RB],[L.RP,f.RP],[L.RT,f.RT],[L.RTC,f.RTC],[L.RUBY,f.RUBY],[L.S,f.S],[L.SCRIPT,f.SCRIPT],[L.SEARCH,f.SEARCH],[L.SECTION,f.SECTION],[L.SELECT,f.SELECT],[L.SOURCE,f.SOURCE],[L.SMALL,f.SMALL],[L.SPAN,f.SPAN],[L.STRIKE,f.STRIKE],[L.STRONG,f.STRONG],[L.STYLE,f.STYLE],[L.SUB,f.SUB],[L.SUMMARY,f.SUMMARY],[L.SUP,f.SUP],[L.TABLE,f.TABLE],[L.TBODY,f.TBODY],[L.TEMPLATE,f.TEMPLATE],[L.TEXTAREA,f.TEXTAREA],[L.TFOOT,f.TFOOT],[L.TD,f.TD],[L.TH,f.TH],[L.THEAD,f.THEAD],[L.TITLE,f.TITLE],[L.TR,f.TR],[L.TRACK,f.TRACK],[L.TT,f.TT],[L.U,f.U],[L.UL,f.UL],[L.SVG,f.SVG],[L.VAR,f.VAR],[L.WBR,f.WBR],[L.XMP,f.XMP]]);function qn(t){var e;return(e=S3.get(t))!==null&&e!==void 0?e:f.UNKNOWN}const Z=f,C3={[$.HTML]:new Set([Z.ADDRESS,Z.APPLET,Z.AREA,Z.ARTICLE,Z.ASIDE,Z.BASE,Z.BASEFONT,Z.BGSOUND,Z.BLOCKQUOTE,Z.BODY,Z.BR,Z.BUTTON,Z.CAPTION,Z.CENTER,Z.COL,Z.COLGROUP,Z.DD,Z.DETAILS,Z.DIR,Z.DIV,Z.DL,Z.DT,Z.EMBED,Z.FIELDSET,Z.FIGCAPTION,Z.FIGURE,Z.FOOTER,Z.FORM,Z.FRAME,Z.FRAMESET,Z.H1,Z.H2,Z.H3,Z.H4,Z.H5,Z.H6,Z.HEAD,Z.HEADER,Z.HGROUP,Z.HR,Z.HTML,Z.IFRAME,Z.IMG,Z.INPUT,Z.LI,Z.LINK,Z.LISTING,Z.MAIN,Z.MARQUEE,Z.MENU,Z.META,Z.NAV,Z.NOEMBED,Z.NOFRAMES,Z.NOSCRIPT,Z.OBJECT,Z.OL,Z.P,Z.PARAM,Z.PLAINTEXT,Z.PRE,Z.SCRIPT,Z.SECTION,Z.SELECT,Z.SOURCE,Z.STYLE,Z.SUMMARY,Z.TABLE,Z.TBODY,Z.TD,Z.TEMPLATE,Z.TEXTAREA,Z.TFOOT,Z.TH,Z.THEAD,Z.TITLE,Z.TR,Z.TRACK,Z.UL,Z.WBR,Z.XMP]),[$.MATHML]:new Set([Z.MI,Z.MO,Z.MN,Z.MS,Z.MTEXT,Z.ANNOTATION_XML]),[$.SVG]:new Set([Z.TITLE,Z.FOREIGN_OBJECT,Z.DESC]),[$.XLINK]:new Set,[$.XML]:new Set,[$.XMLNS]:new Set},aa=new Set([Z.H1,Z.H2,Z.H3,Z.H4,Z.H5,Z.H6]);L.STYLE,L.SCRIPT,L.XMP,L.IFRAME,L.NOEMBED,L.NOFRAMES,L.PLAINTEXT;var S;(function(t){t[t.DATA=0]="DATA",t[t.RCDATA=1]="RCDATA",t[t.RAWTEXT=2]="RAWTEXT",t[t.SCRIPT_DATA=3]="SCRIPT_DATA",t[t.PLAINTEXT=4]="PLAINTEXT",t[t.TAG_OPEN=5]="TAG_OPEN",t[t.END_TAG_OPEN=6]="END_TAG_OPEN",t[t.TAG_NAME=7]="TAG_NAME",t[t.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",t[t.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",t[t.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",t[t.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",t[t.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",t[t.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",t[t.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",t[t.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",t[t.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",t[t.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",t[t.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",t[t.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",t[t.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",t[t.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",t[t.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",t[t.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",t[t.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",t[t.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",t[t.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",t[t.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",t[t.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",t[t.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",t[t.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",t[t.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",t[t.BOGUS_COMMENT=40]="BOGUS_COMMENT",t[t.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",t[t.COMMENT_START=42]="COMMENT_START",t[t.COMMENT_START_DASH=43]="COMMENT_START_DASH",t[t.COMMENT=44]="COMMENT",t[t.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",t[t.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",t[t.COMMENT_END_DASH=49]="COMMENT_END_DASH",t[t.COMMENT_END=50]="COMMENT_END",t[t.COMMENT_END_BANG=51]="COMMENT_END_BANG",t[t.DOCTYPE=52]="DOCTYPE",t[t.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",t[t.DOCTYPE_NAME=54]="DOCTYPE_NAME",t[t.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",t[t.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",t[t.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",t[t.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",t[t.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",t[t.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",t[t.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",t[t.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",t[t.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",t[t.CDATA_SECTION=68]="CDATA_SECTION",t[t.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",t[t.CDATA_SECTION_END=70]="CDATA_SECTION_END",t[t.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",t[t.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(S||(S={}));const Ue={DATA:S.DATA,RCDATA:S.RCDATA,RAWTEXT:S.RAWTEXT,SCRIPT_DATA:S.SCRIPT_DATA,PLAINTEXT:S.PLAINTEXT,CDATA_SECTION:S.CDATA_SECTION};function I3(t){return t>=y.DIGIT_0&&t<=y.DIGIT_9}function cr(t){return t>=y.LATIN_CAPITAL_A&&t<=y.LATIN_CAPITAL_Z}function N3(t){return t>=y.LATIN_SMALL_A&&t<=y.LATIN_SMALL_Z}function $t(t){return N3(t)||cr(t)}function Zu(t){return $t(t)||I3(t)}function ni(t){return t+32}function Gd(t){return t===y.SPACE||t===y.LINE_FEED||t===y.TABULATION||t===y.FORM_FEED}function Yu(t){return Gd(t)||t===y.SOLIDUS||t===y.GREATER_THAN_SIGN}function w3(t){return t===y.NULL?M.nullCharacterReference:t>1114111?M.characterReferenceOutsideUnicodeRange:Yd(t)?M.surrogateCharacterReference:Vd(t)?M.noncharacterCharacterReference:qd(t)||t===y.CARRIAGE_RETURN?M.controlCharacterReference:null}class v3{constructor(e,n){this.options=e,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=S.DATA,this.returnState=S.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new m3(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new k3(g3,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(M.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(M.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const i=w3(r);i&&this._err(i,1)}}:void 0)}_err(e,n=0){var r,i;(i=(r=this.handler).onParseError)===null||i===void 0||i.call(r,this.preprocessor.getError(e,n))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,n,r){this.active=!0,this.preprocessor.write(e,n),this._runParsingLoop(),this.paused||r?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let n=0;n<e;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,n){return this.preprocessor.startsWith(e,n)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:Ee.START_TAG,tagName:"",tagID:f.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:Ee.END_TAG,tagName:"",tagID:f.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:Ee.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:Ee.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,n){this.currentCharacterToken={type:e,chars:n,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e,n;const r=this.currentToken;if(Wd(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const i=(e=(n=r.location).attrs)!==null&&e!==void 0?e:n.attrs=Object.create(null);i[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(M.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const e=this.currentToken;this.prepareToken(e),e.tagID=qn(e.tagName),e.type===Ee.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(M.endTagWithAttributes),e.selfClosing&&this._err(M.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case Ee.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Ee.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Ee.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:Ee.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,n)}_emitCodePoint(e){const n=Gd(e)?Ee.WHITESPACE_CHARACTER:e===y.NULL?Ee.NULL_CHARACTER:Ee.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(Ee.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=S.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Pt.Attribute:Pt.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===S.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===S.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===S.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case S.DATA:{this._stateData(e);break}case S.RCDATA:{this._stateRcdata(e);break}case S.RAWTEXT:{this._stateRawtext(e);break}case S.SCRIPT_DATA:{this._stateScriptData(e);break}case S.PLAINTEXT:{this._statePlaintext(e);break}case S.TAG_OPEN:{this._stateTagOpen(e);break}case S.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case S.TAG_NAME:{this._stateTagName(e);break}case S.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case S.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case S.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case S.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case S.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case S.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case S.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case S.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case S.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case S.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case S.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case S.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case S.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case S.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case S.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case S.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case S.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case S.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case S.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case S.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case S.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case S.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case S.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case S.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case S.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case S.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case S.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case S.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case S.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case S.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case S.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case S.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case S.BOGUS_COMMENT:{this._stateBogusComment(e);break}case S.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case S.COMMENT_START:{this._stateCommentStart(e);break}case S.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case S.COMMENT:{this._stateComment(e);break}case S.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case S.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case S.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case S.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case S.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case S.COMMENT_END:{this._stateCommentEnd(e);break}case S.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case S.DOCTYPE:{this._stateDoctype(e);break}case S.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case S.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case S.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case S.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case S.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case S.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case S.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case S.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case S.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case S.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case S.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case S.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case S.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case S.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case S.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case S.CDATA_SECTION:{this._stateCdataSection(e);break}case S.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case S.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case S.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case S.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case y.LESS_THAN_SIGN:{this.state=S.TAG_OPEN;break}case y.AMPERSAND:{this._startCharacterReference();break}case y.NULL:{this._err(M.unexpectedNullCharacter),this._emitCodePoint(e);break}case y.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case y.AMPERSAND:{this._startCharacterReference();break}case y.LESS_THAN_SIGN:{this.state=S.RCDATA_LESS_THAN_SIGN;break}case y.NULL:{this._err(M.unexpectedNullCharacter),this._emitChars(Me);break}case y.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case y.LESS_THAN_SIGN:{this.state=S.RAWTEXT_LESS_THAN_SIGN;break}case y.NULL:{this._err(M.unexpectedNullCharacter),this._emitChars(Me);break}case y.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case y.LESS_THAN_SIGN:{this.state=S.SCRIPT_DATA_LESS_THAN_SIGN;break}case y.NULL:{this._err(M.unexpectedNullCharacter),this._emitChars(Me);break}case y.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case y.NULL:{this._err(M.unexpectedNullCharacter),this._emitChars(Me);break}case y.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if($t(e))this._createStartTagToken(),this.state=S.TAG_NAME,this._stateTagName(e);else switch(e){case y.EXCLAMATION_MARK:{this.state=S.MARKUP_DECLARATION_OPEN;break}case y.SOLIDUS:{this.state=S.END_TAG_OPEN;break}case y.QUESTION_MARK:{this._err(M.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=S.BOGUS_COMMENT,this._stateBogusComment(e);break}case y.EOF:{this._err(M.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(M.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=S.DATA,this._stateData(e)}}_stateEndTagOpen(e){if($t(e))this._createEndTagToken(),this.state=S.TAG_NAME,this._stateTagName(e);else switch(e){case y.GREATER_THAN_SIGN:{this._err(M.missingEndTagName),this.state=S.DATA;break}case y.EOF:{this._err(M.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(M.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=S.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const n=this.currentToken;switch(e){case y.SPACE:case y.LINE_FEED:case y.TABULATION:case y.FORM_FEED:{this.state=S.BEFORE_ATTRIBUTE_NAME;break}case y.SOLIDUS:{this.state=S.SELF_CLOSING_START_TAG;break}case y.GREATER_THAN_SIGN:{this.state=S.DATA,this.emitCurrentTagToken();break}case y.NULL:{this._err(M.unexpectedNullCharacter),n.tagName+=Me;break}case y.EOF:{this._err(M.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(cr(e)?ni(e):e)}}_stateRcdataLessThanSign(e){e===y.SOLIDUS?this.state=S.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=S.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){$t(e)?(this.state=S.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=S.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case y.SPACE:case y.LINE_FEED:case y.TABULATION:case y.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=S.BEFORE_ATTRIBUTE_NAME,!1;case y.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=S.SELF_CLOSING_START_TAG,!1;case y.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=S.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=S.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===y.SOLIDUS?this.state=S.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=S.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){$t(e)?(this.state=S.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=S.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=S.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case y.SOLIDUS:{this.state=S.SCRIPT_DATA_END_TAG_OPEN;break}case y.EXCLAMATION_MARK:{this.state=S.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=S.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){$t(e)?(this.state=S.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=S.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=S.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===y.HYPHEN_MINUS?(this.state=S.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=S.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===y.HYPHEN_MINUS?(this.state=S.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=S.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case y.HYPHEN_MINUS:{this.state=S.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case y.LESS_THAN_SIGN:{this.state=S.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case y.NULL:{this._err(M.unexpectedNullCharacter),this._emitChars(Me);break}case y.EOF:{this._err(M.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case y.HYPHEN_MINUS:{this.state=S.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case y.LESS_THAN_SIGN:{this.state=S.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case y.NULL:{this._err(M.unexpectedNullCharacter),this.state=S.SCRIPT_DATA_ESCAPED,this._emitChars(Me);break}case y.EOF:{this._err(M.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=S.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case y.HYPHEN_MINUS:{this._emitChars("-");break}case y.LESS_THAN_SIGN:{this.state=S.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case y.GREATER_THAN_SIGN:{this.state=S.SCRIPT_DATA,this._emitChars(">");break}case y.NULL:{this._err(M.unexpectedNullCharacter),this.state=S.SCRIPT_DATA_ESCAPED,this._emitChars(Me);break}case y.EOF:{this._err(M.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=S.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===y.SOLIDUS?this.state=S.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:$t(e)?(this._emitChars("<"),this.state=S.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=S.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){$t(e)?(this.state=S.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=S.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=S.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(it.SCRIPT,!1)&&Yu(this.preprocessor.peek(it.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<it.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=S.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=S.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case y.HYPHEN_MINUS:{this.state=S.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case y.LESS_THAN_SIGN:{this.state=S.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case y.NULL:{this._err(M.unexpectedNullCharacter),this._emitChars(Me);break}case y.EOF:{this._err(M.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case y.HYPHEN_MINUS:{this.state=S.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case y.LESS_THAN_SIGN:{this.state=S.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case y.NULL:{this._err(M.unexpectedNullCharacter),this.state=S.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Me);break}case y.EOF:{this._err(M.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=S.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case y.HYPHEN_MINUS:{this._emitChars("-");break}case y.LESS_THAN_SIGN:{this.state=S.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case y.GREATER_THAN_SIGN:{this.state=S.SCRIPT_DATA,this._emitChars(">");break}case y.NULL:{this._err(M.unexpectedNullCharacter),this.state=S.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Me);break}case y.EOF:{this._err(M.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=S.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===y.SOLIDUS?(this.state=S.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=S.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(it.SCRIPT,!1)&&Yu(this.preprocessor.peek(it.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<it.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=S.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=S.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case y.SPACE:case y.LINE_FEED:case y.TABULATION:case y.FORM_FEED:break;case y.SOLIDUS:case y.GREATER_THAN_SIGN:case y.EOF:{this.state=S.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case y.EQUALS_SIGN:{this._err(M.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=S.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=S.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case y.SPACE:case y.LINE_FEED:case y.TABULATION:case y.FORM_FEED:case y.SOLIDUS:case y.GREATER_THAN_SIGN:case y.EOF:{this._leaveAttrName(),this.state=S.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case y.EQUALS_SIGN:{this._leaveAttrName(),this.state=S.BEFORE_ATTRIBUTE_VALUE;break}case y.QUOTATION_MARK:case y.APOSTROPHE:case y.LESS_THAN_SIGN:{this._err(M.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break}case y.NULL:{this._err(M.unexpectedNullCharacter),this.currentAttr.name+=Me;break}default:this.currentAttr.name+=String.fromCodePoint(cr(e)?ni(e):e)}}_stateAfterAttributeName(e){switch(e){case y.SPACE:case y.LINE_FEED:case y.TABULATION:case y.FORM_FEED:break;case y.SOLIDUS:{this.state=S.SELF_CLOSING_START_TAG;break}case y.EQUALS_SIGN:{this.state=S.BEFORE_ATTRIBUTE_VALUE;break}case y.GREATER_THAN_SIGN:{this.state=S.DATA,this.emitCurrentTagToken();break}case y.EOF:{this._err(M.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=S.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case y.SPACE:case y.LINE_FEED:case y.TABULATION:case y.FORM_FEED:break;case y.QUOTATION_MARK:{this.state=S.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case y.APOSTROPHE:{this.state=S.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case y.GREATER_THAN_SIGN:{this._err(M.missingAttributeValue),this.state=S.DATA,this.emitCurrentTagToken();break}default:this.state=S.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case y.QUOTATION_MARK:{this.state=S.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case y.AMPERSAND:{this._startCharacterReference();break}case y.NULL:{this._err(M.unexpectedNullCharacter),this.currentAttr.value+=Me;break}case y.EOF:{this._err(M.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case y.APOSTROPHE:{this.state=S.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case y.AMPERSAND:{this._startCharacterReference();break}case y.NULL:{this._err(M.unexpectedNullCharacter),this.currentAttr.value+=Me;break}case y.EOF:{this._err(M.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case y.SPACE:case y.LINE_FEED:case y.TABULATION:case y.FORM_FEED:{this._leaveAttrValue(),this.state=S.BEFORE_ATTRIBUTE_NAME;break}case y.AMPERSAND:{this._startCharacterReference();break}case y.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=S.DATA,this.emitCurrentTagToken();break}case y.NULL:{this._err(M.unexpectedNullCharacter),this.currentAttr.value+=Me;break}case y.QUOTATION_MARK:case y.APOSTROPHE:case y.LESS_THAN_SIGN:case y.EQUALS_SIGN:case y.GRAVE_ACCENT:{this._err(M.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break}case y.EOF:{this._err(M.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case y.SPACE:case y.LINE_FEED:case y.TABULATION:case y.FORM_FEED:{this._leaveAttrValue(),this.state=S.BEFORE_ATTRIBUTE_NAME;break}case y.SOLIDUS:{this._leaveAttrValue(),this.state=S.SELF_CLOSING_START_TAG;break}case y.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=S.DATA,this.emitCurrentTagToken();break}case y.EOF:{this._err(M.eofInTag),this._emitEOFToken();break}default:this._err(M.missingWhitespaceBetweenAttributes),this.state=S.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case y.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=S.DATA,this.emitCurrentTagToken();break}case y.EOF:{this._err(M.eofInTag),this._emitEOFToken();break}default:this._err(M.unexpectedSolidusInTag),this.state=S.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){const n=this.currentToken;switch(e){case y.GREATER_THAN_SIGN:{this.state=S.DATA,this.emitCurrentComment(n);break}case y.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case y.NULL:{this._err(M.unexpectedNullCharacter),n.data+=Me;break}default:n.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(it.DASH_DASH,!0)?(this._createCommentToken(it.DASH_DASH.length+1),this.state=S.COMMENT_START):this._consumeSequenceIfMatch(it.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(it.DOCTYPE.length+1),this.state=S.DOCTYPE):this._consumeSequenceIfMatch(it.CDATA_START,!0)?this.inForeignNode?this.state=S.CDATA_SECTION:(this._err(M.cdataInHtmlContent),this._createCommentToken(it.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=S.BOGUS_COMMENT):this._ensureHibernation()||(this._err(M.incorrectlyOpenedComment),this._createCommentToken(2),this.state=S.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case y.HYPHEN_MINUS:{this.state=S.COMMENT_START_DASH;break}case y.GREATER_THAN_SIGN:{this._err(M.abruptClosingOfEmptyComment),this.state=S.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=S.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){const n=this.currentToken;switch(e){case y.HYPHEN_MINUS:{this.state=S.COMMENT_END;break}case y.GREATER_THAN_SIGN:{this._err(M.abruptClosingOfEmptyComment),this.state=S.DATA,this.emitCurrentComment(n);break}case y.EOF:{this._err(M.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=S.COMMENT,this._stateComment(e)}}_stateComment(e){const n=this.currentToken;switch(e){case y.HYPHEN_MINUS:{this.state=S.COMMENT_END_DASH;break}case y.LESS_THAN_SIGN:{n.data+="<",this.state=S.COMMENT_LESS_THAN_SIGN;break}case y.NULL:{this._err(M.unexpectedNullCharacter),n.data+=Me;break}case y.EOF:{this._err(M.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){const n=this.currentToken;switch(e){case y.EXCLAMATION_MARK:{n.data+="!",this.state=S.COMMENT_LESS_THAN_SIGN_BANG;break}case y.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=S.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===y.HYPHEN_MINUS?this.state=S.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=S.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===y.HYPHEN_MINUS?this.state=S.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=S.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==y.GREATER_THAN_SIGN&&e!==y.EOF&&this._err(M.nestedComment),this.state=S.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){const n=this.currentToken;switch(e){case y.HYPHEN_MINUS:{this.state=S.COMMENT_END;break}case y.EOF:{this._err(M.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=S.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){const n=this.currentToken;switch(e){case y.GREATER_THAN_SIGN:{this.state=S.DATA,this.emitCurrentComment(n);break}case y.EXCLAMATION_MARK:{this.state=S.COMMENT_END_BANG;break}case y.HYPHEN_MINUS:{n.data+="-";break}case y.EOF:{this._err(M.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=S.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){const n=this.currentToken;switch(e){case y.HYPHEN_MINUS:{n.data+="--!",this.state=S.COMMENT_END_DASH;break}case y.GREATER_THAN_SIGN:{this._err(M.incorrectlyClosedComment),this.state=S.DATA,this.emitCurrentComment(n);break}case y.EOF:{this._err(M.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=S.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case y.SPACE:case y.LINE_FEED:case y.TABULATION:case y.FORM_FEED:{this.state=S.BEFORE_DOCTYPE_NAME;break}case y.GREATER_THAN_SIGN:{this.state=S.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break}case y.EOF:{this._err(M.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(M.missingWhitespaceBeforeDoctypeName),this.state=S.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(cr(e))this._createDoctypeToken(String.fromCharCode(ni(e))),this.state=S.DOCTYPE_NAME;else switch(e){case y.SPACE:case y.LINE_FEED:case y.TABULATION:case y.FORM_FEED:break;case y.NULL:{this._err(M.unexpectedNullCharacter),this._createDoctypeToken(Me),this.state=S.DOCTYPE_NAME;break}case y.GREATER_THAN_SIGN:{this._err(M.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=S.DATA;break}case y.EOF:{this._err(M.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=S.DOCTYPE_NAME}}_stateDoctypeName(e){const n=this.currentToken;switch(e){case y.SPACE:case y.LINE_FEED:case y.TABULATION:case y.FORM_FEED:{this.state=S.AFTER_DOCTYPE_NAME;break}case y.GREATER_THAN_SIGN:{this.state=S.DATA,this.emitCurrentDoctype(n);break}case y.NULL:{this._err(M.unexpectedNullCharacter),n.name+=Me;break}case y.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(cr(e)?ni(e):e)}}_stateAfterDoctypeName(e){const n=this.currentToken;switch(e){case y.SPACE:case y.LINE_FEED:case y.TABULATION:case y.FORM_FEED:break;case y.GREATER_THAN_SIGN:{this.state=S.DATA,this.emitCurrentDoctype(n);break}case y.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(it.PUBLIC,!1)?this.state=S.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(it.SYSTEM,!1)?this.state=S.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(M.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=S.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){const n=this.currentToken;switch(e){case y.SPACE:case y.LINE_FEED:case y.TABULATION:case y.FORM_FEED:{this.state=S.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case y.QUOTATION_MARK:{this._err(M.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=S.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case y.APOSTROPHE:{this._err(M.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=S.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case y.GREATER_THAN_SIGN:{this._err(M.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=S.DATA,this.emitCurrentDoctype(n);break}case y.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(M.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=S.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case y.SPACE:case y.LINE_FEED:case y.TABULATION:case y.FORM_FEED:break;case y.QUOTATION_MARK:{n.publicId="",this.state=S.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case y.APOSTROPHE:{n.publicId="",this.state=S.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case y.GREATER_THAN_SIGN:{this._err(M.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=S.DATA,this.emitCurrentDoctype(n);break}case y.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(M.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=S.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case y.QUOTATION_MARK:{this.state=S.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case y.NULL:{this._err(M.unexpectedNullCharacter),n.publicId+=Me;break}case y.GREATER_THAN_SIGN:{this._err(M.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=S.DATA;break}case y.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case y.APOSTROPHE:{this.state=S.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case y.NULL:{this._err(M.unexpectedNullCharacter),n.publicId+=Me;break}case y.GREATER_THAN_SIGN:{this._err(M.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=S.DATA;break}case y.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case y.SPACE:case y.LINE_FEED:case y.TABULATION:case y.FORM_FEED:{this.state=S.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case y.GREATER_THAN_SIGN:{this.state=S.DATA,this.emitCurrentDoctype(n);break}case y.QUOTATION_MARK:{this._err(M.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=S.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case y.APOSTROPHE:{this._err(M.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=S.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case y.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(M.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=S.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const n=this.currentToken;switch(e){case y.SPACE:case y.LINE_FEED:case y.TABULATION:case y.FORM_FEED:break;case y.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=S.DATA;break}case y.QUOTATION_MARK:{n.systemId="",this.state=S.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case y.APOSTROPHE:{n.systemId="",this.state=S.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case y.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(M.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=S.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){const n=this.currentToken;switch(e){case y.SPACE:case y.LINE_FEED:case y.TABULATION:case y.FORM_FEED:{this.state=S.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case y.QUOTATION_MARK:{this._err(M.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=S.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case y.APOSTROPHE:{this._err(M.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=S.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case y.GREATER_THAN_SIGN:{this._err(M.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=S.DATA,this.emitCurrentDoctype(n);break}case y.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(M.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=S.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case y.SPACE:case y.LINE_FEED:case y.TABULATION:case y.FORM_FEED:break;case y.QUOTATION_MARK:{n.systemId="",this.state=S.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case y.APOSTROPHE:{n.systemId="",this.state=S.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case y.GREATER_THAN_SIGN:{this._err(M.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=S.DATA,this.emitCurrentDoctype(n);break}case y.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(M.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=S.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case y.QUOTATION_MARK:{this.state=S.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case y.NULL:{this._err(M.unexpectedNullCharacter),n.systemId+=Me;break}case y.GREATER_THAN_SIGN:{this._err(M.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=S.DATA;break}case y.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case y.APOSTROPHE:{this.state=S.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case y.NULL:{this._err(M.unexpectedNullCharacter),n.systemId+=Me;break}case y.GREATER_THAN_SIGN:{this._err(M.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=S.DATA;break}case y.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case y.SPACE:case y.LINE_FEED:case y.TABULATION:case y.FORM_FEED:break;case y.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=S.DATA;break}case y.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(M.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=S.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){const n=this.currentToken;switch(e){case y.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=S.DATA;break}case y.NULL:{this._err(M.unexpectedNullCharacter);break}case y.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(e){switch(e){case y.RIGHT_SQUARE_BRACKET:{this.state=S.CDATA_SECTION_BRACKET;break}case y.EOF:{this._err(M.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===y.RIGHT_SQUARE_BRACKET?this.state=S.CDATA_SECTION_END:(this._emitChars("]"),this.state=S.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case y.GREATER_THAN_SIGN:{this.state=S.DATA;break}case y.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=S.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0)if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(y.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&Zu(this.preprocessor.peek(1))?S.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){Zu(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===y.SEMICOLON&&this._err(M.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}}const Kd=new Set([f.DD,f.DT,f.LI,f.OPTGROUP,f.OPTION,f.P,f.RB,f.RP,f.RT,f.RTC]),qu=new Set([...Kd,f.CAPTION,f.COLGROUP,f.TBODY,f.TD,f.TFOOT,f.TH,f.THEAD,f.TR]),Si=new Set([f.APPLET,f.CAPTION,f.HTML,f.MARQUEE,f.OBJECT,f.TABLE,f.TD,f.TEMPLATE,f.TH]),R3=new Set([...Si,f.OL,f.UL]),O3=new Set([...Si,f.BUTTON]),Vu=new Set([f.ANNOTATION_XML,f.MI,f.MN,f.MO,f.MS,f.MTEXT]),Wu=new Set([f.DESC,f.FOREIGN_OBJECT,f.TITLE]),L3=new Set([f.TR,f.TEMPLATE,f.HTML]),D3=new Set([f.TBODY,f.TFOOT,f.THEAD,f.TEMPLATE,f.HTML]),P3=new Set([f.TABLE,f.TEMPLATE,f.HTML]),M3=new Set([f.TD,f.TH]);class B3{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=f.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===f.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===$.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,n){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,n,!0)}pop(){const e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,n){const r=this._indexOf(e);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(e,n,r){const i=this._indexOf(e)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(e){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(e,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==$.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(e){for(;this.stackTop>=e;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<e)}}popUntilElementPopped(e){const n=this._indexOf(e);this.shortenToLength(Math.max(n,0))}popUntilPopped(e,n){const r=this._indexOfTagNames(e,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(aa,$.HTML)}popUntilTableCellPopped(){this.popUntilPopped(M3,$.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,n){for(let r=this.stackTop;r>=0;r--)if(e.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(e,n){const r=this._indexOfTagNames(e,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(P3,$.HTML)}clearBackToTableBodyContext(){this.clearBackTo(D3,$.HTML)}clearBackToTableRowContext(){this.clearBackTo(L3,$.HTML)}remove(e){const n=this._indexOf(e);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===f.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const n=this._indexOf(e)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===f.HTML}hasInDynamicScope(e,n){for(let r=this.stackTop;r>=0;r--){const i=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case $.HTML:{if(i===e)return!0;if(n.has(i))return!1;break}case $.SVG:{if(Wu.has(i))return!1;break}case $.MATHML:{if(Vu.has(i))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,Si)}hasInListItemScope(e){return this.hasInDynamicScope(e,R3)}hasInButtonScope(e){return this.hasInDynamicScope(e,O3)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const n=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case $.HTML:{if(aa.has(n))return!0;if(Si.has(n))return!1;break}case $.SVG:{if(Wu.has(n))return!1;break}case $.MATHML:{if(Vu.has(n))return!1;break}}}return!0}hasInTableScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===$.HTML)switch(this.tagIDs[n]){case e:return!0;case f.TABLE:case f.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===$.HTML)switch(this.tagIDs[e]){case f.TBODY:case f.THEAD:case f.TFOOT:return!0;case f.TABLE:case f.HTML:return!1}return!0}hasInSelectScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===$.HTML)switch(this.tagIDs[n]){case e:return!0;case f.OPTION:case f.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Kd.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&qu.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&qu.has(this.currentTagId);)this.pop()}}const Ts=3;var wt;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})(wt||(wt={}));const Gu={type:wt.Marker};class F3{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,n){const r=[],i=n.length,s=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let o=0;o<this.entries.length;o++){const u=this.entries[o];if(u.type===wt.Marker)break;const{element:l}=u;if(this.treeAdapter.getTagName(l)===s&&this.treeAdapter.getNamespaceURI(l)===a){const d=this.treeAdapter.getAttrList(l);d.length===i&&r.push({idx:o,attrs:d})}}return r}_ensureNoahArkCondition(e){if(this.entries.length<Ts)return;const n=this.treeAdapter.getAttrList(e),r=this._getNoahArkConditionCandidates(e,n);if(r.length<Ts)return;const i=new Map(n.map(a=>[a.name,a.value]));let s=0;for(let a=0;a<r.length;a++){const o=r[a];o.attrs.every(u=>i.get(u.name)===u.value)&&(s+=1,s>=Ts&&this.entries.splice(o.idx,1))}}insertMarker(){this.entries.unshift(Gu)}pushElement(e,n){this._ensureNoahArkCondition(e),this.entries.unshift({type:wt.Element,element:e,token:n})}insertElementAfterBookmark(e,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:wt.Element,element:e,token:n})}removeEntry(e){const n=this.entries.indexOf(e);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const e=this.entries.indexOf(Gu);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const n=this.entries.find(r=>r.type===wt.Marker||this.treeAdapter.getTagName(r.element)===e);return n&&n.type===wt.Element?n:null}getElementEntry(e){return this.entries.find(n=>n.type===wt.Element&&n.element===e)}}const Zt={createDocument(){return{nodeName:"#document",mode:Et.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(t,e,n){return{nodeName:t,tagName:t,attrs:n,namespaceURI:e,childNodes:[],parentNode:null}},createCommentNode(t){return{nodeName:"#comment",data:t,parentNode:null}},createTextNode(t){return{nodeName:"#text",value:t,parentNode:null}},appendChild(t,e){t.childNodes.push(e),e.parentNode=t},insertBefore(t,e,n){const r=t.childNodes.indexOf(n);t.childNodes.splice(r,0,e),e.parentNode=t},setTemplateContent(t,e){t.content=e},getTemplateContent(t){return t.content},setDocumentType(t,e,n,r){const i=t.childNodes.find(s=>s.nodeName==="#documentType");if(i)i.name=e,i.publicId=n,i.systemId=r;else{const s={nodeName:"#documentType",name:e,publicId:n,systemId:r,parentNode:null};Zt.appendChild(t,s)}},setDocumentMode(t,e){t.mode=e},getDocumentMode(t){return t.mode},detachNode(t){if(t.parentNode){const e=t.parentNode.childNodes.indexOf(t);t.parentNode.childNodes.splice(e,1),t.parentNode=null}},insertText(t,e){if(t.childNodes.length>0){const n=t.childNodes[t.childNodes.length-1];if(Zt.isTextNode(n)){n.value+=e;return}}Zt.appendChild(t,Zt.createTextNode(e))},insertTextBefore(t,e,n){const r=t.childNodes[t.childNodes.indexOf(n)-1];r&&Zt.isTextNode(r)?r.value+=e:Zt.insertBefore(t,Zt.createTextNode(e),n)},adoptAttributes(t,e){const n=new Set(t.attrs.map(r=>r.name));for(let r=0;r<e.length;r++)n.has(e[r].name)||t.attrs.push(e[r])},getFirstChild(t){return t.childNodes[0]},getChildNodes(t){return t.childNodes},getParentNode(t){return t.parentNode},getAttrList(t){return t.attrs},getTagName(t){return t.tagName},getNamespaceURI(t){return t.namespaceURI},getTextNodeContent(t){return t.value},getCommentNodeContent(t){return t.data},getDocumentTypeNodeName(t){return t.name},getDocumentTypeNodePublicId(t){return t.publicId},getDocumentTypeNodeSystemId(t){return t.systemId},isTextNode(t){return t.nodeName==="#text"},isCommentNode(t){return t.nodeName==="#comment"},isDocumentTypeNode(t){return t.nodeName==="#documentType"},isElementNode(t){return Object.prototype.hasOwnProperty.call(t,"tagName")},setNodeSourceCodeLocation(t,e){t.sourceCodeLocation=e},getNodeSourceCodeLocation(t){return t.sourceCodeLocation},updateNodeSourceCodeLocation(t,e){t.sourceCodeLocation={...t.sourceCodeLocation,...e}}},Qd="html",z3="about:legacy-compat",j3="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",Xd=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],U3=[...Xd,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],H3=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Jd=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],$3=[...Jd,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Ku(t,e){return e.some(n=>t.startsWith(n))}function Z3(t){return t.name===Qd&&t.publicId===null&&(t.systemId===null||t.systemId===z3)}function Y3(t){if(t.name!==Qd)return Et.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===j3)return Et.QUIRKS;let{publicId:n}=t;if(n!==null){if(n=n.toLowerCase(),H3.has(n))return Et.QUIRKS;let r=e===null?U3:Xd;if(Ku(n,r))return Et.QUIRKS;if(r=e===null?Jd:$3,Ku(n,r))return Et.LIMITED_QUIRKS}return Et.NO_QUIRKS}const Qu={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},q3="definitionurl",V3="definitionURL",W3=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(t=>[t.toLowerCase(),t])),G3=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:$.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:$.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:$.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:$.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:$.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:$.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:$.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:$.XML}],["xml:space",{prefix:"xml",name:"space",namespace:$.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:$.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:$.XMLNS}]]),K3=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(t=>[t.toLowerCase(),t])),Q3=new Set([f.B,f.BIG,f.BLOCKQUOTE,f.BODY,f.BR,f.CENTER,f.CODE,f.DD,f.DIV,f.DL,f.DT,f.EM,f.EMBED,f.H1,f.H2,f.H3,f.H4,f.H5,f.H6,f.HEAD,f.HR,f.I,f.IMG,f.LI,f.LISTING,f.MENU,f.META,f.NOBR,f.OL,f.P,f.PRE,f.RUBY,f.S,f.SMALL,f.SPAN,f.STRONG,f.STRIKE,f.SUB,f.SUP,f.TABLE,f.TT,f.U,f.UL,f.VAR]);function X3(t){const e=t.tagID;return e===f.FONT&&t.attrs.some(({name:r})=>r===dn.COLOR||r===dn.SIZE||r===dn.FACE)||Q3.has(e)}function ef(t){for(let e=0;e<t.attrs.length;e++)if(t.attrs[e].name===q3){t.attrs[e].name=V3;break}}function tf(t){for(let e=0;e<t.attrs.length;e++){const n=W3.get(t.attrs[e].name);n!=null&&(t.attrs[e].name=n)}}function qa(t){for(let e=0;e<t.attrs.length;e++){const n=G3.get(t.attrs[e].name);n&&(t.attrs[e].prefix=n.prefix,t.attrs[e].name=n.name,t.attrs[e].namespace=n.namespace)}}function J3(t){const e=K3.get(t.tagName);e!=null&&(t.tagName=e,t.tagID=qn(t.tagName))}function ek(t,e){return e===$.MATHML&&(t===f.MI||t===f.MO||t===f.MN||t===f.MS||t===f.MTEXT)}function tk(t,e,n){if(e===$.MATHML&&t===f.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===dn.ENCODING){const i=n[r].value.toLowerCase();return i===Qu.TEXT_HTML||i===Qu.APPLICATION_XML}}return e===$.SVG&&(t===f.FOREIGN_OBJECT||t===f.DESC||t===f.TITLE)}function nk(t,e,n,r){return(!r||r===$.HTML)&&tk(t,e,n)||(!r||r===$.MATHML)&&ek(t,e)}const rk="hidden",ik=8,sk=3;var I;(function(t){t[t.INITIAL=0]="INITIAL",t[t.BEFORE_HTML=1]="BEFORE_HTML",t[t.BEFORE_HEAD=2]="BEFORE_HEAD",t[t.IN_HEAD=3]="IN_HEAD",t[t.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",t[t.AFTER_HEAD=5]="AFTER_HEAD",t[t.IN_BODY=6]="IN_BODY",t[t.TEXT=7]="TEXT",t[t.IN_TABLE=8]="IN_TABLE",t[t.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",t[t.IN_CAPTION=10]="IN_CAPTION",t[t.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",t[t.IN_TABLE_BODY=12]="IN_TABLE_BODY",t[t.IN_ROW=13]="IN_ROW",t[t.IN_CELL=14]="IN_CELL",t[t.IN_SELECT=15]="IN_SELECT",t[t.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",t[t.IN_TEMPLATE=17]="IN_TEMPLATE",t[t.AFTER_BODY=18]="AFTER_BODY",t[t.IN_FRAMESET=19]="IN_FRAMESET",t[t.AFTER_FRAMESET=20]="AFTER_FRAMESET",t[t.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",t[t.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(I||(I={}));const ak={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},nf=new Set([f.TABLE,f.TBODY,f.TFOOT,f.THEAD,f.TR]),Xu={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Zt,onParseError:null};class Ju{constructor(e,n,r=null,i=null){this.fragmentContext=r,this.scriptHandler=i,this.currentToken=null,this.stopped=!1,this.insertionMode=I.INITIAL,this.originalInsertionMode=I.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...Xu,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new v3(this.options,this),this.activeFormattingElements=new F3(this.treeAdapter),this.fragmentContextID=r?qn(this.treeAdapter.getTagName(r)):f.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new B3(this.document,this.treeAdapter,this)}static parse(e,n){const r=new this(n);return r.tokenizer.write(e,!0),r.document}static getFragmentParser(e,n){const r={...Xu,...n};e??(e=r.treeAdapter.createElement(L.TEMPLATE,$.HTML,[]));const i=r.treeAdapter.createElement("documentmock",$.HTML,[]),s=new this(r,i,e);return s.fragmentContextID===f.TEMPLATE&&s.tmplInsertionModeStack.unshift(I.IN_TEMPLATE),s._initTokenizerForFragmentParsing(),s._insertFakeRootElement(),s._resetInsertionMode(),s._findFormInFragmentContext(),s}getFragment(){const e=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,n),n}_err(e,n,r){var i;if(!this.onParseError)return;const s=(i=e.location)!==null&&i!==void 0?i:ak,a={code:n,startLine:s.startLine,startCol:s.startCol,startOffset:s.startOffset,endLine:r?s.startLine:s.endLine,endCol:r?s.startCol:s.endCol,endOffset:r?s.startOffset:s.endOffset};this.onParseError(a)}onItemPush(e,n,r){var i,s;(s=(i=this.treeAdapter).onItemPush)===null||s===void 0||s.call(i,e),r&&this.openElements.stackTop>0&&this._setContextModes(e,n)}onItemPop(e,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.call(r,e,this.openElements.current),n){let s,a;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,a=this.fragmentContextID):{current:s,currentTagId:a}=this.openElements,this._setContextModes(s,a)}}_setContextModes(e,n){const r=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===$.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&e!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,e)}_switchToTextParsing(e,n){this._insertElement(e,$.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=I.TEXT}switchToPlaintextParsing(){this.insertionMode=I.TEXT,this.originalInsertionMode=I.IN_BODY,this.tokenizer.state=Ue.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===L.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==$.HTML))switch(this.fragmentContextID){case f.TITLE:case f.TEXTAREA:{this.tokenizer.state=Ue.RCDATA;break}case f.STYLE:case f.XMP:case f.IFRAME:case f.NOEMBED:case f.NOFRAMES:case f.NOSCRIPT:{this.tokenizer.state=Ue.RAWTEXT;break}case f.SCRIPT:{this.tokenizer.state=Ue.SCRIPT_DATA;break}case f.PLAINTEXT:{this.tokenizer.state=Ue.PLAINTEXT;break}}}_setDocumentType(e){const n=e.name||"",r=e.publicId||"",i=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),e.location){const a=this.treeAdapter.getChildNodes(this.document).find(o=>this.treeAdapter.isDocumentTypeNode(o));a&&this.treeAdapter.setNodeSourceCodeLocation(a,e.location)}}_attachElementToTree(e,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(e,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,e)}}_appendElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location)}_insertElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location),this.openElements.push(r,e.tagID)}_insertFakeElement(e,n){const r=this.treeAdapter.createElement(e,$.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(e){const n=this.treeAdapter.createElement(e.tagName,$.HTML,e.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const e=this.treeAdapter.createElement(L.HTML,$.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,f.HTML)}_appendCommentNode(e,n){const r=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,e.location)}_insertCharacters(e){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,e.chars,r):this.treeAdapter.insertText(n,e.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,e.chars)),!e.location)return;const i=this.treeAdapter.getChildNodes(n),s=r?i.lastIndexOf(r):i.length,a=i[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(a)){const{endLine:u,endCol:l,endOffset:d}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(a,{endLine:u,endCol:l,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,e.location)}_adoptNodes(e,n){for(let r=this.treeAdapter.getFirstChild(e);r;r=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(e,n){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&n.location){const r=n.location,i=this.treeAdapter.getTagName(e),s=n.type===Ee.END_TAG&&i===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,s)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,e.tagID===f.SVG&&this.treeAdapter.getTagName(n)===L.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===$.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===f.MGLYPH||e.tagID===f.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,$.HTML)}_processToken(e){switch(e.type){case Ee.CHARACTER:{this.onCharacter(e);break}case Ee.NULL_CHARACTER:{this.onNullCharacter(e);break}case Ee.COMMENT:{this.onComment(e);break}case Ee.DOCTYPE:{this.onDoctype(e);break}case Ee.START_TAG:{this._processStartTag(e);break}case Ee.END_TAG:{this.onEndTag(e);break}case Ee.EOF:{this.onEof(e);break}case Ee.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,n,r){const i=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return nk(e,i,s,r)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===wt.Marker||this.openElements.contains(i.element)),r=n===-1?e-1:n-1;for(let i=r;i>=0;i--){const s=this.activeFormattingElements.entries[i];this._insertElement(s.token,this.treeAdapter.getNamespaceURI(s.element)),s.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=I.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(f.P),this.openElements.popUntilTagNamePopped(f.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case f.TR:{this.insertionMode=I.IN_ROW;return}case f.TBODY:case f.THEAD:case f.TFOOT:{this.insertionMode=I.IN_TABLE_BODY;return}case f.CAPTION:{this.insertionMode=I.IN_CAPTION;return}case f.COLGROUP:{this.insertionMode=I.IN_COLUMN_GROUP;return}case f.TABLE:{this.insertionMode=I.IN_TABLE;return}case f.BODY:{this.insertionMode=I.IN_BODY;return}case f.FRAMESET:{this.insertionMode=I.IN_FRAMESET;return}case f.SELECT:{this._resetInsertionModeForSelect(e);return}case f.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case f.HTML:{this.insertionMode=this.headElement?I.AFTER_HEAD:I.BEFORE_HEAD;return}case f.TD:case f.TH:{if(e>0){this.insertionMode=I.IN_CELL;return}break}case f.HEAD:{if(e>0){this.insertionMode=I.IN_HEAD;return}break}}this.insertionMode=I.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let n=e-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===f.TEMPLATE)break;if(r===f.TABLE){this.insertionMode=I.IN_SELECT_IN_TABLE;return}}this.insertionMode=I.IN_SELECT}_isElementCausesFosterParenting(e){return nf.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){const n=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case f.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===$.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case f.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,e,n.beforeElement):this.treeAdapter.appendChild(n.parent,e)}_isSpecialElement(e,n){const r=this.treeAdapter.getNamespaceURI(e);return C3[r].has(n)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){MA(this,e);return}switch(this.insertionMode){case I.INITIAL:{ir(this,e);break}case I.BEFORE_HTML:{xr(this,e);break}case I.BEFORE_HEAD:{Tr(this,e);break}case I.IN_HEAD:{_r(this,e);break}case I.IN_HEAD_NO_SCRIPT:{yr(this,e);break}case I.AFTER_HEAD:{kr(this,e);break}case I.IN_BODY:case I.IN_CAPTION:case I.IN_CELL:case I.IN_TEMPLATE:{sf(this,e);break}case I.TEXT:case I.IN_SELECT:case I.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case I.IN_TABLE:case I.IN_TABLE_BODY:case I.IN_ROW:{_s(this,e);break}case I.IN_TABLE_TEXT:{df(this,e);break}case I.IN_COLUMN_GROUP:{Ci(this,e);break}case I.AFTER_BODY:{Ii(this,e);break}case I.AFTER_AFTER_BODY:{hi(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){PA(this,e);return}switch(this.insertionMode){case I.INITIAL:{ir(this,e);break}case I.BEFORE_HTML:{xr(this,e);break}case I.BEFORE_HEAD:{Tr(this,e);break}case I.IN_HEAD:{_r(this,e);break}case I.IN_HEAD_NO_SCRIPT:{yr(this,e);break}case I.AFTER_HEAD:{kr(this,e);break}case I.TEXT:{this._insertCharacters(e);break}case I.IN_TABLE:case I.IN_TABLE_BODY:case I.IN_ROW:{_s(this,e);break}case I.IN_COLUMN_GROUP:{Ci(this,e);break}case I.AFTER_BODY:{Ii(this,e);break}case I.AFTER_AFTER_BODY:{hi(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){oa(this,e);return}switch(this.insertionMode){case I.INITIAL:case I.BEFORE_HTML:case I.BEFORE_HEAD:case I.IN_HEAD:case I.IN_HEAD_NO_SCRIPT:case I.AFTER_HEAD:case I.IN_BODY:case I.IN_TABLE:case I.IN_CAPTION:case I.IN_COLUMN_GROUP:case I.IN_TABLE_BODY:case I.IN_ROW:case I.IN_CELL:case I.IN_SELECT:case I.IN_SELECT_IN_TABLE:case I.IN_TEMPLATE:case I.IN_FRAMESET:case I.AFTER_FRAMESET:{oa(this,e);break}case I.IN_TABLE_TEXT:{sr(this,e);break}case I.AFTER_BODY:{hk(this,e);break}case I.AFTER_AFTER_BODY:case I.AFTER_AFTER_FRAMESET:{pk(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case I.INITIAL:{mk(this,e);break}case I.BEFORE_HEAD:case I.IN_HEAD:case I.IN_HEAD_NO_SCRIPT:case I.AFTER_HEAD:{this._err(e,M.misplacedDoctype);break}case I.IN_TABLE_TEXT:{sr(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,M.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?BA(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case I.INITIAL:{ir(this,e);break}case I.BEFORE_HTML:{gk(this,e);break}case I.BEFORE_HEAD:{Ek(this,e);break}case I.IN_HEAD:{At(this,e);break}case I.IN_HEAD_NO_SCRIPT:{_k(this,e);break}case I.AFTER_HEAD:{kk(this,e);break}case I.IN_BODY:{Xe(this,e);break}case I.IN_TABLE:{Fn(this,e);break}case I.IN_TABLE_TEXT:{sr(this,e);break}case I.IN_CAPTION:{xA(this,e);break}case I.IN_COLUMN_GROUP:{Ga(this,e);break}case I.IN_TABLE_BODY:{Wi(this,e);break}case I.IN_ROW:{Gi(this,e);break}case I.IN_CELL:{yA(this,e);break}case I.IN_SELECT:{pf(this,e);break}case I.IN_SELECT_IN_TABLE:{AA(this,e);break}case I.IN_TEMPLATE:{CA(this,e);break}case I.AFTER_BODY:{NA(this,e);break}case I.IN_FRAMESET:{wA(this,e);break}case I.AFTER_FRAMESET:{RA(this,e);break}case I.AFTER_AFTER_BODY:{LA(this,e);break}case I.AFTER_AFTER_FRAMESET:{DA(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?FA(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case I.INITIAL:{ir(this,e);break}case I.BEFORE_HTML:{bk(this,e);break}case I.BEFORE_HEAD:{xk(this,e);break}case I.IN_HEAD:{Tk(this,e);break}case I.IN_HEAD_NO_SCRIPT:{yk(this,e);break}case I.AFTER_HEAD:{Ak(this,e);break}case I.IN_BODY:{Vi(this,e);break}case I.TEXT:{lA(this,e);break}case I.IN_TABLE:{vr(this,e);break}case I.IN_TABLE_TEXT:{sr(this,e);break}case I.IN_CAPTION:{TA(this,e);break}case I.IN_COLUMN_GROUP:{_A(this,e);break}case I.IN_TABLE_BODY:{ua(this,e);break}case I.IN_ROW:{hf(this,e);break}case I.IN_CELL:{kA(this,e);break}case I.IN_SELECT:{mf(this,e);break}case I.IN_SELECT_IN_TABLE:{SA(this,e);break}case I.IN_TEMPLATE:{IA(this,e);break}case I.AFTER_BODY:{bf(this,e);break}case I.IN_FRAMESET:{vA(this,e);break}case I.AFTER_FRAMESET:{OA(this,e);break}case I.AFTER_AFTER_BODY:{hi(this,e);break}}}onEof(e){switch(this.insertionMode){case I.INITIAL:{ir(this,e);break}case I.BEFORE_HTML:{xr(this,e);break}case I.BEFORE_HEAD:{Tr(this,e);break}case I.IN_HEAD:{_r(this,e);break}case I.IN_HEAD_NO_SCRIPT:{yr(this,e);break}case I.AFTER_HEAD:{kr(this,e);break}case I.IN_BODY:case I.IN_TABLE:case I.IN_CAPTION:case I.IN_COLUMN_GROUP:case I.IN_TABLE_BODY:case I.IN_ROW:case I.IN_CELL:case I.IN_SELECT:case I.IN_SELECT_IN_TABLE:{lf(this,e);break}case I.TEXT:{cA(this,e);break}case I.IN_TABLE_TEXT:{sr(this,e);break}case I.IN_TEMPLATE:{gf(this,e);break}case I.AFTER_BODY:case I.IN_FRAMESET:case I.AFTER_FRAMESET:case I.AFTER_AFTER_BODY:case I.AFTER_AFTER_FRAMESET:{Wa(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===y.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case I.IN_HEAD:case I.IN_HEAD_NO_SCRIPT:case I.AFTER_HEAD:case I.TEXT:case I.IN_COLUMN_GROUP:case I.IN_SELECT:case I.IN_SELECT_IN_TABLE:case I.IN_FRAMESET:case I.AFTER_FRAMESET:{this._insertCharacters(e);break}case I.IN_BODY:case I.IN_CAPTION:case I.IN_CELL:case I.IN_TEMPLATE:case I.AFTER_BODY:case I.AFTER_AFTER_BODY:case I.AFTER_AFTER_FRAMESET:{rf(this,e);break}case I.IN_TABLE:case I.IN_TABLE_BODY:case I.IN_ROW:{_s(this,e);break}case I.IN_TABLE_TEXT:{cf(this,e);break}}}}function ok(t,e){let n=t.activeFormattingElements.getElementEntryInScopeWithTagName(e.tagName);return n?t.openElements.contains(n.element)?t.openElements.hasInScope(e.tagID)||(n=null):(t.activeFormattingElements.removeEntry(n),n=null):uf(t,e),n}function uk(t,e){let n=null,r=t.openElements.stackTop;for(;r>=0;r--){const i=t.openElements.items[r];if(i===e.element)break;t._isSpecialElement(i,t.openElements.tagIDs[r])&&(n=i)}return n||(t.openElements.shortenToLength(Math.max(r,0)),t.activeFormattingElements.removeEntry(e)),n}function lk(t,e,n){let r=e,i=t.openElements.getCommonAncestor(e);for(let s=0,a=i;a!==n;s++,a=i){i=t.openElements.getCommonAncestor(a);const o=t.activeFormattingElements.getElementEntry(a),u=o&&s>=sk;!o||u?(u&&t.activeFormattingElements.removeEntry(o),t.openElements.remove(a)):(a=ck(t,o),r===e&&(t.activeFormattingElements.bookmark=o),t.treeAdapter.detachNode(r),t.treeAdapter.appendChild(a,r),r=a)}return r}function ck(t,e){const n=t.treeAdapter.getNamespaceURI(e.element),r=t.treeAdapter.createElement(e.token.tagName,n,e.token.attrs);return t.openElements.replace(e.element,r),e.element=r,r}function dk(t,e,n){const r=t.treeAdapter.getTagName(e),i=qn(r);if(t._isElementCausesFosterParenting(i))t._fosterParentElement(n);else{const s=t.treeAdapter.getNamespaceURI(e);i===f.TEMPLATE&&s===$.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,n)}}function fk(t,e,n){const r=t.treeAdapter.getNamespaceURI(n.element),{token:i}=n,s=t.treeAdapter.createElement(i.tagName,r,i.attrs);t._adoptNodes(e,s),t.treeAdapter.appendChild(e,s),t.activeFormattingElements.insertElementAfterBookmark(s,i),t.activeFormattingElements.removeEntry(n),t.openElements.remove(n.element),t.openElements.insertAfter(e,s,i.tagID)}function Va(t,e){for(let n=0;n<ik;n++){const r=ok(t,e);if(!r)break;const i=uk(t,r);if(!i)break;t.activeFormattingElements.bookmark=r;const s=lk(t,i,r.element),a=t.openElements.getCommonAncestor(r.element);t.treeAdapter.detachNode(s),a&&dk(t,a,s),fk(t,i,r)}}function oa(t,e){t._appendCommentNode(e,t.openElements.currentTmplContentOrNode)}function hk(t,e){t._appendCommentNode(e,t.openElements.items[0])}function pk(t,e){t._appendCommentNode(e,t.document)}function Wa(t,e){if(t.stopped=!0,e.location){const n=t.fragmentContext?0:2;for(let r=t.openElements.stackTop;r>=n;r--)t._setEndLocation(t.openElements.items[r],e);if(!t.fragmentContext&&t.openElements.stackTop>=0){const r=t.openElements.items[0],i=t.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(t._setEndLocation(r,e),t.openElements.stackTop>=1)){const s=t.openElements.items[1],a=t.treeAdapter.getNodeSourceCodeLocation(s);a&&!a.endTag&&t._setEndLocation(s,e)}}}}function mk(t,e){t._setDocumentType(e);const n=e.forceQuirks?Et.QUIRKS:Y3(e);Z3(e)||t._err(e,M.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,n),t.insertionMode=I.BEFORE_HTML}function ir(t,e){t._err(e,M.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,Et.QUIRKS),t.insertionMode=I.BEFORE_HTML,t._processToken(e)}function gk(t,e){e.tagID===f.HTML?(t._insertElement(e,$.HTML),t.insertionMode=I.BEFORE_HEAD):xr(t,e)}function bk(t,e){const n=e.tagID;(n===f.HTML||n===f.HEAD||n===f.BODY||n===f.BR)&&xr(t,e)}function xr(t,e){t._insertFakeRootElement(),t.insertionMode=I.BEFORE_HEAD,t._processToken(e)}function Ek(t,e){switch(e.tagID){case f.HTML:{Xe(t,e);break}case f.HEAD:{t._insertElement(e,$.HTML),t.headElement=t.openElements.current,t.insertionMode=I.IN_HEAD;break}default:Tr(t,e)}}function xk(t,e){const n=e.tagID;n===f.HEAD||n===f.BODY||n===f.HTML||n===f.BR?Tr(t,e):t._err(e,M.endTagWithoutMatchingOpenElement)}function Tr(t,e){t._insertFakeElement(L.HEAD,f.HEAD),t.headElement=t.openElements.current,t.insertionMode=I.IN_HEAD,t._processToken(e)}function At(t,e){switch(e.tagID){case f.HTML:{Xe(t,e);break}case f.BASE:case f.BASEFONT:case f.BGSOUND:case f.LINK:case f.META:{t._appendElement(e,$.HTML),e.ackSelfClosing=!0;break}case f.TITLE:{t._switchToTextParsing(e,Ue.RCDATA);break}case f.NOSCRIPT:{t.options.scriptingEnabled?t._switchToTextParsing(e,Ue.RAWTEXT):(t._insertElement(e,$.HTML),t.insertionMode=I.IN_HEAD_NO_SCRIPT);break}case f.NOFRAMES:case f.STYLE:{t._switchToTextParsing(e,Ue.RAWTEXT);break}case f.SCRIPT:{t._switchToTextParsing(e,Ue.SCRIPT_DATA);break}case f.TEMPLATE:{t._insertTemplate(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=I.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(I.IN_TEMPLATE);break}case f.HEAD:{t._err(e,M.misplacedStartTagForHeadElement);break}default:_r(t,e)}}function Tk(t,e){switch(e.tagID){case f.HEAD:{t.openElements.pop(),t.insertionMode=I.AFTER_HEAD;break}case f.BODY:case f.BR:case f.HTML:{_r(t,e);break}case f.TEMPLATE:{Tn(t,e);break}default:t._err(e,M.endTagWithoutMatchingOpenElement)}}function Tn(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==f.TEMPLATE&&t._err(e,M.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(f.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode()):t._err(e,M.endTagWithoutMatchingOpenElement)}function _r(t,e){t.openElements.pop(),t.insertionMode=I.AFTER_HEAD,t._processToken(e)}function _k(t,e){switch(e.tagID){case f.HTML:{Xe(t,e);break}case f.BASEFONT:case f.BGSOUND:case f.HEAD:case f.LINK:case f.META:case f.NOFRAMES:case f.STYLE:{At(t,e);break}case f.NOSCRIPT:{t._err(e,M.nestedNoscriptInHead);break}default:yr(t,e)}}function yk(t,e){switch(e.tagID){case f.NOSCRIPT:{t.openElements.pop(),t.insertionMode=I.IN_HEAD;break}case f.BR:{yr(t,e);break}default:t._err(e,M.endTagWithoutMatchingOpenElement)}}function yr(t,e){const n=e.type===Ee.EOF?M.openElementsLeftAfterEof:M.disallowedContentInNoscriptInHead;t._err(e,n),t.openElements.pop(),t.insertionMode=I.IN_HEAD,t._processToken(e)}function kk(t,e){switch(e.tagID){case f.HTML:{Xe(t,e);break}case f.BODY:{t._insertElement(e,$.HTML),t.framesetOk=!1,t.insertionMode=I.IN_BODY;break}case f.FRAMESET:{t._insertElement(e,$.HTML),t.insertionMode=I.IN_FRAMESET;break}case f.BASE:case f.BASEFONT:case f.BGSOUND:case f.LINK:case f.META:case f.NOFRAMES:case f.SCRIPT:case f.STYLE:case f.TEMPLATE:case f.TITLE:{t._err(e,M.abandonedHeadElementChild),t.openElements.push(t.headElement,f.HEAD),At(t,e),t.openElements.remove(t.headElement);break}case f.HEAD:{t._err(e,M.misplacedStartTagForHeadElement);break}default:kr(t,e)}}function Ak(t,e){switch(e.tagID){case f.BODY:case f.HTML:case f.BR:{kr(t,e);break}case f.TEMPLATE:{Tn(t,e);break}default:t._err(e,M.endTagWithoutMatchingOpenElement)}}function kr(t,e){t._insertFakeElement(L.BODY,f.BODY),t.insertionMode=I.IN_BODY,qi(t,e)}function qi(t,e){switch(e.type){case Ee.CHARACTER:{sf(t,e);break}case Ee.WHITESPACE_CHARACTER:{rf(t,e);break}case Ee.COMMENT:{oa(t,e);break}case Ee.START_TAG:{Xe(t,e);break}case Ee.END_TAG:{Vi(t,e);break}case Ee.EOF:{lf(t,e);break}}}function rf(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function sf(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function Sk(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function Ck(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(n,e.attrs))}function Ik(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&n&&(t.treeAdapter.detachNode(n),t.openElements.popAllUpToHtmlElement(),t._insertElement(e,$.HTML),t.insertionMode=I.IN_FRAMESET)}function Nk(t,e){t.openElements.hasInButtonScope(f.P)&&t._closePElement(),t._insertElement(e,$.HTML)}function wk(t,e){t.openElements.hasInButtonScope(f.P)&&t._closePElement(),t.openElements.currentTagId!==void 0&&aa.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,$.HTML)}function vk(t,e){t.openElements.hasInButtonScope(f.P)&&t._closePElement(),t._insertElement(e,$.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function Rk(t,e){const n=t.openElements.tmplCount>0;(!t.formElement||n)&&(t.openElements.hasInButtonScope(f.P)&&t._closePElement(),t._insertElement(e,$.HTML),n||(t.formElement=t.openElements.current))}function Ok(t,e){t.framesetOk=!1;const n=e.tagID;for(let r=t.openElements.stackTop;r>=0;r--){const i=t.openElements.tagIDs[r];if(n===f.LI&&i===f.LI||(n===f.DD||n===f.DT)&&(i===f.DD||i===f.DT)){t.openElements.generateImpliedEndTagsWithExclusion(i),t.openElements.popUntilTagNamePopped(i);break}if(i!==f.ADDRESS&&i!==f.DIV&&i!==f.P&&t._isSpecialElement(t.openElements.items[r],i))break}t.openElements.hasInButtonScope(f.P)&&t._closePElement(),t._insertElement(e,$.HTML)}function Lk(t,e){t.openElements.hasInButtonScope(f.P)&&t._closePElement(),t._insertElement(e,$.HTML),t.tokenizer.state=Ue.PLAINTEXT}function Dk(t,e){t.openElements.hasInScope(f.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(f.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,$.HTML),t.framesetOk=!1}function Pk(t,e){const n=t.activeFormattingElements.getElementEntryInScopeWithTagName(L.A);n&&(Va(t,e),t.openElements.remove(n.element),t.activeFormattingElements.removeEntry(n)),t._reconstructActiveFormattingElements(),t._insertElement(e,$.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function Mk(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,$.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function Bk(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(f.NOBR)&&(Va(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,$.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function Fk(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,$.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function zk(t,e){t.treeAdapter.getDocumentMode(t.document)!==Et.QUIRKS&&t.openElements.hasInButtonScope(f.P)&&t._closePElement(),t._insertElement(e,$.HTML),t.framesetOk=!1,t.insertionMode=I.IN_TABLE}function af(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,$.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function of(t){const e=Wd(t,dn.TYPE);return e!=null&&e.toLowerCase()===rk}function jk(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,$.HTML),of(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function Uk(t,e){t._appendElement(e,$.HTML),e.ackSelfClosing=!0}function Hk(t,e){t.openElements.hasInButtonScope(f.P)&&t._closePElement(),t._appendElement(e,$.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function $k(t,e){e.tagName=L.IMG,e.tagID=f.IMG,af(t,e)}function Zk(t,e){t._insertElement(e,$.HTML),t.skipNextNewLine=!0,t.tokenizer.state=Ue.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=I.TEXT}function Yk(t,e){t.openElements.hasInButtonScope(f.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,Ue.RAWTEXT)}function qk(t,e){t.framesetOk=!1,t._switchToTextParsing(e,Ue.RAWTEXT)}function el(t,e){t._switchToTextParsing(e,Ue.RAWTEXT)}function Vk(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,$.HTML),t.framesetOk=!1,t.insertionMode=t.insertionMode===I.IN_TABLE||t.insertionMode===I.IN_CAPTION||t.insertionMode===I.IN_TABLE_BODY||t.insertionMode===I.IN_ROW||t.insertionMode===I.IN_CELL?I.IN_SELECT_IN_TABLE:I.IN_SELECT}function Wk(t,e){t.openElements.currentTagId===f.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,$.HTML)}function Gk(t,e){t.openElements.hasInScope(f.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,$.HTML)}function Kk(t,e){t.openElements.hasInScope(f.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(f.RTC),t._insertElement(e,$.HTML)}function Qk(t,e){t._reconstructActiveFormattingElements(),ef(e),qa(e),e.selfClosing?t._appendElement(e,$.MATHML):t._insertElement(e,$.MATHML),e.ackSelfClosing=!0}function Xk(t,e){t._reconstructActiveFormattingElements(),tf(e),qa(e),e.selfClosing?t._appendElement(e,$.SVG):t._insertElement(e,$.SVG),e.ackSelfClosing=!0}function tl(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,$.HTML)}function Xe(t,e){switch(e.tagID){case f.I:case f.S:case f.B:case f.U:case f.EM:case f.TT:case f.BIG:case f.CODE:case f.FONT:case f.SMALL:case f.STRIKE:case f.STRONG:{Mk(t,e);break}case f.A:{Pk(t,e);break}case f.H1:case f.H2:case f.H3:case f.H4:case f.H5:case f.H6:{wk(t,e);break}case f.P:case f.DL:case f.OL:case f.UL:case f.DIV:case f.DIR:case f.NAV:case f.MAIN:case f.MENU:case f.ASIDE:case f.CENTER:case f.FIGURE:case f.FOOTER:case f.HEADER:case f.HGROUP:case f.DIALOG:case f.DETAILS:case f.ADDRESS:case f.ARTICLE:case f.SEARCH:case f.SECTION:case f.SUMMARY:case f.FIELDSET:case f.BLOCKQUOTE:case f.FIGCAPTION:{Nk(t,e);break}case f.LI:case f.DD:case f.DT:{Ok(t,e);break}case f.BR:case f.IMG:case f.WBR:case f.AREA:case f.EMBED:case f.KEYGEN:{af(t,e);break}case f.HR:{Hk(t,e);break}case f.RB:case f.RTC:{Gk(t,e);break}case f.RT:case f.RP:{Kk(t,e);break}case f.PRE:case f.LISTING:{vk(t,e);break}case f.XMP:{Yk(t,e);break}case f.SVG:{Xk(t,e);break}case f.HTML:{Sk(t,e);break}case f.BASE:case f.LINK:case f.META:case f.STYLE:case f.TITLE:case f.SCRIPT:case f.BGSOUND:case f.BASEFONT:case f.TEMPLATE:{At(t,e);break}case f.BODY:{Ck(t,e);break}case f.FORM:{Rk(t,e);break}case f.NOBR:{Bk(t,e);break}case f.MATH:{Qk(t,e);break}case f.TABLE:{zk(t,e);break}case f.INPUT:{jk(t,e);break}case f.PARAM:case f.TRACK:case f.SOURCE:{Uk(t,e);break}case f.IMAGE:{$k(t,e);break}case f.BUTTON:{Dk(t,e);break}case f.APPLET:case f.OBJECT:case f.MARQUEE:{Fk(t,e);break}case f.IFRAME:{qk(t,e);break}case f.SELECT:{Vk(t,e);break}case f.OPTION:case f.OPTGROUP:{Wk(t,e);break}case f.NOEMBED:case f.NOFRAMES:{el(t,e);break}case f.FRAMESET:{Ik(t,e);break}case f.TEXTAREA:{Zk(t,e);break}case f.NOSCRIPT:{t.options.scriptingEnabled?el(t,e):tl(t,e);break}case f.PLAINTEXT:{Lk(t,e);break}case f.COL:case f.TH:case f.TD:case f.TR:case f.HEAD:case f.FRAME:case f.TBODY:case f.TFOOT:case f.THEAD:case f.CAPTION:case f.COLGROUP:break;default:tl(t,e)}}function Jk(t,e){if(t.openElements.hasInScope(f.BODY)&&(t.insertionMode=I.AFTER_BODY,t.options.sourceCodeLocationInfo)){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t._setEndLocation(n,e)}}function eA(t,e){t.openElements.hasInScope(f.BODY)&&(t.insertionMode=I.AFTER_BODY,bf(t,e))}function tA(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n))}function nA(t){const e=t.openElements.tmplCount>0,{formElement:n}=t;e||(t.formElement=null),(n||e)&&t.openElements.hasInScope(f.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(f.FORM):n&&t.openElements.remove(n))}function rA(t){t.openElements.hasInButtonScope(f.P)||t._insertFakeElement(L.P,f.P),t._closePElement()}function iA(t){t.openElements.hasInListItemScope(f.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(f.LI),t.openElements.popUntilTagNamePopped(f.LI))}function sA(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.popUntilTagNamePopped(n))}function aA(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function oA(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker())}function uA(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(L.BR,f.BR),t.openElements.pop(),t.framesetOk=!1}function uf(t,e){const n=e.tagName,r=e.tagID;for(let i=t.openElements.stackTop;i>0;i--){const s=t.openElements.items[i],a=t.openElements.tagIDs[i];if(r===a&&(r!==f.UNKNOWN||t.treeAdapter.getTagName(s)===n)){t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.stackTop>=i&&t.openElements.shortenToLength(i);break}if(t._isSpecialElement(s,a))break}}function Vi(t,e){switch(e.tagID){case f.A:case f.B:case f.I:case f.S:case f.U:case f.EM:case f.TT:case f.BIG:case f.CODE:case f.FONT:case f.NOBR:case f.SMALL:case f.STRIKE:case f.STRONG:{Va(t,e);break}case f.P:{rA(t);break}case f.DL:case f.UL:case f.OL:case f.DIR:case f.DIV:case f.NAV:case f.PRE:case f.MAIN:case f.MENU:case f.ASIDE:case f.BUTTON:case f.CENTER:case f.FIGURE:case f.FOOTER:case f.HEADER:case f.HGROUP:case f.DIALOG:case f.ADDRESS:case f.ARTICLE:case f.DETAILS:case f.SEARCH:case f.SECTION:case f.SUMMARY:case f.LISTING:case f.FIELDSET:case f.BLOCKQUOTE:case f.FIGCAPTION:{tA(t,e);break}case f.LI:{iA(t);break}case f.DD:case f.DT:{sA(t,e);break}case f.H1:case f.H2:case f.H3:case f.H4:case f.H5:case f.H6:{aA(t);break}case f.BR:{uA(t);break}case f.BODY:{Jk(t,e);break}case f.HTML:{eA(t,e);break}case f.FORM:{nA(t);break}case f.APPLET:case f.OBJECT:case f.MARQUEE:{oA(t,e);break}case f.TEMPLATE:{Tn(t,e);break}default:uf(t,e)}}function lf(t,e){t.tmplInsertionModeStack.length>0?gf(t,e):Wa(t,e)}function lA(t,e){var n;e.tagID===f.SCRIPT&&((n=t.scriptHandler)===null||n===void 0||n.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function cA(t,e){t._err(e,M.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function _s(t,e){if(t.openElements.currentTagId!==void 0&&nf.has(t.openElements.currentTagId))switch(t.pendingCharacterTokens.length=0,t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=I.IN_TABLE_TEXT,e.type){case Ee.CHARACTER:{df(t,e);break}case Ee.WHITESPACE_CHARACTER:{cf(t,e);break}}else qr(t,e)}function dA(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,$.HTML),t.insertionMode=I.IN_CAPTION}function fA(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,$.HTML),t.insertionMode=I.IN_COLUMN_GROUP}function hA(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(L.COLGROUP,f.COLGROUP),t.insertionMode=I.IN_COLUMN_GROUP,Ga(t,e)}function pA(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,$.HTML),t.insertionMode=I.IN_TABLE_BODY}function mA(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(L.TBODY,f.TBODY),t.insertionMode=I.IN_TABLE_BODY,Wi(t,e)}function gA(t,e){t.openElements.hasInTableScope(f.TABLE)&&(t.openElements.popUntilTagNamePopped(f.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function bA(t,e){of(e)?t._appendElement(e,$.HTML):qr(t,e),e.ackSelfClosing=!0}function EA(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,$.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function Fn(t,e){switch(e.tagID){case f.TD:case f.TH:case f.TR:{mA(t,e);break}case f.STYLE:case f.SCRIPT:case f.TEMPLATE:{At(t,e);break}case f.COL:{hA(t,e);break}case f.FORM:{EA(t,e);break}case f.TABLE:{gA(t,e);break}case f.TBODY:case f.TFOOT:case f.THEAD:{pA(t,e);break}case f.INPUT:{bA(t,e);break}case f.CAPTION:{dA(t,e);break}case f.COLGROUP:{fA(t,e);break}default:qr(t,e)}}function vr(t,e){switch(e.tagID){case f.TABLE:{t.openElements.hasInTableScope(f.TABLE)&&(t.openElements.popUntilTagNamePopped(f.TABLE),t._resetInsertionMode());break}case f.TEMPLATE:{Tn(t,e);break}case f.BODY:case f.CAPTION:case f.COL:case f.COLGROUP:case f.HTML:case f.TBODY:case f.TD:case f.TFOOT:case f.TH:case f.THEAD:case f.TR:break;default:qr(t,e)}}function qr(t,e){const n=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,qi(t,e),t.fosterParentingEnabled=n}function cf(t,e){t.pendingCharacterTokens.push(e)}function df(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function sr(t,e){let n=0;if(t.hasNonWhitespacePendingCharacterToken)for(;n<t.pendingCharacterTokens.length;n++)qr(t,t.pendingCharacterTokens[n]);else for(;n<t.pendingCharacterTokens.length;n++)t._insertCharacters(t.pendingCharacterTokens[n]);t.insertionMode=t.originalInsertionMode,t._processToken(e)}const ff=new Set([f.CAPTION,f.COL,f.COLGROUP,f.TBODY,f.TD,f.TFOOT,f.TH,f.THEAD,f.TR]);function xA(t,e){const n=e.tagID;ff.has(n)?t.openElements.hasInTableScope(f.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(f.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=I.IN_TABLE,Fn(t,e)):Xe(t,e)}function TA(t,e){const n=e.tagID;switch(n){case f.CAPTION:case f.TABLE:{t.openElements.hasInTableScope(f.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(f.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=I.IN_TABLE,n===f.TABLE&&vr(t,e));break}case f.BODY:case f.COL:case f.COLGROUP:case f.HTML:case f.TBODY:case f.TD:case f.TFOOT:case f.TH:case f.THEAD:case f.TR:break;default:Vi(t,e)}}function Ga(t,e){switch(e.tagID){case f.HTML:{Xe(t,e);break}case f.COL:{t._appendElement(e,$.HTML),e.ackSelfClosing=!0;break}case f.TEMPLATE:{At(t,e);break}default:Ci(t,e)}}function _A(t,e){switch(e.tagID){case f.COLGROUP:{t.openElements.currentTagId===f.COLGROUP&&(t.openElements.pop(),t.insertionMode=I.IN_TABLE);break}case f.TEMPLATE:{Tn(t,e);break}case f.COL:break;default:Ci(t,e)}}function Ci(t,e){t.openElements.currentTagId===f.COLGROUP&&(t.openElements.pop(),t.insertionMode=I.IN_TABLE,t._processToken(e))}function Wi(t,e){switch(e.tagID){case f.TR:{t.openElements.clearBackToTableBodyContext(),t._insertElement(e,$.HTML),t.insertionMode=I.IN_ROW;break}case f.TH:case f.TD:{t.openElements.clearBackToTableBodyContext(),t._insertFakeElement(L.TR,f.TR),t.insertionMode=I.IN_ROW,Gi(t,e);break}case f.CAPTION:case f.COL:case f.COLGROUP:case f.TBODY:case f.TFOOT:case f.THEAD:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=I.IN_TABLE,Fn(t,e));break}default:Fn(t,e)}}function ua(t,e){const n=e.tagID;switch(e.tagID){case f.TBODY:case f.TFOOT:case f.THEAD:{t.openElements.hasInTableScope(n)&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=I.IN_TABLE);break}case f.TABLE:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=I.IN_TABLE,vr(t,e));break}case f.BODY:case f.CAPTION:case f.COL:case f.COLGROUP:case f.HTML:case f.TD:case f.TH:case f.TR:break;default:vr(t,e)}}function Gi(t,e){switch(e.tagID){case f.TH:case f.TD:{t.openElements.clearBackToTableRowContext(),t._insertElement(e,$.HTML),t.insertionMode=I.IN_CELL,t.activeFormattingElements.insertMarker();break}case f.CAPTION:case f.COL:case f.COLGROUP:case f.TBODY:case f.TFOOT:case f.THEAD:case f.TR:{t.openElements.hasInTableScope(f.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=I.IN_TABLE_BODY,Wi(t,e));break}default:Fn(t,e)}}function hf(t,e){switch(e.tagID){case f.TR:{t.openElements.hasInTableScope(f.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=I.IN_TABLE_BODY);break}case f.TABLE:{t.openElements.hasInTableScope(f.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=I.IN_TABLE_BODY,ua(t,e));break}case f.TBODY:case f.TFOOT:case f.THEAD:{(t.openElements.hasInTableScope(e.tagID)||t.openElements.hasInTableScope(f.TR))&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=I.IN_TABLE_BODY,ua(t,e));break}case f.BODY:case f.CAPTION:case f.COL:case f.COLGROUP:case f.HTML:case f.TD:case f.TH:break;default:vr(t,e)}}function yA(t,e){const n=e.tagID;ff.has(n)?(t.openElements.hasInTableScope(f.TD)||t.openElements.hasInTableScope(f.TH))&&(t._closeTableCell(),Gi(t,e)):Xe(t,e)}function kA(t,e){const n=e.tagID;switch(n){case f.TD:case f.TH:{t.openElements.hasInTableScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=I.IN_ROW);break}case f.TABLE:case f.TBODY:case f.TFOOT:case f.THEAD:case f.TR:{t.openElements.hasInTableScope(n)&&(t._closeTableCell(),hf(t,e));break}case f.BODY:case f.CAPTION:case f.COL:case f.COLGROUP:case f.HTML:break;default:Vi(t,e)}}function pf(t,e){switch(e.tagID){case f.HTML:{Xe(t,e);break}case f.OPTION:{t.openElements.currentTagId===f.OPTION&&t.openElements.pop(),t._insertElement(e,$.HTML);break}case f.OPTGROUP:{t.openElements.currentTagId===f.OPTION&&t.openElements.pop(),t.openElements.currentTagId===f.OPTGROUP&&t.openElements.pop(),t._insertElement(e,$.HTML);break}case f.HR:{t.openElements.currentTagId===f.OPTION&&t.openElements.pop(),t.openElements.currentTagId===f.OPTGROUP&&t.openElements.pop(),t._appendElement(e,$.HTML),e.ackSelfClosing=!0;break}case f.INPUT:case f.KEYGEN:case f.TEXTAREA:case f.SELECT:{t.openElements.hasInSelectScope(f.SELECT)&&(t.openElements.popUntilTagNamePopped(f.SELECT),t._resetInsertionMode(),e.tagID!==f.SELECT&&t._processStartTag(e));break}case f.SCRIPT:case f.TEMPLATE:{At(t,e);break}}}function mf(t,e){switch(e.tagID){case f.OPTGROUP:{t.openElements.stackTop>0&&t.openElements.currentTagId===f.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===f.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===f.OPTGROUP&&t.openElements.pop();break}case f.OPTION:{t.openElements.currentTagId===f.OPTION&&t.openElements.pop();break}case f.SELECT:{t.openElements.hasInSelectScope(f.SELECT)&&(t.openElements.popUntilTagNamePopped(f.SELECT),t._resetInsertionMode());break}case f.TEMPLATE:{Tn(t,e);break}}}function AA(t,e){const n=e.tagID;n===f.CAPTION||n===f.TABLE||n===f.TBODY||n===f.TFOOT||n===f.THEAD||n===f.TR||n===f.TD||n===f.TH?(t.openElements.popUntilTagNamePopped(f.SELECT),t._resetInsertionMode(),t._processStartTag(e)):pf(t,e)}function SA(t,e){const n=e.tagID;n===f.CAPTION||n===f.TABLE||n===f.TBODY||n===f.TFOOT||n===f.THEAD||n===f.TR||n===f.TD||n===f.TH?t.openElements.hasInTableScope(n)&&(t.openElements.popUntilTagNamePopped(f.SELECT),t._resetInsertionMode(),t.onEndTag(e)):mf(t,e)}function CA(t,e){switch(e.tagID){case f.BASE:case f.BASEFONT:case f.BGSOUND:case f.LINK:case f.META:case f.NOFRAMES:case f.SCRIPT:case f.STYLE:case f.TEMPLATE:case f.TITLE:{At(t,e);break}case f.CAPTION:case f.COLGROUP:case f.TBODY:case f.TFOOT:case f.THEAD:{t.tmplInsertionModeStack[0]=I.IN_TABLE,t.insertionMode=I.IN_TABLE,Fn(t,e);break}case f.COL:{t.tmplInsertionModeStack[0]=I.IN_COLUMN_GROUP,t.insertionMode=I.IN_COLUMN_GROUP,Ga(t,e);break}case f.TR:{t.tmplInsertionModeStack[0]=I.IN_TABLE_BODY,t.insertionMode=I.IN_TABLE_BODY,Wi(t,e);break}case f.TD:case f.TH:{t.tmplInsertionModeStack[0]=I.IN_ROW,t.insertionMode=I.IN_ROW,Gi(t,e);break}default:t.tmplInsertionModeStack[0]=I.IN_BODY,t.insertionMode=I.IN_BODY,Xe(t,e)}}function IA(t,e){e.tagID===f.TEMPLATE&&Tn(t,e)}function gf(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(f.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):Wa(t,e)}function NA(t,e){e.tagID===f.HTML?Xe(t,e):Ii(t,e)}function bf(t,e){var n;if(e.tagID===f.HTML){if(t.fragmentContext||(t.insertionMode=I.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===f.HTML){t._setEndLocation(t.openElements.items[0],e);const r=t.openElements.items[1];r&&!(!((n=t.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&t._setEndLocation(r,e)}}else Ii(t,e)}function Ii(t,e){t.insertionMode=I.IN_BODY,qi(t,e)}function wA(t,e){switch(e.tagID){case f.HTML:{Xe(t,e);break}case f.FRAMESET:{t._insertElement(e,$.HTML);break}case f.FRAME:{t._appendElement(e,$.HTML),e.ackSelfClosing=!0;break}case f.NOFRAMES:{At(t,e);break}}}function vA(t,e){e.tagID===f.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagId!==f.FRAMESET&&(t.insertionMode=I.AFTER_FRAMESET))}function RA(t,e){switch(e.tagID){case f.HTML:{Xe(t,e);break}case f.NOFRAMES:{At(t,e);break}}}function OA(t,e){e.tagID===f.HTML&&(t.insertionMode=I.AFTER_AFTER_FRAMESET)}function LA(t,e){e.tagID===f.HTML?Xe(t,e):hi(t,e)}function hi(t,e){t.insertionMode=I.IN_BODY,qi(t,e)}function DA(t,e){switch(e.tagID){case f.HTML:{Xe(t,e);break}case f.NOFRAMES:{At(t,e);break}}}function PA(t,e){e.chars=Me,t._insertCharacters(e)}function MA(t,e){t._insertCharacters(e),t.framesetOk=!1}function Ef(t){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==$.HTML&&t.openElements.currentTagId!==void 0&&!t._isIntegrationPoint(t.openElements.currentTagId,t.openElements.current);)t.openElements.pop()}function BA(t,e){if(X3(e))Ef(t),t._startTagOutsideForeignContent(e);else{const n=t._getAdjustedCurrentElement(),r=t.treeAdapter.getNamespaceURI(n);r===$.MATHML?ef(e):r===$.SVG&&(J3(e),tf(e)),qa(e),e.selfClosing?t._appendElement(e,r):t._insertElement(e,r),e.ackSelfClosing=!0}}function FA(t,e){if(e.tagID===f.P||e.tagID===f.BR){Ef(t),t._endTagOutsideForeignContent(e);return}for(let n=t.openElements.stackTop;n>0;n--){const r=t.openElements.items[n];if(t.treeAdapter.getNamespaceURI(r)===$.HTML){t._endTagOutsideForeignContent(e);break}const i=t.treeAdapter.getTagName(r);if(i.toLowerCase()===e.tagName){e.tagName=i,t.openElements.shortenToLength(n);break}}}L.AREA,L.BASE,L.BASEFONT,L.BGSOUND,L.BR,L.COL,L.EMBED,L.FRAME,L.HR,L.IMG,L.INPUT,L.KEYGEN,L.LINK,L.META,L.PARAM,L.SOURCE,L.TRACK,L.WBR;const zA=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,jA=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),nl={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function xf(t,e){const n=KA(t),r=$d("type",{handlers:{root:UA,element:HA,text:$A,comment:_f,doctype:ZA,raw:qA},unknown:VA}),i={parser:n?new Ju(nl):Ju.getFragmentParser(void 0,nl),handle(o){r(o,i)},stitches:!1,options:e||{}};r(t,i),Vn(i,Rt());const s=n?i.parser.document:i.parser.getFragment(),a=Qy(s,{file:i.options.file});return i.stitches&&Yi(a,"comment",function(o,u,l){const d=o;if(d.value.stitch&&l&&u!==void 0){const c=l.children;return c[u]=d.value.stitch,u}}),a.type==="root"&&a.children.length===1&&a.children[0].type===t.type?a.children[0]:a}function Tf(t,e){let n=-1;if(t)for(;++n<t.length;)e.handle(t[n])}function UA(t,e){Tf(t.children,e)}function HA(t,e){WA(t,e),Tf(t.children,e),GA(t,e)}function $A(t,e){e.parser.tokenizer.state>4&&(e.parser.tokenizer.state=0);const n={type:Ee.CHARACTER,chars:t.value,location:Vr(t)};Vn(e,Rt(t)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function ZA(t,e){const n={type:Ee.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Vr(t)};Vn(e,Rt(t)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function YA(t,e){e.stitches=!0;const n=QA(t);if("children"in t&&"children"in n){const r=xf({type:"root",children:t.children},e.options);n.children=r.children}_f({type:"comment",value:{stitch:n}},e)}function _f(t,e){const n=t.value,r={type:Ee.COMMENT,data:n,location:Vr(t)};Vn(e,Rt(t)),e.parser.currentToken=r,e.parser._processToken(e.parser.currentToken)}function qA(t,e){if(e.parser.tokenizer.preprocessor.html="",e.parser.tokenizer.preprocessor.pos=-1,e.parser.tokenizer.preprocessor.lastGapPos=-2,e.parser.tokenizer.preprocessor.gapStack=[],e.parser.tokenizer.preprocessor.skipNextNewLine=!1,e.parser.tokenizer.preprocessor.lastChunkWritten=!1,e.parser.tokenizer.preprocessor.endOfChunkHit=!1,e.parser.tokenizer.preprocessor.isEol=!1,yf(e,Rt(t)),e.parser.tokenizer.write(e.options.tagfilter?t.value.replace(zA,"<$1$2"):t.value,!1),e.parser.tokenizer._runParsingLoop(),e.parser.tokenizer.state===72||e.parser.tokenizer.state===78){e.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=e.parser.tokenizer._consume();e.parser.tokenizer._callState(n)}}function VA(t,e){const n=t;if(e.options.passThrough&&e.options.passThrough.includes(n.type))YA(n,e);else{let r="";throw jA.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function Vn(t,e){yf(t,e);const n=t.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=t.parser.tokenizer.preprocessor.line,n.location.endCol=t.parser.tokenizer.preprocessor.col+1,n.location.endOffset=t.parser.tokenizer.preprocessor.offset+1,t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)),t.parser.tokenizer.paused=!1,t.parser.tokenizer.inLoop=!1,t.parser.tokenizer.active=!1,t.parser.tokenizer.returnState=Ue.DATA,t.parser.tokenizer.charRefCode=-1,t.parser.tokenizer.consumedAfterSnapshot=-1,t.parser.tokenizer.currentLocation=null,t.parser.tokenizer.currentCharacterToken=null,t.parser.tokenizer.currentToken=null,t.parser.tokenizer.currentAttr={name:"",value:""}}function yf(t,e){if(e&&e.offset!==void 0){const n={startLine:e.line,startCol:e.column,startOffset:e.offset,endLine:-1,endCol:-1,endOffset:-1};t.parser.tokenizer.preprocessor.lineStartPos=-e.column+1,t.parser.tokenizer.preprocessor.droppedBufferSize=e.offset,t.parser.tokenizer.preprocessor.line=e.line,t.parser.tokenizer.currentLocation=n}}function WA(t,e){const n=t.tagName.toLowerCase();if(e.parser.tokenizer.state===Ue.PLAINTEXT)return;Vn(e,Rt(t));const r=e.parser.openElements.current;let i="namespaceURI"in r?r.namespaceURI:cn.html;i===cn.html&&n==="svg"&&(i=cn.svg);const s=n3({...t,children:[]},{space:i===cn.svg?"svg":"html"}),a={type:Ee.START_TAG,tagName:n,tagID:qn(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:Vr(t)};e.parser.currentToken=a,e.parser._processToken(e.parser.currentToken),e.parser.tokenizer.lastStartTagName=n}function GA(t,e){const n=t.tagName.toLowerCase();if(!e.parser.tokenizer.inForeignNode&&c3.includes(n)||e.parser.tokenizer.state===Ue.PLAINTEXT)return;Vn(e,zi(t));const r={type:Ee.END_TAG,tagName:n,tagID:qn(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Vr(t)};e.parser.currentToken=r,e.parser._processToken(e.parser.currentToken),n===e.parser.tokenizer.lastStartTagName&&(e.parser.tokenizer.state===Ue.RCDATA||e.parser.tokenizer.state===Ue.RAWTEXT||e.parser.tokenizer.state===Ue.SCRIPT_DATA)&&(e.parser.tokenizer.state=Ue.DATA)}function KA(t){const e=t.type==="root"?t.children[0]:t;return!!(e&&(e.type==="doctype"||e.type==="element"&&e.tagName.toLowerCase()==="html"))}function Vr(t){const e=Rt(t)||{line:void 0,column:void 0,offset:void 0},n=zi(t)||{line:void 0,column:void 0,offset:void 0};return{startLine:e.line,startCol:e.column,startOffset:e.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function QA(t){return"children"in t?Bn({...t,children:[]}):Bn(t)}function XA(t){return function(e,n){return xf(e,{...t,file:n})}}function rl(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(e);for(;i!==-1;)r++,i=n.indexOf(e,i+e.length);return r}function JA(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function eS(t,e,n){const i=$i((n||{}).ignore||[]),s=tS(e);let a=-1;for(;++a<s.length;)Fd(t,"text",o);function o(l,d){let c=-1,h;for(;++c<d.length;){const p=d[c],g=h?h.children:void 0;if(i(p,g?g.indexOf(p):void 0,h))return;h=p}if(h)return u(l,d)}function u(l,d){const c=d[d.length-1],h=s[a][0],p=s[a][1];let g=0;const T=c.children.indexOf(l);let x=!1,_=[];h.lastIndex=0;let b=h.exec(l.value);for(;b;){const C=b.index,w={index:b.index,input:b.input,stack:[...d,l]};let k=p(...b,w);if(typeof k=="string"&&(k=k.length>0?{type:"text",value:k}:void 0),k===!1?h.lastIndex=C+1:(g!==C&&_.push({type:"text",value:l.value.slice(g,C)}),Array.isArray(k)?_.push(...k):k&&_.push(k),g=C+b[0].length,x=!0),!h.global)break;b=h.exec(l.value)}return x?(g<l.value.length&&_.push({type:"text",value:l.value.slice(g)}),c.children.splice(T,1,..._)):_=[l],T+_.length}}function tS(t){const e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!t[0]||Array.isArray(t[0])?t:[t];let r=-1;for(;++r<n.length;){const i=n[r];e.push([nS(i[0]),rS(i[1])])}return e}function nS(t){return typeof t=="string"?new RegExp(JA(t),"g"):t}function rS(t){return typeof t=="function"?t:function(){return t}}const ys="phrasing",ks=["autolink","link","image","label"];function iS(){return{transforms:[dS],enter:{literalAutolink:aS,literalAutolinkEmail:As,literalAutolinkHttp:As,literalAutolinkWww:As},exit:{literalAutolink:cS,literalAutolinkEmail:lS,literalAutolinkHttp:oS,literalAutolinkWww:uS}}}function sS(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ys,notInConstruct:ks},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ys,notInConstruct:ks},{character:":",before:"[ps]",after:"\\/",inConstruct:ys,notInConstruct:ks}]}}function aS(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function As(t){this.config.enter.autolinkProtocol.call(this,t)}function oS(t){this.config.exit.autolinkProtocol.call(this,t)}function uS(t){this.config.exit.data.call(this,t);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function lS(t){this.config.exit.autolinkEmail.call(this,t)}function cS(t){this.exit(t)}function dS(t){eS(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,fS],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),hS]],{ignore:["link","linkReference"]})}function fS(t,e,n,r,i){let s="";if(!kf(i)||(/^w/i.test(e)&&(n=e+n,e="",s="http://"),!pS(n)))return!1;const a=mS(n+r);if(!a[0])return!1;const o={type:"link",title:null,url:s+e+a[0],children:[{type:"text",value:e+a[0]}]};return a[1]?[o,{type:"text",value:a[1]}]:o}function hS(t,e,n,r){return!kf(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function pS(t){const e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function mS(t){const e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],r=n.indexOf(")");const i=rl(t,"(");let s=rl(t,")");for(;r!==-1&&i>s;)t+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[t,n]}function kf(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||gn(n)||ji(n))&&(!e||n!==47)}Af.peek=AS;function gS(){this.buffer()}function bS(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function ES(){this.buffer()}function xS(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function TS(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=yt(this.sliceSerialize(t)).toLowerCase(),n.label=e}function _S(t){this.exit(t)}function yS(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=yt(this.sliceSerialize(t)).toLowerCase(),n.label=e}function kS(t){this.exit(t)}function AS(){return"["}function Af(t,e,n,r){const i=n.createTracker(r);let s=i.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return s+=i.move(n.safe(n.associationId(t),{after:"]",before:s})),o(),a(),s+=i.move("]"),s}function SS(){return{enter:{gfmFootnoteCallString:gS,gfmFootnoteCall:bS,gfmFootnoteDefinitionLabelString:ES,gfmFootnoteDefinition:xS},exit:{gfmFootnoteCallString:TS,gfmFootnoteCall:_S,gfmFootnoteDefinitionLabelString:yS,gfmFootnoteDefinition:kS}}}function CS(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:Af},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,a){const o=s.createTracker(a);let u=o.move("[^");const l=s.enter("footnoteDefinition"),d=s.enter("label");return u+=o.move(s.safe(s.associationId(r),{before:u,after:"]"})),d(),u+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),u+=o.move((e?`
|
|
109
|
+
`:" ")+s.indentLines(s.containerFlow(r,o.current()),e?Sf:IS))),l(),u}}function IS(t,e,n){return e===0?t:Sf(t,e,n)}function Sf(t,e,n){return(n?"":" ")+t}const NS=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Cf.peek=LS;function wS(){return{canContainEols:["delete"],enter:{strikethrough:RS},exit:{strikethrough:OS}}}function vS(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:NS}],handlers:{delete:Cf}}}function RS(t){this.enter({type:"delete",children:[]},t)}function OS(t){this.exit(t)}function Cf(t,e,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(t,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),s(),a}function LS(){return"~"}function DS(t){return t.length}function PS(t,e){const n=e||{},r=(n.align||[]).concat(),i=n.stringLength||DS,s=[],a=[],o=[],u=[];let l=0,d=-1;for(;++d<t.length;){const E=[],T=[];let x=-1;for(t[d].length>l&&(l=t[d].length);++x<t[d].length;){const _=MS(t[d][x]);if(n.alignDelimiters!==!1){const b=i(_);T[x]=b,(u[x]===void 0||b>u[x])&&(u[x]=b)}E.push(_)}a[d]=E,o[d]=T}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<l;)s[c]=il(r[c]);else{const E=il(r);for(;++c<l;)s[c]=E}c=-1;const h=[],p=[];for(;++c<l;){const E=s[c];let T="",x="";E===99?(T=":",x=":"):E===108?T=":":E===114&&(x=":");let _=n.alignDelimiters===!1?1:Math.max(1,u[c]-T.length-x.length);const b=T+"-".repeat(_)+x;n.alignDelimiters!==!1&&(_=T.length+_+x.length,_>u[c]&&(u[c]=_),p[c]=_),h[c]=b}a.splice(1,0,h),o.splice(1,0,p),d=-1;const g=[];for(;++d<a.length;){const E=a[d],T=o[d];c=-1;const x=[];for(;++c<l;){const _=E[c]||"";let b="",C="";if(n.alignDelimiters!==!1){const w=u[c]-(T[c]||0),k=s[c];k===114?b=" ".repeat(w):k===99?w%2?(b=" ".repeat(w/2+.5),C=" ".repeat(w/2-.5)):(b=" ".repeat(w/2),C=b):C=" ".repeat(w)}n.delimiterStart!==!1&&!c&&x.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&_==="")&&(n.delimiterStart!==!1||c)&&x.push(" "),n.alignDelimiters!==!1&&x.push(b),x.push(_),n.alignDelimiters!==!1&&x.push(C),n.padding!==!1&&x.push(" "),(n.delimiterEnd!==!1||c!==l-1)&&x.push("|")}g.push(n.delimiterEnd===!1?x.join("").replace(/ +$/,""):x.join(""))}return g.join(`
|
|
110
|
+
`)}function MS(t){return t==null?"":String(t)}function il(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function BS(t,e,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const a=n.indentLines(n.containerFlow(t,s.current()),FS);return i(),a}function FS(t,e,n){return">"+(n?"":" ")+t}function zS(t,e){return sl(t,e.inConstruct,!0)&&!sl(t,e.notInConstruct,!1)}function sl(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let r=-1;for(;++r<e.length;)if(t.includes(e[r]))return!0;return!1}function al(t,e,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
111
|
+
`&&zS(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
112
|
+
`}function jS(t,e){const n=String(t);let r=n.indexOf(e),i=r,s=0,a=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>a&&(a=s):s=1,i=r+e.length,r=n.indexOf(e,i);return a}function US(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function HS(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function $S(t,e,n,r){const i=HS(n),s=t.value||"",a=i==="`"?"GraveAccent":"Tilde";if(US(t,n)){const c=n.enter("codeIndented"),h=n.indentLines(s,ZS);return c(),h}const o=n.createTracker(r),u=i.repeat(Math.max(jS(s,i)+1,3)),l=n.enter("codeFenced");let d=o.move(u);if(t.lang){const c=n.enter(`codeFencedLang${a}`);d+=o.move(n.safe(t.lang,{before:d,after:" ",encode:["`"],...o.current()})),c()}if(t.lang&&t.meta){const c=n.enter(`codeFencedMeta${a}`);d+=o.move(" "),d+=o.move(n.safe(t.meta,{before:d,after:`
|
|
113
|
+
`,encode:["`"],...o.current()})),c()}return d+=o.move(`
|
|
114
|
+
`),s&&(d+=o.move(s+`
|
|
115
|
+
`)),d+=o.move(u),l(),d}function ZS(t,e,n){return(n?"":" ")+t}function Ka(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function YS(t,e,n,r){const i=Ka(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const u=n.createTracker(r);let l=u.move("[");return l+=u.move(n.safe(n.associationId(t),{before:l,after:"]",...u.current()})),l+=u.move("]: "),o(),!t.url||/[\0- \u007F]/.test(t.url)?(o=n.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(n.safe(t.url,{before:l,after:">",...u.current()})),l+=u.move(">")):(o=n.enter("destinationRaw"),l+=u.move(n.safe(t.url,{before:l,after:t.title?" ":`
|
|
116
|
+
`,...u.current()}))),o(),t.title&&(o=n.enter(`title${s}`),l+=u.move(" "+i),l+=u.move(n.safe(t.title,{before:l,after:i,...u.current()})),l+=u.move(i),o()),a(),l}function qS(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function Rr(t){return"&#x"+t.toString(16).toUpperCase()+";"}function Ni(t,e,n){const r=Mn(t),i=Mn(e);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}If.peek=VS;function If(t,e,n,r){const i=qS(n),s=n.enter("emphasis"),a=n.createTracker(r),o=a.move(i);let u=a.move(n.containerPhrasing(t,{after:i,before:o,...a.current()}));const l=u.charCodeAt(0),d=Ni(r.before.charCodeAt(r.before.length-1),l,i);d.inside&&(u=Rr(l)+u.slice(1));const c=u.charCodeAt(u.length-1),h=Ni(r.after.charCodeAt(0),c,i);h.inside&&(u=u.slice(0,-1)+Rr(c));const p=a.move(i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+u+p}function VS(t,e,n){return n.options.emphasis||"*"}function WS(t,e){let n=!1;return Yi(t,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,ea}),!!((!t.depth||t.depth<3)&&Ma(t)&&(e.options.setext||n))}function GS(t,e,n,r){const i=Math.max(Math.min(6,t.depth||1),1),s=n.createTracker(r);if(WS(t,n)){const d=n.enter("headingSetext"),c=n.enter("phrasing"),h=n.containerPhrasing(t,{...s.current(),before:`
|
|
117
|
+
`,after:`
|
|
118
|
+
`});return c(),d(),h+`
|
|
119
|
+
`+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
|
|
120
|
+
`))+1))}const a="#".repeat(i),o=n.enter("headingAtx"),u=n.enter("phrasing");s.move(a+" ");let l=n.containerPhrasing(t,{before:"# ",after:`
|
|
121
|
+
`,...s.current()});return/^[\t ]/.test(l)&&(l=Rr(l.charCodeAt(0))+l.slice(1)),l=l?a+" "+l:a,n.options.closeAtx&&(l+=" "+a),u(),o(),l}Nf.peek=KS;function Nf(t){return t.value||""}function KS(){return"<"}wf.peek=QS;function wf(t,e,n,r){const i=Ka(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const u=n.createTracker(r);let l=u.move("![");return l+=u.move(n.safe(t.alt,{before:l,after:"]",...u.current()})),l+=u.move("]("),o(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(o=n.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(n.safe(t.url,{before:l,after:">",...u.current()})),l+=u.move(">")):(o=n.enter("destinationRaw"),l+=u.move(n.safe(t.url,{before:l,after:t.title?" ":")",...u.current()}))),o(),t.title&&(o=n.enter(`title${s}`),l+=u.move(" "+i),l+=u.move(n.safe(t.title,{before:l,after:i,...u.current()})),l+=u.move(i),o()),l+=u.move(")"),a(),l}function QS(){return"!"}vf.peek=XS;function vf(t,e,n,r){const i=t.referenceType,s=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let u=o.move("![");const l=n.safe(t.alt,{before:u,after:"]",...o.current()});u+=o.move(l+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const c=n.safe(n.associationId(t),{before:u,after:"]",...o.current()});return a(),n.stack=d,s(),i==="full"||!l||l!==c?u+=o.move(c+"]"):i==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function XS(){return"!"}Rf.peek=JS;function Rf(t,e,n){let r=t.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const a=n.unsafe[s],o=n.compilePattern(a);let u;if(a.atBreak)for(;u=o.exec(r);){let l=u.index;r.charCodeAt(l)===10&&r.charCodeAt(l-1)===13&&l--,r=r.slice(0,l)+" "+r.slice(u.index+1)}}return i+r+i}function JS(){return"`"}function Of(t,e){const n=Ma(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}Lf.peek=eC;function Lf(t,e,n,r){const i=Ka(n),s=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let o,u;if(Of(t,n)){const d=n.stack;n.stack=[],o=n.enter("autolink");let c=a.move("<");return c+=a.move(n.containerPhrasing(t,{before:c,after:">",...a.current()})),c+=a.move(">"),o(),n.stack=d,c}o=n.enter("link"),u=n.enter("label");let l=a.move("[");return l+=a.move(n.containerPhrasing(t,{before:l,after:"](",...a.current()})),l+=a.move("]("),u(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),l+=a.move("<"),l+=a.move(n.safe(t.url,{before:l,after:">",...a.current()})),l+=a.move(">")):(u=n.enter("destinationRaw"),l+=a.move(n.safe(t.url,{before:l,after:t.title?" ":")",...a.current()}))),u(),t.title&&(u=n.enter(`title${s}`),l+=a.move(" "+i),l+=a.move(n.safe(t.title,{before:l,after:i,...a.current()})),l+=a.move(i),u()),l+=a.move(")"),o(),l}function eC(t,e,n){return Of(t,n)?"<":"["}Df.peek=tC;function Df(t,e,n,r){const i=t.referenceType,s=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let u=o.move("[");const l=n.containerPhrasing(t,{before:u,after:"]",...o.current()});u+=o.move(l+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const c=n.safe(n.associationId(t),{before:u,after:"]",...o.current()});return a(),n.stack=d,s(),i==="full"||!l||l!==c?u+=o.move(c+"]"):i==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function tC(){return"["}function Qa(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function nC(t){const e=Qa(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function rC(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function Pf(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function iC(t,e,n,r){const i=n.enter("list"),s=n.bulletCurrent;let a=t.ordered?rC(n):Qa(n);const o=t.ordered?a==="."?")":".":nC(n);let u=e&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!t.ordered){const d=t.children?t.children[0]:void 0;if((a==="*"||a==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),Pf(n)===a&&d){let c=-1;for(;++c<t.children.length;){const h=t.children[c];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(a=o),n.bulletCurrent=a;const l=n.containerFlow(t,r);return n.bulletLastUsed=a,n.bulletCurrent=s,i(),l}function sC(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function aC(t,e,n,r){const i=sC(n);let s=n.bulletCurrent||Qa(n);e&&e.type==="list"&&e.ordered&&(s=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+s);let a=s.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(a=Math.ceil(a/4)*4);const o=n.createTracker(r);o.move(s+" ".repeat(a-s.length)),o.shift(a);const u=n.enter("listItem"),l=n.indentLines(n.containerFlow(t,o.current()),d);return u(),l;function d(c,h,p){return h?(p?"":" ".repeat(a))+c:(p?s:s+" ".repeat(a-s.length))+c}}function oC(t,e,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),a=n.containerPhrasing(t,r);return s(),i(),a}const uC=$i(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function lC(t,e,n,r){return(t.children.some(function(a){return uC(a)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function cC(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}Mf.peek=dC;function Mf(t,e,n,r){const i=cC(n),s=n.enter("strong"),a=n.createTracker(r),o=a.move(i+i);let u=a.move(n.containerPhrasing(t,{after:i,before:o,...a.current()}));const l=u.charCodeAt(0),d=Ni(r.before.charCodeAt(r.before.length-1),l,i);d.inside&&(u=Rr(l)+u.slice(1));const c=u.charCodeAt(u.length-1),h=Ni(r.after.charCodeAt(0),c,i);h.inside&&(u=u.slice(0,-1)+Rr(c));const p=a.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+u+p}function dC(t,e,n){return n.options.strong||"*"}function fC(t,e,n,r){return n.safe(t.value,r)}function hC(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function pC(t,e,n){const r=(Pf(n)+(n.options.ruleSpaces?" ":"")).repeat(hC(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Bf={blockquote:BS,break:al,code:$S,definition:YS,emphasis:If,hardBreak:al,heading:GS,html:Nf,image:wf,imageReference:vf,inlineCode:Rf,link:Lf,linkReference:Df,list:iC,listItem:aC,paragraph:oC,root:lC,strong:Mf,text:fC,thematicBreak:pC};function mC(){return{enter:{table:gC,tableData:ol,tableHeader:ol,tableRow:EC},exit:{codeText:xC,table:bC,tableData:Ss,tableHeader:Ss,tableRow:Ss}}}function gC(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function bC(t){this.exit(t),this.data.inTable=void 0}function EC(t){this.enter({type:"tableRow",children:[]},t)}function Ss(t){this.exit(t)}function ol(t){this.enter({type:"tableCell",children:[]},t)}function xC(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,TC));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function TC(t,e){return e==="|"?e:t}function _C(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,i=e.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
122
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:a,tableCell:u,tableRow:o}};function a(p,g,E,T){return l(d(p,E,T),p.align)}function o(p,g,E,T){const x=c(p,E,T),_=l([x]);return _.slice(0,_.indexOf(`
|
|
123
|
+
`))}function u(p,g,E,T){const x=E.enter("tableCell"),_=E.enter("phrasing"),b=E.containerPhrasing(p,{...T,before:s,after:s});return _(),x(),b}function l(p,g){return PS(p,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function d(p,g,E){const T=p.children;let x=-1;const _=[],b=g.enter("table");for(;++x<T.length;)_[x]=c(T[x],g,E);return b(),_}function c(p,g,E){const T=p.children;let x=-1;const _=[],b=g.enter("tableRow");for(;++x<T.length;)_[x]=u(T[x],p,g,E);return b(),_}function h(p,g,E){let T=Bf.inlineCode(p,g,E);return E.stack.includes("tableCell")&&(T=T.replace(/\|/g,"\\$&")),T}}function yC(){return{exit:{taskListCheckValueChecked:ul,taskListCheckValueUnchecked:ul,paragraph:AC}}}function kC(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:SC}}}function ul(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function AC(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=e.children;let s=-1,a;for(;++s<i.length;){const o=i[s];if(o.type==="paragraph"){a=o;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function SC(t,e,n,r){const i=t.children[0],s=typeof t.checked=="boolean"&&i&&i.type==="paragraph",a="["+(t.checked?"x":" ")+"] ",o=n.createTracker(r);s&&o.move(a);let u=Bf.listItem(t,e,n,{...r,...o.current()});return s&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),u;function l(d){return d+a}}function CC(){return[iS(),SS(),wS(),mC(),yC()]}function IC(t){return{extensions:[sS(),CS(t),vS(),_C(t),kC()]}}const NC={tokenize:DC,partial:!0},Ff={tokenize:PC,partial:!0},zf={tokenize:MC,partial:!0},jf={tokenize:BC,partial:!0},wC={tokenize:FC,partial:!0},Uf={name:"wwwAutolink",tokenize:OC,previous:$f},Hf={name:"protocolAutolink",tokenize:LC,previous:Zf},zt={name:"emailAutolink",tokenize:RC,previous:Yf},Ot={};function vC(){return{text:Ot}}let rn=48;for(;rn<123;)Ot[rn]=zt,rn++,rn===58?rn=65:rn===91&&(rn=97);Ot[43]=zt;Ot[45]=zt;Ot[46]=zt;Ot[95]=zt;Ot[72]=[zt,Hf];Ot[104]=[zt,Hf];Ot[87]=[zt,Uf];Ot[119]=[zt,Uf];function RC(t,e,n){const r=this;let i,s;return a;function a(c){return!la(c)||!Yf.call(r,r.previous)||Xa(r.events)?n(c):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),o(c))}function o(c){return la(c)?(t.consume(c),o):c===64?(t.consume(c),u):n(c)}function u(c){return c===46?t.check(wC,d,l)(c):c===45||c===95||Ke(c)?(s=!0,t.consume(c),u):d(c)}function l(c){return t.consume(c),i=!0,u}function d(c){return s&&i&&tt(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(c)):n(c)}}function OC(t,e,n){const r=this;return i;function i(a){return a!==87&&a!==119||!$f.call(r,r.previous)||Xa(r.events)?n(a):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(NC,t.attempt(Ff,t.attempt(zf,s),n),n)(a))}function s(a){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(a)}}function LC(t,e,n){const r=this;let i="",s=!1;return a;function a(c){return(c===72||c===104)&&Zf.call(r,r.previous)&&!Xa(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),t.consume(c),o):n(c)}function o(c){if(tt(c)&&i.length<5)return i+=String.fromCodePoint(c),t.consume(c),o;if(c===58){const h=i.toLowerCase();if(h==="http"||h==="https")return t.consume(c),u}return n(c)}function u(c){return c===47?(t.consume(c),s?l:(s=!0,u)):n(c)}function l(c){return c===null||ki(c)||ve(c)||gn(c)||ji(c)?n(c):t.attempt(Ff,t.attempt(zf,d),n)(c)}function d(c){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(c)}}function DC(t,e,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,t.consume(a),i):a===46&&r===3?(t.consume(a),s):n(a)}function s(a){return a===null?n(a):e(a)}}function PC(t,e,n){let r,i,s;return a;function a(l){return l===46||l===95?t.check(jf,u,o)(l):l===null||ve(l)||gn(l)||l!==45&&ji(l)?u(l):(s=!0,t.consume(l),a)}function o(l){return l===95?r=!0:(i=r,r=void 0),t.consume(l),a}function u(l){return i||r||!s?n(l):e(l)}}function MC(t,e){let n=0,r=0;return i;function i(a){return a===40?(n++,t.consume(a),i):a===41&&r<n?s(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?t.check(jf,e,s)(a):a===null||ve(a)||gn(a)?e(a):(t.consume(a),i)}function s(a){return a===41&&r++,t.consume(a),i}}function BC(t,e,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(t.consume(o),r):o===38?(t.consume(o),s):o===93?(t.consume(o),i):o===60||o===null||ve(o)||gn(o)?e(o):n(o)}function i(o){return o===null||o===40||o===91||ve(o)||gn(o)?e(o):r(o)}function s(o){return tt(o)?a(o):n(o)}function a(o){return o===59?(t.consume(o),r):tt(o)?(t.consume(o),a):n(o)}}function FC(t,e,n){return r;function r(s){return t.consume(s),i}function i(s){return Ke(s)?n(s):e(s)}}function $f(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||ve(t)}function Zf(t){return!tt(t)}function Yf(t){return!(t===47||la(t))}function la(t){return t===43||t===45||t===46||t===95||Ke(t)}function Xa(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const zC={tokenize:VC,partial:!0};function jC(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:ZC,continuation:{tokenize:YC},exit:qC}},text:{91:{name:"gfmFootnoteCall",tokenize:$C},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:UC,resolveTo:HC}}}}function UC(t,e,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){a=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return o;function o(u){if(!a||!a._balanced)return n(u);const l=yt(r.sliceSerialize({start:a.end,end:r.now()}));return l.codePointAt(0)!==94||!s.includes(l.slice(1))?n(u):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(u),t.exit("gfmFootnoteCallLabelMarker"),e(u))}}function HC(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},t[t.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},o=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",i,e],["exit",i,e],["enter",s,e],["enter",a,e],["exit",a,e],["exit",s,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...o),t}function $C(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,a;return o;function o(c){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(c),t.exit("gfmFootnoteCallLabelMarker"),u}function u(c){return c!==94?n(c):(t.enter("gfmFootnoteCallMarker"),t.consume(c),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",l)}function l(c){if(s>999||c===93&&!a||c===null||c===91||ve(c))return n(c);if(c===93){t.exit("chunkString");const h=t.exit("gfmFootnoteCallString");return i.includes(yt(r.sliceSerialize(h)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(c),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(c)}return ve(c)||(a=!0),s++,t.consume(c),c===92?d:l}function d(c){return c===91||c===92||c===93?(t.consume(c),s++,l):l(c)}}function ZC(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,a=0,o;return u;function u(g){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(g){return g===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",d):n(g)}function d(g){if(a>999||g===93&&!o||g===null||g===91||ve(g))return n(g);if(g===93){t.exit("chunkString");const E=t.exit("gfmFootnoteDefinitionLabelString");return s=yt(r.sliceSerialize(E)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),h}return ve(g)||(o=!0),a++,t.consume(g),g===92?c:d}function c(g){return g===91||g===92||g===93?(t.consume(g),a++,d):d(g)}function h(g){return g===58?(t.enter("definitionMarker"),t.consume(g),t.exit("definitionMarker"),i.includes(s)||i.push(s),ye(t,p,"gfmFootnoteDefinitionWhitespace")):n(g)}function p(g){return e(g)}}function YC(t,e,n){return t.check(Zr,e,t.attempt(zC,e,n))}function qC(t){t.exit("gfmFootnoteDefinition")}function VC(t,e,n){const r=this;return ye(t,i,"gfmFootnoteDefinitionIndent",5);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?e(s):n(s)}}function WC(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,o){let u=-1;for(;++u<a.length;)if(a[u][0]==="enter"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._close){let l=u;for(;l--;)if(a[l][0]==="exit"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._open&&a[u][1].end.offset-a[u][1].start.offset===a[l][1].end.offset-a[l][1].start.offset){a[u][1].type="strikethroughSequence",a[l][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},a[l][1].start),end:Object.assign({},a[u][1].end)},c={type:"strikethroughText",start:Object.assign({},a[l][1].end),end:Object.assign({},a[u][1].start)},h=[["enter",d,o],["enter",a[l][1],o],["exit",a[l][1],o],["enter",c,o]],p=o.parser.constructs.insideSpan.null;p&&pt(h,h.length,0,Ui(p,a.slice(l+1,u),o)),pt(h,h.length,0,[["exit",c,o],["enter",a[u][1],o],["exit",a[u][1],o],["exit",d,o]]),pt(a,l-1,u-l+3,h),u=l+h.length-2;break}}for(u=-1;++u<a.length;)a[u][1].type==="strikethroughSequenceTemporary"&&(a[u][1].type="data");return a}function s(a,o,u){const l=this.previous,d=this.events;let c=0;return h;function h(g){return l===126&&d[d.length-1][1].type!=="characterEscape"?u(g):(a.enter("strikethroughSequenceTemporary"),p(g))}function p(g){const E=Mn(l);if(g===126)return c>1?u(g):(a.consume(g),c++,p);if(c<2&&!n)return u(g);const T=a.exit("strikethroughSequenceTemporary"),x=Mn(g);return T._open=!x||x===2&&!!E,T._close=!E||E===2&&!!x,o(g)}}}class GC{constructor(){this.map=[]}add(e,n,r){KC(this,e,n,r)}consume(e){if(this.map.sort(function(s,a){return s[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let i=r.pop();for(;i;){for(const s of i)e.push(s);i=r.pop()}this.map.length=0}}function KC(t,e,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<t.map.length;){if(t.map[i][0]===e){t.map[i][1]+=n,t.map[i][2].push(...r);return}i+=1}t.map.push([e,n,r])}}function QC(t,e){let n=!1;const r=[];for(;e<t.length;){const i=t[e];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function XC(){return{flow:{null:{name:"table",tokenize:JC,resolveAll:eI}}}}function JC(t,e,n){const r=this;let i=0,s=0,a;return o;function o(R){let B=r.events.length-1;for(;B>-1;){const Y=r.events[B][1].type;if(Y==="lineEnding"||Y==="linePrefix")B--;else break}const j=B>-1?r.events[B][1].type:null,J=j==="tableHead"||j==="tableRow"?k:u;return J===k&&r.parser.lazy[r.now().line]?n(R):J(R)}function u(R){return t.enter("tableHead"),t.enter("tableRow"),l(R)}function l(R){return R===124||(a=!0,s+=1),d(R)}function d(R){return R===null?n(R):ae(R)?s>1?(s=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(R),t.exit("lineEnding"),p):n(R):xe(R)?ye(t,d,"whitespace")(R):(s+=1,a&&(a=!1,i+=1),R===124?(t.enter("tableCellDivider"),t.consume(R),t.exit("tableCellDivider"),a=!0,d):(t.enter("data"),c(R)))}function c(R){return R===null||R===124||ve(R)?(t.exit("data"),d(R)):(t.consume(R),R===92?h:c)}function h(R){return R===92||R===124?(t.consume(R),c):c(R)}function p(R){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(R):(t.enter("tableDelimiterRow"),a=!1,xe(R)?ye(t,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):g(R))}function g(R){return R===45||R===58?T(R):R===124?(a=!0,t.enter("tableCellDivider"),t.consume(R),t.exit("tableCellDivider"),E):w(R)}function E(R){return xe(R)?ye(t,T,"whitespace")(R):T(R)}function T(R){return R===58?(s+=1,a=!0,t.enter("tableDelimiterMarker"),t.consume(R),t.exit("tableDelimiterMarker"),x):R===45?(s+=1,x(R)):R===null||ae(R)?C(R):w(R)}function x(R){return R===45?(t.enter("tableDelimiterFiller"),_(R)):w(R)}function _(R){return R===45?(t.consume(R),_):R===58?(a=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(R),t.exit("tableDelimiterMarker"),b):(t.exit("tableDelimiterFiller"),b(R))}function b(R){return xe(R)?ye(t,C,"whitespace")(R):C(R)}function C(R){return R===124?g(R):R===null||ae(R)?!a||i!==s?w(R):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(R)):w(R)}function w(R){return n(R)}function k(R){return t.enter("tableRow"),v(R)}function v(R){return R===124?(t.enter("tableCellDivider"),t.consume(R),t.exit("tableCellDivider"),v):R===null||ae(R)?(t.exit("tableRow"),e(R)):xe(R)?ye(t,v,"whitespace")(R):(t.enter("data"),O(R))}function O(R){return R===null||R===124||ve(R)?(t.exit("data"),v(R)):(t.consume(R),R===92?P:O)}function P(R){return R===92||R===124?(t.consume(R),O):O(R)}}function eI(t,e){let n=-1,r=!0,i=0,s=[0,0,0,0],a=[0,0,0,0],o=!1,u=0,l,d,c;const h=new GC;for(;++n<t.length;){const p=t[n],g=p[1];p[0]==="enter"?g.type==="tableHead"?(o=!1,u!==0&&(ll(h,e,u,l,d),d=void 0,u=0),l={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",l,e]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,c=void 0,s=[0,0,0,0],a=[0,n+1,0,0],o&&(o=!1,d={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",d,e]])),i=g.type==="tableDelimiterRow"?2:d?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(s[1]!==0&&(a[0]=a[1],c=ri(h,e,s,i,void 0,c),s=[0,0,0,0]),a[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(a[0]=a[1],c=ri(h,e,s,i,void 0,c)),s=a,a=[s[1],n,0,0])):g.type==="tableHead"?(o=!0,u=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(u=n,s[1]!==0?(a[0]=a[1],c=ri(h,e,s,i,n,c)):a[1]!==0&&(c=ri(h,e,a,i,n,c)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(a[3]=n)}for(u!==0&&ll(h,e,u,l,d),h.consume(e.events),n=-1;++n<e.events.length;){const p=e.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=QC(e.events,n))}return t}function ri(t,e,n,r,i,s){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(s.end=Object.assign({},Nn(e.events,n[0])),t.add(n[0],0,[["exit",s,e]]));const u=Nn(e.events,n[1]);if(s={type:a,start:Object.assign({},u),end:Object.assign({},u)},t.add(n[1],0,[["enter",s,e]]),n[2]!==0){const l=Nn(e.events,n[2]),d=Nn(e.events,n[3]),c={type:o,start:Object.assign({},l),end:Object.assign({},d)};if(t.add(n[2],0,[["enter",c,e]]),r!==2){const h=e.events[n[2]],p=e.events[n[3]];if(h[1].end=Object.assign({},p[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,E=n[3]-n[2]-1;t.add(g,E,[])}}t.add(n[3]+1,0,[["exit",c,e]])}return i!==void 0&&(s.end=Object.assign({},Nn(e.events,i)),t.add(i,0,[["exit",s,e]]),s=void 0),s}function ll(t,e,n,r,i){const s=[],a=Nn(e.events,n);i&&(i.end=Object.assign({},a),s.push(["exit",i,e])),r.end=Object.assign({},a),s.push(["exit",r,e]),t.add(n+1,0,s)}function Nn(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const tI={name:"tasklistCheck",tokenize:rI};function nI(){return{text:{91:tI}}}function rI(t,e,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),s)}function s(u){return ve(u)?(t.enter("taskListCheckValueUnchecked"),t.consume(u),t.exit("taskListCheckValueUnchecked"),a):u===88||u===120?(t.enter("taskListCheckValueChecked"),t.consume(u),t.exit("taskListCheckValueChecked"),a):n(u)}function a(u){return u===93?(t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),o):n(u)}function o(u){return ae(u)?e(u):xe(u)?t.check({tokenize:iI},e,n)(u):n(u)}}function iI(t,e,n){return ye(t,r,"whitespace");function r(i){return i===null?n(i):e(i)}}function sI(t){return xd([vC(),jC(),WC(t),XC(),nI()])}const aI={};function oI(t){const e=this,n=t||aI,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(sI(n)),s.push(CC()),a.push(IC(n))}const uI=D.lazy(()=>Jh(()=>import("./lazy-highlighter-BZ3JTPPT.js"),__vite__mapDeps([0,1,2,3,4])));function qf(){const t=F.c(3),[e,n]=D.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=async a=>{await navigator.clipboard.writeText(a),n(!0),setTimeout(()=>n(!1),2e3)},t[0]=r):r=t[0];const i=r;let s;return t[1]!==e?(s={handleCopy:i,copied:e},t[1]=e,t[2]=s):s=t[2],s}function lI(){const t=F.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[85,70],t[0]=e):e=t[0];const n=e;let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx("div",{className:"p-4 font-mono text-sm",style:{background:"#2d2d2d",borderRadius:"0 0 0.5rem 0.5rem",overflow:"auto",minHeight:"4rem"},children:n.map(cI)}),t[1]=r):r=t[1],r}function cI(t,e){return m.jsxs("div",{className:"flex gap-2 items-center my-1",children:[e>2&&e<7&&m.jsx("div",{className:"w-4 h-4 rounded-sm opacity-40 animate-pulse",style:{background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.1}s`}}),e%4===0&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"3rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.12}s`}}),e%3===1&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"2.5rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.14}s`}}),m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:`${t}%`,background:"rgba(255, 255, 255, 0.1)",animationDelay:`${e*.1}s`}}),e%5===2&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"4rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.16}s`}})]},e)}function dI(t){const e=F.c(12),n=D.useRef(null),{handleCopy:r,copied:i}=qf(),s=fI;let a;e[0]!==r?(a=async()=>{const p=s(n.current);await r(p)},e[0]=r,e[1]=a):a=e[1];const o=a,u=i?"check":"content_copy";let l;e[2]!==u?(l=m.jsx(ge,{name:u,size:12}),e[2]=u,e[3]=l):l=e[3];let d;e[4]!==o||e[5]!==l?(d=m.jsx("div",{className:"flex justify-end items-center",children:m.jsxs(ut,{variant:"ghost",onClick:o,"aria-label":"Copy as CSV",className:"text-muted-foreground hover:text-foreground h-6 text-[10px]",type:"button",children:["Copy as CSV",l]})}),e[4]=o,e[5]=l,e[6]=d):d=e[6];let c;e[7]!==t?(c=m.jsx("div",{className:"overflow-x-auto mb-4 rounded-lg border border-border",children:m.jsx("table",{ref:n,...t,className:"min-w-full border-collapse text-sm",children:t.children})}),e[7]=t,e[8]=c):c=e[8];let h;return e[9]!==d||e[10]!==c?(h=m.jsxs(m.Fragment,{children:[d,c]}),e[9]=d,e[10]=c,e[11]=h):h=e[11],h}function fI(t){return t?Array.from(t.querySelectorAll("tr")).map(hI).join(`
|
|
124
|
+
`):""}function hI(t){return Array.from(t.querySelectorAll("th,td")).map(pI).join(",")}function pI(t){let e=t.textContent||"";return e=e.replace(/"/g,'""'),e.search(/([",\n])/g)>=0&&(e=`"${e}"`),e}const mI=[oI],gI=[XA],bI={p:t=>m.jsx("p",{...t,className:"leading-relaxed text-[0.9375rem]"}),strong:t=>m.jsx("strong",{...t,className:"font-bold"}),em:t=>m.jsx("em",{...t,className:"italic"}),a:t=>m.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer",className:"text-primary-dark hover:underline break-all font-medium"}),ul:t=>m.jsx("ul",{...t,className:"list-disc ml-6 my-4 space-y-2"}),ol:t=>m.jsx("ol",{...t,className:"list-decimal ml-6 my-4 space-y-2"}),li:t=>m.jsx("li",{...t,className:"leading-relaxed text-[0.9375rem]"}),code:t=>m.jsx("code",{...t,className:"px-1 py-0.5 bg-muted rounded text-sm font-mono break-all"}),pre:t=>m.jsx("pre",{...t,className:"flex w-full min-w-0 my-4 bg-muted rounded overflow-hidden",children:m.jsx("code",{className:"flex-1 min-w-0 p-4 text-sm font-mono whitespace-pre overflow-x-auto",children:t.children})}),table:t=>m.jsx(dI,{...t}),thead:t=>m.jsx("thead",{...t,className:"bg-muted",children:t.children}),tr:t=>m.jsx("tr",{...t,className:"even:bg-muted/50 border-b border-border last:border-0"}),th:t=>m.jsx("th",{...t,className:"px-4 py-2 text-left font-semibold text-muted-foreground border-b border-border"}),td:t=>m.jsx("td",{...t,className:"px-4 py-2 border-b border-border"})},Vf=D.memo(t=>{const e=F.c(2),{content:n}=t;let r;return e[0]!==n?(r=m.jsx(My,{remarkPlugins:mI,rehypePlugins:gI,components:bI,children:n}),e[0]=n,e[1]=r):r=e[1],r},(t,e)=>t.content===e.content);function EI(t){const e=F.c(20),{language:n,content:r}=t,{handleCopy:i,copied:s}=qf(),a=n||"text";let o;e[0]!==a?(o=m.jsx("span",{className:"text-xs font-mono uppercase text-muted-foreground tracking-widest select-none",children:a}),e[0]=a,e[1]=o):o=e[1];let u;e[2]!==r||e[3]!==i?(u=()=>i(r),e[2]=r,e[3]=i,e[4]=u):u=e[4];const l=s?"check":"content_copy";let d;e[5]!==l?(d=m.jsx(ge,{name:l,size:14}),e[5]=l,e[6]=d):d=e[6];let c;e[7]!==u||e[8]!==d?(c=m.jsx(ut,{size:"icon",variant:"ghost",onClick:u,"aria-label":"Copy code",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:d}),e[7]=u,e[8]=d,e[9]=c):c=e[9];let h;e[10]!==o||e[11]!==c?(h=m.jsxs("div",{className:"flex items-center justify-between p-1 pl-4 bg-muted border-b border-border",children:[o,c]}),e[10]=o,e[11]=c,e[12]=h):h=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=m.jsx(lI,{}),e[13]=p):p=e[13];let g;e[14]!==r||e[15]!==n?(g=m.jsx(D.Suspense,{fallback:p,children:m.jsx(uI,{language:n,content:r})}),e[14]=r,e[15]=n,e[16]=g):g=e[16];let E;return e[17]!==h||e[18]!==g?(E=m.jsxs("div",{className:"my-4 rounded-lg bg-muted overflow-hidden border border-border grid min-w-0",children:[h,g]}),e[17]=h,e[18]=g,e[19]=E):E=e[19],E}Vf.displayName="MemoizedMarkdownBlock";const Ja=t=>{const e=F.c(7),{id:n,text:r}=t;let i;e[0]!==r?(i=Ce.lexer(r),e[0]=r,e[1]=i):i=e[1];const s=i;let a;if(e[2]!==s||e[3]!==n){let o;e[5]!==n?(o=(u,l)=>u.type==="code"?m.jsx(EI,{language:u.lang,content:u.text},`${n}-block_${l}`):m.jsx(Vf,{content:u.raw},`${n}-block_${l}`),e[5]=n,e[6]=o):o=e[6],a=s.map(o),e[2]=s,e[3]=n,e[4]=a}else a=e[4];return a};Ja.displayName="MemoizedMarkdown";function xI(t,e){switch(e.type){case"TOGGLE":return{isExpanded:!t.isExpanded,wasManuallyToggled:!0};case"SET_EXPANDED":return t.wasManuallyToggled?t:{...t,isExpanded:e.payload};default:return t}}function TI(t){const e=F.c(38),{part:n,id:r}=t,{state:i}=n,s=i==="streaming";let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={isExpanded:!1,wasManuallyToggled:!1},e[0]=a):a=e[0];const[o,u]=D.useReducer(xI,a),{isExpanded:l}=o;let d,c;e[1]!==s?(d=()=>{u({type:"SET_EXPANDED",payload:s})},c=[s],e[1]=s,e[2]=d,e[3]=c):(d=e[2],c=e[3]),D.useEffect(d,c);let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{u({type:"TOGGLE"})},e[4]=h):h=e[4];const p=h,g=s&&"animate-pulse";let E;e[5]!==g?(E=X("text-muted-foreground transition-opacity",g),e[5]=g,e[6]=E):E=e[6];let T;e[7]!==E?(T=m.jsx(ge,{name:"psychology",className:E}),e[7]=E,e[8]=T):T=e[8];const x=s&&"text-shimmer";let _;e[9]!==x?(_=X("text-sm font-medium text-muted-foreground",x),e[9]=x,e[10]=_):_=e[10];let b;e[11]!==_?(b=m.jsx("span",{className:_,children:"Agent thinking"}),e[11]=_,e[12]=b):b=e[12];const C=l?"rotate-180":"";let w;e[13]!==C?(w=X("text-muted-foreground transition-transform duration-200",C),e[13]=C,e[14]=w):w=e[14];let k;e[15]!==w?(k=m.jsx(ge,{name:"expand_more",className:w}),e[15]=w,e[16]=k):k=e[16];let v;e[17]!==b||e[18]!==k||e[19]!==T?(v=m.jsxs("button",{type:"button",onClick:p,className:"flex items-center gap-2 py-2 transition-colors cursor-pointer",children:[T,b,k]}),e[17]=b,e[18]=k,e[19]=T,e[20]=v):v=e[20];const O=l?s?"max-h-[400px] opacity-100":"max-h-[200px] opacity-80":"max-h-0 opacity-0 overflow-hidden";let P;e[21]!==O?(P=X("transition-all duration-200 ease-in-out",O),e[21]=O,e[22]=P):P=e[22];const R=s?"max-h-[400px]":"max-h-[200px]";let B;e[23]!==R?(B=X("border-l-2 pl-4 overflow-y-auto",R),e[23]=R,e[24]=B):B=e[24];let j;e[25]===Symbol.for("react.memo_cache_sentinel")?(j=X("text-muted-foreground markdown-sm pb-2"),e[25]=j):j=e[25];let J;e[26]!==r||e[27]!==n.text?(J=m.jsx("div",{className:j,children:m.jsx(Ja,{id:r,text:n.text})}),e[26]=r,e[27]=n.text,e[28]=J):J=e[28];let Y;e[29]!==B||e[30]!==J?(Y=m.jsx("div",{className:B,children:J}),e[29]=B,e[30]=J,e[31]=Y):Y=e[31];let H;e[32]!==P||e[33]!==Y?(H=m.jsx("div",{className:P,children:Y}),e[32]=P,e[33]=Y,e[34]=H):H=e[34];let Q;return e[35]!==v||e[36]!==H?(Q=m.jsxs("div",{className:"flex flex-col",children:[v,H]}),e[35]=v,e[36]=H,e[37]=Q):Q=e[37],Q}function _I(){const t=F.c(3),[e,n]=D.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=async a=>{await navigator.clipboard.writeText(a),n(!0),setTimeout(()=>n(!1),2e3)},t[0]=r):r=t[0];const i=r;let s;return t[1]!==e?(s={handleCopy:i,copied:e},t[1]=e,t[2]=s):s=t[2],s}function Wf(t){const e=F.c(13),{id:n,text:r,copyable:i}=t,s=i===void 0?!1:i,{handleCopy:a}=_I(),[o,u]=D.useState(!1);let l;e[0]!==a||e[1]!==r?(l=async()=>{await a(r),u(!0),setTimeout(()=>u(!1),2e3)},e[0]=a,e[1]=r,e[2]=l):l=e[2];const d=l;let c;e[3]!==n||e[4]!==r?(c=m.jsx(Ja,{id:n,text:r}),e[3]=n,e[4]=r,e[5]=c):c=e[5];let h;e[6]!==s||e[7]!==d||e[8]!==o?(h=s&&m.jsx("div",{className:"flex w-full items-center justify-end gap-2 text-xs text-muted-foreground opacity-0 pointer-events-none transition-all duration-200 group-hover/part:opacity-100 group-hover/part:pointer-events-auto",children:m.jsx("div",{className:"flex gap-1",children:m.jsx(ut,{onClick:d,variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground px-2 py-1 h-auto whitespace-nowrap",children:o?m.jsx(m.Fragment,{children:m.jsx(ge,{name:"check",className:"mr-1 text-sm"})}):m.jsx(m.Fragment,{children:m.jsx(ge,{name:"content_copy",className:"mr-1 text-sm"})})})})}),e[6]=s,e[7]=d,e[8]=o,e[9]=h):h=e[9];let p;return e[10]!==c||e[11]!==h?(p=m.jsxs("div",{className:"group/part relative",children:[c,h]}),e[10]=c,e[11]=h,e[12]=p):p=e[12],p}function yI(t){const e=F.c(30),{toolName:n,input:r,output:i,isError:s}=t;if(n==="READ_MCP_TOOLS"){const u=r?.id;if(u){let l;return e[0]!==u?(l=m.jsx(cl,{connectionId:u}),e[0]=u,e[1]=l):l=e[1],l}}if(n==="CALL_MCP_TOOL"){const u=r?.connectionId;let l;e[2]!==u?(l=u&&m.jsx(cl,{connectionId:u,compact:!0}),e[2]=u,e[3]=l):l=e[3];let d;e[4]!==i?(d=JSON.stringify(i,null,2),e[4]=i,e[5]=d):d=e[5];let c;e[6]!==d?(c=m.jsx("div",{className:"absolute top-1 right-1 z-10",children:m.jsx(kI,{text:d})}),e[6]=d,e[7]=c):c=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=m.jsx("div",{className:"font-semibold text-muted-foreground mb-0.5 text-[10px] uppercase tracking-wider",children:"Input"}),e[8]=h):h=e[8];let p;e[9]!==r?(p=JSON.stringify(r,null,2),e[9]=r,e[10]=p):p=e[10];let g;e[11]!==p?(g=m.jsx("pre",{className:"whitespace-pre-wrap break-all text-muted-foreground mb-2",children:p}),e[11]=p,e[12]=g):g=e[12];let E;e[13]===Symbol.for("react.memo_cache_sentinel")?(E=m.jsx("div",{className:"font-semibold text-muted-foreground mb-0.5 text-[10px] uppercase tracking-wider",children:"Output"}),e[13]=E):E=e[13];const T=`whitespace-pre-wrap break-all ${s?"text-destructive":"text-foreground"}`;let x;e[14]!==i?(x=JSON.stringify(i,null,2),e[14]=i,e[15]=x):x=e[15];let _;e[16]!==T||e[17]!==x?(_=m.jsx("pre",{className:T,children:x}),e[16]=T,e[17]=x,e[18]=_):_=e[18];let b;e[19]!==_||e[20]!==c||e[21]!==g?(b=m.jsxs("div",{className:"relative bg-muted rounded-md p-2 text-xs font-mono overflow-auto max-h-[200px]",children:[c,h,g,E,_]}),e[19]=_,e[20]=c,e[21]=g,e[22]=b):b=e[22];let C;return e[23]!==l||e[24]!==b?(C=m.jsxs("div",{className:"flex flex-col gap-2",children:[l,b]}),e[23]=l,e[24]=b,e[25]=C):C=e[25],C}let a;e[26]!==i?(a=JSON.stringify(i,null,2),e[26]=i,e[27]=a):a=e[27];let o;return e[28]!==a?(o=m.jsx("div",{className:"bg-muted rounded-md p-2 text-xs font-mono overflow-auto max-h-[200px]",children:m.jsx("pre",{className:"whitespace-pre-wrap break-all",children:a})}),e[28]=a,e[29]=o):o=e[29],o}function cl(t){const e=F.c(15),{connectionId:n,compact:r}=t,i=yp(n),{org:s}=vt(),{slug:a}=s,o=Pr();if(!i)return null;let u;e[0]!==i.id||e[1]!==o||e[2]!==a?(u=()=>{o({to:"/$org/mcps/$connectionId",params:{org:a,connectionId:i.id}})},e[0]=i.id,e[1]=o,e[2]=a,e[3]=u):u=e[3];const l=u;if(r){let c;e[4]!==i.title?(c=m.jsx("span",{className:"font-medium text-foreground",children:i.title}),e[4]=i.title,e[5]=c):c=e[5];let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=m.jsx(ge,{name:"open_in_new",size:12}),e[6]=h):h=e[6];let p;e[7]!==l?(p=m.jsx("button",{type:"button",onClick:l,className:"hover:text-foreground transition-colors",title:"Open connection",children:h}),e[7]=l,e[8]=p):p=e[8];let g;return e[9]!==c||e[10]!==p?(g=m.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-muted/50 px-2 py-1 rounded-md w-fit",children:[c,p]}),e[9]=c,e[10]=p,e[11]=g):g=e[11],g}let d;return e[12]!==i||e[13]!==l?(d=m.jsx(Mp,{connection:i,onClick:l}),e[12]=i,e[13]=l,e[14]=d):d=e[14],d}function kI({text:t}){const e=async()=>{try{if(navigator.clipboard)await navigator.clipboard.writeText(t),ai.success("Copied to clipboard");else throw new Error("Clipboard API unavailable")}catch(n){try{const r=document.createElement("textarea");r.value=t,r.style.position="fixed",r.style.left="-9999px",r.style.top="0",document.body.appendChild(r),r.focus(),r.select();const i=document.execCommand("copy");if(document.body.removeChild(r),i)ai.success("Copied to clipboard");else throw new Error("Fallback copy failed")}catch(r){console.error("Copy failed",n,r),ai.error("Failed to copy to clipboard")}}};return m.jsx(ut,{size:"icon",variant:"ghost",className:"h-5 w-5 hover:bg-background/50",onClick:e,children:m.jsx(ge,{name:"content_copy",size:12})})}function AI(t){const e=F.c(42),{part:n}=t,{state:r}=n;let i;e[0]!==n?(i="toolName"in n?n.toolName:n.type.replace("tool-",""),e[0]=n,e[1]=i):i=e[1];const s=i,a=r==="output-error"?"error":"terminal",o=r==="output-error"&&"text-destructive";let u;e[2]!==o?(u=X("h-3.5 w-3.5",o),e[2]=o,e[3]=u):u=e[3];let l;e[4]!==a||e[5]!==u?(l=m.jsx(ge,{name:a,className:u}),e[4]=a,e[5]=u,e[6]=l):l=e[6];const d=r==="output-error"&&"text-destructive/90";let c;e[7]!==d?(c=X(d),e[7]=d,e[8]=c):c=e[8];const h=r==="input-streaming"&&`Streaming ${s} arguments...`,p=r==="input-available"&&`Calling ${s}...`,g=r==="output-available"&&`Called ${s}`,E=r==="output-error"&&`Error calling ${s}`;let T;e[9]!==g||e[10]!==E||e[11]!==c||e[12]!==h||e[13]!==p?(T=m.jsxs("span",{className:c,children:[h,p,g,E]}),e[9]=g,e[10]=E,e[11]=c,e[12]=h,e[13]=p,e[14]=T):T=e[14];let x;e[15]!==r?(x=(r==="input-streaming"||r==="input-available")&&m.jsx("span",{className:"animate-pulse",children:"..."}),e[15]=r,e[16]=x):x=e[16];let _;e[17]!==T||e[18]!==x||e[19]!==l?(_=m.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground",children:[l,T,x]}),e[17]=T,e[18]=x,e[19]=l,e[20]=_):_=e[20];const b=r==="output-error"?"border-destructive/50":"border-border";let C;e[21]!==b?(C=X("transition-all duration-200 ease-in-out","border-l-2 pl-3",b),e[21]=b,e[22]=C):C=e[22];let w;e[23]!==n.input||e[24]!==r?(w=(r==="input-streaming"||r==="input-available")&&!!n.input&&m.jsx("div",{className:"text-xs font-mono text-muted-foreground bg-muted/30 p-2 rounded",children:JSON.stringify(n.input,null,2)}),e[23]=n.input,e[24]=r,e[25]=w):w=e[25];let k;e[26]!==n.input||e[27]!==n.output||e[28]!==r||e[29]!==s?(k=r==="output-available"&&m.jsx(yI,{toolName:s,input:n.input,output:n.output}),e[26]=n.input,e[27]=n.output,e[28]=r,e[29]=s,e[30]=k):k=e[30];let v;e[31]!==n||e[32]!==r?(v=r==="output-error"&&m.jsx("div",{className:"text-xs font-mono bg-destructive/10 text-destructive p-2 rounded border border-destructive/20",children:"errorText"in n&&typeof n.errorText=="string"?n.errorText:"An unknown error occurred"}),e[31]=n,e[32]=r,e[33]=v):v=e[33];let O;e[34]!==C||e[35]!==w||e[36]!==k||e[37]!==v?(O=m.jsxs("div",{className:C,children:[w,k,v]}),e[34]=C,e[35]=w,e[36]=k,e[37]=v,e[38]=O):O=e[38];let P;return e[39]!==_||e[40]!==O?(P=m.jsxs("div",{className:"flex flex-col gap-1.5 py-1",children:[_,O]}),e[39]=_,e[40]=O,e[41]=P):P=e[41],P}const SI={planning:{icon:"track_changes",label:"Planning next moves"},thinking:{icon:"psychology",label:"Thinking"}},CI=1200;function II(){const t=F.c(9),[e,n]=D.useState("planning");let r,i;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const l=setTimeout(()=>{n("thinking")},CI);return()=>{clearTimeout(l)}},i=[],t[0]=r,t[1]=i):(r=t[0],i=t[1]),D.useEffect(r,i);const s=SI[e];let a;t[2]!==s.icon?(a=m.jsx(ge,{name:s.icon,className:"text-muted-foreground animate-pulse",size:20}),t[2]=s.icon,t[3]=a):a=t[3];let o;t[4]!==s.label?(o=m.jsxs("span",{className:"text-sm font-medium text-muted-foreground text-shimmer",children:[s.label,"..."]}),t[4]=s.label,t[5]=o):o=t[5];let u;return t[6]!==a||t[7]!==o?(u=m.jsxs("div",{className:"flex items-center gap-2 py-2",children:[a,o]}),t[6]=a,t[7]=o,t[8]=u):u=t[8],u}function NI(t){const e=F.c(5),{duration:n}=t,r=n/1e3;let i;e[0]!==r?(i=r.toFixed(1),e[0]=r,e[1]=i):i=e[1];const s=i;let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx(ge,{name:"lightbulb",className:"text-muted-foreground",size:16}),e[2]=a):a=e[2];let o;return e[3]!==s?(o=m.jsxs("div",{className:"flex items-center gap-2 py-2 opacity-60",children:[a,m.jsxs("span",{className:"text-xs text-muted-foreground",children:["Thought · ",s,"s"]})]}),e[3]=s,e[4]=o):o=e[4],o}function wI(t){const e=F.c(24),{message:n,status:r,className:i}=t,{id:s,parts:a}=n,l=r==="streaming"||r==="submitted",d=D.useRef(null);let c;e[0]!==s?(c=()=>{const O=localStorage.getItem(`msg-duration-${s}`);return O?Number(O):null},e[0]=s,e[1]=c):c=e[1];const[h,p]=D.useState(c);let g,E;e[2]!==l?(g=()=>{l&&d.current===null&&(d.current=Date.now())},E=[l],e[2]=l,e[3]=g,e[4]=E):(g=e[3],E=e[4]),D.useEffect(g,E);let T,x;e[5]!==h||e[6]!==s||e[7]!==a.length?(T=()=>{if(a.length>0&&h===null&&d.current!==null){const O=Date.now()-d.current;p(O),localStorage.setItem(`msg-duration-${s}`,O.toString())}},x=[a.length,h,s],e[5]=h,e[6]=s,e[7]=a.length,e[8]=T,e[9]=x):(T=e[8],x=e[9]),D.useEffect(T,x);const _=a.length>0,b=_&&!l&&h!==null;let C;e[10]!==i?(C=X("w-full min-w-0 group relative flex items-start gap-4 px-8 z-20 text-foreground flex-row",i),e[10]=i,e[11]=C):C=e[11];let w;e[12]!==h||e[13]!==_||e[14]!==s||e[15]!==l||e[16]!==a||e[17]!==b?(w=_?m.jsxs(m.Fragment,{children:[b&&m.jsx(NI,{duration:h}),a.map((O,P)=>{if(O.type==="text")return m.jsx(Wf,{id:s,text:O.text,copyable:!0},`${s}-${P}`);if(O.type==="reasoning")return m.jsx(TI,{part:O,id:s},`${s}-${P}`);if(O.type.startsWith("tool-")||O.type==="dynamic-tool")return m.jsx(AI,{part:O,id:s},`${s}-${P}`);if(O.type==="step-start"||O.type==="file"||O.type==="source-url"||O.type==="source-document")return console.warn("Skipping part type",O),null;throw new Error(`Unknown part type: ${JSON.stringify(O)}`)})]}):l?m.jsx(II,{}):null,e[12]=h,e[13]=_,e[14]=s,e[15]=l,e[16]=a,e[17]=b,e[18]=w):w=e[18];let k;e[19]!==w?(k=m.jsx("div",{className:"flex flex-col gap-2 min-w-0 w-full items-start",children:m.jsx("div",{className:"w-full min-w-0 not-only:rounded-2xl text-[0.9375rem] wrap-break-word overflow-wrap-anywhere bg-transparent",children:w})}),e[19]=w,e[20]=k):k=e[20];let v;return e[21]!==C||e[22]!==k?(v=m.jsx("div",{className:C,children:k}),e[21]=C,e[22]=k,e[23]=v):v=e[23],v}const Gf=D.createContext(null);function Kf(t){const e=F.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx(m.Fragment,{children:n}),e[0]=n,e[1]=r):r=e[1],r}function vI(t){const e=[];for(let n=0;n<t.length;n++){const r=t[n];if(!D.isValidElement(r))continue;if(r.props?.message?.role==="assistant"){const s=t[n-1],a=D.isValidElement(s)&&s.props?.message?.role,o=s&&D.isValidElement(s)&&a==="user"?s:null;e.push({user:o,assistant:r})}}return e}function RI(t){const e=F.c(27),{children:n,className:r,minHeightOffset:i}=t,s=D.useRef(null);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=[],e[0]=a):a=e[0];const o=D.useRef(a);let u,l,d,c,h,p,g;if(e[1]!==n||e[2]!==r||e[3]!==i){const _=D.Children.toArray(n),b=_[_.length-1];l=b&&D.isValidElement(b)&&b.type===Kf?b:null;const C=l?_.slice(0,-1):_,w=vI(C);let k;e[11]===Symbol.for("react.memo_cache_sentinel")?(k=O=>{const P=o.current[O];if(P&&s.current){const R=s.current.offsetTop,B=P.offsetTop;s.current.scrollTo({top:B-R,behavior:"smooth"})}},e[11]=k):k=e[11];const v=k;u=Gf.Provider,e[12]===Symbol.for("react.memo_cache_sentinel")?(g={scrollToPair:v},e[12]=g):g=e[12],h=s,e[13]!==r?(p=X("w-full min-w-0 max-w-full overflow-y-auto h-full overflow-x-hidden",r),e[13]=r,e[14]=p):p=e[14],d="flex flex-col min-w-0 max-w-2xl mx-auto w-full",c=w.map((O,P)=>{const R=P===w.length-1;return m.jsxs("div",{ref:B=>{o.current[P]=B},className:"flex flex-col gap-2 py-2",style:R&&i?{minHeight:`calc(100vh - ${i}px)`}:void 0,children:[m.jsx("div",{className:"sticky top-0 z-50 bg-background w-full h-2"}),m.jsx("div",{className:"sticky top-2 z-50",children:O.user&&D.isValidElement(O.user)?D.cloneElement(O.user,{pairIndex:P}):O.user}),O.assistant]},P)}),e[1]=n,e[2]=r,e[3]=i,e[4]=u,e[5]=l,e[6]=d,e[7]=c,e[8]=h,e[9]=p,e[10]=g}else u=e[4],l=e[5],d=e[6],c=e[7],h=e[8],p=e[9],g=e[10];let E;e[15]!==l||e[16]!==d||e[17]!==c?(E=m.jsxs("div",{className:d,children:[c,l]}),e[15]=l,e[16]=d,e[17]=c,e[18]=E):E=e[18];let T;e[19]!==h||e[20]!==p||e[21]!==E?(T=m.jsx("div",{ref:h,className:p,children:E}),e[19]=h,e[20]=p,e[21]=E,e[22]=T):T=e[22];let x;return e[23]!==u||e[24]!==g||e[25]!==T?(x=m.jsx(u,{value:g,children:T}),e[23]=u,e[24]=g,e[25]=T,e[26]=x):x=e[26],x}function OI(t){const e=F.c(29),{message:n,className:r,pairIndex:i}=t,{id:s,parts:a}=n,o=D.useRef(null),u=D.useContext(Gf),[l,d]=D.useState(!1);if(!a||a.length===0)return null;const h=a.reduce(LI,0)>60;let p;e[0]!==u||e[1]!==i?(p=()=>{i!==void 0&&u?.scrollToPair(i)},e[0]=u,e[1]=i,e[2]=p):p=e[2];const g=p;let E;e[3]!==r?(E=X("message-block w-full min-w-0 group relative flex items-start gap-4 px-4 text-foreground flex-row-reverse",r),e[3]=r,e[4]=E):E=e[4];const T=h&&!l&&"overflow-hidden relative max-h-[60px]";let x;e[5]!==T?(x=X(T),e[5]=T,e[6]=x):x=e[6];let _;if(e[7]!==s||e[8]!==a){let O;e[10]!==s?(O=(P,R)=>P.type==="text"?m.jsx(Wf,{id:s,text:P.text},`${s}-${R}`):null,e[10]=s,e[11]=O):O=e[11],_=a.map(O),e[7]=s,e[8]=a,e[9]=_}else _=e[9];let b;e[12]!==l||e[13]!==h?(b=h&&!l&&m.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-12 bg-gradient-to-t from-muted to-transparent pointer-events-none"}),e[12]=l,e[13]=h,e[14]=b):b=e[14];let C;e[15]!==x||e[16]!==_||e[17]!==b?(C=m.jsxs("div",{className:x,children:[_,b]}),e[15]=x,e[16]=_,e[17]=b,e[18]=C):C=e[18];let w;e[19]!==l||e[20]!==h?(w=h&&m.jsx("div",{className:"flex justify-center",children:m.jsx(ut,{onClick:O=>{O.stopPropagation(),d(!l)},variant:"ghost",size:"xs",className:"text-xs w-full text-muted-foreground hover:text-foreground",children:m.jsx(ge,{name:l?"expand_less":"expand_more",className:"text-sm"})})}),e[19]=l,e[20]=h,e[21]=w):w=e[21];let k;e[22]!==g||e[23]!==C||e[24]!==w?(k=m.jsxs("div",{onClick:g,className:"w-full border min-w-0 shadow-[0_3px_6px_-1px_rgba(0,0,0,0.1)] rounded-lg text-[0.9375rem] break-words overflow-wrap-anywhere bg-muted px-4 py-2 cursor-pointer transition-colors",children:[C,w]}),e[22]=g,e[23]=C,e[24]=w,e[25]=k):k=e[25];let v;return e[26]!==E||e[27]!==k?(v=m.jsxs("div",{ref:o,className:E,children:[" ",k]}),e[26]=E,e[27]=k,e[28]=v):v=e[28],v}function LI(t,e){return e.type==="text"?t+e.text.length:t}const DI="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png",PI=t=>new wc({api:`/api/${t}/models/stream`,credentials:"include",prepareSendMessagesRequest:({messages:e,requestMetadata:n})=>({body:{messages:e,stream:!0,...n}})});function MI(t){const e=F.c(12),{onSubmit:n,onStop:r,disabled:i,isStreaming:s,placeholder:a,leftActions:o}=t,[u,l]=D.useState("");let d;e[0]!==u||e[1]!==s||e[2]!==n?(d=async p=>{if(p?.preventDefault(),!u?.trim()||s)return;const g=u.trim();try{await n(g),l("")}catch(E){const T=E;console.error("Failed to send message:",T);const x=T instanceof Error?T.message:"Failed to send message";ai.error(x)}},e[0]=u,e[1]=s,e[2]=n,e[3]=d):d=e[3];const c=d;let h;return e[4]!==i||e[5]!==c||e[6]!==u||e[7]!==s||e[8]!==o||e[9]!==r||e[10]!==a?(h=m.jsx(RE,{value:u,onChange:l,onSubmit:c,onStop:r,disabled:i,isStreaming:s,placeholder:a,leftActions:o}),e[4]=i,e[5]=c,e[6]=u,e[7]=s,e[8]=o,e[9]=r,e[10]=a,e[11]=h):h=e[11],h}function BI(){const{data:t}=Mr.useSession(),e=t?.user,{org:n,locator:r}=vt(),[,i]=Oi(),s=Pr(),{createThread:a,activeThreadId:o}=ya(),u=D.useRef(null),l=Zc(),d=YE(),c=ZE(o),[h,p]=Dn(Br.chatSelectedModel(r),V=>V??null),[g,E]=Dn(`${r}:selected-gateway`,()=>null),T=PI(n.slug),b=bE({id:o,messages:c,transport:T,onFinish:async V=>{const{finishReason:se,messages:A,isAbort:te,isDisconnect:ie,isError:K}=V;if(se!=="stop"||te||ie||K)return;const ee=A.slice(-2).filter(Boolean);if(ee.length===2){d.insertMany.mutate(ee);const re=ee.find(be=>be.parts?.find(Pe=>Pe.type==="text"))?.parts?.find(be=>be.type==="text")?.text.slice(0,100)||"",le=await UE(r,o);le?l.update.mutate({id:o,updates:{title:le.title||re,updated_at:new Date().toISOString()}}):a({id:o,title:re})}},onError:V=>{console.error("[deco-chat] Chat error:",V)}}),{status:C}=b,w=kp(),[k]=Cp({connections:w,binding:"LLMS"}),v=k1(k?.id),O=Ap(),P=!v||!k?[]:v.map(V=>({...V,name:V.title,contextWindow:V.limits?.contextWindow,outputLimit:V.limits?.maxOutputTokens,inputCost:V.costs?.input,outputCost:V.costs?.output,provider:V.provider,connectionId:k.id,connectionName:k.title})).sort((V,se)=>V.name.localeCompare(se.name));D.useEffect(()=>{if(P.length>0&&!h){const V=P[0];V&&p({id:V.id,connectionId:V.connectionId})}},[v,k,h,p]),D.useEffect(()=>{if(O.length>0&&!g){const V=O[0];V&&E({gatewayId:V.id})}},[O,g,E]);const R=P.find(V=>V.id===h?.id&&V.connectionId===h?.connectionId),B=O.find(V=>V.id===g?.gatewayId),j=b.messages.length===0,J=D.useRef(b.messages.length),Y=D.useRef(0);b.messages.length>J.current&&Y.current!==b.messages.length&&queueMicrotask(()=>{u.current&&(u.current.scrollIntoView({behavior:"smooth",block:"start"}),Y.current=b.messages.length)}),J.current=b.messages.length;const H=O.map(V=>({id:V.id,title:V.title,icon:V.icon,description:V.description,fallbackIcon:"network_node"})),Q=async V=>{if(!V?.trim()||C==="submitted"||C==="streaming")return;if(!R){console.error("No model configured");return}const se={created_at:new Date().toISOString(),thread_id:o,model:R,gateway:B?{id:B.id}:void 0,user:{avatar:e?.image??void 0,name:e?.name??"you"}};await b.sendMessage({id:crypto.randomUUID(),role:"user",parts:[{type:"text",text:V}],metadata:se},{metadata:se})},ue=()=>{b.stop?.()},ce=!!k,fe=O.length>0;if(!(ce&&fe)){let V,se;return!ce&&!fe?(V="Connect your providers",se="Connect an LLM provider and create a gateway to unlock AI-powered features."):ce?(V="No gateways configured",se="Create a gateway to expose your MCP tools to the chat."):(V="No model provider connected",se="Connect to a model provider to unlock AI-powered features."),m.jsxs(nn,{className:"h-full",children:[m.jsxs(nn.Header,{children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("img",{src:DI,alt:"deco chat",className:"size-5 rounded"}),m.jsx("span",{className:"text-sm font-medium",children:"deco chat"})]}),m.jsx("div",{className:"flex items-center gap-1",children:m.jsx("button",{type:"button",onClick:()=>i(!1),className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:m.jsx(ge,{name:"close",size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})})})]}),m.jsx(nn.Content,{className:"flex flex-col items-center",children:m.jsx(Ep,{title:V,description:se,actions:m.jsx(ut,{variant:"outline",onClick:()=>s({to:ce?"/$org/gateways":"/$org/mcps",params:{org:n.slug},search:ce?void 0:{action:"create"}}),children:ce?"Create gateway":"Add connection"})})})]})}return m.jsxs(nn,{className:"h-full",children:[m.jsxs(nn.Header,{children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(bi,{icon:B?.icon,name:B?.title||"deco chat",size:"xs",fallbackIcon:"network_node"}),m.jsx("span",{className:"text-sm font-medium",children:B?.title||"deco chat"})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[!j&&m.jsx("button",{type:"button",onClick:()=>{a()},className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",title:"New chat",children:m.jsx(ge,{name:"add",size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})}),m.jsx("button",{type:"button",onClick:()=>i(!1),className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:m.jsx(ge,{name:"close",size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})})]})]}),m.jsx(nn.Content,{children:j?m.jsx(vE,{title:B?.title||"Ask deco chat",description:B?.description||"Ask anything about configuring model providers or using MCP Mesh.",avatarNode:m.jsx(bi,{icon:B?.icon,name:B?.title||"deco chat",size:"lg",fallbackIcon:"network_node",className:"size-[60px]! rounded-[18px]!"})}):m.jsxs(RI,{minHeightOffset:240,children:[b.messages.map((V,se)=>V.role==="user"?m.jsx(OI,{message:V},V.id):V.role==="assistant"?m.jsx(wI,{message:V,status:se===b.messages.length-1?C:void 0},V.id):null),m.jsx(Kf,{children:m.jsx("div",{ref:u,className:"h-0"})})]})}),m.jsx(nn.Footer,{children:m.jsx(MI,{onSubmit:Q,onStop:ue,disabled:P.length===0||!h,isStreaming:C==="submitted"||C==="streaming",placeholder:P.length===0?"Add an LLM binding connection to start chatting":"Ask anything or @ for context",leftActions:m.jsxs("div",{className:"flex items-center gap-2",children:[O.length>0&&m.jsx(SE,{gateways:H,selectedGatewayId:g?.gatewayId,onGatewayChange:V=>{V&&E({gatewayId:V})},placeholder:"Gateway",variant:"bordered"}),P.length>0&&m.jsx(PE,{models:P,selectedModelId:h?.id,onModelChange:V=>{if(!V)return;const se=P.find(A=>A.id===V);se&&p({id:se.id,connectionId:se.connectionId})},placeholder:"Model",variant:"borderless"})]})})})]})}function Qf(t){const e=F.c(12);let n,r,i,s;e[0]!==t?({className:n,orientation:i,decorative:s,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=s):(n=e[1],r=e[2],i=e[3],s=e[4]);const a=i===void 0?"horizontal":i,o=s===void 0?!0:s;let u;e[5]!==n?(u=X("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",n),e[5]=n,e[6]=u):u=e[6];let l;return e[7]!==o||e[8]!==a||e[9]!==r||e[10]!==u?(l=m.jsx(ep,{"data-slot":"separator-root",decorative:o,orientation:a,className:u,...r}),e[7]=o,e[8]=a,e[9]=r,e[10]=u,e[11]=l):l=e[11],l}function FI(t){const e=F.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(tp,{"data-slot":"sheet",...n}),e[2]=n,e[3]=r):r=e[3],r}function zI(t){const e=F.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(sp,{"data-slot":"sheet-portal",...n}),e[2]=n,e[3]=r):r=e[3],r}function jI(t){const e=F.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=X("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx(op,{"data-slot":"sheet-overlay",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function UI(t){const e=F.c(17);let n,r,i,s;e[0]!==t?({className:r,children:n,side:s,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=s):(n=e[1],r=e[2],i=e[3],s=e[4]);const a=s===void 0?"right":s;let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx(jI,{}),e[5]=o):o=e[5];const u=a==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",l=a==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",d=a==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",c=a==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t";let h;e[6]!==r||e[7]!==u||e[8]!==l||e[9]!==d||e[10]!==c?(h=X("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",u,l,d,c,r),e[6]=r,e[7]=u,e[8]=l,e[9]=d,e[10]=c,e[11]=h):h=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=m.jsxs(ap,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[m.jsx(Bp,{className:"size-4"}),m.jsx("span",{className:"sr-only",children:"Close"})]}),e[12]=p):p=e[12];let g;return e[13]!==n||e[14]!==i||e[15]!==h?(g=m.jsxs(zI,{children:[o,m.jsxs(ip,{"data-slot":"sheet-content",className:h,...i,children:[n,p]})]}),e[13]=n,e[14]=i,e[15]=h,e[16]=g):g=e[16],g}function HI(t){const e=F.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=X("flex flex-col gap-1.5 p-4",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx("div",{"data-slot":"sheet-header",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function $I(t){const e=F.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=X("text-foreground font-semibold",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx(np,{"data-slot":"sheet-title",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function ZI(t){const e=F.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=X("text-muted-foreground text-sm",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx(rp,{"data-slot":"sheet-description",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function eo(t){const e=F.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=X("bg-accent animate-pulse rounded-md",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx("div",{"data-slot":"skeleton",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}const YI="sidebar_state",qI=3600*24*7,VI="16rem",WI="18rem",GI="3rem",KI="b",Xf=D.createContext(null);function to(){const t=D.useContext(Xf);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function QI(t){const e=F.c(21),{defaultOpen:n,open:r,onOpenChange:i,children:s}=t,a=n===void 0?!0:n,o=jn(),[u,l]=D.useState(!1),[d,c]=D.useState(a),h=r??d;let p;e[0]!==h||e[1]!==i?(p=O=>{const P=typeof O=="function"?O(h):O;i?i(P):c(P),document.cookie=`${YI}=${P}; path=/; max-age=${qI}`},e[0]=h,e[1]=i,e[2]=p):p=e[2];const g=p;let E;e[3]!==o||e[4]!==g?(E=()=>o?l(JI):g(XI),e[3]=o,e[4]=g,e[5]=E):E=e[5];const T=E;let x,_;e[6]!==T?(x=()=>{const O=P=>{if(P.key===KI&&(P.metaKey||P.ctrlKey)){const R=P.target;if(R.tagName==="INPUT"||R.tagName==="TEXTAREA"||R.isContentEditable)return;P.preventDefault(),T()}};return globalThis.addEventListener("keydown",O),()=>globalThis.removeEventListener("keydown",O)},_=[T],e[6]=T,e[7]=x,e[8]=_):(x=e[7],_=e[8]),D.useEffect(x,_);const b=h?"expanded":"collapsed";let C;e[9]!==o||e[10]!==h||e[11]!==u||e[12]!==g||e[13]!==b||e[14]!==T?(C={state:b,open:h,setOpen:g,isMobile:o,openMobile:u,setOpenMobile:l,toggleSidebar:T},e[9]=o,e[10]=h,e[11]=u,e[12]=g,e[13]=b,e[14]=T,e[15]=C):C=e[15];const w=C;let k;e[16]!==s?(k=m.jsx(Np,{delayDuration:0,children:s}),e[16]=s,e[17]=k):k=e[17];let v;return e[18]!==w||e[19]!==k?(v=m.jsx(Xf.Provider,{value:w,children:k}),e[18]=w,e[19]=k,e[20]=v):v=e[20],v}function XI(t){return!t}function JI(t){return!t}function eN(t){const e=F.c(14);let n,r,i,s;e[0]!==t?({className:r,style:s,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=s):(n=e[1],r=e[2],i=e[3],s=e[4]);let a;e[5]!==s?(a={"--sidebar-width":VI,"--sidebar-width-icon":GI,...s},e[5]=s,e[6]=a):a=e[6];const o=a;let u;e[7]!==r?(u=X("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",r),e[7]=r,e[8]=u):u=e[8];let l;return e[9]!==n||e[10]!==i||e[11]!==o||e[12]!==u?(l=m.jsx("div",{"data-slot":"sidebar-wrapper",style:o,className:u,...i,children:n}),e[9]=n,e[10]=i,e[11]=o,e[12]=u,e[13]=l):l=e[13],l}function tN(t){const e=F.c(46);let n,r,i,s,a,o;e[0]!==t?({side:s,variant:a,collapsible:o,className:r,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=s,e[5]=a,e[6]=o):(n=e[1],r=e[2],i=e[3],s=e[4],a=e[5],o=e[6]);const u=s===void 0?"left":s,l=a===void 0?"sidebar":a,d=o===void 0?"offcanvas":o,{isMobile:c,state:h,openMobile:p,setOpenMobile:g}=to();if(d==="none"){let P;e[7]!==r?(P=X("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),e[7]=r,e[8]=P):P=e[8];let R;return e[9]!==n||e[10]!==i||e[11]!==P?(R=m.jsx("div",{"data-slot":"sidebar",className:P,...i,children:n}),e[9]=n,e[10]=i,e[11]=P,e[12]=R):R=e[12],R}if(c){let P;e[13]===Symbol.for("react.memo_cache_sentinel")?(P={"--sidebar-width":WI},e[13]=P):P=e[13];let R;e[14]===Symbol.for("react.memo_cache_sentinel")?(R=m.jsxs(HI,{className:"sr-only",children:[m.jsx($I,{children:"Sidebar"}),m.jsx(ZI,{children:"Displays the mobile sidebar."})]}),e[14]=R):R=e[14];let B;e[15]!==n?(B=m.jsx("div",{className:"flex h-full w-full flex-col",children:n}),e[15]=n,e[16]=B):B=e[16];let j;e[17]!==u||e[18]!==B?(j=m.jsxs(UI,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:P,side:u,children:[R,B]}),e[17]=u,e[18]=B,e[19]=j):j=e[19];let J;return e[20]!==p||e[21]!==i||e[22]!==g||e[23]!==j?(J=m.jsx(FI,{open:p,onOpenChange:g,...i,children:j}),e[20]=p,e[21]=i,e[22]=g,e[23]=j,e[24]=J):J=e[24],J}const E=h==="collapsed"?d:"",T=l==="floating"||l==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let x;e[25]!==T?(x=X("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",T),e[25]=T,e[26]=x):x=e[26];let _;e[27]!==x?(_=m.jsx("div",{"data-slot":"sidebar-gap",className:x}),e[27]=x,e[28]=_):_=e[28];const b=u==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",C=l==="floating"||l==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let w;e[29]!==r||e[30]!==b||e[31]!==C?(w=X("fixed top-12 bottom-0 z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",b,C,r),e[29]=r,e[30]=b,e[31]=C,e[32]=w):w=e[32];let k;e[33]!==n?(k=m.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border py-2 flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:n}),e[33]=n,e[34]=k):k=e[34];let v;e[35]!==i||e[36]!==w||e[37]!==k?(v=m.jsx("div",{"data-slot":"sidebar-container",className:w,...i,children:k}),e[35]=i,e[36]=w,e[37]=k,e[38]=v):v=e[38];let O;return e[39]!==u||e[40]!==h||e[41]!==v||e[42]!==E||e[43]!==_||e[44]!==l?(O=m.jsxs("div",{className:"group peer text-foreground hidden md:block border-r","data-state":h,"data-collapsible":E,"data-variant":l,"data-side":u,"data-slot":"sidebar",children:[_,v]}),e[39]=u,e[40]=h,e[41]=v,e[42]=E,e[43]=_,e[44]=l,e[45]=O):O=e[45],O}function nN(t){const e=F.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=X("bg-background relative flex w-full flex-1 flex-col min-w-0","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx("main",{"data-slot":"sidebar-inset",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function Jf(t){const e=F.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=X("bg-border mx-4 w-full",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx(Qf,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function rN(t){const e=F.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=X("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function iN(t){const e=F.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=X("relative flex w-full min-w-0 flex-col px-2 py-2 md:py-0",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function sN(t){const e=F.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=X("w-full text-sm",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function aN(t){const e=F.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=X("flex w-full min-w-0 flex-col gap-1",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function Xt(t){const e=F.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=X("group/menu-item relative",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}const oN=up("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-lg px-2 py-1.5 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding,colors] transition-colors duration-150 ease-out hover:transition-none focus-visible:ring-2 active:bg-sidebar-accent/75 disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent/75 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-[18px] [&>svg]:shrink-0 [&>svg]:text-muted-foreground/75",{variants:{variant:{default:"hover:bg-sidebar-accent text-sidebar-foreground/80 active:text-sidebar-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function no(t){const e=F.c(28);let n,r,i,s,a,o,u;e[0]!==t?({asChild:i,isActive:s,variant:a,size:o,tooltip:u,className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=s,e[5]=a,e[6]=o,e[7]=u):(n=e[1],r=e[2],i=e[3],s=e[4],a=e[5],o=e[6],u=e[7]);const l=i===void 0?!1:i,d=s===void 0?!1:s,c=a===void 0?"default":a,h=o===void 0?"default":o,p=l?lp:"button",{isMobile:g,state:E}=to();let T;e[8]!==n||e[9]!==h||e[10]!==c?(T=X(oN({variant:c,size:h}),n),e[8]=n,e[9]=h,e[10]=c,e[11]=T):T=e[11];let x;e[12]!==p||e[13]!==d||e[14]!==r||e[15]!==h||e[16]!==T?(x=m.jsx(p,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":h,"data-active":d,className:T,...r}),e[12]=p,e[13]=d,e[14]=r,e[15]=h,e[16]=T,e[17]=x):x=e[17];const _=x;if(!u)return _;if(typeof u=="string"){let v;e[18]!==u?(v={children:u},e[18]=u,e[19]=v):v=e[19],u=v}let b;e[20]!==_?(b=m.jsx(Rl,{asChild:!0,children:_}),e[20]=_,e[21]=b):b=e[21];const C=E!=="collapsed"||g;let w;e[22]!==C||e[23]!==u?(w=m.jsx(vl,{side:"right",align:"center",hidden:C,...u}),e[22]=C,e[23]=u,e[24]=w):w=e[24];let k;return e[25]!==b||e[26]!==w?(k=m.jsxs(Ol,{children:[b,w]}),e[25]=b,e[26]=w,e[27]=k):k=e[27],k}function uN(t){const e=F.c(25),{item:n}=t,r=Pr(),{org:i}=vt(),s=Fl(i.id),a=Fp(i.id);let o;e[0]!==a.update||e[1]!==n.url||e[2]!==s?.sidebar_items?(o=async()=>{const b=(s?.sidebar_items||[]).filter(C=>C.url!==n.url);await a.update.mutateAsync({sidebar_items:b})},e[0]=a.update,e[1]=n.url,e[2]=s?.sidebar_items,e[3]=o):o=e[3];const u=o;let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=/^https?:\/\/.+/,e[4]=l):l=e[4];let d;e[5]!==n.icon?(d=l.test(n.icon),e[5]=n.icon,e[6]=d):d=e[6];const c=d;let h;e[7]!==n.url||e[8]!==r?(h=()=>{r({to:n.url})},e[7]=n.url,e[8]=r,e[9]=h):h=e[9];let p;e[10]!==c||e[11]!==n.icon||e[12]!==n.title?(p=m.jsx("div",{className:"flex items-center justify-center shrink-0 mr-2",children:c?m.jsx("img",{src:n.icon,alt:n.title,className:"h-4 w-4 rounded object-cover"}):m.jsx(ge,{name:n.icon,size:16,className:"text-muted-foreground"})}),e[10]=c,e[11]=n.icon,e[12]=n.title,e[13]=p):p=e[13];let g;e[14]!==n.title?(g=n.title.toLocaleLowerCase(),e[14]=n.title,e[15]=g):g=e[15];let E;e[16]!==g?(E=m.jsx("div",{className:"flex-1 min-w-0 flex flex-col items-start",children:m.jsx("span",{className:"truncate text-sm w-full capitalize",children:g})}),e[16]=g,e[17]=E):E=e[17];let T;e[18]!==u?(T=m.jsx(ge,{name:"close",size:16,className:"text-muted-foreground opacity-0 group-hover/item:opacity-50 hover:opacity-100 cursor-pointer",onClick:_=>{_.preventDefault(),_.stopPropagation(),u()}}),e[18]=u,e[19]=T):T=e[19];let x;return e[20]!==h||e[21]!==p||e[22]!==E||e[23]!==T?(x=m.jsx(Xt,{children:m.jsxs(no,{className:"w-full pr-2 group/item relative cursor-pointer",onClick:h,children:[p,E,T]})}),e[20]=h,e[21]=p,e[22]=E,e[23]=T,e[24]=x):x=e[24],x}function lN(){const t=F.c(4),{org:e}=vt(),r=Fl(e.id)?.sidebar_items;if(!r?.length)return null;let i;t[0]!==r?(i=r.map(cN),t[0]=r,t[1]=i):i=t[1];let s;return t[2]!==i?(s=m.jsx(eh,{children:i}),t[2]=i,t[3]=s):s=t[3],s}function cN(t){return m.jsx(uN,{item:t},t.url)}function dl(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx(Xt,{children:m.jsx("div",{className:"flex items-center gap-2 px-4 py-2",children:m.jsx(eo,{className:"h-4 flex-1"})})}),t[0]=e):e=t[0],e}function eh(t){const e=F.c(4),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx(Jf,{className:"my-2 -ml-1"}),e[0]=r):r=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsx(Xt,{children:m.jsx("div",{className:"px-2 py-0 text-xs font-medium text-muted-foreground flex items-center justify-between",children:m.jsx("span",{children:"Pinned Views"})})}),e[1]=i):i=e[1];let s;return e[2]!==n?(s=m.jsxs(m.Fragment,{children:[r,i,n]}),e[2]=n,e[3]=s):s=e[3],s}function dN(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx(D.Suspense,{fallback:m.jsxs(eh,{children:[m.jsx(dl,{}),m.jsx(dl,{})]}),children:m.jsx(lN,{})}),t[0]=e):e=t[0],e}function fN(t){const e=F.c(18),{thread:n,isActive:r}=t,{setActiveThreadId:i,hideThread:s}=ya(),[,a]=Oi();let o;e[0]!==n.created_at||e[1]!==n.title?(o=n.title||`Chat ${new Date(n.created_at).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}`,e[0]=n.created_at,e[1]=n.title,e[2]=o):o=e[2];const u=o,l=`w-full pr-2 group/thread relative cursor-pointer ${r?"bg-accent":""}`;let d;e[3]!==i||e[4]!==a||e[5]!==n.id?(d=()=>{i(n.id),a(!0)},e[3]=i,e[4]=a,e[5]=n.id,e[6]=d):d=e[6];let c;e[7]!==u?(c=m.jsx("div",{className:"flex-1 min-w-0 flex flex-col items-start",children:m.jsx("span",{className:"truncate text-sm w-full",children:u})}),e[7]=u,e[8]=c):c=e[8];let h;e[9]!==s||e[10]!==r||e[11]!==n.id?(h=!r&&m.jsx(ge,{name:"close",size:16,className:"text-muted-foreground opacity-0 group-hover/thread:opacity-50 hover:opacity-100 cursor-pointer",onClick:g=>{g.preventDefault(),g.stopPropagation(),s(n.id)}}),e[9]=s,e[10]=r,e[11]=n.id,e[12]=h):h=e[12];let p;return e[13]!==l||e[14]!==d||e[15]!==c||e[16]!==h?(p=m.jsx(Xt,{children:m.jsxs(no,{className:l,onClick:d,children:[c,h]})}),e[13]=l,e[14]=d,e[15]=c,e[16]=h,e[17]=p):p=e[17],p}const hN=5;function pN(){const t=F.c(9),{activeThreadId:e}=ya(),n=$E();let r,i;if(t[0]!==e||t[1]!==n){i=Symbol.for("react.early_return_sentinel");e:{const a=n.filter(gN).sort(mN).slice(0,hN);if(a.length===0){let u;t[4]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(Xt,{children:m.jsx("div",{className:"px-4 py-2 text-xs text-muted-foreground text-center",children:"No recent chats"})}),t[4]=u):u=t[4],i=u;break e}let o;t[5]!==e?(o=u=>m.jsx(fN,{thread:u,isActive:u.id===e},u.id),t[5]=e,t[6]=o):o=t[6],r=a.map(o)}t[0]=e,t[1]=n,t[2]=r,t[3]=i}else r=t[2],i=t[3];if(i!==Symbol.for("react.early_return_sentinel"))return i;let s;return t[7]!==r?(s=m.jsx(m.Fragment,{children:r}),t[7]=r,t[8]=s):s=t[8],s}function mN(t,e){const n=new Date(t.updated_at).getTime();return new Date(e.updated_at).getTime()-n}function gN(t){return!t.hidden}function Cs(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx(Xt,{children:m.jsx("div",{className:"flex items-center gap-2 px-4 py-2",children:m.jsx(eo,{className:"h-4 flex-1"})})}),t[0]=e):e=t[0],e}function bN(){const t=F.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx(Jf,{className:"my-2 -ml-1"}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsx(Xt,{children:m.jsx("div",{className:"px-2 py-0 text-xs font-medium text-muted-foreground flex items-center justify-between",children:m.jsx("span",{children:"Recent Threads"})})}),t[1]=n):n=t[1];let r;return t[2]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsxs(m.Fragment,{children:[e,n,m.jsx(D.Suspense,{fallback:m.jsxs(m.Fragment,{children:[m.jsx(Cs,{}),m.jsx(Cs,{}),m.jsx(Cs,{})]}),children:m.jsx(pN,{})})]}),t[2]=r):r=t[2],r}function EN(){const t=F.c(36),{locator:e}=vt(),n=Pr();let r;t[0]!==e?(r=oo.parse(e),t[0]=e,t[1]=r):r=t[1];const{org:i}=r;let s;t[2]!==e?(s=oo.isOrgAdminProject(e),t[2]=e,t[3]=s):s=t[3];const a=s;let o;t[4]!==n||t[5]!==i?(o={key:"home",label:"Home",icon:"home",onClick:()=>n({to:"/$org",params:{org:i}})},t[4]=n,t[5]=i,t[6]=o):o=t[6];let u;t[7]!==n||t[8]!==i?(u={key:"store",label:"Store",icon:"shopping_bag",onClick:()=>n({to:"/$org/store",params:{org:i}})},t[7]=n,t[8]=i,t[9]=u):u=t[9];let l;t[10]!==n||t[11]!==i?(l={key:"mcps",label:"MCP Servers",icon:"extension",onClick:()=>n({to:"/$org/mcps",params:{org:i}})},t[10]=n,t[11]=i,t[12]=l):l=t[12];let d;t[13]!==n||t[14]!==i?(d={key:"gateways",label:"MCP Gateways",icon:"network_node",onClick:()=>n({to:"/$org/gateways",params:{org:i}})},t[13]=n,t[14]=i,t[15]=d):d=t[15];let c;t[16]!==n||t[17]!==i?(c={key:"monitoring",label:"Monitoring",icon:"monitoring",onClick:()=>n({to:"/$org/monitoring",params:{org:i}})},t[16]=n,t[17]=i,t[18]=c):c=t[18];let h;t[19]!==n||t[20]!==i?(h={key:"members",label:"Members",icon:"group",onClick:()=>n({to:"/$org/members",params:{org:i}})},t[19]=n,t[20]=i,t[21]=h):h=t[21];let p;t[22]!==n||t[23]!==i?(p={key:"settings",label:"Settings",icon:"settings",onClick:()=>n({to:"/$org/settings",params:{org:i}})},t[22]=n,t[23]=i,t[24]=p):p=t[24];let g;t[25]!==o||t[26]!==u||t[27]!==l||t[28]!==d||t[29]!==c||t[30]!==h||t[31]!==p?(g=[o,u,l,d,c,h,p],t[25]=o,t[26]=u,t[27]=l,t[28]=d,t[29]=c,t[30]=h,t[31]=p,t[32]=g):g=t[32];const E=g;let T;return t[33]!==E||t[34]!==a?(T=a?E:[],t[33]=E,t[34]=a,t[35]=T):T=t[35],T}function th(t){const e=F.c(9),{navigationItems:n,footer:r,additionalContent:i,variant:s}=t,a=s===void 0?"sidebar":s;let o;e[0]!==n?(o=n.map(xN),e[0]=n,e[1]=o):o=e[1];let u;e[2]!==i||e[3]!==o?(u=m.jsx(rN,{className:"flex-1 overflow-x-hidden",children:m.jsx(iN,{className:"font-medium",children:m.jsx(sN,{children:m.jsxs(aN,{className:"gap-0.5",children:[o,i]})})})}),e[2]=i,e[3]=o,e[4]=u):u=e[4];let l;return e[5]!==r||e[6]!==u||e[7]!==a?(l=m.jsxs(tN,{variant:a,children:[u,r]}),e[5]=r,e[6]=u,e[7]=a,e[8]=l):l=e[8],l}function xN(t){return m.jsx(Xt,{children:m.jsxs(no,{className:"cursor-pointer",onClick:t.onClick,isActive:t.isActive,children:[m.jsx(ge,{name:t.icon,size:20,className:"text-muted-foreground/75"}),m.jsx("span",{className:"truncate",children:t.label})]})},t.key)}th.Skeleton=function(){return m.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,n)=>m.jsx("div",{className:"w-full h-8",children:m.jsx(eo,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function TN(){const t=F.c(4),e=EN();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsx(Ps,{children:m.jsx(D.Suspense,{fallback:null,children:m.jsx(dN,{})})}),t[0]=n):n=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsxs(m.Fragment,{children:[n,m.jsx(Ps,{children:m.jsx(D.Suspense,{fallback:null,children:m.jsx(bN,{})})})]}),t[1]=r):r=t[1];let i;return t[2]!==e?(i=m.jsx(th,{navigationItems:e,additionalContent:r}),t[2]=e,t[3]=i):i=t[3],i}const nh=D.createContext(null);function _N(){const t=D.useContext(nh);if(!t)throw new Error("TopbarSwitcher compound components must be used within TopbarSwitcher.Root");return t}function yN(t){const e=F.c(10),{children:n,onItemHover:r}=t,[i,s]=D.useState(null);let a;e[0]!==r?(a=c=>{s(c),r?.(c)},e[0]=r,e[1]=a):a=e[1];const o=a;let u;e[2]!==i||e[3]!==o?(u={hoveredItem:i,setHoveredItem:o},e[2]=i,e[3]=o,e[4]=u):u=e[4];let l;e[5]!==n?(l=m.jsx(Up,{children:n}),e[5]=n,e[6]=l):l=e[6];let d;return e[7]!==u||e[8]!==l?(d=m.jsx(nh.Provider,{value:u,children:l}),e[7]=u,e[8]=l,e[9]=d):d=e[9],d}function kN(t){const e=F.c(6),{children:n,onClick:r}=t;let i;e[0]!==n||e[1]!==r?(i=m.jsx(ut,{variant:"link",className:"p-0.5 h-auto",onClick:r,type:"button",children:n}),e[0]=n,e[1]=r,e[2]=i):i=e[2];let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx(Hp,{asChild:!0,children:m.jsx(ut,{size:"icon",variant:"ghost",className:"w-6 h-6 p-0",children:m.jsx(ge,{name:"expand_all",size:16,className:"opacity-50"})})}),e[3]=s):s=e[3];let a;return e[4]!==i?(a=m.jsxs("div",{className:"flex items-center gap-1",children:[i,s]}),e[4]=i,e[5]=a):a=e[5],a}function AN(t){const e=F.c(8),{item:n,fallback:r}=t,i=r===void 0?"":r,s=n?.avatarUrl??"",a=n?.name??i;let o;e[0]!==s||e[1]!==a?(o=m.jsx(Un,{url:s,fallback:a,size:"xs",objectFit:"contain"}),e[0]=s,e[1]=a,e[2]=o):o=e[2];const u=n?.name??i;let l;e[3]!==u?(l=m.jsx("span",{children:u}),e[3]=u,e[4]=l):l=e[4];let d;return e[5]!==o||e[6]!==l?(d=m.jsxs("div",{className:"flex items-center gap-2",children:[o,l]}),e[5]=o,e[6]=l,e[7]=d):d=e[7],d}function SN(t){const e=F.c(6),{children:n,align:r}=t,i=r===void 0?"start":r,a=D.Children.toArray(n).filter(CN).length===1?"280px":"480px";let o;e[0]!==a?(o={width:a},e[0]=a,e[1]=o):o=e[1];let u;return e[2]!==i||e[3]!==n||e[4]!==o?(u=m.jsx($p,{align:i,className:"p-0 flex items-start",style:o,children:n}),e[2]=i,e[3]=n,e[4]=o,e[5]=u):u=e[5],u}function CN(t){return D.isValidElement(t)&&(t.type===ih||t.type===rh)}function rh(t){const e=F.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=X("flex flex-col border-border w-[240px] border-r last:border-r-0 last:w-full",r),e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==n||e[3]!==i?(s=m.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s}const ih=rh;function IN(t){const e=F.c(6),{placeholder:n,value:r,onChange:i}=t,s=n===void 0?"Search...":n;let a;e[0]!==i?(a=u=>i(u.target.value),e[0]=i,e[1]=a):a=e[1];let o;return e[2]!==s||e[3]!==a||e[4]!==r?(o=m.jsx(jp,{placeholder:s,value:r,onChange:a,className:"rounded-none border-t-0 border-x-0 focus-visible:border-border focus-visible:ring-0"}),e[2]=s,e[3]=a,e[4]=r,e[5]=o):o=e[5],o}function NN(t){const e=F.c(6),{children:n,emptyMessage:r}=t,i=r===void 0?"No items found.":r,s=D.Children.count(n)>0;let a;e[0]!==i||e[1]!==s?(a=!s&&m.jsx("div",{className:"text-muted-foreground text-sm px-1 py-8 text-center",children:i}),e[0]=i,e[1]=s,e[2]=a):a=e[2];let o;return e[3]!==n||e[4]!==a?(o=m.jsxs("div",{className:"flex flex-col gap-0.5 p-1 max-h-44 overflow-y-auto",children:[a,n]}),e[3]=n,e[4]=a,e[5]=o):o=e[5],o}function wN(t){const e=F.c(15),{item:n,onClick:r,onHover:i,children:s}=t,a=_N();let o;e[0]!==a||e[1]!==n||e[2]!==i?(o=()=>{a.setHoveredItem(n.slug),i?.(n)},e[0]=a,e[1]=n,e[2]=i,e[3]=o):o=e[3];const u=o;let l;e[4]!==n||e[5]!==r?(l=()=>r(n),e[4]=n,e[5]=r,e[6]=l):l=e[6];let d;e[7]!==s||e[8]!==n.avatarUrl||e[9]!==n.name?(d=s||m.jsxs(m.Fragment,{children:[m.jsx(Un,{url:n.avatarUrl??"",fallback:n.name,size:"xs",className:"w-[22px]! h-[22px]!",objectFit:"contain"}),m.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:n.name})]}),e[7]=s,e[8]=n.avatarUrl,e[9]=n.name,e[10]=d):d=e[10];let c;return e[11]!==u||e[12]!==l||e[13]!==d?(c=m.jsx(ut,{onClick:l,onMouseEnter:u,variant:"ghost",size:"sm",className:"w-full justify-start font-normal",children:d}),e[11]=u,e[12]=l,e[13]=d,e[14]=c):c=e[14],c}function vN(t){const e=F.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx("div",{className:"px-1 pb-1 pt-0.5",children:n}),e[0]=n,e[1]=r):r=e[1],r}function RN(t){const e=F.c(11),{onClick:n,icon:r,children:i,variant:s}=t,o=(s===void 0?"default":s)==="muted"&&"text-muted-foreground";let u;e[0]!==o?(u=X("w-full justify-start font-normal",o),e[0]=o,e[1]=u):u=e[1];let l;e[2]!==r?(l=r&&m.jsx(ge,{name:r,size:16}),e[2]=r,e[3]=l):l=e[3];let d;e[4]!==i?(d=m.jsx("span",{children:i}),e[4]=i,e[5]=d):d=e[5];let c;return e[6]!==n||e[7]!==u||e[8]!==l||e[9]!==d?(c=m.jsxs(ut,{variant:"ghost",size:"sm",className:u,onClick:n,children:[l,d]}),e[6]=n,e[7]=u,e[8]=l,e[9]=d,e[10]=c):c=e[10],c}function ON(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx(Qf,{}),t[0]=e):e=t[0],e}function LN(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx("div",{className:"h-4 w-16 bg-accent rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const at=Object.assign(yN,{Trigger:kN,CurrentItem:AN,Content:SN,Panel:ih,Search:IN,Items:NN,Item:wN,Actions:vN,Action:RN,Separator:ON,Skeleton:LN});function ca(){const t=F.c(56);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:n}=Il(e),{data:r}=Mr.useListOrganizations(),i=Pr();let s;t[1]!==n||t[2]!==r?(s=r?.find(j=>j.slug===n),t[1]=n,t[2]=r,t[3]=s):s=t[3];const a=s,[o,u]=D.useState(""),[l,d]=D.useState(!1);let c,h,p,g,E,T,x,_;if(t[4]!==a||t[5]!==i||t[6]!==n||t[7]!==o||t[8]!==r){const J=(r?(()=>{const fe=r.filter(N=>N.name.toLowerCase().includes(o.toLowerCase()));if(n){const N=fe.findIndex(V=>V.slug===n);if(N>0){const V=fe[N];V&&(fe.splice(N,1),fe.unshift(V))}}return fe})():[]).map(DN);let Y;t[17]!==a?(Y=a?{slug:a.slug,name:a.name,avatarUrl:a.logo}:void 0,t[17]=a,t[18]=Y):Y=t[18];const H=Y;g=at;let Q;t[19]!==i||t[20]!==n?(Q=()=>i({to:"/$org",params:{org:n??""}}),t[19]=i,t[20]=n,t[21]=Q):Q=t[21];let ue;t[22]!==H?(ue=m.jsx(at.CurrentItem,{item:H}),t[22]=H,t[23]=ue):ue=t[23],t[24]!==Q||t[25]!==ue?(_=m.jsx(at.Trigger,{onClick:Q,children:ue}),t[24]=Q,t[25]=ue,t[26]=_):_=t[26],p=at.Content,h=at.Panel,t[27]!==o?(x=m.jsx(at.Search,{placeholder:"Search organizations...",value:o,onChange:u}),t[27]=o,t[28]=x):x=t[28],c=at.Items,E="No organizations found.";let ce;t[29]!==i?(ce=fe=>m.jsx(at.Item,{item:fe,onClick:N=>i({to:"/$org",params:{org:N.slug}})},fe.slug),t[29]=i,t[30]=ce):ce=t[30],T=J.map(ce),t[4]=a,t[5]=i,t[6]=n,t[7]=o,t[8]=r,t[9]=c,t[10]=h,t[11]=p,t[12]=g,t[13]=E,t[14]=T,t[15]=x,t[16]=_}else c=t[9],h=t[10],p=t[11],g=t[12],E=t[13],T=t[14],x=t[15],_=t[16];let b;t[31]!==c||t[32]!==E||t[33]!==T?(b=m.jsx(c,{emptyMessage:E,children:T}),t[31]=c,t[32]=E,t[33]=T,t[34]=b):b=t[34];let C,w;t[35]===Symbol.for("react.memo_cache_sentinel")?(C=m.jsx(at.Actions,{children:m.jsx(at.Action,{onClick:()=>d(!0),variant:"muted",children:"+ Create organization"})}),w=m.jsx(at.Separator,{}),t[35]=C,t[36]=w):(C=t[35],w=t[36]);let k;t[37]!==i?(k=m.jsx(at.Actions,{children:m.jsx(at.Action,{onClick:()=>i({to:"/"}),icon:"grid_view",children:"See all organizations"})}),t[37]=i,t[38]=k):k=t[38];let v;t[39]!==h||t[40]!==x||t[41]!==b||t[42]!==k?(v=m.jsxs(h,{children:[x,b,C,w,k]}),t[39]=h,t[40]=x,t[41]=b,t[42]=k,t[43]=v):v=t[43];let O;t[44]!==p||t[45]!==v?(O=m.jsx(p,{children:v}),t[44]=p,t[45]=v,t[46]=O):O=t[46];let P;t[47]!==g||t[48]!==O||t[49]!==_?(P=m.jsxs(g,{children:[_,O]}),t[47]=g,t[48]=O,t[49]=_,t[50]=P):P=t[50];let R;t[51]!==l?(R=m.jsx(zp,{open:l,onOpenChange:d}),t[51]=l,t[52]=R):R=t[52];let B;return t[53]!==P||t[54]!==R?(B=m.jsxs(m.Fragment,{children:[P,R]}),t[53]=P,t[54]=R,t[55]=B):B=t[55],B}function DN(t){return{slug:t.slug,name:t.name,avatarUrl:t.logo}}ca.Skeleton=at.Skeleton;const sh=D.createContext({setOpen:()=>{}}),PN=()=>D.useContext(sh),MN=t=>{const e=F.c(25);let n,r,i,s,a;e[0]!==t?({children:n,defaultOpen:r,open:s,onOpenChange:i,...a}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=s,e[5]=a):(n=e[1],r=e[2],i=e[3],s=e[4],a=e[5]);const o=r??!1;let u;e[6]!==i||e[7]!==s||e[8]!==o?(u={prop:s,defaultProp:o,onChange:i},e[6]=i,e[7]=s,e[8]=o,e[9]=u):u=e[9];const[l,d]=Ys(u);let c;e[10]!==d?(c={setOpen:d},e[10]=d,e[11]=c):c=e[11];let h;e[12]!==n||e[13]!==l||e[14]!==a||e[15]!==d?(h=m.jsx(Rc,{open:l,onOpenChange:d,...a,children:n}),e[12]=n,e[13]=l,e[14]=a,e[15]=d,e[16]=h):h=e[16];let p;e[17]!==l||e[18]!==a||e[19]!==d||e[20]!==h?(p=m.jsx(qp,{open:l,onOpenChange:d,...a,children:h}),e[17]=l,e[18]=a,e[19]=d,e[20]=h,e[21]=p):p=e[21];let g;return e[22]!==c||e[23]!==p?(g=m.jsx(sh.Provider,{value:c,children:p}),e[22]=c,e[23]=p,e[24]=g):g=e[24],g},BN=t=>{const{children:e,title:n,...r}=t,i=jn(),{className:s,...a}=r;return i?m.jsxs(Lc,{...a,children:[m.jsx(Dc,{className:"hidden",children:m.jsx(Pc,{children:n})}),m.jsx("div",{className:X("flex flex-col gap-2 p-2 py-4",s),children:e})]}):m.jsx(Yp,{...r,children:e})},FN=t=>{const{children:e,...n}=t,{setOpen:r}=PN(),i=jn(),{className:s,...a}=n;return i?m.jsx("div",{...a,onClick:o=>{r(!1);const{onClick:u}=a;u?.(o)},className:X("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),children:e}):m.jsx(Vp,{...n,children:e})},zN=t=>{const e=F.c(7);let n,r;e[0]!==t?({children:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);const i=jn();let s;return e[3]!==n||e[4]!==i||e[5]!==r?(s=i?m.jsx(Oc,{asChild:!0,children:n}):m.jsx(Zp,{...r,children:n}),e[3]=n,e[4]=i,e[5]=r,e[6]=s):s=e[6],s},jN=t=>{const e=F.c(7);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);const i=jn();let s;return e[3]!==n||e[4]!==i||e[5]!==r?(s=i?m.jsx(uo,{className:X(n),...r}):m.jsx(uo,{className:X(n),...r}),e[3]=n,e[4]=i,e[5]=r,e[6]=s):s=e[6],s};function UN(t){const e=F.c(11),{user:n,trigger:r,align:i,children:s}=t,a=i===void 0?"start":i;let o;e[0]!==r||e[1]!==n?(o=r(n),e[0]=r,e[1]=n,e[2]=o):o=e[2];let u;e[3]!==o?(u=m.jsx(zN,{asChild:!0,children:m.jsx("div",{children:o})}),e[3]=o,e[4]=u):u=e[4];let l;e[5]!==a||e[6]!==s?(l=m.jsx(BN,{side:"top",align:a,className:"md:w-[240px]",children:s}),e[5]=a,e[6]=s,e[7]=l):l=e[7];let d;return e[8]!==u||e[9]!==l?(d=m.jsxs(MN,{children:[u,l]}),e[8]=u,e[9]=l,e[10]=d):d=e[10],d}function HN(t){const e=F.c(8),{children:n,onClick:r,className:i,asChild:s}=t;let a;e[0]!==s||e[1]!==n||e[2]!==r?(a=s?n:m.jsx("button",{type:"button",className:"flex items-center gap-2 text-sm w-full cursor-pointer",onClick:r,children:n}),e[0]=s,e[1]=n,e[2]=r,e[3]=a):a=e[3];let o;return e[4]!==s||e[5]!==i||e[6]!==a?(o=m.jsx(FN,{asChild:s,className:i,children:a}),e[4]=s,e[5]=i,e[6]=a,e[7]=o):o=e[7],o}function $N(t){const e=F.c(2),{className:n}=t;let r;return e[0]!==n?(r=m.jsx(jN,{className:n}),e[0]=n,e[1]=r):r=e[1],r}function ZN(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const Ut=Object.assign(UN,{Item:HN,Separator:$N,Skeleton:ZN});function YN(t){const e=F.c(33),{open:n,onOpenChange:r,user:i,userImage:s}=t,[a,o]=D.useState(!1);let u;e[0]!==i.id?(u=()=>{navigator.clipboard.writeText(i.id),o(!0),setTimeout(()=>o(!1),2e3)},e[0]=i.id,e[1]=u):u=e[1];const l=u;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsxs(Ll,{children:[m.jsx(Dl,{children:"Profile"}),m.jsx(Pl,{children:"Your account information"})]}),e[2]=d):d=e[2];const c=i.name||i.email||"U";let h;e[3]!==c||e[4]!==s?(h=m.jsx(Un,{url:s,fallback:c,shape:"circle",size:"2xl"}),e[3]=c,e[4]=s,e[5]=h):h=e[5];const p=i.name||i.email;let g;e[6]!==p?(g=m.jsx("div",{className:"text-lg font-semibold text-center",children:p}),e[6]=p,e[7]=g):g=e[7];let E;e[8]!==i.email?(E=m.jsx("div",{className:"text-sm text-muted-foreground text-center",children:i.email}),e[8]=i.email,e[9]=E):E=e[9];let T;e[10]!==g||e[11]!==E?(T=m.jsxs("div",{className:"flex flex-col items-center gap-2 w-full",children:[g,E]}),e[10]=g,e[11]=E,e[12]=T):T=e[12];let x;e[13]===Symbol.for("react.memo_cache_sentinel")?(x=m.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"User ID"}),e[13]=x):x=e[13];let _;e[14]!==i.id?(_=m.jsxs("div",{className:"flex flex-col gap-1 min-w-0 flex-1",children:[x,m.jsx("span",{className:"text-sm font-mono truncate",children:i.id})]}),e[14]=i.id,e[15]=_):_=e[15];const b=a?"check":"content_copy",C=a?"text-green-600":"text-muted-foreground";let w;e[16]!==b||e[17]!==C?(w=m.jsx(ge,{name:b,size:16,className:C}),e[16]=b,e[17]=C,e[18]=w):w=e[18];let k;e[19]!==l||e[20]!==w?(k=m.jsx("button",{type:"button",onClick:l,className:"flex-shrink-0 p-2 hover:bg-background rounded-md transition-colors","aria-label":"Copy user ID",children:w}),e[19]=l,e[20]=w,e[21]=k):k=e[21];let v;e[22]!==_||e[23]!==k?(v=m.jsxs("div",{className:"flex items-center justify-between gap-3 w-full px-4 py-3 rounded-lg bg-muted/50 border border-border",children:[_,k]}),e[22]=_,e[23]=k,e[24]=v):v=e[24];let O;e[25]!==v||e[26]!==h||e[27]!==T?(O=m.jsxs(Ml,{className:"sm:max-w-md",children:[d,m.jsxs("div",{className:"flex flex-col items-center gap-6 py-4",children:[h,T,v]})]}),e[25]=v,e[26]=h,e[27]=T,e[28]=O):O=e[28];let P;return e[29]!==r||e[30]!==n||e[31]!==O?(P=m.jsx(Bl,{open:n,onOpenChange:r,children:O}),e[29]=r,e[30]=n,e[31]=O,e[32]=P):P=e[32],P}function qN(t){const e=F.c(5),{open:n,onOpenChange:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsxs(Ll,{children:[m.jsx(Dl,{children:"Invitations"}),m.jsx(Pl,{children:"Your pending organization invitations"})]}),e[0]=i):i=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsxs(Ml,{className:"sm:max-w-lg",children:[i,m.jsx("div",{className:"max-h-[420px] overflow-auto pr-1",children:m.jsx(fp,{})})]}),e[1]=s):s=e[1];let a;return e[2]!==r||e[3]!==n?(a=m.jsx(Bl,{open:n,onOpenChange:r,children:s}),e[2]=r,e[3]=n,e[4]=a):a=e[4],a}function VN(t){const e=F.c(31),{user:n,userImage:r,hasInvites:i,showInvitesItem:s}=t,[a,o]=D.useState(!1),[u,l]=D.useState(!1);let d;e[0]!==i||e[1]!==n.email||e[2]!==n.name||e[3]!==r?(d=()=>m.jsxs("div",{className:"relative",children:[m.jsx(Un,{url:r,fallback:n.name||n.email||"U",shape:"circle",size:"sm",className:"cursor-pointer hover:ring-2 ring-muted-foreground transition-all"}),i&&m.jsx("span",{className:"absolute -top-0.5 -right-0.5 h-2.5 w-2.5 rounded-full bg-destructive ring-2 ring-background"})]}),e[0]=i,e[1]=n.email,e[2]=n.name,e[3]=r,e[4]=d):d=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=m.jsxs(Ut.Item,{onClick:()=>o(!0),children:[m.jsx(ge,{name:"account_circle",className:"text-muted-foreground"}),"Profile"]}),e[5]=c):c=e[5];let h;e[6]!==i||e[7]!==s?(h=s&&m.jsxs(Ut.Item,{onClick:()=>l(!0),children:[m.jsx(ge,{name:"mail",className:"text-muted-foreground"}),"Invitations",i&&m.jsx("span",{className:"ml-auto h-2 w-2 rounded-full bg-destructive"})]}),e[6]=i,e[7]=s,e[8]=h):h=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=m.jsx(Ut.Separator,{}),e[9]=p):p=e[9];let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=m.jsx(dp,{className:"w-4 h-4 text-muted-foreground"}),e[10]=g):g=e[10];let E;e[11]===Symbol.for("react.memo_cache_sentinel")?(E=m.jsx(Ut.Item,{asChild:!0,children:m.jsxs("a",{href:"https://github.com/decocms/admin",target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 text-sm cursor-pointer",children:[g,"decocms/admin",m.jsx(ge,{name:"arrow_outward",size:18,className:"text-muted-foreground ml-auto"})]})}),e[11]=E):E=e[11];let T;e[12]===Symbol.for("react.memo_cache_sentinel")?(T=m.jsx(ge,{name:"language",className:"text-muted-foreground"}),e[12]=T):T=e[12];let x,_;e[13]===Symbol.for("react.memo_cache_sentinel")?(x=m.jsx(Ut.Item,{asChild:!0,children:m.jsxs("a",{href:"https://decocms.com",target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 text-sm cursor-pointer",children:[T,"Homepage",m.jsx(ge,{name:"arrow_outward",size:18,className:"ml-auto text-muted-foreground"})]})}),_=m.jsx(Ut.Separator,{}),e[13]=x,e[14]=_):(x=e[13],_=e[14]);let b;e[15]===Symbol.for("react.memo_cache_sentinel")?(b=m.jsxs(Ut.Item,{onClick:WN,children:[m.jsx(ge,{name:"logout",size:18,className:"text-muted-foreground"}),"Log out"]}),e[15]=b):b=e[15];let C;e[16]!==d||e[17]!==h||e[18]!==n?(C=m.jsxs(Ut,{user:n,trigger:d,align:"end",children:[c,h,p,E,x,_,b]}),e[16]=d,e[17]=h,e[18]=n,e[19]=C):C=e[19];let w;e[20]!==a||e[21]!==n||e[22]!==r?(w=a&&m.jsx(YN,{open:a,onOpenChange:o,user:n,userImage:r}),e[20]=a,e[21]=n,e[22]=r,e[23]=w):w=e[23];let k;e[24]!==u||e[25]!==s?(k=s&&u&&m.jsx(qN,{open:u,onOpenChange:l}),e[24]=u,e[25]=s,e[26]=k):k=e[26];let v;return e[27]!==C||e[28]!==w||e[29]!==k?(v=m.jsxs(m.Fragment,{children:[C,w,k]}),e[27]=C,e[28]=w,e[29]=k,e[30]=v):v=e[30],v}function WN(){return Mr.signOut()}function GN(){const{data:t}=Mr.useSession(),e=D.useContext(cp),{data:n}=e.hooks.useListUserInvitations(),i=(n??[]).length>0;if(!t?.user)return m.jsx(Un,{url:void 0,fallback:"U",shape:"circle",size:"sm",className:"cursor-pointer",muted:!0});const s=t.user,a={...s,name:s.name??void 0},o=s.image;return m.jsx(VN,{user:a,userImage:o,hasInvites:i,showInvitesItem:!0})}function KN(t){const e=F.c(6),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx(hp,{children:m.jsx(Nl,{})}),e[0]=r):r=e[0];let i;e[1]!==n?(i=m.jsx(pp,{children:n}),e[1]=n,e[2]=i):i=e[2];let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx(mp,{children:m.jsx(gp,{to:"/login",replace:!0})}),e[3]=s):s=e[3];let a;return e[4]!==i?(a=m.jsxs(m.Fragment,{children:[r,i,s]}),e[4]=i,e[5]=a):a=e[5],a}function QN(t){const e=F.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=X("fixed top-0 left-0 right-0 z-20 bg-sidebar flex items-center justify-between w-full px-2.5 h-12 border-b border-border",r),e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==n||e[3]!==i?(s=m.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s}function XN(t){const e=F.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=X("flex items-center gap-2",r),e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==n||e[3]!==i?(s=m.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s}function JN(t){const e=F.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=X("flex items-center gap-2",r),e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==n||e[3]!==i?(s=m.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s}function ew(){const t=F.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("div",{className:"w-8 h-8 bg-muted rounded-md animate-pulse"}),m.jsx("div",{className:"w-32 h-6 bg-muted rounded-md animate-pulse"})]}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsxs("div",{className:"fixed top-0 left-0 right-0 z-20 bg-sidebar flex items-center justify-between w-full px-4 h-12 border-b border-border",children:[e,m.jsx("div",{className:"flex items-center gap-2",children:m.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"})})]}),t[1]=n):n=t[1],n}const Is=Object.assign(QN,{Left:XN,Right:JN,Skeleton:ew});function tw(){const t=F.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx("div",{className:"size-10 rounded-xl bg-muted animate-pulse"}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsxs("div",{className:"flex items-center gap-3",children:[e,m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsx("div",{className:"h-4 w-24 rounded bg-muted animate-pulse"}),m.jsx("div",{className:"h-3 w-32 rounded bg-muted/60 animate-pulse"})]})]}),t[1]=n):n=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx("div",{className:"flex-none border-b border-border/80 px-5 pb-4 pt-6",children:m.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n,m.jsxs("div",{className:"flex flex-col items-end gap-2",children:[m.jsx("div",{className:"h-5 w-20 rounded-full bg-muted animate-pulse"}),m.jsx("div",{className:"h-8 w-48 rounded-lg bg-muted animate-pulse"})]})]})}),t[2]=r):r=t[2];let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsx("div",{className:"flex-1 overflow-hidden px-4 py-4",children:m.jsxs("div",{className:"mx-auto flex max-w-2xl flex-col gap-4",children:[m.jsx(ii,{align:"right",width:"w-3/4"}),m.jsx(ii,{align:"left",width:"w-full",lines:3}),m.jsx(ii,{align:"right",width:"w-2/3"}),m.jsx(ii,{align:"left",width:"w-5/6",lines:2})]})}),t[3]=i):i=t[3];let s;t[4]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx("div",{className:"relative flex flex-1 flex-col gap-2 p-2.5",children:m.jsx("div",{className:"relative flex-1",children:m.jsxs("div",{className:"space-y-2 p-2",children:[m.jsx("div",{className:"h-3 w-full rounded bg-muted/40 animate-pulse"}),m.jsx("div",{className:"h-3 w-4/5 rounded bg-muted/40 animate-pulse"})]})})}),t[4]=s):s=t[4];let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx("div",{className:"flex items-center gap-1",children:m.jsx("div",{className:"size-8 rounded-full bg-muted/60 animate-pulse"})}),t[5]=a):a=t[5];let o;return t[6]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsxs("div",{className:"flex h-full w-full flex-col bg-sidebar",children:[r,i,m.jsx("div",{className:"flex-none border-t border-border/80 px-5 py-4",children:m.jsx("div",{className:"space-y-3",children:m.jsxs("div",{className:"relative flex min-h-[130px] flex-col rounded-xl border border-border bg-background shadow-sm",children:[s,m.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2.5",children:[a,m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("div",{className:"h-8 w-32 rounded-lg bg-muted/60 animate-pulse"}),m.jsx("div",{className:"size-8 rounded-full bg-muted animate-pulse"})]})]})]})})})]}),t[6]=o):o=t[6],o}function ii(t){const e=F.c(22),{align:n,width:r,lines:i}=t,s=r===void 0?"w-full":r,a=i===void 0?1:i,o=n==="right"?"flex-row-reverse":"flex-row";let u;e[0]!==o?(u=X("flex w-full gap-4 px-4 py-2",o),e[0]=o,e[1]=u):u=e[1];const l=n==="right"?"ml-auto max-w-3/4 items-end":"w-full items-start";let d;e[2]!==l?(d=X("flex min-w-0 flex-col gap-2",l),e[2]=l,e[3]=d):d=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=m.jsx("div",{className:"h-3 w-16 rounded bg-muted/40 animate-pulse"}),e[4]=c):c=e[4];const h=n==="right"?"bg-muted":"bg-transparent border border-border/40";let p;e[5]!==h||e[6]!==s?(p=X("min-w-0 rounded-2xl p-4",h,s),e[5]=h,e[6]=s,e[7]=p):p=e[7];let g;e[8]!==a?(g=Array.from({length:a}),e[8]=a,e[9]=g):g=e[9];let E;e[10]!==a||e[11]!==g?(E=m.jsx("div",{className:"space-y-2",children:g.map((b,C)=>m.jsx("div",{className:X("h-3 rounded bg-muted-foreground/20 animate-pulse",C===a-1?"w-3/4":"w-full"),style:{animationDelay:`${C*.1}s`}},C))}),e[10]=a,e[11]=g,e[12]=E):E=e[12];let T;e[13]!==E||e[14]!==p?(T=m.jsx("div",{className:p,children:E}),e[13]=E,e[14]=p,e[15]=T):T=e[15];let x;e[16]!==T||e[17]!==d?(x=m.jsxs("div",{className:d,children:[c,T]}),e[16]=T,e[17]=d,e[18]=x):x=e[18];let _;return e[19]!==x||e[20]!==u?(_=m.jsx("div",{className:u,children:x}),e[19]=x,e[20]=u,e[21]=_):_=e[21],_}const Ki=D.createContext(null);Ki.displayName="PanelGroupContext";const je={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},ro=10,fn=D.useLayoutEffect,fl=bp.useId,nw=typeof fl=="function"?fl:()=>null;let rw=0;function io(t=null){const e=nw(),n=D.useRef(t||e||null);return n.current===null&&(n.current=""+rw++),t??n.current}function ah({children:t,className:e="",collapsedSize:n,collapsible:r,defaultSize:i,forwardedRef:s,id:a,maxSize:o,minSize:u,onCollapse:l,onExpand:d,onResize:c,order:h,style:p,tagName:g="div",...E}){const T=D.useContext(Ki);if(T===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:x,expandPanel:_,getPanelSize:b,getPanelStyle:C,groupId:w,isPanelCollapsed:k,reevaluatePanelConstraints:v,registerPanel:O,resizePanel:P,unregisterPanel:R}=T,B=io(a),j=D.useRef({callbacks:{onCollapse:l,onExpand:d,onResize:c},constraints:{collapsedSize:n,collapsible:r,defaultSize:i,maxSize:o,minSize:u},id:B,idIsFromProps:a!==void 0,order:h});D.useRef({didLogMissingDefaultSizeWarning:!1}),fn(()=>{const{callbacks:Y,constraints:H}=j.current,Q={...H};j.current.id=B,j.current.idIsFromProps=a!==void 0,j.current.order=h,Y.onCollapse=l,Y.onExpand=d,Y.onResize=c,H.collapsedSize=n,H.collapsible=r,H.defaultSize=i,H.maxSize=o,H.minSize=u,(Q.collapsedSize!==H.collapsedSize||Q.collapsible!==H.collapsible||Q.maxSize!==H.maxSize||Q.minSize!==H.minSize)&&v(j.current,Q)}),fn(()=>{const Y=j.current;return O(Y),()=>{R(Y)}},[h,B,O,R]),D.useImperativeHandle(s,()=>({collapse:()=>{x(j.current)},expand:Y=>{_(j.current,Y)},getId(){return B},getSize(){return b(j.current)},isCollapsed(){return k(j.current)},isExpanded(){return!k(j.current)},resize:Y=>{P(j.current,Y)}}),[x,_,b,k,B,P]);const J=C(j.current,i);return D.createElement(g,{...E,children:t,className:e,id:B,style:{...J,...p},[je.groupId]:w,[je.panel]:"",[je.panelCollapsible]:r||void 0,[je.panelId]:B,[je.panelSize]:parseFloat(""+J.flexGrow).toFixed(1)})}const oh=D.forwardRef((t,e)=>D.createElement(ah,{...t,forwardedRef:e}));ah.displayName="Panel";oh.displayName="forwardRef(Panel)";let da=null,pi=-1,qt=null;function iw(t,e){if(e){const n=(e&fh)!==0,r=(e&hh)!==0,i=(e&ph)!==0,s=(e&mh)!==0;if(n)return i?"se-resize":s?"ne-resize":"e-resize";if(r)return i?"sw-resize":s?"nw-resize":"w-resize";if(i)return"s-resize";if(s)return"n-resize"}switch(t){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function sw(){qt!==null&&(document.head.removeChild(qt),da=null,qt=null,pi=-1)}function Ns(t,e){var n,r;const i=iw(t,e);if(da!==i){if(da=i,qt===null&&(qt=document.createElement("style"),document.head.appendChild(qt)),pi>=0){var s;(s=qt.sheet)===null||s===void 0||s.removeRule(pi)}pi=(n=(r=qt.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${i} !important;}`))!==null&&n!==void 0?n:-1}}function uh(t){return t.type==="keydown"}function lh(t){return t.type.startsWith("pointer")}function ch(t){return t.type.startsWith("mouse")}function Qi(t){if(lh(t)){if(t.isPrimary)return{x:t.clientX,y:t.clientY}}else if(ch(t))return{x:t.clientX,y:t.clientY};return{x:1/0,y:1/0}}function aw(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function ow(t,e,n){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}function uw(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:ml(t),b:ml(e)};let r;for(;n.a.at(-1)===n.b.at(-1);)t=n.a.pop(),e=n.b.pop(),r=t;me(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:pl(hl(n.a)),b:pl(hl(n.b))};if(i.a===i.b){const s=r.childNodes,a={a:n.a.at(-1),b:n.b.at(-1)};let o=s.length;for(;o--;){const u=s[o];if(u===a.a)return 1;if(u===a.b)return-1}}return Math.sign(i.a-i.b)}const lw=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function cw(t){var e;const n=getComputedStyle((e=dh(t))!==null&&e!==void 0?e:t).display;return n==="flex"||n==="inline-flex"}function dw(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||cw(t))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||lw.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function hl(t){let e=t.length;for(;e--;){const n=t[e];if(me(n,"Missing node"),dw(n))return n}return null}function pl(t){return t&&Number(getComputedStyle(t).zIndex)||0}function ml(t){const e=[];for(;t;)e.push(t),t=dh(t);return e}function dh(t){const{parentNode:e}=t;return e&&e instanceof ShadowRoot?e.host:e}const fh=1,hh=2,ph=4,mh=8,fw=aw()==="coarse";let kt=[],Ln=!1,on=new Map,Xi=new Map;const Or=new Set;function hw(t,e,n,r,i){var s;const{ownerDocument:a}=e,o={direction:n,element:e,hitAreaMargins:r,setResizeHandlerState:i},u=(s=on.get(a))!==null&&s!==void 0?s:0;return on.set(a,u+1),Or.add(o),wi(),function(){var d;Xi.delete(t),Or.delete(o);const c=(d=on.get(a))!==null&&d!==void 0?d:1;if(on.set(a,c-1),wi(),c===1&&on.delete(a),kt.includes(o)){const h=kt.indexOf(o);h>=0&&kt.splice(h,1),ao(),i("up",!0,null)}}}function pw(t){const{target:e}=t,{x:n,y:r}=Qi(t);Ln=!0,so({target:e,x:n,y:r}),wi(),kt.length>0&&(vi("down",t),t.preventDefault(),gh(e)||t.stopImmediatePropagation())}function ws(t){const{x:e,y:n}=Qi(t);if(Ln&&t.buttons===0&&(Ln=!1,vi("up",t)),!Ln){const{target:r}=t;so({target:r,x:e,y:n})}vi("move",t),ao(),kt.length>0&&t.preventDefault()}function vs(t){const{target:e}=t,{x:n,y:r}=Qi(t);Xi.clear(),Ln=!1,kt.length>0&&(t.preventDefault(),gh(e)||t.stopImmediatePropagation()),vi("up",t),so({target:e,x:n,y:r}),ao(),wi()}function gh(t){let e=t;for(;e;){if(e.hasAttribute(je.resizeHandle))return!0;e=e.parentElement}return!1}function so({target:t,x:e,y:n}){kt.splice(0);let r=null;(t instanceof HTMLElement||t instanceof SVGElement)&&(r=t),Or.forEach(i=>{const{element:s,hitAreaMargins:a}=i,o=s.getBoundingClientRect(),{bottom:u,left:l,right:d,top:c}=o,h=fw?a.coarse:a.fine;if(e>=l-h&&e<=d+h&&n>=c-h&&n<=u+h){if(r!==null&&document.contains(r)&&s!==r&&!s.contains(r)&&!r.contains(s)&&uw(r,s)>0){let g=r,E=!1;for(;g&&!g.contains(s);){if(ow(g.getBoundingClientRect(),o)){E=!0;break}g=g.parentElement}if(E)return}kt.push(i)}})}function Rs(t,e){Xi.set(t,e)}function ao(){let t=!1,e=!1;kt.forEach(r=>{const{direction:i}=r;i==="horizontal"?t=!0:e=!0});let n=0;Xi.forEach(r=>{n|=r}),t&&e?Ns("intersection",n):t?Ns("horizontal",n):e?Ns("vertical",n):sw()}let Os=new AbortController;function wi(){Os.abort(),Os=new AbortController;const t={capture:!0,signal:Os.signal};Or.size&&(Ln?(kt.length>0&&on.forEach((e,n)=>{const{body:r}=n;e>0&&(r.addEventListener("contextmenu",vs,t),r.addEventListener("pointerleave",ws,t),r.addEventListener("pointermove",ws,t))}),window.addEventListener("pointerup",vs,t),window.addEventListener("pointercancel",vs,t)):on.forEach((e,n)=>{const{body:r}=n;e>0&&(r.addEventListener("pointerdown",pw,t),r.addEventListener("pointermove",ws,t))}))}function vi(t,e){Or.forEach(n=>{const{setResizeHandlerState:r}=n,i=kt.includes(n);r(t,i,e)})}function mw(){const[t,e]=D.useState(0);return D.useCallback(()=>e(n=>n+1),[])}function me(t,e){if(!t)throw console.error(e),Error(e)}function bn(t,e,n=ro){return t.toFixed(n)===e.toFixed(n)?0:t>e?1:-1}function Mt(t,e,n=ro){return bn(t,e,n)===0}function ht(t,e,n){return bn(t,e,n)===0}function gw(t,e,n){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++){const i=t[r],s=e[r];if(!ht(i,s,n))return!1}return!0}function Rn({panelConstraints:t,panelIndex:e,size:n}){const r=t[e];me(r!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:i=0,collapsible:s,maxSize:a=100,minSize:o=0}=r;if(bn(n,o)<0)if(s){const u=(i+o)/2;bn(n,u)<0?n=i:n=o}else n=o;return n=Math.min(a,n),n=parseFloat(n.toFixed(ro)),n}function dr({delta:t,initialLayout:e,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:s}){if(ht(t,0))return e;const a=[...e],[o,u]=r;me(o!=null,"Invalid first pivot index"),me(u!=null,"Invalid second pivot index");let l=0;if(s==="keyboard"){{const c=t<0?u:o,h=n[c];me(h,`Panel constraints not found for index ${c}`);const{collapsedSize:p=0,collapsible:g,minSize:E=0}=h;if(g){const T=e[c];if(me(T!=null,`Previous layout not found for panel index ${c}`),ht(T,p)){const x=E-T;bn(x,Math.abs(t))>0&&(t=t<0?0-x:x)}}}{const c=t<0?o:u,h=n[c];me(h,`No panel constraints found for index ${c}`);const{collapsedSize:p=0,collapsible:g,minSize:E=0}=h;if(g){const T=e[c];if(me(T!=null,`Previous layout not found for panel index ${c}`),ht(T,E)){const x=T-p;bn(x,Math.abs(t))>0&&(t=t<0?0-x:x)}}}}{const c=t<0?1:-1;let h=t<0?u:o,p=0;for(;;){const E=e[h];me(E!=null,`Previous layout not found for panel index ${h}`);const x=Rn({panelConstraints:n,panelIndex:h,size:100})-E;if(p+=x,h+=c,h<0||h>=n.length)break}const g=Math.min(Math.abs(t),Math.abs(p));t=t<0?0-g:g}{let h=t<0?o:u;for(;h>=0&&h<n.length;){const p=Math.abs(t)-Math.abs(l),g=e[h];me(g!=null,`Previous layout not found for panel index ${h}`);const E=g-p,T=Rn({panelConstraints:n,panelIndex:h,size:E});if(!ht(g,T)&&(l+=g-T,a[h]=T,l.toPrecision(3).localeCompare(Math.abs(t).toPrecision(3),void 0,{numeric:!0})>=0))break;t<0?h--:h++}}if(gw(i,a))return i;{const c=t<0?u:o,h=e[c];me(h!=null,`Previous layout not found for panel index ${c}`);const p=h+l,g=Rn({panelConstraints:n,panelIndex:c,size:p});if(a[c]=g,!ht(g,p)){let E=p-g,x=t<0?u:o;for(;x>=0&&x<n.length;){const _=a[x];me(_!=null,`Previous layout not found for panel index ${x}`);const b=_+E,C=Rn({panelConstraints:n,panelIndex:x,size:b});if(ht(_,C)||(E-=C-_,a[x]=C),ht(E,0))break;t>0?x--:x++}}}const d=a.reduce((c,h)=>h+c,0);return ht(d,100)?a:i}function bw({layout:t,panelsArray:e,pivotIndices:n}){let r=0,i=100,s=0,a=0;const o=n[0];me(o!=null,"No pivot index found"),e.forEach((c,h)=>{const{constraints:p}=c,{maxSize:g=100,minSize:E=0}=p;h===o?(r=E,i=g):(s+=E,a+=g)});const u=Math.min(i,100-s),l=Math.max(r,100-a),d=t[o];return{valueMax:u,valueMin:l,valueNow:d}}function Lr(t,e=document){return Array.from(e.querySelectorAll(`[${je.resizeHandleId}][data-panel-group-id="${t}"]`))}function bh(t,e,n=document){const i=Lr(t,n).findIndex(s=>s.getAttribute(je.resizeHandleId)===e);return i??null}function Eh(t,e,n){const r=bh(t,e,n);return r!=null?[r,r+1]:[-1,-1]}function xh(t,e=document){var n;if(e instanceof HTMLElement&&(e==null||(n=e.dataset)===null||n===void 0?void 0:n.panelGroupId)==t)return e;const r=e.querySelector(`[data-panel-group][data-panel-group-id="${t}"]`);return r||null}function Ji(t,e=document){const n=e.querySelector(`[${je.resizeHandleId}="${t}"]`);return n||null}function Ew(t,e,n,r=document){var i,s,a,o;const u=Ji(e,r),l=Lr(t,r),d=u?l.indexOf(u):-1,c=(i=(s=n[d])===null||s===void 0?void 0:s.id)!==null&&i!==void 0?i:null,h=(a=(o=n[d+1])===null||o===void 0?void 0:o.id)!==null&&a!==void 0?a:null;return[c,h]}function xw({committedValuesRef:t,eagerValuesRef:e,groupId:n,layout:r,panelDataArray:i,panelGroupElement:s,setLayout:a}){D.useRef({didWarnAboutMissingResizeHandle:!1}),fn(()=>{if(!s)return;const o=Lr(n,s);for(let u=0;u<i.length-1;u++){const{valueMax:l,valueMin:d,valueNow:c}=bw({layout:r,panelsArray:i,pivotIndices:[u,u+1]}),h=o[u];if(h!=null){const p=i[u];me(p,`No panel data found for index "${u}"`),h.setAttribute("aria-controls",p.id),h.setAttribute("aria-valuemax",""+Math.round(l)),h.setAttribute("aria-valuemin",""+Math.round(d)),h.setAttribute("aria-valuenow",c!=null?""+Math.round(c):"")}}return()=>{o.forEach((u,l)=>{u.removeAttribute("aria-controls"),u.removeAttribute("aria-valuemax"),u.removeAttribute("aria-valuemin"),u.removeAttribute("aria-valuenow")})}},[n,r,i,s]),D.useEffect(()=>{if(!s)return;const o=e.current;me(o,"Eager values not found");const{panelDataArray:u}=o,l=xh(n,s);me(l!=null,`No group found for id "${n}"`);const d=Lr(n,s);me(d,`No resize handles found for group id "${n}"`);const c=d.map(h=>{const p=h.getAttribute(je.resizeHandleId);me(p,"Resize handle element has no handle id attribute");const[g,E]=Ew(n,p,u,s);if(g==null||E==null)return()=>{};const T=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const _=u.findIndex(b=>b.id===g);if(_>=0){const b=u[_];me(b,`No panel data found for index ${_}`);const C=r[_],{collapsedSize:w=0,collapsible:k,minSize:v=0}=b.constraints;if(C!=null&&k){const O=dr({delta:ht(C,w)?v-w:w-C,initialLayout:r,panelConstraints:u.map(P=>P.constraints),pivotIndices:Eh(n,p,s),prevLayout:r,trigger:"keyboard"});r!==O&&a(O)}}break}}};return h.addEventListener("keydown",T),()=>{h.removeEventListener("keydown",T)}});return()=>{c.forEach(h=>h())}},[s,t,e,n,r,i,a])}function gl(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function Th(t,e){const n=t==="horizontal",{x:r,y:i}=Qi(e);return n?r:i}function Tw(t,e,n,r,i){const s=n==="horizontal",a=Ji(e,i);me(a,`No resize handle element found for id "${e}"`);const o=a.getAttribute(je.groupId);me(o,"Resize handle element has no group id attribute");let{initialCursorPosition:u}=r;const l=Th(n,t),d=xh(o,i);me(d,`No group element found for id "${o}"`);const c=d.getBoundingClientRect(),h=s?c.width:c.height;return(l-u)/h*100}function _w(t,e,n,r,i,s){if(uh(t)){const a=n==="horizontal";let o=0;t.shiftKey?o=100:i!=null?o=i:o=10;let u=0;switch(t.key){case"ArrowDown":u=a?0:o;break;case"ArrowLeft":u=a?-o:0;break;case"ArrowRight":u=a?o:0;break;case"ArrowUp":u=a?0:-o;break;case"End":u=100;break;case"Home":u=-100;break}return u}else return r==null?0:Tw(t,e,n,r,s)}function yw({panelDataArray:t}){const e=Array(t.length),n=t.map(s=>s.constraints);let r=0,i=100;for(let s=0;s<t.length;s++){const a=n[s];me(a,`Panel constraints not found for index ${s}`);const{defaultSize:o}=a;o!=null&&(r++,e[s]=o,i-=o)}for(let s=0;s<t.length;s++){const a=n[s];me(a,`Panel constraints not found for index ${s}`);const{defaultSize:o}=a;if(o!=null)continue;const u=t.length-r,l=i/u;r++,e[s]=l,i-=l}return e}function Sn(t,e,n){e.forEach((r,i)=>{const s=t[i];me(s,`Panel data not found for index ${i}`);const{callbacks:a,constraints:o,id:u}=s,{collapsedSize:l=0,collapsible:d}=o,c=n[u];if(c==null||r!==c){n[u]=r;const{onCollapse:h,onExpand:p,onResize:g}=a;g&&g(r,c),d&&(h||p)&&(p&&(c==null||Mt(c,l))&&!Mt(r,l)&&p(),h&&(c==null||!Mt(c,l))&&Mt(r,l)&&h())}})}function si(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n])return!1;return!0}function kw({defaultSize:t,dragState:e,layout:n,panelData:r,panelIndex:i,precision:s=3}){const a=n[i];let o;return a==null?o=t!=null?t.toPrecision(s):"1":r.length===1?o="1":o=a.toPrecision(s),{flexBasis:0,flexGrow:o,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function Aw(t,e=10){let n=null;return(...i)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...i)},e)}}function bl(t){try{if(typeof localStorage<"u")t.getItem=e=>localStorage.getItem(e),t.setItem=(e,n)=>{localStorage.setItem(e,n)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),t.getItem=()=>null,t.setItem=()=>{}}}function _h(t){return`react-resizable-panels:${t}`}function yh(t){return t.map(e=>{const{constraints:n,id:r,idIsFromProps:i,order:s}=e;return i?r:s?`${s}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((e,n)=>e.localeCompare(n)).join(",")}function kh(t,e){try{const n=_h(t),r=e.getItem(n);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function Sw(t,e,n){var r,i;const s=(r=kh(t,n))!==null&&r!==void 0?r:{},a=yh(e);return(i=s[a])!==null&&i!==void 0?i:null}function Cw(t,e,n,r,i){var s;const a=_h(t),o=yh(e),u=(s=kh(t,i))!==null&&s!==void 0?s:{};u[o]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{i.setItem(a,JSON.stringify(u))}catch(l){console.error(l)}}function El({layout:t,panelConstraints:e}){const n=[...t],r=n.reduce((s,a)=>s+a,0);if(n.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${n.map(s=>`${s}%`).join(", ")}`);if(!ht(r,100)&&n.length>0)for(let s=0;s<e.length;s++){const a=n[s];me(a!=null,`No layout data found for index ${s}`);const o=100/r*a;n[s]=o}let i=0;for(let s=0;s<e.length;s++){const a=n[s];me(a!=null,`No layout data found for index ${s}`);const o=Rn({panelConstraints:e,panelIndex:s,size:a});a!=o&&(i+=a-o,n[s]=o)}if(!ht(i,0))for(let s=0;s<e.length;s++){const a=n[s];me(a!=null,`No layout data found for index ${s}`);const o=a+i,u=Rn({panelConstraints:e,panelIndex:s,size:o});if(a!==u&&(i-=u-a,n[s]=u,ht(i,0)))break}return n}const Iw=100,fr={getItem:t=>(bl(fr),fr.getItem(t)),setItem:(t,e)=>{bl(fr),fr.setItem(t,e)}},xl={};function Ah({autoSaveId:t=null,children:e,className:n="",direction:r,forwardedRef:i,id:s=null,onLayout:a=null,keyboardResizeBy:o=null,storage:u=fr,style:l,tagName:d="div",...c}){const h=io(s),p=D.useRef(null),[g,E]=D.useState(null),[T,x]=D.useState([]),_=mw(),b=D.useRef({}),C=D.useRef(new Map),w=D.useRef(0),k=D.useRef({autoSaveId:t,direction:r,dragState:g,id:h,keyboardResizeBy:o,onLayout:a,storage:u}),v=D.useRef({layout:T,panelDataArray:[],panelDataArrayChanged:!1});D.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),D.useImperativeHandle(i,()=>({getId:()=>k.current.id,getLayout:()=>{const{layout:A}=v.current;return A},setLayout:A=>{const{onLayout:te}=k.current,{layout:ie,panelDataArray:K}=v.current,ee=El({layout:A,panelConstraints:K.map(re=>re.constraints)});gl(ie,ee)||(x(ee),v.current.layout=ee,te&&te(ee),Sn(K,ee,b.current))}}),[]),fn(()=>{k.current.autoSaveId=t,k.current.direction=r,k.current.dragState=g,k.current.id=h,k.current.onLayout=a,k.current.storage=u}),xw({committedValuesRef:k,eagerValuesRef:v,groupId:h,layout:T,panelDataArray:v.current.panelDataArray,setLayout:x,panelGroupElement:p.current}),D.useEffect(()=>{const{panelDataArray:A}=v.current;if(t){if(T.length===0||T.length!==A.length)return;let te=xl[t];te==null&&(te=Aw(Cw,Iw),xl[t]=te);const ie=[...A],K=new Map(C.current);te(t,ie,K,T,u)}},[t,T,u]),D.useEffect(()=>{});const O=D.useCallback(A=>{const{onLayout:te}=k.current,{layout:ie,panelDataArray:K}=v.current;if(A.constraints.collapsible){const ee=K.map(Pe=>Pe.constraints),{collapsedSize:re=0,panelSize:le,pivotIndices:be}=sn(K,A,ie);if(me(le!=null,`Panel size not found for panel "${A.id}"`),!Mt(le,re)){C.current.set(A.id,le);const $e=wn(K,A)===K.length-1?le-re:re-le,ke=dr({delta:$e,initialLayout:ie,panelConstraints:ee,pivotIndices:be,prevLayout:ie,trigger:"imperative-api"});si(ie,ke)||(x(ke),v.current.layout=ke,te&&te(ke),Sn(K,ke,b.current))}}},[]),P=D.useCallback((A,te)=>{const{onLayout:ie}=k.current,{layout:K,panelDataArray:ee}=v.current;if(A.constraints.collapsible){const re=ee.map(qe=>qe.constraints),{collapsedSize:le=0,panelSize:be=0,minSize:Pe=0,pivotIndices:$e}=sn(ee,A,K),ke=te??Pe;if(Mt(be,le)){const qe=C.current.get(A.id),Ze=qe!=null&&qe>=ke?qe:ke,_n=wn(ee,A)===ee.length-1?be-Ze:Ze-be,Ge=dr({delta:_n,initialLayout:K,panelConstraints:re,pivotIndices:$e,prevLayout:K,trigger:"imperative-api"});si(K,Ge)||(x(Ge),v.current.layout=Ge,ie&&ie(Ge),Sn(ee,Ge,b.current))}}},[]),R=D.useCallback(A=>{const{layout:te,panelDataArray:ie}=v.current,{panelSize:K}=sn(ie,A,te);return me(K!=null,`Panel size not found for panel "${A.id}"`),K},[]),B=D.useCallback((A,te)=>{const{panelDataArray:ie}=v.current,K=wn(ie,A);return kw({defaultSize:te,dragState:g,layout:T,panelData:ie,panelIndex:K})},[g,T]),j=D.useCallback(A=>{const{layout:te,panelDataArray:ie}=v.current,{collapsedSize:K=0,collapsible:ee,panelSize:re}=sn(ie,A,te);return me(re!=null,`Panel size not found for panel "${A.id}"`),ee===!0&&Mt(re,K)},[]),J=D.useCallback(A=>{const{layout:te,panelDataArray:ie}=v.current,{collapsedSize:K=0,collapsible:ee,panelSize:re}=sn(ie,A,te);return me(re!=null,`Panel size not found for panel "${A.id}"`),!ee||bn(re,K)>0},[]),Y=D.useCallback(A=>{const{panelDataArray:te}=v.current;te.push(A),te.sort((ie,K)=>{const ee=ie.order,re=K.order;return ee==null&&re==null?0:ee==null?-1:re==null?1:ee-re}),v.current.panelDataArrayChanged=!0,_()},[_]);fn(()=>{if(v.current.panelDataArrayChanged){v.current.panelDataArrayChanged=!1;const{autoSaveId:A,onLayout:te,storage:ie}=k.current,{layout:K,panelDataArray:ee}=v.current;let re=null;if(A){const be=Sw(A,ee,ie);be&&(C.current=new Map(Object.entries(be.expandToSizes)),re=be.layout)}re==null&&(re=yw({panelDataArray:ee}));const le=El({layout:re,panelConstraints:ee.map(be=>be.constraints)});gl(K,le)||(x(le),v.current.layout=le,te&&te(le),Sn(ee,le,b.current))}}),fn(()=>{const A=v.current;return()=>{A.layout=[]}},[]);const H=D.useCallback(A=>{let te=!1;const ie=p.current;return ie&&window.getComputedStyle(ie,null).getPropertyValue("direction")==="rtl"&&(te=!0),function(ee){ee.preventDefault();const re=p.current;if(!re)return()=>null;const{direction:le,dragState:be,id:Pe,keyboardResizeBy:$e,onLayout:ke}=k.current,{layout:qe,panelDataArray:Ze}=v.current,{initialLayout:Jt}=be??{},_n=Eh(Pe,A,re);let Ge=_w(ee,A,le,be,$e,re);const Wn=le==="horizontal";Wn&&te&&(Ge=-Ge);const Wr=Ze.map(es=>es.constraints),en=dr({delta:Ge,initialLayout:Jt??qe,panelConstraints:Wr,pivotIndices:_n,prevLayout:qe,trigger:uh(ee)?"keyboard":"mouse-or-touch"}),Gr=!si(qe,en);(lh(ee)||ch(ee))&&w.current!=Ge&&(w.current=Ge,!Gr&&Ge!==0?Wn?Rs(A,Ge<0?fh:hh):Rs(A,Ge<0?ph:mh):Rs(A,0)),Gr&&(x(en),v.current.layout=en,ke&&ke(en),Sn(Ze,en,b.current))}},[]),Q=D.useCallback((A,te)=>{const{onLayout:ie}=k.current,{layout:K,panelDataArray:ee}=v.current,re=ee.map(qe=>qe.constraints),{panelSize:le,pivotIndices:be}=sn(ee,A,K);me(le!=null,`Panel size not found for panel "${A.id}"`);const $e=wn(ee,A)===ee.length-1?le-te:te-le,ke=dr({delta:$e,initialLayout:K,panelConstraints:re,pivotIndices:be,prevLayout:K,trigger:"imperative-api"});si(K,ke)||(x(ke),v.current.layout=ke,ie&&ie(ke),Sn(ee,ke,b.current))},[]),ue=D.useCallback((A,te)=>{const{layout:ie,panelDataArray:K}=v.current,{collapsedSize:ee=0,collapsible:re}=te,{collapsedSize:le=0,collapsible:be,maxSize:Pe=100,minSize:$e=0}=A.constraints,{panelSize:ke}=sn(K,A,ie);ke!=null&&(re&&be&&Mt(ke,ee)?Mt(ee,le)||Q(A,le):ke<$e?Q(A,$e):ke>Pe&&Q(A,Pe))},[Q]),ce=D.useCallback((A,te)=>{const{direction:ie}=k.current,{layout:K}=v.current;if(!p.current)return;const ee=Ji(A,p.current);me(ee,`Drag handle element not found for id "${A}"`);const re=Th(ie,te);E({dragHandleId:A,dragHandleRect:ee.getBoundingClientRect(),initialCursorPosition:re,initialLayout:K})},[]),fe=D.useCallback(()=>{E(null)},[]),N=D.useCallback(A=>{const{panelDataArray:te}=v.current,ie=wn(te,A);ie>=0&&(te.splice(ie,1),delete b.current[A.id],v.current.panelDataArrayChanged=!0,_())},[_]),V=D.useMemo(()=>({collapsePanel:O,direction:r,dragState:g,expandPanel:P,getPanelSize:R,getPanelStyle:B,groupId:h,isPanelCollapsed:j,isPanelExpanded:J,reevaluatePanelConstraints:ue,registerPanel:Y,registerResizeHandle:H,resizePanel:Q,startDragging:ce,stopDragging:fe,unregisterPanel:N,panelGroupElement:p.current}),[O,g,r,P,R,B,h,j,J,ue,Y,H,Q,ce,fe,N]),se={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return D.createElement(Ki.Provider,{value:V},D.createElement(d,{...c,children:e,className:n,id:s,ref:p,style:{...se,...l},[je.group]:"",[je.groupDirection]:r,[je.groupId]:h}))}const Sh=D.forwardRef((t,e)=>D.createElement(Ah,{...t,forwardedRef:e}));Ah.displayName="PanelGroup";Sh.displayName="forwardRef(PanelGroup)";function wn(t,e){return t.findIndex(n=>n===e||n.id===e.id)}function sn(t,e,n){const r=wn(t,e),s=r===t.length-1?[r-1,r]:[r,r+1],a=n[r];return{...e.constraints,panelSize:a,pivotIndices:s}}function Nw({disabled:t,handleId:e,resizeHandler:n,panelGroupElement:r}){D.useEffect(()=>{if(t||n==null||r==null)return;const i=Ji(e,r);if(i==null)return;const s=a=>{if(!a.defaultPrevented)switch(a.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{a.preventDefault(),n(a);break}case"F6":{a.preventDefault();const o=i.getAttribute(je.groupId);me(o,`No group element found for id "${o}"`);const u=Lr(o,r),l=bh(o,e,r);me(l!==null,`No resize element found for id "${e}"`);const d=a.shiftKey?l>0?l-1:u.length-1:l+1<u.length?l+1:0;u[d].focus();break}}};return i.addEventListener("keydown",s),()=>{i.removeEventListener("keydown",s)}},[r,t,e,n])}function Ch({children:t=null,className:e="",disabled:n=!1,hitAreaMargins:r,id:i,onBlur:s,onClick:a,onDragging:o,onFocus:u,onPointerDown:l,onPointerUp:d,style:c={},tabIndex:h=0,tagName:p="div",...g}){var E,T;const x=D.useRef(null),_=D.useRef({onClick:a,onDragging:o,onPointerDown:l,onPointerUp:d});D.useEffect(()=>{_.current.onClick=a,_.current.onDragging=o,_.current.onPointerDown=l,_.current.onPointerUp=d});const b=D.useContext(Ki);if(b===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:C,groupId:w,registerResizeHandle:k,startDragging:v,stopDragging:O,panelGroupElement:P}=b,R=io(i),[B,j]=D.useState("inactive"),[J,Y]=D.useState(!1),[H,Q]=D.useState(null),ue=D.useRef({state:B});fn(()=>{ue.current.state=B}),D.useEffect(()=>{if(n)Q(null);else{const V=k(R);Q(()=>V)}},[n,R,k]);const ce=(E=r?.coarse)!==null&&E!==void 0?E:15,fe=(T=r?.fine)!==null&&T!==void 0?T:5;D.useEffect(()=>{if(n||H==null)return;const V=x.current;me(V,"Element ref not attached");let se=!1;return hw(R,V,C,{coarse:ce,fine:fe},(te,ie,K)=>{if(!ie){j("inactive");return}switch(te){case"down":{j("drag"),se=!1,me(K,'Expected event to be defined for "down" action'),v(R,K);const{onDragging:ee,onPointerDown:re}=_.current;ee?.(!0),re?.();break}case"move":{const{state:ee}=ue.current;se=!0,ee!=="drag"&&j("hover"),me(K,'Expected event to be defined for "move" action'),H(K);break}case"up":{j("hover"),O();const{onClick:ee,onDragging:re,onPointerUp:le}=_.current;re?.(!1),le?.(),se||ee?.();break}}})},[ce,C,n,fe,k,R,H,v,O]),Nw({disabled:n,handleId:R,resizeHandler:H,panelGroupElement:P});const N={touchAction:"none",userSelect:"none"};return D.createElement(p,{...g,children:t,className:e,id:i,onBlur:()=>{Y(!1),s?.()},onFocus:()=>{Y(!0),u?.()},ref:x,role:"separator",style:{...N,...c},tabIndex:h,[je.groupDirection]:C,[je.groupId]:w,[je.resizeHandle]:"",[je.resizeHandleActive]:B==="drag"?"pointer":J?"keyboard":void 0,[je.resizeHandleEnabled]:!n,[je.resizeHandleId]:R,[je.resizeHandleState]:B})}Ch.displayName="PanelResizeHandle";function ww(t){const e=F.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=X("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx(Sh,{"data-slot":"resizable-panel-group",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function Ih(t){const e=F.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(oh,{"data-slot":"resizable-panel",...n}),e[2]=n,e[3]=r):r=e[3],r}function vw(t){const e=F.c(12);let n,r,i;e[0]!==t?({withHandle:i,className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);let s;e[4]!==n?(s=X("bg-border focus-visible:ring-ring relative flex w-[0.5px] items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",n),e[4]=n,e[5]=s):s=e[5];let a;e[6]!==i?(a=i&&m.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:m.jsx(xE,{className:"size-2.5"})}),e[6]=i,e[7]=a):a=e[7];let o;return e[8]!==r||e[9]!==s||e[10]!==a?(o=m.jsx(Ch,{"data-slot":"resizable-handle",className:s,...r,children:a}),e[8]=r,e[9]=s,e[10]=a,e[11]=o):o=e[11],o}function Nh(){const t=F.c(6),{toggleSidebar:e}=to();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsx(ge,{name:"dock_to_right",className:"text-muted-foreground",size:20}),t[0]=n):n=t[0];let r;t[1]!==e?(r=m.jsx(ut,{onClick:e,size:"icon",variant:"ghost",className:"w-8 h-8 rounded-md",children:n}),t[1]=e,t[2]=r):r=t[2];let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsx("div",{className:"h-8 w-px bg-border"}),t[3]=i):i=t[3];let s;return t[4]!==r?(s=m.jsxs(m.Fragment,{children:[r,i]}),t[4]=r,t[5]=s):s=t[5],s}Nh.Skeleton=function(){return m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"w-8 h-8 bg-muted rounded-md animate-pulse"}),m.jsx("div",{className:"h-8 w-px bg-border"})]})};const Rw="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png";function Tl(t){const e=F.c(18),{showSidebarToggle:n,showOrgSwitcher:r,showDecoChat:i}=t,s=n===void 0?!1:n,a=r===void 0?!1:r,o=i===void 0?!1:i,[,u]=Oi();let l;e[0]!==u?(l=()=>u(Ow),e[0]=u,e[1]=l):l=e[1];const d=l;let c;e[2]!==s?(c=s&&m.jsx(Nh,{}),e[2]=s,e[3]=c):c=e[3];let h;e[4]!==a?(h=a&&m.jsx(D.Suspense,{fallback:m.jsx(ca.Skeleton,{}),children:m.jsx(ca,{})}),e[4]=a,e[5]=h):h=e[5];let p;e[6]!==c||e[7]!==h?(p=m.jsxs(Is.Left,{children:[c,h]}),e[6]=c,e[7]=h,e[8]=p):p=e[8];let g;e[9]!==o||e[10]!==d?(g=o&&m.jsxs(ut,{size:"sm",variant:"default",onClick:d,children:[m.jsx(Un,{url:Rw,fallback:"DC",size:"2xs",className:"rounded-sm"}),"deco chat"]}),e[9]=o,e[10]=d,e[11]=g):g=e[11];let E;e[12]===Symbol.for("react.memo_cache_sentinel")?(E=m.jsx(GN,{}),e[12]=E):E=e[12];let T;e[13]!==g?(T=m.jsxs(Is.Right,{className:"gap-2",children:[g,E]}),e[13]=g,e[14]=T):T=e[14];let x;return e[15]!==T||e[16]!==p?(x=m.jsxs(Is,{children:[p,T]}),e[15]=T,e[16]=p,e[17]=x):x=e[17],x}function Ow(t){return!t}function Lw(t){const e=F.c(10),{children:n,className:r}=t,[,i]=D.useTransition();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=Br.decoChatPanelWidth(),e[0]=s):s=e[0];const[a,o]=Dn(s,30);let u;e[1]!==o?(u=h=>i(()=>o(h)),e[1]=o,e[2]=u):u=e[2];const l=u;let d;e[3]!==r?(d=X("min-w-0",r),e[3]=r,e[4]=d):d=e[4];let c;return e[5]!==a||e[6]!==n||e[7]!==l||e[8]!==d?(c=m.jsx(Ih,{defaultSize:a,minSize:20,className:d,onResize:l,children:n}),e[5]=a,e[6]=n,e[7]=l,e[8]=d,e[9]=c):c=e[9],c}function Dw(t){const e=F.c(5),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=Br.sidebarOpen(),e[0]=r):r=e[0];const[i,s]=Dn(r,!0);let a;return e[1]!==n||e[2]!==s||e[3]!==i?(a=m.jsx(QI,{open:i,onOpenChange:s,children:n}),e[1]=n,e[2]=s,e[3]=i,e[4]=a):a=e[4],a}function Pw(){const t=F.c(9),[e]=Oi();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsx(Ih,{className:"bg-background",children:m.jsx(wl,{})}),t[0]=n):n=t[0];let r;t[1]!==e?(r=m.jsx(vw,{withHandle:e}),t[1]=e,t[2]=r):r=t[2];const i=e?"max-w-none":"max-w-0";let s;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx(Ps,{children:m.jsx(D.Suspense,{fallback:m.jsx(tw,{}),children:m.jsx(BI,{})})}),t[3]=s):s=t[3];let a;t[4]!==i?(a=m.jsx(Lw,{className:i,children:s}),t[4]=i,t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==a?(o=m.jsxs(ww,{direction:"horizontal",children:[n,r,a]}),t[6]=r,t[7]=a,t[8]=o):o=t[8],o}function Mw(){const t=F.c(19);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:n}=Il(e);let r;t[1]!==n?(r=ot.activeOrganization(n),t[1]=n,t[2]=r):r=t[2];let i;t[3]!==n?(i=async()=>{if(!n)return null;const{data:p}=await Mr.organization.setActive({organizationSlug:n});return{org:p,project:{slug:vp}}},t[3]=n,t[4]=i):i=t[4];let s;t[5]!==r||t[6]!==i?(s={queryKey:r,queryFn:i,gcTime:1/0,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1},t[5]=r,t[6]=i,t[7]=s):s=t[7];const{data:a}=ga(s);if(!a){let p;t[8]===Symbol.for("react.memo_cache_sentinel")?(p=m.jsx(Tl,{}),t[8]=p):p=t[8];let g;return t[9]===Symbol.for("react.memo_cache_sentinel")?(g=m.jsxs("div",{className:"min-h-screen bg-background",children:[p,m.jsx("div",{className:"pt-12",children:m.jsx(wl,{})})]}),t[9]=g):g=t[9],g}let o;t[10]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx(Tl,{showSidebarToggle:!0,showOrgSwitcher:!0,showDecoChat:!0}),t[10]=o):o=t[10];let u;t[11]===Symbol.for("react.memo_cache_sentinel")?(u={"--sidebar-width":"13rem","--sidebar-width-mobile":"11rem"},t[11]=u):u=t[11];let l;t[12]===Symbol.for("react.memo_cache_sentinel")?(l=m.jsx(TN,{}),t[12]=l):l=t[12];let d;t[13]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsx(Dw,{children:m.jsxs("div",{className:"flex flex-col h-screen",children:[o,m.jsxs(eN,{className:"flex-1 bg-sidebar",style:u,children:[l,m.jsx(nN,{className:"pt-12",children:m.jsx(Pw,{})})]})]})}),t[13]=d):d=t[13];let c;t[14]!==a.org.slug?(c=m.jsx(qE,{children:d},a.org.slug),t[14]=a.org.slug,t[15]=c):c=t[15];let h;return t[16]!==a||t[17]!==c?(h=m.jsx(wp,{...a,children:c}),t[16]=a,t[17]=c,t[18]=h):h=t[18],h}function d4(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx(KN,{children:m.jsx(D.Suspense,{fallback:m.jsx(Nl,{}),children:m.jsx(Mw,{})})}),t[0]=e):e=t[0],e}export{d4 as default};
|