botschat 0.1.20 → 0.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/packages/api/src/do/connection-do.ts +186 -382
- package/packages/api/src/index.ts +50 -67
- package/packages/api/src/routes/agents.ts +3 -3
- package/packages/api/src/routes/auth.ts +1 -0
- package/packages/api/src/routes/channels.ts +11 -11
- package/packages/api/src/routes/demo.ts +156 -0
- package/packages/api/src/routes/sessions.ts +5 -5
- package/packages/api/src/routes/tasks.ts +33 -33
- package/packages/plugin/dist/src/channel.js +50 -0
- package/packages/plugin/dist/src/channel.js.map +1 -1
- package/packages/plugin/package.json +18 -2
- package/packages/web/dist/assets/index-BtPyCBCl.css +1 -0
- package/packages/web/dist/assets/index-BtpsFe4Z.js +2 -0
- package/packages/web/dist/assets/index-CQbIYr6_.js +2 -0
- package/packages/web/dist/assets/{index-CYQMu_-c.js → index-C_GamcQc.js} +1 -1
- package/packages/web/dist/assets/index-LiBjPMg2.js +1 -0
- package/packages/web/dist/assets/{index-DYCO-ry1.js → index-MyoWvQAH.js} +1 -1
- package/packages/web/dist/assets/index-STIPTMK8.js +1516 -0
- package/packages/web/dist/assets/{index.esm-CvOpngZM.js → index.esm-BpQAwtdR.js} +1 -1
- package/packages/web/dist/assets/{web-D3LMODYp.js → web-BbTzVNLt.js} +1 -1
- package/packages/web/dist/assets/{web-1cdhq2RW.js → web-cnzjgNfD.js} +1 -1
- package/packages/web/dist/index.html +2 -2
- package/packages/web/src/App.tsx +9 -56
- package/packages/web/src/api.ts +5 -61
- package/packages/web/src/components/ChatWindow.tsx +9 -9
- package/packages/web/src/components/CronDetail.tsx +1 -1
- package/packages/web/src/components/ImageLightbox.tsx +96 -0
- package/packages/web/src/components/LoginPage.tsx +59 -1
- package/packages/web/src/components/MessageContent.tsx +17 -2
- package/packages/web/src/components/SessionTabs.tsx +1 -1
- package/packages/web/src/components/Sidebar.tsx +1 -3
- package/packages/web/src/hooks/useIMEComposition.ts +14 -9
- package/packages/web/src/store.ts +7 -39
- package/packages/web/src/ws.ts +0 -1
- package/scripts/dev.sh +0 -53
- package/migrations/0013_agents_table.sql +0 -29
- package/migrations/0014_agent_sessions.sql +0 -19
- package/migrations/0015_message_traces.sql +0 -27
- package/migrations/0016_multi_agent_channels_messages.sql +0 -9
- package/migrations/0017_rename_cron_job_id.sql +0 -2
- package/packages/api/src/protocol-v2.ts +0 -154
- package/packages/api/src/routes/agents-v2.ts +0 -192
- package/packages/api/src/routes/history-v2.ts +0 -221
- package/packages/api/src/routes/migrate-v2.ts +0 -110
- package/packages/web/dist/assets/index-BARPtt0v.css +0 -1
- package/packages/web/dist/assets/index-Bf-XL3te.js +0 -2
- package/packages/web/dist/assets/index-CYlvfpX9.js +0 -1519
- package/packages/web/dist/assets/index-CxcpA4Qo.js +0 -1
- package/packages/web/dist/assets/index-QebPVqwj.js +0 -2
- package/packages/web/src/components/AgentSettings.tsx +0 -328
- package/scripts/mock-openclaw-v2.mjs +0 -486
|
@@ -1,1519 +0,0 @@
|
|
|
1
|
-
var Pw=Object.defineProperty;var Ky=e=>{throw TypeError(e)};var Hw=(e,t,r)=>t in e?Pw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var gs=(e,t,r)=>Hw(e,typeof t!="symbol"?t+"":t,r),Vy=(e,t,r)=>t.has(e)||Ky("Cannot "+r);var Ho=(e,t,r)=>(Vy(e,t,"read from private field"),r?r.call(e):t.get(e)),qy=(e,t,r)=>t.has(e)?Ky("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Yy=(e,t,r,a)=>(Vy(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 o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const c of o)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(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a(o){if(o.ep)return;o.ep=!0;const c=r(o);fetch(o.href,c)}})();const Fw="modulepreload",$w=function(e){return"/"+e},Wy={},ur=function(t,r,a){let o=Promise.resolve();if(r&&r.length>0){let u=function(m){return Promise.all(m.map(b=>Promise.resolve(b).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),h=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));o=u(r.map(m=>{if(m=$w(m),m in Wy)return;Wy[m]=!0;const b=m.endsWith(".css"),y=b?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${y}`))return;const v=document.createElement("link");if(v.rel=b?"stylesheet":Fw,b||(v.as="script"),v.crossOrigin="",v.href=m,h&&v.setAttribute("nonce",h),document.head.appendChild(v),b)return new Promise((x,S)=>{v.addEventListener("load",x),v.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${m}`)))})}))}function c(u){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=u,window.dispatchEvent(f),!f.defaultPrevented)throw u}return o.then(u=>{for(const f of u||[])f.status==="rejected"&&c(f.reason);return t().catch(c)})};function El(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xf={exports:{}},Fo={};/**
|
|
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 Xy;function Gw(){if(Xy)return Fo;Xy=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(a,o,c){var u=null;if(c!==void 0&&(u=""+c),o.key!==void 0&&(u=""+o.key),"key"in o){c={};for(var f in o)f!=="key"&&(c[f]=o[f])}else c=o;return o=c.ref,{$$typeof:e,type:a,key:u,ref:o!==void 0?o:null,props:c}}return Fo.Fragment=t,Fo.jsx=r,Fo.jsxs=r,Fo}var Zy;function Kw(){return Zy||(Zy=1,Xf.exports=Gw()),Xf.exports}var d=Kw(),Zf={exports:{}},$e={};/**
|
|
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 Jy;function Vw(){if(Jy)return $e;Jy=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),v=Symbol.iterator;function x(j){return j===null||typeof j!="object"?null:(j=v&&j[v]||j["@@iterator"],typeof j=="function"?j:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,N={};function T(j,Q,A){this.props=j,this.context=Q,this.refs=N,this.updater=A||S}T.prototype.isReactComponent={},T.prototype.setState=function(j,Q){if(typeof j!="object"&&typeof j!="function"&&j!=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,j,Q,"setState")},T.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function O(){}O.prototype=T.prototype;function R(j,Q,A){this.props=j,this.context=Q,this.refs=N,this.updater=A||S}var M=R.prototype=new O;M.constructor=R,_(M,T.prototype),M.isPureReactComponent=!0;var L=Array.isArray;function w(){}var D={H:null,A:null,T:null,S:null},F=Object.prototype.hasOwnProperty;function J(j,Q,A){var be=A.ref;return{$$typeof:e,type:j,key:Q,ref:be!==void 0?be:null,props:A}}function P(j,Q){return J(j.type,Q,j.props)}function $(j){return typeof j=="object"&&j!==null&&j.$$typeof===e}function Y(j){var Q={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(A){return Q[A]})}var te=/\/+/g;function se(j,Q){return typeof j=="object"&&j!==null&&j.key!=null?Y(""+j.key):Q.toString(36)}function V(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(w,w):(j.status="pending",j.then(function(Q){j.status==="pending"&&(j.status="fulfilled",j.value=Q)},function(Q){j.status==="pending"&&(j.status="rejected",j.reason=Q)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function z(j,Q,A,be,Ne){var we=typeof j;(we==="undefined"||we==="boolean")&&(j=null);var Fe=!1;if(j===null)Fe=!0;else switch(we){case"bigint":case"string":case"number":Fe=!0;break;case"object":switch(j.$$typeof){case e:case t:Fe=!0;break;case b:return Fe=j._init,z(Fe(j._payload),Q,A,be,Ne)}}if(Fe)return Ne=Ne(j),Fe=be===""?"."+se(j,0):be,L(Ne)?(A="",Fe!=null&&(A=Fe.replace(te,"$&/")+"/"),z(Ne,Q,A,"",function(ve){return ve})):Ne!=null&&($(Ne)&&(Ne=P(Ne,A+(Ne.key==null||j&&j.key===Ne.key?"":(""+Ne.key).replace(te,"$&/")+"/")+Fe)),Q.push(Ne)),1;Fe=0;var G=be===""?".":be+":";if(L(j))for(var ie=0;ie<j.length;ie++)be=j[ie],we=G+se(be,ie),Fe+=z(be,Q,A,we,Ne);else if(ie=x(j),typeof ie=="function")for(j=ie.call(j),ie=0;!(be=j.next()).done;)be=be.value,we=G+se(be,ie++),Fe+=z(be,Q,A,we,Ne);else if(we==="object"){if(typeof j.then=="function")return z(V(j),Q,A,be,Ne);throw Q=String(j),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.")}return Fe}function re(j,Q,A){if(j==null)return j;var be=[],Ne=0;return z(j,be,"","",function(we){return Q.call(A,we,Ne++)}),be}function oe(j){if(j._status===-1){var Q=j._result;Q=Q(),Q.then(function(A){(j._status===0||j._status===-1)&&(j._status=1,j._result=A)},function(A){(j._status===0||j._status===-1)&&(j._status=2,j._result=A)}),j._status===-1&&(j._status=0,j._result=Q)}if(j._status===1)return j._result.default;throw j._result}var ye=typeof reportError=="function"?reportError:function(j){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof j=="object"&&j!==null&&typeof j.message=="string"?String(j.message):String(j),error:j});if(!window.dispatchEvent(Q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",j);return}console.error(j)},I={map:re,forEach:function(j,Q,A){re(j,function(){Q.apply(this,arguments)},A)},count:function(j){var Q=0;return re(j,function(){Q++}),Q},toArray:function(j){return re(j,function(Q){return Q})||[]},only:function(j){if(!$(j))throw Error("React.Children.only expected to receive a single React element child.");return j}};return $e.Activity=y,$e.Children=I,$e.Component=T,$e.Fragment=r,$e.Profiler=o,$e.PureComponent=R,$e.StrictMode=a,$e.Suspense=h,$e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,$e.__COMPILER_RUNTIME={__proto__:null,c:function(j){return D.H.useMemoCache(j)}},$e.cache=function(j){return function(){return j.apply(null,arguments)}},$e.cacheSignal=function(){return null},$e.cloneElement=function(j,Q,A){if(j==null)throw Error("The argument must be a React element, but you passed "+j+".");var be=_({},j.props),Ne=j.key;if(Q!=null)for(we in Q.key!==void 0&&(Ne=""+Q.key),Q)!F.call(Q,we)||we==="key"||we==="__self"||we==="__source"||we==="ref"&&Q.ref===void 0||(be[we]=Q[we]);var we=arguments.length-2;if(we===1)be.children=A;else if(1<we){for(var Fe=Array(we),G=0;G<we;G++)Fe[G]=arguments[G+2];be.children=Fe}return J(j.type,Ne,be)},$e.createContext=function(j){return j={$$typeof:u,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null},j.Provider=j,j.Consumer={$$typeof:c,_context:j},j},$e.createElement=function(j,Q,A){var be,Ne={},we=null;if(Q!=null)for(be in Q.key!==void 0&&(we=""+Q.key),Q)F.call(Q,be)&&be!=="key"&&be!=="__self"&&be!=="__source"&&(Ne[be]=Q[be]);var Fe=arguments.length-2;if(Fe===1)Ne.children=A;else if(1<Fe){for(var G=Array(Fe),ie=0;ie<Fe;ie++)G[ie]=arguments[ie+2];Ne.children=G}if(j&&j.defaultProps)for(be in Fe=j.defaultProps,Fe)Ne[be]===void 0&&(Ne[be]=Fe[be]);return J(j,we,Ne)},$e.createRef=function(){return{current:null}},$e.forwardRef=function(j){return{$$typeof:f,render:j}},$e.isValidElement=$,$e.lazy=function(j){return{$$typeof:b,_payload:{_status:-1,_result:j},_init:oe}},$e.memo=function(j,Q){return{$$typeof:m,type:j,compare:Q===void 0?null:Q}},$e.startTransition=function(j){var Q=D.T,A={};D.T=A;try{var be=j(),Ne=D.S;Ne!==null&&Ne(A,be),typeof be=="object"&&be!==null&&typeof be.then=="function"&&be.then(w,ye)}catch(we){ye(we)}finally{Q!==null&&A.types!==null&&(Q.types=A.types),D.T=Q}},$e.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},$e.use=function(j){return D.H.use(j)},$e.useActionState=function(j,Q,A){return D.H.useActionState(j,Q,A)},$e.useCallback=function(j,Q){return D.H.useCallback(j,Q)},$e.useContext=function(j){return D.H.useContext(j)},$e.useDebugValue=function(){},$e.useDeferredValue=function(j,Q){return D.H.useDeferredValue(j,Q)},$e.useEffect=function(j,Q){return D.H.useEffect(j,Q)},$e.useEffectEvent=function(j){return D.H.useEffectEvent(j)},$e.useId=function(){return D.H.useId()},$e.useImperativeHandle=function(j,Q,A){return D.H.useImperativeHandle(j,Q,A)},$e.useInsertionEffect=function(j,Q){return D.H.useInsertionEffect(j,Q)},$e.useLayoutEffect=function(j,Q){return D.H.useLayoutEffect(j,Q)},$e.useMemo=function(j,Q){return D.H.useMemo(j,Q)},$e.useOptimistic=function(j,Q){return D.H.useOptimistic(j,Q)},$e.useReducer=function(j,Q,A){return D.H.useReducer(j,Q,A)},$e.useRef=function(j){return D.H.useRef(j)},$e.useState=function(j){return D.H.useState(j)},$e.useSyncExternalStore=function(j,Q,A){return D.H.useSyncExternalStore(j,Q,A)},$e.useTransition=function(){return D.H.useTransition()},$e.version="19.2.4",$e}var Qy;function Ep(){return Qy||(Qy=1,Zf.exports=Vw()),Zf.exports}var C=Ep();const _a=El(C);var Jf={exports:{}},$o={},Qf={exports:{}},eh={};/**
|
|
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 ev;function qw(){return ev||(ev=1,(function(e){function t(z,re){var oe=z.length;z.push(re);e:for(;0<oe;){var ye=oe-1>>>1,I=z[ye];if(0<o(I,re))z[ye]=re,z[oe]=I,oe=ye;else break e}}function r(z){return z.length===0?null:z[0]}function a(z){if(z.length===0)return null;var re=z[0],oe=z.pop();if(oe!==re){z[0]=oe;e:for(var ye=0,I=z.length,j=I>>>1;ye<j;){var Q=2*(ye+1)-1,A=z[Q],be=Q+1,Ne=z[be];if(0>o(A,oe))be<I&&0>o(Ne,A)?(z[ye]=Ne,z[be]=oe,ye=be):(z[ye]=A,z[Q]=oe,ye=Q);else if(be<I&&0>o(Ne,oe))z[ye]=Ne,z[be]=oe,ye=be;else break e}}return re}function o(z,re){var oe=z.sortIndex-re.sortIndex;return oe!==0?oe:z.id-re.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,f=u.now();e.unstable_now=function(){return u.now()-f}}var h=[],m=[],b=1,y=null,v=3,x=!1,S=!1,_=!1,N=!1,T=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function M(z){for(var re=r(m);re!==null;){if(re.callback===null)a(m);else if(re.startTime<=z)a(m),re.sortIndex=re.expirationTime,t(h,re);else break;re=r(m)}}function L(z){if(_=!1,M(z),!S)if(r(h)!==null)S=!0,w||(w=!0,Y());else{var re=r(m);re!==null&&V(L,re.startTime-z)}}var w=!1,D=-1,F=5,J=-1;function P(){return N?!0:!(e.unstable_now()-J<F)}function $(){if(N=!1,w){var z=e.unstable_now();J=z;var re=!0;try{e:{S=!1,_&&(_=!1,O(D),D=-1),x=!0;var oe=v;try{t:{for(M(z),y=r(h);y!==null&&!(y.expirationTime>z&&P());){var ye=y.callback;if(typeof ye=="function"){y.callback=null,v=y.priorityLevel;var I=ye(y.expirationTime<=z);if(z=e.unstable_now(),typeof I=="function"){y.callback=I,M(z),re=!0;break t}y===r(h)&&a(h),M(z)}else a(h);y=r(h)}if(y!==null)re=!0;else{var j=r(m);j!==null&&V(L,j.startTime-z),re=!1}}break e}finally{y=null,v=oe,x=!1}re=void 0}}finally{re?Y():w=!1}}}var Y;if(typeof R=="function")Y=function(){R($)};else if(typeof MessageChannel<"u"){var te=new MessageChannel,se=te.port2;te.port1.onmessage=$,Y=function(){se.postMessage(null)}}else Y=function(){T($,0)};function V(z,re){D=T(function(){z(e.unstable_now())},re)}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"):F=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 re=3;break;default:re=v}var oe=v;v=re;try{return z()}finally{v=oe}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(z,re){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var oe=v;v=z;try{return re()}finally{v=oe}},e.unstable_scheduleCallback=function(z,re,oe){var ye=e.unstable_now();switch(typeof oe=="object"&&oe!==null?(oe=oe.delay,oe=typeof oe=="number"&&0<oe?ye+oe:ye):oe=ye,z){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=oe+I,z={id:b++,callback:re,priorityLevel:z,startTime:oe,expirationTime:I,sortIndex:-1},oe>ye?(z.sortIndex=oe,t(m,z),r(h)===null&&z===r(m)&&(_?(O(D),D=-1):_=!0,V(L,oe-ye))):(z.sortIndex=I,t(h,z),S||x||(S=!0,w||(w=!0,Y()))),z},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(z){var re=v;return function(){var oe=v;v=re;try{return z.apply(this,arguments)}finally{v=oe}}}})(eh)),eh}var tv;function Yw(){return tv||(tv=1,Qf.exports=qw()),Qf.exports}var th={exports:{}},pn={};/**
|
|
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 nv;function Ww(){if(nv)return pn;nv=1;var e=Ep();function t(h){var m="https://react.dev/errors/"+h;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)m+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+h+"; visit "+m+" 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},o=Symbol.for("react.portal");function c(h,m,b){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:y==null?null:""+y,children:h,containerInfo:m,implementation:b}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,m){if(h==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return pn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,pn.createPortal=function(h,m){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return c(h,m,null,b)},pn.flushSync=function(h){var m=u.T,b=a.p;try{if(u.T=null,a.p=2,h)return h()}finally{u.T=m,a.p=b,a.d.f()}},pn.preconnect=function(h,m){typeof h=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,a.d.C(h,m))},pn.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},pn.preinit=function(h,m){if(typeof h=="string"&&m&&typeof m.as=="string"){var b=m.as,y=f(b,m.crossOrigin),v=typeof m.integrity=="string"?m.integrity:void 0,x=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;b==="style"?a.d.S(h,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:y,integrity:v,fetchPriority:x}):b==="script"&&a.d.X(h,{crossOrigin:y,integrity:v,fetchPriority:x,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},pn.preinitModule=function(h,m){if(typeof h=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var b=f(m.as,m.crossOrigin);a.d.M(h,{crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&a.d.M(h)},pn.preload=function(h,m){if(typeof h=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var b=m.as,y=f(b,m.crossOrigin);a.d.L(h,b,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},pn.preloadModule=function(h,m){if(typeof h=="string")if(m){var b=f(m.as,m.crossOrigin);a.d.m(h,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else a.d.m(h)},pn.requestFormReset=function(h){a.d.r(h)},pn.unstable_batchedUpdates=function(h,m){return h(m)},pn.useFormState=function(h,m,b){return u.H.useFormState(h,m,b)},pn.useFormStatus=function(){return u.H.useHostTransitionStatus()},pn.version="19.2.4",pn}var rv;function Xw(){if(rv)return th.exports;rv=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(),th.exports=Ww(),th.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 iv;function Zw(){if(iv)return $o;iv=1;var e=Yw(),t=Ep(),r=Xw();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 o(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 f(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 m(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,l=i;;){var p=s.return;if(p===null)break;var g=p.alternate;if(g===null){if(l=p.return,l!==null){s=l;continue}break}if(p.child===g.child){for(g=p.child;g;){if(g===s)return h(p),n;if(g===l)return h(p),i;g=g.sibling}throw Error(a(188))}if(s.return!==l.return)s=p,l=g;else{for(var E=!1,k=p.child;k;){if(k===s){E=!0,s=p,l=g;break}if(k===l){E=!0,l=p,s=g;break}k=k.sibling}if(!E){for(k=g.child;k;){if(k===s){E=!0,s=g,l=p;break}if(k===l){E=!0,l=g,s=p;break}k=k.sibling}if(!E)throw Error(a(189))}}if(s.alternate!==l)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"),S=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),R=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),J=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),$=Symbol.iterator;function Y(n){return n===null||typeof n!="object"?null:(n=$&&n[$]||n["@@iterator"],typeof n=="function"?n:null)}var te=Symbol.for("react.client.reference");function se(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===te?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case _:return"Fragment";case T:return"Profiler";case N:return"StrictMode";case L:return"Suspense";case w:return"SuspenseList";case J:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case S:return"Portal";case R:return n.displayName||"Context";case O:return(n._context.displayName||"Context")+".Consumer";case M:var i=n.render;return n=n.displayName,n||(n=i.displayName||i.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case D:return i=n.displayName||null,i!==null?i:se(n.type)||"Memo";case F:i=n._payload,n=n._init;try{return se(n(i))}catch{}}return null}var V=Array.isArray,z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},ye=[],I=-1;function j(n){return{current:n}}function Q(n){0>I||(n.current=ye[I],ye[I]=null,I--)}function A(n,i){I++,ye[I]=n.current,n.current=i}var be=j(null),Ne=j(null),we=j(null),Fe=j(null);function G(n,i){switch(A(we,i),A(Ne,n),A(be,null),i.nodeType){case 9:case 11:n=(n=i.documentElement)&&(n=n.namespaceURI)?py(n):0;break;default:if(n=i.tagName,i=i.namespaceURI)i=py(i),n=my(i,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}Q(be),A(be,n)}function ie(){Q(be),Q(Ne),Q(we)}function ve(n){n.memoizedState!==null&&A(Fe,n);var i=be.current,s=my(i,n.type);i!==s&&(A(Ne,n),A(be,s))}function Ke(n){Ne.current===n&&(Q(be),Q(Ne)),Fe.current===n&&(Q(Fe),zo._currentValue=oe)}var pe,Ze;function ct(n){if(pe===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);pe=i&&i[1]||"",Ze=-1<s.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+pe+n+Ze}var Ye=!1;function Pe(n,i){if(!n||Ye)return"";Ye=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(i){var fe=function(){throw Error()};if(Object.defineProperty(fe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(fe,[])}catch(ne){var ee=ne}Reflect.construct(n,[],fe)}else{try{fe.call()}catch(ne){ee=ne}n.call(fe.prototype)}}else{try{throw Error()}catch(ne){ee=ne}(fe=n())&&typeof fe.catch=="function"&&fe.catch(function(){})}}catch(ne){if(ne&&ee&&typeof ne.stack=="string")return[ne.stack,ee.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=l.DetermineComponentFrameRoot(),E=g[0],k=g[1];if(E&&k){var B=E.split(`
|
|
44
|
-
`),X=k.split(`
|
|
45
|
-
`);for(p=l=0;l<B.length&&!B[l].includes("DetermineComponentFrameRoot");)l++;for(;p<X.length&&!X[p].includes("DetermineComponentFrameRoot");)p++;if(l===B.length||p===X.length)for(l=B.length-1,p=X.length-1;1<=l&&0<=p&&B[l]!==X[p];)p--;for(;1<=l&&0<=p;l--,p--)if(B[l]!==X[p]){if(l!==1||p!==1)do if(l--,p--,0>p||B[l]!==X[p]){var ae=`
|
|
46
|
-
`+B[l].replace(" at new "," at ");return n.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",n.displayName)),ae}while(1<=l&&0<=p);break}}}finally{Ye=!1,Error.prepareStackTrace=s}return(s=n?n.displayName||n.name:"")?ct(s):""}function Me(n,i){switch(n.tag){case 26:case 27:case 5:return ct(n.type);case 16:return ct("Lazy");case 13:return n.child!==i&&i!==null?ct("Suspense Fallback"):ct("Suspense");case 19:return ct("SuspenseList");case 0:case 15:return Pe(n.type,!1);case 11:return Pe(n.type.render,!1);case 1:return Pe(n.type,!0);case 31:return ct("Activity");default:return""}}function pt(n){try{var i="",s=null;do i+=Me(n,s),s=n,n=n.return;while(n);return i}catch(l){return`
|
|
47
|
-
Error generating stack: `+l.message+`
|
|
48
|
-
`+l.stack}}var ft=Object.prototype.hasOwnProperty,Et=e.unstable_scheduleCallback,yr=e.unstable_cancelCallback,di=e.unstable_shouldYield,le=e.unstable_requestPaint,he=e.unstable_now,Ie=e.unstable_getCurrentPriorityLevel,q=e.unstable_ImmediatePriority,de=e.unstable_UserBlockingPriority,Se=e.unstable_NormalPriority,ze=e.unstable_LowPriority,rt=e.unstable_IdlePriority,Tt=e.log,Tn=e.unstable_setDisableYieldValue,en=null,Ut=null;function dn(n){if(typeof Tt=="function"&&Tn(n),Ut&&typeof Ut.setStrictMode=="function")try{Ut.setStrictMode(en,n)}catch{}}var mt=Math.clz32?Math.clz32:Rl,vr=Math.log,bn=Math.LN2;function Rl(n){return n>>>=0,n===0?32:31-(vr(n)/bn|0)|0}var Xi=256,Ia=262144,Zi=4194304;function Nn(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 U(n,i,s){var l=n.pendingLanes;if(l===0)return 0;var p=0,g=n.suspendedLanes,E=n.pingedLanes;n=n.warmLanes;var k=l&134217727;return k!==0?(l=k&~g,l!==0?p=Nn(l):(E&=k,E!==0?p=Nn(E):s||(s=k&~n,s!==0&&(p=Nn(s))))):(k=l&~g,k!==0?p=Nn(k):E!==0?p=Nn(E):s||(s=l&~n,s!==0&&(p=Nn(s)))),p===0?0:i!==0&&i!==p&&(i&g)===0&&(g=p&-p,s=i&-i,g>=s||g===32&&(s&4194048)!==0)?i:p}function ce(n,i){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&i)===0}function Ee(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 He(){var n=Zi;return Zi<<=1,(Zi&62914560)===0&&(Zi=4194304),n}function It(n){for(var i=[],s=0;31>s;s++)i.push(n);return i}function Nt(n,i){n.pendingLanes|=i,i!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function Te(n,i,s,l,p,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,B=n.expirationTimes,X=n.hiddenUpdates;for(s=E&~s;0<s;){var ae=31-mt(s),fe=1<<ae;k[ae]=0,B[ae]=-1;var ee=X[ae];if(ee!==null)for(X[ae]=null,ae=0;ae<ee.length;ae++){var ne=ee[ae];ne!==null&&(ne.lane&=-536870913)}s&=~fe}l!==0&&_e(n,l,0),g!==0&&p===0&&n.tag!==0&&(n.suspendedLanes|=g&~(E&~i))}function _e(n,i,s){n.pendingLanes|=i,n.suspendedLanes&=~i;var l=31-mt(i);n.entangledLanes|=i,n.entanglements[l]=n.entanglements[l]|1073741824|s&261930}function Be(n,i){var s=n.entangledLanes|=i;for(n=n.entanglements;s;){var l=31-mt(s),p=1<<l;p&i|n[l]&i&&(n[l]|=i),s&=~p}}function Ft(n,i){var s=i&-i;return s=(s&42)!==0?1:jt(s),(s&(n.suspendedLanes|i))!==0?0:s}function jt(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 Lr(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function La(){var n=re.p;return n!==0?n:(n=window.event,n===void 0?32:By(n.type))}function Da(n,i){var s=re.p;try{return re.p=n,i()}finally{re.p=s}}var xr=Math.random().toString(36).slice(2),$t="__reactFiber$"+xr,fn="__reactProps$"+xr,fi="__reactContainer$"+xr,qs="__reactEvents$"+xr,Il="__reactListeners$"+xr,ja="__reactHandles$"+xr,Ll="__reactResources$"+xr,Ji="__reactMarker$"+xr;function Ys(n){delete n[$t],delete n[fn],delete n[qs],delete n[Il],delete n[ja]}function yn(n){var i=n[$t];if(i)return i;for(var s=n.parentNode;s;){if(i=s[fi]||s[$t]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(n=Sy(n);n!==null;){if(s=n[$t])return s;n=Sy(n)}return i}n=s,s=n.parentNode}return null}function Dr(n){if(n=n[$t]||n[fi]){var i=n.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return n}return null}function hi(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n.stateNode;throw Error(a(33))}function pi(n){var i=n[Ll];return i||(i=n[Ll]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function qt(n){n[Ji]=!0}var Dl=new Set,Qi={};function jr(n,i){me(n,i),me(n+"Capture",i)}function me(n,i){for(Qi[n]=i,n=0;n<i.length;n++)Dl.add(i[n])}var Oe=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]*$"),Je={},gt={};function Gt(n){return ft.call(gt,n)?!0:ft.call(Je,n)?!1:Oe.test(n)?gt[n]=!0:(Je[n]=!0,!1)}function hn(n,i,s){if(Gt(i))if(s===null)n.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":n.removeAttribute(i);return;case"boolean":var l=i.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){n.removeAttribute(i);return}}n.setAttribute(i,""+s)}}function Un(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 Cn(n,i,s,l){if(l===null)n.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(s);return}n.setAttributeNS(i,s,""+l)}}function Mt(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Pn(n){var i=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function jl(n,i,s){var l=Object.getOwnPropertyDescriptor(n.constructor.prototype,i);if(!n.hasOwnProperty(i)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var p=l.get,g=l.set;return Object.defineProperty(n,i,{configurable:!0,get:function(){return p.call(this)},set:function(E){s=""+E,g.call(this,E)}}),Object.defineProperty(n,i,{enumerable:l.enumerable}),{getValue:function(){return s},setValue:function(E){s=""+E},stopTracking:function(){n._valueTracker=null,delete n[i]}}}}function za(n){if(!n._valueTracker){var i=Pn(n)?"checked":"value";n._valueTracker=jl(n,i,""+n[i])}}function Ws(n){if(!n)return!1;var i=n._valueTracker;if(!i)return!0;var s=i.getValue(),l="";return n&&(l=Pn(n)?n.checked?"true":"false":n.value),n=l,n!==s?(i.setValue(n),!0):!1}function Ba(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 Yu=/[\n"\\]/g;function An(n){return n.replace(Yu,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Xs(n,i,s,l,p,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=""+Mt(i)):n.value!==""+Mt(i)&&(n.value=""+Mt(i)):E!=="submit"&&E!=="reset"||n.removeAttribute("value"),i!=null?Ua(n,E,Mt(i)):s!=null?Ua(n,E,Mt(s)):l!=null&&n.removeAttribute("value"),p==null&&g!=null&&(n.defaultChecked=!!g),p!=null&&(n.checked=p&&typeof p!="function"&&typeof p!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?n.name=""+Mt(k):n.removeAttribute("name")}function ea(n,i,s,l,p,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)){za(n);return}s=s!=null?""+Mt(s):"",i=i!=null?""+Mt(i):s,k||i===n.value||(n.value=i),n.defaultValue=i}l=l??p,l=typeof l!="function"&&typeof l!="symbol"&&!!l,n.checked=k?n.checked:!!l,n.defaultChecked=!!l,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(n.name=E),za(n)}function Ua(n,i,s){i==="number"&&Ba(n.ownerDocument)===n||n.defaultValue===""+s||(n.defaultValue=""+s)}function rn(n,i,s,l){if(n=n.options,i){i={};for(var p=0;p<s.length;p++)i["$"+s[p]]=!0;for(s=0;s<n.length;s++)p=i.hasOwnProperty("$"+n[s].value),n[s].selected!==p&&(n[s].selected=p),p&&l&&(n[s].defaultSelected=!0)}else{for(s=""+Mt(s),i=null,p=0;p<n.length;p++){if(n[p].value===s){n[p].selected=!0,l&&(n[p].defaultSelected=!0);return}i!==null||n[p].disabled||(i=n[p])}i!==null&&(i.selected=!0)}}function zl(n,i,s){if(i!=null&&(i=""+Mt(i),i!==n.value&&(n.value=i),s==null)){n.defaultValue!==i&&(n.defaultValue=i);return}n.defaultValue=s!=null?""+Mt(s):""}function Pa(n,i,s,l){if(i==null){if(l!=null){if(s!=null)throw Error(a(92));if(V(l)){if(1<l.length)throw Error(a(93));l=l[0]}s=l}s==null&&(s=""),i=s}s=Mt(i),n.defaultValue=s,l=n.textContent,l===s&&l!==""&&l!==null&&(n.value=l),za(n)}function je(n,i){if(i){var s=n.firstChild;if(s&&s===n.lastChild&&s.nodeType===3){s.nodeValue=i;return}}n.textContent=i}var Bl=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 Yt(n,i,s){var l=i.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?l?n.setProperty(i,""):i==="float"?n.cssFloat="":n[i]="":l?n.setProperty(i,s):typeof s!="number"||s===0||Bl.has(i)?i==="float"?n.cssFloat=s:n[i]=(""+s).trim():n[i]=s+"px"}function bt(n,i,s){if(i!=null&&typeof i!="object")throw Error(a(62));if(n=n.style,s!=null){for(var l in s)!s.hasOwnProperty(l)||i!=null&&i.hasOwnProperty(l)||(l.indexOf("--")===0?n.setProperty(l,""):l==="float"?n.cssFloat="":n[l]="");for(var p in i)l=i[p],i.hasOwnProperty(p)&&s[p]!==l&&Yt(n,p,l)}else for(var g in i)i.hasOwnProperty(g)&&Yt(n,g,i[g])}function mi(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 zr=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"]]),Zs=/^[\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 gi(n){return Zs.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function xe(){}var Ce=null;function Ve(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var it=null,Bt=null;function Jn(n){var i=Dr(n);if(i&&(n=i.stateNode)){var s=n[fn]||null;e:switch(n=i.stateNode,i.type){case"input":if(Xs(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="'+An(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var l=s[i];if(l!==n&&l.form===n.form){var p=l[fn]||null;if(!p)throw Error(a(90));Xs(l,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(i=0;i<s.length;i++)l=s[i],l.form===n.form&&Ws(l)}break e;case"textarea":zl(n,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&rn(n,!!s.multiple,i,!1)}}}var Js=!1;function Ul(n,i,s){if(Js)return n(i,s);Js=!0;try{var l=n(i);return l}finally{if(Js=!1,(it!==null||Bt!==null)&&(Tc(),it&&(i=it,n=Bt,Bt=it=null,Jn(i),n)))for(i=0;i<n.length;i++)Jn(n[i])}}function Qs(n,i){var s=n.stateNode;if(s===null)return null;var l=s[fn]||null;if(l===null)return null;s=l[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":(l=!l.disabled)||(n=n.type,l=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!l;break e;default:n=!1}if(n)return null;if(s&&typeof s!="function")throw Error(a(231,i,typeof s));return s}var Br=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wu=!1;if(Br)try{var eo={};Object.defineProperty(eo,"passive",{get:function(){Wu=!0}}),window.addEventListener("test",eo,eo),window.removeEventListener("test",eo,eo)}catch{Wu=!1}var bi=null,Xu=null,Pl=null;function mm(){if(Pl)return Pl;var n,i=Xu,s=i.length,l,p="value"in bi?bi.value:bi.textContent,g=p.length;for(n=0;n<s&&i[n]===p[n];n++);var E=s-n;for(l=1;l<=E&&i[s-l]===p[g-l];l++);return Pl=p.slice(n,1<l?1-l:void 0)}function Hl(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 Fl(){return!0}function gm(){return!1}function On(n){function i(s,l,p,g,E){this._reactName=s,this._targetInst=p,this.type=l,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)?Fl:gm,this.isPropagationStopped=gm,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=Fl)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Fl)},persist:function(){},isPersistent:Fl}),i}var ta={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$l=On(ta),to=y({},ta,{view:0,detail:0}),BS=On(to),Zu,Ju,no,Gl=y({},to,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ed,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!==no&&(no&&n.type==="mousemove"?(Zu=n.screenX-no.screenX,Ju=n.screenY-no.screenY):Ju=Zu=0,no=n),Zu)},movementY:function(n){return"movementY"in n?n.movementY:Ju}}),bm=On(Gl),US=y({},Gl,{dataTransfer:0}),PS=On(US),HS=y({},to,{relatedTarget:0}),Qu=On(HS),FS=y({},ta,{animationName:0,elapsedTime:0,pseudoElement:0}),$S=On(FS),GS=y({},ta,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),KS=On(GS),VS=y({},ta,{data:0}),ym=On(VS),qS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},YS={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"},WS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function XS(n){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(n):(n=WS[n])?!!i[n]:!1}function ed(){return XS}var ZS=y({},to,{key:function(n){if(n.key){var i=qS[n.key]||n.key;if(i!=="Unidentified")return i}return n.type==="keypress"?(n=Hl(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?YS[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ed,charCode:function(n){return n.type==="keypress"?Hl(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Hl(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),JS=On(ZS),QS=y({},Gl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),vm=On(QS),e_=y({},to,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ed}),t_=On(e_),n_=y({},ta,{propertyName:0,elapsedTime:0,pseudoElement:0}),r_=On(n_),i_=y({},Gl,{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}),a_=On(i_),s_=y({},ta,{newState:0,oldState:0}),o_=On(s_),l_=[9,13,27,32],td=Br&&"CompositionEvent"in window,ro=null;Br&&"documentMode"in document&&(ro=document.documentMode);var c_=Br&&"TextEvent"in window&&!ro,xm=Br&&(!td||ro&&8<ro&&11>=ro),Em=" ",Sm=!1;function _m(n,i){switch(n){case"keyup":return l_.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wm(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Ha=!1;function u_(n,i){switch(n){case"compositionend":return wm(i);case"keypress":return i.which!==32?null:(Sm=!0,Em);case"textInput":return n=i.data,n===Em&&Sm?null:n;default:return null}}function d_(n,i){if(Ha)return n==="compositionend"||!td&&_m(n,i)?(n=mm(),Pl=Xu=bi=null,Ha=!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 xm&&i.locale!=="ko"?null:i.data;default:return null}}var f_={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 km(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i==="input"?!!f_[n.type]:i==="textarea"}function Tm(n,i,s,l){it?Bt?Bt.push(l):Bt=[l]:it=l,i=Ic(i,"onChange"),0<i.length&&(s=new $l("onChange","change",null,s,l),n.push({event:s,listeners:i}))}var io=null,ao=null;function h_(n){ly(n,0)}function Kl(n){var i=hi(n);if(Ws(i))return n}function Nm(n,i){if(n==="change")return i}var Cm=!1;if(Br){var nd;if(Br){var rd="oninput"in document;if(!rd){var Am=document.createElement("div");Am.setAttribute("oninput","return;"),rd=typeof Am.oninput=="function"}nd=rd}else nd=!1;Cm=nd&&(!document.documentMode||9<document.documentMode)}function Om(){io&&(io.detachEvent("onpropertychange",Mm),ao=io=null)}function Mm(n){if(n.propertyName==="value"&&Kl(ao)){var i=[];Tm(i,ao,n,Ve(n)),Ul(h_,i)}}function p_(n,i,s){n==="focusin"?(Om(),io=i,ao=s,io.attachEvent("onpropertychange",Mm)):n==="focusout"&&Om()}function m_(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Kl(ao)}function g_(n,i){if(n==="click")return Kl(i)}function b_(n,i){if(n==="input"||n==="change")return Kl(i)}function y_(n,i){return n===i&&(n!==0||1/n===1/i)||n!==n&&i!==i}var Hn=typeof Object.is=="function"?Object.is:y_;function so(n,i){if(Hn(n,i))return!0;if(typeof n!="object"||n===null||typeof i!="object"||i===null)return!1;var s=Object.keys(n),l=Object.keys(i);if(s.length!==l.length)return!1;for(l=0;l<s.length;l++){var p=s[l];if(!ft.call(i,p)||!Hn(n[p],i[p]))return!1}return!0}function Rm(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Im(n,i){var s=Rm(n);n=0;for(var l;s;){if(s.nodeType===3){if(l=n+s.textContent.length,n<=i&&l>=i)return{node:s,offset:i-n};n=l}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Rm(s)}}function Lm(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?Lm(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function Dm(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var i=Ba(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=Ba(n.document)}return i}function id(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 v_=Br&&"documentMode"in document&&11>=document.documentMode,Fa=null,ad=null,oo=null,sd=!1;function jm(n,i,s){var l=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;sd||Fa==null||Fa!==Ba(l)||(l=Fa,"selectionStart"in l&&id(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),oo&&so(oo,l)||(oo=l,l=Ic(ad,"onSelect"),0<l.length&&(i=new $l("onSelect","select",null,i,s),n.push({event:i,listeners:l}),i.target=Fa)))}function na(n,i){var s={};return s[n.toLowerCase()]=i.toLowerCase(),s["Webkit"+n]="webkit"+i,s["Moz"+n]="moz"+i,s}var $a={animationend:na("Animation","AnimationEnd"),animationiteration:na("Animation","AnimationIteration"),animationstart:na("Animation","AnimationStart"),transitionrun:na("Transition","TransitionRun"),transitionstart:na("Transition","TransitionStart"),transitioncancel:na("Transition","TransitionCancel"),transitionend:na("Transition","TransitionEnd")},od={},zm={};Br&&(zm=document.createElement("div").style,"AnimationEvent"in window||(delete $a.animationend.animation,delete $a.animationiteration.animation,delete $a.animationstart.animation),"TransitionEvent"in window||delete $a.transitionend.transition);function ra(n){if(od[n])return od[n];if(!$a[n])return n;var i=$a[n],s;for(s in i)if(i.hasOwnProperty(s)&&s in zm)return od[n]=i[s];return n}var Bm=ra("animationend"),Um=ra("animationiteration"),Pm=ra("animationstart"),x_=ra("transitionrun"),E_=ra("transitionstart"),S_=ra("transitioncancel"),Hm=ra("transitionend"),Fm=new Map,ld="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(" ");ld.push("scrollEnd");function dr(n,i){Fm.set(n,i),jr(i,[n])}var Vl=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)},Qn=[],Ga=0,cd=0;function ql(){for(var n=Ga,i=cd=Ga=0;i<n;){var s=Qn[i];Qn[i++]=null;var l=Qn[i];Qn[i++]=null;var p=Qn[i];Qn[i++]=null;var g=Qn[i];if(Qn[i++]=null,l!==null&&p!==null){var E=l.pending;E===null?p.next=p:(p.next=E.next,E.next=p),l.pending=p}g!==0&&$m(s,p,g)}}function Yl(n,i,s,l){Qn[Ga++]=n,Qn[Ga++]=i,Qn[Ga++]=s,Qn[Ga++]=l,cd|=l,n.lanes|=l,n=n.alternate,n!==null&&(n.lanes|=l)}function ud(n,i,s,l){return Yl(n,i,s,l),Wl(n)}function ia(n,i){return Yl(n,null,null,i),Wl(n)}function $m(n,i,s){n.lanes|=s;var l=n.alternate;l!==null&&(l.lanes|=s);for(var p=!1,g=n.return;g!==null;)g.childLanes|=s,l=g.alternate,l!==null&&(l.childLanes|=s),g.tag===22&&(n=g.stateNode,n===null||n._visibility&1||(p=!0)),n=g,g=g.return;return n.tag===3?(g=n.stateNode,p&&i!==null&&(p=31-mt(s),n=g.hiddenUpdates,l=n[p],l===null?n[p]=[i]:l.push(i),i.lane=s|536870912),g):null}function Wl(n){if(50<Oo)throw Oo=0,xf=null,Error(a(185));for(var i=n.return;i!==null;)n=i,i=n.return;return n.tag===3?n.stateNode:null}var Ka={};function __(n,i,s,l){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=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Fn(n,i,s,l){return new __(n,i,s,l)}function dd(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Ur(n,i){var s=n.alternate;return s===null?(s=Fn(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 Gm(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 Xl(n,i,s,l,p,g){var E=0;if(l=n,typeof n=="function")dd(n)&&(E=1);else if(typeof n=="string")E=Cw(n,s,be.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case J:return n=Fn(31,s,i,p),n.elementType=J,n.lanes=g,n;case _:return aa(s.children,p,g,i);case N:E=8,p|=24;break;case T:return n=Fn(12,s,i,p|2),n.elementType=T,n.lanes=g,n;case L:return n=Fn(13,s,i,p),n.elementType=L,n.lanes=g,n;case w:return n=Fn(19,s,i,p),n.elementType=w,n.lanes=g,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case R:E=10;break e;case O:E=9;break e;case M:E=11;break e;case D:E=14;break e;case F:E=16,l=null;break e}E=29,s=Error(a(130,n===null?"null":typeof n,"")),l=null}return i=Fn(E,s,i,p),i.elementType=n,i.type=l,i.lanes=g,i}function aa(n,i,s,l){return n=Fn(7,n,l,i),n.lanes=s,n}function fd(n,i,s){return n=Fn(6,n,null,i),n.lanes=s,n}function Km(n){var i=Fn(18,null,null,0);return i.stateNode=n,i}function hd(n,i,s){return i=Fn(4,n.children!==null?n.children:[],n.key,i),i.lanes=s,i.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},i}var Vm=new WeakMap;function er(n,i){if(typeof n=="object"&&n!==null){var s=Vm.get(n);return s!==void 0?s:(i={value:n,source:i,stack:pt(i)},Vm.set(n,i),i)}return{value:n,source:i,stack:pt(i)}}var Va=[],qa=0,Zl=null,lo=0,tr=[],nr=0,yi=null,Er=1,Sr="";function Pr(n,i){Va[qa++]=lo,Va[qa++]=Zl,Zl=n,lo=i}function qm(n,i,s){tr[nr++]=Er,tr[nr++]=Sr,tr[nr++]=yi,yi=n;var l=Er;n=Sr;var p=32-mt(l)-1;l&=~(1<<p),s+=1;var g=32-mt(i)+p;if(30<g){var E=p-p%5;g=(l&(1<<E)-1).toString(32),l>>=E,p-=E,Er=1<<32-mt(i)+p|s<<p|l,Sr=g+n}else Er=1<<g|s<<p|l,Sr=n}function pd(n){n.return!==null&&(Pr(n,1),qm(n,1,0))}function md(n){for(;n===Zl;)Zl=Va[--qa],Va[qa]=null,lo=Va[--qa],Va[qa]=null;for(;n===yi;)yi=tr[--nr],tr[nr]=null,Sr=tr[--nr],tr[nr]=null,Er=tr[--nr],tr[nr]=null}function Ym(n,i){tr[nr++]=Er,tr[nr++]=Sr,tr[nr++]=yi,Er=i.id,Sr=i.overflow,yi=n}var an=null,Lt=null,ot=!1,vi=null,rr=!1,gd=Error(a(519));function xi(n){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw co(er(i,n)),gd}function Wm(n){var i=n.stateNode,s=n.type,l=n.memoizedProps;switch(i[$t]=n,i[fn]=l,s){case"dialog":tt("cancel",i),tt("close",i);break;case"iframe":case"object":case"embed":tt("load",i);break;case"video":case"audio":for(s=0;s<Ro.length;s++)tt(Ro[s],i);break;case"source":tt("error",i);break;case"img":case"image":case"link":tt("error",i),tt("load",i);break;case"details":tt("toggle",i);break;case"input":tt("invalid",i),ea(i,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":tt("invalid",i);break;case"textarea":tt("invalid",i),Pa(i,l.value,l.defaultValue,l.children)}s=l.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||i.textContent===""+s||l.suppressHydrationWarning===!0||fy(i.textContent,s)?(l.popover!=null&&(tt("beforetoggle",i),tt("toggle",i)),l.onScroll!=null&&tt("scroll",i),l.onScrollEnd!=null&&tt("scrollend",i),l.onClick!=null&&(i.onclick=xe),i=!0):i=!1,i||xi(n,!0)}function Xm(n){for(an=n.return;an;)switch(an.tag){case 5:case 31:case 13:rr=!1;return;case 27:case 3:rr=!0;return;default:an=an.return}}function Ya(n){if(n!==an)return!1;if(!ot)return Xm(n),ot=!0,!1;var i=n.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=n.type,s=!(s!=="form"&&s!=="button")||Df(n.type,n.memoizedProps)),s=!s),s&&Lt&&xi(n),Xm(n),i===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));Lt=Ey(n)}else if(i===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));Lt=Ey(n)}else i===27?(i=Lt,Li(n.type)?(n=Pf,Pf=null,Lt=n):Lt=i):Lt=an?ar(n.stateNode.nextSibling):null;return!0}function sa(){Lt=an=null,ot=!1}function bd(){var n=vi;return n!==null&&(Ln===null?Ln=n:Ln.push.apply(Ln,n),vi=null),n}function co(n){vi===null?vi=[n]:vi.push(n)}var yd=j(null),oa=null,Hr=null;function Ei(n,i,s){A(yd,i._currentValue),i._currentValue=s}function Fr(n){n._currentValue=yd.current,Q(yd)}function vd(n,i,s){for(;n!==null;){var l=n.alternate;if((n.childLanes&i)!==i?(n.childLanes|=i,l!==null&&(l.childLanes|=i)):l!==null&&(l.childLanes&i)!==i&&(l.childLanes|=i),n===s)break;n=n.return}}function xd(n,i,s,l){var p=n.child;for(p!==null&&(p.return=n);p!==null;){var g=p.dependencies;if(g!==null){var E=p.child;g=g.firstContext;e:for(;g!==null;){var k=g;g=p;for(var B=0;B<i.length;B++)if(k.context===i[B]){g.lanes|=s,k=g.alternate,k!==null&&(k.lanes|=s),vd(g.return,s,n),l||(E=null);break e}g=k.next}}else if(p.tag===18){if(E=p.return,E===null)throw Error(a(341));E.lanes|=s,g=E.alternate,g!==null&&(g.lanes|=s),vd(E,s,n),E=null}else E=p.child;if(E!==null)E.return=p;else for(E=p;E!==null;){if(E===n){E=null;break}if(p=E.sibling,p!==null){p.return=E.return,E=p;break}E=E.return}p=E}}function Wa(n,i,s,l){n=null;for(var p=i,g=!1;p!==null;){if(!g){if((p.flags&524288)!==0)g=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var E=p.alternate;if(E===null)throw Error(a(387));if(E=E.memoizedProps,E!==null){var k=p.type;Hn(p.pendingProps.value,E.value)||(n!==null?n.push(k):n=[k])}}else if(p===Fe.current){if(E=p.alternate,E===null)throw Error(a(387));E.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(n!==null?n.push(zo):n=[zo])}p=p.return}n!==null&&xd(i,n,s,l),i.flags|=262144}function Jl(n){for(n=n.firstContext;n!==null;){if(!Hn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function la(n){oa=n,Hr=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function sn(n){return Zm(oa,n)}function Ql(n,i){return oa===null&&la(n),Zm(n,i)}function Zm(n,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},Hr===null){if(n===null)throw Error(a(308));Hr=i,n.dependencies={lanes:0,firstContext:i},n.flags|=524288}else Hr=Hr.next=i;return s}var w_=typeof AbortController<"u"?AbortController:function(){var n=[],i=this.signal={aborted:!1,addEventListener:function(s,l){n.push(l)}};this.abort=function(){i.aborted=!0,n.forEach(function(s){return s()})}},k_=e.unstable_scheduleCallback,T_=e.unstable_NormalPriority,Wt={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ed(){return{controller:new w_,data:new Map,refCount:0}}function uo(n){n.refCount--,n.refCount===0&&k_(T_,function(){n.controller.abort()})}var fo=null,Sd=0,Xa=0,Za=null;function N_(n,i){if(fo===null){var s=fo=[];Sd=0,Xa=Tf(),Za={status:"pending",value:void 0,then:function(l){s.push(l)}}}return Sd++,i.then(Jm,Jm),i}function Jm(){if(--Sd===0&&fo!==null){Za!==null&&(Za.status="fulfilled");var n=fo;fo=null,Xa=0,Za=null;for(var i=0;i<n.length;i++)(0,n[i])()}}function C_(n,i){var s=[],l={status:"pending",value:null,reason:null,then:function(p){s.push(p)}};return n.then(function(){l.status="fulfilled",l.value=i;for(var p=0;p<s.length;p++)(0,s[p])(i)},function(p){for(l.status="rejected",l.reason=p,p=0;p<s.length;p++)(0,s[p])(void 0)}),l}var Qm=z.S;z.S=function(n,i){jb=he(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&N_(n,i),Qm!==null&&Qm(n,i)};var ca=j(null);function _d(){var n=ca.current;return n!==null?n:Ct.pooledCache}function ec(n,i){i===null?A(ca,ca.current):A(ca,i.pool)}function eg(){var n=_d();return n===null?null:{parent:Wt._currentValue,pool:n}}var Ja=Error(a(460)),wd=Error(a(474)),tc=Error(a(542)),nc={then:function(){}};function tg(n){return n=n.status,n==="fulfilled"||n==="rejected"}function ng(n,i,s){switch(s=n[s],s===void 0?n.push(i):s!==i&&(i.then(xe,xe),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,ig(n),n;default:if(typeof i.status=="string")i.then(xe,xe);else{if(n=Ct,n!==null&&100<n.shellSuspendCounter)throw Error(a(482));n=i,n.status="pending",n.then(function(l){if(i.status==="pending"){var p=i;p.status="fulfilled",p.value=l}},function(l){if(i.status==="pending"){var p=i;p.status="rejected",p.reason=l}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,ig(n),n}throw da=i,Ja}}function ua(n){try{var i=n._init;return i(n._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(da=s,Ja):s}}var da=null;function rg(){if(da===null)throw Error(a(459));var n=da;return da=null,n}function ig(n){if(n===Ja||n===tc)throw Error(a(483))}var Qa=null,ho=0;function rc(n){var i=ho;return ho+=1,Qa===null&&(Qa=[]),ng(Qa,n,i)}function po(n,i){i=i.props.ref,n.ref=i!==void 0?i:null}function ic(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 ag(n){function i(K,H){if(n){var W=K.deletions;W===null?(K.deletions=[H],K.flags|=16):W.push(H)}}function s(K,H){if(!n)return null;for(;H!==null;)i(K,H),H=H.sibling;return null}function l(K){for(var H=new Map;K!==null;)K.key!==null?H.set(K.key,K):H.set(K.index,K),K=K.sibling;return H}function p(K,H){return K=Ur(K,H),K.index=0,K.sibling=null,K}function g(K,H,W){return K.index=W,n?(W=K.alternate,W!==null?(W=W.index,W<H?(K.flags|=67108866,H):W):(K.flags|=67108866,H)):(K.flags|=1048576,H)}function E(K){return n&&K.alternate===null&&(K.flags|=67108866),K}function k(K,H,W,ue){return H===null||H.tag!==6?(H=fd(W,K.mode,ue),H.return=K,H):(H=p(H,W),H.return=K,H)}function B(K,H,W,ue){var Re=W.type;return Re===_?ae(K,H,W.props.children,ue,W.key):H!==null&&(H.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===F&&ua(Re)===H.type)?(H=p(H,W.props),po(H,W),H.return=K,H):(H=Xl(W.type,W.key,W.props,null,K.mode,ue),po(H,W),H.return=K,H)}function X(K,H,W,ue){return H===null||H.tag!==4||H.stateNode.containerInfo!==W.containerInfo||H.stateNode.implementation!==W.implementation?(H=hd(W,K.mode,ue),H.return=K,H):(H=p(H,W.children||[]),H.return=K,H)}function ae(K,H,W,ue,Re){return H===null||H.tag!==7?(H=aa(W,K.mode,ue,Re),H.return=K,H):(H=p(H,W),H.return=K,H)}function fe(K,H,W){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=fd(""+H,K.mode,W),H.return=K,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case x:return W=Xl(H.type,H.key,H.props,null,K.mode,W),po(W,H),W.return=K,W;case S:return H=hd(H,K.mode,W),H.return=K,H;case F:return H=ua(H),fe(K,H,W)}if(V(H)||Y(H))return H=aa(H,K.mode,W,null),H.return=K,H;if(typeof H.then=="function")return fe(K,rc(H),W);if(H.$$typeof===R)return fe(K,Ql(K,H),W);ic(K,H)}return null}function ee(K,H,W,ue){var Re=H!==null?H.key:null;if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return Re!==null?null:k(K,H,""+W,ue);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case x:return W.key===Re?B(K,H,W,ue):null;case S:return W.key===Re?X(K,H,W,ue):null;case F:return W=ua(W),ee(K,H,W,ue)}if(V(W)||Y(W))return Re!==null?null:ae(K,H,W,ue,null);if(typeof W.then=="function")return ee(K,H,rc(W),ue);if(W.$$typeof===R)return ee(K,H,Ql(K,W),ue);ic(K,W)}return null}function ne(K,H,W,ue,Re){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return K=K.get(W)||null,k(H,K,""+ue,Re);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case x:return K=K.get(ue.key===null?W:ue.key)||null,B(H,K,ue,Re);case S:return K=K.get(ue.key===null?W:ue.key)||null,X(H,K,ue,Re);case F:return ue=ua(ue),ne(K,H,W,ue,Re)}if(V(ue)||Y(ue))return K=K.get(W)||null,ae(H,K,ue,Re,null);if(typeof ue.then=="function")return ne(K,H,W,rc(ue),Re);if(ue.$$typeof===R)return ne(K,H,W,Ql(H,ue),Re);ic(H,ue)}return null}function ke(K,H,W,ue){for(var Re=null,ut=null,Ae=H,We=H=0,st=null;Ae!==null&&We<W.length;We++){Ae.index>We?(st=Ae,Ae=null):st=Ae.sibling;var dt=ee(K,Ae,W[We],ue);if(dt===null){Ae===null&&(Ae=st);break}n&&Ae&&dt.alternate===null&&i(K,Ae),H=g(dt,H,We),ut===null?Re=dt:ut.sibling=dt,ut=dt,Ae=st}if(We===W.length)return s(K,Ae),ot&&Pr(K,We),Re;if(Ae===null){for(;We<W.length;We++)Ae=fe(K,W[We],ue),Ae!==null&&(H=g(Ae,H,We),ut===null?Re=Ae:ut.sibling=Ae,ut=Ae);return ot&&Pr(K,We),Re}for(Ae=l(Ae);We<W.length;We++)st=ne(Ae,K,We,W[We],ue),st!==null&&(n&&st.alternate!==null&&Ae.delete(st.key===null?We:st.key),H=g(st,H,We),ut===null?Re=st:ut.sibling=st,ut=st);return n&&Ae.forEach(function(Ui){return i(K,Ui)}),ot&&Pr(K,We),Re}function De(K,H,W,ue){if(W==null)throw Error(a(151));for(var Re=null,ut=null,Ae=H,We=H=0,st=null,dt=W.next();Ae!==null&&!dt.done;We++,dt=W.next()){Ae.index>We?(st=Ae,Ae=null):st=Ae.sibling;var Ui=ee(K,Ae,dt.value,ue);if(Ui===null){Ae===null&&(Ae=st);break}n&&Ae&&Ui.alternate===null&&i(K,Ae),H=g(Ui,H,We),ut===null?Re=Ui:ut.sibling=Ui,ut=Ui,Ae=st}if(dt.done)return s(K,Ae),ot&&Pr(K,We),Re;if(Ae===null){for(;!dt.done;We++,dt=W.next())dt=fe(K,dt.value,ue),dt!==null&&(H=g(dt,H,We),ut===null?Re=dt:ut.sibling=dt,ut=dt);return ot&&Pr(K,We),Re}for(Ae=l(Ae);!dt.done;We++,dt=W.next())dt=ne(Ae,K,We,dt.value,ue),dt!==null&&(n&&dt.alternate!==null&&Ae.delete(dt.key===null?We:dt.key),H=g(dt,H,We),ut===null?Re=dt:ut.sibling=dt,ut=dt);return n&&Ae.forEach(function(Uw){return i(K,Uw)}),ot&&Pr(K,We),Re}function wt(K,H,W,ue){if(typeof W=="object"&&W!==null&&W.type===_&&W.key===null&&(W=W.props.children),typeof W=="object"&&W!==null){switch(W.$$typeof){case x:e:{for(var Re=W.key;H!==null;){if(H.key===Re){if(Re=W.type,Re===_){if(H.tag===7){s(K,H.sibling),ue=p(H,W.props.children),ue.return=K,K=ue;break e}}else if(H.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===F&&ua(Re)===H.type){s(K,H.sibling),ue=p(H,W.props),po(ue,W),ue.return=K,K=ue;break e}s(K,H);break}else i(K,H);H=H.sibling}W.type===_?(ue=aa(W.props.children,K.mode,ue,W.key),ue.return=K,K=ue):(ue=Xl(W.type,W.key,W.props,null,K.mode,ue),po(ue,W),ue.return=K,K=ue)}return E(K);case S:e:{for(Re=W.key;H!==null;){if(H.key===Re)if(H.tag===4&&H.stateNode.containerInfo===W.containerInfo&&H.stateNode.implementation===W.implementation){s(K,H.sibling),ue=p(H,W.children||[]),ue.return=K,K=ue;break e}else{s(K,H);break}else i(K,H);H=H.sibling}ue=hd(W,K.mode,ue),ue.return=K,K=ue}return E(K);case F:return W=ua(W),wt(K,H,W,ue)}if(V(W))return ke(K,H,W,ue);if(Y(W)){if(Re=Y(W),typeof Re!="function")throw Error(a(150));return W=Re.call(W),De(K,H,W,ue)}if(typeof W.then=="function")return wt(K,H,rc(W),ue);if(W.$$typeof===R)return wt(K,H,Ql(K,W),ue);ic(K,W)}return typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint"?(W=""+W,H!==null&&H.tag===6?(s(K,H.sibling),ue=p(H,W),ue.return=K,K=ue):(s(K,H),ue=fd(W,K.mode,ue),ue.return=K,K=ue),E(K)):s(K,H)}return function(K,H,W,ue){try{ho=0;var Re=wt(K,H,W,ue);return Qa=null,Re}catch(Ae){if(Ae===Ja||Ae===tc)throw Ae;var ut=Fn(29,Ae,null,K.mode);return ut.lanes=ue,ut.return=K,ut}finally{}}}var fa=ag(!0),sg=ag(!1),Si=!1;function kd(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Td(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 _i(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function wi(n,i,s){var l=n.updateQueue;if(l===null)return null;if(l=l.shared,(ht&2)!==0){var p=l.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),l.pending=i,i=Wl(n),$m(n,null,s),i}return Yl(n,l,i,s),Wl(n)}function mo(n,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var l=i.lanes;l&=n.pendingLanes,s|=l,i.lanes=s,Be(n,s)}}function Nd(n,i){var s=n.updateQueue,l=n.alternate;if(l!==null&&(l=l.updateQueue,s===l)){var p=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?p=g=E:g=g.next=E,s=s.next}while(s!==null);g===null?p=g=i:g=g.next=i}else p=g=i;s={baseState:l.baseState,firstBaseUpdate:p,lastBaseUpdate:g,shared:l.shared,callbacks:l.callbacks},n.updateQueue=s;return}n=s.lastBaseUpdate,n===null?s.firstBaseUpdate=i:n.next=i,s.lastBaseUpdate=i}var Cd=!1;function go(){if(Cd){var n=Za;if(n!==null)throw n}}function bo(n,i,s,l){Cd=!1;var p=n.updateQueue;Si=!1;var g=p.firstBaseUpdate,E=p.lastBaseUpdate,k=p.shared.pending;if(k!==null){p.shared.pending=null;var B=k,X=B.next;B.next=null,E===null?g=X:E.next=X,E=B;var ae=n.alternate;ae!==null&&(ae=ae.updateQueue,k=ae.lastBaseUpdate,k!==E&&(k===null?ae.firstBaseUpdate=X:k.next=X,ae.lastBaseUpdate=B))}if(g!==null){var fe=p.baseState;E=0,ae=X=B=null,k=g;do{var ee=k.lane&-536870913,ne=ee!==k.lane;if(ne?(at&ee)===ee:(l&ee)===ee){ee!==0&&ee===Xa&&(Cd=!0),ae!==null&&(ae=ae.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var ke=n,De=k;ee=i;var wt=s;switch(De.tag){case 1:if(ke=De.payload,typeof ke=="function"){fe=ke.call(wt,fe,ee);break e}fe=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=De.payload,ee=typeof ke=="function"?ke.call(wt,fe,ee):ke,ee==null)break e;fe=y({},fe,ee);break e;case 2:Si=!0}}ee=k.callback,ee!==null&&(n.flags|=64,ne&&(n.flags|=8192),ne=p.callbacks,ne===null?p.callbacks=[ee]:ne.push(ee))}else ne={lane:ee,tag:k.tag,payload:k.payload,callback:k.callback,next:null},ae===null?(X=ae=ne,B=fe):ae=ae.next=ne,E|=ee;if(k=k.next,k===null){if(k=p.shared.pending,k===null)break;ne=k,k=ne.next,ne.next=null,p.lastBaseUpdate=ne,p.shared.pending=null}}while(!0);ae===null&&(B=fe),p.baseState=B,p.firstBaseUpdate=X,p.lastBaseUpdate=ae,g===null&&(p.shared.lanes=0),Ai|=E,n.lanes=E,n.memoizedState=fe}}function og(n,i){if(typeof n!="function")throw Error(a(191,n));n.call(i)}function lg(n,i){var s=n.callbacks;if(s!==null)for(n.callbacks=null,n=0;n<s.length;n++)og(s[n],i)}var es=j(null),ac=j(0);function cg(n,i){n=Zr,A(ac,n),A(es,i),Zr=n|i.baseLanes}function Ad(){A(ac,Zr),A(es,es.current)}function Od(){Zr=ac.current,Q(es),Q(ac)}var $n=j(null),ir=null;function ki(n){var i=n.alternate;A(Kt,Kt.current&1),A($n,n),ir===null&&(i===null||es.current!==null||i.memoizedState!==null)&&(ir=n)}function Md(n){A(Kt,Kt.current),A($n,n),ir===null&&(ir=n)}function ug(n){n.tag===22?(A(Kt,Kt.current),A($n,n),ir===null&&(ir=n)):Ti()}function Ti(){A(Kt,Kt.current),A($n,$n.current)}function Gn(n){Q($n),ir===n&&(ir=null),Q(Kt)}var Kt=j(0);function sc(n){for(var i=n;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Bf(s)||Uf(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 $r=0,qe=null,St=null,Xt=null,oc=!1,ts=!1,ha=!1,lc=0,yo=0,ns=null,A_=0;function Pt(){throw Error(a(321))}function Rd(n,i){if(i===null)return!1;for(var s=0;s<i.length&&s<n.length;s++)if(!Hn(n[s],i[s]))return!1;return!0}function Id(n,i,s,l,p,g){return $r=g,qe=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,z.H=n===null||n.memoizedState===null?qg:Yd,ha=!1,g=s(l,p),ha=!1,ts&&(g=fg(i,s,l,p)),dg(n),g}function dg(n){z.H=Eo;var i=St!==null&&St.next!==null;if($r=0,Xt=St=qe=null,oc=!1,yo=0,ns=null,i)throw Error(a(300));n===null||Zt||(n=n.dependencies,n!==null&&Jl(n)&&(Zt=!0))}function fg(n,i,s,l){qe=n;var p=0;do{if(ts&&(ns=null),yo=0,ts=!1,25<=p)throw Error(a(301));if(p+=1,Xt=St=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=Yg,g=i(s,l)}while(ts);return g}function O_(){var n=z.H,i=n.useState()[0];return i=typeof i.then=="function"?vo(i):i,n=n.useState()[0],(St!==null?St.memoizedState:null)!==n&&(qe.flags|=1024),i}function Ld(){var n=lc!==0;return lc=0,n}function Dd(n,i,s){i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~s}function jd(n){if(oc){for(n=n.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}oc=!1}$r=0,Xt=St=qe=null,ts=!1,yo=lc=0,ns=null}function vn(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xt===null?qe.memoizedState=Xt=n:Xt=Xt.next=n,Xt}function Vt(){if(St===null){var n=qe.alternate;n=n!==null?n.memoizedState:null}else n=St.next;var i=Xt===null?qe.memoizedState:Xt.next;if(i!==null)Xt=i,St=n;else{if(n===null)throw qe.alternate===null?Error(a(467)):Error(a(310));St=n,n={memoizedState:St.memoizedState,baseState:St.baseState,baseQueue:St.baseQueue,queue:St.queue,next:null},Xt===null?qe.memoizedState=Xt=n:Xt=Xt.next=n}return Xt}function cc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function vo(n){var i=yo;return yo+=1,ns===null&&(ns=[]),n=ng(ns,n,i),i=qe,(Xt===null?i.memoizedState:Xt.next)===null&&(i=i.alternate,z.H=i===null||i.memoizedState===null?qg:Yd),n}function uc(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return vo(n);if(n.$$typeof===R)return sn(n)}throw Error(a(438,String(n)))}function zd(n){var i=null,s=qe.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var l=qe.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(i={data:l.data.map(function(p){return p.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),s===null&&(s=cc(),qe.updateQueue=s),s.memoCache=i,s=i.data[i.index],s===void 0)for(s=i.data[i.index]=Array(n),l=0;l<n;l++)s[l]=P;return i.index++,s}function Gr(n,i){return typeof i=="function"?i(n):i}function dc(n){var i=Vt();return Bd(i,St,n)}function Bd(n,i,s){var l=n.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=s;var p=n.baseQueue,g=l.pending;if(g!==null){if(p!==null){var E=p.next;p.next=g.next,g.next=E}i.baseQueue=p=g,l.pending=null}if(g=n.baseState,p===null)n.memoizedState=g;else{i=p.next;var k=E=null,B=null,X=i,ae=!1;do{var fe=X.lane&-536870913;if(fe!==X.lane?(at&fe)===fe:($r&fe)===fe){var ee=X.revertLane;if(ee===0)B!==null&&(B=B.next={lane:0,revertLane:0,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null}),fe===Xa&&(ae=!0);else if(($r&ee)===ee){X=X.next,ee===Xa&&(ae=!0);continue}else fe={lane:0,revertLane:X.revertLane,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},B===null?(k=B=fe,E=g):B=B.next=fe,qe.lanes|=ee,Ai|=ee;fe=X.action,ha&&s(g,fe),g=X.hasEagerState?X.eagerState:s(g,fe)}else ee={lane:fe,revertLane:X.revertLane,gesture:X.gesture,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},B===null?(k=B=ee,E=g):B=B.next=ee,qe.lanes|=fe,Ai|=fe;X=X.next}while(X!==null&&X!==i);if(B===null?E=g:B.next=k,!Hn(g,n.memoizedState)&&(Zt=!0,ae&&(s=Za,s!==null)))throw s;n.memoizedState=g,n.baseState=E,n.baseQueue=B,l.lastRenderedState=g}return p===null&&(l.lanes=0),[n.memoizedState,l.dispatch]}function Ud(n){var i=Vt(),s=i.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=n;var l=s.dispatch,p=s.pending,g=i.memoizedState;if(p!==null){s.pending=null;var E=p=p.next;do g=n(g,E.action),E=E.next;while(E!==p);Hn(g,i.memoizedState)||(Zt=!0),i.memoizedState=g,i.baseQueue===null&&(i.baseState=g),s.lastRenderedState=g}return[g,l]}function hg(n,i,s){var l=qe,p=Vt(),g=ot;if(g){if(s===void 0)throw Error(a(407));s=s()}else s=i();var E=!Hn((St||p).memoizedState,s);if(E&&(p.memoizedState=s,Zt=!0),p=p.queue,Fd(gg.bind(null,l,p,n),[n]),p.getSnapshot!==i||E||Xt!==null&&Xt.memoizedState.tag&1){if(l.flags|=2048,rs(9,{destroy:void 0},mg.bind(null,l,p,s,i),null),Ct===null)throw Error(a(349));g||($r&127)!==0||pg(l,i,s)}return s}function pg(n,i,s){n.flags|=16384,n={getSnapshot:i,value:s},i=qe.updateQueue,i===null?(i=cc(),qe.updateQueue=i,i.stores=[n]):(s=i.stores,s===null?i.stores=[n]:s.push(n))}function mg(n,i,s,l){i.value=s,i.getSnapshot=l,bg(i)&&yg(n)}function gg(n,i,s){return s(function(){bg(i)&&yg(n)})}function bg(n){var i=n.getSnapshot;n=n.value;try{var s=i();return!Hn(n,s)}catch{return!0}}function yg(n){var i=ia(n,2);i!==null&&Dn(i,n,2)}function Pd(n){var i=vn();if(typeof n=="function"){var s=n;if(n=s(),ha){dn(!0);try{s()}finally{dn(!1)}}}return i.memoizedState=i.baseState=n,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gr,lastRenderedState:n},i}function vg(n,i,s,l){return n.baseState=s,Bd(n,St,typeof l=="function"?l:Gr)}function M_(n,i,s,l,p){if(pc(n))throw Error(a(485));if(n=i.action,n!==null){var g={payload:p,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,l(g),s=i.pending,s===null?(g.next=i.pending=g,xg(i,g)):(g.next=s.next,i.pending=s.next=g)}}function xg(n,i){var s=i.action,l=i.payload,p=n.state;if(i.isTransition){var g=z.T,E={};z.T=E;try{var k=s(p,l),B=z.S;B!==null&&B(E,k),Eg(n,i,k)}catch(X){Hd(n,i,X)}finally{g!==null&&E.types!==null&&(g.types=E.types),z.T=g}}else try{g=s(p,l),Eg(n,i,g)}catch(X){Hd(n,i,X)}}function Eg(n,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(l){Sg(n,i,l)},function(l){return Hd(n,i,l)}):Sg(n,i,s)}function Sg(n,i,s){i.status="fulfilled",i.value=s,_g(i),n.state=s,i=n.pending,i!==null&&(s=i.next,s===i?n.pending=null:(s=s.next,i.next=s,xg(n,s)))}function Hd(n,i,s){var l=n.pending;if(n.pending=null,l!==null){l=l.next;do i.status="rejected",i.reason=s,_g(i),i=i.next;while(i!==l)}n.action=null}function _g(n){n=n.listeners;for(var i=0;i<n.length;i++)(0,n[i])()}function wg(n,i){return i}function kg(n,i){if(ot){var s=Ct.formState;if(s!==null){e:{var l=qe;if(ot){if(Lt){t:{for(var p=Lt,g=rr;p.nodeType!==8;){if(!g){p=null;break t}if(p=ar(p.nextSibling),p===null){p=null;break t}}g=p.data,p=g==="F!"||g==="F"?p:null}if(p){Lt=ar(p.nextSibling),l=p.data==="F!";break e}}xi(l)}l=!1}l&&(i=s[0])}}return s=vn(),s.memoizedState=s.baseState=i,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:wg,lastRenderedState:i},s.queue=l,s=Gg.bind(null,qe,l),l.dispatch=s,l=Pd(!1),g=qd.bind(null,qe,!1,l.queue),l=vn(),p={state:i,dispatch:null,action:n,pending:null},l.queue=p,s=M_.bind(null,qe,p,g,s),p.dispatch=s,l.memoizedState=n,[i,s,!1]}function Tg(n){var i=Vt();return Ng(i,St,n)}function Ng(n,i,s){if(i=Bd(n,i,wg)[0],n=dc(Gr)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var l=vo(i)}catch(E){throw E===Ja?tc:E}else l=i;i=Vt();var p=i.queue,g=p.dispatch;return s!==i.memoizedState&&(qe.flags|=2048,rs(9,{destroy:void 0},R_.bind(null,p,s),null)),[l,g,n]}function R_(n,i){n.action=i}function Cg(n){var i=Vt(),s=St;if(s!==null)return Ng(i,s,n);Vt(),i=i.memoizedState,s=Vt();var l=s.queue.dispatch;return s.memoizedState=n,[i,l,!1]}function rs(n,i,s,l){return n={tag:n,create:s,deps:l,inst:i,next:null},i=qe.updateQueue,i===null&&(i=cc(),qe.updateQueue=i),s=i.lastEffect,s===null?i.lastEffect=n.next=n:(l=s.next,s.next=n,n.next=l,i.lastEffect=n),n}function Ag(){return Vt().memoizedState}function fc(n,i,s,l){var p=vn();qe.flags|=n,p.memoizedState=rs(1|i,{destroy:void 0},s,l===void 0?null:l)}function hc(n,i,s,l){var p=Vt();l=l===void 0?null:l;var g=p.memoizedState.inst;St!==null&&l!==null&&Rd(l,St.memoizedState.deps)?p.memoizedState=rs(i,g,s,l):(qe.flags|=n,p.memoizedState=rs(1|i,g,s,l))}function Og(n,i){fc(8390656,8,n,i)}function Fd(n,i){hc(2048,8,n,i)}function I_(n){qe.flags|=4;var i=qe.updateQueue;if(i===null)i=cc(),qe.updateQueue=i,i.events=[n];else{var s=i.events;s===null?i.events=[n]:s.push(n)}}function Mg(n){var i=Vt().memoizedState;return I_({ref:i,nextImpl:n}),function(){if((ht&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function Rg(n,i){return hc(4,2,n,i)}function Ig(n,i){return hc(4,4,n,i)}function Lg(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 Dg(n,i,s){s=s!=null?s.concat([n]):null,hc(4,4,Lg.bind(null,i,n),s)}function $d(){}function jg(n,i){var s=Vt();i=i===void 0?null:i;var l=s.memoizedState;return i!==null&&Rd(i,l[1])?l[0]:(s.memoizedState=[n,i],n)}function zg(n,i){var s=Vt();i=i===void 0?null:i;var l=s.memoizedState;if(i!==null&&Rd(i,l[1]))return l[0];if(l=n(),ha){dn(!0);try{n()}finally{dn(!1)}}return s.memoizedState=[l,i],l}function Gd(n,i,s){return s===void 0||($r&1073741824)!==0&&(at&261930)===0?n.memoizedState=i:(n.memoizedState=s,n=Bb(),qe.lanes|=n,Ai|=n,s)}function Bg(n,i,s,l){return Hn(s,i)?s:es.current!==null?(n=Gd(n,s,l),Hn(n,i)||(Zt=!0),n):($r&42)===0||($r&1073741824)!==0&&(at&261930)===0?(Zt=!0,n.memoizedState=s):(n=Bb(),qe.lanes|=n,Ai|=n,i)}function Ug(n,i,s,l,p){var g=re.p;re.p=g!==0&&8>g?g:8;var E=z.T,k={};z.T=k,qd(n,!1,i,s);try{var B=p(),X=z.S;if(X!==null&&X(k,B),B!==null&&typeof B=="object"&&typeof B.then=="function"){var ae=C_(B,l);xo(n,i,ae,qn(n))}else xo(n,i,l,qn(n))}catch(fe){xo(n,i,{then:function(){},status:"rejected",reason:fe},qn())}finally{re.p=g,E!==null&&k.types!==null&&(E.types=k.types),z.T=E}}function L_(){}function Kd(n,i,s,l){if(n.tag!==5)throw Error(a(476));var p=Pg(n).queue;Ug(n,p,i,oe,s===null?L_:function(){return Hg(n),s(l)})}function Pg(n){var i=n.memoizedState;if(i!==null)return i;i={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gr,lastRenderedState:oe},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gr,lastRenderedState:s},next:null},n.memoizedState=i,n=n.alternate,n!==null&&(n.memoizedState=i),i}function Hg(n){var i=Pg(n);i.next===null&&(i=n.alternate.memoizedState),xo(n,i.next.queue,{},qn())}function Vd(){return sn(zo)}function Fg(){return Vt().memoizedState}function $g(){return Vt().memoizedState}function D_(n){for(var i=n.return;i!==null;){switch(i.tag){case 24:case 3:var s=qn();n=_i(s);var l=wi(i,n,s);l!==null&&(Dn(l,i,s),mo(l,i,s)),i={cache:Ed()},n.payload=i;return}i=i.return}}function j_(n,i,s){var l=qn();s={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},pc(n)?Kg(i,s):(s=ud(n,i,s,l),s!==null&&(Dn(s,n,l),Vg(s,i,l)))}function Gg(n,i,s){var l=qn();xo(n,i,s,l)}function xo(n,i,s,l){var p={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(pc(n))Kg(i,p);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(p.hasEagerState=!0,p.eagerState=k,Hn(k,E))return Yl(n,i,p,0),Ct===null&&ql(),!1}catch{}finally{}if(s=ud(n,i,p,l),s!==null)return Dn(s,n,l),Vg(s,i,l),!0}return!1}function qd(n,i,s,l){if(l={lane:2,revertLane:Tf(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},pc(n)){if(i)throw Error(a(479))}else i=ud(n,s,l,2),i!==null&&Dn(i,n,2)}function pc(n){var i=n.alternate;return n===qe||i!==null&&i===qe}function Kg(n,i){ts=oc=!0;var s=n.pending;s===null?i.next=i:(i.next=s.next,s.next=i),n.pending=i}function Vg(n,i,s){if((s&4194048)!==0){var l=i.lanes;l&=n.pendingLanes,s|=l,i.lanes=s,Be(n,s)}}var Eo={readContext:sn,use:uc,useCallback:Pt,useContext:Pt,useEffect:Pt,useImperativeHandle:Pt,useLayoutEffect:Pt,useInsertionEffect:Pt,useMemo:Pt,useReducer:Pt,useRef:Pt,useState:Pt,useDebugValue:Pt,useDeferredValue:Pt,useTransition:Pt,useSyncExternalStore:Pt,useId:Pt,useHostTransitionStatus:Pt,useFormState:Pt,useActionState:Pt,useOptimistic:Pt,useMemoCache:Pt,useCacheRefresh:Pt};Eo.useEffectEvent=Pt;var qg={readContext:sn,use:uc,useCallback:function(n,i){return vn().memoizedState=[n,i===void 0?null:i],n},useContext:sn,useEffect:Og,useImperativeHandle:function(n,i,s){s=s!=null?s.concat([n]):null,fc(4194308,4,Lg.bind(null,i,n),s)},useLayoutEffect:function(n,i){return fc(4194308,4,n,i)},useInsertionEffect:function(n,i){fc(4,2,n,i)},useMemo:function(n,i){var s=vn();i=i===void 0?null:i;var l=n();if(ha){dn(!0);try{n()}finally{dn(!1)}}return s.memoizedState=[l,i],l},useReducer:function(n,i,s){var l=vn();if(s!==void 0){var p=s(i);if(ha){dn(!0);try{s(i)}finally{dn(!1)}}}else p=i;return l.memoizedState=l.baseState=p,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:p},l.queue=n,n=n.dispatch=j_.bind(null,qe,n),[l.memoizedState,n]},useRef:function(n){var i=vn();return n={current:n},i.memoizedState=n},useState:function(n){n=Pd(n);var i=n.queue,s=Gg.bind(null,qe,i);return i.dispatch=s,[n.memoizedState,s]},useDebugValue:$d,useDeferredValue:function(n,i){var s=vn();return Gd(s,n,i)},useTransition:function(){var n=Pd(!1);return n=Ug.bind(null,qe,n.queue,!0,!1),vn().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,i,s){var l=qe,p=vn();if(ot){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),Ct===null)throw Error(a(349));(at&127)!==0||pg(l,i,s)}p.memoizedState=s;var g={value:s,getSnapshot:i};return p.queue=g,Og(gg.bind(null,l,g,n),[n]),l.flags|=2048,rs(9,{destroy:void 0},mg.bind(null,l,g,s,i),null),s},useId:function(){var n=vn(),i=Ct.identifierPrefix;if(ot){var s=Sr,l=Er;s=(l&~(1<<32-mt(l)-1)).toString(32)+s,i="_"+i+"R_"+s,s=lc++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=A_++,i="_"+i+"r_"+s.toString(32)+"_";return n.memoizedState=i},useHostTransitionStatus:Vd,useFormState:kg,useActionState:kg,useOptimistic:function(n){var i=vn();i.memoizedState=i.baseState=n;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=qd.bind(null,qe,!0,s),s.dispatch=i,[n,i]},useMemoCache:zd,useCacheRefresh:function(){return vn().memoizedState=D_.bind(null,qe)},useEffectEvent:function(n){var i=vn(),s={impl:n};return i.memoizedState=s,function(){if((ht&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},Yd={readContext:sn,use:uc,useCallback:jg,useContext:sn,useEffect:Fd,useImperativeHandle:Dg,useInsertionEffect:Rg,useLayoutEffect:Ig,useMemo:zg,useReducer:dc,useRef:Ag,useState:function(){return dc(Gr)},useDebugValue:$d,useDeferredValue:function(n,i){var s=Vt();return Bg(s,St.memoizedState,n,i)},useTransition:function(){var n=dc(Gr)[0],i=Vt().memoizedState;return[typeof n=="boolean"?n:vo(n),i]},useSyncExternalStore:hg,useId:Fg,useHostTransitionStatus:Vd,useFormState:Tg,useActionState:Tg,useOptimistic:function(n,i){var s=Vt();return vg(s,St,n,i)},useMemoCache:zd,useCacheRefresh:$g};Yd.useEffectEvent=Mg;var Yg={readContext:sn,use:uc,useCallback:jg,useContext:sn,useEffect:Fd,useImperativeHandle:Dg,useInsertionEffect:Rg,useLayoutEffect:Ig,useMemo:zg,useReducer:Ud,useRef:Ag,useState:function(){return Ud(Gr)},useDebugValue:$d,useDeferredValue:function(n,i){var s=Vt();return St===null?Gd(s,n,i):Bg(s,St.memoizedState,n,i)},useTransition:function(){var n=Ud(Gr)[0],i=Vt().memoizedState;return[typeof n=="boolean"?n:vo(n),i]},useSyncExternalStore:hg,useId:Fg,useHostTransitionStatus:Vd,useFormState:Cg,useActionState:Cg,useOptimistic:function(n,i){var s=Vt();return St!==null?vg(s,St,n,i):(s.baseState=n,[n,s.queue.dispatch])},useMemoCache:zd,useCacheRefresh:$g};Yg.useEffectEvent=Mg;function Wd(n,i,s,l){i=n.memoizedState,s=s(l,i),s=s==null?i:y({},i,s),n.memoizedState=s,n.lanes===0&&(n.updateQueue.baseState=s)}var Xd={enqueueSetState:function(n,i,s){n=n._reactInternals;var l=qn(),p=_i(l);p.payload=i,s!=null&&(p.callback=s),i=wi(n,p,l),i!==null&&(Dn(i,n,l),mo(i,n,l))},enqueueReplaceState:function(n,i,s){n=n._reactInternals;var l=qn(),p=_i(l);p.tag=1,p.payload=i,s!=null&&(p.callback=s),i=wi(n,p,l),i!==null&&(Dn(i,n,l),mo(i,n,l))},enqueueForceUpdate:function(n,i){n=n._reactInternals;var s=qn(),l=_i(s);l.tag=2,i!=null&&(l.callback=i),i=wi(n,l,s),i!==null&&(Dn(i,n,s),mo(i,n,s))}};function Wg(n,i,s,l,p,g,E){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(l,g,E):i.prototype&&i.prototype.isPureReactComponent?!so(s,l)||!so(p,g):!0}function Xg(n,i,s,l){n=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(s,l),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(s,l),i.state!==n&&Xd.enqueueReplaceState(i,i.state,null)}function pa(n,i){var s=i;if("ref"in i){s={};for(var l in i)l!=="ref"&&(s[l]=i[l])}if(n=n.defaultProps){s===i&&(s=y({},s));for(var p in n)s[p]===void 0&&(s[p]=n[p])}return s}function Zg(n){Vl(n)}function Jg(n){console.error(n)}function Qg(n){Vl(n)}function mc(n,i){try{var s=n.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(l){setTimeout(function(){throw l})}}function eb(n,i,s){try{var l=n.onCaughtError;l(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Zd(n,i,s){return s=_i(s),s.tag=3,s.payload={element:null},s.callback=function(){mc(n,i)},s}function tb(n){return n=_i(n),n.tag=3,n}function nb(n,i,s,l){var p=s.type.getDerivedStateFromError;if(typeof p=="function"){var g=l.value;n.payload=function(){return p(g)},n.callback=function(){eb(i,s,l)}}var E=s.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(n.callback=function(){eb(i,s,l),typeof p!="function"&&(Oi===null?Oi=new Set([this]):Oi.add(this));var k=l.stack;this.componentDidCatch(l.value,{componentStack:k!==null?k:""})})}function z_(n,i,s,l,p){if(s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(i=s.alternate,i!==null&&Wa(i,s,p,!0),s=$n.current,s!==null){switch(s.tag){case 31:case 13:return ir===null?Nc():s.alternate===null&&Ht===0&&(Ht=3),s.flags&=-257,s.flags|=65536,s.lanes=p,l===nc?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([l]):i.add(l),_f(n,l,p)),!1;case 22:return s.flags|=65536,l===nc?s.flags|=16384:(i=s.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([l])},s.updateQueue=i):(s=i.retryQueue,s===null?i.retryQueue=new Set([l]):s.add(l)),_f(n,l,p)),!1}throw Error(a(435,s.tag))}return _f(n,l,p),Nc(),!1}if(ot)return i=$n.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=p,l!==gd&&(n=Error(a(422),{cause:l}),co(er(n,s)))):(l!==gd&&(i=Error(a(423),{cause:l}),co(er(i,s))),n=n.current.alternate,n.flags|=65536,p&=-p,n.lanes|=p,l=er(l,s),p=Zd(n.stateNode,l,p),Nd(n,p),Ht!==4&&(Ht=2)),!1;var g=Error(a(520),{cause:l});if(g=er(g,s),Ao===null?Ao=[g]:Ao.push(g),Ht!==4&&(Ht=2),i===null)return!0;l=er(l,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,n=p&-p,s.lanes|=n,n=Zd(s.stateNode,l,n),Nd(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"&&(Oi===null||!Oi.has(g))))return s.flags|=65536,p&=-p,s.lanes|=p,p=tb(p),nb(p,n,s,l),Nd(s,p),!1}s=s.return}while(s!==null);return!1}var Jd=Error(a(461)),Zt=!1;function on(n,i,s,l){i.child=n===null?sg(i,null,s,l):fa(i,n.child,s,l)}function rb(n,i,s,l,p){s=s.render;var g=i.ref;if("ref"in l){var E={};for(var k in l)k!=="ref"&&(E[k]=l[k])}else E=l;return la(i),l=Id(n,i,s,E,g,p),k=Ld(),n!==null&&!Zt?(Dd(n,i,p),Kr(n,i,p)):(ot&&k&&pd(i),i.flags|=1,on(n,i,l,p),i.child)}function ib(n,i,s,l,p){if(n===null){var g=s.type;return typeof g=="function"&&!dd(g)&&g.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=g,ab(n,i,g,l,p)):(n=Xl(s.type,null,l,i,i.mode,p),n.ref=i.ref,n.return=i,i.child=n)}if(g=n.child,!of(n,p)){var E=g.memoizedProps;if(s=s.compare,s=s!==null?s:so,s(E,l)&&n.ref===i.ref)return Kr(n,i,p)}return i.flags|=1,n=Ur(g,l),n.ref=i.ref,n.return=i,i.child=n}function ab(n,i,s,l,p){if(n!==null){var g=n.memoizedProps;if(so(g,l)&&n.ref===i.ref)if(Zt=!1,i.pendingProps=l=g,of(n,p))(n.flags&131072)!==0&&(Zt=!0);else return i.lanes=n.lanes,Kr(n,i,p)}return Qd(n,i,s,l,p)}function sb(n,i,s,l){var p=l.children,g=n!==null?n.memoizedState:null;if(n===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((i.flags&128)!==0){if(g=g!==null?g.baseLanes|s:s,n!==null){for(l=i.child=n.child,p=0;l!==null;)p=p|l.lanes|l.childLanes,l=l.sibling;l=p&~g}else l=0,i.child=null;return ob(n,i,g,s,l)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},n!==null&&ec(i,g!==null?g.cachePool:null),g!==null?cg(i,g):Ad(),ug(i);else return l=i.lanes=536870912,ob(n,i,g!==null?g.baseLanes|s:s,s,l)}else g!==null?(ec(i,g.cachePool),cg(i,g),Ti(),i.memoizedState=null):(n!==null&&ec(i,null),Ad(),Ti());return on(n,i,p,s),i.child}function So(n,i){return n!==null&&n.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function ob(n,i,s,l,p){var g=_d();return g=g===null?null:{parent:Wt._currentValue,pool:g},i.memoizedState={baseLanes:s,cachePool:g},n!==null&&ec(i,null),Ad(),ug(i),n!==null&&Wa(n,i,l,!0),i.childLanes=p,null}function gc(n,i){return i=yc({mode:i.mode,children:i.children},n.mode),i.ref=n.ref,n.child=i,i.return=n,i}function lb(n,i,s){return fa(i,n.child,null,s),n=gc(i,i.pendingProps),n.flags|=2,Gn(i),i.memoizedState=null,n}function B_(n,i,s){var l=i.pendingProps,p=(i.flags&128)!==0;if(i.flags&=-129,n===null){if(ot){if(l.mode==="hidden")return n=gc(i,l),i.lanes=536870912,So(null,n);if(Md(i),(n=Lt)?(n=xy(n,rr),n=n!==null&&n.data==="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:yi!==null?{id:Er,overflow:Sr}:null,retryLane:536870912,hydrationErrors:null},s=Km(n),s.return=i,i.child=s,an=i,Lt=null)):n=null,n===null)throw xi(i);return i.lanes=536870912,null}return gc(i,l)}var g=n.memoizedState;if(g!==null){var E=g.dehydrated;if(Md(i),p)if(i.flags&256)i.flags&=-257,i=lb(n,i,s);else if(i.memoizedState!==null)i.child=n.child,i.flags|=128,i=null;else throw Error(a(558));else if(Zt||Wa(n,i,s,!1),p=(s&n.childLanes)!==0,Zt||p){if(l=Ct,l!==null&&(E=Ft(l,s),E!==0&&E!==g.retryLane))throw g.retryLane=E,ia(n,E),Dn(l,n,E),Jd;Nc(),i=lb(n,i,s)}else n=g.treeContext,Lt=ar(E.nextSibling),an=i,ot=!0,vi=null,rr=!1,n!==null&&Ym(i,n),i=gc(i,l),i.flags|=4096;return i}return n=Ur(n.child,{mode:l.mode,children:l.children}),n.ref=i.ref,i.child=n,n.return=i,n}function bc(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 Qd(n,i,s,l,p){return la(i),s=Id(n,i,s,l,void 0,p),l=Ld(),n!==null&&!Zt?(Dd(n,i,p),Kr(n,i,p)):(ot&&l&&pd(i),i.flags|=1,on(n,i,s,p),i.child)}function cb(n,i,s,l,p,g){return la(i),i.updateQueue=null,s=fg(i,l,s,p),dg(n),l=Ld(),n!==null&&!Zt?(Dd(n,i,g),Kr(n,i,g)):(ot&&l&&pd(i),i.flags|=1,on(n,i,s,g),i.child)}function ub(n,i,s,l,p){if(la(i),i.stateNode===null){var g=Ka,E=s.contextType;typeof E=="object"&&E!==null&&(g=sn(E)),g=new s(l,g),i.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=Xd,i.stateNode=g,g._reactInternals=i,g=i.stateNode,g.props=l,g.state=i.memoizedState,g.refs={},kd(i),E=s.contextType,g.context=typeof E=="object"&&E!==null?sn(E):Ka,g.state=i.memoizedState,E=s.getDerivedStateFromProps,typeof E=="function"&&(Wd(i,s,E,l),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&&Xd.enqueueReplaceState(g,g.state,null),bo(i,l,g,p),go(),g.state=i.memoizedState),typeof g.componentDidMount=="function"&&(i.flags|=4194308),l=!0}else if(n===null){g=i.stateNode;var k=i.memoizedProps,B=pa(s,k);g.props=B;var X=g.context,ae=s.contextType;E=Ka,typeof ae=="object"&&ae!==null&&(E=sn(ae));var fe=s.getDerivedStateFromProps;ae=typeof fe=="function"||typeof g.getSnapshotBeforeUpdate=="function",k=i.pendingProps!==k,ae||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(k||X!==E)&&Xg(i,g,l,E),Si=!1;var ee=i.memoizedState;g.state=ee,bo(i,l,g,p),go(),X=i.memoizedState,k||ee!==X||Si?(typeof fe=="function"&&(Wd(i,s,fe,l),X=i.memoizedState),(B=Si||Wg(i,s,B,l,ee,X,E))?(ae||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=l,i.memoizedState=X),g.props=l,g.state=X,g.context=E,l=B):(typeof g.componentDidMount=="function"&&(i.flags|=4194308),l=!1)}else{g=i.stateNode,Td(n,i),E=i.memoizedProps,ae=pa(s,E),g.props=ae,fe=i.pendingProps,ee=g.context,X=s.contextType,B=Ka,typeof X=="object"&&X!==null&&(B=sn(X)),k=s.getDerivedStateFromProps,(X=typeof k=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(E!==fe||ee!==B)&&Xg(i,g,l,B),Si=!1,ee=i.memoizedState,g.state=ee,bo(i,l,g,p),go();var ne=i.memoizedState;E!==fe||ee!==ne||Si||n!==null&&n.dependencies!==null&&Jl(n.dependencies)?(typeof k=="function"&&(Wd(i,s,k,l),ne=i.memoizedState),(ae=Si||Wg(i,s,ae,l,ee,ne,B)||n!==null&&n.dependencies!==null&&Jl(n.dependencies))?(X||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(l,ne,B),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(l,ne,B)),typeof g.componentDidUpdate=="function"&&(i.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof g.componentDidUpdate!="function"||E===n.memoizedProps&&ee===n.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||E===n.memoizedProps&&ee===n.memoizedState||(i.flags|=1024),i.memoizedProps=l,i.memoizedState=ne),g.props=l,g.state=ne,g.context=B,l=ae):(typeof g.componentDidUpdate!="function"||E===n.memoizedProps&&ee===n.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||E===n.memoizedProps&&ee===n.memoizedState||(i.flags|=1024),l=!1)}return g=l,bc(n,i),l=(i.flags&128)!==0,g||l?(g=i.stateNode,s=l&&typeof s.getDerivedStateFromError!="function"?null:g.render(),i.flags|=1,n!==null&&l?(i.child=fa(i,n.child,null,p),i.child=fa(i,null,s,p)):on(n,i,s,p),i.memoizedState=g.state,n=i.child):n=Kr(n,i,p),n}function db(n,i,s,l){return sa(),i.flags|=256,on(n,i,s,l),i.child}var ef={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tf(n){return{baseLanes:n,cachePool:eg()}}function nf(n,i,s){return n=n!==null?n.childLanes&~s:0,i&&(n|=Vn),n}function fb(n,i,s){var l=i.pendingProps,p=!1,g=(i.flags&128)!==0,E;if((E=g)||(E=n!==null&&n.memoizedState===null?!1:(Kt.current&2)!==0),E&&(p=!0,i.flags&=-129),E=(i.flags&32)!==0,i.flags&=-33,n===null){if(ot){if(p?ki(i):Ti(),(n=Lt)?(n=xy(n,rr),n=n!==null&&n.data!=="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:yi!==null?{id:Er,overflow:Sr}:null,retryLane:536870912,hydrationErrors:null},s=Km(n),s.return=i,i.child=s,an=i,Lt=null)):n=null,n===null)throw xi(i);return Uf(n)?i.lanes=32:i.lanes=536870912,null}var k=l.children;return l=l.fallback,p?(Ti(),p=i.mode,k=yc({mode:"hidden",children:k},p),l=aa(l,p,s,null),k.return=i,l.return=i,k.sibling=l,i.child=k,l=i.child,l.memoizedState=tf(s),l.childLanes=nf(n,E,s),i.memoizedState=ef,So(null,l)):(ki(i),rf(i,k))}var B=n.memoizedState;if(B!==null&&(k=B.dehydrated,k!==null)){if(g)i.flags&256?(ki(i),i.flags&=-257,i=af(n,i,s)):i.memoizedState!==null?(Ti(),i.child=n.child,i.flags|=128,i=null):(Ti(),k=l.fallback,p=i.mode,l=yc({mode:"visible",children:l.children},p),k=aa(k,p,s,null),k.flags|=2,l.return=i,k.return=i,l.sibling=k,i.child=l,fa(i,n.child,null,s),l=i.child,l.memoizedState=tf(s),l.childLanes=nf(n,E,s),i.memoizedState=ef,i=So(null,l));else if(ki(i),Uf(k)){if(E=k.nextSibling&&k.nextSibling.dataset,E)var X=E.dgst;E=X,l=Error(a(419)),l.stack="",l.digest=E,co({value:l,source:null,stack:null}),i=af(n,i,s)}else if(Zt||Wa(n,i,s,!1),E=(s&n.childLanes)!==0,Zt||E){if(E=Ct,E!==null&&(l=Ft(E,s),l!==0&&l!==B.retryLane))throw B.retryLane=l,ia(n,l),Dn(E,n,l),Jd;Bf(k)||Nc(),i=af(n,i,s)}else Bf(k)?(i.flags|=192,i.child=n.child,i=null):(n=B.treeContext,Lt=ar(k.nextSibling),an=i,ot=!0,vi=null,rr=!1,n!==null&&Ym(i,n),i=rf(i,l.children),i.flags|=4096);return i}return p?(Ti(),k=l.fallback,p=i.mode,B=n.child,X=B.sibling,l=Ur(B,{mode:"hidden",children:l.children}),l.subtreeFlags=B.subtreeFlags&65011712,X!==null?k=Ur(X,k):(k=aa(k,p,s,null),k.flags|=2),k.return=i,l.return=i,l.sibling=k,i.child=l,So(null,l),l=i.child,k=n.child.memoizedState,k===null?k=tf(s):(p=k.cachePool,p!==null?(B=Wt._currentValue,p=p.parent!==B?{parent:B,pool:B}:p):p=eg(),k={baseLanes:k.baseLanes|s,cachePool:p}),l.memoizedState=k,l.childLanes=nf(n,E,s),i.memoizedState=ef,So(n.child,l)):(ki(i),s=n.child,n=s.sibling,s=Ur(s,{mode:"visible",children:l.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 rf(n,i){return i=yc({mode:"visible",children:i},n.mode),i.return=n,n.child=i}function yc(n,i){return n=Fn(22,n,null,i),n.lanes=0,n}function af(n,i,s){return fa(i,n.child,null,s),n=rf(i,i.pendingProps.children),n.flags|=2,i.memoizedState=null,n}function hb(n,i,s){n.lanes|=i;var l=n.alternate;l!==null&&(l.lanes|=i),vd(n.return,i,s)}function sf(n,i,s,l,p,g){var E=n.memoizedState;E===null?n.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:l,tail:s,tailMode:p,treeForkCount:g}:(E.isBackwards=i,E.rendering=null,E.renderingStartTime=0,E.last=l,E.tail=s,E.tailMode=p,E.treeForkCount=g)}function pb(n,i,s){var l=i.pendingProps,p=l.revealOrder,g=l.tail;l=l.children;var E=Kt.current,k=(E&2)!==0;if(k?(E=E&1|2,i.flags|=128):E&=1,A(Kt,E),on(n,i,l,s),l=ot?lo:0,!k&&n!==null&&(n.flags&128)!==0)e:for(n=i.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&hb(n,s,i);else if(n.tag===19)hb(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(p){case"forwards":for(s=i.child,p=null;s!==null;)n=s.alternate,n!==null&&sc(n)===null&&(p=s),s=s.sibling;s=p,s===null?(p=i.child,i.child=null):(p=s.sibling,s.sibling=null),sf(i,!1,p,s,g,l);break;case"backwards":case"unstable_legacy-backwards":for(s=null,p=i.child,i.child=null;p!==null;){if(n=p.alternate,n!==null&&sc(n)===null){i.child=p;break}n=p.sibling,p.sibling=s,s=p,p=n}sf(i,!0,s,null,g,l);break;case"together":sf(i,!1,null,null,void 0,l);break;default:i.memoizedState=null}return i.child}function Kr(n,i,s){if(n!==null&&(i.dependencies=n.dependencies),Ai|=i.lanes,(s&i.childLanes)===0)if(n!==null){if(Wa(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=Ur(n,n.pendingProps),i.child=s,s.return=i;n.sibling!==null;)n=n.sibling,s=s.sibling=Ur(n,n.pendingProps),s.return=i;s.sibling=null}return i.child}function of(n,i){return(n.lanes&i)!==0?!0:(n=n.dependencies,!!(n!==null&&Jl(n)))}function U_(n,i,s){switch(i.tag){case 3:G(i,i.stateNode.containerInfo),Ei(i,Wt,n.memoizedState.cache),sa();break;case 27:case 5:ve(i);break;case 4:G(i,i.stateNode.containerInfo);break;case 10:Ei(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Md(i),null;break;case 13:var l=i.memoizedState;if(l!==null)return l.dehydrated!==null?(ki(i),i.flags|=128,null):(s&i.child.childLanes)!==0?fb(n,i,s):(ki(i),n=Kr(n,i,s),n!==null?n.sibling:null);ki(i);break;case 19:var p=(n.flags&128)!==0;if(l=(s&i.childLanes)!==0,l||(Wa(n,i,s,!1),l=(s&i.childLanes)!==0),p){if(l)return pb(n,i,s);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),A(Kt,Kt.current),l)break;return null;case 22:return i.lanes=0,sb(n,i,s,i.pendingProps);case 24:Ei(i,Wt,n.memoizedState.cache)}return Kr(n,i,s)}function mb(n,i,s){if(n!==null)if(n.memoizedProps!==i.pendingProps)Zt=!0;else{if(!of(n,s)&&(i.flags&128)===0)return Zt=!1,U_(n,i,s);Zt=(n.flags&131072)!==0}else Zt=!1,ot&&(i.flags&1048576)!==0&&qm(i,lo,i.index);switch(i.lanes=0,i.tag){case 16:e:{var l=i.pendingProps;if(n=ua(i.elementType),i.type=n,typeof n=="function")dd(n)?(l=pa(n,l),i.tag=1,i=ub(null,i,n,l,s)):(i.tag=0,i=Qd(null,i,n,l,s));else{if(n!=null){var p=n.$$typeof;if(p===M){i.tag=11,i=rb(null,i,n,l,s);break e}else if(p===D){i.tag=14,i=ib(null,i,n,l,s);break e}}throw i=se(n)||n,Error(a(306,i,""))}}return i;case 0:return Qd(n,i,i.type,i.pendingProps,s);case 1:return l=i.type,p=pa(l,i.pendingProps),ub(n,i,l,p,s);case 3:e:{if(G(i,i.stateNode.containerInfo),n===null)throw Error(a(387));l=i.pendingProps;var g=i.memoizedState;p=g.element,Td(n,i),bo(i,l,null,s);var E=i.memoizedState;if(l=E.cache,Ei(i,Wt,l),l!==g.cache&&xd(i,[Wt],s,!0),go(),l=E.element,g.isDehydrated)if(g={element:l,isDehydrated:!1,cache:E.cache},i.updateQueue.baseState=g,i.memoizedState=g,i.flags&256){i=db(n,i,l,s);break e}else if(l!==p){p=er(Error(a(424)),i),co(p),i=db(n,i,l,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(Lt=ar(n.firstChild),an=i,ot=!0,vi=null,rr=!0,s=sg(i,null,l,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(sa(),l===p){i=Kr(n,i,s);break e}on(n,i,l,s)}i=i.child}return i;case 26:return bc(n,i),n===null?(s=Ty(i.type,null,i.pendingProps,null))?i.memoizedState=s:ot||(s=i.type,n=i.pendingProps,l=Lc(we.current).createElement(s),l[$t]=i,l[fn]=n,ln(l,s,n),qt(l),i.stateNode=l):i.memoizedState=Ty(i.type,n.memoizedProps,i.pendingProps,n.memoizedState),null;case 27:return ve(i),n===null&&ot&&(l=i.stateNode=_y(i.type,i.pendingProps,we.current),an=i,rr=!0,p=Lt,Li(i.type)?(Pf=p,Lt=ar(l.firstChild)):Lt=p),on(n,i,i.pendingProps.children,s),bc(n,i),n===null&&(i.flags|=4194304),i.child;case 5:return n===null&&ot&&((p=l=Lt)&&(l=mw(l,i.type,i.pendingProps,rr),l!==null?(i.stateNode=l,an=i,Lt=ar(l.firstChild),rr=!1,p=!0):p=!1),p||xi(i)),ve(i),p=i.type,g=i.pendingProps,E=n!==null?n.memoizedProps:null,l=g.children,Df(p,g)?l=null:E!==null&&Df(p,E)&&(i.flags|=32),i.memoizedState!==null&&(p=Id(n,i,O_,null,null,s),zo._currentValue=p),bc(n,i),on(n,i,l,s),i.child;case 6:return n===null&&ot&&((n=s=Lt)&&(s=gw(s,i.pendingProps,rr),s!==null?(i.stateNode=s,an=i,Lt=null,n=!0):n=!1),n||xi(i)),null;case 13:return fb(n,i,s);case 4:return G(i,i.stateNode.containerInfo),l=i.pendingProps,n===null?i.child=fa(i,null,l,s):on(n,i,l,s),i.child;case 11:return rb(n,i,i.type,i.pendingProps,s);case 7:return on(n,i,i.pendingProps,s),i.child;case 8:return on(n,i,i.pendingProps.children,s),i.child;case 12:return on(n,i,i.pendingProps.children,s),i.child;case 10:return l=i.pendingProps,Ei(i,i.type,l.value),on(n,i,l.children,s),i.child;case 9:return p=i.type._context,l=i.pendingProps.children,la(i),p=sn(p),l=l(p),i.flags|=1,on(n,i,l,s),i.child;case 14:return ib(n,i,i.type,i.pendingProps,s);case 15:return ab(n,i,i.type,i.pendingProps,s);case 19:return pb(n,i,s);case 31:return B_(n,i,s);case 22:return sb(n,i,s,i.pendingProps);case 24:return la(i),l=sn(Wt),n===null?(p=_d(),p===null&&(p=Ct,g=Ed(),p.pooledCache=g,g.refCount++,g!==null&&(p.pooledCacheLanes|=s),p=g),i.memoizedState={parent:l,cache:p},kd(i),Ei(i,Wt,p)):((n.lanes&s)!==0&&(Td(n,i),bo(i,null,null,s),go()),p=n.memoizedState,g=i.memoizedState,p.parent!==l?(p={parent:l,cache:l},i.memoizedState=p,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=p),Ei(i,Wt,l)):(l=g.cache,Ei(i,Wt,l),l!==p.cache&&xd(i,[Wt],s,!0))),on(n,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function Vr(n){n.flags|=4}function lf(n,i,s,l,p){if((i=(n.mode&32)!==0)&&(i=!1),i){if(n.flags|=16777216,(p&335544128)===p)if(n.stateNode.complete)n.flags|=8192;else if(Fb())n.flags|=8192;else throw da=nc,wd}else n.flags&=-16777217}function gb(n,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!My(i))if(Fb())n.flags|=8192;else throw da=nc,wd}function vc(n,i){i!==null&&(n.flags|=4),n.flags&16384&&(i=n.tag!==22?He():536870912,n.lanes|=i,os|=i)}function _o(n,i){if(!ot)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 l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?i||n.tail===null?n.tail=null:n.tail.sibling=null:l.sibling=null}}function Dt(n){var i=n.alternate!==null&&n.alternate.child===n.child,s=0,l=0;if(i)for(var p=n.child;p!==null;)s|=p.lanes|p.childLanes,l|=p.subtreeFlags&65011712,l|=p.flags&65011712,p.return=n,p=p.sibling;else for(p=n.child;p!==null;)s|=p.lanes|p.childLanes,l|=p.subtreeFlags,l|=p.flags,p.return=n,p=p.sibling;return n.subtreeFlags|=l,n.childLanes=s,i}function P_(n,i,s){var l=i.pendingProps;switch(md(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Dt(i),null;case 1:return Dt(i),null;case 3:return s=i.stateNode,l=null,n!==null&&(l=n.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),Fr(Wt),ie(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(n===null||n.child===null)&&(Ya(i)?Vr(i):n===null||n.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,bd())),Dt(i),null;case 26:var p=i.type,g=i.memoizedState;return n===null?(Vr(i),g!==null?(Dt(i),gb(i,g)):(Dt(i),lf(i,p,null,l,s))):g?g!==n.memoizedState?(Vr(i),Dt(i),gb(i,g)):(Dt(i),i.flags&=-16777217):(n=n.memoizedProps,n!==l&&Vr(i),Dt(i),lf(i,p,n,l,s)),null;case 27:if(Ke(i),s=we.current,p=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==l&&Vr(i);else{if(!l){if(i.stateNode===null)throw Error(a(166));return Dt(i),null}n=be.current,Ya(i)?Wm(i):(n=_y(p,l,s),i.stateNode=n,Vr(i))}return Dt(i),null;case 5:if(Ke(i),p=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==l&&Vr(i);else{if(!l){if(i.stateNode===null)throw Error(a(166));return Dt(i),null}if(g=be.current,Ya(i))Wm(i);else{var E=Lc(we.current);switch(g){case 1:g=E.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:g=E.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":g=E.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":g=E.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":g=E.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof l.is=="string"?E.createElement("select",{is:l.is}):E.createElement("select"),l.multiple?g.multiple=!0:l.size&&(g.size=l.size);break;default:g=typeof l.is=="string"?E.createElement(p,{is:l.is}):E.createElement(p)}}g[$t]=i,g[fn]=l;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(ln(g,p,l),p){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Vr(i)}}return Dt(i),lf(i,i.type,n===null?null:n.memoizedProps,i.pendingProps,s),null;case 6:if(n&&i.stateNode!=null)n.memoizedProps!==l&&Vr(i);else{if(typeof l!="string"&&i.stateNode===null)throw Error(a(166));if(n=we.current,Ya(i)){if(n=i.stateNode,s=i.memoizedProps,l=null,p=an,p!==null)switch(p.tag){case 27:case 5:l=p.memoizedProps}n[$t]=i,n=!!(n.nodeValue===s||l!==null&&l.suppressHydrationWarning===!0||fy(n.nodeValue,s)),n||xi(i,!0)}else n=Lc(n).createTextNode(l),n[$t]=i,i.stateNode=n}return Dt(i),null;case 31:if(s=i.memoizedState,n===null||n.memoizedState!==null){if(l=Ya(i),s!==null){if(n===null){if(!l)throw Error(a(318));if(n=i.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(557));n[$t]=i}else sa(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Dt(i),n=!1}else s=bd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=s),n=!0;if(!n)return i.flags&256?(Gn(i),i):(Gn(i),null);if((i.flags&128)!==0)throw Error(a(558))}return Dt(i),null;case 13:if(l=i.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(p=Ya(i),l!==null&&l.dehydrated!==null){if(n===null){if(!p)throw Error(a(318));if(p=i.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[$t]=i}else sa(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Dt(i),p=!1}else p=bd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=p),p=!0;if(!p)return i.flags&256?(Gn(i),i):(Gn(i),null)}return Gn(i),(i.flags&128)!==0?(i.lanes=s,i):(s=l!==null,n=n!==null&&n.memoizedState!==null,s&&(l=i.child,p=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(p=l.alternate.memoizedState.cachePool.pool),g=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),g!==p&&(l.flags|=2048)),s!==n&&s&&(i.child.flags|=8192),vc(i,i.updateQueue),Dt(i),null);case 4:return ie(),n===null&&Of(i.stateNode.containerInfo),Dt(i),null;case 10:return Fr(i.type),Dt(i),null;case 19:if(Q(Kt),l=i.memoizedState,l===null)return Dt(i),null;if(p=(i.flags&128)!==0,g=l.rendering,g===null)if(p)_o(l,!1);else{if(Ht!==0||n!==null&&(n.flags&128)!==0)for(n=i.child;n!==null;){if(g=sc(n),g!==null){for(i.flags|=128,_o(l,!1),n=g.updateQueue,i.updateQueue=n,vc(i,n),i.subtreeFlags=0,n=s,s=i.child;s!==null;)Gm(s,n),s=s.sibling;return A(Kt,Kt.current&1|2),ot&&Pr(i,l.treeForkCount),i.child}n=n.sibling}l.tail!==null&&he()>wc&&(i.flags|=128,p=!0,_o(l,!1),i.lanes=4194304)}else{if(!p)if(n=sc(g),n!==null){if(i.flags|=128,p=!0,n=n.updateQueue,i.updateQueue=n,vc(i,n),_o(l,!0),l.tail===null&&l.tailMode==="hidden"&&!g.alternate&&!ot)return Dt(i),null}else 2*he()-l.renderingStartTime>wc&&s!==536870912&&(i.flags|=128,p=!0,_o(l,!1),i.lanes=4194304);l.isBackwards?(g.sibling=i.child,i.child=g):(n=l.last,n!==null?n.sibling=g:i.child=g,l.last=g)}return l.tail!==null?(n=l.tail,l.rendering=n,l.tail=n.sibling,l.renderingStartTime=he(),n.sibling=null,s=Kt.current,A(Kt,p?s&1|2:s&1),ot&&Pr(i,l.treeForkCount),n):(Dt(i),null);case 22:case 23:return Gn(i),Od(),l=i.memoizedState!==null,n!==null?n.memoizedState!==null!==l&&(i.flags|=8192):l&&(i.flags|=8192),l?(s&536870912)!==0&&(i.flags&128)===0&&(Dt(i),i.subtreeFlags&6&&(i.flags|=8192)):Dt(i),s=i.updateQueue,s!==null&&vc(i,s.retryQueue),s=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),l=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(l=i.memoizedState.cachePool.pool),l!==s&&(i.flags|=2048),n!==null&&Q(ca),null;case 24:return s=null,n!==null&&(s=n.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),Fr(Wt),Dt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function H_(n,i){switch(md(i),i.tag){case 1:return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 3:return Fr(Wt),ie(),n=i.flags,(n&65536)!==0&&(n&128)===0?(i.flags=n&-65537|128,i):null;case 26:case 27:case 5:return Ke(i),null;case 31:if(i.memoizedState!==null){if(Gn(i),i.alternate===null)throw Error(a(340));sa()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 13:if(Gn(i),n=i.memoizedState,n!==null&&n.dehydrated!==null){if(i.alternate===null)throw Error(a(340));sa()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 19:return Q(Kt),null;case 4:return ie(),null;case 10:return Fr(i.type),null;case 22:case 23:return Gn(i),Od(),n!==null&&Q(ca),n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 24:return Fr(Wt),null;case 25:return null;default:return null}}function bb(n,i){switch(md(i),i.tag){case 3:Fr(Wt),ie();break;case 26:case 27:case 5:Ke(i);break;case 4:ie();break;case 31:i.memoizedState!==null&&Gn(i);break;case 13:Gn(i);break;case 19:Q(Kt);break;case 10:Fr(i.type);break;case 22:case 23:Gn(i),Od(),n!==null&&Q(ca);break;case 24:Fr(Wt)}}function wo(n,i){try{var s=i.updateQueue,l=s!==null?s.lastEffect:null;if(l!==null){var p=l.next;s=p;do{if((s.tag&n)===n){l=void 0;var g=s.create,E=s.inst;l=g(),E.destroy=l}s=s.next}while(s!==p)}}catch(k){vt(i,i.return,k)}}function Ni(n,i,s){try{var l=i.updateQueue,p=l!==null?l.lastEffect:null;if(p!==null){var g=p.next;l=g;do{if((l.tag&n)===n){var E=l.inst,k=E.destroy;if(k!==void 0){E.destroy=void 0,p=i;var B=s,X=k;try{X()}catch(ae){vt(p,B,ae)}}}l=l.next}while(l!==g)}}catch(ae){vt(i,i.return,ae)}}function yb(n){var i=n.updateQueue;if(i!==null){var s=n.stateNode;try{lg(i,s)}catch(l){vt(n,n.return,l)}}}function vb(n,i,s){s.props=pa(n.type,n.memoizedProps),s.state=n.memoizedState;try{s.componentWillUnmount()}catch(l){vt(n,i,l)}}function ko(n,i){try{var s=n.ref;if(s!==null){switch(n.tag){case 26:case 27:case 5:var l=n.stateNode;break;case 30:l=n.stateNode;break;default:l=n.stateNode}typeof s=="function"?n.refCleanup=s(l):s.current=l}}catch(p){vt(n,i,p)}}function _r(n,i){var s=n.ref,l=n.refCleanup;if(s!==null)if(typeof l=="function")try{l()}catch(p){vt(n,i,p)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(p){vt(n,i,p)}else s.current=null}function xb(n){var i=n.type,s=n.memoizedProps,l=n.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":s.autoFocus&&l.focus();break e;case"img":s.src?l.src=s.src:s.srcSet&&(l.srcset=s.srcSet)}}catch(p){vt(n,n.return,p)}}function cf(n,i,s){try{var l=n.stateNode;cw(l,n.type,s,i),l[fn]=i}catch(p){vt(n,n.return,p)}}function Eb(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Li(n.type)||n.tag===4}function uf(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Eb(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&&Li(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 df(n,i,s){var l=n.tag;if(l===5||l===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=xe));else if(l!==4&&(l===27&&Li(n.type)&&(s=n.stateNode,i=null),n=n.child,n!==null))for(df(n,i,s),n=n.sibling;n!==null;)df(n,i,s),n=n.sibling}function xc(n,i,s){var l=n.tag;if(l===5||l===6)n=n.stateNode,i?s.insertBefore(n,i):s.appendChild(n);else if(l!==4&&(l===27&&Li(n.type)&&(s=n.stateNode),n=n.child,n!==null))for(xc(n,i,s),n=n.sibling;n!==null;)xc(n,i,s),n=n.sibling}function Sb(n){var i=n.stateNode,s=n.memoizedProps;try{for(var l=n.type,p=i.attributes;p.length;)i.removeAttributeNode(p[0]);ln(i,l,s),i[$t]=n,i[fn]=s}catch(g){vt(n,n.return,g)}}var qr=!1,Jt=!1,ff=!1,_b=typeof WeakSet=="function"?WeakSet:Set,nn=null;function F_(n,i){if(n=n.containerInfo,If=Hc,n=Dm(n),id(n)){if("selectionStart"in n)var s={start:n.selectionStart,end:n.selectionEnd};else e:{s=(s=n.ownerDocument)&&s.defaultView||window;var l=s.getSelection&&s.getSelection();if(l&&l.rangeCount!==0){s=l.anchorNode;var p=l.anchorOffset,g=l.focusNode;l=l.focusOffset;try{s.nodeType,g.nodeType}catch{s=null;break e}var E=0,k=-1,B=-1,X=0,ae=0,fe=n,ee=null;t:for(;;){for(var ne;fe!==s||p!==0&&fe.nodeType!==3||(k=E+p),fe!==g||l!==0&&fe.nodeType!==3||(B=E+l),fe.nodeType===3&&(E+=fe.nodeValue.length),(ne=fe.firstChild)!==null;)ee=fe,fe=ne;for(;;){if(fe===n)break t;if(ee===s&&++X===p&&(k=E),ee===g&&++ae===l&&(B=E),(ne=fe.nextSibling)!==null)break;fe=ee,ee=fe.parentNode}fe=ne}s=k===-1||B===-1?null:{start:k,end:B}}else s=null}s=s||{start:0,end:0}}else s=null;for(Lf={focusedElem:n,selectionRange:s},Hc=!1,nn=i;nn!==null;)if(i=nn,n=i.child,(i.subtreeFlags&1028)!==0&&n!==null)n.return=i,nn=n;else for(;nn!==null;){switch(i=nn,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++)p=n[s],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&g!==null){n=void 0,s=i,p=g.memoizedProps,g=g.memoizedState,l=s.stateNode;try{var ke=pa(s.type,p);n=l.getSnapshotBeforeUpdate(ke,g),l.__reactInternalSnapshotBeforeUpdate=n}catch(De){vt(s,s.return,De)}}break;case 3:if((n&1024)!==0){if(n=i.stateNode.containerInfo,s=n.nodeType,s===9)zf(n);else if(s===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":zf(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,nn=n;break}nn=i.return}}function wb(n,i,s){var l=s.flags;switch(s.tag){case 0:case 11:case 15:Wr(n,s),l&4&&wo(5,s);break;case 1:if(Wr(n,s),l&4)if(n=s.stateNode,i===null)try{n.componentDidMount()}catch(E){vt(s,s.return,E)}else{var p=pa(s.type,i.memoizedProps);i=i.memoizedState;try{n.componentDidUpdate(p,i,n.__reactInternalSnapshotBeforeUpdate)}catch(E){vt(s,s.return,E)}}l&64&&yb(s),l&512&&ko(s,s.return);break;case 3:if(Wr(n,s),l&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{lg(n,i)}catch(E){vt(s,s.return,E)}}break;case 27:i===null&&l&4&&Sb(s);case 26:case 5:Wr(n,s),i===null&&l&4&&xb(s),l&512&&ko(s,s.return);break;case 12:Wr(n,s);break;case 31:Wr(n,s),l&4&&Nb(n,s);break;case 13:Wr(n,s),l&4&&Cb(n,s),l&64&&(n=s.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(s=Z_.bind(null,s),bw(n,s))));break;case 22:if(l=s.memoizedState!==null||qr,!l){i=i!==null&&i.memoizedState!==null||Jt,p=qr;var g=Jt;qr=l,(Jt=i)&&!g?Xr(n,s,(s.subtreeFlags&8772)!==0):Wr(n,s),qr=p,Jt=g}break;case 30:break;default:Wr(n,s)}}function kb(n){var i=n.alternate;i!==null&&(n.alternate=null,kb(i)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(i=n.stateNode,i!==null&&Ys(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 zt=null,Mn=!1;function Yr(n,i,s){for(s=s.child;s!==null;)Tb(n,i,s),s=s.sibling}function Tb(n,i,s){if(Ut&&typeof Ut.onCommitFiberUnmount=="function")try{Ut.onCommitFiberUnmount(en,s)}catch{}switch(s.tag){case 26:Jt||_r(s,i),Yr(n,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Jt||_r(s,i);var l=zt,p=Mn;Li(s.type)&&(zt=s.stateNode,Mn=!1),Yr(n,i,s),Lo(s.stateNode),zt=l,Mn=p;break;case 5:Jt||_r(s,i);case 6:if(l=zt,p=Mn,zt=null,Yr(n,i,s),zt=l,Mn=p,zt!==null)if(Mn)try{(zt.nodeType===9?zt.body:zt.nodeName==="HTML"?zt.ownerDocument.body:zt).removeChild(s.stateNode)}catch(g){vt(s,i,g)}else try{zt.removeChild(s.stateNode)}catch(g){vt(s,i,g)}break;case 18:zt!==null&&(Mn?(n=zt,yy(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,s.stateNode),ms(n)):yy(zt,s.stateNode));break;case 4:l=zt,p=Mn,zt=s.stateNode.containerInfo,Mn=!0,Yr(n,i,s),zt=l,Mn=p;break;case 0:case 11:case 14:case 15:Ni(2,s,i),Jt||Ni(4,s,i),Yr(n,i,s);break;case 1:Jt||(_r(s,i),l=s.stateNode,typeof l.componentWillUnmount=="function"&&vb(s,i,l)),Yr(n,i,s);break;case 21:Yr(n,i,s);break;case 22:Jt=(l=Jt)||s.memoizedState!==null,Yr(n,i,s),Jt=l;break;default:Yr(n,i,s)}}function Nb(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{ms(n)}catch(s){vt(i,i.return,s)}}}function Cb(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{ms(n)}catch(s){vt(i,i.return,s)}}function $_(n){switch(n.tag){case 31:case 13:case 19:var i=n.stateNode;return i===null&&(i=n.stateNode=new _b),i;case 22:return n=n.stateNode,i=n._retryCache,i===null&&(i=n._retryCache=new _b),i;default:throw Error(a(435,n.tag))}}function Ec(n,i){var s=$_(n);i.forEach(function(l){if(!s.has(l)){s.add(l);var p=J_.bind(null,n,l);l.then(p,p)}})}function Rn(n,i){var s=i.deletions;if(s!==null)for(var l=0;l<s.length;l++){var p=s[l],g=n,E=i,k=E;e:for(;k!==null;){switch(k.tag){case 27:if(Li(k.type)){zt=k.stateNode,Mn=!1;break e}break;case 5:zt=k.stateNode,Mn=!1;break e;case 3:case 4:zt=k.stateNode.containerInfo,Mn=!0;break e}k=k.return}if(zt===null)throw Error(a(160));Tb(g,E,p),zt=null,Mn=!1,g=p.alternate,g!==null&&(g.return=null),p.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Ab(i,n),i=i.sibling}var fr=null;function Ab(n,i){var s=n.alternate,l=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:Rn(i,n),In(n),l&4&&(Ni(3,n,n.return),wo(3,n),Ni(5,n,n.return));break;case 1:Rn(i,n),In(n),l&512&&(Jt||s===null||_r(s,s.return)),l&64&&qr&&(n=n.updateQueue,n!==null&&(l=n.callbacks,l!==null&&(s=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=s===null?l:s.concat(l))));break;case 26:var p=fr;if(Rn(i,n),In(n),l&512&&(Jt||s===null||_r(s,s.return)),l&4){var g=s!==null?s.memoizedState:null;if(l=n.memoizedState,s===null)if(l===null)if(n.stateNode===null){e:{l=n.type,s=n.memoizedProps,p=p.ownerDocument||p;t:switch(l){case"title":g=p.getElementsByTagName("title")[0],(!g||g[Ji]||g[$t]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=p.createElement(l),p.head.insertBefore(g,p.querySelector("head > title"))),ln(g,l,s),g[$t]=n,qt(g),l=g;break e;case"link":var E=Ay("link","href",p).get(l+(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=p.createElement(l),ln(g,l,s),p.head.appendChild(g);break;case"meta":if(E=Ay("meta","content",p).get(l+(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=p.createElement(l),ln(g,l,s),p.head.appendChild(g);break;default:throw Error(a(468,l))}g[$t]=n,qt(g),l=g}n.stateNode=l}else Oy(p,n.type,n.stateNode);else n.stateNode=Cy(p,l,n.memoizedProps);else g!==l?(g===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):g.count--,l===null?Oy(p,n.type,n.stateNode):Cy(p,l,n.memoizedProps)):l===null&&n.stateNode!==null&&cf(n,n.memoizedProps,s.memoizedProps)}break;case 27:Rn(i,n),In(n),l&512&&(Jt||s===null||_r(s,s.return)),s!==null&&l&4&&cf(n,n.memoizedProps,s.memoizedProps);break;case 5:if(Rn(i,n),In(n),l&512&&(Jt||s===null||_r(s,s.return)),n.flags&32){p=n.stateNode;try{je(p,"")}catch(ke){vt(n,n.return,ke)}}l&4&&n.stateNode!=null&&(p=n.memoizedProps,cf(n,p,s!==null?s.memoizedProps:p)),l&1024&&(ff=!0);break;case 6:if(Rn(i,n),In(n),l&4){if(n.stateNode===null)throw Error(a(162));l=n.memoizedProps,s=n.stateNode;try{s.nodeValue=l}catch(ke){vt(n,n.return,ke)}}break;case 3:if(zc=null,p=fr,fr=Dc(i.containerInfo),Rn(i,n),fr=p,In(n),l&4&&s!==null&&s.memoizedState.isDehydrated)try{ms(i.containerInfo)}catch(ke){vt(n,n.return,ke)}ff&&(ff=!1,Ob(n));break;case 4:l=fr,fr=Dc(n.stateNode.containerInfo),Rn(i,n),In(n),fr=l;break;case 12:Rn(i,n),In(n);break;case 31:Rn(i,n),In(n),l&4&&(l=n.updateQueue,l!==null&&(n.updateQueue=null,Ec(n,l)));break;case 13:Rn(i,n),In(n),n.child.flags&8192&&n.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(_c=he()),l&4&&(l=n.updateQueue,l!==null&&(n.updateQueue=null,Ec(n,l)));break;case 22:p=n.memoizedState!==null;var B=s!==null&&s.memoizedState!==null,X=qr,ae=Jt;if(qr=X||p,Jt=ae||B,Rn(i,n),Jt=ae,qr=X,In(n),l&8192)e:for(i=n.stateNode,i._visibility=p?i._visibility&-2:i._visibility|1,p&&(s===null||B||qr||Jt||ma(n)),s=null,i=n;;){if(i.tag===5||i.tag===26){if(s===null){B=s=i;try{if(g=B.stateNode,p)E=g.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{k=B.stateNode;var fe=B.memoizedProps.style,ee=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;k.style.display=ee==null||typeof ee=="boolean"?"":(""+ee).trim()}}catch(ke){vt(B,B.return,ke)}}}else if(i.tag===6){if(s===null){B=i;try{B.stateNode.nodeValue=p?"":B.memoizedProps}catch(ke){vt(B,B.return,ke)}}}else if(i.tag===18){if(s===null){B=i;try{var ne=B.stateNode;p?vy(ne,!0):vy(B.stateNode,!1)}catch(ke){vt(B,B.return,ke)}}}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}l&4&&(l=n.updateQueue,l!==null&&(s=l.retryQueue,s!==null&&(l.retryQueue=null,Ec(n,s))));break;case 19:Rn(i,n),In(n),l&4&&(l=n.updateQueue,l!==null&&(n.updateQueue=null,Ec(n,l)));break;case 30:break;case 21:break;default:Rn(i,n),In(n)}}function In(n){var i=n.flags;if(i&2){try{for(var s,l=n.return;l!==null;){if(Eb(l)){s=l;break}l=l.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var p=s.stateNode,g=uf(n);xc(n,g,p);break;case 5:var E=s.stateNode;s.flags&32&&(je(E,""),s.flags&=-33);var k=uf(n);xc(n,k,E);break;case 3:case 4:var B=s.stateNode.containerInfo,X=uf(n);df(n,X,B);break;default:throw Error(a(161))}}catch(ae){vt(n,n.return,ae)}n.flags&=-3}i&4096&&(n.flags&=-4097)}function Ob(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var i=n;Ob(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),n=n.sibling}}function Wr(n,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)wb(n,i.alternate,i),i=i.sibling}function ma(n){for(n=n.child;n!==null;){var i=n;switch(i.tag){case 0:case 11:case 14:case 15:Ni(4,i,i.return),ma(i);break;case 1:_r(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&vb(i,i.return,s),ma(i);break;case 27:Lo(i.stateNode);case 26:case 5:_r(i,i.return),ma(i);break;case 22:i.memoizedState===null&&ma(i);break;case 30:ma(i);break;default:ma(i)}n=n.sibling}}function Xr(n,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var l=i.alternate,p=n,g=i,E=g.flags;switch(g.tag){case 0:case 11:case 15:Xr(p,g,s),wo(4,g);break;case 1:if(Xr(p,g,s),l=g,p=l.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(X){vt(l,l.return,X)}if(l=g,p=l.updateQueue,p!==null){var k=l.stateNode;try{var B=p.shared.hiddenCallbacks;if(B!==null)for(p.shared.hiddenCallbacks=null,p=0;p<B.length;p++)og(B[p],k)}catch(X){vt(l,l.return,X)}}s&&E&64&&yb(g),ko(g,g.return);break;case 27:Sb(g);case 26:case 5:Xr(p,g,s),s&&l===null&&E&4&&xb(g),ko(g,g.return);break;case 12:Xr(p,g,s);break;case 31:Xr(p,g,s),s&&E&4&&Nb(p,g);break;case 13:Xr(p,g,s),s&&E&4&&Cb(p,g);break;case 22:g.memoizedState===null&&Xr(p,g,s),ko(g,g.return);break;case 30:break;default:Xr(p,g,s)}i=i.sibling}}function hf(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&&uo(s))}function pf(n,i){n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&uo(n))}function hr(n,i,s,l){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Mb(n,i,s,l),i=i.sibling}function Mb(n,i,s,l){var p=i.flags;switch(i.tag){case 0:case 11:case 15:hr(n,i,s,l),p&2048&&wo(9,i);break;case 1:hr(n,i,s,l);break;case 3:hr(n,i,s,l),p&2048&&(n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&uo(n)));break;case 12:if(p&2048){hr(n,i,s,l),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(B){vt(i,i.return,B)}}else hr(n,i,s,l);break;case 31:hr(n,i,s,l);break;case 13:hr(n,i,s,l);break;case 23:break;case 22:g=i.stateNode,E=i.alternate,i.memoizedState!==null?g._visibility&2?hr(n,i,s,l):To(n,i):g._visibility&2?hr(n,i,s,l):(g._visibility|=2,is(n,i,s,l,(i.subtreeFlags&10256)!==0||!1)),p&2048&&hf(E,i);break;case 24:hr(n,i,s,l),p&2048&&pf(i.alternate,i);break;default:hr(n,i,s,l)}}function is(n,i,s,l,p){for(p=p&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var g=n,E=i,k=s,B=l,X=E.flags;switch(E.tag){case 0:case 11:case 15:is(g,E,k,B,p),wo(8,E);break;case 23:break;case 22:var ae=E.stateNode;E.memoizedState!==null?ae._visibility&2?is(g,E,k,B,p):To(g,E):(ae._visibility|=2,is(g,E,k,B,p)),p&&X&2048&&hf(E.alternate,E);break;case 24:is(g,E,k,B,p),p&&X&2048&&pf(E.alternate,E);break;default:is(g,E,k,B,p)}i=i.sibling}}function To(n,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=n,l=i,p=l.flags;switch(l.tag){case 22:To(s,l),p&2048&&hf(l.alternate,l);break;case 24:To(s,l),p&2048&&pf(l.alternate,l);break;default:To(s,l)}i=i.sibling}}var No=8192;function as(n,i,s){if(n.subtreeFlags&No)for(n=n.child;n!==null;)Rb(n,i,s),n=n.sibling}function Rb(n,i,s){switch(n.tag){case 26:as(n,i,s),n.flags&No&&n.memoizedState!==null&&Aw(s,fr,n.memoizedState,n.memoizedProps);break;case 5:as(n,i,s);break;case 3:case 4:var l=fr;fr=Dc(n.stateNode.containerInfo),as(n,i,s),fr=l;break;case 22:n.memoizedState===null&&(l=n.alternate,l!==null&&l.memoizedState!==null?(l=No,No=16777216,as(n,i,s),No=l):as(n,i,s));break;default:as(n,i,s)}}function Ib(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 Co(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var l=i[s];nn=l,Db(l,n)}Ib(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Lb(n),n=n.sibling}function Lb(n){switch(n.tag){case 0:case 11:case 15:Co(n),n.flags&2048&&Ni(9,n,n.return);break;case 3:Co(n);break;case 12:Co(n);break;case 22:var i=n.stateNode;n.memoizedState!==null&&i._visibility&2&&(n.return===null||n.return.tag!==13)?(i._visibility&=-3,Sc(n)):Co(n);break;default:Co(n)}}function Sc(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var l=i[s];nn=l,Db(l,n)}Ib(n)}for(n=n.child;n!==null;){switch(i=n,i.tag){case 0:case 11:case 15:Ni(8,i,i.return),Sc(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,Sc(i));break;default:Sc(i)}n=n.sibling}}function Db(n,i){for(;nn!==null;){var s=nn;switch(s.tag){case 0:case 11:case 15:Ni(8,s,i);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var l=s.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:uo(s.memoizedState.cache)}if(l=s.child,l!==null)l.return=s,nn=l;else e:for(s=n;nn!==null;){l=nn;var p=l.sibling,g=l.return;if(kb(l),l===s){nn=null;break e}if(p!==null){p.return=g,nn=p;break e}nn=g}}}var G_={getCacheForType:function(n){var i=sn(Wt),s=i.data.get(n);return s===void 0&&(s=n(),i.data.set(n,s)),s},cacheSignal:function(){return sn(Wt).controller.signal}},K_=typeof WeakMap=="function"?WeakMap:Map,ht=0,Ct=null,et=null,at=0,yt=0,Kn=null,Ci=!1,ss=!1,mf=!1,Zr=0,Ht=0,Ai=0,ga=0,gf=0,Vn=0,os=0,Ao=null,Ln=null,bf=!1,_c=0,jb=0,wc=1/0,kc=null,Oi=null,tn=0,Mi=null,ls=null,Jr=0,yf=0,vf=null,zb=null,Oo=0,xf=null;function qn(){return(ht&2)!==0&&at!==0?at&-at:z.T!==null?Tf():La()}function Bb(){if(Vn===0)if((at&536870912)===0||ot){var n=Ia;Ia<<=1,(Ia&3932160)===0&&(Ia=262144),Vn=n}else Vn=536870912;return n=$n.current,n!==null&&(n.flags|=32),Vn}function Dn(n,i,s){(n===Ct&&(yt===2||yt===9)||n.cancelPendingCommit!==null)&&(cs(n,0),Ri(n,at,Vn,!1)),Nt(n,s),((ht&2)===0||n!==Ct)&&(n===Ct&&((ht&2)===0&&(ga|=s),Ht===4&&Ri(n,at,Vn,!1)),wr(n))}function Ub(n,i,s){if((ht&6)!==0)throw Error(a(327));var l=!s&&(i&127)===0&&(i&n.expiredLanes)===0||ce(n,i),p=l?Y_(n,i):Sf(n,i,!0),g=l;do{if(p===0){ss&&!l&&Ri(n,i,0,!1);break}else{if(s=n.current.alternate,g&&!V_(s)){p=Sf(n,i,!1),g=!1;continue}if(p===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;p=Ao;var B=k.current.memoizedState.isDehydrated;if(B&&(cs(k,E).flags|=256),E=Sf(k,E,!1),E!==2){if(mf&&!B){k.errorRecoveryDisabledLanes|=g,ga|=g,p=4;break e}g=Ln,Ln=p,g!==null&&(Ln===null?Ln=g:Ln.push.apply(Ln,g))}p=E}if(g=!1,p!==2)continue}}if(p===1){cs(n,0),Ri(n,i,0,!0);break}e:{switch(l=n,g=p,g){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:Ri(l,i,Vn,!Ci);break e;case 2:Ln=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(p=_c+300-he(),10<p)){if(Ri(l,i,Vn,!Ci),U(l,0,!0)!==0)break e;Jr=i,l.timeoutHandle=gy(Pb.bind(null,l,s,Ln,kc,bf,i,Vn,ga,os,Ci,g,"Throttled",-0,0),p);break e}Pb(l,s,Ln,kc,bf,i,Vn,ga,os,Ci,g,null,-0,0)}}break}while(!0);wr(n)}function Pb(n,i,s,l,p,g,E,k,B,X,ae,fe,ee,ne){if(n.timeoutHandle=-1,fe=i.subtreeFlags,fe&8192||(fe&16785408)===16785408){fe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:xe},Rb(i,g,fe);var ke=(g&62914560)===g?_c-he():(g&4194048)===g?jb-he():0;if(ke=Ow(fe,ke),ke!==null){Jr=g,n.cancelPendingCommit=ke(Yb.bind(null,n,i,g,s,l,p,E,k,B,ae,fe,null,ee,ne)),Ri(n,g,E,!X);return}}Yb(n,i,g,s,l,p,E,k,B)}function V_(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 l=0;l<s.length;l++){var p=s[l],g=p.getSnapshot;p=p.value;try{if(!Hn(g(),p))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 Ri(n,i,s,l){i&=~gf,i&=~ga,n.suspendedLanes|=i,n.pingedLanes&=~i,l&&(n.warmLanes|=i),l=n.expirationTimes;for(var p=i;0<p;){var g=31-mt(p),E=1<<g;l[g]=-1,p&=~E}s!==0&&_e(n,s,i)}function Tc(){return(ht&6)===0?(Mo(0),!1):!0}function Ef(){if(et!==null){if(yt===0)var n=et.return;else n=et,Hr=oa=null,jd(n),Qa=null,ho=0,n=et;for(;n!==null;)bb(n.alternate,n),n=n.return;et=null}}function cs(n,i){var s=n.timeoutHandle;s!==-1&&(n.timeoutHandle=-1,fw(s)),s=n.cancelPendingCommit,s!==null&&(n.cancelPendingCommit=null,s()),Jr=0,Ef(),Ct=n,et=s=Ur(n.current,null),at=i,yt=0,Kn=null,Ci=!1,ss=ce(n,i),mf=!1,os=Vn=gf=ga=Ai=Ht=0,Ln=Ao=null,bf=!1,(i&8)!==0&&(i|=i&32);var l=n.entangledLanes;if(l!==0)for(n=n.entanglements,l&=i;0<l;){var p=31-mt(l),g=1<<p;i|=n[p],l&=~g}return Zr=i,ql(),s}function Hb(n,i){qe=null,z.H=Eo,i===Ja||i===tc?(i=rg(),yt=3):i===wd?(i=rg(),yt=4):yt=i===Jd?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Kn=i,et===null&&(Ht=1,mc(n,er(i,n.current)))}function Fb(){var n=$n.current;return n===null?!0:(at&4194048)===at?ir===null:(at&62914560)===at||(at&536870912)!==0?n===ir:!1}function $b(){var n=z.H;return z.H=Eo,n===null?Eo:n}function Gb(){var n=z.A;return z.A=G_,n}function Nc(){Ht=4,Ci||(at&4194048)!==at&&$n.current!==null||(ss=!0),(Ai&134217727)===0&&(ga&134217727)===0||Ct===null||Ri(Ct,at,Vn,!1)}function Sf(n,i,s){var l=ht;ht|=2;var p=$b(),g=Gb();(Ct!==n||at!==i)&&(kc=null,cs(n,i)),i=!1;var E=Ht;e:do try{if(yt!==0&&et!==null){var k=et,B=Kn;switch(yt){case 8:Ef(),E=6;break e;case 3:case 2:case 9:case 6:$n.current===null&&(i=!0);var X=yt;if(yt=0,Kn=null,us(n,k,B,X),s&&ss){E=0;break e}break;default:X=yt,yt=0,Kn=null,us(n,k,B,X)}}q_(),E=Ht;break}catch(ae){Hb(n,ae)}while(!0);return i&&n.shellSuspendCounter++,Hr=oa=null,ht=l,z.H=p,z.A=g,et===null&&(Ct=null,at=0,ql()),E}function q_(){for(;et!==null;)Kb(et)}function Y_(n,i){var s=ht;ht|=2;var l=$b(),p=Gb();Ct!==n||at!==i?(kc=null,wc=he()+500,cs(n,i)):ss=ce(n,i);e:do try{if(yt!==0&&et!==null){i=et;var g=Kn;t:switch(yt){case 1:yt=0,Kn=null,us(n,i,g,1);break;case 2:case 9:if(tg(g)){yt=0,Kn=null,Vb(i);break}i=function(){yt!==2&&yt!==9||Ct!==n||(yt=7),wr(n)},g.then(i,i);break e;case 3:yt=7;break e;case 4:yt=5;break e;case 7:tg(g)?(yt=0,Kn=null,Vb(i)):(yt=0,Kn=null,us(n,i,g,7));break;case 5:var E=null;switch(et.tag){case 26:E=et.memoizedState;case 5:case 27:var k=et;if(E?My(E):k.stateNode.complete){yt=0,Kn=null;var B=k.sibling;if(B!==null)et=B;else{var X=k.return;X!==null?(et=X,Cc(X)):et=null}break t}}yt=0,Kn=null,us(n,i,g,5);break;case 6:yt=0,Kn=null,us(n,i,g,6);break;case 8:Ef(),Ht=6;break e;default:throw Error(a(462))}}W_();break}catch(ae){Hb(n,ae)}while(!0);return Hr=oa=null,z.H=l,z.A=p,ht=s,et!==null?0:(Ct=null,at=0,ql(),Ht)}function W_(){for(;et!==null&&!di();)Kb(et)}function Kb(n){var i=mb(n.alternate,n,Zr);n.memoizedProps=n.pendingProps,i===null?Cc(n):et=i}function Vb(n){var i=n,s=i.alternate;switch(i.tag){case 15:case 0:i=cb(s,i,i.pendingProps,i.type,void 0,at);break;case 11:i=cb(s,i,i.pendingProps,i.type.render,i.ref,at);break;case 5:jd(i);default:bb(s,i),i=et=Gm(i,Zr),i=mb(s,i,Zr)}n.memoizedProps=n.pendingProps,i===null?Cc(n):et=i}function us(n,i,s,l){Hr=oa=null,jd(i),Qa=null,ho=0;var p=i.return;try{if(z_(n,p,i,s,at)){Ht=1,mc(n,er(s,n.current)),et=null;return}}catch(g){if(p!==null)throw et=p,g;Ht=1,mc(n,er(s,n.current)),et=null;return}i.flags&32768?(ot||l===1?n=!0:ss||(at&536870912)!==0?n=!1:(Ci=n=!0,(l===2||l===9||l===3||l===6)&&(l=$n.current,l!==null&&l.tag===13&&(l.flags|=16384))),qb(i,n)):Cc(i)}function Cc(n){var i=n;do{if((i.flags&32768)!==0){qb(i,Ci);return}n=i.return;var s=P_(i.alternate,i,Zr);if(s!==null){et=s;return}if(i=i.sibling,i!==null){et=i;return}et=i=n}while(i!==null);Ht===0&&(Ht=5)}function qb(n,i){do{var s=H_(n.alternate,n);if(s!==null){s.flags&=32767,et=s;return}if(s=n.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(n=n.sibling,n!==null)){et=n;return}et=n=s}while(n!==null);Ht=6,et=null}function Yb(n,i,s,l,p,g,E,k,B){n.cancelPendingCommit=null;do Ac();while(tn!==0);if((ht&6)!==0)throw Error(a(327));if(i!==null){if(i===n.current)throw Error(a(177));if(g=i.lanes|i.childLanes,g|=cd,Te(n,s,g,E,k,B),n===Ct&&(et=Ct=null,at=0),ls=i,Mi=n,Jr=s,yf=g,vf=p,zb=l,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,Q_(Se,function(){return Qb(),null})):(n.callbackNode=null,n.callbackPriority=0),l=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||l){l=z.T,z.T=null,p=re.p,re.p=2,E=ht,ht|=4;try{F_(n,i,s)}finally{ht=E,re.p=p,z.T=l}}tn=1,Wb(),Xb(),Zb()}}function Wb(){if(tn===1){tn=0;var n=Mi,i=ls,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=z.T,z.T=null;var l=re.p;re.p=2;var p=ht;ht|=4;try{Ab(i,n);var g=Lf,E=Dm(n.containerInfo),k=g.focusedElem,B=g.selectionRange;if(E!==k&&k&&k.ownerDocument&&Lm(k.ownerDocument.documentElement,k)){if(B!==null&&id(k)){var X=B.start,ae=B.end;if(ae===void 0&&(ae=X),"selectionStart"in k)k.selectionStart=X,k.selectionEnd=Math.min(ae,k.value.length);else{var fe=k.ownerDocument||document,ee=fe&&fe.defaultView||window;if(ee.getSelection){var ne=ee.getSelection(),ke=k.textContent.length,De=Math.min(B.start,ke),wt=B.end===void 0?De:Math.min(B.end,ke);!ne.extend&&De>wt&&(E=wt,wt=De,De=E);var K=Im(k,De),H=Im(k,wt);if(K&&H&&(ne.rangeCount!==1||ne.anchorNode!==K.node||ne.anchorOffset!==K.offset||ne.focusNode!==H.node||ne.focusOffset!==H.offset)){var W=fe.createRange();W.setStart(K.node,K.offset),ne.removeAllRanges(),De>wt?(ne.addRange(W),ne.extend(H.node,H.offset)):(W.setEnd(H.node,H.offset),ne.addRange(W))}}}}for(fe=[],ne=k;ne=ne.parentNode;)ne.nodeType===1&&fe.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<fe.length;k++){var ue=fe[k];ue.element.scrollLeft=ue.left,ue.element.scrollTop=ue.top}}Hc=!!If,Lf=If=null}finally{ht=p,re.p=l,z.T=s}}n.current=i,tn=2}}function Xb(){if(tn===2){tn=0;var n=Mi,i=ls,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=z.T,z.T=null;var l=re.p;re.p=2;var p=ht;ht|=4;try{wb(n,i.alternate,i)}finally{ht=p,re.p=l,z.T=s}}tn=3}}function Zb(){if(tn===4||tn===3){tn=0,le();var n=Mi,i=ls,s=Jr,l=zb;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?tn=5:(tn=0,ls=Mi=null,Jb(n,n.pendingLanes));var p=n.pendingLanes;if(p===0&&(Oi=null),Lr(s),i=i.stateNode,Ut&&typeof Ut.onCommitFiberRoot=="function")try{Ut.onCommitFiberRoot(en,i,void 0,(i.current.flags&128)===128)}catch{}if(l!==null){i=z.T,p=re.p,re.p=2,z.T=null;try{for(var g=n.onRecoverableError,E=0;E<l.length;E++){var k=l[E];g(k.value,{componentStack:k.stack})}}finally{z.T=i,re.p=p}}(Jr&3)!==0&&Ac(),wr(n),p=n.pendingLanes,(s&261930)!==0&&(p&42)!==0?n===xf?Oo++:(Oo=0,xf=n):Oo=0,Mo(0)}}function Jb(n,i){(n.pooledCacheLanes&=i)===0&&(i=n.pooledCache,i!=null&&(n.pooledCache=null,uo(i)))}function Ac(){return Wb(),Xb(),Zb(),Qb()}function Qb(){if(tn!==5)return!1;var n=Mi,i=yf;yf=0;var s=Lr(Jr),l=z.T,p=re.p;try{re.p=32>s?32:s,z.T=null,s=vf,vf=null;var g=Mi,E=Jr;if(tn=0,ls=Mi=null,Jr=0,(ht&6)!==0)throw Error(a(331));var k=ht;if(ht|=4,Lb(g.current),Mb(g,g.current,E,s),ht=k,Mo(0,!1),Ut&&typeof Ut.onPostCommitFiberRoot=="function")try{Ut.onPostCommitFiberRoot(en,g)}catch{}return!0}finally{re.p=p,z.T=l,Jb(n,i)}}function ey(n,i,s){i=er(s,i),i=Zd(n.stateNode,i,2),n=wi(n,i,2),n!==null&&(Nt(n,2),wr(n))}function vt(n,i,s){if(n.tag===3)ey(n,n,s);else for(;i!==null;){if(i.tag===3){ey(i,n,s);break}else if(i.tag===1){var l=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Oi===null||!Oi.has(l))){n=er(s,n),s=tb(2),l=wi(i,s,2),l!==null&&(nb(s,l,i,n),Nt(l,2),wr(l));break}}i=i.return}}function _f(n,i,s){var l=n.pingCache;if(l===null){l=n.pingCache=new K_;var p=new Set;l.set(i,p)}else p=l.get(i),p===void 0&&(p=new Set,l.set(i,p));p.has(s)||(mf=!0,p.add(s),n=X_.bind(null,n,i,s),i.then(n,n))}function X_(n,i,s){var l=n.pingCache;l!==null&&l.delete(i),n.pingedLanes|=n.suspendedLanes&s,n.warmLanes&=~s,Ct===n&&(at&s)===s&&(Ht===4||Ht===3&&(at&62914560)===at&&300>he()-_c?(ht&2)===0&&cs(n,0):gf|=s,os===at&&(os=0)),wr(n)}function ty(n,i){i===0&&(i=He()),n=ia(n,i),n!==null&&(Nt(n,i),wr(n))}function Z_(n){var i=n.memoizedState,s=0;i!==null&&(s=i.retryLane),ty(n,s)}function J_(n,i){var s=0;switch(n.tag){case 31:case 13:var l=n.stateNode,p=n.memoizedState;p!==null&&(s=p.retryLane);break;case 19:l=n.stateNode;break;case 22:l=n.stateNode._retryCache;break;default:throw Error(a(314))}l!==null&&l.delete(i),ty(n,s)}function Q_(n,i){return Et(n,i)}var Oc=null,ds=null,wf=!1,Mc=!1,kf=!1,Ii=0;function wr(n){n!==ds&&n.next===null&&(ds===null?Oc=ds=n:ds=ds.next=n),Mc=!0,wf||(wf=!0,tw())}function Mo(n,i){if(!kf&&Mc){kf=!0;do for(var s=!1,l=Oc;l!==null;){if(n!==0){var p=l.pendingLanes;if(p===0)var g=0;else{var E=l.suspendedLanes,k=l.pingedLanes;g=(1<<31-mt(42|n)+1)-1,g&=p&~(E&~k),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(s=!0,ay(l,g))}else g=at,g=U(l,l===Ct?g:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(g&3)===0||ce(l,g)||(s=!0,ay(l,g));l=l.next}while(s);kf=!1}}function ew(){ny()}function ny(){Mc=wf=!1;var n=0;Ii!==0&&dw()&&(n=Ii);for(var i=he(),s=null,l=Oc;l!==null;){var p=l.next,g=ry(l,i);g===0?(l.next=null,s===null?Oc=p:s.next=p,p===null&&(ds=s)):(s=l,(n!==0||(g&3)!==0)&&(Mc=!0)),l=p}tn!==0&&tn!==5||Mo(n),Ii!==0&&(Ii=0)}function ry(n,i){for(var s=n.suspendedLanes,l=n.pingedLanes,p=n.expirationTimes,g=n.pendingLanes&-62914561;0<g;){var E=31-mt(g),k=1<<E,B=p[E];B===-1?((k&s)===0||(k&l)!==0)&&(p[E]=Ee(k,i)):B<=i&&(n.expiredLanes|=k),g&=~k}if(i=Ct,s=at,s=U(n,n===i?s:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),l=n.callbackNode,s===0||n===i&&(yt===2||yt===9)||n.cancelPendingCommit!==null)return l!==null&&l!==null&&yr(l),n.callbackNode=null,n.callbackPriority=0;if((s&3)===0||ce(n,s)){if(i=s&-s,i===n.callbackPriority)return i;switch(l!==null&&yr(l),Lr(s)){case 2:case 8:s=de;break;case 32:s=Se;break;case 268435456:s=rt;break;default:s=Se}return l=iy.bind(null,n),s=Et(s,l),n.callbackPriority=i,n.callbackNode=s,i}return l!==null&&l!==null&&yr(l),n.callbackPriority=2,n.callbackNode=null,2}function iy(n,i){if(tn!==0&&tn!==5)return n.callbackNode=null,n.callbackPriority=0,null;var s=n.callbackNode;if(Ac()&&n.callbackNode!==s)return null;var l=at;return l=U(n,n===Ct?l:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),l===0?null:(Ub(n,l,i),ry(n,he()),n.callbackNode!=null&&n.callbackNode===s?iy.bind(null,n):null)}function ay(n,i){if(Ac())return null;Ub(n,i,!0)}function tw(){hw(function(){(ht&6)!==0?Et(q,ew):ny()})}function Tf(){if(Ii===0){var n=Xa;n===0&&(n=Xi,Xi<<=1,(Xi&261888)===0&&(Xi=256)),Ii=n}return Ii}function sy(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:gi(""+n)}function oy(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 nw(n,i,s,l,p){if(i==="submit"&&s&&s.stateNode===p){var g=sy((p[fn]||null).action),E=l.submitter;E&&(i=(i=E[fn]||null)?sy(i.formAction):E.getAttribute("formAction"),i!==null&&(g=i,E=null));var k=new $l("action","action",null,l,p);n.push({event:k,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Ii!==0){var B=E?oy(p,E):new FormData(p);Kd(s,{pending:!0,data:B,method:p.method,action:g},null,B)}}else typeof g=="function"&&(k.preventDefault(),B=E?oy(p,E):new FormData(p),Kd(s,{pending:!0,data:B,method:p.method,action:g},g,B))},currentTarget:p}]})}}for(var Nf=0;Nf<ld.length;Nf++){var Cf=ld[Nf],rw=Cf.toLowerCase(),iw=Cf[0].toUpperCase()+Cf.slice(1);dr(rw,"on"+iw)}dr(Bm,"onAnimationEnd"),dr(Um,"onAnimationIteration"),dr(Pm,"onAnimationStart"),dr("dblclick","onDoubleClick"),dr("focusin","onFocus"),dr("focusout","onBlur"),dr(x_,"onTransitionRun"),dr(E_,"onTransitionStart"),dr(S_,"onTransitionCancel"),dr(Hm,"onTransitionEnd"),me("onMouseEnter",["mouseout","mouseover"]),me("onMouseLeave",["mouseout","mouseover"]),me("onPointerEnter",["pointerout","pointerover"]),me("onPointerLeave",["pointerout","pointerover"]),jr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),jr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),jr("onBeforeInput",["compositionend","keypress","textInput","paste"]),jr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),jr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),jr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ro="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(" "),aw=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ro));function ly(n,i){i=(i&4)!==0;for(var s=0;s<n.length;s++){var l=n[s],p=l.event;l=l.listeners;e:{var g=void 0;if(i)for(var E=l.length-1;0<=E;E--){var k=l[E],B=k.instance,X=k.currentTarget;if(k=k.listener,B!==g&&p.isPropagationStopped())break e;g=k,p.currentTarget=X;try{g(p)}catch(ae){Vl(ae)}p.currentTarget=null,g=B}else for(E=0;E<l.length;E++){if(k=l[E],B=k.instance,X=k.currentTarget,k=k.listener,B!==g&&p.isPropagationStopped())break e;g=k,p.currentTarget=X;try{g(p)}catch(ae){Vl(ae)}p.currentTarget=null,g=B}}}}function tt(n,i){var s=i[qs];s===void 0&&(s=i[qs]=new Set);var l=n+"__bubble";s.has(l)||(cy(i,n,2,!1),s.add(l))}function Af(n,i,s){var l=0;i&&(l|=4),cy(s,n,l,i)}var Rc="_reactListening"+Math.random().toString(36).slice(2);function Of(n){if(!n[Rc]){n[Rc]=!0,Dl.forEach(function(s){s!=="selectionchange"&&(aw.has(s)||Af(s,!1,n),Af(s,!0,n))});var i=n.nodeType===9?n:n.ownerDocument;i===null||i[Rc]||(i[Rc]=!0,Af("selectionchange",!1,i))}}function cy(n,i,s,l){switch(By(i)){case 2:var p=Iw;break;case 8:p=Lw;break;default:p=Kf}s=p.bind(null,i,s,n),p=void 0,!Wu||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(p=!0),l?p!==void 0?n.addEventListener(i,s,{capture:!0,passive:p}):n.addEventListener(i,s,!0):p!==void 0?n.addEventListener(i,s,{passive:p}):n.addEventListener(i,s,!1)}function Mf(n,i,s,l,p){var g=l;if((i&1)===0&&(i&2)===0&&l!==null)e:for(;;){if(l===null)return;var E=l.tag;if(E===3||E===4){var k=l.stateNode.containerInfo;if(k===p)break;if(E===4)for(E=l.return;E!==null;){var B=E.tag;if((B===3||B===4)&&E.stateNode.containerInfo===p)return;E=E.return}for(;k!==null;){if(E=yn(k),E===null)return;if(B=E.tag,B===5||B===6||B===26||B===27){l=g=E;continue e}k=k.parentNode}}l=l.return}Ul(function(){var X=g,ae=Ve(s),fe=[];e:{var ee=Fm.get(n);if(ee!==void 0){var ne=$l,ke=n;switch(n){case"keypress":if(Hl(s)===0)break e;case"keydown":case"keyup":ne=JS;break;case"focusin":ke="focus",ne=Qu;break;case"focusout":ke="blur",ne=Qu;break;case"beforeblur":case"afterblur":ne=Qu;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":ne=bm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=PS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=t_;break;case Bm:case Um:case Pm:ne=$S;break;case Hm:ne=r_;break;case"scroll":case"scrollend":ne=BS;break;case"wheel":ne=a_;break;case"copy":case"cut":case"paste":ne=KS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=vm;break;case"toggle":case"beforetoggle":ne=o_}var De=(i&4)!==0,wt=!De&&(n==="scroll"||n==="scrollend"),K=De?ee!==null?ee+"Capture":null:ee;De=[];for(var H=X,W;H!==null;){var ue=H;if(W=ue.stateNode,ue=ue.tag,ue!==5&&ue!==26&&ue!==27||W===null||K===null||(ue=Qs(H,K),ue!=null&&De.push(Io(H,ue,W))),wt)break;H=H.return}0<De.length&&(ee=new ne(ee,ke,null,s,ae),fe.push({event:ee,listeners:De}))}}if((i&7)===0){e:{if(ee=n==="mouseover"||n==="pointerover",ne=n==="mouseout"||n==="pointerout",ee&&s!==Ce&&(ke=s.relatedTarget||s.fromElement)&&(yn(ke)||ke[fi]))break e;if((ne||ee)&&(ee=ae.window===ae?ae:(ee=ae.ownerDocument)?ee.defaultView||ee.parentWindow:window,ne?(ke=s.relatedTarget||s.toElement,ne=X,ke=ke?yn(ke):null,ke!==null&&(wt=c(ke),De=ke.tag,ke!==wt||De!==5&&De!==27&&De!==6)&&(ke=null)):(ne=null,ke=X),ne!==ke)){if(De=bm,ue="onMouseLeave",K="onMouseEnter",H="mouse",(n==="pointerout"||n==="pointerover")&&(De=vm,ue="onPointerLeave",K="onPointerEnter",H="pointer"),wt=ne==null?ee:hi(ne),W=ke==null?ee:hi(ke),ee=new De(ue,H+"leave",ne,s,ae),ee.target=wt,ee.relatedTarget=W,ue=null,yn(ae)===X&&(De=new De(K,H+"enter",ke,s,ae),De.target=W,De.relatedTarget=wt,ue=De),wt=ue,ne&&ke)t:{for(De=sw,K=ne,H=ke,W=0,ue=K;ue;ue=De(ue))W++;ue=0;for(var Re=H;Re;Re=De(Re))ue++;for(;0<W-ue;)K=De(K),W--;for(;0<ue-W;)H=De(H),ue--;for(;W--;){if(K===H||H!==null&&K===H.alternate){De=K;break t}K=De(K),H=De(H)}De=null}else De=null;ne!==null&&uy(fe,ee,ne,De,!1),ke!==null&&wt!==null&&uy(fe,wt,ke,De,!0)}}e:{if(ee=X?hi(X):window,ne=ee.nodeName&&ee.nodeName.toLowerCase(),ne==="select"||ne==="input"&&ee.type==="file")var ut=Nm;else if(km(ee))if(Cm)ut=b_;else{ut=m_;var Ae=p_}else ne=ee.nodeName,!ne||ne.toLowerCase()!=="input"||ee.type!=="checkbox"&&ee.type!=="radio"?X&&mi(X.elementType)&&(ut=Nm):ut=g_;if(ut&&(ut=ut(n,X))){Tm(fe,ut,s,ae);break e}Ae&&Ae(n,ee,X),n==="focusout"&&X&&ee.type==="number"&&X.memoizedProps.value!=null&&Ua(ee,"number",ee.value)}switch(Ae=X?hi(X):window,n){case"focusin":(km(Ae)||Ae.contentEditable==="true")&&(Fa=Ae,ad=X,oo=null);break;case"focusout":oo=ad=Fa=null;break;case"mousedown":sd=!0;break;case"contextmenu":case"mouseup":case"dragend":sd=!1,jm(fe,s,ae);break;case"selectionchange":if(v_)break;case"keydown":case"keyup":jm(fe,s,ae)}var We;if(td)e:{switch(n){case"compositionstart":var st="onCompositionStart";break e;case"compositionend":st="onCompositionEnd";break e;case"compositionupdate":st="onCompositionUpdate";break e}st=void 0}else Ha?_m(n,s)&&(st="onCompositionEnd"):n==="keydown"&&s.keyCode===229&&(st="onCompositionStart");st&&(xm&&s.locale!=="ko"&&(Ha||st!=="onCompositionStart"?st==="onCompositionEnd"&&Ha&&(We=mm()):(bi=ae,Xu="value"in bi?bi.value:bi.textContent,Ha=!0)),Ae=Ic(X,st),0<Ae.length&&(st=new ym(st,n,null,s,ae),fe.push({event:st,listeners:Ae}),We?st.data=We:(We=wm(s),We!==null&&(st.data=We)))),(We=c_?u_(n,s):d_(n,s))&&(st=Ic(X,"onBeforeInput"),0<st.length&&(Ae=new ym("onBeforeInput","beforeinput",null,s,ae),fe.push({event:Ae,listeners:st}),Ae.data=We)),nw(fe,n,X,s,ae)}ly(fe,i)})}function Io(n,i,s){return{instance:n,listener:i,currentTarget:s}}function Ic(n,i){for(var s=i+"Capture",l=[];n!==null;){var p=n,g=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||g===null||(p=Qs(n,s),p!=null&&l.unshift(Io(n,p,g)),p=Qs(n,i),p!=null&&l.push(Io(n,p,g))),n.tag===3)return l;n=n.return}return[]}function sw(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function uy(n,i,s,l,p){for(var g=i._reactName,E=[];s!==null&&s!==l;){var k=s,B=k.alternate,X=k.stateNode;if(k=k.tag,B!==null&&B===l)break;k!==5&&k!==26&&k!==27||X===null||(B=X,p?(X=Qs(s,g),X!=null&&E.unshift(Io(s,X,B))):p||(X=Qs(s,g),X!=null&&E.push(Io(s,X,B)))),s=s.return}E.length!==0&&n.push({event:i,listeners:E})}var ow=/\r\n?/g,lw=/\u0000|\uFFFD/g;function dy(n){return(typeof n=="string"?n:""+n).replace(ow,`
|
|
49
|
-
`).replace(lw,"")}function fy(n,i){return i=dy(i),dy(n)===i}function _t(n,i,s,l,p,g){switch(s){case"children":typeof l=="string"?i==="body"||i==="textarea"&&l===""||je(n,l):(typeof l=="number"||typeof l=="bigint")&&i!=="body"&&je(n,""+l);break;case"className":Un(n,"class",l);break;case"tabIndex":Un(n,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Un(n,s,l);break;case"style":bt(n,l,g);break;case"data":if(i!=="object"){Un(n,"data",l);break}case"src":case"href":if(l===""&&(i!=="a"||s!=="href")){n.removeAttribute(s);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){n.removeAttribute(s);break}l=gi(""+l),n.setAttribute(s,l);break;case"action":case"formAction":if(typeof l=="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"&&_t(n,i,"name",p.name,p,null),_t(n,i,"formEncType",p.formEncType,p,null),_t(n,i,"formMethod",p.formMethod,p,null),_t(n,i,"formTarget",p.formTarget,p,null)):(_t(n,i,"encType",p.encType,p,null),_t(n,i,"method",p.method,p,null),_t(n,i,"target",p.target,p,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){n.removeAttribute(s);break}l=gi(""+l),n.setAttribute(s,l);break;case"onClick":l!=null&&(n.onclick=xe);break;case"onScroll":l!=null&&tt("scroll",n);break;case"onScrollEnd":l!=null&&tt("scrollend",n);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(a(61));if(s=l.__html,s!=null){if(p.children!=null)throw Error(a(60));n.innerHTML=s}}break;case"multiple":n.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":n.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){n.removeAttribute("xlink:href");break}s=gi(""+l),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":l!=null&&typeof l!="function"&&typeof l!="symbol"?n.setAttribute(s,""+l):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":l&&typeof l!="function"&&typeof l!="symbol"?n.setAttribute(s,""):n.removeAttribute(s);break;case"capture":case"download":l===!0?n.setAttribute(s,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?n.setAttribute(s,l):n.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?n.setAttribute(s,l):n.removeAttribute(s);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?n.removeAttribute(s):n.setAttribute(s,l);break;case"popover":tt("beforetoggle",n),tt("toggle",n),hn(n,"popover",l);break;case"xlinkActuate":Cn(n,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Cn(n,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Cn(n,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Cn(n,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Cn(n,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Cn(n,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Cn(n,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Cn(n,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Cn(n,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":hn(n,"is",l);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=zr.get(s)||s,hn(n,s,l))}}function Rf(n,i,s,l,p,g){switch(s){case"style":bt(n,l,g);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(a(61));if(s=l.__html,s!=null){if(p.children!=null)throw Error(a(60));n.innerHTML=s}}break;case"children":typeof l=="string"?je(n,l):(typeof l=="number"||typeof l=="bigint")&&je(n,""+l);break;case"onScroll":l!=null&&tt("scroll",n);break;case"onScrollEnd":l!=null&&tt("scrollend",n);break;case"onClick":l!=null&&(n.onclick=xe);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Qi.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(p=s.endsWith("Capture"),i=s.slice(2,p?s.length-7:void 0),g=n[fn]||null,g=g!=null?g[s]:null,typeof g=="function"&&n.removeEventListener(i,g,p),typeof l=="function")){typeof g!="function"&&g!==null&&(s in n?n[s]=null:n.hasAttribute(s)&&n.removeAttribute(s)),n.addEventListener(i,l,p);break e}s in n?n[s]=l:l===!0?n.setAttribute(s,""):hn(n,s,l)}}}function ln(n,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":tt("error",n),tt("load",n);var l=!1,p=!1,g;for(g in s)if(s.hasOwnProperty(g)){var E=s[g];if(E!=null)switch(g){case"src":l=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:_t(n,i,g,E,s,null)}}p&&_t(n,i,"srcSet",s.srcSet,s,null),l&&_t(n,i,"src",s.src,s,null);return;case"input":tt("invalid",n);var k=g=E=p=null,B=null,X=null;for(l in s)if(s.hasOwnProperty(l)){var ae=s[l];if(ae!=null)switch(l){case"name":p=ae;break;case"type":E=ae;break;case"checked":B=ae;break;case"defaultChecked":X=ae;break;case"value":g=ae;break;case"defaultValue":k=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(a(137,i));break;default:_t(n,i,l,ae,s,null)}}ea(n,g,k,B,X,E,p,!1);return;case"select":tt("invalid",n),l=E=g=null;for(p in s)if(s.hasOwnProperty(p)&&(k=s[p],k!=null))switch(p){case"value":g=k;break;case"defaultValue":E=k;break;case"multiple":l=k;default:_t(n,i,p,k,s,null)}i=g,s=E,n.multiple=!!l,i!=null?rn(n,!!l,i,!1):s!=null&&rn(n,!!l,s,!0);return;case"textarea":tt("invalid",n),g=p=l=null;for(E in s)if(s.hasOwnProperty(E)&&(k=s[E],k!=null))switch(E){case"value":l=k;break;case"defaultValue":p=k;break;case"children":g=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(a(91));break;default:_t(n,i,E,k,s,null)}Pa(n,l,p,g);return;case"option":for(B in s)if(s.hasOwnProperty(B)&&(l=s[B],l!=null))switch(B){case"selected":n.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:_t(n,i,B,l,s,null)}return;case"dialog":tt("beforetoggle",n),tt("toggle",n),tt("cancel",n),tt("close",n);break;case"iframe":case"object":tt("load",n);break;case"video":case"audio":for(l=0;l<Ro.length;l++)tt(Ro[l],n);break;case"image":tt("error",n),tt("load",n);break;case"details":tt("toggle",n);break;case"embed":case"source":case"link":tt("error",n),tt("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(X in s)if(s.hasOwnProperty(X)&&(l=s[X],l!=null))switch(X){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:_t(n,i,X,l,s,null)}return;default:if(mi(i)){for(ae in s)s.hasOwnProperty(ae)&&(l=s[ae],l!==void 0&&Rf(n,i,ae,l,s,void 0));return}}for(k in s)s.hasOwnProperty(k)&&(l=s[k],l!=null&&_t(n,i,k,l,s,null))}function cw(n,i,s,l){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,g=null,E=null,k=null,B=null,X=null,ae=null;for(ne in s){var fe=s[ne];if(s.hasOwnProperty(ne)&&fe!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":B=fe;default:l.hasOwnProperty(ne)||_t(n,i,ne,null,l,fe)}}for(var ee in l){var ne=l[ee];if(fe=s[ee],l.hasOwnProperty(ee)&&(ne!=null||fe!=null))switch(ee){case"type":g=ne;break;case"name":p=ne;break;case"checked":X=ne;break;case"defaultChecked":ae=ne;break;case"value":E=ne;break;case"defaultValue":k=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(a(137,i));break;default:ne!==fe&&_t(n,i,ee,ne,l,fe)}}Xs(n,E,k,B,X,ae,g,p);return;case"select":ne=E=k=ee=null;for(g in s)if(B=s[g],s.hasOwnProperty(g)&&B!=null)switch(g){case"value":break;case"multiple":ne=B;default:l.hasOwnProperty(g)||_t(n,i,g,null,l,B)}for(p in l)if(g=l[p],B=s[p],l.hasOwnProperty(p)&&(g!=null||B!=null))switch(p){case"value":ee=g;break;case"defaultValue":k=g;break;case"multiple":E=g;default:g!==B&&_t(n,i,p,g,l,B)}i=k,s=E,l=ne,ee!=null?rn(n,!!s,ee,!1):!!l!=!!s&&(i!=null?rn(n,!!s,i,!0):rn(n,!!s,s?[]:"",!1));return;case"textarea":ne=ee=null;for(k in s)if(p=s[k],s.hasOwnProperty(k)&&p!=null&&!l.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:_t(n,i,k,null,l,p)}for(E in l)if(p=l[E],g=s[E],l.hasOwnProperty(E)&&(p!=null||g!=null))switch(E){case"value":ee=p;break;case"defaultValue":ne=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==g&&_t(n,i,E,p,l,g)}zl(n,ee,ne);return;case"option":for(var ke in s)if(ee=s[ke],s.hasOwnProperty(ke)&&ee!=null&&!l.hasOwnProperty(ke))switch(ke){case"selected":n.selected=!1;break;default:_t(n,i,ke,null,l,ee)}for(B in l)if(ee=l[B],ne=s[B],l.hasOwnProperty(B)&&ee!==ne&&(ee!=null||ne!=null))switch(B){case"selected":n.selected=ee&&typeof ee!="function"&&typeof ee!="symbol";break;default:_t(n,i,B,ee,l,ne)}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 De in s)ee=s[De],s.hasOwnProperty(De)&&ee!=null&&!l.hasOwnProperty(De)&&_t(n,i,De,null,l,ee);for(X in l)if(ee=l[X],ne=s[X],l.hasOwnProperty(X)&&ee!==ne&&(ee!=null||ne!=null))switch(X){case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(a(137,i));break;default:_t(n,i,X,ee,l,ne)}return;default:if(mi(i)){for(var wt in s)ee=s[wt],s.hasOwnProperty(wt)&&ee!==void 0&&!l.hasOwnProperty(wt)&&Rf(n,i,wt,void 0,l,ee);for(ae in l)ee=l[ae],ne=s[ae],!l.hasOwnProperty(ae)||ee===ne||ee===void 0&&ne===void 0||Rf(n,i,ae,ee,l,ne);return}}for(var K in s)ee=s[K],s.hasOwnProperty(K)&&ee!=null&&!l.hasOwnProperty(K)&&_t(n,i,K,null,l,ee);for(fe in l)ee=l[fe],ne=s[fe],!l.hasOwnProperty(fe)||ee===ne||ee==null&&ne==null||_t(n,i,fe,ee,l,ne)}function hy(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function uw(){if(typeof performance.getEntriesByType=="function"){for(var n=0,i=0,s=performance.getEntriesByType("resource"),l=0;l<s.length;l++){var p=s[l],g=p.transferSize,E=p.initiatorType,k=p.duration;if(g&&k&&hy(E)){for(E=0,k=p.responseEnd,l+=1;l<s.length;l++){var B=s[l],X=B.startTime;if(X>k)break;var ae=B.transferSize,fe=B.initiatorType;ae&&hy(fe)&&(B=B.responseEnd,E+=ae*(B<k?1:(k-X)/(B-X)))}if(--l,i+=8*(g+E)/(p.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 If=null,Lf=null;function Lc(n){return n.nodeType===9?n:n.ownerDocument}function py(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 my(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 Df(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 jf=null;function dw(){var n=window.event;return n&&n.type==="popstate"?n===jf?!1:(jf=n,!0):(jf=null,!1)}var gy=typeof setTimeout=="function"?setTimeout:void 0,fw=typeof clearTimeout=="function"?clearTimeout:void 0,by=typeof Promise=="function"?Promise:void 0,hw=typeof queueMicrotask=="function"?queueMicrotask:typeof by<"u"?function(n){return by.resolve(null).then(n).catch(pw)}:gy;function pw(n){setTimeout(function(){throw n})}function Li(n){return n==="head"}function yy(n,i){var s=i,l=0;do{var p=s.nextSibling;if(n.removeChild(s),p&&p.nodeType===8)if(s=p.data,s==="/$"||s==="/&"){if(l===0){n.removeChild(p),ms(i);return}l--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")l++;else if(s==="html")Lo(n.ownerDocument.documentElement);else if(s==="head"){s=n.ownerDocument.head,Lo(s);for(var g=s.firstChild;g;){var E=g.nextSibling,k=g.nodeName;g[Ji]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&g.rel.toLowerCase()==="stylesheet"||s.removeChild(g),g=E}}else s==="body"&&Lo(n.ownerDocument.body);s=p}while(s);ms(i)}function vy(n,i){var s=n;n=0;do{var l=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||""),l&&l.nodeType===8)if(s=l.data,s==="/$"){if(n===0)break;n--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||n++;s=l}while(s)}function zf(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":zf(s),Ys(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}n.removeChild(s)}}function mw(n,i,s,l){for(;n.nodeType===1;){var p=s;if(n.nodeName.toLowerCase()!==i.toLowerCase()){if(!l&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(l){if(!n[Ji])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!==p.rel||n.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||n.getAttribute("title")!==(p.title==null?null:p.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(g=n.getAttribute("src"),(g!==(p.src==null?null:p.src)||n.getAttribute("type")!==(p.type==null?null:p.type)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&g&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(i==="input"&&n.type==="hidden"){var g=p.name==null?null:""+p.name;if(p.type==="hidden"&&n.getAttribute("name")===g)return n}else return n;if(n=ar(n.nextSibling),n===null)break}return null}function gw(n,i,s){if(i==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!s||(n=ar(n.nextSibling),n===null))return null;return n}function xy(n,i){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=ar(n.nextSibling),n===null))return null;return n}function Bf(n){return n.data==="$?"||n.data==="$~"}function Uf(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function bw(n,i){var s=n.ownerDocument;if(n.data==="$~")n._reactRetry=i;else if(n.data!=="$?"||s.readyState!=="loading")i();else{var l=function(){i(),s.removeEventListener("DOMContentLoaded",l)};s.addEventListener("DOMContentLoaded",l),n._reactRetry=l}}function ar(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 Pf=null;function Ey(n){n=n.nextSibling;for(var i=0;n;){if(n.nodeType===8){var s=n.data;if(s==="/$"||s==="/&"){if(i===0)return ar(n.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}n=n.nextSibling}return null}function Sy(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 _y(n,i,s){switch(i=Lc(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 Lo(n){for(var i=n.attributes;i.length;)n.removeAttributeNode(i[0]);Ys(n)}var sr=new Map,wy=new Set;function Dc(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Qr=re.d;re.d={f:yw,r:vw,D:xw,C:Ew,L:Sw,m:_w,X:kw,S:ww,M:Tw};function yw(){var n=Qr.f(),i=Tc();return n||i}function vw(n){var i=Dr(n);i!==null&&i.tag===5&&i.type==="form"?Hg(i):Qr.r(n)}var fs=typeof document>"u"?null:document;function ky(n,i,s){var l=fs;if(l&&typeof i=="string"&&i){var p=An(i);p='link[rel="'+n+'"][href="'+p+'"]',typeof s=="string"&&(p+='[crossorigin="'+s+'"]'),wy.has(p)||(wy.add(p),n={rel:n,crossOrigin:s,href:i},l.querySelector(p)===null&&(i=l.createElement("link"),ln(i,"link",n),qt(i),l.head.appendChild(i)))}}function xw(n){Qr.D(n),ky("dns-prefetch",n,null)}function Ew(n,i){Qr.C(n,i),ky("preconnect",n,i)}function Sw(n,i,s){Qr.L(n,i,s);var l=fs;if(l&&n&&i){var p='link[rel="preload"][as="'+An(i)+'"]';i==="image"&&s&&s.imageSrcSet?(p+='[imagesrcset="'+An(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(p+='[imagesizes="'+An(s.imageSizes)+'"]')):p+='[href="'+An(n)+'"]';var g=p;switch(i){case"style":g=hs(n);break;case"script":g=ps(n)}sr.has(g)||(n=y({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:n,as:i},s),sr.set(g,n),l.querySelector(p)!==null||i==="style"&&l.querySelector(Do(g))||i==="script"&&l.querySelector(jo(g))||(i=l.createElement("link"),ln(i,"link",n),qt(i),l.head.appendChild(i)))}}function _w(n,i){Qr.m(n,i);var s=fs;if(s&&n){var l=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+An(l)+'"][href="'+An(n)+'"]',g=p;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=ps(n)}if(!sr.has(g)&&(n=y({rel:"modulepreload",href:n},i),sr.set(g,n),s.querySelector(p)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(jo(g)))return}l=s.createElement("link"),ln(l,"link",n),qt(l),s.head.appendChild(l)}}}function ww(n,i,s){Qr.S(n,i,s);var l=fs;if(l&&n){var p=pi(l).hoistableStyles,g=hs(n);i=i||"default";var E=p.get(g);if(!E){var k={loading:0,preload:null};if(E=l.querySelector(Do(g)))k.loading=5;else{n=y({rel:"stylesheet",href:n,"data-precedence":i},s),(s=sr.get(g))&&Hf(n,s);var B=E=l.createElement("link");qt(B),ln(B,"link",n),B._p=new Promise(function(X,ae){B.onload=X,B.onerror=ae}),B.addEventListener("load",function(){k.loading|=1}),B.addEventListener("error",function(){k.loading|=2}),k.loading|=4,jc(E,i,l)}E={type:"stylesheet",instance:E,count:1,state:k},p.set(g,E)}}}function kw(n,i){Qr.X(n,i);var s=fs;if(s&&n){var l=pi(s).hoistableScripts,p=ps(n),g=l.get(p);g||(g=s.querySelector(jo(p)),g||(n=y({src:n,async:!0},i),(i=sr.get(p))&&Ff(n,i),g=s.createElement("script"),qt(g),ln(g,"link",n),s.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},l.set(p,g))}}function Tw(n,i){Qr.M(n,i);var s=fs;if(s&&n){var l=pi(s).hoistableScripts,p=ps(n),g=l.get(p);g||(g=s.querySelector(jo(p)),g||(n=y({src:n,async:!0,type:"module"},i),(i=sr.get(p))&&Ff(n,i),g=s.createElement("script"),qt(g),ln(g,"link",n),s.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},l.set(p,g))}}function Ty(n,i,s,l){var p=(p=we.current)?Dc(p):null;if(!p)throw Error(a(446));switch(n){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(i=hs(s.href),s=pi(p).hoistableStyles,l=s.get(i),l||(l={type:"style",instance:null,count:0,state:null},s.set(i,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){n=hs(s.href);var g=pi(p).hoistableStyles,E=g.get(n);if(E||(p=p.ownerDocument||p,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(n,E),(g=p.querySelector(Do(n)))&&!g._p&&(E.instance=g,E.state.loading=5),sr.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},sr.set(n,s),g||Nw(p,n,s,E.state))),i&&l===null)throw Error(a(528,""));return E}if(i&&l!==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=ps(s),s=pi(p).hoistableScripts,l=s.get(i),l||(l={type:"script",instance:null,count:0,state:null},s.set(i,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,n))}}function hs(n){return'href="'+An(n)+'"'}function Do(n){return'link[rel="stylesheet"]['+n+"]"}function Ny(n){return y({},n,{"data-precedence":n.precedence,precedence:null})}function Nw(n,i,s,l){n.querySelector('link[rel="preload"][as="style"]['+i+"]")?l.loading=1:(i=n.createElement("link"),l.preload=i,i.addEventListener("load",function(){return l.loading|=1}),i.addEventListener("error",function(){return l.loading|=2}),ln(i,"link",s),qt(i),n.head.appendChild(i))}function ps(n){return'[src="'+An(n)+'"]'}function jo(n){return"script[async]"+n}function Cy(n,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var l=n.querySelector('style[data-href~="'+An(s.href)+'"]');if(l)return i.instance=l,qt(l),l;var p=y({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return l=(n.ownerDocument||n).createElement("style"),qt(l),ln(l,"style",p),jc(l,s.precedence,n),i.instance=l;case"stylesheet":p=hs(s.href);var g=n.querySelector(Do(p));if(g)return i.state.loading|=4,i.instance=g,qt(g),g;l=Ny(s),(p=sr.get(p))&&Hf(l,p),g=(n.ownerDocument||n).createElement("link"),qt(g);var E=g;return E._p=new Promise(function(k,B){E.onload=k,E.onerror=B}),ln(g,"link",l),i.state.loading|=4,jc(g,s.precedence,n),i.instance=g;case"script":return g=ps(s.src),(p=n.querySelector(jo(g)))?(i.instance=p,qt(p),p):(l=s,(p=sr.get(g))&&(l=y({},s),Ff(l,p)),n=n.ownerDocument||n,p=n.createElement("script"),qt(p),ln(p,"link",l),n.head.appendChild(p),i.instance=p);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(l=i.instance,i.state.loading|=4,jc(l,s.precedence,n));return i.instance}function jc(n,i,s){for(var l=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=l.length?l[l.length-1]:null,g=p,E=0;E<l.length;E++){var k=l[E];if(k.dataset.precedence===i)g=k;else if(g!==p)break}g?g.parentNode.insertBefore(n,g.nextSibling):(i=s.nodeType===9?s.head:s,i.insertBefore(n,i.firstChild))}function Hf(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.title==null&&(n.title=i.title)}function Ff(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.integrity==null&&(n.integrity=i.integrity)}var zc=null;function Ay(n,i,s){if(zc===null){var l=new Map,p=zc=new Map;p.set(s,l)}else p=zc,l=p.get(s),l||(l=new Map,p.set(s,l));if(l.has(n))return l;for(l.set(n,null),s=s.getElementsByTagName(n),p=0;p<s.length;p++){var g=s[p];if(!(g[Ji]||g[$t]||n==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var E=g.getAttribute(i)||"";E=n+E;var k=l.get(E);k?k.push(g):l.set(E,[g])}}return l}function Oy(n,i,s){n=n.ownerDocument||n,n.head.insertBefore(s,i==="title"?n.querySelector("head > title"):null)}function Cw(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 My(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function Aw(n,i,s,l){if(s.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var p=hs(l.href),g=i.querySelector(Do(p));if(g){i=g._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(n.count++,n=Bc.bind(n),i.then(n,n)),s.state.loading|=4,s.instance=g,qt(g);return}g=i.ownerDocument||i,l=Ny(l),(p=sr.get(p))&&Hf(l,p),g=g.createElement("link"),qt(g);var E=g;E._p=new Promise(function(k,B){E.onload=k,E.onerror=B}),ln(g,"link",l),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=Bc.bind(n),i.addEventListener("load",s),i.addEventListener("error",s))}}var $f=0;function Ow(n,i){return n.stylesheets&&n.count===0&&Pc(n,n.stylesheets),0<n.count||0<n.imgCount?function(s){var l=setTimeout(function(){if(n.stylesheets&&Pc(n,n.stylesheets),n.unsuspend){var g=n.unsuspend;n.unsuspend=null,g()}},6e4+i);0<n.imgBytes&&$f===0&&($f=62500*uw());var p=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Pc(n,n.stylesheets),n.unsuspend)){var g=n.unsuspend;n.unsuspend=null,g()}},(n.imgBytes>$f?50:800)+i);return n.unsuspend=s,function(){n.unsuspend=null,clearTimeout(l),clearTimeout(p)}}:null}function Bc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Pc(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Uc=null;function Pc(n,i){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Uc=new Map,i.forEach(Mw,n),Uc=null,Bc.call(n))}function Mw(n,i){if(!(i.state.loading&4)){var s=Uc.get(n);if(s)var l=s.get(null);else{s=new Map,Uc.set(n,s);for(var p=n.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<p.length;g++){var E=p[g];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(s.set(E.dataset.precedence,E),l=E)}l&&s.set(null,l)}p=i.instance,E=p.getAttribute("data-precedence"),g=s.get(E)||l,g===l&&s.set(null,p),s.set(E,p),this.count++,l=Bc.bind(this),p.addEventListener("load",l),p.addEventListener("error",l),g?g.parentNode.insertBefore(p,g.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(p,n.firstChild)),i.state.loading|=4}}var zo={$$typeof:R,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function Rw(n,i,s,l,p,g,E,k,B){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=It(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=It(0),this.hiddenUpdates=It(null),this.identifierPrefix=l,this.onUncaughtError=p,this.onCaughtError=g,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=B,this.incompleteTransitions=new Map}function Ry(n,i,s,l,p,g,E,k,B,X,ae,fe){return n=new Rw(n,i,s,E,B,X,ae,fe,k),i=1,g===!0&&(i|=24),g=Fn(3,null,null,i),n.current=g,g.stateNode=n,i=Ed(),i.refCount++,n.pooledCache=i,i.refCount++,g.memoizedState={element:l,isDehydrated:s,cache:i},kd(g),n}function Iy(n){return n?(n=Ka,n):Ka}function Ly(n,i,s,l,p,g){p=Iy(p),l.context===null?l.context=p:l.pendingContext=p,l=_i(i),l.payload={element:s},g=g===void 0?null:g,g!==null&&(l.callback=g),s=wi(n,l,i),s!==null&&(Dn(s,n,i),mo(s,n,i))}function Dy(n,i){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var s=n.retryLane;n.retryLane=s!==0&&s<i?s:i}}function Gf(n,i){Dy(n,i),(n=n.alternate)&&Dy(n,i)}function jy(n){if(n.tag===13||n.tag===31){var i=ia(n,67108864);i!==null&&Dn(i,n,67108864),Gf(n,67108864)}}function zy(n){if(n.tag===13||n.tag===31){var i=qn();i=jt(i);var s=ia(n,i);s!==null&&Dn(s,n,i),Gf(n,i)}}var Hc=!0;function Iw(n,i,s,l){var p=z.T;z.T=null;var g=re.p;try{re.p=2,Kf(n,i,s,l)}finally{re.p=g,z.T=p}}function Lw(n,i,s,l){var p=z.T;z.T=null;var g=re.p;try{re.p=8,Kf(n,i,s,l)}finally{re.p=g,z.T=p}}function Kf(n,i,s,l){if(Hc){var p=Vf(l);if(p===null)Mf(n,i,l,Fc,s),Uy(n,l);else if(jw(p,n,i,s,l))l.stopPropagation();else if(Uy(n,l),i&4&&-1<Dw.indexOf(n)){for(;p!==null;){var g=Dr(p);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var E=Nn(g.pendingLanes);if(E!==0){var k=g;for(k.pendingLanes|=2,k.entangledLanes|=2;E;){var B=1<<31-mt(E);k.entanglements[1]|=B,E&=~B}wr(g),(ht&6)===0&&(wc=he()+500,Mo(0))}}break;case 31:case 13:k=ia(g,2),k!==null&&Dn(k,g,2),Tc(),Gf(g,2)}if(g=Vf(l),g===null&&Mf(n,i,l,Fc,s),g===p)break;p=g}p!==null&&l.stopPropagation()}else Mf(n,i,l,null,s)}}function Vf(n){return n=Ve(n),qf(n)}var Fc=null;function qf(n){if(Fc=null,n=yn(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=f(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 Fc=n,null}function By(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(Ie()){case q:return 2;case de:return 8;case Se:case ze:return 32;case rt:return 268435456;default:return 32}default:return 32}}var Yf=!1,Di=null,ji=null,zi=null,Bo=new Map,Uo=new Map,Bi=[],Dw="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 Uy(n,i){switch(n){case"focusin":case"focusout":Di=null;break;case"dragenter":case"dragleave":ji=null;break;case"mouseover":case"mouseout":zi=null;break;case"pointerover":case"pointerout":Bo.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Uo.delete(i.pointerId)}}function Po(n,i,s,l,p,g){return n===null||n.nativeEvent!==g?(n={blockedOn:i,domEventName:s,eventSystemFlags:l,nativeEvent:g,targetContainers:[p]},i!==null&&(i=Dr(i),i!==null&&jy(i)),n):(n.eventSystemFlags|=l,i=n.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),n)}function jw(n,i,s,l,p){switch(i){case"focusin":return Di=Po(Di,n,i,s,l,p),!0;case"dragenter":return ji=Po(ji,n,i,s,l,p),!0;case"mouseover":return zi=Po(zi,n,i,s,l,p),!0;case"pointerover":var g=p.pointerId;return Bo.set(g,Po(Bo.get(g)||null,n,i,s,l,p)),!0;case"gotpointercapture":return g=p.pointerId,Uo.set(g,Po(Uo.get(g)||null,n,i,s,l,p)),!0}return!1}function Py(n){var i=yn(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,Da(n.priority,function(){zy(s)});return}}else if(i===31){if(i=f(s),i!==null){n.blockedOn=i,Da(n.priority,function(){zy(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 $c(n){if(n.blockedOn!==null)return!1;for(var i=n.targetContainers;0<i.length;){var s=Vf(n.nativeEvent);if(s===null){s=n.nativeEvent;var l=new s.constructor(s.type,s);Ce=l,s.target.dispatchEvent(l),Ce=null}else return i=Dr(s),i!==null&&jy(i),n.blockedOn=s,!1;i.shift()}return!0}function Hy(n,i,s){$c(n)&&s.delete(i)}function zw(){Yf=!1,Di!==null&&$c(Di)&&(Di=null),ji!==null&&$c(ji)&&(ji=null),zi!==null&&$c(zi)&&(zi=null),Bo.forEach(Hy),Uo.forEach(Hy)}function Gc(n,i){n.blockedOn===i&&(n.blockedOn=null,Yf||(Yf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,zw)))}var Kc=null;function Fy(n){Kc!==n&&(Kc=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Kc===n&&(Kc=null);for(var i=0;i<n.length;i+=3){var s=n[i],l=n[i+1],p=n[i+2];if(typeof l!="function"){if(qf(l||s)===null)continue;break}var g=Dr(s);g!==null&&(n.splice(i,3),i-=3,Kd(g,{pending:!0,data:p,method:s.method,action:l},l,p))}}))}function ms(n){function i(B){return Gc(B,n)}Di!==null&&Gc(Di,n),ji!==null&&Gc(ji,n),zi!==null&&Gc(zi,n),Bo.forEach(i),Uo.forEach(i);for(var s=0;s<Bi.length;s++){var l=Bi[s];l.blockedOn===n&&(l.blockedOn=null)}for(;0<Bi.length&&(s=Bi[0],s.blockedOn===null);)Py(s),s.blockedOn===null&&Bi.shift();if(s=(n.ownerDocument||n).$$reactFormReplay,s!=null)for(l=0;l<s.length;l+=3){var p=s[l],g=s[l+1],E=p[fn]||null;if(typeof g=="function")E||Fy(s);else if(E){var k=null;if(g&&g.hasAttribute("formAction")){if(p=g,E=g[fn]||null)k=E.formAction;else if(qf(p)!==null)continue}else k=E.action;typeof k=="function"?s[l+1]=k:(s.splice(l,3),l-=3),Fy(s)}}}function $y(){function n(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(E){return p=E})},focusReset:"manual",scroll:"manual"})}function i(){p!==null&&(p(),p=null),l||setTimeout(s,20)}function s(){if(!l&&!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 l=!1,p=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(s,100),function(){l=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),p!==null&&(p(),p=null)}}}function Wf(n){this._internalRoot=n}Vc.prototype.render=Wf.prototype.render=function(n){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,l=qn();Ly(s,l,n,i,null,null)},Vc.prototype.unmount=Wf.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var i=n.containerInfo;Ly(n.current,2,null,n,null,null),Tc(),i[fi]=null}};function Vc(n){this._internalRoot=n}Vc.prototype.unstable_scheduleHydration=function(n){if(n){var i=La();n={blockedOn:null,target:n,priority:i};for(var s=0;s<Bi.length&&i!==0&&i<Bi[s].priority;s++);Bi.splice(s,0,n),s===0&&Py(n)}};var Gy=t.version;if(Gy!=="19.2.4")throw Error(a(527,Gy,"19.2.4"));re.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=m(i),n=n!==null?b(n):null,n=n===null?null:n.stateNode,n};var Bw={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var qc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qc.isDisabled&&qc.supportsFiber)try{en=qc.inject(Bw),Ut=qc}catch{}}return $o.createRoot=function(n,i){if(!o(n))throw Error(a(299));var s=!1,l="",p=Zg,g=Jg,E=Qg;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(l=i.identifierPrefix),i.onUncaughtError!==void 0&&(p=i.onUncaughtError),i.onCaughtError!==void 0&&(g=i.onCaughtError),i.onRecoverableError!==void 0&&(E=i.onRecoverableError)),i=Ry(n,1,!1,null,null,s,l,null,p,g,E,$y),n[fi]=i.current,Of(n),new Wf(i)},$o.hydrateRoot=function(n,i,s){if(!o(n))throw Error(a(299));var l=!1,p="",g=Zg,E=Jg,k=Qg,B=null;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(p=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&&(B=s.formState)),i=Ry(n,1,!0,i,s??null,l,p,B,g,E,k,$y),i.context=Iy(null),s=i.current,l=qn(),l=jt(l),p=_i(l),p.callback=null,wi(s,p,l),s=l,i.current.lanes=s,Nt(i,s),wr(i),n[fi]=i.current,Of(n),new Vc(i)},$o.version="19.2.4",$o}var av;function Jw(){if(av)return Jf.exports;av=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(),Jf.exports=Zw(),Jf.exports}var Qw=Jw();const ek=El(Qw);/*! Capacitor: https://capacitorjs.com/ - MIT License */var js;(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(js||(js={}));class nh extends Error{constructor(t,r,a){super(t),this.message=t,this.code=r,this.data=a}}const tk=e=>{var t,r;return e!=null&&e.androidBridge?"android":!((r=(t=e==null?void 0:e.webkit)===null||t===void 0?void 0:t.messageHandlers)===null||r===void 0)&&r.bridge?"ios":"web"},nk=e=>{const t=e.CapacitorCustomPlatform||null,r=e.Capacitor||{},a=r.Plugins=r.Plugins||{},o=()=>t!==null?t.name:tk(e),c=()=>o()!=="web",u=y=>{const v=m.get(y);return!!(v!=null&&v.platforms.has(o())||f(y))},f=y=>{var v;return(v=r.PluginHeaders)===null||v===void 0?void 0:v.find(x=>x.name===y)},h=y=>e.console.error(y),m=new Map,b=(y,v={})=>{const x=m.get(y);if(x)return console.warn(`Capacitor plugin "${y}" already registered. Cannot register plugins twice.`),x.proxy;const S=o(),_=f(y);let N;const T=async()=>(!N&&S in v?N=typeof v[S]=="function"?N=await v[S]():N=v[S]:t!==null&&!N&&"web"in v&&(N=typeof v.web=="function"?N=await v.web():N=v.web),N),O=(F,J)=>{var P,$;if(_){const Y=_==null?void 0:_.methods.find(te=>J===te.name);if(Y)return Y.rtype==="promise"?te=>r.nativePromise(y,J.toString(),te):(te,se)=>r.nativeCallback(y,J.toString(),te,se);if(F)return(P=F[J])===null||P===void 0?void 0:P.bind(F)}else{if(F)return($=F[J])===null||$===void 0?void 0:$.bind(F);throw new nh(`"${y}" plugin is not implemented on ${S}`,js.Unimplemented)}},R=F=>{let J;const P=(...$)=>{const Y=T().then(te=>{const se=O(te,F);if(se){const V=se(...$);return J=V==null?void 0:V.remove,V}else throw new nh(`"${y}.${F}()" is not implemented on ${S}`,js.Unimplemented)});return F==="addListener"&&(Y.remove=async()=>J()),Y};return P.toString=()=>`${F.toString()}() { [capacitor code] }`,Object.defineProperty(P,"name",{value:F,writable:!1,configurable:!1}),P},M=R("addListener"),L=R("removeListener"),w=(F,J)=>{const P=M({eventName:F},J),$=async()=>{const te=await P;L({eventName:F,callbackId:te},J)},Y=new Promise(te=>P.then(()=>te({remove:$})));return Y.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await $()},Y},D=new Proxy({},{get(F,J){switch(J){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return _?w:M;case"removeListener":return L;default:return R(J)}}});return a[y]=D,m.set(y,{name:y,proxy:D,platforms:new Set([...Object.keys(v),..._?[S]:[]])}),D};return r.convertFileSrc||(r.convertFileSrc=y=>y),r.getPlatform=o,r.handleError=h,r.isNativePlatform=c,r.isPluginAvailable=u,r.registerPlugin=b,r.Exception=nh,r.DEBUG=!!r.DEBUG,r.isLoggingEnabled=!!r.isLoggingEnabled,r},rk=e=>e.Capacitor=nk(e),un=rk(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),Sp=un.registerPlugin;class _p{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(t,r){let a=!1;this.listeners[t]||(this.listeners[t]=[],a=!0),this.listeners[t].push(r);const c=this.windowListeners[t];c&&!c.registered&&this.addWindowListener(c),a&&this.sendRetainedArgumentsForEvent(t);const u=async()=>this.removeListener(t,r);return Promise.resolve({remove:u})}async removeAllListeners(){this.listeners={};for(const t in this.windowListeners)this.removeWindowListener(this.windowListeners[t]);this.windowListeners={}}notifyListeners(t,r,a){const o=this.listeners[t];if(!o){if(a){let c=this.retainedEventArguments[t];c||(c=[]),c.push(r),this.retainedEventArguments[t]=c}return}o.forEach(c=>c(r))}hasListeners(t){var r;return!!(!((r=this.listeners[t])===null||r===void 0)&&r.length)}registerWindowListener(t,r){this.windowListeners[r]={registered:!1,windowEventName:t,pluginEventName:r,handler:a=>{this.notifyListeners(r,a)}}}unimplemented(t="not implemented"){return new un.Exception(t,js.Unimplemented)}unavailable(t="not available"){return new un.Exception(t,js.Unavailable)}async removeListener(t,r){const a=this.listeners[t];if(!a)return;const o=a.indexOf(r);this.listeners[t].splice(o,1),this.listeners[t].length||this.removeWindowListener(this.windowListeners[t])}addWindowListener(t){window.addEventListener(t.windowEventName,t.handler),t.registered=!0}removeWindowListener(t){t&&(window.removeEventListener(t.windowEventName,t.handler),t.registered=!1)}sendRetainedArgumentsForEvent(t){const r=this.retainedEventArguments[t];r&&(delete this.retainedEventArguments[t],r.forEach(a=>{this.notifyListeners(t,a)}))}}const sv=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),ov=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class ik extends _p{async getCookies(){const t=document.cookie,r={};return t.split(";").forEach(a=>{if(a.length<=0)return;let[o,c]=a.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");o=ov(o).trim(),c=ov(c).trim(),r[o]=c}),r}async setCookie(t){try{const r=sv(t.key),a=sv(t.value),o=t.expires?`; expires=${t.expires.replace("expires=","")}`:"",c=(t.path||"/").replace("path=",""),u=t.url!=null&&t.url.length>0?`domain=${t.url}`:"";document.cookie=`${r}=${a||""}${o}; path=${c}; ${u};`}catch(r){return Promise.reject(r)}}async deleteCookie(t){try{document.cookie=`${t.key}=; Max-Age=0`}catch(r){return Promise.reject(r)}}async clearCookies(){try{const t=document.cookie.split(";")||[];for(const r of t)document.cookie=r.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(t){return Promise.reject(t)}}async clearAllCookies(){try{await this.clearCookies()}catch(t){return Promise.reject(t)}}}Sp("CapacitorCookies",{web:()=>new ik});const ak=async e=>new Promise((t,r)=>{const a=new FileReader;a.onload=()=>{const o=a.result;t(o.indexOf(",")>=0?o.split(",")[1]:o)},a.onerror=o=>r(o),a.readAsDataURL(e)}),sk=(e={})=>{const t=Object.keys(e);return Object.keys(e).map(o=>o.toLocaleLowerCase()).reduce((o,c,u)=>(o[c]=e[t[u]],o),{})},ok=(e,t=!0)=>e?Object.entries(e).reduce((a,o)=>{const[c,u]=o;let f,h;return Array.isArray(u)?(h="",u.forEach(m=>{f=t?encodeURIComponent(m):m,h+=`${c}=${f}&`}),h.slice(0,-1)):(f=t?encodeURIComponent(u):u,h=`${c}=${f}`),`${a}&${h}`},"").substr(1):null,lk=(e,t={})=>{const r=Object.assign({method:e.method||"GET",headers:e.headers},t),o=sk(e.headers)["content-type"]||"";if(typeof e.data=="string")r.body=e.data;else if(o.includes("application/x-www-form-urlencoded")){const c=new URLSearchParams;for(const[u,f]of Object.entries(e.data||{}))c.set(u,f);r.body=c.toString()}else if(o.includes("multipart/form-data")||e.data instanceof FormData){const c=new FormData;if(e.data instanceof FormData)e.data.forEach((f,h)=>{c.append(h,f)});else for(const f of Object.keys(e.data))c.append(f,e.data[f]);r.body=c;const u=new Headers(r.headers);u.delete("content-type"),r.headers=u}else(o.includes("application/json")||typeof e.data=="object")&&(r.body=JSON.stringify(e.data));return r};class ck extends _p{async request(t){const r=lk(t,t.webFetchExtra),a=ok(t.params,t.shouldEncodeUrlParams),o=a?`${t.url}?${a}`:t.url,c=await fetch(o,r),u=c.headers.get("content-type")||"";let{responseType:f="text"}=c.ok?t:{};u.includes("application/json")&&(f="json");let h,m;switch(f){case"arraybuffer":case"blob":m=await c.blob(),h=await ak(m);break;case"json":h=await c.json();break;case"document":case"text":default:h=await c.text()}const b={};return c.headers.forEach((y,v)=>{b[v]=y}),{data:h,headers:b,status:c.status,url:c.url}}async get(t){return this.request(Object.assign(Object.assign({},t),{method:"GET"}))}async post(t){return this.request(Object.assign(Object.assign({},t),{method:"POST"}))}async put(t){return this.request(Object.assign(Object.assign({},t),{method:"PUT"}))}async patch(t){return this.request(Object.assign(Object.assign({},t),{method:"PATCH"}))}async delete(t){return this.request(Object.assign(Object.assign({},t),{method:"DELETE"}))}}Sp("CapacitorHttp",{web:()=>new ck});var lv;(function(e){e.Dark="DARK",e.Light="LIGHT",e.Default="DEFAULT"})(lv||(lv={}));var cv;(function(e){e.StatusBar="StatusBar",e.NavigationBar="NavigationBar"})(cv||(cv={}));class uk extends _p{async setStyle(){this.unavailable("not available for web")}async setAnimation(){this.unavailable("not available for web")}async show(){this.unavailable("not available for web")}async hide(){this.unavailable("not available for web")}}Sp("SystemBars",{web:()=>new uk});function dk(e,t){const r=getComputedStyle(e),a=parseFloat(r.fontSize);return t*a}function fk(e,t){const r=getComputedStyle(e.ownerDocument.body),a=parseFloat(r.fontSize);return t*a}function hk(e){return e/100*window.innerHeight}function pk(e){return e/100*window.innerWidth}function mk(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 Yc({groupSize:e,panelElement:t,styleProp:r}){let a;const[o,c]=mk(r);switch(c){case"%":{a=o/100*e;break}case"px":{a=o;break}case"rem":{a=fk(t,o);break}case"em":{a=dk(t,o);break}case"vh":{a=hk(o);break}case"vw":{a=pk(o);break}}return a}function pr(e){return parseFloat(e.toFixed(3))}function zs({group:e}){const{orientation:t,panels:r}=e;return r.reduce((a,o)=>(a+=t==="horizontal"?o.element.offsetWidth:o.element.offsetHeight,a),0)}function $h(e){const{panels:t}=e,r=zs({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:o,panelConstraints:c}=a;let u=0;if(c.collapsedSize!==void 0){const b=Yc({groupSize:r,panelElement:o,styleProp:c.collapsedSize});u=pr(b/r*100)}let f;if(c.defaultSize!==void 0){const b=Yc({groupSize:r,panelElement:o,styleProp:c.defaultSize});f=pr(b/r*100)}let h=0;if(c.minSize!==void 0){const b=Yc({groupSize:r,panelElement:o,styleProp:c.minSize});h=pr(b/r*100)}let m=100;if(c.maxSize!==void 0){const b=Yc({groupSize:r,panelElement:o,styleProp:c.maxSize});m=pr(b/r*100)}return{collapsedSize:u,collapsible:c.collapsible===!0,defaultSize:f,disabled:c.disabled,minSize:h,maxSize:m,panelId:a.id}})}function xt(e,t="Assertion error"){if(!e)throw Error(t)}function Gh(e,t){return Array.from(t).sort(e==="horizontal"?gk:bk)}function gk(e,t){const r=e.element.offsetLeft-t.element.offsetLeft;return r!==0?r:e.element.offsetWidth-t.element.offsetWidth}function bk(e,t){const r=e.element.offsetTop-t.element.offsetTop;return r!==0?r:e.element.offsetHeight-t.element.offsetHeight}function S1(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function _1(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 yk({orientation:e,rects:t,targetRect:r}){const a={x:r.x+r.width/2,y:r.y+r.height/2};let o,c=Number.MAX_VALUE;for(const u of t){const{x:f,y:h}=_1(a,u),m=e==="horizontal"?f:h;m<c&&(c=m,o=u)}return xt(o,"No rect found"),o}let Wc;function vk(){return Wc===void 0&&(typeof matchMedia=="function"?Wc=!!matchMedia("(pointer:coarse)").matches:Wc=!1),Wc}function w1(e){const{element:t,orientation:r,panels:a,separators:o}=e,c=Gh(r,Array.from(t.children).filter(S1).map(S=>({element:S}))).map(({element:S})=>S),u=[];let f=!1,h=!1,m=-1,b=-1,y=0,v,x=[];{let S=-1;for(const _ of c)_.hasAttribute("data-panel")&&(S++,_.ariaDisabled===null&&(y++,m===-1&&(m=S),b=S))}if(y>1){let S=-1;for(const _ of c)if(_.hasAttribute("data-panel")){S++;const N=a.find(T=>T.element===_);if(N){if(v){const T=v.element.getBoundingClientRect(),O=_.getBoundingClientRect();let R;if(h){const M=r==="horizontal"?new DOMRect(T.right,T.top,0,T.height):new DOMRect(T.left,T.bottom,T.width,0),L=r==="horizontal"?new DOMRect(O.left,O.top,0,O.height):new DOMRect(O.left,O.top,O.width,0);switch(x.length){case 0:{R=[M,L];break}case 1:{const w=x[0],D=yk({orientation:r,rects:[T,O],targetRect:w.element.getBoundingClientRect()});R=[w,D===T?L:M];break}default:{R=x;break}}}else x.length?R=x:R=[r==="horizontal"?new DOMRect(T.right,O.top,O.left-T.right,O.height):new DOMRect(O.left,T.bottom,O.width,O.top-T.bottom)];for(const M of R){let L="width"in M?M:M.element.getBoundingClientRect();const w=vk()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(L.width<w){const F=w-L.width;L=new DOMRect(L.x-F/2,L.y,L.width+F,L.height)}if(L.height<w){const F=w-L.height;L=new DOMRect(L.x,L.y-F/2,L.width,L.height+F)}const D=S<=m||S>b;!f&&!D&&u.push({group:e,groupSize:zs({group:e}),panels:[v,N],separator:"width"in M?void 0:M,rect:L}),f=!1}}h=!1,v=N,x=[]}}else if(_.hasAttribute("data-separator")){_.ariaDisabled!==null&&(f=!0);const N=o.find(T=>T.element===_);N?x.push(N):(v=void 0,x=[])}else h=!0}return u}var Ki;class xk{constructor(){qy(this,Ki,{})}addListener(t,r){const a=Ho(this,Ki)[t];return a===void 0?Ho(this,Ki)[t]=[r]:a.includes(r)||a.push(r),()=>{this.removeListener(t,r)}}emit(t,r){const a=Ho(this,Ki)[t];if(a!==void 0)if(a.length===1)a[0].call(null,r);else{let o=!1,c=null;const u=Array.from(a);for(let f=0;f<u.length;f++){const h=u[f];try{h.call(null,r)}catch(m){c===null&&(o=!0,c=m)}}if(o)throw c}}removeAllListeners(){Yy(this,Ki,{})}removeListener(t,r){const a=Ho(this,Ki)[t];if(a!==void 0){const o=a.indexOf(r);o>=0&&a.splice(o,1)}}}Ki=new WeakMap;function En(e,t,r=0){return Math.abs(pr(e)-pr(t))<=r}let or={cursorFlags:0,interactionState:{state:"inactive"},mountedGroups:new Map};const ii=new xk;function _n(){return or}function wn(e){const t=typeof e=="function"?e(or):e;if(or===t)return or;const r=or;return or={...or,...t},t.cursorFlags!==void 0&&ii.emit("cursorFlagsChange",or.cursorFlags),t.interactionState!==void 0&&ii.emit("interactionStateChange",or.interactionState),t.mountedGroups!==void 0&&(or.mountedGroups.forEach((a,o)=>{a.derivedPanelConstraints.forEach(c=>{if(c.collapsible){const{layout:u}=r.mountedGroups.get(o)??{};if(u){const f=En(c.collapsedSize,a.layout[c.panelId]),h=En(c.collapsedSize,u[c.panelId]);f&&!h&&(o.inMemoryLastExpandedPanelSizes[c.panelId]=u[c.panelId])}}})}),ii.emit("mountedGroupsChange",or.mountedGroups)),or}function Ek(e,t,r){let a,o={x:1/0,y:1/0};for(const c of t){const u=_1(r,c.rect);switch(e){case"horizontal":{u.x<=o.x&&(a=c,o=u);break}case"vertical":{u.y<=o.y&&(a=c,o=u);break}}}return a?{distance:o,hitRegion:a}:void 0}function Sk(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function _k(e,t){if(e===t)throw new Error("Cannot compare node with itself");const r={a:fv(e),b:fv(t)};let a;for(;r.a.at(-1)===r.b.at(-1);)a=r.a.pop(),r.b.pop();xt(a,"Stacking order can only be calculated for elements with a common ancestor");const o={a:dv(uv(r.a)),b:dv(uv(r.b))};if(o.a===o.b){const c=a.childNodes,u={a:r.a.at(-1),b:r.b.at(-1)};let f=c.length;for(;f--;){const h=c[f];if(h===u.a)return 1;if(h===u.b)return-1}}return Math.sign(o.a-o.b)}const wk=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function kk(e){const t=getComputedStyle(k1(e)??e).display;return t==="flex"||t==="inline-flex"}function Tk(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||kk(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"||wk.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function uv(e){let t=e.length;for(;t--;){const r=e[t];if(xt(r,"Missing node"),Tk(r))return r}return null}function dv(e){return e&&Number(getComputedStyle(e).zIndex)||0}function fv(e){const t=[];for(;e;)t.push(e),e=k1(e);return t}function k1(e){const{parentNode:t}=e;return Sk(t)?t.host:t}function Nk(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 Ck({groupElement:e,hitRegion:t,pointerEventTarget:r}){if(!S1(r)||r.contains(e)||e.contains(r))return!0;if(_k(r,e)>0){let a=r;for(;a;){if(a.contains(e))return!0;if(Nk(a.getBoundingClientRect(),t))return!1;a=a.parentElement}}return!0}function wp(e,t){const r=[];return t.forEach((a,o)=>{if(o.disabled)return;const c=w1(o),u=Ek(o.orientation,c,{x:e.clientX,y:e.clientY});u&&u.distance.x<=0&&u.distance.y<=0&&Ck({groupElement:o.element,hitRegion:u.hitRegion.rect,pointerEventTarget:e.target})&&r.push(u.hitRegion)}),r}function Ak(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 Nr(e,t){return En(e,t)?0:e>t?1:-1}function Ts({overrideDisabledPanels:e,panelConstraints:t,prevSize:r,size:a}){const{collapsedSize:o=0,collapsible:c,disabled:u,maxSize:f=100,minSize:h=0}=t;if(u&&!e)return r;if(Nr(a,h)<0)if(c){const m=(o+h)/2;Nr(a,m)<0?a=o:a=h}else a=h;return a=Math.min(f,a),a=pr(a),a}function fl({delta:e,initialLayout:t,panelConstraints:r,pivotIndices:a,prevLayout:o,trigger:c}){if(En(e,0))return t;const u=c==="imperative-api",f=Object.values(t),h=Object.values(o),m=[...f],[b,y]=a;xt(b!=null,"Invalid first pivot index"),xt(y!=null,"Invalid second pivot index");let v=0;switch(c){case"keyboard":{{const _=e<0?y:b,N=r[_];xt(N,`Panel constraints not found for index ${_}`);const{collapsedSize:T=0,collapsible:O,minSize:R=0}=N;if(O){const M=f[_];if(xt(M!=null,`Previous layout not found for panel index ${_}`),En(M,T)){const L=R-M;Nr(L,Math.abs(e))>0&&(e=e<0?0-L:L)}}}{const _=e<0?b:y,N=r[_];xt(N,`No panel constraints found for index ${_}`);const{collapsedSize:T=0,collapsible:O,minSize:R=0}=N;if(O){const M=f[_];if(xt(M!=null,`Previous layout not found for panel index ${_}`),En(M,R)){const L=M-T;Nr(L,Math.abs(e))>0&&(e=e<0?0-L:L)}}}break}default:{const _=e<0?y:b,N=r[_];xt(N,`Panel constraints not found for index ${_}`);const T=f[_],{collapsible:O,collapsedSize:R,minSize:M}=N;if(O&&Nr(T,M)<0)if(e>0){const L=M-R,w=L/2,D=T+e;Nr(D,M)<0&&(e=Nr(e,w)<=0?0:L)}else{const L=M-R,w=100-L/2,D=T-e;Nr(D,M)<0&&(e=Nr(100+e,w)>0?0:-L)}break}}{const _=e<0?1:-1;let N=e<0?y:b,T=0;for(;;){const R=f[N];xt(R!=null,`Previous layout not found for panel index ${N}`);const M=Ts({overrideDisabledPanels:u,panelConstraints:r[N],prevSize:R,size:100})-R;if(T+=M,N+=_,N<0||N>=r.length)break}const O=Math.min(Math.abs(e),Math.abs(T));e=e<0?0-O:O}{let _=e<0?b:y;for(;_>=0&&_<r.length;){const N=Math.abs(e)-Math.abs(v),T=f[_];xt(T!=null,`Previous layout not found for panel index ${_}`);const O=T-N,R=Ts({overrideDisabledPanels:u,panelConstraints:r[_],prevSize:T,size:O});if(!En(T,R)&&(v+=T-R,m[_]=R,v.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?_--:_++}}if(Ak(h,m))return o;{const _=e<0?y:b,N=f[_];xt(N!=null,`Previous layout not found for panel index ${_}`);const T=N+v,O=Ts({overrideDisabledPanels:u,panelConstraints:r[_],prevSize:N,size:T});if(m[_]=O,!En(O,T)){let R=T-O,M=e<0?y:b;for(;M>=0&&M<r.length;){const L=m[M];xt(L!=null,`Previous layout not found for panel index ${M}`);const w=L+R,D=Ts({overrideDisabledPanels:u,panelConstraints:r[M],prevSize:L,size:w});if(En(L,D)||(R-=D-L,m[M]=D),En(R,0))break;e>0?M--:M++}}}const x=Object.values(m).reduce((_,N)=>N+_,0);if(!En(x,100,.1))return o;const S=Object.keys(o);return m.reduce((_,N,T)=>(_[S[T]]=N,_),{})}function ka(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(t[r]===void 0||Nr(e[r],t[r])!==0)return!1;return!0}function Ta({layout:e,panelConstraints:t}){const r=Object.values(e),a=[...r],o=a.reduce((f,h)=>f+h,0);if(a.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${a.map(f=>`${f}%`).join(", ")}`);if(!En(o,100)&&a.length>0)for(let f=0;f<t.length;f++){const h=a[f];xt(h!=null,`No layout data found for index ${f}`);const m=100/o*h;a[f]=m}let c=0;for(let f=0;f<t.length;f++){const h=r[f];xt(h!=null,`No layout data found for index ${f}`);const m=a[f];xt(m!=null,`No layout data found for index ${f}`);const b=Ts({overrideDisabledPanels:!0,panelConstraints:t[f],prevSize:h,size:m});m!=b&&(c+=m-b,a[f]=b)}if(!En(c,0))for(let f=0;f<t.length;f++){const h=a[f];xt(h!=null,`No layout data found for index ${f}`);const m=h+c,b=Ts({overrideDisabledPanels:!0,panelConstraints:t[f],prevSize:h,size:m});if(h!==b&&(c-=b-h,a[f]=b,En(c,0)))break}const u=Object.keys(e);return a.reduce((f,h,m)=>(f[u[m]]=h,f),{})}function T1({groupId:e,panelId:t}){const r=()=>{const{mountedGroups:f}=_n();for(const[h,{defaultLayoutDeferred:m,derivedPanelConstraints:b,layout:y,separatorToPanels:v}]of f)if(h.id===e)return{defaultLayoutDeferred:m,derivedPanelConstraints:b,group:h,layout:y,separatorToPanels:v};throw Error(`Group ${e} not found`)},a=()=>{const f=r().derivedPanelConstraints.find(h=>h.panelId===t);if(f!==void 0)return f;throw Error(`Panel constraints not found for Panel ${t}`)},o=()=>{const f=r().group.panels.find(h=>h.id===t);if(f!==void 0)return f;throw Error(`Layout not found for Panel ${t}`)},c=()=>{const f=r().layout[t];if(f!==void 0)return f;throw Error(`Layout not found for Panel ${t}`)},u=f=>{const h=c();if(f===h)return;const{defaultLayoutDeferred:m,derivedPanelConstraints:b,group:y,layout:v,separatorToPanels:x}=r(),S=y.panels.findIndex(O=>O.id===t),_=S===y.panels.length-1,N=fl({delta:_?h-f:f-h,initialLayout:v,panelConstraints:b,pivotIndices:_?[S-1,S]:[S,S+1],prevLayout:v,trigger:"imperative-api"}),T=Ta({layout:N,panelConstraints:b});ka(v,T)||wn(O=>({mountedGroups:new Map(O.mountedGroups).set(y,{defaultLayoutDeferred:m,derivedPanelConstraints:b,layout:T,separatorToPanels:x})}))};return{collapse:()=>{const{collapsible:f,collapsedSize:h}=a(),{mutableValues:m}=o(),b=c();f&&b!==h&&(m.expandToSize=b,u(h))},expand:()=>{const{collapsible:f,collapsedSize:h,minSize:m}=a(),{mutableValues:b}=o(),y=c();if(f&&y===h){let v=b.expandToSize??m;v===0&&(v=1),u(v)}},getSize:()=>{const{group:f}=r(),h=c(),{element:m}=o(),b=f.orientation==="horizontal"?m.offsetWidth:m.offsetHeight;return{asPercentage:h,inPixels:b}},isCollapsed:()=>{const{collapsible:f,collapsedSize:h}=a(),m=c();return f&&En(h,m)},resize:f=>{if(c()!==f){let h;switch(typeof f){case"number":{const{group:m}=r(),b=zs({group:m});h=pr(f/b*100);break}case"string":{h=parseFloat(f);break}}u(h)}}}}function hv(e){if(e.defaultPrevented)return;const{mountedGroups:t}=_n();wp(e,t).forEach(r=>{if(r.separator){const a=r.panels.find(o=>o.panelConstraints.defaultSize!==void 0);if(a){const o=a.panelConstraints.defaultSize,c=T1({groupId:r.group.id,panelId:a.id});c&&o!==void 0&&(c.resize(o),e.preventDefault())}}})}function fu(e){const{mountedGroups:t}=_n();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 N1({groupId:e}){const t=()=>{const{mountedGroups:r}=_n();for(const[a,o]of r)if(a.id===e)return{group:a,...o};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:o,group:c,layout:u,separatorToPanels:f}=t(),h=Ta({layout:r,panelConstraints:o});if(a)return u;if(!ka(u,h)){wn(b=>({mountedGroups:new Map(b.mountedGroups).set(c,{defaultLayoutDeferred:a,derivedPanelConstraints:o,layout:h,separatorToPanels:f})}));const m=c.panels.map(({id:b})=>b).join(",");c.inMemoryLayouts[m]=h}return h}}}function C1(e){const{mountedGroups:t}=_n(),r=t.get(e);return xt(r,`Mounted Group ${e.id} not found`),r}function ba(e,t){const r=fu(e),a=C1(r),o=r.separators.find(b=>b.element===e);xt(o,"Matching separator not found");const c=a.separatorToPanels.get(o);xt(c,"Matching panels not found");const u=c.map(b=>r.panels.indexOf(b)),f=N1({groupId:r.id}).getLayout(),h=fl({delta:t,initialLayout:f,panelConstraints:a.derivedPanelConstraints,pivotIndices:u,prevLayout:f,trigger:"keyboard"}),m=Ta({layout:h,panelConstraints:a.derivedPanelConstraints});ka(f,m)||wn(b=>({mountedGroups:new Map(b.mountedGroups).set(r,{defaultLayoutDeferred:a.defaultLayoutDeferred,derivedPanelConstraints:a.derivedPanelConstraints,layout:m,separatorToPanels:a.separatorToPanels})}))}function pv(e){if(e.defaultPrevented)return;const t=e.currentTarget,r=fu(t);if(!r.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),r.orientation==="vertical"&&ba(t,5);break}case"ArrowLeft":{e.preventDefault(),r.orientation==="horizontal"&&ba(t,-5);break}case"ArrowRight":{e.preventDefault(),r.orientation==="horizontal"&&ba(t,5);break}case"ArrowUp":{e.preventDefault(),r.orientation==="vertical"&&ba(t,-5);break}case"End":{e.preventDefault(),ba(t,100);break}case"Enter":{e.preventDefault();const a=fu(t),{derivedPanelConstraints:o,layout:c,separatorToPanels:u}=C1(a),f=a.separators.find(y=>y.element===t);xt(f,"Matching separator not found");const h=u.get(f);xt(h,"Matching panels not found");const m=h[0],b=o.find(y=>y.panelId===m.id);if(xt(b,"Panel metadata not found"),b.collapsible){const y=c[m.id],v=b.collapsedSize===y?a.inMemoryLastExpandedPanelSizes[m.id]??b.minSize:b.collapsedSize;ba(t,v-y)}break}case"F6":{e.preventDefault();const a=fu(t).separators.map(u=>u.element),o=Array.from(a).findIndex(u=>u===e.currentTarget);xt(o!==null,"Index not found");const c=e.shiftKey?o>0?o-1:a.length-1:o+1<a.length?o+1:0;a[c].focus();break}case"Home":{e.preventDefault(),ba(t,-100);break}}}function mv(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const{mountedGroups:t}=_n(),r=wp(e,t),a=new Map;let o=!1;r.forEach(c=>{c.separator&&(o||(o=!0,c.separator.element.focus()));const u=t.get(c.group);u&&a.set(c.group,u.layout)}),wn({interactionState:{hitRegions:r,initialLayoutMap:a,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}}),r.length&&e.preventDefault()}const Ok=e=>e,rh=()=>{},A1=1,O1=2,M1=4,R1=8,gv=3,bv=12;let Xc;function yv(){return Xc===void 0&&(Xc=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(Xc=!0)),Xc}function Mk({cursorFlags:e,groups:t,state:r}){let a=0,o=0;switch(r){case"active":case"hover":t.forEach(c=>{if(!c.disableCursor)switch(c.orientation){case"horizontal":{a++;break}case"vertical":{o++;break}}})}if(!(a===0&&o===0)){switch(r){case"active":{if(e&&yv()){const c=(e&A1)!==0,u=(e&O1)!==0,f=(e&M1)!==0,h=(e&R1)!==0;if(c)return f?"se-resize":h?"ne-resize":"e-resize";if(u)return f?"sw-resize":h?"nw-resize":"w-resize";if(f)return"s-resize";if(h)return"n-resize"}break}}return yv()?a>0&&o>0?"move":a>0?"ew-resize":"ns-resize":a>0&&o>0?"grab":a>0?"col-resize":"row-resize"}}const vv=new WeakMap;function kp(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:r}=vv.get(e)??{};r===void 0&&(r=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets.push(r));const{cursorFlags:a,interactionState:o}=_n();switch(o.state){case"active":case"hover":{const c=Mk({cursorFlags:a,groups:o.hitRegions.map(f=>f.group),state:o.state}),u=`*, *:hover {cursor: ${c} !important; ${o.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}}vv.set(e,{prevStyle:t,styleSheet:r})}function I1({document:e,event:t,hitRegions:r,initialLayoutMap:a,mountedGroups:o,pointerDownAtPoint:c,prevCursorFlags:u}){let f=0;const h=new Map(o);r.forEach(b=>{const{group:y,groupSize:v}=b,{disableCursor:x,orientation:S,panels:_}=y;let N=0;c?S==="horizontal"?N=(t.clientX-c.x)/v*100:N=(t.clientY-c.y)/v*100:S==="horizontal"?N=t.clientX<0?-100:100:N=t.clientY<0?-100:100;const T=a.get(y),{defaultLayoutDeferred:O,derivedPanelConstraints:R,layout:M,separatorToPanels:L}=o.get(y)??{defaultLayoutDeferred:!1};if(R&&T&&M&&L){const w=fl({delta:N,initialLayout:T,panelConstraints:R,pivotIndices:b.panels.map(D=>_.indexOf(D)),prevLayout:M,trigger:"mouse-or-touch"});if(ka(w,M)){if(N!==0&&!x)switch(S){case"horizontal":{f|=N<0?A1:O1;break}case"vertical":{f|=N<0?M1:R1;break}}}else{h.set(b.group,{defaultLayoutDeferred:O,derivedPanelConstraints:R,layout:w,separatorToPanels:L});const D=b.group.panels.map(({id:F})=>F).join(",");b.group.inMemoryLayouts[D]=w}}});let m=0;t.movementX===0?m|=u&gv:m|=f&gv,t.movementY===0?m|=u&bv:m|=f&bv,wn({cursorFlags:m,mountedGroups:h}),kp(e)}function xv(e){const{cursorFlags:t,interactionState:r,mountedGroups:a}=_n();switch(r.state){case"active":I1({document:e.currentTarget,event:e,hitRegions:r.hitRegions,initialLayoutMap:r.initialLayoutMap,mountedGroups:a,prevCursorFlags:t})}}function Ev(e){if(e.defaultPrevented)return;const{cursorFlags:t,interactionState:r,mountedGroups:a}=_n();switch(r.state){case"active":{if(e.buttons===0){wn(o=>o.interactionState.state==="inactive"?o:{cursorFlags:0,interactionState:{state:"inactive"}}),wn(o=>({mountedGroups:new Map(o.mountedGroups)}));return}I1({document:e.currentTarget,event:e,hitRegions:r.hitRegions,initialLayoutMap:r.initialLayoutMap,mountedGroups:a,pointerDownAtPoint:r.pointerDownAtPoint,prevCursorFlags:t});break}default:{const o=wp(e,a);o.length===0?r.state!=="inactive"&&wn({interactionState:{state:"inactive"}}):wn({interactionState:{hitRegions:o,state:"hover"}}),kp(e.currentTarget);break}}}function Sv(e){if(e.relatedTarget instanceof HTMLIFrameElement){const{interactionState:t}=_n();switch(t.state){case"hover":wn({interactionState:{state:"inactive"}})}}}function _v(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const{interactionState:t}=_n();switch(t.state){case"active":wn({cursorFlags:0,interactionState:{state:"inactive"}}),t.hitRegions.length>0&&(kp(e.currentTarget),wn(r=>({mountedGroups:new Map(r.mountedGroups)})),e.preventDefault())}}function wv(e){let t=0,r=0;const a={};for(const c of e)if(c.defaultSize!==void 0){t++;const u=pr(c.defaultSize);r+=u,a[c.panelId]=u}else a[c.panelId]=void 0;const o=e.length-t;if(o!==0){const c=pr((100-r)/o);for(const u of e)u.defaultSize===void 0&&(a[u.panelId]=c)}return a}function Rk(e,t,r){if(!r[0])return;const a=e.panels.find(h=>h.element===t);if(!a||!a.onResize)return;const o=zs({group:e}),c=e.orientation==="horizontal"?a.element.offsetWidth:a.element.offsetHeight,u=a.mutableValues.prevSize,f={asPercentage:pr(c/o*100),inPixels:c};a.mutableValues.prevSize=f,a.onResize(f,a.id,u)}function Ik(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 Lk(e,t){const r=e.map(o=>o.id),a=Object.keys(t);if(r.length!==a.length)return!1;for(const o of r)if(!a.includes(o))return!1;return!0}const bs=new Map;function Dk(e){let t=!0;xt(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const r=e.element.ownerDocument.defaultView.ResizeObserver,a=new Set,o=new Set,c=new r(S=>{for(const _ of S){const{borderBoxSize:N,target:T}=_;if(T===e.element){if(t){if(zs({group:e})===0)return;wn(O=>{const R=O.mountedGroups.get(e);if(R){const M=$h(e),L=R.defaultLayoutDeferred?wv(M):R.layout,w=Ta({layout:L,panelConstraints:M});return!R.defaultLayoutDeferred&&ka(L,w)&&Ik(R.derivedPanelConstraints,M)?O:{mountedGroups:new Map(O.mountedGroups).set(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:M,layout:w,separatorToPanels:R.separatorToPanels})}}return O})}}else Rk(e,T,N)}});c.observe(e.element),e.panels.forEach(S=>{xt(!a.has(S.id),`Panel ids must be unique; id "${S.id}" was used more than once`),a.add(S.id),S.onResize&&c.observe(S.element)});const u=zs({group:e}),f=$h(e),h=e.panels.map(({id:S})=>S).join(",");let m=e.defaultLayout;m&&(Lk(e.panels,m)||(m=void 0));const b=e.inMemoryLayouts[h]??m??wv(f),y=Ta({layout:b,panelConstraints:f}),v=w1(e),x=e.element.ownerDocument;return wn(S=>{const _=new Map;return bs.set(x,(bs.get(x)??0)+1),v.forEach(N=>{N.separator&&_.set(N.separator,N.panels)}),{mountedGroups:new Map(S.mountedGroups).set(e,{defaultLayoutDeferred:u===0,derivedPanelConstraints:f,layout:y,separatorToPanels:_})}}),e.separators.forEach(S=>{xt(!o.has(S.id),`Separator ids must be unique; id "${S.id}" was used more than once`),o.add(S.id),S.element.addEventListener("keydown",pv)}),bs.get(x)===1&&(x.addEventListener("dblclick",hv,!0),x.addEventListener("pointerdown",mv,!0),x.addEventListener("pointerleave",xv),x.addEventListener("pointermove",Ev),x.addEventListener("pointerout",Sv),x.addEventListener("pointerup",_v,!0)),function(){t=!1,bs.set(x,Math.max(0,(bs.get(x)??0)-1)),wn(S=>{const _=new Map(S.mountedGroups);return _.delete(e),{mountedGroups:_}}),e.separators.forEach(S=>{S.element.removeEventListener("keydown",pv)}),bs.get(x)||(x.removeEventListener("dblclick",hv,!0),x.removeEventListener("pointerdown",mv,!0),x.removeEventListener("pointerleave",xv),x.removeEventListener("pointermove",Ev),x.removeEventListener("pointerout",Sv),x.removeEventListener("pointerup",_v,!0)),c.disconnect()}}function jk(){const[e,t]=C.useState({}),r=C.useCallback(()=>t({}),[]);return[e,r]}function Tp(e){const t=C.useId();return`${e??t}`}const Aa=typeof window<"u"?C.useLayoutEffect:C.useEffect;function el(e){const t=C.useRef(e);return Aa(()=>{t.current=e},[e]),C.useCallback((...r)=>{var a;return(a=t.current)==null?void 0:a.call(t,...r)},[t])}function Np(...e){return el(t=>{e.forEach(r=>{if(r)switch(typeof r){case"function":{r(t);break}case"object":{r.current=t;break}}})})}function Cp(e){const t=C.useRef({...e});return Aa(()=>{for(const r in e)t.current[r]=e[r]},[e]),t.current}const L1=C.createContext(null);function zk(e,t){const r=C.useRef({getLayout:()=>({}),setLayout:Ok});C.useImperativeHandle(t,()=>r.current,[]),Aa(()=>{Object.assign(r.current,N1({groupId:e}))})}function hl({children:e,className:t,defaultLayout:r,disableCursor:a,disabled:o,elementRef:c,groupRef:u,id:f,onLayoutChange:h,onLayoutChanged:m,orientation:b="horizontal",resizeTargetMinimumSize:y={coarse:20,fine:10},style:v,...x}){const S=C.useRef({onLayoutChange:{},onLayoutChanged:{}}),_=el($=>{ka(S.current.onLayoutChange,$)||(S.current.onLayoutChange=$,h==null||h($))}),N=el($=>{ka(S.current.onLayoutChanged,$)||(S.current.onLayoutChanged=$,m==null||m($))}),T=Tp(f),O=C.useRef(null),[R,M]=jk(),L=C.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:y,separators:[]}),w=Np(O,c);zk(T,u);const D=el(($,Y)=>{const{interactionState:te,mountedGroups:se}=_n();for(const V of se.keys())if(V.id===$){const z=se.get(V);if(z){let re=!1;switch(te.state){case"active":{re=te.hitRegions.some(oe=>oe.group===V);break}}return{flexGrow:z.layout[Y]??1,pointerEvents:re?"none":void 0}}}return{flexGrow:(r==null?void 0:r[Y])??1}}),F=Cp({defaultLayout:r,disableCursor:a}),J=C.useMemo(()=>({get disableCursor(){return!!F.disableCursor},getPanelStyles:D,id:T,orientation:b,registerPanel:$=>{const Y=L.current;return Y.panels=Gh(b,[...Y.panels,$]),M(),()=>{Y.panels=Y.panels.filter(te=>te!==$),M()}},registerSeparator:$=>{const Y=L.current;return Y.separators=Gh(b,[...Y.separators,$]),M(),()=>{Y.separators=Y.separators.filter(te=>te!==$),M()}},togglePanelDisabled:($,Y)=>{const te=L.current.panels.find(V=>V.id===$);te&&(te.panelConstraints.disabled=Y);const{mountedGroups:se}=_n();for(const V of se.keys())if(V.id===T){const z=se.get(V);z&&(z.derivedPanelConstraints=$h(V))}},toggleSeparatorDisabled:($,Y)=>{const te=L.current.separators.find(se=>se.id===$);te&&(te.disabled=Y)}}),[D,T,M,b,F]),P=C.useRef(null);return Aa(()=>{const $=O.current;if($===null)return;const Y=L.current;let te;if(F.defaultLayout!==void 0&&Object.keys(F.defaultLayout).length===Y.panels.length){te={};for(const ye of Y.panels){const I=F.defaultLayout[ye.id];I!==void 0&&(te[ye.id]=I)}}const se={defaultLayout:te,disableCursor:!!F.disableCursor,disabled:!!o,element:$,id:T,inMemoryLastExpandedPanelSizes:L.current.lastExpandedPanelSizes,inMemoryLayouts:L.current.layouts,orientation:b,panels:Y.panels,resizeTargetMinimumSize:Y.resizeTargetMinimumSize,separators:Y.separators};P.current=se;const V=Dk(se),z=_n().mountedGroups.get(se);if(z){const{defaultLayoutDeferred:ye,derivedPanelConstraints:I,layout:j}=z;!ye&&I.length>0&&(_(j),N(j))}const re=ii.addListener("interactionStateChange",ye=>{ye.state}),oe=ii.addListener("mountedGroupsChange",ye=>{const I=ye.get(se);if(I){const{defaultLayoutDeferred:j,derivedPanelConstraints:Q,layout:A}=I;if(j||Q.length===0)return;const{interactionState:be}=_n(),Ne=be.state!=="active";_(A),Ne&&N(A)}});return()=>{P.current=null,V(),re(),oe()}},[o,T,N,_,b,R,F]),C.useEffect(()=>{const $=P.current;$&&($.defaultLayout=r,$.disableCursor=!!a)}),d.jsx(L1.Provider,{value:J,children:d.jsx("div",{...x,className:t,"data-group":!0,"data-testid":T,id:T,ref:w,style:{height:"100%",width:"100%",overflow:"hidden",...v,display:"flex",flexDirection:b==="horizontal"?"row":"column",flexWrap:"nowrap"},children:e})})}hl.displayName="Group";function ih(e,t){return`react-resizable-panels:${[e,...t].join(":")}`}function yu({debounceSaveMs:e=100,panelIds:t,storage:r=localStorage,...a}){const o=t!==void 0,c="id"in a?a.id:a.groupId,u=ih(c,t??[]),f=C.useSyncExternalStore(Bk,()=>r.getItem(u),()=>r.getItem(u)),h=C.useMemo(()=>f?JSON.parse(f):void 0,[f]),m=C.useRef(null),b=C.useCallback(()=>{const x=m.current;x&&(m.current=null,clearTimeout(x))},[]);C.useLayoutEffect(()=>()=>{b()},[b]);const y=C.useCallback(x=>{b();let S;o?S=ih(c,Object.keys(x)):S=ih(c,[]);try{r.setItem(S,JSON.stringify(x))}catch(_){console.error(_)}},[b,o,c,r]),v=C.useCallback(x=>{b(),e===0?y(x):m.current=setTimeout(()=>{y(x)},e)},[b,e,y]);return{defaultLayout:h,onLayoutChange:v,onLayoutChanged:y}}function Bk(){return function(){}}function Ap(){const e=C.useContext(L1);return xt(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function Uk(e,t){const{id:r}=Ap(),a=C.useRef({collapse:rh,expand:rh,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:rh});C.useImperativeHandle(t,()=>a.current,[]),Aa(()=>{Object.assign(a.current,T1({groupId:r,panelId:e}))})}function Cr({children:e,className:t,collapsedSize:r="0%",collapsible:a=!1,defaultSize:o,disabled:c,elementRef:u,id:f,maxSize:h="100%",minSize:m="0%",onResize:b,panelRef:y,style:v,...x}){const S=!!f,_=Tp(f),N=Cp({disabled:c}),T=C.useRef(null),O=Np(T,u),{getPanelStyles:R,id:M,registerPanel:L,togglePanelDisabled:w}=Ap(),D=b!==null,F=el((P,$,Y)=>{b==null||b(P,f,Y)});Aa(()=>{const P=T.current;if(P!==null){const $={element:P,id:_,idIsStable:S,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:D?F:void 0,panelConstraints:{collapsedSize:r,collapsible:a,defaultSize:o,disabled:N.disabled,maxSize:h,minSize:m}};return L($)}},[r,a,o,D,_,S,h,m,F,L,N]),C.useEffect(()=>{w(_,!!c)},[c,_,w]),Uk(_,y);const J=C.useSyncExternalStore(P=>(ii.addListener("mountedGroupsChange",P),()=>{ii.removeListener("mountedGroupsChange",P)}),()=>JSON.stringify(R(M,_)),()=>JSON.stringify(R(M,_)));return d.jsx("div",{...x,"aria-disabled":c||void 0,"data-panel":!0,"data-testid":_,id:_,ref:O,style:{...Pk,display:"flex",flexBasis:0,flexShrink:1,overflow:"hidden",...JSON.parse(J)},children:d.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,...v},children:e})})}Cr.displayName="Panel";const Pk={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function Hk({layout:e,panelConstraints:t,panelId:r,panelIndex:a}){let o,c;const u=e[r],f=t.find(h=>h.panelId===r);if(f){const h=f.maxSize,m=f.collapsible?f.collapsedSize:f.minSize,b=[a,a+1];c=Ta({layout:fl({delta:m-u,initialLayout:e,panelConstraints:t,pivotIndices:b,prevLayout:e}),panelConstraints:t})[r],o=Ta({layout:fl({delta:h-u,initialLayout:e,panelConstraints:t,pivotIndices:b,prevLayout:e}),panelConstraints:t})[r]}return{valueControls:r,valueMax:o,valueMin:c,valueNow:u}}function D1({children:e,className:t,disabled:r,elementRef:a,id:o,style:c,...u}){const f=Tp(o),h=Cp({disabled:r}),[m,b]=C.useState({}),[y,v]=C.useState("inactive"),x=C.useRef(null),S=Np(x,a),{disableCursor:_,id:N,orientation:T,registerSeparator:O,toggleSeparatorDisabled:R}=Ap(),M=T==="horizontal"?"vertical":"horizontal";Aa(()=>{const w=x.current;if(w!==null){const D={disabled:h.disabled,element:w,id:f},F=O(D),J=ii.addListener("interactionStateChange",$=>{v($.state!=="inactive"&&$.hitRegions.some(Y=>Y.separator===D)?$.state:"inactive")}),P=ii.addListener("mountedGroupsChange",$=>{$.forEach(({derivedPanelConstraints:Y,layout:te,separatorToPanels:se},V)=>{if(V.id===N){const z=se.get(D);if(z){const re=z[0],oe=V.panels.indexOf(re);b(Hk({layout:te,panelConstraints:Y,panelId:re.id,panelIndex:oe}))}}})});return()=>{J(),P(),F()}}},[N,f,O,h]),C.useEffect(()=>{R(f,!!r)},[r,f,R]);let L;return r&&!_&&(L="not-allowed"),d.jsx("div",{...u,"aria-controls":m.valueControls,"aria-disabled":r||void 0,"aria-orientation":M,"aria-valuemax":m.valueMax,"aria-valuemin":m.valueMin,"aria-valuenow":m.valueNow,children:e,className:t,"data-separator":r?"disabled":y,"data-testid":f,id:f,ref:S,role:"separator",style:{flexBasis:"auto",cursor:L,...c,flexGrow:0,flexShrink:0},tabIndex:r?void 0:0})}D1.displayName="Separator";const Op={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,agentConnections:{},v2Agents:[],sessionModel:null,wsConnected:!1,models:[],defaultModel:null,streamingRunId:null,streamingSessionKey:null,streamingThreadId:null,cronTasks:[],selectedCronTaskId:null,cronJobs:[],selectedCronJobId:null};function Fk(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,activities:r.activities}]}:{...e,messages:[...e.messages,t.message]}}case"SET_MESSAGES":{let r=t.messages;if(e.streamingRunId){const a=e.messages.find(o=>o.id===`stream_${e.streamingRunId}`);a&&(r=[...r,a])}return{...e,messages:r,...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 o=e.threadMessages,c={};if(a){const f=e.threadMessages[e.threadMessages.length-1];t.message.sender==="agent"&&(f!=null&&f.isStreaming)?(o=[...e.threadMessages.slice(0,-1),{...t.message,isStreaming:!1,activities:f.activities}],c={streamingRunId:null,streamingSessionKey:null,streamingThreadId:null}):o=[...e.threadMessages,t.message]}const u={...e.threadReplyCounts};return r&&(a?u[r]=o.length:u[r]=(u[r]??0)+1),{...e,...c,threadMessages:o,threadReplyCounts:u}}case"SET_OPENCLAW_CONNECTED":{const r=t.connected||Object.values(e.agentConnections).some(Boolean);return{...e,openclawConnected:r,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"STREAM_ACTIVITY":{const r=e.streamingRunId?`stream_${e.streamingRunId}`:null,a=o=>o.map(c=>{if(!(r?c.id===r:c.isStreaming))return c;const f=c.activities??[];return t.activity.kind==="reasoning"?f.length>0&&f[f.length-1].kind==="reasoning"?{...c,activities:[...f.slice(0,-1),t.activity]}:{...c,activities:[...f,t.activity]}:{...c,activities:[...f,t.activity]}});return e.streamingThreadId?{...e,threadMessages:a(e.threadMessages)}:{...e,messages:a(e.messages)}}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.providerJobId?r.get(c.providerJobId):null;return u?{...c,schedule:u.schedule||null,instructions:u.instructions||null,model:u.model||null,enabled:u.enabled}:c}),o=e.tasks.map(c=>{const u=c.providerJobId?r.get(c.providerJobId):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:o}}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 o=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:o}})}:{...e,cronJobs:[t.job,...e.cronJobs]};case"APPEND_JOB_OUTPUT":{const r=a=>a.map(o=>o.id===t.jobId?{...o,summary:t.text}:o);return{...e,jobs:r(e.jobs),cronJobs:r(e.cronJobs)}}case"SET_V2_AGENTS":{const r=Object.fromEntries(t.agents.map(o=>[o.id,o.status==="connected"])),a=Object.values(r).some(Boolean);return{...e,v2Agents:t.agents,agentConnections:r,openclawConnected:a||e.openclawConnected}}case"SET_AGENT_CONNECTION":{const r={...e.agentConnections,[t.agentId]:t.connected},a=Object.values(r).some(Boolean);return{...e,agentConnections:r,openclawConnected:a||e.openclawConnected}}case"LOGOUT":return{...Op};default:return e}}const Ea=C.createContext(Op),Ss=C.createContext(()=>{});function Zn(){return C.useContext(Ea)}function Rr(){return C.useContext(Ss)}const kv=500;let $k=1;const Ns=[],vu=new Set;function ys(e,t,r,a){const o={id:$k++,ts:Date.now(),level:e,tag:t,message:r,detail:a!==void 0?typeof a=="string"?a:JSON.stringify(a,null,2):void 0};Ns.push(o),Ns.length>kv&&Ns.splice(0,Ns.length-kv);for(const c of vu)c()}function Gk(){return Ns}function Kk(){Ns.length=0;for(const e of vu)e()}function Vk(e){return vu.add(e),()=>vu.delete(e)}const Z={info:(e,t,r)=>ys("info",e,t,r),warn:(e,t,r)=>ys("warn",e,t,r),error:(e,t,r)=>ys("error",e,t,r),wsIn:(e,t,r)=>ys("ws-in",e,t,r),wsOut:(e,t,r)=>ys("ws-out",e,t,r),api:(e,t,r)=>ys("api",e,t,r)},qk=un.isNativePlatform()||!!window.__BOTSCHAT_NATIVE__,Yk=qk?"https://console.botschat.app":"",Kh=`${Yk}/api`;let tl=localStorage.getItem("botschat_token"),xu=localStorage.getItem("botschat_refresh_token");function ai(e){tl=e,e?localStorage.setItem("botschat_token",e):localStorage.removeItem("botschat_token")}function Na(e){xu=e,e?localStorage.setItem("botschat_refresh_token",e):localStorage.removeItem("botschat_refresh_token")}function ah(){return tl}async function j1(){if(!xu)return!1;try{const e=await fetch(`${Kh}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:xu})});if(!e.ok)return!1;const t=await e.json();return ai(t.token),Z.info("API","Access token refreshed successfully"),!0}catch{return!1}}async function Qe(e,t,r){const a=`${e} ${t}`;Z.api("API",`→ ${a}`,r);const o={"Content-Type":"application/json"};tl&&(o.Authorization=`Bearer ${tl}`);const c=performance.now();let u;try{u=await fetch(`${Kh}${t}`,{method:e,headers:o,body:r?JSON.stringify(r):void 0,cache:"no-store"})}catch(m){const b=Math.round(performance.now()-c);throw Z.error("API",`✗ ${a} — network error (${b}ms)`,String(m)),m}if(u.status===401&&xu&&!t.includes("/auth/refresh")&&await j1()){o.Authorization=`Bearer ${tl}`;try{u=await fetch(`${Kh}${t}`,{method:e,headers:o,body:r?JSON.stringify(r):void 0,cache:"no-store"})}catch(b){const y=Math.round(performance.now()-c);throw Z.error("API",`✗ ${a} — network error on retry (${y}ms)`,String(b)),b}}const f=Math.round(performance.now()-c);if(!u.ok){const b=(await u.json().catch(()=>({error:u.statusText}))).error??`HTTP ${u.status}`;throw Z.error("API",`✗ ${a} — ${u.status} (${f}ms): ${b}`),new Error(b)}const h=await u.json();return Z.api("API",`✓ ${a} — ${u.status} (${f}ms)`,h),h}const Eu={config:()=>Qe("GET","/auth/config"),register:(e,t,r)=>Qe("POST","/auth/register",{email:e,password:t,displayName:r}),login:(e,t)=>Qe("POST","/auth/login",{email:e,password:t}),firebase:e=>Qe("POST","/auth/firebase",{idToken:e}),me:()=>Qe("GET","/me"),deleteAccount:()=>Qe("DELETE","/auth/account")},z1={updateSettings:e=>Qe("PATCH","/me",e)},Wk={list:()=>Qe("GET","/models")},Os={list:()=>Qe("GET","/agents")},cr={list:()=>Qe("GET","/channels"),get:e=>Qe("GET",`/channels/${e}`),create:e=>Qe("POST","/channels",e),update:(e,t)=>Qe("PATCH",`/channels/${e}`,t),delete:e=>Qe("DELETE",`/channels/${e}`)},Cs={list:e=>Qe("GET",`/channels/${e}/sessions`),create:(e,t)=>Qe("POST",`/channels/${e}/sessions`,{name:t}),rename:(e,t,r)=>Qe("PATCH",`/channels/${e}/sessions/${t}`,{name:r}),delete:(e,t)=>Qe("DELETE",`/channels/${e}/sessions/${t}`)},zn={list:e=>Qe("GET",`/channels/${e}/tasks`),listAll:(e="background")=>Qe("GET",`/tasks?kind=${e}`),scanData:()=>Qe("GET","/task-scan"),create:(e,t)=>Qe("POST",`/channels/${e}/tasks`,t),update:(e,t,r)=>Qe("PATCH",`/channels/${e}/tasks/${t}`,r),delete:(e,t)=>Qe("DELETE",`/channels/${e}/tasks/${t}`),run:(e,t)=>Qe("POST",`/channels/${e}/tasks/${t}/run`)},Vh={list:(e,t)=>Qe("GET",`/channels/${e}/tasks/${t}/jobs`),listByTask:e=>Qe("GET",`/tasks/${e}/jobs`)},B1={list:(e,t,r)=>Qe("GET",`/messages/${e}?sessionKey=${encodeURIComponent(t)}${r?`&threadId=${encodeURIComponent(r)}`:""}`)},Xo={list:()=>Qe("GET","/pairing-tokens"),create:e=>Qe("POST","/pairing-tokens",{label:e}),delete:e=>Qe("DELETE",`/pairing-tokens/${e}`)},U1={register:(e,t)=>Qe("POST","/push-tokens",{token:e,platform:t}),unregister:e=>Qe("DELETE","/push-tokens",{token:e})},P1={cloudUrl:()=>Qe("GET","/setup/cloud-url")},Su={list:()=>Qe("GET","/v2/agents"),create:e=>Qe("POST","/v2/agents",e),update:(e,t)=>Qe("PATCH",`/v2/agents/${e}`,t),delete:e=>Qe("DELETE",`/v2/agents/${e}`)};function Mp({value:e,onChange:t,models:r,disabled:a,placeholder:o="Select model...",compact:c}){const f=!r.find(_=>_.id===e)&&e?r.find(_=>_.name===e):null,h=f?f.id:e,m=!h||r.some(_=>_.id===h);C.useEffect(()=>{f&&e!==f.id&&t(f.id)},[f,e,t]);const b=C.useRef(null),[y,v]=C.useState(void 0),x=h||o,S=C.useCallback(()=>{if(!c||!b.current)return;const _=getComputedStyle(b.current),T=document.createElement("canvas").getContext("2d");if(!T)return;T.font=`${_.fontSize} ${_.fontFamily}`;const O=T.measureText(x).width,R=parseFloat(_.paddingLeft)||6,M=parseFloat(_.paddingRight)||6;v(Math.ceil(O)+R+M+22)},[c,x]);return C.useEffect(()=>{S()},[S]),d.jsxs("select",{ref:b,value:h,onChange:_=>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&&d.jsx("option",{value:"",children:o}),h&&!m&&d.jsx("option",{value:h,children:h}),r.map(_=>d.jsx("option",{value:_.id,children:_.id},_.id))]})}var E1;const Fs=typeof globalThis.process<"u"&&typeof((E1=globalThis.process.versions)==null?void 0:E1.node)=="string",H1=31e4,F1=32,$1=16,G1="botschat-e2e:";function pl(e){return new TextEncoder().encode(e)}function Xk(e){return new TextDecoder().decode(e)}async function Zk(e,t){const r=pl(e),a=pl(G1+t),o=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:H1,hash:"SHA-256"},o,F1*8);return new Uint8Array(u)}async function K1(e,t){const r=await crypto.subtle.importKey("raw",e.buffer,{name:"HMAC",hash:"SHA-256"},!1,["sign"]),a=pl("nonce-"+t),o=new Uint8Array(a.length+1);o.set(a),o[a.length]=1;const c=await crypto.subtle.sign("HMAC",r,o.buffer);return new Uint8Array(c).slice(0,$1)}async function V1(e,t,r){const a=await K1(e,r),o=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},o,t.buffer);return new Uint8Array(c)}async function q1(e,t,r){const a=await K1(e,r),o=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},o,t.buffer);return new Uint8Array(c)}let Vi=null,nl=null;const rl=globalThis;Fs&&rl.__e2e_nodeCrypto&&(Vi=rl.__e2e_nodeCrypto,nl=rl.__e2e_nodeUtil);async function zu(){Vi&&nl||(Vi=await ur(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]),nl=await ur(()=>import("./__vite-browser-external-BIHI7g3E.js"),[]),rl.__e2e_nodeCrypto=Vi,rl.__e2e_nodeUtil=nl)}async function Jk(e,t){await zu();const r=nl.promisify(Vi.pbkdf2),a=G1+t,o=await r(e,a,H1,F1,"sha256");return new Uint8Array(o)}async function Y1(e,t){await zu();const r=pl("nonce-"+t),a=new Uint8Array(r.length+1);a.set(r),a[r.length]=1;const o=Vi.createHmac("sha256",Buffer.from(e));o.update(Buffer.from(a));const c=o.digest();return new Uint8Array(c.buffer,c.byteOffset,$1)}async function W1(e,t,r){await zu();const a=await Y1(e,r),o=Vi.createCipheriv("aes-256-ctr",Buffer.from(e),Buffer.from(a)),c=Buffer.concat([o.update(Buffer.from(t)),o.final()]);return new Uint8Array(c)}async function X1(e,t,r){await zu();const a=await Y1(e,r),o=Vi.createDecipheriv("aes-256-ctr",Buffer.from(e),Buffer.from(a)),c=Buffer.concat([o.update(Buffer.from(t)),o.final()]);return new Uint8Array(c)}async function Qk(e,t){return Fs?Jk(e,t):Zk(e,t)}async function e2(e,t,r){const a=pl(t);return Fs?W1(e,a,r):V1(e,a,r)}async function Tv(e,t,r){const a=Fs?await X1(e,t,r):await q1(e,t,r);return Xk(a)}async function t2(e,t,r){return Fs?W1(e,t,r):V1(e,t,r)}async function n2(e,t,r){return Fs?await X1(e,t,r):await q1(e,t,r)}function Nv(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 qh(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 va="botschat_e2e_pwd_cache",Zo="botschat_e2e_key_cache";let cn=null,Jo=null;const sh=new Set;try{const e=localStorage.getItem(Zo);e&&(cn=qh(e),Jo=localStorage.getItem(va))}catch{}const Ge={subscribe(e){return sh.add(e),()=>sh.delete(e)},notify(){sh.forEach(e=>e())},async setPassword(e,t,r){if(!e){cn=null,Jo=null,localStorage.removeItem(va),localStorage.removeItem(Zo),this.notify();return}try{cn=await Qk(e,t),Jo=e,r?(localStorage.setItem(va,e),localStorage.setItem(Zo,Nv(cn))):(localStorage.removeItem(va),localStorage.removeItem(Zo)),this.notify()}catch(a){throw console.error("Failed to derive E2E key:",a),a}},clear(){cn=null,Jo=null,localStorage.removeItem(va),localStorage.removeItem(Zo),this.notify()},hasKey(){return!!cn},hasSavedPassword(){return!!localStorage.getItem(va)},async loadSavedPassword(e){if(cn)return!0;const t=localStorage.getItem(va);if(!t)return!1;try{return await this.setPassword(t,e,!0),!0}catch{return!1}},async encrypt(e,t){if(!cn)throw new Error("E2E key not set");const r=t||crypto.randomUUID(),a=await e2(cn,e,r);return{ciphertext:Nv(a),messageId:r}},async decrypt(e,t){if(!cn)throw new Error("E2E key not set");const r=qh(e);return Tv(cn,r,t)},getPassword(){return Jo},async encryptMedia(e,t){if(!cn)throw new Error("E2E key not set");const r=t||crypto.randomUUID();return{encrypted:await t2(cn,e,r),contextId:r}},async decryptMedia(e,t){if(!cn)throw new Error("E2E key not set");return n2(cn,e,t)},async decryptBytesLegacy(e,t){if(!cn)throw new Error("E2E key not set");const r=qh(e),a=await Tv(cn,r,t);return new TextEncoder().encode(a)}};class r2{constructor(t){gs(this,"ws",null);gs(this,"reconnectTimer",null);gs(this,"backoffMs",1e3);gs(this,"intentionalClose",!1);gs(this,"_connected",!1);this.opts=t}get connected(){return this._connected}connect(){this.intentionalClose=!1;const t=un.isNativePlatform()||!!window.__BOTSCHAT_NATIVE__;let r;t?r=`wss://console.botschat.app/api/ws/${this.opts.userId}/${this.opts.sessionId}`:r=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/ws/${this.opts.userId}/${this.opts.sessionId}`,Z.info("WS",`Connecting to ${r}`),this.ws=new WebSocket(r),this.ws.onopen=()=>{var o;Z.info("WS","Socket opened, sending auth");const a=this.opts.getToken();if(!a){Z.error("WS","No access token available, closing"),(o=this.ws)==null||o.close();return}this.ws.send(JSON.stringify({type:"auth",token:a}))},this.ws.onmessage=async a=>{try{const o=JSON.parse(a.data);if(console.log(`[E2E-WS] msg.type=${o.type} encrypted=${o.encrypted} hasKey=${Ge.hasKey()} messageId=${o.messageId}`),o.encrypted&&Ge.hasKey())try{if(o.type==="agent.text"||o.type==="agent.media"){const c=o.text,u=o.caption,f=o.messageId;c&&f&&(o.text=await Ge.decrypt(c,f),o.encrypted=!1),u&&f&&(o.caption=await Ge.decrypt(u,f),o.encrypted=!1)}else if(o.type==="job.update"){const c=o.summary,u=o.jobId;c&&u&&(o.summary=await Ge.decrypt(c,u),o.encrypted=!1)}}catch(c){Z.warn("E2E","Decryption failed",c),o.decryptionError=!0}if(o.type==="agent.stream.chunk"&&o.encrypted&&o.chunkId&&Ge.hasKey())try{o.text=await Ge.decrypt(o.text,o.chunkId),o.encrypted=!1}catch(c){Z.warn("E2E","Stream chunk decryption failed",c)}if(o.type==="agent.activity"&&o.encrypted&&o.activityId&&Ge.hasKey())try{o.text=await Ge.decrypt(o.text,o.activityId),o.encrypted=!1}catch(c){Z.warn("E2E","Activity decryption failed",c)}if(o.type==="task.scan.result"&&Array.isArray(o.tasks)&&Ge.hasKey()){for(const c of o.tasks)if(c.encrypted&&c.iv)try{c.schedule&&(c.schedule=await Ge.decrypt(c.schedule,c.iv)),c.instructions&&(c.instructions=await Ge.decrypt(c.instructions,c.iv)),c.encrypted=!1}catch(u){Z.warn("E2E",`Task decryption failed for ${c.cronJobId}`,u),c.decryptionError=!0}}if(o.type==="auth.ok"){Z.info("WS","Auth OK — connected");const c=o.userId;if(console.log(`[E2E-WS] auth.ok userId=${c}, hasSavedPwd=${Ge.hasSavedPassword()}`),c&&Ge.hasSavedPassword()){const u=await Ge.loadSavedPassword(c);console.log(`[E2E-WS] loadSavedPassword result=${u}, hasKey=${Ge.hasKey()}`)}this.backoffMs=1e3,this._connected=!0,this.opts.onStatusChange(!0),this.opts.onMessage(o)}else this.opts.onMessage(o)}catch(o){Z.warn("WS","Failed to process incoming message",o)}},this.ws.onclose=a=>{if(this._connected=!1,this.opts.onStatusChange(!1),this.intentionalClose)Z.info("WS","Connection closed (intentional)");else{const o=a.code===4001;Z.warn("WS",`Connection closed (code=${a.code}), reconnecting in ${this.backoffMs}ms${o?" (will refresh token)":""}`),this.reconnectTimer=setTimeout(async()=>{this.backoffMs=Math.min(this.backoffMs*2,3e4),o&&(Z.info("WS","Refreshing access token before reconnect..."),await j1()?(Z.info("WS","Token refreshed, reconnecting"),this.backoffMs=1e3):Z.error("WS","Token refresh failed — will retry on next cycle")),this.connect()},this.backoffMs)}},this.ws.onerror=()=>{Z.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"&&Ge.hasKey()&&typeof t.text=="string")try{const o=t.messageId||void 0,{ciphertext:c,messageId:u}=await Ge.encrypt(t.text,o);t.text=c,o||(t.messageId=u),t.encrypted=!0}catch(o){Z.error("E2E","Encryption failed",o);return}this.ws.send(JSON.stringify(t))}else Z.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)}}let Cv=!1,Rp=null;function Av(){return Rp}function Ov(){Rp=null}function Yh(e){Rp=e,window.dispatchEvent(new CustomEvent("botschat:push-nav",{detail:{sessionKey:e}}))}const i2="botschat-sw",Wh="keys",Mv="e2e_key";function a2(){return new Promise((e,t)=>{const r=indexedDB.open(i2,1);r.onupgradeneeded=()=>{r.result.createObjectStore(Wh)},r.onsuccess=()=>e(r.result),r.onerror=()=>t(r.error)})}async function Rv(){try{const t=(await a2()).transaction(Wh,"readwrite"),r=t.objectStore(Wh),a=localStorage.getItem("botschat_e2e_key_cache");if(a){const o=atob(a),c=new Uint8Array(o.length);for(let u=0;u<o.length;u++)c[u]=o.charCodeAt(u);r.put(c,Mv)}else r.delete(Mv);await new Promise((o,c)=>{t.oncomplete=()=>o(),t.onerror=()=>c(t.error)})}catch(e){Z.warn("Push","Failed to sync E2E key to SW IndexedDB",e)}}function Z1(){return!!(window.__BOTSCHAT_NATIVE__&&window.__BOTSCHAT_PLATFORM__==="macos")}async function s2(){var e;try{(e=window.__BOTSCHAT_NATIVE_REQUEST_PERMISSION__)==null||e.call(window),Z.info("Push","macOS native notification permission requested")}catch(t){Z.error("Push","macOS notification init failed",t)}}function o2(e){if(!Z1()||!document.hidden&&document.hasFocus()||!window.__BOTSCHAT_NATIVE_NOTIFY__)return;let t="";const r=e.agentName||"BotsChat";if(e.type==="agent.text"&&e.text)t=e.text.length>200?e.text.slice(0,200)+"…":e.text;else if(e.type==="agent.media")t=e.caption||"Sent a media file";else return;window.__BOTSCHAT_NATIVE_NOTIFY__({title:r,body:t,sessionKey:e.sessionKey})}function l2(){if(!("serviceWorker"in navigator))return;navigator.serviceWorker.addEventListener("message",r=>{var a;((a=r.data)==null?void 0:a.type)==="push-nav"&&r.data.sessionKey&&(Z.info("Push",`SW postMessage push-nav: ${r.data.sessionKey}`),Yh(r.data.sessionKey))});const e=new URLSearchParams(window.location.search),t=e.get("push_session");if(t){Z.info("Push",`URL push_session param: ${t}`),Yh(t),e.delete("push_session");const r=e.toString(),a=window.location.pathname+(r?"?"+r:"")+window.location.hash;window.history.replaceState({},"",a)}}async function c2(){Cv||(l2(),await Rv(),Ge.subscribe(()=>{Rv().catch(()=>{})}),Z1()?await s2():un.isNativePlatform()?await d2():await u2(),Cv=!0)}async function u2(){try{if(!("Notification"in self)){Z.warn("Push","Notifications not supported in this browser");return}if(await Notification.requestPermission()!=="granted"){Z.warn("Push","Notification permission denied");return}const{getMessaging:t,getToken:r,onMessage:a}=await ur(async()=>{const{getMessaging:b,getToken:y,onMessage:v}=await import("./index.esm-CvOpngZM.js");return{getMessaging:b,getToken:y,onMessage:v}},[]),{ensureFirebaseApp:o}=await ur(async()=>{const{ensureFirebaseApp:b}=await Promise.resolve().then(()=>VL);return{ensureFirebaseApp:b}},void 0),c=o();if(!c){Z.warn("Push","Firebase not configured (missing env vars)");return}const u=t(c),f=await navigator.serviceWorker.getRegistration();if(!f){Z.warn("Push","No service worker registration found");return}const h="BJQuKLWCFa67k1dakYUqnEkHFQK8YR6PxDJTDlkiscVWmQHu54E8_zy6-a40jPuFOI-aFELTNtlxOjyYDOvd3Tc",m=await r(u,{vapidKey:h,serviceWorkerRegistration:f});m&&(Z.info("Push",`FCM token obtained (${m.slice(0,20)}...)`),await U1.register(m,"web"),Z.info("Push","Token registered with backend")),a(u,b=>{Z.info("Push","Foreground FCM message received (suppressed)")})}catch(e){Z.error("Push","Web push init failed",e)}}async function d2(){try{const{PushNotifications:e}=await ur(async()=>{const{PushNotifications:r}=await import("./index-CxcpA4Qo.js");return{PushNotifications:r}},[]);if((await e.requestPermissions()).receive!=="granted"){Z.warn("Push","Native push permission denied");return}await e.register(),e.addListener("registration",async r=>{Z.info("Push",`Native push token: ${r.value.slice(0,20)}...`);const a=un.getPlatform();await U1.register(r.value,a),Z.info("Push","Native token registered with backend")}),e.addListener("registrationError",r=>{Z.error("Push","Native push registration failed",r)}),e.addListener("pushNotificationReceived",r=>{Z.info("Push","Foreground native notification (suppressed)")}),e.addListener("pushNotificationActionPerformed",r=>{var c,u;Z.info("Push","Notification tapped",r);const a=(c=r.notification)==null?void 0:c.data,o=((u=a==null?void 0:a.custom)==null?void 0:u.sessionKey)||(a==null?void 0:a.sessionKey);o&&(Z.info("Push",`Push nav target: ${o}`),Yh(o))})}catch(e){Z.error("Push","Native push init failed",e)}}function f2(e,t){e.send({type:"focus.update",sessionKey:t}),Z.info("Foreground",`Focus updated: ${t??"(none)"}`)}function h2(e){const{wsClient:t,getActiveSessionKey:r,onResume:a}=e,o=()=>{t.send({type:"foreground.enter",sessionKey:r()}),a==null||a(),Z.info("Foreground","Entered foreground")},c=()=>{t.send({type:"foreground.leave"}),Z.info("Foreground","Entered background")};if(un.isNativePlatform()){let f=null,h=!0;return ur(async()=>{const{App:m}=await import("./index-Bf-XL3te.js");return{App:m}},[]).then(({App:m})=>{const b=m.addListener("appStateChange",({isActive:y})=>{h=y,y?o():c()});f=()=>b.then(y=>y.remove())}),o(),{cleanup:()=>f==null?void 0:f(),resend:()=>{h?o():c()}}}const u=()=>{document.hidden?c():o()};return document.addEventListener("visibilitychange",u),document.hidden||o(),{cleanup:()=>document.removeEventListener("visibilitychange",u),resend:()=>{document.hidden?c():o()}}}function p2({onToggleTheme:e,onOpenSettings:t,theme:r}){var b,y,v,x,S,_,N,T,O,R;const a=Zn(),o=Rr(),[c,u]=_a.useState(!1),f=()=>{var M;Z.info("Auth",`Logout — user ${(M=a.user)==null?void 0:M.email}`),ai(null),Na(null),o({type:"LOGOUT"})},h=M=>{Z.info("Nav",`Switch view → ${M}`),o({type:"SET_ACTIVE_VIEW",view:M})},m=((v=(y=(b=a.user)==null?void 0:b.displayName)==null?void 0:y[0])==null?void 0:v.toUpperCase())??((_=(S=(x=a.user)==null?void 0:x.email)==null?void 0:S[0])==null?void 0:_.toUpperCase())??"?";return d.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:[d.jsx("button",{className:"w-8 h-8 rounded-lg flex items-center justify-center overflow-hidden hover:rounded-xl transition-all",title:"BotsChat",children:d.jsx("img",{src:"/botschat-logo.png",alt:"BotsChat",className:`w-8 h-8 ${r==="dark"?"invert":""}`})}),d.jsx("div",{className:"w-7 border-t my-1",style:{borderColor:"var(--sidebar-divider)"}}),d.jsx(Zc,{label:"Messages",active:a.activeView==="messages",onClick:()=>h("messages"),icon:d.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:d.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"})})}),d.jsx(Zc,{label:"Automations",active:a.activeView==="automations",onClick:()=>h("automations"),icon:d.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})})}),d.jsx("div",{className:"flex-1"}),d.jsx(Zc,{label:"Settings",active:!1,onClick:t,icon:d.jsxs("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[d.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"}),d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}),d.jsx(Zc,{label:r==="dark"?"Light mode":"Dark mode",active:!1,onClick:e,icon:r==="dark"?d.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:d.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"})}):d.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:d.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"})})}),d.jsxs("div",{className:"relative",children:[d.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:((N=a.user)==null?void 0:N.displayName)??((T=a.user)==null?void 0:T.email)??"User",children:m}),c&&d.jsx("div",{className:"fixed inset-0 z-50",onClick:()=>u(!1),children:d.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:M=>M.stopPropagation(),children:[d.jsxs("div",{className:"px-4 py-2.5",style:{borderBottom:"1px solid var(--border)"},children:[d.jsx("div",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:((O=a.user)==null?void 0:O.displayName)??"User"}),d.jsx("div",{className:"text-caption",style:{color:"var(--text-muted)"},children:(R=a.user)==null?void 0:R.email})]}),d.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:()=>{f(),u(!1)},onMouseEnter:M=>{M.currentTarget.style.background="var(--sidebar-hover)"},onMouseLeave:M=>{M.currentTarget.style.background=""},children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:d.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 Zc({label:e,active:t,icon:r,onClick:a}){return d.jsxs("div",{className:"relative flex items-center justify-center",children:[t&&d.jsx("div",{className:"absolute left-0 w-[3px] h-5 rounded-r-sm",style:{left:-4,background:"var(--text-sidebar-active)"}}),d.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:o=>{t||(o.currentTarget.style.background="var(--sidebar-hover)")},onMouseLeave:o=>{t||(o.currentTarget.style.background="")},title:e,"aria-label":e,children:r})]})}function Sl(){const e=C.useRef(!1),t=C.useRef(!1),r=C.useCallback(()=>{e.current=!0,t.current=!1},[]),a=C.useCallback(()=>{e.current=!1,t.current=!0,requestAnimationFrame(()=>{t.current=!1})},[]),o=C.useCallback(()=>e.current||t.current,[]);return{onCompositionStart:r,onCompositionEnd:a,isIMEActive:o}}function J1({onOpenSettings:e,onNavigate:t}={}){const r=Zn(),a=Rr(),[o,c]=C.useState(!1),[u,f]=C.useState(""),[h,m]=C.useState(""),{onCompositionStart:b,onCompositionEnd:y,isIMEActive:v}=Sl(),[x,S]=C.useState(!0),_=async()=>{if(u.trim()){Z.info("Channel",`Creating channel: "${u}"${h?` (${h})`:""}`);try{await cr.create({name:u,description:h});const{agents:w}=await Os.list(),{channels:D}=await cr.list();a({type:"SET_AGENTS",agents:w}),a({type:"SET_CHANNELS",channels:D});const F=w.find(J=>J.name===u.trim());if(F){Z.info("Channel",`Channel created → agent ${F.id}, auto-selected`),a({type:"SELECT_AGENT",agentId:F.id,sessionKey:F.sessionKey});try{localStorage.setItem("botschat_last_agent",F.id)}catch{}t==null||t()}c(!1),f(""),m("")}catch(w){Z.error("Channel",`Failed to create channel: ${w}`)}}},[N,T]=C.useState(null),O=(w,D)=>{if(r.activeView!=="messages"&&a({type:"SET_ACTIVE_VIEW",view:"messages"}),r.selectedAgentId===w){t==null||t();return}const F=r.agents.find(J=>J.id===w);Z.info("Channel",`Selected channel: ${(F==null?void 0:F.name)??w} (session=${D})`),a({type:"SELECT_AGENT",agentId:w,sessionKey:D}),t==null||t();try{localStorage.setItem("botschat_last_agent",w)}catch{}},R=async w=>{const D=r.channels.find(F=>F.id===w);Z.info("Channel",`Deleting channel: ${(D==null?void 0:D.name)??w}`);try{await cr.delete(w),Z.info("Channel",`Channel deleted: ${(D==null?void 0:D.name)??w}`);const F=r.agents.find($=>$.channelId===w);F&&r.selectedAgentId===F.id&&a({type:"SELECT_AGENT",agentId:null,sessionKey:null});const{agents:J}=await Os.list(),{channels:P}=await cr.list();a({type:"SET_AGENTS",agents:J}),a({type:"SET_CHANNELS",channels:P})}catch(F){Z.error("Channel",`Failed to delete channel: ${F}`)}finally{T(null)}},M=r.agents.filter(w=>w.isDefault),L=r.agents.filter(w=>!w.isDefault&&w.name!=="Default");return d.jsxs("div",{className:"flex flex-col",style:{background:"var(--bg-secondary)"},children:[d.jsxs("div",{className:"px-4 py-3 flex items-center gap-2",children:[d.jsx("span",{className:"text-[--text-sidebar-active] font-bold text-h2 truncate flex-1",children:"BotsChat"}),e&&d.jsx("button",{onClick:e,className:"p-1 rounded transition-colors hover:bg-[--sidebar-hover]",style:{color:"var(--text-sidebar)"},title:"Settings",children:d.jsxs("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[d.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"}),d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}),d.jsx("svg",{className:"w-3 h-3 text-[--text-sidebar]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),d.jsx("div",{className:"px-4 pb-2",children:d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:r.openclawConnected?"var(--accent-green)":"var(--accent-red)"}}),d.jsx("span",{className:"text-tiny text-[--text-muted]",children:r.openclawConnected?`${Object.values(r.agentConnections).filter(Boolean).length||1} agent(s) connected`:"No agents connected"})]})}),d.jsxs("div",{className:"flex-1 overflow-y-auto sidebar-scroll",children:[d.jsx(m2,{label:"Channels",expanded:x,onToggle:()=>S(!x),onAdd:w=>{w.stopPropagation(),x||S(!0),c(!o)}}),x&&d.jsxs("div",{children:[M.map(w=>d.jsx(Iv,{label:`# ${w.name}`,active:r.selectedAgentId===w.id,onClick:()=>O(w.id,w.sessionKey)},w.id)),L.map(w=>d.jsx(Iv,{label:`# ${w.name}`,active:r.selectedAgentId===w.id,onClick:()=>O(w.id,w.sessionKey),showDelete:!0,confirmDelete:N===w.channelId,onDeleteClick:D=>{D.stopPropagation(),T(w.channelId)},onDeleteConfirm:D=>{D.stopPropagation(),w.channelId&&R(w.channelId)},onDeleteCancel:D=>{D.stopPropagation(),T(null)}},w.id)),L.length===0&&M.length===0&&d.jsx("div",{className:"px-8 py-2 text-tiny text-[--text-muted]",children:"Loading channels…"}),o&&d.jsxs("div",{className:"px-4 py-2 space-y-2",children:[d.jsx("input",{type:"text",placeholder:"Channel name",value:u,onChange:w=>f(w.target.value),onKeyDown:w=>w.key==="Enter"&&!w.nativeEvent.isComposing&&!v()&&_(),onCompositionStart:b,onCompositionEnd: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}),d.jsx("input",{type:"text",placeholder:"Description (optional)",value:h,onChange:w=>m(w.target.value),onKeyDown:w=>w.key==="Enter"&&!w.nativeEvent.isComposing&&!v()&&_(),onCompositionStart:b,onCompositionEnd: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)"}}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{onClick:_,className:"flex-1 px-3 py-1.5 text-caption bg-[--bg-active] text-white rounded-sm font-bold hover:brightness-110",children:"Create"}),d.jsx("button",{onClick:()=>c(!1),className:"px-3 py-1.5 text-caption text-[--text-muted] hover:text-[--text-sidebar]",children:"Cancel"})]})]})]})]})]})}function m2({label:e,expanded:t,onToggle:r,onAdd:a}){return d.jsxs("div",{className:"w-full flex items-center px-4 py-1.5",children:[d.jsxs("button",{onClick:r,className:"flex items-center gap-1 text-tiny uppercase tracking-wider text-[--text-sidebar] hover:text-[--text-sidebar-active] transition-colors",children:[d.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:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})}),e]}),a&&d.jsx("button",{onClick:a,className:"ml-auto p-0.5 rounded transition-colors text-[--text-sidebar] hover:text-[--text-sidebar-active] hover:bg-[--sidebar-hover]",title:`New ${e.toLowerCase().replace(/s$/,"")}`,children:d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})})})]})}function Iv({label:e,active:t,onClick:r,showDelete:a,confirmDelete:o,onDeleteClick:c,onDeleteConfirm:u,onDeleteCancel:f}){const[h,m]=C.useState(!1),b=C.useRef(null);return C.useEffect(()=>{if(!o)return;const y=v=>{b.current&&!b.current.contains(v.target)&&(f==null||f(v))};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[o,f]),o?d.jsxs("div",{ref:b,className:"px-4 py-1.5 flex items-center gap-1.5",style:{paddingLeft:32,background:"var(--sidebar-hover)"},children:[d.jsx("span",{className:"text-caption text-[--text-sidebar] truncate flex-1",children:"Delete?"}),d.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"}),d.jsx("button",{onClick:f,className:"px-1.5 py-0.5 text-tiny rounded-sm text-[--text-muted] hover:text-[--text-sidebar]",children:"No"})]}):d.jsxs("div",{className:"relative group",onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),children:[d.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&&d.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:d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.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 g2(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const b2=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,y2=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,v2={};function Lv(e,t){return(v2.jsx?y2:b2).test(e)}const x2=/[ \t\n\f\r]/g;function E2(e){return typeof e=="object"?e.type==="text"?Dv(e.value):!1:Dv(e)}function Dv(e){return e.replace(x2,"")===""}class _l{constructor(t,r,a){this.normal=r,this.property=t,a&&(this.space=a)}}_l.prototype.normal={};_l.prototype.property={};_l.prototype.space=void 0;function Q1(e,t){const r={},a={};for(const o of e)Object.assign(r,o.property),Object.assign(a,o.normal);return new _l(r,a,t)}function Xh(e){return e.toLowerCase()}class Bn{constructor(t,r){this.attribute=r,this.property=t}}Bn.prototype.attribute="";Bn.prototype.booleanish=!1;Bn.prototype.boolean=!1;Bn.prototype.commaOrSpaceSeparated=!1;Bn.prototype.commaSeparated=!1;Bn.prototype.defined=!1;Bn.prototype.mustUseProperty=!1;Bn.prototype.number=!1;Bn.prototype.overloadedBoolean=!1;Bn.prototype.property="";Bn.prototype.spaceSeparated=!1;Bn.prototype.space=void 0;let S2=0;const Xe=Oa(),Qt=Oa(),Zh=Oa(),ge=Oa(),Rt=Oa(),Ms=Oa(),Yn=Oa();function Oa(){return 2**++S2}const Jh=Object.freeze(Object.defineProperty({__proto__:null,boolean:Xe,booleanish:Qt,commaOrSpaceSeparated:Yn,commaSeparated:Ms,number:ge,overloadedBoolean:Zh,spaceSeparated:Rt},Symbol.toStringTag,{value:"Module"})),oh=Object.keys(Jh);class Ip extends Bn{constructor(t,r,a,o){let c=-1;if(super(t,r),jv(this,"space",o),typeof a=="number")for(;++c<oh.length;){const u=oh[c];jv(this,oh[c],(a&Jh[u])===Jh[u])}}}Ip.prototype.defined=!0;function jv(e,t,r){r&&(e[t]=r)}function $s(e){const t={},r={};for(const[a,o]of Object.entries(e.properties)){const c=new Ip(a,e.transform(e.attributes||{},a),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(c.mustUseProperty=!0),t[a]=c,r[Xh(a)]=a,r[Xh(c.attribute)]=a}return new _l(t,r,e.space)}const e0=$s({properties:{ariaActiveDescendant:null,ariaAtomic:Qt,ariaAutoComplete:null,ariaBusy:Qt,ariaChecked:Qt,ariaColCount:ge,ariaColIndex:ge,ariaColSpan:ge,ariaControls:Rt,ariaCurrent:null,ariaDescribedBy:Rt,ariaDetails:null,ariaDisabled:Qt,ariaDropEffect:Rt,ariaErrorMessage:null,ariaExpanded:Qt,ariaFlowTo:Rt,ariaGrabbed:Qt,ariaHasPopup:null,ariaHidden:Qt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Rt,ariaLevel:ge,ariaLive:null,ariaModal:Qt,ariaMultiLine:Qt,ariaMultiSelectable:Qt,ariaOrientation:null,ariaOwns:Rt,ariaPlaceholder:null,ariaPosInSet:ge,ariaPressed:Qt,ariaReadOnly:Qt,ariaRelevant:null,ariaRequired:Qt,ariaRoleDescription:Rt,ariaRowCount:ge,ariaRowIndex:ge,ariaRowSpan:ge,ariaSelected:Qt,ariaSetSize:ge,ariaSort:null,ariaValueMax:ge,ariaValueMin:ge,ariaValueNow:ge,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function t0(e,t){return t in e?e[t]:t}function n0(e,t){return t0(e,t.toLowerCase())}const _2=$s({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ms,acceptCharset:Rt,accessKey:Rt,action:null,allow:null,allowFullScreen:Xe,allowPaymentRequest:Xe,allowUserMedia:Xe,alt:null,as:null,async:Xe,autoCapitalize:null,autoComplete:Rt,autoFocus:Xe,autoPlay:Xe,blocking:Rt,capture:null,charSet:null,checked:Xe,cite:null,className:Rt,cols:ge,colSpan:null,content:null,contentEditable:Qt,controls:Xe,controlsList:Rt,coords:ge|Ms,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Xe,defer:Xe,dir:null,dirName:null,disabled:Xe,download:Zh,draggable:Qt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Xe,formTarget:null,headers:Rt,height:ge,hidden:Zh,high:ge,href:null,hrefLang:null,htmlFor:Rt,httpEquiv:Rt,id:null,imageSizes:null,imageSrcSet:null,inert:Xe,inputMode:null,integrity:null,is:null,isMap:Xe,itemId:null,itemProp:Rt,itemRef:Rt,itemScope:Xe,itemType:Rt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Xe,low:ge,manifest:null,max:null,maxLength:ge,media:null,method:null,min:null,minLength:ge,multiple:Xe,muted:Xe,name:null,nonce:null,noModule:Xe,noValidate:Xe,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:Xe,optimum:ge,pattern:null,ping:Rt,placeholder:null,playsInline:Xe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Xe,referrerPolicy:null,rel:Rt,required:Xe,reversed:Xe,rows:ge,rowSpan:ge,sandbox:Rt,scope:null,scoped:Xe,seamless:Xe,selected:Xe,shadowRootClonable:Xe,shadowRootDelegatesFocus:Xe,shadowRootMode:null,shape:null,size:ge,sizes:null,slot:null,span:ge,spellCheck:Qt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ge,step:null,style:null,tabIndex:ge,target:null,title:null,translate:null,type:null,typeMustMatch:Xe,useMap:null,value:Qt,width:ge,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Rt,axis:null,background:null,bgColor:null,border:ge,borderColor:null,bottomMargin:ge,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Xe,declare:Xe,event:null,face:null,frame:null,frameBorder:null,hSpace:ge,leftMargin:ge,link:null,longDesc:null,lowSrc:null,marginHeight:ge,marginWidth:ge,noResize:Xe,noHref:Xe,noShade:Xe,noWrap:Xe,object:null,profile:null,prompt:null,rev:null,rightMargin:ge,rules:null,scheme:null,scrolling:Qt,standby:null,summary:null,text:null,topMargin:ge,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ge,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Xe,disableRemotePlayback:Xe,prefix:null,property:null,results:ge,security:null,unselectable:null},space:"html",transform:n0}),w2=$s({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:Yn,accentHeight:ge,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ge,amplitude:ge,arabicForm:null,ascent:ge,attributeName:null,attributeType:null,azimuth:ge,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ge,by:null,calcMode:null,capHeight:ge,className:Rt,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:ge,diffuseConstant:ge,direction:null,display:null,dur:null,divisor:ge,dominantBaseline:null,download:Xe,dx:null,dy:null,edgeMode:null,editable:null,elevation:ge,enableBackground:null,end:null,event:null,exponent:ge,externalResourcesRequired:null,fill:null,fillOpacity:ge,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:Ms,g2:Ms,glyphName:Ms,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ge,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ge,horizOriginX:ge,horizOriginY:ge,id:null,ideographic:ge,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ge,k:ge,k1:ge,k2:ge,k3:ge,k4:ge,kernelMatrix:Yn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ge,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:ge,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:ge,overlineThickness:ge,paintOrder:null,panose1:null,path:null,pathLength:ge,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Rt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ge,pointsAtY:ge,pointsAtZ:ge,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Yn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Yn,rev:Yn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Yn,requiredFeatures:Yn,requiredFonts:Yn,requiredFormats:Yn,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:ge,specularExponent:ge,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ge,strikethroughThickness:ge,string:null,stroke:null,strokeDashArray:Yn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ge,strokeOpacity:ge,strokeWidth:null,style:null,surfaceScale:ge,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Yn,tabIndex:ge,tableValues:null,target:null,targetX:ge,targetY:ge,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Yn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ge,underlineThickness:ge,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ge,values:null,vAlphabetic:ge,vMathematical:ge,vectorEffect:null,vHanging:ge,vIdeographic:ge,version:null,vertAdvY:ge,vertOriginX:ge,vertOriginY:ge,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ge,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:t0}),r0=$s({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()}}),i0=$s({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:n0}),a0=$s({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),k2={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"},T2=/[A-Z]/g,zv=/-[a-z]/g,N2=/^data[-\w.:]+$/i;function C2(e,t){const r=Xh(t);let a=t,o=Bn;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&N2.test(t)){if(t.charAt(4)==="-"){const c=t.slice(5).replace(zv,O2);a="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=t.slice(4);if(!zv.test(c)){let u=c.replace(T2,A2);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}o=Ip}return new o(a,t)}function A2(e){return"-"+e.toLowerCase()}function O2(e){return e.charAt(1).toUpperCase()}const M2=Q1([e0,_2,r0,i0,a0],"html"),Lp=Q1([e0,w2,r0,i0,a0],"svg");function R2(e){return e.join(" ").trim()}var vs={},lh,Bv;function I2(){if(Bv)return lh;Bv=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
|
|
50
|
-
`,m="/",b="*",y="",v="comment",x="declaration";function S(N,T){if(typeof N!="string")throw new TypeError("First argument must be a string");if(!N)return[];T=T||{};var O=1,R=1;function M(se){var V=se.match(t);V&&(O+=V.length);var z=se.lastIndexOf(h);R=~z?se.length-z:R+se.length}function L(){var se={line:O,column:R};return function(V){return V.position=new w(se),J(),V}}function w(se){this.start=se,this.end={line:O,column:R},this.source=T.source}w.prototype.content=N;function D(se){var V=new Error(T.source+":"+O+":"+R+": "+se);if(V.reason=se,V.filename=T.source,V.line=O,V.column=R,V.source=N,!T.silent)throw V}function F(se){var V=se.exec(N);if(V){var z=V[0];return M(z),N=N.slice(z.length),V}}function J(){F(r)}function P(se){var V;for(se=se||[];V=$();)V!==!1&&se.push(V);return se}function $(){var se=L();if(!(m!=N.charAt(0)||b!=N.charAt(1))){for(var V=2;y!=N.charAt(V)&&(b!=N.charAt(V)||m!=N.charAt(V+1));)++V;if(V+=2,y===N.charAt(V-1))return D("End of comment missing");var z=N.slice(2,V-2);return R+=2,M(z),N=N.slice(V),R+=2,se({type:v,comment:z})}}function Y(){var se=L(),V=F(a);if(V){if($(),!F(o))return D("property missing ':'");var z=F(c),re=se({type:x,property:_(V[0].replace(e,y)),value:z?_(z[0].replace(e,y)):y});return F(u),re}}function te(){var se=[];P(se);for(var V;V=Y();)V!==!1&&(se.push(V),P(se));return se}return J(),te()}function _(N){return N?N.replace(f,y):y}return lh=S,lh}var Uv;function L2(){if(Uv)return vs;Uv=1;var e=vs&&vs.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(vs,"__esModule",{value:!0}),vs.default=r;const t=e(I2());function r(a,o){let c=null;if(!a||typeof a!="string")return c;const u=(0,t.default)(a),f=typeof o=="function";return u.forEach(h=>{if(h.type!=="declaration")return;const{property:m,value:b}=h;f?o(m,b,h):b&&(c=c||{},c[m]=b)}),c}return vs}var Go={},Pv;function D2(){if(Pv)return Go;Pv=1,Object.defineProperty(Go,"__esModule",{value:!0}),Go.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,r=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,c=function(m){return!m||r.test(m)||e.test(m)},u=function(m,b){return b.toUpperCase()},f=function(m,b){return"".concat(b,"-")},h=function(m,b){return b===void 0&&(b={}),c(m)?m:(m=m.toLowerCase(),b.reactCompat?m=m.replace(o,f):m=m.replace(a,f),m.replace(t,u))};return Go.camelCase=h,Go}var Ko,Hv;function j2(){if(Hv)return Ko;Hv=1;var e=Ko&&Ko.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(L2()),r=D2();function a(o,c){var u={};return!o||typeof o!="string"||(0,t.default)(o,function(f,h){f&&h&&(u[(0,r.camelCase)(f,c)]=h)}),u}return a.default=a,Ko=a,Ko}var z2=j2();const B2=El(z2),s0=o0("end"),Dp=o0("start");function o0(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 U2(e){const t=Dp(e),r=s0(e);if(t&&r)return{start:t,end:r}}function il(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Fv(e.position):"start"in e||"end"in e?Fv(e):"line"in e||"column"in e?Qh(e):""}function Qh(e){return $v(e&&e.line)+":"+$v(e&&e.column)}function Fv(e){return Qh(e&&e.start)+"-"+Qh(e&&e.end)}function $v(e){return e&&typeof e=="number"?e:1}class gn extends Error{constructor(t,r,a){super(),typeof r=="string"&&(a=r,r=void 0);let o="",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"?o=t:!c.cause&&t&&(u=!0,o=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 f=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=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=f?f.line:void 0,this.name=il(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}}gn.prototype.file="";gn.prototype.name="";gn.prototype.reason="";gn.prototype.message="";gn.prototype.stack="";gn.prototype.column=void 0;gn.prototype.line=void 0;gn.prototype.ancestors=void 0;gn.prototype.cause=void 0;gn.prototype.fatal=void 0;gn.prototype.place=void 0;gn.prototype.ruleId=void 0;gn.prototype.source=void 0;const jp={}.hasOwnProperty,P2=new Map,H2=/[A-Z]/g,F2=new Set(["table","tbody","thead","tfoot","tr"]),$2=new Set(["td","th"]),l0="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function G2(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=J2(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=Z2(r,t.jsx,t.jsxs)}const o={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:M2,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},c=c0(o,e,void 0);return c&&typeof c!="string"?c:o.create(e,o.Fragment,{children:c||void 0},void 0)}function c0(e,t,r){if(t.type==="element")return K2(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return V2(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Y2(e,t,r);if(t.type==="mdxjsEsm")return q2(e,t);if(t.type==="root")return W2(e,t,r);if(t.type==="text")return X2(e,t)}function K2(e,t,r){const a=e.schema;let o=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(o=Lp,e.schema=o),e.ancestors.push(t);const c=d0(e,t.tagName,!1),u=Q2(e,t);let f=Bp(e,t);return F2.has(t.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!E2(h):!0})),u0(e,u,c,t),zp(u,f),e.ancestors.pop(),e.schema=a,e.create(t,c,u,r)}function V2(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)}ml(e,t.position)}function q2(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ml(e,t.position)}function Y2(e,t,r){const a=e.schema;let o=a;t.name==="svg"&&a.space==="html"&&(o=Lp,e.schema=o),e.ancestors.push(t);const c=t.name===null?e.Fragment:d0(e,t.name,!0),u=eT(e,t),f=Bp(e,t);return u0(e,u,c,t),zp(u,f),e.ancestors.pop(),e.schema=a,e.create(t,c,u,r)}function W2(e,t,r){const a={};return zp(a,Bp(e,t)),e.create(t,e.Fragment,a,r)}function X2(e,t){return t.value}function u0(e,t,r,a){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=a)}function zp(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function Z2(e,t,r){return a;function a(o,c,u,f){const m=Array.isArray(u.children)?r:t;return f?m(c,u,f):m(c,u)}}function J2(e,t){return r;function r(a,o,c,u){const f=Array.isArray(c.children),h=Dp(a);return t(o,c,u,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function Q2(e,t){const r={};let a,o;for(o in t.properties)if(o!=="children"&&jp.call(t.properties,o)){const c=tT(e,o,t.properties[o]);if(c){const[u,f]=c;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&$2.has(t.tagName)?a=f:r[u]=f}}if(a){const c=r.style||(r.style={});c[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return r}function eT(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 f=u.properties[0];f.type,Object.assign(r,e.evaluater.evaluateExpression(f.argument))}else ml(e,t.position);else{const o=a.name;let c;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const f=a.value.data.estree.body[0];f.type,c=e.evaluater.evaluateExpression(f.expression)}else ml(e,t.position);else c=a.value===null?!0:a.value;r[o]=c}return r}function Bp(e,t){const r=[];let a=-1;const o=e.passKeys?new Map:P2;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 m=o.get(h)||0;u=h+"-"+m,o.set(h,m+1)}}const f=c0(e,c,u);f!==void 0&&r.push(f)}return r}function tT(e,t,r){const a=C2(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=a.commaSeparated?g2(r):R2(r)),a.property==="style"){let o=typeof r=="object"?r:nT(e,String(r));return e.stylePropertyNameCase==="css"&&(o=rT(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&a.space?k2[a.property]||a.property:a.attribute,r]}}function nT(e,t){try{return B2(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const a=r,o=new gn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=l0+"#cannot-parse-style-attribute",o}}function d0(e,t,r){let a;if(!r)a={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let c=-1,u;for(;++c<o.length;){const f=Lv(o[c])?{type:"Identifier",name:o[c]}:{type:"Literal",value:o[c]};u=u?{type:"MemberExpression",object:u,property:f,computed:!!(c&&f.type==="Literal"),optional:!1}:f}a=u}else a=Lv(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const o=a.value;return jp.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(a);ml(e)}function ml(e,t){const r=new gn("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=l0+"#cannot-handle-mdx-estrees-without-createevaluater",r}function rT(e){const t={};let r;for(r in e)jp.call(e,r)&&(t[iT(r)]=e[r]);return t}function iT(e){let t=e.replace(H2,aT);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function aT(e){return"-"+e.toLowerCase()}const ch={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"]},sT={};function Up(e,t){const r=sT,a=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,o=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return f0(e,a,o)}function f0(e,t,r){if(oT(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 Gv(e.children,t,r)}return Array.isArray(e)?Gv(e,t,r):""}function Gv(e,t,r){const a=[];let o=-1;for(;++o<e.length;)a[o]=f0(e[o],t,r);return a.join("")}function oT(e){return!!(e&&typeof e=="object")}const Kv=document.createElement("i");function Pp(e){const t="&"+e+";";Kv.innerHTML=t;const r=Kv.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function Xn(e,t,r,a){const o=e.length;let c=0,u;if(t<0?t=-t>o?0:o+t:t=t>o?o: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 lr(e,t){return e.length>0?(Xn(e,e.length,0,t),e):t}const Vv={}.hasOwnProperty;function h0(e){const t={};let r=-1;for(;++r<e.length;)lT(t,e[r]);return t}function lT(e,t){let r;for(r in t){const o=(Vv.call(e,r)?e[r]:void 0)||(e[r]={}),c=t[r];let u;if(c)for(u in c){Vv.call(o,u)||(o[u]=[]);const f=c[u];cT(o[u],Array.isArray(f)?f:f?[f]:[])}}}function cT(e,t){let r=-1;const a=[];for(;++r<t.length;)(t[r].add==="after"?e:a).push(t[r]);Xn(e,0,0,a)}function p0(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 gr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Sn=Yi(/[A-Za-z]/),mn=Yi(/[\dA-Za-z]/),uT=Yi(/[#-'*+\--9=?A-Z^-~]/);function _u(e){return e!==null&&(e<32||e===127)}const ep=Yi(/\d/),dT=Yi(/[\dA-Fa-f]/),fT=Yi(/[!-/:-@[-`{-~]/);function Le(e){return e!==null&&e<-2}function Ot(e){return e!==null&&(e<0||e===32)}function nt(e){return e===-2||e===-1||e===32}const Bu=Yi(new RegExp("\\p{P}|\\p{S}","u")),Ca=Yi(/\s/);function Yi(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function Gs(e){const t=[];let r=-1,a=0,o=0;for(;++r<e.length;){const c=e.charCodeAt(r);let u="";if(c===37&&mn(e.charCodeAt(r+1))&&mn(e.charCodeAt(r+2)))o=2;else if(c<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(c))||(u=String.fromCharCode(c));else if(c>55295&&c<57344){const f=e.charCodeAt(r+1);c<56320&&f>56319&&f<57344?(u=String.fromCharCode(c,f),o=1):u="�"}else u=String.fromCharCode(c);u&&(t.push(e.slice(a,r),encodeURIComponent(u)),a=r+o+1,u=""),o&&(r+=o,o=0)}return t.join("")+e.slice(a)}function lt(e,t,r,a){const o=a?a-1:Number.POSITIVE_INFINITY;let c=0;return u;function u(h){return nt(h)?(e.enter(r),f(h)):t(h)}function f(h){return nt(h)&&c++<o?(e.consume(h),f):(e.exit(r),t(h))}}const hT={tokenize:pT};function pT(e){const t=e.attempt(this.parser.constructs.contentInitial,a,o);let r;return t;function a(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),lt(e,t,"linePrefix")}function o(f){return e.enter("paragraph"),c(f)}function c(f){const h=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=h),r=h,u(f)}function u(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Le(f)?(e.consume(f),e.exit("chunkText"),c):(e.consume(f),u)}}const mT={tokenize:gT},qv={tokenize:bT};function gT(e){const t=this,r=[];let a=0,o,c,u;return f;function f(R){if(a<r.length){const M=r[a];return t.containerState=M[1],e.attempt(M[0].continuation,h,m)(R)}return m(R)}function h(R){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&O();const M=t.events.length;let L=M,w;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){w=t.events[L][1].end;break}T(a);let D=M;for(;D<t.events.length;)t.events[D][1].end={...w},D++;return Xn(t.events,L+1,0,t.events.slice(M)),t.events.length=D,m(R)}return f(R)}function m(R){if(a===r.length){if(!o)return v(R);if(o.currentConstruct&&o.currentConstruct.concrete)return S(R);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(qv,b,y)(R)}function b(R){return o&&O(),T(a),v(R)}function y(R){return t.parser.lazy[t.now().line]=a!==r.length,u=t.now().offset,S(R)}function v(R){return t.containerState={},e.attempt(qv,x,S)(R)}function x(R){return a++,r.push([t.currentConstruct,t.containerState]),v(R)}function S(R){if(R===null){o&&O(),T(0),e.consume(R);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:c}),_(R)}function _(R){if(R===null){N(e.exit("chunkFlow"),!0),T(0),e.consume(R);return}return Le(R)?(e.consume(R),N(e.exit("chunkFlow")),a=0,t.interrupt=void 0,f):(e.consume(R),_)}function N(R,M){const L=t.sliceStream(R);if(M&&L.push(null),R.previous=c,c&&(c.next=R),c=R,o.defineSkip(R.start),o.write(L),t.parser.lazy[R.start.line]){let w=o.events.length;for(;w--;)if(o.events[w][1].start.offset<u&&(!o.events[w][1].end||o.events[w][1].end.offset>u))return;const D=t.events.length;let F=D,J,P;for(;F--;)if(t.events[F][0]==="exit"&&t.events[F][1].type==="chunkFlow"){if(J){P=t.events[F][1].end;break}J=!0}for(T(a),w=D;w<t.events.length;)t.events[w][1].end={...P},w++;Xn(t.events,F+1,0,t.events.slice(D)),t.events.length=w}}function T(R){let M=r.length;for(;M-- >R;){const L=r[M];t.containerState=L[1],L[0].exit.call(t,e)}r.length=R}function O(){o.write([null]),c=void 0,o=void 0,t.containerState._closeFlow=void 0}}function bT(e,t,r){return lt(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Bs(e){if(e===null||Ot(e)||Ca(e))return 1;if(Bu(e))return 2}function Uu(e,t,r){const a=[];let o=-1;for(;++o<e.length;){const c=e[o].resolveAll;c&&!a.includes(c)&&(t=c(t,r),a.push(c))}return t}const tp={name:"attention",resolveAll:yT,tokenize:vT};function yT(e,t){let r=-1,a,o,c,u,f,h,m,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};Yv(y,-h),Yv(v,h),u={type:h>1?"strongSequence":"emphasisSequence",start:y,end:{...e[a][1].end}},f={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}},o={type:h>1?"strong":"emphasis",start:{...u.start},end:{...f.end}},e[a][1].end={...u.start},e[r][1].start={...f.end},m=[],e[a][1].end.offset-e[a][1].start.offset&&(m=lr(m,[["enter",e[a][1],t],["exit",e[a][1],t]])),m=lr(m,[["enter",o,t],["enter",u,t],["exit",u,t],["enter",c,t]]),m=lr(m,Uu(t.parser.constructs.insideSpan.null,e.slice(a+1,r),t)),m=lr(m,[["exit",c,t],["enter",f,t],["exit",f,t],["exit",o,t]]),e[r][1].end.offset-e[r][1].start.offset?(b=2,m=lr(m,[["enter",e[r][1],t],["exit",e[r][1],t]])):b=0,Xn(e,a-1,r-a+3,m),r=a+m.length-b-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function vT(e,t){const r=this.parser.constructs.attentionMarkers.null,a=this.previous,o=Bs(a);let c;return u;function u(h){return c=h,e.enter("attentionSequence"),f(h)}function f(h){if(h===c)return e.consume(h),f;const m=e.exit("attentionSequence"),b=Bs(h),y=!b||b===2&&o||r.includes(h),v=!o||o===2&&b||r.includes(a);return m._open=!!(c===42?y:y&&(o||!v)),m._close=!!(c===42?v:v&&(b||!y)),t(h)}}function Yv(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const xT={name:"autolink",tokenize:ET};function ET(e,t,r){let a=0;return o;function o(x){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),c}function c(x){return Sn(x)?(e.consume(x),u):x===64?r(x):m(x)}function u(x){return x===43||x===45||x===46||mn(x)?(a=1,f(x)):m(x)}function f(x){return x===58?(e.consume(x),a=0,h):(x===43||x===45||x===46||mn(x))&&a++<32?(e.consume(x),f):(a=0,m(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||_u(x)?r(x):(e.consume(x),h)}function m(x){return x===64?(e.consume(x),b):uT(x)?(e.consume(x),m):r(x)}function b(x){return mn(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||mn(x))&&a++<63){const S=x===45?v:y;return e.consume(x),S}return r(x)}}const wl={partial:!0,tokenize:ST};function ST(e,t,r){return a;function a(c){return nt(c)?lt(e,o,"linePrefix")(c):o(c)}function o(c){return c===null||Le(c)?t(c):r(c)}}const m0={continuation:{tokenize:wT},exit:kT,name:"blockQuote",tokenize:_T};function _T(e,t,r){const a=this;return o;function o(u){if(u===62){const f=a.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),c}return r(u)}function c(u){return nt(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function wT(e,t,r){const a=this;return o;function o(u){return nt(u)?lt(e,c,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):c(u)}function c(u){return e.attempt(m0,t,r)(u)}}function kT(e){e.exit("blockQuote")}const g0={name:"characterEscape",tokenize:TT};function TT(e,t,r){return a;function a(c){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(c),e.exit("escapeMarker"),o}function o(c){return fT(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(c)}}const b0={name:"characterReference",tokenize:NT};function NT(e,t,r){const a=this;let o=0,c,u;return f;function f(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"),m):(e.enter("characterReferenceValue"),c=31,u=mn,b(y))}function m(y){return y===88||y===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(y),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),c=6,u=dT,b):(e.enter("characterReferenceValue"),c=7,u=ep,b(y))}function b(y){if(y===59&&o){const v=e.exit("characterReferenceValue");return u===mn&&!Pp(a.sliceSerialize(v))?r(y):(e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(y)&&o++<c?(e.consume(y),b):r(y)}}const Wv={partial:!0,tokenize:AT},Xv={concrete:!0,name:"codeFenced",tokenize:CT};function CT(e,t,r){const a=this,o={partial:!0,tokenize:L};let c=0,u=0,f;return h;function h(w){return m(w)}function m(w){const D=a.events[a.events.length-1];return c=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,f=w,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),b(w)}function b(w){return w===f?(u++,e.consume(w),b):u<3?r(w):(e.exit("codeFencedFenceSequence"),nt(w)?lt(e,y,"whitespace")(w):y(w))}function y(w){return w===null||Le(w)?(e.exit("codeFencedFence"),a.interrupt?t(w):e.check(Wv,_,M)(w)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(w))}function v(w){return w===null||Le(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),y(w)):nt(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),lt(e,x,"whitespace")(w)):w===96&&w===f?r(w):(e.consume(w),v)}function x(w){return w===null||Le(w)?y(w):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(w))}function S(w){return w===null||Le(w)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),y(w)):w===96&&w===f?r(w):(e.consume(w),S)}function _(w){return e.attempt(o,M,N)(w)}function N(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),T}function T(w){return c>0&&nt(w)?lt(e,O,"linePrefix",c+1)(w):O(w)}function O(w){return w===null||Le(w)?e.check(Wv,_,M)(w):(e.enter("codeFlowValue"),R(w))}function R(w){return w===null||Le(w)?(e.exit("codeFlowValue"),O(w)):(e.consume(w),R)}function M(w){return e.exit("codeFenced"),t(w)}function L(w,D,F){let J=0;return P;function P(V){return w.enter("lineEnding"),w.consume(V),w.exit("lineEnding"),$}function $(V){return w.enter("codeFencedFence"),nt(V)?lt(w,Y,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):Y(V)}function Y(V){return V===f?(w.enter("codeFencedFenceSequence"),te(V)):F(V)}function te(V){return V===f?(J++,w.consume(V),te):J>=u?(w.exit("codeFencedFenceSequence"),nt(V)?lt(w,se,"whitespace")(V):se(V)):F(V)}function se(V){return V===null||Le(V)?(w.exit("codeFencedFence"),D(V)):F(V)}}}function AT(e,t,r){const a=this;return o;function o(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 uh={name:"codeIndented",tokenize:MT},OT={partial:!0,tokenize:RT};function MT(e,t,r){const a=this;return o;function o(m){return e.enter("codeIndented"),lt(e,c,"linePrefix",5)(m)}function c(m){const b=a.events[a.events.length-1];return b&&b[1].type==="linePrefix"&&b[2].sliceSerialize(b[1],!0).length>=4?u(m):r(m)}function u(m){return m===null?h(m):Le(m)?e.attempt(OT,u,h)(m):(e.enter("codeFlowValue"),f(m))}function f(m){return m===null||Le(m)?(e.exit("codeFlowValue"),u(m)):(e.consume(m),f)}function h(m){return e.exit("codeIndented"),t(m)}}function RT(e,t,r){const a=this;return o;function o(u){return a.parser.lazy[a.now().line]?r(u):Le(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o):lt(e,c,"linePrefix",5)(u)}function c(u){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):Le(u)?o(u):r(u)}}const IT={name:"codeText",previous:DT,resolve:LT,tokenize:jT};function LT(e){let t=e.length-4,r=3,a,o;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;)o===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(o=a):(a===t||e[a][1].type==="lineEnding")&&(e[o][1].type="codeTextData",a!==o+2&&(e[o][1].end=e[a-1][1].end,e.splice(o+2,a-o-2),t-=a-o-2,a=o+2),o=void 0);return e}function DT(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function jT(e,t,r){let a=0,o,c;return u;function u(y){return e.enter("codeText"),e.enter("codeTextSequence"),f(y)}function f(y){return y===96?(e.consume(y),a++,f):(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"),o=0,b(y)):Le(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),h):(e.enter("codeTextData"),m(y))}function m(y){return y===null||y===32||y===96||Le(y)?(e.exit("codeTextData"),h(y)):(e.consume(y),m)}function b(y){return y===96?(e.consume(y),o++,b):o===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(y)):(c.type="codeTextData",m(y))}}class zT{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 o=r||0;this.setCursor(Math.trunc(t));const c=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return a&&Vo(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),Vo(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Vo(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);Vo(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Vo(this.left,r.reverse())}}}function Vo(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 y0(e){const t={};let r=-1,a,o,c,u,f,h,m;const b=new zT(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,BT(b,r)),r=t[r],m=!0);else if(a[1]._container){for(c=r,o=void 0;c--;)if(u=b.get(c),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(o&&(b.get(o)[1].type="lineEndingBlank"),u[1].type="lineEnding",o=c);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;o&&(a[1].end={...b.get(o)[1].start},f=b.slice(o,r),f.unshift(a),b.splice(o,r-o+1,f))}}return Xn(e,0,Number.POSITIVE_INFINITY,b.slice(0)),!m}function BT(e,t){const r=e.get(t)[1],a=e.get(t)[2];let o=t-1;const c=[];let u=r._tokenizer;u||(u=a.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const f=u.events,h=[],m={};let b,y,v=-1,x=r,S=0,_=0;const N=[_];for(;x;){for(;e.get(++o)[1]!==x;);c.push(o),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<f.length;)f[v][0]==="exit"&&f[v-1][0]==="enter"&&f[v][1].type===f[v-1][1].type&&f[v][1].start.line!==f[v][1].end.line&&(_=v+1,N.push(_),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(u.events=[],x?(x._tokenizer=void 0,x.previous=void 0):N.pop(),v=N.length;v--;){const T=f.slice(N[v],N[v+1]),O=c.pop();h.push([O,O+T.length-1]),e.splice(O,2,T)}for(h.reverse(),v=-1;++v<h.length;)m[S+h[v][0]]=S+h[v][1],S+=h[v][1]-h[v][0]-1;return m}const UT={resolve:HT,tokenize:FT},PT={partial:!0,tokenize:$T};function HT(e){return y0(e),e}function FT(e,t){let r;return a;function a(f){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),o(f)}function o(f){return f===null?c(f):Le(f)?e.check(PT,u,c)(f):(e.consume(f),o)}function c(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function u(f){return e.consume(f),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,o}}function $T(e,t,r){const a=this;return o;function o(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),lt(e,c,"linePrefix")}function c(u){if(u===null||Le(u))return r(u);const f=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):e.interrupt(a.parser.constructs.flow,r,t)(u)}}function v0(e,t,r,a,o,c,u,f,h){const m=h||Number.POSITIVE_INFINITY;let b=0;return y;function y(T){return T===60?(e.enter(a),e.enter(o),e.enter(c),e.consume(T),e.exit(c),v):T===null||T===32||T===41||_u(T)?r(T):(e.enter(a),e.enter(u),e.enter(f),e.enter("chunkString",{contentType:"string"}),_(T))}function v(T){return T===62?(e.enter(c),e.consume(T),e.exit(c),e.exit(o),e.exit(a),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),x(T))}function x(T){return T===62?(e.exit("chunkString"),e.exit(f),v(T)):T===null||T===60||Le(T)?r(T):(e.consume(T),T===92?S:x)}function S(T){return T===60||T===62||T===92?(e.consume(T),x):x(T)}function _(T){return!b&&(T===null||T===41||Ot(T))?(e.exit("chunkString"),e.exit(f),e.exit(u),e.exit(a),t(T)):b<m&&T===40?(e.consume(T),b++,_):T===41?(e.consume(T),b--,_):T===null||T===32||T===40||_u(T)?r(T):(e.consume(T),T===92?N:_)}function N(T){return T===40||T===41||T===92?(e.consume(T),_):_(T)}}function x0(e,t,r,a,o,c){const u=this;let f=0,h;return m;function m(x){return e.enter(a),e.enter(o),e.consume(x),e.exit(o),e.enter(c),b}function b(x){return f>999||x===null||x===91||x===93&&!h||x===94&&!f&&"_hiddenFootnoteSupport"in u.parser.constructs?r(x):x===93?(e.exit(c),e.enter(o),e.consume(x),e.exit(o),e.exit(a),t):Le(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||Le(x)||f++>999?(e.exit("chunkString"),b(x)):(e.consume(x),h||(h=!nt(x)),x===92?v:y)}function v(x){return x===91||x===92||x===93?(e.consume(x),f++,y):y(x)}}function E0(e,t,r,a,o,c){let u;return f;function f(v){return v===34||v===39||v===40?(e.enter(a),e.enter(o),e.consume(v),e.exit(o),u=v===40?41:v,h):r(v)}function h(v){return v===u?(e.enter(o),e.consume(v),e.exit(o),e.exit(a),t):(e.enter(c),m(v))}function m(v){return v===u?(e.exit(c),h(u)):v===null?r(v):Le(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),lt(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),b(v))}function b(v){return v===u||v===null||Le(v)?(e.exit("chunkString"),m(v)):(e.consume(v),v===92?y:b)}function y(v){return v===u||v===92?(e.consume(v),b):b(v)}}function al(e,t){let r;return a;function a(o){return Le(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r=!0,a):nt(o)?lt(e,a,r?"linePrefix":"lineSuffix")(o):t(o)}}const GT={name:"definition",tokenize:VT},KT={partial:!0,tokenize:qT};function VT(e,t,r){const a=this;let o;return c;function c(x){return e.enter("definition"),u(x)}function u(x){return x0.call(a,e,f,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function f(x){return o=gr(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 Ot(x)?al(e,m)(x):m(x)}function m(x){return v0(e,b,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function b(x){return e.attempt(KT,y,y)(x)}function y(x){return nt(x)?lt(e,v,"whitespace")(x):v(x)}function v(x){return x===null||Le(x)?(e.exit("definition"),a.parser.defined.push(o),t(x)):r(x)}}function qT(e,t,r){return a;function a(f){return Ot(f)?al(e,o)(f):r(f)}function o(f){return E0(e,c,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function c(f){return nt(f)?lt(e,u,"whitespace")(f):u(f)}function u(f){return f===null||Le(f)?t(f):r(f)}}const YT={name:"hardBreakEscape",tokenize:WT};function WT(e,t,r){return a;function a(c){return e.enter("hardBreakEscape"),e.consume(c),o}function o(c){return Le(c)?(e.exit("hardBreakEscape"),t(c)):r(c)}}const XT={name:"headingAtx",resolve:ZT,tokenize:JT};function ZT(e,t){let r=e.length-2,a=3,o,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&&(o={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"},Xn(e,a,r-a+1,[["enter",o,t],["enter",c,t],["exit",c,t],["exit",o,t]])),e}function JT(e,t,r){let a=0;return o;function o(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||Ot(b)?(e.exit("atxHeadingSequence"),f(b)):r(b)}function f(b){return b===35?(e.enter("atxHeadingSequence"),h(b)):b===null||Le(b)?(e.exit("atxHeading"),t(b)):nt(b)?lt(e,f,"whitespace")(b):(e.enter("atxHeadingText"),m(b))}function h(b){return b===35?(e.consume(b),h):(e.exit("atxHeadingSequence"),f(b))}function m(b){return b===null||b===35||Ot(b)?(e.exit("atxHeadingText"),f(b)):(e.consume(b),m)}}const QT=["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"],Zv=["pre","script","style","textarea"],eN={concrete:!0,name:"htmlFlow",resolveTo:rN,tokenize:iN},tN={partial:!0,tokenize:sN},nN={partial:!0,tokenize:aN};function rN(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 iN(e,t,r){const a=this;let o,c,u,f,h;return m;function m(A){return b(A)}function b(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),y}function y(A){return A===33?(e.consume(A),v):A===47?(e.consume(A),c=!0,_):A===63?(e.consume(A),o=3,a.interrupt?t:I):Sn(A)?(e.consume(A),u=String.fromCharCode(A),N):r(A)}function v(A){return A===45?(e.consume(A),o=2,x):A===91?(e.consume(A),o=5,f=0,S):Sn(A)?(e.consume(A),o=4,a.interrupt?t:I):r(A)}function x(A){return A===45?(e.consume(A),a.interrupt?t:I):r(A)}function S(A){const be="CDATA[";return A===be.charCodeAt(f++)?(e.consume(A),f===be.length?a.interrupt?t:Y:S):r(A)}function _(A){return Sn(A)?(e.consume(A),u=String.fromCharCode(A),N):r(A)}function N(A){if(A===null||A===47||A===62||Ot(A)){const be=A===47,Ne=u.toLowerCase();return!be&&!c&&Zv.includes(Ne)?(o=1,a.interrupt?t(A):Y(A)):QT.includes(u.toLowerCase())?(o=6,be?(e.consume(A),T):a.interrupt?t(A):Y(A)):(o=7,a.interrupt&&!a.parser.lazy[a.now().line]?r(A):c?O(A):R(A))}return A===45||mn(A)?(e.consume(A),u+=String.fromCharCode(A),N):r(A)}function T(A){return A===62?(e.consume(A),a.interrupt?t:Y):r(A)}function O(A){return nt(A)?(e.consume(A),O):P(A)}function R(A){return A===47?(e.consume(A),P):A===58||A===95||Sn(A)?(e.consume(A),M):nt(A)?(e.consume(A),R):P(A)}function M(A){return A===45||A===46||A===58||A===95||mn(A)?(e.consume(A),M):L(A)}function L(A){return A===61?(e.consume(A),w):nt(A)?(e.consume(A),L):R(A)}function w(A){return A===null||A===60||A===61||A===62||A===96?r(A):A===34||A===39?(e.consume(A),h=A,D):nt(A)?(e.consume(A),w):F(A)}function D(A){return A===h?(e.consume(A),h=null,J):A===null||Le(A)?r(A):(e.consume(A),D)}function F(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||Ot(A)?L(A):(e.consume(A),F)}function J(A){return A===47||A===62||nt(A)?R(A):r(A)}function P(A){return A===62?(e.consume(A),$):r(A)}function $(A){return A===null||Le(A)?Y(A):nt(A)?(e.consume(A),$):r(A)}function Y(A){return A===45&&o===2?(e.consume(A),z):A===60&&o===1?(e.consume(A),re):A===62&&o===4?(e.consume(A),j):A===63&&o===3?(e.consume(A),I):A===93&&o===5?(e.consume(A),ye):Le(A)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(tN,Q,te)(A)):A===null||Le(A)?(e.exit("htmlFlowData"),te(A)):(e.consume(A),Y)}function te(A){return e.check(nN,se,Q)(A)}function se(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),V}function V(A){return A===null||Le(A)?te(A):(e.enter("htmlFlowData"),Y(A))}function z(A){return A===45?(e.consume(A),I):Y(A)}function re(A){return A===47?(e.consume(A),u="",oe):Y(A)}function oe(A){if(A===62){const be=u.toLowerCase();return Zv.includes(be)?(e.consume(A),j):Y(A)}return Sn(A)&&u.length<8?(e.consume(A),u+=String.fromCharCode(A),oe):Y(A)}function ye(A){return A===93?(e.consume(A),I):Y(A)}function I(A){return A===62?(e.consume(A),j):A===45&&o===2?(e.consume(A),I):Y(A)}function j(A){return A===null||Le(A)?(e.exit("htmlFlowData"),Q(A)):(e.consume(A),j)}function Q(A){return e.exit("htmlFlow"),t(A)}}function aN(e,t,r){const a=this;return o;function o(u){return Le(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 sN(e,t,r){return a;function a(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(wl,t,r)}}const oN={name:"htmlText",tokenize:lN};function lN(e,t,r){const a=this;let o,c,u;return f;function f(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),h}function h(I){return I===33?(e.consume(I),m):I===47?(e.consume(I),L):I===63?(e.consume(I),R):Sn(I)?(e.consume(I),F):r(I)}function m(I){return I===45?(e.consume(I),b):I===91?(e.consume(I),c=0,S):Sn(I)?(e.consume(I),O):r(I)}function b(I){return I===45?(e.consume(I),x):r(I)}function y(I){return I===null?r(I):I===45?(e.consume(I),v):Le(I)?(u=y,re(I)):(e.consume(I),y)}function v(I){return I===45?(e.consume(I),x):y(I)}function x(I){return I===62?z(I):I===45?v(I):y(I)}function S(I){const j="CDATA[";return I===j.charCodeAt(c++)?(e.consume(I),c===j.length?_:S):r(I)}function _(I){return I===null?r(I):I===93?(e.consume(I),N):Le(I)?(u=_,re(I)):(e.consume(I),_)}function N(I){return I===93?(e.consume(I),T):_(I)}function T(I){return I===62?z(I):I===93?(e.consume(I),T):_(I)}function O(I){return I===null||I===62?z(I):Le(I)?(u=O,re(I)):(e.consume(I),O)}function R(I){return I===null?r(I):I===63?(e.consume(I),M):Le(I)?(u=R,re(I)):(e.consume(I),R)}function M(I){return I===62?z(I):R(I)}function L(I){return Sn(I)?(e.consume(I),w):r(I)}function w(I){return I===45||mn(I)?(e.consume(I),w):D(I)}function D(I){return Le(I)?(u=D,re(I)):nt(I)?(e.consume(I),D):z(I)}function F(I){return I===45||mn(I)?(e.consume(I),F):I===47||I===62||Ot(I)?J(I):r(I)}function J(I){return I===47?(e.consume(I),z):I===58||I===95||Sn(I)?(e.consume(I),P):Le(I)?(u=J,re(I)):nt(I)?(e.consume(I),J):z(I)}function P(I){return I===45||I===46||I===58||I===95||mn(I)?(e.consume(I),P):$(I)}function $(I){return I===61?(e.consume(I),Y):Le(I)?(u=$,re(I)):nt(I)?(e.consume(I),$):J(I)}function Y(I){return I===null||I===60||I===61||I===62||I===96?r(I):I===34||I===39?(e.consume(I),o=I,te):Le(I)?(u=Y,re(I)):nt(I)?(e.consume(I),Y):(e.consume(I),se)}function te(I){return I===o?(e.consume(I),o=void 0,V):I===null?r(I):Le(I)?(u=te,re(I)):(e.consume(I),te)}function se(I){return I===null||I===34||I===39||I===60||I===61||I===96?r(I):I===47||I===62||Ot(I)?J(I):(e.consume(I),se)}function V(I){return I===47||I===62||Ot(I)?J(I):r(I)}function z(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):r(I)}function re(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),oe}function oe(I){return nt(I)?lt(e,ye,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):ye(I)}function ye(I){return e.enter("htmlTextData"),u(I)}}const Hp={name:"labelEnd",resolveAll:fN,resolveTo:hN,tokenize:pN},cN={tokenize:mN},uN={tokenize:gN},dN={tokenize:bN};function fN(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 o=a.type==="labelImage"?4:2;a.type="data",t+=o}}return e.length!==r.length&&Xn(e,0,e.length,r),e}function hN(e,t){let r=e.length,a=0,o,c,u,f;for(;r--;)if(o=e[r][1],c){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[r][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(u){if(e[r][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(c=r,o.type!=="labelLink")){a=2;break}}else o.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}},m={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 f=[["enter",h,t],["enter",m,t]],f=lr(f,e.slice(c+1,c+a+3)),f=lr(f,[["enter",b,t]]),f=lr(f,Uu(t.parser.constructs.insideSpan.null,e.slice(c+a+4,u-3),t)),f=lr(f,[["exit",b,t],e[u-2],e[u-1],["exit",m,t]]),f=lr(f,e.slice(u+1)),f=lr(f,[["exit",h,t]]),Xn(e,c,e.length,f),e}function pN(e,t,r){const a=this;let o=a.events.length,c,u;for(;o--;)if((a.events[o][1].type==="labelImage"||a.events[o][1].type==="labelLink")&&!a.events[o][1]._balanced){c=a.events[o][1];break}return f;function f(v){return c?c._inactive?y(v):(u=a.parser.defined.includes(gr(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(cN,b,u?b:y)(v):v===91?e.attempt(uN,b,u?m:y)(v):u?b(v):y(v)}function m(v){return e.attempt(dN,b,y)(v)}function b(v){return t(v)}function y(v){return c._balanced=!0,r(v)}}function mN(e,t,r){return a;function a(y){return e.enter("resource"),e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),o}function o(y){return Ot(y)?al(e,c)(y):c(y)}function c(y){return y===41?b(y):v0(e,u,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(y)}function u(y){return Ot(y)?al(e,h)(y):b(y)}function f(y){return r(y)}function h(y){return y===34||y===39||y===40?E0(e,m,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(y):b(y)}function m(y){return Ot(y)?al(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 gN(e,t,r){const a=this;return o;function o(f){return x0.call(a,e,c,u,"reference","referenceMarker","referenceString")(f)}function c(f){return a.parser.defined.includes(gr(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(f):r(f)}function u(f){return r(f)}}function bN(e,t,r){return a;function a(c){return e.enter("reference"),e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),o}function o(c){return c===93?(e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),e.exit("reference"),t):r(c)}}const yN={name:"labelStartImage",resolveAll:Hp.resolveAll,tokenize:vN};function vN(e,t,r){const a=this;return o;function o(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),c}function c(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),u):r(f)}function u(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?r(f):t(f)}}const xN={name:"labelStartLink",resolveAll:Hp.resolveAll,tokenize:EN};function EN(e,t,r){const a=this;return o;function o(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 dh={name:"lineEnding",tokenize:SN};function SN(e,t){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),lt(e,t,"linePrefix")}}const hu={name:"thematicBreak",tokenize:_N};function _N(e,t,r){let a=0,o;return c;function c(m){return e.enter("thematicBreak"),u(m)}function u(m){return o=m,f(m)}function f(m){return m===o?(e.enter("thematicBreakSequence"),h(m)):a>=3&&(m===null||Le(m))?(e.exit("thematicBreak"),t(m)):r(m)}function h(m){return m===o?(e.consume(m),a++,h):(e.exit("thematicBreakSequence"),nt(m)?lt(e,f,"whitespace")(m):f(m))}}const jn={continuation:{tokenize:NN},exit:AN,name:"list",tokenize:TN},wN={partial:!0,tokenize:ON},kN={partial:!0,tokenize:CN};function TN(e,t,r){const a=this,o=a.events[a.events.length-1];let c=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,u=0;return f;function f(x){const S=a.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!a.containerState.marker||x===a.containerState.marker:ep(x)){if(a.containerState.type||(a.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(hu,r,m)(x):m(x);if(!a.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(x)}return r(x)}function h(x){return ep(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"),m(x)):r(x)}function m(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||x,e.check(wl,a.interrupt?r:b,e.attempt(wN,v,y))}function b(x){return a.containerState.initialBlankLine=!0,c++,v(x)}function y(x){return nt(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 NN(e,t,r){const a=this;return a.containerState._closeFlow=void 0,e.check(wl,o,c);function o(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,lt(e,t,"listItemIndent",a.containerState.size+1)(f)}function c(f){return a.containerState.furtherBlankLines||!nt(f)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,u(f)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(kN,t,u)(f))}function u(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,lt(e,e.attempt(jn,t,r),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function CN(e,t,r){const a=this;return lt(e,o,"listItemIndent",a.containerState.size+1);function o(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 AN(e){e.exit(this.containerState.type)}function ON(e,t,r){const a=this;return lt(e,o,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(c){const u=a.events[a.events.length-1];return!nt(c)&&u&&u[1].type==="listItemPrefixWhitespace"?t(c):r(c)}}const Jv={name:"setextUnderline",resolveTo:MN,tokenize:RN};function MN(e,t){let r=e.length,a,o,c;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){a=r;break}e[r][1].type==="paragraph"&&(o=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[o][1].type="setextHeadingText",c?(e.splice(o,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 RN(e,t,r){const a=this;let o;return c;function c(m){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"),o=m,u(m)):r(m)}function u(m){return e.enter("setextHeadingLineSequence"),f(m)}function f(m){return m===o?(e.consume(m),f):(e.exit("setextHeadingLineSequence"),nt(m)?lt(e,h,"lineSuffix")(m):h(m))}function h(m){return m===null||Le(m)?(e.exit("setextHeadingLine"),t(m)):r(m)}}const IN={tokenize:LN};function LN(e){const t=this,r=e.attempt(wl,a,e.attempt(this.parser.constructs.flowInitial,o,lt(e,e.attempt(this.parser.constructs.flow,o,e.attempt(UT,o)),"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 o(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),t.currentConstruct=void 0,r}}const DN={resolveAll:_0()},jN=S0("string"),zN=S0("text");function S0(e){return{resolveAll:_0(e==="text"?BN:void 0),tokenize:t};function t(r){const a=this,o=this.parser.constructs[e],c=r.attempt(o,u,f);return u;function u(b){return m(b)?c(b):f(b)}function f(b){if(b===null){r.consume(b);return}return r.enter("data"),r.consume(b),h}function h(b){return m(b)?(r.exit("data"),c(b)):(r.consume(b),h)}function m(b){if(b===null)return!0;const y=o[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 _0(e){return t;function t(r,a){let o=-1,c;for(;++o<=r.length;)c===void 0?r[o]&&r[o][1].type==="data"&&(c=o,o++):(!r[o]||r[o][1].type!=="data")&&(o!==c+2&&(r[c][1].end=r[o-1][1].end,r.splice(c+2,o-c-2),o=c+2),c=void 0);return e?e(r,a):r}}function BN(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],o=t.sliceStream(a);let c=o.length,u=-1,f=0,h;for(;c--;){const m=o[c];if(typeof m=="string"){for(u=m.length;m.charCodeAt(u-1)===32;)f++,u--;if(u)break;u=-1}else if(m===-2)h=!0,f++;else if(m!==-1){c++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(f=0),f){const m={type:r===e.length||h||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?u:a.start._bufferIndex+u,_index:a.start._index+c,line:a.end.line,column:a.end.column-f,offset:a.end.offset-f},end:{...a.end}};a.end={...m.start},a.start.offset===a.end.offset?Object.assign(a,m):(e.splice(r,0,["enter",m,t],["exit",m,t]),r+=2)}r++}return e}const UN={42:jn,43:jn,45:jn,48:jn,49:jn,50:jn,51:jn,52:jn,53:jn,54:jn,55:jn,56:jn,57:jn,62:m0},PN={91:GT},HN={[-2]:uh,[-1]:uh,32:uh},FN={35:XT,42:hu,45:[Jv,hu],60:eN,61:Jv,95:hu,96:Xv,126:Xv},$N={38:b0,92:g0},GN={[-5]:dh,[-4]:dh,[-3]:dh,33:yN,38:b0,42:tp,60:[xT,oN],91:xN,92:[YT,g0],93:Hp,95:tp,96:IT},KN={null:[tp,DN]},VN={null:[42,95]},qN={null:[]},YN=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:VN,contentInitial:PN,disable:qN,document:UN,flow:FN,flowInitial:HN,insideSpan:KN,string:$N,text:GN},Symbol.toStringTag,{value:"Module"}));function WN(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 o={},c=[];let u=[],f=[];const h={attempt:D(L),check:D(w),consume:O,enter:R,exit:M,interrupt:D(w,{interrupt:!0})},m={code:null,containerState:{},defineSkip:_,events:[],now:S,parser:e,previous:null,sliceSerialize:v,sliceStream:x,write:y};let b=t.tokenize.call(m,h);return t.resolveAll&&c.push(t),m;function y($){return u=lr(u,$),N(),u[u.length-1]!==null?[]:(F(t,0),m.events=Uu(c,m.events,m),m.events)}function v($,Y){return ZN(x($),Y)}function x($){return XN(u,$)}function S(){const{_bufferIndex:$,_index:Y,line:te,column:se,offset:V}=a;return{_bufferIndex:$,_index:Y,line:te,column:se,offset:V}}function _($){o[$.line]=$.column,P()}function N(){let $;for(;a._index<u.length;){const Y=u[a._index];if(typeof Y=="string")for($=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===$&&a._bufferIndex<Y.length;)T(Y.charCodeAt(a._bufferIndex));else T(Y)}}function T($){b=b($)}function O($){Le($)?(a.line++,a.column=1,a.offset+=$===-3?2:1,P()):$!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===u[a._index].length&&(a._bufferIndex=-1,a._index++)),m.previous=$}function R($,Y){const te=Y||{};return te.type=$,te.start=S(),m.events.push(["enter",te,m]),f.push(te),te}function M($){const Y=f.pop();return Y.end=S(),m.events.push(["exit",Y,m]),Y}function L($,Y){F($,Y.from)}function w($,Y){Y.restore()}function D($,Y){return te;function te(se,V,z){let re,oe,ye,I;return Array.isArray(se)?Q(se):"tokenize"in se?Q([se]):j(se);function j(we){return Fe;function Fe(G){const ie=G!==null&&we[G],ve=G!==null&&we.null,Ke=[...Array.isArray(ie)?ie:ie?[ie]:[],...Array.isArray(ve)?ve:ve?[ve]:[]];return Q(Ke)(G)}}function Q(we){return re=we,oe=0,we.length===0?z:A(we[oe])}function A(we){return Fe;function Fe(G){return I=J(),ye=we,we.partial||(m.currentConstruct=we),we.name&&m.parser.constructs.disable.null.includes(we.name)?Ne():we.tokenize.call(Y?Object.assign(Object.create(m),Y):m,h,be,Ne)(G)}}function be(we){return $(ye,I),V}function Ne(we){return I.restore(),++oe<re.length?A(re[oe]):z}}}function F($,Y){$.resolveAll&&!c.includes($)&&c.push($),$.resolve&&Xn(m.events,Y,m.events.length-Y,$.resolve(m.events.slice(Y),m)),$.resolveTo&&(m.events=$.resolveTo(m.events,m))}function J(){const $=S(),Y=m.previous,te=m.currentConstruct,se=m.events.length,V=Array.from(f);return{from:se,restore:z};function z(){a=$,m.previous=Y,m.currentConstruct=te,m.events.length=se,f=V,P()}}function P(){a.line in o&&a.column<2&&(a.column=o[a.line],a.offset+=o[a.line]-1)}}function XN(e,t){const r=t.start._index,a=t.start._bufferIndex,o=t.end._index,c=t.end._bufferIndex;let u;if(r===o)u=[e[r].slice(a,c)];else{if(u=e.slice(r,o),a>-1){const f=u[0];typeof f=="string"?u[0]=f.slice(a):u.shift()}c>0&&u.push(e[o].slice(0,c))}return u}function ZN(e,t){let r=-1;const a=[];let o;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&&o)continue;u=" ";break}default:u=String.fromCharCode(c)}o=c===-2,a.push(u)}return a.join("")}function JN(e){const a={constructs:h0([YN,...(e||{}).extensions||[]]),content:o(hT),defined:[],document:o(mT),flow:o(IN),lazy:{},string:o(jN),text:o(zN)};return a;function o(c){return u;function u(f){return WN(a,c,f)}}}function QN(e){for(;!y0(e););return e}const Qv=/[\0\t\n\r]/g;function eC(){let e=1,t="",r=!0,a;return o;function o(c,u,f){const h=[];let m,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(Qv.lastIndex=y,m=Qv.exec(c),v=m&&m.index!==void 0?m.index:c.length,x=c.charCodeAt(v),!m){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 f&&(a&&h.push(-5),t&&h.push(t),h.push(null)),h}}const tC=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function nC(e){return e.replace(tC,rC)}function rC(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){const o=r.charCodeAt(1),c=o===120||o===88;return p0(r.slice(c?2:1),c?16:10)}return Pp(r)||e}const w0={}.hasOwnProperty;function iC(e,t,r){return typeof t!="string"&&(r=t,t=void 0),aC(r)(QN(JN(r).document().write(eC()(e,t,!0))))}function aC(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(ft),autolinkProtocol:J,autolinkEmail:J,atxHeading:c(Ye),blockQuote:c(ve),characterEscape:J,characterReference:J,codeFenced:c(Ke),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:c(Ke,u),codeText:c(pe,u),codeTextData:J,data:J,codeFlowValue:J,definition:c(Ze),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:c(ct),hardBreakEscape:c(Pe),hardBreakTrailing:c(Pe),htmlFlow:c(Me,u),htmlFlowData:J,htmlText:c(Me,u),htmlTextData:J,image:c(pt),label:u,link:c(ft),listItem:c(yr),listItemValue:v,listOrdered:c(Et,y),listUnordered:c(Et),paragraph:c(di),reference:A,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:c(Ye),strong:c(le),thematicBreak:c(Ie)},exit:{atxHeading:h(),atxHeadingSequence:L,autolink:h(),autolinkEmail:ie,autolinkProtocol:G,blockQuote:h(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:Ne,characterReferenceMarkerNumeric:Ne,characterReferenceValue:we,characterReference:Fe,codeFenced:h(N),codeFencedFence:_,codeFencedFenceInfo:x,codeFencedFenceMeta:S,codeFlowValue:P,codeIndented:h(T),codeText:h(V),codeTextData:P,data:P,definition:h(),definitionDestinationString:M,definitionLabelString:O,definitionTitleString:R,emphasis:h(),hardBreakEscape:h(Y),hardBreakTrailing:h(Y),htmlFlow:h(te),htmlFlowData:P,htmlText:h(se),htmlTextData:P,image:h(re),label:ye,labelText:oe,lineEnding:$,link:h(z),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:be,resourceDestinationString:I,resourceTitleString:j,resource:Q,setextHeading:h(F),setextHeadingLineSequence:D,setextHeadingText:w,strong:h(),thematicBreak:h()}};k0(t,(e||{}).mdastExtensions||[]);const r={};return a;function a(q){let de={type:"root",children:[]};const Se={stack:[de],tokenStack:[],config:t,enter:f,exit:m,buffer:u,resume:b,data:r},ze=[];let rt=-1;for(;++rt<q.length;)if(q[rt][1].type==="listOrdered"||q[rt][1].type==="listUnordered")if(q[rt][0]==="enter")ze.push(rt);else{const Tt=ze.pop();rt=o(q,Tt,rt)}for(rt=-1;++rt<q.length;){const Tt=t[q[rt][0]];w0.call(Tt,q[rt][1].type)&&Tt[q[rt][1].type].call(Object.assign({sliceSerialize:q[rt][2].sliceSerialize},Se),q[rt][1])}if(Se.tokenStack.length>0){const Tt=Se.tokenStack[Se.tokenStack.length-1];(Tt[1]||ex).call(Se,void 0,Tt[0])}for(de.position={start:Pi(q.length>0?q[0][1].start:{line:1,column:1,offset:0}),end:Pi(q.length>0?q[q.length-2][1].end:{line:1,column:1,offset:0})},rt=-1;++rt<t.transforms.length;)de=t.transforms[rt](de)||de;return de}function o(q,de,Se){let ze=de-1,rt=-1,Tt=!1,Tn,en,Ut,dn;for(;++ze<=Se;){const mt=q[ze];switch(mt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{mt[0]==="enter"?rt++:rt--,dn=void 0;break}case"lineEndingBlank":{mt[0]==="enter"&&(Tn&&!dn&&!rt&&!Ut&&(Ut=ze),dn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:dn=void 0}if(!rt&&mt[0]==="enter"&&mt[1].type==="listItemPrefix"||rt===-1&&mt[0]==="exit"&&(mt[1].type==="listUnordered"||mt[1].type==="listOrdered")){if(Tn){let vr=ze;for(en=void 0;vr--;){const bn=q[vr];if(bn[1].type==="lineEnding"||bn[1].type==="lineEndingBlank"){if(bn[0]==="exit")continue;en&&(q[en][1].type="lineEndingBlank",Tt=!0),bn[1].type="lineEnding",en=vr}else if(!(bn[1].type==="linePrefix"||bn[1].type==="blockQuotePrefix"||bn[1].type==="blockQuotePrefixWhitespace"||bn[1].type==="blockQuoteMarker"||bn[1].type==="listItemIndent"))break}Ut&&(!en||Ut<en)&&(Tn._spread=!0),Tn.end=Object.assign({},en?q[en][1].start:mt[1].end),q.splice(en||ze,0,["exit",Tn,mt[2]]),ze++,Se++}if(mt[1].type==="listItemPrefix"){const vr={type:"listItem",_spread:!1,start:Object.assign({},mt[1].start),end:void 0};Tn=vr,q.splice(ze,0,["enter",vr,mt[2]]),ze++,Se++,Ut=void 0,dn=!0}}}return q[de][1]._spread=Tt,Se}function c(q,de){return Se;function Se(ze){f.call(this,q(ze),ze),de&&de.call(this,ze)}}function u(){this.stack.push({type:"fragment",children:[]})}function f(q,de,Se){this.stack[this.stack.length-1].children.push(q),this.stack.push(q),this.tokenStack.push([de,Se||void 0]),q.position={start:Pi(de.start),end:void 0}}function h(q){return de;function de(Se){q&&q.call(this,Se),m.call(this,Se)}}function m(q,de){const Se=this.stack.pop(),ze=this.tokenStack.pop();if(ze)ze[0].type!==q.type&&(de?de.call(this,q,ze[0]):(ze[1]||ex).call(this,q,ze[0]));else throw new Error("Cannot close `"+q.type+"` ("+il({start:q.start,end:q.end})+"): it’s not open");Se.position.end=Pi(q.end)}function b(){return Up(this.stack.pop())}function y(){this.data.expectingFirstListItemValue=!0}function v(q){if(this.data.expectingFirstListItemValue){const de=this.stack[this.stack.length-2];de.start=Number.parseInt(this.sliceSerialize(q),10),this.data.expectingFirstListItemValue=void 0}}function x(){const q=this.resume(),de=this.stack[this.stack.length-1];de.lang=q}function S(){const q=this.resume(),de=this.stack[this.stack.length-1];de.meta=q}function _(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const q=this.resume(),de=this.stack[this.stack.length-1];de.value=q.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function T(){const q=this.resume(),de=this.stack[this.stack.length-1];de.value=q.replace(/(\r?\n|\r)$/g,"")}function O(q){const de=this.resume(),Se=this.stack[this.stack.length-1];Se.label=de,Se.identifier=gr(this.sliceSerialize(q)).toLowerCase()}function R(){const q=this.resume(),de=this.stack[this.stack.length-1];de.title=q}function M(){const q=this.resume(),de=this.stack[this.stack.length-1];de.url=q}function L(q){const de=this.stack[this.stack.length-1];if(!de.depth){const Se=this.sliceSerialize(q).length;de.depth=Se}}function w(){this.data.setextHeadingSlurpLineEnding=!0}function D(q){const de=this.stack[this.stack.length-1];de.depth=this.sliceSerialize(q).codePointAt(0)===61?1:2}function F(){this.data.setextHeadingSlurpLineEnding=void 0}function J(q){const Se=this.stack[this.stack.length-1].children;let ze=Se[Se.length-1];(!ze||ze.type!=="text")&&(ze=he(),ze.position={start:Pi(q.start),end:void 0},Se.push(ze)),this.stack.push(ze)}function P(q){const de=this.stack.pop();de.value+=this.sliceSerialize(q),de.position.end=Pi(q.end)}function $(q){const de=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Se=de.children[de.children.length-1];Se.position.end=Pi(q.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(de.type)&&(J.call(this,q),P.call(this,q))}function Y(){this.data.atHardBreak=!0}function te(){const q=this.resume(),de=this.stack[this.stack.length-1];de.value=q}function se(){const q=this.resume(),de=this.stack[this.stack.length-1];de.value=q}function V(){const q=this.resume(),de=this.stack[this.stack.length-1];de.value=q}function z(){const q=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";q.type+="Reference",q.referenceType=de,delete q.url,delete q.title}else delete q.identifier,delete q.label;this.data.referenceType=void 0}function re(){const q=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";q.type+="Reference",q.referenceType=de,delete q.url,delete q.title}else delete q.identifier,delete q.label;this.data.referenceType=void 0}function oe(q){const de=this.sliceSerialize(q),Se=this.stack[this.stack.length-2];Se.label=nC(de),Se.identifier=gr(de).toLowerCase()}function ye(){const q=this.stack[this.stack.length-1],de=this.resume(),Se=this.stack[this.stack.length-1];if(this.data.inReference=!0,Se.type==="link"){const ze=q.children;Se.children=ze}else Se.alt=de}function I(){const q=this.resume(),de=this.stack[this.stack.length-1];de.url=q}function j(){const q=this.resume(),de=this.stack[this.stack.length-1];de.title=q}function Q(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function be(q){const de=this.resume(),Se=this.stack[this.stack.length-1];Se.label=de,Se.identifier=gr(this.sliceSerialize(q)).toLowerCase(),this.data.referenceType="full"}function Ne(q){this.data.characterReferenceType=q.type}function we(q){const de=this.sliceSerialize(q),Se=this.data.characterReferenceType;let ze;Se?(ze=p0(de,Se==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ze=Pp(de);const rt=this.stack[this.stack.length-1];rt.value+=ze}function Fe(q){const de=this.stack.pop();de.position.end=Pi(q.end)}function G(q){P.call(this,q);const de=this.stack[this.stack.length-1];de.url=this.sliceSerialize(q)}function ie(q){P.call(this,q);const de=this.stack[this.stack.length-1];de.url="mailto:"+this.sliceSerialize(q)}function ve(){return{type:"blockquote",children:[]}}function Ke(){return{type:"code",lang:null,meta:null,value:""}}function pe(){return{type:"inlineCode",value:""}}function Ze(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ct(){return{type:"emphasis",children:[]}}function Ye(){return{type:"heading",depth:0,children:[]}}function Pe(){return{type:"break"}}function Me(){return{type:"html",value:""}}function pt(){return{type:"image",title:null,url:"",alt:null}}function ft(){return{type:"link",title:null,url:"",children:[]}}function Et(q){return{type:"list",ordered:q.type==="listOrdered",start:null,spread:q._spread,children:[]}}function yr(q){return{type:"listItem",spread:q._spread,checked:null,children:[]}}function di(){return{type:"paragraph",children:[]}}function le(){return{type:"strong",children:[]}}function he(){return{type:"text",value:""}}function Ie(){return{type:"thematicBreak"}}}function Pi(e){return{line:e.line,column:e.column,offset:e.offset}}function k0(e,t){let r=-1;for(;++r<t.length;){const a=t[r];Array.isArray(a)?k0(e,a):sC(e,a)}}function sC(e,t){let r;for(r in t)if(w0.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 ex(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+il({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+il({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+il({start:t.start,end:t.end})+") is still open")}function oC(e){const t=this;t.parser=r;function r(a){return iC(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function lC(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 cC(e,t){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
|
|
53
|
-
`}]}function uC(e,t){const r=t.value?t.value+`
|
|
54
|
-
`:"",a={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(a.className=["language-"+o[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 dC(e,t){const r={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function fC(e,t){const r={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function hC(e,t){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),o=Gs(a.toLowerCase()),c=e.footnoteOrder.indexOf(a);let u,f=e.footnoteCounts.get(a);f===void 0?(f=0,e.footnoteOrder.push(a),u=e.footnoteOrder.length):u=c+1,f+=1,e.footnoteCounts.set(a,f);const h={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+o,id:r+"fnref-"+o+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(t,h);const m={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,m),e.applyData(t,m)}function pC(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 mC(e,t){if(e.options.allowDangerousHtml){const r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}}function T0(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 o=e.all(t),c=o[0];c&&c.type==="text"?c.value="["+c.value:o.unshift({type:"text",value:"["});const u=o[o.length-1];return u&&u.type==="text"?u.value+=a:o.push({type:"text",value:a}),o}function gC(e,t){const r=String(t.identifier).toUpperCase(),a=e.definitionById.get(r);if(!a)return T0(e,t);const o={src:Gs(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(o.title=a.title);const c={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,c),e.applyData(t,c)}function bC(e,t){const r={src:Gs(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 yC(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 vC(e,t){const r=String(t.identifier).toUpperCase(),a=e.definitionById.get(r);if(!a)return T0(e,t);const o={href:Gs(a.url||"")};a.title!==null&&a.title!==void 0&&(o.title=a.title);const c={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,c),e.applyData(t,c)}function xC(e,t){const r={href:Gs(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 EC(e,t,r){const a=e.all(t),o=r?SC(r):N0(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 f=-1;for(;++f<a.length;){const b=a[f];(o||f!==0||b.type!=="element"||b.tagName!=="p")&&u.push({type:"text",value:`
|
|
55
|
-
`}),b.type==="element"&&b.tagName==="p"&&!o?u.push(...b.children):u.push(b)}const h=a[a.length-1];h&&(o||h.type!=="element"||h.tagName!=="p")&&u.push({type:"text",value:`
|
|
56
|
-
`});const m={type:"element",tagName:"li",properties:c,children:u};return e.patch(t,m),e.applyData(t,m)}function SC(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=N0(r[a])}return t}function N0(e){const t=e.spread;return t??e.children.length>1}function _C(e,t){const r={},a=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(r.start=t.start);++o<a.length;){const u=a[o];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 wC(e,t){const r={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function kC(e,t){const r={type:"root",children:e.wrap(e.all(t))};return e.patch(t,r),e.applyData(t,r)}function TC(e,t){const r={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function NC(e,t){const r=e.all(t),a=r.shift(),o=[];if(a){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],u),o.push(u)}if(r.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},f=Dp(t.children[1]),h=s0(t.children[t.children.length-1]);f&&h&&(u.position={start:f,end:h}),o.push(u)}const c={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,c),e.applyData(t,c)}function CC(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,f=u?u.length:t.children.length;let h=-1;const m=[];for(;++h<f;){const y=t.children[h],v={},x=u?u[h]:void 0;x&&(v.align=x);let S={type:"element",tagName:c,properties:v,children:[]};y&&(S.children=e.all(y),e.patch(y,S),S=e.applyData(y,S)),m.push(S)}const b={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(t,b),e.applyData(t,b)}function AC(e,t){const r={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}const tx=9,nx=32;function OC(e){const t=String(e),r=/\r?\n|\r/g;let a=r.exec(t),o=0;const c=[];for(;a;)c.push(rx(t.slice(o,a.index),o>0,!0),a[0]),o=a.index+a[0].length,a=r.exec(t);return c.push(rx(t.slice(o),o>0,!1)),c.join("")}function rx(e,t,r){let a=0,o=e.length;if(t){let c=e.codePointAt(a);for(;c===tx||c===nx;)a++,c=e.codePointAt(a)}if(r){let c=e.codePointAt(o-1);for(;c===tx||c===nx;)o--,c=e.codePointAt(o-1)}return o>a?e.slice(a,o):""}function MC(e,t){const r={type:"text",value:OC(String(t.value))};return e.patch(t,r),e.applyData(t,r)}function RC(e,t){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)}const IC={blockquote:lC,break:cC,code:uC,delete:dC,emphasis:fC,footnoteReference:hC,heading:pC,html:mC,imageReference:gC,image:bC,inlineCode:yC,linkReference:vC,link:xC,listItem:EC,list:_C,paragraph:wC,root:kC,strong:TC,table:NC,tableCell:AC,tableRow:CC,text:MC,thematicBreak:RC,toml:Jc,yaml:Jc,definition:Jc,footnoteDefinition:Jc};function Jc(){}const C0=-1,Pu=0,sl=1,wu=2,Fp=3,$p=4,Gp=5,Kp=6,A0=7,O0=8,ix=typeof self=="object"?self:globalThis,LC=(e,t)=>{const r=(o,c)=>(e.set(c,o),o),a=o=>{if(e.has(o))return e.get(o);const[c,u]=t[o];switch(c){case Pu:case C0:return r(u,o);case sl:{const f=r([],o);for(const h of u)f.push(a(h));return f}case wu:{const f=r({},o);for(const[h,m]of u)f[a(h)]=a(m);return f}case Fp:return r(new Date(u),o);case $p:{const{source:f,flags:h}=u;return r(new RegExp(f,h),o)}case Gp:{const f=r(new Map,o);for(const[h,m]of u)f.set(a(h),a(m));return f}case Kp:{const f=r(new Set,o);for(const h of u)f.add(a(h));return f}case A0:{const{name:f,message:h}=u;return r(new ix[f](h),o)}case O0:return r(BigInt(u),o);case"BigInt":return r(Object(BigInt(u)),o);case"ArrayBuffer":return r(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:f}=new Uint8Array(u);return r(new DataView(f),u)}}return r(new ix[c](u),o)};return a},ax=e=>LC(new Map,e)(0),xs="",{toString:DC}={},{keys:jC}=Object,qo=e=>{const t=typeof e;if(t!=="object"||!e)return[Pu,t];const r=DC.call(e).slice(8,-1);switch(r){case"Array":return[sl,xs];case"Object":return[wu,xs];case"Date":return[Fp,xs];case"RegExp":return[$p,xs];case"Map":return[Gp,xs];case"Set":return[Kp,xs];case"DataView":return[sl,r]}return r.includes("Array")?[sl,r]:r.includes("Error")?[A0,r]:[wu,r]},Qc=([e,t])=>e===Pu&&(t==="function"||t==="symbol"),zC=(e,t,r,a)=>{const o=(u,f)=>{const h=a.push(u)-1;return r.set(f,h),h},c=u=>{if(r.has(u))return r.get(u);let[f,h]=qo(u);switch(f){case Pu:{let b=u;switch(h){case"bigint":f=O0,b=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);b=null;break;case"undefined":return o([C0],u)}return o([f,b],u)}case sl:{if(h){let v=u;return h==="DataView"?v=new Uint8Array(u.buffer):h==="ArrayBuffer"&&(v=new Uint8Array(u)),o([h,[...v]],u)}const b=[],y=o([f,b],u);for(const v of u)b.push(c(v));return y}case wu:{if(h)switch(h){case"BigInt":return o([h,u.toString()],u);case"Boolean":case"Number":case"String":return o([h,u.valueOf()],u)}if(t&&"toJSON"in u)return c(u.toJSON());const b=[],y=o([f,b],u);for(const v of jC(u))(e||!Qc(qo(u[v])))&&b.push([c(v),c(u[v])]);return y}case Fp:return o([f,u.toISOString()],u);case $p:{const{source:b,flags:y}=u;return o([f,{source:b,flags:y}],u)}case Gp:{const b=[],y=o([f,b],u);for(const[v,x]of u)(e||!(Qc(qo(v))||Qc(qo(x))))&&b.push([c(v),c(x)]);return y}case Kp:{const b=[],y=o([f,b],u);for(const v of u)(e||!Qc(qo(v)))&&b.push(c(v));return y}}const{message:m}=u;return o([f,{name:h,message:m}],u)};return c},sx=(e,{json:t,lossy:r}={})=>{const a=[];return zC(!(t||r),!!t,new Map,a)(e),a},ku=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ax(sx(e,t)):structuredClone(e):(e,t)=>ax(sx(e,t));function BC(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 UC(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function PC(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||BC,a=e.options.footnoteBackLabel||UC,o=e.options.footnoteLabel||"Footnotes",c=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let h=-1;for(;++h<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[h]);if(!m)continue;const b=e.all(m),y=String(m.identifier).toUpperCase(),v=Gs(y.toLowerCase());let x=0;const S=[],_=e.footnoteCounts.get(y);for(;_!==void 0&&++x<=_;){S.length>0&&S.push({type:"text",value:" "});let O=typeof r=="string"?r:r(h,x);typeof O=="string"&&(O={type:"text",value:O}),S.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(O)?O:[O]})}const N=b[b.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const O=N.children[N.children.length-1];O&&O.type==="text"?O.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...S)}else b.push(...S);const T={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(b,!0)};e.patch(m,T),f.push(T)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{...ku(u),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
57
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
|
|
58
|
-
`}]}}const kl=(function(e){if(e==null)return GC;if(typeof e=="function")return Hu(e);if(typeof e=="object")return Array.isArray(e)?HC(e):FC(e);if(typeof e=="string")return $C(e);throw new Error("Expected function, string, or object as test")});function HC(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=kl(e[r]);return Hu(a);function a(...o){let c=-1;for(;++c<t.length;)if(t[c].apply(this,o))return!0;return!1}}function FC(e){const t=e;return Hu(r);function r(a){const o=a;let c;for(c in e)if(o[c]!==t[c])return!1;return!0}}function $C(e){return Hu(t);function t(r){return r&&r.type===e}}function Hu(e){return t;function t(r,a,o){return!!(KC(r)&&e.call(this,r,typeof a=="number"?a:void 0,o||void 0))}}function GC(){return!0}function KC(e){return e!==null&&typeof e=="object"&&"type"in e}const M0=[],VC=!0,np=!1,qC="skip";function R0(e,t,r,a){let o;typeof t=="function"&&typeof r!="function"?(a=r,r=t):o=t;const c=kl(o),u=a?-1:1;f(e,void 0,[])();function f(h,m,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=M0,S,_,N;if((!t||c(h,m,b[b.length-1]||void 0))&&(x=YC(r(h,b)),x[0]===np))return x;if("children"in h&&h.children){const T=h;if(T.children&&x[0]!==qC)for(_=(a?T.children.length:-1)+u,N=b.concat(T);_>-1&&_<T.children.length;){const O=T.children[_];if(S=f(O,_,N)(),S[0]===np)return S;_=typeof S[1]=="number"?S[1]:_+u}}return x}}}function YC(e){return Array.isArray(e)?e:typeof e=="number"?[VC,e]:e==null?M0:[e]}function Fu(e,t,r,a){let o,c,u;typeof t=="function"&&typeof r!="function"?(c=void 0,u=t,o=r):(c=t,u=r,o=a),R0(e,c,f,o);function f(h,m){const b=m[m.length-1],y=b?b.children.indexOf(h):void 0;return u(h,y,b)}}const rp={}.hasOwnProperty,WC={};function XC(e,t){const r=t||WC,a=new Map,o=new Map,c=new Map,u={...IC,...r.handlers},f={all:m,applyData:JC,definitionById:a,footnoteById:o,footnoteCounts:c,footnoteOrder:[],handlers:u,one:h,options:r,patch:ZC,wrap:eA};return Fu(e,function(b){if(b.type==="definition"||b.type==="footnoteDefinition"){const y=b.type==="definition"?a:o,v=String(b.identifier).toUpperCase();y.has(v)||y.set(v,b)}}),f;function h(b,y){const v=b.type,x=f.handlers[v];if(rp.call(f.handlers,v)&&x)return x(f,b,y);if(f.options.passThrough&&f.options.passThrough.includes(v)){if("children"in b){const{children:_,...N}=b,T=ku(N);return T.children=f.all(b),T}return ku(b)}return(f.options.unknownHandler||QC)(f,b,y)}function m(b){const y=[];if("children"in b){const v=b.children;let x=-1;for(;++x<v.length;){const S=f.one(v[x],b);if(S){if(x&&v[x-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=ox(S.value)),!Array.isArray(S)&&S.type==="element")){const _=S.children[0];_&&_.type==="text"&&(_.value=ox(_.value))}Array.isArray(S)?y.push(...S):y.push(S)}}}return y}}function ZC(e,t){e.position&&(t.position=U2(e))}function JC(e,t){let r=t;if(e&&e.data){const a=e.data.hName,o=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,ku(c)),"children"in r&&r.children&&o!==null&&o!==void 0&&(r.children=o)}return r}function QC(e,t){const r=t.data||{},a="value"in t&&!(rp.call(r,"hProperties")||rp.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 eA(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 ox(e){let t=0,r=e.charCodeAt(t);for(;r===9||r===32;)t++,r=e.charCodeAt(t);return e.slice(t)}function lx(e,t){const r=XC(e,t),a=r.one(e,void 0),o=PC(r),c=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return o&&c.children.push({type:"text",value:`
|
|
62
|
-
`},o),c}function tA(e,t){return e&&"run"in e?async function(r,a){const o=lx(r,{file:a,...t});await e.run(o,a)}:function(r,a){return lx(r,{file:a,...e||t})}}function cx(e){if(e)throw e}var fh,ux;function nA(){if(ux)return fh;ux=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(m){return typeof Array.isArray=="function"?Array.isArray(m):t.call(m)==="[object Array]"},c=function(m){if(!m||t.call(m)!=="[object Object]")return!1;var b=e.call(m,"constructor"),y=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!b&&!y)return!1;var v;for(v in m);return typeof v>"u"||e.call(m,v)},u=function(m,b){r&&b.name==="__proto__"?r(m,b.name,{enumerable:!0,configurable:!0,value:b.newValue,writable:!0}):m[b.name]=b.newValue},f=function(m,b){if(b==="__proto__")if(e.call(m,b)){if(a)return a(m,b).value}else return;return m[b]};return fh=function h(){var m,b,y,v,x,S,_=arguments[0],N=1,T=arguments.length,O=!1;for(typeof _=="boolean"&&(O=_,_=arguments[1]||{},N=2),(_==null||typeof _!="object"&&typeof _!="function")&&(_={});N<T;++N)if(m=arguments[N],m!=null)for(b in m)y=f(_,b),v=f(m,b),_!==v&&(O&&v&&(c(v)||(x=o(v)))?(x?(x=!1,S=y&&o(y)?y:[]):S=y&&c(y)?y:{},u(_,{name:b,newValue:h(O,S,v)})):typeof v<"u"&&u(_,{name:b,newValue:v}));return _},fh}var rA=nA();const hh=El(rA);function ip(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 iA(){const e=[],t={run:r,use:a};return t;function r(...o){let c=-1;const u=o.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);f(null,...o);function f(h,...m){const b=e[++c];let y=-1;if(h){u(h);return}for(;++y<o.length;)(m[y]===null||m[y]===void 0)&&(m[y]=o[y]);o=m,b?aA(b,f)(...m):u(null,...m)}}function a(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function aA(e,t){let r;return a;function a(...u){const f=e.length>u.length;let h;f&&u.push(o);try{h=e.apply(this,u)}catch(m){const b=m;if(f&&r)throw b;return o(b)}f||(h&&h.then&&typeof h.then=="function"?h.then(c,o):h instanceof Error?o(h):c(h))}function o(u,...f){r||(r=!0,t(u,...f))}function c(u){o(null,u)}}const Tr={basename:sA,dirname:oA,extname:lA,join:cA,sep:"/"};function sA(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Tl(e);let r=0,a=-1,o=e.length,c;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(c){r=o+1;break}}else a<0&&(c=!0,a=o+1);return a<0?"":e.slice(r,a)}if(t===e)return"";let u=-1,f=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(c){r=o+1;break}}else u<0&&(c=!0,u=o+1),f>-1&&(e.codePointAt(o)===t.codePointAt(f--)?f<0&&(a=o):(f=-1,a=u));return r===a?a=u:a<0&&(a=e.length),e.slice(r,a)}function oA(e){if(Tl(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 lA(e){Tl(e);let t=e.length,r=-1,a=0,o=-1,c=0,u;for(;t--;){const f=e.codePointAt(t);if(f===47){if(u){a=t+1;break}continue}r<0&&(u=!0,r=t+1),f===46?o<0?o=t:c!==1&&(c=1):o>-1&&(c=-1)}return o<0||r<0||c===0||c===1&&o===r-1&&o===a+1?"":e.slice(o,r)}function cA(...e){let t=-1,r;for(;++t<e.length;)Tl(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":uA(r)}function uA(e){Tl(e);const t=e.codePointAt(0)===47;let r=dA(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function dA(e,t){let r="",a=0,o=-1,c=0,u=-1,f,h;for(;++u<=e.length;){if(u<e.length)f=e.codePointAt(u);else{if(f===47)break;f=47}if(f===47){if(!(o===u-1||c===1))if(o!==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("/")),o=u,c=0;continue}}else if(r.length>0){r="",a=0,o=u,c=0;continue}}t&&(r=r.length>0?r+"/..":"..",a=2)}else r.length>0?r+="/"+e.slice(o+1,u):r=e.slice(o+1,u),a=u-o-1;o=u,c=0}else f===46&&c>-1?c++:c=-1}return r}function Tl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const fA={cwd:hA};function hA(){return"/"}function ap(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function pA(e){if(typeof e=="string")e=new URL(e);else if(!ap(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 mA(e)}function mA(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 o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const ph=["history","path","basename","stem","extname","dirname"];class I0{constructor(t){let r;t?ap(t)?r={path:t}:typeof t=="string"||gA(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":fA.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<ph.length;){const c=ph[a];c in r&&r[c]!==void 0&&r[c]!==null&&(this[c]=c==="history"?[...r[c]]:r[c])}let o;for(o in r)ph.includes(o)||(this[o]=r[o])}get basename(){return typeof this.path=="string"?Tr.basename(this.path):void 0}set basename(t){gh(t,"basename"),mh(t,"basename"),this.path=Tr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Tr.dirname(this.path):void 0}set dirname(t){dx(this.basename,"dirname"),this.path=Tr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Tr.extname(this.path):void 0}set extname(t){if(mh(t,"extname"),dx(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=Tr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ap(t)&&(t=pA(t)),gh(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Tr.basename(this.path,this.extname):void 0}set stem(t){gh(t,"stem"),mh(t,"stem"),this.path=Tr.join(this.dirname||"",t+(this.extname||""))}fail(t,r,a){const o=this.message(t,r,a);throw o.fatal=!0,o}info(t,r,a){const o=this.message(t,r,a);return o.fatal=void 0,o}message(t,r,a){const o=new gn(t,r,a);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function mh(e,t){if(e&&e.includes(Tr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Tr.sep+"`")}function gh(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function dx(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function gA(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const bA=(function(e){const a=this.constructor.prototype,o=a[e],c=function(){return o.apply(c,arguments)};return Object.setPrototypeOf(c,a),c}),yA={}.hasOwnProperty;class Vp extends bA{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=iA()}copy(){const t=new Vp;let r=-1;for(;++r<this.attachers.length;){const a=this.attachers[r];t.use(...a)}return t.data(hh(!0,{},this.namespace)),t}data(t,r){return typeof t=="string"?arguments.length===2?(vh("data",this.frozen),this.namespace[t]=r,this):yA.call(this.namespace,t)&&this.namespace[t]||void 0:t?(vh("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 o=r.call(t,...a);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const r=eu(t),a=this.parser||this.Parser;return bh("parse",a),a(String(r),r)}process(t,r){const a=this;return this.freeze(),bh("process",this.parser||this.Parser),yh("process",this.compiler||this.Compiler),r?o(void 0,r):new Promise(o);function o(c,u){const f=eu(t),h=a.parse(f);a.run(h,f,function(b,y,v){if(b||!y||!v)return m(b);const x=y,S=a.stringify(x,v);EA(S)?v.value=S:v.result=S,m(b,v)});function m(b,y){b||!y?u(b):c?c(y):r(void 0,y)}}}processSync(t){let r=!1,a;return this.freeze(),bh("processSync",this.parser||this.Parser),yh("processSync",this.compiler||this.Compiler),this.process(t,o),hx("processSync","process",r),a;function o(c,u){r=!0,cx(c),a=u}}run(t,r,a){fx(t),this.freeze();const o=this.transformers;return!a&&typeof r=="function"&&(a=r,r=void 0),a?c(void 0,a):new Promise(c);function c(u,f){const h=eu(r);o.run(t,h,m);function m(b,y,v){const x=y||t;b?f(b):u?u(x):a(void 0,x,v)}}}runSync(t,r){let a=!1,o;return this.run(t,r,c),hx("runSync","run",a),o;function c(u,f){cx(u),o=f,a=!0}}stringify(t,r){this.freeze();const a=eu(r),o=this.compiler||this.Compiler;return yh("stringify",o),fx(t),o(t,a)}use(t,...r){const a=this.attachers,o=this.namespace;if(vh("use",this.frozen),t!=null)if(typeof t=="function")h(t,r);else if(typeof t=="object")Array.isArray(t)?f(t):u(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function c(m){if(typeof m=="function")h(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[b,...y]=m;h(b,y)}else u(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function u(m){if(!("plugins"in m)&&!("settings"in m))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(m.plugins),m.settings&&(o.settings=hh(!0,o.settings,m.settings))}function f(m){let b=-1;if(m!=null)if(Array.isArray(m))for(;++b<m.length;){const y=m[b];c(y)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function h(m,b){let y=-1,v=-1;for(;++y<a.length;)if(a[y][0]===m){v=y;break}if(v===-1)a.push([m,...b]);else if(b.length>0){let[x,...S]=b;const _=a[v][1];ip(_)&&ip(x)&&(x=hh(!0,_,x)),a[v]=[m,x,...S]}}}}const vA=new Vp().freeze();function bh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function yh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function vh(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 fx(e){if(!ip(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function hx(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function eu(e){return xA(e)?e:new I0(e)}function xA(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function EA(e){return typeof e=="string"||SA(e)}function SA(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const _A="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",px=[],mx={allowDangerousHtml:!0},wA=/^(https?|ircs?|mailto|xmpp)$/i,kA=[{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 L0(e){const t=TA(e),r=NA(e);return CA(t.runSync(t.parse(r),r),e)}function TA(e){const t=e.rehypePlugins||px,r=e.remarkPlugins||px,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...mx}:mx;return vA().use(oC).use(r).use(tA,a).use(t)}function NA(e){const t=e.children||"",r=new I0;return typeof t=="string"&&(r.value=t),r}function CA(e,t){const r=t.allowedElements,a=t.allowElement,o=t.components,c=t.disallowedElements,u=t.skipHtml,f=t.unwrapDisallowed,h=t.urlTransform||AA;for(const b of kA)Object.hasOwn(t,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+_A+b.id,void 0);return Fu(e,m),G2(e,{Fragment:d.Fragment,components:o,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function m(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 ch)if(Object.hasOwn(ch,x)&&Object.hasOwn(b.properties,x)){const S=b.properties[x],_=ch[x];(_===null||_.includes(b.tagName))&&(b.properties[x]=h(String(S||""),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 f&&b.children?v.children.splice(y,1,...b.children):v.children.splice(y,1),y}}}function AA(e){const t=e.indexOf(":"),r=e.indexOf("?"),a=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||r!==-1&&t>r||a!==-1&&t>a||wA.test(e.slice(0,t))?e:""}function gx(e,t){const r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,o=r.indexOf(t);for(;o!==-1;)a++,o=r.indexOf(t,o+t.length);return a}function OA(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function MA(e,t,r){const o=kl((r||{}).ignore||[]),c=RA(t);let u=-1;for(;++u<c.length;)R0(e,"text",f);function f(m,b){let y=-1,v;for(;++y<b.length;){const x=b[y],S=v?v.children:void 0;if(o(x,S?S.indexOf(x):void 0,v))return;v=x}if(v)return h(m,b)}function h(m,b){const y=b[b.length-1],v=c[u][0],x=c[u][1];let S=0;const N=y.children.indexOf(m);let T=!1,O=[];v.lastIndex=0;let R=v.exec(m.value);for(;R;){const M=R.index,L={index:R.index,input:R.input,stack:[...b,m]};let w=x(...R,L);if(typeof w=="string"&&(w=w.length>0?{type:"text",value:w}:void 0),w===!1?v.lastIndex=M+1:(S!==M&&O.push({type:"text",value:m.value.slice(S,M)}),Array.isArray(w)?O.push(...w):w&&O.push(w),S=M+R[0].length,T=!0),!v.global)break;R=v.exec(m.value)}return T?(S<m.value.length&&O.push({type:"text",value:m.value.slice(S)}),y.children.splice(N,1,...O)):O=[m],N+O.length}}function RA(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 o=r[a];t.push([IA(o[0]),LA(o[1])])}return t}function IA(e){return typeof e=="string"?new RegExp(OA(e),"g"):e}function LA(e){return typeof e=="function"?e:function(){return e}}const xh="phrasing",Eh=["autolink","link","image","label"];function DA(){return{transforms:[FA],enter:{literalAutolink:zA,literalAutolinkEmail:Sh,literalAutolinkHttp:Sh,literalAutolinkWww:Sh},exit:{literalAutolink:HA,literalAutolinkEmail:PA,literalAutolinkHttp:BA,literalAutolinkWww:UA}}}function jA(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:xh,notInConstruct:Eh},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:xh,notInConstruct:Eh},{character:":",before:"[ps]",after:"\\/",inConstruct:xh,notInConstruct:Eh}]}}function zA(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Sh(e){this.config.enter.autolinkProtocol.call(this,e)}function BA(e){this.config.exit.autolinkProtocol.call(this,e)}function UA(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 PA(e){this.config.exit.autolinkEmail.call(this,e)}function HA(e){this.exit(e)}function FA(e){MA(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,$A],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),GA]],{ignore:["link","linkReference"]})}function $A(e,t,r,a,o){let c="";if(!D0(o)||(/^w/i.test(t)&&(r=t+r,t="",c="http://"),!KA(r)))return!1;const u=VA(r+a);if(!u[0])return!1;const f={type:"link",title:null,url:c+t+u[0],children:[{type:"text",value:t+u[0]}]};return u[1]?[f,{type:"text",value:u[1]}]:f}function GA(e,t,r,a){return!D0(a,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+r,children:[{type:"text",value:t+"@"+r}]}}function KA(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 VA(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 o=gx(e,"(");let c=gx(e,")");for(;a!==-1&&o>c;)e+=r.slice(0,a+1),r=r.slice(a+1),a=r.indexOf(")"),c++;return[e,r]}function D0(e,t){const r=e.input.charCodeAt(e.index-1);return(e.index===0||Ca(r)||Bu(r))&&(!t||r!==47)}j0.peek=t5;function qA(){this.buffer()}function YA(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function WA(){this.buffer()}function XA(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ZA(e){const t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=gr(this.sliceSerialize(e)).toLowerCase(),r.label=t}function JA(e){this.exit(e)}function QA(e){const t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=gr(this.sliceSerialize(e)).toLowerCase(),r.label=t}function e5(e){this.exit(e)}function t5(){return"["}function j0(e,t,r,a){const o=r.createTracker(a);let c=o.move("[^");const u=r.enter("footnoteReference"),f=r.enter("reference");return c+=o.move(r.safe(r.associationId(e),{after:"]",before:c})),f(),u(),c+=o.move("]"),c}function n5(){return{enter:{gfmFootnoteCallString:qA,gfmFootnoteCall:YA,gfmFootnoteDefinitionLabelString:WA,gfmFootnoteDefinition:XA},exit:{gfmFootnoteCallString:ZA,gfmFootnoteCall:JA,gfmFootnoteDefinitionLabelString:QA,gfmFootnoteDefinition:e5}}}function r5(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:r,footnoteReference:j0},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(a,o,c,u){const f=c.createTracker(u);let h=f.move("[^");const m=c.enter("footnoteDefinition"),b=c.enter("label");return h+=f.move(c.safe(c.associationId(a),{before:h,after:"]"})),b(),h+=f.move("]:"),a.children&&a.children.length>0&&(f.shift(4),h+=f.move((t?`
|
|
63
|
-
`:" ")+c.indentLines(c.containerFlow(a,f.current()),t?z0:i5))),m(),h}}function i5(e,t,r){return t===0?e:z0(e,t,r)}function z0(e,t,r){return(r?"":" ")+e}const a5=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];B0.peek=u5;function s5(){return{canContainEols:["delete"],enter:{strikethrough:l5},exit:{strikethrough:c5}}}function o5(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:a5}],handlers:{delete:B0}}}function l5(e){this.enter({type:"delete",children:[]},e)}function c5(e){this.exit(e)}function B0(e,t,r,a){const o=r.createTracker(a),c=r.enter("strikethrough");let u=o.move("~~");return u+=r.containerPhrasing(e,{...o.current(),before:u,after:"~"}),u+=o.move("~~"),c(),u}function u5(){return"~"}function d5(e){return e.length}function f5(e,t){const r=t||{},a=(r.align||[]).concat(),o=r.stringLength||d5,c=[],u=[],f=[],h=[];let m=0,b=-1;for(;++b<e.length;){const _=[],N=[];let T=-1;for(e[b].length>m&&(m=e[b].length);++T<e[b].length;){const O=h5(e[b][T]);if(r.alignDelimiters!==!1){const R=o(O);N[T]=R,(h[T]===void 0||R>h[T])&&(h[T]=R)}_.push(O)}u[b]=_,f[b]=N}let y=-1;if(typeof a=="object"&&"length"in a)for(;++y<m;)c[y]=bx(a[y]);else{const _=bx(a);for(;++y<m;)c[y]=_}y=-1;const v=[],x=[];for(;++y<m;){const _=c[y];let N="",T="";_===99?(N=":",T=":"):_===108?N=":":_===114&&(T=":");let O=r.alignDelimiters===!1?1:Math.max(1,h[y]-N.length-T.length);const R=N+"-".repeat(O)+T;r.alignDelimiters!==!1&&(O=N.length+O+T.length,O>h[y]&&(h[y]=O),x[y]=O),v[y]=R}u.splice(1,0,v),f.splice(1,0,x),b=-1;const S=[];for(;++b<u.length;){const _=u[b],N=f[b];y=-1;const T=[];for(;++y<m;){const O=_[y]||"";let R="",M="";if(r.alignDelimiters!==!1){const L=h[y]-(N[y]||0),w=c[y];w===114?R=" ".repeat(L):w===99?L%2?(R=" ".repeat(L/2+.5),M=" ".repeat(L/2-.5)):(R=" ".repeat(L/2),M=R):M=" ".repeat(L)}r.delimiterStart!==!1&&!y&&T.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&O==="")&&(r.delimiterStart!==!1||y)&&T.push(" "),r.alignDelimiters!==!1&&T.push(R),T.push(O),r.alignDelimiters!==!1&&T.push(M),r.padding!==!1&&T.push(" "),(r.delimiterEnd!==!1||y!==m-1)&&T.push("|")}S.push(r.delimiterEnd===!1?T.join("").replace(/ +$/,""):T.join(""))}return S.join(`
|
|
64
|
-
`)}function h5(e){return e==null?"":String(e)}function bx(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 p5(e,t,r,a){const o=r.enter("blockquote"),c=r.createTracker(a);c.move("> "),c.shift(2);const u=r.indentLines(r.containerFlow(e,c.current()),m5);return o(),u}function m5(e,t,r){return">"+(r?"":" ")+e}function g5(e,t){return yx(e,t.inConstruct,!0)&&!yx(e,t.notInConstruct,!1)}function yx(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 vx(e,t,r,a){let o=-1;for(;++o<r.unsafe.length;)if(r.unsafe[o].character===`
|
|
65
|
-
`&&g5(r.stack,r.unsafe[o]))return/[ \t]/.test(a.before)?"":" ";return`\\
|
|
66
|
-
`}function b5(e,t){const r=String(e);let a=r.indexOf(t),o=a,c=0,u=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===o?++c>u&&(u=c):c=1,o=a+t.length,a=r.indexOf(t,o);return u}function y5(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 v5(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 x5(e,t,r,a){const o=v5(r),c=e.value||"",u=o==="`"?"GraveAccent":"Tilde";if(y5(e,r)){const y=r.enter("codeIndented"),v=r.indentLines(c,E5);return y(),v}const f=r.createTracker(a),h=o.repeat(Math.max(b5(c,o)+1,3)),m=r.enter("codeFenced");let b=f.move(h);if(e.lang){const y=r.enter(`codeFencedLang${u}`);b+=f.move(r.safe(e.lang,{before:b,after:" ",encode:["`"],...f.current()})),y()}if(e.lang&&e.meta){const y=r.enter(`codeFencedMeta${u}`);b+=f.move(" "),b+=f.move(r.safe(e.meta,{before:b,after:`
|
|
67
|
-
`,encode:["`"],...f.current()})),y()}return b+=f.move(`
|
|
68
|
-
`),c&&(b+=f.move(c+`
|
|
69
|
-
`)),b+=f.move(h),m(),b}function E5(e,t,r){return(r?"":" ")+e}function qp(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 S5(e,t,r,a){const o=qp(r),c=o==='"'?"Quote":"Apostrophe",u=r.enter("definition");let f=r.enter("label");const h=r.createTracker(a);let m=h.move("[");return m+=h.move(r.safe(r.associationId(e),{before:m,after:"]",...h.current()})),m+=h.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=r.enter("destinationLiteral"),m+=h.move("<"),m+=h.move(r.safe(e.url,{before:m,after:">",...h.current()})),m+=h.move(">")):(f=r.enter("destinationRaw"),m+=h.move(r.safe(e.url,{before:m,after:e.title?" ":`
|
|
70
|
-
`,...h.current()}))),f(),e.title&&(f=r.enter(`title${c}`),m+=h.move(" "+o),m+=h.move(r.safe(e.title,{before:m,after:o,...h.current()})),m+=h.move(o),f()),u(),m}function _5(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 gl(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Tu(e,t,r){const a=Bs(e),o=Bs(t);return a===void 0?o===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}U0.peek=w5;function U0(e,t,r,a){const o=_5(r),c=r.enter("emphasis"),u=r.createTracker(a),f=u.move(o);let h=u.move(r.containerPhrasing(e,{after:o,before:f,...u.current()}));const m=h.charCodeAt(0),b=Tu(a.before.charCodeAt(a.before.length-1),m,o);b.inside&&(h=gl(m)+h.slice(1));const y=h.charCodeAt(h.length-1),v=Tu(a.after.charCodeAt(0),y,o);v.inside&&(h=h.slice(0,-1)+gl(y));const x=u.move(o);return c(),r.attentionEncodeSurroundingInfo={after:v.outside,before:b.outside},f+h+x}function w5(e,t,r){return r.options.emphasis||"*"}function k5(e,t){let r=!1;return Fu(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return r=!0,np}),!!((!e.depth||e.depth<3)&&Up(e)&&(t.options.setext||r))}function T5(e,t,r,a){const o=Math.max(Math.min(6,e.depth||1),1),c=r.createTracker(a);if(k5(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
|
-
`+(o===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
|
|
74
|
-
`))+1))}const u="#".repeat(o),f=r.enter("headingAtx"),h=r.enter("phrasing");c.move(u+" ");let m=r.containerPhrasing(e,{before:"# ",after:`
|
|
75
|
-
`,...c.current()});return/^[\t ]/.test(m)&&(m=gl(m.charCodeAt(0))+m.slice(1)),m=m?u+" "+m:u,r.options.closeAtx&&(m+=" "+u),h(),f(),m}P0.peek=N5;function P0(e){return e.value||""}function N5(){return"<"}H0.peek=C5;function H0(e,t,r,a){const o=qp(r),c=o==='"'?"Quote":"Apostrophe",u=r.enter("image");let f=r.enter("label");const h=r.createTracker(a);let m=h.move("![");return m+=h.move(r.safe(e.alt,{before:m,after:"]",...h.current()})),m+=h.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=r.enter("destinationLiteral"),m+=h.move("<"),m+=h.move(r.safe(e.url,{before:m,after:">",...h.current()})),m+=h.move(">")):(f=r.enter("destinationRaw"),m+=h.move(r.safe(e.url,{before:m,after:e.title?" ":")",...h.current()}))),f(),e.title&&(f=r.enter(`title${c}`),m+=h.move(" "+o),m+=h.move(r.safe(e.title,{before:m,after:o,...h.current()})),m+=h.move(o),f()),m+=h.move(")"),u(),m}function C5(){return"!"}F0.peek=A5;function F0(e,t,r,a){const o=e.referenceType,c=r.enter("imageReference");let u=r.enter("label");const f=r.createTracker(a);let h=f.move("![");const m=r.safe(e.alt,{before:h,after:"]",...f.current()});h+=f.move(m+"]["),u();const b=r.stack;r.stack=[],u=r.enter("reference");const y=r.safe(r.associationId(e),{before:h,after:"]",...f.current()});return u(),r.stack=b,c(),o==="full"||!m||m!==y?h+=f.move(y+"]"):o==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function A5(){return"!"}$0.peek=O5;function $0(e,t,r){let a=e.value||"",o="`",c=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(a);)o+="`";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],f=r.compilePattern(u);let h;if(u.atBreak)for(;h=f.exec(a);){let m=h.index;a.charCodeAt(m)===10&&a.charCodeAt(m-1)===13&&m--,a=a.slice(0,m)+" "+a.slice(h.index+1)}}return o+a+o}function O5(){return"`"}function G0(e,t){const r=Up(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))}K0.peek=M5;function K0(e,t,r,a){const o=qp(r),c=o==='"'?"Quote":"Apostrophe",u=r.createTracker(a);let f,h;if(G0(e,r)){const b=r.stack;r.stack=[],f=r.enter("autolink");let y=u.move("<");return y+=u.move(r.containerPhrasing(e,{before:y,after:">",...u.current()})),y+=u.move(">"),f(),r.stack=b,y}f=r.enter("link"),h=r.enter("label");let m=u.move("[");return m+=u.move(r.containerPhrasing(e,{before:m,after:"](",...u.current()})),m+=u.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=r.enter("destinationLiteral"),m+=u.move("<"),m+=u.move(r.safe(e.url,{before:m,after:">",...u.current()})),m+=u.move(">")):(h=r.enter("destinationRaw"),m+=u.move(r.safe(e.url,{before:m,after:e.title?" ":")",...u.current()}))),h(),e.title&&(h=r.enter(`title${c}`),m+=u.move(" "+o),m+=u.move(r.safe(e.title,{before:m,after:o,...u.current()})),m+=u.move(o),h()),m+=u.move(")"),f(),m}function M5(e,t,r){return G0(e,r)?"<":"["}V0.peek=R5;function V0(e,t,r,a){const o=e.referenceType,c=r.enter("linkReference");let u=r.enter("label");const f=r.createTracker(a);let h=f.move("[");const m=r.containerPhrasing(e,{before:h,after:"]",...f.current()});h+=f.move(m+"]["),u();const b=r.stack;r.stack=[],u=r.enter("reference");const y=r.safe(r.associationId(e),{before:h,after:"]",...f.current()});return u(),r.stack=b,c(),o==="full"||!m||m!==y?h+=f.move(y+"]"):o==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function R5(){return"["}function Yp(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 I5(e){const t=Yp(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 L5(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 q0(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 D5(e,t,r,a){const o=r.enter("list"),c=r.bulletCurrent;let u=e.ordered?L5(r):Yp(r);const f=e.ordered?u==="."?")":".":I5(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),q0(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=f),r.bulletCurrent=u;const m=r.containerFlow(e,a);return r.bulletLastUsed=u,r.bulletCurrent=c,o(),m}function j5(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 z5(e,t,r,a){const o=j5(r);let c=r.bulletCurrent||Yp(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;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(u=Math.ceil(u/4)*4);const f=r.createTracker(a);f.move(c+" ".repeat(u-c.length)),f.shift(u);const h=r.enter("listItem"),m=r.indentLines(r.containerFlow(e,f.current()),b);return h(),m;function b(y,v,x){return v?(x?"":" ".repeat(u))+y:(x?c:c+" ".repeat(u-c.length))+y}}function B5(e,t,r,a){const o=r.enter("paragraph"),c=r.enter("phrasing"),u=r.containerPhrasing(e,a);return c(),o(),u}const U5=kl(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function P5(e,t,r,a){return(e.children.some(function(u){return U5(u)})?r.containerPhrasing:r.containerFlow).call(r,e,a)}function H5(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Y0.peek=F5;function Y0(e,t,r,a){const o=H5(r),c=r.enter("strong"),u=r.createTracker(a),f=u.move(o+o);let h=u.move(r.containerPhrasing(e,{after:o,before:f,...u.current()}));const m=h.charCodeAt(0),b=Tu(a.before.charCodeAt(a.before.length-1),m,o);b.inside&&(h=gl(m)+h.slice(1));const y=h.charCodeAt(h.length-1),v=Tu(a.after.charCodeAt(0),y,o);v.inside&&(h=h.slice(0,-1)+gl(y));const x=u.move(o+o);return c(),r.attentionEncodeSurroundingInfo={after:v.outside,before:b.outside},f+h+x}function F5(e,t,r){return r.options.strong||"*"}function $5(e,t,r,a){return r.safe(e.value,a)}function G5(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 K5(e,t,r){const a=(q0(r)+(r.options.ruleSpaces?" ":"")).repeat(G5(r));return r.options.ruleSpaces?a.slice(0,-1):a}const W0={blockquote:p5,break:vx,code:x5,definition:S5,emphasis:U0,hardBreak:vx,heading:T5,html:P0,image:H0,imageReference:F0,inlineCode:$0,link:K0,linkReference:V0,list:D5,listItem:z5,paragraph:B5,root:P5,strong:Y0,text:$5,thematicBreak:K5};function V5(){return{enter:{table:q5,tableData:xx,tableHeader:xx,tableRow:W5},exit:{codeText:X5,table:Y5,tableData:_h,tableHeader:_h,tableRow:_h}}}function q5(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 Y5(e){this.exit(e),this.data.inTable=void 0}function W5(e){this.enter({type:"tableRow",children:[]},e)}function _h(e){this.exit(e)}function xx(e){this.enter({type:"tableCell",children:[]},e)}function X5(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Z5));const r=this.stack[this.stack.length-1];r.type,r.value=t,this.exit(e)}function Z5(e,t){return t==="|"?t:e}function J5(e){const t=e||{},r=t.tableCellPadding,a=t.tablePipeAlign,o=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:f}};function u(x,S,_,N){return m(b(x,_,N),x.align)}function f(x,S,_,N){const T=y(x,_,N),O=m([T]);return O.slice(0,O.indexOf(`
|
|
77
|
-
`))}function h(x,S,_,N){const T=_.enter("tableCell"),O=_.enter("phrasing"),R=_.containerPhrasing(x,{...N,before:c,after:c});return O(),T(),R}function m(x,S){return f5(x,{align:S,alignDelimiters:a,padding:r,stringLength:o})}function b(x,S,_){const N=x.children;let T=-1;const O=[],R=S.enter("table");for(;++T<N.length;)O[T]=y(N[T],S,_);return R(),O}function y(x,S,_){const N=x.children;let T=-1;const O=[],R=S.enter("tableRow");for(;++T<N.length;)O[T]=h(N[T],x,S,_);return R(),O}function v(x,S,_){let N=W0.inlineCode(x,S,_);return _.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function Q5(){return{exit:{taskListCheckValueChecked:Ex,taskListCheckValueUnchecked:Ex,paragraph:tO}}}function eO(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:nO}}}function Ex(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function tO(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 o=t.children;let c=-1,u;for(;++c<o.length;){const f=o[c];if(f.type==="paragraph"){u=f;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 nO(e,t,r,a){const o=e.children[0],c=typeof e.checked=="boolean"&&o&&o.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",f=r.createTracker(a);c&&f.move(u);let h=W0.listItem(e,t,r,{...a,...f.current()});return c&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),h;function m(b){return b+u}}function rO(){return[DA(),n5(),s5(),V5(),Q5()]}function iO(e){return{extensions:[jA(),r5(e),o5(),J5(e),eO()]}}const aO={tokenize:dO,partial:!0},X0={tokenize:fO,partial:!0},Z0={tokenize:hO,partial:!0},J0={tokenize:pO,partial:!0},sO={tokenize:mO,partial:!0},Q0={name:"wwwAutolink",tokenize:cO,previous:tE},eE={name:"protocolAutolink",tokenize:uO,previous:nE},ui={name:"emailAutolink",tokenize:lO,previous:rE},Ir={};function oO(){return{text:Ir}}let ya=48;for(;ya<123;)Ir[ya]=ui,ya++,ya===58?ya=65:ya===91&&(ya=97);Ir[43]=ui;Ir[45]=ui;Ir[46]=ui;Ir[95]=ui;Ir[72]=[ui,eE];Ir[104]=[ui,eE];Ir[87]=[ui,Q0];Ir[119]=[ui,Q0];function lO(e,t,r){const a=this;let o,c;return u;function u(y){return!sp(y)||!rE.call(a,a.previous)||Wp(a.events)?r(y):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(y))}function f(y){return sp(y)?(e.consume(y),f):y===64?(e.consume(y),h):r(y)}function h(y){return y===46?e.check(sO,b,m)(y):y===45||y===95||mn(y)?(c=!0,e.consume(y),h):b(y)}function m(y){return e.consume(y),o=!0,h}function b(y){return c&&o&&Sn(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(y)):r(y)}}function cO(e,t,r){const a=this;return o;function o(u){return u!==87&&u!==119||!tE.call(a,a.previous)||Wp(a.events)?r(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(aO,e.attempt(X0,e.attempt(Z0,c),r),r)(u))}function c(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function uO(e,t,r){const a=this;let o="",c=!1;return u;function u(y){return(y===72||y===104)&&nE.call(a,a.previous)&&!Wp(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(y),e.consume(y),f):r(y)}function f(y){if(Sn(y)&&o.length<5)return o+=String.fromCodePoint(y),e.consume(y),f;if(y===58){const v=o.toLowerCase();if(v==="http"||v==="https")return e.consume(y),h}return r(y)}function h(y){return y===47?(e.consume(y),c?m:(c=!0,h)):r(y)}function m(y){return y===null||_u(y)||Ot(y)||Ca(y)||Bu(y)?r(y):e.attempt(X0,e.attempt(Z0,b),r)(y)}function b(y){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(y)}}function dO(e,t,r){let a=0;return o;function o(u){return(u===87||u===119)&&a<3?(a++,e.consume(u),o):u===46&&a===3?(e.consume(u),c):r(u)}function c(u){return u===null?r(u):t(u)}}function fO(e,t,r){let a,o,c;return u;function u(m){return m===46||m===95?e.check(J0,h,f)(m):m===null||Ot(m)||Ca(m)||m!==45&&Bu(m)?h(m):(c=!0,e.consume(m),u)}function f(m){return m===95?a=!0:(o=a,a=void 0),e.consume(m),u}function h(m){return o||a||!c?r(m):t(m)}}function hO(e,t){let r=0,a=0;return o;function o(u){return u===40?(r++,e.consume(u),o):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(J0,t,c)(u):u===null||Ot(u)||Ca(u)?t(u):(e.consume(u),o)}function c(u){return u===41&&a++,e.consume(u),o}}function pO(e,t,r){return a;function a(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),a):f===38?(e.consume(f),c):f===93?(e.consume(f),o):f===60||f===null||Ot(f)||Ca(f)?t(f):r(f)}function o(f){return f===null||f===40||f===91||Ot(f)||Ca(f)?t(f):a(f)}function c(f){return Sn(f)?u(f):r(f)}function u(f){return f===59?(e.consume(f),a):Sn(f)?(e.consume(f),u):r(f)}}function mO(e,t,r){return a;function a(c){return e.consume(c),o}function o(c){return mn(c)?r(c):t(c)}}function tE(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ot(e)}function nE(e){return!Sn(e)}function rE(e){return!(e===47||sp(e))}function sp(e){return e===43||e===45||e===46||e===95||mn(e)}function Wp(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 gO={tokenize:wO,partial:!0};function bO(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:EO,continuation:{tokenize:SO},exit:_O}},text:{91:{name:"gfmFootnoteCall",tokenize:xO},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:yO,resolveTo:vO}}}}function yO(e,t,r){const a=this;let o=a.events.length;const c=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let u;for(;o--;){const h=a.events[o][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 f;function f(h){if(!u||!u._balanced)return r(h);const m=gr(a.sliceSerialize({start:u.end,end:a.now()}));return m.codePointAt(0)!==94||!c.includes(m.slice(1))?r(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),t(h))}}function vO(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)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const c={type:"gfmFootnoteCallString",start:Object.assign({},o.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)},f=[e[r+1],e[r+2],["enter",a,t],e[r+3],e[r+4],["enter",o,t],["exit",o,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,...f),e}function xO(e,t,r){const a=this,o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let c=0,u;return f;function f(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",m)}function m(y){if(c>999||y===93&&!u||y===null||y===91||Ot(y))return r(y);if(y===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return o.includes(gr(a.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(y),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):r(y)}return Ot(y)||(u=!0),c++,e.consume(y),y===92?b:m}function b(y){return y===91||y===92||y===93?(e.consume(y),c++,m):m(y)}}function EO(e,t,r){const a=this,o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let c,u=0,f;return h;function h(S){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(S){return S===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",b):r(S)}function b(S){if(u>999||S===93&&!f||S===null||S===91||Ot(S))return r(S);if(S===93){e.exit("chunkString");const _=e.exit("gfmFootnoteDefinitionLabelString");return c=gr(a.sliceSerialize(_)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return Ot(S)||(f=!0),u++,e.consume(S),S===92?y:b}function y(S){return S===91||S===92||S===93?(e.consume(S),u++,b):b(S)}function v(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),o.includes(c)||o.push(c),lt(e,x,"gfmFootnoteDefinitionWhitespace")):r(S)}function x(S){return t(S)}}function SO(e,t,r){return e.check(wl,t,e.attempt(gO,t,r))}function _O(e){e.exit("gfmFootnoteDefinition")}function wO(e,t,r){const a=this;return lt(e,o,"gfmFootnoteDefinitionIndent",5);function o(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 kO(e){let r=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:c,resolveAll:o};return r==null&&(r=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function o(u,f){let h=-1;for(;++h<u.length;)if(u[h][0]==="enter"&&u[h][1].type==="strikethroughSequenceTemporary"&&u[h][1]._close){let m=h;for(;m--;)if(u[m][0]==="exit"&&u[m][1].type==="strikethroughSequenceTemporary"&&u[m][1]._open&&u[h][1].end.offset-u[h][1].start.offset===u[m][1].end.offset-u[m][1].start.offset){u[h][1].type="strikethroughSequence",u[m][1].type="strikethroughSequence";const b={type:"strikethrough",start:Object.assign({},u[m][1].start),end:Object.assign({},u[h][1].end)},y={type:"strikethroughText",start:Object.assign({},u[m][1].end),end:Object.assign({},u[h][1].start)},v=[["enter",b,f],["enter",u[m][1],f],["exit",u[m][1],f],["enter",y,f]],x=f.parser.constructs.insideSpan.null;x&&Xn(v,v.length,0,Uu(x,u.slice(m+1,h),f)),Xn(v,v.length,0,[["exit",y,f],["enter",u[h][1],f],["exit",u[h][1],f],["exit",b,f]]),Xn(u,m-1,h-m+3,v),h=m+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,f,h){const m=this.previous,b=this.events;let y=0;return v;function v(S){return m===126&&b[b.length-1][1].type!=="characterEscape"?h(S):(u.enter("strikethroughSequenceTemporary"),x(S))}function x(S){const _=Bs(m);if(S===126)return y>1?h(S):(u.consume(S),y++,x);if(y<2&&!r)return h(S);const N=u.exit("strikethroughSequenceTemporary"),T=Bs(S);return N._open=!T||T===2&&!!_,N._close=!_||_===2&&!!T,f(S)}}}class TO{constructor(){this.map=[]}add(t,r,a){NO(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 o=a.pop();for(;o;){for(const c of o)t.push(c);o=a.pop()}this.map.length=0}}function NO(e,t,r,a){let o=0;if(!(r===0&&a.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=r,e.map[o][2].push(...a);return}o+=1}e.map.push([t,r,a])}}function CO(e,t){let r=!1;const a=[];for(;t<e.length;){const o=e[t];if(r){if(o[0]==="enter")o[1].type==="tableContent"&&a.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const c=a.length-1;a[c]=a[c]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(r=!0);t+=1}return a}function AO(){return{flow:{null:{name:"table",tokenize:OO,resolveAll:MO}}}}function OO(e,t,r){const a=this;let o=0,c=0,u;return f;function f(P){let $=a.events.length-1;for(;$>-1;){const se=a.events[$][1].type;if(se==="lineEnding"||se==="linePrefix")$--;else break}const Y=$>-1?a.events[$][1].type:null,te=Y==="tableHead"||Y==="tableRow"?w:h;return te===w&&a.parser.lazy[a.now().line]?r(P):te(P)}function h(P){return e.enter("tableHead"),e.enter("tableRow"),m(P)}function m(P){return P===124||(u=!0,c+=1),b(P)}function b(P){return P===null?r(P):Le(P)?c>1?(c=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),x):r(P):nt(P)?lt(e,b,"whitespace")(P):(c+=1,u&&(u=!1,o+=1),P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),u=!0,b):(e.enter("data"),y(P)))}function y(P){return P===null||P===124||Ot(P)?(e.exit("data"),b(P)):(e.consume(P),P===92?v:y)}function v(P){return P===92||P===124?(e.consume(P),y):y(P)}function x(P){return a.interrupt=!1,a.parser.lazy[a.now().line]?r(P):(e.enter("tableDelimiterRow"),u=!1,nt(P)?lt(e,S,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):S(P))}function S(P){return P===45||P===58?N(P):P===124?(u=!0,e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),_):L(P)}function _(P){return nt(P)?lt(e,N,"whitespace")(P):N(P)}function N(P){return P===58?(c+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),T):P===45?(c+=1,T(P)):P===null||Le(P)?M(P):L(P)}function T(P){return P===45?(e.enter("tableDelimiterFiller"),O(P)):L(P)}function O(P){return P===45?(e.consume(P),O):P===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),R):(e.exit("tableDelimiterFiller"),R(P))}function R(P){return nt(P)?lt(e,M,"whitespace")(P):M(P)}function M(P){return P===124?S(P):P===null||Le(P)?!u||o!==c?L(P):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(P)):L(P)}function L(P){return r(P)}function w(P){return e.enter("tableRow"),D(P)}function D(P){return P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),D):P===null||Le(P)?(e.exit("tableRow"),t(P)):nt(P)?lt(e,D,"whitespace")(P):(e.enter("data"),F(P))}function F(P){return P===null||P===124||Ot(P)?(e.exit("data"),D(P)):(e.consume(P),P===92?J:F)}function J(P){return P===92||P===124?(e.consume(P),F):F(P)}}function MO(e,t){let r=-1,a=!0,o=0,c=[0,0,0,0],u=[0,0,0,0],f=!1,h=0,m,b,y;const v=new TO;for(;++r<e.length;){const x=e[r],S=x[1];x[0]==="enter"?S.type==="tableHead"?(f=!1,h!==0&&(Sx(v,t,h,m,b),b=void 0,h=0),m={type:"table",start:Object.assign({},S.start),end:Object.assign({},S.end)},v.add(r,0,[["enter",m,t]])):S.type==="tableRow"||S.type==="tableDelimiterRow"?(a=!0,y=void 0,c=[0,0,0,0],u=[0,r+1,0,0],f&&(f=!1,b={type:"tableBody",start:Object.assign({},S.start),end:Object.assign({},S.end)},v.add(r,0,[["enter",b,t]])),o=S.type==="tableDelimiterRow"?2:b?3:1):o&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")?(a=!1,u[2]===0&&(c[1]!==0&&(u[0]=u[1],y=tu(v,t,c,o,void 0,y),c=[0,0,0,0]),u[2]=r)):S.type==="tableCellDivider"&&(a?a=!1:(c[1]!==0&&(u[0]=u[1],y=tu(v,t,c,o,void 0,y)),c=u,u=[c[1],r,0,0])):S.type==="tableHead"?(f=!0,h=r):S.type==="tableRow"||S.type==="tableDelimiterRow"?(h=r,c[1]!==0?(u[0]=u[1],y=tu(v,t,c,o,r,y)):u[1]!==0&&(y=tu(v,t,u,o,r,y)),o=0):o&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(u[3]=r)}for(h!==0&&Sx(v,t,h,m,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=CO(t.events,r))}return e}function tu(e,t,r,a,o,c){const u=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",f="tableContent";r[0]!==0&&(c.end=Object.assign({},_s(t.events,r[0])),e.add(r[0],0,[["exit",c,t]]));const h=_s(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 m=_s(t.events,r[2]),b=_s(t.events,r[3]),y={type:f,start:Object.assign({},m),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 S=r[2]+1,_=r[3]-r[2]-1;e.add(S,_,[])}}e.add(r[3]+1,0,[["exit",y,t]])}return o!==void 0&&(c.end=Object.assign({},_s(t.events,o)),e.add(o,0,[["exit",c,t]]),c=void 0),c}function Sx(e,t,r,a,o){const c=[],u=_s(t.events,r);o&&(o.end=Object.assign({},u),c.push(["exit",o,t])),a.end=Object.assign({},u),c.push(["exit",a,t]),e.add(r+1,0,c)}function _s(e,t){const r=e[t],a=r[0]==="enter"?"start":"end";return r[1][a]}const RO={name:"tasklistCheck",tokenize:LO};function IO(){return{text:{91:RO}}}function LO(e,t,r){const a=this;return o;function o(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 Ot(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"),f):r(h)}function f(h){return Le(h)?t(h):nt(h)?e.check({tokenize:DO},t,r)(h):r(h)}}function DO(e,t,r){return lt(e,a,"whitespace");function a(o){return o===null?r(o):t(o)}}function jO(e){return h0([oO(),bO(),kO(e),AO(),IO()])}const zO={};function iE(e){const t=this,r=e||zO,a=t.data(),o=a.micromarkExtensions||(a.micromarkExtensions=[]),c=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),u=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);o.push(jO(r)),c.push(rO()),u.push(iO(r))}const _x=(function(e,t,r){const a=kl(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]}),Ma=(function(e){if(e==null)return PO;if(typeof e=="string")return UO(e);if(typeof e=="object")return BO(e);if(typeof e=="function")return Xp(e);throw new Error("Expected function, string, or array as `test`")});function BO(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=Ma(e[r]);return Xp(a);function a(...o){let c=-1;for(;++c<t.length;)if(t[c].apply(this,o))return!0;return!1}}function UO(e){return Xp(t);function t(r){return r.tagName===e}}function Xp(e){return t;function t(r,a,o){return!!(HO(r)&&e.call(this,r,typeof a=="number"?a:void 0,o||void 0))}}function PO(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function HO(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const wx=/\n/g,kx=/[\t ]+/g,op=Ma("br"),Tx=Ma(WO),FO=Ma("p"),Nx=Ma("tr"),$O=Ma(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",YO,XO]),aE=Ma(["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 GO(e,t){const r=t||{},a="children"in e?e.children:[],o=aE(e),c=lE(e,{whitespace:r.whitespace||"normal"}),u=[];(e.type==="text"||e.type==="comment")&&u.push(...oE(e,{breakBefore:!0,breakAfter:!0}));let f=-1;for(;++f<a.length;)u.push(...sE(a[f],e,{whitespace:c,breakBefore:f?void 0:o,breakAfter:f<a.length-1?op(a[f+1]):o}));const h=[];let m;for(f=-1;++f<u.length;){const b=u[f];typeof b=="number"?m!==void 0&&b>m&&(m=b):b&&(m!==void 0&&m>-1&&h.push(`
|
|
78
|
-
`.repeat(m)||" "),m=-1,h.push(b))}return h.join("")}function sE(e,t,r){return e.type==="element"?KO(e,t,r):e.type==="text"?r.whitespace==="normal"?oE(e,r):VO(e):[]}function KO(e,t,r){const a=lE(e,r),o=e.children||[];let c=-1,u=[];if($O(e))return u;let f,h;for(op(e)||Nx(e)&&_x(t,e,Nx)?h=`
|
|
79
|
-
`:FO(e)?(f=2,h=2):aE(e)&&(f=1,h=1);++c<o.length;)u=u.concat(sE(o[c],e,{whitespace:a,breakBefore:c?void 0:f,breakAfter:c<o.length-1?op(o[c+1]):h}));return Tx(e)&&_x(t,e,Tx)&&u.push(" "),f&&u.unshift(f),h&&u.push(h),u}function oE(e,t){const r=String(e.value),a=[],o=[];let c=0;for(;c<=r.length;){wx.lastIndex=c;const h=wx.exec(r),m=h&&"index"in h?h.index:r.length;a.push(qO(r.slice(c,m).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),c===0?t.breakBefore:!0,m===r.length?t.breakAfter:!0)),c=m+1}let u=-1,f;for(;++u<a.length;)a[u].charCodeAt(a[u].length-1)===8203||u<a.length-1&&a[u+1].charCodeAt(0)===8203?(o.push(a[u]),f=void 0):a[u]?(typeof f=="number"&&o.push(f),o.push(a[u]),f=0):(u===0||u===a.length-1)&&o.push(0);return o}function VO(e){return[String(e.value)]}function qO(e,t,r){const a=[];let o=0,c;for(;o<e.length;){kx.lastIndex=o;const u=kx.exec(e);c=u?u.index:e.length,!o&&!c&&u&&!t&&a.push(""),o!==c&&a.push(e.slice(o,c)),o=u?c+u[0].length:c}return o!==c&&!r&&a.push(""),a.join(" ")}function lE(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 YO(e){return!!(e.properties||{}).hidden}function WO(e){return e.tagName==="td"||e.tagName==="th"}function XO(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function ZO(e){const t=e.regex,r=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",u="(?!struct)("+a+"|"+t.optional(o)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",f={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},m={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(m,{className:"string"}),{className:"string",begin:/<.*?>/},r,e.C_BLOCK_COMMENT_MODE]},v={className:"title",begin:t.optional(o)+e.IDENT_RE,relevance:0},x=t.optional(o)+e.IDENT_RE+"\\s*\\(",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"],_=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],N=["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"],T=["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"],M={type:_,keyword:S,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:N},L={className:"function.dispatch",relevance:0,keywords:{_hint:T},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},w=[L,y,f,r,e.C_BLOCK_COMMENT_MODE,b,m],D={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:M,contains:w.concat([{begin:/\(/,end:/\)/,keywords:M,contains:w.concat(["self"]),relevance:0}]),relevance:0},F={className:"function",begin:"("+u+"[\\*&\\s]+)+"+x,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:M,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:M,relevance:0},{begin:x,returnBegin:!0,contains:[v],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[m,b]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:M,relevance:0,contains:[r,e.C_BLOCK_COMMENT_MODE,m,b,f,{begin:/\(/,end:/\)/,keywords:M,relevance:0,contains:["self",r,e.C_BLOCK_COMMENT_MODE,m,b,f]}]},f,r,e.C_BLOCK_COMMENT_MODE,y]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:M,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(D,F,L,w,[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:M,contains:["self",f]},{begin:e.IDENT_RE+"::",keywords:M},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function JO(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=ZO(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 QO(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 o={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"})]}},f={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,r,o]};o.contains.push(f);const h={match:/\\"/},m={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}),S={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},_=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],N=["true","false"],T={match:/(\/[a-z._-]+)+/},O=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],R=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],M=["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"],L=["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:_,literal:N,built_in:[...O,...R,"set","shopt",...M,...L]},contains:[x,e.SHEBANG(),S,y,c,u,T,f,h,m,b,r]}}function eM(e){const t=e.regex,r=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",u="("+a+"|"+t.optional(o)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",f={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},m={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(m,{className:"string"}),{className:"string",begin:/<.*?>/},r,e.C_BLOCK_COMMENT_MODE]},v={className:"title",begin:t.optional(o)+e.IDENT_RE,relevance:0},x=t.optional(o)+e.IDENT_RE+"\\s*\\(",N={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"},T=[y,f,r,e.C_BLOCK_COMMENT_MODE,b,m],O={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:N,contains:T.concat([{begin:/\(/,end:/\)/,keywords:N,contains:T.concat(["self"]),relevance:0}]),relevance:0},R={begin:"("+u+"[\\*&\\s]+)+"+x,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:N,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:N,relevance:0},{begin:x,returnBegin:!0,contains:[e.inherit(v,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:[r,e.C_BLOCK_COMMENT_MODE,m,b,f,{begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:["self",r,e.C_BLOCK_COMMENT_MODE,m,b,f]}]},f,r,e.C_BLOCK_COMMENT_MODE,y]};return{name:"C",aliases:["h"],keywords:N,disableAutodetect:!0,illegal:"</",contains:[].concat(O,R,T,[y,{begin:e.IDENT_RE+"::",keywords:N},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:y,strings:m,keywords:N}}}function tM(e){const t=e.regex,r=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",u="(?!struct)("+a+"|"+t.optional(o)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",f={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},m={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(m,{className:"string"}),{className:"string",begin:/<.*?>/},r,e.C_BLOCK_COMMENT_MODE]},v={className:"title",begin:t.optional(o)+e.IDENT_RE,relevance:0},x=t.optional(o)+e.IDENT_RE+"\\s*\\(",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"],_=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],N=["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"],T=["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"],M={type:_,keyword:S,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:N},L={className:"function.dispatch",relevance:0,keywords:{_hint:T},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},w=[L,y,f,r,e.C_BLOCK_COMMENT_MODE,b,m],D={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:M,contains:w.concat([{begin:/\(/,end:/\)/,keywords:M,contains:w.concat(["self"]),relevance:0}]),relevance:0},F={className:"function",begin:"("+u+"[\\*&\\s]+)+"+x,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:M,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:M,relevance:0},{begin:x,returnBegin:!0,contains:[v],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[m,b]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:M,relevance:0,contains:[r,e.C_BLOCK_COMMENT_MODE,m,b,f,{begin:/\(/,end:/\)/,keywords:M,relevance:0,contains:["self",r,e.C_BLOCK_COMMENT_MODE,m,b,f]}]},f,r,e.C_BLOCK_COMMENT_MODE,y]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:M,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(D,F,L,w,[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:M,contains:["self",f]},{begin:e.IDENT_RE+"::",keywords:M},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function nM(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"],o=["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:o.concat(c),built_in:t,literal:a},f=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},m={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/}),S={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,x]},_={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},v]},N=e.inherit(_,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},x]});v.contains=[_,S,b,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,e.C_BLOCK_COMMENT_MODE],x.contains=[N,S,y,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const T={variants:[m,_,S,b,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},O={begin:"<",end:">",contains:[{beginKeywords:"in out"},f]},R=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",M={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"}},T,h,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},f,O,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[f,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[f,O,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:"("+R+"\\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,O],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,relevance:0,contains:[T,h,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},M]}}const rM=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_-]*/}}),iM=["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"],aM=["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"],sM=[...iM,...aM],oM=["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(),lM=["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(),cM=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),uM=["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 dM(e){const t=e.regex,r=rM(e),a={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},o="and or not only",c=/@-?\w[\w]*(-\w+)*/,u="[a-zA-Z-][a-zA-Z0-9_-]*",f=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[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:":("+lM.join("|")+")"},{begin:":(:)?("+cM.join("|")+")"}]},r.CSS_VARIABLE,{className:"attribute",begin:"\\b("+uM.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[r.BLOCK_COMMENT,r.HEXCOLOR,r.IMPORTANT,r.CSS_NUMBER_MODE,...f,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...f,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},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:o,attribute:oM.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...f,r.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+sM.join("|")+")\\b"}]}}function fM(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 hM(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 pM(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 mM(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 o={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:"'"}]},f={begin:/\[/,end:/\]/,contains:[a,c,o,u,r,"self"],relevance:0},h=/[A-Za-z0-9_-]+/,m=/"(\\"|[^"])*"/,b=/'[^']*'/,y=t.either(h,m,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,f,c,o,u,r]}}]}}var ws="[0-9](_*[0-9])*",nu=`\\.(${ws})`,ru="[0-9a-fA-F](_*[0-9a-fA-F])*",Cx={className:"number",variants:[{begin:`(\\b(${ws})((${nu})|\\.)?|(${nu}))[eE][+-]?(${ws})[fFdD]?\\b`},{begin:`\\b(${ws})((${nu})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${nu})[fFdD]?\\b`},{begin:`\\b(${ws})[fFdD]\\b`},{begin:`\\b0[xX]((${ru})\\.?|(${ru})?\\.(${ru}))[pP][+-]?(${ws})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${ru})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function cE(e,t,r){return r===-1?"":e.replace(t,a=>cE(e,t,r-1))}function gM(e){const t=e.regex,r="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",a=r+cE("(?:<"+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"]},m={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:[m,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,Cx,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},Cx,m]}}const Ax="[A-Za-z$_][0-9A-Za-z$_]*",bM=["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"],yM=["true","false","null","undefined","NaN","Infinity"],uE=["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"],dE=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],fE=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],vM=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],xM=[].concat(fE,uE,dE);function EM(e){const t=e.regex,r=(oe,{after:ye})=>{const I="</"+oe[0].slice(1);return oe.input.indexOf(I,ye)!==-1},a=Ax,o={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,u={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(oe,ye)=>{const I=oe[0].length+oe.index,j=oe.input[I];if(j==="<"||j===","){ye.ignoreMatch();return}j===">"&&(r(oe,{after:I})||ye.ignoreMatch());let Q;const A=oe.input.substring(I);if(Q=A.match(/^\s*=/)){ye.ignoreMatch();return}if((Q=A.match(/^\s+extends\s+/))&&Q.index===0){ye.ignoreMatch();return}}},f={$pattern:Ax,keyword:bM,literal:yM,built_in:xM,"variable.language":vM},h="[0-9](_?[0-9])*",m=`\\.(${h})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",y={className:"number",variants:[{begin:`(\\b(${b})((${m})|\\.)?|(${m}))[eE][+-]?(${h})\\b`},{begin:`\\b(${b})\\b((${m})\\b|\\.)?|(${m})\\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:f,contains:[]},x={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"xml"}},S={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"css"}},_={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"graphql"}},N={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,v]},O={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]},R=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,S,_,N,{match:/\$\d+/},y];v.contains=R.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(R)});const M=[].concat(O,v.contains),L=M.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat(M)}]),w={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:L},D={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"}}]},F={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:{_:[...uE,...dE]}},J={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},P={variants:[{match:[/function/,/\s+/,a,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},$={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Y(oe){return t.concat("(?!",oe.join("|"),")")}const te={match:t.concat(/\b/,Y([...fE,"super","import"].map(oe=>`${oe}\\s*\\(`)),a,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},se={begin:t.concat(/\./,t.lookahead(t.concat(a,/(?![0-9A-Za-z$_(])/))),end:a,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},V={match:[/get|set/,/\s+/,a,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",re={match:[/const|var|let/,/\s+/,a,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:L,CLASS_REFERENCE:F},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),J,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,S,_,N,O,{match:/\$\d+/},y,F,{scope:"attr",match:a+t.lookahead(":"),relevance:0},re,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[O,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:f,contains:L}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.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"]}]}]},P,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,e.inherit(e.TITLE_MODE,{begin:a,className:"title.function"})]},{match:/\.\.\./,relevance:0},se,{match:"\\$"+a,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},te,$,D,V,{match:/\$[(.]/}]}}function SM(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},a=["true","false","null"],o={scope:"literal",beginKeywords:a.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:a},contains:[t,r,e.QUOTE_STRING_MODE,o,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var ks="[0-9](_*[0-9])*",iu=`\\.(${ks})`,au="[0-9a-fA-F](_*[0-9a-fA-F])*",_M={className:"number",variants:[{begin:`(\\b(${ks})((${iu})|\\.)?|(${iu}))[eE][+-]?(${ks})[fFdD]?\\b`},{begin:`\\b(${ks})((${iu})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${iu})[fFdD]?\\b`},{begin:`\\b(${ks})[fFdD]\\b`},{begin:`\\b0[xX]((${au})\\.?|(${au})?\\.(${au}))[pP][+-]?(${ks})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${au})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function wM(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+"@"},o={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,o]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,c,o]}]};o.contains.push(u);const f={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"]}]},m=_M,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,f,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,f,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},f,h]},u,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
80
|
-
`},m]}}const kM=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_-]*/}}),TM=["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"],NM=["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"],CM=[...TM,...NM],AM=["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(),hE=["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(),pE=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),OM=["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(),MM=hE.concat(pE).sort().reverse();function RM(e){const t=kM(e),r=MM,a="and or not only",o="[\\w-]+",c="("+o+"|@\\{"+o+"\\})",u=[],f=[],h=function(R){return{className:"string",begin:"~?"+R+".*?"+R}},m=function(R,M,L){return{className:R,begin:M,relevance:L}},b={$pattern:/[a-z-]+/,keyword:a,attribute:AM.join(" ")},y={begin:"\\(",end:"\\)",contains:f,keywords:b,relevance:0};f.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,m("variable","@@?"+o,10),m("variable","@\\{"+o+"\\}"),m("built_in","~?`[^`]*?`"),{className:"attribute",begin:o+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const v=f.concat({begin:/\{/,end:/\}/,contains:u}),x={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(f)},S={begin:c+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+OM.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:f}}]},_={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:f,relevance:0}},N={className:"variable",variants:[{begin:"@"+o+"\\s*:",relevance:15},{begin:"@"+o}],starts:{end:"[;}]",returnEnd:!0,contains:v}},T={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,m("keyword","all\\b"),m("variable","@\\{"+o+"\\}"),{begin:"\\b("+CM.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,m("selector-tag",c,0),m("selector-id","#"+c),m("selector-class","\\."+c,0),m("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+hE.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+pE.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:v},{begin:"!important"},t.FUNCTION_DISPATCH]},O={begin:o+`:(:)?(${r.join("|")})`,returnBegin:!0,contains:[T]};return u.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,_,N,O,S,T,x,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:u}}function IM(e){const t="\\[=*\\[",r="\\]=*\\]",a={begin:t,end:r,contains:["self"]},o=[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:o.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:o}].concat(o)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:r,contains:[a],relevance:5}])}}function LM(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]},o={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,o,c,u]}}function DM(e){const t=e.regex,r={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},a={begin:"^[-\\*]{3,}",end:"$"},o={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}]},f=/[A-Za-z][A-Za-z0-9+.-]*/,h={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,f,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},m={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(m,{contains:[]}),v=e.inherit(b,{contains:[]});m.contains.push(v),b.contains.push(y);let x=[r,h];return[m,b,y,v].forEach(T=>{T.contains=T.contains.concat(x)}),x=x.concat(m,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,m,b,{className:"quote",begin:"^>\\s+",contains:x,end:"$"},o,a,h,u,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function jM(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_]*/,f={"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:f,illegal:"</",contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+h.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:h,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function zM(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}/,o={$pattern:/[\w.]+/,keyword:r.join(" ")},c={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:o},u={begin:/->\{/,end:/\}/},f={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:[f]},m={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=(_,N,T="\\1")=>{const O=T==="\\1"?T:t.concat(T,N);return t.concat(t.concat("(?:",_,")"),N,/(?:\\.|[^\\\/])*?/,O,/(?:\\.|[^\\\/])*?/,T,a)},x=(_,N,T)=>t.concat(t.concat("(?:",_,")"),N,/(?:\\.|[^\\\/])*?/,T,a),S=[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}]},m,{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,f]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,f,m]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return c.contains=S,u.contains=S,{name:"Perl",aliases:["pl","pm"],keywords:o,contains:S}}function BM(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),o=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},f={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},h={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},m=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":(se,V)=>{V.data._beginMatch=se[1]||se[2]},"on:end":(se,V)=>{V.data._beginMatch!==se[1]&&V.ignoreMatch()}},v=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),x=`[
|
|
81
|
-
]`,S={scope:"string",variants:[b,m,y,v]},_={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},N=["false","null","true"],T=["__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"],O=["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"],M={keyword:T,literal:(se=>{const V=[];return se.forEach(z=>{V.push(z),z.toLowerCase()===z?V.push(z.toUpperCase()):V.push(z.toLowerCase())}),V})(N),built_in:O},L=se=>se.map(V=>V.replace(/\|\d+$/,"")),w={variants:[{match:[/new/,t.concat(x,"+"),t.concat("(?!",L(O).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},D=t.concat(a,"\\b(?!\\()"),F={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),D],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,t.concat(/::/,t.lookahead(/(?!class\b)/)),D],scope:{1:"title.class",3:"variable.constant"}},{match:[o,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[o,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},J={scope:"attr",match:t.concat(a,t.lookahead(":"),t.lookahead(/(?!::)/))},P={relevance:0,begin:/\(/,end:/\)/,keywords:M,contains:[J,u,F,e.C_BLOCK_COMMENT_MODE,S,_,w]},$={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",L(T).join("\\b|"),"|",L(O).join("\\b|"),"\\b)"),a,t.concat(x,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[P]};P.contains.push($);const Y=[J,F,e.C_BLOCK_COMMENT_MODE,S,_,w],te={begin:t.concat(/#\[\s*\\?/,t.either(o,c)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:N,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:N,keyword:["new","array"]},contains:["self",...Y]},...Y,{scope:"meta",variants:[{match:o},{match:c}]}]};return{case_insensitive:!1,keywords:M,contains:[te,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},f,{scope:"variable.language",match:/\$this\b/},u,$,F,{match:[/const/,/\s/,a],scope:{1:"keyword",3:"variable.constant"}},w,{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:M,contains:["self",te,u,F,e.C_BLOCK_COMMENT_MODE,S,_]}]},{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]},S,_]}}function UM(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 PM(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function HM(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"],f={$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:/^(>>>|\.\.\.) /},m={className:"subst",begin:/\{/,end:/\}/,keywords:f,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,m]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,h,b,m]},{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,m]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,b,m]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},v="[0-9](_?[0-9])*",x=`(\\b(${v}))?\\.(${v})|\\b(${v})\\.`,S=`\\b|${a.join("|")}`,_={className:"number",relevance:0,variants:[{begin:`(\\b(${v})|(${x}))[eE][+-]?(${v})[jJ]?(?=${S})`},{begin:`(${x})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${S})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${S})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${S})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${S})`},{begin:`\\b(${v})[jJ](?=${S})`}]},N={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:f,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},T={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:["self",h,_,y,e.HASH_COMMENT_MODE]}]};return m.contains=[y,_,h],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:f,illegal:/(<\/|\?)|=>/,contains:[h,_,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},y,N,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[T]},{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,y]}]}}function FM(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function $M(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]?/),o=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,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:[o,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:o},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:c},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function GM(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]+/),o=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"]},f={className:"doctag",begin:"@[A-Za-z]+"},h={begin:"#<",end:">"},m=[e.COMMENT("#","$",{contains:[f]}),e.COMMENT("^=begin","^=end",{contains:[f],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])*",S={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"}]},_={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:u}]},w=[y,{variants:[{match:[/class\s+/,o,/\s+<\s+/,o]},{match:[/\b(class|module)\s+/,o]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:u},{match:[/(include|extend)\s+/,o],scope:{2:"title.class"},keywords:u},{relevance:0,match:[o,/\.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:[_]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[y,{begin:r}],relevance:0},S,{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,m),relevance:0}].concat(h,m);b.contains=w,_.contains=w;const P=[{begin:/^\s*=>/,starts:{end:"$",contains:w}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:u,contains:w}}];return m.unshift(h),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:u,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(P).concat(m).concat(w)}}function KM(e){const t=e.regex,r=/(r#)?/,a=t.concat(r,e.UNDERSCORE_IDENT_RE),o=t.concat(r,e.IDENT_RE),c={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,o,t.lookahead(/\s*\(/))},u="([ui](8|16|32|64|128|size)|f(32|64))?",f=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],h=["true","false","Some","None","Ok","Err"],m=["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:f,literal:h,built_in:m},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:m,type:b}},{className:"punctuation",begin:"->"},c]}}const VM=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_-]*/}}),qM=["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"],YM=["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"],WM=[...qM,...YM],XM=["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(),ZM=["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(),JM=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),QM=["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 eR(e){const t=VM(e),r=JM,a=ZM,o="@[a-z-]+",c="and or not only",f={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+WM.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+a.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+r.join("|")+")"},f,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+QM.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,f,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:o,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:c,attribute:XM.join(" ")},contains:[{begin:o,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},f,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function tR(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function nR(e){const t=e.regex,r=e.COMMENT("--","$"),a={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},o={begin:/"/,end:/"/,contains:[{match:/""/}]},c=["true","false","unknown"],u=["double precision","large object","with timezone","without timezone"],f=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],h=["add","asc","collation","desc","final","first","last","view"],m=["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,S=[...m,...h].filter(L=>!b.includes(L)),_={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},N={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},T={match:t.concat(/\b/,t.either(...x),/\s*\(/),relevance:0,keywords:{built_in:x}};function O(L){return t.concat(/\b/,t.either(...L.map(w=>w.replace(/\s+/,"\\s+"))),/\b/)}const R={scope:"keyword",match:O(v),relevance:0};function M(L,{exceptions:w,when:D}={}){const F=D;return w=w||[],L.map(J=>J.match(/\|\d+$/)||w.includes(J)?J:F(J)?`${J}|0`:J)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:M(S,{when:L=>L.length<3}),literal:c,type:f,built_in:y},contains:[{scope:"type",match:O(u)},R,T,_,a,o,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,r,N]}}function mE(e){return e?typeof e=="string"?e:e.source:null}function Yo(e){return kt("(?=",e,")")}function kt(...e){return e.map(r=>mE(r)).join("")}function rR(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function xn(...e){return"("+(rR(e).capture?"":"?:")+e.map(a=>mE(a)).join("|")+")"}const Zp=e=>kt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),iR=["Protocol","Type"].map(Zp),Ox=["init","self"].map(Zp),aR=["Any","Self"],wh=["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"],Mx=["false","nil","true"],sR=["assignment","associativity","higherThan","left","lowerThan","none","right"],oR=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Rx=["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"],gE=xn(/[/=\-+!*%<>&|^~?]/,/[\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]/),bE=xn(gE,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),kh=kt(gE,bE,"*"),yE=xn(/[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]/),Nu=xn(yE,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),kr=kt(yE,Nu,"*"),su=kt(/[A-Z]/,Nu,"*"),lR=["attached","autoclosure",kt(/convention\(/,xn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",kt(/objc\(/,kr,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],cR=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function uR(e){const t={match:/\s+/,relevance:0},r=e.COMMENT("/\\*","\\*/",{contains:["self"]}),a=[e.C_LINE_COMMENT_MODE,r],o={match:[/\./,xn(...iR,...Ox)],className:{2:"keyword"}},c={match:kt(/\./,xn(...wh)),relevance:0},u=wh.filter(Pe=>typeof Pe=="string").concat(["_|0"]),f=wh.filter(Pe=>typeof Pe!="string").concat(aR).map(Zp),h={variants:[{className:"keyword",match:xn(...f,...Ox)}]},m={$pattern:xn(/\b\w+/,/#\w+/),keyword:u.concat(oR),literal:Mx},b=[o,c,h],y={match:kt(/\./,xn(...Rx)),relevance:0},v={className:"built_in",match:kt(/\b/,xn(...Rx),/(?=\()/)},x=[y,v],S={match:/->/,relevance:0},_={className:"operator",relevance:0,variants:[{match:kh},{match:`\\.(\\.|${bE})+`}]},N=[S,_],T="([0-9]_*)+",O="([0-9a-fA-F]_*)+",R={className:"number",relevance:0,variants:[{match:`\\b(${T})(\\.(${T}))?([eE][+-]?(${T}))?\\b`},{match:`\\b0x(${O})(\\.(${O}))?([pP][+-]?(${T}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},M=(Pe="")=>({className:"subst",variants:[{match:kt(/\\/,Pe,/[0\\tnr"']/)},{match:kt(/\\/,Pe,/u\{[0-9a-fA-F]{1,8}\}/)}]}),L=(Pe="")=>({className:"subst",match:kt(/\\/,Pe,/[\t ]*(?:[\r\n]|\r\n)/)}),w=(Pe="")=>({className:"subst",label:"interpol",begin:kt(/\\/,Pe,/\(/),end:/\)/}),D=(Pe="")=>({begin:kt(Pe,/"""/),end:kt(/"""/,Pe),contains:[M(Pe),L(Pe),w(Pe)]}),F=(Pe="")=>({begin:kt(Pe,/"/),end:kt(/"/,Pe),contains:[M(Pe),w(Pe)]}),J={className:"string",variants:[D(),D("#"),D("##"),D("###"),F(),F("#"),F("##"),F("###")]},P=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],$={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:P},Y=Pe=>{const Me=kt(Pe,/\//),pt=kt(/\//,Pe);return{begin:Me,end:pt,contains:[...P,{scope:"comment",begin:`#(?!.*${pt})`,end:/$/}]}},te={scope:"regexp",variants:[Y("###"),Y("##"),Y("#"),$]},se={match:kt(/`/,kr,/`/)},V={className:"variable",match:/\$\d+/},z={className:"variable",match:`\\$${Nu}+`},re=[se,V,z],oe={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:cR,contains:[...N,R,J]}]}},ye={scope:"keyword",match:kt(/@/,xn(...lR),Yo(xn(/\(/,/\s+/)))},I={scope:"meta",match:kt(/@/,kr)},j=[oe,ye,I],Q={match:Yo(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:kt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Nu,"+")},{className:"type",match:su,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:kt(/\s+&\s+/,Yo(su)),relevance:0}]},A={begin:/</,end:/>/,keywords:m,contains:[...a,...b,...j,S,Q]};Q.contains.push(A);const be={match:kt(kr,/\s*:/),keywords:"_|0",relevance:0},Ne={begin:/\(/,end:/\)/,relevance:0,keywords:m,contains:["self",be,...a,te,...b,...x,...N,R,J,...re,...j,Q]},we={begin:/</,end:/>/,keywords:"repeat each",contains:[...a,Q]},Fe={begin:xn(Yo(kt(kr,/\s*:/)),Yo(kt(kr,/\s+/,kr,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:kr}]},G={begin:/\(/,end:/\)/,keywords:m,contains:[Fe,...a,...b,...N,R,J,...j,Q,Ne],endsParent:!0,illegal:/["']/},ie={match:[/(func|macro)/,/\s+/,xn(se.match,kr,kh)],className:{1:"keyword",3:"title.function"},contains:[we,G,t],illegal:[/\[/,/%/]},ve={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[we,G,t],illegal:/\[|%/},Ke={match:[/operator/,/\s+/,kh],className:{1:"keyword",3:"title"}},pe={begin:[/precedencegroup/,/\s+/,su],className:{1:"keyword",3:"title"},contains:[Q],keywords:[...sR,...Mx],end:/}/},Ze={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},ct={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Ye={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,kr,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:m,contains:[we,...b,{begin:/:/,end:/\{/,keywords:m,contains:[{scope:"title.class.inherited",match:su},...b],relevance:0}]};for(const Pe of J.variants){const Me=Pe.contains.find(ft=>ft.label==="interpol");Me.keywords=m;const pt=[...b,...x,...N,R,J,...re];Me.contains=[...pt,{begin:/\(/,end:/\)/,contains:["self",...pt]}]}return{name:"Swift",keywords:m,contains:[...a,ie,ve,Ze,ct,Ye,Ke,pe,{beginKeywords:"import",end:/$/,contains:[...a],relevance:0},te,...b,...x,...N,R,J,...re,...j,Q,Ne]}}const Cu="[A-Za-z$_][0-9A-Za-z$_]*",vE=["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"],xE=["true","false","null","undefined","NaN","Infinity"],EE=["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"],SE=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],_E=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],wE=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],kE=[].concat(_E,EE,SE);function dR(e){const t=e.regex,r=(oe,{after:ye})=>{const I="</"+oe[0].slice(1);return oe.input.indexOf(I,ye)!==-1},a=Cu,o={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,u={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(oe,ye)=>{const I=oe[0].length+oe.index,j=oe.input[I];if(j==="<"||j===","){ye.ignoreMatch();return}j===">"&&(r(oe,{after:I})||ye.ignoreMatch());let Q;const A=oe.input.substring(I);if(Q=A.match(/^\s*=/)){ye.ignoreMatch();return}if((Q=A.match(/^\s+extends\s+/))&&Q.index===0){ye.ignoreMatch();return}}},f={$pattern:Cu,keyword:vE,literal:xE,built_in:kE,"variable.language":wE},h="[0-9](_?[0-9])*",m=`\\.(${h})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",y={className:"number",variants:[{begin:`(\\b(${b})((${m})|\\.)?|(${m}))[eE][+-]?(${h})\\b`},{begin:`\\b(${b})\\b((${m})\\b|\\.)?|(${m})\\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:f,contains:[]},x={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"xml"}},S={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"css"}},_={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"graphql"}},N={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,v]},O={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]},R=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,S,_,N,{match:/\$\d+/},y];v.contains=R.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(R)});const M=[].concat(O,v.contains),L=M.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat(M)}]),w={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:L},D={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"}}]},F={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:{_:[...EE,...SE]}},J={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},P={variants:[{match:[/function/,/\s+/,a,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},$={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Y(oe){return t.concat("(?!",oe.join("|"),")")}const te={match:t.concat(/\b/,Y([..._E,"super","import"].map(oe=>`${oe}\\s*\\(`)),a,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},se={begin:t.concat(/\./,t.lookahead(t.concat(a,/(?![0-9A-Za-z$_(])/))),end:a,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},V={match:[/get|set/,/\s+/,a,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",re={match:[/const|var|let/,/\s+/,a,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:L,CLASS_REFERENCE:F},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),J,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,S,_,N,O,{match:/\$\d+/},y,F,{scope:"attr",match:a+t.lookahead(":"),relevance:0},re,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[O,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:f,contains:L}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.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"]}]}]},P,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,e.inherit(e.TITLE_MODE,{begin:a,className:"title.function"})]},{match:/\.\.\./,relevance:0},se,{match:"\\$"+a,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},te,$,D,V,{match:/\$[(.]/}]}}function fR(e){const t=e.regex,r=dR(e),a=Cu,o=["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:o},contains:[r.exports.CLASS_REFERENCE]},f={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},h=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],m={$pattern:Cu,keyword:vE.concat(h),literal:xE,built_in:kE.concat(o),"variable.language":wE},b={className:"meta",begin:"@"+a},y=(_,N,T)=>{const O=_.contains.findIndex(R=>R.label===N);if(O===-1)throw new Error("can not find mode to replace");_.contains.splice(O,1,T)};Object.assign(r.keywords,m),r.exports.PARAMS_CONTAINS.push(b);const v=r.contains.find(_=>_.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",f);const S=r.contains.find(_=>_.label==="func.def");return S.relevance=0,Object.assign(r,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),r}function hR(e){const t=e.regex,r={className:"string",begin:/"(""|[^/n])"C\b/},a={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},o=/\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)/,f=/\d{1,2}(:\d{1,2}){1,2}/,h={className:"literal",variants:[{begin:t.concat(/# */,t.either(c,o),/ *#/)},{begin:t.concat(/# */,f,/ *#/)},{begin:t.concat(/# */,u,/ *#/)},{begin:t.concat(/# */,t.either(c,o),/ +/,t.either(u,f),/ *#/)}]},m={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,m,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 pR(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"],o={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},c={className:"variable",begin:/\$[\w_]+/},u={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},f={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},h={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},m={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,o,e.QUOTE_STRING_MODE,h,m,f]}}function mR(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,o={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:/\)/}),f=e.inherit(e.APOS_STRING_MODE,{className:"string"}),h=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),m={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:[o]},{begin:/'/,end:/'/,contains:[o]},{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,f,u,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[c,u,h,f]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},o,{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:[m],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[m],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:m}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(r,/>/))),contains:[{className:"name",begin:r,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function gR(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]|$)/}]},o={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,o]},f=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},S={begin:/\{/,end:/\}/,contains:[x],illegal:"\\n",relevance:0},_={begin:"\\[",end:"\\]",contains:[x],illegal:"\\n",relevance:0},N=[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},S,_,c,u],T=[...N];return T.pop(),T.push(f),x.contains=T,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:N}}const bR={arduino:JO,bash:QO,c:eM,cpp:tM,csharp:nM,css:dM,diff:fM,go:hM,graphql:pM,ini:mM,java:gM,javascript:EM,json:SM,kotlin:wM,less:RM,lua:IM,makefile:LM,markdown:DM,objectivec:jM,perl:zM,php:BM,"php-template":UM,plaintext:PM,python:HM,"python-repl":FM,r:$M,ruby:GM,rust:KM,scss:eR,shell:tR,sql:nR,swift:uR,typescript:fR,vbnet:hR,wasm:pR,xml:mR,yaml:gR};var Th,Ix;function yR(){if(Ix)return Th;Ix=1;function e(U){return U instanceof Map?U.clear=U.delete=U.set=function(){throw new Error("map is read-only")}:U instanceof Set&&(U.add=U.clear=U.delete=function(){throw new Error("set is read-only")}),Object.freeze(U),Object.getOwnPropertyNames(U).forEach(ce=>{const Ee=U[ce],He=typeof Ee;(He==="object"||He==="function")&&!Object.isFrozen(Ee)&&e(Ee)}),U}class t{constructor(ce){ce.data===void 0&&(ce.data={}),this.data=ce.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r(U){return U.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function a(U,...ce){const Ee=Object.create(null);for(const He in U)Ee[He]=U[He];return ce.forEach(function(He){for(const It in He)Ee[It]=He[It]}),Ee}const o="</span>",c=U=>!!U.scope,u=(U,{prefix:ce})=>{if(U.startsWith("language:"))return U.replace("language:","language-");if(U.includes(".")){const Ee=U.split(".");return[`${ce}${Ee.shift()}`,...Ee.map((He,It)=>`${He}${"_".repeat(It+1)}`)].join(" ")}return`${ce}${U}`};class f{constructor(ce,Ee){this.buffer="",this.classPrefix=Ee.classPrefix,ce.walk(this)}addText(ce){this.buffer+=r(ce)}openNode(ce){if(!c(ce))return;const Ee=u(ce.scope,{prefix:this.classPrefix});this.span(Ee)}closeNode(ce){c(ce)&&(this.buffer+=o)}value(){return this.buffer}span(ce){this.buffer+=`<span class="${ce}">`}}const h=(U={})=>{const ce={children:[]};return Object.assign(ce,U),ce};class m{constructor(){this.rootNode=h(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(ce){this.top.children.push(ce)}openNode(ce){const Ee=h({scope:ce});this.add(Ee),this.stack.push(Ee)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(ce){return this.constructor._walk(ce,this.rootNode)}static _walk(ce,Ee){return typeof Ee=="string"?ce.addText(Ee):Ee.children&&(ce.openNode(Ee),Ee.children.forEach(He=>this._walk(ce,He)),ce.closeNode(Ee)),ce}static _collapse(ce){typeof ce!="string"&&ce.children&&(ce.children.every(Ee=>typeof Ee=="string")?ce.children=[ce.children.join("")]:ce.children.forEach(Ee=>{m._collapse(Ee)}))}}class b extends m{constructor(ce){super(),this.options=ce}addText(ce){ce!==""&&this.add(ce)}startScope(ce){this.openNode(ce)}endScope(){this.closeNode()}__addSublanguage(ce,Ee){const He=ce.root;Ee&&(He.scope=`language:${Ee}`),this.add(He)}toHTML(){return new f(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function y(U){return U?typeof U=="string"?U:U.source:null}function v(U){return _("(?=",U,")")}function x(U){return _("(?:",U,")*")}function S(U){return _("(?:",U,")?")}function _(...U){return U.map(Ee=>y(Ee)).join("")}function N(U){const ce=U[U.length-1];return typeof ce=="object"&&ce.constructor===Object?(U.splice(U.length-1,1),ce):{}}function T(...U){return"("+(N(U).capture?"":"?:")+U.map(He=>y(He)).join("|")+")"}function O(U){return new RegExp(U.toString()+"|").exec("").length-1}function R(U,ce){const Ee=U&&U.exec(ce);return Ee&&Ee.index===0}const M=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function L(U,{joinWith:ce}){let Ee=0;return U.map(He=>{Ee+=1;const It=Ee;let Nt=y(He),Te="";for(;Nt.length>0;){const _e=M.exec(Nt);if(!_e){Te+=Nt;break}Te+=Nt.substring(0,_e.index),Nt=Nt.substring(_e.index+_e[0].length),_e[0][0]==="\\"&&_e[1]?Te+="\\"+String(Number(_e[1])+It):(Te+=_e[0],_e[0]==="("&&Ee++)}return Te}).map(He=>`(${He})`).join(ce)}const w=/\b\B/,D="[a-zA-Z]\\w*",F="[a-zA-Z_]\\w*",J="\\b\\d+(\\.\\d+)?",P="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",$="\\b(0b[01]+)",Y="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",te=(U={})=>{const ce=/^#![ ]*\//;return U.binary&&(U.begin=_(ce,/.*\b/,U.binary,/\b.*/)),a({scope:"meta",begin:ce,end:/$/,relevance:0,"on:begin":(Ee,He)=>{Ee.index!==0&&He.ignoreMatch()}},U)},se={begin:"\\\\[\\s\\S]",relevance:0},V={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[se]},z={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[se]},re={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/},oe=function(U,ce,Ee={}){const He=a({scope:"comment",begin:U,end:ce,contains:[]},Ee);He.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 It=T("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 He.contains.push({begin:_(/[ ]+/,"(",It,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),He},ye=oe("//","$"),I=oe("/\\*","\\*/"),j=oe("#","$"),Q={scope:"number",begin:J,relevance:0},A={scope:"number",begin:P,relevance:0},be={scope:"number",begin:$,relevance:0},Ne={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[se,{begin:/\[/,end:/\]/,relevance:0,contains:[se]}]},we={scope:"title",begin:D,relevance:0},Fe={scope:"title",begin:F,relevance:0},G={begin:"\\.\\s*"+F,relevance:0};var ve=Object.freeze({__proto__:null,APOS_STRING_MODE:V,BACKSLASH_ESCAPE:se,BINARY_NUMBER_MODE:be,BINARY_NUMBER_RE:$,COMMENT:oe,C_BLOCK_COMMENT_MODE:I,C_LINE_COMMENT_MODE:ye,C_NUMBER_MODE:A,C_NUMBER_RE:P,END_SAME_AS_BEGIN:function(U){return Object.assign(U,{"on:begin":(ce,Ee)=>{Ee.data._beginMatch=ce[1]},"on:end":(ce,Ee)=>{Ee.data._beginMatch!==ce[1]&&Ee.ignoreMatch()}})},HASH_COMMENT_MODE:j,IDENT_RE:D,MATCH_NOTHING_RE:w,METHOD_GUARD:G,NUMBER_MODE:Q,NUMBER_RE:J,PHRASAL_WORDS_MODE:re,QUOTE_STRING_MODE:z,REGEXP_MODE:Ne,RE_STARTERS_RE:Y,SHEBANG:te,TITLE_MODE:we,UNDERSCORE_IDENT_RE:F,UNDERSCORE_TITLE_MODE:Fe});function Ke(U,ce){U.input[U.index-1]==="."&&ce.ignoreMatch()}function pe(U,ce){U.className!==void 0&&(U.scope=U.className,delete U.className)}function Ze(U,ce){ce&&U.beginKeywords&&(U.begin="\\b("+U.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",U.__beforeBegin=Ke,U.keywords=U.keywords||U.beginKeywords,delete U.beginKeywords,U.relevance===void 0&&(U.relevance=0))}function ct(U,ce){Array.isArray(U.illegal)&&(U.illegal=T(...U.illegal))}function Ye(U,ce){if(U.match){if(U.begin||U.end)throw new Error("begin & end are not supported with match");U.begin=U.match,delete U.match}}function Pe(U,ce){U.relevance===void 0&&(U.relevance=1)}const Me=(U,ce)=>{if(!U.beforeMatch)return;if(U.starts)throw new Error("beforeMatch cannot be used with starts");const Ee=Object.assign({},U);Object.keys(U).forEach(He=>{delete U[He]}),U.keywords=Ee.keywords,U.begin=_(Ee.beforeMatch,v(Ee.begin)),U.starts={relevance:0,contains:[Object.assign(Ee,{endsParent:!0})]},U.relevance=0,delete Ee.beforeMatch},pt=["of","and","for","in","not","or","if","then","parent","list","value"],ft="keyword";function Et(U,ce,Ee=ft){const He=Object.create(null);return typeof U=="string"?It(Ee,U.split(" ")):Array.isArray(U)?It(Ee,U):Object.keys(U).forEach(function(Nt){Object.assign(He,Et(U[Nt],ce,Nt))}),He;function It(Nt,Te){ce&&(Te=Te.map(_e=>_e.toLowerCase())),Te.forEach(function(_e){const Be=_e.split("|");He[Be[0]]=[Nt,yr(Be[0],Be[1])]})}}function yr(U,ce){return ce?Number(ce):di(U)?0:1}function di(U){return pt.includes(U.toLowerCase())}const le={},he=U=>{console.error(U)},Ie=(U,...ce)=>{console.log(`WARN: ${U}`,...ce)},q=(U,ce)=>{le[`${U}/${ce}`]||(console.log(`Deprecated as of ${U}. ${ce}`),le[`${U}/${ce}`]=!0)},de=new Error;function Se(U,ce,{key:Ee}){let He=0;const It=U[Ee],Nt={},Te={};for(let _e=1;_e<=ce.length;_e++)Te[_e+He]=It[_e],Nt[_e+He]=!0,He+=O(ce[_e-1]);U[Ee]=Te,U[Ee]._emit=Nt,U[Ee]._multi=!0}function ze(U){if(Array.isArray(U.begin)){if(U.skip||U.excludeBegin||U.returnBegin)throw he("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),de;if(typeof U.beginScope!="object"||U.beginScope===null)throw he("beginScope must be object"),de;Se(U,U.begin,{key:"beginScope"}),U.begin=L(U.begin,{joinWith:""})}}function rt(U){if(Array.isArray(U.end)){if(U.skip||U.excludeEnd||U.returnEnd)throw he("skip, excludeEnd, returnEnd not compatible with endScope: {}"),de;if(typeof U.endScope!="object"||U.endScope===null)throw he("endScope must be object"),de;Se(U,U.end,{key:"endScope"}),U.end=L(U.end,{joinWith:""})}}function Tt(U){U.scope&&typeof U.scope=="object"&&U.scope!==null&&(U.beginScope=U.scope,delete U.scope)}function Tn(U){Tt(U),typeof U.beginScope=="string"&&(U.beginScope={_wrap:U.beginScope}),typeof U.endScope=="string"&&(U.endScope={_wrap:U.endScope}),ze(U),rt(U)}function en(U){function ce(Te,_e){return new RegExp(y(Te),"m"+(U.case_insensitive?"i":"")+(U.unicodeRegex?"u":"")+(_e?"g":""))}class Ee{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(_e,Be){Be.position=this.position++,this.matchIndexes[this.matchAt]=Be,this.regexes.push([Be,_e]),this.matchAt+=O(_e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const _e=this.regexes.map(Be=>Be[1]);this.matcherRe=ce(L(_e,{joinWith:"|"}),!0),this.lastIndex=0}exec(_e){this.matcherRe.lastIndex=this.lastIndex;const Be=this.matcherRe.exec(_e);if(!Be)return null;const Ft=Be.findIndex((Lr,La)=>La>0&&Lr!==void 0),jt=this.matchIndexes[Ft];return Be.splice(0,Ft),Object.assign(Be,jt)}}class He{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(_e){if(this.multiRegexes[_e])return this.multiRegexes[_e];const Be=new Ee;return this.rules.slice(_e).forEach(([Ft,jt])=>Be.addRule(Ft,jt)),Be.compile(),this.multiRegexes[_e]=Be,Be}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(_e,Be){this.rules.push([_e,Be]),Be.type==="begin"&&this.count++}exec(_e){const Be=this.getMatcher(this.regexIndex);Be.lastIndex=this.lastIndex;let Ft=Be.exec(_e);if(this.resumingScanAtSamePosition()&&!(Ft&&Ft.index===this.lastIndex)){const jt=this.getMatcher(0);jt.lastIndex=this.lastIndex+1,Ft=jt.exec(_e)}return Ft&&(this.regexIndex+=Ft.position+1,this.regexIndex===this.count&&this.considerAll()),Ft}}function It(Te){const _e=new He;return Te.contains.forEach(Be=>_e.addRule(Be.begin,{rule:Be,type:"begin"})),Te.terminatorEnd&&_e.addRule(Te.terminatorEnd,{type:"end"}),Te.illegal&&_e.addRule(Te.illegal,{type:"illegal"}),_e}function Nt(Te,_e){const Be=Te;if(Te.isCompiled)return Be;[pe,Ye,Tn,Me].forEach(jt=>jt(Te,_e)),U.compilerExtensions.forEach(jt=>jt(Te,_e)),Te.__beforeBegin=null,[Ze,ct,Pe].forEach(jt=>jt(Te,_e)),Te.isCompiled=!0;let Ft=null;return typeof Te.keywords=="object"&&Te.keywords.$pattern&&(Te.keywords=Object.assign({},Te.keywords),Ft=Te.keywords.$pattern,delete Te.keywords.$pattern),Ft=Ft||/\w+/,Te.keywords&&(Te.keywords=Et(Te.keywords,U.case_insensitive)),Be.keywordPatternRe=ce(Ft,!0),_e&&(Te.begin||(Te.begin=/\B|\b/),Be.beginRe=ce(Be.begin),!Te.end&&!Te.endsWithParent&&(Te.end=/\B|\b/),Te.end&&(Be.endRe=ce(Be.end)),Be.terminatorEnd=y(Be.end)||"",Te.endsWithParent&&_e.terminatorEnd&&(Be.terminatorEnd+=(Te.end?"|":"")+_e.terminatorEnd)),Te.illegal&&(Be.illegalRe=ce(Te.illegal)),Te.contains||(Te.contains=[]),Te.contains=[].concat(...Te.contains.map(function(jt){return dn(jt==="self"?Te:jt)})),Te.contains.forEach(function(jt){Nt(jt,Be)}),Te.starts&&Nt(Te.starts,_e),Be.matcher=It(Be),Be}if(U.compilerExtensions||(U.compilerExtensions=[]),U.contains&&U.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return U.classNameAliases=a(U.classNameAliases||{}),Nt(U)}function Ut(U){return U?U.endsWithParent||Ut(U.starts):!1}function dn(U){return U.variants&&!U.cachedVariants&&(U.cachedVariants=U.variants.map(function(ce){return a(U,{variants:null},ce)})),U.cachedVariants?U.cachedVariants:Ut(U)?a(U,{starts:U.starts?a(U.starts):null}):Object.isFrozen(U)?a(U):U}var mt="11.11.1";class vr extends Error{constructor(ce,Ee){super(ce),this.name="HTMLInjectionError",this.html=Ee}}const bn=r,Rl=a,Xi=Symbol("nomatch"),Ia=7,Zi=function(U){const ce=Object.create(null),Ee=Object.create(null),He=[];let It=!0;const Nt="Could not find the language '{}', did you forget to load/include a language module?",Te={disableAutodetect:!0,name:"Plain text",contains:[]};let _e={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:b};function Be(me){return _e.noHighlightRe.test(me)}function Ft(me){let Oe=me.className+" ";Oe+=me.parentNode?me.parentNode.className:"";const Je=_e.languageDetectRe.exec(Oe);if(Je){const gt=yn(Je[1]);return gt||(Ie(Nt.replace("{}",Je[1])),Ie("Falling back to no-highlight mode for this block.",me)),gt?Je[1]:"no-highlight"}return Oe.split(/\s+/).find(gt=>Be(gt)||yn(gt))}function jt(me,Oe,Je){let gt="",Gt="";typeof Oe=="object"?(gt=me,Je=Oe.ignoreIllegals,Gt=Oe.language):(q("10.7.0","highlight(lang, code, ...args) has been deprecated."),q("10.7.0",`Please use highlight(code, options) instead.
|
|
82
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),Gt=me,gt=Oe),Je===void 0&&(Je=!0);const hn={code:gt,language:Gt};Qi("before:highlight",hn);const Un=hn.result?hn.result:Lr(hn.language,hn.code,Je);return Un.code=hn.code,Qi("after:highlight",Un),Un}function Lr(me,Oe,Je,gt){const Gt=Object.create(null);function hn(xe,Ce){return xe.keywords[Ce]}function Un(){if(!je.keywords){Yt.addText(bt);return}let xe=0;je.keywordPatternRe.lastIndex=0;let Ce=je.keywordPatternRe.exec(bt),Ve="";for(;Ce;){Ve+=bt.substring(xe,Ce.index);const it=rn.case_insensitive?Ce[0].toLowerCase():Ce[0],Bt=hn(je,it);if(Bt){const[Jn,Js]=Bt;if(Yt.addText(Ve),Ve="",Gt[it]=(Gt[it]||0)+1,Gt[it]<=Ia&&(mi+=Js),Jn.startsWith("_"))Ve+=Ce[0];else{const Ul=rn.classNameAliases[Jn]||Jn;Pn(Ce[0],Ul)}}else Ve+=Ce[0];xe=je.keywordPatternRe.lastIndex,Ce=je.keywordPatternRe.exec(bt)}Ve+=bt.substring(xe),Yt.addText(Ve)}function Cn(){if(bt==="")return;let xe=null;if(typeof je.subLanguage=="string"){if(!ce[je.subLanguage]){Yt.addText(bt);return}xe=Lr(je.subLanguage,bt,!0,Bl[je.subLanguage]),Bl[je.subLanguage]=xe._top}else xe=Da(bt,je.subLanguage.length?je.subLanguage:null);je.relevance>0&&(mi+=xe.relevance),Yt.__addSublanguage(xe._emitter,xe.language)}function Mt(){je.subLanguage!=null?Cn():Un(),bt=""}function Pn(xe,Ce){xe!==""&&(Yt.startScope(Ce),Yt.addText(xe),Yt.endScope())}function jl(xe,Ce){let Ve=1;const it=Ce.length-1;for(;Ve<=it;){if(!xe._emit[Ve]){Ve++;continue}const Bt=rn.classNameAliases[xe[Ve]]||xe[Ve],Jn=Ce[Ve];Bt?Pn(Jn,Bt):(bt=Jn,Un(),bt=""),Ve++}}function za(xe,Ce){return xe.scope&&typeof xe.scope=="string"&&Yt.openNode(rn.classNameAliases[xe.scope]||xe.scope),xe.beginScope&&(xe.beginScope._wrap?(Pn(bt,rn.classNameAliases[xe.beginScope._wrap]||xe.beginScope._wrap),bt=""):xe.beginScope._multi&&(jl(xe.beginScope,Ce),bt="")),je=Object.create(xe,{parent:{value:je}}),je}function Ws(xe,Ce,Ve){let it=R(xe.endRe,Ve);if(it){if(xe["on:end"]){const Bt=new t(xe);xe["on:end"](Ce,Bt),Bt.isMatchIgnored&&(it=!1)}if(it){for(;xe.endsParent&&xe.parent;)xe=xe.parent;return xe}}if(xe.endsWithParent)return Ws(xe.parent,Ce,Ve)}function Ba(xe){return je.matcher.regexIndex===0?(bt+=xe[0],1):(gi=!0,0)}function Yu(xe){const Ce=xe[0],Ve=xe.rule,it=new t(Ve),Bt=[Ve.__beforeBegin,Ve["on:begin"]];for(const Jn of Bt)if(Jn&&(Jn(xe,it),it.isMatchIgnored))return Ba(Ce);return Ve.skip?bt+=Ce:(Ve.excludeBegin&&(bt+=Ce),Mt(),!Ve.returnBegin&&!Ve.excludeBegin&&(bt=Ce)),za(Ve,xe),Ve.returnBegin?0:Ce.length}function An(xe){const Ce=xe[0],Ve=Oe.substring(xe.index),it=Ws(je,xe,Ve);if(!it)return Xi;const Bt=je;je.endScope&&je.endScope._wrap?(Mt(),Pn(Ce,je.endScope._wrap)):je.endScope&&je.endScope._multi?(Mt(),jl(je.endScope,xe)):Bt.skip?bt+=Ce:(Bt.returnEnd||Bt.excludeEnd||(bt+=Ce),Mt(),Bt.excludeEnd&&(bt=Ce));do je.scope&&Yt.closeNode(),!je.skip&&!je.subLanguage&&(mi+=je.relevance),je=je.parent;while(je!==it.parent);return it.starts&&za(it.starts,xe),Bt.returnEnd?0:Ce.length}function Xs(){const xe=[];for(let Ce=je;Ce!==rn;Ce=Ce.parent)Ce.scope&&xe.unshift(Ce.scope);xe.forEach(Ce=>Yt.openNode(Ce))}let ea={};function Ua(xe,Ce){const Ve=Ce&&Ce[0];if(bt+=xe,Ve==null)return Mt(),0;if(ea.type==="begin"&&Ce.type==="end"&&ea.index===Ce.index&&Ve===""){if(bt+=Oe.slice(Ce.index,Ce.index+1),!It){const it=new Error(`0 width match regex (${me})`);throw it.languageName=me,it.badRule=ea.rule,it}return 1}if(ea=Ce,Ce.type==="begin")return Yu(Ce);if(Ce.type==="illegal"&&!Je){const it=new Error('Illegal lexeme "'+Ve+'" for mode "'+(je.scope||"<unnamed>")+'"');throw it.mode=je,it}else if(Ce.type==="end"){const it=An(Ce);if(it!==Xi)return it}if(Ce.type==="illegal"&&Ve==="")return bt+=`
|
|
83
|
-
`,1;if(Zs>1e5&&Zs>Ce.index*3)throw new Error("potential infinite loop, way more iterations than matches");return bt+=Ve,Ve.length}const rn=yn(me);if(!rn)throw he(Nt.replace("{}",me)),new Error('Unknown language: "'+me+'"');const zl=en(rn);let Pa="",je=gt||zl;const Bl={},Yt=new _e.__emitter(_e);Xs();let bt="",mi=0,zr=0,Zs=0,gi=!1;try{if(rn.__emitTokens)rn.__emitTokens(Oe,Yt);else{for(je.matcher.considerAll();;){Zs++,gi?gi=!1:je.matcher.considerAll(),je.matcher.lastIndex=zr;const xe=je.matcher.exec(Oe);if(!xe)break;const Ce=Oe.substring(zr,xe.index),Ve=Ua(Ce,xe);zr=xe.index+Ve}Ua(Oe.substring(zr))}return Yt.finalize(),Pa=Yt.toHTML(),{language:me,value:Pa,relevance:mi,illegal:!1,_emitter:Yt,_top:je}}catch(xe){if(xe.message&&xe.message.includes("Illegal"))return{language:me,value:bn(Oe),illegal:!0,relevance:0,_illegalBy:{message:xe.message,index:zr,context:Oe.slice(zr-100,zr+100),mode:xe.mode,resultSoFar:Pa},_emitter:Yt};if(It)return{language:me,value:bn(Oe),illegal:!1,relevance:0,errorRaised:xe,_emitter:Yt,_top:je};throw xe}}function La(me){const Oe={value:bn(me),illegal:!1,relevance:0,_top:Te,_emitter:new _e.__emitter(_e)};return Oe._emitter.addText(me),Oe}function Da(me,Oe){Oe=Oe||_e.languages||Object.keys(ce);const Je=La(me),gt=Oe.filter(yn).filter(hi).map(Mt=>Lr(Mt,me,!1));gt.unshift(Je);const Gt=gt.sort((Mt,Pn)=>{if(Mt.relevance!==Pn.relevance)return Pn.relevance-Mt.relevance;if(Mt.language&&Pn.language){if(yn(Mt.language).supersetOf===Pn.language)return 1;if(yn(Pn.language).supersetOf===Mt.language)return-1}return 0}),[hn,Un]=Gt,Cn=hn;return Cn.secondBest=Un,Cn}function xr(me,Oe,Je){const gt=Oe&&Ee[Oe]||Je;me.classList.add("hljs"),me.classList.add(`language-${gt}`)}function $t(me){let Oe=null;const Je=Ft(me);if(Be(Je))return;if(Qi("before:highlightElement",{el:me,language:Je}),me.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",me);return}if(me.children.length>0&&(_e.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(me)),_e.throwUnescapedHTML))throw new vr("One of your code blocks includes unescaped HTML.",me.innerHTML);Oe=me;const gt=Oe.textContent,Gt=Je?jt(gt,{language:Je,ignoreIllegals:!0}):Da(gt);me.innerHTML=Gt.value,me.dataset.highlighted="yes",xr(me,Je,Gt.language),me.result={language:Gt.language,re:Gt.relevance,relevance:Gt.relevance},Gt.secondBest&&(me.secondBest={language:Gt.secondBest.language,relevance:Gt.secondBest.relevance}),Qi("after:highlightElement",{el:me,result:Gt,text:gt})}function fn(me){_e=Rl(_e,me)}const fi=()=>{ja(),q("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function qs(){ja(),q("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Il=!1;function ja(){function me(){ja()}if(document.readyState==="loading"){Il||window.addEventListener("DOMContentLoaded",me,!1),Il=!0;return}document.querySelectorAll(_e.cssSelector).forEach($t)}function Ll(me,Oe){let Je=null;try{Je=Oe(U)}catch(gt){if(he("Language definition for '{}' could not be registered.".replace("{}",me)),It)he(gt);else throw gt;Je=Te}Je.name||(Je.name=me),ce[me]=Je,Je.rawDefinition=Oe.bind(null,U),Je.aliases&&Dr(Je.aliases,{languageName:me})}function Ji(me){delete ce[me];for(const Oe of Object.keys(Ee))Ee[Oe]===me&&delete Ee[Oe]}function Ys(){return Object.keys(ce)}function yn(me){return me=(me||"").toLowerCase(),ce[me]||ce[Ee[me]]}function Dr(me,{languageName:Oe}){typeof me=="string"&&(me=[me]),me.forEach(Je=>{Ee[Je.toLowerCase()]=Oe})}function hi(me){const Oe=yn(me);return Oe&&!Oe.disableAutodetect}function pi(me){me["before:highlightBlock"]&&!me["before:highlightElement"]&&(me["before:highlightElement"]=Oe=>{me["before:highlightBlock"](Object.assign({block:Oe.el},Oe))}),me["after:highlightBlock"]&&!me["after:highlightElement"]&&(me["after:highlightElement"]=Oe=>{me["after:highlightBlock"](Object.assign({block:Oe.el},Oe))})}function qt(me){pi(me),He.push(me)}function Dl(me){const Oe=He.indexOf(me);Oe!==-1&&He.splice(Oe,1)}function Qi(me,Oe){const Je=me;He.forEach(function(gt){gt[Je]&>[Je](Oe)})}function jr(me){return q("10.7.0","highlightBlock will be removed entirely in v12.0"),q("10.7.0","Please use highlightElement now."),$t(me)}Object.assign(U,{highlight:jt,highlightAuto:Da,highlightAll:ja,highlightElement:$t,highlightBlock:jr,configure:fn,initHighlighting:fi,initHighlightingOnLoad:qs,registerLanguage:Ll,unregisterLanguage:Ji,listLanguages:Ys,getLanguage:yn,registerAliases:Dr,autoDetection:hi,inherit:Rl,addPlugin:qt,removePlugin:Dl}),U.debugMode=function(){It=!1},U.safeMode=function(){It=!0},U.versionString=mt,U.regex={concat:_,lookahead:v,either:T,optional:S,anyNumberOfTimes:x};for(const me in ve)typeof ve[me]=="object"&&e(ve[me]);return Object.assign(U,ve),U},Nn=Zi({});return Nn.newInstance=()=>Zi({}),Th=Nn,Nn.HighlightJS=Nn,Nn.default=Nn,Th}var vR=yR();const xR=El(vR),Lx={},ER="hljs-";function SR(e){const t=xR.newInstance();return e&&c(e),{highlight:r,highlightAuto:a,listLanguages:o,register:c,registerAlias:u,registered:f};function r(h,m,b){const y=b||Lx,v=typeof y.prefix=="string"?y.prefix:ER;if(!t.getLanguage(h))throw new Error("Unknown language: `"+h+"` is not registered");t.configure({__emitter:_R,classPrefix:v});const x=t.highlight(m,{ignoreIllegals:!0,language:h});if(x.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:x.errorRaised});const S=x._emitter.root,_=S.data;return _.language=x.language,_.relevance=x.relevance,S}function a(h,m){const y=(m||Lx).subset||o();let v=-1,x=0,S;for(;++v<y.length;){const _=y[v];if(!t.getLanguage(_))continue;const N=r(_,h,m);N.data&&N.data.relevance!==void 0&&N.data.relevance>x&&(x=N.data.relevance,S=N)}return S||{type:"root",children:[],data:{language:void 0,relevance:x}}}function o(){return t.listLanguages()}function c(h,m){if(typeof h=="string")t.registerLanguage(h,m);else{let b;for(b in h)Object.hasOwn(h,b)&&t.registerLanguage(b,h[b])}}function u(h,m){if(typeof h=="string")t.registerAliases(typeof m=="string"?m:[...m],{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 f(h){return!!t.getLanguage(h)}}class _R{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],o=t.root.children;r?a.children.push({type:"element",tagName:"span",properties:{className:[r]},children:o}):a.children.push(...o)}openNode(t){const r=this,a=t.split(".").map(function(u,f){return f?u+"_".repeat(f):r.options.classPrefix+u}),o=this.stack[this.stack.length-1],c={type:"element",tagName:"span",properties:{className:a},children:[]};o.children.push(c),this.stack.push(c)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const wR={};function kR(e){const t=e||wR,r=t.aliases,a=t.detect||!1,o=t.languages||bR,c=t.plainText,u=t.prefix,f=t.subset;let h="hljs";const m=SR(o);if(r&&m.registerAlias(r),u){const b=u.indexOf("-");h=b===-1?u:u.slice(0,b)}return function(b,y){Fu(b,"element",function(v,x,S){if(v.tagName!=="code"||!S||S.type!=="element"||S.tagName!=="pre")return;const _=TR(v);if(_===!1||!_&&!a||_&&c&&c.includes(_))return;Array.isArray(v.properties.className)||(v.properties.className=[]),v.properties.className.includes(h)||v.properties.className.unshift(h);const N=GO(v,{whitespace:"pre"});let T;try{T=_?m.highlight(_,N,{prefix:u}):m.highlightAuto(N,{prefix:u,subset:f})}catch(O){const R=O;if(_&&/Unknown language/.test(R.message)){y.message("Cannot highlight as `"+_+"`, it’s not registered",{ancestors:[S,v],cause:R,place:v.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw R}!_&&T.data&&T.data.language&&v.properties.className.push("language-"+T.data.language),T.children.length>0&&(v.children=T.children)})}}function TR(e){const t=e.properties.className;let r=-1;if(!Array.isArray(t))return;let a;for(;++r<t.length;){const o=String(t[r]);if(o==="no-highlight"||o==="nohighlight")return!1;!a&&o.slice(0,5)==="lang-"&&(a=o.slice(5)),!a&&o.slice(0,9)==="language-"&&(a=o.slice(9))}return a}function Es(e){return e?typeof e=="string"?e:"literalString"in e?e.literalString:"dataPath"in e?`{{${e.dataPath}}}`:"":""}function ou(e){return e?Array.isArray(e)?e:"explicitList"in e?e.explicitList:[]:[]}function NR({className:e,children:t}){const[r,a]=C.useState(!1),o=String(t).replace(/\n$/,""),c=(e==null?void 0:e.replace(/^language-/,""))??"",u=C.useCallback(()=>{navigator.clipboard.writeText(o).then(()=>{a(!0),setTimeout(()=>a(!1),2e3)})},[o]);return d.jsxs("div",{className:"group/code relative my-2 rounded-md overflow-hidden",style:{border:"1px solid var(--border)"},children:[d.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5",style:{background:"var(--bg-hover)",borderBottom:"1px solid var(--border)"},children:[d.jsx("span",{className:"text-tiny font-mono uppercase",style:{color:"var(--text-muted)"},children:c||"code"}),d.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?d.jsxs(d.Fragment,{children:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),"Copied"]}):d.jsxs(d.Fragment,{children:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.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"]})})]}),d.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:d.jsx("code",{className:e,style:{fontFamily:"var(--font-mono)"},children:t})})]})}function CR({children:e}){return d.jsx("div",{className:"my-2 overflow-x-auto rounded-md",style:{border:"1px solid var(--border)"},children:d.jsx("table",{className:"min-w-full text-[13px]",style:{borderCollapse:"collapse"},children:e})})}function AR({children:e}){return d.jsx("thead",{style:{background:"var(--bg-hover)"},children:e})}function OR({children:e,...t}){return d.jsx("tr",{...t,style:{borderBottom:"1px solid var(--border)"},className:"hover:bg-[--bg-hover] transition-colors",children:e})}function Dx({children:e,isHeader:t=!1,style:r}){const a=t?"th":"td";return d.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 MR({jsonl:e,onAction:t}){const r=C.useMemo(()=>RR(e),[e]);return r?d.jsx("div",{className:"mt-1",children:Qo(r.rootId,r.components,t)}):d.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:[d.jsx("span",{className:"font-bold text-tiny",style:{color:"var(--text-muted)"},children:"A2UI"}),d.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 RR(e){try{const t=e.trim().split(`
|
|
84
|
-
`).filter(Boolean),r=new Map;let a="";for(const o of t){const c=JSON.parse(o);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 Qo(e,t,r){const a=t.get(e);if(!a)return null;if("Text"in a){const{text:o,usageHint:c}=a.Text,u=Es(o),f=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 d.jsx("p",{className:`${h[f]??"text-body"} my-0.5`,style:{color:f.startsWith("h")?"var(--text-primary)":"var(--text-secondary)"},children:u},e)}if("Button"in a){const{label:o,action:c,style:u}=a.Button,f=Es(o),h=u==="primary"||u==="filled";return d.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:f},e)}if("Column"in a){const o=ou(a.Column.children),c=a.Column.gap??4;return d.jsx("div",{className:"flex flex-col",style:{gap:c},children:o.map(u=>Qo(u,t,r))},e)}if("Row"in a){const o=ou(a.Row.children),c=a.Row.gap??8;return d.jsx("div",{className:"flex flex-row flex-wrap items-center",style:{gap:c},children:o.map(u=>Qo(u,t,r))},e)}if("Card"in a){const o=ou(a.Card.children),c=a.Card.title?Es(a.Card.title):null;return d.jsxs("div",{className:"rounded-md p-3 my-1",style:{background:"var(--bg-hover)",border:"1px solid var(--border)"},children:[c&&d.jsx("p",{className:"text-h2 font-bold mb-2",style:{color:"var(--text-primary)"},children:c}),d.jsx("div",{className:"flex flex-col gap-1",children:o.map(u=>Qo(u,t,r))})]},e)}if("List"in a){const o=ou(a.List.children);return d.jsx("div",{className:"flex flex-col gap-0.5 my-1",children:o.map(c=>d.jsxs("div",{className:"flex items-start gap-2 px-2 py-1.5 rounded hover:bg-[--bg-hover] transition-colors",children:[d.jsx("span",{className:"text-tiny mt-1",style:{color:"var(--text-muted)"},children:"•"}),Qo(c,t,r)]},c))},e)}if("Image"in a){const o=Es(a.Image.url),c=a.Image.alt?Es(a.Image.alt):"";return d.jsx("img",{src:o,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 d.jsx("hr",{className:"my-2",style:{border:"none",borderTop:"1px solid var(--border)"}},e);if("Icon"in a){const o=Es(a.Icon.name);return d.jsxs("span",{className:"text-body",style:{color:"var(--text-secondary)"},children:["[",o,"]"]},e)}return null}function IR(e,t){return{pre({children:r,node:a}){var c,u,f,h;const o=(c=a==null?void 0:a.children)==null?void 0:c[0];if((o==null?void 0:o.tagName)==="code"){const m=(u=o.properties)!=null&&u.className?Array.isArray(o.properties.className)?o.properties.className.join(" "):String(o.properties.className):void 0;if(m!=null&&m.includes("language-action")){const b=String(((f=r==null?void 0:r.props)==null?void 0:f.children)??r).trim();try{const y=JSON.parse(b);if(y&&typeof y=="object"&&y.kind){const v=LR(y.prompt??b),x=t==null?void 0:t[v];return d.jsx(zR,{action:y,resolved:x,onResolve:e?(S,_)=>e(S,_):void 0})}}catch{}}return d.jsx(NR,{className:m,children:((h=r==null?void 0:r.props)==null?void 0:h.children)??r})}return d.jsx("pre",{children:r})},code({className:r,children:a,...o}){return d.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)"},...o,children:a})},table({children:r}){return d.jsx(CR,{children:r})},thead({children:r}){return d.jsx(AR,{children:r})},tr({children:r,...a}){return d.jsx(OR,{...a,children:r})},th({children:r,style:a}){return d.jsx(Dx,{isHeader:!0,style:a,children:r})},td({children:r,style:a}){return d.jsx(Dx,{style:a,children:r})},a({href:r,children:a,...o}){return d.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--text-link)"},className:"underline underline-offset-2 hover:opacity-80 transition-opacity",...o,children:a})},blockquote({children:r}){return d.jsx("blockquote",{className:"my-2 pl-3 py-0.5",style:{borderLeft:"3px solid var(--bg-active)",color:"var(--text-secondary)"},children:r})}}}function LR(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 DR(e,t){if(!e.includes("```action"))return e;const r=[];let a=e;const o=/```action\s*\n[\s\S]*?```/g;let c=0,u;for(;(u=o.exec(a))!==null;)u.index>c&&r.push(a.slice(c,u.index)),r.push(u[0]),c=u.index+u[0].length;const f=a.slice(c),h=f.indexOf("```action");return h!==-1&&t?r.push(f.slice(0,h)):r.push(f),r.join("")}function jR(e){return e.includes("```action")?e.replace(/```action\s*\n[\s\S]*?```/g,"").includes("```action"):!1}function zR({action:e,resolved:t,onResolve:r}){var b,y;const[a,o]=C.useState(""),[c,u]=C.useState(null);if(t)return d.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:[d.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:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),d.jsxs("span",{className:"text-caption",style:{color:"var(--text-secondary)"},children:["Selected: ",d.jsx("strong",{style:{color:"var(--text-primary)"},children:t.label??t.value})]})]});const f=v=>{r&&r(v.value,v.label)},h=()=>{const v=a.trim();v&&r&&r(v,v)},m=(v,x)=>{const S=c===x;return v.style==="primary"?{background:"var(--bg-active)",color:"#fff",border:"none",opacity:S?.9:1}:v.style==="danger"?{background:S?"rgba(239,68,68,0.15)":"transparent",color:"var(--accent-red, #ef4444)",border:"1px solid var(--accent-red, #ef4444)"}:{background:S?"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 d.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&&d.jsx("div",{className:"px-4 py-3",style:{borderBottom:"1px solid var(--border)"},children:d.jsx("p",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:e.prompt})}),d.jsxs("div",{className:"flex",children:[d.jsx("button",{onClick:()=>f(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}),d.jsx("button",{onClick:()=>f(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?d.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&&d.jsx("div",{className:"px-4 py-3",style:{borderBottom:"1px solid var(--border)"},children:d.jsx("p",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:e.prompt})}),d.jsx("div",{className:"flex flex-wrap gap-2 px-4 py-3",children:e.items.map((v,x)=>d.jsx("button",{onClick:()=>f(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:m(v,x),children:v.label},v.value))})]}):e.kind==="select"&&e.items?d.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&&d.jsx("div",{className:"px-4 py-3",style:{borderBottom:"1px solid var(--border)"},children:d.jsx("p",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:e.prompt})}),d.jsx("div",{className:"flex flex-col",children:e.items.map((v,x)=>d.jsxs("button",{onClick:()=>f(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:[d.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&&d.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:"#fff"}})}),d.jsx("span",{className:"text-caption",children:v.label})]},v.value))})]}):e.kind==="input"?d.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&&d.jsx("div",{className:"px-4 py-3",style:{borderBottom:"1px solid var(--border)"},children:d.jsx("p",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:e.prompt})}),d.jsxs("div",{className:"flex items-center gap-2 px-4 py-3",children:[d.jsx("input",{type:"text",value:a,onChange:v=>o(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)"}}),d.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 BR(){return d.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:[d.jsx("span",{className:"inline-block w-2 h-2 rounded-full animate-pulse",style:{background:"var(--text-link)"}}),d.jsx("span",{className:"text-caption",style:{color:"var(--text-muted)"},children:"Preparing options..."})]})}function lp({text:e,mediaUrl:t,messageId:r,encrypted:a,a2ui:o,className:c="",isStreaming:u,onAction:f,onResolveAction:h,resolvedActions:m}){const b=C.useMemo(()=>IR(h,m),[h,m]),y=C.useMemo(()=>DR(e,u),[e,u]),v=u&&jR(e);return d.jsxs("div",{className:c,children:[t&&d.jsx("div",{className:"mb-2",children:d.jsx(UR,{url:t,mediaContextId:a&&r?`${r}:media`:void 0})}),y?d.jsx("div",{className:"prose prose-sm max-w-none overflow-hidden 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)",overflowWrap:"break-word",wordBreak:"break-word","--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:d.jsx(L0,{remarkPlugins:[iE],rehypePlugins:[kR],components:b,children:y})}):null,v&&d.jsx(BR,{}),o&&d.jsx(MR,{jsonl:o,onAction:f})]})}function UR({url:e,mediaContextId:t}){var h,m;const[r,a]=C.useState(null),[o,c]=C.useState(!1);C.useEffect(()=>{if(!t||!Ge.hasKey()){a(null);return}let b=!1;return c(!0),(async()=>{try{const y=await fetch(e);if(!y.ok)throw new Error(`HTTP ${y.status}`);const v=new Uint8Array(await y.arrayBuffer()),x=await Ge.decryptMedia(v,t);if(!b){const S=new Blob([x.buffer.slice(0)]);a(URL.createObjectURL(S))}}catch(y){console.warn("[E2E] Media decryption failed, falling back to direct URL:",y),b||a(null)}finally{b||c(!1)}})(),()=>{b=!0,r&&URL.revokeObjectURL(r)}},[e,t]);const u=r||e,f=((h=e.split(".").pop())==null?void 0:h.toLowerCase().split("?")[0])??"";if(o)return d.jsx("div",{className:"flex items-center gap-2 px-3 py-2 rounded-md max-w-[360px]",style:{background:"var(--bg-hover)",border:"1px solid var(--border)"},children:d.jsx("span",{className:"text-caption",style:{color:"var(--text-muted)"},children:"Decrypting media..."})});if(["mp3","wav","ogg","m4a","aac","webm"].includes(f))return d.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:[d.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:d.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"})}),d.jsx("audio",{controls:!0,className:"flex-1 h-8",style:{maxWidth:280},children:d.jsx("source",{src:u})})]});if(["mp4","mov","avi","mkv"].includes(f))return d.jsx("video",{controls:!0,className:"max-w-[360px] max-h-64 rounded-md",style:{border:"1px solid var(--border)"},children:d.jsx("source",{src:u})});if(["pdf","zip","tar","gz","doc","docx","xls","xlsx","csv"].includes(f)){const b=((m=e.split("/").pop())==null?void 0:m.split("?")[0])??"file";return d.jsxs("a",{href:u,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:[d.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:d.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"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("p",{className:"text-caption font-bold truncate",style:{color:"var(--text-primary)"},children:b}),d.jsxs("p",{className:"text-tiny",style:{color:"var(--text-muted)"},children:[f.toUpperCase()," — Click to open"]})]}),d.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:d.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 d.jsx("img",{src:u,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(u,"_blank")})}const bl="botschat:sessionHistory",Nh="botschat:sessionCounter";function PR(e){try{const t=JSON.parse(localStorage.getItem(bl)||"{}");return Array.isArray(t[e])?t[e]:[]}catch{return[]}}function jx(e,t){try{const r=JSON.parse(localStorage.getItem(bl)||"{}"),o=(Array.isArray(r[e])?r[e]:[]).filter(c=>c!==t);o.unshift(t),r[e]=o.slice(0,50),localStorage.setItem(bl,JSON.stringify(r))}catch{}}function HR(e){const t=e.match(/^Session\s+(\d+)$/);return t?parseInt(t[1],10):0}function FR(e,t){let r=0;try{const c=JSON.parse(localStorage.getItem(Nh)||"{}");r=typeof c[e]=="number"?c[e]:0}catch{}const a=t.reduce((c,u)=>Math.max(c,HR(u.name)),0),o=Math.max(r,a)+1;try{const c=JSON.parse(localStorage.getItem(Nh)||"{}");c[e]=o,localStorage.setItem(Nh,JSON.stringify(c))}catch{}return o}function $R(e,t){try{const r=JSON.parse(localStorage.getItem(bl)||"{}"),a=Array.isArray(r[e])?r[e]:[];r[e]=a.filter(o=>o!==t),localStorage.setItem(bl,JSON.stringify(r))}catch{}}function GR({channelId:e}){const t=Zn(),r=Rr(),[a,o]=C.useState(null),{onCompositionStart:c,onCompositionEnd:u,isIMEActive:f}=Sl(),[h,m]=C.useState(""),[b,y]=C.useState(null),v=C.useRef(null),x=C.useRef(null),S=C.useRef(null),_=t.sessions,N=t.selectedSessionId;C.useEffect(()=>{a&&v.current&&(v.current.focus(),v.current.select())},[a]),C.useEffect(()=>{if(!b)return;const w=D=>{S.current&&!S.current.contains(D.target)&&y(null)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[b]);const T=C.useCallback(w=>{if(w===N)return;const D=_.find(F=>F.id===w);D&&(Z.info("Session",`Switched to session: ${D.name} (${D.id})`),e&&jx(e,D.id),r({type:"SELECT_SESSION",sessionId:D.id,sessionKey:D.sessionKey}))},[N,_,e,r]),O=C.useCallback(async()=>{try{let w=e;if(!w){Z.info("Session","No channel for default agent — auto-creating General channel"),w=(await cr.create({name:"General",providerAgentId:"main"})).id;const[{agents:P},{channels:$}]=await Promise.all([Os.list(),cr.list()]);r({type:"SET_AGENTS",agents:P}),r({type:"SET_CHANNELS",channels:$});const{sessions:Y}=await Cs.list(w);r({type:"SET_SESSIONS",sessions:Y}),Y.length>0&&r({type:"SELECT_SESSION",sessionId:Y[0].id,sessionKey:Y[0].sessionKey});return}const D=FR(w,_),F=await Cs.create(w,`Session ${D}`);Z.info("Session",`Created session: ${F.name} (${F.id})`),r({type:"ADD_SESSION",session:F}),jx(w,F.id),r({type:"SELECT_SESSION",sessionId:F.id,sessionKey:F.sessionKey}),requestAnimationFrame(()=>{x.current&&(x.current.scrollLeft=x.current.scrollWidth)})}catch(w){Z.error("Session",`Failed to create session: ${w}`)}},[e,_,r]),R=C.useCallback(async w=>{if(!(_.length<=1||!e))try{if(await Cs.delete(e,w),Z.info("Session",`Deleted session: ${w}`),r({type:"REMOVE_SESSION",sessionId:w}),$R(e,w),y(null),N===w){const D=_.filter(F=>F.id!==w);if(D.length>0){const J=PR(e).map(P=>D.find($=>$.id===P)).find(Boolean)??D[0];r({type:"SELECT_SESSION",sessionId:J.id,sessionKey:J.sessionKey})}}}catch(D){Z.error("Session",`Failed to delete session: ${D}`)}},[e,_,N,r]),M=C.useCallback((w,D)=>{o(w),m(D)},[]),L=C.useCallback(async()=>{if(!a||!h.trim()||!e){o(null);return}try{await Cs.rename(e,a,h.trim()),Z.info("Session",`Renamed session ${a} to: ${h.trim()}`),r({type:"RENAME_SESSION",sessionId:a,name:h.trim()})}catch(w){Z.error("Session",`Failed to rename session: ${w}`)}o(null)},[e,a,h,r]);return d.jsxs("div",{className:"flex items-center gap-0 px-3",style:{height:36,borderBottom:"1px solid var(--border)",background:"var(--bg-surface)"},children:[d.jsxs("div",{ref:x,className:"flex items-center gap-0.5 overflow-x-auto no-scrollbar",children:[_.map(w=>{const D=w.id===N,F=w.id===a;return d.jsx("div",{className:"group relative flex items-center shrink-0",children:F?d.jsx("input",{ref:v,value:h,onChange:J=>m(J.target.value),onBlur:L,onKeyDown:J=>{J.key==="Enter"&&!J.nativeEvent.isComposing&&!f()&&(J.preventDefault(),L()),J.key==="Escape"&&o(null)},onCompositionStart:c,onCompositionEnd:u,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}}):d.jsx("button",{onClick:()=>T(w.id),onDoubleClick:()=>M(w.id,w.name),className:"flex items-center gap-1 px-2.5 py-1 text-caption rounded-t-md transition-colors whitespace-nowrap",style:{background:D?"var(--bg-hover)":"transparent",color:D?"var(--text-primary)":"var(--text-secondary)",fontWeight:D?700:400,borderBottom:D?"2px solid var(--bg-active)":"2px solid transparent",marginBottom:-1},title:`${w.name} (double-click to rename)`,children:d.jsx("span",{className:"max-w-[120px] truncate",children:w.name})})},w.id)}),d.jsx("button",{onClick:O,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:w=>{w.currentTarget.style.background="var(--bg-hover)",w.currentTarget.style.color="var(--text-primary)"},onMouseLeave:w=>{w.currentTarget.style.background="",w.currentTarget.style.color="var(--text-muted)"},children:d.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})})})]}),_.length>1&&N&&d.jsxs("div",{className:"relative ml-auto pl-2 flex-shrink-0",children:[d.jsx("button",{onClick:()=>y(N),className:"w-7 h-7 flex items-center justify-center rounded-md transition-colors",style:{color:"var(--text-muted)"},title:"Close current session","aria-label":"Close current session",onMouseEnter:w=>{w.currentTarget.style.background="var(--bg-hover)",w.currentTarget.style.color="var(--text-primary)"},onMouseLeave:w=>{w.currentTarget.style.background="",w.currentTarget.style.color="var(--text-muted)"},children:d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),b&&d.jsxs("div",{ref:S,className:"absolute right-0 top-full mt-1 z-50 rounded-md shadow-lg py-2 px-3 min-w-[180px]",style:{background:"var(--bg-surface)",border:"1px solid var(--border)",boxShadow:"0 4px 12px rgba(0,0,0,0.15)"},children:[d.jsx("p",{className:"text-caption mb-2",style:{color:"var(--text-primary)"},children:"Close this session?"}),d.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[d.jsx("button",{onClick:()=>y(null),className:"px-2.5 py-1 text-caption rounded-md transition-colors",style:{color:"var(--text-secondary)"},onMouseEnter:w=>{w.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:w=>{w.currentTarget.style.background=""},children:"Cancel"}),d.jsx("button",{onClick:()=>R(b),className:"px-2.5 py-1 text-caption font-bold rounded-md text-white transition-colors",style:{background:"#e74c3c"},onMouseEnter:w=>{w.currentTarget.style.background="#c0392b"},onMouseLeave:w=>{w.currentTarget.style.background="#e74c3c"},children:"Close"})]})]})]})]})}const zx=768;function Jp(){const[e,t]=C.useState(()=>typeof window>"u"?!1:window.innerWidth<zx);return C.useEffect(()=>{const r=window.matchMedia(`(max-width: ${zx-1}px)`),a=o=>t(o.matches);return t(r.matches),r.addEventListener("change",a),()=>r.removeEventListener("change",a)},[]),e}function Wn(){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)}`}const Bx={hour:"2-digit",minute:"2-digit"},KR={month:"short",day:"numeric"},VR={year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"};function qR(e){const t=new Date;return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function cp(e){const t=new Date(e);return qR(t)?t.toLocaleTimeString([],Bx):`${t.toLocaleDateString([],KR)} ${t.toLocaleTimeString([],Bx)}`}function up(e){return new Date(e).toLocaleString([],VR)}function YR(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 Ux=[{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"}],TE="botschat_skill_freq_v2",Px="botschat_skill_freq",WR=2,XR=14;function NE(e=new Date){return e.toISOString().slice(0,10)}function CE(e){const t=Date.now()-XR*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 AE(){try{const e=localStorage.getItem(TE);if(e){const r=JSON.parse(e);return CE(r),r}const t=localStorage.getItem(Px);if(t){const r=JSON.parse(t),a=NE(),o={};for(const[c,u]of Object.entries(r))o[c]={total:u,daily:{[a]:u}};return OE(o),localStorage.removeItem(Px),o}return{}}catch{return{}}}function OE(e){CE(e),localStorage.setItem(TE,JSON.stringify(e))}function Ch(e){const t=e.match(/^\/(\S+)/);if(!t)return null;const r=`/${t[1]}`,a=AE(),o=NE();return a[r]||(a[r]={total:0,daily:{}}),a[r].total+=1,a[r].daily[o]=(a[r].daily[o]??0)+1,OE(a),r}function ME(e){const t=Date.now()-WR*864e5;let r=0;for(const[a,o]of Object.entries(e.daily))new Date(a).getTime()>=t&&(r+=o);return r}function Hx(e){return ME(e)*5+e.total}function ZR(){const e=AE(),t=new Set(Ux.map(o=>o.cmd)),r=Object.keys(e).filter(o=>!t.has(o)&&o.startsWith("/")).map(o=>({cmd:o,label:o.slice(1).charAt(0).toUpperCase()+o.slice(2),icon:o.slice(1).charAt(0).toUpperCase()}));return{skills:[...Ux,...r].sort((o,c)=>{const u=e[o.cmd]?Hx(e[o.cmd]):0;return(e[c.cmd]?Hx(e[c.cmd]):0)-u}),store:e}}function RE({sendMessage:e}){var ft,Et,yr,di;const t=Zn(),r=Rr(),a=Jp(),{onCompositionStart:o,onCompositionEnd:c,isIMEActive:u}=Sl(),[f,h]=C.useState(""),[m,b]=C.useState(0),[y,v]=C.useState(null),[x,S]=C.useState(!1),[_,N]=C.useState(!1),[T,O]=C.useState(null),[R,M]=C.useState(!1),L=C.useRef(null),w=C.useRef(null),D=C.useRef(null),F=C.useRef(null),J=C.useRef(null),P=C.useRef(null),[$,Y]=C.useState(0),te=t.selectedSessionKey,{skills:se,store:V}=C.useMemo(()=>ZR(),[m]);C.useEffect(()=>{var le;(le=L.current)==null||le.scrollIntoView({behavior:"smooth"})},[t.messages]),C.useEffect(()=>{w.current&&(w.current.style.height="auto",w.current.style.height=Math.min(w.current.scrollHeight,160)+"px")},[f]),C.useEffect(()=>{a||te&&w.current&&requestAnimationFrame(()=>{var le;(le=w.current)==null||le.focus()})},[te,a]),C.useEffect(()=>{if(!R)return;const le=he=>{J.current&&!J.current.contains(he.target)&&M(!1)};return document.addEventListener("mousedown",le),()=>document.removeEventListener("mousedown",le)},[R]),C.useEffect(()=>{const le=P.current;if(!le)return;const he=new ResizeObserver(Ie=>{for(const q of Ie)Y(q.contentRect.width)});return he.observe(le),Y(le.clientWidth),()=>he.disconnect()},[]),C.useEffect(()=>{if(te)try{const he=JSON.parse(localStorage.getItem("botschat:sessionModels")||"{}")[te];he&&he!==t.sessionModel?r({type:"SET_SESSION_MODEL",model:he}):!he&&t.sessionModel&&r({type:"SET_SESSION_MODEL",model:null})}catch{}},[te]);const z=t.sessionModel??t.defaultModel,re=C.useMemo(()=>{if(!z)return null;if($>=500){const le=z.lastIndexOf("/");return le>=0?z.substring(le+1):z}return null},[z,$]),oe=C.useCallback(le=>{var Ie;if(!le||!te||le===z)return;Z.info("Chat",`Model change: ${z??"none"} → ${le}`),r({type:"SET_SESSION_MODEL",model:le});try{const q=JSON.parse(localStorage.getItem("botschat:sessionModels")||"{}");q[te]=le,localStorage.setItem("botschat:sessionModels",JSON.stringify(q))}catch{}Ch("/model"),b(q=>q+1);const he={id:Wn(),sender:"user",text:`/model ${le}`,timestamp:Date.now()};r({type:"ADD_MESSAGE",message:he}),e({type:"user.message",sessionKey:te,text:`/model ${le}`,userId:((Ie=t.user)==null?void 0:Ie.id)??"",messageId:he.id}),requestAnimationFrame(()=>{var q;(q=L.current)==null||q.scrollIntoView({behavior:"smooth"})})},[te,z,(ft=t.user)==null?void 0:ft.id,e,r]),ye=C.useCallback(le=>{var he;Z.info("Skill",`Skill button clicked: ${le}`),h(Ie=>Ie.startsWith(le+" ")||Ie===le?Ie:le+" "),(he=w.current)==null||he.focus()},[]),I=C.useCallback(le=>{var q,de;const he=(q=le.target.files)==null?void 0:q[0];if(!he)return;const Ie=he.type.startsWith("image/")?URL.createObjectURL(he):"";v({file:he,preview:Ie}),le.target.value="",(de=w.current)==null||de.focus()},[]),j=C.useCallback(()=>{y&&(URL.revokeObjectURL(y.preview),v(null))},[y]),Q=C.useCallback(async(le,he)=>{const Ie=localStorage.getItem("botschat_token");try{let q=le;if(Ge.hasKey()&&he){const Tt=await le.arrayBuffer(),Tn=new Uint8Array(Tt),{encrypted:en}=await Ge.encryptMedia(Tn,he);q=new Blob([en.buffer.slice(0)],{type:le.type}),Z.info("E2E",`Encrypted media (${Tn.length} bytes, ctx=${he.slice(0,8)}…)`)}const de=new FormData;de.append("file",q,le.name);const Se=await fetch("/api/upload",{method:"POST",headers:Ie?{Authorization:`Bearer ${Ie}`}:{},body:de});if(!Se.ok){const Tt=await Se.json().catch(()=>({error:"Upload failed"}));throw new Error(Tt.error??`HTTP ${Se.status}`)}const ze=await Se.json();return{url:ze.url.startsWith("/")?`${window.location.origin}${ze.url}`:ze.url}}catch(q){return Z.error("Upload",`File upload failed: ${q}`),null}},[]),A=C.useCallback(le=>{le.preventDefault(),le.stopPropagation(),le.dataTransfer.types.includes("Files")&&N(!0)},[]),be=C.useCallback(le=>{var Ie;le.preventDefault(),le.stopPropagation();const he=(Ie=F.current)==null?void 0:Ie.getBoundingClientRect();if(he){const{clientX:q,clientY:de}=le;(q<he.left||q>he.right||de<he.top||de>he.bottom)&&N(!1)}},[]),Ne=C.useCallback(le=>{le.preventDefault(),le.stopPropagation()},[]),we=C.useCallback(le=>{var Ie,q;le.preventDefault(),le.stopPropagation(),N(!1);const he=(Ie=le.dataTransfer.files)==null?void 0:Ie[0];if(he){const de=he.type.startsWith("image/")?URL.createObjectURL(he):"";v({file:he,preview:de}),(q=w.current)==null||q.focus()}},[]),Fe=C.useCallback(le=>{var Ie;const he=(Ie=le.clipboardData)==null?void 0:Ie.items;if(he){for(let q=0;q<he.length;q++)if(he[q].type.startsWith("image/")){le.preventDefault();const de=he[q].getAsFile();if(de){const Se=URL.createObjectURL(de);v({file:de,preview:Se})}return}}},[]),G=async()=>{var rt;if(!f.trim()&&!y||!te)return;t.openclawConnected||Z.warn("Chat","Sending while OpenClaw appears offline — message will be delivered when reconnected");const le=f.trim(),he=T?`> ${T.text.split(`
|
|
85
|
-
`).slice(0,3).join(`
|
|
86
|
-
> `)}
|
|
87
|
-
|
|
88
|
-
${le}`:le;O(null);const Ie=he.length>0,q=Ie&&he.startsWith("/");Z.info("Chat",`Send message${q?" (skill)":""}${y?" +image":""}: ${he.length>120?he.slice(0,120)+"…":he}`,{sessionKey:te,isSkill:q}),Ie&&(Ch(he),b(Tt=>Tt+1));const de=Wn();let Se;if(y){S(!0);const Tt=await Q(y.file,`${de}:media`);if(S(!1),!Tt)return;Se=Tt.url,j()}const ze={id:de,sender:"user",text:he,timestamp:Date.now(),mediaUrl:Se,encrypted:Ge.hasKey(),mediaEncrypted:!!Se&&Ge.hasKey()};r({type:"ADD_MESSAGE",message:ze}),e({type:"user.message",sessionKey:te,text:he,userId:((rt=t.user)==null?void 0:rt.id)??"",messageId:ze.id,...Se?{mediaUrl:Se}:{}}),h(""),requestAnimationFrame(()=>{var Tt;(Tt=L.current)==null||Tt.scrollIntoView({behavior:"smooth"})})},ie=le=>{Z.info("Thread",`Open thread for message: ${le}`),r({type:"OPEN_THREAD",threadId:le,messages:[]})},ve=C.useCallback(le=>{var he;O(le),a||(he=w.current)==null||he.focus()},[a]),Ke=C.useCallback(async le=>{try{await navigator.clipboard.writeText(le)}catch{const he=document.createElement("textarea");he.value=le,he.style.position="fixed",he.style.left="-9999px",document.body.appendChild(he),he.select(),document.execCommand("copy"),document.body.removeChild(he)}},[]),pe=C.useCallback(le=>{var Ie;if(!te)return;Z.info("A2UI",`Action triggered: ${le}`);const he={id:Wn(),sender:"user",text:le,timestamp:Date.now()};r({type:"ADD_MESSAGE",message:he}),e({type:"user.message",sessionKey:te,text:le,userId:((Ie=t.user)==null?void 0:Ie.id)??"",messageId:he.id}),requestAnimationFrame(()=>{var q;(q=L.current)==null||q.scrollIntoView({behavior:"smooth"})})},[te,(Et=t.user)==null?void 0:Et.id,e,r]),Ze=C.useCallback((le,he,Ie)=>{var Se;if(!te)return;Z.info("ActionCard",`Resolved: "${Ie}" (value="${he}")`);const q=YR(Ie+he);r({type:"RESOLVE_ACTION",messageId:le,promptHash:q,value:he,label:Ie});const de={id:Wn(),sender:"user",text:Ie,timestamp:Date.now()};r({type:"ADD_MESSAGE",message:de}),e({type:"user.message",sessionKey:te,text:Ie,userId:((Se=t.user)==null?void 0:Se.id)??"",messageId:de.id}),requestAnimationFrame(()=>{var ze;(ze=L.current)==null||ze.scrollIntoView({behavior:"smooth"})})},[te,(yr=t.user)==null?void 0:yr.id,e,r]),ct=C.useCallback(()=>{var Ie;if(!te||!t.streamingRunId)return;Z.info("Chat","Stop streaming requested");const le=t.streamingThreadId?`${te}:thread:${t.streamingThreadId}`:te,he={id:Wn(),sender:"user",text:"/stop",timestamp:Date.now()};t.streamingThreadId?r({type:"ADD_THREAD_MESSAGE",message:he}):r({type:"ADD_MESSAGE",message:he}),e({type:"user.message",sessionKey:le,text:"/stop",userId:((Ie=t.user)==null?void 0:Ie.id)??"",messageId:he.id}),Ch("/stop"),b(q=>q+1),requestAnimationFrame(()=>{var q;(q=L.current)==null||q.scrollIntoView({behavior:"smooth"})})},[te,t.streamingRunId,t.streamingThreadId,(di=t.user)==null?void 0:di.id,e,r]),Ye=t.agents.find(le=>le.id===t.selectedAgentId),Pe=(Ye==null?void 0:Ye.name)??"channel",Me=(Ye==null?void 0:Ye.channelId)??null,pt=!!Ye;return te?d.jsxs("div",{ref:F,className:"flex-1 flex flex-col min-w-0 h-full relative",style:{background:"var(--bg-surface)"},onDragEnter:A,onDragLeave:be,onDragOver:Ne,onDrop:we,children:[_&&d.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center",style:{background:"rgba(0,0,0,0.4)",pointerEvents:"none"},children:d.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:[d.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:d.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"})}),d.jsx("span",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:"Drop image here"})]})}),!a&&d.jsxs("div",{className:"flex items-center px-3 sm:px-5 gap-2 flex-shrink-0",style:{height:44,borderBottom:"1px solid var(--border)"},children:[d.jsxs("span",{className:"text-h1 truncate",style:{color:"var(--text-primary)"},children:["# ",Pe]}),Ye&&!Ye.isDefault&&d.jsx("span",{className:"text-caption hidden sm:inline flex-shrink-0",style:{color:"var(--text-secondary)"},children:"— custom channel"})]}),pt&&d.jsxs("div",{ref:P,className:"flex items-stretch flex-shrink-0",children:[d.jsx("div",{className:"flex-1 min-w-0",children:d.jsx(GR,{channelId:Me})}),d.jsxs("div",{ref:J,className:"relative flex-shrink-0 flex items-center pr-2",style:{borderBottom:"1px solid var(--border)"},children:[d.jsxs("button",{onClick:()=>M(le=>!le),disabled:!t.openclawConnected,className:"flex items-center gap-1.5 px-2 h-8 rounded-md transition-colors text-caption",style:{color:z?"var(--text-primary)":"var(--text-muted)",opacity:t.openclawConnected?1:.5,cursor:t.openclawConnected?"pointer":"not-allowed",fontFamily:"var(--font-mono)"},title:z||"Select model",children:[d.jsx("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:d.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"})}),re&&d.jsx("span",{className:"block overflow-hidden whitespace-nowrap max-w-[200px]",style:{direction:"rtl",textOverflow:"ellipsis"},children:re})]}),R&&d.jsxs("div",{className:"absolute right-0 top-full mt-1 z-50 rounded-md shadow-lg py-1 min-w-[220px] max-h-[300px] overflow-y-auto",style:{background:"var(--bg-surface)",border:"1px solid var(--border)",boxShadow:"0 4px 12px rgba(0,0,0,0.15)"},children:[t.models.map(le=>d.jsxs("button",{onClick:()=>{oe(le.id),M(!1)},className:"w-full text-left px-3 py-2 text-caption transition-colors",style:{color:le.id===z?"var(--text-primary)":"var(--text-secondary)",background:le.id===z?"var(--bg-hover)":"transparent",fontFamily:"var(--font-mono)"},onMouseEnter:he=>{he.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:he=>{he.currentTarget.style.background=le.id===z?"var(--bg-hover)":"transparent"},children:[le.id===z&&d.jsx("span",{className:"mr-1.5",style:{color:"var(--accent)"},children:"✓"}),le.id]},le.id)),t.models.length===0&&d.jsx("div",{className:"px-3 py-2 text-caption",style:{color:"var(--text-muted)"},children:"No models available"})]})]})]}),d.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto overflow-x-hidden",children:[t.messages.length===0&&d.jsx("div",{className:"py-12 px-5 text-center",children:d.jsx("p",{className:"text-caption",style:{color:"var(--text-muted)"},children:"No messages yet. Start a conversation."})}),t.messages.map((le,he)=>{const Ie=he>0?t.messages[he-1]:null,q=(Ie==null?void 0:Ie.sender)===le.sender&&le.timestamp-Ie.timestamp<3e5;return d.jsx(QR,{msg:le,grouped:q,onOpenThread:()=>ie(le.id),onQuote:()=>ve(le),onCopy:()=>Ke(le.text),onAction:pe,onResolveAction:(de,Se)=>Ze(le.id,de,Se),onStop:ct},le.id)}),d.jsx("div",{ref:L})]}),d.jsxs("div",{className:"flex-shrink-0 px-3 sm:px-5 pb-3 sm:pb-4 pt-2",children:[d.jsx("div",{className:"flex items-center gap-1.5 pb-1.5 overflow-x-auto no-scrollbar",children:se.map(le=>{const he=V[le.cmd],Ie=(he==null?void 0:he.total)??0,q=he?ME(he):0,de=f.startsWith(le.cmd+" ")||f===le.cmd;return d.jsxs("button",{onClick:()=>ye(le.cmd),className:"flex items-center gap-1 px-2 py-1 rounded-md text-xs whitespace-nowrap transition-colors shrink-0",style:{background:de?"var(--bg-active)":"var(--bg-hover)",color:de?"#fff":"var(--text-secondary)",border:"1px solid transparent"},title:`${le.cmd}${Ie>0?` (total ${Ie}x${q>0?`, recent ${q}x`:""})`:""}`,children:[d.jsx("span",{className:"font-mono text-[10px] opacity-70",children:le.cmd}),Ie>0&&d.jsx("span",{className:"ml-0.5 px-1 rounded-sm text-[10px] font-bold",style:{background:de?"rgba(255,255,255,0.2)":"var(--bg-surface)",color:de?"#fff":"var(--text-muted)"},children:Ie})]},le.cmd)})}),T&&d.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 mb-1 rounded-md text-caption",style:{background:"var(--bg-hover)",borderLeft:"3px solid var(--text-link)",color:"var(--text-secondary)"},children:[d.jsx("svg",{className:"w-3.5 h-3.5 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 15L3 9m0 0l6-6M3 9h12a6 6 0 010 12h-3"})}),d.jsxs("span",{className:"truncate flex-1",children:[T.sender==="user"?"You":"Agent",": ",T.text.slice(0,80),T.text.length>80?"...":""]}),d.jsx("button",{onClick:()=>O(null),className:"p-0.5 rounded hover:bg-[--bg-surface] shrink-0",style:{color:"var(--text-muted)"},children:d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),d.jsxs("div",{className:"rounded-md",style:{border:"1px solid var(--border)",background:"var(--bg-surface)"},children:[y&&d.jsxs("div",{className:"px-3 pt-2 flex items-start gap-2",children:[d.jsxs("div",{className:"relative",children:[y.preview?d.jsx("img",{src:y.preview,alt:"Preview",className:"max-w-[120px] max-h-[80px] rounded-md object-contain",style:{border:"1px solid var(--border)"}}):d.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-2 rounded-md text-caption",style:{border:"1px solid var(--border)",background:"var(--bg-hover)"},children:[d.jsx("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,style:{color:"var(--text-muted)"},children:d.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"})}),d.jsx("span",{className:"truncate max-w-[100px]",style:{color:"var(--text-secondary)"},children:y.file.name})]}),d.jsx("button",{onClick:j,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 file",children:"✕"})]}),x&&d.jsx("span",{className:"text-caption",style:{color:"var(--text-muted)"},children:"Uploading…"})]}),d.jsx("textarea",{ref:w,value:f,onChange:le=>h(le.target.value),onKeyDown:le=>{le.key==="Enter"&&!le.shiftKey&&!le.nativeEvent.isComposing&&!u()&&(le.preventDefault(),G())},onCompositionStart:o,onCompositionEnd:c,onPaste:Fe,placeholder:t.openclawConnected?`Message #${Pe}`:"No agents connected…",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}}),d.jsxs("div",{className:"flex items-center justify-between px-3 pb-2",children:[d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("input",{ref:D,type:"file",accept:"image/*,application/pdf,.txt,.csv,.md,.json,.zip,.gz,.mp3,.wav,.mp4,.mov",className:"hidden",onChange:I}),d.jsx("button",{onClick:()=>{var le;return(le=D.current)==null?void 0:le.click()},className:"p-1.5 rounded hover:bg-[--bg-hover] transition-colors flex items-center gap-1",style:{color:"var(--text-secondary)"},title:"Attach file","aria-label":"Attach file",disabled:!t.openclawConnected,children:d.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.375 12.739l-7.693 7.693a4.5 4.5 0 01-6.364-6.364l10.94-10.94A3 3 0 1119.5 7.372L8.552 18.32m.009-.01l-.01.01m5.699-9.941l-7.81 7.81a1.5 1.5 0 002.112 2.13"})})})]}),d.jsx("button",{onClick:G,disabled:!f.trim()&&!y,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:d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.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"]})})]})]})]})]}):d.jsx("div",{className:"flex-1 h-full flex items-center justify-center",style:{background:"var(--bg-surface)"},children:d.jsxs("div",{className:"text-center",children:[d.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:d.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"})}),d.jsx("p",{className:"text-body font-bold",style:{color:"var(--text-muted)"},children:"Select a channel to get started"}),d.jsx("p",{className:"text-caption mt-1",style:{color:"var(--text-muted)"},children:"Choose a channel from the sidebar"})]})})}function JR({activities:e}){const[t,r]=C.useState(new Set);if(!e||e.length===0)return null;const a=e.filter(f=>f.kind==="reasoning").pop(),o=e.filter(f=>f.kind==="tool_start"||f.kind==="tool_end"),c=[];for(const f of o)if(f.kind==="tool_start")c.push({name:f.toolName??"tool",started:f.timestamp});else{const h=c.find(m=>m.name===(f.toolName??"tool")&&!m.ended);h?(h.ended=f.timestamp,h.durationMs=f.durationMs,h.result=f.text):c.push({name:f.toolName??"tool",started:f.timestamp,ended:f.timestamp,durationMs:f.durationMs,result:f.text})}const u=f=>r(h=>{const m=new Set(h);return m.has(f)?m.delete(f):m.add(f),m});return d.jsxs("div",{className:"flex flex-col gap-0.5 mt-1 text-xs",style:{color:"var(--text-secondary)"},children:[a&&d.jsxs(d.Fragment,{children:[d.jsxs("button",{onClick:()=>u("reasoning"),className:"flex items-center gap-1.5 py-0.5 px-1 -ml-1 rounded hover:bg-[--bg-hover] transition-colors cursor-pointer text-left w-full",children:[d.jsx("span",{className:"text-[10px] opacity-60",children:t.has("reasoning")?"▾":"▸"}),d.jsx("svg",{className:"w-3 h-3 opacity-50",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"})}),d.jsx("span",{className:"opacity-70",children:"Thinking…"})]}),t.has("reasoning")&&d.jsx("div",{className:"ml-4 px-2 py-1.5 rounded text-xs whitespace-pre-wrap max-h-48 overflow-y-auto leading-relaxed",style:{background:"var(--bg-hover)",color:"var(--text-secondary)"},children:a.text||"…"})]}),c.map((f,h)=>{const m=`tool-${h}`,b=!f.ended,y=f.durationMs?f.durationMs>=1e3?`${(f.durationMs/1e3).toFixed(1)}s`:`${f.durationMs}ms`:null,v=b?`Running ${f.name}…`:`${f.name}${y?` (${y})`:""}`;return d.jsxs(_a.Fragment,{children:[d.jsxs("button",{onClick:()=>u(m),className:"flex items-center gap-1.5 py-0.5 px-1 -ml-1 rounded hover:bg-[--bg-hover] transition-colors cursor-pointer text-left w-full",children:[d.jsx("span",{className:"text-[10px] opacity-60",children:t.has(m)?"▾":"▸"}),b?d.jsx("span",{className:"inline-block w-2 h-2 rounded-full animate-pulse flex-shrink-0",style:{background:"var(--text-link)"}}):d.jsx("svg",{className:"w-3 h-3 opacity-50 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.42 15.17l-5.384-3.107A.563.563 0 005.5 12.56v6.88a.563.563 0 00.536.5h.964a.563.563 0 00.536-.5V15.97l4.384 2.53a.563.563 0 00.78-.232l.482-.964a.563.563 0 00-.232-.78zM17 8l4-4m0 0l-4-4m4 4H3"})}),d.jsx("span",{className:"opacity-70 truncate",children:v})]}),t.has(m)&&f.result&&d.jsx("div",{className:"ml-4 px-2 py-1.5 rounded text-xs whitespace-pre-wrap max-h-32 overflow-y-auto font-mono leading-relaxed",style:{background:"var(--bg-hover)",color:"var(--text-secondary)"},children:f.result})]},m)})]})}function QR({msg:e,grouped:t,onOpenThread:r,onQuote:a,onCopy:o,onAction:c,onResolveAction:u,onStop:f}){var F;const h=Zn(),m=e.senderAgentName??"Agent",b=e.sender==="user"?"You":m,y=e.sender==="user"?"#9B59B6":"#2BAC76",v=e.sender==="user"?"U":((F=m[0])==null?void 0:F.toUpperCase())??"A",x=h.threadReplyCounts[e.id]??0,[S,_]=C.useState(!1),N=C.useRef(null),T=C.useRef(!1),O=C.useCallback(()=>{T.current=!1,N.current=setTimeout(()=>{T.current||_(!0)},500)},[]),R=C.useCallback(()=>{T.current=!0,N.current&&clearTimeout(N.current)},[]),M=C.useCallback(()=>{N.current&&clearTimeout(N.current)},[]),[L,w]=C.useState(!1),D=C.useCallback(()=>{o(),w(!0),setTimeout(()=>w(!1),1500),_(!1)},[o]);return d.jsxs("div",{className:"group relative px-3 sm:px-5 hover:bg-[--bg-hover] transition-colors",style:{paddingTop:t?2:8,paddingBottom:2},onTouchStart:O,onTouchMove:R,onTouchEnd:M,onContextMenu:J=>{J.preventDefault(),_(!0)},children:[d.jsxs("div",{className:"flex gap-2 max-w-message",children:[d.jsx("div",{className:"flex-shrink-0",style:{width:36},children:!t&&d.jsx("div",{className:"w-9 h-9 rounded flex items-center justify-center text-white text-caption font-bold",style:{background:y},children:v})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[!t&&d.jsxs("div",{className:"flex items-baseline gap-2 mb-0.5",children:[d.jsx("span",{className:"text-h2",style:{color:"var(--text-primary)"},children:b}),d.jsx("span",{className:"text-caption cursor-default",style:{color:"var(--text-secondary)"},title:up(e.timestamp),children:cp(e.timestamp)})]}),e.activities&&e.activities.length>0&&d.jsx(JR,{activities:e.activities}),d.jsx(lp,{text:e.text,mediaUrl:e.mediaUrl,messageId:e.id,encrypted:!!e.mediaEncrypted&&!!e.mediaUrl&&Ge.hasKey(),a2ui:e.a2ui,isStreaming:e.isStreaming,onAction:c,onResolveAction:u,resolvedActions:e.resolvedActions}),e.isStreaming&&d.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[d.jsx("span",{className:"inline-block w-1.5 h-4 rounded-sm animate-pulse",style:{background:"var(--text-link)",verticalAlign:"text-bottom"}}),f&&d.jsxs("button",{onClick:f,className:"flex items-center gap-1 px-2 py-0.5 rounded-md text-xs font-medium transition-colors",style:{color:"var(--text-secondary)",background:"var(--bg-hover)",border:"1px solid var(--border)"},onMouseEnter:J=>{J.currentTarget.style.background="#e74c3c",J.currentTarget.style.color="#fff",J.currentTarget.style.borderColor="#e74c3c"},onMouseLeave:J=>{J.currentTarget.style.background="var(--bg-hover)",J.currentTarget.style.color="var(--text-secondary)",J.currentTarget.style.borderColor="var(--border)"},title:"Stop generating",children:[d.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 24 24",children:d.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),"Stop"]})]}),x>0&&d.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:[d.jsxs("span",{className:"text-caption font-bold",style:{color:"var(--text-link)"},children:[x," ",x===1?"reply":"replies"]}),d.jsx("span",{className:"text-caption opacity-0 group-hover/thread:opacity-100 transition-opacity",style:{color:"var(--text-secondary)"},children:"View thread"}),d.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:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})})]})]})]}),d.jsxs("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:[d.jsx(Oh,{label:"Reply in thread",onClick:r,icon:d.jsx("svg",{className:"w-[18px] h-[18px]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:d.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"})})}),d.jsx(Oh,{label:"Quote reply",onClick:()=>{a()},icon:d.jsx("svg",{className:"w-[18px] h-[18px]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 15L3 9m0 0l6-6M3 9h12a6 6 0 010 12h-3"})})}),d.jsx(Oh,{label:L?"Copied!":"Copy text",onClick:D,icon:L?d.jsx("svg",{className:"w-[18px] h-[18px]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):d.jsx("svg",{className:"w-[18px] h-[18px]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:d.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"})})})]}),S&&d.jsx("div",{className:"fixed inset-0 z-50 flex items-end justify-center",style:{background:"rgba(0,0,0,0.4)"},onClick:()=>_(!1),children:d.jsxs("div",{className:"w-full max-w-md rounded-t-xl overflow-hidden",style:{background:"var(--bg-surface)",paddingBottom:"env(safe-area-inset-bottom, 12px)"},onClick:J=>J.stopPropagation(),children:[d.jsxs("div",{className:"px-4 py-3",style:{borderBottom:"1px solid var(--border)"},children:[d.jsx("span",{className:"text-caption",style:{color:"var(--text-muted)"},children:e.sender==="user"?"You":"Agent"}),d.jsxs("p",{className:"text-body mt-0.5 line-clamp-2",style:{color:"var(--text-primary)"},children:[e.text.slice(0,120),e.text.length>120?"...":""]})]}),d.jsx(Ah,{label:"Reply in thread",icon:d.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:d.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.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:()=>{_(!1),r()}}),d.jsx(Ah,{label:"Quote reply",icon:d.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 15L3 9m0 0l6-6M3 9h12a6 6 0 010 12h-3"})}),onClick:()=>{_(!1),a()}}),d.jsx(Ah,{label:"Copy text",icon:d.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:d.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"})}),onClick:D}),d.jsx("button",{onClick:()=>_(!1),className:"w-full py-3 text-body font-bold",style:{color:"var(--text-muted)",borderTop:"1px solid var(--border)"},children:"Cancel"})]})})]})}function Ah({label:e,icon:t,onClick:r}){return d.jsxs("button",{onClick:r,className:"w-full flex items-center gap-3 px-4 py-3 text-body transition-colors active:bg-[--bg-hover]",style:{color:"var(--text-primary)"},children:[d.jsx("span",{style:{color:"var(--text-secondary)"},children:t}),e]})}function Oh({label:e,icon:t,onClick:r}){return d.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 e3(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 IE({sendMessage:e}){var _,N,T;const t=Zn(),r=Rr(),[a,o]=C.useState(""),{onCompositionStart:c,onCompositionEnd:u,isIMEActive:f}=Sl();if(C.useEffect(()=>{if(!t.activeThreadId||!t.selectedSessionKey||!t.user)return;const O=`${t.selectedSessionKey}:thread:${t.activeThreadId}`;Z.info("Thread",`Loading history for thread ${t.activeThreadId}`),B1.list(t.user.id,O,t.activeThreadId).then(async({messages:R})=>{if(Z.info("Thread",`Loaded ${R.length} thread messages`),R.length>0){const M=await Promise.all(R.map(async L=>{if(L.encrypted&&Ge.hasKey())try{const w=await Ge.decrypt(L.text,L.id);return{...L,text:w,isEncryptedLocked:!1}}catch(w){return Z.warn("Thread",`Failed to decrypt message ${L.id}`,w),{...L,isEncryptedLocked:!0}}else if(L.encrypted)return{...L,isEncryptedLocked:!0};return L}));r({type:"OPEN_THREAD",threadId:t.activeThreadId,messages:M})}}).catch(R=>{Z.error("Thread",`Failed to load thread history: ${R}`)})},[t.activeThreadId]),!t.activeThreadId)return null;const h=t.messages.find(O=>O.id===t.activeThreadId),m=t.selectedSessionKey?`${t.selectedSessionKey}:thread:${t.activeThreadId}`:null,b=C.useCallback(O=>{var M;if(!m)return;Z.info("Thread/A2UI",`Action triggered: ${O}`);const R={id:Wn(),sender:"user",text:O,timestamp:Date.now(),threadId:t.activeThreadId??void 0};r({type:"ADD_THREAD_MESSAGE",message:R}),e({type:"user.message",sessionKey:m,text:O,userId:((M=t.user)==null?void 0:M.id)??"",messageId:R.id})},[m,t.activeThreadId,(_=t.user)==null?void 0:_.id,e,r]),y=C.useCallback((O,R,M)=>{var D;if(!m)return;Z.info("Thread/ActionCard",`Resolved: "${M}" (value="${R}")`);const L=e3(M+R);r({type:"RESOLVE_ACTION",messageId:O,promptHash:L,value:R,label:M});const w={id:Wn(),sender:"user",text:M,timestamp:Date.now(),threadId:t.activeThreadId??void 0};r({type:"ADD_THREAD_MESSAGE",message:w}),e({type:"user.message",sessionKey:m,text:M,userId:((D=t.user)==null?void 0:D.id)??"",messageId:w.id})},[m,t.activeThreadId,(N=t.user)==null?void 0:N.id,e,r]),v=C.useCallback(()=>{var R;if(!m||!t.streamingRunId||!t.streamingThreadId)return;Z.info("Thread","Stop streaming requested");const O={id:Wn(),sender:"user",text:"/stop",timestamp:Date.now(),threadId:t.activeThreadId??void 0};r({type:"ADD_THREAD_MESSAGE",message:O}),e({type:"user.message",sessionKey:m,text:"/stop",userId:((R=t.user)==null?void 0:R.id)??"",messageId:O.id})},[m,t.streamingRunId,t.streamingThreadId,t.activeThreadId,(T=t.user)==null?void 0:T.id,e,r]),x=!!t.streamingRunId&&!!t.streamingThreadId,S=()=>{var M;if(!a.trim()||!t.selectedSessionKey)return;const O=a.trim();Z.info("Thread",`Send reply: ${O.length>120?O.slice(0,120)+"…":O}`,{threadId:t.activeThreadId});const R={id:Wn(),sender:"user",text:O,timestamp:Date.now(),threadId:t.activeThreadId??void 0};r({type:"ADD_THREAD_MESSAGE",message:R}),e({type:"user.message",sessionKey:m,text:O,userId:((M=t.user)==null?void 0:M.id)??"",messageId:R.id}),o("")};return d.jsxs("div",{className:"flex flex-col h-full",style:{background:"var(--bg-surface)"},children:[d.jsxs("div",{className:"flex items-center justify-between px-4 flex-shrink-0",style:{height:44,borderBottom:"1px solid var(--border)"},children:[d.jsx("h3",{className:"text-h1",style:{color:"var(--text-primary)"},children:"Thread"}),d.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:d.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),d.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[h&&d.jsx("div",{className:"px-5 py-3",style:{borderBottom:"1px solid var(--border)"},children:d.jsxs("div",{className:"flex gap-2",children:[d.jsx("div",{className:"w-9 h-9 rounded flex-shrink-0 flex items-center justify-center text-white text-caption font-bold",style:{background:h.sender==="user"?"#9B59B6":"#2BAC76"},children:h.sender==="user"?"U":"A"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-baseline gap-2 mb-0.5",children:[d.jsx("span",{className:"text-h2",style:{color:"var(--text-primary)"},children:h.sender==="user"?"You":"OpenClaw Agent"}),d.jsx("span",{className:"text-caption cursor-default",style:{color:"var(--text-secondary)"},title:up(h.timestamp),children:cp(h.timestamp)})]}),d.jsx(lp,{text:h.text,mediaUrl:h.mediaUrl,messageId:h.id,encrypted:!!h.mediaEncrypted&&!!h.mediaUrl&&Ge.hasKey(),a2ui:h.a2ui,onAction:b,onResolveAction:(O,R)=>y(h.id,O,R),resolvedActions:h.resolvedActions})]})]})}),d.jsx("div",{className:"px-5 py-2",style:{borderBottom:"1px solid var(--border)"},children:d.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((O,R)=>{const M=R>0?t.threadMessages[R-1]:null,L=(M==null?void 0:M.sender)===O.sender&&O.timestamp-M.timestamp<3e5;return d.jsx("div",{className:"px-5 hover:bg-[--bg-hover] transition-colors",style:{paddingTop:L?2:8,paddingBottom:2},children:d.jsxs("div",{className:"flex gap-2",children:[d.jsx("div",{className:"flex-shrink-0",style:{width:36},children:!L&&d.jsx("div",{className:"w-9 h-9 rounded flex items-center justify-center text-white text-caption font-bold",style:{background:O.sender==="user"?"#9B59B6":"#2BAC76"},children:O.sender==="user"?"U":"A"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[!L&&d.jsxs("div",{className:"flex items-baseline gap-2 mb-0.5",children:[d.jsx("span",{className:"text-h2",style:{color:"var(--text-primary)"},children:O.sender==="user"?"You":"OpenClaw Agent"}),d.jsx("span",{className:"text-caption cursor-default",style:{color:"var(--text-secondary)"},title:up(O.timestamp),children:cp(O.timestamp)})]}),d.jsx(lp,{text:O.text,mediaUrl:O.mediaUrl,messageId:O.id,encrypted:!!O.mediaEncrypted&&!!O.mediaUrl&&Ge.hasKey(),a2ui:O.a2ui,isStreaming:O.isStreaming,onAction:b,onResolveAction:(w,D)=>y(O.id,w,D),resolvedActions:O.resolvedActions}),O.isStreaming&&d.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[d.jsx("span",{className:"inline-block w-1.5 h-4 rounded-sm animate-pulse",style:{background:"var(--text-link)",verticalAlign:"text-bottom"}}),d.jsxs("button",{onClick:v,className:"flex items-center gap-1 px-2 py-0.5 rounded-md text-xs font-medium transition-colors",style:{color:"var(--text-secondary)",background:"var(--bg-hover)",border:"1px solid var(--border)"},onMouseEnter:w=>{w.currentTarget.style.background="#e74c3c",w.currentTarget.style.color="#fff",w.currentTarget.style.borderColor="#e74c3c"},onMouseLeave:w=>{w.currentTarget.style.background="var(--bg-hover)",w.currentTarget.style.color="var(--text-secondary)",w.currentTarget.style.borderColor="var(--border)"},title:"Stop generating",children:[d.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 24 24",children:d.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),"Stop"]})]})]})]})},O.id)})]})," ",d.jsx("div",{className:"px-4 pb-3 pt-2",children:d.jsxs("div",{className:"rounded-md",style:{border:"1px solid var(--border)",background:"var(--bg-surface)"},children:[d.jsx("textarea",{value:a,onChange:O=>o(O.target.value),onKeyDown:O=>{O.key==="Enter"&&!O.shiftKey&&!O.nativeEvent.isComposing&&!f()&&(O.preventDefault(),S())},onCompositionStart:c,onCompositionEnd: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}}),d.jsx("div",{className:"flex justify-end px-3 pb-2",children:x?d.jsx("button",{onClick:v,className:"px-3 py-1 rounded-sm text-caption font-bold text-white transition-colors",style:{background:"#e74c3c"},onMouseEnter:O=>{O.currentTarget.style.background="#c0392b"},onMouseLeave:O=>{O.currentTarget.style.background="#e74c3c"},title:"Stop generating",children:d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"currentColor",viewBox:"0 0 24 24",children:d.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),"Stop"]})}):d.jsx("button",{onClick:S,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 t3(e){switch(e){case"ok":return"OK";case"error":return"ERR";case"skipped":return"SKIP";case"running":return"RUN";default:return e.toUpperCase()}}function n3(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 r3({jobs:e,selectedJobId:t,onSelectJob:r}){return e.length===0?d.jsx("div",{className:"flex items-center justify-center h-full",style:{background:"var(--bg-surface)"},children:d.jsxs("div",{className:"text-center p-4",children:[d.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:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),d.jsxs("p",{className:"text-tiny",style:{color:"var(--text-muted)"},children:["No runs yet.",d.jsx("br",{}),"Waiting for schedule..."]})]})}):d.jsxs("div",{className:"overflow-y-auto h-full",style:{background:"var(--bg-surface)"},children:[d.jsxs("div",{className:"px-3 py-2",style:{borderBottom:"1px solid var(--border)"},children:[d.jsx("span",{className:"text-tiny uppercase tracking-wider font-bold",style:{color:"var(--text-muted)"},children:"Job History"}),d.jsxs("span",{className:"text-tiny ml-1",style:{color:"var(--text-muted)"},children:["(",e.length,")"]})]}),e.map((a,o)=>{const c=n3(a.status),u=a.number||e.length-o;return d.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:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("span",{className:"text-tiny font-mono",style:{color:"var(--text-muted)"},children:["#",u]}),d.jsx("span",{className:"text-tiny px-1.5 py-0.5 rounded-sm font-bold",style:{background:c.bg,color:c.fg},children:t3(a.status)})]}),d.jsxs("div",{className:"text-tiny mt-0.5",style:{color:"var(--text-muted)"},children:[a.time,a.durationMs!=null&&d.jsxs("span",{className:"ml-1",children:["(",(a.durationMs/1e3).toFixed(1),"s)"]})]}),a.summary&&d.jsx("div",{className:"text-caption mt-1 truncate",style:{color:"var(--text-secondary)"},children:a.summary})]},a.id)})]})}const i3=()=>{};var Fx={};/**
|
|
89
|
-
* @license
|
|
90
|
-
* Copyright 2017 Google LLC
|
|
91
|
-
*
|
|
92
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
93
|
-
* you may not use this file except in compliance with the License.
|
|
94
|
-
* You may obtain a copy of the License at
|
|
95
|
-
*
|
|
96
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
97
|
-
*
|
|
98
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
99
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
100
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
101
|
-
* See the License for the specific language governing permissions and
|
|
102
|
-
* limitations under the License.
|
|
103
|
-
*/const LE=function(e){const t=[];let r=0;for(let a=0;a<e.length;a++){let o=e.charCodeAt(a);o<128?t[r++]=o:o<2048?(t[r++]=o>>6|192,t[r++]=o&63|128):(o&64512)===55296&&a+1<e.length&&(e.charCodeAt(a+1)&64512)===56320?(o=65536+((o&1023)<<10)+(e.charCodeAt(++a)&1023),t[r++]=o>>18|240,t[r++]=o>>12&63|128,t[r++]=o>>6&63|128,t[r++]=o&63|128):(t[r++]=o>>12|224,t[r++]=o>>6&63|128,t[r++]=o&63|128)}return t},a3=function(e){const t=[];let r=0,a=0;for(;r<e.length;){const o=e[r++];if(o<128)t[a++]=String.fromCharCode(o);else if(o>191&&o<224){const c=e[r++];t[a++]=String.fromCharCode((o&31)<<6|c&63)}else if(o>239&&o<365){const c=e[r++],u=e[r++],f=e[r++],h=((o&7)<<18|(c&63)<<12|(u&63)<<6|f&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((o&15)<<12|(c&63)<<6|u&63)}}return t.join("")},DE={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 o=0;o<e.length;o+=3){const c=e[o],u=o+1<e.length,f=u?e[o+1]:0,h=o+2<e.length,m=h?e[o+2]:0,b=c>>2,y=(c&3)<<4|f>>4;let v=(f&15)<<2|m>>6,x=m&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(LE(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):a3(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const r=t?this.charToByteMapWebSafe_:this.charToByteMap_,a=[];for(let o=0;o<e.length;){const c=r[e.charAt(o++)],f=o<e.length?r[e.charAt(o)]:0;++o;const m=o<e.length?r[e.charAt(o)]:64;++o;const y=o<e.length?r[e.charAt(o)]:64;if(++o,c==null||f==null||m==null||y==null)throw new s3;const v=c<<2|f>>4;if(a.push(v),m!==64){const x=f<<4&240|m>>2;if(a.push(x),y!==64){const S=m<<6&192|y;a.push(S)}}}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 s3 extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const o3=function(e){const t=LE(e);return DE.encodeByteArray(t,!0)},jE=function(e){return o3(e).replace(/\./g,"")},zE=function(e){try{return DE.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};/**
|
|
104
|
-
* @license
|
|
105
|
-
* Copyright 2022 Google LLC
|
|
106
|
-
*
|
|
107
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
108
|
-
* you may not use this file except in compliance with the License.
|
|
109
|
-
* You may obtain a copy of the License at
|
|
110
|
-
*
|
|
111
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
112
|
-
*
|
|
113
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
114
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
115
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
116
|
-
* See the License for the specific language governing permissions and
|
|
117
|
-
* limitations under the License.
|
|
118
|
-
*/function l3(){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.")}/**
|
|
119
|
-
* @license
|
|
120
|
-
* Copyright 2022 Google LLC
|
|
121
|
-
*
|
|
122
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
123
|
-
* you may not use this file except in compliance with the License.
|
|
124
|
-
* You may obtain a copy of the License at
|
|
125
|
-
*
|
|
126
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
127
|
-
*
|
|
128
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
129
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
130
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
131
|
-
* See the License for the specific language governing permissions and
|
|
132
|
-
* limitations under the License.
|
|
133
|
-
*/const c3=()=>l3().__FIREBASE_DEFAULTS__,u3=()=>{if(typeof process>"u"||typeof Fx>"u")return;const e=Fx.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},d3=()=>{if(typeof document>"u")return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const t=e&&zE(e[1]);return t&&JSON.parse(t)},Qp=()=>{try{return i3()||c3()||u3()||d3()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},f3=e=>{var t,r;return(r=(t=Qp())==null?void 0:t.emulatorHosts)==null?void 0:r[e]},BE=()=>{var e;return(e=Qp())==null?void 0:e.config},UE=e=>{var t;return(t=Qp())==null?void 0:t[`_${e}`]};/**
|
|
134
|
-
* @license
|
|
135
|
-
* Copyright 2017 Google LLC
|
|
136
|
-
*
|
|
137
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
138
|
-
* you may not use this file except in compliance with the License.
|
|
139
|
-
* You may obtain a copy of the License at
|
|
140
|
-
*
|
|
141
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
142
|
-
*
|
|
143
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
144
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
145
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
146
|
-
* See the License for the specific language governing permissions and
|
|
147
|
-
* limitations under the License.
|
|
148
|
-
*/class h3{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))}}}/**
|
|
149
|
-
* @license
|
|
150
|
-
* Copyright 2025 Google LLC
|
|
151
|
-
*
|
|
152
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
153
|
-
* you may not use this file except in compliance with the License.
|
|
154
|
-
* You may obtain a copy of the License at
|
|
155
|
-
*
|
|
156
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
157
|
-
*
|
|
158
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
159
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
160
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
161
|
-
* See the License for the specific language governing permissions and
|
|
162
|
-
* limitations under the License.
|
|
163
|
-
*/function $u(e){try{return(e.startsWith("http://")||e.startsWith("https://")?new URL(e).hostname:e).endsWith(".cloudworkstations.dev")}catch{return!1}}async function p3(e){return(await fetch(e,{credentials:"include"})).ok}const ol={};function m3(){const e={prod:[],emulator:[]};for(const t of Object.keys(ol))ol[t]?e.emulator.push(t):e.prod.push(t);return e}function g3(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 $x=!1;function b3(e,t){if(typeof window>"u"||typeof document>"u"||!$u(window.location.host)||ol[e]===t||ol[e]||$x)return;ol[e]=t;function r(v){return`__firebase__banner__${v}`}const a="__firebase__banner",c=m3().prod.length>0;function u(){const v=document.getElementById(a);v&&v.remove()}function f(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 m(){const v=document.createElement("span");return v.style.cursor="pointer",v.style.marginLeft="16px",v.style.fontSize="24px",v.innerHTML=" ×",v.onclick=()=>{$x=!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=g3(a),x=r("text"),S=document.getElementById(x)||document.createElement("span"),_=r("learnmore"),N=document.getElementById(_)||document.createElement("a"),T=r("preprendIcon"),O=document.getElementById(T)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(v.created){const R=v.element;f(R),b(N,_);const M=m();h(O,T),R.append(O,S,N,M),document.body.appendChild(R)}c?(S.innerText="Preview backend disconnected.",O.innerHTML=`<g clip-path="url(#clip0_6013_33858)">
|
|
164
|
-
<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"/>
|
|
165
|
-
</g>
|
|
166
|
-
<defs>
|
|
167
|
-
<clipPath id="clip0_6013_33858">
|
|
168
|
-
<rect width="24" height="24" fill="white"/>
|
|
169
|
-
</clipPath>
|
|
170
|
-
</defs>`):(O.innerHTML=`<g clip-path="url(#clip0_6083_34804)">
|
|
171
|
-
<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"/>
|
|
172
|
-
</g>
|
|
173
|
-
<defs>
|
|
174
|
-
<clipPath id="clip0_6083_34804">
|
|
175
|
-
<rect width="24" height="24" fill="white"/>
|
|
176
|
-
</clipPath>
|
|
177
|
-
</defs>`,S.innerText="Preview backend running in this workspace."),S.setAttribute("id",x)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",y):y()}/**
|
|
178
|
-
* @license
|
|
179
|
-
* Copyright 2017 Google LLC
|
|
180
|
-
*
|
|
181
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
182
|
-
* you may not use this file except in compliance with the License.
|
|
183
|
-
* You may obtain a copy of the License at
|
|
184
|
-
*
|
|
185
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
186
|
-
*
|
|
187
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
188
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
189
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
190
|
-
* See the License for the specific language governing permissions and
|
|
191
|
-
* limitations under the License.
|
|
192
|
-
*/function kn(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function y3(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(kn())}function v3(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function x3(){const e=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof e=="object"&&e.id!==void 0}function E3(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function S3(){const e=kn();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function _3(){try{return typeof indexedDB=="object"}catch{return!1}}function w3(){return new Promise((e,t)=>{try{let r=!0;const a="validate-browser-context-for-indexeddb-analytics-module",o=self.indexedDB.open(a);o.onsuccess=()=>{o.result.close(),r||self.indexedDB.deleteDatabase(a),e(!0)},o.onupgradeneeded=()=>{r=!1},o.onerror=()=>{var c;t(((c=o.error)==null?void 0:c.message)||"")}}catch(r){t(r)}})}function ND(){return!(typeof navigator>"u"||!navigator.cookieEnabled)}/**
|
|
193
|
-
* @license
|
|
194
|
-
* Copyright 2017 Google LLC
|
|
195
|
-
*
|
|
196
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
197
|
-
* you may not use this file except in compliance with the License.
|
|
198
|
-
* You may obtain a copy of the License at
|
|
199
|
-
*
|
|
200
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
201
|
-
*
|
|
202
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
203
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
204
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
205
|
-
* See the License for the specific language governing permissions and
|
|
206
|
-
* limitations under the License.
|
|
207
|
-
*/const k3="FirebaseError";class Wi extends Error{constructor(t,r,a){super(r),this.code=t,this.customData=a,this.name=k3,Object.setPrototypeOf(this,Wi.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,Nl.prototype.create)}}class Nl{constructor(t,r,a){this.service=t,this.serviceName=r,this.errors=a}create(t,...r){const a=r[0]||{},o=`${this.service}/${t}`,c=this.errors[t],u=c?T3(c,a):"Error",f=`${this.serviceName}: ${u} (${o}).`;return new Wi(o,f,a)}}function T3(e,t){return e.replace(N3,(r,a)=>{const o=t[a];return o!=null?String(o):`<${a}?>`})}const N3=/\{\$([^}]+)}/g;function C3(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function Us(e,t){if(e===t)return!0;const r=Object.keys(e),a=Object.keys(t);for(const o of r){if(!a.includes(o))return!1;const c=e[o],u=t[o];if(Gx(c)&&Gx(u)){if(!Us(c,u))return!1}else if(c!==u)return!1}for(const o of a)if(!r.includes(o))return!1;return!0}function Gx(e){return e!==null&&typeof e=="object"}/**
|
|
208
|
-
* @license
|
|
209
|
-
* Copyright 2017 Google LLC
|
|
210
|
-
*
|
|
211
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
212
|
-
* you may not use this file except in compliance with the License.
|
|
213
|
-
* You may obtain a copy of the License at
|
|
214
|
-
*
|
|
215
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
216
|
-
*
|
|
217
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
218
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
219
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
220
|
-
* See the License for the specific language governing permissions and
|
|
221
|
-
* limitations under the License.
|
|
222
|
-
*/function Cl(e){const t=[];for(const[r,a]of Object.entries(e))Array.isArray(a)?a.forEach(o=>{t.push(encodeURIComponent(r)+"="+encodeURIComponent(o))}):t.push(encodeURIComponent(r)+"="+encodeURIComponent(a));return t.length?"&"+t.join("&"):""}function A3(e,t){const r=new O3(e,t);return r.subscribe.bind(r)}class O3{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 o;if(t===void 0&&r===void 0&&a===void 0)throw new Error("Missing Observer.");M3(t,["next","error","complete"])?o=t:o={next:t,error:r,complete:a},o.next===void 0&&(o.next=Mh),o.error===void 0&&(o.error=Mh),o.complete===void 0&&(o.complete=Mh);const c=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?o.error(this.finalError):o.complete()}catch{}}),this.observers.push(o),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 M3(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 Mh(){}/**
|
|
223
|
-
* @license
|
|
224
|
-
* Copyright 2021 Google LLC
|
|
225
|
-
*
|
|
226
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
227
|
-
* you may not use this file except in compliance with the License.
|
|
228
|
-
* You may obtain a copy of the License at
|
|
229
|
-
*
|
|
230
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
231
|
-
*
|
|
232
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
233
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
234
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
235
|
-
* See the License for the specific language governing permissions and
|
|
236
|
-
* limitations under the License.
|
|
237
|
-
*/function Ra(e){return e&&e._delegate?e._delegate:e}class Ps{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}}/**
|
|
238
|
-
* @license
|
|
239
|
-
* Copyright 2019 Google LLC
|
|
240
|
-
*
|
|
241
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
242
|
-
* you may not use this file except in compliance with the License.
|
|
243
|
-
* You may obtain a copy of the License at
|
|
244
|
-
*
|
|
245
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
246
|
-
*
|
|
247
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
248
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
249
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
250
|
-
* See the License for the specific language governing permissions and
|
|
251
|
-
* limitations under the License.
|
|
252
|
-
*/const xa="[DEFAULT]";/**
|
|
253
|
-
* @license
|
|
254
|
-
* Copyright 2019 Google LLC
|
|
255
|
-
*
|
|
256
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
257
|
-
* you may not use this file except in compliance with the License.
|
|
258
|
-
* You may obtain a copy of the License at
|
|
259
|
-
*
|
|
260
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
261
|
-
*
|
|
262
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
263
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
264
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
265
|
-
* See the License for the specific language governing permissions and
|
|
266
|
-
* limitations under the License.
|
|
267
|
-
*/class R3{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 h3;if(this.instancesDeferred.set(r,a),this.isInitialized(r)||this.shouldAutoInitialize())try{const o=this.getOrInitializeService({instanceIdentifier:r});o&&a.resolve(o)}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(o){if(a)return null;throw o}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(L3(t))try{this.getOrInitializeService({instanceIdentifier:xa})}catch{}for(const[r,a]of this.instancesDeferred.entries()){const o=this.normalizeInstanceIdentifier(r);try{const c=this.getOrInitializeService({instanceIdentifier:o});a.resolve(c)}catch{}}}}clearInstance(t=xa){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=xa){return this.instances.has(t)}getOptions(t=xa){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 o=this.getOrInitializeService({instanceIdentifier:a,options:r});for(const[c,u]of this.instancesDeferred.entries()){const f=this.normalizeInstanceIdentifier(c);a===f&&u.resolve(o)}return o}onInit(t,r){const a=this.normalizeInstanceIdentifier(r),o=this.onInitCallbacks.get(a)??new Set;o.add(t),this.onInitCallbacks.set(a,o);const c=this.instances.get(a);return c&&t(c,a),()=>{o.delete(t)}}invokeOnInitCallbacks(t,r){const a=this.onInitCallbacks.get(r);if(a)for(const o of a)try{o(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:I3(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=xa){return this.component?this.component.multipleInstances?t:xa:t}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function I3(e){return e===xa?void 0:e}function L3(e){return e.instantiationMode==="EAGER"}/**
|
|
268
|
-
* @license
|
|
269
|
-
* Copyright 2019 Google LLC
|
|
270
|
-
*
|
|
271
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
272
|
-
* you may not use this file except in compliance with the License.
|
|
273
|
-
* You may obtain a copy of the License at
|
|
274
|
-
*
|
|
275
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
276
|
-
*
|
|
277
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
278
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
279
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
280
|
-
* See the License for the specific language governing permissions and
|
|
281
|
-
* limitations under the License.
|
|
282
|
-
*/class D3{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 R3(t,this);return this.providers.set(t,r),r}getProviders(){return Array.from(this.providers.values())}}/**
|
|
283
|
-
* @license
|
|
284
|
-
* Copyright 2017 Google LLC
|
|
285
|
-
*
|
|
286
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
287
|
-
* you may not use this file except in compliance with the License.
|
|
288
|
-
* You may obtain a copy of the License at
|
|
289
|
-
*
|
|
290
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
291
|
-
*
|
|
292
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
293
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
294
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
295
|
-
* See the License for the specific language governing permissions and
|
|
296
|
-
* limitations under the License.
|
|
297
|
-
*/var At;(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"})(At||(At={}));const j3={debug:At.DEBUG,verbose:At.VERBOSE,info:At.INFO,warn:At.WARN,error:At.ERROR,silent:At.SILENT},z3=At.INFO,B3={[At.DEBUG]:"log",[At.VERBOSE]:"log",[At.INFO]:"info",[At.WARN]:"warn",[At.ERROR]:"error"},U3=(e,t,...r)=>{if(t<e.logLevel)return;const a=new Date().toISOString(),o=B3[t];if(o)console[o](`[${a}] ${e.name}:`,...r);else throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`)};class PE{constructor(t){this.name=t,this._logLevel=z3,this._logHandler=U3,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in At))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel=typeof t=="string"?j3[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,At.DEBUG,...t),this._logHandler(this,At.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,At.VERBOSE,...t),this._logHandler(this,At.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,At.INFO,...t),this._logHandler(this,At.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,At.WARN,...t),this._logHandler(this,At.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,At.ERROR,...t),this._logHandler(this,At.ERROR,...t)}}const P3=(e,t)=>t.some(r=>e instanceof r);let Kx,Vx;function H3(){return Kx||(Kx=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function F3(){return Vx||(Vx=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const HE=new WeakMap,dp=new WeakMap,FE=new WeakMap,Rh=new WeakMap,em=new WeakMap;function $3(e){const t=new Promise((r,a)=>{const o=()=>{e.removeEventListener("success",c),e.removeEventListener("error",u)},c=()=>{r(si(e.result)),o()},u=()=>{a(e.error),o()};e.addEventListener("success",c),e.addEventListener("error",u)});return t.then(r=>{r instanceof IDBCursor&&HE.set(r,e)}).catch(()=>{}),em.set(t,e),t}function G3(e){if(dp.has(e))return;const t=new Promise((r,a)=>{const o=()=>{e.removeEventListener("complete",c),e.removeEventListener("error",u),e.removeEventListener("abort",u)},c=()=>{r(),o()},u=()=>{a(e.error||new DOMException("AbortError","AbortError")),o()};e.addEventListener("complete",c),e.addEventListener("error",u),e.addEventListener("abort",u)});dp.set(e,t)}let fp={get(e,t,r){if(e instanceof IDBTransaction){if(t==="done")return dp.get(e);if(t==="objectStoreNames")return e.objectStoreNames||FE.get(e);if(t==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return si(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 K3(e){fp=e(fp)}function V3(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...r){const a=e.call(Ih(this),t,...r);return FE.set(a,t.sort?t.sort():[t]),si(a)}:F3().includes(e)?function(...t){return e.apply(Ih(this),t),si(HE.get(this))}:function(...t){return si(e.apply(Ih(this),t))}}function q3(e){return typeof e=="function"?V3(e):(e instanceof IDBTransaction&&G3(e),P3(e,H3())?new Proxy(e,fp):e)}function si(e){if(e instanceof IDBRequest)return $3(e);if(Rh.has(e))return Rh.get(e);const t=q3(e);return t!==e&&(Rh.set(e,t),em.set(t,e)),t}const Ih=e=>em.get(e);function Y3(e,t,{blocked:r,upgrade:a,blocking:o,terminated:c}={}){const u=indexedDB.open(e,t),f=si(u);return a&&u.addEventListener("upgradeneeded",h=>{a(si(u.result),h.oldVersion,h.newVersion,si(u.transaction),h)}),r&&u.addEventListener("blocked",h=>r(h.oldVersion,h.newVersion,h)),f.then(h=>{c&&h.addEventListener("close",()=>c()),o&&h.addEventListener("versionchange",m=>o(m.oldVersion,m.newVersion,m))}).catch(()=>{}),f}function CD(e,{blocked:t}={}){const r=indexedDB.deleteDatabase(e);return t&&r.addEventListener("blocked",a=>t(a.oldVersion,a)),si(r).then(()=>{})}const W3=["get","getKey","getAll","getAllKeys","count"],X3=["put","add","delete","clear"],Lh=new Map;function qx(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(Lh.get(t))return Lh.get(t);const r=t.replace(/FromIndex$/,""),a=t!==r,o=X3.includes(r);if(!(r in(a?IDBIndex:IDBObjectStore).prototype)||!(o||W3.includes(r)))return;const c=async function(u,...f){const h=this.transaction(u,o?"readwrite":"readonly");let m=h.store;return a&&(m=m.index(f.shift())),(await Promise.all([m[r](...f),o&&h.done]))[0]};return Lh.set(t,c),c}K3(e=>({...e,get:(t,r,a)=>qx(t,r)||e.get(t,r,a),has:(t,r)=>!!qx(t,r)||e.has(t,r)}));/**
|
|
298
|
-
* @license
|
|
299
|
-
* Copyright 2019 Google LLC
|
|
300
|
-
*
|
|
301
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
302
|
-
* you may not use this file except in compliance with the License.
|
|
303
|
-
* You may obtain a copy of the License at
|
|
304
|
-
*
|
|
305
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
306
|
-
*
|
|
307
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
308
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
309
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
310
|
-
* See the License for the specific language governing permissions and
|
|
311
|
-
* limitations under the License.
|
|
312
|
-
*/class Z3{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map(r=>{if(J3(r)){const a=r.getImmediate();return`${a.library}/${a.version}`}else return null}).filter(r=>r).join(" ")}}function J3(e){const t=e.getComponent();return(t==null?void 0:t.type)==="VERSION"}const hp="@firebase/app",Yx="0.14.8";/**
|
|
313
|
-
* @license
|
|
314
|
-
* Copyright 2019 Google LLC
|
|
315
|
-
*
|
|
316
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
317
|
-
* you may not use this file except in compliance with the License.
|
|
318
|
-
* You may obtain a copy of the License at
|
|
319
|
-
*
|
|
320
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
321
|
-
*
|
|
322
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
323
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
324
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
325
|
-
* See the License for the specific language governing permissions and
|
|
326
|
-
* limitations under the License.
|
|
327
|
-
*/const oi=new PE("@firebase/app"),Q3="@firebase/app-compat",eI="@firebase/analytics-compat",tI="@firebase/analytics",nI="@firebase/app-check-compat",rI="@firebase/app-check",iI="@firebase/auth",aI="@firebase/auth-compat",sI="@firebase/database",oI="@firebase/data-connect",lI="@firebase/database-compat",cI="@firebase/functions",uI="@firebase/functions-compat",dI="@firebase/installations",fI="@firebase/installations-compat",hI="@firebase/messaging",pI="@firebase/messaging-compat",mI="@firebase/performance",gI="@firebase/performance-compat",bI="@firebase/remote-config",yI="@firebase/remote-config-compat",vI="@firebase/storage",xI="@firebase/storage-compat",EI="@firebase/firestore",SI="@firebase/ai",_I="@firebase/firestore-compat",wI="firebase",kI="12.9.0";/**
|
|
328
|
-
* @license
|
|
329
|
-
* Copyright 2019 Google LLC
|
|
330
|
-
*
|
|
331
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
332
|
-
* you may not use this file except in compliance with the License.
|
|
333
|
-
* You may obtain a copy of the License at
|
|
334
|
-
*
|
|
335
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
336
|
-
*
|
|
337
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
338
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
339
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
340
|
-
* See the License for the specific language governing permissions and
|
|
341
|
-
* limitations under the License.
|
|
342
|
-
*/const pp="[DEFAULT]",TI={[hp]:"fire-core",[Q3]:"fire-core-compat",[tI]:"fire-analytics",[eI]:"fire-analytics-compat",[rI]:"fire-app-check",[nI]:"fire-app-check-compat",[iI]:"fire-auth",[aI]:"fire-auth-compat",[sI]:"fire-rtdb",[oI]:"fire-data-connect",[lI]:"fire-rtdb-compat",[cI]:"fire-fn",[uI]:"fire-fn-compat",[dI]:"fire-iid",[fI]:"fire-iid-compat",[hI]:"fire-fcm",[pI]:"fire-fcm-compat",[mI]:"fire-perf",[gI]:"fire-perf-compat",[bI]:"fire-rc",[yI]:"fire-rc-compat",[vI]:"fire-gcs",[xI]:"fire-gcs-compat",[EI]:"fire-fst",[_I]:"fire-fst-compat",[SI]:"fire-vertex","fire-js":"fire-js",[wI]:"fire-js-all"};/**
|
|
343
|
-
* @license
|
|
344
|
-
* Copyright 2019 Google LLC
|
|
345
|
-
*
|
|
346
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
347
|
-
* you may not use this file except in compliance with the License.
|
|
348
|
-
* You may obtain a copy of the License at
|
|
349
|
-
*
|
|
350
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
351
|
-
*
|
|
352
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
353
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
354
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
355
|
-
* See the License for the specific language governing permissions and
|
|
356
|
-
* limitations under the License.
|
|
357
|
-
*/const Au=new Map,NI=new Map,mp=new Map;function Wx(e,t){try{e.container.addComponent(t)}catch(r){oi.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,r)}}function yl(e){const t=e.name;if(mp.has(t))return oi.debug(`There were multiple attempts to register component ${t}.`),!1;mp.set(t,e);for(const r of Au.values())Wx(r,e);for(const r of NI.values())Wx(r,e);return!0}function $E(e,t){const r=e.container.getProvider("heartbeat").getImmediate({optional:!0});return r&&r.triggerHeartbeat(),e.container.getProvider(t)}function Ar(e){return e==null?!1:e.settings!==void 0}/**
|
|
358
|
-
* @license
|
|
359
|
-
* Copyright 2019 Google LLC
|
|
360
|
-
*
|
|
361
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
362
|
-
* you may not use this file except in compliance with the License.
|
|
363
|
-
* You may obtain a copy of the License at
|
|
364
|
-
*
|
|
365
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
366
|
-
*
|
|
367
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
368
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
369
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
370
|
-
* See the License for the specific language governing permissions and
|
|
371
|
-
* limitations under the License.
|
|
372
|
-
*/const CI={"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."},qi=new Nl("app","Firebase",CI);/**
|
|
373
|
-
* @license
|
|
374
|
-
* Copyright 2019 Google LLC
|
|
375
|
-
*
|
|
376
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
377
|
-
* you may not use this file except in compliance with the License.
|
|
378
|
-
* You may obtain a copy of the License at
|
|
379
|
-
*
|
|
380
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
381
|
-
*
|
|
382
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
383
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
384
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
385
|
-
* See the License for the specific language governing permissions and
|
|
386
|
-
* limitations under the License.
|
|
387
|
-
*/class AI{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 Ps("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 qi.create("app-deleted",{appName:this._name})}}/**
|
|
388
|
-
* @license
|
|
389
|
-
* Copyright 2019 Google LLC
|
|
390
|
-
*
|
|
391
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
392
|
-
* you may not use this file except in compliance with the License.
|
|
393
|
-
* You may obtain a copy of the License at
|
|
394
|
-
*
|
|
395
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
396
|
-
*
|
|
397
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
398
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
399
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
400
|
-
* See the License for the specific language governing permissions and
|
|
401
|
-
* limitations under the License.
|
|
402
|
-
*/const Al=kI;function tm(e,t={}){let r=e;typeof t!="object"&&(t={name:t});const a={name:pp,automaticDataCollectionEnabled:!0,...t},o=a.name;if(typeof o!="string"||!o)throw qi.create("bad-app-name",{appName:String(o)});if(r||(r=BE()),!r)throw qi.create("no-options");const c=Au.get(o);if(c){if(Us(r,c.options)&&Us(a,c.config))return c;throw qi.create("duplicate-app",{appName:o})}const u=new D3(o);for(const h of mp.values())u.addComponent(h);const f=new AI(r,a,u);return Au.set(o,f),f}function OI(e=pp){const t=Au.get(e);if(!t&&e===pp&&BE())return tm();if(!t)throw qi.create("no-app",{appName:e});return t}function Rs(e,t,r){let a=TI[e]??e;r&&(a+=`-${r}`);const o=a.match(/\s|\//),c=t.match(/\s|\//);if(o||c){const u=[`Unable to register library "${a}" with version "${t}":`];o&&u.push(`library name "${a}" contains illegal characters (whitespace or "/")`),o&&c&&u.push("and"),c&&u.push(`version name "${t}" contains illegal characters (whitespace or "/")`),oi.warn(u.join(" "));return}yl(new Ps(`${a}-version`,()=>({library:a,version:t}),"VERSION"))}/**
|
|
403
|
-
* @license
|
|
404
|
-
* Copyright 2021 Google LLC
|
|
405
|
-
*
|
|
406
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
407
|
-
* you may not use this file except in compliance with the License.
|
|
408
|
-
* You may obtain a copy of the License at
|
|
409
|
-
*
|
|
410
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
411
|
-
*
|
|
412
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
413
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
414
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
415
|
-
* See the License for the specific language governing permissions and
|
|
416
|
-
* limitations under the License.
|
|
417
|
-
*/const MI="firebase-heartbeat-database",RI=1,vl="firebase-heartbeat-store";let Dh=null;function GE(){return Dh||(Dh=Y3(MI,RI,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(vl)}catch(r){console.warn(r)}}}}).catch(e=>{throw qi.create("idb-open",{originalErrorMessage:e.message})})),Dh}async function II(e){try{const r=(await GE()).transaction(vl),a=await r.objectStore(vl).get(KE(e));return await r.done,a}catch(t){if(t instanceof Wi)oi.warn(t.message);else{const r=qi.create("idb-get",{originalErrorMessage:t==null?void 0:t.message});oi.warn(r.message)}}}async function Xx(e,t){try{const a=(await GE()).transaction(vl,"readwrite");await a.objectStore(vl).put(t,KE(e)),await a.done}catch(r){if(r instanceof Wi)oi.warn(r.message);else{const a=qi.create("idb-set",{originalErrorMessage:r==null?void 0:r.message});oi.warn(a.message)}}}function KE(e){return`${e.name}!${e.options.appId}`}/**
|
|
418
|
-
* @license
|
|
419
|
-
* Copyright 2021 Google LLC
|
|
420
|
-
*
|
|
421
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
422
|
-
* you may not use this file except in compliance with the License.
|
|
423
|
-
* You may obtain a copy of the License at
|
|
424
|
-
*
|
|
425
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
426
|
-
*
|
|
427
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
428
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
429
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
430
|
-
* See the License for the specific language governing permissions and
|
|
431
|
-
* limitations under the License.
|
|
432
|
-
*/const LI=1024,DI=30;class jI{constructor(t){this.container=t,this._heartbeatsCache=null;const r=this.container.getProvider("app").getImmediate();this._storage=new BI(r),this._heartbeatsCachePromise=this._storage.read().then(a=>(this._heartbeatsCache=a,a))}async triggerHeartbeat(){var t,r;try{const o=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),c=Zx();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:o}),this._heartbeatsCache.heartbeats.length>DI){const u=UI(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(u,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(a){oi.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=Zx(),{heartbeatsToSend:a,unsentEntries:o}=zI(this._heartbeatsCache.heartbeats),c=jE(JSON.stringify({version:2,heartbeats:a}));return this._heartbeatsCache.lastSentHeartbeatDate=r,o.length>0?(this._heartbeatsCache.heartbeats=o,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),c}catch(r){return oi.warn(r),""}}}function Zx(){return new Date().toISOString().substring(0,10)}function zI(e,t=LI){const r=[];let a=e.slice();for(const o of e){const c=r.find(u=>u.agent===o.agent);if(c){if(c.dates.push(o.date),Jx(r)>t){c.dates.pop();break}}else if(r.push({agent:o.agent,dates:[o.date]}),Jx(r)>t){r.pop();break}a=a.slice(1)}return{heartbeatsToSend:r,unsentEntries:a}}class BI{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return _3()?w3().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const r=await II(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 Xx(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 Xx(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??a.lastSentHeartbeatDate,heartbeats:[...a.heartbeats,...t.heartbeats]})}else return}}function Jx(e){return jE(JSON.stringify({version:2,heartbeats:e})).length}function UI(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}/**
|
|
433
|
-
* @license
|
|
434
|
-
* Copyright 2019 Google LLC
|
|
435
|
-
*
|
|
436
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
437
|
-
* you may not use this file except in compliance with the License.
|
|
438
|
-
* You may obtain a copy of the License at
|
|
439
|
-
*
|
|
440
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
441
|
-
*
|
|
442
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
443
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
444
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
445
|
-
* See the License for the specific language governing permissions and
|
|
446
|
-
* limitations under the License.
|
|
447
|
-
*/function PI(e){yl(new Ps("platform-logger",t=>new Z3(t),"PRIVATE")),yl(new Ps("heartbeat",t=>new jI(t),"PRIVATE")),Rs(hp,Yx,e),Rs(hp,Yx,"esm2020"),Rs("fire-js","")}PI("");var HI="firebase",FI="12.9.0";/**
|
|
448
|
-
* @license
|
|
449
|
-
* Copyright 2020 Google LLC
|
|
450
|
-
*
|
|
451
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
452
|
-
* you may not use this file except in compliance with the License.
|
|
453
|
-
* You may obtain a copy of the License at
|
|
454
|
-
*
|
|
455
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
456
|
-
*
|
|
457
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
458
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
459
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
460
|
-
* See the License for the specific language governing permissions and
|
|
461
|
-
* limitations under the License.
|
|
462
|
-
*/Rs(HI,FI,"app");function VE(){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 $I=VE,qE=new Nl("auth","Firebase",VE());/**
|
|
463
|
-
* @license
|
|
464
|
-
* Copyright 2020 Google LLC
|
|
465
|
-
*
|
|
466
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
467
|
-
* you may not use this file except in compliance with the License.
|
|
468
|
-
* You may obtain a copy of the License at
|
|
469
|
-
*
|
|
470
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
471
|
-
*
|
|
472
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
473
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
474
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
475
|
-
* See the License for the specific language governing permissions and
|
|
476
|
-
* limitations under the License.
|
|
477
|
-
*/const Ou=new PE("@firebase/auth");function GI(e,...t){Ou.logLevel<=At.WARN&&Ou.warn(`Auth (${Al}): ${e}`,...t)}function pu(e,...t){Ou.logLevel<=At.ERROR&&Ou.error(`Auth (${Al}): ${e}`,...t)}/**
|
|
478
|
-
* @license
|
|
479
|
-
* Copyright 2020 Google LLC
|
|
480
|
-
*
|
|
481
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
482
|
-
* you may not use this file except in compliance with the License.
|
|
483
|
-
* You may obtain a copy of the License at
|
|
484
|
-
*
|
|
485
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
486
|
-
*
|
|
487
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
488
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
489
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
490
|
-
* See the License for the specific language governing permissions and
|
|
491
|
-
* limitations under the License.
|
|
492
|
-
*/function Mr(e,...t){throw rm(e,...t)}function br(e,...t){return rm(e,...t)}function nm(e,t,r){const a={...$I(),[t]:r};return new Nl("auth","Firebase",a).create(t,{appName:e.name})}function wa(e){return nm(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function KI(e,t,r){const a=r;if(!(t instanceof a))throw a.name!==t.constructor.name&&Mr(e,"argument-error"),nm(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function rm(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 qE.create(e,...t)}function Ue(e,t,...r){if(!e)throw rm(t,...r)}function ni(e){const t="INTERNAL ASSERTION FAILED: "+e;throw pu(t),new Error(t)}function li(e,t){e||ni(t)}/**
|
|
493
|
-
* @license
|
|
494
|
-
* Copyright 2020 Google LLC
|
|
495
|
-
*
|
|
496
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
497
|
-
* you may not use this file except in compliance with the License.
|
|
498
|
-
* You may obtain a copy of the License at
|
|
499
|
-
*
|
|
500
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
501
|
-
*
|
|
502
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
503
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
504
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
505
|
-
* See the License for the specific language governing permissions and
|
|
506
|
-
* limitations under the License.
|
|
507
|
-
*/function gp(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.href)||""}function VI(){return Qx()==="http:"||Qx()==="https:"}function Qx(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.protocol)||null}/**
|
|
508
|
-
* @license
|
|
509
|
-
* Copyright 2020 Google LLC
|
|
510
|
-
*
|
|
511
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
512
|
-
* you may not use this file except in compliance with the License.
|
|
513
|
-
* You may obtain a copy of the License at
|
|
514
|
-
*
|
|
515
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
516
|
-
*
|
|
517
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
518
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
519
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
520
|
-
* See the License for the specific language governing permissions and
|
|
521
|
-
* limitations under the License.
|
|
522
|
-
*/function qI(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(VI()||x3()||"connection"in navigator)?navigator.onLine:!0}function YI(){if(typeof navigator>"u")return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}/**
|
|
523
|
-
* @license
|
|
524
|
-
* Copyright 2020 Google LLC
|
|
525
|
-
*
|
|
526
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
527
|
-
* you may not use this file except in compliance with the License.
|
|
528
|
-
* You may obtain a copy of the License at
|
|
529
|
-
*
|
|
530
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
531
|
-
*
|
|
532
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
533
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
534
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
535
|
-
* See the License for the specific language governing permissions and
|
|
536
|
-
* limitations under the License.
|
|
537
|
-
*/class Ol{constructor(t,r){this.shortDelay=t,this.longDelay=r,li(r>t,"Short delay should be less than long delay!"),this.isMobile=y3()||E3()}get(){return qI()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
|
|
538
|
-
* @license
|
|
539
|
-
* Copyright 2020 Google LLC
|
|
540
|
-
*
|
|
541
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
542
|
-
* you may not use this file except in compliance with the License.
|
|
543
|
-
* You may obtain a copy of the License at
|
|
544
|
-
*
|
|
545
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
546
|
-
*
|
|
547
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
548
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
549
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
550
|
-
* See the License for the specific language governing permissions and
|
|
551
|
-
* limitations under the License.
|
|
552
|
-
*/function im(e,t){li(e.emulator,"Emulator should always be set here");const{url:r}=e.emulator;return t?`${r}${t.startsWith("/")?t.slice(1):t}`:r}/**
|
|
553
|
-
* @license
|
|
554
|
-
* Copyright 2020 Google LLC
|
|
555
|
-
*
|
|
556
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
557
|
-
* you may not use this file except in compliance with the License.
|
|
558
|
-
* You may obtain a copy of the License at
|
|
559
|
-
*
|
|
560
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
561
|
-
*
|
|
562
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
563
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
564
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
565
|
-
* See the License for the specific language governing permissions and
|
|
566
|
-
* limitations under the License.
|
|
567
|
-
*/class YE{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;ni("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;ni("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;ni("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
|
|
568
|
-
* @license
|
|
569
|
-
* Copyright 2020 Google LLC
|
|
570
|
-
*
|
|
571
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
572
|
-
* you may not use this file except in compliance with the License.
|
|
573
|
-
* You may obtain a copy of the License at
|
|
574
|
-
*
|
|
575
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
576
|
-
*
|
|
577
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
578
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
579
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
580
|
-
* See the License for the specific language governing permissions and
|
|
581
|
-
* limitations under the License.
|
|
582
|
-
*/const WI={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"};/**
|
|
583
|
-
* @license
|
|
584
|
-
* Copyright 2020 Google LLC
|
|
585
|
-
*
|
|
586
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
587
|
-
* you may not use this file except in compliance with the License.
|
|
588
|
-
* You may obtain a copy of the License at
|
|
589
|
-
*
|
|
590
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
591
|
-
*
|
|
592
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
593
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
594
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
595
|
-
* See the License for the specific language governing permissions and
|
|
596
|
-
* limitations under the License.
|
|
597
|
-
*/const XI=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],ZI=new Ol(3e4,6e4);function am(e,t){return e.tenantId&&!t.tenantId?{...t,tenantId:e.tenantId}:t}async function Ks(e,t,r,a,o={}){return WE(e,o,async()=>{let c={},u={};a&&(t==="GET"?u=a:c={body:JSON.stringify(a)});const f=Cl({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 m={method:t,headers:h,...c};return v3()||(m.referrerPolicy="no-referrer"),e.emulatorConfig&&$u(e.emulatorConfig.host)&&(m.credentials="include"),YE.fetch()(await XE(e,e.config.apiHost,r,f),m)})}async function WE(e,t,r){e._canInitEmulator=!1;const a={...WI,...t};try{const o=new QI(e),c=await Promise.race([r(),o.promise]);o.clearNetworkTimeout();const u=await c.json();if("needConfirmation"in u)throw lu(e,"account-exists-with-different-credential",u);if(c.ok&&!("errorMessage"in u))return u;{const f=c.ok?u.errorMessage:u.error.message,[h,m]=f.split(" : ");if(h==="FEDERATED_USER_ID_ALREADY_LINKED")throw lu(e,"credential-already-in-use",u);if(h==="EMAIL_EXISTS")throw lu(e,"email-already-in-use",u);if(h==="USER_DISABLED")throw lu(e,"user-disabled",u);const b=a[h]||h.toLowerCase().replace(/[_\s]+/g,"-");if(m)throw nm(e,b,m);Mr(e,b)}}catch(o){if(o instanceof Wi)throw o;Mr(e,"network-request-failed",{message:String(o)})}}async function JI(e,t,r,a,o={}){const c=await Ks(e,t,r,a,o);return"mfaPendingCredential"in c&&Mr(e,"multi-factor-auth-required",{_serverResponse:c}),c}async function XE(e,t,r,a){const o=`${t}${r}?${a}`,c=e,u=c.config.emulator?im(e.config,o):`${e.config.apiScheme}://${o}`;return XI.includes(r)&&(await c._persistenceManagerAvailable,c._getPersistenceType()==="COOKIE")?c._getPersistence()._getFinalTarget(u).toString():u}class QI{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(t){this.auth=t,this.timer=null,this.promise=new Promise((r,a)=>{this.timer=setTimeout(()=>a(br(this.auth,"network-request-failed")),ZI.get())})}}function lu(e,t,r){const a={appName:e.name};r.email&&(a.email=r.email),r.phoneNumber&&(a.phoneNumber=r.phoneNumber);const o=br(e,t,a);return o.customData._tokenResponse=r,o}/**
|
|
598
|
-
* @license
|
|
599
|
-
* Copyright 2020 Google LLC
|
|
600
|
-
*
|
|
601
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
602
|
-
* you may not use this file except in compliance with the License.
|
|
603
|
-
* You may obtain a copy of the License at
|
|
604
|
-
*
|
|
605
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
606
|
-
*
|
|
607
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
608
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
609
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
610
|
-
* See the License for the specific language governing permissions and
|
|
611
|
-
* limitations under the License.
|
|
612
|
-
*/async function e4(e,t){return Ks(e,"POST","/v1/accounts:delete",t)}async function Mu(e,t){return Ks(e,"POST","/v1/accounts:lookup",t)}/**
|
|
613
|
-
* @license
|
|
614
|
-
* Copyright 2020 Google LLC
|
|
615
|
-
*
|
|
616
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
617
|
-
* you may not use this file except in compliance with the License.
|
|
618
|
-
* You may obtain a copy of the License at
|
|
619
|
-
*
|
|
620
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
621
|
-
*
|
|
622
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
623
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
624
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
625
|
-
* See the License for the specific language governing permissions and
|
|
626
|
-
* limitations under the License.
|
|
627
|
-
*/function ll(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch{}}async function t4(e,t=!1){const r=Ra(e),a=await r.getIdToken(t),o=sm(a);Ue(o&&o.exp&&o.auth_time&&o.iat,r.auth,"internal-error");const c=typeof o.firebase=="object"?o.firebase:void 0,u=c==null?void 0:c.sign_in_provider;return{claims:o,token:a,authTime:ll(jh(o.auth_time)),issuedAtTime:ll(jh(o.iat)),expirationTime:ll(jh(o.exp)),signInProvider:u||null,signInSecondFactor:(c==null?void 0:c.sign_in_second_factor)||null}}function jh(e){return Number(e)*1e3}function sm(e){const[t,r,a]=e.split(".");if(t===void 0||r===void 0||a===void 0)return pu("JWT malformed, contained fewer than 3 sections"),null;try{const o=zE(r);return o?JSON.parse(o):(pu("Failed to decode base64 JWT payload"),null)}catch(o){return pu("Caught error parsing JWT payload as JSON",o==null?void 0:o.toString()),null}}function e1(e){const t=sm(e);return Ue(t,"internal-error"),Ue(typeof t.exp<"u","internal-error"),Ue(typeof t.iat<"u","internal-error"),Number(t.exp)-Number(t.iat)}/**
|
|
628
|
-
* @license
|
|
629
|
-
* Copyright 2020 Google LLC
|
|
630
|
-
*
|
|
631
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
632
|
-
* you may not use this file except in compliance with the License.
|
|
633
|
-
* You may obtain a copy of the License at
|
|
634
|
-
*
|
|
635
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
636
|
-
*
|
|
637
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
638
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
639
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
640
|
-
* See the License for the specific language governing permissions and
|
|
641
|
-
* limitations under the License.
|
|
642
|
-
*/async function xl(e,t,r=!1){if(r)return t;try{return await t}catch(a){throw a instanceof Wi&&n4(a)&&e.auth.currentUser===e&&await e.auth.signOut(),a}}function n4({code:e}){return e==="auth/user-disabled"||e==="auth/user-token-expired"}/**
|
|
643
|
-
* @license
|
|
644
|
-
* Copyright 2020 Google LLC
|
|
645
|
-
*
|
|
646
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
647
|
-
* you may not use this file except in compliance with the License.
|
|
648
|
-
* You may obtain a copy of the License at
|
|
649
|
-
*
|
|
650
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
651
|
-
*
|
|
652
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
653
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
654
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
655
|
-
* See the License for the specific language governing permissions and
|
|
656
|
-
* limitations under the License.
|
|
657
|
-
*/class r4{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()}}/**
|
|
658
|
-
* @license
|
|
659
|
-
* Copyright 2020 Google LLC
|
|
660
|
-
*
|
|
661
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
662
|
-
* you may not use this file except in compliance with the License.
|
|
663
|
-
* You may obtain a copy of the License at
|
|
664
|
-
*
|
|
665
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
666
|
-
*
|
|
667
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
668
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
669
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
670
|
-
* See the License for the specific language governing permissions and
|
|
671
|
-
* limitations under the License.
|
|
672
|
-
*/class bp{constructor(t,r){this.createdAt=t,this.lastLoginAt=r,this._initializeTime()}_initializeTime(){this.lastSignInTime=ll(this.lastLoginAt),this.creationTime=ll(this.createdAt)}_copy(t){this.createdAt=t.createdAt,this.lastLoginAt=t.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
|
|
673
|
-
* @license
|
|
674
|
-
* Copyright 2019 Google LLC
|
|
675
|
-
*
|
|
676
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
677
|
-
* you may not use this file except in compliance with the License.
|
|
678
|
-
* You may obtain a copy of the License at
|
|
679
|
-
*
|
|
680
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
681
|
-
*
|
|
682
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
683
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
684
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
685
|
-
* See the License for the specific language governing permissions and
|
|
686
|
-
* limitations under the License.
|
|
687
|
-
*/async function Ru(e){var y;const t=e.auth,r=await e.getIdToken(),a=await xl(e,Mu(t,{idToken:r}));Ue(a==null?void 0:a.users.length,t,"internal-error");const o=a.users[0];e._notifyReloadListener(o);const c=(y=o.providerUserInfo)!=null&&y.length?ZE(o.providerUserInfo):[],u=a4(e.providerData,c),f=e.isAnonymous,h=!(e.email&&o.passwordHash)&&!(u!=null&&u.length),m=f?h:!1,b={uid:o.localId,displayName:o.displayName||null,photoURL:o.photoUrl||null,email:o.email||null,emailVerified:o.emailVerified||!1,phoneNumber:o.phoneNumber||null,tenantId:o.tenantId||null,providerData:u,metadata:new bp(o.createdAt,o.lastLoginAt),isAnonymous:m};Object.assign(e,b)}async function i4(e){const t=Ra(e);await Ru(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}function a4(e,t){return[...e.filter(a=>!t.some(o=>o.providerId===a.providerId)),...t]}function ZE(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}))}/**
|
|
688
|
-
* @license
|
|
689
|
-
* Copyright 2020 Google LLC
|
|
690
|
-
*
|
|
691
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
692
|
-
* you may not use this file except in compliance with the License.
|
|
693
|
-
* You may obtain a copy of the License at
|
|
694
|
-
*
|
|
695
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
696
|
-
*
|
|
697
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
698
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
699
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
700
|
-
* See the License for the specific language governing permissions and
|
|
701
|
-
* limitations under the License.
|
|
702
|
-
*/async function s4(e,t){const r=await WE(e,{},async()=>{const a=Cl({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:o,apiKey:c}=e.config,u=await XE(e,o,"/v1/token",`key=${c}`),f=await e._getAdditionalHeaders();f["Content-Type"]="application/x-www-form-urlencoded";const h={method:"POST",headers:f,body:a};return e.emulatorConfig&&$u(e.emulatorConfig.host)&&(h.credentials="include"),YE.fetch()(u,h)});return{accessToken:r.access_token,expiresIn:r.expires_in,refreshToken:r.refresh_token}}async function o4(e,t){return Ks(e,"POST","/v2/accounts:revokeToken",am(e,t))}/**
|
|
703
|
-
* @license
|
|
704
|
-
* Copyright 2020 Google LLC
|
|
705
|
-
*
|
|
706
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
707
|
-
* you may not use this file except in compliance with the License.
|
|
708
|
-
* You may obtain a copy of the License at
|
|
709
|
-
*
|
|
710
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
711
|
-
*
|
|
712
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
713
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
714
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
715
|
-
* See the License for the specific language governing permissions and
|
|
716
|
-
* limitations under the License.
|
|
717
|
-
*/class Is{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(t){Ue(t.idToken,"internal-error"),Ue(typeof t.idToken<"u","internal-error"),Ue(typeof t.refreshToken<"u","internal-error");const r="expiresIn"in t&&typeof t.expiresIn<"u"?Number(t.expiresIn):e1(t.idToken);this.updateTokensAndExpiration(t.idToken,t.refreshToken,r)}updateFromIdToken(t){Ue(t.length!==0,"internal-error");const r=e1(t);this.updateTokensAndExpiration(t,null,r)}async getToken(t,r=!1){return!r&&this.accessToken&&!this.isExpired?this.accessToken:(Ue(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:o,expiresIn:c}=await s4(t,r);this.updateTokensAndExpiration(a,o,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:o,expirationTime:c}=r,u=new Is;return a&&(Ue(typeof a=="string","internal-error",{appName:t}),u.refreshToken=a),o&&(Ue(typeof o=="string","internal-error",{appName:t}),u.accessToken=o),c&&(Ue(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 Is,this.toJSON())}_performRefresh(){return ni("not implemented")}}/**
|
|
718
|
-
* @license
|
|
719
|
-
* Copyright 2020 Google LLC
|
|
720
|
-
*
|
|
721
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
722
|
-
* you may not use this file except in compliance with the License.
|
|
723
|
-
* You may obtain a copy of the License at
|
|
724
|
-
*
|
|
725
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
726
|
-
*
|
|
727
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
728
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
729
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
730
|
-
* See the License for the specific language governing permissions and
|
|
731
|
-
* limitations under the License.
|
|
732
|
-
*/function Hi(e,t){Ue(typeof e=="string"||typeof e>"u","internal-error",{appName:t})}class mr{constructor({uid:t,auth:r,stsTokenManager:a,...o}){this.providerId="firebase",this.proactiveRefresh=new r4(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=r,this.stsTokenManager=a,this.accessToken=a.accessToken,this.displayName=o.displayName||null,this.email=o.email||null,this.emailVerified=o.emailVerified||!1,this.phoneNumber=o.phoneNumber||null,this.photoURL=o.photoURL||null,this.isAnonymous=o.isAnonymous||!1,this.tenantId=o.tenantId||null,this.providerData=o.providerData?[...o.providerData]:[],this.metadata=new bp(o.createdAt||void 0,o.lastLoginAt||void 0)}async getIdToken(t){const r=await xl(this,this.stsTokenManager.getToken(this.auth,t));return Ue(r,this.auth,"internal-error"),this.accessToken!==r&&(this.accessToken=r,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),r}getIdTokenResult(t){return t4(this,t)}reload(){return i4(this)}_assign(t){this!==t&&(Ue(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 mr({...this,auth:t,stsTokenManager:this.stsTokenManager._clone()});return r.metadata._copy(this.metadata),r}_onReload(t){Ue(!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 Ru(this),await this.auth._persistUserIfCurrent(this),a&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(Ar(this.auth.app))return Promise.reject(wa(this.auth));const t=await this.getIdToken();return await xl(this,e4(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,o=r.email??void 0,c=r.phoneNumber??void 0,u=r.photoURL??void 0,f=r.tenantId??void 0,h=r._redirectEventId??void 0,m=r.createdAt??void 0,b=r.lastLoginAt??void 0,{uid:y,emailVerified:v,isAnonymous:x,providerData:S,stsTokenManager:_}=r;Ue(y&&_,t,"internal-error");const N=Is.fromJSON(this.name,_);Ue(typeof y=="string",t,"internal-error"),Hi(a,t.name),Hi(o,t.name),Ue(typeof v=="boolean",t,"internal-error"),Ue(typeof x=="boolean",t,"internal-error"),Hi(c,t.name),Hi(u,t.name),Hi(f,t.name),Hi(h,t.name),Hi(m,t.name),Hi(b,t.name);const T=new mr({uid:y,auth:t,email:o,emailVerified:v,displayName:a,isAnonymous:x,photoURL:u,phoneNumber:c,tenantId:f,stsTokenManager:N,createdAt:m,lastLoginAt:b});return S&&Array.isArray(S)&&(T.providerData=S.map(O=>({...O}))),h&&(T._redirectEventId=h),T}static async _fromIdTokenResponse(t,r,a=!1){const o=new Is;o.updateFromServerResponse(r);const c=new mr({uid:r.localId,auth:t,stsTokenManager:o,isAnonymous:a});return await Ru(c),c}static async _fromGetAccountInfoResponse(t,r,a){const o=r.users[0];Ue(o.localId!==void 0,"internal-error");const c=o.providerUserInfo!==void 0?ZE(o.providerUserInfo):[],u=!(o.email&&o.passwordHash)&&!(c!=null&&c.length),f=new Is;f.updateFromIdToken(a);const h=new mr({uid:o.localId,auth:t,stsTokenManager:f,isAnonymous:u}),m={uid:o.localId,displayName:o.displayName||null,photoURL:o.photoUrl||null,email:o.email||null,emailVerified:o.emailVerified||!1,phoneNumber:o.phoneNumber||null,tenantId:o.tenantId||null,providerData:c,metadata:new bp(o.createdAt,o.lastLoginAt),isAnonymous:!(o.email&&o.passwordHash)&&!(c!=null&&c.length)};return Object.assign(h,m),h}}/**
|
|
733
|
-
* @license
|
|
734
|
-
* Copyright 2020 Google LLC
|
|
735
|
-
*
|
|
736
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
737
|
-
* you may not use this file except in compliance with the License.
|
|
738
|
-
* You may obtain a copy of the License at
|
|
739
|
-
*
|
|
740
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
741
|
-
*
|
|
742
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
743
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
744
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
745
|
-
* See the License for the specific language governing permissions and
|
|
746
|
-
* limitations under the License.
|
|
747
|
-
*/const t1=new Map;function ri(e){li(e instanceof Function,"Expected a class definition");let t=t1.get(e);return t?(li(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,t1.set(e,t),t)}/**
|
|
748
|
-
* @license
|
|
749
|
-
* Copyright 2019 Google LLC
|
|
750
|
-
*
|
|
751
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
752
|
-
* you may not use this file except in compliance with the License.
|
|
753
|
-
* You may obtain a copy of the License at
|
|
754
|
-
*
|
|
755
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
756
|
-
*
|
|
757
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
758
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
759
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
760
|
-
* See the License for the specific language governing permissions and
|
|
761
|
-
* limitations under the License.
|
|
762
|
-
*/class JE{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){}}JE.type="NONE";const yp=JE;/**
|
|
763
|
-
* @license
|
|
764
|
-
* Copyright 2019 Google LLC
|
|
765
|
-
*
|
|
766
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
767
|
-
* you may not use this file except in compliance with the License.
|
|
768
|
-
* You may obtain a copy of the License at
|
|
769
|
-
*
|
|
770
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
771
|
-
*
|
|
772
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
773
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
774
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
775
|
-
* See the License for the specific language governing permissions and
|
|
776
|
-
* limitations under the License.
|
|
777
|
-
*/function mu(e,t,r){return`firebase:${e}:${t}:${r}`}class Ls{constructor(t,r,a){this.persistence=t,this.auth=r,this.userKey=a;const{config:o,name:c}=this.auth;this.fullUserKey=mu(this.userKey,o.apiKey,c),this.fullPersistenceKey=mu("persistence",o.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 Mu(this.auth,{idToken:t}).catch(()=>{});return r?mr._fromGetAccountInfoResponse(this.auth,r,t):null}return mr._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 Ls(ri(yp),t,a);const o=(await Promise.all(r.map(async m=>{if(await m._isAvailable())return m}))).filter(m=>m);let c=o[0]||ri(yp);const u=mu(a,t.config.apiKey,t.name);let f=null;for(const m of r)try{const b=await m._get(u);if(b){let y;if(typeof b=="string"){const v=await Mu(t,{idToken:b}).catch(()=>{});if(!v)break;y=await mr._fromGetAccountInfoResponse(t,v,b)}else y=mr._fromJSON(t,b);m!==c&&(f=y),c=m;break}}catch{}const h=o.filter(m=>m._shouldAllowMigration);return!c._shouldAllowMigration||!h.length?new Ls(c,t,a):(c=h[0],f&&await c._set(u,f.toJSON()),await Promise.all(r.map(async m=>{if(m!==c)try{await m._remove(u)}catch{}})),new Ls(c,t,a))}}/**
|
|
778
|
-
* @license
|
|
779
|
-
* Copyright 2020 Google LLC
|
|
780
|
-
*
|
|
781
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
782
|
-
* you may not use this file except in compliance with the License.
|
|
783
|
-
* You may obtain a copy of the License at
|
|
784
|
-
*
|
|
785
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
786
|
-
*
|
|
787
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
788
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
789
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
790
|
-
* See the License for the specific language governing permissions and
|
|
791
|
-
* limitations under the License.
|
|
792
|
-
*/function n1(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(nS(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(QE(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(iS(t))return"Blackberry";if(aS(t))return"Webos";if(eS(t))return"Safari";if((t.includes("chrome/")||tS(t))&&!t.includes("edge/"))return"Chrome";if(rS(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 QE(e=kn()){return/firefox\//i.test(e)}function eS(e=kn()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function tS(e=kn()){return/crios\//i.test(e)}function nS(e=kn()){return/iemobile/i.test(e)}function rS(e=kn()){return/android/i.test(e)}function iS(e=kn()){return/blackberry/i.test(e)}function aS(e=kn()){return/webos/i.test(e)}function om(e=kn()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function l4(e=kn()){var t;return om(e)&&!!((t=window.navigator)!=null&&t.standalone)}function c4(){return S3()&&document.documentMode===10}function sS(e=kn()){return om(e)||rS(e)||aS(e)||iS(e)||/windows phone/i.test(e)||nS(e)}/**
|
|
793
|
-
* @license
|
|
794
|
-
* Copyright 2020 Google LLC
|
|
795
|
-
*
|
|
796
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
797
|
-
* you may not use this file except in compliance with the License.
|
|
798
|
-
* You may obtain a copy of the License at
|
|
799
|
-
*
|
|
800
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
801
|
-
*
|
|
802
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
803
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
804
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
805
|
-
* See the License for the specific language governing permissions and
|
|
806
|
-
* limitations under the License.
|
|
807
|
-
*/function oS(e,t=[]){let r;switch(e){case"Browser":r=n1(kn());break;case"Worker":r=`${n1(kn())}-${e}`;break;default:r=e}const a=t.length?t.join(","):"FirebaseCore-web";return`${r}/JsCore/${Al}/${a}`}/**
|
|
808
|
-
* @license
|
|
809
|
-
* Copyright 2022 Google LLC
|
|
810
|
-
*
|
|
811
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
812
|
-
* you may not use this file except in compliance with the License.
|
|
813
|
-
* You may obtain a copy of the License at
|
|
814
|
-
*
|
|
815
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
816
|
-
*
|
|
817
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
818
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
819
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
820
|
-
* See the License for the specific language governing permissions and
|
|
821
|
-
* limitations under the License.
|
|
822
|
-
*/class u4{constructor(t){this.auth=t,this.queue=[]}pushCallback(t,r){const a=c=>new Promise((u,f)=>{try{const h=t(c);u(h)}catch(h){f(h)}});a.onAbort=r,this.queue.push(a);const o=this.queue.length-1;return()=>{this.queue[o]=()=>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 o of r)try{o()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:a==null?void 0:a.message})}}}/**
|
|
823
|
-
* @license
|
|
824
|
-
* Copyright 2023 Google LLC
|
|
825
|
-
*
|
|
826
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
827
|
-
* you may not use this file except in compliance with the License.
|
|
828
|
-
* You may obtain a copy of the License at
|
|
829
|
-
*
|
|
830
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
831
|
-
*
|
|
832
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
833
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
834
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
835
|
-
* See the License for the specific language governing permissions and
|
|
836
|
-
* limitations under the License.
|
|
837
|
-
*/async function d4(e,t={}){return Ks(e,"GET","/v2/passwordPolicy",am(e,t))}/**
|
|
838
|
-
* @license
|
|
839
|
-
* Copyright 2023 Google LLC
|
|
840
|
-
*
|
|
841
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
842
|
-
* you may not use this file except in compliance with the License.
|
|
843
|
-
* You may obtain a copy of the License at
|
|
844
|
-
*
|
|
845
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
846
|
-
*
|
|
847
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
848
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
849
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
850
|
-
* See the License for the specific language governing permissions and
|
|
851
|
-
* limitations under the License.
|
|
852
|
-
*/const f4=6;class h4{constructor(t){var a;const r=t.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=r.minPasswordLength??f4,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,o=this.customStrengthOptions.maxPasswordLength;a&&(r.meetsMinPasswordLength=t.length>=a),o&&(r.meetsMaxPasswordLength=t.length<=o)}validatePasswordCharacterOptions(t,r){this.updatePasswordCharacterOptionsStatuses(r,!1,!1,!1,!1);let a;for(let o=0;o<t.length;o++)a=t.charAt(o),this.updatePasswordCharacterOptionsStatuses(r,a>="a"&&a<="z",a>="A"&&a<="Z",a>="0"&&a<="9",this.allowedNonAlphanumericCharacters.includes(a))}updatePasswordCharacterOptionsStatuses(t,r,a,o,c){this.customStrengthOptions.containsLowercaseLetter&&(t.containsLowercaseLetter||(t.containsLowercaseLetter=r)),this.customStrengthOptions.containsUppercaseLetter&&(t.containsUppercaseLetter||(t.containsUppercaseLetter=a)),this.customStrengthOptions.containsNumericCharacter&&(t.containsNumericCharacter||(t.containsNumericCharacter=o)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(t.containsNonAlphanumericCharacter||(t.containsNonAlphanumericCharacter=c))}}/**
|
|
853
|
-
* @license
|
|
854
|
-
* Copyright 2020 Google LLC
|
|
855
|
-
*
|
|
856
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
857
|
-
* you may not use this file except in compliance with the License.
|
|
858
|
-
* You may obtain a copy of the License at
|
|
859
|
-
*
|
|
860
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
861
|
-
*
|
|
862
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
863
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
864
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
865
|
-
* See the License for the specific language governing permissions and
|
|
866
|
-
* limitations under the License.
|
|
867
|
-
*/class p4{constructor(t,r,a,o){this.app=t,this.heartbeatServiceProvider=r,this.appCheckServiceProvider=a,this.config=o,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new r1(this),this.idTokenSubscription=new r1(this),this.beforeStateQueue=new u4(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=qE,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=o.sdkClientVersion,this._persistenceManagerAvailable=new Promise(c=>this._resolvePersistenceManagerAvailable=c)}_initializeWithPersistence(t,r){return r&&(this._popupRedirectResolver=ri(r)),this._initializationPromise=this.queue(async()=>{var a,o,c;if(!this._deleted&&(this.persistenceManager=await Ls.create(this,t),(a=this._resolvePersistenceManagerAvailable)==null||a.call(this),!this._deleted)){if((o=this._popupRedirectResolver)!=null&&o._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 Mu(this,{idToken:t}),a=await mr._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(Ar(this.app)){const u=this.app.settings.authIdToken;return u?new Promise(f=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(u).then(f,f))}):this.directlySetCurrentUser(null)}const r=await this.assertedPersistence.getCurrentUser();let a=r,o=!1;if(t&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const u=(c=this.redirectUser)==null?void 0:c._redirectEventId,f=a==null?void 0:a._redirectEventId,h=await this.tryRedirectSignIn(t);(!u||u===f)&&(h!=null&&h.user)&&(a=h.user,o=!0)}if(!a)return this.directlySetCurrentUser(null);if(!a._redirectEventId){if(o)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 Ue(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 Ru(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=YI()}async _delete(){this._deleted=!0}async updateCurrentUser(t){if(Ar(this.app))return Promise.reject(wa(this));const r=t?Ra(t):null;return r&&Ue(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&&Ue(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 Ar(this.app)?Promise.reject(wa(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(t){return Ar(this.app)?Promise.reject(wa(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(ri(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 d4(this),r=new h4(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 Nl("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 o4(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&&ri(t)||this._popupRedirectResolver;Ue(r,this,"argument-error"),this.redirectPersistenceManager=await Ls.create(this,[ri(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,o){if(this._deleted)return()=>{};const c=typeof r=="function"?r:r.next.bind(r);let u=!1;const f=this._isInitialized?Promise.resolve():this._initializationPromise;if(Ue(f,this,"internal-error"),f.then(()=>{u||c(this.currentUser)}),typeof r=="function"){const h=t.addObserver(r,a,o);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 Ue(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(t){!t||this.frameworks.includes(t)||(this.frameworks.push(t),this.frameworks.sort(),this.clientVersion=oS(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var o;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const r=await((o=this.heartbeatServiceProvider.getImmediate({optional:!0}))==null?void 0:o.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(Ar(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&&GI(`Error while retrieving App Check token: ${t.error}`),t==null?void 0:t.token}}function Gu(e){return Ra(e)}class r1{constructor(t){this.auth=t,this.observer=null,this.addObserver=A3(r=>this.observer=r)}get next(){return Ue(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
|
|
868
|
-
* @license
|
|
869
|
-
* Copyright 2020 Google LLC
|
|
870
|
-
*
|
|
871
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
872
|
-
* you may not use this file except in compliance with the License.
|
|
873
|
-
* You may obtain a copy of the License at
|
|
874
|
-
*
|
|
875
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
876
|
-
*
|
|
877
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
878
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
879
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
880
|
-
* See the License for the specific language governing permissions and
|
|
881
|
-
* limitations under the License.
|
|
882
|
-
*/let lm={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function m4(e){lm=e}function g4(e){return lm.loadJS(e)}function b4(){return lm.gapiScript}function y4(e){return`__${e}${Math.floor(Math.random()*1e6)}`}/**
|
|
883
|
-
* @license
|
|
884
|
-
* Copyright 2020 Google LLC
|
|
885
|
-
*
|
|
886
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
887
|
-
* you may not use this file except in compliance with the License.
|
|
888
|
-
* You may obtain a copy of the License at
|
|
889
|
-
*
|
|
890
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
891
|
-
*
|
|
892
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
893
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
894
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
895
|
-
* See the License for the specific language governing permissions and
|
|
896
|
-
* limitations under the License.
|
|
897
|
-
*/function v4(e,t){const r=$E(e,"auth");if(r.isInitialized()){const o=r.getImmediate(),c=r.getOptions();if(Us(c,t??{}))return o;Mr(o,"already-initialized")}return r.initialize({options:t})}function x4(e,t){const r=(t==null?void 0:t.persistence)||[],a=(Array.isArray(r)?r:[r]).map(ri);t!=null&&t.errorMap&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(a,t==null?void 0:t.popupRedirectResolver)}function E4(e,t,r){const a=Gu(e);Ue(/^https?:\/\//.test(t),a,"invalid-emulator-scheme");const o=!1,c=lS(t),{host:u,port:f}=S4(t),h=f===null?"":`:${f}`,m={url:`${c}//${u}${h}/`},b=Object.freeze({host:u,port:f,protocol:c.replace(":",""),options:Object.freeze({disableWarnings:o})});if(!a._canInitEmulator){Ue(a.config.emulator&&a.emulatorConfig,a,"emulator-config-failed"),Ue(Us(m,a.config.emulator)&&Us(b,a.emulatorConfig),a,"emulator-config-failed");return}a.config.emulator=m,a.emulatorConfig=b,a.settings.appVerificationDisabledForTesting=!0,$u(u)?(p3(`${c}//${u}${h}`),b3("Auth",!0)):_4()}function lS(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function S4(e){const t=lS(e),r=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!r)return{host:"",port:null};const a=r[2].split("@").pop()||"",o=/^(\[[^\]]+\])(:|$)/.exec(a);if(o){const c=o[1];return{host:c,port:i1(a.substr(c.length+1))}}else{const[c,u]=a.split(":");return{host:c,port:i1(u)}}}function i1(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}function _4(){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())}/**
|
|
898
|
-
* @license
|
|
899
|
-
* Copyright 2020 Google LLC
|
|
900
|
-
*
|
|
901
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
902
|
-
* you may not use this file except in compliance with the License.
|
|
903
|
-
* You may obtain a copy of the License at
|
|
904
|
-
*
|
|
905
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
906
|
-
*
|
|
907
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
908
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
909
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
910
|
-
* See the License for the specific language governing permissions and
|
|
911
|
-
* limitations under the License.
|
|
912
|
-
*/class cS{constructor(t,r){this.providerId=t,this.signInMethod=r}toJSON(){return ni("not implemented")}_getIdTokenResponse(t){return ni("not implemented")}_linkToIdToken(t,r){return ni("not implemented")}_getReauthenticationResolver(t){return ni("not implemented")}}/**
|
|
913
|
-
* @license
|
|
914
|
-
* Copyright 2020 Google LLC
|
|
915
|
-
*
|
|
916
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
917
|
-
* you may not use this file except in compliance with the License.
|
|
918
|
-
* You may obtain a copy of the License at
|
|
919
|
-
*
|
|
920
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
921
|
-
*
|
|
922
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
923
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
924
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
925
|
-
* See the License for the specific language governing permissions and
|
|
926
|
-
* limitations under the License.
|
|
927
|
-
*/async function Ds(e,t){return JI(e,"POST","/v1/accounts:signInWithIdp",am(e,t))}/**
|
|
928
|
-
* @license
|
|
929
|
-
* Copyright 2020 Google LLC
|
|
930
|
-
*
|
|
931
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
932
|
-
* you may not use this file except in compliance with the License.
|
|
933
|
-
* You may obtain a copy of the License at
|
|
934
|
-
*
|
|
935
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
936
|
-
*
|
|
937
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
938
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
939
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
940
|
-
* See the License for the specific language governing permissions and
|
|
941
|
-
* limitations under the License.
|
|
942
|
-
*/const w4="http://localhost";class ci extends cS{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(t){const r=new ci(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):Mr("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:o,...c}=r;if(!a||!o)return null;const u=new ci(a,o);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 Ds(t,r)}_linkToIdToken(t,r){const a=this.buildRequest();return a.idToken=r,Ds(t,a)}_getReauthenticationResolver(t){const r=this.buildRequest();return r.autoCreate=!1,Ds(t,r)}buildRequest(){const t={requestUri:w4,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=Cl(r)}return t}}/**
|
|
943
|
-
* @license
|
|
944
|
-
* Copyright 2020 Google LLC
|
|
945
|
-
*
|
|
946
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
947
|
-
* you may not use this file except in compliance with the License.
|
|
948
|
-
* You may obtain a copy of the License at
|
|
949
|
-
*
|
|
950
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
951
|
-
*
|
|
952
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
953
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
954
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
955
|
-
* See the License for the specific language governing permissions and
|
|
956
|
-
* limitations under the License.
|
|
957
|
-
*/class cm{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}}/**
|
|
958
|
-
* @license
|
|
959
|
-
* Copyright 2019 Google LLC
|
|
960
|
-
*
|
|
961
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
962
|
-
* you may not use this file except in compliance with the License.
|
|
963
|
-
* You may obtain a copy of the License at
|
|
964
|
-
*
|
|
965
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
966
|
-
*
|
|
967
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
968
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
969
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
970
|
-
* See the License for the specific language governing permissions and
|
|
971
|
-
* limitations under the License.
|
|
972
|
-
*/class Vs extends cm{constructor(){super(...arguments),this.scopes=[]}addScope(t){return this.scopes.includes(t)||this.scopes.push(t),this}getScopes(){return[...this.scopes]}}class cl extends Vs{static credentialFromJSON(t){const r=typeof t=="string"?JSON.parse(t):t;return Ue("providerId"in r&&"signInMethod"in r,"argument-error"),ci._fromParams(r)}credential(t){return this._credential({...t,nonce:t.rawNonce})}_credential(t){return Ue(t.idToken||t.accessToken,"argument-error"),ci._fromParams({...t,providerId:this.providerId,signInMethod:this.providerId})}static credentialFromResult(t){return cl.oauthCredentialFromTaggedObject(t)}static credentialFromError(t){return cl.oauthCredentialFromTaggedObject(t.customData||{})}static oauthCredentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthIdToken:r,oauthAccessToken:a,oauthTokenSecret:o,pendingToken:c,nonce:u,providerId:f}=t;if(!a&&!o&&!r&&!c||!f)return null;try{return new cl(f)._credential({idToken:r,accessToken:a,nonce:u,pendingToken:c})}catch{return null}}}/**
|
|
973
|
-
* @license
|
|
974
|
-
* Copyright 2020 Google LLC
|
|
975
|
-
*
|
|
976
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
977
|
-
* you may not use this file except in compliance with the License.
|
|
978
|
-
* You may obtain a copy of the License at
|
|
979
|
-
*
|
|
980
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
981
|
-
*
|
|
982
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
983
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
984
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
985
|
-
* See the License for the specific language governing permissions and
|
|
986
|
-
* limitations under the License.
|
|
987
|
-
*/class $i extends Vs{constructor(){super("facebook.com")}static credential(t){return ci._fromParams({providerId:$i.PROVIDER_ID,signInMethod:$i.FACEBOOK_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return $i.credentialFromTaggedObject(t)}static credentialFromError(t){return $i.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return $i.credential(t.oauthAccessToken)}catch{return null}}}$i.FACEBOOK_SIGN_IN_METHOD="facebook.com";$i.PROVIDER_ID="facebook.com";/**
|
|
988
|
-
* @license
|
|
989
|
-
* Copyright 2020 Google LLC
|
|
990
|
-
*
|
|
991
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
992
|
-
* you may not use this file except in compliance with the License.
|
|
993
|
-
* You may obtain a copy of the License at
|
|
994
|
-
*
|
|
995
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
996
|
-
*
|
|
997
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
998
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
999
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1000
|
-
* See the License for the specific language governing permissions and
|
|
1001
|
-
* limitations under the License.
|
|
1002
|
-
*/class ei extends Vs{constructor(){super("google.com"),this.addScope("profile")}static credential(t,r){return ci._fromParams({providerId:ei.PROVIDER_ID,signInMethod:ei.GOOGLE_SIGN_IN_METHOD,idToken:t,accessToken:r})}static credentialFromResult(t){return ei.credentialFromTaggedObject(t)}static credentialFromError(t){return ei.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthIdToken:r,oauthAccessToken:a}=t;if(!r&&!a)return null;try{return ei.credential(r,a)}catch{return null}}}ei.GOOGLE_SIGN_IN_METHOD="google.com";ei.PROVIDER_ID="google.com";/**
|
|
1003
|
-
* @license
|
|
1004
|
-
* Copyright 2020 Google LLC
|
|
1005
|
-
*
|
|
1006
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1007
|
-
* you may not use this file except in compliance with the License.
|
|
1008
|
-
* You may obtain a copy of the License at
|
|
1009
|
-
*
|
|
1010
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1011
|
-
*
|
|
1012
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1013
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1014
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1015
|
-
* See the License for the specific language governing permissions and
|
|
1016
|
-
* limitations under the License.
|
|
1017
|
-
*/class ti extends Vs{constructor(){super("github.com")}static credential(t){return ci._fromParams({providerId:ti.PROVIDER_ID,signInMethod:ti.GITHUB_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return ti.credentialFromTaggedObject(t)}static credentialFromError(t){return ti.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return ti.credential(t.oauthAccessToken)}catch{return null}}}ti.GITHUB_SIGN_IN_METHOD="github.com";ti.PROVIDER_ID="github.com";/**
|
|
1018
|
-
* @license
|
|
1019
|
-
* Copyright 2020 Google LLC
|
|
1020
|
-
*
|
|
1021
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1022
|
-
* you may not use this file except in compliance with the License.
|
|
1023
|
-
* You may obtain a copy of the License at
|
|
1024
|
-
*
|
|
1025
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1026
|
-
*
|
|
1027
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1028
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1029
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1030
|
-
* See the License for the specific language governing permissions and
|
|
1031
|
-
* limitations under the License.
|
|
1032
|
-
*/class Gi extends Vs{constructor(){super("twitter.com")}static credential(t,r){return ci._fromParams({providerId:Gi.PROVIDER_ID,signInMethod:Gi.TWITTER_SIGN_IN_METHOD,oauthToken:t,oauthTokenSecret:r})}static credentialFromResult(t){return Gi.credentialFromTaggedObject(t)}static credentialFromError(t){return Gi.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthAccessToken:r,oauthTokenSecret:a}=t;if(!r||!a)return null;try{return Gi.credential(r,a)}catch{return null}}}Gi.TWITTER_SIGN_IN_METHOD="twitter.com";Gi.PROVIDER_ID="twitter.com";/**
|
|
1033
|
-
* @license
|
|
1034
|
-
* Copyright 2020 Google LLC
|
|
1035
|
-
*
|
|
1036
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1037
|
-
* you may not use this file except in compliance with the License.
|
|
1038
|
-
* You may obtain a copy of the License at
|
|
1039
|
-
*
|
|
1040
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1041
|
-
*
|
|
1042
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1043
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1044
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1045
|
-
* See the License for the specific language governing permissions and
|
|
1046
|
-
* limitations under the License.
|
|
1047
|
-
*/class Hs{constructor(t){this.user=t.user,this.providerId=t.providerId,this._tokenResponse=t._tokenResponse,this.operationType=t.operationType}static async _fromIdTokenResponse(t,r,a,o=!1){const c=await mr._fromIdTokenResponse(t,a,o),u=a1(a);return new Hs({user:c,providerId:u,_tokenResponse:a,operationType:r})}static async _forOperation(t,r,a){await t._updateTokensIfNecessary(a,!0);const o=a1(a);return new Hs({user:t,providerId:o,_tokenResponse:a,operationType:r})}}function a1(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}/**
|
|
1048
|
-
* @license
|
|
1049
|
-
* Copyright 2020 Google LLC
|
|
1050
|
-
*
|
|
1051
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1052
|
-
* you may not use this file except in compliance with the License.
|
|
1053
|
-
* You may obtain a copy of the License at
|
|
1054
|
-
*
|
|
1055
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1056
|
-
*
|
|
1057
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1058
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1059
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1060
|
-
* See the License for the specific language governing permissions and
|
|
1061
|
-
* limitations under the License.
|
|
1062
|
-
*/class Iu extends Wi{constructor(t,r,a,o){super(r.code,r.message),this.operationType=a,this.user=o,Object.setPrototypeOf(this,Iu.prototype),this.customData={appName:t.name,tenantId:t.tenantId??void 0,_serverResponse:r.customData._serverResponse,operationType:a}}static _fromErrorAndOperation(t,r,a,o){return new Iu(t,r,a,o)}}function uS(e,t,r,a){return(t==="reauthenticate"?r._getReauthenticationResolver(e):r._getIdTokenResponse(e)).catch(c=>{throw c.code==="auth/multi-factor-auth-required"?Iu._fromErrorAndOperation(e,c,t,a):c})}async function k4(e,t,r=!1){const a=await xl(e,t._linkToIdToken(e.auth,await e.getIdToken()),r);return Hs._forOperation(e,"link",a)}/**
|
|
1063
|
-
* @license
|
|
1064
|
-
* Copyright 2019 Google LLC
|
|
1065
|
-
*
|
|
1066
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1067
|
-
* you may not use this file except in compliance with the License.
|
|
1068
|
-
* You may obtain a copy of the License at
|
|
1069
|
-
*
|
|
1070
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1071
|
-
*
|
|
1072
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1073
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1074
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1075
|
-
* See the License for the specific language governing permissions and
|
|
1076
|
-
* limitations under the License.
|
|
1077
|
-
*/async function T4(e,t,r=!1){const{auth:a}=e;if(Ar(a.app))return Promise.reject(wa(a));const o="reauthenticate";try{const c=await xl(e,uS(a,o,t,e),r);Ue(c.idToken,a,"internal-error");const u=sm(c.idToken);Ue(u,a,"internal-error");const{sub:f}=u;return Ue(e.uid===f,a,"user-mismatch"),Hs._forOperation(e,o,c)}catch(c){throw(c==null?void 0:c.code)==="auth/user-not-found"&&Mr(a,"user-mismatch"),c}}/**
|
|
1078
|
-
* @license
|
|
1079
|
-
* Copyright 2020 Google LLC
|
|
1080
|
-
*
|
|
1081
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1082
|
-
* you may not use this file except in compliance with the License.
|
|
1083
|
-
* You may obtain a copy of the License at
|
|
1084
|
-
*
|
|
1085
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1086
|
-
*
|
|
1087
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1088
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1089
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1090
|
-
* See the License for the specific language governing permissions and
|
|
1091
|
-
* limitations under the License.
|
|
1092
|
-
*/async function N4(e,t,r=!1){if(Ar(e.app))return Promise.reject(wa(e));const a="signIn",o=await uS(e,a,t),c=await Hs._fromIdTokenResponse(e,a,o);return r||await e._updateCurrentUser(c.user),c}/**
|
|
1093
|
-
* @license
|
|
1094
|
-
* Copyright 2020 Google LLC
|
|
1095
|
-
*
|
|
1096
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1097
|
-
* you may not use this file except in compliance with the License.
|
|
1098
|
-
* You may obtain a copy of the License at
|
|
1099
|
-
*
|
|
1100
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1101
|
-
*
|
|
1102
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1103
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1104
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1105
|
-
* See the License for the specific language governing permissions and
|
|
1106
|
-
* limitations under the License.
|
|
1107
|
-
*/function C4(e,t){return Ra(e).setPersistence(t)}function A4(e,t,r,a){return Ra(e).onIdTokenChanged(t,r,a)}function O4(e,t,r){return Ra(e).beforeAuthStateChanged(t,r)}const Lu="__sak";/**
|
|
1108
|
-
* @license
|
|
1109
|
-
* Copyright 2019 Google LLC
|
|
1110
|
-
*
|
|
1111
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1112
|
-
* you may not use this file except in compliance with the License.
|
|
1113
|
-
* You may obtain a copy of the License at
|
|
1114
|
-
*
|
|
1115
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1116
|
-
*
|
|
1117
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1118
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1119
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1120
|
-
* See the License for the specific language governing permissions and
|
|
1121
|
-
* limitations under the License.
|
|
1122
|
-
*/class dS{constructor(t,r){this.storageRetriever=t,this.type=r}_isAvailable(){try{return this.storage?(this.storage.setItem(Lu,"1"),this.storage.removeItem(Lu),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()}}/**
|
|
1123
|
-
* @license
|
|
1124
|
-
* Copyright 2020 Google LLC
|
|
1125
|
-
*
|
|
1126
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1127
|
-
* you may not use this file except in compliance with the License.
|
|
1128
|
-
* You may obtain a copy of the License at
|
|
1129
|
-
*
|
|
1130
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1131
|
-
*
|
|
1132
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1133
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1134
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1135
|
-
* See the License for the specific language governing permissions and
|
|
1136
|
-
* limitations under the License.
|
|
1137
|
-
*/const M4=1e3,R4=10;class fS extends dS{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,r)=>this.onStorageEvent(t,r),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=sS(),this._shouldAllowMigration=!0}forAllChangedKeys(t){for(const r of Object.keys(this.listeners)){const a=this.storage.getItem(r),o=this.localCache[r];a!==o&&t(r,o,a)}}onStorageEvent(t,r=!1){if(!t.key){this.forAllChangedKeys((u,f,h)=>{this.notifyListeners(u,h)});return}const a=t.key;r?this.detachListener():this.stopPolling();const o=()=>{const u=this.storage.getItem(a);!r&&this.localCache[a]===u||this.notifyListeners(a,u)},c=this.storage.getItem(a);c4()&&c!==t.newValue&&t.newValue!==t.oldValue?setTimeout(o,R4):o()}notifyListeners(t,r){this.localCache[t]=r;const a=this.listeners[t];if(a)for(const o of Array.from(a))o(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)})},M4)}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]}}fS.type="LOCAL";const I4=fS;/**
|
|
1138
|
-
* @license
|
|
1139
|
-
* Copyright 2020 Google LLC
|
|
1140
|
-
*
|
|
1141
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1142
|
-
* you may not use this file except in compliance with the License.
|
|
1143
|
-
* You may obtain a copy of the License at
|
|
1144
|
-
*
|
|
1145
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1146
|
-
*
|
|
1147
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1148
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1149
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1150
|
-
* See the License for the specific language governing permissions and
|
|
1151
|
-
* limitations under the License.
|
|
1152
|
-
*/class hS extends dS{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(t,r){}_removeListener(t,r){}}hS.type="SESSION";const pS=hS;/**
|
|
1153
|
-
* @license
|
|
1154
|
-
* Copyright 2019 Google LLC
|
|
1155
|
-
*
|
|
1156
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1157
|
-
* you may not use this file except in compliance with the License.
|
|
1158
|
-
* You may obtain a copy of the License at
|
|
1159
|
-
*
|
|
1160
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1161
|
-
*
|
|
1162
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1163
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1164
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1165
|
-
* See the License for the specific language governing permissions and
|
|
1166
|
-
* limitations under the License.
|
|
1167
|
-
*/function L4(e){return Promise.all(e.map(async t=>{try{return{fulfilled:!0,value:await t}}catch(r){return{fulfilled:!1,reason:r}}}))}/**
|
|
1168
|
-
* @license
|
|
1169
|
-
* Copyright 2019 Google LLC
|
|
1170
|
-
*
|
|
1171
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1172
|
-
* you may not use this file except in compliance with the License.
|
|
1173
|
-
* You may obtain a copy of the License at
|
|
1174
|
-
*
|
|
1175
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1176
|
-
*
|
|
1177
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1178
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1179
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1180
|
-
* See the License for the specific language governing permissions and
|
|
1181
|
-
* limitations under the License.
|
|
1182
|
-
*/class Ku{constructor(t){this.eventTarget=t,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(t){const r=this.receivers.find(o=>o.isListeningto(t));if(r)return r;const a=new Ku(t);return this.receivers.push(a),a}isListeningto(t){return this.eventTarget===t}async handleEvent(t){const r=t,{eventId:a,eventType:o,data:c}=r.data,u=this.handlersMap[o];if(!(u!=null&&u.size))return;r.ports[0].postMessage({status:"ack",eventId:a,eventType:o});const f=Array.from(u).map(async m=>m(r.origin,c)),h=await L4(f);r.ports[0].postMessage({status:"done",eventId:a,eventType:o,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)}}Ku.receivers=[];/**
|
|
1183
|
-
* @license
|
|
1184
|
-
* Copyright 2020 Google LLC
|
|
1185
|
-
*
|
|
1186
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1187
|
-
* you may not use this file except in compliance with the License.
|
|
1188
|
-
* You may obtain a copy of the License at
|
|
1189
|
-
*
|
|
1190
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1191
|
-
*
|
|
1192
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1193
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1194
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1195
|
-
* See the License for the specific language governing permissions and
|
|
1196
|
-
* limitations under the License.
|
|
1197
|
-
*/function um(e="",t=10){let r="";for(let a=0;a<t;a++)r+=Math.floor(Math.random()*10);return e+r}/**
|
|
1198
|
-
* @license
|
|
1199
|
-
* Copyright 2019 Google LLC
|
|
1200
|
-
*
|
|
1201
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1202
|
-
* you may not use this file except in compliance with the License.
|
|
1203
|
-
* You may obtain a copy of the License at
|
|
1204
|
-
*
|
|
1205
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1206
|
-
*
|
|
1207
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1208
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1209
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1210
|
-
* See the License for the specific language governing permissions and
|
|
1211
|
-
* limitations under the License.
|
|
1212
|
-
*/class D4{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 o=typeof MessageChannel<"u"?new MessageChannel:null;if(!o)throw new Error("connection_unavailable");let c,u;return new Promise((f,h)=>{const m=um("",20);o.port1.start();const b=setTimeout(()=>{h(new Error("unsupported_event"))},a);u={messageChannel:o,onMessage(y){const v=y;if(v.data.eventId===m)switch(v.data.status){case"ack":clearTimeout(b),c=setTimeout(()=>{h(new Error("timeout"))},3e3);break;case"done":clearTimeout(c),f(v.data.response);break;default:clearTimeout(b),clearTimeout(c),h(new Error("invalid_response"));break}}},this.handlers.add(u),o.port1.addEventListener("message",u.onMessage),this.target.postMessage({eventType:t,eventId:m,data:r},[o.port2])}).finally(()=>{u&&this.removeMessageHandler(u)})}}/**
|
|
1213
|
-
* @license
|
|
1214
|
-
* Copyright 2020 Google LLC
|
|
1215
|
-
*
|
|
1216
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1217
|
-
* you may not use this file except in compliance with the License.
|
|
1218
|
-
* You may obtain a copy of the License at
|
|
1219
|
-
*
|
|
1220
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1221
|
-
*
|
|
1222
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1223
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1224
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1225
|
-
* See the License for the specific language governing permissions and
|
|
1226
|
-
* limitations under the License.
|
|
1227
|
-
*/function Or(){return window}function j4(e){Or().location.href=e}/**
|
|
1228
|
-
* @license
|
|
1229
|
-
* Copyright 2020 Google LLC.
|
|
1230
|
-
*
|
|
1231
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1232
|
-
* you may not use this file except in compliance with the License.
|
|
1233
|
-
* You may obtain a copy of the License at
|
|
1234
|
-
*
|
|
1235
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1236
|
-
*
|
|
1237
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1238
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1239
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1240
|
-
* See the License for the specific language governing permissions and
|
|
1241
|
-
* limitations under the License.
|
|
1242
|
-
*/function mS(){return typeof Or().WorkerGlobalScope<"u"&&typeof Or().importScripts=="function"}async function z4(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function B4(){var e;return((e=navigator==null?void 0:navigator.serviceWorker)==null?void 0:e.controller)||null}function U4(){return mS()?self:null}/**
|
|
1243
|
-
* @license
|
|
1244
|
-
* Copyright 2019 Google LLC
|
|
1245
|
-
*
|
|
1246
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1247
|
-
* you may not use this file except in compliance with the License.
|
|
1248
|
-
* You may obtain a copy of the License at
|
|
1249
|
-
*
|
|
1250
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1251
|
-
*
|
|
1252
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1253
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1254
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1255
|
-
* See the License for the specific language governing permissions and
|
|
1256
|
-
* limitations under the License.
|
|
1257
|
-
*/const gS="firebaseLocalStorageDb",P4=1,Du="firebaseLocalStorage",bS="fbase_key";class Ml{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 Vu(e,t){return e.transaction([Du],t?"readwrite":"readonly").objectStore(Du)}function H4(){const e=indexedDB.deleteDatabase(gS);return new Ml(e).toPromise()}function vp(){const e=indexedDB.open(gS,P4);return new Promise((t,r)=>{e.addEventListener("error",()=>{r(e.error)}),e.addEventListener("upgradeneeded",()=>{const a=e.result;try{a.createObjectStore(Du,{keyPath:bS})}catch(o){r(o)}}),e.addEventListener("success",async()=>{const a=e.result;a.objectStoreNames.contains(Du)?t(a):(a.close(),await H4(),t(await vp()))})})}async function s1(e,t,r){const a=Vu(e,!0).put({[bS]:t,value:r});return new Ml(a).toPromise()}async function F4(e,t){const r=Vu(e,!1).get(t),a=await new Ml(r).toPromise();return a===void 0?null:a.value}function o1(e,t){const r=Vu(e,!0).delete(t);return new Ml(r).toPromise()}const $4=800,G4=3;class yS{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 vp(),this.db)}async _withRetries(t){let r=0;for(;;)try{const a=await this._openDb();return await t(a)}catch(a){if(r++>G4)throw a;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return mS()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Ku._getInstance(U4()),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 z4(),!this.activeServiceWorker)return;this.sender=new D4(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||B4()!==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 vp();return await s1(t,Lu,"1"),await o1(t,Lu),!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=>s1(a,t,r)),this.localCache[t]=r,this.notifyServiceWorker(t)))}async _get(t){const r=await this._withRetries(a=>F4(a,t));return this.localCache[t]=r,r}async _remove(t){return this._withPendingWrite(async()=>(await this._withRetries(r=>o1(r,t)),delete this.localCache[t],this.notifyServiceWorker(t)))}async _poll(){const t=await this._withRetries(o=>{const c=Vu(o,!1).getAll();return new Ml(c).toPromise()});if(!t)return[];if(this.pendingWrites!==0)return[];const r=[],a=new Set;if(t.length!==0)for(const{fbase_key:o,value:c}of t)a.add(o),JSON.stringify(this.localCache[o])!==JSON.stringify(c)&&(this.notifyListeners(o,c),r.push(o));for(const o of Object.keys(this.localCache))this.localCache[o]&&!a.has(o)&&(this.notifyListeners(o,null),r.push(o));return r}notifyListeners(t,r){this.localCache[t]=r;const a=this.listeners[t];if(a)for(const o of Array.from(a))o(r)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),$4)}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()}}yS.type="LOCAL";const K4=yS;new Ol(3e4,6e4);/**
|
|
1258
|
-
* @license
|
|
1259
|
-
* Copyright 2021 Google LLC
|
|
1260
|
-
*
|
|
1261
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1262
|
-
* you may not use this file except in compliance with the License.
|
|
1263
|
-
* You may obtain a copy of the License at
|
|
1264
|
-
*
|
|
1265
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1266
|
-
*
|
|
1267
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1268
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1269
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1270
|
-
* See the License for the specific language governing permissions and
|
|
1271
|
-
* limitations under the License.
|
|
1272
|
-
*/function vS(e,t){return t?ri(t):(Ue(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}/**
|
|
1273
|
-
* @license
|
|
1274
|
-
* Copyright 2019 Google LLC
|
|
1275
|
-
*
|
|
1276
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1277
|
-
* you may not use this file except in compliance with the License.
|
|
1278
|
-
* You may obtain a copy of the License at
|
|
1279
|
-
*
|
|
1280
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1281
|
-
*
|
|
1282
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1283
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1284
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1285
|
-
* See the License for the specific language governing permissions and
|
|
1286
|
-
* limitations under the License.
|
|
1287
|
-
*/class dm extends cS{constructor(t){super("custom","custom"),this.params=t}_getIdTokenResponse(t){return Ds(t,this._buildIdpRequest())}_linkToIdToken(t,r){return Ds(t,this._buildIdpRequest(r))}_getReauthenticationResolver(t){return Ds(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 V4(e){return N4(e.auth,new dm(e),e.bypassAuthState)}function q4(e){const{auth:t,user:r}=e;return Ue(r,t,"internal-error"),T4(r,new dm(e),e.bypassAuthState)}async function Y4(e){const{auth:t,user:r}=e;return Ue(r,t,"internal-error"),k4(r,new dm(e),e.bypassAuthState)}/**
|
|
1288
|
-
* @license
|
|
1289
|
-
* Copyright 2020 Google LLC
|
|
1290
|
-
*
|
|
1291
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1292
|
-
* you may not use this file except in compliance with the License.
|
|
1293
|
-
* You may obtain a copy of the License at
|
|
1294
|
-
*
|
|
1295
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1296
|
-
*
|
|
1297
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1298
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1299
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1300
|
-
* See the License for the specific language governing permissions and
|
|
1301
|
-
* limitations under the License.
|
|
1302
|
-
*/class xS{constructor(t,r,a,o,c=!1){this.auth=t,this.resolver=a,this.user=o,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:o,tenantId:c,error:u,type:f}=t;if(u){this.reject(u);return}const h={auth:this.auth,requestUri:r,sessionId:a,tenantId:c||void 0,postBody:o||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(f)(h))}catch(m){this.reject(m)}}onError(t){this.reject(t)}getIdpTask(t){switch(t){case"signInViaPopup":case"signInViaRedirect":return V4;case"linkViaPopup":case"linkViaRedirect":return Y4;case"reauthViaPopup":case"reauthViaRedirect":return q4;default:Mr(this.auth,"internal-error")}}resolve(t){li(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(t),this.unregisterAndCleanUp()}reject(t){li(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()}}/**
|
|
1303
|
-
* @license
|
|
1304
|
-
* Copyright 2020 Google LLC
|
|
1305
|
-
*
|
|
1306
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1307
|
-
* you may not use this file except in compliance with the License.
|
|
1308
|
-
* You may obtain a copy of the License at
|
|
1309
|
-
*
|
|
1310
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1311
|
-
*
|
|
1312
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1313
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1314
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1315
|
-
* See the License for the specific language governing permissions and
|
|
1316
|
-
* limitations under the License.
|
|
1317
|
-
*/const W4=new Ol(2e3,1e4);async function fm(e,t,r){if(Ar(e.app))return Promise.reject(br(e,"operation-not-supported-in-this-environment"));const a=Gu(e);KI(e,t,cm);const o=vS(a,r);return new Sa(a,"signInViaPopup",t,o).executeNotNull()}class Sa extends xS{constructor(t,r,a,o,c){super(t,r,o,c),this.provider=a,this.authWindow=null,this.pollId=null,Sa.currentPopupAction&&Sa.currentPopupAction.cancel(),Sa.currentPopupAction=this}async executeNotNull(){const t=await this.execute();return Ue(t,this.auth,"internal-error"),t}async onExecution(){li(this.filter.length===1,"Popup operations only handle one event");const t=um();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(br(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var t;return((t=this.authWindow)==null?void 0:t.associatedEvent)||null}cancel(){this.reject(br(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Sa.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(br(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(t,W4.get())};t()}}Sa.currentPopupAction=null;/**
|
|
1318
|
-
* @license
|
|
1319
|
-
* Copyright 2020 Google LLC
|
|
1320
|
-
*
|
|
1321
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1322
|
-
* you may not use this file except in compliance with the License.
|
|
1323
|
-
* You may obtain a copy of the License at
|
|
1324
|
-
*
|
|
1325
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1326
|
-
*
|
|
1327
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1328
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1329
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1330
|
-
* See the License for the specific language governing permissions and
|
|
1331
|
-
* limitations under the License.
|
|
1332
|
-
*/const X4="pendingRedirect",gu=new Map;class Z4 extends xS{constructor(t,r,a=!1){super(t,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],r,void 0,a),this.eventId=null}async execute(){let t=gu.get(this.auth._key());if(!t){try{const a=await J4(this.resolver,this.auth)?await super.execute():null;t=()=>Promise.resolve(a)}catch(r){t=()=>Promise.reject(r)}gu.set(this.auth._key(),t)}return this.bypassAuthState||gu.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 J4(e,t){const r=tL(t),a=eL(e);if(!await a._isAvailable())return!1;const o=await a._get(r)==="true";return await a._remove(r),o}function Q4(e,t){gu.set(e._key(),t)}function eL(e){return ri(e._redirectPersistence)}function tL(e){return mu(X4,e.config.apiKey,e.name)}async function nL(e,t,r=!1){if(Ar(e.app))return Promise.reject(wa(e));const a=Gu(e),o=vS(a,t),u=await new Z4(a,o,r).execute();return u&&!r&&(delete u.user._redirectEventId,await a._persistUserIfCurrent(u.user),await a._setRedirectUser(null,t)),u}/**
|
|
1333
|
-
* @license
|
|
1334
|
-
* Copyright 2020 Google LLC
|
|
1335
|
-
*
|
|
1336
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1337
|
-
* you may not use this file except in compliance with the License.
|
|
1338
|
-
* You may obtain a copy of the License at
|
|
1339
|
-
*
|
|
1340
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1341
|
-
*
|
|
1342
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1343
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1344
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1345
|
-
* See the License for the specific language governing permissions and
|
|
1346
|
-
* limitations under the License.
|
|
1347
|
-
*/const rL=600*1e3;class iL{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||!aL(t)||(this.hasHandledPotentialRedirect=!0,r||(this.queuedRedirectEvent=t,r=!0)),r}sendToConsumer(t,r){var a;if(t.error&&!ES(t)){const o=((a=t.error.code)==null?void 0:a.split("auth/")[1])||"internal-error";r.onError(br(this.auth,o))}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>=rL&&this.cachedEventUids.clear(),this.cachedEventUids.has(l1(t))}saveEventToCache(t){this.cachedEventUids.add(l1(t)),this.lastProcessedEventTime=Date.now()}}function l1(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(t=>t).join("-")}function ES({type:e,error:t}){return e==="unknown"&&(t==null?void 0:t.code)==="auth/no-auth-event"}function aL(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return ES(e);default:return!1}}/**
|
|
1348
|
-
* @license
|
|
1349
|
-
* Copyright 2020 Google LLC
|
|
1350
|
-
*
|
|
1351
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1352
|
-
* you may not use this file except in compliance with the License.
|
|
1353
|
-
* You may obtain a copy of the License at
|
|
1354
|
-
*
|
|
1355
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1356
|
-
*
|
|
1357
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1358
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1359
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1360
|
-
* See the License for the specific language governing permissions and
|
|
1361
|
-
* limitations under the License.
|
|
1362
|
-
*/async function sL(e,t={}){return Ks(e,"GET","/v1/projects",t)}/**
|
|
1363
|
-
* @license
|
|
1364
|
-
* Copyright 2020 Google LLC
|
|
1365
|
-
*
|
|
1366
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1367
|
-
* you may not use this file except in compliance with the License.
|
|
1368
|
-
* You may obtain a copy of the License at
|
|
1369
|
-
*
|
|
1370
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1371
|
-
*
|
|
1372
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1373
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1374
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1375
|
-
* See the License for the specific language governing permissions and
|
|
1376
|
-
* limitations under the License.
|
|
1377
|
-
*/const oL=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,lL=/^https?/;async function cL(e){if(e.config.emulator)return;const{authorizedDomains:t}=await sL(e);for(const r of t)try{if(uL(r))return}catch{}Mr(e,"unauthorized-domain")}function uL(e){const t=gp(),{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(!lL.test(r))return!1;if(oL.test(e))return a===e;const o=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+o+"|"+o+")$","i").test(a)}/**
|
|
1378
|
-
* @license
|
|
1379
|
-
* Copyright 2020 Google LLC.
|
|
1380
|
-
*
|
|
1381
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1382
|
-
* you may not use this file except in compliance with the License.
|
|
1383
|
-
* You may obtain a copy of the License at
|
|
1384
|
-
*
|
|
1385
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1386
|
-
*
|
|
1387
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1388
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1389
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1390
|
-
* See the License for the specific language governing permissions and
|
|
1391
|
-
* limitations under the License.
|
|
1392
|
-
*/const dL=new Ol(3e4,6e4);function c1(){const e=Or().___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 fL(e){return new Promise((t,r)=>{var o,c,u;function a(){c1(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{c1(),r(br(e,"network-request-failed"))},timeout:dL.get()})}if((c=(o=Or().gapi)==null?void 0:o.iframes)!=null&&c.Iframe)t(gapi.iframes.getContext());else if((u=Or().gapi)!=null&&u.load)a();else{const f=y4("iframefcb");return Or()[f]=()=>{gapi.load?a():r(br(e,"network-request-failed"))},g4(`${b4()}?onload=${f}`).catch(h=>r(h))}}).catch(t=>{throw bu=null,t})}let bu=null;function hL(e){return bu=bu||fL(e),bu}/**
|
|
1393
|
-
* @license
|
|
1394
|
-
* Copyright 2020 Google LLC.
|
|
1395
|
-
*
|
|
1396
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1397
|
-
* you may not use this file except in compliance with the License.
|
|
1398
|
-
* You may obtain a copy of the License at
|
|
1399
|
-
*
|
|
1400
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1401
|
-
*
|
|
1402
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1403
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1404
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1405
|
-
* See the License for the specific language governing permissions and
|
|
1406
|
-
* limitations under the License.
|
|
1407
|
-
*/const pL=new Ol(5e3,15e3),mL="__/auth/iframe",gL="emulator/auth/iframe",bL={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},yL=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function vL(e){const t=e.config;Ue(t.authDomain,e,"auth-domain-config-required");const r=t.emulator?im(t,gL):`https://${e.config.authDomain}/${mL}`,a={apiKey:t.apiKey,appName:e.name,v:Al},o=yL.get(e.config.apiHost);o&&(a.eid=o);const c=e._getFrameworks();return c.length&&(a.fw=c.join(",")),`${r}?${Cl(a).slice(1)}`}async function xL(e){const t=await hL(e),r=Or().gapi;return Ue(r,e,"internal-error"),t.open({where:document.body,url:vL(e),messageHandlersFilter:r.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:bL,dontclear:!0},a=>new Promise(async(o,c)=>{await a.restyle({setHideOnLeave:!1});const u=br(e,"network-request-failed"),f=Or().setTimeout(()=>{c(u)},pL.get());function h(){Or().clearTimeout(f),o(a)}a.ping(h).then(h,()=>{c(u)})}))}/**
|
|
1408
|
-
* @license
|
|
1409
|
-
* Copyright 2020 Google LLC.
|
|
1410
|
-
*
|
|
1411
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1412
|
-
* you may not use this file except in compliance with the License.
|
|
1413
|
-
* You may obtain a copy of the License at
|
|
1414
|
-
*
|
|
1415
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1416
|
-
*
|
|
1417
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1418
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1419
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1420
|
-
* See the License for the specific language governing permissions and
|
|
1421
|
-
* limitations under the License.
|
|
1422
|
-
*/const EL={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},SL=500,_L=600,wL="_blank",kL="http://localhost";class u1{constructor(t){this.window=t,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function TL(e,t,r,a=SL,o=_L){const c=Math.max((window.screen.availHeight-o)/2,0).toString(),u=Math.max((window.screen.availWidth-a)/2,0).toString();let f="";const h={...EL,width:a.toString(),height:o.toString(),top:c,left:u},m=kn().toLowerCase();r&&(f=tS(m)?wL:r),QE(m)&&(t=t||kL,h.scrollbars="yes");const b=Object.entries(h).reduce((v,[x,S])=>`${v}${x}=${S},`,"");if(l4(m)&&f!=="_self")return NL(t||"",f),new u1(null);const y=window.open(t||"",f,b);Ue(y,e,"popup-blocked");try{y.focus()}catch{}return new u1(y)}function NL(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)}/**
|
|
1423
|
-
* @license
|
|
1424
|
-
* Copyright 2021 Google LLC
|
|
1425
|
-
*
|
|
1426
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1427
|
-
* you may not use this file except in compliance with the License.
|
|
1428
|
-
* You may obtain a copy of the License at
|
|
1429
|
-
*
|
|
1430
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1431
|
-
*
|
|
1432
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1433
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1434
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1435
|
-
* See the License for the specific language governing permissions and
|
|
1436
|
-
* limitations under the License.
|
|
1437
|
-
*/const CL="__/auth/handler",AL="emulator/auth/handler",OL=encodeURIComponent("fac");async function d1(e,t,r,a,o,c){Ue(e.config.authDomain,e,"auth-domain-config-required"),Ue(e.config.apiKey,e,"invalid-api-key");const u={apiKey:e.config.apiKey,appName:e.name,authType:r,redirectUrl:a,v:Al,eventId:o};if(t instanceof cm){t.setDefaultLanguage(e.languageCode),u.providerId=t.providerId||"",C3(t.getCustomParameters())||(u.customParameters=JSON.stringify(t.getCustomParameters()));for(const[b,y]of Object.entries({}))u[b]=y}if(t instanceof Vs){const b=t.getScopes().filter(y=>y!=="");b.length>0&&(u.scopes=b.join(","))}e.tenantId&&(u.tid=e.tenantId);const f=u;for(const b of Object.keys(f))f[b]===void 0&&delete f[b];const h=await e._getAppCheckToken(),m=h?`#${OL}=${encodeURIComponent(h)}`:"";return`${ML(e)}?${Cl(f).slice(1)}${m}`}function ML({config:e}){return e.emulator?im(e,AL):`https://${e.authDomain}/${CL}`}/**
|
|
1438
|
-
* @license
|
|
1439
|
-
* Copyright 2020 Google LLC
|
|
1440
|
-
*
|
|
1441
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1442
|
-
* you may not use this file except in compliance with the License.
|
|
1443
|
-
* You may obtain a copy of the License at
|
|
1444
|
-
*
|
|
1445
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1446
|
-
*
|
|
1447
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1448
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1449
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1450
|
-
* See the License for the specific language governing permissions and
|
|
1451
|
-
* limitations under the License.
|
|
1452
|
-
*/const zh="webStorageSupport";class RL{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=pS,this._completeRedirectFn=nL,this._overrideRedirectResult=Q4}async _openPopup(t,r,a,o){var u;li((u=this.eventManagers[t._key()])==null?void 0:u.manager,"_initialize() not called before _openPopup()");const c=await d1(t,r,a,gp(),o);return TL(t,c,um())}async _openRedirect(t,r,a,o){await this._originValidation(t);const c=await d1(t,r,a,gp(),o);return j4(c),new Promise(()=>{})}_initialize(t){const r=t._key();if(this.eventManagers[r]){const{manager:o,promise:c}=this.eventManagers[r];return o?Promise.resolve(o):(li(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 xL(t),a=new iL(t);return r.register("authEvent",o=>(Ue(o==null?void 0:o.authEvent,t,"invalid-auth-event"),{status:a.onEvent(o.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(zh,{type:zh},o=>{var u;const c=(u=o==null?void 0:o[0])==null?void 0:u[zh];c!==void 0&&r(!!c),Mr(t,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(t){const r=t._key();return this.originValidationPromises[r]||(this.originValidationPromises[r]=cL(t)),this.originValidationPromises[r]}get _shouldInitProactively(){return sS()||eS()||om()}}const IL=RL;var f1="@firebase/auth",h1="1.12.0";/**
|
|
1453
|
-
* @license
|
|
1454
|
-
* Copyright 2020 Google LLC
|
|
1455
|
-
*
|
|
1456
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1457
|
-
* you may not use this file except in compliance with the License.
|
|
1458
|
-
* You may obtain a copy of the License at
|
|
1459
|
-
*
|
|
1460
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1461
|
-
*
|
|
1462
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1463
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1464
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1465
|
-
* See the License for the specific language governing permissions and
|
|
1466
|
-
* limitations under the License.
|
|
1467
|
-
*/class LL{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(){Ue(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
|
|
1468
|
-
* @license
|
|
1469
|
-
* Copyright 2020 Google LLC
|
|
1470
|
-
*
|
|
1471
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1472
|
-
* you may not use this file except in compliance with the License.
|
|
1473
|
-
* You may obtain a copy of the License at
|
|
1474
|
-
*
|
|
1475
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1476
|
-
*
|
|
1477
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1478
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1479
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1480
|
-
* See the License for the specific language governing permissions and
|
|
1481
|
-
* limitations under the License.
|
|
1482
|
-
*/function DL(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 jL(e){yl(new Ps("auth",(t,{options:r})=>{const a=t.getProvider("app").getImmediate(),o=t.getProvider("heartbeat"),c=t.getProvider("app-check-internal"),{apiKey:u,authDomain:f}=a.options;Ue(u&&!u.includes(":"),"invalid-api-key",{appName:a.name});const h={apiKey:u,authDomain:f,clientPlatform:e,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:oS(e)},m=new p4(a,o,c,h);return x4(m,r),m},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,r,a)=>{t.getProvider("auth-internal").initialize()})),yl(new Ps("auth-internal",t=>{const r=Gu(t.getProvider("auth").getImmediate());return(a=>new LL(a))(r)},"PRIVATE").setInstantiationMode("EXPLICIT")),Rs(f1,h1,DL(e)),Rs(f1,h1,"esm2020")}/**
|
|
1483
|
-
* @license
|
|
1484
|
-
* Copyright 2021 Google LLC
|
|
1485
|
-
*
|
|
1486
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1487
|
-
* you may not use this file except in compliance with the License.
|
|
1488
|
-
* You may obtain a copy of the License at
|
|
1489
|
-
*
|
|
1490
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1491
|
-
*
|
|
1492
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1493
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1494
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1495
|
-
* See the License for the specific language governing permissions and
|
|
1496
|
-
* limitations under the License.
|
|
1497
|
-
*/const zL=300,BL=UE("authIdTokenMaxAge")||zL;let p1=null;const UL=e=>async t=>{const r=t&&await t.getIdTokenResult(),a=r&&(new Date().getTime()-Date.parse(r.issuedAtTime))/1e3;if(a&&a>BL)return;const o=r==null?void 0:r.token;p1!==o&&(p1=o,await fetch(e,{method:o?"POST":"DELETE",headers:o?{Authorization:`Bearer ${o}`}:{}}))};function PL(e=OI()){const t=$E(e,"auth");if(t.isInitialized())return t.getImmediate();const r=v4(e,{popupRedirectResolver:IL,persistence:[K4,I4,pS]}),a=UE("authTokenSyncURL");if(a&&typeof isSecureContext=="boolean"&&isSecureContext){const c=new URL(a,location.origin);if(location.origin===c.origin){const u=UL(c.toString());O4(r,u,()=>u(r.currentUser)),A4(r,f=>u(f))}}const o=f3("auth");return o&&E4(r,`http://${o}`),r}function HL(){var e;return((e=document.getElementsByTagName("head"))==null?void 0:e[0])??document}m4({loadJS(e){return new Promise((t,r)=>{const a=document.createElement("script");a.setAttribute("src",e),a.onload=t,a.onerror=o=>{const c=br("internal-error");c.customData=o,r(c)},a.type="text/javascript",a.charset="UTF-8",HL().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="});jL("Browser");const ul={apiKey:"AIzaSyA8NdosgijoZoOSTHoRY4XA5WH-58OF3Yk",authDomain:"botschat-130ff.firebaseapp.com",projectId:"botschat-130ff",messagingSenderId:"670756745871",appId:"1:670756745871:web:f3abae021c9520296276fa"};let As=null,cu=null;function qu(){return!!(ul.apiKey&&ul.authDomain&&ul.projectId)}function FL(){return As||(qu()?(As=tm(ul),As):null)}function hm(){if(!cu){if(!qu())throw new Error("Firebase is not configured. Set VITE_FIREBASE_* env vars.");As=tm(ul),cu=PL(As),(un.isNativePlatform()||!!window.__BOTSCHAT_NATIVE__)&&C4(cu,yp).catch(()=>{})}return cu}let ju=!1;function SS(e,t,r){return new Promise((a,o)=>{const c=setTimeout(()=>o(new Error(`${r} timed out after ${t}ms`)),t);e.then(u=>{clearTimeout(c),a(u)},u=>{clearTimeout(c),o(u)})})}async function $L(){if(!un.isNativePlatform()||ju)return;const{SocialLogin:e}=await ur(async()=>{const{SocialLogin:o}=await import("./index-QebPVqwj.js");return{SocialLogin:o}},[]),t="670756745871-ct1k370fk3h5oj3f3gdabqv1nq2b7r54.apps.googleusercontent.com",r="670756745871-1anrnjukhhu0a550j86blm771a2k3jou.apps.googleusercontent.com",a=un.getPlatform();console.log("[NativeGoogleSignIn] initialize: platform =",a,"iOSClientId =",(t==null?void 0:t.substring(0,20))+"...","webClientId =",(r==null?void 0:r.substring(0,20))+"..."),await SS(e.initialize({google:{webClientId:r,iOSClientId:t,iOSServerClientId:r}}),1e4,"SocialLogin.initialize"),ju=!0,console.log("[NativeGoogleSignIn] initialized OK")}async function GL(){var o;console.log("[NativeGoogleSignIn] Step 1: ensureNativeGoogleInit"),await $L(),console.log("[NativeGoogleSignIn] Step 2: calling SocialLogin.login()");const{SocialLogin:e}=await ur(async()=>{const{SocialLogin:c}=await import("./index-QebPVqwj.js");return{SocialLogin:c}},[]),t=await e.login({provider:"google",options:{scopes:["email","profile"]}});console.log("[NativeGoogleSignIn] Step 3: SocialLogin.login() returned, responseType =",(o=t==null?void 0:t.result)==null?void 0:o.responseType);const r=t.result;if(r.responseType!=="online")throw new Error(`Google Sign-In returned '${r.responseType}' response; expected 'online'. Full result: ${JSON.stringify(t)}`);const a=r.idToken;if(console.log("[NativeGoogleSignIn] Step 4: idToken present =",!!a,", length =",(a==null?void 0:a.length)??0),!a)throw new Error("Google Sign-In did not return an idToken. Ensure Web Client ID (iOSServerClientId) is correct.");return console.log("[NativeGoogleSignIn] Step 5: Skipping Firebase client, sending Google ID token directly to backend"),{idToken:a,email:r.profile.email??"",displayName:r.profile.name??null,photoURL:r.profile.imageUrl??null,provider:"google"}}async function _S(){if(un.isNativePlatform())return GL();const e=hm(),t=new ei;t.addScope("email"),t.addScope("profile");const r=await fm(e,t);return{idToken:await r.user.getIdToken(),email:r.user.email??"",displayName:r.user.displayName,photoURL:r.user.photoURL,provider:"google"}}async function wS(){const e=hm(),t=new ti;t.addScope("user:email");const r=await fm(e,t);return{idToken:await r.user.getIdToken(),email:r.user.email??"",displayName:r.user.displayName,photoURL:r.user.photoURL,provider:"github"}}async function KL(){var o,c,u;console.log("[NativeAppleSignIn] Step 1: initializing");const{SocialLogin:e}=await ur(async()=>{const{SocialLogin:f}=await import("./index-QebPVqwj.js");return{SocialLogin:f}},[]);ju||(await SS(e.initialize({apple:{}}),1e4,"SocialLogin.initialize(apple)"),ju=!0),console.log("[NativeAppleSignIn] Step 2: calling SocialLogin.login()");const t=await e.login({provider:"apple",options:{scopes:["email","name"]}});console.log("[NativeAppleSignIn] Step 3: SocialLogin.login() returned",JSON.stringify(t).substring(0,200));const r=t.result,a=r.idToken;if(!a)throw new Error("Apple Sign-In did not return an idToken");return console.log("[NativeAppleSignIn] Step 4: Skipping Firebase client, sending Apple ID token directly to backend"),{idToken:a,email:((o=r.profile)==null?void 0:o.email)??r.email??"",displayName:((c=r.profile)==null?void 0:c.name)??((u=r.fullName)==null?void 0:u.givenName)??null,photoURL:null,provider:"apple"}}async function kS(){if(un.isNativePlatform())return KL();const e=hm(),t=new cl("apple.com");t.addScope("email"),t.addScope("name");const r=await fm(e,t);return{idToken:await r.user.getIdToken(),email:r.user.email??"",displayName:r.user.displayName,photoURL:r.user.photoURL,provider:"apple"}}const VL=Object.freeze(Object.defineProperty({__proto__:null,ensureFirebaseApp:FL,isFirebaseConfigured:qu,signInWithApple:kS,signInWithGitHub:wS,signInWithGoogle:_S},Symbol.toStringTag,{value:"Module"}));function qL(){return d.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 48 48",style:{flexShrink:0},children:[d.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"}),d.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"}),d.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"}),d.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 YL(){return d.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",style:{flexShrink:0},children:d.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 WL(){return d.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",style:{flexShrink:0},children:d.jsx("path",{d:"M17.05 20.28c-.98.95-2.05.88-3.08.4-1.09-.5-2.08-.48-3.24 0-1.44.62-2.2.44-3.06-.4C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"})})}function XL(){const e=Rr(),[t,r]=C.useState(!1),[a,o]=C.useState(""),[c,u]=C.useState(""),[f,h]=C.useState(""),[m,b]=C.useState(""),[y,v]=C.useState(!1),[x,S]=C.useState(null),[_,N]=C.useState(null),T=qu(),O=y||!!x;C.useEffect(()=>{Eu.config().then(N).catch(()=>{N({emailEnabled:!0,googleEnabled:T,githubEnabled:T,appleEnabled:T})})},[T]);const R=!1,M=_!==null,L=M&&(T||R),w=F=>{ai(F.token),F.refreshToken&&Na(F.refreshToken),e({type:"SET_USER",user:{id:F.id,email:F.email,displayName:F.displayName}})},D=async F=>{b(""),S(F);const P=setTimeout(()=>{S(null)},F==="apple"?12e4:3e4);try{Z.info("Auth",`Starting ${F} sign-in`);const $=F==="google"?_S:F==="github"?wS:kS,{idToken:Y}=await $();Z.info("Auth",`Got Firebase ID token from ${F}, verifying with backend`);const te=await Eu.firebase(Y);Z.info("Auth",`${F} sign-in success — user ${te.id} (${te.email})`),w(te)}catch($){if($ instanceof Error&&($.message.includes("popup-closed-by-user")||$.message.includes("cancelled")))Z.info("Auth",`${F} sign-in cancelled by user`);else{const Y=$ instanceof Error?$.message:`${F} sign-in failed`;Z.error("Auth",`${F} sign-in failed: ${Y}`),b(Y)}}finally{clearTimeout(P),S(null)}};return d.jsx("div",{className:"h-screen overflow-y-auto",style:{background:"var(--bg-secondary)"},children:d.jsx("div",{className:"min-h-full flex items-center justify-center p-4",children:d.jsxs("div",{className:"w-full max-w-md",children:[d.jsxs("div",{className:"text-center mb-8",children:[d.jsx("img",{src:"/botschat-logo.png",alt:"BotsChat",className:"inline-block w-16 h-16 mb-4"}),d.jsx("h1",{className:"text-3xl font-bold",style:{color:"var(--text-primary)"},children:"BotsChat"}),d.jsx("p",{className:"mt-2",style:{color:"var(--text-secondary)"},children:"Multi-channel AI chat powered by OpenClaw"})]}),d.jsxs("div",{className:"rounded-md p-8",style:{background:"var(--bg-surface)",boxShadow:"var(--shadow-lg)"},children:[d.jsx("h2",{className:"text-h1 mb-6",style:{color:"var(--text-primary)"},children:"Sign in"}),!M&&d.jsx("div",{className:"py-8 text-center",style:{color:"var(--text-muted)"},children:d.jsx("span",{className:"text-body",children:"Loading sign-in options…"})}),M&&!L&&d.jsx("div",{className:"py-4 text-caption",style:{color:"var(--text-secondary)"},children:"Sign-in is not configured. Please contact support."}),M&&T&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-3",children:[d.jsx("button",{type:"button",onClick:()=>D("apple"),disabled:O,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==="apple"?d.jsx("span",{children:"Signing in..."}):d.jsxs(d.Fragment,{children:[d.jsx(WL,{}),d.jsx("span",{children:"Continue with Apple"})]})}),d.jsx("button",{type:"button",onClick:()=>D("google"),disabled:O,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"?d.jsx("span",{children:"Signing in..."}):d.jsxs(d.Fragment,{children:[d.jsx(qL,{}),d.jsx("span",{children:"Continue with Google"})]})}),d.jsx("button",{type:"button",onClick:()=>D("github"),disabled:O,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"?d.jsx("span",{children:"Signing in..."}):d.jsxs(d.Fragment,{children:[d.jsx(YL,{}),d.jsx("span",{children:"Continue with GitHub"})]})})]}),M&&R]}),m&&d.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:m}),M&&R,d.jsxs("div",{className:"mt-6 text-center",children:[d.jsx("a",{href:"https://botschat.app/privacy.html",target:"_blank",rel:"noopener noreferrer",className:"text-tiny hover:underline",style:{color:"var(--text-muted)"},children:"Privacy Policy"}),d.jsx("span",{className:"mx-2 text-tiny",style:{color:"var(--text-muted)"},children:"·"}),d.jsx("a",{href:"https://botschat.app/terms.html",target:"_blank",rel:"noopener noreferrer",className:"text-tiny hover:underline",style:{color:"var(--text-muted)"},children:"Terms of Service"})]})]})]})})})}function ZL({onAccept:e}){const[t,r]=C.useState(!1),[a,o]=C.useState(!1);C.useEffect(()=>{const f=setTimeout(()=>o(!0),3e3);return()=>clearTimeout(f)},[]);const c=t||a,u=f=>{const h=f.currentTarget;h.scrollHeight-h.scrollTop-h.clientHeight<20&&r(!0)};return d.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-50 p-4",style:{background:"var(--bg-secondary)"},children:d.jsxs("div",{className:"w-full max-w-lg flex flex-col rounded-md",style:{background:"var(--bg-surface)",boxShadow:"var(--shadow-lg)",maxHeight:"90vh"},children:[d.jsxs("div",{className:"px-6 pt-6 pb-4 shrink-0",children:[d.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[d.jsx("svg",{className:"w-6 h-6 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"var(--bg-active)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"})}),d.jsx("h1",{className:"text-h1 font-bold",style:{color:"var(--text-primary)"},children:"How Your Data Works in BotsChat"})]}),d.jsx("p",{className:"text-caption",style:{color:"var(--text-muted)"},children:"Please review before continuing"})]}),d.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto px-6",onScroll:u,children:d.jsxs("div",{className:"space-y-5 pb-2",children:[d.jsx(Wo,{icon:d.jsx("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M22 12h-4l-3 9L9 3l-3 9H2"})}),title:"Message Relay",children:"BotsChat acts as a WebSocket relay between your browser and your own OpenClaw AI gateway. Messages you send are transmitted through BotsChat Cloud to reach your gateway."}),d.jsx(Wo,{icon:d.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),d.jsx("path",{d:"M7 11V7a5 5 0 0110 0v4"})]}),title:"End-to-End Encryption",children:"When E2E encryption is enabled, the server only stores ciphertext it cannot read. Your encryption key never leaves your device."}),d.jsx(Wo,{icon:d.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",ry:"2"}),d.jsx("rect",{x:"9",y:"9",width:"6",height:"6"}),d.jsx("line",{x1:"9",y1:"1",x2:"9",y2:"4"}),d.jsx("line",{x1:"15",y1:"1",x2:"15",y2:"4"}),d.jsx("line",{x1:"9",y1:"20",x2:"9",y2:"23"}),d.jsx("line",{x1:"15",y1:"20",x2:"15",y2:"23"}),d.jsx("line",{x1:"20",y1:"9",x2:"23",y2:"9"}),d.jsx("line",{x1:"20",y1:"14",x2:"23",y2:"14"}),d.jsx("line",{x1:"1",y1:"9",x2:"4",y2:"9"}),d.jsx("line",{x1:"1",y1:"14",x2:"4",y2:"14"})]}),title:"AI Processing",children:"AI processing happens on your OpenClaw gateway using AI services you configure (such as OpenAI, Anthropic, Google, Azure, etc.). BotsChat does not choose or control which AI service processes your data."}),d.jsx(Wo,{icon:d.jsx("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M21 2l-2 2m-7.61 7.61a5.5 5.5 0 11-7.778 7.778 5.5 5.5 0 017.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4"})}),title:"Your API Keys",children:"Your API keys are stored on your OpenClaw gateway machine and never pass through BotsChat Cloud."}),d.jsx(Wo,{icon:d.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("circle",{cx:"12",cy:"12",r:"10"}),d.jsx("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),d.jsx("path",{d:"M12 2a15.3 15.3 0 014 10 15.3 15.3 0 01-4 10 15.3 15.3 0 01-4-10 15.3 15.3 0 014-10z"})]}),title:"Third-Party Services",children:"BotsChat Cloud uses Cloudflare for hosting, database, and media storage. Authentication is provided by Google and GitHub OAuth. No data is sold or shared with advertisers."}),d.jsxs("div",{className:"rounded-md p-4",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)"},children:[d.jsx("h3",{className:"text-body font-bold mb-3",style:{color:"var(--text-primary)"},children:"What You Agree To"}),d.jsxs("ul",{className:"space-y-2",children:[d.jsx(uu,{children:"Messages sent through BotsChat may be processed by third-party AI services configured in your OpenClaw gateway"}),d.jsx(uu,{children:"Your chat data is stored on Cloudflare infrastructure"}),d.jsx(uu,{children:"You can enable E2E encryption for additional privacy"}),d.jsx(uu,{children:"You can delete your account and all data at any time"})]})]})]})}),d.jsxs("div",{className:"px-6 py-4 shrink-0",style:{borderTop:"1px solid var(--border)"},children:[d.jsx("button",{onClick:e,disabled:!c,className:"w-full py-2.5 font-bold text-body text-white rounded-sm transition-all",style:{background:c?"var(--bg-active)":"var(--bg-hover, #3a3d41)",cursor:c?"pointer":"not-allowed",opacity:c?1:.5},children:"I Understand & Accept"}),d.jsxs("div",{className:"flex items-center justify-center gap-2 mt-3",children:[d.jsx("a",{href:"https://botschat.app/privacy.html",target:"_blank",rel:"noopener noreferrer",className:"text-tiny hover:underline",style:{color:"var(--text-muted)"},children:"Privacy Policy"}),d.jsx("span",{className:"text-tiny",style:{color:"var(--text-muted)"},children:"·"}),d.jsx("a",{href:"https://botschat.app/terms.html",target:"_blank",rel:"noopener noreferrer",className:"text-tiny hover:underline",style:{color:"var(--text-muted)"},children:"Terms of Service"})]})]})]})})}function Wo({icon:e,title:t,children:r}){return d.jsxs("div",{className:"flex gap-3",children:[d.jsx("div",{className:"shrink-0 w-8 h-8 rounded-md flex items-center justify-center mt-0.5",style:{background:"var(--bg-secondary)",color:"var(--text-secondary)"},children:e}),d.jsxs("div",{className:"min-w-0",children:[d.jsx("h3",{className:"text-body font-bold mb-1",style:{color:"var(--text-primary)"},children:t}),d.jsx("p",{className:"text-caption",style:{color:"var(--text-secondary)",lineHeight:1.6},children:r})]})]})}function uu({children:e}){return d.jsxs("li",{className:"flex gap-2 text-caption",style:{color:"var(--text-secondary)"},children:[d.jsx("svg",{className:"w-4 h-4 shrink-0 mt-0.5",viewBox:"0 0 20 20",fill:"var(--bg-active)",children:d.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),d.jsx("span",{style:{lineHeight:1.5},children:e})]})}function JL({text:e}){const[t,r]=C.useState(!1),a=async()=>{try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),2e3)}catch{const o=document.createElement("textarea");o.value=e,document.body.appendChild(o),o.select(),document.execCommand("copy"),document.body.removeChild(o),r(!0),setTimeout(()=>r(!1),2e3)}};return d.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 du({code:e,multiline:t}){return d.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:[d.jsx("pre",{className:"flex-1 text-caption font-mono overflow-x-auto whitespace-pre-wrap break-all",style:{color:"var(--text-primary)"},children:e}),d.jsx(JL,{text:e})]})}function QL({color:e}){return d.jsxs("span",{className:"relative flex h-3 w-3",children:[d.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",style:{backgroundColor:e}}),d.jsx("span",{className:"relative inline-flex rounded-full h-3 w-3",style:{backgroundColor:e}})]})}function eD({onSkip:e}){const t=Zn(),[r,a]=C.useState(null),[o,c]=C.useState(!0),[u,f]=C.useState(""),[h,m]=C.useState(""),[b,y]=C.useState(!0),[v,x]=C.useState(!1),[S,_]=C.useState(""),[N,T]=C.useState(!1),[O,R]=C.useState(!1),[M,L]=C.useState(typeof window<"u"?window.location.origin:"https://console.botschat.app"),[w,D]=C.useState(!1),[F,J]=C.useState(),[P,$]=C.useState(!1);C.useEffect(()=>{let z=!1;async function re(){try{const oe=await P1.cloudUrl();if(z)return;L(oe.cloudUrl),D(oe.isLoopback),J(oe.hint)}catch(oe){Z.warn("Onboarding",`Failed to fetch cloudUrl, using origin: ${oe}`);const ye=window.location.hostname,I=ye==="localhost"||ye.startsWith("127.");D(I),I&&J("This URL (localhost) only works on this machine. If your OpenClaw is on a different host, replace with its LAN IP.")}}return re(),()=>{z=!0}},[]),C.useEffect(()=>{let z=!1;async function re(){c(!0);try{const{token:oe}=await Xo.create("Default");z||a(oe)}catch(oe){Z.error("Onboarding",`Failed to create pairing token: ${oe}`)}finally{z||c(!1)}}return re(),()=>{z=!0}},[]);const Y=u.length>=6&&u===h,te=async()=>{var z;if(Y){if(!((z=t.user)!=null&&z.id)){_("User not loaded yet. Please wait.");return}T(!0),_("");try{await Ge.setPassword(u,t.user.id,b),x(!0)}catch{_("Failed to derive encryption key. Please try again.")}finally{T(!1)}}},se=r?`openclaw plugins install @botschat/botschat && \\
|
|
1498
|
-
openclaw config set channels.botschat.cloudUrl ${M} && \\
|
|
1499
|
-
openclaw config set channels.botschat.pairingToken ${r} && \\
|
|
1500
|
-
openclaw config set channels.botschat.e2ePassword "${u}" && \\
|
|
1501
|
-
openclaw config set channels.botschat.enabled true && \\
|
|
1502
|
-
openclaw gateway restart`:"Loading...",V=t.openclawConnected;return d.jsx("div",{className:"h-screen overflow-y-auto",style:{background:"var(--bg-secondary)"},children:d.jsx("div",{className:"min-h-full flex items-center justify-center p-4",children:d.jsxs("div",{className:"w-full max-w-xl",children:[d.jsxs("div",{className:"text-center mb-8",children:[d.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"}),d.jsx("h1",{className:"text-3xl font-bold",style:{color:"var(--text-primary)"},children:"Welcome to BotsChat!"}),d.jsx("p",{className:"mt-2",style:{color:"var(--text-secondary)"},children:"Connect your OpenClaw agent to start chatting."})]}),d.jsx("div",{className:"rounded-md p-8",style:{background:"var(--bg-surface)",boxShadow:"var(--shadow-lg)"},children:V?d.jsxs("div",{className:"text-center py-6",children:[d.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:d.jsx("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"var(--accent-green)",strokeWidth:2.5,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),d.jsx("h2",{className:"text-h1 font-bold mb-2",style:{color:"var(--text-primary)"},children:"OpenClaw Connected!"}),d.jsx("p",{className:"text-body mb-6",style:{color:"var(--text-secondary)"},children:"Your agent is ready. Start chatting now."}),d.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"})]}):d.jsxs(d.Fragment,{children:[d.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:[d.jsx(QL,{color:"var(--accent-yellow)"}),d.jsx("span",{className:"text-caption font-medium",style:{color:"var(--accent-yellow)"},children:"Waiting for OpenClaw connection..."})]}),d.jsxs("div",{className:"mb-6",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[d.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?d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):"1"}),d.jsx("h3",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:"Set your E2E encryption password"})]}),v?d.jsx("p",{className:"text-caption ml-8",style:{color:"var(--accent-green)"},children:"E2E encryption is active. Your encryption key has been derived."}):d.jsxs("div",{className:"ml-8",children:[d.jsxs("p",{className:"text-caption mb-3",style:{color:"var(--text-secondary)"},children:["Your messages, prompts, and task results will be ",d.jsx("strong",{children:"encrypted on this device"})," before they leave — the server only stores ciphertext it cannot read."]}),d.jsx("div",{className:"mb-3 rounded-md overflow-hidden",style:{border:"1px solid var(--border)"},children:d.jsx("img",{src:"/architecture.png",alt:"BotsChat E2E Encryption Architecture",className:"w-full",style:{display:"block"}})}),d.jsxs("p",{className:"text-caption mb-4",style:{color:"var(--text-muted)"},children:["Encryption keys are derived locally and never sent to the server."," ",d.jsx("a",{href:"https://botschat.app/#features",target:"_blank",rel:"noopener noreferrer",className:"underline",style:{color:"var(--text-link)"},children:"Learn more"})]}),d.jsxs("div",{className:"space-y-2.5",children:[d.jsxs("div",{className:"relative",children:[d.jsx("input",{type:O?"text":"password",value:u,onChange:z=>f(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"}}),d.jsx("button",{type:"button",onClick:()=>R(!O),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1",style:{color:"var(--text-muted)"},tabIndex:-1,children:O?d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.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"}),d.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"}),d.jsx("path",{d:"M14.12 14.12a3 3 0 1 1-4.24-4.24"}),d.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}):d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),d.jsx("circle",{cx:"12",cy:"12",r:"3"})]})})]}),d.jsxs("div",{className:"relative",children:[d.jsx("input",{type:O?"text":"password",value:h,onChange:z=>m(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"}}),d.jsx("button",{type:"button",onClick:()=>R(!O),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1",style:{color:"var(--text-muted)"},tabIndex:-1,children:O?d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.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"}),d.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"}),d.jsx("path",{d:"M14.12 14.12a3 3 0 1 1-4.24-4.24"}),d.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}):d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),d.jsx("circle",{cx:"12",cy:"12",r:"3"})]})})]}),h&&u!==h&&d.jsx("p",{className:"text-caption",style:{color:"var(--accent-red, #e53e3e)"},children:"Passwords do not match."}),d.jsxs("label",{className:"flex items-center gap-2 text-caption",style:{color:"var(--text-secondary)"},children:[d.jsx("input",{type:"checkbox",checked:b,onChange:z=>y(z.target.checked)}),"Remember on this device"]}),S&&d.jsx("p",{className:"text-caption",style:{color:"var(--accent-red, #e53e3e)"},children:S}),d.jsx("button",{onClick:te,disabled:!Y||N,className:"w-full py-2 font-bold text-caption text-white rounded-sm transition-colors",style:{background:Y&&!N?"var(--bg-active)":"var(--bg-hover)",cursor:Y&&!N?"pointer":"not-allowed",opacity:Y&&!N?1:.5},children:N?"Deriving key...":"Set E2E Password & Continue"})]})]})]}),d.jsxs("div",{className:"mb-6",style:{opacity:v?1:.4,pointerEvents:v?"auto":"none"},children:[d.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[d.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"}),d.jsx("h3",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:"Run this command on your OpenClaw machine"})]}),d.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."}),w&&d.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:[d.jsx("svg",{className:"w-4 h-4 mt-0.5 shrink-0",viewBox:"0 0 20 20",fill:"currentColor",children:d.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"})}),d.jsxs("span",{children:[F||"localhost URL may not be reachable from other machines."," ",d.jsx("button",{onClick:()=>$(!0),className:"underline font-medium hover:brightness-110",style:{color:"var(--text-link)"},children:"Change URL"})]})]}),P&&d.jsxs("div",{className:"flex items-center gap-2 mb-3 ml-8",children:[d.jsx("label",{className:"text-caption font-bold shrink-0",style:{color:"var(--text-secondary)"},children:"Cloud URL:"}),d.jsx("input",{type:"text",value:M,onChange:z=>{L(z.target.value.replace(/\/+$/,"")),D(!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}),d.jsx("button",{onClick:()=>$(!1),className:"px-2.5 py-1 text-tiny font-medium rounded-sm",style:{background:"var(--bg-active)",color:"#fff"},children:"Done"})]}),d.jsx("div",{className:"ml-8",children:o?d.jsx("div",{className:"rounded-md px-3 py-2.5 animate-pulse",style:{background:"var(--code-bg)",height:"80px"}}):d.jsx(du,{code:se,multiline:!0})})]}),d.jsxs("div",{className:"mb-6",style:{opacity:v?1:.4,pointerEvents:v?"auto":"none"},children:[d.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[d.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"}),d.jsx("h3",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:"Verify connection"})]}),d.jsx("p",{className:"text-caption ml-8",style:{color:"var(--text-secondary)"},children:'Check the gateway logs — you should see "Authenticated with BotsChat cloud":'}),d.jsx("div",{className:"ml-8 mt-2",children:d.jsx(du,{code:"openclaw gateway logs"})})]}),d.jsxs("details",{className:"mb-4",children:[d.jsx("summary",{className:"text-caption font-medium cursor-pointer select-none",style:{color:"var(--text-link)"},children:"Or configure manually"}),d.jsxs("div",{className:"mt-3 space-y-3 ml-1",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-caption font-bold mb-1",style:{color:"var(--text-secondary)"},children:"Your Pairing Token"}),r?d.jsx(du,{code:r}):d.jsx("span",{className:"text-caption",style:{color:"var(--text-muted)"},children:"Loading..."})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-caption font-bold mb-1",style:{color:"var(--text-secondary)"},children:"Cloud URL"}),d.jsx(du,{code:M})]})]})]}),d.jsx("div",{className:"text-center pt-2",children:d.jsx("button",{onClick:e,className:"text-caption hover:underline",style:{color:"var(--text-muted)"},children:"Skip for now"})})]})})]})})})}function TS({text:e}){const[t,r]=C.useState(!1),a=async()=>{try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),2e3)}catch{const o=document.createElement("textarea");o.value=e,document.body.appendChild(o),o.select(),document.execCommand("copy"),document.body.removeChild(o),r(!0),setTimeout(()=>r(!1),2e3)}};return d.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 tD({code:e}){return d.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:[d.jsx("pre",{className:"flex-1 text-caption font-mono overflow-x-auto whitespace-pre-wrap break-all",style:{color:"var(--text-primary)"},children:e}),d.jsx(TS,{text:e})]})}function nD(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 NS(){const e=Zn(),[t,r]=C.useState([]),[a,o]=C.useState(!0),[c,u]=C.useState(typeof window<"u"?window.location.origin:"https://console.botschat.app"),[f,h]=C.useState(!1),[m,b]=C.useState(),[y,v]=C.useState(!1),[x,S]=C.useState(!1),[_,N]=C.useState(""),[T,O]=C.useState(!1),[R,M]=C.useState(null);C.useEffect(()=>{let $=!1;return P1.cloudUrl().then(Y=>{$||(u(Y.cloudUrl),h(Y.isLoopback),b(Y.hint))}).catch(Y=>{Z.warn("ConnectionSettings",`Failed to fetch cloudUrl: ${Y}`);const te=window.location.hostname,se=te==="localhost"||te.startsWith("127.");h(se),se&&b("This URL (localhost) only works on this machine. If your OpenClaw is on a different host, replace with its LAN IP.")}),()=>{$=!0}},[]),C.useEffect(()=>{let $=!1;return o(!0),Xo.list().then(({tokens:Y})=>{$||r(Y)}).catch(Y=>{Z.error("ConnectionSettings",`Failed to list tokens: ${Y}`)}).finally(()=>{$||o(!1)}),()=>{$=!0}},[]);const L=C.useCallback(async()=>{O(!0);try{const $=await Xo.create(_.trim()||void 0);M({id:$.id,token:$.token});const{tokens:Y}=await Xo.list();r(Y),N(""),S(!1)}catch($){Z.error("ConnectionSettings",`Failed to create token: ${$}`)}finally{O(!1)}},[_]),w=C.useCallback(async $=>{try{await Xo.delete($),r(Y=>Y.filter(te=>te.id!==$)),(R==null?void 0:R.id)===$&&M(null)}catch(Y){Z.error("ConnectionSettings",`Failed to revoke token: ${Y}`)}},[R]),D=(R==null?void 0:R.token)??null,F=Ge.getPassword(),J=D?`openclaw plugins install @botschat/botschat && \\
|
|
1503
|
-
openclaw config set channels.botschat.cloudUrl ${c} && \\
|
|
1504
|
-
openclaw config set channels.botschat.pairingToken ${D} && \\${F?`
|
|
1505
|
-
openclaw config set channels.botschat.e2ePassword "${F}" && \\`:""}
|
|
1506
|
-
openclaw config set channels.botschat.enabled true && \\
|
|
1507
|
-
openclaw gateway restart`:null,P=e.openclawConnected;return d.jsxs("div",{className:"space-y-5",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-caption font-bold mb-1.5",style:{color:"var(--text-secondary)"},children:"OpenClaw Status"}),d.jsxs("div",{className:"flex items-center gap-3 rounded-md px-4 py-3",style:{background:P?"rgba(43, 172, 118, 0.1)":"rgba(232, 162, 48, 0.1)",border:`1px solid ${P?"rgba(43, 172, 118, 0.3)":"rgba(232, 162, 48, 0.3)"}`},children:[d.jsx("span",{className:"w-2.5 h-2.5 rounded-full shrink-0",style:{background:P?"var(--accent-green)":"var(--accent-yellow)"}}),d.jsx("span",{className:"text-caption font-medium",style:{color:P?"var(--accent-green)":"var(--accent-yellow)"},children:P?"Connected to OpenClaw":"Not connected"})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-caption font-bold mb-1.5",style:{color:"var(--text-secondary)"},children:"Setup Command"}),d.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."}),f&&d.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:[d.jsx("svg",{className:"w-3.5 h-3.5 mt-0.5 shrink-0",viewBox:"0 0 20 20",fill:"currentColor",children:d.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"})}),d.jsxs("span",{children:[m||"localhost URL may not be reachable from other machines."," ",d.jsx("button",{onClick:()=>v(!0),className:"underline font-medium hover:brightness-110",style:{color:"var(--text-link)"},children:"Change URL"})]})]}),y&&d.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[d.jsx("label",{className:"text-tiny font-bold shrink-0",style:{color:"var(--text-secondary)"},children:"Cloud URL:"}),d.jsx("input",{type:"text",value:c,onChange:$=>{u($.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}),d.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?d.jsx("div",{className:"rounded-md px-3 py-2.5 animate-pulse",style:{background:"var(--code-bg)",height:"64px"}}):J?d.jsx(tD,{code:J}):d.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&&d.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[d.jsx("span",{className:"text-tiny",style:{color:"var(--text-muted)"},children:"Cloud URL:"}),d.jsx("code",{className:"text-tiny font-mono",style:{color:"var(--text-secondary)"},children:c}),d.jsx("button",{onClick:()=>v(!0),className:"text-tiny hover:underline",style:{color:"var(--text-link)"},children:"Edit"})]})]}),d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[d.jsx("label",{className:"text-caption font-bold",style:{color:"var(--text-secondary)"},children:"Pairing Tokens"}),d.jsx("button",{onClick:()=>S(!x),className:"text-tiny font-medium hover:underline",style:{color:"var(--text-link)"},children:x?"Cancel":"+ New Token"})]}),x&&d.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:[d.jsx("input",{type:"text",value:_,onChange:$=>N($.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:$=>{$.key==="Enter"&&L()},autoFocus:!0}),d.jsx("button",{onClick:L,disabled:T,className:"px-3 py-1 text-tiny font-medium rounded-sm text-white",style:{background:T?"var(--text-muted)":"var(--bg-active)"},children:T?"Creating...":"Create"})]}),R&&d.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:[d.jsxs("div",{className:"flex items-center justify-between mb-1",children:[d.jsx("span",{className:"text-tiny font-bold",style:{color:"var(--accent-green)"},children:"New token created — copy it now (only shown once)"}),d.jsx("button",{onClick:()=>M(null),className:"text-tiny",style:{color:"var(--text-muted)"},children:"Dismiss"})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("code",{className:"flex-1 text-tiny font-mono break-all",style:{color:"var(--text-primary)"},children:R.token}),d.jsx(TS,{text:R.token})]})]}),a?d.jsx("div",{className:"rounded-md px-3 py-4 animate-pulse",style:{background:"var(--code-bg)"}}):t.length===0?d.jsx("p",{className:"text-tiny py-2",style:{color:"var(--text-muted)"},children:"No active pairing tokens. Create one to connect your OpenClaw agent."}):d.jsx("div",{className:"space-y-1",children:t.map($=>d.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:[d.jsx("code",{className:"text-tiny font-mono shrink-0",style:{color:"var(--text-primary)"},children:$.tokenPreview}),$.label&&d.jsx("span",{className:"text-tiny px-1.5 py-0.5 rounded",style:{background:"var(--bg-hover)",color:"var(--text-secondary)"},children:$.label}),d.jsx("span",{className:"flex-1"}),d.jsx("span",{className:"text-tiny",style:{color:"var(--text-muted)"},children:$.lastConnectedAt?nD($.lastConnectedAt):"Never connected"}),d.jsx("button",{onClick:()=>w($.id),className:"text-tiny font-medium hover:underline shrink-0",style:{color:"var(--accent-red)"},title:"Revoke this token",children:"Revoke"})]},$.id))})]})]})}function CS(){const{user:e}=_a.useContext(Ea),[t,r]=C.useState(Ge.hasKey()),[a,o]=C.useState(""),[c,u]=C.useState(!1),[f,h]=C.useState(!1),[m,b]=C.useState(null),[y,v]=C.useState(!1),[x,S]=C.useState(!1),[_,N]=C.useState(!1);C.useEffect(()=>Ge.subscribe(()=>{r(Ge.hasKey())}),[]),C.useEffect(()=>{Eu.me().then(M=>{var L;(L=M==null?void 0:M.settings)!=null&&L.notifyPreview&&S(!0)}).catch(()=>{})},[]);const T=async M=>{S(M),N(!0);try{await z1.updateSettings({notifyPreview:M})}catch(L){console.error("Failed to update notification preview setting:",L),S(!M)}finally{N(!1)}},O=async()=>{if(!(!a||!e)){h(!0),b(null);try{await Ge.setPassword(a,e.id,c),o("")}catch{b("Failed to set password. check logs.")}finally{h(!1)}}},R=()=>{Ge.clear()};return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h3",{className:"text-h3 font-bold mb-2",style:{color:"var(--text-primary)"},children:"End-to-End Encryption"}),d.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."})]}),d.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:[d.jsxs("div",{className:"flex items-center justify-between mb-4",children:[d.jsx("span",{className:"font-bold flex items-center gap-2",style:{color:t?"var(--success)":"var(--error)"},children:t?d.jsxs(d.Fragment,{children:[d.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.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)"]}):d.jsxs(d.Fragment,{children:[d.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.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&&d.jsx("button",{onClick:R,className:"text-caption font-bold hover:underline",style:{color:"var(--accent-red, #e53e3e)"},children:"Lock / Clear Key"})]}),!t&&d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-caption font-bold mb-1",style:{color:"var(--text-secondary)"},children:"E2E Password"}),d.jsxs("div",{className:"relative",children:[d.jsx("input",{type:y?"text":"password",value:a,onChange:M=>o(M.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"}),d.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?d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.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"}),d.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"}),d.jsx("path",{d:"M14.12 14.12a3 3 0 1 1-4.24-4.24"}),d.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}):d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),d.jsx("circle",{cx:"12",cy:"12",r:"3"})]})})]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("input",{type:"checkbox",id:"remember-e2e",checked:c,onChange:M=>u(M.target.checked)}),d.jsx("label",{htmlFor:"remember-e2e",className:"text-caption",style:{color:"var(--text-secondary)"},children:"Remember on this device"})]}),m&&d.jsx("p",{className:"text-caption text-red-500",children:m}),d.jsx("button",{onClick:O,disabled:!a||f,className:"px-4 py-2 rounded font-bold w-full",style:{background:"var(--bg-active, #6366f1)",color:"#fff",opacity:!a||f?.5:1},children:f?"Deriving Key...":"Unlock / Set Password"})]})]}),d.jsxs("div",{className:"p-4 rounded-md border",style:{borderColor:"var(--border)",background:"var(--bg-surface)"},children:[d.jsxs("div",{className:"flex items-center justify-between mb-3",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{color:"var(--text-secondary)"},children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"})}),d.jsx("span",{className:"text-caption font-bold",style:{color:"var(--text-primary)"},children:"Notification Preview"})]}),d.jsx("button",{role:"switch","aria-checked":x,onClick:()=>T(!x),disabled:_,className:"relative inline-flex h-6 w-11 items-center rounded-full transition-colors",style:{background:x?"var(--bg-active, #6366f1)":"var(--border)",opacity:_?.5:1},children:d.jsx("span",{className:"inline-block h-4 w-4 rounded-full bg-white transition-transform",style:{transform:x?"translateX(1.375rem)":"translateX(0.25rem)"}})})]}),d.jsx("p",{className:"text-caption mb-2",style:{color:"var(--text-muted)"},children:"Show message text in push notifications on iOS and Android."}),x&&d.jsxs("div",{className:"p-3 rounded border text-caption",style:{borderColor:"var(--accent-yellow, #d69e2e)",background:"rgba(214, 158, 46, 0.08)",color:"var(--text-secondary)"},children:[d.jsx("p",{className:"font-bold mb-1",style:{color:"var(--accent-yellow, #d69e2e)"},children:"Security trade-off"}),d.jsxs("ul",{className:"list-disc ml-4 space-y-0.5",children:[d.jsx("li",{children:"Message previews will briefly pass through our server to deliver notifications."}),d.jsxs("li",{children:["Previews are ",d.jsx("strong",{children:"never stored"})," — they exist only in memory during delivery."]}),d.jsx("li",{children:"Your full message history remains end-to-end encrypted."}),d.jsx("li",{children:"Web browser notifications are not affected (they decrypt locally)."})]})]})]}),d.jsxs("div",{className:"text-caption",style:{color:"var(--text-muted)"},children:[d.jsx("p",{className:"font-bold text-red-400 mb-1",children:"Warning:"}),d.jsxs("ul",{className:"list-disc ml-4 space-y-1",children:[d.jsx("li",{children:"If you lose this password, your encrypted history is lost forever."}),d.jsx("li",{children:"We do not store this password on our servers."}),d.jsx("li",{children:"You must use the same password on all devices to access your history."})]})]})]})}function rD(){var y;const e=Zn(),[t,r]=C.useState(!1),[a,o]=C.useState(""),[c,u]=C.useState(!1),[f,h]=C.useState(null),m=()=>{ai(null),Na(null),localStorage.clear(),window.location.reload()},b=async()=>{if(a==="DELETE"){u(!0),h(null);try{const v=localStorage.getItem("botschat_token"),x=await fetch("/api/auth/account",{method:"DELETE",headers:{Authorization:`Bearer ${v}`}});if(!x.ok){const S=await x.json().catch(()=>({error:x.statusText}));throw new Error(S.error??`HTTP ${x.status}`)}ai(null),Na(null),localStorage.clear(),window.location.reload()}catch(v){h(v instanceof Error?v.message:"Failed to delete account"),u(!1)}}};return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h3",{className:"text-h3 font-bold mb-2",style:{color:"var(--text-primary)"},children:"Account"}),d.jsx("div",{className:"space-y-1.5",children:d.jsxs("p",{className:"text-body",style:{color:"var(--text-secondary)"},children:[d.jsx("span",{style:{color:"var(--text-muted)"},children:"Email: "}),((y=e.user)==null?void 0:y.email)??"—"]})})]}),d.jsx("div",{children:d.jsx("button",{onClick:m,className:"px-4 py-2 rounded-md text-caption font-bold",style:{background:"var(--bg-hover)",color:"var(--text-primary)",border:"1px solid var(--border)"},children:"Sign Out"})}),d.jsxs("div",{className:"p-4 rounded-md border",style:{borderColor:"var(--accent-red, #e53e3e)",background:"rgba(255, 0, 0, 0.04)"},children:[d.jsx("h4",{className:"text-caption font-bold mb-2",style:{color:"var(--accent-red, #e53e3e)"},children:"Danger Zone"}),d.jsx("p",{className:"text-caption mb-3",style:{color:"var(--text-muted)"},children:"Permanently delete your account and all associated data (messages, channels, automations, media). This action cannot be undone."}),t?d.jsxs("div",{className:"space-y-3",children:[d.jsxs("p",{className:"text-caption font-bold",style:{color:"var(--text-primary)"},children:["Type ",d.jsx("code",{style:{color:"var(--accent-red, #e53e3e)"},children:"DELETE"})," to confirm:"]}),d.jsx("input",{type:"text",value:a,onChange:v=>o(v.target.value),className:"w-full px-3 py-2 rounded border text-body",style:{background:"var(--bg-input, var(--bg-surface))",borderColor:"var(--border)",color:"var(--text-primary)"},placeholder:"DELETE",autoFocus:!0}),f&&d.jsx("p",{className:"text-caption",style:{color:"var(--accent-red, #e53e3e)"},children:f}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{onClick:b,disabled:a!=="DELETE"||c,className:"px-4 py-2 rounded-md text-caption font-bold",style:{background:"var(--accent-red, #e53e3e)",color:"#fff",opacity:a!=="DELETE"||c?.5:1},children:c?"Deleting...":"Permanently Delete"}),d.jsx("button",{onClick:()=>{r(!1),o(""),h(null)},className:"px-4 py-2 rounded-md text-caption font-bold",style:{background:"var(--bg-hover)",color:"var(--text-primary)",border:"1px solid var(--border)"},children:"Cancel"})]})]}):d.jsx("button",{onClick:()=>r(!0),className:"px-4 py-2 rounded-md text-caption font-bold",style:{background:"var(--accent-red, #e53e3e)",color:"#fff"},children:"Delete Account"})]})]})}const pm=[{value:"openclaw",label:"OpenClaw",color:"#2BAC76"},{value:"cursor_cli",label:"Cursor CLI",color:"#3B82F6"},{value:"cursor_cloud",label:"Cursor Cloud",color:"#6366F1"},{value:"claude_code",label:"Claude Code",color:"#F59E0B"},{value:"mock",label:"Mock",color:"#9CA3AF"}],AS=[{value:"general",label:"General"},{value:"product_manager",label:"Product Manager"},{value:"developer",label:"Developer"},{value:"qa",label:"QA / Tester"},{value:"devops",label:"DevOps"}];function iD({type:e,size:t=20}){const r=pm.find(o=>o.value===e),a=(r==null?void 0:r.color)??"#9CA3AF";return d.jsx("div",{className:"shrink-0 rounded-full flex items-center justify-center font-bold",style:{width:t,height:t,background:a,color:"#fff",fontSize:t*.45},children:((r==null?void 0:r.label)??"?")[0]})}function aD({connected:e}){return d.jsx("span",{className:"inline-block rounded-full",style:{width:8,height:8,background:e?"#2BAC76":"var(--text-tertiary)"}})}function sD({onClose:e}){Zn();const t=Rr(),[r,a]=C.useState([]),[o,c]=C.useState(!0),[u,f]=C.useState(null),[h,m]=C.useState(!1),b=C.useCallback(async()=>{c(!0);try{const v=await Su.list();a(v.agents),t({type:"SET_V2_AGENTS",agents:v.agents})}catch(v){console.error("Failed to load agents:",v)}finally{c(!1)}},[t]);C.useEffect(()=>{b()},[b]);const y=async(v,x)=>{if(confirm(`Delete agent "${x}"? This cannot be undone.`))try{await Su.delete(v),await b()}catch(S){alert(`Failed to delete: ${S}`)}};return d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{background:"rgba(0,0,0,0.5)"},children:d.jsxs("div",{className:"w-full max-w-2xl max-h-[80vh] overflow-y-auto rounded-xl shadow-lg",style:{background:"var(--bg-primary)",border:"1px solid var(--border)"},children:[d.jsxs("div",{className:"flex items-center justify-between px-6 py-4",style:{borderBottom:"1px solid var(--border)"},children:[d.jsx("h2",{className:"text-body font-semibold",style:{color:"var(--text-primary)"},children:"Agent Management"}),d.jsx("button",{onClick:e,className:"text-caption",style:{color:"var(--text-secondary)"},children:"Close"})]}),d.jsx("div",{className:"px-6 py-4",children:o?d.jsx("p",{className:"text-caption",style:{color:"var(--text-secondary)"},children:"Loading agents..."}):d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"space-y-2",children:r.map(v=>{var x,S;return d.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-lg",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)"},children:[d.jsx(iD,{type:v.type}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-caption font-medium",style:{color:"var(--text-primary)"},children:v.name}),d.jsx(aD,{connected:v.status==="connected"}),d.jsx("span",{className:"text-tiny px-1.5 py-0.5 rounded",style:{background:"var(--bg-hover)",color:"var(--text-secondary)"},children:((x=AS.find(_=>_.value===v.role))==null?void 0:x.label)??v.role})]}),d.jsxs("div",{className:"text-tiny",style:{color:"var(--text-tertiary)"},children:[((S=pm.find(_=>_.value===v.type))==null?void 0:S.label)??v.type,v.skills.length>0&&` · ${v.skills.map(_=>_.name).join(", ")}`]})]}),d.jsxs("div",{className:"flex gap-1.5",children:[d.jsx("button",{onClick:()=>f(v),className:"px-2.5 py-1 text-tiny rounded-sm",style:{background:"var(--bg-hover)",color:"var(--text-secondary)"},children:"Edit"}),d.jsx("button",{onClick:()=>y(v.id,v.name),className:"px-2.5 py-1 text-tiny rounded-sm",style:{background:"var(--bg-hover)",color:"var(--accent-red)"},children:"Delete"})]})]},v.id)})}),d.jsx("button",{onClick:()=>m(!0),className:"mt-4 w-full py-2.5 text-caption font-medium rounded-lg transition-colors",style:{background:"var(--accent-blue)",color:"#fff"},children:"+ Add Agent"})]})}),(h||u)&&d.jsx(oD,{agent:u,onSave:async()=>{m(!1),f(null),await b()},onCancel:()=>{m(!1),f(null)}})]})})}function oD({agent:e,onSave:t,onCancel:r}){const a=!!e,[o,c]=C.useState((e==null?void 0:e.name)??""),[u,f]=C.useState((e==null?void 0:e.type)??"openclaw"),[h,m]=C.useState((e==null?void 0:e.role)??"general"),[b,y]=C.useState((e==null?void 0:e.systemPrompt)??""),[v,x]=C.useState((e==null?void 0:e.skills.map(L=>`${L.name}: ${L.description}`).join(`
|
|
1508
|
-
`))??""),[S,_]=C.useState(""),[N,T]=C.useState(!1),[O,R]=C.useState(""),M=async L=>{L.preventDefault(),T(!0),R("");const w=v.split(`
|
|
1509
|
-
`).map(D=>D.trim()).filter(Boolean).map(D=>{const F=D.indexOf(":");return F>0?{name:D.slice(0,F).trim(),description:D.slice(F+1).trim()}:{name:D,description:""}});try{a?await Su.update(e.id,{name:o,role:h,systemPrompt:b,skills:w}):await Su.create({name:o,type:u,role:h,systemPrompt:b,skills:w,pairingToken:S||void 0}),t()}catch(D){R(String(D))}finally{T(!1)}};return d.jsxs("div",{className:"px-6 py-4",style:{borderTop:"1px solid var(--border)"},children:[d.jsx("h3",{className:"text-caption font-semibold mb-3",style:{color:"var(--text-primary)"},children:a?`Edit ${e.name}`:"Add New Agent"}),d.jsxs("form",{onSubmit:M,className:"space-y-3",children:[d.jsxs("div",{className:"flex gap-3",children:[d.jsxs("label",{className:"flex-1",children:[d.jsx("span",{className:"text-tiny block mb-1",style:{color:"var(--text-secondary)"},children:"Name"}),d.jsx("input",{value:o,onChange:L=>c(L.target.value),className:"w-full px-3 py-2 text-caption rounded-md",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"},required:!0})]}),!a&&d.jsxs("label",{className:"w-40",children:[d.jsx("span",{className:"text-tiny block mb-1",style:{color:"var(--text-secondary)"},children:"Type"}),d.jsx("select",{value:u,onChange:L=>f(L.target.value),className:"w-full px-3 py-2 text-caption rounded-md",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"},children:pm.map(L=>d.jsx("option",{value:L.value,children:L.label},L.value))})]}),d.jsxs("label",{className:"w-40",children:[d.jsx("span",{className:"text-tiny block mb-1",style:{color:"var(--text-secondary)"},children:"Role"}),d.jsx("select",{value:h,onChange:L=>m(L.target.value),className:"w-full px-3 py-2 text-caption rounded-md",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"},children:AS.map(L=>d.jsx("option",{value:L.value,children:L.label},L.value))})]})]}),d.jsxs("label",{children:[d.jsx("span",{className:"text-tiny block mb-1",style:{color:"var(--text-secondary)"},children:"System Prompt"}),d.jsx("textarea",{value:b,onChange:L=>y(L.target.value),rows:3,className:"w-full px-3 py-2 text-caption rounded-md resize-y",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"},placeholder:"You are a product manager who excels at..."})]}),d.jsxs("label",{children:[d.jsx("span",{className:"text-tiny block mb-1",style:{color:"var(--text-secondary)"},children:"Skills (one per line, format: name: description)"}),d.jsx("textarea",{value:v,onChange:L=>x(L.target.value),rows:3,className:"w-full px-3 py-2 text-caption rounded-md resize-y font-mono",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"},placeholder:`Code Review: Review code for quality and security
|
|
1510
|
-
Refactoring: Improve code structure`})]}),!a&&u==="openclaw"&&d.jsxs("label",{children:[d.jsx("span",{className:"text-tiny block mb-1",style:{color:"var(--text-secondary)"},children:"Pairing Token (optional)"}),d.jsx("input",{value:S,onChange:L=>_(L.target.value),className:"w-full px-3 py-2 text-caption rounded-md font-mono",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"},placeholder:"bc_pat_..."})]}),O&&d.jsx("p",{className:"text-tiny",style:{color:"var(--accent-red)"},children:O}),d.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[d.jsx("button",{type:"button",onClick:r,className:"px-4 py-2 text-caption rounded-md",style:{background:"var(--bg-hover)",color:"var(--text-secondary)"},children:"Cancel"}),d.jsx("button",{type:"submit",disabled:N,className:"px-4 py-2 text-caption font-medium rounded-md",style:{background:"var(--accent-blue)",color:"#fff",opacity:N?.6:1},children:N?"Saving...":a?"Update":"Create"})]})]})]})}const OS={info:"var(--text-muted)",warn:"var(--accent-yellow)",error:"var(--accent-red)","ws-in":"#6BCB77","ws-out":"#4D96FF",api:"#C77DFF"},MS={info:"INF",warn:"WRN",error:"ERR","ws-in":"WS↓","ws-out":"WS↑",api:"API"};function lD(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 Bh="botschat_debug_panel_height",m1=220,Uh=80,Ph=600;function cD(){const e=C.useSyncExternalStore(Vk,Gk),[t,r]=C.useState(!1),[a,o]=C.useState("all"),[c,u]=C.useState(new Set),f=C.useRef(null),h=C.useRef(!0),[m,b]=C.useState(()=>{try{const M=localStorage.getItem(Bh);if(M){const L=parseInt(M,10);if(L>=Uh&&L<=Ph)return L}}catch{}return m1}),y=C.useRef(!1),v=C.useRef(0),x=C.useRef(m1),S=C.useCallback(M=>{M.preventDefault(),M.stopPropagation(),y.current=!0,v.current=M.clientY,x.current=m;const L=D=>{if(!y.current)return;const F=v.current-D.clientY,J=Math.max(Uh,Math.min(Ph,x.current+F));b(J)},w=()=>{y.current&&(y.current=!1,document.removeEventListener("mousemove",L),document.removeEventListener("mouseup",w),b(D=>{try{localStorage.setItem(Bh,String(D))}catch{}return D}))};document.addEventListener("mousemove",L),document.addEventListener("mouseup",w)},[m]),_=C.useCallback(M=>{M.stopPropagation();const L=M.touches[0];y.current=!0,v.current=L.clientY,x.current=m;const w=F=>{if(!y.current)return;const J=F.touches[0],P=v.current-J.clientY,$=Math.max(Uh,Math.min(Ph,x.current+P));b($)},D=()=>{y.current&&(y.current=!1,document.removeEventListener("touchmove",w),document.removeEventListener("touchend",D),b(F=>{try{localStorage.setItem(Bh,String(F))}catch{}return F}))};document.addEventListener("touchmove",w,{passive:!1}),document.addEventListener("touchend",D)},[m]);C.useEffect(()=>{t&&h.current&&f.current&&(f.current.scrollTop=f.current.scrollHeight)},[e.length,t]);const N=()=>{if(!f.current)return;const{scrollTop:M,scrollHeight:L,clientHeight:w}=f.current;h.current=L-M-w<40},T=M=>{u(L=>{const w=new Set(L);return w.has(M)?w.delete(M):w.add(M),w})},O=a==="all"?e:e.filter(M=>M.level===a),R=e.length;return d.jsxs("div",{style:{flexShrink:0,fontFamily:"var(--font-mono)",fontSize:12,lineHeight:1.5},children:[t&&d.jsx("div",{onMouseDown:S,onTouchStart:_,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:d.jsx("div",{className:"resize-handle-line",style:{width:"100%",height:1,background:"var(--border)",transition:"height 150ms, background 150ms"}})}),d.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:[d.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:d.jsx("path",{d:"M1 7L5 3l4 4",stroke:"var(--text-muted)",strokeWidth:1.5,fill:"none"})}),d.jsx("span",{style:{color:"var(--text-muted)",fontWeight:600,fontSize:11},children:"Debug Log"}),d.jsxs("span",{style:{color:"var(--text-muted)",fontSize:10},children:["(",R,")"]}),t&&d.jsx("div",{style:{display:"flex",gap:2,marginLeft:8},onClick:M=>M.stopPropagation(),children:["all","ws-in","ws-out","api","info","warn","error"].map(M=>d.jsx("button",{onClick:()=>o(M),style:{padding:"1px 6px",borderRadius:3,border:"none",fontSize:10,fontFamily:"var(--font-mono)",cursor:"pointer",background:a===M?"var(--bg-active)":"var(--bg-hover)",color:a===M?"#fff":M==="all"?"var(--text-muted)":OS[M]},children:M==="all"?"ALL":MS[M]},M))}),t&&d.jsx("button",{onClick:M=>{M.stopPropagation(),Kk()},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&&d.jsxs("div",{ref:f,onScroll:N,style:{height:m,overflowY:"auto",overflowX:"hidden",background:"var(--bg-primary)",borderTop:"1px solid var(--border)"},children:[O.length===0&&d.jsx("div",{style:{padding:"16px 12px",color:"var(--text-muted)",textAlign:"center"},children:"No log entries yet."}),O.map(M=>d.jsx(uD,{entry:M,expanded:c.has(M.id),onToggleExpand:()=>T(M.id)},M.id))]})]})}function uD({entry:e,expanded:t,onToggleExpand:r}){const a=OS[e.level],o=MS[e.level];return d.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:[d.jsxs("div",{style:{display:"flex",gap:8,alignItems:"flex-start"},children:[d.jsx("span",{style:{color:"var(--text-muted)",flexShrink:0,width:85},children:lD(e.ts)}),d.jsx("span",{style:{color:a,fontWeight:700,flexShrink:0,width:28,textAlign:"center"},children:o}),d.jsxs("span",{style:{color:"var(--text-secondary)",flexShrink:0,minWidth:50},children:["[",e.tag,"]"]}),d.jsx("span",{style:{color:"var(--text-primary)",flex:1},children:e.message}),e.detail&&d.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&&d.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 RS({onNavigate:e}={}){const t=Zn(),r=Rr(),[a,o]=C.useState(!1),[c,u]=C.useState(""),{onCompositionStart:f,onCompositionEnd:h,isIMEActive:m}=Sl(),b=v=>{t.activeView!=="automations"&&r({type:"SET_ACTIVE_VIEW",view:"automations"}),r({type:"SELECT_CRON_TASK",taskId:v}),e==null||e()},y=async()=>{var x,S;if(!c.trim())return;let v=((x=t.channels.find(_=>_.name==="Default"))==null?void 0:x.id)??((S=t.channels[0])==null?void 0:S.id);if(!v)try{v=(await cr.create({name:"Default"})).id;const{channels:N}=await cr.list();r({type:"SET_CHANNELS",channels:N})}catch(_){Z.error("Cron",`Failed to create default channel: ${_}`);return}try{const _=await zn.create(v,{name:c.trim(),kind:"background"});Z.info("Cron",`Created automation: ${_.name} (${_.id})`);const{tasks:N}=await zn.listAll("background");r({type:"SET_CRON_TASKS",cronTasks:N}),r({type:"SELECT_CRON_TASK",taskId:_.id}),o(!1),u(""),e==null||e()}catch(_){Z.error("Cron",`Failed to create automation: ${_}`)}};return d.jsxs("div",{className:"flex flex-col",style:{background:"var(--bg-secondary)"},children:[d.jsxs("div",{className:"w-full flex items-center px-4 py-1.5",children:[d.jsx("button",{className:"flex items-center gap-1 text-tiny uppercase tracking-wider text-[--text-sidebar] hover:text-[--text-sidebar-active] transition-colors",children:"Automations"}),d.jsx("span",{className:"ml-1.5 text-tiny text-[--text-muted]",children:t.cronTasks.length>0&&`${t.cronTasks.length}`}),d.jsx("button",{onClick:()=>o(!a),className:"ml-auto p-0.5 rounded transition-colors text-[--text-sidebar] hover:text-[--text-sidebar-active] hover:bg-[--sidebar-hover]",title:"New automation",children:d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})})})]}),a&&d.jsxs("div",{className:"px-4 py-2 space-y-2",children:[d.jsx("input",{type:"text",placeholder:"Automation name",value:c,onChange:v=>u(v.target.value),onKeyDown:v=>v.key==="Enter"&&!v.nativeEvent.isComposing&&!m()&&y(),onCompositionStart:f,onCompositionEnd:h,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}),d.jsxs("div",{className:"flex gap-2",children:[d.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"}),d.jsx("button",{onClick:()=>{o(!1),u("")},className:"px-3 py-1.5 text-caption text-[--text-muted] hover:text-[--text-sidebar]",children:"Cancel"})]})]}),d.jsx("div",{className:"flex-1 overflow-y-auto sidebar-scroll",children:t.cronTasks.length===0&&!a?d.jsxs("div",{className:"px-4 py-8 text-center",children:[d.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:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})}),d.jsx("p",{className:"text-caption text-[--text-muted]",children:"No automations yet."}),d.jsx("p",{className:"text-tiny text-[--text-muted] mt-1",children:"Cron jobs from OpenClaw will appear here automatically."})]}):t.cronTasks.map(v=>{const x=t.selectedCronTaskId===v.id,S=v.enabled;let _="var(--accent-green)";return S||(_="var(--text-muted)"),d.jsxs("button",{onClick:()=>b(v.id),className:"w-full text-left py-2 transition-colors",style:{paddingLeft:x?13:16,paddingRight:16,background:x?"var(--bg-hover)":void 0,borderLeft:x?"3px solid var(--bg-active)":"3px solid transparent",color:x?"var(--text-sidebar-active)":"var(--text-sidebar)"},onMouseEnter:N=>{x||(N.currentTarget.style.background="var(--sidebar-hover)")},onMouseLeave:N=>{x||(N.currentTarget.style.background=x?"var(--bg-hover)":"")},children:[d.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d.jsx("div",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:_}}),d.jsx("span",{className:`text-body truncate ${x?"font-bold":""}`,children:v.name})]}),d.jsxs("div",{className:"flex items-center gap-2 mt-0.5 pl-4",children:[d.jsx("span",{className:"text-tiny truncate",style:{color:"var(--text-muted)"},children:v.schedule??"no schedule"}),!S&&d.jsx("span",{className:"text-tiny",style:{color:"var(--text-muted)"},children:"paused"})]})]},v.id)})})]})}function xp(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})$/);if(a)return{kind:"at",atTime:a[1].padStart(5,"0")};const o=e.trim().match(/^cron\s+(.+)$/i);return o?{kind:"cron",cronExpr:o[1].trim()}:null}function dD(e){return e.kind==="every"&&e.intervalValue&&e.intervalUnit?`every ${e.intervalValue}${e.intervalUnit}`:e.kind==="at"&&e.atTime?`at ${e.atTime}`:e.kind==="cron"&&e.cronExpr?`cron ${e.cronExpr}`:""}function IS(e){const t=e.trim().split(/\s+/);if(t.length<5)return e;const[r,a,o,c,u]=t;if(o==="*"&&c==="*"&&u==="*"&&!r.includes(",")&&!a.includes(",")){const h=a.padStart(2,"0"),m=r.padStart(2,"0");return`Daily at ${h}:${m}`}if(o==="*"&&c==="*"&&u==="*"&&a.includes(","))return`Daily at ${a.split(",").map(m=>`${m.padStart(2,"0")}:${r.padStart(2,"0")}`).join(", ")}`;const f=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];return o==="*"&&c==="*"&&/^\d$/.test(u)?`${f[parseInt(u)]??u} at ${a.padStart(2,"0")}:${r.padStart(2,"0")}`:e}function fD({value:e,onChange:t,onSave:r,onCancel:a,saving:o}){const c=xp(e),[u,f]=C.useState((c==null?void 0:c.kind)??"every"),[h,m]=C.useState((c==null?void 0:c.intervalValue)??1),[b,y]=C.useState((c==null?void 0:c.intervalUnit)??"h"),[v,x]=C.useState((c==null?void 0:c.atTime)??"09:00"),[S,_]=C.useState((c==null?void 0:c.cronExpr)??"0 9 * * *");C.useEffect(()=>{const D=xp(e);D&&(f(D.kind),D.kind==="every"?(m(D.intervalValue??1),y(D.intervalUnit??"h")):D.kind==="at"?x(D.atTime??"09:00"):D.kind==="cron"&&_(D.cronExpr??"0 9 * * *"))},[e]);const N=C.useCallback((D,F,J,P,$)=>{const Y=dD(D==="every"?{kind:"every",intervalValue:F,intervalUnit:J}:D==="cron"?{kind:"cron",cronExpr:$}:{kind:"at",atTime:P});t(Y)},[t]),T=D=>{f(D),N(D,h,b,v,S)},O=D=>{const F=Math.max(1,Math.min(D,999));m(F),N(u,F,b,v,S)},R=D=>{y(D),N(u,h,D,v,S)},M=D=>{x(D),N(u,h,b,D,S)},L=D=>{_(D),N(u,h,b,v,D)},w=D=>{D.key==="Escape"&&a(),D.key==="Enter"&&(D.preventDefault(),r())};return d.jsxs("div",{className:"flex flex-col gap-2",onKeyDown:w,children:[d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(Hh,{active:u==="every",onClick:()=>T("every"),label:"Interval",icon:d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:d.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"})})}),d.jsx(Hh,{active:u==="at",onClick:()=>T("at"),label:"Daily at",icon:d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})})}),d.jsx(Hh,{active:u==="cron",onClick:()=>T("cron"),label:"Cron",icon:d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5"})})})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[u==="every"?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-caption flex-shrink-0",style:{color:"var(--text-muted)"},children:"Every"}),d.jsx("input",{type:"number",min:1,max:999,value:h,onChange:D=>O(parseInt(D.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}),d.jsxs("div",{className:"flex items-center gap-0.5",children:[d.jsx(Fh,{active:b==="m",onClick:()=>R("m"),label:"min"}),d.jsx(Fh,{active:b==="h",onClick:()=>R("h"),label:"hr"}),d.jsx(Fh,{active:b==="s",onClick:()=>R("s"),label:"sec"})]})]}):u==="cron"?d.jsx(d.Fragment,{children:d.jsx("input",{type:"text",value:S,onChange:D=>L(D.target.value),placeholder:"0 9 * * *",className:"text-body font-mono px-2 py-1 rounded-sm focus:outline-none flex-1 min-w-[140px]",style:{background:"var(--bg-hover)",color:"var(--text-primary)",border:"1px solid var(--bg-active)"},autoFocus:!0})}):d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-caption flex-shrink-0",style:{color:"var(--text-muted)"},children:"Daily at"}),d.jsx("input",{type:"time",value:v,onChange:D=>M(D.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})]}),d.jsxs("div",{className:"flex items-center gap-1 ml-auto flex-shrink-0",children:[d.jsx("button",{onClick:r,disabled:o,className:"px-2 py-1 text-tiny font-bold text-white rounded-sm disabled:opacity-50",style:{background:"var(--bg-active)"},children:o?"...":"Save"}),d.jsx("button",{onClick:a,className:"px-2 py-1 text-tiny rounded-sm",style:{color:"var(--text-muted)"},children:"Cancel"})]})]}),d.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":""}`:u==="cron"?`Runs: ${IS(S)}`:`Runs daily at ${v}`})]})}function hD({schedule:e,onClick:t}){if(!e)return d.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=xp(e);if(!r)return d.jsx("span",{className:"text-body cursor-pointer hover:underline",style:{color:"var(--text-primary)"},onClick:t,title:"Click to edit schedule",children:e});const a={every:d.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:d.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"})}),at:d.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:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})}),cron:d.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:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5"})})},o={every:`Every ${r.intervalValue}${r.intervalUnit==="h"?"h":r.intervalUnit==="m"?"m":"s"}`,at:`Daily at ${r.atTime}`,cron:IS(r.cronExpr??"")};return d.jsxs("button",{className:"flex items-center gap-1.5 cursor-pointer group",onClick:t,title:"Click to edit schedule",children:[a[r.kind],d.jsx("span",{className:"text-body group-hover:underline",style:{color:"var(--text-primary)"},children:o[r.kind]})]})}function Hh({active:e,onClick:t,label:r,icon:a}){return d.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 Fh({active:e,onClick:t,label:r}){return d.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 dl({direction:e="horizontal",className:t=""}){const r=e==="vertical";return d.jsx(D1,{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:d.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)"}})})}function g1(e){return new Date(e*1e3).toLocaleString()}function LS(e){switch(e){case"ok":return"OK";case"error":return"ERR";case"skipped":return"SKIP";case"running":return"RUN";default:return e.toUpperCase()}}function DS(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 jS(){const e=Zn(),t=Rr(),r=Jp(),a=e.cronTasks.find(V=>V.id===e.selectedCronTaskId),[o,c]=C.useState(null),[u,f]=C.useState(""),[h,m]=C.useState(!1),[b,y]=C.useState(!1),[v,x]=C.useState(!1),[S,_]=C.useState(!1),[N,T]=C.useState(!0),O=C.useRef(null);C.useEffect(()=>{c(null),y(!1)},[e.selectedCronTaskId]),C.useEffect(()=>{o&&O.current&&O.current.focus()},[o]);const R=C.useCallback(()=>{a&&(Z.info("Cron",`Loading jobs for task: ${a.name} (${a.id})`),Vh.listByTask(a.id).then(({jobs:V})=>{Z.info("Cron",`Loaded ${V.length} jobs for task ${a.name}`);const z=M.current,re=new Map;for(const ye of z)ye.summary&&re.set(ye.id,ye.summary);const oe=V.map(ye=>{var j;const I=re.get(ye.id);return I&&I.length>(((j=ye.summary)==null?void 0:j.length)||0)?{...ye,summary:I}:ye});t({type:"SET_CRON_JOBS",cronJobs:oe}),V.length>0&&!e.selectedCronJobId&&t({type:"SELECT_CRON_JOB",jobId:V[0].id,sessionKey:V[0].sessionKey})}).catch(V=>{Z.error("Cron",`Failed to load jobs: ${V}`)}))},[a==null?void 0:a.id]);C.useEffect(()=>{R()},[R]);const M=C.useRef(e.cronJobs);C.useEffect(()=>{M.current=e.cronJobs},[e.cronJobs]),C.useEffect(()=>{if(!e.cronJobs.some(oe=>oe.status==="running")||!a)return;const z=a.id,re=setInterval(()=>{Z.info("Cron","Auto-refreshing jobs (running job detected)"),Vh.listByTask(z).then(({jobs:oe})=>{const ye=M.current,I=new Map;for(const Q of ye)Q.summary&&I.set(Q.id,Q.summary);const j=oe.map(Q=>{var be;const A=I.get(Q.id);return A&&A.length>(((be=Q.summary)==null?void 0:be.length)||0)?{...Q,summary:A}:Q});t({type:"SET_CRON_JOBS",cronJobs:j})}).catch(()=>{})},3e3);return()=>clearInterval(re)},[e.cronJobs,a==null?void 0:a.id]);const L=C.useCallback(async()=>{if(!a)return;const V=!a.enabled;Z.info("Cron",`Toggle task "${a.name}": ${a.enabled?"enabled → disabled":"disabled → enabled"}`),t({type:"UPDATE_CRON_TASK",taskId:a.id,updates:{enabled:V}});try{await zn.update(a.channelId,a.id,{schedule:a.schedule??"",instructions:a.instructions??"",enabled:V,model:a.model??""})}catch(z){Z.error("Cron",`Failed to toggle task: ${z}`),t({type:"UPDATE_CRON_TASK",taskId:a.id,updates:{enabled:a.enabled}})}},[a]),w=C.useCallback(V=>{const z=e.cronJobs.find(re=>re.id===V);z&&(Z.info("Cron",`Selected job #${z.number||V} (status=${z.status})`),t({type:"SELECT_CRON_JOB",jobId:z.id,sessionKey:z.sessionKey||void 0}))},[e.cronJobs]),D=V=>{if(!a)return;const z=V==="name"?a.name:V==="schedule"?a.schedule??"":a.instructions??"";f(z),c(V)},F=C.useCallback(async V=>{if(!a)return;Z.info("Cron",`Change model for "${a.name}": → ${V||"default"}`);const z=a.model;t({type:"UPDATE_CRON_TASK",taskId:a.id,updates:{model:V||null}});try{await zn.update(a.channelId,a.id,{schedule:a.schedule??"",instructions:a.instructions??"",enabled:a.enabled,model:V})}catch(re){Z.error("Cron",`Failed to update task model: ${re}`),t({type:"UPDATE_CRON_TASK",taskId:a.id,updates:{model:z}})}},[a]),J=C.useCallback(async()=>{if(!(!a||S)){Z.info("Cron",`Triggering immediate run for "${a.name}"`),_(!0);try{await zn.run(a.channelId,a.id),Z.info("Cron",`Task "${a.name}" triggered successfully`),setTimeout(()=>{R()},1500)}catch(V){Z.error("Cron",`Failed to trigger task: ${V}`)}finally{_(!1)}}},[a,S,R]),P=()=>{c(null),f("")},$=async()=>{if(!(!a||!o)){Z.info("Cron",`Save edit "${o}" for "${a.name}": ${u.length>80?u.slice(0,80)+"…":u}`),m(!0);try{if(o==="name")t({type:"UPDATE_CRON_TASK",taskId:a.id,updates:{name:u}}),await zn.update(a.channelId,a.id,{name:u});else{const V={[o]:u};t({type:"UPDATE_CRON_TASK",taskId:a.id,updates:V}),await zn.update(a.channelId,a.id,{schedule:o==="schedule"?u:a.schedule??"",instructions:o==="instructions"?u:a.instructions??"",enabled:a.enabled,model:a.model??""})}c(null)}catch(V){Z.error("Cron",`Failed to update task field "${o}": ${V}`)}finally{m(!1)}}},Y=async()=>{if(a){Z.info("Cron",`Deleting task: "${a.name}" (${a.id})`),x(!0);try{await zn.delete(a.channelId,a.id),Z.info("Cron",`Task deleted: "${a.name}"`);const{tasks:V}=await zn.listAll("background");t({type:"SET_CRON_TASKS",cronTasks:V}),t({type:"SELECT_CRON_TASK",taskId:V.length>0?V[0].id:null}),y(!1)}catch(V){Z.error("Cron",`Failed to delete task: ${V}`)}finally{x(!1)}}},te=V=>{V.key==="Escape"&&P(),V.key==="Enter"&&!V.shiftKey&&o!=="instructions"&&(V.preventDefault(),$())};if(!a)return d.jsx("div",{className:"flex-1 h-full flex items-center justify-center",style:{background:"var(--bg-surface)"},children:d.jsxs("div",{className:"text-center",children:[d.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:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})}),d.jsx("p",{className:"text-body font-bold",style:{color:"var(--text-muted)"},children:"Select an automation"}),d.jsx("p",{className:"text-caption mt-1",style:{color:"var(--text-muted)"},children:"Choose a cron job from the sidebar to view details"})]})});const se=e.channels.find(V=>V.id===a.channelId);return d.jsxs("div",{className:"flex-1 h-full flex flex-col min-w-0",style:{background:"var(--bg-surface)"},children:[d.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:[d.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 min-w-0 flex-1",children:[d.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:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})}),o==="name"?d.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d.jsx("input",{ref:O,value:u,onChange:V=>f(V.target.value),onKeyDown:te,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}}),d.jsx(zS,{saving:h,onSave:$,onCancel:P})]}):d.jsx("h2",{className:"text-h2 font-bold truncate cursor-pointer hover:underline",style:{color:"var(--text-primary)"},onClick:()=>D("name"),title:"Click to edit name",children:a.name}),!a.enabled&&d.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"})]}),d.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 flex-shrink-0",children:[d.jsxs("button",{onClick:J,disabled:S,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:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{d:"M8 5v14l11-7z"})}),d.jsx("span",{className:"hidden sm:inline",children:S?"Running...":"Run Now"})]}),d.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:d.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:d.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"})})}),d.jsxs("button",{onClick:L,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:[d.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:d.jsx("div",{className:"w-3 h-3 rounded-full bg-white absolute top-0.5 transition-all",style:{left:a.enabled?14:2}})}),d.jsx("span",{className:"hidden sm:inline",children:a.enabled?"Enabled":"Disabled"})]})]})]}),b&&d.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:[d.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d.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:d.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"})}),d.jsxs("span",{className:"text-caption",style:{color:"var(--accent-red)"},children:['Delete "',a.name,'"?']})]}),d.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[d.jsx("button",{onClick:Y,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"}),d.jsx("button",{onClick:()=>y(!1),className:"px-3 py-1.5 text-caption rounded-sm",style:{color:"var(--text-muted)"},children:"Cancel"})]})]}),d.jsx(pD,{task:a,channel:se,state:e,isMobile:r,infoExpanded:N,setInfoExpanded:T,editingField:o,editValue:u,setEditValue:f,editRef:O,handleKeyDown:te,saving:h,saveEdit:$,cancelEdit:P,startEdit:D,handleModelSelectChange:F,handleSelectJob:w})]})}function pD({task:e,channel:t,state:r,isMobile:a,infoExpanded:o,setInfoExpanded:c,editingField:u,editValue:f,setEditValue:h,editRef:m,handleKeyDown:b,saving:y,saveEdit:v,cancelEdit:x,startEdit:S,handleModelSelectChange:_,handleSelectJob:N}){const T=yu({id:"botschat-cron-detail-v"}),[O,R]=C.useState(40),M=C.useRef(null),L=C.useRef({startY:0,startPct:40}),w=C.useCallback(J=>{J.preventDefault(),L.current.startY=J.touches[0].clientY,L.current.startPct=O;const P=Y=>{if(Y.preventDefault(),!M.current)return;const te=M.current.getBoundingClientRect().height,se=(Y.touches[0].clientY-L.current.startY)/te*100;R(Math.max(10,Math.min(70,L.current.startPct+se)))},$=()=>{document.removeEventListener("touchmove",P),document.removeEventListener("touchend",$)};document.addEventListener("touchmove",P,{passive:!1}),document.addEventListener("touchend",$)},[O]),D=C.useCallback(J=>{J.preventDefault(),L.current.startY=J.clientY,L.current.startPct=O;const P=Y=>{if(!M.current)return;const te=M.current.getBoundingClientRect().height,se=(Y.clientY-L.current.startY)/te*100;R(Math.max(10,Math.min(70,L.current.startPct+se)))},$=()=>{document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",$)};document.addEventListener("mousemove",P),document.addEventListener("mouseup",$)},[O]),F=d.jsxs("div",{className:"h-full flex flex-col",children:[d.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(!o),children:[d.jsx("svg",{className:`w-3 h-3 transition-transform ${o?"rotate-0":"-rotate-90"}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})}),"Task Details"]}),o&&d.jsxs("div",{className:"flex-1 overflow-y-auto px-4 sm:px-5 pb-4 space-y-4",children:[u==="schedule"?d.jsx("div",{children:d.jsx(Fi,{label:"Schedule",children:d.jsx(fD,{value:f,onChange:h,onSave:v,onCancel:x,saving:y})})}):d.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 sm:gap-4",children:[d.jsx(Fi,{label:"Schedule",children:d.jsx(hD,{schedule:e.schedule,onClick:()=>S("schedule")})}),d.jsx(Fi,{label:"Model",children:d.jsx(Mp,{value:e.model??"",onChange:_,models:r.models,placeholder:"Default"})}),d.jsx(Fi,{label:"Channel",children:d.jsx("span",{className:"text-body",style:{color:"var(--text-primary)"},children:(t==null?void 0:t.name)??"Default"})}),d.jsx(Fi,{label:"Status",children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:e.enabled?"var(--accent-green)":"var(--accent-yellow)"}}),d.jsx("span",{className:"text-body",style:{color:"var(--text-primary)"},children:e.enabled?"Active":"Paused"})]})})]}),d.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 sm:gap-4",children:[d.jsx(Fi,{label:"Cron Job ID",children:d.jsx("span",{className:"text-caption font-mono",style:{color:"var(--text-secondary)"},children:e.providerJobId??"N/A"})}),d.jsx(Fi,{label:"Created",children:d.jsx("span",{className:"text-caption",style:{color:"var(--text-secondary)"},children:e.createdAt?g1(e.createdAt):"N/A"})}),d.jsx(Fi,{label:"Updated",children:d.jsx("span",{className:"text-caption",style:{color:"var(--text-secondary)"},children:e.updatedAt?g1(e.updatedAt):"N/A"})})]}),d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-1",children:[d.jsx("span",{className:"text-tiny uppercase tracking-wider",style:{color:"var(--text-muted)"},children:"Prompt / Instructions"}),u!=="instructions"&&d.jsx("button",{onClick:()=>S("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"?d.jsxs("div",{children:[d.jsx("textarea",{ref:m,value:f,onChange:J=>h(J.target.value),onKeyDown:J=>{J.key==="Escape"&&x(),J.key==="Enter"&&(J.metaKey||J.ctrlKey)&&(J.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}}),d.jsxs("div",{className:"flex items-center justify-between mt-2",children:[d.jsx("span",{className:"text-tiny",style:{color:"var(--text-muted)"},children:"Cmd/Ctrl+Enter to save, Esc to cancel"}),d.jsx(zS,{saving:y,onSave:v,onCancel:x})]})]}):d.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:()=>S("instructions"),title:"Click to edit",children:e.instructions||"No instructions set. Click to add a prompt for this cron task."})]})]})]});return a?d.jsxs("div",{ref:M,className:"flex-1 min-h-0 flex flex-col",children:[d.jsx("div",{className:"flex-shrink-0 overflow-y-auto",style:{...o?{height:`${O}%`}:{},borderBottom:"1px solid var(--border)"},children:F}),o&&d.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:w,onMouseDown:D,children:d.jsx("div",{className:"rounded-full",style:{width:36,height:4,background:"var(--text-muted)",opacity:.4}})}),d.jsx(b1,{cronJobs:r.cronJobs,selectedCronJobId:r.selectedCronJobId,handleSelectJob:N,mobile:!0})]}):d.jsxs(hl,{orientation:"vertical",defaultLayout:T.defaultLayout,onLayoutChanged:T.onLayoutChanged,id:"botschat-cron-detail-v",className:"flex-1 min-h-0",children:[d.jsx(Cr,{id:"cron-info",defaultSize:"40%",minSize:"5%",maxSize:"70%",children:d.jsx("div",{className:"h-full",style:{borderBottom:"1px solid var(--border)"},children:F})}),d.jsx(dl,{direction:"vertical"}),d.jsx(Cr,{id:"cron-content-area",children:d.jsx(b1,{cronJobs:r.cronJobs,selectedCronJobId:r.selectedCronJobId,handleSelectJob:N,mobile:!1})})]})}function b1({cronJobs:e,selectedCronJobId:t,handleSelectJob:r,mobile:a}){const o=yu({id:"botschat-cron-content"}),[c,u]=C.useState(!1),f=m=>{r(m),u(!0)},h=d.jsxs("div",{className:"overflow-y-auto h-full",children:[d.jsxs("div",{className:"px-3 py-2",style:{borderBottom:"1px solid var(--border)"},children:[d.jsx("span",{className:"text-tiny uppercase tracking-wider font-bold",style:{color:"var(--text-muted)"},children:"Execution History"}),d.jsxs("span",{className:"text-tiny ml-1",style:{color:"var(--text-muted)"},children:["(",e.length,")"]})]}),e.length===0?d.jsxs("div",{className:"px-4 py-6 text-center",children:[d.jsx("p",{className:"text-tiny",style:{color:"var(--text-muted)"},children:"No runs yet."}),d.jsx("p",{className:"text-tiny mt-1",style:{color:"var(--text-muted)"},children:"Waiting for schedule..."})]}):e.map((m,b)=>{const y=DS(m.status),v=m.number||e.length-b,x=t===m.id;return d.jsxs("button",{onClick:()=>a?f(m.id):r(m.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:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("span",{className:"text-tiny font-mono",style:{color:"var(--text-muted)"},children:["#",v]}),d.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:[m.status==="running"&&d.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--text-link)"}}),LS(m.status)]})]}),d.jsxs("div",{className:"text-tiny mt-0.5",style:{color:"var(--text-muted)"},children:[m.time,m.durationMs!=null&&d.jsxs("span",{className:"ml-1",children:["(",(m.durationMs/1e3).toFixed(1),"s)"]})]}),m.summary&&d.jsx("div",{className:"text-caption mt-1 truncate",style:{color:"var(--text-secondary)"},children:m.summary})]},m.id)})]});return a?c&&t?d.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[d.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:[d.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5L8.25 12l7.5-7.5"})}),"Back to History"]}),d.jsx("div",{className:"flex-1 min-h-0",children:d.jsx(y1,{jobs:e,selectedJobId:t})})]}):d.jsx("div",{className:"flex-1 min-h-0",children:h}):d.jsxs(hl,{orientation:"horizontal",defaultLayout:o.defaultLayout,onLayoutChanged:o.onLayoutChanged,id:"botschat-cron-content",className:"flex-1 min-h-0",children:[d.jsx(Cr,{id:"cron-jobs",defaultSize:"20%",minSize:"8%",maxSize:"40%",children:h}),d.jsx(dl,{}),d.jsx(Cr,{id:"cron-output",children:d.jsx(y1,{jobs:e,selectedJobId:t})})]})}const mD=`prose prose-sm max-w-none
|
|
1511
|
-
prose-p:my-1.5 prose-ul:my-1.5 prose-ol:my-1.5
|
|
1512
|
-
prose-pre:my-2 prose-pre:rounded-md prose-pre:text-caption
|
|
1513
|
-
prose-code:before:content-none prose-code:after:content-none
|
|
1514
|
-
prose-code:px-1 prose-code:py-0.5 prose-code:rounded-sm prose-code:text-caption
|
|
1515
|
-
prose-table:my-2 prose-th:px-3 prose-th:py-1.5 prose-td:px-3 prose-td:py-1.5
|
|
1516
|
-
prose-h1:text-lg prose-h2:text-base prose-h3:text-sm
|
|
1517
|
-
prose-li:my-0.5
|
|
1518
|
-
prose-blockquote:border-l-2 prose-blockquote:pl-4 prose-blockquote:my-2
|
|
1519
|
-
prose-hr:my-4`,gD={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 bD(e){return e.split(/\n\n---\n\n/).filter(t=>t.trim())}function y1({jobs:e,selectedJobId:t}){const r=t?e.find(f=>f.id===t):null,a=C.useRef(null);if(C.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 d.jsx("div",{className:"flex-1 h-full flex items-center justify-center",style:{background:"var(--bg-surface)"},children:d.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 o=DS(r.status),c=r.status==="running",u=r.summary?bD(r.summary):[];return d.jsxs("div",{className:"flex-1 h-full flex flex-col min-w-0",style:{background:"var(--bg-surface)"},children:[d.jsxs("div",{className:"flex items-center gap-3 px-5 py-2.5 flex-shrink-0",style:{borderBottom:"1px solid var(--border)"},children:[d.jsx("span",{className:"text-tiny px-2 py-0.5 rounded-sm font-bold",style:{background:o.bg,color:o.fg},children:LS(r.status)}),c&&d.jsx("span",{className:"inline-block w-2 h-2 rounded-full animate-pulse",style:{background:"var(--text-link)"}}),d.jsx("span",{className:"text-caption",style:{color:"var(--text-secondary)"},children:r.time}),r.durationMs!=null&&d.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`})]}),d.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",ref:a,children:u.length>0?d.jsxs("div",{className:"flex flex-col gap-3",children:[u.map((f,h)=>{const m=h===u.length-1,b=c&&m;return d.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:[d.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[d.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&&d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--text-link)"}}),d.jsx("span",{className:"text-tiny",style:{color:"var(--text-link)"},children:"streaming..."})]}),!b&&!c&&u.length>1&&d.jsx("span",{className:"text-tiny",style:{color:"var(--text-muted)"},children:"completed"})]}),d.jsx("div",{className:mD,style:gD,children:d.jsx(L0,{remarkPlugins:[iE],children:f})})]},h)}),c&&d.jsxs("div",{className:"flex items-center gap-1.5 pl-2",children:[d.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--text-link)"}}),d.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--text-link)",animationDelay:"0.2s"}}),d.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--text-link)",animationDelay:"0.4s"}})]})]}):c?d.jsxs("div",{className:"flex items-center gap-1.5 py-2 pl-1",children:[d.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--text-link)"}}),d.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--text-link)",animationDelay:"0.2s"}}),d.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--text-link)",animationDelay:"0.4s"}})]}):d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx("p",{className:"text-caption",style:{color:"var(--text-muted)"},children:"No output recorded for this run."})})})]})}function Fi({label:e,children:t}){return d.jsxs("div",{className:"min-w-0",children:[d.jsx("div",{className:"text-tiny uppercase tracking-wider mb-1",style:{color:"var(--text-muted)"},children:e}),t]})}function zS({saving:e,onSave:t,onCancel:r}){return d.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[d.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"}),d.jsx("button",{onClick:r,className:"px-2 py-1 text-tiny rounded-sm",style:{color:"var(--text-muted)"},children:"Cancel"})]})}function yD({sendMessage:e,theme:t,onToggleTheme:r,showSettings:a,onOpenSettings:o,onCloseSettings:c,handleDefaultModelChange:u,handleSelectJob:f}){var R,M,L,w,D,F,J,P,$,Y;const h=Zn(),m=Rr(),[b,y]=C.useState(()=>h.selectedAgentId&&h.selectedSessionKey?"chat":"home"),[v,x]=C.useState(!1);_a.useEffect(()=>{function te(){y("chat")}return window.addEventListener("botschat:push-nav",te),()=>window.removeEventListener("botschat:push-nav",te)},[]),_a.useEffect(()=>{h.activeThreadId&&b==="chat"&&y("thread")},[h.activeThreadId,b]),_a.useEffect(()=>{!h.activeThreadId&&b==="thread"&&y("chat")},[h.activeThreadId,b]);const S=()=>{var te;Z.info("Auth",`Mobile logout — user ${(te=h.user)==null?void 0:te.email}`),ai(null),Na(null),m({type:"LOGOUT"})},_=((L=(M=(R=h.user)==null?void 0:R.displayName)==null?void 0:M[0])==null?void 0:L.toUpperCase())??((F=(D=(w=h.user)==null?void 0:w.email)==null?void 0:D[0])==null?void 0:F.toUpperCase())??"?",N=C.useCallback(()=>{switch(b){case"chat":y("home");break;case"thread":m({type:"CLOSE_THREAD"}),y("chat");break;case"cron-detail":y("home");break}},[b,m]),T=()=>{switch(b){case"home":return"BotsChat";case"chat":{const te=h.agents.find(se=>se.id===h.selectedAgentId);return`# ${(te==null?void 0:te.name)??"Chat"}`}case"thread":return"Thread";case"cron-detail":{const te=h.cronTasks.find(se=>se.id===h.selectedCronTaskId);return(te==null?void 0:te.name)??"Task Detail"}default:return"BotsChat"}},O=b!=="home";return d.jsxs("div",{className:"flex flex-col",style:{height:"calc(100vh - var(--keyboard-height, 0px))",background:"var(--bg-surface)",transition:"height 0.2s ease-out"},children:[d.jsxs("div",{className:"flex items-center justify-between px-4 flex-shrink-0",style:{minHeight:"calc(44px + env(safe-area-inset-top, 0px))",paddingTop:"env(safe-area-inset-top, 0px)",background:"var(--bg-primary)",borderBottom:"1px solid var(--border)"},children:[d.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[O&&d.jsx("button",{onClick:N,className:"p-1 -ml-1 rounded",style:{color:"var(--text-link)"},"aria-label":"Back",children:d.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5L8.25 12l7.5-7.5"})})}),d.jsx("span",{className:"text-h2 font-bold truncate",style:{color:"var(--text-primary)"},children:T()})]}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("div",{className:"w-2 h-2 rounded-full mr-1",style:{background:h.openclawConnected?"var(--accent-green)":"var(--accent-red)"}}),d.jsx("button",{onClick:o,className:"p-1.5 rounded",style:{color:"var(--text-muted)"},children:d.jsxs("svg",{className:"w-4.5 h-4.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[d.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"}),d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}),d.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:((J=h.user)==null?void 0:J.displayName)??((P=h.user)==null?void 0:P.email)??"User",children:_})]})]}),v&&d.jsx("div",{className:"fixed inset-0 z-50",onClick:()=>x(!1),children:d.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:te=>te.stopPropagation(),children:[d.jsxs("div",{className:"px-4 py-2.5",style:{borderBottom:"1px solid var(--border)"},children:[d.jsx("div",{className:"text-body font-bold",style:{color:"var(--text-primary)"},children:(($=h.user)==null?void 0:$.displayName)??"User"}),d.jsx("div",{className:"text-caption",style:{color:"var(--text-muted)"},children:(Y=h.user)==null?void 0:Y.email})]}),d.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"?d.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:d.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"})}):d.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:d.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"]}),d.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:()=>{o(),x(!1)},children:[d.jsxs("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[d.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"}),d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),"Settings"]}),d.jsx("div",{style:{borderTop:"1px solid var(--border)"}}),d.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:()=>{S(),x(!1)},children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:d.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"]})]})}),d.jsxs("div",{className:"flex-1 min-h-0 flex flex-col overflow-hidden",children:[b==="home"&&d.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",style:{background:"var(--bg-secondary)"},children:[d.jsx(J1,{onOpenSettings:o,onNavigate:()=>y("chat")}),d.jsx(RS,{onNavigate:()=>y("cron-detail")})]}),b==="chat"&&d.jsx("div",{className:"flex-1 min-h-0 flex flex-col",children:d.jsx(RE,{sendMessage:e})}),b==="thread"&&d.jsx("div",{className:"flex-1 min-h-0 flex flex-col",children:d.jsx(IE,{sendMessage:e})}),b==="cron-detail"&&d.jsx("div",{className:"flex-1 min-h-0 flex flex-col overflow-hidden",children:d.jsx(jS,{})})]}),a&&d.jsx(vD,{state:h,onClose:c,handleDefaultModelChange:u})]})}function vD({state:e,onClose:t,handleDefaultModelChange:r}){const[a,o]=C.useState("general");return d.jsx("div",{className:"fixed inset-0 flex items-end justify-center z-50",style:{background:"rgba(0,0,0,0.5)"},onClick:t,children:d.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:[d.jsx("div",{className:"w-10 h-1 rounded-full mx-auto mb-4",style:{background:"var(--text-muted)"}}),d.jsx("h2",{className:"text-h1 font-bold mb-3",style:{color:"var(--text-primary)"},children:"Settings"}),d.jsxs("div",{className:"flex gap-4 mb-4",style:{borderBottom:"1px solid var(--border)"},children:[d.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:()=>o("general"),children:"General"}),d.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:()=>o("connection"),children:"Connection"}),d.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:()=>o("security"),children:"Security"})]}),d.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[a==="general"&&d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-caption font-bold mb-1.5",style:{color:"var(--text-secondary)"},children:"Default Model"}),d.jsx(Mp,{value:e.defaultModel??"",onChange:r,models:e.models,placeholder:"Not set (use agent default)"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-caption font-bold mb-1.5",style:{color:"var(--text-secondary)"},children:"Current Session Model"}),d.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"&&d.jsx(NS,{}),a==="security"&&d.jsx(CS,{})]}),d.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"})]})})}const v1="G-HKJNG1X0JE";function xD(){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",v1);const e=document.createElement("script");return e.async=!0,e.src=`https://www.googletagmanager.com/gtag/js?id=${v1}`,document.head.appendChild(e),!0}let x1=!1;function ED(){x1||(x1=xD())}function SD(e,t){window.gtag&&window.gtag("event",e,t)}function _D(e){SD("page_view",{page_path:`/${e}`,page_title:e})}function wD(){var Fe;const[e,t]=C.useReducer(Fk,Op,G=>{try{const ie=localStorage.getItem("botschat_active_view");if(ie==="messages"||ie==="automations")return{...G,activeView:ie}}catch{}return G}),r=C.useRef(null),a=C.useRef(()=>{}),o=C.useRef(!1),c=C.useRef(null),[u,f]=C.useState(!1),[h,m]=C.useState("general"),[b,y]=C.useState(!1),[v,x]=C.useState(!1),[S,_]=C.useState(Ge.hasKey());C.useEffect(()=>Ge.subscribe(()=>_(Ge.hasKey())),[]);const[N,T]=C.useState(0),O=Jp(),R=yu({id:"botschat-main"}),M=yu({id:"botschat-content"}),[L,w]=C.useState(()=>localStorage.getItem("botschat_data_consent")==="1"),D=C.useCallback(()=>{w(!0),localStorage.setItem("botschat_data_consent","1")},[]),[F,J]=C.useState(()=>localStorage.getItem("botschat_onboarding_dismissed")==="1"),P=C.useCallback(()=>{J(!0),localStorage.setItem("botschat_onboarding_dismissed","1")},[]),[$,Y]=C.useState(()=>{var ie;const G=localStorage.getItem("botschat_theme");return G==="light"||G==="dark"?G:(ie=window.matchMedia)!=null&&ie.call(window,"(prefers-color-scheme: light)").matches?"light":"dark"});C.useEffect(()=>{document.documentElement.setAttribute("data-theme",$),localStorage.setItem("botschat_theme",$);const G=document.querySelector('meta[name="theme-color"]');G&&G.setAttribute("content",$==="dark"?"#1A1D21":"#FFFFFF"),un.isNativePlatform()&&ur(async()=>{const{StatusBar:ie,Style:ve}=await import("./index-CYQMu_-c.js");return{StatusBar:ie,Style:ve}},[]).then(({StatusBar:ie,Style:ve})=>{ie.setStyle({style:$==="dark"?ve.Dark:ve.Light}).catch(()=>{})})},[$]),C.useEffect(()=>{localStorage.setItem("botschat_active_view",e.activeView)},[e.activeView]),C.useEffect(()=>{_D(e.activeView)},[e.activeView]),C.useEffect(()=>{e.selectedCronTaskId&&localStorage.setItem("botschat_last_cron_task",e.selectedCronTaskId)},[e.selectedCronTaskId]),C.useEffect(()=>{if(e.selectedSessionId){const G=e.agents.find(ie=>ie.id===e.selectedAgentId);G!=null&&G.channelId&&localStorage.setItem(`botschat_last_session_${G.channelId}`,e.selectedSessionId)}},[e.selectedSessionId,e.selectedAgentId,e.agents]);const te=C.useCallback(()=>{Y(G=>G==="dark"?"light":"dark")},[]);C.useEffect(()=>{const G=new URLSearchParams(window.location.search),ie=G.get("dev_token"),ve=G.get("dev_user");if(ie){Z.info("Auth","Dev-token login attempt"),fetch("/api/dev-auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({secret:ie,...ve?{userId:ve}:{}})}).then(pe=>{if(!pe.ok)throw new Error(`HTTP ${pe.status}`);return pe.json()}).then(async pe=>{ai(pe.token),t({type:"SET_USER",user:{id:pe.userId,email:ve?"auxtenwpc@gmail.com":"dev@botschat.test",displayName:ve?"Auxten Wang":"Dev User"}});const Ze=G.get("dev_e2e");if(Ze)try{await Ge.setPassword(Ze,pe.userId,!0),_(!0),Z.info("Auth","Dev E2E key derived successfully")}catch(Ye){Z.warn("Auth",`Dev E2E key derivation failed: ${Ye}`)}else Ge.clear(),_(!1);G.delete("dev_token"),G.delete("dev_user"),G.delete("dev_e2e");const ct=G.toString();window.history.replaceState({},"",window.location.pathname+(ct?`?${ct}`:"")),Z.info("Auth",`Dev-token login success: ${pe.userId}`)}).catch(pe=>{Z.warn("Auth",`Dev-token login failed: ${pe}`)});return}if(ah())Z.api("Auth","Auto-login with stored token"),Eu.me().then(pe=>{Z.info("Auth",`Logged in as ${pe.email} (${pe.id})`),t({type:"SET_USER",user:pe})}).catch(pe=>{Z.warn("Auth",`Auto-login failed: ${pe}`),ai(null),Na(null)});else if(!un.isNativePlatform()){const pe="auxtenwpc@gmail.com",Ze="http://192.168.3.232:8787";{const ct=`${Ze}/api/auth/dev-login`;Z.info("Auth",`Debug auto-login as ${pe} via ${ct}`),fetch(ct,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:pe})}).then(Ye=>Ye.json()).then(Ye=>{Ye.token?(ai(Ye.token),Ye.refreshToken&&Na(Ye.refreshToken),t({type:"SET_USER",user:{id:Ye.id,email:Ye.email,displayName:Ye.displayName}}),Z.info("Auth",`Debug auto-login success: ${Ye.email}`)):Z.warn("Auth","Debug auto-login returned no token",Ye)}).catch(Ye=>Z.warn("Auth",`Debug auto-login failed: ${Ye}`))}}},[]),C.useEffect(()=>{if(!e.user)return;const G=setTimeout(()=>{e.models.length===0&&Wk.list().then(({models:ie})=>{ie.length>0&&t({type:"SET_MODELS",models:ie})}).catch(()=>{})},2e3);return()=>clearTimeout(G)},[e.user,e.models.length]),C.useEffect(()=>{e.user&&(Z.api("Agents","Loading agents list"),Os.list().then(({agents:G})=>{if(Z.info("Agents",`Loaded ${G.length} agents`,G.map(ie=>({id:ie.id,name:ie.name,channelId:ie.channelId}))),t({type:"SET_AGENTS",agents:G}),G.length>0&&!e.selectedAgentId){const ie=c.current;if(ie){const Ke=ie.match(/^agent:([^:]+):/);if(Ke){const pe=G.find(Ze=>Ze.sessionKey.startsWith(`agent:${Ke[1]}:`));if(pe){Z.info("Push",`Agent select from push nav: ${pe.name} (${pe.id})`),t({type:"SET_ACTIVE_VIEW",view:"messages"}),t({type:"SELECT_AGENT",agentId:pe.id,sessionKey:pe.sessionKey});return}}}let ve=G[0];try{const Ke=localStorage.getItem("botschat_last_agent");if(Ke){const pe=G.find(Ze=>Ze.id===Ke);pe&&(Z.info("Agents",`Restoring last channel: ${pe.name} (${pe.id})`),ve=pe)}}catch{}t({type:"SELECT_AGENT",agentId:ve.id,sessionKey:ve.sessionKey})}}),Z.api("Channels","Loading channels list"),cr.list().then(({channels:G})=>{Z.info("Channels",`Loaded ${G.length} channels`,G.map(ie=>({id:ie.id,name:ie.name}))),t({type:"SET_CHANNELS",channels:G}),x(!0)}))},[e.user]),C.useEffect(()=>{e.user&&e.activeView==="automations"&&(Z.api("Cron","Loading all background tasks + scan data"),Promise.all([zn.listAll("background"),zn.scanData()]).then(([{tasks:G},{tasks:ie}])=>{if(Z.info("Cron",`Loaded ${G.length} cron tasks + ${ie.length} scan entries`),t({type:"SET_CRON_TASKS",cronTasks:G}),t({type:"MERGE_SCAN_DATA",scanTasks:ie.map(ve=>({cronJobId:ve.cronJobId,schedule:ve.schedule,instructions:ve.instructions,model:ve.model||void 0,enabled:ve.enabled}))}),G.length>0&&!e.selectedCronTaskId){let ve=G[0].id;try{const Ke=localStorage.getItem("botschat_last_cron_task");if(Ke){const pe=G.find(Ze=>Ze.id===Ke);pe&&(Z.info("Cron",`Restoring last cron task: ${pe.name} (${pe.id})`),ve=pe.id)}}catch{}t({type:"SELECT_CRON_TASK",taskId:ve})}}))},[e.user,e.activeView]);const se=(Fe=e.agents.find(G=>G.id===e.selectedAgentId))==null?void 0:Fe.channelId,V=e.activeView==="messages";C.useEffect(()=>{if(!V)return;if(!e.selectedAgentId){t({type:"SET_TASKS",tasks:[]}),t({type:"SELECT_TASK",taskId:null}),t({type:"SET_SESSIONS",sessions:[]});return}const G=e.agents.find(ie=>ie.id===e.selectedAgentId);G!=null&&G.channelId?(G.isDefault?(t({type:"SET_TASKS",tasks:[]}),t({type:"SELECT_TASK",taskId:null})):zn.list(G.channelId).then(({tasks:ie})=>{if(t({type:"SET_TASKS",tasks:ie}),ie.length>0){const ve=ie[0];t({type:"SELECT_TASK",taskId:ve.id})}}),Cs.list(G.channelId).then(({sessions:ie})=>{if(Z.info("Sessions",`Loaded ${ie.length} sessions for channel ${G.channelId}`),t({type:"SET_SESSIONS",sessions:ie}),ie.length>0){const ve=c.current;if(ve){const pe=ie.find(Ze=>Ze.sessionKey===ve);if(pe){Z.info("Push",`Session select from push nav: ${pe.name} (${pe.id})`),c.current=null,Ov(),t({type:"SELECT_SESSION",sessionId:pe.id,sessionKey:pe.sessionKey});return}}let Ke=ie[0];try{const pe=localStorage.getItem(`botschat_last_session_${G.channelId}`);if(pe){const Ze=ie.find(ct=>ct.id===pe);Ze&&(Z.info("Sessions",`Restoring last session: ${Ze.name} (${Ze.id})`),Ke=Ze)}}catch{}t({type:"SELECT_SESSION",sessionId:Ke.id,sessionKey:Ke.sessionKey})}}).catch(ie=>{Z.error("Sessions",`Failed to load sessions: ${ie}`)})):G!=null&&G.isDefault&&!o.current&&F?(Z.info("Sessions","Default agent has no channel — auto-creating General channel"),o.current=!0,t({type:"SET_TASKS",tasks:[]}),t({type:"SELECT_TASK",taskId:null}),t({type:"SET_SESSIONS",sessions:[]}),cr.create({name:"General",providerAgentId:"main"}).then(async ie=>{Z.info("Sessions",`General channel created: ${ie.id}`);const[{agents:ve},{channels:Ke}]=await Promise.all([Os.list(),cr.list()]);t({type:"SET_AGENTS",agents:ve}),t({type:"SET_CHANNELS",channels:Ke});const{sessions:pe}=await Cs.list(ie.id);t({type:"SET_SESSIONS",sessions:pe}),pe.length>0&&t({type:"SELECT_SESSION",sessionId:pe[0].id,sessionKey:pe[0].sessionKey})}).catch(ie=>{Z.error("Sessions",`Failed to auto-create General channel: ${ie}`),o.current=!1})):(t({type:"SET_TASKS",tasks:[]}),t({type:"SELECT_TASK",taskId:null}),t({type:"SET_SESSIONS",sessions:[]}))},[e.selectedAgentId,se,V,F]),C.useEffect(()=>{if(!e.selectedTaskId)return;const G=e.tasks.find(ve=>ve.id===e.selectedTaskId);if(!G||G.kind!=="background"){t({type:"SET_JOBS",jobs:[]});return}const ie=e.agents.find(ve=>ve.id===e.selectedAgentId);ie!=null&&ie.channelId&&Vh.list(ie.channelId,G.id).then(({jobs:ve})=>{t({type:"SET_JOBS",jobs:ve}),ve.length>0&&!e.selectedJobId&&t({type:"SELECT_JOB",jobId:ve[0].id,sessionKey:ve[0].sessionKey})}).catch(ve=>{console.error("Failed to load jobs:",ve)})},[e.selectedTaskId,e.tasks]),C.useEffect(()=>{if(!e.user||!e.selectedSessionKey)return;let G=!1;return B1.list(e.user.id,e.selectedSessionKey).then(async({messages:ie,replyCounts:ve})=>{if(G)return;const Ke=await Promise.all(ie.map(async pe=>{if(pe.encrypted&&Ge.hasKey())try{const Ze=await Ge.decrypt(pe.text,pe.id);return{...pe,text:Ze,isEncryptedLocked:!1}}catch(Ze){return console.warn(`Failed to decrypt message ${pe.id}`,Ze),{...pe,isEncryptedLocked:!0}}else if(pe.encrypted)return{...pe,isEncryptedLocked:!0};return pe}));t({type:"SET_MESSAGES",messages:Ke,replyCounts:ve})}).catch(ie=>{console.error("Failed to load message history:",ie)}),()=>{G=!0}},[e.user,e.selectedSessionKey,S,N]),C.useEffect(()=>{const G=r.current;G!=null&&G.connected&&f2(G,e.selectedSessionKey)},[e.selectedSessionKey]);const z=C.useRef(e);C.useEffect(()=>{z.current=e},[e]);const re=C.useCallback(G=>{Z.info("Push",`Navigating to session: ${G}`);const ie=G.replace(/:thread:.+$/,"");c.current=ie;const ve=ie.match(/^agent:([^:]+):/);if(!ve)return;const Ke=ve[1],pe=z.current,Ze=pe.agents.find(ct=>ct.sessionKey.startsWith(`agent:${Ke}:`));if(Ze)if(pe.activeView!=="messages"&&t({type:"SET_ACTIVE_VIEW",view:"messages"}),pe.selectedAgentId!==Ze.id)t({type:"SELECT_AGENT",agentId:Ze.id,sessionKey:Ze.sessionKey});else{const ct=pe.sessions.find(Ye=>Ye.sessionKey===ie);ct&&(c.current=null,Ov(),t({type:"SELECT_SESSION",sessionId:ct.id,sessionKey:ct.sessionKey}))}},[t]);C.useEffect(()=>{function G(ve){var pe;const Ke=(pe=ve.detail)==null?void 0:pe.sessionKey;Ke&&re(Ke)}window.addEventListener("botschat:push-nav",G);const ie=Av();return ie&&re(ie),()=>window.removeEventListener("botschat:push-nav",G)},[re]);const oe=C.useCallback(G=>{var Ze,ct,Ye;const ie=G.sessionKey,ve=G.threadId??G.replyToId;Z.wsIn("WS",`${G.type}`,G),o2({type:G.type,text:G.text,caption:G.caption,sessionKey:ie,agentName:G.agentName});const Ke=Pe=>{if(Pe)return Pe.replace(/:thread:.+$/,"")},pe=Pe=>Pe?Ke(Pe)===z.current.selectedSessionKey:!0;switch(G.type){case"connection.status":Z.info("Connection",`OpenClaw ${G.openclawConnected?"connected":"disconnected"}${G.defaultModel?` (default: ${G.defaultModel})`:""}`),t({type:"SET_OPENCLAW_CONNECTED",connected:G.openclawConnected,defaultModel:G.defaultModel||void 0}),Array.isArray(G.models)&&G.models.length>0&&t({type:"SET_MODELS",models:G.models});const Pe=G;if(Array.isArray(Pe.connectedAgents))for(const Me of Pe.connectedAgents)t({type:"SET_AGENT_CONNECTION",agentId:Me.id,connected:!0});break;case"openclaw.disconnected":Z.warn("Connection","OpenClaw disconnected"),t({type:"SET_OPENCLAW_CONNECTED",connected:!1});break;case"model.changed":if(G.model&&G.sessionKey){Z.info("Model",`Session model changed to: ${G.model} (session: ${G.sessionKey})`),t({type:"SET_SESSION_MODEL",model:G.model});try{const Me=JSON.parse(localStorage.getItem("botschat:sessionModels")||"{}");Me[G.sessionKey]=G.model,localStorage.setItem("botschat:sessionModels",JSON.stringify(Me))}catch{}}break;case"agent.stream.start":if(ie&&pe(ie)){const Me=ve??((Ze=ie.match(/:thread:(.+)$/))==null?void 0:Ze[1]);t({type:"STREAM_START",runId:G.runId,sessionKey:ie,threadId:Me})}break;case"agent.stream.chunk":t({type:"STREAM_CHUNK",runId:G.runId,sessionKey:ie??"",text:G.text});break;case"agent.stream.end":t({type:"STREAM_END",runId:G.runId});break;case"agent.activity":{if(!pe(ie))break;const Me=G.runId||e.streamingRunId||`activity_${Date.now()}`;if(!e.streamingRunId&&ie){const pt=G.threadId??((ct=ie.match(/:thread:(.+)$/))==null?void 0:ct[1]);t({type:"STREAM_START",runId:Me,sessionKey:ie,threadId:pt})}t({type:"STREAM_ACTIVITY",runId:Me,sessionKey:ie??"",activity:{kind:G.kind,text:G.text,toolName:G.toolName,durationMs:G.durationMs,timestamp:Date.now()}});break}case"agent.text":{if(!pe(ie))break;const Me=G.agentId,pt={id:Wn(),sender:"agent",text:G.text,timestamp:Date.now(),threadId:ve,encrypted:!!G.encrypted,...Me?{senderAgentId:Me,senderAgentName:((Ye=z.current.v2Agents.find(ft=>ft.id===Me))==null?void 0:Ye.name)??Me}:{}};t(ve&&ie?{type:"ADD_THREAD_MESSAGE",message:pt}:{type:"ADD_MESSAGE",message:pt});break}case"agent.media":{if(!pe(ie))break;const Me={id:Wn(),sender:"agent",text:G.caption??"",mediaUrl:G.mediaUrl,timestamp:Date.now(),threadId:ve,encrypted:!!G.encrypted,mediaEncrypted:!!G.mediaEncrypted};t(ve&&ie?{type:"ADD_THREAD_MESSAGE",message:Me}:{type:"ADD_MESSAGE",message:Me});break}case"agent.a2ui":{if(!pe(ie))break;const Me={id:Wn(),sender:"agent",text:"",a2ui:G.jsonl,timestamp:Date.now(),threadId:ve};t(ve&&ie?{type:"ADD_THREAD_MESSAGE",message:Me}:{type:"ADD_MESSAGE",message:Me});break}case"job.update":{const Me={id:G.jobId,number:0,sessionKey:G.sessionKey,status:G.status,startedAt:G.startedAt,finishedAt:G.finishedAt??null,durationMs:G.durationMs??null,summary:G.summary??"",time:new Date((G.startedAt??0)*1e3).toLocaleString()};if(Me.status==="running")t({type:"ADD_JOB",job:Me});else{const pt=z.current,ft=pt.jobs.some(Et=>Et.id===Me.id);t(ft?{type:"SET_JOBS",jobs:pt.jobs.map(Et=>Et.id===Me.id?{...Et,...Me}:Et)}:{type:"ADD_JOB",job:Me})}Me.status==="running"?t({type:"ADD_CRON_JOB",job:Me}):t({type:"UPDATE_CRON_JOB",job:Me});break}case"job.output":{const Me=G.jobId,pt=G.text;Me&&pt&&t({type:"APPEND_JOB_OUTPUT",jobId:Me,text:pt});break}case"task.scan.result":{const Me=G.tasks??[];Z.info("TaskScan",`Scan result: ${Me.length} tasks reported`,Me),Os.list().then(({agents:ft})=>{Z.info("TaskScan",`Reloaded ${ft.length} agents`),t({type:"SET_AGENTS",agents:ft})}),cr.list().then(({channels:ft})=>{Z.info("TaskScan",`Reloaded ${ft.length} channels`),t({type:"SET_CHANNELS",channels:ft})}),zn.listAll("background").then(({tasks:ft})=>{Z.info("TaskScan",`Reloaded ${ft.length} cron tasks, merging scan data`),t({type:"SET_CRON_TASKS",cronTasks:ft}),t({type:"MERGE_SCAN_DATA",scanTasks:Me.map(Et=>({cronJobId:Et.cronJobId,schedule:Et.schedule,instructions:Et.instructions??"",model:Et.model,enabled:Et.enabled}))})});const pt=z.current;if(pt.selectedAgentId){const ft=pt.agents.find(Et=>Et.id===pt.selectedAgentId);ft!=null&&ft.channelId&&zn.list(ft.channelId).then(({tasks:Et})=>{t({type:"SET_TASKS",tasks:Et})})}break}case"auth.ok":{const Me=G;Array.isArray(Me.availableAgents)&&t({type:"SET_V2_AGENTS",agents:Me.availableAgents});break}case"status":break;case"models.list":Array.isArray(G.models)&&t({type:"SET_MODELS",models:G.models});break;case"task.schedule.ack":G.ok?Z.info("Task",`Schedule applied to OpenClaw: ${G.cronJobId}`):Z.error("Task",`Schedule push to OpenClaw failed: ${G.error}`,G);break;case"error":Z.error("Server",G.message,G);break}},[]);C.useEffect(()=>{a.current=oe},[oe]),C.useEffect(()=>{if(!e.user||!ah())return;const G=Wn();Z.info("WS",`Connecting WebSocket (session=${G.slice(0,8)}...)`);let ie=null;const ve=new r2({userId:e.user.id,sessionId:G,getToken:ah,onMessage:pe=>{a.current(pe)},onStatusChange:pe=>{Z.info("WS",pe?"WebSocket connected":"WebSocket disconnected"),t({type:"SET_WS_CONNECTED",connected:pe}),pe&&(ie==null||ie())}});ve.connect(),r.current=ve,c2().then(()=>{const pe=Av();pe&&re(pe)}).catch(pe=>{Z.warn("Push",`Push init failed: ${pe}`)});const Ke=h2({wsClient:ve,getActiveSessionKey:()=>z.current.selectedSessionKey,onResume:()=>T(pe=>pe+1)});return ie=Ke.resend,()=>{Ke.cleanup(),ve.disconnect(),r.current=null}},[e.user]);const ye=C.useCallback(G=>{var ie;Z.wsOut("WS",`${G.type}`,G),(ie=r.current)==null||ie.send(G)},[]),I=C.useCallback(async G=>{t({type:"SET_DEFAULT_MODEL",model:G||null});try{await z1.updateSettings({defaultModel:G||void 0})}catch(ie){console.error("Failed to update default model:",ie)}},[]),j=C.useCallback(G=>{const ie=e.jobs.find(ve=>ve.id===G);ie&&t({type:"SELECT_JOB",jobId:ie.id,sessionKey:ie.sessionKey||void 0})},[e.jobs]);if(C.useEffect(()=>{if(e.openclawConnected&&!F){const G=setTimeout(()=>{P()},1500);return()=>clearTimeout(G)}},[e.openclawConnected,F,P]),!e.user)return d.jsx(Ea.Provider,{value:e,children:d.jsx(Ss.Provider,{value:t,children:d.jsx(XL,{})})});if(!L)return d.jsx(Ea.Provider,{value:e,children:d.jsx(Ss.Provider,{value:t,children:d.jsx(ZL,{onAccept:D})})});if(!F&&v&&e.channels.length===0&&!e.openclawConnected)return d.jsx(Ea.Provider,{value:e,children:d.jsx(Ss.Provider,{value:t,children:d.jsx(eD,{onSkip:P})})});e.agents.find(G=>G.id===e.selectedAgentId);const A=e.tasks.find(G=>G.id===e.selectedTaskId),be=(A==null?void 0:A.kind)==="background",Ne=!!e.selectedSessionKey,we=e.activeView==="automations";return O?d.jsx(Ea.Provider,{value:e,children:d.jsx(Ss.Provider,{value:t,children:d.jsx(yD,{sendMessage:ye,theme:$,onToggleTheme:te,showSettings:u,onOpenSettings:()=>f(!0),onCloseSettings:()=>f(!1),handleDefaultModelChange:I,handleSelectJob:j})})}):d.jsx(Ea.Provider,{value:e,children:d.jsxs(Ss.Provider,{value:t,children:[d.jsxs("div",{className:"flex flex-col h-screen",children:[d.jsxs("div",{className:"flex flex-1 min-h-0",children:[d.jsx(p2,{onToggleTheme:te,onOpenSettings:()=>f(!0),theme:$}),d.jsxs(hl,{orientation:"horizontal",defaultLayout:R.defaultLayout,onLayoutChanged:R.onLayoutChanged,id:"botschat-main",className:"flex-1",children:[d.jsx(Cr,{id:"sidebar",defaultSize:"15%",minSize:"5%",maxSize:"30%",children:we?d.jsx(RS,{}):d.jsx(J1,{})}),d.jsx(dl,{}),d.jsx(Cr,{id:"content",children:we?d.jsx(jS,{}):d.jsx("div",{className:"flex-1 flex flex-col min-w-0 h-full",children:Ne?d.jsxs(hl,{orientation:"horizontal",defaultLayout:M.defaultLayout,onLayoutChanged:M.onLayoutChanged,id:"botschat-content",children:[be&&d.jsxs(d.Fragment,{children:[d.jsx(Cr,{id:"joblist",defaultSize:"15%",minSize:"5%",maxSize:"30%",children:d.jsx(r3,{jobs:e.jobs,selectedJobId:e.selectedJobId,onSelectJob:j})}),d.jsx(dl,{})]}),d.jsx(Cr,{id:"chat",children:d.jsx(RE,{sendMessage:ye})}),e.activeThreadId&&d.jsxs(d.Fragment,{children:[d.jsx(dl,{}),d.jsx(Cr,{id:"thread",defaultSize:"28%",minSize:"10%",maxSize:"50%",children:d.jsx(IE,{sendMessage:ye})})]})]}):d.jsx("div",{className:"flex-1 flex items-center justify-center",style:{background:"var(--bg-surface)"},children:d.jsxs("div",{className:"text-center",children:[d.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:d.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"})}),d.jsx("p",{className:"text-body font-bold",style:{color:"var(--text-muted)"},children:"Select a channel to get started"}),d.jsx("p",{className:"text-caption mt-1",style:{color:"var(--text-muted)"},children:"Choose a channel from the sidebar"})]})})})})]})]}),d.jsx(cD,{})]}),u&&d.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-50",style:{background:"rgba(0,0,0,0.5)"},onClick:()=>f(!1),children:d.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:G=>G.stopPropagation(),children:[d.jsxs("div",{className:"flex items-center justify-between mb-4",children:[d.jsx("h2",{className:"text-h1 font-bold",style:{color:"var(--text-primary)"},children:"Settings"}),d.jsx("button",{onClick:()=>f(!1),className:"p-1 hover:bg-[--bg-hover] rounded",style:{color:"var(--text-muted)"},children:d.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),d.jsxs("div",{className:"flex gap-4 mb-4",style:{borderBottom:"1px solid var(--border)"},children:[d.jsx("button",{className:"pb-2 text-caption font-bold transition-colors",style:{color:h==="general"?"var(--text-primary)":"var(--text-muted)",borderBottom:h==="general"?"2px solid var(--bg-active)":"2px solid transparent",marginBottom:"-1px"},onClick:()=>m("general"),children:"General"}),d.jsx("button",{className:"pb-2 text-caption font-bold transition-colors",style:{color:h==="connection"?"var(--text-primary)":"var(--text-muted)",borderBottom:h==="connection"?"2px solid var(--bg-active)":"2px solid transparent",marginBottom:"-1px"},onClick:()=>m("connection"),children:"Connection"}),d.jsx("button",{className:"pb-2 text-caption font-bold transition-colors",style:{color:h==="agents"?"var(--text-primary)":"var(--text-muted)",borderBottom:h==="agents"?"2px solid var(--bg-active)":"2px solid transparent",marginBottom:"-1px"},onClick:()=>m("agents"),children:"Agents"}),d.jsx("button",{className:"pb-2 text-caption font-bold transition-colors",style:{color:h==="security"?"var(--text-primary)":"var(--text-muted)",borderBottom:h==="security"?"2px solid var(--bg-active)":"2px solid transparent",marginBottom:"-1px"},onClick:()=>m("security"),children:"Security"})]}),d.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[h==="general"&&d.jsxs("div",{className:"space-y-5",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-caption font-bold mb-1.5",style:{color:"var(--text-secondary)"},children:"Default Model"}),d.jsx(Mp,{value:e.defaultModel??"",onChange:I,models:e.models,placeholder:"Not set (use agent default)"}),d.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"," ",d.jsx("code",{children:"/model"})," or per automation in its settings."]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-caption font-bold mb-1.5",style:{color:"var(--text-secondary)"},children:"Current Session Model"}),d.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.jsx(rD,{})]}),h==="connection"&&d.jsx(NS,{}),h==="agents"&&d.jsxs("div",{className:"space-y-3",children:[d.jsx("p",{className:"text-caption",style:{color:"var(--text-secondary)"},children:"Manage your AI agents. Each agent has a type (engine) and role (persona)."}),d.jsx("button",{onClick:()=>y(!0),className:"w-full py-2.5 text-caption font-medium rounded-lg",style:{background:"var(--accent-blue)",color:"#fff"},children:"Open Agent Manager"})]}),h==="security"&&d.jsx(CS,{})]}),d.jsx("div",{className:"mt-4 pt-4 flex justify-end",style:{borderTop:"1px solid var(--border)"},children:d.jsx("button",{onClick:()=>f(!1),className:"px-4 py-1.5 text-caption font-bold text-white rounded-sm",style:{background:"var(--bg-active)"},children:"Done"})})]})}),b&&d.jsx(sD,{onClose:()=>y(!1)})]})})}ED();un.isNativePlatform()&&(ur(async()=>{const{StatusBar:e,Style:t}=await import("./index-CYQMu_-c.js");return{StatusBar:e,Style:t}},[]).then(({StatusBar:e,Style:t})=>{const r=document.documentElement.getAttribute("data-theme")!=="light";e.setStyle({style:r?t.Dark:t.Light}).catch(()=>{}),e.setOverlaysWebView({overlay:!0}).catch(()=>{})}),ur(async()=>{const{Keyboard:e}=await import("./index-DYCO-ry1.js");return{Keyboard:e}},[]).then(({Keyboard:e})=>{e.setAccessoryBarVisible({isVisible:!0}).catch(()=>{}),e.addListener("keyboardWillShow",t=>{document.documentElement.style.setProperty("--keyboard-height",`${t.keyboardHeight}px`)}),e.addListener("keyboardWillHide",()=>{document.documentElement.style.setProperty("--keyboard-height","0px")})}));ek.createRoot(document.getElementById("root")).render(d.jsx(_a.StrictMode,{children:d.jsx(wD,{})}));const kD=un.isNativePlatform()||!!window.__BOTSCHAT_NATIVE__;!kD&&"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(()=>{})});export{Ps as C,Nl as E,Wi as F,_p as W,yl as _,Rs as a,$E as b,OI as c,ND as d,CD as e,ur as f,Ra as g,_3 as i,Y3 as o,Sp as r,w3 as v};
|