botschat 0.1.9 → 0.1.10

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.
@@ -1,1497 +0,0 @@
1
- var WS=Object.defineProperty;var hy=e=>{throw TypeError(e)};var XS=(e,t,r)=>t in e?WS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var cs=(e,t,r)=>XS(e,typeof t!="symbol"?t+"":t,r),py=(e,t,r)=>t.has(e)||hy("Cannot "+r);var Rl=(e,t,r)=>(py(e,t,"read from private field"),r?r.call(e):t.get(e)),my=(e,t,r)=>t.has(e)?hy("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),gy=(e,t,r,a)=>(py(e,t,"write to private field"),a?a.call(e,r):t.set(e,r),r);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).observe(document,{childList:!0,subtree:!0});function r(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a(l){if(l.ep)return;l.ep=!0;const c=r(l);fetch(l.href,c)}})();function co(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Bf={exports:{}},Ml={};/**
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 by;function ZS(){if(by)return Ml;by=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(a,l,c){var u=null;if(c!==void 0&&(u=""+c),l.key!==void 0&&(u=""+l.key),"key"in l){c={};for(var d in l)d!=="key"&&(c[d]=l[d])}else c=l;return l=c.ref,{$$typeof:e,type:a,key:u,ref:l!==void 0?l:null,props:c}}return Ml.Fragment=t,Ml.jsx=r,Ml.jsxs=r,Ml}var yy;function QS(){return yy||(yy=1,Bf.exports=ZS()),Bf.exports}var m=QS(),Uf={exports:{}},ze={};/**
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 vy;function JS(){if(vy)return ze;vy=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),v=Symbol.iterator;function x(O){return O===null||typeof O!="object"?null:(O=v&&O[v]||O["@@iterator"],typeof O=="function"?O:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,C={};function S(O,G,N){this.props=O,this.context=G,this.refs=C,this.updater=N||_}S.prototype.isReactComponent={},S.prototype.setState=function(O,G){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,G,"setState")},S.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function R(){}R.prototype=S.prototype;function M(O,G,N){this.props=O,this.context=G,this.refs=C,this.updater=N||_}var A=M.prototype=new R;A.constructor=M,T(A,S.prototype),A.isPureReactComponent=!0;var P=Array.isArray;function I(){}var W={H:null,A:null,T:null,S:null},te=Object.prototype.hasOwnProperty;function ee(O,G,N){var de=N.ref;return{$$typeof:e,type:O,key:G,ref:de!==void 0?de:null,props:N}}function U(O,G){return ee(O.type,G,O.props)}function F(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function X(O){var G={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(N){return G[N]})}var me=/\/+/g;function le(O,G){return typeof O=="object"&&O!==null&&O.key!=null?X(""+O.key):G.toString(36)}function K(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(I,I):(O.status="pending",O.then(function(G){O.status==="pending"&&(O.status="fulfilled",O.value=G)},function(G){O.status==="pending"&&(O.status="rejected",O.reason=G)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function z(O,G,N,de,fe){var q=typeof O;(q==="undefined"||q==="boolean")&&(O=null);var ce=!1;if(O===null)ce=!0;else switch(q){case"bigint":case"string":case"number":ce=!0;break;case"object":switch(O.$$typeof){case e:case t:ce=!0;break;case b:return ce=O._init,z(ce(O._payload),G,N,de,fe)}}if(ce)return fe=fe(O),ce=de===""?"."+le(O,0):de,P(fe)?(N="",ce!=null&&(N=ce.replace(me,"$&/")+"/"),z(fe,G,N,"",function(Ie){return Ie})):fe!=null&&(F(fe)&&(fe=U(fe,N+(fe.key==null||O&&O.key===fe.key?"":(""+fe.key).replace(me,"$&/")+"/")+ce)),G.push(fe)),1;ce=0;var ge=de===""?".":de+":";if(P(O))for(var xe=0;xe<O.length;xe++)de=O[xe],q=ge+le(de,xe),ce+=z(de,G,N,q,fe);else if(xe=x(O),typeof xe=="function")for(O=xe.call(O),xe=0;!(de=O.next()).done;)de=de.value,q=ge+le(de,xe++),ce+=z(de,G,N,q,fe);else if(q==="object"){if(typeof O.then=="function")return z(K(O),G,N,de,fe);throw G=String(O),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return ce}function Q(O,G,N){if(O==null)return O;var de=[],fe=0;return z(O,de,"","",function(q){return G.call(N,q,fe++)}),de}function ie(O){if(O._status===-1){var G=O._result;G=G(),G.then(function(N){(O._status===0||O._status===-1)&&(O._status=1,O._result=N)},function(N){(O._status===0||O._status===-1)&&(O._status=2,O._result=N)}),O._status===-1&&(O._status=0,O._result=G)}if(O._status===1)return O._result.default;throw O._result}var B=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},w={map:Q,forEach:function(O,G,N){Q(O,function(){G.apply(this,arguments)},N)},count:function(O){var G=0;return Q(O,function(){G++}),G},toArray:function(O){return Q(O,function(G){return G})||[]},only:function(O){if(!F(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return ze.Activity=y,ze.Children=w,ze.Component=S,ze.Fragment=r,ze.Profiler=l,ze.PureComponent=M,ze.StrictMode=a,ze.Suspense=h,ze.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=W,ze.__COMPILER_RUNTIME={__proto__:null,c:function(O){return W.H.useMemoCache(O)}},ze.cache=function(O){return function(){return O.apply(null,arguments)}},ze.cacheSignal=function(){return null},ze.cloneElement=function(O,G,N){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var de=T({},O.props),fe=O.key;if(G!=null)for(q in G.key!==void 0&&(fe=""+G.key),G)!te.call(G,q)||q==="key"||q==="__self"||q==="__source"||q==="ref"&&G.ref===void 0||(de[q]=G[q]);var q=arguments.length-2;if(q===1)de.children=N;else if(1<q){for(var ce=Array(q),ge=0;ge<q;ge++)ce[ge]=arguments[ge+2];de.children=ce}return ee(O.type,fe,de)},ze.createContext=function(O){return O={$$typeof:u,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:c,_context:O},O},ze.createElement=function(O,G,N){var de,fe={},q=null;if(G!=null)for(de in G.key!==void 0&&(q=""+G.key),G)te.call(G,de)&&de!=="key"&&de!=="__self"&&de!=="__source"&&(fe[de]=G[de]);var ce=arguments.length-2;if(ce===1)fe.children=N;else if(1<ce){for(var ge=Array(ce),xe=0;xe<ce;xe++)ge[xe]=arguments[xe+2];fe.children=ge}if(O&&O.defaultProps)for(de in ce=O.defaultProps,ce)fe[de]===void 0&&(fe[de]=ce[de]);return ee(O,q,fe)},ze.createRef=function(){return{current:null}},ze.forwardRef=function(O){return{$$typeof:d,render:O}},ze.isValidElement=F,ze.lazy=function(O){return{$$typeof:b,_payload:{_status:-1,_result:O},_init:ie}},ze.memo=function(O,G){return{$$typeof:p,type:O,compare:G===void 0?null:G}},ze.startTransition=function(O){var G=W.T,N={};W.T=N;try{var de=O(),fe=W.S;fe!==null&&fe(N,de),typeof de=="object"&&de!==null&&typeof de.then=="function"&&de.then(I,B)}catch(q){B(q)}finally{G!==null&&N.types!==null&&(G.types=N.types),W.T=G}},ze.unstable_useCacheRefresh=function(){return W.H.useCacheRefresh()},ze.use=function(O){return W.H.use(O)},ze.useActionState=function(O,G,N){return W.H.useActionState(O,G,N)},ze.useCallback=function(O,G){return W.H.useCallback(O,G)},ze.useContext=function(O){return W.H.useContext(O)},ze.useDebugValue=function(){},ze.useDeferredValue=function(O,G){return W.H.useDeferredValue(O,G)},ze.useEffect=function(O,G){return W.H.useEffect(O,G)},ze.useEffectEvent=function(O){return W.H.useEffectEvent(O)},ze.useId=function(){return W.H.useId()},ze.useImperativeHandle=function(O,G,N){return W.H.useImperativeHandle(O,G,N)},ze.useInsertionEffect=function(O,G){return W.H.useInsertionEffect(O,G)},ze.useLayoutEffect=function(O,G){return W.H.useLayoutEffect(O,G)},ze.useMemo=function(O,G){return W.H.useMemo(O,G)},ze.useOptimistic=function(O,G){return W.H.useOptimistic(O,G)},ze.useReducer=function(O,G,N){return W.H.useReducer(O,G,N)},ze.useRef=function(O){return W.H.useRef(O)},ze.useState=function(O){return W.H.useState(O)},ze.useSyncExternalStore=function(O,G,N){return W.H.useSyncExternalStore(O,G,N)},ze.useTransition=function(){return W.H.useTransition()},ze.version="19.2.4",ze}var xy;function Qh(){return xy||(xy=1,Uf.exports=JS()),Uf.exports}var D=Qh();const qr=co(D);var Pf={exports:{}},Il={},Hf={exports:{}},Ff={};/**
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 Ey;function ew(){return Ey||(Ey=1,(function(e){function t(z,Q){var ie=z.length;z.push(Q);e:for(;0<ie;){var B=ie-1>>>1,w=z[B];if(0<l(w,Q))z[B]=Q,z[ie]=w,ie=B;else break e}}function r(z){return z.length===0?null:z[0]}function a(z){if(z.length===0)return null;var Q=z[0],ie=z.pop();if(ie!==Q){z[0]=ie;e:for(var B=0,w=z.length,O=w>>>1;B<O;){var G=2*(B+1)-1,N=z[G],de=G+1,fe=z[de];if(0>l(N,ie))de<w&&0>l(fe,N)?(z[B]=fe,z[de]=ie,B=de):(z[B]=N,z[G]=ie,B=G);else if(de<w&&0>l(fe,ie))z[B]=fe,z[de]=ie,B=de;else break e}}return Q}function l(z,Q){var ie=z.sortIndex-Q.sortIndex;return ie!==0?ie:z.id-Q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var u=Date,d=u.now();e.unstable_now=function(){return u.now()-d}}var h=[],p=[],b=1,y=null,v=3,x=!1,_=!1,T=!1,C=!1,S=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function A(z){for(var Q=r(p);Q!==null;){if(Q.callback===null)a(p);else if(Q.startTime<=z)a(p),Q.sortIndex=Q.expirationTime,t(h,Q);else break;Q=r(p)}}function P(z){if(T=!1,A(z),!_)if(r(h)!==null)_=!0,I||(I=!0,X());else{var Q=r(p);Q!==null&&K(P,Q.startTime-z)}}var I=!1,W=-1,te=5,ee=-1;function U(){return C?!0:!(e.unstable_now()-ee<te)}function F(){if(C=!1,I){var z=e.unstable_now();ee=z;var Q=!0;try{e:{_=!1,T&&(T=!1,R(W),W=-1),x=!0;var ie=v;try{t:{for(A(z),y=r(h);y!==null&&!(y.expirationTime>z&&U());){var B=y.callback;if(typeof B=="function"){y.callback=null,v=y.priorityLevel;var w=B(y.expirationTime<=z);if(z=e.unstable_now(),typeof w=="function"){y.callback=w,A(z),Q=!0;break t}y===r(h)&&a(h),A(z)}else a(h);y=r(h)}if(y!==null)Q=!0;else{var O=r(p);O!==null&&K(P,O.startTime-z),Q=!1}}break e}finally{y=null,v=ie,x=!1}Q=void 0}}finally{Q?X():I=!1}}}var X;if(typeof M=="function")X=function(){M(F)};else if(typeof MessageChannel<"u"){var me=new MessageChannel,le=me.port2;me.port1.onmessage=F,X=function(){le.postMessage(null)}}else X=function(){S(F,0)};function K(z,Q){W=S(function(){z(e.unstable_now())},Q)}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(z){z.callback=null},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):te=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(z){switch(v){case 1:case 2:case 3:var Q=3;break;default:Q=v}var ie=v;v=Q;try{return z()}finally{v=ie}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(z,Q){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var ie=v;v=z;try{return Q()}finally{v=ie}},e.unstable_scheduleCallback=function(z,Q,ie){var B=e.unstable_now();switch(typeof ie=="object"&&ie!==null?(ie=ie.delay,ie=typeof ie=="number"&&0<ie?B+ie:B):ie=B,z){case 1:var w=-1;break;case 2:w=250;break;case 5:w=1073741823;break;case 4:w=1e4;break;default:w=5e3}return w=ie+w,z={id:b++,callback:Q,priorityLevel:z,startTime:ie,expirationTime:w,sortIndex:-1},ie>B?(z.sortIndex=ie,t(p,z),r(h)===null&&z===r(p)&&(T?(R(W),W=-1):T=!0,K(P,ie-B))):(z.sortIndex=w,t(h,z),_||x||(_=!0,I||(I=!0,X()))),z},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(z){var Q=v;return function(){var ie=v;v=Q;try{return z.apply(this,arguments)}finally{v=ie}}}})(Ff)),Ff}var _y;function tw(){return _y||(_y=1,Hf.exports=ew()),Hf.exports}var $f={exports:{}},tn={};/**
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 Sy;function nw(){if(Sy)return tn;Sy=1;var e=Qh();function t(h){var p="https://react.dev/errors/"+h;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)p+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+h+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var a={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},l=Symbol.for("react.portal");function c(h,p,b){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:y==null?null:""+y,children:h,containerInfo:p,implementation:b}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(h,p){if(h==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return tn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,tn.createPortal=function(h,p){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return c(h,p,null,b)},tn.flushSync=function(h){var p=u.T,b=a.p;try{if(u.T=null,a.p=2,h)return h()}finally{u.T=p,a.p=b,a.d.f()}},tn.preconnect=function(h,p){typeof h=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,a.d.C(h,p))},tn.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},tn.preinit=function(h,p){if(typeof h=="string"&&p&&typeof p.as=="string"){var b=p.as,y=d(b,p.crossOrigin),v=typeof p.integrity=="string"?p.integrity:void 0,x=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;b==="style"?a.d.S(h,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:y,integrity:v,fetchPriority:x}):b==="script"&&a.d.X(h,{crossOrigin:y,integrity:v,fetchPriority:x,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},tn.preinitModule=function(h,p){if(typeof h=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var b=d(p.as,p.crossOrigin);a.d.M(h,{crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&a.d.M(h)},tn.preload=function(h,p){if(typeof h=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var b=p.as,y=d(b,p.crossOrigin);a.d.L(h,b,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},tn.preloadModule=function(h,p){if(typeof h=="string")if(p){var b=d(p.as,p.crossOrigin);a.d.m(h,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else a.d.m(h)},tn.requestFormReset=function(h){a.d.r(h)},tn.unstable_batchedUpdates=function(h,p){return h(p)},tn.useFormState=function(h,p,b){return u.H.useFormState(h,p,b)},tn.useFormStatus=function(){return u.H.useHostTransitionStatus()},tn.version="19.2.4",tn}var wy;function rw(){if(wy)return $f.exports;wy=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(),$f.exports=nw(),$f.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 ky;function iw(){if(ky)return Il;ky=1;var e=tw(),t=Qh(),r=rw();function a(n){var i="https://react.dev/errors/"+n;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)i+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+n+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function c(n){var i=n,s=n;if(n.alternate)for(;i.return;)i=i.return;else{n=i;do i=n,(i.flags&4098)!==0&&(s=i.return),n=i.return;while(n)}return i.tag===3?s:null}function u(n){if(n.tag===13){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function d(n){if(n.tag===31){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function h(n){if(c(n)!==n)throw Error(a(188))}function p(n){var i=n.alternate;if(!i){if(i=c(n),i===null)throw Error(a(188));return i!==n?null:n}for(var s=n,o=i;;){var f=s.return;if(f===null)break;var g=f.alternate;if(g===null){if(o=f.return,o!==null){s=o;continue}break}if(f.child===g.child){for(g=f.child;g;){if(g===s)return h(f),n;if(g===o)return h(f),i;g=g.sibling}throw Error(a(188))}if(s.return!==o.return)s=f,o=g;else{for(var E=!1,k=f.child;k;){if(k===s){E=!0,s=f,o=g;break}if(k===o){E=!0,o=f,s=g;break}k=k.sibling}if(!E){for(k=g.child;k;){if(k===s){E=!0,s=g,o=f;break}if(k===o){E=!0,o=g,s=f;break}k=k.sibling}if(!E)throw Error(a(189))}}if(s.alternate!==o)throw Error(a(190))}if(s.tag!==3)throw Error(a(188));return s.stateNode.current===s?n:i}function b(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n;for(n=n.child;n!==null;){if(i=b(n),i!==null)return i;n=n.sibling}return null}var y=Object.assign,v=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),M=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),U=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function X(n){return n===null||typeof n!="object"?null:(n=F&&n[F]||n["@@iterator"],typeof n=="function"?n:null)}var me=Symbol.for("react.client.reference");function le(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===me?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case T:return"Fragment";case S:return"Profiler";case C:return"StrictMode";case P:return"Suspense";case I:return"SuspenseList";case ee:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case _:return"Portal";case M:return n.displayName||"Context";case R:return(n._context.displayName||"Context")+".Consumer";case A:var i=n.render;return n=n.displayName,n||(n=i.displayName||i.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case W:return i=n.displayName||null,i!==null?i:le(n.type)||"Memo";case te:i=n._payload,n=n._init;try{return le(n(i))}catch{}}return null}var K=Array.isArray,z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie={pending:!1,data:null,method:null,action:null},B=[],w=-1;function O(n){return{current:n}}function G(n){0>w||(n.current=B[w],B[w]=null,w--)}function N(n,i){w++,B[w]=n.current,n.current=i}var de=O(null),fe=O(null),q=O(null),ce=O(null);function ge(n,i){switch(N(q,i),N(fe,n),N(de,null),i.nodeType){case 9:case 11:n=(n=i.documentElement)&&(n=n.namespaceURI)?zb(n):0;break;default:if(n=i.tagName,i=i.namespaceURI)i=zb(i),n=jb(i,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}G(de),N(de,n)}function xe(){G(de),G(fe),G(q)}function Ie(n){n.memoizedState!==null&&N(ce,n);var i=de.current,s=jb(i,n.type);i!==s&&(N(fe,n),N(de,s))}function St(n){fe.current===n&&(G(de),G(fe)),ce.current===n&&(G(ce),Nl._currentValue=ie)}var Ct,ri;function Tn(n){if(Ct===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);Ct=i&&i[1]||"",ri=-1<s.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+Ct+n+ri}var or=!1;function We(n,i){if(!n||or)return"";or=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(i){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(J){var Z=J}Reflect.construct(n,[],oe)}else{try{oe.call()}catch(J){Z=J}n.call(oe.prototype)}}else{try{throw Error()}catch(J){Z=J}(oe=n())&&typeof oe.catch=="function"&&oe.catch(function(){})}}catch(J){if(J&&Z&&typeof J.stack=="string")return[J.stack,Z.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=o.DetermineComponentFrameRoot(),E=g[0],k=g[1];if(E&&k){var L=E.split(`
44
- `),Y=k.split(`
45
- `);for(f=o=0;o<L.length&&!L[o].includes("DetermineComponentFrameRoot");)o++;for(;f<Y.length&&!Y[f].includes("DetermineComponentFrameRoot");)f++;if(o===L.length||f===Y.length)for(o=L.length-1,f=Y.length-1;1<=o&&0<=f&&L[o]!==Y[f];)f--;for(;1<=o&&0<=f;o--,f--)if(L[o]!==Y[f]){if(o!==1||f!==1)do if(o--,f--,0>f||L[o]!==Y[f]){var re=`
46
- `+L[o].replace(" at new "," at ");return n.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",n.displayName)),re}while(1<=o&&0<=f);break}}}finally{or=!1,Error.prepareStackTrace=s}return(s=n?n.displayName||n.name:"")?Tn(s):""}function Qn(n,i){switch(n.tag){case 26:case 27:case 5:return Tn(n.type);case 16:return Tn("Lazy");case 13:return n.child!==i&&i!==null?Tn("Suspense Fallback"):Tn("Suspense");case 19:return Tn("SuspenseList");case 0:case 15:return We(n.type,!1);case 11:return We(n.type.render,!1);case 1:return We(n.type,!0);case 31:return Tn("Activity");default:return""}}function Un(n){try{var i="",s=null;do i+=Qn(n,s),s=n,n=n.return;while(n);return i}catch(o){return`
47
- Error generating stack: `+o.message+`
48
- `+o.stack}}var cr=Object.prototype.hasOwnProperty,kr=e.unstable_scheduleCallback,$i=e.unstable_cancelCallback,js=e.unstable_shouldYield,wa=e.unstable_requestPaint,Tt=e.unstable_now,ka=e.unstable_getCurrentPriorityLevel,ne=e.unstable_ImmediatePriority,be=e.unstable_UserBlockingPriority,Ae=e.unstable_NormalPriority,He=e.unstable_LowPriority,Qe=e.unstable_IdlePriority,an=e.log,Jn=e.unstable_setDisableYieldValue,qt=null,At=null;function Qt(n){if(typeof an=="function"&&Jn(n),At&&typeof At.setStrictMode=="function")try{At.setStrictMode(qt,n)}catch{}}var rt=Math.clz32?Math.clz32:_o,ur=Math.log,sn=Math.LN2;function _o(n){return n>>>=0,n===0?32:31-(ur(n)/sn|0)|0}var Gi=256,Ta=262144,Ki=4194304;function mn(n){var i=n&42;if(i!==0)return i;switch(n&-n){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 n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function j(n,i,s){var o=n.pendingLanes;if(o===0)return 0;var f=0,g=n.suspendedLanes,E=n.pingedLanes;n=n.warmLanes;var k=o&134217727;return k!==0?(o=k&~g,o!==0?f=mn(o):(E&=k,E!==0?f=mn(E):s||(s=k&~n,s!==0&&(f=mn(s))))):(k=o&~g,k!==0?f=mn(k):E!==0?f=mn(E):s||(s=o&~n,s!==0&&(f=mn(s)))),f===0?0:i!==0&&i!==f&&(i&g)===0&&(g=f&-f,s=i&-i,g>=s||g===32&&(s&4194048)!==0)?i:f}function ae(n,i){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&i)===0}function ve(n,i){switch(n){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 De(){var n=Ki;return Ki<<=1,(Ki&62914560)===0&&(Ki=4194304),n}function xt(n){for(var i=[],s=0;31>s;s++)i.push(n);return i}function ht(n,i){n.pendingLanes|=i,i!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function Se(n,i,s,o,f,g){var E=n.pendingLanes;n.pendingLanes=s,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=s,n.entangledLanes&=s,n.errorRecoveryDisabledLanes&=s,n.shellSuspendCounter=0;var k=n.entanglements,L=n.expirationTimes,Y=n.hiddenUpdates;for(s=E&~s;0<s;){var re=31-rt(s),oe=1<<re;k[re]=0,L[re]=-1;var Z=Y[re];if(Z!==null)for(Y[re]=null,re=0;re<Z.length;re++){var J=Z[re];J!==null&&(J.lane&=-536870913)}s&=~oe}o!==0&&Ee(n,o,0),g!==0&&f===0&&n.tag!==0&&(n.suspendedLanes|=g&~(E&~i))}function Ee(n,i,s){n.pendingLanes|=i,n.suspendedLanes&=~i;var o=31-rt(i);n.entangledLanes|=i,n.entanglements[o]=n.entanglements[o]|1073741824|s&261930}function Me(n,i){var s=n.entangledLanes|=i;for(n=n.entanglements;s;){var o=31-rt(s),f=1<<o;f&i|n[o]&i&&(n[o]|=i),s&=~f}}function Mt(n,i){var s=i&-i;return s=(s&42)!==0?1:wt(s),(s&(n.suspendedLanes|i))!==0?0:s}function wt(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=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:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function Tr(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function Na(){var n=Q.p;return n!==0?n:(n=window.event,n===void 0?32:sy(n.type))}function Ca(n,i){var s=Q.p;try{return Q.p=n,i()}finally{Q.p=s}}var dr=Math.random().toString(36).slice(2),It="__reactFiber$"+dr,Jt="__reactProps$"+dr,ii="__reactContainer$"+dr,Bs="__reactEvents$"+dr,So="__reactListeners$"+dr,Aa="__reactHandles$"+dr,wo="__reactResources$"+dr,qi="__reactMarker$"+dr;function Us(n){delete n[It],delete n[Jt],delete n[Bs],delete n[So],delete n[Aa]}function ln(n){var i=n[It];if(i)return i;for(var s=n.parentNode;s;){if(i=s[ii]||s[It]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(n=Gb(n);n!==null;){if(s=n[It])return s;n=Gb(n)}return i}n=s,s=n.parentNode}return null}function Nr(n){if(n=n[It]||n[ii]){var i=n.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return n}return null}function ai(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n.stateNode;throw Error(a(33))}function si(n){var i=n[wo];return i||(i=n[wo]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function jt(n){n[qi]=!0}var ko=new Set,Vi={};function Cr(n,i){he(n,i),he(n+"Capture",i)}function he(n,i){for(Vi[n]=i,n=0;n<i.length;n++)ko.add(i[n])}var Te=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]*$"),Fe={},it={};function Dt(n){return cr.call(it,n)?!0:cr.call(Fe,n)?!1:Te.test(n)?it[n]=!0:(Fe[n]=!0,!1)}function en(n,i,s){if(Dt(i))if(s===null)n.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":n.removeAttribute(i);return;case"boolean":var o=i.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){n.removeAttribute(i);return}}n.setAttribute(i,""+s)}}function Nn(n,i,s){if(s===null)n.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(i);return}n.setAttribute(i,""+s)}}function gn(n,i,s,o){if(o===null)n.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(s);return}n.setAttributeNS(i,s,""+o)}}function bt(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Cn(n){var i=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function To(n,i,s){var o=Object.getOwnPropertyDescriptor(n.constructor.prototype,i);if(!n.hasOwnProperty(i)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var f=o.get,g=o.set;return Object.defineProperty(n,i,{configurable:!0,get:function(){return f.call(this)},set:function(E){s=""+E,g.call(this,E)}}),Object.defineProperty(n,i,{enumerable:o.enumerable}),{getValue:function(){return s},setValue:function(E){s=""+E},stopTracking:function(){n._valueTracker=null,delete n[i]}}}}function Oa(n){if(!n._valueTracker){var i=Cn(n)?"checked":"value";n._valueTracker=To(n,i,""+n[i])}}function Ps(n){if(!n)return!1;var i=n._valueTracker;if(!i)return!0;var s=i.getValue(),o="";return n&&(o=Cn(n)?n.checked?"true":"false":n.value),n=o,n!==s?(i.setValue(n),!0):!1}function Ra(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var zu=/[\n"\\]/g;function bn(n){return n.replace(zu,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Hs(n,i,s,o,f,g,E,k){n.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?n.type=E:n.removeAttribute("type"),i!=null?E==="number"?(i===0&&n.value===""||n.value!=i)&&(n.value=""+bt(i)):n.value!==""+bt(i)&&(n.value=""+bt(i)):E!=="submit"&&E!=="reset"||n.removeAttribute("value"),i!=null?Ma(n,E,bt(i)):s!=null?Ma(n,E,bt(s)):o!=null&&n.removeAttribute("value"),f==null&&g!=null&&(n.defaultChecked=!!g),f!=null&&(n.checked=f&&typeof f!="function"&&typeof f!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?n.name=""+bt(k):n.removeAttribute("name")}function Yi(n,i,s,o,f,g,E,k){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(n.type=g),i!=null||s!=null){if(!(g!=="submit"&&g!=="reset"||i!=null)){Oa(n);return}s=s!=null?""+bt(s):"",i=i!=null?""+bt(i):s,k||i===n.value||(n.value=i),n.defaultValue=i}o=o??f,o=typeof o!="function"&&typeof o!="symbol"&&!!o,n.checked=k?n.checked:!!o,n.defaultChecked=!!o,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(n.name=E),Oa(n)}function Ma(n,i,s){i==="number"&&Ra(n.ownerDocument)===n||n.defaultValue===""+s||(n.defaultValue=""+s)}function Vt(n,i,s,o){if(n=n.options,i){i={};for(var f=0;f<s.length;f++)i["$"+s[f]]=!0;for(s=0;s<n.length;s++)f=i.hasOwnProperty("$"+n[s].value),n[s].selected!==f&&(n[s].selected=f),f&&o&&(n[s].defaultSelected=!0)}else{for(s=""+bt(s),i=null,f=0;f<n.length;f++){if(n[f].value===s){n[f].selected=!0,o&&(n[f].defaultSelected=!0);return}i!==null||n[f].disabled||(i=n[f])}i!==null&&(i.selected=!0)}}function No(n,i,s){if(i!=null&&(i=""+bt(i),i!==n.value&&(n.value=i),s==null)){n.defaultValue!==i&&(n.defaultValue=i);return}n.defaultValue=s!=null?""+bt(s):""}function Ia(n,i,s,o){if(i==null){if(o!=null){if(s!=null)throw Error(a(92));if(K(o)){if(1<o.length)throw Error(a(93));o=o[0]}s=o}s==null&&(s=""),i=s}s=bt(i),n.defaultValue=s,o=n.textContent,o===s&&o!==""&&o!==null&&(n.value=o),Oa(n)}function Re(n,i){if(i){var s=n.firstChild;if(s&&s===n.lastChild&&s.nodeType===3){s.nodeValue=i;return}}n.textContent=i}var Co=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 Bt(n,i,s){var o=i.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?o?n.setProperty(i,""):i==="float"?n.cssFloat="":n[i]="":o?n.setProperty(i,s):typeof s!="number"||s===0||Co.has(i)?i==="float"?n.cssFloat=s:n[i]=(""+s).trim():n[i]=s+"px"}function at(n,i,s){if(i!=null&&typeof i!="object")throw Error(a(62));if(n=n.style,s!=null){for(var o in s)!s.hasOwnProperty(o)||i!=null&&i.hasOwnProperty(o)||(o.indexOf("--")===0?n.setProperty(o,""):o==="float"?n.cssFloat="":n[o]="");for(var f in i)o=i[f],i.hasOwnProperty(f)&&s[f]!==o&&Bt(n,f,o)}else for(var g in i)i.hasOwnProperty(g)&&Bt(n,g,i[g])}function li(n){if(n.indexOf("-")===-1)return!1;switch(n){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 Ar=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"]]),Fs=/^[\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 oi(n){return Fs.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function ye(){}var we=null;function je(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var qe=null,Nt=null;function Pn(n){var i=Nr(n);if(i&&(n=i.stateNode)){var s=n[Jt]||null;e:switch(n=i.stateNode,i.type){case"input":if(Hs(n,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),i=s.name,s.type==="radio"&&i!=null){for(s=n;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+bn(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var o=s[i];if(o!==n&&o.form===n.form){var f=o[Jt]||null;if(!f)throw Error(a(90));Hs(o,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(i=0;i<s.length;i++)o=s[i],o.form===n.form&&Ps(o)}break e;case"textarea":No(n,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&Vt(n,!!s.multiple,i,!1)}}}var $s=!1;function Ao(n,i,s){if($s)return n(i,s);$s=!0;try{var o=n(i);return o}finally{if($s=!1,(qe!==null||Nt!==null)&&(gc(),qe&&(i=qe,n=Nt,Nt=qe=null,Pn(i),n)))for(i=0;i<n.length;i++)Pn(n[i])}}function Gs(n,i){var s=n.stateNode;if(s===null)return null;var o=s[Jt]||null;if(o===null)return null;s=o[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(n=n.type,o=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!o;break e;default:n=!1}if(n)return null;if(s&&typeof s!="function")throw Error(a(231,i,typeof s));return s}var Or=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ju=!1;if(Or)try{var Ks={};Object.defineProperty(Ks,"passive",{get:function(){ju=!0}}),window.addEventListener("test",Ks,Ks),window.removeEventListener("test",Ks,Ks)}catch{ju=!1}var ci=null,Bu=null,Oo=null;function jp(){if(Oo)return Oo;var n,i=Bu,s=i.length,o,f="value"in ci?ci.value:ci.textContent,g=f.length;for(n=0;n<s&&i[n]===f[n];n++);var E=s-n;for(o=1;o<=E&&i[s-o]===f[g-o];o++);return Oo=f.slice(n,1<o?1-o:void 0)}function Ro(n){var i=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&i===13&&(n=13)):n=i,n===10&&(n=13),32<=n||n===13?n:0}function Mo(){return!0}function Bp(){return!1}function yn(n){function i(s,o,f,g,E){this._reactName=s,this._targetInst=f,this.type=o,this.nativeEvent=g,this.target=E,this.currentTarget=null;for(var k in n)n.hasOwnProperty(k)&&(s=n[k],this[k]=s?s(g):g[k]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?Mo:Bp,this.isPropagationStopped=Bp,this}return y(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Mo)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Mo)},persist:function(){},isPersistent:Mo}),i}var Wi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Io=yn(Wi),qs=y({},Wi,{view:0,detail:0}),VE=yn(qs),Uu,Pu,Vs,Do=y({},qs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fu,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Vs&&(Vs&&n.type==="mousemove"?(Uu=n.screenX-Vs.screenX,Pu=n.screenY-Vs.screenY):Pu=Uu=0,Vs=n),Uu)},movementY:function(n){return"movementY"in n?n.movementY:Pu}}),Up=yn(Do),YE=y({},Do,{dataTransfer:0}),WE=yn(YE),XE=y({},qs,{relatedTarget:0}),Hu=yn(XE),ZE=y({},Wi,{animationName:0,elapsedTime:0,pseudoElement:0}),QE=yn(ZE),JE=y({},Wi,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),e_=yn(JE),t_=y({},Wi,{data:0}),Pp=yn(t_),n_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},r_={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"},i_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function a_(n){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(n):(n=i_[n])?!!i[n]:!1}function Fu(){return a_}var s_=y({},qs,{key:function(n){if(n.key){var i=n_[n.key]||n.key;if(i!=="Unidentified")return i}return n.type==="keypress"?(n=Ro(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?r_[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fu,charCode:function(n){return n.type==="keypress"?Ro(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Ro(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),l_=yn(s_),o_=y({},Do,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Hp=yn(o_),c_=y({},qs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fu}),u_=yn(c_),d_=y({},Wi,{propertyName:0,elapsedTime:0,pseudoElement:0}),f_=yn(d_),h_=y({},Do,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),p_=yn(h_),m_=y({},Wi,{newState:0,oldState:0}),g_=yn(m_),b_=[9,13,27,32],$u=Or&&"CompositionEvent"in window,Ys=null;Or&&"documentMode"in document&&(Ys=document.documentMode);var y_=Or&&"TextEvent"in window&&!Ys,Fp=Or&&(!$u||Ys&&8<Ys&&11>=Ys),$p=" ",Gp=!1;function Kp(n,i){switch(n){case"keyup":return b_.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qp(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Da=!1;function v_(n,i){switch(n){case"compositionend":return qp(i);case"keypress":return i.which!==32?null:(Gp=!0,$p);case"textInput":return n=i.data,n===$p&&Gp?null:n;default:return null}}function x_(n,i){if(Da)return n==="compositionend"||!$u&&Kp(n,i)?(n=jp(),Oo=Bu=ci=null,Da=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Fp&&i.locale!=="ko"?null:i.data;default:return null}}var E_={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 Vp(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i==="input"?!!E_[n.type]:i==="textarea"}function Yp(n,i,s,o){qe?Nt?Nt.push(o):Nt=[o]:qe=o,i=Sc(i,"onChange"),0<i.length&&(s=new Io("onChange","change",null,s,o),n.push({event:s,listeners:i}))}var Ws=null,Xs=null;function __(n){Ob(n,0)}function Lo(n){var i=ai(n);if(Ps(i))return n}function Wp(n,i){if(n==="change")return i}var Xp=!1;if(Or){var Gu;if(Or){var Ku="oninput"in document;if(!Ku){var Zp=document.createElement("div");Zp.setAttribute("oninput","return;"),Ku=typeof Zp.oninput=="function"}Gu=Ku}else Gu=!1;Xp=Gu&&(!document.documentMode||9<document.documentMode)}function Qp(){Ws&&(Ws.detachEvent("onpropertychange",Jp),Xs=Ws=null)}function Jp(n){if(n.propertyName==="value"&&Lo(Xs)){var i=[];Yp(i,Xs,n,je(n)),Ao(__,i)}}function S_(n,i,s){n==="focusin"?(Qp(),Ws=i,Xs=s,Ws.attachEvent("onpropertychange",Jp)):n==="focusout"&&Qp()}function w_(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Lo(Xs)}function k_(n,i){if(n==="click")return Lo(i)}function T_(n,i){if(n==="input"||n==="change")return Lo(i)}function N_(n,i){return n===i&&(n!==0||1/n===1/i)||n!==n&&i!==i}var An=typeof Object.is=="function"?Object.is:N_;function Zs(n,i){if(An(n,i))return!0;if(typeof n!="object"||n===null||typeof i!="object"||i===null)return!1;var s=Object.keys(n),o=Object.keys(i);if(s.length!==o.length)return!1;for(o=0;o<s.length;o++){var f=s[o];if(!cr.call(i,f)||!An(n[f],i[f]))return!1}return!0}function em(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function tm(n,i){var s=em(n);n=0;for(var o;s;){if(s.nodeType===3){if(o=n+s.textContent.length,n<=i&&o>=i)return{node:s,offset:i-n};n=o}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=em(s)}}function nm(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?nm(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function rm(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var i=Ra(n.document);i instanceof n.HTMLIFrameElement;){try{var s=typeof i.contentWindow.location.href=="string"}catch{s=!1}if(s)n=i.contentWindow;else break;i=Ra(n.document)}return i}function qu(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i&&(i==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||i==="textarea"||n.contentEditable==="true")}var C_=Or&&"documentMode"in document&&11>=document.documentMode,La=null,Vu=null,Qs=null,Yu=!1;function im(n,i,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Yu||La==null||La!==Ra(o)||(o=La,"selectionStart"in o&&qu(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Qs&&Zs(Qs,o)||(Qs=o,o=Sc(Vu,"onSelect"),0<o.length&&(i=new Io("onSelect","select",null,i,s),n.push({event:i,listeners:o}),i.target=La)))}function Xi(n,i){var s={};return s[n.toLowerCase()]=i.toLowerCase(),s["Webkit"+n]="webkit"+i,s["Moz"+n]="moz"+i,s}var za={animationend:Xi("Animation","AnimationEnd"),animationiteration:Xi("Animation","AnimationIteration"),animationstart:Xi("Animation","AnimationStart"),transitionrun:Xi("Transition","TransitionRun"),transitionstart:Xi("Transition","TransitionStart"),transitioncancel:Xi("Transition","TransitionCancel"),transitionend:Xi("Transition","TransitionEnd")},Wu={},am={};Or&&(am=document.createElement("div").style,"AnimationEvent"in window||(delete za.animationend.animation,delete za.animationiteration.animation,delete za.animationstart.animation),"TransitionEvent"in window||delete za.transitionend.transition);function Zi(n){if(Wu[n])return Wu[n];if(!za[n])return n;var i=za[n],s;for(s in i)if(i.hasOwnProperty(s)&&s in am)return Wu[n]=i[s];return n}var sm=Zi("animationend"),lm=Zi("animationiteration"),om=Zi("animationstart"),A_=Zi("transitionrun"),O_=Zi("transitionstart"),R_=Zi("transitioncancel"),cm=Zi("transitionend"),um=new Map,Xu="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(" ");Xu.push("scrollEnd");function er(n,i){um.set(n,i),Cr(i,[n])}var zo=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Hn=[],ja=0,Zu=0;function jo(){for(var n=ja,i=Zu=ja=0;i<n;){var s=Hn[i];Hn[i++]=null;var o=Hn[i];Hn[i++]=null;var f=Hn[i];Hn[i++]=null;var g=Hn[i];if(Hn[i++]=null,o!==null&&f!==null){var E=o.pending;E===null?f.next=f:(f.next=E.next,E.next=f),o.pending=f}g!==0&&dm(s,f,g)}}function Bo(n,i,s,o){Hn[ja++]=n,Hn[ja++]=i,Hn[ja++]=s,Hn[ja++]=o,Zu|=o,n.lanes|=o,n=n.alternate,n!==null&&(n.lanes|=o)}function Qu(n,i,s,o){return Bo(n,i,s,o),Uo(n)}function Qi(n,i){return Bo(n,null,null,i),Uo(n)}function dm(n,i,s){n.lanes|=s;var o=n.alternate;o!==null&&(o.lanes|=s);for(var f=!1,g=n.return;g!==null;)g.childLanes|=s,o=g.alternate,o!==null&&(o.childLanes|=s),g.tag===22&&(n=g.stateNode,n===null||n._visibility&1||(f=!0)),n=g,g=g.return;return n.tag===3?(g=n.stateNode,f&&i!==null&&(f=31-rt(s),n=g.hiddenUpdates,o=n[f],o===null?n[f]=[i]:o.push(i),i.lane=s|536870912),g):null}function Uo(n){if(50<xl)throw xl=0,of=null,Error(a(185));for(var i=n.return;i!==null;)n=i,i=n.return;return n.tag===3?n.stateNode:null}var Ba={};function M_(n,i,s,o){this.tag=n,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function On(n,i,s,o){return new M_(n,i,s,o)}function Ju(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Rr(n,i){var s=n.alternate;return s===null?(s=On(n.tag,i,n.key,n.mode),s.elementType=n.elementType,s.type=n.type,s.stateNode=n.stateNode,s.alternate=n,n.alternate=s):(s.pendingProps=i,s.type=n.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=n.flags&65011712,s.childLanes=n.childLanes,s.lanes=n.lanes,s.child=n.child,s.memoizedProps=n.memoizedProps,s.memoizedState=n.memoizedState,s.updateQueue=n.updateQueue,i=n.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},s.sibling=n.sibling,s.index=n.index,s.ref=n.ref,s.refCleanup=n.refCleanup,s}function fm(n,i){n.flags&=65011714;var s=n.alternate;return s===null?(n.childLanes=0,n.lanes=i,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=s.childLanes,n.lanes=s.lanes,n.child=s.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=s.memoizedProps,n.memoizedState=s.memoizedState,n.updateQueue=s.updateQueue,n.type=s.type,i=s.dependencies,n.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),n}function Po(n,i,s,o,f,g){var E=0;if(o=n,typeof n=="function")Ju(n)&&(E=1);else if(typeof n=="string")E=jS(n,s,de.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case ee:return n=On(31,s,i,f),n.elementType=ee,n.lanes=g,n;case T:return Ji(s.children,f,g,i);case C:E=8,f|=24;break;case S:return n=On(12,s,i,f|2),n.elementType=S,n.lanes=g,n;case P:return n=On(13,s,i,f),n.elementType=P,n.lanes=g,n;case I:return n=On(19,s,i,f),n.elementType=I,n.lanes=g,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case M:E=10;break e;case R:E=9;break e;case A:E=11;break e;case W:E=14;break e;case te:E=16,o=null;break e}E=29,s=Error(a(130,n===null?"null":typeof n,"")),o=null}return i=On(E,s,i,f),i.elementType=n,i.type=o,i.lanes=g,i}function Ji(n,i,s,o){return n=On(7,n,o,i),n.lanes=s,n}function ed(n,i,s){return n=On(6,n,null,i),n.lanes=s,n}function hm(n){var i=On(18,null,null,0);return i.stateNode=n,i}function td(n,i,s){return i=On(4,n.children!==null?n.children:[],n.key,i),i.lanes=s,i.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},i}var pm=new WeakMap;function Fn(n,i){if(typeof n=="object"&&n!==null){var s=pm.get(n);return s!==void 0?s:(i={value:n,source:i,stack:Un(i)},pm.set(n,i),i)}return{value:n,source:i,stack:Un(i)}}var Ua=[],Pa=0,Ho=null,Js=0,$n=[],Gn=0,ui=null,fr=1,hr="";function Mr(n,i){Ua[Pa++]=Js,Ua[Pa++]=Ho,Ho=n,Js=i}function mm(n,i,s){$n[Gn++]=fr,$n[Gn++]=hr,$n[Gn++]=ui,ui=n;var o=fr;n=hr;var f=32-rt(o)-1;o&=~(1<<f),s+=1;var g=32-rt(i)+f;if(30<g){var E=f-f%5;g=(o&(1<<E)-1).toString(32),o>>=E,f-=E,fr=1<<32-rt(i)+f|s<<f|o,hr=g+n}else fr=1<<g|s<<f|o,hr=n}function nd(n){n.return!==null&&(Mr(n,1),mm(n,1,0))}function rd(n){for(;n===Ho;)Ho=Ua[--Pa],Ua[Pa]=null,Js=Ua[--Pa],Ua[Pa]=null;for(;n===ui;)ui=$n[--Gn],$n[Gn]=null,hr=$n[--Gn],$n[Gn]=null,fr=$n[--Gn],$n[Gn]=null}function gm(n,i){$n[Gn++]=fr,$n[Gn++]=hr,$n[Gn++]=ui,fr=i.id,hr=i.overflow,ui=n}var Yt=null,Et=null,Xe=!1,di=null,Kn=!1,id=Error(a(519));function fi(n){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw el(Fn(i,n)),id}function bm(n){var i=n.stateNode,s=n.type,o=n.memoizedProps;switch(i[It]=n,i[Jt]=o,s){case"dialog":Ge("cancel",i),Ge("close",i);break;case"iframe":case"object":case"embed":Ge("load",i);break;case"video":case"audio":for(s=0;s<_l.length;s++)Ge(_l[s],i);break;case"source":Ge("error",i);break;case"img":case"image":case"link":Ge("error",i),Ge("load",i);break;case"details":Ge("toggle",i);break;case"input":Ge("invalid",i),Yi(i,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Ge("invalid",i);break;case"textarea":Ge("invalid",i),Ia(i,o.value,o.defaultValue,o.children)}s=o.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||i.textContent===""+s||o.suppressHydrationWarning===!0||Db(i.textContent,s)?(o.popover!=null&&(Ge("beforetoggle",i),Ge("toggle",i)),o.onScroll!=null&&Ge("scroll",i),o.onScrollEnd!=null&&Ge("scrollend",i),o.onClick!=null&&(i.onclick=ye),i=!0):i=!1,i||fi(n,!0)}function ym(n){for(Yt=n.return;Yt;)switch(Yt.tag){case 5:case 31:case 13:Kn=!1;return;case 27:case 3:Kn=!0;return;default:Yt=Yt.return}}function Ha(n){if(n!==Yt)return!1;if(!Xe)return ym(n),Xe=!0,!1;var i=n.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=n.type,s=!(s!=="form"&&s!=="button")||Sf(n.type,n.memoizedProps)),s=!s),s&&Et&&fi(n),ym(n),i===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));Et=$b(n)}else if(i===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));Et=$b(n)}else i===27?(i=Et,Ti(n.type)?(n=Cf,Cf=null,Et=n):Et=i):Et=Yt?Vn(n.stateNode.nextSibling):null;return!0}function ea(){Et=Yt=null,Xe=!1}function ad(){var n=di;return n!==null&&(_n===null?_n=n:_n.push.apply(_n,n),di=null),n}function el(n){di===null?di=[n]:di.push(n)}var sd=O(null),ta=null,Ir=null;function hi(n,i,s){N(sd,i._currentValue),i._currentValue=s}function Dr(n){n._currentValue=sd.current,G(sd)}function ld(n,i,s){for(;n!==null;){var o=n.alternate;if((n.childLanes&i)!==i?(n.childLanes|=i,o!==null&&(o.childLanes|=i)):o!==null&&(o.childLanes&i)!==i&&(o.childLanes|=i),n===s)break;n=n.return}}function od(n,i,s,o){var f=n.child;for(f!==null&&(f.return=n);f!==null;){var g=f.dependencies;if(g!==null){var E=f.child;g=g.firstContext;e:for(;g!==null;){var k=g;g=f;for(var L=0;L<i.length;L++)if(k.context===i[L]){g.lanes|=s,k=g.alternate,k!==null&&(k.lanes|=s),ld(g.return,s,n),o||(E=null);break e}g=k.next}}else if(f.tag===18){if(E=f.return,E===null)throw Error(a(341));E.lanes|=s,g=E.alternate,g!==null&&(g.lanes|=s),ld(E,s,n),E=null}else E=f.child;if(E!==null)E.return=f;else for(E=f;E!==null;){if(E===n){E=null;break}if(f=E.sibling,f!==null){f.return=E.return,E=f;break}E=E.return}f=E}}function Fa(n,i,s,o){n=null;for(var f=i,g=!1;f!==null;){if(!g){if((f.flags&524288)!==0)g=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var E=f.alternate;if(E===null)throw Error(a(387));if(E=E.memoizedProps,E!==null){var k=f.type;An(f.pendingProps.value,E.value)||(n!==null?n.push(k):n=[k])}}else if(f===ce.current){if(E=f.alternate,E===null)throw Error(a(387));E.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(n!==null?n.push(Nl):n=[Nl])}f=f.return}n!==null&&od(i,n,s,o),i.flags|=262144}function Fo(n){for(n=n.firstContext;n!==null;){if(!An(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function na(n){ta=n,Ir=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Wt(n){return vm(ta,n)}function $o(n,i){return ta===null&&na(n),vm(n,i)}function vm(n,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},Ir===null){if(n===null)throw Error(a(308));Ir=i,n.dependencies={lanes:0,firstContext:i},n.flags|=524288}else Ir=Ir.next=i;return s}var I_=typeof AbortController<"u"?AbortController:function(){var n=[],i=this.signal={aborted:!1,addEventListener:function(s,o){n.push(o)}};this.abort=function(){i.aborted=!0,n.forEach(function(s){return s()})}},D_=e.unstable_scheduleCallback,L_=e.unstable_NormalPriority,Ut={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function cd(){return{controller:new I_,data:new Map,refCount:0}}function tl(n){n.refCount--,n.refCount===0&&D_(L_,function(){n.controller.abort()})}var nl=null,ud=0,$a=0,Ga=null;function z_(n,i){if(nl===null){var s=nl=[];ud=0,$a=pf(),Ga={status:"pending",value:void 0,then:function(o){s.push(o)}}}return ud++,i.then(xm,xm),i}function xm(){if(--ud===0&&nl!==null){Ga!==null&&(Ga.status="fulfilled");var n=nl;nl=null,$a=0,Ga=null;for(var i=0;i<n.length;i++)(0,n[i])()}}function j_(n,i){var s=[],o={status:"pending",value:null,reason:null,then:function(f){s.push(f)}};return n.then(function(){o.status="fulfilled",o.value=i;for(var f=0;f<s.length;f++)(0,s[f])(i)},function(f){for(o.status="rejected",o.reason=f,f=0;f<s.length;f++)(0,s[f])(void 0)}),o}var Em=z.S;z.S=function(n,i){ib=Tt(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&z_(n,i),Em!==null&&Em(n,i)};var ra=O(null);function dd(){var n=ra.current;return n!==null?n:pt.pooledCache}function Go(n,i){i===null?N(ra,ra.current):N(ra,i.pool)}function _m(){var n=dd();return n===null?null:{parent:Ut._currentValue,pool:n}}var Ka=Error(a(460)),fd=Error(a(474)),Ko=Error(a(542)),qo={then:function(){}};function Sm(n){return n=n.status,n==="fulfilled"||n==="rejected"}function wm(n,i,s){switch(s=n[s],s===void 0?n.push(i):s!==i&&(i.then(ye,ye),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,Tm(n),n;default:if(typeof i.status=="string")i.then(ye,ye);else{if(n=pt,n!==null&&100<n.shellSuspendCounter)throw Error(a(482));n=i,n.status="pending",n.then(function(o){if(i.status==="pending"){var f=i;f.status="fulfilled",f.value=o}},function(o){if(i.status==="pending"){var f=i;f.status="rejected",f.reason=o}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,Tm(n),n}throw aa=i,Ka}}function ia(n){try{var i=n._init;return i(n._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(aa=s,Ka):s}}var aa=null;function km(){if(aa===null)throw Error(a(459));var n=aa;return aa=null,n}function Tm(n){if(n===Ka||n===Ko)throw Error(a(483))}var qa=null,rl=0;function Vo(n){var i=rl;return rl+=1,qa===null&&(qa=[]),wm(qa,n,i)}function il(n,i){i=i.props.ref,n.ref=i!==void 0?i:null}function Yo(n,i){throw i.$$typeof===v?Error(a(525)):(n=Object.prototype.toString.call(i),Error(a(31,n==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":n)))}function Nm(n){function i($,H){if(n){var V=$.deletions;V===null?($.deletions=[H],$.flags|=16):V.push(H)}}function s($,H){if(!n)return null;for(;H!==null;)i($,H),H=H.sibling;return null}function o($){for(var H=new Map;$!==null;)$.key!==null?H.set($.key,$):H.set($.index,$),$=$.sibling;return H}function f($,H){return $=Rr($,H),$.index=0,$.sibling=null,$}function g($,H,V){return $.index=V,n?(V=$.alternate,V!==null?(V=V.index,V<H?($.flags|=67108866,H):V):($.flags|=67108866,H)):($.flags|=1048576,H)}function E($){return n&&$.alternate===null&&($.flags|=67108866),$}function k($,H,V,se){return H===null||H.tag!==6?(H=ed(V,$.mode,se),H.return=$,H):(H=f(H,V),H.return=$,H)}function L($,H,V,se){var Ne=V.type;return Ne===T?re($,H,V.props.children,se,V.key):H!==null&&(H.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===te&&ia(Ne)===H.type)?(H=f(H,V.props),il(H,V),H.return=$,H):(H=Po(V.type,V.key,V.props,null,$.mode,se),il(H,V),H.return=$,H)}function Y($,H,V,se){return H===null||H.tag!==4||H.stateNode.containerInfo!==V.containerInfo||H.stateNode.implementation!==V.implementation?(H=td(V,$.mode,se),H.return=$,H):(H=f(H,V.children||[]),H.return=$,H)}function re($,H,V,se,Ne){return H===null||H.tag!==7?(H=Ji(V,$.mode,se,Ne),H.return=$,H):(H=f(H,V),H.return=$,H)}function oe($,H,V){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=ed(""+H,$.mode,V),H.return=$,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case x:return V=Po(H.type,H.key,H.props,null,$.mode,V),il(V,H),V.return=$,V;case _:return H=td(H,$.mode,V),H.return=$,H;case te:return H=ia(H),oe($,H,V)}if(K(H)||X(H))return H=Ji(H,$.mode,V,null),H.return=$,H;if(typeof H.then=="function")return oe($,Vo(H),V);if(H.$$typeof===M)return oe($,$o($,H),V);Yo($,H)}return null}function Z($,H,V,se){var Ne=H!==null?H.key:null;if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return Ne!==null?null:k($,H,""+V,se);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case x:return V.key===Ne?L($,H,V,se):null;case _:return V.key===Ne?Y($,H,V,se):null;case te:return V=ia(V),Z($,H,V,se)}if(K(V)||X(V))return Ne!==null?null:re($,H,V,se,null);if(typeof V.then=="function")return Z($,H,Vo(V),se);if(V.$$typeof===M)return Z($,H,$o($,V),se);Yo($,V)}return null}function J($,H,V,se,Ne){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return $=$.get(V)||null,k(H,$,""+se,Ne);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case x:return $=$.get(se.key===null?V:se.key)||null,L(H,$,se,Ne);case _:return $=$.get(se.key===null?V:se.key)||null,Y(H,$,se,Ne);case te:return se=ia(se),J($,H,V,se,Ne)}if(K(se)||X(se))return $=$.get(V)||null,re(H,$,se,Ne,null);if(typeof se.then=="function")return J($,H,V,Vo(se),Ne);if(se.$$typeof===M)return J($,H,V,$o(H,se),Ne);Yo(H,se)}return null}function _e($,H,V,se){for(var Ne=null,Je=null,ke=H,Ue=H=0,Ye=null;ke!==null&&Ue<V.length;Ue++){ke.index>Ue?(Ye=ke,ke=null):Ye=ke.sibling;var et=Z($,ke,V[Ue],se);if(et===null){ke===null&&(ke=Ye);break}n&&ke&&et.alternate===null&&i($,ke),H=g(et,H,Ue),Je===null?Ne=et:Je.sibling=et,Je=et,ke=Ye}if(Ue===V.length)return s($,ke),Xe&&Mr($,Ue),Ne;if(ke===null){for(;Ue<V.length;Ue++)ke=oe($,V[Ue],se),ke!==null&&(H=g(ke,H,Ue),Je===null?Ne=ke:Je.sibling=ke,Je=ke);return Xe&&Mr($,Ue),Ne}for(ke=o(ke);Ue<V.length;Ue++)Ye=J(ke,$,Ue,V[Ue],se),Ye!==null&&(n&&Ye.alternate!==null&&ke.delete(Ye.key===null?Ue:Ye.key),H=g(Ye,H,Ue),Je===null?Ne=Ye:Je.sibling=Ye,Je=Ye);return n&&ke.forEach(function(Ri){return i($,Ri)}),Xe&&Mr($,Ue),Ne}function Oe($,H,V,se){if(V==null)throw Error(a(151));for(var Ne=null,Je=null,ke=H,Ue=H=0,Ye=null,et=V.next();ke!==null&&!et.done;Ue++,et=V.next()){ke.index>Ue?(Ye=ke,ke=null):Ye=ke.sibling;var Ri=Z($,ke,et.value,se);if(Ri===null){ke===null&&(ke=Ye);break}n&&ke&&Ri.alternate===null&&i($,ke),H=g(Ri,H,Ue),Je===null?Ne=Ri:Je.sibling=Ri,Je=Ri,ke=Ye}if(et.done)return s($,ke),Xe&&Mr($,Ue),Ne;if(ke===null){for(;!et.done;Ue++,et=V.next())et=oe($,et.value,se),et!==null&&(H=g(et,H,Ue),Je===null?Ne=et:Je.sibling=et,Je=et);return Xe&&Mr($,Ue),Ne}for(ke=o(ke);!et.done;Ue++,et=V.next())et=J(ke,$,Ue,et.value,se),et!==null&&(n&&et.alternate!==null&&ke.delete(et.key===null?Ue:et.key),H=g(et,H,Ue),Je===null?Ne=et:Je.sibling=et,Je=et);return n&&ke.forEach(function(YS){return i($,YS)}),Xe&&Mr($,Ue),Ne}function dt($,H,V,se){if(typeof V=="object"&&V!==null&&V.type===T&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case x:e:{for(var Ne=V.key;H!==null;){if(H.key===Ne){if(Ne=V.type,Ne===T){if(H.tag===7){s($,H.sibling),se=f(H,V.props.children),se.return=$,$=se;break e}}else if(H.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===te&&ia(Ne)===H.type){s($,H.sibling),se=f(H,V.props),il(se,V),se.return=$,$=se;break e}s($,H);break}else i($,H);H=H.sibling}V.type===T?(se=Ji(V.props.children,$.mode,se,V.key),se.return=$,$=se):(se=Po(V.type,V.key,V.props,null,$.mode,se),il(se,V),se.return=$,$=se)}return E($);case _:e:{for(Ne=V.key;H!==null;){if(H.key===Ne)if(H.tag===4&&H.stateNode.containerInfo===V.containerInfo&&H.stateNode.implementation===V.implementation){s($,H.sibling),se=f(H,V.children||[]),se.return=$,$=se;break e}else{s($,H);break}else i($,H);H=H.sibling}se=td(V,$.mode,se),se.return=$,$=se}return E($);case te:return V=ia(V),dt($,H,V,se)}if(K(V))return _e($,H,V,se);if(X(V)){if(Ne=X(V),typeof Ne!="function")throw Error(a(150));return V=Ne.call(V),Oe($,H,V,se)}if(typeof V.then=="function")return dt($,H,Vo(V),se);if(V.$$typeof===M)return dt($,H,$o($,V),se);Yo($,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,H!==null&&H.tag===6?(s($,H.sibling),se=f(H,V),se.return=$,$=se):(s($,H),se=ed(V,$.mode,se),se.return=$,$=se),E($)):s($,H)}return function($,H,V,se){try{rl=0;var Ne=dt($,H,V,se);return qa=null,Ne}catch(ke){if(ke===Ka||ke===Ko)throw ke;var Je=On(29,ke,null,$.mode);return Je.lanes=se,Je.return=$,Je}finally{}}}var sa=Nm(!0),Cm=Nm(!1),pi=!1;function hd(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function pd(n,i){n=n.updateQueue,i.updateQueue===n&&(i.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function mi(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function gi(n,i,s){var o=n.updateQueue;if(o===null)return null;if(o=o.shared,(tt&2)!==0){var f=o.pending;return f===null?i.next=i:(i.next=f.next,f.next=i),o.pending=i,i=Uo(n),dm(n,null,s),i}return Bo(n,o,i,s),Uo(n)}function al(n,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var o=i.lanes;o&=n.pendingLanes,s|=o,i.lanes=s,Me(n,s)}}function md(n,i){var s=n.updateQueue,o=n.alternate;if(o!==null&&(o=o.updateQueue,s===o)){var f=null,g=null;if(s=s.firstBaseUpdate,s!==null){do{var E={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};g===null?f=g=E:g=g.next=E,s=s.next}while(s!==null);g===null?f=g=i:g=g.next=i}else f=g=i;s={baseState:o.baseState,firstBaseUpdate:f,lastBaseUpdate:g,shared:o.shared,callbacks:o.callbacks},n.updateQueue=s;return}n=s.lastBaseUpdate,n===null?s.firstBaseUpdate=i:n.next=i,s.lastBaseUpdate=i}var gd=!1;function sl(){if(gd){var n=Ga;if(n!==null)throw n}}function ll(n,i,s,o){gd=!1;var f=n.updateQueue;pi=!1;var g=f.firstBaseUpdate,E=f.lastBaseUpdate,k=f.shared.pending;if(k!==null){f.shared.pending=null;var L=k,Y=L.next;L.next=null,E===null?g=Y:E.next=Y,E=L;var re=n.alternate;re!==null&&(re=re.updateQueue,k=re.lastBaseUpdate,k!==E&&(k===null?re.firstBaseUpdate=Y:k.next=Y,re.lastBaseUpdate=L))}if(g!==null){var oe=f.baseState;E=0,re=Y=L=null,k=g;do{var Z=k.lane&-536870913,J=Z!==k.lane;if(J?(Ve&Z)===Z:(o&Z)===Z){Z!==0&&Z===$a&&(gd=!0),re!==null&&(re=re.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var _e=n,Oe=k;Z=i;var dt=s;switch(Oe.tag){case 1:if(_e=Oe.payload,typeof _e=="function"){oe=_e.call(dt,oe,Z);break e}oe=_e;break e;case 3:_e.flags=_e.flags&-65537|128;case 0:if(_e=Oe.payload,Z=typeof _e=="function"?_e.call(dt,oe,Z):_e,Z==null)break e;oe=y({},oe,Z);break e;case 2:pi=!0}}Z=k.callback,Z!==null&&(n.flags|=64,J&&(n.flags|=8192),J=f.callbacks,J===null?f.callbacks=[Z]:J.push(Z))}else J={lane:Z,tag:k.tag,payload:k.payload,callback:k.callback,next:null},re===null?(Y=re=J,L=oe):re=re.next=J,E|=Z;if(k=k.next,k===null){if(k=f.shared.pending,k===null)break;J=k,k=J.next,J.next=null,f.lastBaseUpdate=J,f.shared.pending=null}}while(!0);re===null&&(L=oe),f.baseState=L,f.firstBaseUpdate=Y,f.lastBaseUpdate=re,g===null&&(f.shared.lanes=0),Ei|=E,n.lanes=E,n.memoizedState=oe}}function Am(n,i){if(typeof n!="function")throw Error(a(191,n));n.call(i)}function Om(n,i){var s=n.callbacks;if(s!==null)for(n.callbacks=null,n=0;n<s.length;n++)Am(s[n],i)}var Va=O(null),Wo=O(0);function Rm(n,i){n=$r,N(Wo,n),N(Va,i),$r=n|i.baseLanes}function bd(){N(Wo,$r),N(Va,Va.current)}function yd(){$r=Wo.current,G(Va),G(Wo)}var Rn=O(null),qn=null;function bi(n){var i=n.alternate;N(Lt,Lt.current&1),N(Rn,n),qn===null&&(i===null||Va.current!==null||i.memoizedState!==null)&&(qn=n)}function vd(n){N(Lt,Lt.current),N(Rn,n),qn===null&&(qn=n)}function Mm(n){n.tag===22?(N(Lt,Lt.current),N(Rn,n),qn===null&&(qn=n)):yi()}function yi(){N(Lt,Lt.current),N(Rn,Rn.current)}function Mn(n){G(Rn),qn===n&&(qn=null),G(Lt)}var Lt=O(0);function Xo(n){for(var i=n;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Tf(s)||Nf(s)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Lr=0,Be=null,ct=null,Pt=null,Zo=!1,Ya=!1,la=!1,Qo=0,ol=0,Wa=null,B_=0;function Ot(){throw Error(a(321))}function xd(n,i){if(i===null)return!1;for(var s=0;s<i.length&&s<n.length;s++)if(!An(n[s],i[s]))return!1;return!0}function Ed(n,i,s,o,f,g){return Lr=g,Be=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,z.H=n===null||n.memoizedState===null?mg:zd,la=!1,g=s(o,f),la=!1,Ya&&(g=Dm(i,s,o,f)),Im(n),g}function Im(n){z.H=dl;var i=ct!==null&&ct.next!==null;if(Lr=0,Pt=ct=Be=null,Zo=!1,ol=0,Wa=null,i)throw Error(a(300));n===null||Ht||(n=n.dependencies,n!==null&&Fo(n)&&(Ht=!0))}function Dm(n,i,s,o){Be=n;var f=0;do{if(Ya&&(Wa=null),ol=0,Ya=!1,25<=f)throw Error(a(301));if(f+=1,Pt=ct=null,n.updateQueue!=null){var g=n.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}z.H=gg,g=i(s,o)}while(Ya);return g}function U_(){var n=z.H,i=n.useState()[0];return i=typeof i.then=="function"?cl(i):i,n=n.useState()[0],(ct!==null?ct.memoizedState:null)!==n&&(Be.flags|=1024),i}function _d(){var n=Qo!==0;return Qo=0,n}function Sd(n,i,s){i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~s}function wd(n){if(Zo){for(n=n.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Zo=!1}Lr=0,Pt=ct=Be=null,Ya=!1,ol=Qo=0,Wa=null}function on(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pt===null?Be.memoizedState=Pt=n:Pt=Pt.next=n,Pt}function zt(){if(ct===null){var n=Be.alternate;n=n!==null?n.memoizedState:null}else n=ct.next;var i=Pt===null?Be.memoizedState:Pt.next;if(i!==null)Pt=i,ct=n;else{if(n===null)throw Be.alternate===null?Error(a(467)):Error(a(310));ct=n,n={memoizedState:ct.memoizedState,baseState:ct.baseState,baseQueue:ct.baseQueue,queue:ct.queue,next:null},Pt===null?Be.memoizedState=Pt=n:Pt=Pt.next=n}return Pt}function Jo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function cl(n){var i=ol;return ol+=1,Wa===null&&(Wa=[]),n=wm(Wa,n,i),i=Be,(Pt===null?i.memoizedState:Pt.next)===null&&(i=i.alternate,z.H=i===null||i.memoizedState===null?mg:zd),n}function ec(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return cl(n);if(n.$$typeof===M)return Wt(n)}throw Error(a(438,String(n)))}function kd(n){var i=null,s=Be.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var o=Be.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(i={data:o.data.map(function(f){return f.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),s===null&&(s=Jo(),Be.updateQueue=s),s.memoCache=i,s=i.data[i.index],s===void 0)for(s=i.data[i.index]=Array(n),o=0;o<n;o++)s[o]=U;return i.index++,s}function zr(n,i){return typeof i=="function"?i(n):i}function tc(n){var i=zt();return Td(i,ct,n)}function Td(n,i,s){var o=n.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=s;var f=n.baseQueue,g=o.pending;if(g!==null){if(f!==null){var E=f.next;f.next=g.next,g.next=E}i.baseQueue=f=g,o.pending=null}if(g=n.baseState,f===null)n.memoizedState=g;else{i=f.next;var k=E=null,L=null,Y=i,re=!1;do{var oe=Y.lane&-536870913;if(oe!==Y.lane?(Ve&oe)===oe:(Lr&oe)===oe){var Z=Y.revertLane;if(Z===0)L!==null&&(L=L.next={lane:0,revertLane:0,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),oe===$a&&(re=!0);else if((Lr&Z)===Z){Y=Y.next,Z===$a&&(re=!0);continue}else oe={lane:0,revertLane:Y.revertLane,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},L===null?(k=L=oe,E=g):L=L.next=oe,Be.lanes|=Z,Ei|=Z;oe=Y.action,la&&s(g,oe),g=Y.hasEagerState?Y.eagerState:s(g,oe)}else Z={lane:oe,revertLane:Y.revertLane,gesture:Y.gesture,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},L===null?(k=L=Z,E=g):L=L.next=Z,Be.lanes|=oe,Ei|=oe;Y=Y.next}while(Y!==null&&Y!==i);if(L===null?E=g:L.next=k,!An(g,n.memoizedState)&&(Ht=!0,re&&(s=Ga,s!==null)))throw s;n.memoizedState=g,n.baseState=E,n.baseQueue=L,o.lastRenderedState=g}return f===null&&(o.lanes=0),[n.memoizedState,o.dispatch]}function Nd(n){var i=zt(),s=i.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=n;var o=s.dispatch,f=s.pending,g=i.memoizedState;if(f!==null){s.pending=null;var E=f=f.next;do g=n(g,E.action),E=E.next;while(E!==f);An(g,i.memoizedState)||(Ht=!0),i.memoizedState=g,i.baseQueue===null&&(i.baseState=g),s.lastRenderedState=g}return[g,o]}function Lm(n,i,s){var o=Be,f=zt(),g=Xe;if(g){if(s===void 0)throw Error(a(407));s=s()}else s=i();var E=!An((ct||f).memoizedState,s);if(E&&(f.memoizedState=s,Ht=!0),f=f.queue,Od(Bm.bind(null,o,f,n),[n]),f.getSnapshot!==i||E||Pt!==null&&Pt.memoizedState.tag&1){if(o.flags|=2048,Xa(9,{destroy:void 0},jm.bind(null,o,f,s,i),null),pt===null)throw Error(a(349));g||(Lr&127)!==0||zm(o,i,s)}return s}function zm(n,i,s){n.flags|=16384,n={getSnapshot:i,value:s},i=Be.updateQueue,i===null?(i=Jo(),Be.updateQueue=i,i.stores=[n]):(s=i.stores,s===null?i.stores=[n]:s.push(n))}function jm(n,i,s,o){i.value=s,i.getSnapshot=o,Um(i)&&Pm(n)}function Bm(n,i,s){return s(function(){Um(i)&&Pm(n)})}function Um(n){var i=n.getSnapshot;n=n.value;try{var s=i();return!An(n,s)}catch{return!0}}function Pm(n){var i=Qi(n,2);i!==null&&Sn(i,n,2)}function Cd(n){var i=on();if(typeof n=="function"){var s=n;if(n=s(),la){Qt(!0);try{s()}finally{Qt(!1)}}}return i.memoizedState=i.baseState=n,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zr,lastRenderedState:n},i}function Hm(n,i,s,o){return n.baseState=s,Td(n,ct,typeof o=="function"?o:zr)}function P_(n,i,s,o,f){if(ic(n))throw Error(a(485));if(n=i.action,n!==null){var g={payload:f,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){g.listeners.push(E)}};z.T!==null?s(!0):g.isTransition=!1,o(g),s=i.pending,s===null?(g.next=i.pending=g,Fm(i,g)):(g.next=s.next,i.pending=s.next=g)}}function Fm(n,i){var s=i.action,o=i.payload,f=n.state;if(i.isTransition){var g=z.T,E={};z.T=E;try{var k=s(f,o),L=z.S;L!==null&&L(E,k),$m(n,i,k)}catch(Y){Ad(n,i,Y)}finally{g!==null&&E.types!==null&&(g.types=E.types),z.T=g}}else try{g=s(f,o),$m(n,i,g)}catch(Y){Ad(n,i,Y)}}function $m(n,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(o){Gm(n,i,o)},function(o){return Ad(n,i,o)}):Gm(n,i,s)}function Gm(n,i,s){i.status="fulfilled",i.value=s,Km(i),n.state=s,i=n.pending,i!==null&&(s=i.next,s===i?n.pending=null:(s=s.next,i.next=s,Fm(n,s)))}function Ad(n,i,s){var o=n.pending;if(n.pending=null,o!==null){o=o.next;do i.status="rejected",i.reason=s,Km(i),i=i.next;while(i!==o)}n.action=null}function Km(n){n=n.listeners;for(var i=0;i<n.length;i++)(0,n[i])()}function qm(n,i){return i}function Vm(n,i){if(Xe){var s=pt.formState;if(s!==null){e:{var o=Be;if(Xe){if(Et){t:{for(var f=Et,g=Kn;f.nodeType!==8;){if(!g){f=null;break t}if(f=Vn(f.nextSibling),f===null){f=null;break t}}g=f.data,f=g==="F!"||g==="F"?f:null}if(f){Et=Vn(f.nextSibling),o=f.data==="F!";break e}}fi(o)}o=!1}o&&(i=s[0])}}return s=on(),s.memoizedState=s.baseState=i,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qm,lastRenderedState:i},s.queue=o,s=fg.bind(null,Be,o),o.dispatch=s,o=Cd(!1),g=Ld.bind(null,Be,!1,o.queue),o=on(),f={state:i,dispatch:null,action:n,pending:null},o.queue=f,s=P_.bind(null,Be,f,g,s),f.dispatch=s,o.memoizedState=n,[i,s,!1]}function Ym(n){var i=zt();return Wm(i,ct,n)}function Wm(n,i,s){if(i=Td(n,i,qm)[0],n=tc(zr)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var o=cl(i)}catch(E){throw E===Ka?Ko:E}else o=i;i=zt();var f=i.queue,g=f.dispatch;return s!==i.memoizedState&&(Be.flags|=2048,Xa(9,{destroy:void 0},H_.bind(null,f,s),null)),[o,g,n]}function H_(n,i){n.action=i}function Xm(n){var i=zt(),s=ct;if(s!==null)return Wm(i,s,n);zt(),i=i.memoizedState,s=zt();var o=s.queue.dispatch;return s.memoizedState=n,[i,o,!1]}function Xa(n,i,s,o){return n={tag:n,create:s,deps:o,inst:i,next:null},i=Be.updateQueue,i===null&&(i=Jo(),Be.updateQueue=i),s=i.lastEffect,s===null?i.lastEffect=n.next=n:(o=s.next,s.next=n,n.next=o,i.lastEffect=n),n}function Zm(){return zt().memoizedState}function nc(n,i,s,o){var f=on();Be.flags|=n,f.memoizedState=Xa(1|i,{destroy:void 0},s,o===void 0?null:o)}function rc(n,i,s,o){var f=zt();o=o===void 0?null:o;var g=f.memoizedState.inst;ct!==null&&o!==null&&xd(o,ct.memoizedState.deps)?f.memoizedState=Xa(i,g,s,o):(Be.flags|=n,f.memoizedState=Xa(1|i,g,s,o))}function Qm(n,i){nc(8390656,8,n,i)}function Od(n,i){rc(2048,8,n,i)}function F_(n){Be.flags|=4;var i=Be.updateQueue;if(i===null)i=Jo(),Be.updateQueue=i,i.events=[n];else{var s=i.events;s===null?i.events=[n]:s.push(n)}}function Jm(n){var i=zt().memoizedState;return F_({ref:i,nextImpl:n}),function(){if((tt&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function eg(n,i){return rc(4,2,n,i)}function tg(n,i){return rc(4,4,n,i)}function ng(n,i){if(typeof i=="function"){n=n();var s=i(n);return function(){typeof s=="function"?s():i(null)}}if(i!=null)return n=n(),i.current=n,function(){i.current=null}}function rg(n,i,s){s=s!=null?s.concat([n]):null,rc(4,4,ng.bind(null,i,n),s)}function Rd(){}function ig(n,i){var s=zt();i=i===void 0?null:i;var o=s.memoizedState;return i!==null&&xd(i,o[1])?o[0]:(s.memoizedState=[n,i],n)}function ag(n,i){var s=zt();i=i===void 0?null:i;var o=s.memoizedState;if(i!==null&&xd(i,o[1]))return o[0];if(o=n(),la){Qt(!0);try{n()}finally{Qt(!1)}}return s.memoizedState=[o,i],o}function Md(n,i,s){return s===void 0||(Lr&1073741824)!==0&&(Ve&261930)===0?n.memoizedState=i:(n.memoizedState=s,n=sb(),Be.lanes|=n,Ei|=n,s)}function sg(n,i,s,o){return An(s,i)?s:Va.current!==null?(n=Md(n,s,o),An(n,i)||(Ht=!0),n):(Lr&42)===0||(Lr&1073741824)!==0&&(Ve&261930)===0?(Ht=!0,n.memoizedState=s):(n=sb(),Be.lanes|=n,Ei|=n,i)}function lg(n,i,s,o,f){var g=Q.p;Q.p=g!==0&&8>g?g:8;var E=z.T,k={};z.T=k,Ld(n,!1,i,s);try{var L=f(),Y=z.S;if(Y!==null&&Y(k,L),L!==null&&typeof L=="object"&&typeof L.then=="function"){var re=j_(L,o);ul(n,i,re,Ln(n))}else ul(n,i,o,Ln(n))}catch(oe){ul(n,i,{then:function(){},status:"rejected",reason:oe},Ln())}finally{Q.p=g,E!==null&&k.types!==null&&(E.types=k.types),z.T=E}}function $_(){}function Id(n,i,s,o){if(n.tag!==5)throw Error(a(476));var f=og(n).queue;lg(n,f,i,ie,s===null?$_:function(){return cg(n),s(o)})}function og(n){var i=n.memoizedState;if(i!==null)return i;i={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zr,lastRenderedState:ie},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zr,lastRenderedState:s},next:null},n.memoizedState=i,n=n.alternate,n!==null&&(n.memoizedState=i),i}function cg(n){var i=og(n);i.next===null&&(i=n.alternate.memoizedState),ul(n,i.next.queue,{},Ln())}function Dd(){return Wt(Nl)}function ug(){return zt().memoizedState}function dg(){return zt().memoizedState}function G_(n){for(var i=n.return;i!==null;){switch(i.tag){case 24:case 3:var s=Ln();n=mi(s);var o=gi(i,n,s);o!==null&&(Sn(o,i,s),al(o,i,s)),i={cache:cd()},n.payload=i;return}i=i.return}}function K_(n,i,s){var o=Ln();s={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},ic(n)?hg(i,s):(s=Qu(n,i,s,o),s!==null&&(Sn(s,n,o),pg(s,i,o)))}function fg(n,i,s){var o=Ln();ul(n,i,s,o)}function ul(n,i,s,o){var f={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(ic(n))hg(i,f);else{var g=n.alternate;if(n.lanes===0&&(g===null||g.lanes===0)&&(g=i.lastRenderedReducer,g!==null))try{var E=i.lastRenderedState,k=g(E,s);if(f.hasEagerState=!0,f.eagerState=k,An(k,E))return Bo(n,i,f,0),pt===null&&jo(),!1}catch{}finally{}if(s=Qu(n,i,f,o),s!==null)return Sn(s,n,o),pg(s,i,o),!0}return!1}function Ld(n,i,s,o){if(o={lane:2,revertLane:pf(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},ic(n)){if(i)throw Error(a(479))}else i=Qu(n,s,o,2),i!==null&&Sn(i,n,2)}function ic(n){var i=n.alternate;return n===Be||i!==null&&i===Be}function hg(n,i){Ya=Zo=!0;var s=n.pending;s===null?i.next=i:(i.next=s.next,s.next=i),n.pending=i}function pg(n,i,s){if((s&4194048)!==0){var o=i.lanes;o&=n.pendingLanes,s|=o,i.lanes=s,Me(n,s)}}var dl={readContext:Wt,use:ec,useCallback:Ot,useContext:Ot,useEffect:Ot,useImperativeHandle:Ot,useLayoutEffect:Ot,useInsertionEffect:Ot,useMemo:Ot,useReducer:Ot,useRef:Ot,useState:Ot,useDebugValue:Ot,useDeferredValue:Ot,useTransition:Ot,useSyncExternalStore:Ot,useId:Ot,useHostTransitionStatus:Ot,useFormState:Ot,useActionState:Ot,useOptimistic:Ot,useMemoCache:Ot,useCacheRefresh:Ot};dl.useEffectEvent=Ot;var mg={readContext:Wt,use:ec,useCallback:function(n,i){return on().memoizedState=[n,i===void 0?null:i],n},useContext:Wt,useEffect:Qm,useImperativeHandle:function(n,i,s){s=s!=null?s.concat([n]):null,nc(4194308,4,ng.bind(null,i,n),s)},useLayoutEffect:function(n,i){return nc(4194308,4,n,i)},useInsertionEffect:function(n,i){nc(4,2,n,i)},useMemo:function(n,i){var s=on();i=i===void 0?null:i;var o=n();if(la){Qt(!0);try{n()}finally{Qt(!1)}}return s.memoizedState=[o,i],o},useReducer:function(n,i,s){var o=on();if(s!==void 0){var f=s(i);if(la){Qt(!0);try{s(i)}finally{Qt(!1)}}}else f=i;return o.memoizedState=o.baseState=f,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:f},o.queue=n,n=n.dispatch=K_.bind(null,Be,n),[o.memoizedState,n]},useRef:function(n){var i=on();return n={current:n},i.memoizedState=n},useState:function(n){n=Cd(n);var i=n.queue,s=fg.bind(null,Be,i);return i.dispatch=s,[n.memoizedState,s]},useDebugValue:Rd,useDeferredValue:function(n,i){var s=on();return Md(s,n,i)},useTransition:function(){var n=Cd(!1);return n=lg.bind(null,Be,n.queue,!0,!1),on().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,i,s){var o=Be,f=on();if(Xe){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),pt===null)throw Error(a(349));(Ve&127)!==0||zm(o,i,s)}f.memoizedState=s;var g={value:s,getSnapshot:i};return f.queue=g,Qm(Bm.bind(null,o,g,n),[n]),o.flags|=2048,Xa(9,{destroy:void 0},jm.bind(null,o,g,s,i),null),s},useId:function(){var n=on(),i=pt.identifierPrefix;if(Xe){var s=hr,o=fr;s=(o&~(1<<32-rt(o)-1)).toString(32)+s,i="_"+i+"R_"+s,s=Qo++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=B_++,i="_"+i+"r_"+s.toString(32)+"_";return n.memoizedState=i},useHostTransitionStatus:Dd,useFormState:Vm,useActionState:Vm,useOptimistic:function(n){var i=on();i.memoizedState=i.baseState=n;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=Ld.bind(null,Be,!0,s),s.dispatch=i,[n,i]},useMemoCache:kd,useCacheRefresh:function(){return on().memoizedState=G_.bind(null,Be)},useEffectEvent:function(n){var i=on(),s={impl:n};return i.memoizedState=s,function(){if((tt&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},zd={readContext:Wt,use:ec,useCallback:ig,useContext:Wt,useEffect:Od,useImperativeHandle:rg,useInsertionEffect:eg,useLayoutEffect:tg,useMemo:ag,useReducer:tc,useRef:Zm,useState:function(){return tc(zr)},useDebugValue:Rd,useDeferredValue:function(n,i){var s=zt();return sg(s,ct.memoizedState,n,i)},useTransition:function(){var n=tc(zr)[0],i=zt().memoizedState;return[typeof n=="boolean"?n:cl(n),i]},useSyncExternalStore:Lm,useId:ug,useHostTransitionStatus:Dd,useFormState:Ym,useActionState:Ym,useOptimistic:function(n,i){var s=zt();return Hm(s,ct,n,i)},useMemoCache:kd,useCacheRefresh:dg};zd.useEffectEvent=Jm;var gg={readContext:Wt,use:ec,useCallback:ig,useContext:Wt,useEffect:Od,useImperativeHandle:rg,useInsertionEffect:eg,useLayoutEffect:tg,useMemo:ag,useReducer:Nd,useRef:Zm,useState:function(){return Nd(zr)},useDebugValue:Rd,useDeferredValue:function(n,i){var s=zt();return ct===null?Md(s,n,i):sg(s,ct.memoizedState,n,i)},useTransition:function(){var n=Nd(zr)[0],i=zt().memoizedState;return[typeof n=="boolean"?n:cl(n),i]},useSyncExternalStore:Lm,useId:ug,useHostTransitionStatus:Dd,useFormState:Xm,useActionState:Xm,useOptimistic:function(n,i){var s=zt();return ct!==null?Hm(s,ct,n,i):(s.baseState=n,[n,s.queue.dispatch])},useMemoCache:kd,useCacheRefresh:dg};gg.useEffectEvent=Jm;function jd(n,i,s,o){i=n.memoizedState,s=s(o,i),s=s==null?i:y({},i,s),n.memoizedState=s,n.lanes===0&&(n.updateQueue.baseState=s)}var Bd={enqueueSetState:function(n,i,s){n=n._reactInternals;var o=Ln(),f=mi(o);f.payload=i,s!=null&&(f.callback=s),i=gi(n,f,o),i!==null&&(Sn(i,n,o),al(i,n,o))},enqueueReplaceState:function(n,i,s){n=n._reactInternals;var o=Ln(),f=mi(o);f.tag=1,f.payload=i,s!=null&&(f.callback=s),i=gi(n,f,o),i!==null&&(Sn(i,n,o),al(i,n,o))},enqueueForceUpdate:function(n,i){n=n._reactInternals;var s=Ln(),o=mi(s);o.tag=2,i!=null&&(o.callback=i),i=gi(n,o,s),i!==null&&(Sn(i,n,s),al(i,n,s))}};function bg(n,i,s,o,f,g,E){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(o,g,E):i.prototype&&i.prototype.isPureReactComponent?!Zs(s,o)||!Zs(f,g):!0}function yg(n,i,s,o){n=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(s,o),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(s,o),i.state!==n&&Bd.enqueueReplaceState(i,i.state,null)}function oa(n,i){var s=i;if("ref"in i){s={};for(var o in i)o!=="ref"&&(s[o]=i[o])}if(n=n.defaultProps){s===i&&(s=y({},s));for(var f in n)s[f]===void 0&&(s[f]=n[f])}return s}function vg(n){zo(n)}function xg(n){console.error(n)}function Eg(n){zo(n)}function ac(n,i){try{var s=n.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(o){setTimeout(function(){throw o})}}function _g(n,i,s){try{var o=n.onCaughtError;o(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Ud(n,i,s){return s=mi(s),s.tag=3,s.payload={element:null},s.callback=function(){ac(n,i)},s}function Sg(n){return n=mi(n),n.tag=3,n}function wg(n,i,s,o){var f=s.type.getDerivedStateFromError;if(typeof f=="function"){var g=o.value;n.payload=function(){return f(g)},n.callback=function(){_g(i,s,o)}}var E=s.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(n.callback=function(){_g(i,s,o),typeof f!="function"&&(_i===null?_i=new Set([this]):_i.add(this));var k=o.stack;this.componentDidCatch(o.value,{componentStack:k!==null?k:""})})}function q_(n,i,s,o,f){if(s.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(i=s.alternate,i!==null&&Fa(i,s,f,!0),s=Rn.current,s!==null){switch(s.tag){case 31:case 13:return qn===null?bc():s.alternate===null&&Rt===0&&(Rt=3),s.flags&=-257,s.flags|=65536,s.lanes=f,o===qo?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([o]):i.add(o),df(n,o,f)),!1;case 22:return s.flags|=65536,o===qo?s.flags|=16384:(i=s.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([o])},s.updateQueue=i):(s=i.retryQueue,s===null?i.retryQueue=new Set([o]):s.add(o)),df(n,o,f)),!1}throw Error(a(435,s.tag))}return df(n,o,f),bc(),!1}if(Xe)return i=Rn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=f,o!==id&&(n=Error(a(422),{cause:o}),el(Fn(n,s)))):(o!==id&&(i=Error(a(423),{cause:o}),el(Fn(i,s))),n=n.current.alternate,n.flags|=65536,f&=-f,n.lanes|=f,o=Fn(o,s),f=Ud(n.stateNode,o,f),md(n,f),Rt!==4&&(Rt=2)),!1;var g=Error(a(520),{cause:o});if(g=Fn(g,s),vl===null?vl=[g]:vl.push(g),Rt!==4&&(Rt=2),i===null)return!0;o=Fn(o,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,n=f&-f,s.lanes|=n,n=Ud(s.stateNode,o,n),md(s,n),!1;case 1:if(i=s.type,g=s.stateNode,(s.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(_i===null||!_i.has(g))))return s.flags|=65536,f&=-f,s.lanes|=f,f=Sg(f),wg(f,n,s,o),md(s,f),!1}s=s.return}while(s!==null);return!1}var Pd=Error(a(461)),Ht=!1;function Xt(n,i,s,o){i.child=n===null?Cm(i,null,s,o):sa(i,n.child,s,o)}function kg(n,i,s,o,f){s=s.render;var g=i.ref;if("ref"in o){var E={};for(var k in o)k!=="ref"&&(E[k]=o[k])}else E=o;return na(i),o=Ed(n,i,s,E,g,f),k=_d(),n!==null&&!Ht?(Sd(n,i,f),jr(n,i,f)):(Xe&&k&&nd(i),i.flags|=1,Xt(n,i,o,f),i.child)}function Tg(n,i,s,o,f){if(n===null){var g=s.type;return typeof g=="function"&&!Ju(g)&&g.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=g,Ng(n,i,g,o,f)):(n=Po(s.type,null,o,i,i.mode,f),n.ref=i.ref,n.return=i,i.child=n)}if(g=n.child,!Yd(n,f)){var E=g.memoizedProps;if(s=s.compare,s=s!==null?s:Zs,s(E,o)&&n.ref===i.ref)return jr(n,i,f)}return i.flags|=1,n=Rr(g,o),n.ref=i.ref,n.return=i,i.child=n}function Ng(n,i,s,o,f){if(n!==null){var g=n.memoizedProps;if(Zs(g,o)&&n.ref===i.ref)if(Ht=!1,i.pendingProps=o=g,Yd(n,f))(n.flags&131072)!==0&&(Ht=!0);else return i.lanes=n.lanes,jr(n,i,f)}return Hd(n,i,s,o,f)}function Cg(n,i,s,o){var f=o.children,g=n!==null?n.memoizedState:null;if(n===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((i.flags&128)!==0){if(g=g!==null?g.baseLanes|s:s,n!==null){for(o=i.child=n.child,f=0;o!==null;)f=f|o.lanes|o.childLanes,o=o.sibling;o=f&~g}else o=0,i.child=null;return Ag(n,i,g,s,o)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},n!==null&&Go(i,g!==null?g.cachePool:null),g!==null?Rm(i,g):bd(),Mm(i);else return o=i.lanes=536870912,Ag(n,i,g!==null?g.baseLanes|s:s,s,o)}else g!==null?(Go(i,g.cachePool),Rm(i,g),yi(),i.memoizedState=null):(n!==null&&Go(i,null),bd(),yi());return Xt(n,i,f,s),i.child}function fl(n,i){return n!==null&&n.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Ag(n,i,s,o,f){var g=dd();return g=g===null?null:{parent:Ut._currentValue,pool:g},i.memoizedState={baseLanes:s,cachePool:g},n!==null&&Go(i,null),bd(),Mm(i),n!==null&&Fa(n,i,o,!0),i.childLanes=f,null}function sc(n,i){return i=oc({mode:i.mode,children:i.children},n.mode),i.ref=n.ref,n.child=i,i.return=n,i}function Og(n,i,s){return sa(i,n.child,null,s),n=sc(i,i.pendingProps),n.flags|=2,Mn(i),i.memoizedState=null,n}function V_(n,i,s){var o=i.pendingProps,f=(i.flags&128)!==0;if(i.flags&=-129,n===null){if(Xe){if(o.mode==="hidden")return n=sc(i,o),i.lanes=536870912,fl(null,n);if(vd(i),(n=Et)?(n=Fb(n,Kn),n=n!==null&&n.data==="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:ui!==null?{id:fr,overflow:hr}:null,retryLane:536870912,hydrationErrors:null},s=hm(n),s.return=i,i.child=s,Yt=i,Et=null)):n=null,n===null)throw fi(i);return i.lanes=536870912,null}return sc(i,o)}var g=n.memoizedState;if(g!==null){var E=g.dehydrated;if(vd(i),f)if(i.flags&256)i.flags&=-257,i=Og(n,i,s);else if(i.memoizedState!==null)i.child=n.child,i.flags|=128,i=null;else throw Error(a(558));else if(Ht||Fa(n,i,s,!1),f=(s&n.childLanes)!==0,Ht||f){if(o=pt,o!==null&&(E=Mt(o,s),E!==0&&E!==g.retryLane))throw g.retryLane=E,Qi(n,E),Sn(o,n,E),Pd;bc(),i=Og(n,i,s)}else n=g.treeContext,Et=Vn(E.nextSibling),Yt=i,Xe=!0,di=null,Kn=!1,n!==null&&gm(i,n),i=sc(i,o),i.flags|=4096;return i}return n=Rr(n.child,{mode:o.mode,children:o.children}),n.ref=i.ref,i.child=n,n.return=i,n}function lc(n,i){var s=i.ref;if(s===null)n!==null&&n.ref!==null&&(i.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(a(284));(n===null||n.ref!==s)&&(i.flags|=4194816)}}function Hd(n,i,s,o,f){return na(i),s=Ed(n,i,s,o,void 0,f),o=_d(),n!==null&&!Ht?(Sd(n,i,f),jr(n,i,f)):(Xe&&o&&nd(i),i.flags|=1,Xt(n,i,s,f),i.child)}function Rg(n,i,s,o,f,g){return na(i),i.updateQueue=null,s=Dm(i,o,s,f),Im(n),o=_d(),n!==null&&!Ht?(Sd(n,i,g),jr(n,i,g)):(Xe&&o&&nd(i),i.flags|=1,Xt(n,i,s,g),i.child)}function Mg(n,i,s,o,f){if(na(i),i.stateNode===null){var g=Ba,E=s.contextType;typeof E=="object"&&E!==null&&(g=Wt(E)),g=new s(o,g),i.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=Bd,i.stateNode=g,g._reactInternals=i,g=i.stateNode,g.props=o,g.state=i.memoizedState,g.refs={},hd(i),E=s.contextType,g.context=typeof E=="object"&&E!==null?Wt(E):Ba,g.state=i.memoizedState,E=s.getDerivedStateFromProps,typeof E=="function"&&(jd(i,s,E,o),g.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(E=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),E!==g.state&&Bd.enqueueReplaceState(g,g.state,null),ll(i,o,g,f),sl(),g.state=i.memoizedState),typeof g.componentDidMount=="function"&&(i.flags|=4194308),o=!0}else if(n===null){g=i.stateNode;var k=i.memoizedProps,L=oa(s,k);g.props=L;var Y=g.context,re=s.contextType;E=Ba,typeof re=="object"&&re!==null&&(E=Wt(re));var oe=s.getDerivedStateFromProps;re=typeof oe=="function"||typeof g.getSnapshotBeforeUpdate=="function",k=i.pendingProps!==k,re||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(k||Y!==E)&&yg(i,g,o,E),pi=!1;var Z=i.memoizedState;g.state=Z,ll(i,o,g,f),sl(),Y=i.memoizedState,k||Z!==Y||pi?(typeof oe=="function"&&(jd(i,s,oe,o),Y=i.memoizedState),(L=pi||bg(i,s,L,o,Z,Y,E))?(re||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(i.flags|=4194308)):(typeof g.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=o,i.memoizedState=Y),g.props=o,g.state=Y,g.context=E,o=L):(typeof g.componentDidMount=="function"&&(i.flags|=4194308),o=!1)}else{g=i.stateNode,pd(n,i),E=i.memoizedProps,re=oa(s,E),g.props=re,oe=i.pendingProps,Z=g.context,Y=s.contextType,L=Ba,typeof Y=="object"&&Y!==null&&(L=Wt(Y)),k=s.getDerivedStateFromProps,(Y=typeof k=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(E!==oe||Z!==L)&&yg(i,g,o,L),pi=!1,Z=i.memoizedState,g.state=Z,ll(i,o,g,f),sl();var J=i.memoizedState;E!==oe||Z!==J||pi||n!==null&&n.dependencies!==null&&Fo(n.dependencies)?(typeof k=="function"&&(jd(i,s,k,o),J=i.memoizedState),(re=pi||bg(i,s,re,o,Z,J,L)||n!==null&&n.dependencies!==null&&Fo(n.dependencies))?(Y||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(o,J,L),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(o,J,L)),typeof g.componentDidUpdate=="function"&&(i.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof g.componentDidUpdate!="function"||E===n.memoizedProps&&Z===n.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||E===n.memoizedProps&&Z===n.memoizedState||(i.flags|=1024),i.memoizedProps=o,i.memoizedState=J),g.props=o,g.state=J,g.context=L,o=re):(typeof g.componentDidUpdate!="function"||E===n.memoizedProps&&Z===n.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||E===n.memoizedProps&&Z===n.memoizedState||(i.flags|=1024),o=!1)}return g=o,lc(n,i),o=(i.flags&128)!==0,g||o?(g=i.stateNode,s=o&&typeof s.getDerivedStateFromError!="function"?null:g.render(),i.flags|=1,n!==null&&o?(i.child=sa(i,n.child,null,f),i.child=sa(i,null,s,f)):Xt(n,i,s,f),i.memoizedState=g.state,n=i.child):n=jr(n,i,f),n}function Ig(n,i,s,o){return ea(),i.flags|=256,Xt(n,i,s,o),i.child}var Fd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function $d(n){return{baseLanes:n,cachePool:_m()}}function Gd(n,i,s){return n=n!==null?n.childLanes&~s:0,i&&(n|=Dn),n}function Dg(n,i,s){var o=i.pendingProps,f=!1,g=(i.flags&128)!==0,E;if((E=g)||(E=n!==null&&n.memoizedState===null?!1:(Lt.current&2)!==0),E&&(f=!0,i.flags&=-129),E=(i.flags&32)!==0,i.flags&=-33,n===null){if(Xe){if(f?bi(i):yi(),(n=Et)?(n=Fb(n,Kn),n=n!==null&&n.data!=="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:ui!==null?{id:fr,overflow:hr}:null,retryLane:536870912,hydrationErrors:null},s=hm(n),s.return=i,i.child=s,Yt=i,Et=null)):n=null,n===null)throw fi(i);return Nf(n)?i.lanes=32:i.lanes=536870912,null}var k=o.children;return o=o.fallback,f?(yi(),f=i.mode,k=oc({mode:"hidden",children:k},f),o=Ji(o,f,s,null),k.return=i,o.return=i,k.sibling=o,i.child=k,o=i.child,o.memoizedState=$d(s),o.childLanes=Gd(n,E,s),i.memoizedState=Fd,fl(null,o)):(bi(i),Kd(i,k))}var L=n.memoizedState;if(L!==null&&(k=L.dehydrated,k!==null)){if(g)i.flags&256?(bi(i),i.flags&=-257,i=qd(n,i,s)):i.memoizedState!==null?(yi(),i.child=n.child,i.flags|=128,i=null):(yi(),k=o.fallback,f=i.mode,o=oc({mode:"visible",children:o.children},f),k=Ji(k,f,s,null),k.flags|=2,o.return=i,k.return=i,o.sibling=k,i.child=o,sa(i,n.child,null,s),o=i.child,o.memoizedState=$d(s),o.childLanes=Gd(n,E,s),i.memoizedState=Fd,i=fl(null,o));else if(bi(i),Nf(k)){if(E=k.nextSibling&&k.nextSibling.dataset,E)var Y=E.dgst;E=Y,o=Error(a(419)),o.stack="",o.digest=E,el({value:o,source:null,stack:null}),i=qd(n,i,s)}else if(Ht||Fa(n,i,s,!1),E=(s&n.childLanes)!==0,Ht||E){if(E=pt,E!==null&&(o=Mt(E,s),o!==0&&o!==L.retryLane))throw L.retryLane=o,Qi(n,o),Sn(E,n,o),Pd;Tf(k)||bc(),i=qd(n,i,s)}else Tf(k)?(i.flags|=192,i.child=n.child,i=null):(n=L.treeContext,Et=Vn(k.nextSibling),Yt=i,Xe=!0,di=null,Kn=!1,n!==null&&gm(i,n),i=Kd(i,o.children),i.flags|=4096);return i}return f?(yi(),k=o.fallback,f=i.mode,L=n.child,Y=L.sibling,o=Rr(L,{mode:"hidden",children:o.children}),o.subtreeFlags=L.subtreeFlags&65011712,Y!==null?k=Rr(Y,k):(k=Ji(k,f,s,null),k.flags|=2),k.return=i,o.return=i,o.sibling=k,i.child=o,fl(null,o),o=i.child,k=n.child.memoizedState,k===null?k=$d(s):(f=k.cachePool,f!==null?(L=Ut._currentValue,f=f.parent!==L?{parent:L,pool:L}:f):f=_m(),k={baseLanes:k.baseLanes|s,cachePool:f}),o.memoizedState=k,o.childLanes=Gd(n,E,s),i.memoizedState=Fd,fl(n.child,o)):(bi(i),s=n.child,n=s.sibling,s=Rr(s,{mode:"visible",children:o.children}),s.return=i,s.sibling=null,n!==null&&(E=i.deletions,E===null?(i.deletions=[n],i.flags|=16):E.push(n)),i.child=s,i.memoizedState=null,s)}function Kd(n,i){return i=oc({mode:"visible",children:i},n.mode),i.return=n,n.child=i}function oc(n,i){return n=On(22,n,null,i),n.lanes=0,n}function qd(n,i,s){return sa(i,n.child,null,s),n=Kd(i,i.pendingProps.children),n.flags|=2,i.memoizedState=null,n}function Lg(n,i,s){n.lanes|=i;var o=n.alternate;o!==null&&(o.lanes|=i),ld(n.return,i,s)}function Vd(n,i,s,o,f,g){var E=n.memoizedState;E===null?n.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:o,tail:s,tailMode:f,treeForkCount:g}:(E.isBackwards=i,E.rendering=null,E.renderingStartTime=0,E.last=o,E.tail=s,E.tailMode=f,E.treeForkCount=g)}function zg(n,i,s){var o=i.pendingProps,f=o.revealOrder,g=o.tail;o=o.children;var E=Lt.current,k=(E&2)!==0;if(k?(E=E&1|2,i.flags|=128):E&=1,N(Lt,E),Xt(n,i,o,s),o=Xe?Js:0,!k&&n!==null&&(n.flags&128)!==0)e:for(n=i.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&Lg(n,s,i);else if(n.tag===19)Lg(n,s,i);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===i)break e;for(;n.sibling===null;){if(n.return===null||n.return===i)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(f){case"forwards":for(s=i.child,f=null;s!==null;)n=s.alternate,n!==null&&Xo(n)===null&&(f=s),s=s.sibling;s=f,s===null?(f=i.child,i.child=null):(f=s.sibling,s.sibling=null),Vd(i,!1,f,s,g,o);break;case"backwards":case"unstable_legacy-backwards":for(s=null,f=i.child,i.child=null;f!==null;){if(n=f.alternate,n!==null&&Xo(n)===null){i.child=f;break}n=f.sibling,f.sibling=s,s=f,f=n}Vd(i,!0,s,null,g,o);break;case"together":Vd(i,!1,null,null,void 0,o);break;default:i.memoizedState=null}return i.child}function jr(n,i,s){if(n!==null&&(i.dependencies=n.dependencies),Ei|=i.lanes,(s&i.childLanes)===0)if(n!==null){if(Fa(n,i,s,!1),(s&i.childLanes)===0)return null}else return null;if(n!==null&&i.child!==n.child)throw Error(a(153));if(i.child!==null){for(n=i.child,s=Rr(n,n.pendingProps),i.child=s,s.return=i;n.sibling!==null;)n=n.sibling,s=s.sibling=Rr(n,n.pendingProps),s.return=i;s.sibling=null}return i.child}function Yd(n,i){return(n.lanes&i)!==0?!0:(n=n.dependencies,!!(n!==null&&Fo(n)))}function Y_(n,i,s){switch(i.tag){case 3:ge(i,i.stateNode.containerInfo),hi(i,Ut,n.memoizedState.cache),ea();break;case 27:case 5:Ie(i);break;case 4:ge(i,i.stateNode.containerInfo);break;case 10:hi(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,vd(i),null;break;case 13:var o=i.memoizedState;if(o!==null)return o.dehydrated!==null?(bi(i),i.flags|=128,null):(s&i.child.childLanes)!==0?Dg(n,i,s):(bi(i),n=jr(n,i,s),n!==null?n.sibling:null);bi(i);break;case 19:var f=(n.flags&128)!==0;if(o=(s&i.childLanes)!==0,o||(Fa(n,i,s,!1),o=(s&i.childLanes)!==0),f){if(o)return zg(n,i,s);i.flags|=128}if(f=i.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),N(Lt,Lt.current),o)break;return null;case 22:return i.lanes=0,Cg(n,i,s,i.pendingProps);case 24:hi(i,Ut,n.memoizedState.cache)}return jr(n,i,s)}function jg(n,i,s){if(n!==null)if(n.memoizedProps!==i.pendingProps)Ht=!0;else{if(!Yd(n,s)&&(i.flags&128)===0)return Ht=!1,Y_(n,i,s);Ht=(n.flags&131072)!==0}else Ht=!1,Xe&&(i.flags&1048576)!==0&&mm(i,Js,i.index);switch(i.lanes=0,i.tag){case 16:e:{var o=i.pendingProps;if(n=ia(i.elementType),i.type=n,typeof n=="function")Ju(n)?(o=oa(n,o),i.tag=1,i=Mg(null,i,n,o,s)):(i.tag=0,i=Hd(null,i,n,o,s));else{if(n!=null){var f=n.$$typeof;if(f===A){i.tag=11,i=kg(null,i,n,o,s);break e}else if(f===W){i.tag=14,i=Tg(null,i,n,o,s);break e}}throw i=le(n)||n,Error(a(306,i,""))}}return i;case 0:return Hd(n,i,i.type,i.pendingProps,s);case 1:return o=i.type,f=oa(o,i.pendingProps),Mg(n,i,o,f,s);case 3:e:{if(ge(i,i.stateNode.containerInfo),n===null)throw Error(a(387));o=i.pendingProps;var g=i.memoizedState;f=g.element,pd(n,i),ll(i,o,null,s);var E=i.memoizedState;if(o=E.cache,hi(i,Ut,o),o!==g.cache&&od(i,[Ut],s,!0),sl(),o=E.element,g.isDehydrated)if(g={element:o,isDehydrated:!1,cache:E.cache},i.updateQueue.baseState=g,i.memoizedState=g,i.flags&256){i=Ig(n,i,o,s);break e}else if(o!==f){f=Fn(Error(a(424)),i),el(f),i=Ig(n,i,o,s);break e}else{switch(n=i.stateNode.containerInfo,n.nodeType){case 9:n=n.body;break;default:n=n.nodeName==="HTML"?n.ownerDocument.body:n}for(Et=Vn(n.firstChild),Yt=i,Xe=!0,di=null,Kn=!0,s=Cm(i,null,o,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(ea(),o===f){i=jr(n,i,s);break e}Xt(n,i,o,s)}i=i.child}return i;case 26:return lc(n,i),n===null?(s=Yb(i.type,null,i.pendingProps,null))?i.memoizedState=s:Xe||(s=i.type,n=i.pendingProps,o=wc(q.current).createElement(s),o[It]=i,o[Jt]=n,Zt(o,s,n),jt(o),i.stateNode=o):i.memoizedState=Yb(i.type,n.memoizedProps,i.pendingProps,n.memoizedState),null;case 27:return Ie(i),n===null&&Xe&&(o=i.stateNode=Kb(i.type,i.pendingProps,q.current),Yt=i,Kn=!0,f=Et,Ti(i.type)?(Cf=f,Et=Vn(o.firstChild)):Et=f),Xt(n,i,i.pendingProps.children,s),lc(n,i),n===null&&(i.flags|=4194304),i.child;case 5:return n===null&&Xe&&((f=o=Et)&&(o=wS(o,i.type,i.pendingProps,Kn),o!==null?(i.stateNode=o,Yt=i,Et=Vn(o.firstChild),Kn=!1,f=!0):f=!1),f||fi(i)),Ie(i),f=i.type,g=i.pendingProps,E=n!==null?n.memoizedProps:null,o=g.children,Sf(f,g)?o=null:E!==null&&Sf(f,E)&&(i.flags|=32),i.memoizedState!==null&&(f=Ed(n,i,U_,null,null,s),Nl._currentValue=f),lc(n,i),Xt(n,i,o,s),i.child;case 6:return n===null&&Xe&&((n=s=Et)&&(s=kS(s,i.pendingProps,Kn),s!==null?(i.stateNode=s,Yt=i,Et=null,n=!0):n=!1),n||fi(i)),null;case 13:return Dg(n,i,s);case 4:return ge(i,i.stateNode.containerInfo),o=i.pendingProps,n===null?i.child=sa(i,null,o,s):Xt(n,i,o,s),i.child;case 11:return kg(n,i,i.type,i.pendingProps,s);case 7:return Xt(n,i,i.pendingProps,s),i.child;case 8:return Xt(n,i,i.pendingProps.children,s),i.child;case 12:return Xt(n,i,i.pendingProps.children,s),i.child;case 10:return o=i.pendingProps,hi(i,i.type,o.value),Xt(n,i,o.children,s),i.child;case 9:return f=i.type._context,o=i.pendingProps.children,na(i),f=Wt(f),o=o(f),i.flags|=1,Xt(n,i,o,s),i.child;case 14:return Tg(n,i,i.type,i.pendingProps,s);case 15:return Ng(n,i,i.type,i.pendingProps,s);case 19:return zg(n,i,s);case 31:return V_(n,i,s);case 22:return Cg(n,i,s,i.pendingProps);case 24:return na(i),o=Wt(Ut),n===null?(f=dd(),f===null&&(f=pt,g=cd(),f.pooledCache=g,g.refCount++,g!==null&&(f.pooledCacheLanes|=s),f=g),i.memoizedState={parent:o,cache:f},hd(i),hi(i,Ut,f)):((n.lanes&s)!==0&&(pd(n,i),ll(i,null,null,s),sl()),f=n.memoizedState,g=i.memoizedState,f.parent!==o?(f={parent:o,cache:o},i.memoizedState=f,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=f),hi(i,Ut,o)):(o=g.cache,hi(i,Ut,o),o!==f.cache&&od(i,[Ut],s,!0))),Xt(n,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function Br(n){n.flags|=4}function Wd(n,i,s,o,f){if((i=(n.mode&32)!==0)&&(i=!1),i){if(n.flags|=16777216,(f&335544128)===f)if(n.stateNode.complete)n.flags|=8192;else if(ub())n.flags|=8192;else throw aa=qo,fd}else n.flags&=-16777217}function Bg(n,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!Jb(i))if(ub())n.flags|=8192;else throw aa=qo,fd}function cc(n,i){i!==null&&(n.flags|=4),n.flags&16384&&(i=n.tag!==22?De():536870912,n.lanes|=i,es|=i)}function hl(n,i){if(!Xe)switch(n.tailMode){case"hidden":i=n.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?n.tail=null:s.sibling=null;break;case"collapsed":s=n.tail;for(var o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?i||n.tail===null?n.tail=null:n.tail.sibling=null:o.sibling=null}}function _t(n){var i=n.alternate!==null&&n.alternate.child===n.child,s=0,o=0;if(i)for(var f=n.child;f!==null;)s|=f.lanes|f.childLanes,o|=f.subtreeFlags&65011712,o|=f.flags&65011712,f.return=n,f=f.sibling;else for(f=n.child;f!==null;)s|=f.lanes|f.childLanes,o|=f.subtreeFlags,o|=f.flags,f.return=n,f=f.sibling;return n.subtreeFlags|=o,n.childLanes=s,i}function W_(n,i,s){var o=i.pendingProps;switch(rd(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _t(i),null;case 1:return _t(i),null;case 3:return s=i.stateNode,o=null,n!==null&&(o=n.memoizedState.cache),i.memoizedState.cache!==o&&(i.flags|=2048),Dr(Ut),xe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(n===null||n.child===null)&&(Ha(i)?Br(i):n===null||n.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,ad())),_t(i),null;case 26:var f=i.type,g=i.memoizedState;return n===null?(Br(i),g!==null?(_t(i),Bg(i,g)):(_t(i),Wd(i,f,null,o,s))):g?g!==n.memoizedState?(Br(i),_t(i),Bg(i,g)):(_t(i),i.flags&=-16777217):(n=n.memoizedProps,n!==o&&Br(i),_t(i),Wd(i,f,n,o,s)),null;case 27:if(St(i),s=q.current,f=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==o&&Br(i);else{if(!o){if(i.stateNode===null)throw Error(a(166));return _t(i),null}n=de.current,Ha(i)?bm(i):(n=Kb(f,o,s),i.stateNode=n,Br(i))}return _t(i),null;case 5:if(St(i),f=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==o&&Br(i);else{if(!o){if(i.stateNode===null)throw Error(a(166));return _t(i),null}if(g=de.current,Ha(i))bm(i);else{var E=wc(q.current);switch(g){case 1:g=E.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:g=E.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":g=E.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":g=E.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":g=E.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof o.is=="string"?E.createElement("select",{is:o.is}):E.createElement("select"),o.multiple?g.multiple=!0:o.size&&(g.size=o.size);break;default:g=typeof o.is=="string"?E.createElement(f,{is:o.is}):E.createElement(f)}}g[It]=i,g[Jt]=o;e:for(E=i.child;E!==null;){if(E.tag===5||E.tag===6)g.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===i)break e;for(;E.sibling===null;){if(E.return===null||E.return===i)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}i.stateNode=g;e:switch(Zt(g,f,o),f){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&Br(i)}}return _t(i),Wd(i,i.type,n===null?null:n.memoizedProps,i.pendingProps,s),null;case 6:if(n&&i.stateNode!=null)n.memoizedProps!==o&&Br(i);else{if(typeof o!="string"&&i.stateNode===null)throw Error(a(166));if(n=q.current,Ha(i)){if(n=i.stateNode,s=i.memoizedProps,o=null,f=Yt,f!==null)switch(f.tag){case 27:case 5:o=f.memoizedProps}n[It]=i,n=!!(n.nodeValue===s||o!==null&&o.suppressHydrationWarning===!0||Db(n.nodeValue,s)),n||fi(i,!0)}else n=wc(n).createTextNode(o),n[It]=i,i.stateNode=n}return _t(i),null;case 31:if(s=i.memoizedState,n===null||n.memoizedState!==null){if(o=Ha(i),s!==null){if(n===null){if(!o)throw Error(a(318));if(n=i.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(557));n[It]=i}else ea(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;_t(i),n=!1}else s=ad(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=s),n=!0;if(!n)return i.flags&256?(Mn(i),i):(Mn(i),null);if((i.flags&128)!==0)throw Error(a(558))}return _t(i),null;case 13:if(o=i.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(f=Ha(i),o!==null&&o.dehydrated!==null){if(n===null){if(!f)throw Error(a(318));if(f=i.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(a(317));f[It]=i}else ea(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;_t(i),f=!1}else f=ad(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=f),f=!0;if(!f)return i.flags&256?(Mn(i),i):(Mn(i),null)}return Mn(i),(i.flags&128)!==0?(i.lanes=s,i):(s=o!==null,n=n!==null&&n.memoizedState!==null,s&&(o=i.child,f=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(f=o.alternate.memoizedState.cachePool.pool),g=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(g=o.memoizedState.cachePool.pool),g!==f&&(o.flags|=2048)),s!==n&&s&&(i.child.flags|=8192),cc(i,i.updateQueue),_t(i),null);case 4:return xe(),n===null&&yf(i.stateNode.containerInfo),_t(i),null;case 10:return Dr(i.type),_t(i),null;case 19:if(G(Lt),o=i.memoizedState,o===null)return _t(i),null;if(f=(i.flags&128)!==0,g=o.rendering,g===null)if(f)hl(o,!1);else{if(Rt!==0||n!==null&&(n.flags&128)!==0)for(n=i.child;n!==null;){if(g=Xo(n),g!==null){for(i.flags|=128,hl(o,!1),n=g.updateQueue,i.updateQueue=n,cc(i,n),i.subtreeFlags=0,n=s,s=i.child;s!==null;)fm(s,n),s=s.sibling;return N(Lt,Lt.current&1|2),Xe&&Mr(i,o.treeForkCount),i.child}n=n.sibling}o.tail!==null&&Tt()>pc&&(i.flags|=128,f=!0,hl(o,!1),i.lanes=4194304)}else{if(!f)if(n=Xo(g),n!==null){if(i.flags|=128,f=!0,n=n.updateQueue,i.updateQueue=n,cc(i,n),hl(o,!0),o.tail===null&&o.tailMode==="hidden"&&!g.alternate&&!Xe)return _t(i),null}else 2*Tt()-o.renderingStartTime>pc&&s!==536870912&&(i.flags|=128,f=!0,hl(o,!1),i.lanes=4194304);o.isBackwards?(g.sibling=i.child,i.child=g):(n=o.last,n!==null?n.sibling=g:i.child=g,o.last=g)}return o.tail!==null?(n=o.tail,o.rendering=n,o.tail=n.sibling,o.renderingStartTime=Tt(),n.sibling=null,s=Lt.current,N(Lt,f?s&1|2:s&1),Xe&&Mr(i,o.treeForkCount),n):(_t(i),null);case 22:case 23:return Mn(i),yd(),o=i.memoizedState!==null,n!==null?n.memoizedState!==null!==o&&(i.flags|=8192):o&&(i.flags|=8192),o?(s&536870912)!==0&&(i.flags&128)===0&&(_t(i),i.subtreeFlags&6&&(i.flags|=8192)):_t(i),s=i.updateQueue,s!==null&&cc(i,s.retryQueue),s=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),o=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),o!==s&&(i.flags|=2048),n!==null&&G(ra),null;case 24:return s=null,n!==null&&(s=n.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),Dr(Ut),_t(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function X_(n,i){switch(rd(i),i.tag){case 1:return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 3:return Dr(Ut),xe(),n=i.flags,(n&65536)!==0&&(n&128)===0?(i.flags=n&-65537|128,i):null;case 26:case 27:case 5:return St(i),null;case 31:if(i.memoizedState!==null){if(Mn(i),i.alternate===null)throw Error(a(340));ea()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 13:if(Mn(i),n=i.memoizedState,n!==null&&n.dehydrated!==null){if(i.alternate===null)throw Error(a(340));ea()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 19:return G(Lt),null;case 4:return xe(),null;case 10:return Dr(i.type),null;case 22:case 23:return Mn(i),yd(),n!==null&&G(ra),n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 24:return Dr(Ut),null;case 25:return null;default:return null}}function Ug(n,i){switch(rd(i),i.tag){case 3:Dr(Ut),xe();break;case 26:case 27:case 5:St(i);break;case 4:xe();break;case 31:i.memoizedState!==null&&Mn(i);break;case 13:Mn(i);break;case 19:G(Lt);break;case 10:Dr(i.type);break;case 22:case 23:Mn(i),yd(),n!==null&&G(ra);break;case 24:Dr(Ut)}}function pl(n,i){try{var s=i.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var f=o.next;s=f;do{if((s.tag&n)===n){o=void 0;var g=s.create,E=s.inst;o=g(),E.destroy=o}s=s.next}while(s!==f)}}catch(k){lt(i,i.return,k)}}function vi(n,i,s){try{var o=i.updateQueue,f=o!==null?o.lastEffect:null;if(f!==null){var g=f.next;o=g;do{if((o.tag&n)===n){var E=o.inst,k=E.destroy;if(k!==void 0){E.destroy=void 0,f=i;var L=s,Y=k;try{Y()}catch(re){lt(f,L,re)}}}o=o.next}while(o!==g)}}catch(re){lt(i,i.return,re)}}function Pg(n){var i=n.updateQueue;if(i!==null){var s=n.stateNode;try{Om(i,s)}catch(o){lt(n,n.return,o)}}}function Hg(n,i,s){s.props=oa(n.type,n.memoizedProps),s.state=n.memoizedState;try{s.componentWillUnmount()}catch(o){lt(n,i,o)}}function ml(n,i){try{var s=n.ref;if(s!==null){switch(n.tag){case 26:case 27:case 5:var o=n.stateNode;break;case 30:o=n.stateNode;break;default:o=n.stateNode}typeof s=="function"?n.refCleanup=s(o):s.current=o}}catch(f){lt(n,i,f)}}function pr(n,i){var s=n.ref,o=n.refCleanup;if(s!==null)if(typeof o=="function")try{o()}catch(f){lt(n,i,f)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(f){lt(n,i,f)}else s.current=null}function Fg(n){var i=n.type,s=n.memoizedProps,o=n.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":s.autoFocus&&o.focus();break e;case"img":s.src?o.src=s.src:s.srcSet&&(o.srcset=s.srcSet)}}catch(f){lt(n,n.return,f)}}function Xd(n,i,s){try{var o=n.stateNode;yS(o,n.type,s,i),o[Jt]=i}catch(f){lt(n,n.return,f)}}function $g(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Ti(n.type)||n.tag===4}function Zd(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||$g(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&Ti(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Qd(n,i,s){var o=n.tag;if(o===5||o===6)n=n.stateNode,i?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(n,i):(i=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,i.appendChild(n),s=s._reactRootContainer,s!=null||i.onclick!==null||(i.onclick=ye));else if(o!==4&&(o===27&&Ti(n.type)&&(s=n.stateNode,i=null),n=n.child,n!==null))for(Qd(n,i,s),n=n.sibling;n!==null;)Qd(n,i,s),n=n.sibling}function uc(n,i,s){var o=n.tag;if(o===5||o===6)n=n.stateNode,i?s.insertBefore(n,i):s.appendChild(n);else if(o!==4&&(o===27&&Ti(n.type)&&(s=n.stateNode),n=n.child,n!==null))for(uc(n,i,s),n=n.sibling;n!==null;)uc(n,i,s),n=n.sibling}function Gg(n){var i=n.stateNode,s=n.memoizedProps;try{for(var o=n.type,f=i.attributes;f.length;)i.removeAttributeNode(f[0]);Zt(i,o,s),i[It]=n,i[Jt]=s}catch(g){lt(n,n.return,g)}}var Ur=!1,Ft=!1,Jd=!1,Kg=typeof WeakSet=="function"?WeakSet:Set,Kt=null;function Z_(n,i){if(n=n.containerInfo,Ef=Rc,n=rm(n),qu(n)){if("selectionStart"in n)var s={start:n.selectionStart,end:n.selectionEnd};else e:{s=(s=n.ownerDocument)&&s.defaultView||window;var o=s.getSelection&&s.getSelection();if(o&&o.rangeCount!==0){s=o.anchorNode;var f=o.anchorOffset,g=o.focusNode;o=o.focusOffset;try{s.nodeType,g.nodeType}catch{s=null;break e}var E=0,k=-1,L=-1,Y=0,re=0,oe=n,Z=null;t:for(;;){for(var J;oe!==s||f!==0&&oe.nodeType!==3||(k=E+f),oe!==g||o!==0&&oe.nodeType!==3||(L=E+o),oe.nodeType===3&&(E+=oe.nodeValue.length),(J=oe.firstChild)!==null;)Z=oe,oe=J;for(;;){if(oe===n)break t;if(Z===s&&++Y===f&&(k=E),Z===g&&++re===o&&(L=E),(J=oe.nextSibling)!==null)break;oe=Z,Z=oe.parentNode}oe=J}s=k===-1||L===-1?null:{start:k,end:L}}else s=null}s=s||{start:0,end:0}}else s=null;for(_f={focusedElem:n,selectionRange:s},Rc=!1,Kt=i;Kt!==null;)if(i=Kt,n=i.child,(i.subtreeFlags&1028)!==0&&n!==null)n.return=i,Kt=n;else for(;Kt!==null;){switch(i=Kt,g=i.alternate,n=i.flags,i.tag){case 0:if((n&4)!==0&&(n=i.updateQueue,n=n!==null?n.events:null,n!==null))for(s=0;s<n.length;s++)f=n[s],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&g!==null){n=void 0,s=i,f=g.memoizedProps,g=g.memoizedState,o=s.stateNode;try{var _e=oa(s.type,f);n=o.getSnapshotBeforeUpdate(_e,g),o.__reactInternalSnapshotBeforeUpdate=n}catch(Oe){lt(s,s.return,Oe)}}break;case 3:if((n&1024)!==0){if(n=i.stateNode.containerInfo,s=n.nodeType,s===9)kf(n);else if(s===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":kf(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(a(163))}if(n=i.sibling,n!==null){n.return=i.return,Kt=n;break}Kt=i.return}}function qg(n,i,s){var o=s.flags;switch(s.tag){case 0:case 11:case 15:Hr(n,s),o&4&&pl(5,s);break;case 1:if(Hr(n,s),o&4)if(n=s.stateNode,i===null)try{n.componentDidMount()}catch(E){lt(s,s.return,E)}else{var f=oa(s.type,i.memoizedProps);i=i.memoizedState;try{n.componentDidUpdate(f,i,n.__reactInternalSnapshotBeforeUpdate)}catch(E){lt(s,s.return,E)}}o&64&&Pg(s),o&512&&ml(s,s.return);break;case 3:if(Hr(n,s),o&64&&(n=s.updateQueue,n!==null)){if(i=null,s.child!==null)switch(s.child.tag){case 27:case 5:i=s.child.stateNode;break;case 1:i=s.child.stateNode}try{Om(n,i)}catch(E){lt(s,s.return,E)}}break;case 27:i===null&&o&4&&Gg(s);case 26:case 5:Hr(n,s),i===null&&o&4&&Fg(s),o&512&&ml(s,s.return);break;case 12:Hr(n,s);break;case 31:Hr(n,s),o&4&&Wg(n,s);break;case 13:Hr(n,s),o&4&&Xg(n,s),o&64&&(n=s.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(s=sS.bind(null,s),TS(n,s))));break;case 22:if(o=s.memoizedState!==null||Ur,!o){i=i!==null&&i.memoizedState!==null||Ft,f=Ur;var g=Ft;Ur=o,(Ft=i)&&!g?Fr(n,s,(s.subtreeFlags&8772)!==0):Hr(n,s),Ur=f,Ft=g}break;case 30:break;default:Hr(n,s)}}function Vg(n){var i=n.alternate;i!==null&&(n.alternate=null,Vg(i)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(i=n.stateNode,i!==null&&Us(i)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var kt=null,vn=!1;function Pr(n,i,s){for(s=s.child;s!==null;)Yg(n,i,s),s=s.sibling}function Yg(n,i,s){if(At&&typeof At.onCommitFiberUnmount=="function")try{At.onCommitFiberUnmount(qt,s)}catch{}switch(s.tag){case 26:Ft||pr(s,i),Pr(n,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Ft||pr(s,i);var o=kt,f=vn;Ti(s.type)&&(kt=s.stateNode,vn=!1),Pr(n,i,s),wl(s.stateNode),kt=o,vn=f;break;case 5:Ft||pr(s,i);case 6:if(o=kt,f=vn,kt=null,Pr(n,i,s),kt=o,vn=f,kt!==null)if(vn)try{(kt.nodeType===9?kt.body:kt.nodeName==="HTML"?kt.ownerDocument.body:kt).removeChild(s.stateNode)}catch(g){lt(s,i,g)}else try{kt.removeChild(s.stateNode)}catch(g){lt(s,i,g)}break;case 18:kt!==null&&(vn?(n=kt,Pb(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,s.stateNode),os(n)):Pb(kt,s.stateNode));break;case 4:o=kt,f=vn,kt=s.stateNode.containerInfo,vn=!0,Pr(n,i,s),kt=o,vn=f;break;case 0:case 11:case 14:case 15:vi(2,s,i),Ft||vi(4,s,i),Pr(n,i,s);break;case 1:Ft||(pr(s,i),o=s.stateNode,typeof o.componentWillUnmount=="function"&&Hg(s,i,o)),Pr(n,i,s);break;case 21:Pr(n,i,s);break;case 22:Ft=(o=Ft)||s.memoizedState!==null,Pr(n,i,s),Ft=o;break;default:Pr(n,i,s)}}function Wg(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{os(n)}catch(s){lt(i,i.return,s)}}}function Xg(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{os(n)}catch(s){lt(i,i.return,s)}}function Q_(n){switch(n.tag){case 31:case 13:case 19:var i=n.stateNode;return i===null&&(i=n.stateNode=new Kg),i;case 22:return n=n.stateNode,i=n._retryCache,i===null&&(i=n._retryCache=new Kg),i;default:throw Error(a(435,n.tag))}}function dc(n,i){var s=Q_(n);i.forEach(function(o){if(!s.has(o)){s.add(o);var f=lS.bind(null,n,o);o.then(f,f)}})}function xn(n,i){var s=i.deletions;if(s!==null)for(var o=0;o<s.length;o++){var f=s[o],g=n,E=i,k=E;e:for(;k!==null;){switch(k.tag){case 27:if(Ti(k.type)){kt=k.stateNode,vn=!1;break e}break;case 5:kt=k.stateNode,vn=!1;break e;case 3:case 4:kt=k.stateNode.containerInfo,vn=!0;break e}k=k.return}if(kt===null)throw Error(a(160));Yg(g,E,f),kt=null,vn=!1,g=f.alternate,g!==null&&(g.return=null),f.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Zg(i,n),i=i.sibling}var tr=null;function Zg(n,i){var s=n.alternate,o=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:xn(i,n),En(n),o&4&&(vi(3,n,n.return),pl(3,n),vi(5,n,n.return));break;case 1:xn(i,n),En(n),o&512&&(Ft||s===null||pr(s,s.return)),o&64&&Ur&&(n=n.updateQueue,n!==null&&(o=n.callbacks,o!==null&&(s=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=s===null?o:s.concat(o))));break;case 26:var f=tr;if(xn(i,n),En(n),o&512&&(Ft||s===null||pr(s,s.return)),o&4){var g=s!==null?s.memoizedState:null;if(o=n.memoizedState,s===null)if(o===null)if(n.stateNode===null){e:{o=n.type,s=n.memoizedProps,f=f.ownerDocument||f;t:switch(o){case"title":g=f.getElementsByTagName("title")[0],(!g||g[qi]||g[It]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=f.createElement(o),f.head.insertBefore(g,f.querySelector("head > title"))),Zt(g,o,s),g[It]=n,jt(g),o=g;break e;case"link":var E=Zb("link","href",f).get(o+(s.href||""));if(E){for(var k=0;k<E.length;k++)if(g=E[k],g.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&g.getAttribute("rel")===(s.rel==null?null:s.rel)&&g.getAttribute("title")===(s.title==null?null:s.title)&&g.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){E.splice(k,1);break t}}g=f.createElement(o),Zt(g,o,s),f.head.appendChild(g);break;case"meta":if(E=Zb("meta","content",f).get(o+(s.content||""))){for(k=0;k<E.length;k++)if(g=E[k],g.getAttribute("content")===(s.content==null?null:""+s.content)&&g.getAttribute("name")===(s.name==null?null:s.name)&&g.getAttribute("property")===(s.property==null?null:s.property)&&g.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&g.getAttribute("charset")===(s.charSet==null?null:s.charSet)){E.splice(k,1);break t}}g=f.createElement(o),Zt(g,o,s),f.head.appendChild(g);break;default:throw Error(a(468,o))}g[It]=n,jt(g),o=g}n.stateNode=o}else Qb(f,n.type,n.stateNode);else n.stateNode=Xb(f,o,n.memoizedProps);else g!==o?(g===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):g.count--,o===null?Qb(f,n.type,n.stateNode):Xb(f,o,n.memoizedProps)):o===null&&n.stateNode!==null&&Xd(n,n.memoizedProps,s.memoizedProps)}break;case 27:xn(i,n),En(n),o&512&&(Ft||s===null||pr(s,s.return)),s!==null&&o&4&&Xd(n,n.memoizedProps,s.memoizedProps);break;case 5:if(xn(i,n),En(n),o&512&&(Ft||s===null||pr(s,s.return)),n.flags&32){f=n.stateNode;try{Re(f,"")}catch(_e){lt(n,n.return,_e)}}o&4&&n.stateNode!=null&&(f=n.memoizedProps,Xd(n,f,s!==null?s.memoizedProps:f)),o&1024&&(Jd=!0);break;case 6:if(xn(i,n),En(n),o&4){if(n.stateNode===null)throw Error(a(162));o=n.memoizedProps,s=n.stateNode;try{s.nodeValue=o}catch(_e){lt(n,n.return,_e)}}break;case 3:if(Nc=null,f=tr,tr=kc(i.containerInfo),xn(i,n),tr=f,En(n),o&4&&s!==null&&s.memoizedState.isDehydrated)try{os(i.containerInfo)}catch(_e){lt(n,n.return,_e)}Jd&&(Jd=!1,Qg(n));break;case 4:o=tr,tr=kc(n.stateNode.containerInfo),xn(i,n),En(n),tr=o;break;case 12:xn(i,n),En(n);break;case 31:xn(i,n),En(n),o&4&&(o=n.updateQueue,o!==null&&(n.updateQueue=null,dc(n,o)));break;case 13:xn(i,n),En(n),n.child.flags&8192&&n.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(hc=Tt()),o&4&&(o=n.updateQueue,o!==null&&(n.updateQueue=null,dc(n,o)));break;case 22:f=n.memoizedState!==null;var L=s!==null&&s.memoizedState!==null,Y=Ur,re=Ft;if(Ur=Y||f,Ft=re||L,xn(i,n),Ft=re,Ur=Y,En(n),o&8192)e:for(i=n.stateNode,i._visibility=f?i._visibility&-2:i._visibility|1,f&&(s===null||L||Ur||Ft||ca(n)),s=null,i=n;;){if(i.tag===5||i.tag===26){if(s===null){L=s=i;try{if(g=L.stateNode,f)E=g.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{k=L.stateNode;var oe=L.memoizedProps.style,Z=oe!=null&&oe.hasOwnProperty("display")?oe.display:null;k.style.display=Z==null||typeof Z=="boolean"?"":(""+Z).trim()}}catch(_e){lt(L,L.return,_e)}}}else if(i.tag===6){if(s===null){L=i;try{L.stateNode.nodeValue=f?"":L.memoizedProps}catch(_e){lt(L,L.return,_e)}}}else if(i.tag===18){if(s===null){L=i;try{var J=L.stateNode;f?Hb(J,!0):Hb(L.stateNode,!1)}catch(_e){lt(L,L.return,_e)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===n)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break e;for(;i.sibling===null;){if(i.return===null||i.return===n)break e;s===i&&(s=null),i=i.return}s===i&&(s=null),i.sibling.return=i.return,i=i.sibling}o&4&&(o=n.updateQueue,o!==null&&(s=o.retryQueue,s!==null&&(o.retryQueue=null,dc(n,s))));break;case 19:xn(i,n),En(n),o&4&&(o=n.updateQueue,o!==null&&(n.updateQueue=null,dc(n,o)));break;case 30:break;case 21:break;default:xn(i,n),En(n)}}function En(n){var i=n.flags;if(i&2){try{for(var s,o=n.return;o!==null;){if($g(o)){s=o;break}o=o.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var f=s.stateNode,g=Zd(n);uc(n,g,f);break;case 5:var E=s.stateNode;s.flags&32&&(Re(E,""),s.flags&=-33);var k=Zd(n);uc(n,k,E);break;case 3:case 4:var L=s.stateNode.containerInfo,Y=Zd(n);Qd(n,Y,L);break;default:throw Error(a(161))}}catch(re){lt(n,n.return,re)}n.flags&=-3}i&4096&&(n.flags&=-4097)}function Qg(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var i=n;Qg(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),n=n.sibling}}function Hr(n,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)qg(n,i.alternate,i),i=i.sibling}function ca(n){for(n=n.child;n!==null;){var i=n;switch(i.tag){case 0:case 11:case 14:case 15:vi(4,i,i.return),ca(i);break;case 1:pr(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&Hg(i,i.return,s),ca(i);break;case 27:wl(i.stateNode);case 26:case 5:pr(i,i.return),ca(i);break;case 22:i.memoizedState===null&&ca(i);break;case 30:ca(i);break;default:ca(i)}n=n.sibling}}function Fr(n,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var o=i.alternate,f=n,g=i,E=g.flags;switch(g.tag){case 0:case 11:case 15:Fr(f,g,s),pl(4,g);break;case 1:if(Fr(f,g,s),o=g,f=o.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(Y){lt(o,o.return,Y)}if(o=g,f=o.updateQueue,f!==null){var k=o.stateNode;try{var L=f.shared.hiddenCallbacks;if(L!==null)for(f.shared.hiddenCallbacks=null,f=0;f<L.length;f++)Am(L[f],k)}catch(Y){lt(o,o.return,Y)}}s&&E&64&&Pg(g),ml(g,g.return);break;case 27:Gg(g);case 26:case 5:Fr(f,g,s),s&&o===null&&E&4&&Fg(g),ml(g,g.return);break;case 12:Fr(f,g,s);break;case 31:Fr(f,g,s),s&&E&4&&Wg(f,g);break;case 13:Fr(f,g,s),s&&E&4&&Xg(f,g);break;case 22:g.memoizedState===null&&Fr(f,g,s),ml(g,g.return);break;case 30:break;default:Fr(f,g,s)}i=i.sibling}}function ef(n,i){var s=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),n=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(n=i.memoizedState.cachePool.pool),n!==s&&(n!=null&&n.refCount++,s!=null&&tl(s))}function tf(n,i){n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&tl(n))}function nr(n,i,s,o){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Jg(n,i,s,o),i=i.sibling}function Jg(n,i,s,o){var f=i.flags;switch(i.tag){case 0:case 11:case 15:nr(n,i,s,o),f&2048&&pl(9,i);break;case 1:nr(n,i,s,o);break;case 3:nr(n,i,s,o),f&2048&&(n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&tl(n)));break;case 12:if(f&2048){nr(n,i,s,o),n=i.stateNode;try{var g=i.memoizedProps,E=g.id,k=g.onPostCommit;typeof k=="function"&&k(E,i.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(L){lt(i,i.return,L)}}else nr(n,i,s,o);break;case 31:nr(n,i,s,o);break;case 13:nr(n,i,s,o);break;case 23:break;case 22:g=i.stateNode,E=i.alternate,i.memoizedState!==null?g._visibility&2?nr(n,i,s,o):gl(n,i):g._visibility&2?nr(n,i,s,o):(g._visibility|=2,Za(n,i,s,o,(i.subtreeFlags&10256)!==0||!1)),f&2048&&ef(E,i);break;case 24:nr(n,i,s,o),f&2048&&tf(i.alternate,i);break;default:nr(n,i,s,o)}}function Za(n,i,s,o,f){for(f=f&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var g=n,E=i,k=s,L=o,Y=E.flags;switch(E.tag){case 0:case 11:case 15:Za(g,E,k,L,f),pl(8,E);break;case 23:break;case 22:var re=E.stateNode;E.memoizedState!==null?re._visibility&2?Za(g,E,k,L,f):gl(g,E):(re._visibility|=2,Za(g,E,k,L,f)),f&&Y&2048&&ef(E.alternate,E);break;case 24:Za(g,E,k,L,f),f&&Y&2048&&tf(E.alternate,E);break;default:Za(g,E,k,L,f)}i=i.sibling}}function gl(n,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=n,o=i,f=o.flags;switch(o.tag){case 22:gl(s,o),f&2048&&ef(o.alternate,o);break;case 24:gl(s,o),f&2048&&tf(o.alternate,o);break;default:gl(s,o)}i=i.sibling}}var bl=8192;function Qa(n,i,s){if(n.subtreeFlags&bl)for(n=n.child;n!==null;)eb(n,i,s),n=n.sibling}function eb(n,i,s){switch(n.tag){case 26:Qa(n,i,s),n.flags&bl&&n.memoizedState!==null&&BS(s,tr,n.memoizedState,n.memoizedProps);break;case 5:Qa(n,i,s);break;case 3:case 4:var o=tr;tr=kc(n.stateNode.containerInfo),Qa(n,i,s),tr=o;break;case 22:n.memoizedState===null&&(o=n.alternate,o!==null&&o.memoizedState!==null?(o=bl,bl=16777216,Qa(n,i,s),bl=o):Qa(n,i,s));break;default:Qa(n,i,s)}}function tb(n){var i=n.alternate;if(i!==null&&(n=i.child,n!==null)){i.child=null;do i=n.sibling,n.sibling=null,n=i;while(n!==null)}}function yl(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var o=i[s];Kt=o,rb(o,n)}tb(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)nb(n),n=n.sibling}function nb(n){switch(n.tag){case 0:case 11:case 15:yl(n),n.flags&2048&&vi(9,n,n.return);break;case 3:yl(n);break;case 12:yl(n);break;case 22:var i=n.stateNode;n.memoizedState!==null&&i._visibility&2&&(n.return===null||n.return.tag!==13)?(i._visibility&=-3,fc(n)):yl(n);break;default:yl(n)}}function fc(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var o=i[s];Kt=o,rb(o,n)}tb(n)}for(n=n.child;n!==null;){switch(i=n,i.tag){case 0:case 11:case 15:vi(8,i,i.return),fc(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,fc(i));break;default:fc(i)}n=n.sibling}}function rb(n,i){for(;Kt!==null;){var s=Kt;switch(s.tag){case 0:case 11:case 15:vi(8,s,i);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var o=s.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:tl(s.memoizedState.cache)}if(o=s.child,o!==null)o.return=s,Kt=o;else e:for(s=n;Kt!==null;){o=Kt;var f=o.sibling,g=o.return;if(Vg(o),o===s){Kt=null;break e}if(f!==null){f.return=g,Kt=f;break e}Kt=g}}}var J_={getCacheForType:function(n){var i=Wt(Ut),s=i.data.get(n);return s===void 0&&(s=n(),i.data.set(n,s)),s},cacheSignal:function(){return Wt(Ut).controller.signal}},eS=typeof WeakMap=="function"?WeakMap:Map,tt=0,pt=null,$e=null,Ve=0,st=0,In=null,xi=!1,Ja=!1,nf=!1,$r=0,Rt=0,Ei=0,ua=0,rf=0,Dn=0,es=0,vl=null,_n=null,af=!1,hc=0,ib=0,pc=1/0,mc=null,_i=null,Gt=0,Si=null,ts=null,Gr=0,sf=0,lf=null,ab=null,xl=0,of=null;function Ln(){return(tt&2)!==0&&Ve!==0?Ve&-Ve:z.T!==null?pf():Na()}function sb(){if(Dn===0)if((Ve&536870912)===0||Xe){var n=Ta;Ta<<=1,(Ta&3932160)===0&&(Ta=262144),Dn=n}else Dn=536870912;return n=Rn.current,n!==null&&(n.flags|=32),Dn}function Sn(n,i,s){(n===pt&&(st===2||st===9)||n.cancelPendingCommit!==null)&&(ns(n,0),wi(n,Ve,Dn,!1)),ht(n,s),((tt&2)===0||n!==pt)&&(n===pt&&((tt&2)===0&&(ua|=s),Rt===4&&wi(n,Ve,Dn,!1)),mr(n))}function lb(n,i,s){if((tt&6)!==0)throw Error(a(327));var o=!s&&(i&127)===0&&(i&n.expiredLanes)===0||ae(n,i),f=o?rS(n,i):uf(n,i,!0),g=o;do{if(f===0){Ja&&!o&&wi(n,i,0,!1);break}else{if(s=n.current.alternate,g&&!tS(s)){f=uf(n,i,!1),g=!1;continue}if(f===2){if(g=i,n.errorRecoveryDisabledLanes&g)var E=0;else E=n.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){i=E;e:{var k=n;f=vl;var L=k.current.memoizedState.isDehydrated;if(L&&(ns(k,E).flags|=256),E=uf(k,E,!1),E!==2){if(nf&&!L){k.errorRecoveryDisabledLanes|=g,ua|=g,f=4;break e}g=_n,_n=f,g!==null&&(_n===null?_n=g:_n.push.apply(_n,g))}f=E}if(g=!1,f!==2)continue}}if(f===1){ns(n,0),wi(n,i,0,!0);break}e:{switch(o=n,g=f,g){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:wi(o,i,Dn,!xi);break e;case 2:_n=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(f=hc+300-Tt(),10<f)){if(wi(o,i,Dn,!xi),j(o,0,!0)!==0)break e;Gr=i,o.timeoutHandle=Bb(ob.bind(null,o,s,_n,mc,af,i,Dn,ua,es,xi,g,"Throttled",-0,0),f);break e}ob(o,s,_n,mc,af,i,Dn,ua,es,xi,g,null,-0,0)}}break}while(!0);mr(n)}function ob(n,i,s,o,f,g,E,k,L,Y,re,oe,Z,J){if(n.timeoutHandle=-1,oe=i.subtreeFlags,oe&8192||(oe&16785408)===16785408){oe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ye},eb(i,g,oe);var _e=(g&62914560)===g?hc-Tt():(g&4194048)===g?ib-Tt():0;if(_e=US(oe,_e),_e!==null){Gr=g,n.cancelPendingCommit=_e(gb.bind(null,n,i,g,s,o,f,E,k,L,re,oe,null,Z,J)),wi(n,g,E,!Y);return}}gb(n,i,g,s,o,f,E,k,L)}function tS(n){for(var i=n;;){var s=i.tag;if((s===0||s===11||s===15)&&i.flags&16384&&(s=i.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var o=0;o<s.length;o++){var f=s[o],g=f.getSnapshot;f=f.value;try{if(!An(g(),f))return!1}catch{return!1}}if(s=i.child,i.subtreeFlags&16384&&s!==null)s.return=i,i=s;else{if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function wi(n,i,s,o){i&=~rf,i&=~ua,n.suspendedLanes|=i,n.pingedLanes&=~i,o&&(n.warmLanes|=i),o=n.expirationTimes;for(var f=i;0<f;){var g=31-rt(f),E=1<<g;o[g]=-1,f&=~E}s!==0&&Ee(n,s,i)}function gc(){return(tt&6)===0?(El(0),!1):!0}function cf(){if($e!==null){if(st===0)var n=$e.return;else n=$e,Ir=ta=null,wd(n),qa=null,rl=0,n=$e;for(;n!==null;)Ug(n.alternate,n),n=n.return;$e=null}}function ns(n,i){var s=n.timeoutHandle;s!==-1&&(n.timeoutHandle=-1,ES(s)),s=n.cancelPendingCommit,s!==null&&(n.cancelPendingCommit=null,s()),Gr=0,cf(),pt=n,$e=s=Rr(n.current,null),Ve=i,st=0,In=null,xi=!1,Ja=ae(n,i),nf=!1,es=Dn=rf=ua=Ei=Rt=0,_n=vl=null,af=!1,(i&8)!==0&&(i|=i&32);var o=n.entangledLanes;if(o!==0)for(n=n.entanglements,o&=i;0<o;){var f=31-rt(o),g=1<<f;i|=n[f],o&=~g}return $r=i,jo(),s}function cb(n,i){Be=null,z.H=dl,i===Ka||i===Ko?(i=km(),st=3):i===fd?(i=km(),st=4):st=i===Pd?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,In=i,$e===null&&(Rt=1,ac(n,Fn(i,n.current)))}function ub(){var n=Rn.current;return n===null?!0:(Ve&4194048)===Ve?qn===null:(Ve&62914560)===Ve||(Ve&536870912)!==0?n===qn:!1}function db(){var n=z.H;return z.H=dl,n===null?dl:n}function fb(){var n=z.A;return z.A=J_,n}function bc(){Rt=4,xi||(Ve&4194048)!==Ve&&Rn.current!==null||(Ja=!0),(Ei&134217727)===0&&(ua&134217727)===0||pt===null||wi(pt,Ve,Dn,!1)}function uf(n,i,s){var o=tt;tt|=2;var f=db(),g=fb();(pt!==n||Ve!==i)&&(mc=null,ns(n,i)),i=!1;var E=Rt;e:do try{if(st!==0&&$e!==null){var k=$e,L=In;switch(st){case 8:cf(),E=6;break e;case 3:case 2:case 9:case 6:Rn.current===null&&(i=!0);var Y=st;if(st=0,In=null,rs(n,k,L,Y),s&&Ja){E=0;break e}break;default:Y=st,st=0,In=null,rs(n,k,L,Y)}}nS(),E=Rt;break}catch(re){cb(n,re)}while(!0);return i&&n.shellSuspendCounter++,Ir=ta=null,tt=o,z.H=f,z.A=g,$e===null&&(pt=null,Ve=0,jo()),E}function nS(){for(;$e!==null;)hb($e)}function rS(n,i){var s=tt;tt|=2;var o=db(),f=fb();pt!==n||Ve!==i?(mc=null,pc=Tt()+500,ns(n,i)):Ja=ae(n,i);e:do try{if(st!==0&&$e!==null){i=$e;var g=In;t:switch(st){case 1:st=0,In=null,rs(n,i,g,1);break;case 2:case 9:if(Sm(g)){st=0,In=null,pb(i);break}i=function(){st!==2&&st!==9||pt!==n||(st=7),mr(n)},g.then(i,i);break e;case 3:st=7;break e;case 4:st=5;break e;case 7:Sm(g)?(st=0,In=null,pb(i)):(st=0,In=null,rs(n,i,g,7));break;case 5:var E=null;switch($e.tag){case 26:E=$e.memoizedState;case 5:case 27:var k=$e;if(E?Jb(E):k.stateNode.complete){st=0,In=null;var L=k.sibling;if(L!==null)$e=L;else{var Y=k.return;Y!==null?($e=Y,yc(Y)):$e=null}break t}}st=0,In=null,rs(n,i,g,5);break;case 6:st=0,In=null,rs(n,i,g,6);break;case 8:cf(),Rt=6;break e;default:throw Error(a(462))}}iS();break}catch(re){cb(n,re)}while(!0);return Ir=ta=null,z.H=o,z.A=f,tt=s,$e!==null?0:(pt=null,Ve=0,jo(),Rt)}function iS(){for(;$e!==null&&!js();)hb($e)}function hb(n){var i=jg(n.alternate,n,$r);n.memoizedProps=n.pendingProps,i===null?yc(n):$e=i}function pb(n){var i=n,s=i.alternate;switch(i.tag){case 15:case 0:i=Rg(s,i,i.pendingProps,i.type,void 0,Ve);break;case 11:i=Rg(s,i,i.pendingProps,i.type.render,i.ref,Ve);break;case 5:wd(i);default:Ug(s,i),i=$e=fm(i,$r),i=jg(s,i,$r)}n.memoizedProps=n.pendingProps,i===null?yc(n):$e=i}function rs(n,i,s,o){Ir=ta=null,wd(i),qa=null,rl=0;var f=i.return;try{if(q_(n,f,i,s,Ve)){Rt=1,ac(n,Fn(s,n.current)),$e=null;return}}catch(g){if(f!==null)throw $e=f,g;Rt=1,ac(n,Fn(s,n.current)),$e=null;return}i.flags&32768?(Xe||o===1?n=!0:Ja||(Ve&536870912)!==0?n=!1:(xi=n=!0,(o===2||o===9||o===3||o===6)&&(o=Rn.current,o!==null&&o.tag===13&&(o.flags|=16384))),mb(i,n)):yc(i)}function yc(n){var i=n;do{if((i.flags&32768)!==0){mb(i,xi);return}n=i.return;var s=W_(i.alternate,i,$r);if(s!==null){$e=s;return}if(i=i.sibling,i!==null){$e=i;return}$e=i=n}while(i!==null);Rt===0&&(Rt=5)}function mb(n,i){do{var s=X_(n.alternate,n);if(s!==null){s.flags&=32767,$e=s;return}if(s=n.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(n=n.sibling,n!==null)){$e=n;return}$e=n=s}while(n!==null);Rt=6,$e=null}function gb(n,i,s,o,f,g,E,k,L){n.cancelPendingCommit=null;do vc();while(Gt!==0);if((tt&6)!==0)throw Error(a(327));if(i!==null){if(i===n.current)throw Error(a(177));if(g=i.lanes|i.childLanes,g|=Zu,Se(n,s,g,E,k,L),n===pt&&($e=pt=null,Ve=0),ts=i,Si=n,Gr=s,sf=g,lf=f,ab=o,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,oS(Ae,function(){return Eb(),null})):(n.callbackNode=null,n.callbackPriority=0),o=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||o){o=z.T,z.T=null,f=Q.p,Q.p=2,E=tt,tt|=4;try{Z_(n,i,s)}finally{tt=E,Q.p=f,z.T=o}}Gt=1,bb(),yb(),vb()}}function bb(){if(Gt===1){Gt=0;var n=Si,i=ts,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=z.T,z.T=null;var o=Q.p;Q.p=2;var f=tt;tt|=4;try{Zg(i,n);var g=_f,E=rm(n.containerInfo),k=g.focusedElem,L=g.selectionRange;if(E!==k&&k&&k.ownerDocument&&nm(k.ownerDocument.documentElement,k)){if(L!==null&&qu(k)){var Y=L.start,re=L.end;if(re===void 0&&(re=Y),"selectionStart"in k)k.selectionStart=Y,k.selectionEnd=Math.min(re,k.value.length);else{var oe=k.ownerDocument||document,Z=oe&&oe.defaultView||window;if(Z.getSelection){var J=Z.getSelection(),_e=k.textContent.length,Oe=Math.min(L.start,_e),dt=L.end===void 0?Oe:Math.min(L.end,_e);!J.extend&&Oe>dt&&(E=dt,dt=Oe,Oe=E);var $=tm(k,Oe),H=tm(k,dt);if($&&H&&(J.rangeCount!==1||J.anchorNode!==$.node||J.anchorOffset!==$.offset||J.focusNode!==H.node||J.focusOffset!==H.offset)){var V=oe.createRange();V.setStart($.node,$.offset),J.removeAllRanges(),Oe>dt?(J.addRange(V),J.extend(H.node,H.offset)):(V.setEnd(H.node,H.offset),J.addRange(V))}}}}for(oe=[],J=k;J=J.parentNode;)J.nodeType===1&&oe.push({element:J,left:J.scrollLeft,top:J.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<oe.length;k++){var se=oe[k];se.element.scrollLeft=se.left,se.element.scrollTop=se.top}}Rc=!!Ef,_f=Ef=null}finally{tt=f,Q.p=o,z.T=s}}n.current=i,Gt=2}}function yb(){if(Gt===2){Gt=0;var n=Si,i=ts,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=z.T,z.T=null;var o=Q.p;Q.p=2;var f=tt;tt|=4;try{qg(n,i.alternate,i)}finally{tt=f,Q.p=o,z.T=s}}Gt=3}}function vb(){if(Gt===4||Gt===3){Gt=0,wa();var n=Si,i=ts,s=Gr,o=ab;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Gt=5:(Gt=0,ts=Si=null,xb(n,n.pendingLanes));var f=n.pendingLanes;if(f===0&&(_i=null),Tr(s),i=i.stateNode,At&&typeof At.onCommitFiberRoot=="function")try{At.onCommitFiberRoot(qt,i,void 0,(i.current.flags&128)===128)}catch{}if(o!==null){i=z.T,f=Q.p,Q.p=2,z.T=null;try{for(var g=n.onRecoverableError,E=0;E<o.length;E++){var k=o[E];g(k.value,{componentStack:k.stack})}}finally{z.T=i,Q.p=f}}(Gr&3)!==0&&vc(),mr(n),f=n.pendingLanes,(s&261930)!==0&&(f&42)!==0?n===of?xl++:(xl=0,of=n):xl=0,El(0)}}function xb(n,i){(n.pooledCacheLanes&=i)===0&&(i=n.pooledCache,i!=null&&(n.pooledCache=null,tl(i)))}function vc(){return bb(),yb(),vb(),Eb()}function Eb(){if(Gt!==5)return!1;var n=Si,i=sf;sf=0;var s=Tr(Gr),o=z.T,f=Q.p;try{Q.p=32>s?32:s,z.T=null,s=lf,lf=null;var g=Si,E=Gr;if(Gt=0,ts=Si=null,Gr=0,(tt&6)!==0)throw Error(a(331));var k=tt;if(tt|=4,nb(g.current),Jg(g,g.current,E,s),tt=k,El(0,!1),At&&typeof At.onPostCommitFiberRoot=="function")try{At.onPostCommitFiberRoot(qt,g)}catch{}return!0}finally{Q.p=f,z.T=o,xb(n,i)}}function _b(n,i,s){i=Fn(s,i),i=Ud(n.stateNode,i,2),n=gi(n,i,2),n!==null&&(ht(n,2),mr(n))}function lt(n,i,s){if(n.tag===3)_b(n,n,s);else for(;i!==null;){if(i.tag===3){_b(i,n,s);break}else if(i.tag===1){var o=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(_i===null||!_i.has(o))){n=Fn(s,n),s=Sg(2),o=gi(i,s,2),o!==null&&(wg(s,o,i,n),ht(o,2),mr(o));break}}i=i.return}}function df(n,i,s){var o=n.pingCache;if(o===null){o=n.pingCache=new eS;var f=new Set;o.set(i,f)}else f=o.get(i),f===void 0&&(f=new Set,o.set(i,f));f.has(s)||(nf=!0,f.add(s),n=aS.bind(null,n,i,s),i.then(n,n))}function aS(n,i,s){var o=n.pingCache;o!==null&&o.delete(i),n.pingedLanes|=n.suspendedLanes&s,n.warmLanes&=~s,pt===n&&(Ve&s)===s&&(Rt===4||Rt===3&&(Ve&62914560)===Ve&&300>Tt()-hc?(tt&2)===0&&ns(n,0):rf|=s,es===Ve&&(es=0)),mr(n)}function Sb(n,i){i===0&&(i=De()),n=Qi(n,i),n!==null&&(ht(n,i),mr(n))}function sS(n){var i=n.memoizedState,s=0;i!==null&&(s=i.retryLane),Sb(n,s)}function lS(n,i){var s=0;switch(n.tag){case 31:case 13:var o=n.stateNode,f=n.memoizedState;f!==null&&(s=f.retryLane);break;case 19:o=n.stateNode;break;case 22:o=n.stateNode._retryCache;break;default:throw Error(a(314))}o!==null&&o.delete(i),Sb(n,s)}function oS(n,i){return kr(n,i)}var xc=null,is=null,ff=!1,Ec=!1,hf=!1,ki=0;function mr(n){n!==is&&n.next===null&&(is===null?xc=is=n:is=is.next=n),Ec=!0,ff||(ff=!0,uS())}function El(n,i){if(!hf&&Ec){hf=!0;do for(var s=!1,o=xc;o!==null;){if(n!==0){var f=o.pendingLanes;if(f===0)var g=0;else{var E=o.suspendedLanes,k=o.pingedLanes;g=(1<<31-rt(42|n)+1)-1,g&=f&~(E&~k),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(s=!0,Nb(o,g))}else g=Ve,g=j(o,o===pt?g:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(g&3)===0||ae(o,g)||(s=!0,Nb(o,g));o=o.next}while(s);hf=!1}}function cS(){wb()}function wb(){Ec=ff=!1;var n=0;ki!==0&&xS()&&(n=ki);for(var i=Tt(),s=null,o=xc;o!==null;){var f=o.next,g=kb(o,i);g===0?(o.next=null,s===null?xc=f:s.next=f,f===null&&(is=s)):(s=o,(n!==0||(g&3)!==0)&&(Ec=!0)),o=f}Gt!==0&&Gt!==5||El(n),ki!==0&&(ki=0)}function kb(n,i){for(var s=n.suspendedLanes,o=n.pingedLanes,f=n.expirationTimes,g=n.pendingLanes&-62914561;0<g;){var E=31-rt(g),k=1<<E,L=f[E];L===-1?((k&s)===0||(k&o)!==0)&&(f[E]=ve(k,i)):L<=i&&(n.expiredLanes|=k),g&=~k}if(i=pt,s=Ve,s=j(n,n===i?s:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),o=n.callbackNode,s===0||n===i&&(st===2||st===9)||n.cancelPendingCommit!==null)return o!==null&&o!==null&&$i(o),n.callbackNode=null,n.callbackPriority=0;if((s&3)===0||ae(n,s)){if(i=s&-s,i===n.callbackPriority)return i;switch(o!==null&&$i(o),Tr(s)){case 2:case 8:s=be;break;case 32:s=Ae;break;case 268435456:s=Qe;break;default:s=Ae}return o=Tb.bind(null,n),s=kr(s,o),n.callbackPriority=i,n.callbackNode=s,i}return o!==null&&o!==null&&$i(o),n.callbackPriority=2,n.callbackNode=null,2}function Tb(n,i){if(Gt!==0&&Gt!==5)return n.callbackNode=null,n.callbackPriority=0,null;var s=n.callbackNode;if(vc()&&n.callbackNode!==s)return null;var o=Ve;return o=j(n,n===pt?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),o===0?null:(lb(n,o,i),kb(n,Tt()),n.callbackNode!=null&&n.callbackNode===s?Tb.bind(null,n):null)}function Nb(n,i){if(vc())return null;lb(n,i,!0)}function uS(){_S(function(){(tt&6)!==0?kr(ne,cS):wb()})}function pf(){if(ki===0){var n=$a;n===0&&(n=Gi,Gi<<=1,(Gi&261888)===0&&(Gi=256)),ki=n}return ki}function Cb(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:oi(""+n)}function Ab(n,i){var s=i.ownerDocument.createElement("input");return s.name=i.name,s.value=i.value,n.id&&s.setAttribute("form",n.id),i.parentNode.insertBefore(s,i),n=new FormData(n),s.parentNode.removeChild(s),n}function dS(n,i,s,o,f){if(i==="submit"&&s&&s.stateNode===f){var g=Cb((f[Jt]||null).action),E=o.submitter;E&&(i=(i=E[Jt]||null)?Cb(i.formAction):E.getAttribute("formAction"),i!==null&&(g=i,E=null));var k=new Io("action","action",null,o,f);n.push({event:k,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(ki!==0){var L=E?Ab(f,E):new FormData(f);Id(s,{pending:!0,data:L,method:f.method,action:g},null,L)}}else typeof g=="function"&&(k.preventDefault(),L=E?Ab(f,E):new FormData(f),Id(s,{pending:!0,data:L,method:f.method,action:g},g,L))},currentTarget:f}]})}}for(var mf=0;mf<Xu.length;mf++){var gf=Xu[mf],fS=gf.toLowerCase(),hS=gf[0].toUpperCase()+gf.slice(1);er(fS,"on"+hS)}er(sm,"onAnimationEnd"),er(lm,"onAnimationIteration"),er(om,"onAnimationStart"),er("dblclick","onDoubleClick"),er("focusin","onFocus"),er("focusout","onBlur"),er(A_,"onTransitionRun"),er(O_,"onTransitionStart"),er(R_,"onTransitionCancel"),er(cm,"onTransitionEnd"),he("onMouseEnter",["mouseout","mouseover"]),he("onMouseLeave",["mouseout","mouseover"]),he("onPointerEnter",["pointerout","pointerover"]),he("onPointerLeave",["pointerout","pointerover"]),Cr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Cr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Cr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Cr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Cr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Cr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _l="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(" "),pS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(_l));function Ob(n,i){i=(i&4)!==0;for(var s=0;s<n.length;s++){var o=n[s],f=o.event;o=o.listeners;e:{var g=void 0;if(i)for(var E=o.length-1;0<=E;E--){var k=o[E],L=k.instance,Y=k.currentTarget;if(k=k.listener,L!==g&&f.isPropagationStopped())break e;g=k,f.currentTarget=Y;try{g(f)}catch(re){zo(re)}f.currentTarget=null,g=L}else for(E=0;E<o.length;E++){if(k=o[E],L=k.instance,Y=k.currentTarget,k=k.listener,L!==g&&f.isPropagationStopped())break e;g=k,f.currentTarget=Y;try{g(f)}catch(re){zo(re)}f.currentTarget=null,g=L}}}}function Ge(n,i){var s=i[Bs];s===void 0&&(s=i[Bs]=new Set);var o=n+"__bubble";s.has(o)||(Rb(i,n,2,!1),s.add(o))}function bf(n,i,s){var o=0;i&&(o|=4),Rb(s,n,o,i)}var _c="_reactListening"+Math.random().toString(36).slice(2);function yf(n){if(!n[_c]){n[_c]=!0,ko.forEach(function(s){s!=="selectionchange"&&(pS.has(s)||bf(s,!1,n),bf(s,!0,n))});var i=n.nodeType===9?n:n.ownerDocument;i===null||i[_c]||(i[_c]=!0,bf("selectionchange",!1,i))}}function Rb(n,i,s,o){switch(sy(i)){case 2:var f=FS;break;case 8:f=$S;break;default:f=If}s=f.bind(null,i,s,n),f=void 0,!ju||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(f=!0),o?f!==void 0?n.addEventListener(i,s,{capture:!0,passive:f}):n.addEventListener(i,s,!0):f!==void 0?n.addEventListener(i,s,{passive:f}):n.addEventListener(i,s,!1)}function vf(n,i,s,o,f){var g=o;if((i&1)===0&&(i&2)===0&&o!==null)e:for(;;){if(o===null)return;var E=o.tag;if(E===3||E===4){var k=o.stateNode.containerInfo;if(k===f)break;if(E===4)for(E=o.return;E!==null;){var L=E.tag;if((L===3||L===4)&&E.stateNode.containerInfo===f)return;E=E.return}for(;k!==null;){if(E=ln(k),E===null)return;if(L=E.tag,L===5||L===6||L===26||L===27){o=g=E;continue e}k=k.parentNode}}o=o.return}Ao(function(){var Y=g,re=je(s),oe=[];e:{var Z=um.get(n);if(Z!==void 0){var J=Io,_e=n;switch(n){case"keypress":if(Ro(s)===0)break e;case"keydown":case"keyup":J=l_;break;case"focusin":_e="focus",J=Hu;break;case"focusout":_e="blur",J=Hu;break;case"beforeblur":case"afterblur":J=Hu;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":J=Up;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":J=WE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":J=u_;break;case sm:case lm:case om:J=QE;break;case cm:J=f_;break;case"scroll":case"scrollend":J=VE;break;case"wheel":J=p_;break;case"copy":case"cut":case"paste":J=e_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":J=Hp;break;case"toggle":case"beforetoggle":J=g_}var Oe=(i&4)!==0,dt=!Oe&&(n==="scroll"||n==="scrollend"),$=Oe?Z!==null?Z+"Capture":null:Z;Oe=[];for(var H=Y,V;H!==null;){var se=H;if(V=se.stateNode,se=se.tag,se!==5&&se!==26&&se!==27||V===null||$===null||(se=Gs(H,$),se!=null&&Oe.push(Sl(H,se,V))),dt)break;H=H.return}0<Oe.length&&(Z=new J(Z,_e,null,s,re),oe.push({event:Z,listeners:Oe}))}}if((i&7)===0){e:{if(Z=n==="mouseover"||n==="pointerover",J=n==="mouseout"||n==="pointerout",Z&&s!==we&&(_e=s.relatedTarget||s.fromElement)&&(ln(_e)||_e[ii]))break e;if((J||Z)&&(Z=re.window===re?re:(Z=re.ownerDocument)?Z.defaultView||Z.parentWindow:window,J?(_e=s.relatedTarget||s.toElement,J=Y,_e=_e?ln(_e):null,_e!==null&&(dt=c(_e),Oe=_e.tag,_e!==dt||Oe!==5&&Oe!==27&&Oe!==6)&&(_e=null)):(J=null,_e=Y),J!==_e)){if(Oe=Up,se="onMouseLeave",$="onMouseEnter",H="mouse",(n==="pointerout"||n==="pointerover")&&(Oe=Hp,se="onPointerLeave",$="onPointerEnter",H="pointer"),dt=J==null?Z:ai(J),V=_e==null?Z:ai(_e),Z=new Oe(se,H+"leave",J,s,re),Z.target=dt,Z.relatedTarget=V,se=null,ln(re)===Y&&(Oe=new Oe($,H+"enter",_e,s,re),Oe.target=V,Oe.relatedTarget=dt,se=Oe),dt=se,J&&_e)t:{for(Oe=mS,$=J,H=_e,V=0,se=$;se;se=Oe(se))V++;se=0;for(var Ne=H;Ne;Ne=Oe(Ne))se++;for(;0<V-se;)$=Oe($),V--;for(;0<se-V;)H=Oe(H),se--;for(;V--;){if($===H||H!==null&&$===H.alternate){Oe=$;break t}$=Oe($),H=Oe(H)}Oe=null}else Oe=null;J!==null&&Mb(oe,Z,J,Oe,!1),_e!==null&&dt!==null&&Mb(oe,dt,_e,Oe,!0)}}e:{if(Z=Y?ai(Y):window,J=Z.nodeName&&Z.nodeName.toLowerCase(),J==="select"||J==="input"&&Z.type==="file")var Je=Wp;else if(Vp(Z))if(Xp)Je=T_;else{Je=w_;var ke=S_}else J=Z.nodeName,!J||J.toLowerCase()!=="input"||Z.type!=="checkbox"&&Z.type!=="radio"?Y&&li(Y.elementType)&&(Je=Wp):Je=k_;if(Je&&(Je=Je(n,Y))){Yp(oe,Je,s,re);break e}ke&&ke(n,Z,Y),n==="focusout"&&Y&&Z.type==="number"&&Y.memoizedProps.value!=null&&Ma(Z,"number",Z.value)}switch(ke=Y?ai(Y):window,n){case"focusin":(Vp(ke)||ke.contentEditable==="true")&&(La=ke,Vu=Y,Qs=null);break;case"focusout":Qs=Vu=La=null;break;case"mousedown":Yu=!0;break;case"contextmenu":case"mouseup":case"dragend":Yu=!1,im(oe,s,re);break;case"selectionchange":if(C_)break;case"keydown":case"keyup":im(oe,s,re)}var Ue;if($u)e:{switch(n){case"compositionstart":var Ye="onCompositionStart";break e;case"compositionend":Ye="onCompositionEnd";break e;case"compositionupdate":Ye="onCompositionUpdate";break e}Ye=void 0}else Da?Kp(n,s)&&(Ye="onCompositionEnd"):n==="keydown"&&s.keyCode===229&&(Ye="onCompositionStart");Ye&&(Fp&&s.locale!=="ko"&&(Da||Ye!=="onCompositionStart"?Ye==="onCompositionEnd"&&Da&&(Ue=jp()):(ci=re,Bu="value"in ci?ci.value:ci.textContent,Da=!0)),ke=Sc(Y,Ye),0<ke.length&&(Ye=new Pp(Ye,n,null,s,re),oe.push({event:Ye,listeners:ke}),Ue?Ye.data=Ue:(Ue=qp(s),Ue!==null&&(Ye.data=Ue)))),(Ue=y_?v_(n,s):x_(n,s))&&(Ye=Sc(Y,"onBeforeInput"),0<Ye.length&&(ke=new Pp("onBeforeInput","beforeinput",null,s,re),oe.push({event:ke,listeners:Ye}),ke.data=Ue)),dS(oe,n,Y,s,re)}Ob(oe,i)})}function Sl(n,i,s){return{instance:n,listener:i,currentTarget:s}}function Sc(n,i){for(var s=i+"Capture",o=[];n!==null;){var f=n,g=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||g===null||(f=Gs(n,s),f!=null&&o.unshift(Sl(n,f,g)),f=Gs(n,i),f!=null&&o.push(Sl(n,f,g))),n.tag===3)return o;n=n.return}return[]}function mS(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function Mb(n,i,s,o,f){for(var g=i._reactName,E=[];s!==null&&s!==o;){var k=s,L=k.alternate,Y=k.stateNode;if(k=k.tag,L!==null&&L===o)break;k!==5&&k!==26&&k!==27||Y===null||(L=Y,f?(Y=Gs(s,g),Y!=null&&E.unshift(Sl(s,Y,L))):f||(Y=Gs(s,g),Y!=null&&E.push(Sl(s,Y,L)))),s=s.return}E.length!==0&&n.push({event:i,listeners:E})}var gS=/\r\n?/g,bS=/\u0000|\uFFFD/g;function Ib(n){return(typeof n=="string"?n:""+n).replace(gS,`
49
- `).replace(bS,"")}function Db(n,i){return i=Ib(i),Ib(n)===i}function ut(n,i,s,o,f,g){switch(s){case"children":typeof o=="string"?i==="body"||i==="textarea"&&o===""||Re(n,o):(typeof o=="number"||typeof o=="bigint")&&i!=="body"&&Re(n,""+o);break;case"className":Nn(n,"class",o);break;case"tabIndex":Nn(n,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":Nn(n,s,o);break;case"style":at(n,o,g);break;case"data":if(i!=="object"){Nn(n,"data",o);break}case"src":case"href":if(o===""&&(i!=="a"||s!=="href")){n.removeAttribute(s);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){n.removeAttribute(s);break}o=oi(""+o),n.setAttribute(s,o);break;case"action":case"formAction":if(typeof o=="function"){n.setAttribute(s,"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 g=="function"&&(s==="formAction"?(i!=="input"&&ut(n,i,"name",f.name,f,null),ut(n,i,"formEncType",f.formEncType,f,null),ut(n,i,"formMethod",f.formMethod,f,null),ut(n,i,"formTarget",f.formTarget,f,null)):(ut(n,i,"encType",f.encType,f,null),ut(n,i,"method",f.method,f,null),ut(n,i,"target",f.target,f,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){n.removeAttribute(s);break}o=oi(""+o),n.setAttribute(s,o);break;case"onClick":o!=null&&(n.onclick=ye);break;case"onScroll":o!=null&&Ge("scroll",n);break;case"onScrollEnd":o!=null&&Ge("scrollend",n);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(a(61));if(s=o.__html,s!=null){if(f.children!=null)throw Error(a(60));n.innerHTML=s}}break;case"multiple":n.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":n.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){n.removeAttribute("xlink:href");break}s=oi(""+o),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?n.setAttribute(s,""+o):n.removeAttribute(s);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":o&&typeof o!="function"&&typeof o!="symbol"?n.setAttribute(s,""):n.removeAttribute(s);break;case"capture":case"download":o===!0?n.setAttribute(s,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?n.setAttribute(s,o):n.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?n.setAttribute(s,o):n.removeAttribute(s);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?n.removeAttribute(s):n.setAttribute(s,o);break;case"popover":Ge("beforetoggle",n),Ge("toggle",n),en(n,"popover",o);break;case"xlinkActuate":gn(n,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":gn(n,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":gn(n,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":gn(n,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":gn(n,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":gn(n,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":gn(n,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":gn(n,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":gn(n,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":en(n,"is",o);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=Ar.get(s)||s,en(n,s,o))}}function xf(n,i,s,o,f,g){switch(s){case"style":at(n,o,g);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(a(61));if(s=o.__html,s!=null){if(f.children!=null)throw Error(a(60));n.innerHTML=s}}break;case"children":typeof o=="string"?Re(n,o):(typeof o=="number"||typeof o=="bigint")&&Re(n,""+o);break;case"onScroll":o!=null&&Ge("scroll",n);break;case"onScrollEnd":o!=null&&Ge("scrollend",n);break;case"onClick":o!=null&&(n.onclick=ye);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Vi.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(f=s.endsWith("Capture"),i=s.slice(2,f?s.length-7:void 0),g=n[Jt]||null,g=g!=null?g[s]:null,typeof g=="function"&&n.removeEventListener(i,g,f),typeof o=="function")){typeof g!="function"&&g!==null&&(s in n?n[s]=null:n.hasAttribute(s)&&n.removeAttribute(s)),n.addEventListener(i,o,f);break e}s in n?n[s]=o:o===!0?n.setAttribute(s,""):en(n,s,o)}}}function Zt(n,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ge("error",n),Ge("load",n);var o=!1,f=!1,g;for(g in s)if(s.hasOwnProperty(g)){var E=s[g];if(E!=null)switch(g){case"src":o=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:ut(n,i,g,E,s,null)}}f&&ut(n,i,"srcSet",s.srcSet,s,null),o&&ut(n,i,"src",s.src,s,null);return;case"input":Ge("invalid",n);var k=g=E=f=null,L=null,Y=null;for(o in s)if(s.hasOwnProperty(o)){var re=s[o];if(re!=null)switch(o){case"name":f=re;break;case"type":E=re;break;case"checked":L=re;break;case"defaultChecked":Y=re;break;case"value":g=re;break;case"defaultValue":k=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(a(137,i));break;default:ut(n,i,o,re,s,null)}}Yi(n,g,k,L,Y,E,f,!1);return;case"select":Ge("invalid",n),o=E=g=null;for(f in s)if(s.hasOwnProperty(f)&&(k=s[f],k!=null))switch(f){case"value":g=k;break;case"defaultValue":E=k;break;case"multiple":o=k;default:ut(n,i,f,k,s,null)}i=g,s=E,n.multiple=!!o,i!=null?Vt(n,!!o,i,!1):s!=null&&Vt(n,!!o,s,!0);return;case"textarea":Ge("invalid",n),g=f=o=null;for(E in s)if(s.hasOwnProperty(E)&&(k=s[E],k!=null))switch(E){case"value":o=k;break;case"defaultValue":f=k;break;case"children":g=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(a(91));break;default:ut(n,i,E,k,s,null)}Ia(n,o,f,g);return;case"option":for(L in s)if(s.hasOwnProperty(L)&&(o=s[L],o!=null))switch(L){case"selected":n.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:ut(n,i,L,o,s,null)}return;case"dialog":Ge("beforetoggle",n),Ge("toggle",n),Ge("cancel",n),Ge("close",n);break;case"iframe":case"object":Ge("load",n);break;case"video":case"audio":for(o=0;o<_l.length;o++)Ge(_l[o],n);break;case"image":Ge("error",n),Ge("load",n);break;case"details":Ge("toggle",n);break;case"embed":case"source":case"link":Ge("error",n),Ge("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Y in s)if(s.hasOwnProperty(Y)&&(o=s[Y],o!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:ut(n,i,Y,o,s,null)}return;default:if(li(i)){for(re in s)s.hasOwnProperty(re)&&(o=s[re],o!==void 0&&xf(n,i,re,o,s,void 0));return}}for(k in s)s.hasOwnProperty(k)&&(o=s[k],o!=null&&ut(n,i,k,o,s,null))}function yS(n,i,s,o){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,g=null,E=null,k=null,L=null,Y=null,re=null;for(J in s){var oe=s[J];if(s.hasOwnProperty(J)&&oe!=null)switch(J){case"checked":break;case"value":break;case"defaultValue":L=oe;default:o.hasOwnProperty(J)||ut(n,i,J,null,o,oe)}}for(var Z in o){var J=o[Z];if(oe=s[Z],o.hasOwnProperty(Z)&&(J!=null||oe!=null))switch(Z){case"type":g=J;break;case"name":f=J;break;case"checked":Y=J;break;case"defaultChecked":re=J;break;case"value":E=J;break;case"defaultValue":k=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(a(137,i));break;default:J!==oe&&ut(n,i,Z,J,o,oe)}}Hs(n,E,k,L,Y,re,g,f);return;case"select":J=E=k=Z=null;for(g in s)if(L=s[g],s.hasOwnProperty(g)&&L!=null)switch(g){case"value":break;case"multiple":J=L;default:o.hasOwnProperty(g)||ut(n,i,g,null,o,L)}for(f in o)if(g=o[f],L=s[f],o.hasOwnProperty(f)&&(g!=null||L!=null))switch(f){case"value":Z=g;break;case"defaultValue":k=g;break;case"multiple":E=g;default:g!==L&&ut(n,i,f,g,o,L)}i=k,s=E,o=J,Z!=null?Vt(n,!!s,Z,!1):!!o!=!!s&&(i!=null?Vt(n,!!s,i,!0):Vt(n,!!s,s?[]:"",!1));return;case"textarea":J=Z=null;for(k in s)if(f=s[k],s.hasOwnProperty(k)&&f!=null&&!o.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:ut(n,i,k,null,o,f)}for(E in o)if(f=o[E],g=s[E],o.hasOwnProperty(E)&&(f!=null||g!=null))switch(E){case"value":Z=f;break;case"defaultValue":J=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(a(91));break;default:f!==g&&ut(n,i,E,f,o,g)}No(n,Z,J);return;case"option":for(var _e in s)if(Z=s[_e],s.hasOwnProperty(_e)&&Z!=null&&!o.hasOwnProperty(_e))switch(_e){case"selected":n.selected=!1;break;default:ut(n,i,_e,null,o,Z)}for(L in o)if(Z=o[L],J=s[L],o.hasOwnProperty(L)&&Z!==J&&(Z!=null||J!=null))switch(L){case"selected":n.selected=Z&&typeof Z!="function"&&typeof Z!="symbol";break;default:ut(n,i,L,Z,o,J)}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 Oe in s)Z=s[Oe],s.hasOwnProperty(Oe)&&Z!=null&&!o.hasOwnProperty(Oe)&&ut(n,i,Oe,null,o,Z);for(Y in o)if(Z=o[Y],J=s[Y],o.hasOwnProperty(Y)&&Z!==J&&(Z!=null||J!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(a(137,i));break;default:ut(n,i,Y,Z,o,J)}return;default:if(li(i)){for(var dt in s)Z=s[dt],s.hasOwnProperty(dt)&&Z!==void 0&&!o.hasOwnProperty(dt)&&xf(n,i,dt,void 0,o,Z);for(re in o)Z=o[re],J=s[re],!o.hasOwnProperty(re)||Z===J||Z===void 0&&J===void 0||xf(n,i,re,Z,o,J);return}}for(var $ in s)Z=s[$],s.hasOwnProperty($)&&Z!=null&&!o.hasOwnProperty($)&&ut(n,i,$,null,o,Z);for(oe in o)Z=o[oe],J=s[oe],!o.hasOwnProperty(oe)||Z===J||Z==null&&J==null||ut(n,i,oe,Z,o,J)}function Lb(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function vS(){if(typeof performance.getEntriesByType=="function"){for(var n=0,i=0,s=performance.getEntriesByType("resource"),o=0;o<s.length;o++){var f=s[o],g=f.transferSize,E=f.initiatorType,k=f.duration;if(g&&k&&Lb(E)){for(E=0,k=f.responseEnd,o+=1;o<s.length;o++){var L=s[o],Y=L.startTime;if(Y>k)break;var re=L.transferSize,oe=L.initiatorType;re&&Lb(oe)&&(L=L.responseEnd,E+=re*(L<k?1:(k-Y)/(L-Y)))}if(--o,i+=8*(g+E)/(f.duration/1e3),n++,10<n)break}}if(0<n)return i/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var Ef=null,_f=null;function wc(n){return n.nodeType===9?n:n.ownerDocument}function zb(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function jb(n,i){if(n===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&i==="foreignObject"?0:n}function Sf(n,i){return n==="textarea"||n==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var wf=null;function xS(){var n=window.event;return n&&n.type==="popstate"?n===wf?!1:(wf=n,!0):(wf=null,!1)}var Bb=typeof setTimeout=="function"?setTimeout:void 0,ES=typeof clearTimeout=="function"?clearTimeout:void 0,Ub=typeof Promise=="function"?Promise:void 0,_S=typeof queueMicrotask=="function"?queueMicrotask:typeof Ub<"u"?function(n){return Ub.resolve(null).then(n).catch(SS)}:Bb;function SS(n){setTimeout(function(){throw n})}function Ti(n){return n==="head"}function Pb(n,i){var s=i,o=0;do{var f=s.nextSibling;if(n.removeChild(s),f&&f.nodeType===8)if(s=f.data,s==="/$"||s==="/&"){if(o===0){n.removeChild(f),os(i);return}o--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")o++;else if(s==="html")wl(n.ownerDocument.documentElement);else if(s==="head"){s=n.ownerDocument.head,wl(s);for(var g=s.firstChild;g;){var E=g.nextSibling,k=g.nodeName;g[qi]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&g.rel.toLowerCase()==="stylesheet"||s.removeChild(g),g=E}}else s==="body"&&wl(n.ownerDocument.body);s=f}while(s);os(i)}function Hb(n,i){var s=n;n=0;do{var o=s.nextSibling;if(s.nodeType===1?i?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(i?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),o&&o.nodeType===8)if(s=o.data,s==="/$"){if(n===0)break;n--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||n++;s=o}while(s)}function kf(n){var i=n.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var s=i;switch(i=i.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":kf(s),Us(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}n.removeChild(s)}}function wS(n,i,s,o){for(;n.nodeType===1;){var f=s;if(n.nodeName.toLowerCase()!==i.toLowerCase()){if(!o&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(o){if(!n[qi])switch(i){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(g=n.getAttribute("rel"),g==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(g!==f.rel||n.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||n.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||n.getAttribute("title")!==(f.title==null?null:f.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(g=n.getAttribute("src"),(g!==(f.src==null?null:f.src)||n.getAttribute("type")!==(f.type==null?null:f.type)||n.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&g&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(i==="input"&&n.type==="hidden"){var g=f.name==null?null:""+f.name;if(f.type==="hidden"&&n.getAttribute("name")===g)return n}else return n;if(n=Vn(n.nextSibling),n===null)break}return null}function kS(n,i,s){if(i==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!s||(n=Vn(n.nextSibling),n===null))return null;return n}function Fb(n,i){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=Vn(n.nextSibling),n===null))return null;return n}function Tf(n){return n.data==="$?"||n.data==="$~"}function Nf(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function TS(n,i){var s=n.ownerDocument;if(n.data==="$~")n._reactRetry=i;else if(n.data!=="$?"||s.readyState!=="loading")i();else{var o=function(){i(),s.removeEventListener("DOMContentLoaded",o)};s.addEventListener("DOMContentLoaded",o),n._reactRetry=o}}function Vn(n){for(;n!=null;n=n.nextSibling){var i=n.nodeType;if(i===1||i===3)break;if(i===8){if(i=n.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return n}var Cf=null;function $b(n){n=n.nextSibling;for(var i=0;n;){if(n.nodeType===8){var s=n.data;if(s==="/$"||s==="/&"){if(i===0)return Vn(n.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}n=n.nextSibling}return null}function Gb(n){n=n.previousSibling;for(var i=0;n;){if(n.nodeType===8){var s=n.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(i===0)return n;i--}else s!=="/$"&&s!=="/&"||i++}n=n.previousSibling}return null}function Kb(n,i,s){switch(i=wc(s),n){case"html":if(n=i.documentElement,!n)throw Error(a(452));return n;case"head":if(n=i.head,!n)throw Error(a(453));return n;case"body":if(n=i.body,!n)throw Error(a(454));return n;default:throw Error(a(451))}}function wl(n){for(var i=n.attributes;i.length;)n.removeAttributeNode(i[0]);Us(n)}var Yn=new Map,qb=new Set;function kc(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Kr=Q.d;Q.d={f:NS,r:CS,D:AS,C:OS,L:RS,m:MS,X:DS,S:IS,M:LS};function NS(){var n=Kr.f(),i=gc();return n||i}function CS(n){var i=Nr(n);i!==null&&i.tag===5&&i.type==="form"?cg(i):Kr.r(n)}var as=typeof document>"u"?null:document;function Vb(n,i,s){var o=as;if(o&&typeof i=="string"&&i){var f=bn(i);f='link[rel="'+n+'"][href="'+f+'"]',typeof s=="string"&&(f+='[crossorigin="'+s+'"]'),qb.has(f)||(qb.add(f),n={rel:n,crossOrigin:s,href:i},o.querySelector(f)===null&&(i=o.createElement("link"),Zt(i,"link",n),jt(i),o.head.appendChild(i)))}}function AS(n){Kr.D(n),Vb("dns-prefetch",n,null)}function OS(n,i){Kr.C(n,i),Vb("preconnect",n,i)}function RS(n,i,s){Kr.L(n,i,s);var o=as;if(o&&n&&i){var f='link[rel="preload"][as="'+bn(i)+'"]';i==="image"&&s&&s.imageSrcSet?(f+='[imagesrcset="'+bn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(f+='[imagesizes="'+bn(s.imageSizes)+'"]')):f+='[href="'+bn(n)+'"]';var g=f;switch(i){case"style":g=ss(n);break;case"script":g=ls(n)}Yn.has(g)||(n=y({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:n,as:i},s),Yn.set(g,n),o.querySelector(f)!==null||i==="style"&&o.querySelector(kl(g))||i==="script"&&o.querySelector(Tl(g))||(i=o.createElement("link"),Zt(i,"link",n),jt(i),o.head.appendChild(i)))}}function MS(n,i){Kr.m(n,i);var s=as;if(s&&n){var o=i&&typeof i.as=="string"?i.as:"script",f='link[rel="modulepreload"][as="'+bn(o)+'"][href="'+bn(n)+'"]',g=f;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=ls(n)}if(!Yn.has(g)&&(n=y({rel:"modulepreload",href:n},i),Yn.set(g,n),s.querySelector(f)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Tl(g)))return}o=s.createElement("link"),Zt(o,"link",n),jt(o),s.head.appendChild(o)}}}function IS(n,i,s){Kr.S(n,i,s);var o=as;if(o&&n){var f=si(o).hoistableStyles,g=ss(n);i=i||"default";var E=f.get(g);if(!E){var k={loading:0,preload:null};if(E=o.querySelector(kl(g)))k.loading=5;else{n=y({rel:"stylesheet",href:n,"data-precedence":i},s),(s=Yn.get(g))&&Af(n,s);var L=E=o.createElement("link");jt(L),Zt(L,"link",n),L._p=new Promise(function(Y,re){L.onload=Y,L.onerror=re}),L.addEventListener("load",function(){k.loading|=1}),L.addEventListener("error",function(){k.loading|=2}),k.loading|=4,Tc(E,i,o)}E={type:"stylesheet",instance:E,count:1,state:k},f.set(g,E)}}}function DS(n,i){Kr.X(n,i);var s=as;if(s&&n){var o=si(s).hoistableScripts,f=ls(n),g=o.get(f);g||(g=s.querySelector(Tl(f)),g||(n=y({src:n,async:!0},i),(i=Yn.get(f))&&Of(n,i),g=s.createElement("script"),jt(g),Zt(g,"link",n),s.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},o.set(f,g))}}function LS(n,i){Kr.M(n,i);var s=as;if(s&&n){var o=si(s).hoistableScripts,f=ls(n),g=o.get(f);g||(g=s.querySelector(Tl(f)),g||(n=y({src:n,async:!0,type:"module"},i),(i=Yn.get(f))&&Of(n,i),g=s.createElement("script"),jt(g),Zt(g,"link",n),s.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},o.set(f,g))}}function Yb(n,i,s,o){var f=(f=q.current)?kc(f):null;if(!f)throw Error(a(446));switch(n){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(i=ss(s.href),s=si(f).hoistableStyles,o=s.get(i),o||(o={type:"style",instance:null,count:0,state:null},s.set(i,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){n=ss(s.href);var g=si(f).hoistableStyles,E=g.get(n);if(E||(f=f.ownerDocument||f,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(n,E),(g=f.querySelector(kl(n)))&&!g._p&&(E.instance=g,E.state.loading=5),Yn.has(n)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Yn.set(n,s),g||zS(f,n,s,E.state))),i&&o===null)throw Error(a(528,""));return E}if(i&&o!==null)throw Error(a(529,""));return null;case"script":return i=s.async,s=s.src,typeof s=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=ls(s),s=si(f).hoistableScripts,o=s.get(i),o||(o={type:"script",instance:null,count:0,state:null},s.set(i,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,n))}}function ss(n){return'href="'+bn(n)+'"'}function kl(n){return'link[rel="stylesheet"]['+n+"]"}function Wb(n){return y({},n,{"data-precedence":n.precedence,precedence:null})}function zS(n,i,s,o){n.querySelector('link[rel="preload"][as="style"]['+i+"]")?o.loading=1:(i=n.createElement("link"),o.preload=i,i.addEventListener("load",function(){return o.loading|=1}),i.addEventListener("error",function(){return o.loading|=2}),Zt(i,"link",s),jt(i),n.head.appendChild(i))}function ls(n){return'[src="'+bn(n)+'"]'}function Tl(n){return"script[async]"+n}function Xb(n,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var o=n.querySelector('style[data-href~="'+bn(s.href)+'"]');if(o)return i.instance=o,jt(o),o;var f=y({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return o=(n.ownerDocument||n).createElement("style"),jt(o),Zt(o,"style",f),Tc(o,s.precedence,n),i.instance=o;case"stylesheet":f=ss(s.href);var g=n.querySelector(kl(f));if(g)return i.state.loading|=4,i.instance=g,jt(g),g;o=Wb(s),(f=Yn.get(f))&&Af(o,f),g=(n.ownerDocument||n).createElement("link"),jt(g);var E=g;return E._p=new Promise(function(k,L){E.onload=k,E.onerror=L}),Zt(g,"link",o),i.state.loading|=4,Tc(g,s.precedence,n),i.instance=g;case"script":return g=ls(s.src),(f=n.querySelector(Tl(g)))?(i.instance=f,jt(f),f):(o=s,(f=Yn.get(g))&&(o=y({},s),Of(o,f)),n=n.ownerDocument||n,f=n.createElement("script"),jt(f),Zt(f,"link",o),n.head.appendChild(f),i.instance=f);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(o=i.instance,i.state.loading|=4,Tc(o,s.precedence,n));return i.instance}function Tc(n,i,s){for(var o=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=o.length?o[o.length-1]:null,g=f,E=0;E<o.length;E++){var k=o[E];if(k.dataset.precedence===i)g=k;else if(g!==f)break}g?g.parentNode.insertBefore(n,g.nextSibling):(i=s.nodeType===9?s.head:s,i.insertBefore(n,i.firstChild))}function Af(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.title==null&&(n.title=i.title)}function Of(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.integrity==null&&(n.integrity=i.integrity)}var Nc=null;function Zb(n,i,s){if(Nc===null){var o=new Map,f=Nc=new Map;f.set(s,o)}else f=Nc,o=f.get(s),o||(o=new Map,f.set(s,o));if(o.has(n))return o;for(o.set(n,null),s=s.getElementsByTagName(n),f=0;f<s.length;f++){var g=s[f];if(!(g[qi]||g[It]||n==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var E=g.getAttribute(i)||"";E=n+E;var k=o.get(E);k?k.push(g):o.set(E,[g])}}return o}function Qb(n,i,s){n=n.ownerDocument||n,n.head.insertBefore(s,i==="title"?n.querySelector("head > title"):null)}function jS(n,i,s){if(s===1||i.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return n=i.disabled,typeof i.precedence=="string"&&n==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function Jb(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function BS(n,i,s,o){if(s.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var f=ss(o.href),g=i.querySelector(kl(f));if(g){i=g._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(n.count++,n=Cc.bind(n),i.then(n,n)),s.state.loading|=4,s.instance=g,jt(g);return}g=i.ownerDocument||i,o=Wb(o),(f=Yn.get(f))&&Af(o,f),g=g.createElement("link"),jt(g);var E=g;E._p=new Promise(function(k,L){E.onload=k,E.onerror=L}),Zt(g,"link",o),s.instance=g}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(s,i),(i=s.state.preload)&&(s.state.loading&3)===0&&(n.count++,s=Cc.bind(n),i.addEventListener("load",s),i.addEventListener("error",s))}}var Rf=0;function US(n,i){return n.stylesheets&&n.count===0&&Oc(n,n.stylesheets),0<n.count||0<n.imgCount?function(s){var o=setTimeout(function(){if(n.stylesheets&&Oc(n,n.stylesheets),n.unsuspend){var g=n.unsuspend;n.unsuspend=null,g()}},6e4+i);0<n.imgBytes&&Rf===0&&(Rf=62500*vS());var f=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Oc(n,n.stylesheets),n.unsuspend)){var g=n.unsuspend;n.unsuspend=null,g()}},(n.imgBytes>Rf?50:800)+i);return n.unsuspend=s,function(){n.unsuspend=null,clearTimeout(o),clearTimeout(f)}}:null}function Cc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Oc(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Ac=null;function Oc(n,i){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Ac=new Map,i.forEach(PS,n),Ac=null,Cc.call(n))}function PS(n,i){if(!(i.state.loading&4)){var s=Ac.get(n);if(s)var o=s.get(null);else{s=new Map,Ac.set(n,s);for(var f=n.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<f.length;g++){var E=f[g];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(s.set(E.dataset.precedence,E),o=E)}o&&s.set(null,o)}f=i.instance,E=f.getAttribute("data-precedence"),g=s.get(E)||o,g===o&&s.set(null,f),s.set(E,f),this.count++,o=Cc.bind(this),f.addEventListener("load",o),f.addEventListener("error",o),g?g.parentNode.insertBefore(f,g.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(f,n.firstChild)),i.state.loading|=4}}var Nl={$$typeof:M,Provider:null,Consumer:null,_currentValue:ie,_currentValue2:ie,_threadCount:0};function HS(n,i,s,o,f,g,E,k,L){this.tag=1,this.containerInfo=n,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=xt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xt(0),this.hiddenUpdates=xt(null),this.identifierPrefix=o,this.onUncaughtError=f,this.onCaughtError=g,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=L,this.incompleteTransitions=new Map}function ey(n,i,s,o,f,g,E,k,L,Y,re,oe){return n=new HS(n,i,s,E,L,Y,re,oe,k),i=1,g===!0&&(i|=24),g=On(3,null,null,i),n.current=g,g.stateNode=n,i=cd(),i.refCount++,n.pooledCache=i,i.refCount++,g.memoizedState={element:o,isDehydrated:s,cache:i},hd(g),n}function ty(n){return n?(n=Ba,n):Ba}function ny(n,i,s,o,f,g){f=ty(f),o.context===null?o.context=f:o.pendingContext=f,o=mi(i),o.payload={element:s},g=g===void 0?null:g,g!==null&&(o.callback=g),s=gi(n,o,i),s!==null&&(Sn(s,n,i),al(s,n,i))}function ry(n,i){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var s=n.retryLane;n.retryLane=s!==0&&s<i?s:i}}function Mf(n,i){ry(n,i),(n=n.alternate)&&ry(n,i)}function iy(n){if(n.tag===13||n.tag===31){var i=Qi(n,67108864);i!==null&&Sn(i,n,67108864),Mf(n,67108864)}}function ay(n){if(n.tag===13||n.tag===31){var i=Ln();i=wt(i);var s=Qi(n,i);s!==null&&Sn(s,n,i),Mf(n,i)}}var Rc=!0;function FS(n,i,s,o){var f=z.T;z.T=null;var g=Q.p;try{Q.p=2,If(n,i,s,o)}finally{Q.p=g,z.T=f}}function $S(n,i,s,o){var f=z.T;z.T=null;var g=Q.p;try{Q.p=8,If(n,i,s,o)}finally{Q.p=g,z.T=f}}function If(n,i,s,o){if(Rc){var f=Df(o);if(f===null)vf(n,i,o,Mc,s),ly(n,o);else if(KS(f,n,i,s,o))o.stopPropagation();else if(ly(n,o),i&4&&-1<GS.indexOf(n)){for(;f!==null;){var g=Nr(f);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var E=mn(g.pendingLanes);if(E!==0){var k=g;for(k.pendingLanes|=2,k.entangledLanes|=2;E;){var L=1<<31-rt(E);k.entanglements[1]|=L,E&=~L}mr(g),(tt&6)===0&&(pc=Tt()+500,El(0))}}break;case 31:case 13:k=Qi(g,2),k!==null&&Sn(k,g,2),gc(),Mf(g,2)}if(g=Df(o),g===null&&vf(n,i,o,Mc,s),g===f)break;f=g}f!==null&&o.stopPropagation()}else vf(n,i,o,null,s)}}function Df(n){return n=je(n),Lf(n)}var Mc=null;function Lf(n){if(Mc=null,n=ln(n),n!==null){var i=c(n);if(i===null)n=null;else{var s=i.tag;if(s===13){if(n=u(i),n!==null)return n;n=null}else if(s===31){if(n=d(i),n!==null)return n;n=null}else if(s===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;n=null}else i!==n&&(n=null)}}return Mc=n,null}function sy(n){switch(n){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(ka()){case ne:return 2;case be:return 8;case Ae:case He:return 32;case Qe:return 268435456;default:return 32}default:return 32}}var zf=!1,Ni=null,Ci=null,Ai=null,Cl=new Map,Al=new Map,Oi=[],GS="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 ly(n,i){switch(n){case"focusin":case"focusout":Ni=null;break;case"dragenter":case"dragleave":Ci=null;break;case"mouseover":case"mouseout":Ai=null;break;case"pointerover":case"pointerout":Cl.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Al.delete(i.pointerId)}}function Ol(n,i,s,o,f,g){return n===null||n.nativeEvent!==g?(n={blockedOn:i,domEventName:s,eventSystemFlags:o,nativeEvent:g,targetContainers:[f]},i!==null&&(i=Nr(i),i!==null&&iy(i)),n):(n.eventSystemFlags|=o,i=n.targetContainers,f!==null&&i.indexOf(f)===-1&&i.push(f),n)}function KS(n,i,s,o,f){switch(i){case"focusin":return Ni=Ol(Ni,n,i,s,o,f),!0;case"dragenter":return Ci=Ol(Ci,n,i,s,o,f),!0;case"mouseover":return Ai=Ol(Ai,n,i,s,o,f),!0;case"pointerover":var g=f.pointerId;return Cl.set(g,Ol(Cl.get(g)||null,n,i,s,o,f)),!0;case"gotpointercapture":return g=f.pointerId,Al.set(g,Ol(Al.get(g)||null,n,i,s,o,f)),!0}return!1}function oy(n){var i=ln(n.target);if(i!==null){var s=c(i);if(s!==null){if(i=s.tag,i===13){if(i=u(s),i!==null){n.blockedOn=i,Ca(n.priority,function(){ay(s)});return}}else if(i===31){if(i=d(s),i!==null){n.blockedOn=i,Ca(n.priority,function(){ay(s)});return}}else if(i===3&&s.stateNode.current.memoizedState.isDehydrated){n.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Ic(n){if(n.blockedOn!==null)return!1;for(var i=n.targetContainers;0<i.length;){var s=Df(n.nativeEvent);if(s===null){s=n.nativeEvent;var o=new s.constructor(s.type,s);we=o,s.target.dispatchEvent(o),we=null}else return i=Nr(s),i!==null&&iy(i),n.blockedOn=s,!1;i.shift()}return!0}function cy(n,i,s){Ic(n)&&s.delete(i)}function qS(){zf=!1,Ni!==null&&Ic(Ni)&&(Ni=null),Ci!==null&&Ic(Ci)&&(Ci=null),Ai!==null&&Ic(Ai)&&(Ai=null),Cl.forEach(cy),Al.forEach(cy)}function Dc(n,i){n.blockedOn===i&&(n.blockedOn=null,zf||(zf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,qS)))}var Lc=null;function uy(n){Lc!==n&&(Lc=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Lc===n&&(Lc=null);for(var i=0;i<n.length;i+=3){var s=n[i],o=n[i+1],f=n[i+2];if(typeof o!="function"){if(Lf(o||s)===null)continue;break}var g=Nr(s);g!==null&&(n.splice(i,3),i-=3,Id(g,{pending:!0,data:f,method:s.method,action:o},o,f))}}))}function os(n){function i(L){return Dc(L,n)}Ni!==null&&Dc(Ni,n),Ci!==null&&Dc(Ci,n),Ai!==null&&Dc(Ai,n),Cl.forEach(i),Al.forEach(i);for(var s=0;s<Oi.length;s++){var o=Oi[s];o.blockedOn===n&&(o.blockedOn=null)}for(;0<Oi.length&&(s=Oi[0],s.blockedOn===null);)oy(s),s.blockedOn===null&&Oi.shift();if(s=(n.ownerDocument||n).$$reactFormReplay,s!=null)for(o=0;o<s.length;o+=3){var f=s[o],g=s[o+1],E=f[Jt]||null;if(typeof g=="function")E||uy(s);else if(E){var k=null;if(g&&g.hasAttribute("formAction")){if(f=g,E=g[Jt]||null)k=E.formAction;else if(Lf(f)!==null)continue}else k=E.action;typeof k=="function"?s[o+1]=k:(s.splice(o,3),o-=3),uy(s)}}}function dy(){function n(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(E){return f=E})},focusReset:"manual",scroll:"manual"})}function i(){f!==null&&(f(),f=null),o||setTimeout(s,20)}function s(){if(!o&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,f=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(s,100),function(){o=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),f!==null&&(f(),f=null)}}}function jf(n){this._internalRoot=n}zc.prototype.render=jf.prototype.render=function(n){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,o=Ln();ny(s,o,n,i,null,null)},zc.prototype.unmount=jf.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var i=n.containerInfo;ny(n.current,2,null,n,null,null),gc(),i[ii]=null}};function zc(n){this._internalRoot=n}zc.prototype.unstable_scheduleHydration=function(n){if(n){var i=Na();n={blockedOn:null,target:n,priority:i};for(var s=0;s<Oi.length&&i!==0&&i<Oi[s].priority;s++);Oi.splice(s,0,n),s===0&&oy(n)}};var fy=t.version;if(fy!=="19.2.4")throw Error(a(527,fy,"19.2.4"));Q.findDOMNode=function(n){var i=n._reactInternals;if(i===void 0)throw typeof n.render=="function"?Error(a(188)):(n=Object.keys(n).join(","),Error(a(268,n)));return n=p(i),n=n!==null?b(n):null,n=n===null?null:n.stateNode,n};var VS={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var jc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!jc.isDisabled&&jc.supportsFiber)try{qt=jc.inject(VS),At=jc}catch{}}return Il.createRoot=function(n,i){if(!l(n))throw Error(a(299));var s=!1,o="",f=vg,g=xg,E=Eg;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(o=i.identifierPrefix),i.onUncaughtError!==void 0&&(f=i.onUncaughtError),i.onCaughtError!==void 0&&(g=i.onCaughtError),i.onRecoverableError!==void 0&&(E=i.onRecoverableError)),i=ey(n,1,!1,null,null,s,o,null,f,g,E,dy),n[ii]=i.current,yf(n),new jf(i)},Il.hydrateRoot=function(n,i,s){if(!l(n))throw Error(a(299));var o=!1,f="",g=vg,E=xg,k=Eg,L=null;return s!=null&&(s.unstable_strictMode===!0&&(o=!0),s.identifierPrefix!==void 0&&(f=s.identifierPrefix),s.onUncaughtError!==void 0&&(g=s.onUncaughtError),s.onCaughtError!==void 0&&(E=s.onCaughtError),s.onRecoverableError!==void 0&&(k=s.onRecoverableError),s.formState!==void 0&&(L=s.formState)),i=ey(n,1,!0,i,s??null,o,f,L,g,E,k,dy),i.context=ty(null),s=i.current,o=Ln(),o=wt(o),f=mi(o),f.callback=null,gi(s,f,o),s=o,i.current.lanes=s,ht(i,s),mr(i),n[ii]=i.current,yf(n),new zc(i)},Il.version="19.2.4",Il}var Ty;function aw(){if(Ty)return Pf.exports;Ty=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(),Pf.exports=iw(),Pf.exports}var sw=aw();const lw=co(sw);function ow(e,t){const r=getComputedStyle(e),a=parseFloat(r.fontSize);return t*a}function cw(e,t){const r=getComputedStyle(e.ownerDocument.body),a=parseFloat(r.fontSize);return t*a}function uw(e){return e/100*window.innerHeight}function dw(e){return e/100*window.innerWidth}function fw(e){switch(typeof e){case"number":return[e,"px"];case"string":{const t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}function Bc({groupSize:e,panelElement:t,styleProp:r}){let a;const[l,c]=fw(r);switch(c){case"%":{a=l/100*e;break}case"px":{a=l;break}case"rem":{a=cw(t,l);break}case"em":{a=ow(t,l);break}case"vh":{a=uw(l);break}case"vw":{a=dw(l);break}}return a}function rr(e){return parseFloat(e.toFixed(3))}function Cs({group:e}){const{orientation:t,panels:r}=e;return r.reduce((a,l)=>(a+=t==="horizontal"?l.element.offsetWidth:l.element.offsetHeight,a),0)}function kh(e){const{panels:t}=e,r=Cs({group:e});return r===0?t.map(a=>({collapsedSize:0,collapsible:a.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:a.panelConstraints.disabled,minSize:0,maxSize:100,panelId:a.id})):t.map(a=>{const{element:l,panelConstraints:c}=a;let u=0;if(c.collapsedSize!==void 0){const b=Bc({groupSize:r,panelElement:l,styleProp:c.collapsedSize});u=rr(b/r*100)}let d;if(c.defaultSize!==void 0){const b=Bc({groupSize:r,panelElement:l,styleProp:c.defaultSize});d=rr(b/r*100)}let h=0;if(c.minSize!==void 0){const b=Bc({groupSize:r,panelElement:l,styleProp:c.minSize});h=rr(b/r*100)}let p=100;if(c.maxSize!==void 0){const b=Bc({groupSize:r,panelElement:l,styleProp:c.maxSize});p=rr(b/r*100)}return{collapsedSize:u,collapsible:c.collapsible===!0,defaultSize:d,disabled:c.disabled,minSize:h,maxSize:p,panelId:a.id}})}function ot(e,t="Assertion error"){if(!e)throw Error(t)}function Th(e,t){return Array.from(t).sort(e==="horizontal"?hw:pw)}function hw(e,t){const r=e.element.offsetLeft-t.element.offsetLeft;return r!==0?r:e.element.offsetWidth-t.element.offsetWidth}function pw(e,t){const r=e.element.offsetTop-t.element.offsetTop;return r!==0?r:e.element.offsetHeight-t.element.offsetHeight}function P1(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function H1(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function mw({orientation:e,rects:t,targetRect:r}){const a={x:r.x+r.width/2,y:r.y+r.height/2};let l,c=Number.MAX_VALUE;for(const u of t){const{x:d,y:h}=H1(a,u),p=e==="horizontal"?d:h;p<c&&(c=p,l=u)}return ot(l,"No rect found"),l}let Uc;function gw(){return Uc===void 0&&(typeof matchMedia=="function"?Uc=!!matchMedia("(pointer:coarse)").matches:Uc=!1),Uc}function F1(e){const{element:t,orientation:r,panels:a,separators:l}=e,c=Th(r,Array.from(t.children).filter(P1).map(_=>({element:_}))).map(({element:_})=>_),u=[];let d=!1,h=!1,p=-1,b=-1,y=0,v,x=[];{let _=-1;for(const T of c)T.hasAttribute("data-panel")&&(_++,T.ariaDisabled===null&&(y++,p===-1&&(p=_),b=_))}if(y>1){let _=-1;for(const T of c)if(T.hasAttribute("data-panel")){_++;const C=a.find(S=>S.element===T);if(C){if(v){const S=v.element.getBoundingClientRect(),R=T.getBoundingClientRect();let M;if(h){const A=r==="horizontal"?new DOMRect(S.right,S.top,0,S.height):new DOMRect(S.left,S.bottom,S.width,0),P=r==="horizontal"?new DOMRect(R.left,R.top,0,R.height):new DOMRect(R.left,R.top,R.width,0);switch(x.length){case 0:{M=[A,P];break}case 1:{const I=x[0],W=mw({orientation:r,rects:[S,R],targetRect:I.element.getBoundingClientRect()});M=[I,W===S?P:A];break}default:{M=x;break}}}else x.length?M=x:M=[r==="horizontal"?new DOMRect(S.right,R.top,R.left-S.right,R.height):new DOMRect(R.left,S.bottom,R.width,R.top-S.bottom)];for(const A of M){let P="width"in A?A:A.element.getBoundingClientRect();const I=gw()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(P.width<I){const te=I-P.width;P=new DOMRect(P.x-te/2,P.y,P.width+te,P.height)}if(P.height<I){const te=I-P.height;P=new DOMRect(P.x,P.y-te/2,P.width,P.height+te)}const W=_<=p||_>b;!d&&!W&&u.push({group:e,groupSize:Cs({group:e}),panels:[v,C],separator:"width"in A?void 0:A,rect:P}),d=!1}}h=!1,v=C,x=[]}}else if(T.hasAttribute("data-separator")){T.ariaDisabled!==null&&(d=!0);const C=l.find(S=>S.element===T);C?x.push(C):(v=void 0,x=[])}else h=!0}return u}var ji;class bw{constructor(){my(this,ji,{})}addListener(t,r){const a=Rl(this,ji)[t];return a===void 0?Rl(this,ji)[t]=[r]:a.includes(r)||a.push(r),()=>{this.removeListener(t,r)}}emit(t,r){const a=Rl(this,ji)[t];if(a!==void 0)if(a.length===1)a[0].call(null,r);else{let l=!1,c=null;const u=Array.from(a);for(let d=0;d<u.length;d++){const h=u[d];try{h.call(null,r)}catch(p){c===null&&(l=!0,c=p)}}if(l)throw c}}removeAllListeners(){gy(this,ji,{})}removeListener(t,r){const a=Rl(this,ji)[t];if(a!==void 0){const l=a.indexOf(r);l>=0&&a.splice(l,1)}}}ji=new WeakMap;function un(e,t,r=0){return Math.abs(rr(e)-rr(t))<=r}let Wn={cursorFlags:0,interactionState:{state:"inactive"},mountedGroups:new Map};const Qr=new bw;function fn(){return Wn}function hn(e){const t=typeof e=="function"?e(Wn):e;if(Wn===t)return Wn;const r=Wn;return Wn={...Wn,...t},t.cursorFlags!==void 0&&Qr.emit("cursorFlagsChange",Wn.cursorFlags),t.interactionState!==void 0&&Qr.emit("interactionStateChange",Wn.interactionState),t.mountedGroups!==void 0&&(Wn.mountedGroups.forEach((a,l)=>{a.derivedPanelConstraints.forEach(c=>{if(c.collapsible){const{layout:u}=r.mountedGroups.get(l)??{};if(u){const d=un(c.collapsedSize,a.layout[c.panelId]),h=un(c.collapsedSize,u[c.panelId]);d&&!h&&(l.inMemoryLastExpandedPanelSizes[c.panelId]=u[c.panelId])}}})}),Qr.emit("mountedGroupsChange",Wn.mountedGroups)),Wn}function yw(e,t,r){let a,l={x:1/0,y:1/0};for(const c of t){const u=H1(r,c.rect);switch(e){case"horizontal":{u.x<=l.x&&(a=c,l=u);break}case"vertical":{u.y<=l.y&&(a=c,l=u);break}}}return a?{distance:l,hitRegion:a}:void 0}function vw(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function xw(e,t){if(e===t)throw new Error("Cannot compare node with itself");const r={a:Ay(e),b:Ay(t)};let a;for(;r.a.at(-1)===r.b.at(-1);)a=r.a.pop(),r.b.pop();ot(a,"Stacking order can only be calculated for elements with a common ancestor");const l={a:Cy(Ny(r.a)),b:Cy(Ny(r.b))};if(l.a===l.b){const c=a.childNodes,u={a:r.a.at(-1),b:r.b.at(-1)};let d=c.length;for(;d--;){const h=c[d];if(h===u.a)return 1;if(h===u.b)return-1}}return Math.sign(l.a-l.b)}const Ew=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function _w(e){const t=getComputedStyle($1(e)??e).display;return t==="flex"||t==="inline-flex"}function Sw(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||_w(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||Ew.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function Ny(e){let t=e.length;for(;t--;){const r=e[t];if(ot(r,"Missing node"),Sw(r))return r}return null}function Cy(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Ay(e){const t=[];for(;e;)t.push(e),e=$1(e);return t}function $1(e){const{parentNode:t}=e;return vw(t)?t.host:t}function ww(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function kw({groupElement:e,hitRegion:t,pointerEventTarget:r}){if(!P1(r)||r.contains(e)||e.contains(r))return!0;if(xw(r,e)>0){let a=r;for(;a;){if(a.contains(e))return!0;if(ww(a.getBoundingClientRect(),t))return!1;a=a.parentElement}}return!0}function Jh(e,t){const r=[];return t.forEach((a,l)=>{if(l.disabled)return;const c=F1(l),u=yw(l.orientation,c,{x:e.clientX,y:e.clientY});u&&u.distance.x<=0&&u.distance.y<=0&&kw({groupElement:l.element,hitRegion:u.hitRegion.rect,pointerEventTarget:e.target})&&r.push(u.hitRegion)}),r}function Tw(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!=t[r])return!1;return!0}function yr(e,t){return un(e,t)?0:e>t?1:-1}function ys({overrideDisabledPanels:e,panelConstraints:t,prevSize:r,size:a}){const{collapsedSize:l=0,collapsible:c,disabled:u,maxSize:d=100,minSize:h=0}=t;if(u&&!e)return r;if(yr(a,h)<0)if(c){const p=(l+h)/2;yr(a,p)<0?a=l:a=h}else a=h;return a=Math.min(d,a),a=rr(a),a}function to({delta:e,initialLayout:t,panelConstraints:r,pivotIndices:a,prevLayout:l,trigger:c}){if(un(e,0))return t;const u=c==="imperative-api",d=Object.values(t),h=Object.values(l),p=[...d],[b,y]=a;ot(b!=null,"Invalid first pivot index"),ot(y!=null,"Invalid second pivot index");let v=0;switch(c){case"keyboard":{{const T=e<0?y:b,C=r[T];ot(C,`Panel constraints not found for index ${T}`);const{collapsedSize:S=0,collapsible:R,minSize:M=0}=C;if(R){const A=d[T];if(ot(A!=null,`Previous layout not found for panel index ${T}`),un(A,S)){const P=M-A;yr(P,Math.abs(e))>0&&(e=e<0?0-P:P)}}}{const T=e<0?b:y,C=r[T];ot(C,`No panel constraints found for index ${T}`);const{collapsedSize:S=0,collapsible:R,minSize:M=0}=C;if(R){const A=d[T];if(ot(A!=null,`Previous layout not found for panel index ${T}`),un(A,M)){const P=A-S;yr(P,Math.abs(e))>0&&(e=e<0?0-P:P)}}}break}default:{const T=e<0?y:b,C=r[T];ot(C,`Panel constraints not found for index ${T}`);const S=d[T],{collapsible:R,collapsedSize:M,minSize:A}=C;if(R&&yr(S,A)<0)if(e>0){const P=A-M,I=P/2,W=S+e;yr(W,A)<0&&(e=yr(e,I)<=0?0:P)}else{const P=A-M,I=100-P/2,W=S-e;yr(W,A)<0&&(e=yr(100+e,I)>0?0:-P)}break}}{const T=e<0?1:-1;let C=e<0?y:b,S=0;for(;;){const M=d[C];ot(M!=null,`Previous layout not found for panel index ${C}`);const A=ys({overrideDisabledPanels:u,panelConstraints:r[C],prevSize:M,size:100})-M;if(S+=A,C+=T,C<0||C>=r.length)break}const R=Math.min(Math.abs(e),Math.abs(S));e=e<0?0-R:R}{let T=e<0?b:y;for(;T>=0&&T<r.length;){const C=Math.abs(e)-Math.abs(v),S=d[T];ot(S!=null,`Previous layout not found for panel index ${T}`);const R=S-C,M=ys({overrideDisabledPanels:u,panelConstraints:r[T],prevSize:S,size:R});if(!un(S,M)&&(v+=S-M,p[T]=M,v.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?T--:T++}}if(Tw(h,p))return l;{const T=e<0?y:b,C=d[T];ot(C!=null,`Previous layout not found for panel index ${T}`);const S=C+v,R=ys({overrideDisabledPanels:u,panelConstraints:r[T],prevSize:C,size:S});if(p[T]=R,!un(R,S)){let M=S-R,A=e<0?y:b;for(;A>=0&&A<r.length;){const P=p[A];ot(P!=null,`Previous layout not found for panel index ${A}`);const I=P+M,W=ys({overrideDisabledPanels:u,panelConstraints:r[A],prevSize:P,size:I});if(un(P,W)||(M-=W-P,p[A]=W),un(M,0))break;e>0?A--:A++}}}const x=Object.values(p).reduce((T,C)=>C+T,0);if(!un(x,100,.1))return l;const _=Object.keys(l);return p.reduce((T,C,S)=>(T[_[S]]=C,T),{})}function ba(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(t[r]===void 0||yr(e[r],t[r])!==0)return!1;return!0}function ya({layout:e,panelConstraints:t}){const r=Object.values(e),a=[...r],l=a.reduce((d,h)=>d+h,0);if(a.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${a.map(d=>`${d}%`).join(", ")}`);if(!un(l,100)&&a.length>0)for(let d=0;d<t.length;d++){const h=a[d];ot(h!=null,`No layout data found for index ${d}`);const p=100/l*h;a[d]=p}let c=0;for(let d=0;d<t.length;d++){const h=r[d];ot(h!=null,`No layout data found for index ${d}`);const p=a[d];ot(p!=null,`No layout data found for index ${d}`);const b=ys({overrideDisabledPanels:!0,panelConstraints:t[d],prevSize:h,size:p});p!=b&&(c+=p-b,a[d]=b)}if(!un(c,0))for(let d=0;d<t.length;d++){const h=a[d];ot(h!=null,`No layout data found for index ${d}`);const p=h+c,b=ys({overrideDisabledPanels:!0,panelConstraints:t[d],prevSize:h,size:p});if(h!==b&&(c-=b-h,a[d]=b,un(c,0)))break}const u=Object.keys(e);return a.reduce((d,h,p)=>(d[u[p]]=h,d),{})}function G1({groupId:e,panelId:t}){const r=()=>{const{mountedGroups:d}=fn();for(const[h,{defaultLayoutDeferred:p,derivedPanelConstraints:b,layout:y,separatorToPanels:v}]of d)if(h.id===e)return{defaultLayoutDeferred:p,derivedPanelConstraints:b,group:h,layout:y,separatorToPanels:v};throw Error(`Group ${e} not found`)},a=()=>{const d=r().derivedPanelConstraints.find(h=>h.panelId===t);if(d!==void 0)return d;throw Error(`Panel constraints not found for Panel ${t}`)},l=()=>{const d=r().group.panels.find(h=>h.id===t);if(d!==void 0)return d;throw Error(`Layout not found for Panel ${t}`)},c=()=>{const d=r().layout[t];if(d!==void 0)return d;throw Error(`Layout not found for Panel ${t}`)},u=d=>{const h=c();if(d===h)return;const{defaultLayoutDeferred:p,derivedPanelConstraints:b,group:y,layout:v,separatorToPanels:x}=r(),_=y.panels.findIndex(R=>R.id===t),T=_===y.panels.length-1,C=to({delta:T?h-d:d-h,initialLayout:v,panelConstraints:b,pivotIndices:T?[_-1,_]:[_,_+1],prevLayout:v,trigger:"imperative-api"}),S=ya({layout:C,panelConstraints:b});ba(v,S)||hn(R=>({mountedGroups:new Map(R.mountedGroups).set(y,{defaultLayoutDeferred:p,derivedPanelConstraints:b,layout:S,separatorToPanels:x})}))};return{collapse:()=>{const{collapsible:d,collapsedSize:h}=a(),{mutableValues:p}=l(),b=c();d&&b!==h&&(p.expandToSize=b,u(h))},expand:()=>{const{collapsible:d,collapsedSize:h,minSize:p}=a(),{mutableValues:b}=l(),y=c();if(d&&y===h){let v=b.expandToSize??p;v===0&&(v=1),u(v)}},getSize:()=>{const{group:d}=r(),h=c(),{element:p}=l(),b=d.orientation==="horizontal"?p.offsetWidth:p.offsetHeight;return{asPercentage:h,inPixels:b}},isCollapsed:()=>{const{collapsible:d,collapsedSize:h}=a(),p=c();return d&&un(h,p)},resize:d=>{if(c()!==d){let h;switch(typeof d){case"number":{const{group:p}=r(),b=Cs({group:p});h=rr(d/b*100);break}case"string":{h=parseFloat(d);break}}u(h)}}}}function Oy(e){if(e.defaultPrevented)return;const{mountedGroups:t}=fn();Jh(e,t).forEach(r=>{if(r.separator){const a=r.panels.find(l=>l.panelConstraints.defaultSize!==void 0);if(a){const l=a.panelConstraints.defaultSize,c=G1({groupId:r.group.id,panelId:a.id});c&&l!==void 0&&(c.resize(l),e.preventDefault())}}})}function eu(e){const{mountedGroups:t}=fn();for(const[r]of t)if(r.separators.some(a=>a.element===e))return r;throw Error("Could not find parent Group for separator element")}function K1({groupId:e}){const t=()=>{const{mountedGroups:r}=fn();for(const[a,l]of r)if(a.id===e)return{group:a,...l};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:r,layout:a}=t();return r?{}:a},setLayout(r){const{defaultLayoutDeferred:a,derivedPanelConstraints:l,group:c,layout:u,separatorToPanels:d}=t(),h=ya({layout:r,panelConstraints:l});if(a)return u;if(!ba(u,h)){hn(b=>({mountedGroups:new Map(b.mountedGroups).set(c,{defaultLayoutDeferred:a,derivedPanelConstraints:l,layout:h,separatorToPanels:d})}));const p=c.panels.map(({id:b})=>b).join(",");c.inMemoryLayouts[p]=h}return h}}}function q1(e){const{mountedGroups:t}=fn(),r=t.get(e);return ot(r,`Mounted Group ${e.id} not found`),r}function da(e,t){const r=eu(e),a=q1(r),l=r.separators.find(b=>b.element===e);ot(l,"Matching separator not found");const c=a.separatorToPanels.get(l);ot(c,"Matching panels not found");const u=c.map(b=>r.panels.indexOf(b)),d=K1({groupId:r.id}).getLayout(),h=to({delta:t,initialLayout:d,panelConstraints:a.derivedPanelConstraints,pivotIndices:u,prevLayout:d,trigger:"keyboard"}),p=ya({layout:h,panelConstraints:a.derivedPanelConstraints});ba(d,p)||hn(b=>({mountedGroups:new Map(b.mountedGroups).set(r,{defaultLayoutDeferred:a.defaultLayoutDeferred,derivedPanelConstraints:a.derivedPanelConstraints,layout:p,separatorToPanels:a.separatorToPanels})}))}function Ry(e){if(e.defaultPrevented)return;const t=e.currentTarget,r=eu(t);if(!r.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),r.orientation==="vertical"&&da(t,5);break}case"ArrowLeft":{e.preventDefault(),r.orientation==="horizontal"&&da(t,-5);break}case"ArrowRight":{e.preventDefault(),r.orientation==="horizontal"&&da(t,5);break}case"ArrowUp":{e.preventDefault(),r.orientation==="vertical"&&da(t,-5);break}case"End":{e.preventDefault(),da(t,100);break}case"Enter":{e.preventDefault();const a=eu(t),{derivedPanelConstraints:l,layout:c,separatorToPanels:u}=q1(a),d=a.separators.find(y=>y.element===t);ot(d,"Matching separator not found");const h=u.get(d);ot(h,"Matching panels not found");const p=h[0],b=l.find(y=>y.panelId===p.id);if(ot(b,"Panel metadata not found"),b.collapsible){const y=c[p.id],v=b.collapsedSize===y?a.inMemoryLastExpandedPanelSizes[p.id]??b.minSize:b.collapsedSize;da(t,v-y)}break}case"F6":{e.preventDefault();const a=eu(t).separators.map(u=>u.element),l=Array.from(a).findIndex(u=>u===e.currentTarget);ot(l!==null,"Index not found");const c=e.shiftKey?l>0?l-1:a.length-1:l+1<a.length?l+1:0;a[c].focus();break}case"Home":{e.preventDefault(),da(t,-100);break}}}function My(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const{mountedGroups:t}=fn(),r=Jh(e,t),a=new Map;let l=!1;r.forEach(c=>{c.separator&&(l||(l=!0,c.separator.element.focus()));const u=t.get(c.group);u&&a.set(c.group,u.layout)}),hn({interactionState:{hitRegions:r,initialLayoutMap:a,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}}),r.length&&e.preventDefault()}const Nw=e=>e,Gf=()=>{},V1=1,Y1=2,W1=4,X1=8,Iy=3,Dy=12;let Pc;function Ly(){return Pc===void 0&&(Pc=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(Pc=!0)),Pc}function Cw({cursorFlags:e,groups:t,state:r}){let a=0,l=0;switch(r){case"active":case"hover":t.forEach(c=>{if(!c.disableCursor)switch(c.orientation){case"horizontal":{a++;break}case"vertical":{l++;break}}})}if(!(a===0&&l===0)){switch(r){case"active":{if(e&&Ly()){const c=(e&V1)!==0,u=(e&Y1)!==0,d=(e&W1)!==0,h=(e&X1)!==0;if(c)return d?"se-resize":h?"ne-resize":"e-resize";if(u)return d?"sw-resize":h?"nw-resize":"w-resize";if(d)return"s-resize";if(h)return"n-resize"}break}}return Ly()?a>0&&l>0?"move":a>0?"ew-resize":"ns-resize":a>0&&l>0?"grab":a>0?"col-resize":"row-resize"}}const zy=new WeakMap;function ep(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:r}=zy.get(e)??{};r===void 0&&(r=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets.push(r));const{cursorFlags:a,interactionState:l}=fn();switch(l.state){case"active":case"hover":{const c=Cw({cursorFlags:a,groups:l.hitRegions.map(d=>d.group),state:l.state}),u=`*, *:hover {cursor: ${c} !important; ${l.state==="active"?"touch-action: none;":""} }`;if(t===u)return;t=u,c?r.cssRules.length===0?r.insertRule(u):r.replaceSync(u):r.cssRules.length===1&&r.deleteRule(0);break}case"inactive":{t=void 0,r.cssRules.length===1&&r.deleteRule(0);break}}zy.set(e,{prevStyle:t,styleSheet:r})}function Z1({document:e,event:t,hitRegions:r,initialLayoutMap:a,mountedGroups:l,pointerDownAtPoint:c,prevCursorFlags:u}){let d=0;const h=new Map(l);r.forEach(b=>{const{group:y,groupSize:v}=b,{disableCursor:x,orientation:_,panels:T}=y;let C=0;c?_==="horizontal"?C=(t.clientX-c.x)/v*100:C=(t.clientY-c.y)/v*100:_==="horizontal"?C=t.clientX<0?-100:100:C=t.clientY<0?-100:100;const S=a.get(y),{defaultLayoutDeferred:R,derivedPanelConstraints:M,layout:A,separatorToPanels:P}=l.get(y)??{defaultLayoutDeferred:!1};if(M&&S&&A&&P){const I=to({delta:C,initialLayout:S,panelConstraints:M,pivotIndices:b.panels.map(W=>T.indexOf(W)),prevLayout:A,trigger:"mouse-or-touch"});if(ba(I,A)){if(C!==0&&!x)switch(_){case"horizontal":{d|=C<0?V1:Y1;break}case"vertical":{d|=C<0?W1:X1;break}}}else{h.set(b.group,{defaultLayoutDeferred:R,derivedPanelConstraints:M,layout:I,separatorToPanels:P});const W=b.group.panels.map(({id:te})=>te).join(",");b.group.inMemoryLayouts[W]=I}}});let p=0;t.movementX===0?p|=u&Iy:p|=d&Iy,t.movementY===0?p|=u&Dy:p|=d&Dy,hn({cursorFlags:p,mountedGroups:h}),ep(e)}function jy(e){const{cursorFlags:t,interactionState:r,mountedGroups:a}=fn();switch(r.state){case"active":Z1({document:e.currentTarget,event:e,hitRegions:r.hitRegions,initialLayoutMap:r.initialLayoutMap,mountedGroups:a,prevCursorFlags:t})}}function By(e){if(e.defaultPrevented)return;const{cursorFlags:t,interactionState:r,mountedGroups:a}=fn();switch(r.state){case"active":{if(e.buttons===0){hn(l=>l.interactionState.state==="inactive"?l:{cursorFlags:0,interactionState:{state:"inactive"}}),hn(l=>({mountedGroups:new Map(l.mountedGroups)}));return}Z1({document:e.currentTarget,event:e,hitRegions:r.hitRegions,initialLayoutMap:r.initialLayoutMap,mountedGroups:a,pointerDownAtPoint:r.pointerDownAtPoint,prevCursorFlags:t});break}default:{const l=Jh(e,a);l.length===0?r.state!=="inactive"&&hn({interactionState:{state:"inactive"}}):hn({interactionState:{hitRegions:l,state:"hover"}}),ep(e.currentTarget);break}}}function Uy(e){if(e.relatedTarget instanceof HTMLIFrameElement){const{interactionState:t}=fn();switch(t.state){case"hover":hn({interactionState:{state:"inactive"}})}}}function Py(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const{interactionState:t}=fn();switch(t.state){case"active":hn({cursorFlags:0,interactionState:{state:"inactive"}}),t.hitRegions.length>0&&(ep(e.currentTarget),hn(r=>({mountedGroups:new Map(r.mountedGroups)})),e.preventDefault())}}function Hy(e){let t=0,r=0;const a={};for(const c of e)if(c.defaultSize!==void 0){t++;const u=rr(c.defaultSize);r+=u,a[c.panelId]=u}else a[c.panelId]=void 0;const l=e.length-t;if(l!==0){const c=rr((100-r)/l);for(const u of e)u.defaultSize===void 0&&(a[u.panelId]=c)}return a}function Aw(e,t,r){if(!r[0])return;const a=e.panels.find(h=>h.element===t);if(!a||!a.onResize)return;const l=Cs({group:e}),c=e.orientation==="horizontal"?a.element.offsetWidth:a.element.offsetHeight,u=a.mutableValues.prevSize,d={asPercentage:rr(c/l*100),inPixels:c};a.mutableValues.prevSize=d,a.onResize(d,a.id,u)}function Ow(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function Rw(e,t){const r=e.map(l=>l.id),a=Object.keys(t);if(r.length!==a.length)return!1;for(const l of r)if(!a.includes(l))return!1;return!0}const us=new Map;function Mw(e){let t=!0;ot(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const r=e.element.ownerDocument.defaultView.ResizeObserver,a=new Set,l=new Set,c=new r(_=>{for(const T of _){const{borderBoxSize:C,target:S}=T;if(S===e.element){if(t){if(Cs({group:e})===0)return;hn(R=>{const M=R.mountedGroups.get(e);if(M){const A=kh(e),P=M.defaultLayoutDeferred?Hy(A):M.layout,I=ya({layout:P,panelConstraints:A});return!M.defaultLayoutDeferred&&ba(P,I)&&Ow(M.derivedPanelConstraints,A)?R:{mountedGroups:new Map(R.mountedGroups).set(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:A,layout:I,separatorToPanels:M.separatorToPanels})}}return R})}}else Aw(e,S,C)}});c.observe(e.element),e.panels.forEach(_=>{ot(!a.has(_.id),`Panel ids must be unique; id "${_.id}" was used more than once`),a.add(_.id),_.onResize&&c.observe(_.element)});const u=Cs({group:e}),d=kh(e),h=e.panels.map(({id:_})=>_).join(",");let p=e.defaultLayout;p&&(Rw(e.panels,p)||(p=void 0));const b=e.inMemoryLayouts[h]??p??Hy(d),y=ya({layout:b,panelConstraints:d}),v=F1(e),x=e.element.ownerDocument;return hn(_=>{const T=new Map;return us.set(x,(us.get(x)??0)+1),v.forEach(C=>{C.separator&&T.set(C.separator,C.panels)}),{mountedGroups:new Map(_.mountedGroups).set(e,{defaultLayoutDeferred:u===0,derivedPanelConstraints:d,layout:y,separatorToPanels:T})}}),e.separators.forEach(_=>{ot(!l.has(_.id),`Separator ids must be unique; id "${_.id}" was used more than once`),l.add(_.id),_.element.addEventListener("keydown",Ry)}),us.get(x)===1&&(x.addEventListener("dblclick",Oy,!0),x.addEventListener("pointerdown",My,!0),x.addEventListener("pointerleave",jy),x.addEventListener("pointermove",By),x.addEventListener("pointerout",Uy),x.addEventListener("pointerup",Py,!0)),function(){t=!1,us.set(x,Math.max(0,(us.get(x)??0)-1)),hn(_=>{const T=new Map(_.mountedGroups);return T.delete(e),{mountedGroups:T}}),e.separators.forEach(_=>{_.element.removeEventListener("keydown",Ry)}),us.get(x)||(x.removeEventListener("dblclick",Oy,!0),x.removeEventListener("pointerdown",My,!0),x.removeEventListener("pointerleave",jy),x.removeEventListener("pointermove",By),x.removeEventListener("pointerout",Uy),x.removeEventListener("pointerup",Py,!0)),c.disconnect()}}function Iw(){const[e,t]=D.useState({}),r=D.useCallback(()=>t({}),[]);return[e,r]}function tp(e){const t=D.useId();return`${e??t}`}const Ea=typeof window<"u"?D.useLayoutEffect:D.useEffect;function Kl(e){const t=D.useRef(e);return Ea(()=>{t.current=e},[e]),D.useCallback((...r)=>{var a;return(a=t.current)==null?void 0:a.call(t,...r)},[t])}function np(...e){return Kl(t=>{e.forEach(r=>{if(r)switch(typeof r){case"function":{r(t);break}case"object":{r.current=t;break}}})})}function rp(e){const t=D.useRef({...e});return Ea(()=>{for(const r in e)t.current[r]=e[r]},[e]),t.current}const Q1=D.createContext(null);function Dw(e,t){const r=D.useRef({getLayout:()=>({}),setLayout:Nw});D.useImperativeHandle(t,()=>r.current,[]),Ea(()=>{Object.assign(r.current,K1({groupId:e}))})}function no({children:e,className:t,defaultLayout:r,disableCursor:a,disabled:l,elementRef:c,groupRef:u,id:d,onLayoutChange:h,onLayoutChanged:p,orientation:b="horizontal",resizeTargetMinimumSize:y={coarse:20,fine:10},style:v,...x}){const _=D.useRef({onLayoutChange:{},onLayoutChanged:{}}),T=Kl(F=>{ba(_.current.onLayoutChange,F)||(_.current.onLayoutChange=F,h==null||h(F))}),C=Kl(F=>{ba(_.current.onLayoutChanged,F)||(_.current.onLayoutChanged=F,p==null||p(F))}),S=tp(d),R=D.useRef(null),[M,A]=Iw(),P=D.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:y,separators:[]}),I=np(R,c);Dw(S,u);const W=Kl((F,X)=>{const{interactionState:me,mountedGroups:le}=fn();for(const K of le.keys())if(K.id===F){const z=le.get(K);if(z){let Q=!1;switch(me.state){case"active":{Q=me.hitRegions.some(ie=>ie.group===K);break}}return{flexGrow:z.layout[X]??1,pointerEvents:Q?"none":void 0}}}return{flexGrow:(r==null?void 0:r[X])??1}}),te=rp({defaultLayout:r,disableCursor:a}),ee=D.useMemo(()=>({get disableCursor(){return!!te.disableCursor},getPanelStyles:W,id:S,orientation:b,registerPanel:F=>{const X=P.current;return X.panels=Th(b,[...X.panels,F]),A(),()=>{X.panels=X.panels.filter(me=>me!==F),A()}},registerSeparator:F=>{const X=P.current;return X.separators=Th(b,[...X.separators,F]),A(),()=>{X.separators=X.separators.filter(me=>me!==F),A()}},togglePanelDisabled:(F,X)=>{const me=P.current.panels.find(K=>K.id===F);me&&(me.panelConstraints.disabled=X);const{mountedGroups:le}=fn();for(const K of le.keys())if(K.id===S){const z=le.get(K);z&&(z.derivedPanelConstraints=kh(K))}},toggleSeparatorDisabled:(F,X)=>{const me=P.current.separators.find(le=>le.id===F);me&&(me.disabled=X)}}),[W,S,A,b,te]),U=D.useRef(null);return Ea(()=>{const F=R.current;if(F===null)return;const X=P.current;let me;if(te.defaultLayout!==void 0&&Object.keys(te.defaultLayout).length===X.panels.length){me={};for(const B of X.panels){const w=te.defaultLayout[B.id];w!==void 0&&(me[B.id]=w)}}const le={defaultLayout:me,disableCursor:!!te.disableCursor,disabled:!!l,element:F,id:S,inMemoryLastExpandedPanelSizes:P.current.lastExpandedPanelSizes,inMemoryLayouts:P.current.layouts,orientation:b,panels:X.panels,resizeTargetMinimumSize:X.resizeTargetMinimumSize,separators:X.separators};U.current=le;const K=Mw(le),z=fn().mountedGroups.get(le);if(z){const{defaultLayoutDeferred:B,derivedPanelConstraints:w,layout:O}=z;!B&&w.length>0&&(T(O),C(O))}const Q=Qr.addListener("interactionStateChange",B=>{B.state}),ie=Qr.addListener("mountedGroupsChange",B=>{const w=B.get(le);if(w){const{defaultLayoutDeferred:O,derivedPanelConstraints:G,layout:N}=w;if(O||G.length===0)return;const{interactionState:de}=fn(),fe=de.state!=="active";T(N),fe&&C(N)}});return()=>{U.current=null,K(),Q(),ie()}},[l,S,C,T,b,M,te]),D.useEffect(()=>{const F=U.current;F&&(F.defaultLayout=r,F.disableCursor=!!a)}),m.jsx(Q1.Provider,{value:ee,children:m.jsx("div",{...x,className:t,"data-group":!0,"data-testid":S,id:S,ref:I,style:{height:"100%",width:"100%",overflow:"hidden",...v,display:"flex",flexDirection:b==="horizontal"?"row":"column",flexWrap:"nowrap"},children:e})})}no.displayName="Group";function Kf(e,t){return`react-resizable-panels:${[e,...t].join(":")}`}function lu({debounceSaveMs:e=100,panelIds:t,storage:r=localStorage,...a}){const l=t!==void 0,c="id"in a?a.id:a.groupId,u=Kf(c,t??[]),d=D.useSyncExternalStore(Lw,()=>r.getItem(u),()=>r.getItem(u)),h=D.useMemo(()=>d?JSON.parse(d):void 0,[d]),p=D.useRef(null),b=D.useCallback(()=>{const x=p.current;x&&(p.current=null,clearTimeout(x))},[]);D.useLayoutEffect(()=>()=>{b()},[b]);const y=D.useCallback(x=>{b();let _;l?_=Kf(c,Object.keys(x)):_=Kf(c,[]);try{r.setItem(_,JSON.stringify(x))}catch(T){console.error(T)}},[b,l,c,r]),v=D.useCallback(x=>{b(),e===0?y(x):p.current=setTimeout(()=>{y(x)},e)},[b,e,y]);return{defaultLayout:h,onLayoutChange:v,onLayoutChanged:y}}function Lw(){return function(){}}function ip(){const e=D.useContext(Q1);return ot(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function zw(e,t){const{id:r}=ip(),a=D.useRef({collapse:Gf,expand:Gf,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Gf});D.useImperativeHandle(t,()=>a.current,[]),Ea(()=>{Object.assign(a.current,G1({groupId:r,panelId:e}))})}function vr({children:e,className:t,collapsedSize:r="0%",collapsible:a=!1,defaultSize:l,disabled:c,elementRef:u,id:d,maxSize:h="100%",minSize:p="0%",onResize:b,panelRef:y,style:v,...x}){const _=!!d,T=tp(d),C=rp({disabled:c}),S=D.useRef(null),R=np(S,u),{getPanelStyles:M,id:A,registerPanel:P,togglePanelDisabled:I}=ip(),W=b!==null,te=Kl((U,F,X)=>{b==null||b(U,d,X)});Ea(()=>{const U=S.current;if(U!==null){const F={element:U,id:T,idIsStable:_,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:W?te:void 0,panelConstraints:{collapsedSize:r,collapsible:a,defaultSize:l,disabled:C.disabled,maxSize:h,minSize:p}};return P(F)}},[r,a,l,W,T,_,h,p,te,P,C]),D.useEffect(()=>{I(T,!!c)},[c,T,I]),zw(T,y);const ee=D.useSyncExternalStore(U=>(Qr.addListener("mountedGroupsChange",U),()=>{Qr.removeListener("mountedGroupsChange",U)}),()=>JSON.stringify(M(A,T)),()=>JSON.stringify(M(A,T)));return m.jsx("div",{...x,"aria-disabled":c||void 0,"data-panel":!0,"data-testid":T,id:T,ref:R,style:{...jw,display:"flex",flexBasis:0,flexShrink:1,overflow:"hidden",...JSON.parse(ee)},children:m.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,...v},children:e})})}vr.displayName="Panel";const jw={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function Bw({layout:e,panelConstraints:t,panelId:r,panelIndex:a}){let l,c;const u=e[r],d=t.find(h=>h.panelId===r);if(d){const h=d.maxSize,p=d.collapsible?d.collapsedSize:d.minSize,b=[a,a+1];c=ya({layout:to({delta:p-u,initialLayout:e,panelConstraints:t,pivotIndices:b,prevLayout:e}),panelConstraints:t})[r],l=ya({layout:to({delta:h-u,initialLayout:e,panelConstraints:t,pivotIndices:b,prevLayout:e}),panelConstraints:t})[r]}return{valueControls:r,valueMax:l,valueMin:c,valueNow:u}}function J1({children:e,className:t,disabled:r,elementRef:a,id:l,style:c,...u}){const d=tp(l),h=rp({disabled:r}),[p,b]=D.useState({}),[y,v]=D.useState("inactive"),x=D.useRef(null),_=np(x,a),{disableCursor:T,id:C,orientation:S,registerSeparator:R,toggleSeparatorDisabled:M}=ip(),A=S==="horizontal"?"vertical":"horizontal";Ea(()=>{const I=x.current;if(I!==null){const W={disabled:h.disabled,element:I,id:d},te=R(W),ee=Qr.addListener("interactionStateChange",F=>{v(F.state!=="inactive"&&F.hitRegions.some(X=>X.separator===W)?F.state:"inactive")}),U=Qr.addListener("mountedGroupsChange",F=>{F.forEach(({derivedPanelConstraints:X,layout:me,separatorToPanels:le},K)=>{if(K.id===C){const z=le.get(W);if(z){const Q=z[0],ie=K.panels.indexOf(Q);b(Bw({layout:me,panelConstraints:X,panelId:Q.id,panelIndex:ie}))}}})});return()=>{ee(),U(),te()}}},[C,d,R,h]),D.useEffect(()=>{M(d,!!r)},[r,d,M]);let P;return r&&!T&&(P="not-allowed"),m.jsx("div",{...u,"aria-controls":p.valueControls,"aria-disabled":r||void 0,"aria-orientation":A,"aria-valuemax":p.valueMax,"aria-valuemin":p.valueMin,"aria-valuenow":p.valueNow,children:e,className:t,"data-separator":r?"disabled":y,"data-testid":d,id:d,ref:_,role:"separator",style:{flexBasis:"auto",cursor:P,...c,flexGrow:0,flexShrink:0},tabIndex:r?void 0:0})}J1.displayName="Separator";const ap={user:null,activeView:"messages",agents:[],selectedAgentId:null,selectedSessionKey:null,channels:[],selectedChannelId:null,sessions:[],selectedSessionId:null,tasks:[],selectedTaskId:null,jobs:[],selectedJobId:null,messages:[],threadMessages:[],activeThreadId:null,threadReplyCounts:{},openclawConnected:!1,sessionModel:null,wsConnected:!1,models:[],defaultModel:null,streamingRunId:null,streamingSessionKey:null,streamingThreadId:null,cronTasks:[],selectedCronTaskId:null,cronJobs:[],selectedCronJobId:null};function Uw(e,t){switch(t.type){case"SET_USER":return{...e,user:t.user};case"SET_ACTIVE_VIEW":return{...e,activeView:t.view};case"SET_AGENTS":return{...e,agents:t.agents};case"SELECT_AGENT":return{...e,selectedAgentId:t.agentId,selectedSessionKey:t.sessionKey,sessions:[],selectedSessionId:null,messages:[],jobs:[],selectedJobId:null,activeThreadId:null,threadMessages:[]};case"SET_CHANNELS":return{...e,channels:t.channels};case"SELECT_CHANNEL":return{...e,selectedChannelId:t.channelId,sessions:[],selectedSessionId:null,tasks:[],selectedTaskId:null,jobs:[],selectedJobId:null,messages:[]};case"SET_SESSIONS":return{...e,sessions:t.sessions};case"SELECT_SESSION":{const r=t.sessionKey??e.selectedSessionKey,a=r!==e.selectedSessionKey;return{...e,selectedSessionId:t.sessionId,selectedSessionKey:r,messages:a?[]:e.messages,activeThreadId:a?null:e.activeThreadId,threadMessages:a?[]:e.threadMessages}}case"ADD_SESSION":return{...e,sessions:[...e.sessions,t.session]};case"REMOVE_SESSION":return{...e,sessions:e.sessions.filter(r=>r.id!==t.sessionId),...e.selectedSessionId===t.sessionId?{selectedSessionId:null,selectedSessionKey:null,messages:[]}:{}};case"RENAME_SESSION":return{...e,sessions:e.sessions.map(r=>r.id===t.sessionId?{...r,name:t.name}:r)};case"SET_TASKS":return{...e,tasks:t.tasks};case"SELECT_TASK":{const r=t.sessionKey??e.selectedSessionKey,a=r!==e.selectedSessionKey;return{...e,selectedTaskId:t.taskId,selectedSessionKey:r,messages:a?[]:e.messages,jobs:[],selectedJobId:null}}case"SET_JOBS":return{...e,jobs:t.jobs};case"SELECT_JOB":return{...e,selectedJobId:t.jobId,selectedSessionKey:t.sessionKey??e.selectedSessionKey,messages:[]};case"ADD_JOB":return{...e,jobs:[t.job,...e.jobs]};case"ADD_MESSAGE":{const r=e.messages[e.messages.length-1];return t.message.sender==="agent"&&(r!=null&&r.isStreaming)?{...e,streamingRunId:null,streamingSessionKey:null,messages:[...e.messages.slice(0,-1),{...t.message,isStreaming:!1}]}:{...e,messages:[...e.messages,t.message]}}case"SET_MESSAGES":return{...e,messages:t.messages,...t.replyCounts?{threadReplyCounts:{...e.threadReplyCounts,...t.replyCounts}}:{}};case"OPEN_THREAD":return{...e,activeThreadId:t.threadId,threadMessages:t.messages,threadReplyCounts:{...e.threadReplyCounts,...t.messages.length>0?{[t.threadId]:t.messages.length}:{}}};case"CLOSE_THREAD":return{...e,activeThreadId:null,threadMessages:[]};case"ADD_THREAD_MESSAGE":{const r=t.message.threadId??e.activeThreadId,a=!!(r&&r===e.activeThreadId);let l=e.threadMessages,c={};if(a){const d=e.threadMessages[e.threadMessages.length-1];t.message.sender==="agent"&&(d!=null&&d.isStreaming)?(l=[...e.threadMessages.slice(0,-1),{...t.message,isStreaming:!1}],c={streamingRunId:null,streamingSessionKey:null,streamingThreadId:null}):l=[...e.threadMessages,t.message]}const u={...e.threadReplyCounts};return r&&(a?u[r]=l.length:u[r]=(u[r]??0)+1),{...e,...c,threadMessages:l,threadReplyCounts:u}}case"SET_OPENCLAW_CONNECTED":return{...e,openclawConnected:t.connected,defaultModel:e.defaultModel??t.defaultModel??null};case"SET_SESSION_MODEL":return{...e,sessionModel:t.model};case"SET_WS_CONNECTED":return{...e,wsConnected:t.connected};case"SET_MODELS":return{...e,models:t.models};case"SET_DEFAULT_MODEL":return{...e,defaultModel:t.model};case"RESOLVE_ACTION":return{...e,messages:e.messages.map(r=>r.id===t.messageId?{...r,resolvedActions:{...r.resolvedActions,[t.promptHash]:{value:t.value,label:t.label}}}:r)};case"STREAM_START":{const r={id:`stream_${t.runId}`,sender:"agent",text:"",timestamp:Date.now(),isStreaming:!0},a=!!t.threadId;return{...e,streamingRunId:t.runId,streamingSessionKey:t.sessionKey,streamingThreadId:t.threadId??null,...a?{threadMessages:[...e.threadMessages,r]}:{messages:[...e.messages,r]}}}case"STREAM_CHUNK":{if(e.streamingRunId!==t.runId)return e;const r=`stream_${t.runId}`;return e.streamingThreadId?{...e,threadMessages:e.threadMessages.map(a=>a.id===r?{...a,text:t.text}:a)}:{...e,messages:e.messages.map(a=>a.id===r?{...a,text:t.text}:a)}}case"STREAM_END":return e.streamingRunId&&e.streamingRunId!==t.runId?e:{...e,streamingRunId:null,streamingSessionKey:null,streamingThreadId:null};case"SET_CRON_TASKS":return{...e,cronTasks:t.cronTasks};case"MERGE_SCAN_DATA":{const r=new Map(t.scanTasks.map(c=>[c.cronJobId,c])),a=e.cronTasks.map(c=>{const u=c.openclawCronJobId?r.get(c.openclawCronJobId):null;return u?{...c,schedule:u.schedule||null,instructions:u.instructions||null,model:u.model||null,enabled:u.enabled}:c}),l=e.tasks.map(c=>{const u=c.openclawCronJobId?r.get(c.openclawCronJobId):null;return u?{...c,schedule:u.schedule||null,instructions:u.instructions||null,model:u.model||null,enabled:u.enabled}:c});return{...e,cronTasks:a,tasks:l}}case"UPDATE_CRON_TASK":return{...e,cronTasks:e.cronTasks.map(r=>r.id===t.taskId?{...r,...t.updates}:r),tasks:e.tasks.map(r=>r.id===t.taskId?{...r,...t.updates}:r)};case"SELECT_CRON_TASK":return e.selectedCronTaskId===t.taskId?e:{...e,selectedCronTaskId:t.taskId,cronJobs:[],selectedCronJobId:null,messages:[],selectedSessionKey:null};case"SET_CRON_JOBS":return{...e,cronJobs:t.cronJobs};case"SELECT_CRON_JOB":return{...e,selectedCronJobId:t.jobId,selectedSessionKey:t.sessionKey??e.selectedSessionKey,messages:[]};case"ADD_CRON_JOB":return{...e,cronJobs:[t.job,...e.cronJobs]};case"UPDATE_CRON_JOB":return e.cronJobs.some(a=>a.id===t.job.id)?{...e,cronJobs:e.cronJobs.map(a=>{var c;if(a.id!==t.job.id)return a;const l=a.summary&&a.summary.length>(((c=t.job.summary)==null?void 0:c.length)||0)?a.summary:t.job.summary;return{...a,...t.job,summary:l}})}:{...e,cronJobs:[t.job,...e.cronJobs]};case"APPEND_JOB_OUTPUT":{const r=a=>a.map(l=>l.id===t.jobId?{...l,summary:t.text}:l);return{...e,jobs:r(e.jobs),cronJobs:r(e.cronJobs)}}case"LOGOUT":return{...ap};default:return e}}const vs=D.createContext(ap),Ul=D.createContext(()=>{});function lr(){return D.useContext(vs)}function ti(){return D.useContext(Ul)}const Fy=500;let Pw=1;const xs=[],ou=new Set;function ds(e,t,r,a){const l={id:Pw++,ts:Date.now(),level:e,tag:t,message:r,detail:a!==void 0?typeof a=="string"?a:JSON.stringify(a,null,2):void 0};xs.push(l),xs.length>Fy&&xs.splice(0,xs.length-Fy);for(const c of ou)c()}function Hw(){return xs}function Fw(){xs.length=0;for(const e of ou)e()}function $w(e){return ou.add(e),()=>ou.delete(e)}const ue={info:(e,t,r)=>ds("info",e,t,r),warn:(e,t,r)=>ds("warn",e,t,r),error:(e,t,r)=>ds("error",e,t,r),wsIn:(e,t,r)=>ds("ws-in",e,t,r),wsOut:(e,t,r)=>ds("ws-out",e,t,r),api:(e,t,r)=>ds("api",e,t,r)},Nh="/api";let ql=localStorage.getItem("botschat_token"),cu=localStorage.getItem("botschat_refresh_token");function uo(e){ql=e,e?localStorage.setItem("botschat_token",e):localStorage.removeItem("botschat_token")}function Su(e){cu=e,e?localStorage.setItem("botschat_refresh_token",e):localStorage.removeItem("botschat_refresh_token")}function $y(){return ql}async function Gw(){if(!cu)return!1;try{const e=await fetch(`${Nh}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:cu})});if(!e.ok)return!1;const t=await e.json();return uo(t.token),ue.info("API","Access token refreshed successfully"),!0}catch{return!1}}async function nt(e,t,r){const a=`${e} ${t}`;ue.api("API",`→ ${a}`,r);const l={"Content-Type":"application/json"};ql&&(l.Authorization=`Bearer ${ql}`);const c=performance.now();let u;try{u=await fetch(`${Nh}${t}`,{method:e,headers:l,body:r?JSON.stringify(r):void 0,cache:"no-store"})}catch(p){const b=Math.round(performance.now()-c);throw ue.error("API",`✗ ${a} — network error (${b}ms)`,String(p)),p}if(u.status===401&&cu&&!t.includes("/auth/refresh")&&await Gw()){l.Authorization=`Bearer ${ql}`;try{u=await fetch(`${Nh}${t}`,{method:e,headers:l,body:r?JSON.stringify(r):void 0,cache:"no-store"})}catch(b){const y=Math.round(performance.now()-c);throw ue.error("API",`✗ ${a} — network error on retry (${y}ms)`,String(b)),b}}const d=Math.round(performance.now()-c);if(!u.ok){const b=(await u.json().catch(()=>({error:u.statusText}))).error??`HTTP ${u.status}`;throw ue.error("API",`✗ ${a} — ${u.status} (${d}ms): ${b}`),new Error(b)}const h=await u.json();return ue.api("API",`✓ ${a} — ${u.status} (${d}ms)`,h),h}const Pl={config:()=>nt("GET","/auth/config"),register:(e,t,r)=>nt("POST","/auth/register",{email:e,password:t,displayName:r}),login:(e,t)=>nt("POST","/auth/login",{email:e,password:t}),firebase:e=>nt("POST","/auth/firebase",{idToken:e}),me:()=>nt("GET","/me")},Kw={updateSettings:e=>nt("PATCH","/me",e)},qw={list:()=>nt("GET","/models")},_s={list:()=>nt("GET","/agents")},Er={list:()=>nt("GET","/channels"),get:e=>nt("GET",`/channels/${e}`),create:e=>nt("POST","/channels",e),update:(e,t)=>nt("PATCH",`/channels/${e}`,t),delete:e=>nt("DELETE",`/channels/${e}`)},Es={list:e=>nt("GET",`/channels/${e}/sessions`),create:(e,t)=>nt("POST",`/channels/${e}/sessions`,{name:t}),rename:(e,t,r)=>nt("PATCH",`/channels/${e}/sessions/${t}`,{name:r}),delete:(e,t)=>nt("DELETE",`/channels/${e}/sessions/${t}`)},Xn={list:e=>nt("GET",`/channels/${e}/tasks`),listAll:(e="background")=>nt("GET",`/tasks?kind=${e}`),scanData:()=>nt("GET","/task-scan"),create:(e,t)=>nt("POST",`/channels/${e}/tasks`,t),update:(e,t,r)=>nt("PATCH",`/channels/${e}/tasks/${t}`,r),delete:(e,t)=>nt("DELETE",`/channels/${e}/tasks/${t}`),run:(e,t)=>nt("POST",`/channels/${e}/tasks/${t}/run`)},Ch={list:(e,t)=>nt("GET",`/channels/${e}/tasks/${t}/jobs`),listByTask:e=>nt("GET",`/tasks/${e}/jobs`)},ex={list:(e,t,r)=>nt("GET",`/messages/${e}?sessionKey=${encodeURIComponent(t)}${r?`&threadId=${encodeURIComponent(r)}`:""}`)},Hl={list:()=>nt("GET","/pairing-tokens"),create:e=>nt("POST","/pairing-tokens",{label:e}),delete:e=>nt("DELETE",`/pairing-tokens/${e}`)},tx={cloudUrl:()=>nt("GET","/setup/cloud-url")};function wu({value:e,onChange:t,models:r,disabled:a,placeholder:l="Select model...",compact:c}){const d=!r.find(T=>T.id===e)&&e?r.find(T=>T.name===e):null,h=d?d.id:e,p=!h||r.some(T=>T.id===h);D.useEffect(()=>{d&&e!==d.id&&t(d.id)},[d,e,t]);const b=D.useRef(null),[y,v]=D.useState(void 0),x=h||l,_=D.useCallback(()=>{if(!c||!b.current)return;const T=getComputedStyle(b.current),S=document.createElement("canvas").getContext("2d");if(!S)return;S.font=`${T.fontSize} ${T.fontFamily}`;const R=S.measureText(x).width,M=parseFloat(T.paddingLeft)||6,A=parseFloat(T.paddingRight)||6;v(Math.ceil(R)+M+A+22)},[c,x]);return D.useEffect(()=>{_()},[_]),m.jsxs("select",{ref:b,value:h,onChange:T=>t(T.target.value),disabled:a,className:`rounded-sm focus:outline-none ${c?"text-caption py-0.5 px-1.5":"text-body py-1.5 px-2.5"}`,style:{background:c?"transparent":"var(--bg-hover)",color:h?"var(--text-primary)":"var(--text-muted)",border:c?"1px solid transparent":"1px solid var(--border)",cursor:a?"not-allowed":"pointer",opacity:a?.5:1,width:c&&y?y:void 0,maxWidth:"100%",fontFamily:"var(--font-mono)",textOverflow:"ellipsis",overflow:"hidden"},children:[!h&&m.jsx("option",{value:"",children:l}),h&&!p&&m.jsx("option",{value:h,children:h}),r.map(T=>m.jsx("option",{value:T.id,children:T.id},T.id))]})}const Vw="modulepreload",Yw=function(e){return"/"+e},Gy={},Ky=function(t,r,a){let l=Promise.resolve();if(r&&r.length>0){let u=function(p){return Promise.all(p.map(b=>Promise.resolve(b).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),h=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));l=u(r.map(p=>{if(p=Yw(p),p in Gy)return;Gy[p]=!0;const b=p.endsWith(".css"),y=b?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${y}`))return;const v=document.createElement("link");if(v.rel=b?"stylesheet":Vw,b||(v.as="script"),v.crossOrigin="",v.href=p,h&&v.setAttribute("nonce",h),document.head.appendChild(v),b)return new Promise((x,_)=>{v.addEventListener("load",x),v.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${p}`)))})}))}function c(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return l.then(u=>{for(const d of u||[])d.status==="rejected"&&c(d.reason);return t().catch(c)})};var U1;const ku=typeof globalThis.process<"u"&&typeof((U1=globalThis.process.versions)==null?void 0:U1.node)=="string",nx=31e4,rx=32,ix=16,ax="botschat-e2e:";function ro(e){return new TextEncoder().encode(e)}function Ww(e){return new TextDecoder().decode(e)}async function Xw(e,t){const r=ro(e),a=ro(ax+t),l=await crypto.subtle.importKey("raw",r.buffer,"PBKDF2",!1,["deriveBits"]),c=new ArrayBuffer(a.byteLength);new Uint8Array(c).set(a);const u=await crypto.subtle.deriveBits({name:"PBKDF2",salt:c,iterations:nx,hash:"SHA-256"},l,rx*8);return new Uint8Array(u)}async function sx(e,t){const r=await crypto.subtle.importKey("raw",e.buffer,{name:"HMAC",hash:"SHA-256"},!1,["sign"]),a=ro("nonce-"+t),l=new Uint8Array(a.length+1);l.set(a),l[a.length]=1;const c=await crypto.subtle.sign("HMAC",r,l.buffer);return new Uint8Array(c).slice(0,ix)}async function Zw(e,t,r){const a=await sx(e,r),l=await crypto.subtle.importKey("raw",e.buffer,{name:"AES-CTR"},!1,["encrypt"]),c=await crypto.subtle.encrypt({name:"AES-CTR",counter:new Uint8Array(a).buffer,length:128},l,t.buffer);return new Uint8Array(c)}async function Qw(e,t,r){const a=await sx(e,r),l=await crypto.subtle.importKey("raw",e.buffer,{name:"AES-CTR"},!1,["decrypt"]),c=await crypto.subtle.decrypt({name:"AES-CTR",counter:new Uint8Array(a).buffer,length:128},l,t.buffer);return new Uint8Array(c)}let Bi=null,Vl=null;const Yl=globalThis;ku&&Yl.__e2e_nodeCrypto&&(Bi=Yl.__e2e_nodeCrypto,Vl=Yl.__e2e_nodeUtil);async function Tu(){Bi&&Vl||(Bi=await Ky(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]),Vl=await Ky(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]),Yl.__e2e_nodeCrypto=Bi,Yl.__e2e_nodeUtil=Vl)}async function Jw(e,t){await Tu();const r=Vl.promisify(Bi.pbkdf2),a=ax+t,l=await r(e,a,nx,rx,"sha256");return new Uint8Array(l)}async function lx(e,t){await Tu();const r=ro("nonce-"+t),a=new Uint8Array(r.length+1);a.set(r),a[r.length]=1;const l=Bi.createHmac("sha256",Buffer.from(e));l.update(Buffer.from(a));const c=l.digest();return new Uint8Array(c.buffer,c.byteOffset,ix)}async function ek(e,t,r){await Tu();const a=await lx(e,r),l=Bi.createCipheriv("aes-256-ctr",Buffer.from(e),Buffer.from(a)),c=Buffer.concat([l.update(Buffer.from(t)),l.final()]);return new Uint8Array(c)}async function tk(e,t,r){await Tu();const a=await lx(e,r),l=Bi.createDecipheriv("aes-256-ctr",Buffer.from(e),Buffer.from(a)),c=Buffer.concat([l.update(Buffer.from(t)),l.final()]);return new Uint8Array(c)}async function nk(e,t){return ku?Jw(e,t):Xw(e,t)}async function rk(e,t,r){const a=ro(t);return ku?ek(e,a,r):Zw(e,a,r)}async function qy(e,t,r){const a=ku?await tk(e,t,r):await Qw(e,t,r);return Ww(a)}function Vy(e){if(typeof Buffer<"u")return Buffer.from(e).toString("base64");let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Ah(e){if(typeof Buffer<"u"){const a=Buffer.from(e,"base64");return new Uint8Array(a.buffer,a.byteOffset,a.byteLength)}const t=atob(e),r=new Uint8Array(t.length);for(let a=0;a<t.length;a++)r[a]=t.charCodeAt(a);return r}const ha="botschat_e2e_pwd_cache",Fl="botschat_e2e_key_cache";let zn=null,$l=null;const qf=new Set;try{const e=localStorage.getItem(Fl);e&&(zn=Ah(e),$l=localStorage.getItem(ha))}catch{}const vt={subscribe(e){return qf.add(e),()=>qf.delete(e)},notify(){qf.forEach(e=>e())},async setPassword(e,t,r){if(!e){zn=null,$l=null,localStorage.removeItem(ha),localStorage.removeItem(Fl),this.notify();return}try{zn=await nk(e,t),$l=e,r?(localStorage.setItem(ha,e),localStorage.setItem(Fl,Vy(zn))):(localStorage.removeItem(ha),localStorage.removeItem(Fl)),this.notify()}catch(a){throw console.error("Failed to derive E2E key:",a),a}},clear(){zn=null,$l=null,localStorage.removeItem(ha),localStorage.removeItem(Fl),this.notify()},hasKey(){return!!zn},hasSavedPassword(){return!!localStorage.getItem(ha)},async loadSavedPassword(e){if(zn)return!0;const t=localStorage.getItem(ha);if(!t)return!1;try{return await this.setPassword(t,e,!0),!0}catch{return!1}},async encrypt(e){if(!zn)throw new Error("E2E key not set");const t=crypto.randomUUID(),r=await rk(zn,e,t);return{ciphertext:Vy(r),messageId:t}},async decrypt(e,t){if(!zn)throw new Error("E2E key not set");const r=Ah(e);return qy(zn,r,t)},getPassword(){return $l},async decryptBytes(e,t){if(!zn)throw new Error("E2E key not set");const r=Ah(e),a=await qy(zn,r,t);return new TextEncoder().encode(a)}};class ik{constructor(t){cs(this,"ws",null);cs(this,"reconnectTimer",null);cs(this,"backoffMs",1e3);cs(this,"intentionalClose",!1);cs(this,"_connected",!1);this.opts=t}get connected(){return this._connected}connect(){this.intentionalClose=!1;const r=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/ws/${this.opts.userId}/${this.opts.sessionId}`;ue.info("WS",`Connecting to ${r}`),this.ws=new WebSocket(r),this.ws.onopen=()=>{ue.info("WS","Socket opened, sending auth"),this.ws.send(JSON.stringify({type:"auth",token:this.opts.token}))},this.ws.onmessage=async a=>{try{const l=JSON.parse(a.data);if(console.log(`[E2E-WS] msg.type=${l.type} encrypted=${l.encrypted} hasKey=${vt.hasKey()} messageId=${l.messageId}`),l.encrypted&&vt.hasKey())try{if(l.type==="agent.text"||l.type==="agent.media"){const c=l.text,u=l.caption,d=l.messageId;c&&d&&(l.text=await vt.decrypt(c,d),l.encrypted=!1),u&&d&&(l.caption=await vt.decrypt(u,d),l.encrypted=!1)}else if(l.type==="job.update"){const c=l.summary,u=l.jobId;c&&u&&(l.summary=await vt.decrypt(c,u),l.encrypted=!1)}}catch(c){ue.warn("E2E","Decryption failed",c),l.decryptionError=!0}if(l.type==="task.scan.result"&&Array.isArray(l.tasks)&&vt.hasKey()){for(const c of l.tasks)if(c.encrypted&&c.iv)try{c.schedule&&(c.schedule=await vt.decrypt(c.schedule,c.iv)),c.instructions&&(c.instructions=await vt.decrypt(c.instructions,c.iv)),c.encrypted=!1}catch(u){ue.warn("E2E",`Task decryption failed for ${c.cronJobId}`,u),c.decryptionError=!0}}if(l.type==="auth.ok"){ue.info("WS","Auth OK — connected");const c=l.userId;if(console.log(`[E2E-WS] auth.ok userId=${c}, hasSavedPwd=${vt.hasSavedPassword()}`),c&&vt.hasSavedPassword()){const u=await vt.loadSavedPassword(c);console.log(`[E2E-WS] loadSavedPassword result=${u}, hasKey=${vt.hasKey()}`)}this.backoffMs=1e3,this._connected=!0,this.opts.onStatusChange(!0)}else this.opts.onMessage(l)}catch(l){ue.warn("WS","Failed to process incoming message",l)}},this.ws.onclose=a=>{this._connected=!1,this.opts.onStatusChange(!1),this.intentionalClose?ue.info("WS","Connection closed (intentional)"):(ue.warn("WS",`Connection closed (code=${a.code}), reconnecting in ${this.backoffMs}ms`),this.reconnectTimer=setTimeout(()=>{this.backoffMs=Math.min(this.backoffMs*2,3e4),this.connect()},this.backoffMs))},this.ws.onerror=()=>{ue.error("WS","WebSocket error (close event will follow)")}}async send(t){var r,a;if(((r=this.ws)==null?void 0:r.readyState)===WebSocket.OPEN){if(t.type==="user.message"&&vt.hasKey()&&typeof t.text=="string")try{const{ciphertext:l,messageId:c}=await vt.encrypt(t.text);t.text=l,t.messageId=c,t.encrypted=!0}catch(l){ue.error("E2E","Encryption failed",l);return}this.ws.send(JSON.stringify(t))}else ue.warn("WS",`Cannot send — socket not open (readyState=${(a=this.ws)==null?void 0:a.readyState})`,t)}disconnect(){var t;this.intentionalClose=!0,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),(t=this.ws)==null||t.close(),this.ws=null,this._connected=!1,this.opts.onStatusChange(!1)}}function ak({onToggleTheme:e,onOpenSettings:t,theme:r}){var b,y,v,x,_,T,C,S,R,M;const a=lr(),l=ti(),[c,u]=qr.useState(!1),d=()=>{var A;ue.info("Auth",`Logout — user ${(A=a.user)==null?void 0:A.email}`),uo(null),Su(null),l({type:"LOGOUT"})},h=A=>{ue.info("Nav",`Switch view → ${A}`),l({type:"SET_ACTIVE_VIEW",view:A})},p=((v=(y=(b=a.user)==null?void 0:b.displayName)==null?void 0:y[0])==null?void 0:v.toUpperCase())??((T=(_=(x=a.user)==null?void 0:x.email)==null?void 0:_[0])==null?void 0:T.toUpperCase())??"?";return m.jsxs("div",{className:"flex flex-col items-center py-3 gap-2 h-full",style:{width:48,background:"var(--bg-primary)",borderRight:"1px solid var(--border)"},children:[m.jsx("button",{className:"w-8 h-8 rounded-lg flex items-center justify-center overflow-hidden hover:rounded-xl transition-all",title:"BotsChat",children:m.jsx("img",{src:"/botschat-logo.png",alt:"BotsChat",className:`w-8 h-8 ${r==="dark"?"invert":""}`})}),m.jsx("div",{className:"w-7 border-t my-1",style:{borderColor:"var(--sidebar-divider)"}}),m.jsx(Hc,{label:"Messages",active:a.activeView==="messages",onClick:()=>h("messages"),icon:m.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 01-.825-.242m9.345-8.334a2.126 2.126 0 00-.476-.095 48.64 48.64 0 00-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0011.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155"})})}),m.jsx(Hc,{label:"Automations",active:a.activeView==="automations",onClick:()=>h("automations"),icon:m.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})})}),m.jsx("div",{className:"flex-1"}),m.jsx(Hc,{label:"Settings",active:!1,onClick:t,icon:m.jsxs("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z"}),m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}),m.jsx(Hc,{label:r==="dark"?"Light mode":"Dark mode",active:!1,onClick:e,icon:r==="dark"?m.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z"})}):m.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.752 15.002A9.718 9.718 0 0118 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 003 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 009.002-5.998z"})})}),m.jsxs("div",{className:"relative",children:[m.jsx("button",{onClick:()=>u(!c),className:"w-6 h-6 rounded flex items-center justify-center text-[10px] font-bold text-white mt-1 cursor-pointer",style:{background:"#9B59B6"},title:((C=a.user)==null?void 0:C.displayName)??((S=a.user)==null?void 0:S.email)??"User",children:p}),c&&m.jsx("div",{className:"fixed inset-0 z-50",onClick:()=>u(!1),children:m.jsxs("div",{className:"absolute rounded-lg py-1 min-w-[200px]",style:{bottom:12,left:56,background:"var(--bg-surface)",border:"1px solid var(--border)",boxShadow:"0 4px 12px rgba(0,0,0,0.15)"},onClick:A=>A.stopPropagation(),children:[m.jsxs("div",{className:"px-4 py-2.5",style:{borderBottom:"1px solid var(--border)"},children:[m.jsx("div",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:((R=a.user)==null?void 0:R.displayName)??"User"}),m.jsx("div",{className:"text-caption",style:{color:"var(--text-muted)"},children:(M=a.user)==null?void 0:M.email})]}),m.jsxs("button",{className:"w-full text-left px-4 py-2.5 text-body flex items-center gap-2.5",style:{color:"var(--accent-red)"},onClick:()=>{d(),u(!1)},onMouseEnter:A=>{A.currentTarget.style.background="var(--sidebar-hover)"},onMouseLeave:A=>{A.currentTarget.style.background=""},children:[m.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"})}),"Logout"]})]})})]})]})}function Hc({label:e,active:t,icon:r,onClick:a}){return m.jsxs("div",{className:"relative flex items-center justify-center",children:[t&&m.jsx("div",{className:"absolute left-0 w-[3px] h-5 rounded-r-sm",style:{left:-4,background:"var(--text-sidebar-active)"}}),m.jsx("button",{onClick:a,className:`w-8 h-8 rounded-lg flex items-center justify-center transition-colors ${t?"text-[--text-sidebar-active]":"text-[--text-sidebar] hover:text-[--text-sidebar-active]"}`,style:t?{background:"var(--sidebar-hover)"}:void 0,onMouseEnter:l=>{t||(l.currentTarget.style.background="var(--sidebar-hover)")},onMouseLeave:l=>{t||(l.currentTarget.style.background="")},title:e,"aria-label":e,children:r})]})}function ox({onOpenSettings:e}={}){const t=lr(),r=ti(),[a,l]=D.useState(!1),[c,u]=D.useState(""),[d,h]=D.useState(""),[p,b]=D.useState(!0),y=async()=>{if(c.trim()){ue.info("Channel",`Creating channel: "${c}"${d?` (${d})`:""}`);try{await Er.create({name:c,description:d});const{agents:R}=await _s.list(),{channels:M}=await Er.list();r({type:"SET_AGENTS",agents:R}),r({type:"SET_CHANNELS",channels:M});const A=R.find(P=>P.name===c.trim());if(A){ue.info("Channel",`Channel created → agent ${A.id}, auto-selected`),r({type:"SELECT_AGENT",agentId:A.id,sessionKey:A.sessionKey});try{localStorage.setItem("botschat_last_agent",A.id)}catch{}}l(!1),u(""),h("")}catch(R){ue.error("Channel",`Failed to create channel: ${R}`)}}},[v,x]=D.useState(null),_=(R,M)=>{if(t.selectedAgentId===R)return;const A=t.agents.find(P=>P.id===R);ue.info("Channel",`Selected channel: ${(A==null?void 0:A.name)??R} (session=${M})`),r({type:"SELECT_AGENT",agentId:R,sessionKey:M});try{localStorage.setItem("botschat_last_agent",R)}catch{}},T=async R=>{const M=t.channels.find(A=>A.id===R);ue.info("Channel",`Deleting channel: ${(M==null?void 0:M.name)??R}`);try{await Er.delete(R),ue.info("Channel",`Channel deleted: ${(M==null?void 0:M.name)??R}`);const A=t.agents.find(W=>W.channelId===R);A&&t.selectedAgentId===A.id&&r({type:"SELECT_AGENT",agentId:null,sessionKey:null});const{agents:P}=await _s.list(),{channels:I}=await Er.list();r({type:"SET_AGENTS",agents:P}),r({type:"SET_CHANNELS",channels:I})}catch(A){ue.error("Channel",`Failed to delete channel: ${A}`)}finally{x(null)}},C=t.agents.filter(R=>R.isDefault),S=t.agents.filter(R=>!R.isDefault&&R.name!=="Default");return m.jsxs("div",{className:"flex flex-col h-full",style:{background:"var(--bg-secondary)"},children:[m.jsxs("div",{className:"px-4 py-3 flex items-center gap-2",children:[m.jsx("span",{className:"text-[--text-sidebar-active] font-bold text-h2 truncate flex-1",children:"BotsChat"}),e&&m.jsx("button",{onClick:e,className:"p-1 rounded transition-colors hover:bg-[--sidebar-hover]",style:{color:"var(--text-sidebar)"},title:"Settings",children:m.jsxs("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z"}),m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}),m.jsx("svg",{className:"w-3 h-3 text-[--text-sidebar]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),m.jsx("div",{className:"px-4 pb-2",children:m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:t.openclawConnected?"var(--accent-green)":"var(--accent-red)"}}),m.jsx("span",{className:"text-tiny text-[--text-muted]",children:t.openclawConnected?"OpenClaw connected":"OpenClaw offline"})]})}),m.jsxs("div",{className:"flex-1 overflow-y-auto sidebar-scroll",children:[m.jsx(sk,{label:"Channels",expanded:p,onToggle:()=>b(!p)}),p&&m.jsxs("div",{children:[C.map(R=>m.jsx(Yy,{label:`# ${R.name}`,active:t.selectedAgentId===R.id,onClick:()=>_(R.id,R.sessionKey)},R.id)),S.map(R=>m.jsx(Yy,{label:`# ${R.name}`,active:t.selectedAgentId===R.id,onClick:()=>_(R.id,R.sessionKey),showDelete:!0,confirmDelete:v===R.channelId,onDeleteClick:M=>{M.stopPropagation(),x(R.channelId)},onDeleteConfirm:M=>{M.stopPropagation(),R.channelId&&T(R.channelId)},onDeleteCancel:M=>{M.stopPropagation(),x(null)}},R.id)),S.length===0&&C.length===0&&m.jsx("div",{className:"px-8 py-2 text-tiny text-[--text-muted]",children:"Loading channels…"})]})]}),a?m.jsxs("div",{className:"p-3 space-y-2",style:{borderTop:"1px solid var(--sidebar-border)"},children:[m.jsx("input",{type:"text",placeholder:"Channel name",value:c,onChange:R=>u(R.target.value),onKeyDown:R=>R.key==="Enter"&&!R.nativeEvent.isComposing&&y(),className:"w-full px-2 py-1.5 text-caption text-[--text-sidebar] rounded-sm focus:outline-none placeholder:text-[--text-muted]",style:{background:"var(--sidebar-hover)",border:"1px solid var(--sidebar-border)"},autoFocus:!0}),m.jsx("input",{type:"text",placeholder:"Description (optional)",value:d,onChange:R=>h(R.target.value),className:"w-full px-2 py-1.5 text-caption text-[--text-sidebar] rounded-sm focus:outline-none placeholder:text-[--text-muted]",style:{background:"var(--sidebar-hover)",border:"1px solid var(--sidebar-border)"}}),m.jsxs("div",{className:"flex gap-2",children:[m.jsx("button",{onClick:y,className:"flex-1 px-3 py-1.5 text-caption bg-[--bg-active] text-white rounded-sm font-bold hover:brightness-110",children:"Create"}),m.jsx("button",{onClick:()=>l(!1),className:"px-3 py-1.5 text-caption text-[--text-muted] hover:text-[--text-sidebar]",children:"Cancel"})]})]}):m.jsx("div",{className:"p-3",style:{borderTop:"1px solid var(--sidebar-border)"},children:m.jsx("button",{onClick:()=>l(!0),className:"w-full px-3 py-1.5 text-caption text-[--text-sidebar] hover:text-[--text-sidebar-active] rounded-sm border border-dashed transition-colors",style:{borderColor:"var(--sidebar-divider)"},children:"+ New channel"})})]})}function sk({label:e,expanded:t,onToggle:r}){return m.jsxs("button",{onClick:r,className:"w-full flex items-center gap-1 px-4 py-1.5 text-tiny uppercase tracking-wider text-[--text-sidebar] hover:text-[--text-sidebar-active] transition-colors",children:[m.jsx("svg",{className:`w-3 h-3 transition-transform ${t?"rotate-0":"-rotate-90"}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})}),e]})}function Yy({label:e,active:t,onClick:r,showDelete:a,confirmDelete:l,onDeleteClick:c,onDeleteConfirm:u,onDeleteCancel:d}){const[h,p]=D.useState(!1),b=D.useRef(null);return D.useEffect(()=>{if(!l)return;const y=v=>{b.current&&!b.current.contains(v.target)&&(d==null||d(v))};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[l,d]),l?m.jsxs("div",{ref:b,className:"px-4 py-1.5 flex items-center gap-1.5",style:{paddingLeft:32,background:"var(--sidebar-hover)"},children:[m.jsx("span",{className:"text-caption text-[--text-sidebar] truncate flex-1",children:"Delete?"}),m.jsx("button",{onClick:u,className:"px-1.5 py-0.5 text-tiny rounded-sm font-bold text-white",style:{background:"var(--accent-red, #e53935)"},children:"Yes"}),m.jsx("button",{onClick:d,className:"px-1.5 py-0.5 text-tiny rounded-sm text-[--text-muted] hover:text-[--text-sidebar]",children:"No"})]}):m.jsxs("div",{className:"relative group",onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[m.jsx("button",{onClick:r,className:"w-full text-left py-[5px] text-body truncate transition-colors",onMouseEnter:y=>{t||(y.currentTarget.style.background="var(--sidebar-hover)")},onMouseLeave:y=>{t||(y.currentTarget.style.background=t?"var(--bg-hover)":"")},style:{paddingLeft:t?29:32,paddingRight:a?28:void 0,background:t?"var(--bg-hover)":void 0,borderLeft:t?"3px solid var(--bg-active)":"3px solid transparent",color:t?"var(--text-sidebar-active)":"var(--text-sidebar)",fontWeight:t?700:void 0},children:e}),a&&h&&m.jsx("button",{onClick:c,className:"absolute right-2 top-1/2 -translate-y-1/2 w-5 h-5 flex items-center justify-center rounded-sm text-[--text-muted] hover:text-[--accent-red] hover:bg-[--sidebar-hover] transition-colors",title:"Delete channel",children:m.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})}function lk(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const ok=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ck=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uk={};function Wy(e,t){return(uk.jsx?ck:ok).test(e)}const dk=/[ \t\n\f\r]/g;function fk(e){return typeof e=="object"?e.type==="text"?Xy(e.value):!1:Xy(e)}function Xy(e){return e.replace(dk,"")===""}class fo{constructor(t,r,a){this.normal=r,this.property=t,a&&(this.space=a)}}fo.prototype.normal={};fo.prototype.property={};fo.prototype.space=void 0;function cx(e,t){const r={},a={};for(const l of e)Object.assign(r,l.property),Object.assign(a,l.normal);return new fo(r,a,t)}function Oh(e){return e.toLowerCase()}class kn{constructor(t,r){this.attribute=r,this.property=t}}kn.prototype.attribute="";kn.prototype.booleanish=!1;kn.prototype.boolean=!1;kn.prototype.commaOrSpaceSeparated=!1;kn.prototype.commaSeparated=!1;kn.prototype.defined=!1;kn.prototype.mustUseProperty=!1;kn.prototype.number=!1;kn.prototype.overloadedBoolean=!1;kn.prototype.property="";kn.prototype.spaceSeparated=!1;kn.prototype.space=void 0;let hk=0;const Pe=_a(),$t=_a(),Rh=_a(),pe=_a(),yt=_a(),Ss=_a(),jn=_a();function _a(){return 2**++hk}const Mh=Object.freeze(Object.defineProperty({__proto__:null,boolean:Pe,booleanish:$t,commaOrSpaceSeparated:jn,commaSeparated:Ss,number:pe,overloadedBoolean:Rh,spaceSeparated:yt},Symbol.toStringTag,{value:"Module"})),Vf=Object.keys(Mh);class sp extends kn{constructor(t,r,a,l){let c=-1;if(super(t,r),Zy(this,"space",l),typeof a=="number")for(;++c<Vf.length;){const u=Vf[c];Zy(this,Vf[c],(a&Mh[u])===Mh[u])}}}sp.prototype.defined=!0;function Zy(e,t,r){r&&(e[t]=r)}function Is(e){const t={},r={};for(const[a,l]of Object.entries(e.properties)){const c=new sp(a,e.transform(e.attributes||{},a),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(c.mustUseProperty=!0),t[a]=c,r[Oh(a)]=a,r[Oh(c.attribute)]=a}return new fo(t,r,e.space)}const ux=Is({properties:{ariaActiveDescendant:null,ariaAtomic:$t,ariaAutoComplete:null,ariaBusy:$t,ariaChecked:$t,ariaColCount:pe,ariaColIndex:pe,ariaColSpan:pe,ariaControls:yt,ariaCurrent:null,ariaDescribedBy:yt,ariaDetails:null,ariaDisabled:$t,ariaDropEffect:yt,ariaErrorMessage:null,ariaExpanded:$t,ariaFlowTo:yt,ariaGrabbed:$t,ariaHasPopup:null,ariaHidden:$t,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:yt,ariaLevel:pe,ariaLive:null,ariaModal:$t,ariaMultiLine:$t,ariaMultiSelectable:$t,ariaOrientation:null,ariaOwns:yt,ariaPlaceholder:null,ariaPosInSet:pe,ariaPressed:$t,ariaReadOnly:$t,ariaRelevant:null,ariaRequired:$t,ariaRoleDescription:yt,ariaRowCount:pe,ariaRowIndex:pe,ariaRowSpan:pe,ariaSelected:$t,ariaSetSize:pe,ariaSort:null,ariaValueMax:pe,ariaValueMin:pe,ariaValueNow:pe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function dx(e,t){return t in e?e[t]:t}function fx(e,t){return dx(e,t.toLowerCase())}const pk=Is({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ss,acceptCharset:yt,accessKey:yt,action:null,allow:null,allowFullScreen:Pe,allowPaymentRequest:Pe,allowUserMedia:Pe,alt:null,as:null,async:Pe,autoCapitalize:null,autoComplete:yt,autoFocus:Pe,autoPlay:Pe,blocking:yt,capture:null,charSet:null,checked:Pe,cite:null,className:yt,cols:pe,colSpan:null,content:null,contentEditable:$t,controls:Pe,controlsList:yt,coords:pe|Ss,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Pe,defer:Pe,dir:null,dirName:null,disabled:Pe,download:Rh,draggable:$t,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Pe,formTarget:null,headers:yt,height:pe,hidden:Rh,high:pe,href:null,hrefLang:null,htmlFor:yt,httpEquiv:yt,id:null,imageSizes:null,imageSrcSet:null,inert:Pe,inputMode:null,integrity:null,is:null,isMap:Pe,itemId:null,itemProp:yt,itemRef:yt,itemScope:Pe,itemType:yt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Pe,low:pe,manifest:null,max:null,maxLength:pe,media:null,method:null,min:null,minLength:pe,multiple:Pe,muted:Pe,name:null,nonce:null,noModule:Pe,noValidate:Pe,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:Pe,optimum:pe,pattern:null,ping:yt,placeholder:null,playsInline:Pe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Pe,referrerPolicy:null,rel:yt,required:Pe,reversed:Pe,rows:pe,rowSpan:pe,sandbox:yt,scope:null,scoped:Pe,seamless:Pe,selected:Pe,shadowRootClonable:Pe,shadowRootDelegatesFocus:Pe,shadowRootMode:null,shape:null,size:pe,sizes:null,slot:null,span:pe,spellCheck:$t,src:null,srcDoc:null,srcLang:null,srcSet:null,start:pe,step:null,style:null,tabIndex:pe,target:null,title:null,translate:null,type:null,typeMustMatch:Pe,useMap:null,value:$t,width:pe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:yt,axis:null,background:null,bgColor:null,border:pe,borderColor:null,bottomMargin:pe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Pe,declare:Pe,event:null,face:null,frame:null,frameBorder:null,hSpace:pe,leftMargin:pe,link:null,longDesc:null,lowSrc:null,marginHeight:pe,marginWidth:pe,noResize:Pe,noHref:Pe,noShade:Pe,noWrap:Pe,object:null,profile:null,prompt:null,rev:null,rightMargin:pe,rules:null,scheme:null,scrolling:$t,standby:null,summary:null,text:null,topMargin:pe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:pe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Pe,disableRemotePlayback:Pe,prefix:null,property:null,results:pe,security:null,unselectable:null},space:"html",transform:fx}),mk=Is({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:jn,accentHeight:pe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:pe,amplitude:pe,arabicForm:null,ascent:pe,attributeName:null,attributeType:null,azimuth:pe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:pe,by:null,calcMode:null,capHeight:pe,className:yt,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:pe,diffuseConstant:pe,direction:null,display:null,dur:null,divisor:pe,dominantBaseline:null,download:Pe,dx:null,dy:null,edgeMode:null,editable:null,elevation:pe,enableBackground:null,end:null,event:null,exponent:pe,externalResourcesRequired:null,fill:null,fillOpacity:pe,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:Ss,g2:Ss,glyphName:Ss,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:pe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:pe,horizOriginX:pe,horizOriginY:pe,id:null,ideographic:pe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:pe,k:pe,k1:pe,k2:pe,k3:pe,k4:pe,kernelMatrix:jn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:pe,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:pe,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:pe,overlineThickness:pe,paintOrder:null,panose1:null,path:null,pathLength:pe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:yt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:pe,pointsAtY:pe,pointsAtZ:pe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:jn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:jn,rev:jn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:jn,requiredFeatures:jn,requiredFonts:jn,requiredFormats:jn,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:pe,specularExponent:pe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:pe,strikethroughThickness:pe,string:null,stroke:null,strokeDashArray:jn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:pe,strokeOpacity:pe,strokeWidth:null,style:null,surfaceScale:pe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:jn,tabIndex:pe,tableValues:null,target:null,targetX:pe,targetY:pe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:jn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:pe,underlineThickness:pe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:pe,values:null,vAlphabetic:pe,vMathematical:pe,vectorEffect:null,vHanging:pe,vIdeographic:pe,version:null,vertAdvY:pe,vertOriginX:pe,vertOriginY:pe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:pe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:dx}),hx=Is({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()}}),px=Is({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:fx}),mx=Is({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),gk={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"},bk=/[A-Z]/g,Qy=/-[a-z]/g,yk=/^data[-\w.:]+$/i;function vk(e,t){const r=Oh(t);let a=t,l=kn;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&yk.test(t)){if(t.charAt(4)==="-"){const c=t.slice(5).replace(Qy,Ek);a="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=t.slice(4);if(!Qy.test(c)){let u=c.replace(bk,xk);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}l=sp}return new l(a,t)}function xk(e){return"-"+e.toLowerCase()}function Ek(e){return e.charAt(1).toUpperCase()}const _k=cx([ux,pk,hx,px,mx],"html"),lp=cx([ux,mk,hx,px,mx],"svg");function Sk(e){return e.join(" ").trim()}var fs={},Yf,Jy;function wk(){if(Jy)return Yf;Jy=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,d=/^\s+|\s+$/g,h=`
50
- `,p="/",b="*",y="",v="comment",x="declaration";function _(C,S){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];S=S||{};var R=1,M=1;function A(le){var K=le.match(t);K&&(R+=K.length);var z=le.lastIndexOf(h);M=~z?le.length-z:M+le.length}function P(){var le={line:R,column:M};return function(K){return K.position=new I(le),ee(),K}}function I(le){this.start=le,this.end={line:R,column:M},this.source=S.source}I.prototype.content=C;function W(le){var K=new Error(S.source+":"+R+":"+M+": "+le);if(K.reason=le,K.filename=S.source,K.line=R,K.column=M,K.source=C,!S.silent)throw K}function te(le){var K=le.exec(C);if(K){var z=K[0];return A(z),C=C.slice(z.length),K}}function ee(){te(r)}function U(le){var K;for(le=le||[];K=F();)K!==!1&&le.push(K);return le}function F(){var le=P();if(!(p!=C.charAt(0)||b!=C.charAt(1))){for(var K=2;y!=C.charAt(K)&&(b!=C.charAt(K)||p!=C.charAt(K+1));)++K;if(K+=2,y===C.charAt(K-1))return W("End of comment missing");var z=C.slice(2,K-2);return M+=2,A(z),C=C.slice(K),M+=2,le({type:v,comment:z})}}function X(){var le=P(),K=te(a);if(K){if(F(),!te(l))return W("property missing ':'");var z=te(c),Q=le({type:x,property:T(K[0].replace(e,y)),value:z?T(z[0].replace(e,y)):y});return te(u),Q}}function me(){var le=[];U(le);for(var K;K=X();)K!==!1&&(le.push(K),U(le));return le}return ee(),me()}function T(C){return C?C.replace(d,y):y}return Yf=_,Yf}var ev;function kk(){if(ev)return fs;ev=1;var e=fs&&fs.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(fs,"__esModule",{value:!0}),fs.default=r;const t=e(wk());function r(a,l){let c=null;if(!a||typeof a!="string")return c;const u=(0,t.default)(a),d=typeof l=="function";return u.forEach(h=>{if(h.type!=="declaration")return;const{property:p,value:b}=h;d?l(p,b,h):b&&(c=c||{},c[p]=b)}),c}return fs}var Dl={},tv;function Tk(){if(tv)return Dl;tv=1,Object.defineProperty(Dl,"__esModule",{value:!0}),Dl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,r=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,c=function(p){return!p||r.test(p)||e.test(p)},u=function(p,b){return b.toUpperCase()},d=function(p,b){return"".concat(b,"-")},h=function(p,b){return b===void 0&&(b={}),c(p)?p:(p=p.toLowerCase(),b.reactCompat?p=p.replace(l,d):p=p.replace(a,d),p.replace(t,u))};return Dl.camelCase=h,Dl}var Ll,nv;function Nk(){if(nv)return Ll;nv=1;var e=Ll&&Ll.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(kk()),r=Tk();function a(l,c){var u={};return!l||typeof l!="string"||(0,t.default)(l,function(d,h){d&&h&&(u[(0,r.camelCase)(d,c)]=h)}),u}return a.default=a,Ll=a,Ll}var Ck=Nk();const Ak=co(Ck),gx=bx("end"),op=bx("start");function bx(e){return t;function t(r){const a=r&&r.position&&r.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function Ok(e){const t=op(e),r=gx(e);if(t&&r)return{start:t,end:r}}function Wl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?rv(e.position):"start"in e||"end"in e?rv(e):"line"in e||"column"in e?Ih(e):""}function Ih(e){return iv(e&&e.line)+":"+iv(e&&e.column)}function rv(e){return Ih(e&&e.start)+"-"+Ih(e&&e.end)}function iv(e){return e&&typeof e=="number"?e:1}class rn extends Error{constructor(t,r,a){super(),typeof r=="string"&&(a=r,r=void 0);let l="",c={},u=!1;if(r&&("line"in r&&"column"in r?c={place:r}:"start"in r&&"end"in r?c={place:r}:"type"in r?c={ancestors:[r],place:r.position}:c={...r}),typeof t=="string"?l=t:!c.cause&&t&&(u=!0,l=t.message,c.cause=t),!c.ruleId&&!c.source&&typeof a=="string"){const h=a.indexOf(":");h===-1?c.ruleId=a:(c.source=a.slice(0,h),c.ruleId=a.slice(h+1))}if(!c.place&&c.ancestors&&c.ancestors){const h=c.ancestors[c.ancestors.length-1];h&&(c.place=h.position)}const d=c.place&&"start"in c.place?c.place.start:c.place;this.ancestors=c.ancestors||void 0,this.cause=c.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=d?d.line:void 0,this.name=Wl(c.place)||"1:1",this.place=c.place||void 0,this.reason=this.message,this.ruleId=c.ruleId||void 0,this.source=c.source||void 0,this.stack=u&&c.cause&&typeof c.cause.stack=="string"?c.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}rn.prototype.file="";rn.prototype.name="";rn.prototype.reason="";rn.prototype.message="";rn.prototype.stack="";rn.prototype.column=void 0;rn.prototype.line=void 0;rn.prototype.ancestors=void 0;rn.prototype.cause=void 0;rn.prototype.fatal=void 0;rn.prototype.place=void 0;rn.prototype.ruleId=void 0;rn.prototype.source=void 0;const cp={}.hasOwnProperty,Rk=new Map,Mk=/[A-Z]/g,Ik=new Set(["table","tbody","thead","tfoot","tr"]),Dk=new Set(["td","th"]),yx="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Lk(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=t.filePath||void 0;let a;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=$k(r,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");a=Fk(r,t.jsx,t.jsxs)}const l={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?lp:_k,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},c=vx(l,e,void 0);return c&&typeof c!="string"?c:l.create(e,l.Fragment,{children:c||void 0},void 0)}function vx(e,t,r){if(t.type==="element")return zk(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return jk(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Uk(e,t,r);if(t.type==="mdxjsEsm")return Bk(e,t);if(t.type==="root")return Pk(e,t,r);if(t.type==="text")return Hk(e,t)}function zk(e,t,r){const a=e.schema;let l=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(l=lp,e.schema=l),e.ancestors.push(t);const c=Ex(e,t.tagName,!1),u=Gk(e,t);let d=dp(e,t);return Ik.has(t.tagName)&&(d=d.filter(function(h){return typeof h=="string"?!fk(h):!0})),xx(e,u,c,t),up(u,d),e.ancestors.pop(),e.schema=a,e.create(t,c,u,r)}function jk(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}io(e,t.position)}function Bk(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);io(e,t.position)}function Uk(e,t,r){const a=e.schema;let l=a;t.name==="svg"&&a.space==="html"&&(l=lp,e.schema=l),e.ancestors.push(t);const c=t.name===null?e.Fragment:Ex(e,t.name,!0),u=Kk(e,t),d=dp(e,t);return xx(e,u,c,t),up(u,d),e.ancestors.pop(),e.schema=a,e.create(t,c,u,r)}function Pk(e,t,r){const a={};return up(a,dp(e,t)),e.create(t,e.Fragment,a,r)}function Hk(e,t){return t.value}function xx(e,t,r,a){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=a)}function up(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function Fk(e,t,r){return a;function a(l,c,u,d){const p=Array.isArray(u.children)?r:t;return d?p(c,u,d):p(c,u)}}function $k(e,t){return r;function r(a,l,c,u){const d=Array.isArray(c.children),h=op(a);return t(l,c,u,d,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function Gk(e,t){const r={};let a,l;for(l in t.properties)if(l!=="children"&&cp.call(t.properties,l)){const c=qk(e,l,t.properties[l]);if(c){const[u,d]=c;e.tableCellAlignToStyle&&u==="align"&&typeof d=="string"&&Dk.has(t.tagName)?a=d:r[u]=d}}if(a){const c=r.style||(r.style={});c[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return r}function Kk(e,t){const r={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const c=a.data.estree.body[0];c.type;const u=c.expression;u.type;const d=u.properties[0];d.type,Object.assign(r,e.evaluater.evaluateExpression(d.argument))}else io(e,t.position);else{const l=a.name;let c;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const d=a.value.data.estree.body[0];d.type,c=e.evaluater.evaluateExpression(d.expression)}else io(e,t.position);else c=a.value===null?!0:a.value;r[l]=c}return r}function dp(e,t){const r=[];let a=-1;const l=e.passKeys?new Map:Rk;for(;++a<t.children.length;){const c=t.children[a];let u;if(e.passKeys){const h=c.type==="element"?c.tagName:c.type==="mdxJsxFlowElement"||c.type==="mdxJsxTextElement"?c.name:void 0;if(h){const p=l.get(h)||0;u=h+"-"+p,l.set(h,p+1)}}const d=vx(e,c,u);d!==void 0&&r.push(d)}return r}function qk(e,t,r){const a=vk(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=a.commaSeparated?lk(r):Sk(r)),a.property==="style"){let l=typeof r=="object"?r:Vk(e,String(r));return e.stylePropertyNameCase==="css"&&(l=Yk(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&a.space?gk[a.property]||a.property:a.attribute,r]}}function Vk(e,t){try{return Ak(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const a=r,l=new rn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=yx+"#cannot-parse-style-attribute",l}}function Ex(e,t,r){let a;if(!r)a={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let c=-1,u;for(;++c<l.length;){const d=Wy(l[c])?{type:"Identifier",name:l[c]}:{type:"Literal",value:l[c]};u=u?{type:"MemberExpression",object:u,property:d,computed:!!(c&&d.type==="Literal"),optional:!1}:d}a=u}else a=Wy(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const l=a.value;return cp.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(a);io(e)}function io(e,t){const r=new rn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=yx+"#cannot-handle-mdx-estrees-without-createevaluater",r}function Yk(e){const t={};let r;for(r in e)cp.call(e,r)&&(t[Wk(r)]=e[r]);return t}function Wk(e){let t=e.replace(Mk,Xk);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Xk(e){return"-"+e.toLowerCase()}const Wf={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"]},Zk={};function fp(e,t){const r=Zk,a=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,l=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return _x(e,a,l)}function _x(e,t,r){if(Qk(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return av(e.children,t,r)}return Array.isArray(e)?av(e,t,r):""}function av(e,t,r){const a=[];let l=-1;for(;++l<e.length;)a[l]=_x(e[l],t,r);return a.join("")}function Qk(e){return!!(e&&typeof e=="object")}const sv=document.createElement("i");function hp(e){const t="&"+e+";";sv.innerHTML=t;const r=sv.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function Bn(e,t,r,a){const l=e.length;let c=0,u;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,r=r>0?r:0,a.length<1e4)u=Array.from(a),u.unshift(t,r),e.splice(...u);else for(r&&e.splice(t,r);c<a.length;)u=a.slice(c,c+1e4),u.unshift(t,0),e.splice(...u),c+=1e4,t+=1e4}function Zn(e,t){return e.length>0?(Bn(e,e.length,0,t),e):t}const lv={}.hasOwnProperty;function Sx(e){const t={};let r=-1;for(;++r<e.length;)Jk(t,e[r]);return t}function Jk(e,t){let r;for(r in t){const l=(lv.call(e,r)?e[r]:void 0)||(e[r]={}),c=t[r];let u;if(c)for(u in c){lv.call(l,u)||(l[u]=[]);const d=c[u];e2(l[u],Array.isArray(d)?d:d?[d]:[])}}}function e2(e,t){let r=-1;const a=[];for(;++r<t.length;)(t[r].add==="after"?e:a).push(t[r]);Bn(e,0,0,a)}function wx(e,t){const r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function ar(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const dn=Hi(/[A-Za-z]/),nn=Hi(/[\dA-Za-z]/),t2=Hi(/[#-'*+\--9=?A-Z^-~]/);function uu(e){return e!==null&&(e<32||e===127)}const Dh=Hi(/\d/),n2=Hi(/[\dA-Fa-f]/),r2=Hi(/[!-/:-@[-`{-~]/);function Ce(e){return e!==null&&e<-2}function gt(e){return e!==null&&(e<0||e===32)}function Ke(e){return e===-2||e===-1||e===32}const Nu=Hi(new RegExp("\\p{P}|\\p{S}","u")),va=Hi(/\s/);function Hi(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function Ds(e){const t=[];let r=-1,a=0,l=0;for(;++r<e.length;){const c=e.charCodeAt(r);let u="";if(c===37&&nn(e.charCodeAt(r+1))&&nn(e.charCodeAt(r+2)))l=2;else if(c<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(c))||(u=String.fromCharCode(c));else if(c>55295&&c<57344){const d=e.charCodeAt(r+1);c<56320&&d>56319&&d<57344?(u=String.fromCharCode(c,d),l=1):u="�"}else u=String.fromCharCode(c);u&&(t.push(e.slice(a,r),encodeURIComponent(u)),a=r+l+1,u=""),l&&(r+=l,l=0)}return t.join("")+e.slice(a)}function Ze(e,t,r,a){const l=a?a-1:Number.POSITIVE_INFINITY;let c=0;return u;function u(h){return Ke(h)?(e.enter(r),d(h)):t(h)}function d(h){return Ke(h)&&c++<l?(e.consume(h),d):(e.exit(r),t(h))}}const i2={tokenize:a2};function a2(e){const t=e.attempt(this.parser.constructs.contentInitial,a,l);let r;return t;function a(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),Ze(e,t,"linePrefix")}function l(d){return e.enter("paragraph"),c(d)}function c(d){const h=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=h),r=h,u(d)}function u(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return Ce(d)?(e.consume(d),e.exit("chunkText"),c):(e.consume(d),u)}}const s2={tokenize:l2},ov={tokenize:o2};function l2(e){const t=this,r=[];let a=0,l,c,u;return d;function d(M){if(a<r.length){const A=r[a];return t.containerState=A[1],e.attempt(A[0].continuation,h,p)(M)}return p(M)}function h(M){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&R();const A=t.events.length;let P=A,I;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){I=t.events[P][1].end;break}S(a);let W=A;for(;W<t.events.length;)t.events[W][1].end={...I},W++;return Bn(t.events,P+1,0,t.events.slice(A)),t.events.length=W,p(M)}return d(M)}function p(M){if(a===r.length){if(!l)return v(M);if(l.currentConstruct&&l.currentConstruct.concrete)return _(M);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(ov,b,y)(M)}function b(M){return l&&R(),S(a),v(M)}function y(M){return t.parser.lazy[t.now().line]=a!==r.length,u=t.now().offset,_(M)}function v(M){return t.containerState={},e.attempt(ov,x,_)(M)}function x(M){return a++,r.push([t.currentConstruct,t.containerState]),v(M)}function _(M){if(M===null){l&&R(),S(0),e.consume(M);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:c}),T(M)}function T(M){if(M===null){C(e.exit("chunkFlow"),!0),S(0),e.consume(M);return}return Ce(M)?(e.consume(M),C(e.exit("chunkFlow")),a=0,t.interrupt=void 0,d):(e.consume(M),T)}function C(M,A){const P=t.sliceStream(M);if(A&&P.push(null),M.previous=c,c&&(c.next=M),c=M,l.defineSkip(M.start),l.write(P),t.parser.lazy[M.start.line]){let I=l.events.length;for(;I--;)if(l.events[I][1].start.offset<u&&(!l.events[I][1].end||l.events[I][1].end.offset>u))return;const W=t.events.length;let te=W,ee,U;for(;te--;)if(t.events[te][0]==="exit"&&t.events[te][1].type==="chunkFlow"){if(ee){U=t.events[te][1].end;break}ee=!0}for(S(a),I=W;I<t.events.length;)t.events[I][1].end={...U},I++;Bn(t.events,te+1,0,t.events.slice(W)),t.events.length=I}}function S(M){let A=r.length;for(;A-- >M;){const P=r[A];t.containerState=P[1],P[0].exit.call(t,e)}r.length=M}function R(){l.write([null]),c=void 0,l=void 0,t.containerState._closeFlow=void 0}}function o2(e,t,r){return Ze(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function As(e){if(e===null||gt(e)||va(e))return 1;if(Nu(e))return 2}function Cu(e,t,r){const a=[];let l=-1;for(;++l<e.length;){const c=e[l].resolveAll;c&&!a.includes(c)&&(t=c(t,r),a.push(c))}return t}const Lh={name:"attention",resolveAll:c2,tokenize:u2};function c2(e,t){let r=-1,a,l,c,u,d,h,p,b;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(a=r;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&t.sliceSerialize(e[a][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[a][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;h=e[a][1].end.offset-e[a][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const y={...e[a][1].end},v={...e[r][1].start};cv(y,-h),cv(v,h),u={type:h>1?"strongSequence":"emphasisSequence",start:y,end:{...e[a][1].end}},d={type:h>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:v},c={type:h>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[r][1].start}},l={type:h>1?"strong":"emphasis",start:{...u.start},end:{...d.end}},e[a][1].end={...u.start},e[r][1].start={...d.end},p=[],e[a][1].end.offset-e[a][1].start.offset&&(p=Zn(p,[["enter",e[a][1],t],["exit",e[a][1],t]])),p=Zn(p,[["enter",l,t],["enter",u,t],["exit",u,t],["enter",c,t]]),p=Zn(p,Cu(t.parser.constructs.insideSpan.null,e.slice(a+1,r),t)),p=Zn(p,[["exit",c,t],["enter",d,t],["exit",d,t],["exit",l,t]]),e[r][1].end.offset-e[r][1].start.offset?(b=2,p=Zn(p,[["enter",e[r][1],t],["exit",e[r][1],t]])):b=0,Bn(e,a-1,r-a+3,p),r=a+p.length-b-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function u2(e,t){const r=this.parser.constructs.attentionMarkers.null,a=this.previous,l=As(a);let c;return u;function u(h){return c=h,e.enter("attentionSequence"),d(h)}function d(h){if(h===c)return e.consume(h),d;const p=e.exit("attentionSequence"),b=As(h),y=!b||b===2&&l||r.includes(h),v=!l||l===2&&b||r.includes(a);return p._open=!!(c===42?y:y&&(l||!v)),p._close=!!(c===42?v:v&&(b||!y)),t(h)}}function cv(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const d2={name:"autolink",tokenize:f2};function f2(e,t,r){let a=0;return l;function l(x){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),c}function c(x){return dn(x)?(e.consume(x),u):x===64?r(x):p(x)}function u(x){return x===43||x===45||x===46||nn(x)?(a=1,d(x)):p(x)}function d(x){return x===58?(e.consume(x),a=0,h):(x===43||x===45||x===46||nn(x))&&a++<32?(e.consume(x),d):(a=0,p(x))}function h(x){return x===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):x===null||x===32||x===60||uu(x)?r(x):(e.consume(x),h)}function p(x){return x===64?(e.consume(x),b):t2(x)?(e.consume(x),p):r(x)}function b(x){return nn(x)?y(x):r(x)}function y(x){return x===46?(e.consume(x),a=0,b):x===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):v(x)}function v(x){if((x===45||nn(x))&&a++<63){const _=x===45?v:y;return e.consume(x),_}return r(x)}}const ho={partial:!0,tokenize:h2};function h2(e,t,r){return a;function a(c){return Ke(c)?Ze(e,l,"linePrefix")(c):l(c)}function l(c){return c===null||Ce(c)?t(c):r(c)}}const kx={continuation:{tokenize:m2},exit:g2,name:"blockQuote",tokenize:p2};function p2(e,t,r){const a=this;return l;function l(u){if(u===62){const d=a.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),c}return r(u)}function c(u){return Ke(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function m2(e,t,r){const a=this;return l;function l(u){return Ke(u)?Ze(e,c,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):c(u)}function c(u){return e.attempt(kx,t,r)(u)}}function g2(e){e.exit("blockQuote")}const Tx={name:"characterEscape",tokenize:b2};function b2(e,t,r){return a;function a(c){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(c),e.exit("escapeMarker"),l}function l(c){return r2(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(c)}}const Nx={name:"characterReference",tokenize:y2};function y2(e,t,r){const a=this;let l=0,c,u;return d;function d(y){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),h}function h(y){return y===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(y),e.exit("characterReferenceMarkerNumeric"),p):(e.enter("characterReferenceValue"),c=31,u=nn,b(y))}function p(y){return y===88||y===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(y),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),c=6,u=n2,b):(e.enter("characterReferenceValue"),c=7,u=Dh,b(y))}function b(y){if(y===59&&l){const v=e.exit("characterReferenceValue");return u===nn&&!hp(a.sliceSerialize(v))?r(y):(e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(y)&&l++<c?(e.consume(y),b):r(y)}}const uv={partial:!0,tokenize:x2},dv={concrete:!0,name:"codeFenced",tokenize:v2};function v2(e,t,r){const a=this,l={partial:!0,tokenize:P};let c=0,u=0,d;return h;function h(I){return p(I)}function p(I){const W=a.events[a.events.length-1];return c=W&&W[1].type==="linePrefix"?W[2].sliceSerialize(W[1],!0).length:0,d=I,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),b(I)}function b(I){return I===d?(u++,e.consume(I),b):u<3?r(I):(e.exit("codeFencedFenceSequence"),Ke(I)?Ze(e,y,"whitespace")(I):y(I))}function y(I){return I===null||Ce(I)?(e.exit("codeFencedFence"),a.interrupt?t(I):e.check(uv,T,A)(I)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(I))}function v(I){return I===null||Ce(I)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),y(I)):Ke(I)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ze(e,x,"whitespace")(I)):I===96&&I===d?r(I):(e.consume(I),v)}function x(I){return I===null||Ce(I)?y(I):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),_(I))}function _(I){return I===null||Ce(I)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),y(I)):I===96&&I===d?r(I):(e.consume(I),_)}function T(I){return e.attempt(l,A,C)(I)}function C(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),S}function S(I){return c>0&&Ke(I)?Ze(e,R,"linePrefix",c+1)(I):R(I)}function R(I){return I===null||Ce(I)?e.check(uv,T,A)(I):(e.enter("codeFlowValue"),M(I))}function M(I){return I===null||Ce(I)?(e.exit("codeFlowValue"),R(I)):(e.consume(I),M)}function A(I){return e.exit("codeFenced"),t(I)}function P(I,W,te){let ee=0;return U;function U(K){return I.enter("lineEnding"),I.consume(K),I.exit("lineEnding"),F}function F(K){return I.enter("codeFencedFence"),Ke(K)?Ze(I,X,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(K):X(K)}function X(K){return K===d?(I.enter("codeFencedFenceSequence"),me(K)):te(K)}function me(K){return K===d?(ee++,I.consume(K),me):ee>=u?(I.exit("codeFencedFenceSequence"),Ke(K)?Ze(I,le,"whitespace")(K):le(K)):te(K)}function le(K){return K===null||Ce(K)?(I.exit("codeFencedFence"),W(K)):te(K)}}}function x2(e,t,r){const a=this;return l;function l(u){return u===null?r(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),c)}function c(u){return a.parser.lazy[a.now().line]?r(u):t(u)}}const Xf={name:"codeIndented",tokenize:_2},E2={partial:!0,tokenize:S2};function _2(e,t,r){const a=this;return l;function l(p){return e.enter("codeIndented"),Ze(e,c,"linePrefix",5)(p)}function c(p){const b=a.events[a.events.length-1];return b&&b[1].type==="linePrefix"&&b[2].sliceSerialize(b[1],!0).length>=4?u(p):r(p)}function u(p){return p===null?h(p):Ce(p)?e.attempt(E2,u,h)(p):(e.enter("codeFlowValue"),d(p))}function d(p){return p===null||Ce(p)?(e.exit("codeFlowValue"),u(p)):(e.consume(p),d)}function h(p){return e.exit("codeIndented"),t(p)}}function S2(e,t,r){const a=this;return l;function l(u){return a.parser.lazy[a.now().line]?r(u):Ce(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):Ze(e,c,"linePrefix",5)(u)}function c(u){const d=a.events[a.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(u):Ce(u)?l(u):r(u)}}const w2={name:"codeText",previous:T2,resolve:k2,tokenize:N2};function k2(e){let t=e.length-4,r=3,a,l;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=r;++a<t;)if(e[a][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[t][1].type="codeTextPadding",r+=2,t-=2;break}}for(a=r-1,t++;++a<=t;)l===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(l=a):(a===t||e[a][1].type==="lineEnding")&&(e[l][1].type="codeTextData",a!==l+2&&(e[l][1].end=e[a-1][1].end,e.splice(l+2,a-l-2),t-=a-l-2,a=l+2),l=void 0);return e}function T2(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function N2(e,t,r){let a=0,l,c;return u;function u(y){return e.enter("codeText"),e.enter("codeTextSequence"),d(y)}function d(y){return y===96?(e.consume(y),a++,d):(e.exit("codeTextSequence"),h(y))}function h(y){return y===null?r(y):y===32?(e.enter("space"),e.consume(y),e.exit("space"),h):y===96?(c=e.enter("codeTextSequence"),l=0,b(y)):Ce(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),h):(e.enter("codeTextData"),p(y))}function p(y){return y===null||y===32||y===96||Ce(y)?(e.exit("codeTextData"),h(y)):(e.consume(y),p)}function b(y){return y===96?(e.consume(y),l++,b):l===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(y)):(c.type="codeTextData",p(y))}}class C2{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,r){const a=r??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(t,a):t>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(t,r,a){const l=r||0;this.setCursor(Math.trunc(t));const c=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return a&&zl(this.left,a),c.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),zl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),zl(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 r=this.left.splice(t,Number.POSITIVE_INFINITY);zl(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);zl(this.left,r.reverse())}}}function zl(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}function Cx(e){const t={};let r=-1,a,l,c,u,d,h,p;const b=new C2(e);for(;++r<b.length;){for(;r in t;)r=t[r];if(a=b.get(r),r&&a[1].type==="chunkFlow"&&b.get(r-1)[1].type==="listItemPrefix"&&(h=a[1]._tokenizer.events,c=0,c<h.length&&h[c][1].type==="lineEndingBlank"&&(c+=2),c<h.length&&h[c][1].type==="content"))for(;++c<h.length&&h[c][1].type!=="content";)h[c][1].type==="chunkText"&&(h[c][1]._isInFirstContentOfListItem=!0,c++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,A2(b,r)),r=t[r],p=!0);else if(a[1]._container){for(c=r,l=void 0;c--;)if(u=b.get(c),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(l&&(b.get(l)[1].type="lineEndingBlank"),u[1].type="lineEnding",l=c);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;l&&(a[1].end={...b.get(l)[1].start},d=b.slice(l,r),d.unshift(a),b.splice(l,r-l+1,d))}}return Bn(e,0,Number.POSITIVE_INFINITY,b.slice(0)),!p}function A2(e,t){const r=e.get(t)[1],a=e.get(t)[2];let l=t-1;const c=[];let u=r._tokenizer;u||(u=a.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const d=u.events,h=[],p={};let b,y,v=-1,x=r,_=0,T=0;const C=[T];for(;x;){for(;e.get(++l)[1]!==x;);c.push(l),x._tokenizer||(b=a.sliceStream(x),x.next||b.push(null),y&&u.defineSkip(x.start),x._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(b),x._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),y=x,x=x.next}for(x=r;++v<d.length;)d[v][0]==="exit"&&d[v-1][0]==="enter"&&d[v][1].type===d[v-1][1].type&&d[v][1].start.line!==d[v][1].end.line&&(T=v+1,C.push(T),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(u.events=[],x?(x._tokenizer=void 0,x.previous=void 0):C.pop(),v=C.length;v--;){const S=d.slice(C[v],C[v+1]),R=c.pop();h.push([R,R+S.length-1]),e.splice(R,2,S)}for(h.reverse(),v=-1;++v<h.length;)p[_+h[v][0]]=_+h[v][1],_+=h[v][1]-h[v][0]-1;return p}const O2={resolve:M2,tokenize:I2},R2={partial:!0,tokenize:D2};function M2(e){return Cx(e),e}function I2(e,t){let r;return a;function a(d){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),l(d)}function l(d){return d===null?c(d):Ce(d)?e.check(R2,u,c)(d):(e.consume(d),l)}function c(d){return e.exit("chunkContent"),e.exit("content"),t(d)}function u(d){return e.consume(d),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,l}}function D2(e,t,r){const a=this;return l;function l(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Ze(e,c,"linePrefix")}function c(u){if(u===null||Ce(u))return r(u);const d=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(u):e.interrupt(a.parser.constructs.flow,r,t)(u)}}function Ax(e,t,r,a,l,c,u,d,h){const p=h||Number.POSITIVE_INFINITY;let b=0;return y;function y(S){return S===60?(e.enter(a),e.enter(l),e.enter(c),e.consume(S),e.exit(c),v):S===null||S===32||S===41||uu(S)?r(S):(e.enter(a),e.enter(u),e.enter(d),e.enter("chunkString",{contentType:"string"}),T(S))}function v(S){return S===62?(e.enter(c),e.consume(S),e.exit(c),e.exit(l),e.exit(a),t):(e.enter(d),e.enter("chunkString",{contentType:"string"}),x(S))}function x(S){return S===62?(e.exit("chunkString"),e.exit(d),v(S)):S===null||S===60||Ce(S)?r(S):(e.consume(S),S===92?_:x)}function _(S){return S===60||S===62||S===92?(e.consume(S),x):x(S)}function T(S){return!b&&(S===null||S===41||gt(S))?(e.exit("chunkString"),e.exit(d),e.exit(u),e.exit(a),t(S)):b<p&&S===40?(e.consume(S),b++,T):S===41?(e.consume(S),b--,T):S===null||S===32||S===40||uu(S)?r(S):(e.consume(S),S===92?C:T)}function C(S){return S===40||S===41||S===92?(e.consume(S),T):T(S)}}function Ox(e,t,r,a,l,c){const u=this;let d=0,h;return p;function p(x){return e.enter(a),e.enter(l),e.consume(x),e.exit(l),e.enter(c),b}function b(x){return d>999||x===null||x===91||x===93&&!h||x===94&&!d&&"_hiddenFootnoteSupport"in u.parser.constructs?r(x):x===93?(e.exit(c),e.enter(l),e.consume(x),e.exit(l),e.exit(a),t):Ce(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),b):(e.enter("chunkString",{contentType:"string"}),y(x))}function y(x){return x===null||x===91||x===93||Ce(x)||d++>999?(e.exit("chunkString"),b(x)):(e.consume(x),h||(h=!Ke(x)),x===92?v:y)}function v(x){return x===91||x===92||x===93?(e.consume(x),d++,y):y(x)}}function Rx(e,t,r,a,l,c){let u;return d;function d(v){return v===34||v===39||v===40?(e.enter(a),e.enter(l),e.consume(v),e.exit(l),u=v===40?41:v,h):r(v)}function h(v){return v===u?(e.enter(l),e.consume(v),e.exit(l),e.exit(a),t):(e.enter(c),p(v))}function p(v){return v===u?(e.exit(c),h(u)):v===null?r(v):Ce(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),Ze(e,p,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),b(v))}function b(v){return v===u||v===null||Ce(v)?(e.exit("chunkString"),p(v)):(e.consume(v),v===92?y:b)}function y(v){return v===u||v===92?(e.consume(v),b):b(v)}}function Xl(e,t){let r;return a;function a(l){return Ce(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),r=!0,a):Ke(l)?Ze(e,a,r?"linePrefix":"lineSuffix")(l):t(l)}}const L2={name:"definition",tokenize:j2},z2={partial:!0,tokenize:B2};function j2(e,t,r){const a=this;let l;return c;function c(x){return e.enter("definition"),u(x)}function u(x){return Ox.call(a,e,d,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function d(x){return l=ar(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),h):r(x)}function h(x){return gt(x)?Xl(e,p)(x):p(x)}function p(x){return Ax(e,b,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function b(x){return e.attempt(z2,y,y)(x)}function y(x){return Ke(x)?Ze(e,v,"whitespace")(x):v(x)}function v(x){return x===null||Ce(x)?(e.exit("definition"),a.parser.defined.push(l),t(x)):r(x)}}function B2(e,t,r){return a;function a(d){return gt(d)?Xl(e,l)(d):r(d)}function l(d){return Rx(e,c,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function c(d){return Ke(d)?Ze(e,u,"whitespace")(d):u(d)}function u(d){return d===null||Ce(d)?t(d):r(d)}}const U2={name:"hardBreakEscape",tokenize:P2};function P2(e,t,r){return a;function a(c){return e.enter("hardBreakEscape"),e.consume(c),l}function l(c){return Ce(c)?(e.exit("hardBreakEscape"),t(c)):r(c)}}const H2={name:"headingAtx",resolve:F2,tokenize:$2};function F2(e,t){let r=e.length-2,a=3,l,c;return e[a][1].type==="whitespace"&&(a+=2),r-2>a&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(a===r-1||r-4>a&&e[r-2][1].type==="whitespace")&&(r-=a+1===r?2:4),r>a&&(l={type:"atxHeadingText",start:e[a][1].start,end:e[r][1].end},c={type:"chunkText",start:e[a][1].start,end:e[r][1].end,contentType:"text"},Bn(e,a,r-a+1,[["enter",l,t],["enter",c,t],["exit",c,t],["exit",l,t]])),e}function $2(e,t,r){let a=0;return l;function l(b){return e.enter("atxHeading"),c(b)}function c(b){return e.enter("atxHeadingSequence"),u(b)}function u(b){return b===35&&a++<6?(e.consume(b),u):b===null||gt(b)?(e.exit("atxHeadingSequence"),d(b)):r(b)}function d(b){return b===35?(e.enter("atxHeadingSequence"),h(b)):b===null||Ce(b)?(e.exit("atxHeading"),t(b)):Ke(b)?Ze(e,d,"whitespace")(b):(e.enter("atxHeadingText"),p(b))}function h(b){return b===35?(e.consume(b),h):(e.exit("atxHeadingSequence"),d(b))}function p(b){return b===null||b===35||gt(b)?(e.exit("atxHeadingText"),d(b)):(e.consume(b),p)}}const G2=["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"],fv=["pre","script","style","textarea"],K2={concrete:!0,name:"htmlFlow",resolveTo:Y2,tokenize:W2},q2={partial:!0,tokenize:Z2},V2={partial:!0,tokenize:X2};function Y2(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 W2(e,t,r){const a=this;let l,c,u,d,h;return p;function p(N){return b(N)}function b(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),y}function y(N){return N===33?(e.consume(N),v):N===47?(e.consume(N),c=!0,T):N===63?(e.consume(N),l=3,a.interrupt?t:w):dn(N)?(e.consume(N),u=String.fromCharCode(N),C):r(N)}function v(N){return N===45?(e.consume(N),l=2,x):N===91?(e.consume(N),l=5,d=0,_):dn(N)?(e.consume(N),l=4,a.interrupt?t:w):r(N)}function x(N){return N===45?(e.consume(N),a.interrupt?t:w):r(N)}function _(N){const de="CDATA[";return N===de.charCodeAt(d++)?(e.consume(N),d===de.length?a.interrupt?t:X:_):r(N)}function T(N){return dn(N)?(e.consume(N),u=String.fromCharCode(N),C):r(N)}function C(N){if(N===null||N===47||N===62||gt(N)){const de=N===47,fe=u.toLowerCase();return!de&&!c&&fv.includes(fe)?(l=1,a.interrupt?t(N):X(N)):G2.includes(u.toLowerCase())?(l=6,de?(e.consume(N),S):a.interrupt?t(N):X(N)):(l=7,a.interrupt&&!a.parser.lazy[a.now().line]?r(N):c?R(N):M(N))}return N===45||nn(N)?(e.consume(N),u+=String.fromCharCode(N),C):r(N)}function S(N){return N===62?(e.consume(N),a.interrupt?t:X):r(N)}function R(N){return Ke(N)?(e.consume(N),R):U(N)}function M(N){return N===47?(e.consume(N),U):N===58||N===95||dn(N)?(e.consume(N),A):Ke(N)?(e.consume(N),M):U(N)}function A(N){return N===45||N===46||N===58||N===95||nn(N)?(e.consume(N),A):P(N)}function P(N){return N===61?(e.consume(N),I):Ke(N)?(e.consume(N),P):M(N)}function I(N){return N===null||N===60||N===61||N===62||N===96?r(N):N===34||N===39?(e.consume(N),h=N,W):Ke(N)?(e.consume(N),I):te(N)}function W(N){return N===h?(e.consume(N),h=null,ee):N===null||Ce(N)?r(N):(e.consume(N),W)}function te(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||gt(N)?P(N):(e.consume(N),te)}function ee(N){return N===47||N===62||Ke(N)?M(N):r(N)}function U(N){return N===62?(e.consume(N),F):r(N)}function F(N){return N===null||Ce(N)?X(N):Ke(N)?(e.consume(N),F):r(N)}function X(N){return N===45&&l===2?(e.consume(N),z):N===60&&l===1?(e.consume(N),Q):N===62&&l===4?(e.consume(N),O):N===63&&l===3?(e.consume(N),w):N===93&&l===5?(e.consume(N),B):Ce(N)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(q2,G,me)(N)):N===null||Ce(N)?(e.exit("htmlFlowData"),me(N)):(e.consume(N),X)}function me(N){return e.check(V2,le,G)(N)}function le(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),K}function K(N){return N===null||Ce(N)?me(N):(e.enter("htmlFlowData"),X(N))}function z(N){return N===45?(e.consume(N),w):X(N)}function Q(N){return N===47?(e.consume(N),u="",ie):X(N)}function ie(N){if(N===62){const de=u.toLowerCase();return fv.includes(de)?(e.consume(N),O):X(N)}return dn(N)&&u.length<8?(e.consume(N),u+=String.fromCharCode(N),ie):X(N)}function B(N){return N===93?(e.consume(N),w):X(N)}function w(N){return N===62?(e.consume(N),O):N===45&&l===2?(e.consume(N),w):X(N)}function O(N){return N===null||Ce(N)?(e.exit("htmlFlowData"),G(N)):(e.consume(N),O)}function G(N){return e.exit("htmlFlow"),t(N)}}function X2(e,t,r){const a=this;return l;function l(u){return Ce(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),c):r(u)}function c(u){return a.parser.lazy[a.now().line]?r(u):t(u)}}function Z2(e,t,r){return a;function a(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(ho,t,r)}}const Q2={name:"htmlText",tokenize:J2};function J2(e,t,r){const a=this;let l,c,u;return d;function d(w){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(w),h}function h(w){return w===33?(e.consume(w),p):w===47?(e.consume(w),P):w===63?(e.consume(w),M):dn(w)?(e.consume(w),te):r(w)}function p(w){return w===45?(e.consume(w),b):w===91?(e.consume(w),c=0,_):dn(w)?(e.consume(w),R):r(w)}function b(w){return w===45?(e.consume(w),x):r(w)}function y(w){return w===null?r(w):w===45?(e.consume(w),v):Ce(w)?(u=y,Q(w)):(e.consume(w),y)}function v(w){return w===45?(e.consume(w),x):y(w)}function x(w){return w===62?z(w):w===45?v(w):y(w)}function _(w){const O="CDATA[";return w===O.charCodeAt(c++)?(e.consume(w),c===O.length?T:_):r(w)}function T(w){return w===null?r(w):w===93?(e.consume(w),C):Ce(w)?(u=T,Q(w)):(e.consume(w),T)}function C(w){return w===93?(e.consume(w),S):T(w)}function S(w){return w===62?z(w):w===93?(e.consume(w),S):T(w)}function R(w){return w===null||w===62?z(w):Ce(w)?(u=R,Q(w)):(e.consume(w),R)}function M(w){return w===null?r(w):w===63?(e.consume(w),A):Ce(w)?(u=M,Q(w)):(e.consume(w),M)}function A(w){return w===62?z(w):M(w)}function P(w){return dn(w)?(e.consume(w),I):r(w)}function I(w){return w===45||nn(w)?(e.consume(w),I):W(w)}function W(w){return Ce(w)?(u=W,Q(w)):Ke(w)?(e.consume(w),W):z(w)}function te(w){return w===45||nn(w)?(e.consume(w),te):w===47||w===62||gt(w)?ee(w):r(w)}function ee(w){return w===47?(e.consume(w),z):w===58||w===95||dn(w)?(e.consume(w),U):Ce(w)?(u=ee,Q(w)):Ke(w)?(e.consume(w),ee):z(w)}function U(w){return w===45||w===46||w===58||w===95||nn(w)?(e.consume(w),U):F(w)}function F(w){return w===61?(e.consume(w),X):Ce(w)?(u=F,Q(w)):Ke(w)?(e.consume(w),F):ee(w)}function X(w){return w===null||w===60||w===61||w===62||w===96?r(w):w===34||w===39?(e.consume(w),l=w,me):Ce(w)?(u=X,Q(w)):Ke(w)?(e.consume(w),X):(e.consume(w),le)}function me(w){return w===l?(e.consume(w),l=void 0,K):w===null?r(w):Ce(w)?(u=me,Q(w)):(e.consume(w),me)}function le(w){return w===null||w===34||w===39||w===60||w===61||w===96?r(w):w===47||w===62||gt(w)?ee(w):(e.consume(w),le)}function K(w){return w===47||w===62||gt(w)?ee(w):r(w)}function z(w){return w===62?(e.consume(w),e.exit("htmlTextData"),e.exit("htmlText"),t):r(w)}function Q(w){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),ie}function ie(w){return Ke(w)?Ze(e,B,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(w):B(w)}function B(w){return e.enter("htmlTextData"),u(w)}}const pp={name:"labelEnd",resolveAll:rT,resolveTo:iT,tokenize:aT},eT={tokenize:sT},tT={tokenize:lT},nT={tokenize:oT};function rT(e){let t=-1;const r=[];for(;++t<e.length;){const a=e[t][1];if(r.push(e[t]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const l=a.type==="labelImage"?4:2;a.type="data",t+=l}}return e.length!==r.length&&Bn(e,0,e.length,r),e}function iT(e,t){let r=e.length,a=0,l,c,u,d;for(;r--;)if(l=e[r][1],c){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;e[r][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(u){if(e[r][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(c=r,l.type!=="labelLink")){a=2;break}}else l.type==="labelEnd"&&(u=r);const h={type:e[c][1].type==="labelLink"?"link":"image",start:{...e[c][1].start},end:{...e[e.length-1][1].end}},p={type:"label",start:{...e[c][1].start},end:{...e[u][1].end}},b={type:"labelText",start:{...e[c+a+2][1].end},end:{...e[u-2][1].start}};return d=[["enter",h,t],["enter",p,t]],d=Zn(d,e.slice(c+1,c+a+3)),d=Zn(d,[["enter",b,t]]),d=Zn(d,Cu(t.parser.constructs.insideSpan.null,e.slice(c+a+4,u-3),t)),d=Zn(d,[["exit",b,t],e[u-2],e[u-1],["exit",p,t]]),d=Zn(d,e.slice(u+1)),d=Zn(d,[["exit",h,t]]),Bn(e,c,e.length,d),e}function aT(e,t,r){const a=this;let l=a.events.length,c,u;for(;l--;)if((a.events[l][1].type==="labelImage"||a.events[l][1].type==="labelLink")&&!a.events[l][1]._balanced){c=a.events[l][1];break}return d;function d(v){return c?c._inactive?y(v):(u=a.parser.defined.includes(ar(a.sliceSerialize({start:c.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),h):r(v)}function h(v){return v===40?e.attempt(eT,b,u?b:y)(v):v===91?e.attempt(tT,b,u?p:y)(v):u?b(v):y(v)}function p(v){return e.attempt(nT,b,y)(v)}function b(v){return t(v)}function y(v){return c._balanced=!0,r(v)}}function sT(e,t,r){return a;function a(y){return e.enter("resource"),e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),l}function l(y){return gt(y)?Xl(e,c)(y):c(y)}function c(y){return y===41?b(y):Ax(e,u,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(y)}function u(y){return gt(y)?Xl(e,h)(y):b(y)}function d(y){return r(y)}function h(y){return y===34||y===39||y===40?Rx(e,p,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(y):b(y)}function p(y){return gt(y)?Xl(e,b)(y):b(y)}function b(y){return y===41?(e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),e.exit("resource"),t):r(y)}}function lT(e,t,r){const a=this;return l;function l(d){return Ox.call(a,e,c,u,"reference","referenceMarker","referenceString")(d)}function c(d){return a.parser.defined.includes(ar(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(d):r(d)}function u(d){return r(d)}}function oT(e,t,r){return a;function a(c){return e.enter("reference"),e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),l}function l(c){return c===93?(e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),e.exit("reference"),t):r(c)}}const cT={name:"labelStartImage",resolveAll:pp.resolveAll,tokenize:uT};function uT(e,t,r){const a=this;return l;function l(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),c}function c(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),u):r(d)}function u(d){return d===94&&"_hiddenFootnoteSupport"in a.parser.constructs?r(d):t(d)}}const dT={name:"labelStartLink",resolveAll:pp.resolveAll,tokenize:fT};function fT(e,t,r){const a=this;return l;function l(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),c}function c(u){return u===94&&"_hiddenFootnoteSupport"in a.parser.constructs?r(u):t(u)}}const Zf={name:"lineEnding",tokenize:hT};function hT(e,t){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Ze(e,t,"linePrefix")}}const tu={name:"thematicBreak",tokenize:pT};function pT(e,t,r){let a=0,l;return c;function c(p){return e.enter("thematicBreak"),u(p)}function u(p){return l=p,d(p)}function d(p){return p===l?(e.enter("thematicBreakSequence"),h(p)):a>=3&&(p===null||Ce(p))?(e.exit("thematicBreak"),t(p)):r(p)}function h(p){return p===l?(e.consume(p),a++,h):(e.exit("thematicBreakSequence"),Ke(p)?Ze(e,d,"whitespace")(p):d(p))}}const wn={continuation:{tokenize:yT},exit:xT,name:"list",tokenize:bT},mT={partial:!0,tokenize:ET},gT={partial:!0,tokenize:vT};function bT(e,t,r){const a=this,l=a.events[a.events.length-1];let c=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,u=0;return d;function d(x){const _=a.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(_==="listUnordered"?!a.containerState.marker||x===a.containerState.marker:Dh(x)){if(a.containerState.type||(a.containerState.type=_,e.enter(_,{_container:!0})),_==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(tu,r,p)(x):p(x);if(!a.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(x)}return r(x)}function h(x){return Dh(x)&&++u<10?(e.consume(x),h):(!a.interrupt||u<2)&&(a.containerState.marker?x===a.containerState.marker:x===41||x===46)?(e.exit("listItemValue"),p(x)):r(x)}function p(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||x,e.check(ho,a.interrupt?r:b,e.attempt(mT,v,y))}function b(x){return a.containerState.initialBlankLine=!0,c++,v(x)}function y(x){return Ke(x)?(e.enter("listItemPrefixWhitespace"),e.consume(x),e.exit("listItemPrefixWhitespace"),v):r(x)}function v(x){return a.containerState.size=c+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(x)}}function yT(e,t,r){const a=this;return a.containerState._closeFlow=void 0,e.check(ho,l,c);function l(d){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,Ze(e,t,"listItemIndent",a.containerState.size+1)(d)}function c(d){return a.containerState.furtherBlankLines||!Ke(d)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,u(d)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(gT,t,u)(d))}function u(d){return a.containerState._closeFlow=!0,a.interrupt=void 0,Ze(e,e.attempt(wn,t,r),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function vT(e,t,r){const a=this;return Ze(e,l,"listItemIndent",a.containerState.size+1);function l(c){const u=a.events[a.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===a.containerState.size?t(c):r(c)}}function xT(e){e.exit(this.containerState.type)}function ET(e,t,r){const a=this;return Ze(e,l,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(c){const u=a.events[a.events.length-1];return!Ke(c)&&u&&u[1].type==="listItemPrefixWhitespace"?t(c):r(c)}}const hv={name:"setextUnderline",resolveTo:_T,tokenize:ST};function _T(e,t){let r=e.length,a,l,c;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){a=r;break}e[r][1].type==="paragraph"&&(l=r)}else e[r][1].type==="content"&&e.splice(r,1),!c&&e[r][1].type==="definition"&&(c=r);const u={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",c?(e.splice(l,0,["enter",u,t]),e.splice(c+1,0,["exit",e[a][1],t]),e[a][1].end={...e[c][1].end}):e[a][1]=u,e.push(["exit",u,t]),e}function ST(e,t,r){const a=this;let l;return c;function c(p){let b=a.events.length,y;for(;b--;)if(a.events[b][1].type!=="lineEnding"&&a.events[b][1].type!=="linePrefix"&&a.events[b][1].type!=="content"){y=a.events[b][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||y)?(e.enter("setextHeadingLine"),l=p,u(p)):r(p)}function u(p){return e.enter("setextHeadingLineSequence"),d(p)}function d(p){return p===l?(e.consume(p),d):(e.exit("setextHeadingLineSequence"),Ke(p)?Ze(e,h,"lineSuffix")(p):h(p))}function h(p){return p===null||Ce(p)?(e.exit("setextHeadingLine"),t(p)):r(p)}}const wT={tokenize:kT};function kT(e){const t=this,r=e.attempt(ho,a,e.attempt(this.parser.constructs.flowInitial,l,Ze(e,e.attempt(this.parser.constructs.flow,l,e.attempt(O2,l)),"linePrefix")));return r;function a(c){if(c===null){e.consume(c);return}return e.enter("lineEndingBlank"),e.consume(c),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function l(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),t.currentConstruct=void 0,r}}const TT={resolveAll:Ix()},NT=Mx("string"),CT=Mx("text");function Mx(e){return{resolveAll:Ix(e==="text"?AT:void 0),tokenize:t};function t(r){const a=this,l=this.parser.constructs[e],c=r.attempt(l,u,d);return u;function u(b){return p(b)?c(b):d(b)}function d(b){if(b===null){r.consume(b);return}return r.enter("data"),r.consume(b),h}function h(b){return p(b)?(r.exit("data"),c(b)):(r.consume(b),h)}function p(b){if(b===null)return!0;const y=l[b];let v=-1;if(y)for(;++v<y.length;){const x=y[v];if(!x.previous||x.previous.call(a,a.previous))return!0}return!1}}}function Ix(e){return t;function t(r,a){let l=-1,c;for(;++l<=r.length;)c===void 0?r[l]&&r[l][1].type==="data"&&(c=l,l++):(!r[l]||r[l][1].type!=="data")&&(l!==c+2&&(r[c][1].end=r[l-1][1].end,r.splice(c+2,l-c-2),l=c+2),c=void 0);return e?e(r,a):r}}function AT(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const a=e[r-1][1],l=t.sliceStream(a);let c=l.length,u=-1,d=0,h;for(;c--;){const p=l[c];if(typeof p=="string"){for(u=p.length;p.charCodeAt(u-1)===32;)d++,u--;if(u)break;u=-1}else if(p===-2)h=!0,d++;else if(p!==-1){c++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(d=0),d){const p={type:r===e.length||h||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?u:a.start._bufferIndex+u,_index:a.start._index+c,line:a.end.line,column:a.end.column-d,offset:a.end.offset-d},end:{...a.end}};a.end={...p.start},a.start.offset===a.end.offset?Object.assign(a,p):(e.splice(r,0,["enter",p,t],["exit",p,t]),r+=2)}r++}return e}const OT={42:wn,43:wn,45:wn,48:wn,49:wn,50:wn,51:wn,52:wn,53:wn,54:wn,55:wn,56:wn,57:wn,62:kx},RT={91:L2},MT={[-2]:Xf,[-1]:Xf,32:Xf},IT={35:H2,42:tu,45:[hv,tu],60:K2,61:hv,95:tu,96:dv,126:dv},DT={38:Nx,92:Tx},LT={[-5]:Zf,[-4]:Zf,[-3]:Zf,33:cT,38:Nx,42:Lh,60:[d2,Q2],91:dT,92:[U2,Tx],93:pp,95:Lh,96:w2},zT={null:[Lh,TT]},jT={null:[42,95]},BT={null:[]},UT=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:jT,contentInitial:RT,disable:BT,document:OT,flow:IT,flowInitial:MT,insideSpan:zT,string:DT,text:LT},Symbol.toStringTag,{value:"Module"}));function PT(e,t,r){let a={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const l={},c=[];let u=[],d=[];const h={attempt:W(P),check:W(I),consume:R,enter:M,exit:A,interrupt:W(I,{interrupt:!0})},p={code:null,containerState:{},defineSkip:T,events:[],now:_,parser:e,previous:null,sliceSerialize:v,sliceStream:x,write:y};let b=t.tokenize.call(p,h);return t.resolveAll&&c.push(t),p;function y(F){return u=Zn(u,F),C(),u[u.length-1]!==null?[]:(te(t,0),p.events=Cu(c,p.events,p),p.events)}function v(F,X){return FT(x(F),X)}function x(F){return HT(u,F)}function _(){const{_bufferIndex:F,_index:X,line:me,column:le,offset:K}=a;return{_bufferIndex:F,_index:X,line:me,column:le,offset:K}}function T(F){l[F.line]=F.column,U()}function C(){let F;for(;a._index<u.length;){const X=u[a._index];if(typeof X=="string")for(F=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===F&&a._bufferIndex<X.length;)S(X.charCodeAt(a._bufferIndex));else S(X)}}function S(F){b=b(F)}function R(F){Ce(F)?(a.line++,a.column=1,a.offset+=F===-3?2:1,U()):F!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===u[a._index].length&&(a._bufferIndex=-1,a._index++)),p.previous=F}function M(F,X){const me=X||{};return me.type=F,me.start=_(),p.events.push(["enter",me,p]),d.push(me),me}function A(F){const X=d.pop();return X.end=_(),p.events.push(["exit",X,p]),X}function P(F,X){te(F,X.from)}function I(F,X){X.restore()}function W(F,X){return me;function me(le,K,z){let Q,ie,B,w;return Array.isArray(le)?G(le):"tokenize"in le?G([le]):O(le);function O(q){return ce;function ce(ge){const xe=ge!==null&&q[ge],Ie=ge!==null&&q.null,St=[...Array.isArray(xe)?xe:xe?[xe]:[],...Array.isArray(Ie)?Ie:Ie?[Ie]:[]];return G(St)(ge)}}function G(q){return Q=q,ie=0,q.length===0?z:N(q[ie])}function N(q){return ce;function ce(ge){return w=ee(),B=q,q.partial||(p.currentConstruct=q),q.name&&p.parser.constructs.disable.null.includes(q.name)?fe():q.tokenize.call(X?Object.assign(Object.create(p),X):p,h,de,fe)(ge)}}function de(q){return F(B,w),K}function fe(q){return w.restore(),++ie<Q.length?N(Q[ie]):z}}}function te(F,X){F.resolveAll&&!c.includes(F)&&c.push(F),F.resolve&&Bn(p.events,X,p.events.length-X,F.resolve(p.events.slice(X),p)),F.resolveTo&&(p.events=F.resolveTo(p.events,p))}function ee(){const F=_(),X=p.previous,me=p.currentConstruct,le=p.events.length,K=Array.from(d);return{from:le,restore:z};function z(){a=F,p.previous=X,p.currentConstruct=me,p.events.length=le,d=K,U()}}function U(){a.line in l&&a.column<2&&(a.column=l[a.line],a.offset+=l[a.line]-1)}}function HT(e,t){const r=t.start._index,a=t.start._bufferIndex,l=t.end._index,c=t.end._bufferIndex;let u;if(r===l)u=[e[r].slice(a,c)];else{if(u=e.slice(r,l),a>-1){const d=u[0];typeof d=="string"?u[0]=d.slice(a):u.shift()}c>0&&u.push(e[l].slice(0,c))}return u}function FT(e,t){let r=-1;const a=[];let l;for(;++r<e.length;){const c=e[r];let u;if(typeof c=="string")u=c;else switch(c){case-5:{u="\r";break}case-4:{u=`
51
- `;break}case-3:{u=`\r
52
- `;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&l)continue;u=" ";break}default:u=String.fromCharCode(c)}l=c===-2,a.push(u)}return a.join("")}function $T(e){const a={constructs:Sx([UT,...(e||{}).extensions||[]]),content:l(i2),defined:[],document:l(s2),flow:l(wT),lazy:{},string:l(NT),text:l(CT)};return a;function l(c){return u;function u(d){return PT(a,c,d)}}}function GT(e){for(;!Cx(e););return e}const pv=/[\0\t\n\r]/g;function KT(){let e=1,t="",r=!0,a;return l;function l(c,u,d){const h=[];let p,b,y,v,x;for(c=t+(typeof c=="string"?c.toString():new TextDecoder(u||void 0).decode(c)),y=0,t="",r&&(c.charCodeAt(0)===65279&&y++,r=void 0);y<c.length;){if(pv.lastIndex=y,p=pv.exec(c),v=p&&p.index!==void 0?p.index:c.length,x=c.charCodeAt(v),!p){t=c.slice(y);break}if(x===10&&y===v&&a)h.push(-3),a=void 0;else switch(a&&(h.push(-5),a=void 0),y<v&&(h.push(c.slice(y,v)),e+=v-y),x){case 0:{h.push(65533),e++;break}case 9:{for(b=Math.ceil(e/4)*4,h.push(-2);e++<b;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:a=!0,e=1}y=v+1}return d&&(a&&h.push(-5),t&&h.push(t),h.push(null)),h}}const qT=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function VT(e){return e.replace(qT,YT)}function YT(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){const l=r.charCodeAt(1),c=l===120||l===88;return wx(r.slice(c?2:1),c?16:10)}return hp(r)||e}const Dx={}.hasOwnProperty;function WT(e,t,r){return typeof t!="string"&&(r=t,t=void 0),XT(r)(GT($T(r).document().write(KT()(e,t,!0))))}function XT(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(cr),autolinkProtocol:ee,autolinkEmail:ee,atxHeading:c(or),blockQuote:c(Ie),characterEscape:ee,characterReference:ee,codeFenced:c(St),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:c(St,u),codeText:c(Ct,u),codeTextData:ee,data:ee,codeFlowValue:ee,definition:c(ri),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:c(Tn),hardBreakEscape:c(We),hardBreakTrailing:c(We),htmlFlow:c(Qn,u),htmlFlowData:ee,htmlText:c(Qn,u),htmlTextData:ee,image:c(Un),label:u,link:c(cr),listItem:c($i),listItemValue:v,listOrdered:c(kr,y),listUnordered:c(kr),paragraph:c(js),reference:N,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:c(or),strong:c(wa),thematicBreak:c(ka)},exit:{atxHeading:h(),atxHeadingSequence:P,autolink:h(),autolinkEmail:xe,autolinkProtocol:ge,blockQuote:h(),characterEscapeValue:U,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:q,characterReference:ce,codeFenced:h(C),codeFencedFence:T,codeFencedFenceInfo:x,codeFencedFenceMeta:_,codeFlowValue:U,codeIndented:h(S),codeText:h(K),codeTextData:U,data:U,definition:h(),definitionDestinationString:A,definitionLabelString:R,definitionTitleString:M,emphasis:h(),hardBreakEscape:h(X),hardBreakTrailing:h(X),htmlFlow:h(me),htmlFlowData:U,htmlText:h(le),htmlTextData:U,image:h(Q),label:B,labelText:ie,lineEnding:F,link:h(z),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:de,resourceDestinationString:w,resourceTitleString:O,resource:G,setextHeading:h(te),setextHeadingLineSequence:W,setextHeadingText:I,strong:h(),thematicBreak:h()}};Lx(t,(e||{}).mdastExtensions||[]);const r={};return a;function a(ne){let be={type:"root",children:[]};const Ae={stack:[be],tokenStack:[],config:t,enter:d,exit:p,buffer:u,resume:b,data:r},He=[];let Qe=-1;for(;++Qe<ne.length;)if(ne[Qe][1].type==="listOrdered"||ne[Qe][1].type==="listUnordered")if(ne[Qe][0]==="enter")He.push(Qe);else{const an=He.pop();Qe=l(ne,an,Qe)}for(Qe=-1;++Qe<ne.length;){const an=t[ne[Qe][0]];Dx.call(an,ne[Qe][1].type)&&an[ne[Qe][1].type].call(Object.assign({sliceSerialize:ne[Qe][2].sliceSerialize},Ae),ne[Qe][1])}if(Ae.tokenStack.length>0){const an=Ae.tokenStack[Ae.tokenStack.length-1];(an[1]||mv).call(Ae,void 0,an[0])}for(be.position={start:Mi(ne.length>0?ne[0][1].start:{line:1,column:1,offset:0}),end:Mi(ne.length>0?ne[ne.length-2][1].end:{line:1,column:1,offset:0})},Qe=-1;++Qe<t.transforms.length;)be=t.transforms[Qe](be)||be;return be}function l(ne,be,Ae){let He=be-1,Qe=-1,an=!1,Jn,qt,At,Qt;for(;++He<=Ae;){const rt=ne[He];switch(rt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{rt[0]==="enter"?Qe++:Qe--,Qt=void 0;break}case"lineEndingBlank":{rt[0]==="enter"&&(Jn&&!Qt&&!Qe&&!At&&(At=He),Qt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Qt=void 0}if(!Qe&&rt[0]==="enter"&&rt[1].type==="listItemPrefix"||Qe===-1&&rt[0]==="exit"&&(rt[1].type==="listUnordered"||rt[1].type==="listOrdered")){if(Jn){let ur=He;for(qt=void 0;ur--;){const sn=ne[ur];if(sn[1].type==="lineEnding"||sn[1].type==="lineEndingBlank"){if(sn[0]==="exit")continue;qt&&(ne[qt][1].type="lineEndingBlank",an=!0),sn[1].type="lineEnding",qt=ur}else if(!(sn[1].type==="linePrefix"||sn[1].type==="blockQuotePrefix"||sn[1].type==="blockQuotePrefixWhitespace"||sn[1].type==="blockQuoteMarker"||sn[1].type==="listItemIndent"))break}At&&(!qt||At<qt)&&(Jn._spread=!0),Jn.end=Object.assign({},qt?ne[qt][1].start:rt[1].end),ne.splice(qt||He,0,["exit",Jn,rt[2]]),He++,Ae++}if(rt[1].type==="listItemPrefix"){const ur={type:"listItem",_spread:!1,start:Object.assign({},rt[1].start),end:void 0};Jn=ur,ne.splice(He,0,["enter",ur,rt[2]]),He++,Ae++,At=void 0,Qt=!0}}}return ne[be][1]._spread=an,Ae}function c(ne,be){return Ae;function Ae(He){d.call(this,ne(He),He),be&&be.call(this,He)}}function u(){this.stack.push({type:"fragment",children:[]})}function d(ne,be,Ae){this.stack[this.stack.length-1].children.push(ne),this.stack.push(ne),this.tokenStack.push([be,Ae||void 0]),ne.position={start:Mi(be.start),end:void 0}}function h(ne){return be;function be(Ae){ne&&ne.call(this,Ae),p.call(this,Ae)}}function p(ne,be){const Ae=this.stack.pop(),He=this.tokenStack.pop();if(He)He[0].type!==ne.type&&(be?be.call(this,ne,He[0]):(He[1]||mv).call(this,ne,He[0]));else throw new Error("Cannot close `"+ne.type+"` ("+Wl({start:ne.start,end:ne.end})+"): it’s not open");Ae.position.end=Mi(ne.end)}function b(){return fp(this.stack.pop())}function y(){this.data.expectingFirstListItemValue=!0}function v(ne){if(this.data.expectingFirstListItemValue){const be=this.stack[this.stack.length-2];be.start=Number.parseInt(this.sliceSerialize(ne),10),this.data.expectingFirstListItemValue=void 0}}function x(){const ne=this.resume(),be=this.stack[this.stack.length-1];be.lang=ne}function _(){const ne=this.resume(),be=this.stack[this.stack.length-1];be.meta=ne}function T(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const ne=this.resume(),be=this.stack[this.stack.length-1];be.value=ne.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const ne=this.resume(),be=this.stack[this.stack.length-1];be.value=ne.replace(/(\r?\n|\r)$/g,"")}function R(ne){const be=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=be,Ae.identifier=ar(this.sliceSerialize(ne)).toLowerCase()}function M(){const ne=this.resume(),be=this.stack[this.stack.length-1];be.title=ne}function A(){const ne=this.resume(),be=this.stack[this.stack.length-1];be.url=ne}function P(ne){const be=this.stack[this.stack.length-1];if(!be.depth){const Ae=this.sliceSerialize(ne).length;be.depth=Ae}}function I(){this.data.setextHeadingSlurpLineEnding=!0}function W(ne){const be=this.stack[this.stack.length-1];be.depth=this.sliceSerialize(ne).codePointAt(0)===61?1:2}function te(){this.data.setextHeadingSlurpLineEnding=void 0}function ee(ne){const Ae=this.stack[this.stack.length-1].children;let He=Ae[Ae.length-1];(!He||He.type!=="text")&&(He=Tt(),He.position={start:Mi(ne.start),end:void 0},Ae.push(He)),this.stack.push(He)}function U(ne){const be=this.stack.pop();be.value+=this.sliceSerialize(ne),be.position.end=Mi(ne.end)}function F(ne){const be=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ae=be.children[be.children.length-1];Ae.position.end=Mi(ne.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(be.type)&&(ee.call(this,ne),U.call(this,ne))}function X(){this.data.atHardBreak=!0}function me(){const ne=this.resume(),be=this.stack[this.stack.length-1];be.value=ne}function le(){const ne=this.resume(),be=this.stack[this.stack.length-1];be.value=ne}function K(){const ne=this.resume(),be=this.stack[this.stack.length-1];be.value=ne}function z(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const be=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=be,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function Q(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const be=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=be,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function ie(ne){const be=this.sliceSerialize(ne),Ae=this.stack[this.stack.length-2];Ae.label=VT(be),Ae.identifier=ar(be).toLowerCase()}function B(){const ne=this.stack[this.stack.length-1],be=this.resume(),Ae=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ae.type==="link"){const He=ne.children;Ae.children=He}else Ae.alt=be}function w(){const ne=this.resume(),be=this.stack[this.stack.length-1];be.url=ne}function O(){const ne=this.resume(),be=this.stack[this.stack.length-1];be.title=ne}function G(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function de(ne){const be=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=be,Ae.identifier=ar(this.sliceSerialize(ne)).toLowerCase(),this.data.referenceType="full"}function fe(ne){this.data.characterReferenceType=ne.type}function q(ne){const be=this.sliceSerialize(ne),Ae=this.data.characterReferenceType;let He;Ae?(He=wx(be,Ae==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):He=hp(be);const Qe=this.stack[this.stack.length-1];Qe.value+=He}function ce(ne){const be=this.stack.pop();be.position.end=Mi(ne.end)}function ge(ne){U.call(this,ne);const be=this.stack[this.stack.length-1];be.url=this.sliceSerialize(ne)}function xe(ne){U.call(this,ne);const be=this.stack[this.stack.length-1];be.url="mailto:"+this.sliceSerialize(ne)}function Ie(){return{type:"blockquote",children:[]}}function St(){return{type:"code",lang:null,meta:null,value:""}}function Ct(){return{type:"inlineCode",value:""}}function ri(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Tn(){return{type:"emphasis",children:[]}}function or(){return{type:"heading",depth:0,children:[]}}function We(){return{type:"break"}}function Qn(){return{type:"html",value:""}}function Un(){return{type:"image",title:null,url:"",alt:null}}function cr(){return{type:"link",title:null,url:"",children:[]}}function kr(ne){return{type:"list",ordered:ne.type==="listOrdered",start:null,spread:ne._spread,children:[]}}function $i(ne){return{type:"listItem",spread:ne._spread,checked:null,children:[]}}function js(){return{type:"paragraph",children:[]}}function wa(){return{type:"strong",children:[]}}function Tt(){return{type:"text",value:""}}function ka(){return{type:"thematicBreak"}}}function Mi(e){return{line:e.line,column:e.column,offset:e.offset}}function Lx(e,t){let r=-1;for(;++r<t.length;){const a=t[r];Array.isArray(a)?Lx(e,a):ZT(e,a)}}function ZT(e,t){let r;for(r in t)if(Dx.call(t,r))switch(r){case"canContainEols":{const a=t[r];a&&e[r].push(...a);break}case"transforms":{const a=t[r];a&&e[r].push(...a);break}case"enter":case"exit":{const a=t[r];a&&Object.assign(e[r],a);break}}}function mv(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Wl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Wl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Wl({start:t.start,end:t.end})+") is still open")}function QT(e){const t=this;t.parser=r;function r(a){return WT(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function JT(e,t){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)}function eN(e,t){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
53
- `}]}function tN(e,t){const r=t.value?t.value+`
54
- `:"",a={},l=t.lang?t.lang.split(/\s+/):[];l.length>0&&(a.className=["language-"+l[0]]);let c={type:"element",tagName:"code",properties:a,children:[{type:"text",value:r}]};return t.meta&&(c.data={meta:t.meta}),e.patch(t,c),c=e.applyData(t,c),c={type:"element",tagName:"pre",properties:{},children:[c]},e.patch(t,c),c}function nN(e,t){const r={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function rN(e,t){const r={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function iN(e,t){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),l=Ds(a.toLowerCase()),c=e.footnoteOrder.indexOf(a);let u,d=e.footnoteCounts.get(a);d===void 0?(d=0,e.footnoteOrder.push(a),u=e.footnoteOrder.length):u=c+1,d+=1,e.footnoteCounts.set(a,d);const h={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+l,id:r+"fnref-"+l+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(t,h);const p={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,p),e.applyData(t,p)}function aN(e,t){const r={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function sN(e,t){if(e.options.allowDangerousHtml){const r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}}function zx(e,t){const r=t.referenceType;let a="]";if(r==="collapsed"?a+="[]":r==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const l=e.all(t),c=l[0];c&&c.type==="text"?c.value="["+c.value:l.unshift({type:"text",value:"["});const u=l[l.length-1];return u&&u.type==="text"?u.value+=a:l.push({type:"text",value:a}),l}function lN(e,t){const r=String(t.identifier).toUpperCase(),a=e.definitionById.get(r);if(!a)return zx(e,t);const l={src:Ds(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(l.title=a.title);const c={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,c),e.applyData(t,c)}function oN(e,t){const r={src:Ds(t.url)};t.alt!==null&&t.alt!==void 0&&(r.alt=t.alt),t.title!==null&&t.title!==void 0&&(r.title=t.title);const a={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,a),e.applyData(t,a)}function cN(e,t){const r={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,r);const a={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(t,a),e.applyData(t,a)}function uN(e,t){const r=String(t.identifier).toUpperCase(),a=e.definitionById.get(r);if(!a)return zx(e,t);const l={href:Ds(a.url||"")};a.title!==null&&a.title!==void 0&&(l.title=a.title);const c={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,c),e.applyData(t,c)}function dN(e,t){const r={href:Ds(t.url)};t.title!==null&&t.title!==void 0&&(r.title=t.title);const a={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function fN(e,t,r){const a=e.all(t),l=r?hN(r):jx(t),c={},u=[];if(typeof t.checked=="boolean"){const b=a[0];let y;b&&b.type==="element"&&b.tagName==="p"?y=b:(y={type:"element",tagName:"p",properties:{},children:[]},a.unshift(y)),y.children.length>0&&y.children.unshift({type:"text",value:" "}),y.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),c.className=["task-list-item"]}let d=-1;for(;++d<a.length;){const b=a[d];(l||d!==0||b.type!=="element"||b.tagName!=="p")&&u.push({type:"text",value:`
55
- `}),b.type==="element"&&b.tagName==="p"&&!l?u.push(...b.children):u.push(b)}const h=a[a.length-1];h&&(l||h.type!=="element"||h.tagName!=="p")&&u.push({type:"text",value:`
56
- `});const p={type:"element",tagName:"li",properties:c,children:u};return e.patch(t,p),e.applyData(t,p)}function hN(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const r=e.children;let a=-1;for(;!t&&++a<r.length;)t=jx(r[a])}return t}function jx(e){const t=e.spread;return t??e.children.length>1}function pN(e,t){const r={},a=e.all(t);let l=-1;for(typeof t.start=="number"&&t.start!==1&&(r.start=t.start);++l<a.length;){const u=a[l];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const c={type:"element",tagName:t.ordered?"ol":"ul",properties:r,children:e.wrap(a,!0)};return e.patch(t,c),e.applyData(t,c)}function mN(e,t){const r={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function gN(e,t){const r={type:"root",children:e.wrap(e.all(t))};return e.patch(t,r),e.applyData(t,r)}function bN(e,t){const r={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function yN(e,t){const r=e.all(t),a=r.shift(),l=[];if(a){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],u),l.push(u)}if(r.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},d=op(t.children[1]),h=gx(t.children[t.children.length-1]);d&&h&&(u.position={start:d,end:h}),l.push(u)}const c={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,c),e.applyData(t,c)}function vN(e,t,r){const a=r?r.children:void 0,c=(a?a.indexOf(t):1)===0?"th":"td",u=r&&r.type==="table"?r.align:void 0,d=u?u.length:t.children.length;let h=-1;const p=[];for(;++h<d;){const y=t.children[h],v={},x=u?u[h]:void 0;x&&(v.align=x);let _={type:"element",tagName:c,properties:v,children:[]};y&&(_.children=e.all(y),e.patch(y,_),_=e.applyData(y,_)),p.push(_)}const b={type:"element",tagName:"tr",properties:{},children:e.wrap(p,!0)};return e.patch(t,b),e.applyData(t,b)}function xN(e,t){const r={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}const gv=9,bv=32;function EN(e){const t=String(e),r=/\r?\n|\r/g;let a=r.exec(t),l=0;const c=[];for(;a;)c.push(yv(t.slice(l,a.index),l>0,!0),a[0]),l=a.index+a[0].length,a=r.exec(t);return c.push(yv(t.slice(l),l>0,!1)),c.join("")}function yv(e,t,r){let a=0,l=e.length;if(t){let c=e.codePointAt(a);for(;c===gv||c===bv;)a++,c=e.codePointAt(a)}if(r){let c=e.codePointAt(l-1);for(;c===gv||c===bv;)l--,c=e.codePointAt(l-1)}return l>a?e.slice(a,l):""}function _N(e,t){const r={type:"text",value:EN(String(t.value))};return e.patch(t,r),e.applyData(t,r)}function SN(e,t){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)}const wN={blockquote:JT,break:eN,code:tN,delete:nN,emphasis:rN,footnoteReference:iN,heading:aN,html:sN,imageReference:lN,image:oN,inlineCode:cN,linkReference:uN,link:dN,listItem:fN,list:pN,paragraph:mN,root:gN,strong:bN,table:yN,tableCell:xN,tableRow:vN,text:_N,thematicBreak:SN,toml:Fc,yaml:Fc,definition:Fc,footnoteDefinition:Fc};function Fc(){}const Bx=-1,Au=0,Zl=1,du=2,mp=3,gp=4,bp=5,yp=6,Ux=7,Px=8,vv=typeof self=="object"?self:globalThis,kN=(e,t)=>{const r=(l,c)=>(e.set(c,l),l),a=l=>{if(e.has(l))return e.get(l);const[c,u]=t[l];switch(c){case Au:case Bx:return r(u,l);case Zl:{const d=r([],l);for(const h of u)d.push(a(h));return d}case du:{const d=r({},l);for(const[h,p]of u)d[a(h)]=a(p);return d}case mp:return r(new Date(u),l);case gp:{const{source:d,flags:h}=u;return r(new RegExp(d,h),l)}case bp:{const d=r(new Map,l);for(const[h,p]of u)d.set(a(h),a(p));return d}case yp:{const d=r(new Set,l);for(const h of u)d.add(a(h));return d}case Ux:{const{name:d,message:h}=u;return r(new vv[d](h),l)}case Px:return r(BigInt(u),l);case"BigInt":return r(Object(BigInt(u)),l);case"ArrayBuffer":return r(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:d}=new Uint8Array(u);return r(new DataView(d),u)}}return r(new vv[c](u),l)};return a},xv=e=>kN(new Map,e)(0),hs="",{toString:TN}={},{keys:NN}=Object,jl=e=>{const t=typeof e;if(t!=="object"||!e)return[Au,t];const r=TN.call(e).slice(8,-1);switch(r){case"Array":return[Zl,hs];case"Object":return[du,hs];case"Date":return[mp,hs];case"RegExp":return[gp,hs];case"Map":return[bp,hs];case"Set":return[yp,hs];case"DataView":return[Zl,r]}return r.includes("Array")?[Zl,r]:r.includes("Error")?[Ux,r]:[du,r]},$c=([e,t])=>e===Au&&(t==="function"||t==="symbol"),CN=(e,t,r,a)=>{const l=(u,d)=>{const h=a.push(u)-1;return r.set(d,h),h},c=u=>{if(r.has(u))return r.get(u);let[d,h]=jl(u);switch(d){case Au:{let b=u;switch(h){case"bigint":d=Px,b=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);b=null;break;case"undefined":return l([Bx],u)}return l([d,b],u)}case Zl:{if(h){let v=u;return h==="DataView"?v=new Uint8Array(u.buffer):h==="ArrayBuffer"&&(v=new Uint8Array(u)),l([h,[...v]],u)}const b=[],y=l([d,b],u);for(const v of u)b.push(c(v));return y}case du:{if(h)switch(h){case"BigInt":return l([h,u.toString()],u);case"Boolean":case"Number":case"String":return l([h,u.valueOf()],u)}if(t&&"toJSON"in u)return c(u.toJSON());const b=[],y=l([d,b],u);for(const v of NN(u))(e||!$c(jl(u[v])))&&b.push([c(v),c(u[v])]);return y}case mp:return l([d,u.toISOString()],u);case gp:{const{source:b,flags:y}=u;return l([d,{source:b,flags:y}],u)}case bp:{const b=[],y=l([d,b],u);for(const[v,x]of u)(e||!($c(jl(v))||$c(jl(x))))&&b.push([c(v),c(x)]);return y}case yp:{const b=[],y=l([d,b],u);for(const v of u)(e||!$c(jl(v)))&&b.push(c(v));return y}}const{message:p}=u;return l([d,{name:h,message:p}],u)};return c},Ev=(e,{json:t,lossy:r}={})=>{const a=[];return CN(!(t||r),!!t,new Map,a)(e),a},fu=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?xv(Ev(e,t)):structuredClone(e):(e,t)=>xv(Ev(e,t));function AN(e,t){const r=[{type:"text",value:"↩"}];return t>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),r}function ON(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function RN(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||AN,a=e.options.footnoteBackLabel||ON,l=e.options.footnoteLabel||"Footnotes",c=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let h=-1;for(;++h<e.footnoteOrder.length;){const p=e.footnoteById.get(e.footnoteOrder[h]);if(!p)continue;const b=e.all(p),y=String(p.identifier).toUpperCase(),v=Ds(y.toLowerCase());let x=0;const _=[],T=e.footnoteCounts.get(y);for(;T!==void 0&&++x<=T;){_.length>0&&_.push({type:"text",value:" "});let R=typeof r=="string"?r:r(h,x);typeof R=="string"&&(R={type:"text",value:R}),_.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(h,x),className:["data-footnote-backref"]},children:Array.isArray(R)?R:[R]})}const C=b[b.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const R=C.children[C.children.length-1];R&&R.type==="text"?R.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(..._)}else b.push(..._);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(b,!0)};e.patch(p,S),d.push(S)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{...fu(u),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
57
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
58
- `}]}}const po=(function(e){if(e==null)return LN;if(typeof e=="function")return Ou(e);if(typeof e=="object")return Array.isArray(e)?MN(e):IN(e);if(typeof e=="string")return DN(e);throw new Error("Expected function, string, or object as test")});function MN(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=po(e[r]);return Ou(a);function a(...l){let c=-1;for(;++c<t.length;)if(t[c].apply(this,l))return!0;return!1}}function IN(e){const t=e;return Ou(r);function r(a){const l=a;let c;for(c in e)if(l[c]!==t[c])return!1;return!0}}function DN(e){return Ou(t);function t(r){return r&&r.type===e}}function Ou(e){return t;function t(r,a,l){return!!(zN(r)&&e.call(this,r,typeof a=="number"?a:void 0,l||void 0))}}function LN(){return!0}function zN(e){return e!==null&&typeof e=="object"&&"type"in e}const Hx=[],jN=!0,zh=!1,BN="skip";function Fx(e,t,r,a){let l;typeof t=="function"&&typeof r!="function"?(a=r,r=t):l=t;const c=po(l),u=a?-1:1;d(e,void 0,[])();function d(h,p,b){const y=h&&typeof h=="object"?h:{};if(typeof y.type=="string"){const x=typeof y.tagName=="string"?y.tagName:typeof y.name=="string"?y.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(h.type+(x?"<"+x+">":""))+")"})}return v;function v(){let x=Hx,_,T,C;if((!t||c(h,p,b[b.length-1]||void 0))&&(x=UN(r(h,b)),x[0]===zh))return x;if("children"in h&&h.children){const S=h;if(S.children&&x[0]!==BN)for(T=(a?S.children.length:-1)+u,C=b.concat(S);T>-1&&T<S.children.length;){const R=S.children[T];if(_=d(R,T,C)(),_[0]===zh)return _;T=typeof _[1]=="number"?_[1]:T+u}}return x}}}function UN(e){return Array.isArray(e)?e:typeof e=="number"?[jN,e]:e==null?Hx:[e]}function Ru(e,t,r,a){let l,c,u;typeof t=="function"&&typeof r!="function"?(c=void 0,u=t,l=r):(c=t,u=r,l=a),Fx(e,c,d,l);function d(h,p){const b=p[p.length-1],y=b?b.children.indexOf(h):void 0;return u(h,y,b)}}const jh={}.hasOwnProperty,PN={};function HN(e,t){const r=t||PN,a=new Map,l=new Map,c=new Map,u={...wN,...r.handlers},d={all:p,applyData:$N,definitionById:a,footnoteById:l,footnoteCounts:c,footnoteOrder:[],handlers:u,one:h,options:r,patch:FN,wrap:KN};return Ru(e,function(b){if(b.type==="definition"||b.type==="footnoteDefinition"){const y=b.type==="definition"?a:l,v=String(b.identifier).toUpperCase();y.has(v)||y.set(v,b)}}),d;function h(b,y){const v=b.type,x=d.handlers[v];if(jh.call(d.handlers,v)&&x)return x(d,b,y);if(d.options.passThrough&&d.options.passThrough.includes(v)){if("children"in b){const{children:T,...C}=b,S=fu(C);return S.children=d.all(b),S}return fu(b)}return(d.options.unknownHandler||GN)(d,b,y)}function p(b){const y=[];if("children"in b){const v=b.children;let x=-1;for(;++x<v.length;){const _=d.one(v[x],b);if(_){if(x&&v[x-1].type==="break"&&(!Array.isArray(_)&&_.type==="text"&&(_.value=_v(_.value)),!Array.isArray(_)&&_.type==="element")){const T=_.children[0];T&&T.type==="text"&&(T.value=_v(T.value))}Array.isArray(_)?y.push(..._):y.push(_)}}}return y}}function FN(e,t){e.position&&(t.position=Ok(e))}function $N(e,t){let r=t;if(e&&e.data){const a=e.data.hName,l=e.data.hChildren,c=e.data.hProperties;if(typeof a=="string")if(r.type==="element")r.tagName=a;else{const u="children"in r?r.children:[r];r={type:"element",tagName:a,properties:{},children:u}}r.type==="element"&&c&&Object.assign(r.properties,fu(c)),"children"in r&&r.children&&l!==null&&l!==void 0&&(r.children=l)}return r}function GN(e,t){const r=t.data||{},a="value"in t&&!(jh.call(r,"hProperties")||jh.call(r,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function KN(e,t){const r=[];let a=-1;for(t&&r.push({type:"text",value:`
59
- `});++a<e.length;)a&&r.push({type:"text",value:`
60
- `}),r.push(e[a]);return t&&e.length>0&&r.push({type:"text",value:`
61
- `}),r}function _v(e){let t=0,r=e.charCodeAt(t);for(;r===9||r===32;)t++,r=e.charCodeAt(t);return e.slice(t)}function Sv(e,t){const r=HN(e,t),a=r.one(e,void 0),l=RN(r),c=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return l&&c.children.push({type:"text",value:`
62
- `},l),c}function qN(e,t){return e&&"run"in e?async function(r,a){const l=Sv(r,{file:a,...t});await e.run(l,a)}:function(r,a){return Sv(r,{file:a,...e||t})}}function wv(e){if(e)throw e}var Qf,kv;function VN(){if(kv)return Qf;kv=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l=function(p){return typeof Array.isArray=="function"?Array.isArray(p):t.call(p)==="[object Array]"},c=function(p){if(!p||t.call(p)!=="[object Object]")return!1;var b=e.call(p,"constructor"),y=p.constructor&&p.constructor.prototype&&e.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!b&&!y)return!1;var v;for(v in p);return typeof v>"u"||e.call(p,v)},u=function(p,b){r&&b.name==="__proto__"?r(p,b.name,{enumerable:!0,configurable:!0,value:b.newValue,writable:!0}):p[b.name]=b.newValue},d=function(p,b){if(b==="__proto__")if(e.call(p,b)){if(a)return a(p,b).value}else return;return p[b]};return Qf=function h(){var p,b,y,v,x,_,T=arguments[0],C=1,S=arguments.length,R=!1;for(typeof T=="boolean"&&(R=T,T=arguments[1]||{},C=2),(T==null||typeof T!="object"&&typeof T!="function")&&(T={});C<S;++C)if(p=arguments[C],p!=null)for(b in p)y=d(T,b),v=d(p,b),T!==v&&(R&&v&&(c(v)||(x=l(v)))?(x?(x=!1,_=y&&l(y)?y:[]):_=y&&c(y)?y:{},u(T,{name:b,newValue:h(R,_,v)})):typeof v<"u"&&u(T,{name:b,newValue:v}));return T},Qf}var YN=VN();const Jf=co(YN);function Bh(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 WN(){const e=[],t={run:r,use:a};return t;function r(...l){let c=-1;const u=l.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);d(null,...l);function d(h,...p){const b=e[++c];let y=-1;if(h){u(h);return}for(;++y<l.length;)(p[y]===null||p[y]===void 0)&&(p[y]=l[y]);l=p,b?XN(b,d)(...p):u(null,...p)}}function a(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),t}}function XN(e,t){let r;return a;function a(...u){const d=e.length>u.length;let h;d&&u.push(l);try{h=e.apply(this,u)}catch(p){const b=p;if(d&&r)throw b;return l(b)}d||(h&&h.then&&typeof h.then=="function"?h.then(c,l):h instanceof Error?l(h):c(h))}function l(u,...d){r||(r=!0,t(u,...d))}function c(u){l(null,u)}}const br={basename:ZN,dirname:QN,extname:JN,join:eC,sep:"/"};function ZN(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');mo(e);let r=0,a=-1,l=e.length,c;if(t===void 0||t.length===0||t.length>e.length){for(;l--;)if(e.codePointAt(l)===47){if(c){r=l+1;break}}else a<0&&(c=!0,a=l+1);return a<0?"":e.slice(r,a)}if(t===e)return"";let u=-1,d=t.length-1;for(;l--;)if(e.codePointAt(l)===47){if(c){r=l+1;break}}else u<0&&(c=!0,u=l+1),d>-1&&(e.codePointAt(l)===t.codePointAt(d--)?d<0&&(a=l):(d=-1,a=u));return r===a?a=u:a<0&&(a=e.length),e.slice(r,a)}function QN(e){if(mo(e),e.length===0)return".";let t=-1,r=e.length,a;for(;--r;)if(e.codePointAt(r)===47){if(a){t=r;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function JN(e){mo(e);let t=e.length,r=-1,a=0,l=-1,c=0,u;for(;t--;){const d=e.codePointAt(t);if(d===47){if(u){a=t+1;break}continue}r<0&&(u=!0,r=t+1),d===46?l<0?l=t:c!==1&&(c=1):l>-1&&(c=-1)}return l<0||r<0||c===0||c===1&&l===r-1&&l===a+1?"":e.slice(l,r)}function eC(...e){let t=-1,r;for(;++t<e.length;)mo(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":tC(r)}function tC(e){mo(e);const t=e.codePointAt(0)===47;let r=nC(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function nC(e,t){let r="",a=0,l=-1,c=0,u=-1,d,h;for(;++u<=e.length;){if(u<e.length)d=e.codePointAt(u);else{if(d===47)break;d=47}if(d===47){if(!(l===u-1||c===1))if(l!==u-1&&c===2){if(r.length<2||a!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(h=r.lastIndexOf("/"),h!==r.length-1){h<0?(r="",a=0):(r=r.slice(0,h),a=r.length-1-r.lastIndexOf("/")),l=u,c=0;continue}}else if(r.length>0){r="",a=0,l=u,c=0;continue}}t&&(r=r.length>0?r+"/..":"..",a=2)}else r.length>0?r+="/"+e.slice(l+1,u):r=e.slice(l+1,u),a=u-l-1;l=u,c=0}else d===46&&c>-1?c++:c=-1}return r}function mo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const rC={cwd:iC};function iC(){return"/"}function Uh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function aC(e){if(typeof e=="string")e=new URL(e);else if(!Uh(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 sC(e)}function sC(e){if(e.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const t=e.pathname;let r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){const a=t.codePointAt(r+2);if(a===70||a===102){const l=new TypeError("File URL path must not include encoded / characters");throw l.code="ERR_INVALID_FILE_URL_PATH",l}}return decodeURIComponent(t)}const eh=["history","path","basename","stem","extname","dirname"];class $x{constructor(t){let r;t?Uh(t)?r={path:t}:typeof t=="string"||lC(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":rC.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<eh.length;){const c=eh[a];c in r&&r[c]!==void 0&&r[c]!==null&&(this[c]=c==="history"?[...r[c]]:r[c])}let l;for(l in r)eh.includes(l)||(this[l]=r[l])}get basename(){return typeof this.path=="string"?br.basename(this.path):void 0}set basename(t){nh(t,"basename"),th(t,"basename"),this.path=br.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?br.dirname(this.path):void 0}set dirname(t){Tv(this.basename,"dirname"),this.path=br.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?br.extname(this.path):void 0}set extname(t){if(th(t,"extname"),Tv(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=br.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Uh(t)&&(t=aC(t)),nh(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?br.basename(this.path,this.extname):void 0}set stem(t){nh(t,"stem"),th(t,"stem"),this.path=br.join(this.dirname||"",t+(this.extname||""))}fail(t,r,a){const l=this.message(t,r,a);throw l.fatal=!0,l}info(t,r,a){const l=this.message(t,r,a);return l.fatal=void 0,l}message(t,r,a){const l=new rn(t,r,a);return this.path&&(l.name=this.path+":"+l.name,l.file=this.path),l.fatal=!1,this.messages.push(l),l}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function th(e,t){if(e&&e.includes(br.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+br.sep+"`")}function nh(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Tv(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function lC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const oC=(function(e){const a=this.constructor.prototype,l=a[e],c=function(){return l.apply(c,arguments)};return Object.setPrototypeOf(c,a),c}),cC={}.hasOwnProperty;class vp extends oC{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=WN()}copy(){const t=new vp;let r=-1;for(;++r<this.attachers.length;){const a=this.attachers[r];t.use(...a)}return t.data(Jf(!0,{},this.namespace)),t}data(t,r){return typeof t=="string"?arguments.length===2?(ah("data",this.frozen),this.namespace[t]=r,this):cC.call(this.namespace,t)&&this.namespace[t]||void 0:t?(ah("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[r,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const l=r.call(t,...a);typeof l=="function"&&this.transformers.use(l)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const r=Gc(t),a=this.parser||this.Parser;return rh("parse",a),a(String(r),r)}process(t,r){const a=this;return this.freeze(),rh("process",this.parser||this.Parser),ih("process",this.compiler||this.Compiler),r?l(void 0,r):new Promise(l);function l(c,u){const d=Gc(t),h=a.parse(d);a.run(h,d,function(b,y,v){if(b||!y||!v)return p(b);const x=y,_=a.stringify(x,v);fC(_)?v.value=_:v.result=_,p(b,v)});function p(b,y){b||!y?u(b):c?c(y):r(void 0,y)}}}processSync(t){let r=!1,a;return this.freeze(),rh("processSync",this.parser||this.Parser),ih("processSync",this.compiler||this.Compiler),this.process(t,l),Cv("processSync","process",r),a;function l(c,u){r=!0,wv(c),a=u}}run(t,r,a){Nv(t),this.freeze();const l=this.transformers;return!a&&typeof r=="function"&&(a=r,r=void 0),a?c(void 0,a):new Promise(c);function c(u,d){const h=Gc(r);l.run(t,h,p);function p(b,y,v){const x=y||t;b?d(b):u?u(x):a(void 0,x,v)}}}runSync(t,r){let a=!1,l;return this.run(t,r,c),Cv("runSync","run",a),l;function c(u,d){wv(u),l=d,a=!0}}stringify(t,r){this.freeze();const a=Gc(r),l=this.compiler||this.Compiler;return ih("stringify",l),Nv(t),l(t,a)}use(t,...r){const a=this.attachers,l=this.namespace;if(ah("use",this.frozen),t!=null)if(typeof t=="function")h(t,r);else if(typeof t=="object")Array.isArray(t)?d(t):u(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function c(p){if(typeof p=="function")h(p,[]);else if(typeof p=="object")if(Array.isArray(p)){const[b,...y]=p;h(b,y)}else u(p);else throw new TypeError("Expected usable value, not `"+p+"`")}function u(p){if(!("plugins"in p)&&!("settings"in p))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");d(p.plugins),p.settings&&(l.settings=Jf(!0,l.settings,p.settings))}function d(p){let b=-1;if(p!=null)if(Array.isArray(p))for(;++b<p.length;){const y=p[b];c(y)}else throw new TypeError("Expected a list of plugins, not `"+p+"`")}function h(p,b){let y=-1,v=-1;for(;++y<a.length;)if(a[y][0]===p){v=y;break}if(v===-1)a.push([p,...b]);else if(b.length>0){let[x,..._]=b;const T=a[v][1];Bh(T)&&Bh(x)&&(x=Jf(!0,T,x)),a[v]=[p,x,..._]}}}}const uC=new vp().freeze();function rh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ih(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ah(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 Nv(e){if(!Bh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Cv(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Gc(e){return dC(e)?e:new $x(e)}function dC(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function fC(e){return typeof e=="string"||hC(e)}function hC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const pC="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Av=[],Ov={allowDangerousHtml:!0},mC=/^(https?|ircs?|mailto|xmpp)$/i,gC=[{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 Gx(e){const t=bC(e),r=yC(e);return vC(t.runSync(t.parse(r),r),e)}function bC(e){const t=e.rehypePlugins||Av,r=e.remarkPlugins||Av,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ov}:Ov;return uC().use(QT).use(r).use(qN,a).use(t)}function yC(e){const t=e.children||"",r=new $x;return typeof t=="string"&&(r.value=t),r}function vC(e,t){const r=t.allowedElements,a=t.allowElement,l=t.components,c=t.disallowedElements,u=t.skipHtml,d=t.unwrapDisallowed,h=t.urlTransform||xC;for(const b of gC)Object.hasOwn(t,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+pC+b.id,void 0);return Ru(e,p),Lk(e,{Fragment:m.Fragment,components:l,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0});function p(b,y,v){if(b.type==="raw"&&v&&typeof y=="number")return u?v.children.splice(y,1):v.children[y]={type:"text",value:b.value},y;if(b.type==="element"){let x;for(x in Wf)if(Object.hasOwn(Wf,x)&&Object.hasOwn(b.properties,x)){const _=b.properties[x],T=Wf[x];(T===null||T.includes(b.tagName))&&(b.properties[x]=h(String(_||""),x,b))}}if(b.type==="element"){let x=r?!r.includes(b.tagName):c?c.includes(b.tagName):!1;if(!x&&a&&typeof y=="number"&&(x=!a(b,y,v)),x&&v&&typeof y=="number")return d&&b.children?v.children.splice(y,1,...b.children):v.children.splice(y,1),y}}}function xC(e){const t=e.indexOf(":"),r=e.indexOf("?"),a=e.indexOf("#"),l=e.indexOf("/");return t===-1||l!==-1&&t>l||r!==-1&&t>r||a!==-1&&t>a||mC.test(e.slice(0,t))?e:""}function Rv(e,t){const r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,l=r.indexOf(t);for(;l!==-1;)a++,l=r.indexOf(t,l+t.length);return a}function EC(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function _C(e,t,r){const l=po((r||{}).ignore||[]),c=SC(t);let u=-1;for(;++u<c.length;)Fx(e,"text",d);function d(p,b){let y=-1,v;for(;++y<b.length;){const x=b[y],_=v?v.children:void 0;if(l(x,_?_.indexOf(x):void 0,v))return;v=x}if(v)return h(p,b)}function h(p,b){const y=b[b.length-1],v=c[u][0],x=c[u][1];let _=0;const C=y.children.indexOf(p);let S=!1,R=[];v.lastIndex=0;let M=v.exec(p.value);for(;M;){const A=M.index,P={index:M.index,input:M.input,stack:[...b,p]};let I=x(...M,P);if(typeof I=="string"&&(I=I.length>0?{type:"text",value:I}:void 0),I===!1?v.lastIndex=A+1:(_!==A&&R.push({type:"text",value:p.value.slice(_,A)}),Array.isArray(I)?R.push(...I):I&&R.push(I),_=A+M[0].length,S=!0),!v.global)break;M=v.exec(p.value)}return S?(_<p.value.length&&R.push({type:"text",value:p.value.slice(_)}),y.children.splice(C,1,...R)):R=[p],C+R.length}}function SC(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const r=!e[0]||Array.isArray(e[0])?e:[e];let a=-1;for(;++a<r.length;){const l=r[a];t.push([wC(l[0]),kC(l[1])])}return t}function wC(e){return typeof e=="string"?new RegExp(EC(e),"g"):e}function kC(e){return typeof e=="function"?e:function(){return e}}const sh="phrasing",lh=["autolink","link","image","label"];function TC(){return{transforms:[IC],enter:{literalAutolink:CC,literalAutolinkEmail:oh,literalAutolinkHttp:oh,literalAutolinkWww:oh},exit:{literalAutolink:MC,literalAutolinkEmail:RC,literalAutolinkHttp:AC,literalAutolinkWww:OC}}}function NC(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:sh,notInConstruct:lh},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:sh,notInConstruct:lh},{character:":",before:"[ps]",after:"\\/",inConstruct:sh,notInConstruct:lh}]}}function CC(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function oh(e){this.config.enter.autolinkProtocol.call(this,e)}function AC(e){this.config.exit.autolinkProtocol.call(this,e)}function OC(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 RC(e){this.config.exit.autolinkEmail.call(this,e)}function MC(e){this.exit(e)}function IC(e){_C(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,DC],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),LC]],{ignore:["link","linkReference"]})}function DC(e,t,r,a,l){let c="";if(!Kx(l)||(/^w/i.test(t)&&(r=t+r,t="",c="http://"),!zC(r)))return!1;const u=jC(r+a);if(!u[0])return!1;const d={type:"link",title:null,url:c+t+u[0],children:[{type:"text",value:t+u[0]}]};return u[1]?[d,{type:"text",value:u[1]}]:d}function LC(e,t,r,a){return!Kx(a,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+r,children:[{type:"text",value:t+"@"+r}]}}function zC(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 jC(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let r=t[0],a=r.indexOf(")");const l=Rv(e,"(");let c=Rv(e,")");for(;a!==-1&&l>c;)e+=r.slice(0,a+1),r=r.slice(a+1),a=r.indexOf(")"),c++;return[e,r]}function Kx(e,t){const r=e.input.charCodeAt(e.index-1);return(e.index===0||va(r)||Nu(r))&&(!t||r!==47)}qx.peek=qC;function BC(){this.buffer()}function UC(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function PC(){this.buffer()}function HC(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function FC(e){const t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=ar(this.sliceSerialize(e)).toLowerCase(),r.label=t}function $C(e){this.exit(e)}function GC(e){const t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=ar(this.sliceSerialize(e)).toLowerCase(),r.label=t}function KC(e){this.exit(e)}function qC(){return"["}function qx(e,t,r,a){const l=r.createTracker(a);let c=l.move("[^");const u=r.enter("footnoteReference"),d=r.enter("reference");return c+=l.move(r.safe(r.associationId(e),{after:"]",before:c})),d(),u(),c+=l.move("]"),c}function VC(){return{enter:{gfmFootnoteCallString:BC,gfmFootnoteCall:UC,gfmFootnoteDefinitionLabelString:PC,gfmFootnoteDefinition:HC},exit:{gfmFootnoteCallString:FC,gfmFootnoteCall:$C,gfmFootnoteDefinitionLabelString:GC,gfmFootnoteDefinition:KC}}}function YC(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:r,footnoteReference:qx},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(a,l,c,u){const d=c.createTracker(u);let h=d.move("[^");const p=c.enter("footnoteDefinition"),b=c.enter("label");return h+=d.move(c.safe(c.associationId(a),{before:h,after:"]"})),b(),h+=d.move("]:"),a.children&&a.children.length>0&&(d.shift(4),h+=d.move((t?`
63
- `:" ")+c.indentLines(c.containerFlow(a,d.current()),t?Vx:WC))),p(),h}}function WC(e,t,r){return t===0?e:Vx(e,t,r)}function Vx(e,t,r){return(r?"":" ")+e}const XC=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Yx.peek=tA;function ZC(){return{canContainEols:["delete"],enter:{strikethrough:JC},exit:{strikethrough:eA}}}function QC(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:XC}],handlers:{delete:Yx}}}function JC(e){this.enter({type:"delete",children:[]},e)}function eA(e){this.exit(e)}function Yx(e,t,r,a){const l=r.createTracker(a),c=r.enter("strikethrough");let u=l.move("~~");return u+=r.containerPhrasing(e,{...l.current(),before:u,after:"~"}),u+=l.move("~~"),c(),u}function tA(){return"~"}function nA(e){return e.length}function rA(e,t){const r=t||{},a=(r.align||[]).concat(),l=r.stringLength||nA,c=[],u=[],d=[],h=[];let p=0,b=-1;for(;++b<e.length;){const T=[],C=[];let S=-1;for(e[b].length>p&&(p=e[b].length);++S<e[b].length;){const R=iA(e[b][S]);if(r.alignDelimiters!==!1){const M=l(R);C[S]=M,(h[S]===void 0||M>h[S])&&(h[S]=M)}T.push(R)}u[b]=T,d[b]=C}let y=-1;if(typeof a=="object"&&"length"in a)for(;++y<p;)c[y]=Mv(a[y]);else{const T=Mv(a);for(;++y<p;)c[y]=T}y=-1;const v=[],x=[];for(;++y<p;){const T=c[y];let C="",S="";T===99?(C=":",S=":"):T===108?C=":":T===114&&(S=":");let R=r.alignDelimiters===!1?1:Math.max(1,h[y]-C.length-S.length);const M=C+"-".repeat(R)+S;r.alignDelimiters!==!1&&(R=C.length+R+S.length,R>h[y]&&(h[y]=R),x[y]=R),v[y]=M}u.splice(1,0,v),d.splice(1,0,x),b=-1;const _=[];for(;++b<u.length;){const T=u[b],C=d[b];y=-1;const S=[];for(;++y<p;){const R=T[y]||"";let M="",A="";if(r.alignDelimiters!==!1){const P=h[y]-(C[y]||0),I=c[y];I===114?M=" ".repeat(P):I===99?P%2?(M=" ".repeat(P/2+.5),A=" ".repeat(P/2-.5)):(M=" ".repeat(P/2),A=M):A=" ".repeat(P)}r.delimiterStart!==!1&&!y&&S.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&R==="")&&(r.delimiterStart!==!1||y)&&S.push(" "),r.alignDelimiters!==!1&&S.push(M),S.push(R),r.alignDelimiters!==!1&&S.push(A),r.padding!==!1&&S.push(" "),(r.delimiterEnd!==!1||y!==p-1)&&S.push("|")}_.push(r.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return _.join(`
64
- `)}function iA(e){return e==null?"":String(e)}function Mv(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}function aA(e,t,r,a){const l=r.enter("blockquote"),c=r.createTracker(a);c.move("> "),c.shift(2);const u=r.indentLines(r.containerFlow(e,c.current()),sA);return l(),u}function sA(e,t,r){return">"+(r?"":" ")+e}function lA(e,t){return Iv(e,t.inConstruct,!0)&&!Iv(e,t.notInConstruct,!1)}function Iv(e,t,r){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return r;let a=-1;for(;++a<t.length;)if(e.includes(t[a]))return!0;return!1}function Dv(e,t,r,a){let l=-1;for(;++l<r.unsafe.length;)if(r.unsafe[l].character===`
65
- `&&lA(r.stack,r.unsafe[l]))return/[ \t]/.test(a.before)?"":" ";return`\\
66
- `}function oA(e,t){const r=String(e);let a=r.indexOf(t),l=a,c=0,u=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===l?++c>u&&(u=c):c=1,l=a+t.length,a=r.indexOf(t,l);return u}function cA(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 uA(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 dA(e,t,r,a){const l=uA(r),c=e.value||"",u=l==="`"?"GraveAccent":"Tilde";if(cA(e,r)){const y=r.enter("codeIndented"),v=r.indentLines(c,fA);return y(),v}const d=r.createTracker(a),h=l.repeat(Math.max(oA(c,l)+1,3)),p=r.enter("codeFenced");let b=d.move(h);if(e.lang){const y=r.enter(`codeFencedLang${u}`);b+=d.move(r.safe(e.lang,{before:b,after:" ",encode:["`"],...d.current()})),y()}if(e.lang&&e.meta){const y=r.enter(`codeFencedMeta${u}`);b+=d.move(" "),b+=d.move(r.safe(e.meta,{before:b,after:`
67
- `,encode:["`"],...d.current()})),y()}return b+=d.move(`
68
- `),c&&(b+=d.move(c+`
69
- `)),b+=d.move(h),p(),b}function fA(e,t,r){return(r?"":" ")+e}function xp(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 hA(e,t,r,a){const l=xp(r),c=l==='"'?"Quote":"Apostrophe",u=r.enter("definition");let d=r.enter("label");const h=r.createTracker(a);let p=h.move("[");return p+=h.move(r.safe(r.associationId(e),{before:p,after:"]",...h.current()})),p+=h.move("]: "),d(),!e.url||/[\0- \u007F]/.test(e.url)?(d=r.enter("destinationLiteral"),p+=h.move("<"),p+=h.move(r.safe(e.url,{before:p,after:">",...h.current()})),p+=h.move(">")):(d=r.enter("destinationRaw"),p+=h.move(r.safe(e.url,{before:p,after:e.title?" ":`
70
- `,...h.current()}))),d(),e.title&&(d=r.enter(`title${c}`),p+=h.move(" "+l),p+=h.move(r.safe(e.title,{before:p,after:l,...h.current()})),p+=h.move(l),d()),u(),p}function pA(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 ao(e){return"&#x"+e.toString(16).toUpperCase()+";"}function hu(e,t,r){const a=As(e),l=As(t);return a===void 0?l===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===1?l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Wx.peek=mA;function Wx(e,t,r,a){const l=pA(r),c=r.enter("emphasis"),u=r.createTracker(a),d=u.move(l);let h=u.move(r.containerPhrasing(e,{after:l,before:d,...u.current()}));const p=h.charCodeAt(0),b=hu(a.before.charCodeAt(a.before.length-1),p,l);b.inside&&(h=ao(p)+h.slice(1));const y=h.charCodeAt(h.length-1),v=hu(a.after.charCodeAt(0),y,l);v.inside&&(h=h.slice(0,-1)+ao(y));const x=u.move(l);return c(),r.attentionEncodeSurroundingInfo={after:v.outside,before:b.outside},d+h+x}function mA(e,t,r){return r.options.emphasis||"*"}function gA(e,t){let r=!1;return Ru(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return r=!0,zh}),!!((!e.depth||e.depth<3)&&fp(e)&&(t.options.setext||r))}function bA(e,t,r,a){const l=Math.max(Math.min(6,e.depth||1),1),c=r.createTracker(a);if(gA(e,r)){const b=r.enter("headingSetext"),y=r.enter("phrasing"),v=r.containerPhrasing(e,{...c.current(),before:`
71
- `,after:`
72
- `});return y(),b(),v+`
73
- `+(l===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
74
- `))+1))}const u="#".repeat(l),d=r.enter("headingAtx"),h=r.enter("phrasing");c.move(u+" ");let p=r.containerPhrasing(e,{before:"# ",after:`
75
- `,...c.current()});return/^[\t ]/.test(p)&&(p=ao(p.charCodeAt(0))+p.slice(1)),p=p?u+" "+p:u,r.options.closeAtx&&(p+=" "+u),h(),d(),p}Xx.peek=yA;function Xx(e){return e.value||""}function yA(){return"<"}Zx.peek=vA;function Zx(e,t,r,a){const l=xp(r),c=l==='"'?"Quote":"Apostrophe",u=r.enter("image");let d=r.enter("label");const h=r.createTracker(a);let p=h.move("![");return p+=h.move(r.safe(e.alt,{before:p,after:"]",...h.current()})),p+=h.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=r.enter("destinationLiteral"),p+=h.move("<"),p+=h.move(r.safe(e.url,{before:p,after:">",...h.current()})),p+=h.move(">")):(d=r.enter("destinationRaw"),p+=h.move(r.safe(e.url,{before:p,after:e.title?" ":")",...h.current()}))),d(),e.title&&(d=r.enter(`title${c}`),p+=h.move(" "+l),p+=h.move(r.safe(e.title,{before:p,after:l,...h.current()})),p+=h.move(l),d()),p+=h.move(")"),u(),p}function vA(){return"!"}Qx.peek=xA;function Qx(e,t,r,a){const l=e.referenceType,c=r.enter("imageReference");let u=r.enter("label");const d=r.createTracker(a);let h=d.move("![");const p=r.safe(e.alt,{before:h,after:"]",...d.current()});h+=d.move(p+"]["),u();const b=r.stack;r.stack=[],u=r.enter("reference");const y=r.safe(r.associationId(e),{before:h,after:"]",...d.current()});return u(),r.stack=b,c(),l==="full"||!p||p!==y?h+=d.move(y+"]"):l==="shortcut"?h=h.slice(0,-1):h+=d.move("]"),h}function xA(){return"!"}Jx.peek=EA;function Jx(e,t,r){let a=e.value||"",l="`",c=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(a);)l+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++c<r.unsafe.length;){const u=r.unsafe[c],d=r.compilePattern(u);let h;if(u.atBreak)for(;h=d.exec(a);){let p=h.index;a.charCodeAt(p)===10&&a.charCodeAt(p-1)===13&&p--,a=a.slice(0,p)+" "+a.slice(h.index+1)}}return l+a+l}function EA(){return"`"}function e0(e,t){const r=fp(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(r===e.url||"mailto:"+r===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}t0.peek=_A;function t0(e,t,r,a){const l=xp(r),c=l==='"'?"Quote":"Apostrophe",u=r.createTracker(a);let d,h;if(e0(e,r)){const b=r.stack;r.stack=[],d=r.enter("autolink");let y=u.move("<");return y+=u.move(r.containerPhrasing(e,{before:y,after:">",...u.current()})),y+=u.move(">"),d(),r.stack=b,y}d=r.enter("link"),h=r.enter("label");let p=u.move("[");return p+=u.move(r.containerPhrasing(e,{before:p,after:"](",...u.current()})),p+=u.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=r.enter("destinationLiteral"),p+=u.move("<"),p+=u.move(r.safe(e.url,{before:p,after:">",...u.current()})),p+=u.move(">")):(h=r.enter("destinationRaw"),p+=u.move(r.safe(e.url,{before:p,after:e.title?" ":")",...u.current()}))),h(),e.title&&(h=r.enter(`title${c}`),p+=u.move(" "+l),p+=u.move(r.safe(e.title,{before:p,after:l,...u.current()})),p+=u.move(l),h()),p+=u.move(")"),d(),p}function _A(e,t,r){return e0(e,r)?"<":"["}n0.peek=SA;function n0(e,t,r,a){const l=e.referenceType,c=r.enter("linkReference");let u=r.enter("label");const d=r.createTracker(a);let h=d.move("[");const p=r.containerPhrasing(e,{before:h,after:"]",...d.current()});h+=d.move(p+"]["),u();const b=r.stack;r.stack=[],u=r.enter("reference");const y=r.safe(r.associationId(e),{before:h,after:"]",...d.current()});return u(),r.stack=b,c(),l==="full"||!p||p!==y?h+=d.move(y+"]"):l==="shortcut"?h=h.slice(0,-1):h+=d.move("]"),h}function SA(){return"["}function Ep(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 wA(e){const t=Ep(e),r=e.options.bulletOther;if(!r)return t==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+r+"`) to be different");return r}function kA(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 r0(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 TA(e,t,r,a){const l=r.enter("list"),c=r.bulletCurrent;let u=e.ordered?kA(r):Ep(r);const d=e.ordered?u==="."?")":".":wA(r);let h=t&&r.bulletLastUsed?u===r.bulletLastUsed:!1;if(!e.ordered){const b=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&b&&(!b.children||!b.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(h=!0),r0(r)===u&&b){let y=-1;for(;++y<e.children.length;){const v=e.children[y];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(u=d),r.bulletCurrent=u;const p=r.containerFlow(e,a);return r.bulletLastUsed=u,r.bulletCurrent=c,l(),p}function NA(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 CA(e,t,r,a){const l=NA(r);let c=r.bulletCurrent||Ep(r);t&&t.type==="list"&&t.ordered&&(c=(typeof t.start=="number"&&t.start>-1?t.start:1)+(r.options.incrementListMarker===!1?0:t.children.indexOf(e))+c);let u=c.length+1;(l==="tab"||l==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(u=Math.ceil(u/4)*4);const d=r.createTracker(a);d.move(c+" ".repeat(u-c.length)),d.shift(u);const h=r.enter("listItem"),p=r.indentLines(r.containerFlow(e,d.current()),b);return h(),p;function b(y,v,x){return v?(x?"":" ".repeat(u))+y:(x?c:c+" ".repeat(u-c.length))+y}}function AA(e,t,r,a){const l=r.enter("paragraph"),c=r.enter("phrasing"),u=r.containerPhrasing(e,a);return c(),l(),u}const OA=po(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function RA(e,t,r,a){return(e.children.some(function(u){return OA(u)})?r.containerPhrasing:r.containerFlow).call(r,e,a)}function MA(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}i0.peek=IA;function i0(e,t,r,a){const l=MA(r),c=r.enter("strong"),u=r.createTracker(a),d=u.move(l+l);let h=u.move(r.containerPhrasing(e,{after:l,before:d,...u.current()}));const p=h.charCodeAt(0),b=hu(a.before.charCodeAt(a.before.length-1),p,l);b.inside&&(h=ao(p)+h.slice(1));const y=h.charCodeAt(h.length-1),v=hu(a.after.charCodeAt(0),y,l);v.inside&&(h=h.slice(0,-1)+ao(y));const x=u.move(l+l);return c(),r.attentionEncodeSurroundingInfo={after:v.outside,before:b.outside},d+h+x}function IA(e,t,r){return r.options.strong||"*"}function DA(e,t,r,a){return r.safe(e.value,a)}function LA(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 zA(e,t,r){const a=(r0(r)+(r.options.ruleSpaces?" ":"")).repeat(LA(r));return r.options.ruleSpaces?a.slice(0,-1):a}const a0={blockquote:aA,break:Dv,code:dA,definition:hA,emphasis:Wx,hardBreak:Dv,heading:bA,html:Xx,image:Zx,imageReference:Qx,inlineCode:Jx,link:t0,linkReference:n0,list:TA,listItem:CA,paragraph:AA,root:RA,strong:i0,text:DA,thematicBreak:zA};function jA(){return{enter:{table:BA,tableData:Lv,tableHeader:Lv,tableRow:PA},exit:{codeText:HA,table:UA,tableData:ch,tableHeader:ch,tableRow:ch}}}function BA(e){const t=e._align;this.enter({type:"table",align:t.map(function(r){return r==="none"?null:r}),children:[]},e),this.data.inTable=!0}function UA(e){this.exit(e),this.data.inTable=void 0}function PA(e){this.enter({type:"tableRow",children:[]},e)}function ch(e){this.exit(e)}function Lv(e){this.enter({type:"tableCell",children:[]},e)}function HA(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,FA));const r=this.stack[this.stack.length-1];r.type,r.value=t,this.exit(e)}function FA(e,t){return t==="|"?t:e}function $A(e){const t=e||{},r=t.tableCellPadding,a=t.tablePipeAlign,l=t.stringLength,c=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
76
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:u,tableCell:h,tableRow:d}};function u(x,_,T,C){return p(b(x,T,C),x.align)}function d(x,_,T,C){const S=y(x,T,C),R=p([S]);return R.slice(0,R.indexOf(`
77
- `))}function h(x,_,T,C){const S=T.enter("tableCell"),R=T.enter("phrasing"),M=T.containerPhrasing(x,{...C,before:c,after:c});return R(),S(),M}function p(x,_){return rA(x,{align:_,alignDelimiters:a,padding:r,stringLength:l})}function b(x,_,T){const C=x.children;let S=-1;const R=[],M=_.enter("table");for(;++S<C.length;)R[S]=y(C[S],_,T);return M(),R}function y(x,_,T){const C=x.children;let S=-1;const R=[],M=_.enter("tableRow");for(;++S<C.length;)R[S]=h(C[S],x,_,T);return M(),R}function v(x,_,T){let C=a0.inlineCode(x,_,T);return T.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function GA(){return{exit:{taskListCheckValueChecked:zv,taskListCheckValueUnchecked:zv,paragraph:qA}}}function KA(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:VA}}}function zv(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function qA(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const a=r.children[0];if(a&&a.type==="text"){const l=t.children;let c=-1,u;for(;++c<l.length;){const d=l[c];if(d.type==="paragraph"){u=d;break}}u===r&&(a.value=a.value.slice(1),a.value.length===0?r.children.shift():r.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,r.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function VA(e,t,r,a){const l=e.children[0],c=typeof e.checked=="boolean"&&l&&l.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",d=r.createTracker(a);c&&d.move(u);let h=a0.listItem(e,t,r,{...a,...d.current()});return c&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,p)),h;function p(b){return b+u}}function YA(){return[TC(),VC(),ZC(),jA(),GA()]}function WA(e){return{extensions:[NC(),YC(e),QC(),$A(e),KA()]}}const XA={tokenize:nO,partial:!0},s0={tokenize:rO,partial:!0},l0={tokenize:iO,partial:!0},o0={tokenize:aO,partial:!0},ZA={tokenize:sO,partial:!0},c0={name:"wwwAutolink",tokenize:eO,previous:d0},u0={name:"protocolAutolink",tokenize:tO,previous:f0},ni={name:"emailAutolink",tokenize:JA,previous:h0},wr={};function QA(){return{text:wr}}let fa=48;for(;fa<123;)wr[fa]=ni,fa++,fa===58?fa=65:fa===91&&(fa=97);wr[43]=ni;wr[45]=ni;wr[46]=ni;wr[95]=ni;wr[72]=[ni,u0];wr[104]=[ni,u0];wr[87]=[ni,c0];wr[119]=[ni,c0];function JA(e,t,r){const a=this;let l,c;return u;function u(y){return!Ph(y)||!h0.call(a,a.previous)||_p(a.events)?r(y):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),d(y))}function d(y){return Ph(y)?(e.consume(y),d):y===64?(e.consume(y),h):r(y)}function h(y){return y===46?e.check(ZA,b,p)(y):y===45||y===95||nn(y)?(c=!0,e.consume(y),h):b(y)}function p(y){return e.consume(y),l=!0,h}function b(y){return c&&l&&dn(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(y)):r(y)}}function eO(e,t,r){const a=this;return l;function l(u){return u!==87&&u!==119||!d0.call(a,a.previous)||_p(a.events)?r(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(XA,e.attempt(s0,e.attempt(l0,c),r),r)(u))}function c(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function tO(e,t,r){const a=this;let l="",c=!1;return u;function u(y){return(y===72||y===104)&&f0.call(a,a.previous)&&!_p(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(y),e.consume(y),d):r(y)}function d(y){if(dn(y)&&l.length<5)return l+=String.fromCodePoint(y),e.consume(y),d;if(y===58){const v=l.toLowerCase();if(v==="http"||v==="https")return e.consume(y),h}return r(y)}function h(y){return y===47?(e.consume(y),c?p:(c=!0,h)):r(y)}function p(y){return y===null||uu(y)||gt(y)||va(y)||Nu(y)?r(y):e.attempt(s0,e.attempt(l0,b),r)(y)}function b(y){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(y)}}function nO(e,t,r){let a=0;return l;function l(u){return(u===87||u===119)&&a<3?(a++,e.consume(u),l):u===46&&a===3?(e.consume(u),c):r(u)}function c(u){return u===null?r(u):t(u)}}function rO(e,t,r){let a,l,c;return u;function u(p){return p===46||p===95?e.check(o0,h,d)(p):p===null||gt(p)||va(p)||p!==45&&Nu(p)?h(p):(c=!0,e.consume(p),u)}function d(p){return p===95?a=!0:(l=a,a=void 0),e.consume(p),u}function h(p){return l||a||!c?r(p):t(p)}}function iO(e,t){let r=0,a=0;return l;function l(u){return u===40?(r++,e.consume(u),l):u===41&&a<r?c(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(o0,t,c)(u):u===null||gt(u)||va(u)?t(u):(e.consume(u),l)}function c(u){return u===41&&a++,e.consume(u),l}}function aO(e,t,r){return a;function a(d){return d===33||d===34||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===63||d===95||d===126?(e.consume(d),a):d===38?(e.consume(d),c):d===93?(e.consume(d),l):d===60||d===null||gt(d)||va(d)?t(d):r(d)}function l(d){return d===null||d===40||d===91||gt(d)||va(d)?t(d):a(d)}function c(d){return dn(d)?u(d):r(d)}function u(d){return d===59?(e.consume(d),a):dn(d)?(e.consume(d),u):r(d)}}function sO(e,t,r){return a;function a(c){return e.consume(c),l}function l(c){return nn(c)?r(c):t(c)}}function d0(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||gt(e)}function f0(e){return!dn(e)}function h0(e){return!(e===47||Ph(e))}function Ph(e){return e===43||e===45||e===46||e===95||nn(e)}function _p(e){let t=e.length,r=!1;for(;t--;){const a=e[t][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){r=!0;break}if(a._gfmAutolinkLiteralWalkedInto){r=!1;break}}return e.length>0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const lO={tokenize:mO,partial:!0};function oO(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:fO,continuation:{tokenize:hO},exit:pO}},text:{91:{name:"gfmFootnoteCall",tokenize:dO},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:cO,resolveTo:uO}}}}function cO(e,t,r){const a=this;let l=a.events.length;const c=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let u;for(;l--;){const h=a.events[l][1];if(h.type==="labelImage"){u=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return d;function d(h){if(!u||!u._balanced)return r(h);const p=ar(a.sliceSerialize({start:u.end,end:a.now()}));return p.codePointAt(0)!==94||!c.includes(p.slice(1))?r(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),t(h))}}function uO(e,t){let r=e.length;for(;r--;)if(e[r][1].type==="labelImage"&&e[r][0]==="enter"){e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const c={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},c.start),end:Object.assign({},c.end)},d=[e[r+1],e[r+2],["enter",a,t],e[r+3],e[r+4],["enter",l,t],["exit",l,t],["enter",c,t],["enter",u,t],["exit",u,t],["exit",c,t],e[e.length-2],e[e.length-1],["exit",a,t]];return e.splice(r,e.length-r+1,...d),e}function dO(e,t,r){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let c=0,u;return d;function d(y){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(y),e.exit("gfmFootnoteCallLabelMarker"),h}function h(y){return y!==94?r(y):(e.enter("gfmFootnoteCallMarker"),e.consume(y),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",p)}function p(y){if(c>999||y===93&&!u||y===null||y===91||gt(y))return r(y);if(y===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return l.includes(ar(a.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(y),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):r(y)}return gt(y)||(u=!0),c++,e.consume(y),y===92?b:p}function b(y){return y===91||y===92||y===93?(e.consume(y),c++,p):p(y)}}function fO(e,t,r){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let c,u=0,d;return h;function h(_){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionLabelMarker"),p}function p(_){return _===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",b):r(_)}function b(_){if(u>999||_===93&&!d||_===null||_===91||gt(_))return r(_);if(_===93){e.exit("chunkString");const T=e.exit("gfmFootnoteDefinitionLabelString");return c=ar(a.sliceSerialize(T)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(_),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return gt(_)||(d=!0),u++,e.consume(_),_===92?y:b}function y(_){return _===91||_===92||_===93?(e.consume(_),u++,b):b(_)}function v(_){return _===58?(e.enter("definitionMarker"),e.consume(_),e.exit("definitionMarker"),l.includes(c)||l.push(c),Ze(e,x,"gfmFootnoteDefinitionWhitespace")):r(_)}function x(_){return t(_)}}function hO(e,t,r){return e.check(ho,t,e.attempt(lO,t,r))}function pO(e){e.exit("gfmFootnoteDefinition")}function mO(e,t,r){const a=this;return Ze(e,l,"gfmFootnoteDefinitionIndent",5);function l(c){const u=a.events[a.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?t(c):r(c)}}function gO(e){let r=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:c,resolveAll:l};return r==null&&(r=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function l(u,d){let h=-1;for(;++h<u.length;)if(u[h][0]==="enter"&&u[h][1].type==="strikethroughSequenceTemporary"&&u[h][1]._close){let p=h;for(;p--;)if(u[p][0]==="exit"&&u[p][1].type==="strikethroughSequenceTemporary"&&u[p][1]._open&&u[h][1].end.offset-u[h][1].start.offset===u[p][1].end.offset-u[p][1].start.offset){u[h][1].type="strikethroughSequence",u[p][1].type="strikethroughSequence";const b={type:"strikethrough",start:Object.assign({},u[p][1].start),end:Object.assign({},u[h][1].end)},y={type:"strikethroughText",start:Object.assign({},u[p][1].end),end:Object.assign({},u[h][1].start)},v=[["enter",b,d],["enter",u[p][1],d],["exit",u[p][1],d],["enter",y,d]],x=d.parser.constructs.insideSpan.null;x&&Bn(v,v.length,0,Cu(x,u.slice(p+1,h),d)),Bn(v,v.length,0,[["exit",y,d],["enter",u[h][1],d],["exit",u[h][1],d],["exit",b,d]]),Bn(u,p-1,h-p+3,v),h=p+v.length-2;break}}for(h=-1;++h<u.length;)u[h][1].type==="strikethroughSequenceTemporary"&&(u[h][1].type="data");return u}function c(u,d,h){const p=this.previous,b=this.events;let y=0;return v;function v(_){return p===126&&b[b.length-1][1].type!=="characterEscape"?h(_):(u.enter("strikethroughSequenceTemporary"),x(_))}function x(_){const T=As(p);if(_===126)return y>1?h(_):(u.consume(_),y++,x);if(y<2&&!r)return h(_);const C=u.exit("strikethroughSequenceTemporary"),S=As(_);return C._open=!S||S===2&&!!T,C._close=!T||T===2&&!!S,d(_)}}}class bO{constructor(){this.map=[]}add(t,r,a){yO(this,t,r,a)}consume(t){if(this.map.sort(function(c,u){return c[0]-u[0]}),this.map.length===0)return;let r=this.map.length;const a=[];for(;r>0;)r-=1,a.push(t.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),t.length=this.map[r][0];a.push(t.slice()),t.length=0;let l=a.pop();for(;l;){for(const c of l)t.push(c);l=a.pop()}this.map.length=0}}function yO(e,t,r,a){let l=0;if(!(r===0&&a.length===0)){for(;l<e.map.length;){if(e.map[l][0]===t){e.map[l][1]+=r,e.map[l][2].push(...a);return}l+=1}e.map.push([t,r,a])}}function vO(e,t){let r=!1;const a=[];for(;t<e.length;){const l=e[t];if(r){if(l[0]==="enter")l[1].type==="tableContent"&&a.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const c=a.length-1;a[c]=a[c]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(r=!0);t+=1}return a}function xO(){return{flow:{null:{name:"table",tokenize:EO,resolveAll:_O}}}}function EO(e,t,r){const a=this;let l=0,c=0,u;return d;function d(U){let F=a.events.length-1;for(;F>-1;){const le=a.events[F][1].type;if(le==="lineEnding"||le==="linePrefix")F--;else break}const X=F>-1?a.events[F][1].type:null,me=X==="tableHead"||X==="tableRow"?I:h;return me===I&&a.parser.lazy[a.now().line]?r(U):me(U)}function h(U){return e.enter("tableHead"),e.enter("tableRow"),p(U)}function p(U){return U===124||(u=!0,c+=1),b(U)}function b(U){return U===null?r(U):Ce(U)?c>1?(c=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),x):r(U):Ke(U)?Ze(e,b,"whitespace")(U):(c+=1,u&&(u=!1,l+=1),U===124?(e.enter("tableCellDivider"),e.consume(U),e.exit("tableCellDivider"),u=!0,b):(e.enter("data"),y(U)))}function y(U){return U===null||U===124||gt(U)?(e.exit("data"),b(U)):(e.consume(U),U===92?v:y)}function v(U){return U===92||U===124?(e.consume(U),y):y(U)}function x(U){return a.interrupt=!1,a.parser.lazy[a.now().line]?r(U):(e.enter("tableDelimiterRow"),u=!1,Ke(U)?Ze(e,_,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):_(U))}function _(U){return U===45||U===58?C(U):U===124?(u=!0,e.enter("tableCellDivider"),e.consume(U),e.exit("tableCellDivider"),T):P(U)}function T(U){return Ke(U)?Ze(e,C,"whitespace")(U):C(U)}function C(U){return U===58?(c+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(U),e.exit("tableDelimiterMarker"),S):U===45?(c+=1,S(U)):U===null||Ce(U)?A(U):P(U)}function S(U){return U===45?(e.enter("tableDelimiterFiller"),R(U)):P(U)}function R(U){return U===45?(e.consume(U),R):U===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(U),e.exit("tableDelimiterMarker"),M):(e.exit("tableDelimiterFiller"),M(U))}function M(U){return Ke(U)?Ze(e,A,"whitespace")(U):A(U)}function A(U){return U===124?_(U):U===null||Ce(U)?!u||l!==c?P(U):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(U)):P(U)}function P(U){return r(U)}function I(U){return e.enter("tableRow"),W(U)}function W(U){return U===124?(e.enter("tableCellDivider"),e.consume(U),e.exit("tableCellDivider"),W):U===null||Ce(U)?(e.exit("tableRow"),t(U)):Ke(U)?Ze(e,W,"whitespace")(U):(e.enter("data"),te(U))}function te(U){return U===null||U===124||gt(U)?(e.exit("data"),W(U)):(e.consume(U),U===92?ee:te)}function ee(U){return U===92||U===124?(e.consume(U),te):te(U)}}function _O(e,t){let r=-1,a=!0,l=0,c=[0,0,0,0],u=[0,0,0,0],d=!1,h=0,p,b,y;const v=new bO;for(;++r<e.length;){const x=e[r],_=x[1];x[0]==="enter"?_.type==="tableHead"?(d=!1,h!==0&&(jv(v,t,h,p,b),b=void 0,h=0),p={type:"table",start:Object.assign({},_.start),end:Object.assign({},_.end)},v.add(r,0,[["enter",p,t]])):_.type==="tableRow"||_.type==="tableDelimiterRow"?(a=!0,y=void 0,c=[0,0,0,0],u=[0,r+1,0,0],d&&(d=!1,b={type:"tableBody",start:Object.assign({},_.start),end:Object.assign({},_.end)},v.add(r,0,[["enter",b,t]])),l=_.type==="tableDelimiterRow"?2:b?3:1):l&&(_.type==="data"||_.type==="tableDelimiterMarker"||_.type==="tableDelimiterFiller")?(a=!1,u[2]===0&&(c[1]!==0&&(u[0]=u[1],y=Kc(v,t,c,l,void 0,y),c=[0,0,0,0]),u[2]=r)):_.type==="tableCellDivider"&&(a?a=!1:(c[1]!==0&&(u[0]=u[1],y=Kc(v,t,c,l,void 0,y)),c=u,u=[c[1],r,0,0])):_.type==="tableHead"?(d=!0,h=r):_.type==="tableRow"||_.type==="tableDelimiterRow"?(h=r,c[1]!==0?(u[0]=u[1],y=Kc(v,t,c,l,r,y)):u[1]!==0&&(y=Kc(v,t,u,l,r,y)),l=0):l&&(_.type==="data"||_.type==="tableDelimiterMarker"||_.type==="tableDelimiterFiller")&&(u[3]=r)}for(h!==0&&jv(v,t,h,p,b),v.consume(t.events),r=-1;++r<t.events.length;){const x=t.events[r];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=vO(t.events,r))}return e}function Kc(e,t,r,a,l,c){const u=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",d="tableContent";r[0]!==0&&(c.end=Object.assign({},ms(t.events,r[0])),e.add(r[0],0,[["exit",c,t]]));const h=ms(t.events,r[1]);if(c={type:u,start:Object.assign({},h),end:Object.assign({},h)},e.add(r[1],0,[["enter",c,t]]),r[2]!==0){const p=ms(t.events,r[2]),b=ms(t.events,r[3]),y={type:d,start:Object.assign({},p),end:Object.assign({},b)};if(e.add(r[2],0,[["enter",y,t]]),a!==2){const v=t.events[r[2]],x=t.events[r[3]];if(v[1].end=Object.assign({},x[1].end),v[1].type="chunkText",v[1].contentType="text",r[3]>r[2]+1){const _=r[2]+1,T=r[3]-r[2]-1;e.add(_,T,[])}}e.add(r[3]+1,0,[["exit",y,t]])}return l!==void 0&&(c.end=Object.assign({},ms(t.events,l)),e.add(l,0,[["exit",c,t]]),c=void 0),c}function jv(e,t,r,a,l){const c=[],u=ms(t.events,r);l&&(l.end=Object.assign({},u),c.push(["exit",l,t])),a.end=Object.assign({},u),c.push(["exit",a,t]),e.add(r+1,0,c)}function ms(e,t){const r=e[t],a=r[0]==="enter"?"start":"end";return r[1][a]}const SO={name:"tasklistCheck",tokenize:kO};function wO(){return{text:{91:SO}}}function kO(e,t,r){const a=this;return l;function l(h){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?r(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),c)}function c(h){return gt(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),u):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),u):r(h)}function u(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),d):r(h)}function d(h){return Ce(h)?t(h):Ke(h)?e.check({tokenize:TO},t,r)(h):r(h)}}function TO(e,t,r){return Ze(e,a,"whitespace");function a(l){return l===null?r(l):t(l)}}function NO(e){return Sx([QA(),oO(),gO(e),xO(),wO()])}const CO={};function p0(e){const t=this,r=e||CO,a=t.data(),l=a.micromarkExtensions||(a.micromarkExtensions=[]),c=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),u=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);l.push(NO(r)),c.push(YA()),u.push(WA(r))}const Bv=(function(e,t,r){const a=po(r);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(a(e.children[t],t,e))return e.children[t]}),Sa=(function(e){if(e==null)return RO;if(typeof e=="string")return OO(e);if(typeof e=="object")return AO(e);if(typeof e=="function")return Sp(e);throw new Error("Expected function, string, or array as `test`")});function AO(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=Sa(e[r]);return Sp(a);function a(...l){let c=-1;for(;++c<t.length;)if(t[c].apply(this,l))return!0;return!1}}function OO(e){return Sp(t);function t(r){return r.tagName===e}}function Sp(e){return t;function t(r,a,l){return!!(MO(r)&&e.call(this,r,typeof a=="number"?a:void 0,l||void 0))}}function RO(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function MO(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const Uv=/\n/g,Pv=/[\t ]+/g,Hh=Sa("br"),Hv=Sa(PO),IO=Sa("p"),Fv=Sa("tr"),DO=Sa(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",UO,HO]),m0=Sa(["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 LO(e,t){const r=t||{},a="children"in e?e.children:[],l=m0(e),c=y0(e,{whitespace:r.whitespace||"normal"}),u=[];(e.type==="text"||e.type==="comment")&&u.push(...b0(e,{breakBefore:!0,breakAfter:!0}));let d=-1;for(;++d<a.length;)u.push(...g0(a[d],e,{whitespace:c,breakBefore:d?void 0:l,breakAfter:d<a.length-1?Hh(a[d+1]):l}));const h=[];let p;for(d=-1;++d<u.length;){const b=u[d];typeof b=="number"?p!==void 0&&b>p&&(p=b):b&&(p!==void 0&&p>-1&&h.push(`
78
- `.repeat(p)||" "),p=-1,h.push(b))}return h.join("")}function g0(e,t,r){return e.type==="element"?zO(e,t,r):e.type==="text"?r.whitespace==="normal"?b0(e,r):jO(e):[]}function zO(e,t,r){const a=y0(e,r),l=e.children||[];let c=-1,u=[];if(DO(e))return u;let d,h;for(Hh(e)||Fv(e)&&Bv(t,e,Fv)?h=`
79
- `:IO(e)?(d=2,h=2):m0(e)&&(d=1,h=1);++c<l.length;)u=u.concat(g0(l[c],e,{whitespace:a,breakBefore:c?void 0:d,breakAfter:c<l.length-1?Hh(l[c+1]):h}));return Hv(e)&&Bv(t,e,Hv)&&u.push(" "),d&&u.unshift(d),h&&u.push(h),u}function b0(e,t){const r=String(e.value),a=[],l=[];let c=0;for(;c<=r.length;){Uv.lastIndex=c;const h=Uv.exec(r),p=h&&"index"in h?h.index:r.length;a.push(BO(r.slice(c,p).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),c===0?t.breakBefore:!0,p===r.length?t.breakAfter:!0)),c=p+1}let u=-1,d;for(;++u<a.length;)a[u].charCodeAt(a[u].length-1)===8203||u<a.length-1&&a[u+1].charCodeAt(0)===8203?(l.push(a[u]),d=void 0):a[u]?(typeof d=="number"&&l.push(d),l.push(a[u]),d=0):(u===0||u===a.length-1)&&l.push(0);return l}function jO(e){return[String(e.value)]}function BO(e,t,r){const a=[];let l=0,c;for(;l<e.length;){Pv.lastIndex=l;const u=Pv.exec(e);c=u?u.index:e.length,!l&&!c&&u&&!t&&a.push(""),l!==c&&a.push(e.slice(l,c)),l=u?c+u[0].length:c}return l!==c&&!r&&a.push(""),a.join(" ")}function y0(e,t){if(e.type==="element"){const r=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return r.wrap?"pre-wrap":"pre";case"td":case"th":return r.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function UO(e){return!!(e.properties||{}).hidden}function PO(e){return e.tagName==="td"||e.tagName==="th"}function HO(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function FO(e){const t=e.regex,r=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",l="[a-zA-Z_]\\w*::",u="(?!struct)("+a+"|"+t.optional(l)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",d={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},p={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})"/})]},b={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},y={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(p,{className:"string"}),{className:"string",begin:/<.*?>/},r,e.C_BLOCK_COMMENT_MODE]},v={className:"title",begin:t.optional(l)+e.IDENT_RE,relevance:0},x=t.optional(l)+e.IDENT_RE+"\\s*\\(",_=["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"],C=["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"],S=["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"],A={type:T,keyword:_,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:C},P={className:"function.dispatch",relevance:0,keywords:{_hint:S},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},I=[P,y,d,r,e.C_BLOCK_COMMENT_MODE,b,p],W={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:A,contains:I.concat([{begin:/\(/,end:/\)/,keywords:A,contains:I.concat(["self"]),relevance:0}]),relevance:0},te={className:"function",begin:"("+u+"[\\*&\\s]+)+"+x,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:A,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:A,relevance:0},{begin:x,returnBegin:!0,contains:[v],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[p,b]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:[r,e.C_BLOCK_COMMENT_MODE,p,b,d,{begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:["self",r,e.C_BLOCK_COMMENT_MODE,p,b,d]}]},d,r,e.C_BLOCK_COMMENT_MODE,y]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:A,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(W,te,P,I,[y,{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:A,contains:["self",d]},{begin:e.IDENT_RE+"::",keywords:A},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function $O(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"]},r=FO(e),a=r.keywords;return a.type=[...a.type,...t.type],a.literal=[...a.literal,...t.literal],a.built_in=[...a.built_in,...t.built_in],a._hints=t._hints,r.name="Arduino",r.aliases=["ino"],r.supersetOf="cpp",r}function GO(e){const t=e.regex,r={},a={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[r]}]};Object.assign(r,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},a]});const l={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},c=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),u={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},d={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,r,l]};l.contains.push(d);const h={match:/\\"/},p={className:"string",begin:/'/,end:/'/},b={match:/\\'/},y={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,r]},v=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],x=e.SHEBANG({binary:`(${v.join("|")})`,relevance:10}),_={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"],C=["true","false"],S={match:/(\/[a-z._-]+)+/},R=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],M=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],A=["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"],P=["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:C,built_in:[...R,...M,"set","shopt",...A,...P]},contains:[x,e.SHEBANG(),_,y,c,u,S,d,h,p,b,r]}}function KO(e){const t=e.regex,r=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",l="[a-zA-Z_]\\w*::",u="("+a+"|"+t.optional(l)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",d={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},p={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})"/})]},b={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},y={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(p,{className:"string"}),{className:"string",begin:/<.*?>/},r,e.C_BLOCK_COMMENT_MODE]},v={className:"title",begin:t.optional(l)+e.IDENT_RE,relevance:0},x=t.optional(l)+e.IDENT_RE+"\\s*\\(",C={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"},S=[y,d,r,e.C_BLOCK_COMMENT_MODE,b,p],R={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:C,contains:S.concat([{begin:/\(/,end:/\)/,keywords:C,contains:S.concat(["self"]),relevance:0}]),relevance:0},M={begin:"("+u+"[\\*&\\s]+)+"+x,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:C,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:C,relevance:0},{begin:x,returnBegin:!0,contains:[e.inherit(v,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:[r,e.C_BLOCK_COMMENT_MODE,p,b,d,{begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:["self",r,e.C_BLOCK_COMMENT_MODE,p,b,d]}]},d,r,e.C_BLOCK_COMMENT_MODE,y]};return{name:"C",aliases:["h"],keywords:C,disableAutodetect:!0,illegal:"</",contains:[].concat(R,M,S,[y,{begin:e.IDENT_RE+"::",keywords:C},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:y,strings:p,keywords:C}}}function qO(e){const t=e.regex,r=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",l="[a-zA-Z_]\\w*::",u="(?!struct)("+a+"|"+t.optional(l)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",d={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},p={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})"/})]},b={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},y={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(p,{className:"string"}),{className:"string",begin:/<.*?>/},r,e.C_BLOCK_COMMENT_MODE]},v={className:"title",begin:t.optional(l)+e.IDENT_RE,relevance:0},x=t.optional(l)+e.IDENT_RE+"\\s*\\(",_=["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"],C=["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"],S=["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"],A={type:T,keyword:_,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:C},P={className:"function.dispatch",relevance:0,keywords:{_hint:S},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},I=[P,y,d,r,e.C_BLOCK_COMMENT_MODE,b,p],W={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:A,contains:I.concat([{begin:/\(/,end:/\)/,keywords:A,contains:I.concat(["self"]),relevance:0}]),relevance:0},te={className:"function",begin:"("+u+"[\\*&\\s]+)+"+x,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:A,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:A,relevance:0},{begin:x,returnBegin:!0,contains:[v],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[p,b]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:[r,e.C_BLOCK_COMMENT_MODE,p,b,d,{begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:["self",r,e.C_BLOCK_COMMENT_MODE,p,b,d]}]},d,r,e.C_BLOCK_COMMENT_MODE,y]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:A,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(W,te,P,I,[y,{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:A,contains:["self",d]},{begin:e.IDENT_RE+"::",keywords:A},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function VO(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],r=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],a=["default","false","null","true"],l=["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"],c=["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"],u={keyword:l.concat(c),built_in:t,literal:a},d=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),h={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},p={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},b={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},y=e.inherit(b,{illegal:/\n/}),v={className:"subst",begin:/\{/,end:/\}/,keywords:u},x=e.inherit(v,{illegal:/\n/}),_={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,x]},T={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},v]},C=e.inherit(T,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},x]});v.contains=[T,_,b,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,e.C_BLOCK_COMMENT_MODE],x.contains=[C,_,y,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const S={variants:[p,T,_,b,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},R={begin:"<",end:">",contains:[{beginKeywords:"in out"},d]},M=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",A={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:u,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"}},S,h,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},d,R,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[d,R,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:"("+M+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:u,contains:[{beginKeywords:r.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,R],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,relevance:0,contains:[S,h,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},A]}}const YO=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_-]*/}}),WO=["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"],XO=["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"],ZO=[...WO,...XO],QO=["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(),JO=["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(),eR=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),tR=["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 nR(e){const t=e.regex,r=YO(e),a={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},l="and or not only",c=/@-?\w[\w]*(-\w+)*/,u="[a-zA-Z-][a-zA-Z0-9_-]*",d=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[r.BLOCK_COMMENT,a,r.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+u,relevance:0},r.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+JO.join("|")+")"},{begin:":(:)?("+eR.join("|")+")"}]},r.CSS_VARIABLE,{className:"attribute",begin:"\\b("+tR.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[r.BLOCK_COMMENT,r.HEXCOLOR,r.IMPORTANT,r.CSS_NUMBER_MODE,...d,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...d,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},r.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:c},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:l,attribute:QO.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...d,r.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+ZO.join("|")+")\\b"}]}}function rR(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 iR(e){const c={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:c,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:c,illegal:/["']/}]}]}}function aR(e){const t=e.regex,r=/[_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(r,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function sR(e){const t=e.regex,r={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},a=e.COMMENT();a.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const l={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},c={className:"literal",begin:/\bon|off|true|false|yes|no\b/},u={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},d={begin:/\[/,end:/\]/,contains:[a,c,l,u,r,"self"],relevance:0},h=/[A-Za-z0-9_-]+/,p=/"(\\"|[^"])*"/,b=/'[^']*'/,y=t.either(h,p,b),v=t.concat(y,"(\\s*\\.\\s*",y,")*",t.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[a,{className:"section",begin:/\[+/,end:/\]+/},{begin:v,className:"attr",starts:{end:/$/,contains:[a,d,c,l,u,r]}}]}}var gs="[0-9](_*[0-9])*",qc=`\\.(${gs})`,Vc="[0-9a-fA-F](_*[0-9a-fA-F])*",$v={className:"number",variants:[{begin:`(\\b(${gs})((${qc})|\\.)?|(${qc}))[eE][+-]?(${gs})[fFdD]?\\b`},{begin:`\\b(${gs})((${qc})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${qc})[fFdD]?\\b`},{begin:`\\b(${gs})[fFdD]\\b`},{begin:`\\b0[xX]((${Vc})\\.?|(${Vc})?\\.(${Vc}))[pP][+-]?(${gs})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Vc})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function v0(e,t,r){return r===-1?"":e.replace(t,a=>v0(e,t,r-1))}function lR(e){const t=e.regex,r="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",a=r+v0("(?:<"+r+"~~~(?:\\s*,\\s*"+r+"~~~)*>)?",/~~~/g,2),h={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"]},p={className:"meta",begin:"@"+r,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},b={className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:h,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+/,r],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,r),/\s+/,r,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,r],className:{1:"keyword",3:"title.class"},contains:[b,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+a+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:h,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[p,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,$v,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},$v,p]}}const Gv="[A-Za-z$_][0-9A-Za-z$_]*",oR=["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"],cR=["true","false","null","undefined","NaN","Infinity"],x0=["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"],E0=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],_0=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],uR=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],dR=[].concat(_0,x0,E0);function fR(e){const t=e.regex,r=(ie,{after:B})=>{const w="</"+ie[0].slice(1);return ie.input.indexOf(w,B)!==-1},a=Gv,l={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,u={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ie,B)=>{const w=ie[0].length+ie.index,O=ie.input[w];if(O==="<"||O===","){B.ignoreMatch();return}O===">"&&(r(ie,{after:w})||B.ignoreMatch());let G;const N=ie.input.substring(w);if(G=N.match(/^\s*=/)){B.ignoreMatch();return}if((G=N.match(/^\s+extends\s+/))&&G.index===0){B.ignoreMatch();return}}},d={$pattern:Gv,keyword:oR,literal:cR,built_in:dR,"variable.language":uR},h="[0-9](_?[0-9])*",p=`\\.(${h})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",y={className:"number",variants:[{begin:`(\\b(${b})((${p})|\\.)?|(${p}))[eE][+-]?(${h})\\b`},{begin:`\\b(${b})\\b((${p})\\b|\\.)?|(${p})\\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},v={className:"subst",begin:"\\$\\{",end:"\\}",keywords:d,contains:[]},x={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"xml"}},_={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"css"}},T={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"graphql"}},C={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,v]},R={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:a+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},M=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,_,T,C,{match:/\$\d+/},y];v.contains=M.concat({begin:/\{/,end:/\}/,keywords:d,contains:["self"].concat(M)});const A=[].concat(R,v.contains),P=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:d,contains:["self"].concat(A)}]),I={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:P},W={variants:[{match:[/class/,/\s+/,a,/\s+/,/extends/,/\s+/,t.concat(a,"(",t.concat(/\./,a),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,a],scope:{1:"keyword",3:"title.class"}}]},te={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:{_:[...x0,...E0]}},ee={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},U={variants:[{match:[/function/,/\s+/,a,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[I],illegal:/%/},F={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function X(ie){return t.concat("(?!",ie.join("|"),")")}const me={match:t.concat(/\b/,X([..._0,"super","import"].map(ie=>`${ie}\\s*\\(`)),a,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},le={begin:t.concat(/\./,t.lookahead(t.concat(a,/(?![0-9A-Za-z$_(])/))),end:a,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},K={match:[/get|set/,/\s+/,a,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},I]},z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",Q={match:[/const|var|let/,/\s+/,a,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[I]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:d,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:te},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),ee,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,_,T,C,R,{match:/\$\d+/},y,te,{scope:"attr",match:a+t.lookahead(":"),relevance:0},Q,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[R,e.REGEXP_MODE,{className:"function",begin:z,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:d,contains:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:c},{begin:u.begin,"on:begin":u.isTrulyOpeningTag,end:u.end}],subLanguage:"xml",contains:[{begin:u.begin,end:u.end,skip:!0,contains:["self"]}]}]},U,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[I,e.inherit(e.TITLE_MODE,{begin:a,className:"title.function"})]},{match:/\.\.\./,relevance:0},le,{match:"\\$"+a,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[I]},me,F,W,K,{match:/\$[(.]/}]}}function hR(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},a=["true","false","null"],l={scope:"literal",beginKeywords:a.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:a},contains:[t,r,e.QUOTE_STRING_MODE,l,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var bs="[0-9](_*[0-9])*",Yc=`\\.(${bs})`,Wc="[0-9a-fA-F](_*[0-9a-fA-F])*",pR={className:"number",variants:[{begin:`(\\b(${bs})((${Yc})|\\.)?|(${Yc}))[eE][+-]?(${bs})[fFdD]?\\b`},{begin:`\\b(${bs})((${Yc})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Yc})[fFdD]?\\b`},{begin:`\\b(${bs})[fFdD]\\b`},{begin:`\\b0[xX]((${Wc})\\.?|(${Wc})?\\.(${Wc}))[pP][+-]?(${bs})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Wc})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function mR(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"},r={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},a={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},l={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},c={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},u={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[c,l]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,c,l]}]};l.contains.push(u);const d={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},h={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(u,{className:"string"}),"self"]}]},p=pR,b=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),y={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},v=y;return v.variants[1].contains=[y],y.variants[1].contains=[v],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,b,r,a,d,h,{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:[y,e.C_LINE_COMMENT_MODE,b],relevance:0},e.C_LINE_COMMENT_MODE,b,d,h,u,e.C_NUMBER_MODE]},b]},{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},d,h]},u,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
80
- `},p]}}const gR=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_-]*/}}),bR=["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"],yR=["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"],vR=[...bR,...yR],xR=["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(),S0=["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(),w0=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),ER=["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(),_R=S0.concat(w0).sort().reverse();function SR(e){const t=gR(e),r=_R,a="and or not only",l="[\\w-]+",c="("+l+"|@\\{"+l+"\\})",u=[],d=[],h=function(M){return{className:"string",begin:"~?"+M+".*?"+M}},p=function(M,A,P){return{className:M,begin:A,relevance:P}},b={$pattern:/[a-z-]+/,keyword:a,attribute:xR.join(" ")},y={begin:"\\(",end:"\\)",contains:d,keywords:b,relevance:0};d.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,h("'"),h('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,y,p("variable","@@?"+l,10),p("variable","@\\{"+l+"\\}"),p("built_in","~?`[^`]*?`"),{className:"attribute",begin:l+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const v=d.concat({begin:/\{/,end:/\}/,contains:u}),x={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(d)},_={begin:c+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+ER.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:d}}]},T={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:b,returnEnd:!0,contains:d,relevance:0}},C={className:"variable",variants:[{begin:"@"+l+"\\s*:",relevance:15},{begin:"@"+l}],starts:{end:"[;}]",returnEnd:!0,contains:v}},S={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:c,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,x,p("keyword","all\\b"),p("variable","@\\{"+l+"\\}"),{begin:"\\b("+vR.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,p("selector-tag",c,0),p("selector-id","#"+c),p("selector-class","\\."+c,0),p("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+S0.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+w0.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:v},{begin:"!important"},t.FUNCTION_DISPATCH]},R={begin:l+`:(:)?(${r.join("|")})`,returnBegin:!0,contains:[S]};return u.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,T,C,R,_,S,x,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:u}}function wR(e){const t="\\[=*\\[",r="\\]=*\\]",a={begin:t,end:r,contains:["self"]},l=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,r,{contains:[a],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:l.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:l}].concat(l)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:r,contains:[a],relevance:5}])}}function kR(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},r={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},a={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,r]},l={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},c={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},u={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,r,a,l,c,u]}}function TR(e){const t=e.regex,r={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},a={begin:"^[-\\*]{3,}",end:"$"},l={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}]},c={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},u={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},d=/[A-Za-z][A-Za-z0-9+.-]*/,h={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,d,/:\/\/.*?\)/),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}]},p={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},b={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},y=e.inherit(p,{contains:[]}),v=e.inherit(b,{contains:[]});p.contains.push(v),b.contains.push(y);let x=[r,h];return[p,b,y,v].forEach(S=>{S.contains=S.contains.concat(x)}),x=x.concat(p,b),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:x},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:x}]}]},r,c,p,b,{className:"quote",begin:"^>\\s+",contains:x,end:"$"},l,a,h,u,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function NR(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+"},r=/[a-zA-Z@][a-zA-Z0-9_]*/,d={"variable.language":["this","super"],$pattern:r,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"]},h={$pattern:r,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:d,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:"("+h.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:h,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function CR(e){const t=e.regex,r=["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"],a=/[dualxmsipngr]{0,12}/,l={$pattern:/[\w.]+/,keyword:r.join(" ")},c={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:l},u={begin:/->\{/,end:/\}/},d={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},h={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[d]},p={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},b=[e.BACKSLASH_ESCAPE,c,h],y=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],v=(T,C,S="\\1")=>{const R=S==="\\1"?S:t.concat(S,C);return t.concat(t.concat("(?:",T,")"),C,/(?:\\.|[^\\\/])*?/,R,/(?:\\.|[^\\\/])*?/,S,a)},x=(T,C,S)=>t.concat(t.concat("(?:",T,")"),C,/(?:\\.|[^\\\/])*?/,S,a),_=[h,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),u,{className:"string",contains:b,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}]},p,{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:v("s|tr|y",t.either(...y,{capture:!0}))},{begin:v("s|tr|y","\\(","\\)")},{begin:v("s|tr|y","\\[","\\]")},{begin:v("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:x("(?:m|qr)?",/\//,/\//)},{begin:x("m|qr",t.either(...y,{capture:!0}),/\1/)},{begin:x("m|qr",/\(/,/\)/)},{begin:x("m|qr",/\[/,/\]/)},{begin:x("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,d]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,d,p]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return c.contains=_,u.contains=_,{name:"Perl",aliases:["pl","pm"],keywords:l,contains:_}}function AR(e){const t=e.regex,r=/(?![A-Za-z0-9])(?![$])/,a=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,r),l=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,r),c=t.concat(/[A-Z]+/,r),u={scope:"variable",match:"\\$+"+a},d={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},h={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},p=e.inherit(e.APOS_STRING_MODE,{illegal:null}),b=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(h)}),y={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(h),"on:begin":(le,K)=>{K.data._beginMatch=le[1]||le[2]},"on:end":(le,K)=>{K.data._beginMatch!==le[1]&&K.ignoreMatch()}},v=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),x=`[
81
- ]`,_={scope:"string",variants:[b,p,y,v]},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},C=["false","null","true"],S=["__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"],R=["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"],A={keyword:S,literal:(le=>{const K=[];return le.forEach(z=>{K.push(z),z.toLowerCase()===z?K.push(z.toUpperCase()):K.push(z.toLowerCase())}),K})(C),built_in:R},P=le=>le.map(K=>K.replace(/\|\d+$/,"")),I={variants:[{match:[/new/,t.concat(x,"+"),t.concat("(?!",P(R).join("\\b|"),"\\b)"),l],scope:{1:"keyword",4:"title.class"}}]},W=t.concat(a,"\\b(?!\\()"),te={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),W],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[l,t.concat(/::/,t.lookahead(/(?!class\b)/)),W],scope:{1:"title.class",3:"variable.constant"}},{match:[l,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[l,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},ee={scope:"attr",match:t.concat(a,t.lookahead(":"),t.lookahead(/(?!::)/))},U={relevance:0,begin:/\(/,end:/\)/,keywords:A,contains:[ee,u,te,e.C_BLOCK_COMMENT_MODE,_,T,I]},F={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",P(S).join("\\b|"),"|",P(R).join("\\b|"),"\\b)"),a,t.concat(x,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[U]};U.contains.push(F);const X=[ee,te,e.C_BLOCK_COMMENT_MODE,_,T,I],me={begin:t.concat(/#\[\s*\\?/,t.either(l,c)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:C,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:C,keyword:["new","array"]},contains:["self",...X]},...X,{scope:"meta",variants:[{match:l},{match:c}]}]};return{case_insensitive:!1,keywords:A,contains:[me,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}]}},d,{scope:"variable.language",match:/\$this\b/},u,F,te,{match:[/const/,/\s/,a],scope:{1:"keyword",3:"variable.constant"}},I,{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:A,contains:["self",me,u,te,e.C_BLOCK_COMMENT_MODE,_,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]},_,T]}}function OR(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 RR(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function MR(e){const t=e.regex,r=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),a=["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"],d={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:a,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"]},h={className:"meta",begin:/^(>>>|\.\.\.) /},p={className:"subst",begin:/\{/,end:/\}/,keywords:d,illegal:/#/},b={begin:/\{\{/,relevance:0},y={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,h],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,h],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,h,b,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,h,b,p]},{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,b,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,b,p]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},v="[0-9](_?[0-9])*",x=`(\\b(${v}))?\\.(${v})|\\b(${v})\\.`,_=`\\b|${a.join("|")}`,T={className:"number",relevance:0,variants:[{begin:`(\\b(${v})|(${x}))[eE][+-]?(${v})[jJ]?(?=${_})`},{begin:`(${x})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${_})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${_})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${_})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${_})`},{begin:`\\b(${v})[jJ](?=${_})`}]},C={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:d,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},S={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:["self",h,T,y,e.HASH_COMMENT_MODE]}]};return p.contains=[y,T,h],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:d,illegal:/(<\/|\?)|=>/,contains:[h,T,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},y,C,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[S]},{variants:[{match:[/\bclass/,/\s+/,r,/\s*/,/\(\s*/,r,/\s*\)/]},{match:[/\bclass/,/\s+/,r]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[T,S,y]}]}}function IR(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function DR(e){const t=e.regex,r=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,a=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]?/),l=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,c=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:r,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:r},{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:[l,a]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,a]},{scope:{1:"punctuation",2:"number"},match:[c,a]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,a]}]},{scope:{3:"operator"},match:[r,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:l},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:c},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function LR(e){const t=e.regex,r="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",a=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),l=t.concat(a,/(::\w+)*/),u={"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"]},d={className:"doctag",begin:"@[A-Za-z]+"},h={begin:"#<",end:">"},p=[e.COMMENT("#","$",{contains:[d]}),e.COMMENT("^=begin","^=end",{contains:[d],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],b={className:"subst",begin:/#\{/,end:/\}/,keywords:u},y={className:"string",contains:[e.BACKSLASH_ESCAPE,b],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,b]})]}]},v="[1-9](_?[0-9])*|0",x="[0-9](_?[0-9])*",_={className:"number",relevance:0,variants:[{begin:`\\b(${v})(\\.(${x}))?([eE][+-]?(${x})|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:u}]},I=[y,{variants:[{match:[/class\s+/,l,/\s+<\s+/,l]},{match:[/\b(class|module)\s+/,l]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:u},{match:[/(include|extend)\s+/,l],scope:{2:"title.class"},keywords:u},{relevance:0,match:[l,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:a,scope:"title.class"},{match:[/def/,/\s+/,r],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:[y,{begin:r}],relevance:0},_,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:u},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,b],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(h,p),relevance:0}].concat(h,p);b.contains=I,T.contains=I;const U=[{begin:/^\s*=>/,starts:{end:"$",contains:I}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:u,contains:I}}];return p.unshift(h),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:u,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(U).concat(p).concat(I)}}function zR(e){const t=e.regex,r=/(r#)?/,a=t.concat(r,e.UNDERSCORE_IDENT_RE),l=t.concat(r,e.IDENT_RE),c={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,l,t.lookahead(/\s*\(/))},u="([ui](8|16|32|64|128|size)|f(32|64))?",d=["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"],h=["true","false","Some","None","Ok","Err"],p=["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!"],b=["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:b,keyword:d,literal:h,built_in:p},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_]+)"+u},{begin:"\\b0o([0-7_]+)"+u},{begin:"\\b0x([A-Fa-f0-9_]+)"+u},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+u}],relevance:0},{begin:[/fn/,/\s+/,a],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,a],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,a,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,a],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,a],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:p,type:b}},{className:"punctuation",begin:"->"},c]}}const jR=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_-]*/}}),BR=["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"],UR=["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"],PR=[...BR,...UR],HR=["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(),FR=["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(),$R=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),GR=["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 KR(e){const t=jR(e),r=$R,a=FR,l="@[a-z-]+",c="and or not only",d={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("+PR.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+a.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+r.join("|")+")"},d,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+GR.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,d,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:l,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:c,attribute:HR.join(" ")},contains:[{begin:l,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},d,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function qR(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function VR(e){const t=e.regex,r=e.COMMENT("--","$"),a={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},l={begin:/"/,end:/"/,contains:[{match:/""/}]},c=["true","false","unknown"],u=["double precision","large object","with timezone","without timezone"],d=["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"],h=["add","asc","collation","desc","final","first","last","view"],p=["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"],b=["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"],y=["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"],v=["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"],x=b,_=[...p,...h].filter(P=>!b.includes(P)),T={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},C={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},S={match:t.concat(/\b/,t.either(...x),/\s*\(/),relevance:0,keywords:{built_in:x}};function R(P){return t.concat(/\b/,t.either(...P.map(I=>I.replace(/\s+/,"\\s+"))),/\b/)}const M={scope:"keyword",match:R(v),relevance:0};function A(P,{exceptions:I,when:W}={}){const te=W;return I=I||[],P.map(ee=>ee.match(/\|\d+$/)||I.includes(ee)?ee:te(ee)?`${ee}|0`:ee)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:A(_,{when:P=>P.length<3}),literal:c,type:d,built_in:y},contains:[{scope:"type",match:R(u)},M,S,T,a,l,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,r,C]}}function k0(e){return e?typeof e=="string"?e:e.source:null}function Bl(e){return ft("(?=",e,")")}function ft(...e){return e.map(r=>k0(r)).join("")}function YR(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function cn(...e){return"("+(YR(e).capture?"":"?:")+e.map(a=>k0(a)).join("|")+")"}const wp=e=>ft(/\b/,e,/\w$/.test(e)?/\b/:/\B/),WR=["Protocol","Type"].map(wp),Kv=["init","self"].map(wp),XR=["Any","Self"],uh=["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"],qv=["false","nil","true"],ZR=["assignment","associativity","higherThan","left","lowerThan","none","right"],QR=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Vv=["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"],T0=cn(/[/=\-+!*%<>&|^~?]/,/[\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]/),N0=cn(T0,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),dh=ft(T0,N0,"*"),C0=cn(/[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]/),pu=cn(C0,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),gr=ft(C0,pu,"*"),Xc=ft(/[A-Z]/,pu,"*"),JR=["attached","autoclosure",ft(/convention\(/,cn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",ft(/objc\(/,gr,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],eM=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function tM(e){const t={match:/\s+/,relevance:0},r=e.COMMENT("/\\*","\\*/",{contains:["self"]}),a=[e.C_LINE_COMMENT_MODE,r],l={match:[/\./,cn(...WR,...Kv)],className:{2:"keyword"}},c={match:ft(/\./,cn(...uh)),relevance:0},u=uh.filter(We=>typeof We=="string").concat(["_|0"]),d=uh.filter(We=>typeof We!="string").concat(XR).map(wp),h={variants:[{className:"keyword",match:cn(...d,...Kv)}]},p={$pattern:cn(/\b\w+/,/#\w+/),keyword:u.concat(QR),literal:qv},b=[l,c,h],y={match:ft(/\./,cn(...Vv)),relevance:0},v={className:"built_in",match:ft(/\b/,cn(...Vv),/(?=\()/)},x=[y,v],_={match:/->/,relevance:0},T={className:"operator",relevance:0,variants:[{match:dh},{match:`\\.(\\.|${N0})+`}]},C=[_,T],S="([0-9]_*)+",R="([0-9a-fA-F]_*)+",M={className:"number",relevance:0,variants:[{match:`\\b(${S})(\\.(${S}))?([eE][+-]?(${S}))?\\b`},{match:`\\b0x(${R})(\\.(${R}))?([pP][+-]?(${S}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},A=(We="")=>({className:"subst",variants:[{match:ft(/\\/,We,/[0\\tnr"']/)},{match:ft(/\\/,We,/u\{[0-9a-fA-F]{1,8}\}/)}]}),P=(We="")=>({className:"subst",match:ft(/\\/,We,/[\t ]*(?:[\r\n]|\r\n)/)}),I=(We="")=>({className:"subst",label:"interpol",begin:ft(/\\/,We,/\(/),end:/\)/}),W=(We="")=>({begin:ft(We,/"""/),end:ft(/"""/,We),contains:[A(We),P(We),I(We)]}),te=(We="")=>({begin:ft(We,/"/),end:ft(/"/,We),contains:[A(We),I(We)]}),ee={className:"string",variants:[W(),W("#"),W("##"),W("###"),te(),te("#"),te("##"),te("###")]},U=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],F={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:U},X=We=>{const Qn=ft(We,/\//),Un=ft(/\//,We);return{begin:Qn,end:Un,contains:[...U,{scope:"comment",begin:`#(?!.*${Un})`,end:/$/}]}},me={scope:"regexp",variants:[X("###"),X("##"),X("#"),F]},le={match:ft(/`/,gr,/`/)},K={className:"variable",match:/\$\d+/},z={className:"variable",match:`\\$${pu}+`},Q=[le,K,z],ie={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:eM,contains:[...C,M,ee]}]}},B={scope:"keyword",match:ft(/@/,cn(...JR),Bl(cn(/\(/,/\s+/)))},w={scope:"meta",match:ft(/@/,gr)},O=[ie,B,w],G={match:Bl(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:ft(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,pu,"+")},{className:"type",match:Xc,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:ft(/\s+&\s+/,Bl(Xc)),relevance:0}]},N={begin:/</,end:/>/,keywords:p,contains:[...a,...b,...O,_,G]};G.contains.push(N);const de={match:ft(gr,/\s*:/),keywords:"_|0",relevance:0},fe={begin:/\(/,end:/\)/,relevance:0,keywords:p,contains:["self",de,...a,me,...b,...x,...C,M,ee,...Q,...O,G]},q={begin:/</,end:/>/,keywords:"repeat each",contains:[...a,G]},ce={begin:cn(Bl(ft(gr,/\s*:/)),Bl(ft(gr,/\s+/,gr,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:gr}]},ge={begin:/\(/,end:/\)/,keywords:p,contains:[ce,...a,...b,...C,M,ee,...O,G,fe],endsParent:!0,illegal:/["']/},xe={match:[/(func|macro)/,/\s+/,cn(le.match,gr,dh)],className:{1:"keyword",3:"title.function"},contains:[q,ge,t],illegal:[/\[/,/%/]},Ie={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[q,ge,t],illegal:/\[|%/},St={match:[/operator/,/\s+/,dh],className:{1:"keyword",3:"title"}},Ct={begin:[/precedencegroup/,/\s+/,Xc],className:{1:"keyword",3:"title"},contains:[G],keywords:[...ZR,...qv],end:/}/},ri={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Tn={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},or={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,gr,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:p,contains:[q,...b,{begin:/:/,end:/\{/,keywords:p,contains:[{scope:"title.class.inherited",match:Xc},...b],relevance:0}]};for(const We of ee.variants){const Qn=We.contains.find(cr=>cr.label==="interpol");Qn.keywords=p;const Un=[...b,...x,...C,M,ee,...Q];Qn.contains=[...Un,{begin:/\(/,end:/\)/,contains:["self",...Un]}]}return{name:"Swift",keywords:p,contains:[...a,xe,Ie,ri,Tn,or,St,Ct,{beginKeywords:"import",end:/$/,contains:[...a],relevance:0},me,...b,...x,...C,M,ee,...Q,...O,G,fe]}}const mu="[A-Za-z$_][0-9A-Za-z$_]*",A0=["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"],O0=["true","false","null","undefined","NaN","Infinity"],R0=["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"],M0=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],I0=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],D0=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],L0=[].concat(I0,R0,M0);function nM(e){const t=e.regex,r=(ie,{after:B})=>{const w="</"+ie[0].slice(1);return ie.input.indexOf(w,B)!==-1},a=mu,l={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,u={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ie,B)=>{const w=ie[0].length+ie.index,O=ie.input[w];if(O==="<"||O===","){B.ignoreMatch();return}O===">"&&(r(ie,{after:w})||B.ignoreMatch());let G;const N=ie.input.substring(w);if(G=N.match(/^\s*=/)){B.ignoreMatch();return}if((G=N.match(/^\s+extends\s+/))&&G.index===0){B.ignoreMatch();return}}},d={$pattern:mu,keyword:A0,literal:O0,built_in:L0,"variable.language":D0},h="[0-9](_?[0-9])*",p=`\\.(${h})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",y={className:"number",variants:[{begin:`(\\b(${b})((${p})|\\.)?|(${p}))[eE][+-]?(${h})\\b`},{begin:`\\b(${b})\\b((${p})\\b|\\.)?|(${p})\\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},v={className:"subst",begin:"\\$\\{",end:"\\}",keywords:d,contains:[]},x={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"xml"}},_={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"css"}},T={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"graphql"}},C={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,v]},R={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:a+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},M=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,_,T,C,{match:/\$\d+/},y];v.contains=M.concat({begin:/\{/,end:/\}/,keywords:d,contains:["self"].concat(M)});const A=[].concat(R,v.contains),P=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:d,contains:["self"].concat(A)}]),I={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:P},W={variants:[{match:[/class/,/\s+/,a,/\s+/,/extends/,/\s+/,t.concat(a,"(",t.concat(/\./,a),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,a],scope:{1:"keyword",3:"title.class"}}]},te={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:{_:[...R0,...M0]}},ee={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},U={variants:[{match:[/function/,/\s+/,a,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[I],illegal:/%/},F={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function X(ie){return t.concat("(?!",ie.join("|"),")")}const me={match:t.concat(/\b/,X([...I0,"super","import"].map(ie=>`${ie}\\s*\\(`)),a,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},le={begin:t.concat(/\./,t.lookahead(t.concat(a,/(?![0-9A-Za-z$_(])/))),end:a,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},K={match:[/get|set/,/\s+/,a,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},I]},z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",Q={match:[/const|var|let/,/\s+/,a,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[I]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:d,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:te},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),ee,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,_,T,C,R,{match:/\$\d+/},y,te,{scope:"attr",match:a+t.lookahead(":"),relevance:0},Q,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[R,e.REGEXP_MODE,{className:"function",begin:z,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:d,contains:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:c},{begin:u.begin,"on:begin":u.isTrulyOpeningTag,end:u.end}],subLanguage:"xml",contains:[{begin:u.begin,end:u.end,skip:!0,contains:["self"]}]}]},U,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[I,e.inherit(e.TITLE_MODE,{begin:a,className:"title.function"})]},{match:/\.\.\./,relevance:0},le,{match:"\\$"+a,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[I]},me,F,W,K,{match:/\$[(.]/}]}}function rM(e){const t=e.regex,r=nM(e),a=mu,l=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],c={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},u={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:l},contains:[r.exports.CLASS_REFERENCE]},d={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},h=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],p={$pattern:mu,keyword:A0.concat(h),literal:O0,built_in:L0.concat(l),"variable.language":D0},b={className:"meta",begin:"@"+a},y=(T,C,S)=>{const R=T.contains.findIndex(M=>M.label===C);if(R===-1)throw new Error("can not find mode to replace");T.contains.splice(R,1,S)};Object.assign(r.keywords,p),r.exports.PARAMS_CONTAINS.push(b);const v=r.contains.find(T=>T.scope==="attr"),x=Object.assign({},v,{match:t.concat(a,t.lookahead(/\s*\?:/))});r.exports.PARAMS_CONTAINS.push([r.exports.CLASS_REFERENCE,v,x]),r.contains=r.contains.concat([b,c,u,x]),y(r,"shebang",e.SHEBANG()),y(r,"use_strict",d);const _=r.contains.find(T=>T.label==="func.def");return _.relevance=0,Object.assign(r,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),r}function iM(e){const t=e.regex,r={className:"string",begin:/"(""|[^/n])"C\b/},a={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},l=/\d{1,2}\/\d{1,2}\/\d{4}/,c=/\d{4}-\d{1,2}-\d{1,2}/,u=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,d=/\d{1,2}(:\d{1,2}){1,2}/,h={className:"literal",variants:[{begin:t.concat(/# */,t.either(c,l),/ *#/)},{begin:t.concat(/# */,d,/ *#/)},{begin:t.concat(/# */,u,/ *#/)},{begin:t.concat(/# */,t.either(c,l),/ +/,t.either(u,d),/ *#/)}]},p={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])|[%&])?/}]},b={className:"label",begin:/^\w+:/},y=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),v=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:[r,a,h,p,b,y,v,{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:[v]}]}}function aM(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const r=e.COMMENT(/;;/,/$/),a=["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"],l={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},c={className:"variable",begin:/\$[\w_]+/},u={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},d={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/},h={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},p={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:a},contains:[r,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},c,u,l,e.QUOTE_STRING_MODE,h,p,d]}}function sM(e){const t=e.regex,r=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),a=/[\p{L}0-9._:-]+/u,l={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},c={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},u=e.inherit(c,{begin:/\(/,end:/\)/}),d=e.inherit(e.APOS_STRING_MODE,{className:"string"}),h=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),p={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:a,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[l]},{begin:/'/,end:/'/,contains:[l]},{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:[c,h,d,u,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[c,u,h,d]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},l,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[h]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[p],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[p],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(r,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:r,relevance:0,starts:p}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(r,/>/))),contains:[{className:"name",begin:r,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function lM(e){const t="true false yes no null",r="[\\w#;/?:@&=+$,.~*'()[\\]]+",a={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},l={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},c={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},u={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,l]},d=e.inherit(u,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),v={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"},x={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},_={begin:/\{/,end:/\}/,contains:[x],illegal:"\\n",relevance:0},T={begin:"\\[",end:"\\]",contains:[x],illegal:"\\n",relevance:0},C=[a,{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+!"+r},{className:"type",begin:"!<"+r+">"},{className:"type",begin:"!"+r},{className:"type",begin:"!!"+r},{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}},v,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},_,T,c,u],S=[...C];return S.pop(),S.push(d),x.contains=S,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:C}}const oM={arduino:$O,bash:GO,c:KO,cpp:qO,csharp:VO,css:nR,diff:rR,go:iR,graphql:aR,ini:sR,java:lR,javascript:fR,json:hR,kotlin:mR,less:SR,lua:wR,makefile:kR,markdown:TR,objectivec:NR,perl:CR,php:AR,"php-template":OR,plaintext:RR,python:MR,"python-repl":IR,r:DR,ruby:LR,rust:zR,scss:KR,shell:qR,sql:VR,swift:tM,typescript:rM,vbnet:iM,wasm:aM,xml:sM,yaml:lM};var fh,Yv;function cM(){if(Yv)return fh;Yv=1;function e(j){return j instanceof Map?j.clear=j.delete=j.set=function(){throw new Error("map is read-only")}:j instanceof Set&&(j.add=j.clear=j.delete=function(){throw new Error("set is read-only")}),Object.freeze(j),Object.getOwnPropertyNames(j).forEach(ae=>{const ve=j[ae],De=typeof ve;(De==="object"||De==="function")&&!Object.isFrozen(ve)&&e(ve)}),j}class t{constructor(ae){ae.data===void 0&&(ae.data={}),this.data=ae.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r(j){return j.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function a(j,...ae){const ve=Object.create(null);for(const De in j)ve[De]=j[De];return ae.forEach(function(De){for(const xt in De)ve[xt]=De[xt]}),ve}const l="</span>",c=j=>!!j.scope,u=(j,{prefix:ae})=>{if(j.startsWith("language:"))return j.replace("language:","language-");if(j.includes(".")){const ve=j.split(".");return[`${ae}${ve.shift()}`,...ve.map((De,xt)=>`${De}${"_".repeat(xt+1)}`)].join(" ")}return`${ae}${j}`};class d{constructor(ae,ve){this.buffer="",this.classPrefix=ve.classPrefix,ae.walk(this)}addText(ae){this.buffer+=r(ae)}openNode(ae){if(!c(ae))return;const ve=u(ae.scope,{prefix:this.classPrefix});this.span(ve)}closeNode(ae){c(ae)&&(this.buffer+=l)}value(){return this.buffer}span(ae){this.buffer+=`<span class="${ae}">`}}const h=(j={})=>{const ae={children:[]};return Object.assign(ae,j),ae};class p{constructor(){this.rootNode=h(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(ae){this.top.children.push(ae)}openNode(ae){const ve=h({scope:ae});this.add(ve),this.stack.push(ve)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(ae){return this.constructor._walk(ae,this.rootNode)}static _walk(ae,ve){return typeof ve=="string"?ae.addText(ve):ve.children&&(ae.openNode(ve),ve.children.forEach(De=>this._walk(ae,De)),ae.closeNode(ve)),ae}static _collapse(ae){typeof ae!="string"&&ae.children&&(ae.children.every(ve=>typeof ve=="string")?ae.children=[ae.children.join("")]:ae.children.forEach(ve=>{p._collapse(ve)}))}}class b extends p{constructor(ae){super(),this.options=ae}addText(ae){ae!==""&&this.add(ae)}startScope(ae){this.openNode(ae)}endScope(){this.closeNode()}__addSublanguage(ae,ve){const De=ae.root;ve&&(De.scope=`language:${ve}`),this.add(De)}toHTML(){return new d(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function y(j){return j?typeof j=="string"?j:j.source:null}function v(j){return T("(?=",j,")")}function x(j){return T("(?:",j,")*")}function _(j){return T("(?:",j,")?")}function T(...j){return j.map(ve=>y(ve)).join("")}function C(j){const ae=j[j.length-1];return typeof ae=="object"&&ae.constructor===Object?(j.splice(j.length-1,1),ae):{}}function S(...j){return"("+(C(j).capture?"":"?:")+j.map(De=>y(De)).join("|")+")"}function R(j){return new RegExp(j.toString()+"|").exec("").length-1}function M(j,ae){const ve=j&&j.exec(ae);return ve&&ve.index===0}const A=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function P(j,{joinWith:ae}){let ve=0;return j.map(De=>{ve+=1;const xt=ve;let ht=y(De),Se="";for(;ht.length>0;){const Ee=A.exec(ht);if(!Ee){Se+=ht;break}Se+=ht.substring(0,Ee.index),ht=ht.substring(Ee.index+Ee[0].length),Ee[0][0]==="\\"&&Ee[1]?Se+="\\"+String(Number(Ee[1])+xt):(Se+=Ee[0],Ee[0]==="("&&ve++)}return Se}).map(De=>`(${De})`).join(ae)}const I=/\b\B/,W="[a-zA-Z]\\w*",te="[a-zA-Z_]\\w*",ee="\\b\\d+(\\.\\d+)?",U="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",F="\\b(0b[01]+)",X="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",me=(j={})=>{const ae=/^#![ ]*\//;return j.binary&&(j.begin=T(ae,/.*\b/,j.binary,/\b.*/)),a({scope:"meta",begin:ae,end:/$/,relevance:0,"on:begin":(ve,De)=>{ve.index!==0&&De.ignoreMatch()}},j)},le={begin:"\\\\[\\s\\S]",relevance:0},K={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[le]},z={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[le]},Q={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/},ie=function(j,ae,ve={}){const De=a({scope:"comment",begin:j,end:ae,contains:[]},ve);De.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 xt=S("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 De.contains.push({begin:T(/[ ]+/,"(",xt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),De},B=ie("//","$"),w=ie("/\\*","\\*/"),O=ie("#","$"),G={scope:"number",begin:ee,relevance:0},N={scope:"number",begin:U,relevance:0},de={scope:"number",begin:F,relevance:0},fe={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[le,{begin:/\[/,end:/\]/,relevance:0,contains:[le]}]},q={scope:"title",begin:W,relevance:0},ce={scope:"title",begin:te,relevance:0},ge={begin:"\\.\\s*"+te,relevance:0};var Ie=Object.freeze({__proto__:null,APOS_STRING_MODE:K,BACKSLASH_ESCAPE:le,BINARY_NUMBER_MODE:de,BINARY_NUMBER_RE:F,COMMENT:ie,C_BLOCK_COMMENT_MODE:w,C_LINE_COMMENT_MODE:B,C_NUMBER_MODE:N,C_NUMBER_RE:U,END_SAME_AS_BEGIN:function(j){return Object.assign(j,{"on:begin":(ae,ve)=>{ve.data._beginMatch=ae[1]},"on:end":(ae,ve)=>{ve.data._beginMatch!==ae[1]&&ve.ignoreMatch()}})},HASH_COMMENT_MODE:O,IDENT_RE:W,MATCH_NOTHING_RE:I,METHOD_GUARD:ge,NUMBER_MODE:G,NUMBER_RE:ee,PHRASAL_WORDS_MODE:Q,QUOTE_STRING_MODE:z,REGEXP_MODE:fe,RE_STARTERS_RE:X,SHEBANG:me,TITLE_MODE:q,UNDERSCORE_IDENT_RE:te,UNDERSCORE_TITLE_MODE:ce});function St(j,ae){j.input[j.index-1]==="."&&ae.ignoreMatch()}function Ct(j,ae){j.className!==void 0&&(j.scope=j.className,delete j.className)}function ri(j,ae){ae&&j.beginKeywords&&(j.begin="\\b("+j.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",j.__beforeBegin=St,j.keywords=j.keywords||j.beginKeywords,delete j.beginKeywords,j.relevance===void 0&&(j.relevance=0))}function Tn(j,ae){Array.isArray(j.illegal)&&(j.illegal=S(...j.illegal))}function or(j,ae){if(j.match){if(j.begin||j.end)throw new Error("begin & end are not supported with match");j.begin=j.match,delete j.match}}function We(j,ae){j.relevance===void 0&&(j.relevance=1)}const Qn=(j,ae)=>{if(!j.beforeMatch)return;if(j.starts)throw new Error("beforeMatch cannot be used with starts");const ve=Object.assign({},j);Object.keys(j).forEach(De=>{delete j[De]}),j.keywords=ve.keywords,j.begin=T(ve.beforeMatch,v(ve.begin)),j.starts={relevance:0,contains:[Object.assign(ve,{endsParent:!0})]},j.relevance=0,delete ve.beforeMatch},Un=["of","and","for","in","not","or","if","then","parent","list","value"],cr="keyword";function kr(j,ae,ve=cr){const De=Object.create(null);return typeof j=="string"?xt(ve,j.split(" ")):Array.isArray(j)?xt(ve,j):Object.keys(j).forEach(function(ht){Object.assign(De,kr(j[ht],ae,ht))}),De;function xt(ht,Se){ae&&(Se=Se.map(Ee=>Ee.toLowerCase())),Se.forEach(function(Ee){const Me=Ee.split("|");De[Me[0]]=[ht,$i(Me[0],Me[1])]})}}function $i(j,ae){return ae?Number(ae):js(j)?0:1}function js(j){return Un.includes(j.toLowerCase())}const wa={},Tt=j=>{console.error(j)},ka=(j,...ae)=>{console.log(`WARN: ${j}`,...ae)},ne=(j,ae)=>{wa[`${j}/${ae}`]||(console.log(`Deprecated as of ${j}. ${ae}`),wa[`${j}/${ae}`]=!0)},be=new Error;function Ae(j,ae,{key:ve}){let De=0;const xt=j[ve],ht={},Se={};for(let Ee=1;Ee<=ae.length;Ee++)Se[Ee+De]=xt[Ee],ht[Ee+De]=!0,De+=R(ae[Ee-1]);j[ve]=Se,j[ve]._emit=ht,j[ve]._multi=!0}function He(j){if(Array.isArray(j.begin)){if(j.skip||j.excludeBegin||j.returnBegin)throw Tt("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),be;if(typeof j.beginScope!="object"||j.beginScope===null)throw Tt("beginScope must be object"),be;Ae(j,j.begin,{key:"beginScope"}),j.begin=P(j.begin,{joinWith:""})}}function Qe(j){if(Array.isArray(j.end)){if(j.skip||j.excludeEnd||j.returnEnd)throw Tt("skip, excludeEnd, returnEnd not compatible with endScope: {}"),be;if(typeof j.endScope!="object"||j.endScope===null)throw Tt("endScope must be object"),be;Ae(j,j.end,{key:"endScope"}),j.end=P(j.end,{joinWith:""})}}function an(j){j.scope&&typeof j.scope=="object"&&j.scope!==null&&(j.beginScope=j.scope,delete j.scope)}function Jn(j){an(j),typeof j.beginScope=="string"&&(j.beginScope={_wrap:j.beginScope}),typeof j.endScope=="string"&&(j.endScope={_wrap:j.endScope}),He(j),Qe(j)}function qt(j){function ae(Se,Ee){return new RegExp(y(Se),"m"+(j.case_insensitive?"i":"")+(j.unicodeRegex?"u":"")+(Ee?"g":""))}class ve{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Ee,Me){Me.position=this.position++,this.matchIndexes[this.matchAt]=Me,this.regexes.push([Me,Ee]),this.matchAt+=R(Ee)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Ee=this.regexes.map(Me=>Me[1]);this.matcherRe=ae(P(Ee,{joinWith:"|"}),!0),this.lastIndex=0}exec(Ee){this.matcherRe.lastIndex=this.lastIndex;const Me=this.matcherRe.exec(Ee);if(!Me)return null;const Mt=Me.findIndex((Tr,Na)=>Na>0&&Tr!==void 0),wt=this.matchIndexes[Mt];return Me.splice(0,Mt),Object.assign(Me,wt)}}class De{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Ee){if(this.multiRegexes[Ee])return this.multiRegexes[Ee];const Me=new ve;return this.rules.slice(Ee).forEach(([Mt,wt])=>Me.addRule(Mt,wt)),Me.compile(),this.multiRegexes[Ee]=Me,Me}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Ee,Me){this.rules.push([Ee,Me]),Me.type==="begin"&&this.count++}exec(Ee){const Me=this.getMatcher(this.regexIndex);Me.lastIndex=this.lastIndex;let Mt=Me.exec(Ee);if(this.resumingScanAtSamePosition()&&!(Mt&&Mt.index===this.lastIndex)){const wt=this.getMatcher(0);wt.lastIndex=this.lastIndex+1,Mt=wt.exec(Ee)}return Mt&&(this.regexIndex+=Mt.position+1,this.regexIndex===this.count&&this.considerAll()),Mt}}function xt(Se){const Ee=new De;return Se.contains.forEach(Me=>Ee.addRule(Me.begin,{rule:Me,type:"begin"})),Se.terminatorEnd&&Ee.addRule(Se.terminatorEnd,{type:"end"}),Se.illegal&&Ee.addRule(Se.illegal,{type:"illegal"}),Ee}function ht(Se,Ee){const Me=Se;if(Se.isCompiled)return Me;[Ct,or,Jn,Qn].forEach(wt=>wt(Se,Ee)),j.compilerExtensions.forEach(wt=>wt(Se,Ee)),Se.__beforeBegin=null,[ri,Tn,We].forEach(wt=>wt(Se,Ee)),Se.isCompiled=!0;let Mt=null;return typeof Se.keywords=="object"&&Se.keywords.$pattern&&(Se.keywords=Object.assign({},Se.keywords),Mt=Se.keywords.$pattern,delete Se.keywords.$pattern),Mt=Mt||/\w+/,Se.keywords&&(Se.keywords=kr(Se.keywords,j.case_insensitive)),Me.keywordPatternRe=ae(Mt,!0),Ee&&(Se.begin||(Se.begin=/\B|\b/),Me.beginRe=ae(Me.begin),!Se.end&&!Se.endsWithParent&&(Se.end=/\B|\b/),Se.end&&(Me.endRe=ae(Me.end)),Me.terminatorEnd=y(Me.end)||"",Se.endsWithParent&&Ee.terminatorEnd&&(Me.terminatorEnd+=(Se.end?"|":"")+Ee.terminatorEnd)),Se.illegal&&(Me.illegalRe=ae(Se.illegal)),Se.contains||(Se.contains=[]),Se.contains=[].concat(...Se.contains.map(function(wt){return Qt(wt==="self"?Se:wt)})),Se.contains.forEach(function(wt){ht(wt,Me)}),Se.starts&&ht(Se.starts,Ee),Me.matcher=xt(Me),Me}if(j.compilerExtensions||(j.compilerExtensions=[]),j.contains&&j.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return j.classNameAliases=a(j.classNameAliases||{}),ht(j)}function At(j){return j?j.endsWithParent||At(j.starts):!1}function Qt(j){return j.variants&&!j.cachedVariants&&(j.cachedVariants=j.variants.map(function(ae){return a(j,{variants:null},ae)})),j.cachedVariants?j.cachedVariants:At(j)?a(j,{starts:j.starts?a(j.starts):null}):Object.isFrozen(j)?a(j):j}var rt="11.11.1";class ur extends Error{constructor(ae,ve){super(ae),this.name="HTMLInjectionError",this.html=ve}}const sn=r,_o=a,Gi=Symbol("nomatch"),Ta=7,Ki=function(j){const ae=Object.create(null),ve=Object.create(null),De=[];let xt=!0;const ht="Could not find the language '{}', did you forget to load/include a language module?",Se={disableAutodetect:!0,name:"Plain text",contains:[]};let Ee={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:b};function Me(he){return Ee.noHighlightRe.test(he)}function Mt(he){let Te=he.className+" ";Te+=he.parentNode?he.parentNode.className:"";const Fe=Ee.languageDetectRe.exec(Te);if(Fe){const it=ln(Fe[1]);return it||(ka(ht.replace("{}",Fe[1])),ka("Falling back to no-highlight mode for this block.",he)),it?Fe[1]:"no-highlight"}return Te.split(/\s+/).find(it=>Me(it)||ln(it))}function wt(he,Te,Fe){let it="",Dt="";typeof Te=="object"?(it=he,Fe=Te.ignoreIllegals,Dt=Te.language):(ne("10.7.0","highlight(lang, code, ...args) has been deprecated."),ne("10.7.0",`Please use highlight(code, options) instead.
82
- https://github.com/highlightjs/highlight.js/issues/2277`),Dt=he,it=Te),Fe===void 0&&(Fe=!0);const en={code:it,language:Dt};Vi("before:highlight",en);const Nn=en.result?en.result:Tr(en.language,en.code,Fe);return Nn.code=en.code,Vi("after:highlight",Nn),Nn}function Tr(he,Te,Fe,it){const Dt=Object.create(null);function en(ye,we){return ye.keywords[we]}function Nn(){if(!Re.keywords){Bt.addText(at);return}let ye=0;Re.keywordPatternRe.lastIndex=0;let we=Re.keywordPatternRe.exec(at),je="";for(;we;){je+=at.substring(ye,we.index);const qe=Vt.case_insensitive?we[0].toLowerCase():we[0],Nt=en(Re,qe);if(Nt){const[Pn,$s]=Nt;if(Bt.addText(je),je="",Dt[qe]=(Dt[qe]||0)+1,Dt[qe]<=Ta&&(li+=$s),Pn.startsWith("_"))je+=we[0];else{const Ao=Vt.classNameAliases[Pn]||Pn;Cn(we[0],Ao)}}else je+=we[0];ye=Re.keywordPatternRe.lastIndex,we=Re.keywordPatternRe.exec(at)}je+=at.substring(ye),Bt.addText(je)}function gn(){if(at==="")return;let ye=null;if(typeof Re.subLanguage=="string"){if(!ae[Re.subLanguage]){Bt.addText(at);return}ye=Tr(Re.subLanguage,at,!0,Co[Re.subLanguage]),Co[Re.subLanguage]=ye._top}else ye=Ca(at,Re.subLanguage.length?Re.subLanguage:null);Re.relevance>0&&(li+=ye.relevance),Bt.__addSublanguage(ye._emitter,ye.language)}function bt(){Re.subLanguage!=null?gn():Nn(),at=""}function Cn(ye,we){ye!==""&&(Bt.startScope(we),Bt.addText(ye),Bt.endScope())}function To(ye,we){let je=1;const qe=we.length-1;for(;je<=qe;){if(!ye._emit[je]){je++;continue}const Nt=Vt.classNameAliases[ye[je]]||ye[je],Pn=we[je];Nt?Cn(Pn,Nt):(at=Pn,Nn(),at=""),je++}}function Oa(ye,we){return ye.scope&&typeof ye.scope=="string"&&Bt.openNode(Vt.classNameAliases[ye.scope]||ye.scope),ye.beginScope&&(ye.beginScope._wrap?(Cn(at,Vt.classNameAliases[ye.beginScope._wrap]||ye.beginScope._wrap),at=""):ye.beginScope._multi&&(To(ye.beginScope,we),at="")),Re=Object.create(ye,{parent:{value:Re}}),Re}function Ps(ye,we,je){let qe=M(ye.endRe,je);if(qe){if(ye["on:end"]){const Nt=new t(ye);ye["on:end"](we,Nt),Nt.isMatchIgnored&&(qe=!1)}if(qe){for(;ye.endsParent&&ye.parent;)ye=ye.parent;return ye}}if(ye.endsWithParent)return Ps(ye.parent,we,je)}function Ra(ye){return Re.matcher.regexIndex===0?(at+=ye[0],1):(oi=!0,0)}function zu(ye){const we=ye[0],je=ye.rule,qe=new t(je),Nt=[je.__beforeBegin,je["on:begin"]];for(const Pn of Nt)if(Pn&&(Pn(ye,qe),qe.isMatchIgnored))return Ra(we);return je.skip?at+=we:(je.excludeBegin&&(at+=we),bt(),!je.returnBegin&&!je.excludeBegin&&(at=we)),Oa(je,ye),je.returnBegin?0:we.length}function bn(ye){const we=ye[0],je=Te.substring(ye.index),qe=Ps(Re,ye,je);if(!qe)return Gi;const Nt=Re;Re.endScope&&Re.endScope._wrap?(bt(),Cn(we,Re.endScope._wrap)):Re.endScope&&Re.endScope._multi?(bt(),To(Re.endScope,ye)):Nt.skip?at+=we:(Nt.returnEnd||Nt.excludeEnd||(at+=we),bt(),Nt.excludeEnd&&(at=we));do Re.scope&&Bt.closeNode(),!Re.skip&&!Re.subLanguage&&(li+=Re.relevance),Re=Re.parent;while(Re!==qe.parent);return qe.starts&&Oa(qe.starts,ye),Nt.returnEnd?0:we.length}function Hs(){const ye=[];for(let we=Re;we!==Vt;we=we.parent)we.scope&&ye.unshift(we.scope);ye.forEach(we=>Bt.openNode(we))}let Yi={};function Ma(ye,we){const je=we&&we[0];if(at+=ye,je==null)return bt(),0;if(Yi.type==="begin"&&we.type==="end"&&Yi.index===we.index&&je===""){if(at+=Te.slice(we.index,we.index+1),!xt){const qe=new Error(`0 width match regex (${he})`);throw qe.languageName=he,qe.badRule=Yi.rule,qe}return 1}if(Yi=we,we.type==="begin")return zu(we);if(we.type==="illegal"&&!Fe){const qe=new Error('Illegal lexeme "'+je+'" for mode "'+(Re.scope||"<unnamed>")+'"');throw qe.mode=Re,qe}else if(we.type==="end"){const qe=bn(we);if(qe!==Gi)return qe}if(we.type==="illegal"&&je==="")return at+=`
83
- `,1;if(Fs>1e5&&Fs>we.index*3)throw new Error("potential infinite loop, way more iterations than matches");return at+=je,je.length}const Vt=ln(he);if(!Vt)throw Tt(ht.replace("{}",he)),new Error('Unknown language: "'+he+'"');const No=qt(Vt);let Ia="",Re=it||No;const Co={},Bt=new Ee.__emitter(Ee);Hs();let at="",li=0,Ar=0,Fs=0,oi=!1;try{if(Vt.__emitTokens)Vt.__emitTokens(Te,Bt);else{for(Re.matcher.considerAll();;){Fs++,oi?oi=!1:Re.matcher.considerAll(),Re.matcher.lastIndex=Ar;const ye=Re.matcher.exec(Te);if(!ye)break;const we=Te.substring(Ar,ye.index),je=Ma(we,ye);Ar=ye.index+je}Ma(Te.substring(Ar))}return Bt.finalize(),Ia=Bt.toHTML(),{language:he,value:Ia,relevance:li,illegal:!1,_emitter:Bt,_top:Re}}catch(ye){if(ye.message&&ye.message.includes("Illegal"))return{language:he,value:sn(Te),illegal:!0,relevance:0,_illegalBy:{message:ye.message,index:Ar,context:Te.slice(Ar-100,Ar+100),mode:ye.mode,resultSoFar:Ia},_emitter:Bt};if(xt)return{language:he,value:sn(Te),illegal:!1,relevance:0,errorRaised:ye,_emitter:Bt,_top:Re};throw ye}}function Na(he){const Te={value:sn(he),illegal:!1,relevance:0,_top:Se,_emitter:new Ee.__emitter(Ee)};return Te._emitter.addText(he),Te}function Ca(he,Te){Te=Te||Ee.languages||Object.keys(ae);const Fe=Na(he),it=Te.filter(ln).filter(ai).map(bt=>Tr(bt,he,!1));it.unshift(Fe);const Dt=it.sort((bt,Cn)=>{if(bt.relevance!==Cn.relevance)return Cn.relevance-bt.relevance;if(bt.language&&Cn.language){if(ln(bt.language).supersetOf===Cn.language)return 1;if(ln(Cn.language).supersetOf===bt.language)return-1}return 0}),[en,Nn]=Dt,gn=en;return gn.secondBest=Nn,gn}function dr(he,Te,Fe){const it=Te&&ve[Te]||Fe;he.classList.add("hljs"),he.classList.add(`language-${it}`)}function It(he){let Te=null;const Fe=Mt(he);if(Me(Fe))return;if(Vi("before:highlightElement",{el:he,language:Fe}),he.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",he);return}if(he.children.length>0&&(Ee.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(he)),Ee.throwUnescapedHTML))throw new ur("One of your code blocks includes unescaped HTML.",he.innerHTML);Te=he;const it=Te.textContent,Dt=Fe?wt(it,{language:Fe,ignoreIllegals:!0}):Ca(it);he.innerHTML=Dt.value,he.dataset.highlighted="yes",dr(he,Fe,Dt.language),he.result={language:Dt.language,re:Dt.relevance,relevance:Dt.relevance},Dt.secondBest&&(he.secondBest={language:Dt.secondBest.language,relevance:Dt.secondBest.relevance}),Vi("after:highlightElement",{el:he,result:Dt,text:it})}function Jt(he){Ee=_o(Ee,he)}const ii=()=>{Aa(),ne("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Bs(){Aa(),ne("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let So=!1;function Aa(){function he(){Aa()}if(document.readyState==="loading"){So||window.addEventListener("DOMContentLoaded",he,!1),So=!0;return}document.querySelectorAll(Ee.cssSelector).forEach(It)}function wo(he,Te){let Fe=null;try{Fe=Te(j)}catch(it){if(Tt("Language definition for '{}' could not be registered.".replace("{}",he)),xt)Tt(it);else throw it;Fe=Se}Fe.name||(Fe.name=he),ae[he]=Fe,Fe.rawDefinition=Te.bind(null,j),Fe.aliases&&Nr(Fe.aliases,{languageName:he})}function qi(he){delete ae[he];for(const Te of Object.keys(ve))ve[Te]===he&&delete ve[Te]}function Us(){return Object.keys(ae)}function ln(he){return he=(he||"").toLowerCase(),ae[he]||ae[ve[he]]}function Nr(he,{languageName:Te}){typeof he=="string"&&(he=[he]),he.forEach(Fe=>{ve[Fe.toLowerCase()]=Te})}function ai(he){const Te=ln(he);return Te&&!Te.disableAutodetect}function si(he){he["before:highlightBlock"]&&!he["before:highlightElement"]&&(he["before:highlightElement"]=Te=>{he["before:highlightBlock"](Object.assign({block:Te.el},Te))}),he["after:highlightBlock"]&&!he["after:highlightElement"]&&(he["after:highlightElement"]=Te=>{he["after:highlightBlock"](Object.assign({block:Te.el},Te))})}function jt(he){si(he),De.push(he)}function ko(he){const Te=De.indexOf(he);Te!==-1&&De.splice(Te,1)}function Vi(he,Te){const Fe=he;De.forEach(function(it){it[Fe]&&it[Fe](Te)})}function Cr(he){return ne("10.7.0","highlightBlock will be removed entirely in v12.0"),ne("10.7.0","Please use highlightElement now."),It(he)}Object.assign(j,{highlight:wt,highlightAuto:Ca,highlightAll:Aa,highlightElement:It,highlightBlock:Cr,configure:Jt,initHighlighting:ii,initHighlightingOnLoad:Bs,registerLanguage:wo,unregisterLanguage:qi,listLanguages:Us,getLanguage:ln,registerAliases:Nr,autoDetection:ai,inherit:_o,addPlugin:jt,removePlugin:ko}),j.debugMode=function(){xt=!1},j.safeMode=function(){xt=!0},j.versionString=rt,j.regex={concat:T,lookahead:v,either:S,optional:_,anyNumberOfTimes:x};for(const he in Ie)typeof Ie[he]=="object"&&e(Ie[he]);return Object.assign(j,Ie),j},mn=Ki({});return mn.newInstance=()=>Ki({}),fh=mn,mn.HighlightJS=mn,mn.default=mn,fh}var uM=cM();const dM=co(uM),Wv={},fM="hljs-";function hM(e){const t=dM.newInstance();return e&&c(e),{highlight:r,highlightAuto:a,listLanguages:l,register:c,registerAlias:u,registered:d};function r(h,p,b){const y=b||Wv,v=typeof y.prefix=="string"?y.prefix:fM;if(!t.getLanguage(h))throw new Error("Unknown language: `"+h+"` is not registered");t.configure({__emitter:pM,classPrefix:v});const x=t.highlight(p,{ignoreIllegals:!0,language:h});if(x.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:x.errorRaised});const _=x._emitter.root,T=_.data;return T.language=x.language,T.relevance=x.relevance,_}function a(h,p){const y=(p||Wv).subset||l();let v=-1,x=0,_;for(;++v<y.length;){const T=y[v];if(!t.getLanguage(T))continue;const C=r(T,h,p);C.data&&C.data.relevance!==void 0&&C.data.relevance>x&&(x=C.data.relevance,_=C)}return _||{type:"root",children:[],data:{language:void 0,relevance:x}}}function l(){return t.listLanguages()}function c(h,p){if(typeof h=="string")t.registerLanguage(h,p);else{let b;for(b in h)Object.hasOwn(h,b)&&t.registerLanguage(b,h[b])}}function u(h,p){if(typeof h=="string")t.registerAliases(typeof p=="string"?p:[...p],{languageName:h});else{let b;for(b in h)if(Object.hasOwn(h,b)){const y=h[b];t.registerAliases(typeof y=="string"?y:[...y],{languageName:b})}}}function d(h){return!!t.getLanguage(h)}}class pM{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 r=this.stack[this.stack.length-1],a=r.children[r.children.length-1];a&&a.type==="text"?a.value+=t:r.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,r){const a=this.stack[this.stack.length-1],l=t.root.children;r?a.children.push({type:"element",tagName:"span",properties:{className:[r]},children:l}):a.children.push(...l)}openNode(t){const r=this,a=t.split(".").map(function(u,d){return d?u+"_".repeat(d):r.options.classPrefix+u}),l=this.stack[this.stack.length-1],c={type:"element",tagName:"span",properties:{className:a},children:[]};l.children.push(c),this.stack.push(c)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const mM={};function gM(e){const t=e||mM,r=t.aliases,a=t.detect||!1,l=t.languages||oM,c=t.plainText,u=t.prefix,d=t.subset;let h="hljs";const p=hM(l);if(r&&p.registerAlias(r),u){const b=u.indexOf("-");h=b===-1?u:u.slice(0,b)}return function(b,y){Ru(b,"element",function(v,x,_){if(v.tagName!=="code"||!_||_.type!=="element"||_.tagName!=="pre")return;const T=bM(v);if(T===!1||!T&&!a||T&&c&&c.includes(T))return;Array.isArray(v.properties.className)||(v.properties.className=[]),v.properties.className.includes(h)||v.properties.className.unshift(h);const C=LO(v,{whitespace:"pre"});let S;try{S=T?p.highlight(T,C,{prefix:u}):p.highlightAuto(C,{prefix:u,subset:d})}catch(R){const M=R;if(T&&/Unknown language/.test(M.message)){y.message("Cannot highlight as `"+T+"`, it’s not registered",{ancestors:[_,v],cause:M,place:v.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw M}!T&&S.data&&S.data.language&&v.properties.className.push("language-"+S.data.language),S.children.length>0&&(v.children=S.children)})}}function bM(e){const t=e.properties.className;let r=-1;if(!Array.isArray(t))return;let a;for(;++r<t.length;){const l=String(t[r]);if(l==="no-highlight"||l==="nohighlight")return!1;!a&&l.slice(0,5)==="lang-"&&(a=l.slice(5)),!a&&l.slice(0,9)==="language-"&&(a=l.slice(9))}return a}function ps(e){return e?typeof e=="string"?e:"literalString"in e?e.literalString:"dataPath"in e?`{{${e.dataPath}}}`:"":""}function Zc(e){return e?Array.isArray(e)?e:"explicitList"in e?e.explicitList:[]:[]}function yM({className:e,children:t}){const[r,a]=D.useState(!1),l=String(t).replace(/\n$/,""),c=(e==null?void 0:e.replace(/^language-/,""))??"",u=D.useCallback(()=>{navigator.clipboard.writeText(l).then(()=>{a(!0),setTimeout(()=>a(!1),2e3)})},[l]);return m.jsxs("div",{className:"group/code relative my-2 rounded-md overflow-hidden",style:{border:"1px solid var(--border)"},children:[m.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5",style:{background:"var(--bg-hover)",borderBottom:"1px solid var(--border)"},children:[m.jsx("span",{className:"text-tiny font-mono uppercase",style:{color:"var(--text-muted)"},children:c||"code"}),m.jsx("button",{onClick:u,className:"flex items-center gap-1 px-2 py-0.5 rounded text-tiny transition-colors",style:{color:r?"var(--accent-green)":"var(--text-muted)",background:"transparent"},title:"Copy code",children:r?m.jsxs(m.Fragment,{children:[m.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),"Copied"]}):m.jsxs(m.Fragment,{children:[m.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.666 3.888A2.25 2.25 0 0013.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 01-.75.75H9.75a.75.75 0 01-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 01-2.25 2.25H6.75A2.25 2.25 0 014.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 011.927-.184"})}),"Copy"]})})]}),m.jsx("pre",{className:"overflow-x-auto p-3 text-[13px] leading-[1.5]",style:{background:"var(--code-bg)",color:"var(--text-primary)",margin:0},children:m.jsx("code",{className:e,style:{fontFamily:"var(--font-mono)"},children:t})})]})}function vM({children:e}){return m.jsx("div",{className:"my-2 overflow-x-auto rounded-md",style:{border:"1px solid var(--border)"},children:m.jsx("table",{className:"min-w-full text-[13px]",style:{borderCollapse:"collapse"},children:e})})}function xM({children:e}){return m.jsx("thead",{style:{background:"var(--bg-hover)"},children:e})}function EM({children:e,...t}){return m.jsx("tr",{...t,style:{borderBottom:"1px solid var(--border)"},className:"hover:bg-[--bg-hover] transition-colors",children:e})}function Xv({children:e,isHeader:t=!1,style:r}){const a=t?"th":"td";return m.jsx(a,{className:`px-3 py-2 text-left ${t?"font-bold":""}`,style:{color:t?"var(--text-primary)":"var(--text-secondary)",whiteSpace:"nowrap",...r},children:e})}function _M({jsonl:e,onAction:t}){const r=D.useMemo(()=>SM(e),[e]);return r?m.jsx("div",{className:"mt-1",children:Gl(r.rootId,r.components,t)}):m.jsxs("div",{className:"mt-2 px-2 py-1.5 rounded-sm text-caption",style:{background:"var(--code-bg)",border:"1px solid var(--border)",color:"var(--text-secondary)"},children:[m.jsx("span",{className:"font-bold text-tiny",style:{color:"var(--text-muted)"},children:"A2UI"}),m.jsx("pre",{className:"mt-1 overflow-x-auto whitespace-pre-wrap break-words max-h-32",style:{fontFamily:"var(--font-mono)",fontSize:12},children:e})]})}function SM(e){try{const t=e.trim().split(`
84
- `).filter(Boolean),r=new Map;let a="";for(const l of t){const c=JSON.parse(l);if("surfaceUpdate"in c)for(const u of c.surfaceUpdate.components)r.set(u.id,u.component);"beginRendering"in c&&(a=c.beginRendering.root)}return!a||r.size===0?null:{rootId:a,components:r}}catch{return null}}function Gl(e,t,r){const a=t.get(e);if(!a)return null;if("Text"in a){const{text:l,usageHint:c}=a.Text,u=ps(l),d=c??"body",h={h1:"text-h1 font-bold",h2:"text-h2 font-bold",h3:"text-[14px] font-bold",h4:"text-caption font-bold",h5:"text-tiny font-bold uppercase tracking-wide",caption:"text-caption",body:"text-body"};return m.jsx("p",{className:`${h[d]??"text-body"} my-0.5`,style:{color:d.startsWith("h")?"var(--text-primary)":"var(--text-secondary)"},children:u},e)}if("Button"in a){const{label:l,action:c,style:u}=a.Button,d=ps(l),h=u==="primary"||u==="filled";return m.jsx("button",{onClick:()=>{c!=null&&c.sendMessage&&r&&r(c.sendMessage,c)},className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-sm text-caption font-bold transition-colors ${h?"text-white":"hover:bg-[--bg-hover]"}`,style:{background:h?"var(--bg-active)":"transparent",color:h?"#fff":"var(--text-link)",border:h?"none":"1px solid var(--border)"},children:d},e)}if("Column"in a){const l=Zc(a.Column.children),c=a.Column.gap??4;return m.jsx("div",{className:"flex flex-col",style:{gap:c},children:l.map(u=>Gl(u,t,r))},e)}if("Row"in a){const l=Zc(a.Row.children),c=a.Row.gap??8;return m.jsx("div",{className:"flex flex-row flex-wrap items-center",style:{gap:c},children:l.map(u=>Gl(u,t,r))},e)}if("Card"in a){const l=Zc(a.Card.children),c=a.Card.title?ps(a.Card.title):null;return m.jsxs("div",{className:"rounded-md p-3 my-1",style:{background:"var(--bg-hover)",border:"1px solid var(--border)"},children:[c&&m.jsx("p",{className:"text-h2 font-bold mb-2",style:{color:"var(--text-primary)"},children:c}),m.jsx("div",{className:"flex flex-col gap-1",children:l.map(u=>Gl(u,t,r))})]},e)}if("List"in a){const l=Zc(a.List.children);return m.jsx("div",{className:"flex flex-col gap-0.5 my-1",children:l.map(c=>m.jsxs("div",{className:"flex items-start gap-2 px-2 py-1.5 rounded hover:bg-[--bg-hover] transition-colors",children:[m.jsx("span",{className:"text-tiny mt-1",style:{color:"var(--text-muted)"},children:"•"}),Gl(c,t,r)]},c))},e)}if("Image"in a){const l=ps(a.Image.url),c=a.Image.alt?ps(a.Image.alt):"";return m.jsx("img",{src:l,alt:c,className:"max-w-[360px] max-h-64 rounded-md object-contain my-1",style:{border:"1px solid var(--border)"}},e)}if("Divider"in a)return m.jsx("hr",{className:"my-2",style:{border:"none",borderTop:"1px solid var(--border)"}},e);if("Icon"in a){const l=ps(a.Icon.name);return m.jsxs("span",{className:"text-body",style:{color:"var(--text-secondary)"},children:["[",l,"]"]},e)}return null}function wM(e,t){return{pre({children:r,node:a}){var c,u,d,h;const l=(c=a==null?void 0:a.children)==null?void 0:c[0];if((l==null?void 0:l.tagName)==="code"){const p=(u=l.properties)!=null&&u.className?Array.isArray(l.properties.className)?l.properties.className.join(" "):String(l.properties.className):void 0;if(p!=null&&p.includes("language-action")){const b=String(((d=r==null?void 0:r.props)==null?void 0:d.children)??r).trim();try{const y=JSON.parse(b);if(y&&typeof y=="object"&&y.kind){const v=kM(y.prompt??b),x=t==null?void 0:t[v];return m.jsx(CM,{action:y,resolved:x,onResolve:e?(_,T)=>e(_,T):void 0})}}catch{}}return m.jsx(yM,{className:p,children:((h=r==null?void 0:r.props)==null?void 0:h.children)??r})}return m.jsx("pre",{children:r})},code({className:r,children:a,...l}){return m.jsx("code",{className:"px-1 py-0.5 rounded text-[0.85em]",style:{background:"var(--code-bg)",color:"var(--code-text)",fontFamily:"var(--font-mono)"},...l,children:a})},table({children:r}){return m.jsx(vM,{children:r})},thead({children:r}){return m.jsx(xM,{children:r})},tr({children:r,...a}){return m.jsx(EM,{...a,children:r})},th({children:r,style:a}){return m.jsx(Xv,{isHeader:!0,style:a,children:r})},td({children:r,style:a}){return m.jsx(Xv,{style:a,children:r})},a({href:r,children:a,...l}){return m.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--text-link)"},className:"underline underline-offset-2 hover:opacity-80 transition-opacity",...l,children:a})},blockquote({children:r}){return m.jsx("blockquote",{className:"my-2 pl-3 py-0.5",style:{borderLeft:"3px solid var(--bg-active)",color:"var(--text-secondary)"},children:r})}}}function kM(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r)|0;return t.toString(36)}function TM(e,t){if(!e.includes("```action"))return e;const r=[];let a=e;const l=/```action\s*\n[\s\S]*?```/g;let c=0,u;for(;(u=l.exec(a))!==null;)u.index>c&&r.push(a.slice(c,u.index)),r.push(u[0]),c=u.index+u[0].length;const d=a.slice(c),h=d.indexOf("```action");return h!==-1&&t?r.push(d.slice(0,h)):r.push(d),r.join("")}function NM(e){return e.includes("```action")?e.replace(/```action\s*\n[\s\S]*?```/g,"").includes("```action"):!1}function CM({action:e,resolved:t,onResolve:r}){var b,y;const[a,l]=D.useState(""),[c,u]=D.useState(null);if(t)return m.jsxs("div",{className:"mt-2 rounded-lg px-4 py-3 flex items-center gap-2",style:{background:"var(--bg-hover)",border:"1px solid var(--border)",opacity:.85},children:[m.jsx("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,style:{color:"var(--accent-green, #34d399)"},children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),m.jsxs("span",{className:"text-caption",style:{color:"var(--text-secondary)"},children:["Selected: ",m.jsx("strong",{style:{color:"var(--text-primary)"},children:t.label??t.value})]})]});const d=v=>{r&&r(v.value,v.label)},h=()=>{const v=a.trim();v&&r&&r(v,v)},p=(v,x)=>{const _=c===x;return v.style==="primary"?{background:"var(--bg-active)",color:"#fff",border:"none",opacity:_?.9:1}:v.style==="danger"?{background:_?"rgba(239,68,68,0.15)":"transparent",color:"var(--accent-red, #ef4444)",border:"1px solid var(--accent-red, #ef4444)"}:{background:_?"var(--bg-hover)":"transparent",color:"var(--text-link)",border:"1px solid var(--border)"}};if(e.kind==="confirm"){const v=((b=e.items)==null?void 0:b[0])??{label:"Yes",value:"yes"},x=((y=e.items)==null?void 0:y[1])??{label:"No",value:"no"};return m.jsxs("div",{className:"mt-2 rounded-lg overflow-hidden",style:{border:"1px solid var(--border)",background:"var(--bg-secondary, var(--bg-hover))"},children:[e.prompt&&m.jsx("div",{className:"px-4 py-3",style:{borderBottom:"1px solid var(--border)"},children:m.jsx("p",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:e.prompt})}),m.jsxs("div",{className:"flex",children:[m.jsx("button",{onClick:()=>d(x),onMouseEnter:()=>u(0),onMouseLeave:()=>u(null),className:"flex-1 px-4 py-2.5 text-caption font-bold transition-all cursor-pointer",style:{background:c===0?"var(--bg-hover)":"transparent",color:"var(--text-secondary)",borderRight:"1px solid var(--border)",border:"none",borderRightWidth:1,borderRightStyle:"solid",borderRightColor:"var(--border)"},children:x.label}),m.jsx("button",{onClick:()=>d(v),onMouseEnter:()=>u(1),onMouseLeave:()=>u(null),className:"flex-1 px-4 py-2.5 text-caption font-bold transition-all cursor-pointer",style:{background:"var(--bg-active)",color:"#fff",border:"none",opacity:c===1?.9:1},children:v.label})]})]})}return e.kind==="buttons"&&e.items?m.jsxs("div",{className:"mt-2 rounded-lg overflow-hidden",style:{border:"1px solid var(--border)",background:"var(--bg-secondary, var(--bg-hover))"},children:[e.prompt&&m.jsx("div",{className:"px-4 py-3",style:{borderBottom:"1px solid var(--border)"},children:m.jsx("p",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:e.prompt})}),m.jsx("div",{className:"flex flex-wrap gap-2 px-4 py-3",children:e.items.map((v,x)=>m.jsx("button",{onClick:()=>d(v),onMouseEnter:()=>u(x),onMouseLeave:()=>u(null),className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-md text-caption font-bold transition-all cursor-pointer",style:p(v,x),children:v.label},v.value))})]}):e.kind==="select"&&e.items?m.jsxs("div",{className:"mt-2 rounded-lg overflow-hidden",style:{border:"1px solid var(--border)",background:"var(--bg-secondary, var(--bg-hover))"},children:[e.prompt&&m.jsx("div",{className:"px-4 py-3",style:{borderBottom:"1px solid var(--border)"},children:m.jsx("p",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:e.prompt})}),m.jsx("div",{className:"flex flex-col",children:e.items.map((v,x)=>m.jsxs("button",{onClick:()=>d(v),onMouseEnter:()=>u(x),onMouseLeave:()=>u(null),className:"flex items-center gap-3 px-4 py-2.5 text-left transition-all cursor-pointer",style:{background:c===x?"var(--bg-hover)":"transparent",color:"var(--text-primary)",borderBottom:x<e.items.length-1?"1px solid var(--border)":"none",border:"none",borderBottomWidth:x<e.items.length-1?1:0,borderBottomStyle:"solid",borderBottomColor:"var(--border)"},children:[m.jsx("span",{className:"w-5 h-5 rounded-full flex items-center justify-center flex-shrink-0",style:{border:"2px solid var(--border)",background:c===x?"var(--bg-active)":"transparent"},children:c===x&&m.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:"#fff"}})}),m.jsx("span",{className:"text-caption",children:v.label})]},v.value))})]}):e.kind==="input"?m.jsxs("div",{className:"mt-2 rounded-lg overflow-hidden",style:{border:"1px solid var(--border)",background:"var(--bg-secondary, var(--bg-hover))"},children:[e.prompt&&m.jsx("div",{className:"px-4 py-3",style:{borderBottom:"1px solid var(--border)"},children:m.jsx("p",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:e.prompt})}),m.jsxs("div",{className:"flex items-center gap-2 px-4 py-3",children:[m.jsx("input",{type:"text",value:a,onChange:v=>l(v.target.value),onKeyDown:v=>{v.key==="Enter"&&h()},placeholder:e.placeholder??"Type your answer...",className:"flex-1 px-3 py-2 rounded-md text-caption outline-none",style:{background:"var(--bg-primary, var(--bg))",color:"var(--text-primary)",border:"1px solid var(--border)"}}),m.jsx("button",{onClick:h,disabled:!a.trim(),className:"px-4 py-2 rounded-md text-caption font-bold transition-all cursor-pointer",style:{background:a.trim()?"var(--bg-active)":"var(--bg-hover)",color:a.trim()?"#fff":"var(--text-muted)",border:"none"},children:"Submit"})]})]}):null}function AM(){return m.jsxs("div",{className:"mt-2 rounded-lg px-4 py-3 flex items-center gap-3",style:{background:"var(--bg-secondary, var(--bg-hover))",border:"1px solid var(--border)"},children:[m.jsx("span",{className:"inline-block w-2 h-2 rounded-full animate-pulse",style:{background:"var(--text-link)"}}),m.jsx("span",{className:"text-caption",style:{color:"var(--text-muted)"},children:"Preparing options..."})]})}function Fh({text:e,mediaUrl:t,a2ui:r,className:a="",isStreaming:l,onAction:c,onResolveAction:u,resolvedActions:d}){const h=D.useMemo(()=>wM(u,d),[u,d]),p=D.useMemo(()=>TM(e,l),[e,l]),b=l&&NM(e);return m.jsxs("div",{className:a,children:[t&&m.jsx("div",{className:"mb-2",children:m.jsx(OM,{url:t})}),p?m.jsx("div",{className:"prose prose-sm max-w-none prose-p:my-1 prose-ul:my-1 prose-ol:my-1 prose-pre:my-0 prose-code:before:content-none prose-code:after:content-none prose-headings:my-2",style:{color:"var(--text-primary)","--tw-prose-headings":"var(--text-primary)","--tw-prose-bold":"var(--text-primary)","--tw-prose-code":"var(--code-text)","--tw-prose-pre-code":"var(--text-primary)","--tw-prose-pre-bg":"var(--code-bg)","--tw-prose-bullets":"var(--text-muted)","--tw-prose-counters":"var(--text-muted)"},children:m.jsx(Gx,{remarkPlugins:[p0],rehypePlugins:[gM],components:h,children:p})}):null,b&&m.jsx(AM,{}),r&&m.jsx(_M,{jsonl:r,onAction:c})]})}function OM({url:e}){var r,a;const t=((r=e.split(".").pop())==null?void 0:r.toLowerCase().split("?")[0])??"";if(["mp3","wav","ogg","m4a","aac","webm"].includes(t))return m.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 rounded-md max-w-[360px]",style:{background:"var(--bg-hover)",border:"1px solid var(--border)"},children:[m.jsx("svg",{className:"w-8 h-8 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,style:{color:"var(--text-link)"},children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.114 5.636a9 9 0 010 12.728M16.463 8.288a5.25 5.25 0 010 7.424M6.75 8.25l4.72-4.72a.75.75 0 011.28.53v15.88a.75.75 0 01-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.01 9.01 0 012.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75z"})}),m.jsx("audio",{controls:!0,className:"flex-1 h-8",style:{maxWidth:280},children:m.jsx("source",{src:e})})]});if(["mp4","mov","avi","mkv"].includes(t))return m.jsx("video",{controls:!0,className:"max-w-[360px] max-h-64 rounded-md",style:{border:"1px solid var(--border)"},children:m.jsx("source",{src:e})});if(["pdf","zip","tar","gz","doc","docx","xls","xlsx","csv"].includes(t)){const l=((a=e.split("/").pop())==null?void 0:a.split("?")[0])??"file";return m.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 px-3 py-2.5 rounded-md max-w-[360px] hover:opacity-90 transition-opacity",style:{background:"var(--bg-hover)",border:"1px solid var(--border)",textDecoration:"none"},children:[m.jsx("svg",{className:"w-8 h-8 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,style:{color:"var(--text-link)"},children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})}),m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsx("p",{className:"text-caption font-bold truncate",style:{color:"var(--text-primary)"},children:l}),m.jsxs("p",{className:"text-tiny",style:{color:"var(--text-muted)"},children:[t.toUpperCase()," — Click to open"]})]}),m.jsx("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,style:{color:"var(--text-muted)"},children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})})]})}return m.jsx("img",{src:e,alt:"",className:"max-w-[360px] max-h-64 rounded-md object-contain cursor-pointer hover:opacity-90 transition-opacity",style:{border:"1px solid var(--border)"},onClick:()=>window.open(e,"_blank")})}function RM({channelId:e}){const t=lr(),r=ti(),[a,l]=D.useState(null),[c,u]=D.useState(""),d=D.useRef(null),h=D.useRef(null),p=t.sessions,b=t.selectedSessionId;D.useEffect(()=>{a&&d.current&&(d.current.focus(),d.current.select())},[a]);const y=D.useCallback(C=>{if(C===b)return;const S=p.find(R=>R.id===C);S&&(ue.info("Session",`Switched to session: ${S.name} (${S.id})`),r({type:"SELECT_SESSION",sessionId:S.id,sessionKey:S.sessionKey}))},[b,p,r]),v=D.useCallback(async()=>{try{let C=e;if(!C){ue.info("Session","No channel for default agent — auto-creating General channel"),C=(await Er.create({name:"General",openclawAgentId:"main"})).id;const[{agents:M},{channels:A}]=await Promise.all([_s.list(),Er.list()]);r({type:"SET_AGENTS",agents:M}),r({type:"SET_CHANNELS",channels:A});const{sessions:P}=await Es.list(C);r({type:"SET_SESSIONS",sessions:P}),P.length>0&&r({type:"SELECT_SESSION",sessionId:P[0].id,sessionKey:P[0].sessionKey});return}const S=await Es.create(C);ue.info("Session",`Created session: ${S.name} (${S.id})`),r({type:"ADD_SESSION",session:S}),r({type:"SELECT_SESSION",sessionId:S.id,sessionKey:S.sessionKey}),requestAnimationFrame(()=>{h.current&&(h.current.scrollLeft=h.current.scrollWidth)})}catch(C){ue.error("Session",`Failed to create session: ${C}`)}},[e,r]),x=D.useCallback(async C=>{if(!(p.length<=1||!e))try{if(await Es.delete(e,C),ue.info("Session",`Deleted session: ${C}`),r({type:"REMOVE_SESSION",sessionId:C}),b===C){const S=p.filter(R=>R.id!==C);S.length>0&&r({type:"SELECT_SESSION",sessionId:S[0].id,sessionKey:S[0].sessionKey})}}catch(S){ue.error("Session",`Failed to delete session: ${S}`)}},[e,p,b,r]),_=D.useCallback((C,S)=>{l(C),u(S)},[]),T=D.useCallback(async()=>{if(!a||!c.trim()||!e){l(null);return}try{await Es.rename(e,a,c.trim()),ue.info("Session",`Renamed session ${a} to: ${c.trim()}`),r({type:"RENAME_SESSION",sessionId:a,name:c.trim()})}catch(C){ue.error("Session",`Failed to rename session: ${C}`)}l(null)},[e,a,c,r]);return m.jsx("div",{className:"flex items-center gap-0 px-3",style:{height:36,borderBottom:"1px solid var(--border)",background:"var(--bg-surface)"},children:m.jsxs("div",{ref:h,className:"flex items-center gap-0.5 overflow-x-auto no-scrollbar",children:[p.map(C=>{const S=C.id===b,R=C.id===a;return m.jsx("div",{className:"group relative flex items-center shrink-0",children:R?m.jsx("input",{ref:d,value:c,onChange:M=>u(M.target.value),onBlur:T,onKeyDown:M=>{M.key==="Enter"&&!M.nativeEvent.isComposing&&(M.preventDefault(),T()),M.key==="Escape"&&l(null)},className:"px-2.5 py-1 text-caption rounded-t-md focus:outline-none",style:{background:"var(--bg-hover)",color:"var(--text-primary)",border:"1px solid var(--bg-active)",borderBottom:"none",minWidth:60,maxWidth:140}}):m.jsxs("button",{onClick:()=>y(C.id),onDoubleClick:()=>_(C.id,C.name),className:"flex items-center gap-1 px-2.5 py-1 text-caption rounded-t-md transition-colors whitespace-nowrap",style:{background:S?"var(--bg-hover)":"transparent",color:S?"var(--text-primary)":"var(--text-secondary)",fontWeight:S?700:400,borderBottom:S?"2px solid var(--bg-active)":"2px solid transparent",marginBottom:-1},title:`${C.name} (double-click to rename)`,children:[m.jsx("span",{className:"max-w-[120px] truncate",children:C.name}),p.length>1&&m.jsx("span",{onClick:M=>{M.stopPropagation(),x(C.id)},className:"ml-0.5 w-4 h-4 flex items-center justify-center rounded-sm opacity-0 group-hover:opacity-100 transition-opacity hover:bg-[--bg-hover]",style:{color:"var(--text-muted)"},title:"Close session",children:m.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]})},C.id)}),m.jsx("button",{onClick:v,className:"shrink-0 w-7 h-7 flex items-center justify-center rounded-md transition-colors ml-0.5",style:{color:"var(--text-muted)"},title:"New session","aria-label":"New session",onMouseEnter:C=>{C.currentTarget.style.background="var(--bg-hover)",C.currentTarget.style.color="var(--text-primary)"},onMouseLeave:C=>{C.currentTarget.style.background="",C.currentTarget.style.color="var(--text-muted)"},children:m.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})})})]})})}function Wr(){if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();const e=new Uint8Array(16);if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function")crypto.getRandomValues(e);else for(let r=0;r<16;r++)e[r]=Math.floor(Math.random()*256);e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=Array.from(e,r=>r.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function MM(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r)|0;return t.toString(36)}const Zv=[{cmd:"/help",label:"Help",icon:"?"},{cmd:"/status",label:"Status",icon:"i"},{cmd:"/model",label:"Model",icon:"M"},{cmd:"/clear",label:"Clear",icon:"C"},{cmd:"/think",label:"Think",icon:"T"},{cmd:"/image",label:"Image",icon:"I"},{cmd:"/search",label:"Search",icon:"S"},{cmd:"/summarize",label:"Summarize",icon:"Σ"},{cmd:"/translate",label:"Translate",icon:"翻"},{cmd:"/reset",label:"Reset",icon:"R"}],z0="botschat_skill_freq_v2",Qv="botschat_skill_freq",IM=2,DM=14;function j0(e=new Date){return e.toISOString().slice(0,10)}function B0(e){const t=Date.now()-DM*864e5;for(const r of Object.values(e))for(const a of Object.keys(r.daily))new Date(a).getTime()<t&&delete r.daily[a]}function U0(){try{const e=localStorage.getItem(z0);if(e){const r=JSON.parse(e);return B0(r),r}const t=localStorage.getItem(Qv);if(t){const r=JSON.parse(t),a=j0(),l={};for(const[c,u]of Object.entries(r))l[c]={total:u,daily:{[a]:u}};return P0(l),localStorage.removeItem(Qv),l}return{}}catch{return{}}}function P0(e){B0(e),localStorage.setItem(z0,JSON.stringify(e))}function Jv(e){const t=e.match(/^\/(\S+)/);if(!t)return null;const r=`/${t[1]}`,a=U0(),l=j0();return a[r]||(a[r]={total:0,daily:{}}),a[r].total+=1,a[r].daily[l]=(a[r].daily[l]??0)+1,P0(a),r}function H0(e){const t=Date.now()-IM*864e5;let r=0;for(const[a,l]of Object.entries(e.daily))new Date(a).getTime()>=t&&(r+=l);return r}function e1(e){return H0(e)*5+e.total}function LM(){const e=U0(),t=new Set(Zv.map(l=>l.cmd)),r=Object.keys(e).filter(l=>!t.has(l)&&l.startsWith("/")).map(l=>({cmd:l,label:l.slice(1).charAt(0).toUpperCase()+l.slice(2),icon:l.slice(1).charAt(0).toUpperCase()}));return{skills:[...Zv,...r].sort((l,c)=>{const u=e[l.cmd]?e1(e[l.cmd]):0;return(e[c.cmd]?e1(e[c.cmd]):0)-u}),store:e}}function F0({sendMessage:e}){var N,de,fe;const t=lr(),r=ti(),[a,l]=D.useState(""),[c,u]=D.useState(0),[d,h]=D.useState(null),[p,b]=D.useState(!1),[y,v]=D.useState(!1),x=D.useRef(null),_=D.useRef(null),T=D.useRef(null),C=D.useRef(null),S=t.selectedSessionKey,{skills:R,store:M}=D.useMemo(()=>LM(),[c]);D.useEffect(()=>{var q;(q=x.current)==null||q.scrollIntoView({behavior:"smooth"})},[t.messages]),D.useEffect(()=>{_.current&&(_.current.style.height="auto",_.current.style.height=Math.min(_.current.scrollHeight,160)+"px")},[a]),D.useEffect(()=>{S&&_.current&&requestAnimationFrame(()=>{var q;(q=_.current)==null||q.focus()})},[S]),D.useEffect(()=>{if(S)try{const ce=JSON.parse(localStorage.getItem("botschat:sessionModels")||"{}")[S];ce&&ce!==t.sessionModel?r({type:"SET_SESSION_MODEL",model:ce}):!ce&&t.sessionModel&&r({type:"SET_SESSION_MODEL",model:null})}catch{}},[S]);const A=t.sessionModel??t.defaultModel,P=D.useCallback(q=>{var ge;if(!q||!S||q===A)return;ue.info("Chat",`Model change: ${A??"none"} → ${q}`),r({type:"SET_SESSION_MODEL",model:q});try{const xe=JSON.parse(localStorage.getItem("botschat:sessionModels")||"{}");xe[S]=q,localStorage.setItem("botschat:sessionModels",JSON.stringify(xe))}catch{}Jv("/model"),u(xe=>xe+1);const ce={id:Wr(),sender:"user",text:`/model ${q}`,timestamp:Date.now()};r({type:"ADD_MESSAGE",message:ce}),e({type:"user.message",sessionKey:S,text:`/model ${q}`,userId:((ge=t.user)==null?void 0:ge.id)??"",messageId:ce.id}),requestAnimationFrame(()=>{var xe;(xe=x.current)==null||xe.scrollIntoView({behavior:"smooth"})})},[S,A,(N=t.user)==null?void 0:N.id,e,r]),I=D.useCallback(q=>{var ce;ue.info("Skill",`Skill button clicked: ${q}`),l(ge=>ge.startsWith(q+" ")||ge===q?ge:q+" "),(ce=_.current)==null||ce.focus()},[]),W=D.useCallback(q=>{var xe,Ie;const ce=(xe=q.target.files)==null?void 0:xe[0];if(!ce||!ce.type.startsWith("image/"))return;const ge=URL.createObjectURL(ce);h({file:ce,preview:ge}),q.target.value="",(Ie=_.current)==null||Ie.focus()},[]),te=D.useCallback(()=>{d&&(URL.revokeObjectURL(d.preview),h(null))},[d]),ee=D.useCallback(async q=>{const ce=new FormData;ce.append("file",q);const ge=localStorage.getItem("botschat_token");try{const xe=await fetch("/api/upload",{method:"POST",headers:ge?{Authorization:`Bearer ${ge}`}:{},body:ce});if(!xe.ok){const Ct=await xe.json().catch(()=>({error:"Upload failed"}));throw new Error(Ct.error??`HTTP ${xe.status}`)}const Ie=await xe.json();return Ie.url.startsWith("/")?`${window.location.origin}${Ie.url}`:Ie.url}catch(xe){return ue.error("Upload",`Image upload failed: ${xe}`),null}},[]),U=D.useCallback(q=>{q.preventDefault(),q.stopPropagation(),q.dataTransfer.types.includes("Files")&&v(!0)},[]),F=D.useCallback(q=>{var ge;q.preventDefault(),q.stopPropagation();const ce=(ge=C.current)==null?void 0:ge.getBoundingClientRect();if(ce){const{clientX:xe,clientY:Ie}=q;(xe<ce.left||xe>ce.right||Ie<ce.top||Ie>ce.bottom)&&v(!1)}},[]),X=D.useCallback(q=>{q.preventDefault(),q.stopPropagation()},[]),me=D.useCallback(q=>{var ge,xe;q.preventDefault(),q.stopPropagation(),v(!1);const ce=(ge=q.dataTransfer.files)==null?void 0:ge[0];if(ce&&ce.type.startsWith("image/")){const Ie=URL.createObjectURL(ce);h({file:ce,preview:Ie}),(xe=_.current)==null||xe.focus()}},[]),le=D.useCallback(q=>{var ge;const ce=(ge=q.clipboardData)==null?void 0:ge.items;if(ce){for(let xe=0;xe<ce.length;xe++)if(ce[xe].type.startsWith("image/")){q.preventDefault();const Ie=ce[xe].getAsFile();if(Ie){const St=URL.createObjectURL(Ie);h({file:Ie,preview:St})}return}}},[]),K=async()=>{var St;if(!a.trim()&&!d||!S)return;const q=a.trim(),ce=q.length>0,ge=ce&&q.startsWith("/");ue.info("Chat",`Send message${ge?" (skill)":""}${d?" +image":""}: ${q.length>120?q.slice(0,120)+"…":q}`,{sessionKey:S,isSkill:ge}),ce&&(Jv(q),u(Ct=>Ct+1));let xe;if(d){b(!0);const Ct=await ee(d.file);if(b(!1),!Ct)return;xe=Ct,te()}const Ie={id:Wr(),sender:"user",text:q,timestamp:Date.now(),mediaUrl:xe};r({type:"ADD_MESSAGE",message:Ie}),e({type:"user.message",sessionKey:S,text:q,userId:((St=t.user)==null?void 0:St.id)??"",messageId:Ie.id,...xe?{mediaUrl:xe}:{}}),l(""),requestAnimationFrame(()=>{var Ct;(Ct=x.current)==null||Ct.scrollIntoView({behavior:"smooth"})})},z=q=>{ue.info("Thread",`Open thread for message: ${q}`),r({type:"OPEN_THREAD",threadId:q,messages:[]})},Q=D.useCallback(q=>{var ge;if(!S)return;ue.info("A2UI",`Action triggered: ${q}`);const ce={id:Wr(),sender:"user",text:q,timestamp:Date.now()};r({type:"ADD_MESSAGE",message:ce}),e({type:"user.message",sessionKey:S,text:q,userId:((ge=t.user)==null?void 0:ge.id)??"",messageId:ce.id}),requestAnimationFrame(()=>{var xe;(xe=x.current)==null||xe.scrollIntoView({behavior:"smooth"})})},[S,(de=t.user)==null?void 0:de.id,e,r]),ie=D.useCallback((q,ce,ge)=>{var St;if(!S)return;ue.info("ActionCard",`Resolved: "${ge}" (value="${ce}")`);const xe=MM(ge+ce);r({type:"RESOLVE_ACTION",messageId:q,promptHash:xe,value:ce,label:ge});const Ie={id:Wr(),sender:"user",text:ge,timestamp:Date.now()};r({type:"ADD_MESSAGE",message:Ie}),e({type:"user.message",sessionKey:S,text:ge,userId:((St=t.user)==null?void 0:St.id)??"",messageId:Ie.id}),requestAnimationFrame(()=>{var Ct;(Ct=x.current)==null||Ct.scrollIntoView({behavior:"smooth"})})},[S,(fe=t.user)==null?void 0:fe.id,e,r]),B=t.agents.find(q=>q.id===t.selectedAgentId),w=(B==null?void 0:B.name)??"channel",O=(B==null?void 0:B.channelId)??null,G=!!B;return S?m.jsxs("div",{ref:C,className:"flex-1 flex flex-col min-w-0 h-full relative",style:{background:"var(--bg-surface)"},onDragEnter:U,onDragLeave:F,onDragOver:X,onDrop:me,children:[y&&m.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center",style:{background:"rgba(0,0,0,0.4)",pointerEvents:"none"},children:m.jsxs("div",{className:"flex flex-col items-center gap-3 p-8 rounded-lg",style:{background:"var(--bg-surface)",border:"2px dashed var(--text-link)"},children:[m.jsx("svg",{className:"w-12 h-12",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,style:{color:"var(--text-link)"},children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909M3.75 21h16.5a1.5 1.5 0 001.5-1.5V6a1.5 1.5 0 00-1.5-1.5H3.75A1.5 1.5 0 002.25 6v13.5A1.5 1.5 0 003.75 21z"})}),m.jsx("span",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:"Drop image here"})]})}),m.jsxs("div",{className:"flex items-center justify-between px-3 sm:px-5 gap-2 flex-shrink-0",style:{height:44,borderBottom:"1px solid var(--border)"},children:[m.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[m.jsxs("span",{className:"text-h1 truncate",style:{color:"var(--text-primary)"},children:["# ",w]}),B&&!B.isDefault&&m.jsx("span",{className:"text-caption hidden sm:inline flex-shrink-0",style:{color:"var(--text-secondary)"},children:"— custom channel"})]}),m.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[m.jsx("svg",{className:"w-3.5 h-3.5 hidden sm:block",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,style:{color:"var(--text-muted)"},children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.455 2.456L21.75 6l-1.036.259a3.375 3.375 0 00-2.455 2.456z"})}),m.jsx(wu,{value:A??"",onChange:P,models:t.models,disabled:!t.openclawConnected,placeholder:"No model",compact:!0})]})]}),G&&m.jsx(RM,{channelId:O}),m.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[t.messages.length===0&&m.jsx("div",{className:"py-12 px-5 text-center",children:m.jsx("p",{className:"text-caption",style:{color:"var(--text-muted)"},children:"No messages yet. Start a conversation."})}),t.messages.map((q,ce)=>{const ge=ce>0?t.messages[ce-1]:null,xe=(ge==null?void 0:ge.sender)===q.sender&&q.timestamp-ge.timestamp<3e5;return m.jsx(zM,{msg:q,grouped:xe,onOpenThread:()=>z(q.id),onAction:Q,onResolveAction:(Ie,St)=>ie(q.id,Ie,St)},q.id)}),m.jsx("div",{ref:x})]}),m.jsxs("div",{className:"flex-shrink-0 px-3 sm:px-5 pb-3 sm:pb-4 pt-2",children:[m.jsx("div",{className:"flex items-center gap-1.5 pb-1.5 overflow-x-auto no-scrollbar",children:R.map(q=>{const ce=M[q.cmd],ge=(ce==null?void 0:ce.total)??0,xe=ce?H0(ce):0,Ie=a.startsWith(q.cmd+" ")||a===q.cmd;return m.jsxs("button",{onClick:()=>I(q.cmd),className:"flex items-center gap-1 px-2 py-1 rounded-md text-xs whitespace-nowrap transition-colors shrink-0",style:{background:Ie?"var(--bg-active)":"var(--bg-hover)",color:Ie?"#fff":"var(--text-secondary)",border:"1px solid transparent"},title:`${q.cmd}${ge>0?` (total ${ge}x${xe>0?`, recent ${xe}x`:""})`:""}`,children:[m.jsx("span",{className:"font-mono text-[10px] opacity-70",children:q.cmd}),ge>0&&m.jsx("span",{className:"ml-0.5 px-1 rounded-sm text-[10px] font-bold",style:{background:Ie?"rgba(255,255,255,0.2)":"var(--bg-surface)",color:Ie?"#fff":"var(--text-muted)"},children:ge})]},q.cmd)})}),m.jsxs("div",{className:"rounded-md",style:{border:"1px solid var(--border)",background:"var(--bg-surface)"},children:[d&&m.jsxs("div",{className:"px-3 pt-2 flex items-start gap-2",children:[m.jsxs("div",{className:"relative",children:[m.jsx("img",{src:d.preview,alt:"Preview",className:"max-w-[120px] max-h-[80px] rounded-md object-contain",style:{border:"1px solid var(--border)"}}),m.jsx("button",{onClick:te,className:"absolute -top-1.5 -right-1.5 w-5 h-5 rounded-full flex items-center justify-center text-white opacity-80 hover:opacity-100 transition-opacity",style:{background:"#e74c3c",fontSize:11},title:"Remove image",children:"✕"})]}),p&&m.jsx("span",{className:"text-caption",style:{color:"var(--text-muted)"},children:"Uploading…"})]}),m.jsx("textarea",{ref:_,value:a,onChange:q=>l(q.target.value),onKeyDown:q=>{q.key==="Enter"&&!q.shiftKey&&!q.nativeEvent.isComposing&&(q.preventDefault(),K())},onPaste:le,placeholder:t.openclawConnected?`Message #${w}`:"OpenClaw is offline…",disabled:!t.openclawConnected,rows:1,className:"w-full px-3 py-2.5 text-body bg-transparent resize-none focus:outline-none disabled:opacity-50 placeholder:text-[--text-muted]",style:{color:"var(--text-primary)",minHeight:40}}),m.jsxs("div",{className:"flex items-center justify-between px-3 pb-2",children:[m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("input",{ref:T,type:"file",accept:"image/*",className:"hidden",onChange:W}),m.jsx("button",{onClick:()=>{var q;return(q=T.current)==null?void 0:q.click()},className:"p-1.5 rounded hover:bg-[--bg-hover] transition-colors",style:{color:"var(--text-muted)"},title:"Upload image","aria-label":"Upload image",disabled:!t.openclawConnected,children:m.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909M3.75 21h16.5a1.5 1.5 0 001.5-1.5V6a1.5 1.5 0 00-1.5-1.5H3.75A1.5 1.5 0 002.25 6v13.5A1.5 1.5 0 003.75 21zm14.25-15.75a.75.75 0 11-1.5 0 .75.75 0 011.5 0z"})})})]}),m.jsx("button",{onClick:K,disabled:!a.trim()&&!d||!t.openclawConnected,className:"px-3 py-1.5 rounded-sm text-caption font-bold text-white disabled:opacity-40 disabled:cursor-not-allowed transition-colors",style:{background:"var(--bg-active)"},children:m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5"})}),"Send"]})})]})]})]})]}):m.jsx("div",{className:"flex-1 h-full flex items-center justify-center",style:{background:"var(--bg-surface)"},children:m.jsxs("div",{className:"text-center",children:[m.jsx("svg",{className:"w-16 h-16 mx-auto mb-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,style:{color:"var(--text-muted)"},children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 01-.825-.242m9.345-8.334a2.126 2.126 0 00-.476-.095 48.64 48.64 0 00-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0011.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155"})}),m.jsx("p",{className:"text-body font-bold",style:{color:"var(--text-muted)"},children:"Select a channel to get started"}),m.jsx("p",{className:"text-caption mt-1",style:{color:"var(--text-muted)"},children:"Choose a channel from the sidebar"})]})})}function zM({msg:e,grouped:t,onOpenThread:r,onAction:a,onResolveAction:l}){const c=lr(),u=e.sender==="user"?"You":"OpenClaw Agent",d=e.sender==="user"?"#9B59B6":"#2BAC76",h=e.sender==="user"?"U":"A",p=c.threadReplyCounts[e.id]??0;return m.jsxs("div",{className:"group relative px-3 sm:px-5 hover:bg-[--bg-hover] transition-colors",style:{paddingTop:t?2:8,paddingBottom:2},children:[m.jsxs("div",{className:"flex gap-2 max-w-message",children:[m.jsx("div",{className:"flex-shrink-0",style:{width:36},children:!t&&m.jsx("div",{className:"w-9 h-9 rounded flex items-center justify-center text-white text-caption font-bold",style:{background:d},children:h})}),m.jsxs("div",{className:"flex-1 min-w-0",children:[!t&&m.jsxs("div",{className:"flex items-baseline gap-2 mb-0.5",children:[m.jsx("span",{className:"text-h2",style:{color:"var(--text-primary)"},children:u}),m.jsx("span",{className:"text-caption",style:{color:"var(--text-secondary)"},children:new Date(e.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),m.jsx(Fh,{text:e.text,mediaUrl:e.mediaUrl,a2ui:e.a2ui,isStreaming:e.isStreaming,onAction:a,onResolveAction:l,resolvedActions:e.resolvedActions}),e.isStreaming&&m.jsx("span",{className:"inline-block w-1.5 h-4 ml-0.5 rounded-sm animate-pulse",style:{background:"var(--text-link)",verticalAlign:"text-bottom"}}),p>0&&m.jsxs("button",{onClick:r,className:"flex items-center gap-2 mt-1 py-1 px-1 -ml-1 rounded hover:bg-[--bg-hover] transition-colors cursor-pointer group/thread",children:[m.jsxs("span",{className:"text-caption font-bold",style:{color:"var(--text-link)"},children:[p," ",p===1?"reply":"replies"]}),m.jsx("span",{className:"text-caption opacity-0 group-hover/thread:opacity-100 transition-opacity",style:{color:"var(--text-secondary)"},children:"View thread"}),m.jsx("svg",{className:"w-4 h-4 opacity-0 group-hover/thread:opacity-100 transition-opacity",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,style:{color:"var(--text-secondary)"},children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})})]})]})]}),m.jsx("div",{className:"absolute top-0 right-5 -translate-y-1/2 opacity-0 group-hover:opacity-100 transition-opacity flex items-center gap-0.5 px-1 py-0.5 rounded",style:{background:"var(--bg-surface)",border:"1px solid var(--border)",boxShadow:"var(--shadow-sm)"},children:m.jsx(jM,{label:"Reply in thread",icon:m.jsx("svg",{className:"w-[18px] h-[18px]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 01-.825-.242m9.345-8.334a2.126 2.126 0 00-.476-.095 48.64 48.64 0 00-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0011.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155"})}),onClick:r})})]})}function jM({label:e,icon:t,onClick:r}){return m.jsx("button",{onClick:r,className:"p-1 rounded hover:bg-[--bg-hover] transition-colors",style:{color:"var(--text-secondary)"},title:e,"aria-label":e,children:t})}function $0({sendMessage:e}){const t=lr(),r=ti(),[a,l]=D.useState("");if(D.useEffect(()=>{if(!t.activeThreadId||!t.selectedSessionKey||!t.user)return;const d=`${t.selectedSessionKey}:thread:${t.activeThreadId}`;ue.info("Thread",`Loading history for thread ${t.activeThreadId}`),ex.list(t.user.id,d,t.activeThreadId).then(({messages:h})=>{ue.info("Thread",`Loaded ${h.length} thread messages`),h.length>0&&r({type:"OPEN_THREAD",threadId:t.activeThreadId,messages:h})}).catch(h=>{ue.error("Thread",`Failed to load thread history: ${h}`)})},[t.activeThreadId]),!t.activeThreadId)return null;const c=t.messages.find(d=>d.id===t.activeThreadId),u=()=>{var b;if(!a.trim()||!t.selectedSessionKey)return;const d=a.trim(),h=`${t.selectedSessionKey}:thread:${t.activeThreadId}`;ue.info("Thread",`Send reply: ${d.length>120?d.slice(0,120)+"…":d}`,{threadId:t.activeThreadId});const p={id:Wr(),sender:"user",text:d,timestamp:Date.now(),threadId:t.activeThreadId??void 0};r({type:"ADD_THREAD_MESSAGE",message:p}),e({type:"user.message",sessionKey:h,text:d,userId:((b=t.user)==null?void 0:b.id)??"",messageId:p.id}),l("")};return m.jsxs("div",{className:"flex flex-col h-full",style:{background:"var(--bg-surface)"},children:[m.jsxs("div",{className:"flex items-center justify-between px-4 flex-shrink-0",style:{height:44,borderBottom:"1px solid var(--border)"},children:[m.jsx("h3",{className:"text-h1",style:{color:"var(--text-primary)"},children:"Thread"}),m.jsx("button",{onClick:()=>r({type:"CLOSE_THREAD"}),className:"p-1 rounded hover:bg-[--bg-hover] transition-colors",style:{color:"var(--text-secondary)"},"aria-label":"Close thread",children:m.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),m.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[c&&m.jsx("div",{className:"px-5 py-3",style:{borderBottom:"1px solid var(--border)"},children:m.jsxs("div",{className:"flex gap-2",children:[m.jsx("div",{className:"w-9 h-9 rounded flex-shrink-0 flex items-center justify-center text-white text-caption font-bold",style:{background:c.sender==="user"?"#9B59B6":"#2BAC76"},children:c.sender==="user"?"U":"A"}),m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsxs("div",{className:"flex items-baseline gap-2 mb-0.5",children:[m.jsx("span",{className:"text-h2",style:{color:"var(--text-primary)"},children:c.sender==="user"?"You":"OpenClaw Agent"}),m.jsx("span",{className:"text-caption",style:{color:"var(--text-secondary)"},children:new Date(c.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),m.jsx(Fh,{text:c.text,mediaUrl:c.mediaUrl})]})]})}),m.jsx("div",{className:"px-5 py-2",style:{borderBottom:"1px solid var(--border)"},children:m.jsxs("span",{className:"text-caption font-bold",style:{color:"var(--text-link)"},children:[t.threadMessages.length," ",t.threadMessages.length===1?"reply":"replies"]})}),t.threadMessages.map((d,h)=>{const p=h>0?t.threadMessages[h-1]:null,b=(p==null?void 0:p.sender)===d.sender&&d.timestamp-p.timestamp<3e5;return m.jsx("div",{className:"px-5 hover:bg-[--bg-hover] transition-colors",style:{paddingTop:b?2:8,paddingBottom:2},children:m.jsxs("div",{className:"flex gap-2",children:[m.jsx("div",{className:"flex-shrink-0",style:{width:36},children:!b&&m.jsx("div",{className:"w-9 h-9 rounded flex items-center justify-center text-white text-caption font-bold",style:{background:d.sender==="user"?"#9B59B6":"#2BAC76"},children:d.sender==="user"?"U":"A"})}),m.jsxs("div",{className:"flex-1 min-w-0",children:[!b&&m.jsxs("div",{className:"flex items-baseline gap-2 mb-0.5",children:[m.jsx("span",{className:"text-h2",style:{color:"var(--text-primary)"},children:d.sender==="user"?"You":"OpenClaw Agent"}),m.jsx("span",{className:"text-caption",style:{color:"var(--text-secondary)"},children:new Date(d.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),m.jsx(Fh,{text:d.text,mediaUrl:d.mediaUrl,a2ui:d.a2ui})]})]})},d.id)})]})," ",m.jsx("div",{className:"px-4 pb-3 pt-2",children:m.jsxs("div",{className:"rounded-md",style:{border:"1px solid var(--border)",background:"var(--bg-surface)"},children:[m.jsx("textarea",{value:a,onChange:d=>l(d.target.value),onKeyDown:d=>{d.key==="Enter"&&!d.shiftKey&&!d.nativeEvent.isComposing&&(d.preventDefault(),u())},placeholder:"Reply…",rows:1,className:"w-full px-3 py-2 text-body bg-transparent resize-none focus:outline-none placeholder:text-[--text-muted]",style:{color:"var(--text-primary)",minHeight:36}}),m.jsx("div",{className:"flex justify-end px-3 pb-2",children:m.jsx("button",{onClick:u,disabled:!a.trim(),className:"px-3 py-1 rounded-sm text-caption font-bold text-white disabled:opacity-40 disabled:cursor-not-allowed transition-colors",style:{background:"var(--bg-active)"},children:"Send"})})]})})]})}function BM(e){switch(e){case"ok":return"OK";case"error":return"ERR";case"skipped":return"SKIP";case"running":return"RUN";default:return e.toUpperCase()}}function UM(e){switch(e){case"ok":return{bg:"rgba(43,172,118,0.15)",fg:"var(--accent-green)"};case"error":return{bg:"rgba(224,30,90,0.15)",fg:"var(--accent-red)"};case"running":return{bg:"rgba(29,155,209,0.15)",fg:"var(--text-link)"};default:return{bg:"rgba(232,162,48,0.15)",fg:"var(--accent-yellow)"}}}function PM({jobs:e,selectedJobId:t,onSelectJob:r}){return e.length===0?m.jsx("div",{className:"flex items-center justify-center h-full",style:{background:"var(--bg-surface)"},children:m.jsxs("div",{className:"text-center p-4",children:[m.jsx("svg",{className:"w-8 h-8 mx-auto mb-2",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,style:{color:"var(--text-muted)"},children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),m.jsxs("p",{className:"text-tiny",style:{color:"var(--text-muted)"},children:["No runs yet.",m.jsx("br",{}),"Waiting for schedule..."]})]})}):m.jsxs("div",{className:"overflow-y-auto h-full",style:{background:"var(--bg-surface)"},children:[m.jsxs("div",{className:"px-3 py-2",style:{borderBottom:"1px solid var(--border)"},children:[m.jsx("span",{className:"text-tiny uppercase tracking-wider font-bold",style:{color:"var(--text-muted)"},children:"Job History"}),m.jsxs("span",{className:"text-tiny ml-1",style:{color:"var(--text-muted)"},children:["(",e.length,")"]})]}),e.map((a,l)=>{const c=UM(a.status),u=a.number||e.length-l;return m.jsxs("button",{onClick:()=>r(a.id),className:`w-full text-left px-3 py-2 hover:bg-[--bg-hover] transition-colors ${t===a.id?"bg-[--bg-hover]":""}`,style:{borderBottom:"1px solid var(--border)",...t===a.id?{borderLeft:"3px solid var(--bg-active)"}:{}},children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsxs("span",{className:"text-tiny font-mono",style:{color:"var(--text-muted)"},children:["#",u]}),m.jsx("span",{className:"text-tiny px-1.5 py-0.5 rounded-sm font-bold",style:{background:c.bg,color:c.fg},children:BM(a.status)})]}),m.jsxs("div",{className:"text-tiny mt-0.5",style:{color:"var(--text-muted)"},children:[a.time,a.durationMs!=null&&m.jsxs("span",{className:"ml-1",children:["(",(a.durationMs/1e3).toFixed(1),"s)"]})]}),a.summary&&m.jsx("div",{className:"text-caption mt-1 truncate",style:{color:"var(--text-secondary)"},children:a.summary})]},a.id)})]})}const HM=()=>{};var t1={};/**
85
- * @license
86
- * Copyright 2017 Google LLC
87
- *
88
- * Licensed under the Apache License, Version 2.0 (the "License");
89
- * you may not use this file except in compliance with the License.
90
- * You may obtain a copy of the License at
91
- *
92
- * http://www.apache.org/licenses/LICENSE-2.0
93
- *
94
- * Unless required by applicable law or agreed to in writing, software
95
- * distributed under the License is distributed on an "AS IS" BASIS,
96
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
97
- * See the License for the specific language governing permissions and
98
- * limitations under the License.
99
- */const G0=function(e){const t=[];let r=0;for(let a=0;a<e.length;a++){let l=e.charCodeAt(a);l<128?t[r++]=l:l<2048?(t[r++]=l>>6|192,t[r++]=l&63|128):(l&64512)===55296&&a+1<e.length&&(e.charCodeAt(a+1)&64512)===56320?(l=65536+((l&1023)<<10)+(e.charCodeAt(++a)&1023),t[r++]=l>>18|240,t[r++]=l>>12&63|128,t[r++]=l>>6&63|128,t[r++]=l&63|128):(t[r++]=l>>12|224,t[r++]=l>>6&63|128,t[r++]=l&63|128)}return t},FM=function(e){const t=[];let r=0,a=0;for(;r<e.length;){const l=e[r++];if(l<128)t[a++]=String.fromCharCode(l);else if(l>191&&l<224){const c=e[r++];t[a++]=String.fromCharCode((l&31)<<6|c&63)}else if(l>239&&l<365){const c=e[r++],u=e[r++],d=e[r++],h=((l&7)<<18|(c&63)<<12|(u&63)<<6|d&63)-65536;t[a++]=String.fromCharCode(55296+(h>>10)),t[a++]=String.fromCharCode(56320+(h&1023))}else{const c=e[r++],u=e[r++];t[a++]=String.fromCharCode((l&15)<<12|(c&63)<<6|u&63)}}return t.join("")},K0={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const r=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,a=[];for(let l=0;l<e.length;l+=3){const c=e[l],u=l+1<e.length,d=u?e[l+1]:0,h=l+2<e.length,p=h?e[l+2]:0,b=c>>2,y=(c&3)<<4|d>>4;let v=(d&15)<<2|p>>6,x=p&63;h||(x=64,u||(v=64)),a.push(r[b],r[y],r[v],r[x])}return a.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(G0(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):FM(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const r=t?this.charToByteMapWebSafe_:this.charToByteMap_,a=[];for(let l=0;l<e.length;){const c=r[e.charAt(l++)],d=l<e.length?r[e.charAt(l)]:0;++l;const p=l<e.length?r[e.charAt(l)]:64;++l;const y=l<e.length?r[e.charAt(l)]:64;if(++l,c==null||d==null||p==null||y==null)throw new $M;const v=c<<2|d>>4;if(a.push(v),p!==64){const x=d<<4&240|p>>2;if(a.push(x),y!==64){const _=p<<6&192|y;a.push(_)}}}return a},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class $M extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const GM=function(e){const t=G0(e);return K0.encodeByteArray(t,!0)},q0=function(e){return GM(e).replace(/\./g,"")},V0=function(e){try{return K0.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};/**
100
- * @license
101
- * Copyright 2022 Google LLC
102
- *
103
- * Licensed under the Apache License, Version 2.0 (the "License");
104
- * you may not use this file except in compliance with the License.
105
- * You may obtain a copy of the License at
106
- *
107
- * http://www.apache.org/licenses/LICENSE-2.0
108
- *
109
- * Unless required by applicable law or agreed to in writing, software
110
- * distributed under the License is distributed on an "AS IS" BASIS,
111
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
112
- * See the License for the specific language governing permissions and
113
- * limitations under the License.
114
- */function KM(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/**
115
- * @license
116
- * Copyright 2022 Google LLC
117
- *
118
- * Licensed under the Apache License, Version 2.0 (the "License");
119
- * you may not use this file except in compliance with the License.
120
- * You may obtain a copy of the License at
121
- *
122
- * http://www.apache.org/licenses/LICENSE-2.0
123
- *
124
- * Unless required by applicable law or agreed to in writing, software
125
- * distributed under the License is distributed on an "AS IS" BASIS,
126
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
127
- * See the License for the specific language governing permissions and
128
- * limitations under the License.
129
- */const qM=()=>KM().__FIREBASE_DEFAULTS__,VM=()=>{if(typeof process>"u"||typeof t1>"u")return;const e=t1.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},YM=()=>{if(typeof document>"u")return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const t=e&&V0(e[1]);return t&&JSON.parse(t)},kp=()=>{try{return HM()||qM()||VM()||YM()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},WM=e=>{var t,r;return(r=(t=kp())==null?void 0:t.emulatorHosts)==null?void 0:r[e]},Y0=()=>{var e;return(e=kp())==null?void 0:e.config},W0=e=>{var t;return(t=kp())==null?void 0:t[`_${e}`]};/**
130
- * @license
131
- * Copyright 2017 Google LLC
132
- *
133
- * Licensed under the Apache License, Version 2.0 (the "License");
134
- * you may not use this file except in compliance with the License.
135
- * You may obtain a copy of the License at
136
- *
137
- * http://www.apache.org/licenses/LICENSE-2.0
138
- *
139
- * Unless required by applicable law or agreed to in writing, software
140
- * distributed under the License is distributed on an "AS IS" BASIS,
141
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
142
- * See the License for the specific language governing permissions and
143
- * limitations under the License.
144
- */class XM{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((t,r)=>{this.resolve=t,this.reject=r})}wrapCallback(t){return(r,a)=>{r?this.reject(r):this.resolve(a),typeof t=="function"&&(this.promise.catch(()=>{}),t.length===1?t(r):t(r,a))}}}/**
145
- * @license
146
- * Copyright 2025 Google LLC
147
- *
148
- * Licensed under the Apache License, Version 2.0 (the "License");
149
- * you may not use this file except in compliance with the License.
150
- * You may obtain a copy of the License at
151
- *
152
- * http://www.apache.org/licenses/LICENSE-2.0
153
- *
154
- * Unless required by applicable law or agreed to in writing, software
155
- * distributed under the License is distributed on an "AS IS" BASIS,
156
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
157
- * See the License for the specific language governing permissions and
158
- * limitations under the License.
159
- */function Mu(e){try{return(e.startsWith("http://")||e.startsWith("https://")?new URL(e).hostname:e).endsWith(".cloudworkstations.dev")}catch{return!1}}async function ZM(e){return(await fetch(e,{credentials:"include"})).ok}const Ql={};function QM(){const e={prod:[],emulator:[]};for(const t of Object.keys(Ql))Ql[t]?e.emulator.push(t):e.prod.push(t);return e}function JM(e){let t=document.getElementById(e),r=!1;return t||(t=document.createElement("div"),t.setAttribute("id",e),r=!0),{created:r,element:t}}let n1=!1;function e5(e,t){if(typeof window>"u"||typeof document>"u"||!Mu(window.location.host)||Ql[e]===t||Ql[e]||n1)return;Ql[e]=t;function r(v){return`__firebase__banner__${v}`}const a="__firebase__banner",c=QM().prod.length>0;function u(){const v=document.getElementById(a);v&&v.remove()}function d(v){v.style.display="flex",v.style.background="#7faaf0",v.style.position="fixed",v.style.bottom="5px",v.style.left="5px",v.style.padding=".5em",v.style.borderRadius="5px",v.style.alignItems="center"}function h(v,x){v.setAttribute("width","24"),v.setAttribute("id",x),v.setAttribute("height","24"),v.setAttribute("viewBox","0 0 24 24"),v.setAttribute("fill","none"),v.style.marginLeft="-6px"}function p(){const v=document.createElement("span");return v.style.cursor="pointer",v.style.marginLeft="16px",v.style.fontSize="24px",v.innerHTML=" &times;",v.onclick=()=>{n1=!0,u()},v}function b(v,x){v.setAttribute("id",x),v.innerText="Learn more",v.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",v.setAttribute("target","__blank"),v.style.paddingLeft="5px",v.style.textDecoration="underline"}function y(){const v=JM(a),x=r("text"),_=document.getElementById(x)||document.createElement("span"),T=r("learnmore"),C=document.getElementById(T)||document.createElement("a"),S=r("preprendIcon"),R=document.getElementById(S)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(v.created){const M=v.element;d(M),b(C,T);const A=p();h(R,S),M.append(R,_,C,A),document.body.appendChild(M)}c?(_.innerText="Preview backend disconnected.",R.innerHTML=`<g clip-path="url(#clip0_6013_33858)">
160
- <path d="M4.8 17.6L12 5.6L19.2 17.6H4.8ZM6.91667 16.4H17.0833L12 7.93333L6.91667 16.4ZM12 15.6C12.1667 15.6 12.3056 15.5444 12.4167 15.4333C12.5389 15.3111 12.6 15.1667 12.6 15C12.6 14.8333 12.5389 14.6944 12.4167 14.5833C12.3056 14.4611 12.1667 14.4 12 14.4C11.8333 14.4 11.6889 14.4611 11.5667 14.5833C11.4556 14.6944 11.4 14.8333 11.4 15C11.4 15.1667 11.4556 15.3111 11.5667 15.4333C11.6889 15.5444 11.8333 15.6 12 15.6ZM11.4 13.6H12.6V10.4H11.4V13.6Z" fill="#212121"/>
161
- </g>
162
- <defs>
163
- <clipPath id="clip0_6013_33858">
164
- <rect width="24" height="24" fill="white"/>
165
- </clipPath>
166
- </defs>`):(R.innerHTML=`<g clip-path="url(#clip0_6083_34804)">
167
- <path d="M11.4 15.2H12.6V11.2H11.4V15.2ZM12 10C12.1667 10 12.3056 9.94444 12.4167 9.83333C12.5389 9.71111 12.6 9.56667 12.6 9.4C12.6 9.23333 12.5389 9.09444 12.4167 8.98333C12.3056 8.86111 12.1667 8.8 12 8.8C11.8333 8.8 11.6889 8.86111 11.5667 8.98333C11.4556 9.09444 11.4 9.23333 11.4 9.4C11.4 9.56667 11.4556 9.71111 11.5667 9.83333C11.6889 9.94444 11.8333 10 12 10ZM12 18.4C11.1222 18.4 10.2944 18.2333 9.51667 17.9C8.73889 17.5667 8.05556 17.1111 7.46667 16.5333C6.88889 15.9444 6.43333 15.2611 6.1 14.4833C5.76667 13.7056 5.6 12.8778 5.6 12C5.6 11.1111 5.76667 10.2833 6.1 9.51667C6.43333 8.73889 6.88889 8.06111 7.46667 7.48333C8.05556 6.89444 8.73889 6.43333 9.51667 6.1C10.2944 5.76667 11.1222 5.6 12 5.6C12.8889 5.6 13.7167 5.76667 14.4833 6.1C15.2611 6.43333 15.9389 6.89444 16.5167 7.48333C17.1056 8.06111 17.5667 8.73889 17.9 9.51667C18.2333 10.2833 18.4 11.1111 18.4 12C18.4 12.8778 18.2333 13.7056 17.9 14.4833C17.5667 15.2611 17.1056 15.9444 16.5167 16.5333C15.9389 17.1111 15.2611 17.5667 14.4833 17.9C13.7167 18.2333 12.8889 18.4 12 18.4ZM12 17.2C13.4444 17.2 14.6722 16.6944 15.6833 15.6833C16.6944 14.6722 17.2 13.4444 17.2 12C17.2 10.5556 16.6944 9.32778 15.6833 8.31667C14.6722 7.30555 13.4444 6.8 12 6.8C10.5556 6.8 9.32778 7.30555 8.31667 8.31667C7.30556 9.32778 6.8 10.5556 6.8 12C6.8 13.4444 7.30556 14.6722 8.31667 15.6833C9.32778 16.6944 10.5556 17.2 12 17.2Z" fill="#212121"/>
168
- </g>
169
- <defs>
170
- <clipPath id="clip0_6083_34804">
171
- <rect width="24" height="24" fill="white"/>
172
- </clipPath>
173
- </defs>`,_.innerText="Preview backend running in this workspace."),_.setAttribute("id",x)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",y):y()}/**
174
- * @license
175
- * Copyright 2017 Google LLC
176
- *
177
- * Licensed under the Apache License, Version 2.0 (the "License");
178
- * you may not use this file except in compliance with the License.
179
- * You may obtain a copy of the License at
180
- *
181
- * http://www.apache.org/licenses/LICENSE-2.0
182
- *
183
- * Unless required by applicable law or agreed to in writing, software
184
- * distributed under the License is distributed on an "AS IS" BASIS,
185
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
186
- * See the License for the specific language governing permissions and
187
- * limitations under the License.
188
- */function pn(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function t5(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(pn())}function n5(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function r5(){const e=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof e=="object"&&e.id!==void 0}function i5(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function a5(){const e=pn();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function s5(){try{return typeof indexedDB=="object"}catch{return!1}}function l5(){return new Promise((e,t)=>{try{let r=!0;const a="validate-browser-context-for-indexeddb-analytics-module",l=self.indexedDB.open(a);l.onsuccess=()=>{l.result.close(),r||self.indexedDB.deleteDatabase(a),e(!0)},l.onupgradeneeded=()=>{r=!1},l.onerror=()=>{var c;t(((c=l.error)==null?void 0:c.message)||"")}}catch(r){t(r)}})}/**
189
- * @license
190
- * Copyright 2017 Google LLC
191
- *
192
- * Licensed under the Apache License, Version 2.0 (the "License");
193
- * you may not use this file except in compliance with the License.
194
- * You may obtain a copy of the License at
195
- *
196
- * http://www.apache.org/licenses/LICENSE-2.0
197
- *
198
- * Unless required by applicable law or agreed to in writing, software
199
- * distributed under the License is distributed on an "AS IS" BASIS,
200
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
- * See the License for the specific language governing permissions and
202
- * limitations under the License.
203
- */const o5="FirebaseError";class Fi extends Error{constructor(t,r,a){super(r),this.code=t,this.customData=a,this.name=o5,Object.setPrototypeOf(this,Fi.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,go.prototype.create)}}class go{constructor(t,r,a){this.service=t,this.serviceName=r,this.errors=a}create(t,...r){const a=r[0]||{},l=`${this.service}/${t}`,c=this.errors[t],u=c?c5(c,a):"Error",d=`${this.serviceName}: ${u} (${l}).`;return new Fi(l,d,a)}}function c5(e,t){return e.replace(u5,(r,a)=>{const l=t[a];return l!=null?String(l):`<${a}?>`})}const u5=/\{\$([^}]+)}/g;function d5(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function Os(e,t){if(e===t)return!0;const r=Object.keys(e),a=Object.keys(t);for(const l of r){if(!a.includes(l))return!1;const c=e[l],u=t[l];if(r1(c)&&r1(u)){if(!Os(c,u))return!1}else if(c!==u)return!1}for(const l of a)if(!r.includes(l))return!1;return!0}function r1(e){return e!==null&&typeof e=="object"}/**
204
- * @license
205
- * Copyright 2017 Google LLC
206
- *
207
- * Licensed under the Apache License, Version 2.0 (the "License");
208
- * you may not use this file except in compliance with the License.
209
- * You may obtain a copy of the License at
210
- *
211
- * http://www.apache.org/licenses/LICENSE-2.0
212
- *
213
- * Unless required by applicable law or agreed to in writing, software
214
- * distributed under the License is distributed on an "AS IS" BASIS,
215
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
216
- * See the License for the specific language governing permissions and
217
- * limitations under the License.
218
- */function bo(e){const t=[];for(const[r,a]of Object.entries(e))Array.isArray(a)?a.forEach(l=>{t.push(encodeURIComponent(r)+"="+encodeURIComponent(l))}):t.push(encodeURIComponent(r)+"="+encodeURIComponent(a));return t.length?"&"+t.join("&"):""}function f5(e,t){const r=new h5(e,t);return r.subscribe.bind(r)}class h5{constructor(t,r){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=r,this.task.then(()=>{t(this)}).catch(a=>{this.error(a)})}next(t){this.forEachObserver(r=>{r.next(t)})}error(t){this.forEachObserver(r=>{r.error(t)}),this.close(t)}complete(){this.forEachObserver(t=>{t.complete()}),this.close()}subscribe(t,r,a){let l;if(t===void 0&&r===void 0&&a===void 0)throw new Error("Missing Observer.");p5(t,["next","error","complete"])?l=t:l={next:t,error:r,complete:a},l.next===void 0&&(l.next=hh),l.error===void 0&&(l.error=hh),l.complete===void 0&&(l.complete=hh);const c=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?l.error(this.finalError):l.complete()}catch{}}),this.observers.push(l),c}unsubscribeOne(t){this.observers===void 0||this.observers[t]===void 0||(delete this.observers[t],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(t){if(!this.finalized)for(let r=0;r<this.observers.length;r++)this.sendOne(r,t)}sendOne(t,r){this.task.then(()=>{if(this.observers!==void 0&&this.observers[t]!==void 0)try{r(this.observers[t])}catch(a){typeof console<"u"&&console.error&&console.error(a)}})}close(t){this.finalized||(this.finalized=!0,t!==void 0&&(this.finalError=t),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function p5(e,t){if(typeof e!="object"||e===null)return!1;for(const r of t)if(r in e&&typeof e[r]=="function")return!0;return!1}function hh(){}/**
219
- * @license
220
- * Copyright 2021 Google LLC
221
- *
222
- * Licensed under the Apache License, Version 2.0 (the "License");
223
- * you may not use this file except in compliance with the License.
224
- * You may obtain a copy of the License at
225
- *
226
- * http://www.apache.org/licenses/LICENSE-2.0
227
- *
228
- * Unless required by applicable law or agreed to in writing, software
229
- * distributed under the License is distributed on an "AS IS" BASIS,
230
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
231
- * See the License for the specific language governing permissions and
232
- * limitations under the License.
233
- */function Ls(e){return e&&e._delegate?e._delegate:e}class Rs{constructor(t,r,a){this.name=t,this.instanceFactory=r,this.type=a,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,this}}/**
234
- * @license
235
- * Copyright 2019 Google LLC
236
- *
237
- * Licensed under the Apache License, Version 2.0 (the "License");
238
- * you may not use this file except in compliance with the License.
239
- * You may obtain a copy of the License at
240
- *
241
- * http://www.apache.org/licenses/LICENSE-2.0
242
- *
243
- * Unless required by applicable law or agreed to in writing, software
244
- * distributed under the License is distributed on an "AS IS" BASIS,
245
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
246
- * See the License for the specific language governing permissions and
247
- * limitations under the License.
248
- */const pa="[DEFAULT]";/**
249
- * @license
250
- * Copyright 2019 Google LLC
251
- *
252
- * Licensed under the Apache License, Version 2.0 (the "License");
253
- * you may not use this file except in compliance with the License.
254
- * You may obtain a copy of the License at
255
- *
256
- * http://www.apache.org/licenses/LICENSE-2.0
257
- *
258
- * Unless required by applicable law or agreed to in writing, software
259
- * distributed under the License is distributed on an "AS IS" BASIS,
260
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
261
- * See the License for the specific language governing permissions and
262
- * limitations under the License.
263
- */class m5{constructor(t,r){this.name=t,this.container=r,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(t){const r=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(r)){const a=new XM;if(this.instancesDeferred.set(r,a),this.isInitialized(r)||this.shouldAutoInitialize())try{const l=this.getOrInitializeService({instanceIdentifier:r});l&&a.resolve(l)}catch{}}return this.instancesDeferred.get(r).promise}getImmediate(t){const r=this.normalizeInstanceIdentifier(t==null?void 0:t.identifier),a=(t==null?void 0:t.optional)??!1;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(l){if(a)return null;throw l}else{if(a)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(t){if(t.name!==this.name)throw Error(`Mismatching Component ${t.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=t,!!this.shouldAutoInitialize()){if(b5(t))try{this.getOrInitializeService({instanceIdentifier:pa})}catch{}for(const[r,a]of this.instancesDeferred.entries()){const l=this.normalizeInstanceIdentifier(r);try{const c=this.getOrInitializeService({instanceIdentifier:l});a.resolve(c)}catch{}}}}clearInstance(t=pa){this.instancesDeferred.delete(t),this.instancesOptions.delete(t),this.instances.delete(t)}async delete(){const t=Array.from(this.instances.values());await Promise.all([...t.filter(r=>"INTERNAL"in r).map(r=>r.INTERNAL.delete()),...t.filter(r=>"_delete"in r).map(r=>r._delete())])}isComponentSet(){return this.component!=null}isInitialized(t=pa){return this.instances.has(t)}getOptions(t=pa){return this.instancesOptions.get(t)||{}}initialize(t={}){const{options:r={}}=t,a=this.normalizeInstanceIdentifier(t.instanceIdentifier);if(this.isInitialized(a))throw Error(`${this.name}(${a}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const l=this.getOrInitializeService({instanceIdentifier:a,options:r});for(const[c,u]of this.instancesDeferred.entries()){const d=this.normalizeInstanceIdentifier(c);a===d&&u.resolve(l)}return l}onInit(t,r){const a=this.normalizeInstanceIdentifier(r),l=this.onInitCallbacks.get(a)??new Set;l.add(t),this.onInitCallbacks.set(a,l);const c=this.instances.get(a);return c&&t(c,a),()=>{l.delete(t)}}invokeOnInitCallbacks(t,r){const a=this.onInitCallbacks.get(r);if(a)for(const l of a)try{l(t,r)}catch{}}getOrInitializeService({instanceIdentifier:t,options:r={}}){let a=this.instances.get(t);if(!a&&this.component&&(a=this.component.instanceFactory(this.container,{instanceIdentifier:g5(t),options:r}),this.instances.set(t,a),this.instancesOptions.set(t,r),this.invokeOnInitCallbacks(a,t),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,t,a)}catch{}return a||null}normalizeInstanceIdentifier(t=pa){return this.component?this.component.multipleInstances?t:pa:t}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function g5(e){return e===pa?void 0:e}function b5(e){return e.instantiationMode==="EAGER"}/**
264
- * @license
265
- * Copyright 2019 Google LLC
266
- *
267
- * Licensed under the Apache License, Version 2.0 (the "License");
268
- * you may not use this file except in compliance with the License.
269
- * You may obtain a copy of the License at
270
- *
271
- * http://www.apache.org/licenses/LICENSE-2.0
272
- *
273
- * Unless required by applicable law or agreed to in writing, software
274
- * distributed under the License is distributed on an "AS IS" BASIS,
275
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
276
- * See the License for the specific language governing permissions and
277
- * limitations under the License.
278
- */class y5{constructor(t){this.name=t,this.providers=new Map}addComponent(t){const r=this.getProvider(t.name);if(r.isComponentSet())throw new Error(`Component ${t.name} has already been registered with ${this.name}`);r.setComponent(t)}addOrOverwriteComponent(t){this.getProvider(t.name).isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)}getProvider(t){if(this.providers.has(t))return this.providers.get(t);const r=new m5(t,this);return this.providers.set(t,r),r}getProviders(){return Array.from(this.providers.values())}}/**
279
- * @license
280
- * Copyright 2017 Google LLC
281
- *
282
- * Licensed under the Apache License, Version 2.0 (the "License");
283
- * you may not use this file except in compliance with the License.
284
- * You may obtain a copy of the License at
285
- *
286
- * http://www.apache.org/licenses/LICENSE-2.0
287
- *
288
- * Unless required by applicable law or agreed to in writing, software
289
- * distributed under the License is distributed on an "AS IS" BASIS,
290
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
291
- * See the License for the specific language governing permissions and
292
- * limitations under the License.
293
- */var mt;(function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"})(mt||(mt={}));const v5={debug:mt.DEBUG,verbose:mt.VERBOSE,info:mt.INFO,warn:mt.WARN,error:mt.ERROR,silent:mt.SILENT},x5=mt.INFO,E5={[mt.DEBUG]:"log",[mt.VERBOSE]:"log",[mt.INFO]:"info",[mt.WARN]:"warn",[mt.ERROR]:"error"},_5=(e,t,...r)=>{if(t<e.logLevel)return;const a=new Date().toISOString(),l=E5[t];if(l)console[l](`[${a}] ${e.name}:`,...r);else throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`)};class X0{constructor(t){this.name=t,this._logLevel=x5,this._logHandler=_5,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in mt))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel=typeof t=="string"?v5[t]:t}get logHandler(){return this._logHandler}set logHandler(t){if(typeof t!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}get userLogHandler(){return this._userLogHandler}set userLogHandler(t){this._userLogHandler=t}debug(...t){this._userLogHandler&&this._userLogHandler(this,mt.DEBUG,...t),this._logHandler(this,mt.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,mt.VERBOSE,...t),this._logHandler(this,mt.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,mt.INFO,...t),this._logHandler(this,mt.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,mt.WARN,...t),this._logHandler(this,mt.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,mt.ERROR,...t),this._logHandler(this,mt.ERROR,...t)}}const S5=(e,t)=>t.some(r=>e instanceof r);let i1,a1;function w5(){return i1||(i1=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function k5(){return a1||(a1=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Z0=new WeakMap,$h=new WeakMap,Q0=new WeakMap,ph=new WeakMap,Tp=new WeakMap;function T5(e){const t=new Promise((r,a)=>{const l=()=>{e.removeEventListener("success",c),e.removeEventListener("error",u)},c=()=>{r(Ui(e.result)),l()},u=()=>{a(e.error),l()};e.addEventListener("success",c),e.addEventListener("error",u)});return t.then(r=>{r instanceof IDBCursor&&Z0.set(r,e)}).catch(()=>{}),Tp.set(t,e),t}function N5(e){if($h.has(e))return;const t=new Promise((r,a)=>{const l=()=>{e.removeEventListener("complete",c),e.removeEventListener("error",u),e.removeEventListener("abort",u)},c=()=>{r(),l()},u=()=>{a(e.error||new DOMException("AbortError","AbortError")),l()};e.addEventListener("complete",c),e.addEventListener("error",u),e.addEventListener("abort",u)});$h.set(e,t)}let Gh={get(e,t,r){if(e instanceof IDBTransaction){if(t==="done")return $h.get(e);if(t==="objectStoreNames")return e.objectStoreNames||Q0.get(e);if(t==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return Ui(e[t])},set(e,t,r){return e[t]=r,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function C5(e){Gh=e(Gh)}function A5(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...r){const a=e.call(mh(this),t,...r);return Q0.set(a,t.sort?t.sort():[t]),Ui(a)}:k5().includes(e)?function(...t){return e.apply(mh(this),t),Ui(Z0.get(this))}:function(...t){return Ui(e.apply(mh(this),t))}}function O5(e){return typeof e=="function"?A5(e):(e instanceof IDBTransaction&&N5(e),S5(e,w5())?new Proxy(e,Gh):e)}function Ui(e){if(e instanceof IDBRequest)return T5(e);if(ph.has(e))return ph.get(e);const t=O5(e);return t!==e&&(ph.set(e,t),Tp.set(t,e)),t}const mh=e=>Tp.get(e);function R5(e,t,{blocked:r,upgrade:a,blocking:l,terminated:c}={}){const u=indexedDB.open(e,t),d=Ui(u);return a&&u.addEventListener("upgradeneeded",h=>{a(Ui(u.result),h.oldVersion,h.newVersion,Ui(u.transaction),h)}),r&&u.addEventListener("blocked",h=>r(h.oldVersion,h.newVersion,h)),d.then(h=>{c&&h.addEventListener("close",()=>c()),l&&h.addEventListener("versionchange",p=>l(p.oldVersion,p.newVersion,p))}).catch(()=>{}),d}const M5=["get","getKey","getAll","getAllKeys","count"],I5=["put","add","delete","clear"],gh=new Map;function s1(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(gh.get(t))return gh.get(t);const r=t.replace(/FromIndex$/,""),a=t!==r,l=I5.includes(r);if(!(r in(a?IDBIndex:IDBObjectStore).prototype)||!(l||M5.includes(r)))return;const c=async function(u,...d){const h=this.transaction(u,l?"readwrite":"readonly");let p=h.store;return a&&(p=p.index(d.shift())),(await Promise.all([p[r](...d),l&&h.done]))[0]};return gh.set(t,c),c}C5(e=>({...e,get:(t,r,a)=>s1(t,r)||e.get(t,r,a),has:(t,r)=>!!s1(t,r)||e.has(t,r)}));/**
294
- * @license
295
- * Copyright 2019 Google LLC
296
- *
297
- * Licensed under the Apache License, Version 2.0 (the "License");
298
- * you may not use this file except in compliance with the License.
299
- * You may obtain a copy of the License at
300
- *
301
- * http://www.apache.org/licenses/LICENSE-2.0
302
- *
303
- * Unless required by applicable law or agreed to in writing, software
304
- * distributed under the License is distributed on an "AS IS" BASIS,
305
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
306
- * See the License for the specific language governing permissions and
307
- * limitations under the License.
308
- */class D5{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map(r=>{if(L5(r)){const a=r.getImmediate();return`${a.library}/${a.version}`}else return null}).filter(r=>r).join(" ")}}function L5(e){const t=e.getComponent();return(t==null?void 0:t.type)==="VERSION"}const Kh="@firebase/app",l1="0.14.8";/**
309
- * @license
310
- * Copyright 2019 Google LLC
311
- *
312
- * Licensed under the Apache License, Version 2.0 (the "License");
313
- * you may not use this file except in compliance with the License.
314
- * You may obtain a copy of the License at
315
- *
316
- * http://www.apache.org/licenses/LICENSE-2.0
317
- *
318
- * Unless required by applicable law or agreed to in writing, software
319
- * distributed under the License is distributed on an "AS IS" BASIS,
320
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
321
- * See the License for the specific language governing permissions and
322
- * limitations under the License.
323
- */const Jr=new X0("@firebase/app"),z5="@firebase/app-compat",j5="@firebase/analytics-compat",B5="@firebase/analytics",U5="@firebase/app-check-compat",P5="@firebase/app-check",H5="@firebase/auth",F5="@firebase/auth-compat",$5="@firebase/database",G5="@firebase/data-connect",K5="@firebase/database-compat",q5="@firebase/functions",V5="@firebase/functions-compat",Y5="@firebase/installations",W5="@firebase/installations-compat",X5="@firebase/messaging",Z5="@firebase/messaging-compat",Q5="@firebase/performance",J5="@firebase/performance-compat",eI="@firebase/remote-config",tI="@firebase/remote-config-compat",nI="@firebase/storage",rI="@firebase/storage-compat",iI="@firebase/firestore",aI="@firebase/ai",sI="@firebase/firestore-compat",lI="firebase",oI="12.9.0";/**
324
- * @license
325
- * Copyright 2019 Google LLC
326
- *
327
- * Licensed under the Apache License, Version 2.0 (the "License");
328
- * you may not use this file except in compliance with the License.
329
- * You may obtain a copy of the License at
330
- *
331
- * http://www.apache.org/licenses/LICENSE-2.0
332
- *
333
- * Unless required by applicable law or agreed to in writing, software
334
- * distributed under the License is distributed on an "AS IS" BASIS,
335
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
336
- * See the License for the specific language governing permissions and
337
- * limitations under the License.
338
- */const qh="[DEFAULT]",cI={[Kh]:"fire-core",[z5]:"fire-core-compat",[B5]:"fire-analytics",[j5]:"fire-analytics-compat",[P5]:"fire-app-check",[U5]:"fire-app-check-compat",[H5]:"fire-auth",[F5]:"fire-auth-compat",[$5]:"fire-rtdb",[G5]:"fire-data-connect",[K5]:"fire-rtdb-compat",[q5]:"fire-fn",[V5]:"fire-fn-compat",[Y5]:"fire-iid",[W5]:"fire-iid-compat",[X5]:"fire-fcm",[Z5]:"fire-fcm-compat",[Q5]:"fire-perf",[J5]:"fire-perf-compat",[eI]:"fire-rc",[tI]:"fire-rc-compat",[nI]:"fire-gcs",[rI]:"fire-gcs-compat",[iI]:"fire-fst",[sI]:"fire-fst-compat",[aI]:"fire-vertex","fire-js":"fire-js",[lI]:"fire-js-all"};/**
339
- * @license
340
- * Copyright 2019 Google LLC
341
- *
342
- * Licensed under the Apache License, Version 2.0 (the "License");
343
- * you may not use this file except in compliance with the License.
344
- * You may obtain a copy of the License at
345
- *
346
- * http://www.apache.org/licenses/LICENSE-2.0
347
- *
348
- * Unless required by applicable law or agreed to in writing, software
349
- * distributed under the License is distributed on an "AS IS" BASIS,
350
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
351
- * See the License for the specific language governing permissions and
352
- * limitations under the License.
353
- */const gu=new Map,uI=new Map,Vh=new Map;function o1(e,t){try{e.container.addComponent(t)}catch(r){Jr.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,r)}}function so(e){const t=e.name;if(Vh.has(t))return Jr.debug(`There were multiple attempts to register component ${t}.`),!1;Vh.set(t,e);for(const r of gu.values())o1(r,e);for(const r of uI.values())o1(r,e);return!0}function J0(e,t){const r=e.container.getProvider("heartbeat").getImmediate({optional:!0});return r&&r.triggerHeartbeat(),e.container.getProvider(t)}function xr(e){return e==null?!1:e.settings!==void 0}/**
354
- * @license
355
- * Copyright 2019 Google LLC
356
- *
357
- * Licensed under the Apache License, Version 2.0 (the "License");
358
- * you may not use this file except in compliance with the License.
359
- * You may obtain a copy of the License at
360
- *
361
- * http://www.apache.org/licenses/LICENSE-2.0
362
- *
363
- * Unless required by applicable law or agreed to in writing, software
364
- * distributed under the License is distributed on an "AS IS" BASIS,
365
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
366
- * See the License for the specific language governing permissions and
367
- * limitations under the License.
368
- */const dI={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},Pi=new go("app","Firebase",dI);/**
369
- * @license
370
- * Copyright 2019 Google LLC
371
- *
372
- * Licensed under the Apache License, Version 2.0 (the "License");
373
- * you may not use this file except in compliance with the License.
374
- * You may obtain a copy of the License at
375
- *
376
- * http://www.apache.org/licenses/LICENSE-2.0
377
- *
378
- * Unless required by applicable law or agreed to in writing, software
379
- * distributed under the License is distributed on an "AS IS" BASIS,
380
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
381
- * See the License for the specific language governing permissions and
382
- * limitations under the License.
383
- */class fI{constructor(t,r,a){this._isDeleted=!1,this._options={...t},this._config={...r},this._name=r.name,this._automaticDataCollectionEnabled=r.automaticDataCollectionEnabled,this._container=a,this.container.addComponent(new Rs("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(t){this.checkDestroyed(),this._automaticDataCollectionEnabled=t}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(t){this._isDeleted=t}checkDestroyed(){if(this.isDeleted)throw Pi.create("app-deleted",{appName:this._name})}}/**
384
- * @license
385
- * Copyright 2019 Google LLC
386
- *
387
- * Licensed under the Apache License, Version 2.0 (the "License");
388
- * you may not use this file except in compliance with the License.
389
- * You may obtain a copy of the License at
390
- *
391
- * http://www.apache.org/licenses/LICENSE-2.0
392
- *
393
- * Unless required by applicable law or agreed to in writing, software
394
- * distributed under the License is distributed on an "AS IS" BASIS,
395
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
396
- * See the License for the specific language governing permissions and
397
- * limitations under the License.
398
- */const yo=oI;function eE(e,t={}){let r=e;typeof t!="object"&&(t={name:t});const a={name:qh,automaticDataCollectionEnabled:!0,...t},l=a.name;if(typeof l!="string"||!l)throw Pi.create("bad-app-name",{appName:String(l)});if(r||(r=Y0()),!r)throw Pi.create("no-options");const c=gu.get(l);if(c){if(Os(r,c.options)&&Os(a,c.config))return c;throw Pi.create("duplicate-app",{appName:l})}const u=new y5(l);for(const h of Vh.values())u.addComponent(h);const d=new fI(r,a,u);return gu.set(l,d),d}function hI(e=qh){const t=gu.get(e);if(!t&&e===qh&&Y0())return eE();if(!t)throw Pi.create("no-app",{appName:e});return t}function ws(e,t,r){let a=cI[e]??e;r&&(a+=`-${r}`);const l=a.match(/\s|\//),c=t.match(/\s|\//);if(l||c){const u=[`Unable to register library "${a}" with version "${t}":`];l&&u.push(`library name "${a}" contains illegal characters (whitespace or "/")`),l&&c&&u.push("and"),c&&u.push(`version name "${t}" contains illegal characters (whitespace or "/")`),Jr.warn(u.join(" "));return}so(new Rs(`${a}-version`,()=>({library:a,version:t}),"VERSION"))}/**
399
- * @license
400
- * Copyright 2021 Google LLC
401
- *
402
- * Licensed under the Apache License, Version 2.0 (the "License");
403
- * you may not use this file except in compliance with the License.
404
- * You may obtain a copy of the License at
405
- *
406
- * http://www.apache.org/licenses/LICENSE-2.0
407
- *
408
- * Unless required by applicable law or agreed to in writing, software
409
- * distributed under the License is distributed on an "AS IS" BASIS,
410
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
411
- * See the License for the specific language governing permissions and
412
- * limitations under the License.
413
- */const pI="firebase-heartbeat-database",mI=1,lo="firebase-heartbeat-store";let bh=null;function tE(){return bh||(bh=R5(pI,mI,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(lo)}catch(r){console.warn(r)}}}}).catch(e=>{throw Pi.create("idb-open",{originalErrorMessage:e.message})})),bh}async function gI(e){try{const r=(await tE()).transaction(lo),a=await r.objectStore(lo).get(nE(e));return await r.done,a}catch(t){if(t instanceof Fi)Jr.warn(t.message);else{const r=Pi.create("idb-get",{originalErrorMessage:t==null?void 0:t.message});Jr.warn(r.message)}}}async function c1(e,t){try{const a=(await tE()).transaction(lo,"readwrite");await a.objectStore(lo).put(t,nE(e)),await a.done}catch(r){if(r instanceof Fi)Jr.warn(r.message);else{const a=Pi.create("idb-set",{originalErrorMessage:r==null?void 0:r.message});Jr.warn(a.message)}}}function nE(e){return`${e.name}!${e.options.appId}`}/**
414
- * @license
415
- * Copyright 2021 Google LLC
416
- *
417
- * Licensed under the Apache License, Version 2.0 (the "License");
418
- * you may not use this file except in compliance with the License.
419
- * You may obtain a copy of the License at
420
- *
421
- * http://www.apache.org/licenses/LICENSE-2.0
422
- *
423
- * Unless required by applicable law or agreed to in writing, software
424
- * distributed under the License is distributed on an "AS IS" BASIS,
425
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
426
- * See the License for the specific language governing permissions and
427
- * limitations under the License.
428
- */const bI=1024,yI=30;class vI{constructor(t){this.container=t,this._heartbeatsCache=null;const r=this.container.getProvider("app").getImmediate();this._storage=new EI(r),this._heartbeatsCachePromise=this._storage.read().then(a=>(this._heartbeatsCache=a,a))}async triggerHeartbeat(){var t,r;try{const l=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),c=u1();if(((t=this._heartbeatsCache)==null?void 0:t.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((r=this._heartbeatsCache)==null?void 0:r.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===c||this._heartbeatsCache.heartbeats.some(u=>u.date===c))return;if(this._heartbeatsCache.heartbeats.push({date:c,agent:l}),this._heartbeatsCache.heartbeats.length>yI){const u=_I(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(u,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(a){Jr.warn(a)}}async getHeartbeatsHeader(){var t;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((t=this._heartbeatsCache)==null?void 0:t.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const r=u1(),{heartbeatsToSend:a,unsentEntries:l}=xI(this._heartbeatsCache.heartbeats),c=q0(JSON.stringify({version:2,heartbeats:a}));return this._heartbeatsCache.lastSentHeartbeatDate=r,l.length>0?(this._heartbeatsCache.heartbeats=l,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),c}catch(r){return Jr.warn(r),""}}}function u1(){return new Date().toISOString().substring(0,10)}function xI(e,t=bI){const r=[];let a=e.slice();for(const l of e){const c=r.find(u=>u.agent===l.agent);if(c){if(c.dates.push(l.date),d1(r)>t){c.dates.pop();break}}else if(r.push({agent:l.agent,dates:[l.date]}),d1(r)>t){r.pop();break}a=a.slice(1)}return{heartbeatsToSend:r,unsentEntries:a}}class EI{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return s5()?l5().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const r=await gI(this.app);return r!=null&&r.heartbeats?r:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(t){if(await this._canUseIndexedDBPromise){const a=await this.read();return c1(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??a.lastSentHeartbeatDate,heartbeats:t.heartbeats})}else return}async add(t){if(await this._canUseIndexedDBPromise){const a=await this.read();return c1(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??a.lastSentHeartbeatDate,heartbeats:[...a.heartbeats,...t.heartbeats]})}else return}}function d1(e){return q0(JSON.stringify({version:2,heartbeats:e})).length}function _I(e){if(e.length===0)return-1;let t=0,r=e[0].date;for(let a=1;a<e.length;a++)e[a].date<r&&(r=e[a].date,t=a);return t}/**
429
- * @license
430
- * Copyright 2019 Google LLC
431
- *
432
- * Licensed under the Apache License, Version 2.0 (the "License");
433
- * you may not use this file except in compliance with the License.
434
- * You may obtain a copy of the License at
435
- *
436
- * http://www.apache.org/licenses/LICENSE-2.0
437
- *
438
- * Unless required by applicable law or agreed to in writing, software
439
- * distributed under the License is distributed on an "AS IS" BASIS,
440
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
441
- * See the License for the specific language governing permissions and
442
- * limitations under the License.
443
- */function SI(e){so(new Rs("platform-logger",t=>new D5(t),"PRIVATE")),so(new Rs("heartbeat",t=>new vI(t),"PRIVATE")),ws(Kh,l1,e),ws(Kh,l1,"esm2020"),ws("fire-js","")}SI("");var wI="firebase",kI="12.9.0";/**
444
- * @license
445
- * Copyright 2020 Google LLC
446
- *
447
- * Licensed under the Apache License, Version 2.0 (the "License");
448
- * you may not use this file except in compliance with the License.
449
- * You may obtain a copy of the License at
450
- *
451
- * http://www.apache.org/licenses/LICENSE-2.0
452
- *
453
- * Unless required by applicable law or agreed to in writing, software
454
- * distributed under the License is distributed on an "AS IS" BASIS,
455
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
456
- * See the License for the specific language governing permissions and
457
- * limitations under the License.
458
- */ws(wI,kI,"app");function rE(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const TI=rE,iE=new go("auth","Firebase",rE());/**
459
- * @license
460
- * Copyright 2020 Google LLC
461
- *
462
- * Licensed under the Apache License, Version 2.0 (the "License");
463
- * you may not use this file except in compliance with the License.
464
- * You may obtain a copy of the License at
465
- *
466
- * http://www.apache.org/licenses/LICENSE-2.0
467
- *
468
- * Unless required by applicable law or agreed to in writing, software
469
- * distributed under the License is distributed on an "AS IS" BASIS,
470
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
471
- * See the License for the specific language governing permissions and
472
- * limitations under the License.
473
- */const bu=new X0("@firebase/auth");function NI(e,...t){bu.logLevel<=mt.WARN&&bu.warn(`Auth (${yo}): ${e}`,...t)}function nu(e,...t){bu.logLevel<=mt.ERROR&&bu.error(`Auth (${yo}): ${e}`,...t)}/**
474
- * @license
475
- * Copyright 2020 Google LLC
476
- *
477
- * Licensed under the Apache License, Version 2.0 (the "License");
478
- * you may not use this file except in compliance with the License.
479
- * You may obtain a copy of the License at
480
- *
481
- * http://www.apache.org/licenses/LICENSE-2.0
482
- *
483
- * Unless required by applicable law or agreed to in writing, software
484
- * distributed under the License is distributed on an "AS IS" BASIS,
485
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
486
- * See the License for the specific language governing permissions and
487
- * limitations under the License.
488
- */function Sr(e,...t){throw Cp(e,...t)}function sr(e,...t){return Cp(e,...t)}function Np(e,t,r){const a={...TI(),[t]:r};return new go("auth","Firebase",a).create(t,{appName:e.name})}function ga(e){return Np(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function CI(e,t,r){const a=r;if(!(t instanceof a))throw a.name!==t.constructor.name&&Sr(e,"argument-error"),Np(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function Cp(e,...t){if(typeof e!="string"){const r=t[0],a=[...t.slice(1)];return a[0]&&(a[0].appName=e.name),e._errorFactory.create(r,...a)}return iE.create(e,...t)}function Le(e,t,...r){if(!e)throw Cp(t,...r)}function Xr(e){const t="INTERNAL ASSERTION FAILED: "+e;throw nu(t),new Error(t)}function ei(e,t){e||Xr(t)}/**
489
- * @license
490
- * Copyright 2020 Google LLC
491
- *
492
- * Licensed under the Apache License, Version 2.0 (the "License");
493
- * you may not use this file except in compliance with the License.
494
- * You may obtain a copy of the License at
495
- *
496
- * http://www.apache.org/licenses/LICENSE-2.0
497
- *
498
- * Unless required by applicable law or agreed to in writing, software
499
- * distributed under the License is distributed on an "AS IS" BASIS,
500
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
501
- * See the License for the specific language governing permissions and
502
- * limitations under the License.
503
- */function Yh(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.href)||""}function AI(){return f1()==="http:"||f1()==="https:"}function f1(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.protocol)||null}/**
504
- * @license
505
- * Copyright 2020 Google LLC
506
- *
507
- * Licensed under the Apache License, Version 2.0 (the "License");
508
- * you may not use this file except in compliance with the License.
509
- * You may obtain a copy of the License at
510
- *
511
- * http://www.apache.org/licenses/LICENSE-2.0
512
- *
513
- * Unless required by applicable law or agreed to in writing, software
514
- * distributed under the License is distributed on an "AS IS" BASIS,
515
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
516
- * See the License for the specific language governing permissions and
517
- * limitations under the License.
518
- */function OI(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(AI()||r5()||"connection"in navigator)?navigator.onLine:!0}function RI(){if(typeof navigator>"u")return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}/**
519
- * @license
520
- * Copyright 2020 Google LLC
521
- *
522
- * Licensed under the Apache License, Version 2.0 (the "License");
523
- * you may not use this file except in compliance with the License.
524
- * You may obtain a copy of the License at
525
- *
526
- * http://www.apache.org/licenses/LICENSE-2.0
527
- *
528
- * Unless required by applicable law or agreed to in writing, software
529
- * distributed under the License is distributed on an "AS IS" BASIS,
530
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
531
- * See the License for the specific language governing permissions and
532
- * limitations under the License.
533
- */class vo{constructor(t,r){this.shortDelay=t,this.longDelay=r,ei(r>t,"Short delay should be less than long delay!"),this.isMobile=t5()||i5()}get(){return OI()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
534
- * @license
535
- * Copyright 2020 Google LLC
536
- *
537
- * Licensed under the Apache License, Version 2.0 (the "License");
538
- * you may not use this file except in compliance with the License.
539
- * You may obtain a copy of the License at
540
- *
541
- * http://www.apache.org/licenses/LICENSE-2.0
542
- *
543
- * Unless required by applicable law or agreed to in writing, software
544
- * distributed under the License is distributed on an "AS IS" BASIS,
545
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
546
- * See the License for the specific language governing permissions and
547
- * limitations under the License.
548
- */function Ap(e,t){ei(e.emulator,"Emulator should always be set here");const{url:r}=e.emulator;return t?`${r}${t.startsWith("/")?t.slice(1):t}`:r}/**
549
- * @license
550
- * Copyright 2020 Google LLC
551
- *
552
- * Licensed under the Apache License, Version 2.0 (the "License");
553
- * you may not use this file except in compliance with the License.
554
- * You may obtain a copy of the License at
555
- *
556
- * http://www.apache.org/licenses/LICENSE-2.0
557
- *
558
- * Unless required by applicable law or agreed to in writing, software
559
- * distributed under the License is distributed on an "AS IS" BASIS,
560
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
561
- * See the License for the specific language governing permissions and
562
- * limitations under the License.
563
- */class aE{static initialize(t,r,a){this.fetchImpl=t,r&&(this.headersImpl=r),a&&(this.responseImpl=a)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;Xr("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;Xr("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;Xr("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
564
- * @license
565
- * Copyright 2020 Google LLC
566
- *
567
- * Licensed under the Apache License, Version 2.0 (the "License");
568
- * you may not use this file except in compliance with the License.
569
- * You may obtain a copy of the License at
570
- *
571
- * http://www.apache.org/licenses/LICENSE-2.0
572
- *
573
- * Unless required by applicable law or agreed to in writing, software
574
- * distributed under the License is distributed on an "AS IS" BASIS,
575
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
576
- * See the License for the specific language governing permissions and
577
- * limitations under the License.
578
- */const MI={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};/**
579
- * @license
580
- * Copyright 2020 Google LLC
581
- *
582
- * Licensed under the Apache License, Version 2.0 (the "License");
583
- * you may not use this file except in compliance with the License.
584
- * You may obtain a copy of the License at
585
- *
586
- * http://www.apache.org/licenses/LICENSE-2.0
587
- *
588
- * Unless required by applicable law or agreed to in writing, software
589
- * distributed under the License is distributed on an "AS IS" BASIS,
590
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
591
- * See the License for the specific language governing permissions and
592
- * limitations under the License.
593
- */const II=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],DI=new vo(3e4,6e4);function Op(e,t){return e.tenantId&&!t.tenantId?{...t,tenantId:e.tenantId}:t}async function zs(e,t,r,a,l={}){return sE(e,l,async()=>{let c={},u={};a&&(t==="GET"?u=a:c={body:JSON.stringify(a)});const d=bo({key:e.config.apiKey,...u}).slice(1),h=await e._getAdditionalHeaders();h["Content-Type"]="application/json",e.languageCode&&(h["X-Firebase-Locale"]=e.languageCode);const p={method:t,headers:h,...c};return n5()||(p.referrerPolicy="no-referrer"),e.emulatorConfig&&Mu(e.emulatorConfig.host)&&(p.credentials="include"),aE.fetch()(await lE(e,e.config.apiHost,r,d),p)})}async function sE(e,t,r){e._canInitEmulator=!1;const a={...MI,...t};try{const l=new zI(e),c=await Promise.race([r(),l.promise]);l.clearNetworkTimeout();const u=await c.json();if("needConfirmation"in u)throw Qc(e,"account-exists-with-different-credential",u);if(c.ok&&!("errorMessage"in u))return u;{const d=c.ok?u.errorMessage:u.error.message,[h,p]=d.split(" : ");if(h==="FEDERATED_USER_ID_ALREADY_LINKED")throw Qc(e,"credential-already-in-use",u);if(h==="EMAIL_EXISTS")throw Qc(e,"email-already-in-use",u);if(h==="USER_DISABLED")throw Qc(e,"user-disabled",u);const b=a[h]||h.toLowerCase().replace(/[_\s]+/g,"-");if(p)throw Np(e,b,p);Sr(e,b)}}catch(l){if(l instanceof Fi)throw l;Sr(e,"network-request-failed",{message:String(l)})}}async function LI(e,t,r,a,l={}){const c=await zs(e,t,r,a,l);return"mfaPendingCredential"in c&&Sr(e,"multi-factor-auth-required",{_serverResponse:c}),c}async function lE(e,t,r,a){const l=`${t}${r}?${a}`,c=e,u=c.config.emulator?Ap(e.config,l):`${e.config.apiScheme}://${l}`;return II.includes(r)&&(await c._persistenceManagerAvailable,c._getPersistenceType()==="COOKIE")?c._getPersistence()._getFinalTarget(u).toString():u}class zI{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(t){this.auth=t,this.timer=null,this.promise=new Promise((r,a)=>{this.timer=setTimeout(()=>a(sr(this.auth,"network-request-failed")),DI.get())})}}function Qc(e,t,r){const a={appName:e.name};r.email&&(a.email=r.email),r.phoneNumber&&(a.phoneNumber=r.phoneNumber);const l=sr(e,t,a);return l.customData._tokenResponse=r,l}/**
594
- * @license
595
- * Copyright 2020 Google LLC
596
- *
597
- * Licensed under the Apache License, Version 2.0 (the "License");
598
- * you may not use this file except in compliance with the License.
599
- * You may obtain a copy of the License at
600
- *
601
- * http://www.apache.org/licenses/LICENSE-2.0
602
- *
603
- * Unless required by applicable law or agreed to in writing, software
604
- * distributed under the License is distributed on an "AS IS" BASIS,
605
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
606
- * See the License for the specific language governing permissions and
607
- * limitations under the License.
608
- */async function jI(e,t){return zs(e,"POST","/v1/accounts:delete",t)}async function yu(e,t){return zs(e,"POST","/v1/accounts:lookup",t)}/**
609
- * @license
610
- * Copyright 2020 Google LLC
611
- *
612
- * Licensed under the Apache License, Version 2.0 (the "License");
613
- * you may not use this file except in compliance with the License.
614
- * You may obtain a copy of the License at
615
- *
616
- * http://www.apache.org/licenses/LICENSE-2.0
617
- *
618
- * Unless required by applicable law or agreed to in writing, software
619
- * distributed under the License is distributed on an "AS IS" BASIS,
620
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
621
- * See the License for the specific language governing permissions and
622
- * limitations under the License.
623
- */function Jl(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch{}}async function BI(e,t=!1){const r=Ls(e),a=await r.getIdToken(t),l=Rp(a);Le(l&&l.exp&&l.auth_time&&l.iat,r.auth,"internal-error");const c=typeof l.firebase=="object"?l.firebase:void 0,u=c==null?void 0:c.sign_in_provider;return{claims:l,token:a,authTime:Jl(yh(l.auth_time)),issuedAtTime:Jl(yh(l.iat)),expirationTime:Jl(yh(l.exp)),signInProvider:u||null,signInSecondFactor:(c==null?void 0:c.sign_in_second_factor)||null}}function yh(e){return Number(e)*1e3}function Rp(e){const[t,r,a]=e.split(".");if(t===void 0||r===void 0||a===void 0)return nu("JWT malformed, contained fewer than 3 sections"),null;try{const l=V0(r);return l?JSON.parse(l):(nu("Failed to decode base64 JWT payload"),null)}catch(l){return nu("Caught error parsing JWT payload as JSON",l==null?void 0:l.toString()),null}}function h1(e){const t=Rp(e);return Le(t,"internal-error"),Le(typeof t.exp<"u","internal-error"),Le(typeof t.iat<"u","internal-error"),Number(t.exp)-Number(t.iat)}/**
624
- * @license
625
- * Copyright 2020 Google LLC
626
- *
627
- * Licensed under the Apache License, Version 2.0 (the "License");
628
- * you may not use this file except in compliance with the License.
629
- * You may obtain a copy of the License at
630
- *
631
- * http://www.apache.org/licenses/LICENSE-2.0
632
- *
633
- * Unless required by applicable law or agreed to in writing, software
634
- * distributed under the License is distributed on an "AS IS" BASIS,
635
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
636
- * See the License for the specific language governing permissions and
637
- * limitations under the License.
638
- */async function oo(e,t,r=!1){if(r)return t;try{return await t}catch(a){throw a instanceof Fi&&UI(a)&&e.auth.currentUser===e&&await e.auth.signOut(),a}}function UI({code:e}){return e==="auth/user-disabled"||e==="auth/user-token-expired"}/**
639
- * @license
640
- * Copyright 2020 Google LLC
641
- *
642
- * Licensed under the Apache License, Version 2.0 (the "License");
643
- * you may not use this file except in compliance with the License.
644
- * You may obtain a copy of the License at
645
- *
646
- * http://www.apache.org/licenses/LICENSE-2.0
647
- *
648
- * Unless required by applicable law or agreed to in writing, software
649
- * distributed under the License is distributed on an "AS IS" BASIS,
650
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
651
- * See the License for the specific language governing permissions and
652
- * limitations under the License.
653
- */class PI{constructor(t){this.user=t,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(t){if(t){const r=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),r}else{this.errorBackoff=3e4;const a=(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5;return Math.max(0,a)}}schedule(t=!1){if(!this.isRunning)return;const r=this.getInterval(t);this.timerId=setTimeout(async()=>{await this.iteration()},r)}async iteration(){try{await this.user.getIdToken(!0)}catch(t){(t==null?void 0:t.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/**
654
- * @license
655
- * Copyright 2020 Google LLC
656
- *
657
- * Licensed under the Apache License, Version 2.0 (the "License");
658
- * you may not use this file except in compliance with the License.
659
- * You may obtain a copy of the License at
660
- *
661
- * http://www.apache.org/licenses/LICENSE-2.0
662
- *
663
- * Unless required by applicable law or agreed to in writing, software
664
- * distributed under the License is distributed on an "AS IS" BASIS,
665
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
666
- * See the License for the specific language governing permissions and
667
- * limitations under the License.
668
- */class Wh{constructor(t,r){this.createdAt=t,this.lastLoginAt=r,this._initializeTime()}_initializeTime(){this.lastSignInTime=Jl(this.lastLoginAt),this.creationTime=Jl(this.createdAt)}_copy(t){this.createdAt=t.createdAt,this.lastLoginAt=t.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
669
- * @license
670
- * Copyright 2019 Google LLC
671
- *
672
- * Licensed under the Apache License, Version 2.0 (the "License");
673
- * you may not use this file except in compliance with the License.
674
- * You may obtain a copy of the License at
675
- *
676
- * http://www.apache.org/licenses/LICENSE-2.0
677
- *
678
- * Unless required by applicable law or agreed to in writing, software
679
- * distributed under the License is distributed on an "AS IS" BASIS,
680
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
681
- * See the License for the specific language governing permissions and
682
- * limitations under the License.
683
- */async function vu(e){var y;const t=e.auth,r=await e.getIdToken(),a=await oo(e,yu(t,{idToken:r}));Le(a==null?void 0:a.users.length,t,"internal-error");const l=a.users[0];e._notifyReloadListener(l);const c=(y=l.providerUserInfo)!=null&&y.length?oE(l.providerUserInfo):[],u=FI(e.providerData,c),d=e.isAnonymous,h=!(e.email&&l.passwordHash)&&!(u!=null&&u.length),p=d?h:!1,b={uid:l.localId,displayName:l.displayName||null,photoURL:l.photoUrl||null,email:l.email||null,emailVerified:l.emailVerified||!1,phoneNumber:l.phoneNumber||null,tenantId:l.tenantId||null,providerData:u,metadata:new Wh(l.createdAt,l.lastLoginAt),isAnonymous:p};Object.assign(e,b)}async function HI(e){const t=Ls(e);await vu(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}function FI(e,t){return[...e.filter(a=>!t.some(l=>l.providerId===a.providerId)),...t]}function oE(e){return e.map(({providerId:t,...r})=>({providerId:t,uid:r.rawId||"",displayName:r.displayName||null,email:r.email||null,phoneNumber:r.phoneNumber||null,photoURL:r.photoUrl||null}))}/**
684
- * @license
685
- * Copyright 2020 Google LLC
686
- *
687
- * Licensed under the Apache License, Version 2.0 (the "License");
688
- * you may not use this file except in compliance with the License.
689
- * You may obtain a copy of the License at
690
- *
691
- * http://www.apache.org/licenses/LICENSE-2.0
692
- *
693
- * Unless required by applicable law or agreed to in writing, software
694
- * distributed under the License is distributed on an "AS IS" BASIS,
695
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
696
- * See the License for the specific language governing permissions and
697
- * limitations under the License.
698
- */async function $I(e,t){const r=await sE(e,{},async()=>{const a=bo({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:l,apiKey:c}=e.config,u=await lE(e,l,"/v1/token",`key=${c}`),d=await e._getAdditionalHeaders();d["Content-Type"]="application/x-www-form-urlencoded";const h={method:"POST",headers:d,body:a};return e.emulatorConfig&&Mu(e.emulatorConfig.host)&&(h.credentials="include"),aE.fetch()(u,h)});return{accessToken:r.access_token,expiresIn:r.expires_in,refreshToken:r.refresh_token}}async function GI(e,t){return zs(e,"POST","/v2/accounts:revokeToken",Op(e,t))}/**
699
- * @license
700
- * Copyright 2020 Google LLC
701
- *
702
- * Licensed under the Apache License, Version 2.0 (the "License");
703
- * you may not use this file except in compliance with the License.
704
- * You may obtain a copy of the License at
705
- *
706
- * http://www.apache.org/licenses/LICENSE-2.0
707
- *
708
- * Unless required by applicable law or agreed to in writing, software
709
- * distributed under the License is distributed on an "AS IS" BASIS,
710
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
711
- * See the License for the specific language governing permissions and
712
- * limitations under the License.
713
- */class ks{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(t){Le(t.idToken,"internal-error"),Le(typeof t.idToken<"u","internal-error"),Le(typeof t.refreshToken<"u","internal-error");const r="expiresIn"in t&&typeof t.expiresIn<"u"?Number(t.expiresIn):h1(t.idToken);this.updateTokensAndExpiration(t.idToken,t.refreshToken,r)}updateFromIdToken(t){Le(t.length!==0,"internal-error");const r=h1(t);this.updateTokensAndExpiration(t,null,r)}async getToken(t,r=!1){return!r&&this.accessToken&&!this.isExpired?this.accessToken:(Le(this.refreshToken,t,"user-token-expired"),this.refreshToken?(await this.refresh(t,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(t,r){const{accessToken:a,refreshToken:l,expiresIn:c}=await $I(t,r);this.updateTokensAndExpiration(a,l,Number(c))}updateTokensAndExpiration(t,r,a){this.refreshToken=r||null,this.accessToken=t||null,this.expirationTime=Date.now()+a*1e3}static fromJSON(t,r){const{refreshToken:a,accessToken:l,expirationTime:c}=r,u=new ks;return a&&(Le(typeof a=="string","internal-error",{appName:t}),u.refreshToken=a),l&&(Le(typeof l=="string","internal-error",{appName:t}),u.accessToken=l),c&&(Le(typeof c=="number","internal-error",{appName:t}),u.expirationTime=c),u}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(t){this.accessToken=t.accessToken,this.refreshToken=t.refreshToken,this.expirationTime=t.expirationTime}_clone(){return Object.assign(new ks,this.toJSON())}_performRefresh(){return Xr("not implemented")}}/**
714
- * @license
715
- * Copyright 2020 Google LLC
716
- *
717
- * Licensed under the Apache License, Version 2.0 (the "License");
718
- * you may not use this file except in compliance with the License.
719
- * You may obtain a copy of the License at
720
- *
721
- * http://www.apache.org/licenses/LICENSE-2.0
722
- *
723
- * Unless required by applicable law or agreed to in writing, software
724
- * distributed under the License is distributed on an "AS IS" BASIS,
725
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
726
- * See the License for the specific language governing permissions and
727
- * limitations under the License.
728
- */function Ii(e,t){Le(typeof e=="string"||typeof e>"u","internal-error",{appName:t})}class ir{constructor({uid:t,auth:r,stsTokenManager:a,...l}){this.providerId="firebase",this.proactiveRefresh=new PI(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=r,this.stsTokenManager=a,this.accessToken=a.accessToken,this.displayName=l.displayName||null,this.email=l.email||null,this.emailVerified=l.emailVerified||!1,this.phoneNumber=l.phoneNumber||null,this.photoURL=l.photoURL||null,this.isAnonymous=l.isAnonymous||!1,this.tenantId=l.tenantId||null,this.providerData=l.providerData?[...l.providerData]:[],this.metadata=new Wh(l.createdAt||void 0,l.lastLoginAt||void 0)}async getIdToken(t){const r=await oo(this,this.stsTokenManager.getToken(this.auth,t));return Le(r,this.auth,"internal-error"),this.accessToken!==r&&(this.accessToken=r,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),r}getIdTokenResult(t){return BI(this,t)}reload(){return HI(this)}_assign(t){this!==t&&(Le(this.uid===t.uid,this.auth,"internal-error"),this.displayName=t.displayName,this.photoURL=t.photoURL,this.email=t.email,this.emailVerified=t.emailVerified,this.phoneNumber=t.phoneNumber,this.isAnonymous=t.isAnonymous,this.tenantId=t.tenantId,this.providerData=t.providerData.map(r=>({...r})),this.metadata._copy(t.metadata),this.stsTokenManager._assign(t.stsTokenManager))}_clone(t){const r=new ir({...this,auth:t,stsTokenManager:this.stsTokenManager._clone()});return r.metadata._copy(this.metadata),r}_onReload(t){Le(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=t,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(t){this.reloadListener?this.reloadListener(t):this.reloadUserInfo=t}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(t,r=!1){let a=!1;t.idToken&&t.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(t),a=!0),r&&await vu(this),await this.auth._persistUserIfCurrent(this),a&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(xr(this.auth.app))return Promise.reject(ga(this.auth));const t=await this.getIdToken();return await oo(this,jI(this.auth,{idToken:t})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(t=>({...t})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId,...this.metadata.toJSON(),apiKey:this.auth.config.apiKey,appName:this.auth.name}}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(t,r){const a=r.displayName??void 0,l=r.email??void 0,c=r.phoneNumber??void 0,u=r.photoURL??void 0,d=r.tenantId??void 0,h=r._redirectEventId??void 0,p=r.createdAt??void 0,b=r.lastLoginAt??void 0,{uid:y,emailVerified:v,isAnonymous:x,providerData:_,stsTokenManager:T}=r;Le(y&&T,t,"internal-error");const C=ks.fromJSON(this.name,T);Le(typeof y=="string",t,"internal-error"),Ii(a,t.name),Ii(l,t.name),Le(typeof v=="boolean",t,"internal-error"),Le(typeof x=="boolean",t,"internal-error"),Ii(c,t.name),Ii(u,t.name),Ii(d,t.name),Ii(h,t.name),Ii(p,t.name),Ii(b,t.name);const S=new ir({uid:y,auth:t,email:l,emailVerified:v,displayName:a,isAnonymous:x,photoURL:u,phoneNumber:c,tenantId:d,stsTokenManager:C,createdAt:p,lastLoginAt:b});return _&&Array.isArray(_)&&(S.providerData=_.map(R=>({...R}))),h&&(S._redirectEventId=h),S}static async _fromIdTokenResponse(t,r,a=!1){const l=new ks;l.updateFromServerResponse(r);const c=new ir({uid:r.localId,auth:t,stsTokenManager:l,isAnonymous:a});return await vu(c),c}static async _fromGetAccountInfoResponse(t,r,a){const l=r.users[0];Le(l.localId!==void 0,"internal-error");const c=l.providerUserInfo!==void 0?oE(l.providerUserInfo):[],u=!(l.email&&l.passwordHash)&&!(c!=null&&c.length),d=new ks;d.updateFromIdToken(a);const h=new ir({uid:l.localId,auth:t,stsTokenManager:d,isAnonymous:u}),p={uid:l.localId,displayName:l.displayName||null,photoURL:l.photoUrl||null,email:l.email||null,emailVerified:l.emailVerified||!1,phoneNumber:l.phoneNumber||null,tenantId:l.tenantId||null,providerData:c,metadata:new Wh(l.createdAt,l.lastLoginAt),isAnonymous:!(l.email&&l.passwordHash)&&!(c!=null&&c.length)};return Object.assign(h,p),h}}/**
729
- * @license
730
- * Copyright 2020 Google LLC
731
- *
732
- * Licensed under the Apache License, Version 2.0 (the "License");
733
- * you may not use this file except in compliance with the License.
734
- * You may obtain a copy of the License at
735
- *
736
- * http://www.apache.org/licenses/LICENSE-2.0
737
- *
738
- * Unless required by applicable law or agreed to in writing, software
739
- * distributed under the License is distributed on an "AS IS" BASIS,
740
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
741
- * See the License for the specific language governing permissions and
742
- * limitations under the License.
743
- */const p1=new Map;function Zr(e){ei(e instanceof Function,"Expected a class definition");let t=p1.get(e);return t?(ei(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,p1.set(e,t),t)}/**
744
- * @license
745
- * Copyright 2019 Google LLC
746
- *
747
- * Licensed under the Apache License, Version 2.0 (the "License");
748
- * you may not use this file except in compliance with the License.
749
- * You may obtain a copy of the License at
750
- *
751
- * http://www.apache.org/licenses/LICENSE-2.0
752
- *
753
- * Unless required by applicable law or agreed to in writing, software
754
- * distributed under the License is distributed on an "AS IS" BASIS,
755
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
756
- * See the License for the specific language governing permissions and
757
- * limitations under the License.
758
- */class cE{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(t,r){this.storage[t]=r}async _get(t){const r=this.storage[t];return r===void 0?null:r}async _remove(t){delete this.storage[t]}_addListener(t,r){}_removeListener(t,r){}}cE.type="NONE";const m1=cE;/**
759
- * @license
760
- * Copyright 2019 Google LLC
761
- *
762
- * Licensed under the Apache License, Version 2.0 (the "License");
763
- * you may not use this file except in compliance with the License.
764
- * You may obtain a copy of the License at
765
- *
766
- * http://www.apache.org/licenses/LICENSE-2.0
767
- *
768
- * Unless required by applicable law or agreed to in writing, software
769
- * distributed under the License is distributed on an "AS IS" BASIS,
770
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
771
- * See the License for the specific language governing permissions and
772
- * limitations under the License.
773
- */function ru(e,t,r){return`firebase:${e}:${t}:${r}`}class Ts{constructor(t,r,a){this.persistence=t,this.auth=r,this.userKey=a;const{config:l,name:c}=this.auth;this.fullUserKey=ru(this.userKey,l.apiKey,c),this.fullPersistenceKey=ru("persistence",l.apiKey,c),this.boundEventHandler=r._onStorageEvent.bind(r),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(t){return this.persistence._set(this.fullUserKey,t.toJSON())}async getCurrentUser(){const t=await this.persistence._get(this.fullUserKey);if(!t)return null;if(typeof t=="string"){const r=await yu(this.auth,{idToken:t}).catch(()=>{});return r?ir._fromGetAccountInfoResponse(this.auth,r,t):null}return ir._fromJSON(this.auth,t)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(t){if(this.persistence===t)return;const r=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=t,r)return this.setCurrentUser(r)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(t,r,a="authUser"){if(!r.length)return new Ts(Zr(m1),t,a);const l=(await Promise.all(r.map(async p=>{if(await p._isAvailable())return p}))).filter(p=>p);let c=l[0]||Zr(m1);const u=ru(a,t.config.apiKey,t.name);let d=null;for(const p of r)try{const b=await p._get(u);if(b){let y;if(typeof b=="string"){const v=await yu(t,{idToken:b}).catch(()=>{});if(!v)break;y=await ir._fromGetAccountInfoResponse(t,v,b)}else y=ir._fromJSON(t,b);p!==c&&(d=y),c=p;break}}catch{}const h=l.filter(p=>p._shouldAllowMigration);return!c._shouldAllowMigration||!h.length?new Ts(c,t,a):(c=h[0],d&&await c._set(u,d.toJSON()),await Promise.all(r.map(async p=>{if(p!==c)try{await p._remove(u)}catch{}})),new Ts(c,t,a))}}/**
774
- * @license
775
- * Copyright 2020 Google LLC
776
- *
777
- * Licensed under the Apache License, Version 2.0 (the "License");
778
- * you may not use this file except in compliance with the License.
779
- * You may obtain a copy of the License at
780
- *
781
- * http://www.apache.org/licenses/LICENSE-2.0
782
- *
783
- * Unless required by applicable law or agreed to in writing, software
784
- * distributed under the License is distributed on an "AS IS" BASIS,
785
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
786
- * See the License for the specific language governing permissions and
787
- * limitations under the License.
788
- */function g1(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(hE(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(uE(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(mE(t))return"Blackberry";if(gE(t))return"Webos";if(dE(t))return"Safari";if((t.includes("chrome/")||fE(t))&&!t.includes("edge/"))return"Chrome";if(pE(t))return"Android";{const r=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,a=e.match(r);if((a==null?void 0:a.length)===2)return a[1]}return"Other"}function uE(e=pn()){return/firefox\//i.test(e)}function dE(e=pn()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function fE(e=pn()){return/crios\//i.test(e)}function hE(e=pn()){return/iemobile/i.test(e)}function pE(e=pn()){return/android/i.test(e)}function mE(e=pn()){return/blackberry/i.test(e)}function gE(e=pn()){return/webos/i.test(e)}function Mp(e=pn()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function KI(e=pn()){var t;return Mp(e)&&!!((t=window.navigator)!=null&&t.standalone)}function qI(){return a5()&&document.documentMode===10}function bE(e=pn()){return Mp(e)||pE(e)||gE(e)||mE(e)||/windows phone/i.test(e)||hE(e)}/**
789
- * @license
790
- * Copyright 2020 Google LLC
791
- *
792
- * Licensed under the Apache License, Version 2.0 (the "License");
793
- * you may not use this file except in compliance with the License.
794
- * You may obtain a copy of the License at
795
- *
796
- * http://www.apache.org/licenses/LICENSE-2.0
797
- *
798
- * Unless required by applicable law or agreed to in writing, software
799
- * distributed under the License is distributed on an "AS IS" BASIS,
800
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
801
- * See the License for the specific language governing permissions and
802
- * limitations under the License.
803
- */function yE(e,t=[]){let r;switch(e){case"Browser":r=g1(pn());break;case"Worker":r=`${g1(pn())}-${e}`;break;default:r=e}const a=t.length?t.join(","):"FirebaseCore-web";return`${r}/JsCore/${yo}/${a}`}/**
804
- * @license
805
- * Copyright 2022 Google LLC
806
- *
807
- * Licensed under the Apache License, Version 2.0 (the "License");
808
- * you may not use this file except in compliance with the License.
809
- * You may obtain a copy of the License at
810
- *
811
- * http://www.apache.org/licenses/LICENSE-2.0
812
- *
813
- * Unless required by applicable law or agreed to in writing, software
814
- * distributed under the License is distributed on an "AS IS" BASIS,
815
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
816
- * See the License for the specific language governing permissions and
817
- * limitations under the License.
818
- */class VI{constructor(t){this.auth=t,this.queue=[]}pushCallback(t,r){const a=c=>new Promise((u,d)=>{try{const h=t(c);u(h)}catch(h){d(h)}});a.onAbort=r,this.queue.push(a);const l=this.queue.length-1;return()=>{this.queue[l]=()=>Promise.resolve()}}async runMiddleware(t){if(this.auth.currentUser===t)return;const r=[];try{for(const a of this.queue)await a(t),a.onAbort&&r.push(a.onAbort)}catch(a){r.reverse();for(const l of r)try{l()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:a==null?void 0:a.message})}}}/**
819
- * @license
820
- * Copyright 2023 Google LLC
821
- *
822
- * Licensed under the Apache License, Version 2.0 (the "License");
823
- * you may not use this file except in compliance with the License.
824
- * You may obtain a copy of the License at
825
- *
826
- * http://www.apache.org/licenses/LICENSE-2.0
827
- *
828
- * Unless required by applicable law or agreed to in writing, software
829
- * distributed under the License is distributed on an "AS IS" BASIS,
830
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
831
- * See the License for the specific language governing permissions and
832
- * limitations under the License.
833
- */async function YI(e,t={}){return zs(e,"GET","/v2/passwordPolicy",Op(e,t))}/**
834
- * @license
835
- * Copyright 2023 Google LLC
836
- *
837
- * Licensed under the Apache License, Version 2.0 (the "License");
838
- * you may not use this file except in compliance with the License.
839
- * You may obtain a copy of the License at
840
- *
841
- * http://www.apache.org/licenses/LICENSE-2.0
842
- *
843
- * Unless required by applicable law or agreed to in writing, software
844
- * distributed under the License is distributed on an "AS IS" BASIS,
845
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
846
- * See the License for the specific language governing permissions and
847
- * limitations under the License.
848
- */const WI=6;class XI{constructor(t){var a;const r=t.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=r.minPasswordLength??WI,r.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=r.maxPasswordLength),r.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=r.containsLowercaseCharacter),r.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=r.containsUppercaseCharacter),r.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=r.containsNumericCharacter),r.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=r.containsNonAlphanumericCharacter),this.enforcementState=t.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=((a=t.allowedNonAlphanumericCharacters)==null?void 0:a.join(""))??"",this.forceUpgradeOnSignin=t.forceUpgradeOnSignin??!1,this.schemaVersion=t.schemaVersion}validatePassword(t){const r={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(t,r),this.validatePasswordCharacterOptions(t,r),r.isValid&&(r.isValid=r.meetsMinPasswordLength??!0),r.isValid&&(r.isValid=r.meetsMaxPasswordLength??!0),r.isValid&&(r.isValid=r.containsLowercaseLetter??!0),r.isValid&&(r.isValid=r.containsUppercaseLetter??!0),r.isValid&&(r.isValid=r.containsNumericCharacter??!0),r.isValid&&(r.isValid=r.containsNonAlphanumericCharacter??!0),r}validatePasswordLengthOptions(t,r){const a=this.customStrengthOptions.minPasswordLength,l=this.customStrengthOptions.maxPasswordLength;a&&(r.meetsMinPasswordLength=t.length>=a),l&&(r.meetsMaxPasswordLength=t.length<=l)}validatePasswordCharacterOptions(t,r){this.updatePasswordCharacterOptionsStatuses(r,!1,!1,!1,!1);let a;for(let l=0;l<t.length;l++)a=t.charAt(l),this.updatePasswordCharacterOptionsStatuses(r,a>="a"&&a<="z",a>="A"&&a<="Z",a>="0"&&a<="9",this.allowedNonAlphanumericCharacters.includes(a))}updatePasswordCharacterOptionsStatuses(t,r,a,l,c){this.customStrengthOptions.containsLowercaseLetter&&(t.containsLowercaseLetter||(t.containsLowercaseLetter=r)),this.customStrengthOptions.containsUppercaseLetter&&(t.containsUppercaseLetter||(t.containsUppercaseLetter=a)),this.customStrengthOptions.containsNumericCharacter&&(t.containsNumericCharacter||(t.containsNumericCharacter=l)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(t.containsNonAlphanumericCharacter||(t.containsNonAlphanumericCharacter=c))}}/**
849
- * @license
850
- * Copyright 2020 Google LLC
851
- *
852
- * Licensed under the Apache License, Version 2.0 (the "License");
853
- * you may not use this file except in compliance with the License.
854
- * You may obtain a copy of the License at
855
- *
856
- * http://www.apache.org/licenses/LICENSE-2.0
857
- *
858
- * Unless required by applicable law or agreed to in writing, software
859
- * distributed under the License is distributed on an "AS IS" BASIS,
860
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
861
- * See the License for the specific language governing permissions and
862
- * limitations under the License.
863
- */class ZI{constructor(t,r,a,l){this.app=t,this.heartbeatServiceProvider=r,this.appCheckServiceProvider=a,this.config=l,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new b1(this),this.idTokenSubscription=new b1(this),this.beforeStateQueue=new VI(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=iE,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=t.name,this.clientVersion=l.sdkClientVersion,this._persistenceManagerAvailable=new Promise(c=>this._resolvePersistenceManagerAvailable=c)}_initializeWithPersistence(t,r){return r&&(this._popupRedirectResolver=Zr(r)),this._initializationPromise=this.queue(async()=>{var a,l,c;if(!this._deleted&&(this.persistenceManager=await Ts.create(this,t),(a=this._resolvePersistenceManagerAvailable)==null||a.call(this),!this._deleted)){if((l=this._popupRedirectResolver)!=null&&l._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(r),this.lastNotifiedUid=((c=this.currentUser)==null?void 0:c.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const t=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!t)){if(this.currentUser&&t&&this.currentUser.uid===t.uid){this._currentUser._assign(t),await this.currentUser.getIdToken();return}await this._updateCurrentUser(t,!0)}}async initializeCurrentUserFromIdToken(t){try{const r=await yu(this,{idToken:t}),a=await ir._fromGetAccountInfoResponse(this,r,t);await this.directlySetCurrentUser(a)}catch(r){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",r),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(t){var c;if(xr(this.app)){const u=this.app.settings.authIdToken;return u?new Promise(d=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(u).then(d,d))}):this.directlySetCurrentUser(null)}const r=await this.assertedPersistence.getCurrentUser();let a=r,l=!1;if(t&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const u=(c=this.redirectUser)==null?void 0:c._redirectEventId,d=a==null?void 0:a._redirectEventId,h=await this.tryRedirectSignIn(t);(!u||u===d)&&(h!=null&&h.user)&&(a=h.user,l=!0)}if(!a)return this.directlySetCurrentUser(null);if(!a._redirectEventId){if(l)try{await this.beforeStateQueue.runMiddleware(a)}catch(u){a=r,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(u))}return a?this.reloadAndSetCurrentUserOrClear(a):this.directlySetCurrentUser(null)}return Le(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===a._redirectEventId?this.directlySetCurrentUser(a):this.reloadAndSetCurrentUserOrClear(a)}async tryRedirectSignIn(t){let r=null;try{r=await this._popupRedirectResolver._completeRedirectFn(this,t,!0)}catch{await this._setRedirectUser(null)}return r}async reloadAndSetCurrentUserOrClear(t){try{await vu(t)}catch(r){if((r==null?void 0:r.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(t)}useDeviceLanguage(){this.languageCode=RI()}async _delete(){this._deleted=!0}async updateCurrentUser(t){if(xr(this.app))return Promise.reject(ga(this));const r=t?Ls(t):null;return r&&Le(r.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(r&&r._clone(this))}async _updateCurrentUser(t,r=!1){if(!this._deleted)return t&&Le(this.tenantId===t.tenantId,this,"tenant-id-mismatch"),r||await this.beforeStateQueue.runMiddleware(t),this.queue(async()=>{await this.directlySetCurrentUser(t),this.notifyAuthListeners()})}async signOut(){return xr(this.app)?Promise.reject(ga(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(t){return xr(this.app)?Promise.reject(ga(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(Zr(t))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(t){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const r=this._getPasswordPolicyInternal();return r.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):r.validatePassword(t)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const t=await YI(this),r=new XI(t);this.tenantId===null?this._projectPasswordPolicy=r:this._tenantPasswordPolicies[this.tenantId]=r}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(t){this._errorFactory=new go("auth","Firebase",t())}onAuthStateChanged(t,r,a){return this.registerStateListener(this.authStateSubscription,t,r,a)}beforeAuthStateChanged(t,r){return this.beforeStateQueue.pushCallback(t,r)}onIdTokenChanged(t,r,a){return this.registerStateListener(this.idTokenSubscription,t,r,a)}authStateReady(){return new Promise((t,r)=>{if(this.currentUser)t();else{const a=this.onAuthStateChanged(()=>{a(),t()},r)}})}async revokeAccessToken(t){if(this.currentUser){const r=await this.currentUser.getIdToken(),a={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:t,idToken:r};this.tenantId!=null&&(a.tenantId=this.tenantId),await GI(this,a)}}toJSON(){var t;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(t=this._currentUser)==null?void 0:t.toJSON()}}async _setRedirectUser(t,r){const a=await this.getOrInitRedirectPersistenceManager(r);return t===null?a.removeCurrentUser():a.setCurrentUser(t)}async getOrInitRedirectPersistenceManager(t){if(!this.redirectPersistenceManager){const r=t&&Zr(t)||this._popupRedirectResolver;Le(r,this,"argument-error"),this.redirectPersistenceManager=await Ts.create(this,[Zr(r._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(t){var r,a;return this._isInitialized&&await this.queue(async()=>{}),((r=this._currentUser)==null?void 0:r._redirectEventId)===t?this._currentUser:((a=this.redirectUser)==null?void 0:a._redirectEventId)===t?this.redirectUser:null}async _persistUserIfCurrent(t){if(t===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(t))}_notifyListenersIfCurrent(t){t===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var r;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const t=((r=this.currentUser)==null?void 0:r.uid)??null;this.lastNotifiedUid!==t&&(this.lastNotifiedUid=t,this.authStateSubscription.next(this.currentUser))}registerStateListener(t,r,a,l){if(this._deleted)return()=>{};const c=typeof r=="function"?r:r.next.bind(r);let u=!1;const d=this._isInitialized?Promise.resolve():this._initializationPromise;if(Le(d,this,"internal-error"),d.then(()=>{u||c(this.currentUser)}),typeof r=="function"){const h=t.addObserver(r,a,l);return()=>{u=!0,h()}}else{const h=t.addObserver(r);return()=>{u=!0,h()}}}async directlySetCurrentUser(t){this.currentUser&&this.currentUser!==t&&this._currentUser._stopProactiveRefresh(),t&&this.isProactiveRefreshEnabled&&t._startProactiveRefresh(),this.currentUser=t,t?await this.assertedPersistence.setCurrentUser(t):await this.assertedPersistence.removeCurrentUser()}queue(t){return this.operations=this.operations.then(t,t),this.operations}get assertedPersistence(){return Le(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(t){!t||this.frameworks.includes(t)||(this.frameworks.push(t),this.frameworks.sort(),this.clientVersion=yE(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var l;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const r=await((l=this.heartbeatServiceProvider.getImmediate({optional:!0}))==null?void 0:l.getHeartbeatsHeader());r&&(t["X-Firebase-Client"]=r);const a=await this._getAppCheckToken();return a&&(t["X-Firebase-AppCheck"]=a),t}async _getAppCheckToken(){var r;if(xr(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const t=await((r=this.appCheckServiceProvider.getImmediate({optional:!0}))==null?void 0:r.getToken());return t!=null&&t.error&&NI(`Error while retrieving App Check token: ${t.error}`),t==null?void 0:t.token}}function Iu(e){return Ls(e)}class b1{constructor(t){this.auth=t,this.observer=null,this.addObserver=f5(r=>this.observer=r)}get next(){return Le(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
864
- * @license
865
- * Copyright 2020 Google LLC
866
- *
867
- * Licensed under the Apache License, Version 2.0 (the "License");
868
- * you may not use this file except in compliance with the License.
869
- * You may obtain a copy of the License at
870
- *
871
- * http://www.apache.org/licenses/LICENSE-2.0
872
- *
873
- * Unless required by applicable law or agreed to in writing, software
874
- * distributed under the License is distributed on an "AS IS" BASIS,
875
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
876
- * See the License for the specific language governing permissions and
877
- * limitations under the License.
878
- */let Ip={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function QI(e){Ip=e}function JI(e){return Ip.loadJS(e)}function e3(){return Ip.gapiScript}function t3(e){return`__${e}${Math.floor(Math.random()*1e6)}`}/**
879
- * @license
880
- * Copyright 2020 Google LLC
881
- *
882
- * Licensed under the Apache License, Version 2.0 (the "License");
883
- * you may not use this file except in compliance with the License.
884
- * You may obtain a copy of the License at
885
- *
886
- * http://www.apache.org/licenses/LICENSE-2.0
887
- *
888
- * Unless required by applicable law or agreed to in writing, software
889
- * distributed under the License is distributed on an "AS IS" BASIS,
890
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
891
- * See the License for the specific language governing permissions and
892
- * limitations under the License.
893
- */function n3(e,t){const r=J0(e,"auth");if(r.isInitialized()){const l=r.getImmediate(),c=r.getOptions();if(Os(c,t??{}))return l;Sr(l,"already-initialized")}return r.initialize({options:t})}function r3(e,t){const r=(t==null?void 0:t.persistence)||[],a=(Array.isArray(r)?r:[r]).map(Zr);t!=null&&t.errorMap&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(a,t==null?void 0:t.popupRedirectResolver)}function i3(e,t,r){const a=Iu(e);Le(/^https?:\/\//.test(t),a,"invalid-emulator-scheme");const l=!1,c=vE(t),{host:u,port:d}=a3(t),h=d===null?"":`:${d}`,p={url:`${c}//${u}${h}/`},b=Object.freeze({host:u,port:d,protocol:c.replace(":",""),options:Object.freeze({disableWarnings:l})});if(!a._canInitEmulator){Le(a.config.emulator&&a.emulatorConfig,a,"emulator-config-failed"),Le(Os(p,a.config.emulator)&&Os(b,a.emulatorConfig),a,"emulator-config-failed");return}a.config.emulator=p,a.emulatorConfig=b,a.settings.appVerificationDisabledForTesting=!0,Mu(u)?(ZM(`${c}//${u}${h}`),e5("Auth",!0)):s3()}function vE(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function a3(e){const t=vE(e),r=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!r)return{host:"",port:null};const a=r[2].split("@").pop()||"",l=/^(\[[^\]]+\])(:|$)/.exec(a);if(l){const c=l[1];return{host:c,port:y1(a.substr(c.length+1))}}else{const[c,u]=a.split(":");return{host:c,port:y1(u)}}}function y1(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}function s3(){function e(){const t=document.createElement("p"),r=t.style;t.innerText="Running in emulator mode. Do not use with production credentials.",r.position="fixed",r.width="100%",r.backgroundColor="#ffffff",r.border=".1em solid #000000",r.color="#b50000",r.bottom="0px",r.left="0px",r.margin="0px",r.zIndex="10000",r.textAlign="center",t.classList.add("firebase-emulator-warning"),document.body.appendChild(t)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",e):e())}/**
894
- * @license
895
- * Copyright 2020 Google LLC
896
- *
897
- * Licensed under the Apache License, Version 2.0 (the "License");
898
- * you may not use this file except in compliance with the License.
899
- * You may obtain a copy of the License at
900
- *
901
- * http://www.apache.org/licenses/LICENSE-2.0
902
- *
903
- * Unless required by applicable law or agreed to in writing, software
904
- * distributed under the License is distributed on an "AS IS" BASIS,
905
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
906
- * See the License for the specific language governing permissions and
907
- * limitations under the License.
908
- */class xE{constructor(t,r){this.providerId=t,this.signInMethod=r}toJSON(){return Xr("not implemented")}_getIdTokenResponse(t){return Xr("not implemented")}_linkToIdToken(t,r){return Xr("not implemented")}_getReauthenticationResolver(t){return Xr("not implemented")}}/**
909
- * @license
910
- * Copyright 2020 Google LLC
911
- *
912
- * Licensed under the Apache License, Version 2.0 (the "License");
913
- * you may not use this file except in compliance with the License.
914
- * You may obtain a copy of the License at
915
- *
916
- * http://www.apache.org/licenses/LICENSE-2.0
917
- *
918
- * Unless required by applicable law or agreed to in writing, software
919
- * distributed under the License is distributed on an "AS IS" BASIS,
920
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
921
- * See the License for the specific language governing permissions and
922
- * limitations under the License.
923
- */async function Ns(e,t){return LI(e,"POST","/v1/accounts:signInWithIdp",Op(e,t))}/**
924
- * @license
925
- * Copyright 2020 Google LLC
926
- *
927
- * Licensed under the Apache License, Version 2.0 (the "License");
928
- * you may not use this file except in compliance with the License.
929
- * You may obtain a copy of the License at
930
- *
931
- * http://www.apache.org/licenses/LICENSE-2.0
932
- *
933
- * Unless required by applicable law or agreed to in writing, software
934
- * distributed under the License is distributed on an "AS IS" BASIS,
935
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
936
- * See the License for the specific language governing permissions and
937
- * limitations under the License.
938
- */const l3="http://localhost";class xa extends xE{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(t){const r=new xa(t.providerId,t.signInMethod);return t.idToken||t.accessToken?(t.idToken&&(r.idToken=t.idToken),t.accessToken&&(r.accessToken=t.accessToken),t.nonce&&!t.pendingToken&&(r.nonce=t.nonce),t.pendingToken&&(r.pendingToken=t.pendingToken)):t.oauthToken&&t.oauthTokenSecret?(r.accessToken=t.oauthToken,r.secret=t.oauthTokenSecret):Sr("argument-error"),r}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(t){const r=typeof t=="string"?JSON.parse(t):t,{providerId:a,signInMethod:l,...c}=r;if(!a||!l)return null;const u=new xa(a,l);return u.idToken=c.idToken||void 0,u.accessToken=c.accessToken||void 0,u.secret=c.secret,u.nonce=c.nonce,u.pendingToken=c.pendingToken||null,u}_getIdTokenResponse(t){const r=this.buildRequest();return Ns(t,r)}_linkToIdToken(t,r){const a=this.buildRequest();return a.idToken=r,Ns(t,a)}_getReauthenticationResolver(t){const r=this.buildRequest();return r.autoCreate=!1,Ns(t,r)}buildRequest(){const t={requestUri:l3,returnSecureToken:!0};if(this.pendingToken)t.pendingToken=this.pendingToken;else{const r={};this.idToken&&(r.id_token=this.idToken),this.accessToken&&(r.access_token=this.accessToken),this.secret&&(r.oauth_token_secret=this.secret),r.providerId=this.providerId,this.nonce&&!this.pendingToken&&(r.nonce=this.nonce),t.postBody=bo(r)}return t}}/**
939
- * @license
940
- * Copyright 2020 Google LLC
941
- *
942
- * Licensed under the Apache License, Version 2.0 (the "License");
943
- * you may not use this file except in compliance with the License.
944
- * You may obtain a copy of the License at
945
- *
946
- * http://www.apache.org/licenses/LICENSE-2.0
947
- *
948
- * Unless required by applicable law or agreed to in writing, software
949
- * distributed under the License is distributed on an "AS IS" BASIS,
950
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
951
- * See the License for the specific language governing permissions and
952
- * limitations under the License.
953
- */class Dp{constructor(t){this.providerId=t,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(t){this.defaultLanguageCode=t}setCustomParameters(t){return this.customParameters=t,this}getCustomParameters(){return this.customParameters}}/**
954
- * @license
955
- * Copyright 2019 Google LLC
956
- *
957
- * Licensed under the Apache License, Version 2.0 (the "License");
958
- * you may not use this file except in compliance with the License.
959
- * You may obtain a copy of the License at
960
- *
961
- * http://www.apache.org/licenses/LICENSE-2.0
962
- *
963
- * Unless required by applicable law or agreed to in writing, software
964
- * distributed under the License is distributed on an "AS IS" BASIS,
965
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
966
- * See the License for the specific language governing permissions and
967
- * limitations under the License.
968
- */class xo extends Dp{constructor(){super(...arguments),this.scopes=[]}addScope(t){return this.scopes.includes(t)||this.scopes.push(t),this}getScopes(){return[...this.scopes]}}/**
969
- * @license
970
- * Copyright 2020 Google LLC
971
- *
972
- * Licensed under the Apache License, Version 2.0 (the "License");
973
- * you may not use this file except in compliance with the License.
974
- * You may obtain a copy of the License at
975
- *
976
- * http://www.apache.org/licenses/LICENSE-2.0
977
- *
978
- * Unless required by applicable law or agreed to in writing, software
979
- * distributed under the License is distributed on an "AS IS" BASIS,
980
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
981
- * See the License for the specific language governing permissions and
982
- * limitations under the License.
983
- */class Li extends xo{constructor(){super("facebook.com")}static credential(t){return xa._fromParams({providerId:Li.PROVIDER_ID,signInMethod:Li.FACEBOOK_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return Li.credentialFromTaggedObject(t)}static credentialFromError(t){return Li.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return Li.credential(t.oauthAccessToken)}catch{return null}}}Li.FACEBOOK_SIGN_IN_METHOD="facebook.com";Li.PROVIDER_ID="facebook.com";/**
984
- * @license
985
- * Copyright 2020 Google LLC
986
- *
987
- * Licensed under the Apache License, Version 2.0 (the "License");
988
- * you may not use this file except in compliance with the License.
989
- * You may obtain a copy of the License at
990
- *
991
- * http://www.apache.org/licenses/LICENSE-2.0
992
- *
993
- * Unless required by applicable law or agreed to in writing, software
994
- * distributed under the License is distributed on an "AS IS" BASIS,
995
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
996
- * See the License for the specific language governing permissions and
997
- * limitations under the License.
998
- */class Vr extends xo{constructor(){super("google.com"),this.addScope("profile")}static credential(t,r){return xa._fromParams({providerId:Vr.PROVIDER_ID,signInMethod:Vr.GOOGLE_SIGN_IN_METHOD,idToken:t,accessToken:r})}static credentialFromResult(t){return Vr.credentialFromTaggedObject(t)}static credentialFromError(t){return Vr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthIdToken:r,oauthAccessToken:a}=t;if(!r&&!a)return null;try{return Vr.credential(r,a)}catch{return null}}}Vr.GOOGLE_SIGN_IN_METHOD="google.com";Vr.PROVIDER_ID="google.com";/**
999
- * @license
1000
- * Copyright 2020 Google LLC
1001
- *
1002
- * Licensed under the Apache License, Version 2.0 (the "License");
1003
- * you may not use this file except in compliance with the License.
1004
- * You may obtain a copy of the License at
1005
- *
1006
- * http://www.apache.org/licenses/LICENSE-2.0
1007
- *
1008
- * Unless required by applicable law or agreed to in writing, software
1009
- * distributed under the License is distributed on an "AS IS" BASIS,
1010
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1011
- * See the License for the specific language governing permissions and
1012
- * limitations under the License.
1013
- */class Yr extends xo{constructor(){super("github.com")}static credential(t){return xa._fromParams({providerId:Yr.PROVIDER_ID,signInMethod:Yr.GITHUB_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return Yr.credentialFromTaggedObject(t)}static credentialFromError(t){return Yr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return Yr.credential(t.oauthAccessToken)}catch{return null}}}Yr.GITHUB_SIGN_IN_METHOD="github.com";Yr.PROVIDER_ID="github.com";/**
1014
- * @license
1015
- * Copyright 2020 Google LLC
1016
- *
1017
- * Licensed under the Apache License, Version 2.0 (the "License");
1018
- * you may not use this file except in compliance with the License.
1019
- * You may obtain a copy of the License at
1020
- *
1021
- * http://www.apache.org/licenses/LICENSE-2.0
1022
- *
1023
- * Unless required by applicable law or agreed to in writing, software
1024
- * distributed under the License is distributed on an "AS IS" BASIS,
1025
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1026
- * See the License for the specific language governing permissions and
1027
- * limitations under the License.
1028
- */class zi extends xo{constructor(){super("twitter.com")}static credential(t,r){return xa._fromParams({providerId:zi.PROVIDER_ID,signInMethod:zi.TWITTER_SIGN_IN_METHOD,oauthToken:t,oauthTokenSecret:r})}static credentialFromResult(t){return zi.credentialFromTaggedObject(t)}static credentialFromError(t){return zi.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthAccessToken:r,oauthTokenSecret:a}=t;if(!r||!a)return null;try{return zi.credential(r,a)}catch{return null}}}zi.TWITTER_SIGN_IN_METHOD="twitter.com";zi.PROVIDER_ID="twitter.com";/**
1029
- * @license
1030
- * Copyright 2020 Google LLC
1031
- *
1032
- * Licensed under the Apache License, Version 2.0 (the "License");
1033
- * you may not use this file except in compliance with the License.
1034
- * You may obtain a copy of the License at
1035
- *
1036
- * http://www.apache.org/licenses/LICENSE-2.0
1037
- *
1038
- * Unless required by applicable law or agreed to in writing, software
1039
- * distributed under the License is distributed on an "AS IS" BASIS,
1040
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1041
- * See the License for the specific language governing permissions and
1042
- * limitations under the License.
1043
- */class Ms{constructor(t){this.user=t.user,this.providerId=t.providerId,this._tokenResponse=t._tokenResponse,this.operationType=t.operationType}static async _fromIdTokenResponse(t,r,a,l=!1){const c=await ir._fromIdTokenResponse(t,a,l),u=v1(a);return new Ms({user:c,providerId:u,_tokenResponse:a,operationType:r})}static async _forOperation(t,r,a){await t._updateTokensIfNecessary(a,!0);const l=v1(a);return new Ms({user:t,providerId:l,_tokenResponse:a,operationType:r})}}function v1(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}/**
1044
- * @license
1045
- * Copyright 2020 Google LLC
1046
- *
1047
- * Licensed under the Apache License, Version 2.0 (the "License");
1048
- * you may not use this file except in compliance with the License.
1049
- * You may obtain a copy of the License at
1050
- *
1051
- * http://www.apache.org/licenses/LICENSE-2.0
1052
- *
1053
- * Unless required by applicable law or agreed to in writing, software
1054
- * distributed under the License is distributed on an "AS IS" BASIS,
1055
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1056
- * See the License for the specific language governing permissions and
1057
- * limitations under the License.
1058
- */class xu extends Fi{constructor(t,r,a,l){super(r.code,r.message),this.operationType=a,this.user=l,Object.setPrototypeOf(this,xu.prototype),this.customData={appName:t.name,tenantId:t.tenantId??void 0,_serverResponse:r.customData._serverResponse,operationType:a}}static _fromErrorAndOperation(t,r,a,l){return new xu(t,r,a,l)}}function EE(e,t,r,a){return(t==="reauthenticate"?r._getReauthenticationResolver(e):r._getIdTokenResponse(e)).catch(c=>{throw c.code==="auth/multi-factor-auth-required"?xu._fromErrorAndOperation(e,c,t,a):c})}async function o3(e,t,r=!1){const a=await oo(e,t._linkToIdToken(e.auth,await e.getIdToken()),r);return Ms._forOperation(e,"link",a)}/**
1059
- * @license
1060
- * Copyright 2019 Google LLC
1061
- *
1062
- * Licensed under the Apache License, Version 2.0 (the "License");
1063
- * you may not use this file except in compliance with the License.
1064
- * You may obtain a copy of the License at
1065
- *
1066
- * http://www.apache.org/licenses/LICENSE-2.0
1067
- *
1068
- * Unless required by applicable law or agreed to in writing, software
1069
- * distributed under the License is distributed on an "AS IS" BASIS,
1070
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1071
- * See the License for the specific language governing permissions and
1072
- * limitations under the License.
1073
- */async function c3(e,t,r=!1){const{auth:a}=e;if(xr(a.app))return Promise.reject(ga(a));const l="reauthenticate";try{const c=await oo(e,EE(a,l,t,e),r);Le(c.idToken,a,"internal-error");const u=Rp(c.idToken);Le(u,a,"internal-error");const{sub:d}=u;return Le(e.uid===d,a,"user-mismatch"),Ms._forOperation(e,l,c)}catch(c){throw(c==null?void 0:c.code)==="auth/user-not-found"&&Sr(a,"user-mismatch"),c}}/**
1074
- * @license
1075
- * Copyright 2020 Google LLC
1076
- *
1077
- * Licensed under the Apache License, Version 2.0 (the "License");
1078
- * you may not use this file except in compliance with the License.
1079
- * You may obtain a copy of the License at
1080
- *
1081
- * http://www.apache.org/licenses/LICENSE-2.0
1082
- *
1083
- * Unless required by applicable law or agreed to in writing, software
1084
- * distributed under the License is distributed on an "AS IS" BASIS,
1085
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1086
- * See the License for the specific language governing permissions and
1087
- * limitations under the License.
1088
- */async function u3(e,t,r=!1){if(xr(e.app))return Promise.reject(ga(e));const a="signIn",l=await EE(e,a,t),c=await Ms._fromIdTokenResponse(e,a,l);return r||await e._updateCurrentUser(c.user),c}function d3(e,t,r,a){return Ls(e).onIdTokenChanged(t,r,a)}function f3(e,t,r){return Ls(e).beforeAuthStateChanged(t,r)}const Eu="__sak";/**
1089
- * @license
1090
- * Copyright 2019 Google LLC
1091
- *
1092
- * Licensed under the Apache License, Version 2.0 (the "License");
1093
- * you may not use this file except in compliance with the License.
1094
- * You may obtain a copy of the License at
1095
- *
1096
- * http://www.apache.org/licenses/LICENSE-2.0
1097
- *
1098
- * Unless required by applicable law or agreed to in writing, software
1099
- * distributed under the License is distributed on an "AS IS" BASIS,
1100
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1101
- * See the License for the specific language governing permissions and
1102
- * limitations under the License.
1103
- */class _E{constructor(t,r){this.storageRetriever=t,this.type=r}_isAvailable(){try{return this.storage?(this.storage.setItem(Eu,"1"),this.storage.removeItem(Eu),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(t,r){return this.storage.setItem(t,JSON.stringify(r)),Promise.resolve()}_get(t){const r=this.storage.getItem(t);return Promise.resolve(r?JSON.parse(r):null)}_remove(t){return this.storage.removeItem(t),Promise.resolve()}get storage(){return this.storageRetriever()}}/**
1104
- * @license
1105
- * Copyright 2020 Google LLC
1106
- *
1107
- * Licensed under the Apache License, Version 2.0 (the "License");
1108
- * you may not use this file except in compliance with the License.
1109
- * You may obtain a copy of the License at
1110
- *
1111
- * http://www.apache.org/licenses/LICENSE-2.0
1112
- *
1113
- * Unless required by applicable law or agreed to in writing, software
1114
- * distributed under the License is distributed on an "AS IS" BASIS,
1115
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1116
- * See the License for the specific language governing permissions and
1117
- * limitations under the License.
1118
- */const h3=1e3,p3=10;class SE extends _E{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,r)=>this.onStorageEvent(t,r),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=bE(),this._shouldAllowMigration=!0}forAllChangedKeys(t){for(const r of Object.keys(this.listeners)){const a=this.storage.getItem(r),l=this.localCache[r];a!==l&&t(r,l,a)}}onStorageEvent(t,r=!1){if(!t.key){this.forAllChangedKeys((u,d,h)=>{this.notifyListeners(u,h)});return}const a=t.key;r?this.detachListener():this.stopPolling();const l=()=>{const u=this.storage.getItem(a);!r&&this.localCache[a]===u||this.notifyListeners(a,u)},c=this.storage.getItem(a);qI()&&c!==t.newValue&&t.newValue!==t.oldValue?setTimeout(l,p3):l()}notifyListeners(t,r){this.localCache[t]=r;const a=this.listeners[t];if(a)for(const l of Array.from(a))l(r&&JSON.parse(r))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((t,r,a)=>{this.onStorageEvent(new StorageEvent("storage",{key:t,oldValue:r,newValue:a}),!0)})},h3)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(t,r){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[t]||(this.listeners[t]=new Set,this.localCache[t]=this.storage.getItem(t)),this.listeners[t].add(r)}_removeListener(t,r){this.listeners[t]&&(this.listeners[t].delete(r),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(t,r){await super._set(t,r),this.localCache[t]=JSON.stringify(r)}async _get(t){const r=await super._get(t);return this.localCache[t]=JSON.stringify(r),r}async _remove(t){await super._remove(t),delete this.localCache[t]}}SE.type="LOCAL";const m3=SE;/**
1119
- * @license
1120
- * Copyright 2020 Google LLC
1121
- *
1122
- * Licensed under the Apache License, Version 2.0 (the "License");
1123
- * you may not use this file except in compliance with the License.
1124
- * You may obtain a copy of the License at
1125
- *
1126
- * http://www.apache.org/licenses/LICENSE-2.0
1127
- *
1128
- * Unless required by applicable law or agreed to in writing, software
1129
- * distributed under the License is distributed on an "AS IS" BASIS,
1130
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1131
- * See the License for the specific language governing permissions and
1132
- * limitations under the License.
1133
- */class wE extends _E{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(t,r){}_removeListener(t,r){}}wE.type="SESSION";const kE=wE;/**
1134
- * @license
1135
- * Copyright 2019 Google LLC
1136
- *
1137
- * Licensed under the Apache License, Version 2.0 (the "License");
1138
- * you may not use this file except in compliance with the License.
1139
- * You may obtain a copy of the License at
1140
- *
1141
- * http://www.apache.org/licenses/LICENSE-2.0
1142
- *
1143
- * Unless required by applicable law or agreed to in writing, software
1144
- * distributed under the License is distributed on an "AS IS" BASIS,
1145
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1146
- * See the License for the specific language governing permissions and
1147
- * limitations under the License.
1148
- */function g3(e){return Promise.all(e.map(async t=>{try{return{fulfilled:!0,value:await t}}catch(r){return{fulfilled:!1,reason:r}}}))}/**
1149
- * @license
1150
- * Copyright 2019 Google LLC
1151
- *
1152
- * Licensed under the Apache License, Version 2.0 (the "License");
1153
- * you may not use this file except in compliance with the License.
1154
- * You may obtain a copy of the License at
1155
- *
1156
- * http://www.apache.org/licenses/LICENSE-2.0
1157
- *
1158
- * Unless required by applicable law or agreed to in writing, software
1159
- * distributed under the License is distributed on an "AS IS" BASIS,
1160
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1161
- * See the License for the specific language governing permissions and
1162
- * limitations under the License.
1163
- */class Du{constructor(t){this.eventTarget=t,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(t){const r=this.receivers.find(l=>l.isListeningto(t));if(r)return r;const a=new Du(t);return this.receivers.push(a),a}isListeningto(t){return this.eventTarget===t}async handleEvent(t){const r=t,{eventId:a,eventType:l,data:c}=r.data,u=this.handlersMap[l];if(!(u!=null&&u.size))return;r.ports[0].postMessage({status:"ack",eventId:a,eventType:l});const d=Array.from(u).map(async p=>p(r.origin,c)),h=await g3(d);r.ports[0].postMessage({status:"done",eventId:a,eventType:l,response:h})}_subscribe(t,r){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[t]||(this.handlersMap[t]=new Set),this.handlersMap[t].add(r)}_unsubscribe(t,r){this.handlersMap[t]&&r&&this.handlersMap[t].delete(r),(!r||this.handlersMap[t].size===0)&&delete this.handlersMap[t],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}Du.receivers=[];/**
1164
- * @license
1165
- * Copyright 2020 Google LLC
1166
- *
1167
- * Licensed under the Apache License, Version 2.0 (the "License");
1168
- * you may not use this file except in compliance with the License.
1169
- * You may obtain a copy of the License at
1170
- *
1171
- * http://www.apache.org/licenses/LICENSE-2.0
1172
- *
1173
- * Unless required by applicable law or agreed to in writing, software
1174
- * distributed under the License is distributed on an "AS IS" BASIS,
1175
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1176
- * See the License for the specific language governing permissions and
1177
- * limitations under the License.
1178
- */function Lp(e="",t=10){let r="";for(let a=0;a<t;a++)r+=Math.floor(Math.random()*10);return e+r}/**
1179
- * @license
1180
- * Copyright 2019 Google LLC
1181
- *
1182
- * Licensed under the Apache License, Version 2.0 (the "License");
1183
- * you may not use this file except in compliance with the License.
1184
- * You may obtain a copy of the License at
1185
- *
1186
- * http://www.apache.org/licenses/LICENSE-2.0
1187
- *
1188
- * Unless required by applicable law or agreed to in writing, software
1189
- * distributed under the License is distributed on an "AS IS" BASIS,
1190
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1191
- * See the License for the specific language governing permissions and
1192
- * limitations under the License.
1193
- */class b3{constructor(t){this.target=t,this.handlers=new Set}removeMessageHandler(t){t.messageChannel&&(t.messageChannel.port1.removeEventListener("message",t.onMessage),t.messageChannel.port1.close()),this.handlers.delete(t)}async _send(t,r,a=50){const l=typeof MessageChannel<"u"?new MessageChannel:null;if(!l)throw new Error("connection_unavailable");let c,u;return new Promise((d,h)=>{const p=Lp("",20);l.port1.start();const b=setTimeout(()=>{h(new Error("unsupported_event"))},a);u={messageChannel:l,onMessage(y){const v=y;if(v.data.eventId===p)switch(v.data.status){case"ack":clearTimeout(b),c=setTimeout(()=>{h(new Error("timeout"))},3e3);break;case"done":clearTimeout(c),d(v.data.response);break;default:clearTimeout(b),clearTimeout(c),h(new Error("invalid_response"));break}}},this.handlers.add(u),l.port1.addEventListener("message",u.onMessage),this.target.postMessage({eventType:t,eventId:p,data:r},[l.port2])}).finally(()=>{u&&this.removeMessageHandler(u)})}}/**
1194
- * @license
1195
- * Copyright 2020 Google LLC
1196
- *
1197
- * Licensed under the Apache License, Version 2.0 (the "License");
1198
- * you may not use this file except in compliance with the License.
1199
- * You may obtain a copy of the License at
1200
- *
1201
- * http://www.apache.org/licenses/LICENSE-2.0
1202
- *
1203
- * Unless required by applicable law or agreed to in writing, software
1204
- * distributed under the License is distributed on an "AS IS" BASIS,
1205
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1206
- * See the License for the specific language governing permissions and
1207
- * limitations under the License.
1208
- */function _r(){return window}function y3(e){_r().location.href=e}/**
1209
- * @license
1210
- * Copyright 2020 Google LLC.
1211
- *
1212
- * Licensed under the Apache License, Version 2.0 (the "License");
1213
- * you may not use this file except in compliance with the License.
1214
- * You may obtain a copy of the License at
1215
- *
1216
- * http://www.apache.org/licenses/LICENSE-2.0
1217
- *
1218
- * Unless required by applicable law or agreed to in writing, software
1219
- * distributed under the License is distributed on an "AS IS" BASIS,
1220
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1221
- * See the License for the specific language governing permissions and
1222
- * limitations under the License.
1223
- */function TE(){return typeof _r().WorkerGlobalScope<"u"&&typeof _r().importScripts=="function"}async function v3(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function x3(){var e;return((e=navigator==null?void 0:navigator.serviceWorker)==null?void 0:e.controller)||null}function E3(){return TE()?self:null}/**
1224
- * @license
1225
- * Copyright 2019 Google LLC
1226
- *
1227
- * Licensed under the Apache License, Version 2.0 (the "License");
1228
- * you may not use this file except in compliance with the License.
1229
- * You may obtain a copy of the License at
1230
- *
1231
- * http://www.apache.org/licenses/LICENSE-2.0
1232
- *
1233
- * Unless required by applicable law or agreed to in writing, software
1234
- * distributed under the License is distributed on an "AS IS" BASIS,
1235
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1236
- * See the License for the specific language governing permissions and
1237
- * limitations under the License.
1238
- */const NE="firebaseLocalStorageDb",_3=1,_u="firebaseLocalStorage",CE="fbase_key";class Eo{constructor(t){this.request=t}toPromise(){return new Promise((t,r)=>{this.request.addEventListener("success",()=>{t(this.request.result)}),this.request.addEventListener("error",()=>{r(this.request.error)})})}}function Lu(e,t){return e.transaction([_u],t?"readwrite":"readonly").objectStore(_u)}function S3(){const e=indexedDB.deleteDatabase(NE);return new Eo(e).toPromise()}function Xh(){const e=indexedDB.open(NE,_3);return new Promise((t,r)=>{e.addEventListener("error",()=>{r(e.error)}),e.addEventListener("upgradeneeded",()=>{const a=e.result;try{a.createObjectStore(_u,{keyPath:CE})}catch(l){r(l)}}),e.addEventListener("success",async()=>{const a=e.result;a.objectStoreNames.contains(_u)?t(a):(a.close(),await S3(),t(await Xh()))})})}async function x1(e,t,r){const a=Lu(e,!0).put({[CE]:t,value:r});return new Eo(a).toPromise()}async function w3(e,t){const r=Lu(e,!1).get(t),a=await new Eo(r).toPromise();return a===void 0?null:a.value}function E1(e,t){const r=Lu(e,!0).delete(t);return new Eo(r).toPromise()}const k3=800,T3=3;class AE{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await Xh(),this.db)}async _withRetries(t){let r=0;for(;;)try{const a=await this._openDb();return await t(a)}catch(a){if(r++>T3)throw a;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return TE()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Du._getInstance(E3()),this.receiver._subscribe("keyChanged",async(t,r)=>({keyProcessed:(await this._poll()).includes(r.key)})),this.receiver._subscribe("ping",async(t,r)=>["keyChanged"])}async initializeSender(){var r,a;if(this.activeServiceWorker=await v3(),!this.activeServiceWorker)return;this.sender=new b3(this.activeServiceWorker);const t=await this.sender._send("ping",{},800);t&&(r=t[0])!=null&&r.fulfilled&&(a=t[0])!=null&&a.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(t){if(!(!this.sender||!this.activeServiceWorker||x3()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:t},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const t=await Xh();return await x1(t,Eu,"1"),await E1(t,Eu),!0}catch{}return!1}async _withPendingWrite(t){this.pendingWrites++;try{await t()}finally{this.pendingWrites--}}async _set(t,r){return this._withPendingWrite(async()=>(await this._withRetries(a=>x1(a,t,r)),this.localCache[t]=r,this.notifyServiceWorker(t)))}async _get(t){const r=await this._withRetries(a=>w3(a,t));return this.localCache[t]=r,r}async _remove(t){return this._withPendingWrite(async()=>(await this._withRetries(r=>E1(r,t)),delete this.localCache[t],this.notifyServiceWorker(t)))}async _poll(){const t=await this._withRetries(l=>{const c=Lu(l,!1).getAll();return new Eo(c).toPromise()});if(!t)return[];if(this.pendingWrites!==0)return[];const r=[],a=new Set;if(t.length!==0)for(const{fbase_key:l,value:c}of t)a.add(l),JSON.stringify(this.localCache[l])!==JSON.stringify(c)&&(this.notifyListeners(l,c),r.push(l));for(const l of Object.keys(this.localCache))this.localCache[l]&&!a.has(l)&&(this.notifyListeners(l,null),r.push(l));return r}notifyListeners(t,r){this.localCache[t]=r;const a=this.listeners[t];if(a)for(const l of Array.from(a))l(r)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),k3)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(t,r){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[t]||(this.listeners[t]=new Set,this._get(t)),this.listeners[t].add(r)}_removeListener(t,r){this.listeners[t]&&(this.listeners[t].delete(r),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&this.stopPolling()}}AE.type="LOCAL";const N3=AE;new vo(3e4,6e4);/**
1239
- * @license
1240
- * Copyright 2021 Google LLC
1241
- *
1242
- * Licensed under the Apache License, Version 2.0 (the "License");
1243
- * you may not use this file except in compliance with the License.
1244
- * You may obtain a copy of the License at
1245
- *
1246
- * http://www.apache.org/licenses/LICENSE-2.0
1247
- *
1248
- * Unless required by applicable law or agreed to in writing, software
1249
- * distributed under the License is distributed on an "AS IS" BASIS,
1250
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1251
- * See the License for the specific language governing permissions and
1252
- * limitations under the License.
1253
- */function OE(e,t){return t?Zr(t):(Le(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}/**
1254
- * @license
1255
- * Copyright 2019 Google LLC
1256
- *
1257
- * Licensed under the Apache License, Version 2.0 (the "License");
1258
- * you may not use this file except in compliance with the License.
1259
- * You may obtain a copy of the License at
1260
- *
1261
- * http://www.apache.org/licenses/LICENSE-2.0
1262
- *
1263
- * Unless required by applicable law or agreed to in writing, software
1264
- * distributed under the License is distributed on an "AS IS" BASIS,
1265
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1266
- * See the License for the specific language governing permissions and
1267
- * limitations under the License.
1268
- */class zp extends xE{constructor(t){super("custom","custom"),this.params=t}_getIdTokenResponse(t){return Ns(t,this._buildIdpRequest())}_linkToIdToken(t,r){return Ns(t,this._buildIdpRequest(r))}_getReauthenticationResolver(t){return Ns(t,this._buildIdpRequest())}_buildIdpRequest(t){const r={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return t&&(r.idToken=t),r}}function C3(e){return u3(e.auth,new zp(e),e.bypassAuthState)}function A3(e){const{auth:t,user:r}=e;return Le(r,t,"internal-error"),c3(r,new zp(e),e.bypassAuthState)}async function O3(e){const{auth:t,user:r}=e;return Le(r,t,"internal-error"),o3(r,new zp(e),e.bypassAuthState)}/**
1269
- * @license
1270
- * Copyright 2020 Google LLC
1271
- *
1272
- * Licensed under the Apache License, Version 2.0 (the "License");
1273
- * you may not use this file except in compliance with the License.
1274
- * You may obtain a copy of the License at
1275
- *
1276
- * http://www.apache.org/licenses/LICENSE-2.0
1277
- *
1278
- * Unless required by applicable law or agreed to in writing, software
1279
- * distributed under the License is distributed on an "AS IS" BASIS,
1280
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1281
- * See the License for the specific language governing permissions and
1282
- * limitations under the License.
1283
- */class RE{constructor(t,r,a,l,c=!1){this.auth=t,this.resolver=a,this.user=l,this.bypassAuthState=c,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(r)?r:[r]}execute(){return new Promise(async(t,r)=>{this.pendingPromise={resolve:t,reject:r};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(a){this.reject(a)}})}async onAuthEvent(t){const{urlResponse:r,sessionId:a,postBody:l,tenantId:c,error:u,type:d}=t;if(u){this.reject(u);return}const h={auth:this.auth,requestUri:r,sessionId:a,tenantId:c||void 0,postBody:l||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(d)(h))}catch(p){this.reject(p)}}onError(t){this.reject(t)}getIdpTask(t){switch(t){case"signInViaPopup":case"signInViaRedirect":return C3;case"linkViaPopup":case"linkViaRedirect":return O3;case"reauthViaPopup":case"reauthViaRedirect":return A3;default:Sr(this.auth,"internal-error")}}resolve(t){ei(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(t),this.unregisterAndCleanUp()}reject(t){ei(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(t),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/**
1284
- * @license
1285
- * Copyright 2020 Google LLC
1286
- *
1287
- * Licensed under the Apache License, Version 2.0 (the "License");
1288
- * you may not use this file except in compliance with the License.
1289
- * You may obtain a copy of the License at
1290
- *
1291
- * http://www.apache.org/licenses/LICENSE-2.0
1292
- *
1293
- * Unless required by applicable law or agreed to in writing, software
1294
- * distributed under the License is distributed on an "AS IS" BASIS,
1295
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1296
- * See the License for the specific language governing permissions and
1297
- * limitations under the License.
1298
- */const R3=new vo(2e3,1e4);async function ME(e,t,r){if(xr(e.app))return Promise.reject(sr(e,"operation-not-supported-in-this-environment"));const a=Iu(e);CI(e,t,Dp);const l=OE(a,r);return new ma(a,"signInViaPopup",t,l).executeNotNull()}class ma extends RE{constructor(t,r,a,l,c){super(t,r,l,c),this.provider=a,this.authWindow=null,this.pollId=null,ma.currentPopupAction&&ma.currentPopupAction.cancel(),ma.currentPopupAction=this}async executeNotNull(){const t=await this.execute();return Le(t,this.auth,"internal-error"),t}async onExecution(){ei(this.filter.length===1,"Popup operations only handle one event");const t=Lp();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],t),this.authWindow.associatedEvent=t,this.resolver._originValidation(this.auth).catch(r=>{this.reject(r)}),this.resolver._isIframeWebStorageSupported(this.auth,r=>{r||this.reject(sr(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var t;return((t=this.authWindow)==null?void 0:t.associatedEvent)||null}cancel(){this.reject(sr(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,ma.currentPopupAction=null}pollUserCancellation(){const t=()=>{var r,a;if((a=(r=this.authWindow)==null?void 0:r.window)!=null&&a.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(sr(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(t,R3.get())};t()}}ma.currentPopupAction=null;/**
1299
- * @license
1300
- * Copyright 2020 Google LLC
1301
- *
1302
- * Licensed under the Apache License, Version 2.0 (the "License");
1303
- * you may not use this file except in compliance with the License.
1304
- * You may obtain a copy of the License at
1305
- *
1306
- * http://www.apache.org/licenses/LICENSE-2.0
1307
- *
1308
- * Unless required by applicable law or agreed to in writing, software
1309
- * distributed under the License is distributed on an "AS IS" BASIS,
1310
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1311
- * See the License for the specific language governing permissions and
1312
- * limitations under the License.
1313
- */const M3="pendingRedirect",iu=new Map;class I3 extends RE{constructor(t,r,a=!1){super(t,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],r,void 0,a),this.eventId=null}async execute(){let t=iu.get(this.auth._key());if(!t){try{const a=await D3(this.resolver,this.auth)?await super.execute():null;t=()=>Promise.resolve(a)}catch(r){t=()=>Promise.reject(r)}iu.set(this.auth._key(),t)}return this.bypassAuthState||iu.set(this.auth._key(),()=>Promise.resolve(null)),t()}async onAuthEvent(t){if(t.type==="signInViaRedirect")return super.onAuthEvent(t);if(t.type==="unknown"){this.resolve(null);return}if(t.eventId){const r=await this.auth._redirectUserForId(t.eventId);if(r)return this.user=r,super.onAuthEvent(t);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function D3(e,t){const r=j3(t),a=z3(e);if(!await a._isAvailable())return!1;const l=await a._get(r)==="true";return await a._remove(r),l}function L3(e,t){iu.set(e._key(),t)}function z3(e){return Zr(e._redirectPersistence)}function j3(e){return ru(M3,e.config.apiKey,e.name)}async function B3(e,t,r=!1){if(xr(e.app))return Promise.reject(ga(e));const a=Iu(e),l=OE(a,t),u=await new I3(a,l,r).execute();return u&&!r&&(delete u.user._redirectEventId,await a._persistUserIfCurrent(u.user),await a._setRedirectUser(null,t)),u}/**
1314
- * @license
1315
- * Copyright 2020 Google LLC
1316
- *
1317
- * Licensed under the Apache License, Version 2.0 (the "License");
1318
- * you may not use this file except in compliance with the License.
1319
- * You may obtain a copy of the License at
1320
- *
1321
- * http://www.apache.org/licenses/LICENSE-2.0
1322
- *
1323
- * Unless required by applicable law or agreed to in writing, software
1324
- * distributed under the License is distributed on an "AS IS" BASIS,
1325
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1326
- * See the License for the specific language governing permissions and
1327
- * limitations under the License.
1328
- */const U3=600*1e3;class P3{constructor(t){this.auth=t,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(t){this.consumers.add(t),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,t)&&(this.sendToConsumer(this.queuedRedirectEvent,t),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(t){this.consumers.delete(t)}onEvent(t){if(this.hasEventBeenHandled(t))return!1;let r=!1;return this.consumers.forEach(a=>{this.isEventForConsumer(t,a)&&(r=!0,this.sendToConsumer(t,a),this.saveEventToCache(t))}),this.hasHandledPotentialRedirect||!H3(t)||(this.hasHandledPotentialRedirect=!0,r||(this.queuedRedirectEvent=t,r=!0)),r}sendToConsumer(t,r){var a;if(t.error&&!IE(t)){const l=((a=t.error.code)==null?void 0:a.split("auth/")[1])||"internal-error";r.onError(sr(this.auth,l))}else r.onAuthEvent(t)}isEventForConsumer(t,r){const a=r.eventId===null||!!t.eventId&&t.eventId===r.eventId;return r.filter.includes(t.type)&&a}hasEventBeenHandled(t){return Date.now()-this.lastProcessedEventTime>=U3&&this.cachedEventUids.clear(),this.cachedEventUids.has(_1(t))}saveEventToCache(t){this.cachedEventUids.add(_1(t)),this.lastProcessedEventTime=Date.now()}}function _1(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(t=>t).join("-")}function IE({type:e,error:t}){return e==="unknown"&&(t==null?void 0:t.code)==="auth/no-auth-event"}function H3(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return IE(e);default:return!1}}/**
1329
- * @license
1330
- * Copyright 2020 Google LLC
1331
- *
1332
- * Licensed under the Apache License, Version 2.0 (the "License");
1333
- * you may not use this file except in compliance with the License.
1334
- * You may obtain a copy of the License at
1335
- *
1336
- * http://www.apache.org/licenses/LICENSE-2.0
1337
- *
1338
- * Unless required by applicable law or agreed to in writing, software
1339
- * distributed under the License is distributed on an "AS IS" BASIS,
1340
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1341
- * See the License for the specific language governing permissions and
1342
- * limitations under the License.
1343
- */async function F3(e,t={}){return zs(e,"GET","/v1/projects",t)}/**
1344
- * @license
1345
- * Copyright 2020 Google LLC
1346
- *
1347
- * Licensed under the Apache License, Version 2.0 (the "License");
1348
- * you may not use this file except in compliance with the License.
1349
- * You may obtain a copy of the License at
1350
- *
1351
- * http://www.apache.org/licenses/LICENSE-2.0
1352
- *
1353
- * Unless required by applicable law or agreed to in writing, software
1354
- * distributed under the License is distributed on an "AS IS" BASIS,
1355
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1356
- * See the License for the specific language governing permissions and
1357
- * limitations under the License.
1358
- */const $3=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,G3=/^https?/;async function K3(e){if(e.config.emulator)return;const{authorizedDomains:t}=await F3(e);for(const r of t)try{if(q3(r))return}catch{}Sr(e,"unauthorized-domain")}function q3(e){const t=Yh(),{protocol:r,hostname:a}=new URL(t);if(e.startsWith("chrome-extension://")){const u=new URL(e);return u.hostname===""&&a===""?r==="chrome-extension:"&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):r==="chrome-extension:"&&u.hostname===a}if(!G3.test(r))return!1;if($3.test(e))return a===e;const l=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+l+"|"+l+")$","i").test(a)}/**
1359
- * @license
1360
- * Copyright 2020 Google LLC.
1361
- *
1362
- * Licensed under the Apache License, Version 2.0 (the "License");
1363
- * you may not use this file except in compliance with the License.
1364
- * You may obtain a copy of the License at
1365
- *
1366
- * http://www.apache.org/licenses/LICENSE-2.0
1367
- *
1368
- * Unless required by applicable law or agreed to in writing, software
1369
- * distributed under the License is distributed on an "AS IS" BASIS,
1370
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1371
- * See the License for the specific language governing permissions and
1372
- * limitations under the License.
1373
- */const V3=new vo(3e4,6e4);function S1(){const e=_r().___jsl;if(e!=null&&e.H){for(const t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let r=0;r<e.CP.length;r++)e.CP[r]=null}}function Y3(e){return new Promise((t,r)=>{var l,c,u;function a(){S1(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{S1(),r(sr(e,"network-request-failed"))},timeout:V3.get()})}if((c=(l=_r().gapi)==null?void 0:l.iframes)!=null&&c.Iframe)t(gapi.iframes.getContext());else if((u=_r().gapi)!=null&&u.load)a();else{const d=t3("iframefcb");return _r()[d]=()=>{gapi.load?a():r(sr(e,"network-request-failed"))},JI(`${e3()}?onload=${d}`).catch(h=>r(h))}}).catch(t=>{throw au=null,t})}let au=null;function W3(e){return au=au||Y3(e),au}/**
1374
- * @license
1375
- * Copyright 2020 Google LLC.
1376
- *
1377
- * Licensed under the Apache License, Version 2.0 (the "License");
1378
- * you may not use this file except in compliance with the License.
1379
- * You may obtain a copy of the License at
1380
- *
1381
- * http://www.apache.org/licenses/LICENSE-2.0
1382
- *
1383
- * Unless required by applicable law or agreed to in writing, software
1384
- * distributed under the License is distributed on an "AS IS" BASIS,
1385
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1386
- * See the License for the specific language governing permissions and
1387
- * limitations under the License.
1388
- */const X3=new vo(5e3,15e3),Z3="__/auth/iframe",Q3="emulator/auth/iframe",J3={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},eD=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function tD(e){const t=e.config;Le(t.authDomain,e,"auth-domain-config-required");const r=t.emulator?Ap(t,Q3):`https://${e.config.authDomain}/${Z3}`,a={apiKey:t.apiKey,appName:e.name,v:yo},l=eD.get(e.config.apiHost);l&&(a.eid=l);const c=e._getFrameworks();return c.length&&(a.fw=c.join(",")),`${r}?${bo(a).slice(1)}`}async function nD(e){const t=await W3(e),r=_r().gapi;return Le(r,e,"internal-error"),t.open({where:document.body,url:tD(e),messageHandlersFilter:r.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:J3,dontclear:!0},a=>new Promise(async(l,c)=>{await a.restyle({setHideOnLeave:!1});const u=sr(e,"network-request-failed"),d=_r().setTimeout(()=>{c(u)},X3.get());function h(){_r().clearTimeout(d),l(a)}a.ping(h).then(h,()=>{c(u)})}))}/**
1389
- * @license
1390
- * Copyright 2020 Google LLC.
1391
- *
1392
- * Licensed under the Apache License, Version 2.0 (the "License");
1393
- * you may not use this file except in compliance with the License.
1394
- * You may obtain a copy of the License at
1395
- *
1396
- * http://www.apache.org/licenses/LICENSE-2.0
1397
- *
1398
- * Unless required by applicable law or agreed to in writing, software
1399
- * distributed under the License is distributed on an "AS IS" BASIS,
1400
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1401
- * See the License for the specific language governing permissions and
1402
- * limitations under the License.
1403
- */const rD={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},iD=500,aD=600,sD="_blank",lD="http://localhost";class w1{constructor(t){this.window=t,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function oD(e,t,r,a=iD,l=aD){const c=Math.max((window.screen.availHeight-l)/2,0).toString(),u=Math.max((window.screen.availWidth-a)/2,0).toString();let d="";const h={...rD,width:a.toString(),height:l.toString(),top:c,left:u},p=pn().toLowerCase();r&&(d=fE(p)?sD:r),uE(p)&&(t=t||lD,h.scrollbars="yes");const b=Object.entries(h).reduce((v,[x,_])=>`${v}${x}=${_},`,"");if(KI(p)&&d!=="_self")return cD(t||"",d),new w1(null);const y=window.open(t||"",d,b);Le(y,e,"popup-blocked");try{y.focus()}catch{}return new w1(y)}function cD(e,t){const r=document.createElement("a");r.href=e,r.target=t;const a=document.createEvent("MouseEvent");a.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),r.dispatchEvent(a)}/**
1404
- * @license
1405
- * Copyright 2021 Google LLC
1406
- *
1407
- * Licensed under the Apache License, Version 2.0 (the "License");
1408
- * you may not use this file except in compliance with the License.
1409
- * You may obtain a copy of the License at
1410
- *
1411
- * http://www.apache.org/licenses/LICENSE-2.0
1412
- *
1413
- * Unless required by applicable law or agreed to in writing, software
1414
- * distributed under the License is distributed on an "AS IS" BASIS,
1415
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1416
- * See the License for the specific language governing permissions and
1417
- * limitations under the License.
1418
- */const uD="__/auth/handler",dD="emulator/auth/handler",fD=encodeURIComponent("fac");async function k1(e,t,r,a,l,c){Le(e.config.authDomain,e,"auth-domain-config-required"),Le(e.config.apiKey,e,"invalid-api-key");const u={apiKey:e.config.apiKey,appName:e.name,authType:r,redirectUrl:a,v:yo,eventId:l};if(t instanceof Dp){t.setDefaultLanguage(e.languageCode),u.providerId=t.providerId||"",d5(t.getCustomParameters())||(u.customParameters=JSON.stringify(t.getCustomParameters()));for(const[b,y]of Object.entries({}))u[b]=y}if(t instanceof xo){const b=t.getScopes().filter(y=>y!=="");b.length>0&&(u.scopes=b.join(","))}e.tenantId&&(u.tid=e.tenantId);const d=u;for(const b of Object.keys(d))d[b]===void 0&&delete d[b];const h=await e._getAppCheckToken(),p=h?`#${fD}=${encodeURIComponent(h)}`:"";return`${hD(e)}?${bo(d).slice(1)}${p}`}function hD({config:e}){return e.emulator?Ap(e,dD):`https://${e.authDomain}/${uD}`}/**
1419
- * @license
1420
- * Copyright 2020 Google LLC
1421
- *
1422
- * Licensed under the Apache License, Version 2.0 (the "License");
1423
- * you may not use this file except in compliance with the License.
1424
- * You may obtain a copy of the License at
1425
- *
1426
- * http://www.apache.org/licenses/LICENSE-2.0
1427
- *
1428
- * Unless required by applicable law or agreed to in writing, software
1429
- * distributed under the License is distributed on an "AS IS" BASIS,
1430
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1431
- * See the License for the specific language governing permissions and
1432
- * limitations under the License.
1433
- */const vh="webStorageSupport";class pD{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=kE,this._completeRedirectFn=B3,this._overrideRedirectResult=L3}async _openPopup(t,r,a,l){var u;ei((u=this.eventManagers[t._key()])==null?void 0:u.manager,"_initialize() not called before _openPopup()");const c=await k1(t,r,a,Yh(),l);return oD(t,c,Lp())}async _openRedirect(t,r,a,l){await this._originValidation(t);const c=await k1(t,r,a,Yh(),l);return y3(c),new Promise(()=>{})}_initialize(t){const r=t._key();if(this.eventManagers[r]){const{manager:l,promise:c}=this.eventManagers[r];return l?Promise.resolve(l):(ei(c,"If manager is not set, promise should be"),c)}const a=this.initAndGetManager(t);return this.eventManagers[r]={promise:a},a.catch(()=>{delete this.eventManagers[r]}),a}async initAndGetManager(t){const r=await nD(t),a=new P3(t);return r.register("authEvent",l=>(Le(l==null?void 0:l.authEvent,t,"invalid-auth-event"),{status:a.onEvent(l.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[t._key()]={manager:a},this.iframes[t._key()]=r,a}_isIframeWebStorageSupported(t,r){this.iframes[t._key()].send(vh,{type:vh},l=>{var u;const c=(u=l==null?void 0:l[0])==null?void 0:u[vh];c!==void 0&&r(!!c),Sr(t,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(t){const r=t._key();return this.originValidationPromises[r]||(this.originValidationPromises[r]=K3(t)),this.originValidationPromises[r]}get _shouldInitProactively(){return bE()||dE()||Mp()}}const mD=pD;var T1="@firebase/auth",N1="1.12.0";/**
1434
- * @license
1435
- * Copyright 2020 Google LLC
1436
- *
1437
- * Licensed under the Apache License, Version 2.0 (the "License");
1438
- * you may not use this file except in compliance with the License.
1439
- * You may obtain a copy of the License at
1440
- *
1441
- * http://www.apache.org/licenses/LICENSE-2.0
1442
- *
1443
- * Unless required by applicable law or agreed to in writing, software
1444
- * distributed under the License is distributed on an "AS IS" BASIS,
1445
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1446
- * See the License for the specific language governing permissions and
1447
- * limitations under the License.
1448
- */class gD{constructor(t){this.auth=t,this.internalListeners=new Map}getUid(){var t;return this.assertAuthConfigured(),((t=this.auth.currentUser)==null?void 0:t.uid)||null}async getToken(t){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(t)}:null}addAuthTokenListener(t){if(this.assertAuthConfigured(),this.internalListeners.has(t))return;const r=this.auth.onIdTokenChanged(a=>{t((a==null?void 0:a.stsTokenManager.accessToken)||null)});this.internalListeners.set(t,r),this.updateProactiveRefresh()}removeAuthTokenListener(t){this.assertAuthConfigured();const r=this.internalListeners.get(t);r&&(this.internalListeners.delete(t),r(),this.updateProactiveRefresh())}assertAuthConfigured(){Le(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
1449
- * @license
1450
- * Copyright 2020 Google LLC
1451
- *
1452
- * Licensed under the Apache License, Version 2.0 (the "License");
1453
- * you may not use this file except in compliance with the License.
1454
- * You may obtain a copy of the License at
1455
- *
1456
- * http://www.apache.org/licenses/LICENSE-2.0
1457
- *
1458
- * Unless required by applicable law or agreed to in writing, software
1459
- * distributed under the License is distributed on an "AS IS" BASIS,
1460
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1461
- * See the License for the specific language governing permissions and
1462
- * limitations under the License.
1463
- */function bD(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function yD(e){so(new Rs("auth",(t,{options:r})=>{const a=t.getProvider("app").getImmediate(),l=t.getProvider("heartbeat"),c=t.getProvider("app-check-internal"),{apiKey:u,authDomain:d}=a.options;Le(u&&!u.includes(":"),"invalid-api-key",{appName:a.name});const h={apiKey:u,authDomain:d,clientPlatform:e,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:yE(e)},p=new ZI(a,l,c,h);return r3(p,r),p},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,r,a)=>{t.getProvider("auth-internal").initialize()})),so(new Rs("auth-internal",t=>{const r=Iu(t.getProvider("auth").getImmediate());return(a=>new gD(a))(r)},"PRIVATE").setInstantiationMode("EXPLICIT")),ws(T1,N1,bD(e)),ws(T1,N1,"esm2020")}/**
1464
- * @license
1465
- * Copyright 2021 Google LLC
1466
- *
1467
- * Licensed under the Apache License, Version 2.0 (the "License");
1468
- * you may not use this file except in compliance with the License.
1469
- * You may obtain a copy of the License at
1470
- *
1471
- * http://www.apache.org/licenses/LICENSE-2.0
1472
- *
1473
- * Unless required by applicable law or agreed to in writing, software
1474
- * distributed under the License is distributed on an "AS IS" BASIS,
1475
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1476
- * See the License for the specific language governing permissions and
1477
- * limitations under the License.
1478
- */const vD=300,xD=W0("authIdTokenMaxAge")||vD;let C1=null;const ED=e=>async t=>{const r=t&&await t.getIdTokenResult(),a=r&&(new Date().getTime()-Date.parse(r.issuedAtTime))/1e3;if(a&&a>xD)return;const l=r==null?void 0:r.token;C1!==l&&(C1=l,await fetch(e,{method:l?"POST":"DELETE",headers:l?{Authorization:`Bearer ${l}`}:{}}))};function _D(e=hI()){const t=J0(e,"auth");if(t.isInitialized())return t.getImmediate();const r=n3(e,{popupRedirectResolver:mD,persistence:[N3,m3,kE]}),a=W0("authTokenSyncURL");if(a&&typeof isSecureContext=="boolean"&&isSecureContext){const c=new URL(a,location.origin);if(location.origin===c.origin){const u=ED(c.toString());f3(r,u,()=>u(r.currentUser)),d3(r,d=>u(d))}}const l=WM("auth");return l&&i3(r,`http://${l}`),r}function SD(){var e;return((e=document.getElementsByTagName("head"))==null?void 0:e[0])??document}QI({loadJS(e){return new Promise((t,r)=>{const a=document.createElement("script");a.setAttribute("src",e),a.onload=t,a.onerror=l=>{const c=sr("internal-error");c.customData=l,r(c)},a.type="text/javascript",a.charset="UTF-8",SD().appendChild(a)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});yD("Browser");const su={apiKey:"AIzaSyA8NdosgijoZoOSTHoRY4XA5WH-58OF3Yk",authDomain:"botschat-130ff.firebaseapp.com",projectId:"botschat-130ff"};let A1=null,xh=null;function DE(){return!!(su.apiKey&&su.authDomain&&su.projectId)}function LE(){if(!xh){if(!DE())throw new Error("Firebase is not configured. Set VITE_FIREBASE_* env vars.");A1=eE(su),xh=_D(A1)}return xh}async function wD(){const e=LE(),t=new Vr;t.addScope("email"),t.addScope("profile");const r=await ME(e,t);return{idToken:await r.user.getIdToken(),email:r.user.email??"",displayName:r.user.displayName,photoURL:r.user.photoURL,provider:"google"}}async function kD(){const e=LE(),t=new Yr;t.addScope("user:email");const r=await ME(e,t);return{idToken:await r.user.getIdToken(),email:r.user.email??"",displayName:r.user.displayName,photoURL:r.user.photoURL,provider:"github"}}function TD(){return m.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 48 48",style:{flexShrink:0},children:[m.jsx("path",{fill:"#EA4335",d:"M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"}),m.jsx("path",{fill:"#4285F4",d:"M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"}),m.jsx("path",{fill:"#FBBC05",d:"M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"}),m.jsx("path",{fill:"#34A853",d:"M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"})]})}function ND(){return m.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",style:{flexShrink:0},children:m.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z"})})}function CD(){const e=ti(),[t,r]=D.useState(!1),[a,l]=D.useState(""),[c,u]=D.useState(""),[d,h]=D.useState(""),[p,b]=D.useState(""),[y,v]=D.useState(!1),[x,_]=D.useState(null),[T,C]=D.useState(null),S=DE(),R=y||!!x;D.useEffect(()=>{Pl.config().then(C).catch(()=>{C({emailEnabled:!0,googleEnabled:S,githubEnabled:S})})},[S]);const M=(T==null?void 0:T.emailEnabled)??!0,A=T!==null,P=A&&(S||M),I=ee=>{uo(ee.token),ee.refreshToken&&Su(ee.refreshToken),e({type:"SET_USER",user:{id:ee.id,email:ee.email,displayName:ee.displayName}})},W=async ee=>{ee.preventDefault(),b(""),v(!0);try{let U;t?(ue.info("Auth",`Registering new account: ${a}`),U=await Pl.register(a,c,d||void 0)):(ue.info("Auth",`Logging in: ${a}`),U=await Pl.login(a,c)),ue.info("Auth",`${t?"Register":"Login"} success — user ${U.id} (${U.email})`),I(U),t&&localStorage.setItem("botschat_onboarding_dismissed","1")}catch(U){const F=U instanceof Error?U.message:"Something went wrong";ue.error("Auth",`${t?"Register":"Login"} failed: ${F}`),b(F)}finally{v(!1)}},te=async ee=>{b(""),_(ee);try{ue.info("Auth",`Starting ${ee} sign-in`);const U=ee==="google"?wD:kD,{idToken:F}=await U();ue.info("Auth",`Got Firebase ID token from ${ee}, verifying with backend`);const X=await Pl.firebase(F);ue.info("Auth",`${ee} sign-in success — user ${X.id} (${X.email})`),I(X)}catch(U){if(U instanceof Error&&(U.message.includes("popup-closed-by-user")||U.message.includes("cancelled")))ue.info("Auth",`${ee} sign-in cancelled by user`);else{const F=U instanceof Error?U.message:`${ee} sign-in failed`;ue.error("Auth",`${ee} sign-in failed: ${F}`),b(F)}}finally{_(null)}};return m.jsx("div",{className:"min-h-screen flex items-center justify-center",style:{background:"var(--bg-secondary)"},children:m.jsxs("div",{className:"w-full max-w-md",children:[m.jsxs("div",{className:"text-center mb-8",children:[m.jsx("img",{src:"/botschat-logo.png",alt:"BotsChat",className:"inline-block w-16 h-16 mb-4"}),m.jsx("h1",{className:"text-3xl font-bold",style:{color:"var(--text-primary)"},children:"BotsChat"}),m.jsx("p",{className:"mt-2",style:{color:"var(--text-secondary)"},children:"Multi-channel AI chat powered by OpenClaw"})]}),m.jsxs("div",{className:"rounded-md p-8",style:{background:"var(--bg-surface)",boxShadow:"var(--shadow-lg)"},children:[m.jsx("h2",{className:"text-h1 mb-6",style:{color:"var(--text-primary)"},children:M&&t?"Create account":"Sign in"}),!A&&m.jsx("div",{className:"py-8 text-center",style:{color:"var(--text-muted)"},children:m.jsx("span",{className:"text-body",children:"Loading sign-in options…"})}),A&&!P&&m.jsx("div",{className:"py-4 text-caption",style:{color:"var(--text-secondary)"},children:"Sign-in is not configured. Please contact support."}),A&&S&&m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"space-y-3",children:[m.jsx("button",{type:"button",onClick:()=>te("google"),disabled:R,className:"w-full flex items-center justify-center gap-3 py-2.5 px-4 font-medium text-body rounded-sm disabled:opacity-50 transition-colors hover:brightness-95",style:{background:"var(--bg-surface)",color:"var(--text-primary)",border:"1px solid var(--border)"},children:x==="google"?m.jsx("span",{children:"Signing in..."}):m.jsxs(m.Fragment,{children:[m.jsx(TD,{}),m.jsx("span",{children:"Continue with Google"})]})}),m.jsx("button",{type:"button",onClick:()=>te("github"),disabled:R,className:"w-full flex items-center justify-center gap-3 py-2.5 px-4 font-medium text-body rounded-sm disabled:opacity-50 transition-colors hover:brightness-95",style:{background:"var(--bg-surface)",color:"var(--text-primary)",border:"1px solid var(--border)"},children:x==="github"?m.jsx("span",{children:"Signing in..."}):m.jsxs(m.Fragment,{children:[m.jsx(ND,{}),m.jsx("span",{children:"Continue with GitHub"})]})})]}),A&&M&&m.jsxs("div",{className:"flex items-center gap-3 my-5",children:[m.jsx("div",{className:"flex-1 h-px",style:{background:"var(--border)"}}),m.jsx("span",{className:"text-caption",style:{color:"var(--text-muted)"},children:"or"}),m.jsx("div",{className:"flex-1 h-px",style:{background:"var(--border)"}})]})]}),p&&m.jsx("div",{className:"text-caption px-3 py-2 rounded-sm mt-4",style:{background:"rgba(224,30,90,0.1)",color:"var(--accent-red)"},children:p}),A&&M&&m.jsxs(m.Fragment,{children:[m.jsxs("form",{onSubmit:W,className:"space-y-4",children:[t&&m.jsxs("div",{children:[m.jsx("label",{className:"block text-caption font-bold mb-1",style:{color:"var(--text-secondary)"},children:"Display Name"}),m.jsx("input",{type:"text",value:d,onChange:ee=>h(ee.target.value),className:"w-full px-3 py-2.5 text-body rounded-sm focus:outline-none placeholder:text-[--text-muted]",style:{background:"var(--bg-surface)",color:"var(--text-primary)",border:"1px solid var(--border)"},placeholder:"Your name"})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-caption font-bold mb-1",style:{color:"var(--text-secondary)"},children:"Email"}),m.jsx("input",{type:"email",value:a,onChange:ee=>l(ee.target.value),required:!0,className:"w-full px-3 py-2.5 text-body rounded-sm focus:outline-none placeholder:text-[--text-muted]",style:{background:"var(--bg-surface)",color:"var(--text-primary)",border:"1px solid var(--border)"},placeholder:"you@example.com"})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-caption font-bold mb-1",style:{color:"var(--text-secondary)"},children:"Password"}),m.jsx("input",{type:"password",value:c,onChange:ee=>u(ee.target.value),required:!0,className:"w-full px-3 py-2.5 text-body rounded-sm focus:outline-none placeholder:text-[--text-muted]",style:{background:"var(--bg-surface)",color:"var(--text-primary)",border:"1px solid var(--border)"},placeholder:"Enter password"})]}),m.jsx("button",{type:"submit",disabled:R,className:"w-full py-2.5 font-bold text-body text-white rounded-sm disabled:opacity-50 transition-colors hover:brightness-110",style:{background:"var(--bg-active)"},children:y?"...":t?"Create account":"Sign in with email"})]}),m.jsx("div",{className:"mt-6 text-center",children:m.jsx("button",{onClick:()=>{r(!t),b("")},className:"text-caption hover:underline",style:{color:"var(--text-link)"},children:t?"Already have an account? Sign in":"Don't have an account? Register"})})]})]})]})})}function AD({text:e}){const[t,r]=D.useState(!1),a=async()=>{try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),2e3)}catch{const l=document.createElement("textarea");l.value=e,document.body.appendChild(l),l.select(),document.execCommand("copy"),document.body.removeChild(l),r(!0),setTimeout(()=>r(!1),2e3)}};return m.jsx("button",{onClick:a,className:"shrink-0 px-2.5 py-1 text-tiny font-medium rounded-sm transition-colors",style:{background:t?"var(--accent-green)":"var(--bg-hover)",color:t?"#fff":"var(--text-secondary)"},children:t?"Copied!":"Copy"})}function Jc({code:e,multiline:t}){return m.jsxs("div",{className:"flex items-start gap-2 rounded-md px-3 py-2.5",style:{background:"var(--code-bg)",border:"1px solid var(--border)"},children:[m.jsx("pre",{className:"flex-1 text-caption font-mono overflow-x-auto whitespace-pre-wrap break-all",style:{color:"var(--text-primary)"},children:e}),m.jsx(AD,{text:e})]})}function OD({color:e}){return m.jsxs("span",{className:"relative flex h-3 w-3",children:[m.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",style:{backgroundColor:e}}),m.jsx("span",{className:"relative inline-flex rounded-full h-3 w-3",style:{backgroundColor:e}})]})}function RD({onSkip:e}){const t=lr(),[r,a]=D.useState(null),[l,c]=D.useState(!0),[u,d]=D.useState(""),[h,p]=D.useState(""),[b,y]=D.useState(!0),[v,x]=D.useState(!1),[_,T]=D.useState(""),[C,S]=D.useState(!1),[R,M]=D.useState(!1),[A,P]=D.useState(typeof window<"u"?window.location.origin:"https://console.botschat.app"),[I,W]=D.useState(!1),[te,ee]=D.useState(),[U,F]=D.useState(!1);D.useEffect(()=>{let z=!1;async function Q(){try{const ie=await tx.cloudUrl();if(z)return;P(ie.cloudUrl),W(ie.isLoopback),ee(ie.hint)}catch(ie){ue.warn("Onboarding",`Failed to fetch cloudUrl, using origin: ${ie}`);const B=window.location.hostname,w=B==="localhost"||B.startsWith("127.");W(w),w&&ee("This URL (localhost) only works on this machine. If your OpenClaw is on a different host, replace with its LAN IP.")}}return Q(),()=>{z=!0}},[]),D.useEffect(()=>{let z=!1;async function Q(){c(!0);try{const{token:ie}=await Hl.create("Default");z||a(ie)}catch(ie){ue.error("Onboarding",`Failed to create pairing token: ${ie}`)}finally{z||c(!1)}}return Q(),()=>{z=!0}},[]);const X=u.length>=6&&u===h,me=async()=>{var z;if(X){if(!((z=t.user)!=null&&z.id)){T("User not loaded yet. Please wait.");return}S(!0),T("");try{await vt.setPassword(u,t.user.id,b),x(!0)}catch{T("Failed to derive encryption key. Please try again.")}finally{S(!1)}}},le=r?`openclaw plugins install @botschat/botschat && \\
1479
- openclaw config set channels.botschat.cloudUrl ${A} && \\
1480
- openclaw config set channels.botschat.pairingToken ${r} && \\
1481
- openclaw config set channels.botschat.e2ePassword "${u}" && \\
1482
- openclaw config set channels.botschat.enabled true && \\
1483
- openclaw gateway restart`:"Loading...",K=t.openclawConnected;return m.jsx("div",{className:"min-h-screen flex items-center justify-center p-4",style:{background:"var(--bg-secondary)"},children:m.jsxs("div",{className:"w-full max-w-xl",children:[m.jsxs("div",{className:"text-center mb-8",children:[m.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-xl text-white text-2xl font-bold mb-4",style:{background:"#1264A3"},children:"BC"}),m.jsx("h1",{className:"text-3xl font-bold",style:{color:"var(--text-primary)"},children:"Welcome to BotsChat!"}),m.jsx("p",{className:"mt-2",style:{color:"var(--text-secondary)"},children:"Connect your OpenClaw agent to start chatting."})]}),m.jsx("div",{className:"rounded-md p-8",style:{background:"var(--bg-surface)",boxShadow:"var(--shadow-lg)"},children:K?m.jsxs("div",{className:"text-center py-6",children:[m.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full mb-4",style:{background:"rgba(43, 172, 118, 0.15)"},children:m.jsx("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"var(--accent-green)",strokeWidth:2.5,children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),m.jsx("h2",{className:"text-h1 font-bold mb-2",style:{color:"var(--text-primary)"},children:"OpenClaw Connected!"}),m.jsx("p",{className:"text-body mb-6",style:{color:"var(--text-secondary)"},children:"Your agent is ready. Start chatting now."}),m.jsx("button",{onClick:e,className:"px-6 py-2.5 font-bold text-body text-white rounded-sm transition-colors hover:brightness-110",style:{background:"var(--bg-active)"},children:"Start Chatting"})]}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"flex items-center gap-3 rounded-md px-4 py-3 mb-6",style:{background:"rgba(232, 162, 48, 0.1)",border:"1px solid rgba(232, 162, 48, 0.3)"},children:[m.jsx(OD,{color:"var(--accent-yellow)"}),m.jsx("span",{className:"text-caption font-medium",style:{color:"var(--accent-yellow)"},children:"Waiting for OpenClaw connection..."})]}),m.jsxs("div",{className:"mb-6",children:[m.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[m.jsx("span",{className:"inline-flex items-center justify-center w-6 h-6 rounded-full text-tiny font-bold text-white",style:{background:v?"var(--accent-green)":"var(--bg-active)"},children:v?m.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):"1"}),m.jsx("h3",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:"Set your E2E encryption password"})]}),v?m.jsx("p",{className:"text-caption ml-8",style:{color:"var(--accent-green)"},children:"E2E encryption is active. Your encryption key has been derived."}):m.jsxs("div",{className:"ml-8",children:[m.jsxs("p",{className:"text-caption mb-3",style:{color:"var(--text-secondary)"},children:["Your messages, prompts, and task results will be ",m.jsx("strong",{children:"encrypted on this device"})," before they leave — the server only stores ciphertext it cannot read."]}),m.jsx("div",{className:"mb-3 rounded-md overflow-hidden",style:{border:"1px solid var(--border)"},children:m.jsx("img",{src:"/architecture.png",alt:"BotsChat E2E Encryption Architecture",className:"w-full",style:{display:"block"}})}),m.jsxs("p",{className:"text-caption mb-4",style:{color:"var(--text-muted)"},children:["Encryption keys are derived locally and never sent to the server."," ",m.jsx("a",{href:"https://botschat.app/#features",target:"_blank",rel:"noopener noreferrer",className:"underline",style:{color:"var(--text-link)"},children:"Learn more"})]}),m.jsxs("div",{className:"space-y-2.5",children:[m.jsxs("div",{className:"relative",children:[m.jsx("input",{type:R?"text":"password",value:u,onChange:z=>d(z.target.value),placeholder:"E2E encryption password (min 6 chars)",className:"w-full px-3 py-2 pr-10 rounded-sm text-caption",style:{background:"var(--code-bg)",border:"1px solid var(--border)",color:"var(--text-primary)",outline:"none"}}),m.jsx("button",{type:"button",onClick:()=>M(!R),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1",style:{color:"var(--text-muted)"},tabIndex:-1,children:R?m.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94"}),m.jsx("path",{d:"M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19"}),m.jsx("path",{d:"M14.12 14.12a3 3 0 1 1-4.24-4.24"}),m.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}):m.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),m.jsx("circle",{cx:"12",cy:"12",r:"3"})]})})]}),m.jsxs("div",{className:"relative",children:[m.jsx("input",{type:R?"text":"password",value:h,onChange:z=>p(z.target.value),placeholder:"Confirm password",className:"w-full px-3 py-2 pr-10 rounded-sm text-caption",style:{background:"var(--code-bg)",border:`1px solid ${h&&u!==h?"var(--accent-red, #e53e3e)":"var(--border)"}`,color:"var(--text-primary)",outline:"none"}}),m.jsx("button",{type:"button",onClick:()=>M(!R),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1",style:{color:"var(--text-muted)"},tabIndex:-1,children:R?m.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94"}),m.jsx("path",{d:"M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19"}),m.jsx("path",{d:"M14.12 14.12a3 3 0 1 1-4.24-4.24"}),m.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}):m.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),m.jsx("circle",{cx:"12",cy:"12",r:"3"})]})})]}),h&&u!==h&&m.jsx("p",{className:"text-caption",style:{color:"var(--accent-red, #e53e3e)"},children:"Passwords do not match."}),m.jsxs("label",{className:"flex items-center gap-2 text-caption",style:{color:"var(--text-secondary)"},children:[m.jsx("input",{type:"checkbox",checked:b,onChange:z=>y(z.target.checked)}),"Remember on this device"]}),_&&m.jsx("p",{className:"text-caption",style:{color:"var(--accent-red, #e53e3e)"},children:_}),m.jsx("button",{onClick:me,disabled:!X||C,className:"w-full py-2 font-bold text-caption text-white rounded-sm transition-colors",style:{background:X&&!C?"var(--bg-active)":"var(--bg-hover)",cursor:X&&!C?"pointer":"not-allowed",opacity:X&&!C?1:.5},children:C?"Deriving key...":"Set E2E Password & Continue"})]})]})]}),m.jsxs("div",{className:"mb-6",style:{opacity:v?1:.4,pointerEvents:v?"auto":"none"},children:[m.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[m.jsx("span",{className:"inline-flex items-center justify-center w-6 h-6 rounded-full text-tiny font-bold text-white",style:{background:"var(--bg-active)"},children:"2"}),m.jsx("h3",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:"Run this command on your OpenClaw machine"})]}),m.jsx("p",{className:"text-caption mb-3 ml-8",style:{color:"var(--text-secondary)"},children:"This installs the BotsChat plugin, configures the connection, and restarts the gateway."}),I&&m.jsxs("div",{className:"flex items-start gap-2 rounded-md px-3 py-2.5 mb-3 ml-8 text-caption",style:{background:"rgba(232, 162, 48, 0.1)",border:"1px solid rgba(232, 162, 48, 0.25)",color:"var(--accent-yellow)"},children:[m.jsx("svg",{className:"w-4 h-4 mt-0.5 shrink-0",viewBox:"0 0 20 20",fill:"currentColor",children:m.jsx("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.168 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 6a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 6zm0 9a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})}),m.jsxs("span",{children:[te||"localhost URL may not be reachable from other machines."," ",m.jsx("button",{onClick:()=>F(!0),className:"underline font-medium hover:brightness-110",style:{color:"var(--text-link)"},children:"Change URL"})]})]}),U&&m.jsxs("div",{className:"flex items-center gap-2 mb-3 ml-8",children:[m.jsx("label",{className:"text-caption font-bold shrink-0",style:{color:"var(--text-secondary)"},children:"Cloud URL:"}),m.jsx("input",{type:"text",value:A,onChange:z=>{P(z.target.value.replace(/\/+$/,"")),W(!1)},className:"flex-1 px-2.5 py-1.5 rounded-sm text-caption font-mono",style:{background:"var(--code-bg)",border:"1px solid var(--border)",color:"var(--text-primary)",outline:"none"},placeholder:"http://192.168.x.x:8787",autoFocus:!0}),m.jsx("button",{onClick:()=>F(!1),className:"px-2.5 py-1 text-tiny font-medium rounded-sm",style:{background:"var(--bg-active)",color:"#fff"},children:"Done"})]}),m.jsx("div",{className:"ml-8",children:l?m.jsx("div",{className:"rounded-md px-3 py-2.5 animate-pulse",style:{background:"var(--code-bg)",height:"80px"}}):m.jsx(Jc,{code:le,multiline:!0})})]}),m.jsxs("div",{className:"mb-6",style:{opacity:v?1:.4,pointerEvents:v?"auto":"none"},children:[m.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[m.jsx("span",{className:"inline-flex items-center justify-center w-6 h-6 rounded-full text-tiny font-bold text-white",style:{background:"var(--bg-active)"},children:"3"}),m.jsx("h3",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:"Verify connection"})]}),m.jsx("p",{className:"text-caption ml-8",style:{color:"var(--text-secondary)"},children:'Check the gateway logs — you should see "Authenticated with BotsChat cloud":'}),m.jsx("div",{className:"ml-8 mt-2",children:m.jsx(Jc,{code:"openclaw gateway logs"})})]}),m.jsxs("details",{className:"mb-4",children:[m.jsx("summary",{className:"text-caption font-medium cursor-pointer select-none",style:{color:"var(--text-link)"},children:"Or configure manually"}),m.jsxs("div",{className:"mt-3 space-y-3 ml-1",children:[m.jsxs("div",{children:[m.jsx("label",{className:"block text-caption font-bold mb-1",style:{color:"var(--text-secondary)"},children:"Your Pairing Token"}),r?m.jsx(Jc,{code:r}):m.jsx("span",{className:"text-caption",style:{color:"var(--text-muted)"},children:"Loading..."})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-caption font-bold mb-1",style:{color:"var(--text-secondary)"},children:"Cloud URL"}),m.jsx(Jc,{code:A})]})]})]}),m.jsx("div",{className:"text-center pt-2",children:m.jsx("button",{onClick:e,className:"text-caption hover:underline",style:{color:"var(--text-muted)"},children:"Skip for now"})})]})})]})})}function zE({text:e}){const[t,r]=D.useState(!1),a=async()=>{try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),2e3)}catch{const l=document.createElement("textarea");l.value=e,document.body.appendChild(l),l.select(),document.execCommand("copy"),document.body.removeChild(l),r(!0),setTimeout(()=>r(!1),2e3)}};return m.jsx("button",{onClick:a,className:"shrink-0 px-2.5 py-1 text-tiny font-medium rounded-sm transition-colors",style:{background:t?"var(--accent-green)":"var(--bg-hover)",color:t?"#fff":"var(--text-secondary)"},children:t?"Copied!":"Copy"})}function MD({code:e}){return m.jsxs("div",{className:"flex items-start gap-2 rounded-md px-3 py-2.5",style:{background:"var(--code-bg)",border:"1px solid var(--border)"},children:[m.jsx("pre",{className:"flex-1 text-caption font-mono overflow-x-auto whitespace-pre-wrap break-all",style:{color:"var(--text-primary)"},children:e}),m.jsx(zE,{text:e})]})}function ID(e){const r=Date.now()/1e3-e;return r<60?"Just now":r<3600?`${Math.floor(r/60)}m ago`:r<86400?`${Math.floor(r/3600)}h ago`:r<604800?`${Math.floor(r/86400)}d ago`:new Date(e*1e3).toLocaleDateString()}function jE(){const e=lr(),[t,r]=D.useState([]),[a,l]=D.useState(!0),[c,u]=D.useState(typeof window<"u"?window.location.origin:"https://console.botschat.app"),[d,h]=D.useState(!1),[p,b]=D.useState(),[y,v]=D.useState(!1),[x,_]=D.useState(!1),[T,C]=D.useState(""),[S,R]=D.useState(!1),[M,A]=D.useState(null);D.useEffect(()=>{let F=!1;return tx.cloudUrl().then(X=>{F||(u(X.cloudUrl),h(X.isLoopback),b(X.hint))}).catch(X=>{ue.warn("ConnectionSettings",`Failed to fetch cloudUrl: ${X}`);const me=window.location.hostname,le=me==="localhost"||me.startsWith("127.");h(le),le&&b("This URL (localhost) only works on this machine. If your OpenClaw is on a different host, replace with its LAN IP.")}),()=>{F=!0}},[]),D.useEffect(()=>{let F=!1;return l(!0),Hl.list().then(({tokens:X})=>{F||r(X)}).catch(X=>{ue.error("ConnectionSettings",`Failed to list tokens: ${X}`)}).finally(()=>{F||l(!1)}),()=>{F=!0}},[]);const P=D.useCallback(async()=>{R(!0);try{const F=await Hl.create(T.trim()||void 0);A({id:F.id,token:F.token});const{tokens:X}=await Hl.list();r(X),C(""),_(!1)}catch(F){ue.error("ConnectionSettings",`Failed to create token: ${F}`)}finally{R(!1)}},[T]),I=D.useCallback(async F=>{try{await Hl.delete(F),r(X=>X.filter(me=>me.id!==F)),(M==null?void 0:M.id)===F&&A(null)}catch(X){ue.error("ConnectionSettings",`Failed to revoke token: ${X}`)}},[M]),W=(M==null?void 0:M.token)??null,te=vt.getPassword(),ee=W?`openclaw plugins install @botschat/botschat && \\
1484
- openclaw config set channels.botschat.cloudUrl ${c} && \\
1485
- openclaw config set channels.botschat.pairingToken ${W} && \\${te?`
1486
- openclaw config set channels.botschat.e2ePassword "${te}" && \\`:""}
1487
- openclaw config set channels.botschat.enabled true && \\
1488
- openclaw gateway restart`:null,U=e.openclawConnected;return m.jsxs("div",{className:"space-y-5",children:[m.jsxs("div",{children:[m.jsx("label",{className:"block text-caption font-bold mb-1.5",style:{color:"var(--text-secondary)"},children:"OpenClaw Status"}),m.jsxs("div",{className:"flex items-center gap-3 rounded-md px-4 py-3",style:{background:U?"rgba(43, 172, 118, 0.1)":"rgba(232, 162, 48, 0.1)",border:`1px solid ${U?"rgba(43, 172, 118, 0.3)":"rgba(232, 162, 48, 0.3)"}`},children:[m.jsx("span",{className:"w-2.5 h-2.5 rounded-full shrink-0",style:{background:U?"var(--accent-green)":"var(--accent-yellow)"}}),m.jsx("span",{className:"text-caption font-medium",style:{color:U?"var(--accent-green)":"var(--accent-yellow)"},children:U?"Connected to OpenClaw":"Not connected"})]})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-caption font-bold mb-1.5",style:{color:"var(--text-secondary)"},children:"Setup Command"}),m.jsx("p",{className:"text-tiny mb-2",style:{color:"var(--text-muted)"},children:"Run this on your OpenClaw machine to install and connect the plugin."}),d&&m.jsxs("div",{className:"flex items-start gap-2 rounded-md px-3 py-2 mb-2 text-tiny",style:{background:"rgba(232, 162, 48, 0.1)",border:"1px solid rgba(232, 162, 48, 0.25)",color:"var(--accent-yellow)"},children:[m.jsx("svg",{className:"w-3.5 h-3.5 mt-0.5 shrink-0",viewBox:"0 0 20 20",fill:"currentColor",children:m.jsx("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.168 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 6a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 6zm0 9a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})}),m.jsxs("span",{children:[p||"localhost URL may not be reachable from other machines."," ",m.jsx("button",{onClick:()=>v(!0),className:"underline font-medium hover:brightness-110",style:{color:"var(--text-link)"},children:"Change URL"})]})]}),y&&m.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[m.jsx("label",{className:"text-tiny font-bold shrink-0",style:{color:"var(--text-secondary)"},children:"Cloud URL:"}),m.jsx("input",{type:"text",value:c,onChange:F=>{u(F.target.value.replace(/\/+$/,"")),h(!1)},className:"flex-1 px-2.5 py-1 rounded-sm text-tiny font-mono",style:{background:"var(--code-bg)",border:"1px solid var(--border)",color:"var(--text-primary)",outline:"none"},placeholder:"http://192.168.x.x:8787",autoFocus:!0}),m.jsx("button",{onClick:()=>v(!1),className:"px-2.5 py-1 text-tiny font-medium rounded-sm",style:{background:"var(--bg-active)",color:"#fff"},children:"Done"})]}),a?m.jsx("div",{className:"rounded-md px-3 py-2.5 animate-pulse",style:{background:"var(--code-bg)",height:"64px"}}):ee?m.jsx(MD,{code:ee}):m.jsx("div",{className:"rounded-md px-4 py-3 text-caption",style:{background:"var(--code-bg)",border:"1px solid var(--border)",color:"var(--text-muted)"},children:t.length>0?"Create a new pairing token below to generate the setup command. (Token values are only shown once at creation time.)":"No pairing tokens available. Create one below to generate the setup command."}),!y&&m.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[m.jsx("span",{className:"text-tiny",style:{color:"var(--text-muted)"},children:"Cloud URL:"}),m.jsx("code",{className:"text-tiny font-mono",style:{color:"var(--text-secondary)"},children:c}),m.jsx("button",{onClick:()=>v(!0),className:"text-tiny hover:underline",style:{color:"var(--text-link)"},children:"Edit"})]})]}),m.jsxs("div",{children:[m.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[m.jsx("label",{className:"text-caption font-bold",style:{color:"var(--text-secondary)"},children:"Pairing Tokens"}),m.jsx("button",{onClick:()=>_(!x),className:"text-tiny font-medium hover:underline",style:{color:"var(--text-link)"},children:x?"Cancel":"+ New Token"})]}),x&&m.jsxs("div",{className:"flex items-center gap-2 rounded-md px-3 py-2.5 mb-2",style:{background:"var(--code-bg)",border:"1px solid var(--border)"},children:[m.jsx("input",{type:"text",value:T,onChange:F=>C(F.target.value),placeholder:"Token label (optional)",className:"flex-1 px-2 py-1 rounded-sm text-tiny",style:{background:"var(--bg-surface)",border:"1px solid var(--border)",color:"var(--text-primary)",outline:"none"},onKeyDown:F=>{F.key==="Enter"&&P()},autoFocus:!0}),m.jsx("button",{onClick:P,disabled:S,className:"px-3 py-1 text-tiny font-medium rounded-sm text-white",style:{background:S?"var(--text-muted)":"var(--bg-active)"},children:S?"Creating...":"Create"})]}),M&&m.jsxs("div",{className:"rounded-md px-3 py-2.5 mb-2",style:{background:"rgba(43, 172, 118, 0.08)",border:"1px solid rgba(43, 172, 118, 0.3)"},children:[m.jsxs("div",{className:"flex items-center justify-between mb-1",children:[m.jsx("span",{className:"text-tiny font-bold",style:{color:"var(--accent-green)"},children:"New token created — copy it now (only shown once)"}),m.jsx("button",{onClick:()=>A(null),className:"text-tiny",style:{color:"var(--text-muted)"},children:"Dismiss"})]}),m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("code",{className:"flex-1 text-tiny font-mono break-all",style:{color:"var(--text-primary)"},children:M.token}),m.jsx(zE,{text:M.token})]})]}),a?m.jsx("div",{className:"rounded-md px-3 py-4 animate-pulse",style:{background:"var(--code-bg)"}}):t.length===0?m.jsx("p",{className:"text-tiny py-2",style:{color:"var(--text-muted)"},children:"No active pairing tokens. Create one to connect your OpenClaw agent."}):m.jsx("div",{className:"space-y-1",children:t.map(F=>m.jsxs("div",{className:"flex items-center gap-2 rounded-md px-3 py-2",style:{background:"var(--code-bg)",border:"1px solid var(--border)"},children:[m.jsx("code",{className:"text-tiny font-mono shrink-0",style:{color:"var(--text-primary)"},children:F.tokenPreview}),F.label&&m.jsx("span",{className:"text-tiny px-1.5 py-0.5 rounded",style:{background:"var(--bg-hover)",color:"var(--text-secondary)"},children:F.label}),m.jsx("span",{className:"flex-1"}),m.jsx("span",{className:"text-tiny",style:{color:"var(--text-muted)"},children:F.lastConnectedAt?ID(F.lastConnectedAt):"Never connected"}),m.jsx("button",{onClick:()=>I(F.id),className:"text-tiny font-medium hover:underline shrink-0",style:{color:"var(--accent-red)"},title:"Revoke this token",children:"Revoke"})]},F.id))})]})]})}function BE(){const{user:e}=qr.useContext(vs),[t,r]=D.useState(vt.hasKey()),[a,l]=D.useState(""),[c,u]=D.useState(!1),[d,h]=D.useState(!1),[p,b]=D.useState(null),[y,v]=D.useState(!1);D.useEffect(()=>vt.subscribe(()=>{r(vt.hasKey())}),[]);const x=async()=>{if(!(!a||!e)){h(!0),b(null);try{await vt.setPassword(a,e.id,c),l("")}catch{b("Failed to set password. check logs.")}finally{h(!1)}}},_=()=>{vt.clear()};return m.jsxs("div",{className:"space-y-6",children:[m.jsxs("div",{children:[m.jsx("h3",{className:"text-h3 font-bold mb-2",style:{color:"var(--text-primary)"},children:"End-to-End Encryption"}),m.jsx("p",{className:"text-body",style:{color:"var(--text-muted)"},children:"Your messages and tasks are encrypted before leaving your device. Only your device (with this password) can decrypt them."})]}),m.jsxs("div",{className:"p-4 rounded-md border",style:{borderColor:"var(--border)",background:t?"rgba(0, 255, 0, 0.05)":"rgba(255, 0, 0, 0.05)"},children:[m.jsxs("div",{className:"flex items-center justify-between mb-4",children:[m.jsx("span",{className:"font-bold flex items-center gap-2",style:{color:t?"var(--success)":"var(--error)"},children:t?m.jsxs(m.Fragment,{children:[m.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),"Active (Unlocked)"]}):m.jsxs(m.Fragment,{children:[m.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 11V7a4 4 0 118 0m-4 8v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2z"})}),"Inactive (Locked)"]})}),t&&m.jsx("button",{onClick:_,className:"text-caption font-bold hover:underline",style:{color:"var(--accent-red, #e53e3e)"},children:"Lock / Clear Key"})]}),!t&&m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{children:[m.jsx("label",{className:"block text-caption font-bold mb-1",style:{color:"var(--text-secondary)"},children:"E2E Password"}),m.jsxs("div",{className:"relative",children:[m.jsx("input",{type:y?"text":"password",value:a,onChange:T=>l(T.target.value),className:"w-full px-3 py-2 pr-10 rounded border",style:{background:"var(--bg-input)",borderColor:"var(--border)",color:"var(--text-primary)"},placeholder:"Enter your encryption password"}),m.jsx("button",{type:"button",onClick:()=>v(!y),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1",style:{color:"var(--text-muted)"},tabIndex:-1,children:y?m.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94"}),m.jsx("path",{d:"M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19"}),m.jsx("path",{d:"M14.12 14.12a3 3 0 1 1-4.24-4.24"}),m.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}):m.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),m.jsx("circle",{cx:"12",cy:"12",r:"3"})]})})]})]}),m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("input",{type:"checkbox",id:"remember-e2e",checked:c,onChange:T=>u(T.target.checked)}),m.jsx("label",{htmlFor:"remember-e2e",className:"text-caption",style:{color:"var(--text-secondary)"},children:"Remember on this device"})]}),p&&m.jsx("p",{className:"text-caption text-red-500",children:p}),m.jsx("button",{onClick:x,disabled:!a||d,className:"px-4 py-2 rounded font-bold w-full",style:{background:"var(--bg-active, #6366f1)",color:"#fff",opacity:!a||d?.5:1},children:d?"Deriving Key...":"Unlock / Set Password"})]})]}),m.jsxs("div",{className:"text-caption",style:{color:"var(--text-muted)"},children:[m.jsx("p",{className:"font-bold text-red-400 mb-1",children:"Warning:"}),m.jsxs("ul",{className:"list-disc ml-5 space-y-1",children:[m.jsx("li",{children:"If you lose this password, your encrypted history is lost forever."}),m.jsx("li",{children:"We do not store this password on our servers."}),m.jsx("li",{children:"You must use the same password on all devices to access your history."})]})]})]})}const UE={info:"var(--text-muted)",warn:"var(--accent-yellow)",error:"var(--accent-red)","ws-in":"#6BCB77","ws-out":"#4D96FF",api:"#C77DFF"},PE={info:"INF",warn:"WRN",error:"ERR","ws-in":"WS↓","ws-out":"WS↑",api:"API"};function DD(e){const t=new Date(e);return t.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})+"."+String(t.getMilliseconds()).padStart(3,"0")}const Eh="botschat_debug_panel_height",O1=220,_h=80,Sh=600;function LD(){const e=D.useSyncExternalStore($w,Hw),[t,r]=D.useState(!1),[a,l]=D.useState("all"),[c,u]=D.useState(new Set),d=D.useRef(null),h=D.useRef(!0),[p,b]=D.useState(()=>{try{const A=localStorage.getItem(Eh);if(A){const P=parseInt(A,10);if(P>=_h&&P<=Sh)return P}}catch{}return O1}),y=D.useRef(!1),v=D.useRef(0),x=D.useRef(O1),_=D.useCallback(A=>{A.preventDefault(),A.stopPropagation(),y.current=!0,v.current=A.clientY,x.current=p;const P=W=>{if(!y.current)return;const te=v.current-W.clientY,ee=Math.max(_h,Math.min(Sh,x.current+te));b(ee)},I=()=>{y.current&&(y.current=!1,document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",I),b(W=>{try{localStorage.setItem(Eh,String(W))}catch{}return W}))};document.addEventListener("mousemove",P),document.addEventListener("mouseup",I)},[p]),T=D.useCallback(A=>{A.stopPropagation();const P=A.touches[0];y.current=!0,v.current=P.clientY,x.current=p;const I=te=>{if(!y.current)return;const ee=te.touches[0],U=v.current-ee.clientY,F=Math.max(_h,Math.min(Sh,x.current+U));b(F)},W=()=>{y.current&&(y.current=!1,document.removeEventListener("touchmove",I),document.removeEventListener("touchend",W),b(te=>{try{localStorage.setItem(Eh,String(te))}catch{}return te}))};document.addEventListener("touchmove",I,{passive:!1}),document.addEventListener("touchend",W)},[p]);D.useEffect(()=>{t&&h.current&&d.current&&(d.current.scrollTop=d.current.scrollHeight)},[e.length,t]);const C=()=>{if(!d.current)return;const{scrollTop:A,scrollHeight:P,clientHeight:I}=d.current;h.current=P-A-I<40},S=A=>{u(P=>{const I=new Set(P);return I.has(A)?I.delete(A):I.add(A),I})},R=a==="all"?e:e.filter(A=>A.level===a),M=e.length;return m.jsxs("div",{style:{flexShrink:0,fontFamily:"var(--font-mono)",fontSize:12,lineHeight:1.5},children:[t&&m.jsx("div",{onMouseDown:_,onTouchStart:T,className:"resize-handle group",style:{height:6,cursor:"row-resize",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--bg-secondary)",borderTop:"1px solid var(--border)",flexShrink:0},children:m.jsx("div",{className:"resize-handle-line",style:{width:"100%",height:1,background:"var(--border)",transition:"height 150ms, background 150ms"}})}),m.jsxs("div",{onClick:()=>r(!t),style:{display:"flex",alignItems:"center",gap:8,padding:"3px 12px",background:"var(--bg-secondary)",borderTop:t?void 0:"1px solid var(--border)",cursor:"pointer",userSelect:"none"},children:[m.jsx("svg",{width:10,height:10,viewBox:"0 0 10 10",style:{transform:t?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.15s",flexShrink:0},children:m.jsx("path",{d:"M1 7L5 3l4 4",stroke:"var(--text-muted)",strokeWidth:1.5,fill:"none"})}),m.jsx("span",{style:{color:"var(--text-muted)",fontWeight:600,fontSize:11},children:"Debug Log"}),m.jsxs("span",{style:{color:"var(--text-muted)",fontSize:10},children:["(",M,")"]}),t&&m.jsx("div",{style:{display:"flex",gap:2,marginLeft:8},onClick:A=>A.stopPropagation(),children:["all","ws-in","ws-out","api","info","warn","error"].map(A=>m.jsx("button",{onClick:()=>l(A),style:{padding:"1px 6px",borderRadius:3,border:"none",fontSize:10,fontFamily:"var(--font-mono)",cursor:"pointer",background:a===A?"var(--bg-active)":"var(--bg-hover)",color:a===A?"#fff":A==="all"?"var(--text-muted)":UE[A]},children:A==="all"?"ALL":PE[A]},A))}),t&&m.jsx("button",{onClick:A=>{A.stopPropagation(),Fw()},style:{marginLeft:"auto",padding:"1px 8px",borderRadius:3,border:"none",fontSize:10,fontFamily:"var(--font-mono)",cursor:"pointer",background:"var(--bg-hover)",color:"var(--text-muted)"},children:"Clear"})]}),t&&m.jsxs("div",{ref:d,onScroll:C,style:{height:p,overflowY:"auto",overflowX:"hidden",background:"var(--bg-primary)",borderTop:"1px solid var(--border)"},children:[R.length===0&&m.jsx("div",{style:{padding:"16px 12px",color:"var(--text-muted)",textAlign:"center"},children:"No log entries yet."}),R.map(A=>m.jsx(zD,{entry:A,expanded:c.has(A.id),onToggleExpand:()=>S(A.id)},A.id))]})]})}function zD({entry:e,expanded:t,onToggleExpand:r}){const a=UE[e.level],l=PE[e.level];return m.jsxs("div",{style:{padding:"1px 12px",borderBottom:"1px solid var(--border)",wordBreak:"break-all"},onMouseEnter:c=>c.currentTarget.style.background="var(--bg-hover)",onMouseLeave:c=>c.currentTarget.style.background="",children:[m.jsxs("div",{style:{display:"flex",gap:8,alignItems:"flex-start"},children:[m.jsx("span",{style:{color:"var(--text-muted)",flexShrink:0,width:85},children:DD(e.ts)}),m.jsx("span",{style:{color:a,fontWeight:700,flexShrink:0,width:28,textAlign:"center"},children:l}),m.jsxs("span",{style:{color:"var(--text-secondary)",flexShrink:0,minWidth:50},children:["[",e.tag,"]"]}),m.jsx("span",{style:{color:"var(--text-primary)",flex:1},children:e.message}),e.detail&&m.jsx("button",{onClick:r,style:{border:"none",background:"none",cursor:"pointer",color:"var(--text-muted)",fontSize:10,padding:"0 4px",flexShrink:0},children:t?"▼":"▶"})]}),t&&e.detail&&m.jsx("pre",{style:{margin:"2px 0 4px 121px",padding:"4px 8px",background:"var(--code-bg)",borderRadius:3,color:"var(--text-secondary)",fontSize:11,whiteSpace:"pre-wrap",wordBreak:"break-all",maxHeight:200,overflowY:"auto"},children:e.detail})]})}function HE(){const e=lr(),t=ti(),r=a=>{t({type:"SELECT_CRON_TASK",taskId:a})};return m.jsxs("div",{className:"flex flex-col h-full",style:{background:"var(--bg-secondary)"},children:[m.jsx("div",{className:"px-4 py-3 flex items-center gap-2",children:m.jsx("span",{className:"text-[--text-sidebar-active] font-bold text-h2 truncate flex-1",children:"Automations"})}),m.jsx("div",{className:"px-4 pb-2",children:m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:e.openclawConnected?"var(--accent-green)":"var(--accent-red)"}}),m.jsx("span",{className:"text-tiny text-[--text-muted]",children:e.openclawConnected?"OpenClaw connected":"OpenClaw offline"})]})}),m.jsx("div",{className:"px-4 pb-2",children:m.jsxs("span",{className:"text-tiny text-[--text-muted]",children:[e.cronTasks.length," cron job",e.cronTasks.length!==1?"s":""]})}),m.jsx("div",{className:"flex-1 overflow-y-auto sidebar-scroll",children:e.cronTasks.length===0?m.jsxs("div",{className:"px-4 py-8 text-center",children:[m.jsx("svg",{className:"w-10 h-10 mx-auto mb-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,style:{color:"var(--text-muted)"},children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})}),m.jsx("p",{className:"text-caption text-[--text-muted]",children:"No automations yet."}),m.jsx("p",{className:"text-tiny text-[--text-muted] mt-1",children:"Cron jobs from OpenClaw will appear here automatically."})]}):e.cronTasks.map(a=>{const l=e.selectedCronTaskId===a.id,c=a.enabled;let u="var(--accent-green)";return c||(u="var(--text-muted)"),m.jsxs("button",{onClick:()=>r(a.id),className:"w-full text-left py-2 transition-colors",style:{paddingLeft:l?13:16,paddingRight:16,background:l?"var(--bg-hover)":void 0,borderLeft:l?"3px solid var(--bg-active)":"3px solid transparent",color:l?"var(--text-sidebar-active)":"var(--text-sidebar)"},onMouseEnter:d=>{l||(d.currentTarget.style.background="var(--sidebar-hover)")},onMouseLeave:d=>{l||(d.currentTarget.style.background=l?"var(--bg-hover)":"")},children:[m.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[m.jsx("div",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:u}}),m.jsx("span",{className:`text-body truncate ${l?"font-bold":""}`,children:a.name})]}),m.jsxs("div",{className:"flex items-center gap-2 mt-0.5 pl-4",children:[m.jsx("span",{className:"text-tiny truncate",style:{color:"var(--text-muted)"},children:a.schedule??"no schedule"}),!c&&m.jsx("span",{className:"text-tiny",style:{color:"var(--text-muted)"},children:"paused"})]})]},a.id)})})]})}function Zh(e){if(!e)return null;const t=e.trim().toLowerCase(),r=t.match(/^every\s+(\d+(?:\.\d+)?)\s*(s|m|h)$/);if(r)return{kind:"every",intervalValue:parseFloat(r[1]),intervalUnit:r[2]};const a=t.match(/^at\s+(\d{1,2}:\d{2})$/);return a?{kind:"at",atTime:a[1].padStart(5,"0")}:null}function jD(e){return e.kind==="every"&&e.intervalValue&&e.intervalUnit?`every ${e.intervalValue}${e.intervalUnit}`:e.kind==="at"&&e.atTime?`at ${e.atTime}`:""}function BD({value:e,onChange:t,onSave:r,onCancel:a,saving:l}){const c=Zh(e),[u,d]=D.useState((c==null?void 0:c.kind)??"every"),[h,p]=D.useState((c==null?void 0:c.intervalValue)??1),[b,y]=D.useState((c==null?void 0:c.intervalUnit)??"h"),[v,x]=D.useState((c==null?void 0:c.atTime)??"09:00");D.useEffect(()=>{const A=Zh(e);A&&(d(A.kind),A.kind==="every"?(p(A.intervalValue??1),y(A.intervalUnit??"h")):x(A.atTime??"09:00"))},[e]);const _=D.useCallback((A,P,I,W)=>{const te=jD(A==="every"?{kind:"every",intervalValue:P,intervalUnit:I}:{kind:"at",atTime:W});t(te)},[t]),T=A=>{d(A),_(A,h,b,v)},C=A=>{const P=Math.max(1,Math.min(A,999));p(P),_(u,P,b,v)},S=A=>{y(A),_(u,h,A,v)},R=A=>{x(A),_(u,h,b,A)},M=A=>{A.key==="Escape"&&a(),A.key==="Enter"&&(A.preventDefault(),r())};return m.jsxs("div",{className:"flex flex-col gap-2",onKeyDown:M,children:[m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx(R1,{active:u==="every",onClick:()=>T("every"),label:"Interval",icon:m.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182"})})}),m.jsx(R1,{active:u==="at",onClick:()=>T("at"),label:"Daily at",icon:m.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})})})]}),m.jsxs("div",{className:"flex items-center gap-2",children:[u==="every"?m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-caption flex-shrink-0",style:{color:"var(--text-muted)"},children:"Every"}),m.jsx("input",{type:"number",min:1,max:999,value:h,onChange:A=>C(parseInt(A.target.value,10)||1),className:"text-body px-2 py-1 rounded-sm focus:outline-none w-16 text-center",style:{background:"var(--bg-hover)",color:"var(--text-primary)",border:"1px solid var(--bg-active)"},autoFocus:!0}),m.jsxs("div",{className:"flex items-center gap-0.5",children:[m.jsx(wh,{active:b==="m",onClick:()=>S("m"),label:"min"}),m.jsx(wh,{active:b==="h",onClick:()=>S("h"),label:"hr"}),m.jsx(wh,{active:b==="s",onClick:()=>S("s"),label:"sec"})]})]}):m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-caption flex-shrink-0",style:{color:"var(--text-muted)"},children:"Daily at"}),m.jsx("input",{type:"time",value:v,onChange:A=>R(A.target.value),className:"text-body px-2 py-1 rounded-sm focus:outline-none",style:{background:"var(--bg-hover)",color:"var(--text-primary)",border:"1px solid var(--bg-active)"},autoFocus:!0})]}),m.jsxs("div",{className:"flex items-center gap-1 ml-auto flex-shrink-0",children:[m.jsx("button",{onClick:r,disabled:l,className:"px-2 py-1 text-tiny font-bold text-white rounded-sm disabled:opacity-50",style:{background:"var(--bg-active)"},children:l?"...":"Save"}),m.jsx("button",{onClick:a,className:"px-2 py-1 text-tiny rounded-sm",style:{color:"var(--text-muted)"},children:"Cancel"})]})]}),m.jsx("div",{className:"text-tiny",style:{color:"var(--text-muted)"},children:u==="every"?`Runs every ${h} ${b==="h"?"hour":b==="m"?"minute":"second"}${h!==1?"s":""}`:`Runs daily at ${v}`})]})}function UD({schedule:e,onClick:t}){if(!e)return m.jsx("span",{className:"text-body cursor-pointer hover:underline",style:{color:"var(--text-muted)"},onClick:t,title:"Click to set schedule",children:"Not set"});const r=Zh(e);return r?m.jsx("button",{className:"flex items-center gap-1.5 cursor-pointer group",onClick:t,title:"Click to edit schedule",children:r.kind==="every"?m.jsxs(m.Fragment,{children:[m.jsx("svg",{className:"w-3.5 h-3.5 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,style:{color:"var(--text-muted)"},children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182"})}),m.jsxs("span",{className:"text-body group-hover:underline",style:{color:"var(--text-primary)"},children:["Every ",r.intervalValue,r.intervalUnit==="h"?"h":r.intervalUnit==="m"?"m":"s"]})]}):m.jsxs(m.Fragment,{children:[m.jsx("svg",{className:"w-3.5 h-3.5 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,style:{color:"var(--text-muted)"},children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})}),m.jsxs("span",{className:"text-body group-hover:underline",style:{color:"var(--text-primary)"},children:["Daily at ",r.atTime]})]})}):m.jsx("span",{className:"text-body cursor-pointer hover:underline",style:{color:"var(--text-primary)"},onClick:t,title:"Click to edit schedule",children:e})}function R1({active:e,onClick:t,label:r,icon:a}){return m.jsxs("button",{onClick:t,className:"flex items-center gap-1.5 px-2.5 py-1 text-caption rounded-sm transition-colors",style:{background:e?"rgba(29,155,209,0.15)":"transparent",color:e?"var(--text-link)":"var(--text-muted)",border:e?"1px solid rgba(29,155,209,0.3)":"1px solid transparent"},children:[a,r]})}function wh({active:e,onClick:t,label:r}){return m.jsx("button",{onClick:t,className:"px-2 py-1 text-caption rounded-sm transition-colors",style:{background:e?"var(--bg-active)":"var(--bg-hover)",color:e?"#fff":"var(--text-secondary)",border:e?"1px solid var(--bg-active)":"1px solid var(--border)"},children:r})}function eo({direction:e="horizontal",className:t=""}){const r=e==="vertical";return m.jsx(J1,{className:`resize-handle group relative flex items-center justify-center ${r?"h-[6px] cursor-row-resize":"w-[6px] cursor-col-resize"} ${t}`,style:{flexShrink:0,flexGrow:0},children:m.jsx("div",{className:`resize-handle-line transition-all duration-150 ${r?"w-full h-px group-hover:h-[3px]":"h-full w-px group-hover:w-[3px]"}`,style:{background:"var(--border)"}})})}const M1=768;function FE(){const[e,t]=D.useState(()=>typeof window>"u"?!1:window.innerWidth<M1);return D.useEffect(()=>{const r=window.matchMedia(`(max-width: ${M1-1}px)`),a=l=>t(l.matches);return t(r.matches),r.addEventListener("change",a),()=>r.removeEventListener("change",a)},[]),e}function I1(e){return new Date(e*1e3).toLocaleString()}function $E(e){switch(e){case"ok":return"OK";case"error":return"ERR";case"skipped":return"SKIP";case"running":return"RUN";default:return e.toUpperCase()}}function GE(e){switch(e){case"ok":return{bg:"rgba(43,172,118,0.15)",fg:"var(--accent-green)"};case"error":return{bg:"rgba(224,30,90,0.15)",fg:"var(--accent-red)"};case"running":return{bg:"rgba(29,155,209,0.15)",fg:"var(--text-link)"};default:return{bg:"rgba(232,162,48,0.15)",fg:"var(--accent-yellow)"}}}function KE(){const e=lr(),t=ti(),r=FE(),a=e.cronTasks.find(K=>K.id===e.selectedCronTaskId),[l,c]=D.useState(null),[u,d]=D.useState(""),[h,p]=D.useState(!1),[b,y]=D.useState(!1),[v,x]=D.useState(!1),[_,T]=D.useState(!1),[C,S]=D.useState(!0),R=D.useRef(null);D.useEffect(()=>{c(null),y(!1)},[e.selectedCronTaskId]),D.useEffect(()=>{l&&R.current&&R.current.focus()},[l]);const M=D.useCallback(()=>{a&&(ue.info("Cron",`Loading jobs for task: ${a.name} (${a.id})`),Ch.listByTask(a.id).then(({jobs:K})=>{ue.info("Cron",`Loaded ${K.length} jobs for task ${a.name}`);const z=A.current,Q=new Map;for(const B of z)B.summary&&Q.set(B.id,B.summary);const ie=K.map(B=>{var O;const w=Q.get(B.id);return w&&w.length>(((O=B.summary)==null?void 0:O.length)||0)?{...B,summary:w}:B});t({type:"SET_CRON_JOBS",cronJobs:ie}),K.length>0&&!e.selectedCronJobId&&t({type:"SELECT_CRON_JOB",jobId:K[0].id,sessionKey:K[0].sessionKey})}).catch(K=>{ue.error("Cron",`Failed to load jobs: ${K}`)}))},[a==null?void 0:a.id]);D.useEffect(()=>{M()},[M]);const A=D.useRef(e.cronJobs);D.useEffect(()=>{A.current=e.cronJobs},[e.cronJobs]),D.useEffect(()=>{if(!e.cronJobs.some(ie=>ie.status==="running")||!a)return;const z=a.id,Q=setInterval(()=>{ue.info("Cron","Auto-refreshing jobs (running job detected)"),Ch.listByTask(z).then(({jobs:ie})=>{const B=A.current,w=new Map;for(const G of B)G.summary&&w.set(G.id,G.summary);const O=ie.map(G=>{var de;const N=w.get(G.id);return N&&N.length>(((de=G.summary)==null?void 0:de.length)||0)?{...G,summary:N}:G});t({type:"SET_CRON_JOBS",cronJobs:O})}).catch(()=>{})},3e3);return()=>clearInterval(Q)},[e.cronJobs,a==null?void 0:a.id]);const P=D.useCallback(async()=>{if(!a)return;const K=!a.enabled;ue.info("Cron",`Toggle task "${a.name}": ${a.enabled?"enabled → disabled":"disabled → enabled"}`),t({type:"UPDATE_CRON_TASK",taskId:a.id,updates:{enabled:K}});try{await Xn.update(a.channelId,a.id,{schedule:a.schedule??"",instructions:a.instructions??"",enabled:K,model:a.model??""})}catch(z){ue.error("Cron",`Failed to toggle task: ${z}`),t({type:"UPDATE_CRON_TASK",taskId:a.id,updates:{enabled:a.enabled}})}},[a]),I=D.useCallback(K=>{const z=e.cronJobs.find(Q=>Q.id===K);z&&(ue.info("Cron",`Selected job #${z.number||K} (status=${z.status})`),t({type:"SELECT_CRON_JOB",jobId:z.id,sessionKey:z.sessionKey||void 0}))},[e.cronJobs]),W=K=>{if(!a)return;const z=K==="name"?a.name:K==="schedule"?a.schedule??"":a.instructions??"";d(z),c(K)},te=D.useCallback(async K=>{if(!a)return;ue.info("Cron",`Change model for "${a.name}": → ${K||"default"}`);const z=a.model;t({type:"UPDATE_CRON_TASK",taskId:a.id,updates:{model:K||null}});try{await Xn.update(a.channelId,a.id,{schedule:a.schedule??"",instructions:a.instructions??"",enabled:a.enabled,model:K})}catch(Q){ue.error("Cron",`Failed to update task model: ${Q}`),t({type:"UPDATE_CRON_TASK",taskId:a.id,updates:{model:z}})}},[a]),ee=D.useCallback(async()=>{if(!(!a||_)){ue.info("Cron",`Triggering immediate run for "${a.name}"`),T(!0);try{await Xn.run(a.channelId,a.id),ue.info("Cron",`Task "${a.name}" triggered successfully`),setTimeout(()=>{M()},1500)}catch(K){ue.error("Cron",`Failed to trigger task: ${K}`)}finally{T(!1)}}},[a,_,M]),U=()=>{c(null),d("")},F=async()=>{if(!(!a||!l)){ue.info("Cron",`Save edit "${l}" for "${a.name}": ${u.length>80?u.slice(0,80)+"…":u}`),p(!0);try{if(l==="name")t({type:"UPDATE_CRON_TASK",taskId:a.id,updates:{name:u}}),await Xn.update(a.channelId,a.id,{name:u});else{const K={[l]:u};t({type:"UPDATE_CRON_TASK",taskId:a.id,updates:K}),await Xn.update(a.channelId,a.id,{schedule:l==="schedule"?u:a.schedule??"",instructions:l==="instructions"?u:a.instructions??"",enabled:a.enabled,model:a.model??""})}c(null)}catch(K){ue.error("Cron",`Failed to update task field "${l}": ${K}`)}finally{p(!1)}}},X=async()=>{if(a){ue.info("Cron",`Deleting task: "${a.name}" (${a.id})`),x(!0);try{await Xn.delete(a.channelId,a.id),ue.info("Cron",`Task deleted: "${a.name}"`);const{tasks:K}=await Xn.listAll("background");t({type:"SET_CRON_TASKS",cronTasks:K}),t({type:"SELECT_CRON_TASK",taskId:K.length>0?K[0].id:null}),y(!1)}catch(K){ue.error("Cron",`Failed to delete task: ${K}`)}finally{x(!1)}}},me=K=>{K.key==="Escape"&&U(),K.key==="Enter"&&!K.shiftKey&&l!=="instructions"&&(K.preventDefault(),F())};if(!a)return m.jsx("div",{className:"flex-1 h-full flex items-center justify-center",style:{background:"var(--bg-surface)"},children:m.jsxs("div",{className:"text-center",children:[m.jsx("svg",{className:"w-16 h-16 mx-auto mb-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,style:{color:"var(--text-muted)"},children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})}),m.jsx("p",{className:"text-body font-bold",style:{color:"var(--text-muted)"},children:"Select an automation"}),m.jsx("p",{className:"text-caption mt-1",style:{color:"var(--text-muted)"},children:"Choose a cron job from the sidebar to view details"})]})});const le=e.channels.find(K=>K.id===a.channelId);return m.jsxs("div",{className:"flex-1 h-full flex flex-col min-w-0",style:{background:"var(--bg-surface)"},children:[m.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 px-4 sm:px-5 py-2 sm:py-3 flex-shrink-0",style:{borderBottom:"1px solid var(--border)"},children:[m.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 min-w-0 flex-1",children:[m.jsx("svg",{className:"w-5 h-5 flex-shrink-0 hidden sm:block",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,style:{color:"var(--text-secondary)"},children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})}),l==="name"?m.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[m.jsx("input",{ref:R,value:u,onChange:K=>d(K.target.value),onKeyDown:me,className:"text-h2 font-bold px-2 py-0.5 rounded-sm focus:outline-none min-w-0 w-full",style:{background:"var(--bg-hover)",color:"var(--text-primary)",border:"1px solid var(--bg-active)",maxWidth:280}}),m.jsx(qE,{saving:h,onSave:F,onCancel:U})]}):m.jsx("h2",{className:"text-h2 font-bold truncate cursor-pointer hover:underline",style:{color:"var(--text-primary)"},onClick:()=>W("name"),title:"Click to edit name",children:a.name}),!a.enabled&&m.jsx("span",{className:"text-tiny px-2 py-0.5 rounded-sm font-bold flex-shrink-0",style:{background:"rgba(232,162,48,0.15)",color:"var(--accent-yellow)"},children:"PAUSED"})]}),m.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 flex-shrink-0",children:[m.jsxs("button",{onClick:ee,disabled:_,className:"flex items-center gap-1 sm:gap-1.5 px-2 sm:px-3 py-1 sm:py-1.5 text-caption rounded-sm transition-colors disabled:opacity-50",style:{background:"rgba(29,155,209,0.15)",color:"var(--text-link)"},title:"Run task now (one-time)",children:[m.jsx("svg",{className:"w-3.5 h-3.5",fill:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{d:"M8 5v14l11-7z"})}),m.jsx("span",{className:"hidden sm:inline",children:_?"Running...":"Run Now"})]}),m.jsx("button",{onClick:()=>y(!0),className:"p-1 sm:p-1.5 rounded-sm transition-colors hover:bg-[--bg-hover]",style:{color:"var(--text-muted)"},title:"Delete task",children:m.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"})})}),m.jsxs("button",{onClick:P,className:"flex items-center gap-1.5 sm:gap-2 px-2 sm:px-3 py-1 sm:py-1.5 text-caption rounded-sm transition-colors",style:{background:a.enabled?"rgba(43,172,118,0.15)":"rgba(107,111,118,0.15)",color:a.enabled?"var(--accent-green)":"var(--text-muted)"},children:[m.jsx("div",{className:"w-7 h-4 rounded-full relative transition-colors flex-shrink-0",style:{background:a.enabled?"var(--accent-green)":"var(--text-muted)"},children:m.jsx("div",{className:"w-3 h-3 rounded-full bg-white absolute top-0.5 transition-all",style:{left:a.enabled?14:2}})}),m.jsx("span",{className:"hidden sm:inline",children:a.enabled?"Enabled":"Disabled"})]})]})]}),b&&m.jsxs("div",{className:"px-4 sm:px-5 py-2 sm:py-3 flex flex-wrap items-center justify-between gap-2",style:{background:"rgba(224,30,90,0.08)",borderBottom:"1px solid var(--border)"},children:[m.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[m.jsx("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,style:{color:"var(--accent-red)"},children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"})}),m.jsxs("span",{className:"text-caption",style:{color:"var(--accent-red)"},children:['Delete "',a.name,'"?']})]}),m.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[m.jsx("button",{onClick:X,disabled:v,className:"px-3 py-1.5 text-caption font-bold text-white rounded-sm disabled:opacity-50",style:{background:"var(--accent-red)"},children:v?"Deleting...":"Delete"}),m.jsx("button",{onClick:()=>y(!1),className:"px-3 py-1.5 text-caption rounded-sm",style:{color:"var(--text-muted)"},children:"Cancel"})]})]}),m.jsx(PD,{task:a,channel:le,state:e,isMobile:r,infoExpanded:C,setInfoExpanded:S,editingField:l,editValue:u,setEditValue:d,editRef:R,handleKeyDown:me,saving:h,saveEdit:F,cancelEdit:U,startEdit:W,handleModelSelectChange:te,handleSelectJob:I})]})}function PD({task:e,channel:t,state:r,isMobile:a,infoExpanded:l,setInfoExpanded:c,editingField:u,editValue:d,setEditValue:h,editRef:p,handleKeyDown:b,saving:y,saveEdit:v,cancelEdit:x,startEdit:_,handleModelSelectChange:T,handleSelectJob:C}){const S=lu({id:"botschat-cron-detail-v"}),[R,M]=D.useState(40),A=D.useRef(null),P=D.useRef({startY:0,startPct:40}),I=D.useCallback(ee=>{ee.preventDefault(),P.current.startY=ee.touches[0].clientY,P.current.startPct=R;const U=X=>{if(X.preventDefault(),!A.current)return;const me=A.current.getBoundingClientRect().height,le=(X.touches[0].clientY-P.current.startY)/me*100;M(Math.max(10,Math.min(70,P.current.startPct+le)))},F=()=>{document.removeEventListener("touchmove",U),document.removeEventListener("touchend",F)};document.addEventListener("touchmove",U,{passive:!1}),document.addEventListener("touchend",F)},[R]),W=D.useCallback(ee=>{ee.preventDefault(),P.current.startY=ee.clientY,P.current.startPct=R;const U=X=>{if(!A.current)return;const me=A.current.getBoundingClientRect().height,le=(X.clientY-P.current.startY)/me*100;M(Math.max(10,Math.min(70,P.current.startPct+le)))},F=()=>{document.removeEventListener("mousemove",U),document.removeEventListener("mouseup",F)};document.addEventListener("mousemove",U),document.addEventListener("mouseup",F)},[R]),te=m.jsxs("div",{className:"h-full flex flex-col",children:[m.jsxs("button",{className:"w-full flex items-center gap-2 px-4 sm:px-5 py-2 text-tiny uppercase tracking-wider hover:bg-[--bg-hover] transition-colors flex-shrink-0",style:{color:"var(--text-muted)"},onClick:()=>c(!l),children:[m.jsx("svg",{className:`w-3 h-3 transition-transform ${l?"rotate-0":"-rotate-90"}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})}),"Task Details"]}),l&&m.jsxs("div",{className:"flex-1 overflow-y-auto px-4 sm:px-5 pb-4 space-y-4",children:[u==="schedule"?m.jsx("div",{children:m.jsx(Di,{label:"Schedule",children:m.jsx(BD,{value:d,onChange:h,onSave:v,onCancel:x,saving:y})})}):m.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 sm:gap-4",children:[m.jsx(Di,{label:"Schedule",children:m.jsx(UD,{schedule:e.schedule,onClick:()=>_("schedule")})}),m.jsx(Di,{label:"Model",children:m.jsx(wu,{value:e.model??"",onChange:T,models:r.models,placeholder:"Default"})}),m.jsx(Di,{label:"Channel",children:m.jsx("span",{className:"text-body",style:{color:"var(--text-primary)"},children:(t==null?void 0:t.name)??"Default"})}),m.jsx(Di,{label:"Status",children:m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:e.enabled?"var(--accent-green)":"var(--accent-yellow)"}}),m.jsx("span",{className:"text-body",style:{color:"var(--text-primary)"},children:e.enabled?"Active":"Paused"})]})})]}),m.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 sm:gap-4",children:[m.jsx(Di,{label:"Cron Job ID",children:m.jsx("span",{className:"text-caption font-mono",style:{color:"var(--text-secondary)"},children:e.openclawCronJobId??"N/A"})}),m.jsx(Di,{label:"Created",children:m.jsx("span",{className:"text-caption",style:{color:"var(--text-secondary)"},children:e.createdAt?I1(e.createdAt):"N/A"})}),m.jsx(Di,{label:"Updated",children:m.jsx("span",{className:"text-caption",style:{color:"var(--text-secondary)"},children:e.updatedAt?I1(e.updatedAt):"N/A"})})]}),m.jsxs("div",{children:[m.jsxs("div",{className:"flex items-center justify-between mb-1",children:[m.jsx("span",{className:"text-tiny uppercase tracking-wider",style:{color:"var(--text-muted)"},children:"Prompt / Instructions"}),u!=="instructions"&&m.jsx("button",{onClick:()=>_("instructions"),className:"text-tiny px-2 py-0.5 rounded-sm transition-colors hover:bg-[--bg-hover]",style:{color:"var(--text-link)"},children:"Edit"})]}),u==="instructions"?m.jsxs("div",{children:[m.jsx("textarea",{ref:p,value:d,onChange:ee=>h(ee.target.value),onKeyDown:ee=>{ee.key==="Escape"&&x(),ee.key==="Enter"&&(ee.metaKey||ee.ctrlKey)&&(ee.preventDefault(),v())},placeholder:"Enter the prompt or instructions for this cron task...",rows:6,className:"w-full text-caption p-3 rounded-md resize-y focus:outline-none",style:{background:"var(--bg-hover)",color:"var(--text-primary)",border:"1px solid var(--bg-active)",minHeight:80,maxHeight:300}}),m.jsxs("div",{className:"flex items-center justify-between mt-2",children:[m.jsx("span",{className:"text-tiny",style:{color:"var(--text-muted)"},children:"Cmd/Ctrl+Enter to save, Esc to cancel"}),m.jsx(qE,{saving:y,onSave:v,onCancel:x})]})]}):m.jsx("div",{className:"text-caption p-3 rounded-md whitespace-pre-wrap cursor-pointer hover:border-[--text-muted] transition-colors",style:{background:"var(--bg-hover)",color:e.instructions?"var(--text-primary)":"var(--text-muted)",border:"1px solid transparent",minHeight:48},onClick:()=>_("instructions"),title:"Click to edit",children:e.instructions||"No instructions set. Click to add a prompt for this cron task."})]})]})]});return a?m.jsxs("div",{ref:A,className:"flex-1 min-h-0 flex flex-col",children:[m.jsx("div",{className:"flex-shrink-0 overflow-y-auto",style:{...l?{height:`${R}%`}:{},borderBottom:"1px solid var(--border)"},children:te}),l&&m.jsx("div",{className:"flex-shrink-0 flex items-center justify-center touch-none select-none",style:{height:20,cursor:"row-resize",background:"var(--bg-surface)",borderBottom:"1px solid var(--border)"},onTouchStart:I,onMouseDown:W,children:m.jsx("div",{className:"rounded-full",style:{width:36,height:4,background:"var(--text-muted)",opacity:.4}})}),m.jsx(D1,{cronJobs:r.cronJobs,selectedCronJobId:r.selectedCronJobId,handleSelectJob:C,mobile:!0})]}):m.jsxs(no,{orientation:"vertical",defaultLayout:S.defaultLayout,onLayoutChanged:S.onLayoutChanged,id:"botschat-cron-detail-v",className:"flex-1 min-h-0",children:[m.jsx(vr,{id:"cron-info",defaultSize:"40%",minSize:"5%",maxSize:"70%",children:m.jsx("div",{className:"h-full",style:{borderBottom:"1px solid var(--border)"},children:te})}),m.jsx(eo,{direction:"vertical"}),m.jsx(vr,{id:"cron-content-area",children:m.jsx(D1,{cronJobs:r.cronJobs,selectedCronJobId:r.selectedCronJobId,handleSelectJob:C,mobile:!1})})]})}function D1({cronJobs:e,selectedCronJobId:t,handleSelectJob:r,mobile:a}){const l=lu({id:"botschat-cron-content"}),[c,u]=D.useState(!1),d=p=>{r(p),u(!0)},h=m.jsxs("div",{className:"overflow-y-auto h-full",children:[m.jsxs("div",{className:"px-3 py-2",style:{borderBottom:"1px solid var(--border)"},children:[m.jsx("span",{className:"text-tiny uppercase tracking-wider font-bold",style:{color:"var(--text-muted)"},children:"Execution History"}),m.jsxs("span",{className:"text-tiny ml-1",style:{color:"var(--text-muted)"},children:["(",e.length,")"]})]}),e.length===0?m.jsxs("div",{className:"px-4 py-6 text-center",children:[m.jsx("p",{className:"text-tiny",style:{color:"var(--text-muted)"},children:"No runs yet."}),m.jsx("p",{className:"text-tiny mt-1",style:{color:"var(--text-muted)"},children:"Waiting for schedule..."})]}):e.map((p,b)=>{const y=GE(p.status),v=p.number||e.length-b,x=t===p.id;return m.jsxs("button",{onClick:()=>a?d(p.id):r(p.id),className:`w-full text-left px-3 py-2 hover:bg-[--bg-hover] transition-colors ${x?"bg-[--bg-hover]":""}`,style:{borderBottom:"1px solid var(--border)",...x?{borderLeft:"3px solid var(--bg-active)"}:{}},children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsxs("span",{className:"text-tiny font-mono",style:{color:"var(--text-muted)"},children:["#",v]}),m.jsxs("span",{className:"text-tiny px-1.5 py-0.5 rounded-sm font-bold flex items-center gap-1",style:{background:y.bg,color:y.fg},children:[p.status==="running"&&m.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--text-link)"}}),$E(p.status)]})]}),m.jsxs("div",{className:"text-tiny mt-0.5",style:{color:"var(--text-muted)"},children:[p.time,p.durationMs!=null&&m.jsxs("span",{className:"ml-1",children:["(",(p.durationMs/1e3).toFixed(1),"s)"]})]}),p.summary&&m.jsx("div",{className:"text-caption mt-1 truncate",style:{color:"var(--text-secondary)"},children:p.summary})]},p.id)})]});return a?c&&t?m.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[m.jsxs("button",{onClick:()=>u(!1),className:"flex items-center gap-1 px-4 py-2 text-caption flex-shrink-0",style:{borderBottom:"1px solid var(--border)",color:"var(--text-link)"},children:[m.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5L8.25 12l7.5-7.5"})}),"Back to History"]}),m.jsx("div",{className:"flex-1 min-h-0",children:m.jsx(L1,{jobs:e,selectedJobId:t})})]}):m.jsx("div",{className:"flex-1 min-h-0",children:h}):m.jsxs(no,{orientation:"horizontal",defaultLayout:l.defaultLayout,onLayoutChanged:l.onLayoutChanged,id:"botschat-cron-content",className:"flex-1 min-h-0",children:[m.jsx(vr,{id:"cron-jobs",defaultSize:"20%",minSize:"8%",maxSize:"40%",children:h}),m.jsx(eo,{}),m.jsx(vr,{id:"cron-output",children:m.jsx(L1,{jobs:e,selectedJobId:t})})]})}const HD=`prose prose-sm max-w-none
1489
- prose-p:my-1.5 prose-ul:my-1.5 prose-ol:my-1.5
1490
- prose-pre:my-2 prose-pre:rounded-md prose-pre:text-caption
1491
- prose-code:before:content-none prose-code:after:content-none
1492
- prose-code:px-1 prose-code:py-0.5 prose-code:rounded-sm prose-code:text-caption
1493
- prose-table:my-2 prose-th:px-3 prose-th:py-1.5 prose-td:px-3 prose-td:py-1.5
1494
- prose-h1:text-lg prose-h2:text-base prose-h3:text-sm
1495
- prose-li:my-0.5
1496
- prose-blockquote:border-l-2 prose-blockquote:pl-4 prose-blockquote:my-2
1497
- prose-hr:my-4`,FD={color:"var(--text-primary)","--tw-prose-headings":"var(--text-primary)","--tw-prose-bold":"var(--text-primary)","--tw-prose-links":"var(--text-link)","--tw-prose-code":"var(--text-primary)","--tw-prose-pre-code":"var(--text-primary)","--tw-prose-pre-bg":"var(--code-bg)","--tw-prose-th-borders":"var(--border)","--tw-prose-td-borders":"var(--border)","--tw-prose-quotes":"var(--text-secondary)","--tw-prose-quote-borders":"var(--border)","--tw-prose-bullets":"var(--text-muted)","--tw-prose-counters":"var(--text-muted)","--tw-prose-hr":"var(--border)"};function $D(e){return e.split(/\n\n---\n\n/).filter(t=>t.trim())}function L1({jobs:e,selectedJobId:t}){const r=t?e.find(d=>d.id===t):null,a=D.useRef(null);if(D.useEffect(()=>{a.current&&(r==null?void 0:r.status)==="running"&&(a.current.scrollTop=a.current.scrollHeight)},[r==null?void 0:r.summary,r==null?void 0:r.status]),!r)return m.jsx("div",{className:"flex-1 h-full flex items-center justify-center",style:{background:"var(--bg-surface)"},children:m.jsx("p",{className:"text-caption",style:{color:"var(--text-muted)"},children:e.length>0?"Select a run to view output":"No execution history yet"})});const l=GE(r.status),c=r.status==="running",u=r.summary?$D(r.summary):[];return m.jsxs("div",{className:"flex-1 h-full flex flex-col min-w-0",style:{background:"var(--bg-surface)"},children:[m.jsxs("div",{className:"flex items-center gap-3 px-5 py-2.5 flex-shrink-0",style:{borderBottom:"1px solid var(--border)"},children:[m.jsx("span",{className:"text-tiny px-2 py-0.5 rounded-sm font-bold",style:{background:l.bg,color:l.fg},children:$E(r.status)}),c&&m.jsx("span",{className:"inline-block w-2 h-2 rounded-full animate-pulse",style:{background:"var(--text-link)"}}),m.jsx("span",{className:"text-caption",style:{color:"var(--text-secondary)"},children:r.time}),r.durationMs!=null&&m.jsx("span",{className:"text-caption",style:{color:"var(--text-muted)"},children:r.durationMs>=6e4?`${(r.durationMs/6e4).toFixed(1)}m`:`${(r.durationMs/1e3).toFixed(1)}s`})]}),m.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",ref:a,children:u.length>0?m.jsxs("div",{className:"flex flex-col gap-3",children:[u.map((d,h)=>{const p=h===u.length-1,b=c&&p;return m.jsxs("div",{className:"rounded-md px-4 py-3",style:{background:"var(--bg-primary)",border:b?"1px solid var(--text-link)":"1px solid var(--border)"},children:[m.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[m.jsx("span",{className:"text-tiny font-bold px-1.5 py-0.5 rounded-sm",style:{background:b?"var(--text-link)":"var(--bg-surface)",color:b?"#fff":"var(--text-muted)"},children:u.length>1?`#${h+1}`:"Output"}),b&&m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--text-link)"}}),m.jsx("span",{className:"text-tiny",style:{color:"var(--text-link)"},children:"streaming..."})]}),!b&&!c&&u.length>1&&m.jsx("span",{className:"text-tiny",style:{color:"var(--text-muted)"},children:"completed"})]}),m.jsx("div",{className:HD,style:FD,children:m.jsx(Gx,{remarkPlugins:[p0],children:d})})]},h)}),c&&m.jsxs("div",{className:"flex items-center gap-1.5 pl-2",children:[m.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--text-link)"}}),m.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--text-link)",animationDelay:"0.2s"}}),m.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--text-link)",animationDelay:"0.4s"}})]})]}):c?m.jsxs("div",{className:"flex items-center gap-1.5 py-2 pl-1",children:[m.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--text-link)"}}),m.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--text-link)",animationDelay:"0.2s"}}),m.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--text-link)",animationDelay:"0.4s"}})]}):m.jsx("div",{className:"flex items-center justify-center h-full",children:m.jsx("p",{className:"text-caption",style:{color:"var(--text-muted)"},children:"No output recorded for this run."})})})]})}function Di({label:e,children:t}){return m.jsxs("div",{className:"min-w-0",children:[m.jsx("div",{className:"text-tiny uppercase tracking-wider mb-1",style:{color:"var(--text-muted)"},children:e}),t]})}function qE({saving:e,onSave:t,onCancel:r}){return m.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[m.jsx("button",{onClick:t,disabled:e,className:"px-2 py-1 text-tiny font-bold text-white rounded-sm disabled:opacity-50",style:{background:"var(--bg-active)"},children:e?"...":"Save"}),m.jsx("button",{onClick:r,className:"px-2 py-1 text-tiny rounded-sm",style:{color:"var(--text-muted)"},children:"Cancel"})]})}function GD({sendMessage:e,theme:t,onToggleTheme:r,showSettings:a,onOpenSettings:l,onCloseSettings:c,handleDefaultModelChange:u,handleSelectJob:d}){var W,te,ee,U,F,X,me,le,K,z;const h=lr(),p=ti(),[b,y]=D.useState(()=>h.activeView==="automations"?"cron-list":h.selectedAgentId&&h.selectedSessionKey?"chat":"channel-list"),[v,x]=D.useState(!1),_=h.activeView,T=D.useCallback(Q=>{p({type:"SET_ACTIVE_VIEW",view:Q}),Q==="messages"?h.selectedAgentId&&h.selectedSessionKey?y("chat"):y("channel-list"):h.selectedCronTaskId?y("cron-detail"):y("cron-list")},[p,h.selectedAgentId,h.selectedSessionKey,h.selectedCronTaskId]),C=qr.useRef(h.selectedAgentId);qr.useEffect(()=>{h.selectedAgentId&&h.selectedAgentId!==C.current&&b==="channel-list"&&y("chat"),C.current=h.selectedAgentId},[h.selectedAgentId,b]);const S=qr.useRef(h.selectedCronTaskId);qr.useEffect(()=>{h.selectedCronTaskId&&h.selectedCronTaskId!==S.current&&b==="cron-list"&&y("cron-detail"),S.current=h.selectedCronTaskId},[h.selectedCronTaskId,b]),qr.useEffect(()=>{h.activeThreadId&&b==="chat"&&y("thread")},[h.activeThreadId,b]),qr.useEffect(()=>{!h.activeThreadId&&b==="thread"&&y("chat")},[h.activeThreadId,b]);const R=()=>{var Q;ue.info("Auth",`Mobile logout — user ${(Q=h.user)==null?void 0:Q.email}`),uo(null),Su(null),p({type:"LOGOUT"})},M=((ee=(te=(W=h.user)==null?void 0:W.displayName)==null?void 0:te[0])==null?void 0:ee.toUpperCase())??((X=(F=(U=h.user)==null?void 0:U.email)==null?void 0:F[0])==null?void 0:X.toUpperCase())??"?",A=D.useCallback(()=>{switch(b){case"chat":y("channel-list");break;case"thread":p({type:"CLOSE_THREAD"}),y("chat");break;case"cron-detail":y("cron-list");break}},[b,p]),P=()=>{switch(b){case"channel-list":return"BotsChat";case"chat":{const Q=h.agents.find(ie=>ie.id===h.selectedAgentId);return`# ${(Q==null?void 0:Q.name)??"Chat"}`}case"thread":return"Thread";case"cron-list":return"Automations";case"cron-detail":{const Q=h.cronTasks.find(ie=>ie.id===h.selectedCronTaskId);return(Q==null?void 0:Q.name)??"Task Detail"}default:return"BotsChat"}},I=b!=="channel-list"&&b!=="cron-list";return m.jsxs("div",{className:"flex flex-col h-screen",style:{background:"var(--bg-surface)"},children:[m.jsxs("div",{className:"flex items-center justify-between px-4 flex-shrink-0",style:{height:44,paddingTop:"env(safe-area-inset-top, 0px)",background:"var(--bg-primary)",borderBottom:"1px solid var(--border)"},children:[m.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[I&&m.jsx("button",{onClick:A,className:"p-1 -ml-1 rounded",style:{color:"var(--text-link)"},"aria-label":"Back",children:m.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5L8.25 12l7.5-7.5"})})}),m.jsx("span",{className:"text-h2 font-bold truncate",style:{color:"var(--text-primary)"},children:P()})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("div",{className:"w-2 h-2 rounded-full mr-1",style:{background:h.openclawConnected?"var(--accent-green)":"var(--accent-red)"}}),m.jsx("button",{onClick:l,className:"p-1.5 rounded",style:{color:"var(--text-muted)"},children:m.jsxs("svg",{className:"w-4.5 h-4.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z"}),m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}),m.jsx("button",{onClick:()=>x(!v),className:"w-6 h-6 rounded flex items-center justify-center text-[10px] font-bold text-white",style:{background:"#9B59B6"},title:((me=h.user)==null?void 0:me.displayName)??((le=h.user)==null?void 0:le.email)??"User",children:M})]})]}),v&&m.jsx("div",{className:"fixed inset-0 z-50",onClick:()=>x(!1),children:m.jsxs("div",{className:"absolute right-4 rounded-lg py-1 min-w-[200px]",style:{top:"calc(44px + env(safe-area-inset-top, 0px) + 4px)",background:"var(--bg-surface)",border:"1px solid var(--border)",boxShadow:"0 4px 12px rgba(0,0,0,0.15)"},onClick:Q=>Q.stopPropagation(),children:[m.jsxs("div",{className:"px-4 py-2.5",style:{borderBottom:"1px solid var(--border)"},children:[m.jsx("div",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:((K=h.user)==null?void 0:K.displayName)??"User"}),m.jsx("div",{className:"text-caption",style:{color:"var(--text-muted)"},children:(z=h.user)==null?void 0:z.email})]}),m.jsxs("button",{className:"w-full text-left px-4 py-2.5 text-body flex items-center gap-2.5",style:{color:"var(--text-primary)"},onClick:()=>{r(),x(!1)},children:[t==="dark"?m.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z"})}):m.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.752 15.002A9.718 9.718 0 0118 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 003 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 009.002-5.998z"})}),t==="dark"?"Light Mode":"Dark Mode"]}),m.jsxs("button",{className:"w-full text-left px-4 py-2.5 text-body flex items-center gap-2.5",style:{color:"var(--text-primary)"},onClick:()=>{l(),x(!1)},children:[m.jsxs("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z"}),m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),"Settings"]}),m.jsx("div",{style:{borderTop:"1px solid var(--border)"}}),m.jsxs("button",{className:"w-full text-left px-4 py-2.5 text-body flex items-center gap-2.5",style:{color:"var(--accent-red)"},onClick:()=>{R(),x(!1)},children:[m.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"})}),"Logout"]})]})}),m.jsxs("div",{className:"flex-1 min-h-0 flex flex-col overflow-hidden",children:[b==="channel-list"&&m.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",style:{background:"var(--bg-secondary)"},children:m.jsx(ox,{onOpenSettings:l})}),b==="chat"&&m.jsx("div",{className:"flex-1 min-h-0 flex flex-col",children:m.jsx(F0,{sendMessage:e})}),b==="thread"&&m.jsx("div",{className:"flex-1 min-h-0 flex flex-col",children:m.jsx($0,{sendMessage:e})}),b==="cron-list"&&m.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",style:{background:"var(--bg-secondary)"},children:m.jsx(HE,{})}),b==="cron-detail"&&m.jsx("div",{className:"flex-1 min-h-0 flex flex-col overflow-hidden",children:m.jsx(KE,{})})]}),m.jsxs("div",{className:"flex items-stretch flex-shrink-0",style:{height:56,background:"var(--bg-primary)",borderTop:"1px solid var(--border)",paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:[m.jsx(z1,{label:"Messages",active:_==="messages",onClick:()=>T("messages"),icon:m.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 01-.825-.242m9.345-8.334a2.126 2.126 0 00-.476-.095 48.64 48.64 0 00-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0011.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155"})})}),m.jsx(z1,{label:"Automations",active:_==="automations",onClick:()=>T("automations"),icon:m.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})})})]}),a&&m.jsx(KD,{state:h,onClose:c,handleDefaultModelChange:u})]})}function KD({state:e,onClose:t,handleDefaultModelChange:r}){const[a,l]=D.useState("general");return m.jsx("div",{className:"fixed inset-0 flex items-end justify-center z-50",style:{background:"rgba(0,0,0,0.5)"},onClick:t,children:m.jsxs("div",{className:"w-full rounded-t-xl p-5 max-h-[85vh] flex flex-col",style:{background:"var(--bg-surface)",paddingBottom:"calc(20px + env(safe-area-inset-bottom, 0px))"},onClick:c=>c.stopPropagation(),children:[m.jsx("div",{className:"w-10 h-1 rounded-full mx-auto mb-4",style:{background:"var(--text-muted)"}}),m.jsx("h2",{className:"text-h1 font-bold mb-3",style:{color:"var(--text-primary)"},children:"Settings"}),m.jsxs("div",{className:"flex gap-4 mb-4",style:{borderBottom:"1px solid var(--border)"},children:[m.jsx("button",{className:"pb-2 text-caption font-bold transition-colors",style:{color:a==="general"?"var(--text-primary)":"var(--text-muted)",borderBottom:a==="general"?"2px solid var(--bg-active)":"2px solid transparent",marginBottom:"-1px"},onClick:()=>l("general"),children:"General"}),m.jsx("button",{className:"pb-2 text-caption font-bold transition-colors",style:{color:a==="connection"?"var(--text-primary)":"var(--text-muted)",borderBottom:a==="connection"?"2px solid var(--bg-active)":"2px solid transparent",marginBottom:"-1px"},onClick:()=>l("connection"),children:"Connection"}),m.jsx("button",{className:"pb-2 text-caption font-bold transition-colors",style:{color:a==="security"?"var(--text-primary)":"var(--text-muted)",borderBottom:a==="security"?"2px solid var(--bg-active)":"2px solid transparent",marginBottom:"-1px"},onClick:()=>l("security"),children:"Security"})]}),m.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[a==="general"&&m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{children:[m.jsx("label",{className:"block text-caption font-bold mb-1.5",style:{color:"var(--text-secondary)"},children:"Default Model"}),m.jsx(wu,{value:e.defaultModel??"",onChange:r,models:e.models,placeholder:"Not set (use agent default)"})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-caption font-bold mb-1.5",style:{color:"var(--text-secondary)"},children:"Current Session Model"}),m.jsx("span",{className:"text-body font-mono",style:{color:e.sessionModel||e.defaultModel?"var(--text-primary)":"var(--text-muted)"},children:e.sessionModel??e.defaultModel??"Not connected"})]})]}),a==="connection"&&m.jsx(jE,{}),a==="security"&&m.jsx(BE,{})]}),m.jsx("button",{onClick:t,className:"w-full mt-4 py-2.5 text-caption font-bold text-white rounded-md shrink-0",style:{background:"var(--bg-active)"},children:"Done"})]})})}function z1({label:e,active:t,onClick:r,icon:a}){return m.jsxs("button",{onClick:r,className:"flex-1 flex flex-col items-center justify-center gap-0.5 transition-colors",style:{color:t?"var(--text-link)":"var(--text-muted)"},children:[a,m.jsx("span",{className:"text-[10px] leading-tight",children:e})]})}const j1="G-HKJNG1X0JE";function qD(){if(typeof window>"u")return!1;if(window.gtag)return!0;window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date),window.gtag("config",j1);const e=document.createElement("script");return e.async=!0,e.src=`https://www.googletagmanager.com/gtag/js?id=${j1}`,document.head.appendChild(e),!0}let B1=!1;function VD(){B1||(B1=qD())}function YD(e,t){window.gtag&&window.gtag("event",e,t)}function WD(e){YD("page_view",{page_path:`/${e}`,page_title:e})}function XD(){var ie;const[e,t]=D.useReducer(Uw,ap,B=>{try{const w=localStorage.getItem("botschat_active_view");if(w==="messages"||w==="automations")return{...B,activeView:w}}catch{}return B}),r=D.useRef(null),a=D.useRef(()=>{}),l=D.useRef(!1),[c,u]=D.useState(!1),[d,h]=D.useState("general"),[p,b]=D.useState(!1),[y,v]=D.useState(vt.hasKey());D.useEffect(()=>vt.subscribe(()=>v(vt.hasKey())),[]);const x=FE(),_=lu({id:"botschat-main"}),T=lu({id:"botschat-content"}),[C,S]=D.useState(()=>localStorage.getItem("botschat_onboarding_dismissed")==="1"),R=D.useCallback(()=>{S(!0),localStorage.setItem("botschat_onboarding_dismissed","1")},[]),[M,A]=D.useState(()=>{var w;const B=localStorage.getItem("botschat_theme");return B==="light"||B==="dark"?B:(w=window.matchMedia)!=null&&w.call(window,"(prefers-color-scheme: light)").matches?"light":"dark"});D.useEffect(()=>{document.documentElement.setAttribute("data-theme",M),localStorage.setItem("botschat_theme",M);const B=document.querySelector('meta[name="theme-color"]');B&&B.setAttribute("content",M==="dark"?"#1A1D21":"#FFFFFF")},[M]),D.useEffect(()=>{localStorage.setItem("botschat_active_view",e.activeView)},[e.activeView]),D.useEffect(()=>{WD(e.activeView)},[e.activeView]),D.useEffect(()=>{e.selectedCronTaskId&&localStorage.setItem("botschat_last_cron_task",e.selectedCronTaskId)},[e.selectedCronTaskId]),D.useEffect(()=>{if(e.selectedSessionId){const B=e.agents.find(w=>w.id===e.selectedAgentId);B!=null&&B.channelId&&localStorage.setItem(`botschat_last_session_${B.channelId}`,e.selectedSessionId)}},[e.selectedSessionId,e.selectedAgentId,e.agents]);const P=D.useCallback(()=>{A(B=>B==="dark"?"light":"dark")},[]);D.useEffect(()=>{$y()&&(ue.api("Auth","Auto-login with stored token"),Pl.me().then(w=>{ue.info("Auth",`Logged in as ${w.email} (${w.id})`),t({type:"SET_USER",user:w})}).catch(w=>{ue.warn("Auth",`Auto-login failed: ${w}`),uo(null),Su(null)}))},[]),D.useEffect(()=>{if(!e.user)return;const B=setTimeout(()=>{e.models.length===0&&qw.list().then(({models:w})=>{w.length>0&&t({type:"SET_MODELS",models:w})}).catch(()=>{})},2e3);return()=>clearTimeout(B)},[e.user,e.models.length]),D.useEffect(()=>{e.user&&(ue.api("Agents","Loading agents list"),_s.list().then(({agents:B})=>{if(ue.info("Agents",`Loaded ${B.length} agents`,B.map(w=>({id:w.id,name:w.name,channelId:w.channelId}))),t({type:"SET_AGENTS",agents:B}),B.length>0&&!e.selectedAgentId){let w=B[0];try{const O=localStorage.getItem("botschat_last_agent");if(O){const G=B.find(N=>N.id===O);G&&(ue.info("Agents",`Restoring last channel: ${G.name} (${G.id})`),w=G)}}catch{}t({type:"SELECT_AGENT",agentId:w.id,sessionKey:w.sessionKey})}}),ue.api("Channels","Loading channels list"),Er.list().then(({channels:B})=>{ue.info("Channels",`Loaded ${B.length} channels`,B.map(w=>({id:w.id,name:w.name}))),t({type:"SET_CHANNELS",channels:B}),b(!0)}))},[e.user]),D.useEffect(()=>{e.user&&e.activeView==="automations"&&(ue.api("Cron","Loading all background tasks + scan data"),Promise.all([Xn.listAll("background"),Xn.scanData()]).then(([{tasks:B},{tasks:w}])=>{if(ue.info("Cron",`Loaded ${B.length} cron tasks + ${w.length} scan entries`),t({type:"SET_CRON_TASKS",cronTasks:B}),t({type:"MERGE_SCAN_DATA",scanTasks:w.map(O=>({cronJobId:O.cronJobId,schedule:O.schedule,instructions:O.instructions,model:O.model||void 0,enabled:O.enabled}))}),B.length>0&&!e.selectedCronTaskId){let O=B[0].id;try{const G=localStorage.getItem("botschat_last_cron_task");if(G){const N=B.find(de=>de.id===G);N&&(ue.info("Cron",`Restoring last cron task: ${N.name} (${N.id})`),O=N.id)}}catch{}t({type:"SELECT_CRON_TASK",taskId:O})}}))},[e.user,e.activeView]);const I=(ie=e.agents.find(B=>B.id===e.selectedAgentId))==null?void 0:ie.channelId,W=e.activeView==="messages";D.useEffect(()=>{if(!W)return;if(!e.selectedAgentId){t({type:"SET_TASKS",tasks:[]}),t({type:"SELECT_TASK",taskId:null}),t({type:"SET_SESSIONS",sessions:[]});return}const B=e.agents.find(w=>w.id===e.selectedAgentId);B!=null&&B.channelId?(B.isDefault?(t({type:"SET_TASKS",tasks:[]}),t({type:"SELECT_TASK",taskId:null})):Xn.list(B.channelId).then(({tasks:w})=>{if(t({type:"SET_TASKS",tasks:w}),w.length>0){const O=w[0];t({type:"SELECT_TASK",taskId:O.id})}}),Es.list(B.channelId).then(({sessions:w})=>{if(ue.info("Sessions",`Loaded ${w.length} sessions for channel ${B.channelId}`),t({type:"SET_SESSIONS",sessions:w}),w.length>0){let O=w[0];try{const G=localStorage.getItem(`botschat_last_session_${B.channelId}`);if(G){const N=w.find(de=>de.id===G);N&&(ue.info("Sessions",`Restoring last session: ${N.name} (${N.id})`),O=N)}}catch{}t({type:"SELECT_SESSION",sessionId:O.id,sessionKey:O.sessionKey})}}).catch(w=>{ue.error("Sessions",`Failed to load sessions: ${w}`)})):B!=null&&B.isDefault&&!l.current&&C?(ue.info("Sessions","Default agent has no channel — auto-creating General channel"),l.current=!0,t({type:"SET_TASKS",tasks:[]}),t({type:"SELECT_TASK",taskId:null}),t({type:"SET_SESSIONS",sessions:[]}),Er.create({name:"General",openclawAgentId:"main"}).then(async w=>{ue.info("Sessions",`General channel created: ${w.id}`);const[{agents:O},{channels:G}]=await Promise.all([_s.list(),Er.list()]);t({type:"SET_AGENTS",agents:O}),t({type:"SET_CHANNELS",channels:G});const{sessions:N}=await Es.list(w.id);t({type:"SET_SESSIONS",sessions:N}),N.length>0&&t({type:"SELECT_SESSION",sessionId:N[0].id,sessionKey:N[0].sessionKey})}).catch(w=>{ue.error("Sessions",`Failed to auto-create General channel: ${w}`),l.current=!1})):(t({type:"SET_TASKS",tasks:[]}),t({type:"SELECT_TASK",taskId:null}),t({type:"SET_SESSIONS",sessions:[]}))},[e.selectedAgentId,I,W,C]),D.useEffect(()=>{if(!e.selectedTaskId)return;const B=e.tasks.find(O=>O.id===e.selectedTaskId);if(!B||B.kind!=="background"){t({type:"SET_JOBS",jobs:[]});return}const w=e.agents.find(O=>O.id===e.selectedAgentId);w!=null&&w.channelId&&Ch.list(w.channelId,B.id).then(({jobs:O})=>{t({type:"SET_JOBS",jobs:O}),O.length>0&&!e.selectedJobId&&t({type:"SELECT_JOB",jobId:O[0].id,sessionKey:O[0].sessionKey})}).catch(O=>{console.error("Failed to load jobs:",O)})},[e.selectedTaskId,e.tasks]),D.useEffect(()=>{if(!e.user||!e.selectedSessionKey)return;let B=!1;return ex.list(e.user.id,e.selectedSessionKey).then(async({messages:w,replyCounts:O})=>{if(B)return;const G=await Promise.all(w.map(async N=>{if(N.encrypted&&vt.hasKey())try{const de=await vt.decrypt(N.text,N.id);return{...N,text:de,isEncryptedLocked:!1}}catch(de){return console.warn(`Failed to decrypt message ${N.id}`,de),{...N,isEncryptedLocked:!0}}else if(N.encrypted)return{...N,isEncryptedLocked:!0};return N}));t({type:"SET_MESSAGES",messages:G,replyCounts:O})}).catch(w=>{console.error("Failed to load message history:",w)}),()=>{B=!0}},[e.user,e.selectedSessionKey,y]);const te=D.useRef(e);D.useEffect(()=>{te.current=e},[e]);const ee=D.useCallback(B=>{var de;const w=B.sessionKey,O=B.threadId??B.replyToId;ue.wsIn("WS",`${B.type}`,B);const G=fe=>{if(fe)return fe.replace(/:thread:.+$/,"")},N=fe=>fe?G(fe)===te.current.selectedSessionKey:!0;switch(B.type){case"connection.status":ue.info("Connection",`OpenClaw ${B.openclawConnected?"connected":"disconnected"}${B.defaultModel?` (default: ${B.defaultModel})`:""}`),t({type:"SET_OPENCLAW_CONNECTED",connected:B.openclawConnected,defaultModel:B.defaultModel||void 0}),Array.isArray(B.models)&&B.models.length>0&&t({type:"SET_MODELS",models:B.models});break;case"openclaw.disconnected":ue.warn("Connection","OpenClaw disconnected"),t({type:"SET_OPENCLAW_CONNECTED",connected:!1});break;case"model.changed":if(B.model&&B.sessionKey){ue.info("Model",`Session model changed to: ${B.model} (session: ${B.sessionKey})`),t({type:"SET_SESSION_MODEL",model:B.model});try{const fe=JSON.parse(localStorage.getItem("botschat:sessionModels")||"{}");fe[B.sessionKey]=B.model,localStorage.setItem("botschat:sessionModels",JSON.stringify(fe))}catch{}}break;case"agent.stream.start":if(w&&N(w)){const fe=O??((de=w.match(/:thread:(.+)$/))==null?void 0:de[1]);t({type:"STREAM_START",runId:B.runId,sessionKey:w,threadId:fe})}break;case"agent.stream.chunk":t({type:"STREAM_CHUNK",runId:B.runId,sessionKey:w??"",text:B.text});break;case"agent.stream.end":t({type:"STREAM_END",runId:B.runId});break;case"agent.text":{if(!N(w))break;const fe={id:Wr(),sender:"agent",text:B.text,timestamp:Date.now(),threadId:O};t(O&&w?{type:"ADD_THREAD_MESSAGE",message:fe}:{type:"ADD_MESSAGE",message:fe});break}case"agent.media":{if(!N(w))break;const fe={id:Wr(),sender:"agent",text:B.caption??"",mediaUrl:B.mediaUrl,timestamp:Date.now(),threadId:O};t(O&&w?{type:"ADD_THREAD_MESSAGE",message:fe}:{type:"ADD_MESSAGE",message:fe});break}case"agent.a2ui":{if(!N(w))break;const fe={id:Wr(),sender:"agent",text:"",a2ui:B.jsonl,timestamp:Date.now(),threadId:O};t(O&&w?{type:"ADD_THREAD_MESSAGE",message:fe}:{type:"ADD_MESSAGE",message:fe});break}case"job.update":{const fe={id:B.jobId,number:0,sessionKey:B.sessionKey,status:B.status,startedAt:B.startedAt,finishedAt:B.finishedAt??null,durationMs:B.durationMs??null,summary:B.summary??"",time:new Date((B.startedAt??0)*1e3).toLocaleString()};if(fe.status==="running")t({type:"ADD_JOB",job:fe});else{const q=te.current,ce=q.jobs.some(ge=>ge.id===fe.id);t(ce?{type:"SET_JOBS",jobs:q.jobs.map(ge=>ge.id===fe.id?{...ge,...fe}:ge)}:{type:"ADD_JOB",job:fe})}fe.status==="running"?t({type:"ADD_CRON_JOB",job:fe}):t({type:"UPDATE_CRON_JOB",job:fe});break}case"job.output":{const fe=B.jobId,q=B.text;fe&&q&&t({type:"APPEND_JOB_OUTPUT",jobId:fe,text:q});break}case"task.scan.result":{const fe=B.tasks??[];ue.info("TaskScan",`Scan result: ${fe.length} tasks reported`,fe),_s.list().then(({agents:ce})=>{ue.info("TaskScan",`Reloaded ${ce.length} agents`),t({type:"SET_AGENTS",agents:ce})}),Er.list().then(({channels:ce})=>{ue.info("TaskScan",`Reloaded ${ce.length} channels`),t({type:"SET_CHANNELS",channels:ce})}),Xn.listAll("background").then(({tasks:ce})=>{ue.info("TaskScan",`Reloaded ${ce.length} cron tasks, merging scan data`),t({type:"SET_CRON_TASKS",cronTasks:ce}),t({type:"MERGE_SCAN_DATA",scanTasks:fe.map(ge=>({cronJobId:ge.cronJobId,schedule:ge.schedule,instructions:ge.instructions??"",model:ge.model,enabled:ge.enabled}))})});const q=te.current;if(q.selectedAgentId){const ce=q.agents.find(ge=>ge.id===q.selectedAgentId);ce!=null&&ce.channelId&&Xn.list(ce.channelId).then(({tasks:ge})=>{t({type:"SET_TASKS",tasks:ge})})}break}case"status":break;case"models.list":Array.isArray(B.models)&&t({type:"SET_MODELS",models:B.models});break;case"task.schedule.ack":B.ok?ue.info("Task",`Schedule applied to OpenClaw: ${B.cronJobId}`):ue.error("Task",`Schedule push to OpenClaw failed: ${B.error}`,B);break;case"error":ue.error("Server",B.message,B);break}},[]);D.useEffect(()=>{a.current=ee},[ee]),D.useEffect(()=>{if(!e.user)return;const B=$y();if(!B)return;const w=Wr();ue.info("WS",`Connecting WebSocket (session=${w.slice(0,8)}...)`);const O=new ik({userId:e.user.id,sessionId:w,token:B,onMessage:G=>{a.current(G)},onStatusChange:G=>{ue.info("WS",G?"WebSocket connected":"WebSocket disconnected"),t({type:"SET_WS_CONNECTED",connected:G})}});return O.connect(),r.current=O,()=>{O.disconnect(),r.current=null}},[e.user]);const U=D.useCallback(B=>{var w;ue.wsOut("WS",`${B.type}`,B),(w=r.current)==null||w.send(B)},[]),F=D.useCallback(async B=>{t({type:"SET_DEFAULT_MODEL",model:B||null});try{await Kw.updateSettings({defaultModel:B||void 0})}catch(w){console.error("Failed to update default model:",w)}},[]),X=D.useCallback(B=>{const w=e.jobs.find(O=>O.id===B);w&&t({type:"SELECT_JOB",jobId:w.id,sessionKey:w.sessionKey||void 0})},[e.jobs]);if(D.useEffect(()=>{if(e.openclawConnected&&!C){const B=setTimeout(()=>{R()},1500);return()=>clearTimeout(B)}},[e.openclawConnected,C,R]),!e.user)return m.jsx(vs.Provider,{value:e,children:m.jsx(Ul.Provider,{value:t,children:m.jsx(CD,{})})});if(!C&&p&&e.channels.length===0&&!e.openclawConnected)return m.jsx(vs.Provider,{value:e,children:m.jsx(Ul.Provider,{value:t,children:m.jsx(RD,{onSkip:R})})});e.agents.find(B=>B.id===e.selectedAgentId);const le=e.tasks.find(B=>B.id===e.selectedTaskId),K=(le==null?void 0:le.kind)==="background",z=!!e.selectedSessionKey,Q=e.activeView==="automations";return x?m.jsx(vs.Provider,{value:e,children:m.jsx(Ul.Provider,{value:t,children:m.jsx(GD,{sendMessage:U,theme:M,onToggleTheme:P,showSettings:c,onOpenSettings:()=>u(!0),onCloseSettings:()=>u(!1),handleDefaultModelChange:F,handleSelectJob:X})})}):m.jsx(vs.Provider,{value:e,children:m.jsxs(Ul.Provider,{value:t,children:[m.jsxs("div",{className:"flex flex-col h-screen",children:[m.jsxs("div",{className:"flex flex-1 min-h-0",children:[m.jsx(ak,{onToggleTheme:P,onOpenSettings:()=>u(!0),theme:M}),m.jsxs(no,{orientation:"horizontal",defaultLayout:_.defaultLayout,onLayoutChanged:_.onLayoutChanged,id:"botschat-main",className:"flex-1",children:[m.jsx(vr,{id:"sidebar",defaultSize:"15%",minSize:"5%",maxSize:"30%",children:Q?m.jsx(HE,{}):m.jsx(ox,{})}),m.jsx(eo,{}),m.jsx(vr,{id:"content",children:Q?m.jsx(KE,{}):m.jsx("div",{className:"flex-1 flex flex-col min-w-0 h-full",children:z?m.jsxs(no,{orientation:"horizontal",defaultLayout:T.defaultLayout,onLayoutChanged:T.onLayoutChanged,id:"botschat-content",children:[K&&m.jsxs(m.Fragment,{children:[m.jsx(vr,{id:"joblist",defaultSize:"15%",minSize:"5%",maxSize:"30%",children:m.jsx(PM,{jobs:e.jobs,selectedJobId:e.selectedJobId,onSelectJob:X})}),m.jsx(eo,{})]}),m.jsx(vr,{id:"chat",children:m.jsx(F0,{sendMessage:U})}),e.activeThreadId&&m.jsxs(m.Fragment,{children:[m.jsx(eo,{}),m.jsx(vr,{id:"thread",defaultSize:"28%",minSize:"10%",maxSize:"50%",children:m.jsx($0,{sendMessage:U})})]})]}):m.jsx("div",{className:"flex-1 flex items-center justify-center",style:{background:"var(--bg-surface)"},children:m.jsxs("div",{className:"text-center",children:[m.jsx("svg",{className:"w-20 h-20 mx-auto mb-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,style:{color:"var(--text-muted)"},children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"})}),m.jsx("p",{className:"text-body font-bold",style:{color:"var(--text-muted)"},children:"Select a channel to get started"}),m.jsx("p",{className:"text-caption mt-1",style:{color:"var(--text-muted)"},children:"Choose a channel from the sidebar"})]})})})})]})]}),m.jsx(LD,{})]}),c&&m.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-50",style:{background:"rgba(0,0,0,0.5)"},onClick:()=>u(!1),children:m.jsxs("div",{className:"rounded-lg p-6 w-[540px] max-w-[90vw] max-h-[85vh] flex flex-col",style:{background:"var(--bg-surface)",boxShadow:"var(--shadow-lg)"},onClick:B=>B.stopPropagation(),children:[m.jsxs("div",{className:"flex items-center justify-between mb-4",children:[m.jsx("h2",{className:"text-h1 font-bold",style:{color:"var(--text-primary)"},children:"Settings"}),m.jsx("button",{onClick:()=>u(!1),className:"p-1 hover:bg-[--bg-hover] rounded",style:{color:"var(--text-muted)"},children:m.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),m.jsxs("div",{className:"flex gap-4 mb-4",style:{borderBottom:"1px solid var(--border)"},children:[m.jsx("button",{className:"pb-2 text-caption font-bold transition-colors",style:{color:d==="general"?"var(--text-primary)":"var(--text-muted)",borderBottom:d==="general"?"2px solid var(--bg-active)":"2px solid transparent",marginBottom:"-1px"},onClick:()=>h("general"),children:"General"}),m.jsx("button",{className:"pb-2 text-caption font-bold transition-colors",style:{color:d==="connection"?"var(--text-primary)":"var(--text-muted)",borderBottom:d==="connection"?"2px solid var(--bg-active)":"2px solid transparent",marginBottom:"-1px"},onClick:()=>h("connection"),children:"Connection"}),m.jsx("button",{className:"pb-2 text-caption font-bold transition-colors",style:{color:d==="security"?"var(--text-primary)":"var(--text-muted)",borderBottom:d==="security"?"2px solid var(--bg-active)":"2px solid transparent",marginBottom:"-1px"},onClick:()=>h("security"),children:"Security"})]}),m.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[d==="general"&&m.jsxs("div",{className:"space-y-5",children:[m.jsxs("div",{children:[m.jsx("label",{className:"block text-caption font-bold mb-1.5",style:{color:"var(--text-secondary)"},children:"Default Model"}),m.jsx(wu,{value:e.defaultModel??"",onChange:F,models:e.models,placeholder:"Not set (use agent default)"}),m.jsxs("p",{className:"text-tiny mt-1.5",style:{color:"var(--text-muted)"},children:["Default model for new conversations. You can override per session using"," ",m.jsx("code",{children:"/model"})," or per automation in its settings."]})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-caption font-bold mb-1.5",style:{color:"var(--text-secondary)"},children:"Current Session Model"}),m.jsx("span",{className:"text-body font-mono",style:{color:e.sessionModel||e.defaultModel?"var(--text-primary)":"var(--text-muted)"},children:e.sessionModel??e.defaultModel??"Not connected"})]})]}),d==="connection"&&m.jsx(jE,{}),d==="security"&&m.jsx(BE,{})]}),m.jsx("div",{className:"mt-4 pt-4 flex justify-end",style:{borderTop:"1px solid var(--border)"},children:m.jsx("button",{onClick:()=>u(!1),className:"px-4 py-1.5 text-caption font-bold text-white rounded-sm",style:{background:"var(--bg-active)"},children:"Done"})})]})})]})})}VD();lw.createRoot(document.getElementById("root")).render(m.jsx(qr.StrictMode,{children:m.jsx(XD,{})}));"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(()=>{})});