@portkey-ai/hoot 0.14.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,400 @@
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))i(a);new MutationObserver(a=>{for(const u of a)if(u.type==="childList")for(const o of u.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(a){const u={};return a.integrity&&(u.integrity=a.integrity),a.referrerPolicy&&(u.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?u.credentials="include":a.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function i(a){if(a.ep)return;a.ep=!0;const u=n(a);fetch(a.href,u)}})();window.process={env:{}};var kg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function bc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function jk(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function i(){var a=!1;try{a=this instanceof i}catch{}return a?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(i){var a=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(n,i,a.get?a:{enumerable:!0,get:function(){return e[i]}})}),n}var Mg={exports:{}},vl={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var t1;function Lk(){if(t1)return vl;t1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(i,a,u){var o=null;if(u!==void 0&&(o=""+u),a.key!==void 0&&(o=""+a.key),"key"in a){u={};for(var f in a)f!=="key"&&(u[f]=a[f])}else u=a;return a=u.ref,{$$typeof:e,type:i,key:o,ref:a!==void 0?a:null,props:u}}return vl.Fragment=t,vl.jsx=n,vl.jsxs=n,vl}var n1;function Hk(){return n1||(n1=1,Mg.exports=Lk()),Mg.exports}var _=Hk(),Pg={exports:{}},st={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var r1;function Bk(){if(r1)return st;r1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),o=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),l=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),g=Symbol.iterator;function b(M){return M===null||typeof M!="object"?null:(M=g&&M[g]||M["@@iterator"],typeof M=="function"?M:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,O={};function v(M,q,D){this.props=M,this.context=q,this.refs=O,this.updater=D||E}v.prototype.isReactComponent={},v.prototype.setState=function(M,q){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,q,"setState")},v.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function C(){}C.prototype=v.prototype;function x(M,q,D){this.props=M,this.context=q,this.refs=O,this.updater=D||E}var I=x.prototype=new C;I.constructor=x,T(I,v.prototype),I.isPureReactComponent=!0;var j=Array.isArray;function R(){}var k={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function z(M,q,D){var ie=D.ref;return{$$typeof:e,type:M,key:q,ref:ie!==void 0?ie:null,props:D}}function L(M,q){return z(M.type,q,M.props)}function G(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function F(M){var q={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(D){return q[D]})}var K=/\/+/g;function B(M,q){return typeof M=="object"&&M!==null&&M.key!=null?F(""+M.key):q.toString(36)}function Z(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(R,R):(M.status="pending",M.then(function(q){M.status==="pending"&&(M.status="fulfilled",M.value=q)},function(q){M.status==="pending"&&(M.status="rejected",M.reason=q)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function U(M,q,D,ie,ae){var fe=typeof M;(fe==="undefined"||fe==="boolean")&&(M=null);var Ee=!1;if(M===null)Ee=!0;else switch(fe){case"bigint":case"string":case"number":Ee=!0;break;case"object":switch(M.$$typeof){case e:case t:Ee=!0;break;case h:return Ee=M._init,U(Ee(M._payload),q,D,ie,ae)}}if(Ee)return ae=ae(M),Ee=ie===""?"."+B(M,0):ie,j(ae)?(D="",Ee!=null&&(D=Ee.replace(K,"$&/")+"/"),U(ae,q,D,"",function(Pe){return Pe})):ae!=null&&(G(ae)&&(ae=L(ae,D+(ae.key==null||M&&M.key===ae.key?"":(""+ae.key).replace(K,"$&/")+"/")+Ee)),q.push(ae)),1;Ee=0;var de=ie===""?".":ie+":";if(j(M))for(var le=0;le<M.length;le++)ie=M[le],fe=de+B(ie,le),Ee+=U(ie,q,D,fe,ae);else if(le=b(M),typeof le=="function")for(M=le.call(M),le=0;!(ie=M.next()).done;)ie=ie.value,fe=de+B(ie,le++),Ee+=U(ie,q,D,fe,ae);else if(fe==="object"){if(typeof M.then=="function")return U(Z(M),q,D,ie,ae);throw q=String(M),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return Ee}function Y(M,q,D){if(M==null)return M;var ie=[],ae=0;return U(M,ie,"","",function(fe){return q.call(D,fe,ae++)}),ie}function W(M){if(M._status===-1){var q=M._result;q=q(),q.then(function(D){(M._status===0||M._status===-1)&&(M._status=1,M._result=D)},function(D){(M._status===0||M._status===-1)&&(M._status=2,M._result=D)}),M._status===-1&&(M._status=0,M._result=q)}if(M._status===1)return M._result.default;throw M._result}var pe=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},N={map:Y,forEach:function(M,q,D){Y(M,function(){q.apply(this,arguments)},D)},count:function(M){var q=0;return Y(M,function(){q++}),q},toArray:function(M){return Y(M,function(q){return q})||[]},only:function(M){if(!G(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return st.Activity=m,st.Children=N,st.Component=v,st.Fragment=n,st.Profiler=a,st.PureComponent=x,st.StrictMode=i,st.Suspense=d,st.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=k,st.__COMPILER_RUNTIME={__proto__:null,c:function(M){return k.H.useMemoCache(M)}},st.cache=function(M){return function(){return M.apply(null,arguments)}},st.cacheSignal=function(){return null},st.cloneElement=function(M,q,D){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var ie=T({},M.props),ae=M.key;if(q!=null)for(fe in q.key!==void 0&&(ae=""+q.key),q)!P.call(q,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&q.ref===void 0||(ie[fe]=q[fe]);var fe=arguments.length-2;if(fe===1)ie.children=D;else if(1<fe){for(var Ee=Array(fe),de=0;de<fe;de++)Ee[de]=arguments[de+2];ie.children=Ee}return z(M.type,ae,ie)},st.createContext=function(M){return M={$$typeof:o,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:u,_context:M},M},st.createElement=function(M,q,D){var ie,ae={},fe=null;if(q!=null)for(ie in q.key!==void 0&&(fe=""+q.key),q)P.call(q,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(ae[ie]=q[ie]);var Ee=arguments.length-2;if(Ee===1)ae.children=D;else if(1<Ee){for(var de=Array(Ee),le=0;le<Ee;le++)de[le]=arguments[le+2];ae.children=de}if(M&&M.defaultProps)for(ie in Ee=M.defaultProps,Ee)ae[ie]===void 0&&(ae[ie]=Ee[ie]);return z(M,fe,ae)},st.createRef=function(){return{current:null}},st.forwardRef=function(M){return{$$typeof:f,render:M}},st.isValidElement=G,st.lazy=function(M){return{$$typeof:h,_payload:{_status:-1,_result:M},_init:W}},st.memo=function(M,q){return{$$typeof:l,type:M,compare:q===void 0?null:q}},st.startTransition=function(M){var q=k.T,D={};k.T=D;try{var ie=M(),ae=k.S;ae!==null&&ae(D,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(R,pe)}catch(fe){pe(fe)}finally{q!==null&&D.types!==null&&(q.types=D.types),k.T=q}},st.unstable_useCacheRefresh=function(){return k.H.useCacheRefresh()},st.use=function(M){return k.H.use(M)},st.useActionState=function(M,q,D){return k.H.useActionState(M,q,D)},st.useCallback=function(M,q){return k.H.useCallback(M,q)},st.useContext=function(M){return k.H.useContext(M)},st.useDebugValue=function(){},st.useDeferredValue=function(M,q){return k.H.useDeferredValue(M,q)},st.useEffect=function(M,q){return k.H.useEffect(M,q)},st.useEffectEvent=function(M){return k.H.useEffectEvent(M)},st.useId=function(){return k.H.useId()},st.useImperativeHandle=function(M,q,D){return k.H.useImperativeHandle(M,q,D)},st.useInsertionEffect=function(M,q){return k.H.useInsertionEffect(M,q)},st.useLayoutEffect=function(M,q){return k.H.useLayoutEffect(M,q)},st.useMemo=function(M,q){return k.H.useMemo(M,q)},st.useOptimistic=function(M,q){return k.H.useOptimistic(M,q)},st.useReducer=function(M,q,D){return k.H.useReducer(M,q,D)},st.useRef=function(M){return k.H.useRef(M)},st.useState=function(M){return k.H.useState(M)},st.useSyncExternalStore=function(M,q,D){return k.H.useSyncExternalStore(M,q,D)},st.useTransition=function(){return k.H.useTransition()},st.version="19.2.0",st}var i1;function vb(){return i1||(i1=1,Pg.exports=Bk()),Pg.exports}var J=vb();const Cn=bc(J);var Dg={exports:{}},Tl={},jg={exports:{}},Lg={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var s1;function Uk(){return s1||(s1=1,(function(e){function t(U,Y){var W=U.length;U.push(Y);e:for(;0<W;){var pe=W-1>>>1,N=U[pe];if(0<a(N,Y))U[pe]=Y,U[W]=N,W=pe;else break e}}function n(U){return U.length===0?null:U[0]}function i(U){if(U.length===0)return null;var Y=U[0],W=U.pop();if(W!==Y){U[0]=W;e:for(var pe=0,N=U.length,M=N>>>1;pe<M;){var q=2*(pe+1)-1,D=U[q],ie=q+1,ae=U[ie];if(0>a(D,W))ie<N&&0>a(ae,D)?(U[pe]=ae,U[ie]=W,pe=ie):(U[pe]=D,U[q]=W,pe=q);else if(ie<N&&0>a(ae,W))U[pe]=ae,U[ie]=W,pe=ie;else break e}}return Y}function a(U,Y){var W=U.sortIndex-Y.sortIndex;return W!==0?W:U.id-Y.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var o=Date,f=o.now();e.unstable_now=function(){return o.now()-f}}var d=[],l=[],h=1,m=null,g=3,b=!1,E=!1,T=!1,O=!1,v=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function I(U){for(var Y=n(l);Y!==null;){if(Y.callback===null)i(l);else if(Y.startTime<=U)i(l),Y.sortIndex=Y.expirationTime,t(d,Y);else break;Y=n(l)}}function j(U){if(T=!1,I(U),!E)if(n(d)!==null)E=!0,R||(R=!0,F());else{var Y=n(l);Y!==null&&Z(j,Y.startTime-U)}}var R=!1,k=-1,P=5,z=-1;function L(){return O?!0:!(e.unstable_now()-z<P)}function G(){if(O=!1,R){var U=e.unstable_now();z=U;var Y=!0;try{e:{E=!1,T&&(T=!1,C(k),k=-1),b=!0;var W=g;try{t:{for(I(U),m=n(d);m!==null&&!(m.expirationTime>U&&L());){var pe=m.callback;if(typeof pe=="function"){m.callback=null,g=m.priorityLevel;var N=pe(m.expirationTime<=U);if(U=e.unstable_now(),typeof N=="function"){m.callback=N,I(U),Y=!0;break t}m===n(d)&&i(d),I(U)}else i(d);m=n(d)}if(m!==null)Y=!0;else{var M=n(l);M!==null&&Z(j,M.startTime-U),Y=!1}}break e}finally{m=null,g=W,b=!1}Y=void 0}}finally{Y?F():R=!1}}}var F;if(typeof x=="function")F=function(){x(G)};else if(typeof MessageChannel<"u"){var K=new MessageChannel,B=K.port2;K.port1.onmessage=G,F=function(){B.postMessage(null)}}else F=function(){v(G,0)};function Z(U,Y){k=v(function(){U(e.unstable_now())},Y)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(U){U.callback=null},e.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<U?Math.floor(1e3/U):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function(U){switch(g){case 1:case 2:case 3:var Y=3;break;default:Y=g}var W=g;g=Y;try{return U()}finally{g=W}},e.unstable_requestPaint=function(){O=!0},e.unstable_runWithPriority=function(U,Y){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var W=g;g=U;try{return Y()}finally{g=W}},e.unstable_scheduleCallback=function(U,Y,W){var pe=e.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?pe+W:pe):W=pe,U){case 1:var N=-1;break;case 2:N=250;break;case 5:N=1073741823;break;case 4:N=1e4;break;default:N=5e3}return N=W+N,U={id:h++,callback:Y,priorityLevel:U,startTime:W,expirationTime:N,sortIndex:-1},W>pe?(U.sortIndex=W,t(l,U),n(d)===null&&U===n(l)&&(T?(C(k),k=-1):T=!0,Z(j,W-pe))):(U.sortIndex=N,t(d,U),E||b||(E=!0,R||(R=!0,F()))),U},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(U){var Y=g;return function(){var W=g;g=Y;try{return U.apply(this,arguments)}finally{g=W}}}})(Lg)),Lg}var a1;function Fk(){return a1||(a1=1,jg.exports=Uk()),jg.exports}var Hg={exports:{}},ur={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var o1;function zk(){if(o1)return ur;o1=1;var e=vb();function t(d){var l="https://react.dev/errors/"+d;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)l+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+d+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function u(d,l,h){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:m==null?null:""+m,children:d,containerInfo:l,implementation:h}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(d,l){if(d==="font")return"";if(typeof l=="string")return l==="use-credentials"?l:""}return ur.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,ur.createPortal=function(d,l){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)throw Error(t(299));return u(d,l,null,h)},ur.flushSync=function(d){var l=o.T,h=i.p;try{if(o.T=null,i.p=2,d)return d()}finally{o.T=l,i.p=h,i.d.f()}},ur.preconnect=function(d,l){typeof d=="string"&&(l?(l=l.crossOrigin,l=typeof l=="string"?l==="use-credentials"?l:"":void 0):l=null,i.d.C(d,l))},ur.prefetchDNS=function(d){typeof d=="string"&&i.d.D(d)},ur.preinit=function(d,l){if(typeof d=="string"&&l&&typeof l.as=="string"){var h=l.as,m=f(h,l.crossOrigin),g=typeof l.integrity=="string"?l.integrity:void 0,b=typeof l.fetchPriority=="string"?l.fetchPriority:void 0;h==="style"?i.d.S(d,typeof l.precedence=="string"?l.precedence:void 0,{crossOrigin:m,integrity:g,fetchPriority:b}):h==="script"&&i.d.X(d,{crossOrigin:m,integrity:g,fetchPriority:b,nonce:typeof l.nonce=="string"?l.nonce:void 0})}},ur.preinitModule=function(d,l){if(typeof d=="string")if(typeof l=="object"&&l!==null){if(l.as==null||l.as==="script"){var h=f(l.as,l.crossOrigin);i.d.M(d,{crossOrigin:h,integrity:typeof l.integrity=="string"?l.integrity:void 0,nonce:typeof l.nonce=="string"?l.nonce:void 0})}}else l==null&&i.d.M(d)},ur.preload=function(d,l){if(typeof d=="string"&&typeof l=="object"&&l!==null&&typeof l.as=="string"){var h=l.as,m=f(h,l.crossOrigin);i.d.L(d,h,{crossOrigin:m,integrity:typeof l.integrity=="string"?l.integrity:void 0,nonce:typeof l.nonce=="string"?l.nonce:void 0,type:typeof l.type=="string"?l.type:void 0,fetchPriority:typeof l.fetchPriority=="string"?l.fetchPriority:void 0,referrerPolicy:typeof l.referrerPolicy=="string"?l.referrerPolicy:void 0,imageSrcSet:typeof l.imageSrcSet=="string"?l.imageSrcSet:void 0,imageSizes:typeof l.imageSizes=="string"?l.imageSizes:void 0,media:typeof l.media=="string"?l.media:void 0})}},ur.preloadModule=function(d,l){if(typeof d=="string")if(l){var h=f(l.as,l.crossOrigin);i.d.m(d,{as:typeof l.as=="string"&&l.as!=="script"?l.as:void 0,crossOrigin:h,integrity:typeof l.integrity=="string"?l.integrity:void 0})}else i.d.m(d)},ur.requestFormReset=function(d){i.d.r(d)},ur.unstable_batchedUpdates=function(d,l){return d(l)},ur.useFormState=function(d,l,h){return o.H.useFormState(d,l,h)},ur.useFormStatus=function(){return o.H.useHostTransitionStatus()},ur.version="19.2.0",ur}var c1;function ax(){if(c1)return Hg.exports;c1=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Hg.exports=zk(),Hg.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var l1;function $k(){if(l1)return Tl;l1=1;var e=Fk(),t=vb(),n=ax();function i(r){var s="https://react.dev/errors/"+r;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)s+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+r+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function u(r){var s=r,c=r;if(r.alternate)for(;s.return;)s=s.return;else{r=s;do s=r,(s.flags&4098)!==0&&(c=s.return),r=s.return;while(r)}return s.tag===3?c:null}function o(r){if(r.tag===13){var s=r.memoizedState;if(s===null&&(r=r.alternate,r!==null&&(s=r.memoizedState)),s!==null)return s.dehydrated}return null}function f(r){if(r.tag===31){var s=r.memoizedState;if(s===null&&(r=r.alternate,r!==null&&(s=r.memoizedState)),s!==null)return s.dehydrated}return null}function d(r){if(u(r)!==r)throw Error(i(188))}function l(r){var s=r.alternate;if(!s){if(s=u(r),s===null)throw Error(i(188));return s!==r?null:r}for(var c=r,p=s;;){var y=c.return;if(y===null)break;var A=y.alternate;if(A===null){if(p=y.return,p!==null){c=p;continue}break}if(y.child===A.child){for(A=y.child;A;){if(A===c)return d(y),r;if(A===p)return d(y),s;A=A.sibling}throw Error(i(188))}if(c.return!==p.return)c=y,p=A;else{for(var w=!1,H=y.child;H;){if(H===c){w=!0,c=y,p=A;break}if(H===p){w=!0,p=y,c=A;break}H=H.sibling}if(!w){for(H=A.child;H;){if(H===c){w=!0,c=A,p=y;break}if(H===p){w=!0,p=A,c=y;break}H=H.sibling}if(!w)throw Error(i(189))}}if(c.alternate!==p)throw Error(i(190))}if(c.tag!==3)throw Error(i(188));return c.stateNode.current===c?r:s}function h(r){var s=r.tag;if(s===5||s===26||s===27||s===6)return r;for(r=r.child;r!==null;){if(s=h(r),s!==null)return s;r=r.sibling}return null}var m=Object.assign,g=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),x=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),L=Symbol.for("react.memo_cache_sentinel"),G=Symbol.iterator;function F(r){return r===null||typeof r!="object"?null:(r=G&&r[G]||r["@@iterator"],typeof r=="function"?r:null)}var K=Symbol.for("react.client.reference");function B(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===K?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case T:return"Fragment";case v:return"Profiler";case O:return"StrictMode";case j:return"Suspense";case R:return"SuspenseList";case z:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case E:return"Portal";case x:return r.displayName||"Context";case C:return(r._context.displayName||"Context")+".Consumer";case I:var s=r.render;return r=r.displayName,r||(r=s.displayName||s.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case k:return s=r.displayName||null,s!==null?s:B(r.type)||"Memo";case P:s=r._payload,r=r._init;try{return B(r(s))}catch{}}return null}var Z=Array.isArray,U=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},pe=[],N=-1;function M(r){return{current:r}}function q(r){0>N||(r.current=pe[N],pe[N]=null,N--)}function D(r,s){N++,pe[N]=r.current,r.current=s}var ie=M(null),ae=M(null),fe=M(null),Ee=M(null);function de(r,s){switch(D(fe,s),D(ae,r),D(ie,null),s.nodeType){case 9:case 11:r=(r=s.documentElement)&&(r=r.namespaceURI)?Ov(r):0;break;default:if(r=s.tagName,s=s.namespaceURI)s=Ov(s),r=Sv(s,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}q(ie),D(ie,r)}function le(){q(ie),q(ae),q(fe)}function Pe(r){r.memoizedState!==null&&D(Ee,r);var s=ie.current,c=Sv(s,r.type);s!==c&&(D(ae,r),D(ie,c))}function re(r){ae.current===r&&(q(ie),q(ae)),Ee.current===r&&(q(Ee),bl._currentValue=W)}var Ae,Ce;function Me(r){if(Ae===void 0)try{throw Error()}catch(c){var s=c.stack.trim().match(/\n( *(at )?)/);Ae=s&&s[1]||"",Ce=-1<c.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Ae+r+Ce}var He=!1;function Ne(r,s){if(!r||He)return"";He=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(s){var Oe=function(){throw Error()};if(Object.defineProperty(Oe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Oe,[])}catch(me){var he=me}Reflect.construct(r,[],Oe)}else{try{Oe.call()}catch(me){he=me}r.call(Oe.prototype)}}else{try{throw Error()}catch(me){he=me}(Oe=r())&&typeof Oe.catch=="function"&&Oe.catch(function(){})}}catch(me){if(me&&he&&typeof me.stack=="string")return[me.stack,he.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var A=p.DetermineComponentFrameRoot(),w=A[0],H=A[1];if(w&&H){var Q=w.split(`
44
+ `),ue=H.split(`
45
+ `);for(y=p=0;p<Q.length&&!Q[p].includes("DetermineComponentFrameRoot");)p++;for(;y<ue.length&&!ue[y].includes("DetermineComponentFrameRoot");)y++;if(p===Q.length||y===ue.length)for(p=Q.length-1,y=ue.length-1;1<=p&&0<=y&&Q[p]!==ue[y];)y--;for(;1<=p&&0<=y;p--,y--)if(Q[p]!==ue[y]){if(p!==1||y!==1)do if(p--,y--,0>y||Q[p]!==ue[y]){var _e=`
46
+ `+Q[p].replace(" at new "," at ");return r.displayName&&_e.includes("<anonymous>")&&(_e=_e.replace("<anonymous>",r.displayName)),_e}while(1<=p&&0<=y);break}}}finally{He=!1,Error.prepareStackTrace=c}return(c=r?r.displayName||r.name:"")?Me(c):""}function Ge(r,s){switch(r.tag){case 26:case 27:case 5:return Me(r.type);case 16:return Me("Lazy");case 13:return r.child!==s&&s!==null?Me("Suspense Fallback"):Me("Suspense");case 19:return Me("SuspenseList");case 0:case 15:return Ne(r.type,!1);case 11:return Ne(r.type.render,!1);case 1:return Ne(r.type,!0);case 31:return Me("Activity");default:return""}}function pt(r){try{var s="",c=null;do s+=Ge(r,c),c=r,r=r.return;while(r);return s}catch(p){return`
47
+ Error generating stack: `+p.message+`
48
+ `+p.stack}}var it=Object.prototype.hasOwnProperty,bt=e.unstable_scheduleCallback,jt=e.unstable_cancelCallback,ar=e.unstable_shouldYield,vt=e.unstable_requestPaint,Lt=e.unstable_now,ni=e.unstable_getCurrentPriorityLevel,be=e.unstable_ImmediatePriority,xe=e.unstable_UserBlockingPriority,$e=e.unstable_NormalPriority,ct=e.unstable_LowPriority,wt=e.unstable_IdlePriority,qn=e.log,ri=e.unstable_setDisableYieldValue,Tn=null,An=null;function or(r){if(typeof qn=="function"&&ri(r),An&&typeof An.setStrictMode=="function")try{An.setStrictMode(Tn,r)}catch{}}var Ft=Math.clz32?Math.clz32:uf,Li=Math.log,mr=Math.LN2;function uf(r){return r>>>=0,r===0?32:31-(Li(r)/mr|0)|0}var ya=256,uo=262144,Ea=4194304;function Ar(r){var s=r&42;if(s!==0)return s;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function ee(r,s,c){var p=r.pendingLanes;if(p===0)return 0;var y=0,A=r.suspendedLanes,w=r.pingedLanes;r=r.warmLanes;var H=p&134217727;return H!==0?(p=H&~A,p!==0?y=Ar(p):(w&=H,w!==0?y=Ar(w):c||(c=H&~r,c!==0&&(y=Ar(c))))):(H=p&~A,H!==0?y=Ar(H):w!==0?y=Ar(w):c||(c=p&~r,c!==0&&(y=Ar(c)))),y===0?0:s!==0&&s!==y&&(s&A)===0&&(A=y&-y,c=s&-s,A>=c||A===32&&(c&4194048)!==0)?s:y}function ve(r,s){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&s)===0}function je(r,s){switch(r){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function rt(){var r=Ea;return Ea<<=1,(Ea&62914560)===0&&(Ea=4194304),r}function an(r){for(var s=[],c=0;31>c;c++)s.push(r);return s}function Wt(r,s){r.pendingLanes|=s,s!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function qe(r,s,c,p,y,A){var w=r.pendingLanes;r.pendingLanes=c,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=c,r.entangledLanes&=c,r.errorRecoveryDisabledLanes&=c,r.shellSuspendCounter=0;var H=r.entanglements,Q=r.expirationTimes,ue=r.hiddenUpdates;for(c=w&~c;0<c;){var _e=31-Ft(c),Oe=1<<_e;H[_e]=0,Q[_e]=-1;var he=ue[_e];if(he!==null)for(ue[_e]=null,_e=0;_e<he.length;_e++){var me=he[_e];me!==null&&(me.lane&=-536870913)}c&=~Oe}p!==0&&Fe(r,p,0),A!==0&&y===0&&r.tag!==0&&(r.suspendedLanes|=A&~(w&~s))}function Fe(r,s,c){r.pendingLanes|=s,r.suspendedLanes&=~s;var p=31-Ft(s);r.entangledLanes|=s,r.entanglements[p]=r.entanglements[p]|1073741824|c&261930}function nt(r,s){var c=r.entangledLanes|=s;for(r=r.entanglements;c;){var p=31-Ft(c),y=1<<p;y&s|r[p]&s&&(r[p]|=s),c&=~y}}function wn(r,s){var c=s&-s;return c=(c&42)!==0?1:fn(c),(c&(r.suspendedLanes|s))!==0?0:c}function fn(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function Wi(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function fo(){var r=Y.p;return r!==0?r:(r=window.event,r===void 0?32:Vv(r.type))}function ho(r,s){var c=Y.p;try{return Y.p=r,s()}finally{Y.p=c}}var Hi=Math.random().toString(36).slice(2),Rn="__reactFiber$"+Hi,cr="__reactProps$"+Hi,Is="__reactContainer$"+Hi,wc="__reactEvents$"+Hi,df="__reactListeners$"+Hi,mo="__reactHandles$"+Hi,ff="__reactResources$"+Hi,va="__reactMarker$"+Hi;function Rc(r){delete r[Rn],delete r[cr],delete r[wc],delete r[df],delete r[mo]}function pr(r){var s=r[Rn];if(s)return s;for(var c=r.parentNode;c;){if(s=c[Is]||c[Rn]){if(c=s.alternate,s.child!==null||c!==null&&c.child!==null)for(r=kv(r);r!==null;){if(c=r[Rn])return c;r=kv(r)}return s}r=c,c=r.parentNode}return null}function Xi(r){if(r=r[Rn]||r[Is]){var s=r.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return r}return null}function ks(r){var s=r.tag;if(s===5||s===26||s===27||s===6)return r.stateNode;throw Error(i(33))}function Ms(r){var s=r[ff];return s||(s=r[ff]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Pn(r){r[va]=!0}var hf=new Set,Ta={};function Qi(r,s){Re(r,s),Re(r+"Capture",s)}function Re(r,s){for(Ta[r]=s,r=0;r<s.length;r++)hf.add(s[r])}var We=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),_t={},zt={};function Nn(r){return it.call(zt,r)?!0:it.call(_t,r)?!1:We.test(r)?zt[r]=!0:(_t[r]=!0,!1)}function lr(r,s,c){if(Nn(s))if(c===null)r.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":r.removeAttribute(s);return;case"boolean":var p=s.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){r.removeAttribute(s);return}}r.setAttribute(s,""+c)}}function Lr(r,s,c){if(c===null)r.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(s);return}r.setAttribute(s,""+c)}}function Or(r,s,c,p){if(p===null)r.removeAttribute(c);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(c);return}r.setAttributeNS(s,c,""+p)}}function en(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Hr(r){var s=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function mf(r,s,c){var p=Object.getOwnPropertyDescriptor(r.constructor.prototype,s);if(!r.hasOwnProperty(s)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var y=p.get,A=p.set;return Object.defineProperty(r,s,{configurable:!0,get:function(){return y.call(this)},set:function(w){c=""+w,A.call(this,w)}}),Object.defineProperty(r,s,{enumerable:p.enumerable}),{getValue:function(){return c},setValue:function(w){c=""+w},stopTracking:function(){r._valueTracker=null,delete r[s]}}}}function po(r){if(!r._valueTracker){var s=Hr(r)?"checked":"value";r._valueTracker=mf(r,s,""+r[s])}}function Nc(r){if(!r)return!1;var s=r._valueTracker;if(!s)return!0;var c=s.getValue(),p="";return r&&(p=Hr(r)?r.checked?"true":"false":r.value),r=p,r!==c?(s.setValue(r),!0):!1}function go(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var Im=/[\n"\\]/g;function Sr(r){return r.replace(Im,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Ic(r,s,c,p,y,A,w,H){r.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?r.type=w:r.removeAttribute("type"),s!=null?w==="number"?(s===0&&r.value===""||r.value!=s)&&(r.value=""+en(s)):r.value!==""+en(s)&&(r.value=""+en(s)):w!=="submit"&&w!=="reset"||r.removeAttribute("value"),s!=null?bo(r,w,en(s)):c!=null?bo(r,w,en(c)):p!=null&&r.removeAttribute("value"),y==null&&A!=null&&(r.defaultChecked=!!A),y!=null&&(r.checked=y&&typeof y!="function"&&typeof y!="symbol"),H!=null&&typeof H!="function"&&typeof H!="symbol"&&typeof H!="boolean"?r.name=""+en(H):r.removeAttribute("name")}function Aa(r,s,c,p,y,A,w,H){if(A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(r.type=A),s!=null||c!=null){if(!(A!=="submit"&&A!=="reset"||s!=null)){po(r);return}c=c!=null?""+en(c):"",s=s!=null?""+en(s):c,H||s===r.value||(r.value=s),r.defaultValue=s}p=p??y,p=typeof p!="function"&&typeof p!="symbol"&&!!p,r.checked=H?r.checked:!!p,r.defaultChecked=!!p,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(r.name=w),po(r)}function bo(r,s,c){s==="number"&&go(r.ownerDocument)===r||r.defaultValue===""+c||(r.defaultValue=""+c)}function Vn(r,s,c,p){if(r=r.options,s){s={};for(var y=0;y<c.length;y++)s["$"+c[y]]=!0;for(c=0;c<r.length;c++)y=s.hasOwnProperty("$"+r[c].value),r[c].selected!==y&&(r[c].selected=y),y&&p&&(r[c].defaultSelected=!0)}else{for(c=""+en(c),s=null,y=0;y<r.length;y++){if(r[y].value===c){r[y].selected=!0,p&&(r[y].defaultSelected=!0);return}s!==null||r[y].disabled||(s=r[y])}s!==null&&(s.selected=!0)}}function pf(r,s,c){if(s!=null&&(s=""+en(s),s!==r.value&&(r.value=s),c==null)){r.defaultValue!==s&&(r.defaultValue=s);return}r.defaultValue=c!=null?""+en(c):""}function _o(r,s,c,p){if(s==null){if(p!=null){if(c!=null)throw Error(i(92));if(Z(p)){if(1<p.length)throw Error(i(93));p=p[0]}c=p}c==null&&(c=""),s=c}c=en(s),r.defaultValue=c,p=r.textContent,p===c&&p!==""&&p!==null&&(r.value=p),po(r)}function tt(r,s){if(s){var c=r.firstChild;if(c&&c===r.lastChild&&c.nodeType===3){c.nodeValue=s;return}}r.textContent=s}var gf=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Dn(r,s,c){var p=s.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?p?r.setProperty(s,""):s==="float"?r.cssFloat="":r[s]="":p?r.setProperty(s,c):typeof c!="number"||c===0||gf.has(s)?s==="float"?r.cssFloat=c:r[s]=(""+c).trim():r[s]=c+"px"}function $t(r,s,c){if(s!=null&&typeof s!="object")throw Error(i(62));if(r=r.style,c!=null){for(var p in c)!c.hasOwnProperty(p)||s!=null&&s.hasOwnProperty(p)||(p.indexOf("--")===0?r.setProperty(p,""):p==="float"?r.cssFloat="":r[p]="");for(var y in s)p=s[y],s.hasOwnProperty(y)&&c[y]!==p&&Dn(r,y,p)}else for(var A in s)s.hasOwnProperty(A)&&Dn(r,A,s[A])}function Ps(r){if(r.indexOf("-")===-1)return!1;switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ji=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),kc=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ds(r){return kc.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function De(){}var Ke=null;function at(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var St=null,_n=null;function ii(r){var s=Xi(r);if(s&&(r=s.stateNode)){var c=r[cr]||null;e:switch(r=s.stateNode,s.type){case"input":if(Ic(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),s=c.name,c.type==="radio"&&s!=null){for(c=r;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+Sr(""+s)+'"][type="radio"]'),s=0;s<c.length;s++){var p=c[s];if(p!==r&&p.form===r.form){var y=p[cr]||null;if(!y)throw Error(i(90));Ic(p,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(s=0;s<c.length;s++)p=c[s],p.form===r.form&&Nc(p)}break e;case"textarea":pf(r,c.value,c.defaultValue);break e;case"select":s=c.value,s!=null&&Vn(r,!!c.multiple,s,!1)}}}var Mc=!1;function bf(r,s,c){if(Mc)return r(s,c);Mc=!0;try{var p=r(s);return p}finally{if(Mc=!1,(St!==null||_n!==null)&&(ih(),St&&(s=St,r=_n,_n=St=null,ii(s),r)))for(s=0;s<r.length;s++)ii(r[s])}}function Pc(r,s){var c=r.stateNode;if(c===null)return null;var p=c[cr]||null;if(p===null)return null;c=p[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(r=r.type,p=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!p;break e;default:r=!1}if(r)return null;if(c&&typeof c!="function")throw Error(i(231,s,typeof c));return c}var es=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),km=!1;if(es)try{var Dc={};Object.defineProperty(Dc,"passive",{get:function(){km=!0}}),window.addEventListener("test",Dc,Dc),window.removeEventListener("test",Dc,Dc)}catch{km=!1}var js=null,Mm=null,_f=null;function S_(){if(_f)return _f;var r,s=Mm,c=s.length,p,y="value"in js?js.value:js.textContent,A=y.length;for(r=0;r<c&&s[r]===y[r];r++);var w=c-r;for(p=1;p<=w&&s[c-p]===y[A-p];p++);return _f=y.slice(r,1<p?1-p:void 0)}function yf(r){var s=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&s===13&&(r=13)):r=s,r===10&&(r=13),32<=r||r===13?r:0}function Ef(){return!0}function C_(){return!1}function Cr(r){function s(c,p,y,A,w){this._reactName=c,this._targetInst=y,this.type=p,this.nativeEvent=A,this.target=w,this.currentTarget=null;for(var H in r)r.hasOwnProperty(H)&&(c=r[H],this[H]=c?c(A):A[H]);return this.isDefaultPrevented=(A.defaultPrevented!=null?A.defaultPrevented:A.returnValue===!1)?Ef:C_,this.isPropagationStopped=C_,this}return m(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=Ef)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=Ef)},persist:function(){},isPersistent:Ef}),s}var Oa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vf=Cr(Oa),jc=m({},Oa,{view:0,detail:0}),PI=Cr(jc),Pm,Dm,Lc,Tf=m({},jc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Lm,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==Lc&&(Lc&&r.type==="mousemove"?(Pm=r.screenX-Lc.screenX,Dm=r.screenY-Lc.screenY):Dm=Pm=0,Lc=r),Pm)},movementY:function(r){return"movementY"in r?r.movementY:Dm}}),x_=Cr(Tf),DI=m({},Tf,{dataTransfer:0}),jI=Cr(DI),LI=m({},jc,{relatedTarget:0}),jm=Cr(LI),HI=m({},Oa,{animationName:0,elapsedTime:0,pseudoElement:0}),BI=Cr(HI),UI=m({},Oa,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),FI=Cr(UI),zI=m({},Oa,{data:0}),w_=Cr(zI),$I={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qI={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},GI={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function KI(r){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(r):(r=GI[r])?!!s[r]:!1}function Lm(){return KI}var YI=m({},jc,{key:function(r){if(r.key){var s=$I[r.key]||r.key;if(s!=="Unidentified")return s}return r.type==="keypress"?(r=yf(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?qI[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Lm,charCode:function(r){return r.type==="keypress"?yf(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?yf(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),VI=Cr(YI),ZI=m({},Tf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),R_=Cr(ZI),WI=m({},jc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Lm}),XI=Cr(WI),QI=m({},Oa,{propertyName:0,elapsedTime:0,pseudoElement:0}),JI=Cr(QI),e2=m({},Tf,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),t2=Cr(e2),n2=m({},Oa,{newState:0,oldState:0}),r2=Cr(n2),i2=[9,13,27,32],Hm=es&&"CompositionEvent"in window,Hc=null;es&&"documentMode"in document&&(Hc=document.documentMode);var s2=es&&"TextEvent"in window&&!Hc,N_=es&&(!Hm||Hc&&8<Hc&&11>=Hc),I_=" ",k_=!1;function M_(r,s){switch(r){case"keyup":return i2.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function P_(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var yo=!1;function a2(r,s){switch(r){case"compositionend":return P_(s);case"keypress":return s.which!==32?null:(k_=!0,I_);case"textInput":return r=s.data,r===I_&&k_?null:r;default:return null}}function o2(r,s){if(yo)return r==="compositionend"||!Hm&&M_(r,s)?(r=S_(),_f=Mm=js=null,yo=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return N_&&s.locale!=="ko"?null:s.data;default:return null}}var c2={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function D_(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s==="input"?!!c2[r.type]:s==="textarea"}function j_(r,s,c,p){St?_n?_n.push(p):_n=[p]:St=p,s=dh(s,"onChange"),0<s.length&&(c=new vf("onChange","change",null,c,p),r.push({event:c,listeners:s}))}var Bc=null,Uc=null;function l2(r){_v(r,0)}function Af(r){var s=ks(r);if(Nc(s))return r}function L_(r,s){if(r==="change")return s}var H_=!1;if(es){var Bm;if(es){var Um="oninput"in document;if(!Um){var B_=document.createElement("div");B_.setAttribute("oninput","return;"),Um=typeof B_.oninput=="function"}Bm=Um}else Bm=!1;H_=Bm&&(!document.documentMode||9<document.documentMode)}function U_(){Bc&&(Bc.detachEvent("onpropertychange",F_),Uc=Bc=null)}function F_(r){if(r.propertyName==="value"&&Af(Uc)){var s=[];j_(s,Uc,r,at(r)),bf(l2,s)}}function u2(r,s,c){r==="focusin"?(U_(),Bc=s,Uc=c,Bc.attachEvent("onpropertychange",F_)):r==="focusout"&&U_()}function d2(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Af(Uc)}function f2(r,s){if(r==="click")return Af(s)}function h2(r,s){if(r==="input"||r==="change")return Af(s)}function m2(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}var Br=typeof Object.is=="function"?Object.is:m2;function Fc(r,s){if(Br(r,s))return!0;if(typeof r!="object"||r===null||typeof s!="object"||s===null)return!1;var c=Object.keys(r),p=Object.keys(s);if(c.length!==p.length)return!1;for(p=0;p<c.length;p++){var y=c[p];if(!it.call(s,y)||!Br(r[y],s[y]))return!1}return!0}function z_(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function $_(r,s){var c=z_(r);r=0;for(var p;c;){if(c.nodeType===3){if(p=r+c.textContent.length,r<=s&&p>=s)return{node:c,offset:s-r};r=p}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=z_(c)}}function q_(r,s){return r&&s?r===s?!0:r&&r.nodeType===3?!1:s&&s.nodeType===3?q_(r,s.parentNode):"contains"in r?r.contains(s):r.compareDocumentPosition?!!(r.compareDocumentPosition(s)&16):!1:!1}function G_(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var s=go(r.document);s instanceof r.HTMLIFrameElement;){try{var c=typeof s.contentWindow.location.href=="string"}catch{c=!1}if(c)r=s.contentWindow;else break;s=go(r.document)}return s}function Fm(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s&&(s==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||s==="textarea"||r.contentEditable==="true")}var p2=es&&"documentMode"in document&&11>=document.documentMode,Eo=null,zm=null,zc=null,$m=!1;function K_(r,s,c){var p=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;$m||Eo==null||Eo!==go(p)||(p=Eo,"selectionStart"in p&&Fm(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),zc&&Fc(zc,p)||(zc=p,p=dh(zm,"onSelect"),0<p.length&&(s=new vf("onSelect","select",null,s,c),r.push({event:s,listeners:p}),s.target=Eo)))}function Sa(r,s){var c={};return c[r.toLowerCase()]=s.toLowerCase(),c["Webkit"+r]="webkit"+s,c["Moz"+r]="moz"+s,c}var vo={animationend:Sa("Animation","AnimationEnd"),animationiteration:Sa("Animation","AnimationIteration"),animationstart:Sa("Animation","AnimationStart"),transitionrun:Sa("Transition","TransitionRun"),transitionstart:Sa("Transition","TransitionStart"),transitioncancel:Sa("Transition","TransitionCancel"),transitionend:Sa("Transition","TransitionEnd")},qm={},Y_={};es&&(Y_=document.createElement("div").style,"AnimationEvent"in window||(delete vo.animationend.animation,delete vo.animationiteration.animation,delete vo.animationstart.animation),"TransitionEvent"in window||delete vo.transitionend.transition);function Ca(r){if(qm[r])return qm[r];if(!vo[r])return r;var s=vo[r],c;for(c in s)if(s.hasOwnProperty(c)&&c in Y_)return qm[r]=s[c];return r}var V_=Ca("animationend"),Z_=Ca("animationiteration"),W_=Ca("animationstart"),g2=Ca("transitionrun"),b2=Ca("transitionstart"),_2=Ca("transitioncancel"),X_=Ca("transitionend"),Q_=new Map,Gm="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Gm.push("scrollEnd");function Ai(r,s){Q_.set(r,s),Qi(s,[r])}var Of=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},si=[],To=0,Km=0;function Sf(){for(var r=To,s=Km=To=0;s<r;){var c=si[s];si[s++]=null;var p=si[s];si[s++]=null;var y=si[s];si[s++]=null;var A=si[s];if(si[s++]=null,p!==null&&y!==null){var w=p.pending;w===null?y.next=y:(y.next=w.next,w.next=y),p.pending=y}A!==0&&J_(c,y,A)}}function Cf(r,s,c,p){si[To++]=r,si[To++]=s,si[To++]=c,si[To++]=p,Km|=p,r.lanes|=p,r=r.alternate,r!==null&&(r.lanes|=p)}function Ym(r,s,c,p){return Cf(r,s,c,p),xf(r)}function xa(r,s){return Cf(r,null,null,s),xf(r)}function J_(r,s,c){r.lanes|=c;var p=r.alternate;p!==null&&(p.lanes|=c);for(var y=!1,A=r.return;A!==null;)A.childLanes|=c,p=A.alternate,p!==null&&(p.childLanes|=c),A.tag===22&&(r=A.stateNode,r===null||r._visibility&1||(y=!0)),r=A,A=A.return;return r.tag===3?(A=r.stateNode,y&&s!==null&&(y=31-Ft(c),r=A.hiddenUpdates,p=r[y],p===null?r[y]=[s]:p.push(s),s.lane=c|536870912),A):null}function xf(r){if(50<ul)throw ul=0,ng=null,Error(i(185));for(var s=r.return;s!==null;)r=s,s=r.return;return r.tag===3?r.stateNode:null}var Ao={};function y2(r,s,c,p){this.tag=r,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ur(r,s,c,p){return new y2(r,s,c,p)}function Vm(r){return r=r.prototype,!(!r||!r.isReactComponent)}function ts(r,s){var c=r.alternate;return c===null?(c=Ur(r.tag,s,r.key,r.mode),c.elementType=r.elementType,c.type=r.type,c.stateNode=r.stateNode,c.alternate=r,r.alternate=c):(c.pendingProps=s,c.type=r.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=r.flags&65011712,c.childLanes=r.childLanes,c.lanes=r.lanes,c.child=r.child,c.memoizedProps=r.memoizedProps,c.memoizedState=r.memoizedState,c.updateQueue=r.updateQueue,s=r.dependencies,c.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},c.sibling=r.sibling,c.index=r.index,c.ref=r.ref,c.refCleanup=r.refCleanup,c}function ey(r,s){r.flags&=65011714;var c=r.alternate;return c===null?(r.childLanes=0,r.lanes=s,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=c.childLanes,r.lanes=c.lanes,r.child=c.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=c.memoizedProps,r.memoizedState=c.memoizedState,r.updateQueue=c.updateQueue,r.type=c.type,s=c.dependencies,r.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),r}function wf(r,s,c,p,y,A){var w=0;if(p=r,typeof r=="function")Vm(r)&&(w=1);else if(typeof r=="string")w=Ok(r,c,ie.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case z:return r=Ur(31,c,s,y),r.elementType=z,r.lanes=A,r;case T:return wa(c.children,y,A,s);case O:w=8,y|=24;break;case v:return r=Ur(12,c,s,y|2),r.elementType=v,r.lanes=A,r;case j:return r=Ur(13,c,s,y),r.elementType=j,r.lanes=A,r;case R:return r=Ur(19,c,s,y),r.elementType=R,r.lanes=A,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case x:w=10;break e;case C:w=9;break e;case I:w=11;break e;case k:w=14;break e;case P:w=16,p=null;break e}w=29,c=Error(i(130,r===null?"null":typeof r,"")),p=null}return s=Ur(w,c,s,y),s.elementType=r,s.type=p,s.lanes=A,s}function wa(r,s,c,p){return r=Ur(7,r,p,s),r.lanes=c,r}function Zm(r,s,c){return r=Ur(6,r,null,s),r.lanes=c,r}function ty(r){var s=Ur(18,null,null,0);return s.stateNode=r,s}function Wm(r,s,c){return s=Ur(4,r.children!==null?r.children:[],r.key,s),s.lanes=c,s.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},s}var ny=new WeakMap;function ai(r,s){if(typeof r=="object"&&r!==null){var c=ny.get(r);return c!==void 0?c:(s={value:r,source:s,stack:pt(s)},ny.set(r,s),s)}return{value:r,source:s,stack:pt(s)}}var Oo=[],So=0,Rf=null,$c=0,oi=[],ci=0,Ls=null,Bi=1,Ui="";function ns(r,s){Oo[So++]=$c,Oo[So++]=Rf,Rf=r,$c=s}function ry(r,s,c){oi[ci++]=Bi,oi[ci++]=Ui,oi[ci++]=Ls,Ls=r;var p=Bi;r=Ui;var y=32-Ft(p)-1;p&=~(1<<y),c+=1;var A=32-Ft(s)+y;if(30<A){var w=y-y%5;A=(p&(1<<w)-1).toString(32),p>>=w,y-=w,Bi=1<<32-Ft(s)+y|c<<y|p,Ui=A+r}else Bi=1<<A|c<<y|p,Ui=r}function Xm(r){r.return!==null&&(ns(r,1),ry(r,1,0))}function Qm(r){for(;r===Rf;)Rf=Oo[--So],Oo[So]=null,$c=Oo[--So],Oo[So]=null;for(;r===Ls;)Ls=oi[--ci],oi[ci]=null,Ui=oi[--ci],oi[ci]=null,Bi=oi[--ci],oi[ci]=null}function iy(r,s){oi[ci++]=Bi,oi[ci++]=Ui,oi[ci++]=Ls,Bi=s.id,Ui=s.overflow,Ls=r}var Zn=null,on=null,Rt=!1,Hs=null,li=!1,Jm=Error(i(519));function Bs(r){var s=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw qc(ai(s,r)),Jm}function sy(r){var s=r.stateNode,c=r.type,p=r.memoizedProps;switch(s[Rn]=r,s[cr]=p,c){case"dialog":At("cancel",s),At("close",s);break;case"iframe":case"object":case"embed":At("load",s);break;case"video":case"audio":for(c=0;c<fl.length;c++)At(fl[c],s);break;case"source":At("error",s);break;case"img":case"image":case"link":At("error",s),At("load",s);break;case"details":At("toggle",s);break;case"input":At("invalid",s),Aa(s,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":At("invalid",s);break;case"textarea":At("invalid",s),_o(s,p.value,p.defaultValue,p.children)}c=p.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||s.textContent===""+c||p.suppressHydrationWarning===!0||Tv(s.textContent,c)?(p.popover!=null&&(At("beforetoggle",s),At("toggle",s)),p.onScroll!=null&&At("scroll",s),p.onScrollEnd!=null&&At("scrollend",s),p.onClick!=null&&(s.onclick=De),s=!0):s=!1,s||Bs(r,!0)}function ay(r){for(Zn=r.return;Zn;)switch(Zn.tag){case 5:case 31:case 13:li=!1;return;case 27:case 3:li=!0;return;default:Zn=Zn.return}}function Co(r){if(r!==Zn)return!1;if(!Rt)return ay(r),Rt=!0,!1;var s=r.tag,c;if((c=s!==3&&s!==27)&&((c=s===5)&&(c=r.type,c=!(c!=="form"&&c!=="button")||bg(r.type,r.memoizedProps)),c=!c),c&&on&&Bs(r),ay(r),s===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));on=Iv(r)}else if(s===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));on=Iv(r)}else s===27?(s=on,Js(r.type)?(r=Tg,Tg=null,on=r):on=s):on=Zn?di(r.stateNode.nextSibling):null;return!0}function Ra(){on=Zn=null,Rt=!1}function ep(){var r=Hs;return r!==null&&(Nr===null?Nr=r:Nr.push.apply(Nr,r),Hs=null),r}function qc(r){Hs===null?Hs=[r]:Hs.push(r)}var tp=M(null),Na=null,rs=null;function Us(r,s,c){D(tp,s._currentValue),s._currentValue=c}function is(r){r._currentValue=tp.current,q(tp)}function np(r,s,c){for(;r!==null;){var p=r.alternate;if((r.childLanes&s)!==s?(r.childLanes|=s,p!==null&&(p.childLanes|=s)):p!==null&&(p.childLanes&s)!==s&&(p.childLanes|=s),r===c)break;r=r.return}}function rp(r,s,c,p){var y=r.child;for(y!==null&&(y.return=r);y!==null;){var A=y.dependencies;if(A!==null){var w=y.child;A=A.firstContext;e:for(;A!==null;){var H=A;A=y;for(var Q=0;Q<s.length;Q++)if(H.context===s[Q]){A.lanes|=c,H=A.alternate,H!==null&&(H.lanes|=c),np(A.return,c,r),p||(w=null);break e}A=H.next}}else if(y.tag===18){if(w=y.return,w===null)throw Error(i(341));w.lanes|=c,A=w.alternate,A!==null&&(A.lanes|=c),np(w,c,r),w=null}else w=y.child;if(w!==null)w.return=y;else for(w=y;w!==null;){if(w===r){w=null;break}if(y=w.sibling,y!==null){y.return=w.return,w=y;break}w=w.return}y=w}}function xo(r,s,c,p){r=null;for(var y=s,A=!1;y!==null;){if(!A){if((y.flags&524288)!==0)A=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var w=y.alternate;if(w===null)throw Error(i(387));if(w=w.memoizedProps,w!==null){var H=y.type;Br(y.pendingProps.value,w.value)||(r!==null?r.push(H):r=[H])}}else if(y===Ee.current){if(w=y.alternate,w===null)throw Error(i(387));w.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(r!==null?r.push(bl):r=[bl])}y=y.return}r!==null&&rp(s,r,c,p),s.flags|=262144}function Nf(r){for(r=r.firstContext;r!==null;){if(!Br(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Ia(r){Na=r,rs=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function Wn(r){return oy(Na,r)}function If(r,s){return Na===null&&Ia(r),oy(r,s)}function oy(r,s){var c=s._currentValue;if(s={context:s,memoizedValue:c,next:null},rs===null){if(r===null)throw Error(i(308));rs=s,r.dependencies={lanes:0,firstContext:s},r.flags|=524288}else rs=rs.next=s;return c}var E2=typeof AbortController<"u"?AbortController:function(){var r=[],s=this.signal={aborted:!1,addEventListener:function(c,p){r.push(p)}};this.abort=function(){s.aborted=!0,r.forEach(function(c){return c()})}},v2=e.unstable_scheduleCallback,T2=e.unstable_NormalPriority,jn={$$typeof:x,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ip(){return{controller:new E2,data:new Map,refCount:0}}function Gc(r){r.refCount--,r.refCount===0&&v2(T2,function(){r.controller.abort()})}var Kc=null,sp=0,wo=0,Ro=null;function A2(r,s){if(Kc===null){var c=Kc=[];sp=0,wo=cg(),Ro={status:"pending",value:void 0,then:function(p){c.push(p)}}}return sp++,s.then(cy,cy),s}function cy(){if(--sp===0&&Kc!==null){Ro!==null&&(Ro.status="fulfilled");var r=Kc;Kc=null,wo=0,Ro=null;for(var s=0;s<r.length;s++)(0,r[s])()}}function O2(r,s){var c=[],p={status:"pending",value:null,reason:null,then:function(y){c.push(y)}};return r.then(function(){p.status="fulfilled",p.value=s;for(var y=0;y<c.length;y++)(0,c[y])(s)},function(y){for(p.status="rejected",p.reason=y,y=0;y<c.length;y++)(0,c[y])(void 0)}),p}var ly=U.S;U.S=function(r,s){KE=Lt(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&A2(r,s),ly!==null&&ly(r,s)};var ka=M(null);function ap(){var r=ka.current;return r!==null?r:Xt.pooledCache}function kf(r,s){s===null?D(ka,ka.current):D(ka,s.pool)}function uy(){var r=ap();return r===null?null:{parent:jn._currentValue,pool:r}}var No=Error(i(460)),op=Error(i(474)),Mf=Error(i(542)),Pf={then:function(){}};function dy(r){return r=r.status,r==="fulfilled"||r==="rejected"}function fy(r,s,c){switch(c=r[c],c===void 0?r.push(s):c!==s&&(s.then(De,De),s=c),s.status){case"fulfilled":return s.value;case"rejected":throw r=s.reason,my(r),r;default:if(typeof s.status=="string")s.then(De,De);else{if(r=Xt,r!==null&&100<r.shellSuspendCounter)throw Error(i(482));r=s,r.status="pending",r.then(function(p){if(s.status==="pending"){var y=s;y.status="fulfilled",y.value=p}},function(p){if(s.status==="pending"){var y=s;y.status="rejected",y.reason=p}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw r=s.reason,my(r),r}throw Pa=s,No}}function Ma(r){try{var s=r._init;return s(r._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(Pa=c,No):c}}var Pa=null;function hy(){if(Pa===null)throw Error(i(459));var r=Pa;return Pa=null,r}function my(r){if(r===No||r===Mf)throw Error(i(483))}var Io=null,Yc=0;function Df(r){var s=Yc;return Yc+=1,Io===null&&(Io=[]),fy(Io,r,s)}function Vc(r,s){s=s.props.ref,r.ref=s!==void 0?s:null}function jf(r,s){throw s.$$typeof===g?Error(i(525)):(r=Object.prototype.toString.call(s),Error(i(31,r==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":r)))}function py(r){function s(se,ne){if(r){var ce=se.deletions;ce===null?(se.deletions=[ne],se.flags|=16):ce.push(ne)}}function c(se,ne){if(!r)return null;for(;ne!==null;)s(se,ne),ne=ne.sibling;return null}function p(se){for(var ne=new Map;se!==null;)se.key!==null?ne.set(se.key,se):ne.set(se.index,se),se=se.sibling;return ne}function y(se,ne){return se=ts(se,ne),se.index=0,se.sibling=null,se}function A(se,ne,ce){return se.index=ce,r?(ce=se.alternate,ce!==null?(ce=ce.index,ce<ne?(se.flags|=67108866,ne):ce):(se.flags|=67108866,ne)):(se.flags|=1048576,ne)}function w(se){return r&&se.alternate===null&&(se.flags|=67108866),se}function H(se,ne,ce,Te){return ne===null||ne.tag!==6?(ne=Zm(ce,se.mode,Te),ne.return=se,ne):(ne=y(ne,ce),ne.return=se,ne)}function Q(se,ne,ce,Te){var Qe=ce.type;return Qe===T?_e(se,ne,ce.props.children,Te,ce.key):ne!==null&&(ne.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===P&&Ma(Qe)===ne.type)?(ne=y(ne,ce.props),Vc(ne,ce),ne.return=se,ne):(ne=wf(ce.type,ce.key,ce.props,null,se.mode,Te),Vc(ne,ce),ne.return=se,ne)}function ue(se,ne,ce,Te){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==ce.containerInfo||ne.stateNode.implementation!==ce.implementation?(ne=Wm(ce,se.mode,Te),ne.return=se,ne):(ne=y(ne,ce.children||[]),ne.return=se,ne)}function _e(se,ne,ce,Te,Qe){return ne===null||ne.tag!==7?(ne=wa(ce,se.mode,Te,Qe),ne.return=se,ne):(ne=y(ne,ce),ne.return=se,ne)}function Oe(se,ne,ce){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return ne=Zm(""+ne,se.mode,ce),ne.return=se,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case b:return ce=wf(ne.type,ne.key,ne.props,null,se.mode,ce),Vc(ce,ne),ce.return=se,ce;case E:return ne=Wm(ne,se.mode,ce),ne.return=se,ne;case P:return ne=Ma(ne),Oe(se,ne,ce)}if(Z(ne)||F(ne))return ne=wa(ne,se.mode,ce,null),ne.return=se,ne;if(typeof ne.then=="function")return Oe(se,Df(ne),ce);if(ne.$$typeof===x)return Oe(se,If(se,ne),ce);jf(se,ne)}return null}function he(se,ne,ce,Te){var Qe=ne!==null?ne.key:null;if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return Qe!==null?null:H(se,ne,""+ce,Te);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case b:return ce.key===Qe?Q(se,ne,ce,Te):null;case E:return ce.key===Qe?ue(se,ne,ce,Te):null;case P:return ce=Ma(ce),he(se,ne,ce,Te)}if(Z(ce)||F(ce))return Qe!==null?null:_e(se,ne,ce,Te,null);if(typeof ce.then=="function")return he(se,ne,Df(ce),Te);if(ce.$$typeof===x)return he(se,ne,If(se,ce),Te);jf(se,ce)}return null}function me(se,ne,ce,Te,Qe){if(typeof Te=="string"&&Te!==""||typeof Te=="number"||typeof Te=="bigint")return se=se.get(ce)||null,H(ne,se,""+Te,Qe);if(typeof Te=="object"&&Te!==null){switch(Te.$$typeof){case b:return se=se.get(Te.key===null?ce:Te.key)||null,Q(ne,se,Te,Qe);case E:return se=se.get(Te.key===null?ce:Te.key)||null,ue(ne,se,Te,Qe);case P:return Te=Ma(Te),me(se,ne,ce,Te,Qe)}if(Z(Te)||F(Te))return se=se.get(ce)||null,_e(ne,se,Te,Qe,null);if(typeof Te.then=="function")return me(se,ne,ce,Df(Te),Qe);if(Te.$$typeof===x)return me(se,ne,ce,If(ne,Te),Qe);jf(ne,Te)}return null}function ze(se,ne,ce,Te){for(var Qe=null,Mt=null,Ye=ne,dt=ne=0,xt=null;Ye!==null&&dt<ce.length;dt++){Ye.index>dt?(xt=Ye,Ye=null):xt=Ye.sibling;var Pt=he(se,Ye,ce[dt],Te);if(Pt===null){Ye===null&&(Ye=xt);break}r&&Ye&&Pt.alternate===null&&s(se,Ye),ne=A(Pt,ne,dt),Mt===null?Qe=Pt:Mt.sibling=Pt,Mt=Pt,Ye=xt}if(dt===ce.length)return c(se,Ye),Rt&&ns(se,dt),Qe;if(Ye===null){for(;dt<ce.length;dt++)Ye=Oe(se,ce[dt],Te),Ye!==null&&(ne=A(Ye,ne,dt),Mt===null?Qe=Ye:Mt.sibling=Ye,Mt=Ye);return Rt&&ns(se,dt),Qe}for(Ye=p(Ye);dt<ce.length;dt++)xt=me(Ye,se,dt,ce[dt],Te),xt!==null&&(r&&xt.alternate!==null&&Ye.delete(xt.key===null?dt:xt.key),ne=A(xt,ne,dt),Mt===null?Qe=xt:Mt.sibling=xt,Mt=xt);return r&&Ye.forEach(function(ia){return s(se,ia)}),Rt&&ns(se,dt),Qe}function et(se,ne,ce,Te){if(ce==null)throw Error(i(151));for(var Qe=null,Mt=null,Ye=ne,dt=ne=0,xt=null,Pt=ce.next();Ye!==null&&!Pt.done;dt++,Pt=ce.next()){Ye.index>dt?(xt=Ye,Ye=null):xt=Ye.sibling;var ia=he(se,Ye,Pt.value,Te);if(ia===null){Ye===null&&(Ye=xt);break}r&&Ye&&ia.alternate===null&&s(se,Ye),ne=A(ia,ne,dt),Mt===null?Qe=ia:Mt.sibling=ia,Mt=ia,Ye=xt}if(Pt.done)return c(se,Ye),Rt&&ns(se,dt),Qe;if(Ye===null){for(;!Pt.done;dt++,Pt=ce.next())Pt=Oe(se,Pt.value,Te),Pt!==null&&(ne=A(Pt,ne,dt),Mt===null?Qe=Pt:Mt.sibling=Pt,Mt=Pt);return Rt&&ns(se,dt),Qe}for(Ye=p(Ye);!Pt.done;dt++,Pt=ce.next())Pt=me(Ye,se,dt,Pt.value,Te),Pt!==null&&(r&&Pt.alternate!==null&&Ye.delete(Pt.key===null?dt:Pt.key),ne=A(Pt,ne,dt),Mt===null?Qe=Pt:Mt.sibling=Pt,Mt=Pt);return r&&Ye.forEach(function(Dk){return s(se,Dk)}),Rt&&ns(se,dt),Qe}function Vt(se,ne,ce,Te){if(typeof ce=="object"&&ce!==null&&ce.type===T&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case b:e:{for(var Qe=ce.key;ne!==null;){if(ne.key===Qe){if(Qe=ce.type,Qe===T){if(ne.tag===7){c(se,ne.sibling),Te=y(ne,ce.props.children),Te.return=se,se=Te;break e}}else if(ne.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===P&&Ma(Qe)===ne.type){c(se,ne.sibling),Te=y(ne,ce.props),Vc(Te,ce),Te.return=se,se=Te;break e}c(se,ne);break}else s(se,ne);ne=ne.sibling}ce.type===T?(Te=wa(ce.props.children,se.mode,Te,ce.key),Te.return=se,se=Te):(Te=wf(ce.type,ce.key,ce.props,null,se.mode,Te),Vc(Te,ce),Te.return=se,se=Te)}return w(se);case E:e:{for(Qe=ce.key;ne!==null;){if(ne.key===Qe)if(ne.tag===4&&ne.stateNode.containerInfo===ce.containerInfo&&ne.stateNode.implementation===ce.implementation){c(se,ne.sibling),Te=y(ne,ce.children||[]),Te.return=se,se=Te;break e}else{c(se,ne);break}else s(se,ne);ne=ne.sibling}Te=Wm(ce,se.mode,Te),Te.return=se,se=Te}return w(se);case P:return ce=Ma(ce),Vt(se,ne,ce,Te)}if(Z(ce))return ze(se,ne,ce,Te);if(F(ce)){if(Qe=F(ce),typeof Qe!="function")throw Error(i(150));return ce=Qe.call(ce),et(se,ne,ce,Te)}if(typeof ce.then=="function")return Vt(se,ne,Df(ce),Te);if(ce.$$typeof===x)return Vt(se,ne,If(se,ce),Te);jf(se,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint"?(ce=""+ce,ne!==null&&ne.tag===6?(c(se,ne.sibling),Te=y(ne,ce),Te.return=se,se=Te):(c(se,ne),Te=Zm(ce,se.mode,Te),Te.return=se,se=Te),w(se)):c(se,ne)}return function(se,ne,ce,Te){try{Yc=0;var Qe=Vt(se,ne,ce,Te);return Io=null,Qe}catch(Ye){if(Ye===No||Ye===Mf)throw Ye;var Mt=Ur(29,Ye,null,se.mode);return Mt.lanes=Te,Mt.return=se,Mt}finally{}}}var Da=py(!0),gy=py(!1),Fs=!1;function cp(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function lp(r,s){r=r.updateQueue,s.updateQueue===r&&(s.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function zs(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function $s(r,s,c){var p=r.updateQueue;if(p===null)return null;if(p=p.shared,(Ht&2)!==0){var y=p.pending;return y===null?s.next=s:(s.next=y.next,y.next=s),p.pending=s,s=xf(r),J_(r,null,c),s}return Cf(r,p,s,c),xf(r)}function Zc(r,s,c){if(s=s.updateQueue,s!==null&&(s=s.shared,(c&4194048)!==0)){var p=s.lanes;p&=r.pendingLanes,c|=p,s.lanes=c,nt(r,c)}}function up(r,s){var c=r.updateQueue,p=r.alternate;if(p!==null&&(p=p.updateQueue,c===p)){var y=null,A=null;if(c=c.firstBaseUpdate,c!==null){do{var w={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};A===null?y=A=w:A=A.next=w,c=c.next}while(c!==null);A===null?y=A=s:A=A.next=s}else y=A=s;c={baseState:p.baseState,firstBaseUpdate:y,lastBaseUpdate:A,shared:p.shared,callbacks:p.callbacks},r.updateQueue=c;return}r=c.lastBaseUpdate,r===null?c.firstBaseUpdate=s:r.next=s,c.lastBaseUpdate=s}var dp=!1;function Wc(){if(dp){var r=Ro;if(r!==null)throw r}}function Xc(r,s,c,p){dp=!1;var y=r.updateQueue;Fs=!1;var A=y.firstBaseUpdate,w=y.lastBaseUpdate,H=y.shared.pending;if(H!==null){y.shared.pending=null;var Q=H,ue=Q.next;Q.next=null,w===null?A=ue:w.next=ue,w=Q;var _e=r.alternate;_e!==null&&(_e=_e.updateQueue,H=_e.lastBaseUpdate,H!==w&&(H===null?_e.firstBaseUpdate=ue:H.next=ue,_e.lastBaseUpdate=Q))}if(A!==null){var Oe=y.baseState;w=0,_e=ue=Q=null,H=A;do{var he=H.lane&-536870913,me=he!==H.lane;if(me?(Ct&he)===he:(p&he)===he){he!==0&&he===wo&&(dp=!0),_e!==null&&(_e=_e.next={lane:0,tag:H.tag,payload:H.payload,callback:null,next:null});e:{var ze=r,et=H;he=s;var Vt=c;switch(et.tag){case 1:if(ze=et.payload,typeof ze=="function"){Oe=ze.call(Vt,Oe,he);break e}Oe=ze;break e;case 3:ze.flags=ze.flags&-65537|128;case 0:if(ze=et.payload,he=typeof ze=="function"?ze.call(Vt,Oe,he):ze,he==null)break e;Oe=m({},Oe,he);break e;case 2:Fs=!0}}he=H.callback,he!==null&&(r.flags|=64,me&&(r.flags|=8192),me=y.callbacks,me===null?y.callbacks=[he]:me.push(he))}else me={lane:he,tag:H.tag,payload:H.payload,callback:H.callback,next:null},_e===null?(ue=_e=me,Q=Oe):_e=_e.next=me,w|=he;if(H=H.next,H===null){if(H=y.shared.pending,H===null)break;me=H,H=me.next,me.next=null,y.lastBaseUpdate=me,y.shared.pending=null}}while(!0);_e===null&&(Q=Oe),y.baseState=Q,y.firstBaseUpdate=ue,y.lastBaseUpdate=_e,A===null&&(y.shared.lanes=0),Vs|=w,r.lanes=w,r.memoizedState=Oe}}function by(r,s){if(typeof r!="function")throw Error(i(191,r));r.call(s)}function _y(r,s){var c=r.callbacks;if(c!==null)for(r.callbacks=null,r=0;r<c.length;r++)by(c[r],s)}var ko=M(null),Lf=M(0);function yy(r,s){r=hs,D(Lf,r),D(ko,s),hs=r|s.baseLanes}function fp(){D(Lf,hs),D(ko,ko.current)}function hp(){hs=Lf.current,q(ko),q(Lf)}var Fr=M(null),ui=null;function qs(r){var s=r.alternate;D(In,In.current&1),D(Fr,r),ui===null&&(s===null||ko.current!==null||s.memoizedState!==null)&&(ui=r)}function mp(r){D(In,In.current),D(Fr,r),ui===null&&(ui=r)}function Ey(r){r.tag===22?(D(In,In.current),D(Fr,r),ui===null&&(ui=r)):Gs()}function Gs(){D(In,In.current),D(Fr,Fr.current)}function zr(r){q(Fr),ui===r&&(ui=null),q(In)}var In=M(0);function Hf(r){for(var s=r;s!==null;){if(s.tag===13){var c=s.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Eg(c)||vg(c)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var ss=0,lt=null,Kt=null,Ln=null,Bf=!1,Mo=!1,ja=!1,Uf=0,Qc=0,Po=null,S2=0;function On(){throw Error(i(321))}function pp(r,s){if(s===null)return!1;for(var c=0;c<s.length&&c<r.length;c++)if(!Br(r[c],s[c]))return!1;return!0}function gp(r,s,c,p,y,A){return ss=A,lt=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,U.H=r===null||r.memoizedState===null?rE:Ip,ja=!1,A=c(p,y),ja=!1,Mo&&(A=Ty(s,c,p,y)),vy(r),A}function vy(r){U.H=tl;var s=Kt!==null&&Kt.next!==null;if(ss=0,Ln=Kt=lt=null,Bf=!1,Qc=0,Po=null,s)throw Error(i(300));r===null||Hn||(r=r.dependencies,r!==null&&Nf(r)&&(Hn=!0))}function Ty(r,s,c,p){lt=r;var y=0;do{if(Mo&&(Po=null),Qc=0,Mo=!1,25<=y)throw Error(i(301));if(y+=1,Ln=Kt=null,r.updateQueue!=null){var A=r.updateQueue;A.lastEffect=null,A.events=null,A.stores=null,A.memoCache!=null&&(A.memoCache.index=0)}U.H=iE,A=s(c,p)}while(Mo);return A}function C2(){var r=U.H,s=r.useState()[0];return s=typeof s.then=="function"?Jc(s):s,r=r.useState()[0],(Kt!==null?Kt.memoizedState:null)!==r&&(lt.flags|=1024),s}function bp(){var r=Uf!==0;return Uf=0,r}function _p(r,s,c){s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~c}function yp(r){if(Bf){for(r=r.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}Bf=!1}ss=0,Ln=Kt=lt=null,Mo=!1,Qc=Uf=0,Po=null}function gr(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ln===null?lt.memoizedState=Ln=r:Ln=Ln.next=r,Ln}function kn(){if(Kt===null){var r=lt.alternate;r=r!==null?r.memoizedState:null}else r=Kt.next;var s=Ln===null?lt.memoizedState:Ln.next;if(s!==null)Ln=s,Kt=r;else{if(r===null)throw lt.alternate===null?Error(i(467)):Error(i(310));Kt=r,r={memoizedState:Kt.memoizedState,baseState:Kt.baseState,baseQueue:Kt.baseQueue,queue:Kt.queue,next:null},Ln===null?lt.memoizedState=Ln=r:Ln=Ln.next=r}return Ln}function Ff(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Jc(r){var s=Qc;return Qc+=1,Po===null&&(Po=[]),r=fy(Po,r,s),s=lt,(Ln===null?s.memoizedState:Ln.next)===null&&(s=s.alternate,U.H=s===null||s.memoizedState===null?rE:Ip),r}function zf(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Jc(r);if(r.$$typeof===x)return Wn(r)}throw Error(i(438,String(r)))}function Ep(r){var s=null,c=lt.updateQueue;if(c!==null&&(s=c.memoCache),s==null){var p=lt.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(s={data:p.data.map(function(y){return y.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),c===null&&(c=Ff(),lt.updateQueue=c),c.memoCache=s,c=s.data[s.index],c===void 0)for(c=s.data[s.index]=Array(r),p=0;p<r;p++)c[p]=L;return s.index++,c}function as(r,s){return typeof s=="function"?s(r):s}function $f(r){var s=kn();return vp(s,Kt,r)}function vp(r,s,c){var p=r.queue;if(p===null)throw Error(i(311));p.lastRenderedReducer=c;var y=r.baseQueue,A=p.pending;if(A!==null){if(y!==null){var w=y.next;y.next=A.next,A.next=w}s.baseQueue=y=A,p.pending=null}if(A=r.baseState,y===null)r.memoizedState=A;else{s=y.next;var H=w=null,Q=null,ue=s,_e=!1;do{var Oe=ue.lane&-536870913;if(Oe!==ue.lane?(Ct&Oe)===Oe:(ss&Oe)===Oe){var he=ue.revertLane;if(he===0)Q!==null&&(Q=Q.next={lane:0,revertLane:0,gesture:null,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null}),Oe===wo&&(_e=!0);else if((ss&he)===he){ue=ue.next,he===wo&&(_e=!0);continue}else Oe={lane:0,revertLane:ue.revertLane,gesture:null,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},Q===null?(H=Q=Oe,w=A):Q=Q.next=Oe,lt.lanes|=he,Vs|=he;Oe=ue.action,ja&&c(A,Oe),A=ue.hasEagerState?ue.eagerState:c(A,Oe)}else he={lane:Oe,revertLane:ue.revertLane,gesture:ue.gesture,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},Q===null?(H=Q=he,w=A):Q=Q.next=he,lt.lanes|=Oe,Vs|=Oe;ue=ue.next}while(ue!==null&&ue!==s);if(Q===null?w=A:Q.next=H,!Br(A,r.memoizedState)&&(Hn=!0,_e&&(c=Ro,c!==null)))throw c;r.memoizedState=A,r.baseState=w,r.baseQueue=Q,p.lastRenderedState=A}return y===null&&(p.lanes=0),[r.memoizedState,p.dispatch]}function Tp(r){var s=kn(),c=s.queue;if(c===null)throw Error(i(311));c.lastRenderedReducer=r;var p=c.dispatch,y=c.pending,A=s.memoizedState;if(y!==null){c.pending=null;var w=y=y.next;do A=r(A,w.action),w=w.next;while(w!==y);Br(A,s.memoizedState)||(Hn=!0),s.memoizedState=A,s.baseQueue===null&&(s.baseState=A),c.lastRenderedState=A}return[A,p]}function Ay(r,s,c){var p=lt,y=kn(),A=Rt;if(A){if(c===void 0)throw Error(i(407));c=c()}else c=s();var w=!Br((Kt||y).memoizedState,c);if(w&&(y.memoizedState=c,Hn=!0),y=y.queue,Sp(Cy.bind(null,p,y,r),[r]),y.getSnapshot!==s||w||Ln!==null&&Ln.memoizedState.tag&1){if(p.flags|=2048,Do(9,{destroy:void 0},Sy.bind(null,p,y,c,s),null),Xt===null)throw Error(i(349));A||(ss&127)!==0||Oy(p,s,c)}return c}function Oy(r,s,c){r.flags|=16384,r={getSnapshot:s,value:c},s=lt.updateQueue,s===null?(s=Ff(),lt.updateQueue=s,s.stores=[r]):(c=s.stores,c===null?s.stores=[r]:c.push(r))}function Sy(r,s,c,p){s.value=c,s.getSnapshot=p,xy(s)&&wy(r)}function Cy(r,s,c){return c(function(){xy(s)&&wy(r)})}function xy(r){var s=r.getSnapshot;r=r.value;try{var c=s();return!Br(r,c)}catch{return!0}}function wy(r){var s=xa(r,2);s!==null&&Ir(s,r,2)}function Ap(r){var s=gr();if(typeof r=="function"){var c=r;if(r=c(),ja){or(!0);try{c()}finally{or(!1)}}}return s.memoizedState=s.baseState=r,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:r},s}function Ry(r,s,c,p){return r.baseState=c,vp(r,Kt,typeof p=="function"?p:as)}function x2(r,s,c,p,y){if(Kf(r))throw Error(i(485));if(r=s.action,r!==null){var A={payload:y,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){A.listeners.push(w)}};U.T!==null?c(!0):A.isTransition=!1,p(A),c=s.pending,c===null?(A.next=s.pending=A,Ny(s,A)):(A.next=c.next,s.pending=c.next=A)}}function Ny(r,s){var c=s.action,p=s.payload,y=r.state;if(s.isTransition){var A=U.T,w={};U.T=w;try{var H=c(y,p),Q=U.S;Q!==null&&Q(w,H),Iy(r,s,H)}catch(ue){Op(r,s,ue)}finally{A!==null&&w.types!==null&&(A.types=w.types),U.T=A}}else try{A=c(y,p),Iy(r,s,A)}catch(ue){Op(r,s,ue)}}function Iy(r,s,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(p){ky(r,s,p)},function(p){return Op(r,s,p)}):ky(r,s,c)}function ky(r,s,c){s.status="fulfilled",s.value=c,My(s),r.state=c,s=r.pending,s!==null&&(c=s.next,c===s?r.pending=null:(c=c.next,s.next=c,Ny(r,c)))}function Op(r,s,c){var p=r.pending;if(r.pending=null,p!==null){p=p.next;do s.status="rejected",s.reason=c,My(s),s=s.next;while(s!==p)}r.action=null}function My(r){r=r.listeners;for(var s=0;s<r.length;s++)(0,r[s])()}function Py(r,s){return s}function Dy(r,s){if(Rt){var c=Xt.formState;if(c!==null){e:{var p=lt;if(Rt){if(on){t:{for(var y=on,A=li;y.nodeType!==8;){if(!A){y=null;break t}if(y=di(y.nextSibling),y===null){y=null;break t}}A=y.data,y=A==="F!"||A==="F"?y:null}if(y){on=di(y.nextSibling),p=y.data==="F!";break e}}Bs(p)}p=!1}p&&(s=c[0])}}return c=gr(),c.memoizedState=c.baseState=s,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Py,lastRenderedState:s},c.queue=p,c=eE.bind(null,lt,p),p.dispatch=c,p=Ap(!1),A=Np.bind(null,lt,!1,p.queue),p=gr(),y={state:s,dispatch:null,action:r,pending:null},p.queue=y,c=x2.bind(null,lt,y,A,c),y.dispatch=c,p.memoizedState=r,[s,c,!1]}function jy(r){var s=kn();return Ly(s,Kt,r)}function Ly(r,s,c){if(s=vp(r,s,Py)[0],r=$f(as)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var p=Jc(s)}catch(w){throw w===No?Mf:w}else p=s;s=kn();var y=s.queue,A=y.dispatch;return c!==s.memoizedState&&(lt.flags|=2048,Do(9,{destroy:void 0},w2.bind(null,y,c),null)),[p,A,r]}function w2(r,s){r.action=s}function Hy(r){var s=kn(),c=Kt;if(c!==null)return Ly(s,c,r);kn(),s=s.memoizedState,c=kn();var p=c.queue.dispatch;return c.memoizedState=r,[s,p,!1]}function Do(r,s,c,p){return r={tag:r,create:c,deps:p,inst:s,next:null},s=lt.updateQueue,s===null&&(s=Ff(),lt.updateQueue=s),c=s.lastEffect,c===null?s.lastEffect=r.next=r:(p=c.next,c.next=r,r.next=p,s.lastEffect=r),r}function By(){return kn().memoizedState}function qf(r,s,c,p){var y=gr();lt.flags|=r,y.memoizedState=Do(1|s,{destroy:void 0},c,p===void 0?null:p)}function Gf(r,s,c,p){var y=kn();p=p===void 0?null:p;var A=y.memoizedState.inst;Kt!==null&&p!==null&&pp(p,Kt.memoizedState.deps)?y.memoizedState=Do(s,A,c,p):(lt.flags|=r,y.memoizedState=Do(1|s,A,c,p))}function Uy(r,s){qf(8390656,8,r,s)}function Sp(r,s){Gf(2048,8,r,s)}function R2(r){lt.flags|=4;var s=lt.updateQueue;if(s===null)s=Ff(),lt.updateQueue=s,s.events=[r];else{var c=s.events;c===null?s.events=[r]:c.push(r)}}function Fy(r){var s=kn().memoizedState;return R2({ref:s,nextImpl:r}),function(){if((Ht&2)!==0)throw Error(i(440));return s.impl.apply(void 0,arguments)}}function zy(r,s){return Gf(4,2,r,s)}function $y(r,s){return Gf(4,4,r,s)}function qy(r,s){if(typeof s=="function"){r=r();var c=s(r);return function(){typeof c=="function"?c():s(null)}}if(s!=null)return r=r(),s.current=r,function(){s.current=null}}function Gy(r,s,c){c=c!=null?c.concat([r]):null,Gf(4,4,qy.bind(null,s,r),c)}function Cp(){}function Ky(r,s){var c=kn();s=s===void 0?null:s;var p=c.memoizedState;return s!==null&&pp(s,p[1])?p[0]:(c.memoizedState=[r,s],r)}function Yy(r,s){var c=kn();s=s===void 0?null:s;var p=c.memoizedState;if(s!==null&&pp(s,p[1]))return p[0];if(p=r(),ja){or(!0);try{r()}finally{or(!1)}}return c.memoizedState=[p,s],p}function xp(r,s,c){return c===void 0||(ss&1073741824)!==0&&(Ct&261930)===0?r.memoizedState=s:(r.memoizedState=c,r=VE(),lt.lanes|=r,Vs|=r,c)}function Vy(r,s,c,p){return Br(c,s)?c:ko.current!==null?(r=xp(r,c,p),Br(r,s)||(Hn=!0),r):(ss&42)===0||(ss&1073741824)!==0&&(Ct&261930)===0?(Hn=!0,r.memoizedState=c):(r=VE(),lt.lanes|=r,Vs|=r,s)}function Zy(r,s,c,p,y){var A=Y.p;Y.p=A!==0&&8>A?A:8;var w=U.T,H={};U.T=H,Np(r,!1,s,c);try{var Q=y(),ue=U.S;if(ue!==null&&ue(H,Q),Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var _e=O2(Q,p);el(r,s,_e,Gr(r))}else el(r,s,p,Gr(r))}catch(Oe){el(r,s,{then:function(){},status:"rejected",reason:Oe},Gr())}finally{Y.p=A,w!==null&&H.types!==null&&(w.types=H.types),U.T=w}}function N2(){}function wp(r,s,c,p){if(r.tag!==5)throw Error(i(476));var y=Wy(r).queue;Zy(r,y,s,W,c===null?N2:function(){return Xy(r),c(p)})}function Wy(r){var s=r.memoizedState;if(s!==null)return s;s={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:W},next:null};var c={};return s.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:c},next:null},r.memoizedState=s,r=r.alternate,r!==null&&(r.memoizedState=s),s}function Xy(r){var s=Wy(r);s.next===null&&(s=r.alternate.memoizedState),el(r,s.next.queue,{},Gr())}function Rp(){return Wn(bl)}function Qy(){return kn().memoizedState}function Jy(){return kn().memoizedState}function I2(r){for(var s=r.return;s!==null;){switch(s.tag){case 24:case 3:var c=Gr();r=zs(c);var p=$s(s,r,c);p!==null&&(Ir(p,s,c),Zc(p,s,c)),s={cache:ip()},r.payload=s;return}s=s.return}}function k2(r,s,c){var p=Gr();c={lane:p,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Kf(r)?tE(s,c):(c=Ym(r,s,c,p),c!==null&&(Ir(c,r,p),nE(c,s,p)))}function eE(r,s,c){var p=Gr();el(r,s,c,p)}function el(r,s,c,p){var y={lane:p,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(Kf(r))tE(s,y);else{var A=r.alternate;if(r.lanes===0&&(A===null||A.lanes===0)&&(A=s.lastRenderedReducer,A!==null))try{var w=s.lastRenderedState,H=A(w,c);if(y.hasEagerState=!0,y.eagerState=H,Br(H,w))return Cf(r,s,y,0),Xt===null&&Sf(),!1}catch{}finally{}if(c=Ym(r,s,y,p),c!==null)return Ir(c,r,p),nE(c,s,p),!0}return!1}function Np(r,s,c,p){if(p={lane:2,revertLane:cg(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Kf(r)){if(s)throw Error(i(479))}else s=Ym(r,c,p,2),s!==null&&Ir(s,r,2)}function Kf(r){var s=r.alternate;return r===lt||s!==null&&s===lt}function tE(r,s){Mo=Bf=!0;var c=r.pending;c===null?s.next=s:(s.next=c.next,c.next=s),r.pending=s}function nE(r,s,c){if((c&4194048)!==0){var p=s.lanes;p&=r.pendingLanes,c|=p,s.lanes=c,nt(r,c)}}var tl={readContext:Wn,use:zf,useCallback:On,useContext:On,useEffect:On,useImperativeHandle:On,useLayoutEffect:On,useInsertionEffect:On,useMemo:On,useReducer:On,useRef:On,useState:On,useDebugValue:On,useDeferredValue:On,useTransition:On,useSyncExternalStore:On,useId:On,useHostTransitionStatus:On,useFormState:On,useActionState:On,useOptimistic:On,useMemoCache:On,useCacheRefresh:On};tl.useEffectEvent=On;var rE={readContext:Wn,use:zf,useCallback:function(r,s){return gr().memoizedState=[r,s===void 0?null:s],r},useContext:Wn,useEffect:Uy,useImperativeHandle:function(r,s,c){c=c!=null?c.concat([r]):null,qf(4194308,4,qy.bind(null,s,r),c)},useLayoutEffect:function(r,s){return qf(4194308,4,r,s)},useInsertionEffect:function(r,s){qf(4,2,r,s)},useMemo:function(r,s){var c=gr();s=s===void 0?null:s;var p=r();if(ja){or(!0);try{r()}finally{or(!1)}}return c.memoizedState=[p,s],p},useReducer:function(r,s,c){var p=gr();if(c!==void 0){var y=c(s);if(ja){or(!0);try{c(s)}finally{or(!1)}}}else y=s;return p.memoizedState=p.baseState=y,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:y},p.queue=r,r=r.dispatch=k2.bind(null,lt,r),[p.memoizedState,r]},useRef:function(r){var s=gr();return r={current:r},s.memoizedState=r},useState:function(r){r=Ap(r);var s=r.queue,c=eE.bind(null,lt,s);return s.dispatch=c,[r.memoizedState,c]},useDebugValue:Cp,useDeferredValue:function(r,s){var c=gr();return xp(c,r,s)},useTransition:function(){var r=Ap(!1);return r=Zy.bind(null,lt,r.queue,!0,!1),gr().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,s,c){var p=lt,y=gr();if(Rt){if(c===void 0)throw Error(i(407));c=c()}else{if(c=s(),Xt===null)throw Error(i(349));(Ct&127)!==0||Oy(p,s,c)}y.memoizedState=c;var A={value:c,getSnapshot:s};return y.queue=A,Uy(Cy.bind(null,p,A,r),[r]),p.flags|=2048,Do(9,{destroy:void 0},Sy.bind(null,p,A,c,s),null),c},useId:function(){var r=gr(),s=Xt.identifierPrefix;if(Rt){var c=Ui,p=Bi;c=(p&~(1<<32-Ft(p)-1)).toString(32)+c,s="_"+s+"R_"+c,c=Uf++,0<c&&(s+="H"+c.toString(32)),s+="_"}else c=S2++,s="_"+s+"r_"+c.toString(32)+"_";return r.memoizedState=s},useHostTransitionStatus:Rp,useFormState:Dy,useActionState:Dy,useOptimistic:function(r){var s=gr();s.memoizedState=s.baseState=r;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=c,s=Np.bind(null,lt,!0,c),c.dispatch=s,[r,s]},useMemoCache:Ep,useCacheRefresh:function(){return gr().memoizedState=I2.bind(null,lt)},useEffectEvent:function(r){var s=gr(),c={impl:r};return s.memoizedState=c,function(){if((Ht&2)!==0)throw Error(i(440));return c.impl.apply(void 0,arguments)}}},Ip={readContext:Wn,use:zf,useCallback:Ky,useContext:Wn,useEffect:Sp,useImperativeHandle:Gy,useInsertionEffect:zy,useLayoutEffect:$y,useMemo:Yy,useReducer:$f,useRef:By,useState:function(){return $f(as)},useDebugValue:Cp,useDeferredValue:function(r,s){var c=kn();return Vy(c,Kt.memoizedState,r,s)},useTransition:function(){var r=$f(as)[0],s=kn().memoizedState;return[typeof r=="boolean"?r:Jc(r),s]},useSyncExternalStore:Ay,useId:Qy,useHostTransitionStatus:Rp,useFormState:jy,useActionState:jy,useOptimistic:function(r,s){var c=kn();return Ry(c,Kt,r,s)},useMemoCache:Ep,useCacheRefresh:Jy};Ip.useEffectEvent=Fy;var iE={readContext:Wn,use:zf,useCallback:Ky,useContext:Wn,useEffect:Sp,useImperativeHandle:Gy,useInsertionEffect:zy,useLayoutEffect:$y,useMemo:Yy,useReducer:Tp,useRef:By,useState:function(){return Tp(as)},useDebugValue:Cp,useDeferredValue:function(r,s){var c=kn();return Kt===null?xp(c,r,s):Vy(c,Kt.memoizedState,r,s)},useTransition:function(){var r=Tp(as)[0],s=kn().memoizedState;return[typeof r=="boolean"?r:Jc(r),s]},useSyncExternalStore:Ay,useId:Qy,useHostTransitionStatus:Rp,useFormState:Hy,useActionState:Hy,useOptimistic:function(r,s){var c=kn();return Kt!==null?Ry(c,Kt,r,s):(c.baseState=r,[r,c.queue.dispatch])},useMemoCache:Ep,useCacheRefresh:Jy};iE.useEffectEvent=Fy;function kp(r,s,c,p){s=r.memoizedState,c=c(p,s),c=c==null?s:m({},s,c),r.memoizedState=c,r.lanes===0&&(r.updateQueue.baseState=c)}var Mp={enqueueSetState:function(r,s,c){r=r._reactInternals;var p=Gr(),y=zs(p);y.payload=s,c!=null&&(y.callback=c),s=$s(r,y,p),s!==null&&(Ir(s,r,p),Zc(s,r,p))},enqueueReplaceState:function(r,s,c){r=r._reactInternals;var p=Gr(),y=zs(p);y.tag=1,y.payload=s,c!=null&&(y.callback=c),s=$s(r,y,p),s!==null&&(Ir(s,r,p),Zc(s,r,p))},enqueueForceUpdate:function(r,s){r=r._reactInternals;var c=Gr(),p=zs(c);p.tag=2,s!=null&&(p.callback=s),s=$s(r,p,c),s!==null&&(Ir(s,r,c),Zc(s,r,c))}};function sE(r,s,c,p,y,A,w){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(p,A,w):s.prototype&&s.prototype.isPureReactComponent?!Fc(c,p)||!Fc(y,A):!0}function aE(r,s,c,p){r=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(c,p),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(c,p),s.state!==r&&Mp.enqueueReplaceState(s,s.state,null)}function La(r,s){var c=s;if("ref"in s){c={};for(var p in s)p!=="ref"&&(c[p]=s[p])}if(r=r.defaultProps){c===s&&(c=m({},c));for(var y in r)c[y]===void 0&&(c[y]=r[y])}return c}function oE(r){Of(r)}function cE(r){console.error(r)}function lE(r){Of(r)}function Yf(r,s){try{var c=r.onUncaughtError;c(s.value,{componentStack:s.stack})}catch(p){setTimeout(function(){throw p})}}function uE(r,s,c){try{var p=r.onCaughtError;p(c.value,{componentStack:c.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function Pp(r,s,c){return c=zs(c),c.tag=3,c.payload={element:null},c.callback=function(){Yf(r,s)},c}function dE(r){return r=zs(r),r.tag=3,r}function fE(r,s,c,p){var y=c.type.getDerivedStateFromError;if(typeof y=="function"){var A=p.value;r.payload=function(){return y(A)},r.callback=function(){uE(s,c,p)}}var w=c.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(r.callback=function(){uE(s,c,p),typeof y!="function"&&(Zs===null?Zs=new Set([this]):Zs.add(this));var H=p.stack;this.componentDidCatch(p.value,{componentStack:H!==null?H:""})})}function M2(r,s,c,p,y){if(c.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(s=c.alternate,s!==null&&xo(s,c,y,!0),c=Fr.current,c!==null){switch(c.tag){case 31:case 13:return ui===null?sh():c.alternate===null&&Sn===0&&(Sn=3),c.flags&=-257,c.flags|=65536,c.lanes=y,p===Pf?c.flags|=16384:(s=c.updateQueue,s===null?c.updateQueue=new Set([p]):s.add(p),sg(r,p,y)),!1;case 22:return c.flags|=65536,p===Pf?c.flags|=16384:(s=c.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([p])},c.updateQueue=s):(c=s.retryQueue,c===null?s.retryQueue=new Set([p]):c.add(p)),sg(r,p,y)),!1}throw Error(i(435,c.tag))}return sg(r,p,y),sh(),!1}if(Rt)return s=Fr.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=y,p!==Jm&&(r=Error(i(422),{cause:p}),qc(ai(r,c)))):(p!==Jm&&(s=Error(i(423),{cause:p}),qc(ai(s,c))),r=r.current.alternate,r.flags|=65536,y&=-y,r.lanes|=y,p=ai(p,c),y=Pp(r.stateNode,p,y),up(r,y),Sn!==4&&(Sn=2)),!1;var A=Error(i(520),{cause:p});if(A=ai(A,c),ll===null?ll=[A]:ll.push(A),Sn!==4&&(Sn=2),s===null)return!0;p=ai(p,c),c=s;do{switch(c.tag){case 3:return c.flags|=65536,r=y&-y,c.lanes|=r,r=Pp(c.stateNode,p,r),up(c,r),!1;case 1:if(s=c.type,A=c.stateNode,(c.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||A!==null&&typeof A.componentDidCatch=="function"&&(Zs===null||!Zs.has(A))))return c.flags|=65536,y&=-y,c.lanes|=y,y=dE(y),fE(y,r,c,p),up(c,y),!1}c=c.return}while(c!==null);return!1}var Dp=Error(i(461)),Hn=!1;function Xn(r,s,c,p){s.child=r===null?gy(s,null,c,p):Da(s,r.child,c,p)}function hE(r,s,c,p,y){c=c.render;var A=s.ref;if("ref"in p){var w={};for(var H in p)H!=="ref"&&(w[H]=p[H])}else w=p;return Ia(s),p=gp(r,s,c,w,A,y),H=bp(),r!==null&&!Hn?(_p(r,s,y),os(r,s,y)):(Rt&&H&&Xm(s),s.flags|=1,Xn(r,s,p,y),s.child)}function mE(r,s,c,p,y){if(r===null){var A=c.type;return typeof A=="function"&&!Vm(A)&&A.defaultProps===void 0&&c.compare===null?(s.tag=15,s.type=A,pE(r,s,A,p,y)):(r=wf(c.type,null,p,s,s.mode,y),r.ref=s.ref,r.return=s,s.child=r)}if(A=r.child,!$p(r,y)){var w=A.memoizedProps;if(c=c.compare,c=c!==null?c:Fc,c(w,p)&&r.ref===s.ref)return os(r,s,y)}return s.flags|=1,r=ts(A,p),r.ref=s.ref,r.return=s,s.child=r}function pE(r,s,c,p,y){if(r!==null){var A=r.memoizedProps;if(Fc(A,p)&&r.ref===s.ref)if(Hn=!1,s.pendingProps=p=A,$p(r,y))(r.flags&131072)!==0&&(Hn=!0);else return s.lanes=r.lanes,os(r,s,y)}return jp(r,s,c,p,y)}function gE(r,s,c,p){var y=p.children,A=r!==null?r.memoizedState:null;if(r===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((s.flags&128)!==0){if(A=A!==null?A.baseLanes|c:c,r!==null){for(p=s.child=r.child,y=0;p!==null;)y=y|p.lanes|p.childLanes,p=p.sibling;p=y&~A}else p=0,s.child=null;return bE(r,s,A,c,p)}if((c&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},r!==null&&kf(s,A!==null?A.cachePool:null),A!==null?yy(s,A):fp(),Ey(s);else return p=s.lanes=536870912,bE(r,s,A!==null?A.baseLanes|c:c,c,p)}else A!==null?(kf(s,A.cachePool),yy(s,A),Gs(),s.memoizedState=null):(r!==null&&kf(s,null),fp(),Gs());return Xn(r,s,y,c),s.child}function nl(r,s){return r!==null&&r.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function bE(r,s,c,p,y){var A=ap();return A=A===null?null:{parent:jn._currentValue,pool:A},s.memoizedState={baseLanes:c,cachePool:A},r!==null&&kf(s,null),fp(),Ey(s),r!==null&&xo(r,s,p,!0),s.childLanes=y,null}function Vf(r,s){return s=Wf({mode:s.mode,children:s.children},r.mode),s.ref=r.ref,r.child=s,s.return=r,s}function _E(r,s,c){return Da(s,r.child,null,c),r=Vf(s,s.pendingProps),r.flags|=2,zr(s),s.memoizedState=null,r}function P2(r,s,c){var p=s.pendingProps,y=(s.flags&128)!==0;if(s.flags&=-129,r===null){if(Rt){if(p.mode==="hidden")return r=Vf(s,p),s.lanes=536870912,nl(null,r);if(mp(s),(r=on)?(r=Nv(r,li),r=r!==null&&r.data==="&"?r:null,r!==null&&(s.memoizedState={dehydrated:r,treeContext:Ls!==null?{id:Bi,overflow:Ui}:null,retryLane:536870912,hydrationErrors:null},c=ty(r),c.return=s,s.child=c,Zn=s,on=null)):r=null,r===null)throw Bs(s);return s.lanes=536870912,null}return Vf(s,p)}var A=r.memoizedState;if(A!==null){var w=A.dehydrated;if(mp(s),y)if(s.flags&256)s.flags&=-257,s=_E(r,s,c);else if(s.memoizedState!==null)s.child=r.child,s.flags|=128,s=null;else throw Error(i(558));else if(Hn||xo(r,s,c,!1),y=(c&r.childLanes)!==0,Hn||y){if(p=Xt,p!==null&&(w=wn(p,c),w!==0&&w!==A.retryLane))throw A.retryLane=w,xa(r,w),Ir(p,r,w),Dp;sh(),s=_E(r,s,c)}else r=A.treeContext,on=di(w.nextSibling),Zn=s,Rt=!0,Hs=null,li=!1,r!==null&&iy(s,r),s=Vf(s,p),s.flags|=4096;return s}return r=ts(r.child,{mode:p.mode,children:p.children}),r.ref=s.ref,s.child=r,r.return=s,r}function Zf(r,s){var c=s.ref;if(c===null)r!==null&&r.ref!==null&&(s.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(i(284));(r===null||r.ref!==c)&&(s.flags|=4194816)}}function jp(r,s,c,p,y){return Ia(s),c=gp(r,s,c,p,void 0,y),p=bp(),r!==null&&!Hn?(_p(r,s,y),os(r,s,y)):(Rt&&p&&Xm(s),s.flags|=1,Xn(r,s,c,y),s.child)}function yE(r,s,c,p,y,A){return Ia(s),s.updateQueue=null,c=Ty(s,p,c,y),vy(r),p=bp(),r!==null&&!Hn?(_p(r,s,A),os(r,s,A)):(Rt&&p&&Xm(s),s.flags|=1,Xn(r,s,c,A),s.child)}function EE(r,s,c,p,y){if(Ia(s),s.stateNode===null){var A=Ao,w=c.contextType;typeof w=="object"&&w!==null&&(A=Wn(w)),A=new c(p,A),s.memoizedState=A.state!==null&&A.state!==void 0?A.state:null,A.updater=Mp,s.stateNode=A,A._reactInternals=s,A=s.stateNode,A.props=p,A.state=s.memoizedState,A.refs={},cp(s),w=c.contextType,A.context=typeof w=="object"&&w!==null?Wn(w):Ao,A.state=s.memoizedState,w=c.getDerivedStateFromProps,typeof w=="function"&&(kp(s,c,w,p),A.state=s.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof A.getSnapshotBeforeUpdate=="function"||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(w=A.state,typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount(),w!==A.state&&Mp.enqueueReplaceState(A,A.state,null),Xc(s,p,A,y),Wc(),A.state=s.memoizedState),typeof A.componentDidMount=="function"&&(s.flags|=4194308),p=!0}else if(r===null){A=s.stateNode;var H=s.memoizedProps,Q=La(c,H);A.props=Q;var ue=A.context,_e=c.contextType;w=Ao,typeof _e=="object"&&_e!==null&&(w=Wn(_e));var Oe=c.getDerivedStateFromProps;_e=typeof Oe=="function"||typeof A.getSnapshotBeforeUpdate=="function",H=s.pendingProps!==H,_e||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(H||ue!==w)&&aE(s,A,p,w),Fs=!1;var he=s.memoizedState;A.state=he,Xc(s,p,A,y),Wc(),ue=s.memoizedState,H||he!==ue||Fs?(typeof Oe=="function"&&(kp(s,c,Oe,p),ue=s.memoizedState),(Q=Fs||sE(s,c,Q,p,he,ue,w))?(_e||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount()),typeof A.componentDidMount=="function"&&(s.flags|=4194308)):(typeof A.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=p,s.memoizedState=ue),A.props=p,A.state=ue,A.context=w,p=Q):(typeof A.componentDidMount=="function"&&(s.flags|=4194308),p=!1)}else{A=s.stateNode,lp(r,s),w=s.memoizedProps,_e=La(c,w),A.props=_e,Oe=s.pendingProps,he=A.context,ue=c.contextType,Q=Ao,typeof ue=="object"&&ue!==null&&(Q=Wn(ue)),H=c.getDerivedStateFromProps,(ue=typeof H=="function"||typeof A.getSnapshotBeforeUpdate=="function")||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(w!==Oe||he!==Q)&&aE(s,A,p,Q),Fs=!1,he=s.memoizedState,A.state=he,Xc(s,p,A,y),Wc();var me=s.memoizedState;w!==Oe||he!==me||Fs||r!==null&&r.dependencies!==null&&Nf(r.dependencies)?(typeof H=="function"&&(kp(s,c,H,p),me=s.memoizedState),(_e=Fs||sE(s,c,_e,p,he,me,Q)||r!==null&&r.dependencies!==null&&Nf(r.dependencies))?(ue||typeof A.UNSAFE_componentWillUpdate!="function"&&typeof A.componentWillUpdate!="function"||(typeof A.componentWillUpdate=="function"&&A.componentWillUpdate(p,me,Q),typeof A.UNSAFE_componentWillUpdate=="function"&&A.UNSAFE_componentWillUpdate(p,me,Q)),typeof A.componentDidUpdate=="function"&&(s.flags|=4),typeof A.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof A.componentDidUpdate!="function"||w===r.memoizedProps&&he===r.memoizedState||(s.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||w===r.memoizedProps&&he===r.memoizedState||(s.flags|=1024),s.memoizedProps=p,s.memoizedState=me),A.props=p,A.state=me,A.context=Q,p=_e):(typeof A.componentDidUpdate!="function"||w===r.memoizedProps&&he===r.memoizedState||(s.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||w===r.memoizedProps&&he===r.memoizedState||(s.flags|=1024),p=!1)}return A=p,Zf(r,s),p=(s.flags&128)!==0,A||p?(A=s.stateNode,c=p&&typeof c.getDerivedStateFromError!="function"?null:A.render(),s.flags|=1,r!==null&&p?(s.child=Da(s,r.child,null,y),s.child=Da(s,null,c,y)):Xn(r,s,c,y),s.memoizedState=A.state,r=s.child):r=os(r,s,y),r}function vE(r,s,c,p){return Ra(),s.flags|=256,Xn(r,s,c,p),s.child}var Lp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Hp(r){return{baseLanes:r,cachePool:uy()}}function Bp(r,s,c){return r=r!==null?r.childLanes&~c:0,s&&(r|=qr),r}function TE(r,s,c){var p=s.pendingProps,y=!1,A=(s.flags&128)!==0,w;if((w=A)||(w=r!==null&&r.memoizedState===null?!1:(In.current&2)!==0),w&&(y=!0,s.flags&=-129),w=(s.flags&32)!==0,s.flags&=-33,r===null){if(Rt){if(y?qs(s):Gs(),(r=on)?(r=Nv(r,li),r=r!==null&&r.data!=="&"?r:null,r!==null&&(s.memoizedState={dehydrated:r,treeContext:Ls!==null?{id:Bi,overflow:Ui}:null,retryLane:536870912,hydrationErrors:null},c=ty(r),c.return=s,s.child=c,Zn=s,on=null)):r=null,r===null)throw Bs(s);return vg(r)?s.lanes=32:s.lanes=536870912,null}var H=p.children;return p=p.fallback,y?(Gs(),y=s.mode,H=Wf({mode:"hidden",children:H},y),p=wa(p,y,c,null),H.return=s,p.return=s,H.sibling=p,s.child=H,p=s.child,p.memoizedState=Hp(c),p.childLanes=Bp(r,w,c),s.memoizedState=Lp,nl(null,p)):(qs(s),Up(s,H))}var Q=r.memoizedState;if(Q!==null&&(H=Q.dehydrated,H!==null)){if(A)s.flags&256?(qs(s),s.flags&=-257,s=Fp(r,s,c)):s.memoizedState!==null?(Gs(),s.child=r.child,s.flags|=128,s=null):(Gs(),H=p.fallback,y=s.mode,p=Wf({mode:"visible",children:p.children},y),H=wa(H,y,c,null),H.flags|=2,p.return=s,H.return=s,p.sibling=H,s.child=p,Da(s,r.child,null,c),p=s.child,p.memoizedState=Hp(c),p.childLanes=Bp(r,w,c),s.memoizedState=Lp,s=nl(null,p));else if(qs(s),vg(H)){if(w=H.nextSibling&&H.nextSibling.dataset,w)var ue=w.dgst;w=ue,p=Error(i(419)),p.stack="",p.digest=w,qc({value:p,source:null,stack:null}),s=Fp(r,s,c)}else if(Hn||xo(r,s,c,!1),w=(c&r.childLanes)!==0,Hn||w){if(w=Xt,w!==null&&(p=wn(w,c),p!==0&&p!==Q.retryLane))throw Q.retryLane=p,xa(r,p),Ir(w,r,p),Dp;Eg(H)||sh(),s=Fp(r,s,c)}else Eg(H)?(s.flags|=192,s.child=r.child,s=null):(r=Q.treeContext,on=di(H.nextSibling),Zn=s,Rt=!0,Hs=null,li=!1,r!==null&&iy(s,r),s=Up(s,p.children),s.flags|=4096);return s}return y?(Gs(),H=p.fallback,y=s.mode,Q=r.child,ue=Q.sibling,p=ts(Q,{mode:"hidden",children:p.children}),p.subtreeFlags=Q.subtreeFlags&65011712,ue!==null?H=ts(ue,H):(H=wa(H,y,c,null),H.flags|=2),H.return=s,p.return=s,p.sibling=H,s.child=p,nl(null,p),p=s.child,H=r.child.memoizedState,H===null?H=Hp(c):(y=H.cachePool,y!==null?(Q=jn._currentValue,y=y.parent!==Q?{parent:Q,pool:Q}:y):y=uy(),H={baseLanes:H.baseLanes|c,cachePool:y}),p.memoizedState=H,p.childLanes=Bp(r,w,c),s.memoizedState=Lp,nl(r.child,p)):(qs(s),c=r.child,r=c.sibling,c=ts(c,{mode:"visible",children:p.children}),c.return=s,c.sibling=null,r!==null&&(w=s.deletions,w===null?(s.deletions=[r],s.flags|=16):w.push(r)),s.child=c,s.memoizedState=null,c)}function Up(r,s){return s=Wf({mode:"visible",children:s},r.mode),s.return=r,r.child=s}function Wf(r,s){return r=Ur(22,r,null,s),r.lanes=0,r}function Fp(r,s,c){return Da(s,r.child,null,c),r=Up(s,s.pendingProps.children),r.flags|=2,s.memoizedState=null,r}function AE(r,s,c){r.lanes|=s;var p=r.alternate;p!==null&&(p.lanes|=s),np(r.return,s,c)}function zp(r,s,c,p,y,A){var w=r.memoizedState;w===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:p,tail:c,tailMode:y,treeForkCount:A}:(w.isBackwards=s,w.rendering=null,w.renderingStartTime=0,w.last=p,w.tail=c,w.tailMode=y,w.treeForkCount=A)}function OE(r,s,c){var p=s.pendingProps,y=p.revealOrder,A=p.tail;p=p.children;var w=In.current,H=(w&2)!==0;if(H?(w=w&1|2,s.flags|=128):w&=1,D(In,w),Xn(r,s,p,c),p=Rt?$c:0,!H&&r!==null&&(r.flags&128)!==0)e:for(r=s.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&AE(r,c,s);else if(r.tag===19)AE(r,c,s);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break e;for(;r.sibling===null;){if(r.return===null||r.return===s)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(y){case"forwards":for(c=s.child,y=null;c!==null;)r=c.alternate,r!==null&&Hf(r)===null&&(y=c),c=c.sibling;c=y,c===null?(y=s.child,s.child=null):(y=c.sibling,c.sibling=null),zp(s,!1,y,c,A,p);break;case"backwards":case"unstable_legacy-backwards":for(c=null,y=s.child,s.child=null;y!==null;){if(r=y.alternate,r!==null&&Hf(r)===null){s.child=y;break}r=y.sibling,y.sibling=c,c=y,y=r}zp(s,!0,c,null,A,p);break;case"together":zp(s,!1,null,null,void 0,p);break;default:s.memoizedState=null}return s.child}function os(r,s,c){if(r!==null&&(s.dependencies=r.dependencies),Vs|=s.lanes,(c&s.childLanes)===0)if(r!==null){if(xo(r,s,c,!1),(c&s.childLanes)===0)return null}else return null;if(r!==null&&s.child!==r.child)throw Error(i(153));if(s.child!==null){for(r=s.child,c=ts(r,r.pendingProps),s.child=c,c.return=s;r.sibling!==null;)r=r.sibling,c=c.sibling=ts(r,r.pendingProps),c.return=s;c.sibling=null}return s.child}function $p(r,s){return(r.lanes&s)!==0?!0:(r=r.dependencies,!!(r!==null&&Nf(r)))}function D2(r,s,c){switch(s.tag){case 3:de(s,s.stateNode.containerInfo),Us(s,jn,r.memoizedState.cache),Ra();break;case 27:case 5:Pe(s);break;case 4:de(s,s.stateNode.containerInfo);break;case 10:Us(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,mp(s),null;break;case 13:var p=s.memoizedState;if(p!==null)return p.dehydrated!==null?(qs(s),s.flags|=128,null):(c&s.child.childLanes)!==0?TE(r,s,c):(qs(s),r=os(r,s,c),r!==null?r.sibling:null);qs(s);break;case 19:var y=(r.flags&128)!==0;if(p=(c&s.childLanes)!==0,p||(xo(r,s,c,!1),p=(c&s.childLanes)!==0),y){if(p)return OE(r,s,c);s.flags|=128}if(y=s.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),D(In,In.current),p)break;return null;case 22:return s.lanes=0,gE(r,s,c,s.pendingProps);case 24:Us(s,jn,r.memoizedState.cache)}return os(r,s,c)}function SE(r,s,c){if(r!==null)if(r.memoizedProps!==s.pendingProps)Hn=!0;else{if(!$p(r,c)&&(s.flags&128)===0)return Hn=!1,D2(r,s,c);Hn=(r.flags&131072)!==0}else Hn=!1,Rt&&(s.flags&1048576)!==0&&ry(s,$c,s.index);switch(s.lanes=0,s.tag){case 16:e:{var p=s.pendingProps;if(r=Ma(s.elementType),s.type=r,typeof r=="function")Vm(r)?(p=La(r,p),s.tag=1,s=EE(null,s,r,p,c)):(s.tag=0,s=jp(null,s,r,p,c));else{if(r!=null){var y=r.$$typeof;if(y===I){s.tag=11,s=hE(null,s,r,p,c);break e}else if(y===k){s.tag=14,s=mE(null,s,r,p,c);break e}}throw s=B(r)||r,Error(i(306,s,""))}}return s;case 0:return jp(r,s,s.type,s.pendingProps,c);case 1:return p=s.type,y=La(p,s.pendingProps),EE(r,s,p,y,c);case 3:e:{if(de(s,s.stateNode.containerInfo),r===null)throw Error(i(387));p=s.pendingProps;var A=s.memoizedState;y=A.element,lp(r,s),Xc(s,p,null,c);var w=s.memoizedState;if(p=w.cache,Us(s,jn,p),p!==A.cache&&rp(s,[jn],c,!0),Wc(),p=w.element,A.isDehydrated)if(A={element:p,isDehydrated:!1,cache:w.cache},s.updateQueue.baseState=A,s.memoizedState=A,s.flags&256){s=vE(r,s,p,c);break e}else if(p!==y){y=ai(Error(i(424)),s),qc(y),s=vE(r,s,p,c);break e}else{switch(r=s.stateNode.containerInfo,r.nodeType){case 9:r=r.body;break;default:r=r.nodeName==="HTML"?r.ownerDocument.body:r}for(on=di(r.firstChild),Zn=s,Rt=!0,Hs=null,li=!0,c=gy(s,null,p,c),s.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling}else{if(Ra(),p===y){s=os(r,s,c);break e}Xn(r,s,p,c)}s=s.child}return s;case 26:return Zf(r,s),r===null?(c=jv(s.type,null,s.pendingProps,null))?s.memoizedState=c:Rt||(c=s.type,r=s.pendingProps,p=fh(fe.current).createElement(c),p[Rn]=s,p[cr]=r,Qn(p,c,r),Pn(p),s.stateNode=p):s.memoizedState=jv(s.type,r.memoizedProps,s.pendingProps,r.memoizedState),null;case 27:return Pe(s),r===null&&Rt&&(p=s.stateNode=Mv(s.type,s.pendingProps,fe.current),Zn=s,li=!0,y=on,Js(s.type)?(Tg=y,on=di(p.firstChild)):on=y),Xn(r,s,s.pendingProps.children,c),Zf(r,s),r===null&&(s.flags|=4194304),s.child;case 5:return r===null&&Rt&&((y=p=on)&&(p=dk(p,s.type,s.pendingProps,li),p!==null?(s.stateNode=p,Zn=s,on=di(p.firstChild),li=!1,y=!0):y=!1),y||Bs(s)),Pe(s),y=s.type,A=s.pendingProps,w=r!==null?r.memoizedProps:null,p=A.children,bg(y,A)?p=null:w!==null&&bg(y,w)&&(s.flags|=32),s.memoizedState!==null&&(y=gp(r,s,C2,null,null,c),bl._currentValue=y),Zf(r,s),Xn(r,s,p,c),s.child;case 6:return r===null&&Rt&&((r=c=on)&&(c=fk(c,s.pendingProps,li),c!==null?(s.stateNode=c,Zn=s,on=null,r=!0):r=!1),r||Bs(s)),null;case 13:return TE(r,s,c);case 4:return de(s,s.stateNode.containerInfo),p=s.pendingProps,r===null?s.child=Da(s,null,p,c):Xn(r,s,p,c),s.child;case 11:return hE(r,s,s.type,s.pendingProps,c);case 7:return Xn(r,s,s.pendingProps,c),s.child;case 8:return Xn(r,s,s.pendingProps.children,c),s.child;case 12:return Xn(r,s,s.pendingProps.children,c),s.child;case 10:return p=s.pendingProps,Us(s,s.type,p.value),Xn(r,s,p.children,c),s.child;case 9:return y=s.type._context,p=s.pendingProps.children,Ia(s),y=Wn(y),p=p(y),s.flags|=1,Xn(r,s,p,c),s.child;case 14:return mE(r,s,s.type,s.pendingProps,c);case 15:return pE(r,s,s.type,s.pendingProps,c);case 19:return OE(r,s,c);case 31:return P2(r,s,c);case 22:return gE(r,s,c,s.pendingProps);case 24:return Ia(s),p=Wn(jn),r===null?(y=ap(),y===null&&(y=Xt,A=ip(),y.pooledCache=A,A.refCount++,A!==null&&(y.pooledCacheLanes|=c),y=A),s.memoizedState={parent:p,cache:y},cp(s),Us(s,jn,y)):((r.lanes&c)!==0&&(lp(r,s),Xc(s,null,null,c),Wc()),y=r.memoizedState,A=s.memoizedState,y.parent!==p?(y={parent:p,cache:p},s.memoizedState=y,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=y),Us(s,jn,p)):(p=A.cache,Us(s,jn,p),p!==y.cache&&rp(s,[jn],c,!0))),Xn(r,s,s.pendingProps.children,c),s.child;case 29:throw s.pendingProps}throw Error(i(156,s.tag))}function cs(r){r.flags|=4}function qp(r,s,c,p,y){if((s=(r.mode&32)!==0)&&(s=!1),s){if(r.flags|=16777216,(y&335544128)===y)if(r.stateNode.complete)r.flags|=8192;else if(QE())r.flags|=8192;else throw Pa=Pf,op}else r.flags&=-16777217}function CE(r,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!Fv(s))if(QE())r.flags|=8192;else throw Pa=Pf,op}function Xf(r,s){s!==null&&(r.flags|=4),r.flags&16384&&(s=r.tag!==22?rt():536870912,r.lanes|=s,Bo|=s)}function rl(r,s){if(!Rt)switch(r.tailMode){case"hidden":s=r.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?r.tail=null:c.sibling=null;break;case"collapsed":c=r.tail;for(var p=null;c!==null;)c.alternate!==null&&(p=c),c=c.sibling;p===null?s||r.tail===null?r.tail=null:r.tail.sibling=null:p.sibling=null}}function cn(r){var s=r.alternate!==null&&r.alternate.child===r.child,c=0,p=0;if(s)for(var y=r.child;y!==null;)c|=y.lanes|y.childLanes,p|=y.subtreeFlags&65011712,p|=y.flags&65011712,y.return=r,y=y.sibling;else for(y=r.child;y!==null;)c|=y.lanes|y.childLanes,p|=y.subtreeFlags,p|=y.flags,y.return=r,y=y.sibling;return r.subtreeFlags|=p,r.childLanes=c,s}function j2(r,s,c){var p=s.pendingProps;switch(Qm(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return cn(s),null;case 1:return cn(s),null;case 3:return c=s.stateNode,p=null,r!==null&&(p=r.memoizedState.cache),s.memoizedState.cache!==p&&(s.flags|=2048),is(jn),le(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(r===null||r.child===null)&&(Co(s)?cs(s):r===null||r.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,ep())),cn(s),null;case 26:var y=s.type,A=s.memoizedState;return r===null?(cs(s),A!==null?(cn(s),CE(s,A)):(cn(s),qp(s,y,null,p,c))):A?A!==r.memoizedState?(cs(s),cn(s),CE(s,A)):(cn(s),s.flags&=-16777217):(r=r.memoizedProps,r!==p&&cs(s),cn(s),qp(s,y,r,p,c)),null;case 27:if(re(s),c=fe.current,y=s.type,r!==null&&s.stateNode!=null)r.memoizedProps!==p&&cs(s);else{if(!p){if(s.stateNode===null)throw Error(i(166));return cn(s),null}r=ie.current,Co(s)?sy(s):(r=Mv(y,p,c),s.stateNode=r,cs(s))}return cn(s),null;case 5:if(re(s),y=s.type,r!==null&&s.stateNode!=null)r.memoizedProps!==p&&cs(s);else{if(!p){if(s.stateNode===null)throw Error(i(166));return cn(s),null}if(A=ie.current,Co(s))sy(s);else{var w=fh(fe.current);switch(A){case 1:A=w.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:A=w.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":A=w.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":A=w.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":A=w.createElement("div"),A.innerHTML="<script><\/script>",A=A.removeChild(A.firstChild);break;case"select":A=typeof p.is=="string"?w.createElement("select",{is:p.is}):w.createElement("select"),p.multiple?A.multiple=!0:p.size&&(A.size=p.size);break;default:A=typeof p.is=="string"?w.createElement(y,{is:p.is}):w.createElement(y)}}A[Rn]=s,A[cr]=p;e:for(w=s.child;w!==null;){if(w.tag===5||w.tag===6)A.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===s)break e;for(;w.sibling===null;){if(w.return===null||w.return===s)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}s.stateNode=A;e:switch(Qn(A,y,p),y){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&cs(s)}}return cn(s),qp(s,s.type,r===null?null:r.memoizedProps,s.pendingProps,c),null;case 6:if(r&&s.stateNode!=null)r.memoizedProps!==p&&cs(s);else{if(typeof p!="string"&&s.stateNode===null)throw Error(i(166));if(r=fe.current,Co(s)){if(r=s.stateNode,c=s.memoizedProps,p=null,y=Zn,y!==null)switch(y.tag){case 27:case 5:p=y.memoizedProps}r[Rn]=s,r=!!(r.nodeValue===c||p!==null&&p.suppressHydrationWarning===!0||Tv(r.nodeValue,c)),r||Bs(s,!0)}else r=fh(r).createTextNode(p),r[Rn]=s,s.stateNode=r}return cn(s),null;case 31:if(c=s.memoizedState,r===null||r.memoizedState!==null){if(p=Co(s),c!==null){if(r===null){if(!p)throw Error(i(318));if(r=s.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(557));r[Rn]=s}else Ra(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;cn(s),r=!1}else c=ep(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=c),r=!0;if(!r)return s.flags&256?(zr(s),s):(zr(s),null);if((s.flags&128)!==0)throw Error(i(558))}return cn(s),null;case 13:if(p=s.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(y=Co(s),p!==null&&p.dehydrated!==null){if(r===null){if(!y)throw Error(i(318));if(y=s.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(i(317));y[Rn]=s}else Ra(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;cn(s),y=!1}else y=ep(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=y),y=!0;if(!y)return s.flags&256?(zr(s),s):(zr(s),null)}return zr(s),(s.flags&128)!==0?(s.lanes=c,s):(c=p!==null,r=r!==null&&r.memoizedState!==null,c&&(p=s.child,y=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(y=p.alternate.memoizedState.cachePool.pool),A=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(A=p.memoizedState.cachePool.pool),A!==y&&(p.flags|=2048)),c!==r&&c&&(s.child.flags|=8192),Xf(s,s.updateQueue),cn(s),null);case 4:return le(),r===null&&fg(s.stateNode.containerInfo),cn(s),null;case 10:return is(s.type),cn(s),null;case 19:if(q(In),p=s.memoizedState,p===null)return cn(s),null;if(y=(s.flags&128)!==0,A=p.rendering,A===null)if(y)rl(p,!1);else{if(Sn!==0||r!==null&&(r.flags&128)!==0)for(r=s.child;r!==null;){if(A=Hf(r),A!==null){for(s.flags|=128,rl(p,!1),r=A.updateQueue,s.updateQueue=r,Xf(s,r),s.subtreeFlags=0,r=c,c=s.child;c!==null;)ey(c,r),c=c.sibling;return D(In,In.current&1|2),Rt&&ns(s,p.treeForkCount),s.child}r=r.sibling}p.tail!==null&&Lt()>nh&&(s.flags|=128,y=!0,rl(p,!1),s.lanes=4194304)}else{if(!y)if(r=Hf(A),r!==null){if(s.flags|=128,y=!0,r=r.updateQueue,s.updateQueue=r,Xf(s,r),rl(p,!0),p.tail===null&&p.tailMode==="hidden"&&!A.alternate&&!Rt)return cn(s),null}else 2*Lt()-p.renderingStartTime>nh&&c!==536870912&&(s.flags|=128,y=!0,rl(p,!1),s.lanes=4194304);p.isBackwards?(A.sibling=s.child,s.child=A):(r=p.last,r!==null?r.sibling=A:s.child=A,p.last=A)}return p.tail!==null?(r=p.tail,p.rendering=r,p.tail=r.sibling,p.renderingStartTime=Lt(),r.sibling=null,c=In.current,D(In,y?c&1|2:c&1),Rt&&ns(s,p.treeForkCount),r):(cn(s),null);case 22:case 23:return zr(s),hp(),p=s.memoizedState!==null,r!==null?r.memoizedState!==null!==p&&(s.flags|=8192):p&&(s.flags|=8192),p?(c&536870912)!==0&&(s.flags&128)===0&&(cn(s),s.subtreeFlags&6&&(s.flags|=8192)):cn(s),c=s.updateQueue,c!==null&&Xf(s,c.retryQueue),c=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),p=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),p!==c&&(s.flags|=2048),r!==null&&q(ka),null;case 24:return c=null,r!==null&&(c=r.memoizedState.cache),s.memoizedState.cache!==c&&(s.flags|=2048),is(jn),cn(s),null;case 25:return null;case 30:return null}throw Error(i(156,s.tag))}function L2(r,s){switch(Qm(s),s.tag){case 1:return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 3:return is(jn),le(),r=s.flags,(r&65536)!==0&&(r&128)===0?(s.flags=r&-65537|128,s):null;case 26:case 27:case 5:return re(s),null;case 31:if(s.memoizedState!==null){if(zr(s),s.alternate===null)throw Error(i(340));Ra()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 13:if(zr(s),r=s.memoizedState,r!==null&&r.dehydrated!==null){if(s.alternate===null)throw Error(i(340));Ra()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 19:return q(In),null;case 4:return le(),null;case 10:return is(s.type),null;case 22:case 23:return zr(s),hp(),r!==null&&q(ka),r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 24:return is(jn),null;case 25:return null;default:return null}}function xE(r,s){switch(Qm(s),s.tag){case 3:is(jn),le();break;case 26:case 27:case 5:re(s);break;case 4:le();break;case 31:s.memoizedState!==null&&zr(s);break;case 13:zr(s);break;case 19:q(In);break;case 10:is(s.type);break;case 22:case 23:zr(s),hp(),r!==null&&q(ka);break;case 24:is(jn)}}function il(r,s){try{var c=s.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var y=p.next;c=y;do{if((c.tag&r)===r){p=void 0;var A=c.create,w=c.inst;p=A(),w.destroy=p}c=c.next}while(c!==y)}}catch(H){Gt(s,s.return,H)}}function Ks(r,s,c){try{var p=s.updateQueue,y=p!==null?p.lastEffect:null;if(y!==null){var A=y.next;p=A;do{if((p.tag&r)===r){var w=p.inst,H=w.destroy;if(H!==void 0){w.destroy=void 0,y=s;var Q=c,ue=H;try{ue()}catch(_e){Gt(y,Q,_e)}}}p=p.next}while(p!==A)}}catch(_e){Gt(s,s.return,_e)}}function wE(r){var s=r.updateQueue;if(s!==null){var c=r.stateNode;try{_y(s,c)}catch(p){Gt(r,r.return,p)}}}function RE(r,s,c){c.props=La(r.type,r.memoizedProps),c.state=r.memoizedState;try{c.componentWillUnmount()}catch(p){Gt(r,s,p)}}function sl(r,s){try{var c=r.ref;if(c!==null){switch(r.tag){case 26:case 27:case 5:var p=r.stateNode;break;case 30:p=r.stateNode;break;default:p=r.stateNode}typeof c=="function"?r.refCleanup=c(p):c.current=p}}catch(y){Gt(r,s,y)}}function Fi(r,s){var c=r.ref,p=r.refCleanup;if(c!==null)if(typeof p=="function")try{p()}catch(y){Gt(r,s,y)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(y){Gt(r,s,y)}else c.current=null}function NE(r){var s=r.type,c=r.memoizedProps,p=r.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":c.autoFocus&&p.focus();break e;case"img":c.src?p.src=c.src:c.srcSet&&(p.srcset=c.srcSet)}}catch(y){Gt(r,r.return,y)}}function Gp(r,s,c){try{var p=r.stateNode;sk(p,r.type,c,s),p[cr]=s}catch(y){Gt(r,r.return,y)}}function IE(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Js(r.type)||r.tag===4}function Kp(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||IE(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&Js(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Yp(r,s,c){var p=r.tag;if(p===5||p===6)r=r.stateNode,s?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(r,s):(s=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,s.appendChild(r),c=c._reactRootContainer,c!=null||s.onclick!==null||(s.onclick=De));else if(p!==4&&(p===27&&Js(r.type)&&(c=r.stateNode,s=null),r=r.child,r!==null))for(Yp(r,s,c),r=r.sibling;r!==null;)Yp(r,s,c),r=r.sibling}function Qf(r,s,c){var p=r.tag;if(p===5||p===6)r=r.stateNode,s?c.insertBefore(r,s):c.appendChild(r);else if(p!==4&&(p===27&&Js(r.type)&&(c=r.stateNode),r=r.child,r!==null))for(Qf(r,s,c),r=r.sibling;r!==null;)Qf(r,s,c),r=r.sibling}function kE(r){var s=r.stateNode,c=r.memoizedProps;try{for(var p=r.type,y=s.attributes;y.length;)s.removeAttributeNode(y[0]);Qn(s,p,c),s[Rn]=r,s[cr]=c}catch(A){Gt(r,r.return,A)}}var ls=!1,Bn=!1,Vp=!1,ME=typeof WeakSet=="function"?WeakSet:Set,Gn=null;function H2(r,s){if(r=r.containerInfo,pg=yh,r=G_(r),Fm(r)){if("selectionStart"in r)var c={start:r.selectionStart,end:r.selectionEnd};else e:{c=(c=r.ownerDocument)&&c.defaultView||window;var p=c.getSelection&&c.getSelection();if(p&&p.rangeCount!==0){c=p.anchorNode;var y=p.anchorOffset,A=p.focusNode;p=p.focusOffset;try{c.nodeType,A.nodeType}catch{c=null;break e}var w=0,H=-1,Q=-1,ue=0,_e=0,Oe=r,he=null;t:for(;;){for(var me;Oe!==c||y!==0&&Oe.nodeType!==3||(H=w+y),Oe!==A||p!==0&&Oe.nodeType!==3||(Q=w+p),Oe.nodeType===3&&(w+=Oe.nodeValue.length),(me=Oe.firstChild)!==null;)he=Oe,Oe=me;for(;;){if(Oe===r)break t;if(he===c&&++ue===y&&(H=w),he===A&&++_e===p&&(Q=w),(me=Oe.nextSibling)!==null)break;Oe=he,he=Oe.parentNode}Oe=me}c=H===-1||Q===-1?null:{start:H,end:Q}}else c=null}c=c||{start:0,end:0}}else c=null;for(gg={focusedElem:r,selectionRange:c},yh=!1,Gn=s;Gn!==null;)if(s=Gn,r=s.child,(s.subtreeFlags&1028)!==0&&r!==null)r.return=s,Gn=r;else for(;Gn!==null;){switch(s=Gn,A=s.alternate,r=s.flags,s.tag){case 0:if((r&4)!==0&&(r=s.updateQueue,r=r!==null?r.events:null,r!==null))for(c=0;c<r.length;c++)y=r[c],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&A!==null){r=void 0,c=s,y=A.memoizedProps,A=A.memoizedState,p=c.stateNode;try{var ze=La(c.type,y);r=p.getSnapshotBeforeUpdate(ze,A),p.__reactInternalSnapshotBeforeUpdate=r}catch(et){Gt(c,c.return,et)}}break;case 3:if((r&1024)!==0){if(r=s.stateNode.containerInfo,c=r.nodeType,c===9)yg(r);else if(c===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":yg(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(i(163))}if(r=s.sibling,r!==null){r.return=s.return,Gn=r;break}Gn=s.return}}function PE(r,s,c){var p=c.flags;switch(c.tag){case 0:case 11:case 15:ds(r,c),p&4&&il(5,c);break;case 1:if(ds(r,c),p&4)if(r=c.stateNode,s===null)try{r.componentDidMount()}catch(w){Gt(c,c.return,w)}else{var y=La(c.type,s.memoizedProps);s=s.memoizedState;try{r.componentDidUpdate(y,s,r.__reactInternalSnapshotBeforeUpdate)}catch(w){Gt(c,c.return,w)}}p&64&&wE(c),p&512&&sl(c,c.return);break;case 3:if(ds(r,c),p&64&&(r=c.updateQueue,r!==null)){if(s=null,c.child!==null)switch(c.child.tag){case 27:case 5:s=c.child.stateNode;break;case 1:s=c.child.stateNode}try{_y(r,s)}catch(w){Gt(c,c.return,w)}}break;case 27:s===null&&p&4&&kE(c);case 26:case 5:ds(r,c),s===null&&p&4&&NE(c),p&512&&sl(c,c.return);break;case 12:ds(r,c);break;case 31:ds(r,c),p&4&&LE(r,c);break;case 13:ds(r,c),p&4&&HE(r,c),p&64&&(r=c.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(c=Y2.bind(null,c),hk(r,c))));break;case 22:if(p=c.memoizedState!==null||ls,!p){s=s!==null&&s.memoizedState!==null||Bn,y=ls;var A=Bn;ls=p,(Bn=s)&&!A?fs(r,c,(c.subtreeFlags&8772)!==0):ds(r,c),ls=y,Bn=A}break;case 30:break;default:ds(r,c)}}function DE(r){var s=r.alternate;s!==null&&(r.alternate=null,DE(s)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(s=r.stateNode,s!==null&&Rc(s)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var hn=null,xr=!1;function us(r,s,c){for(c=c.child;c!==null;)jE(r,s,c),c=c.sibling}function jE(r,s,c){if(An&&typeof An.onCommitFiberUnmount=="function")try{An.onCommitFiberUnmount(Tn,c)}catch{}switch(c.tag){case 26:Bn||Fi(c,s),us(r,s,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:Bn||Fi(c,s);var p=hn,y=xr;Js(c.type)&&(hn=c.stateNode,xr=!1),us(r,s,c),ml(c.stateNode),hn=p,xr=y;break;case 5:Bn||Fi(c,s);case 6:if(p=hn,y=xr,hn=null,us(r,s,c),hn=p,xr=y,hn!==null)if(xr)try{(hn.nodeType===9?hn.body:hn.nodeName==="HTML"?hn.ownerDocument.body:hn).removeChild(c.stateNode)}catch(A){Gt(c,s,A)}else try{hn.removeChild(c.stateNode)}catch(A){Gt(c,s,A)}break;case 18:hn!==null&&(xr?(r=hn,wv(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,c.stateNode),Yo(r)):wv(hn,c.stateNode));break;case 4:p=hn,y=xr,hn=c.stateNode.containerInfo,xr=!0,us(r,s,c),hn=p,xr=y;break;case 0:case 11:case 14:case 15:Ks(2,c,s),Bn||Ks(4,c,s),us(r,s,c);break;case 1:Bn||(Fi(c,s),p=c.stateNode,typeof p.componentWillUnmount=="function"&&RE(c,s,p)),us(r,s,c);break;case 21:us(r,s,c);break;case 22:Bn=(p=Bn)||c.memoizedState!==null,us(r,s,c),Bn=p;break;default:us(r,s,c)}}function LE(r,s){if(s.memoizedState===null&&(r=s.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{Yo(r)}catch(c){Gt(s,s.return,c)}}}function HE(r,s){if(s.memoizedState===null&&(r=s.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{Yo(r)}catch(c){Gt(s,s.return,c)}}function B2(r){switch(r.tag){case 31:case 13:case 19:var s=r.stateNode;return s===null&&(s=r.stateNode=new ME),s;case 22:return r=r.stateNode,s=r._retryCache,s===null&&(s=r._retryCache=new ME),s;default:throw Error(i(435,r.tag))}}function Jf(r,s){var c=B2(r);s.forEach(function(p){if(!c.has(p)){c.add(p);var y=V2.bind(null,r,p);p.then(y,y)}})}function wr(r,s){var c=s.deletions;if(c!==null)for(var p=0;p<c.length;p++){var y=c[p],A=r,w=s,H=w;e:for(;H!==null;){switch(H.tag){case 27:if(Js(H.type)){hn=H.stateNode,xr=!1;break e}break;case 5:hn=H.stateNode,xr=!1;break e;case 3:case 4:hn=H.stateNode.containerInfo,xr=!0;break e}H=H.return}if(hn===null)throw Error(i(160));jE(A,w,y),hn=null,xr=!1,A=y.alternate,A!==null&&(A.return=null),y.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)BE(s,r),s=s.sibling}var Oi=null;function BE(r,s){var c=r.alternate,p=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:wr(s,r),Rr(r),p&4&&(Ks(3,r,r.return),il(3,r),Ks(5,r,r.return));break;case 1:wr(s,r),Rr(r),p&512&&(Bn||c===null||Fi(c,c.return)),p&64&&ls&&(r=r.updateQueue,r!==null&&(p=r.callbacks,p!==null&&(c=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=c===null?p:c.concat(p))));break;case 26:var y=Oi;if(wr(s,r),Rr(r),p&512&&(Bn||c===null||Fi(c,c.return)),p&4){var A=c!==null?c.memoizedState:null;if(p=r.memoizedState,c===null)if(p===null)if(r.stateNode===null){e:{p=r.type,c=r.memoizedProps,y=y.ownerDocument||y;t:switch(p){case"title":A=y.getElementsByTagName("title")[0],(!A||A[va]||A[Rn]||A.namespaceURI==="http://www.w3.org/2000/svg"||A.hasAttribute("itemprop"))&&(A=y.createElement(p),y.head.insertBefore(A,y.querySelector("head > title"))),Qn(A,p,c),A[Rn]=r,Pn(A),p=A;break e;case"link":var w=Bv("link","href",y).get(p+(c.href||""));if(w){for(var H=0;H<w.length;H++)if(A=w[H],A.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&A.getAttribute("rel")===(c.rel==null?null:c.rel)&&A.getAttribute("title")===(c.title==null?null:c.title)&&A.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){w.splice(H,1);break t}}A=y.createElement(p),Qn(A,p,c),y.head.appendChild(A);break;case"meta":if(w=Bv("meta","content",y).get(p+(c.content||""))){for(H=0;H<w.length;H++)if(A=w[H],A.getAttribute("content")===(c.content==null?null:""+c.content)&&A.getAttribute("name")===(c.name==null?null:c.name)&&A.getAttribute("property")===(c.property==null?null:c.property)&&A.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&A.getAttribute("charset")===(c.charSet==null?null:c.charSet)){w.splice(H,1);break t}}A=y.createElement(p),Qn(A,p,c),y.head.appendChild(A);break;default:throw Error(i(468,p))}A[Rn]=r,Pn(A),p=A}r.stateNode=p}else Uv(y,r.type,r.stateNode);else r.stateNode=Hv(y,p,r.memoizedProps);else A!==p?(A===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):A.count--,p===null?Uv(y,r.type,r.stateNode):Hv(y,p,r.memoizedProps)):p===null&&r.stateNode!==null&&Gp(r,r.memoizedProps,c.memoizedProps)}break;case 27:wr(s,r),Rr(r),p&512&&(Bn||c===null||Fi(c,c.return)),c!==null&&p&4&&Gp(r,r.memoizedProps,c.memoizedProps);break;case 5:if(wr(s,r),Rr(r),p&512&&(Bn||c===null||Fi(c,c.return)),r.flags&32){y=r.stateNode;try{tt(y,"")}catch(ze){Gt(r,r.return,ze)}}p&4&&r.stateNode!=null&&(y=r.memoizedProps,Gp(r,y,c!==null?c.memoizedProps:y)),p&1024&&(Vp=!0);break;case 6:if(wr(s,r),Rr(r),p&4){if(r.stateNode===null)throw Error(i(162));p=r.memoizedProps,c=r.stateNode;try{c.nodeValue=p}catch(ze){Gt(r,r.return,ze)}}break;case 3:if(ph=null,y=Oi,Oi=hh(s.containerInfo),wr(s,r),Oi=y,Rr(r),p&4&&c!==null&&c.memoizedState.isDehydrated)try{Yo(s.containerInfo)}catch(ze){Gt(r,r.return,ze)}Vp&&(Vp=!1,UE(r));break;case 4:p=Oi,Oi=hh(r.stateNode.containerInfo),wr(s,r),Rr(r),Oi=p;break;case 12:wr(s,r),Rr(r);break;case 31:wr(s,r),Rr(r),p&4&&(p=r.updateQueue,p!==null&&(r.updateQueue=null,Jf(r,p)));break;case 13:wr(s,r),Rr(r),r.child.flags&8192&&r.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(th=Lt()),p&4&&(p=r.updateQueue,p!==null&&(r.updateQueue=null,Jf(r,p)));break;case 22:y=r.memoizedState!==null;var Q=c!==null&&c.memoizedState!==null,ue=ls,_e=Bn;if(ls=ue||y,Bn=_e||Q,wr(s,r),Bn=_e,ls=ue,Rr(r),p&8192)e:for(s=r.stateNode,s._visibility=y?s._visibility&-2:s._visibility|1,y&&(c===null||Q||ls||Bn||Ha(r)),c=null,s=r;;){if(s.tag===5||s.tag===26){if(c===null){Q=c=s;try{if(A=Q.stateNode,y)w=A.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{H=Q.stateNode;var Oe=Q.memoizedProps.style,he=Oe!=null&&Oe.hasOwnProperty("display")?Oe.display:null;H.style.display=he==null||typeof he=="boolean"?"":(""+he).trim()}}catch(ze){Gt(Q,Q.return,ze)}}}else if(s.tag===6){if(c===null){Q=s;try{Q.stateNode.nodeValue=y?"":Q.memoizedProps}catch(ze){Gt(Q,Q.return,ze)}}}else if(s.tag===18){if(c===null){Q=s;try{var me=Q.stateNode;y?Rv(me,!0):Rv(Q.stateNode,!1)}catch(ze){Gt(Q,Q.return,ze)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===r)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break e;for(;s.sibling===null;){if(s.return===null||s.return===r)break e;c===s&&(c=null),s=s.return}c===s&&(c=null),s.sibling.return=s.return,s=s.sibling}p&4&&(p=r.updateQueue,p!==null&&(c=p.retryQueue,c!==null&&(p.retryQueue=null,Jf(r,c))));break;case 19:wr(s,r),Rr(r),p&4&&(p=r.updateQueue,p!==null&&(r.updateQueue=null,Jf(r,p)));break;case 30:break;case 21:break;default:wr(s,r),Rr(r)}}function Rr(r){var s=r.flags;if(s&2){try{for(var c,p=r.return;p!==null;){if(IE(p)){c=p;break}p=p.return}if(c==null)throw Error(i(160));switch(c.tag){case 27:var y=c.stateNode,A=Kp(r);Qf(r,A,y);break;case 5:var w=c.stateNode;c.flags&32&&(tt(w,""),c.flags&=-33);var H=Kp(r);Qf(r,H,w);break;case 3:case 4:var Q=c.stateNode.containerInfo,ue=Kp(r);Yp(r,ue,Q);break;default:throw Error(i(161))}}catch(_e){Gt(r,r.return,_e)}r.flags&=-3}s&4096&&(r.flags&=-4097)}function UE(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var s=r;UE(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),r=r.sibling}}function ds(r,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)PE(r,s.alternate,s),s=s.sibling}function Ha(r){for(r=r.child;r!==null;){var s=r;switch(s.tag){case 0:case 11:case 14:case 15:Ks(4,s,s.return),Ha(s);break;case 1:Fi(s,s.return);var c=s.stateNode;typeof c.componentWillUnmount=="function"&&RE(s,s.return,c),Ha(s);break;case 27:ml(s.stateNode);case 26:case 5:Fi(s,s.return),Ha(s);break;case 22:s.memoizedState===null&&Ha(s);break;case 30:Ha(s);break;default:Ha(s)}r=r.sibling}}function fs(r,s,c){for(c=c&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var p=s.alternate,y=r,A=s,w=A.flags;switch(A.tag){case 0:case 11:case 15:fs(y,A,c),il(4,A);break;case 1:if(fs(y,A,c),p=A,y=p.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(ue){Gt(p,p.return,ue)}if(p=A,y=p.updateQueue,y!==null){var H=p.stateNode;try{var Q=y.shared.hiddenCallbacks;if(Q!==null)for(y.shared.hiddenCallbacks=null,y=0;y<Q.length;y++)by(Q[y],H)}catch(ue){Gt(p,p.return,ue)}}c&&w&64&&wE(A),sl(A,A.return);break;case 27:kE(A);case 26:case 5:fs(y,A,c),c&&p===null&&w&4&&NE(A),sl(A,A.return);break;case 12:fs(y,A,c);break;case 31:fs(y,A,c),c&&w&4&&LE(y,A);break;case 13:fs(y,A,c),c&&w&4&&HE(y,A);break;case 22:A.memoizedState===null&&fs(y,A,c),sl(A,A.return);break;case 30:break;default:fs(y,A,c)}s=s.sibling}}function Zp(r,s){var c=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),r=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(r=s.memoizedState.cachePool.pool),r!==c&&(r!=null&&r.refCount++,c!=null&&Gc(c))}function Wp(r,s){r=null,s.alternate!==null&&(r=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==r&&(s.refCount++,r!=null&&Gc(r))}function Si(r,s,c,p){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)FE(r,s,c,p),s=s.sibling}function FE(r,s,c,p){var y=s.flags;switch(s.tag){case 0:case 11:case 15:Si(r,s,c,p),y&2048&&il(9,s);break;case 1:Si(r,s,c,p);break;case 3:Si(r,s,c,p),y&2048&&(r=null,s.alternate!==null&&(r=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==r&&(s.refCount++,r!=null&&Gc(r)));break;case 12:if(y&2048){Si(r,s,c,p),r=s.stateNode;try{var A=s.memoizedProps,w=A.id,H=A.onPostCommit;typeof H=="function"&&H(w,s.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(Q){Gt(s,s.return,Q)}}else Si(r,s,c,p);break;case 31:Si(r,s,c,p);break;case 13:Si(r,s,c,p);break;case 23:break;case 22:A=s.stateNode,w=s.alternate,s.memoizedState!==null?A._visibility&2?Si(r,s,c,p):al(r,s):A._visibility&2?Si(r,s,c,p):(A._visibility|=2,jo(r,s,c,p,(s.subtreeFlags&10256)!==0||!1)),y&2048&&Zp(w,s);break;case 24:Si(r,s,c,p),y&2048&&Wp(s.alternate,s);break;default:Si(r,s,c,p)}}function jo(r,s,c,p,y){for(y=y&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var A=r,w=s,H=c,Q=p,ue=w.flags;switch(w.tag){case 0:case 11:case 15:jo(A,w,H,Q,y),il(8,w);break;case 23:break;case 22:var _e=w.stateNode;w.memoizedState!==null?_e._visibility&2?jo(A,w,H,Q,y):al(A,w):(_e._visibility|=2,jo(A,w,H,Q,y)),y&&ue&2048&&Zp(w.alternate,w);break;case 24:jo(A,w,H,Q,y),y&&ue&2048&&Wp(w.alternate,w);break;default:jo(A,w,H,Q,y)}s=s.sibling}}function al(r,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var c=r,p=s,y=p.flags;switch(p.tag){case 22:al(c,p),y&2048&&Zp(p.alternate,p);break;case 24:al(c,p),y&2048&&Wp(p.alternate,p);break;default:al(c,p)}s=s.sibling}}var ol=8192;function Lo(r,s,c){if(r.subtreeFlags&ol)for(r=r.child;r!==null;)zE(r,s,c),r=r.sibling}function zE(r,s,c){switch(r.tag){case 26:Lo(r,s,c),r.flags&ol&&r.memoizedState!==null&&Sk(c,Oi,r.memoizedState,r.memoizedProps);break;case 5:Lo(r,s,c);break;case 3:case 4:var p=Oi;Oi=hh(r.stateNode.containerInfo),Lo(r,s,c),Oi=p;break;case 22:r.memoizedState===null&&(p=r.alternate,p!==null&&p.memoizedState!==null?(p=ol,ol=16777216,Lo(r,s,c),ol=p):Lo(r,s,c));break;default:Lo(r,s,c)}}function $E(r){var s=r.alternate;if(s!==null&&(r=s.child,r!==null)){s.child=null;do s=r.sibling,r.sibling=null,r=s;while(r!==null)}}function cl(r){var s=r.deletions;if((r.flags&16)!==0){if(s!==null)for(var c=0;c<s.length;c++){var p=s[c];Gn=p,GE(p,r)}$E(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)qE(r),r=r.sibling}function qE(r){switch(r.tag){case 0:case 11:case 15:cl(r),r.flags&2048&&Ks(9,r,r.return);break;case 3:cl(r);break;case 12:cl(r);break;case 22:var s=r.stateNode;r.memoizedState!==null&&s._visibility&2&&(r.return===null||r.return.tag!==13)?(s._visibility&=-3,eh(r)):cl(r);break;default:cl(r)}}function eh(r){var s=r.deletions;if((r.flags&16)!==0){if(s!==null)for(var c=0;c<s.length;c++){var p=s[c];Gn=p,GE(p,r)}$E(r)}for(r=r.child;r!==null;){switch(s=r,s.tag){case 0:case 11:case 15:Ks(8,s,s.return),eh(s);break;case 22:c=s.stateNode,c._visibility&2&&(c._visibility&=-3,eh(s));break;default:eh(s)}r=r.sibling}}function GE(r,s){for(;Gn!==null;){var c=Gn;switch(c.tag){case 0:case 11:case 15:Ks(8,c,s);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var p=c.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:Gc(c.memoizedState.cache)}if(p=c.child,p!==null)p.return=c,Gn=p;else e:for(c=r;Gn!==null;){p=Gn;var y=p.sibling,A=p.return;if(DE(p),p===c){Gn=null;break e}if(y!==null){y.return=A,Gn=y;break e}Gn=A}}}var U2={getCacheForType:function(r){var s=Wn(jn),c=s.data.get(r);return c===void 0&&(c=r(),s.data.set(r,c)),c},cacheSignal:function(){return Wn(jn).controller.signal}},F2=typeof WeakMap=="function"?WeakMap:Map,Ht=0,Xt=null,Tt=null,Ct=0,qt=0,$r=null,Ys=!1,Ho=!1,Xp=!1,hs=0,Sn=0,Vs=0,Ba=0,Qp=0,qr=0,Bo=0,ll=null,Nr=null,Jp=!1,th=0,KE=0,nh=1/0,rh=null,Zs=null,zn=0,Ws=null,Uo=null,ms=0,eg=0,tg=null,YE=null,ul=0,ng=null;function Gr(){return(Ht&2)!==0&&Ct!==0?Ct&-Ct:U.T!==null?cg():fo()}function VE(){if(qr===0)if((Ct&536870912)===0||Rt){var r=uo;uo<<=1,(uo&3932160)===0&&(uo=262144),qr=r}else qr=536870912;return r=Fr.current,r!==null&&(r.flags|=32),qr}function Ir(r,s,c){(r===Xt&&(qt===2||qt===9)||r.cancelPendingCommit!==null)&&(Fo(r,0),Xs(r,Ct,qr,!1)),Wt(r,c),((Ht&2)===0||r!==Xt)&&(r===Xt&&((Ht&2)===0&&(Ba|=c),Sn===4&&Xs(r,Ct,qr,!1)),zi(r))}function ZE(r,s,c){if((Ht&6)!==0)throw Error(i(327));var p=!c&&(s&127)===0&&(s&r.expiredLanes)===0||ve(r,s),y=p?q2(r,s):ig(r,s,!0),A=p;do{if(y===0){Ho&&!p&&Xs(r,s,0,!1);break}else{if(c=r.current.alternate,A&&!z2(c)){y=ig(r,s,!1),A=!1;continue}if(y===2){if(A=s,r.errorRecoveryDisabledLanes&A)var w=0;else w=r.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){s=w;e:{var H=r;y=ll;var Q=H.current.memoizedState.isDehydrated;if(Q&&(Fo(H,w).flags|=256),w=ig(H,w,!1),w!==2){if(Xp&&!Q){H.errorRecoveryDisabledLanes|=A,Ba|=A,y=4;break e}A=Nr,Nr=y,A!==null&&(Nr===null?Nr=A:Nr.push.apply(Nr,A))}y=w}if(A=!1,y!==2)continue}}if(y===1){Fo(r,0),Xs(r,s,0,!0);break}e:{switch(p=r,A=y,A){case 0:case 1:throw Error(i(345));case 4:if((s&4194048)!==s)break;case 6:Xs(p,s,qr,!Ys);break e;case 2:Nr=null;break;case 3:case 5:break;default:throw Error(i(329))}if((s&62914560)===s&&(y=th+300-Lt(),10<y)){if(Xs(p,s,qr,!Ys),ee(p,0,!0)!==0)break e;ms=s,p.timeoutHandle=Cv(WE.bind(null,p,c,Nr,rh,Jp,s,qr,Ba,Bo,Ys,A,"Throttled",-0,0),y);break e}WE(p,c,Nr,rh,Jp,s,qr,Ba,Bo,Ys,A,null,-0,0)}}break}while(!0);zi(r)}function WE(r,s,c,p,y,A,w,H,Q,ue,_e,Oe,he,me){if(r.timeoutHandle=-1,Oe=s.subtreeFlags,Oe&8192||(Oe&16785408)===16785408){Oe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:De},zE(s,A,Oe);var ze=(A&62914560)===A?th-Lt():(A&4194048)===A?KE-Lt():0;if(ze=Ck(Oe,ze),ze!==null){ms=A,r.cancelPendingCommit=ze(iv.bind(null,r,s,A,c,p,y,w,H,Q,_e,Oe,null,he,me)),Xs(r,A,w,!ue);return}}iv(r,s,A,c,p,y,w,H,Q)}function z2(r){for(var s=r;;){var c=s.tag;if((c===0||c===11||c===15)&&s.flags&16384&&(c=s.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var p=0;p<c.length;p++){var y=c[p],A=y.getSnapshot;y=y.value;try{if(!Br(A(),y))return!1}catch{return!1}}if(c=s.child,s.subtreeFlags&16384&&c!==null)c.return=s,s=c;else{if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function Xs(r,s,c,p){s&=~Qp,s&=~Ba,r.suspendedLanes|=s,r.pingedLanes&=~s,p&&(r.warmLanes|=s),p=r.expirationTimes;for(var y=s;0<y;){var A=31-Ft(y),w=1<<A;p[A]=-1,y&=~w}c!==0&&Fe(r,c,s)}function ih(){return(Ht&6)===0?(dl(0),!1):!0}function rg(){if(Tt!==null){if(qt===0)var r=Tt.return;else r=Tt,rs=Na=null,yp(r),Io=null,Yc=0,r=Tt;for(;r!==null;)xE(r.alternate,r),r=r.return;Tt=null}}function Fo(r,s){var c=r.timeoutHandle;c!==-1&&(r.timeoutHandle=-1,ck(c)),c=r.cancelPendingCommit,c!==null&&(r.cancelPendingCommit=null,c()),ms=0,rg(),Xt=r,Tt=c=ts(r.current,null),Ct=s,qt=0,$r=null,Ys=!1,Ho=ve(r,s),Xp=!1,Bo=qr=Qp=Ba=Vs=Sn=0,Nr=ll=null,Jp=!1,(s&8)!==0&&(s|=s&32);var p=r.entangledLanes;if(p!==0)for(r=r.entanglements,p&=s;0<p;){var y=31-Ft(p),A=1<<y;s|=r[y],p&=~A}return hs=s,Sf(),c}function XE(r,s){lt=null,U.H=tl,s===No||s===Mf?(s=hy(),qt=3):s===op?(s=hy(),qt=4):qt=s===Dp?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,$r=s,Tt===null&&(Sn=1,Yf(r,ai(s,r.current)))}function QE(){var r=Fr.current;return r===null?!0:(Ct&4194048)===Ct?ui===null:(Ct&62914560)===Ct||(Ct&536870912)!==0?r===ui:!1}function JE(){var r=U.H;return U.H=tl,r===null?tl:r}function ev(){var r=U.A;return U.A=U2,r}function sh(){Sn=4,Ys||(Ct&4194048)!==Ct&&Fr.current!==null||(Ho=!0),(Vs&134217727)===0&&(Ba&134217727)===0||Xt===null||Xs(Xt,Ct,qr,!1)}function ig(r,s,c){var p=Ht;Ht|=2;var y=JE(),A=ev();(Xt!==r||Ct!==s)&&(rh=null,Fo(r,s)),s=!1;var w=Sn;e:do try{if(qt!==0&&Tt!==null){var H=Tt,Q=$r;switch(qt){case 8:rg(),w=6;break e;case 3:case 2:case 9:case 6:Fr.current===null&&(s=!0);var ue=qt;if(qt=0,$r=null,zo(r,H,Q,ue),c&&Ho){w=0;break e}break;default:ue=qt,qt=0,$r=null,zo(r,H,Q,ue)}}$2(),w=Sn;break}catch(_e){XE(r,_e)}while(!0);return s&&r.shellSuspendCounter++,rs=Na=null,Ht=p,U.H=y,U.A=A,Tt===null&&(Xt=null,Ct=0,Sf()),w}function $2(){for(;Tt!==null;)tv(Tt)}function q2(r,s){var c=Ht;Ht|=2;var p=JE(),y=ev();Xt!==r||Ct!==s?(rh=null,nh=Lt()+500,Fo(r,s)):Ho=ve(r,s);e:do try{if(qt!==0&&Tt!==null){s=Tt;var A=$r;t:switch(qt){case 1:qt=0,$r=null,zo(r,s,A,1);break;case 2:case 9:if(dy(A)){qt=0,$r=null,nv(s);break}s=function(){qt!==2&&qt!==9||Xt!==r||(qt=7),zi(r)},A.then(s,s);break e;case 3:qt=7;break e;case 4:qt=5;break e;case 7:dy(A)?(qt=0,$r=null,nv(s)):(qt=0,$r=null,zo(r,s,A,7));break;case 5:var w=null;switch(Tt.tag){case 26:w=Tt.memoizedState;case 5:case 27:var H=Tt;if(w?Fv(w):H.stateNode.complete){qt=0,$r=null;var Q=H.sibling;if(Q!==null)Tt=Q;else{var ue=H.return;ue!==null?(Tt=ue,ah(ue)):Tt=null}break t}}qt=0,$r=null,zo(r,s,A,5);break;case 6:qt=0,$r=null,zo(r,s,A,6);break;case 8:rg(),Sn=6;break e;default:throw Error(i(462))}}G2();break}catch(_e){XE(r,_e)}while(!0);return rs=Na=null,U.H=p,U.A=y,Ht=c,Tt!==null?0:(Xt=null,Ct=0,Sf(),Sn)}function G2(){for(;Tt!==null&&!ar();)tv(Tt)}function tv(r){var s=SE(r.alternate,r,hs);r.memoizedProps=r.pendingProps,s===null?ah(r):Tt=s}function nv(r){var s=r,c=s.alternate;switch(s.tag){case 15:case 0:s=yE(c,s,s.pendingProps,s.type,void 0,Ct);break;case 11:s=yE(c,s,s.pendingProps,s.type.render,s.ref,Ct);break;case 5:yp(s);default:xE(c,s),s=Tt=ey(s,hs),s=SE(c,s,hs)}r.memoizedProps=r.pendingProps,s===null?ah(r):Tt=s}function zo(r,s,c,p){rs=Na=null,yp(s),Io=null,Yc=0;var y=s.return;try{if(M2(r,y,s,c,Ct)){Sn=1,Yf(r,ai(c,r.current)),Tt=null;return}}catch(A){if(y!==null)throw Tt=y,A;Sn=1,Yf(r,ai(c,r.current)),Tt=null;return}s.flags&32768?(Rt||p===1?r=!0:Ho||(Ct&536870912)!==0?r=!1:(Ys=r=!0,(p===2||p===9||p===3||p===6)&&(p=Fr.current,p!==null&&p.tag===13&&(p.flags|=16384))),rv(s,r)):ah(s)}function ah(r){var s=r;do{if((s.flags&32768)!==0){rv(s,Ys);return}r=s.return;var c=j2(s.alternate,s,hs);if(c!==null){Tt=c;return}if(s=s.sibling,s!==null){Tt=s;return}Tt=s=r}while(s!==null);Sn===0&&(Sn=5)}function rv(r,s){do{var c=L2(r.alternate,r);if(c!==null){c.flags&=32767,Tt=c;return}if(c=r.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!s&&(r=r.sibling,r!==null)){Tt=r;return}Tt=r=c}while(r!==null);Sn=6,Tt=null}function iv(r,s,c,p,y,A,w,H,Q){r.cancelPendingCommit=null;do oh();while(zn!==0);if((Ht&6)!==0)throw Error(i(327));if(s!==null){if(s===r.current)throw Error(i(177));if(A=s.lanes|s.childLanes,A|=Km,qe(r,c,A,w,H,Q),r===Xt&&(Tt=Xt=null,Ct=0),Uo=s,Ws=r,ms=c,eg=A,tg=y,YE=p,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,Z2($e,function(){return lv(),null})):(r.callbackNode=null,r.callbackPriority=0),p=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||p){p=U.T,U.T=null,y=Y.p,Y.p=2,w=Ht,Ht|=4;try{H2(r,s,c)}finally{Ht=w,Y.p=y,U.T=p}}zn=1,sv(),av(),ov()}}function sv(){if(zn===1){zn=0;var r=Ws,s=Uo,c=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||c){c=U.T,U.T=null;var p=Y.p;Y.p=2;var y=Ht;Ht|=4;try{BE(s,r);var A=gg,w=G_(r.containerInfo),H=A.focusedElem,Q=A.selectionRange;if(w!==H&&H&&H.ownerDocument&&q_(H.ownerDocument.documentElement,H)){if(Q!==null&&Fm(H)){var ue=Q.start,_e=Q.end;if(_e===void 0&&(_e=ue),"selectionStart"in H)H.selectionStart=ue,H.selectionEnd=Math.min(_e,H.value.length);else{var Oe=H.ownerDocument||document,he=Oe&&Oe.defaultView||window;if(he.getSelection){var me=he.getSelection(),ze=H.textContent.length,et=Math.min(Q.start,ze),Vt=Q.end===void 0?et:Math.min(Q.end,ze);!me.extend&&et>Vt&&(w=Vt,Vt=et,et=w);var se=$_(H,et),ne=$_(H,Vt);if(se&&ne&&(me.rangeCount!==1||me.anchorNode!==se.node||me.anchorOffset!==se.offset||me.focusNode!==ne.node||me.focusOffset!==ne.offset)){var ce=Oe.createRange();ce.setStart(se.node,se.offset),me.removeAllRanges(),et>Vt?(me.addRange(ce),me.extend(ne.node,ne.offset)):(ce.setEnd(ne.node,ne.offset),me.addRange(ce))}}}}for(Oe=[],me=H;me=me.parentNode;)me.nodeType===1&&Oe.push({element:me,left:me.scrollLeft,top:me.scrollTop});for(typeof H.focus=="function"&&H.focus(),H=0;H<Oe.length;H++){var Te=Oe[H];Te.element.scrollLeft=Te.left,Te.element.scrollTop=Te.top}}yh=!!pg,gg=pg=null}finally{Ht=y,Y.p=p,U.T=c}}r.current=s,zn=2}}function av(){if(zn===2){zn=0;var r=Ws,s=Uo,c=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||c){c=U.T,U.T=null;var p=Y.p;Y.p=2;var y=Ht;Ht|=4;try{PE(r,s.alternate,s)}finally{Ht=y,Y.p=p,U.T=c}}zn=3}}function ov(){if(zn===4||zn===3){zn=0,vt();var r=Ws,s=Uo,c=ms,p=YE;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?zn=5:(zn=0,Uo=Ws=null,cv(r,r.pendingLanes));var y=r.pendingLanes;if(y===0&&(Zs=null),Wi(c),s=s.stateNode,An&&typeof An.onCommitFiberRoot=="function")try{An.onCommitFiberRoot(Tn,s,void 0,(s.current.flags&128)===128)}catch{}if(p!==null){s=U.T,y=Y.p,Y.p=2,U.T=null;try{for(var A=r.onRecoverableError,w=0;w<p.length;w++){var H=p[w];A(H.value,{componentStack:H.stack})}}finally{U.T=s,Y.p=y}}(ms&3)!==0&&oh(),zi(r),y=r.pendingLanes,(c&261930)!==0&&(y&42)!==0?r===ng?ul++:(ul=0,ng=r):ul=0,dl(0)}}function cv(r,s){(r.pooledCacheLanes&=s)===0&&(s=r.pooledCache,s!=null&&(r.pooledCache=null,Gc(s)))}function oh(){return sv(),av(),ov(),lv()}function lv(){if(zn!==5)return!1;var r=Ws,s=eg;eg=0;var c=Wi(ms),p=U.T,y=Y.p;try{Y.p=32>c?32:c,U.T=null,c=tg,tg=null;var A=Ws,w=ms;if(zn=0,Uo=Ws=null,ms=0,(Ht&6)!==0)throw Error(i(331));var H=Ht;if(Ht|=4,qE(A.current),FE(A,A.current,w,c),Ht=H,dl(0,!1),An&&typeof An.onPostCommitFiberRoot=="function")try{An.onPostCommitFiberRoot(Tn,A)}catch{}return!0}finally{Y.p=y,U.T=p,cv(r,s)}}function uv(r,s,c){s=ai(c,s),s=Pp(r.stateNode,s,2),r=$s(r,s,2),r!==null&&(Wt(r,2),zi(r))}function Gt(r,s,c){if(r.tag===3)uv(r,r,c);else for(;s!==null;){if(s.tag===3){uv(s,r,c);break}else if(s.tag===1){var p=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(Zs===null||!Zs.has(p))){r=ai(c,r),c=dE(2),p=$s(s,c,2),p!==null&&(fE(c,p,s,r),Wt(p,2),zi(p));break}}s=s.return}}function sg(r,s,c){var p=r.pingCache;if(p===null){p=r.pingCache=new F2;var y=new Set;p.set(s,y)}else y=p.get(s),y===void 0&&(y=new Set,p.set(s,y));y.has(c)||(Xp=!0,y.add(c),r=K2.bind(null,r,s,c),s.then(r,r))}function K2(r,s,c){var p=r.pingCache;p!==null&&p.delete(s),r.pingedLanes|=r.suspendedLanes&c,r.warmLanes&=~c,Xt===r&&(Ct&c)===c&&(Sn===4||Sn===3&&(Ct&62914560)===Ct&&300>Lt()-th?(Ht&2)===0&&Fo(r,0):Qp|=c,Bo===Ct&&(Bo=0)),zi(r)}function dv(r,s){s===0&&(s=rt()),r=xa(r,s),r!==null&&(Wt(r,s),zi(r))}function Y2(r){var s=r.memoizedState,c=0;s!==null&&(c=s.retryLane),dv(r,c)}function V2(r,s){var c=0;switch(r.tag){case 31:case 13:var p=r.stateNode,y=r.memoizedState;y!==null&&(c=y.retryLane);break;case 19:p=r.stateNode;break;case 22:p=r.stateNode._retryCache;break;default:throw Error(i(314))}p!==null&&p.delete(s),dv(r,c)}function Z2(r,s){return bt(r,s)}var ch=null,$o=null,ag=!1,lh=!1,og=!1,Qs=0;function zi(r){r!==$o&&r.next===null&&($o===null?ch=$o=r:$o=$o.next=r),lh=!0,ag||(ag=!0,X2())}function dl(r,s){if(!og&&lh){og=!0;do for(var c=!1,p=ch;p!==null;){if(r!==0){var y=p.pendingLanes;if(y===0)var A=0;else{var w=p.suspendedLanes,H=p.pingedLanes;A=(1<<31-Ft(42|r)+1)-1,A&=y&~(w&~H),A=A&201326741?A&201326741|1:A?A|2:0}A!==0&&(c=!0,pv(p,A))}else A=Ct,A=ee(p,p===Xt?A:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(A&3)===0||ve(p,A)||(c=!0,pv(p,A));p=p.next}while(c);og=!1}}function W2(){fv()}function fv(){lh=ag=!1;var r=0;Qs!==0&&ok()&&(r=Qs);for(var s=Lt(),c=null,p=ch;p!==null;){var y=p.next,A=hv(p,s);A===0?(p.next=null,c===null?ch=y:c.next=y,y===null&&($o=c)):(c=p,(r!==0||(A&3)!==0)&&(lh=!0)),p=y}zn!==0&&zn!==5||dl(r),Qs!==0&&(Qs=0)}function hv(r,s){for(var c=r.suspendedLanes,p=r.pingedLanes,y=r.expirationTimes,A=r.pendingLanes&-62914561;0<A;){var w=31-Ft(A),H=1<<w,Q=y[w];Q===-1?((H&c)===0||(H&p)!==0)&&(y[w]=je(H,s)):Q<=s&&(r.expiredLanes|=H),A&=~H}if(s=Xt,c=Ct,c=ee(r,r===s?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),p=r.callbackNode,c===0||r===s&&(qt===2||qt===9)||r.cancelPendingCommit!==null)return p!==null&&p!==null&&jt(p),r.callbackNode=null,r.callbackPriority=0;if((c&3)===0||ve(r,c)){if(s=c&-c,s===r.callbackPriority)return s;switch(p!==null&&jt(p),Wi(c)){case 2:case 8:c=xe;break;case 32:c=$e;break;case 268435456:c=wt;break;default:c=$e}return p=mv.bind(null,r),c=bt(c,p),r.callbackPriority=s,r.callbackNode=c,s}return p!==null&&p!==null&&jt(p),r.callbackPriority=2,r.callbackNode=null,2}function mv(r,s){if(zn!==0&&zn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var c=r.callbackNode;if(oh()&&r.callbackNode!==c)return null;var p=Ct;return p=ee(r,r===Xt?p:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),p===0?null:(ZE(r,p,s),hv(r,Lt()),r.callbackNode!=null&&r.callbackNode===c?mv.bind(null,r):null)}function pv(r,s){if(oh())return null;ZE(r,s,!0)}function X2(){lk(function(){(Ht&6)!==0?bt(be,W2):fv()})}function cg(){if(Qs===0){var r=wo;r===0&&(r=ya,ya<<=1,(ya&261888)===0&&(ya=256)),Qs=r}return Qs}function gv(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Ds(""+r)}function bv(r,s){var c=s.ownerDocument.createElement("input");return c.name=s.name,c.value=s.value,r.id&&c.setAttribute("form",r.id),s.parentNode.insertBefore(c,s),r=new FormData(r),c.parentNode.removeChild(c),r}function Q2(r,s,c,p,y){if(s==="submit"&&c&&c.stateNode===y){var A=gv((y[cr]||null).action),w=p.submitter;w&&(s=(s=w[cr]||null)?gv(s.formAction):w.getAttribute("formAction"),s!==null&&(A=s,w=null));var H=new vf("action","action",null,p,y);r.push({event:H,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(Qs!==0){var Q=w?bv(y,w):new FormData(y);wp(c,{pending:!0,data:Q,method:y.method,action:A},null,Q)}}else typeof A=="function"&&(H.preventDefault(),Q=w?bv(y,w):new FormData(y),wp(c,{pending:!0,data:Q,method:y.method,action:A},A,Q))},currentTarget:y}]})}}for(var lg=0;lg<Gm.length;lg++){var ug=Gm[lg],J2=ug.toLowerCase(),ek=ug[0].toUpperCase()+ug.slice(1);Ai(J2,"on"+ek)}Ai(V_,"onAnimationEnd"),Ai(Z_,"onAnimationIteration"),Ai(W_,"onAnimationStart"),Ai("dblclick","onDoubleClick"),Ai("focusin","onFocus"),Ai("focusout","onBlur"),Ai(g2,"onTransitionRun"),Ai(b2,"onTransitionStart"),Ai(_2,"onTransitionCancel"),Ai(X_,"onTransitionEnd"),Re("onMouseEnter",["mouseout","mouseover"]),Re("onMouseLeave",["mouseout","mouseover"]),Re("onPointerEnter",["pointerout","pointerover"]),Re("onPointerLeave",["pointerout","pointerover"]),Qi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Qi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Qi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Qi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Qi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Qi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),tk=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(fl));function _v(r,s){s=(s&4)!==0;for(var c=0;c<r.length;c++){var p=r[c],y=p.event;p=p.listeners;e:{var A=void 0;if(s)for(var w=p.length-1;0<=w;w--){var H=p[w],Q=H.instance,ue=H.currentTarget;if(H=H.listener,Q!==A&&y.isPropagationStopped())break e;A=H,y.currentTarget=ue;try{A(y)}catch(_e){Of(_e)}y.currentTarget=null,A=Q}else for(w=0;w<p.length;w++){if(H=p[w],Q=H.instance,ue=H.currentTarget,H=H.listener,Q!==A&&y.isPropagationStopped())break e;A=H,y.currentTarget=ue;try{A(y)}catch(_e){Of(_e)}y.currentTarget=null,A=Q}}}}function At(r,s){var c=s[wc];c===void 0&&(c=s[wc]=new Set);var p=r+"__bubble";c.has(p)||(yv(s,r,2,!1),c.add(p))}function dg(r,s,c){var p=0;s&&(p|=4),yv(c,r,p,s)}var uh="_reactListening"+Math.random().toString(36).slice(2);function fg(r){if(!r[uh]){r[uh]=!0,hf.forEach(function(c){c!=="selectionchange"&&(tk.has(c)||dg(c,!1,r),dg(c,!0,r))});var s=r.nodeType===9?r:r.ownerDocument;s===null||s[uh]||(s[uh]=!0,dg("selectionchange",!1,s))}}function yv(r,s,c,p){switch(Vv(s)){case 2:var y=Rk;break;case 8:y=Nk;break;default:y=xg}c=y.bind(null,s,c,r),y=void 0,!km||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(y=!0),p?y!==void 0?r.addEventListener(s,c,{capture:!0,passive:y}):r.addEventListener(s,c,!0):y!==void 0?r.addEventListener(s,c,{passive:y}):r.addEventListener(s,c,!1)}function hg(r,s,c,p,y){var A=p;if((s&1)===0&&(s&2)===0&&p!==null)e:for(;;){if(p===null)return;var w=p.tag;if(w===3||w===4){var H=p.stateNode.containerInfo;if(H===y)break;if(w===4)for(w=p.return;w!==null;){var Q=w.tag;if((Q===3||Q===4)&&w.stateNode.containerInfo===y)return;w=w.return}for(;H!==null;){if(w=pr(H),w===null)return;if(Q=w.tag,Q===5||Q===6||Q===26||Q===27){p=A=w;continue e}H=H.parentNode}}p=p.return}bf(function(){var ue=A,_e=at(c),Oe=[];e:{var he=Q_.get(r);if(he!==void 0){var me=vf,ze=r;switch(r){case"keypress":if(yf(c)===0)break e;case"keydown":case"keyup":me=VI;break;case"focusin":ze="focus",me=jm;break;case"focusout":ze="blur",me=jm;break;case"beforeblur":case"afterblur":me=jm;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=x_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=jI;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=XI;break;case V_:case Z_:case W_:me=BI;break;case X_:me=JI;break;case"scroll":case"scrollend":me=PI;break;case"wheel":me=t2;break;case"copy":case"cut":case"paste":me=FI;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=R_;break;case"toggle":case"beforetoggle":me=r2}var et=(s&4)!==0,Vt=!et&&(r==="scroll"||r==="scrollend"),se=et?he!==null?he+"Capture":null:he;et=[];for(var ne=ue,ce;ne!==null;){var Te=ne;if(ce=Te.stateNode,Te=Te.tag,Te!==5&&Te!==26&&Te!==27||ce===null||se===null||(Te=Pc(ne,se),Te!=null&&et.push(hl(ne,Te,ce))),Vt)break;ne=ne.return}0<et.length&&(he=new me(he,ze,null,c,_e),Oe.push({event:he,listeners:et}))}}if((s&7)===0){e:{if(he=r==="mouseover"||r==="pointerover",me=r==="mouseout"||r==="pointerout",he&&c!==Ke&&(ze=c.relatedTarget||c.fromElement)&&(pr(ze)||ze[Is]))break e;if((me||he)&&(he=_e.window===_e?_e:(he=_e.ownerDocument)?he.defaultView||he.parentWindow:window,me?(ze=c.relatedTarget||c.toElement,me=ue,ze=ze?pr(ze):null,ze!==null&&(Vt=u(ze),et=ze.tag,ze!==Vt||et!==5&&et!==27&&et!==6)&&(ze=null)):(me=null,ze=ue),me!==ze)){if(et=x_,Te="onMouseLeave",se="onMouseEnter",ne="mouse",(r==="pointerout"||r==="pointerover")&&(et=R_,Te="onPointerLeave",se="onPointerEnter",ne="pointer"),Vt=me==null?he:ks(me),ce=ze==null?he:ks(ze),he=new et(Te,ne+"leave",me,c,_e),he.target=Vt,he.relatedTarget=ce,Te=null,pr(_e)===ue&&(et=new et(se,ne+"enter",ze,c,_e),et.target=ce,et.relatedTarget=Vt,Te=et),Vt=Te,me&&ze)t:{for(et=nk,se=me,ne=ze,ce=0,Te=se;Te;Te=et(Te))ce++;Te=0;for(var Qe=ne;Qe;Qe=et(Qe))Te++;for(;0<ce-Te;)se=et(se),ce--;for(;0<Te-ce;)ne=et(ne),Te--;for(;ce--;){if(se===ne||ne!==null&&se===ne.alternate){et=se;break t}se=et(se),ne=et(ne)}et=null}else et=null;me!==null&&Ev(Oe,he,me,et,!1),ze!==null&&Vt!==null&&Ev(Oe,Vt,ze,et,!0)}}e:{if(he=ue?ks(ue):window,me=he.nodeName&&he.nodeName.toLowerCase(),me==="select"||me==="input"&&he.type==="file")var Mt=L_;else if(D_(he))if(H_)Mt=h2;else{Mt=d2;var Ye=u2}else me=he.nodeName,!me||me.toLowerCase()!=="input"||he.type!=="checkbox"&&he.type!=="radio"?ue&&Ps(ue.elementType)&&(Mt=L_):Mt=f2;if(Mt&&(Mt=Mt(r,ue))){j_(Oe,Mt,c,_e);break e}Ye&&Ye(r,he,ue),r==="focusout"&&ue&&he.type==="number"&&ue.memoizedProps.value!=null&&bo(he,"number",he.value)}switch(Ye=ue?ks(ue):window,r){case"focusin":(D_(Ye)||Ye.contentEditable==="true")&&(Eo=Ye,zm=ue,zc=null);break;case"focusout":zc=zm=Eo=null;break;case"mousedown":$m=!0;break;case"contextmenu":case"mouseup":case"dragend":$m=!1,K_(Oe,c,_e);break;case"selectionchange":if(p2)break;case"keydown":case"keyup":K_(Oe,c,_e)}var dt;if(Hm)e:{switch(r){case"compositionstart":var xt="onCompositionStart";break e;case"compositionend":xt="onCompositionEnd";break e;case"compositionupdate":xt="onCompositionUpdate";break e}xt=void 0}else yo?M_(r,c)&&(xt="onCompositionEnd"):r==="keydown"&&c.keyCode===229&&(xt="onCompositionStart");xt&&(N_&&c.locale!=="ko"&&(yo||xt!=="onCompositionStart"?xt==="onCompositionEnd"&&yo&&(dt=S_()):(js=_e,Mm="value"in js?js.value:js.textContent,yo=!0)),Ye=dh(ue,xt),0<Ye.length&&(xt=new w_(xt,r,null,c,_e),Oe.push({event:xt,listeners:Ye}),dt?xt.data=dt:(dt=P_(c),dt!==null&&(xt.data=dt)))),(dt=s2?a2(r,c):o2(r,c))&&(xt=dh(ue,"onBeforeInput"),0<xt.length&&(Ye=new w_("onBeforeInput","beforeinput",null,c,_e),Oe.push({event:Ye,listeners:xt}),Ye.data=dt)),Q2(Oe,r,ue,c,_e)}_v(Oe,s)})}function hl(r,s,c){return{instance:r,listener:s,currentTarget:c}}function dh(r,s){for(var c=s+"Capture",p=[];r!==null;){var y=r,A=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||A===null||(y=Pc(r,c),y!=null&&p.unshift(hl(r,y,A)),y=Pc(r,s),y!=null&&p.push(hl(r,y,A))),r.tag===3)return p;r=r.return}return[]}function nk(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function Ev(r,s,c,p,y){for(var A=s._reactName,w=[];c!==null&&c!==p;){var H=c,Q=H.alternate,ue=H.stateNode;if(H=H.tag,Q!==null&&Q===p)break;H!==5&&H!==26&&H!==27||ue===null||(Q=ue,y?(ue=Pc(c,A),ue!=null&&w.unshift(hl(c,ue,Q))):y||(ue=Pc(c,A),ue!=null&&w.push(hl(c,ue,Q)))),c=c.return}w.length!==0&&r.push({event:s,listeners:w})}var rk=/\r\n?/g,ik=/\u0000|\uFFFD/g;function vv(r){return(typeof r=="string"?r:""+r).replace(rk,`
49
+ `).replace(ik,"")}function Tv(r,s){return s=vv(s),vv(r)===s}function Yt(r,s,c,p,y,A){switch(c){case"children":typeof p=="string"?s==="body"||s==="textarea"&&p===""||tt(r,p):(typeof p=="number"||typeof p=="bigint")&&s!=="body"&&tt(r,""+p);break;case"className":Lr(r,"class",p);break;case"tabIndex":Lr(r,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":Lr(r,c,p);break;case"style":$t(r,p,A);break;case"data":if(s!=="object"){Lr(r,"data",p);break}case"src":case"href":if(p===""&&(s!=="a"||c!=="href")){r.removeAttribute(c);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){r.removeAttribute(c);break}p=Ds(""+p),r.setAttribute(c,p);break;case"action":case"formAction":if(typeof p=="function"){r.setAttribute(c,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof A=="function"&&(c==="formAction"?(s!=="input"&&Yt(r,s,"name",y.name,y,null),Yt(r,s,"formEncType",y.formEncType,y,null),Yt(r,s,"formMethod",y.formMethod,y,null),Yt(r,s,"formTarget",y.formTarget,y,null)):(Yt(r,s,"encType",y.encType,y,null),Yt(r,s,"method",y.method,y,null),Yt(r,s,"target",y.target,y,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){r.removeAttribute(c);break}p=Ds(""+p),r.setAttribute(c,p);break;case"onClick":p!=null&&(r.onclick=De);break;case"onScroll":p!=null&&At("scroll",r);break;case"onScrollEnd":p!=null&&At("scrollend",r);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(i(61));if(c=p.__html,c!=null){if(y.children!=null)throw Error(i(60));r.innerHTML=c}}break;case"multiple":r.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":r.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){r.removeAttribute("xlink:href");break}c=Ds(""+p),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?r.setAttribute(c,""+p):r.removeAttribute(c);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":p&&typeof p!="function"&&typeof p!="symbol"?r.setAttribute(c,""):r.removeAttribute(c);break;case"capture":case"download":p===!0?r.setAttribute(c,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?r.setAttribute(c,p):r.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?r.setAttribute(c,p):r.removeAttribute(c);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?r.removeAttribute(c):r.setAttribute(c,p);break;case"popover":At("beforetoggle",r),At("toggle",r),lr(r,"popover",p);break;case"xlinkActuate":Or(r,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":Or(r,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":Or(r,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":Or(r,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":Or(r,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":Or(r,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":Or(r,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":Or(r,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":Or(r,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":lr(r,"is",p);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=Ji.get(c)||c,lr(r,c,p))}}function mg(r,s,c,p,y,A){switch(c){case"style":$t(r,p,A);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(i(61));if(c=p.__html,c!=null){if(y.children!=null)throw Error(i(60));r.innerHTML=c}}break;case"children":typeof p=="string"?tt(r,p):(typeof p=="number"||typeof p=="bigint")&&tt(r,""+p);break;case"onScroll":p!=null&&At("scroll",r);break;case"onScrollEnd":p!=null&&At("scrollend",r);break;case"onClick":p!=null&&(r.onclick=De);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ta.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(y=c.endsWith("Capture"),s=c.slice(2,y?c.length-7:void 0),A=r[cr]||null,A=A!=null?A[c]:null,typeof A=="function"&&r.removeEventListener(s,A,y),typeof p=="function")){typeof A!="function"&&A!==null&&(c in r?r[c]=null:r.hasAttribute(c)&&r.removeAttribute(c)),r.addEventListener(s,p,y);break e}c in r?r[c]=p:p===!0?r.setAttribute(c,""):lr(r,c,p)}}}function Qn(r,s,c){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":At("error",r),At("load",r);var p=!1,y=!1,A;for(A in c)if(c.hasOwnProperty(A)){var w=c[A];if(w!=null)switch(A){case"src":p=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,s));default:Yt(r,s,A,w,c,null)}}y&&Yt(r,s,"srcSet",c.srcSet,c,null),p&&Yt(r,s,"src",c.src,c,null);return;case"input":At("invalid",r);var H=A=w=y=null,Q=null,ue=null;for(p in c)if(c.hasOwnProperty(p)){var _e=c[p];if(_e!=null)switch(p){case"name":y=_e;break;case"type":w=_e;break;case"checked":Q=_e;break;case"defaultChecked":ue=_e;break;case"value":A=_e;break;case"defaultValue":H=_e;break;case"children":case"dangerouslySetInnerHTML":if(_e!=null)throw Error(i(137,s));break;default:Yt(r,s,p,_e,c,null)}}Aa(r,A,H,Q,ue,w,y,!1);return;case"select":At("invalid",r),p=w=A=null;for(y in c)if(c.hasOwnProperty(y)&&(H=c[y],H!=null))switch(y){case"value":A=H;break;case"defaultValue":w=H;break;case"multiple":p=H;default:Yt(r,s,y,H,c,null)}s=A,c=w,r.multiple=!!p,s!=null?Vn(r,!!p,s,!1):c!=null&&Vn(r,!!p,c,!0);return;case"textarea":At("invalid",r),A=y=p=null;for(w in c)if(c.hasOwnProperty(w)&&(H=c[w],H!=null))switch(w){case"value":p=H;break;case"defaultValue":y=H;break;case"children":A=H;break;case"dangerouslySetInnerHTML":if(H!=null)throw Error(i(91));break;default:Yt(r,s,w,H,c,null)}_o(r,p,y,A);return;case"option":for(Q in c)if(c.hasOwnProperty(Q)&&(p=c[Q],p!=null))switch(Q){case"selected":r.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:Yt(r,s,Q,p,c,null)}return;case"dialog":At("beforetoggle",r),At("toggle",r),At("cancel",r),At("close",r);break;case"iframe":case"object":At("load",r);break;case"video":case"audio":for(p=0;p<fl.length;p++)At(fl[p],r);break;case"image":At("error",r),At("load",r);break;case"details":At("toggle",r);break;case"embed":case"source":case"link":At("error",r),At("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ue in c)if(c.hasOwnProperty(ue)&&(p=c[ue],p!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,s));default:Yt(r,s,ue,p,c,null)}return;default:if(Ps(s)){for(_e in c)c.hasOwnProperty(_e)&&(p=c[_e],p!==void 0&&mg(r,s,_e,p,c,void 0));return}}for(H in c)c.hasOwnProperty(H)&&(p=c[H],p!=null&&Yt(r,s,H,p,c,null))}function sk(r,s,c,p){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,A=null,w=null,H=null,Q=null,ue=null,_e=null;for(me in c){var Oe=c[me];if(c.hasOwnProperty(me)&&Oe!=null)switch(me){case"checked":break;case"value":break;case"defaultValue":Q=Oe;default:p.hasOwnProperty(me)||Yt(r,s,me,null,p,Oe)}}for(var he in p){var me=p[he];if(Oe=c[he],p.hasOwnProperty(he)&&(me!=null||Oe!=null))switch(he){case"type":A=me;break;case"name":y=me;break;case"checked":ue=me;break;case"defaultChecked":_e=me;break;case"value":w=me;break;case"defaultValue":H=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(i(137,s));break;default:me!==Oe&&Yt(r,s,he,me,p,Oe)}}Ic(r,w,H,Q,ue,_e,A,y);return;case"select":me=w=H=he=null;for(A in c)if(Q=c[A],c.hasOwnProperty(A)&&Q!=null)switch(A){case"value":break;case"multiple":me=Q;default:p.hasOwnProperty(A)||Yt(r,s,A,null,p,Q)}for(y in p)if(A=p[y],Q=c[y],p.hasOwnProperty(y)&&(A!=null||Q!=null))switch(y){case"value":he=A;break;case"defaultValue":H=A;break;case"multiple":w=A;default:A!==Q&&Yt(r,s,y,A,p,Q)}s=H,c=w,p=me,he!=null?Vn(r,!!c,he,!1):!!p!=!!c&&(s!=null?Vn(r,!!c,s,!0):Vn(r,!!c,c?[]:"",!1));return;case"textarea":me=he=null;for(H in c)if(y=c[H],c.hasOwnProperty(H)&&y!=null&&!p.hasOwnProperty(H))switch(H){case"value":break;case"children":break;default:Yt(r,s,H,null,p,y)}for(w in p)if(y=p[w],A=c[w],p.hasOwnProperty(w)&&(y!=null||A!=null))switch(w){case"value":he=y;break;case"defaultValue":me=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(i(91));break;default:y!==A&&Yt(r,s,w,y,p,A)}pf(r,he,me);return;case"option":for(var ze in c)if(he=c[ze],c.hasOwnProperty(ze)&&he!=null&&!p.hasOwnProperty(ze))switch(ze){case"selected":r.selected=!1;break;default:Yt(r,s,ze,null,p,he)}for(Q in p)if(he=p[Q],me=c[Q],p.hasOwnProperty(Q)&&he!==me&&(he!=null||me!=null))switch(Q){case"selected":r.selected=he&&typeof he!="function"&&typeof he!="symbol";break;default:Yt(r,s,Q,he,p,me)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var et in c)he=c[et],c.hasOwnProperty(et)&&he!=null&&!p.hasOwnProperty(et)&&Yt(r,s,et,null,p,he);for(ue in p)if(he=p[ue],me=c[ue],p.hasOwnProperty(ue)&&he!==me&&(he!=null||me!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(i(137,s));break;default:Yt(r,s,ue,he,p,me)}return;default:if(Ps(s)){for(var Vt in c)he=c[Vt],c.hasOwnProperty(Vt)&&he!==void 0&&!p.hasOwnProperty(Vt)&&mg(r,s,Vt,void 0,p,he);for(_e in p)he=p[_e],me=c[_e],!p.hasOwnProperty(_e)||he===me||he===void 0&&me===void 0||mg(r,s,_e,he,p,me);return}}for(var se in c)he=c[se],c.hasOwnProperty(se)&&he!=null&&!p.hasOwnProperty(se)&&Yt(r,s,se,null,p,he);for(Oe in p)he=p[Oe],me=c[Oe],!p.hasOwnProperty(Oe)||he===me||he==null&&me==null||Yt(r,s,Oe,he,p,me)}function Av(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ak(){if(typeof performance.getEntriesByType=="function"){for(var r=0,s=0,c=performance.getEntriesByType("resource"),p=0;p<c.length;p++){var y=c[p],A=y.transferSize,w=y.initiatorType,H=y.duration;if(A&&H&&Av(w)){for(w=0,H=y.responseEnd,p+=1;p<c.length;p++){var Q=c[p],ue=Q.startTime;if(ue>H)break;var _e=Q.transferSize,Oe=Q.initiatorType;_e&&Av(Oe)&&(Q=Q.responseEnd,w+=_e*(Q<H?1:(H-ue)/(Q-ue)))}if(--p,s+=8*(A+w)/(y.duration/1e3),r++,10<r)break}}if(0<r)return s/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var pg=null,gg=null;function fh(r){return r.nodeType===9?r:r.ownerDocument}function Ov(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Sv(r,s){if(r===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&s==="foreignObject"?0:r}function bg(r,s){return r==="textarea"||r==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var _g=null;function ok(){var r=window.event;return r&&r.type==="popstate"?r===_g?!1:(_g=r,!0):(_g=null,!1)}var Cv=typeof setTimeout=="function"?setTimeout:void 0,ck=typeof clearTimeout=="function"?clearTimeout:void 0,xv=typeof Promise=="function"?Promise:void 0,lk=typeof queueMicrotask=="function"?queueMicrotask:typeof xv<"u"?function(r){return xv.resolve(null).then(r).catch(uk)}:Cv;function uk(r){setTimeout(function(){throw r})}function Js(r){return r==="head"}function wv(r,s){var c=s,p=0;do{var y=c.nextSibling;if(r.removeChild(c),y&&y.nodeType===8)if(c=y.data,c==="/$"||c==="/&"){if(p===0){r.removeChild(y),Yo(s);return}p--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")p++;else if(c==="html")ml(r.ownerDocument.documentElement);else if(c==="head"){c=r.ownerDocument.head,ml(c);for(var A=c.firstChild;A;){var w=A.nextSibling,H=A.nodeName;A[va]||H==="SCRIPT"||H==="STYLE"||H==="LINK"&&A.rel.toLowerCase()==="stylesheet"||c.removeChild(A),A=w}}else c==="body"&&ml(r.ownerDocument.body);c=y}while(c);Yo(s)}function Rv(r,s){var c=r;r=0;do{var p=c.nextSibling;if(c.nodeType===1?s?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(s?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),p&&p.nodeType===8)if(c=p.data,c==="/$"){if(r===0)break;r--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||r++;c=p}while(c)}function yg(r){var s=r.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var c=s;switch(s=s.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":yg(c),Rc(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}r.removeChild(c)}}function dk(r,s,c,p){for(;r.nodeType===1;){var y=c;if(r.nodeName.toLowerCase()!==s.toLowerCase()){if(!p&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(p){if(!r[va])switch(s){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(A=r.getAttribute("rel"),A==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(A!==y.rel||r.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||r.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||r.getAttribute("title")!==(y.title==null?null:y.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(A=r.getAttribute("src"),(A!==(y.src==null?null:y.src)||r.getAttribute("type")!==(y.type==null?null:y.type)||r.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&A&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(s==="input"&&r.type==="hidden"){var A=y.name==null?null:""+y.name;if(y.type==="hidden"&&r.getAttribute("name")===A)return r}else return r;if(r=di(r.nextSibling),r===null)break}return null}function fk(r,s,c){if(s==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!c||(r=di(r.nextSibling),r===null))return null;return r}function Nv(r,s){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=di(r.nextSibling),r===null))return null;return r}function Eg(r){return r.data==="$?"||r.data==="$~"}function vg(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function hk(r,s){var c=r.ownerDocument;if(r.data==="$~")r._reactRetry=s;else if(r.data!=="$?"||c.readyState!=="loading")s();else{var p=function(){s(),c.removeEventListener("DOMContentLoaded",p)};c.addEventListener("DOMContentLoaded",p),r._reactRetry=p}}function di(r){for(;r!=null;r=r.nextSibling){var s=r.nodeType;if(s===1||s===3)break;if(s===8){if(s=r.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return r}var Tg=null;function Iv(r){r=r.nextSibling;for(var s=0;r;){if(r.nodeType===8){var c=r.data;if(c==="/$"||c==="/&"){if(s===0)return di(r.nextSibling);s--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||s++}r=r.nextSibling}return null}function kv(r){r=r.previousSibling;for(var s=0;r;){if(r.nodeType===8){var c=r.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(s===0)return r;s--}else c!=="/$"&&c!=="/&"||s++}r=r.previousSibling}return null}function Mv(r,s,c){switch(s=fh(c),r){case"html":if(r=s.documentElement,!r)throw Error(i(452));return r;case"head":if(r=s.head,!r)throw Error(i(453));return r;case"body":if(r=s.body,!r)throw Error(i(454));return r;default:throw Error(i(451))}}function ml(r){for(var s=r.attributes;s.length;)r.removeAttributeNode(s[0]);Rc(r)}var fi=new Map,Pv=new Set;function hh(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var ps=Y.d;Y.d={f:mk,r:pk,D:gk,C:bk,L:_k,m:yk,X:vk,S:Ek,M:Tk};function mk(){var r=ps.f(),s=ih();return r||s}function pk(r){var s=Xi(r);s!==null&&s.tag===5&&s.type==="form"?Xy(s):ps.r(r)}var qo=typeof document>"u"?null:document;function Dv(r,s,c){var p=qo;if(p&&typeof s=="string"&&s){var y=Sr(s);y='link[rel="'+r+'"][href="'+y+'"]',typeof c=="string"&&(y+='[crossorigin="'+c+'"]'),Pv.has(y)||(Pv.add(y),r={rel:r,crossOrigin:c,href:s},p.querySelector(y)===null&&(s=p.createElement("link"),Qn(s,"link",r),Pn(s),p.head.appendChild(s)))}}function gk(r){ps.D(r),Dv("dns-prefetch",r,null)}function bk(r,s){ps.C(r,s),Dv("preconnect",r,s)}function _k(r,s,c){ps.L(r,s,c);var p=qo;if(p&&r&&s){var y='link[rel="preload"][as="'+Sr(s)+'"]';s==="image"&&c&&c.imageSrcSet?(y+='[imagesrcset="'+Sr(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(y+='[imagesizes="'+Sr(c.imageSizes)+'"]')):y+='[href="'+Sr(r)+'"]';var A=y;switch(s){case"style":A=Go(r);break;case"script":A=Ko(r)}fi.has(A)||(r=m({rel:"preload",href:s==="image"&&c&&c.imageSrcSet?void 0:r,as:s},c),fi.set(A,r),p.querySelector(y)!==null||s==="style"&&p.querySelector(pl(A))||s==="script"&&p.querySelector(gl(A))||(s=p.createElement("link"),Qn(s,"link",r),Pn(s),p.head.appendChild(s)))}}function yk(r,s){ps.m(r,s);var c=qo;if(c&&r){var p=s&&typeof s.as=="string"?s.as:"script",y='link[rel="modulepreload"][as="'+Sr(p)+'"][href="'+Sr(r)+'"]',A=y;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":A=Ko(r)}if(!fi.has(A)&&(r=m({rel:"modulepreload",href:r},s),fi.set(A,r),c.querySelector(y)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(gl(A)))return}p=c.createElement("link"),Qn(p,"link",r),Pn(p),c.head.appendChild(p)}}}function Ek(r,s,c){ps.S(r,s,c);var p=qo;if(p&&r){var y=Ms(p).hoistableStyles,A=Go(r);s=s||"default";var w=y.get(A);if(!w){var H={loading:0,preload:null};if(w=p.querySelector(pl(A)))H.loading=5;else{r=m({rel:"stylesheet",href:r,"data-precedence":s},c),(c=fi.get(A))&&Ag(r,c);var Q=w=p.createElement("link");Pn(Q),Qn(Q,"link",r),Q._p=new Promise(function(ue,_e){Q.onload=ue,Q.onerror=_e}),Q.addEventListener("load",function(){H.loading|=1}),Q.addEventListener("error",function(){H.loading|=2}),H.loading|=4,mh(w,s,p)}w={type:"stylesheet",instance:w,count:1,state:H},y.set(A,w)}}}function vk(r,s){ps.X(r,s);var c=qo;if(c&&r){var p=Ms(c).hoistableScripts,y=Ko(r),A=p.get(y);A||(A=c.querySelector(gl(y)),A||(r=m({src:r,async:!0},s),(s=fi.get(y))&&Og(r,s),A=c.createElement("script"),Pn(A),Qn(A,"link",r),c.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},p.set(y,A))}}function Tk(r,s){ps.M(r,s);var c=qo;if(c&&r){var p=Ms(c).hoistableScripts,y=Ko(r),A=p.get(y);A||(A=c.querySelector(gl(y)),A||(r=m({src:r,async:!0,type:"module"},s),(s=fi.get(y))&&Og(r,s),A=c.createElement("script"),Pn(A),Qn(A,"link",r),c.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},p.set(y,A))}}function jv(r,s,c,p){var y=(y=fe.current)?hh(y):null;if(!y)throw Error(i(446));switch(r){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(s=Go(c.href),c=Ms(y).hoistableStyles,p=c.get(s),p||(p={type:"style",instance:null,count:0,state:null},c.set(s,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){r=Go(c.href);var A=Ms(y).hoistableStyles,w=A.get(r);if(w||(y=y.ownerDocument||y,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},A.set(r,w),(A=y.querySelector(pl(r)))&&!A._p&&(w.instance=A,w.state.loading=5),fi.has(r)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},fi.set(r,c),A||Ak(y,r,c,w.state))),s&&p===null)throw Error(i(528,""));return w}if(s&&p!==null)throw Error(i(529,""));return null;case"script":return s=c.async,c=c.src,typeof c=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Ko(c),c=Ms(y).hoistableScripts,p=c.get(s),p||(p={type:"script",instance:null,count:0,state:null},c.set(s,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,r))}}function Go(r){return'href="'+Sr(r)+'"'}function pl(r){return'link[rel="stylesheet"]['+r+"]"}function Lv(r){return m({},r,{"data-precedence":r.precedence,precedence:null})}function Ak(r,s,c,p){r.querySelector('link[rel="preload"][as="style"]['+s+"]")?p.loading=1:(s=r.createElement("link"),p.preload=s,s.addEventListener("load",function(){return p.loading|=1}),s.addEventListener("error",function(){return p.loading|=2}),Qn(s,"link",c),Pn(s),r.head.appendChild(s))}function Ko(r){return'[src="'+Sr(r)+'"]'}function gl(r){return"script[async]"+r}function Hv(r,s,c){if(s.count++,s.instance===null)switch(s.type){case"style":var p=r.querySelector('style[data-href~="'+Sr(c.href)+'"]');if(p)return s.instance=p,Pn(p),p;var y=m({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return p=(r.ownerDocument||r).createElement("style"),Pn(p),Qn(p,"style",y),mh(p,c.precedence,r),s.instance=p;case"stylesheet":y=Go(c.href);var A=r.querySelector(pl(y));if(A)return s.state.loading|=4,s.instance=A,Pn(A),A;p=Lv(c),(y=fi.get(y))&&Ag(p,y),A=(r.ownerDocument||r).createElement("link"),Pn(A);var w=A;return w._p=new Promise(function(H,Q){w.onload=H,w.onerror=Q}),Qn(A,"link",p),s.state.loading|=4,mh(A,c.precedence,r),s.instance=A;case"script":return A=Ko(c.src),(y=r.querySelector(gl(A)))?(s.instance=y,Pn(y),y):(p=c,(y=fi.get(A))&&(p=m({},c),Og(p,y)),r=r.ownerDocument||r,y=r.createElement("script"),Pn(y),Qn(y,"link",p),r.head.appendChild(y),s.instance=y);case"void":return null;default:throw Error(i(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(p=s.instance,s.state.loading|=4,mh(p,c.precedence,r));return s.instance}function mh(r,s,c){for(var p=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=p.length?p[p.length-1]:null,A=y,w=0;w<p.length;w++){var H=p[w];if(H.dataset.precedence===s)A=H;else if(A!==y)break}A?A.parentNode.insertBefore(r,A.nextSibling):(s=c.nodeType===9?c.head:c,s.insertBefore(r,s.firstChild))}function Ag(r,s){r.crossOrigin==null&&(r.crossOrigin=s.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=s.referrerPolicy),r.title==null&&(r.title=s.title)}function Og(r,s){r.crossOrigin==null&&(r.crossOrigin=s.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=s.referrerPolicy),r.integrity==null&&(r.integrity=s.integrity)}var ph=null;function Bv(r,s,c){if(ph===null){var p=new Map,y=ph=new Map;y.set(c,p)}else y=ph,p=y.get(c),p||(p=new Map,y.set(c,p));if(p.has(r))return p;for(p.set(r,null),c=c.getElementsByTagName(r),y=0;y<c.length;y++){var A=c[y];if(!(A[va]||A[Rn]||r==="link"&&A.getAttribute("rel")==="stylesheet")&&A.namespaceURI!=="http://www.w3.org/2000/svg"){var w=A.getAttribute(s)||"";w=r+w;var H=p.get(w);H?H.push(A):p.set(w,[A])}}return p}function Uv(r,s,c){r=r.ownerDocument||r,r.head.insertBefore(c,s==="title"?r.querySelector("head > title"):null)}function Ok(r,s,c){if(c===1||s.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return r=s.disabled,typeof s.precedence=="string"&&r==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function Fv(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function Sk(r,s,c,p){if(c.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var y=Go(p.href),A=s.querySelector(pl(y));if(A){s=A._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(r.count++,r=gh.bind(r),s.then(r,r)),c.state.loading|=4,c.instance=A,Pn(A);return}A=s.ownerDocument||s,p=Lv(p),(y=fi.get(y))&&Ag(p,y),A=A.createElement("link"),Pn(A);var w=A;w._p=new Promise(function(H,Q){w.onload=H,w.onerror=Q}),Qn(A,"link",p),c.instance=A}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(c,s),(s=c.state.preload)&&(c.state.loading&3)===0&&(r.count++,c=gh.bind(r),s.addEventListener("load",c),s.addEventListener("error",c))}}var Sg=0;function Ck(r,s){return r.stylesheets&&r.count===0&&_h(r,r.stylesheets),0<r.count||0<r.imgCount?function(c){var p=setTimeout(function(){if(r.stylesheets&&_h(r,r.stylesheets),r.unsuspend){var A=r.unsuspend;r.unsuspend=null,A()}},6e4+s);0<r.imgBytes&&Sg===0&&(Sg=62500*ak());var y=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&_h(r,r.stylesheets),r.unsuspend)){var A=r.unsuspend;r.unsuspend=null,A()}},(r.imgBytes>Sg?50:800)+s);return r.unsuspend=c,function(){r.unsuspend=null,clearTimeout(p),clearTimeout(y)}}:null}function gh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)_h(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var bh=null;function _h(r,s){r.stylesheets=null,r.unsuspend!==null&&(r.count++,bh=new Map,s.forEach(xk,r),bh=null,gh.call(r))}function xk(r,s){if(!(s.state.loading&4)){var c=bh.get(r);if(c)var p=c.get(null);else{c=new Map,bh.set(r,c);for(var y=r.querySelectorAll("link[data-precedence],style[data-precedence]"),A=0;A<y.length;A++){var w=y[A];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(c.set(w.dataset.precedence,w),p=w)}p&&c.set(null,p)}y=s.instance,w=y.getAttribute("data-precedence"),A=c.get(w)||p,A===p&&c.set(null,y),c.set(w,y),this.count++,p=gh.bind(this),y.addEventListener("load",p),y.addEventListener("error",p),A?A.parentNode.insertBefore(y,A.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(y,r.firstChild)),s.state.loading|=4}}var bl={$$typeof:x,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function wk(r,s,c,p,y,A,w,H,Q){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=an(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=an(0),this.hiddenUpdates=an(null),this.identifierPrefix=p,this.onUncaughtError=y,this.onCaughtError=A,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Q,this.incompleteTransitions=new Map}function zv(r,s,c,p,y,A,w,H,Q,ue,_e,Oe){return r=new wk(r,s,c,w,Q,ue,_e,Oe,H),s=1,A===!0&&(s|=24),A=Ur(3,null,null,s),r.current=A,A.stateNode=r,s=ip(),s.refCount++,r.pooledCache=s,s.refCount++,A.memoizedState={element:p,isDehydrated:c,cache:s},cp(A),r}function $v(r){return r?(r=Ao,r):Ao}function qv(r,s,c,p,y,A){y=$v(y),p.context===null?p.context=y:p.pendingContext=y,p=zs(s),p.payload={element:c},A=A===void 0?null:A,A!==null&&(p.callback=A),c=$s(r,p,s),c!==null&&(Ir(c,r,s),Zc(c,r,s))}function Gv(r,s){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var c=r.retryLane;r.retryLane=c!==0&&c<s?c:s}}function Cg(r,s){Gv(r,s),(r=r.alternate)&&Gv(r,s)}function Kv(r){if(r.tag===13||r.tag===31){var s=xa(r,67108864);s!==null&&Ir(s,r,67108864),Cg(r,67108864)}}function Yv(r){if(r.tag===13||r.tag===31){var s=Gr();s=fn(s);var c=xa(r,s);c!==null&&Ir(c,r,s),Cg(r,s)}}var yh=!0;function Rk(r,s,c,p){var y=U.T;U.T=null;var A=Y.p;try{Y.p=2,xg(r,s,c,p)}finally{Y.p=A,U.T=y}}function Nk(r,s,c,p){var y=U.T;U.T=null;var A=Y.p;try{Y.p=8,xg(r,s,c,p)}finally{Y.p=A,U.T=y}}function xg(r,s,c,p){if(yh){var y=wg(p);if(y===null)hg(r,s,p,Eh,c),Zv(r,p);else if(kk(y,r,s,c,p))p.stopPropagation();else if(Zv(r,p),s&4&&-1<Ik.indexOf(r)){for(;y!==null;){var A=Xi(y);if(A!==null)switch(A.tag){case 3:if(A=A.stateNode,A.current.memoizedState.isDehydrated){var w=Ar(A.pendingLanes);if(w!==0){var H=A;for(H.pendingLanes|=2,H.entangledLanes|=2;w;){var Q=1<<31-Ft(w);H.entanglements[1]|=Q,w&=~Q}zi(A),(Ht&6)===0&&(nh=Lt()+500,dl(0))}}break;case 31:case 13:H=xa(A,2),H!==null&&Ir(H,A,2),ih(),Cg(A,2)}if(A=wg(p),A===null&&hg(r,s,p,Eh,c),A===y)break;y=A}y!==null&&p.stopPropagation()}else hg(r,s,p,null,c)}}function wg(r){return r=at(r),Rg(r)}var Eh=null;function Rg(r){if(Eh=null,r=pr(r),r!==null){var s=u(r);if(s===null)r=null;else{var c=s.tag;if(c===13){if(r=o(s),r!==null)return r;r=null}else if(c===31){if(r=f(s),r!==null)return r;r=null}else if(c===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;r=null}else s!==r&&(r=null)}}return Eh=r,null}function Vv(r){switch(r){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ni()){case be:return 2;case xe:return 8;case $e:case ct:return 32;case wt:return 268435456;default:return 32}default:return 32}}var Ng=!1,ea=null,ta=null,na=null,_l=new Map,yl=new Map,ra=[],Ik="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Zv(r,s){switch(r){case"focusin":case"focusout":ea=null;break;case"dragenter":case"dragleave":ta=null;break;case"mouseover":case"mouseout":na=null;break;case"pointerover":case"pointerout":_l.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":yl.delete(s.pointerId)}}function El(r,s,c,p,y,A){return r===null||r.nativeEvent!==A?(r={blockedOn:s,domEventName:c,eventSystemFlags:p,nativeEvent:A,targetContainers:[y]},s!==null&&(s=Xi(s),s!==null&&Kv(s)),r):(r.eventSystemFlags|=p,s=r.targetContainers,y!==null&&s.indexOf(y)===-1&&s.push(y),r)}function kk(r,s,c,p,y){switch(s){case"focusin":return ea=El(ea,r,s,c,p,y),!0;case"dragenter":return ta=El(ta,r,s,c,p,y),!0;case"mouseover":return na=El(na,r,s,c,p,y),!0;case"pointerover":var A=y.pointerId;return _l.set(A,El(_l.get(A)||null,r,s,c,p,y)),!0;case"gotpointercapture":return A=y.pointerId,yl.set(A,El(yl.get(A)||null,r,s,c,p,y)),!0}return!1}function Wv(r){var s=pr(r.target);if(s!==null){var c=u(s);if(c!==null){if(s=c.tag,s===13){if(s=o(c),s!==null){r.blockedOn=s,ho(r.priority,function(){Yv(c)});return}}else if(s===31){if(s=f(c),s!==null){r.blockedOn=s,ho(r.priority,function(){Yv(c)});return}}else if(s===3&&c.stateNode.current.memoizedState.isDehydrated){r.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}r.blockedOn=null}function vh(r){if(r.blockedOn!==null)return!1;for(var s=r.targetContainers;0<s.length;){var c=wg(r.nativeEvent);if(c===null){c=r.nativeEvent;var p=new c.constructor(c.type,c);Ke=p,c.target.dispatchEvent(p),Ke=null}else return s=Xi(c),s!==null&&Kv(s),r.blockedOn=c,!1;s.shift()}return!0}function Xv(r,s,c){vh(r)&&c.delete(s)}function Mk(){Ng=!1,ea!==null&&vh(ea)&&(ea=null),ta!==null&&vh(ta)&&(ta=null),na!==null&&vh(na)&&(na=null),_l.forEach(Xv),yl.forEach(Xv)}function Th(r,s){r.blockedOn===s&&(r.blockedOn=null,Ng||(Ng=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Mk)))}var Ah=null;function Qv(r){Ah!==r&&(Ah=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Ah===r&&(Ah=null);for(var s=0;s<r.length;s+=3){var c=r[s],p=r[s+1],y=r[s+2];if(typeof p!="function"){if(Rg(p||c)===null)continue;break}var A=Xi(c);A!==null&&(r.splice(s,3),s-=3,wp(A,{pending:!0,data:y,method:c.method,action:p},p,y))}}))}function Yo(r){function s(Q){return Th(Q,r)}ea!==null&&Th(ea,r),ta!==null&&Th(ta,r),na!==null&&Th(na,r),_l.forEach(s),yl.forEach(s);for(var c=0;c<ra.length;c++){var p=ra[c];p.blockedOn===r&&(p.blockedOn=null)}for(;0<ra.length&&(c=ra[0],c.blockedOn===null);)Wv(c),c.blockedOn===null&&ra.shift();if(c=(r.ownerDocument||r).$$reactFormReplay,c!=null)for(p=0;p<c.length;p+=3){var y=c[p],A=c[p+1],w=y[cr]||null;if(typeof A=="function")w||Qv(c);else if(w){var H=null;if(A&&A.hasAttribute("formAction")){if(y=A,w=A[cr]||null)H=w.formAction;else if(Rg(y)!==null)continue}else H=w.action;typeof H=="function"?c[p+1]=H:(c.splice(p,3),p-=3),Qv(c)}}}function Jv(){function r(A){A.canIntercept&&A.info==="react-transition"&&A.intercept({handler:function(){return new Promise(function(w){return y=w})},focusReset:"manual",scroll:"manual"})}function s(){y!==null&&(y(),y=null),p||setTimeout(c,20)}function c(){if(!p&&!navigation.transition){var A=navigation.currentEntry;A&&A.url!=null&&navigation.navigate(A.url,{state:A.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,y=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(c,100),function(){p=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),y!==null&&(y(),y=null)}}}function Ig(r){this._internalRoot=r}Oh.prototype.render=Ig.prototype.render=function(r){var s=this._internalRoot;if(s===null)throw Error(i(409));var c=s.current,p=Gr();qv(c,p,r,s,null,null)},Oh.prototype.unmount=Ig.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var s=r.containerInfo;qv(r.current,2,null,r,null,null),ih(),s[Is]=null}};function Oh(r){this._internalRoot=r}Oh.prototype.unstable_scheduleHydration=function(r){if(r){var s=fo();r={blockedOn:null,target:r,priority:s};for(var c=0;c<ra.length&&s!==0&&s<ra[c].priority;c++);ra.splice(c,0,r),c===0&&Wv(r)}};var e1=t.version;if(e1!=="19.2.0")throw Error(i(527,e1,"19.2.0"));Y.findDOMNode=function(r){var s=r._reactInternals;if(s===void 0)throw typeof r.render=="function"?Error(i(188)):(r=Object.keys(r).join(","),Error(i(268,r)));return r=l(s),r=r!==null?h(r):null,r=r===null?null:r.stateNode,r};var Pk={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Sh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Sh.isDisabled&&Sh.supportsFiber)try{Tn=Sh.inject(Pk),An=Sh}catch{}}return Tl.createRoot=function(r,s){if(!a(r))throw Error(i(299));var c=!1,p="",y=oE,A=cE,w=lE;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(y=s.onUncaughtError),s.onCaughtError!==void 0&&(A=s.onCaughtError),s.onRecoverableError!==void 0&&(w=s.onRecoverableError)),s=zv(r,1,!1,null,null,c,p,null,y,A,w,Jv),r[Is]=s.current,fg(r),new Ig(s)},Tl.hydrateRoot=function(r,s,c){if(!a(r))throw Error(i(299));var p=!1,y="",A=oE,w=cE,H=lE,Q=null;return c!=null&&(c.unstable_strictMode===!0&&(p=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onUncaughtError!==void 0&&(A=c.onUncaughtError),c.onCaughtError!==void 0&&(w=c.onCaughtError),c.onRecoverableError!==void 0&&(H=c.onRecoverableError),c.formState!==void 0&&(Q=c.formState)),s=zv(r,1,!0,s,c??null,p,y,Q,A,w,H,Jv),s.context=$v(null),c=s.current,p=Gr(),p=fn(p),y=zs(p),y.callback=null,$s(c,y,p),c=p,s.current.lanes=c,Wt(s,c),zi(s),r[Is]=s.current,fg(r),new Oh(s)},Tl.version="19.2.0",Tl}var u1;function qk(){if(u1)return Dg.exports;u1=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Dg.exports=$k(),Dg.exports}var Gk=qk();const Kk=bc(Gk),Yk="modulepreload",Vk=function(e){return"/"+e},d1={},D0=function(t,n,i){let a=Promise.resolve();if(n&&n.length>0){let l=function(h){return Promise.all(h.map(m=>Promise.resolve(m).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};var o=l;document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),d=f?.nonce||f?.getAttribute("nonce");a=l(n.map(h=>{if(h=Vk(h),h in d1)return;d1[h]=!0;const m=h.endsWith(".css"),g=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${g}`))return;const b=document.createElement("link");if(b.rel=m?"stylesheet":Yk,m||(b.as="script"),b.crossOrigin="",b.href=h,d&&b.setAttribute("nonce",d),document.head.appendChild(b),m)return new Promise((E,T)=>{b.addEventListener("load",E),b.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${h}`)))})}))}function u(f){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=f,window.dispatchEvent(d),!d.defaultPrevented)throw f}return a.then(f=>{for(const d of f||[])d.status==="rejected"&&u(d.reason);return t().catch(u)})};/**
50
+ * @license lucide-react v0.546.0 - ISC
51
+ *
52
+ * This source code is licensed under the ISC license.
53
+ * See the LICENSE file in the root directory of this source tree.
54
+ */const Zk=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Wk=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,i)=>i?i.toUpperCase():n.toLowerCase()),f1=e=>{const t=Wk(e);return t.charAt(0).toUpperCase()+t.slice(1)},ox=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim(),Xk=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
55
+ * @license lucide-react v0.546.0 - ISC
56
+ *
57
+ * This source code is licensed under the ISC license.
58
+ * See the LICENSE file in the root directory of this source tree.
59
+ */var Qk={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
60
+ * @license lucide-react v0.546.0 - ISC
61
+ *
62
+ * This source code is licensed under the ISC license.
63
+ * See the LICENSE file in the root directory of this source tree.
64
+ */const Jk=J.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:a="",children:u,iconNode:o,...f},d)=>J.createElement("svg",{ref:d,...Qk,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:ox("lucide",a),...!u&&!Xk(f)&&{"aria-hidden":"true"},...f},[...o.map(([l,h])=>J.createElement(l,h)),...Array.isArray(u)?u:[u]]));/**
65
+ * @license lucide-react v0.546.0 - ISC
66
+ *
67
+ * This source code is licensed under the ISC license.
68
+ * See the LICENSE file in the root directory of this source tree.
69
+ */const Et=(e,t)=>{const n=J.forwardRef(({className:i,...a},u)=>J.createElement(Jk,{ref:u,iconNode:t,className:ox(`lucide-${Zk(f1(e))}`,`lucide-${e}`,i),...a}));return n.displayName=f1(e),n};/**
70
+ * @license lucide-react v0.546.0 - ISC
71
+ *
72
+ * This source code is licensed under the ISC license.
73
+ * See the LICENSE file in the root directory of this source tree.
74
+ */const eM=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],tM=Et("arrow-up-down",eM);/**
75
+ * @license lucide-react v0.546.0 - ISC
76
+ *
77
+ * This source code is licensed under the ISC license.
78
+ * See the LICENSE file in the root directory of this source tree.
79
+ */const nM=[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]],rM=Et("award",nM);/**
80
+ * @license lucide-react v0.546.0 - ISC
81
+ *
82
+ * This source code is licensed under the ISC license.
83
+ * See the LICENSE file in the root directory of this source tree.
84
+ */const iM=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],sM=Et("book-open",iM);/**
85
+ * @license lucide-react v0.546.0 - ISC
86
+ *
87
+ * This source code is licensed under the ISC license.
88
+ * See the LICENSE file in the root directory of this source tree.
89
+ */const aM=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],yd=Et("check",aM);/**
90
+ * @license lucide-react v0.546.0 - ISC
91
+ *
92
+ * This source code is licensed under the ISC license.
93
+ * See the LICENSE file in the root directory of this source tree.
94
+ */const oM=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],j0=Et("chevron-down",oM);/**
95
+ * @license lucide-react v0.546.0 - ISC
96
+ *
97
+ * This source code is licensed under the ISC license.
98
+ * See the LICENSE file in the root directory of this source tree.
99
+ */const cM=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Vh=Et("chevron-right",cM);/**
100
+ * @license lucide-react v0.546.0 - ISC
101
+ *
102
+ * This source code is licensed under the ISC license.
103
+ * See the LICENSE file in the root directory of this source tree.
104
+ */const lM=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Tb=Et("circle-alert",lM);/**
105
+ * @license lucide-react v0.546.0 - ISC
106
+ *
107
+ * This source code is licensed under the ISC license.
108
+ * See the LICENSE file in the root directory of this source tree.
109
+ */const uM=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],dM=Et("circle-check-big",uM);/**
110
+ * @license lucide-react v0.546.0 - ISC
111
+ *
112
+ * This source code is licensed under the ISC license.
113
+ * See the LICENSE file in the root directory of this source tree.
114
+ */const fM=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Ua=Et("circle-check",fM);/**
115
+ * @license lucide-react v0.546.0 - ISC
116
+ *
117
+ * This source code is licensed under the ISC license.
118
+ * See the LICENSE file in the root directory of this source tree.
119
+ */const hM=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Ed=Et("circle-x",hM);/**
120
+ * @license lucide-react v0.546.0 - ISC
121
+ *
122
+ * This source code is licensed under the ISC license.
123
+ * See the LICENSE file in the root directory of this source tree.
124
+ */const mM=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],pM=Et("clock",mM);/**
125
+ * @license lucide-react v0.546.0 - ISC
126
+ *
127
+ * This source code is licensed under the ISC license.
128
+ * See the LICENSE file in the root directory of this source tree.
129
+ */const gM=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],xs=Et("code-xml",gM);/**
130
+ * @license lucide-react v0.546.0 - ISC
131
+ *
132
+ * This source code is licensed under the ISC license.
133
+ * See the LICENSE file in the root directory of this source tree.
134
+ */const bM=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],vd=Et("copy",bM);/**
135
+ * @license lucide-react v0.546.0 - ISC
136
+ *
137
+ * This source code is licensed under the ISC license.
138
+ * See the LICENSE file in the root directory of this source tree.
139
+ */const _M=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],yM=Et("ellipsis-vertical",_M);/**
140
+ * @license lucide-react v0.546.0 - ISC
141
+ *
142
+ * This source code is licensed under the ISC license.
143
+ * See the LICENSE file in the root directory of this source tree.
144
+ */const EM=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Bg=Et("external-link",EM);/**
145
+ * @license lucide-react v0.546.0 - ISC
146
+ *
147
+ * This source code is licensed under the ISC license.
148
+ * See the LICENSE file in the root directory of this source tree.
149
+ */const vM=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],TM=Et("eye-off",vM);/**
150
+ * @license lucide-react v0.546.0 - ISC
151
+ *
152
+ * This source code is licensed under the ISC license.
153
+ * See the LICENSE file in the root directory of this source tree.
154
+ */const AM=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],OM=Et("eye",AM);/**
155
+ * @license lucide-react v0.546.0 - ISC
156
+ *
157
+ * This source code is licensed under the ISC license.
158
+ * See the LICENSE file in the root directory of this source tree.
159
+ */const SM=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m9 15 2 2 4-4",key:"1grp1n"}]],h1=Et("file-check",SM);/**
160
+ * @license lucide-react v0.546.0 - ISC
161
+ *
162
+ * This source code is licensed under the ISC license.
163
+ * See the LICENSE file in the root directory of this source tree.
164
+ */const CM=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],fa=Et("funnel",CM);/**
165
+ * @license lucide-react v0.546.0 - ISC
166
+ *
167
+ * This source code is licensed under the ISC license.
168
+ * See the LICENSE file in the root directory of this source tree.
169
+ */const xM=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],wM=Et("github",xM);/**
170
+ * @license lucide-react v0.546.0 - ISC
171
+ *
172
+ * This source code is licensed under the ISC license.
173
+ * See the LICENSE file in the root directory of this source tree.
174
+ */const RM=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],m1=Et("globe",RM);/**
175
+ * @license lucide-react v0.546.0 - ISC
176
+ *
177
+ * This source code is licensed under the ISC license.
178
+ * See the LICENSE file in the root directory of this source tree.
179
+ */const NM=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],oc=Et("info",NM);/**
180
+ * @license lucide-react v0.546.0 - ISC
181
+ *
182
+ * This source code is licensed under the ISC license.
183
+ * See the LICENSE file in the root directory of this source tree.
184
+ */const IM=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],Dd=Et("key",IM);/**
185
+ * @license lucide-react v0.546.0 - ISC
186
+ *
187
+ * This source code is licensed under the ISC license.
188
+ * See the LICENSE file in the root directory of this source tree.
189
+ */const kM=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],Ab=Et("keyboard",kM);/**
190
+ * @license lucide-react v0.546.0 - ISC
191
+ *
192
+ * This source code is licensed under the ISC license.
193
+ * See the LICENSE file in the root directory of this source tree.
194
+ */const MM=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],p1=Et("log-out",MM);/**
195
+ * @license lucide-react v0.546.0 - ISC
196
+ *
197
+ * This source code is licensed under the ISC license.
198
+ * See the LICENSE file in the root directory of this source tree.
199
+ */const PM=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],DM=Et("message-circle",PM);/**
200
+ * @license lucide-react v0.546.0 - ISC
201
+ *
202
+ * This source code is licensed under the ISC license.
203
+ * See the LICENSE file in the root directory of this source tree.
204
+ */const jM=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],LM=Et("palette",jM);/**
205
+ * @license lucide-react v0.546.0 - ISC
206
+ *
207
+ * This source code is licensed under the ISC license.
208
+ * See the LICENSE file in the root directory of this source tree.
209
+ */const HM=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],jd=Et("refresh-cw",HM);/**
210
+ * @license lucide-react v0.546.0 - ISC
211
+ *
212
+ * This source code is licensed under the ISC license.
213
+ * See the LICENSE file in the root directory of this source tree.
214
+ */const BM=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],UM=Et("send",BM);/**
215
+ * @license lucide-react v0.546.0 - ISC
216
+ *
217
+ * This source code is licensed under the ISC license.
218
+ * See the LICENSE file in the root directory of this source tree.
219
+ */const FM=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],fc=Et("server",FM);/**
220
+ * @license lucide-react v0.546.0 - ISC
221
+ *
222
+ * This source code is licensed under the ISC license.
223
+ * See the LICENSE file in the root directory of this source tree.
224
+ */const zM=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Ob=Et("settings",zM);/**
225
+ * @license lucide-react v0.546.0 - ISC
226
+ *
227
+ * This source code is licensed under the ISC license.
228
+ * See the LICENSE file in the root directory of this source tree.
229
+ */const $M=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Ug=Et("shield",$M);/**
230
+ * @license lucide-react v0.546.0 - ISC
231
+ *
232
+ * This source code is licensed under the ISC license.
233
+ * See the LICENSE file in the root directory of this source tree.
234
+ */const qM=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Ld=Et("sparkles",qM);/**
235
+ * @license lucide-react v0.546.0 - ISC
236
+ *
237
+ * This source code is licensed under the ISC license.
238
+ * See the LICENSE file in the root directory of this source tree.
239
+ */const GM=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],cx=Et("trash-2",GM);/**
240
+ * @license lucide-react v0.546.0 - ISC
241
+ *
242
+ * This source code is licensed under the ISC license.
243
+ * See the LICENSE file in the root directory of this source tree.
244
+ */const KM=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],YM=Et("triangle-alert",KM);/**
245
+ * @license lucide-react v0.546.0 - ISC
246
+ *
247
+ * This source code is licensed under the ISC license.
248
+ * See the LICENSE file in the root directory of this source tree.
249
+ */const VM=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],lm=Et("wrench",VM);/**
250
+ * @license lucide-react v0.546.0 - ISC
251
+ *
252
+ * This source code is licensed under the ISC license.
253
+ * See the LICENSE file in the root directory of this source tree.
254
+ */const ZM=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],lx=Et("x",ZM);/**
255
+ * @license lucide-react v0.546.0 - ISC
256
+ *
257
+ * This source code is licensed under the ISC license.
258
+ * See the LICENSE file in the root directory of this source tree.
259
+ */const WM=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],L0=Et("zap",WM),g1=e=>{let t;const n=new Set,i=(l,h)=>{const m=typeof l=="function"?l(t):l;if(!Object.is(m,t)){const g=t;t=h??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(b=>b(t,g))}},a=()=>t,f={setState:i,getState:a,getInitialState:()=>d,subscribe:l=>(n.add(l),()=>n.delete(l))},d=t=e(i,a,f);return f},XM=(e=>e?g1(e):g1),QM=e=>e;function JM(e,t=QM){const n=Cn.useSyncExternalStore(e.subscribe,Cn.useCallback(()=>t(e.getState()),[e,t]),Cn.useCallback(()=>t(e.getInitialState()),[e,t]));return Cn.useDebugValue(n),n}const b1=e=>{const t=XM(e),n=i=>JM(t,i);return Object.assign(n,t),n},Sb=(e=>e?b1(e):b1);function Cb(e,t){let n;try{n=e()}catch{return}return{getItem:a=>{var u;const o=d=>d===null?null:JSON.parse(d,void 0),f=(u=n.getItem(a))!=null?u:null;return f instanceof Promise?f.then(o):o(f)},setItem:(a,u)=>n.setItem(a,JSON.stringify(u,void 0)),removeItem:a=>n.removeItem(a)}}const H0=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(i){return H0(i)(n)},catch(i){return this}}}catch(n){return{then(i){return this},catch(i){return H0(i)(n)}}}},e3=(e,t)=>(n,i,a)=>{let u={storage:Cb(()=>localStorage),partialize:T=>T,version:0,merge:(T,O)=>({...O,...T}),...t},o=!1;const f=new Set,d=new Set;let l=u.storage;if(!l)return e((...T)=>{console.warn(`[zustand persist middleware] Unable to update item '${u.name}', the given storage is currently unavailable.`),n(...T)},i,a);const h=()=>{const T=u.partialize({...i()});return l.setItem(u.name,{state:T,version:u.version})},m=a.setState;a.setState=(T,O)=>(m(T,O),h());const g=e((...T)=>(n(...T),h()),i,a);a.getInitialState=()=>g;let b;const E=()=>{var T,O;if(!l)return;o=!1,f.forEach(C=>{var x;return C((x=i())!=null?x:g)});const v=((O=u.onRehydrateStorage)==null?void 0:O.call(u,(T=i())!=null?T:g))||void 0;return H0(l.getItem.bind(l))(u.name).then(C=>{if(C)if(typeof C.version=="number"&&C.version!==u.version){if(u.migrate){const x=u.migrate(C.state,C.version);return x instanceof Promise?x.then(I=>[!0,I]):[!0,x]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,C.state];return[!1,void 0]}).then(C=>{var x;const[I,j]=C;if(b=u.merge(j,(x=i())!=null?x:g),n(b,!0),I)return h()}).then(()=>{v?.(b,void 0),b=i(),o=!0,d.forEach(C=>C(b))}).catch(C=>{v?.(void 0,C)})};return a.persist={setOptions:T=>{u={...u,...T},T.storage&&(l=T.storage)},clearStorage:()=>{l?.removeItem(u.name)},getOptions:()=>u,rehydrate:()=>E(),hasHydrated:()=>o,onHydrate:T=>(f.add(T),()=>{f.delete(T)}),onFinishHydration:T=>(d.add(T),()=>{d.delete(T)})},u.skipHydration||E(),b||g},ux=e3,t3=Cb(()=>({getItem:e=>{const t=localStorage.getItem(e);if(!t)return null;const n=JSON.parse(t);return n.state?.serverData&&Object.keys(n.state.serverData).forEach(i=>{const a=n.state.serverData[i];a.toolStates&&Object.keys(a.toolStates).forEach(u=>{const o=a.toolStates[u];o.lastExecuted&&(o.lastExecuted=new Date(o.lastExecuted))})}),t},setItem:(e,t)=>{localStorage.setItem(e,t)},removeItem:e=>{localStorage.removeItem(e)}})),Od=Sb()(ux((e,t)=>({serverData:{},recordToolExecution:(n,i)=>{e(a=>{const u=a.serverData[n]||{toolStates:{},toolParameters:{}},o=u.toolStates[i]||{executionCount:0};return{serverData:{...a.serverData,[n]:{...u,toolStates:{...u.toolStates,[i]:{lastExecuted:new Date,executionCount:o.executionCount+1}}}}}})},saveToolParameters:(n,i,a)=>{e(u=>{const o=u.serverData[n]||{toolStates:{},toolParameters:{}};return{serverData:{...u.serverData,[n]:{...o,toolParameters:{...o.toolParameters,[i]:a}}}}})},getToolParameters:(n,i)=>t().serverData[n]?.toolParameters[i],getToolState:(n,i)=>t().serverData[n]?.toolStates[i],clearServerData:n=>{e(i=>{const{[n]:a,...u}=i.serverData;return{serverData:u}})},clearToolParameters:(n,i)=>{e(a=>{const u=a.serverData[n];if(!u)return a;const{[i]:o,...f}=u.toolParameters;return{serverData:{...a.serverData,[n]:{...u,toolParameters:f}}}})}}),{name:"hoot-tool-state",version:1,storage:t3})),n3=Cb(()=>({getItem:e=>{const t=localStorage.getItem(e);if(!t)return null;const n=JSON.parse(t);return n.state?.servers&&(n.state.servers=n.state.servers.map(i=>({...i,lastConnected:i.lastConnected?new Date(i.lastConnected):void 0}))),n.state?.history&&(n.state.history=n.state.history.map(i=>({...i,timestamp:new Date(i.timestamp),result:{...i.result,timestamp:new Date(i.result.timestamp)}}))),t},setItem:(e,t)=>{localStorage.setItem(e,t)},removeItem:e=>{localStorage.removeItem(e)}})),Ue=Sb()(ux(e=>({servers:[],selectedServerId:null,selectedToolName:null,tools:{},history:[],searchQuery:"",executingTools:[],faviconCache:{},toolFilterEnabled:!0,toolFilterConfig:{topK:20,minScore:.3,contextMessages:3,maxContextTokens:500},toolFilterReady:!1,portkeyAuth:{useApiKey:!1,apiKey:null,baseUrl:null},addServer:t=>e(n=>({servers:[...n.servers,{...t,id:"id"in t?t.id:crypto.randomUUID(),connected:!1}]})),removeServer:t=>e(n=>(Od.getState().clearServerData(t),{servers:n.servers.filter(i=>i.id!==t),selectedServerId:n.selectedServerId===t?null:n.selectedServerId,tools:Object.fromEntries(Object.entries(n.tools).filter(([i])=>i!==t))})),updateServer:(t,n)=>e(i=>({servers:i.servers.map(a=>a.id===t?{...a,...n}:a)})),setSelectedServer:t=>e({selectedServerId:t,selectedToolName:null}),setTools:(t,n)=>e(i=>({tools:{...i.tools,[t]:n}})),setSelectedTool:t=>e({selectedToolName:t}),addToHistory:t=>e(n=>({history:[{...t,id:crypto.randomUUID(),timestamp:new Date},...n.history].slice(0,100)})),clearHistory:()=>e({history:[]}),setToolExecuting:(t,n,i)=>e(a=>{const u=`${t}:${n}`;if(i){if(!a.executingTools.includes(u))return{executingTools:[...a.executingTools,u]}}else return{executingTools:a.executingTools.filter(o=>o!==u)};return a}),setSearchQuery:t=>e({searchQuery:t}),setFaviconUrl:(t,n)=>e(i=>({faviconCache:{...i.faviconCache,[t]:n}})),setToolFilterEnabled:t=>e({toolFilterEnabled:t}),updateToolFilterConfig:t=>e(n=>({toolFilterConfig:{...n.toolFilterConfig,...t}})),setToolFilterReady:t=>e({toolFilterReady:t}),setPortkeyUseApiKey:t=>e(n=>({portkeyAuth:{...n.portkeyAuth,useApiKey:t}})),setPortkeyApiKey:t=>e(n=>({portkeyAuth:{...n.portkeyAuth,apiKey:t}})),setPortkeyBaseUrl:t=>e(n=>({portkeyAuth:{...n.portkeyAuth,baseUrl:t}}))}),{name:"hoot-storage",version:1,storage:n3,partialize:e=>({servers:e.servers.map(t=>({...t,connected:!1,error:void 0})),tools:e.tools,faviconCache:e.faviconCache,history:e.history.slice(0,50),selectedServerId:null,selectedToolName:null,searchQuery:"",executingTools:[],toolFilterEnabled:e.toolFilterEnabled,toolFilterConfig:e.toolFilterConfig,toolFilterReady:!1,portkeyAuth:e.portkeyAuth})}));class r3{serverId;_redirectUrl;constructor(t,n,i=`${window.location.origin}/oauth/callback`){this.serverId=t,this._redirectUrl=i}get redirectUrl(){return this._redirectUrl}get clientMetadata(){return{client_name:"Hoot MCP Testing Tool",client_uri:window.location.origin,redirect_uris:[this._redirectUrl],grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"}}async state(){const t=new Uint8Array(32);crypto.getRandomValues(t);const n=Array.from(t,u=>u.toString(16).padStart(2,"0")).join(""),i={path:window.location.pathname,search:window.location.search,serverId:this.serverId};return btoa(JSON.stringify({csrf:n,return:i}))}async clientInformation(){const t=`oauth_client_${this.serverId}`,n=localStorage.getItem(t);if(n)try{return JSON.parse(n)}catch{return}}async saveClientInformation(t){const n=`oauth_client_${this.serverId}`;localStorage.setItem(n,JSON.stringify(t))}async tokens(){const t=`oauth_tokens_${this.serverId}`,n=localStorage.getItem(t);if(n)try{return JSON.parse(n)}catch{return}}async saveTokens(t){const n=`oauth_tokens_${this.serverId}`;localStorage.setItem(n,JSON.stringify(t)),console.log(`🔐 Hoot: Saved OAuth tokens for server ${this.serverId}`)}async redirectToAuthorization(t){console.log(`🔐 Hoot: Redirecting to authorization: ${t.toString()}`);const n=sessionStorage.getItem("oauth_last_redirect"),i=Date.now();if(n&&i-parseInt(n)<3e3)throw console.error("🔐 Hoot: Redirect loop detected! Aborting to prevent infinite redirects."),sessionStorage.removeItem("oauth_last_redirect"),new Error("OAuth redirect loop detected. Please check your OAuth configuration.");sessionStorage.setItem("oauth_last_redirect",i.toString()),sessionStorage.setItem("oauth_server_id",this.serverId),await new Promise(a=>setTimeout(a,100)),console.log("🔐 Hoot: Performing redirect now..."),window.location.href=t.toString()}async saveCodeVerifier(t){const n=`oauth_verifier_${this.serverId}`;sessionStorage.setItem(n,t)}async codeVerifier(){const t=`oauth_verifier_${this.serverId}`,n=sessionStorage.getItem(t);if(!n)throw new Error("Code verifier not found. Authorization flow may have been interrupted.");return n}async invalidateCredentials(t){console.warn(`🔐 Hoot: Invalidating credentials (${t}) for server ${this.serverId}`),(t==="all"||t==="client")&&localStorage.removeItem(`oauth_client_${this.serverId}`),(t==="all"||t==="tokens")&&localStorage.removeItem(`oauth_tokens_${this.serverId}`),(t==="all"||t==="verifier")&&sessionStorage.removeItem(`oauth_verifier_${this.serverId}`)}async isTokenExpired(t){return(t||await this.tokens())?.expires_in,!1}async getValidAccessToken(){const t=await this.tokens();if(t?.access_token)return t.access_token}}const _1="hoot_user_id";function i3(){let e=localStorage.getItem(_1);return e||(e=crypto.randomUUID(),localStorage.setItem(_1,e)),e}const _i="http://localhost:8008";let da=null,Vo=null;async function Gd(){return da||Vo||(Vo=(async()=>{try{const e=i3(),t=await fetch(`${_i}/auth/token`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})});if(!t.ok)throw new Error("Failed to retrieve session token");if(da=(await t.json()).token,!da)throw new Error("No token received from backend");return da}catch(e){throw console.error("Failed to get session token:",e),Vo=null,new Error("Cannot connect to Hoot backend. Make sure it's running on port 8008.")}finally{da&&(Vo=null)}})(),Vo)}async function dx(){try{await Gd(),console.log("Backend client initialized successfully")}catch(e){console.error("Failed to initialize backend client:",e)}}async function bi(e,t={},n=!0){try{const i=await Gd(),a=new Headers(t.headers);a.set("x-hoot-token",i),a.set("Content-Type","application/json");const u=await fetch(e,{...t,headers:a});return u.status===401&&n?(console.log("Auth token expired, refreshing..."),da=null,bi(e,t,!1)):u}catch(i){if(n)return da=null,bi(e,t,!1);throw i}}async function xb(e,t){try{const i=await(await bi(`${_i}/mcp/discover-oauth`,{method:"POST",body:JSON.stringify({url:e,transport:t})})).json();return i.success?{requiresOAuth:i.requiresOAuth||!1}:{requiresOAuth:!1,error:i.error}}catch(n){return console.error("OAuth discovery error:",n),{requiresOAuth:!1,error:n instanceof Error?n.message:"Discovery failed"}}}async function wb(e){try{const t=await bi(`${_i}/mcp/auto-detect`,{method:"POST",body:JSON.stringify({url:e})}),n=await t.json();return!t.ok||!n.success?{success:!1,error:n.error||"Auto-detection failed"}:{success:!0,serverInfo:n.serverInfo,transport:n.transport,requiresOAuth:n.requiresOAuth||!1,requiresClientCredentials:n.requiresClientCredentials||!1,requiresHeaderAuth:n.requiresHeaderAuth||!1}}catch(t){return console.error("Auto-detect error:",t),{success:!1,error:t instanceof Error?t.message:"Auto-detection failed"}}}async function fx(){try{return(await fetch(`${_i}/health`,{method:"GET",signal:AbortSignal.timeout(1e3)})).ok}catch{return!1}}async function hx(e,t){try{const n=await bi(`${_i}/mcp/connect`,{method:"POST",body:JSON.stringify({serverId:e.id,serverName:e.name,url:e.url,transport:e.transport,auth:e.auth,authorizationCode:t})}),i=await n.json();return n.ok?{success:!0}:{success:!1,error:i.error||"Connection failed",needsAuth:i.needsAuth||!1,authorizationUrl:i.authorizationUrl}}catch(n){return console.error("Backend connection error:",n),{success:!1,error:n instanceof Error?n.message:"Failed to connect to backend server"}}}async function mx(e){try{await bi(`${_i}/mcp/disconnect`,{method:"POST",body:JSON.stringify({serverId:e})})}catch(t){throw console.error("Backend disconnect error:",t),t}}async function B0(e){try{const t=await bi(`${_i}/mcp/clear-oauth-tokens`,{method:"POST",body:JSON.stringify({serverId:e})});if(!t.ok){const n=await t.json();throw new Error(n.error||"Failed to clear OAuth tokens")}}catch(t){throw console.error("Backend clear OAuth tokens error:",t),t}}async function px(e){try{const t=await bi(`${_i}/mcp/tools/${e}`,{method:"GET"});if(!t.ok){const i=await t.json();throw new Error(i.error||"Failed to list tools")}return(await t.json()).tools}catch(t){throw console.error("Backend list tools error:",t),t}}async function gx(e,t,n){try{const i=await bi(`${_i}/mcp/execute`,{method:"POST",body:JSON.stringify({serverId:e,toolName:t,arguments:n})});if(!i.ok){const u=await i.json();throw new Error(u.error||"Tool execution failed")}return(await i.json()).result}catch(i){throw console.error("Backend execute tool error:",i),i}}async function Rb(e){try{const t=await bi(`${_i}/mcp/server-info/${e}`,{method:"GET"});return t.ok?(await t.json()).serverInfo:null}catch(t){return console.error("Backend get server info error:",t),null}}async function bx(e){try{const t=await bi(`${_i}/mcp/oauth-metadata/${e}`,{method:"GET"});return t.ok?(await t.json()).metadata||null:(t.status!==404&&console.error(`Failed to fetch OAuth metadata (${t.status}):`,await t.text()),null)}catch(t){return console.error("Backend get OAuth metadata error:",t),null}}async function Hd(e,t){try{const n=await bi(`${_i}/mcp/favicon`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverUrl:e,oauthLogoUri:t})});return n.ok&&(await n.json()).faviconUrl||null}catch(n){return console.error("Backend get favicon error:",n),null}}const y1=Object.freeze(Object.defineProperty({__proto__:null,autoDetectServer:wb,clearOAuthTokens:B0,connectToServer:hx,disconnectFromServer:mx,discoverOAuth:xb,executeTool:gx,getFaviconUrl:Hd,getOAuthMetadata:bx,getServerInfo:Rb,getSessionToken:Gd,initializeBackendClient:dx,isBackendAvailable:fx,listTools:px},Symbol.toStringTag,{value:"Module"}));class s3{oauthProviders=new Map;connectedServers=new Set;async connect(t,n,i=!1){this.connectedServers.has(t.id)&&await this.disconnect(t.id);try{if(console.log(`🔌 Connecting to ${t.name} via backend...`,{transport:t.transport,url:t.url,hasAuth:!!t.auth,authType:t.auth?.type,hasAuthCode:!!n}),!await fx())throw new Error("Backend server is not running. Please start it with: npm run backend");if(t.auth?.type==="oauth"&&t.url){const o=new r3(t.id,t.url);this.oauthProviders.set(t.id,o)}const u=await hx(t,n);if(!u.success){if(u.needsAuth&&u.authorizationUrl){if(i)return console.log(`🔐 ${t.name} needs OAuth authorization (skipped during auto-reconnect)`),!1;const o=this.oauthProviders.get(t.id);if(o)return console.log(`🔐 Redirecting to OAuth: ${u.authorizationUrl}`),await o.redirectToAuthorization(new URL(u.authorizationUrl)),!1}throw new Error(u.error||"Connection failed")}return this.connectedServers.add(t.id),console.log(`✅ Connected to ${t.name}`),!0}catch(a){throw this.oauthProviders.delete(t.id),this.connectedServers.delete(t.id),console.error(`❌ Connection failed for ${t.name}:`,a),a}}async disconnect(t){try{await mx(t),this.connectedServers.delete(t),this.oauthProviders.delete(t)}catch(n){console.error("Disconnect error:",n),this.connectedServers.delete(t),this.oauthProviders.delete(t)}}getOAuthProvider(t){return this.oauthProviders.get(t)}async needsTokenRefresh(t){const n=this.oauthProviders.get(t);return n?n.isTokenExpired():!1}async listTools(t){if(!this.connectedServers.has(t))throw new Error("Server not connected");return await px(t)}async executeTool(t,n,i){if(!this.connectedServers.has(t))throw new Error("Server not connected");return await gx(t,n,i)}isConnected(t){return this.connectedServers.has(t)}async disconnectAll(){const t=Array.from(this.connectedServers);await Promise.all(t.map(n=>this.disconnect(n)))}}const lc=new s3,a3=Object.freeze(Object.defineProperty({__proto__:null,mcpClient:lc},Symbol.toStringTag,{value:"Module"})),eo=Sb(e=>({toasts:[],addToast:(t,n,i,a)=>{const o={id:`toast-${Date.now()}-${Math.random()}`,type:t,message:n,description:i,duration:a??5e3};e(f=>({toasts:[...f.toasts,o]}))},removeToast:t=>{e(n=>({toasts:n.toasts.filter(i=>i.id!==t)}))},clearToasts:()=>{e({toasts:[]})}})),gi={success:(e,t,n)=>{eo.getState().addToast("success",e,t,n)},error:(e,t,n)=>{eo.getState().addToast("error",e,t,n)},warning:(e,t,n)=>{eo.getState().addToast("warning",e,t,n)},warn:(e,t,n)=>{eo.getState().addToast("warning",e,t,n)},info:(e,t,n)=>{eo.getState().addToast("info",e,t,n)}},o3=Object.freeze({status:"aborted"});function ye(e,t,n){function i(f,d){var l;Object.defineProperty(f,"_zod",{value:f._zod??{},enumerable:!1}),(l=f._zod).traits??(l.traits=new Set),f._zod.traits.add(e),t(f,d);for(const h in o.prototype)h in f||Object.defineProperty(f,h,{value:o.prototype[h].bind(f)});f._zod.constr=o,f._zod.def=d}const a=n?.Parent??Object;class u extends a{}Object.defineProperty(u,"name",{value:e});function o(f){var d;const l=n?.Parent?new u:this;i(l,f),(d=l._zod).deferred??(d.deferred=[]);for(const h of l._zod.deferred)h();return l}return Object.defineProperty(o,"init",{value:i}),Object.defineProperty(o,Symbol.hasInstance,{value:f=>n?.Parent&&f instanceof n.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class Bd extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const _x={};function ma(e){return _x}function c3(e){const t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,a])=>t.indexOf(+i)===-1).map(([i,a])=>a)}function l3(e,t){return typeof t=="bigint"?t.toString():t}function Nb(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ib(e){return e==null}function kb(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function u3(e,t){const n=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,a=n>i?n:i,u=Number.parseInt(e.toFixed(a).replace(".","")),o=Number.parseInt(t.toFixed(a).replace(".",""));return u%o/10**a}function un(e,t,n){Object.defineProperty(e,t,{get(){{const i=n();return e[t]=i,i}},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function um(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Al(e){return JSON.stringify(e)}const yx=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function Zh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const d3=Nb(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Wh(e){if(Zh(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(Zh(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}const f3=new Set(["string","number","symbol"]);function Kd(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function so(e,t,n){const i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function Ve(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function h3(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const m3={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function p3(e,t){const n={},i=e._zod.def;for(const a in t){if(!(a in i.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(n[a]=i.shape[a])}return so(e,{...e._zod.def,shape:n,checks:[]})}function g3(e,t){const n={...e._zod.def.shape},i=e._zod.def;for(const a in t){if(!(a in i.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete n[a]}return so(e,{...e._zod.def,shape:n,checks:[]})}function b3(e,t){if(!Wh(t))throw new Error("Invalid input to extend: expected a plain object");const n={...e._zod.def,get shape(){const i={...e._zod.def.shape,...t};return um(this,"shape",i),i},checks:[]};return so(e,n)}function _3(e,t){return so(e,{...e._zod.def,get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return um(this,"shape",n),n},catchall:t._zod.def.catchall,checks:[]})}function y3(e,t,n){const i=t._zod.def.shape,a={...i};if(n)for(const u in n){if(!(u in i))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(a[u]=e?new e({type:"optional",innerType:i[u]}):i[u])}else for(const u in i)a[u]=e?new e({type:"optional",innerType:i[u]}):i[u];return so(t,{...t._zod.def,shape:a,checks:[]})}function E3(e,t,n){const i=t._zod.def.shape,a={...i};if(n)for(const u in n){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(a[u]=new e({type:"nonoptional",innerType:i[u]}))}else for(const u in i)a[u]=new e({type:"nonoptional",innerType:i[u]});return so(t,{...t._zod.def,shape:a,checks:[]})}function Sd(e,t=0){for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function to(e,t){return t.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function Ch(e){return typeof e=="string"?e:e?.message}function pa(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const a=Ch(e.inst?._zod.def?.error?.(e))??Ch(t?.error?.(e))??Ch(n.customError?.(e))??Ch(n.localeError?.(e))??"Invalid input";i.message=a}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function Mb(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Ud(...e){const[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}const Ex=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,l3,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},vx=ye("$ZodError",Ex),Tx=ye("$ZodError",Ex,{Parent:Error});function v3(e,t=n=>n.message){const n={},i=[];for(const a of e.issues)a.path.length>0?(n[a.path[0]]=n[a.path[0]]||[],n[a.path[0]].push(t(a))):i.push(t(a));return{formErrors:i,fieldErrors:n}}function T3(e,t){const n=t||function(u){return u.message},i={_errors:[]},a=u=>{for(const o of u.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(f=>a({issues:f}));else if(o.code==="invalid_key")a({issues:o.issues});else if(o.code==="invalid_element")a({issues:o.issues});else if(o.path.length===0)i._errors.push(n(o));else{let f=i,d=0;for(;d<o.path.length;){const l=o.path[d];d===o.path.length-1?(f[l]=f[l]||{_errors:[]},f[l]._errors.push(n(o))):f[l]=f[l]||{_errors:[]},f=f[l],d++}}};return a(e),i}const A3=e=>(t,n,i,a)=>{const u=i?Object.assign(i,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},u);if(o instanceof Promise)throw new Bd;if(o.issues.length){const f=new(a?.Err??e)(o.issues.map(d=>pa(d,u,ma())));throw yx(f,a?.callee),f}return o.value},O3=e=>async(t,n,i,a)=>{const u=i?Object.assign(i,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},u);if(o instanceof Promise&&(o=await o),o.issues.length){const f=new(a?.Err??e)(o.issues.map(d=>pa(d,u,ma())));throw yx(f,a?.callee),f}return o.value},Ax=e=>(t,n,i)=>{const a=i?{...i,async:!1}:{async:!1},u=t._zod.run({value:n,issues:[]},a);if(u instanceof Promise)throw new Bd;return u.issues.length?{success:!1,error:new(e??vx)(u.issues.map(o=>pa(o,a,ma())))}:{success:!0,data:u.value}},S3=Ax(Tx),Ox=e=>async(t,n,i)=>{const a=i?Object.assign(i,{async:!0}):{async:!0};let u=t._zod.run({value:n,issues:[]},a);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(o=>pa(o,a,ma())))}:{success:!0,data:u.value}},C3=Ox(Tx),x3=/^[cC][^\s-]{8,}$/,w3=/^[0-9a-z]+$/,R3=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,N3=/^[0-9a-vA-V]{20}$/,I3=/^[A-Za-z0-9]{27}$/,k3=/^[a-zA-Z0-9_-]{21}$/,M3=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,P3=/^([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})$/,E1=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[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)$/,D3=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,j3="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function L3(){return new RegExp(j3,"u")}const H3=/^(?:(?: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])$/,B3=/^(([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})$/,U3=/^((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])$/,F3=/^(([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])$/,z3=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Sx=/^[A-Za-z0-9_-]*$/,$3=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,q3=/^\+(?:[0-9]){6,14}[0-9]$/,Cx="(?:(?:\\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])))",G3=new RegExp(`^${Cx}$`);function xx(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function K3(e){return new RegExp(`^${xx(e)}$`)}function Y3(e){const t=xx({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-]\\d{2}:\\d{2})");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${Cx}T(?:${i})$`)}const V3=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Z3=/^\d+$/,W3=/^-?\d+(?:\.\d+)?/i,X3=/true|false/i,Q3=/null/i,J3=/^[^A-Z]*$/,eP=/^[^a-z]*$/,Dr=ye("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),wx={number:"number",bigint:"bigint",object:"date"},Rx=ye("$ZodCheckLessThan",(e,t)=>{Dr.init(e,t);const n=wx[typeof t.value];e._zod.onattach.push(i=>{const a=i._zod.bag,u=(t.inclusive?a.maximum:a.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<u&&(t.inclusive?a.maximum=t.value:a.exclusiveMaximum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:n,code:"too_big",maximum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Nx=ye("$ZodCheckGreaterThan",(e,t)=>{Dr.init(e,t);const n=wx[typeof t.value];e._zod.onattach.push(i=>{const a=i._zod.bag,u=(t.inclusive?a.minimum:a.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>u&&(t.inclusive?a.minimum=t.value:a.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),tP=ye("$ZodCheckMultipleOf",(e,t)=>{Dr.init(e,t),e._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):u3(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),nP=ye("$ZodCheckNumberFormat",(e,t)=>{Dr.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[a,u]=m3[t.format];e._zod.onattach.push(o=>{const f=o._zod.bag;f.format=t.format,f.minimum=a,f.maximum=u,n&&(f.pattern=Z3)}),e._zod.check=o=>{const f=o.value;if(n){if(!Number.isInteger(f)){o.issues.push({expected:i,format:t.format,code:"invalid_type",input:f,inst:e});return}if(!Number.isSafeInteger(f)){f>0?o.issues.push({input:f,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}):o.issues.push({input:f,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort});return}}f<a&&o.issues.push({origin:"number",input:f,code:"too_small",minimum:a,inclusive:!0,inst:e,continue:!t.abort}),f>u&&o.issues.push({origin:"number",input:f,code:"too_big",maximum:u,inst:e})}}),rP=ye("$ZodCheckMaxLength",(e,t)=>{var n;Dr.init(e,t),(n=e._zod.def).when??(n.when=i=>{const a=i.value;return!Ib(a)&&a.length!==void 0}),e._zod.onattach.push(i=>{const a=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<a&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{const a=i.value;if(a.length<=t.maximum)return;const o=Mb(a);i.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),iP=ye("$ZodCheckMinLength",(e,t)=>{var n;Dr.init(e,t),(n=e._zod.def).when??(n.when=i=>{const a=i.value;return!Ib(a)&&a.length!==void 0}),e._zod.onattach.push(i=>{const a=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>a&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{const a=i.value;if(a.length>=t.minimum)return;const o=Mb(a);i.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),sP=ye("$ZodCheckLengthEquals",(e,t)=>{var n;Dr.init(e,t),(n=e._zod.def).when??(n.when=i=>{const a=i.value;return!Ib(a)&&a.length!==void 0}),e._zod.onattach.push(i=>{const a=i._zod.bag;a.minimum=t.length,a.maximum=t.length,a.length=t.length}),e._zod.check=i=>{const a=i.value,u=a.length;if(u===t.length)return;const o=Mb(a),f=u>t.length;i.issues.push({origin:o,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),dm=ye("$ZodCheckStringFormat",(e,t)=>{var n,i;Dr.init(e,t),e._zod.onattach.push(a=>{const u=a._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=a=>{t.pattern.lastIndex=0,!t.pattern.test(a.value)&&a.issues.push({origin:"string",code:"invalid_format",format:t.format,input:a.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),aP=ye("$ZodCheckRegex",(e,t)=>{dm.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),oP=ye("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=J3),dm.init(e,t)}),cP=ye("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=eP),dm.init(e,t)}),lP=ye("$ZodCheckIncludes",(e,t)=>{Dr.init(e,t);const n=Kd(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push(a=>{const u=a._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(i)}),e._zod.check=a=>{a.value.includes(t.includes,t.position)||a.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:a.value,inst:e,continue:!t.abort})}}),uP=ye("$ZodCheckStartsWith",(e,t)=>{Dr.init(e,t);const n=new RegExp(`^${Kd(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const a=i._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(n)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),dP=ye("$ZodCheckEndsWith",(e,t)=>{Dr.init(e,t);const n=new RegExp(`.*${Kd(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const a=i._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(n)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}}),fP=ye("$ZodCheckOverwrite",(e,t)=>{Dr.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class hP{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const i=t.split(`
260
+ `).filter(o=>o),a=Math.min(...i.map(o=>o.length-o.trimStart().length)),u=i.map(o=>o.slice(a)).map(o=>" ".repeat(this.indent*2)+o);for(const o of u)this.content.push(o)}compile(){const t=Function,n=this?.args,a=[...(this?.content??[""]).map(u=>` ${u}`)];return new t(...n,a.join(`
261
+ `))}}const mP={major:4,minor:0,patch:0},rn=ye("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=mP;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const a of i)for(const u of a._zod.onattach)u(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const a=(u,o,f)=>{let d=Sd(u),l;for(const h of o){if(h._zod.def.when){if(!h._zod.def.when(u))continue}else if(d)continue;const m=u.issues.length,g=h._zod.check(u);if(g instanceof Promise&&f?.async===!1)throw new Bd;if(l||g instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await g,u.issues.length!==m&&(d||(d=Sd(u,m)))});else{if(u.issues.length===m)continue;d||(d=Sd(u,m))}}return l?l.then(()=>u):u};e._zod.run=(u,o)=>{const f=e._zod.parse(u,o);if(f instanceof Promise){if(o.async===!1)throw new Bd;return f.then(d=>a(d,i,o))}return a(f,i,o)}}e["~standard"]={validate:a=>{try{const u=S3(e,a);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return C3(e,a).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}}),Pb=ye("$ZodString",(e,t)=>{rn.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??V3(e._zod.bag),e._zod.parse=(n,i)=>{if(t.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:e}),n}}),pn=ye("$ZodStringFormat",(e,t)=>{dm.init(e,t),Pb.init(e,t)}),pP=ye("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=P3),pn.init(e,t)}),gP=ye("$ZodUUID",(e,t)=>{if(t.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=E1(i))}else t.pattern??(t.pattern=E1());pn.init(e,t)}),bP=ye("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=D3),pn.init(e,t)}),_P=ye("$ZodURL",(e,t)=>{pn.init(e,t),e._zod.check=n=>{try{const i=n.value,a=new URL(i),u=a.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(a.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:$3.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),!i.endsWith("/")&&u.endsWith("/")?n.value=u.slice(0,-1):n.value=u;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),yP=ye("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=L3()),pn.init(e,t)}),EP=ye("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=k3),pn.init(e,t)}),vP=ye("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=x3),pn.init(e,t)}),TP=ye("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=w3),pn.init(e,t)}),AP=ye("$ZodULID",(e,t)=>{t.pattern??(t.pattern=R3),pn.init(e,t)}),OP=ye("$ZodXID",(e,t)=>{t.pattern??(t.pattern=N3),pn.init(e,t)}),SP=ye("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=I3),pn.init(e,t)}),CP=ye("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Y3(t)),pn.init(e,t)}),xP=ye("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=G3),pn.init(e,t)}),wP=ye("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=K3(t)),pn.init(e,t)}),RP=ye("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=M3),pn.init(e,t)}),NP=ye("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=H3),pn.init(e,t),e._zod.onattach.push(n=>{const i=n._zod.bag;i.format="ipv4"})}),IP=ye("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=B3),pn.init(e,t),e._zod.onattach.push(n=>{const i=n._zod.bag;i.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),kP=ye("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=U3),pn.init(e,t)}),MP=ye("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=F3),pn.init(e,t),e._zod.check=n=>{const[i,a]=n.value.split("/");try{if(!a)throw new Error;const u=Number(a);if(`${u}`!==a)throw new Error;if(u<0||u>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Ix(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const PP=ye("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=z3),pn.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{Ix(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function DP(e){if(!Sx.test(e))return!1;const t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Ix(n)}const jP=ye("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Sx),pn.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{DP(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),LP=ye("$ZodE164",(e,t)=>{t.pattern??(t.pattern=q3),pn.init(e,t)});function HP(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[i]=n;if(!i)return!1;const a=JSON.parse(atob(i));return!("typ"in a&&a?.typ!=="JWT"||!a.alg||t&&(!("alg"in a)||a.alg!==t))}catch{return!1}}const BP=ye("$ZodJWT",(e,t)=>{pn.init(e,t),e._zod.check=n=>{HP(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),kx=ye("$ZodNumber",(e,t)=>{rn.init(e,t),e._zod.pattern=e._zod.bag.pattern??W3,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const a=n.value;if(typeof a=="number"&&!Number.isNaN(a)&&Number.isFinite(a))return n;const u=typeof a=="number"?Number.isNaN(a)?"NaN":Number.isFinite(a)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:a,inst:e,...u?{received:u}:{}}),n}}),UP=ye("$ZodNumber",(e,t)=>{nP.init(e,t),kx.init(e,t)}),FP=ye("$ZodBoolean",(e,t)=>{rn.init(e,t),e._zod.pattern=X3,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=!!n.value}catch{}const a=n.value;return typeof a=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:a,inst:e}),n}}),zP=ye("$ZodNull",(e,t)=>{rn.init(e,t),e._zod.pattern=Q3,e._zod.values=new Set([null]),e._zod.parse=(n,i)=>{const a=n.value;return a===null||n.issues.push({expected:"null",code:"invalid_type",input:a,inst:e}),n}}),$P=ye("$ZodAny",(e,t)=>{rn.init(e,t),e._zod.parse=n=>n}),qP=ye("$ZodUnknown",(e,t)=>{rn.init(e,t),e._zod.parse=n=>n}),GP=ye("$ZodNever",(e,t)=>{rn.init(e,t),e._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function v1(e,t,n){e.issues.length&&t.issues.push(...to(n,e.issues)),t.value[n]=e.value}const KP=ye("$ZodArray",(e,t)=>{rn.init(e,t),e._zod.parse=(n,i)=>{const a=n.value;if(!Array.isArray(a))return n.issues.push({expected:"array",code:"invalid_type",input:a,inst:e}),n;n.value=Array(a.length);const u=[];for(let o=0;o<a.length;o++){const f=a[o],d=t.element._zod.run({value:f,issues:[]},i);d instanceof Promise?u.push(d.then(l=>v1(l,n,o))):v1(d,n,o)}return u.length?Promise.all(u).then(()=>n):n}});function xh(e,t,n){e.issues.length&&t.issues.push(...to(n,e.issues)),t.value[n]=e.value}function T1(e,t,n,i){e.issues.length?i[n]===void 0?n in i?t.value[n]=void 0:t.value[n]=e.value:t.issues.push(...to(n,e.issues)):e.value===void 0?n in i&&(t.value[n]=void 0):t.value[n]=e.value}const YP=ye("$ZodObject",(e,t)=>{rn.init(e,t);const n=Nb(()=>{const m=Object.keys(t.shape);for(const b of m)if(!(t.shape[b]instanceof rn))throw new Error(`Invalid element at key "${b}": expected a Zod schema`);const g=h3(t.shape);return{shape:t.shape,keys:m,keySet:new Set(m),numKeys:m.length,optionalKeys:new Set(g)}});un(e._zod,"propValues",()=>{const m=t.shape,g={};for(const b in m){const E=m[b]._zod;if(E.values){g[b]??(g[b]=new Set);for(const T of E.values)g[b].add(T)}}return g});const i=m=>{const g=new hP(["shape","payload","ctx"]),b=n.value,E=C=>{const x=Al(C);return`shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`};g.write("const input = payload.value;");const T=Object.create(null);let O=0;for(const C of b.keys)T[C]=`key_${O++}`;g.write("const newResult = {}");for(const C of b.keys)if(b.optionalKeys.has(C)){const x=T[C];g.write(`const ${x} = ${E(C)};`);const I=Al(C);g.write(`
262
+ if (${x}.issues.length) {
263
+ if (input[${I}] === undefined) {
264
+ if (${I} in input) {
265
+ newResult[${I}] = undefined;
266
+ }
267
+ } else {
268
+ payload.issues = payload.issues.concat(
269
+ ${x}.issues.map((iss) => ({
270
+ ...iss,
271
+ path: iss.path ? [${I}, ...iss.path] : [${I}],
272
+ }))
273
+ );
274
+ }
275
+ } else if (${x}.value === undefined) {
276
+ if (${I} in input) newResult[${I}] = undefined;
277
+ } else {
278
+ newResult[${I}] = ${x}.value;
279
+ }
280
+ `)}else{const x=T[C];g.write(`const ${x} = ${E(C)};`),g.write(`
281
+ if (${x}.issues.length) payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
282
+ ...iss,
283
+ path: iss.path ? [${Al(C)}, ...iss.path] : [${Al(C)}]
284
+ })));`),g.write(`newResult[${Al(C)}] = ${x}.value`)}g.write("payload.value = newResult;"),g.write("return payload;");const v=g.compile();return(C,x)=>v(m,C,x)};let a;const u=Zh,o=!_x.jitless,d=o&&d3.value,l=t.catchall;let h;e._zod.parse=(m,g)=>{h??(h=n.value);const b=m.value;if(!u(b))return m.issues.push({expected:"object",code:"invalid_type",input:b,inst:e}),m;const E=[];if(o&&d&&g?.async===!1&&g.jitless!==!0)a||(a=i(t.shape)),m=a(m,g);else{m.value={};const x=h.shape;for(const I of h.keys){const j=x[I],R=j._zod.run({value:b[I],issues:[]},g),k=j._zod.optin==="optional"&&j._zod.optout==="optional";R instanceof Promise?E.push(R.then(P=>k?T1(P,m,I,b):xh(P,m,I))):k?T1(R,m,I,b):xh(R,m,I)}}if(!l)return E.length?Promise.all(E).then(()=>m):m;const T=[],O=h.keySet,v=l._zod,C=v.def.type;for(const x of Object.keys(b)){if(O.has(x))continue;if(C==="never"){T.push(x);continue}const I=v.run({value:b[x],issues:[]},g);I instanceof Promise?E.push(I.then(j=>xh(j,m,x))):xh(I,m,x)}return T.length&&m.issues.push({code:"unrecognized_keys",keys:T,input:b,inst:e}),E.length?Promise.all(E).then(()=>m):m}});function A1(e,t,n,i){for(const a of e)if(a.issues.length===0)return t.value=a.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(a=>a.issues.map(u=>pa(u,i,ma())))}),t}const Mx=ye("$ZodUnion",(e,t)=>{rn.init(e,t),un(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),un(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),un(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),un(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){const n=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${n.map(i=>kb(i.source)).join("|")})$`)}}),e._zod.parse=(n,i)=>{let a=!1;const u=[];for(const o of t.options){const f=o._zod.run({value:n.value,issues:[]},i);if(f instanceof Promise)u.push(f),a=!0;else{if(f.issues.length===0)return f;u.push(f)}}return a?Promise.all(u).then(o=>A1(o,n,e,i)):A1(u,n,e,i)}}),VP=ye("$ZodDiscriminatedUnion",(e,t)=>{Mx.init(e,t);const n=e._zod.parse;un(e._zod,"propValues",()=>{const a={};for(const u of t.options){const o=u._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(const[f,d]of Object.entries(o)){a[f]||(a[f]=new Set);for(const l of d)a[f].add(l)}}return a});const i=Nb(()=>{const a=t.options,u=new Map;for(const o of a){const f=o._zod.propValues[t.discriminator];if(!f||f.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const d of f){if(u.has(d))throw new Error(`Duplicate discriminator value "${String(d)}"`);u.set(d,o)}}return u});e._zod.parse=(a,u)=>{const o=a.value;if(!Zh(o))return a.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),a;const f=i.value.get(o?.[t.discriminator]);return f?f._zod.run(a,u):t.unionFallback?n(a,u):(a.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:o,path:[t.discriminator],inst:e}),a)}}),ZP=ye("$ZodIntersection",(e,t)=>{rn.init(e,t),e._zod.parse=(n,i)=>{const a=n.value,u=t.left._zod.run({value:a,issues:[]},i),o=t.right._zod.run({value:a,issues:[]},i);return u instanceof Promise||o instanceof Promise?Promise.all([u,o]).then(([d,l])=>O1(n,d,l)):O1(n,u,o)}});function U0(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Wh(e)&&Wh(t)){const n=Object.keys(t),i=Object.keys(e).filter(u=>n.indexOf(u)!==-1),a={...e,...t};for(const u of i){const o=U0(e[u],t[u]);if(!o.valid)return{valid:!1,mergeErrorPath:[u,...o.mergeErrorPath]};a[u]=o.data}return{valid:!0,data:a}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let i=0;i<e.length;i++){const a=e[i],u=t[i],o=U0(a,u);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function O1(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Sd(e))return e;const i=U0(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const WP=ye("$ZodRecord",(e,t)=>{rn.init(e,t),e._zod.parse=(n,i)=>{const a=n.value;if(!Wh(a))return n.issues.push({expected:"record",code:"invalid_type",input:a,inst:e}),n;const u=[];if(t.keyType._zod.values){const o=t.keyType._zod.values;n.value={};for(const d of o)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){const l=t.valueType._zod.run({value:a[d],issues:[]},i);l instanceof Promise?u.push(l.then(h=>{h.issues.length&&n.issues.push(...to(d,h.issues)),n.value[d]=h.value})):(l.issues.length&&n.issues.push(...to(d,l.issues)),n.value[d]=l.value)}let f;for(const d in a)o.has(d)||(f=f??[],f.push(d));f&&f.length>0&&n.issues.push({code:"unrecognized_keys",input:a,inst:e,keys:f})}else{n.value={};for(const o of Reflect.ownKeys(a)){if(o==="__proto__")continue;const f=t.keyType._zod.run({value:o,issues:[]},i);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(f.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:f.issues.map(l=>pa(l,i,ma())),input:o,path:[o],inst:e}),n.value[f.value]=f.value;continue}const d=t.valueType._zod.run({value:a[o],issues:[]},i);d instanceof Promise?u.push(d.then(l=>{l.issues.length&&n.issues.push(...to(o,l.issues)),n.value[f.value]=l.value})):(d.issues.length&&n.issues.push(...to(o,d.issues)),n.value[f.value]=d.value)}}return u.length?Promise.all(u).then(()=>n):n}}),XP=ye("$ZodEnum",(e,t)=>{rn.init(e,t);const n=c3(t.entries);e._zod.values=new Set(n),e._zod.pattern=new RegExp(`^(${n.filter(i=>f3.has(typeof i)).map(i=>typeof i=="string"?Kd(i):i.toString()).join("|")})$`),e._zod.parse=(i,a)=>{const u=i.value;return e._zod.values.has(u)||i.issues.push({code:"invalid_value",values:n,input:u,inst:e}),i}}),QP=ye("$ZodLiteral",(e,t)=>{rn.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Kd(n):n?n.toString():String(n)).join("|")})$`),e._zod.parse=(n,i)=>{const a=n.value;return e._zod.values.has(a)||n.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),n}}),JP=ye("$ZodTransform",(e,t)=>{rn.init(e,t),e._zod.parse=(n,i)=>{const a=t.transform(n.value,n);if(i.async)return(a instanceof Promise?a:Promise.resolve(a)).then(o=>(n.value=o,n));if(a instanceof Promise)throw new Bd;return n.value=a,n}}),eD=ye("$ZodOptional",(e,t)=>{rn.init(e,t),e._zod.optin="optional",e._zod.optout="optional",un(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),un(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${kb(n.source)})?$`):void 0}),e._zod.parse=(n,i)=>t.innerType._zod.optin==="optional"?t.innerType._zod.run(n,i):n.value===void 0?n:t.innerType._zod.run(n,i)}),tD=ye("$ZodNullable",(e,t)=>{rn.init(e,t),un(e._zod,"optin",()=>t.innerType._zod.optin),un(e._zod,"optout",()=>t.innerType._zod.optout),un(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${kb(n.source)}|null)$`):void 0}),un(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,i)=>n.value===null?n:t.innerType._zod.run(n,i)}),nD=ye("$ZodDefault",(e,t)=>{rn.init(e,t),e._zod.optin="optional",un(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(n.value===void 0)return n.value=t.defaultValue,n;const a=t.innerType._zod.run(n,i);return a instanceof Promise?a.then(u=>S1(u,t)):S1(a,t)}});function S1(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const rD=ye("$ZodPrefault",(e,t)=>{rn.init(e,t),e._zod.optin="optional",un(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>(n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,i))}),iD=ye("$ZodNonOptional",(e,t)=>{rn.init(e,t),un(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(i=>i!==void 0)):void 0}),e._zod.parse=(n,i)=>{const a=t.innerType._zod.run(n,i);return a instanceof Promise?a.then(u=>C1(u,e)):C1(a,e)}});function C1(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const sD=ye("$ZodCatch",(e,t)=>{rn.init(e,t),e._zod.optin="optional",un(e._zod,"optout",()=>t.innerType._zod.optout),un(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{const a=t.innerType._zod.run(n,i);return a instanceof Promise?a.then(u=>(n.value=u.value,u.issues.length&&(n.value=t.catchValue({...n,error:{issues:u.issues.map(o=>pa(o,i,ma()))},input:n.value}),n.issues=[]),n)):(n.value=a.value,a.issues.length&&(n.value=t.catchValue({...n,error:{issues:a.issues.map(u=>pa(u,i,ma()))},input:n.value}),n.issues=[]),n)}}),aD=ye("$ZodPipe",(e,t)=>{rn.init(e,t),un(e._zod,"values",()=>t.in._zod.values),un(e._zod,"optin",()=>t.in._zod.optin),un(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(n,i)=>{const a=t.in._zod.run(n,i);return a instanceof Promise?a.then(u=>x1(u,t,i)):x1(a,t,i)}});function x1(e,t,n){return Sd(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}const oD=ye("$ZodReadonly",(e,t)=>{rn.init(e,t),un(e._zod,"propValues",()=>t.innerType._zod.propValues),un(e._zod,"values",()=>t.innerType._zod.values),un(e._zod,"optin",()=>t.innerType._zod.optin),un(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(n,i)=>{const a=t.innerType._zod.run(n,i);return a instanceof Promise?a.then(w1):w1(a)}});function w1(e){return e.value=Object.freeze(e.value),e}const cD=ye("$ZodCustom",(e,t)=>{Dr.init(e,t),rn.init(e,t),e._zod.parse=(n,i)=>n,e._zod.check=n=>{const i=n.value,a=t.fn(i);if(a instanceof Promise)return a.then(u=>R1(u,n,i,e));R1(a,n,i,e)}});function R1(e,t,n,i){if(!e){const a={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(a.params=i._zod.def.params),t.issues.push(Ud(a))}}class lD{constructor(){this._map=new Map,this._idmap=new Map}add(t,...n){const i=n[0];if(this._map.set(t,i),i&&typeof i=="object"&&"id"in i){if(this._idmap.has(i.id))throw new Error(`ID ${i.id} already exists in the registry`);this._idmap.set(i.id,t)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const i={...this.get(n)??{}};return delete i.id,{...i,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}}function uD(){return new lD}const wh=uD();function dD(e,t){return new e({type:"string",...Ve(t)})}function fD(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ve(t)})}function N1(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ve(t)})}function hD(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ve(t)})}function mD(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ve(t)})}function pD(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ve(t)})}function gD(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ve(t)})}function Px(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ve(t)})}function bD(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ve(t)})}function _D(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ve(t)})}function yD(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ve(t)})}function ED(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ve(t)})}function vD(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ve(t)})}function TD(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ve(t)})}function AD(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ve(t)})}function OD(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ve(t)})}function SD(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ve(t)})}function CD(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ve(t)})}function xD(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ve(t)})}function wD(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ve(t)})}function RD(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ve(t)})}function ND(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ve(t)})}function ID(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ve(t)})}function kD(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ve(t)})}function MD(e,t){return new e({type:"string",format:"date",check:"string_format",...Ve(t)})}function PD(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ve(t)})}function DD(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ve(t)})}function jD(e,t){return new e({type:"number",checks:[],...Ve(t)})}function LD(e,t){return new e({type:"number",coerce:!0,checks:[],...Ve(t)})}function HD(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ve(t)})}function BD(e,t){return new e({type:"boolean",...Ve(t)})}function UD(e,t){return new e({type:"null",...Ve(t)})}function FD(e){return new e({type:"any"})}function zD(e){return new e({type:"unknown"})}function $D(e,t){return new e({type:"never",...Ve(t)})}function I1(e,t){return new Rx({check:"less_than",...Ve(t),value:e,inclusive:!1})}function Fg(e,t){return new Rx({check:"less_than",...Ve(t),value:e,inclusive:!0})}function k1(e,t){return new Nx({check:"greater_than",...Ve(t),value:e,inclusive:!1})}function zg(e,t){return new Nx({check:"greater_than",...Ve(t),value:e,inclusive:!0})}function M1(e,t){return new tP({check:"multiple_of",...Ve(t),value:e})}function Dx(e,t){return new rP({check:"max_length",...Ve(t),maximum:e})}function Xh(e,t){return new iP({check:"min_length",...Ve(t),minimum:e})}function jx(e,t){return new sP({check:"length_equals",...Ve(t),length:e})}function qD(e,t){return new aP({check:"string_format",format:"regex",...Ve(t),pattern:e})}function GD(e){return new oP({check:"string_format",format:"lowercase",...Ve(e)})}function KD(e){return new cP({check:"string_format",format:"uppercase",...Ve(e)})}function YD(e,t){return new lP({check:"string_format",format:"includes",...Ve(t),includes:e})}function VD(e,t){return new uP({check:"string_format",format:"starts_with",...Ve(t),prefix:e})}function ZD(e,t){return new dP({check:"string_format",format:"ends_with",...Ve(t),suffix:e})}function Yd(e){return new fP({check:"overwrite",tx:e})}function WD(e){return Yd(t=>t.normalize(e))}function XD(){return Yd(e=>e.trim())}function QD(){return Yd(e=>e.toLowerCase())}function JD(){return Yd(e=>e.toUpperCase())}function ej(e,t,n){return new e({type:"array",element:t,...Ve(n)})}function tj(e,t,n){const i=Ve(n);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:t,...i})}function nj(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Ve(n)})}const rj=ye("ZodISODateTime",(e,t)=>{CP.init(e,t),vn.init(e,t)});function Lx(e){return kD(rj,e)}const ij=ye("ZodISODate",(e,t)=>{xP.init(e,t),vn.init(e,t)});function sj(e){return MD(ij,e)}const aj=ye("ZodISOTime",(e,t)=>{wP.init(e,t),vn.init(e,t)});function oj(e){return PD(aj,e)}const cj=ye("ZodISODuration",(e,t)=>{RP.init(e,t),vn.init(e,t)});function lj(e){return DD(cj,e)}const uj=(e,t)=>{vx.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>T3(e,n)},flatten:{value:n=>v3(e,n)},addIssue:{value:n=>e.issues.push(n)},addIssues:{value:n=>e.issues.push(...n)},isEmpty:{get(){return e.issues.length===0}}})},fm=ye("ZodError",uj,{Parent:Error}),dj=A3(fm),fj=O3(fm),hj=Ax(fm),mj=Ox(fm),gn=ye("ZodType",(e,t)=>(rn.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),e.clone=(n,i)=>so(e,n,i),e.brand=()=>e,e.register=((n,i)=>(n.add(e,i),e)),e.parse=(n,i)=>dj(e,n,i,{callee:e.parse}),e.safeParse=(n,i)=>hj(e,n,i),e.parseAsync=async(n,i)=>fj(e,n,i,{callee:e.parseAsync}),e.safeParseAsync=async(n,i)=>mj(e,n,i),e.spa=e.safeParseAsync,e.refine=(n,i)=>e.check(aL(n,i)),e.superRefine=n=>e.check(oL(n)),e.overwrite=n=>e.check(Yd(n)),e.optional=()=>xn(e),e.nullable=()=>j1(e),e.nullish=()=>xn(j1(e)),e.nonoptional=n=>Qj(e,n),e.array=()=>Le(e),e.or=n=>dn([e,n]),e.and=n=>jb(e,n),e.transform=n=>z0(e,qx(n)),e.default=n=>Zj(e,n),e.prefault=n=>Xj(e,n),e.catch=n=>eL(e,n),e.pipe=n=>z0(e,n),e.readonly=()=>rL(e),e.describe=n=>{const i=e.clone();return wh.add(i,{description:n}),i},Object.defineProperty(e,"description",{get(){return wh.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return wh.get(e);const i=e.clone();return wh.add(i,n[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Hx=ye("_ZodString",(e,t)=>{Pb.init(e,t),gn.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...i)=>e.check(qD(...i)),e.includes=(...i)=>e.check(YD(...i)),e.startsWith=(...i)=>e.check(VD(...i)),e.endsWith=(...i)=>e.check(ZD(...i)),e.min=(...i)=>e.check(Xh(...i)),e.max=(...i)=>e.check(Dx(...i)),e.length=(...i)=>e.check(jx(...i)),e.nonempty=(...i)=>e.check(Xh(1,...i)),e.lowercase=i=>e.check(GD(i)),e.uppercase=i=>e.check(KD(i)),e.trim=()=>e.check(XD()),e.normalize=(...i)=>e.check(WD(...i)),e.toLowerCase=()=>e.check(QD()),e.toUpperCase=()=>e.check(JD())}),pj=ye("ZodString",(e,t)=>{Pb.init(e,t),Hx.init(e,t),e.email=n=>e.check(fD(gj,n)),e.url=n=>e.check(Px(Bx,n)),e.jwt=n=>e.check(ID(kj,n)),e.emoji=n=>e.check(bD(_j,n)),e.guid=n=>e.check(N1(P1,n)),e.uuid=n=>e.check(hD(Rh,n)),e.uuidv4=n=>e.check(mD(Rh,n)),e.uuidv6=n=>e.check(pD(Rh,n)),e.uuidv7=n=>e.check(gD(Rh,n)),e.nanoid=n=>e.check(_D(yj,n)),e.guid=n=>e.check(N1(P1,n)),e.cuid=n=>e.check(yD(Ej,n)),e.cuid2=n=>e.check(ED(vj,n)),e.ulid=n=>e.check(vD(Tj,n)),e.base64=n=>e.check(wD(Rj,n)),e.base64url=n=>e.check(RD(Nj,n)),e.xid=n=>e.check(TD(Aj,n)),e.ksuid=n=>e.check(AD(Oj,n)),e.ipv4=n=>e.check(OD(Sj,n)),e.ipv6=n=>e.check(SD(Cj,n)),e.cidrv4=n=>e.check(CD(xj,n)),e.cidrv6=n=>e.check(xD(wj,n)),e.e164=n=>e.check(ND(Ij,n)),e.datetime=n=>e.check(Lx(n)),e.date=n=>e.check(sj(n)),e.time=n=>e.check(oj(n)),e.duration=n=>e.check(lj(n))});function te(e){return dD(pj,e)}const vn=ye("ZodStringFormat",(e,t)=>{pn.init(e,t),Hx.init(e,t)}),gj=ye("ZodEmail",(e,t)=>{bP.init(e,t),vn.init(e,t)}),P1=ye("ZodGUID",(e,t)=>{pP.init(e,t),vn.init(e,t)}),Rh=ye("ZodUUID",(e,t)=>{gP.init(e,t),vn.init(e,t)}),Bx=ye("ZodURL",(e,t)=>{_P.init(e,t),vn.init(e,t)});function bj(e){return Px(Bx,e)}const _j=ye("ZodEmoji",(e,t)=>{yP.init(e,t),vn.init(e,t)}),yj=ye("ZodNanoID",(e,t)=>{EP.init(e,t),vn.init(e,t)}),Ej=ye("ZodCUID",(e,t)=>{vP.init(e,t),vn.init(e,t)}),vj=ye("ZodCUID2",(e,t)=>{TP.init(e,t),vn.init(e,t)}),Tj=ye("ZodULID",(e,t)=>{AP.init(e,t),vn.init(e,t)}),Aj=ye("ZodXID",(e,t)=>{OP.init(e,t),vn.init(e,t)}),Oj=ye("ZodKSUID",(e,t)=>{SP.init(e,t),vn.init(e,t)}),Sj=ye("ZodIPv4",(e,t)=>{NP.init(e,t),vn.init(e,t)}),Cj=ye("ZodIPv6",(e,t)=>{IP.init(e,t),vn.init(e,t)}),xj=ye("ZodCIDRv4",(e,t)=>{kP.init(e,t),vn.init(e,t)}),wj=ye("ZodCIDRv6",(e,t)=>{MP.init(e,t),vn.init(e,t)}),Rj=ye("ZodBase64",(e,t)=>{PP.init(e,t),vn.init(e,t)}),Nj=ye("ZodBase64URL",(e,t)=>{jP.init(e,t),vn.init(e,t)}),Ij=ye("ZodE164",(e,t)=>{LP.init(e,t),vn.init(e,t)}),kj=ye("ZodJWT",(e,t)=>{BP.init(e,t),vn.init(e,t)}),Db=ye("ZodNumber",(e,t)=>{kx.init(e,t),gn.init(e,t),e.gt=(i,a)=>e.check(k1(i,a)),e.gte=(i,a)=>e.check(zg(i,a)),e.min=(i,a)=>e.check(zg(i,a)),e.lt=(i,a)=>e.check(I1(i,a)),e.lte=(i,a)=>e.check(Fg(i,a)),e.max=(i,a)=>e.check(Fg(i,a)),e.int=i=>e.check(D1(i)),e.safe=i=>e.check(D1(i)),e.positive=i=>e.check(k1(0,i)),e.nonnegative=i=>e.check(zg(0,i)),e.negative=i=>e.check(I1(0,i)),e.nonpositive=i=>e.check(Fg(0,i)),e.multipleOf=(i,a)=>e.check(M1(i,a)),e.step=(i,a)=>e.check(M1(i,a)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Ut(e){return jD(Db,e)}const Mj=ye("ZodNumberFormat",(e,t)=>{UP.init(e,t),Db.init(e,t)});function D1(e){return HD(Mj,e)}const Pj=ye("ZodBoolean",(e,t)=>{FP.init(e,t),gn.init(e,t)});function ln(e){return BD(Pj,e)}const Dj=ye("ZodNull",(e,t)=>{zP.init(e,t),gn.init(e,t)});function Ux(e){return UD(Dj,e)}const jj=ye("ZodAny",(e,t)=>{$P.init(e,t),gn.init(e,t)});function Lj(){return FD(jj)}const Hj=ye("ZodUnknown",(e,t)=>{qP.init(e,t),gn.init(e,t)});function yn(){return zD(Hj)}const Bj=ye("ZodNever",(e,t)=>{GP.init(e,t),gn.init(e,t)});function Uj(e){return $D(Bj,e)}const Fj=ye("ZodArray",(e,t)=>{KP.init(e,t),gn.init(e,t),e.element=t.element,e.min=(n,i)=>e.check(Xh(n,i)),e.nonempty=n=>e.check(Xh(1,n)),e.max=(n,i)=>e.check(Dx(n,i)),e.length=(n,i)=>e.check(jx(n,i)),e.unwrap=()=>e.element});function Le(e,t){return ej(Fj,e,t)}const Fx=ye("ZodObject",(e,t)=>{YP.init(e,t),gn.init(e,t),un(e,"shape",()=>t.shape),e.keyof=()=>ei(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:yn()}),e.loose=()=>e.clone({...e._zod.def,catchall:yn()}),e.strict=()=>e.clone({...e._zod.def,catchall:Uj()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>b3(e,n),e.merge=n=>_3(e,n),e.pick=n=>p3(e,n),e.omit=n=>g3(e,n),e.partial=(...n)=>y3(Gx,e,n[0]),e.required=(...n)=>E3(Kx,e,n[0])});function Be(e,t){const n={type:"object",get shape(){return um(this,"shape",{...e}),this.shape},...Ve(t)};return new Fx(n)}function tr(e,t){return new Fx({type:"object",get shape(){return um(this,"shape",{...e}),this.shape},catchall:yn(),...Ve(t)})}const zx=ye("ZodUnion",(e,t)=>{Mx.init(e,t),gn.init(e,t),e.options=t.options});function dn(e,t){return new zx({type:"union",options:e,...Ve(t)})}const zj=ye("ZodDiscriminatedUnion",(e,t)=>{zx.init(e,t),VP.init(e,t)});function $x(e,t,n){return new zj({type:"union",options:t,discriminator:e,...Ve(n)})}const $j=ye("ZodIntersection",(e,t)=>{ZP.init(e,t),gn.init(e,t)});function jb(e,t){return new $j({type:"intersection",left:e,right:t})}const qj=ye("ZodRecord",(e,t)=>{WP.init(e,t),gn.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function En(e,t,n){return new qj({type:"record",keyType:e,valueType:t,...Ve(n)})}const F0=ye("ZodEnum",(e,t)=>{XP.init(e,t),gn.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(i,a)=>{const u={};for(const o of i)if(n.has(o))u[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new F0({...t,checks:[],...Ve(a),entries:u})},e.exclude=(i,a)=>{const u={...t.entries};for(const o of i)if(n.has(o))delete u[o];else throw new Error(`Key ${o} not found in enum`);return new F0({...t,checks:[],...Ve(a),entries:u})}});function ei(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new F0({type:"enum",entries:n,...Ve(t)})}const Gj=ye("ZodLiteral",(e,t)=>{QP.init(e,t),gn.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Ze(e,t){return new Gj({type:"literal",values:Array.isArray(e)?e:[e],...Ve(t)})}const Kj=ye("ZodTransform",(e,t)=>{JP.init(e,t),gn.init(e,t),e._zod.parse=(n,i)=>{n.addIssue=u=>{if(typeof u=="string")n.issues.push(Ud(u,n.value,t));else{const o=u;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),o.continue??(o.continue=!0),n.issues.push(Ud(o))}};const a=t.transform(n.value,n);return a instanceof Promise?a.then(u=>(n.value=u,n)):(n.value=a,n)}});function qx(e){return new Kj({type:"transform",transform:e})}const Gx=ye("ZodOptional",(e,t)=>{eD.init(e,t),gn.init(e,t),e.unwrap=()=>e._zod.def.innerType});function xn(e){return new Gx({type:"optional",innerType:e})}const Yj=ye("ZodNullable",(e,t)=>{tD.init(e,t),gn.init(e,t),e.unwrap=()=>e._zod.def.innerType});function j1(e){return new Yj({type:"nullable",innerType:e})}const Vj=ye("ZodDefault",(e,t)=>{nD.init(e,t),gn.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Zj(e,t){return new Vj({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const Wj=ye("ZodPrefault",(e,t)=>{rD.init(e,t),gn.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Xj(e,t){return new Wj({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const Kx=ye("ZodNonOptional",(e,t)=>{iD.init(e,t),gn.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Qj(e,t){return new Kx({type:"nonoptional",innerType:e,...Ve(t)})}const Jj=ye("ZodCatch",(e,t)=>{sD.init(e,t),gn.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function eL(e,t){return new Jj({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const tL=ye("ZodPipe",(e,t)=>{aD.init(e,t),gn.init(e,t),e.in=t.in,e.out=t.out});function z0(e,t){return new tL({type:"pipe",in:e,out:t})}const nL=ye("ZodReadonly",(e,t)=>{oD.init(e,t),gn.init(e,t)});function rL(e){return new nL({type:"readonly",innerType:e})}const Yx=ye("ZodCustom",(e,t)=>{cD.init(e,t),gn.init(e,t)});function iL(e){const t=new Dr({check:"custom"});return t._zod.check=e,t}function sL(e,t){return tj(Yx,e??(()=>!0),t)}function aL(e,t={}){return nj(Yx,e,t)}function oL(e){const t=iL(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(Ud(i,n.value,t._zod.def));else{const a=i;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=!t._zod.def.abort),n.issues.push(Ud(a))}},e(n.value,n)));return t}function Vx(e,t){return z0(qx(e),t)}const cL={custom:"custom"};function lL(e){return LD(Db,e)}const uL="io.modelcontextprotocol/related-task",hm="2.0",nr=sL(e=>e!==null&&(typeof e=="object"||typeof e=="function")),Zx=dn([te(),Ut().int()]),Wx=te();tr({ttl:dn([Ut(),Ux()]).optional(),pollInterval:Ut().optional()});const dL=Be({ttl:Ut().optional()}),fL=Be({taskId:te()}),Lb=tr({progressToken:Zx.optional(),[uL]:fL.optional()}),ti=Be({_meta:Lb.optional()}),mm=ti.extend({task:dL.optional()}),rr=Be({method:te(),params:ti.loose().optional()}),yi=Be({_meta:Lb.optional()}),Ei=Be({method:te(),params:yi.loose().optional()}),ir=tr({_meta:Lb.optional()}),pm=dn([te(),Ut().int()]),hL=Be({jsonrpc:Ze(hm),id:pm,...rr.shape}).strict(),mL=Be({jsonrpc:Ze(hm),...Ei.shape}).strict(),Xx=Be({jsonrpc:Ze(hm),id:pm,result:ir}).strict();var L1;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(L1||(L1={}));const Qx=Be({jsonrpc:Ze(hm),id:pm.optional(),error:Be({code:Ut().int(),message:te(),data:yn().optional()})}).strict();dn([hL,mL,Xx,Qx]);dn([Xx,Qx]);const Jx=ir.strict(),pL=yi.extend({requestId:pm.optional(),reason:te().optional()}),ew=Ei.extend({method:Ze("notifications/cancelled"),params:pL}),gL=Be({src:te(),mimeType:te().optional(),sizes:Le(te()).optional(),theme:ei(["light","dark"]).optional()}),Vd=Be({icons:Le(gL).optional()}),hc=Be({name:te(),title:te().optional()}),tw=hc.extend({...hc.shape,...Vd.shape,version:te(),websiteUrl:te().optional(),description:te().optional()}),bL=jb(Be({applyDefaults:ln().optional()}),En(te(),yn())),_L=Vx(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,jb(Be({form:bL.optional(),url:nr.optional()}),En(te(),yn()).optional())),yL=tr({list:nr.optional(),cancel:nr.optional(),requests:tr({sampling:tr({createMessage:nr.optional()}).optional(),elicitation:tr({create:nr.optional()}).optional()}).optional()}),EL=tr({list:nr.optional(),cancel:nr.optional(),requests:tr({tools:tr({call:nr.optional()}).optional()}).optional()}),vL=Be({experimental:En(te(),nr).optional(),sampling:Be({context:nr.optional(),tools:nr.optional()}).optional(),elicitation:_L.optional(),roots:Be({listChanged:ln().optional()}).optional(),tasks:yL.optional()}),TL=ti.extend({protocolVersion:te(),capabilities:vL,clientInfo:tw}),AL=rr.extend({method:Ze("initialize"),params:TL}),OL=Be({experimental:En(te(),nr).optional(),logging:nr.optional(),completions:nr.optional(),prompts:Be({listChanged:ln().optional()}).optional(),resources:Be({subscribe:ln().optional(),listChanged:ln().optional()}).optional(),tools:Be({listChanged:ln().optional()}).optional(),tasks:EL.optional()}),SL=ir.extend({protocolVersion:te(),capabilities:OL,serverInfo:tw,instructions:te().optional()}),CL=Ei.extend({method:Ze("notifications/initialized"),params:yi.optional()}),nw=rr.extend({method:Ze("ping"),params:ti.optional()}),xL=Be({progress:Ut(),total:xn(Ut()),message:xn(te())}),wL=Be({...yi.shape,...xL.shape,progressToken:Zx}),rw=Ei.extend({method:Ze("notifications/progress"),params:wL}),RL=ti.extend({cursor:Wx.optional()}),Zd=rr.extend({params:RL.optional()}),Wd=ir.extend({nextCursor:Wx.optional()}),NL=ei(["working","input_required","completed","failed","cancelled"]),Xd=Be({taskId:te(),status:NL,ttl:dn([Ut(),Ux()]),createdAt:te(),lastUpdatedAt:te(),pollInterval:xn(Ut()),statusMessage:xn(te())}),iw=ir.extend({task:Xd}),IL=yi.merge(Xd),sw=Ei.extend({method:Ze("notifications/tasks/status"),params:IL}),aw=rr.extend({method:Ze("tasks/get"),params:ti.extend({taskId:te()})}),ow=ir.merge(Xd),cw=rr.extend({method:Ze("tasks/result"),params:ti.extend({taskId:te()})});ir.loose();const lw=Zd.extend({method:Ze("tasks/list")}),uw=Wd.extend({tasks:Le(Xd)}),dw=rr.extend({method:Ze("tasks/cancel"),params:ti.extend({taskId:te()})});ir.merge(Xd);const fw=Be({uri:te(),mimeType:xn(te()),_meta:En(te(),yn()).optional()}),hw=fw.extend({text:te()}),Hb=te().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),mw=fw.extend({blob:Hb}),Qd=ei(["user","assistant"]),_c=Be({audience:Le(Qd).optional(),priority:Ut().min(0).max(1).optional(),lastModified:Lx({offset:!0}).optional()}),pw=Be({...hc.shape,...Vd.shape,uri:te(),description:xn(te()),mimeType:xn(te()),annotations:_c.optional(),_meta:xn(tr({}))}),kL=Be({...hc.shape,...Vd.shape,uriTemplate:te(),description:xn(te()),mimeType:xn(te()),annotations:_c.optional(),_meta:xn(tr({}))}),ML=Zd.extend({method:Ze("resources/list")}),PL=Wd.extend({resources:Le(pw)}),DL=Zd.extend({method:Ze("resources/templates/list")}),jL=Wd.extend({resourceTemplates:Le(kL)}),Bb=ti.extend({uri:te()}),LL=Bb,HL=rr.extend({method:Ze("resources/read"),params:LL}),BL=ir.extend({contents:Le(dn([hw,mw]))}),UL=Ei.extend({method:Ze("notifications/resources/list_changed"),params:yi.optional()}),FL=Bb,zL=rr.extend({method:Ze("resources/subscribe"),params:FL}),$L=Bb,qL=rr.extend({method:Ze("resources/unsubscribe"),params:$L}),GL=yi.extend({uri:te()}),KL=Ei.extend({method:Ze("notifications/resources/updated"),params:GL}),YL=Be({name:te(),description:xn(te()),required:xn(ln())}),VL=Be({...hc.shape,...Vd.shape,description:xn(te()),arguments:xn(Le(YL)),_meta:xn(tr({}))}),ZL=Zd.extend({method:Ze("prompts/list")}),WL=Wd.extend({prompts:Le(VL)}),XL=ti.extend({name:te(),arguments:En(te(),te()).optional()}),QL=rr.extend({method:Ze("prompts/get"),params:XL}),Ub=Be({type:Ze("text"),text:te(),annotations:_c.optional(),_meta:En(te(),yn()).optional()}),Fb=Be({type:Ze("image"),data:Hb,mimeType:te(),annotations:_c.optional(),_meta:En(te(),yn()).optional()}),zb=Be({type:Ze("audio"),data:Hb,mimeType:te(),annotations:_c.optional(),_meta:En(te(),yn()).optional()}),JL=Be({type:Ze("tool_use"),name:te(),id:te(),input:En(te(),yn()),_meta:En(te(),yn()).optional()}),e6=Be({type:Ze("resource"),resource:dn([hw,mw]),annotations:_c.optional(),_meta:En(te(),yn()).optional()}),t6=pw.extend({type:Ze("resource_link")}),$b=dn([Ub,Fb,zb,t6,e6]),n6=Be({role:Qd,content:$b}),r6=ir.extend({description:te().optional(),messages:Le(n6)}),i6=Ei.extend({method:Ze("notifications/prompts/list_changed"),params:yi.optional()}),s6=Be({title:te().optional(),readOnlyHint:ln().optional(),destructiveHint:ln().optional(),idempotentHint:ln().optional(),openWorldHint:ln().optional()}),a6=Be({taskSupport:ei(["required","optional","forbidden"]).optional()}),gw=Be({...hc.shape,...Vd.shape,description:te().optional(),inputSchema:Be({type:Ze("object"),properties:En(te(),nr).optional(),required:Le(te()).optional()}).catchall(yn()),outputSchema:Be({type:Ze("object"),properties:En(te(),nr).optional(),required:Le(te()).optional()}).catchall(yn()).optional(),annotations:s6.optional(),execution:a6.optional(),_meta:En(te(),yn()).optional()}),o6=Zd.extend({method:Ze("tools/list")}),c6=Wd.extend({tools:Le(gw)}),bw=ir.extend({content:Le($b).default([]),structuredContent:En(te(),yn()).optional(),isError:ln().optional()});bw.or(ir.extend({toolResult:yn()}));const l6=mm.extend({name:te(),arguments:En(te(),yn()).optional()}),u6=rr.extend({method:Ze("tools/call"),params:l6}),d6=Ei.extend({method:Ze("notifications/tools/list_changed"),params:yi.optional()});Be({autoRefresh:ln().default(!0),debounceMs:Ut().int().nonnegative().default(300)});const _w=ei(["debug","info","notice","warning","error","critical","alert","emergency"]),f6=ti.extend({level:_w}),h6=rr.extend({method:Ze("logging/setLevel"),params:f6}),m6=yi.extend({level:_w,logger:te().optional(),data:yn()}),p6=Ei.extend({method:Ze("notifications/message"),params:m6}),g6=Be({name:te().optional()}),b6=Be({hints:Le(g6).optional(),costPriority:Ut().min(0).max(1).optional(),speedPriority:Ut().min(0).max(1).optional(),intelligencePriority:Ut().min(0).max(1).optional()}),_6=Be({mode:ei(["auto","required","none"]).optional()}),y6=Be({type:Ze("tool_result"),toolUseId:te().describe("The unique identifier for the corresponding tool call."),content:Le($b).default([]),structuredContent:Be({}).loose().optional(),isError:ln().optional(),_meta:En(te(),yn()).optional()}),E6=$x("type",[Ub,Fb,zb]),Qh=$x("type",[Ub,Fb,zb,JL,y6]),v6=Be({role:Qd,content:dn([Qh,Le(Qh)]),_meta:En(te(),yn()).optional()}),T6=mm.extend({messages:Le(v6),modelPreferences:b6.optional(),systemPrompt:te().optional(),includeContext:ei(["none","thisServer","allServers"]).optional(),temperature:Ut().optional(),maxTokens:Ut().int(),stopSequences:Le(te()).optional(),metadata:nr.optional(),tools:Le(gw).optional(),toolChoice:_6.optional()}),A6=rr.extend({method:Ze("sampling/createMessage"),params:T6}),O6=ir.extend({model:te(),stopReason:xn(ei(["endTurn","stopSequence","maxTokens"]).or(te())),role:Qd,content:E6}),S6=ir.extend({model:te(),stopReason:xn(ei(["endTurn","stopSequence","maxTokens","toolUse"]).or(te())),role:Qd,content:dn([Qh,Le(Qh)])}),C6=Be({type:Ze("boolean"),title:te().optional(),description:te().optional(),default:ln().optional()}),x6=Be({type:Ze("string"),title:te().optional(),description:te().optional(),minLength:Ut().optional(),maxLength:Ut().optional(),format:ei(["email","uri","date","date-time"]).optional(),default:te().optional()}),w6=Be({type:ei(["number","integer"]),title:te().optional(),description:te().optional(),minimum:Ut().optional(),maximum:Ut().optional(),default:Ut().optional()}),R6=Be({type:Ze("string"),title:te().optional(),description:te().optional(),enum:Le(te()),default:te().optional()}),N6=Be({type:Ze("string"),title:te().optional(),description:te().optional(),oneOf:Le(Be({const:te(),title:te()})),default:te().optional()}),I6=Be({type:Ze("string"),title:te().optional(),description:te().optional(),enum:Le(te()),enumNames:Le(te()).optional(),default:te().optional()}),k6=dn([R6,N6]),M6=Be({type:Ze("array"),title:te().optional(),description:te().optional(),minItems:Ut().optional(),maxItems:Ut().optional(),items:Be({type:Ze("string"),enum:Le(te())}),default:Le(te()).optional()}),P6=Be({type:Ze("array"),title:te().optional(),description:te().optional(),minItems:Ut().optional(),maxItems:Ut().optional(),items:Be({anyOf:Le(Be({const:te(),title:te()}))}),default:Le(te()).optional()}),D6=dn([M6,P6]),j6=dn([I6,k6,D6]),L6=dn([j6,C6,x6,w6]),H6=mm.extend({mode:Ze("form").optional(),message:te(),requestedSchema:Be({type:Ze("object"),properties:En(te(),L6),required:Le(te()).optional()})}),B6=mm.extend({mode:Ze("url"),message:te(),elicitationId:te(),url:te().url()}),U6=dn([H6,B6]),F6=rr.extend({method:Ze("elicitation/create"),params:U6}),z6=yi.extend({elicitationId:te()}),$6=Ei.extend({method:Ze("notifications/elicitation/complete"),params:z6}),q6=ir.extend({action:ei(["accept","decline","cancel"]),content:Vx(e=>e===null?void 0:e,En(te(),dn([te(),Ut(),ln(),Le(te())])).optional())}),G6=Be({type:Ze("ref/resource"),uri:te()}),K6=Be({type:Ze("ref/prompt"),name:te()}),Y6=ti.extend({ref:dn([K6,G6]),argument:Be({name:te(),value:te()}),context:Be({arguments:En(te(),te()).optional()}).optional()}),V6=rr.extend({method:Ze("completion/complete"),params:Y6}),Z6=ir.extend({completion:tr({values:Le(te()).max(100),total:xn(Ut().int()),hasMore:xn(ln())})}),W6=Be({uri:te().startsWith("file://"),name:te().optional(),_meta:En(te(),yn()).optional()}),X6=rr.extend({method:Ze("roots/list"),params:ti.optional()}),Q6=ir.extend({roots:Le(W6)}),J6=Ei.extend({method:Ze("notifications/roots/list_changed"),params:yi.optional()});dn([nw,AL,V6,h6,QL,ZL,ML,DL,HL,zL,qL,u6,o6,aw,cw,lw,dw]);dn([ew,rw,CL,J6,sw]);dn([Jx,O6,S6,q6,Q6,ow,uw,iw]);dn([nw,A6,F6,X6,aw,cw,lw,dw]);dn([ew,rw,p6,KL,UL,d6,i6,sw,$6]);dn([Jx,SL,Z6,r6,WL,PL,jL,BL,bw,c6,ow,uw,iw]);const er=bj().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:cL.custom,message:"URL must be parseable",fatal:!0}),o3}).refine(e=>{const t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"});tr({resource:te().url(),authorization_servers:Le(er).optional(),jwks_uri:te().url().optional(),scopes_supported:Le(te()).optional(),bearer_methods_supported:Le(te()).optional(),resource_signing_alg_values_supported:Le(te()).optional(),resource_name:te().optional(),resource_documentation:te().optional(),resource_policy_uri:te().url().optional(),resource_tos_uri:te().url().optional(),tls_client_certificate_bound_access_tokens:ln().optional(),authorization_details_types_supported:Le(te()).optional(),dpop_signing_alg_values_supported:Le(te()).optional(),dpop_bound_access_tokens_required:ln().optional()});const e4=tr({issuer:te(),authorization_endpoint:er,token_endpoint:er,registration_endpoint:er.optional(),scopes_supported:Le(te()).optional(),response_types_supported:Le(te()),response_modes_supported:Le(te()).optional(),grant_types_supported:Le(te()).optional(),token_endpoint_auth_methods_supported:Le(te()).optional(),token_endpoint_auth_signing_alg_values_supported:Le(te()).optional(),service_documentation:er.optional(),revocation_endpoint:er.optional(),revocation_endpoint_auth_methods_supported:Le(te()).optional(),revocation_endpoint_auth_signing_alg_values_supported:Le(te()).optional(),introspection_endpoint:te().optional(),introspection_endpoint_auth_methods_supported:Le(te()).optional(),introspection_endpoint_auth_signing_alg_values_supported:Le(te()).optional(),code_challenge_methods_supported:Le(te()).optional(),client_id_metadata_document_supported:ln().optional()}),t4=tr({issuer:te(),authorization_endpoint:er,token_endpoint:er,userinfo_endpoint:er.optional(),jwks_uri:er,registration_endpoint:er.optional(),scopes_supported:Le(te()).optional(),response_types_supported:Le(te()),response_modes_supported:Le(te()).optional(),grant_types_supported:Le(te()).optional(),acr_values_supported:Le(te()).optional(),subject_types_supported:Le(te()),id_token_signing_alg_values_supported:Le(te()),id_token_encryption_alg_values_supported:Le(te()).optional(),id_token_encryption_enc_values_supported:Le(te()).optional(),userinfo_signing_alg_values_supported:Le(te()).optional(),userinfo_encryption_alg_values_supported:Le(te()).optional(),userinfo_encryption_enc_values_supported:Le(te()).optional(),request_object_signing_alg_values_supported:Le(te()).optional(),request_object_encryption_alg_values_supported:Le(te()).optional(),request_object_encryption_enc_values_supported:Le(te()).optional(),token_endpoint_auth_methods_supported:Le(te()).optional(),token_endpoint_auth_signing_alg_values_supported:Le(te()).optional(),display_values_supported:Le(te()).optional(),claim_types_supported:Le(te()).optional(),claims_supported:Le(te()).optional(),service_documentation:te().optional(),claims_locales_supported:Le(te()).optional(),ui_locales_supported:Le(te()).optional(),claims_parameter_supported:ln().optional(),request_parameter_supported:ln().optional(),request_uri_parameter_supported:ln().optional(),require_request_uri_registration:ln().optional(),op_policy_uri:er.optional(),op_tos_uri:er.optional(),client_id_metadata_document_supported:ln().optional()});Be({...t4.shape,...e4.pick({code_challenge_methods_supported:!0}).shape});Be({access_token:te(),id_token:te().optional(),token_type:te(),expires_in:lL().optional(),scope:te().optional(),refresh_token:te().optional()}).strip();Be({error:te(),error_description:te().optional(),error_uri:te().optional()});const H1=er.optional().or(Ze("").transform(()=>{})),n4=Be({redirect_uris:Le(er),token_endpoint_auth_method:te().optional(),grant_types:Le(te()).optional(),response_types:Le(te()).optional(),client_name:te().optional(),client_uri:er.optional(),logo_uri:H1,scope:te().optional(),contacts:Le(te()).optional(),tos_uri:H1,policy_uri:te().optional(),jwks_uri:er.optional(),jwks:Lj().optional(),software_id:te().optional(),software_version:te().optional(),software_statement:te().optional()}).strip(),r4=Be({client_id:te(),client_secret:te().optional(),client_id_issued_at:Ut().optional(),client_secret_expires_at:Ut().optional()}).strip();n4.merge(r4);Be({error:te(),error_description:te().optional()}).strip();Be({token:te(),token_type_hint:te().optional()}).strip();class sr extends Error{constructor(t,n){super(t),this.errorUri=n,this.name=this.constructor.name}toResponseObject(){const t={error:this.errorCode,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}get errorCode(){return this.constructor.errorCode}}class i4 extends sr{}i4.errorCode="invalid_request";class s4 extends sr{}s4.errorCode="invalid_client";class a4 extends sr{}a4.errorCode="invalid_grant";class o4 extends sr{}o4.errorCode="unauthorized_client";class c4 extends sr{}c4.errorCode="unsupported_grant_type";class l4 extends sr{}l4.errorCode="invalid_scope";class u4 extends sr{}u4.errorCode="access_denied";class d4 extends sr{}d4.errorCode="server_error";class f4 extends sr{}f4.errorCode="temporarily_unavailable";class h4 extends sr{}h4.errorCode="unsupported_response_type";class m4 extends sr{}m4.errorCode="unsupported_token_type";class p4 extends sr{}p4.errorCode="invalid_token";class g4 extends sr{}g4.errorCode="method_not_allowed";class b4 extends sr{}b4.errorCode="too_many_requests";class _4 extends sr{}_4.errorCode="invalid_client_metadata";class y4 extends sr{}y4.errorCode="insufficient_scope";class E4 extends sr{}E4.errorCode="invalid_target";class B1 extends Error{constructor(t){super(t??"Unauthorized")}}function yc(){const[e,t]=J.useState(!1),n=Ue(o=>o.updateServer),i=Ue(o=>o.setTools),a=J.useCallback(async(o,f,d,l)=>{t(!0);try{if(console.log(`🔌 Attempting to connect to ${o.name}...`,{hasAuth:!!o.auth,authType:o.auth?.type,hasAuthCode:!!f,suppressErrorToast:l}),!await lc.connect(o,f,d))return console.log(`🔐 OAuth redirect initiated for ${o.name}`),!1;n(o.id,{connected:!0,error:void 0,lastConnected:new Date});const m=await lc.listTools(o.id);i(o.id,m);try{const g=await Rb(o.id);g&&n(o.id,{metadata:g})}catch(g){console.warn("Failed to fetch server metadata:",g)}return console.log(`✓ Successfully connected to ${o.name}`),!0}catch(h){console.error("Connection error:",h),console.error("Error type:",h?.constructor?.name);const m=h instanceof Error?h.message:String(h);if(m.includes("OAuth authorization required")||m.includes("Redirecting to authorization"))return console.log("🔐 OAuth redirect is happening - not showing as error"),n(o.id,{connected:!1,error:void 0}),!1;if(h instanceof B1)return console.log("🔐 UnauthorizedError caught - OAuth redirect should be happening..."),n(o.id,{connected:!1,error:void 0}),!1;if(h&&typeof h=="object"&&"name"in h&&h.name==="UnauthorizedError")return console.log("🔐 UnauthorizedError detected by name - OAuth redirect should be happening..."),n(o.id,{connected:!1,error:void 0}),!1;let g=h instanceof Error?h.message:"Connection failed";return(g.includes("Failed to fetch")||g.includes("CORS"))&&(g="CORS Error: Server does not allow browser connections. See CORS.md for solutions."),(g.includes("401")||g.includes("Unauthorized"))&&(o.auth?.type==="oauth"&&!f?g="OAuth required but authorization redirect did not occur. Check server OAuth configuration.":o.auth?.type!=="oauth"&&(g.includes("invalid_token")||g.includes("Bearer")?g=`âš ī¸ This server requires OAuth authentication.
285
+
286
+ To fix:
287
+ 1. Open the server menu (⋮)
288
+ 2. Click "Edit Server"
289
+ 3. Set Authentication to "OAuth"
290
+ 4. Save and connect again`:g="Authentication required (401). Please configure authentication for this server.")),console.error(`❌ Connection to ${o.name} failed:`,g),n(o.id,{connected:!1,error:g}),!(g.includes("OAuth authorization required")||g.includes("Redirecting to authorization")||g.includes("Code verifier")||g.includes("PKCE")||!!f||h instanceof B1)&&!l?gi.error(`Failed to connect to ${o.name}`,g):l&&console.log(`🔇 Error toast suppressed during auto-reconnect for ${o.name}`),!1}finally{t(!1)}},[n,i]),u=J.useCallback(async o=>{await lc.disconnect(o),n(o,{connected:!1})},[n]);return{connect:a,disconnect:u,isConnecting:e}}function v4(){const[e,t]=J.useState(!1),n=Ue(a=>a.addToHistory);return{execute:J.useCallback(async(a,u,o)=>{t(!0);const f=performance.now();try{const d=await lc.executeTool(a,u,o),h={success:!0,time:Math.round(performance.now()-f),data:d,timestamp:new Date};return n({serverId:a,toolName:u,input:o,result:h}),h}catch(d){const l=Math.round(performance.now()-f);console.error("Tool execution error:",{serverId:a,toolName:u,args:o,error:d,errorMessage:d instanceof Error?d.message:String(d),errorStack:d instanceof Error?d.stack:void 0});const h=d instanceof Error?d.message:"Execution failed",m={success:!1,time:l,error:h,timestamp:new Date};return n({serverId:a,toolName:u,input:o,result:m}),gi.error(`Failed to execute ${u}`,h),m}finally{t(!1)}},[n]),isExecuting:e}}const Bt=Cn.forwardRef(({variant:e="primary",size:t="md",className:n="",type:i="button",children:a,...u},o)=>{const f=`btn-${e}`,d=`btn-${t}`;return _.jsx("button",{ref:o,type:i,className:`btn ${f} ${d} ${n}`.trim(),...u,children:a})});Bt.displayName="Button";const It=Cn.forwardRef(({label:e,error:t,helperText:n,className:i="",id:a,...u},o)=>{const f=a||(typeof e=="string"?e.toLowerCase().replace(/\s+/g,"-"):void 0);return _.jsxs("div",{className:"input-wrapper",children:[e&&_.jsxs("label",{htmlFor:f,className:"input-label",children:[e,u.required&&_.jsx("span",{className:"input-required",children:"*"})]}),_.jsx("input",{ref:o,id:f,className:`input ${t?"input-error":""} ${i}`.trim(),...u}),t&&_.jsx("span",{className:"input-error-text",children:t}),n&&!t&&_.jsx("span",{className:"input-helper-text",children:n})]})});It.displayName="Input";const yw=Cn.forwardRef(({label:e,error:t,helperText:n,showToggle:i=!0,className:a="",id:u,...o},f)=>{const[d,l]=J.useState(!1),h=u||(typeof e=="string"?e.toLowerCase().replace(/\s+/g,"-"):void 0);return _.jsxs("div",{className:"api-key-input-wrapper",children:[e&&_.jsxs("label",{htmlFor:h,className:"api-key-input-label",children:[e,o.required&&_.jsx("span",{className:"api-key-input-required",children:"*"})]}),_.jsxs("div",{className:"api-key-input-container",children:[_.jsx("input",{ref:f,id:h,type:d?"text":"password",className:`api-key-input ${t?"api-key-input-error":""} ${a}`.trim(),autoComplete:"off",...o}),i&&_.jsx("button",{type:"button",className:"api-key-toggle-button",onClick:()=>l(!d),"aria-label":d?"Hide API key":"Show API key",tabIndex:-1,children:d?_.jsx(TM,{size:16}):_.jsx(OM,{size:16})})]}),t&&_.jsx("span",{className:"api-key-input-error-text",children:t}),n&&!t&&_.jsx("span",{className:"api-key-input-helper-text",children:n})]})});yw.displayName="APIKeyInput";const Ew=Cn.forwardRef(({label:e,error:t,helperText:n,className:i="",id:a,...u},o)=>{const f=a||(typeof e=="string"?e.toLowerCase().replace(/\s+/g,"-"):void 0);return _.jsxs("div",{className:"textarea-wrapper",children:[e&&_.jsxs("label",{htmlFor:f,className:"textarea-label",children:[e,u.required&&_.jsx("span",{className:"textarea-required",children:"*"})]}),_.jsx("textarea",{ref:o,id:f,className:`textarea ${t?"textarea-error":""} ${i}`.trim(),...u}),t&&_.jsx("span",{className:"textarea-error-text",children:t}),n&&!t&&_.jsx("span",{className:"textarea-helper-text",children:n})]})});Ew.displayName="Textarea";const T4=Cn.forwardRef(({label:e,error:t,helperText:n,options:i,placeholder:a,className:u="",id:o,...f},d)=>{const l=o||(typeof e=="string"?e.toLowerCase().replace(/\s+/g,"-"):void 0);return _.jsxs("div",{className:"select-wrapper",children:[e&&_.jsxs("label",{htmlFor:l,className:"select-label",children:[e,f.required&&_.jsx("span",{className:"select-required",children:"*"})]}),_.jsxs("select",{ref:d,id:l,className:`select ${t?"select-error":""} ${u}`.trim(),...f,children:[a&&_.jsx("option",{value:"",disabled:!0,children:a}),i.map(h=>_.jsx("option",{value:h.value,disabled:h.disabled,children:h.label},h.value))]}),t&&_.jsx("span",{className:"select-error-text",children:t}),n&&!t&&_.jsx("span",{className:"select-helper-text",children:n})]})});T4.displayName="Select";const qb=Cn.forwardRef(({label:e,helperText:t,className:n="",id:i,...a},u)=>{const o=i||(typeof e=="string"?e.toLowerCase().replace(/\s+/g,"-"):void 0);return _.jsxs("div",{className:"checkbox-wrapper",children:[_.jsxs("div",{className:"checkbox-container",children:[_.jsx("input",{ref:u,type:"checkbox",id:o,className:`checkbox ${n}`.trim(),...a}),e&&_.jsx("label",{htmlFor:o,className:"checkbox-label",children:e})]}),t&&_.jsx("span",{className:"checkbox-helper-text",children:t})]})});qb.displayName="Checkbox";const ga=Cn.forwardRef(({label:e,options:t,value:n,onChange:i,helperText:a,error:u,disabled:o=!1,className:f=""},d)=>_.jsxs("div",{ref:d,className:`toggle-group-wrapper ${f}`,children:[e&&_.jsx("label",{className:"toggle-group-label",children:e}),_.jsx("div",{className:"toggle-group",role:"group",children:t.map(l=>{const h=n===l.value,m=o||l.disabled;return _.jsx("button",{type:"button",className:`toggle-option ${h?"toggle-option-selected":""}`,onClick:()=>!m&&i(l.value),disabled:m,"aria-pressed":h,children:l.label},l.value)})}),a&&!u&&_.jsx("div",{className:"toggle-group-helper",children:a}),u&&_.jsx("div",{className:"toggle-group-error",children:u})]}));ga.displayName="ToggleGroup";const $0=Cn.forwardRef(({label:e,helperText:t,className:n="",id:i,...a},u)=>{const o=i||(typeof e=="string"?e.toLowerCase().replace(/\s+/g,"-"):void 0);return _.jsxs("div",{className:"switch-wrapper",children:[_.jsxs("div",{className:"switch-container",children:[_.jsx("input",{ref:u,type:"checkbox",id:o,className:`switch ${n}`.trim(),role:"switch",...a}),_.jsx("label",{htmlFor:o,className:"switch-slider"}),e&&_.jsx("label",{htmlFor:o,className:"switch-label",children:e})]}),t&&_.jsx("span",{className:"switch-helper-text",children:t})]})});$0.displayName="Switch";const A4=Cn.forwardRef(({variant:e="default",size:t="md",className:n="",children:i,...a},u)=>{const o=`badge-${e}`,f=`badge-${t}`;return _.jsx("span",{ref:u,className:`badge ${o} ${f} ${n}`.trim(),...a,children:i})});A4.displayName="Badge";const O4=Cn.forwardRef(({variant:e="default",padding:t="md",className:n="",children:i,...a},u)=>{const o=`card-${e}`,f=`card-padding-${t}`;return _.jsx("div",{ref:u,className:`card ${o} ${f} ${n}`.trim(),...a,children:i})});O4.displayName="Card";const S4=Cn.forwardRef(({className:e="",children:t,...n},i)=>_.jsx("div",{ref:i,className:`card-header ${e}`.trim(),...n,children:t}));S4.displayName="CardHeader";const C4=Cn.forwardRef(({className:e="",children:t,...n},i)=>_.jsx("h3",{ref:i,className:`card-title ${e}`.trim(),...n,children:t}));C4.displayName="CardTitle";const x4=Cn.forwardRef(({className:e="",children:t,...n},i)=>_.jsx("p",{ref:i,className:`card-description ${e}`.trim(),...n,children:t}));x4.displayName="CardDescription";const w4=Cn.forwardRef(({className:e="",children:t,...n},i)=>_.jsx("div",{ref:i,className:`card-content ${e}`.trim(),...n,children:t}));w4.displayName="CardContent";const R4=Cn.forwardRef(({className:e="",children:t,...n},i)=>_.jsx("div",{ref:i,className:`card-footer ${e}`.trim(),...n,children:t}));R4.displayName="CardFooter";const Gb=Cn.forwardRef(({size:e="md",variant:t="primary",className:n="",...i},a)=>{const u=`spinner-${e}`,o=`spinner-${t}`;return _.jsx("div",{ref:a,className:`spinner ${u} ${o} ${n}`.trim(),role:"status","aria-label":"Loading",...i,children:_.jsx("span",{className:"spinner-sr-only",children:"Loading..."})})});Gb.displayName="Spinner";const vw=Cn.forwardRef(({tabs:e,defaultValue:t,value:n,onChange:i,className:a="",children:u},o)=>{const[f,d]=J.useState(t||e[0]?.value||""),l=n!==void 0,h=l?n:f,m=g=>{l||d(g),i?.(g)};return _.jsxs("div",{ref:o,className:`tabs-wrapper ${a}`,children:[_.jsx("div",{className:"tabs-list",role:"tablist",children:e.map(g=>{const b=h===g.value,E=g.disabled;return _.jsxs("button",{type:"button",role:"tab","aria-selected":b,"aria-disabled":E,className:`tab ${b?"tab-active":""}`,onClick:()=>!E&&m(g.value),disabled:E,children:[g.icon&&_.jsx("span",{className:"tab-icon",children:g.icon}),_.jsx("span",{className:"tab-label",children:g.label})]},g.value)})}),_.jsx("div",{className:"tabs-content",children:u?.(h)})]})});vw.displayName="Tabs";const Ec=J.memo(function({icon:t,title:n,description:i,action:a}){return _.jsxs("div",{className:"empty-state",children:[t&&_.jsx("div",{className:"empty-state-icon",children:t}),_.jsx("h3",{className:"empty-state-title",children:n}),_.jsx("p",{className:"empty-state-description",children:i}),a&&_.jsx(Bt,{variant:"primary",onClick:a.onClick,children:a.label})]})}),N4=J.memo(function({onAddServer:t}){return _.jsxs("div",{className:"no-servers-container",children:[_.jsx(Ec,{icon:_.jsx(fc,{size:48}),title:"No servers yet",description:"Add your first MCP server to get started testing tools and capabilities.",action:{label:"Add Server",onClick:t}}),_.jsxs("div",{className:"quick-servers-section",children:[_.jsx("p",{className:"quick-servers-text",children:"Try these popular servers (no auth needed)"}),_.jsxs("div",{className:"quick-servers-list",children:[_.jsxs("a",{href:"/?s=Cloudflare%20Docs:https://docs.mcp.cloudflare.com/mcp",className:"quick-server-pill",title:"Add Cloudflare Docs",children:[_.jsx("span",{className:"quick-server-icon-fallback",children:"📘"}),"Cloudflare Docs"]}),_.jsxs("a",{href:"/?s=Exa:https://mcp.exa.ai/mcp",className:"quick-server-pill",title:"Add Exa",children:[_.jsx("span",{className:"quick-server-icon-fallback",children:"🔍"}),"Exa"]}),_.jsxs("a",{href:"/?s=DeepWiki:https://mcp.deepwiki.com/mcp",className:"quick-server-pill",title:"Add DeepWiki",children:[_.jsx("span",{className:"quick-server-icon-fallback",children:"📚"}),"DeepWiki"]}),_.jsxs("a",{href:"/?s=CoinGecko:https://mcp.api.coingecko.com/mcp",className:"quick-server-pill",title:"Add CoinGecko",children:[_.jsx("span",{className:"quick-server-icon-fallback",children:"đŸĒ™"}),"CoinGecko"]})]})]})]})}),I4=J.memo(function(){return _.jsx(Ec,{icon:_.jsx(lm,{size:48}),title:"No tools available",description:"This server doesn't expose any tools, or hasn't been connected yet."})});J.memo(function(){return _.jsx(Ec,{icon:_.jsx(pM,{size:48}),title:"No execution history",description:"Tool execution history will appear here once you start testing."})});J.memo(function({error:t,onRetry:n}){return _.jsx(Ec,{icon:_.jsx(Tb,{size:48}),title:"Connection failed",description:t,action:n?{label:"Retry Connection",onClick:n}:void 0})});var Kb=ax();const k4=J.memo(function({title:t,message:n,confirmText:i="Confirm",cancelText:a="Cancel",onConfirm:u,onCancel:o,danger:f=!1}){return J.useEffect(()=>{const d=l=>{l.key==="Enter"?(l.preventDefault(),u()):l.key==="Escape"&&(l.preventDefault(),o())};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[u,o]),Kb.createPortal(_.jsx("div",{className:"modal-overlay",onClick:o,children:_.jsxs("div",{className:"modal modal-small",onClick:d=>d.stopPropagation(),children:[_.jsx("div",{className:"modal-header",children:_.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},children:[_.jsx("span",{style:{fontSize:"24px",filter:"drop-shadow(0 2px 8px rgba(92, 207, 230, 0.3))"},children:"đŸĻ‰"}),_.jsx("h2",{style:{margin:0,fontSize:"20px"},children:t})]})}),_.jsx("div",{className:"modal-body",children:_.jsx("p",{style:{lineHeight:1.6},children:n})}),_.jsxs("div",{className:"modal-footer",children:[_.jsx(Bt,{variant:"secondary",onClick:o,children:a}),_.jsx(Bt,{variant:f?"danger":"primary",onClick:u,children:i})]})]})}),document.body)});function Tw(e){const t=J.useCallback(n=>{const i=n.target,a=i.tagName==="INPUT"||i.tagName==="TEXTAREA"||i.isContentEditable;for(const u of e){const o=n.key.toLowerCase()===u.key.toLowerCase();if(!o)continue;const f=u.ctrl?n.ctrlKey||n.metaKey:!n.ctrlKey&&!n.metaKey,d=u.shift?n.shiftKey:!n.shiftKey,l=u.alt?n.altKey:!n.altKey,h=u.meta?n.metaKey:!0;if(o&&f&&d&&l&&h){if(a&&!u.preventDefault)continue;u.preventDefault!==!1&&n.preventDefault(),u.handler(n);break}}},[e]);J.useEffect(()=>(window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)),[t])}function Aw(e){const t=navigator.platform.toLowerCase().includes("mac"),n=[];if(e.ctrl&&n.push(t?"⌘":"Ctrl"),e.shift&&n.push(t?"⇧":"Shift"),e.alt&&n.push(t?"âŒĨ":"Alt"),e.key){const i=e.key.length===1?e.key.toUpperCase():e.key;n.push(i)}return t?n.join(""):n.join("+")}function Jd(e,t){return`${e} (${Aw(t)})`}const M4=J.memo(function({onAddServer:t,onEditServer:n}){return _.jsxs("div",{className:"server-sidebar",children:[_.jsx("div",{className:"sidebar-actions",children:_.jsxs("button",{type:"button",className:"add-server-btn",onClick:t,title:Jd("Add new server",{key:"a"}),children:[_.jsx("span",{className:"btn-icon",children:"+"}),_.jsx("span",{children:"Add Server"}),_.jsx("kbd",{className:"btn-shortcut-hint",children:"A"})]})}),_.jsx("div",{className:"nav-hint",children:_.jsxs("div",{className:"nav-hint-keys",children:[_.jsx("kbd",{children:"j"}),_.jsx("kbd",{children:"k"})]})}),_.jsx(P4,{onAddServer:t,onEditServer:n})]})});function P4({onAddServer:e,onEditServer:t}){const n=Ue(o=>o.servers),i=Ue(o=>o.selectedServerId),a=Ue(o=>o.setSelectedServer),u=o=>{a(o)};return n.length===0?_.jsx(N4,{onAddServer:e}):_.jsx("div",{className:"servers-list",children:n.map(o=>{const f=n.filter(d=>d.name===o.name).length>1;return _.jsx(D4,{server:o,isSelected:i===o.id,hasDuplicateName:f,onClick:()=>u(o.id),onEditServer:t},o.id)})})}const D4=J.memo(function({server:t,isSelected:n,hasDuplicateName:i,onClick:a,onEditServer:u}){const o=Ue(N=>N.tools[t.id]),f=Ue(N=>N.removeServer),d=Ue(N=>N.updateServer),l=Ue(N=>N.setTools),h=Ue(N=>N.faviconCache),m=Ue(N=>N.setFaviconUrl),{connect:g,disconnect:b}=yc(),[E,T]=J.useState(!1),[O,v]=J.useState(!1),[C,x]=J.useState(!1),I=J.useRef(null),j=t.url||"",R=h[j],P=(()=>{if(t.metadata?.icons&&t.metadata.icons.length>0){const N=t.metadata.icons.find(q=>q.mimeType?.includes("png")||q.mimeType?.includes("jpeg"));if(N)return N.src;const M=t.metadata.icons.find(q=>q.mimeType?.includes("svg"));return M?M.src:t.metadata.icons[0].src}return t.auth?.oauthServerMetadata?.logo_uri?t.auth.oauthServerMetadata.logo_uri:R||null})();J.useEffect(()=>{if(t.metadata?.icons&&t.metadata.icons.length>0||t.auth?.oauthServerMetadata?.logo_uri||!t.url||R!==void 0)return;const N=t.auth?.oauthServerMetadata?.logo_uri;Hd(t.url,N).then(M=>{m(t.url||"",M)}).catch(M=>{console.warn(`Failed to fetch favicon for ${t.name}:`,M),m(t.url||"",null)})},[t.url,t.name,t.metadata?.icons,t.auth?.oauthServerMetadata?.logo_uri,R,m]),J.useEffect(()=>{t.connected&&t.auth?.type==="oauth"&&!t.auth?.oauthServerMetadata&&bx(t.id).then(N=>{N?.logo_uri&&t.auth&&d(t.id,{auth:{...t.auth,oauthServerMetadata:N}})}).catch(N=>{N&&!N.message?.includes("404")&&console.warn("Failed to fetch OAuth metadata:",N)})},[t.connected,t.id,t.auth?.type,t.auth?.oauthServerMetadata,d]),J.useEffect(()=>{const N=M=>{I.current&&!I.current.contains(M.target)&&T(!1)};if(E)return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[E]);const z=()=>{const N={http:"🌐",sse:"⚡",stdio:"đŸ’ģ"};return _.jsxs("span",{className:"transport-badge","data-transport":t.transport,children:[N[t.transport]," ",t.transport.toUpperCase()]})},L=()=>{if(!t.auth||t.auth.type==="none")return null;const N=t.auth.type,M={headers:"API Key",oauth:"OAuth",oauth_client_credentials:"OAuth Client"},q={headers:"🔑",oauth:"🔐",oauth_client_credentials:"🔐"};return _.jsxs("span",{className:"auth-badge","data-auth-type":N,children:[q[N]||"🔑"," ",M[N]||"Auth"]})},G=N=>{N.stopPropagation(),T(!E)},F=async N=>{if(N.stopPropagation(),T(!1),!!t.connected){v(!0),gi.info(`Refreshing ${t.name}...`,void 0,1500);try{const{mcpClient:M}=await D0(async()=>{const{mcpClient:D}=await Promise.resolve().then(()=>a3);return{mcpClient:D}},void 0),q=await M.listTools(t.id);l(t.id,q),console.log(`✓ Refreshed tools for ${t.name} - ${q.length} tools`)}catch(M){console.error("Failed to refresh tools:",M);const q=M instanceof Error?M.message:"Unknown error";gi.error(`Failed to refresh ${t.name}`,q)}finally{v(!1)}}},K=async N=>{if(N.stopPropagation(),T(!1),!t.auth)return;const M=t.auth.type;if(M==="oauth"||M==="oauth_client_credentials"){try{await B0(t.id),console.log(`🔐 Cleared OAuth credentials from backend for ${t.name}`)}catch(q){console.error("Failed to clear OAuth tokens from backend:",q)}localStorage.removeItem(`oauth_tokens_${t.id}`),localStorage.removeItem(`oauth_client_${t.id}`),sessionStorage.removeItem(`oauth_verifier_${t.id}`)}t.connected&&await b(t.id),M==="oauth"?d(t.id,{auth:{type:"oauth"}}):M==="oauth_client_credentials"?d(t.id,{auth:{type:"oauth_client_credentials"}}):M==="headers"?d(t.id,{auth:{type:"headers"}}):d(t.id,{auth:void 0})},B=async N=>{if(N.stopPropagation(),T(!1),!t.auth)return;const M=t.auth.type;if(t.connected&&await b(t.id),M==="oauth"||M==="oauth_client_credentials"){try{await B0(t.id),console.log(`🔐 Cleared OAuth tokens from backend for re-authentication: ${t.name}`)}catch(q){console.error("Failed to clear OAuth tokens from backend:",q)}localStorage.removeItem(`oauth_tokens_${t.id}`),sessionStorage.removeItem(`oauth_verifier_${t.id}`),M==="oauth"?(sessionStorage.setItem("oauth_server_id",t.id),console.log("🔐 Starting re-authentication OAuth flow...")):console.log("🔐 Starting re-authentication for client credentials...")}else M==="headers"&&console.log("🔐 Re-authentication for header-based auth (will prompt for new headers on next connect)...");await g(t)},Z=async N=>{N.stopPropagation(),T(!1),t.auth?.type==="oauth"&&(localStorage.removeItem(`oauth_tokens_${t.id}`),sessionStorage.removeItem(`oauth_verifier_${t.id}`),sessionStorage.removeItem("oauth_last_redirect"),sessionStorage.setItem("oauth_server_id",t.id),console.log("🔐 Starting fresh OAuth flow...")),await g(t)},U=N=>{N.stopPropagation(),T(!1),u(t)},Y=async N=>{N.stopPropagation(),T(!1),t.connected&&await b(t.id)},W=N=>{N.stopPropagation(),T(!1),x(!0)},pe=async()=>{t.connected&&await b(t.id),f(t.id),x(!1)};return _.jsxs("div",{className:`server-item ${n?"active":""}`,"data-server-id":t.id,onClick:a,children:[_.jsxs("div",{className:"server-header",children:[P?_.jsxs("div",{className:"server-favicon-container",children:[_.jsx("img",{src:P,alt:`${t.name} icon`,className:"server-favicon"}),_.jsx("div",{className:`favicon-status-dot ${t.connected?"connected":"disconnected"}`,title:t.error||(t.connected?"Connected":"Disconnected")})]}):_.jsx("div",{className:`status-dot ${t.connected?"connected":"disconnected"}`,title:t.error||(t.connected?"Connected":"Disconnected")}),_.jsx("span",{className:"server-name",children:t.name}),i&&_.jsx("span",{className:"server-duplicate-hint",title:t.url||t.command,children:t.url?new URL(t.url).hostname:"stdio"}),t.metadata?.instructions&&_.jsx("span",{className:"server-instructions-icon",title:`Server Instructions:
291
+
292
+ ${t.metadata.instructions}`,children:_.jsx(oc,{size:12})}),_.jsx("span",{className:"tool-count",children:o?.length||0})]}),_.jsxs("div",{className:"server-footer",children:[_.jsxs("div",{className:"server-meta",children:[z(),L()]}),_.jsxs("div",{className:"server-actions",ref:I,children:[_.jsx("button",{type:"button",className:"action-btn menu-btn",onClick:G,title:"Server actions",children:_.jsx(yM,{size:14})}),E&&_.jsxs("div",{className:"dropdown-menu",children:[t.connected?_.jsxs("button",{type:"button",className:"dropdown-item",onClick:F,disabled:O,children:[_.jsx(jd,{size:14,className:O?"spinning":""}),_.jsx("span",{children:"Refresh Tools"})]}):_.jsxs("button",{type:"button",className:"dropdown-item",onClick:Z,children:[_.jsx(jd,{size:14}),_.jsx("span",{children:"Connect"})]}),t.auth&&t.auth.type!=="none"&&_.jsxs(_.Fragment,{children:[_.jsxs("button",{type:"button",className:"dropdown-item",onClick:B,disabled:!t.connected,children:[_.jsx(Dd,{size:14}),_.jsx("span",{children:"Re-authenticate"})]}),_.jsxs("button",{type:"button",className:"dropdown-item",onClick:K,children:[_.jsx(p1,{size:14}),_.jsx("span",{children:"Clear Auth"})]})]}),t.connected&&_.jsxs("button",{type:"button",className:"dropdown-item",onClick:Y,children:[_.jsx(p1,{size:14}),_.jsx("span",{children:"Disconnect"})]}),_.jsx("div",{className:"dropdown-divider"}),_.jsxs("button",{type:"button",className:"dropdown-item",onClick:U,children:[_.jsx(Ob,{size:14}),_.jsx("span",{children:"Edit Server"})]}),_.jsxs("button",{type:"button",className:"dropdown-item danger",onClick:W,children:[_.jsx(cx,{size:14}),_.jsx("span",{children:"Delete Server"})]})]})]})]}),C&&_.jsx(k4,{title:"Delete Server",message:`Delete "${t.name}"? This will remove all cached tools and disconnect the server.`,confirmText:"Delete",cancelText:"Cancel",onConfirm:pe,onCancel:()=>x(!1),danger:!0})]})});function j4(e){return encodeURIComponent(e.replace(/:/g,"%3A"))}function L4(e,t){if(!e||!t)throw new Error("Server name and URL are required");return`${j4(e)}:${t}`}let $g=null;function Ow(){const e=J.useCallback(()=>{const a=new URLSearchParams(window.location.search),u={server:a.get("s")||a.get("server"),tool:a.get("tool"),search:a.get("search"),args:a.get("args"),view:a.get("view"),execution:a.get("execution")};return console.log("🔍 readURL called:",{fullURL:window.location.href,search:window.location.search,parsedState:u}),u},[]),t=J.useCallback((a,u=!0,o=!1)=>{console.log("📝 updateURL called:",{updates:a,currentURL:window.location.href,stack:new Error().stack?.split(`
293
+ `).slice(2,5).join(`
294
+ `)});const f=()=>{const d=new URL(window.location.href),l=d.searchParams;Object.entries(a).forEach(([m,g])=>{g==null||g===""?m==="server"?(l.delete("s"),l.delete("server")):l.delete(m):m==="server"?(l.set("s",g),l.delete("server")):l.set(m,g)});const h=`${d.pathname}${l.toString()?"?"+l.toString():""}${d.hash}`;console.log("📝 Updating URL to:",h),u?window.history.replaceState({},"",h):window.history.pushState({},"",h)};o?($g&&clearTimeout($g),$g=setTimeout(f,300)):f()},[]),n=J.useCallback(a=>{const u={};a.forEach(o=>{u[o]=null}),t(u,!0)},[t]),i=J.useCallback(()=>{const a=new URL(window.location.href);window.history.replaceState({},"",a.pathname+a.hash)},[]);return{readURL:e,updateURL:t,clearURLParams:n,clearAllParams:i}}const H4=J.memo(function(){const t=Ue(O=>O.selectedServerId),n=Ue(O=>O.tools),i=Ue(O=>O.selectedToolName),a=Ue(O=>O.setSelectedTool),u=Ue(O=>O.searchQuery),o=Ue(O=>O.setSearchQuery),f=Ue(O=>O.executingTools),{updateURL:d}=Ow(),l=Od(O=>O.getToolParameters),h=J.useRef(null),m=J.useCallback(O=>{a(O),d({tool:O})},[a,d]),g=J.useCallback(O=>{o(O),d({search:O||null},!0)},[o,d]),b=J.useCallback(O=>{O.key==="Escape"&&O.currentTarget.blur()},[]),E=J.useMemo(()=>t?n[t]||[]:[],[t,n]),T=J.useMemo(()=>u?E.filter(O=>O.name.toLowerCase().includes(u.toLowerCase())||O.description.toLowerCase().includes(u.toLowerCase())):E,[E,u]);return t?E.length===0?_.jsx("div",{className:"tools-sidebar",children:_.jsx(I4,{})}):_.jsxs("div",{className:"tools-sidebar",children:[_.jsxs("div",{className:"tools-search",children:[_.jsx("input",{ref:h,type:"text",className:"search-box",placeholder:`Search ${E.length} tools...`,value:u,onChange:O=>g(O.target.value),onKeyDown:b,title:Jd("Search tools",{key:"/"})}),_.jsx("kbd",{className:"search-shortcut-hint",children:"/"})]}),_.jsx("div",{className:"nav-hint",children:_.jsxs("div",{className:"nav-hint-keys",children:[_.jsx("kbd",{children:"↑"}),_.jsx("kbd",{children:"↓"})]})}),_.jsx("div",{className:"tools-list",children:T.length===0?_.jsx("div",{className:"no-results",children:_.jsxs("p",{children:['No tools match "',u,'"']})}):T.map(O=>{const v=t?l(t,O.name):void 0,C=t?`${t}:${O.name}`:O.name,x=f.includes(C),I=O.icons&&O.icons.length>0?O.icons.find(R=>R.mimeType?.includes("png")||R.mimeType?.includes("jpeg"))?.src||O.icons.find(R=>R.mimeType?.includes("svg"))?.src||O.icons[0].src:null,j=O.annotations?.title||O.title||O.name;return _.jsxs("div",{"data-tool-name":O.name,className:`tool-item ${i===O.name?"active":""} ${x?"executing":""}`,onClick:()=>m(O.name),children:[_.jsxs("div",{className:"tool-name",children:[x&&_.jsx("span",{className:"tool-pulse"}),I&&_.jsx("img",{src:I,alt:"",className:"tool-icon"}),j,v&&_.jsx("span",{className:"tool-has-params-dot",title:"Has saved parameters"})]}),_.jsx("div",{className:"tool-description",children:O.description})]},O.name)})})]}):_.jsx("div",{className:"tools-sidebar",children:_.jsx(Ec,{icon:_.jsx(fc,{size:48}),title:"No server selected",description:"Select a server from the left to view its tools."})})}),Sw="hoot-";function B4(e,t){try{const n=localStorage.getItem(`${Sw}${e}`);if(n===null)return t;try{return JSON.parse(n)}catch{return n}}catch(n){return console.warn(`Failed to read preference "${e}":`,n),t}}function U4(e,t){try{const n=typeof t=="string"?t:JSON.stringify(t);localStorage.setItem(`${Sw}${e}`,n)}catch(n){console.error(`Failed to save preference "${e}":`,n)}}function F4(){const[e,t]=J.useState(()=>B4("input-mode","form")),n=i=>{t(i),U4("input-mode",i)};return J.useEffect(()=>{const i=a=>{if(a.key==="hoot-input-mode"&&a.newValue)try{const u=JSON.parse(a.newValue);t(u)}catch{}};return window.addEventListener("storage",i),()=>window.removeEventListener("storage",i)},[]),{inputMode:e,setInputMode:n}}const z4=J.memo(function({content:t,label:n="Copy",size:i="md"}){const[a,u]=J.useState(!1),o=async()=>{try{await navigator.clipboard.writeText(t),u(!0),setTimeout(()=>{u(!1)},2e3)}catch(f){console.error("Failed to copy:",f),gi.error("Failed to copy","Clipboard access denied")}};return _.jsxs("button",{type:"button",className:`copy-btn copy-btn-${i}`,onClick:o,title:n,"aria-label":n,children:[a?_.jsx(yd,{size:i==="sm"?14:16}):_.jsx(vd,{size:i==="sm"?14:16}),i==="md"&&_.jsx("span",{children:a?"Copied!":"Copy"})]})});function q0(e){let t=e.trim(),n=0;const i=5;for(;n<i;)try{const a=JSON.parse(t);if(typeof a=="string"&&(a.startsWith("{")||a.startsWith("["))){t=a,n++;continue}return a}catch{return t}return t}function $4(e){if(Array.isArray(e)){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&"type"in e[0]&&e[0].type==="text"&&"text"in e[0]){const t=e[0].text,n=q0(t);return n}if(e.length>0&&e.every(t=>typeof t=="object"&&t!==null&&"type"in t&&"text"in t)){const t=e.map(n=>{const i=n.text;return q0(i)});return t.length===1?t[0]:t}}return e}function G0({value:e,indent:t}){const[n,i]=J.useState(!1),a=" ".repeat(t);if(e===null)return _.jsx("span",{className:"json-null",children:"null"});if(typeof e=="boolean")return _.jsx("span",{className:"json-boolean",children:String(e)});if(typeof e=="number")return _.jsx("span",{className:"json-number",children:String(e)});if(typeof e=="string")return _.jsxs("span",{className:"json-string",children:['"',e,'"']});if(Array.isArray(e))return e.length===0?_.jsx("span",{className:"json-bracket",children:"[]"}):_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"json-collapse-toggle",onClick:()=>i(!n),title:n?"Expand":"Collapse",children:n?_.jsx(Vh,{size:12}):_.jsx(j0,{size:12})}),_.jsx("span",{className:"json-bracket",children:"["}),!n&&_.jsxs(_.Fragment,{children:[_.jsx("span",{children:`
295
+ `}),e.map((u,o)=>_.jsxs("span",{children:[_.jsxs("span",{children:[a," "]}),_.jsx(G0,{value:u,indent:t+1}),o<e.length-1&&_.jsx("span",{className:"json-punctuation",children:","}),_.jsx("span",{children:`
296
+ `})]},o)),_.jsx("span",{children:a})]}),n&&_.jsx("span",{className:"json-ellipsis",children:"..."}),_.jsx("span",{className:"json-bracket",children:"]"})]});if(typeof e=="object"){const u=Object.entries(e);return u.length===0?_.jsx("span",{className:"json-bracket",children:"{}"}):_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"json-collapse-toggle",onClick:()=>i(!n),title:n?"Expand":"Collapse",children:n?_.jsx(Vh,{size:12}):_.jsx(j0,{size:12})}),_.jsx("span",{className:"json-bracket",children:"{"}),!n&&_.jsxs(_.Fragment,{children:[_.jsx("span",{children:`
297
+ `}),u.map(([o,f],d)=>_.jsxs("span",{children:[_.jsxs("span",{children:[a," "]}),_.jsxs("span",{className:"json-key",children:['"',o,'"']}),_.jsx("span",{className:"json-punctuation",children:": "}),_.jsx(G0,{value:f,indent:t+1}),d<u.length-1&&_.jsx("span",{className:"json-punctuation",children:","}),_.jsx("span",{children:`
298
+ `})]},o)),_.jsx("span",{children:a})]}),n&&_.jsx("span",{className:"json-ellipsis",children:"..."}),_.jsx("span",{className:"json-bracket",children:"}"})]})}return _.jsx("span",{children:String(e)})}const Td=J.memo(function({content:t,className:n="",preserveQuotes:i=!1}){const a=J.useMemo(()=>{let u=q0(t);if(u=$4(u),typeof u=="string"){let o=u;return!i&&o.startsWith('"')&&o.endsWith('"')&&o.length>1&&(o=o.slice(1,-1)),_.jsx("span",{children:o})}return _.jsx(G0,{value:u,indent:0})},[t,i]);return _.jsx("pre",{className:`json-viewer ${n}`,children:a})});function q4(e){const t=[];let n=0;const i=[{regex:/"[^"\\]*(?:\\.[^"\\]*)*"(?=\s*:)/g,className:"json-key"},{regex:/"[^"\\]*(?:\\.[^"\\]*)*"/g,className:"json-string"},{regex:/\b(-?\d+\.?\d*([eE][+-]?\d+)?)\b/g,className:"json-number"},{regex:/\b(true|false)\b/g,className:"json-boolean"},{regex:/\bnull\b/g,className:"json-null"},{regex:/[{}[\]]/g,className:"json-bracket"},{regex:/[:,]/g,className:"json-punctuation"}];let a=0;const u=[];i.forEach(d=>{const l=new RegExp(d.regex.source,"g");let h;for(;(h=l.exec(e))!==null;)u.push({start:h.index,end:h.index+h[0].length,className:d.className})}),u.sort((d,l)=>d.start-l.start);const o=[];let f=-1;return u.forEach(d=>{d.start>=f&&(o.push(d),f=d.end)}),o.forEach(d=>{a<d.start&&t.push(_.jsx("span",{children:e.slice(a,d.start)},n++)),t.push(_.jsx("span",{className:d.className,children:e.slice(d.start,d.end)},n++)),a=d.end}),a<e.length&&t.push(_.jsx("span",{children:e.slice(a)},n++)),t}const G4=J.memo(function({value:t,onChange:n,placeholder:i,className:a=""}){const u=J.useRef(null),o=J.useRef(null),[f,d]=J.useState(0),[l,h]=J.useState(0),m=()=>{u.current&&(d(u.current.scrollTop),h(u.current.scrollLeft))};J.useEffect(()=>{o.current&&(o.current.scrollTop=f,o.current.scrollLeft=l)},[f,l]);const g=t?q4(t):null;return _.jsxs("div",{className:`json-editor-wrapper ${a}`,children:[_.jsx("div",{ref:o,className:"json-editor-highlight","aria-hidden":"true",children:_.jsx("pre",{children:g})}),_.jsx("textarea",{ref:u,className:"json-editor-input",value:t,onChange:b=>n(b.target.value),onScroll:m,placeholder:i,spellCheck:!1})]})}),kr=new Map,K4=J.memo(function(){const t=Ue(o=>o.selectedServerId),n=Ue(o=>o.selectedToolName),i=Ue(o=>o.tools),u=J.useMemo(()=>t?i[t]||[]:[],[t,i]).find(o=>o.name===n);return u?_.jsx(V4,{tool:u,serverId:t}):_.jsx(Y4,{})});function Y4(){return _.jsx("div",{className:"main-area",children:_.jsx(Ec,{icon:_.jsx(lm,{size:48}),title:"No tool selected",description:"Select a tool from the sidebar to test its functionality and view results."})})}function V4({tool:e,serverId:t}){const{inputMode:n,setInputMode:i}=F4(),a=Ue(K=>K.setToolExecuting),u=`${t}:${e.name}`;kr.has(u)||kr.set(u,{result:null,resultTab:"response",elapsedTime:0,isExecuting:!1,abortController:null});const[,o]=J.useState({}),f=kr.get(u),d=J.useCallback(K=>{const B={...kr.get(u),...K};kr.set(u,B),o({})},[u]),[l,h]=J.useState(!1),[m,g]=J.useState(!0),b=J.useRef(null),{execute:E}=v4(),T=Od(K=>K.getToolParameters),O=Od(K=>K.saveToolParameters),v=Od(K=>K.recordToolExecution);J.useEffect(()=>{b.current&&e.description?requestAnimationFrame(()=>{if(b.current){const K=b.current.scrollHeight>b.current.clientHeight;g(K)}}):g(!1)},[e.description]);const C=J.useMemo(()=>{const K=e.inputSchema.properties||{},B={};return Object.entries(K).forEach(([Z,U])=>{U.default!==void 0?B[Z]=U.default:U.type==="string"?B[Z]="":U.type==="number"||U.type==="integer"?B[Z]=void 0:U.type==="boolean"?B[Z]=!1:U.type==="array"?B[Z]=[]:U.type==="object"&&(B[Z]={})}),B},[e.inputSchema]),x=J.useMemo(()=>{const K=T(t,e.name);return K?{...C,...K}:C},[t,e.name,C,T]),[I,j]=J.useState(x),[R,k]=J.useState(""),[P,z]=J.useState("");J.useEffect(()=>{const K=T(t,e.name),B=K?{...C,...K}:C;j(B),k(""),z(""),h(!1),o({})},[e.name,t,u,C,T,o]),J.useEffect(()=>{if(Object.entries(I).some(([,B])=>!(B==null||B===""||typeof B=="boolean"&&B===!1||Array.isArray(B)&&B.length===0||typeof B=="object"&&!Array.isArray(B)&&Object.keys(B).length===0))){const B=setTimeout(()=>{O(t,e.name,I)},500);return()=>clearTimeout(B)}},[I,t,e.name,O]),J.useEffect(()=>{n==="json"&&k(JSON.stringify(I,null,2))},[n,I]);const L=K=>{k(K),z("");try{const B=JSON.parse(K);j(B)}catch(B){z(B instanceof Error?B.message:"Invalid JSON")}},G=J.useCallback(async()=>{try{if(n==="json"&&P){d({result:{success:!1,time:0,error:`Invalid JSON: ${P}`,timestamp:new Date},isExecuting:!1});return}const K=Object.fromEntries(Object.entries(I).filter(([N,M])=>M!==void 0)),B=new AbortController,Z=u,U=t,Y=e.name;kr.set(Z,{...kr.get(Z),elapsedTime:0,isExecuting:!0,abortController:B,result:null}),o({}),a(U,Y,!0);const W=Date.now(),pe=setInterval(()=>{const N=kr.get(Z);N&&N.isExecuting&&(kr.set(Z,{...N,elapsedTime:Date.now()-W}),u===Z&&o({}))},10);try{const N=await E(U,Y,K);B.signal.aborted||(kr.set(Z,{...kr.get(Z),result:N,isExecuting:!1,abortController:null}),u===Z&&o({}),N.success&&v(U,Y))}catch(N){const M={success:!1,time:Date.now()-W,error:N instanceof Error?N.message:"Execution failed",timestamp:new Date};kr.set(Z,{...kr.get(Z),result:M,isExecuting:!1,abortController:null}),u===Z&&o({})}finally{clearInterval(pe),a(U,Y,!1)}}catch(K){console.error("Execution error:",K),d({result:{success:!1,time:0,error:K instanceof Error?K.message:"Execution failed",timestamp:new Date},isExecuting:!1,abortController:null}),a(t,e.name,!1)}},[n,P,I,u,t,e.name,E,a,v,d,o]),F=J.useCallback(()=>{const K=kr.get(u);K.abortController&&(K.abortController.abort(),d({result:{success:!1,time:K.elapsedTime,error:"Execution cancelled by user",timestamp:new Date},isExecuting:!1,abortController:null}),a(t,e.name,!1))},[u,t,e.name,a,d]);return Tw([{key:"Enter",ctrl:!0,description:"Execute tool",handler:()=>{f.isExecuting||G()},preventDefault:!0},{key:"m",description:"Toggle Form/JSON input mode",handler:()=>{i(n==="form"?"json":"form")}}]),_.jsxs("div",{className:"main-area",children:[_.jsxs("div",{className:"main-header",children:[_.jsxs("div",{className:"main-header-title",children:[e.icons&&e.icons.length>0&&_.jsx("img",{src:e.icons.find(K=>K.mimeType?.includes("png")||K.mimeType?.includes("jpeg"))?.src||e.icons.find(K=>K.mimeType?.includes("svg"))?.src||e.icons[0].src,alt:"",className:"tool-header-icon"}),_.jsx("h2",{children:e.annotations?.title||e.title||e.name})]}),_.jsxs("div",{className:"description-container",children:[_.jsx("p",{ref:b,className:`main-tool-description ${!l&&m?"collapsed":""}`,children:e.description}),m&&_.jsx("button",{type:"button",className:"description-toggle",onClick:()=>h(!l),children:l?"Show less":"+ Show more"})]})]}),_.jsxs("div",{className:"content-area",children:[_.jsxs("section",{className:"input-section",children:[_.jsx("div",{className:"section-title",children:"Input Parameters"}),_.jsxs("div",{className:"input-form-container",children:[_.jsx(ga,{value:n,onChange:K=>i(K),options:[{value:"form",label:"Form"},{value:"json",label:"JSON"}]}),n==="form"?_.jsx(Z4,{schema:e.inputSchema,values:I,onChange:j}):_.jsxs(_.Fragment,{children:[_.jsx(G4,{value:R,onChange:L,placeholder:"Enter JSON input..."}),P&&_.jsxs("div",{className:"json-error",children:["âš ī¸ JSON Error: ",P]})]}),_.jsx("button",{type:"button",className:`execute-btn ${f.isExecuting?"executing":""}`,onClick:f.isExecuting?F:G,title:f.isExecuting?"Click to cancel execution":Jd("Execute tool",{key:"Enter",ctrl:!0}),children:f.isExecuting?_.jsxs(_.Fragment,{children:[_.jsx("span",{children:"Executing"}),_.jsxs("span",{className:"execute-timer",children:[f.elapsedTime,"ms"]}),_.jsx("span",{className:"execute-cancel-hint",children:"(click to cancel)"})]}):_.jsxs(_.Fragment,{children:["Execute Tool",_.jsx("kbd",{className:"execute-btn-shortcut",children:"⌘â†ĩ"})]})})]})]}),f.result&&_.jsx(W4,{result:f.result,resultTab:f.resultTab,setResultTab:K=>d({resultTab:K}),toolName:e.name,input:I})]})]})}const Z4=J.memo(function({schema:t,values:n,onChange:i}){const a=t.properties||{},u=t.required||[],o=(d,l,h)=>{let m=h;if(l.type==="number"||l.type==="integer")m=h===""?void 0:Number(h);else if(l.type==="boolean")m=h;else if(l.type==="array"||l.type==="object")try{m=h===""?l.type==="array"?[]:{}:JSON.parse(h)}catch{m=h}i({...n,[d]:m})},f=(d,l)=>{const h=n[d];return h==null?"":l.type==="array"||l.type==="object"?JSON.stringify(h):String(h)};return _.jsx("div",{className:"form-fields",children:Object.entries(a).map(([d,l])=>l.type==="boolean"?_.jsx("div",{className:"form-field",children:_.jsx(qb,{label:_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"param-name",title:l.description,children:d}),u.includes(d)&&_.jsx("span",{className:"required",children:"*"})]}),checked:!!n[d],onChange:h=>o(d,l,h.target.checked)})},d):l.type==="array"||l.type==="object"?_.jsx(Ew,{label:_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"param-name",title:l.description,children:d}),u.includes(d)&&_.jsx("span",{className:"required",children:"*"}),_.jsxs("span",{className:"field-type",children:["(",l.type,")"]})]}),placeholder:l.description||`Enter JSON ${l.type}...`,value:f(d,l),onChange:h=>o(d,l,h.target.value),rows:3},d):_.jsx(It,{label:_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"param-name",title:l.description,children:d}),u.includes(d)&&_.jsx("span",{className:"required",children:"*"}),(l.type==="number"||l.type==="integer")&&_.jsxs("span",{className:"field-type",children:["(",l.type,")"]})]}),type:l.type==="number"||l.type==="integer"?"number":"text",placeholder:l.description||`Enter ${d}...`,value:f(d,l),onChange:h=>o(d,l,h.target.value),step:l.type==="number"?"any":void 0},d))})});function W4({result:e,resultTab:t,setResultTab:n,toolName:i,input:a}){const u=J.useMemo(()=>{switch(t){case"response":return!e.success&&e.error?e.error:JSON.stringify(e.data,null,2);case"raw":return JSON.stringify(e,null,2);case"request":return JSON.stringify({tool:i,input:a},null,2);default:return""}},[t,e,i,a]);return _.jsxs("section",{className:"result-section animate-fade-in",children:[_.jsxs("div",{className:`result-header ${e.success?"":"error"}`,children:[_.jsxs("div",{className:"result-header-left",children:[_.jsx("span",{className:`result-status ${e.success?"":"error"}`,children:e.success?"✓ Success":"✗ Error"}),_.jsxs("span",{className:"result-time",children:["(",e.time,"ms)"]})]}),_.jsx(z4,{content:u,label:`Copy ${t}`,size:"sm"})]}),_.jsxs("div",{className:"result-tabs",children:[_.jsx("button",{className:`result-tab ${t==="response"?"active":""}`,onClick:()=>n("response"),children:"Response"}),_.jsx("button",{className:`result-tab ${t==="raw"?"active":""}`,onClick:()=>n("raw"),children:"Raw JSON"}),_.jsx("button",{className:`result-tab ${t==="request"?"active":""}`,onClick:()=>n("request"),children:"Request"})]}),_.jsx(Td,{content:u,className:"result-content",preserveQuotes:t==="raw"})]})}const Cw=J.memo(function({onClose:t,children:n}){return J.useEffect(()=>{const i=document.body.style.overflow;document.body.style.overflow="hidden";const a=u=>{u.key==="Escape"&&t()};return document.addEventListener("keydown",a),()=>{document.body.style.overflow=i,document.removeEventListener("keydown",a)}},[t]),Kb.createPortal(_.jsx("div",{className:"modal-overlay",onClick:t,children:_.jsx("div",{className:"modal",onClick:i=>i.stopPropagation(),children:n})}),document.body)});var gs={},qg={},bs={},Ol={},U1;function gt(){if(U1)return Ol;U1=1,Object.defineProperty(Ol,"__esModule",{value:!0}),Ol.ApiResource=void 0;class e{constructor(n){this.client=n,this.post=n._post.bind(n),this.put=n._put.bind(n),this.getMethod=n._get.bind(n),this.deleteMethod=n._delete.bind(n)}}return Ol.ApiResource=e,Ol}var Gg={},F1;function Tr(){return F1||(F1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.AUDIO_FILE_DURATION_HEADER=e.GUARDRAILS_API=e.PROVIDERS_API=e.INTEGRATIONS_API=e.COLLECTIONS_API=e.LABELS_API=e.PROMPT_PARTIALS_API=e.PROMPTS_API=e.LOGS_API=e.EMBEDDINGS_API=e.FEEDBACK_API=e.PROMPT_API=e.TEXT_COMPLETE_API=e.CHAT_COMPLETE_API=e.OPEN_AI_API_KEY=e.PORTKEY_PROXY_ENV=e.PORTKEY_API_KEY_ENV=e.PORTKEY_GATEWAY_URL=e.LOCAL_BASE_URL=e.PORTKEY_BASE_URL=e.PORTKEY_HEADER_PREFIX=e.DEFAULT_TIMEOUT=e.DEFAULT_MAX_RETRIES=e.CUSTOM_HOST_CONNECTION_ERROR=e.LOCALHOST_CONNECTION_ERROR=e.INVALID_PORTKEY_MODE=e.MISSING_MODE_MESSAGE=e.MISSING_CONFIG_MESSAGE=e.MISSING_BASE_URL=e.MISSING_API_KEY_ERROR_MESSAGE=void 0,e.MISSING_API_KEY_ERROR_MESSAGE=`Portkey API Key Not Found
299
+ Resolution:
300
+ 1. Get your Portkey API key from https://app.portkey.ai/api-keys
301
+ 2. Pass it while instantiating the Portkey client with apiKey param, or set it as an environment variable with export PORTKEY_API_KEY=YOUR_API_KEY
302
+ `,e.MISSING_BASE_URL=`No Base url provided. Please provide a valid base url.
303
+ For example: https://api.portkey.ai
304
+ `,e.MISSING_CONFIG_MESSAGE="The 'config' parameter is not set. Please provide a valid Config object",e.MISSING_MODE_MESSAGE="The 'mode' parameter is not set. Please provide a valid mode literal.",e.INVALID_PORTKEY_MODE=`Argument of type '{}' cannot be assigned to parameter "mode" of type "ModesLiteral | Modes | None"
305
+ `,e.LOCALHOST_CONNECTION_ERROR="Could not instantiate the Portkey client. You can either add a valid 'apiKey' parameter (from https://app.portkey.ai/api-keys) or set the 'baseURL' parameter to your AI Gateway's instance's URL.",e.CUSTOM_HOST_CONNECTION_ERROR="We could not connect to the AI Gateway's instance. Please check the 'baseURL' parameter in the Portkey client.",e.DEFAULT_MAX_RETRIES=2,e.DEFAULT_TIMEOUT=60,e.PORTKEY_HEADER_PREFIX="x-portkey-",e.PORTKEY_BASE_URL="https://api.portkey.ai/v1",e.LOCAL_BASE_URL="http://localhost:8787/v1",e.PORTKEY_GATEWAY_URL=e.PORTKEY_BASE_URL,e.PORTKEY_API_KEY_ENV="PORTKEY_API_KEY",e.PORTKEY_PROXY_ENV="PORTKEY_PROXY",e.OPEN_AI_API_KEY="DUMMY-KEY",e.CHAT_COMPLETE_API="/chat/completions",e.TEXT_COMPLETE_API="/completions",e.PROMPT_API="/prompt/complete",e.FEEDBACK_API="/feedback",e.EMBEDDINGS_API="/embeddings",e.LOGS_API="/logs",e.PROMPTS_API="/prompts",e.PROMPT_PARTIALS_API="/prompts/partials",e.LABELS_API="/labels",e.COLLECTIONS_API="/collections",e.INTEGRATIONS_API="/integrations",e.PROVIDERS_API="/providers",e.GUARDRAILS_API="/guardrails",e.AUDIO_FILE_DURATION_HEADER="audio-file-duration"})(Gg)),Gg}var Fa={},Jn={},Qt={},z1;function xw(){if(z1)return Qt;z1=1,Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.InternalServerError=Qt.RateLimitError=Qt.UnprocessableEntityError=Qt.ConflictError=Qt.NotFoundError=Qt.PermissionDeniedError=Qt.AuthenticationError=Qt.BadRequestError=Qt.APIConnectionTimeoutError=Qt.APIConnectionError=Qt.APIUserAbortError=Qt.APIError=void 0;const e=ot();class t extends Error{constructor(E,T,O,v){super(t.makeMessage(T,O)),this.status=E,this.headers=v,this.error=T}static makeMessage(E,T){return E?.message?typeof E.message=="string"?E.message:JSON.stringify(E.message):E?JSON.stringify(E):T||"Unknown error occurred"}static generate(E,T,O,v){if(!E)return new i({cause:(0,e.castToError)(T)});const C=T;return E===400?new u(E,C,O,v):E===401?new o(E,C,O,v):E===403?new f(E,C,O,v):E===404?new d(E,C,O,v):E===409?new l(E,C,O,v):E===422?new h(E,C,O,v):E===429?new m(E,C,O,v):E>=500?new g(E,C,O,v):new t(E,C,O,v)}}Qt.APIError=t;class n extends t{constructor({message:E}={}){super(void 0,void 0,E||"Request was aborted.",void 0),this.status=void 0}}Qt.APIUserAbortError=n;class i extends t{constructor({message:E,cause:T}){const O=`Could not instantiate the Portkey client.
306
+ You can either add a valid 'apiKey' parameter (from https://app.portkey.ai/api-keys)
307
+ or check the 'baseURL' parameter in the Portkey client,
308
+ for your AI Gateway's instance's URL.
309
+ CAUSE: ${T}
310
+ MESSAGE: ${E}`;super(void 0,void 0,E||O,void 0),this.status=void 0,T&&(this.cause=T)}}Qt.APIConnectionError=i;class a extends i{constructor({message:E}={}){super({message:E??"Request timed out."})}}Qt.APIConnectionTimeoutError=a;class u extends t{constructor(){super(...arguments),this.status=400}}Qt.BadRequestError=u;class o extends t{constructor(){super(...arguments),this.status=401}}Qt.AuthenticationError=o;class f extends t{constructor(){super(...arguments),this.status=403}}Qt.PermissionDeniedError=f;class d extends t{constructor(){super(...arguments),this.status=404}}Qt.NotFoundError=d;class l extends t{constructor(){super(...arguments),this.status=409}}Qt.ConflictError=l;class h extends t{constructor(){super(...arguments),this.status=422}}Qt.UnprocessableEntityError=h;class m extends t{constructor(){super(...arguments),this.status=429}}Qt.RateLimitError=m;class g extends t{}return Qt.InternalServerError=g,Qt}var $1;function ww(){if($1)return Jn;$1=1;var e=Jn&&Jn.__awaiter||function(g,b,E,T){function O(v){return v instanceof E?v:new E(function(C){C(v)})}return new(E||(E=Promise))(function(v,C){function x(R){try{j(T.next(R))}catch(k){C(k)}}function I(R){try{j(T.throw(R))}catch(k){C(k)}}function j(R){R.done?v(R.value):O(R.value).then(x,I)}j((T=T.apply(g,b||[])).next())})},t=Jn&&Jn.__asyncValues||function(g){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var b=g[Symbol.asyncIterator],E;return b?b.call(g):(g=typeof __values=="function"?__values(g):g[Symbol.iterator](),E={},T("next"),T("throw"),T("return"),E[Symbol.asyncIterator]=function(){return this},E);function T(v){E[v]=g[v]&&function(C){return new Promise(function(x,I){C=g[v](C),O(x,I,C.done,C.value)})}}function O(v,C,x,I){Promise.resolve(I).then(function(j){v({value:j,done:x})},C)}},n=Jn&&Jn.__await||function(g){return this instanceof n?(this.v=g,this):new n(g)},i=Jn&&Jn.__asyncGenerator||function(g,b,E){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var T=E.apply(g,b||[]),O,v=[];return O={},x("next"),x("throw"),x("return",C),O[Symbol.asyncIterator]=function(){return this},O;function C(z){return function(L){return Promise.resolve(L).then(z,k)}}function x(z,L){T[z]&&(O[z]=function(G){return new Promise(function(F,K){v.push([z,G,F,K])>1||I(z,G)})},L&&(O[z]=L(O[z])))}function I(z,L){try{j(T[z](L))}catch(G){P(v[0][3],G)}}function j(z){z.value instanceof n?Promise.resolve(z.value.v).then(R,k):P(v[0][2],z)}function R(z){I("next",z)}function k(z){I("throw",z)}function P(z,L){z(L),v.shift(),v.length&&I(v[0][0],v[0][1])}};Object.defineProperty(Jn,"__esModule",{value:!0}),Jn.Stream=Jn.createResponseHeaders=Jn.safeJSON=void 0;const a=xw(),u=g=>{try{return JSON.parse(g)}catch{return}};Jn.safeJSON=u;const o=g=>new Proxy(Object.fromEntries(g.entries()),{get(b,E){const T=E.toString();return b[T.toLowerCase()]||b[T]}});Jn.createResponseHeaders=o;class f{constructor(b){this.response=b,this.decoder=new d}iterMessages(){return i(this,arguments,function*(){var E,T,O,v;if(!this.response.body)throw new Error("Attempted to iterate over a response with no body");const C=new l,x=m(this.response.body);try{for(var I=!0,j=t(x),R;R=yield n(j.next()),E=R.done,!E;I=!0){v=R.value,I=!1;const k=v;for(const P of C.decode(k)){const z=this.decoder.decode(P);z&&(yield yield n(z))}}}catch(k){T={error:k}}finally{try{!I&&!E&&(O=j.return)&&(yield n(O.call(j)))}finally{if(T)throw T.error}}for(const k of C.flush()){const P=this.decoder.decode(k);P&&(yield yield n(P))}})}[Symbol.asyncIterator](){return i(this,arguments,function*(){var E,T,O,v;try{try{for(var C=!0,x=t(this.iterMessages()),I;I=yield n(x.next()),E=I.done,!E;C=!0){v=I.value,C=!1;const j=v;if(!j.data.startsWith("[DONE]")){if(j.event===null)try{yield yield n(JSON.parse(j.data))}catch(R){throw console.error("Could not parse message into JSON:",j.data),console.error("From chunk:",j.raw),R}if(j.event!=="ping"&&j.event==="error"){let R;try{R=JSON.parse(j.data)}catch{throw console.error("Could not parse message into JSON:",j.data),console.error("From chunk:",j.raw),new a.APIError(void 0,void 0,"Unknown error",void 0)}throw new a.APIError(void 0,R,R.message,void 0)}}}}catch(j){T={error:j}}finally{try{!C&&!E&&(O=x.return)&&(yield n(O.call(x)))}finally{if(T)throw T.error}}}catch(j){if(j instanceof Error&&j.name==="AbortError")return yield n(void 0);throw j}})}}Jn.Stream=f;class d{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(b){if(b.endsWith("\r")&&(b=b.substring(0,b.length-1)),!b){if(!this.event&&!this.data.length)return null;const v={event:this.event,data:this.data.join(`
311
+ `),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],v}if(this.chunks.push(b),b.startsWith(":"))return null;let[E,T,O]=h(b,":");return O.startsWith(" ")&&(O=O.substring(1)),E==="event"?this.event=O:E==="data"&&this.data.push(O),null}}class l{constructor(){this.buffer=[],this.trailingCR=!1}decode(b){let E=this.decodeText(b);if(this.trailingCR&&(E="\r"+E,this.trailingCR=!1),E.endsWith("\r")&&(this.trailingCR=!0,E=E.slice(0,-1)),!E)return[];const T=l.NEWLINE_CHARS.has(E[E.length-1]||"");let O=E.split(l.NEWLINE_REGEXP);return O.length===1&&!T?(this.buffer.push(O[0]),[]):(this.buffer.length>0&&(O=[this.buffer.join("")+O[0],...O.slice(1)],this.buffer=[]),T||(this.buffer=[O.pop()||""]),O)}decodeText(b){var E;if(b==null)return"";if(typeof b=="string")return b;if(typeof Buffer<"u"){if(b instanceof Buffer)return b.toString();if(b instanceof Uint8Array)return Buffer.from(b).toString();throw new Error(`Unexpected: received non-Uint8Array (${b.constructor.name}) stream chunk in an environment with a global "Buffer" defined, which this library assumes to be Node. Please report this error.`)}if(typeof TextDecoder<"u"){if(b instanceof Uint8Array||b instanceof ArrayBuffer)return(E=this.textDecoder)!==null&&E!==void 0||(this.textDecoder=new TextDecoder("utf8")),this.textDecoder.decode(b);throw new Error(`Unexpected: received non-Uint8Array/ArrayBuffer (${b.constructor.name}) in a web platform. Please report this error.`)}throw new Error("Unexpected: neither Buffer nor TextDecoder are available as globals. Please report this error.")}flush(){if(!this.buffer.length&&!this.trailingCR)return[];const b=[this.buffer.join("")];return this.buffer=[],this.trailingCR=!1,b}}l.NEWLINE_CHARS=new Set([`
312
+ `,"\r","\v","\f","","","","…","\u2028","\u2029"]),l.NEWLINE_REGEXP=/\r\n|[\n\r\x0b\x0c\x1c\x1d\x1e\x85\u2028\u2029]/g;function h(g,b){const E=g.indexOf(b);return E!==-1?[g.substring(0,E),b,g.substring(E+b.length)]:[g,"",""]}function m(g){if(g[Symbol.asyncIterator])return g;const b=g.getReader();return{next(){return e(this,void 0,void 0,function*(){try{const E=yield b.read();return E?.done&&b.releaseLock(),E}catch(E){throw b.releaseLock(),E}})},return(){return e(this,void 0,void 0,function*(){const E=b.cancel();return b.releaseLock(),yield E,{done:!0,value:void 0}})},[Symbol.asyncIterator](){return this}}}return Jn}var Nh={exports:{}},Sl={},Ci={},q1;function ht(){if(q1)return Ci;q1=1,Object.defineProperty(Ci,"__esModule",{value:!0}),Ci.__setModuleDefault=Ci.__createBinding=void 0,Ci.__classPrivateFieldSet=e,Ci.__classPrivateFieldGet=t,Ci.__exportStar=i,Ci.__importStar=o;function e(f,d,l,h,m){if(h==="m")throw new TypeError("Private method is not writable");if(h==="a"&&!m)throw new TypeError("Private accessor was defined without a setter");if(typeof d=="function"?f!==d||!m:!d.has(f))throw new TypeError("Cannot write private member to an object whose class did not declare it");return h==="a"?m.call(f,l):m?m.value=l:d.set(f,l),l}function t(f,d,l,h){if(l==="a"&&!h)throw new TypeError("Private accessor was defined without a getter");if(typeof d=="function"?f!==d||!h:!d.has(f))throw new TypeError("Cannot read private member from an object whose class did not declare it");return l==="m"?h:l==="a"?h.call(f):h?h.value:d.get(f)}var n=Object.create?function(f,d,l,h){h===void 0&&(h=l);var m=Object.getOwnPropertyDescriptor(d,l);(!m||("get"in m?!d.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return d[l]}}),Object.defineProperty(f,h,m)}:function(f,d,l,h){h===void 0&&(h=l),f[h]=d[l]};Ci.__createBinding=n;function i(f,d){for(var l in f)l!=="default"&&!Object.prototype.hasOwnProperty.call(d,l)&&n(d,f,l)}var a=Object.create?function(f,d){Object.defineProperty(f,"default",{enumerable:!0,value:d})}:function(f,d){f.default=d};Ci.__setModuleDefault=a;var u=function(f){return u=Object.getOwnPropertyNames||function(d){var l=[];for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(l[l.length]=h);return l},u(f)};function o(f){if(f&&f.__esModule)return f;var d={};if(f!=null)for(var l=u(f),h=0;h<l.length;h++)l[h]!=="default"&&n(d,f,l[h]);return a(d,f),d}return Ci}var Zo={},G1;function Rw(){if(G1)return Zo;G1=1,Object.defineProperty(Zo,"__esModule",{value:!0}),Zo.uuid4=void 0;let e=function(){const{crypto:t}=globalThis;if(t?.randomUUID)return Zo.uuid4=t.randomUUID.bind(t),t.randomUUID();const n=new Uint8Array(1),i=t?()=>t.getRandomValues(n)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,a=>(+a^i()&15>>+a/4).toString(16))};return Zo.uuid4=e,Zo}var Kg={},Nt={},Wo={},K1;function Yb(){if(K1)return Wo;K1=1,Object.defineProperty(Wo,"__esModule",{value:!0}),Wo.castToError=void 0,Wo.isAbortError=e;function e(n){return typeof n=="object"&&n!==null&&("name"in n&&n.name==="AbortError"||"message"in n&&String(n.message).includes("FetchRequestCanceledException"))}const t=n=>{if(n instanceof Error)return n;if(typeof n=="object"&&n!==null){try{if(Object.prototype.toString.call(n)==="[object Error]"){const i=new Error(n.message,n.cause?{cause:n.cause}:{});return n.stack&&(i.stack=n.stack),n.cause&&!i.cause&&(i.cause=n.cause),n.name&&(i.name=n.name),i}}catch{}try{return new Error(JSON.stringify(n))}catch{}}return new Error(n)};return Wo.castToError=t,Wo}var Y1;function Rs(){if(Y1)return Nt;Y1=1,Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.InvalidWebhookSignatureError=Nt.ContentFilterFinishReasonError=Nt.LengthFinishReasonError=Nt.InternalServerError=Nt.RateLimitError=Nt.UnprocessableEntityError=Nt.ConflictError=Nt.NotFoundError=Nt.PermissionDeniedError=Nt.AuthenticationError=Nt.BadRequestError=Nt.APIConnectionTimeoutError=Nt.APIConnectionError=Nt.APIUserAbortError=Nt.APIError=Nt.OpenAIError=void 0;const e=Yb();class t extends Error{}Nt.OpenAIError=t;class n extends t{constructor(C,x,I,j){super(`${n.makeMessage(C,x,I)}`),this.status=C,this.headers=j,this.requestID=j?.get("x-request-id"),this.error=x;const R=x;this.code=R?.code,this.param=R?.param,this.type=R?.type}static makeMessage(C,x,I){const j=x?.message?typeof x.message=="string"?x.message:JSON.stringify(x.message):x?JSON.stringify(x):I;return C&&j?`${C} ${j}`:C?`${C} status code (no body)`:j||"(no status code or body)"}static generate(C,x,I,j){if(!C||!j)return new a({message:I,cause:(0,e.castToError)(x)});const R=x?.error;return C===400?new o(C,R,I,j):C===401?new f(C,R,I,j):C===403?new d(C,R,I,j):C===404?new l(C,R,I,j):C===409?new h(C,R,I,j):C===422?new m(C,R,I,j):C===429?new g(C,R,I,j):C>=500?new b(C,R,I,j):new n(C,R,I,j)}}Nt.APIError=n;class i extends n{constructor({message:C}={}){super(void 0,void 0,C||"Request was aborted.",void 0)}}Nt.APIUserAbortError=i;class a extends n{constructor({message:C,cause:x}){super(void 0,void 0,C||"Connection error.",void 0),x&&(this.cause=x)}}Nt.APIConnectionError=a;class u extends a{constructor({message:C}={}){super({message:C??"Request timed out."})}}Nt.APIConnectionTimeoutError=u;class o extends n{}Nt.BadRequestError=o;class f extends n{}Nt.AuthenticationError=f;class d extends n{}Nt.PermissionDeniedError=d;class l extends n{}Nt.NotFoundError=l;class h extends n{}Nt.ConflictError=h;class m extends n{}Nt.UnprocessableEntityError=m;class g extends n{}Nt.RateLimitError=g;class b extends n{}Nt.InternalServerError=b;class E extends t{constructor(){super("Could not parse response content as the length limit was reached")}}Nt.LengthFinishReasonError=E;class T extends t{constructor(){super("Could not parse response content as the request was rejected by the content filter")}}Nt.ContentFilterFinishReasonError=T;class O extends Error{constructor(C){super(C)}}return Nt.InvalidWebhookSignatureError=O,Nt}var V1;function ba(){return V1||(V1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.safeJSON=e.maybeCoerceBoolean=e.maybeCoerceFloat=e.maybeCoerceInteger=e.coerceBoolean=e.coerceFloat=e.coerceInteger=e.validatePositiveInteger=e.ensurePresent=e.isReadonlyArray=e.isArray=e.isAbsoluteURL=void 0,e.maybeObj=u,e.isEmptyObj=o,e.hasOwn=f,e.isObj=d;const t=Rs(),n=/^[a-z][a-z0-9+.-]*:/i,i=C=>n.test(C);e.isAbsoluteURL=i;let a=C=>(e.isArray=Array.isArray,(0,e.isArray)(C));e.isArray=a,e.isReadonlyArray=e.isArray;function u(C){return typeof C!="object"?{}:C??{}}function o(C){if(!C)return!0;for(const x in C)return!1;return!0}function f(C,x){return Object.prototype.hasOwnProperty.call(C,x)}function d(C){return C!=null&&typeof C=="object"&&!Array.isArray(C)}const l=C=>{if(C==null)throw new t.OpenAIError(`Expected a value to be given but received ${C} instead.`);return C};e.ensurePresent=l;const h=(C,x)=>{if(typeof x!="number"||!Number.isInteger(x))throw new t.OpenAIError(`${C} must be an integer`);if(x<0)throw new t.OpenAIError(`${C} must be a positive integer`);return x};e.validatePositiveInteger=h;const m=C=>{if(typeof C=="number")return Math.round(C);if(typeof C=="string")return parseInt(C,10);throw new t.OpenAIError(`Could not coerce ${C} (type: ${typeof C}) into a number`)};e.coerceInteger=m;const g=C=>{if(typeof C=="number")return C;if(typeof C=="string")return parseFloat(C);throw new t.OpenAIError(`Could not coerce ${C} (type: ${typeof C}) into a number`)};e.coerceFloat=g;const b=C=>typeof C=="boolean"?C:typeof C=="string"?C==="true":!!C;e.coerceBoolean=b;const E=C=>{if(C!=null)return(0,e.coerceInteger)(C)};e.maybeCoerceInteger=E;const T=C=>{if(C!=null)return(0,e.coerceFloat)(C)};e.maybeCoerceFloat=T;const O=C=>{if(C!=null)return(0,e.coerceBoolean)(C)};e.maybeCoerceBoolean=O;const v=C=>{try{return JSON.parse(C)}catch{return}};e.safeJSON=v})(Kg)),Kg}var Cl={},Z1;function ef(){if(Z1)return Cl;Z1=1,Object.defineProperty(Cl,"__esModule",{value:!0}),Cl.sleep=void 0;const e=t=>new Promise(n=>setTimeout(n,t));return Cl.sleep=e,Cl}var za={},xl={},W1;function Nw(){return W1||(W1=1,Object.defineProperty(xl,"__esModule",{value:!0}),xl.VERSION=void 0,xl.VERSION="6.3.0"),xl}var X1;function K0(){if(X1)return za;X1=1,Object.defineProperty(za,"__esModule",{value:!0}),za.getPlatformHeaders=za.isRunningInBrowser=void 0;const e=Nw(),t=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";za.isRunningInBrowser=t;function n(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}const i=()=>{const l=n();if(l==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":e.VERSION,"X-Stainless-OS":o(Deno.build.os),"X-Stainless-Arch":u(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":e.VERSION,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(l==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":e.VERSION,"X-Stainless-OS":o(globalThis.process.platform??"unknown"),"X-Stainless-Arch":u(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};const h=a();return h?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":e.VERSION,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${h.browser}`,"X-Stainless-Runtime-Version":h.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":e.VERSION,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function a(){if(typeof navigator>"u"||!navigator)return null;const l=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(const{key:h,pattern:m}of l){const g=m.exec(navigator.userAgent);if(g){const b=g[1]||0,E=g[2]||0,T=g[3]||0;return{browser:h,version:`${b}.${E}.${T}`}}}return null}const u=l=>l==="x32"?"x32":l==="x86_64"||l==="x64"?"x64":l==="arm"?"arm":l==="aarch64"||l==="arm64"?"arm64":l?`other:${l}`:"unknown",o=l=>(l=l.toLowerCase(),l.includes("ios")?"iOS":l==="android"?"Android":l==="darwin"?"MacOS":l==="win32"?"Windows":l==="freebsd"?"FreeBSD":l==="openbsd"?"OpenBSD":l==="linux"?"Linux":l?`Other:${l}`:"Unknown");let f;const d=()=>f??(f=i());return za.getPlatformHeaders=d,za}var sa={},Q1;function Jh(){if(Q1)return sa;Q1=1,Object.defineProperty(sa,"__esModule",{value:!0}),sa.getDefaultFetch=e,sa.makeReadableStream=t,sa.ReadableStreamFrom=n,sa.ReadableStreamToAsyncIterable=i,sa.CancelReadableStream=a;function e(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function t(...u){const o=globalThis.ReadableStream;if(typeof o>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new o(...u)}function n(u){let o=Symbol.asyncIterator in u?u[Symbol.asyncIterator]():u[Symbol.iterator]();return t({start(){},async pull(f){const{done:d,value:l}=await o.next();d?f.close():f.enqueue(l)},async cancel(){await o.return?.()}})}function i(u){if(u[Symbol.asyncIterator])return u;const o=u.getReader();return{async next(){try{const f=await o.read();return f?.done&&o.releaseLock(),f}catch(f){throw o.releaseLock(),f}},async return(){const f=o.cancel();return o.releaseLock(),await f,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function a(u){if(u===null||typeof u!="object")return;if(u[Symbol.asyncIterator]){await u[Symbol.asyncIterator]().return?.();return}const o=u.getReader(),f=o.cancel();o.releaseLock(),await f}return sa}var wl={},J1;function X4(){if(J1)return wl;J1=1,Object.defineProperty(wl,"__esModule",{value:!0}),wl.FallbackEncoder=void 0;const e=({headers:t,body:n})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(n)});return wl.FallbackEncoder=e,wl}var Yg={},Vg={},eT;function Vb(){return eT||(eT=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RFC3986=e.RFC1738=e.formatters=e.default_formatter=e.default_format=void 0,e.default_format="RFC3986";const t=n=>String(n);e.default_formatter=t,e.formatters={RFC1738:n=>String(n).replace(/%20/g,"+"),RFC3986:e.default_formatter},e.RFC1738="RFC1738",e.RFC3986="RFC3986"})(Vg)),Vg}var Ih={},Zg={},tT;function Q4(){return tT||(tT=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.encode=e.has=void 0,e.merge=f,e.assign_single_source=d,e.decode=l,e.compact=g,e.is_regexp=b,e.is_buffer=E,e.combine=T,e.maybe_map=O;const t=Vb(),n=ba();let i=(v,C)=>(e.has=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),(0,e.has)(v,C));e.has=i;const a=(()=>{const v=[];for(let C=0;C<256;++C)v.push("%"+((C<16?"0":"")+C.toString(16)).toUpperCase());return v})();function u(v){for(;v.length>1;){const C=v.pop();if(!C)continue;const x=C.obj[C.prop];if((0,n.isArray)(x)){const I=[];for(let j=0;j<x.length;++j)typeof x[j]<"u"&&I.push(x[j]);C.obj[C.prop]=I}}}function o(v,C){const x=C&&C.plainObjects?Object.create(null):{};for(let I=0;I<v.length;++I)typeof v[I]<"u"&&(x[I]=v[I]);return x}function f(v,C,x={}){if(!C)return v;if(typeof C!="object"){if((0,n.isArray)(v))v.push(C);else if(v&&typeof v=="object")(x&&(x.plainObjects||x.allowPrototypes)||!(0,e.has)(Object.prototype,C))&&(v[C]=!0);else return[v,C];return v}if(!v||typeof v!="object")return[v].concat(C);let I=v;return(0,n.isArray)(v)&&!(0,n.isArray)(C)&&(I=o(v,x)),(0,n.isArray)(v)&&(0,n.isArray)(C)?(C.forEach(function(j,R){if((0,e.has)(v,R)){const k=v[R];k&&typeof k=="object"&&j&&typeof j=="object"?v[R]=f(k,j,x):v.push(j)}else v[R]=j}),v):Object.keys(C).reduce(function(j,R){const k=C[R];return(0,e.has)(j,R)?j[R]=f(j[R],k,x):j[R]=k,j},I)}function d(v,C){return Object.keys(C).reduce(function(x,I){return x[I]=C[I],x},v)}function l(v,C,x){const I=v.replace(/\+/g," ");if(x==="iso-8859-1")return I.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(I)}catch{return I}}const h=1024,m=(v,C,x,I,j)=>{if(v.length===0)return v;let R=v;if(typeof v=="symbol"?R=Symbol.prototype.toString.call(v):typeof v!="string"&&(R=String(v)),x==="iso-8859-1")return escape(R).replace(/%u[0-9a-f]{4}/gi,function(P){return"%26%23"+parseInt(P.slice(2),16)+"%3B"});let k="";for(let P=0;P<R.length;P+=h){const z=R.length>=h?R.slice(P,P+h):R,L=[];for(let G=0;G<z.length;++G){let F=z.charCodeAt(G);if(F===45||F===46||F===95||F===126||F>=48&&F<=57||F>=65&&F<=90||F>=97&&F<=122||j===t.RFC1738&&(F===40||F===41)){L[L.length]=z.charAt(G);continue}if(F<128){L[L.length]=a[F];continue}if(F<2048){L[L.length]=a[192|F>>6]+a[128|F&63];continue}if(F<55296||F>=57344){L[L.length]=a[224|F>>12]+a[128|F>>6&63]+a[128|F&63];continue}G+=1,F=65536+((F&1023)<<10|z.charCodeAt(G)&1023),L[L.length]=a[240|F>>18]+a[128|F>>12&63]+a[128|F>>6&63]+a[128|F&63]}k+=L.join("")}return k};e.encode=m;function g(v){const C=[{obj:{o:v},prop:"o"}],x=[];for(let I=0;I<C.length;++I){const j=C[I],R=j.obj[j.prop],k=Object.keys(R);for(let P=0;P<k.length;++P){const z=k[P],L=R[z];typeof L=="object"&&L!==null&&x.indexOf(L)===-1&&(C.push({obj:R,prop:z}),x.push(L))}}return u(C),v}function b(v){return Object.prototype.toString.call(v)==="[object RegExp]"}function E(v){return!v||typeof v!="object"?!1:!!(v.constructor&&v.constructor.isBuffer&&v.constructor.isBuffer(v))}function T(v,C){return[].concat(v,C)}function O(v,C){if((0,n.isArray)(v)){const x=[];for(let I=0;I<v.length;I+=1)x.push(C(v[I]));return x}return C(v)}})(Zg)),Zg}var nT;function J4(){if(nT)return Ih;nT=1,Object.defineProperty(Ih,"__esModule",{value:!0}),Ih.stringify=m;const e=Q4(),t=Vb(),n=ba(),i={brackets(g){return String(g)+"[]"},comma:"comma",indices(g,b){return String(g)+"["+b+"]"},repeat(g){return String(g)}},a=function(g,b){Array.prototype.push.apply(g,(0,n.isArray)(b)?b:[b])};let u;const o={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:e.encode,encodeValuesOnly:!1,format:t.default_format,formatter:t.default_formatter,indices:!1,serializeDate(g){return(u??(u=Function.prototype.call.bind(Date.prototype.toISOString)))(g)},skipNulls:!1,strictNullHandling:!1};function f(g){return typeof g=="string"||typeof g=="number"||typeof g=="boolean"||typeof g=="symbol"||typeof g=="bigint"}const d={};function l(g,b,E,T,O,v,C,x,I,j,R,k,P,z,L,G,F,K){let B=g,Z=K,U=0,Y=!1;for(;(Z=Z.get(d))!==void 0&&!Y;){const q=Z.get(g);if(U+=1,typeof q<"u"){if(q===U)throw new RangeError("Cyclic object value");Y=!0}typeof Z.get(d)>"u"&&(U=0)}if(typeof j=="function"?B=j(b,B):B instanceof Date?B=P?.(B):E==="comma"&&(0,n.isArray)(B)&&(B=(0,e.maybe_map)(B,function(q){return q instanceof Date?P?.(q):q})),B===null){if(v)return I&&!G?I(b,o.encoder,F,"key",z):b;B=""}if(f(B)||(0,e.is_buffer)(B)){if(I){const q=G?b:I(b,o.encoder,F,"key",z);return[L?.(q)+"="+L?.(I(B,o.encoder,F,"value",z))]}return[L?.(b)+"="+L?.(String(B))]}const W=[];if(typeof B>"u")return W;let pe;if(E==="comma"&&(0,n.isArray)(B))G&&I&&(B=(0,e.maybe_map)(B,I)),pe=[{value:B.length>0?B.join(",")||null:void 0}];else if((0,n.isArray)(j))pe=j;else{const q=Object.keys(B);pe=R?q.sort(R):q}const N=x?String(b).replace(/\./g,"%2E"):String(b),M=T&&(0,n.isArray)(B)&&B.length===1?N+"[]":N;if(O&&(0,n.isArray)(B)&&B.length===0)return M+"[]";for(let q=0;q<pe.length;++q){const D=pe[q],ie=typeof D=="object"&&typeof D.value<"u"?D.value:B[D];if(C&&ie===null)continue;const ae=k&&x?D.replace(/\./g,"%2E"):D,fe=(0,n.isArray)(B)?typeof E=="function"?E(M,ae):M:M+(k?"."+ae:"["+ae+"]");K.set(g,U);const Ee=new WeakMap;Ee.set(d,K),a(W,l(ie,fe,E,T,O,v,C,x,E==="comma"&&G&&(0,n.isArray)(B)?null:I,j,R,k,P,z,L,G,F,Ee))}return W}function h(g=o){if(typeof g.allowEmptyArrays<"u"&&typeof g.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof g.encodeDotInKeys<"u"&&typeof g.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(g.encoder!==null&&typeof g.encoder<"u"&&typeof g.encoder!="function")throw new TypeError("Encoder has to be a function.");const b=g.charset||o.charset;if(typeof g.charset<"u"&&g.charset!=="utf-8"&&g.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let E=t.default_format;if(typeof g.format<"u"){if(!(0,e.has)(t.formatters,g.format))throw new TypeError("Unknown format option provided.");E=g.format}const T=t.formatters[E];let O=o.filter;(typeof g.filter=="function"||(0,n.isArray)(g.filter))&&(O=g.filter);let v;if(g.arrayFormat&&g.arrayFormat in i?v=g.arrayFormat:"indices"in g?v=g.indices?"indices":"repeat":v=o.arrayFormat,"commaRoundTrip"in g&&typeof g.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");const C=typeof g.allowDots>"u"?g.encodeDotInKeys?!0:o.allowDots:!!g.allowDots;return{addQueryPrefix:typeof g.addQueryPrefix=="boolean"?g.addQueryPrefix:o.addQueryPrefix,allowDots:C,allowEmptyArrays:typeof g.allowEmptyArrays=="boolean"?!!g.allowEmptyArrays:o.allowEmptyArrays,arrayFormat:v,charset:b,charsetSentinel:typeof g.charsetSentinel=="boolean"?g.charsetSentinel:o.charsetSentinel,commaRoundTrip:!!g.commaRoundTrip,delimiter:typeof g.delimiter>"u"?o.delimiter:g.delimiter,encode:typeof g.encode=="boolean"?g.encode:o.encode,encodeDotInKeys:typeof g.encodeDotInKeys=="boolean"?g.encodeDotInKeys:o.encodeDotInKeys,encoder:typeof g.encoder=="function"?g.encoder:o.encoder,encodeValuesOnly:typeof g.encodeValuesOnly=="boolean"?g.encodeValuesOnly:o.encodeValuesOnly,filter:O,format:E,formatter:T,serializeDate:typeof g.serializeDate=="function"?g.serializeDate:o.serializeDate,skipNulls:typeof g.skipNulls=="boolean"?g.skipNulls:o.skipNulls,sort:typeof g.sort=="function"?g.sort:null,strictNullHandling:typeof g.strictNullHandling=="boolean"?g.strictNullHandling:o.strictNullHandling}}function m(g,b={}){let E=g;const T=h(b);let O,v;typeof T.filter=="function"?(v=T.filter,E=v("",E)):(0,n.isArray)(T.filter)&&(v=T.filter,O=v);const C=[];if(typeof E!="object"||E===null)return"";const x=i[T.arrayFormat],I=x==="comma"&&T.commaRoundTrip;O||(O=Object.keys(E)),T.sort&&O.sort(T.sort);const j=new WeakMap;for(let P=0;P<O.length;++P){const z=O[P];T.skipNulls&&E[z]===null||a(C,l(E[z],z,x,I,T.allowEmptyArrays,T.strictNullHandling,T.skipNulls,T.encodeDotInKeys,T.encode?T.encoder:null,T.filter,T.sort,T.allowDots,T.serializeDate,T.format,T.formatter,T.encodeValuesOnly,T.charset,j))}const R=C.join(T.delimiter);let k=T.addQueryPrefix===!0?"?":"";return T.charsetSentinel&&(T.charset==="iso-8859-1"?k+="utf8=%26%2310003%3B&":k+="utf8=%E2%9C%93&"),R.length>0?k+R:""}return Ih}var rT;function eH(){return rT||(rT=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formats=e.stringify=void 0;const t=Vb(),n={formatters:t.formatters,RFC1738:t.RFC1738,RFC3986:t.RFC3986,default:t.default_format};e.formats=n;var i=J4();Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return i.stringify}})})(Yg)),Yg}var Kr={},Rl={},Xo={},Qo={},Jo={},iT;function Zb(){if(iT)return Jo;iT=1,Object.defineProperty(Jo,"__esModule",{value:!0}),Jo.concatBytes=e,Jo.encodeUTF8=n,Jo.decodeUTF8=a;function e(u){let o=0;for(const l of u)o+=l.length;const f=new Uint8Array(o);let d=0;for(const l of u)f.set(l,d),d+=l.length;return f}let t;function n(u){let o;return(t??(o=new globalThis.TextEncoder,t=o.encode.bind(o)))(u)}let i;function a(u){let o;return(i??(o=new globalThis.TextDecoder,i=o.decode.bind(o)))(u)}return Jo}var sT;function tH(){if(sT)return Qo;sT=1;var e,t;Object.defineProperty(Qo,"__esModule",{value:!0}),Qo.LineDecoder=void 0,Qo.findDoubleNewlineIndex=o;const n=ht(),i=Zb();class a{constructor(){e.set(this,void 0),t.set(this,void 0),n.__classPrivateFieldSet(this,e,new Uint8Array,"f"),n.__classPrivateFieldSet(this,t,null,"f")}decode(d){if(d==null)return[];const l=d instanceof ArrayBuffer?new Uint8Array(d):typeof d=="string"?(0,i.encodeUTF8)(d):d;n.__classPrivateFieldSet(this,e,(0,i.concatBytes)([n.__classPrivateFieldGet(this,e,"f"),l]),"f");const h=[];let m;for(;(m=u(n.__classPrivateFieldGet(this,e,"f"),n.__classPrivateFieldGet(this,t,"f")))!=null;){if(m.carriage&&n.__classPrivateFieldGet(this,t,"f")==null){n.__classPrivateFieldSet(this,t,m.index,"f");continue}if(n.__classPrivateFieldGet(this,t,"f")!=null&&(m.index!==n.__classPrivateFieldGet(this,t,"f")+1||m.carriage)){h.push((0,i.decodeUTF8)(n.__classPrivateFieldGet(this,e,"f").subarray(0,n.__classPrivateFieldGet(this,t,"f")-1))),n.__classPrivateFieldSet(this,e,n.__classPrivateFieldGet(this,e,"f").subarray(n.__classPrivateFieldGet(this,t,"f")),"f"),n.__classPrivateFieldSet(this,t,null,"f");continue}const g=n.__classPrivateFieldGet(this,t,"f")!==null?m.preceding-1:m.preceding,b=(0,i.decodeUTF8)(n.__classPrivateFieldGet(this,e,"f").subarray(0,g));h.push(b),n.__classPrivateFieldSet(this,e,n.__classPrivateFieldGet(this,e,"f").subarray(m.index),"f"),n.__classPrivateFieldSet(this,t,null,"f")}return h}flush(){return n.__classPrivateFieldGet(this,e,"f").length?this.decode(`
313
+ `):[]}}Qo.LineDecoder=a,e=new WeakMap,t=new WeakMap,a.NEWLINE_CHARS=new Set([`
314
+ `,"\r"]),a.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function u(f,d){for(let m=d??0;m<f.length;m++){if(f[m]===10)return{preceding:m,index:m+1,carriage:!1};if(f[m]===13)return{preceding:m,index:m+1,carriage:!0}}return null}function o(f){for(let h=0;h<f.length-1;h++){if(f[h]===10&&f[h+1]===10||f[h]===13&&f[h+1]===13)return h+2;if(f[h]===13&&f[h+1]===10&&h+3<f.length&&f[h+2]===13&&f[h+3]===10)return h+4}return-1}return Qo}var aa={},aT;function gm(){if(aT)return aa;aT=1,Object.defineProperty(aa,"__esModule",{value:!0}),aa.formatRequestDetails=aa.parseLogLevel=void 0,aa.loggerFor=f;const e=ba(),t={off:0,error:200,warn:300,info:400,debug:500},n=(l,h,m)=>{if(l){if((0,e.hasOwn)(t,l))return l;f(m).warn(`${h} was set to ${JSON.stringify(l)}, expected one of ${JSON.stringify(Object.keys(t))}`)}};aa.parseLogLevel=n;function i(){}function a(l,h,m){return!h||t[l]>t[m]?i:h[l].bind(h)}const u={error:i,warn:i,info:i,debug:i};let o=new WeakMap;function f(l){const h=l.logger,m=l.logLevel??"off";if(!h)return u;const g=o.get(h);if(g&&g[0]===m)return g[1];const b={error:a("error",h,m),warn:a("warn",h,m),info:a("info",h,m),debug:a("debug",h,m)};return o.set(h,[m,b]),b}const d=l=>(l.options&&(l.options={...l.options},delete l.options.headers),l.headers&&(l.headers=Object.fromEntries((l.headers instanceof Headers?[...l.headers]:Object.entries(l.headers)).map(([h,m])=>[h,h.toLowerCase()==="authorization"||h.toLowerCase()==="cookie"||h.toLowerCase()==="set-cookie"?"***":m]))),"retryOfRequestLogID"in l&&(l.retryOfRequestLogID&&(l.retryOf=l.retryOfRequestLogID),delete l.retryOfRequestLogID),l);return aa.formatRequestDetails=d,aa}var oT;function Iw(){if(oT)return Xo;oT=1;var e;Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.Stream=void 0,Xo._iterSSEMessages=m;const t=ht(),n=Rs(),i=Jh(),a=tH(),u=Jh(),o=Yb(),f=Zb(),d=gm(),l=Rs();class h{constructor(O,v,C){this.iterator=O,e.set(this,void 0),this.controller=v,t.__classPrivateFieldSet(this,e,C,"f")}static fromSSEResponse(O,v,C){let x=!1;const I=C?(0,d.loggerFor)(C):console;async function*j(){if(x)throw new n.OpenAIError("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");x=!0;let R=!1;try{for await(const k of m(O,v))if(!R){if(k.data.startsWith("[DONE]")){R=!0;continue}if(k.event===null||!k.event.startsWith("thread.")){let P;try{P=JSON.parse(k.data)}catch(z){throw I.error("Could not parse message into JSON:",k.data),I.error("From chunk:",k.raw),z}if(P&&P.error)throw new l.APIError(void 0,P.error,void 0,O.headers);yield P}else{let P;try{P=JSON.parse(k.data)}catch(z){throw console.error("Could not parse message into JSON:",k.data),console.error("From chunk:",k.raw),z}if(k.event=="error")throw new l.APIError(void 0,P.error,P.message,void 0);yield{event:k.event,data:P}}}R=!0}catch(k){if((0,o.isAbortError)(k))return;throw k}finally{R||v.abort()}}return new h(j,v,C)}static fromReadableStream(O,v,C){let x=!1;async function*I(){const R=new a.LineDecoder,k=(0,u.ReadableStreamToAsyncIterable)(O);for await(const P of k)for(const z of R.decode(P))yield z;for(const P of R.flush())yield P}async function*j(){if(x)throw new n.OpenAIError("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");x=!0;let R=!1;try{for await(const k of I())R||k&&(yield JSON.parse(k));R=!0}catch(k){if((0,o.isAbortError)(k))return;throw k}finally{R||v.abort()}}return new h(j,v,C)}[(e=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){const O=[],v=[],C=this.iterator(),x=I=>({next:()=>{if(I.length===0){const j=C.next();O.push(j),v.push(j)}return I.shift()}});return[new h(()=>x(O),this.controller,t.__classPrivateFieldGet(this,e,"f")),new h(()=>x(v),this.controller,t.__classPrivateFieldGet(this,e,"f"))]}toReadableStream(){const O=this;let v;return(0,i.makeReadableStream)({async start(){v=O[Symbol.asyncIterator]()},async pull(C){try{const{value:x,done:I}=await v.next();if(I)return C.close();const j=(0,f.encodeUTF8)(JSON.stringify(x)+`
315
+ `);C.enqueue(j)}catch(x){C.error(x)}},async cancel(){await v.return?.()}})}}Xo.Stream=h;async function*m(T,O){if(!T.body)throw O.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new n.OpenAIError("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new n.OpenAIError("Attempted to iterate over a response with no body");const v=new b,C=new a.LineDecoder,x=(0,u.ReadableStreamToAsyncIterable)(T.body);for await(const I of g(x))for(const j of C.decode(I)){const R=v.decode(j);R&&(yield R)}for(const I of C.flush()){const j=v.decode(I);j&&(yield j)}}async function*g(T){let O=new Uint8Array;for await(const v of T){if(v==null)continue;const C=v instanceof ArrayBuffer?new Uint8Array(v):typeof v=="string"?(0,f.encodeUTF8)(v):v;let x=new Uint8Array(O.length+C.length);x.set(O),x.set(C,O.length),O=x;let I;for(;(I=(0,a.findDoubleNewlineIndex)(O))!==-1;)yield O.slice(0,I),O=O.slice(I)}O.length>0&&(yield O)}class b{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(O){if(O.endsWith("\r")&&(O=O.substring(0,O.length-1)),!O){if(!this.event&&!this.data.length)return null;const I={event:this.event,data:this.data.join(`
316
+ `),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],I}if(this.chunks.push(O),O.startsWith(":"))return null;let[v,C,x]=E(O,":");return x.startsWith(" ")&&(x=x.substring(1)),v==="event"?this.event=x:v==="data"&&this.data.push(x),null}}function E(T,O){const v=T.indexOf(O);return v!==-1?[T.substring(0,v),O,T.substring(v+O.length)]:[T,"",""]}return Xo}var cT;function kw(){if(cT)return Rl;cT=1,Object.defineProperty(Rl,"__esModule",{value:!0}),Rl.defaultParseResponse=n,Rl.addRequestID=i;const e=Iw(),t=gm();async function n(a,u){const{response:o,requestLogID:f,retryOfRequestLogID:d,startTime:l}=u,h=await(async()=>{if(u.options.stream)return(0,t.loggerFor)(a).debug("response",o.status,o.url,o.headers,o.body),u.options.__streamClass?u.options.__streamClass.fromSSEResponse(o,u.controller,a):e.Stream.fromSSEResponse(o,u.controller,a);if(o.status===204)return null;if(u.options.__binaryResponse)return o;const g=o.headers.get("content-type")?.split(";")[0]?.trim();if(g?.includes("application/json")||g?.endsWith("+json")){const T=await o.json();return i(T,o)}return await o.text()})();return(0,t.loggerFor)(a).debug(`[${f}] response parsed`,(0,t.formatRequestDetails)({retryOfRequestLogID:d,url:o.url,status:o.status,body:h,durationMs:Date.now()-l})),h}function i(a,u){return!a||typeof a!="object"||Array.isArray(a)?a:Object.defineProperty(a,"_request_id",{value:u.headers.get("x-request-id"),enumerable:!1})}return Rl}var Nl={},lT;function Wb(){if(lT)return Nl;lT=1;var e;Object.defineProperty(Nl,"__esModule",{value:!0}),Nl.APIPromise=void 0;const t=ht(),n=kw();class i extends Promise{constructor(u,o,f=n.defaultParseResponse){super(d=>{d(null)}),this.responsePromise=o,this.parseResponse=f,e.set(this,void 0),t.__classPrivateFieldSet(this,e,u,"f")}_thenUnwrap(u){return new i(t.__classPrivateFieldGet(this,e,"f"),this.responsePromise,async(o,f)=>(0,n.addRequestID)(u(await this.parseResponse(o,f),f),f.response))}asResponse(){return this.responsePromise.then(u=>u.response)}async withResponse(){const[u,o]=await Promise.all([this.parse(),this.asResponse()]);return{data:u,response:o,request_id:o.headers.get("x-request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(u=>this.parseResponse(t.__classPrivateFieldGet(this,e,"f"),u))),this.parsedPromise}then(u,o){return this.parse().then(u,o)}catch(u){return this.parse().catch(u)}finally(u){return this.parse().finally(u)}}return Nl.APIPromise=i,e=new WeakMap,Nl}var uT;function sn(){if(uT)return Kr;uT=1;var e;Object.defineProperty(Kr,"__esModule",{value:!0}),Kr.ConversationCursorPage=Kr.CursorPage=Kr.Page=Kr.PagePromise=Kr.AbstractPage=void 0;const t=ht(),n=Rs(),i=kw(),a=Wb(),u=ba();class o{constructor(g,b,E,T){e.set(this,void 0),t.__classPrivateFieldSet(this,e,g,"f"),this.options=T,this.response=b,this.body=E}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){const g=this.nextPageRequestOptions();if(!g)throw new n.OpenAIError("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await t.__classPrivateFieldGet(this,e,"f").requestAPIList(this.constructor,g)}async*iterPages(){let g=this;for(yield g;g.hasNextPage();)g=await g.getNextPage(),yield g}async*[(e=new WeakMap,Symbol.asyncIterator)](){for await(const g of this.iterPages())for(const b of g.getPaginatedItems())yield b}}Kr.AbstractPage=o;class f extends a.APIPromise{constructor(g,b,E){super(g,b,async(T,O)=>new E(T,O.response,await(0,i.defaultParseResponse)(T,O),O.options))}async*[Symbol.asyncIterator](){const g=await this;for await(const b of g)yield b}}Kr.PagePromise=f;class d extends o{constructor(g,b,E,T){super(g,b,E,T),this.data=E.data||[],this.object=E.object}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){return null}}Kr.Page=d;class l extends o{constructor(g,b,E,T){super(g,b,E,T),this.data=E.data||[],this.has_more=E.has_more||!1}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){const g=this.getPaginatedItems(),b=g[g.length-1]?.id;return b?{...this.options,query:{...(0,u.maybeObj)(this.options.query),after:b}}:null}}Kr.CursorPage=l;class h extends o{constructor(g,b,E,T){super(g,b,E,T),this.data=E.data||[],this.has_more=E.has_more||!1,this.last_id=E.last_id||""}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){const g=this.last_id;return g?{...this.options,query:{...(0,u.maybeObj)(this.options.query),after:g}}:null}}return Kr.ConversationCursorPage=h,Kr}var Wg={},kh={},Xg={},dT;function Yi(){return dT||(dT=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createForm=e.multipartFormRequestOptions=e.maybeMultipartFormRequestOptions=e.isAsyncIterable=e.checkFileSupport=void 0,e.makeFile=i,e.getName=a;const t=Jh(),n=()=>{if(typeof File>"u"){const{process:T}=globalThis,O=typeof T?.versions?.node=="string"&&parseInt(T.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(O?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};e.checkFileSupport=n;function i(T,O,v){return(0,e.checkFileSupport)(),new File(T,O??"unknown_file",v)}function a(T){return(typeof T=="object"&&T!==null&&("name"in T&&T.name&&String(T.name)||"url"in T&&T.url&&String(T.url)||"filename"in T&&T.filename&&String(T.filename)||"path"in T&&T.path&&String(T.path))||"").split(/[\\/]/).pop()||void 0}const u=T=>T!=null&&typeof T=="object"&&typeof T[Symbol.asyncIterator]=="function";e.isAsyncIterable=u;const o=async(T,O)=>b(T.body)?{...T,body:await(0,e.createForm)(T.body,O)}:T;e.maybeMultipartFormRequestOptions=o;const f=async(T,O)=>({...T,body:await(0,e.createForm)(T.body,O)});e.multipartFormRequestOptions=f;const d=new WeakMap;function l(T){const O=typeof T=="function"?T:T.fetch,v=d.get(O);if(v)return v;const C=(async()=>{try{const x="Response"in O?O.Response:(await O("data:,")).constructor,I=new FormData;return I.toString()!==await new x(I).text()}catch{return!0}})();return d.set(O,C),C}const h=async(T,O)=>{if(!await l(O))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");const v=new FormData;return await Promise.all(Object.entries(T||{}).map(([C,x])=>E(v,C,x))),v};e.createForm=h;const m=T=>T instanceof Blob&&"name"in T,g=T=>typeof T=="object"&&T!==null&&(T instanceof Response||(0,e.isAsyncIterable)(T)||m(T)),b=T=>{if(g(T))return!0;if(Array.isArray(T))return T.some(b);if(T&&typeof T=="object"){for(const O in T)if(b(T[O]))return!0}return!1},E=async(T,O,v)=>{if(v!==void 0){if(v==null)throw new TypeError(`Received null for "${O}"; to pass null in FormData, you must use the string 'null'`);if(typeof v=="string"||typeof v=="number"||typeof v=="boolean")T.append(O,String(v));else if(v instanceof Response)T.append(O,i([await v.blob()],a(v)));else if((0,e.isAsyncIterable)(v))T.append(O,i([await new Response((0,t.ReadableStreamFrom)(v)).blob()],a(v)));else if(m(v))T.append(O,v,a(v));else if(Array.isArray(v))await Promise.all(v.map(C=>E(T,O+"[]",C)));else if(typeof v=="object")await Promise.all(Object.entries(v).map(([C,x])=>E(T,`${O}[${C}]`,x)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${v} instead`)}}})(Xg)),Xg}var fT;function nH(){if(fT)return kh;fT=1,Object.defineProperty(kh,"__esModule",{value:!0}),kh.toFile=u;const e=Yi(),t=Yi(),n=d=>d!=null&&typeof d=="object"&&typeof d.size=="number"&&typeof d.type=="string"&&typeof d.text=="function"&&typeof d.slice=="function"&&typeof d.arrayBuffer=="function",i=d=>d!=null&&typeof d=="object"&&typeof d.name=="string"&&typeof d.lastModified=="number"&&n(d),a=d=>d!=null&&typeof d=="object"&&typeof d.url=="string"&&typeof d.blob=="function";async function u(d,l,h){if((0,t.checkFileSupport)(),d=await d,i(d))return d instanceof File?d:(0,e.makeFile)([await d.arrayBuffer()],d.name);if(a(d)){const g=await d.blob();return l||(l=new URL(d.url).pathname.split(/[\\/]/).pop()),(0,e.makeFile)(await o(g),l,h)}const m=await o(d);if(l||(l=(0,e.getName)(d)),!h?.type){const g=m.find(b=>typeof b=="object"&&"type"in b&&b.type);typeof g=="string"&&(h={...h,type:g})}return(0,e.makeFile)(m,l,h)}async function o(d){let l=[];if(typeof d=="string"||ArrayBuffer.isView(d)||d instanceof ArrayBuffer)l.push(d);else if(n(d))l.push(d instanceof Blob?d:await d.arrayBuffer());else if((0,e.isAsyncIterable)(d))for await(const h of d)l.push(...await o(h));else{const h=d?.constructor?.name;throw new Error(`Unexpected data type: ${typeof d}${h?`; constructor: ${h}`:""}${f(d)}`)}return l}function f(d){return typeof d!="object"||d===null?"":`; props: [${Object.getOwnPropertyNames(d).map(h=>`"${h}"`).join(", ")}]`}return kh}var hT;function Mw(){return hT||(hT=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toFile=void 0;var t=nH();Object.defineProperty(e,"toFile",{enumerable:!0,get:function(){return t.toFile}})})(Wg)),Wg}var Qg={},Jg={},Il={},kl={},mT;function Xe(){if(mT)return kl;mT=1,Object.defineProperty(kl,"__esModule",{value:!0}),kl.APIResource=void 0;class e{constructor(n){this._client=n}}return kl.APIResource=e,kl}var e0={},Ml={},t0={},pT;function Dt(){return pT||(pT=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.path=e.createPathTagFunction=void 0,e.encodeURIPath=n;const t=Rs();function n(u){return u.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}const i=Object.freeze(Object.create(null)),a=(u=n)=>function(f,...d){if(f.length===1)return f[0];let l=!1;const h=[],m=f.reduce((T,O,v)=>{/[?#]/.test(O)&&(l=!0);const C=d[v];let x=(l?encodeURIComponent:u)(""+C);return v!==d.length&&(C==null||typeof C=="object"&&C.toString===Object.getPrototypeOf(Object.getPrototypeOf(C.hasOwnProperty??i)??i)?.toString)&&(x=C+"",h.push({start:T.length+O.length,length:x.length,error:`Value of type ${Object.prototype.toString.call(C).slice(8,-1)} is not a valid path parameter`})),T+O+(v===d.length?"":x)},""),g=m.split(/[?#]/,1)[0],b=new RegExp("(?<=^|\\/)(?:\\.|%2e){1,2}(?=\\/|$)","gi");let E;for(;(E=b.exec(g))!==null;)h.push({start:E.index,length:E[0].length,error:`Value "${E[0]}" can't be safely passed as a path parameter`});if(h.sort((T,O)=>T.start-O.start),h.length>0){let T=0;const O=h.reduce((v,C)=>{const x=" ".repeat(C.start-T),I="^".repeat(C.length);return T=C.start+C.length,v+x+I},"");throw new t.OpenAIError(`Path parameters result in path with invalid segments:
317
+ ${h.map(v=>v.error).join(`
318
+ `)}
319
+ ${m}
320
+ ${O}`)}return m};e.createPathTagFunction=a,e.path=(0,e.createPathTagFunction)(n)})(t0)),t0}var gT;function Y0(){if(gT)return Ml;gT=1,Object.defineProperty(Ml,"__esModule",{value:!0}),Ml.Messages=void 0;const e=Xe(),t=sn(),n=Dt();class i extends e.APIResource{list(u,o={},f){return this._client.getAPIList((0,n.path)`/chat/completions/${u}/messages`,t.CursorPage,{query:o,...f})}}return Ml.Messages=i,Ml}var Pl={},Dl={},n0={},bT;function vi(){return bT||(bT=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),ht().__exportStar(Rs(),e)})(n0)),n0}var br={},_T;function bm(){if(_T)return br;_T=1,Object.defineProperty(br,"__esModule",{value:!0}),br.isChatCompletionFunctionTool=t,br.makeParseableResponseFormat=n,br.makeParseableTextFormat=i,br.isAutoParsableResponseFormat=a,br.makeParseableTool=u,br.isAutoParsableTool=o,br.maybeParseChatCompletion=f,br.parseChatCompletion=d,br.shouldParseToolCall=m,br.hasAutoParseableInput=g,br.assertToolCallsAreChatCompletionFunctionToolCalls=b,br.validateInputTools=E;const e=vi();function t(T){return T!==void 0&&"function"in T&&T.function!==void 0}function n(T,O){const v={...T};return Object.defineProperties(v,{$brand:{value:"auto-parseable-response-format",enumerable:!1},$parseRaw:{value:O,enumerable:!1}}),v}function i(T,O){const v={...T};return Object.defineProperties(v,{$brand:{value:"auto-parseable-response-format",enumerable:!1},$parseRaw:{value:O,enumerable:!1}}),v}function a(T){return T?.$brand==="auto-parseable-response-format"}function u(T,{parser:O,callback:v}){const C={...T};return Object.defineProperties(C,{$brand:{value:"auto-parseable-tool",enumerable:!1},$parseRaw:{value:O,enumerable:!1},$callback:{value:v,enumerable:!1}}),C}function o(T){return T?.$brand==="auto-parseable-tool"}function f(T,O){return!O||!g(O)?{...T,choices:T.choices.map(v=>(b(v.message.tool_calls),{...v,message:{...v.message,parsed:null,...v.message.tool_calls?{tool_calls:v.message.tool_calls}:void 0}}))}:d(T,O)}function d(T,O){const v=T.choices.map(C=>{if(C.finish_reason==="length")throw new e.LengthFinishReasonError;if(C.finish_reason==="content_filter")throw new e.ContentFilterFinishReasonError;return b(C.message.tool_calls),{...C,message:{...C.message,...C.message.tool_calls?{tool_calls:C.message.tool_calls?.map(x=>h(O,x))??void 0}:void 0,parsed:C.message.content&&!C.message.refusal?l(O,C.message.content):null}}});return{...T,choices:v}}function l(T,O){return T.response_format?.type!=="json_schema"?null:T.response_format?.type==="json_schema"?"$parseRaw"in T.response_format?T.response_format.$parseRaw(O):JSON.parse(O):null}function h(T,O){const v=T.tools?.find(C=>t(C)&&C.function?.name===O.function.name);return{...O,function:{...O.function,parsed_arguments:o(v)?v.$parseRaw(O.function.arguments):v?.function.strict?JSON.parse(O.function.arguments):null}}}function m(T,O){if(!T||!("tools"in T)||!T.tools)return!1;const v=T.tools?.find(C=>t(C)&&C.function?.name===O.function.name);return t(v)&&(o(v)||v?.function.strict||!1)}function g(T){return a(T.response_format)?!0:T.tools?.some(O=>o(O)||O.type==="function"&&O.function.strict===!0)??!1}function b(T){for(const O of T||[])if(O.type!=="function")throw new e.OpenAIError(`Currently only \`function\` tool calls are supported; Received \`${O.type}\``)}function E(T){for(const O of T??[]){if(O.type!=="function")throw new e.OpenAIError(`Currently only \`function\` tool types support auto-parsing; Received \`${O.type}\``);if(O.function.strict!==!0)throw new e.OpenAIError(`The \`${O.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`)}}return br}var oa={},yT;function Pw(){if(yT)return oa;yT=1,Object.defineProperty(oa,"__esModule",{value:!0}),oa.isToolMessage=oa.isAssistantMessage=void 0,oa.isPresent=n;const e=i=>i?.role==="assistant";oa.isAssistantMessage=e;const t=i=>i?.role==="tool";oa.isToolMessage=t;function n(i){return i!=null}return oa}var jl={},ET;function Xb(){if(ET)return jl;ET=1;var e,t,n,i,a,u,o,f,d,l,h,m,g;Object.defineProperty(jl,"__esModule",{value:!0}),jl.EventStream=void 0;const b=ht(),E=vi();let T=class{constructor(){e.add(this),this.controller=new AbortController,t.set(this,void 0),n.set(this,()=>{}),i.set(this,()=>{}),a.set(this,void 0),u.set(this,()=>{}),o.set(this,()=>{}),f.set(this,{}),d.set(this,!1),l.set(this,!1),h.set(this,!1),m.set(this,!1),b.__classPrivateFieldSet(this,t,new Promise((v,C)=>{b.__classPrivateFieldSet(this,n,v,"f"),b.__classPrivateFieldSet(this,i,C,"f")}),"f"),b.__classPrivateFieldSet(this,a,new Promise((v,C)=>{b.__classPrivateFieldSet(this,u,v,"f"),b.__classPrivateFieldSet(this,o,C,"f")}),"f"),b.__classPrivateFieldGet(this,t,"f").catch(()=>{}),b.__classPrivateFieldGet(this,a,"f").catch(()=>{})}_run(v){setTimeout(()=>{v().then(()=>{this._emitFinal(),this._emit("end")},b.__classPrivateFieldGet(this,e,"m",g).bind(this))},0)}_connected(){this.ended||(b.__classPrivateFieldGet(this,n,"f").call(this),this._emit("connect"))}get ended(){return b.__classPrivateFieldGet(this,d,"f")}get errored(){return b.__classPrivateFieldGet(this,l,"f")}get aborted(){return b.__classPrivateFieldGet(this,h,"f")}abort(){this.controller.abort()}on(v,C){return(b.__classPrivateFieldGet(this,f,"f")[v]||(b.__classPrivateFieldGet(this,f,"f")[v]=[])).push({listener:C}),this}off(v,C){const x=b.__classPrivateFieldGet(this,f,"f")[v];if(!x)return this;const I=x.findIndex(j=>j.listener===C);return I>=0&&x.splice(I,1),this}once(v,C){return(b.__classPrivateFieldGet(this,f,"f")[v]||(b.__classPrivateFieldGet(this,f,"f")[v]=[])).push({listener:C,once:!0}),this}emitted(v){return new Promise((C,x)=>{b.__classPrivateFieldSet(this,m,!0,"f"),v!=="error"&&this.once("error",x),this.once(v,C)})}async done(){b.__classPrivateFieldSet(this,m,!0,"f"),await b.__classPrivateFieldGet(this,a,"f")}_emit(v,...C){if(b.__classPrivateFieldGet(this,d,"f"))return;v==="end"&&(b.__classPrivateFieldSet(this,d,!0,"f"),b.__classPrivateFieldGet(this,u,"f").call(this));const x=b.__classPrivateFieldGet(this,f,"f")[v];if(x&&(b.__classPrivateFieldGet(this,f,"f")[v]=x.filter(I=>!I.once),x.forEach(({listener:I})=>I(...C))),v==="abort"){const I=C[0];!b.__classPrivateFieldGet(this,m,"f")&&!x?.length&&Promise.reject(I),b.__classPrivateFieldGet(this,i,"f").call(this,I),b.__classPrivateFieldGet(this,o,"f").call(this,I),this._emit("end");return}if(v==="error"){const I=C[0];!b.__classPrivateFieldGet(this,m,"f")&&!x?.length&&Promise.reject(I),b.__classPrivateFieldGet(this,i,"f").call(this,I),b.__classPrivateFieldGet(this,o,"f").call(this,I),this._emit("end")}}_emitFinal(){}};return jl.EventStream=T,t=new WeakMap,n=new WeakMap,i=new WeakMap,a=new WeakMap,u=new WeakMap,o=new WeakMap,f=new WeakMap,d=new WeakMap,l=new WeakMap,h=new WeakMap,m=new WeakMap,e=new WeakSet,g=function(v){if(b.__classPrivateFieldSet(this,l,!0,"f"),v instanceof Error&&v.name==="AbortError"&&(v=new E.APIUserAbortError),v instanceof E.APIUserAbortError)return b.__classPrivateFieldSet(this,h,!0,"f"),this._emit("abort",v);if(v instanceof E.OpenAIError)return this._emit("error",v);if(v instanceof Error){const C=new E.OpenAIError(v.message);return C.cause=v,this._emit("error",C)}return this._emit("error",new E.OpenAIError(String(v)))},jl}var ec={},vT;function Dw(){if(vT)return ec;vT=1,Object.defineProperty(ec,"__esModule",{value:!0}),ec.ParsingToolFunction=void 0,ec.isRunnableFunctionWithParse=e;function e(n){return typeof n.parse=="function"}class t{constructor(i){this.type="function",this.function=i}}return ec.ParsingToolFunction=t,ec}var TT;function jw(){if(TT)return Dl;TT=1;var e,t,n,i,a,u,o,f;Object.defineProperty(Dl,"__esModule",{value:!0}),Dl.AbstractChatCompletionRunner=void 0;const d=ht(),l=vi(),h=bm(),m=Pw(),g=Xb(),b=Dw(),E=10;let T=class extends g.EventStream{constructor(){super(...arguments),e.add(this),this._chatCompletions=[],this.messages=[]}_addChatCompletion(v){this._chatCompletions.push(v),this._emit("chatCompletion",v);const C=v.choices[0]?.message;return C&&this._addMessage(C),v}_addMessage(v,C=!0){if("content"in v||(v.content=null),this.messages.push(v),C){if(this._emit("message",v),(0,m.isToolMessage)(v)&&v.content)this._emit("functionToolCallResult",v.content);else if((0,m.isAssistantMessage)(v)&&v.tool_calls)for(const x of v.tool_calls)x.type==="function"&&this._emit("functionToolCall",x.function)}}async finalChatCompletion(){await this.done();const v=this._chatCompletions[this._chatCompletions.length-1];if(!v)throw new l.OpenAIError("stream ended without producing a ChatCompletion");return v}async finalContent(){return await this.done(),d.__classPrivateFieldGet(this,e,"m",t).call(this)}async finalMessage(){return await this.done(),d.__classPrivateFieldGet(this,e,"m",n).call(this)}async finalFunctionToolCall(){return await this.done(),d.__classPrivateFieldGet(this,e,"m",i).call(this)}async finalFunctionToolCallResult(){return await this.done(),d.__classPrivateFieldGet(this,e,"m",a).call(this)}async totalUsage(){return await this.done(),d.__classPrivateFieldGet(this,e,"m",u).call(this)}allChatCompletions(){return[...this._chatCompletions]}_emitFinal(){const v=this._chatCompletions[this._chatCompletions.length-1];v&&this._emit("finalChatCompletion",v);const C=d.__classPrivateFieldGet(this,e,"m",n).call(this);C&&this._emit("finalMessage",C);const x=d.__classPrivateFieldGet(this,e,"m",t).call(this);x&&this._emit("finalContent",x);const I=d.__classPrivateFieldGet(this,e,"m",i).call(this);I&&this._emit("finalFunctionToolCall",I);const j=d.__classPrivateFieldGet(this,e,"m",a).call(this);j!=null&&this._emit("finalFunctionToolCallResult",j),this._chatCompletions.some(R=>R.usage)&&this._emit("totalUsage",d.__classPrivateFieldGet(this,e,"m",u).call(this))}async _createChatCompletion(v,C,x){const I=x?.signal;I&&(I.aborted&&this.controller.abort(),I.addEventListener("abort",()=>this.controller.abort())),d.__classPrivateFieldGet(this,e,"m",o).call(this,C);const j=await v.chat.completions.create({...C,stream:!1},{...x,signal:this.controller.signal});return this._connected(),this._addChatCompletion((0,h.parseChatCompletion)(j,C))}async _runChatCompletion(v,C,x){for(const I of C.messages)this._addMessage(I,!1);return await this._createChatCompletion(v,C,x)}async _runTools(v,C,x){const I="tool",{tool_choice:j="auto",stream:R,...k}=C,P=typeof j!="string"&&j.type==="function"&&j?.function?.name,{maxChatCompletions:z=E}=x||{},L=C.tools.map(K=>{if((0,h.isAutoParsableTool)(K)){if(!K.$callback)throw new l.OpenAIError("Tool given to `.runTools()` that does not have an associated function");return{type:"function",function:{function:K.$callback,name:K.function.name,description:K.function.description||"",parameters:K.function.parameters,parse:K.$parseRaw,strict:!0}}}return K}),G={};for(const K of L)K.type==="function"&&(G[K.function.name||K.function.function.name]=K.function);const F="tools"in C?L.map(K=>K.type==="function"?{type:"function",function:{name:K.function.name||K.function.function.name,parameters:K.function.parameters,description:K.function.description,strict:K.function.strict}}:K):void 0;for(const K of C.messages)this._addMessage(K,!1);for(let K=0;K<z;++K){const Z=(await this._createChatCompletion(v,{...k,tool_choice:j,tools:F,messages:[...this.messages]},x)).choices[0]?.message;if(!Z)throw new l.OpenAIError("missing message in ChatCompletion response");if(!Z.tool_calls?.length)return;for(const U of Z.tool_calls){if(U.type!=="function")continue;const Y=U.id,{name:W,arguments:pe}=U.function,N=G[W];if(N){if(P&&P!==W){const ie=`Invalid tool_call: ${JSON.stringify(W)}. ${JSON.stringify(P)} requested. Please try again`;this._addMessage({role:I,tool_call_id:Y,content:ie});continue}}else{const ie=`Invalid tool_call: ${JSON.stringify(W)}. Available options are: ${Object.keys(G).map(ae=>JSON.stringify(ae)).join(", ")}. Please try again`;this._addMessage({role:I,tool_call_id:Y,content:ie});continue}let M;try{M=(0,b.isRunnableFunctionWithParse)(N)?await N.parse(pe):pe}catch(ie){const ae=ie instanceof Error?ie.message:String(ie);this._addMessage({role:I,tool_call_id:Y,content:ae});continue}const q=await N.function(M,this),D=d.__classPrivateFieldGet(this,e,"m",f).call(this,q);if(this._addMessage({role:I,tool_call_id:Y,content:D}),P)return}}}};return Dl.AbstractChatCompletionRunner=T,e=new WeakSet,t=function(){return d.__classPrivateFieldGet(this,e,"m",n).call(this).content??null},n=function(){let v=this.messages.length;for(;v-- >0;){const C=this.messages[v];if((0,m.isAssistantMessage)(C))return{...C,content:C.content??null,refusal:C.refusal??null}}throw new l.OpenAIError("stream ended without producing a ChatCompletionMessage with role=assistant")},i=function(){for(let v=this.messages.length-1;v>=0;v--){const C=this.messages[v];if((0,m.isAssistantMessage)(C)&&C?.tool_calls?.length)return C.tool_calls.filter(x=>x.type==="function").at(-1)?.function}},a=function(){for(let v=this.messages.length-1;v>=0;v--){const C=this.messages[v];if((0,m.isToolMessage)(C)&&C.content!=null&&typeof C.content=="string"&&this.messages.some(x=>x.role==="assistant"&&x.tool_calls?.some(I=>I.type==="function"&&I.id===C.tool_call_id)))return C.content}},u=function(){const v={completion_tokens:0,prompt_tokens:0,total_tokens:0};for(const{usage:C}of this._chatCompletions)C&&(v.completion_tokens+=C.completion_tokens,v.prompt_tokens+=C.prompt_tokens,v.total_tokens+=C.total_tokens);return v},o=function(v){if(v.n!=null&&v.n>1)throw new l.OpenAIError("ChatCompletion convenience helpers only support n=1 at this time. To use n>1, please use chat.completions.create() directly.")},f=function(v){return typeof v=="string"?v:v===void 0?"undefined":JSON.stringify(v)},Dl}var AT;function OT(){if(AT)return Pl;AT=1,Object.defineProperty(Pl,"__esModule",{value:!0}),Pl.ChatCompletionRunner=void 0;const e=jw(),t=Pw();let n=class Lw extends e.AbstractChatCompletionRunner{static runTools(a,u,o){const f=new Lw,d={...o,headers:{...o?.headers,"X-Stainless-Helper-Method":"runTools"}};return f._run(()=>f._runTools(a,u,d)),f}_addMessage(a,u=!0){super._addMessage(a,u),(0,t.isAssistantMessage)(a)&&a.content&&this._emit("content",a.content)}};return Pl.ChatCompletionRunner=n,Pl}var Ll={},Hl={},_s={},ST;function rH(){if(ST)return _s;ST=1,Object.defineProperty(_s,"__esModule",{value:!0}),_s.MalformedJSON=_s.PartialJSON=_s.partialParse=void 0;const e=1,t=2,n=4,i=8,a=16,u=32,o=64,f=128,d=256,l=f|d,h=a|u|l|o,m=e|t|h,g=n|i,b=m|g,E={STR:e,NUM:t,ARR:n,OBJ:i,NULL:a,BOOL:u,NAN:o,INFINITY:f,MINUS_INFINITY:d,INF:l,SPECIAL:h,ATOM:m,COLLECTION:g,ALL:b};class T extends Error{}_s.PartialJSON=T;class O extends Error{}_s.MalformedJSON=O;function v(I,j=E.ALL){if(typeof I!="string")throw new TypeError(`expecting str, got ${typeof I}`);if(!I.trim())throw new Error(`${I} is empty`);return C(I.trim(),j)}const C=(I,j)=>{const R=I.length;let k=0;const P=U=>{throw new T(`${U} at position ${k}`)},z=U=>{throw new O(`${U} at position ${k}`)},L=()=>(Z(),k>=R&&P("Unexpected end of input"),I[k]==='"'?G():I[k]==="{"?F():I[k]==="["?K():I.substring(k,k+4)==="null"||E.NULL&j&&R-k<4&&"null".startsWith(I.substring(k))?(k+=4,null):I.substring(k,k+4)==="true"||E.BOOL&j&&R-k<4&&"true".startsWith(I.substring(k))?(k+=4,!0):I.substring(k,k+5)==="false"||E.BOOL&j&&R-k<5&&"false".startsWith(I.substring(k))?(k+=5,!1):I.substring(k,k+8)==="Infinity"||E.INFINITY&j&&R-k<8&&"Infinity".startsWith(I.substring(k))?(k+=8,1/0):I.substring(k,k+9)==="-Infinity"||E.MINUS_INFINITY&j&&1<R-k&&R-k<9&&"-Infinity".startsWith(I.substring(k))?(k+=9,-1/0):I.substring(k,k+3)==="NaN"||E.NAN&j&&R-k<3&&"NaN".startsWith(I.substring(k))?(k+=3,NaN):B()),G=()=>{const U=k;let Y=!1;for(k++;k<R&&(I[k]!=='"'||Y&&I[k-1]==="\\");)Y=I[k]==="\\"?!Y:!1,k++;if(I.charAt(k)=='"')try{return JSON.parse(I.substring(U,++k-Number(Y)))}catch(W){z(String(W))}else if(E.STR&j)try{return JSON.parse(I.substring(U,k-Number(Y))+'"')}catch{return JSON.parse(I.substring(U,I.lastIndexOf("\\"))+'"')}P("Unterminated string literal")},F=()=>{k++,Z();const U={};try{for(;I[k]!=="}";){if(Z(),k>=R&&E.OBJ&j)return U;const Y=G();Z(),k++;try{const W=L();Object.defineProperty(U,Y,{value:W,writable:!0,enumerable:!0,configurable:!0})}catch(W){if(E.OBJ&j)return U;throw W}Z(),I[k]===","&&k++}}catch{if(E.OBJ&j)return U;P("Expected '}' at end of object")}return k++,U},K=()=>{k++;const U=[];try{for(;I[k]!=="]";)U.push(L()),Z(),I[k]===","&&k++}catch{if(E.ARR&j)return U;P("Expected ']' at end of array")}return k++,U},B=()=>{if(k===0){I==="-"&&E.NUM&j&&P("Not sure what '-' is");try{return JSON.parse(I)}catch(Y){if(E.NUM&j)try{return I[I.length-1]==="."?JSON.parse(I.substring(0,I.lastIndexOf("."))):JSON.parse(I.substring(0,I.lastIndexOf("e")))}catch{}z(String(Y))}}const U=k;for(I[k]==="-"&&k++;I[k]&&!",]}".includes(I[k]);)k++;k==R&&!(E.NUM&j)&&P("Unterminated number literal");try{return JSON.parse(I.substring(U,k))}catch{I.substring(U,k)==="-"&&E.NUM&j&&P("Not sure what '-' is");try{return JSON.parse(I.substring(U,I.lastIndexOf("e")))}catch(W){z(String(W))}}},Z=()=>{for(;k<R&&`
321
+ \r `.includes(I[k]);)k++};return L()},x=I=>v(I,E.ALL^E.NUM);return _s.partialParse=x,_s}var r0={},CT;function Hw(){return CT||(CT=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),ht().__exportStar(Iw(),e)})(r0)),r0}var xT;function Z0(){if(xT)return Hl;xT=1;var e,t,n,i,a,u,o,f,d,l,h,m;Object.defineProperty(Hl,"__esModule",{value:!0}),Hl.ChatCompletionStream=void 0;const g=ht(),b=rH(),E=vi(),T=bm(),O=Hw(),v=jw();let C=class V0 extends v.AbstractChatCompletionRunner{constructor(k){super(),e.add(this),t.set(this,void 0),n.set(this,void 0),i.set(this,void 0),g.__classPrivateFieldSet(this,t,k,"f"),g.__classPrivateFieldSet(this,n,[],"f")}get currentChatCompletionSnapshot(){return g.__classPrivateFieldGet(this,i,"f")}static fromReadableStream(k){const P=new V0(null);return P._run(()=>P._fromReadableStream(k)),P}static createChatCompletion(k,P,z){const L=new V0(P);return L._run(()=>L._runChatCompletion(k,{...P,stream:!0},{...z,headers:{...z?.headers,"X-Stainless-Helper-Method":"stream"}})),L}async _createChatCompletion(k,P,z){super._createChatCompletion;const L=z?.signal;L&&(L.aborted&&this.controller.abort(),L.addEventListener("abort",()=>this.controller.abort())),g.__classPrivateFieldGet(this,e,"m",a).call(this);const G=await k.chat.completions.create({...P,stream:!0},{...z,signal:this.controller.signal});this._connected();for await(const F of G)g.__classPrivateFieldGet(this,e,"m",o).call(this,F);if(G.controller.signal?.aborted)throw new E.APIUserAbortError;return this._addChatCompletion(g.__classPrivateFieldGet(this,e,"m",l).call(this))}async _fromReadableStream(k,P){const z=P?.signal;z&&(z.aborted&&this.controller.abort(),z.addEventListener("abort",()=>this.controller.abort())),g.__classPrivateFieldGet(this,e,"m",a).call(this),this._connected();const L=O.Stream.fromReadableStream(k,this.controller);let G;for await(const F of L)G&&G!==F.id&&this._addChatCompletion(g.__classPrivateFieldGet(this,e,"m",l).call(this)),g.__classPrivateFieldGet(this,e,"m",o).call(this,F),G=F.id;if(L.controller.signal?.aborted)throw new E.APIUserAbortError;return this._addChatCompletion(g.__classPrivateFieldGet(this,e,"m",l).call(this))}[(t=new WeakMap,n=new WeakMap,i=new WeakMap,e=new WeakSet,a=function(){this.ended||g.__classPrivateFieldSet(this,i,void 0,"f")},u=function(P){let z=g.__classPrivateFieldGet(this,n,"f")[P.index];return z||(z={content_done:!1,refusal_done:!1,logprobs_content_done:!1,logprobs_refusal_done:!1,done_tool_calls:new Set,current_tool_call_index:null},g.__classPrivateFieldGet(this,n,"f")[P.index]=z,z)},o=function(P){if(this.ended)return;const z=g.__classPrivateFieldGet(this,e,"m",m).call(this,P);this._emit("chunk",P,z);for(const L of P.choices){const G=z.choices[L.index];L.delta.content!=null&&G.message?.role==="assistant"&&G.message?.content&&(this._emit("content",L.delta.content,G.message.content),this._emit("content.delta",{delta:L.delta.content,snapshot:G.message.content,parsed:G.message.parsed})),L.delta.refusal!=null&&G.message?.role==="assistant"&&G.message?.refusal&&this._emit("refusal.delta",{delta:L.delta.refusal,snapshot:G.message.refusal}),L.logprobs?.content!=null&&G.message?.role==="assistant"&&this._emit("logprobs.content.delta",{content:L.logprobs?.content,snapshot:G.logprobs?.content??[]}),L.logprobs?.refusal!=null&&G.message?.role==="assistant"&&this._emit("logprobs.refusal.delta",{refusal:L.logprobs?.refusal,snapshot:G.logprobs?.refusal??[]});const F=g.__classPrivateFieldGet(this,e,"m",u).call(this,G);G.finish_reason&&(g.__classPrivateFieldGet(this,e,"m",d).call(this,G),F.current_tool_call_index!=null&&g.__classPrivateFieldGet(this,e,"m",f).call(this,G,F.current_tool_call_index));for(const K of L.delta.tool_calls??[])F.current_tool_call_index!==K.index&&(g.__classPrivateFieldGet(this,e,"m",d).call(this,G),F.current_tool_call_index!=null&&g.__classPrivateFieldGet(this,e,"m",f).call(this,G,F.current_tool_call_index)),F.current_tool_call_index=K.index;for(const K of L.delta.tool_calls??[]){const B=G.message.tool_calls?.[K.index];B?.type&&(B?.type==="function"?this._emit("tool_calls.function.arguments.delta",{name:B.function?.name,index:K.index,arguments:B.function.arguments,parsed_arguments:B.function.parsed_arguments,arguments_delta:K.function?.arguments??""}):(B?.type,void 0))}}},f=function(P,z){if(g.__classPrivateFieldGet(this,e,"m",u).call(this,P).done_tool_calls.has(z))return;const G=P.message.tool_calls?.[z];if(!G)throw new Error("no tool call snapshot");if(!G.type)throw new Error("tool call snapshot missing `type`");if(G.type==="function"){const F=g.__classPrivateFieldGet(this,t,"f")?.tools?.find(K=>(0,T.isChatCompletionFunctionTool)(K)&&K.function.name===G.function.name);this._emit("tool_calls.function.arguments.done",{name:G.function.name,index:z,arguments:G.function.arguments,parsed_arguments:(0,T.isAutoParsableTool)(F)?F.$parseRaw(G.function.arguments):F?.function.strict?JSON.parse(G.function.arguments):null})}else G.type},d=function(P){const z=g.__classPrivateFieldGet(this,e,"m",u).call(this,P);if(P.message.content&&!z.content_done){z.content_done=!0;const L=g.__classPrivateFieldGet(this,e,"m",h).call(this);this._emit("content.done",{content:P.message.content,parsed:L?L.$parseRaw(P.message.content):null})}P.message.refusal&&!z.refusal_done&&(z.refusal_done=!0,this._emit("refusal.done",{refusal:P.message.refusal})),P.logprobs?.content&&!z.logprobs_content_done&&(z.logprobs_content_done=!0,this._emit("logprobs.content.done",{content:P.logprobs.content})),P.logprobs?.refusal&&!z.logprobs_refusal_done&&(z.logprobs_refusal_done=!0,this._emit("logprobs.refusal.done",{refusal:P.logprobs.refusal}))},l=function(){if(this.ended)throw new E.OpenAIError("stream has ended, this shouldn't happen");const P=g.__classPrivateFieldGet(this,i,"f");if(!P)throw new E.OpenAIError("request ended without sending any chunks");return g.__classPrivateFieldSet(this,i,void 0,"f"),g.__classPrivateFieldSet(this,n,[],"f"),x(P,g.__classPrivateFieldGet(this,t,"f"))},h=function(){const P=g.__classPrivateFieldGet(this,t,"f")?.response_format;return(0,T.isAutoParsableResponseFormat)(P)?P:null},m=function(P){var z,L,G,F;let K=g.__classPrivateFieldGet(this,i,"f");const{choices:B,...Z}=P;K?Object.assign(K,Z):K=g.__classPrivateFieldSet(this,i,{...Z,choices:[]},"f");for(const{delta:U,finish_reason:Y,index:W,logprobs:pe=null,...N}of P.choices){let M=K.choices[W];if(M||(M=K.choices[W]={finish_reason:Y,index:W,message:{},logprobs:pe,...N}),pe)if(!M.logprobs)M.logprobs=Object.assign({},pe);else{const{content:de,refusal:le,...Pe}=pe;Object.assign(M.logprobs,Pe),de&&((z=M.logprobs).content??(z.content=[]),M.logprobs.content.push(...de)),le&&((L=M.logprobs).refusal??(L.refusal=[]),M.logprobs.refusal.push(...le))}if(Y&&(M.finish_reason=Y,g.__classPrivateFieldGet(this,t,"f")&&(0,T.hasAutoParseableInput)(g.__classPrivateFieldGet(this,t,"f")))){if(Y==="length")throw new E.LengthFinishReasonError;if(Y==="content_filter")throw new E.ContentFilterFinishReasonError}if(Object.assign(M,N),!U)continue;const{content:q,refusal:D,function_call:ie,role:ae,tool_calls:fe,...Ee}=U;if(Object.assign(M.message,Ee),D&&(M.message.refusal=(M.message.refusal||"")+D),ae&&(M.message.role=ae),ie&&(M.message.function_call?(ie.name&&(M.message.function_call.name=ie.name),ie.arguments&&((G=M.message.function_call).arguments??(G.arguments=""),M.message.function_call.arguments+=ie.arguments)):M.message.function_call=ie),q&&(M.message.content=(M.message.content||"")+q,!M.message.refusal&&g.__classPrivateFieldGet(this,e,"m",h).call(this)&&(M.message.parsed=(0,b.partialParse)(M.message.content))),fe){M.message.tool_calls||(M.message.tool_calls=[]);for(const{index:de,id:le,type:Pe,function:re,...Ae}of fe){const Ce=(F=M.message.tool_calls)[de]??(F[de]={});Object.assign(Ce,Ae),le&&(Ce.id=le),Pe&&(Ce.type=Pe),re&&(Ce.function??(Ce.function={name:re.name??"",arguments:""})),re?.name&&(Ce.function.name=re.name),re?.arguments&&(Ce.function.arguments+=re.arguments,(0,T.shouldParseToolCall)(g.__classPrivateFieldGet(this,t,"f"),Ce)&&(Ce.function.parsed_arguments=(0,b.partialParse)(Ce.function.arguments)))}}}return K},Symbol.asyncIterator)](){const k=[],P=[];let z=!1;return this.on("chunk",L=>{const G=P.shift();G?G.resolve(L):k.push(L)}),this.on("end",()=>{z=!0;for(const L of P)L.resolve(void 0);P.length=0}),this.on("abort",L=>{z=!0;for(const G of P)G.reject(L);P.length=0}),this.on("error",L=>{z=!0;for(const G of P)G.reject(L);P.length=0}),{next:async()=>k.length?{value:k.shift(),done:!1}:z?{value:void 0,done:!0}:new Promise((G,F)=>P.push({resolve:G,reject:F})).then(G=>G?{value:G,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new O.Stream(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}};Hl.ChatCompletionStream=C;function x(R,k){const{id:P,choices:z,created:L,model:G,system_fingerprint:F,...K}=R,B={...K,id:P,choices:z.map(({message:Z,finish_reason:U,index:Y,logprobs:W,...pe})=>{if(!U)throw new E.OpenAIError(`missing finish_reason for choice ${Y}`);const{content:N=null,function_call:M,tool_calls:q,...D}=Z,ie=Z.role;if(!ie)throw new E.OpenAIError(`missing role for choice ${Y}`);if(M){const{arguments:ae,name:fe}=M;if(ae==null)throw new E.OpenAIError(`missing function_call.arguments for choice ${Y}`);if(!fe)throw new E.OpenAIError(`missing function_call.name for choice ${Y}`);return{...pe,message:{content:N,function_call:{arguments:ae,name:fe},role:ie,refusal:Z.refusal??null},finish_reason:U,index:Y,logprobs:W}}return q?{...pe,index:Y,finish_reason:U,logprobs:W,message:{...D,role:ie,content:N,refusal:Z.refusal??null,tool_calls:q.map((ae,fe)=>{const{function:Ee,type:de,id:le,...Pe}=ae,{arguments:re,name:Ae,...Ce}=Ee||{};if(le==null)throw new E.OpenAIError(`missing choices[${Y}].tool_calls[${fe}].id
322
+ ${I(R)}`);if(de==null)throw new E.OpenAIError(`missing choices[${Y}].tool_calls[${fe}].type
323
+ ${I(R)}`);if(Ae==null)throw new E.OpenAIError(`missing choices[${Y}].tool_calls[${fe}].function.name
324
+ ${I(R)}`);if(re==null)throw new E.OpenAIError(`missing choices[${Y}].tool_calls[${fe}].function.arguments
325
+ ${I(R)}`);return{...Pe,id:le,type:de,function:{...Ce,name:Ae,arguments:re}}})}}:{...pe,message:{...D,content:N,role:ie,refusal:Z.refusal??null},finish_reason:U,index:Y,logprobs:W}}),created:L,model:G,object:"chat.completion",...F?{system_fingerprint:F}:{}};return(0,T.maybeParseChatCompletion)(B,k)}function I(R){return JSON.stringify(R)}function j(R){}return Hl}var wT;function RT(){if(wT)return Ll;wT=1,Object.defineProperty(Ll,"__esModule",{value:!0}),Ll.ChatCompletionStreamingRunner=void 0;const e=Z0();let t=class W0 extends e.ChatCompletionStream{static fromReadableStream(i){const a=new W0(null);return a._run(()=>a._fromReadableStream(i)),a}static runTools(i,a,u){const o=new W0(a),f={...u,headers:{...u?.headers,"X-Stainless-Helper-Method":"runTools"}};return o._run(()=>o._runTools(i,a,f)),o}};return Ll.ChatCompletionStreamingRunner=t,Ll}var NT;function em(){return NT||(NT=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ChatCompletionRunner=e.ChatCompletionStream=e.ParsingToolFunction=e.ChatCompletionStreamingRunner=e.Completions=void 0;const t=ht(),n=Xe(),i=t.__importStar(Y0()),a=Y0(),u=sn(),o=Dt(),f=OT(),d=RT(),l=Z0(),h=bm();class m extends n.APIResource{constructor(){super(...arguments),this.messages=new i.Messages(this._client)}create(v,C){return this._client.post("/chat/completions",{body:v,...C,stream:v.stream??!1})}retrieve(v,C){return this._client.get((0,o.path)`/chat/completions/${v}`,C)}update(v,C,x){return this._client.post((0,o.path)`/chat/completions/${v}`,{body:C,...x})}list(v={},C){return this._client.getAPIList("/chat/completions",u.CursorPage,{query:v,...C})}delete(v,C){return this._client.delete((0,o.path)`/chat/completions/${v}`,C)}parse(v,C){return(0,h.validateInputTools)(v.tools),this._client.chat.completions.create(v,{...C,headers:{...C?.headers,"X-Stainless-Helper-Method":"chat.completions.parse"}})._thenUnwrap(x=>(0,h.parseChatCompletion)(x,v))}runTools(v,C){return v.stream?d.ChatCompletionStreamingRunner.runTools(this._client,v,C):f.ChatCompletionRunner.runTools(this._client,v,C)}stream(v,C){return l.ChatCompletionStream.createChatCompletion(this._client,v,C)}}e.Completions=m;var g=RT();Object.defineProperty(e,"ChatCompletionStreamingRunner",{enumerable:!0,get:function(){return g.ChatCompletionStreamingRunner}});var b=Dw();Object.defineProperty(e,"ParsingToolFunction",{enumerable:!0,get:function(){return b.ParsingToolFunction}});var E=Z0();Object.defineProperty(e,"ChatCompletionStream",{enumerable:!0,get:function(){return E.ChatCompletionStream}});var T=OT();Object.defineProperty(e,"ChatCompletionRunner",{enumerable:!0,get:function(){return T.ChatCompletionRunner}}),m.Messages=a.Messages})(e0)),e0}var IT;function Bw(){if(IT)return Il;IT=1,Object.defineProperty(Il,"__esModule",{value:!0}),Il.Chat=void 0;const e=ht(),t=Xe(),n=e.__importStar(em()),i=em();class a extends t.APIResource{constructor(){super(...arguments),this.completions=new n.Completions(this._client)}}return Il.Chat=a,a.Completions=i.Completions,Il}var i0={},kT;function iH(){return kT||(kT=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Messages=e.Completions=void 0;const t=ht();var n=em();Object.defineProperty(e,"Completions",{enumerable:!0,get:function(){return n.Completions}}),t.__exportStar(em(),e);var i=Y0();Object.defineProperty(e,"Messages",{enumerable:!0,get:function(){return i.Messages}})})(i0)),i0}var MT;function sH(){return MT||(MT=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Completions=e.Chat=void 0;var t=Bw();Object.defineProperty(e,"Chat",{enumerable:!0,get:function(){return t.Chat}});var n=iH();Object.defineProperty(e,"Completions",{enumerable:!0,get:function(){return n.Completions}})})(Jg)),Jg}var s0={},PT;function aH(){return PT||(PT=1,Object.defineProperty(s0,"__esModule",{value:!0})),s0}var Bl={},Ul={},$a={},DT;function bn(){if(DT)return $a;DT=1,Object.defineProperty($a,"__esModule",{value:!0}),$a.isEmptyHeaders=$a.buildHeaders=void 0;const e=ba(),t=Symbol("brand.privateNullableHeaders");function*n(u){if(!u)return;if(t in u){const{values:d,nulls:l}=u;yield*d.entries();for(const h of l)yield[h,null];return}let o=!1,f;u instanceof Headers?f=u.entries():(0,e.isReadonlyArray)(u)?f=u:(o=!0,f=Object.entries(u??{}));for(let d of f){const l=d[0];if(typeof l!="string")throw new TypeError("expected header name to be a string");const h=(0,e.isReadonlyArray)(d[1])?d[1]:[d[1]];let m=!1;for(const g of h)g!==void 0&&(o&&!m&&(m=!0,yield[l,null]),yield[l,g])}}const i=u=>{const o=new Headers,f=new Set;for(const d of u){const l=new Set;for(const[h,m]of n(d)){const g=h.toLowerCase();l.has(g)||(o.delete(h),l.add(g)),m===null?(o.delete(h),f.add(g)):(o.append(h,m),f.delete(g))}}return{[t]:!0,values:o,nulls:f}};$a.buildHeaders=i;const a=u=>{for(const o of n(u))return!1;return!0};return $a.isEmptyHeaders=a,$a}var jT;function LT(){if(jT)return Ul;jT=1,Object.defineProperty(Ul,"__esModule",{value:!0}),Ul.Speech=void 0;const e=Xe(),t=bn();class n extends e.APIResource{create(a,u){return this._client.post("/audio/speech",{body:a,...u,headers:(0,t.buildHeaders)([{Accept:"application/octet-stream"},u?.headers]),__binaryResponse:!0})}}return Ul.Speech=n,Ul}var Fl={},HT;function BT(){if(HT)return Fl;HT=1,Object.defineProperty(Fl,"__esModule",{value:!0}),Fl.Transcriptions=void 0;const e=Xe(),t=Yi();class n extends e.APIResource{create(a,u){return this._client.post("/audio/transcriptions",(0,t.multipartFormRequestOptions)({body:a,...u,stream:a.stream??!1,__metadata:{model:a.model}},this._client))}}return Fl.Transcriptions=n,Fl}var zl={},UT;function FT(){if(UT)return zl;UT=1,Object.defineProperty(zl,"__esModule",{value:!0}),zl.Translations=void 0;const e=Xe(),t=Yi();class n extends e.APIResource{create(a,u){return this._client.post("/audio/translations",(0,t.multipartFormRequestOptions)({body:a,...u,__metadata:{model:a.model}},this._client))}}return zl.Translations=n,zl}var zT;function Uw(){if(zT)return Bl;zT=1,Object.defineProperty(Bl,"__esModule",{value:!0}),Bl.Audio=void 0;const e=ht(),t=Xe(),n=e.__importStar(LT()),i=LT(),a=e.__importStar(BT()),u=BT(),o=e.__importStar(FT()),f=FT();class d extends t.APIResource{constructor(){super(...arguments),this.transcriptions=new a.Transcriptions(this._client),this.translations=new o.Translations(this._client),this.speech=new n.Speech(this._client)}}return Bl.Audio=d,d.Transcriptions=u.Transcriptions,d.Translations=f.Translations,d.Speech=i.Speech,Bl}var $l={},$T;function Fw(){if($T)return $l;$T=1,Object.defineProperty($l,"__esModule",{value:!0}),$l.Batches=void 0;const e=Xe(),t=sn(),n=Dt();class i extends e.APIResource{create(u,o){return this._client.post("/batches",{body:u,...o})}retrieve(u,o){return this._client.get((0,n.path)`/batches/${u}`,o)}list(u={},o){return this._client.getAPIList("/batches",t.CursorPage,{query:u,...o})}cancel(u,o){return this._client.post((0,n.path)`/batches/${u}/cancel`,o)}}return $l.Batches=i,$l}var ql={},Gl={},qT;function GT(){if(qT)return Gl;qT=1,Object.defineProperty(Gl,"__esModule",{value:!0}),Gl.Assistants=void 0;const e=Xe(),t=sn(),n=bn(),i=Dt();class a extends e.APIResource{create(o,f){return this._client.post("/assistants",{body:o,...f,headers:(0,n.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},f?.headers])})}retrieve(o,f){return this._client.get((0,i.path)`/assistants/${o}`,{...f,headers:(0,n.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},f?.headers])})}update(o,f,d){return this._client.post((0,i.path)`/assistants/${o}`,{body:f,...d,headers:(0,n.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},d?.headers])})}list(o={},f){return this._client.getAPIList("/assistants",t.CursorPage,{query:o,...f,headers:(0,n.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},f?.headers])})}delete(o,f){return this._client.delete((0,i.path)`/assistants/${o}`,{...f,headers:(0,n.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},f?.headers])})}}return Gl.Assistants=a,Gl}var Kl={},Yl={},KT;function YT(){if(KT)return Yl;KT=1,Object.defineProperty(Yl,"__esModule",{value:!0}),Yl.Sessions=void 0;const e=Xe(),t=bn();class n extends e.APIResource{create(a,u){return this._client.post("/realtime/sessions",{body:a,...u,headers:(0,t.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},u?.headers])})}}return Yl.Sessions=n,Yl}var Vl={},VT;function ZT(){if(VT)return Vl;VT=1,Object.defineProperty(Vl,"__esModule",{value:!0}),Vl.TranscriptionSessions=void 0;const e=Xe(),t=bn();class n extends e.APIResource{create(a,u){return this._client.post("/realtime/transcription_sessions",{body:a,...u,headers:(0,t.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},u?.headers])})}}return Vl.TranscriptionSessions=n,Vl}var WT;function XT(){if(WT)return Kl;WT=1,Object.defineProperty(Kl,"__esModule",{value:!0}),Kl.Realtime=void 0;const e=ht(),t=Xe(),n=e.__importStar(YT()),i=YT(),a=e.__importStar(ZT()),u=ZT();class o extends t.APIResource{constructor(){super(...arguments),this.sessions=new n.Sessions(this._client),this.transcriptionSessions=new a.TranscriptionSessions(this._client)}}return Kl.Realtime=o,o.Sessions=i.Sessions,o.TranscriptionSessions=u.TranscriptionSessions,Kl}var Zl={},Wl={},QT;function JT(){if(QT)return Wl;QT=1,Object.defineProperty(Wl,"__esModule",{value:!0}),Wl.Sessions=void 0;const e=Xe(),t=bn(),n=Dt();class i extends e.APIResource{create(u,o){return this._client.post("/chatkit/sessions",{body:u,...o,headers:(0,t.buildHeaders)([{"OpenAI-Beta":"chatkit_beta=v1"},o?.headers])})}cancel(u,o){return this._client.post((0,n.path)`/chatkit/sessions/${u}/cancel`,{...o,headers:(0,t.buildHeaders)([{"OpenAI-Beta":"chatkit_beta=v1"},o?.headers])})}}return Wl.Sessions=i,Wl}var Xl={},eA;function tA(){if(eA)return Xl;eA=1,Object.defineProperty(Xl,"__esModule",{value:!0}),Xl.Threads=void 0;const e=Xe(),t=sn(),n=bn(),i=Dt();class a extends e.APIResource{retrieve(o,f){return this._client.get((0,i.path)`/chatkit/threads/${o}`,{...f,headers:(0,n.buildHeaders)([{"OpenAI-Beta":"chatkit_beta=v1"},f?.headers])})}list(o={},f){return this._client.getAPIList("/chatkit/threads",t.ConversationCursorPage,{query:o,...f,headers:(0,n.buildHeaders)([{"OpenAI-Beta":"chatkit_beta=v1"},f?.headers])})}delete(o,f){return this._client.delete((0,i.path)`/chatkit/threads/${o}`,{...f,headers:(0,n.buildHeaders)([{"OpenAI-Beta":"chatkit_beta=v1"},f?.headers])})}listItems(o,f={},d){return this._client.getAPIList((0,i.path)`/chatkit/threads/${o}/items`,t.ConversationCursorPage,{query:f,...d,headers:(0,n.buildHeaders)([{"OpenAI-Beta":"chatkit_beta=v1"},d?.headers])})}}return Xl.Threads=a,Xl}var nA;function rA(){if(nA)return Zl;nA=1,Object.defineProperty(Zl,"__esModule",{value:!0}),Zl.ChatKit=void 0;const e=ht(),t=Xe(),n=e.__importStar(JT()),i=JT(),a=e.__importStar(tA()),u=tA(),o=bn(),f=Yi();class d extends t.APIResource{constructor(){super(...arguments),this.sessions=new n.Sessions(this._client),this.threads=new a.Threads(this._client)}uploadFile(h,m){return this._client.post("/chatkit/files",(0,f.maybeMultipartFormRequestOptions)({body:h,...m,headers:(0,o.buildHeaders)([{"OpenAI-Beta":"chatkit_beta=v1"},m?.headers])},this._client))}}return Zl.ChatKit=d,d.Sessions=i.Sessions,d.Threads=u.Threads,Zl}var Ql={},Jl={},iA;function sA(){if(iA)return Jl;iA=1,Object.defineProperty(Jl,"__esModule",{value:!0}),Jl.Messages=void 0;const e=Xe(),t=sn(),n=bn(),i=Dt();class a extends e.APIResource{create(o,f,d){return this._client.post((0,i.path)`/threads/${o}/messages`,{body:f,...d,headers:(0,n.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},d?.headers])})}retrieve(o,f,d){const{thread_id:l}=f;return this._client.get((0,i.path)`/threads/${l}/messages/${o}`,{...d,headers:(0,n.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},d?.headers])})}update(o,f,d){const{thread_id:l,...h}=f;return this._client.post((0,i.path)`/threads/${l}/messages/${o}`,{body:h,...d,headers:(0,n.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},d?.headers])})}list(o,f={},d){return this._client.getAPIList((0,i.path)`/threads/${o}/messages`,t.CursorPage,{query:f,...d,headers:(0,n.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},d?.headers])})}delete(o,f,d){const{thread_id:l}=f;return this._client.delete((0,i.path)`/threads/${l}/messages/${o}`,{...d,headers:(0,n.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},d?.headers])})}}return Jl.Messages=a,Jl}var eu={},tu={},aA;function oA(){if(aA)return tu;aA=1,Object.defineProperty(tu,"__esModule",{value:!0}),tu.Steps=void 0;const e=Xe(),t=sn(),n=bn(),i=Dt();class a extends e.APIResource{retrieve(o,f,d){const{thread_id:l,run_id:h,...m}=f;return this._client.get((0,i.path)`/threads/${l}/runs/${h}/steps/${o}`,{query:m,...d,headers:(0,n.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},d?.headers])})}list(o,f,d){const{thread_id:l,...h}=f;return this._client.getAPIList((0,i.path)`/threads/${l}/runs/${o}/steps`,t.CursorPage,{query:h,...d,headers:(0,n.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},d?.headers])})}}return tu.Steps=a,tu}var nu={},a0={},ys={},cA;function oH(){if(cA)return ys;cA=1,Object.defineProperty(ys,"__esModule",{value:!0}),ys.toFloat32Array=ys.fromBase64=ys.toBase64=void 0;const e=Rs(),t=Zb(),n=u=>{if(!u)return"";if(typeof globalThis.Buffer<"u")return globalThis.Buffer.from(u).toString("base64");if(typeof u=="string"&&(u=(0,t.encodeUTF8)(u)),typeof btoa<"u")return btoa(String.fromCharCode.apply(null,u));throw new e.OpenAIError("Cannot generate base64 string; Expected `Buffer` or `btoa` to be defined")};ys.toBase64=n;const i=u=>{if(typeof globalThis.Buffer<"u"){const o=globalThis.Buffer.from(u,"base64");return new Uint8Array(o.buffer,o.byteOffset,o.byteLength)}if(typeof atob<"u"){const o=atob(u),f=new Uint8Array(o.length);for(let d=0;d<o.length;d++)f[d]=o.charCodeAt(d);return f}throw new e.OpenAIError("Cannot decode base64 string; Expected `Buffer` or `atob` to be defined")};ys.fromBase64=i;const a=u=>{if(typeof Buffer<"u"){const o=Buffer.from(u,"base64");return Array.from(new Float32Array(o.buffer,o.byteOffset,o.length/Float32Array.BYTES_PER_ELEMENT))}else{const o=atob(u),f=o.length,d=new Uint8Array(f);for(let l=0;l<f;l++)d[l]=o.charCodeAt(l);return Array.from(new Float32Array(d.buffer))}};return ys.toFloat32Array=a,ys}var ru={},lA;function zw(){if(lA)return ru;lA=1;var e={};Object.defineProperty(ru,"__esModule",{value:!0}),ru.readEnv=void 0;const t=n=>{if(typeof globalThis.process<"u")return e?.[n]?.trim()??void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(n)?.trim()};return ru.readEnv=t,ru}var uA;function _m(){return uA||(uA=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=ht();t.__exportStar(ba(),e),t.__exportStar(oH(),e),t.__exportStar(zw(),e),t.__exportStar(gm(),e),t.__exportStar(Rw(),e),t.__exportStar(ef(),e)})(a0)),a0}var dA;function $w(){if(dA)return nu;dA=1;var e,t,n,i,a,u,o,f,d,l,h,m,g,b,E,T,O,v,C,x,I,j,R;Object.defineProperty(nu,"__esModule",{value:!0}),nu.AssistantStream=void 0;const k=ht(),P=Hw(),z=vi(),L=Xb(),G=_m();let F=class extends L.EventStream{constructor(){super(...arguments),e.add(this),n.set(this,[]),i.set(this,{}),a.set(this,{}),u.set(this,void 0),o.set(this,void 0),f.set(this,void 0),d.set(this,void 0),l.set(this,void 0),h.set(this,void 0),m.set(this,void 0),g.set(this,void 0),b.set(this,void 0)}[(n=new WeakMap,i=new WeakMap,a=new WeakMap,u=new WeakMap,o=new WeakMap,f=new WeakMap,d=new WeakMap,l=new WeakMap,h=new WeakMap,m=new WeakMap,g=new WeakMap,b=new WeakMap,e=new WeakSet,Symbol.asyncIterator)](){const B=[],Z=[];let U=!1;return this.on("event",Y=>{const W=Z.shift();W?W.resolve(Y):B.push(Y)}),this.on("end",()=>{U=!0;for(const Y of Z)Y.resolve(void 0);Z.length=0}),this.on("abort",Y=>{U=!0;for(const W of Z)W.reject(Y);Z.length=0}),this.on("error",Y=>{U=!0;for(const W of Z)W.reject(Y);Z.length=0}),{next:async()=>B.length?{value:B.shift(),done:!1}:U?{value:void 0,done:!0}:new Promise((W,pe)=>Z.push({resolve:W,reject:pe})).then(W=>W?{value:W,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}static fromReadableStream(B){const Z=new t;return Z._run(()=>Z._fromReadableStream(B)),Z}async _fromReadableStream(B,Z){const U=Z?.signal;U&&(U.aborted&&this.controller.abort(),U.addEventListener("abort",()=>this.controller.abort())),this._connected();const Y=P.Stream.fromReadableStream(B,this.controller);for await(const W of Y)k.__classPrivateFieldGet(this,e,"m",E).call(this,W);if(Y.controller.signal?.aborted)throw new z.APIUserAbortError;return this._addRun(k.__classPrivateFieldGet(this,e,"m",T).call(this))}toReadableStream(){return new P.Stream(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}static createToolAssistantStream(B,Z,U,Y){const W=new t;return W._run(()=>W._runToolAssistantStream(B,Z,U,{...Y,headers:{...Y?.headers,"X-Stainless-Helper-Method":"stream"}})),W}async _createToolAssistantStream(B,Z,U,Y){const W=Y?.signal;W&&(W.aborted&&this.controller.abort(),W.addEventListener("abort",()=>this.controller.abort()));const pe={...U,stream:!0},N=await B.submitToolOutputs(Z,pe,{...Y,signal:this.controller.signal});this._connected();for await(const M of N)k.__classPrivateFieldGet(this,e,"m",E).call(this,M);if(N.controller.signal?.aborted)throw new z.APIUserAbortError;return this._addRun(k.__classPrivateFieldGet(this,e,"m",T).call(this))}static createThreadAssistantStream(B,Z,U){const Y=new t;return Y._run(()=>Y._threadAssistantStream(B,Z,{...U,headers:{...U?.headers,"X-Stainless-Helper-Method":"stream"}})),Y}static createAssistantStream(B,Z,U,Y){const W=new t;return W._run(()=>W._runAssistantStream(B,Z,U,{...Y,headers:{...Y?.headers,"X-Stainless-Helper-Method":"stream"}})),W}currentEvent(){return k.__classPrivateFieldGet(this,m,"f")}currentRun(){return k.__classPrivateFieldGet(this,g,"f")}currentMessageSnapshot(){return k.__classPrivateFieldGet(this,u,"f")}currentRunStepSnapshot(){return k.__classPrivateFieldGet(this,b,"f")}async finalRunSteps(){return await this.done(),Object.values(k.__classPrivateFieldGet(this,i,"f"))}async finalMessages(){return await this.done(),Object.values(k.__classPrivateFieldGet(this,a,"f"))}async finalRun(){if(await this.done(),!k.__classPrivateFieldGet(this,o,"f"))throw Error("Final run was not received.");return k.__classPrivateFieldGet(this,o,"f")}async _createThreadAssistantStream(B,Z,U){const Y=U?.signal;Y&&(Y.aborted&&this.controller.abort(),Y.addEventListener("abort",()=>this.controller.abort()));const W={...Z,stream:!0},pe=await B.createAndRun(W,{...U,signal:this.controller.signal});this._connected();for await(const N of pe)k.__classPrivateFieldGet(this,e,"m",E).call(this,N);if(pe.controller.signal?.aborted)throw new z.APIUserAbortError;return this._addRun(k.__classPrivateFieldGet(this,e,"m",T).call(this))}async _createAssistantStream(B,Z,U,Y){const W=Y?.signal;W&&(W.aborted&&this.controller.abort(),W.addEventListener("abort",()=>this.controller.abort()));const pe={...U,stream:!0},N=await B.create(Z,pe,{...Y,signal:this.controller.signal});this._connected();for await(const M of N)k.__classPrivateFieldGet(this,e,"m",E).call(this,M);if(N.controller.signal?.aborted)throw new z.APIUserAbortError;return this._addRun(k.__classPrivateFieldGet(this,e,"m",T).call(this))}static accumulateDelta(B,Z){for(const[U,Y]of Object.entries(Z)){if(!B.hasOwnProperty(U)){B[U]=Y;continue}let W=B[U];if(W==null){B[U]=Y;continue}if(U==="index"||U==="type"){B[U]=Y;continue}if(typeof W=="string"&&typeof Y=="string")W+=Y;else if(typeof W=="number"&&typeof Y=="number")W+=Y;else if((0,G.isObj)(W)&&(0,G.isObj)(Y))W=this.accumulateDelta(W,Y);else if(Array.isArray(W)&&Array.isArray(Y)){if(W.every(pe=>typeof pe=="string"||typeof pe=="number")){W.push(...Y);continue}for(const pe of Y){if(!(0,G.isObj)(pe))throw new Error(`Expected array delta entry to be an object but got: ${pe}`);const N=pe.index;if(N==null)throw console.error(pe),new Error("Expected array delta entry to have an `index` property");if(typeof N!="number")throw new Error(`Expected array delta entry \`index\` property to be a number but got ${N}`);const M=W[N];M==null?W.push(pe):W[N]=this.accumulateDelta(M,pe)}continue}else throw Error(`Unhandled record type: ${U}, deltaValue: ${Y}, accValue: ${W}`);B[U]=W}return B}_addRun(B){return B}async _threadAssistantStream(B,Z,U){return await this._createThreadAssistantStream(Z,B,U)}async _runAssistantStream(B,Z,U,Y){return await this._createAssistantStream(Z,B,U,Y)}async _runToolAssistantStream(B,Z,U,Y){return await this._createToolAssistantStream(Z,B,U,Y)}};return nu.AssistantStream=F,t=F,E=function(B){if(!this.ended)switch(k.__classPrivateFieldSet(this,m,B,"f"),k.__classPrivateFieldGet(this,e,"m",C).call(this,B),B.event){case"thread.created":break;case"thread.run.created":case"thread.run.queued":case"thread.run.in_progress":case"thread.run.requires_action":case"thread.run.completed":case"thread.run.incomplete":case"thread.run.failed":case"thread.run.cancelling":case"thread.run.cancelled":case"thread.run.expired":k.__classPrivateFieldGet(this,e,"m",R).call(this,B);break;case"thread.run.step.created":case"thread.run.step.in_progress":case"thread.run.step.delta":case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":k.__classPrivateFieldGet(this,e,"m",v).call(this,B);break;case"thread.message.created":case"thread.message.in_progress":case"thread.message.delta":case"thread.message.completed":case"thread.message.incomplete":k.__classPrivateFieldGet(this,e,"m",O).call(this,B);break;case"error":throw new Error("Encountered an error event in event processing - errors should be processed earlier")}},T=function(){if(this.ended)throw new z.OpenAIError("stream has ended, this shouldn't happen");if(!k.__classPrivateFieldGet(this,o,"f"))throw Error("Final run has not been received");return k.__classPrivateFieldGet(this,o,"f")},O=function(B){const[Z,U]=k.__classPrivateFieldGet(this,e,"m",I).call(this,B,k.__classPrivateFieldGet(this,u,"f"));k.__classPrivateFieldSet(this,u,Z,"f"),k.__classPrivateFieldGet(this,a,"f")[Z.id]=Z;for(const Y of U){const W=Z.content[Y.index];W?.type=="text"&&this._emit("textCreated",W.text)}switch(B.event){case"thread.message.created":this._emit("messageCreated",B.data);break;case"thread.message.in_progress":break;case"thread.message.delta":if(this._emit("messageDelta",B.data.delta,Z),B.data.delta.content)for(const Y of B.data.delta.content){if(Y.type=="text"&&Y.text){let W=Y.text,pe=Z.content[Y.index];if(pe&&pe.type=="text")this._emit("textDelta",W,pe.text);else throw Error("The snapshot associated with this text delta is not text or missing")}if(Y.index!=k.__classPrivateFieldGet(this,f,"f")){if(k.__classPrivateFieldGet(this,d,"f"))switch(k.__classPrivateFieldGet(this,d,"f").type){case"text":this._emit("textDone",k.__classPrivateFieldGet(this,d,"f").text,k.__classPrivateFieldGet(this,u,"f"));break;case"image_file":this._emit("imageFileDone",k.__classPrivateFieldGet(this,d,"f").image_file,k.__classPrivateFieldGet(this,u,"f"));break}k.__classPrivateFieldSet(this,f,Y.index,"f")}k.__classPrivateFieldSet(this,d,Z.content[Y.index],"f")}break;case"thread.message.completed":case"thread.message.incomplete":if(k.__classPrivateFieldGet(this,f,"f")!==void 0){const Y=B.data.content[k.__classPrivateFieldGet(this,f,"f")];if(Y)switch(Y.type){case"image_file":this._emit("imageFileDone",Y.image_file,k.__classPrivateFieldGet(this,u,"f"));break;case"text":this._emit("textDone",Y.text,k.__classPrivateFieldGet(this,u,"f"));break}}k.__classPrivateFieldGet(this,u,"f")&&this._emit("messageDone",B.data),k.__classPrivateFieldSet(this,u,void 0,"f")}},v=function(B){const Z=k.__classPrivateFieldGet(this,e,"m",x).call(this,B);switch(k.__classPrivateFieldSet(this,b,Z,"f"),B.event){case"thread.run.step.created":this._emit("runStepCreated",B.data);break;case"thread.run.step.delta":const U=B.data.delta;if(U.step_details&&U.step_details.type=="tool_calls"&&U.step_details.tool_calls&&Z.step_details.type=="tool_calls")for(const W of U.step_details.tool_calls)W.index==k.__classPrivateFieldGet(this,l,"f")?this._emit("toolCallDelta",W,Z.step_details.tool_calls[W.index]):(k.__classPrivateFieldGet(this,h,"f")&&this._emit("toolCallDone",k.__classPrivateFieldGet(this,h,"f")),k.__classPrivateFieldSet(this,l,W.index,"f"),k.__classPrivateFieldSet(this,h,Z.step_details.tool_calls[W.index],"f"),k.__classPrivateFieldGet(this,h,"f")&&this._emit("toolCallCreated",k.__classPrivateFieldGet(this,h,"f")));this._emit("runStepDelta",B.data.delta,Z);break;case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":k.__classPrivateFieldSet(this,b,void 0,"f"),B.data.step_details.type=="tool_calls"&&k.__classPrivateFieldGet(this,h,"f")&&(this._emit("toolCallDone",k.__classPrivateFieldGet(this,h,"f")),k.__classPrivateFieldSet(this,h,void 0,"f")),this._emit("runStepDone",B.data,Z);break}},C=function(B){k.__classPrivateFieldGet(this,n,"f").push(B),this._emit("event",B)},x=function(B){switch(B.event){case"thread.run.step.created":return k.__classPrivateFieldGet(this,i,"f")[B.data.id]=B.data,B.data;case"thread.run.step.delta":let Z=k.__classPrivateFieldGet(this,i,"f")[B.data.id];if(!Z)throw Error("Received a RunStepDelta before creation of a snapshot");let U=B.data;if(U.delta){const Y=t.accumulateDelta(Z,U.delta);k.__classPrivateFieldGet(this,i,"f")[B.data.id]=Y}return k.__classPrivateFieldGet(this,i,"f")[B.data.id];case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":case"thread.run.step.in_progress":k.__classPrivateFieldGet(this,i,"f")[B.data.id]=B.data;break}if(k.__classPrivateFieldGet(this,i,"f")[B.data.id])return k.__classPrivateFieldGet(this,i,"f")[B.data.id];throw new Error("No snapshot available")},I=function(B,Z){let U=[];switch(B.event){case"thread.message.created":return[B.data,U];case"thread.message.delta":if(!Z)throw Error("Received a delta with no existing snapshot (there should be one from message creation)");let Y=B.data;if(Y.delta.content)for(const W of Y.delta.content)if(W.index in Z.content){let pe=Z.content[W.index];Z.content[W.index]=k.__classPrivateFieldGet(this,e,"m",j).call(this,W,pe)}else Z.content[W.index]=W,U.push(W);return[Z,U];case"thread.message.in_progress":case"thread.message.completed":case"thread.message.incomplete":if(Z)return[Z,U];throw Error("Received thread message event with no existing snapshot")}throw Error("Tried to accumulate a non-message event")},j=function(B,Z){return t.accumulateDelta(Z,B)},R=function(B){switch(k.__classPrivateFieldSet(this,g,B.data,"f"),B.event){case"thread.run.created":break;case"thread.run.queued":break;case"thread.run.in_progress":break;case"thread.run.requires_action":case"thread.run.cancelled":case"thread.run.failed":case"thread.run.completed":case"thread.run.expired":case"thread.run.incomplete":k.__classPrivateFieldSet(this,o,B.data,"f"),k.__classPrivateFieldGet(this,h,"f")&&(this._emit("toolCallDone",k.__classPrivateFieldGet(this,h,"f")),k.__classPrivateFieldSet(this,h,void 0,"f"));break}},nu}var fA;function hA(){if(fA)return eu;fA=1,Object.defineProperty(eu,"__esModule",{value:!0}),eu.Runs=void 0;const e=ht(),t=Xe(),n=e.__importStar(oA()),i=oA(),a=sn(),u=bn(),o=$w(),f=ef(),d=Dt();class l extends t.APIResource{constructor(){super(...arguments),this.steps=new n.Steps(this._client)}create(m,g,b){const{include:E,...T}=g;return this._client.post((0,d.path)`/threads/${m}/runs`,{query:{include:E},body:T,...b,headers:(0,u.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},b?.headers]),stream:g.stream??!1})}retrieve(m,g,b){const{thread_id:E}=g;return this._client.get((0,d.path)`/threads/${E}/runs/${m}`,{...b,headers:(0,u.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},b?.headers])})}update(m,g,b){const{thread_id:E,...T}=g;return this._client.post((0,d.path)`/threads/${E}/runs/${m}`,{body:T,...b,headers:(0,u.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},b?.headers])})}list(m,g={},b){return this._client.getAPIList((0,d.path)`/threads/${m}/runs`,a.CursorPage,{query:g,...b,headers:(0,u.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},b?.headers])})}cancel(m,g,b){const{thread_id:E}=g;return this._client.post((0,d.path)`/threads/${E}/runs/${m}/cancel`,{...b,headers:(0,u.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},b?.headers])})}async createAndPoll(m,g,b){const E=await this.create(m,g,b);return await this.poll(E.id,{thread_id:m},b)}createAndStream(m,g,b){return o.AssistantStream.createAssistantStream(m,this._client.beta.threads.runs,g,b)}async poll(m,g,b){const E=(0,u.buildHeaders)([b?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":b?.pollIntervalMs?.toString()??void 0}]);for(;;){const{data:T,response:O}=await this.retrieve(m,g,{...b,headers:{...b?.headers,...E}}).withResponse();switch(T.status){case"queued":case"in_progress":case"cancelling":let v=5e3;if(b?.pollIntervalMs)v=b.pollIntervalMs;else{const C=O.headers.get("openai-poll-after-ms");if(C){const x=parseInt(C);isNaN(x)||(v=x)}}await(0,f.sleep)(v);break;case"requires_action":case"incomplete":case"cancelled":case"completed":case"failed":case"expired":return T}}}stream(m,g,b){return o.AssistantStream.createAssistantStream(m,this._client.beta.threads.runs,g,b)}submitToolOutputs(m,g,b){const{thread_id:E,...T}=g;return this._client.post((0,d.path)`/threads/${E}/runs/${m}/submit_tool_outputs`,{body:T,...b,headers:(0,u.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},b?.headers]),stream:g.stream??!1})}async submitToolOutputsAndPoll(m,g,b){const E=await this.submitToolOutputs(m,g,b);return await this.poll(E.id,g,b)}submitToolOutputsStream(m,g,b){return o.AssistantStream.createToolAssistantStream(m,this._client.beta.threads.runs,g,b)}}return eu.Runs=l,l.Steps=i.Steps,eu}var mA;function pA(){if(mA)return Ql;mA=1,Object.defineProperty(Ql,"__esModule",{value:!0}),Ql.Threads=void 0;const e=ht(),t=Xe(),n=e.__importStar(sA()),i=sA(),a=e.__importStar(hA()),u=hA(),o=bn(),f=$w(),d=Dt();class l extends t.APIResource{constructor(){super(...arguments),this.runs=new a.Runs(this._client),this.messages=new n.Messages(this._client)}create(m={},g){return this._client.post("/threads",{body:m,...g,headers:(0,o.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},g?.headers])})}retrieve(m,g){return this._client.get((0,d.path)`/threads/${m}`,{...g,headers:(0,o.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},g?.headers])})}update(m,g,b){return this._client.post((0,d.path)`/threads/${m}`,{body:g,...b,headers:(0,o.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},b?.headers])})}delete(m,g){return this._client.delete((0,d.path)`/threads/${m}`,{...g,headers:(0,o.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},g?.headers])})}createAndRun(m,g){return this._client.post("/threads/runs",{body:m,...g,headers:(0,o.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},g?.headers]),stream:m.stream??!1})}async createAndRunPoll(m,g){const b=await this.createAndRun(m,g);return await this.runs.poll(b.id,{thread_id:b.thread_id},g)}createAndRunStream(m,g){return f.AssistantStream.createThreadAssistantStream(m,this._client.beta.threads,g)}}return Ql.Threads=l,l.Runs=u.Runs,l.Messages=i.Messages,Ql}var gA;function qw(){if(gA)return ql;gA=1,Object.defineProperty(ql,"__esModule",{value:!0}),ql.Beta=void 0;const e=ht(),t=Xe(),n=e.__importStar(GT()),i=GT(),a=e.__importStar(XT()),u=XT(),o=e.__importStar(rA()),f=rA(),d=e.__importStar(pA()),l=pA();class h extends t.APIResource{constructor(){super(...arguments),this.realtime=new a.Realtime(this._client),this.chatkit=new o.ChatKit(this._client),this.assistants=new n.Assistants(this._client),this.threads=new d.Threads(this._client)}}return ql.Beta=h,h.Realtime=u.Realtime,h.ChatKit=f.ChatKit,h.Assistants=i.Assistants,h.Threads=l.Threads,ql}var iu={},bA;function Gw(){if(bA)return iu;bA=1,Object.defineProperty(iu,"__esModule",{value:!0}),iu.Completions=void 0;const e=Xe();class t extends e.APIResource{create(i,a){return this._client.post("/completions",{body:i,...a,stream:i.stream??!1})}}return iu.Completions=t,iu}var su={},au={},ou={},_A;function yA(){if(_A)return ou;_A=1,Object.defineProperty(ou,"__esModule",{value:!0}),ou.Content=void 0;const e=Xe(),t=bn(),n=Dt();class i extends e.APIResource{retrieve(u,o,f){const{container_id:d}=o;return this._client.get((0,n.path)`/containers/${d}/files/${u}/content`,{...f,headers:(0,t.buildHeaders)([{Accept:"application/binary"},f?.headers]),__binaryResponse:!0})}}return ou.Content=i,ou}var EA;function vA(){if(EA)return au;EA=1,Object.defineProperty(au,"__esModule",{value:!0}),au.Files=void 0;const e=ht(),t=Xe(),n=e.__importStar(yA()),i=yA(),a=sn(),u=bn(),o=Yi(),f=Dt();class d extends t.APIResource{constructor(){super(...arguments),this.content=new n.Content(this._client)}create(h,m,g){return this._client.post((0,f.path)`/containers/${h}/files`,(0,o.multipartFormRequestOptions)({body:m,...g},this._client))}retrieve(h,m,g){const{container_id:b}=m;return this._client.get((0,f.path)`/containers/${b}/files/${h}`,g)}list(h,m={},g){return this._client.getAPIList((0,f.path)`/containers/${h}/files`,a.CursorPage,{query:m,...g})}delete(h,m,g){const{container_id:b}=m;return this._client.delete((0,f.path)`/containers/${b}/files/${h}`,{...g,headers:(0,u.buildHeaders)([{Accept:"*/*"},g?.headers])})}}return au.Files=d,d.Content=i.Content,au}var TA;function Kw(){if(TA)return su;TA=1,Object.defineProperty(su,"__esModule",{value:!0}),su.Containers=void 0;const e=ht(),t=Xe(),n=e.__importStar(vA()),i=vA(),a=sn(),u=bn(),o=Dt();class f extends t.APIResource{constructor(){super(...arguments),this.files=new n.Files(this._client)}create(l,h){return this._client.post("/containers",{body:l,...h})}retrieve(l,h){return this._client.get((0,o.path)`/containers/${l}`,h)}list(l={},h){return this._client.getAPIList("/containers",a.CursorPage,{query:l,...h})}delete(l,h){return this._client.delete((0,o.path)`/containers/${l}`,{...h,headers:(0,u.buildHeaders)([{Accept:"*/*"},h?.headers])})}}return su.Containers=f,f.Files=i.Files,su}var cu={},lu={},AA;function OA(){if(AA)return lu;AA=1,Object.defineProperty(lu,"__esModule",{value:!0}),lu.Items=void 0;const e=Xe(),t=sn(),n=Dt();class i extends e.APIResource{create(u,o,f){const{include:d,...l}=o;return this._client.post((0,n.path)`/conversations/${u}/items`,{query:{include:d},body:l,...f})}retrieve(u,o,f){const{conversation_id:d,...l}=o;return this._client.get((0,n.path)`/conversations/${d}/items/${u}`,{query:l,...f})}list(u,o={},f){return this._client.getAPIList((0,n.path)`/conversations/${u}/items`,t.ConversationCursorPage,{query:o,...f})}delete(u,o,f){const{conversation_id:d}=o;return this._client.delete((0,n.path)`/conversations/${d}/items/${u}`,f)}}return lu.Items=i,lu}var SA;function Yw(){if(SA)return cu;SA=1,Object.defineProperty(cu,"__esModule",{value:!0}),cu.Conversations=void 0;const e=ht(),t=Xe(),n=e.__importStar(OA()),i=OA(),a=Dt();class u extends t.APIResource{constructor(){super(...arguments),this.items=new n.Items(this._client)}create(f={},d){return this._client.post("/conversations",{body:f,...d})}retrieve(f,d){return this._client.get((0,a.path)`/conversations/${f}`,d)}update(f,d,l){return this._client.post((0,a.path)`/conversations/${f}`,{body:d,...l})}delete(f,d){return this._client.delete((0,a.path)`/conversations/${f}`,d)}}return cu.Conversations=u,u.Items=i.Items,cu}var uu={},CA;function Vw(){if(CA)return uu;CA=1,Object.defineProperty(uu,"__esModule",{value:!0}),uu.Embeddings=void 0;const e=Xe(),t=_m();class n extends e.APIResource{create(a,u){const o=!!a.encoding_format;let f=o?a.encoding_format:"base64";o&&(0,t.loggerFor)(this._client).debug("embeddings/user defined encoding_format:",a.encoding_format);const d=this._client.post("/embeddings",{body:{...a,encoding_format:f},...u});return o?d:((0,t.loggerFor)(this._client).debug("embeddings/decoding base64 embeddings from base64"),d._thenUnwrap(l=>(l&&l.data&&l.data.forEach(h=>{const m=h.embedding;h.embedding=(0,t.toFloat32Array)(m)}),l)))}}return uu.Embeddings=n,uu}var du={},fu={},hu={},xA;function wA(){if(xA)return hu;xA=1,Object.defineProperty(hu,"__esModule",{value:!0}),hu.OutputItems=void 0;const e=Xe(),t=sn(),n=Dt();class i extends e.APIResource{retrieve(u,o,f){const{eval_id:d,run_id:l}=o;return this._client.get((0,n.path)`/evals/${d}/runs/${l}/output_items/${u}`,f)}list(u,o,f){const{eval_id:d,...l}=o;return this._client.getAPIList((0,n.path)`/evals/${d}/runs/${u}/output_items`,t.CursorPage,{query:l,...f})}}return hu.OutputItems=i,hu}var RA;function NA(){if(RA)return fu;RA=1,Object.defineProperty(fu,"__esModule",{value:!0}),fu.Runs=void 0;const e=ht(),t=Xe(),n=e.__importStar(wA()),i=wA(),a=sn(),u=Dt();class o extends t.APIResource{constructor(){super(...arguments),this.outputItems=new n.OutputItems(this._client)}create(d,l,h){return this._client.post((0,u.path)`/evals/${d}/runs`,{body:l,...h})}retrieve(d,l,h){const{eval_id:m}=l;return this._client.get((0,u.path)`/evals/${m}/runs/${d}`,h)}list(d,l={},h){return this._client.getAPIList((0,u.path)`/evals/${d}/runs`,a.CursorPage,{query:l,...h})}delete(d,l,h){const{eval_id:m}=l;return this._client.delete((0,u.path)`/evals/${m}/runs/${d}`,h)}cancel(d,l,h){const{eval_id:m}=l;return this._client.post((0,u.path)`/evals/${m}/runs/${d}`,h)}}return fu.Runs=o,o.OutputItems=i.OutputItems,fu}var IA;function Zw(){if(IA)return du;IA=1,Object.defineProperty(du,"__esModule",{value:!0}),du.Evals=void 0;const e=ht(),t=Xe(),n=e.__importStar(NA()),i=NA(),a=sn(),u=Dt();class o extends t.APIResource{constructor(){super(...arguments),this.runs=new n.Runs(this._client)}create(d,l){return this._client.post("/evals",{body:d,...l})}retrieve(d,l){return this._client.get((0,u.path)`/evals/${d}`,l)}update(d,l,h){return this._client.post((0,u.path)`/evals/${d}`,{body:l,...h})}list(d={},l){return this._client.getAPIList("/evals",a.CursorPage,{query:d,...l})}delete(d,l){return this._client.delete((0,u.path)`/evals/${d}`,l)}}return du.Evals=o,o.Runs=i.Runs,du}var mu={},kA;function Ww(){if(kA)return mu;kA=1,Object.defineProperty(mu,"__esModule",{value:!0}),mu.Files=void 0;const e=Xe(),t=sn(),n=bn(),i=ef(),a=vi(),u=Yi(),o=Dt();class f extends e.APIResource{create(l,h){return this._client.post("/files",(0,u.multipartFormRequestOptions)({body:l,...h},this._client))}retrieve(l,h){return this._client.get((0,o.path)`/files/${l}`,h)}list(l={},h){return this._client.getAPIList("/files",t.CursorPage,{query:l,...h})}delete(l,h){return this._client.delete((0,o.path)`/files/${l}`,h)}content(l,h){return this._client.get((0,o.path)`/files/${l}/content`,{...h,headers:(0,n.buildHeaders)([{Accept:"application/binary"},h?.headers]),__binaryResponse:!0})}async waitForProcessing(l,{pollInterval:h=5e3,maxWait:m=1800*1e3}={}){const g=new Set(["processed","error","deleted"]),b=Date.now();let E=await this.retrieve(l);for(;!E.status||!g.has(E.status);)if(await(0,i.sleep)(h),E=await this.retrieve(l),Date.now()-b>m)throw new a.APIConnectionTimeoutError({message:`Giving up on waiting for file ${l} to finish processing after ${m} milliseconds.`});return E}}return mu.Files=f,mu}var pu={},gu={},MA;function PA(){if(MA)return gu;MA=1,Object.defineProperty(gu,"__esModule",{value:!0}),gu.Methods=void 0;const e=Xe();class t extends e.APIResource{}return gu.Methods=t,gu}var bu={},_u={},DA;function jA(){if(DA)return _u;DA=1,Object.defineProperty(_u,"__esModule",{value:!0}),_u.Graders=void 0;const e=Xe();class t extends e.APIResource{run(i,a){return this._client.post("/fine_tuning/alpha/graders/run",{body:i,...a})}validate(i,a){return this._client.post("/fine_tuning/alpha/graders/validate",{body:i,...a})}}return _u.Graders=t,_u}var LA;function HA(){if(LA)return bu;LA=1,Object.defineProperty(bu,"__esModule",{value:!0}),bu.Alpha=void 0;const e=ht(),t=Xe(),n=e.__importStar(jA()),i=jA();class a extends t.APIResource{constructor(){super(...arguments),this.graders=new n.Graders(this._client)}}return bu.Alpha=a,a.Graders=i.Graders,bu}var yu={},Eu={},BA;function UA(){if(BA)return Eu;BA=1,Object.defineProperty(Eu,"__esModule",{value:!0}),Eu.Permissions=void 0;const e=Xe(),t=sn(),n=Dt();class i extends e.APIResource{create(u,o,f){return this._client.getAPIList((0,n.path)`/fine_tuning/checkpoints/${u}/permissions`,t.Page,{body:o,method:"post",...f})}retrieve(u,o={},f){return this._client.get((0,n.path)`/fine_tuning/checkpoints/${u}/permissions`,{query:o,...f})}delete(u,o,f){const{fine_tuned_model_checkpoint:d}=o;return this._client.delete((0,n.path)`/fine_tuning/checkpoints/${d}/permissions/${u}`,f)}}return Eu.Permissions=i,Eu}var FA;function zA(){if(FA)return yu;FA=1,Object.defineProperty(yu,"__esModule",{value:!0}),yu.Checkpoints=void 0;const e=ht(),t=Xe(),n=e.__importStar(UA()),i=UA();class a extends t.APIResource{constructor(){super(...arguments),this.permissions=new n.Permissions(this._client)}}return yu.Checkpoints=a,a.Permissions=i.Permissions,yu}var vu={},Tu={},$A;function qA(){if($A)return Tu;$A=1,Object.defineProperty(Tu,"__esModule",{value:!0}),Tu.Checkpoints=void 0;const e=Xe(),t=sn(),n=Dt();class i extends e.APIResource{list(u,o={},f){return this._client.getAPIList((0,n.path)`/fine_tuning/jobs/${u}/checkpoints`,t.CursorPage,{query:o,...f})}}return Tu.Checkpoints=i,Tu}var GA;function KA(){if(GA)return vu;GA=1,Object.defineProperty(vu,"__esModule",{value:!0}),vu.Jobs=void 0;const e=ht(),t=Xe(),n=e.__importStar(qA()),i=qA(),a=sn(),u=Dt();class o extends t.APIResource{constructor(){super(...arguments),this.checkpoints=new n.Checkpoints(this._client)}create(d,l){return this._client.post("/fine_tuning/jobs",{body:d,...l})}retrieve(d,l){return this._client.get((0,u.path)`/fine_tuning/jobs/${d}`,l)}list(d={},l){return this._client.getAPIList("/fine_tuning/jobs",a.CursorPage,{query:d,...l})}cancel(d,l){return this._client.post((0,u.path)`/fine_tuning/jobs/${d}/cancel`,l)}listEvents(d,l={},h){return this._client.getAPIList((0,u.path)`/fine_tuning/jobs/${d}/events`,a.CursorPage,{query:l,...h})}pause(d,l){return this._client.post((0,u.path)`/fine_tuning/jobs/${d}/pause`,l)}resume(d,l){return this._client.post((0,u.path)`/fine_tuning/jobs/${d}/resume`,l)}}return vu.Jobs=o,o.Checkpoints=i.Checkpoints,vu}var YA;function Xw(){if(YA)return pu;YA=1,Object.defineProperty(pu,"__esModule",{value:!0}),pu.FineTuning=void 0;const e=ht(),t=Xe(),n=e.__importStar(PA()),i=PA(),a=e.__importStar(HA()),u=HA(),o=e.__importStar(zA()),f=zA(),d=e.__importStar(KA()),l=KA();class h extends t.APIResource{constructor(){super(...arguments),this.methods=new n.Methods(this._client),this.jobs=new d.Jobs(this._client),this.checkpoints=new o.Checkpoints(this._client),this.alpha=new a.Alpha(this._client)}}return pu.FineTuning=h,h.Methods=i.Methods,h.Jobs=l.Jobs,h.Checkpoints=f.Checkpoints,h.Alpha=u.Alpha,pu}var Au={},Ou={},VA;function ZA(){if(VA)return Ou;VA=1,Object.defineProperty(Ou,"__esModule",{value:!0}),Ou.GraderModels=void 0;const e=Xe();class t extends e.APIResource{}return Ou.GraderModels=t,Ou}var WA;function Qw(){if(WA)return Au;WA=1,Object.defineProperty(Au,"__esModule",{value:!0}),Au.Graders=void 0;const e=ht(),t=Xe(),n=e.__importStar(ZA()),i=ZA();class a extends t.APIResource{constructor(){super(...arguments),this.graderModels=new n.GraderModels(this._client)}}return Au.Graders=a,a.GraderModels=i.GraderModels,Au}var Su={},XA;function Jw(){if(XA)return Su;XA=1,Object.defineProperty(Su,"__esModule",{value:!0}),Su.Images=void 0;const e=Xe(),t=Yi();class n extends e.APIResource{createVariation(a,u){return this._client.post("/images/variations",(0,t.multipartFormRequestOptions)({body:a,...u},this._client))}edit(a,u){return this._client.post("/images/edits",(0,t.multipartFormRequestOptions)({body:a,...u,stream:a.stream??!1},this._client))}generate(a,u){return this._client.post("/images/generations",{body:a,...u,stream:a.stream??!1})}}return Su.Images=n,Su}var Cu={},QA;function eR(){if(QA)return Cu;QA=1,Object.defineProperty(Cu,"__esModule",{value:!0}),Cu.Models=void 0;const e=Xe(),t=sn(),n=Dt();class i extends e.APIResource{retrieve(u,o){return this._client.get((0,n.path)`/models/${u}`,o)}list(u){return this._client.getAPIList("/models",t.Page,u)}delete(u,o){return this._client.delete((0,n.path)`/models/${u}`,o)}}return Cu.Models=i,Cu}var xu={},JA;function tR(){if(JA)return xu;JA=1,Object.defineProperty(xu,"__esModule",{value:!0}),xu.Moderations=void 0;const e=Xe();class t extends e.APIResource{create(i,a){return this._client.post("/moderations",{body:i,...a})}}return xu.Moderations=t,xu}var wu={},Ru={},eO;function tO(){if(eO)return Ru;eO=1,Object.defineProperty(Ru,"__esModule",{value:!0}),Ru.Calls=void 0;const e=Xe(),t=bn(),n=Dt();class i extends e.APIResource{accept(u,o,f){return this._client.post((0,n.path)`/realtime/calls/${u}/accept`,{body:o,...f,headers:(0,t.buildHeaders)([{Accept:"*/*"},f?.headers])})}hangup(u,o){return this._client.post((0,n.path)`/realtime/calls/${u}/hangup`,{...o,headers:(0,t.buildHeaders)([{Accept:"*/*"},o?.headers])})}refer(u,o,f){return this._client.post((0,n.path)`/realtime/calls/${u}/refer`,{body:o,...f,headers:(0,t.buildHeaders)([{Accept:"*/*"},f?.headers])})}reject(u,o={},f){return this._client.post((0,n.path)`/realtime/calls/${u}/reject`,{body:o,...f,headers:(0,t.buildHeaders)([{Accept:"*/*"},f?.headers])})}}return Ru.Calls=i,Ru}var Nu={},nO;function rO(){if(nO)return Nu;nO=1,Object.defineProperty(Nu,"__esModule",{value:!0}),Nu.ClientSecrets=void 0;const e=Xe();class t extends e.APIResource{create(i,a){return this._client.post("/realtime/client_secrets",{body:i,...a})}}return Nu.ClientSecrets=t,Nu}var iO;function nR(){if(iO)return wu;iO=1,Object.defineProperty(wu,"__esModule",{value:!0}),wu.Realtime=void 0;const e=ht(),t=Xe(),n=e.__importStar(tO()),i=tO(),a=e.__importStar(rO()),u=rO();class o extends t.APIResource{constructor(){super(...arguments),this.clientSecrets=new a.ClientSecrets(this._client),this.calls=new n.Calls(this._client)}}return wu.Realtime=o,o.ClientSecrets=u.ClientSecrets,o.Calls=i.Calls,wu}var Iu={},xi={},sO;function rR(){if(sO)return xi;sO=1,Object.defineProperty(xi,"__esModule",{value:!0}),xi.maybeParseResponse=n,xi.parseResponse=i,xi.hasAutoParseableInput=u,xi.makeParseableResponseTool=o,xi.isAutoParsableTool=f,xi.shouldParseToolCall=h,xi.validateInputTools=m,xi.addOutputText=g;const e=vi(),t=bm();function n(b,E){return!E||!u(E)?{...b,output_parsed:null,output:b.output.map(T=>T.type==="function_call"?{...T,parsed_arguments:null}:T.type==="message"?{...T,content:T.content.map(O=>({...O,parsed:null}))}:T)}:i(b,E)}function i(b,E){const T=b.output.map(v=>{if(v.type==="function_call")return{...v,parsed_arguments:l(E,v)};if(v.type==="message"){const C=v.content.map(x=>x.type==="output_text"?{...x,parsed:a(E,x.text)}:x);return{...v,content:C}}return v}),O=Object.assign({},b,{output:T});return Object.getOwnPropertyDescriptor(b,"output_text")||g(O),Object.defineProperty(O,"output_parsed",{enumerable:!0,get(){for(const v of O.output)if(v.type==="message"){for(const C of v.content)if(C.type==="output_text"&&C.parsed!==null)return C.parsed}return null}}),O}function a(b,E){return b.text?.format?.type!=="json_schema"?null:"$parseRaw"in b.text?.format?(b.text?.format).$parseRaw(E):JSON.parse(E)}function u(b){return!!(0,t.isAutoParsableResponseFormat)(b.text?.format)}function o(b,{parser:E,callback:T}){const O={...b};return Object.defineProperties(O,{$brand:{value:"auto-parseable-tool",enumerable:!1},$parseRaw:{value:E,enumerable:!1},$callback:{value:T,enumerable:!1}}),O}function f(b){return b?.$brand==="auto-parseable-tool"}function d(b,E){return b.find(T=>T.type==="function"&&T.name===E)}function l(b,E){const T=d(b.tools??[],E.name);return{...E,...E,parsed_arguments:f(T)?T.$parseRaw(E.arguments):T?.strict?JSON.parse(E.arguments):null}}function h(b,E){if(!b)return!1;const T=d(b.tools??[],E.name);return f(T)||T?.strict||!1}function m(b){for(const E of b??[]){if(E.type!=="function")throw new e.OpenAIError(`Currently only \`function\` tool types support auto-parsing; Received \`${E.type}\``);if(E.function.strict!==!0)throw new e.OpenAIError(`The \`${E.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`)}}function g(b){const E=[];for(const T of b.output)if(T.type==="message")for(const O of T.content)O.type==="output_text"&&E.push(O.text);b.output_text=E.join("")}return xi}var ku={},aO;function cH(){if(aO)return ku;aO=1;var e,t,n,i,a,u,o,f;Object.defineProperty(ku,"__esModule",{value:!0}),ku.ResponseStream=void 0;const d=ht(),l=vi(),h=Xb(),m=rR();let g=class iR extends h.EventStream{constructor(T){super(),e.add(this),t.set(this,void 0),n.set(this,void 0),i.set(this,void 0),d.__classPrivateFieldSet(this,t,T,"f")}static createResponse(T,O,v){const C=new iR(O);return C._run(()=>C._createOrRetrieveResponse(T,O,{...v,headers:{...v?.headers,"X-Stainless-Helper-Method":"stream"}})),C}async _createOrRetrieveResponse(T,O,v){const C=v?.signal;C&&(C.aborted&&this.controller.abort(),C.addEventListener("abort",()=>this.controller.abort())),d.__classPrivateFieldGet(this,e,"m",a).call(this);let x,I=null;"response_id"in O?(x=await T.responses.retrieve(O.response_id,{stream:!0},{...v,signal:this.controller.signal,stream:!0}),I=O.starting_after??null):x=await T.responses.create({...O,stream:!0},{...v,signal:this.controller.signal}),this._connected();for await(const j of x)d.__classPrivateFieldGet(this,e,"m",u).call(this,j,I);if(x.controller.signal?.aborted)throw new l.APIUserAbortError;return d.__classPrivateFieldGet(this,e,"m",o).call(this)}[(t=new WeakMap,n=new WeakMap,i=new WeakMap,e=new WeakSet,a=function(){this.ended||d.__classPrivateFieldSet(this,n,void 0,"f")},u=function(O,v){if(this.ended)return;const C=(I,j)=>{(v==null||j.sequence_number>v)&&this._emit(I,j)},x=d.__classPrivateFieldGet(this,e,"m",f).call(this,O);switch(C("event",O),O.type){case"response.output_text.delta":{const I=x.output[O.output_index];if(!I)throw new l.OpenAIError(`missing output at index ${O.output_index}`);if(I.type==="message"){const j=I.content[O.content_index];if(!j)throw new l.OpenAIError(`missing content at index ${O.content_index}`);if(j.type!=="output_text")throw new l.OpenAIError(`expected content to be 'output_text', got ${j.type}`);C("response.output_text.delta",{...O,snapshot:j.text})}break}case"response.function_call_arguments.delta":{const I=x.output[O.output_index];if(!I)throw new l.OpenAIError(`missing output at index ${O.output_index}`);I.type==="function_call"&&C("response.function_call_arguments.delta",{...O,snapshot:I.arguments});break}default:C(O.type,O);break}},o=function(){if(this.ended)throw new l.OpenAIError("stream has ended, this shouldn't happen");const O=d.__classPrivateFieldGet(this,n,"f");if(!O)throw new l.OpenAIError("request ended without sending any events");d.__classPrivateFieldSet(this,n,void 0,"f");const v=b(O,d.__classPrivateFieldGet(this,t,"f"));return d.__classPrivateFieldSet(this,i,v,"f"),v},f=function(O){let v=d.__classPrivateFieldGet(this,n,"f");if(!v){if(O.type!=="response.created")throw new l.OpenAIError(`When snapshot hasn't been set yet, expected 'response.created' event, got ${O.type}`);return v=d.__classPrivateFieldSet(this,n,O.response,"f"),v}switch(O.type){case"response.output_item.added":{v.output.push(O.item);break}case"response.content_part.added":{const C=v.output[O.output_index];if(!C)throw new l.OpenAIError(`missing output at index ${O.output_index}`);const x=C.type,I=O.part;x==="message"&&I.type!=="reasoning_text"?C.content.push(I):x==="reasoning"&&I.type==="reasoning_text"&&(C.content||(C.content=[]),C.content.push(I));break}case"response.output_text.delta":{const C=v.output[O.output_index];if(!C)throw new l.OpenAIError(`missing output at index ${O.output_index}`);if(C.type==="message"){const x=C.content[O.content_index];if(!x)throw new l.OpenAIError(`missing content at index ${O.content_index}`);if(x.type!=="output_text")throw new l.OpenAIError(`expected content to be 'output_text', got ${x.type}`);x.text+=O.delta}break}case"response.function_call_arguments.delta":{const C=v.output[O.output_index];if(!C)throw new l.OpenAIError(`missing output at index ${O.output_index}`);C.type==="function_call"&&(C.arguments+=O.delta);break}case"response.reasoning_text.delta":{const C=v.output[O.output_index];if(!C)throw new l.OpenAIError(`missing output at index ${O.output_index}`);if(C.type==="reasoning"){const x=C.content?.[O.content_index];if(!x)throw new l.OpenAIError(`missing content at index ${O.content_index}`);if(x.type!=="reasoning_text")throw new l.OpenAIError(`expected content to be 'reasoning_text', got ${x.type}`);x.text+=O.delta}break}case"response.completed":{d.__classPrivateFieldSet(this,n,O.response,"f");break}}return v},Symbol.asyncIterator)](){const T=[],O=[];let v=!1;return this.on("event",C=>{const x=O.shift();x?x.resolve(C):T.push(C)}),this.on("end",()=>{v=!0;for(const C of O)C.resolve(void 0);O.length=0}),this.on("abort",C=>{v=!0;for(const x of O)x.reject(C);O.length=0}),this.on("error",C=>{v=!0;for(const x of O)x.reject(C);O.length=0}),{next:async()=>T.length?{value:T.shift(),done:!1}:v?{value:void 0,done:!0}:new Promise((x,I)=>O.push({resolve:x,reject:I})).then(x=>x?{value:x,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}async finalResponse(){await this.done();const T=d.__classPrivateFieldGet(this,i,"f");if(!T)throw new l.OpenAIError("stream ended without producing a ChatCompletion");return T}};ku.ResponseStream=g;function b(E,T){return(0,m.maybeParseResponse)(E,T)}return ku}var Mu={},oO;function cO(){if(oO)return Mu;oO=1,Object.defineProperty(Mu,"__esModule",{value:!0}),Mu.InputItems=void 0;const e=Xe(),t=sn(),n=Dt();class i extends e.APIResource{list(u,o={},f){return this._client.getAPIList((0,n.path)`/responses/${u}/input_items`,t.CursorPage,{query:o,...f})}}return Mu.InputItems=i,Mu}var lO;function sR(){if(lO)return Iu;lO=1,Object.defineProperty(Iu,"__esModule",{value:!0}),Iu.Responses=void 0;const e=ht(),t=rR(),n=cH(),i=Xe(),a=e.__importStar(cO()),u=cO(),o=bn(),f=Dt();class d extends i.APIResource{constructor(){super(...arguments),this.inputItems=new a.InputItems(this._client)}create(h,m){return this._client.post("/responses",{body:h,...m,stream:h.stream??!1})._thenUnwrap(g=>("object"in g&&g.object==="response"&&(0,t.addOutputText)(g),g))}retrieve(h,m={},g){return this._client.get((0,f.path)`/responses/${h}`,{query:m,...g,stream:m?.stream??!1})._thenUnwrap(b=>("object"in b&&b.object==="response"&&(0,t.addOutputText)(b),b))}delete(h,m){return this._client.delete((0,f.path)`/responses/${h}`,{...m,headers:(0,o.buildHeaders)([{Accept:"*/*"},m?.headers])})}parse(h,m){return this._client.responses.create(h,m)._thenUnwrap(g=>(0,t.parseResponse)(g,h))}stream(h,m){return n.ResponseStream.createResponse(this._client,h,m)}cancel(h,m){return this._client.post((0,f.path)`/responses/${h}/cancel`,m)}}return Iu.Responses=d,d.InputItems=u.InputItems,Iu}var Pu={},Du={},uO;function dO(){if(uO)return Du;uO=1,Object.defineProperty(Du,"__esModule",{value:!0}),Du.Parts=void 0;const e=Xe(),t=Yi(),n=Dt();class i extends e.APIResource{create(u,o,f){return this._client.post((0,n.path)`/uploads/${u}/parts`,(0,t.multipartFormRequestOptions)({body:o,...f},this._client))}}return Du.Parts=i,Du}var fO;function aR(){if(fO)return Pu;fO=1,Object.defineProperty(Pu,"__esModule",{value:!0}),Pu.Uploads=void 0;const e=ht(),t=Xe(),n=e.__importStar(dO()),i=dO(),a=Dt();class u extends t.APIResource{constructor(){super(...arguments),this.parts=new n.Parts(this._client)}create(f,d){return this._client.post("/uploads",{body:f,...d})}cancel(f,d){return this._client.post((0,a.path)`/uploads/${f}/cancel`,d)}complete(f,d,l){return this._client.post((0,a.path)`/uploads/${f}/complete`,{body:d,...l})}}return Pu.Uploads=u,u.Parts=i.Parts,Pu}var ju={},Lu={},Hu={},hO;function lH(){if(hO)return Hu;hO=1,Object.defineProperty(Hu,"__esModule",{value:!0}),Hu.allSettledWithThrow=void 0;const e=async t=>{const n=await Promise.allSettled(t),i=n.filter(u=>u.status==="rejected");if(i.length){for(const u of i)console.error(u.reason);throw new Error(`${i.length} promise(s) failed - see the above errors`)}const a=[];for(const u of n)u.status==="fulfilled"&&a.push(u.value);return a};return Hu.allSettledWithThrow=e,Hu}var mO;function pO(){if(mO)return Lu;mO=1,Object.defineProperty(Lu,"__esModule",{value:!0}),Lu.FileBatches=void 0;const e=Xe(),t=sn(),n=bn(),i=ef(),a=lH(),u=Dt();class o extends e.APIResource{create(d,l,h){return this._client.post((0,u.path)`/vector_stores/${d}/file_batches`,{body:l,...h,headers:(0,n.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},h?.headers])})}retrieve(d,l,h){const{vector_store_id:m}=l;return this._client.get((0,u.path)`/vector_stores/${m}/file_batches/${d}`,{...h,headers:(0,n.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},h?.headers])})}cancel(d,l,h){const{vector_store_id:m}=l;return this._client.post((0,u.path)`/vector_stores/${m}/file_batches/${d}/cancel`,{...h,headers:(0,n.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},h?.headers])})}async createAndPoll(d,l,h){const m=await this.create(d,l);return await this.poll(d,m.id,h)}listFiles(d,l,h){const{vector_store_id:m,...g}=l;return this._client.getAPIList((0,u.path)`/vector_stores/${m}/file_batches/${d}/files`,t.CursorPage,{query:g,...h,headers:(0,n.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},h?.headers])})}async poll(d,l,h){const m=(0,n.buildHeaders)([h?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":h?.pollIntervalMs?.toString()??void 0}]);for(;;){const{data:g,response:b}=await this.retrieve(l,{vector_store_id:d},{...h,headers:m}).withResponse();switch(g.status){case"in_progress":let E=5e3;if(h?.pollIntervalMs)E=h.pollIntervalMs;else{const T=b.headers.get("openai-poll-after-ms");if(T){const O=parseInt(T);isNaN(O)||(E=O)}}await(0,i.sleep)(E);break;case"failed":case"cancelled":case"completed":return g}}}async uploadAndPoll(d,{files:l,fileIds:h=[]},m){if(l==null||l.length==0)throw new Error("No `files` provided to process. If you've already uploaded files you should use `.createAndPoll()` instead");const g=m?.maxConcurrency??5,b=Math.min(g,l.length),E=this._client,T=l.values(),O=[...h];async function v(x){for(let I of x){const j=await E.files.create({file:I,purpose:"assistants"},m);O.push(j.id)}}const C=Array(b).fill(T).map(v);return await(0,a.allSettledWithThrow)(C),await this.createAndPoll(d,{file_ids:O})}}return Lu.FileBatches=o,Lu}var Bu={},gO;function bO(){if(gO)return Bu;gO=1,Object.defineProperty(Bu,"__esModule",{value:!0}),Bu.Files=void 0;const e=Xe(),t=sn(),n=bn(),i=_m(),a=Dt();class u extends e.APIResource{create(f,d,l){return this._client.post((0,a.path)`/vector_stores/${f}/files`,{body:d,...l,headers:(0,n.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},l?.headers])})}retrieve(f,d,l){const{vector_store_id:h}=d;return this._client.get((0,a.path)`/vector_stores/${h}/files/${f}`,{...l,headers:(0,n.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},l?.headers])})}update(f,d,l){const{vector_store_id:h,...m}=d;return this._client.post((0,a.path)`/vector_stores/${h}/files/${f}`,{body:m,...l,headers:(0,n.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},l?.headers])})}list(f,d={},l){return this._client.getAPIList((0,a.path)`/vector_stores/${f}/files`,t.CursorPage,{query:d,...l,headers:(0,n.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},l?.headers])})}delete(f,d,l){const{vector_store_id:h}=d;return this._client.delete((0,a.path)`/vector_stores/${h}/files/${f}`,{...l,headers:(0,n.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},l?.headers])})}async createAndPoll(f,d,l){const h=await this.create(f,d,l);return await this.poll(f,h.id,l)}async poll(f,d,l){const h=(0,n.buildHeaders)([l?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":l?.pollIntervalMs?.toString()??void 0}]);for(;;){const m=await this.retrieve(d,{vector_store_id:f},{...l,headers:h}).withResponse(),g=m.data;switch(g.status){case"in_progress":let b=5e3;if(l?.pollIntervalMs)b=l.pollIntervalMs;else{const E=m.response.headers.get("openai-poll-after-ms");if(E){const T=parseInt(E);isNaN(T)||(b=T)}}await(0,i.sleep)(b);break;case"failed":case"completed":return g}}}async upload(f,d,l){const h=await this._client.files.create({file:d,purpose:"assistants"},l);return this.create(f,{file_id:h.id},l)}async uploadAndPoll(f,d,l){const h=await this.upload(f,d,l);return await this.poll(f,h.id,l)}content(f,d,l){const{vector_store_id:h}=d;return this._client.getAPIList((0,a.path)`/vector_stores/${h}/files/${f}/content`,t.Page,{...l,headers:(0,n.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},l?.headers])})}}return Bu.Files=u,Bu}var _O;function oR(){if(_O)return ju;_O=1,Object.defineProperty(ju,"__esModule",{value:!0}),ju.VectorStores=void 0;const e=ht(),t=Xe(),n=e.__importStar(pO()),i=pO(),a=e.__importStar(bO()),u=bO(),o=sn(),f=bn(),d=Dt();class l extends t.APIResource{constructor(){super(...arguments),this.files=new a.Files(this._client),this.fileBatches=new n.FileBatches(this._client)}create(m,g){return this._client.post("/vector_stores",{body:m,...g,headers:(0,f.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},g?.headers])})}retrieve(m,g){return this._client.get((0,d.path)`/vector_stores/${m}`,{...g,headers:(0,f.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},g?.headers])})}update(m,g,b){return this._client.post((0,d.path)`/vector_stores/${m}`,{body:g,...b,headers:(0,f.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},b?.headers])})}list(m={},g){return this._client.getAPIList("/vector_stores",o.CursorPage,{query:m,...g,headers:(0,f.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},g?.headers])})}delete(m,g){return this._client.delete((0,d.path)`/vector_stores/${m}`,{...g,headers:(0,f.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},g?.headers])})}search(m,g,b){return this._client.getAPIList((0,d.path)`/vector_stores/${m}/search`,o.Page,{body:g,method:"post",...b,headers:(0,f.buildHeaders)([{"OpenAI-Beta":"assistants=v2"},b?.headers])})}}return ju.VectorStores=l,l.Files=u.Files,l.FileBatches=i.FileBatches,ju}var Uu={},yO;function cR(){if(yO)return Uu;yO=1,Object.defineProperty(Uu,"__esModule",{value:!0}),Uu.Videos=void 0;const e=Xe(),t=sn(),n=bn(),i=Yi(),a=Dt();class u extends e.APIResource{create(f,d){return this._client.post("/videos",(0,i.maybeMultipartFormRequestOptions)({body:f,...d},this._client))}retrieve(f,d){return this._client.get((0,a.path)`/videos/${f}`,d)}list(f={},d){return this._client.getAPIList("/videos",t.ConversationCursorPage,{query:f,...d})}delete(f,d){return this._client.delete((0,a.path)`/videos/${f}`,d)}downloadContent(f,d={},l){return this._client.get((0,a.path)`/videos/${f}/content`,{query:d,...l,headers:(0,n.buildHeaders)([{Accept:"application/binary"},l?.headers]),__binaryResponse:!0})}remix(f,d,l){return this._client.post((0,a.path)`/videos/${f}/remix`,(0,i.maybeMultipartFormRequestOptions)({body:d,...l},this._client))}}return Uu.Videos=u,Uu}var Fu={},EO;function lR(){if(EO)return Fu;EO=1;var e,t,n;Object.defineProperty(Fu,"__esModule",{value:!0}),Fu.Webhooks=void 0;const i=ht(),a=vi(),u=Xe(),o=bn();class f extends u.APIResource{constructor(){super(...arguments),e.add(this)}async unwrap(l,h,m=this._client.webhookSecret,g=300){return await this.verifySignature(l,h,m,g),JSON.parse(l)}async verifySignature(l,h,m=this._client.webhookSecret,g=300){if(typeof crypto>"u"||typeof crypto.subtle.importKey!="function"||typeof crypto.subtle.verify!="function")throw new Error("Webhook signature verification is only supported when the `crypto` global is defined");i.__classPrivateFieldGet(this,e,"m",t).call(this,m);const b=(0,o.buildHeaders)([h]).values,E=i.__classPrivateFieldGet(this,e,"m",n).call(this,b,"webhook-signature"),T=i.__classPrivateFieldGet(this,e,"m",n).call(this,b,"webhook-timestamp"),O=i.__classPrivateFieldGet(this,e,"m",n).call(this,b,"webhook-id"),v=parseInt(T,10);if(isNaN(v))throw new a.InvalidWebhookSignatureError("Invalid webhook timestamp format");const C=Math.floor(Date.now()/1e3);if(C-v>g)throw new a.InvalidWebhookSignatureError("Webhook timestamp is too old");if(v>C+g)throw new a.InvalidWebhookSignatureError("Webhook timestamp is too new");const x=E.split(" ").map(k=>k.startsWith("v1,")?k.substring(3):k),I=m.startsWith("whsec_")?Buffer.from(m.replace("whsec_",""),"base64"):Buffer.from(m,"utf-8"),j=O?`${O}.${T}.${l}`:`${T}.${l}`,R=await crypto.subtle.importKey("raw",I,{name:"HMAC",hash:"SHA-256"},!1,["verify"]);for(const k of x)try{const P=Buffer.from(k,"base64");if(await crypto.subtle.verify("HMAC",R,P,new TextEncoder().encode(j)))return}catch{continue}throw new a.InvalidWebhookSignatureError("The given webhook signature does not match the expected signature")}}return Fu.Webhooks=f,e=new WeakSet,t=function(l){if(typeof l!="string"||l.length===0)throw new Error("The webhook secret must either be set using the env var, OPENAI_WEBHOOK_SECRET, on the client class, OpenAI({ webhookSecret: '123' }), or passed to this function")},n=function(l,h){if(!l)throw new Error("Headers are required");const m=l.get(h);if(m==null)throw new Error(`Missing required header: ${h}`);return m},Fu}var vO;function uH(){return vO||(vO=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Webhooks=e.Videos=e.VectorStores=e.Uploads=e.Responses=e.Realtime=e.Moderations=e.Models=e.Images=e.Graders=e.FineTuning=e.Files=e.Evals=e.Embeddings=e.Conversations=e.Containers=e.Completions=e.Beta=e.Batches=e.Audio=void 0;const t=ht();t.__exportStar(sH(),e),t.__exportStar(aH(),e);var n=Uw();Object.defineProperty(e,"Audio",{enumerable:!0,get:function(){return n.Audio}});var i=Fw();Object.defineProperty(e,"Batches",{enumerable:!0,get:function(){return i.Batches}});var a=qw();Object.defineProperty(e,"Beta",{enumerable:!0,get:function(){return a.Beta}});var u=Gw();Object.defineProperty(e,"Completions",{enumerable:!0,get:function(){return u.Completions}});var o=Kw();Object.defineProperty(e,"Containers",{enumerable:!0,get:function(){return o.Containers}});var f=Yw();Object.defineProperty(e,"Conversations",{enumerable:!0,get:function(){return f.Conversations}});var d=Vw();Object.defineProperty(e,"Embeddings",{enumerable:!0,get:function(){return d.Embeddings}});var l=Zw();Object.defineProperty(e,"Evals",{enumerable:!0,get:function(){return l.Evals}});var h=Ww();Object.defineProperty(e,"Files",{enumerable:!0,get:function(){return h.Files}});var m=Xw();Object.defineProperty(e,"FineTuning",{enumerable:!0,get:function(){return m.FineTuning}});var g=Qw();Object.defineProperty(e,"Graders",{enumerable:!0,get:function(){return g.Graders}});var b=Jw();Object.defineProperty(e,"Images",{enumerable:!0,get:function(){return b.Images}});var E=eR();Object.defineProperty(e,"Models",{enumerable:!0,get:function(){return E.Models}});var T=tR();Object.defineProperty(e,"Moderations",{enumerable:!0,get:function(){return T.Moderations}});var O=nR();Object.defineProperty(e,"Realtime",{enumerable:!0,get:function(){return O.Realtime}});var v=sR();Object.defineProperty(e,"Responses",{enumerable:!0,get:function(){return v.Responses}});var C=aR();Object.defineProperty(e,"Uploads",{enumerable:!0,get:function(){return C.Uploads}});var x=oR();Object.defineProperty(e,"VectorStores",{enumerable:!0,get:function(){return x.VectorStores}});var I=cR();Object.defineProperty(e,"Videos",{enumerable:!0,get:function(){return I.Videos}});var j=lR();Object.defineProperty(e,"Webhooks",{enumerable:!0,get:function(){return j.Webhooks}})})(Qg)),Qg}var TO;function X0(){if(TO)return Sl;TO=1;var e,t,n,i;Object.defineProperty(Sl,"__esModule",{value:!0}),Sl.OpenAI=void 0;const a=ht(),u=Rw(),o=ba(),f=ef(),d=Yb(),l=K0(),h=a.__importStar(Jh()),m=a.__importStar(X4()),g=a.__importStar(eH()),b=Nw(),E=a.__importStar(Rs()),T=a.__importStar(sn()),O=a.__importStar(Mw()),v=a.__importStar(uH()),C=Wb(),x=Fw(),I=Gw(),j=Vw(),R=Ww(),k=Jw(),P=eR(),z=tR(),L=cR(),G=lR(),F=Uw(),K=qw(),B=Bw(),Z=Kw(),U=Yw(),Y=Zw(),W=Xw(),pe=Qw(),N=nR(),M=sR(),q=aR(),D=oR(),ie=K0(),ae=bn(),fe=zw(),Ee=gm(),de=ba();class le{constructor({baseURL:re=(0,fe.readEnv)("OPENAI_BASE_URL"),apiKey:Ae=(0,fe.readEnv)("OPENAI_API_KEY"),organization:Ce=(0,fe.readEnv)("OPENAI_ORG_ID")??null,project:Me=(0,fe.readEnv)("OPENAI_PROJECT_ID")??null,webhookSecret:He=(0,fe.readEnv)("OPENAI_WEBHOOK_SECRET")??null,...Ne}={}){if(e.add(this),n.set(this,void 0),this.completions=new v.Completions(this),this.chat=new v.Chat(this),this.embeddings=new v.Embeddings(this),this.files=new v.Files(this),this.images=new v.Images(this),this.audio=new v.Audio(this),this.moderations=new v.Moderations(this),this.models=new v.Models(this),this.fineTuning=new v.FineTuning(this),this.graders=new v.Graders(this),this.vectorStores=new v.VectorStores(this),this.webhooks=new v.Webhooks(this),this.beta=new v.Beta(this),this.batches=new v.Batches(this),this.uploads=new v.Uploads(this),this.responses=new v.Responses(this),this.realtime=new v.Realtime(this),this.conversations=new v.Conversations(this),this.evals=new v.Evals(this),this.containers=new v.Containers(this),this.videos=new v.Videos(this),Ae===void 0)throw new E.OpenAIError("Missing credentials. Please pass an `apiKey`, or set the `OPENAI_API_KEY` environment variable.");const Ge={apiKey:Ae,organization:Ce,project:Me,webhookSecret:He,...Ne,baseURL:re||"https://api.openai.com/v1"};if(!Ge.dangerouslyAllowBrowser&&(0,ie.isRunningInBrowser)())throw new E.OpenAIError(`It looks like you're running in a browser-like environment.
326
+
327
+ This is disabled by default, as it risks exposing your secret API credentials to attackers.
328
+ If you understand the risks and have appropriate mitigations in place,
329
+ you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g.,
330
+
331
+ new OpenAI({ apiKey, dangerouslyAllowBrowser: true });
332
+
333
+ https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
334
+ `);this.baseURL=Ge.baseURL,this.timeout=Ge.timeout??t.DEFAULT_TIMEOUT,this.logger=Ge.logger??console;const pt="warn";this.logLevel=pt,this.logLevel=(0,Ee.parseLogLevel)(Ge.logLevel,"ClientOptions.logLevel",this)??(0,Ee.parseLogLevel)((0,fe.readEnv)("OPENAI_LOG"),"process.env['OPENAI_LOG']",this)??pt,this.fetchOptions=Ge.fetchOptions,this.maxRetries=Ge.maxRetries??2,this.fetch=Ge.fetch??h.getDefaultFetch(),a.__classPrivateFieldSet(this,n,m.FallbackEncoder,"f"),this._options=Ge,this.apiKey=typeof Ae=="string"?Ae:"Missing Key",this.organization=Ce,this.project=Me,this.webhookSecret=He}withOptions(re){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,organization:this.organization,project:this.project,webhookSecret:this.webhookSecret,...re})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:re,nulls:Ae}){}async authHeaders(re){return(0,ae.buildHeaders)([{Authorization:`Bearer ${this.apiKey}`}])}stringifyQuery(re){return g.stringify(re,{arrayFormat:"brackets"})}getUserAgent(){return`${this.constructor.name}/JS ${b.VERSION}`}defaultIdempotencyKey(){return`stainless-node-retry-${(0,u.uuid4)()}`}makeStatusError(re,Ae,Ce,Me){return E.APIError.generate(re,Ae,Ce,Me)}async _callApiKey(){const re=this._options.apiKey;if(typeof re!="function")return!1;let Ae;try{Ae=await re()}catch(Ce){throw Ce instanceof E.OpenAIError?Ce:new E.OpenAIError(`Failed to get token from 'apiKey' function: ${Ce.message}`,{cause:Ce})}if(typeof Ae!="string"||!Ae)throw new E.OpenAIError(`Expected 'apiKey' function argument to return a string but it returned ${Ae}`);return this.apiKey=Ae,!0}buildURL(re,Ae,Ce){const Me=!a.__classPrivateFieldGet(this,e,"m",i).call(this)&&Ce||this.baseURL,He=(0,o.isAbsoluteURL)(re)?new URL(re):new URL(Me+(Me.endsWith("/")&&re.startsWith("/")?re.slice(1):re)),Ne=this.defaultQuery();return(0,de.isEmptyObj)(Ne)||(Ae={...Ne,...Ae}),typeof Ae=="object"&&Ae&&!Array.isArray(Ae)&&(He.search=this.stringifyQuery(Ae)),He.toString()}async prepareOptions(re){await this._callApiKey()}async prepareRequest(re,{url:Ae,options:Ce}){}get(re,Ae){return this.methodRequest("get",re,Ae)}post(re,Ae){return this.methodRequest("post",re,Ae)}patch(re,Ae){return this.methodRequest("patch",re,Ae)}put(re,Ae){return this.methodRequest("put",re,Ae)}delete(re,Ae){return this.methodRequest("delete",re,Ae)}methodRequest(re,Ae,Ce){return this.request(Promise.resolve(Ce).then(Me=>({method:re,path:Ae,...Me})))}request(re,Ae=null){return new C.APIPromise(this,this.makeRequest(re,Ae,void 0))}async makeRequest(re,Ae,Ce){const Me=await re,He=Me.maxRetries??this.maxRetries;Ae==null&&(Ae=He),await this.prepareOptions(Me);const{req:Ne,url:Ge,timeout:pt}=await this.buildRequest(Me,{retryCount:He-Ae});await this.prepareRequest(Ne,{url:Ge,options:Me});const it="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),bt=Ce===void 0?"":`, retryOf: ${Ce}`,jt=Date.now();if((0,Ee.loggerFor)(this).debug(`[${it}] sending request`,(0,Ee.formatRequestDetails)({retryOfRequestLogID:Ce,method:Me.method,url:Ge,options:Me,headers:Ne.headers})),Me.signal?.aborted)throw new E.APIUserAbortError;const ar=new AbortController,vt=await this.fetchWithTimeout(Ge,Ne,pt,ar).catch(d.castToError),Lt=Date.now();if(vt instanceof globalThis.Error){const xe=`retrying, ${Ae} attempts remaining`;if(Me.signal?.aborted)throw new E.APIUserAbortError;const $e=(0,d.isAbortError)(vt)||/timed? ?out/i.test(String(vt)+("cause"in vt?String(vt.cause):""));if(Ae)return(0,Ee.loggerFor)(this).info(`[${it}] connection ${$e?"timed out":"failed"} - ${xe}`),(0,Ee.loggerFor)(this).debug(`[${it}] connection ${$e?"timed out":"failed"} (${xe})`,(0,Ee.formatRequestDetails)({retryOfRequestLogID:Ce,url:Ge,durationMs:Lt-jt,message:vt.message})),this.retryRequest(Me,Ae,Ce??it);throw(0,Ee.loggerFor)(this).info(`[${it}] connection ${$e?"timed out":"failed"} - error; no more retries left`),(0,Ee.loggerFor)(this).debug(`[${it}] connection ${$e?"timed out":"failed"} (error; no more retries left)`,(0,Ee.formatRequestDetails)({retryOfRequestLogID:Ce,url:Ge,durationMs:Lt-jt,message:vt.message})),$e?new E.APIConnectionTimeoutError:new E.APIConnectionError({cause:vt})}const ni=[...vt.headers.entries()].filter(([xe])=>xe==="x-request-id").map(([xe,$e])=>", "+xe+": "+JSON.stringify($e)).join(""),be=`[${it}${bt}${ni}] ${Ne.method} ${Ge} ${vt.ok?"succeeded":"failed"} with status ${vt.status} in ${Lt-jt}ms`;if(!vt.ok){const xe=await this.shouldRetry(vt);if(Ae&&xe){const Tn=`retrying, ${Ae} attempts remaining`;return await h.CancelReadableStream(vt.body),(0,Ee.loggerFor)(this).info(`${be} - ${Tn}`),(0,Ee.loggerFor)(this).debug(`[${it}] response error (${Tn})`,(0,Ee.formatRequestDetails)({retryOfRequestLogID:Ce,url:vt.url,status:vt.status,headers:vt.headers,durationMs:Lt-jt})),this.retryRequest(Me,Ae,Ce??it,vt.headers)}const $e=xe?"error; no more retries left":"error; not retryable";(0,Ee.loggerFor)(this).info(`${be} - ${$e}`);const ct=await vt.text().catch(Tn=>(0,d.castToError)(Tn).message),wt=(0,o.safeJSON)(ct),qn=wt?void 0:ct;throw(0,Ee.loggerFor)(this).debug(`[${it}] response error (${$e})`,(0,Ee.formatRequestDetails)({retryOfRequestLogID:Ce,url:vt.url,status:vt.status,headers:vt.headers,message:qn,durationMs:Date.now()-jt})),this.makeStatusError(vt.status,wt,qn,vt.headers)}return(0,Ee.loggerFor)(this).info(be),(0,Ee.loggerFor)(this).debug(`[${it}] response start`,(0,Ee.formatRequestDetails)({retryOfRequestLogID:Ce,url:vt.url,status:vt.status,headers:vt.headers,durationMs:Lt-jt})),{response:vt,options:Me,controller:ar,requestLogID:it,retryOfRequestLogID:Ce,startTime:jt}}getAPIList(re,Ae,Ce){return this.requestAPIList(Ae,{method:"get",path:re,...Ce})}requestAPIList(re,Ae){const Ce=this.makeRequest(Ae,null,void 0);return new T.PagePromise(this,Ce,re)}async fetchWithTimeout(re,Ae,Ce,Me){const{signal:He,method:Ne,...Ge}=Ae||{};He&&He.addEventListener("abort",()=>Me.abort());const pt=setTimeout(()=>Me.abort(),Ce),it=globalThis.ReadableStream&&Ge.body instanceof globalThis.ReadableStream||typeof Ge.body=="object"&&Ge.body!==null&&Symbol.asyncIterator in Ge.body,bt={signal:Me.signal,...it?{duplex:"half"}:{},method:"GET",...Ge};Ne&&(bt.method=Ne.toUpperCase());try{return await this.fetch.call(void 0,re,bt)}finally{clearTimeout(pt)}}async shouldRetry(re){const Ae=re.headers.get("x-should-retry");return Ae==="true"?!0:Ae==="false"?!1:re.status===408||re.status===409||re.status===429||re.status>=500}async retryRequest(re,Ae,Ce,Me){let He;const Ne=Me?.get("retry-after-ms");if(Ne){const pt=parseFloat(Ne);Number.isNaN(pt)||(He=pt)}const Ge=Me?.get("retry-after");if(Ge&&!He){const pt=parseFloat(Ge);Number.isNaN(pt)?He=Date.parse(Ge)-Date.now():He=pt*1e3}if(!(He&&0<=He&&He<60*1e3)){const pt=re.maxRetries??this.maxRetries;He=this.calculateDefaultRetryTimeoutMillis(Ae,pt)}return await(0,f.sleep)(He),this.makeRequest(re,Ae-1,Ce)}calculateDefaultRetryTimeoutMillis(re,Ae){const He=Ae-re,Ne=Math.min(.5*Math.pow(2,He),8),Ge=1-Math.random()*.25;return Ne*Ge*1e3}async buildRequest(re,{retryCount:Ae=0}={}){const Ce={...re},{method:Me,path:He,query:Ne,defaultBaseURL:Ge}=Ce,pt=this.buildURL(He,Ne,Ge);"timeout"in Ce&&(0,o.validatePositiveInteger)("timeout",Ce.timeout),Ce.timeout=Ce.timeout??this.timeout;const{bodyHeaders:it,body:bt}=this.buildBody({options:Ce}),jt=await this.buildHeaders({options:re,method:Me,bodyHeaders:it,retryCount:Ae});return{req:{method:Me,headers:jt,...Ce.signal&&{signal:Ce.signal},...globalThis.ReadableStream&&bt instanceof globalThis.ReadableStream&&{duplex:"half"},...bt&&{body:bt},...this.fetchOptions??{},...Ce.fetchOptions??{}},url:pt,timeout:Ce.timeout}}async buildHeaders({options:re,method:Ae,bodyHeaders:Ce,retryCount:Me}){let He={};this.idempotencyHeader&&Ae!=="get"&&(re.idempotencyKey||(re.idempotencyKey=this.defaultIdempotencyKey()),He[this.idempotencyHeader]=re.idempotencyKey);const Ne=(0,ae.buildHeaders)([He,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(Me),...re.timeout?{"X-Stainless-Timeout":String(Math.trunc(re.timeout/1e3))}:{},...(0,l.getPlatformHeaders)(),"OpenAI-Organization":this.organization,"OpenAI-Project":this.project},await this.authHeaders(re),this._options.defaultHeaders,Ce,re.headers]);return this.validateHeaders(Ne),Ne.values}buildBody({options:{body:re,headers:Ae}}){if(!re)return{bodyHeaders:void 0,body:void 0};const Ce=(0,ae.buildHeaders)([Ae]);return ArrayBuffer.isView(re)||re instanceof ArrayBuffer||re instanceof DataView||typeof re=="string"&&Ce.values.has("content-type")||globalThis.Blob&&re instanceof globalThis.Blob||re instanceof FormData||re instanceof URLSearchParams||globalThis.ReadableStream&&re instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:re}:typeof re=="object"&&(Symbol.asyncIterator in re||Symbol.iterator in re&&"next"in re&&typeof re.next=="function")?{bodyHeaders:void 0,body:h.ReadableStreamFrom(re)}:a.__classPrivateFieldGet(this,n,"f").call(this,{body:re,headers:Ce})}}return Sl.OpenAI=le,t=le,n=new WeakMap,e=new WeakSet,i=function(){return this.baseURL!=="https://api.openai.com/v1"},le.OpenAI=t,le.DEFAULT_TIMEOUT=6e5,le.OpenAIError=E.OpenAIError,le.APIError=E.APIError,le.APIConnectionError=E.APIConnectionError,le.APIConnectionTimeoutError=E.APIConnectionTimeoutError,le.APIUserAbortError=E.APIUserAbortError,le.NotFoundError=E.NotFoundError,le.ConflictError=E.ConflictError,le.RateLimitError=E.RateLimitError,le.BadRequestError=E.BadRequestError,le.AuthenticationError=E.AuthenticationError,le.InternalServerError=E.InternalServerError,le.PermissionDeniedError=E.PermissionDeniedError,le.UnprocessableEntityError=E.UnprocessableEntityError,le.InvalidWebhookSignatureError=E.InvalidWebhookSignatureError,le.toFile=O.toFile,le.Completions=I.Completions,le.Chat=B.Chat,le.Embeddings=j.Embeddings,le.Files=R.Files,le.Images=k.Images,le.Audio=F.Audio,le.Moderations=z.Moderations,le.Models=P.Models,le.FineTuning=W.FineTuning,le.Graders=pe.Graders,le.VectorStores=D.VectorStores,le.Webhooks=G.Webhooks,le.Beta=K.Beta,le.Batches=x.Batches,le.Uploads=q.Uploads,le.Responses=M.Responses,le.Realtime=N.Realtime,le.Conversations=U.Conversations,le.Evals=Y.Evals,le.Containers=Z.Containers,le.Videos=L.Videos,Sl}var zu={},AO;function dH(){if(AO)return zu;AO=1;var e={};Object.defineProperty(zu,"__esModule",{value:!0}),zu.AzureOpenAI=void 0;const t=ht(),n=bn(),i=t.__importStar(vi()),a=_m(),u=X0();class o extends u.OpenAI{constructor({baseURL:l=(0,a.readEnv)("OPENAI_BASE_URL"),apiKey:h=(0,a.readEnv)("AZURE_OPENAI_API_KEY"),apiVersion:m=(0,a.readEnv)("OPENAI_API_VERSION"),endpoint:g,deployment:b,azureADTokenProvider:E,dangerouslyAllowBrowser:T,...O}={}){if(!m)throw new i.OpenAIError("The OPENAI_API_VERSION environment variable is missing or empty; either provide it, or instantiate the AzureOpenAI client with an apiVersion option, like new AzureOpenAI({ apiVersion: 'My API Version' }).");if(typeof E=="function"&&(T=!0),!E&&!h)throw new i.OpenAIError("Missing credentials. Please pass one of `apiKey` and `azureADTokenProvider`, or set the `AZURE_OPENAI_API_KEY` environment variable.");if(E&&h)throw new i.OpenAIError("The `apiKey` and `azureADTokenProvider` arguments are mutually exclusive; only one can be passed at a time.");if(O.defaultQuery={...O.defaultQuery,"api-version":m},l){if(g)throw new i.OpenAIError("baseURL and endpoint are mutually exclusive")}else{if(g||(g=e.AZURE_OPENAI_ENDPOINT),!g)throw new i.OpenAIError("Must provide one of the `baseURL` or `endpoint` arguments, or the `AZURE_OPENAI_ENDPOINT` environment variable");l=`${g}/openai`}super({apiKey:E??h,baseURL:l,...O,...T!==void 0?{dangerouslyAllowBrowser:T}:{}}),this.apiVersion="",this.apiVersion=m,this.deploymentName=b}async buildRequest(l,h={}){if(f.has(l.path)&&l.method==="post"&&l.body!==void 0){if(!(0,a.isObj)(l.body))throw new Error("Expected request body to be an object");const m=this.deploymentName||l.body.model||l.__metadata?.model;m!==void 0&&!this.baseURL.includes("/deployments")&&(l.path=`/deployments/${m}${l.path}`)}return super.buildRequest(l,h)}async authHeaders(l){return typeof this._options.apiKey=="string"?(0,n.buildHeaders)([{"api-key":this.apiKey}]):super.authHeaders(l)}}zu.AzureOpenAI=o;const f=new Set(["/completions","/chat/completions","/embeddings","/audio/transcriptions","/audio/translations","/audio/speech","/images/generations","/batches","/images/edits"]);return zu}var OO;function ym(){return OO||(OO=1,(function(e,t){t=e.exports=function(...l){return new t.default(...l)},Object.defineProperty(t,"__esModule",{value:!0}),t.AzureOpenAI=t.InvalidWebhookSignatureError=t.UnprocessableEntityError=t.PermissionDeniedError=t.InternalServerError=t.AuthenticationError=t.BadRequestError=t.RateLimitError=t.ConflictError=t.NotFoundError=t.APIUserAbortError=t.APIConnectionTimeoutError=t.APIConnectionError=t.APIError=t.OpenAIError=t.PagePromise=t.OpenAI=t.APIPromise=t.toFile=t.default=void 0;var n=X0();Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n.OpenAI}});var i=Mw();Object.defineProperty(t,"toFile",{enumerable:!0,get:function(){return i.toFile}});var a=Wb();Object.defineProperty(t,"APIPromise",{enumerable:!0,get:function(){return a.APIPromise}});var u=X0();Object.defineProperty(t,"OpenAI",{enumerable:!0,get:function(){return u.OpenAI}});var o=sn();Object.defineProperty(t,"PagePromise",{enumerable:!0,get:function(){return o.PagePromise}});var f=Rs();Object.defineProperty(t,"OpenAIError",{enumerable:!0,get:function(){return f.OpenAIError}}),Object.defineProperty(t,"APIError",{enumerable:!0,get:function(){return f.APIError}}),Object.defineProperty(t,"APIConnectionError",{enumerable:!0,get:function(){return f.APIConnectionError}}),Object.defineProperty(t,"APIConnectionTimeoutError",{enumerable:!0,get:function(){return f.APIConnectionTimeoutError}}),Object.defineProperty(t,"APIUserAbortError",{enumerable:!0,get:function(){return f.APIUserAbortError}}),Object.defineProperty(t,"NotFoundError",{enumerable:!0,get:function(){return f.NotFoundError}}),Object.defineProperty(t,"ConflictError",{enumerable:!0,get:function(){return f.ConflictError}}),Object.defineProperty(t,"RateLimitError",{enumerable:!0,get:function(){return f.RateLimitError}}),Object.defineProperty(t,"BadRequestError",{enumerable:!0,get:function(){return f.BadRequestError}}),Object.defineProperty(t,"AuthenticationError",{enumerable:!0,get:function(){return f.AuthenticationError}}),Object.defineProperty(t,"InternalServerError",{enumerable:!0,get:function(){return f.InternalServerError}}),Object.defineProperty(t,"PermissionDeniedError",{enumerable:!0,get:function(){return f.PermissionDeniedError}}),Object.defineProperty(t,"UnprocessableEntityError",{enumerable:!0,get:function(){return f.UnprocessableEntityError}}),Object.defineProperty(t,"InvalidWebhookSignatureError",{enumerable:!0,get:function(){return f.InvalidWebhookSignatureError}});var d=dH();Object.defineProperty(t,"AzureOpenAI",{enumerable:!0,get:function(){return d.AzureOpenAI}})})(Nh,Nh.exports)),Nh.exports}var Es={};const fH={},hH=Object.freeze(Object.defineProperty({__proto__:null,default:fH},Symbol.toStringTag,{value:"Module"})),SO=jk(hH);var CO;function Em(){if(CO)return Es;CO=1,Object.defineProperty(Es,"__esModule",{value:!0}),Es.isFsModuleAvailable=Es.isRunningInBrowser=Es.getBrowserInfo=void 0;function e(){if(typeof navigator>"u"||!navigator)return null;const i=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(const{key:a,pattern:u}of i){const o=u.exec(navigator.userAgent);if(o){const f=o[1]||0,d=o[2]||0,l=o[3]||0;return{browser:a,version:`${f}.${d}.${l}`}}}return null}Es.getBrowserInfo=e;const t=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";Es.isRunningInBrowser=t;const n=()=>{try{return!0}catch{return!1}};return Es.isFsModuleAvailable=n,Es}var xO;function ot(){return xO||(xO=1,(function(e){var t={},n=Fa&&Fa.__awaiter||function(R,k,P,z){function L(G){return G instanceof P?G:new P(function(F){F(G)})}return new(P||(P=Promise))(function(G,F){function K(U){try{Z(z.next(U))}catch(Y){F(Y)}}function B(U){try{Z(z.throw(U))}catch(Y){F(Y)}}function Z(U){U.done?G(U.value):L(U.value).then(K,B)}Z((z=z.apply(R,k||[])).next())})},i=Fa&&Fa.__importDefault||function(R){return R&&R.__esModule?R:{default:R}};Object.defineProperty(e,"__esModule",{value:!0}),e.setApiKey=e.setBaseURL=e.toQueryParams=e.initOpenAIClient=e.defaultHeadersBuilder=e.portkeyHeaders=e.finalResponse=e.parseBody=e.overrideConfig=e.getPortkeyHeader=e.isEmpty=e.castToError=e.readEnv=e.getPlatformProperties=void 0;const a=Tr(),u=ww(),o=i(ym()),f=Em(),d=()=>{if(Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]")return{[`${a.PORTKEY_HEADER_PREFIX}runtime`]:"node",[`${a.PORTKEY_HEADER_PREFIX}runtime-version`]:process.version};const R=(0,f.getBrowserInfo)();return R?{[`${a.PORTKEY_HEADER_PREFIX}runtime`]:`browser: ${R.browser}`,[`${a.PORTKEY_HEADER_PREFIX}runtime-version`]:R.version}:{}};e.getPlatformProperties=d;const l=R=>{var k,P;if(typeof process<"u")return(P=(k=t)===null||k===void 0?void 0:k[R])!==null&&P!==void 0?P:void 0};e.readEnv=l;const h=R=>R instanceof Error?R:new Error(R);e.castToError=h;const m=R=>!!(R==null||typeof R=="string"&&R.trim().length===0||Array.isArray(R)&&R.length===0||typeof R=="object"&&Object.keys(R).length===0);e.isEmpty=m;const g=R=>`${a.PORTKEY_HEADER_PREFIX}${R}`;e.getPortkeyHeader=g;const b=(R,k)=>(0,e.isEmpty)(k)?R:k;e.overrideConfig=b;const E=R=>{if((0,e.isEmpty)(R))return{};const k={};for(let P in R){const z=R[P];P=P.replace("ID","Id").replace(/[A-Z]/g,L=>`_${L.toLowerCase()}`),k[P]=z}return k};e.parseBody=E;function T(R){var k;const P=O(R.response.headers);return Object.assign(Object.assign({},((k=R.data)===null||k===void 0?void 0:k.body)||R.data),{getHeaders:()=>P})}e.finalResponse=T;function O(R){const k=(0,u.createResponseHeaders)(R),P=a.PORTKEY_HEADER_PREFIX,z=Object.entries(k).filter(([L,G])=>L.startsWith(P)).map(([L,G])=>[L.replace(P,""),G]);return Object.fromEntries(z)}e.portkeyHeaders=O;function v(R){const k=R.customHeaders,P=R.portkeyHeaders;return Object.prototype.hasOwnProperty.call(k,"authorization")&&!k.authorization.startsWith("Bearer")&&(R.customHeaders.authorization="Bearer "+R.customHeaders.authorization),Object.assign(Object.assign({},k),P)}e.defaultHeadersBuilder=v;function C(R){var k;return new o.default({apiKey:R.apiKey||(0,e.readEnv)("OPENAI_API_KEY")||a.OPEN_AI_API_KEY,baseURL:R.baseURL,defaultHeaders:v(R),maxRetries:0,dangerouslyAllowBrowser:(k=R.dangerouslyAllowBrowser)!==null&&k!==void 0?k:!1,fetch:(P,z)=>n(this,void 0,void 0,function*(){var L,G;const F=Object.assign(Object.assign({},z),z?.body&&typeof((L=z.body)===null||L===void 0?void 0:L.pipe)=="function"&&{duplex:"half"});if(F.body&&((G=F.body.constructor)===null||G===void 0?void 0:G.name)==="FormData"){if(F.headers instanceof Headers)F.headers.delete("Content-Type");else if(F.headers&&"Content-Type"in F.headers&&typeof F.headers=="object"){const Z=F.headers;delete Z["Content-Type"]}}let K=!1,B;try{B=yield fetch(P,F)}catch{K=!0}if(K||B&&!B.ok&&R._shouldRetry(B))return yield fetch(P,F);if(B)return B;throw(0,e.castToError)(B)})})}e.initOpenAIClient=C;function x(R){if(!R)return"";const k=Object.entries(R).filter(([,P])=>P!=null).map(([P,z])=>`${P}=${z}`).join("&");return k?`?${k}`:""}e.toQueryParams=x;function I(R,k){return R||(k?a.PORTKEY_BASE_URL:a.LOCAL_BASE_URL)}e.setBaseURL=I;function j(R,k){if(k)return k;if(R===a.PORTKEY_BASE_URL&&!k)throw(0,e.castToError)(a.MISSING_API_KEY_ERROR_MESSAGE)}e.setApiKey=j})(Fa)),Fa}var $u={},wO;function mt(){if(wO)return $u;wO=1,Object.defineProperty($u,"__esModule",{value:!0}),$u.createHeaders=void 0;const e=ot(),t=n=>{const i={};let a=[];n.forwardHeaders&&(a=n.forwardHeaders.map(u=>u.replace("ID","Id").replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`)));for(let u in n){let o=n[u];if(!(0,e.isEmpty)(o)){if(u.toLocaleLowerCase()==="authorization"){i[u.toLowerCase()]=o||"";continue}typeof o=="boolean"&&(o=o.toString()),u==="forwardHeaders"&&(o=o.join(",")),u=u.replace("ID","Id").replace(/[A-Z]/g,f=>`-${f.toLowerCase()}`),!(0,e.isEmpty)(o)&&typeof o=="object"&&(o=JSON.stringify(o)),a&&a.includes(u)?i[u]=o||"":i[(0,e.getPortkeyHeader)(u)]=o||""}}return i};return $u.createHeaders=t,$u}var RO;function mH(){if(RO)return bs;RO=1;var e=bs&&bs.__awaiter||function(d,l,h,m){function g(b){return b instanceof h?b:new h(function(E){E(b)})}return new(h||(h=Promise))(function(b,E){function T(C){try{v(m.next(C))}catch(x){E(x)}}function O(C){try{v(m.throw(C))}catch(x){E(x)}}function v(C){C.done?b(C.value):g(C.value).then(T,O)}v((m=m.apply(d,l||[])).next())})};Object.defineProperty(bs,"__esModule",{value:!0}),bs.ChatCompletionsMessages=bs.Chat=void 0;const t=gt(),n=Tr(),i=ot(),a=mt();class u extends t.ApiResource{constructor(){super(...arguments),this.completions=new o(this.client)}}bs.Chat=u;class o extends t.ApiResource{constructor(){super(...arguments),this.messages=new f(this.client)}create(l,h,m){var g;const b=l;if(h){const T=(0,i.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,a.createHeaders)(Object.assign(Object.assign({},h),{config:T})))}const E=(g=l.stream)!==null&&g!==void 0?g:!1;return this.post(n.CHAT_COMPLETE_API,Object.assign(Object.assign({body:b},m),{stream:E}))}retrieve(l,h,m){if(h){const g=(0,i.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,a.createHeaders)(Object.assign(Object.assign({},h),{config:g})))}return this.getMethod(`${n.CHAT_COMPLETE_API}/${l}`,Object.assign({},m))}update(l,h,m,g){const b=h;if(m){const E=(0,i.overrideConfig)(this.client.config,m.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,a.createHeaders)(Object.assign(Object.assign({},m),{config:E})))}return this.post(`${n.CHAT_COMPLETE_API}/${l}`,Object.assign({body:b},g))}list(l,h,m){if(h){const g=(0,i.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,a.createHeaders)(Object.assign(Object.assign({},h),{config:g})))}return this.getMethod(`${n.CHAT_COMPLETE_API}`,Object.assign(Object.assign({},m),l))}delete(l,h,m){if(h){const g=(0,i.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,a.createHeaders)(Object.assign(Object.assign({},h),{config:g})))}return this.deleteMethod(`${n.CHAT_COMPLETE_API}/${l}`,Object.assign({},m))}parse(l,h,m){return e(this,void 0,void 0,function*(){if(h){const E=(0,i.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,a.createHeaders)(Object.assign(Object.assign({},h),{config:E})))}return yield(0,i.initOpenAIClient)(this.client).responses.parse(l,m)})}stream(l,h,m){return e(this,void 0,void 0,function*(){if(h){const E=(0,i.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,a.createHeaders)(Object.assign(Object.assign({},h),{config:E})))}return yield(0,i.initOpenAIClient)(this.client).chat.completions.stream(l,m)})}runTools(l,h,m){if(h){const E=(0,i.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,a.createHeaders)(Object.assign(Object.assign({},h),{config:E})))}return(0,i.initOpenAIClient)(this.client).chat.completions.runTools(l,m)}}class f extends t.ApiResource{list(l,h,m,g){if(m){const b=(0,i.overrideConfig)(this.client.config,m.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,a.createHeaders)(Object.assign(Object.assign({},m),{config:b})))}return this.getMethod(`${n.CHAT_COMPLETE_API}/${l}/messages`,Object.assign(Object.assign({},g),h))}}return bs.ChatCompletionsMessages=f,bs}var qu={},NO;function pH(){if(NO)return qu;NO=1,Object.defineProperty(qu,"__esModule",{value:!0}),qu.Completions=void 0;const e=gt(),t=Tr(),n=ot(),i=mt();class a extends e.ApiResource{create(o,f,d){var l;const h=o;if(f){const g=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:g})))}const m=(l=o.stream)!==null&&l!==void 0?l:!1;return this.client.responseHeaders,this.post(t.TEXT_COMPLETE_API,Object.assign(Object.assign({body:h},d),{stream:m}))}}return qu.Completions=a,qu}var Gu={},IO;function gH(){if(IO)return Gu;IO=1,Object.defineProperty(Gu,"__esModule",{value:!0}),Gu.Feedback=void 0;const e=gt(),t=Tr(),n=ot(),i=mt();class a extends e.ApiResource{create(o,f,d){const l=o;if(f){const m=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:m})))}return this.post(t.FEEDBACK_API,Object.assign({body:l},d))}update(o,f,d){const l=o,h=o.feedbackID;if(f){const g=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:g})))}return this.put(t.FEEDBACK_API+"/"+h,Object.assign({body:l},d))}}return Gu.Feedback=a,Gu}var _r={},kO;function bH(){if(kO)return _r;kO=1,Object.defineProperty(_r,"__esModule",{value:!0}),_r.PromptCompletions=_r.PromptPartialsVersions=_r.Partials=_r.PromptVersions=_r.Prompt=_r.Generations=void 0;const e=Tr(),t=gt(),n=ot(),i=mt();class a extends t.ApiResource{create(m,g){console.warn("This API has been deprecated. Please use the Prompt API for the saved prompt.");const E={variables:m.variables};return this.post(`/v1/prompts/${m.promptID}/generate`,Object.assign({body:E},g))}}_r.Generations=a;class u extends t.ApiResource{constructor(m){super(m),this.completions=new l(m),this.versions=new o(m),this.partials=new f(m)}render(m,g,b){const E=m,T=m.promptID;if(g){const v=(0,n.overrideConfig)(this.client.config,g.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},g),{config:v})))}return this.post(`/prompts/${T}/render`,Object.assign({body:E},b))}create(m,g,b){const E=m;if(g){const O=(0,n.overrideConfig)(this.client.config,g.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},g),{config:O})))}return this.post(e.PROMPTS_API,Object.assign({body:E},b))}list(m,g,b){const E=m?(0,n.toQueryParams)(m):"";if(g){const O=(0,n.overrideConfig)(this.client.config,g.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},g),{config:O})))}return this.getMethod(`${e.PROMPTS_API}${E}`,Object.assign({},b))}retrieve(m,g,b){if(g){const T=(0,n.overrideConfig)(this.client.config,g.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},g),{config:T})))}return this.getMethod(`${e.PROMPTS_API}/${m}`,Object.assign({},b))}update(m,g,b,E){const T=g;if(b){const v=(0,n.overrideConfig)(this.client.config,b.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},b),{config:v})))}return this.put(`${e.PROMPTS_API}/${m}`,Object.assign({body:T},E))}delete(m,g,b){if(g){const T=(0,n.overrideConfig)(this.client.config,g.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},g),{config:T})))}return this.deleteMethod(`${e.PROMPTS_API}/${m}`,Object.assign({},b))}publish(m,g,b,E){if(b){const O=(0,n.overrideConfig)(this.client.config,b.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},b),{config:O})))}return this.put(`${e.PROMPTS_API}/${m}/makeDefault`,Object.assign({body:g},E))}}_r.Prompt=u;class o extends t.ApiResource{list(m,g,b){if(g){const T=(0,n.overrideConfig)(this.client.config,g.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},g),{config:T})))}return this.getMethod(`${e.PROMPTS_API}/${m}/versions`,Object.assign({},b))}retrieve(m,g,b,E){if(b){const O=(0,n.overrideConfig)(this.client.config,b.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},b),{config:O})))}return this.getMethod(`${e.PROMPTS_API}/${m}/versions/${g}`,Object.assign({},E))}update(m,g,b,E,T){if(E){const v=(0,n.overrideConfig)(this.client.config,E.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},E),{config:v})))}return this.put(`${e.PROMPTS_API}/${m}/versions/${g}`,Object.assign({body:b},T))}}_r.PromptVersions=o;class f extends t.ApiResource{constructor(m){super(m),this.versions=new d(m)}create(m,g,b){const E=m;if(g){const O=(0,n.overrideConfig)(this.client.config,g.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},g),{config:O})))}return this.post(`${e.PROMPT_PARTIALS_API}`,Object.assign({body:E},b))}list(m,g,b){const E=m?(0,n.toQueryParams)(m):"";if(g){const O=(0,n.overrideConfig)(this.client.config,g.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},g),{config:O})))}return this.getMethod(`${e.PROMPT_PARTIALS_API}${E}`,Object.assign({},b))}retrieve(m,g,b){if(g){const T=(0,n.overrideConfig)(this.client.config,g.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},g),{config:T})))}return this.getMethod(`${e.PROMPT_PARTIALS_API}/${m}`,Object.assign({},b))}update(m,g,b,E){if(b){const O=(0,n.overrideConfig)(this.client.config,b.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},b),{config:O})))}return this.put(`${e.PROMPT_PARTIALS_API}/${m}`,Object.assign({body:g},E))}delete(m,g,b){if(g){const T=(0,n.overrideConfig)(this.client.config,g.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},g),{config:T})))}return this.deleteMethod(`${e.PROMPT_PARTIALS_API}/${m}`,Object.assign({},b))}publish(m,g,b,E){if(b){const O=(0,n.overrideConfig)(this.client.config,b.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},b),{config:O})))}return this.put(`${e.PROMPT_PARTIALS_API}/${m}/makeDefault`,Object.assign({body:g},E))}}_r.Partials=f;class d extends t.ApiResource{list(m,g,b){if(g){const T=(0,n.overrideConfig)(this.client.config,g.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},g),{config:T})))}return this.getMethod(`${e.PROMPT_PARTIALS_API}/${m}/versions`,Object.assign({},b))}}_r.PromptPartialsVersions=d;class l extends t.ApiResource{create(m,g,b){var E;if(g){const x=(0,n.overrideConfig)(this.client.config,g.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},g),{config:x})))}const T=m.promptID,O=m,v=(E=m.stream)!==null&&E!==void 0?E:!1;return delete O.promptID,O.stream=v,this.post(`/prompts/${T}/completions`,Object.assign(Object.assign({body:O},b),{stream:v}))}}return _r.PromptCompletions=l,_r}var Ku={},MO;function _H(){if(MO)return Ku;MO=1,Object.defineProperty(Ku,"__esModule",{value:!0}),Ku.postMethod=void 0;const e=gt(),t=ot(),n=mt();let i=class extends e.ApiResource{create(u,o,f,d){const l=o;if(f){const m=(0,t.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign(Object.assign({},f),{config:m})))}return this.post(u,Object.assign({body:l},d))}};return Ku.postMethod=i,Ku}var Yu={},PO;function yH(){if(PO)return Yu;PO=1,Object.defineProperty(Yu,"__esModule",{value:!0}),Yu.getMethod=void 0;const e=gt(),t=ot(),n=mt();let i=class extends e.ApiResource{create(u,o,f){if(o){const l=(0,t.overrideConfig)(this.client.config,o.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign(Object.assign({},o),{config:l})))}return this.getMethod(u,Object.assign({},f))}};return Yu.getMethod=i,Yu}var Vu={},DO;function EH(){if(DO)return Vu;DO=1,Object.defineProperty(Vu,"__esModule",{value:!0}),Vu.deleteMethod=void 0;const e=gt(),t=ot(),n=mt();let i=class extends e.ApiResource{create(u,o,f){if(o){const l=(0,t.overrideConfig)(this.client.config,o.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign(Object.assign({},o),{config:l})))}return this.deleteMethod(u,Object.assign({},f))}};return Vu.deleteMethod=i,Vu}var Zu={},jO;function vH(){if(jO)return Zu;jO=1,Object.defineProperty(Zu,"__esModule",{value:!0}),Zu.putMethod=void 0;const e=gt(),t=ot(),n=mt();let i=class extends e.ApiResource{create(u,o,f,d){const l=o;if(f){const m=(0,t.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign(Object.assign({},f),{config:m})))}return this.put(u,Object.assign({body:l},d))}};return Zu.putMethod=i,Zu}var Wu={},LO;function TH(){if(LO)return Wu;LO=1,Object.defineProperty(Wu,"__esModule",{value:!0}),Wu.Embeddings=void 0;const e=gt(),t=Tr(),n=ot(),i=mt();class a extends e.ApiResource{create(o,f,d){const l=o;if(f){const m=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:m})))}return this.post(t.EMBEDDINGS_API,Object.assign({body:l},d))}}return Wu.Embeddings=a,Wu}var qa={},HO;function AH(){if(HO)return qa;HO=1;var e=qa&&qa.__awaiter||function(u,o,f,d){function l(h){return h instanceof f?h:new f(function(m){m(h)})}return new(f||(f=Promise))(function(h,m){function g(T){try{E(d.next(T))}catch(O){m(O)}}function b(T){try{E(d.throw(T))}catch(O){m(O)}}function E(T){T.done?h(T.value):l(T.value).then(g,b)}E((d=d.apply(u,o||[])).next())})};Object.defineProperty(qa,"__esModule",{value:!0}),qa.Images=void 0;const t=gt(),n=ot(),i=mt();class a extends t.ApiResource{generate(o,f,d){if(f){const h=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:h})))}const l=(0,n.initOpenAIClient)(this.client);return o.stream?l.images.generate(o,d):l.images.generate(o,d).withResponse().then(m=>(0,n.finalResponse)(m))}edit(o,f,d){if(f){const h=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:h})))}const l=(0,n.initOpenAIClient)(this.client);return o.stream?l.images.edit(o,d):l.images.edit(o,d).withResponse().then(m=>(0,n.finalResponse)(m))}createVariation(o,f,d){return e(this,void 0,void 0,function*(){const l=o;if(f){const g=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:g})))}const m=yield(0,n.initOpenAIClient)(this.client).images.createVariation(l,d).withResponse();return(0,n.finalResponse)(m)})}}return qa.Images=a,qa}var Ga={},BO;function OH(){if(BO)return Ga;BO=1;var e=Ga&&Ga.__awaiter||function(u,o,f,d){function l(h){return h instanceof f?h:new f(function(m){m(h)})}return new(f||(f=Promise))(function(h,m){function g(T){try{E(d.next(T))}catch(O){m(O)}}function b(T){try{E(d.throw(T))}catch(O){m(O)}}function E(T){T.done?h(T.value):l(T.value).then(g,b)}E((d=d.apply(u,o||[])).next())})};Object.defineProperty(Ga,"__esModule",{value:!0}),Ga.Assistants=void 0;const t=gt(),n=ot(),i=mt();class a extends t.ApiResource{create(o,f,d){return e(this,void 0,void 0,function*(){const l=o;if(f){const g=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:g})))}const m=yield(0,n.initOpenAIClient)(this.client).beta.assistants.create(l,d).withResponse();return(0,n.finalResponse)(m)})}list(o,f,d){return e(this,void 0,void 0,function*(){const l=o;if(f){const g=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:g})))}const m=yield(0,n.initOpenAIClient)(this.client).beta.assistants.list(l,d).withResponse();return(0,n.finalResponse)(m)})}retrieve(o,f,d){return e(this,void 0,void 0,function*(){if(f){const m=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:m})))}const h=yield(0,n.initOpenAIClient)(this.client).beta.assistants.retrieve(o,d).withResponse();return(0,n.finalResponse)(h)})}update(o,f,d,l){return e(this,void 0,void 0,function*(){const h=f;if(d){const b=(0,n.overrideConfig)(this.client.config,d.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},d),{config:b})))}const g=yield(0,n.initOpenAIClient)(this.client).beta.assistants.update(o,h,l).withResponse();return(0,n.finalResponse)(g)})}delete(o,f,d){return e(this,void 0,void 0,function*(){if(f){const m=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:m})))}const h=yield(0,n.initOpenAIClient)(this.client).beta.assistants.delete(o,d).withResponse();return(0,n.finalResponse)(h)})}}return Ga.Assistants=a,Ga}var Yr={},UO;function SH(){if(UO)return Yr;UO=1;var e=Yr&&Yr.__awaiter||function(d,l,h,m){function g(b){return b instanceof h?b:new h(function(E){E(b)})}return new(h||(h=Promise))(function(b,E){function T(C){try{v(m.next(C))}catch(x){E(x)}}function O(C){try{v(m.throw(C))}catch(x){E(x)}}function v(C){C.done?b(C.value):g(C.value).then(T,O)}v((m=m.apply(d,l||[])).next())})};Object.defineProperty(Yr,"__esModule",{value:!0}),Yr.Steps=Yr.Runs=Yr.Messages=Yr.Threads=void 0;const t=gt(),n=ot(),i=mt();class a extends t.ApiResource{constructor(l){super(l),this.messages=new u(l),this.runs=new o(l)}create(l,h,m){return e(this,void 0,void 0,function*(){const g=l;if(h){const T=(0,n.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},h),{config:T})))}const E=yield(0,n.initOpenAIClient)(this.client).beta.threads.create(g,m).withResponse();return(0,n.finalResponse)(E)})}retrieve(l,h,m){return e(this,void 0,void 0,function*(){if(h){const E=(0,n.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},h),{config:E})))}const b=yield(0,n.initOpenAIClient)(this.client).beta.threads.retrieve(l,m).withResponse();return(0,n.finalResponse)(b)})}update(l,h,m,g){return e(this,void 0,void 0,function*(){const b=h;if(m){const O=(0,n.overrideConfig)(this.client.config,m.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},m),{config:O})))}const T=yield(0,n.initOpenAIClient)(this.client).beta.threads.update(l,b,g).withResponse();return(0,n.finalResponse)(T)})}delete(l,h,m){return e(this,void 0,void 0,function*(){if(h){const E=(0,n.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},h),{config:E})))}const b=yield(0,n.initOpenAIClient)(this.client).beta.threads.delete(l,m).withResponse();return(0,n.finalResponse)(b)})}createAndRun(l,h,m){return e(this,void 0,void 0,function*(){const g=l,{stream:b}=g;if(h){const T=(0,n.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},h),{config:T})))}const E=(0,n.initOpenAIClient)(this.client);if(b===!0)return yield E.beta.threads.createAndRunStream(g,m);{const T=yield E.beta.threads.createAndRun(g,m).withResponse();return(0,n.finalResponse)(T)}})}createAndRunPoll(l,h,m){return e(this,void 0,void 0,function*(){const g=l;if(h){const T=(0,n.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},h),{config:T})))}return yield(0,n.initOpenAIClient)(this.client).beta.threads.createAndRunPoll(g,m)})}createAndRunStream(l,h,m){return e(this,void 0,void 0,function*(){const g=l;if(h){const T=(0,n.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},h),{config:T})))}return yield(0,n.initOpenAIClient)(this.client).beta.threads.createAndRunStream(g,m)})}}Yr.Threads=a;class u extends t.ApiResource{create(l,h,m,g){return e(this,void 0,void 0,function*(){const b=h;if(m){const O=(0,n.overrideConfig)(this.client.config,m.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},m),{config:O})))}const T=yield(0,n.initOpenAIClient)(this.client).beta.threads.messages.create(l,b,g).withResponse();return(0,n.finalResponse)(T)})}list(l,h,m,g){return e(this,void 0,void 0,function*(){const b=h;if(m){const O=(0,n.overrideConfig)(this.client.config,m.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},m),{config:O})))}const T=yield(0,n.initOpenAIClient)(this.client).beta.threads.messages.list(l,b,g).withResponse();return(0,n.finalResponse)(T)})}retrieve(l,{thread_id:h},m,g){return e(this,void 0,void 0,function*(){if(m){const T=(0,n.overrideConfig)(this.client.config,m.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},m),{config:T})))}const E=yield(0,n.initOpenAIClient)(this.client).beta.threads.messages.retrieve(l,{thread_id:h},g).withResponse();return(0,n.finalResponse)(E)})}update(l,h,m,g){return e(this,void 0,void 0,function*(){const b=h;if(m){const O=(0,n.overrideConfig)(this.client.config,m.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},m),{config:O})))}const T=yield(0,n.initOpenAIClient)(this.client).beta.threads.messages.update(l,b,g).withResponse();return(0,n.finalResponse)(T)})}delete(l,{thread_id:h},m,g){return e(this,void 0,void 0,function*(){if(m){const T=(0,n.overrideConfig)(this.client.config,m.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},m),{config:T})))}const E=yield(0,n.initOpenAIClient)(this.client).beta.threads.messages.delete(l,{thread_id:h},g).withResponse();return(0,n.finalResponse)(E)})}}Yr.Messages=u;class o extends t.ApiResource{constructor(l){super(l),this.steps=new f(l)}create(l,h,m,g){return e(this,void 0,void 0,function*(){const b=h,{stream:E}=b;if(m){const O=(0,n.overrideConfig)(this.client.config,m.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},m),{config:O})))}const T=(0,n.initOpenAIClient)(this.client);if(E===!0)return yield T.beta.threads.runs.stream(l,b,g);{const O=yield T.beta.threads.runs.create(l,b,g).withResponse();return(0,n.finalResponse)(O)}})}list(l,h,m,g){return e(this,void 0,void 0,function*(){const b=h;if(m){const O=(0,n.overrideConfig)(this.client.config,m.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},m),{config:O})))}const T=yield(0,n.initOpenAIClient)(this.client).beta.threads.runs.list(l,b,g).withResponse();return(0,n.finalResponse)(T)})}retrieve(l,{thread_id:h},m,g){return e(this,void 0,void 0,function*(){if(m){const T=(0,n.overrideConfig)(this.client.config,m.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},m),{config:T})))}const E=yield(0,n.initOpenAIClient)(this.client).beta.threads.runs.retrieve(l,{thread_id:h},g).withResponse();return(0,n.finalResponse)(E)})}update(l,h,m,g){return e(this,void 0,void 0,function*(){const b=h;if(m){const O=(0,n.overrideConfig)(this.client.config,m.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},m),{config:O})))}const T=yield(0,n.initOpenAIClient)(this.client).beta.threads.runs.update(l,b,g).withResponse();return(0,n.finalResponse)(T)})}submitToolOutputs(l,h,m,g){return e(this,void 0,void 0,function*(){const b=h;if(m){const O=(0,n.overrideConfig)(this.client.config,m.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},m),{config:O})))}const T=yield(0,n.initOpenAIClient)(this.client).beta.threads.runs.submitToolOutputs(l,b,g).withResponse();return(0,n.finalResponse)(T)})}submitToolOutputsAndPoll(l,h,m,g){return e(this,void 0,void 0,function*(){const b=h;if(m){const O=(0,n.overrideConfig)(this.client.config,m.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},m),{config:O})))}return yield(0,n.initOpenAIClient)(this.client).beta.threads.runs.submitToolOutputsAndPoll(l,b,g)})}submitToolOutputsStream(l,h,m,g){return e(this,void 0,void 0,function*(){const b=h;if(m){const O=(0,n.overrideConfig)(this.client.config,m.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},m),{config:O})))}return yield(0,n.initOpenAIClient)(this.client).beta.threads.runs.submitToolOutputsStream(l,b,g)})}cancel(l,{thread_id:h},m,g){return e(this,void 0,void 0,function*(){if(m){const v=(0,n.overrideConfig)(this.client.config,m.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},m),{config:v})))}const b=(0,n.initOpenAIClient)(this.client),T=Object.assign({body:{}},g),O=yield b.beta.threads.runs.cancel(l,{thread_id:h},T).withResponse();return(0,n.finalResponse)(O)})}createAndPoll(l,h,m,g){return e(this,void 0,void 0,function*(){const b=h;if(m){const O=(0,n.overrideConfig)(this.client.config,m.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},m),{config:O})))}return yield(0,n.initOpenAIClient)(this.client).beta.threads.runs.createAndPoll(l,b,g)})}createAndStream(l,h,m,g){return e(this,void 0,void 0,function*(){const b=h;if(m){const O=(0,n.overrideConfig)(this.client.config,m.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},m),{config:O})))}return yield(0,n.initOpenAIClient)(this.client).beta.threads.runs.createAndStream(l,b,g)})}poll(l,{thread_id:h},m,g){return e(this,void 0,void 0,function*(){if(m){const T=(0,n.overrideConfig)(this.client.config,m.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},m),{config:T})))}return yield(0,n.initOpenAIClient)(this.client).beta.threads.runs.poll(l,{thread_id:h},g)})}stream(l,h,m,g){return e(this,void 0,void 0,function*(){const b=h;if(m){const O=(0,n.overrideConfig)(this.client.config,m.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},m),{config:O})))}return yield(0,n.initOpenAIClient)(this.client).beta.threads.runs.stream(l,b,g)})}}Yr.Runs=o;class f extends t.ApiResource{list(l,h,m,g){return e(this,void 0,void 0,function*(){const b=h;if(m){const O=(0,n.overrideConfig)(this.client.config,m.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},m),{config:O})))}const T=yield(0,n.initOpenAIClient)(this.client).beta.threads.runs.steps.list(l,b,g).withResponse();return(0,n.finalResponse)(T)})}retrieve(l,{thread_id:h,run_id:m},g,b){return e(this,void 0,void 0,function*(){if(g){const O=(0,n.overrideConfig)(this.client.config,g.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},g),{config:O})))}const T=yield(0,n.initOpenAIClient)(this.client).beta.threads.runs.steps.retrieve(l,{thread_id:h,run_id:m},b).withResponse();return(0,n.finalResponse)(T)})}}return Yr.Steps=f,Yr}var Ka={},FO;function CH(){if(FO)return Ka;FO=1;var e=Ka&&Ka.__awaiter||function(u,o,f,d){function l(h){return h instanceof f?h:new f(function(m){m(h)})}return new(f||(f=Promise))(function(h,m){function g(T){try{E(d.next(T))}catch(O){m(O)}}function b(T){try{E(d.throw(T))}catch(O){m(O)}}function E(T){T.done?h(T.value):l(T.value).then(g,b)}E((d=d.apply(u,o||[])).next())})};Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.MainFiles=void 0;const t=gt(),n=ot(),i=mt();class a extends t.ApiResource{create(o,f,d){return e(this,void 0,void 0,function*(){const l=o;if(f){const g=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:g})))}const m=yield(0,n.initOpenAIClient)(this.client).files.create(l,d).withResponse();return(0,n.finalResponse)(m)})}list(o,f,d){return e(this,void 0,void 0,function*(){const l=o;if(f){const g=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:g})))}const m=yield(0,n.initOpenAIClient)(this.client).files.list(l,d).withResponse();return(0,n.finalResponse)(m)})}retrieve(o,f,d){return e(this,void 0,void 0,function*(){if(f){const m=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:m})))}const h=yield(0,n.initOpenAIClient)(this.client).files.retrieve(o,d).withResponse();return(0,n.finalResponse)(h)})}delete(o,f,d){return e(this,void 0,void 0,function*(){if(f){const m=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:m})))}const h=yield(0,n.initOpenAIClient)(this.client).files.delete(o,d).withResponse();return(0,n.finalResponse)(h)})}content(o,f,d){return e(this,void 0,void 0,function*(){if(f){const m=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:m})))}const h=yield(0,n.initOpenAIClient)(this.client).files.content(o,d).withResponse();return(0,n.finalResponse)(h)})}retrieveContent(o,f,d){return e(this,void 0,void 0,function*(){if(f){const m=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:m})))}const h=yield(0,n.initOpenAIClient)(this.client).files.content(o,d).withResponse();return(0,n.finalResponse)(h)})}waitForProcessing(o,f,d){return e(this,void 0,void 0,function*(){const l=f;if(d){const g=(0,n.overrideConfig)(this.client.config,d.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},d),{config:g})))}return yield(0,n.initOpenAIClient)(this.client).files.waitForProcessing(o,Object.assign(Object.assign({},l.pollInterval!==void 0&&{pollInterval:l.pollInterval}),l.maxWait!==void 0&&{maxWait:l.maxWait}))})}}return Ka.MainFiles=a,Ka}var Ya={},zO;function xH(){if(zO)return Ya;zO=1;var e=Ya&&Ya.__awaiter||function(u,o,f,d){function l(h){return h instanceof f?h:new f(function(m){m(h)})}return new(f||(f=Promise))(function(h,m){function g(T){try{E(d.next(T))}catch(O){m(O)}}function b(T){try{E(d.throw(T))}catch(O){m(O)}}function E(T){T.done?h(T.value):l(T.value).then(g,b)}E((d=d.apply(u,o||[])).next())})};Object.defineProperty(Ya,"__esModule",{value:!0}),Ya.Models=void 0;const t=gt(),n=ot(),i=mt();class a extends t.ApiResource{list(o,f){return e(this,void 0,void 0,function*(){if(o){const h=(0,n.overrideConfig)(this.client.config,o.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},o),{config:h})))}const l=yield(0,n.initOpenAIClient)(this.client).models.list(f).withResponse();return(0,n.finalResponse)(l)})}retrieve(o,f,d){return e(this,void 0,void 0,function*(){if(f){const m=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:m})))}const h=yield(0,n.initOpenAIClient)(this.client).models.retrieve(o,d).withResponse();return(0,n.finalResponse)(h)})}delete(o,f,d){return e(this,void 0,void 0,function*(){if(f){const m=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:m})))}const h=yield(0,n.initOpenAIClient)(this.client).models.delete(o,d).withResponse();return(0,n.finalResponse)(h)})}}return Ya.Models=a,Ya}var Vr={},$O;function wH(){if($O)return Vr;$O=1,Object.defineProperty(Vr,"__esModule",{value:!0}),Vr.Member=Vr.Workspaces=Vr.Invites=Vr.Users=Vr.Admin=void 0;const e=gt(),t=mt(),n=ot();class i extends e.ApiResource{constructor(l){super(l),this.users=new a(l),this.workspaces=new o(l)}}Vr.Admin=i;class a extends e.ApiResource{constructor(){super(...arguments),this.invites=new u(this.client)}retrieve(l,h,m){const b=l.userId;return h&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},h)))),this.getMethod(`/admin/users/${b}`,Object.assign({},m))}list(l,h,m){const g=l;h&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},h))));const b=(0,n.toQueryParams)(g);return this.getMethod(`/admin/users${b}`,Object.assign({},m))}update(l,h,m){const g=l,b=g.userId;return delete g.userId,h&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},h)))),this.put(`/admin/users/${b}`,Object.assign({body:g},m))}delete(l,h,m){const g=l,b=g.userId;return h&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},h)))),this.deleteMethod(`/admin/users/${b}`,Object.assign({body:g},m))}}Vr.Users=a;class u extends e.ApiResource{create(l,h,m){const g=l;return h&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},h)))),this.post("/admin/users/invites",Object.assign({body:g},m))}retrieve(l,h,m){const b=l.inviteId;return h&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},h)))),this.getMethod(`/admin/users/invites/${b}`,Object.assign({},m))}list(l,h,m){const g=l;h&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},h))));const b=g?(0,n.toQueryParams)(g):"";return this.getMethod(`/admin/users/invites${b}`,Object.assign({},m))}delete(l,h,m){const g=l,b=g.inviteId;return h&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},h)))),this.deleteMethod(`/admin/users/invites/${b}`,Object.assign({body:g},m))}resend(l,h,m){const b=l.inviteId;return h&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},h)))),this.post(`/admin/users/invites/${b}/resend`,Object.assign({},m))}}Vr.Invites=u;class o extends e.ApiResource{constructor(){super(...arguments),this.users=new f(this.client)}create(l,h,m){const g=l;return h&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},h)))),this.post("/admin/workspaces",Object.assign({body:g},m))}retrieve(l,h,m){const b=l.workspaceId;return h&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},h)))),this.getMethod(`/admin/workspaces/${b}`,Object.assign({},m))}list(l,h,m){const g=l;h&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},h))));const b=(0,n.toQueryParams)(g);return this.getMethod(`/admin/workspaces${b}`,Object.assign({},m))}update(l,h,m){const g=l,b=g.workspaceId;return delete g.workspaceId,h&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},h)))),this.put(`/admin/workspaces/${b}`,Object.assign({body:g},m))}delete(l,h,m){const g=l,b=g.workspaceId;return h&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},h)))),this.deleteMethod(`/admin/workspaces/${b}`,Object.assign({body:g},m))}}Vr.Workspaces=o;class f extends e.ApiResource{create(l,h,m){const g=l,b=g.workspaceId;return h&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},h)))),this.post(`/admin/workspaces/${b}/users`,Object.assign({body:g},m))}retrieve(l,h,m){const g=l,b=g.workspaceId,E=g.userId;return h&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},h)))),this.getMethod(`/admin/workspaces/${b}/users/${E}`,Object.assign({},m))}list(l,h,m){const g=l,b=g.workspaceId;h&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},h))));const E=(0,n.toQueryParams)(g);return this.getMethod(`/admin/workspaces/${b}/users${E}`,Object.assign({},m))}delete(l,h,m){const g=l,b=g.workspaceId,E=g.userId;return h&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},h)))),this.deleteMethod(`/admin/workspaces/${b}/users/${E}`,Object.assign({body:g},m))}update(l,h,m){const g=l,b=g.workspaceId,E=g.userId;return delete g.workspaceId,h&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},h)))),this.put(`/admin/workspaces/${b}/users/${E}`,Object.assign({body:g},m))}}return Vr.Member=f,Vr}var Xu={},qO;function RH(){if(qO)return Xu;qO=1,Object.defineProperty(Xu,"__esModule",{value:!0}),Xu.Configs=void 0;const e=gt(),t=mt(),n=ot();class i extends e.ApiResource{constructor(u){super(u)}create(u,o,f){const d=u;return o&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},o)))),this.post("/configs",Object.assign({body:d},f))}retrieve(u,o,f){const l=u.slug;return o&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},o)))),this.getMethod(`/configs/${l}`,Object.assign({},f))}update(u,o,f){const d=u,l=d.slug;return o&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},o)))),this.put(`/configs/${l}`,Object.assign({body:d},f))}list(u,o,f){const d=u,l=(0,n.toQueryParams)(d);return o&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},o)))),this.getMethod(`/configs${l}`,Object.assign({},f))}delete(u,o,f){const d=u;let l="";return d.id?(l=d.id,console.warn('You are using "id" to delete a config. This will be deprecated in the future. Please use "slug" instead.')):d.slug&&(l=d.slug),o&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},o)))),this.deleteMethod(`/configs/${l}`,Object.assign({},f))}}return Xu.Configs=i,Xu}var Va={},GO;function NH(){if(GO)return Va;GO=1;var e=Va&&Va.__awaiter||function(u,o,f,d){function l(h){return h instanceof f?h:new f(function(m){m(h)})}return new(f||(f=Promise))(function(h,m){function g(T){try{E(d.next(T))}catch(O){m(O)}}function b(T){try{E(d.throw(T))}catch(O){m(O)}}function E(T){T.done?h(T.value):l(T.value).then(g,b)}E((d=d.apply(u,o||[])).next())})};Object.defineProperty(Va,"__esModule",{value:!0}),Va.Batches=void 0;const t=gt(),n=ot(),i=mt();class a extends t.ApiResource{create(o,f,d){return e(this,void 0,void 0,function*(){const l=o;if(f){const g=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:g})))}const m=yield(0,n.initOpenAIClient)(this.client).batches.create(l,d).withResponse();return(0,n.finalResponse)(m)})}retrieve(o,f,d){return e(this,void 0,void 0,function*(){if(f){const m=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:m})))}const h=yield(0,n.initOpenAIClient)(this.client).batches.retrieve(o,d).withResponse();return(0,n.finalResponse)(h)})}list(o,f,d){return e(this,void 0,void 0,function*(){const l=o;if(f){const g=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:g})))}const m=yield(0,n.initOpenAIClient)(this.client).batches.list(l,d).withResponse();return(0,n.finalResponse)(m)})}cancel(o,f,d){return e(this,void 0,void 0,function*(){if(f){const b=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:b})))}const l=(0,n.initOpenAIClient)(this.client),m=Object.assign({body:{}},d),g=yield l.batches.cancel(o,m).withResponse();return(0,n.finalResponse)(g)})}output(o,f,d){if(f){const h=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:h})))}return this.getMethod(`/batches/${o}/output`,d)}}return Va.Batches=a,Va}var Za={},KO;function IH(){if(KO)return Za;KO=1;var e=Za&&Za.__rest||function(u,o){var f={};for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&o.indexOf(d)<0&&(f[d]=u[d]);if(u!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,d=Object.getOwnPropertySymbols(u);l<d.length;l++)o.indexOf(d[l])<0&&Object.prototype.propertyIsEnumerable.call(u,d[l])&&(f[d[l]]=u[d[l]]);return f};Object.defineProperty(Za,"__esModule",{value:!0}),Za.VirtualKeys=void 0;const t=gt(),n=mt(),i=ot();class a extends t.ApiResource{create(o,f,d){return f&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign({},f)))),this.post("/virtual-keys",Object.assign({body:o},d))}list(o,f,d){const l=o;f&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign({},f))));const h=(0,i.toQueryParams)(l);return this.getMethod(`/virtual-keys${h}`,Object.assign({},d))}retrieve(o,f,d){const{slug:l}=o;return f&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign({},f)))),this.getMethod(`/virtual-keys/${l}`,Object.assign({},d))}update(o,f,d){const{slug:l}=o,h=e(o,["slug"]);return f&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign({},f)))),this.put(`/virtual-keys/${l}`,Object.assign({body:h},d))}delete(o,f,d){const{slug:l}=o;return f&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign({},f)))),this.deleteMethod(`/virtual-keys/${l}`,Object.assign({},d))}}return Za.VirtualKeys=a,Za}var $n={},YO;function kH(){if(YO)return $n;YO=1;var e=$n&&$n.__awaiter||function(m,g,b,E){function T(O){return O instanceof b?O:new b(function(v){v(O)})}return new(b||(b=Promise))(function(O,v){function C(j){try{I(E.next(j))}catch(R){v(R)}}function x(j){try{I(E.throw(j))}catch(R){v(R)}}function I(j){j.done?O(j.value):T(j.value).then(C,x)}I((E=E.apply(m,g||[])).next())})};Object.defineProperty($n,"__esModule",{value:!0}),$n.Permissions=$n.FineTuningCheckpoints=$n.Grader=$n.Alpha=$n.Checkpoints=$n.Jobs=$n.FineTuning=void 0;const t=gt(),n=ot(),i=mt();class a extends t.ApiResource{constructor(g){super(g),this.jobs=new u(g),this.checkpoints=new l(g),this.alpha=new f(g)}}$n.FineTuning=a;class u extends t.ApiResource{constructor(g){super(g),this.checkpoints=new o(g)}create(g,b,E){return e(this,void 0,void 0,function*(){const T=g;if(b){const C=(0,n.overrideConfig)(this.client.config,b.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},b),{config:C})))}const v=yield(0,n.initOpenAIClient)(this.client).fineTuning.jobs.create(T,E).withResponse();return(0,n.finalResponse)(v)})}retrieve(g,b,E){return e(this,void 0,void 0,function*(){if(b){const v=(0,n.overrideConfig)(this.client.config,b.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},b),{config:v})))}const O=yield(0,n.initOpenAIClient)(this.client).fineTuning.jobs.retrieve(g,E).withResponse();return(0,n.finalResponse)(O)})}list(g,b,E){return e(this,void 0,void 0,function*(){const T=g;if(b){const C=(0,n.overrideConfig)(this.client.config,b.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},b),{config:C})))}const v=yield(0,n.initOpenAIClient)(this.client).fineTuning.jobs.list(T,E).withResponse();return(0,n.finalResponse)(v)})}cancel(g,b,E){return e(this,void 0,void 0,function*(){if(b){const x=(0,n.overrideConfig)(this.client.config,b.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},b),{config:x})))}const T=(0,n.initOpenAIClient)(this.client),v=Object.assign({body:{}},E),C=yield T.fineTuning.jobs.cancel(g,v).withResponse();return(0,n.finalResponse)(C)})}listEvents(g,b,E,T){return e(this,void 0,void 0,function*(){const O=b;if(E){const x=(0,n.overrideConfig)(this.client.config,E.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},E),{config:x})))}const C=yield(0,n.initOpenAIClient)(this.client).fineTuning.jobs.listEvents(g,O,T).withResponse();return(0,n.finalResponse)(C)})}}$n.Jobs=u;class o extends t.ApiResource{list(g,b,E,T){return e(this,void 0,void 0,function*(){const O=b;if(E){const x=(0,n.overrideConfig)(this.client.config,E.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},E),{config:x})))}const C=yield(0,n.initOpenAIClient)(this.client).fineTuning.jobs.checkpoints.list(g,O,T).withResponse();return(0,n.finalResponse)(C)})}}$n.Checkpoints=o;class f extends t.ApiResource{constructor(g){super(g),this.grader=new d(g)}}$n.Alpha=f;class d extends t.ApiResource{run(g,b,E){return e(this,void 0,void 0,function*(){if(b){const v=(0,n.overrideConfig)(this.client.config,b.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},b),{config:v})))}const O=yield(0,n.initOpenAIClient)(this.client).fineTuning.alpha.graders.run(g,E).withResponse();return(0,n.finalResponse)(O)})}validate(g,b,E){return e(this,void 0,void 0,function*(){if(b){const v=(0,n.overrideConfig)(this.client.config,b.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},b),{config:v})))}const O=yield(0,n.initOpenAIClient)(this.client).fineTuning.alpha.graders.validate(g,E).withResponse();return(0,n.finalResponse)(O)})}}$n.Grader=d;class l extends t.ApiResource{constructor(g){super(g),this.permissions=new h(g)}}$n.FineTuningCheckpoints=l;class h extends t.ApiResource{create(g,b,E,T){return e(this,void 0,void 0,function*(){if(E){const C=(0,n.overrideConfig)(this.client.config,E.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},E),{config:C})))}const v=yield(0,n.initOpenAIClient)(this.client).fineTuning.checkpoints.permissions.create(g,b,T).withResponse();return(0,n.finalResponse)(v)})}retrieve(g,b,E,T){return e(this,void 0,void 0,function*(){if(E){const C=(0,n.overrideConfig)(this.client.config,E.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},E),{config:C})))}const v=yield(0,n.initOpenAIClient)(this.client).fineTuning.checkpoints.permissions.retrieve(g,b,T).withResponse();return(0,n.finalResponse)(v)})}delete(g,{fine_tuned_model_checkpoint:b},E,T){return e(this,void 0,void 0,function*(){if(E){const C=(0,n.overrideConfig)(this.client.config,E.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},E),{config:C})))}const v=yield(0,n.initOpenAIClient)(this.client).fineTuning.checkpoints.permissions.delete(g,{fine_tuned_model_checkpoint:b},T).withResponse();return(0,n.finalResponse)(v)})}}return $n.Permissions=h,$n}var Wa={},VO;function MH(){if(VO)return Wa;VO=1;var e=Wa&&Wa.__awaiter||function(u,o,f,d){function l(h){return h instanceof f?h:new f(function(m){m(h)})}return new(f||(f=Promise))(function(h,m){function g(T){try{E(d.next(T))}catch(O){m(O)}}function b(T){try{E(d.throw(T))}catch(O){m(O)}}function E(T){T.done?h(T.value):l(T.value).then(g,b)}E((d=d.apply(u,o||[])).next())})};Object.defineProperty(Wa,"__esModule",{value:!0}),Wa.Moderations=void 0;const t=gt(),n=ot(),i=mt();class a extends t.ApiResource{create(o,f,d){return e(this,void 0,void 0,function*(){const l=o;if(f){const g=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:g})))}const m=yield(0,n.initOpenAIClient)(this.client).moderations.create(l,d).withResponse();return(0,n.finalResponse)(m)})}}return Wa.Moderations=a,Wa}var yr={},tc={},ZO;function PH(){if(ZO)return tc;ZO=1;var e=tc&&tc.__awaiter||function(v,C,x,I){function j(R){return R instanceof x?R:new x(function(k){k(R)})}return new(x||(x=Promise))(function(R,k){function P(G){try{L(I.next(G))}catch(F){k(F)}}function z(G){try{L(I.throw(G))}catch(F){k(F)}}function L(G){G.done?R(G.value):j(G.value).then(P,z)}L((I=I.apply(v,C||[])).next())})};Object.defineProperty(tc,"__esModule",{value:!0});const n=(0,Em().isFsModuleAvailable)();let i,a,u,o,f;if(n)try{i=SO;const{promisify:v}=SO;a=v(i.open),u=v(i.read),o=v(i.stat),f=v(i.close)}catch{console.warn("File system operations not available in this environment")}function d(v){var C;return e(this,void 0,void 0,function*(){if(!n||!i)return null;try{const x=(C=v.split(".").pop())===null||C===void 0?void 0:C.toLowerCase(),j=(yield o(v)).size;switch(x){case"wav":return h(v);case"mp3":return m(v,j);case"mpga":return g(v,j);case"flac":return b(v);case"ogg":return E(v,j);case"mp4":case"m4a":return T(v);default:return null}}catch{return null}})}function l(v,C,x){return e(this,void 0,void 0,function*(){const I=yield a(v,"r"),j=Buffer.alloc(x);try{const{bytesRead:R}=yield u(I,j,0,x,C);return R<x?j.slice(0,R):j}finally{yield f(I)}})}function h(v){return e(this,void 0,void 0,function*(){try{const C=yield l(v,0,44);if(C.length<44)return null;const x=C.readUInt32LE(24),I=C.readUInt32LE(40),j=C.readUInt16LE(34),R=C.readUInt16LE(22),k=I/(x*R*(j/8));return Math.round(k*1e3).toString()}catch{return null}})}function m(v,C){return e(this,void 0,void 0,function*(){try{const x=yield l(v,0,Math.min(10240,C));if(x.length<128)return null;for(let I=0;I<x.length-4;I++)if(x[I]===255&&(x[I+1]&224)===224){const j=x[I+2]>>4&15,R=x[I+2]>>2&3,k=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320],P=[44100,48e3,32e3];if(j>=k.length||R>=P.length)continue;const z=Number(k[j]),L=Number(P[R]);if(!z||!L)continue;return(C*8/(z*1e3)*1e3).toFixed(0)}}catch{}return null})}function g(v,C){var x,I;return e(this,void 0,void 0,function*(){try{const j=yield l(v,0,Math.min(10240,C));if(j.length<128)return null;for(let R=0;R<j.length-4;R++)if(j[R]===255&&(j[R+1]&240)===240){const k=j[R+2]>>4&15,P=j[R+2]>>2&3,z=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,0],L=[[44100,48e3,32e3,0],[22050,24e3,16e3,0],[11025,12e3,8e3,0]],G=j[R+1]>>3&3,F=G===3?0:G===2?1:2;if(k===0||k>=z.length||P>=3||F>=L.length||P>=((x=L[F])===null||x===void 0?void 0:x.length))continue;const K=Number(z[k]),B=Number((I=L[F])===null||I===void 0?void 0:I[P]);if(!K||!B)continue;return(C*8/(K*1e3)*1e3).toFixed(0)}}catch{}return null})}function b(v){return e(this,void 0,void 0,function*(){try{if((yield l(v,0,4)).toString()!=="fLaC")return null;const x=yield l(v,4,102400);let I=0,j=!1,R=!1,k=0,P=0;for(;!j&&I<x.length&&!(I+4>x.length);){j=(x[I]&128)===128;const G=x[I]&127,F=x.readUInt32BE(I)&16777215;if(I+=4,G===0&&I+18<=x.length){P=x[I+10]<<12|x[I+11]<<4|(x[I+12]&240)>>4,k=(x[I+13]&15)<<32|x[I+14]<<24|x[I+15]<<16|x[I+16]<<8|x[I+17],R=!0;break}I+=F}if(!R||P===0)return null;const z=k/P;return Math.round(z*1e3).toString()}catch{return null}})}function E(v,C){return e(this,void 0,void 0,function*(){try{if((yield l(v,0,4)).toString()!=="OggS")return null;const I=yield l(v,0,Math.min(1e4,C)),j=Math.min(10240,C),R=yield l(v,Math.max(0,C-j),j);let k=0,P=0;for(;P<I.length-7;){if(P+7<=I.length&&I.slice(P,P+7).toString()==="vorbis"&&P+16<I.length){k=I.readUInt32LE(P+12);break}P++}if(k===0)return null;let z=0;for(P=0;P<R.length-27;)if(P+4<=R.length&&R.slice(P,P+4).toString()==="OggS")if(P+14<R.length){const F=Number(R.readBigInt64LE(P+6));if(F>z&&(z=F),P+27>=R.length)break;const K=R[P+26];let Z=27+K;for(let U=0;U<K&&P+27+U<R.length;U++)Z+=R[P+27+U];P+=Z}else break;else P++;if(z===0)return null;const L=z/k;return Math.round(L*1e3).toString()}catch{return null}})}function T(v){return e(this,void 0,void 0,function*(){try{const C=yield a(v,"r");try{return yield O(C,v,0)}finally{yield f(C)}}catch{return null}})}function O(v,C,x){return e(this,void 0,void 0,function*(){try{const j=Buffer.alloc(8),{bytesRead:R}=yield u(v,j,0,8,x);if(R<8)return null;const k=j.readUInt32BE(0);if(k<8)return null;const P=j.slice(4,8).toString();if(P==="moov"){const z=yield l(C,x,k);for(let L=8;L<z.length-8;L++)if(L+4<=z.length&&z.slice(L,L+4).toString()==="mvhd"){if(L+5>=z.length)break;const G=z[L+4];let F,K;if(G===0){if(L+24>=z.length)break;F=z.readUInt32BE(L+16),K=z.readUInt32BE(L+20)}else{if(L+36>=z.length)break;F=z.readUInt32BE(L+24);const B=z.readUInt32BE(L+28),Z=z.readUInt32BE(L+32);K=B*Math.pow(2,32)+Z}if(F>0){const B=K/F;return Math.round(B*1e3).toString()}}}else if(["trak","mdia","minf","stbl"].includes(P))return O(v,C,x+8);if(k>0)return O(v,C,x+k)}catch{return null}return null})}return tc.default=d,tc}var WO;function DH(){if(WO)return yr;WO=1;var e=yr&&yr.__awaiter||function(g,b,E,T){function O(v){return v instanceof E?v:new E(function(C){C(v)})}return new(E||(E=Promise))(function(v,C){function x(R){try{j(T.next(R))}catch(k){C(k)}}function I(R){try{j(T.throw(R))}catch(k){C(k)}}function j(R){R.done?v(R.value):O(R.value).then(x,I)}j((T=T.apply(g,b||[])).next())})},t=yr&&yr.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(yr,"__esModule",{value:!0}),yr.speech=yr.translations=yr.transcriptions=yr.Audio=void 0;const n=gt(),i=ot(),a=mt(),u=Tr(),o=t(PH()),f=Em();class d extends n.ApiResource{constructor(b){super(b),this.transcriptions=new l(b),this.translations=new h(b),this.speech=new m(b)}}yr.Audio=d;class l extends n.ApiResource{create(b,E,T){var O;return e(this,void 0,void 0,function*(){const v=(O=b.file)===null||O===void 0?void 0:O.path;if(v&&this.client.calculateAudioDuration&&(0,f.isFsModuleAvailable)()){const I=yield(0,o.default)(v);I&&(E=Object.assign(Object.assign({},E),{[u.AUDIO_FILE_DURATION_HEADER]:I}))}if(E){const I=(0,i.overrideConfig)(this.client.config,E.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,a.createHeaders)(Object.assign(Object.assign({},E),{config:I})))}return(0,i.initOpenAIClient)(this.client).audio.transcriptions.create(b,T)})}}yr.transcriptions=l;class h extends n.ApiResource{create(b,E,T){var O;return e(this,void 0,void 0,function*(){const v=b,C=(O=v.file)===null||O===void 0?void 0:O.path;if(C&&this.client.calculateAudioDuration&&(0,f.isFsModuleAvailable)()){const j=yield(0,o.default)(C);j&&(E=Object.assign(Object.assign({},E),{[u.AUDIO_FILE_DURATION_HEADER]:j}))}if(E){const j=(0,i.overrideConfig)(this.client.config,E.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,a.createHeaders)(Object.assign(Object.assign({},E),{config:j})))}const I=yield(0,i.initOpenAIClient)(this.client).audio.translations.create(v,T).withResponse();return(0,i.finalResponse)(I)})}}yr.translations=h;class m extends n.ApiResource{create(b,E,T){return e(this,void 0,void 0,function*(){const O=b;if(E){const x=(0,i.overrideConfig)(this.client.config,E.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,a.createHeaders)(Object.assign(Object.assign({},E),{config:x})))}return yield(0,i.initOpenAIClient)(this.client).audio.speech.create(O,T)})}}return yr.speech=m,yr}var wi={},XO;function jH(){if(XO)return wi;XO=1;var e=wi&&wi.__awaiter||function(f,d,l,h){function m(g){return g instanceof l?g:new l(function(b){b(g)})}return new(l||(l=Promise))(function(g,b){function E(v){try{O(h.next(v))}catch(C){b(C)}}function T(v){try{O(h.throw(v))}catch(C){b(C)}}function O(v){v.done?g(v.value):m(v.value).then(E,T)}O((h=h.apply(f,d||[])).next())})};Object.defineProperty(wi,"__esModule",{value:!0}),wi.FileBatches=wi.Files=wi.VectorStores=void 0;const t=gt(),n=ot(),i=mt();class a extends t.ApiResource{constructor(d){super(d),this.files=new u(d),this.fileBatches=new o(d)}create(d,l,h){return e(this,void 0,void 0,function*(){const m=d;if(l){const E=(0,n.overrideConfig)(this.client.config,l.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},l),{config:E})))}const b=yield(0,n.initOpenAIClient)(this.client).vectorStores.create(m,h).withResponse();return(0,n.finalResponse)(b)})}retrieve(d,l,h){return e(this,void 0,void 0,function*(){if(l){const b=(0,n.overrideConfig)(this.client.config,l.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},l),{config:b})))}const g=yield(0,n.initOpenAIClient)(this.client).vectorStores.retrieve(d,h).withResponse();return(0,n.finalResponse)(g)})}update(d,l,h,m){return e(this,void 0,void 0,function*(){const g=l;if(h){const T=(0,n.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},h),{config:T})))}const E=yield(0,n.initOpenAIClient)(this.client).vectorStores.update(d,g,m).withResponse();return(0,n.finalResponse)(E)})}list(d,l,h){return e(this,void 0,void 0,function*(){const m=d;if(l){const E=(0,n.overrideConfig)(this.client.config,l.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},l),{config:E})))}const b=yield(0,n.initOpenAIClient)(this.client).vectorStores.list(m,h).withResponse();return(0,n.finalResponse)(b)})}delete(d,l,h){return e(this,void 0,void 0,function*(){if(l){const b=(0,n.overrideConfig)(this.client.config,l.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},l),{config:b})))}const g=yield(0,n.initOpenAIClient)(this.client).vectorStores.delete(d,h).withResponse();return(0,n.finalResponse)(g)})}}wi.VectorStores=a;class u extends t.ApiResource{create(d,l,h,m){return e(this,void 0,void 0,function*(){const g=l;if(h){const T=(0,n.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},h),{config:T})))}const E=yield(0,n.initOpenAIClient)(this.client).vectorStores.files.create(d,g,m).withResponse();return(0,n.finalResponse)(E)})}retrieve(d,{vector_store_id:l},h,m){return e(this,void 0,void 0,function*(){if(h){const E=(0,n.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},h),{config:E})))}const b=yield(0,n.initOpenAIClient)(this.client).vectorStores.files.retrieve(d,{vector_store_id:l},m).withResponse();return(0,n.finalResponse)(b)})}list(d,l,h,m){return e(this,void 0,void 0,function*(){const g=l;if(h){const T=(0,n.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},h),{config:T})))}const E=yield(0,n.initOpenAIClient)(this.client).vectorStores.files.list(d,g,m).withResponse();return(0,n.finalResponse)(E)})}delete(d,{vector_store_id:l},h,m){return e(this,void 0,void 0,function*(){if(h){const E=(0,n.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},h),{config:E})))}const b=yield(0,n.initOpenAIClient)(this.client).vectorStores.files.delete(d,{vector_store_id:l},m).withResponse();return(0,n.finalResponse)(b)})}createAndPoll(d,l,h,m){return e(this,void 0,void 0,function*(){const g=l;if(h){const T=(0,n.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},h),{config:T})))}return yield(0,n.initOpenAIClient)(this.client).vectorStores.files.createAndPoll(d,g,m)})}poll(d,l,h,m){return e(this,void 0,void 0,function*(){if(h){const E=(0,n.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},h),{config:E})))}return yield(0,n.initOpenAIClient)(this.client).vectorStores.files.poll(d,l,m)})}upload(d,l,h,m){return e(this,void 0,void 0,function*(){if(h){const E=(0,n.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},h),{config:E})))}return yield(0,n.initOpenAIClient)(this.client).vectorStores.files.upload(d,l,m)})}uploadAndPoll(d,l,h,m){return e(this,void 0,void 0,function*(){if(h){const E=(0,n.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},h),{config:E})))}return yield(0,n.initOpenAIClient)(this.client).vectorStores.files.uploadAndPoll(d,l,m)})}}wi.Files=u;class o extends t.ApiResource{create(d,l,h,m){return e(this,void 0,void 0,function*(){const g=l;if(h){const T=(0,n.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},h),{config:T})))}const E=yield(0,n.initOpenAIClient)(this.client).vectorStores.fileBatches.create(d,g,m).withResponse();return(0,n.finalResponse)(E)})}retrieve(d,{vector_store_id:l},h,m){return e(this,void 0,void 0,function*(){if(h){const E=(0,n.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},h),{config:E})))}const b=yield(0,n.initOpenAIClient)(this.client).vectorStores.fileBatches.retrieve(d,{vector_store_id:l},m).withResponse();return(0,n.finalResponse)(b)})}cancel(d,{vector_store_id:l},h,m){return e(this,void 0,void 0,function*(){if(h){const O=(0,n.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},h),{config:O})))}const g=(0,n.initOpenAIClient)(this.client),E=Object.assign({body:{}},m),T=yield g.vectorStores.fileBatches.cancel(d,{vector_store_id:l},E).withResponse();return(0,n.finalResponse)(T)})}createAndPoll(d,l,h,m){return e(this,void 0,void 0,function*(){const g=l;if(h){const T=(0,n.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},h),{config:T})))}return yield(0,n.initOpenAIClient)(this.client).vectorStores.fileBatches.createAndPoll(d,g,m)})}listFiles(d,l,h,m){return e(this,void 0,void 0,function*(){const g=l;if(h){const T=(0,n.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},h),{config:T})))}const E=yield(0,n.initOpenAIClient)(this.client).vectorStores.fileBatches.listFiles(d,g,m).withResponse();return(0,n.finalResponse)(E)})}poll(d,l,h,m){return e(this,void 0,void 0,function*(){if(h){const E=(0,n.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},h),{config:E})))}return yield(0,n.initOpenAIClient)(this.client).vectorStores.fileBatches.poll(d,l,m)})}uploadAndPoll(d,{files:l,fileIds:h=[]},m,g){return e(this,void 0,void 0,function*(){if(m){const T=(0,n.overrideConfig)(this.client.config,m.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},m),{config:T})))}return yield(0,n.initOpenAIClient)(this.client).vectorStores.fileBatches.uploadAndPoll(d,{files:l,fileIds:h},g)})}}return wi.FileBatches=o,wi}var vs={},QO;function LH(){if(QO)return vs;QO=1;var e=vs&&vs.__awaiter||function(o,f,d,l){function h(m){return m instanceof d?m:new d(function(g){g(m)})}return new(d||(d=Promise))(function(m,g){function b(O){try{T(l.next(O))}catch(v){g(v)}}function E(O){try{T(l.throw(O))}catch(v){g(v)}}function T(O){O.done?m(O.value):h(O.value).then(b,E)}T((l=l.apply(o,f||[])).next())})};Object.defineProperty(vs,"__esModule",{value:!0}),vs.Parts=vs.Uploads=void 0;const t=gt(),n=ot(),i=mt();class a extends t.ApiResource{constructor(f){super(f),this.parts=new u(f)}create(f,d,l){return e(this,void 0,void 0,function*(){const h=f;if(d){const b=(0,n.overrideConfig)(this.client.config,d.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},d),{config:b})))}const g=yield(0,n.initOpenAIClient)(this.client).uploads.create(h,l).withResponse();return(0,n.finalResponse)(g)})}cancel(f,d,l){return e(this,void 0,void 0,function*(){if(d){const E=(0,n.overrideConfig)(this.client.config,d.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},d),{config:E})))}const h=(0,n.initOpenAIClient)(this.client),g=Object.assign({body:{}},l),b=yield h.uploads.cancel(f,g).withResponse();return(0,n.finalResponse)(b)})}complete(f,d,l,h){return e(this,void 0,void 0,function*(){const m=d;if(l){const E=(0,n.overrideConfig)(this.client.config,l.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},l),{config:E})))}const b=yield(0,n.initOpenAIClient)(this.client).uploads.complete(f,m,h).withResponse();return(0,n.finalResponse)(b)})}}vs.Uploads=a;class u extends t.ApiResource{create(f,d,l,h){return e(this,void 0,void 0,function*(){const m=d;if(l){const E=(0,n.overrideConfig)(this.client.config,l.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},l),{config:E})))}const b=yield(0,n.initOpenAIClient)(this.client).uploads.parts.create(f,m,h).withResponse();return(0,n.finalResponse)(b)})}}return vs.Parts=u,vs}var Qu={},JO;function HH(){if(JO)return Qu;JO=1,Object.defineProperty(Qu,"__esModule",{value:!0}),Qu.ApiKeys=void 0;const e=gt(),t=mt(),n=ot();class i extends e.ApiResource{create(u,o,f){const d=u,l=d.type,h=d["sub-type"];return o&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},o)))),this.post(`/api-keys/${l}/${h}`,Object.assign({body:d},f))}retrieve(u,o,f){const l=u.id;return o&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},o)))),this.getMethod(`/api-keys/${l}`,Object.assign({},f))}update(u,o,f){const d=u,l=d.id;return o&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},o)))),this.put(`/api-keys/${l}`,Object.assign({body:d},f))}list(u,o,f){const d=u;o&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},o))));const l=(0,n.toQueryParams)(d);return this.getMethod(`/api-keys${l}`,Object.assign({},f))}delete(u,o,f){const d=u,l=d.id;return o&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},o)))),this.deleteMethod(`/api-keys/${l}`,Object.assign({body:d},f))}}return Qu.ApiKeys=i,Qu}var Ts={},eS;function BH(){if(eS)return Ts;eS=1;var e=Ts&&Ts.__rest||function(f,d){var l={};for(var h in f)Object.prototype.hasOwnProperty.call(f,h)&&d.indexOf(h)<0&&(l[h]=f[h]);if(f!=null&&typeof Object.getOwnPropertySymbols=="function")for(var m=0,h=Object.getOwnPropertySymbols(f);m<h.length;m++)d.indexOf(h[m])<0&&Object.prototype.propertyIsEnumerable.call(f,h[m])&&(l[h[m]]=f[h[m]]);return l};Object.defineProperty(Ts,"__esModule",{value:!0}),Ts.Exports=Ts.Logs=void 0;const t=gt(),n=mt(),i=ot(),a=Tr();class u extends t.ApiResource{constructor(d){super(d),this.exports=new o(d)}create(d,l,h){const m=d;if(l){const b=(0,i.overrideConfig)(this.client.config,l.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign(Object.assign({},l),{config:b})))}return this.post(a.LOGS_API,Object.assign({body:m},h))}}Ts.Logs=u;class o extends t.ApiResource{create(d,l,h){const{workspaceId:m,requestedData:g}=d,b=e(d,["workspaceId","requestedData"]),E=Object.assign(Object.assign({},b),{workspace_id:m,requested_data:g});return l&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign({},l)))),this.post("/logs/exports",Object.assign({body:E},h))}retrieve(d,l,h){const g=d.exportId;return l&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign({},l)))),this.getMethod(`/logs/exports/${g}`,Object.assign({},h))}list(d,l,h){const{workspaceId:m}=d,g=e(d,["workspaceId"]),b=Object.assign(Object.assign({},g),{workspace_id:m}),E=(0,i.toQueryParams)(b);return l&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign({},l)))),this.getMethod(`/logs/exports${E}`,Object.assign({},h))}update(d,l,h){const{workspaceId:m,requestedData:g}=d,b=e(d,["workspaceId","requestedData"]),E=Object.assign(Object.assign({},b),{workspace_id:m,requested_data:g}),T=E.exportId;return l&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign({},l)))),this.put(`/logs/exports/${T}`,Object.assign({body:E},h))}start(d,l,h){const m=d,g=m.exportId;return l&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign({},l)))),this.post(`/logs/exports/${g}/start`,Object.assign({body:m},h))}cancel(d,l,h){const m=d,g=m.exportId;return l&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign({},l)))),this.post(`/logs/exports/${g}/cancel`,Object.assign({body:m},h))}download(d,l,h){const m=d,g=m.exportId;return l&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign({},l)))),this.getMethod(`/logs/exports/${g}/download`,Object.assign({body:m},h))}}return Ts.Exports=o,Ts}var Ri={},tS;function UH(){if(tS)return Ri;tS=1;var e=Ri&&Ri.__awaiter||function(f,d,l,h){function m(g){return g instanceof l?g:new l(function(b){b(g)})}return new(l||(l=Promise))(function(g,b){function E(v){try{O(h.next(v))}catch(C){b(C)}}function T(v){try{O(h.throw(v))}catch(C){b(C)}}function O(v){v.done?g(v.value):m(v.value).then(E,T)}O((h=h.apply(f,d||[])).next())})};Object.defineProperty(Ri,"__esModule",{value:!0}),Ri.TranscriptionSessions=Ri.Sessions=Ri.Realtime=void 0;const t=gt(),n=ot(),i=mt();class a extends t.ApiResource{constructor(d){super(d),this.sessions=new u(d),this.transcriptionSessions=new o(d)}}Ri.Realtime=a;class u extends t.ApiResource{create(d,l,h){return e(this,void 0,void 0,function*(){const m=d;if(l){const E=(0,n.overrideConfig)(this.client.config,l.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},l),{config:E})))}const b=yield(0,n.initOpenAIClient)(this.client).beta.realtime.sessions.create(m,h).withResponse();return(0,n.finalResponse)(b)})}}Ri.Sessions=u;class o extends t.ApiResource{create(d,l,h){return e(this,void 0,void 0,function*(){const m=d;if(l){const E=(0,n.overrideConfig)(this.client.config,l.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},l),{config:E})))}const b=yield(0,n.initOpenAIClient)(this.client).beta.realtime.transcriptionSessions.create(m,h).withResponse();return(0,n.finalResponse)(b)})}}return Ri.TranscriptionSessions=o,Ri}var As={},nS;function FH(){if(nS)return As;nS=1;var e=As&&As.__awaiter||function(o,f,d,l){function h(m){return m instanceof d?m:new d(function(g){g(m)})}return new(d||(d=Promise))(function(m,g){function b(O){try{T(l.next(O))}catch(v){g(v)}}function E(O){try{T(l.throw(O))}catch(v){g(v)}}function T(O){O.done?m(O.value):h(O.value).then(b,E)}T((l=l.apply(o,f||[])).next())})};Object.defineProperty(As,"__esModule",{value:!0}),As.InputItems=As.Responses=void 0;const t=gt(),n=mt(),i=ot();class a extends t.ApiResource{constructor(f){super(f),this.inputItems=new u(f)}create(f,d,l){if(d){const g=(0,i.overrideConfig)(this.client.config,d.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign(Object.assign({},d),{config:g})))}return(0,i.initOpenAIClient)(this.client).responses.create(f,l)}retrieve(f,d,l,h){return e(this,void 0,void 0,function*(){const m=d;if(l){const E=(0,i.overrideConfig)(this.client.config,l.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign(Object.assign({},l),{config:E})))}const b=yield(0,i.initOpenAIClient)(this.client).responses.retrieve(f,m,h).withResponse();return(0,i.finalResponse)(b)})}delete(f,d,l){return e(this,void 0,void 0,function*(){if(d){const g=(0,i.overrideConfig)(this.client.config,d.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign(Object.assign({},d),{config:g})))}const m=yield(0,i.initOpenAIClient)(this.client).responses.delete(f,l).withResponse();return(0,i.finalResponse)(m)})}parse(f,d,l){return e(this,void 0,void 0,function*(){const h=f;if(d){const b=(0,i.overrideConfig)(this.client.config,d.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign(Object.assign({},d),{config:b})))}return yield(0,i.initOpenAIClient)(this.client).responses.parse(h,l)})}stream(f,d,l){return e(this,void 0,void 0,function*(){const h=f;if(d){const b=(0,i.overrideConfig)(this.client.config,d.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign(Object.assign({},d),{config:b})))}return yield(0,i.initOpenAIClient)(this.client).responses.stream(h,l)})}cancel(f,d,l){return e(this,void 0,void 0,function*(){if(d){const E=(0,i.overrideConfig)(this.client.config,d.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign(Object.assign({},d),{config:E})))}const h=(0,i.initOpenAIClient)(this.client),g=Object.assign({body:{}},l),b=yield h.responses.cancel(f,g).withResponse();return(0,i.finalResponse)(b)})}}As.Responses=a;class u extends t.ApiResource{list(f,d,l,h){return e(this,void 0,void 0,function*(){const m=d;if(l){const E=(0,i.overrideConfig)(this.client.config,l.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign(Object.assign({},l),{config:E})))}const b=yield(0,i.initOpenAIClient)(this.client).responses.inputItems.list(f,m,h).withResponse();return(0,i.finalResponse)(b)})}}return As.InputItems=u,As}var Ju={},rS;function zH(){if(rS)return Ju;rS=1,Object.defineProperty(Ju,"__esModule",{value:!0}),Ju.Labels=void 0;const e=Tr(),t=gt(),n=ot(),i=mt();class a extends t.ApiResource{create(o,f,d){const l=o;if(f){const m=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:m})))}return this.post(`${e.LABELS_API}`,Object.assign({body:l},d))}list(o,f,d){const l=o?(0,n.toQueryParams)(o):"";if(f){const m=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:m})))}return this.getMethod(`${e.LABELS_API}${l}`,Object.assign({},d))}retrieve(o,f,d){if(f){const h=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:h})))}return this.getMethod(`${e.LABELS_API}/${o}`,Object.assign({},d))}update(o,f,d,l){const h=f;if(d){const g=(0,n.overrideConfig)(this.client.config,d.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},d),{config:g})))}return this.put(`${e.LABELS_API}/${o}`,Object.assign({body:h},l))}delete(o,f,d){if(f){const h=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:h})))}return this.deleteMethod(`${e.LABELS_API}/${o}`,Object.assign({},d))}}return Ju.Labels=a,Ju}var ed={},iS;function $H(){if(iS)return ed;iS=1,Object.defineProperty(ed,"__esModule",{value:!0}),ed.Collections=void 0;const e=Tr(),t=gt(),n=ot(),i=mt();class a extends t.ApiResource{create(o,f,d){const l=o;if(f){const m=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:m})))}return this.post(`${e.COLLECTIONS_API}`,Object.assign({body:l},d))}list(o,f,d){const l=o?(0,n.toQueryParams)(o):"";if(f){const m=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:m})))}return this.getMethod(`${e.COLLECTIONS_API}${l}`,Object.assign({},d))}retrieve(o,f,d){if(f){const h=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:h})))}return this.getMethod(`${e.COLLECTIONS_API}/${o}`,Object.assign({},d))}update(o,f,d,l){if(d){const m=(0,n.overrideConfig)(this.client.config,d.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},d),{config:m})))}return this.put(`${e.COLLECTIONS_API}/${o}`,Object.assign({body:f},l))}delete(o,f,d){if(f){const h=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},f),{config:h})))}return this.deleteMethod(`${e.COLLECTIONS_API}/${o}`,Object.assign({},d))}}return ed.Collections=a,ed}var Ni={},sS;function qH(){if(sS)return Ni;sS=1;var e=Ni&&Ni.__awaiter||function(f,d,l,h){function m(g){return g instanceof l?g:new l(function(b){b(g)})}return new(l||(l=Promise))(function(g,b){function E(v){try{O(h.next(v))}catch(C){b(C)}}function T(v){try{O(h.throw(v))}catch(C){b(C)}}function O(v){v.done?g(v.value):m(v.value).then(E,T)}O((h=h.apply(f,d||[])).next())})};Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.OutputItems=Ni.EvalsRuns=Ni.Evals=void 0;const t=gt(),n=ot(),i=mt();class a extends t.ApiResource{constructor(d){super(d),this.runs=new u(d)}create(d,l,h){return e(this,void 0,void 0,function*(){if(l){const b=(0,n.overrideConfig)(this.client.config,l.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},l),{config:b})))}return yield(0,n.initOpenAIClient)(this.client).evals.create(d,h)})}retrieve(d,l,h){return e(this,void 0,void 0,function*(){if(l){const b=(0,n.overrideConfig)(this.client.config,l.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},l),{config:b})))}const g=yield(0,n.initOpenAIClient)(this.client).evals.retrieve(d,h).withResponse();return(0,n.finalResponse)(g)})}update(d,l,h,m){return e(this,void 0,void 0,function*(){if(h){const E=(0,n.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},h),{config:E})))}const b=yield(0,n.initOpenAIClient)(this.client).evals.update(d,l,m).withResponse();return(0,n.finalResponse)(b)})}list(d,l,h){return e(this,void 0,void 0,function*(){if(l){const b=(0,n.overrideConfig)(this.client.config,l.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},l),{config:b})))}const g=yield(0,n.initOpenAIClient)(this.client).evals.list(d,h).withResponse();return(0,n.finalResponse)(g)})}delete(d,l,h){return e(this,void 0,void 0,function*(){if(l){const b=(0,n.overrideConfig)(this.client.config,l.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},l),{config:b})))}const g=yield(0,n.initOpenAIClient)(this.client).evals.delete(d,h).withResponse();return(0,n.finalResponse)(g)})}}Ni.Evals=a;class u extends t.ApiResource{constructor(d){super(d),this.outputItems=new o(d)}create(d,l,h,m){return e(this,void 0,void 0,function*(){if(h){const E=(0,n.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},h),{config:E})))}const b=yield(0,n.initOpenAIClient)(this.client).evals.runs.create(d,l,m).withResponse();return(0,n.finalResponse)(b)})}retrieve(d,{eval_id:l},h,m){return e(this,void 0,void 0,function*(){if(h){const E=(0,n.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},h),{config:E})))}const b=yield(0,n.initOpenAIClient)(this.client).evals.runs.retrieve(d,{eval_id:l},m).withResponse();return(0,n.finalResponse)(b)})}list(d,l,h,m){return e(this,void 0,void 0,function*(){if(h){const E=(0,n.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},h),{config:E})))}const b=yield(0,n.initOpenAIClient)(this.client).evals.runs.list(d,l,m).withResponse();return(0,n.finalResponse)(b)})}delete(d,{eval_id:l},h,m){return e(this,void 0,void 0,function*(){if(h){const E=(0,n.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},h),{config:E})))}const b=yield(0,n.initOpenAIClient)(this.client).evals.runs.delete(d,{eval_id:l},m).withResponse();return(0,n.finalResponse)(b)})}cancel(d,{eval_id:l},h,m){return e(this,void 0,void 0,function*(){if(h){const O=(0,n.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},h),{config:O})))}const g=(0,n.initOpenAIClient)(this.client),E=Object.assign({body:{}},m),T=yield g.evals.runs.cancel(d,{eval_id:l},E).withResponse();return(0,n.finalResponse)(T)})}}Ni.EvalsRuns=u;class o extends t.ApiResource{retrieve(d,{eval_id:l,run_id:h},m,g){return e(this,void 0,void 0,function*(){if(m){const T=(0,n.overrideConfig)(this.client.config,m.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},m),{config:T})))}const E=yield(0,n.initOpenAIClient)(this.client).evals.runs.outputItems.retrieve(d,{eval_id:l,run_id:h},g).withResponse();return(0,n.finalResponse)(E)})}list(d,l,h,m){return e(this,void 0,void 0,function*(){if(h){const E=(0,n.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},h),{config:E})))}const b=yield(0,n.initOpenAIClient)(this.client).evals.runs.outputItems.list(d,l,m).withResponse();return(0,n.finalResponse)(b)})}}return Ni.OutputItems=o,Ni}var Ii={},aS;function GH(){if(aS)return Ii;aS=1;var e=Ii&&Ii.__awaiter||function(f,d,l,h){function m(g){return g instanceof l?g:new l(function(b){b(g)})}return new(l||(l=Promise))(function(g,b){function E(v){try{O(h.next(v))}catch(C){b(C)}}function T(v){try{O(h.throw(v))}catch(C){b(C)}}function O(v){v.done?g(v.value):m(v.value).then(E,T)}O((h=h.apply(f,d||[])).next())})};Object.defineProperty(Ii,"__esModule",{value:!0}),Ii.Content=Ii.ContainersFiles=Ii.Containers=void 0;const t=gt(),n=mt(),i=ot();class a extends t.ApiResource{constructor(d){super(d),this.files=new u(d)}create(d,l,h){return e(this,void 0,void 0,function*(){const m=d;if(l){const E=(0,i.overrideConfig)(this.client.config,l.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign(Object.assign({},l),{config:E})))}const b=yield(0,i.initOpenAIClient)(this.client).containers.create(m,h).withResponse();return(0,i.finalResponse)(b)})}retrieve(d,l,h){return e(this,void 0,void 0,function*(){if(l){const b=(0,i.overrideConfig)(this.client.config,l.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign(Object.assign({},l),{config:b})))}const g=yield(0,i.initOpenAIClient)(this.client).containers.retrieve(d,h).withResponse();return(0,i.finalResponse)(g)})}list(d,l,h){return e(this,void 0,void 0,function*(){if(l){const b=(0,i.overrideConfig)(this.client.config,l.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign(Object.assign({},l),{config:b})))}const g=yield(0,i.initOpenAIClient)(this.client).containers.list(d,h).withResponse();return(0,i.finalResponse)(g)})}delete(d,l,h){return e(this,void 0,void 0,function*(){if(l){const b=(0,i.overrideConfig)(this.client.config,l.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign(Object.assign({},l),{config:b})))}const g=yield(0,i.initOpenAIClient)(this.client).containers.delete(d,h).withResponse();return(0,i.finalResponse)(g)})}}Ii.Containers=a;class u extends t.ApiResource{constructor(d){super(d),this.content=new o(d)}create(d,l,h,m){return e(this,void 0,void 0,function*(){if(h){const E=(0,i.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign(Object.assign({},h),{config:E})))}const b=yield(0,i.initOpenAIClient)(this.client).containers.files.create(d,l,m).withResponse();return(0,i.finalResponse)(b)})}retrieve(d,{container_id:l},h,m){return e(this,void 0,void 0,function*(){if(h){const E=(0,i.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign(Object.assign({},h),{config:E})))}const b=yield(0,i.initOpenAIClient)(this.client).containers.files.retrieve(d,{container_id:l},m).withResponse();return(0,i.finalResponse)(b)})}list(d,l,h,m){return e(this,void 0,void 0,function*(){if(h){const E=(0,i.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign(Object.assign({},h),{config:E})))}const b=yield(0,i.initOpenAIClient)(this.client).containers.files.list(d,l,m).withResponse();return(0,i.finalResponse)(b)})}delete(d,{container_id:l},h,m){return e(this,void 0,void 0,function*(){if(h){const E=(0,i.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign(Object.assign({},h),{config:E})))}const b=yield(0,i.initOpenAIClient)(this.client).containers.files.delete(d,{container_id:l},m).withResponse();return(0,i.finalResponse)(b)})}}Ii.ContainersFiles=u;class o extends t.ApiResource{retrieve(d,{container_id:l},h,m){return e(this,void 0,void 0,function*(){if(h){const E=(0,i.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign(Object.assign({},h),{config:E})))}return yield(yield(0,i.initOpenAIClient)(this.client).containers.files.content.retrieve(d,{container_id:l},m)).text()})}}return Ii.Content=o,Ii}var ki={},oS;function KH(){if(oS)return ki;oS=1;var e=ki&&ki.__rest||function(d,l){var h={};for(var m in d)Object.prototype.hasOwnProperty.call(d,m)&&l.indexOf(m)<0&&(h[m]=d[m]);if(d!=null&&typeof Object.getOwnPropertySymbols=="function")for(var g=0,m=Object.getOwnPropertySymbols(d);g<m.length;g++)l.indexOf(m[g])<0&&Object.prototype.propertyIsEnumerable.call(d,m[g])&&(h[m[g]]=d[m[g]]);return h};Object.defineProperty(ki,"__esModule",{value:!0}),ki.Models=ki.Workspaces=ki.Integrations=void 0;const t=Tr(),n=gt(),i=mt(),a=ot();class u extends n.ApiResource{constructor(l){super(l),this.workspaces=new o(l),this.models=new f(l)}create(l,h,m){const g=l;return h&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign({},h)))),this.post(`${t.INTEGRATIONS_API}`,Object.assign({body:g},m))}list(l,h,m){const g=l;h&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign({},h))));const b=(0,a.toQueryParams)(g);return this.getMethod(`${t.INTEGRATIONS_API}${b}`,Object.assign({},m))}retrieve(l,h,m){const b=l.slug;return h&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign({},h)))),this.getMethod(`${t.INTEGRATIONS_API}/${b}`,Object.assign({},m))}update(l,h,m){const{slug:g}=l,b=e(l,["slug"]);return h&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign({},h)))),this.put(`${t.INTEGRATIONS_API}/${g}`,Object.assign({body:b},m))}delete(l,h,m){const b=l.slug;return h&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign({},h)))),this.deleteMethod(`${t.INTEGRATIONS_API}/${b}`,Object.assign({},m))}}ki.Integrations=u;class o extends n.ApiResource{constructor(l){super(l)}update(l,h,m){const{slug:g}=l,b=e(l,["slug"]);return h&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign({},h)))),this.put(`${t.INTEGRATIONS_API}/${g}/workspaces`,Object.assign({body:b},m))}list(l,h,m){const b=l.slug;return h&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign({},h)))),this.getMethod(`${t.INTEGRATIONS_API}/${b}/workspaces`,Object.assign({},m))}}ki.Workspaces=o;class f extends n.ApiResource{constructor(l){super(l)}update(l,h,m){const{slug:g}=l,b=e(l,["slug"]);return h&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign({},h)))),this.put(`${t.INTEGRATIONS_API}/${g}/models`,Object.assign({body:b},m))}list(l,h,m){const b=l.slug;return h&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign({},h)))),this.getMethod(`${t.INTEGRATIONS_API}/${b}/models`,Object.assign({},m))}delete(l,h,m){const g=l,b=g.slug,E=g.slugs;h&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign({},h))));const T=E?`?slugs=${E}`:"";return this.deleteMethod(`${t.INTEGRATIONS_API}/${b}/models${T}`,Object.assign({},m))}}return ki.Models=f,ki}var Xa={},cS;function YH(){if(cS)return Xa;cS=1;var e=Xa&&Xa.__rest||function(o,f){var d={};for(var l in o)Object.prototype.hasOwnProperty.call(o,l)&&f.indexOf(l)<0&&(d[l]=o[l]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var h=0,l=Object.getOwnPropertySymbols(o);h<l.length;h++)f.indexOf(l[h])<0&&Object.prototype.propertyIsEnumerable.call(o,l[h])&&(d[l[h]]=o[l[h]]);return d};Object.defineProperty(Xa,"__esModule",{value:!0}),Xa.Providers=void 0;const t=Tr(),n=gt(),i=mt(),a=ot();class u extends n.ApiResource{list(f,d,l){const h=f;d&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign({},d))));const m=h?(0,a.toQueryParams)(h):"";return this.getMethod(`${t.PROVIDERS_API}${m}`,Object.assign({},l))}create(f,d,l){const h=f;return d&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign({},d)))),this.post(t.PROVIDERS_API,Object.assign({body:h},l))}retrieve(f,d,l){const{slug:h}=f,m=e(f,["slug"]);d&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign({},d))));const g=(0,a.toQueryParams)(m);return this.getMethod(`${t.PROVIDERS_API}/${h}${g}`,Object.assign({},l))}update(f,d,l){const{slug:h}=f,m=e(f,["slug"]);return d&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign({},d)))),this.put(`${t.PROVIDERS_API}/${h}`,Object.assign({body:m},l))}delete(f,d,l){const{slug:h}=f,m=e(f,["slug"]);d&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign({},d))));const g=(0,a.toQueryParams)(m);return this.deleteMethod(`${t.PROVIDERS_API}/${h}${g}`,Object.assign({},l))}}return Xa.Providers=u,Xa}var Qa={},lS;function VH(){if(lS)return Qa;lS=1;var e=Qa&&Qa.__awaiter||function(u,o,f,d){function l(h){return h instanceof f?h:new f(function(m){m(h)})}return new(f||(f=Promise))(function(h,m){function g(T){try{E(d.next(T))}catch(O){m(O)}}function b(T){try{E(d.throw(T))}catch(O){m(O)}}function E(T){T.done?h(T.value):l(T.value).then(g,b)}E((d=d.apply(u,o||[])).next())})};Object.defineProperty(Qa,"__esModule",{value:!0}),Qa.Webhooks=void 0;const t=gt(),n=mt(),i=ot();class a extends t.ApiResource{constructor(o){super(o)}unwarp(o,f,d,l=300,h){return e(this,void 0,void 0,function*(){if(h){const b=(0,i.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign(Object.assign({},h),{config:b})))}return yield(0,i.initOpenAIClient)(this.client).webhooks.unwrap(o,f,d,l)})}verifySignature(o,f,d,l=300,h){return e(this,void 0,void 0,function*(){if(h){const b=(0,i.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,n.createHeaders)(Object.assign(Object.assign({},h),{config:b})))}return yield(0,i.initOpenAIClient)(this.client).webhooks.verifySignature(o,f,d,l)})}}return Qa.Webhooks=a,Qa}var Mi={},uS;function ZH(){if(uS)return Mi;uS=1;var e=Mi&&Mi.__awaiter||function(f,d,l,h){function m(g){return g instanceof l?g:new l(function(b){b(g)})}return new(l||(l=Promise))(function(g,b){function E(v){try{O(h.next(v))}catch(C){b(C)}}function T(v){try{O(h.throw(v))}catch(C){b(C)}}function O(v){v.done?g(v.value):m(v.value).then(E,T)}O((h=h.apply(f,d||[])).next())})};Object.defineProperty(Mi,"__esModule",{value:!0}),Mi.Calls=Mi.ClientSecrets=Mi.MainRealtime=void 0;const t=gt(),n=ot(),i=mt();class a extends t.ApiResource{constructor(d){super(d),this.clientSecrets=new u(d),this.calls=new o(d)}}Mi.MainRealtime=a;class u extends t.ApiResource{constructor(d){super(d)}create(d,l,h){return e(this,void 0,void 0,function*(){const m=d;if(l){const E=(0,n.overrideConfig)(this.client.config,l.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},l),{config:E})))}const b=yield(0,n.initOpenAIClient)(this.client).realtime.clientSecrets.create(m,h).withResponse();return(0,n.finalResponse)(b)})}}Mi.ClientSecrets=u;class o extends t.ApiResource{constructor(d){super(d)}accept(d,l,h,m){if(h){const E=(0,n.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},h),{config:E})))}return(0,n.initOpenAIClient)(this.client).realtime.calls.accept(d,l,m)}hangup(d,l,h){if(l){const b=(0,n.overrideConfig)(this.client.config,l.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},l),{config:b})))}return(0,n.initOpenAIClient)(this.client).realtime.calls.hangup(d,h)}refer(d,l,h,m){if(h){const E=(0,n.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},h),{config:E})))}return(0,n.initOpenAIClient)(this.client).realtime.calls.refer(d,l,m)}reject(d,l={},h,m){if(h){const E=(0,n.overrideConfig)(this.client.config,h.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},h),{config:E})))}return(0,n.initOpenAIClient)(this.client).realtime.calls.reject(d,l,m)}}return Mi.Calls=o,Mi}var Os={},dS;function WH(){if(dS)return Os;dS=1;var e=Os&&Os.__awaiter||function(o,f,d,l){function h(m){return m instanceof d?m:new d(function(g){g(m)})}return new(d||(d=Promise))(function(m,g){function b(O){try{T(l.next(O))}catch(v){g(v)}}function E(O){try{T(l.throw(O))}catch(v){g(v)}}function T(O){O.done?m(O.value):h(O.value).then(b,E)}T((l=l.apply(o,f||[])).next())})};Object.defineProperty(Os,"__esModule",{value:!0}),Os.Items=Os.Conversations=void 0;const t=gt(),n=ot(),i=mt();class a extends t.ApiResource{constructor(f){super(f),this.items=new u(f)}create(f,d,l){return e(this,void 0,void 0,function*(){const h=f;if(d){const b=(0,n.overrideConfig)(this.client.config,d.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},d),{config:b})))}const g=yield(0,n.initOpenAIClient)(this.client).conversations.create(h,l).withResponse();return(0,n.finalResponse)(g)})}retrieve(f,d,l){return e(this,void 0,void 0,function*(){if(d){const g=(0,n.overrideConfig)(this.client.config,d.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},d),{config:g})))}const m=yield(0,n.initOpenAIClient)(this.client).conversations.retrieve(f,l).withResponse();return(0,n.finalResponse)(m)})}update(f,d,l,h){return e(this,void 0,void 0,function*(){const m=d;if(l){const E=(0,n.overrideConfig)(this.client.config,l.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},l),{config:E})))}const b=yield(0,n.initOpenAIClient)(this.client).conversations.update(f,m,h).withResponse();return(0,n.finalResponse)(b)})}delete(f,d,l){return e(this,void 0,void 0,function*(){if(d){const g=(0,n.overrideConfig)(this.client.config,d.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},d),{config:g})))}const m=yield(0,n.initOpenAIClient)(this.client).conversations.delete(f,l).withResponse();return(0,n.finalResponse)(m)})}}Os.Conversations=a;class u extends t.ApiResource{create(f,d,l,h){return e(this,void 0,void 0,function*(){if(l){const b=(0,n.overrideConfig)(this.client.config,l.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},l),{config:b})))}const g=yield(0,n.initOpenAIClient)(this.client).conversations.items.create(f,d,h).withResponse();return(0,n.finalResponse)(g)})}retrieve(f,d,l,h){return e(this,void 0,void 0,function*(){if(l){const b=(0,n.overrideConfig)(this.client.config,l.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},l),{config:b})))}const g=yield(0,n.initOpenAIClient)(this.client).conversations.items.retrieve(f,d,h).withResponse();return(0,n.finalResponse)(g)})}list(f,d,l,h){return e(this,void 0,void 0,function*(){if(l){const b=(0,n.overrideConfig)(this.client.config,l.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},l),{config:b})))}const g=yield(0,n.initOpenAIClient)(this.client).conversations.items.list(f,d,h).withResponse();return(0,n.finalResponse)(g)})}delete(f,d,l,h){return e(this,void 0,void 0,function*(){if(l){const b=(0,n.overrideConfig)(this.client.config,l.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,i.createHeaders)(Object.assign(Object.assign({},l),{config:b})))}const g=yield(0,n.initOpenAIClient)(this.client).conversations.items.delete(f,d,h).withResponse();return(0,n.finalResponse)(g)})}}return Os.Items=u,Os}var td={},fS;function XH(){if(fS)return td;fS=1,Object.defineProperty(td,"__esModule",{value:!0}),td.Videos=void 0;const e=gt(),t=mt(),n=ot();class i extends e.ApiResource{constructor(u){super(u)}create(u,o,f){if(o){const h=(0,n.overrideConfig)(this.client.config,o.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign(Object.assign({},o),{config:h})))}return(0,n.initOpenAIClient)(this.client).videos.create(u,f)}retrieve(u,o,f){if(o){const h=(0,n.overrideConfig)(this.client.config,o.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign(Object.assign({},o),{config:h})))}return(0,n.initOpenAIClient)(this.client).videos.retrieve(u,f)}list(u={},o,f){if(o){const h=(0,n.overrideConfig)(this.client.config,o.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign(Object.assign({},o),{config:h})))}return(0,n.initOpenAIClient)(this.client).videos.list(u,f)}delete(u,o,f){if(o){const h=(0,n.overrideConfig)(this.client.config,o.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign(Object.assign({},o),{config:h})))}return(0,n.initOpenAIClient)(this.client).videos.delete(u,f)}downloadContent(u,o={},f,d){if(f){const m=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign(Object.assign({},f),{config:m})))}return(0,n.initOpenAIClient)(this.client).videos.downloadContent(u,o,d)}remix(u,o,f,d){if(f){const m=(0,n.overrideConfig)(this.client.config,f.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign(Object.assign({},f),{config:m})))}return(0,n.initOpenAIClient)(this.client).videos.remix(u,o,d)}}return td.Videos=i,td}var Ss={},hS;function QH(){if(hS)return Ss;hS=1,Object.defineProperty(Ss,"__esModule",{value:!0}),Ss.ChatKitThreads=Ss.ChatKitSessions=Ss.ChatKit=void 0;const e=gt(),t=mt(),n=ot();class i extends e.ApiResource{constructor(f){super(f),this.sessions=new a(f),this.threads=new u(f)}uploadFile(f,d,l){if(d){const g=(0,n.overrideConfig)(this.client.config,d.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign(Object.assign({},d),{config:g})))}return(0,n.initOpenAIClient)(this.client).beta.chatkit.uploadFile(f,l)}}Ss.ChatKit=i;class a extends e.ApiResource{create(f,d,l){if(d){const g=(0,n.overrideConfig)(this.client.config,d.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign(Object.assign({},d),{config:g})))}const m=(0,n.initOpenAIClient)(this.client).beta.chatkit.sessions.create(f,l).withResponse();return(0,n.finalResponse)(m)}cancel(f,d,l){if(d){const g=(0,n.overrideConfig)(this.client.config,d.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign(Object.assign({},d),{config:g})))}const m=(0,n.initOpenAIClient)(this.client).beta.chatkit.sessions.cancel(f,l).withResponse();return(0,n.finalResponse)(m)}}Ss.ChatKitSessions=a;class u extends e.ApiResource{retrieve(f,d,l){if(d){const g=(0,n.overrideConfig)(this.client.config,d.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign(Object.assign({},d),{config:g})))}const m=(0,n.initOpenAIClient)(this.client).beta.chatkit.threads.retrieve(f,l).withResponse();return(0,n.finalResponse)(m)}list(f={},d,l){if(d){const g=(0,n.overrideConfig)(this.client.config,d.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign(Object.assign({},d),{config:g})))}return(0,n.initOpenAIClient)(this.client).beta.chatkit.threads.list(f,l)}delete(f,d,l){if(d){const g=(0,n.overrideConfig)(this.client.config,d.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign(Object.assign({},d),{config:g})))}const m=(0,n.initOpenAIClient)(this.client).beta.chatkit.threads.delete(f,l).withResponse();return(0,n.finalResponse)(m)}listItems(f,d={},l,h){if(l){const b=(0,n.overrideConfig)(this.client.config,l.config);this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign(Object.assign({},l),{config:b})))}return(0,n.initOpenAIClient)(this.client).beta.chatkit.threads.listItems(f,d,h)}}return Ss.ChatKitThreads=u,Ss}var nd={},mS;function JH(){if(mS)return nd;mS=1,Object.defineProperty(nd,"__esModule",{value:!0}),nd.Guardrails=void 0;const e=gt(),t=mt(),n=ot(),i=Tr();class a extends e.ApiResource{create(o,f,d){const l=o;return f&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},f)))),this.post(i.GUARDRAILS_API,Object.assign({body:l},d))}list(o,f,d){const l=o;f&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},f))));const h=l?(0,n.toQueryParams)(l):"";return this.getMethod(`${i.GUARDRAILS_API}${h}`,Object.assign({},d))}retrieve(o,f,d){const h=o.guardrail_id;return f&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},f)))),this.getMethod(`${i.GUARDRAILS_API}/${h}`,Object.assign({},d))}update(o,f,d){const l=o,h=l.guardrail_id;return delete l.guardrail_id,f&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},f)))),this.put(`${i.GUARDRAILS_API}/${h}`,Object.assign({body:l},d))}delete(o,f,d){const l=o,h=l.guardrail_id;return f&&(this.client.customHeaders=Object.assign(Object.assign({},this.client.customHeaders),(0,t.createHeaders)(Object.assign({},f)))),this.deleteMethod(`${i.GUARDRAILS_API}/${h}`,Object.assign({body:l},d))}}return nd.Guardrails=a,nd}var pS;function Qb(){return pS||(pS=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Guardrails=e.ChatKit=e.Videos=e.Conversations=e.MainRealtime=e.Webhooks=e.Providers=e.Integrations=e.Containers=e.Evals=e.Collections=e.Labels=e.Responses=e.Realtime=e.Logs=e.ApiKeys=e.Uploads=e.VectorStores=e.Audio=e.Moderations=e.FineTuning=e.VirtualKeys=e.Batches=e.Configs=e.Admin=e.Models=e.MainFiles=e.Threads=e.Assistants=e.Images=e.Embeddings=e.putMethod=e.deleteMethod=e.getMethod=e.postMethod=e.Prompt=e.Generations=e.Feedback=e.createHeaders=e.Completions=e.Chat=void 0;var t=mH();Object.defineProperty(e,"Chat",{enumerable:!0,get:function(){return t.Chat}});var n=pH();Object.defineProperty(e,"Completions",{enumerable:!0,get:function(){return n.Completions}});var i=mt();Object.defineProperty(e,"createHeaders",{enumerable:!0,get:function(){return i.createHeaders}});var a=gH();Object.defineProperty(e,"Feedback",{enumerable:!0,get:function(){return a.Feedback}});var u=bH();Object.defineProperty(e,"Generations",{enumerable:!0,get:function(){return u.Generations}}),Object.defineProperty(e,"Prompt",{enumerable:!0,get:function(){return u.Prompt}});var o=_H();Object.defineProperty(e,"postMethod",{enumerable:!0,get:function(){return o.postMethod}});var f=yH();Object.defineProperty(e,"getMethod",{enumerable:!0,get:function(){return f.getMethod}});var d=EH();Object.defineProperty(e,"deleteMethod",{enumerable:!0,get:function(){return d.deleteMethod}});var l=vH();Object.defineProperty(e,"putMethod",{enumerable:!0,get:function(){return l.putMethod}});var h=TH();Object.defineProperty(e,"Embeddings",{enumerable:!0,get:function(){return h.Embeddings}});var m=AH();Object.defineProperty(e,"Images",{enumerable:!0,get:function(){return m.Images}});var g=OH();Object.defineProperty(e,"Assistants",{enumerable:!0,get:function(){return g.Assistants}});var b=SH();Object.defineProperty(e,"Threads",{enumerable:!0,get:function(){return b.Threads}});var E=CH();Object.defineProperty(e,"MainFiles",{enumerable:!0,get:function(){return E.MainFiles}});var T=xH();Object.defineProperty(e,"Models",{enumerable:!0,get:function(){return T.Models}});var O=wH();Object.defineProperty(e,"Admin",{enumerable:!0,get:function(){return O.Admin}});var v=RH();Object.defineProperty(e,"Configs",{enumerable:!0,get:function(){return v.Configs}});var C=NH();Object.defineProperty(e,"Batches",{enumerable:!0,get:function(){return C.Batches}});var x=IH();Object.defineProperty(e,"VirtualKeys",{enumerable:!0,get:function(){return x.VirtualKeys}});var I=kH();Object.defineProperty(e,"FineTuning",{enumerable:!0,get:function(){return I.FineTuning}});var j=MH();Object.defineProperty(e,"Moderations",{enumerable:!0,get:function(){return j.Moderations}});var R=DH();Object.defineProperty(e,"Audio",{enumerable:!0,get:function(){return R.Audio}});var k=jH();Object.defineProperty(e,"VectorStores",{enumerable:!0,get:function(){return k.VectorStores}});var P=LH();Object.defineProperty(e,"Uploads",{enumerable:!0,get:function(){return P.Uploads}});var z=HH();Object.defineProperty(e,"ApiKeys",{enumerable:!0,get:function(){return z.ApiKeys}});var L=BH();Object.defineProperty(e,"Logs",{enumerable:!0,get:function(){return L.Logs}});var G=UH();Object.defineProperty(e,"Realtime",{enumerable:!0,get:function(){return G.Realtime}});var F=FH();Object.defineProperty(e,"Responses",{enumerable:!0,get:function(){return F.Responses}});var K=zH();Object.defineProperty(e,"Labels",{enumerable:!0,get:function(){return K.Labels}});var B=$H();Object.defineProperty(e,"Collections",{enumerable:!0,get:function(){return B.Collections}});var Z=qH();Object.defineProperty(e,"Evals",{enumerable:!0,get:function(){return Z.Evals}});var U=GH();Object.defineProperty(e,"Containers",{enumerable:!0,get:function(){return U.Containers}});var Y=KH();Object.defineProperty(e,"Integrations",{enumerable:!0,get:function(){return Y.Integrations}});var W=YH();Object.defineProperty(e,"Providers",{enumerable:!0,get:function(){return W.Providers}});var pe=VH();Object.defineProperty(e,"Webhooks",{enumerable:!0,get:function(){return pe.Webhooks}});var N=ZH();Object.defineProperty(e,"MainRealtime",{enumerable:!0,get:function(){return N.MainRealtime}});var M=WH();Object.defineProperty(e,"Conversations",{enumerable:!0,get:function(){return M.Conversations}});var q=XH();Object.defineProperty(e,"Videos",{enumerable:!0,get:function(){return q.Videos}});var D=QH();Object.defineProperty(e,"ChatKit",{enumerable:!0,get:function(){return D.ChatKit}});var ie=JH();Object.defineProperty(e,"Guardrails",{enumerable:!0,get:function(){return ie.Guardrails}})})(qg)),qg}var Zr={},Wr={},Mh={exports:{}},gS;function e8(){if(gS)return Mh.exports;gS=1,Mh.exports=e,Mh.exports.HttpsAgent=e;function e(){}return Mh.exports}var rd={},bS;function t8(){return bS||(bS=1,Object.defineProperty(rd,"__esModule",{value:!0}),rd.VERSION=void 0,rd.VERSION="3.0.1"),rd}var _S;function n8(){if(_S)return Wr;_S=1;var e=Wr&&Wr.__awaiter||function(O,v,C,x){function I(j){return j instanceof C?j:new C(function(R){R(j)})}return new(C||(C=Promise))(function(j,R){function k(L){try{z(x.next(L))}catch(G){R(G)}}function P(L){try{z(x.throw(L))}catch(G){R(G)}}function z(L){L.done?j(L.value):I(L.value).then(k,P)}z((x=x.apply(O,v||[])).next())})},t=Wr&&Wr.__rest||function(O,v){var C={};for(var x in O)Object.prototype.hasOwnProperty.call(O,x)&&v.indexOf(x)<0&&(C[x]=O[x]);if(O!=null&&typeof Object.getOwnPropertySymbols=="function")for(var I=0,x=Object.getOwnPropertySymbols(O);I<x.length;I++)v.indexOf(x[I])<0&&Object.prototype.propertyIsEnumerable.call(O,x[I])&&(C[x[I]]=O[x[I]]);return C},n=Wr&&Wr.__importDefault||function(O){return O&&O.__esModule?O:{default:O}};Object.defineProperty(Wr,"__esModule",{value:!0}),Wr.ApiClient=Wr.APIPromise=void 0;const i=n(e8()),a=Qb(),u=Tr(),o=xw(),f=ww(),d=ot(),l=t8(),h=new i.default({keepAlive:!0,timeout:300*1e3});function m(){if(typeof window<"u"&&window.fetch)return window.fetch.bind(window);if(typeof kg<"u"&&kg.fetch)return kg.fetch;if(typeof fetch<"u")return fetch.bind(globalThis);throw new Error("Fetch is not available in this environment")}function g(O){return e(this,void 0,void 0,function*(){const{response:v}=O;if(O.options.stream)return new f.Stream(v);const C=v.headers.get("content-type");if(C?.includes("application/json")){const I=b(O);return Object.assign(Object.assign({},yield v.json()),{getHeaders:()=>I})}return yield v.text()})}function b(O){const{responseHeaders:v}=O,C=(0,f.createResponseHeaders)(v),x=u.PORTKEY_HEADER_PREFIX,I=Object.entries(C).filter(([j,R])=>j.startsWith(x)).map(([j,R])=>[j.replace(x,""),R]);return Object.fromEntries(I)}class E extends Promise{constructor(v,C=g){super(x=>{x(null)}),this.responsePromise=v,this.parseResponse=C}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(this.parseResponse)),this.parsedPromise}then(v,C){return this.parse().then(v,C)}catch(v){return this.parse().catch(v)}finally(v){return this.parse().finally(v)}}Wr.APIPromise=E;class T{constructor(v){var{apiKey:C,baseURL:x,config:I,virtualKey:j,traceID:R,metadata:k,provider:P,Authorization:z,cacheForceRefresh:L,debug:G,customHost:F,openaiProject:K,openaiOrganization:B,awsSecretAccessKey:Z,awsAccessKeyId:U,awsSessionToken:Y,awsRegion:W,vertexProjectId:pe,vertexRegion:N,workersAiAccountId:M,azureResourceName:q,azureDeploymentId:D,azureApiVersion:ie,azureEndpointName:ae,huggingfaceBaseUrl:fe,forwardHeaders:Ee,cacheNamespace:de,requestTimeout:le,strictOpenAiCompliance:Pe=!1,anthropicBeta:re,anthropicVersion:Ae,mistralFimCompletion:Ce,dangerouslyAllowBrowser:Me,vertexStorageBucketName:He,providerFileName:Ne,providerModel:Ge,awsS3Bucket:pt,awsS3ObjectKey:it,awsBedrockModel:bt,fireworksAccountId:jt}=v,ar=t(v,["apiKey","baseURL","config","virtualKey","traceID","metadata","provider","Authorization","cacheForceRefresh","debug","customHost","openaiProject","openaiOrganization","awsSecretAccessKey","awsAccessKeyId","awsSessionToken","awsRegion","vertexProjectId","vertexRegion","workersAiAccountId","azureResourceName","azureDeploymentId","azureApiVersion","azureEndpointName","huggingfaceBaseUrl","forwardHeaders","cacheNamespace","requestTimeout","strictOpenAiCompliance","anthropicBeta","anthropicVersion","mistralFimCompletion","dangerouslyAllowBrowser","vertexStorageBucketName","providerFileName","providerModel","awsS3Bucket","awsS3ObjectKey","awsBedrockModel","fireworksAccountId"]);this.maxRetries=1,this.apiKey=C??"",this.baseURL=x??"",this.customHeaders=(0,a.createHeaders)(Object.assign({apiKey:C,config:I,virtualKey:j,traceID:R,metadata:k,provider:P,Authorization:z,cacheForceRefresh:L,debug:G,customHost:F,cacheNamespace:de,openaiProject:K,openaiOrganization:B,awsSecretAccessKey:Z,awsAccessKeyId:U,awsSessionToken:Y,awsRegion:W,vertexProjectId:pe,vertexRegion:N,workersAiAccountId:M,azureResourceName:q,azureDeploymentId:D,azureApiVersion:ie,azureEndpointName:ae,huggingfaceBaseUrl:fe,forwardHeaders:Ee,requestTimeout:le,strictOpenAiCompliance:Pe,anthropicVersion:Ae,mistralFimCompletion:Ce,anthropicBeta:re,dangerouslyAllowBrowser:Me,vertexStorageBucketName:He,providerFileName:Ne,providerModel:Ge,awsS3Bucket:pt,awsS3ObjectKey:it,awsBedrockModel:bt,fireworksAccountId:jt},ar)),this.portkeyHeaders=this.defaultHeaders(),this.fetch=m(),this.responseHeaders={}}defaultHeaders(){return Object.assign({"Content-Type":"application/json",[`${u.PORTKEY_HEADER_PREFIX}package-version`]:`portkey-${l.VERSION}`},(0,d.getPlatformProperties)())}_post(v,C){return this.methodRequest("post",v,C)}_put(v,C){return this.methodRequest("put",v,C)}_get(v,C){return this.methodRequest("get",v,C)}_delete(v,C){return this.methodRequest("delete",v,C)}generateError(v,C,x,I){return o.APIError.generate(v,C,x,I)}_shouldRetry(v){const C=v.status,x=v.headers.get("x-portkey-trace-id"),I=v.headers.get("x-portkey-request-id"),j=v.headers.get("x-portkey-gateway-exception");return!(C<500||x||I||j)}request(v,C=0){var x;return e(this,void 0,void 0,function*(){const{req:I,url:j}=this.buildRequest(v),R=yield this.fetch(j,I).catch(d.castToError);if(R instanceof Error){if(!((x=v.signal)===null||x===void 0)&&x.aborted)throw new o.APIUserAbortError;if(C<this.maxRetries)return this.request(v,C+1);throw R.name==="AbortError"?new o.APIConnectionTimeoutError({message:`${R.message}
335
+ STACK: ${R.stack}`}):new o.APIConnectionError({cause:R})}if(this.responseHeaders=(0,f.createResponseHeaders)(R.headers),!R.ok){if(C<this.maxRetries&&this._shouldRetry(R))return this.request(v,C+1);const k=yield R.text().catch(()=>"Unknown"),P=(0,f.safeJSON)(k),z=P?void 0:k;throw this.generateError(R.status,P,z,this.responseHeaders)}return{response:R,options:v,responseHeaders:R.headers}})}buildRequest(v){const C=new URL(this.baseURL+v.path),{method:x,body:I,extraHeaders:j}=v,R=Object.assign(Object.assign(Object.assign({},this.defaultHeaders()),this.customHeaders),j),P=Object.assign({method:x,headers:R},typeof window>"u"?{agent:h}:{});return x!=="get"&&I!==void 0&&(P.body=JSON.stringify((0,d.parseBody)(I))),{req:P,url:C.toString()}}methodRequest(v,C,x){return new E(this.request(Object.assign({method:v,path:C},x)))}}return Wr.ApiClient=T,Wr}var yS;function r8(){if(yS)return Zr;yS=1;var e=Zr&&Zr.__createBinding||(Object.create?(function(l,h,m,g){g===void 0&&(g=m);var b=Object.getOwnPropertyDescriptor(h,m);(!b||("get"in b?!h.__esModule:b.writable||b.configurable))&&(b={enumerable:!0,get:function(){return h[m]}}),Object.defineProperty(l,g,b)}):(function(l,h,m,g){g===void 0&&(g=m),l[g]=h[m]})),t=Zr&&Zr.__setModuleDefault||(Object.create?(function(l,h){Object.defineProperty(l,"default",{enumerable:!0,value:h})}):function(l,h){l.default=h}),n=Zr&&Zr.__importStar||function(l){if(l&&l.__esModule)return l;var h={};if(l!=null)for(var m in l)m!=="default"&&Object.prototype.hasOwnProperty.call(l,m)&&e(h,l,m);return t(h,l),h},i=Zr&&Zr.__rest||function(l,h){var m={};for(var g in l)Object.prototype.hasOwnProperty.call(l,g)&&h.indexOf(g)<0&&(m[g]=l[g]);if(l!=null&&typeof Object.getOwnPropertySymbols=="function")for(var b=0,g=Object.getOwnPropertySymbols(l);b<g.length;b++)h.indexOf(g[b])<0&&Object.prototype.propertyIsEnumerable.call(l,g[b])&&(m[g[b]]=l[g[b]]);return m};Object.defineProperty(Zr,"__esModule",{value:!0}),Zr.Portkey=void 0;const a=n(Qb()),u=n8(),o=Em(),f=ot();class d extends u.ApiClient{constructor(h){var m,g,{apiKey:b=(m=(0,f.readEnv)("PORTKEY_API_KEY"))!==null&&m!==void 0?m:null,baseURL:E=(g=(0,f.readEnv)("PORTKEY_BASE_URL"))!==null&&g!==void 0?g:null,config:T,virtualKey:O,provider:v,traceID:C,metadata:x,Authorization:I,cacheForceRefresh:j,debug:R,customHost:k,openaiProject:P,openaiOrganization:z,awsSecretAccessKey:L,awsAccessKeyId:G,awsSessionToken:F,awsRegion:K,vertexProjectId:B,vertexRegion:Z,workersAiAccountId:U,azureResourceName:Y,azureDeploymentId:W,azureApiVersion:pe,azureEndpointName:N,huggingfaceBaseUrl:M,forwardHeaders:q,cacheNamespace:D,requestTimeout:ie,strictOpenAiCompliance:ae,anthropicBeta:fe,anthropicVersion:Ee,mistralFimCompletion:de,dangerouslyAllowBrowser:le,vertexStorageBucketName:Pe,providerFileName:re,providerModel:Ae,awsS3Bucket:Ce,awsS3ObjectKey:Me,awsBedrockModel:He,fireworksAccountId:Ne,calculateAudioDuration:Ge}=h,pt=i(h,["apiKey","baseURL","config","virtualKey","provider","traceID","metadata","Authorization","cacheForceRefresh","debug","customHost","openaiProject","openaiOrganization","awsSecretAccessKey","awsAccessKeyId","awsSessionToken","awsRegion","vertexProjectId","vertexRegion","workersAiAccountId","azureResourceName","azureDeploymentId","azureApiVersion","azureEndpointName","huggingfaceBaseUrl","forwardHeaders","cacheNamespace","requestTimeout","strictOpenAiCompliance","anthropicBeta","anthropicVersion","mistralFimCompletion","dangerouslyAllowBrowser","vertexStorageBucketName","providerFileName","providerModel","awsS3Bucket","awsS3ObjectKey","awsBedrockModel","fireworksAccountId","calculateAudioDuration"]);if((0,o.isRunningInBrowser)()&&!le)throw new Error(`It looks like you're running in a browser-like environment.
336
+
337
+ This is disabled by default, as it risks exposing your secret API credentials to attackers.
338
+ If you understand the risks and have appropriate mitigations in place,
339
+ you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g.,
340
+
341
+ new Portkey({ ..., dangerouslyAllowBrowser: true, ... });`);super(Object.assign({apiKey:b,baseURL:E,config:T,virtualKey:O,provider:v,traceID:C,metadata:x,Authorization:I,cacheForceRefresh:j,debug:R,customHost:k,cacheNamespace:D,openaiProject:P,openaiOrganization:z,awsSecretAccessKey:L,awsAccessKeyId:G,awsSessionToken:F,awsRegion:K,vertexProjectId:B,vertexRegion:Z,workersAiAccountId:U,azureResourceName:Y,azureDeploymentId:W,azureApiVersion:pe,azureEndpointName:N,huggingfaceBaseUrl:M,forwardHeaders:q,requestTimeout:ie,strictOpenAiCompliance:ae,anthropicBeta:fe,anthropicVersion:Ee,mistralFimCompletion:de,dangerouslyAllowBrowser:le,vertexStorageBucketName:Pe,providerFileName:re,providerModel:Ae,awsS3Bucket:Ce,awsS3ObjectKey:Me,awsBedrockModel:He,fireworksAccountId:Ne},pt)),this.completions=new a.Completions(this),this.chat=new a.Chat(this),this.embeddings=new a.Embeddings(this),this.files=new a.MainFiles(this),this.images=new a.Images(this),this.models=new a.Models(this),this.generations=new a.Generations(this),this.prompts=new a.Prompt(this),this.labels=new a.Labels(this),this.collections=new a.Collections(this),this.feedback=new a.Feedback(this),this.batches=new a.Batches(this),this.fineTuning=new a.FineTuning(this),this.vectorStores=new a.VectorStores(this),this.moderations=new a.Moderations(this),this.audio=new a.Audio(this),this.uploads=new a.Uploads(this),this.responses=new a.Responses(this),this.evals=new a.Evals(this),this.containers=new a.Containers(this),this.webhooks=new a.Webhooks(this),this.admin=new a.Admin(this),this.virtualKeys=new a.VirtualKeys(this),this.apiKeys=new a.ApiKeys(this),this.configs=new a.Configs(this),this.logs=new a.Logs(this),this.integrations=new a.Integrations(this),this.providers=new a.Providers(this),this.realtime=new a.MainRealtime(this),this.conversations=new a.Conversations(this),this.videos=new a.Videos(this),this.guardrails=new a.Guardrails(this),this.beta={assistants:new a.Assistants(this),threads:new a.Threads(this),realtime:new a.Realtime(this),chatkit:new a.ChatKit(this)},this.post=(it,bt,jt,ar)=>new a.postMethod(this).create(it,bt,jt,ar),this.get=(it,bt,jt)=>new a.getMethod(this).create(it,bt,jt),this.delete=(it,bt,jt)=>new a.deleteMethod(this).create(it,bt,jt),this.put=(it,bt,jt,ar)=>new a.putMethod(this).create(it,bt,jt,ar),this.baseURL=(0,f.setBaseURL)(E,b),this.apiKey=(0,f.setApiKey)(this.baseURL,b),this.virtualKey=O||null,this.config=T||null,this.provider=v,this.traceID=C,this.metadata=x,this.cacheForceRefresh=j,this.debug=R,this.customHost=k,this.cacheNamespace=D,this.openaiProject=P,this.openaiOrganization=z,this.awsSecretAccessKey=L,this.awsAccessKeyId=G,this.awsSessionToken=F,this.awsRegion=K,this.vertexProjectId=B,this.vertexRegion=Z,this.workersAiAccountId=U,this.azureResourceName=Y,this.azureDeploymentId=W,this.azureApiVersion=pe,this.azureEndpointName=N,this.huggingfaceBaseUrl=M,this.forwardHeaders=q,this.requestTimeout=ie,this.strictOpenAiCompliance=ae,this.anthropicBeta=fe,this.anthropicVersion=Ee,this.mistralFimCompletion=de,this.dangerouslyAllowBrowser=le??!1,this.vertexStorageBucketName=Pe,this.providerFileName=re,this.providerModel=Ae,this.awsS3Bucket=Ce,this.awsS3ObjectKey=Me,this.awsBedrockModel=He,this.fireworksAccountId=Ne,this.calculateAudioDuration=Ge??!0}}return Zr.Portkey=d,Zr}var o0={},id={},sd={},c0,ES;function i8(){return ES||(ES=1,c0=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}),c0}var Cs={},ad={},vS;function s8(){if(vS)return ad;vS=1;var e;Object.defineProperty(ad,"__esModule",{value:!0}),ad.EventEmitter=void 0;const t=ht();let n=class{constructor(){e.set(this,{})}on(a,u){return(t.__classPrivateFieldGet(this,e,"f")[a]||(t.__classPrivateFieldGet(this,e,"f")[a]=[])).push({listener:u}),this}off(a,u){const o=t.__classPrivateFieldGet(this,e,"f")[a];if(!o)return this;const f=o.findIndex(d=>d.listener===u);return f>=0&&o.splice(f,1),this}once(a,u){return(t.__classPrivateFieldGet(this,e,"f")[a]||(t.__classPrivateFieldGet(this,e,"f")[a]=[])).push({listener:u,once:!0}),this}emitted(a){return new Promise((u,o)=>{this.once(a,u)})}_emit(a,...u){const o=t.__classPrivateFieldGet(this,e,"f")[a];o&&(t.__classPrivateFieldGet(this,e,"f")[a]=o.filter(f=>!f.once),o.forEach(({listener:f})=>f(...u)))}_hasListener(a){const u=t.__classPrivateFieldGet(this,e,"f")[a];return u&&u.length>0}};return ad.EventEmitter=n,e=new WeakMap,ad}var TS;function uR(){if(TS)return Cs;TS=1,Object.defineProperty(Cs,"__esModule",{value:!0}),Cs.OpenAIRealtimeEmitter=Cs.OpenAIRealtimeError=void 0,Cs.isAzure=u,Cs.buildRealtimeURL=o;const e=s8(),t=vi(),n=ym();class i extends t.OpenAIError{constructor(d,l){super(d),this.error=l?.error,this.event_id=l?.event_id}}Cs.OpenAIRealtimeError=i;class a extends e.EventEmitter{_onError(d,l,h){if(l=d?.error?`${d.error.message} code=${d.error.code} param=${d.error.param} type=${d.error.type} event_id=${d.error.event_id}`:l??"unknown error",!this._hasListener("error")){const g=new i(l+"\n\nTo resolve these unhandled rejection errors you should bind an `error` callback, e.g. `rt.on('error', (error) => ...)` ",d);g.cause=h,Promise.reject(g);return}const m=new i(l,d);m.cause=h,this._emit("error",m)}}Cs.OpenAIRealtimeEmitter=a;function u(f){return f instanceof n.AzureOpenAI}function o(f,d){const l="/realtime",h=f.baseURL,m=new URL(h+(h.endsWith("/")?l.slice(1):l));return m.protocol="wss",u(f)?(m.searchParams.set("api-version",f.apiVersion),m.searchParams.set("deployment",d)):m.searchParams.set("model",d),m}return Cs}var AS;function a8(){if(AS)return sd;AS=1,Object.defineProperty(sd,"__esModule",{value:!0}),sd.OpenAIRealtimeWS=void 0;const t=ht().__importStar(i8()),n=ym(),i=uR();class a extends i.OpenAIRealtimeEmitter{constructor(o,f){if(super(),f??(f=new n.OpenAI),typeof f?._options?.apiKey=="function"&&!o.__resolvedApiKey)throw new Error(["Cannot open Realtime WebSocket with a function-based apiKey.","Use the .create() method so that the key is resolved before connecting:","await OpenAIRealtimeWS.create(client, { model })"].join(`
342
+ `));this.url=(0,i.buildRealtimeURL)(f,o.model),this.socket=new t.WebSocket(this.url,{...o.options,headers:{...o.options?.headers,...(0,i.isAzure)(f)&&!o.__resolvedApiKey?{}:{Authorization:`Bearer ${f.apiKey}`},"OpenAI-Beta":"realtime=v1"}}),this.socket.on("message",l=>{const h=(()=>{try{return JSON.parse(l.toString())}catch(m){return this._onError(null,"could not parse websocket event",m),null}})();h&&(this._emit("event",h),h.type==="error"?this._onError(h):this._emit(h.type,h))}),this.socket.on("error",l=>{this._onError(null,l.message,l)})}static async create(o,f){return new a({...f,__resolvedApiKey:await o._callApiKey()},o)}static async azure(o,f={}){const d=await o._callApiKey(),l=f.deploymentName??o.deploymentName;if(!l)throw new Error("No deployment name provided");return new a({model:l,options:{...f.options,headers:{...f.options?.headers,...d?{}:{"api-key":o.apiKey}}},__resolvedApiKey:d},o)}send(o){try{this.socket.send(JSON.stringify(o))}catch(f){this._onError(null,"could not send data",f)}}close(o){try{this.socket.close(o?.code??1e3,o?.reason??"OK")}catch(f){this._onError(null,"could not close the connection",f)}}}return sd.OpenAIRealtimeWS=a,sd}var OS;function o8(){if(OS)return id;OS=1,Object.defineProperty(id,"__esModule",{value:!0}),id.PortkeyAIRealtimeWS=void 0;const e=a8();class t extends e.OpenAIRealtimeWS{constructor(i,a){var u;const o=Object.assign(Object.assign({},i.options),{headers:Object.assign(Object.assign({},((u=i.options)===null||u===void 0?void 0:u.headers)||{}),a.customHeaders)});super(Object.assign(Object.assign({},i),{options:o}),a)}}return id.PortkeyAIRealtimeWS=t,id}var SS;function c8(){return SS||(SS=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PortkeyAIRealtimeWS=void 0;var t=o8();Object.defineProperty(e,"PortkeyAIRealtimeWS",{enumerable:!0,get:function(){return t.PortkeyAIRealtimeWS}})})(o0)),o0}var od={},cd={},CS;function l8(){if(CS)return cd;CS=1,Object.defineProperty(cd,"__esModule",{value:!0}),cd.OpenAIRealtimeWebSocket=void 0;const e=ym(),t=vi(),n=uR(),i=K0();class a extends n.OpenAIRealtimeEmitter{constructor(o,f){super();const d=typeof f?._options?.apiKey=="function",l=o.dangerouslyAllowBrowser??f?._options?.dangerouslyAllowBrowser??(f?.apiKey?.startsWith("ek_")?!0:null);if(!l&&(0,i.isRunningInBrowser)())throw new t.OpenAIError(`It looks like you're running in a browser-like environment.
343
+
344
+ This is disabled by default, as it risks exposing your secret API credentials to attackers.
345
+
346
+ You can avoid this error by creating an ephemeral session token:
347
+ https://platform.openai.com/docs/api-reference/realtime-sessions
348
+ `);if(f??(f=new e.OpenAI({dangerouslyAllowBrowser:l})),d&&!o?.__resolvedApiKey)throw new Error(["Cannot open Realtime WebSocket with a function-based apiKey.","Use the .create() method so that the key is resolved before connecting:","await OpenAIRealtimeWebSocket.create(client, { model })"].join(`
349
+ `));this.url=(0,n.buildRealtimeURL)(f,o.model),o.onURL?.(this.url),this.socket=new WebSocket(this.url.toString(),["realtime",...(0,n.isAzure)(f)?[]:[`openai-insecure-api-key.${f.apiKey}`],"openai-beta.realtime-v1"]),this.socket.addEventListener("message",h=>{const m=(()=>{try{return JSON.parse(h.data.toString())}catch(g){return this._onError(null,"could not parse websocket event",g),null}})();m&&(this._emit("event",m),m.type==="error"?this._onError(m):this._emit(m.type,m))}),this.socket.addEventListener("error",h=>{this._onError(null,h.message,null)}),(0,n.isAzure)(f)&&(this.url.searchParams.get("Authorization")!==null?this.url.searchParams.set("Authorization","<REDACTED>"):this.url.searchParams.set("api-key","<REDACTED>"))}static async create(o,f){return new a({...f,__resolvedApiKey:await o._callApiKey()},o)}static async azure(o,f={}){const d=await o._callApiKey();function l(g){d?g.searchParams.set("Authorization",`Bearer ${o.apiKey}`):g.searchParams.set("api-key",o.apiKey)}const h=f.deploymentName??o.deploymentName;if(!h)throw new Error("No deployment name provided");const{dangerouslyAllowBrowser:m}=f;return new a({model:h,onURL:l,...m?{dangerouslyAllowBrowser:m}:{},__resolvedApiKey:d},o)}send(o){try{this.socket.send(JSON.stringify(o))}catch(f){this._onError(null,"could not send data",f)}}close(o){try{this.socket.close(o?.code??1e3,o?.reason??"OK")}catch(f){this._onError(null,"could not close the connection",f)}}}return cd.OpenAIRealtimeWebSocket=a,cd}var xS;function u8(){if(xS)return od;xS=1,Object.defineProperty(od,"__esModule",{value:!0}),od.PorkteyRealtimeWebSocket=void 0;const e=l8();class t extends e.OpenAIRealtimeWebSocket{constructor(i,a){super(Object.assign({},i),a)}}return od.PorkteyRealtimeWebSocket=t,od}var Pi={},l0={},wS;function d8(){return wS||(wS=1,Object.defineProperty(l0,"__esModule",{value:!0})),l0}var RS;function f8(){if(RS)return Pi;RS=1;var e=Pi&&Pi.__createBinding||(Object.create?(function(i,a,u,o){o===void 0&&(o=u);var f=Object.getOwnPropertyDescriptor(a,u);(!f||("get"in f?!a.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return a[u]}}),Object.defineProperty(i,o,f)}):(function(i,a,u,o){o===void 0&&(o=u),i[o]=a[u]})),t=Pi&&Pi.__setModuleDefault||(Object.create?(function(i,a){Object.defineProperty(i,"default",{enumerable:!0,value:a})}):function(i,a){i.default=a}),n=Pi&&Pi.__importStar||function(i){if(i&&i.__esModule)return i;var a={};if(i!=null)for(var u in i)u!=="default"&&Object.prototype.hasOwnProperty.call(i,u)&&e(a,i,u);return t(a,i),a};return Object.defineProperty(Pi,"__esModule",{value:!0}),Pi.ChatCompletionTypes=void 0,Pi.ChatCompletionTypes=n(d8()),Pi}var NS;function h8(){return NS||(NS=1,(function(e){var t=gs&&gs.__createBinding||(Object.create?(function(l,h,m,g){g===void 0&&(g=m);var b=Object.getOwnPropertyDescriptor(h,m);(!b||("get"in b?!h.__esModule:b.writable||b.configurable))&&(b={enumerable:!0,get:function(){return h[m]}}),Object.defineProperty(l,g,b)}):(function(l,h,m,g){g===void 0&&(g=m),l[g]=h[m]})),n=gs&&gs.__setModuleDefault||(Object.create?(function(l,h){Object.defineProperty(l,"default",{enumerable:!0,value:h})}):function(l,h){l.default=h}),i=gs&&gs.__importStar||function(l){if(l&&l.__esModule)return l;var h={};if(l!=null)for(var m in l)m!=="default"&&Object.prototype.hasOwnProperty.call(l,m)&&t(h,l,m);return n(h,l),h};Object.defineProperty(e,"__esModule",{value:!0}),e.types=e.PorkteyRealtimeWebSocket=e.PortkeyAIRealtimeWS=e.createHeaders=e.PORTKEY_GATEWAY_URL=e.Portkey=void 0;const a=i(Qb()),u=i(r8()),o=i(Tr()),f=c8();Object.defineProperty(e,"PortkeyAIRealtimeWS",{enumerable:!0,get:function(){return f.PortkeyAIRealtimeWS}});const d=u8();Object.defineProperty(e,"PorkteyRealtimeWebSocket",{enumerable:!0,get:function(){return d.PorkteyRealtimeWebSocket}}),e.Portkey=u.Portkey,e.PORTKEY_GATEWAY_URL=o.PORTKEY_GATEWAY_URL,e.createHeaders=a.createHeaders,e.types=i(f8()),e.default=e.Portkey})(gs)),gs}var m8=h8();const IS=bc(m8);function kS(){return localStorage.getItem("hoot-selected-model")||"@openai/gpt-4o-mini"}function Ki(e){const t=e.split("/");return t.length>1?t[t.length-1]:e}class p8{client=null;jwtToken=null;lastAuthMode=null;lastBaseUrl=null;constructor(){}getAuthConfig(){return Ue.getState().portkeyAuth}async ensureClient(){const t=this.getAuthConfig(),n=t.useApiKey?"apiKey":"jwt",i=t.baseUrl||null;if((this.lastAuthMode&&this.lastAuthMode!==n||this.lastBaseUrl!==i)&&(this.client=null,this.jwtToken=null),!this.client){const a={apiKey:"",dangerouslyAllowBrowser:!0};t.baseUrl&&(a.baseURL=t.baseUrl),t.useApiKey&&t.apiKey?(a.apiKey=t.apiKey,this.client=new IS(a),this.lastAuthMode="apiKey",this.lastBaseUrl=i):(this.jwtToken=await Gd(),a.apiKey=this.jwtToken,this.client=new IS(a),this.lastAuthMode="jwt",this.lastBaseUrl=i)}}async createChatCompletion(t){try{await this.ensureClient();const n=t.model||kS();console.log(`🤖 Using model: ${Ki(n)}`);const a=Ki(n).toLowerCase().includes("gpt-5"),u={model:n,messages:t.messages,tools:t.tools,temperature:t.temperature??.7,stream:t.stream??!1};return a?u.max_completion_tokens=t.max_tokens??2e3:u.max_tokens=t.max_tokens??2e3,await this.client.chat.completions.create(u)}catch(n){if(console.error("Portkey API error:",n),n instanceof Error&&n.message.includes("401"))return console.log("🔄 JWT expired, refreshing..."),this.client=null,this.jwtToken=null,this.createChatCompletion(t);throw n}}async*createChatCompletionStream(t){try{await this.ensureClient();const n=t.model||kS();console.log(`🤖 Using model (streaming): ${Ki(n)}`);const a=Ki(n).toLowerCase().includes("gpt-5"),u={model:n,messages:t.messages,tools:t.tools,temperature:t.temperature??.7,stream:!0};a?u.max_completion_tokens=t.max_tokens??2e3:u.max_tokens=t.max_tokens??2e3;const o=await this.client.chat.completions.create(u);for await(const f of o)yield f}catch(n){if(console.error("Portkey streaming error:",n),n instanceof Error&&n.message.includes("401")){console.log("🔄 JWT expired, refreshing..."),this.client=null,this.jwtToken=null,yield*this.createChatCompletionStream(t);return}throw n}}async refreshToken(){this.client=null,this.jwtToken=null,this.lastAuthMode=null,this.lastBaseUrl=null,await this.ensureClient()}getAuthMode(){const t=this.getAuthConfig();return t.useApiKey&&t.apiKey?"apiKey":"jwt"}async listModels(){try{return await this.ensureClient(),await this.client.models.list()}catch(t){if(console.error("Failed to list models:",t),t instanceof Error&&t.message.includes("401"))return console.log("🔄 JWT expired, refreshing..."),this.client=null,this.jwtToken=null,this.listModels();throw t}}}let qh=null;function Q0(){return qh||(qh=new p8),qh}function g8(){qh=null}let ld=null;const u0="hoot-available-models",MS="hoot-selected-model",b8=1440*60*1e3;function _8({onClose:e}){const[t,n]=J.useState([]),[i,a]=J.useState(!0),[u,o]=J.useState(!1),[f,d]=J.useState(()=>localStorage.getItem(MS)||"@openai/gpt-4o-mini"),[l,h]=J.useState("model"),m=Ue(M=>M.toolFilterEnabled),g=Ue(M=>M.toolFilterConfig),b=Ue(M=>M.setToolFilterEnabled),E=Ue(M=>M.updateToolFilterConfig),[T,O]=J.useState(m),[v,C]=J.useState(g.topK.toString()),[x,I]=J.useState(g.minScore.toFixed(2)),j=Ue(M=>M.portkeyAuth),R=Ue(M=>M.setPortkeyUseApiKey),k=Ue(M=>M.setPortkeyApiKey),P=Ue(M=>M.setPortkeyBaseUrl),[z,L]=J.useState(j.useApiKey),[G,F]=J.useState(j.apiKey||""),[K,B]=J.useState(j.baseUrl||"");J.useEffect(()=>{O(m),C(g.topK.toString()),I(g.minScore.toFixed(2)),L(j.useApiKey),F(j.apiKey||""),B(j.baseUrl||""),console.log("🔧 Modal sync:",{topK:g.topK.toString(),minScore:g.minScore.toFixed(2),useApiKey:j.useApiKey,baseUrl:j.baseUrl})},[m,g,j]);const Z=async(M=!1)=>{let q=null;try{if(!M&&ld){console.log("✅ Using cached models from memory"),n(ld);return}if(M){const fe=localStorage.getItem(u0);if(fe)try{const{models:Ee}=JSON.parse(fe);q=Ee}catch{}}else{const fe=localStorage.getItem(u0);if(fe)try{const{models:Ee,timestamp:de}=JSON.parse(fe),le=Date.now()-de;if(le<b8){console.log(`✅ Using cached models from localStorage (${Math.floor(le/1e3/60)}min old)`),ld=Ee,n(Ee);return}else q=Ee,console.log("⏰ Cache expired, will try to refresh...")}catch(Ee){console.warn("Failed to parse cached models:",Ee)}}console.log("🔄 Fetching models from Portkey...");const ae=(await Q0().listModels()).data?.map(fe=>fe.id)||[];if(ae.length===0)throw new Error("No models returned from API");ld=ae,localStorage.setItem(u0,JSON.stringify({models:ae,timestamp:Date.now()})),n(ae),console.log(`✅ Loaded ${ae.length} models from Portkey`)}catch(D){console.error("Failed to load models:",D),q&&q.length>0?(console.log("âš ī¸ Using stale cache due to API failure"),ld=q,n(q)):(console.error("❌ No cached models and API failed"),n([]))}};J.useEffect(()=>{(async()=>{a(!0),await Z(!1),a(!1)})()},[]);const U=async()=>{o(!0),await Z(!0),o(!1)},Y=M=>{d(M),localStorage.setItem(MS,M),console.log(`✅ Selected model: ${M}`),window.dispatchEvent(new CustomEvent("model-changed",{detail:{model:M}}))},W=()=>{b(T),E({topK:parseInt(v),minScore:parseFloat(x)});const M=z!==j.useApiKey||G!==(j.apiKey||"")||K!==(j.baseUrl||"");R(z),k(G||null),P(K||null),M&&(g8(),console.log("🔄 Portkey auth changed, client will reinitialize")),e()},pe=[{value:"10",label:"Aggressive"},{value:"20",label:"Moderate"},{value:"30",label:"Balanced"},{value:"50",label:"Conservative"}],N=[{value:"0.20",label:"Relaxed"},{value:"0.30",label:"Standard"},{value:"0.40",label:"Strict"},{value:"0.50",label:"Very Strict"}];return J.useEffect(()=>{const M=q=>{if(q.key==="Enter"&&!q.shiftKey&&!q.ctrlKey&&!q.metaKey){const D=q.target;(D.tagName==="INPUT"||D.tagName==="TEXTAREA")&&(q.preventDefault(),W())}};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[T,v,x,z,G,K]),_.jsx(Cw,{onClose:e,children:_.jsxs("div",{className:"llm-settings-modal",children:[_.jsxs("div",{className:"modal-header",children:[_.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",marginBottom:"8px"},children:[_.jsx(Ob,{size:24,style:{color:"var(--theme-accent-primary)"}}),_.jsx("h2",{style:{margin:0},children:"Settings"})]}),_.jsx("p",{style:{textAlign:"center",color:"var(--text-secondary)",fontSize:"14px",fontWeight:400,marginTop:"4px",marginBottom:"24px"},children:"Configure Model and Tool Filtering"})]}),_.jsx("div",{className:"modal-body",children:_.jsx(vw,{tabs:[{value:"model",label:"Model",icon:_.jsx(Ld,{size:16})},{value:"auth",label:"Authentication",icon:_.jsx(Dd,{size:16})},{value:"filtering",label:"Tool Filtering",icon:_.jsx(fa,{size:16})}],value:l,onChange:h,children:M=>M==="model"?_.jsx("div",{className:"tab-content-wrapper",children:_.jsx("div",{className:"info-section",style:{marginBottom:"0",marginTop:0},children:_.jsxs("div",{className:"info-box",children:[_.jsxs("div",{className:"info-box-header",children:[_.jsx(Ld,{size:14,style:{marginRight:"6px"}}),"Current Model"]}),_.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginTop:"12px",padding:"12px",background:"var(--bg-secondary)",borderRadius:"6px",border:"1px solid var(--border-color)"},children:[_.jsxs("div",{children:[_.jsx("div",{style:{fontSize:"16px",fontWeight:600,color:"var(--text-primary)",marginBottom:"4px"},children:Ki(f)}),_.jsxs("div",{style:{fontSize:"12px",color:"var(--text-secondary)"},children:[z&&G?"Authenticated via API Key":"Authenticated via JWT"," â€ĸ ",K||"Portkey Gateway"]})]}),_.jsx("div",{style:{padding:"4px 8px",background:"var(--theme-accent-primary)",color:"white",borderRadius:"4px",fontSize:"11px",fontWeight:600},children:"ACTIVE"})]}),i?_.jsx("div",{style:{marginTop:"12px",fontSize:"13px",color:"var(--text-secondary)",fontStyle:"italic"},children:"Loading available models..."}):t.length>0?_.jsxs("div",{style:{marginTop:"12px"},children:[_.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"8px"},children:[_.jsxs("div",{style:{fontSize:"12px",color:"var(--text-secondary)",fontWeight:500},children:["Available models (",t.length,"):"]}),_.jsxs("button",{onClick:U,disabled:u,style:{display:"flex",alignItems:"center",gap:"4px",padding:"4px 8px",background:"var(--bg-tertiary)",border:"1px solid var(--border-color)",borderRadius:"4px",fontSize:"11px",color:"var(--text-secondary)",cursor:u?"not-allowed":"pointer",opacity:u?.6:1},title:"Refresh models list",children:[_.jsx(jd,{size:12,style:{animation:u?"spin 1s linear infinite":"none"}}),"Refresh"]})]}),_.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:[t.slice(0,10).map(q=>_.jsx("button",{onClick:()=>Y(q),style:{padding:"4px 8px",background:q===f?"var(--theme-accent-primary)":"var(--bg-tertiary)",color:q===f?"white":"var(--text-secondary)",borderRadius:"4px",fontSize:"11px",fontFamily:"monospace",border:q===f?"none":"1px solid var(--border-color)",cursor:"pointer",transition:"all 0.15s ease"},onMouseEnter:D=>{q!==f&&(D.currentTarget.style.background="var(--bg-secondary)",D.currentTarget.style.borderColor="var(--theme-accent-primary)")},onMouseLeave:D=>{q!==f&&(D.currentTarget.style.background="var(--bg-tertiary)",D.currentTarget.style.borderColor="var(--border-color)")},children:Ki(q)},q)),t.length>10&&_.jsxs("span",{style:{padding:"4px 8px",color:"var(--text-secondary)",fontSize:"11px",display:"flex",alignItems:"center"},children:["+",t.length-10," more"]})]})]}):null]})})}):M==="auth"?_.jsx("div",{className:"tab-content-wrapper",children:_.jsx("div",{className:"info-section",style:{marginBottom:"0",marginTop:0},children:_.jsxs("div",{className:"info-box",children:[_.jsxs("div",{className:"info-box-header",children:[_.jsx(Dd,{size:14,style:{marginRight:"6px"}}),"Portkey Authentication"]}),_.jsx("p",{style:{marginTop:"8px",marginBottom:"16px"},children:"Choose how to authenticate with Portkey. Use JWT for production (more secure) or API key for local development."}),_.jsx("div",{className:"form-group",style:{marginBottom:"16px"},children:_.jsx($0,{label:"Use API Key",checked:z,onChange:q=>L(q.target.checked),helperText:"When enabled, uses your Portkey API key directly instead of JWT"})}),z&&_.jsx("div",{className:"form-group",children:_.jsx(yw,{label:"Portkey API Key",value:G,onChange:q=>F(q.target.value),placeholder:"pk-...",helperText:"Get your API key from portkey.ai/api-keys"})}),!z&&_.jsxs("div",{style:{padding:"12px",background:"var(--bg-secondary)",borderRadius:"6px",border:"1px solid var(--border-color)",fontSize:"13px",color:"var(--text-secondary)",marginBottom:"16px"},children:[_.jsx("strong",{style:{color:"var(--text-primary)"},children:"JWT Mode (Default)"}),_.jsx("br",{}),"Token is automatically generated by the backend server. No configuration needed."]}),_.jsxs("div",{className:"form-group",style:{marginTop:"16px"},children:[_.jsx("label",{style:{display:"block",marginBottom:"6px",fontSize:"13px",fontWeight:500,color:"var(--text-primary)"},children:"Gateway URL (Optional)"}),_.jsx("input",{type:"url",value:K,onChange:q=>B(q.target.value),placeholder:"https://api.portkey.ai",style:{width:"100%",padding:"10px 12px",background:"var(--bg-secondary)",border:"1px solid var(--border-color)",borderRadius:"6px",fontSize:"14px",color:"var(--text-primary)",boxSizing:"border-box"}}),_.jsx("div",{style:{marginTop:"4px",fontSize:"12px",color:"var(--text-secondary)"},children:"Use a custom gateway endpoint for private deployments. Leave empty for default."})]})]})})}):M==="filtering"?_.jsxs("div",{className:"tab-content-wrapper",children:[_.jsx("div",{className:"info-section",style:{marginBottom:"0",marginTop:0},children:_.jsxs("div",{className:"info-box",children:[_.jsx("div",{className:"info-box-header",children:"💡 How It Works"}),_.jsx("p",{children:"Semantic filtering ranks tools by relevance using sentence embeddings. Only top-ranked tools are sent to the LLM, reducing token usage while maintaining accuracy."})]})}),_.jsxs("div",{className:"form-section",children:[_.jsx("div",{className:"form-group",children:_.jsx($0,{label:"Enable Semantic Filtering",checked:T,onChange:q=>O(q.target.checked),helperText:"Automatically select relevant tools based on conversation context"})}),T&&_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"form-group",children:_.jsx(ga,{label:"Filter Strength",options:pe,value:v,onChange:C,helperText:"How many tools to include after filtering"})}),_.jsx("div",{className:"form-group",children:_.jsx(ga,{label:"Match Sensitivity",options:N,value:x,onChange:I,helperText:"How closely tools must match your query"})})]})]}),!T&&_.jsx("div",{className:"info-section",children:_.jsxs("div",{className:"info-box warning-box",children:[_.jsx("div",{className:"info-box-header",children:"âš ī¸ Warning"}),_.jsx("p",{children:"All tools will be sent to the LLM. May exceed OpenAI's 128 tool limit for large toolsets."})]})})]}):null})}),_.jsxs("div",{className:"modal-footer",children:[_.jsx(Bt,{variant:"secondary",onClick:e,children:"Cancel"}),_.jsx(Bt,{variant:"primary",onClick:W,children:"Save Configuration"})]})]})})}function PS(e){const t=[],n=String(e||"");let i=n.indexOf(","),a=0,u=!1;for(;!u;){i===-1&&(i=n.length,u=!0);const o=n.slice(a,i).trim();(o||!u)&&t.push(o),a=i+1,i=n.indexOf(",",a)}return t}function dR(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const y8=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,E8=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,v8={};function DS(e,t){return(v8.jsx?E8:y8).test(e)}const T8=/[ \t\n\f\r]/g;function A8(e){return typeof e=="object"?e.type==="text"?jS(e.value):!1:jS(e)}function jS(e){return e.replace(T8,"")===""}let tf=class{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}};tf.prototype.normal={};tf.prototype.property={};tf.prototype.space=void 0;function fR(e,t){const n={},i={};for(const a of e)Object.assign(n,a.property),Object.assign(i,a.normal);return new tf(n,i,t)}function Fd(e){return e.toLowerCase()}let jr=class{constructor(t,n){this.attribute=n,this.property=t}};jr.prototype.attribute="";jr.prototype.booleanish=!1;jr.prototype.boolean=!1;jr.prototype.commaOrSpaceSeparated=!1;jr.prototype.commaSeparated=!1;jr.prototype.defined=!1;jr.prototype.mustUseProperty=!1;jr.prototype.number=!1;jr.prototype.overloadedBoolean=!1;jr.prototype.property="";jr.prototype.spaceSeparated=!1;jr.prototype.space=void 0;let O8=0;const ft=ao(),Un=ao(),J0=ao(),Ie=ao(),tn=ao(),uc=ao(),Xr=ao();function ao(){return 2**++O8}const eb=Object.freeze(Object.defineProperty({__proto__:null,boolean:ft,booleanish:Un,commaOrSpaceSeparated:Xr,commaSeparated:uc,number:Ie,overloadedBoolean:J0,spaceSeparated:tn},Symbol.toStringTag,{value:"Module"})),d0=Object.keys(eb);let Jb=class extends jr{constructor(t,n,i,a){let u=-1;if(super(t,n),LS(this,"space",a),typeof i=="number")for(;++u<d0.length;){const o=d0[u];LS(this,d0[u],(i&eb[o])===eb[o])}}};Jb.prototype.defined=!0;function LS(e,t,n){n&&(e[t]=n)}function vc(e){const t={},n={};for(const[i,a]of Object.entries(e.properties)){const u=new Jb(i,e.transform(e.attributes||{},i),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(u.mustUseProperty=!0),t[i]=u,n[Fd(i)]=i,n[Fd(u.attribute)]=i}return new tf(t,n,e.space)}const hR=vc({properties:{ariaActiveDescendant:null,ariaAtomic:Un,ariaAutoComplete:null,ariaBusy:Un,ariaChecked:Un,ariaColCount:Ie,ariaColIndex:Ie,ariaColSpan:Ie,ariaControls:tn,ariaCurrent:null,ariaDescribedBy:tn,ariaDetails:null,ariaDisabled:Un,ariaDropEffect:tn,ariaErrorMessage:null,ariaExpanded:Un,ariaFlowTo:tn,ariaGrabbed:Un,ariaHasPopup:null,ariaHidden:Un,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:tn,ariaLevel:Ie,ariaLive:null,ariaModal:Un,ariaMultiLine:Un,ariaMultiSelectable:Un,ariaOrientation:null,ariaOwns:tn,ariaPlaceholder:null,ariaPosInSet:Ie,ariaPressed:Un,ariaReadOnly:Un,ariaRelevant:null,ariaRequired:Un,ariaRoleDescription:tn,ariaRowCount:Ie,ariaRowIndex:Ie,ariaRowSpan:Ie,ariaSelected:Un,ariaSetSize:Ie,ariaSort:null,ariaValueMax:Ie,ariaValueMin:Ie,ariaValueNow:Ie,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function mR(e,t){return t in e?e[t]:t}function pR(e,t){return mR(e,t.toLowerCase())}const S8=vc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:uc,acceptCharset:tn,accessKey:tn,action:null,allow:null,allowFullScreen:ft,allowPaymentRequest:ft,allowUserMedia:ft,alt:null,as:null,async:ft,autoCapitalize:null,autoComplete:tn,autoFocus:ft,autoPlay:ft,blocking:tn,capture:null,charSet:null,checked:ft,cite:null,className:tn,cols:Ie,colSpan:null,content:null,contentEditable:Un,controls:ft,controlsList:tn,coords:Ie|uc,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ft,defer:ft,dir:null,dirName:null,disabled:ft,download:J0,draggable:Un,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ft,formTarget:null,headers:tn,height:Ie,hidden:J0,high:Ie,href:null,hrefLang:null,htmlFor:tn,httpEquiv:tn,id:null,imageSizes:null,imageSrcSet:null,inert:ft,inputMode:null,integrity:null,is:null,isMap:ft,itemId:null,itemProp:tn,itemRef:tn,itemScope:ft,itemType:tn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ft,low:Ie,manifest:null,max:null,maxLength:Ie,media:null,method:null,min:null,minLength:Ie,multiple:ft,muted:ft,name:null,nonce:null,noModule:ft,noValidate:ft,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:ft,optimum:Ie,pattern:null,ping:tn,placeholder:null,playsInline:ft,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ft,referrerPolicy:null,rel:tn,required:ft,reversed:ft,rows:Ie,rowSpan:Ie,sandbox:tn,scope:null,scoped:ft,seamless:ft,selected:ft,shadowRootClonable:ft,shadowRootDelegatesFocus:ft,shadowRootMode:null,shape:null,size:Ie,sizes:null,slot:null,span:Ie,spellCheck:Un,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ie,step:null,style:null,tabIndex:Ie,target:null,title:null,translate:null,type:null,typeMustMatch:ft,useMap:null,value:Un,width:Ie,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:tn,axis:null,background:null,bgColor:null,border:Ie,borderColor:null,bottomMargin:Ie,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ft,declare:ft,event:null,face:null,frame:null,frameBorder:null,hSpace:Ie,leftMargin:Ie,link:null,longDesc:null,lowSrc:null,marginHeight:Ie,marginWidth:Ie,noResize:ft,noHref:ft,noShade:ft,noWrap:ft,object:null,profile:null,prompt:null,rev:null,rightMargin:Ie,rules:null,scheme:null,scrolling:Un,standby:null,summary:null,text:null,topMargin:Ie,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ie,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ft,disableRemotePlayback:ft,prefix:null,property:null,results:Ie,security:null,unselectable:null},space:"html",transform:pR}),C8=vc({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:Xr,accentHeight:Ie,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ie,amplitude:Ie,arabicForm:null,ascent:Ie,attributeName:null,attributeType:null,azimuth:Ie,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ie,by:null,calcMode:null,capHeight:Ie,className:tn,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:Ie,diffuseConstant:Ie,direction:null,display:null,dur:null,divisor:Ie,dominantBaseline:null,download:ft,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ie,enableBackground:null,end:null,event:null,exponent:Ie,externalResourcesRequired:null,fill:null,fillOpacity:Ie,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:uc,g2:uc,glyphName:uc,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ie,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ie,horizOriginX:Ie,horizOriginY:Ie,id:null,ideographic:Ie,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ie,k:Ie,k1:Ie,k2:Ie,k3:Ie,k4:Ie,kernelMatrix:Xr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ie,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:Ie,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:Ie,overlineThickness:Ie,paintOrder:null,panose1:null,path:null,pathLength:Ie,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:tn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ie,pointsAtY:Ie,pointsAtZ:Ie,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Xr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Xr,rev:Xr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Xr,requiredFeatures:Xr,requiredFonts:Xr,requiredFormats:Xr,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:Ie,specularExponent:Ie,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ie,strikethroughThickness:Ie,string:null,stroke:null,strokeDashArray:Xr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ie,strokeOpacity:Ie,strokeWidth:null,style:null,surfaceScale:Ie,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Xr,tabIndex:Ie,tableValues:null,target:null,targetX:Ie,targetY:Ie,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Xr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ie,underlineThickness:Ie,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ie,values:null,vAlphabetic:Ie,vMathematical:Ie,vectorEffect:null,vHanging:Ie,vIdeographic:Ie,version:null,vertAdvY:Ie,vertOriginX:Ie,vertOriginY:Ie,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ie,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:mR}),gR=vc({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),bR=vc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:pR}),_R=vc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),x8={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"},w8=/[A-Z]/g,HS=/-[a-z]/g,R8=/^data[-\w.:]+$/i;function e_(e,t){const n=Fd(t);let i=t,a=jr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&R8.test(t)){if(t.charAt(4)==="-"){const u=t.slice(5).replace(HS,I8);i="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=t.slice(4);if(!HS.test(u)){let o=u.replace(w8,N8);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}a=Jb}return new a(i,t)}function N8(e){return"-"+e.toLowerCase()}function I8(e){return e.charAt(1).toUpperCase()}const vm=fR([hR,S8,gR,bR,_R],"html"),Tc=fR([hR,C8,gR,bR,_R],"svg");function BS(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function yR(e){return e.join(" ").trim()}var nc={},f0,US;function k8(){if(US)return f0;US=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,f=/^\s+|\s+$/g,d=`
350
+ `,l="/",h="*",m="",g="comment",b="declaration";f0=function(T,O){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];O=O||{};var v=1,C=1;function x(K){var B=K.match(t);B&&(v+=B.length);var Z=K.lastIndexOf(d);C=~Z?K.length-Z:C+K.length}function I(){var K={line:v,column:C};return function(B){return B.position=new j(K),P(),B}}function j(K){this.start=K,this.end={line:v,column:C},this.source=O.source}j.prototype.content=T;function R(K){var B=new Error(O.source+":"+v+":"+C+": "+K);if(B.reason=K,B.filename=O.source,B.line=v,B.column=C,B.source=T,!O.silent)throw B}function k(K){var B=K.exec(T);if(B){var Z=B[0];return x(Z),T=T.slice(Z.length),B}}function P(){k(n)}function z(K){var B;for(K=K||[];B=L();)B!==!1&&K.push(B);return K}function L(){var K=I();if(!(l!=T.charAt(0)||h!=T.charAt(1))){for(var B=2;m!=T.charAt(B)&&(h!=T.charAt(B)||l!=T.charAt(B+1));)++B;if(B+=2,m===T.charAt(B-1))return R("End of comment missing");var Z=T.slice(2,B-2);return C+=2,x(Z),T=T.slice(B),C+=2,K({type:g,comment:Z})}}function G(){var K=I(),B=k(i);if(B){if(L(),!k(a))return R("property missing ':'");var Z=k(u),U=K({type:b,property:E(B[0].replace(e,m)),value:Z?E(Z[0].replace(e,m)):m});return k(o),U}}function F(){var K=[];z(K);for(var B;B=G();)B!==!1&&(K.push(B),z(K));return K}return P(),F()};function E(T){return T?T.replace(f,m):m}return f0}var FS;function M8(){if(FS)return nc;FS=1;var e=nc&&nc.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(nc,"__esModule",{value:!0}),nc.default=n;const t=e(k8());function n(i,a){let u=null;if(!i||typeof i!="string")return u;const o=(0,t.default)(i),f=typeof a=="function";return o.forEach(d=>{if(d.type!=="declaration")return;const{property:l,value:h}=d;f?a(l,h,d):h&&(u=u||{},u[l]=h)}),u}return nc}var ud={},zS;function P8(){if(zS)return ud;zS=1,Object.defineProperty(ud,"__esModule",{value:!0}),ud.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,u=function(l){return!l||n.test(l)||e.test(l)},o=function(l,h){return h.toUpperCase()},f=function(l,h){return"".concat(h,"-")},d=function(l,h){return h===void 0&&(h={}),u(l)?l:(l=l.toLowerCase(),h.reactCompat?l=l.replace(a,f):l=l.replace(i,f),l.replace(t,o))};return ud.camelCase=d,ud}var dd,$S;function D8(){if($S)return dd;$S=1;var e=dd&&dd.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(M8()),n=P8();function i(a,u){var o={};return!a||typeof a!="string"||(0,t.default)(a,function(f,d){f&&d&&(o[(0,n.camelCase)(f,u)]=d)}),o}return i.default=i,dd=i,dd}var j8=D8();const L8=bc(j8),Tm=ER("end"),Vi=ER("start");function ER(e){return t;function t(n){const i=n&&n.position&&n.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function H8(e){const t=Vi(e),n=Tm(e);if(t&&n)return{start:t,end:n}}function Cd(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?qS(e.position):"start"in e||"end"in e?qS(e):"line"in e||"column"in e?tb(e):""}function tb(e){return GS(e&&e.line)+":"+GS(e&&e.column)}function qS(e){return tb(e&&e.start)+"-"+tb(e&&e.end)}function GS(e){return e&&typeof e=="number"?e:1}class fr extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let a="",u={},o=!1;if(n&&("line"in n&&"column"in n?u={place:n}:"start"in n&&"end"in n?u={place:n}:"type"in n?u={ancestors:[n],place:n.position}:u={...n}),typeof t=="string"?a=t:!u.cause&&t&&(o=!0,a=t.message,u.cause=t),!u.ruleId&&!u.source&&typeof i=="string"){const d=i.indexOf(":");d===-1?u.ruleId=i:(u.source=i.slice(0,d),u.ruleId=i.slice(d+1))}if(!u.place&&u.ancestors&&u.ancestors){const d=u.ancestors[u.ancestors.length-1];d&&(u.place=d.position)}const f=u.place&&"start"in u.place?u.place.start:u.place;this.ancestors=u.ancestors||void 0,this.cause=u.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=f?f.line:void 0,this.name=Cd(u.place)||"1:1",this.place=u.place||void 0,this.reason=this.message,this.ruleId=u.ruleId||void 0,this.source=u.source||void 0,this.stack=o&&u.cause&&typeof u.cause.stack=="string"?u.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}fr.prototype.file="";fr.prototype.name="";fr.prototype.reason="";fr.prototype.message="";fr.prototype.stack="";fr.prototype.column=void 0;fr.prototype.line=void 0;fr.prototype.ancestors=void 0;fr.prototype.cause=void 0;fr.prototype.fatal=void 0;fr.prototype.place=void 0;fr.prototype.ruleId=void 0;fr.prototype.source=void 0;const t_={}.hasOwnProperty,B8=new Map,U8=/[A-Z]/g,F8=new Set(["table","tbody","thead","tfoot","tr"]),z8=new Set(["td","th"]),vR="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $8(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let i;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=X8(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=W8(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Tc:vm,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},u=TR(a,e,void 0);return u&&typeof u!="string"?u:a.create(e,a.Fragment,{children:u||void 0},void 0)}function TR(e,t,n){if(t.type==="element")return q8(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return G8(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Y8(e,t,n);if(t.type==="mdxjsEsm")return K8(e,t);if(t.type==="root")return V8(e,t,n);if(t.type==="text")return Z8(e,t)}function q8(e,t,n){const i=e.schema;let a=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(a=Tc,e.schema=a),e.ancestors.push(t);const u=OR(e,t.tagName,!1),o=Q8(e,t);let f=r_(e,t);return F8.has(t.tagName)&&(f=f.filter(function(d){return typeof d=="string"?!A8(d):!0})),AR(e,o,u,t),n_(o,f),e.ancestors.pop(),e.schema=i,e.create(t,u,o,n)}function G8(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}zd(e,t.position)}function K8(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);zd(e,t.position)}function Y8(e,t,n){const i=e.schema;let a=i;t.name==="svg"&&i.space==="html"&&(a=Tc,e.schema=a),e.ancestors.push(t);const u=t.name===null?e.Fragment:OR(e,t.name,!0),o=J8(e,t),f=r_(e,t);return AR(e,o,u,t),n_(o,f),e.ancestors.pop(),e.schema=i,e.create(t,u,o,n)}function V8(e,t,n){const i={};return n_(i,r_(e,t)),e.create(t,e.Fragment,i,n)}function Z8(e,t){return t.value}function AR(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function n_(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function W8(e,t,n){return i;function i(a,u,o,f){const l=Array.isArray(o.children)?n:t;return f?l(u,o,f):l(u,o)}}function X8(e,t){return n;function n(i,a,u,o){const f=Array.isArray(u.children),d=Vi(i);return t(a,u,o,f,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function Q8(e,t){const n={};let i,a;for(a in t.properties)if(a!=="children"&&t_.call(t.properties,a)){const u=eB(e,a,t.properties[a]);if(u){const[o,f]=u;e.tableCellAlignToStyle&&o==="align"&&typeof f=="string"&&z8.has(t.tagName)?i=f:n[o]=f}}if(i){const u=n.style||(n.style={});u[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function J8(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const u=i.data.estree.body[0];u.type;const o=u.expression;o.type;const f=o.properties[0];f.type,Object.assign(n,e.evaluater.evaluateExpression(f.argument))}else zd(e,t.position);else{const a=i.name;let u;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const f=i.value.data.estree.body[0];f.type,u=e.evaluater.evaluateExpression(f.expression)}else zd(e,t.position);else u=i.value===null?!0:i.value;n[a]=u}return n}function r_(e,t){const n=[];let i=-1;const a=e.passKeys?new Map:B8;for(;++i<t.children.length;){const u=t.children[i];let o;if(e.passKeys){const d=u.type==="element"?u.tagName:u.type==="mdxJsxFlowElement"||u.type==="mdxJsxTextElement"?u.name:void 0;if(d){const l=a.get(d)||0;o=d+"-"+l,a.set(d,l+1)}}const f=TR(e,u,o);f!==void 0&&n.push(f)}return n}function eB(e,t,n){const i=e_(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?dR(n):yR(n)),i.property==="style"){let a=typeof n=="object"?n:tB(e,String(n));return e.stylePropertyNameCase==="css"&&(a=nB(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&i.space?x8[i.property]||i.property:i.attribute,n]}}function tB(e,t){try{return L8(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const i=n,a=new fr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=vR+"#cannot-parse-style-attribute",a}}function OR(e,t,n){let i;if(!n)i={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let u=-1,o;for(;++u<a.length;){const f=DS(a[u])?{type:"Identifier",name:a[u]}:{type:"Literal",value:a[u]};o=o?{type:"MemberExpression",object:o,property:f,computed:!!(u&&f.type==="Literal"),optional:!1}:f}i=o}else i=DS(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const a=i.value;return t_.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(i);zd(e)}function zd(e,t){const n=new fr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=vR+"#cannot-handle-mdx-estrees-without-createevaluater",n}function nB(e){const t={};let n;for(n in e)t_.call(e,n)&&(t[rB(n)]=e[n]);return t}function rB(e){let t=e.replace(U8,iB);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function iB(e){return"-"+e.toLowerCase()}const h0={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"]},sB={};function i_(e,t){const n=sB,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return SR(e,i,a)}function SR(e,t,n){if(aB(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return KS(e.children,t,n)}return Array.isArray(e)?KS(e,t,n):""}function KS(e,t,n){const i=[];let a=-1;for(;++a<e.length;)i[a]=SR(e[a],t,n);return i.join("")}function aB(e){return!!(e&&typeof e=="object")}const YS=document.createElement("i");function s_(e){const t="&"+e+";";YS.innerHTML=t;const n=YS.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Jr(e,t,n,i){const a=e.length;let u=0,o;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,i.length<1e4)o=Array.from(i),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);u<i.length;)o=i.slice(u,u+1e4),o.unshift(t,0),e.splice(...o),u+=1e4,t+=1e4}function mi(e,t){return e.length>0?(Jr(e,e.length,0,t),e):t}const VS={}.hasOwnProperty;function CR(e){const t={};let n=-1;for(;++n<e.length;)oB(t,e[n]);return t}function oB(e,t){let n;for(n in t){const a=(VS.call(e,n)?e[n]:void 0)||(e[n]={}),u=t[n];let o;if(u)for(o in u){VS.call(a,o)||(a[o]=[]);const f=u[o];cB(a[o],Array.isArray(f)?f:f?[f]:[])}}}function cB(e,t){let n=-1;const i=[];for(;++n<t.length;)(t[n].add==="after"?e:i).push(t[n]);Jr(e,0,0,i)}function xR(e,t){const n=Number.parseInt(e,t);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 Di(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const vr=_a(/[A-Za-z]/),dr=_a(/[\dA-Za-z]/),lB=_a(/[#-'*+\--9=?A-Z^-~]/);function tm(e){return e!==null&&(e<32||e===127)}const nb=_a(/\d/),uB=_a(/[\dA-Fa-f]/),dB=_a(/[!-/:-@[-`{-~]/);function Je(e){return e!==null&&e<-2}function Jt(e){return e!==null&&(e<0||e===32)}function Ot(e){return e===-2||e===-1||e===32}const Am=_a(new RegExp("\\p{P}|\\p{S}","u")),io=_a(/\s/);function _a(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ac(e){const t=[];let n=-1,i=0,a=0;for(;++n<e.length;){const u=e.charCodeAt(n);let o="";if(u===37&&dr(e.charCodeAt(n+1))&&dr(e.charCodeAt(n+2)))a=2;else if(u<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(u))||(o=String.fromCharCode(u));else if(u>55295&&u<57344){const f=e.charCodeAt(n+1);u<56320&&f>56319&&f<57344?(o=String.fromCharCode(u,f),a=1):o="īŋŊ"}else o=String.fromCharCode(u);o&&(t.push(e.slice(i,n),encodeURIComponent(o)),i=n+a+1,o=""),a&&(n+=a,a=0)}return t.join("")+e.slice(i)}function kt(e,t,n,i){const a=i?i-1:Number.POSITIVE_INFINITY;let u=0;return o;function o(d){return Ot(d)?(e.enter(n),f(d)):t(d)}function f(d){return Ot(d)&&u++<a?(e.consume(d),f):(e.exit(n),t(d))}}const fB={tokenize:hB};function hB(e){const t=e.attempt(this.parser.constructs.contentInitial,i,a);let n;return t;function i(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),kt(e,t,"linePrefix")}function a(f){return e.enter("paragraph"),u(f)}function u(f){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,o(f)}function o(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Je(f)?(e.consume(f),e.exit("chunkText"),u):(e.consume(f),o)}}const mB={tokenize:pB},ZS={tokenize:gB};function pB(e){const t=this,n=[];let i=0,a,u,o;return f;function f(x){if(i<n.length){const I=n[i];return t.containerState=I[1],e.attempt(I[0].continuation,d,l)(x)}return l(x)}function d(x){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&C();const I=t.events.length;let j=I,R;for(;j--;)if(t.events[j][0]==="exit"&&t.events[j][1].type==="chunkFlow"){R=t.events[j][1].end;break}v(i);let k=I;for(;k<t.events.length;)t.events[k][1].end={...R},k++;return Jr(t.events,j+1,0,t.events.slice(I)),t.events.length=k,l(x)}return f(x)}function l(x){if(i===n.length){if(!a)return g(x);if(a.currentConstruct&&a.currentConstruct.concrete)return E(x);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(ZS,h,m)(x)}function h(x){return a&&C(),v(i),g(x)}function m(x){return t.parser.lazy[t.now().line]=i!==n.length,o=t.now().offset,E(x)}function g(x){return t.containerState={},e.attempt(ZS,b,E)(x)}function b(x){return i++,n.push([t.currentConstruct,t.containerState]),g(x)}function E(x){if(x===null){a&&C(),v(0),e.consume(x);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:u}),T(x)}function T(x){if(x===null){O(e.exit("chunkFlow"),!0),v(0),e.consume(x);return}return Je(x)?(e.consume(x),O(e.exit("chunkFlow")),i=0,t.interrupt=void 0,f):(e.consume(x),T)}function O(x,I){const j=t.sliceStream(x);if(I&&j.push(null),x.previous=u,u&&(u.next=x),u=x,a.defineSkip(x.start),a.write(j),t.parser.lazy[x.start.line]){let R=a.events.length;for(;R--;)if(a.events[R][1].start.offset<o&&(!a.events[R][1].end||a.events[R][1].end.offset>o))return;const k=t.events.length;let P=k,z,L;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(z){L=t.events[P][1].end;break}z=!0}for(v(i),R=k;R<t.events.length;)t.events[R][1].end={...L},R++;Jr(t.events,P+1,0,t.events.slice(k)),t.events.length=R}}function v(x){let I=n.length;for(;I-- >x;){const j=n[I];t.containerState=j[1],j[0].exit.call(t,e)}n.length=x}function C(){a.write([null]),u=void 0,a=void 0,t.containerState._closeFlow=void 0}}function gB(e,t,n){return kt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function mc(e){if(e===null||Jt(e)||io(e))return 1;if(Am(e))return 2}function Om(e,t,n){const i=[];let a=-1;for(;++a<e.length;){const u=e[a].resolveAll;u&&!i.includes(u)&&(t=u(t,n),i.push(u))}return t}const rb={name:"attention",resolveAll:bB,tokenize:_B};function bB(e,t){let n=-1,i,a,u,o,f,d,l,h;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(i=n;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[i][1].end},g={...e[n][1].start};WS(m,-d),WS(g,d),o={type:d>1?"strongSequence":"emphasisSequence",start:m,end:{...e[i][1].end}},f={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:g},u={type:d>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},a={type:d>1?"strong":"emphasis",start:{...o.start},end:{...f.end}},e[i][1].end={...o.start},e[n][1].start={...f.end},l=[],e[i][1].end.offset-e[i][1].start.offset&&(l=mi(l,[["enter",e[i][1],t],["exit",e[i][1],t]])),l=mi(l,[["enter",a,t],["enter",o,t],["exit",o,t],["enter",u,t]]),l=mi(l,Om(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),l=mi(l,[["exit",u,t],["enter",f,t],["exit",f,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,l=mi(l,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,Jr(e,i-1,n-i+3,l),n=i+l.length-h-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function _B(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,a=mc(i);let u;return o;function o(d){return u=d,e.enter("attentionSequence"),f(d)}function f(d){if(d===u)return e.consume(d),f;const l=e.exit("attentionSequence"),h=mc(d),m=!h||h===2&&a||n.includes(d),g=!a||a===2&&h||n.includes(i);return l._open=!!(u===42?m:m&&(a||!g)),l._close=!!(u===42?g:g&&(h||!m)),t(d)}}function WS(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const yB={name:"autolink",tokenize:EB};function EB(e,t,n){let i=0;return a;function a(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),u}function u(b){return vr(b)?(e.consume(b),o):b===64?n(b):l(b)}function o(b){return b===43||b===45||b===46||dr(b)?(i=1,f(b)):l(b)}function f(b){return b===58?(e.consume(b),i=0,d):(b===43||b===45||b===46||dr(b))&&i++<32?(e.consume(b),f):(i=0,l(b))}function d(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||tm(b)?n(b):(e.consume(b),d)}function l(b){return b===64?(e.consume(b),h):lB(b)?(e.consume(b),l):n(b)}function h(b){return dr(b)?m(b):n(b)}function m(b){return b===46?(e.consume(b),i=0,h):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):g(b)}function g(b){if((b===45||dr(b))&&i++<63){const E=b===45?g:m;return e.consume(b),E}return n(b)}}const nf={partial:!0,tokenize:vB};function vB(e,t,n){return i;function i(u){return Ot(u)?kt(e,a,"linePrefix")(u):a(u)}function a(u){return u===null||Je(u)?t(u):n(u)}}const wR={continuation:{tokenize:AB},exit:OB,name:"blockQuote",tokenize:TB};function TB(e,t,n){const i=this;return a;function a(o){if(o===62){const f=i.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),u}return n(o)}function u(o){return Ot(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function AB(e,t,n){const i=this;return a;function a(o){return Ot(o)?kt(e,u,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):u(o)}function u(o){return e.attempt(wR,t,n)(o)}}function OB(e){e.exit("blockQuote")}const RR={name:"characterEscape",tokenize:SB};function SB(e,t,n){return i;function i(u){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(u),e.exit("escapeMarker"),a}function a(u){return dB(u)?(e.enter("characterEscapeValue"),e.consume(u),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(u)}}const NR={name:"characterReference",tokenize:CB};function CB(e,t,n){const i=this;let a=0,u,o;return f;function f(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),d}function d(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),u=31,o=dr,h(m))}function l(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),u=6,o=uB,h):(e.enter("characterReferenceValue"),u=7,o=nb,h(m))}function h(m){if(m===59&&a){const g=e.exit("characterReferenceValue");return o===dr&&!s_(i.sliceSerialize(g))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(m)&&a++<u?(e.consume(m),h):n(m)}}const XS={partial:!0,tokenize:wB},QS={concrete:!0,name:"codeFenced",tokenize:xB};function xB(e,t,n){const i=this,a={partial:!0,tokenize:j};let u=0,o=0,f;return d;function d(R){return l(R)}function l(R){const k=i.events[i.events.length-1];return u=k&&k[1].type==="linePrefix"?k[2].sliceSerialize(k[1],!0).length:0,f=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),h(R)}function h(R){return R===f?(o++,e.consume(R),h):o<3?n(R):(e.exit("codeFencedFenceSequence"),Ot(R)?kt(e,m,"whitespace")(R):m(R))}function m(R){return R===null||Je(R)?(e.exit("codeFencedFence"),i.interrupt?t(R):e.check(XS,T,I)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(R))}function g(R){return R===null||Je(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(R)):Ot(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),kt(e,b,"whitespace")(R)):R===96&&R===f?n(R):(e.consume(R),g)}function b(R){return R===null||Je(R)?m(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),E(R))}function E(R){return R===null||Je(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(R)):R===96&&R===f?n(R):(e.consume(R),E)}function T(R){return e.attempt(a,I,O)(R)}function O(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),v}function v(R){return u>0&&Ot(R)?kt(e,C,"linePrefix",u+1)(R):C(R)}function C(R){return R===null||Je(R)?e.check(XS,T,I)(R):(e.enter("codeFlowValue"),x(R))}function x(R){return R===null||Je(R)?(e.exit("codeFlowValue"),C(R)):(e.consume(R),x)}function I(R){return e.exit("codeFenced"),t(R)}function j(R,k,P){let z=0;return L;function L(Z){return R.enter("lineEnding"),R.consume(Z),R.exit("lineEnding"),G}function G(Z){return R.enter("codeFencedFence"),Ot(Z)?kt(R,F,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):F(Z)}function F(Z){return Z===f?(R.enter("codeFencedFenceSequence"),K(Z)):P(Z)}function K(Z){return Z===f?(z++,R.consume(Z),K):z>=o?(R.exit("codeFencedFenceSequence"),Ot(Z)?kt(R,B,"whitespace")(Z):B(Z)):P(Z)}function B(Z){return Z===null||Je(Z)?(R.exit("codeFencedFence"),k(Z)):P(Z)}}}function wB(e,t,n){const i=this;return a;function a(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),u)}function u(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}const m0={name:"codeIndented",tokenize:NB},RB={partial:!0,tokenize:IB};function NB(e,t,n){const i=this;return a;function a(l){return e.enter("codeIndented"),kt(e,u,"linePrefix",5)(l)}function u(l){const h=i.events[i.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?o(l):n(l)}function o(l){return l===null?d(l):Je(l)?e.attempt(RB,o,d)(l):(e.enter("codeFlowValue"),f(l))}function f(l){return l===null||Je(l)?(e.exit("codeFlowValue"),o(l)):(e.consume(l),f)}function d(l){return e.exit("codeIndented"),t(l)}}function IB(e,t,n){const i=this;return a;function a(o){return i.parser.lazy[i.now().line]?n(o):Je(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):kt(e,u,"linePrefix",5)(o)}function u(o){const f=i.events[i.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(o):Je(o)?a(o):n(o)}}const kB={name:"codeText",previous:PB,resolve:MB,tokenize:DB};function MB(e){let t=e.length-4,n=3,i,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i<t;)if(e[i][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(i=n-1,t++;++i<=t;)a===void 0?i!==t&&e[i][1].type!=="lineEnding"&&(a=i):(i===t||e[i][1].type==="lineEnding")&&(e[a][1].type="codeTextData",i!==a+2&&(e[a][1].end=e[i-1][1].end,e.splice(a+2,i-a-2),t-=i-a-2,i=a+2),a=void 0);return e}function PB(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function DB(e,t,n){let i=0,a,u;return o;function o(m){return e.enter("codeText"),e.enter("codeTextSequence"),f(m)}function f(m){return m===96?(e.consume(m),i++,f):(e.exit("codeTextSequence"),d(m))}function d(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),d):m===96?(u=e.enter("codeTextSequence"),a=0,h(m)):Je(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("codeTextData"),l(m))}function l(m){return m===null||m===32||m===96||Je(m)?(e.exit("codeTextData"),d(m)):(e.consume(m),l)}function h(m){return m===96?(e.consume(m),a++,h):a===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(u.type="codeTextData",l(m))}}class jB{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const i=n??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(t,i):t>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const a=n||0;this.setCursor(Math.trunc(t));const u=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return i&&fd(this.left,i),u.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),fd(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),fd(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);fd(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);fd(this.left,n.reverse())}}}function fd(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function IR(e){const t={};let n=-1,i,a,u,o,f,d,l;const h=new jB(e);for(;++n<h.length;){for(;n in t;)n=t[n];if(i=h.get(n),n&&i[1].type==="chunkFlow"&&h.get(n-1)[1].type==="listItemPrefix"&&(d=i[1]._tokenizer.events,u=0,u<d.length&&d[u][1].type==="lineEndingBlank"&&(u+=2),u<d.length&&d[u][1].type==="content"))for(;++u<d.length&&d[u][1].type!=="content";)d[u][1].type==="chunkText"&&(d[u][1]._isInFirstContentOfListItem=!0,u++);if(i[0]==="enter")i[1].contentType&&(Object.assign(t,LB(h,n)),n=t[n],l=!0);else if(i[1]._container){for(u=n,a=void 0;u--;)if(o=h.get(u),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(a&&(h.get(a)[1].type="lineEndingBlank"),o[1].type="lineEnding",a=u);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;a&&(i[1].end={...h.get(a)[1].start},f=h.slice(a,n),f.unshift(i),h.splice(a,n-a+1,f))}}return Jr(e,0,Number.POSITIVE_INFINITY,h.slice(0)),!l}function LB(e,t){const n=e.get(t)[1],i=e.get(t)[2];let a=t-1;const u=[];let o=n._tokenizer;o||(o=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const f=o.events,d=[],l={};let h,m,g=-1,b=n,E=0,T=0;const O=[T];for(;b;){for(;e.get(++a)[1]!==b;);u.push(a),b._tokenizer||(h=i.sliceStream(b),b.next||h.push(null),m&&o.defineSkip(b.start),b._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(h),b._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),m=b,b=b.next}for(b=n;++g<f.length;)f[g][0]==="exit"&&f[g-1][0]==="enter"&&f[g][1].type===f[g-1][1].type&&f[g][1].start.line!==f[g][1].end.line&&(T=g+1,O.push(T),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(o.events=[],b?(b._tokenizer=void 0,b.previous=void 0):O.pop(),g=O.length;g--;){const v=f.slice(O[g],O[g+1]),C=u.pop();d.push([C,C+v.length-1]),e.splice(C,2,v)}for(d.reverse(),g=-1;++g<d.length;)l[E+d[g][0]]=E+d[g][1],E+=d[g][1]-d[g][0]-1;return l}const HB={resolve:UB,tokenize:FB},BB={partial:!0,tokenize:zB};function UB(e){return IR(e),e}function FB(e,t){let n;return i;function i(f){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(f)}function a(f){return f===null?u(f):Je(f)?e.check(BB,o,u)(f):(e.consume(f),a)}function u(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function o(f){return e.consume(f),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function zB(e,t,n){const i=this;return a;function a(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),kt(e,u,"linePrefix")}function u(o){if(o===null||Je(o))return n(o);const f=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(o):e.interrupt(i.parser.constructs.flow,n,t)(o)}}function kR(e,t,n,i,a,u,o,f,d){const l=d||Number.POSITIVE_INFINITY;let h=0;return m;function m(v){return v===60?(e.enter(i),e.enter(a),e.enter(u),e.consume(v),e.exit(u),g):v===null||v===32||v===41||tm(v)?n(v):(e.enter(i),e.enter(o),e.enter(f),e.enter("chunkString",{contentType:"string"}),T(v))}function g(v){return v===62?(e.enter(u),e.consume(v),e.exit(u),e.exit(a),e.exit(i),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),b(v))}function b(v){return v===62?(e.exit("chunkString"),e.exit(f),g(v)):v===null||v===60||Je(v)?n(v):(e.consume(v),v===92?E:b)}function E(v){return v===60||v===62||v===92?(e.consume(v),b):b(v)}function T(v){return!h&&(v===null||v===41||Jt(v))?(e.exit("chunkString"),e.exit(f),e.exit(o),e.exit(i),t(v)):h<l&&v===40?(e.consume(v),h++,T):v===41?(e.consume(v),h--,T):v===null||v===32||v===40||tm(v)?n(v):(e.consume(v),v===92?O:T)}function O(v){return v===40||v===41||v===92?(e.consume(v),T):T(v)}}function MR(e,t,n,i,a,u){const o=this;let f=0,d;return l;function l(b){return e.enter(i),e.enter(a),e.consume(b),e.exit(a),e.enter(u),h}function h(b){return f>999||b===null||b===91||b===93&&!d||b===94&&!f&&"_hiddenFootnoteSupport"in o.parser.constructs?n(b):b===93?(e.exit(u),e.enter(a),e.consume(b),e.exit(a),e.exit(i),t):Je(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===null||b===91||b===93||Je(b)||f++>999?(e.exit("chunkString"),h(b)):(e.consume(b),d||(d=!Ot(b)),b===92?g:m)}function g(b){return b===91||b===92||b===93?(e.consume(b),f++,m):m(b)}}function PR(e,t,n,i,a,u){let o;return f;function f(g){return g===34||g===39||g===40?(e.enter(i),e.enter(a),e.consume(g),e.exit(a),o=g===40?41:g,d):n(g)}function d(g){return g===o?(e.enter(a),e.consume(g),e.exit(a),e.exit(i),t):(e.enter(u),l(g))}function l(g){return g===o?(e.exit(u),d(o)):g===null?n(g):Je(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),kt(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===o||g===null||Je(g)?(e.exit("chunkString"),l(g)):(e.consume(g),g===92?m:h)}function m(g){return g===o||g===92?(e.consume(g),h):h(g)}}function xd(e,t){let n;return i;function i(a){return Je(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,i):Ot(a)?kt(e,i,n?"linePrefix":"lineSuffix")(a):t(a)}}const $B={name:"definition",tokenize:GB},qB={partial:!0,tokenize:KB};function GB(e,t,n){const i=this;let a;return u;function u(b){return e.enter("definition"),o(b)}function o(b){return MR.call(i,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function f(b){return a=Di(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),d):n(b)}function d(b){return Jt(b)?xd(e,l)(b):l(b)}function l(b){return kR(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function h(b){return e.attempt(qB,m,m)(b)}function m(b){return Ot(b)?kt(e,g,"whitespace")(b):g(b)}function g(b){return b===null||Je(b)?(e.exit("definition"),i.parser.defined.push(a),t(b)):n(b)}}function KB(e,t,n){return i;function i(f){return Jt(f)?xd(e,a)(f):n(f)}function a(f){return PR(e,u,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function u(f){return Ot(f)?kt(e,o,"whitespace")(f):o(f)}function o(f){return f===null||Je(f)?t(f):n(f)}}const YB={name:"hardBreakEscape",tokenize:VB};function VB(e,t,n){return i;function i(u){return e.enter("hardBreakEscape"),e.consume(u),a}function a(u){return Je(u)?(e.exit("hardBreakEscape"),t(u)):n(u)}}const ZB={name:"headingAtx",resolve:WB,tokenize:XB};function WB(e,t){let n=e.length-2,i=3,a,u;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(a={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},u={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},Jr(e,i,n-i+1,[["enter",a,t],["enter",u,t],["exit",u,t],["exit",a,t]])),e}function XB(e,t,n){let i=0;return a;function a(h){return e.enter("atxHeading"),u(h)}function u(h){return e.enter("atxHeadingSequence"),o(h)}function o(h){return h===35&&i++<6?(e.consume(h),o):h===null||Jt(h)?(e.exit("atxHeadingSequence"),f(h)):n(h)}function f(h){return h===35?(e.enter("atxHeadingSequence"),d(h)):h===null||Je(h)?(e.exit("atxHeading"),t(h)):Ot(h)?kt(e,f,"whitespace")(h):(e.enter("atxHeadingText"),l(h))}function d(h){return h===35?(e.consume(h),d):(e.exit("atxHeadingSequence"),f(h))}function l(h){return h===null||h===35||Jt(h)?(e.exit("atxHeadingText"),f(h)):(e.consume(h),l)}}const QB=["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"],JS=["pre","script","style","textarea"],JB={concrete:!0,name:"htmlFlow",resolveTo:n5,tokenize:r5},e5={partial:!0,tokenize:s5},t5={partial:!0,tokenize:i5};function n5(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function r5(e,t,n){const i=this;let a,u,o,f,d;return l;function l(D){return h(D)}function h(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),m}function m(D){return D===33?(e.consume(D),g):D===47?(e.consume(D),u=!0,T):D===63?(e.consume(D),a=3,i.interrupt?t:N):vr(D)?(e.consume(D),o=String.fromCharCode(D),O):n(D)}function g(D){return D===45?(e.consume(D),a=2,b):D===91?(e.consume(D),a=5,f=0,E):vr(D)?(e.consume(D),a=4,i.interrupt?t:N):n(D)}function b(D){return D===45?(e.consume(D),i.interrupt?t:N):n(D)}function E(D){const ie="CDATA[";return D===ie.charCodeAt(f++)?(e.consume(D),f===ie.length?i.interrupt?t:F:E):n(D)}function T(D){return vr(D)?(e.consume(D),o=String.fromCharCode(D),O):n(D)}function O(D){if(D===null||D===47||D===62||Jt(D)){const ie=D===47,ae=o.toLowerCase();return!ie&&!u&&JS.includes(ae)?(a=1,i.interrupt?t(D):F(D)):QB.includes(o.toLowerCase())?(a=6,ie?(e.consume(D),v):i.interrupt?t(D):F(D)):(a=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(D):u?C(D):x(D))}return D===45||dr(D)?(e.consume(D),o+=String.fromCharCode(D),O):n(D)}function v(D){return D===62?(e.consume(D),i.interrupt?t:F):n(D)}function C(D){return Ot(D)?(e.consume(D),C):L(D)}function x(D){return D===47?(e.consume(D),L):D===58||D===95||vr(D)?(e.consume(D),I):Ot(D)?(e.consume(D),x):L(D)}function I(D){return D===45||D===46||D===58||D===95||dr(D)?(e.consume(D),I):j(D)}function j(D){return D===61?(e.consume(D),R):Ot(D)?(e.consume(D),j):x(D)}function R(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),d=D,k):Ot(D)?(e.consume(D),R):P(D)}function k(D){return D===d?(e.consume(D),d=null,z):D===null||Je(D)?n(D):(e.consume(D),k)}function P(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||Jt(D)?j(D):(e.consume(D),P)}function z(D){return D===47||D===62||Ot(D)?x(D):n(D)}function L(D){return D===62?(e.consume(D),G):n(D)}function G(D){return D===null||Je(D)?F(D):Ot(D)?(e.consume(D),G):n(D)}function F(D){return D===45&&a===2?(e.consume(D),U):D===60&&a===1?(e.consume(D),Y):D===62&&a===4?(e.consume(D),M):D===63&&a===3?(e.consume(D),N):D===93&&a===5?(e.consume(D),pe):Je(D)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(e5,q,K)(D)):D===null||Je(D)?(e.exit("htmlFlowData"),K(D)):(e.consume(D),F)}function K(D){return e.check(t5,B,q)(D)}function B(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),Z}function Z(D){return D===null||Je(D)?K(D):(e.enter("htmlFlowData"),F(D))}function U(D){return D===45?(e.consume(D),N):F(D)}function Y(D){return D===47?(e.consume(D),o="",W):F(D)}function W(D){if(D===62){const ie=o.toLowerCase();return JS.includes(ie)?(e.consume(D),M):F(D)}return vr(D)&&o.length<8?(e.consume(D),o+=String.fromCharCode(D),W):F(D)}function pe(D){return D===93?(e.consume(D),N):F(D)}function N(D){return D===62?(e.consume(D),M):D===45&&a===2?(e.consume(D),N):F(D)}function M(D){return D===null||Je(D)?(e.exit("htmlFlowData"),q(D)):(e.consume(D),M)}function q(D){return e.exit("htmlFlow"),t(D)}}function i5(e,t,n){const i=this;return a;function a(o){return Je(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),u):n(o)}function u(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}function s5(e,t,n){return i;function i(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(nf,t,n)}}const a5={name:"htmlText",tokenize:o5};function o5(e,t,n){const i=this;let a,u,o;return f;function f(N){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(N),d}function d(N){return N===33?(e.consume(N),l):N===47?(e.consume(N),j):N===63?(e.consume(N),x):vr(N)?(e.consume(N),P):n(N)}function l(N){return N===45?(e.consume(N),h):N===91?(e.consume(N),u=0,E):vr(N)?(e.consume(N),C):n(N)}function h(N){return N===45?(e.consume(N),b):n(N)}function m(N){return N===null?n(N):N===45?(e.consume(N),g):Je(N)?(o=m,Y(N)):(e.consume(N),m)}function g(N){return N===45?(e.consume(N),b):m(N)}function b(N){return N===62?U(N):N===45?g(N):m(N)}function E(N){const M="CDATA[";return N===M.charCodeAt(u++)?(e.consume(N),u===M.length?T:E):n(N)}function T(N){return N===null?n(N):N===93?(e.consume(N),O):Je(N)?(o=T,Y(N)):(e.consume(N),T)}function O(N){return N===93?(e.consume(N),v):T(N)}function v(N){return N===62?U(N):N===93?(e.consume(N),v):T(N)}function C(N){return N===null||N===62?U(N):Je(N)?(o=C,Y(N)):(e.consume(N),C)}function x(N){return N===null?n(N):N===63?(e.consume(N),I):Je(N)?(o=x,Y(N)):(e.consume(N),x)}function I(N){return N===62?U(N):x(N)}function j(N){return vr(N)?(e.consume(N),R):n(N)}function R(N){return N===45||dr(N)?(e.consume(N),R):k(N)}function k(N){return Je(N)?(o=k,Y(N)):Ot(N)?(e.consume(N),k):U(N)}function P(N){return N===45||dr(N)?(e.consume(N),P):N===47||N===62||Jt(N)?z(N):n(N)}function z(N){return N===47?(e.consume(N),U):N===58||N===95||vr(N)?(e.consume(N),L):Je(N)?(o=z,Y(N)):Ot(N)?(e.consume(N),z):U(N)}function L(N){return N===45||N===46||N===58||N===95||dr(N)?(e.consume(N),L):G(N)}function G(N){return N===61?(e.consume(N),F):Je(N)?(o=G,Y(N)):Ot(N)?(e.consume(N),G):z(N)}function F(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),a=N,K):Je(N)?(o=F,Y(N)):Ot(N)?(e.consume(N),F):(e.consume(N),B)}function K(N){return N===a?(e.consume(N),a=void 0,Z):N===null?n(N):Je(N)?(o=K,Y(N)):(e.consume(N),K)}function B(N){return N===null||N===34||N===39||N===60||N===61||N===96?n(N):N===47||N===62||Jt(N)?z(N):(e.consume(N),B)}function Z(N){return N===47||N===62||Jt(N)?z(N):n(N)}function U(N){return N===62?(e.consume(N),e.exit("htmlTextData"),e.exit("htmlText"),t):n(N)}function Y(N){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),W}function W(N){return Ot(N)?kt(e,pe,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):pe(N)}function pe(N){return e.enter("htmlTextData"),o(N)}}const a_={name:"labelEnd",resolveAll:d5,resolveTo:f5,tokenize:h5},c5={tokenize:m5},l5={tokenize:p5},u5={tokenize:g5};function d5(e){let t=-1;const n=[];for(;++t<e.length;){const i=e[t][1];if(n.push(e[t]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const a=i.type==="labelImage"?4:2;i.type="data",t+=a}}return e.length!==n.length&&Jr(e,0,e.length,n),e}function f5(e,t){let n=e.length,i=0,a,u,o,f;for(;n--;)if(a=e[n][1],u){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(u=n,a.type!=="labelLink")){i=2;break}}else a.type==="labelEnd"&&(o=n);const d={type:e[u][1].type==="labelLink"?"link":"image",start:{...e[u][1].start},end:{...e[e.length-1][1].end}},l={type:"label",start:{...e[u][1].start},end:{...e[o][1].end}},h={type:"labelText",start:{...e[u+i+2][1].end},end:{...e[o-2][1].start}};return f=[["enter",d,t],["enter",l,t]],f=mi(f,e.slice(u+1,u+i+3)),f=mi(f,[["enter",h,t]]),f=mi(f,Om(t.parser.constructs.insideSpan.null,e.slice(u+i+4,o-3),t)),f=mi(f,[["exit",h,t],e[o-2],e[o-1],["exit",l,t]]),f=mi(f,e.slice(o+1)),f=mi(f,[["exit",d,t]]),Jr(e,u,e.length,f),e}function h5(e,t,n){const i=this;let a=i.events.length,u,o;for(;a--;)if((i.events[a][1].type==="labelImage"||i.events[a][1].type==="labelLink")&&!i.events[a][1]._balanced){u=i.events[a][1];break}return f;function f(g){return u?u._inactive?m(g):(o=i.parser.defined.includes(Di(i.sliceSerialize({start:u.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(g),e.exit("labelMarker"),e.exit("labelEnd"),d):n(g)}function d(g){return g===40?e.attempt(c5,h,o?h:m)(g):g===91?e.attempt(l5,h,o?l:m)(g):o?h(g):m(g)}function l(g){return e.attempt(u5,h,m)(g)}function h(g){return t(g)}function m(g){return u._balanced=!0,n(g)}}function m5(e,t,n){return i;function i(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),a}function a(m){return Jt(m)?xd(e,u)(m):u(m)}function u(m){return m===41?h(m):kR(e,o,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function o(m){return Jt(m)?xd(e,d)(m):h(m)}function f(m){return n(m)}function d(m){return m===34||m===39||m===40?PR(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):h(m)}function l(m){return Jt(m)?xd(e,h)(m):h(m)}function h(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):n(m)}}function p5(e,t,n){const i=this;return a;function a(f){return MR.call(i,e,u,o,"reference","referenceMarker","referenceString")(f)}function u(f){return i.parser.defined.includes(Di(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function o(f){return n(f)}}function g5(e,t,n){return i;function i(u){return e.enter("reference"),e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),a}function a(u){return u===93?(e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),e.exit("reference"),t):n(u)}}const b5={name:"labelStartImage",resolveAll:a_.resolveAll,tokenize:_5};function _5(e,t,n){const i=this;return a;function a(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),u}function u(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),o):n(f)}function o(f){return f===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(f):t(f)}}const y5={name:"labelStartLink",resolveAll:a_.resolveAll,tokenize:E5};function E5(e,t,n){const i=this;return a;function a(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),u}function u(o){return o===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(o):t(o)}}const p0={name:"lineEnding",tokenize:v5};function v5(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),kt(e,t,"linePrefix")}}const Gh={name:"thematicBreak",tokenize:T5};function T5(e,t,n){let i=0,a;return u;function u(l){return e.enter("thematicBreak"),o(l)}function o(l){return a=l,f(l)}function f(l){return l===a?(e.enter("thematicBreakSequence"),d(l)):i>=3&&(l===null||Je(l))?(e.exit("thematicBreak"),t(l)):n(l)}function d(l){return l===a?(e.consume(l),i++,d):(e.exit("thematicBreakSequence"),Ot(l)?kt(e,f,"whitespace")(l):f(l))}}const Pr={continuation:{tokenize:C5},exit:w5,name:"list",tokenize:S5},A5={partial:!0,tokenize:R5},O5={partial:!0,tokenize:x5};function S5(e,t,n){const i=this,a=i.events[i.events.length-1];let u=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,o=0;return f;function f(b){const E=i.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(E==="listUnordered"?!i.containerState.marker||b===i.containerState.marker:nb(b)){if(i.containerState.type||(i.containerState.type=E,e.enter(E,{_container:!0})),E==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(Gh,n,l)(b):l(b);if(!i.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(b)}return n(b)}function d(b){return nb(b)&&++o<10?(e.consume(b),d):(!i.interrupt||o<2)&&(i.containerState.marker?b===i.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),l(b)):n(b)}function l(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||b,e.check(nf,i.interrupt?n:h,e.attempt(A5,g,m))}function h(b){return i.containerState.initialBlankLine=!0,u++,g(b)}function m(b){return Ot(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),g):n(b)}function g(b){return i.containerState.size=u+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function C5(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(nf,a,u);function a(f){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,kt(e,t,"listItemIndent",i.containerState.size+1)(f)}function u(f){return i.containerState.furtherBlankLines||!Ot(f)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,o(f)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(O5,t,o)(f))}function o(f){return i.containerState._closeFlow=!0,i.interrupt=void 0,kt(e,e.attempt(Pr,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function x5(e,t,n){const i=this;return kt(e,a,"listItemIndent",i.containerState.size+1);function a(u){const o=i.events[i.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===i.containerState.size?t(u):n(u)}}function w5(e){e.exit(this.containerState.type)}function R5(e,t,n){const i=this;return kt(e,a,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(u){const o=i.events[i.events.length-1];return!Ot(u)&&o&&o[1].type==="listItemPrefixWhitespace"?t(u):n(u)}}const eC={name:"setextUnderline",resolveTo:N5,tokenize:I5};function N5(e,t){let n=e.length,i,a,u;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!u&&e[n][1].type==="definition"&&(u=n);const o={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",u?(e.splice(a,0,["enter",o,t]),e.splice(u+1,0,["exit",e[i][1],t]),e[i][1].end={...e[u][1].end}):e[i][1]=o,e.push(["exit",o,t]),e}function I5(e,t,n){const i=this;let a;return u;function u(l){let h=i.events.length,m;for(;h--;)if(i.events[h][1].type!=="lineEnding"&&i.events[h][1].type!=="linePrefix"&&i.events[h][1].type!=="content"){m=i.events[h][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||m)?(e.enter("setextHeadingLine"),a=l,o(l)):n(l)}function o(l){return e.enter("setextHeadingLineSequence"),f(l)}function f(l){return l===a?(e.consume(l),f):(e.exit("setextHeadingLineSequence"),Ot(l)?kt(e,d,"lineSuffix")(l):d(l))}function d(l){return l===null||Je(l)?(e.exit("setextHeadingLine"),t(l)):n(l)}}const k5={tokenize:M5};function M5(e){const t=this,n=e.attempt(nf,i,e.attempt(this.parser.constructs.flowInitial,a,kt(e,e.attempt(this.parser.constructs.flow,a,e.attempt(HB,a)),"linePrefix")));return n;function i(u){if(u===null){e.consume(u);return}return e.enter("lineEndingBlank"),e.consume(u),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const P5={resolveAll:jR()},D5=DR("string"),j5=DR("text");function DR(e){return{resolveAll:jR(e==="text"?L5:void 0),tokenize:t};function t(n){const i=this,a=this.parser.constructs[e],u=n.attempt(a,o,f);return o;function o(h){return l(h)?u(h):f(h)}function f(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),d}function d(h){return l(h)?(n.exit("data"),u(h)):(n.consume(h),d)}function l(h){if(h===null)return!0;const m=a[h];let g=-1;if(m)for(;++g<m.length;){const b=m[g];if(!b.previous||b.previous.call(i,i.previous))return!0}return!1}}}function jR(e){return t;function t(n,i){let a=-1,u;for(;++a<=n.length;)u===void 0?n[a]&&n[a][1].type==="data"&&(u=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==u+2&&(n[u][1].end=n[a-1][1].end,n.splice(u+2,a-u-2),a=u+2),u=void 0);return e?e(n,i):n}}function L5(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const i=e[n-1][1],a=t.sliceStream(i);let u=a.length,o=-1,f=0,d;for(;u--;){const l=a[u];if(typeof l=="string"){for(o=l.length;l.charCodeAt(o-1)===32;)f++,o--;if(o)break;o=-1}else if(l===-2)d=!0,f++;else if(l!==-1){u++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(f=0),f){const l={type:n===e.length||d||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:u?o:i.start._bufferIndex+o,_index:i.start._index+u,line:i.end.line,column:i.end.column-f,offset:i.end.offset-f},end:{...i.end}};i.end={...l.start},i.start.offset===i.end.offset?Object.assign(i,l):(e.splice(n,0,["enter",l,t],["exit",l,t]),n+=2)}n++}return e}const H5={42:Pr,43:Pr,45:Pr,48:Pr,49:Pr,50:Pr,51:Pr,52:Pr,53:Pr,54:Pr,55:Pr,56:Pr,57:Pr,62:wR},B5={91:$B},U5={[-2]:m0,[-1]:m0,32:m0},F5={35:ZB,42:Gh,45:[eC,Gh],60:JB,61:eC,95:Gh,96:QS,126:QS},z5={38:NR,92:RR},$5={[-5]:p0,[-4]:p0,[-3]:p0,33:b5,38:NR,42:rb,60:[yB,a5],91:y5,92:[YB,RR],93:a_,95:rb,96:kB},q5={null:[rb,P5]},G5={null:[42,95]},K5={null:[]},Y5=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:G5,contentInitial:B5,disable:K5,document:H5,flow:F5,flowInitial:U5,insideSpan:q5,string:z5,text:$5},Symbol.toStringTag,{value:"Module"}));function V5(e,t,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},u=[];let o=[],f=[];const d={attempt:k(j),check:k(R),consume:C,enter:x,exit:I,interrupt:k(R,{interrupt:!0})},l={code:null,containerState:{},defineSkip:T,events:[],now:E,parser:e,previous:null,sliceSerialize:g,sliceStream:b,write:m};let h=t.tokenize.call(l,d);return t.resolveAll&&u.push(t),l;function m(G){return o=mi(o,G),O(),o[o.length-1]!==null?[]:(P(t,0),l.events=Om(u,l.events,l),l.events)}function g(G,F){return W5(b(G),F)}function b(G){return Z5(o,G)}function E(){const{_bufferIndex:G,_index:F,line:K,column:B,offset:Z}=i;return{_bufferIndex:G,_index:F,line:K,column:B,offset:Z}}function T(G){a[G.line]=G.column,L()}function O(){let G;for(;i._index<o.length;){const F=o[i._index];if(typeof F=="string")for(G=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===G&&i._bufferIndex<F.length;)v(F.charCodeAt(i._bufferIndex));else v(F)}}function v(G){h=h(G)}function C(G){Je(G)?(i.line++,i.column=1,i.offset+=G===-3?2:1,L()):G!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===o[i._index].length&&(i._bufferIndex=-1,i._index++)),l.previous=G}function x(G,F){const K=F||{};return K.type=G,K.start=E(),l.events.push(["enter",K,l]),f.push(K),K}function I(G){const F=f.pop();return F.end=E(),l.events.push(["exit",F,l]),F}function j(G,F){P(G,F.from)}function R(G,F){F.restore()}function k(G,F){return K;function K(B,Z,U){let Y,W,pe,N;return Array.isArray(B)?q(B):"tokenize"in B?q([B]):M(B);function M(fe){return Ee;function Ee(de){const le=de!==null&&fe[de],Pe=de!==null&&fe.null,re=[...Array.isArray(le)?le:le?[le]:[],...Array.isArray(Pe)?Pe:Pe?[Pe]:[]];return q(re)(de)}}function q(fe){return Y=fe,W=0,fe.length===0?U:D(fe[W])}function D(fe){return Ee;function Ee(de){return N=z(),pe=fe,fe.partial||(l.currentConstruct=fe),fe.name&&l.parser.constructs.disable.null.includes(fe.name)?ae():fe.tokenize.call(F?Object.assign(Object.create(l),F):l,d,ie,ae)(de)}}function ie(fe){return G(pe,N),Z}function ae(fe){return N.restore(),++W<Y.length?D(Y[W]):U}}}function P(G,F){G.resolveAll&&!u.includes(G)&&u.push(G),G.resolve&&Jr(l.events,F,l.events.length-F,G.resolve(l.events.slice(F),l)),G.resolveTo&&(l.events=G.resolveTo(l.events,l))}function z(){const G=E(),F=l.previous,K=l.currentConstruct,B=l.events.length,Z=Array.from(f);return{from:B,restore:U};function U(){i=G,l.previous=F,l.currentConstruct=K,l.events.length=B,f=Z,L()}}function L(){i.line in a&&i.column<2&&(i.column=a[i.line],i.offset+=a[i.line]-1)}}function Z5(e,t){const n=t.start._index,i=t.start._bufferIndex,a=t.end._index,u=t.end._bufferIndex;let o;if(n===a)o=[e[n].slice(i,u)];else{if(o=e.slice(n,a),i>-1){const f=o[0];typeof f=="string"?o[0]=f.slice(i):o.shift()}u>0&&o.push(e[a].slice(0,u))}return o}function W5(e,t){let n=-1;const i=[];let a;for(;++n<e.length;){const u=e[n];let o;if(typeof u=="string")o=u;else switch(u){case-5:{o="\r";break}case-4:{o=`
351
+ `;break}case-3:{o=`\r
352
+ `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&a)continue;o=" ";break}default:o=String.fromCharCode(u)}a=u===-2,i.push(o)}return i.join("")}function X5(e){const i={constructs:CR([Y5,...(e||{}).extensions||[]]),content:a(fB),defined:[],document:a(mB),flow:a(k5),lazy:{},string:a(D5),text:a(j5)};return i;function a(u){return o;function o(f){return V5(i,u,f)}}}function Q5(e){for(;!IR(e););return e}const tC=/[\0\t\n\r]/g;function J5(){let e=1,t="",n=!0,i;return a;function a(u,o,f){const d=[];let l,h,m,g,b;for(u=t+(typeof u=="string"?u.toString():new TextDecoder(o||void 0).decode(u)),m=0,t="",n&&(u.charCodeAt(0)===65279&&m++,n=void 0);m<u.length;){if(tC.lastIndex=m,l=tC.exec(u),g=l&&l.index!==void 0?l.index:u.length,b=u.charCodeAt(g),!l){t=u.slice(m);break}if(b===10&&m===g&&i)d.push(-3),i=void 0;else switch(i&&(d.push(-5),i=void 0),m<g&&(d.push(u.slice(m,g)),e+=g-m),b){case 0:{d.push(65533),e++;break}case 9:{for(h=Math.ceil(e/4)*4,d.push(-2);e++<h;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:i=!0,e=1}m=g+1}return f&&(i&&d.push(-5),t&&d.push(t),d.push(null)),d}}const eU=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function tU(e){return e.replace(eU,nU)}function nU(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),u=a===120||a===88;return xR(n.slice(u?2:1),u?16:10)}return s_(n)||e}const LR={}.hasOwnProperty;function rU(e,t,n){return typeof t!="string"&&(n=t,t=void 0),iU(n)(Q5(X5(n).document().write(J5()(e,t,!0))))}function iU(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(it),autolinkProtocol:z,autolinkEmail:z,atxHeading:u(He),blockQuote:u(Pe),characterEscape:z,characterReference:z,codeFenced:u(re),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:u(re,o),codeText:u(Ae,o),codeTextData:z,data:z,codeFlowValue:z,definition:u(Ce),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:u(Me),hardBreakEscape:u(Ne),hardBreakTrailing:u(Ne),htmlFlow:u(Ge,o),htmlFlowData:z,htmlText:u(Ge,o),htmlTextData:z,image:u(pt),label:o,link:u(it),listItem:u(jt),listItemValue:g,listOrdered:u(bt,m),listUnordered:u(bt),paragraph:u(ar),reference:D,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:u(He),strong:u(vt),thematicBreak:u(ni)},exit:{atxHeading:d(),atxHeadingSequence:j,autolink:d(),autolinkEmail:le,autolinkProtocol:de,blockQuote:d(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:ae,characterReferenceMarkerNumeric:ae,characterReferenceValue:fe,characterReference:Ee,codeFenced:d(O),codeFencedFence:T,codeFencedFenceInfo:b,codeFencedFenceMeta:E,codeFlowValue:L,codeIndented:d(v),codeText:d(Z),codeTextData:L,data:L,definition:d(),definitionDestinationString:I,definitionLabelString:C,definitionTitleString:x,emphasis:d(),hardBreakEscape:d(F),hardBreakTrailing:d(F),htmlFlow:d(K),htmlFlowData:L,htmlText:d(B),htmlTextData:L,image:d(Y),label:pe,labelText:W,lineEnding:G,link:d(U),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:ie,resourceDestinationString:N,resourceTitleString:M,resource:q,setextHeading:d(P),setextHeadingLineSequence:k,setextHeadingText:R,strong:d(),thematicBreak:d()}};HR(t,(e||{}).mdastExtensions||[]);const n={};return i;function i(be){let xe={type:"root",children:[]};const $e={stack:[xe],tokenStack:[],config:t,enter:f,exit:l,buffer:o,resume:h,data:n},ct=[];let wt=-1;for(;++wt<be.length;)if(be[wt][1].type==="listOrdered"||be[wt][1].type==="listUnordered")if(be[wt][0]==="enter")ct.push(wt);else{const qn=ct.pop();wt=a(be,qn,wt)}for(wt=-1;++wt<be.length;){const qn=t[be[wt][0]];LR.call(qn,be[wt][1].type)&&qn[be[wt][1].type].call(Object.assign({sliceSerialize:be[wt][2].sliceSerialize},$e),be[wt][1])}if($e.tokenStack.length>0){const qn=$e.tokenStack[$e.tokenStack.length-1];(qn[1]||nC).call($e,void 0,qn[0])}for(xe.position={start:ca(be.length>0?be[0][1].start:{line:1,column:1,offset:0}),end:ca(be.length>0?be[be.length-2][1].end:{line:1,column:1,offset:0})},wt=-1;++wt<t.transforms.length;)xe=t.transforms[wt](xe)||xe;return xe}function a(be,xe,$e){let ct=xe-1,wt=-1,qn=!1,ri,Tn,An,or;for(;++ct<=$e;){const Ft=be[ct];switch(Ft[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ft[0]==="enter"?wt++:wt--,or=void 0;break}case"lineEndingBlank":{Ft[0]==="enter"&&(ri&&!or&&!wt&&!An&&(An=ct),or=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:or=void 0}if(!wt&&Ft[0]==="enter"&&Ft[1].type==="listItemPrefix"||wt===-1&&Ft[0]==="exit"&&(Ft[1].type==="listUnordered"||Ft[1].type==="listOrdered")){if(ri){let Li=ct;for(Tn=void 0;Li--;){const mr=be[Li];if(mr[1].type==="lineEnding"||mr[1].type==="lineEndingBlank"){if(mr[0]==="exit")continue;Tn&&(be[Tn][1].type="lineEndingBlank",qn=!0),mr[1].type="lineEnding",Tn=Li}else if(!(mr[1].type==="linePrefix"||mr[1].type==="blockQuotePrefix"||mr[1].type==="blockQuotePrefixWhitespace"||mr[1].type==="blockQuoteMarker"||mr[1].type==="listItemIndent"))break}An&&(!Tn||An<Tn)&&(ri._spread=!0),ri.end=Object.assign({},Tn?be[Tn][1].start:Ft[1].end),be.splice(Tn||ct,0,["exit",ri,Ft[2]]),ct++,$e++}if(Ft[1].type==="listItemPrefix"){const Li={type:"listItem",_spread:!1,start:Object.assign({},Ft[1].start),end:void 0};ri=Li,be.splice(ct,0,["enter",Li,Ft[2]]),ct++,$e++,An=void 0,or=!0}}}return be[xe][1]._spread=qn,$e}function u(be,xe){return $e;function $e(ct){f.call(this,be(ct),ct),xe&&xe.call(this,ct)}}function o(){this.stack.push({type:"fragment",children:[]})}function f(be,xe,$e){this.stack[this.stack.length-1].children.push(be),this.stack.push(be),this.tokenStack.push([xe,$e||void 0]),be.position={start:ca(xe.start),end:void 0}}function d(be){return xe;function xe($e){be&&be.call(this,$e),l.call(this,$e)}}function l(be,xe){const $e=this.stack.pop(),ct=this.tokenStack.pop();if(ct)ct[0].type!==be.type&&(xe?xe.call(this,be,ct[0]):(ct[1]||nC).call(this,be,ct[0]));else throw new Error("Cannot close `"+be.type+"` ("+Cd({start:be.start,end:be.end})+"): it’s not open");$e.position.end=ca(be.end)}function h(){return i_(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function g(be){if(this.data.expectingFirstListItemValue){const xe=this.stack[this.stack.length-2];xe.start=Number.parseInt(this.sliceSerialize(be),10),this.data.expectingFirstListItemValue=void 0}}function b(){const be=this.resume(),xe=this.stack[this.stack.length-1];xe.lang=be}function E(){const be=this.resume(),xe=this.stack[this.stack.length-1];xe.meta=be}function T(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function O(){const be=this.resume(),xe=this.stack[this.stack.length-1];xe.value=be.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const be=this.resume(),xe=this.stack[this.stack.length-1];xe.value=be.replace(/(\r?\n|\r)$/g,"")}function C(be){const xe=this.resume(),$e=this.stack[this.stack.length-1];$e.label=xe,$e.identifier=Di(this.sliceSerialize(be)).toLowerCase()}function x(){const be=this.resume(),xe=this.stack[this.stack.length-1];xe.title=be}function I(){const be=this.resume(),xe=this.stack[this.stack.length-1];xe.url=be}function j(be){const xe=this.stack[this.stack.length-1];if(!xe.depth){const $e=this.sliceSerialize(be).length;xe.depth=$e}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function k(be){const xe=this.stack[this.stack.length-1];xe.depth=this.sliceSerialize(be).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function z(be){const $e=this.stack[this.stack.length-1].children;let ct=$e[$e.length-1];(!ct||ct.type!=="text")&&(ct=Lt(),ct.position={start:ca(be.start),end:void 0},$e.push(ct)),this.stack.push(ct)}function L(be){const xe=this.stack.pop();xe.value+=this.sliceSerialize(be),xe.position.end=ca(be.end)}function G(be){const xe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const $e=xe.children[xe.children.length-1];$e.position.end=ca(be.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(xe.type)&&(z.call(this,be),L.call(this,be))}function F(){this.data.atHardBreak=!0}function K(){const be=this.resume(),xe=this.stack[this.stack.length-1];xe.value=be}function B(){const be=this.resume(),xe=this.stack[this.stack.length-1];xe.value=be}function Z(){const be=this.resume(),xe=this.stack[this.stack.length-1];xe.value=be}function U(){const be=this.stack[this.stack.length-1];if(this.data.inReference){const xe=this.data.referenceType||"shortcut";be.type+="Reference",be.referenceType=xe,delete be.url,delete be.title}else delete be.identifier,delete be.label;this.data.referenceType=void 0}function Y(){const be=this.stack[this.stack.length-1];if(this.data.inReference){const xe=this.data.referenceType||"shortcut";be.type+="Reference",be.referenceType=xe,delete be.url,delete be.title}else delete be.identifier,delete be.label;this.data.referenceType=void 0}function W(be){const xe=this.sliceSerialize(be),$e=this.stack[this.stack.length-2];$e.label=tU(xe),$e.identifier=Di(xe).toLowerCase()}function pe(){const be=this.stack[this.stack.length-1],xe=this.resume(),$e=this.stack[this.stack.length-1];if(this.data.inReference=!0,$e.type==="link"){const ct=be.children;$e.children=ct}else $e.alt=xe}function N(){const be=this.resume(),xe=this.stack[this.stack.length-1];xe.url=be}function M(){const be=this.resume(),xe=this.stack[this.stack.length-1];xe.title=be}function q(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function ie(be){const xe=this.resume(),$e=this.stack[this.stack.length-1];$e.label=xe,$e.identifier=Di(this.sliceSerialize(be)).toLowerCase(),this.data.referenceType="full"}function ae(be){this.data.characterReferenceType=be.type}function fe(be){const xe=this.sliceSerialize(be),$e=this.data.characterReferenceType;let ct;$e?(ct=xR(xe,$e==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ct=s_(xe);const wt=this.stack[this.stack.length-1];wt.value+=ct}function Ee(be){const xe=this.stack.pop();xe.position.end=ca(be.end)}function de(be){L.call(this,be);const xe=this.stack[this.stack.length-1];xe.url=this.sliceSerialize(be)}function le(be){L.call(this,be);const xe=this.stack[this.stack.length-1];xe.url="mailto:"+this.sliceSerialize(be)}function Pe(){return{type:"blockquote",children:[]}}function re(){return{type:"code",lang:null,meta:null,value:""}}function Ae(){return{type:"inlineCode",value:""}}function Ce(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Me(){return{type:"emphasis",children:[]}}function He(){return{type:"heading",depth:0,children:[]}}function Ne(){return{type:"break"}}function Ge(){return{type:"html",value:""}}function pt(){return{type:"image",title:null,url:"",alt:null}}function it(){return{type:"link",title:null,url:"",children:[]}}function bt(be){return{type:"list",ordered:be.type==="listOrdered",start:null,spread:be._spread,children:[]}}function jt(be){return{type:"listItem",spread:be._spread,checked:null,children:[]}}function ar(){return{type:"paragraph",children:[]}}function vt(){return{type:"strong",children:[]}}function Lt(){return{type:"text",value:""}}function ni(){return{type:"thematicBreak"}}}function ca(e){return{line:e.line,column:e.column,offset:e.offset}}function HR(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?HR(e,i):sU(e,i)}}function sU(e,t){let n;for(n in t)if(LR.call(t,n))switch(n){case"canContainEols":{const i=t[n];i&&e[n].push(...i);break}case"transforms":{const i=t[n];i&&e[n].push(...i);break}case"enter":case"exit":{const i=t[n];i&&Object.assign(e[n],i);break}}}function nC(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Cd({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Cd({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Cd({start:t.start,end:t.end})+") is still open")}function aU(e){const t=this;t.parser=n;function n(i){return rU(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function oU(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function cU(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
353
+ `}]}function lU(e,t){const n=t.value?t.value+`
354
+ `:"",i={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(i.className=["language-"+a[0]]);let u={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(u.data={meta:t.meta}),e.patch(t,u),u=e.applyData(t,u),u={type:"element",tagName:"pre",properties:{},children:[u]},e.patch(t,u),u}function uU(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dU(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fU(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),a=Ac(i.toLowerCase()),u=e.footnoteOrder.indexOf(i);let o,f=e.footnoteCounts.get(i);f===void 0?(f=0,e.footnoteOrder.push(i),o=e.footnoteOrder.length):o=u+1,f+=1,e.footnoteCounts.set(i,f);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,d);const l={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,l),e.applyData(t,l)}function hU(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mU(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function BR(e,t){const n=t.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];const a=e.all(t),u=a[0];u&&u.type==="text"?u.value="["+u.value:a.unshift({type:"text",value:"["});const o=a[a.length-1];return o&&o.type==="text"?o.value+=i:a.push({type:"text",value:i}),a}function pU(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return BR(e,t);const a={src:Ac(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(a.title=i.title);const u={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,u),e.applyData(t,u)}function gU(e,t){const n={src:Ac(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,i),e.applyData(t,i)}function bU(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,i),e.applyData(t,i)}function _U(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return BR(e,t);const a={href:Ac(i.url||"")};i.title!==null&&i.title!==void 0&&(a.title=i.title);const u={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,u),e.applyData(t,u)}function yU(e,t){const n={href:Ac(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function EU(e,t,n){const i=e.all(t),a=n?vU(n):UR(t),u={},o=[];if(typeof t.checked=="boolean"){const h=i[0];let m;h&&h.type==="element"&&h.tagName==="p"?m=h:(m={type:"element",tagName:"p",properties:{},children:[]},i.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),u.className=["task-list-item"]}let f=-1;for(;++f<i.length;){const h=i[f];(a||f!==0||h.type!=="element"||h.tagName!=="p")&&o.push({type:"text",value:`
355
+ `}),h.type==="element"&&h.tagName==="p"&&!a?o.push(...h.children):o.push(h)}const d=i[i.length-1];d&&(a||d.type!=="element"||d.tagName!=="p")&&o.push({type:"text",value:`
356
+ `});const l={type:"element",tagName:"li",properties:u,children:o};return e.patch(t,l),e.applyData(t,l)}function vU(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let i=-1;for(;!t&&++i<n.length;)t=UR(n[i])}return t}function UR(e){const t=e.spread;return t??e.children.length>1}function TU(e,t){const n={},i=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<i.length;){const o=i[a];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const u={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(i,!0)};return e.patch(t,u),e.applyData(t,u)}function AU(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function OU(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function SU(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function CU(e,t){const n=e.all(t),i=n.shift(),a=[];if(i){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!0)};e.patch(t.children[0],o),a.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},f=Vi(t.children[1]),d=Tm(t.children[t.children.length-1]);f&&d&&(o.position={start:f,end:d}),a.push(o)}const u={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,u),e.applyData(t,u)}function xU(e,t,n){const i=n?n.children:void 0,u=(i?i.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,f=o?o.length:t.children.length;let d=-1;const l=[];for(;++d<f;){const m=t.children[d],g={},b=o?o[d]:void 0;b&&(g.align=b);let E={type:"element",tagName:u,properties:g,children:[]};m&&(E.children=e.all(m),e.patch(m,E),E=e.applyData(m,E)),l.push(E)}const h={type:"element",tagName:"tr",properties:{},children:e.wrap(l,!0)};return e.patch(t,h),e.applyData(t,h)}function wU(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const rC=9,iC=32;function RU(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),a=0;const u=[];for(;i;)u.push(sC(t.slice(a,i.index),a>0,!0),i[0]),a=i.index+i[0].length,i=n.exec(t);return u.push(sC(t.slice(a),a>0,!1)),u.join("")}function sC(e,t,n){let i=0,a=e.length;if(t){let u=e.codePointAt(i);for(;u===rC||u===iC;)i++,u=e.codePointAt(i)}if(n){let u=e.codePointAt(a-1);for(;u===rC||u===iC;)a--,u=e.codePointAt(a-1)}return a>i?e.slice(i,a):""}function NU(e,t){const n={type:"text",value:RU(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function IU(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const kU={blockquote:oU,break:cU,code:lU,delete:uU,emphasis:dU,footnoteReference:fU,heading:hU,html:mU,imageReference:pU,image:gU,inlineCode:bU,linkReference:_U,link:yU,listItem:EU,list:TU,paragraph:AU,root:OU,strong:SU,table:CU,tableCell:wU,tableRow:xU,text:NU,thematicBreak:IU,toml:Ph,yaml:Ph,definition:Ph,footnoteDefinition:Ph};function Ph(){}const FR=-1,Sm=0,wd=1,nm=2,o_=3,c_=4,l_=5,u_=6,zR=7,$R=8,aC=typeof self=="object"?self:globalThis,MU=(e,t)=>{const n=(a,u)=>(e.set(u,a),a),i=a=>{if(e.has(a))return e.get(a);const[u,o]=t[a];switch(u){case Sm:case FR:return n(o,a);case wd:{const f=n([],a);for(const d of o)f.push(i(d));return f}case nm:{const f=n({},a);for(const[d,l]of o)f[i(d)]=i(l);return f}case o_:return n(new Date(o),a);case c_:{const{source:f,flags:d}=o;return n(new RegExp(f,d),a)}case l_:{const f=n(new Map,a);for(const[d,l]of o)f.set(i(d),i(l));return f}case u_:{const f=n(new Set,a);for(const d of o)f.add(i(d));return f}case zR:{const{name:f,message:d}=o;return n(new aC[f](d),a)}case $R:return n(BigInt(o),a);case"BigInt":return n(Object(BigInt(o)),a);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:f}=new Uint8Array(o);return n(new DataView(f),o)}}return n(new aC[u](o),a)};return i},oC=e=>MU(new Map,e)(0),rc="",{toString:PU}={},{keys:DU}=Object,hd=e=>{const t=typeof e;if(t!=="object"||!e)return[Sm,t];const n=PU.call(e).slice(8,-1);switch(n){case"Array":return[wd,rc];case"Object":return[nm,rc];case"Date":return[o_,rc];case"RegExp":return[c_,rc];case"Map":return[l_,rc];case"Set":return[u_,rc];case"DataView":return[wd,n]}return n.includes("Array")?[wd,n]:n.includes("Error")?[zR,n]:[nm,n]},Dh=([e,t])=>e===Sm&&(t==="function"||t==="symbol"),jU=(e,t,n,i)=>{const a=(o,f)=>{const d=i.push(o)-1;return n.set(f,d),d},u=o=>{if(n.has(o))return n.get(o);let[f,d]=hd(o);switch(f){case Sm:{let h=o;switch(d){case"bigint":f=$R,h=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);h=null;break;case"undefined":return a([FR],o)}return a([f,h],o)}case wd:{if(d){let g=o;return d==="DataView"?g=new Uint8Array(o.buffer):d==="ArrayBuffer"&&(g=new Uint8Array(o)),a([d,[...g]],o)}const h=[],m=a([f,h],o);for(const g of o)h.push(u(g));return m}case nm:{if(d)switch(d){case"BigInt":return a([d,o.toString()],o);case"Boolean":case"Number":case"String":return a([d,o.valueOf()],o)}if(t&&"toJSON"in o)return u(o.toJSON());const h=[],m=a([f,h],o);for(const g of DU(o))(e||!Dh(hd(o[g])))&&h.push([u(g),u(o[g])]);return m}case o_:return a([f,o.toISOString()],o);case c_:{const{source:h,flags:m}=o;return a([f,{source:h,flags:m}],o)}case l_:{const h=[],m=a([f,h],o);for(const[g,b]of o)(e||!(Dh(hd(g))||Dh(hd(b))))&&h.push([u(g),u(b)]);return m}case u_:{const h=[],m=a([f,h],o);for(const g of o)(e||!Dh(hd(g)))&&h.push(u(g));return m}}const{message:l}=o;return a([f,{name:d,message:l}],o)};return u},cC=(e,{json:t,lossy:n}={})=>{const i=[];return jU(!(t||n),!!t,new Map,i)(e),i},pc=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?oC(cC(e,t)):structuredClone(e):(e,t)=>oC(cC(e,t));function LU(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function HU(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function BU(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||LU,i=e.options.footnoteBackLabel||HU,a=e.options.footnoteLabel||"Footnotes",u=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let d=-1;for(;++d<e.footnoteOrder.length;){const l=e.footnoteById.get(e.footnoteOrder[d]);if(!l)continue;const h=e.all(l),m=String(l.identifier).toUpperCase(),g=Ac(m.toLowerCase());let b=0;const E=[],T=e.footnoteCounts.get(m);for(;T!==void 0&&++b<=T;){E.length>0&&E.push({type:"text",value:" "});let C=typeof n=="string"?n:n(d,b);typeof C=="string"&&(C={type:"text",value:C}),E.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+g+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(d,b),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const O=h[h.length-1];if(O&&O.type==="element"&&O.tagName==="p"){const C=O.children[O.children.length-1];C&&C.type==="text"?C.value+=" ":O.children.push({type:"text",value:" "}),O.children.push(...E)}else h.push(...E);const v={type:"element",tagName:"li",properties:{id:t+"fn-"+g},children:e.wrap(h,!0)};e.patch(l,v),f.push(v)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...pc(o),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
357
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
358
+ `}]}}const rf=(function(e){if(e==null)return $U;if(typeof e=="function")return Cm(e);if(typeof e=="object")return Array.isArray(e)?UU(e):FU(e);if(typeof e=="string")return zU(e);throw new Error("Expected function, string, or object as test")});function UU(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=rf(e[n]);return Cm(i);function i(...a){let u=-1;for(;++u<t.length;)if(t[u].apply(this,a))return!0;return!1}}function FU(e){const t=e;return Cm(n);function n(i){const a=i;let u;for(u in e)if(a[u]!==t[u])return!1;return!0}}function zU(e){return Cm(t);function t(n){return n&&n.type===e}}function Cm(e){return t;function t(n,i,a){return!!(qU(n)&&e.call(this,n,typeof i=="number"?i:void 0,a||void 0))}}function $U(){return!0}function qU(e){return e!==null&&typeof e=="object"&&"type"in e}const qR=[],GU=!0,ib=!1,KU="skip";function GR(e,t,n,i){let a;typeof t=="function"&&typeof n!="function"?(i=n,n=t):a=t;const u=rf(a),o=i?-1:1;f(e,void 0,[])();function f(d,l,h){const m=d&&typeof d=="object"?d:{};if(typeof m.type=="string"){const b=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(d.type+(b?"<"+b+">":""))+")"})}return g;function g(){let b=qR,E,T,O;if((!t||u(d,l,h[h.length-1]||void 0))&&(b=YU(n(d,h)),b[0]===ib))return b;if("children"in d&&d.children){const v=d;if(v.children&&b[0]!==KU)for(T=(i?v.children.length:-1)+o,O=h.concat(v);T>-1&&T<v.children.length;){const C=v.children[T];if(E=f(C,T,O)(),E[0]===ib)return E;T=typeof E[1]=="number"?E[1]:T+o}}return b}}}function YU(e){return Array.isArray(e)?e:typeof e=="number"?[GU,e]:e==null?qR:[e]}function sf(e,t,n,i){let a,u,o;typeof t=="function"&&typeof n!="function"?(u=void 0,o=t,a=n):(u=t,o=n,a=i),GR(e,u,f,a);function f(d,l){const h=l[l.length-1],m=h?h.children.indexOf(d):void 0;return o(d,m,h)}}const sb={}.hasOwnProperty,VU={};function ZU(e,t){const n=t||VU,i=new Map,a=new Map,u=new Map,o={...kU,...n.handlers},f={all:l,applyData:XU,definitionById:i,footnoteById:a,footnoteCounts:u,footnoteOrder:[],handlers:o,one:d,options:n,patch:WU,wrap:JU};return sf(e,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const m=h.type==="definition"?i:a,g=String(h.identifier).toUpperCase();m.has(g)||m.set(g,h)}}),f;function d(h,m){const g=h.type,b=f.handlers[g];if(sb.call(f.handlers,g)&&b)return b(f,h,m);if(f.options.passThrough&&f.options.passThrough.includes(g)){if("children"in h){const{children:T,...O}=h,v=pc(O);return v.children=f.all(h),v}return pc(h)}return(f.options.unknownHandler||QU)(f,h,m)}function l(h){const m=[];if("children"in h){const g=h.children;let b=-1;for(;++b<g.length;){const E=f.one(g[b],h);if(E){if(b&&g[b-1].type==="break"&&(!Array.isArray(E)&&E.type==="text"&&(E.value=lC(E.value)),!Array.isArray(E)&&E.type==="element")){const T=E.children[0];T&&T.type==="text"&&(T.value=lC(T.value))}Array.isArray(E)?m.push(...E):m.push(E)}}}return m}}function WU(e,t){e.position&&(t.position=H8(e))}function XU(e,t){let n=t;if(e&&e.data){const i=e.data.hName,a=e.data.hChildren,u=e.data.hProperties;if(typeof i=="string")if(n.type==="element")n.tagName=i;else{const o="children"in n?n.children:[n];n={type:"element",tagName:i,properties:{},children:o}}n.type==="element"&&u&&Object.assign(n.properties,pc(u)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function QU(e,t){const n=t.data||{},i="value"in t&&!(sb.call(n,"hProperties")||sb.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function JU(e,t){const n=[];let i=-1;for(t&&n.push({type:"text",value:`
359
+ `});++i<e.length;)i&&n.push({type:"text",value:`
360
+ `}),n.push(e[i]);return t&&e.length>0&&n.push({type:"text",value:`
361
+ `}),n}function lC(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function uC(e,t){const n=ZU(e,t),i=n.one(e,void 0),a=BU(n),u=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return a&&u.children.push({type:"text",value:`
362
+ `},a),u}function e9(e,t){return e&&"run"in e?async function(n,i){const a=uC(n,{file:i,...t});await e.run(a,i)}:function(n,i){return uC(n,{file:i,...e||t})}}function dC(e){if(e)throw e}var g0,fC;function t9(){if(fC)return g0;fC=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=function(l){return typeof Array.isArray=="function"?Array.isArray(l):t.call(l)==="[object Array]"},u=function(l){if(!l||t.call(l)!=="[object Object]")return!1;var h=e.call(l,"constructor"),m=l.constructor&&l.constructor.prototype&&e.call(l.constructor.prototype,"isPrototypeOf");if(l.constructor&&!h&&!m)return!1;var g;for(g in l);return typeof g>"u"||e.call(l,g)},o=function(l,h){n&&h.name==="__proto__"?n(l,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):l[h.name]=h.newValue},f=function(l,h){if(h==="__proto__")if(e.call(l,h)){if(i)return i(l,h).value}else return;return l[h]};return g0=function d(){var l,h,m,g,b,E,T=arguments[0],O=1,v=arguments.length,C=!1;for(typeof T=="boolean"&&(C=T,T=arguments[1]||{},O=2),(T==null||typeof T!="object"&&typeof T!="function")&&(T={});O<v;++O)if(l=arguments[O],l!=null)for(h in l)m=f(T,h),g=f(l,h),T!==g&&(C&&g&&(u(g)||(b=a(g)))?(b?(b=!1,E=m&&a(m)?m:[]):E=m&&u(m)?m:{},o(T,{name:h,newValue:d(C,E,g)})):typeof g<"u"&&o(T,{name:h,newValue:g}));return T},g0}var n9=t9();const b0=bc(n9);function ab(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function r9(){const e=[],t={run:n,use:i};return t;function n(...a){let u=-1;const o=a.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);f(null,...a);function f(d,...l){const h=e[++u];let m=-1;if(d){o(d);return}for(;++m<a.length;)(l[m]===null||l[m]===void 0)&&(l[m]=a[m]);a=l,h?i9(h,f)(...l):o(null,...l)}}function i(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function i9(e,t){let n;return i;function i(...o){const f=e.length>o.length;let d;f&&o.push(a);try{d=e.apply(this,o)}catch(l){const h=l;if(f&&n)throw h;return a(h)}f||(d&&d.then&&typeof d.then=="function"?d.then(u,a):d instanceof Error?a(d):u(d))}function a(o,...f){n||(n=!0,t(o,...f))}function u(o){a(null,o)}}const qi={basename:s9,dirname:a9,extname:o9,join:c9,sep:"/"};function s9(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');af(e);let n=0,i=-1,a=e.length,u;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(u){n=a+1;break}}else i<0&&(u=!0,i=a+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let o=-1,f=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(u){n=a+1;break}}else o<0&&(u=!0,o=a+1),f>-1&&(e.codePointAt(a)===t.codePointAt(f--)?f<0&&(i=a):(f=-1,i=o));return n===i?i=o:i<0&&(i=e.length),e.slice(n,i)}function a9(e){if(af(e),e.length===0)return".";let t=-1,n=e.length,i;for(;--n;)if(e.codePointAt(n)===47){if(i){t=n;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function o9(e){af(e);let t=e.length,n=-1,i=0,a=-1,u=0,o;for(;t--;){const f=e.codePointAt(t);if(f===47){if(o){i=t+1;break}continue}n<0&&(o=!0,n=t+1),f===46?a<0?a=t:u!==1&&(u=1):a>-1&&(u=-1)}return a<0||n<0||u===0||u===1&&a===n-1&&a===i+1?"":e.slice(a,n)}function c9(...e){let t=-1,n;for(;++t<e.length;)af(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":l9(n)}function l9(e){af(e);const t=e.codePointAt(0)===47;let n=u9(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function u9(e,t){let n="",i=0,a=-1,u=0,o=-1,f,d;for(;++o<=e.length;){if(o<e.length)f=e.codePointAt(o);else{if(f===47)break;f=47}if(f===47){if(!(a===o-1||u===1))if(a!==o-1&&u===2){if(n.length<2||i!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",i=0):(n=n.slice(0,d),i=n.length-1-n.lastIndexOf("/")),a=o,u=0;continue}}else if(n.length>0){n="",i=0,a=o,u=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(a+1,o):n=e.slice(a+1,o),i=o-a-1;a=o,u=0}else f===46&&u>-1?u++:u=-1}return n}function af(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const d9={cwd:f9};function f9(){return"/"}function ob(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function h9(e){if(typeof e=="string")e=new URL(e);else if(!ob(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return m9(e)}function m9(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const i=t.codePointAt(n+2);if(i===70||i===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const _0=["history","path","basename","stem","extname","dirname"];class KR{constructor(t){let n;t?ob(t)?n={path:t}:typeof t=="string"||p9(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":d9.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<_0.length;){const u=_0[i];u in n&&n[u]!==void 0&&n[u]!==null&&(this[u]=u==="history"?[...n[u]]:n[u])}let a;for(a in n)_0.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?qi.basename(this.path):void 0}set basename(t){E0(t,"basename"),y0(t,"basename"),this.path=qi.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?qi.dirname(this.path):void 0}set dirname(t){hC(this.basename,"dirname"),this.path=qi.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?qi.extname(this.path):void 0}set extname(t){if(y0(t,"extname"),hC(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=qi.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ob(t)&&(t=h9(t)),E0(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?qi.basename(this.path,this.extname):void 0}set stem(t){E0(t,"stem"),y0(t,"stem"),this.path=qi.join(this.dirname||"",t+(this.extname||""))}fail(t,n,i){const a=this.message(t,n,i);throw a.fatal=!0,a}info(t,n,i){const a=this.message(t,n,i);return a.fatal=void 0,a}message(t,n,i){const a=new fr(t,n,i);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function y0(e,t){if(e&&e.includes(qi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+qi.sep+"`")}function E0(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function hC(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function p9(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const g9=(function(e){const i=this.constructor.prototype,a=i[e],u=function(){return a.apply(u,arguments)};return Object.setPrototypeOf(u,i),u}),b9={}.hasOwnProperty;class d_ extends g9{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=r9()}copy(){const t=new d_;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(b0(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(A0("data",this.frozen),this.namespace[t]=n,this):b9.call(this.namespace,t)&&this.namespace[t]||void 0:t?(A0("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const a=n.call(t,...i);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=jh(t),i=this.parser||this.Parser;return v0("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),v0("process",this.parser||this.Parser),T0("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(u,o){const f=jh(t),d=i.parse(f);i.run(d,f,function(h,m,g){if(h||!m||!g)return l(h);const b=m,E=i.stringify(b,g);E9(E)?g.value=E:g.result=E,l(h,g)});function l(h,m){h||!m?o(h):u?u(m):n(void 0,m)}}}processSync(t){let n=!1,i;return this.freeze(),v0("processSync",this.parser||this.Parser),T0("processSync",this.compiler||this.Compiler),this.process(t,a),pC("processSync","process",n),i;function a(u,o){n=!0,dC(u),i=o}}run(t,n,i){mC(t),this.freeze();const a=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?u(void 0,i):new Promise(u);function u(o,f){const d=jh(n);a.run(t,d,l);function l(h,m,g){const b=m||t;h?f(h):o?o(b):i(void 0,b,g)}}}runSync(t,n){let i=!1,a;return this.run(t,n,u),pC("runSync","run",i),a;function u(o,f){dC(o),a=f,i=!0}}stringify(t,n){this.freeze();const i=jh(n),a=this.compiler||this.Compiler;return T0("stringify",a),mC(t),a(t,i)}use(t,...n){const i=this.attachers,a=this.namespace;if(A0("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?f(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function u(l){if(typeof l=="function")d(l,[]);else if(typeof l=="object")if(Array.isArray(l)){const[h,...m]=l;d(h,m)}else o(l);else throw new TypeError("Expected usable value, not `"+l+"`")}function o(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");f(l.plugins),l.settings&&(a.settings=b0(!0,a.settings,l.settings))}function f(l){let h=-1;if(l!=null)if(Array.isArray(l))for(;++h<l.length;){const m=l[h];u(m)}else throw new TypeError("Expected a list of plugins, not `"+l+"`")}function d(l,h){let m=-1,g=-1;for(;++m<i.length;)if(i[m][0]===l){g=m;break}if(g===-1)i.push([l,...h]);else if(h.length>0){let[b,...E]=h;const T=i[g][1];ab(T)&&ab(b)&&(b=b0(!0,T,b)),i[g]=[l,b,...E]}}}}const _9=new d_().freeze();function v0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function T0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function A0(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function mC(e){if(!ab(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function pC(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function jh(e){return y9(e)?e:new KR(e)}function y9(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function E9(e){return typeof e=="string"||v9(e)}function v9(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const T9="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",gC=[],bC={allowDangerousHtml:!0},A9=/^(https?|ircs?|mailto|xmpp)$/i,O9=[{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:"className",id:"remove-classname"},{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 S9(e){const t=C9(e),n=x9(e);return w9(t.runSync(t.parse(n),n),e)}function C9(e){const t=e.rehypePlugins||gC,n=e.remarkPlugins||gC,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...bC}:bC;return _9().use(aU).use(n).use(e9,i).use(t)}function x9(e){const t=e.children||"",n=new KR;return typeof t=="string"&&(n.value=t),n}function w9(e,t){const n=t.allowedElements,i=t.allowElement,a=t.components,u=t.disallowedElements,o=t.skipHtml,f=t.unwrapDisallowed,d=t.urlTransform||R9;for(const h of O9)Object.hasOwn(t,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+T9+h.id,void 0);return sf(e,l),$8(e,{Fragment:_.Fragment,components:a,ignoreInvalidStyle:!0,jsx:_.jsx,jsxs:_.jsxs,passKeys:!0,passNode:!0});function l(h,m,g){if(h.type==="raw"&&g&&typeof m=="number")return o?g.children.splice(m,1):g.children[m]={type:"text",value:h.value},m;if(h.type==="element"){let b;for(b in h0)if(Object.hasOwn(h0,b)&&Object.hasOwn(h.properties,b)){const E=h.properties[b],T=h0[b];(T===null||T.includes(h.tagName))&&(h.properties[b]=d(String(E||""),b,h))}}if(h.type==="element"){let b=n?!n.includes(h.tagName):u?u.includes(h.tagName):!1;if(!b&&i&&typeof m=="number"&&(b=!i(h,m,g)),b&&g&&typeof m=="number")return f&&h.children?g.children.splice(m,1,...h.children):g.children.splice(m,1),m}}}function R9(e){const t=e.indexOf(":"),n=e.indexOf("?"),i=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||i!==-1&&t>i||A9.test(e.slice(0,t))?e:""}function _C(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,a=n.indexOf(t);for(;a!==-1;)i++,a=n.indexOf(t,a+t.length);return i}function N9(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function I9(e,t,n){const a=rf((n||{}).ignore||[]),u=k9(t);let o=-1;for(;++o<u.length;)GR(e,"text",f);function f(l,h){let m=-1,g;for(;++m<h.length;){const b=h[m],E=g?g.children:void 0;if(a(b,E?E.indexOf(b):void 0,g))return;g=b}if(g)return d(l,h)}function d(l,h){const m=h[h.length-1],g=u[o][0],b=u[o][1];let E=0;const O=m.children.indexOf(l);let v=!1,C=[];g.lastIndex=0;let x=g.exec(l.value);for(;x;){const I=x.index,j={index:x.index,input:x.input,stack:[...h,l]};let R=b(...x,j);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1?g.lastIndex=I+1:(E!==I&&C.push({type:"text",value:l.value.slice(E,I)}),Array.isArray(R)?C.push(...R):R&&C.push(R),E=I+x[0].length,v=!0),!g.global)break;x=g.exec(l.value)}return v?(E<l.value.length&&C.push({type:"text",value:l.value.slice(E)}),m.children.splice(O,1,...C)):C=[l],O+C.length}}function k9(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let i=-1;for(;++i<n.length;){const a=n[i];t.push([M9(a[0]),P9(a[1])])}return t}function M9(e){return typeof e=="string"?new RegExp(N9(e),"g"):e}function P9(e){return typeof e=="function"?e:function(){return e}}const O0="phrasing",S0=["autolink","link","image","label"];function D9(){return{transforms:[z9],enter:{literalAutolink:L9,literalAutolinkEmail:C0,literalAutolinkHttp:C0,literalAutolinkWww:C0},exit:{literalAutolink:F9,literalAutolinkEmail:U9,literalAutolinkHttp:H9,literalAutolinkWww:B9}}}function j9(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:O0,notInConstruct:S0},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:O0,notInConstruct:S0},{character:":",before:"[ps]",after:"\\/",inConstruct:O0,notInConstruct:S0}]}}function L9(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function C0(e){this.config.enter.autolinkProtocol.call(this,e)}function H9(e){this.config.exit.autolinkProtocol.call(this,e)}function B9(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function U9(e){this.config.exit.autolinkEmail.call(this,e)}function F9(e){this.exit(e)}function z9(e){I9(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,$9],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),q9]],{ignore:["link","linkReference"]})}function $9(e,t,n,i,a){let u="";if(!YR(a)||(/^w/i.test(t)&&(n=t+n,t="",u="http://"),!G9(n)))return!1;const o=K9(n+i);if(!o[0])return!1;const f={type:"link",title:null,url:u+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[f,{type:"text",value:o[1]}]:f}function q9(e,t,n,i){return!YR(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function G9(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function K9(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")");const a=_C(e,"(");let u=_C(e,")");for(;i!==-1&&a>u;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),u++;return[e,n]}function YR(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||io(n)||Am(n))&&(!t||n!==47)}VR.peek=tF;function Y9(){this.buffer()}function V9(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Z9(){this.buffer()}function W9(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function X9(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Di(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Q9(e){this.exit(e)}function J9(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Di(this.sliceSerialize(e)).toLowerCase(),n.label=t}function eF(e){this.exit(e)}function tF(){return"["}function VR(e,t,n,i){const a=n.createTracker(i);let u=a.move("[^");const o=n.enter("footnoteReference"),f=n.enter("reference");return u+=a.move(n.safe(n.associationId(e),{after:"]",before:u})),f(),o(),u+=a.move("]"),u}function nF(){return{enter:{gfmFootnoteCallString:Y9,gfmFootnoteCall:V9,gfmFootnoteDefinitionLabelString:Z9,gfmFootnoteDefinition:W9},exit:{gfmFootnoteCallString:X9,gfmFootnoteCall:Q9,gfmFootnoteDefinitionLabelString:J9,gfmFootnoteDefinition:eF}}}function rF(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:VR},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,a,u,o){const f=u.createTracker(o);let d=f.move("[^");const l=u.enter("footnoteDefinition"),h=u.enter("label");return d+=f.move(u.safe(u.associationId(i),{before:d,after:"]"})),h(),d+=f.move("]:"),i.children&&i.children.length>0&&(f.shift(4),d+=f.move((t?`
363
+ `:" ")+u.indentLines(u.containerFlow(i,f.current()),t?ZR:iF))),l(),d}}function iF(e,t,n){return t===0?e:ZR(e,t,n)}function ZR(e,t,n){return(n?"":" ")+e}const sF=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];WR.peek=uF;function aF(){return{canContainEols:["delete"],enter:{strikethrough:cF},exit:{strikethrough:lF}}}function oF(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:sF}],handlers:{delete:WR}}}function cF(e){this.enter({type:"delete",children:[]},e)}function lF(e){this.exit(e)}function WR(e,t,n,i){const a=n.createTracker(i),u=n.enter("strikethrough");let o=a.move("~~");return o+=n.containerPhrasing(e,{...a.current(),before:o,after:"~"}),o+=a.move("~~"),u(),o}function uF(){return"~"}function dF(e){return e.length}function fF(e,t){const n=t||{},i=(n.align||[]).concat(),a=n.stringLength||dF,u=[],o=[],f=[],d=[];let l=0,h=-1;for(;++h<e.length;){const T=[],O=[];let v=-1;for(e[h].length>l&&(l=e[h].length);++v<e[h].length;){const C=hF(e[h][v]);if(n.alignDelimiters!==!1){const x=a(C);O[v]=x,(d[v]===void 0||x>d[v])&&(d[v]=x)}T.push(C)}o[h]=T,f[h]=O}let m=-1;if(typeof i=="object"&&"length"in i)for(;++m<l;)u[m]=yC(i[m]);else{const T=yC(i);for(;++m<l;)u[m]=T}m=-1;const g=[],b=[];for(;++m<l;){const T=u[m];let O="",v="";T===99?(O=":",v=":"):T===108?O=":":T===114&&(v=":");let C=n.alignDelimiters===!1?1:Math.max(1,d[m]-O.length-v.length);const x=O+"-".repeat(C)+v;n.alignDelimiters!==!1&&(C=O.length+C+v.length,C>d[m]&&(d[m]=C),b[m]=C),g[m]=x}o.splice(1,0,g),f.splice(1,0,b),h=-1;const E=[];for(;++h<o.length;){const T=o[h],O=f[h];m=-1;const v=[];for(;++m<l;){const C=T[m]||"";let x="",I="";if(n.alignDelimiters!==!1){const j=d[m]-(O[m]||0),R=u[m];R===114?x=" ".repeat(j):R===99?j%2?(x=" ".repeat(j/2+.5),I=" ".repeat(j/2-.5)):(x=" ".repeat(j/2),I=x):I=" ".repeat(j)}n.delimiterStart!==!1&&!m&&v.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&C==="")&&(n.delimiterStart!==!1||m)&&v.push(" "),n.alignDelimiters!==!1&&v.push(x),v.push(C),n.alignDelimiters!==!1&&v.push(I),n.padding!==!1&&v.push(" "),(n.delimiterEnd!==!1||m!==l-1)&&v.push("|")}E.push(n.delimiterEnd===!1?v.join("").replace(/ +$/,""):v.join(""))}return E.join(`
364
+ `)}function hF(e){return e==null?"":String(e)}function yC(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}const EC={}.hasOwnProperty;function XR(e,t){const n=t||{};function i(a,...u){let o=i.invalid;const f=i.handlers;if(a&&EC.call(a,e)){const d=String(a[e]);o=EC.call(f,d)?f[d]:i.unknown}if(o)return o.call(this,a,...u)}return i.handlers=n.handlers||{},i.invalid=n.invalid,i.unknown=n.unknown,i}function mF(e,t,n,i){const a=n.enter("blockquote"),u=n.createTracker(i);u.move("> "),u.shift(2);const o=n.indentLines(n.containerFlow(e,u.current()),pF);return a(),o}function pF(e,t,n){return">"+(n?"":" ")+e}function gF(e,t){return vC(e,t.inConstruct,!0)&&!vC(e,t.notInConstruct,!1)}function vC(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let i=-1;for(;++i<t.length;)if(e.includes(t[i]))return!0;return!1}function TC(e,t,n,i){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===`
365
+ `&&gF(n.stack,n.unsafe[a]))return/[ \t]/.test(i.before)?"":" ";return`\\
366
+ `}function bF(e,t){const n=String(e);let i=n.indexOf(t),a=i,u=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===a?++u>o&&(o=u):u=1,a=i+t.length,i=n.indexOf(t,a);return o}function _F(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function yF(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function EF(e,t,n,i){const a=yF(n),u=e.value||"",o=a==="`"?"GraveAccent":"Tilde";if(_F(e,n)){const m=n.enter("codeIndented"),g=n.indentLines(u,vF);return m(),g}const f=n.createTracker(i),d=a.repeat(Math.max(bF(u,a)+1,3)),l=n.enter("codeFenced");let h=f.move(d);if(e.lang){const m=n.enter(`codeFencedLang${o}`);h+=f.move(n.safe(e.lang,{before:h,after:" ",encode:["`"],...f.current()})),m()}if(e.lang&&e.meta){const m=n.enter(`codeFencedMeta${o}`);h+=f.move(" "),h+=f.move(n.safe(e.meta,{before:h,after:`
367
+ `,encode:["`"],...f.current()})),m()}return h+=f.move(`
368
+ `),u&&(h+=f.move(u+`
369
+ `)),h+=f.move(d),l(),h}function vF(e,t,n){return(n?"":" ")+e}function f_(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function TF(e,t,n,i){const a=f_(n),u=a==='"'?"Quote":"Apostrophe",o=n.enter("definition");let f=n.enter("label");const d=n.createTracker(i);let l=d.move("[");return l+=d.move(n.safe(n.associationId(e),{before:l,after:"]",...d.current()})),l+=d.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),l+=d.move("<"),l+=d.move(n.safe(e.url,{before:l,after:">",...d.current()})),l+=d.move(">")):(f=n.enter("destinationRaw"),l+=d.move(n.safe(e.url,{before:l,after:e.title?" ":`
370
+ `,...d.current()}))),f(),e.title&&(f=n.enter(`title${u}`),l+=d.move(" "+a),l+=d.move(n.safe(e.title,{before:l,after:a,...d.current()})),l+=d.move(a),f()),o(),l}function AF(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function $d(e){return"&#x"+e.toString(16).toUpperCase()+";"}function rm(e,t,n){const i=mc(e),a=mc(t);return i===void 0?a===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}QR.peek=OF;function QR(e,t,n,i){const a=AF(n),u=n.enter("emphasis"),o=n.createTracker(i),f=o.move(a);let d=o.move(n.containerPhrasing(e,{after:a,before:f,...o.current()}));const l=d.charCodeAt(0),h=rm(i.before.charCodeAt(i.before.length-1),l,a);h.inside&&(d=$d(l)+d.slice(1));const m=d.charCodeAt(d.length-1),g=rm(i.after.charCodeAt(0),m,a);g.inside&&(d=d.slice(0,-1)+$d(m));const b=o.move(a);return u(),n.attentionEncodeSurroundingInfo={after:g.outside,before:h.outside},f+d+b}function OF(e,t,n){return n.options.emphasis||"*"}function SF(e,t){let n=!1;return sf(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,ib}),!!((!e.depth||e.depth<3)&&i_(e)&&(t.options.setext||n))}function CF(e,t,n,i){const a=Math.max(Math.min(6,e.depth||1),1),u=n.createTracker(i);if(SF(e,n)){const h=n.enter("headingSetext"),m=n.enter("phrasing"),g=n.containerPhrasing(e,{...u.current(),before:`
371
+ `,after:`
372
+ `});return m(),h(),g+`
373
+ `+(a===1?"=":"-").repeat(g.length-(Math.max(g.lastIndexOf("\r"),g.lastIndexOf(`
374
+ `))+1))}const o="#".repeat(a),f=n.enter("headingAtx"),d=n.enter("phrasing");u.move(o+" ");let l=n.containerPhrasing(e,{before:"# ",after:`
375
+ `,...u.current()});return/^[\t ]/.test(l)&&(l=$d(l.charCodeAt(0))+l.slice(1)),l=l?o+" "+l:o,n.options.closeAtx&&(l+=" "+o),d(),f(),l}JR.peek=xF;function JR(e){return e.value||""}function xF(){return"<"}eN.peek=wF;function eN(e,t,n,i){const a=f_(n),u=a==='"'?"Quote":"Apostrophe",o=n.enter("image");let f=n.enter("label");const d=n.createTracker(i);let l=d.move("![");return l+=d.move(n.safe(e.alt,{before:l,after:"]",...d.current()})),l+=d.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),l+=d.move("<"),l+=d.move(n.safe(e.url,{before:l,after:">",...d.current()})),l+=d.move(">")):(f=n.enter("destinationRaw"),l+=d.move(n.safe(e.url,{before:l,after:e.title?" ":")",...d.current()}))),f(),e.title&&(f=n.enter(`title${u}`),l+=d.move(" "+a),l+=d.move(n.safe(e.title,{before:l,after:a,...d.current()})),l+=d.move(a),f()),l+=d.move(")"),o(),l}function wF(){return"!"}tN.peek=RF;function tN(e,t,n,i){const a=e.referenceType,u=n.enter("imageReference");let o=n.enter("label");const f=n.createTracker(i);let d=f.move("![");const l=n.safe(e.alt,{before:d,after:"]",...f.current()});d+=f.move(l+"]["),o();const h=n.stack;n.stack=[],o=n.enter("reference");const m=n.safe(n.associationId(e),{before:d,after:"]",...f.current()});return o(),n.stack=h,u(),a==="full"||!l||l!==m?d+=f.move(m+"]"):a==="shortcut"?d=d.slice(0,-1):d+=f.move("]"),d}function RF(){return"!"}nN.peek=NF;function nN(e,t,n){let i=e.value||"",a="`",u=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(i);)a+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++u<n.unsafe.length;){const o=n.unsafe[u],f=n.compilePattern(o);let d;if(o.atBreak)for(;d=f.exec(i);){let l=d.index;i.charCodeAt(l)===10&&i.charCodeAt(l-1)===13&&l--,i=i.slice(0,l)+" "+i.slice(d.index+1)}}return a+i+a}function NF(){return"`"}function rN(e,t){const n=i_(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}iN.peek=IF;function iN(e,t,n,i){const a=f_(n),u=a==='"'?"Quote":"Apostrophe",o=n.createTracker(i);let f,d;if(rN(e,n)){const h=n.stack;n.stack=[],f=n.enter("autolink");let m=o.move("<");return m+=o.move(n.containerPhrasing(e,{before:m,after:">",...o.current()})),m+=o.move(">"),f(),n.stack=h,m}f=n.enter("link"),d=n.enter("label");let l=o.move("[");return l+=o.move(n.containerPhrasing(e,{before:l,after:"](",...o.current()})),l+=o.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),l+=o.move("<"),l+=o.move(n.safe(e.url,{before:l,after:">",...o.current()})),l+=o.move(">")):(d=n.enter("destinationRaw"),l+=o.move(n.safe(e.url,{before:l,after:e.title?" ":")",...o.current()}))),d(),e.title&&(d=n.enter(`title${u}`),l+=o.move(" "+a),l+=o.move(n.safe(e.title,{before:l,after:a,...o.current()})),l+=o.move(a),d()),l+=o.move(")"),f(),l}function IF(e,t,n){return rN(e,n)?"<":"["}sN.peek=kF;function sN(e,t,n,i){const a=e.referenceType,u=n.enter("linkReference");let o=n.enter("label");const f=n.createTracker(i);let d=f.move("[");const l=n.containerPhrasing(e,{before:d,after:"]",...f.current()});d+=f.move(l+"]["),o();const h=n.stack;n.stack=[],o=n.enter("reference");const m=n.safe(n.associationId(e),{before:d,after:"]",...f.current()});return o(),n.stack=h,u(),a==="full"||!l||l!==m?d+=f.move(m+"]"):a==="shortcut"?d=d.slice(0,-1):d+=f.move("]"),d}function kF(){return"["}function h_(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function MF(e){const t=h_(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function PF(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function aN(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function DF(e,t,n,i){const a=n.enter("list"),u=n.bulletCurrent;let o=e.ordered?PF(n):h_(n);const f=e.ordered?o==="."?")":".":MF(n);let d=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const h=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&h&&(!h.children||!h.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&&(d=!0),aN(n)===o&&h){let m=-1;for(;++m<e.children.length;){const g=e.children[m];if(g&&g.type==="listItem"&&g.children&&g.children[0]&&g.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(o=f),n.bulletCurrent=o;const l=n.containerFlow(e,i);return n.bulletLastUsed=o,n.bulletCurrent=u,a(),l}function jF(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function LF(e,t,n,i){const a=jF(n);let u=n.bulletCurrent||h_(n);t&&t.type==="list"&&t.ordered&&(u=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+u);let o=u.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const f=n.createTracker(i);f.move(u+" ".repeat(o-u.length)),f.shift(o);const d=n.enter("listItem"),l=n.indentLines(n.containerFlow(e,f.current()),h);return d(),l;function h(m,g,b){return g?(b?"":" ".repeat(o))+m:(b?u:u+" ".repeat(o-u.length))+m}}function HF(e,t,n,i){const a=n.enter("paragraph"),u=n.enter("phrasing"),o=n.containerPhrasing(e,i);return u(),a(),o}const BF=rf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function UF(e,t,n,i){return(e.children.some(function(o){return BF(o)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function FF(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}oN.peek=zF;function oN(e,t,n,i){const a=FF(n),u=n.enter("strong"),o=n.createTracker(i),f=o.move(a+a);let d=o.move(n.containerPhrasing(e,{after:a,before:f,...o.current()}));const l=d.charCodeAt(0),h=rm(i.before.charCodeAt(i.before.length-1),l,a);h.inside&&(d=$d(l)+d.slice(1));const m=d.charCodeAt(d.length-1),g=rm(i.after.charCodeAt(0),m,a);g.inside&&(d=d.slice(0,-1)+$d(m));const b=o.move(a+a);return u(),n.attentionEncodeSurroundingInfo={after:g.outside,before:h.outside},f+d+b}function zF(e,t,n){return n.options.strong||"*"}function $F(e,t,n,i){return n.safe(e.value,i)}function qF(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function GF(e,t,n){const i=(aN(n)+(n.options.ruleSpaces?" ":"")).repeat(qF(n));return n.options.ruleSpaces?i.slice(0,-1):i}const cN={blockquote:mF,break:TC,code:EF,definition:TF,emphasis:QR,hardBreak:TC,heading:CF,html:JR,image:eN,imageReference:tN,inlineCode:nN,link:iN,linkReference:sN,list:DF,listItem:LF,paragraph:HF,root:UF,strong:oN,text:$F,thematicBreak:GF};function KF(){return{enter:{table:YF,tableData:AC,tableHeader:AC,tableRow:ZF},exit:{codeText:WF,table:VF,tableData:x0,tableHeader:x0,tableRow:x0}}}function YF(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function VF(e){this.exit(e),this.data.inTable=void 0}function ZF(e){this.enter({type:"tableRow",children:[]},e)}function x0(e){this.exit(e)}function AC(e){this.enter({type:"tableCell",children:[]},e)}function WF(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,XF));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function XF(e,t){return t==="|"?t:e}function QF(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,a=t.stringLength,u=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
376
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:g,table:o,tableCell:d,tableRow:f}};function o(b,E,T,O){return l(h(b,T,O),b.align)}function f(b,E,T,O){const v=m(b,T,O),C=l([v]);return C.slice(0,C.indexOf(`
377
+ `))}function d(b,E,T,O){const v=T.enter("tableCell"),C=T.enter("phrasing"),x=T.containerPhrasing(b,{...O,before:u,after:u});return C(),v(),x}function l(b,E){return fF(b,{align:E,alignDelimiters:i,padding:n,stringLength:a})}function h(b,E,T){const O=b.children;let v=-1;const C=[],x=E.enter("table");for(;++v<O.length;)C[v]=m(O[v],E,T);return x(),C}function m(b,E,T){const O=b.children;let v=-1;const C=[],x=E.enter("tableRow");for(;++v<O.length;)C[v]=d(O[v],b,E,T);return x(),C}function g(b,E,T){let O=cN.inlineCode(b,E,T);return T.stack.includes("tableCell")&&(O=O.replace(/\|/g,"\\$&")),O}}function JF(){return{exit:{taskListCheckValueChecked:OC,taskListCheckValueUnchecked:OC,paragraph:tz}}}function ez(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:nz}}}function OC(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function tz(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const i=n.children[0];if(i&&i.type==="text"){const a=t.children;let u=-1,o;for(;++u<a.length;){const f=a[u];if(f.type==="paragraph"){o=f;break}}o===n&&(i.value=i.value.slice(1),i.value.length===0?n.children.shift():n.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,n.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function nz(e,t,n,i){const a=e.children[0],u=typeof e.checked=="boolean"&&a&&a.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",f=n.createTracker(i);u&&f.move(o);let d=cN.listItem(e,t,n,{...i,...f.current()});return u&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),d;function l(h){return h+o}}function rz(){return[D9(),nF(),aF(),KF(),JF()]}function iz(e){return{extensions:[j9(),rF(e),oF(),QF(e),ez()]}}const sz={tokenize:dz,partial:!0},lN={tokenize:fz,partial:!0},uN={tokenize:hz,partial:!0},dN={tokenize:mz,partial:!0},az={tokenize:pz,partial:!0},fN={name:"wwwAutolink",tokenize:lz,previous:mN},hN={name:"protocolAutolink",tokenize:uz,previous:pN},Ns={name:"emailAutolink",tokenize:cz,previous:gN},Zi={};function oz(){return{text:Zi}}let Ja=48;for(;Ja<123;)Zi[Ja]=Ns,Ja++,Ja===58?Ja=65:Ja===91&&(Ja=97);Zi[43]=Ns;Zi[45]=Ns;Zi[46]=Ns;Zi[95]=Ns;Zi[72]=[Ns,hN];Zi[104]=[Ns,hN];Zi[87]=[Ns,fN];Zi[119]=[Ns,fN];function cz(e,t,n){const i=this;let a,u;return o;function o(m){return!cb(m)||!gN.call(i,i.previous)||m_(i.events)?n(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(m))}function f(m){return cb(m)?(e.consume(m),f):m===64?(e.consume(m),d):n(m)}function d(m){return m===46?e.check(az,h,l)(m):m===45||m===95||dr(m)?(u=!0,e.consume(m),d):h(m)}function l(m){return e.consume(m),a=!0,d}function h(m){return u&&a&&vr(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):n(m)}}function lz(e,t,n){const i=this;return a;function a(o){return o!==87&&o!==119||!mN.call(i,i.previous)||m_(i.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(sz,e.attempt(lN,e.attempt(uN,u),n),n)(o))}function u(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function uz(e,t,n){const i=this;let a="",u=!1;return o;function o(m){return(m===72||m===104)&&pN.call(i,i.previous)&&!m_(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(m),e.consume(m),f):n(m)}function f(m){if(vr(m)&&a.length<5)return a+=String.fromCodePoint(m),e.consume(m),f;if(m===58){const g=a.toLowerCase();if(g==="http"||g==="https")return e.consume(m),d}return n(m)}function d(m){return m===47?(e.consume(m),u?l:(u=!0,d)):n(m)}function l(m){return m===null||tm(m)||Jt(m)||io(m)||Am(m)?n(m):e.attempt(lN,e.attempt(uN,h),n)(m)}function h(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function dz(e,t,n){let i=0;return a;function a(o){return(o===87||o===119)&&i<3?(i++,e.consume(o),a):o===46&&i===3?(e.consume(o),u):n(o)}function u(o){return o===null?n(o):t(o)}}function fz(e,t,n){let i,a,u;return o;function o(l){return l===46||l===95?e.check(dN,d,f)(l):l===null||Jt(l)||io(l)||l!==45&&Am(l)?d(l):(u=!0,e.consume(l),o)}function f(l){return l===95?i=!0:(a=i,i=void 0),e.consume(l),o}function d(l){return a||i||!u?n(l):t(l)}}function hz(e,t){let n=0,i=0;return a;function a(o){return o===40?(n++,e.consume(o),a):o===41&&i<n?u(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(dN,t,u)(o):o===null||Jt(o)||io(o)?t(o):(e.consume(o),a)}function u(o){return o===41&&i++,e.consume(o),a}}function mz(e,t,n){return i;function i(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),i):f===38?(e.consume(f),u):f===93?(e.consume(f),a):f===60||f===null||Jt(f)||io(f)?t(f):n(f)}function a(f){return f===null||f===40||f===91||Jt(f)||io(f)?t(f):i(f)}function u(f){return vr(f)?o(f):n(f)}function o(f){return f===59?(e.consume(f),i):vr(f)?(e.consume(f),o):n(f)}}function pz(e,t,n){return i;function i(u){return e.consume(u),a}function a(u){return dr(u)?n(u):t(u)}}function mN(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Jt(e)}function pN(e){return!vr(e)}function gN(e){return!(e===47||cb(e))}function cb(e){return e===43||e===45||e===46||e===95||dr(e)}function m_(e){let t=e.length,n=!1;for(;t--;){const i=e[t][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){n=!0;break}if(i._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const gz={tokenize:Oz,partial:!0};function bz(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:vz,continuation:{tokenize:Tz},exit:Az}},text:{91:{name:"gfmFootnoteCall",tokenize:Ez},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:_z,resolveTo:yz}}}}function _z(e,t,n){const i=this;let a=i.events.length;const u=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o;for(;a--;){const d=i.events[a][1];if(d.type==="labelImage"){o=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return f;function f(d){if(!o||!o._balanced)return n(d);const l=Di(i.sliceSerialize({start:o.end,end:i.now()}));return l.codePointAt(0)!==94||!u.includes(l.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function yz(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const u={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},u.start),end:Object.assign({},u.end)},f=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",u,t],["enter",o,t],["exit",o,t],["exit",u,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...f),e}function Ez(e,t,n){const i=this,a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let u=0,o;return f;function f(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),d}function d(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(m){if(u>999||m===93&&!o||m===null||m===91||Jt(m))return n(m);if(m===93){e.exit("chunkString");const g=e.exit("gfmFootnoteCallString");return a.includes(Di(i.sliceSerialize(g)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return Jt(m)||(o=!0),u++,e.consume(m),m===92?h:l}function h(m){return m===91||m===92||m===93?(e.consume(m),u++,l):l(m)}}function vz(e,t,n){const i=this,a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let u,o=0,f;return d;function d(E){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(E){return E===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):n(E)}function h(E){if(o>999||E===93&&!f||E===null||E===91||Jt(E))return n(E);if(E===93){e.exit("chunkString");const T=e.exit("gfmFootnoteDefinitionLabelString");return u=Di(i.sliceSerialize(T)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),g}return Jt(E)||(f=!0),o++,e.consume(E),E===92?m:h}function m(E){return E===91||E===92||E===93?(e.consume(E),o++,h):h(E)}function g(E){return E===58?(e.enter("definitionMarker"),e.consume(E),e.exit("definitionMarker"),a.includes(u)||a.push(u),kt(e,b,"gfmFootnoteDefinitionWhitespace")):n(E)}function b(E){return t(E)}}function Tz(e,t,n){return e.check(nf,t,e.attempt(gz,t,n))}function Az(e){e.exit("gfmFootnoteDefinition")}function Oz(e,t,n){const i=this;return kt(e,a,"gfmFootnoteDefinitionIndent",5);function a(u){const o=i.events[i.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(u):n(u)}}function Sz(e){let n=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:u,resolveAll:a};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function a(o,f){let d=-1;for(;++d<o.length;)if(o[d][0]==="enter"&&o[d][1].type==="strikethroughSequenceTemporary"&&o[d][1]._close){let l=d;for(;l--;)if(o[l][0]==="exit"&&o[l][1].type==="strikethroughSequenceTemporary"&&o[l][1]._open&&o[d][1].end.offset-o[d][1].start.offset===o[l][1].end.offset-o[l][1].start.offset){o[d][1].type="strikethroughSequence",o[l][1].type="strikethroughSequence";const h={type:"strikethrough",start:Object.assign({},o[l][1].start),end:Object.assign({},o[d][1].end)},m={type:"strikethroughText",start:Object.assign({},o[l][1].end),end:Object.assign({},o[d][1].start)},g=[["enter",h,f],["enter",o[l][1],f],["exit",o[l][1],f],["enter",m,f]],b=f.parser.constructs.insideSpan.null;b&&Jr(g,g.length,0,Om(b,o.slice(l+1,d),f)),Jr(g,g.length,0,[["exit",m,f],["enter",o[d][1],f],["exit",o[d][1],f],["exit",h,f]]),Jr(o,l-1,d-l+3,g),d=l+g.length-2;break}}for(d=-1;++d<o.length;)o[d][1].type==="strikethroughSequenceTemporary"&&(o[d][1].type="data");return o}function u(o,f,d){const l=this.previous,h=this.events;let m=0;return g;function g(E){return l===126&&h[h.length-1][1].type!=="characterEscape"?d(E):(o.enter("strikethroughSequenceTemporary"),b(E))}function b(E){const T=mc(l);if(E===126)return m>1?d(E):(o.consume(E),m++,b);if(m<2&&!n)return d(E);const O=o.exit("strikethroughSequenceTemporary"),v=mc(E);return O._open=!v||v===2&&!!T,O._close=!T||T===2&&!!v,f(E)}}}class Cz{constructor(){this.map=[]}add(t,n,i){xz(this,t,n,i)}consume(t){if(this.map.sort(function(u,o){return u[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];i.push(t.slice()),t.length=0;let a=i.pop();for(;a;){for(const u of a)t.push(u);a=i.pop()}this.map.length=0}}function xz(e,t,n,i){let a=0;if(!(n===0&&i.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...i);return}a+=1}e.map.push([t,n,i])}}function wz(e,t){let n=!1;const i=[];for(;t<e.length;){const a=e[t];if(n){if(a[0]==="enter")a[1].type==="tableContent"&&i.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const u=i.length-1;i[u]=i[u]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return i}function Rz(){return{flow:{null:{name:"table",tokenize:Nz,resolveAll:Iz}}}}function Nz(e,t,n){const i=this;let a=0,u=0,o;return f;function f(L){let G=i.events.length-1;for(;G>-1;){const B=i.events[G][1].type;if(B==="lineEnding"||B==="linePrefix")G--;else break}const F=G>-1?i.events[G][1].type:null,K=F==="tableHead"||F==="tableRow"?R:d;return K===R&&i.parser.lazy[i.now().line]?n(L):K(L)}function d(L){return e.enter("tableHead"),e.enter("tableRow"),l(L)}function l(L){return L===124||(o=!0,u+=1),h(L)}function h(L){return L===null?n(L):Je(L)?u>1?(u=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),b):n(L):Ot(L)?kt(e,h,"whitespace")(L):(u+=1,o&&(o=!1,a+=1),L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),o=!0,h):(e.enter("data"),m(L)))}function m(L){return L===null||L===124||Jt(L)?(e.exit("data"),h(L)):(e.consume(L),L===92?g:m)}function g(L){return L===92||L===124?(e.consume(L),m):m(L)}function b(L){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(L):(e.enter("tableDelimiterRow"),o=!1,Ot(L)?kt(e,E,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):E(L))}function E(L){return L===45||L===58?O(L):L===124?(o=!0,e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),T):j(L)}function T(L){return Ot(L)?kt(e,O,"whitespace")(L):O(L)}function O(L){return L===58?(u+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),v):L===45?(u+=1,v(L)):L===null||Je(L)?I(L):j(L)}function v(L){return L===45?(e.enter("tableDelimiterFiller"),C(L)):j(L)}function C(L){return L===45?(e.consume(L),C):L===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(L))}function x(L){return Ot(L)?kt(e,I,"whitespace")(L):I(L)}function I(L){return L===124?E(L):L===null||Je(L)?!o||a!==u?j(L):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(L)):j(L)}function j(L){return n(L)}function R(L){return e.enter("tableRow"),k(L)}function k(L){return L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),k):L===null||Je(L)?(e.exit("tableRow"),t(L)):Ot(L)?kt(e,k,"whitespace")(L):(e.enter("data"),P(L))}function P(L){return L===null||L===124||Jt(L)?(e.exit("data"),k(L)):(e.consume(L),L===92?z:P)}function z(L){return L===92||L===124?(e.consume(L),P):P(L)}}function Iz(e,t){let n=-1,i=!0,a=0,u=[0,0,0,0],o=[0,0,0,0],f=!1,d=0,l,h,m;const g=new Cz;for(;++n<e.length;){const b=e[n],E=b[1];b[0]==="enter"?E.type==="tableHead"?(f=!1,d!==0&&(SC(g,t,d,l,h),h=void 0,d=0),l={type:"table",start:Object.assign({},E.start),end:Object.assign({},E.end)},g.add(n,0,[["enter",l,t]])):E.type==="tableRow"||E.type==="tableDelimiterRow"?(i=!0,m=void 0,u=[0,0,0,0],o=[0,n+1,0,0],f&&(f=!1,h={type:"tableBody",start:Object.assign({},E.start),end:Object.assign({},E.end)},g.add(n,0,[["enter",h,t]])),a=E.type==="tableDelimiterRow"?2:h?3:1):a&&(E.type==="data"||E.type==="tableDelimiterMarker"||E.type==="tableDelimiterFiller")?(i=!1,o[2]===0&&(u[1]!==0&&(o[0]=o[1],m=Lh(g,t,u,a,void 0,m),u=[0,0,0,0]),o[2]=n)):E.type==="tableCellDivider"&&(i?i=!1:(u[1]!==0&&(o[0]=o[1],m=Lh(g,t,u,a,void 0,m)),u=o,o=[u[1],n,0,0])):E.type==="tableHead"?(f=!0,d=n):E.type==="tableRow"||E.type==="tableDelimiterRow"?(d=n,u[1]!==0?(o[0]=o[1],m=Lh(g,t,u,a,n,m)):o[1]!==0&&(m=Lh(g,t,o,a,n,m)),a=0):a&&(E.type==="data"||E.type==="tableDelimiterMarker"||E.type==="tableDelimiterFiller")&&(o[3]=n)}for(d!==0&&SC(g,t,d,l,h),g.consume(t.events),n=-1;++n<t.events.length;){const b=t.events[n];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=wz(t.events,n))}return e}function Lh(e,t,n,i,a,u){const o=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",f="tableContent";n[0]!==0&&(u.end=Object.assign({},ic(t.events,n[0])),e.add(n[0],0,[["exit",u,t]]));const d=ic(t.events,n[1]);if(u={type:o,start:Object.assign({},d),end:Object.assign({},d)},e.add(n[1],0,[["enter",u,t]]),n[2]!==0){const l=ic(t.events,n[2]),h=ic(t.events,n[3]),m={type:f,start:Object.assign({},l),end:Object.assign({},h)};if(e.add(n[2],0,[["enter",m,t]]),i!==2){const g=t.events[n[2]],b=t.events[n[3]];if(g[1].end=Object.assign({},b[1].end),g[1].type="chunkText",g[1].contentType="text",n[3]>n[2]+1){const E=n[2]+1,T=n[3]-n[2]-1;e.add(E,T,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return a!==void 0&&(u.end=Object.assign({},ic(t.events,a)),e.add(a,0,[["exit",u,t]]),u=void 0),u}function SC(e,t,n,i,a){const u=[],o=ic(t.events,n);a&&(a.end=Object.assign({},o),u.push(["exit",a,t])),i.end=Object.assign({},o),u.push(["exit",i,t]),e.add(n+1,0,u)}function ic(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const kz={name:"tasklistCheck",tokenize:Pz};function Mz(){return{text:{91:kz}}}function Pz(e,t,n){const i=this;return a;function a(d){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),u)}function u(d){return Jt(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),o):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),o):n(d)}function o(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):n(d)}function f(d){return Je(d)?t(d):Ot(d)?e.check({tokenize:Dz},t,n)(d):n(d)}}function Dz(e,t,n){return kt(e,i,"whitespace");function i(a){return a===null?n(a):t(a)}}function jz(e){return CR([oz(),bz(),Sz(e),Rz(),Mz()])}const Lz={};function Hz(e){const t=this,n=e||Lz,i=t.data(),a=i.micromarkExtensions||(i.micromarkExtensions=[]),u=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),o=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);a.push(jz(n)),u.push(rz()),o.push(iz(n))}const CC=(function(e,t,n){const i=rf(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(i(e.children[t],t,e))return e.children[t]}),oo=(function(e){if(e==null)return Fz;if(typeof e=="string")return Uz(e);if(typeof e=="object")return Bz(e);if(typeof e=="function")return p_(e);throw new Error("Expected function, string, or array as `test`")});function Bz(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=oo(e[n]);return p_(i);function i(...a){let u=-1;for(;++u<t.length;)if(t[u].apply(this,a))return!0;return!1}}function Uz(e){return p_(t);function t(n){return n.tagName===e}}function p_(e){return t;function t(n,i,a){return!!(zz(n)&&e.call(this,n,typeof i=="number"?i:void 0,a||void 0))}}function Fz(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function zz(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const xC=/\n/g,wC=/[\t ]+/g,lb=oo("br"),RC=oo(Wz),$z=oo("p"),NC=oo("tr"),qz=oo(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",Zz,Xz]),bN=oo(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function Gz(e,t){const n=t||{},i="children"in e?e.children:[],a=bN(e),u=EN(e,{whitespace:n.whitespace||"normal"}),o=[];(e.type==="text"||e.type==="comment")&&o.push(...yN(e,{breakBefore:!0,breakAfter:!0}));let f=-1;for(;++f<i.length;)o.push(..._N(i[f],e,{whitespace:u,breakBefore:f?void 0:a,breakAfter:f<i.length-1?lb(i[f+1]):a}));const d=[];let l;for(f=-1;++f<o.length;){const h=o[f];typeof h=="number"?l!==void 0&&h>l&&(l=h):h&&(l!==void 0&&l>-1&&d.push(`
378
+ `.repeat(l)||" "),l=-1,d.push(h))}return d.join("")}function _N(e,t,n){return e.type==="element"?Kz(e,t,n):e.type==="text"?n.whitespace==="normal"?yN(e,n):Yz(e):[]}function Kz(e,t,n){const i=EN(e,n),a=e.children||[];let u=-1,o=[];if(qz(e))return o;let f,d;for(lb(e)||NC(e)&&CC(t,e,NC)?d=`
379
+ `:$z(e)?(f=2,d=2):bN(e)&&(f=1,d=1);++u<a.length;)o=o.concat(_N(a[u],e,{whitespace:i,breakBefore:u?void 0:f,breakAfter:u<a.length-1?lb(a[u+1]):d}));return RC(e)&&CC(t,e,RC)&&o.push(" "),f&&o.unshift(f),d&&o.push(d),o}function yN(e,t){const n=String(e.value),i=[],a=[];let u=0;for(;u<=n.length;){xC.lastIndex=u;const d=xC.exec(n),l=d&&"index"in d?d.index:n.length;i.push(Vz(n.slice(u,l).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),u===0?t.breakBefore:!0,l===n.length?t.breakAfter:!0)),u=l+1}let o=-1,f;for(;++o<i.length;)i[o].charCodeAt(i[o].length-1)===8203||o<i.length-1&&i[o+1].charCodeAt(0)===8203?(a.push(i[o]),f=void 0):i[o]?(typeof f=="number"&&a.push(f),a.push(i[o]),f=0):(o===0||o===i.length-1)&&a.push(0);return a}function Yz(e){return[String(e.value)]}function Vz(e,t,n){const i=[];let a=0,u;for(;a<e.length;){wC.lastIndex=a;const o=wC.exec(e);u=o?o.index:e.length,!a&&!u&&o&&!t&&i.push(""),a!==u&&i.push(e.slice(a,u)),a=o?u+o[0].length:u}return a!==u&&!n&&i.push(""),i.join(" ")}function EN(e,t){if(e.type==="element"){const n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function Zz(e){return!!(e.properties||{}).hidden}function Wz(e){return e.tagName==="td"||e.tagName==="th"}function Xz(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function Qz(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",o="(?!struct)("+i+"|"+t.optional(a)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",f={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},l={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},h={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},m={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(l,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},g={className:"title",begin:t.optional(a)+e.IDENT_RE,relevance:0},b=t.optional(a)+e.IDENT_RE+"\\s*\\(",E=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],T=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],O=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],v=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],I={type:T,keyword:E,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:O},j={className:"function.dispatch",relevance:0,keywords:{_hint:v},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},R=[j,m,f,n,e.C_BLOCK_COMMENT_MODE,h,l],k={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:I,contains:R.concat([{begin:/\(/,end:/\)/,keywords:I,contains:R.concat(["self"]),relevance:0}]),relevance:0},P={className:"function",begin:"("+o+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:I,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:I,relevance:0},{begin:b,returnBegin:!0,contains:[g],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[l,h]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:I,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,l,h,f,{begin:/\(/,end:/\)/,keywords:I,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,l,h,f]}]},f,n,e.C_BLOCK_COMMENT_MODE,m]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:I,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(k,P,j,R,[m,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:I,contains:["self",f]},{begin:e.IDENT_RE+"::",keywords:I},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Jz(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=Qz(e),i=n.keywords;return i.type=[...i.type,...t.type],i.literal=[...i.literal,...t.literal],i.built_in=[...i.built_in,...t.built_in],i._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function e7(e){const t=e.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const a={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},u=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},f={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,a]};a.contains.push(f);const d={match:/\\"/},l={className:"string",begin:/'/,end:/'/},h={match:/\\'/},m={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},g=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],b=e.SHEBANG({binary:`(${g.join("|")})`,relevance:10}),E={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},T=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],O=["true","false"],v={match:/(\/[a-z._-]+)+/},C=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],x=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],I=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],j=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:T,literal:O,built_in:[...C,...x,"set","shopt",...I,...j]},contains:[b,e.SHEBANG(),E,m,u,o,v,f,d,l,h,n]}}function t7(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",o="("+i+"|"+t.optional(a)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",f={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},l={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},h={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},m={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(l,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},g={className:"title",begin:t.optional(a)+e.IDENT_RE,relevance:0},b=t.optional(a)+e.IDENT_RE+"\\s*\\(",O={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},v=[m,f,n,e.C_BLOCK_COMMENT_MODE,h,l],C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:v.concat([{begin:/\(/,end:/\)/,keywords:O,contains:v.concat(["self"]),relevance:0}]),relevance:0},x={begin:"("+o+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:O,relevance:0},{begin:b,returnBegin:!0,contains:[e.inherit(g,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,l,h,f,{begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,l,h,f]}]},f,n,e.C_BLOCK_COMMENT_MODE,m]};return{name:"C",aliases:["h"],keywords:O,disableAutodetect:!0,illegal:"</",contains:[].concat(C,x,v,[m,{begin:e.IDENT_RE+"::",keywords:O},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:m,strings:l,keywords:O}}}function n7(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",o="(?!struct)("+i+"|"+t.optional(a)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",f={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},l={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},h={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},m={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(l,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},g={className:"title",begin:t.optional(a)+e.IDENT_RE,relevance:0},b=t.optional(a)+e.IDENT_RE+"\\s*\\(",E=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],T=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],O=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],v=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],I={type:T,keyword:E,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:O},j={className:"function.dispatch",relevance:0,keywords:{_hint:v},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},R=[j,m,f,n,e.C_BLOCK_COMMENT_MODE,h,l],k={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:I,contains:R.concat([{begin:/\(/,end:/\)/,keywords:I,contains:R.concat(["self"]),relevance:0}]),relevance:0},P={className:"function",begin:"("+o+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:I,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:I,relevance:0},{begin:b,returnBegin:!0,contains:[g],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[l,h]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:I,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,l,h,f,{begin:/\(/,end:/\)/,keywords:I,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,l,h,f]}]},f,n,e.C_BLOCK_COMMENT_MODE,m]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:I,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(k,P,j,R,[m,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:I,contains:["self",f]},{begin:e.IDENT_RE+"::",keywords:I},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function r7(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],i=["default","false","null","true"],a=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],u=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],o={keyword:a.concat(u),built_in:t,literal:i},f=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),d={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},l={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},h={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},m=e.inherit(h,{illegal:/\n/}),g={className:"subst",begin:/\{/,end:/\}/,keywords:o},b=e.inherit(g,{illegal:/\n/}),E={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,b]},T={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},g]},O=e.inherit(T,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},b]});g.contains=[T,E,h,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,e.C_BLOCK_COMMENT_MODE],b.contains=[O,E,m,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const v={variants:[l,T,E,h,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},C={begin:"<",end:">",contains:[{beginKeywords:"in out"},f]},x=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",I={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:o,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},v,d,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},f,C,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[f,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[f,C,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+x+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:o,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,C],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,relevance:0,contains:[v,d,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},I]}}const i7=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),s7=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],a7=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],o7=[...s7,...a7],c7=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),l7=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),u7=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),d7=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function f7(e){const t=e.regex,n=i7(e),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},a="and or not only",u=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",f=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,i,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+l7.join("|")+")"},{begin:":(:)?("+u7.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+d7.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...f,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...f,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:u},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:c7.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...f,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+o7.join("|")+")\\b"}]}}function h7(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function m7(e){const u={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:u,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:u,illegal:/["']/}]}]}}function p7(e){const t=e.regex,n=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:t.concat(n,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function g7(e){const t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},i=e.COMMENT();i.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const a={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},u={className:"literal",begin:/\bon|off|true|false|yes|no\b/},o={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},f={begin:/\[/,end:/\]/,contains:[i,u,a,o,n,"self"],relevance:0},d=/[A-Za-z0-9_-]+/,l=/"(\\"|[^"])*"/,h=/'[^']*'/,m=t.either(d,l,h),g=t.concat(m,"(\\s*\\.\\s*",m,")*",t.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[i,{className:"section",begin:/\[+/,end:/\]+/},{begin:g,className:"attr",starts:{end:/$/,contains:[i,f,u,a,o,n]}}]}}var sc="[0-9](_*[0-9])*",Hh=`\\.(${sc})`,Bh="[0-9a-fA-F](_*[0-9a-fA-F])*",IC={className:"number",variants:[{begin:`(\\b(${sc})((${Hh})|\\.)?|(${Hh}))[eE][+-]?(${sc})[fFdD]?\\b`},{begin:`\\b(${sc})((${Hh})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Hh})[fFdD]?\\b`},{begin:`\\b(${sc})[fFdD]\\b`},{begin:`\\b0[xX]((${Bh})\\.?|(${Bh})?\\.(${Bh}))[pP][+-]?(${sc})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Bh})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function vN(e,t,n){return n===-1?"":e.replace(t,i=>vN(e,t,n-1))}function b7(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+vN("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),d={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},l={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},h={className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:d,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[h,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+i+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:d,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[l,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,IC,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},IC,l]}}const kC="[A-Za-z$_][0-9A-Za-z$_]*",_7=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],y7=["true","false","null","undefined","NaN","Infinity"],TN=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],AN=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],ON=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],E7=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],v7=[].concat(ON,TN,AN);function T7(e){const t=e.regex,n=(W,{after:pe})=>{const N="</"+W[0].slice(1);return W.input.indexOf(N,pe)!==-1},i=kC,a={begin:"<>",end:"</>"},u=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(W,pe)=>{const N=W[0].length+W.index,M=W.input[N];if(M==="<"||M===","){pe.ignoreMatch();return}M===">"&&(n(W,{after:N})||pe.ignoreMatch());let q;const D=W.input.substring(N);if(q=D.match(/^\s*=/)){pe.ignoreMatch();return}if((q=D.match(/^\s+extends\s+/))&&q.index===0){pe.ignoreMatch();return}}},f={$pattern:kC,keyword:_7,literal:y7,built_in:v7,"variable.language":E7},d="[0-9](_?[0-9])*",l=`\\.(${d})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",m={className:"number",variants:[{begin:`(\\b(${h})((${l})|\\.)?|(${l}))[eE][+-]?(${d})\\b`},{begin:`\\b(${h})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},g={className:"subst",begin:"\\$\\{",end:"\\}",keywords:f,contains:[]},b={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,g],subLanguage:"xml"}},E={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,g],subLanguage:"css"}},T={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,g],subLanguage:"graphql"}},O={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,g]},C={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,b,E,T,O,{match:/\$\d+/},m];g.contains=x.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(x)});const I=[].concat(C,g.contains),j=I.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat(I)}]),R={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:j},k={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},P={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...TN,...AN]}},z={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},L={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[R],illegal:/%/},G={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(W){return t.concat("(?!",W.join("|"),")")}const K={match:t.concat(/\b/,F([...ON,"super","import"].map(W=>`${W}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},B={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Z={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},R]},U="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",Y={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(U)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[R]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:j,CLASS_REFERENCE:P},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),z,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,b,E,T,O,C,{match:/\$\d+/},m,P,{scope:"attr",match:i+t.lookahead(":"),relevance:0},Y,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[C,e.REGEXP_MODE,{className:"function",begin:U,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:j}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:u},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},L,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[R,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},B,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},K,G,k,Z,{match:/\$[(.]/}]}}function A7(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],a={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[t,n,e.QUOTE_STRING_MODE,a,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var ac="[0-9](_*[0-9])*",Uh=`\\.(${ac})`,Fh="[0-9a-fA-F](_*[0-9a-fA-F])*",O7={className:"number",variants:[{begin:`(\\b(${ac})((${Uh})|\\.)?|(${Uh}))[eE][+-]?(${ac})[fFdD]?\\b`},{begin:`\\b(${ac})((${Uh})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Uh})[fFdD]?\\b`},{begin:`\\b(${ac})[fFdD]\\b`},{begin:`\\b0[xX]((${Fh})\\.?|(${Fh})?\\.(${Fh}))[pP][+-]?(${ac})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Fh})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function S7(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},i={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},a={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},u={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[u,a]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,u,a]}]};a.contains.push(o);const f={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},d={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:"string"}),"self"]}]},l=O7,h=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),m={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},g=m;return g.variants[1].contains=[m],m.variants[1].contains=[g],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,h,n,i,f,d,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[m,e.C_LINE_COMMENT_MODE,h],relevance:0},e.C_LINE_COMMENT_MODE,h,f,d,o,e.C_NUMBER_MODE]},h]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},f,d]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
380
+ `},l]}}const C7=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),x7=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],w7=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],R7=[...x7,...w7],N7=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),SN=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),CN=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),I7=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),k7=SN.concat(CN).sort().reverse();function M7(e){const t=C7(e),n=k7,i="and or not only",a="[\\w-]+",u="("+a+"|@\\{"+a+"\\})",o=[],f=[],d=function(x){return{className:"string",begin:"~?"+x+".*?"+x}},l=function(x,I,j){return{className:x,begin:I,relevance:j}},h={$pattern:/[a-z-]+/,keyword:i,attribute:N7.join(" ")},m={begin:"\\(",end:"\\)",contains:f,keywords:h,relevance:0};f.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,d("'"),d('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,m,l("variable","@@?"+a,10),l("variable","@\\{"+a+"\\}"),l("built_in","~?`[^`]*?`"),{className:"attribute",begin:a+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const g=f.concat({begin:/\{/,end:/\}/,contains:o}),b={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(f)},E={begin:u+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+I7.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:f}}]},T={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:h,returnEnd:!0,contains:f,relevance:0}},O={className:"variable",variants:[{begin:"@"+a+"\\s*:",relevance:15},{begin:"@"+a}],starts:{end:"[;}]",returnEnd:!0,contains:g}},v={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:u,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,b,l("keyword","all\\b"),l("variable","@\\{"+a+"\\}"),{begin:"\\b("+R7.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,l("selector-tag",u,0),l("selector-id","#"+u),l("selector-class","\\."+u,0),l("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+SN.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+CN.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:g},{begin:"!important"},t.FUNCTION_DISPATCH]},C={begin:a+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[v]};return o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,T,O,C,E,v,b,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:o}}function P7(e){const t="\\[=*\\[",n="\\]=*\\]",i={begin:t,end:n,contains:["self"]},a=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[i],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:a.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:a}].concat(a)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[i],relevance:5}])}}function D7(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},i={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[t,n]},a={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},u={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},o={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,n,i,a,u,o]}}function j7(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},a={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},u={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},f=/[A-Za-z][A-Za-z0-9+.-]*/,d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,f,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},l={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},h={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},m=e.inherit(l,{contains:[]}),g=e.inherit(h,{contains:[]});l.contains.push(g),h.contains.push(m);let b=[n,d];return[l,h,m,g].forEach(v=>{v.contains=v.contains.concat(b)}),b=b.concat(l,h),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:b},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:b}]}]},n,u,l,h,{className:"quote",begin:"^>\\s+",contains:b,end:"$"},a,i,d,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function L7(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,f={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},d={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:f,illegal:"</",contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+d.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:d,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function H7(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],i=/[dualxmsipngr]{0,12}/,a={$pattern:/[\w.]+/,keyword:n.join(" ")},u={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:a},o={begin:/->\{/,end:/\}/},f={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},d={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[f]},l={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},h=[e.BACKSLASH_ESCAPE,u,d],m=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],g=(T,O,v="\\1")=>{const C=v==="\\1"?v:t.concat(v,O);return t.concat(t.concat("(?:",T,")"),O,/(?:\\.|[^\\\/])*?/,C,/(?:\\.|[^\\\/])*?/,v,i)},b=(T,O,v)=>t.concat(t.concat("(?:",T,")"),O,/(?:\\.|[^\\\/])*?/,v,i),E=[d,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:"string",contains:h,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},l,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:g("s|tr|y",t.either(...m,{capture:!0}))},{begin:g("s|tr|y","\\(","\\)")},{begin:g("s|tr|y","\\[","\\]")},{begin:g("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:b("(?:m|qr)?",/\//,/\//)},{begin:b("m|qr",t.either(...m,{capture:!0}),/\1/)},{begin:b("m|qr",/\(/,/\)/)},{begin:b("m|qr",/\[/,/\]/)},{begin:b("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,f]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,f,l]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return u.contains=E,o.contains=E,{name:"Perl",aliases:["pl","pm"],keywords:a,contains:E}}function B7(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,i=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),a=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),u=t.concat(/[A-Z]+/,n),o={scope:"variable",match:"\\$+"+i},f={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},d={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=e.inherit(e.APOS_STRING_MODE,{illegal:null}),h=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(d)}),m={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(d),"on:begin":(B,Z)=>{Z.data._beginMatch=B[1]||B[2]},"on:end":(B,Z)=>{Z.data._beginMatch!==B[1]&&Z.ignoreMatch()}},g=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),b=`[
381
+ ]`,E={scope:"string",variants:[h,l,m,g]},T={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},O=["false","null","true"],v=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],C=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],I={keyword:v,literal:(B=>{const Z=[];return B.forEach(U=>{Z.push(U),U.toLowerCase()===U?Z.push(U.toUpperCase()):Z.push(U.toLowerCase())}),Z})(O),built_in:C},j=B=>B.map(Z=>Z.replace(/\|\d+$/,"")),R={variants:[{match:[/new/,t.concat(b,"+"),t.concat("(?!",j(C).join("\\b|"),"\\b)"),a],scope:{1:"keyword",4:"title.class"}}]},k=t.concat(i,"\\b(?!\\()"),P={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),k],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[a,t.concat(/::/,t.lookahead(/(?!class\b)/)),k],scope:{1:"title.class",3:"variable.constant"}},{match:[a,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[a,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},z={scope:"attr",match:t.concat(i,t.lookahead(":"),t.lookahead(/(?!::)/))},L={relevance:0,begin:/\(/,end:/\)/,keywords:I,contains:[z,o,P,e.C_BLOCK_COMMENT_MODE,E,T,R]},G={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",j(v).join("\\b|"),"|",j(C).join("\\b|"),"\\b)"),i,t.concat(b,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[L]};L.contains.push(G);const F=[z,P,e.C_BLOCK_COMMENT_MODE,E,T,R],K={begin:t.concat(/#\[\s*\\?/,t.either(a,u)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:O,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:O,keyword:["new","array"]},contains:["self",...F]},...F,{scope:"meta",variants:[{match:a},{match:u}]}]};return{case_insensitive:!1,keywords:I,contains:[K,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},f,{scope:"variable.language",match:/\$this\b/},o,G,P,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},R,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:I,contains:["self",K,o,P,e.C_BLOCK_COMMENT_MODE,E,T]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},E,T]}}function U7(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function F7(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function z7(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],f={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},d={className:"meta",begin:/^(>>>|\.\.\.) /},l={className:"subst",begin:/\{/,end:/\}/,keywords:f,illegal:/#/},h={begin:/\{\{/,relevance:0},m={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,d,h,l]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,d,h,l]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,h,l]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,h,l]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},g="[0-9](_?[0-9])*",b=`(\\b(${g}))?\\.(${g})|\\b(${g})\\.`,E=`\\b|${i.join("|")}`,T={className:"number",relevance:0,variants:[{begin:`(\\b(${g})|(${b}))[eE][+-]?(${g})[jJ]?(?=${E})`},{begin:`(${b})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${E})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${E})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${E})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${E})`},{begin:`\\b(${g})[jJ](?=${E})`}]},O={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:f,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},v={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:["self",d,T,m,e.HASH_COMMENT_MODE]}]};return l.contains=[m,T,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:f,illegal:/(<\/|\?)|=>/,contains:[d,T,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},m,O,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[v]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[T,v,m]}]}}function $7(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function q7(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,i=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),a=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,u=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[a,i]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,i]},{scope:{1:"punctuation",2:"number"},match:[u,i]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,i]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:a},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:u},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function G7(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",i=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),a=t.concat(i,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},f={className:"doctag",begin:"@[A-Za-z]+"},d={begin:"#<",end:">"},l=[e.COMMENT("#","$",{contains:[f]}),e.COMMENT("^=begin","^=end",{contains:[f],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],h={className:"subst",begin:/#\{/,end:/\}/,keywords:o},m={className:"string",contains:[e.BACKSLASH_ESCAPE,h],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,h]})]}]},g="[1-9](_?[0-9])*|0",b="[0-9](_?[0-9])*",E={className:"number",relevance:0,variants:[{begin:`\\b(${g})(\\.(${b}))?([eE][+-]?(${b})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},T={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},R=[m,{variants:[{match:[/class\s+/,a,/\s+<\s+/,a]},{match:[/\b(class|module)\s+/,a]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,a],scope:{2:"title.class"},keywords:o},{relevance:0,match:[a,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:i,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[T]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[m,{begin:n}],relevance:0},E,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,h],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(d,l),relevance:0}].concat(d,l);h.contains=R,T.contains=R;const L=[{begin:/^\s*=>/,starts:{end:"$",contains:R}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:R}}];return l.unshift(d),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(L).concat(l).concat(R)}}function K7(e){const t=e.regex,n=/(r#)?/,i=t.concat(n,e.UNDERSCORE_IDENT_RE),a=t.concat(n,e.IDENT_RE),u={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,a,t.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",f=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],d=["true","false","Some","None","Ok","Err"],l=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],h=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:h,keyword:f,literal:d,built_in:l},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+o},{begin:"\\b0o([0-7_]+)"+o},{begin:"\\b0x([A-Fa-f0-9_]+)"+o},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+o}],relevance:0},{begin:[/fn/,/\s+/,i],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,i],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,i,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:l,type:h}},{className:"punctuation",begin:"->"},u]}}const Y7=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),V7=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Z7=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],W7=[...V7,...Z7],X7=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Q7=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),J7=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),e$=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function t$(e){const t=Y7(e),n=J7,i=Q7,a="@[a-z-]+",u="and or not only",f={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+W7.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+i.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},f,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+e$.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,f,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:a,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:u,attribute:X7.join(" ")},contains:[{begin:a,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},f,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function n$(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function r$(e){const t=e.regex,n=e.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},a={begin:/"/,end:/"/,contains:[{match:/""/}]},u=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],f=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],d=["add","asc","collation","desc","final","first","last","view"],l=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],h=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],m=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],g=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],b=h,E=[...l,...d].filter(j=>!h.includes(j)),T={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},O={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},v={match:t.concat(/\b/,t.either(...b),/\s*\(/),relevance:0,keywords:{built_in:b}};function C(j){return t.concat(/\b/,t.either(...j.map(R=>R.replace(/\s+/,"\\s+"))),/\b/)}const x={scope:"keyword",match:C(g),relevance:0};function I(j,{exceptions:R,when:k}={}){const P=k;return R=R||[],j.map(z=>z.match(/\|\d+$/)||R.includes(z)?z:P(z)?`${z}|0`:z)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:I(E,{when:j=>j.length<3}),literal:u,type:f,built_in:m},contains:[{scope:"type",match:C(o)},x,v,T,i,a,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,O]}}function xN(e){return e?typeof e=="string"?e:e.source:null}function md(e){return Zt("(?=",e,")")}function Zt(...e){return e.map(n=>xN(n)).join("")}function i$(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Er(...e){return"("+(i$(e).capture?"":"?:")+e.map(i=>xN(i)).join("|")+")"}const g_=e=>Zt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),s$=["Protocol","Type"].map(g_),MC=["init","self"].map(g_),a$=["Any","Self"],w0=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],PC=["false","nil","true"],o$=["assignment","associativity","higherThan","left","lowerThan","none","right"],c$=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],DC=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],wN=Er(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),RN=Er(wN,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),R0=Zt(wN,RN,"*"),NN=Er(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),im=Er(NN,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),$i=Zt(NN,im,"*"),zh=Zt(/[A-Z]/,im,"*"),l$=["attached","autoclosure",Zt(/convention\(/,Er("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Zt(/objc\(/,$i,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],u$=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function d$(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[e.C_LINE_COMMENT_MODE,n],a={match:[/\./,Er(...s$,...MC)],className:{2:"keyword"}},u={match:Zt(/\./,Er(...w0)),relevance:0},o=w0.filter(Ne=>typeof Ne=="string").concat(["_|0"]),f=w0.filter(Ne=>typeof Ne!="string").concat(a$).map(g_),d={variants:[{className:"keyword",match:Er(...f,...MC)}]},l={$pattern:Er(/\b\w+/,/#\w+/),keyword:o.concat(c$),literal:PC},h=[a,u,d],m={match:Zt(/\./,Er(...DC)),relevance:0},g={className:"built_in",match:Zt(/\b/,Er(...DC),/(?=\()/)},b=[m,g],E={match:/->/,relevance:0},T={className:"operator",relevance:0,variants:[{match:R0},{match:`\\.(\\.|${RN})+`}]},O=[E,T],v="([0-9]_*)+",C="([0-9a-fA-F]_*)+",x={className:"number",relevance:0,variants:[{match:`\\b(${v})(\\.(${v}))?([eE][+-]?(${v}))?\\b`},{match:`\\b0x(${C})(\\.(${C}))?([pP][+-]?(${v}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},I=(Ne="")=>({className:"subst",variants:[{match:Zt(/\\/,Ne,/[0\\tnr"']/)},{match:Zt(/\\/,Ne,/u\{[0-9a-fA-F]{1,8}\}/)}]}),j=(Ne="")=>({className:"subst",match:Zt(/\\/,Ne,/[\t ]*(?:[\r\n]|\r\n)/)}),R=(Ne="")=>({className:"subst",label:"interpol",begin:Zt(/\\/,Ne,/\(/),end:/\)/}),k=(Ne="")=>({begin:Zt(Ne,/"""/),end:Zt(/"""/,Ne),contains:[I(Ne),j(Ne),R(Ne)]}),P=(Ne="")=>({begin:Zt(Ne,/"/),end:Zt(/"/,Ne),contains:[I(Ne),R(Ne)]}),z={className:"string",variants:[k(),k("#"),k("##"),k("###"),P(),P("#"),P("##"),P("###")]},L=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],G={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:L},F=Ne=>{const Ge=Zt(Ne,/\//),pt=Zt(/\//,Ne);return{begin:Ge,end:pt,contains:[...L,{scope:"comment",begin:`#(?!.*${pt})`,end:/$/}]}},K={scope:"regexp",variants:[F("###"),F("##"),F("#"),G]},B={match:Zt(/`/,$i,/`/)},Z={className:"variable",match:/\$\d+/},U={className:"variable",match:`\\$${im}+`},Y=[B,Z,U],W={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:u$,contains:[...O,x,z]}]}},pe={scope:"keyword",match:Zt(/@/,Er(...l$),md(Er(/\(/,/\s+/)))},N={scope:"meta",match:Zt(/@/,$i)},M=[W,pe,N],q={match:md(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Zt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,im,"+")},{className:"type",match:zh,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Zt(/\s+&\s+/,md(zh)),relevance:0}]},D={begin:/</,end:/>/,keywords:l,contains:[...i,...h,...M,E,q]};q.contains.push(D);const ie={match:Zt($i,/\s*:/),keywords:"_|0",relevance:0},ae={begin:/\(/,end:/\)/,relevance:0,keywords:l,contains:["self",ie,...i,K,...h,...b,...O,x,z,...Y,...M,q]},fe={begin:/</,end:/>/,keywords:"repeat each",contains:[...i,q]},Ee={begin:Er(md(Zt($i,/\s*:/)),md(Zt($i,/\s+/,$i,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:$i}]},de={begin:/\(/,end:/\)/,keywords:l,contains:[Ee,...i,...h,...O,x,z,...M,q,ae],endsParent:!0,illegal:/["']/},le={match:[/(func|macro)/,/\s+/,Er(B.match,$i,R0)],className:{1:"keyword",3:"title.function"},contains:[fe,de,t],illegal:[/\[/,/%/]},Pe={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[fe,de,t],illegal:/\[|%/},re={match:[/operator/,/\s+/,R0],className:{1:"keyword",3:"title"}},Ae={begin:[/precedencegroup/,/\s+/,zh],className:{1:"keyword",3:"title"},contains:[q],keywords:[...o$,...PC],end:/}/},Ce={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Me={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},He={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,$i,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:l,contains:[fe,...h,{begin:/:/,end:/\{/,keywords:l,contains:[{scope:"title.class.inherited",match:zh},...h],relevance:0}]};for(const Ne of z.variants){const Ge=Ne.contains.find(it=>it.label==="interpol");Ge.keywords=l;const pt=[...h,...b,...O,x,z,...Y];Ge.contains=[...pt,{begin:/\(/,end:/\)/,contains:["self",...pt]}]}return{name:"Swift",keywords:l,contains:[...i,le,Pe,Ce,Me,He,re,Ae,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},K,...h,...b,...O,x,z,...Y,...M,q,ae]}}const sm="[A-Za-z$_][0-9A-Za-z$_]*",IN=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],kN=["true","false","null","undefined","NaN","Infinity"],MN=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],PN=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],DN=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],jN=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],LN=[].concat(DN,MN,PN);function f$(e){const t=e.regex,n=(W,{after:pe})=>{const N="</"+W[0].slice(1);return W.input.indexOf(N,pe)!==-1},i=sm,a={begin:"<>",end:"</>"},u=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(W,pe)=>{const N=W[0].length+W.index,M=W.input[N];if(M==="<"||M===","){pe.ignoreMatch();return}M===">"&&(n(W,{after:N})||pe.ignoreMatch());let q;const D=W.input.substring(N);if(q=D.match(/^\s*=/)){pe.ignoreMatch();return}if((q=D.match(/^\s+extends\s+/))&&q.index===0){pe.ignoreMatch();return}}},f={$pattern:sm,keyword:IN,literal:kN,built_in:LN,"variable.language":jN},d="[0-9](_?[0-9])*",l=`\\.(${d})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",m={className:"number",variants:[{begin:`(\\b(${h})((${l})|\\.)?|(${l}))[eE][+-]?(${d})\\b`},{begin:`\\b(${h})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},g={className:"subst",begin:"\\$\\{",end:"\\}",keywords:f,contains:[]},b={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,g],subLanguage:"xml"}},E={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,g],subLanguage:"css"}},T={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,g],subLanguage:"graphql"}},O={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,g]},C={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,b,E,T,O,{match:/\$\d+/},m];g.contains=x.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(x)});const I=[].concat(C,g.contains),j=I.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat(I)}]),R={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:j},k={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,t.concat(i,"(",t.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},P={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...MN,...PN]}},z={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},L={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[R],illegal:/%/},G={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(W){return t.concat("(?!",W.join("|"),")")}const K={match:t.concat(/\b/,F([...DN,"super","import"].map(W=>`${W}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},B={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Z={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},R]},U="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",Y={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(U)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[R]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:j,CLASS_REFERENCE:P},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),z,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,b,E,T,O,C,{match:/\$\d+/},m,P,{scope:"attr",match:i+t.lookahead(":"),relevance:0},Y,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[C,e.REGEXP_MODE,{className:"function",begin:U,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:j}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:u},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},L,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[R,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},B,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},K,G,k,Z,{match:/\$[(.]/}]}}function h$(e){const t=e.regex,n=f$(e),i=sm,a=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],u={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:a},contains:[n.exports.CLASS_REFERENCE]},f={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},d=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],l={$pattern:sm,keyword:IN.concat(d),literal:kN,built_in:LN.concat(a),"variable.language":jN},h={className:"meta",begin:"@"+i},m=(T,O,v)=>{const C=T.contains.findIndex(x=>x.label===O);if(C===-1)throw new Error("can not find mode to replace");T.contains.splice(C,1,v)};Object.assign(n.keywords,l),n.exports.PARAMS_CONTAINS.push(h);const g=n.contains.find(T=>T.scope==="attr"),b=Object.assign({},g,{match:t.concat(i,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,g,b]),n.contains=n.contains.concat([h,u,o,b]),m(n,"shebang",e.SHEBANG()),m(n,"use_strict",f);const E=n.contains.find(T=>T.label==="func.def");return E.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function m$(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},i={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},a=/\d{1,2}\/\d{1,2}\/\d{4}/,u=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,f=/\d{1,2}(:\d{1,2}){1,2}/,d={className:"literal",variants:[{begin:t.concat(/# */,t.either(u,a),/ *#/)},{begin:t.concat(/# */,f,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(u,a),/ +/,t.either(o,f),/ *#/)}]},l={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},h={className:"label",begin:/^\w+:/},m=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),g=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,i,d,l,h,m,g,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[g]}]}}function p$(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),i=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],a={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},u={className:"variable",begin:/\$[\w_]+/},o={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},f={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},d={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},l={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:i},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},u,o,a,e.QUOTE_STRING_MODE,d,l,f]}}function g$(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,a={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},u={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(u,{begin:/\(/,end:/\)/}),f=e.inherit(e.APOS_STRING_MODE,{className:"string"}),d=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:i,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[a]},{begin:/'/,end:/'/,contains:[a]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[u,d,f,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[u,o,d,f]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},a,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[d]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:l}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function b$(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},a={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},u={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,a]},f=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),g={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},b={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},E={begin:/\{/,end:/\}/,contains:[b],illegal:"\\n",relevance:0},T={begin:"\\[",end:"\\]",contains:[b],illegal:"\\n",relevance:0},O=[i,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},g,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},E,T,u,o],v=[...O];return v.pop(),v.push(f),b.contains=v,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:O}}const _$={arduino:Jz,bash:e7,c:t7,cpp:n7,csharp:r7,css:f7,diff:h7,go:m7,graphql:p7,ini:g7,java:b7,javascript:T7,json:A7,kotlin:S7,less:M7,lua:P7,makefile:D7,markdown:j7,objectivec:L7,perl:H7,php:B7,"php-template":U7,plaintext:F7,python:z7,"python-repl":$7,r:q7,ruby:G7,rust:K7,scss:t$,shell:n$,sql:r$,swift:d$,typescript:h$,vbnet:m$,wasm:p$,xml:g$,yaml:b$};var N0,jC;function y$(){if(jC)return N0;jC=1;function e(ee){return ee instanceof Map?ee.clear=ee.delete=ee.set=function(){throw new Error("map is read-only")}:ee instanceof Set&&(ee.add=ee.clear=ee.delete=function(){throw new Error("set is read-only")}),Object.freeze(ee),Object.getOwnPropertyNames(ee).forEach(ve=>{const je=ee[ve],rt=typeof je;(rt==="object"||rt==="function")&&!Object.isFrozen(je)&&e(je)}),ee}class t{constructor(ve){ve.data===void 0&&(ve.data={}),this.data=ve.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(ee){return ee.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function i(ee,...ve){const je=Object.create(null);for(const rt in ee)je[rt]=ee[rt];return ve.forEach(function(rt){for(const an in rt)je[an]=rt[an]}),je}const a="</span>",u=ee=>!!ee.scope,o=(ee,{prefix:ve})=>{if(ee.startsWith("language:"))return ee.replace("language:","language-");if(ee.includes(".")){const je=ee.split(".");return[`${ve}${je.shift()}`,...je.map((rt,an)=>`${rt}${"_".repeat(an+1)}`)].join(" ")}return`${ve}${ee}`};class f{constructor(ve,je){this.buffer="",this.classPrefix=je.classPrefix,ve.walk(this)}addText(ve){this.buffer+=n(ve)}openNode(ve){if(!u(ve))return;const je=o(ve.scope,{prefix:this.classPrefix});this.span(je)}closeNode(ve){u(ve)&&(this.buffer+=a)}value(){return this.buffer}span(ve){this.buffer+=`<span class="${ve}">`}}const d=(ee={})=>{const ve={children:[]};return Object.assign(ve,ee),ve};class l{constructor(){this.rootNode=d(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(ve){this.top.children.push(ve)}openNode(ve){const je=d({scope:ve});this.add(je),this.stack.push(je)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(ve){return this.constructor._walk(ve,this.rootNode)}static _walk(ve,je){return typeof je=="string"?ve.addText(je):je.children&&(ve.openNode(je),je.children.forEach(rt=>this._walk(ve,rt)),ve.closeNode(je)),ve}static _collapse(ve){typeof ve!="string"&&ve.children&&(ve.children.every(je=>typeof je=="string")?ve.children=[ve.children.join("")]:ve.children.forEach(je=>{l._collapse(je)}))}}class h extends l{constructor(ve){super(),this.options=ve}addText(ve){ve!==""&&this.add(ve)}startScope(ve){this.openNode(ve)}endScope(){this.closeNode()}__addSublanguage(ve,je){const rt=ve.root;je&&(rt.scope=`language:${je}`),this.add(rt)}toHTML(){return new f(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function m(ee){return ee?typeof ee=="string"?ee:ee.source:null}function g(ee){return T("(?=",ee,")")}function b(ee){return T("(?:",ee,")*")}function E(ee){return T("(?:",ee,")?")}function T(...ee){return ee.map(je=>m(je)).join("")}function O(ee){const ve=ee[ee.length-1];return typeof ve=="object"&&ve.constructor===Object?(ee.splice(ee.length-1,1),ve):{}}function v(...ee){return"("+(O(ee).capture?"":"?:")+ee.map(rt=>m(rt)).join("|")+")"}function C(ee){return new RegExp(ee.toString()+"|").exec("").length-1}function x(ee,ve){const je=ee&&ee.exec(ve);return je&&je.index===0}const I=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function j(ee,{joinWith:ve}){let je=0;return ee.map(rt=>{je+=1;const an=je;let Wt=m(rt),qe="";for(;Wt.length>0;){const Fe=I.exec(Wt);if(!Fe){qe+=Wt;break}qe+=Wt.substring(0,Fe.index),Wt=Wt.substring(Fe.index+Fe[0].length),Fe[0][0]==="\\"&&Fe[1]?qe+="\\"+String(Number(Fe[1])+an):(qe+=Fe[0],Fe[0]==="("&&je++)}return qe}).map(rt=>`(${rt})`).join(ve)}const R=/\b\B/,k="[a-zA-Z]\\w*",P="[a-zA-Z_]\\w*",z="\\b\\d+(\\.\\d+)?",L="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",G="\\b(0b[01]+)",F="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",K=(ee={})=>{const ve=/^#![ ]*\//;return ee.binary&&(ee.begin=T(ve,/.*\b/,ee.binary,/\b.*/)),i({scope:"meta",begin:ve,end:/$/,relevance:0,"on:begin":(je,rt)=>{je.index!==0&&rt.ignoreMatch()}},ee)},B={begin:"\\\\[\\s\\S]",relevance:0},Z={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[B]},U={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[B]},Y={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},W=function(ee,ve,je={}){const rt=i({scope:"comment",begin:ee,end:ve,contains:[]},je);rt.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const an=v("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return rt.contains.push({begin:T(/[ ]+/,"(",an,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),rt},pe=W("//","$"),N=W("/\\*","\\*/"),M=W("#","$"),q={scope:"number",begin:z,relevance:0},D={scope:"number",begin:L,relevance:0},ie={scope:"number",begin:G,relevance:0},ae={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[B,{begin:/\[/,end:/\]/,relevance:0,contains:[B]}]},fe={scope:"title",begin:k,relevance:0},Ee={scope:"title",begin:P,relevance:0},de={begin:"\\.\\s*"+P,relevance:0};var Pe=Object.freeze({__proto__:null,APOS_STRING_MODE:Z,BACKSLASH_ESCAPE:B,BINARY_NUMBER_MODE:ie,BINARY_NUMBER_RE:G,COMMENT:W,C_BLOCK_COMMENT_MODE:N,C_LINE_COMMENT_MODE:pe,C_NUMBER_MODE:D,C_NUMBER_RE:L,END_SAME_AS_BEGIN:function(ee){return Object.assign(ee,{"on:begin":(ve,je)=>{je.data._beginMatch=ve[1]},"on:end":(ve,je)=>{je.data._beginMatch!==ve[1]&&je.ignoreMatch()}})},HASH_COMMENT_MODE:M,IDENT_RE:k,MATCH_NOTHING_RE:R,METHOD_GUARD:de,NUMBER_MODE:q,NUMBER_RE:z,PHRASAL_WORDS_MODE:Y,QUOTE_STRING_MODE:U,REGEXP_MODE:ae,RE_STARTERS_RE:F,SHEBANG:K,TITLE_MODE:fe,UNDERSCORE_IDENT_RE:P,UNDERSCORE_TITLE_MODE:Ee});function re(ee,ve){ee.input[ee.index-1]==="."&&ve.ignoreMatch()}function Ae(ee,ve){ee.className!==void 0&&(ee.scope=ee.className,delete ee.className)}function Ce(ee,ve){ve&&ee.beginKeywords&&(ee.begin="\\b("+ee.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",ee.__beforeBegin=re,ee.keywords=ee.keywords||ee.beginKeywords,delete ee.beginKeywords,ee.relevance===void 0&&(ee.relevance=0))}function Me(ee,ve){Array.isArray(ee.illegal)&&(ee.illegal=v(...ee.illegal))}function He(ee,ve){if(ee.match){if(ee.begin||ee.end)throw new Error("begin & end are not supported with match");ee.begin=ee.match,delete ee.match}}function Ne(ee,ve){ee.relevance===void 0&&(ee.relevance=1)}const Ge=(ee,ve)=>{if(!ee.beforeMatch)return;if(ee.starts)throw new Error("beforeMatch cannot be used with starts");const je=Object.assign({},ee);Object.keys(ee).forEach(rt=>{delete ee[rt]}),ee.keywords=je.keywords,ee.begin=T(je.beforeMatch,g(je.begin)),ee.starts={relevance:0,contains:[Object.assign(je,{endsParent:!0})]},ee.relevance=0,delete je.beforeMatch},pt=["of","and","for","in","not","or","if","then","parent","list","value"],it="keyword";function bt(ee,ve,je=it){const rt=Object.create(null);return typeof ee=="string"?an(je,ee.split(" ")):Array.isArray(ee)?an(je,ee):Object.keys(ee).forEach(function(Wt){Object.assign(rt,bt(ee[Wt],ve,Wt))}),rt;function an(Wt,qe){ve&&(qe=qe.map(Fe=>Fe.toLowerCase())),qe.forEach(function(Fe){const nt=Fe.split("|");rt[nt[0]]=[Wt,jt(nt[0],nt[1])]})}}function jt(ee,ve){return ve?Number(ve):ar(ee)?0:1}function ar(ee){return pt.includes(ee.toLowerCase())}const vt={},Lt=ee=>{console.error(ee)},ni=(ee,...ve)=>{console.log(`WARN: ${ee}`,...ve)},be=(ee,ve)=>{vt[`${ee}/${ve}`]||(console.log(`Deprecated as of ${ee}. ${ve}`),vt[`${ee}/${ve}`]=!0)},xe=new Error;function $e(ee,ve,{key:je}){let rt=0;const an=ee[je],Wt={},qe={};for(let Fe=1;Fe<=ve.length;Fe++)qe[Fe+rt]=an[Fe],Wt[Fe+rt]=!0,rt+=C(ve[Fe-1]);ee[je]=qe,ee[je]._emit=Wt,ee[je]._multi=!0}function ct(ee){if(Array.isArray(ee.begin)){if(ee.skip||ee.excludeBegin||ee.returnBegin)throw Lt("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),xe;if(typeof ee.beginScope!="object"||ee.beginScope===null)throw Lt("beginScope must be object"),xe;$e(ee,ee.begin,{key:"beginScope"}),ee.begin=j(ee.begin,{joinWith:""})}}function wt(ee){if(Array.isArray(ee.end)){if(ee.skip||ee.excludeEnd||ee.returnEnd)throw Lt("skip, excludeEnd, returnEnd not compatible with endScope: {}"),xe;if(typeof ee.endScope!="object"||ee.endScope===null)throw Lt("endScope must be object"),xe;$e(ee,ee.end,{key:"endScope"}),ee.end=j(ee.end,{joinWith:""})}}function qn(ee){ee.scope&&typeof ee.scope=="object"&&ee.scope!==null&&(ee.beginScope=ee.scope,delete ee.scope)}function ri(ee){qn(ee),typeof ee.beginScope=="string"&&(ee.beginScope={_wrap:ee.beginScope}),typeof ee.endScope=="string"&&(ee.endScope={_wrap:ee.endScope}),ct(ee),wt(ee)}function Tn(ee){function ve(qe,Fe){return new RegExp(m(qe),"m"+(ee.case_insensitive?"i":"")+(ee.unicodeRegex?"u":"")+(Fe?"g":""))}class je{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Fe,nt){nt.position=this.position++,this.matchIndexes[this.matchAt]=nt,this.regexes.push([nt,Fe]),this.matchAt+=C(Fe)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Fe=this.regexes.map(nt=>nt[1]);this.matcherRe=ve(j(Fe,{joinWith:"|"}),!0),this.lastIndex=0}exec(Fe){this.matcherRe.lastIndex=this.lastIndex;const nt=this.matcherRe.exec(Fe);if(!nt)return null;const wn=nt.findIndex((Wi,fo)=>fo>0&&Wi!==void 0),fn=this.matchIndexes[wn];return nt.splice(0,wn),Object.assign(nt,fn)}}class rt{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Fe){if(this.multiRegexes[Fe])return this.multiRegexes[Fe];const nt=new je;return this.rules.slice(Fe).forEach(([wn,fn])=>nt.addRule(wn,fn)),nt.compile(),this.multiRegexes[Fe]=nt,nt}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Fe,nt){this.rules.push([Fe,nt]),nt.type==="begin"&&this.count++}exec(Fe){const nt=this.getMatcher(this.regexIndex);nt.lastIndex=this.lastIndex;let wn=nt.exec(Fe);if(this.resumingScanAtSamePosition()&&!(wn&&wn.index===this.lastIndex)){const fn=this.getMatcher(0);fn.lastIndex=this.lastIndex+1,wn=fn.exec(Fe)}return wn&&(this.regexIndex+=wn.position+1,this.regexIndex===this.count&&this.considerAll()),wn}}function an(qe){const Fe=new rt;return qe.contains.forEach(nt=>Fe.addRule(nt.begin,{rule:nt,type:"begin"})),qe.terminatorEnd&&Fe.addRule(qe.terminatorEnd,{type:"end"}),qe.illegal&&Fe.addRule(qe.illegal,{type:"illegal"}),Fe}function Wt(qe,Fe){const nt=qe;if(qe.isCompiled)return nt;[Ae,He,ri,Ge].forEach(fn=>fn(qe,Fe)),ee.compilerExtensions.forEach(fn=>fn(qe,Fe)),qe.__beforeBegin=null,[Ce,Me,Ne].forEach(fn=>fn(qe,Fe)),qe.isCompiled=!0;let wn=null;return typeof qe.keywords=="object"&&qe.keywords.$pattern&&(qe.keywords=Object.assign({},qe.keywords),wn=qe.keywords.$pattern,delete qe.keywords.$pattern),wn=wn||/\w+/,qe.keywords&&(qe.keywords=bt(qe.keywords,ee.case_insensitive)),nt.keywordPatternRe=ve(wn,!0),Fe&&(qe.begin||(qe.begin=/\B|\b/),nt.beginRe=ve(nt.begin),!qe.end&&!qe.endsWithParent&&(qe.end=/\B|\b/),qe.end&&(nt.endRe=ve(nt.end)),nt.terminatorEnd=m(nt.end)||"",qe.endsWithParent&&Fe.terminatorEnd&&(nt.terminatorEnd+=(qe.end?"|":"")+Fe.terminatorEnd)),qe.illegal&&(nt.illegalRe=ve(qe.illegal)),qe.contains||(qe.contains=[]),qe.contains=[].concat(...qe.contains.map(function(fn){return or(fn==="self"?qe:fn)})),qe.contains.forEach(function(fn){Wt(fn,nt)}),qe.starts&&Wt(qe.starts,Fe),nt.matcher=an(nt),nt}if(ee.compilerExtensions||(ee.compilerExtensions=[]),ee.contains&&ee.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return ee.classNameAliases=i(ee.classNameAliases||{}),Wt(ee)}function An(ee){return ee?ee.endsWithParent||An(ee.starts):!1}function or(ee){return ee.variants&&!ee.cachedVariants&&(ee.cachedVariants=ee.variants.map(function(ve){return i(ee,{variants:null},ve)})),ee.cachedVariants?ee.cachedVariants:An(ee)?i(ee,{starts:ee.starts?i(ee.starts):null}):Object.isFrozen(ee)?i(ee):ee}var Ft="11.11.1";class Li extends Error{constructor(ve,je){super(ve),this.name="HTMLInjectionError",this.html=je}}const mr=n,uf=i,ya=Symbol("nomatch"),uo=7,Ea=function(ee){const ve=Object.create(null),je=Object.create(null),rt=[];let an=!0;const Wt="Could not find the language '{}', did you forget to load/include a language module?",qe={disableAutodetect:!0,name:"Plain text",contains:[]};let Fe={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:h};function nt(Re){return Fe.noHighlightRe.test(Re)}function wn(Re){let We=Re.className+" ";We+=Re.parentNode?Re.parentNode.className:"";const _t=Fe.languageDetectRe.exec(We);if(_t){const zt=pr(_t[1]);return zt||(ni(Wt.replace("{}",_t[1])),ni("Falling back to no-highlight mode for this block.",Re)),zt?_t[1]:"no-highlight"}return We.split(/\s+/).find(zt=>nt(zt)||pr(zt))}function fn(Re,We,_t){let zt="",Nn="";typeof We=="object"?(zt=Re,_t=We.ignoreIllegals,Nn=We.language):(be("10.7.0","highlight(lang, code, ...args) has been deprecated."),be("10.7.0",`Please use highlight(code, options) instead.
382
+ https://github.com/highlightjs/highlight.js/issues/2277`),Nn=Re,zt=We),_t===void 0&&(_t=!0);const lr={code:zt,language:Nn};Ta("before:highlight",lr);const Lr=lr.result?lr.result:Wi(lr.language,lr.code,_t);return Lr.code=lr.code,Ta("after:highlight",Lr),Lr}function Wi(Re,We,_t,zt){const Nn=Object.create(null);function lr(De,Ke){return De.keywords[Ke]}function Lr(){if(!tt.keywords){Dn.addText($t);return}let De=0;tt.keywordPatternRe.lastIndex=0;let Ke=tt.keywordPatternRe.exec($t),at="";for(;Ke;){at+=$t.substring(De,Ke.index);const St=Vn.case_insensitive?Ke[0].toLowerCase():Ke[0],_n=lr(tt,St);if(_n){const[ii,Mc]=_n;if(Dn.addText(at),at="",Nn[St]=(Nn[St]||0)+1,Nn[St]<=uo&&(Ps+=Mc),ii.startsWith("_"))at+=Ke[0];else{const bf=Vn.classNameAliases[ii]||ii;Hr(Ke[0],bf)}}else at+=Ke[0];De=tt.keywordPatternRe.lastIndex,Ke=tt.keywordPatternRe.exec($t)}at+=$t.substring(De),Dn.addText(at)}function Or(){if($t==="")return;let De=null;if(typeof tt.subLanguage=="string"){if(!ve[tt.subLanguage]){Dn.addText($t);return}De=Wi(tt.subLanguage,$t,!0,gf[tt.subLanguage]),gf[tt.subLanguage]=De._top}else De=ho($t,tt.subLanguage.length?tt.subLanguage:null);tt.relevance>0&&(Ps+=De.relevance),Dn.__addSublanguage(De._emitter,De.language)}function en(){tt.subLanguage!=null?Or():Lr(),$t=""}function Hr(De,Ke){De!==""&&(Dn.startScope(Ke),Dn.addText(De),Dn.endScope())}function mf(De,Ke){let at=1;const St=Ke.length-1;for(;at<=St;){if(!De._emit[at]){at++;continue}const _n=Vn.classNameAliases[De[at]]||De[at],ii=Ke[at];_n?Hr(ii,_n):($t=ii,Lr(),$t=""),at++}}function po(De,Ke){return De.scope&&typeof De.scope=="string"&&Dn.openNode(Vn.classNameAliases[De.scope]||De.scope),De.beginScope&&(De.beginScope._wrap?(Hr($t,Vn.classNameAliases[De.beginScope._wrap]||De.beginScope._wrap),$t=""):De.beginScope._multi&&(mf(De.beginScope,Ke),$t="")),tt=Object.create(De,{parent:{value:tt}}),tt}function Nc(De,Ke,at){let St=x(De.endRe,at);if(St){if(De["on:end"]){const _n=new t(De);De["on:end"](Ke,_n),_n.isMatchIgnored&&(St=!1)}if(St){for(;De.endsParent&&De.parent;)De=De.parent;return De}}if(De.endsWithParent)return Nc(De.parent,Ke,at)}function go(De){return tt.matcher.regexIndex===0?($t+=De[0],1):(Ds=!0,0)}function Im(De){const Ke=De[0],at=De.rule,St=new t(at),_n=[at.__beforeBegin,at["on:begin"]];for(const ii of _n)if(ii&&(ii(De,St),St.isMatchIgnored))return go(Ke);return at.skip?$t+=Ke:(at.excludeBegin&&($t+=Ke),en(),!at.returnBegin&&!at.excludeBegin&&($t=Ke)),po(at,De),at.returnBegin?0:Ke.length}function Sr(De){const Ke=De[0],at=We.substring(De.index),St=Nc(tt,De,at);if(!St)return ya;const _n=tt;tt.endScope&&tt.endScope._wrap?(en(),Hr(Ke,tt.endScope._wrap)):tt.endScope&&tt.endScope._multi?(en(),mf(tt.endScope,De)):_n.skip?$t+=Ke:(_n.returnEnd||_n.excludeEnd||($t+=Ke),en(),_n.excludeEnd&&($t=Ke));do tt.scope&&Dn.closeNode(),!tt.skip&&!tt.subLanguage&&(Ps+=tt.relevance),tt=tt.parent;while(tt!==St.parent);return St.starts&&po(St.starts,De),_n.returnEnd?0:Ke.length}function Ic(){const De=[];for(let Ke=tt;Ke!==Vn;Ke=Ke.parent)Ke.scope&&De.unshift(Ke.scope);De.forEach(Ke=>Dn.openNode(Ke))}let Aa={};function bo(De,Ke){const at=Ke&&Ke[0];if($t+=De,at==null)return en(),0;if(Aa.type==="begin"&&Ke.type==="end"&&Aa.index===Ke.index&&at===""){if($t+=We.slice(Ke.index,Ke.index+1),!an){const St=new Error(`0 width match regex (${Re})`);throw St.languageName=Re,St.badRule=Aa.rule,St}return 1}if(Aa=Ke,Ke.type==="begin")return Im(Ke);if(Ke.type==="illegal"&&!_t){const St=new Error('Illegal lexeme "'+at+'" for mode "'+(tt.scope||"<unnamed>")+'"');throw St.mode=tt,St}else if(Ke.type==="end"){const St=Sr(Ke);if(St!==ya)return St}if(Ke.type==="illegal"&&at==="")return $t+=`
383
+ `,1;if(kc>1e5&&kc>Ke.index*3)throw new Error("potential infinite loop, way more iterations than matches");return $t+=at,at.length}const Vn=pr(Re);if(!Vn)throw Lt(Wt.replace("{}",Re)),new Error('Unknown language: "'+Re+'"');const pf=Tn(Vn);let _o="",tt=zt||pf;const gf={},Dn=new Fe.__emitter(Fe);Ic();let $t="",Ps=0,Ji=0,kc=0,Ds=!1;try{if(Vn.__emitTokens)Vn.__emitTokens(We,Dn);else{for(tt.matcher.considerAll();;){kc++,Ds?Ds=!1:tt.matcher.considerAll(),tt.matcher.lastIndex=Ji;const De=tt.matcher.exec(We);if(!De)break;const Ke=We.substring(Ji,De.index),at=bo(Ke,De);Ji=De.index+at}bo(We.substring(Ji))}return Dn.finalize(),_o=Dn.toHTML(),{language:Re,value:_o,relevance:Ps,illegal:!1,_emitter:Dn,_top:tt}}catch(De){if(De.message&&De.message.includes("Illegal"))return{language:Re,value:mr(We),illegal:!0,relevance:0,_illegalBy:{message:De.message,index:Ji,context:We.slice(Ji-100,Ji+100),mode:De.mode,resultSoFar:_o},_emitter:Dn};if(an)return{language:Re,value:mr(We),illegal:!1,relevance:0,errorRaised:De,_emitter:Dn,_top:tt};throw De}}function fo(Re){const We={value:mr(Re),illegal:!1,relevance:0,_top:qe,_emitter:new Fe.__emitter(Fe)};return We._emitter.addText(Re),We}function ho(Re,We){We=We||Fe.languages||Object.keys(ve);const _t=fo(Re),zt=We.filter(pr).filter(ks).map(en=>Wi(en,Re,!1));zt.unshift(_t);const Nn=zt.sort((en,Hr)=>{if(en.relevance!==Hr.relevance)return Hr.relevance-en.relevance;if(en.language&&Hr.language){if(pr(en.language).supersetOf===Hr.language)return 1;if(pr(Hr.language).supersetOf===en.language)return-1}return 0}),[lr,Lr]=Nn,Or=lr;return Or.secondBest=Lr,Or}function Hi(Re,We,_t){const zt=We&&je[We]||_t;Re.classList.add("hljs"),Re.classList.add(`language-${zt}`)}function Rn(Re){let We=null;const _t=wn(Re);if(nt(_t))return;if(Ta("before:highlightElement",{el:Re,language:_t}),Re.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",Re);return}if(Re.children.length>0&&(Fe.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(Re)),Fe.throwUnescapedHTML))throw new Li("One of your code blocks includes unescaped HTML.",Re.innerHTML);We=Re;const zt=We.textContent,Nn=_t?fn(zt,{language:_t,ignoreIllegals:!0}):ho(zt);Re.innerHTML=Nn.value,Re.dataset.highlighted="yes",Hi(Re,_t,Nn.language),Re.result={language:Nn.language,re:Nn.relevance,relevance:Nn.relevance},Nn.secondBest&&(Re.secondBest={language:Nn.secondBest.language,relevance:Nn.secondBest.relevance}),Ta("after:highlightElement",{el:Re,result:Nn,text:zt})}function cr(Re){Fe=uf(Fe,Re)}const Is=()=>{mo(),be("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function wc(){mo(),be("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let df=!1;function mo(){function Re(){mo()}if(document.readyState==="loading"){df||window.addEventListener("DOMContentLoaded",Re,!1),df=!0;return}document.querySelectorAll(Fe.cssSelector).forEach(Rn)}function ff(Re,We){let _t=null;try{_t=We(ee)}catch(zt){if(Lt("Language definition for '{}' could not be registered.".replace("{}",Re)),an)Lt(zt);else throw zt;_t=qe}_t.name||(_t.name=Re),ve[Re]=_t,_t.rawDefinition=We.bind(null,ee),_t.aliases&&Xi(_t.aliases,{languageName:Re})}function va(Re){delete ve[Re];for(const We of Object.keys(je))je[We]===Re&&delete je[We]}function Rc(){return Object.keys(ve)}function pr(Re){return Re=(Re||"").toLowerCase(),ve[Re]||ve[je[Re]]}function Xi(Re,{languageName:We}){typeof Re=="string"&&(Re=[Re]),Re.forEach(_t=>{je[_t.toLowerCase()]=We})}function ks(Re){const We=pr(Re);return We&&!We.disableAutodetect}function Ms(Re){Re["before:highlightBlock"]&&!Re["before:highlightElement"]&&(Re["before:highlightElement"]=We=>{Re["before:highlightBlock"](Object.assign({block:We.el},We))}),Re["after:highlightBlock"]&&!Re["after:highlightElement"]&&(Re["after:highlightElement"]=We=>{Re["after:highlightBlock"](Object.assign({block:We.el},We))})}function Pn(Re){Ms(Re),rt.push(Re)}function hf(Re){const We=rt.indexOf(Re);We!==-1&&rt.splice(We,1)}function Ta(Re,We){const _t=Re;rt.forEach(function(zt){zt[_t]&&zt[_t](We)})}function Qi(Re){return be("10.7.0","highlightBlock will be removed entirely in v12.0"),be("10.7.0","Please use highlightElement now."),Rn(Re)}Object.assign(ee,{highlight:fn,highlightAuto:ho,highlightAll:mo,highlightElement:Rn,highlightBlock:Qi,configure:cr,initHighlighting:Is,initHighlightingOnLoad:wc,registerLanguage:ff,unregisterLanguage:va,listLanguages:Rc,getLanguage:pr,registerAliases:Xi,autoDetection:ks,inherit:uf,addPlugin:Pn,removePlugin:hf}),ee.debugMode=function(){an=!1},ee.safeMode=function(){an=!0},ee.versionString=Ft,ee.regex={concat:T,lookahead:g,either:v,optional:E,anyNumberOfTimes:b};for(const Re in Pe)typeof Pe[Re]=="object"&&e(Pe[Re]);return Object.assign(ee,Pe),ee},Ar=Ea({});return Ar.newInstance=()=>Ea({}),N0=Ar,Ar.HighlightJS=Ar,Ar.default=Ar,N0}var E$=y$();const v$=bc(E$),LC={},T$="hljs-";function A$(e){const t=v$.newInstance();return e&&u(e),{highlight:n,highlightAuto:i,listLanguages:a,register:u,registerAlias:o,registered:f};function n(d,l,h){const m=h||LC,g=typeof m.prefix=="string"?m.prefix:T$;if(!t.getLanguage(d))throw new Error("Unknown language: `"+d+"` is not registered");t.configure({__emitter:O$,classPrefix:g});const b=t.highlight(l,{ignoreIllegals:!0,language:d});if(b.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:b.errorRaised});const E=b._emitter.root,T=E.data;return T.language=b.language,T.relevance=b.relevance,E}function i(d,l){const m=(l||LC).subset||a();let g=-1,b=0,E;for(;++g<m.length;){const T=m[g];if(!t.getLanguage(T))continue;const O=n(T,d,l);O.data&&O.data.relevance!==void 0&&O.data.relevance>b&&(b=O.data.relevance,E=O)}return E||{type:"root",children:[],data:{language:void 0,relevance:b}}}function a(){return t.listLanguages()}function u(d,l){if(typeof d=="string")t.registerLanguage(d,l);else{let h;for(h in d)Object.hasOwn(d,h)&&t.registerLanguage(h,d[h])}}function o(d,l){if(typeof d=="string")t.registerAliases(typeof l=="string"?l:[...l],{languageName:d});else{let h;for(h in d)if(Object.hasOwn(d,h)){const m=d[h];t.registerAliases(typeof m=="string"?m:[...m],{languageName:h})}}}function f(d){return!!t.getLanguage(d)}}class O${constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],i=n.children[n.children.length-1];i&&i.type==="text"?i.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const i=this.stack[this.stack.length-1],a=t.root.children;n?i.children.push({type:"element",tagName:"span",properties:{className:[n]},children:a}):i.children.push(...a)}openNode(t){const n=this,i=t.split(".").map(function(o,f){return f?o+"_".repeat(f):n.options.classPrefix+o}),a=this.stack[this.stack.length-1],u={type:"element",tagName:"span",properties:{className:i},children:[]};a.children.push(u),this.stack.push(u)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const S$={};function C$(e){const t=e||S$,n=t.aliases,i=t.detect||!1,a=t.languages||_$,u=t.plainText,o=t.prefix,f=t.subset;let d="hljs";const l=A$(a);if(n&&l.registerAlias(n),o){const h=o.indexOf("-");d=h===-1?o:o.slice(0,h)}return function(h,m){sf(h,"element",function(g,b,E){if(g.tagName!=="code"||!E||E.type!=="element"||E.tagName!=="pre")return;const T=x$(g);if(T===!1||!T&&!i||T&&u&&u.includes(T))return;Array.isArray(g.properties.className)||(g.properties.className=[]),g.properties.className.includes(d)||g.properties.className.unshift(d);const O=Gz(g,{whitespace:"pre"});let v;try{v=T?l.highlight(T,O,{prefix:o}):l.highlightAuto(O,{prefix:o,subset:f})}catch(C){const x=C;if(T&&/Unknown language/.test(x.message)){m.message("Cannot highlight as `"+T+"`, it’s not registered",{ancestors:[E,g],cause:x,place:g.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw x}!T&&v.data&&v.data.language&&g.properties.className.push("language-"+v.data.language),v.children.length>0&&(g.children=v.children)})}}function x$(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let i;for(;++n<t.length;){const a=String(t[n]);if(a==="no-highlight"||a==="nohighlight")return!1;!i&&a.slice(0,5)==="lang-"&&(i=a.slice(5)),!i&&a.slice(0,9)==="language-"&&(i=a.slice(9))}return i}const HC=/[#.]/g;function w$(e,t){const n=e||"",i={};let a=0,u,o;for(;a<n.length;){HC.lastIndex=a;const f=HC.exec(n),d=n.slice(a,f?f.index:n.length);d&&(u?u==="#"?i.id=d:Array.isArray(i.className)?i.className.push(d):i.className=[d]:o=d,a+=d.length),f&&(u=f[0],a++)}return{type:"element",tagName:o||t||"div",properties:i,children:[]}}function HN(e,t,n){const i=n?k$(n):void 0;function a(u,o,...f){let d;if(u==null){d={type:"root",children:[]};const l=o;f.unshift(l)}else{d=w$(u,t);const l=d.tagName.toLowerCase(),h=i?i.get(l):void 0;if(d.tagName=h||l,R$(o))f.unshift(o);else for(const[m,g]of Object.entries(o))N$(e,d.properties,m,g)}for(const l of f)ub(d.children,l);return d.type==="element"&&d.tagName==="template"&&(d.content={type:"root",children:d.children},d.children=[]),d}return a}function R$(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const i of n){const a=t[i];if(a&&typeof a=="object"){if(!Array.isArray(a))return!0;const u=a;for(const o of u)if(typeof o!="number"&&typeof o!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function N$(e,t,n,i){const a=e_(e,n);let u;if(i!=null){if(typeof i=="number"){if(Number.isNaN(i))return;u=i}else typeof i=="boolean"?u=i:typeof i=="string"?a.spaceSeparated?u=BS(i):a.commaSeparated?u=PS(i):a.commaOrSpaceSeparated?u=BS(PS(i).join(" ")):u=BC(a,a.property,i):Array.isArray(i)?u=[...i]:u=a.property==="style"?I$(i):String(i);if(Array.isArray(u)){const o=[];for(const f of u)o.push(BC(a,a.property,f));u=o}a.property==="className"&&Array.isArray(t.className)&&(u=t.className.concat(u)),t[a.property]=u}}function ub(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)ub(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?ub(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function BC(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Fd(n)===Fd(t)))return!0}return n}function I$(e){const t=[];for(const[n,i]of Object.entries(e))t.push([n,i].join(": "));return t.join("; ")}function k$(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const M$=["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"],P$=HN(vm,"div"),D$=HN(Tc,"g",M$);function j$(e){const t=String(e),n=[];return{toOffset:a,toPoint:i};function i(u){if(typeof u=="number"&&u>-1&&u<=t.length){let o=0;for(;;){let f=n[o];if(f===void 0){const d=UC(t,n[o-1]);f=d===-1?t.length+1:d+1,n[o]=f}if(f>u)return{line:o+1,column:u-(o>0?n[o-1]:0)+1,offset:u};o++}}}function a(u){if(u&&typeof u.line=="number"&&typeof u.column=="number"&&!Number.isNaN(u.line)&&!Number.isNaN(u.column)){for(;n.length<u.line;){const f=n[n.length-1],d=UC(t,f),l=d===-1?t.length+1:d+1;if(f===l)break;n.push(l)}const o=(u.line>1?n[u.line-2]:0)+u.column-1;if(o<n[u.line-1])return o}}}function UC(e,t){const n=e.indexOf("\r",t),i=e.indexOf(`
384
+ `,t);return i===-1?n:n===-1||n+1===i?i:n<i?n:i}const no={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/"},BN={}.hasOwnProperty,L$=Object.prototype;function H$(e,t){const n=t||{};return b_({file:n.file||void 0,location:!1,schema:n.space==="svg"?Tc:vm,verbose:n.verbose||!1},e)}function b_(e,t){let n;switch(t.nodeName){case"#comment":{const i=t;return n={type:"comment",value:i.data},Kh(e,i,n),n}case"#document":case"#document-fragment":{const i=t,a="mode"in i?i.mode==="quirks"||i.mode==="limited-quirks":!1;if(n={type:"root",children:UN(e,t.childNodes),data:{quirksMode:a}},e.file&&e.location){const u=String(e.file),o=j$(u),f=o.toPoint(0),d=o.toPoint(u.length);n.position={start:f,end:d}}return n}case"#documentType":{const i=t;return n={type:"doctype"},Kh(e,i,n),n}case"#text":{const i=t;return n={type:"text",value:i.value},Kh(e,i,n),n}default:return n=B$(e,t),n}}function UN(e,t){let n=-1;const i=[];for(;++n<t.length;){const a=b_(e,t[n]);i.push(a)}return i}function B$(e,t){const n=e.schema;e.schema=t.namespaceURI===no.svg?Tc:vm;let i=-1;const a={};for(;++i<t.attrs.length;){const f=t.attrs[i],d=(f.prefix?f.prefix+":":"")+f.name;BN.call(L$,d)||(a[d]=f.value)}const o=(e.schema.space==="svg"?D$:P$)(t.tagName,a,UN(e,t.childNodes));if(Kh(e,t,o),o.tagName==="template"){const f=t,d=f.sourceCodeLocation,l=d&&d.startTag&&cc(d.startTag),h=d&&d.endTag&&cc(d.endTag),m=b_(e,f.content);l&&h&&e.file&&(m.position={start:l.end,end:h.start}),o.content=m}return e.schema=n,o}function Kh(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const i=U$(e,n,t.sourceCodeLocation);i&&(e.location=!0,n.position=i)}}function U$(e,t,n){const i=cc(n);if(t.type==="element"){const a=t.children[t.children.length-1];if(i&&!n.endTag&&a&&a.position&&a.position.end&&(i.end=Object.assign({},a.position.end)),e.verbose){const u={};let o;if(n.attrs)for(o in n.attrs)BN.call(n.attrs,o)&&(u[e_(e.schema,o).property]=cc(n.attrs[o]));n.startTag;const f=cc(n.startTag),d=n.endTag?cc(n.endTag):void 0,l={opening:f};d&&(l.closing=d),l.properties=u,t.data={position:l}}}return i}function cc(e){const t=FC({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=FC({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function FC(e){return e.line&&e.column?e:void 0}class of{constructor(t,n,i){this.property=t,this.normal=n,i&&(this.space=i)}}of.prototype.property={};of.prototype.normal={};of.prototype.space=null;function FN(e,t){const n={},i={};let a=-1;for(;++a<e.length;)Object.assign(n,e[a].property),Object.assign(i,e[a].normal);return new of(n,i,t)}function db(e){return e.toLowerCase()}class Ti{constructor(t,n){this.property=t,this.attribute=n}}Ti.prototype.space=null;Ti.prototype.boolean=!1;Ti.prototype.booleanish=!1;Ti.prototype.overloadedBoolean=!1;Ti.prototype.number=!1;Ti.prototype.commaSeparated=!1;Ti.prototype.spaceSeparated=!1;Ti.prototype.commaOrSpaceSeparated=!1;Ti.prototype.mustUseProperty=!1;Ti.prototype.defined=!1;let F$=0;const ut=co(),Fn=co(),zN=co(),ke=co(),nn=co(),dc=co(),Qr=co();function co(){return 2**++F$}const fb=Object.freeze(Object.defineProperty({__proto__:null,boolean:ut,booleanish:Fn,commaOrSpaceSeparated:Qr,commaSeparated:dc,number:ke,overloadedBoolean:zN,spaceSeparated:nn},Symbol.toStringTag,{value:"Module"})),I0=Object.keys(fb);class __ extends Ti{constructor(t,n,i,a){let u=-1;if(super(t,n),zC(this,"space",a),typeof i=="number")for(;++u<I0.length;){const o=I0[u];zC(this,I0[u],(i&fb[o])===fb[o])}}}__.prototype.defined=!0;function zC(e,t,n){n&&(e[t]=n)}const z$={}.hasOwnProperty;function Oc(e){const t={},n={};let i;for(i in e.properties)if(z$.call(e.properties,i)){const a=e.properties[i],u=new __(i,e.transform(e.attributes||{},i),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(u.mustUseProperty=!0),t[i]=u,n[db(i)]=i,n[db(u.attribute)]=i}return new of(t,n,e.space)}const $N=Oc({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),qN=Oc({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function GN(e,t){return t in e?e[t]:t}function KN(e,t){return GN(e,t.toLowerCase())}const YN=Oc({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:KN,properties:{xmlns:null,xmlnsXLink:null}}),VN=Oc({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:Fn,ariaAutoComplete:null,ariaBusy:Fn,ariaChecked:Fn,ariaColCount:ke,ariaColIndex:ke,ariaColSpan:ke,ariaControls:nn,ariaCurrent:null,ariaDescribedBy:nn,ariaDetails:null,ariaDisabled:Fn,ariaDropEffect:nn,ariaErrorMessage:null,ariaExpanded:Fn,ariaFlowTo:nn,ariaGrabbed:Fn,ariaHasPopup:null,ariaHidden:Fn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:nn,ariaLevel:ke,ariaLive:null,ariaModal:Fn,ariaMultiLine:Fn,ariaMultiSelectable:Fn,ariaOrientation:null,ariaOwns:nn,ariaPlaceholder:null,ariaPosInSet:ke,ariaPressed:Fn,ariaReadOnly:Fn,ariaRelevant:null,ariaRequired:Fn,ariaRoleDescription:nn,ariaRowCount:ke,ariaRowIndex:ke,ariaRowSpan:ke,ariaSelected:Fn,ariaSetSize:ke,ariaSort:null,ariaValueMax:ke,ariaValueMin:ke,ariaValueNow:ke,ariaValueText:null,role:null}}),$$=Oc({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:KN,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:dc,acceptCharset:nn,accessKey:nn,action:null,allow:null,allowFullScreen:ut,allowPaymentRequest:ut,allowUserMedia:ut,alt:null,as:null,async:ut,autoCapitalize:null,autoComplete:nn,autoFocus:ut,autoPlay:ut,blocking:nn,capture:null,charSet:null,checked:ut,cite:null,className:nn,cols:ke,colSpan:null,content:null,contentEditable:Fn,controls:ut,controlsList:nn,coords:ke|dc,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ut,defer:ut,dir:null,dirName:null,disabled:ut,download:zN,draggable:Fn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ut,formTarget:null,headers:nn,height:ke,hidden:ut,high:ke,href:null,hrefLang:null,htmlFor:nn,httpEquiv:nn,id:null,imageSizes:null,imageSrcSet:null,inert:ut,inputMode:null,integrity:null,is:null,isMap:ut,itemId:null,itemProp:nn,itemRef:nn,itemScope:ut,itemType:nn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ut,low:ke,manifest:null,max:null,maxLength:ke,media:null,method:null,min:null,minLength:ke,multiple:ut,muted:ut,name:null,nonce:null,noModule:ut,noValidate:ut,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:ut,optimum:ke,pattern:null,ping:nn,placeholder:null,playsInline:ut,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ut,referrerPolicy:null,rel:nn,required:ut,reversed:ut,rows:ke,rowSpan:ke,sandbox:nn,scope:null,scoped:ut,seamless:ut,selected:ut,shadowRootClonable:ut,shadowRootDelegatesFocus:ut,shadowRootMode:null,shape:null,size:ke,sizes:null,slot:null,span:ke,spellCheck:Fn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ke,step:null,style:null,tabIndex:ke,target:null,title:null,translate:null,type:null,typeMustMatch:ut,useMap:null,value:Fn,width:ke,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:nn,axis:null,background:null,bgColor:null,border:ke,borderColor:null,bottomMargin:ke,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ut,declare:ut,event:null,face:null,frame:null,frameBorder:null,hSpace:ke,leftMargin:ke,link:null,longDesc:null,lowSrc:null,marginHeight:ke,marginWidth:ke,noResize:ut,noHref:ut,noShade:ut,noWrap:ut,object:null,profile:null,prompt:null,rev:null,rightMargin:ke,rules:null,scheme:null,scrolling:Fn,standby:null,summary:null,text:null,topMargin:ke,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ke,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ut,disableRemotePlayback:ut,prefix:null,property:null,results:ke,security:null,unselectable:null}}),q$=Oc({space:"svg",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"},transform:GN,properties:{about:Qr,accentHeight:ke,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ke,amplitude:ke,arabicForm:null,ascent:ke,attributeName:null,attributeType:null,azimuth:ke,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ke,by:null,calcMode:null,capHeight:ke,className:nn,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:ke,diffuseConstant:ke,direction:null,display:null,dur:null,divisor:ke,dominantBaseline:null,download:ut,dx:null,dy:null,edgeMode:null,editable:null,elevation:ke,enableBackground:null,end:null,event:null,exponent:ke,externalResourcesRequired:null,fill:null,fillOpacity:ke,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:dc,g2:dc,glyphName:dc,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ke,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ke,horizOriginX:ke,horizOriginY:ke,id:null,ideographic:ke,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ke,k:ke,k1:ke,k2:ke,k3:ke,k4:ke,kernelMatrix:Qr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ke,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:ke,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:ke,overlineThickness:ke,paintOrder:null,panose1:null,path:null,pathLength:ke,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:nn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ke,pointsAtY:ke,pointsAtZ:ke,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Qr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Qr,rev:Qr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Qr,requiredFeatures:Qr,requiredFonts:Qr,requiredFormats:Qr,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:ke,specularExponent:ke,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ke,strikethroughThickness:ke,string:null,stroke:null,strokeDashArray:Qr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ke,strokeOpacity:ke,strokeWidth:null,style:null,surfaceScale:ke,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Qr,tabIndex:ke,tableValues:null,target:null,targetX:ke,targetY:ke,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Qr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ke,underlineThickness:ke,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ke,values:null,vAlphabetic:ke,vMathematical:ke,vectorEffect:null,vHanging:ke,vIdeographic:ke,version:null,vertAdvY:ke,vertOriginX:ke,vertOriginY:ke,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ke,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),G$=/^data[-\w.:]+$/i,$C=/-[a-z]/g,K$=/[A-Z]/g;function Y$(e,t){const n=db(t);let i=t,a=Ti;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&G$.test(t)){if(t.charAt(4)==="-"){const u=t.slice(5).replace($C,Z$);i="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=t.slice(4);if(!$C.test(u)){let o=u.replace(K$,V$);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}a=__}return new a(i,t)}function V$(e){return"-"+e.toLowerCase()}function Z$(e){return e.charAt(1).toUpperCase()}const W$=FN([qN,$N,YN,VN,$$],"html"),ZN=FN([qN,$N,YN,VN,q$],"svg"),X$={},Q$={}.hasOwnProperty,WN=XR("type",{handlers:{root:eq,element:sq,text:rq,comment:iq,doctype:nq}});function J$(e,t){const i=(t||X$).space;return WN(e,i==="svg"?ZN:W$)}function eq(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=y_(e.children,n,t),Sc(e,n),n}function tq(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=y_(e.children,n,t),Sc(e,n),n}function nq(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Sc(e,t),t}function rq(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Sc(e,t),t}function iq(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Sc(e,t),t}function sq(e,t){const n=t;let i=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(i=ZN);const a=[];let u;if(e.properties){for(u in e.properties)if(u!=="children"&&Q$.call(e.properties,u)){const d=aq(i,u,e.properties[u]);d&&a.push(d)}}const o=i.space,f={nodeName:e.tagName,tagName:e.tagName,attrs:a,namespaceURI:no[o],childNodes:[],parentNode:null};return f.childNodes=y_(e.children,f,i),Sc(e,f),e.tagName==="template"&&e.content&&(f.content=tq(e.content,i)),f}function aq(e,t,n){const i=Y$(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&i.boolean)return;Array.isArray(n)&&(n=i.commaSeparated?dR(n):yR(n));const a={name:i.attribute,value:n===!0?"":String(n)};if(i.space&&i.space!=="html"&&i.space!=="svg"){const u=a.name.indexOf(":");u<0?a.prefix="":(a.name=a.name.slice(u+1),a.prefix=i.attribute.slice(0,u)),a.namespace=no[i.space]}return a}function y_(e,t,n){let i=-1;const a=[];if(e)for(;++i<e.length;){const u=WN(e[i],n);u.parentNode=t,a.push(u)}return a}function Sc(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.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 oq=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],cq=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]),mn="īŋŊ";var $;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})($||($={}));const Mr={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function XN(e){return e>=55296&&e<=57343}function lq(e){return e>=56320&&e<=57343}function uq(e,t){return(e-55296)*1024+9216+t}function QN(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function JN(e){return e>=64976&&e<=65007||cq.has(e)}var ge;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(ge||(ge={}));const dq=65536;class fq{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=dq,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(t,n){const{line:i,col:a,offset:u}=this,o=a+n,f=u+n;return{code:t,startLine:i,endLine:i,startCol:o,endCol:o,startOffset:f,endOffset:f}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(lq(n))return this.pos++,this._addGap(),uq(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,$.EOF;return this._err(ge.surrogateInInputStream),t}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(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let i=0;i<t.length;i++)if((this.html.charCodeAt(this.pos+i)|32)!==t.charCodeAt(i))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,$.EOF;const i=this.html.charCodeAt(n);return i===$.CARRIAGE_RETURN?$.LINE_FEED:i}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,$.EOF;let t=this.html.charCodeAt(this.pos);return t===$.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,$.LINE_FEED):t===$.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,XN(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===$.LINE_FEED||t===$.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){QN(t)?this._err(ge.controlCharacterInInputStream):JN(t)&&this._err(ge.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var yt;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(yt||(yt={}));function eI(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const hq=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ȀDMPTĮ‡Į‹Į‘Į–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;扐bleĖ€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;æˆĨnĖ€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ā­•ā­–ā­Ēā­ŧāŽĄā¯Ģā°„āąžā˛„ā˛Ļ⺘āĩĄāļ…æĢŦĀou⭛⭤ngruent;æ‰ĸ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;æ€ŗÄ€dpāģŠāģŽuct;戏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á‰ģ኉Į˛áŠ€\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ĮŖáŒ“\0጖y;䐎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;ä…ģĮ˛á•”\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Ā;t፜᜷brk;æŽļĀoyᜁᝁ;䐹quo;æ€žĘ€cmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;æĻ°sÊᜌnoÃĩēƀahwá¯áąáŗ;䎲;æ„ļeen;æ‰Ŧr;ė€€đ”Ÿg΀costuvwážážážŗáŸáŸ•áŸ›áŸžÆ€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Ā;e᜚᜜lƀ;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áLjrrowĀlráŠŧáǁeft;æ†ēight;æ†ģʀRSacdáĒ’áĒ”áĒ–áǚáǟÂģāŊ‡;擈st;抛irc;抚ash;抝nint;樐id;æĢ¯cir;槂ubsĀ;uáĒģáĒŧæ™ŖitÂģáĒŧËŦá̇áĢ”áĢē\0áŦŠonĀ;eáĢáĢŽä€ēĀ;qÇÆɭáĢ™\0\0áĢĸaĀ;táĢžá̟ä€Ŧ;䁀ƀ;flá̍áĢŠáĢĢæˆÃŽá… eĀmxáĢąáĢļentÂģáĢŠ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ƀ;osĖĻáŗŠáŗ”ndĀ;sĖĻáŗ‘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;áēáē¤ÄŗáēĄáēŖ;怄;怅怃Ā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;耀īŦƒÉŠážš\0\0ážŊg;耀īŦ€ig;耀īŦ„;ė€€đ”Ŗlig;耀īŦlig;뀀fjƀaltáŋ™áŋœáŋĄt;晭ig;耀īŦ‚ns;æ–ą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ↄâ…Ēâ†Ų–â†›Į°â†‰\0↎proø₞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⧓āŦ¸Įŗâ§Ÿ\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âNJâĒâĒ‘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áĒ âĩ’âĩ—Įˆâĩšlac;䅑v;樸old;æĻŧlig;䅓ĀcrâĩŠâĩ­ir;æĻŋ;뀀đ”Ŧͯâĩš\0\0âĩŧ\0âļ‚n;䋛aveč€ģÃ˛äƒ˛;槁Ābmâļˆāˇ´ar;æĻĩȀacitâļ•âļ˜âļĨâļ¨rÃ˛áǀĀirâļâļ r;æĻžoss;æĻģnÃĨāš’;槀ƀaeiâļąâļĩâļšcr;䅍ga;䏉ƀcdnⷀⷅĮron;äŽŋ;æĻļpf;ė€€đ• Æ€aelⷔ⷗Į’r;æĻˇrp;æĻšÎ€;adiosvâˇĒâˇĢâˇŽâ¸ˆâ¸â¸â¸–æˆ¨rÃ˛ádžȀ;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\0âšģm;æĢŗ;æĢŊ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㚆㚝ãšĩãšŧĮ˛ãš‹\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;ė€€đ“ŒāĢŖážŽãLJ\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(e=>e.charCodeAt(0))),mq=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 pq(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=mq.get(e))!==null&&t!==void 0?t:e}var Yn;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Yn||(Yn={}));const gq=32;var ha;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(ha||(ha={}));function hb(e){return e>=Yn.ZERO&&e<=Yn.NINE}function bq(e){return e>=Yn.UPPER_A&&e<=Yn.UPPER_F||e>=Yn.LOWER_A&&e<=Yn.LOWER_F}function _q(e){return e>=Yn.UPPER_A&&e<=Yn.UPPER_Z||e>=Yn.LOWER_A&&e<=Yn.LOWER_Z||hb(e)}function yq(e){return e===Yn.EQUALS||_q(e)}var Kn;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Kn||(Kn={}));var ws;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(ws||(ws={}));class Eq{constructor(t,n,i){this.decodeTree=t,this.emitCodePoint=n,this.errors=i,this.state=Kn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ws.Strict}startEntity(t){this.decodeMode=t,this.state=Kn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Kn.EntityStart:return t.charCodeAt(n)===Yn.NUM?(this.state=Kn.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Kn.NamedEntity,this.stateNamedEntity(t,n));case Kn.NumericStart:return this.stateNumericStart(t,n);case Kn.NumericDecimal:return this.stateNumericDecimal(t,n);case Kn.NumericHex:return this.stateNumericHex(t,n);case Kn.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|gq)===Yn.LOWER_X?(this.state=Kn.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Kn.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,i,a){if(n!==i){const u=i-n;this.result=this.result*Math.pow(a,u)+Number.parseInt(t.substr(n,u),a),this.consumed+=u}}stateNumericHex(t,n){const i=n;for(;n<t.length;){const a=t.charCodeAt(n);if(hb(a)||bq(a))n+=1;else return this.addToNumericResult(t,i,n,16),this.emitNumericEntity(a,3)}return this.addToNumericResult(t,i,n,16),-1}stateNumericDecimal(t,n){const i=n;for(;n<t.length;){const a=t.charCodeAt(n);if(hb(a))n+=1;else return this.addToNumericResult(t,i,n,10),this.emitNumericEntity(a,2)}return this.addToNumericResult(t,i,n,10),-1}emitNumericEntity(t,n){var i;if(this.consumed<=n)return(i=this.errors)===null||i===void 0||i.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===Yn.SEMI)this.consumed+=1;else if(this.decodeMode===ws.Strict)return 0;return this.emitCodePoint(pq(this.result),this.consumed),this.errors&&(t!==Yn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:i}=this;let a=i[this.treeIndex],u=(a&ha.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const o=t.charCodeAt(n);if(this.treeIndex=vq(i,a,this.treeIndex+Math.max(1,u),o),this.treeIndex<0)return this.result===0||this.decodeMode===ws.Attribute&&(u===0||yq(o))?0:this.emitNotTerminatedNamedEntity();if(a=i[this.treeIndex],u=(a&ha.VALUE_LENGTH)>>14,u!==0){if(o===Yn.SEMI)return this.emitNamedEntityData(this.treeIndex,u,this.consumed+this.excess);this.decodeMode!==ws.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:i}=this,a=(i[n]&ha.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,a,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,i){const{decodeTree:a}=this;return this.emitCodePoint(n===1?a[t]&~ha.VALUE_LENGTH:a[t+1],i),n===3&&this.emitCodePoint(a[t+2],i),i}end(){var t;switch(this.state){case Kn.NamedEntity:return this.result!==0&&(this.decodeMode!==ws.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Kn.NumericDecimal:return this.emitNumericEntity(0,2);case Kn.NumericHex:return this.emitNumericEntity(0,3);case Kn.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Kn.EntityStart:return 0}}}function vq(e,t,n,i){const a=(t&ha.BRANCH_LENGTH)>>7,u=t&ha.JUMP_TABLE;if(a===0)return u!==0&&i===u?n:-1;if(u){const d=i-u;return d<0||d>=a?-1:e[n+d]-1}let o=n,f=o+a-1;for(;o<=f;){const d=o+f>>>1,l=e[d];if(l<i)o=d+1;else if(l>i)f=d-1;else return e[d+a]}return-1}var Se;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(Se||(Se={}));var ro;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(ro||(ro={}));var pi;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(pi||(pi={}));var oe;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(oe||(oe={}));var S;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(S||(S={}));const Tq=new Map([[oe.A,S.A],[oe.ADDRESS,S.ADDRESS],[oe.ANNOTATION_XML,S.ANNOTATION_XML],[oe.APPLET,S.APPLET],[oe.AREA,S.AREA],[oe.ARTICLE,S.ARTICLE],[oe.ASIDE,S.ASIDE],[oe.B,S.B],[oe.BASE,S.BASE],[oe.BASEFONT,S.BASEFONT],[oe.BGSOUND,S.BGSOUND],[oe.BIG,S.BIG],[oe.BLOCKQUOTE,S.BLOCKQUOTE],[oe.BODY,S.BODY],[oe.BR,S.BR],[oe.BUTTON,S.BUTTON],[oe.CAPTION,S.CAPTION],[oe.CENTER,S.CENTER],[oe.CODE,S.CODE],[oe.COL,S.COL],[oe.COLGROUP,S.COLGROUP],[oe.DD,S.DD],[oe.DESC,S.DESC],[oe.DETAILS,S.DETAILS],[oe.DIALOG,S.DIALOG],[oe.DIR,S.DIR],[oe.DIV,S.DIV],[oe.DL,S.DL],[oe.DT,S.DT],[oe.EM,S.EM],[oe.EMBED,S.EMBED],[oe.FIELDSET,S.FIELDSET],[oe.FIGCAPTION,S.FIGCAPTION],[oe.FIGURE,S.FIGURE],[oe.FONT,S.FONT],[oe.FOOTER,S.FOOTER],[oe.FOREIGN_OBJECT,S.FOREIGN_OBJECT],[oe.FORM,S.FORM],[oe.FRAME,S.FRAME],[oe.FRAMESET,S.FRAMESET],[oe.H1,S.H1],[oe.H2,S.H2],[oe.H3,S.H3],[oe.H4,S.H4],[oe.H5,S.H5],[oe.H6,S.H6],[oe.HEAD,S.HEAD],[oe.HEADER,S.HEADER],[oe.HGROUP,S.HGROUP],[oe.HR,S.HR],[oe.HTML,S.HTML],[oe.I,S.I],[oe.IMG,S.IMG],[oe.IMAGE,S.IMAGE],[oe.INPUT,S.INPUT],[oe.IFRAME,S.IFRAME],[oe.KEYGEN,S.KEYGEN],[oe.LABEL,S.LABEL],[oe.LI,S.LI],[oe.LINK,S.LINK],[oe.LISTING,S.LISTING],[oe.MAIN,S.MAIN],[oe.MALIGNMARK,S.MALIGNMARK],[oe.MARQUEE,S.MARQUEE],[oe.MATH,S.MATH],[oe.MENU,S.MENU],[oe.META,S.META],[oe.MGLYPH,S.MGLYPH],[oe.MI,S.MI],[oe.MO,S.MO],[oe.MN,S.MN],[oe.MS,S.MS],[oe.MTEXT,S.MTEXT],[oe.NAV,S.NAV],[oe.NOBR,S.NOBR],[oe.NOFRAMES,S.NOFRAMES],[oe.NOEMBED,S.NOEMBED],[oe.NOSCRIPT,S.NOSCRIPT],[oe.OBJECT,S.OBJECT],[oe.OL,S.OL],[oe.OPTGROUP,S.OPTGROUP],[oe.OPTION,S.OPTION],[oe.P,S.P],[oe.PARAM,S.PARAM],[oe.PLAINTEXT,S.PLAINTEXT],[oe.PRE,S.PRE],[oe.RB,S.RB],[oe.RP,S.RP],[oe.RT,S.RT],[oe.RTC,S.RTC],[oe.RUBY,S.RUBY],[oe.S,S.S],[oe.SCRIPT,S.SCRIPT],[oe.SEARCH,S.SEARCH],[oe.SECTION,S.SECTION],[oe.SELECT,S.SELECT],[oe.SOURCE,S.SOURCE],[oe.SMALL,S.SMALL],[oe.SPAN,S.SPAN],[oe.STRIKE,S.STRIKE],[oe.STRONG,S.STRONG],[oe.STYLE,S.STYLE],[oe.SUB,S.SUB],[oe.SUMMARY,S.SUMMARY],[oe.SUP,S.SUP],[oe.TABLE,S.TABLE],[oe.TBODY,S.TBODY],[oe.TEMPLATE,S.TEMPLATE],[oe.TEXTAREA,S.TEXTAREA],[oe.TFOOT,S.TFOOT],[oe.TD,S.TD],[oe.TH,S.TH],[oe.THEAD,S.THEAD],[oe.TITLE,S.TITLE],[oe.TR,S.TR],[oe.TRACK,S.TRACK],[oe.TT,S.TT],[oe.U,S.U],[oe.UL,S.UL],[oe.SVG,S.SVG],[oe.VAR,S.VAR],[oe.WBR,S.WBR],[oe.XMP,S.XMP]]);function Cc(e){var t;return(t=Tq.get(e))!==null&&t!==void 0?t:S.UNKNOWN}const we=S,Aq={[Se.HTML]:new Set([we.ADDRESS,we.APPLET,we.AREA,we.ARTICLE,we.ASIDE,we.BASE,we.BASEFONT,we.BGSOUND,we.BLOCKQUOTE,we.BODY,we.BR,we.BUTTON,we.CAPTION,we.CENTER,we.COL,we.COLGROUP,we.DD,we.DETAILS,we.DIR,we.DIV,we.DL,we.DT,we.EMBED,we.FIELDSET,we.FIGCAPTION,we.FIGURE,we.FOOTER,we.FORM,we.FRAME,we.FRAMESET,we.H1,we.H2,we.H3,we.H4,we.H5,we.H6,we.HEAD,we.HEADER,we.HGROUP,we.HR,we.HTML,we.IFRAME,we.IMG,we.INPUT,we.LI,we.LINK,we.LISTING,we.MAIN,we.MARQUEE,we.MENU,we.META,we.NAV,we.NOEMBED,we.NOFRAMES,we.NOSCRIPT,we.OBJECT,we.OL,we.P,we.PARAM,we.PLAINTEXT,we.PRE,we.SCRIPT,we.SECTION,we.SELECT,we.SOURCE,we.STYLE,we.SUMMARY,we.TABLE,we.TBODY,we.TD,we.TEMPLATE,we.TEXTAREA,we.TFOOT,we.TH,we.THEAD,we.TITLE,we.TR,we.TRACK,we.UL,we.WBR,we.XMP]),[Se.MATHML]:new Set([we.MI,we.MO,we.MN,we.MS,we.MTEXT,we.ANNOTATION_XML]),[Se.SVG]:new Set([we.TITLE,we.FOREIGN_OBJECT,we.DESC]),[Se.XLINK]:new Set,[Se.XML]:new Set,[Se.XMLNS]:new Set},mb=new Set([we.H1,we.H2,we.H3,we.H4,we.H5,we.H6]);oe.STYLE,oe.SCRIPT,oe.XMP,oe.IFRAME,oe.NOEMBED,oe.NOFRAMES,oe.PLAINTEXT;var V;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(V||(V={}));const Mn={DATA:V.DATA,RCDATA:V.RCDATA,RAWTEXT:V.RAWTEXT,SCRIPT_DATA:V.SCRIPT_DATA,PLAINTEXT:V.PLAINTEXT,CDATA_SECTION:V.CDATA_SECTION};function Oq(e){return e>=$.DIGIT_0&&e<=$.DIGIT_9}function Ad(e){return e>=$.LATIN_CAPITAL_A&&e<=$.LATIN_CAPITAL_Z}function Sq(e){return e>=$.LATIN_SMALL_A&&e<=$.LATIN_SMALL_Z}function la(e){return Sq(e)||Ad(e)}function qC(e){return la(e)||Oq(e)}function $h(e){return e+32}function tI(e){return e===$.SPACE||e===$.LINE_FEED||e===$.TABULATION||e===$.FORM_FEED}function GC(e){return tI(e)||e===$.SOLIDUS||e===$.GREATER_THAN_SIGN}function Cq(e){return e===$.NULL?ge.nullCharacterReference:e>1114111?ge.characterReferenceOutsideUnicodeRange:XN(e)?ge.surrogateCharacterReference:JN(e)?ge.noncharacterCharacterReference:QN(e)||e===$.CARRIAGE_RETURN?ge.controlCharacterReference:null}class xq{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=V.DATA,this.returnState=V.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new fq(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new Eq(hq,(i,a)=>{this.preprocessor.pos=this.entityStartPos+a-1,this._flushCodePointConsumedAsCharacterReference(i)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(ge.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:i=>{this._err(ge.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+i)},validateNumericCharacterReference:i=>{const a=Cq(i);a&&this._err(a,1)}}:void 0)}_err(t,n=0){var i,a;(a=(i=this.handler).onParseError)===null||a===void 0||a.call(i,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t?.())}write(t,n,i){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||i?.()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),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(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:yt.START_TAG,tagName:"",tagID:S.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:yt.END_TAG,tagName:"",tagID:S.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:yt.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:yt.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const i=this.currentToken;if(eI(i,this.currentAttr.name)===null){if(i.attrs.push(this.currentAttr),i.location&&this.currentLocation){const a=(t=(n=i.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);a[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(ge.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=Cc(t.tagName),t.type===yt.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(ge.endTagWithAttributes),t.selfClosing&&this._err(ge.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case yt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case yt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case yt.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:yt.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=tI(t)?yt.WHITESPACE_CHARACTER:t===$.NULL?yt.NULL_CHARACTER:yt.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(yt.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=V.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?ws.Attribute:ws.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===V.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===V.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===V.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case V.DATA:{this._stateData(t);break}case V.RCDATA:{this._stateRcdata(t);break}case V.RAWTEXT:{this._stateRawtext(t);break}case V.SCRIPT_DATA:{this._stateScriptData(t);break}case V.PLAINTEXT:{this._statePlaintext(t);break}case V.TAG_OPEN:{this._stateTagOpen(t);break}case V.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case V.TAG_NAME:{this._stateTagName(t);break}case V.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case V.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case V.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case V.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case V.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case V.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case V.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case V.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case V.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case V.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case V.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case V.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case V.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case V.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case V.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case V.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case V.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case V.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case V.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case V.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case V.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case V.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case V.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case V.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case V.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case V.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case V.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case V.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case V.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case V.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case V.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case V.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case V.BOGUS_COMMENT:{this._stateBogusComment(t);break}case V.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case V.COMMENT_START:{this._stateCommentStart(t);break}case V.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case V.COMMENT:{this._stateComment(t);break}case V.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case V.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case V.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case V.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case V.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case V.COMMENT_END:{this._stateCommentEnd(t);break}case V.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case V.DOCTYPE:{this._stateDoctype(t);break}case V.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case V.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case V.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case V.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case V.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case V.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case V.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case V.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case V.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case V.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case V.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case V.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case V.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case V.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case V.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case V.CDATA_SECTION:{this._stateCdataSection(t);break}case V.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case V.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case V.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case V.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case $.LESS_THAN_SIGN:{this.state=V.TAG_OPEN;break}case $.AMPERSAND:{this._startCharacterReference();break}case $.NULL:{this._err(ge.unexpectedNullCharacter),this._emitCodePoint(t);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case $.AMPERSAND:{this._startCharacterReference();break}case $.LESS_THAN_SIGN:{this.state=V.RCDATA_LESS_THAN_SIGN;break}case $.NULL:{this._err(ge.unexpectedNullCharacter),this._emitChars(mn);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case $.LESS_THAN_SIGN:{this.state=V.RAWTEXT_LESS_THAN_SIGN;break}case $.NULL:{this._err(ge.unexpectedNullCharacter),this._emitChars(mn);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case $.LESS_THAN_SIGN:{this.state=V.SCRIPT_DATA_LESS_THAN_SIGN;break}case $.NULL:{this._err(ge.unexpectedNullCharacter),this._emitChars(mn);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case $.NULL:{this._err(ge.unexpectedNullCharacter),this._emitChars(mn);break}case $.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(la(t))this._createStartTagToken(),this.state=V.TAG_NAME,this._stateTagName(t);else switch(t){case $.EXCLAMATION_MARK:{this.state=V.MARKUP_DECLARATION_OPEN;break}case $.SOLIDUS:{this.state=V.END_TAG_OPEN;break}case $.QUESTION_MARK:{this._err(ge.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=V.BOGUS_COMMENT,this._stateBogusComment(t);break}case $.EOF:{this._err(ge.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(ge.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=V.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(la(t))this._createEndTagToken(),this.state=V.TAG_NAME,this._stateTagName(t);else switch(t){case $.GREATER_THAN_SIGN:{this._err(ge.missingEndTagName),this.state=V.DATA;break}case $.EOF:{this._err(ge.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(ge.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=V.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:{this.state=V.BEFORE_ATTRIBUTE_NAME;break}case $.SOLIDUS:{this.state=V.SELF_CLOSING_START_TAG;break}case $.GREATER_THAN_SIGN:{this.state=V.DATA,this.emitCurrentTagToken();break}case $.NULL:{this._err(ge.unexpectedNullCharacter),n.tagName+=mn;break}case $.EOF:{this._err(ge.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Ad(t)?$h(t):t)}}_stateRcdataLessThanSign(t){t===$.SOLIDUS?this.state=V.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=V.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){la(t)?(this.state=V.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=V.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){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 $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=V.BEFORE_ATTRIBUTE_NAME,!1;case $.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=V.SELF_CLOSING_START_TAG,!1;case $.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=V.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=V.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===$.SOLIDUS?this.state=V.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=V.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){la(t)?(this.state=V.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=V.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=V.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case $.SOLIDUS:{this.state=V.SCRIPT_DATA_END_TAG_OPEN;break}case $.EXCLAMATION_MARK:{this.state=V.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=V.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){la(t)?(this.state=V.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=V.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=V.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===$.HYPHEN_MINUS?(this.state=V.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=V.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===$.HYPHEN_MINUS?(this.state=V.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=V.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case $.HYPHEN_MINUS:{this.state=V.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case $.LESS_THAN_SIGN:{this.state=V.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case $.NULL:{this._err(ge.unexpectedNullCharacter),this._emitChars(mn);break}case $.EOF:{this._err(ge.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case $.HYPHEN_MINUS:{this.state=V.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case $.LESS_THAN_SIGN:{this.state=V.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case $.NULL:{this._err(ge.unexpectedNullCharacter),this.state=V.SCRIPT_DATA_ESCAPED,this._emitChars(mn);break}case $.EOF:{this._err(ge.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=V.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case $.HYPHEN_MINUS:{this._emitChars("-");break}case $.LESS_THAN_SIGN:{this.state=V.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case $.GREATER_THAN_SIGN:{this.state=V.SCRIPT_DATA,this._emitChars(">");break}case $.NULL:{this._err(ge.unexpectedNullCharacter),this.state=V.SCRIPT_DATA_ESCAPED,this._emitChars(mn);break}case $.EOF:{this._err(ge.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=V.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===$.SOLIDUS?this.state=V.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:la(t)?(this._emitChars("<"),this.state=V.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=V.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){la(t)?(this.state=V.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=V.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=V.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(Mr.SCRIPT,!1)&&GC(this.preprocessor.peek(Mr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Mr.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=V.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=V.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case $.HYPHEN_MINUS:{this.state=V.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case $.LESS_THAN_SIGN:{this.state=V.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case $.NULL:{this._err(ge.unexpectedNullCharacter),this._emitChars(mn);break}case $.EOF:{this._err(ge.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case $.HYPHEN_MINUS:{this.state=V.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case $.LESS_THAN_SIGN:{this.state=V.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case $.NULL:{this._err(ge.unexpectedNullCharacter),this.state=V.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(mn);break}case $.EOF:{this._err(ge.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=V.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case $.HYPHEN_MINUS:{this._emitChars("-");break}case $.LESS_THAN_SIGN:{this.state=V.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case $.GREATER_THAN_SIGN:{this.state=V.SCRIPT_DATA,this._emitChars(">");break}case $.NULL:{this._err(ge.unexpectedNullCharacter),this.state=V.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(mn);break}case $.EOF:{this._err(ge.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=V.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===$.SOLIDUS?(this.state=V.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=V.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Mr.SCRIPT,!1)&&GC(this.preprocessor.peek(Mr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Mr.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=V.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=V.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:break;case $.SOLIDUS:case $.GREATER_THAN_SIGN:case $.EOF:{this.state=V.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case $.EQUALS_SIGN:{this._err(ge.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=V.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=V.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:case $.SOLIDUS:case $.GREATER_THAN_SIGN:case $.EOF:{this._leaveAttrName(),this.state=V.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case $.EQUALS_SIGN:{this._leaveAttrName(),this.state=V.BEFORE_ATTRIBUTE_VALUE;break}case $.QUOTATION_MARK:case $.APOSTROPHE:case $.LESS_THAN_SIGN:{this._err(ge.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case $.NULL:{this._err(ge.unexpectedNullCharacter),this.currentAttr.name+=mn;break}default:this.currentAttr.name+=String.fromCodePoint(Ad(t)?$h(t):t)}}_stateAfterAttributeName(t){switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:break;case $.SOLIDUS:{this.state=V.SELF_CLOSING_START_TAG;break}case $.EQUALS_SIGN:{this.state=V.BEFORE_ATTRIBUTE_VALUE;break}case $.GREATER_THAN_SIGN:{this.state=V.DATA,this.emitCurrentTagToken();break}case $.EOF:{this._err(ge.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=V.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:break;case $.QUOTATION_MARK:{this.state=V.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case $.APOSTROPHE:{this.state=V.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case $.GREATER_THAN_SIGN:{this._err(ge.missingAttributeValue),this.state=V.DATA,this.emitCurrentTagToken();break}default:this.state=V.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case $.QUOTATION_MARK:{this.state=V.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case $.AMPERSAND:{this._startCharacterReference();break}case $.NULL:{this._err(ge.unexpectedNullCharacter),this.currentAttr.value+=mn;break}case $.EOF:{this._err(ge.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case $.APOSTROPHE:{this.state=V.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case $.AMPERSAND:{this._startCharacterReference();break}case $.NULL:{this._err(ge.unexpectedNullCharacter),this.currentAttr.value+=mn;break}case $.EOF:{this._err(ge.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:{this._leaveAttrValue(),this.state=V.BEFORE_ATTRIBUTE_NAME;break}case $.AMPERSAND:{this._startCharacterReference();break}case $.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=V.DATA,this.emitCurrentTagToken();break}case $.NULL:{this._err(ge.unexpectedNullCharacter),this.currentAttr.value+=mn;break}case $.QUOTATION_MARK:case $.APOSTROPHE:case $.LESS_THAN_SIGN:case $.EQUALS_SIGN:case $.GRAVE_ACCENT:{this._err(ge.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case $.EOF:{this._err(ge.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:{this._leaveAttrValue(),this.state=V.BEFORE_ATTRIBUTE_NAME;break}case $.SOLIDUS:{this._leaveAttrValue(),this.state=V.SELF_CLOSING_START_TAG;break}case $.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=V.DATA,this.emitCurrentTagToken();break}case $.EOF:{this._err(ge.eofInTag),this._emitEOFToken();break}default:this._err(ge.missingWhitespaceBetweenAttributes),this.state=V.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case $.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=V.DATA,this.emitCurrentTagToken();break}case $.EOF:{this._err(ge.eofInTag),this._emitEOFToken();break}default:this._err(ge.unexpectedSolidusInTag),this.state=V.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case $.GREATER_THAN_SIGN:{this.state=V.DATA,this.emitCurrentComment(n);break}case $.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case $.NULL:{this._err(ge.unexpectedNullCharacter),n.data+=mn;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Mr.DASH_DASH,!0)?(this._createCommentToken(Mr.DASH_DASH.length+1),this.state=V.COMMENT_START):this._consumeSequenceIfMatch(Mr.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Mr.DOCTYPE.length+1),this.state=V.DOCTYPE):this._consumeSequenceIfMatch(Mr.CDATA_START,!0)?this.inForeignNode?this.state=V.CDATA_SECTION:(this._err(ge.cdataInHtmlContent),this._createCommentToken(Mr.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=V.BOGUS_COMMENT):this._ensureHibernation()||(this._err(ge.incorrectlyOpenedComment),this._createCommentToken(2),this.state=V.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case $.HYPHEN_MINUS:{this.state=V.COMMENT_START_DASH;break}case $.GREATER_THAN_SIGN:{this._err(ge.abruptClosingOfEmptyComment),this.state=V.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=V.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case $.HYPHEN_MINUS:{this.state=V.COMMENT_END;break}case $.GREATER_THAN_SIGN:{this._err(ge.abruptClosingOfEmptyComment),this.state=V.DATA,this.emitCurrentComment(n);break}case $.EOF:{this._err(ge.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=V.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case $.HYPHEN_MINUS:{this.state=V.COMMENT_END_DASH;break}case $.LESS_THAN_SIGN:{n.data+="<",this.state=V.COMMENT_LESS_THAN_SIGN;break}case $.NULL:{this._err(ge.unexpectedNullCharacter),n.data+=mn;break}case $.EOF:{this._err(ge.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case $.EXCLAMATION_MARK:{n.data+="!",this.state=V.COMMENT_LESS_THAN_SIGN_BANG;break}case $.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=V.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===$.HYPHEN_MINUS?this.state=V.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=V.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===$.HYPHEN_MINUS?this.state=V.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=V.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==$.GREATER_THAN_SIGN&&t!==$.EOF&&this._err(ge.nestedComment),this.state=V.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case $.HYPHEN_MINUS:{this.state=V.COMMENT_END;break}case $.EOF:{this._err(ge.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=V.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case $.GREATER_THAN_SIGN:{this.state=V.DATA,this.emitCurrentComment(n);break}case $.EXCLAMATION_MARK:{this.state=V.COMMENT_END_BANG;break}case $.HYPHEN_MINUS:{n.data+="-";break}case $.EOF:{this._err(ge.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=V.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case $.HYPHEN_MINUS:{n.data+="--!",this.state=V.COMMENT_END_DASH;break}case $.GREATER_THAN_SIGN:{this._err(ge.incorrectlyClosedComment),this.state=V.DATA,this.emitCurrentComment(n);break}case $.EOF:{this._err(ge.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=V.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:{this.state=V.BEFORE_DOCTYPE_NAME;break}case $.GREATER_THAN_SIGN:{this.state=V.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case $.EOF:{this._err(ge.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ge.missingWhitespaceBeforeDoctypeName),this.state=V.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(Ad(t))this._createDoctypeToken(String.fromCharCode($h(t))),this.state=V.DOCTYPE_NAME;else switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:break;case $.NULL:{this._err(ge.unexpectedNullCharacter),this._createDoctypeToken(mn),this.state=V.DOCTYPE_NAME;break}case $.GREATER_THAN_SIGN:{this._err(ge.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=V.DATA;break}case $.EOF:{this._err(ge.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=V.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:{this.state=V.AFTER_DOCTYPE_NAME;break}case $.GREATER_THAN_SIGN:{this.state=V.DATA,this.emitCurrentDoctype(n);break}case $.NULL:{this._err(ge.unexpectedNullCharacter),n.name+=mn;break}case $.EOF:{this._err(ge.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Ad(t)?$h(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:break;case $.GREATER_THAN_SIGN:{this.state=V.DATA,this.emitCurrentDoctype(n);break}case $.EOF:{this._err(ge.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Mr.PUBLIC,!1)?this.state=V.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Mr.SYSTEM,!1)?this.state=V.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(ge.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=V.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:{this.state=V.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case $.QUOTATION_MARK:{this._err(ge.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=V.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case $.APOSTROPHE:{this._err(ge.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=V.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case $.GREATER_THAN_SIGN:{this._err(ge.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=V.DATA,this.emitCurrentDoctype(n);break}case $.EOF:{this._err(ge.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ge.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=V.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:break;case $.QUOTATION_MARK:{n.publicId="",this.state=V.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case $.APOSTROPHE:{n.publicId="",this.state=V.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case $.GREATER_THAN_SIGN:{this._err(ge.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=V.DATA,this.emitCurrentDoctype(n);break}case $.EOF:{this._err(ge.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ge.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=V.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case $.QUOTATION_MARK:{this.state=V.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case $.NULL:{this._err(ge.unexpectedNullCharacter),n.publicId+=mn;break}case $.GREATER_THAN_SIGN:{this._err(ge.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=V.DATA;break}case $.EOF:{this._err(ge.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case $.APOSTROPHE:{this.state=V.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case $.NULL:{this._err(ge.unexpectedNullCharacter),n.publicId+=mn;break}case $.GREATER_THAN_SIGN:{this._err(ge.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=V.DATA;break}case $.EOF:{this._err(ge.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:{this.state=V.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case $.GREATER_THAN_SIGN:{this.state=V.DATA,this.emitCurrentDoctype(n);break}case $.QUOTATION_MARK:{this._err(ge.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=V.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case $.APOSTROPHE:{this._err(ge.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=V.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case $.EOF:{this._err(ge.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ge.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=V.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:break;case $.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=V.DATA;break}case $.QUOTATION_MARK:{n.systemId="",this.state=V.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case $.APOSTROPHE:{n.systemId="",this.state=V.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case $.EOF:{this._err(ge.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ge.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=V.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:{this.state=V.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case $.QUOTATION_MARK:{this._err(ge.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=V.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case $.APOSTROPHE:{this._err(ge.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=V.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case $.GREATER_THAN_SIGN:{this._err(ge.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=V.DATA,this.emitCurrentDoctype(n);break}case $.EOF:{this._err(ge.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ge.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=V.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:break;case $.QUOTATION_MARK:{n.systemId="",this.state=V.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case $.APOSTROPHE:{n.systemId="",this.state=V.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case $.GREATER_THAN_SIGN:{this._err(ge.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=V.DATA,this.emitCurrentDoctype(n);break}case $.EOF:{this._err(ge.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ge.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=V.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case $.QUOTATION_MARK:{this.state=V.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case $.NULL:{this._err(ge.unexpectedNullCharacter),n.systemId+=mn;break}case $.GREATER_THAN_SIGN:{this._err(ge.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=V.DATA;break}case $.EOF:{this._err(ge.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case $.APOSTROPHE:{this.state=V.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case $.NULL:{this._err(ge.unexpectedNullCharacter),n.systemId+=mn;break}case $.GREATER_THAN_SIGN:{this._err(ge.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=V.DATA;break}case $.EOF:{this._err(ge.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case $.SPACE:case $.LINE_FEED:case $.TABULATION:case $.FORM_FEED:break;case $.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=V.DATA;break}case $.EOF:{this._err(ge.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ge.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=V.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case $.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=V.DATA;break}case $.NULL:{this._err(ge.unexpectedNullCharacter);break}case $.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case $.RIGHT_SQUARE_BRACKET:{this.state=V.CDATA_SECTION_BRACKET;break}case $.EOF:{this._err(ge.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===$.RIGHT_SQUARE_BRACKET?this.state=V.CDATA_SECTION_END:(this._emitChars("]"),this.state=V.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case $.GREATER_THAN_SIGN:{this.state=V.DATA;break}case $.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=V.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference($.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&qC(this.preprocessor.peek(1))?V.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){qC(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===$.SEMICOLON&&this._err(ge.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const nI=new Set([S.DD,S.DT,S.LI,S.OPTGROUP,S.OPTION,S.P,S.RB,S.RP,S.RT,S.RTC]),KC=new Set([...nI,S.CAPTION,S.COLGROUP,S.TBODY,S.TD,S.TFOOT,S.TH,S.THEAD,S.TR]),am=new Set([S.APPLET,S.CAPTION,S.HTML,S.MARQUEE,S.OBJECT,S.TABLE,S.TD,S.TEMPLATE,S.TH]),wq=new Set([...am,S.OL,S.UL]),Rq=new Set([...am,S.BUTTON]),YC=new Set([S.ANNOTATION_XML,S.MI,S.MN,S.MO,S.MS,S.MTEXT]),VC=new Set([S.DESC,S.FOREIGN_OBJECT,S.TITLE]),Nq=new Set([S.TR,S.TEMPLATE,S.HTML]),Iq=new Set([S.TBODY,S.TFOOT,S.THEAD,S.TEMPLATE,S.HTML]),kq=new Set([S.TABLE,S.TEMPLATE,S.HTML]),Mq=new Set([S.TD,S.TH]);class Pq{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,i){this.treeAdapter=n,this.handler=i,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=S.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===S.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Se.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const i=this._indexOf(t);this.items[i]=n,i===this.stackTop&&(this.current=n)}insertAfter(t,n,i){const a=this._indexOf(t)+1;this.items.splice(a,0,n),this.tagIDs.splice(a,0,i),this.stackTop++,a===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,a===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==Se.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(Math.max(n,0))}popUntilPopped(t,n){const i=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(i,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(mb,Se.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Mq,Se.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let i=this.stackTop;i>=0;i--)if(t.has(this.tagIDs[i])&&this.treeAdapter.getNamespaceURI(this.items[i])===n)return i;return-1}clearBackTo(t,n){const i=this._indexOfTagNames(t,n);this.shortenToLength(i+1)}clearBackToTableContext(){this.clearBackTo(kq,Se.HTML)}clearBackToTableBodyContext(){this.clearBackTo(Iq,Se.HTML)}clearBackToTableRowContext(){this.clearBackTo(Nq,Se.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===S.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===S.HTML}hasInDynamicScope(t,n){for(let i=this.stackTop;i>=0;i--){const a=this.tagIDs[i];switch(this.treeAdapter.getNamespaceURI(this.items[i])){case Se.HTML:{if(a===t)return!0;if(n.has(a))return!1;break}case Se.SVG:{if(VC.has(a))return!1;break}case Se.MATHML:{if(YC.has(a))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,am)}hasInListItemScope(t){return this.hasInDynamicScope(t,wq)}hasInButtonScope(t){return this.hasInDynamicScope(t,Rq)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case Se.HTML:{if(mb.has(n))return!0;if(am.has(n))return!1;break}case Se.SVG:{if(VC.has(n))return!1;break}case Se.MATHML:{if(YC.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Se.HTML)switch(this.tagIDs[n]){case t:return!0;case S.TABLE:case S.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===Se.HTML)switch(this.tagIDs[t]){case S.TBODY:case S.THEAD:case S.TFOOT:return!0;case S.TABLE:case S.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Se.HTML)switch(this.tagIDs[n]){case t:return!0;case S.OPTION:case S.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&nI.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&KC.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&KC.has(this.currentTagId);)this.pop()}}const k0=3;var Gi;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Gi||(Gi={}));const ZC={type:Gi.Marker};class Dq{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const i=[],a=n.length,u=this.treeAdapter.getTagName(t),o=this.treeAdapter.getNamespaceURI(t);for(let f=0;f<this.entries.length;f++){const d=this.entries[f];if(d.type===Gi.Marker)break;const{element:l}=d;if(this.treeAdapter.getTagName(l)===u&&this.treeAdapter.getNamespaceURI(l)===o){const h=this.treeAdapter.getAttrList(l);h.length===a&&i.push({idx:f,attrs:h})}}return i}_ensureNoahArkCondition(t){if(this.entries.length<k0)return;const n=this.treeAdapter.getAttrList(t),i=this._getNoahArkConditionCandidates(t,n);if(i.length<k0)return;const a=new Map(n.map(o=>[o.name,o.value]));let u=0;for(let o=0;o<i.length;o++){const f=i[o];f.attrs.every(d=>a.get(d.name)===d.value)&&(u+=1,u>=k0&&this.entries.splice(f.idx,1))}}insertMarker(){this.entries.unshift(ZC)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Gi.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const i=this.entries.indexOf(this.bookmark);this.entries.splice(i,0,{type:Gi.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(ZC);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(i=>i.type===Gi.Marker||this.treeAdapter.getTagName(i.element)===t);return n&&n.type===Gi.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Gi.Element&&n.element===t)}}const ua={createDocument(){return{nodeName:"#document",mode:pi.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const i=e.childNodes.indexOf(n);e.childNodes.splice(i,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,i){const a=e.childNodes.find(u=>u.nodeName==="#documentType");if(a)a.name=t,a.publicId=n,a.systemId=i;else{const u={nodeName:"#documentType",name:t,publicId:n,systemId:i,parentNode:null};ua.appendChild(e,u)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(ua.isTextNode(n)){n.value+=t;return}}ua.appendChild(e,ua.createTextNode(t))},insertTextBefore(e,t,n){const i=e.childNodes[e.childNodes.indexOf(n)-1];i&&ua.isTextNode(i)?i.value+=t:ua.insertBefore(e,ua.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(i=>i.name));for(let i=0;i<t.length;i++)n.has(t[i].name)||e.attrs.push(t[i])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},rI="html",jq="about:legacy-compat",Lq="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",iI=["+//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//"],Hq=[...iI,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],Bq=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),sI=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],Uq=[...sI,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function WC(e,t){return t.some(n=>e.startsWith(n))}function Fq(e){return e.name===rI&&e.publicId===null&&(e.systemId===null||e.systemId===jq)}function zq(e){if(e.name!==rI)return pi.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===Lq)return pi.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),Bq.has(n))return pi.QUIRKS;let i=t===null?Hq:iI;if(WC(n,i))return pi.QUIRKS;if(i=t===null?sI:Uq,WC(n,i))return pi.LIMITED_QUIRKS}return pi.NO_QUIRKS}const XC={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},$q="definitionurl",qq="definitionURL",Gq=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(e=>[e.toLowerCase(),e])),Kq=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Se.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Se.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Se.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Se.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Se.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Se.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Se.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Se.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Se.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Se.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Se.XMLNS}]]),Yq=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(e=>[e.toLowerCase(),e])),Vq=new Set([S.B,S.BIG,S.BLOCKQUOTE,S.BODY,S.BR,S.CENTER,S.CODE,S.DD,S.DIV,S.DL,S.DT,S.EM,S.EMBED,S.H1,S.H2,S.H3,S.H4,S.H5,S.H6,S.HEAD,S.HR,S.I,S.IMG,S.LI,S.LISTING,S.MENU,S.META,S.NOBR,S.OL,S.P,S.PRE,S.RUBY,S.S,S.SMALL,S.SPAN,S.STRONG,S.STRIKE,S.SUB,S.SUP,S.TABLE,S.TT,S.U,S.UL,S.VAR]);function Zq(e){const t=e.tagID;return t===S.FONT&&e.attrs.some(({name:i})=>i===ro.COLOR||i===ro.SIZE||i===ro.FACE)||Vq.has(t)}function aI(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===$q){e.attrs[t].name=qq;break}}function oI(e){for(let t=0;t<e.attrs.length;t++){const n=Gq.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function E_(e){for(let t=0;t<e.attrs.length;t++){const n=Kq.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function Wq(e){const t=Yq.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Cc(e.tagName))}function Xq(e,t){return t===Se.MATHML&&(e===S.MI||e===S.MO||e===S.MN||e===S.MS||e===S.MTEXT)}function Qq(e,t,n){if(t===Se.MATHML&&e===S.ANNOTATION_XML){for(let i=0;i<n.length;i++)if(n[i].name===ro.ENCODING){const a=n[i].value.toLowerCase();return a===XC.TEXT_HTML||a===XC.APPLICATION_XML}}return t===Se.SVG&&(e===S.FOREIGN_OBJECT||e===S.DESC||e===S.TITLE)}function Jq(e,t,n,i){return(!i||i===Se.HTML)&&Qq(e,t,n)||(!i||i===Se.MATHML)&&Xq(e,t)}const eG="hidden",tG=8,nG=3;var X;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(X||(X={}));const rG={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},cI=new Set([S.TABLE,S.TBODY,S.TFOOT,S.THEAD,S.TR]),QC={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:ua,onParseError:null};class JC{constructor(t,n,i=null,a=null){this.fragmentContext=i,this.scriptHandler=a,this.currentToken=null,this.stopped=!1,this.insertionMode=X.INITIAL,this.originalInsertionMode=X.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={...QC,...t},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 xq(this.options,this),this.activeFormattingElements=new Dq(this.treeAdapter),this.fragmentContextID=i?Cc(this.treeAdapter.getTagName(i)):S.UNKNOWN,this._setContextModes(i??this.document,this.fragmentContextID),this.openElements=new Pq(this.document,this.treeAdapter,this)}static parse(t,n){const i=new this(n);return i.tokenizer.write(t,!0),i.document}static getFragmentParser(t,n){const i={...QC,...n};t??(t=i.treeAdapter.createElement(oe.TEMPLATE,Se.HTML,[]));const a=i.treeAdapter.createElement("documentmock",Se.HTML,[]),u=new this(i,a,t);return u.fragmentContextID===S.TEMPLATE&&u.tmplInsertionModeStack.unshift(X.IN_TEMPLATE),u._initTokenizerForFragmentParsing(),u._insertFakeRootElement(),u._resetInsertionMode(),u._findFormInFragmentContext(),u}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,i){var a;if(!this.onParseError)return;const u=(a=t.location)!==null&&a!==void 0?a:rG,o={code:n,startLine:u.startLine,startCol:u.startCol,startOffset:u.startOffset,endLine:i?u.startLine:u.endLine,endCol:i?u.startCol:u.endCol,endOffset:i?u.startOffset:u.endOffset};this.onParseError(o)}onItemPush(t,n,i){var a,u;(u=(a=this.treeAdapter).onItemPush)===null||u===void 0||u.call(a,t),i&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var i,a;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(a=(i=this.treeAdapter).onItemPop)===null||a===void 0||a.call(i,t,this.openElements.current),n){let u,o;this.openElements.stackTop===0&&this.fragmentContext?(u=this.fragmentContext,o=this.fragmentContextID):{current:u,currentTagId:o}=this.openElements,this._setContextModes(u,o)}}_setContextModes(t,n){const i=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===Se.HTML;this.currentNotInHTML=!i,this.tokenizer.inForeignNode=!i&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,Se.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=X.TEXT}switchToPlaintextParsing(){this.insertionMode=X.TEXT,this.originalInsertionMode=X.IN_BODY,this.tokenizer.state=Mn.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===oe.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Se.HTML))switch(this.fragmentContextID){case S.TITLE:case S.TEXTAREA:{this.tokenizer.state=Mn.RCDATA;break}case S.STYLE:case S.XMP:case S.IFRAME:case S.NOEMBED:case S.NOFRAMES:case S.NOSCRIPT:{this.tokenizer.state=Mn.RAWTEXT;break}case S.SCRIPT:{this.tokenizer.state=Mn.SCRIPT_DATA;break}case S.PLAINTEXT:{this.tokenizer.state=Mn.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",i=t.publicId||"",a=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,i,a),t.location){const o=this.treeAdapter.getChildNodes(this.document).find(f=>this.treeAdapter.isDocumentTypeNode(f));o&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const i=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,i)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const i=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(i??this.document,t)}}_appendElement(t,n){const i=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(i,t.location)}_insertElement(t,n){const i=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(i,t.location),this.openElements.push(i,t.tagID)}_insertFakeElement(t,n){const i=this.treeAdapter.createElement(t,Se.HTML,[]);this._attachElementToTree(i,null),this.openElements.push(i,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,Se.HTML,t.attrs),i=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,i),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(oe.HTML,Se.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,S.HTML)}_appendCommentNode(t,n){const i=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,i),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,t.location)}_insertCharacters(t){let n,i;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:i}=this._findFosterParentingLocation(),i?this.treeAdapter.insertTextBefore(n,t.chars,i):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const a=this.treeAdapter.getChildNodes(n),u=i?a.lastIndexOf(i):a.length,o=a[u-1];if(this.treeAdapter.getNodeSourceCodeLocation(o)){const{endLine:d,endCol:l,endOffset:h}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:d,endCol:l,endOffset:h})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(o,t.location)}_adoptNodes(t,n){for(let i=this.treeAdapter.getFirstChild(t);i;i=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(i),this.treeAdapter.appendChild(n,i)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const i=n.location,a=this.treeAdapter.getTagName(t),u=n.type===yt.END_TAG&&a===n.tagName?{endTag:{...i},endLine:i.endLine,endCol:i.endCol,endOffset:i.endOffset}:{endLine:i.startLine,endCol:i.startCol,endOffset:i.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,u)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,i;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,i=this.fragmentContextID):{current:n,currentTagId:i}=this.openElements,t.tagID===S.SVG&&this.treeAdapter.getTagName(n)===oe.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Se.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===S.MGLYPH||t.tagID===S.MALIGNMARK)&&i!==void 0&&!this._isIntegrationPoint(i,n,Se.HTML)}_processToken(t){switch(t.type){case yt.CHARACTER:{this.onCharacter(t);break}case yt.NULL_CHARACTER:{this.onNullCharacter(t);break}case yt.COMMENT:{this.onComment(t);break}case yt.DOCTYPE:{this.onDoctype(t);break}case yt.START_TAG:{this._processStartTag(t);break}case yt.END_TAG:{this.onEndTag(t);break}case yt.EOF:{this.onEof(t);break}case yt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,i){const a=this.treeAdapter.getNamespaceURI(n),u=this.treeAdapter.getAttrList(n);return Jq(t,a,u,i)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(a=>a.type===Gi.Marker||this.openElements.contains(a.element)),i=n===-1?t-1:n-1;for(let a=i;a>=0;a--){const u=this.activeFormattingElements.entries[a];this._insertElement(u.token,this.treeAdapter.getNamespaceURI(u.element)),u.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=X.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(S.P),this.openElements.popUntilTagNamePopped(S.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case S.TR:{this.insertionMode=X.IN_ROW;return}case S.TBODY:case S.THEAD:case S.TFOOT:{this.insertionMode=X.IN_TABLE_BODY;return}case S.CAPTION:{this.insertionMode=X.IN_CAPTION;return}case S.COLGROUP:{this.insertionMode=X.IN_COLUMN_GROUP;return}case S.TABLE:{this.insertionMode=X.IN_TABLE;return}case S.BODY:{this.insertionMode=X.IN_BODY;return}case S.FRAMESET:{this.insertionMode=X.IN_FRAMESET;return}case S.SELECT:{this._resetInsertionModeForSelect(t);return}case S.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case S.HTML:{this.insertionMode=this.headElement?X.AFTER_HEAD:X.BEFORE_HEAD;return}case S.TD:case S.TH:{if(t>0){this.insertionMode=X.IN_CELL;return}break}case S.HEAD:{if(t>0){this.insertionMode=X.IN_HEAD;return}break}}this.insertionMode=X.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const i=this.openElements.tagIDs[n];if(i===S.TEMPLATE)break;if(i===S.TABLE){this.insertionMode=X.IN_SELECT_IN_TABLE;return}}this.insertionMode=X.IN_SELECT}_isElementCausesFosterParenting(t){return cI.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case S.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===Se.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case S.TABLE:{const i=this.treeAdapter.getParentNode(n);return i?{parent:i,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const i=this.treeAdapter.getNamespaceURI(t);return Aq[i].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){MK(this,t);return}switch(this.insertionMode){case X.INITIAL:{pd(this,t);break}case X.BEFORE_HTML:{Rd(this,t);break}case X.BEFORE_HEAD:{Nd(this,t);break}case X.IN_HEAD:{Id(this,t);break}case X.IN_HEAD_NO_SCRIPT:{kd(this,t);break}case X.AFTER_HEAD:{Md(this,t);break}case X.IN_BODY:case X.IN_CAPTION:case X.IN_CELL:case X.IN_TEMPLATE:{uI(this,t);break}case X.TEXT:case X.IN_SELECT:case X.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case X.IN_TABLE:case X.IN_TABLE_BODY:case X.IN_ROW:{M0(this,t);break}case X.IN_TABLE_TEXT:{gI(this,t);break}case X.IN_COLUMN_GROUP:{om(this,t);break}case X.AFTER_BODY:{cm(this,t);break}case X.AFTER_AFTER_BODY:{Yh(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){kK(this,t);return}switch(this.insertionMode){case X.INITIAL:{pd(this,t);break}case X.BEFORE_HTML:{Rd(this,t);break}case X.BEFORE_HEAD:{Nd(this,t);break}case X.IN_HEAD:{Id(this,t);break}case X.IN_HEAD_NO_SCRIPT:{kd(this,t);break}case X.AFTER_HEAD:{Md(this,t);break}case X.TEXT:{this._insertCharacters(t);break}case X.IN_TABLE:case X.IN_TABLE_BODY:case X.IN_ROW:{M0(this,t);break}case X.IN_COLUMN_GROUP:{om(this,t);break}case X.AFTER_BODY:{cm(this,t);break}case X.AFTER_AFTER_BODY:{Yh(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){pb(this,t);return}switch(this.insertionMode){case X.INITIAL:case X.BEFORE_HTML:case X.BEFORE_HEAD:case X.IN_HEAD:case X.IN_HEAD_NO_SCRIPT:case X.AFTER_HEAD:case X.IN_BODY:case X.IN_TABLE:case X.IN_CAPTION:case X.IN_COLUMN_GROUP:case X.IN_TABLE_BODY:case X.IN_ROW:case X.IN_CELL:case X.IN_SELECT:case X.IN_SELECT_IN_TABLE:case X.IN_TEMPLATE:case X.IN_FRAMESET:case X.AFTER_FRAMESET:{pb(this,t);break}case X.IN_TABLE_TEXT:{gd(this,t);break}case X.AFTER_BODY:{uG(this,t);break}case X.AFTER_AFTER_BODY:case X.AFTER_AFTER_FRAMESET:{dG(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case X.INITIAL:{fG(this,t);break}case X.BEFORE_HEAD:case X.IN_HEAD:case X.IN_HEAD_NO_SCRIPT:case X.AFTER_HEAD:{this._err(t,ge.misplacedDoctype);break}case X.IN_TABLE_TEXT:{gd(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,ge.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?PK(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case X.INITIAL:{pd(this,t);break}case X.BEFORE_HTML:{hG(this,t);break}case X.BEFORE_HEAD:{pG(this,t);break}case X.IN_HEAD:{ji(this,t);break}case X.IN_HEAD_NO_SCRIPT:{_G(this,t);break}case X.AFTER_HEAD:{EG(this,t);break}case X.IN_BODY:{hr(this,t);break}case X.IN_TABLE:{gc(this,t);break}case X.IN_TABLE_TEXT:{gd(this,t);break}case X.IN_CAPTION:{gK(this,t);break}case X.IN_COLUMN_GROUP:{A_(this,t);break}case X.IN_TABLE_BODY:{Rm(this,t);break}case X.IN_ROW:{Nm(this,t);break}case X.IN_CELL:{yK(this,t);break}case X.IN_SELECT:{yI(this,t);break}case X.IN_SELECT_IN_TABLE:{vK(this,t);break}case X.IN_TEMPLATE:{AK(this,t);break}case X.AFTER_BODY:{SK(this,t);break}case X.IN_FRAMESET:{CK(this,t);break}case X.AFTER_FRAMESET:{wK(this,t);break}case X.AFTER_AFTER_BODY:{NK(this,t);break}case X.AFTER_AFTER_FRAMESET:{IK(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?DK(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case X.INITIAL:{pd(this,t);break}case X.BEFORE_HTML:{mG(this,t);break}case X.BEFORE_HEAD:{gG(this,t);break}case X.IN_HEAD:{bG(this,t);break}case X.IN_HEAD_NO_SCRIPT:{yG(this,t);break}case X.AFTER_HEAD:{vG(this,t);break}case X.IN_BODY:{wm(this,t);break}case X.TEXT:{aK(this,t);break}case X.IN_TABLE:{qd(this,t);break}case X.IN_TABLE_TEXT:{gd(this,t);break}case X.IN_CAPTION:{bK(this,t);break}case X.IN_COLUMN_GROUP:{_K(this,t);break}case X.IN_TABLE_BODY:{gb(this,t);break}case X.IN_ROW:{_I(this,t);break}case X.IN_CELL:{EK(this,t);break}case X.IN_SELECT:{EI(this,t);break}case X.IN_SELECT_IN_TABLE:{TK(this,t);break}case X.IN_TEMPLATE:{OK(this,t);break}case X.AFTER_BODY:{TI(this,t);break}case X.IN_FRAMESET:{xK(this,t);break}case X.AFTER_FRAMESET:{RK(this,t);break}case X.AFTER_AFTER_BODY:{Yh(this,t);break}}}onEof(t){switch(this.insertionMode){case X.INITIAL:{pd(this,t);break}case X.BEFORE_HTML:{Rd(this,t);break}case X.BEFORE_HEAD:{Nd(this,t);break}case X.IN_HEAD:{Id(this,t);break}case X.IN_HEAD_NO_SCRIPT:{kd(this,t);break}case X.AFTER_HEAD:{Md(this,t);break}case X.IN_BODY:case X.IN_TABLE:case X.IN_CAPTION:case X.IN_COLUMN_GROUP:case X.IN_TABLE_BODY:case X.IN_ROW:case X.IN_CELL:case X.IN_SELECT:case X.IN_SELECT_IN_TABLE:{mI(this,t);break}case X.TEXT:{oK(this,t);break}case X.IN_TABLE_TEXT:{gd(this,t);break}case X.IN_TEMPLATE:{vI(this,t);break}case X.AFTER_BODY:case X.IN_FRAMESET:case X.AFTER_FRAMESET:case X.AFTER_AFTER_BODY:case X.AFTER_AFTER_FRAMESET:{T_(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===$.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case X.IN_HEAD:case X.IN_HEAD_NO_SCRIPT:case X.AFTER_HEAD:case X.TEXT:case X.IN_COLUMN_GROUP:case X.IN_SELECT:case X.IN_SELECT_IN_TABLE:case X.IN_FRAMESET:case X.AFTER_FRAMESET:{this._insertCharacters(t);break}case X.IN_BODY:case X.IN_CAPTION:case X.IN_CELL:case X.IN_TEMPLATE:case X.AFTER_BODY:case X.AFTER_AFTER_BODY:case X.AFTER_AFTER_FRAMESET:{lI(this,t);break}case X.IN_TABLE:case X.IN_TABLE_BODY:case X.IN_ROW:{M0(this,t);break}case X.IN_TABLE_TEXT:{pI(this,t);break}}}}function iG(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):hI(e,t),n}function sG(e,t){let n=null,i=e.openElements.stackTop;for(;i>=0;i--){const a=e.openElements.items[i];if(a===t.element)break;e._isSpecialElement(a,e.openElements.tagIDs[i])&&(n=a)}return n||(e.openElements.shortenToLength(Math.max(i,0)),e.activeFormattingElements.removeEntry(t)),n}function aG(e,t,n){let i=t,a=e.openElements.getCommonAncestor(t);for(let u=0,o=a;o!==n;u++,o=a){a=e.openElements.getCommonAncestor(o);const f=e.activeFormattingElements.getElementEntry(o),d=f&&u>=nG;!f||d?(d&&e.activeFormattingElements.removeEntry(f),e.openElements.remove(o)):(o=oG(e,f),i===t&&(e.activeFormattingElements.bookmark=f),e.treeAdapter.detachNode(i),e.treeAdapter.appendChild(o,i),i=o)}return i}function oG(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),i=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,i),t.element=i,i}function cG(e,t,n){const i=e.treeAdapter.getTagName(t),a=Cc(i);if(e._isElementCausesFosterParenting(a))e._fosterParentElement(n);else{const u=e.treeAdapter.getNamespaceURI(t);a===S.TEMPLATE&&u===Se.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function lG(e,t,n){const i=e.treeAdapter.getNamespaceURI(n.element),{token:a}=n,u=e.treeAdapter.createElement(a.tagName,i,a.attrs);e._adoptNodes(t,u),e.treeAdapter.appendChild(t,u),e.activeFormattingElements.insertElementAfterBookmark(u,a),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,u,a.tagID)}function v_(e,t){for(let n=0;n<tG;n++){const i=iG(e,t);if(!i)break;const a=sG(e,i);if(!a)break;e.activeFormattingElements.bookmark=i;const u=aG(e,a,i.element),o=e.openElements.getCommonAncestor(i.element);e.treeAdapter.detachNode(u),o&&cG(e,o,u),lG(e,a,i)}}function pb(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function uG(e,t){e._appendCommentNode(t,e.openElements.items[0])}function dG(e,t){e._appendCommentNode(t,e.document)}function T_(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let i=e.openElements.stackTop;i>=n;i--)e._setEndLocation(e.openElements.items[i],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const i=e.openElements.items[0],a=e.treeAdapter.getNodeSourceCodeLocation(i);if(a&&!a.endTag&&(e._setEndLocation(i,t),e.openElements.stackTop>=1)){const u=e.openElements.items[1],o=e.treeAdapter.getNodeSourceCodeLocation(u);o&&!o.endTag&&e._setEndLocation(u,t)}}}}function fG(e,t){e._setDocumentType(t);const n=t.forceQuirks?pi.QUIRKS:zq(t);Fq(t)||e._err(t,ge.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=X.BEFORE_HTML}function pd(e,t){e._err(t,ge.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,pi.QUIRKS),e.insertionMode=X.BEFORE_HTML,e._processToken(t)}function hG(e,t){t.tagID===S.HTML?(e._insertElement(t,Se.HTML),e.insertionMode=X.BEFORE_HEAD):Rd(e,t)}function mG(e,t){const n=t.tagID;(n===S.HTML||n===S.HEAD||n===S.BODY||n===S.BR)&&Rd(e,t)}function Rd(e,t){e._insertFakeRootElement(),e.insertionMode=X.BEFORE_HEAD,e._processToken(t)}function pG(e,t){switch(t.tagID){case S.HTML:{hr(e,t);break}case S.HEAD:{e._insertElement(t,Se.HTML),e.headElement=e.openElements.current,e.insertionMode=X.IN_HEAD;break}default:Nd(e,t)}}function gG(e,t){const n=t.tagID;n===S.HEAD||n===S.BODY||n===S.HTML||n===S.BR?Nd(e,t):e._err(t,ge.endTagWithoutMatchingOpenElement)}function Nd(e,t){e._insertFakeElement(oe.HEAD,S.HEAD),e.headElement=e.openElements.current,e.insertionMode=X.IN_HEAD,e._processToken(t)}function ji(e,t){switch(t.tagID){case S.HTML:{hr(e,t);break}case S.BASE:case S.BASEFONT:case S.BGSOUND:case S.LINK:case S.META:{e._appendElement(t,Se.HTML),t.ackSelfClosing=!0;break}case S.TITLE:{e._switchToTextParsing(t,Mn.RCDATA);break}case S.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Mn.RAWTEXT):(e._insertElement(t,Se.HTML),e.insertionMode=X.IN_HEAD_NO_SCRIPT);break}case S.NOFRAMES:case S.STYLE:{e._switchToTextParsing(t,Mn.RAWTEXT);break}case S.SCRIPT:{e._switchToTextParsing(t,Mn.SCRIPT_DATA);break}case S.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=X.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(X.IN_TEMPLATE);break}case S.HEAD:{e._err(t,ge.misplacedStartTagForHeadElement);break}default:Id(e,t)}}function bG(e,t){switch(t.tagID){case S.HEAD:{e.openElements.pop(),e.insertionMode=X.AFTER_HEAD;break}case S.BODY:case S.BR:case S.HTML:{Id(e,t);break}case S.TEMPLATE:{lo(e,t);break}default:e._err(t,ge.endTagWithoutMatchingOpenElement)}}function lo(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==S.TEMPLATE&&e._err(t,ge.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(S.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,ge.endTagWithoutMatchingOpenElement)}function Id(e,t){e.openElements.pop(),e.insertionMode=X.AFTER_HEAD,e._processToken(t)}function _G(e,t){switch(t.tagID){case S.HTML:{hr(e,t);break}case S.BASEFONT:case S.BGSOUND:case S.HEAD:case S.LINK:case S.META:case S.NOFRAMES:case S.STYLE:{ji(e,t);break}case S.NOSCRIPT:{e._err(t,ge.nestedNoscriptInHead);break}default:kd(e,t)}}function yG(e,t){switch(t.tagID){case S.NOSCRIPT:{e.openElements.pop(),e.insertionMode=X.IN_HEAD;break}case S.BR:{kd(e,t);break}default:e._err(t,ge.endTagWithoutMatchingOpenElement)}}function kd(e,t){const n=t.type===yt.EOF?ge.openElementsLeftAfterEof:ge.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=X.IN_HEAD,e._processToken(t)}function EG(e,t){switch(t.tagID){case S.HTML:{hr(e,t);break}case S.BODY:{e._insertElement(t,Se.HTML),e.framesetOk=!1,e.insertionMode=X.IN_BODY;break}case S.FRAMESET:{e._insertElement(t,Se.HTML),e.insertionMode=X.IN_FRAMESET;break}case S.BASE:case S.BASEFONT:case S.BGSOUND:case S.LINK:case S.META:case S.NOFRAMES:case S.SCRIPT:case S.STYLE:case S.TEMPLATE:case S.TITLE:{e._err(t,ge.abandonedHeadElementChild),e.openElements.push(e.headElement,S.HEAD),ji(e,t),e.openElements.remove(e.headElement);break}case S.HEAD:{e._err(t,ge.misplacedStartTagForHeadElement);break}default:Md(e,t)}}function vG(e,t){switch(t.tagID){case S.BODY:case S.HTML:case S.BR:{Md(e,t);break}case S.TEMPLATE:{lo(e,t);break}default:e._err(t,ge.endTagWithoutMatchingOpenElement)}}function Md(e,t){e._insertFakeElement(oe.BODY,S.BODY),e.insertionMode=X.IN_BODY,xm(e,t)}function xm(e,t){switch(t.type){case yt.CHARACTER:{uI(e,t);break}case yt.WHITESPACE_CHARACTER:{lI(e,t);break}case yt.COMMENT:{pb(e,t);break}case yt.START_TAG:{hr(e,t);break}case yt.END_TAG:{wm(e,t);break}case yt.EOF:{mI(e,t);break}}}function lI(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function uI(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function TG(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function AG(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function OG(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Se.HTML),e.insertionMode=X.IN_FRAMESET)}function SG(e,t){e.openElements.hasInButtonScope(S.P)&&e._closePElement(),e._insertElement(t,Se.HTML)}function CG(e,t){e.openElements.hasInButtonScope(S.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&mb.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Se.HTML)}function xG(e,t){e.openElements.hasInButtonScope(S.P)&&e._closePElement(),e._insertElement(t,Se.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function wG(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(S.P)&&e._closePElement(),e._insertElement(t,Se.HTML),n||(e.formElement=e.openElements.current))}function RG(e,t){e.framesetOk=!1;const n=t.tagID;for(let i=e.openElements.stackTop;i>=0;i--){const a=e.openElements.tagIDs[i];if(n===S.LI&&a===S.LI||(n===S.DD||n===S.DT)&&(a===S.DD||a===S.DT)){e.openElements.generateImpliedEndTagsWithExclusion(a),e.openElements.popUntilTagNamePopped(a);break}if(a!==S.ADDRESS&&a!==S.DIV&&a!==S.P&&e._isSpecialElement(e.openElements.items[i],a))break}e.openElements.hasInButtonScope(S.P)&&e._closePElement(),e._insertElement(t,Se.HTML)}function NG(e,t){e.openElements.hasInButtonScope(S.P)&&e._closePElement(),e._insertElement(t,Se.HTML),e.tokenizer.state=Mn.PLAINTEXT}function IG(e,t){e.openElements.hasInScope(S.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(S.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Se.HTML),e.framesetOk=!1}function kG(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(oe.A);n&&(v_(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,Se.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function MG(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Se.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function PG(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(S.NOBR)&&(v_(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Se.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function DG(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Se.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function jG(e,t){e.treeAdapter.getDocumentMode(e.document)!==pi.QUIRKS&&e.openElements.hasInButtonScope(S.P)&&e._closePElement(),e._insertElement(t,Se.HTML),e.framesetOk=!1,e.insertionMode=X.IN_TABLE}function dI(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Se.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function fI(e){const t=eI(e,ro.TYPE);return t!=null&&t.toLowerCase()===eG}function LG(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Se.HTML),fI(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function HG(e,t){e._appendElement(t,Se.HTML),t.ackSelfClosing=!0}function BG(e,t){e.openElements.hasInButtonScope(S.P)&&e._closePElement(),e._appendElement(t,Se.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function UG(e,t){t.tagName=oe.IMG,t.tagID=S.IMG,dI(e,t)}function FG(e,t){e._insertElement(t,Se.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Mn.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=X.TEXT}function zG(e,t){e.openElements.hasInButtonScope(S.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Mn.RAWTEXT)}function $G(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Mn.RAWTEXT)}function ex(e,t){e._switchToTextParsing(t,Mn.RAWTEXT)}function qG(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Se.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===X.IN_TABLE||e.insertionMode===X.IN_CAPTION||e.insertionMode===X.IN_TABLE_BODY||e.insertionMode===X.IN_ROW||e.insertionMode===X.IN_CELL?X.IN_SELECT_IN_TABLE:X.IN_SELECT}function GG(e,t){e.openElements.currentTagId===S.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Se.HTML)}function KG(e,t){e.openElements.hasInScope(S.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Se.HTML)}function YG(e,t){e.openElements.hasInScope(S.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(S.RTC),e._insertElement(t,Se.HTML)}function VG(e,t){e._reconstructActiveFormattingElements(),aI(t),E_(t),t.selfClosing?e._appendElement(t,Se.MATHML):e._insertElement(t,Se.MATHML),t.ackSelfClosing=!0}function ZG(e,t){e._reconstructActiveFormattingElements(),oI(t),E_(t),t.selfClosing?e._appendElement(t,Se.SVG):e._insertElement(t,Se.SVG),t.ackSelfClosing=!0}function tx(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Se.HTML)}function hr(e,t){switch(t.tagID){case S.I:case S.S:case S.B:case S.U:case S.EM:case S.TT:case S.BIG:case S.CODE:case S.FONT:case S.SMALL:case S.STRIKE:case S.STRONG:{MG(e,t);break}case S.A:{kG(e,t);break}case S.H1:case S.H2:case S.H3:case S.H4:case S.H5:case S.H6:{CG(e,t);break}case S.P:case S.DL:case S.OL:case S.UL:case S.DIV:case S.DIR:case S.NAV:case S.MAIN:case S.MENU:case S.ASIDE:case S.CENTER:case S.FIGURE:case S.FOOTER:case S.HEADER:case S.HGROUP:case S.DIALOG:case S.DETAILS:case S.ADDRESS:case S.ARTICLE:case S.SEARCH:case S.SECTION:case S.SUMMARY:case S.FIELDSET:case S.BLOCKQUOTE:case S.FIGCAPTION:{SG(e,t);break}case S.LI:case S.DD:case S.DT:{RG(e,t);break}case S.BR:case S.IMG:case S.WBR:case S.AREA:case S.EMBED:case S.KEYGEN:{dI(e,t);break}case S.HR:{BG(e,t);break}case S.RB:case S.RTC:{KG(e,t);break}case S.RT:case S.RP:{YG(e,t);break}case S.PRE:case S.LISTING:{xG(e,t);break}case S.XMP:{zG(e,t);break}case S.SVG:{ZG(e,t);break}case S.HTML:{TG(e,t);break}case S.BASE:case S.LINK:case S.META:case S.STYLE:case S.TITLE:case S.SCRIPT:case S.BGSOUND:case S.BASEFONT:case S.TEMPLATE:{ji(e,t);break}case S.BODY:{AG(e,t);break}case S.FORM:{wG(e,t);break}case S.NOBR:{PG(e,t);break}case S.MATH:{VG(e,t);break}case S.TABLE:{jG(e,t);break}case S.INPUT:{LG(e,t);break}case S.PARAM:case S.TRACK:case S.SOURCE:{HG(e,t);break}case S.IMAGE:{UG(e,t);break}case S.BUTTON:{IG(e,t);break}case S.APPLET:case S.OBJECT:case S.MARQUEE:{DG(e,t);break}case S.IFRAME:{$G(e,t);break}case S.SELECT:{qG(e,t);break}case S.OPTION:case S.OPTGROUP:{GG(e,t);break}case S.NOEMBED:case S.NOFRAMES:{ex(e,t);break}case S.FRAMESET:{OG(e,t);break}case S.TEXTAREA:{FG(e,t);break}case S.NOSCRIPT:{e.options.scriptingEnabled?ex(e,t):tx(e,t);break}case S.PLAINTEXT:{NG(e,t);break}case S.COL:case S.TH:case S.TD:case S.TR:case S.HEAD:case S.FRAME:case S.TBODY:case S.TFOOT:case S.THEAD:case S.CAPTION:case S.COLGROUP:break;default:tx(e,t)}}function WG(e,t){if(e.openElements.hasInScope(S.BODY)&&(e.insertionMode=X.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function XG(e,t){e.openElements.hasInScope(S.BODY)&&(e.insertionMode=X.AFTER_BODY,TI(e,t))}function QG(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function JG(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(S.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(S.FORM):n&&e.openElements.remove(n))}function eK(e){e.openElements.hasInButtonScope(S.P)||e._insertFakeElement(oe.P,S.P),e._closePElement()}function tK(e){e.openElements.hasInListItemScope(S.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(S.LI),e.openElements.popUntilTagNamePopped(S.LI))}function nK(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function rK(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function iK(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function sK(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(oe.BR,S.BR),e.openElements.pop(),e.framesetOk=!1}function hI(e,t){const n=t.tagName,i=t.tagID;for(let a=e.openElements.stackTop;a>0;a--){const u=e.openElements.items[a],o=e.openElements.tagIDs[a];if(i===o&&(i!==S.UNKNOWN||e.treeAdapter.getTagName(u)===n)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.stackTop>=a&&e.openElements.shortenToLength(a);break}if(e._isSpecialElement(u,o))break}}function wm(e,t){switch(t.tagID){case S.A:case S.B:case S.I:case S.S:case S.U:case S.EM:case S.TT:case S.BIG:case S.CODE:case S.FONT:case S.NOBR:case S.SMALL:case S.STRIKE:case S.STRONG:{v_(e,t);break}case S.P:{eK(e);break}case S.DL:case S.UL:case S.OL:case S.DIR:case S.DIV:case S.NAV:case S.PRE:case S.MAIN:case S.MENU:case S.ASIDE:case S.BUTTON:case S.CENTER:case S.FIGURE:case S.FOOTER:case S.HEADER:case S.HGROUP:case S.DIALOG:case S.ADDRESS:case S.ARTICLE:case S.DETAILS:case S.SEARCH:case S.SECTION:case S.SUMMARY:case S.LISTING:case S.FIELDSET:case S.BLOCKQUOTE:case S.FIGCAPTION:{QG(e,t);break}case S.LI:{tK(e);break}case S.DD:case S.DT:{nK(e,t);break}case S.H1:case S.H2:case S.H3:case S.H4:case S.H5:case S.H6:{rK(e);break}case S.BR:{sK(e);break}case S.BODY:{WG(e,t);break}case S.HTML:{XG(e,t);break}case S.FORM:{JG(e);break}case S.APPLET:case S.OBJECT:case S.MARQUEE:{iK(e,t);break}case S.TEMPLATE:{lo(e,t);break}default:hI(e,t)}}function mI(e,t){e.tmplInsertionModeStack.length>0?vI(e,t):T_(e,t)}function aK(e,t){var n;t.tagID===S.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function oK(e,t){e._err(t,ge.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function M0(e,t){if(e.openElements.currentTagId!==void 0&&cI.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=X.IN_TABLE_TEXT,t.type){case yt.CHARACTER:{gI(e,t);break}case yt.WHITESPACE_CHARACTER:{pI(e,t);break}}else cf(e,t)}function cK(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Se.HTML),e.insertionMode=X.IN_CAPTION}function lK(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Se.HTML),e.insertionMode=X.IN_COLUMN_GROUP}function uK(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(oe.COLGROUP,S.COLGROUP),e.insertionMode=X.IN_COLUMN_GROUP,A_(e,t)}function dK(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Se.HTML),e.insertionMode=X.IN_TABLE_BODY}function fK(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(oe.TBODY,S.TBODY),e.insertionMode=X.IN_TABLE_BODY,Rm(e,t)}function hK(e,t){e.openElements.hasInTableScope(S.TABLE)&&(e.openElements.popUntilTagNamePopped(S.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function mK(e,t){fI(t)?e._appendElement(t,Se.HTML):cf(e,t),t.ackSelfClosing=!0}function pK(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Se.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function gc(e,t){switch(t.tagID){case S.TD:case S.TH:case S.TR:{fK(e,t);break}case S.STYLE:case S.SCRIPT:case S.TEMPLATE:{ji(e,t);break}case S.COL:{uK(e,t);break}case S.FORM:{pK(e,t);break}case S.TABLE:{hK(e,t);break}case S.TBODY:case S.TFOOT:case S.THEAD:{dK(e,t);break}case S.INPUT:{mK(e,t);break}case S.CAPTION:{cK(e,t);break}case S.COLGROUP:{lK(e,t);break}default:cf(e,t)}}function qd(e,t){switch(t.tagID){case S.TABLE:{e.openElements.hasInTableScope(S.TABLE)&&(e.openElements.popUntilTagNamePopped(S.TABLE),e._resetInsertionMode());break}case S.TEMPLATE:{lo(e,t);break}case S.BODY:case S.CAPTION:case S.COL:case S.COLGROUP:case S.HTML:case S.TBODY:case S.TD:case S.TFOOT:case S.TH:case S.THEAD:case S.TR:break;default:cf(e,t)}}function cf(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,xm(e,t),e.fosterParentingEnabled=n}function pI(e,t){e.pendingCharacterTokens.push(t)}function gI(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function gd(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)cf(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const bI=new Set([S.CAPTION,S.COL,S.COLGROUP,S.TBODY,S.TD,S.TFOOT,S.TH,S.THEAD,S.TR]);function gK(e,t){const n=t.tagID;bI.has(n)?e.openElements.hasInTableScope(S.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(S.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=X.IN_TABLE,gc(e,t)):hr(e,t)}function bK(e,t){const n=t.tagID;switch(n){case S.CAPTION:case S.TABLE:{e.openElements.hasInTableScope(S.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(S.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=X.IN_TABLE,n===S.TABLE&&qd(e,t));break}case S.BODY:case S.COL:case S.COLGROUP:case S.HTML:case S.TBODY:case S.TD:case S.TFOOT:case S.TH:case S.THEAD:case S.TR:break;default:wm(e,t)}}function A_(e,t){switch(t.tagID){case S.HTML:{hr(e,t);break}case S.COL:{e._appendElement(t,Se.HTML),t.ackSelfClosing=!0;break}case S.TEMPLATE:{ji(e,t);break}default:om(e,t)}}function _K(e,t){switch(t.tagID){case S.COLGROUP:{e.openElements.currentTagId===S.COLGROUP&&(e.openElements.pop(),e.insertionMode=X.IN_TABLE);break}case S.TEMPLATE:{lo(e,t);break}case S.COL:break;default:om(e,t)}}function om(e,t){e.openElements.currentTagId===S.COLGROUP&&(e.openElements.pop(),e.insertionMode=X.IN_TABLE,e._processToken(t))}function Rm(e,t){switch(t.tagID){case S.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,Se.HTML),e.insertionMode=X.IN_ROW;break}case S.TH:case S.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(oe.TR,S.TR),e.insertionMode=X.IN_ROW,Nm(e,t);break}case S.CAPTION:case S.COL:case S.COLGROUP:case S.TBODY:case S.TFOOT:case S.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=X.IN_TABLE,gc(e,t));break}default:gc(e,t)}}function gb(e,t){const n=t.tagID;switch(t.tagID){case S.TBODY:case S.TFOOT:case S.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=X.IN_TABLE);break}case S.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=X.IN_TABLE,qd(e,t));break}case S.BODY:case S.CAPTION:case S.COL:case S.COLGROUP:case S.HTML:case S.TD:case S.TH:case S.TR:break;default:qd(e,t)}}function Nm(e,t){switch(t.tagID){case S.TH:case S.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,Se.HTML),e.insertionMode=X.IN_CELL,e.activeFormattingElements.insertMarker();break}case S.CAPTION:case S.COL:case S.COLGROUP:case S.TBODY:case S.TFOOT:case S.THEAD:case S.TR:{e.openElements.hasInTableScope(S.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=X.IN_TABLE_BODY,Rm(e,t));break}default:gc(e,t)}}function _I(e,t){switch(t.tagID){case S.TR:{e.openElements.hasInTableScope(S.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=X.IN_TABLE_BODY);break}case S.TABLE:{e.openElements.hasInTableScope(S.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=X.IN_TABLE_BODY,gb(e,t));break}case S.TBODY:case S.TFOOT:case S.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(S.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=X.IN_TABLE_BODY,gb(e,t));break}case S.BODY:case S.CAPTION:case S.COL:case S.COLGROUP:case S.HTML:case S.TD:case S.TH:break;default:qd(e,t)}}function yK(e,t){const n=t.tagID;bI.has(n)?(e.openElements.hasInTableScope(S.TD)||e.openElements.hasInTableScope(S.TH))&&(e._closeTableCell(),Nm(e,t)):hr(e,t)}function EK(e,t){const n=t.tagID;switch(n){case S.TD:case S.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=X.IN_ROW);break}case S.TABLE:case S.TBODY:case S.TFOOT:case S.THEAD:case S.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),_I(e,t));break}case S.BODY:case S.CAPTION:case S.COL:case S.COLGROUP:case S.HTML:break;default:wm(e,t)}}function yI(e,t){switch(t.tagID){case S.HTML:{hr(e,t);break}case S.OPTION:{e.openElements.currentTagId===S.OPTION&&e.openElements.pop(),e._insertElement(t,Se.HTML);break}case S.OPTGROUP:{e.openElements.currentTagId===S.OPTION&&e.openElements.pop(),e.openElements.currentTagId===S.OPTGROUP&&e.openElements.pop(),e._insertElement(t,Se.HTML);break}case S.HR:{e.openElements.currentTagId===S.OPTION&&e.openElements.pop(),e.openElements.currentTagId===S.OPTGROUP&&e.openElements.pop(),e._appendElement(t,Se.HTML),t.ackSelfClosing=!0;break}case S.INPUT:case S.KEYGEN:case S.TEXTAREA:case S.SELECT:{e.openElements.hasInSelectScope(S.SELECT)&&(e.openElements.popUntilTagNamePopped(S.SELECT),e._resetInsertionMode(),t.tagID!==S.SELECT&&e._processStartTag(t));break}case S.SCRIPT:case S.TEMPLATE:{ji(e,t);break}}}function EI(e,t){switch(t.tagID){case S.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===S.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===S.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===S.OPTGROUP&&e.openElements.pop();break}case S.OPTION:{e.openElements.currentTagId===S.OPTION&&e.openElements.pop();break}case S.SELECT:{e.openElements.hasInSelectScope(S.SELECT)&&(e.openElements.popUntilTagNamePopped(S.SELECT),e._resetInsertionMode());break}case S.TEMPLATE:{lo(e,t);break}}}function vK(e,t){const n=t.tagID;n===S.CAPTION||n===S.TABLE||n===S.TBODY||n===S.TFOOT||n===S.THEAD||n===S.TR||n===S.TD||n===S.TH?(e.openElements.popUntilTagNamePopped(S.SELECT),e._resetInsertionMode(),e._processStartTag(t)):yI(e,t)}function TK(e,t){const n=t.tagID;n===S.CAPTION||n===S.TABLE||n===S.TBODY||n===S.TFOOT||n===S.THEAD||n===S.TR||n===S.TD||n===S.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(S.SELECT),e._resetInsertionMode(),e.onEndTag(t)):EI(e,t)}function AK(e,t){switch(t.tagID){case S.BASE:case S.BASEFONT:case S.BGSOUND:case S.LINK:case S.META:case S.NOFRAMES:case S.SCRIPT:case S.STYLE:case S.TEMPLATE:case S.TITLE:{ji(e,t);break}case S.CAPTION:case S.COLGROUP:case S.TBODY:case S.TFOOT:case S.THEAD:{e.tmplInsertionModeStack[0]=X.IN_TABLE,e.insertionMode=X.IN_TABLE,gc(e,t);break}case S.COL:{e.tmplInsertionModeStack[0]=X.IN_COLUMN_GROUP,e.insertionMode=X.IN_COLUMN_GROUP,A_(e,t);break}case S.TR:{e.tmplInsertionModeStack[0]=X.IN_TABLE_BODY,e.insertionMode=X.IN_TABLE_BODY,Rm(e,t);break}case S.TD:case S.TH:{e.tmplInsertionModeStack[0]=X.IN_ROW,e.insertionMode=X.IN_ROW,Nm(e,t);break}default:e.tmplInsertionModeStack[0]=X.IN_BODY,e.insertionMode=X.IN_BODY,hr(e,t)}}function OK(e,t){t.tagID===S.TEMPLATE&&lo(e,t)}function vI(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(S.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):T_(e,t)}function SK(e,t){t.tagID===S.HTML?hr(e,t):cm(e,t)}function TI(e,t){var n;if(t.tagID===S.HTML){if(e.fragmentContext||(e.insertionMode=X.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===S.HTML){e._setEndLocation(e.openElements.items[0],t);const i=e.openElements.items[1];i&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(i))===null||n===void 0)&&n.endTag)&&e._setEndLocation(i,t)}}else cm(e,t)}function cm(e,t){e.insertionMode=X.IN_BODY,xm(e,t)}function CK(e,t){switch(t.tagID){case S.HTML:{hr(e,t);break}case S.FRAMESET:{e._insertElement(t,Se.HTML);break}case S.FRAME:{e._appendElement(t,Se.HTML),t.ackSelfClosing=!0;break}case S.NOFRAMES:{ji(e,t);break}}}function xK(e,t){t.tagID===S.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==S.FRAMESET&&(e.insertionMode=X.AFTER_FRAMESET))}function wK(e,t){switch(t.tagID){case S.HTML:{hr(e,t);break}case S.NOFRAMES:{ji(e,t);break}}}function RK(e,t){t.tagID===S.HTML&&(e.insertionMode=X.AFTER_AFTER_FRAMESET)}function NK(e,t){t.tagID===S.HTML?hr(e,t):Yh(e,t)}function Yh(e,t){e.insertionMode=X.IN_BODY,xm(e,t)}function IK(e,t){switch(t.tagID){case S.HTML:{hr(e,t);break}case S.NOFRAMES:{ji(e,t);break}}}function kK(e,t){t.chars=mn,e._insertCharacters(t)}function MK(e,t){e._insertCharacters(t),e.framesetOk=!1}function AI(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Se.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function PK(e,t){if(Zq(t))AI(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),i=e.treeAdapter.getNamespaceURI(n);i===Se.MATHML?aI(t):i===Se.SVG&&(Wq(t),oI(t)),E_(t),t.selfClosing?e._appendElement(t,i):e._insertElement(t,i),t.ackSelfClosing=!0}}function DK(e,t){if(t.tagID===S.P||t.tagID===S.BR){AI(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const i=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(i)===Se.HTML){e._endTagOutsideForeignContent(t);break}const a=e.treeAdapter.getTagName(i);if(a.toLowerCase()===t.tagName){t.tagName=a,e.openElements.shortenToLength(n);break}}}oe.AREA,oe.BASE,oe.BASEFONT,oe.BGSOUND,oe.BR,oe.COL,oe.EMBED,oe.FRAME,oe.HR,oe.IMG,oe.INPUT,oe.KEYGEN,oe.LINK,oe.META,oe.PARAM,oe.SOURCE,oe.TRACK,oe.WBR;const jK=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,LK=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),nx={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function OI(e,t){const n=YK(e),i=XR("type",{handlers:{root:HK,element:BK,text:UK,comment:CI,doctype:FK,raw:$K},unknown:qK}),a={parser:n?new JC(nx):JC.getFragmentParser(void 0,nx),handle(f){i(f,a)},stitches:!1,options:t||{}};i(e,a),xc(a,Vi());const u=n?a.parser.document:a.parser.getFragment(),o=H$(u,{file:a.options.file});return a.stitches&&sf(o,"comment",function(f,d,l){const h=f;if(h.value.stitch&&l&&d!==void 0){const m=l.children;return m[d]=h.value.stitch,d}}),o.type==="root"&&o.children.length===1&&o.children[0].type===e.type?o.children[0]:o}function SI(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function HK(e,t){SI(e.children,t)}function BK(e,t){GK(e,t),SI(e.children,t),KK(e,t)}function UK(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:yt.CHARACTER,chars:e.value,location:lf(e)};xc(t,Vi(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function FK(e,t){const n={type:yt.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:lf(e)};xc(t,Vi(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function zK(e,t){t.stitches=!0;const n=VK(e);if("children"in e&&"children"in n){const i=OI({type:"root",children:e.children},t.options);n.children=i.children}CI({type:"comment",value:{stitch:n}},t)}function CI(e,t){const n=e.value,i={type:yt.COMMENT,data:n,location:lf(e)};xc(t,Vi(e)),t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken)}function $K(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,xI(t,Vi(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(jK,"&lt;$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function qK(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))zK(n,t);else{let i="";throw LK.has(n.type)&&(i=". 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"+i)}}function xc(e,t){xI(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Mn.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function xI(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function GK(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Mn.PLAINTEXT)return;xc(t,Vi(e));const i=t.parser.openElements.current;let a="namespaceURI"in i?i.namespaceURI:no.html;a===no.html&&n==="svg"&&(a=no.svg);const u=J$({...e,children:[]},{space:a===no.svg?"svg":"html"}),o={type:yt.START_TAG,tagName:n,tagID:Cc(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in u?u.attrs:[],location:lf(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function KK(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&oq.includes(n)||t.parser.tokenizer.state===Mn.PLAINTEXT)return;xc(t,Tm(e));const i={type:yt.END_TAG,tagName:n,tagID:Cc(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:lf(e)};t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Mn.RCDATA||t.parser.tokenizer.state===Mn.RAWTEXT||t.parser.tokenizer.state===Mn.SCRIPT_DATA)&&(t.parser.tokenizer.state=Mn.DATA)}function YK(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function lf(e){const t=Vi(e)||{line:void 0,column:void 0,offset:void 0},n=Tm(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function VK(e){return"children"in e?pc({...e,children:[]}):pc(e)}function ZK(e){return function(t,n){return OI(t,{...e,file:n})}}function WK(e){let t=e;if((e.match(/^```/gm)||[]).length%2!==0){const o=e.lastIndexOf("```");if(o!==-1){const f=e.slice(o+3);f.includes(`
385
+ `)&&!f.trim().endsWith("```")&&(t=e+"\n```")}}if((e.match(new RegExp("(?<!`)`(?!`)","g"))||[]).length%2!==0){const o=e.lastIndexOf("`");e.slice(o+1).trim().length>0&&(t=e+"`")}return e.match(/\[([^\]]*)\]\((?!.*?\))/)&&(t=e+")"),(e.match(/\*\*/g)||[]).length%2!==0&&(t=t+"**"),t}function XK({content:e,className:t="",isStreaming:n=!1}){const i=J.useMemo(()=>n?WK(e):e,[e,n]);return!e&&!i?null:_.jsxs("div",{className:`markdown-content ${t}`,children:[_.jsx(S9,{remarkPlugins:[Hz],rehypePlugins:[C$,ZK],components:{code({node:a,inline:u,className:o,children:f,...d}){return u?_.jsx("code",{className:"inline-code",...d,children:f}):_.jsx("code",{className:o,...d,children:f})},a({node:a,children:u,href:o,...f}){return _.jsx("a",{href:o,target:"_blank",rel:"noopener noreferrer",...f,children:u})}},children:i}),n&&_.jsx("span",{className:"streaming-cursor",children:"▊"})]})}function rx(e,t){const n=e.toLowerCase(),i=t.toLowerCase();return n.includes(i)}function QK({value:e,onChange:t,mentions:n,onMentionsChange:i,servers:a,tools:u,placeholder:o,disabled:f,onKeyPress:d,onKeyDown:l,inputRef:h}){const[m,g]=J.useState(!1),[b,E]=J.useState(""),[T,O]=J.useState(0),[v,C]=J.useState("down"),[x,I]=J.useState(0),[j,R]=J.useState(new Map),k=J.useRef(null),P=h||k,z=J.useRef(null),L=J.useRef(null),G=J.useRef(null),F=J.useMemo(()=>{const N=[],M=a.filter(q=>q.connected);return M.forEach(q=>{N.push({type:"server",id:q.id,name:q.name})}),M.forEach(q=>{(u[q.id]||[]).forEach(ie=>{N.push({type:"tool",id:ie.name,name:ie.name,serverId:q.id,serverName:q.name})})}),N},[a,u]),K=J.useMemo(()=>b?F.filter(N=>{const M=rx(N.name,b),q=N.serverName?rx(N.serverName,b):!1;return M||q}):F,[F,b]);J.useEffect(()=>{O(0)},[K.length]),J.useEffect(()=>{m&&G.current&&setTimeout(()=>{G.current?.focus()},50)},[m]),J.useEffect(()=>{const N=async()=>{const M=new Map(j);let q=!1;for(const D of n)if(D.type==="tool"&&D.serverId&&!M.has(D.serverId)){const ie=a.find(ae=>ae.id===D.serverId);if(ie?.url)try{const{getFaviconUrl:ae}=await D0(async()=>{const{getFaviconUrl:de}=await Promise.resolve().then(()=>y1);return{getFaviconUrl:de}},void 0),fe=ie.auth?.oauthServerMetadata?.logo_uri,Ee=await ae(ie.url,fe);M.set(D.serverId,Ee),q=!0}catch{M.set(D.serverId,null),q=!0}}else if(D.type==="server"&&!M.has(D.id)){const ie=a.find(ae=>ae.id===D.id);if(ie?.url)try{const{getFaviconUrl:ae}=await D0(async()=>{const{getFaviconUrl:de}=await Promise.resolve().then(()=>y1);return{getFaviconUrl:de}},void 0),fe=ie.auth?.oauthServerMetadata?.logo_uri,Ee=await ae(ie.url,fe);M.set(D.id,Ee),q=!0}catch{M.set(D.id,null),q=!0}}q&&R(M)};n.length>0&&N()},[n,a,j]);const B=N=>{E(N),O(0)},Z=N=>{const M=N.target.value,q=N.target.selectionStart||0;t(M),I(q);const D=M.slice(0,q),ie=D.lastIndexOf("@");if(ie!==-1){const ae=D.slice(ie+1),fe=ie>0?D[ie-1]:" ",Ee=fe===" "||fe===`
386
+ `,de=ae.includes(" ")||ae.includes(`
387
+ `);if((ie===0||Ee)&&!de){if(E(ae),!m&&(g(!0),P.current)){const le=P.current.getBoundingClientRect(),re=window.innerHeight-le.bottom,Ae=le.top;C(re<300&&Ae>re?"up":"down")}return}}m&&!G.current&&(g(!1),E(""))},U=()=>{if(!m&&(E(""),O(0),L.current)){const N=L.current.getBoundingClientRect(),q=window.innerHeight-N.bottom,D=N.top;C(q<300&&D>q?"up":"down")}g(!m)},Y=N=>{const M={type:N.type,id:N.id,name:N.name,serverId:N.serverId,serverName:N.serverName};if(n.some(D=>D.type===M.type&&D.id===M.id&&(D.type==="server"||D.serverId===M.serverId))||i([...n,M]),P.current&&e.includes("@")){const D=x,ae=e.slice(0,D).lastIndexOf("@");if(ae!==-1){const fe=e.slice(0,ae),Ee=e.slice(D);t(fe+Ee)}}g(!1),E(""),setTimeout(()=>{P.current?.focus()},0)},W=N=>{N.key==="ArrowDown"?(N.preventDefault(),K.length>0&&O(M=>(M+1)%K.length)):N.key==="ArrowUp"?(N.preventDefault(),K.length>0&&O(M=>(M-1+K.length)%K.length)):N.key==="Enter"?(N.preventDefault(),K.length>0&&Y(K[T])):N.key==="Escape"&&(N.preventDefault(),g(!1),E(""),P.current?.focus())},pe=N=>{const M=n.filter(q=>!(q.type===N.type&&q.id===N.id&&(q.type==="server"||q.serverId===N.serverId)));i(M)};return J.useEffect(()=>{const N=M=>{z.current&&!z.current.contains(M.target)&&P.current&&!P.current.contains(M.target)&&g(!1)};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[]),_.jsx("div",{className:"mention-input-wrapper",children:_.jsxs("div",{className:"mention-input-container",children:[n.length>0&&_.jsxs("div",{className:"mention-tags",children:[n.map((N,M)=>{const q=N.type==="server"?N.id:N.serverId,D=q?j.get(q):null;return _.jsxs("div",{className:"mention-tag",children:[N.type==="server"?_.jsxs(_.Fragment,{children:[D?_.jsx("img",{src:D,alt:"",className:"mention-tag-favicon"}):_.jsx(fc,{size:12}),_.jsx("span",{children:N.name})]}):_.jsxs(_.Fragment,{children:[D?_.jsx("img",{src:D,alt:"",className:"mention-tag-favicon"}):_.jsx(xs,{size:12}),_.jsx("span",{children:N.name})]}),_.jsx("button",{className:"mention-tag-remove",onClick:()=>pe(N),title:"Remove mention",disabled:f,children:"×"})]},`${N.type}-${N.id}-${M}`)}),_.jsx("button",{ref:L,className:"mention-add-button",onClick:U,title:"Add server or tool",disabled:f,children:"+"})]}),n.length===0&&_.jsxs("button",{ref:L,className:"mention-filter-button",onClick:U,title:"Pin servers or tools",disabled:f,children:[_.jsx(fa,{size:14}),_.jsx("span",{children:"Filter servers and tools"})]}),_.jsx("textarea",{ref:P,className:"mention-input",value:e,onChange:Z,onKeyDown:l,onKeyPress:d,placeholder:o,disabled:f,rows:1}),m&&_.jsxs("div",{ref:z,className:`mention-dropdown ${v==="up"?"mention-dropdown-up":"mention-dropdown-down"}`,children:[_.jsx("div",{className:"mention-dropdown-header",children:_.jsx("input",{ref:G,type:"text",className:"mention-dropdown-search",placeholder:"Search servers and tools...",value:b,onChange:N=>B(N.target.value),onKeyDown:W,autoFocus:!0})}),_.jsx("div",{className:"mention-dropdown-list",children:K.length>0?K.map((N,M)=>_.jsxs("div",{className:`mention-dropdown-item ${M===T?"selected":""}`,onClick:()=>Y(N),onMouseEnter:()=>O(M),children:[_.jsx("div",{className:"mention-dropdown-item-icon",children:N.type==="server"?_.jsx(fc,{size:14}):_.jsx(xs,{size:14})}),_.jsxs("div",{className:"mention-dropdown-item-content",children:[_.jsx("div",{className:"mention-dropdown-item-name",children:N.name}),N.type==="tool"&&N.serverName&&_.jsx("div",{className:"mention-dropdown-item-meta",children:N.serverName})]}),_.jsx("div",{className:"mention-dropdown-item-type",children:N.type})]},`${N.type}-${N.id}-${N.serverId||""}`)):_.jsx("div",{className:"mention-dropdown-empty",children:"No servers or tools found"})})]})]})})}function wI(e){return{type:"function",function:{name:e.name,description:e.description||`Call the ${e.name} tool`,parameters:{type:"object",properties:e.inputSchema.properties||{},required:e.inputSchema.required||[]}}}}function JK(e){const t=new Set,n=[];for(const i of e){if(t.has(i.toolName)){console.warn(`[ToolConverter] Skipping duplicate tool: ${i.toolName}`);continue}t.add(i.toolName),n.push({type:"function",function:{name:i.toolName,description:i.tool.description||`Call the ${i.toolName} tool`,parameters:{type:"object",properties:i.tool.inputSchema?.properties||{},required:i.tool.inputSchema?.required||[]}}})}return n}function eY(e){const t=new Set,n=[];for(const i of Object.values(e))for(const a of i){if(t.has(a.name)){console.warn(`[ToolConverter] Skipping duplicate tool: ${a.name}`);continue}t.add(a.name),n.push(wI(a))}return n}function tY(e,t){for(const[n,i]of Object.entries(t))if(i.some(a=>a.name===e))return n;return null}const RI="http://localhost:8008";async function NI(e,t={}){const n=await Gd(),i=new Headers(t.headers);return i.set("x-hoot-token",n),i.set("Content-Type","application/json"),fetch(e,{...t,headers:i})}let Pd=!1,bb=null;async function nY(e,t){try{console.log("[ToolFilter] Initializing on backend...");const n=e.filter(f=>f.connected);if(n.length===0)return console.log("[ToolFilter] No connected servers, skipping initialization"),Pd=!1,{success:!1,error:"No connected servers"};const i=n.map(f=>({id:f.id,name:f.name,tools:t[f.id]||[]})),a=i.reduce((f,d)=>f+d.tools.length,0);console.log(`[ToolFilter] Sending ${i.length} servers with ${a} tools to backend`);const u=await NI(`${RI}/mcp/tool-filter/initialize`,{method:"POST",body:JSON.stringify({servers:i})}),o=await u.json();if(!u.ok||!o.success){const f=o.error||"Backend initialization failed";throw console.error("[ToolFilter] Backend initialization failed:",f),new Error(f)}return Pd=!0,bb=null,console.log("[ToolFilter] Backend initialization complete"),{success:!0}}catch(n){return console.error("[ToolFilter] Backend initialization failed:",n),Pd=!1,bb=n,{success:!1,error:n instanceof Error?n.message:"Unknown error"}}}async function rY(e,t){if(!Pd)return console.warn("[ToolFilter] Filter not initialized on backend"),null;try{const n=await NI(`${RI}/mcp/tool-filter/filter`,{method:"POST",body:JSON.stringify({messages:e,options:t})}),i=await n.json();if(!n.ok||!i.success)throw new Error(i.error||"Backend filtering failed");return console.log(`[ToolFilter] Backend filtered to ${i.tools.length} tools in ${i.metrics.totalTime.toFixed(2)}ms`),{tools:i.tools,metrics:i.metrics}}catch(n){return console.error("[ToolFilter] Backend filtering failed:",n),null}}function iY(){Pd=!1,bb=null,console.log("[ToolFilter] Filter reset")}function sY(){const e=Ue(m=>m.servers),t=Ue(m=>m.tools),n=Ue(m=>m.toolFilterEnabled),i=Ue(m=>m.toolFilterReady),a=Ue(m=>m.setToolFilterReady),u=J.useRef(""),o=J.useRef(""),f=J.useRef(!1),d=J.useRef(null),l=e.filter(m=>m.connected).map(m=>m.id).sort().join(","),h=Object.keys(t).sort().map(m=>`${m}:${t[m].length}`).join(",");return J.useEffect(()=>{if(!n){a(!1);return}const m=l!==u.current,g=h!==o.current;if(!m&&!g)return;d.current&&(clearTimeout(d.current),d.current=null),u.current=l,o.current=h;const b=e.filter(C=>C.connected);if(b.length===0){console.log("[useToolFilter] No connected servers, skipping initialization"),a(!1);return}const E=Object.values(t).flat().length;if(E===0){console.log("[useToolFilter] No tools available, skipping initialization"),a(!1);return}console.log("[useToolFilter] Scheduling filter initialization in 500ms...");const T=[...b],O={...t},v=E;d.current=setTimeout(()=>{if(f.current){console.log("[useToolFilter] Initialization already in progress");return}f.current=!0,console.log("[useToolFilter] Initializing filter with",{servers:T.length,tools:v}),iY(),nY(T,O).then(C=>{C.success?(console.log("[useToolFilter] Filter initialized successfully"),a(!0)):(console.warn("[useToolFilter] Filter initialization failed:",C.error),a(!1))}).catch(C=>{console.error("[useToolFilter] Filter initialization error:",C),a(!1)}).finally(()=>{f.current=!1})},2e3)},[l,h,n,a]),{isReady:i,isEnabled:n}}const _b="hoot-chat-messages",yb="hoot-chat-mentions",aY=()=>{const e=localStorage.getItem(_b);if(e)try{const i=JSON.parse(e);if(Array.isArray(i)&&i.length>0)return i}catch(i){console.warn("Failed to parse saved messages:",i)}const t=localStorage.getItem("hoot-selected-model")||"@openai/gpt-4o-mini";return[{role:"system",content:`👋 Hi! I'm connected to ${Ki(t)} and can use your MCP tools. What would you like to do?`}]},oY=()=>{const e=localStorage.getItem(yb);if(e)try{const t=JSON.parse(e);if(Array.isArray(t))return t}catch(t){console.warn("Failed to parse saved mentions:",t)}return[]};function cY(){const[e,t]=J.useState(aY()),[n,i]=J.useState(""),[a,u]=J.useState(oY()),[o,f]=J.useState(!1),[d,l]=J.useState(-1),[h,m]=J.useState(null),[g,b]=J.useState(!1),[E,T]=J.useState(null),[O,v]=J.useState(null),C=J.useRef(new Map),x=J.useRef(null),I=J.useRef(null),j=Ue(N=>N.servers),R=Ue(N=>N.tools),k=Ue(N=>N.toolFilterEnabled),P=Ue(N=>N.setToolFilterEnabled),z=Ue(N=>N.toolFilterConfig),{isReady:L}=sY(),G=j.filter(N=>N.connected),F=Object.values(R).flat();J.useEffect(()=>{Q0()},[]),J.useEffect(()=>{const N=()=>{if(e.length===1&&e[0].role==="system"){const M=localStorage.getItem("hoot-selected-model")||"@openai/gpt-4o-mini",q=Ki(M);t([{role:"system",content:`👋 Hi! I'm connected to ${q} and can use your MCP tools. What would you like to do?`}])}};return window.addEventListener("model-changed",N),()=>{window.removeEventListener("model-changed",N)}},[e]);const K=()=>{x.current?.scrollIntoView({behavior:"auto",block:"nearest"})},B=async N=>{const M=C.current.get(N);if(M!==void 0)return M;const q=j.find(D=>D.id===N);if(q?.url)try{const D=q.auth?.oauthServerMetadata?.logo_uri,ie=await Hd(q.url,D);return C.current.set(N,ie),ie}catch{return C.current.set(N,null),null}return C.current.set(N,null),null};J.useEffect(()=>{K()},[e]),J.useEffect(()=>{localStorage.setItem(_b,JSON.stringify(e))},[e]),J.useEffect(()=>{localStorage.setItem(yb,JSON.stringify(a))},[a]),J.useEffect(()=>{const N=M=>{(M.metaKey||M.ctrlKey)&&M.key==="k"&&(M.preventDefault(),e.length>1&&Z()),M.key==="/"&&document.activeElement!==I.current&&(M.preventDefault(),I.current?.focus())};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[e.length]);const Z=()=>{const N=localStorage.getItem("hoot-selected-model")||"@openai/gpt-4o-mini",q={role:"system",content:`👋 Hi! I'm connected to ${Ki(N)} and can use your MCP tools. What would you like to do?`};t([q]),m(null),u([]),localStorage.removeItem(_b),localStorage.removeItem(yb)},U=async N=>{const M=Object.values(R).flat().length;if(N=N.filter(ie=>ie.role!=="system"),a.length>0){console.log("[Chat] Using pinned tools from mentions, bypassing semantic filtering");const ie=[],ae=new Set;for(const le of a)if(le.type==="server"){const Pe=R[le.id]||[];for(const re of Pe)ae.has(re.name)||(ae.add(re.name),ie.push(re))}else if(le.type==="tool"&&!ae.has(le.name))for(const Pe of Object.values(R)){const re=Pe.find(Ae=>Ae.name===le.name);if(re){ae.add(le.name),ie.push(re);break}}const fe=ie.slice(0,120);ie.length>120&&console.warn(`[Chat] Pinned tool count (${ie.length}) exceeds OpenAI limit (128), truncated to first 120 tools`);const Ee=fe.map(le=>wI(le)),de=await Promise.all(fe.map(async le=>{let Pe="Unknown",re;for(const[Ae,Ce]of Object.entries(R))if(Ce.some(Me=>Me.name===le.name)){const Me=j.find(He=>He.id===Ae);Me&&(Pe=Me.name,re=await B(Ae)||void 0);break}return{toolName:le.name,serverName:Pe,serverIcon:re}}));return v({toolsUsed:fe.length,toolsTotal:M,lastFilterTime:0}),console.log(`[Chat] Using ${fe.length} pinned tools (bypassing semantic filtering)`),{tools:Ee,metrics:{toolsUsed:fe.length,toolsTotal:M,filterTime:0,toolDetails:de}}}if(k&&L&&M>0)try{console.log("[Tool Filter] Context sent to filtering library:",N);const ie=await rY(N,z);if(console.log("[Tool Filter] Response from filtering library:",ie),ie){const ae=JK(ie.tools),fe=new Map;for(const re of ie.tools)for(const[Ae,Ce]of Object.entries(R))if(Ce.some(Me=>Me.name===re.toolName)){const Me=j.find(He=>He.id===Ae);Me&&fe.set(Ae,{serverId:Ae,serverName:Me.name});break}const Ee=Array.from(fe.values()).map(async({serverId:re})=>{const Ae=j.find(Ce=>Ce.id===re);if(Ae?.url){const Ce=Ae.auth?.oauthServerMetadata?.logo_uri,Me=await Hd(Ae.url,Ce);return{serverId:re,faviconUrl:Me}}return{serverId:re,faviconUrl:null}}),de=await Promise.all(Ee),le=new Map(de.map(({serverId:re,faviconUrl:Ae})=>[re,Ae])),Pe=ie.tools.map(re=>{let Ae="Unknown",Ce;for(const[Me,He]of Object.entries(R))if(He.some(Ne=>Ne.name===re.toolName)){const Ne=j.find(Ge=>Ge.id===Me);Ne&&(Ae=Ne.name,Ce=le.get(Me)||void 0);break}return{toolName:re.toolName,serverName:Ae,serverIcon:Ce}});return v({toolsUsed:ie.tools.length,toolsTotal:M,lastFilterTime:ie.metrics.totalTime}),console.log(`[Chat] Using ${ie.tools.length}/${M} filtered tools (${ie.metrics.totalTime.toFixed(1)}ms)`),{tools:ae,metrics:{toolsUsed:ie.tools.length,toolsTotal:M,filterTime:ie.metrics.totalTime,toolDetails:Pe}}}}catch(ie){console.warn("[Chat] Filtering failed, falling back to all tools:",ie)}const q=eY(R),D=q.slice(0,120);return v({toolsUsed:D.length,toolsTotal:M,lastFilterTime:0}),q.length>120&&console.warn(`[Chat] Tool count (${q.length}) exceeds OpenAI limit (128), truncated to first 120 tools`),console.log(`[Chat] Using all ${D.length} tools (filtering disabled or unavailable)`),{tools:D,metrics:null}},Y=async()=>{if(!n.trim()||o)return;if(G.length===0){alert("Please connect to at least one MCP server in the Test Tools tab first.");return}if(F.length===0){alert("No tools available yet. Please wait for servers to load their tools.");return}const N={role:"user",content:n};t(M=>[...M,N]),i(""),f(!0);try{const M=Q0();if(!M)throw new Error("Portkey client not initialized");const q=e.filter(fe=>fe.role==="user"||fe.role==="assistant"||fe.role==="system"&&!fe.filterMetrics).map(fe=>({role:fe.role,content:fe.content}));q.length===0&&q.unshift({role:"system",content:`You are Hoot's AI assistant. Hoot is a web-based MCP (Model Context Protocol) client that connects to multiple servers, giving you access to a wide range of tools and services.
388
+
389
+ Your available tools are intelligently filtered using semantic similarity to show only the most relevant options for the current conversation. When you need to accomplish a task, use the provided tools effectively.
390
+
391
+ Be helpful, clear about what actions you're taking, and explain tool results in a natural way.`}),q.push({role:"user",content:n});const D=10;let ie=q,ae=0;for(;ae<D;){ae++,console.log(`[Chat] LLM call iteration ${ae}`);let fe=-1;ae===1&&k&&t(Me=>(fe=Me.length,[...Me,{role:"system",content:"🔍 Filtering tools for context..."}]));const{tools:Ee,metrics:de}=await U(ie);fe!==-1&&de?t(Me=>{const He=[...Me];return He[fe]={role:"system",content:"",filterMetrics:de},He}):fe!==-1&&!de?t(Me=>{const He=[...Me];return He.splice(fe,1),He}):ae>1&&de&&t(Me=>[...Me,{role:"system",content:"",filterMetrics:de}]);let le=-1,Pe="",re=[];const Ae=M.createChatCompletionStream({messages:ie,tools:Ee.length>0?Ee:void 0});for await(const Me of Ae){const He=Me.choices?.[0]?.delta;if(He&&(He.content&&(Pe+=He.content,t(Ne=>{if(le===-1)return le=Ne.length,l(le),[...Ne,{role:"assistant",content:Pe}];{const Ge=[...Ne];return Ge[le]={role:"assistant",content:Pe},Ge}})),He.tool_calls))for(const Ne of He.tool_calls){const Ge=Ne.index;re[Ge]?(Ne.id&&(re[Ge].id=Ne.id),Ne.function?.name&&(re[Ge].function.name=Ne.function.name),Ne.function?.arguments&&(re[Ge].function.arguments+=Ne.function.arguments)):re[Ge]={id:Ne.id||"",type:"function",function:{name:Ne.function?.name||"",arguments:Ne.function?.arguments||""}}}}const Ce={role:"assistant",content:Pe||null,tool_calls:re.length>0?re:void 0};if(Ce.tool_calls&&Ce.tool_calls.length>0){const Me=[];for(const He of Ce.tool_calls){const Ne=He.function.name,Ge=He.function.arguments,pt=tY(Ne,R);if(!pt){const it=`Tool ${Ne} not found on any connected server`;Me.push({toolCall:He,result:null,error:it}),t(bt=>[...bt,{role:"tool",content:`Error: ${it}`,toolResult:{id:He.id,name:Ne,result:JSON.stringify({error:it})}}]);continue}try{const it=performance.now(),bt=await lc.executeTool(pt,Ne,JSON.parse(Ge)),jt=performance.now()-it;Me.push({toolCall:He,result:bt,error:void 0});const vt=j.find(ni=>ni.id===pt)?.name||"Unknown Server",Lt=await B(pt);t(ni=>[...ni,{role:"tool",content:`Tool result: ${Ne}`,toolResult:{id:He.id,name:Ne,result:JSON.stringify(bt,null,2),serverId:pt,serverIcon:Lt||void 0,serverName:vt,executionTime:jt},apiResponse:bt}])}catch(it){const bt=it.message||"Tool execution failed";Me.push({toolCall:He,result:null,error:bt}),t(jt=>[...jt,{role:"tool",content:`Error: ${bt}`,toolResult:{id:He.id,name:Ne,result:JSON.stringify({error:bt})}}])}}ie=[...ie,{role:"assistant",content:Ce.content||null,tool_calls:Ce.tool_calls},...Me.map(He=>({role:"tool",content:He.error?JSON.stringify({error:He.error}):JSON.stringify(He.result),tool_call_id:He.toolCall.id}))];continue}else{l(-1),le===-1&&t(Me=>[...Me,{role:"assistant",content:Ce.content||"I apologize, I could not generate a response."}]);break}}ae>=D&&t(fe=>[...fe,{role:"system",content:"âš ī¸ Reached maximum tool execution depth. The conversation may be incomplete."}])}catch(M){console.error("Error in LLM conversation:",M),l(-1),t(q=>[...q,{role:"assistant",content:`❌ Error: ${M.message||"Failed to process your request"}`}])}finally{f(!1)}},W=h!==null?e[h]:null,pe=(N,M)=>{const q=typeof N=="string"?N:JSON.stringify(N,null,2);navigator.clipboard.writeText(q),T(M),setTimeout(()=>T(null),2e3)};return _.jsxs("div",{className:"hybrid-interface",children:[_.jsxs("div",{className:"chat-info-bar",children:[_.jsxs("div",{className:"chat-info-left",children:[_.jsxs("span",{className:"info-item",children:[_.jsx(Ld,{size:14}),_.jsxs("span",{children:[G.length," server",G.length!==1?"s":""]})]}),_.jsx("span",{className:"info-divider",children:"â€ĸ"}),_.jsxs("span",{className:"info-item",children:[_.jsx(xs,{size:14}),O?_.jsxs("span",{title:`${a.length>0?"Pinned tools":"Semantic filtering"} ${k&&L&&a.length===0?"active":"bypassed"}`,children:[O.toolsUsed,"/",O.toolsTotal," tools",a.length===0&&k&&L&&O.lastFilterTime>0&&_.jsxs("span",{style:{opacity:.7,fontSize:"0.85em"},children:[" ","(",O.lastFilterTime.toFixed(0),"ms)"]})]}):_.jsxs("span",{children:[F.length," tool",F.length!==1?"s":""]})]}),a.length>0?_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"info-divider",children:"â€ĸ"}),_.jsxs("span",{className:"info-item",title:`${a.length} pinned ${a.length===1?"item":"items"} - semantic filtering bypassed`,children:[_.jsx(fa,{size:14,style:{color:"#f59e0b"}}),_.jsxs("span",{style:{color:"#f59e0b"},children:[a.length," Pinned"]})]})]}):k&&L&&O?_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"info-divider",children:"â€ĸ"}),_.jsxs("span",{className:"info-item",title:"Semantic filtering is active",children:[_.jsx(fa,{size:14,style:{color:"#10b981"}}),_.jsx("span",{style:{color:"#10b981"},children:"Filtered"})]})]}):null,k&&!L&&F.length>0&&a.length===0&&_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"info-divider",children:"â€ĸ"}),_.jsxs("span",{className:"info-item",title:"Filter is initializing...",children:[_.jsx(fa,{size:14,style:{color:"#f59e0b"}}),_.jsx("span",{style:{color:"#f59e0b"},children:"Initializing..."})]})]})]}),F.length>0&&a.length===0&&_.jsxs("button",{className:`info-settings-button filter-toggle-button ${k?"filter-active":"filter-inactive"}`,onClick:()=>P(!k),title:k?"Disable semantic filtering (show all tools)":"Enable semantic filtering (show relevant tools)",children:[_.jsx(fa,{size:14}),_.jsx("span",{children:k?"Filtering On":"Filtering Off"})]}),_.jsx("button",{className:"info-settings-button",onClick:()=>b(!0),title:"Settings",children:_.jsx(Ob,{size:14})}),e.length>1&&_.jsxs("button",{className:"info-settings-button",onClick:Z,title:Jd("Clear chat history",{key:"k",ctrl:!0}),children:[_.jsx(cx,{size:14}),"Clear Chat",_.jsx("kbd",{className:"btn-shortcut-hint",children:"⌘K"})]})]}),_.jsxs("div",{className:"hybrid-content",children:[_.jsxs("div",{className:"chat-pane full-width",children:[_.jsx("div",{className:"chat-messages-scroll-wrapper",children:_.jsxs("div",{className:"chat-messages-hybrid",children:[e.map((N,M)=>_.jsx("div",{className:`chat-message-hybrid chat-message-${N.role} ${M===h?"selected":""} ${N.apiRequest||N.apiResponse?"has-api-data":""}`,onClick:()=>N.apiRequest||N.apiResponse?m(M):null,children:N.role==="system"&&N.filterMetrics?_.jsxs("div",{className:"filter-metrics-card",children:[_.jsxs("div",{className:"filter-metrics-main",children:[_.jsx(fa,{size:12,style:{color:"var(--theme-accent-primary)"}}),_.jsxs("span",{className:"filter-metrics-text",children:[_.jsx("strong",{style:{color:"var(--theme-accent-primary)"},children:"Semantic Filtering:"})," Selected ",_.jsx("strong",{children:N.filterMetrics.toolsUsed})," of ",N.filterMetrics.toolsTotal," tools"]}),N.filterMetrics.filterTime>0&&_.jsxs("span",{className:"filter-metrics-time",children:[N.filterMetrics.filterTime.toFixed(0),"ms"]})]}),N.filterMetrics.toolDetails&&N.filterMetrics.toolDetails.length>0&&(()=>{const q=N.filterMetrics.toolDetails.reduce((D,ie)=>(D[ie.serverName]||(D[ie.serverName]={serverName:ie.serverName,serverIcon:ie.serverIcon,tools:[]}),D[ie.serverName].tools.push(ie.toolName),D),{});return _.jsx("div",{className:"filter-metrics-hover-card",children:Object.values(q).map((D,ie)=>_.jsxs("div",{className:"filter-hover-server",children:[_.jsxs("div",{className:"filter-hover-server-header",children:[D.serverIcon?_.jsx("img",{src:D.serverIcon,alt:"",className:"filter-hover-favicon"}):_.jsx("div",{className:"filter-hover-favicon-placeholder",children:_.jsx(xs,{size:10})}),_.jsx("span",{className:"filter-hover-server-name",children:D.serverName}),_.jsx("span",{className:"filter-hover-tool-count",children:D.tools.length})]}),_.jsx("div",{className:"filter-hover-tools",children:D.tools.map((ae,fe)=>_.jsx("span",{className:"filter-hover-tool",children:ae},fe))})]},ie))})})()]}):_.jsx(_.Fragment,{children:_.jsxs("div",{className:"message-content-hybrid",children:[N.role==="tool"&&N.toolResult?_.jsx("div",{className:"tool-call-card",onClick:()=>m(M),children:_.jsxs("div",{className:"tool-call-header",children:[_.jsx("div",{className:"tool-call-icon",children:N.toolResult.serverIcon?_.jsx("img",{src:N.toolResult.serverIcon,alt:"",className:"tool-call-favicon"}):_.jsx(xs,{size:12})}),_.jsxs("div",{className:"tool-call-info",children:[_.jsx("div",{className:"tool-call-name",children:N.toolResult.name}),(N.toolResult.serverName||N.toolResult.executionTime)&&_.jsxs("div",{className:"tool-call-meta",children:[N.toolResult.serverName&&_.jsx("span",{className:"tool-call-server",children:N.toolResult.serverName}),N.toolResult.serverName&&N.toolResult.executionTime&&_.jsx("span",{className:"tool-call-meta-divider",children:"â€ĸ"}),N.toolResult.executionTime&&_.jsxs("span",{className:"tool-call-time",children:[N.toolResult.executionTime.toFixed(0),"ms"]})]})]}),_.jsx(Vh,{size:16,className:"tool-call-chevron"})]})}):N.role==="assistant"?_.jsx(XK,{content:N.content,isStreaming:M===d}):N.role==="system"?_.jsx("div",{className:"message-text-hybrid",children:(()=>{const q=localStorage.getItem("hoot-selected-model")||"@openai/gpt-4o-mini",D=Ki(q),ie=N.content.split(D);return ie.length>1?_.jsxs(_.Fragment,{children:[ie[0],_.jsx("span",{onClick:ae=>{ae.stopPropagation(),b(!0)},style:{cursor:"pointer",fontWeight:600,color:"var(--theme-accent-primary)",textDecoration:"underline",textDecorationStyle:"dotted",textUnderlineOffset:"2px"},children:D}),ie.slice(1).join(D)]}):N.content})()}):_.jsx("div",{className:"message-text-hybrid",children:N.content}),(N.apiRequest||N.apiResponse)&&!N.toolResult&&_.jsxs("div",{className:"api-indicator",children:[_.jsx(xs,{size:12}),"Click to view API details"]})]})})},M)),o&&_.jsx("div",{className:"chat-message-hybrid chat-message-assistant",children:_.jsx("div",{className:"message-content-hybrid",children:_.jsxs("div",{className:"typing-indicator-hybrid",children:[_.jsx("span",{}),_.jsx("span",{}),_.jsx("span",{})]})})}),_.jsx("div",{ref:x})]})}),_.jsx("div",{className:"chat-input-container-hybrid",children:_.jsxs("div",{className:"chat-input-wrapper-hybrid",children:[_.jsx(QK,{value:n,onChange:i,mentions:a,onMentionsChange:u,servers:j,tools:R,placeholder:"Let's chat with your MCP servers... (type @ to filter tools)",disabled:o,inputRef:I,onKeyPress:N=>{N.key==="Enter"&&!N.shiftKey&&(N.preventDefault(),Y())},onKeyDown:N=>{N.key==="Escape"&&N.currentTarget.blur()}}),!n&&!o&&_.jsx("kbd",{className:"input-shortcut-hint",children:"/"}),_.jsx("button",{className:"chat-send-button-hybrid",onClick:Y,disabled:!n.trim()||o,children:_.jsx(UM,{size:16})})]})})]}),h!==null&&W&&_.jsxs("div",{className:"api-pane",children:[_.jsxs("div",{className:"api-pane-header",children:[_.jsx(xs,{size:16}),_.jsx("span",{children:"Live API Calls"}),_.jsx("button",{className:"api-close-button",onClick:()=>m(null),title:"Close API viewer",children:"✕"})]}),_.jsx("div",{className:"api-pane-content",children:W?_.jsxs(_.Fragment,{children:[W.apiRequest&&_.jsxs("div",{className:"api-block",children:[_.jsxs("div",{className:"api-block-header request",children:[_.jsx("span",{children:"→ Request"}),_.jsx("button",{className:"api-copy-button",onClick:()=>pe(W.apiRequest,"request"),title:"Copy JSON",children:E==="request"?_.jsx(yd,{size:14}):_.jsx(vd,{size:14})})]}),_.jsx(Td,{content:JSON.stringify(W.apiRequest),className:"api-json-viewer"})]}),W.apiResponse&&_.jsxs("div",{className:"api-block",children:[_.jsxs("div",{className:"api-block-header response",children:[_.jsx("span",{children:"← Response"}),_.jsx("button",{className:"api-copy-button",onClick:()=>pe(W.apiResponse,"response"),title:"Copy JSON",children:E==="response"?_.jsx(yd,{size:14}):_.jsx(vd,{size:14})})]}),_.jsx(Td,{content:JSON.stringify(W.apiResponse),className:"api-json-viewer"})]}),W.toolCall&&_.jsxs("div",{className:"api-block",children:[_.jsxs("div",{className:"api-block-header tool-call",children:[_.jsxs("span",{children:["🔧 Tool Call: ",W.toolCall.name]}),_.jsx("button",{className:"api-copy-button",onClick:()=>pe(W.toolCall.arguments,"toolcall"),title:"Copy JSON",children:E==="toolcall"?_.jsx(yd,{size:14}):_.jsx(vd,{size:14})})]}),_.jsx(Td,{content:W.toolCall.arguments,className:"api-json-viewer"})]}),W.toolResult&&_.jsxs("div",{className:"api-block",children:[_.jsxs("div",{className:"api-block-header tool-result",children:[_.jsxs("span",{children:["✅ Tool Result: ",W.toolResult.name]}),_.jsx("button",{className:"api-copy-button",onClick:()=>pe(W.toolResult.result,"toolresult"),title:"Copy JSON",children:E==="toolresult"?_.jsx(yd,{size:14}):_.jsx(vd,{size:14})})]}),_.jsx(Td,{content:W.toolResult.result,className:"api-json-viewer"})]}),!W.apiRequest&&!W.apiResponse&&!W.toolCall&&!W.toolResult&&_.jsxs("div",{className:"api-empty",children:[_.jsx(xs,{size:32}),_.jsx("p",{children:"No API data for this message"})]})]}):_.jsxs("div",{className:"api-empty",children:[_.jsx(xs,{size:32}),_.jsx("p",{children:"Click on a message to see API details"}),_.jsx("span",{className:"api-hint",children:"Messages with API data have a blue indicator"})]})})]})]}),g&&_.jsx(_8,{onClose:()=>b(!1)})]})}const lY=J.memo(function({server:t,mode:n,onSubmit:i,isSubmitting:a,error:u}){const[o,f]=J.useState(t.name),[d,l]=J.useState(t.transport),[h,m]=J.useState(t.command||""),[g,b]=J.useState(t.url||""),[E,T]=J.useState(""),O=t.auth?.type==="oauth"&&t.auth&&"client_id"in t.auth&&!!t.auth.client_id,[v,C]=J.useState(O?"oauth_client_credentials":t.auth?.type||"none"),[x,I]=J.useState(t.auth?.type==="headers"&&t.auth.headers?Object.entries(t.auth.headers).map(([ae,fe])=>({key:ae,value:fe})):[{key:"",value:""}]),[j,R]=J.useState(t.auth?.type==="oauth"&&t.auth&&"client_id"in t.auth&&t.auth.client_id||""),[k,P]=J.useState(""),[z,L]=J.useState(t.auth?.type==="oauth"&&t.auth&&"token_url"in t.auth&&t.auth.token_url||""),[G,F]=J.useState(!1),[K,B]=J.useState(t.auth?.type==="oauth"&&t.auth?.additionalHeaders?Object.entries(t.auth.additionalHeaders).map(([ae,fe])=>({key:ae,value:fe})):[{key:"",value:""}]),[Z,U]=J.useState(t.auth?.type==="oauth"&&t.auth?.customOAuthMetadata?.authorization_endpoint||""),[Y,W]=J.useState(t.auth?.type==="oauth"&&t.auth?.customOAuthMetadata?.token_endpoint||""),[pe,N]=J.useState(t.auth?.type==="oauth"&&t.auth?.customOAuthMetadata?.client_id||""),[M,q]=J.useState(!1);J.useEffect(()=>{v==="headers"&&x.length===0&&I([{key:"",value:""}])},[v,x.length]);const D=async()=>{if(!(!g.trim()||!g.startsWith("http"))&&v==="none"&&!(d!=="sse"&&d!=="http")){q(!0);try{(await xb(g,d)).requiresOAuth&&(console.log("🔍 OAuth detected for URL:",g),C("oauth"),gi.info("OAuth Required","This server requires OAuth authentication"))}catch(ae){console.error("OAuth discovery error:",ae)}finally{q(!1)}}},ie=J.useCallback(async()=>{if(T(""),!o.trim()){T("Server name is required");return}if(d==="stdio"&&!h.trim()){T("Command is required for stdio transport");return}if((d==="sse"||d==="http")&&!g.trim()){T("URL is required for SSE/HTTP transport");return}if(v==="headers"&&x.filter(de=>de.key.trim()&&de.value.trim()).length===0){T("At least one header with key and value is required for header-based auth");return}if(v==="oauth_client_credentials"&&(!j.trim()||!k.trim())){T("Client ID and Client Secret are required for OAuth Client Credentials");return}let ae;if(v!=="none"&&(ae={type:v==="oauth_client_credentials"?"oauth":v},v==="headers"?ae.headers=x.filter(Ee=>Ee.key.trim()&&Ee.value.trim()).reduce((Ee,de)=>({...Ee,[de.key.trim()]:de.value.trim()}),{}):v==="oauth_client_credentials"&&(ae.client_id=j.trim(),ae.client_secret=k.trim(),z.trim()&&(ae.token_url=z.trim())),v==="oauth"||v==="oauth_client_credentials")){const Ee=K.filter(de=>de.key.trim()&&de.value.trim());Ee.length>0&&(ae.additionalHeaders=Ee.reduce((de,le)=>({...de,[le.key.trim()]:le.value.trim()}),{})),(Z.trim()||Y.trim()||pe.trim())&&(ae.customOAuthMetadata={},Z.trim()&&(ae.customOAuthMetadata.authorization_endpoint=Z.trim()),Y.trim()&&(ae.customOAuthMetadata.token_endpoint=Y.trim()),pe.trim()&&(ae.customOAuthMetadata.client_id=pe.trim()))}const fe={name:o.trim(),transport:d,...d==="stdio"?{command:h.trim(),url:void 0}:{url:g.trim(),command:void 0},auth:ae};await i(fe)},[o,d,h,g,v,x,j,k,z,K,Z,Y,pe,i]);return J.useEffect(()=>{const ae=fe=>{if(fe.key==="Enter"&&!fe.shiftKey&&!a){const Ee=fe.target;(Ee.tagName==="INPUT"||Ee.tagName==="TEXTAREA")&&(fe.preventDefault(),ie())}};return document.addEventListener("keydown",ae),()=>document.removeEventListener("keydown",ae)},[a,ie]),_.jsxs("div",{children:[(E||u)&&_.jsx("div",{className:"error-message",children:E||u}),d==="stdio"?_.jsx(It,{label:"Command",placeholder:"node server.js",value:h,onChange:ae=>m(ae.target.value)}):_.jsxs("div",{style:{position:"relative"},children:[_.jsx(It,{label:"URL",placeholder:"https://example.com/mcp",value:g,onChange:ae=>b(ae.target.value),onBlur:D}),M&&_.jsx("div",{style:{position:"absolute",right:"12px",top:"38px",display:"flex",alignItems:"center",gap:"8px"},children:_.jsx(Gb,{size:"sm"})})]}),_.jsx("div",{style:{marginTop:"20px",paddingTop:"20px",borderTop:"1px solid var(--border-color)"}}),_.jsx(It,{label:"Server Name",placeholder:"My MCP Server",value:o,onChange:ae=>f(ae.target.value)}),_.jsx(ga,{label:"Transport",value:d,onChange:ae=>l(ae),options:[{value:"http",label:"HTTP"},{value:"sse",label:"SSE"},{value:"stdio",label:"stdio (coming soon)",disabled:!0}]}),_.jsx(ga,{label:"Authentication",value:v,onChange:ae=>C(ae),options:[{value:"none",label:"None"},{value:"headers",label:"Headers"},{value:"oauth",label:"OAuth Auto"},{value:"oauth_client_credentials",label:"OAuth Client"}]}),v==="headers"&&_.jsxs("div",{style:{marginTop:"16px",padding:"16px",paddingLeft:"16px",borderLeft:"2px solid var(--theme-accent-tertiary)",background:"color-mix(in srgb, var(--theme-accent-tertiary) 3%, transparent)",borderRadius:"var(--radius-sm)"},children:[_.jsx("label",{className:"form-label",children:"Headers"}),x.map((ae,fe)=>_.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"8px"},children:[_.jsx(It,{placeholder:"Header Name (e.g., X-API-Key)",value:ae.key,onChange:Ee=>{const de=[...x];de[fe].key=Ee.target.value,I(de)}}),_.jsx(It,{type:"password",placeholder:"Header Value",value:ae.value,onChange:Ee=>{const de=[...x];de[fe].value=Ee.target.value,I(de)}}),x.length>1&&_.jsx(Bt,{variant:"ghost",size:"sm",type:"button",onClick:()=>I(x.filter((Ee,de)=>de!==fe)),children:"✕"})]},fe)),_.jsx(Bt,{variant:"outline",size:"sm",type:"button",onClick:()=>I([...x,{key:"",value:""}]),style:{width:"100%",marginTop:"8px"},children:"+ Add Header"})]}),v==="oauth"&&_.jsxs("div",{style:{marginTop:"16px",padding:"16px",paddingLeft:"16px",borderLeft:"2px solid var(--theme-accent-tertiary)",background:"color-mix(in srgb, var(--theme-accent-tertiary) 3%, transparent)",borderRadius:"var(--radius-sm)"},children:[_.jsx("div",{className:"info-message",style:{fontSize:"13px",opacity:.8},children:"Hoot will automatically handle the OAuth flow with PKCE when you connect."}),_.jsxs("div",{style:{marginTop:"20px",paddingTop:"16px",borderTop:"1px solid rgba(92, 207, 230, 0.2)"},children:[_.jsxs(Bt,{variant:"ghost",size:"sm",type:"button",onClick:()=>F(!G),style:{padding:0,display:"flex",alignItems:"center",gap:"6px",marginBottom:G?"16px":0},children:[_.jsx("span",{style:{transform:G?"rotate(90deg)":"rotate(0deg)",transition:"transform 0.2s"},children:"â–ļ"}),"Advanced OAuth Settings"]}),G&&_.jsxs("div",{style:{marginTop:"16px"},children:[_.jsxs("div",{style:{marginBottom:"20px"},children:[_.jsxs("label",{className:"form-label",style:{marginBottom:"8px"},children:["Additional Headers",_.jsx("span",{style:{marginLeft:"8px",fontSize:"11px",fontWeight:400,color:"var(--text-tertiary)",textTransform:"none",letterSpacing:0},children:"(sent with OAuth requests)"})]}),K.map((ae,fe)=>_.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"8px"},children:[_.jsx(It,{placeholder:"Header Name (e.g., X-API-Version)",value:ae.key,onChange:Ee=>{const de=[...K];de[fe].key=Ee.target.value,B(de)}}),_.jsx(It,{placeholder:"Header Value",value:ae.value,onChange:Ee=>{const de=[...K];de[fe].value=Ee.target.value,B(de)}}),K.length>1&&_.jsx(Bt,{variant:"ghost",size:"sm",type:"button",onClick:()=>B(K.filter((Ee,de)=>de!==fe)),children:"✕"})]},fe)),_.jsx(Bt,{variant:"outline",size:"sm",type:"button",onClick:()=>B([...K,{key:"",value:""}]),style:{width:"100%",marginTop:"8px"},children:"+ Add Header"})]}),_.jsxs("div",{children:[_.jsxs("label",{className:"form-label",style:{marginBottom:"12px"},children:["Custom OAuth Endpoints",_.jsx("span",{style:{marginLeft:"8px",fontSize:"11px",fontWeight:400,color:"var(--text-tertiary)",textTransform:"none",letterSpacing:0},children:"(overrides auto-discovery)"})]}),_.jsx(It,{placeholder:"Authorization Endpoint (optional)",value:Z,onChange:ae=>U(ae.target.value)}),_.jsx(It,{placeholder:"Token Endpoint (optional)",value:Y,onChange:ae=>W(ae.target.value)}),_.jsx(It,{placeholder:"Custom Client ID (optional)",value:pe,onChange:ae=>N(ae.target.value)})]})]})]})]}),v==="oauth_client_credentials"&&_.jsxs("div",{style:{marginTop:"16px",padding:"16px",paddingLeft:"16px",borderLeft:"2px solid var(--theme-accent-tertiary)",background:"color-mix(in srgb, var(--theme-accent-tertiary) 3%, transparent)",borderRadius:"var(--radius-sm)",display:"flex",flexDirection:"column",gap:"16px"},children:[_.jsx(It,{label:"Client ID",placeholder:"your-client-id",value:j,onChange:ae=>R(ae.target.value)}),_.jsx(It,{label:"Client Secret",type:"password",placeholder:"your-client-secret",value:k,onChange:ae=>P(ae.target.value)}),_.jsx(It,{label:"Token URL (Optional)",placeholder:"https://api.example.com/oauth/token",value:z,onChange:ae=>L(ae.target.value)})]}),_.jsx("div",{style:{marginTop:"32px",paddingBottom:"8px",display:"flex",gap:"12px",justifyContent:"flex-end"},children:_.jsxs(Bt,{variant:"primary",onClick:ie,disabled:a,children:[a?"Connecting...":n==="add"?"Add Server":"Save & Reconnect",!a&&_.jsx("kbd",{style:{marginLeft:"8px",padding:"4px 8px",borderRadius:"4px",background:"rgba(0, 0, 0, 0.25)",fontSize:"13px",fontWeight:"700",fontFamily:"var(--font-mono)",lineHeight:"1"},children:"â†ĩ"})]})})]})}),uY=J.memo(function({onClose:t}){console.log("đŸĻ‰ AddServerModal rendered"),J.useEffect(()=>{const R=document.body.style.overflow;document.body.style.overflow="hidden";const k=P=>{P.key==="Escape"&&t()};return document.addEventListener("keydown",k),()=>{document.body.style.overflow=R,document.removeEventListener("keydown",k)}},[t]);const[n,i]=J.useState(""),[a,u]=J.useState(""),[o,f]=J.useState("idle"),[d,l]=J.useState(null),h=Ue(R=>R.addServer),m=Ue(R=>R.setSelectedServer),{connect:g}=yc(),[b,E]=J.useState(!1),[T,O]=J.useState(""),[v,C]=J.useState([{id:"connect",label:"Finding your server",status:"pending"},{id:"transport",label:"Checking how to connect",status:"pending"},{id:"metadata",label:"Getting server details",status:"pending"},{id:"auth",label:"Checking if login is needed",status:"pending"}]),x=(R,k,P)=>{C(z=>z.map(L=>L.id===R?{...L,status:k,message:P}:L))},I=async()=>{if(u(""),!n.trim()){u("Server URL is required");return}let R=n.trim();R.match(/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//)||(R=`https://${R}`);try{new URL(R)}catch{u("Please enter a valid URL (e.g., http://localhost:3000)");return}f("detecting"),C([{id:"connect",label:"Finding your server",status:"active"},{id:"transport",label:"Checking how to connect",status:"pending"},{id:"metadata",label:"Getting server details",status:"pending"},{id:"auth",label:"Checking if login is needed",status:"pending"}]);try{await new Promise(G=>setTimeout(G,400));const k=await wb(R);if(!k.success){x("connect","error",k.error||"Connection failed"),f("error"),u(k.error||"Could not connect to server");return}x("connect","complete"),x("transport","active"),await new Promise(G=>setTimeout(G,300)),x("transport","complete",k.transport?.toUpperCase()),x("metadata","active"),await new Promise(G=>setTimeout(G,300));const P=k.serverInfo?.name||"Unknown Server";x("metadata","complete",P),x("auth","active"),await new Promise(G=>setTimeout(G,300));let z="None Required";k.requiresClientCredentials?z="Client Credentials Required":k.requiresOAuth?z="OAuth Required":k.requiresHeaderAuth&&(z="Custom Auth Required"),x("auth","complete",z),f("success");const L={id:`server-${Date.now()}`,name:P,url:R,transport:k.transport||"http"};k.requiresOAuth?L.auth={type:"oauth"}:k.requiresHeaderAuth?L.auth={type:"headers",headers:{}}:L.auth={type:"none"},l(L),await new Promise(G=>setTimeout(G,600)),f("configuring")}catch(k){console.error("Detection error:",k),f("error"),u(k instanceof Error?k.message:"Failed to detect server configuration")}},j=async R=>{E(!0),O("");try{const k=`server-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,P={id:k,name:R.name,transport:R.transport,connected:!1,url:R.url,command:R.command,auth:R.auth};if(h(P),m(k),R.auth?.type==="oauth"&&sessionStorage.setItem("oauth_server_id",k),await g(P))t();else{const L=Ue.getState().servers.find(G=>G.id===k);L?.error?O(L.error):console.log("🔐 OAuth redirect initiated")}}catch(k){const P=k instanceof Error?k.message:"Failed to connect. Check settings and try again.";O(P)}finally{E(!1)}};return _.jsx("div",{className:"modal-overlay",onClick:t,children:_.jsxs("div",{className:"modal",onClick:R=>R.stopPropagation(),style:{maxWidth:o==="configuring"?"600px":"560px"},children:[_.jsxs("div",{className:"modal-header",children:[_.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",marginBottom:"8px"},children:[_.jsx("span",{style:{fontSize:"28px",filter:"drop-shadow(0 2px 8px rgba(92, 207, 230, 0.3))"},children:"đŸĻ‰"}),_.jsx("h2",{style:{margin:0},children:o==="configuring"?"Configure Server":"Add MCP Server"})]}),o!=="configuring"&&_.jsx("p",{style:{textAlign:"center",color:"var(--text-secondary)",fontSize:"14px",fontWeight:400,marginTop:"4px",marginBottom:"24px"},children:"Enter your server URL and we'll figure out the rest"})]}),_.jsx("div",{className:"modal-body",children:o==="configuring"&&d?_.jsx(lY,{server:d,mode:"add",onSubmit:j,isSubmitting:b,error:T}):_.jsxs(_.Fragment,{children:[_.jsx(It,{label:"Server URL",placeholder:"http://localhost:3000/mcp",value:n,onChange:R=>i(R.target.value),onKeyDown:R=>{R.key==="Enter"&&o==="idle"&&I()},disabled:o==="detecting",autoFocus:!0}),o==="detecting"&&_.jsx("div",{style:{marginTop:"24px"},children:v.map(R=>_.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px",marginBottom:"8px",background:R.status==="active"||R.status==="complete"?"rgba(92, 207, 230, 0.1)":"rgba(31, 36, 48, 0.6)",borderRadius:"8px",border:`1px solid ${R.status==="active"?"rgba(92, 207, 230, 0.3)":R.status==="complete"?"rgba(34, 197, 94, 0.3)":R.status==="error"?"rgba(239, 68, 68, 0.3)":"rgba(92, 207, 230, 0.1)"}`,transition:"all 0.3s ease"},children:[_.jsxs("div",{style:{width:"20px",height:"20px",flexShrink:0},children:[R.status==="active"&&_.jsx("div",{className:"spinner-small"}),R.status==="complete"&&_.jsx("span",{style:{color:"var(--green-500)",fontSize:"16px"},children:"✓"}),R.status==="error"&&_.jsx("span",{style:{color:"var(--red-500)",fontSize:"16px"},children:"✕"}),R.status==="pending"&&_.jsx("span",{style:{color:"var(--text-tertiary)",fontSize:"16px"},children:"○"})]}),_.jsxs("div",{style:{flex:1},children:[_.jsx("div",{style:{fontSize:"14px",fontWeight:500,color:"var(--text-primary)"},children:R.label}),R.message&&_.jsx("div",{style:{fontSize:"12px",color:R.status==="error"?"var(--red-500)":"var(--text-secondary)",marginTop:"2px"},children:R.message})]})]},R.id))}),o==="success"&&_.jsxs("div",{style:{marginTop:"24px",padding:"16px",background:"rgba(34, 197, 94, 0.1)",border:"1px solid rgba(34, 197, 94, 0.3)",borderRadius:"8px",textAlign:"center"},children:[_.jsx("div",{style:{fontSize:"32px",marginBottom:"8px"},children:"✓"}),_.jsx("div",{style:{color:"var(--green-500)",fontWeight:600,marginBottom:"4px"},children:"Detection Complete!"}),_.jsx("div",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:"Opening configuration..."})]}),a&&_.jsx("div",{className:"error-message",style:{marginTop:"16px"},children:a})]})}),o!=="configuring"&&_.jsxs("div",{className:"modal-footer",children:[_.jsx(Bt,{variant:"secondary",onClick:t,disabled:o==="detecting",children:"Cancel"}),o==="idle"||o==="error"?_.jsxs(Bt,{variant:"primary",onClick:I,disabled:!n.trim(),children:["Detect Server",_.jsx("kbd",{style:{marginLeft:"8px",padding:"4px 8px",borderRadius:"4px",background:"rgba(0, 0, 0, 0.25)",fontSize:"13px",fontWeight:"700",fontFamily:"var(--font-mono)",lineHeight:"1"},children:"â†ĩ"})]}):null]})]})})}),dY=J.memo(function({mode:t="edit",server:n,onClose:i}){const[a,u]=J.useState(n.name),[o,f]=J.useState(n.transport),[d,l]=J.useState(n.command||""),[h,m]=J.useState(n.url||""),[g,b]=J.useState(""),E=n.auth?.type==="oauth"&&n.auth&&"client_id"in n.auth&&!!n.auth.client_id,[T,O]=J.useState(E?"oauth_client_credentials":n.auth?.type||"none"),[v,C]=J.useState(n.auth?.type==="headers"&&n.auth.headers?Object.entries(n.auth.headers).map(([de,le])=>({key:de,value:le})):[{key:"",value:""}]),[x,I]=J.useState(n.auth?.type==="oauth"&&n.auth&&"client_id"in n.auth&&n.auth.client_id||""),[j,R]=J.useState(""),[k,P]=J.useState(n.auth?.type==="oauth"&&n.auth&&"token_url"in n.auth&&n.auth.token_url||""),[z,L]=J.useState(!1),[G,F]=J.useState(n.auth?.type==="oauth"&&n.auth?.additionalHeaders?Object.entries(n.auth.additionalHeaders).map(([de,le])=>({key:de,value:le})):[{key:"",value:""}]),[K,B]=J.useState(n.auth?.type==="oauth"&&n.auth?.customOAuthMetadata?.authorization_endpoint||""),[Z,U]=J.useState(n.auth?.type==="oauth"&&n.auth?.customOAuthMetadata?.token_endpoint||""),[Y,W]=J.useState(n.auth?.type==="oauth"&&n.auth?.customOAuthMetadata?.client_id||""),[pe,N]=J.useState(!1),M=Ue(de=>de.updateServer),q=Ue(de=>de.addServer),{connect:D,disconnect:ie,isConnecting:ae}=yc();J.useEffect(()=>{T==="headers"&&v.length===0&&C([{key:"",value:""}])},[T,v.length]),J.useEffect(()=>{const de=le=>{if(le.key==="Escape")i();else if(le.key==="Enter"&&!le.shiftKey&&!ae){const Pe=le.target;(Pe.tagName==="INPUT"||Pe.tagName==="TEXTAREA")&&(le.preventDefault(),Ee())}};return document.addEventListener("keydown",de),()=>{document.removeEventListener("keydown",de)}},[i,ae,a,o,d,h,T,v,x,j,k,G,K,Z,Y]);const fe=async()=>{if(!(!h.trim()||!h.startsWith("http"))&&T==="none"&&!(o!=="sse"&&o!=="http")){N(!0);try{(await xb(h,o)).requiresOAuth&&(console.log("🔍 OAuth detected for URL:",h),O("oauth"),gi.info("OAuth Required","This server requires OAuth authentication"))}catch(de){console.error("OAuth discovery error:",de)}finally{N(!1)}}},Ee=async()=>{if(b(""),!a.trim()){b("Server name is required");return}if(o==="stdio"&&!d.trim()){b("Command is required for stdio transport");return}if((o==="sse"||o==="http")&&!h.trim()){b("URL is required for SSE/HTTP transport");return}if(T==="headers"&&v.filter(Pe=>Pe.key.trim()&&Pe.value.trim()).length===0){b("At least one header with key and value is required for header-based auth");return}if(T==="oauth_client_credentials"&&(!x.trim()||!j.trim())){b("Client ID and Client Secret are required for OAuth Client Credentials");return}let de;if(T!=="none"&&(de={type:T==="oauth_client_credentials"?"oauth":T},T==="headers"?de.headers=v.filter(le=>le.key.trim()&&le.value.trim()).reduce((le,Pe)=>({...le,[Pe.key.trim()]:Pe.value.trim()}),{}):T==="oauth_client_credentials"&&(de.client_id=x.trim(),de.client_secret=j.trim(),k.trim()&&(de.token_url=k.trim())),T==="oauth"||T==="oauth_client_credentials")){const le=G.filter(Pe=>Pe.key.trim()&&Pe.value.trim());le.length>0&&(de.additionalHeaders=le.reduce((Pe,re)=>({...Pe,[re.key.trim()]:re.value.trim()}),{})),(K.trim()||Z.trim()||Y.trim())&&(de.customOAuthMetadata={},K.trim()&&(de.customOAuthMetadata.authorization_endpoint=K.trim()),Z.trim()&&(de.customOAuthMetadata.token_endpoint=Z.trim()),Y.trim()&&(de.customOAuthMetadata.client_id=Y.trim()))}if(t==="edit"&&n.connected&&await ie(n.id),t==="add"){const le=`server-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,Pe={id:le,name:a.trim(),transport:o,connected:!1,...o==="stdio"?{command:d.trim()}:{url:h.trim()},auth:de};q(Pe),de?.type==="oauth"&&sessionStorage.setItem("oauth_server_id",le);try{if(await D(Pe))i();else{const Ae=Ue.getState().servers.find(Ce=>Ce.id===le);Ae?.error?b(Ae.error):console.log("🔐 OAuth redirect initiated")}}catch(re){const Ae=re instanceof Error?re.message:"Failed to connect. Check settings and try again.";b(Ae)}}else{const le={name:a.trim(),transport:o,...o==="stdio"?{command:d.trim(),url:void 0}:{url:h.trim(),command:void 0},auth:de};M(n.id,le);const Pe=Ue.getState().servers.find(re=>re.id===n.id);if(Pe){Pe.auth?.type==="oauth"&&sessionStorage.setItem("oauth_server_id",Pe.id);try{if(await D(Pe))i();else{const Ae=Ue.getState().servers.find(Ce=>Ce.id===n.id);Ae?.error?b(Ae.error):console.log("🔐 OAuth redirect initiated")}}catch(re){const Ae=re instanceof Error?re.message:"Failed to connect with new configuration. Check settings and try again.";b(Ae)}}}};return _.jsx("div",{className:"modal-overlay",onClick:i,children:_.jsxs("div",{className:"modal",onClick:de=>de.stopPropagation(),children:[_.jsx("div",{className:"modal-header",children:_.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},children:[_.jsx("span",{style:{fontSize:"28px",filter:"drop-shadow(0 2px 8px rgba(92, 207, 230, 0.3))"},children:"đŸĻ‰"}),_.jsx("h2",{style:{margin:0},children:t==="add"?"Configure Server":"Edit Server"})]})}),_.jsxs("div",{className:"modal-body",children:[g&&_.jsx("div",{className:"error-message",children:g}),o==="stdio"?_.jsx(It,{label:"Command",placeholder:"node server.js",value:d,onChange:de=>l(de.target.value),autoFocus:!0}):_.jsxs("div",{style:{position:"relative"},children:[_.jsx(It,{label:"URL",placeholder:"http://localhost:3000",value:h,onChange:de=>m(de.target.value),onBlur:fe,autoFocus:!0}),pe&&_.jsx("div",{style:{position:"absolute",right:"12px",top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",pointerEvents:"none"},children:_.jsx(Gb,{size:"sm"})})]}),_.jsx(It,{label:"Server Name",placeholder:"My MCP Server",value:a,onChange:de=>u(de.target.value)}),_.jsx(ga,{label:"Transport",value:o,onChange:de=>f(de),options:[{value:"http",label:"HTTP"},{value:"sse",label:"SSE"},{value:"stdio",label:"stdio (desktop only)",disabled:!0}],helperText:o==="stdio"?"stdio transport requires a desktop app. Use SSE or HTTP for browser testing.":void 0}),_.jsx("div",{style:{marginTop:"20px",paddingTop:"20px",borderTop:"1px solid var(--border-color)"},children:_.jsx(ga,{label:"Authentication",value:T,onChange:de=>O(de),options:[{value:"none",label:"None"},{value:"headers",label:"Headers"},{value:"oauth",label:"OAuth Auto"},{value:"oauth_client_credentials",label:"OAuth Client"}]})}),T==="headers"&&_.jsxs("div",{style:{marginTop:"16px",padding:"16px",paddingLeft:"16px",borderLeft:"2px solid var(--theme-accent-tertiary)",background:"color-mix(in srgb, var(--theme-accent-tertiary) 3%, transparent)",borderRadius:"var(--radius-sm)"},children:[_.jsx("label",{className:"form-label",children:"Headers"}),v.map((de,le)=>_.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"8px"},children:[_.jsx(It,{placeholder:"Header Name (e.g., X-API-Key)",value:de.key,onChange:Pe=>{const re=[...v];re[le].key=Pe.target.value,C(re)}}),_.jsx(It,{type:"password",placeholder:"Header Value",value:de.value,onChange:Pe=>{const re=[...v];re[le].value=Pe.target.value,C(re)}}),v.length>1&&_.jsx(Bt,{variant:"ghost",size:"sm",onClick:()=>C(v.filter((Pe,re)=>re!==le)),children:"✕"})]},le)),_.jsx(Bt,{variant:"outline",size:"sm",onClick:()=>C([...v,{key:"",value:""}]),style:{width:"100%",marginTop:"8px"},children:"+ Add Header"})]}),T==="oauth"&&_.jsxs("div",{style:{marginTop:"16px",padding:"16px",paddingLeft:"16px",borderLeft:"2px solid var(--theme-accent-tertiary)",background:"color-mix(in srgb, var(--theme-accent-tertiary) 3%, transparent)",borderRadius:"var(--radius-sm)"},children:[_.jsx("div",{className:"info-message",style:{fontSize:"13px",opacity:.8},children:"Hoot will automatically handle the OAuth flow with PKCE when you connect."}),_.jsxs("div",{style:{marginTop:"20px",paddingTop:"16px",borderTop:"1px solid rgba(92, 207, 230, 0.2)"},children:[_.jsxs(Bt,{variant:"ghost",size:"sm",onClick:()=>L(!z),style:{padding:0,display:"flex",alignItems:"center",gap:"6px",marginBottom:z?"16px":0},children:[_.jsx("span",{style:{transform:z?"rotate(90deg)":"rotate(0deg)",transition:"transform 0.2s"},children:"â–ļ"}),"Advanced OAuth Settings"]}),z&&_.jsxs("div",{style:{marginTop:"16px"},children:[_.jsxs("div",{style:{marginBottom:"20px"},children:[_.jsxs("label",{className:"form-label",style:{marginBottom:"8px"},children:["Additional Headers",_.jsx("span",{style:{marginLeft:"8px",fontSize:"11px",fontWeight:400,color:"var(--text-tertiary)",textTransform:"none",letterSpacing:0},children:"(sent with OAuth requests)"})]}),G.map((de,le)=>_.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"8px"},children:[_.jsx(It,{placeholder:"Header Name (e.g., X-API-Version)",value:de.key,onChange:Pe=>{const re=[...G];re[le].key=Pe.target.value,F(re)}}),_.jsx(It,{placeholder:"Header Value",value:de.value,onChange:Pe=>{const re=[...G];re[le].value=Pe.target.value,F(re)}}),G.length>1&&_.jsx(Bt,{variant:"ghost",size:"sm",onClick:()=>F(G.filter((Pe,re)=>re!==le)),children:"✕"})]},le)),_.jsx(Bt,{variant:"outline",size:"sm",onClick:()=>F([...G,{key:"",value:""}]),style:{width:"100%"},children:"+ Add Header"})]}),_.jsxs("div",{children:[_.jsxs("label",{className:"form-label",style:{marginBottom:"12px"},children:["Custom OAuth Endpoints",_.jsx("span",{style:{marginLeft:"8px",fontSize:"11px",fontWeight:400,color:"var(--text-tertiary)",textTransform:"none",letterSpacing:0},children:"(overrides auto-discovery)"})]}),_.jsx(It,{placeholder:"Authorization Endpoint (optional)",value:K,onChange:de=>B(de.target.value)}),_.jsx(It,{placeholder:"Token Endpoint (optional)",value:Z,onChange:de=>U(de.target.value)}),_.jsx(It,{placeholder:"Custom Client ID (optional)",value:Y,onChange:de=>W(de.target.value)})]})]})]})]}),T==="oauth_client_credentials"&&_.jsxs("div",{style:{marginTop:"16px",padding:"16px",paddingLeft:"16px",borderLeft:"2px solid var(--theme-accent-tertiary)",background:"color-mix(in srgb, var(--theme-accent-tertiary) 3%, transparent)",borderRadius:"var(--radius-sm)",display:"flex",flexDirection:"column",gap:"16px"},children:[_.jsx(It,{label:"Client ID",placeholder:"your-client-id",value:x,onChange:de=>I(de.target.value)}),_.jsx(It,{label:"Client Secret",type:"password",placeholder:"your-client-secret",value:j,onChange:de=>R(de.target.value)}),_.jsx(It,{label:"Token URL (Optional)",placeholder:"https://api.example.com/oauth/token",value:k,onChange:de=>P(de.target.value)}),_.jsxs("div",{style:{marginTop:"20px",paddingTop:"16px",borderTop:"1px solid rgba(92, 207, 230, 0.2)"},children:[_.jsxs(Bt,{variant:"ghost",size:"sm",onClick:()=>L(!z),style:{padding:0,display:"flex",alignItems:"center",gap:"6px",marginBottom:z?"16px":0},children:[_.jsx("span",{style:{transform:z?"rotate(90deg)":"rotate(0deg)",transition:"transform 0.2s"},children:"â–ļ"}),"Advanced Settings"]}),z&&_.jsxs("div",{style:{marginTop:"16px"},children:[_.jsxs("div",{style:{marginBottom:"20px"},children:[_.jsxs("label",{className:"form-label",style:{marginBottom:"8px"},children:["Additional Headers",_.jsx("span",{style:{marginLeft:"8px",fontSize:"11px",fontWeight:400,color:"var(--text-tertiary)",textTransform:"none",letterSpacing:0},children:"(sent with OAuth requests)"})]}),G.map((de,le)=>_.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"8px"},children:[_.jsx(It,{placeholder:"Header Name (e.g., X-API-Version)",value:de.key,onChange:Pe=>{const re=[...G];re[le].key=Pe.target.value,F(re)}}),_.jsx(It,{placeholder:"Header Value",value:de.value,onChange:Pe=>{const re=[...G];re[le].value=Pe.target.value,F(re)}}),G.length>1&&_.jsx(Bt,{variant:"ghost",size:"sm",onClick:()=>F(G.filter((Pe,re)=>re!==le)),children:"✕"})]},le)),_.jsx(Bt,{variant:"outline",size:"sm",onClick:()=>F([...G,{key:"",value:""}]),style:{width:"100%",marginTop:"8px"},children:"+ Add Header"})]}),_.jsxs("div",{children:[_.jsxs("label",{className:"form-label",style:{marginBottom:"12px"},children:["Custom OAuth Endpoints",_.jsx("span",{style:{marginLeft:"8px",fontSize:"11px",fontWeight:400,color:"var(--text-tertiary)",textTransform:"none",letterSpacing:0},children:"(overrides auto-discovery)"})]}),_.jsx(It,{placeholder:"Authorization Endpoint (optional)",value:K,onChange:de=>B(de.target.value)}),_.jsx(It,{placeholder:"Token Endpoint (optional)",value:Z,onChange:de=>U(de.target.value)}),_.jsx(It,{placeholder:"Custom Client ID (optional)",value:Y,onChange:de=>W(de.target.value)})]})]})]})]})]}),_.jsxs("div",{className:"modal-footer",children:[_.jsx(Bt,{variant:"secondary",onClick:i,disabled:ae,children:"Cancel"}),_.jsx(Bt,{variant:"primary",onClick:Ee,disabled:ae,children:ae?"Connecting...":t==="add"?"Add Server":"Save & Reconnect"})]})]})})});function fY(){const[e,t]=J.useState("processing"),[n,i]=J.useState("Processing authorization..."),{connect:a}=yc(),u=Ue(d=>d.servers),o=J.useRef(!1);J.useEffect(()=>{if(o.current){console.log("OAuth callback already executed, skipping duplicate");return}o.current=!0,f()},[]);const f=async()=>{try{sessionStorage.removeItem("oauth_last_redirect");const d=new URLSearchParams(window.location.search),l=d.get("code"),h=d.get("state"),m=d.get("error"),g=d.get("error_description");let b="/test",E="",T=null;if(h)try{const x=JSON.parse(atob(h));x.return&&(b=x.return.path||"/test",E=x.return.search||"",T=x.return.serverId)}catch(x){console.warn("Failed to parse OAuth state, using defaults:",x)}if(m){const I={access_denied:"Authorization was cancelled or denied. You can try again if you change your mind.",invalid_request:"Invalid OAuth request. The server may have incorrect OAuth configuration.",unauthorized_client:"This client is not authorized. Please check the server's OAuth client ID configuration.",unsupported_response_type:"OAuth configuration error. The server may not support the required response type.",invalid_scope:"The requested permissions are invalid or not available.",server_error:"The authorization server encountered an error. Please try again later.",temporarily_unavailable:"The authorization server is temporarily unavailable. Please try again in a few moments."}[m]||g||`OAuth error: ${m}`;throw new Error(I)}if(!l)throw new Error("No authorization code was received from the OAuth provider. This may indicate a configuration issue with the server.");if(T||(T=sessionStorage.getItem("oauth_server_id")||sessionStorage.getItem("oauth_pending_server")),!T)throw new Error("OAuth session expired. Please return to Hoot and try connecting again.");console.log(`🔐 OAuth callback: Looking for server ID: ${T}`),console.log("🔐 OAuth callback: Available servers:",u.map(x=>({id:x.id,name:x.name})));const O=u.find(x=>x.id===T);if(!O)throw new Error(`Server not found. It may have been deleted while you were authorizing. (Looking for ID: ${T})`);i(`Exchanging authorization code for ${O.name}...`);let v=!1,C=null;try{v=await a(O,l)}catch(x){C=x instanceof Error?x:new Error("Connection failed"),console.log("Connection error during OAuth callback:",C)}if(v)t("success"),i(`✓ Successfully authorized ${O.name}!`);else if(i(`Waiting for ${O.name} to complete connection...`),await new Promise(j=>setTimeout(j,1500)),Ue.getState().servers.find(j=>j.id===T)?.connected)t("success"),i(`✓ Successfully authorized ${O.name}!`);else{const j=C?.message||"Failed to complete OAuth connection. The token exchange may have failed. Please try reconnecting.";throw new Error(j)}try{const x=await Rb(T);if(x&&x.name){console.log(`📋 Updating server name from "${O.name}" to "${x.name}"`);const I=Ue.getState().updateServer;I(T,{name:x.name,...x.version&&{}})}}catch(x){console.log("Could not fetch server info after OAuth:",x)}sessionStorage.removeItem("oauth_server_id"),sessionStorage.removeItem("oauth_pending_server"),sessionStorage.removeItem("oauth_last_redirect"),setTimeout(()=>{const x=`${b}${E}`;console.log("OAuth success, redirecting to:",x),window.history.pushState({},"",x),window.dispatchEvent(new PopStateEvent("popstate"))},1e3)}catch(d){console.error("OAuth callback error:",d),t("error");let l="OAuth authorization failed";d instanceof Error&&(l=d.message,l.includes("Code verifier")||l.includes("PKCE")?l="Token exchange failed: PKCE verification error. The authorization session may have expired. Please try connecting again.":l.includes("Backend server is not running")?l="Unable to complete authorization: Backend server is not running. Please ensure the backend is started.":l.includes("Failed to fetch")||l.includes("Network")?l="Network error during token exchange. Please check your internet connection and try again.":l.includes("401")||l.includes("invalid_client")?l="Token exchange failed: Invalid client credentials. Please verify the OAuth configuration (client ID and secret) for this server.":l.includes("invalid_grant")||l.includes("authorization code")?l="Token exchange failed: The authorization code is invalid or expired. This can happen if you took too long to authorize. Please try connecting again.":l.includes("CORS")&&(l="Token exchange failed due to CORS restrictions. The server needs to allow requests from this domain.")),i(l)}};return _.jsx("div",{className:"oauth-callback",children:_.jsxs("div",{className:`oauth-callback-content ${e==="error"?"error":""}`,children:[_.jsxs("div",{className:"oauth-icon",children:[e==="processing"&&_.jsx("div",{className:"oauth-processing",children:"đŸĻ‰"}),e==="success"&&_.jsx("div",{className:"success-icon",children:"✓"}),e==="error"&&_.jsx("div",{className:"error-icon",children:"✗"})]}),_.jsxs("h2",{className:"oauth-title",children:[e==="processing"&&"Authorizing...",e==="success"&&"Authorization Complete!",e==="error"&&"Authorization Failed"]}),_.jsx("p",{className:"oauth-message",children:n}),e==="error"&&_.jsx(Bt,{variant:"primary",onClick:()=>window.location.href="/",children:"Return to Hoot"}),e==="success"&&_.jsx("p",{className:"oauth-redirect",children:"Redirecting you back to Hoot..."})]})})}const hY=J.memo(function(){const[t,n]=J.useState(null),[i,a]=J.useState(!1),[u,o]=J.useState(null),[f,d]=J.useState("score"),[l,h]=J.useState("desc"),[m,g]=J.useState("all"),[b,E]=J.useState(null),[T,O]=J.useState(null),v=Ue(P=>P.faviconCache),C=Ue(P=>P.setFaviconUrl),x={"RFC 6750 (OAuth 2.0 Bearer Token Usage) - WWW-Authenticate header":{title:"WWW-Authenticate Header (RFC 6750)",description:"When a protected resource receives an unauthorized request, it must respond with a 401 Unauthorized status and include a WWW-Authenticate header that indicates Bearer token authentication is required.",implementation:["Return HTTP 401 status code when access token is missing or invalid","Include WWW-Authenticate header in the response",'Header format: WWW-Authenticate: Bearer realm="<resource>", scope="<scopes>"',"Optionally include error, error_description, and error_uri parameters","Recommended: Include resource_metadata parameter pointing to RFC 9728 metadata endpoint",'Example: WWW-Authenticate: Bearer realm="MCP Server", scope="mcp:read mcp:write", resource_metadata="https://example.com/.well-known/oauth-protected-resource"'],passCriteria:["Server returns HTTP 401 status on unauthorized requests","Response includes WWW-Authenticate header",'Header contains "Bearer" authentication scheme (case-insensitive)',"Header is properly formatted according to RFC 6750 Section 3"]},"RFC 9728 (OAuth 2.1 Protected Resource Metadata) - /.well-known endpoint":{title:"OAuth Metadata Endpoint (RFC 9728)",description:"Servers should provide a standardized metadata endpoint at /.well-known/oauth-protected-resource that describes the OAuth configuration, including authorization servers and supported features.",implementation:["Create endpoint at: /.well-known/oauth-protected-resource","Respond with JSON content-type: application/json","Return HTTP 200 status code",'Include required field: "authorization_servers" - array of authorization server URLs','Optionally include: "resource" (resource identifier), "scopes_supported", "bearer_methods_supported"','Example response: { "authorization_servers": ["https://auth.example.com"], "resource": "https://api.example.com", "scopes_supported": ["mcp:read", "mcp:write"] }'],passCriteria:["Endpoint /.well-known/oauth-protected-resource returns HTTP 200","Response is valid JSON",'JSON contains "authorization_servers" or "authorization_server" field',"Authorization servers field is non-empty (array or string)"]},"RFC 6750 (OAuth 2.0 Bearer Token Usage) - Error codes":{title:"OAuth Error Codes (RFC 6750)",description:"When rejecting a request due to authentication issues, servers should return standardized OAuth error codes that help clients understand what went wrong and how to fix it.",implementation:["Include error codes in WWW-Authenticate header or JSON response body",'Use standardized error codes: "invalid_token" (token expired, malformed, invalid), "insufficient_scope" (requires more permissions), "invalid_request" (malformed request)','WWW-Authenticate example: WWW-Authenticate: Bearer error="invalid_token", error_description="Token has expired"','JSON body example: { "error": "invalid_token", "error_description": "Token has expired", "error_uri": "https://docs.example.com/errors/invalid_token" }',"Optionally include error_description (human-readable) and error_uri (link to documentation)"],passCriteria:["Response contains OAuth 2.0 error code in body or WWW-Authenticate header","Error code is one of: invalid_token, insufficient_scope, or invalid_request","Error code appears in either response body JSON or WWW-Authenticate header parameters"]}};J.useEffect(()=>{I()},[]),J.useEffect(()=>{t&&(console.log("[OAuthCompliance] Loading favicons for",t.results.length,"servers"),console.log("[OAuthCompliance] Current favicon cache size:",Object.keys(v).length),t.results.forEach(P=>{const z=P.url,L=v[z];if(L==null){if(P.iconUrl){console.log("[OAuthCompliance] Setting favicon from CSV for",P.serverName,":",P.iconUrl),C(P.url,P.iconUrl);return}console.log("[OAuthCompliance] Fetching favicon from backend for",P.serverName),Hd(P.url).then(G=>{C(P.url,G)}).catch(G=>{console.warn(`Failed to fetch favicon for ${P.serverName}:`,G),C(P.url,null)})}}))},[t,v,C]);const I=async()=>{a(!0),o(null);try{const P=["/tests/oauth-compliance-results.json","../tests/oauth-compliance-results.json","./tests/oauth-compliance-results.json"];let z=null;for(const L of P)try{const G=await fetch(L);if(G.ok){z=await G.json();break}}catch{}if(!z)throw new Error('Results file not found. Run "npm run test:oauth-compliance" first.');n(z)}catch(P){o(P instanceof Error?P.message:"Failed to load results")}finally{a(!1)}},j=J.useMemo(()=>{if(!t)return[];let P=t.results;return m!=="all"&&(P=P.filter(L=>L.status===m)),[...P].sort((L,G)=>{let F=0;return f==="name"?F=L.serverName.localeCompare(G.serverName):f==="score"?F=L.score-G.score:f==="status"&&(F=L.status.localeCompare(G.status)),l==="asc"?F:-F})},[t,f,l,m]),R=P=>{const z={oauth:{label:"OAuth",className:"status-badge status-oauth",icon:Ug},header_auth:{label:"Header Auth",className:"status-badge status-header-auth",icon:Dd},no_auth:{label:"Public Access",className:"status-badge status-no-auth",icon:m1},error:{label:"Error",className:"status-badge status-error",icon:Ed},unknown:{label:"Unknown",className:"status-badge status-unknown",icon:Tb}},L=z[P]||z.unknown,G=L.icon;return _.jsxs("span",{className:L.className,children:[_.jsx(G,{size:14}),L.label]})},k=P=>P>=75?"var(--color-success)":P>=50?"var(--color-warning)":P>=25?"var(--color-error-light)":"var(--color-error)";return!t&&!i&&!u?_.jsxs("div",{className:"oauth-compliance-container",children:[_.jsxs("div",{className:"oauth-compliance-header",children:[_.jsxs("div",{className:"header-content",children:[_.jsx("div",{className:"header-icon",children:_.jsx(Ug,{size:32})}),_.jsxs("div",{className:"header-text",children:[_.jsx("h1",{children:"OAuth Compliance Results"}),_.jsx("p",{children:"Testing MCP servers against OAuth 2.1 and RFC specifications"})]})]}),_.jsxs("button",{className:"refresh-button",onClick:I,children:[_.jsx(jd,{size:16}),"Refresh"]})]}),_.jsx("div",{className:"oauth-compliance-empty",children:_.jsxs("div",{className:"empty-state",children:[_.jsx("div",{className:"empty-icon",children:_.jsx(h1,{size:64,strokeWidth:1.5})}),_.jsx("h2",{children:"No Results Yet"}),_.jsx("p",{children:"Run the OAuth compliance test to see results"}),_.jsx("code",{className:"command",children:"npm run test:oauth-compliance"}),_.jsxs("button",{className:"load-button",onClick:I,children:[_.jsx(L0,{size:16}),"Load Results"]})]})})]}):i?_.jsx("div",{className:"oauth-compliance-container",children:_.jsxs("div",{className:"oauth-compliance-loading",children:[_.jsx("div",{className:"spinner"}),_.jsx("p",{children:"Loading results..."})]})}):u?_.jsx("div",{className:"oauth-compliance-container",children:_.jsxs("div",{className:"oauth-compliance-error",children:[_.jsx("h2",{children:"❌ Error Loading Results"}),_.jsx("p",{children:u}),_.jsx("button",{className:"retry-button",onClick:I,children:"Retry"})]})}):t?_.jsxs("div",{className:"oauth-compliance-container",children:[_.jsxs("div",{className:"oauth-compliance-header",children:[_.jsx("h1",{children:"🔐 OAuth Compliance Results"}),_.jsx("p",{children:t.metadata.description}),_.jsx("button",{className:"refresh-button",onClick:I,children:"🔄 Refresh"})]}),_.jsxs("div",{className:"summary-grid",children:[_.jsxs("div",{className:"summary-card",children:[_.jsx("div",{className:"summary-icon",children:_.jsx(fc,{size:24})}),_.jsxs("div",{className:"summary-content",children:[_.jsx("div",{className:"summary-number",children:t.summary.testedServers}),_.jsx("div",{className:"summary-label",children:"Servers Tested"}),_.jsxs("div",{className:"summary-subtitle",children:["of ",t.summary.totalServers]})]})]}),_.jsxs("div",{className:"summary-card summary-card-success",children:[_.jsx("div",{className:"summary-icon",children:_.jsx(Ug,{size:24})}),_.jsxs("div",{className:"summary-content",children:[_.jsx("div",{className:"summary-number",children:t.summary.oauthCompliant}),_.jsx("div",{className:"summary-label",children:"OAuth Compliant"}),_.jsxs("div",{className:"summary-subtitle",children:[Math.round(t.summary.oauthCompliant/t.summary.testedServers*100),"%"]})]})]}),_.jsxs("div",{className:"summary-card summary-card-warning",children:[_.jsx("div",{className:"summary-icon",children:_.jsx(Dd,{size:24})}),_.jsxs("div",{className:"summary-content",children:[_.jsx("div",{className:"summary-number",children:t.summary.headerAuth}),_.jsx("div",{className:"summary-label",children:"Header Auth"}),_.jsxs("div",{className:"summary-subtitle",children:[Math.round(t.summary.headerAuth/t.summary.testedServers*100),"%"]})]})]}),_.jsxs("div",{className:"summary-card summary-card-success",children:[_.jsx("div",{className:"summary-icon",children:_.jsx(m1,{size:24})}),_.jsxs("div",{className:"summary-content",children:[_.jsx("div",{className:"summary-number",children:t.summary.noAuth}),_.jsx("div",{className:"summary-label",children:"Public Access"}),_.jsxs("div",{className:"summary-subtitle",children:[Math.round(t.summary.noAuth/t.summary.testedServers*100),"%"]})]})]})]}),_.jsxs("div",{className:"specs-section",children:[_.jsxs("h3",{children:[_.jsx(rM,{size:20})," Testing Against"]}),_.jsx("ul",{className:"specs-list",children:t.metadata.specs.map((P,z)=>_.jsxs("li",{onClick:()=>O(P),className:"spec-item-clickable",title:"Click for implementation details",children:[_.jsx(Ua,{size:16}),P,_.jsx(oc,{size:14,className:"spec-info-icon"})]},z))})]}),_.jsxs("div",{className:"controls-bar",children:[_.jsxs("div",{className:"filter-group",children:[_.jsx(fa,{size:16}),_.jsx("label",{children:"Filter:"}),_.jsxs("select",{value:m,onChange:P=>g(P.target.value),children:[_.jsxs("option",{value:"all",children:["All (",t.results.length,")"]}),_.jsxs("option",{value:"oauth",children:["OAuth (",t.summary.oauthCompliant,")"]}),_.jsxs("option",{value:"header_auth",children:["Header Auth (",t.summary.headerAuth,")"]}),_.jsxs("option",{value:"no_auth",children:["Public Access (",t.summary.noAuth,")"]}),_.jsxs("option",{value:"error",children:["Error (",t.summary.errors,")"]})]})]}),_.jsxs("div",{className:"sort-group",children:[_.jsx(tM,{size:16}),_.jsx("label",{children:"Sort:"}),_.jsxs("select",{value:f,onChange:P=>d(P.target.value),children:[_.jsx("option",{value:"score",children:"Compliance Score"}),_.jsx("option",{value:"name",children:"Server Name"}),_.jsx("option",{value:"status",children:"Status"})]}),_.jsx("button",{className:"sort-order-button",onClick:()=>h(P=>P==="asc"?"desc":"asc"),title:l==="asc"?"Ascending":"Descending",children:l==="asc"?"↑":"↓"})]})]}),_.jsxs("div",{className:"results-table",children:[_.jsxs("div",{className:"results-header",children:[_.jsx("div",{className:"col-name",children:"Server"}),_.jsx("div",{className:"col-score",children:"Compliance Score"}),_.jsx("div",{className:"col-status",children:"Status"}),_.jsx("div",{className:"col-checks",children:"Checks"}),_.jsx("div",{className:"col-actions"})]}),j.map(P=>{const z=v[P.url];return!z&&P.iconUrl&&console.log("[OAuthCompliance] Missing favicon in cache for",P.serverName,{url:P.url,iconUrl:P.iconUrl,inCache:P.url in v,cacheValue:v[P.url]}),_.jsxs("div",{className:"result-row",children:[_.jsxs("div",{className:"result-main",children:[_.jsx("div",{className:"col-name",children:_.jsxs("div",{className:"server-name-with-icon",children:[z?_.jsx("img",{src:z,alt:`${P.serverName} favicon`,className:"server-favicon",onError:L=>{L.currentTarget.style.display="none"}}):_.jsx("div",{className:"server-favicon-placeholder",children:_.jsx(fc,{size:16})}),_.jsxs("div",{className:"server-info",children:[_.jsx("div",{className:"server-name",children:P.serverName}),_.jsx("div",{className:"server-url",children:P.url})]})]})}),_.jsx("div",{className:"col-score",children:P.status==="no_auth"?_.jsxs("div",{className:"score-na",children:[_.jsx("span",{className:"na-badge",children:"N/A"}),_.jsx("span",{className:"na-text",children:"No OAuth Required"})]}):_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"score-bar-container",children:_.jsx("div",{className:"score-bar-fill",style:{width:`${P.score}%`,backgroundColor:k(P.score)}})}),_.jsxs("div",{className:"score-text",style:{color:k(P.score)},children:[P.score,"%"]})]})}),_.jsx("div",{className:"col-status",children:R(P.status)}),_.jsx("div",{className:"col-checks",children:_.jsxs("div",{className:"checks-grid",children:[_.jsxs("span",{className:P.compliance.wwwAuthenticateHeader?"check-pass":"check-fail",title:"WWW-Authenticate Header: Server returns RFC 6750 compliant WWW-Authenticate header with 'Bearer' realm on 401 responses",children:[P.compliance.wwwAuthenticateHeader?_.jsx(Ua,{size:14}):_.jsx(Ed,{size:14}),"Header"]}),_.jsxs("span",{className:P.compliance.rfc9728Metadata?"check-pass":"check-fail",title:"RFC 9728 Metadata: Server provides OAuth metadata at /.well-known/oauth-protected-resource endpoint",children:[P.compliance.rfc9728Metadata?_.jsx(Ua,{size:14}):_.jsx(Ed,{size:14}),"RFC 9728"]}),_.jsxs("span",{className:P.compliance.oauthErrorCodes?"check-pass":"check-fail",title:"OAuth Error Codes: Server returns RFC 6750 compliant error codes (invalid_token, insufficient_scope, etc.)",children:[P.compliance.oauthErrorCodes?_.jsx(Ua,{size:14}):_.jsx(Ed,{size:14}),"Errors"]}),_.jsxs("span",{className:P.compliance.mcpSdkUnauthorizedError?"check-pass check-sdk":"check-fail check-sdk",title:"MCP SDK Integration (Informational): MCP SDK properly detects OAuth requirement and throws UnauthorizedError. This is a client SDK feature, not a server requirement.",children:[P.compliance.mcpSdkUnauthorizedError?_.jsx(Ua,{size:14}):_.jsx(oc,{size:14}),"SDK"]})]})}),_.jsx("div",{className:"col-actions",children:_.jsx("button",{className:"expand-button",onClick:()=>E(b===P.url?null:P.url),title:b===P.url?"Collapse":"Expand details",children:b===P.url?_.jsx(j0,{size:16}):_.jsx(Vh,{size:16})})})]}),b===P.url&&_.jsxs("div",{className:"result-details",children:[_.jsxs("h4",{children:[_.jsx(oc,{size:18})," Detailed Information"]}),_.jsxs("div",{className:"details-grid",children:[P.details.httpStatus&&_.jsxs("div",{className:"detail-item",children:[_.jsx("span",{className:"detail-label",children:"HTTP Status:"}),_.jsx("span",{className:"detail-value",children:P.details.httpStatus})]}),P.details.wwwAuthenticate&&_.jsxs("div",{className:"detail-item",children:[_.jsx("span",{className:"detail-label",children:"WWW-Authenticate:"}),_.jsx("span",{className:"detail-value detail-code",children:P.details.wwwAuthenticate})]}),P.details.resourceMetadataUrl&&_.jsxs("div",{className:"detail-item",children:[_.jsx("span",{className:"detail-label",children:"Resource Metadata URL:"}),_.jsxs("a",{href:P.details.resourceMetadataUrl,target:"_blank",rel:"noopener noreferrer",className:"detail-value detail-link",children:[_.jsx(Bg,{size:14}),P.details.resourceMetadataUrl]})]}),P.details.oauthErrorCode&&_.jsxs("div",{className:"detail-item",children:[_.jsx("span",{className:"detail-label",children:"OAuth Error Code:"}),_.jsx("span",{className:"detail-value detail-highlight",children:P.details.oauthErrorCode})]}),P.details.authorizationServers&&_.jsxs("div",{className:"detail-item",children:[_.jsx("span",{className:"detail-label",children:"Authorization Servers:"}),_.jsx("div",{className:"detail-value",children:P.details.authorizationServers.map((L,G)=>_.jsx("div",{children:_.jsxs("a",{href:L,target:"_blank",rel:"noopener noreferrer",className:"detail-link",children:[_.jsx(Bg,{size:14}),L]})},G))})]}),P.details.resource&&_.jsxs("div",{className:"detail-item",children:[_.jsx("span",{className:"detail-label",children:"Resource:"}),_.jsxs("a",{href:P.details.resource,target:"_blank",rel:"noopener noreferrer",className:"detail-value detail-link",children:[_.jsx(Bg,{size:14}),P.details.resource]})]}),P.details.scopesSupported&&_.jsxs("div",{className:"detail-item",children:[_.jsx("span",{className:"detail-label",children:"Scopes Supported:"}),_.jsx("span",{className:"detail-value",children:P.details.scopesSupported.join(", ")})]}),P.details.bearerMethodsSupported&&_.jsxs("div",{className:"detail-item",children:[_.jsx("span",{className:"detail-label",children:"Bearer Methods:"}),_.jsx("span",{className:"detail-value",children:P.details.bearerMethodsSupported.join(", ")})]})]}),P.details.responseBody&&_.jsxs("div",{className:"detail-item detail-full",children:[_.jsx("span",{className:"detail-label",children:"Response Body:"}),_.jsx("pre",{className:"detail-json",children:JSON.stringify(P.details.responseBody,null,2)})]}),P.error&&_.jsxs("div",{className:"detail-item detail-full",children:[_.jsx("span",{className:"detail-label error-label",children:"Error:"}),_.jsx("span",{className:"detail-value error-message",children:P.error})]})]})]},P.url)})]}),j.length===0&&_.jsx("div",{className:"no-results",children:_.jsx("p",{children:"No servers match the current filter."})}),_.jsxs("div",{className:"results-footer",children:[_.jsxs("p",{children:["Test run: ",new Date(t.metadata.startTime).toLocaleString(),t.metadata.endTime&&` - ${new Date(t.metadata.endTime).toLocaleString()}`]}),_.jsxs("p",{className:"footer-note",children:["To run the test again: ",_.jsx("code",{children:"npm run test:oauth-compliance"})]})]}),T&&x[T]&&_.jsx("div",{className:"spec-modal-overlay",onClick:()=>O(null),children:_.jsxs("div",{className:"spec-modal",onClick:P=>P.stopPropagation(),children:[_.jsxs("div",{className:"spec-modal-header",children:[_.jsxs("h2",{children:[_.jsx(h1,{size:24})," ",x[T].title]}),_.jsx("button",{className:"spec-modal-close",onClick:()=>O(null),title:"Close",children:_.jsx(lx,{size:20})})]}),_.jsxs("div",{className:"spec-modal-content",children:[_.jsxs("div",{className:"spec-modal-section",children:[_.jsxs("h3",{children:[_.jsx(oc,{size:20})," Overview"]}),_.jsx("p",{children:x[T].description})]}),_.jsxs("div",{className:"spec-modal-section",children:[_.jsxs("h3",{children:[_.jsx(L0,{size:20})," How to Implement"]}),_.jsx("ol",{className:"spec-modal-list",children:x[T].implementation.map((P,z)=>_.jsx("li",{children:P},z))})]}),_.jsxs("div",{className:"spec-modal-section",children:[_.jsxs("h3",{children:[_.jsx(Ua,{size:20})," Pass Criteria (Our Test)"]}),_.jsxs("p",{className:"spec-modal-note",children:["We mark this check as ",_.jsx("strong",{children:"PASSED"})," when:"]}),_.jsx("ul",{className:"spec-modal-list spec-modal-criteria",children:x[T].passCriteria.map((P,z)=>_.jsxs("li",{children:[_.jsx(Ua,{size:16,className:"criteria-icon"}),P]},z))})]}),_.jsx("div",{className:"spec-modal-footer",children:_.jsxs("p",{children:[_.jsx("strong",{children:"Note:"})," Servers must pass at least one of the three checks to be considered OAuth-compliant. Passing all three checks indicates full RFC compliance."]})})]})]})})]}):null}),Eb="hoot-has-seen-welcome";function mY({onClose:e,onGetStarted:t}){const[n,i]=J.useState(!1),a=()=>{n&&localStorage.setItem(Eb,"true"),e()},u=()=>{n&&localStorage.setItem(Eb,"true"),t&&t(),e()};return J.useEffect(()=>{const o=f=>{f.key==="Enter"&&(f.preventDefault(),u())};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[n,t,e]),_.jsx(Cw,{onClose:a,children:_.jsxs("div",{className:"welcome-modal",children:[_.jsxs("div",{className:"welcome-header",children:[_.jsx("span",{className:"welcome-logo",children:"đŸĻ‰"}),_.jsx("h2",{className:"welcome-title",children:"Welcome to Hoot!"}),_.jsx("p",{className:"welcome-subtitle",children:"A beautiful tool to test and explore MCP (Model Context Protocol) servers"})]}),_.jsxs("div",{className:"welcome-features",children:[_.jsxs("div",{className:"welcome-feature",children:[_.jsx("div",{className:"feature-icon",children:_.jsx(lm,{size:24})}),_.jsxs("div",{className:"feature-content",children:[_.jsx("h3",{children:"Test Tools"}),_.jsx("p",{children:"Connect to MCP servers and test their tools with an intuitive interface"})]})]}),_.jsxs("div",{className:"welcome-feature",children:[_.jsx("div",{className:"feature-icon",children:_.jsx(Ld,{size:24})}),_.jsxs("div",{className:"feature-content",children:[_.jsx("h3",{children:"AI-Powered Chat"}),_.jsx("p",{children:"Chat with AI that can use your MCP tools to accomplish tasks"})]})]}),_.jsxs("div",{className:"welcome-feature",children:[_.jsx("div",{className:"feature-icon",children:_.jsx(Ab,{size:24})}),_.jsxs("div",{className:"feature-content",children:[_.jsx("h3",{children:"Keyboard Shortcuts"}),_.jsxs("p",{children:["Navigate efficiently with vim-style shortcuts (press ",_.jsx("kbd",{children:"?"})," to view all)"]})]})]}),_.jsxs("div",{className:"welcome-feature",children:[_.jsx("div",{className:"feature-icon",children:_.jsx(L0,{size:24})}),_.jsxs("div",{className:"feature-content",children:[_.jsx("h3",{children:"Quick Start"}),_.jsx("p",{children:"Try public servers instantly or connect your own MCP server"})]})]})]}),_.jsxs("div",{className:"welcome-footer",children:[_.jsx(qb,{label:"Don't show this again",checked:n,onChange:o=>i(o.target.checked)}),_.jsxs("div",{className:"welcome-actions",children:[_.jsx(Bt,{variant:"secondary",onClick:a,children:"Skip"}),_.jsx(Bt,{variant:"primary",onClick:u,children:"Get Started →"})]})]})]})})}function II(){return localStorage.getItem(Eb)==="true"}function pY(){const[e,t]=J.useState(!1);return J.useEffect(()=>{t(!II())},[]),{showWelcome:e,setShowWelcome:t}}function gY(){try{if(window.location.hash.startsWith("#/try")){const u=new URL(window.location.href.replace("#/try","")).searchParams.get("config");if(u){const o=atob(u),f=JSON.parse(o);return ix(f)}}const t=new URLSearchParams(window.location.search),n=t.get("try");if(n){const a=atob(n),u=JSON.parse(a);return ix(u)}const i=t.get("s")||t.get("server");if(i){const a=i.indexOf(":");if(a>0){const u=i.substring(0,a),o=i.substring(a+1);if(!Ue.getState().servers.find(l=>{if(l.url===o)return!0;if(l.name===u&&l.url){const h=m=>m.replace(/^https?:\/\//,"").replace(/\/$/,"");return h(l.url)===h(o)}return!1}))return{name:u,transport:"http",url:o}}}return null}catch(e){return console.error("Failed to parse Try in Hoot URL:",e),gi.error("Invalid Link",'The "Try in Hoot" link is malformed or invalid'),null}}function ix(e){if(!e||typeof e!="object")throw new Error("Config must be an object");if(e.url&&!e.name&&!e.transport)return{name:"",transport:"http",url:e.url,...e.auth&&{auth:e.auth}};if(!e.name||typeof e.name!="string")throw new Error('Config must include a "name" string (or just provide URL for auto-detection)');if(!e.transport||!["stdio","sse","http"].includes(e.transport))throw new Error('Config must include a valid "transport" (stdio, sse, or http)');if(e.transport==="stdio"&&!e.command)throw new Error('stdio transport requires a "command" field');if((e.transport==="sse"||e.transport==="http")&&!e.url)throw new Error('SSE/HTTP transport requires a "url" field');if(e.auth&&((!e.auth.type||!["none","headers","oauth","client_credentials"].includes(e.auth.type))&&console.warn(`Unknown auth type: ${e.auth.type}, but allowing it for future compatibility`),e.auth.type==="headers"&&!e.auth.headers))throw new Error('Header auth requires "headers" object');return{name:e.name,transport:e.transport,...e.command&&{command:e.command},...e.url&&{url:e.url},...e.auth&&{auth:e.auth}}}function bY({config:e,onConfirm:t,onCancel:n,isConnecting:i,isFirstTime:a}){return Kb.createPortal(_.jsx("div",{className:"modal-overlay",children:_.jsxs("div",{className:"modal",style:{maxWidth:"520px"},children:[_.jsxs("div",{className:"modal-header",children:[_.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",marginBottom:"8px"},children:[_.jsx("span",{style:{fontSize:"28px",filter:"drop-shadow(0 2px 8px rgba(92, 207, 230, 0.3))"},children:"đŸĻ‰"}),_.jsx("h2",{style:{margin:0},children:a?"Welcome to Hoot!":"Add MCP Server"})]}),_.jsx("p",{style:{textAlign:"center",color:"var(--theme-text-secondary)",fontSize:"14px",fontWeight:400,marginTop:"4px",marginBottom:a?"12px":"24px",lineHeight:"1.5"},children:a?"Hoot lets you test and explore MCP servers. Let's add your first one!":"Connect to this server to use its tools"})]}),_.jsxs("div",{className:"modal-body",children:[_.jsxs("div",{style:{background:"var(--theme-bg-tertiary)",padding:"20px",borderRadius:"var(--radius-lg)",marginBottom:"20px",border:"2px solid color-mix(in srgb, var(--theme-accent-primary) 30%, transparent)"},children:[_.jsx(bd,{label:"Server Name",value:e.name,icon:"đŸˇī¸"}),_.jsx(bd,{label:"Transport",value:e.transport.toUpperCase(),icon:"🔌",badge:!0}),e.url&&_.jsx(bd,{label:"URL",value:e.url,icon:"🌐",mono:!0}),e.command&&_.jsx(bd,{label:"Command",value:e.command,icon:"⚡",mono:!0}),e.auth&&e.auth.type!=="none"&&_.jsx(bd,{label:"Authentication",value:e.auth.type==="oauth"?"OAuth 2.1":"Custom Headers",icon:"🔐",isLast:!0})]}),_.jsxs("div",{style:{background:"color-mix(in srgb, var(--theme-warning) 15%, transparent)",border:"1px solid color-mix(in srgb, var(--theme-warning) 30%, transparent)",padding:"12px 14px",borderRadius:"var(--radius-md)",fontSize:"12px",lineHeight:"1.5",color:"var(--theme-warning)",display:"flex",gap:"10px"},children:[_.jsx("span",{style:{flexShrink:0},children:"âš ī¸"}),_.jsx("span",{children:"Only add servers from trusted sources"})]})]}),_.jsxs("div",{className:"modal-footer",children:[_.jsx(Bt,{variant:"secondary",onClick:n,disabled:i,children:"Cancel"}),i?_.jsx(Bt,{variant:"primary",disabled:!0,children:_.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[_.jsx("span",{className:"spinner-small"}),_.jsx("span",{children:"Connecting..."})]})}):_.jsx(Bt,{variant:"primary",onClick:t,children:a?"Get Started →":"Add & Connect"})]})]})}),document.body)}function bd({label:e,value:t,icon:n,mono:i,badge:a,isLast:u}){return _.jsxs("div",{style:{marginBottom:u?"0":"14px"},children:[_.jsxs("div",{style:{color:"var(--theme-accent-primary)",fontSize:"11px",fontWeight:600,marginBottom:"6px",textTransform:"uppercase",letterSpacing:"0.5px",display:"flex",alignItems:"center",gap:"6px"},children:[_.jsx("span",{children:n}),_.jsx("span",{children:e})]}),_.jsx("div",{style:{color:"var(--theme-text-primary)",fontSize:"14px",fontWeight:500,fontFamily:i?"var(--font-mono)":"var(--font-sans)",wordBreak:"break-all",lineHeight:"1.4",...a&&{display:"inline-block",background:"var(--theme-bg-primary)",padding:"4px 10px",borderRadius:"var(--radius-sm)",border:"1px solid color-mix(in srgb, var(--theme-accent-primary) 40%, transparent)",color:"var(--theme-accent-primary)",fontSize:"12px",fontWeight:600}},children:t})]})}function _Y(){const[e,t]=J.useState(null),[n,i]=J.useState(!1),a=Ue(m=>m.addServer),u=Ue(m=>m.setSelectedServer),o=Ue(m=>m.servers),{connect:f}=yc(),d=!II()&&o.length===0;J.useEffect(()=>{const m=gY();if(m){t(m);const g=new URL(window.location.href);g.hash.startsWith("#/try")?(g.hash="",window.history.replaceState({},"",g.toString())):g.searchParams.has("try")&&(g.searchParams.delete("try"),window.history.replaceState({},"",g.toString()))}},[]);const l=async()=>{if(!(!e||n)){i(!0);try{let m=e;if(e.url&&!e.command&&e.transport==="http")try{const T=await wb(e.url);if(T.success){let O={type:"none"};T.requiresOAuth?O={type:"oauth"}:T.requiresClientCredentials?O={type:"oauth_client_credentials"}:T.requiresHeaderAuth&&(O={type:"headers",headers:{}}),m={name:e.name||T.serverInfo?.name||"MCP Server",transport:T.transport||"http",url:e.url,auth:O}}}catch(T){console.warn("Auto-detection failed, using basic config:",T)}a(m);const g=Ue.getState().servers,b=g[g.length-1];if(u(b.id),await f(b))d&&localStorage.setItem("hoot-has-seen-welcome","true"),gi.success("Server Added",`Successfully connected to ${m.name}`),t(null);else{const T=Ue.getState().servers.find(O=>O.id===b.id);T?.error?(gi.error("Connection Failed",T.error),t(null)):(gi.info("OAuth Required","Redirecting to complete authentication..."),t(null))}}catch(m){const g=m instanceof Error?m.message:"Failed to add server";gi.error("Failed to Add Server",g),t(null)}finally{i(!1)}}},h=()=>{t(null)};return e&&e?_.jsx(bY,{config:e,onConfirm:l,onCancel:h,isConnecting:n,isFirstTime:d}):null}const yY=J.memo(function({toast:t,onDismiss:n}){J.useEffect(()=>{const a=t.duration||5e3;if(a>0){const u=setTimeout(()=>{n(t.id)},a);return()=>clearTimeout(u)}},[t,n]);const i=()=>{switch(t.type){case"success":return _.jsx(dM,{size:20});case"error":return _.jsx(Ed,{size:20});case"warning":return _.jsx(Tb,{size:20});case"info":return _.jsx(oc,{size:20})}};return _.jsxs("div",{className:`toast toast-${t.type}`,children:[_.jsx("div",{className:"toast-icon",children:i()}),_.jsxs("div",{className:"toast-content",children:[_.jsx("div",{className:"toast-message",children:t.message}),t.description&&_.jsx("div",{className:"toast-description",children:t.description})]}),_.jsx("button",{className:"toast-close",onClick:()=>n(t.id),"aria-label":"Dismiss",children:_.jsx(lx,{size:16})})]})}),EY=J.memo(function({toasts:t,onDismiss:n}){return _.jsx("div",{className:"toast-container",children:t.map(i=>_.jsx(yY,{toast:i,onDismiss:n},i.id))})});class vY extends J.Component{constructor(t){super(t),this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("🚨 Error Boundary caught an error:",t,n),this.setState({error:t,errorInfo:n})}handleReset=()=>{this.setState({hasError:!1,error:null,errorInfo:null}),this.props.onReset?.()};render(){return this.state.hasError?this.props.fallback?this.props.fallback:_.jsx("div",{className:"error-boundary",children:_.jsxs("div",{className:"error-boundary-content",children:[_.jsx("div",{className:"error-icon",children:_.jsx(YM,{size:48})}),_.jsx("h2",{className:"error-title",children:"Something went wrong"}),_.jsx("p",{className:"error-message",children:this.state.error?.message||"An unexpected error occurred"}),!1,_.jsxs(Bt,{variant:"primary",onClick:this.handleReset,children:[_.jsx(jd,{size:16}),_.jsx("span",{children:"Try Again"})]})]})}):this.props.children}}const TY=[{id:"arctic-night",name:"Arctic Night",emoji:"🌑",type:"dark"},{id:"ayu-mirage",name:"Ayu Mirage",emoji:"🌀",type:"dark"},{id:"duotone-dark",name:"DuoTone Dark",emoji:"🌙",type:"dark"},{id:"duotone-sea",name:"DuoTone Sea",emoji:"🌊",type:"dark"},{id:"duotone-forest",name:"DuoTone Forest",emoji:"🌲",type:"dark"},{id:"nordic-snow",name:"Nordic Snow",emoji:"â„ī¸",type:"light"},{id:"ayu-light",name:"Ayu Light",emoji:"â˜€ī¸",type:"light"},{id:"duotone-light",name:"DuoTone Light",emoji:"✨",type:"light"}];function AY(){const e=()=>window.matchMedia("(prefers-color-scheme: dark)").matches?"arctic-night":"nordic-snow",[t,n]=J.useState(()=>localStorage.getItem("hoot-theme")||e()),[i,a]=J.useState(()=>!localStorage.getItem("hoot-theme")),u=f=>{window.applyTheme&&window.applyTheme(f),localStorage.setItem("hoot-theme",f),n(f),a(!1),setTimeout(()=>{window.initializeHills&&window.initializeHills()},100)},o=()=>{localStorage.removeItem("hoot-theme");const f=e();window.applyTheme&&window.applyTheme(f),n(f),a(!0),setTimeout(()=>{window.initializeHills&&window.initializeHills()},100)};return J.useEffect(()=>{if(!i)return;const f=window.matchMedia("(prefers-color-scheme: dark)"),d=l=>{const h=l.matches?"arctic-night":"nordic-snow";n(h),window.applyTheme&&window.applyTheme(h),window.initializeHills&&window.initializeHills()};return f.addEventListener("change",d),()=>f.removeEventListener("change",d)},[i]),_.jsxs("div",{className:"theme-switcher-header",children:[_.jsx("button",{className:"theme-trigger",title:"Change theme",children:_.jsx(LM,{size:18})}),_.jsxs("div",{className:"theme-dropdown",children:[_.jsx("button",{"data-theme":"system","data-tooltip":"System Default",className:`theme-option ${i?"active":""} theme-option-system`,onClick:o,children:_.jsx("span",{className:"theme-emoji",children:"🌗"})}),_.jsx("div",{className:"theme-divider"}),TY.map(f=>_.jsx("button",{"data-theme":f.id,"data-theme-type":f.type,"data-tooltip":f.name,className:`theme-option ${!i&&t===f.id?"active":""} theme-option-${f.type}`,onClick:()=>u(f.id),children:_.jsx("span",{className:"theme-emoji",children:f.emoji})},f.id))]})]})}const OY=J.memo(function({onClose:t,shortcuts:n}){return J.useEffect(()=>{const i=a=>{a.key==="Escape"&&t()};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i)}},[t]),_.jsx("div",{className:"modal-overlay",onClick:t,children:_.jsxs("div",{className:"modal keyboard-shortcuts-modal",onClick:i=>i.stopPropagation(),children:[_.jsx("div",{className:"modal-header",children:_.jsxs("div",{className:"modal-title-row",children:[_.jsx(Ab,{size:24}),_.jsx("h2",{children:"Keyboard Shortcuts"})]})}),_.jsx("div",{className:"modal-body",children:_.jsx("div",{className:"shortcuts-grid",children:n.map(i=>_.jsxs("div",{className:"shortcut-category",children:[_.jsx("h3",{className:"shortcut-category-title",children:i.category}),_.jsx("div",{className:"shortcut-list",children:i.shortcuts.map((a,u)=>_.jsxs("div",{className:"shortcut-item",children:[_.jsx("span",{className:"shortcut-description",children:a.description}),_.jsx("kbd",{className:"shortcut-key",children:Aw(a)})]},u))})]},i.category))})}),_.jsx("div",{className:"modal-footer",children:_.jsx("button",{className:"btn btn-secondary",onClick:t,children:"Close"})})]})})});function SY(){const e=Ue(i=>i.servers),t=Ue(i=>i.tools),{connect:n}=yc();J.useEffect(()=>{let i=!1;if(i)return;if(i=!0,sessionStorage.getItem("skip_auto_reconnect")){console.log("🔐 Skipping auto-reconnect after OAuth callback"),sessionStorage.removeItem("skip_auto_reconnect");return}const a=e.filter(u=>t[u.id]&&t[u.id].length>0&&!u.connected);a.length>0&&(console.log(`đŸĻ‰ Hoot: Auto-reconnecting to ${a.length} server(s)...`),a.forEach(u=>{const o=u.auth?.type==="oauth";n(u,void 0,o,!0).catch(d=>{u.auth?.type==="oauth"?console.log(`🔐 ${u.name} needs manual reconnection (OAuth)`):console.warn(`Failed to auto-reconnect to ${u.name}:`,d)})}))},[])}const CY="0.15.0",xY={version:CY};class wY{logs=[];maxLogs=1e3;isEnabled=!1;constructor(){this.isEnabled&&(this.interceptConsole(),console.log("🐛 Development logger initialized. Logs are being captured."))}interceptConsole(){const t=console.log,n=console.warn,i=console.error,a=console.info,u=console.debug;console.log=(...o)=>{this.addLog("log",o),t.apply(console,o)},console.warn=(...o)=>{this.addLog("warn",o),n.apply(console,o)},console.error=(...o)=>{this.addLog("error",o),i.apply(console,o)},console.info=(...o)=>{this.addLog("info",o),a.apply(console,o)},console.debug=(...o)=>{this.addLog("debug",o),u.apply(console,o)}}addLog(t,n){if(!this.isEnabled)return;const i=new Date().toISOString();this.logs.push({timestamp:i,level:t,args:n}),this.logs.length>this.maxLogs&&this.logs.shift()}formatLogs(){return this.logs.map(t=>{const n=t.args.map(i=>{if(typeof i=="object")try{return JSON.stringify(i,null,2)}catch{return String(i)}return String(i)}).join(" ");return`[${t.timestamp}] [${t.level.toUpperCase()}] ${n}`}).join(`
392
+ `)}downloadLogs(){if(!this.isEnabled){console.warn("Logger is not enabled in production");return}const t=this.formatLogs(),n=new Blob([t],{type:"text/plain"}),i=URL.createObjectURL(n),a=document.createElement("a");a.href=i,a.download=`hoot-logs-${Date.now()}.txt`,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i),console.log("đŸ“Ĩ Logs downloaded successfully")}getLogs(){return this.formatLogs()}clearLogs(){this.logs=[],console.log("đŸ—‘ī¸ Logs cleared")}exposeToWindow(){this.isEnabled&&(window.hootLogger={download:()=>this.downloadLogs(),clear:()=>this.clearLogs(),get:()=>this.getLogs(),count:()=>this.logs.length},console.log(`🐛 Logger controls available:
393
+ - hootLogger.download() - Download logs to file
394
+ - hootLogger.clear() - Clear all logs
395
+ - hootLogger.get() - Get logs as string
396
+ - hootLogger.count() - Get log count`))}}new wY;function RY(e){return e.startsWith("/oauth-compliance")?"oauth-compliance":e.startsWith("/chat")?"hybrid":"test"}function sx(e){const t=e==="hybrid"?"/chat":"/test",n=new URLSearchParams(window.location.search);n.set("view",e);const i=`${t}${n.toString()?"?"+n.toString():""}`;window.history.pushState({},"",i),window.dispatchEvent(new PopStateEvent("popstate"))}function NY(){const[e,t]=J.useState(!1),[n,i]=J.useState(null),[a,u]=J.useState(!1),[o,f]=J.useState(window.location.pathname),d=RY(o),l=eo(F=>F.toasts),h=eo(F=>F.removeToast),{readURL:m,updateURL:g}=Ow(),b=Ue(F=>F.servers),E=Ue(F=>F.selectedServerId),T=Ue(F=>F.selectedToolName),O=Ue(F=>F.tools),v=Ue(F=>F.setSelectedServer),C=Ue(F=>F.setSelectedTool),x=Ue(F=>F.setSearchQuery),{showWelcome:I,setShowWelcome:j}=pY(),R=new URLSearchParams(window.location.search),k=R.has("s")||R.has("server")||R.has("try"),P=I&&b.length===0&&!k;J.useEffect(()=>{dx()},[]),SY();const z=J.useRef(!0);J.useEffect(()=>{z.current=!1},[]),J.useEffect(()=>{if(!z.current&&E){const F=b.find(K=>K.id===E);if(F&&F.url){const K=L4(F.name,F.url);m().server!==K&&g({server:K},!0,!1)}}},[E,b,g,m]),J.useEffect(()=>{if(z.current)return;const F=m();T===null&&F.tool&&!(E&&O[E]?.length>0)||F.tool!==T&&g({tool:T},!0,!1)},[T,E,O,g,m]),J.useEffect(()=>{const F=m();if(console.log("📋 URL State restoration effect running:",{urlState:F,selectedServerId:E,selectedToolName:T,hasTools:E?O[E]?.length:0}),F.server){const K=F.server.indexOf(":");if(K>0){const B=F.server.substring(0,K),Z=F.server.substring(K+1),U=Y=>Y.replace(/^https?:\/\//,"").replace(/\/$/,"");if(E){const Y=b.find(W=>W.id===E);if(Y){const W=Y.url===Z,pe=Y.name===B&&Y.url&&U(Y.url)===U(Z);if(W||pe)console.log("✅ Current server matches URL, skipping switch to avoid duplicate conflict");else{const N=b.find(M=>M.url===Z?!0:M.name===B&&M.url?U(M.url)===U(Z):!1);N&&(console.log("đŸ–Ĩī¸ Selecting server from URL:",N.name),v(N.id))}}else{const W=b.find(pe=>pe.url===Z?!0:pe.name===B&&pe.url?U(pe.url)===U(Z):!1);W&&v(W.id)}}else{const Y=b.find(W=>W.url===Z?!0:W.name===B&&W.url?U(W.url)===U(Z):!1);Y&&(console.log("đŸ–Ĩī¸ Selecting server from URL:",Y.name),v(Y.id))}}else{const B=b.find(Z=>Z.id===F.server);B&&B.id!==E&&(console.log("đŸ–Ĩī¸ Selecting server from URL (legacy):",B.name),v(F.server))}}if(F.tool&&E){const K=O[E];if(console.log("🔧 Tool selection check:",{toolFromURL:F.tool,selectedServerId:E,toolsLoaded:!!K,toolsCount:K?.length||0,currentlySelected:T}),K&&K.length>0){const B=K.some(Z=>Z.name===F.tool);B&&F.tool!==T?(console.log("✅ Selecting tool from URL:",F.tool),C(F.tool)):B?console.log("â„šī¸ Tool already selected:",F.tool):console.warn("âš ī¸ Tool from URL not found in server tools:",F.tool)}else console.log("âŗ Waiting for tools to load for server:",E)}F.search&&x(F.search),F.execution&&console.log("Deep link to execution:",F.execution)},[o,m,E,T,v,C,x,b,O]),J.useEffect(()=>{const F=()=>{f(window.location.pathname)};return window.addEventListener("popstate",F),()=>window.removeEventListener("popstate",F)},[]),Tw([{key:"a",description:"Add new server",handler:()=>t(!0)},{key:"/",description:"Focus on tool search",handler:()=>{const F=document.querySelector(".search-box");F&&(F.focus(),F.select())}},{key:"j",description:"Next server",handler:()=>{if(b.length===0)return;const F=b.findIndex(Z=>Z.id===E),K=F>=b.length-1?0:F+1,B=b[K].id;v(B),setTimeout(()=>{const Z=document.querySelector(`.server-item[data-server-id="${B}"]`);Z&&Z.scrollIntoView({behavior:"auto",block:"nearest"})},0)}},{key:"k",description:"Previous server",handler:()=>{if(b.length===0)return;const F=b.findIndex(Z=>Z.id===E),K=F<=0?b.length-1:F-1,B=b[K].id;v(B),setTimeout(()=>{const Z=document.querySelector(`.server-item[data-server-id="${B}"]`);Z&&Z.scrollIntoView({behavior:"auto",block:"nearest"})},0)}},{key:"ArrowUp",description:"Previous tool",handler:()=>{if(!E)return;const F=O[E]||[];if(F.length===0)return;const K=F.findIndex(U=>U.name===T),B=K<=0?F.length-1:K-1,Z=F[B].name;C(Z),setTimeout(()=>{const U=document.querySelector(`.tool-item[data-tool-name="${Z}"]`);U&&U.scrollIntoView({behavior:"auto",block:"nearest"})},0)}},{key:"ArrowDown",description:"Next tool",handler:()=>{if(!E)return;const F=O[E]||[];if(F.length===0)return;const K=F.findIndex(U=>U.name===T),B=K>=F.length-1?0:K+1,Z=F[B].name;C(Z),setTimeout(()=>{const U=document.querySelector(`.tool-item[data-tool-name="${Z}"]`);U&&U.scrollIntoView({behavior:"auto",block:"nearest"})},0)}},{key:"Enter",ctrl:!0,description:"Execute current tool",handler:()=>{const F=document.querySelector(".execute-btn:not(.executing)");F&&F.click()}},{key:"?",shift:!0,description:"Show keyboard shortcuts",handler:()=>u(!0)},{key:"Escape",description:"Close modals or clear search",handler:()=>{if(e)t(!1);else if(n)i(null);else if(a)u(!1);else{const F=document.querySelector(".search-box");F&&F===document.activeElement&&(x(""),F.blur())}},preventDefault:!1}]);const L=[{category:"Servers",shortcuts:[{key:"ArrowUp",description:"Previous server"},{key:"ArrowDown",description:"Next server"},{key:"a",description:"Add new server"}]},{category:"Tools",shortcuts:[{key:"/",description:"Focus tool search"},{key:"k",description:"Previous tool (Vim)"},{key:"j",description:"Next tool (Vim)"},{key:"Enter",ctrl:!0,description:"Execute current tool"},{key:"m",description:"Toggle Form/JSON mode"}]},{category:"Chat",shortcuts:[{key:"/",description:"Focus message input"},{key:"k",ctrl:!0,description:"Clear chat history"},{key:"Escape",description:"Blur from message input"}]},{category:"General",shortcuts:[{key:"?",shift:!0,description:"Show shortcuts"},{key:"Escape",description:"Close modal/Clear search"}]}];return o==="/oauth/callback"?_.jsx(fY,{}):_.jsx(vY,{children:_.jsxs("div",{className:"app",children:[_.jsxs("header",{className:"app-header",children:[_.jsxs("div",{className:"app-header-left",children:[_.jsxs("div",{className:"app-branding",children:[_.jsx("span",{className:"logo-icon",children:"đŸĻ‰"}),_.jsx("h1",{className:"app-title",children:"Hoot"})]}),_.jsxs("nav",{className:"app-nav",children:[_.jsxs("button",{className:`nav-button ${d==="test"?"active":""}`,onClick:()=>sx("test"),title:"Test MCP tools manually",children:[_.jsx(lm,{size:18}),_.jsx("span",{children:"Test Tools"})]}),_.jsxs("button",{className:`nav-button ${d==="hybrid"?"active":""}`,onClick:()=>sx("hybrid"),title:"Chat with AI to test tools",children:[_.jsx(Ld,{size:18}),_.jsx("span",{children:"Chat"})]})]})]}),_.jsxs("div",{className:"app-actions",children:[_.jsx(AY,{}),_.jsx("button",{className:"header-link",onClick:()=>u(!0),title:Jd("Keyboard shortcuts",{key:"?",shift:!0}),children:_.jsx(Ab,{size:18})}),_.jsx("a",{href:"https://portkey.ai/docs/hoot",target:"_blank",rel:"noopener noreferrer",className:"header-link",title:"Documentation",children:_.jsx(sM,{size:18})}),_.jsx("a",{href:"https://portkey.ai/community",target:"_blank",rel:"noopener noreferrer",className:"header-link",title:"Discord",children:_.jsx(DM,{size:18})}),_.jsxs("a",{href:"https://github.com/portkey-ai/hoot",target:"_blank",rel:"noopener noreferrer",className:"version-badge",title:"View on GitHub",children:[_.jsx(wM,{size:14}),_.jsxs("span",{children:["v",xY.version]})]})]})]}),_.jsxs("div",{className:"app-content",children:[d==="oauth-compliance"&&_.jsx(hY,{}),d==="test"&&_.jsxs("div",{className:"test-layout",children:[_.jsx(M4,{onAddServer:()=>t(!0),onEditServer:F=>i(F)}),_.jsx(H4,{}),_.jsx(K4,{})]}),d==="hybrid"&&_.jsx(cY,{})]}),P&&_.jsx(mY,{onClose:()=>j(!1),onGetStarted:()=>{j(!1),setTimeout(()=>{const F=document.querySelector(".add-server-btn");F&&(F.focus(),F.style.animation="none",setTimeout(()=>{F.style.animation="highlightPulse 1s ease-in-out"},10))},100)}}),e&&_.jsx(uY,{onClose:()=>t(!1)}),n&&_.jsx(dY,{server:n,onClose:()=>i(null)}),a&&_.jsx(OY,{shortcuts:L,onClose:()=>u(!1)}),_.jsx(_Y,{}),_.jsx(EY,{toasts:l,onDismiss:h})]})})}const hi={back:{startY:30,endY:30,cssVar:"--hills-layer-1",opacity:.3},middle:{startY:90,endY:90,cssVar:"--hills-layer-2",opacity:.4},front:{startY:120,endY:120,cssVar:"--hills-layer-3",opacity:.5}};function P0(e,t,n,i,a){const u=a!==void 0?kI(a):Math.random,o=Math.floor(u()*3)+3,f=[];f.push({x:0,y:t});for(let l=1;l<o;l++){const h=e/o*l,m=Math.min(t,n)-20,g=Math.min(t,n)+40,b=m+u()*(g-m);f.push({x:h,y:b})}f.push({x:e,y:n});let d=`M${f[0].x} ${f[0].y}`;for(let l=1;l<f.length;l++){const h=f[l-1],m=f[l],g=(m.x-h.x)/3,b=h.x+g,E=h.y+(u()-.5)*30,T=m.x-g,O=m.y+(u()-.5)*30;d+=` C${b} ${E}, ${T} ${O}, ${m.x} ${m.y}`}return d+=` V${i} H0 Z`,d}function kI(e){let t=e;return()=>(t=(t*1664525+1013904223)%4294967296,t/4294967296)}function _d(e=1920,t=150,n){const i=n!==void 0?kI(n):Math.random,a=(g,b)=>typeof window>"u"?b:getComputedStyle(document.documentElement).getPropertyValue(g).trim()||b,u=a(hi.back.cssVar,"#2e3440"),o=a(hi.middle.cssVar,"#3b4252"),f=a(hi.front.cssVar,"#434c5e"),d=P0(e,hi.back.startY,hi.back.endY,t,i()),l=P0(e,hi.middle.startY,hi.middle.endY,t,i()),h=P0(e,hi.front.startY,hi.front.endY,t,i()),m=`<svg viewBox='0 0 ${e} ${t}' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'>
397
+ <path d='${d}' fill='${u}' fill-opacity='${hi.back.opacity}'/>
398
+ <path d='${l}' fill='${o}' fill-opacity='${hi.middle.opacity}'/>
399
+ <path d='${h}' fill='${f}' fill-opacity='${hi.front.opacity}'/>
400
+ </svg>`;return`url("data:image/svg+xml,${encodeURIComponent(m)}")`}function MI(){const e=Date.now(),t=_d(1920,150,e+1),n=_d(1920,150,e+2),i=_d(1920,150,e+3),a=_d(1920,150,e+4),u=_d(1920,150,e+5);document.documentElement.style.setProperty("--hills-main-area",t),document.documentElement.style.setProperty("--hills-tools-sidebar",n),document.documentElement.style.setProperty("--hills-server-sidebar",i),document.documentElement.style.setProperty("--hills-empty-state",a),document.documentElement.style.setProperty("--hills-api-pane",u)}const IY=":root{--nord0: #242933;--nord1: #2e3440;--nord2: #3b4252;--nord3: #434c5e;--nord4-dark: #4c566a;--nord4: #d8dee9;--nord5: #e5e9f0;--nord6: #eceff4;--nord6-bright: #f9fafb;--nord7: #8fbcbb;--nord8: #88c0d0;--nord8-bright: #9cd9e6;--nord9: #81a1c1;--nord10: #5e81ac;--nord11: #bf616a;--nord12: #d08770;--nord13: #ebcb8b;--nord14: #a3be8c;--nord14-bright: #b5d49a;--nord15: #b48ead;--theme-bg-primary: var(--nord0);--theme-bg-secondary: var(--nord1);--theme-bg-tertiary: var(--nord2);--theme-bg-hover: var(--nord2);--theme-bg-active: var(--nord3);--theme-text-primary: var(--nord6-bright);--theme-text-secondary: var(--nord5);--theme-text-tertiary: var(--nord4);--theme-text-white: var(--nord6-bright);--theme-text-placeholder: var(--nord4-dark);--theme-text-on-accent: var(--nord6-bright);--theme-border-color: var(--nord3);--theme-border-bright: var(--nord8);--theme-accent-primary: var(--nord8);--theme-accent-primary-hover: var(--nord8-bright);--theme-accent-secondary: var(--nord7);--theme-accent-tertiary: var(--nord9);--theme-accent-deep: var(--nord10);--theme-success: var(--nord14);--theme-success-bright: var(--nord14-bright);--theme-error: var(--nord11);--theme-warning: var(--nord13);--theme-info: var(--nord12);--theme-special: var(--nord15);--color-success: var(--theme-success);--color-warning: var(--theme-warning);--color-error: var(--theme-error);--color-error-light: var(--nord11);--color-info: var(--theme-info);--hills-layer-1: #2e3440;--hills-layer-2: #3b4252;--hills-layer-3: #434c5e;--bg-primary: var(--theme-bg-primary);--bg-secondary: var(--theme-bg-secondary);--bg-tertiary: var(--theme-bg-tertiary);--bg-hover: var(--theme-bg-hover);--bg-active: var(--theme-bg-active);--text-primary: var(--theme-text-primary);--text-secondary: var(--theme-text-secondary);--text-tertiary: var(--theme-text-tertiary);--text-white: var(--theme-text-white);--text-placeholder: var(--theme-text-placeholder);--border-color: var(--theme-border-color);--border-bright: var(--theme-border-bright);--blue-500: var(--theme-accent-primary);--blue-600: var(--theme-accent-tertiary);--green-500: var(--theme-success);--green-600: var(--theme-success-bright);--red-500: var(--theme-error);--yellow-500: var(--theme-warning);--purple-500: var(--theme-special);--orange-500: var(--theme-info)}",kY=":root{--ayu-bg-0: #1f2430;--ayu-bg-1: #232834;--ayu-bg-2: #2d3340;--ayu-bg-3: #3e4555;--ayu-bg-4: #505766;--ayu-text-0: #d9d7ce;--ayu-text-1: #cbccc6;--ayu-text-2: #b8b9b5;--ayu-text-3: #95989a;--ayu-text-4: #73767a;--ayu-accent-cyan: #5ccfe6;--ayu-accent-blue: #73d0ff;--ayu-accent-orange: #ffad66;--ayu-accent-yellow: #ffd580;--ayu-accent-green: #bae67e;--ayu-accent-purple: #d4bfff;--ayu-accent-red: #f28779;--theme-bg-primary: var(--ayu-bg-0);--theme-bg-secondary: var(--ayu-bg-1);--theme-bg-tertiary: var(--ayu-bg-2);--theme-bg-hover: var(--ayu-bg-2);--theme-bg-active: var(--ayu-bg-3);--theme-text-primary: var(--ayu-text-0);--theme-text-secondary: var(--ayu-text-1);--theme-text-tertiary: var(--ayu-text-2);--theme-text-white: var(--ayu-text-0);--theme-text-placeholder: var(--ayu-bg-4);--theme-text-on-accent: var(--ayu-text-0);--theme-border-color: var(--ayu-bg-3);--theme-border-bright: var(--ayu-accent-cyan);--theme-accent-primary: var(--ayu-accent-cyan);--theme-accent-primary-hover: #6fd9f0;--theme-accent-secondary: var(--ayu-accent-blue);--theme-accent-tertiary: #80d4ff;--theme-accent-deep: #4db8d4;--theme-success: var(--ayu-accent-green);--theme-success-bright: #c4ea8e;--theme-error: var(--ayu-accent-red);--theme-warning: var(--ayu-accent-yellow);--theme-info: var(--ayu-accent-orange);--theme-special: var(--ayu-accent-purple);--color-success: var(--theme-success);--color-warning: var(--theme-warning);--color-error: var(--theme-error);--color-error-light: var(--ayu-accent-red);--color-info: var(--theme-info);--hills-layer-1: #232834;--hills-layer-2: #2d3340;--hills-layer-3: #3e4555;--bg-primary: var(--theme-bg-primary);--bg-secondary: var(--theme-bg-secondary);--bg-tertiary: var(--theme-bg-tertiary);--bg-hover: var(--theme-bg-hover);--bg-active: var(--theme-bg-active);--text-primary: var(--theme-text-primary);--text-secondary: var(--theme-text-secondary);--text-tertiary: var(--theme-text-tertiary);--text-white: var(--theme-text-white);--text-placeholder: var(--theme-text-placeholder);--border-color: var(--theme-border-color);--border-bright: var(--theme-border-bright);--blue-500: var(--theme-accent-primary);--blue-600: var(--theme-accent-tertiary);--green-500: var(--theme-success);--green-600: var(--theme-success-bright);--red-500: var(--theme-error);--yellow-500: var(--theme-warning);--purple-500: var(--theme-special);--orange-500: var(--theme-info)}",MY=":root{--duo-dark-0: #1e1726;--duo-dark-1: #2c2233;--duo-dark-2: #3a2f47;--duo-dark-3: #4a3f5a;--duo-dark-4: #6c5f7c;--duo-gold-0: #eeebdd;--duo-gold-1: #d4c5a9;--duo-gold-2: #c5ae8a;--duo-gold-3: #b8935f;--duo-gold-4: #9d7a47;--duo-accent: #e09142;--duo-accent-bright: #f5a962;--duo-blue: #7c9dd6;--duo-green: #98c379;--duo-red: #e06c75;--duo-yellow: #e5c07b;--duo-purple: #c678dd;--theme-bg-primary: var(--duo-dark-0);--theme-bg-secondary: var(--duo-dark-1);--theme-bg-tertiary: var(--duo-dark-2);--theme-bg-hover: var(--duo-dark-2);--theme-bg-active: var(--duo-dark-3);--theme-text-primary: var(--duo-gold-0);--theme-text-secondary: var(--duo-gold-1);--theme-text-tertiary: var(--duo-gold-2);--theme-text-white: var(--duo-gold-0);--theme-text-placeholder: var(--duo-dark-4);--theme-text-on-accent: var(--duo-gold-0);--theme-border-color: var(--duo-dark-3);--theme-border-bright: var(--duo-accent);--theme-accent-primary: var(--duo-accent);--theme-accent-primary-hover: var(--duo-accent-bright);--theme-accent-secondary: var(--duo-gold-4);--theme-accent-tertiary: var(--duo-purple);--theme-accent-deep: var(--duo-blue);--theme-success: var(--duo-green);--theme-success-bright: #a8d389;--theme-error: var(--duo-red);--theme-warning: var(--duo-yellow);--theme-info: var(--duo-blue);--theme-special: var(--duo-purple);--color-success: var(--theme-success);--color-warning: var(--theme-warning);--color-error: var(--theme-error);--color-error-light: var(--duo-red);--color-info: var(--theme-info);--hills-layer-1: #2c2233;--hills-layer-2: #3a2f47;--hills-layer-3: #4a3f5a;--bg-primary: var(--theme-bg-primary);--bg-secondary: var(--theme-bg-secondary);--bg-tertiary: var(--theme-bg-tertiary);--bg-hover: var(--theme-bg-hover);--bg-active: var(--theme-bg-active);--text-primary: var(--theme-text-primary);--text-secondary: var(--theme-text-secondary);--text-tertiary: var(--theme-text-tertiary);--text-white: var(--theme-text-white);--text-placeholder: var(--theme-text-placeholder);--border-color: var(--theme-border-color);--border-bright: var(--theme-border-bright);--blue-500: var(--theme-accent-primary);--blue-600: var(--theme-accent-tertiary);--green-500: var(--theme-success);--green-600: var(--theme-success-bright);--red-500: var(--theme-error);--yellow-500: var(--theme-warning);--purple-500: var(--theme-special);--orange-500: var(--theme-info)}",PY=":root{--duo-sea-0: #1a2632;--duo-sea-1: #243342;--duo-sea-2: #2e4052;--duo-sea-3: #3d4f5f;--duo-sea-4: #576772;--duo-cyan-0: #e8f2f5;--duo-cyan-1: #c8dfe6;--duo-cyan-2: #a0c5d1;--duo-cyan-3: #7aafbd;--duo-cyan-4: #5a99a9;--duo-accent: #4fb8d6;--duo-accent-bright: #6fcce5;--duo-blue: #569cd6;--duo-green: #6fbc9d;--duo-red: #e57373;--duo-yellow: #d4c78f;--duo-purple: #9b82d4;--theme-bg-primary: var(--duo-sea-0);--theme-bg-secondary: var(--duo-sea-1);--theme-bg-tertiary: var(--duo-sea-2);--theme-bg-hover: var(--duo-sea-2);--theme-bg-active: var(--duo-sea-3);--theme-text-primary: var(--duo-cyan-0);--theme-text-secondary: var(--duo-cyan-1);--theme-text-tertiary: var(--duo-cyan-2);--theme-text-white: var(--duo-cyan-0);--theme-text-placeholder: var(--duo-sea-4);--theme-text-on-accent: var(--duo-cyan-0);--theme-border-color: var(--duo-sea-3);--theme-border-bright: var(--duo-accent);--theme-accent-primary: var(--duo-accent);--theme-accent-primary-hover: var(--duo-accent-bright);--theme-accent-secondary: var(--duo-cyan-4);--theme-accent-tertiary: var(--duo-blue);--theme-accent-deep: var(--duo-purple);--theme-success: var(--duo-green);--theme-success-bright: #7fccad;--theme-error: var(--duo-red);--theme-warning: var(--duo-yellow);--theme-info: var(--duo-blue);--theme-special: var(--duo-purple);--color-success: var(--theme-success);--color-warning: var(--theme-warning);--color-error: var(--theme-error);--color-error-light: var(--duo-red);--color-info: var(--theme-info);--hills-layer-1: #243342;--hills-layer-2: #2e4052;--hills-layer-3: #3d4f5f;--bg-primary: var(--theme-bg-primary);--bg-secondary: var(--theme-bg-secondary);--bg-tertiary: var(--theme-bg-tertiary);--bg-hover: var(--theme-bg-hover);--bg-active: var(--theme-bg-active);--text-primary: var(--theme-text-primary);--text-secondary: var(--theme-text-secondary);--text-tertiary: var(--theme-text-tertiary);--text-white: var(--theme-text-white);--text-placeholder: var(--theme-text-placeholder);--border-color: var(--theme-border-color);--border-bright: var(--theme-border-bright);--blue-500: var(--theme-accent-primary);--blue-600: var(--theme-accent-tertiary);--green-500: var(--theme-success);--green-600: var(--theme-success-bright);--red-500: var(--theme-error);--yellow-500: var(--theme-warning);--purple-500: var(--theme-special);--orange-500: var(--theme-info)}",DY=":root{--duo-forest-0: #1a2321;--duo-forest-1: #243330;--duo-forest-2: #2f443f;--duo-forest-3: #3d544d;--duo-forest-4: #536a61;--duo-lime-0: #e8f5e9;--duo-lime-1: #c8e6c9;--duo-lime-2: #a5d6a7;--duo-lime-3: #81c784;--duo-lime-4: #66bb6a;--duo-accent: #7cb342;--duo-accent-bright: #9ccc65;--duo-blue: #4dd0e1;--duo-green: #81c784;--duo-red: #e57373;--duo-yellow: #dce775;--duo-purple: #ba68c8;--theme-bg-primary: var(--duo-forest-0);--theme-bg-secondary: var(--duo-forest-1);--theme-bg-tertiary: var(--duo-forest-2);--theme-bg-hover: var(--duo-forest-2);--theme-bg-active: var(--duo-forest-3);--theme-text-primary: var(--duo-lime-0);--theme-text-secondary: var(--duo-lime-1);--theme-text-tertiary: var(--duo-lime-2);--theme-text-white: var(--duo-lime-0);--theme-text-placeholder: var(--duo-forest-4);--theme-text-on-accent: var(--duo-lime-0);--theme-border-color: var(--duo-forest-3);--theme-border-bright: var(--duo-accent);--theme-accent-primary: var(--duo-accent);--theme-accent-primary-hover: var(--duo-accent-bright);--theme-accent-secondary: var(--duo-lime-4);--theme-accent-tertiary: var(--duo-green);--theme-accent-deep: var(--duo-blue);--theme-success: var(--duo-green);--theme-success-bright: #91d794;--theme-error: var(--duo-red);--theme-warning: var(--duo-yellow);--theme-info: var(--duo-blue);--theme-special: var(--duo-purple);--color-success: var(--theme-success);--color-warning: var(--theme-warning);--color-error: var(--theme-error);--color-error-light: var(--duo-red);--color-info: var(--theme-info);--hills-layer-1: #243330;--hills-layer-2: #2f443f;--hills-layer-3: #3d544d;--bg-primary: var(--theme-bg-primary);--bg-secondary: var(--theme-bg-secondary);--bg-tertiary: var(--theme-bg-tertiary);--bg-hover: var(--theme-bg-hover);--bg-active: var(--theme-bg-active);--text-primary: var(--theme-text-primary);--text-secondary: var(--theme-text-secondary);--text-tertiary: var(--theme-text-tertiary);--text-white: var(--theme-text-white);--text-placeholder: var(--theme-text-placeholder);--border-color: var(--theme-border-color);--border-bright: var(--theme-border-bright);--blue-500: var(--theme-accent-primary);--blue-600: var(--theme-accent-tertiary);--green-500: var(--theme-success);--green-600: var(--theme-success-bright);--red-500: var(--theme-error);--yellow-500: var(--theme-warning);--purple-500: var(--theme-special);--orange-500: var(--theme-info)}",jY=":root{--nord-light-0: #ffffff;--nord-light-1: #f9fafb;--nord-light-2: #eceff4;--nord-light-3: #e5e9f0;--nord-light-4: #d8dee9;--nord-dark-0: #2e3440;--nord-dark-1: #3b4252;--nord-dark-2: #434c5e;--nord-dark-3: #4c566a;--nord-frost-0: #8fbcbb;--nord-frost-1: #88c0d0;--nord-frost-2: #81a1c1;--nord-frost-3: #5e81ac;--nord-frost-bright: #6eb3c7;--nord-red: #bf616a;--nord-orange: #d08770;--nord-yellow: #ebcb8b;--nord-green: #a3be8c;--nord-purple: #b48ead;--theme-bg-primary: var(--nord-light-1);--theme-bg-secondary: var(--nord-light-0);--theme-bg-tertiary: var(--nord-light-2);--theme-bg-hover: var(--nord-light-3);--theme-bg-active: var(--nord-light-4);--theme-text-primary: var(--nord-dark-0);--theme-text-secondary: var(--nord-dark-1);--theme-text-tertiary: var(--nord-dark-2);--theme-text-white: var(--nord-light-0);--theme-text-placeholder: #9199a1;--theme-text-on-accent: var(--nord-light-0);--theme-border-color: var(--nord-light-4);--theme-border-bright: var(--nord-frost-1);--theme-accent-primary: var(--nord-frost-3);--theme-accent-primary-hover: var(--nord-frost-2);--theme-accent-secondary: var(--nord-frost-0);--theme-accent-tertiary: var(--nord-frost-1);--theme-accent-deep: var(--nord-frost-3);--theme-success: var(--nord-green);--theme-success-bright: #8fb577;--theme-error: var(--nord-red);--theme-warning: #d4a657;--theme-info: var(--nord-orange);--theme-special: var(--nord-purple);--color-success: var(--theme-success);--color-warning: var(--theme-warning);--color-error: var(--theme-error);--color-error-light: var(--nord-red);--color-info: var(--theme-info);--hills-layer-1: #f5f7fa;--hills-layer-2: #eaeef3;--hills-layer-3: #dfe4eb;--bg-primary: var(--theme-bg-primary);--bg-secondary: var(--theme-bg-secondary);--bg-tertiary: var(--theme-bg-tertiary);--bg-hover: var(--theme-bg-hover);--bg-active: var(--theme-bg-active);--text-primary: var(--theme-text-primary);--text-secondary: var(--theme-text-secondary);--text-tertiary: var(--theme-text-tertiary);--text-white: var(--theme-text-white);--text-placeholder: var(--theme-text-placeholder);--border-color: var(--theme-border-color);--border-bright: var(--theme-border-bright);--blue-500: var(--theme-accent-primary);--blue-600: var(--theme-accent-tertiary);--green-500: var(--theme-success);--green-600: var(--theme-success-bright);--red-500: var(--theme-error);--yellow-500: var(--theme-warning);--purple-500: var(--theme-special);--orange-500: var(--theme-info)}",LY=":root{--ayu-light-0: #ffffff;--ayu-light-1: #fafafa;--ayu-light-2: #f3f4f5;--ayu-light-3: #e7e8e9;--ayu-light-4: #d9dadb;--ayu-dark-0: #5c6166;--ayu-dark-1: #828c99;--ayu-dark-2: #959da8;--ayu-dark-3: #a0a8b5;--ayu-dark-4: #bcc5d1;--ayu-accent-orange: #fa8d3e;--ayu-accent-orange-bright: #ff9940;--ayu-accent-yellow: #f2ae49;--ayu-accent-green: #86b300;--ayu-accent-green-bright: #95c700;--ayu-accent-blue: #399ee6;--ayu-accent-blue-bright: #55b4fc;--ayu-accent-red: #f51818;--ayu-accent-purple: #a37acc;--theme-bg-primary: var(--ayu-light-1);--theme-bg-secondary: var(--ayu-light-0);--theme-bg-tertiary: var(--ayu-light-2);--theme-bg-hover: var(--ayu-light-3);--theme-bg-active: var(--ayu-light-4);--theme-text-primary: var(--ayu-dark-0);--theme-text-secondary: var(--ayu-dark-1);--theme-text-tertiary: var(--ayu-dark-2);--theme-text-white: var(--ayu-light-0);--theme-text-placeholder: #b8bdc4;--theme-text-on-accent: var(--ayu-light-0);--theme-border-color: var(--ayu-light-4);--theme-border-bright: var(--ayu-accent-orange);--theme-accent-primary: var(--ayu-accent-orange);--theme-accent-primary-hover: var(--ayu-accent-orange-bright);--theme-accent-secondary: var(--ayu-accent-blue);--theme-accent-tertiary: var(--ayu-accent-blue-bright);--theme-accent-deep: #2b88d1;--theme-success: var(--ayu-accent-green);--theme-success-bright: var(--ayu-accent-green-bright);--theme-error: var(--ayu-accent-red);--theme-warning: var(--ayu-accent-yellow);--theme-info: var(--ayu-accent-blue);--theme-special: var(--ayu-accent-purple);--color-success: var(--theme-success);--color-warning: var(--theme-warning);--color-error: var(--theme-error);--color-error-light: var(--ayu-accent-red);--color-info: var(--theme-info);--hills-layer-1: #f8f8f8;--hills-layer-2: #efefef;--hills-layer-3: #e5e5e5;--bg-primary: var(--theme-bg-primary);--bg-secondary: var(--theme-bg-secondary);--bg-tertiary: var(--theme-bg-tertiary);--bg-hover: var(--theme-bg-hover);--bg-active: var(--theme-bg-active);--text-primary: var(--theme-text-primary);--text-secondary: var(--theme-text-secondary);--text-tertiary: var(--theme-text-tertiary);--text-white: var(--theme-text-white);--text-placeholder: var(--theme-text-placeholder);--border-color: var(--theme-border-color);--border-bright: var(--theme-border-bright);--blue-500: var(--theme-accent-primary);--blue-600: var(--theme-accent-tertiary);--green-500: var(--theme-success);--green-600: var(--theme-success-bright);--red-500: var(--theme-error);--yellow-500: var(--theme-warning);--purple-500: var(--theme-special);--orange-500: var(--theme-info)}",HY=":root{--duo-cream-0: #ffffff;--duo-cream-1: #faf8f5;--duo-cream-2: #f2ede4;--duo-cream-3: #e6dfd0;--duo-cream-4: #d9d0bd;--duo-cream-5: #c9bda5;--duo-brown-0: #3a312a;--duo-brown-1: #63564c;--duo-brown-2: #7d6e5f;--duo-brown-3: #968777;--duo-brown-4: #a89885;--duo-accent: #d97d28;--duo-accent-bright: #e59142;--duo-blue: #4c8fb5;--duo-green: #76a85d;--duo-red: #d05858;--duo-yellow: #d4a72c;--duo-purple: #a46cb8;--theme-bg-primary: var(--duo-cream-1);--theme-bg-secondary: var(--duo-cream-0);--theme-bg-tertiary: var(--duo-cream-2);--theme-bg-hover: var(--duo-cream-3);--theme-bg-active: var(--duo-cream-4);--theme-text-primary: var(--duo-brown-0);--theme-text-secondary: var(--duo-brown-1);--theme-text-tertiary: var(--duo-brown-2);--theme-text-white: var(--duo-cream-0);--theme-text-placeholder: #afa79a;--theme-text-on-accent: var(--duo-cream-0);--theme-border-color: var(--duo-cream-4);--theme-border-bright: var(--duo-accent);--theme-accent-primary: var(--duo-accent);--theme-accent-primary-hover: var(--duo-accent-bright);--theme-accent-secondary: var(--duo-yellow);--theme-accent-tertiary: var(--duo-purple);--theme-accent-deep: var(--duo-blue);--theme-success: var(--duo-green);--theme-success-bright: #86b86d;--theme-error: var(--duo-red);--theme-warning: var(--duo-yellow);--theme-info: var(--duo-blue);--theme-special: var(--duo-purple);--color-success: var(--theme-success);--color-warning: var(--theme-warning);--color-error: var(--theme-error);--color-error-light: var(--duo-red);--color-info: var(--theme-info);--hills-layer-1: #f7f4ee;--hills-layer-2: #ebe4d8;--hills-layer-3: #dfd5c3;--bg-primary: var(--theme-bg-primary);--bg-secondary: var(--theme-bg-secondary);--bg-tertiary: var(--theme-bg-tertiary);--bg-hover: var(--theme-bg-hover);--bg-active: var(--theme-bg-active);--text-primary: var(--theme-text-primary);--text-secondary: var(--theme-text-secondary);--text-tertiary: var(--theme-text-tertiary);--text-white: var(--theme-text-white);--text-placeholder: var(--theme-text-placeholder);--border-color: var(--theme-border-color);--border-bright: var(--theme-border-bright);--blue-500: var(--theme-accent-primary);--blue-600: var(--theme-accent-tertiary);--green-500: var(--theme-success);--green-600: var(--theme-success-bright);--red-500: var(--theme-error);--yellow-500: var(--theme-warning);--purple-500: var(--theme-special);--orange-500: var(--theme-info)}",BY={"arctic-night":IY,"ayu-mirage":kY,"duotone-dark":MY,"duotone-sea":PY,"duotone-forest":DY,"nordic-snow":jY,"ayu-light":LY,"duotone-light":HY};function O_(e){const t=BY[e];if(!t)return;let n=document.getElementById("theme-style");n||(n=document.createElement("style"),n.id="theme-style",document.head.appendChild(n)),n.textContent=t}function UY(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"arctic-night":"nordic-snow"}const FY=localStorage.getItem("hoot-theme"),zY=FY||UY();O_(zY);const $Y=window.matchMedia("(prefers-color-scheme: dark)");$Y.addEventListener("change",e=>{if(!localStorage.getItem("hoot-theme")){const t=e.matches?"arctic-night":"nordic-snow";O_(t),window.initializeHills&&window.initializeHills()}});typeof window<"u"&&(window.applyTheme=O_,window.initializeHills=MI);MI();Kk.createRoot(document.getElementById("root")).render(_.jsx(Cn.StrictMode,{children:_.jsx(NY,{})}));