var Jz=Object.defineProperty;var M2=xt=>{throw TypeError(xt)};var Zz=(xt,gt,$t)=>gt in xt?Jz(xt,gt,{enumerable:!0,configurable:!0,writable:!0,value:$t}):xt[gt]=$t;var pt=(xt,gt,$t)=>Zz(xt,typeof gt!="symbol"?gt+"":gt,$t),R2=(xt,gt,$t)=>gt.has(xt)||M2("Cannot "+$t);var Qt=(xt,gt,$t)=>(R2(xt,gt,"read from private field"),$t?$t.call(xt):gt.get(xt)),Hu=(xt,gt,$t)=>gt.has(xt)?M2("Cannot add the same private member more than once"):gt instanceof WeakSet?gt.add(xt):gt.set(xt,$t),Fa=(xt,gt,$t,dr)=>(R2(xt,gt,"write to private field"),dr?dr.call(xt,$t):gt.set(xt,$t),$t);(function(){"use strict";var Yv,Ta,Aa,fn;var xt=typeof document<"u"?document.currentScript:null;function gt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $t={exports:{}},dr={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Fp;function D2(){if(Fp)return dr;Fp=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(l,o,u){var c=null;if(u!==void 0&&(c=""+u),o.key!==void 0&&(c=""+o.key),"key"in o){u={};for(var f in o)f!=="key"&&(u[f]=o[f])}else u=o;return o=u.ref,{$$typeof:e,type:l,key:c,ref:o!==void 0?o:null,props:u}}return dr.Fragment=n,dr.jsx=r,dr.jsxs=r,dr}var Ip;function L2(){return Ip||(Ip=1,$t.exports=D2()),$t.exports}var s=L2();const Up=Object;typeof Up.fromEntries!="function"&&Object.defineProperty(Object,"fromEntries",{value(e){const n={};if(e==null||typeof e[Symbol.iterator]!="function")throw new TypeError("Object.fromEntries requires an iterable object");for(const r of e){if(r==null||typeof r[Symbol.iterator]!="function")throw new TypeError("Iterator value must be an object that can be iterated as a key/value pair");const l=r[Symbol.iterator](),o=l.next(),u=l.next();if(o.done)throw new TypeError("Each entry pair must yield at least two values");Reflect.set(n,o.value,u.value)}return n},writable:!0,configurable:!0}),typeof Up.hasOwn!="function"&&Object.defineProperty(Object,"hasOwn",{value:(e,n)=>Object.prototype.hasOwnProperty.call(e,n),writable:!0,configurable:!0});function z2(){var n;if(typeof document>"u"||typeof navigator>"u")return;const e=()=>{try{document.documentElement.classList.add("kybot-embedded-qt-webengine")}catch{}};try{if(typeof window<"u"&&typeof URLSearchParams=="function"){const r=((n=new URLSearchParams(window.location.search).get("kybotEmbed"))!=null?n:"").toLowerCase();if(r==="qtwebengine"||r==="qt-webengine"||r==="qt_we"){e();return}}}catch{}try{navigator.userAgent.includes("QtWebEngine")&&e()}catch{}}z2();var qu={exports:{}},De={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Hp;function O2(){if(Hp)return De;Hp=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),_=Symbol.iterator;function v(H){return H===null||typeof H!="object"?null:(H=_&&H[_]||H["@@iterator"],typeof H=="function"?H:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,T={};function C(H,Z,z){this.props=H,this.context=Z,this.refs=T,this.updater=z||w}C.prototype.isReactComponent={},C.prototype.setState=function(H,Z){if(typeof H!="object"&&typeof H!="function"&&H!=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,H,Z,"setState")},C.prototype.forceUpdate=function(H){this.updater.enqueueForceUpdate(this,H,"forceUpdate")};function E(){}E.prototype=C.prototype;function N(H,Z,z){this.props=H,this.context=Z,this.refs=T,this.updater=z||w}var D=N.prototype=new E;D.constructor=N,j(D,C.prototype),D.isPureReactComponent=!0;var F=Array.isArray;function M(){}var A={H:null,A:null,T:null,S:null},U=Object.prototype.hasOwnProperty;function I(H,Z,z){var oe=z.ref;return{$$typeof:e,type:H,key:Z,ref:oe!==void 0?oe:null,props:z}}function L(H,Z){return I(H.type,Z,H.props)}function B(H){return typeof H=="object"&&H!==null&&H.$$typeof===e}function q(H){var Z={"=":"=0",":":"=2"};return"$"+H.replace(/[=:]/g,function(z){return Z[z]})}var K=/\/+/g;function G(H,Z){return typeof H=="object"&&H!==null&&H.key!=null?q(""+H.key):Z.toString(36)}function ne(H){switch(H.status){case"fulfilled":return H.value;case"rejected":throw H.reason;default:switch(typeof H.status=="string"?H.then(M,M):(H.status="pending",H.then(function(Z){H.status==="pending"&&(H.status="fulfilled",H.value=Z)},function(Z){H.status==="pending"&&(H.status="rejected",H.reason=Z)})),H.status){case"fulfilled":return H.value;case"rejected":throw H.reason}}throw H}function V(H,Z,z,oe,ue){var ve=typeof H;(ve==="undefined"||ve==="boolean")&&(H=null);var Se=!1;if(H===null)Se=!0;else switch(ve){case"bigint":case"string":case"number":Se=!0;break;case"object":switch(H.$$typeof){case e:case n:Se=!0;break;case y:return Se=H._init,V(Se(H._payload),Z,z,oe,ue)}}if(Se)return ue=ue(H),Se=oe===""?"."+G(H,0):oe,F(ue)?(z="",Se!=null&&(z=Se.replace(K,"$&/")+"/"),V(ue,Z,z,"",function(ke){return ke})):ue!=null&&(B(ue)&&(ue=L(ue,z+(ue.key==null||H&&H.key===ue.key?"":(""+ue.key).replace(K,"$&/")+"/")+Se)),Z.push(ue)),1;Se=0;var Te=oe===""?".":oe+":";if(F(H))for(var re=0;re<H.length;re++)oe=H[re],ve=Te+G(oe,re),Se+=V(oe,Z,z,ve,ue);else if(re=v(H),typeof re=="function")for(H=re.call(H),re=0;!(oe=H.next()).done;)oe=oe.value,ve=Te+G(oe,re++),Se+=V(oe,Z,z,ve,ue);else if(ve==="object"){if(typeof H.then=="function")return V(ne(H),Z,z,oe,ue);throw Z=String(H),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys(H).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.")}return Se}function le(H,Z,z){if(H==null)return H;var oe=[],ue=0;return V(H,oe,"","",function(ve){return Z.call(z,ve,ue++)}),oe}function me(H){if(H._status===-1){var Z=H._result;Z=Z(),Z.then(function(z){(H._status===0||H._status===-1)&&(H._status=1,H._result=z)},function(z){(H._status===0||H._status===-1)&&(H._status=2,H._result=z)}),H._status===-1&&(H._status=0,H._result=Z)}if(H._status===1)return H._result.default;throw H._result}var ce=typeof reportError=="function"?reportError:function(H){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof H=="object"&&H!==null&&typeof H.message=="string"?String(H.message):String(H),error:H});if(!window.dispatchEvent(Z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",H);return}console.error(H)},O={map:le,forEach:function(H,Z,z){le(H,function(){Z.apply(this,arguments)},z)},count:function(H){var Z=0;return le(H,function(){Z++}),Z},toArray:function(H){return le(H,function(Z){return Z})||[]},only:function(H){if(!B(H))throw Error("React.Children.only expected to receive a single React element child.");return H}};return De.Activity=g,De.Children=O,De.Component=C,De.Fragment=r,De.Profiler=o,De.PureComponent=N,De.StrictMode=l,De.Suspense=h,De.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,De.__COMPILER_RUNTIME={__proto__:null,c:function(H){return A.H.useMemoCache(H)}},De.cache=function(H){return function(){return H.apply(null,arguments)}},De.cacheSignal=function(){return null},De.cloneElement=function(H,Z,z){if(H==null)throw Error("The argument must be a React element, but you passed "+H+".");var oe=j({},H.props),ue=H.key;if(Z!=null)for(ve in Z.key!==void 0&&(ue=""+Z.key),Z)!U.call(Z,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&Z.ref===void 0||(oe[ve]=Z[ve]);var ve=arguments.length-2;if(ve===1)oe.children=z;else if(1<ve){for(var Se=Array(ve),Te=0;Te<ve;Te++)Se[Te]=arguments[Te+2];oe.children=Se}return I(H.type,ue,oe)},De.createContext=function(H){return H={$$typeof:c,_currentValue:H,_currentValue2:H,_threadCount:0,Provider:null,Consumer:null},H.Provider=H,H.Consumer={$$typeof:u,_context:H},H},De.createElement=function(H,Z,z){var oe,ue={},ve=null;if(Z!=null)for(oe in Z.key!==void 0&&(ve=""+Z.key),Z)U.call(Z,oe)&&oe!=="key"&&oe!=="__self"&&oe!=="__source"&&(ue[oe]=Z[oe]);var Se=arguments.length-2;if(Se===1)ue.children=z;else if(1<Se){for(var Te=Array(Se),re=0;re<Se;re++)Te[re]=arguments[re+2];ue.children=Te}if(H&&H.defaultProps)for(oe in Se=H.defaultProps,Se)ue[oe]===void 0&&(ue[oe]=Se[oe]);return I(H,ve,ue)},De.createRef=function(){return{current:null}},De.forwardRef=function(H){return{$$typeof:f,render:H}},De.isValidElement=B,De.lazy=function(H){return{$$typeof:y,_payload:{_status:-1,_result:H},_init:me}},De.memo=function(H,Z){return{$$typeof:m,type:H,compare:Z===void 0?null:Z}},De.startTransition=function(H){var Z=A.T,z={};A.T=z;try{var oe=H(),ue=A.S;ue!==null&&ue(z,oe),typeof oe=="object"&&oe!==null&&typeof oe.then=="function"&&oe.then(M,ce)}catch(ve){ce(ve)}finally{Z!==null&&z.types!==null&&(Z.types=z.types),A.T=Z}},De.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},De.use=function(H){return A.H.use(H)},De.useActionState=function(H,Z,z){return A.H.useActionState(H,Z,z)},De.useCallback=function(H,Z){return A.H.useCallback(H,Z)},De.useContext=function(H){return A.H.useContext(H)},De.useDebugValue=function(){},De.useDeferredValue=function(H,Z){return A.H.useDeferredValue(H,Z)},De.useEffect=function(H,Z){return A.H.useEffect(H,Z)},De.useEffectEvent=function(H){return A.H.useEffectEvent(H)},De.useId=function(){return A.H.useId()},De.useImperativeHandle=function(H,Z,z){return A.H.useImperativeHandle(H,Z,z)},De.useInsertionEffect=function(H,Z){return A.H.useInsertionEffect(H,Z)},De.useLayoutEffect=function(H,Z){return A.H.useLayoutEffect(H,Z)},De.useMemo=function(H,Z){return A.H.useMemo(H,Z)},De.useOptimistic=function(H,Z){return A.H.useOptimistic(H,Z)},De.useReducer=function(H,Z,z){return A.H.useReducer(H,Z,z)},De.useRef=function(H){return A.H.useRef(H)},De.useState=function(H){return A.H.useState(H)},De.useSyncExternalStore=function(H,Z,z){return A.H.useSyncExternalStore(H,Z,z)},De.useTransition=function(){return A.H.useTransition()},De.version="19.2.4",De}var qp;function Pu(){return qp||(qp=1,qu.exports=O2()),qu.exports}var x=Pu();const Fi=gt(x);var $u={exports:{}},Ii={},Yu={exports:{}},Gu={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Pp;function B2(){return Pp||(Pp=1,(function(e){function n(V,le){var me=V.length;V.push(le);e:for(;0<me;){var ce=me-1>>>1,O=V[ce];if(0<o(O,le))V[ce]=le,V[me]=O,me=ce;else break e}}function r(V){return V.length===0?null:V[0]}function l(V){if(V.length===0)return null;var le=V[0],me=V.pop();if(me!==le){V[0]=me;e:for(var ce=0,O=V.length,H=O>>>1;ce<H;){var Z=2*(ce+1)-1,z=V[Z],oe=Z+1,ue=V[oe];if(0>o(z,me))oe<O&&0>o(ue,z)?(V[ce]=ue,V[oe]=me,ce=oe):(V[ce]=z,V[Z]=me,ce=Z);else if(oe<O&&0>o(ue,me))V[ce]=ue,V[oe]=me,ce=oe;else break e}}return le}function o(V,le){var me=V.sortIndex-le.sortIndex;return me!==0?me:V.id-le.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var c=Date,f=c.now();e.unstable_now=function(){return c.now()-f}}var h=[],m=[],y=1,g=null,_=3,v=!1,w=!1,j=!1,T=!1,C=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function D(V){for(var le=r(m);le!==null;){if(le.callback===null)l(m);else if(le.startTime<=V)l(m),le.sortIndex=le.expirationTime,n(h,le);else break;le=r(m)}}function F(V){if(j=!1,D(V),!w)if(r(h)!==null)w=!0,M||(M=!0,q());else{var le=r(m);le!==null&&ne(F,le.startTime-V)}}var M=!1,A=-1,U=5,I=-1;function L(){return T?!0:!(e.unstable_now()-I<U)}function B(){if(T=!1,M){var V=e.unstable_now();I=V;var le=!0;try{e:{w=!1,j&&(j=!1,E(A),A=-1),v=!0;var me=_;try{t:{for(D(V),g=r(h);g!==null&&!(g.expirationTime>V&&L());){var ce=g.callback;if(typeof ce=="function"){g.callback=null,_=g.priorityLevel;var O=ce(g.expirationTime<=V);if(V=e.unstable_now(),typeof O=="function"){g.callback=O,D(V),le=!0;break t}g===r(h)&&l(h),D(V)}else l(h);g=r(h)}if(g!==null)le=!0;else{var H=r(m);H!==null&&ne(F,H.startTime-V),le=!1}}break e}finally{g=null,_=me,v=!1}le=void 0}}finally{le?q():M=!1}}}var q;if(typeof N=="function")q=function(){N(B)};else if(typeof MessageChannel<"u"){var K=new MessageChannel,G=K.port2;K.port1.onmessage=B,q=function(){G.postMessage(null)}}else q=function(){C(B,0)};function ne(V,le){A=C(function(){V(e.unstable_now())},le)}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(V){V.callback=null},e.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<V?Math.floor(1e3/V):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_next=function(V){switch(_){case 1:case 2:case 3:var le=3;break;default:le=_}var me=_;_=le;try{return V()}finally{_=me}},e.unstable_requestPaint=function(){T=!0},e.unstable_runWithPriority=function(V,le){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var me=_;_=V;try{return le()}finally{_=me}},e.unstable_scheduleCallback=function(V,le,me){var ce=e.unstable_now();switch(typeof me=="object"&&me!==null?(me=me.delay,me=typeof me=="number"&&0<me?ce+me:ce):me=ce,V){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=me+O,V={id:y++,callback:le,priorityLevel:V,startTime:me,expirationTime:O,sortIndex:-1},me>ce?(V.sortIndex=me,n(m,V),r(h)===null&&V===r(m)&&(j?(E(A),A=-1):j=!0,ne(F,me-ce))):(V.sortIndex=O,n(h,V),w||v||(w=!0,M||(M=!0,q()))),V},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(V){var le=_;return function(){var me=_;_=le;try{return V.apply(this,arguments)}finally{_=me}}}})(Gu)),Gu}var $p;function F2(){return $p||($p=1,Yu.exports=B2()),Yu.exports}var Ku={exports:{}},tn={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Yp;function I2(){if(Yp)return tn;Yp=1;var e=Pu();function n(h){var m="https://react.dev/errors/"+h;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)m+="&args[]="+encodeURIComponent(arguments[y])}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 l={d:{f:r,r:function(){throw Error(n(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 u(h,m,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:h,containerInfo:m,implementation:y}}var c=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 tn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,tn.createPortal=function(h,m){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(n(299));return u(h,m,null,y)},tn.flushSync=function(h){var m=c.T,y=l.p;try{if(c.T=null,l.p=2,h)return h()}finally{c.T=m,l.p=y,l.d.f()}},tn.preconnect=function(h,m){typeof h=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,l.d.C(h,m))},tn.prefetchDNS=function(h){typeof h=="string"&&l.d.D(h)},tn.preinit=function(h,m){if(typeof h=="string"&&m&&typeof m.as=="string"){var y=m.as,g=f(y,m.crossOrigin),_=typeof m.integrity=="string"?m.integrity:void 0,v=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;y==="style"?l.d.S(h,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:g,integrity:_,fetchPriority:v}):y==="script"&&l.d.X(h,{crossOrigin:g,integrity:_,fetchPriority:v,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},tn.preinitModule=function(h,m){if(typeof h=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var y=f(m.as,m.crossOrigin);l.d.M(h,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&l.d.M(h)},tn.preload=function(h,m){if(typeof h=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var y=m.as,g=f(y,m.crossOrigin);l.d.L(h,y,{crossOrigin:g,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})}},tn.preloadModule=function(h,m){if(typeof h=="string")if(m){var y=f(m.as,m.crossOrigin);l.d.m(h,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else l.d.m(h)},tn.requestFormReset=function(h){l.d.r(h)},tn.unstable_batchedUpdates=function(h,m){return h(m)},tn.useFormState=function(h,m,y){return c.H.useFormState(h,m,y)},tn.useFormStatus=function(){return c.H.useHostTransitionStatus()},tn.version="19.2.4",tn}var Gp;function Kp(){if(Gp)return Ku.exports;Gp=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(n){console.error(n)}}return e(),Ku.exports=I2(),Ku.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Vp;function U2(){if(Vp)return Ii;Vp=1;var e=F2(),n=Pu(),r=Kp();function l(t){var a="https://react.dev/errors/"+t;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)a+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+t+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function u(t){var a=t,i=t;if(t.alternate)for(;a.return;)a=a.return;else{t=a;do a=t,(a.flags&4098)!==0&&(i=a.return),t=a.return;while(t)}return a.tag===3?i:null}function c(t){if(t.tag===13){var a=t.memoizedState;if(a===null&&(t=t.alternate,t!==null&&(a=t.memoizedState)),a!==null)return a.dehydrated}return null}function f(t){if(t.tag===31){var a=t.memoizedState;if(a===null&&(t=t.alternate,t!==null&&(a=t.memoizedState)),a!==null)return a.dehydrated}return null}function h(t){if(u(t)!==t)throw Error(l(188))}function m(t){var a=t.alternate;if(!a){if(a=u(t),a===null)throw Error(l(188));return a!==t?null:t}for(var i=t,d=a;;){var p=i.return;if(p===null)break;var b=p.alternate;if(b===null){if(d=p.return,d!==null){i=d;continue}break}if(p.child===b.child){for(b=p.child;b;){if(b===i)return h(p),t;if(b===d)return h(p),a;b=b.sibling}throw Error(l(188))}if(i.return!==d.return)i=p,d=b;else{for(var k=!1,R=p.child;R;){if(R===i){k=!0,i=p,d=b;break}if(R===d){k=!0,d=p,i=b;break}R=R.sibling}if(!k){for(R=b.child;R;){if(R===i){k=!0,i=b,d=p;break}if(R===d){k=!0,d=b,i=p;break}R=R.sibling}if(!k)throw Error(l(189))}}if(i.alternate!==d)throw Error(l(190))}if(i.tag!==3)throw Error(l(188));return i.stateNode.current===i?t:a}function y(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t;for(t=t.child;t!==null;){if(a=y(t),a!==null)return a;t=t.sibling}return null}var g=Object.assign,_=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),N=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),L=Symbol.for("react.memo_cache_sentinel"),B=Symbol.iterator;function q(t){return t===null||typeof t!="object"?null:(t=B&&t[B]||t["@@iterator"],typeof t=="function"?t:null)}var K=Symbol.for("react.client.reference");function G(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===K?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case j:return"Fragment";case C:return"Profiler";case T:return"StrictMode";case F:return"Suspense";case M:return"SuspenseList";case I:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case w:return"Portal";case N:return t.displayName||"Context";case E:return(t._context.displayName||"Context")+".Consumer";case D:var a=t.render;return t=t.displayName,t||(t=a.displayName||a.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case A:return a=t.displayName||null,a!==null?a:G(t.type)||"Memo";case U:a=t._payload,t=t._init;try{return G(t(a))}catch{}}return null}var ne=Array.isArray,V=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,me={pending:!1,data:null,method:null,action:null},ce=[],O=-1;function H(t){return{current:t}}function Z(t){0>O||(t.current=ce[O],ce[O]=null,O--)}function z(t,a){O++,ce[O]=t.current,t.current=a}var oe=H(null),ue=H(null),ve=H(null),Se=H(null);function Te(t,a){switch(z(ve,a),z(ue,t),z(oe,null),a.nodeType){case 9:case 11:t=(t=a.documentElement)&&(t=t.namespaceURI)?e2(t):0;break;default:if(t=a.tagName,a=a.namespaceURI)a=e2(a),t=t2(a,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Z(oe),z(oe,t)}function re(){Z(oe),Z(ue),Z(ve)}function ke(t){t.memoizedState!==null&&z(Se,t);var a=oe.current,i=t2(a,t.type);a!==i&&(z(ue,t),z(oe,i))}function Ze(t){ue.current===t&&(Z(oe),Z(ue)),Se.current===t&&(Z(Se),cs._currentValue=me)}var Fe,Mt;function vt(t){if(Fe===void 0)try{throw Error()}catch(i){var a=i.stack.trim().match(/\n( *(at )?)/);Fe=a&&a[1]||"",Mt=-1<i.stack.indexOf(`
    at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
`+Fe+t+Mt}var hn=!1;function Yt(t,a){if(!t||hn)return"";hn=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(a){var se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch(ee){var J=ee}Reflect.construct(t,[],se)}else{try{se.call()}catch(ee){J=ee}t.call(se.prototype)}}else{try{throw Error()}catch(ee){J=ee}(se=t())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(ee){if(ee&&J&&typeof ee.stack=="string")return[ee.stack,J.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=d.DetermineComponentFrameRoot(),k=b[0],R=b[1];if(k&&R){var P=k.split(`
`),X=R.split(`
`);for(p=d=0;d<P.length&&!P[d].includes("DetermineComponentFrameRoot");)d++;for(;p<X.length&&!X[p].includes("DetermineComponentFrameRoot");)p++;if(d===P.length||p===X.length)for(d=P.length-1,p=X.length-1;1<=d&&0<=p&&P[d]!==X[p];)p--;for(;1<=d&&0<=p;d--,p--)if(P[d]!==X[p]){if(d!==1||p!==1)do if(d--,p--,0>p||P[d]!==X[p]){var ae=`
`+P[d].replace(" at new "," at ");return t.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",t.displayName)),ae}while(1<=d&&0<=p);break}}}finally{hn=!1,Error.prepareStackTrace=i}return(i=t?t.displayName||t.name:"")?vt(i):""}function Ma(t,a){switch(t.tag){case 26:case 27:case 5:return vt(t.type);case 16:return vt("Lazy");case 13:return t.child!==a&&a!==null?vt("Suspense Fallback"):vt("Suspense");case 19:return vt("SuspenseList");case 0:case 15:return Yt(t.type,!1);case 11:return Yt(t.type.render,!1);case 1:return Yt(t.type,!0);case 31:return vt("Activity");default:return""}}function Ln(t){try{var a="",i=null;do a+=Ma(t,i),i=t,t=t.return;while(t);return a}catch(d){return`
Error generating stack: `+d.message+`
`+d.stack}}var Rt=Object.prototype.hasOwnProperty,bn=e.unstable_scheduleCallback,Wn=e.unstable_cancelCallback,sn=e.unstable_shouldYield,ya=e.unstable_requestPaint,tt=e.unstable_now,xn=e.unstable_getCurrentPriorityLevel,te=e.unstable_ImmediatePriority,pe=e.unstable_UserBlockingPriority,je=e.unstable_NormalPriority,Re=e.unstable_LowPriority,de=e.unstable_IdlePriority,Ve=e.log,lt=e.unstable_setDisableYieldValue,bt=null,it=null;function St(t){if(typeof Ve=="function"&&lt(t),it&&typeof it.setStrictMode=="function")try{it.setStrictMode(bt,t)}catch{}}var Ie=Math.clz32?Math.clz32:wr,cn=Math.log,Kt=Math.LN2;function wr(t){return t>>>=0,t===0?32:31-(cn(t)/Kt|0)|0}var zn=256,Xn=262144,Jn=4194304;function Et(t){var a=t&42;if(a!==0)return a;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Zn(t,a,i){var d=t.pendingLanes;if(d===0)return 0;var p=0,b=t.suspendedLanes,k=t.pingedLanes;t=t.warmLanes;var R=d&134217727;return R!==0?(d=R&~b,d!==0?p=Et(d):(k&=R,k!==0?p=Et(k):i||(i=R&~t,i!==0&&(p=Et(i))))):(R=d&~b,R!==0?p=Et(R):k!==0?p=Et(k):i||(i=d&~t,i!==0&&(p=Et(i)))),p===0?0:a!==0&&a!==p&&(a&b)===0&&(b=p&-p,i=a&-a,b>=i||b===32&&(i&4194048)!==0)?a:p}function ba(t,a){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&a)===0}function kr(t,a){switch(t){case 1:case 2:case 4:case 8:case 64:return a+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 a+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 Sr(){var t=Jn;return Jn<<=1,(Jn&62914560)===0&&(Jn=4194304),t}function Ya(t){for(var a=[],i=0;31>i;i++)a.push(t);return a}function xa(t,a){t.pendingLanes|=a,a!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function ai(t,a,i,d,p,b){var k=t.pendingLanes;t.pendingLanes=i,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=i,t.entangledLanes&=i,t.errorRecoveryDisabledLanes&=i,t.shellSuspendCounter=0;var R=t.entanglements,P=t.expirationTimes,X=t.hiddenUpdates;for(i=k&~i;0<i;){var ae=31-Ie(i),se=1<<ae;R[ae]=0,P[ae]=-1;var J=X[ae];if(J!==null)for(X[ae]=null,ae=0;ae<J.length;ae++){var ee=J[ae];ee!==null&&(ee.lane&=-536870913)}i&=~se}d!==0&&dl(t,d,0),b!==0&&p===0&&t.tag!==0&&(t.suspendedLanes|=b&~(k&~a))}function dl(t,a,i){t.pendingLanes|=a,t.suspendedLanes&=~a;var d=31-Ie(a);t.entangledLanes|=a,t.entanglements[d]=t.entanglements[d]|1073741824|i&261930}function fe(t,a){var i=t.entangledLanes|=a;for(t=t.entanglements;i;){var d=31-Ie(i),p=1<<d;p&a|t[d]&a&&(t[d]|=a),i&=~p}}function Le(t,a){var i=a&-a;return i=(i&42)!==0?1:Qe(i),(i&(t.suspendedLanes|a))!==0?0:i}function Qe(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function ea(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function fl(){var t=le.p;return t!==0?t:(t=window.event,t===void 0?32:S2(t.type))}function ko(t,a){var i=le.p;try{return le.p=t,a()}finally{le.p=i}}var Ra=Math.random().toString(36).slice(2),Bt="__reactFiber$"+Ra,Wt="__reactProps$"+Ra,$="__reactContainer$"+Ra,ge="__reactEvents$"+Ra,be="__reactListeners$"+Ra,_e="__reactHandles$"+Ra,ht="__reactResources$"+Ra,We="__reactMarker$"+Ra;function Ft(t){delete t[Bt],delete t[Wt],delete t[ge],delete t[be],delete t[_e]}function He(t){var a=t[Bt];if(a)return a;for(var i=t.parentNode;i;){if(a=i[$]||i[Bt]){if(i=a.alternate,a.child!==null||i!==null&&i.child!==null)for(t=s2(t);t!==null;){if(i=t[Bt])return i;t=s2(t)}return a}t=i,i=t.parentNode}return null}function vn(t){if(t=t[Bt]||t[$]){var a=t.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return t}return null}function _n(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t.stateNode;throw Error(l(33))}function ta(t){var a=t[ht];return a||(a=t[ht]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function Ct(t){t[We]=!0}var So=new Set,Co={};function Dt(t,a){It(t,a),It(t+"Capture",a)}function It(t,a){for(Co[t]=a,t=0;t<a.length;t++)So.add(a[t])}var Da=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]*$"),Cr={},ri={};function Ga(t){return Rt.call(ri,t)?!0:Rt.call(Cr,t)?!1:Da.test(t)?ri[t]=!0:(Cr[t]=!0,!1)}function On(t,a,i){if(Ga(a))if(i===null)t.removeAttribute(a);else{switch(typeof i){case"undefined":case"function":case"symbol":t.removeAttribute(a);return;case"boolean":var d=a.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){t.removeAttribute(a);return}}t.setAttribute(a,""+i)}}function hl(t,a,i){if(i===null)t.removeAttribute(a);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttribute(a,""+i)}}function Ka(t,a,i,d){if(d===null)t.removeAttribute(i);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttributeNS(a,i,""+d)}}function na(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Gv(t){var a=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function YD(t,a,i){var d=Object.getOwnPropertyDescriptor(t.constructor.prototype,a);if(!t.hasOwnProperty(a)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var p=d.get,b=d.set;return Object.defineProperty(t,a,{configurable:!0,get:function(){return p.call(this)},set:function(k){i=""+k,b.call(this,k)}}),Object.defineProperty(t,a,{enumerable:d.enumerable}),{getValue:function(){return i},setValue:function(k){i=""+k},stopTracking:function(){t._valueTracker=null,delete t[a]}}}}function Mh(t){if(!t._valueTracker){var a=Gv(t)?"checked":"value";t._valueTracker=YD(t,a,""+t[a])}}function Kv(t){if(!t)return!1;var a=t._valueTracker;if(!a)return!0;var i=a.getValue(),d="";return t&&(d=Gv(t)?t.checked?"true":"false":t.value),t=d,t!==i?(a.setValue(t),!0):!1}function Mc(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var GD=/[\n"\\]/g;function aa(t){return t.replace(GD,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function Rh(t,a,i,d,p,b,k,R){t.name="",k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?t.type=k:t.removeAttribute("type"),a!=null?k==="number"?(a===0&&t.value===""||t.value!=a)&&(t.value=""+na(a)):t.value!==""+na(a)&&(t.value=""+na(a)):k!=="submit"&&k!=="reset"||t.removeAttribute("value"),a!=null?Dh(t,k,na(a)):i!=null?Dh(t,k,na(i)):d!=null&&t.removeAttribute("value"),p==null&&b!=null&&(t.defaultChecked=!!b),p!=null&&(t.checked=p&&typeof p!="function"&&typeof p!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?t.name=""+na(R):t.removeAttribute("name")}function Vv(t,a,i,d,p,b,k,R){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(t.type=b),a!=null||i!=null){if(!(b!=="submit"&&b!=="reset"||a!=null)){Mh(t);return}i=i!=null?""+na(i):"",a=a!=null?""+na(a):i,R||a===t.value||(t.value=a),t.defaultValue=a}d=d!=null?d:p,d=typeof d!="function"&&typeof d!="symbol"&&!!d,t.checked=R?t.checked:!!d,t.defaultChecked=!!d,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(t.name=k),Mh(t)}function Dh(t,a,i){a==="number"&&Mc(t.ownerDocument)===t||t.defaultValue===""+i||(t.defaultValue=""+i)}function li(t,a,i,d){if(t=t.options,a){a={};for(var p=0;p<i.length;p++)a["$"+i[p]]=!0;for(i=0;i<t.length;i++)p=a.hasOwnProperty("$"+t[i].value),t[i].selected!==p&&(t[i].selected=p),p&&d&&(t[i].defaultSelected=!0)}else{for(i=""+na(i),a=null,p=0;p<t.length;p++){if(t[p].value===i){t[p].selected=!0,d&&(t[p].defaultSelected=!0);return}a!==null||t[p].disabled||(a=t[p])}a!==null&&(a.selected=!0)}}function Qv(t,a,i){if(a!=null&&(a=""+na(a),a!==t.value&&(t.value=a),i==null)){t.defaultValue!==a&&(t.defaultValue=a);return}t.defaultValue=i!=null?""+na(i):""}function Wv(t,a,i,d){if(a==null){if(d!=null){if(i!=null)throw Error(l(92));if(ne(d)){if(1<d.length)throw Error(l(93));d=d[0]}i=d}i==null&&(i=""),a=i}i=na(a),t.defaultValue=i,d=t.textContent,d===i&&d!==""&&d!==null&&(t.value=d),Mh(t)}function ii(t,a){if(a){var i=t.firstChild;if(i&&i===t.lastChild&&i.nodeType===3){i.nodeValue=a;return}}t.textContent=a}var KD=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 Xv(t,a,i){var d=a.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?d?t.setProperty(a,""):a==="float"?t.cssFloat="":t[a]="":d?t.setProperty(a,i):typeof i!="number"||i===0||KD.has(a)?a==="float"?t.cssFloat=i:t[a]=(""+i).trim():t[a]=i+"px"}function Jv(t,a,i){if(a!=null&&typeof a!="object")throw Error(l(62));if(t=t.style,i!=null){for(var d in i)!i.hasOwnProperty(d)||a!=null&&a.hasOwnProperty(d)||(d.indexOf("--")===0?t.setProperty(d,""):d==="float"?t.cssFloat="":t[d]="");for(var p in a)d=a[p],a.hasOwnProperty(p)&&i[p]!==d&&Xv(t,p,d)}else for(var b in a)a.hasOwnProperty(b)&&Xv(t,b,a[b])}function Lh(t){if(t.indexOf("-")===-1)return!1;switch(t){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 VD=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"]]),QD=/^[\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 Rc(t){return QD.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Va(){}var zh=null;function Oh(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var oi=null,si=null;function Zv(t){var a=vn(t);if(a&&(t=a.stateNode)){var i=t[Wt]||null;e:switch(t=a.stateNode,a.type){case"input":if(Rh(t,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),a=i.name,i.type==="radio"&&a!=null){for(i=t;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+aa(""+a)+'"][type="radio"]'),a=0;a<i.length;a++){var d=i[a];if(d!==t&&d.form===t.form){var p=d[Wt]||null;if(!p)throw Error(l(90));Rh(d,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(a=0;a<i.length;a++)d=i[a],d.form===t.form&&Kv(d)}break e;case"textarea":Qv(t,i.value,i.defaultValue);break e;case"select":a=i.value,a!=null&&li(t,!!i.multiple,a,!1)}}}var Bh=!1;function e1(t,a,i){if(Bh)return t(a,i);Bh=!0;try{var d=t(a);return d}finally{if(Bh=!1,(oi!==null||si!==null)&&(xu(),oi&&(a=oi,t=si,si=oi=null,Zv(a),t)))for(a=0;a<t.length;a++)Zv(t[a])}}function jo(t,a){var i=t.stateNode;if(i===null)return null;var d=i[Wt]||null;if(d===null)return null;i=d[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(t=t.type,d=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!d;break e;default:t=!1}if(t)return null;if(i&&typeof i!="function")throw Error(l(231,a,typeof i));return i}var Qa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fh=!1;if(Qa)try{var Eo={};Object.defineProperty(Eo,"passive",{get:function(){Fh=!0}}),window.addEventListener("test",Eo,Eo),window.removeEventListener("test",Eo,Eo)}catch{Fh=!1}var jr=null,Ih=null,Dc=null;function t1(){if(Dc)return Dc;var t,a=Ih,i=a.length,d,p="value"in jr?jr.value:jr.textContent,b=p.length;for(t=0;t<i&&a[t]===p[t];t++);var k=i-t;for(d=1;d<=k&&a[i-d]===p[b-d];d++);return Dc=p.slice(t,1<d?1-d:void 0)}function Lc(t){var a=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&a===13&&(t=13)):t=a,t===10&&(t=13),32<=t||t===13?t:0}function zc(){return!0}function n1(){return!1}function wn(t){function a(i,d,p,b,k){this._reactName=i,this._targetInst=p,this.type=d,this.nativeEvent=b,this.target=k,this.currentTarget=null;for(var R in t)t.hasOwnProperty(R)&&(i=t[R],this[R]=i?i(b):b[R]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?zc:n1,this.isPropagationStopped=n1,this}return g(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=zc)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=zc)},persist:function(){},isPersistent:zc}),a}var ml={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Oc=wn(ml),No=g({},ml,{view:0,detail:0}),WD=wn(No),Uh,Hh,To,Bc=g({},No,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ph,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==To&&(To&&t.type==="mousemove"?(Uh=t.screenX-To.screenX,Hh=t.screenY-To.screenY):Hh=Uh=0,To=t),Uh)},movementY:function(t){return"movementY"in t?t.movementY:Hh}}),a1=wn(Bc),XD=g({},Bc,{dataTransfer:0}),JD=wn(XD),ZD=g({},No,{relatedTarget:0}),qh=wn(ZD),eL=g({},ml,{animationName:0,elapsedTime:0,pseudoElement:0}),tL=wn(eL),nL=g({},ml,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),aL=wn(nL),rL=g({},ml,{data:0}),r1=wn(rL),lL={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},iL={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"},oL={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function sL(t){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(t):(t=oL[t])?!!a[t]:!1}function Ph(){return sL}var cL=g({},No,{key:function(t){if(t.key){var a=lL[t.key]||t.key;if(a!=="Unidentified")return a}return t.type==="keypress"?(t=Lc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?iL[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ph,charCode:function(t){return t.type==="keypress"?Lc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Lc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),uL=wn(cL),dL=g({},Bc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),l1=wn(dL),fL=g({},No,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ph}),hL=wn(fL),mL=g({},ml,{propertyName:0,elapsedTime:0,pseudoElement:0}),pL=wn(mL),gL=g({},Bc,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),yL=wn(gL),bL=g({},ml,{newState:0,oldState:0}),xL=wn(bL),vL=[9,13,27,32],$h=Qa&&"CompositionEvent"in window,Ao=null;Qa&&"documentMode"in document&&(Ao=document.documentMode);var _L=Qa&&"TextEvent"in window&&!Ao,i1=Qa&&(!$h||Ao&&8<Ao&&11>=Ao),o1=" ",s1=!1;function c1(t,a){switch(t){case"keyup":return vL.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function u1(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ci=!1;function wL(t,a){switch(t){case"compositionend":return u1(a);case"keypress":return a.which!==32?null:(s1=!0,o1);case"textInput":return t=a.data,t===o1&&s1?null:t;default:return null}}function kL(t,a){if(ci)return t==="compositionend"||!$h&&c1(t,a)?(t=t1(),Dc=Ih=jr=null,ci=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return i1&&a.locale!=="ko"?null:a.data;default:return null}}var SL={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 d1(t){var a=t&&t.nodeName&&t.nodeName.toLowerCase();return a==="input"?!!SL[t.type]:a==="textarea"}function f1(t,a,i,d){oi?si?si.push(d):si=[d]:oi=d,a=ju(a,"onChange"),0<a.length&&(i=new Oc("onChange","change",null,i,d),t.push({event:i,listeners:a}))}var Mo=null,Ro=null;function CL(t){Vw(t,0)}function Fc(t){var a=_n(t);if(Kv(a))return t}function h1(t,a){if(t==="change")return a}var m1=!1;if(Qa){var Yh;if(Qa){var Gh="oninput"in document;if(!Gh){var p1=document.createElement("div");p1.setAttribute("oninput","return;"),Gh=typeof p1.oninput=="function"}Yh=Gh}else Yh=!1;m1=Yh&&(!document.documentMode||9<document.documentMode)}function g1(){Mo&&(Mo.detachEvent("onpropertychange",y1),Ro=Mo=null)}function y1(t){if(t.propertyName==="value"&&Fc(Ro)){var a=[];f1(a,Ro,t,Oh(t)),e1(CL,a)}}function jL(t,a,i){t==="focusin"?(g1(),Mo=a,Ro=i,Mo.attachEvent("onpropertychange",y1)):t==="focusout"&&g1()}function EL(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Fc(Ro)}function NL(t,a){if(t==="click")return Fc(a)}function TL(t,a){if(t==="input"||t==="change")return Fc(a)}function AL(t,a){return t===a&&(t!==0||1/t===1/a)||t!==t&&a!==a}var Bn=typeof Object.is=="function"?Object.is:AL;function Do(t,a){if(Bn(t,a))return!0;if(typeof t!="object"||t===null||typeof a!="object"||a===null)return!1;var i=Object.keys(t),d=Object.keys(a);if(i.length!==d.length)return!1;for(d=0;d<i.length;d++){var p=i[d];if(!Rt.call(a,p)||!Bn(t[p],a[p]))return!1}return!0}function b1(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function x1(t,a){var i=b1(t);t=0;for(var d;i;){if(i.nodeType===3){if(d=t+i.textContent.length,t<=a&&d>=a)return{node:i,offset:a-t};t=d}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=b1(i)}}function v1(t,a){return t&&a?t===a?!0:t&&t.nodeType===3?!1:a&&a.nodeType===3?v1(t,a.parentNode):"contains"in t?t.contains(a):t.compareDocumentPosition?!!(t.compareDocumentPosition(a)&16):!1:!1}function _1(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var a=Mc(t.document);a instanceof t.HTMLIFrameElement;){try{var i=typeof a.contentWindow.location.href=="string"}catch{i=!1}if(i)t=a.contentWindow;else break;a=Mc(t.document)}return a}function Kh(t){var a=t&&t.nodeName&&t.nodeName.toLowerCase();return a&&(a==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||a==="textarea"||t.contentEditable==="true")}var ML=Qa&&"documentMode"in document&&11>=document.documentMode,ui=null,Vh=null,Lo=null,Qh=!1;function w1(t,a,i){var d=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Qh||ui==null||ui!==Mc(d)||(d=ui,"selectionStart"in d&&Kh(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Lo&&Do(Lo,d)||(Lo=d,d=ju(Vh,"onSelect"),0<d.length&&(a=new Oc("onSelect","select",null,a,i),t.push({event:a,listeners:d}),a.target=ui)))}function pl(t,a){var i={};return i[t.toLowerCase()]=a.toLowerCase(),i["Webkit"+t]="webkit"+a,i["Moz"+t]="moz"+a,i}var di={animationend:pl("Animation","AnimationEnd"),animationiteration:pl("Animation","AnimationIteration"),animationstart:pl("Animation","AnimationStart"),transitionrun:pl("Transition","TransitionRun"),transitionstart:pl("Transition","TransitionStart"),transitioncancel:pl("Transition","TransitionCancel"),transitionend:pl("Transition","TransitionEnd")},Wh={},k1={};Qa&&(k1=document.createElement("div").style,"AnimationEvent"in window||(delete di.animationend.animation,delete di.animationiteration.animation,delete di.animationstart.animation),"TransitionEvent"in window||delete di.transitionend.transition);function gl(t){if(Wh[t])return Wh[t];if(!di[t])return t;var a=di[t],i;for(i in a)if(a.hasOwnProperty(i)&&i in k1)return Wh[t]=a[i];return t}var S1=gl("animationend"),C1=gl("animationiteration"),j1=gl("animationstart"),RL=gl("transitionrun"),DL=gl("transitionstart"),LL=gl("transitioncancel"),E1=gl("transitionend"),N1=new Map,Xh="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(" ");Xh.push("scrollEnd");function va(t,a){N1.set(t,a),Dt(a,[t])}var Ic=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},ra=[],fi=0,Jh=0;function Uc(){for(var t=fi,a=Jh=fi=0;a<t;){var i=ra[a];ra[a++]=null;var d=ra[a];ra[a++]=null;var p=ra[a];ra[a++]=null;var b=ra[a];if(ra[a++]=null,d!==null&&p!==null){var k=d.pending;k===null?p.next=p:(p.next=k.next,k.next=p),d.pending=p}b!==0&&T1(i,p,b)}}function Hc(t,a,i,d){ra[fi++]=t,ra[fi++]=a,ra[fi++]=i,ra[fi++]=d,Jh|=d,t.lanes|=d,t=t.alternate,t!==null&&(t.lanes|=d)}function Zh(t,a,i,d){return Hc(t,a,i,d),qc(t)}function yl(t,a){return Hc(t,null,null,a),qc(t)}function T1(t,a,i){t.lanes|=i;var d=t.alternate;d!==null&&(d.lanes|=i);for(var p=!1,b=t.return;b!==null;)b.childLanes|=i,d=b.alternate,d!==null&&(d.childLanes|=i),b.tag===22&&(t=b.stateNode,t===null||t._visibility&1||(p=!0)),t=b,b=b.return;return t.tag===3?(b=t.stateNode,p&&a!==null&&(p=31-Ie(i),t=b.hiddenUpdates,d=t[p],d===null?t[p]=[a]:d.push(a),a.lane=i|536870912),b):null}function qc(t){if(50<ns)throw ns=0,sp=null,Error(l(185));for(var a=t.return;a!==null;)t=a,a=t.return;return t.tag===3?t.stateNode:null}var hi={};function zL(t,a,i,d){this.tag=t,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Fn(t,a,i,d){return new zL(t,a,i,d)}function em(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Wa(t,a){var i=t.alternate;return i===null?(i=Fn(t.tag,a,t.key,t.mode),i.elementType=t.elementType,i.type=t.type,i.stateNode=t.stateNode,i.alternate=t,t.alternate=i):(i.pendingProps=a,i.type=t.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=t.flags&65011712,i.childLanes=t.childLanes,i.lanes=t.lanes,i.child=t.child,i.memoizedProps=t.memoizedProps,i.memoizedState=t.memoizedState,i.updateQueue=t.updateQueue,a=t.dependencies,i.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},i.sibling=t.sibling,i.index=t.index,i.ref=t.ref,i.refCleanup=t.refCleanup,i}function A1(t,a){t.flags&=65011714;var i=t.alternate;return i===null?(t.childLanes=0,t.lanes=a,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=i.childLanes,t.lanes=i.lanes,t.child=i.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=i.memoizedProps,t.memoizedState=i.memoizedState,t.updateQueue=i.updateQueue,t.type=i.type,a=i.dependencies,t.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),t}function Pc(t,a,i,d,p,b){var k=0;if(d=t,typeof t=="function")em(t)&&(k=1);else if(typeof t=="string")k=Uz(t,i,oe.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case I:return t=Fn(31,i,a,p),t.elementType=I,t.lanes=b,t;case j:return bl(i.children,p,b,a);case T:k=8,p|=24;break;case C:return t=Fn(12,i,a,p|2),t.elementType=C,t.lanes=b,t;case F:return t=Fn(13,i,a,p),t.elementType=F,t.lanes=b,t;case M:return t=Fn(19,i,a,p),t.elementType=M,t.lanes=b,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case N:k=10;break e;case E:k=9;break e;case D:k=11;break e;case A:k=14;break e;case U:k=16,d=null;break e}k=29,i=Error(l(130,t===null?"null":typeof t,"")),d=null}return a=Fn(k,i,a,p),a.elementType=t,a.type=d,a.lanes=b,a}function bl(t,a,i,d){return t=Fn(7,t,d,a),t.lanes=i,t}function tm(t,a,i){return t=Fn(6,t,null,a),t.lanes=i,t}function M1(t){var a=Fn(18,null,null,0);return a.stateNode=t,a}function nm(t,a,i){return a=Fn(4,t.children!==null?t.children:[],t.key,a),a.lanes=i,a.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},a}var R1=new WeakMap;function la(t,a){if(typeof t=="object"&&t!==null){var i=R1.get(t);return i!==void 0?i:(a={value:t,source:a,stack:Ln(a)},R1.set(t,a),a)}return{value:t,source:a,stack:Ln(a)}}var mi=[],pi=0,$c=null,zo=0,ia=[],oa=0,Er=null,La=1,za="";function Xa(t,a){mi[pi++]=zo,mi[pi++]=$c,$c=t,zo=a}function D1(t,a,i){ia[oa++]=La,ia[oa++]=za,ia[oa++]=Er,Er=t;var d=La;t=za;var p=32-Ie(d)-1;d&=~(1<<p),i+=1;var b=32-Ie(a)+p;if(30<b){var k=p-p%5;b=(d&(1<<k)-1).toString(32),d>>=k,p-=k,La=1<<32-Ie(a)+p|i<<p|d,za=b+t}else La=1<<b|i<<p|d,za=t}function am(t){t.return!==null&&(Xa(t,1),D1(t,1,0))}function rm(t){for(;t===$c;)$c=mi[--pi],mi[pi]=null,zo=mi[--pi],mi[pi]=null;for(;t===Er;)Er=ia[--oa],ia[oa]=null,za=ia[--oa],ia[oa]=null,La=ia[--oa],ia[oa]=null}function L1(t,a){ia[oa++]=La,ia[oa++]=za,ia[oa++]=Er,La=a.id,za=a.overflow,Er=t}var Xt=null,_t=null,Xe=!1,Nr=null,sa=!1,lm=Error(l(519));function Tr(t){var a=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Oo(la(a,t)),lm}function z1(t){var a=t.stateNode,i=t.type,d=t.memoizedProps;switch(a[Bt]=t,a[Wt]=d,i){case"dialog":Pe("cancel",a),Pe("close",a);break;case"iframe":case"object":case"embed":Pe("load",a);break;case"video":case"audio":for(i=0;i<rs.length;i++)Pe(rs[i],a);break;case"source":Pe("error",a);break;case"img":case"image":case"link":Pe("error",a),Pe("load",a);break;case"details":Pe("toggle",a);break;case"input":Pe("invalid",a),Vv(a,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":Pe("invalid",a);break;case"textarea":Pe("invalid",a),Wv(a,d.value,d.defaultValue,d.children)}i=d.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||a.textContent===""+i||d.suppressHydrationWarning===!0||Jw(a.textContent,i)?(d.popover!=null&&(Pe("beforetoggle",a),Pe("toggle",a)),d.onScroll!=null&&Pe("scroll",a),d.onScrollEnd!=null&&Pe("scrollend",a),d.onClick!=null&&(a.onclick=Va),a=!0):a=!1,a||Tr(t,!0)}function O1(t){for(Xt=t.return;Xt;)switch(Xt.tag){case 5:case 31:case 13:sa=!1;return;case 27:case 3:sa=!0;return;default:Xt=Xt.return}}function gi(t){if(t!==Xt)return!1;if(!Xe)return O1(t),Xe=!0,!1;var a=t.tag,i;if((i=a!==3&&a!==27)&&((i=a===5)&&(i=t.type,i=!(i!=="form"&&i!=="button")||kp(t.type,t.memoizedProps)),i=!i),i&&_t&&Tr(t),O1(t),a===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));_t=o2(t)}else if(a===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));_t=o2(t)}else a===27?(a=_t,Pr(t.type)?(t=Np,Np=null,_t=t):_t=a):_t=Xt?ua(t.stateNode.nextSibling):null;return!0}function xl(){_t=Xt=null,Xe=!1}function im(){var t=Nr;return t!==null&&(jn===null?jn=t:jn.push.apply(jn,t),Nr=null),t}function Oo(t){Nr===null?Nr=[t]:Nr.push(t)}var om=H(null),vl=null,Ja=null;function Ar(t,a,i){z(om,a._currentValue),a._currentValue=i}function Za(t){t._currentValue=om.current,Z(om)}function sm(t,a,i){for(;t!==null;){var d=t.alternate;if((t.childLanes&a)!==a?(t.childLanes|=a,d!==null&&(d.childLanes|=a)):d!==null&&(d.childLanes&a)!==a&&(d.childLanes|=a),t===i)break;t=t.return}}function cm(t,a,i,d){var p=t.child;for(p!==null&&(p.return=t);p!==null;){var b=p.dependencies;if(b!==null){var k=p.child;b=b.firstContext;e:for(;b!==null;){var R=b;b=p;for(var P=0;P<a.length;P++)if(R.context===a[P]){b.lanes|=i,R=b.alternate,R!==null&&(R.lanes|=i),sm(b.return,i,t),d||(k=null);break e}b=R.next}}else if(p.tag===18){if(k=p.return,k===null)throw Error(l(341));k.lanes|=i,b=k.alternate,b!==null&&(b.lanes|=i),sm(k,i,t),k=null}else k=p.child;if(k!==null)k.return=p;else for(k=p;k!==null;){if(k===t){k=null;break}if(p=k.sibling,p!==null){p.return=k.return,k=p;break}k=k.return}p=k}}function yi(t,a,i,d){t=null;for(var p=a,b=!1;p!==null;){if(!b){if((p.flags&524288)!==0)b=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var k=p.alternate;if(k===null)throw Error(l(387));if(k=k.memoizedProps,k!==null){var R=p.type;Bn(p.pendingProps.value,k.value)||(t!==null?t.push(R):t=[R])}}else if(p===Se.current){if(k=p.alternate,k===null)throw Error(l(387));k.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(t!==null?t.push(cs):t=[cs])}p=p.return}t!==null&&cm(a,t,i,d),a.flags|=262144}function Yc(t){for(t=t.firstContext;t!==null;){if(!Bn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function _l(t){vl=t,Ja=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Jt(t){return B1(vl,t)}function Gc(t,a){return vl===null&&_l(t),B1(t,a)}function B1(t,a){var i=a._currentValue;if(a={context:a,memoizedValue:i,next:null},Ja===null){if(t===null)throw Error(l(308));Ja=a,t.dependencies={lanes:0,firstContext:a},t.flags|=524288}else Ja=Ja.next=a;return i}var OL=typeof AbortController<"u"?AbortController:function(){var t=[],a=this.signal={aborted:!1,addEventListener:function(i,d){t.push(d)}};this.abort=function(){a.aborted=!0,t.forEach(function(i){return i()})}},BL=e.unstable_scheduleCallback,FL=e.unstable_NormalPriority,Ut={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function um(){return{controller:new OL,data:new Map,refCount:0}}function Bo(t){t.refCount--,t.refCount===0&&BL(FL,function(){t.controller.abort()})}var Fo=null,dm=0,bi=0,xi=null;function IL(t,a){if(Fo===null){var i=Fo=[];dm=0,bi=mp(),xi={status:"pending",value:void 0,then:function(d){i.push(d)}}}return dm++,a.then(F1,F1),a}function F1(){if(--dm===0&&Fo!==null){xi!==null&&(xi.status="fulfilled");var t=Fo;Fo=null,bi=0,xi=null;for(var a=0;a<t.length;a++)(0,t[a])()}}function UL(t,a){var i=[],d={status:"pending",value:null,reason:null,then:function(p){i.push(p)}};return t.then(function(){d.status="fulfilled",d.value=a;for(var p=0;p<i.length;p++)(0,i[p])(a)},function(p){for(d.status="rejected",d.reason=p,p=0;p<i.length;p++)(0,i[p])(void 0)}),d}var I1=V.S;V.S=function(t,a){ww=tt(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&IL(t,a),I1!==null&&I1(t,a)};var wl=H(null);function fm(){var t=wl.current;return t!==null?t:mt.pooledCache}function Kc(t,a){a===null?z(wl,wl.current):z(wl,a.pool)}function U1(){var t=fm();return t===null?null:{parent:Ut._currentValue,pool:t}}var vi=Error(l(460)),hm=Error(l(474)),Vc=Error(l(542)),Qc={then:function(){}};function H1(t){return t=t.status,t==="fulfilled"||t==="rejected"}function q1(t,a,i){switch(i=t[i],i===void 0?t.push(a):i!==a&&(a.then(Va,Va),a=i),a.status){case"fulfilled":return a.value;case"rejected":throw t=a.reason,$1(t),t;default:if(typeof a.status=="string")a.then(Va,Va);else{if(t=mt,t!==null&&100<t.shellSuspendCounter)throw Error(l(482));t=a,t.status="pending",t.then(function(d){if(a.status==="pending"){var p=a;p.status="fulfilled",p.value=d}},function(d){if(a.status==="pending"){var p=a;p.status="rejected",p.reason=d}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw t=a.reason,$1(t),t}throw Sl=a,vi}}function kl(t){try{var a=t._init;return a(t._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Sl=i,vi):i}}var Sl=null;function P1(){if(Sl===null)throw Error(l(459));var t=Sl;return Sl=null,t}function $1(t){if(t===vi||t===Vc)throw Error(l(483))}var _i=null,Io=0;function Wc(t){var a=Io;return Io+=1,_i===null&&(_i=[]),q1(_i,t,a)}function Uo(t,a){a=a.props.ref,t.ref=a!==void 0?a:null}function Xc(t,a){throw a.$$typeof===_?Error(l(525)):(t=Object.prototype.toString.call(a),Error(l(31,t==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":t)))}function Y1(t){function a(Q,Y){if(t){var W=Q.deletions;W===null?(Q.deletions=[Y],Q.flags|=16):W.push(Y)}}function i(Q,Y){if(!t)return null;for(;Y!==null;)a(Q,Y),Y=Y.sibling;return null}function d(Q){for(var Y=new Map;Q!==null;)Q.key!==null?Y.set(Q.key,Q):Y.set(Q.index,Q),Q=Q.sibling;return Y}function p(Q,Y){return Q=Wa(Q,Y),Q.index=0,Q.sibling=null,Q}function b(Q,Y,W){return Q.index=W,t?(W=Q.alternate,W!==null?(W=W.index,W<Y?(Q.flags|=67108866,Y):W):(Q.flags|=67108866,Y)):(Q.flags|=1048576,Y)}function k(Q){return t&&Q.alternate===null&&(Q.flags|=67108866),Q}function R(Q,Y,W,ie){return Y===null||Y.tag!==6?(Y=tm(W,Q.mode,ie),Y.return=Q,Y):(Y=p(Y,W),Y.return=Q,Y)}function P(Q,Y,W,ie){var Ee=W.type;return Ee===j?ae(Q,Y,W.props.children,ie,W.key):Y!==null&&(Y.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===U&&kl(Ee)===Y.type)?(Y=p(Y,W.props),Uo(Y,W),Y.return=Q,Y):(Y=Pc(W.type,W.key,W.props,null,Q.mode,ie),Uo(Y,W),Y.return=Q,Y)}function X(Q,Y,W,ie){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==W.containerInfo||Y.stateNode.implementation!==W.implementation?(Y=nm(W,Q.mode,ie),Y.return=Q,Y):(Y=p(Y,W.children||[]),Y.return=Q,Y)}function ae(Q,Y,W,ie,Ee){return Y===null||Y.tag!==7?(Y=bl(W,Q.mode,ie,Ee),Y.return=Q,Y):(Y=p(Y,W),Y.return=Q,Y)}function se(Q,Y,W){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Y=tm(""+Y,Q.mode,W),Y.return=Q,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case v:return W=Pc(Y.type,Y.key,Y.props,null,Q.mode,W),Uo(W,Y),W.return=Q,W;case w:return Y=nm(Y,Q.mode,W),Y.return=Q,Y;case U:return Y=kl(Y),se(Q,Y,W)}if(ne(Y)||q(Y))return Y=bl(Y,Q.mode,W,null),Y.return=Q,Y;if(typeof Y.then=="function")return se(Q,Wc(Y),W);if(Y.$$typeof===N)return se(Q,Gc(Q,Y),W);Xc(Q,Y)}return null}function J(Q,Y,W,ie){var Ee=Y!==null?Y.key:null;if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return Ee!==null?null:R(Q,Y,""+W,ie);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case v:return W.key===Ee?P(Q,Y,W,ie):null;case w:return W.key===Ee?X(Q,Y,W,ie):null;case U:return W=kl(W),J(Q,Y,W,ie)}if(ne(W)||q(W))return Ee!==null?null:ae(Q,Y,W,ie,null);if(typeof W.then=="function")return J(Q,Y,Wc(W),ie);if(W.$$typeof===N)return J(Q,Y,Gc(Q,W),ie);Xc(Q,W)}return null}function ee(Q,Y,W,ie,Ee){if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return Q=Q.get(W)||null,R(Y,Q,""+ie,Ee);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case v:return Q=Q.get(ie.key===null?W:ie.key)||null,P(Y,Q,ie,Ee);case w:return Q=Q.get(ie.key===null?W:ie.key)||null,X(Y,Q,ie,Ee);case U:return ie=kl(ie),ee(Q,Y,W,ie,Ee)}if(ne(ie)||q(ie))return Q=Q.get(W)||null,ae(Y,Q,ie,Ee,null);if(typeof ie.then=="function")return ee(Q,Y,W,Wc(ie),Ee);if(ie.$$typeof===N)return ee(Q,Y,W,Gc(Y,ie),Ee);Xc(Y,ie)}return null}function we(Q,Y,W,ie){for(var Ee=null,nt=null,Ce=Y,Be=Y=0,Ke=null;Ce!==null&&Be<W.length;Be++){Ce.index>Be?(Ke=Ce,Ce=null):Ke=Ce.sibling;var at=J(Q,Ce,W[Be],ie);if(at===null){Ce===null&&(Ce=Ke);break}t&&Ce&&at.alternate===null&&a(Q,Ce),Y=b(at,Y,Be),nt===null?Ee=at:nt.sibling=at,nt=at,Ce=Ke}if(Be===W.length)return i(Q,Ce),Xe&&Xa(Q,Be),Ee;if(Ce===null){for(;Be<W.length;Be++)Ce=se(Q,W[Be],ie),Ce!==null&&(Y=b(Ce,Y,Be),nt===null?Ee=Ce:nt.sibling=Ce,nt=Ce);return Xe&&Xa(Q,Be),Ee}for(Ce=d(Ce);Be<W.length;Be++)Ke=ee(Ce,Q,Be,W[Be],ie),Ke!==null&&(t&&Ke.alternate!==null&&Ce.delete(Ke.key===null?Be:Ke.key),Y=b(Ke,Y,Be),nt===null?Ee=Ke:nt.sibling=Ke,nt=Ke);return t&&Ce.forEach(function(Vr){return a(Q,Vr)}),Xe&&Xa(Q,Be),Ee}function Ae(Q,Y,W,ie){if(W==null)throw Error(l(151));for(var Ee=null,nt=null,Ce=Y,Be=Y=0,Ke=null,at=W.next();Ce!==null&&!at.done;Be++,at=W.next()){Ce.index>Be?(Ke=Ce,Ce=null):Ke=Ce.sibling;var Vr=J(Q,Ce,at.value,ie);if(Vr===null){Ce===null&&(Ce=Ke);break}t&&Ce&&Vr.alternate===null&&a(Q,Ce),Y=b(Vr,Y,Be),nt===null?Ee=Vr:nt.sibling=Vr,nt=Vr,Ce=Ke}if(at.done)return i(Q,Ce),Xe&&Xa(Q,Be),Ee;if(Ce===null){for(;!at.done;Be++,at=W.next())at=se(Q,at.value,ie),at!==null&&(Y=b(at,Y,Be),nt===null?Ee=at:nt.sibling=at,nt=at);return Xe&&Xa(Q,Be),Ee}for(Ce=d(Ce);!at.done;Be++,at=W.next())at=ee(Ce,Q,Be,at.value,ie),at!==null&&(t&&at.alternate!==null&&Ce.delete(at.key===null?Be:at.key),Y=b(at,Y,Be),nt===null?Ee=at:nt.sibling=at,nt=at);return t&&Ce.forEach(function(Xz){return a(Q,Xz)}),Xe&&Xa(Q,Be),Ee}function dt(Q,Y,W,ie){if(typeof W=="object"&&W!==null&&W.type===j&&W.key===null&&(W=W.props.children),typeof W=="object"&&W!==null){switch(W.$$typeof){case v:e:{for(var Ee=W.key;Y!==null;){if(Y.key===Ee){if(Ee=W.type,Ee===j){if(Y.tag===7){i(Q,Y.sibling),ie=p(Y,W.props.children),ie.return=Q,Q=ie;break e}}else if(Y.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===U&&kl(Ee)===Y.type){i(Q,Y.sibling),ie=p(Y,W.props),Uo(ie,W),ie.return=Q,Q=ie;break e}i(Q,Y);break}else a(Q,Y);Y=Y.sibling}W.type===j?(ie=bl(W.props.children,Q.mode,ie,W.key),ie.return=Q,Q=ie):(ie=Pc(W.type,W.key,W.props,null,Q.mode,ie),Uo(ie,W),ie.return=Q,Q=ie)}return k(Q);case w:e:{for(Ee=W.key;Y!==null;){if(Y.key===Ee)if(Y.tag===4&&Y.stateNode.containerInfo===W.containerInfo&&Y.stateNode.implementation===W.implementation){i(Q,Y.sibling),ie=p(Y,W.children||[]),ie.return=Q,Q=ie;break e}else{i(Q,Y);break}else a(Q,Y);Y=Y.sibling}ie=nm(W,Q.mode,ie),ie.return=Q,Q=ie}return k(Q);case U:return W=kl(W),dt(Q,Y,W,ie)}if(ne(W))return we(Q,Y,W,ie);if(q(W)){if(Ee=q(W),typeof Ee!="function")throw Error(l(150));return W=Ee.call(W),Ae(Q,Y,W,ie)}if(typeof W.then=="function")return dt(Q,Y,Wc(W),ie);if(W.$$typeof===N)return dt(Q,Y,Gc(Q,W),ie);Xc(Q,W)}return typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint"?(W=""+W,Y!==null&&Y.tag===6?(i(Q,Y.sibling),ie=p(Y,W),ie.return=Q,Q=ie):(i(Q,Y),ie=tm(W,Q.mode,ie),ie.return=Q,Q=ie),k(Q)):i(Q,Y)}return function(Q,Y,W,ie){try{Io=0;var Ee=dt(Q,Y,W,ie);return _i=null,Ee}catch(Ce){if(Ce===vi||Ce===Vc)throw Ce;var nt=Fn(29,Ce,null,Q.mode);return nt.lanes=ie,nt.return=Q,nt}finally{}}}var Cl=Y1(!0),G1=Y1(!1),Mr=!1;function mm(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function pm(t,a){t=t.updateQueue,a.updateQueue===t&&(a.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Rr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Dr(t,a,i){var d=t.updateQueue;if(d===null)return null;if(d=d.shared,(rt&2)!==0){var p=d.pending;return p===null?a.next=a:(a.next=p.next,p.next=a),d.pending=a,a=qc(t),T1(t,null,i),a}return Hc(t,d,a,i),qc(t)}function Ho(t,a,i){if(a=a.updateQueue,a!==null&&(a=a.shared,(i&4194048)!==0)){var d=a.lanes;d&=t.pendingLanes,i|=d,a.lanes=i,fe(t,i)}}function gm(t,a){var i=t.updateQueue,d=t.alternate;if(d!==null&&(d=d.updateQueue,i===d)){var p=null,b=null;if(i=i.firstBaseUpdate,i!==null){do{var k={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};b===null?p=b=k:b=b.next=k,i=i.next}while(i!==null);b===null?p=b=a:b=b.next=a}else p=b=a;i={baseState:d.baseState,firstBaseUpdate:p,lastBaseUpdate:b,shared:d.shared,callbacks:d.callbacks},t.updateQueue=i;return}t=i.lastBaseUpdate,t===null?i.firstBaseUpdate=a:t.next=a,i.lastBaseUpdate=a}var ym=!1;function qo(){if(ym){var t=xi;if(t!==null)throw t}}function Po(t,a,i,d){ym=!1;var p=t.updateQueue;Mr=!1;var b=p.firstBaseUpdate,k=p.lastBaseUpdate,R=p.shared.pending;if(R!==null){p.shared.pending=null;var P=R,X=P.next;P.next=null,k===null?b=X:k.next=X,k=P;var ae=t.alternate;ae!==null&&(ae=ae.updateQueue,R=ae.lastBaseUpdate,R!==k&&(R===null?ae.firstBaseUpdate=X:R.next=X,ae.lastBaseUpdate=P))}if(b!==null){var se=p.baseState;k=0,ae=X=P=null,R=b;do{var J=R.lane&-536870913,ee=J!==R.lane;if(ee?(Ge&J)===J:(d&J)===J){J!==0&&J===bi&&(ym=!0),ae!==null&&(ae=ae.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var we=t,Ae=R;J=a;var dt=i;switch(Ae.tag){case 1:if(we=Ae.payload,typeof we=="function"){se=we.call(dt,se,J);break e}se=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=Ae.payload,J=typeof we=="function"?we.call(dt,se,J):we,J==null)break e;se=g({},se,J);break e;case 2:Mr=!0}}J=R.callback,J!==null&&(t.flags|=64,ee&&(t.flags|=8192),ee=p.callbacks,ee===null?p.callbacks=[J]:ee.push(J))}else ee={lane:J,tag:R.tag,payload:R.payload,callback:R.callback,next:null},ae===null?(X=ae=ee,P=se):ae=ae.next=ee,k|=J;if(R=R.next,R===null){if(R=p.shared.pending,R===null)break;ee=R,R=ee.next,ee.next=null,p.lastBaseUpdate=ee,p.shared.pending=null}}while(!0);ae===null&&(P=se),p.baseState=P,p.firstBaseUpdate=X,p.lastBaseUpdate=ae,b===null&&(p.shared.lanes=0),Fr|=k,t.lanes=k,t.memoizedState=se}}function K1(t,a){if(typeof t!="function")throw Error(l(191,t));t.call(a)}function V1(t,a){var i=t.callbacks;if(i!==null)for(t.callbacks=null,t=0;t<i.length;t++)K1(i[t],a)}var wi=H(null),Jc=H(0);function Q1(t,a){t=sr,z(Jc,t),z(wi,a),sr=t|a.baseLanes}function bm(){z(Jc,sr),z(wi,wi.current)}function xm(){sr=Jc.current,Z(wi),Z(Jc)}var In=H(null),ca=null;function Lr(t){var a=t.alternate;z(Lt,Lt.current&1),z(In,t),ca===null&&(a===null||wi.current!==null||a.memoizedState!==null)&&(ca=t)}function vm(t){z(Lt,Lt.current),z(In,t),ca===null&&(ca=t)}function W1(t){t.tag===22?(z(Lt,Lt.current),z(In,t),ca===null&&(ca=t)):zr()}function zr(){z(Lt,Lt.current),z(In,In.current)}function Un(t){Z(In),ca===t&&(ca=null),Z(Lt)}var Lt=H(0);function Zc(t){for(var a=t;a!==null;){if(a.tag===13){var i=a.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||jp(i)||Ep(i)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var er=0,ze=null,ct=null,Ht=null,eu=!1,ki=!1,jl=!1,tu=0,$o=0,Si=null,HL=0;function Nt(){throw Error(l(321))}function _m(t,a){if(a===null)return!1;for(var i=0;i<a.length&&i<t.length;i++)if(!Bn(t[i],a[i]))return!1;return!0}function wm(t,a,i,d,p,b){return er=b,ze=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,V.H=t===null||t.memoizedState===null?D_:Bm,jl=!1,b=i(d,p),jl=!1,ki&&(b=J1(a,i,d,p)),X1(t),b}function X1(t){V.H=Ko;var a=ct!==null&&ct.next!==null;if(er=0,Ht=ct=ze=null,eu=!1,$o=0,Si=null,a)throw Error(l(300));t===null||qt||(t=t.dependencies,t!==null&&Yc(t)&&(qt=!0))}function J1(t,a,i,d){ze=t;var p=0;do{if(ki&&(Si=null),$o=0,ki=!1,25<=p)throw Error(l(301));if(p+=1,Ht=ct=null,t.updateQueue!=null){var b=t.updateQueue;b.lastEffect=null,b.events=null,b.stores=null,b.memoCache!=null&&(b.memoCache.index=0)}V.H=L_,b=a(i,d)}while(ki);return b}function qL(){var t=V.H,a=t.useState()[0];return a=typeof a.then=="function"?Yo(a):a,t=t.useState()[0],(ct!==null?ct.memoizedState:null)!==t&&(ze.flags|=1024),a}function km(){var t=tu!==0;return tu=0,t}function Sm(t,a,i){a.updateQueue=t.updateQueue,a.flags&=-2053,t.lanes&=~i}function Cm(t){if(eu){for(t=t.memoizedState;t!==null;){var a=t.queue;a!==null&&(a.pending=null),t=t.next}eu=!1}er=0,Ht=ct=ze=null,ki=!1,$o=tu=0,Si=null}function mn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ht===null?ze.memoizedState=Ht=t:Ht=Ht.next=t,Ht}function zt(){if(ct===null){var t=ze.alternate;t=t!==null?t.memoizedState:null}else t=ct.next;var a=Ht===null?ze.memoizedState:Ht.next;if(a!==null)Ht=a,ct=t;else{if(t===null)throw ze.alternate===null?Error(l(467)):Error(l(310));ct=t,t={memoizedState:ct.memoizedState,baseState:ct.baseState,baseQueue:ct.baseQueue,queue:ct.queue,next:null},Ht===null?ze.memoizedState=Ht=t:Ht=Ht.next=t}return Ht}function nu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Yo(t){var a=$o;return $o+=1,Si===null&&(Si=[]),t=q1(Si,t,a),a=ze,(Ht===null?a.memoizedState:Ht.next)===null&&(a=a.alternate,V.H=a===null||a.memoizedState===null?D_:Bm),t}function au(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Yo(t);if(t.$$typeof===N)return Jt(t)}throw Error(l(438,String(t)))}function jm(t){var a=null,i=ze.updateQueue;if(i!==null&&(a=i.memoCache),a==null){var d=ze.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(a={data:d.data.map(function(p){return p.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),i===null&&(i=nu(),ze.updateQueue=i),i.memoCache=a,i=a.data[a.index],i===void 0)for(i=a.data[a.index]=Array(t),d=0;d<t;d++)i[d]=L;return a.index++,i}function tr(t,a){return typeof a=="function"?a(t):a}function ru(t){var a=zt();return Em(a,ct,t)}function Em(t,a,i){var d=t.queue;if(d===null)throw Error(l(311));d.lastRenderedReducer=i;var p=t.baseQueue,b=d.pending;if(b!==null){if(p!==null){var k=p.next;p.next=b.next,b.next=k}a.baseQueue=p=b,d.pending=null}if(b=t.baseState,p===null)t.memoizedState=b;else{a=p.next;var R=k=null,P=null,X=a,ae=!1;do{var se=X.lane&-536870913;if(se!==X.lane?(Ge&se)===se:(er&se)===se){var J=X.revertLane;if(J===0)P!==null&&(P=P.next={lane:0,revertLane:0,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null}),se===bi&&(ae=!0);else if((er&J)===J){X=X.next,J===bi&&(ae=!0);continue}else se={lane:0,revertLane:X.revertLane,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},P===null?(R=P=se,k=b):P=P.next=se,ze.lanes|=J,Fr|=J;se=X.action,jl&&i(b,se),b=X.hasEagerState?X.eagerState:i(b,se)}else J={lane:se,revertLane:X.revertLane,gesture:X.gesture,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},P===null?(R=P=J,k=b):P=P.next=J,ze.lanes|=se,Fr|=se;X=X.next}while(X!==null&&X!==a);if(P===null?k=b:P.next=R,!Bn(b,t.memoizedState)&&(qt=!0,ae&&(i=xi,i!==null)))throw i;t.memoizedState=b,t.baseState=k,t.baseQueue=P,d.lastRenderedState=b}return p===null&&(d.lanes=0),[t.memoizedState,d.dispatch]}function Nm(t){var a=zt(),i=a.queue;if(i===null)throw Error(l(311));i.lastRenderedReducer=t;var d=i.dispatch,p=i.pending,b=a.memoizedState;if(p!==null){i.pending=null;var k=p=p.next;do b=t(b,k.action),k=k.next;while(k!==p);Bn(b,a.memoizedState)||(qt=!0),a.memoizedState=b,a.baseQueue===null&&(a.baseState=b),i.lastRenderedState=b}return[b,d]}function Z1(t,a,i){var d=ze,p=zt(),b=Xe;if(b){if(i===void 0)throw Error(l(407));i=i()}else i=a();var k=!Bn((ct||p).memoizedState,i);if(k&&(p.memoizedState=i,qt=!0),p=p.queue,Mm(n_.bind(null,d,p,t),[t]),p.getSnapshot!==a||k||Ht!==null&&Ht.memoizedState.tag&1){if(d.flags|=2048,Ci(9,{destroy:void 0},t_.bind(null,d,p,i,a),null),mt===null)throw Error(l(349));b||(er&127)!==0||e_(d,a,i)}return i}function e_(t,a,i){t.flags|=16384,t={getSnapshot:a,value:i},a=ze.updateQueue,a===null?(a=nu(),ze.updateQueue=a,a.stores=[t]):(i=a.stores,i===null?a.stores=[t]:i.push(t))}function t_(t,a,i,d){a.value=i,a.getSnapshot=d,a_(a)&&r_(t)}function n_(t,a,i){return i(function(){a_(a)&&r_(t)})}function a_(t){var a=t.getSnapshot;t=t.value;try{var i=a();return!Bn(t,i)}catch{return!0}}function r_(t){var a=yl(t,2);a!==null&&En(a,t,2)}function Tm(t){var a=mn();if(typeof t=="function"){var i=t;if(t=i(),jl){St(!0);try{i()}finally{St(!1)}}}return a.memoizedState=a.baseState=t,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:tr,lastRenderedState:t},a}function l_(t,a,i,d){return t.baseState=i,Em(t,ct,typeof d=="function"?d:tr)}function PL(t,a,i,d,p){if(ou(t))throw Error(l(485));if(t=a.action,t!==null){var b={payload:p,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){b.listeners.push(k)}};V.T!==null?i(!0):b.isTransition=!1,d(b),i=a.pending,i===null?(b.next=a.pending=b,i_(a,b)):(b.next=i.next,a.pending=i.next=b)}}function i_(t,a){var i=a.action,d=a.payload,p=t.state;if(a.isTransition){var b=V.T,k={};V.T=k;try{var R=i(p,d),P=V.S;P!==null&&P(k,R),o_(t,a,R)}catch(X){Am(t,a,X)}finally{b!==null&&k.types!==null&&(b.types=k.types),V.T=b}}else try{b=i(p,d),o_(t,a,b)}catch(X){Am(t,a,X)}}function o_(t,a,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(d){s_(t,a,d)},function(d){return Am(t,a,d)}):s_(t,a,i)}function s_(t,a,i){a.status="fulfilled",a.value=i,c_(a),t.state=i,a=t.pending,a!==null&&(i=a.next,i===a?t.pending=null:(i=i.next,a.next=i,i_(t,i)))}function Am(t,a,i){var d=t.pending;if(t.pending=null,d!==null){d=d.next;do a.status="rejected",a.reason=i,c_(a),a=a.next;while(a!==d)}t.action=null}function c_(t){t=t.listeners;for(var a=0;a<t.length;a++)(0,t[a])()}function u_(t,a){return a}function d_(t,a){if(Xe){var i=mt.formState;if(i!==null){e:{var d=ze;if(Xe){if(_t){t:{for(var p=_t,b=sa;p.nodeType!==8;){if(!b){p=null;break t}if(p=ua(p.nextSibling),p===null){p=null;break t}}b=p.data,p=b==="F!"||b==="F"?p:null}if(p){_t=ua(p.nextSibling),d=p.data==="F!";break e}}Tr(d)}d=!1}d&&(a=i[0])}}return i=mn(),i.memoizedState=i.baseState=a,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:u_,lastRenderedState:a},i.queue=d,i=A_.bind(null,ze,d),d.dispatch=i,d=Tm(!1),b=Om.bind(null,ze,!1,d.queue),d=mn(),p={state:a,dispatch:null,action:t,pending:null},d.queue=p,i=PL.bind(null,ze,p,b,i),p.dispatch=i,d.memoizedState=t,[a,i,!1]}function f_(t){var a=zt();return h_(a,ct,t)}function h_(t,a,i){if(a=Em(t,a,u_)[0],t=ru(tr)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var d=Yo(a)}catch(k){throw k===vi?Vc:k}else d=a;a=zt();var p=a.queue,b=p.dispatch;return i!==a.memoizedState&&(ze.flags|=2048,Ci(9,{destroy:void 0},$L.bind(null,p,i),null)),[d,b,t]}function $L(t,a){t.action=a}function m_(t){var a=zt(),i=ct;if(i!==null)return h_(a,i,t);zt(),a=a.memoizedState,i=zt();var d=i.queue.dispatch;return i.memoizedState=t,[a,d,!1]}function Ci(t,a,i,d){return t={tag:t,create:i,deps:d,inst:a,next:null},a=ze.updateQueue,a===null&&(a=nu(),ze.updateQueue=a),i=a.lastEffect,i===null?a.lastEffect=t.next=t:(d=i.next,i.next=t,t.next=d,a.lastEffect=t),t}function p_(){return zt().memoizedState}function lu(t,a,i,d){var p=mn();ze.flags|=t,p.memoizedState=Ci(1|a,{destroy:void 0},i,d===void 0?null:d)}function iu(t,a,i,d){var p=zt();d=d===void 0?null:d;var b=p.memoizedState.inst;ct!==null&&d!==null&&_m(d,ct.memoizedState.deps)?p.memoizedState=Ci(a,b,i,d):(ze.flags|=t,p.memoizedState=Ci(1|a,b,i,d))}function g_(t,a){lu(8390656,8,t,a)}function Mm(t,a){iu(2048,8,t,a)}function YL(t){ze.flags|=4;var a=ze.updateQueue;if(a===null)a=nu(),ze.updateQueue=a,a.events=[t];else{var i=a.events;i===null?a.events=[t]:i.push(t)}}function y_(t){var a=zt().memoizedState;return YL({ref:a,nextImpl:t}),function(){if((rt&2)!==0)throw Error(l(440));return a.impl.apply(void 0,arguments)}}function b_(t,a){return iu(4,2,t,a)}function x_(t,a){return iu(4,4,t,a)}function v_(t,a){if(typeof a=="function"){t=t();var i=a(t);return function(){typeof i=="function"?i():a(null)}}if(a!=null)return t=t(),a.current=t,function(){a.current=null}}function __(t,a,i){i=i!=null?i.concat([t]):null,iu(4,4,v_.bind(null,a,t),i)}function Rm(){}function w_(t,a){var i=zt();a=a===void 0?null:a;var d=i.memoizedState;return a!==null&&_m(a,d[1])?d[0]:(i.memoizedState=[t,a],t)}function k_(t,a){var i=zt();a=a===void 0?null:a;var d=i.memoizedState;if(a!==null&&_m(a,d[1]))return d[0];if(d=t(),jl){St(!0);try{t()}finally{St(!1)}}return i.memoizedState=[d,a],d}function Dm(t,a,i){return i===void 0||(er&1073741824)!==0&&(Ge&261930)===0?t.memoizedState=a:(t.memoizedState=i,t=Sw(),ze.lanes|=t,Fr|=t,i)}function S_(t,a,i,d){return Bn(i,a)?i:wi.current!==null?(t=Dm(t,i,d),Bn(t,a)||(qt=!0),t):(er&42)===0||(er&1073741824)!==0&&(Ge&261930)===0?(qt=!0,t.memoizedState=i):(t=Sw(),ze.lanes|=t,Fr|=t,a)}function C_(t,a,i,d,p){var b=le.p;le.p=b!==0&&8>b?b:8;var k=V.T,R={};V.T=R,Om(t,!1,a,i);try{var P=p(),X=V.S;if(X!==null&&X(R,P),P!==null&&typeof P=="object"&&typeof P.then=="function"){var ae=UL(P,d);Go(t,a,ae,Pn(t))}else Go(t,a,d,Pn(t))}catch(se){Go(t,a,{then:function(){},status:"rejected",reason:se},Pn())}finally{le.p=b,k!==null&&R.types!==null&&(k.types=R.types),V.T=k}}function GL(){}function Lm(t,a,i,d){if(t.tag!==5)throw Error(l(476));var p=j_(t).queue;C_(t,p,a,me,i===null?GL:function(){return E_(t),i(d)})}function j_(t){var a=t.memoizedState;if(a!==null)return a;a={memoizedState:me,baseState:me,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:tr,lastRenderedState:me},next:null};var i={};return a.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:tr,lastRenderedState:i},next:null},t.memoizedState=a,t=t.alternate,t!==null&&(t.memoizedState=a),a}function E_(t){var a=j_(t);a.next===null&&(a=t.alternate.memoizedState),Go(t,a.next.queue,{},Pn())}function zm(){return Jt(cs)}function N_(){return zt().memoizedState}function T_(){return zt().memoizedState}function KL(t){for(var a=t.return;a!==null;){switch(a.tag){case 24:case 3:var i=Pn();t=Rr(i);var d=Dr(a,t,i);d!==null&&(En(d,a,i),Ho(d,a,i)),a={cache:um()},t.payload=a;return}a=a.return}}function VL(t,a,i){var d=Pn();i={lane:d,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},ou(t)?M_(a,i):(i=Zh(t,a,i,d),i!==null&&(En(i,t,d),R_(i,a,d)))}function A_(t,a,i){var d=Pn();Go(t,a,i,d)}function Go(t,a,i,d){var p={lane:d,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(ou(t))M_(a,p);else{var b=t.alternate;if(t.lanes===0&&(b===null||b.lanes===0)&&(b=a.lastRenderedReducer,b!==null))try{var k=a.lastRenderedState,R=b(k,i);if(p.hasEagerState=!0,p.eagerState=R,Bn(R,k))return Hc(t,a,p,0),mt===null&&Uc(),!1}catch{}finally{}if(i=Zh(t,a,p,d),i!==null)return En(i,t,d),R_(i,a,d),!0}return!1}function Om(t,a,i,d){if(d={lane:2,revertLane:mp(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},ou(t)){if(a)throw Error(l(479))}else a=Zh(t,i,d,2),a!==null&&En(a,t,2)}function ou(t){var a=t.alternate;return t===ze||a!==null&&a===ze}function M_(t,a){ki=eu=!0;var i=t.pending;i===null?a.next=a:(a.next=i.next,i.next=a),t.pending=a}function R_(t,a,i){if((i&4194048)!==0){var d=a.lanes;d&=t.pendingLanes,i|=d,a.lanes=i,fe(t,i)}}var Ko={readContext:Jt,use:au,useCallback:Nt,useContext:Nt,useEffect:Nt,useImperativeHandle:Nt,useLayoutEffect:Nt,useInsertionEffect:Nt,useMemo:Nt,useReducer:Nt,useRef:Nt,useState:Nt,useDebugValue:Nt,useDeferredValue:Nt,useTransition:Nt,useSyncExternalStore:Nt,useId:Nt,useHostTransitionStatus:Nt,useFormState:Nt,useActionState:Nt,useOptimistic:Nt,useMemoCache:Nt,useCacheRefresh:Nt};Ko.useEffectEvent=Nt;var D_={readContext:Jt,use:au,useCallback:function(t,a){return mn().memoizedState=[t,a===void 0?null:a],t},useContext:Jt,useEffect:g_,useImperativeHandle:function(t,a,i){i=i!=null?i.concat([t]):null,lu(4194308,4,v_.bind(null,a,t),i)},useLayoutEffect:function(t,a){return lu(4194308,4,t,a)},useInsertionEffect:function(t,a){lu(4,2,t,a)},useMemo:function(t,a){var i=mn();a=a===void 0?null:a;var d=t();if(jl){St(!0);try{t()}finally{St(!1)}}return i.memoizedState=[d,a],d},useReducer:function(t,a,i){var d=mn();if(i!==void 0){var p=i(a);if(jl){St(!0);try{i(a)}finally{St(!1)}}}else p=a;return d.memoizedState=d.baseState=p,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:p},d.queue=t,t=t.dispatch=VL.bind(null,ze,t),[d.memoizedState,t]},useRef:function(t){var a=mn();return t={current:t},a.memoizedState=t},useState:function(t){t=Tm(t);var a=t.queue,i=A_.bind(null,ze,a);return a.dispatch=i,[t.memoizedState,i]},useDebugValue:Rm,useDeferredValue:function(t,a){var i=mn();return Dm(i,t,a)},useTransition:function(){var t=Tm(!1);return t=C_.bind(null,ze,t.queue,!0,!1),mn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,a,i){var d=ze,p=mn();if(Xe){if(i===void 0)throw Error(l(407));i=i()}else{if(i=a(),mt===null)throw Error(l(349));(Ge&127)!==0||e_(d,a,i)}p.memoizedState=i;var b={value:i,getSnapshot:a};return p.queue=b,g_(n_.bind(null,d,b,t),[t]),d.flags|=2048,Ci(9,{destroy:void 0},t_.bind(null,d,b,i,a),null),i},useId:function(){var t=mn(),a=mt.identifierPrefix;if(Xe){var i=za,d=La;i=(d&~(1<<32-Ie(d)-1)).toString(32)+i,a="_"+a+"R_"+i,i=tu++,0<i&&(a+="H"+i.toString(32)),a+="_"}else i=HL++,a="_"+a+"r_"+i.toString(32)+"_";return t.memoizedState=a},useHostTransitionStatus:zm,useFormState:d_,useActionState:d_,useOptimistic:function(t){var a=mn();a.memoizedState=a.baseState=t;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=i,a=Om.bind(null,ze,!0,i),i.dispatch=a,[t,a]},useMemoCache:jm,useCacheRefresh:function(){return mn().memoizedState=KL.bind(null,ze)},useEffectEvent:function(t){var a=mn(),i={impl:t};return a.memoizedState=i,function(){if((rt&2)!==0)throw Error(l(440));return i.impl.apply(void 0,arguments)}}},Bm={readContext:Jt,use:au,useCallback:w_,useContext:Jt,useEffect:Mm,useImperativeHandle:__,useInsertionEffect:b_,useLayoutEffect:x_,useMemo:k_,useReducer:ru,useRef:p_,useState:function(){return ru(tr)},useDebugValue:Rm,useDeferredValue:function(t,a){var i=zt();return S_(i,ct.memoizedState,t,a)},useTransition:function(){var t=ru(tr)[0],a=zt().memoizedState;return[typeof t=="boolean"?t:Yo(t),a]},useSyncExternalStore:Z1,useId:N_,useHostTransitionStatus:zm,useFormState:f_,useActionState:f_,useOptimistic:function(t,a){var i=zt();return l_(i,ct,t,a)},useMemoCache:jm,useCacheRefresh:T_};Bm.useEffectEvent=y_;var L_={readContext:Jt,use:au,useCallback:w_,useContext:Jt,useEffect:Mm,useImperativeHandle:__,useInsertionEffect:b_,useLayoutEffect:x_,useMemo:k_,useReducer:Nm,useRef:p_,useState:function(){return Nm(tr)},useDebugValue:Rm,useDeferredValue:function(t,a){var i=zt();return ct===null?Dm(i,t,a):S_(i,ct.memoizedState,t,a)},useTransition:function(){var t=Nm(tr)[0],a=zt().memoizedState;return[typeof t=="boolean"?t:Yo(t),a]},useSyncExternalStore:Z1,useId:N_,useHostTransitionStatus:zm,useFormState:m_,useActionState:m_,useOptimistic:function(t,a){var i=zt();return ct!==null?l_(i,ct,t,a):(i.baseState=t,[t,i.queue.dispatch])},useMemoCache:jm,useCacheRefresh:T_};L_.useEffectEvent=y_;function Fm(t,a,i,d){a=t.memoizedState,i=i(d,a),i=i==null?a:g({},a,i),t.memoizedState=i,t.lanes===0&&(t.updateQueue.baseState=i)}var Im={enqueueSetState:function(t,a,i){t=t._reactInternals;var d=Pn(),p=Rr(d);p.payload=a,i!=null&&(p.callback=i),a=Dr(t,p,d),a!==null&&(En(a,t,d),Ho(a,t,d))},enqueueReplaceState:function(t,a,i){t=t._reactInternals;var d=Pn(),p=Rr(d);p.tag=1,p.payload=a,i!=null&&(p.callback=i),a=Dr(t,p,d),a!==null&&(En(a,t,d),Ho(a,t,d))},enqueueForceUpdate:function(t,a){t=t._reactInternals;var i=Pn(),d=Rr(i);d.tag=2,a!=null&&(d.callback=a),a=Dr(t,d,i),a!==null&&(En(a,t,i),Ho(a,t,i))}};function z_(t,a,i,d,p,b,k){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(d,b,k):a.prototype&&a.prototype.isPureReactComponent?!Do(i,d)||!Do(p,b):!0}function O_(t,a,i,d){t=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(i,d),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(i,d),a.state!==t&&Im.enqueueReplaceState(a,a.state,null)}function El(t,a){var i=a;if("ref"in a){i={};for(var d in a)d!=="ref"&&(i[d]=a[d])}if(t=t.defaultProps){i===a&&(i=g({},i));for(var p in t)i[p]===void 0&&(i[p]=t[p])}return i}function B_(t){Ic(t)}function F_(t){console.error(t)}function I_(t){Ic(t)}function su(t,a){try{var i=t.onUncaughtError;i(a.value,{componentStack:a.stack})}catch(d){setTimeout(function(){throw d})}}function U_(t,a,i){try{var d=t.onCaughtError;d(i.value,{componentStack:i.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Um(t,a,i){return i=Rr(i),i.tag=3,i.payload={element:null},i.callback=function(){su(t,a)},i}function H_(t){return t=Rr(t),t.tag=3,t}function q_(t,a,i,d){var p=i.type.getDerivedStateFromError;if(typeof p=="function"){var b=d.value;t.payload=function(){return p(b)},t.callback=function(){U_(a,i,d)}}var k=i.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(t.callback=function(){U_(a,i,d),typeof p!="function"&&(Ir===null?Ir=new Set([this]):Ir.add(this));var R=d.stack;this.componentDidCatch(d.value,{componentStack:R!==null?R:""})})}function QL(t,a,i,d,p){if(i.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(a=i.alternate,a!==null&&yi(a,i,p,!0),i=In.current,i!==null){switch(i.tag){case 31:case 13:return ca===null?vu():i.alternate===null&&Tt===0&&(Tt=3),i.flags&=-257,i.flags|=65536,i.lanes=p,d===Qc?i.flags|=16384:(a=i.updateQueue,a===null?i.updateQueue=new Set([d]):a.add(d),dp(t,d,p)),!1;case 22:return i.flags|=65536,d===Qc?i.flags|=16384:(a=i.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([d])},i.updateQueue=a):(i=a.retryQueue,i===null?a.retryQueue=new Set([d]):i.add(d)),dp(t,d,p)),!1}throw Error(l(435,i.tag))}return dp(t,d,p),vu(),!1}if(Xe)return a=In.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=p,d!==lm&&(t=Error(l(422),{cause:d}),Oo(la(t,i)))):(d!==lm&&(a=Error(l(423),{cause:d}),Oo(la(a,i))),t=t.current.alternate,t.flags|=65536,p&=-p,t.lanes|=p,d=la(d,i),p=Um(t.stateNode,d,p),gm(t,p),Tt!==4&&(Tt=2)),!1;var b=Error(l(520),{cause:d});if(b=la(b,i),ts===null?ts=[b]:ts.push(b),Tt!==4&&(Tt=2),a===null)return!0;d=la(d,i),i=a;do{switch(i.tag){case 3:return i.flags|=65536,t=p&-p,i.lanes|=t,t=Um(i.stateNode,d,t),gm(i,t),!1;case 1:if(a=i.type,b=i.stateNode,(i.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Ir===null||!Ir.has(b))))return i.flags|=65536,p&=-p,i.lanes|=p,p=H_(p),q_(p,t,i,d),gm(i,p),!1}i=i.return}while(i!==null);return!1}var Hm=Error(l(461)),qt=!1;function Zt(t,a,i,d){a.child=t===null?G1(a,null,i,d):Cl(a,t.child,i,d)}function P_(t,a,i,d,p){i=i.render;var b=a.ref;if("ref"in d){var k={};for(var R in d)R!=="ref"&&(k[R]=d[R])}else k=d;return _l(a),d=wm(t,a,i,k,b,p),R=km(),t!==null&&!qt?(Sm(t,a,p),nr(t,a,p)):(Xe&&R&&am(a),a.flags|=1,Zt(t,a,d,p),a.child)}function $_(t,a,i,d,p){if(t===null){var b=i.type;return typeof b=="function"&&!em(b)&&b.defaultProps===void 0&&i.compare===null?(a.tag=15,a.type=b,Y_(t,a,b,d,p)):(t=Pc(i.type,null,d,a,a.mode,p),t.ref=a.ref,t.return=a,a.child=t)}if(b=t.child,!Qm(t,p)){var k=b.memoizedProps;if(i=i.compare,i=i!==null?i:Do,i(k,d)&&t.ref===a.ref)return nr(t,a,p)}return a.flags|=1,t=Wa(b,d),t.ref=a.ref,t.return=a,a.child=t}function Y_(t,a,i,d,p){if(t!==null){var b=t.memoizedProps;if(Do(b,d)&&t.ref===a.ref)if(qt=!1,a.pendingProps=d=b,Qm(t,p))(t.flags&131072)!==0&&(qt=!0);else return a.lanes=t.lanes,nr(t,a,p)}return qm(t,a,i,d,p)}function G_(t,a,i,d){var p=d.children,b=t!==null?t.memoizedState:null;if(t===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((a.flags&128)!==0){if(b=b!==null?b.baseLanes|i:i,t!==null){for(d=a.child=t.child,p=0;d!==null;)p=p|d.lanes|d.childLanes,d=d.sibling;d=p&~b}else d=0,a.child=null;return K_(t,a,b,i,d)}if((i&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},t!==null&&Kc(a,b!==null?b.cachePool:null),b!==null?Q1(a,b):bm(),W1(a);else return d=a.lanes=536870912,K_(t,a,b!==null?b.baseLanes|i:i,i,d)}else b!==null?(Kc(a,b.cachePool),Q1(a,b),zr(),a.memoizedState=null):(t!==null&&Kc(a,null),bm(),zr());return Zt(t,a,p,i),a.child}function Vo(t,a){return t!==null&&t.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function K_(t,a,i,d,p){var b=fm();return b=b===null?null:{parent:Ut._currentValue,pool:b},a.memoizedState={baseLanes:i,cachePool:b},t!==null&&Kc(a,null),bm(),W1(a),t!==null&&yi(t,a,d,!0),a.childLanes=p,null}function cu(t,a){return a=du({mode:a.mode,children:a.children},t.mode),a.ref=t.ref,t.child=a,a.return=t,a}function V_(t,a,i){return Cl(a,t.child,null,i),t=cu(a,a.pendingProps),t.flags|=2,Un(a),a.memoizedState=null,t}function WL(t,a,i){var d=a.pendingProps,p=(a.flags&128)!==0;if(a.flags&=-129,t===null){if(Xe){if(d.mode==="hidden")return t=cu(a,d),a.lanes=536870912,Vo(null,t);if(vm(a),(t=_t)?(t=i2(t,sa),t=t!==null&&t.data==="&"?t:null,t!==null&&(a.memoizedState={dehydrated:t,treeContext:Er!==null?{id:La,overflow:za}:null,retryLane:536870912,hydrationErrors:null},i=M1(t),i.return=a,a.child=i,Xt=a,_t=null)):t=null,t===null)throw Tr(a);return a.lanes=536870912,null}return cu(a,d)}var b=t.memoizedState;if(b!==null){var k=b.dehydrated;if(vm(a),p)if(a.flags&256)a.flags&=-257,a=V_(t,a,i);else if(a.memoizedState!==null)a.child=t.child,a.flags|=128,a=null;else throw Error(l(558));else if(qt||yi(t,a,i,!1),p=(i&t.childLanes)!==0,qt||p){if(d=mt,d!==null&&(k=Le(d,i),k!==0&&k!==b.retryLane))throw b.retryLane=k,yl(t,k),En(d,t,k),Hm;vu(),a=V_(t,a,i)}else t=b.treeContext,_t=ua(k.nextSibling),Xt=a,Xe=!0,Nr=null,sa=!1,t!==null&&L1(a,t),a=cu(a,d),a.flags|=4096;return a}return t=Wa(t.child,{mode:d.mode,children:d.children}),t.ref=a.ref,a.child=t,t.return=a,t}function uu(t,a){var i=a.ref;if(i===null)t!==null&&t.ref!==null&&(a.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(l(284));(t===null||t.ref!==i)&&(a.flags|=4194816)}}function qm(t,a,i,d,p){return _l(a),i=wm(t,a,i,d,void 0,p),d=km(),t!==null&&!qt?(Sm(t,a,p),nr(t,a,p)):(Xe&&d&&am(a),a.flags|=1,Zt(t,a,i,p),a.child)}function Q_(t,a,i,d,p,b){return _l(a),a.updateQueue=null,i=J1(a,d,i,p),X1(t),d=km(),t!==null&&!qt?(Sm(t,a,b),nr(t,a,b)):(Xe&&d&&am(a),a.flags|=1,Zt(t,a,i,b),a.child)}function W_(t,a,i,d,p){if(_l(a),a.stateNode===null){var b=hi,k=i.contextType;typeof k=="object"&&k!==null&&(b=Jt(k)),b=new i(d,b),a.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=Im,a.stateNode=b,b._reactInternals=a,b=a.stateNode,b.props=d,b.state=a.memoizedState,b.refs={},mm(a),k=i.contextType,b.context=typeof k=="object"&&k!==null?Jt(k):hi,b.state=a.memoizedState,k=i.getDerivedStateFromProps,typeof k=="function"&&(Fm(a,i,k,d),b.state=a.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(k=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),k!==b.state&&Im.enqueueReplaceState(b,b.state,null),Po(a,d,b,p),qo(),b.state=a.memoizedState),typeof b.componentDidMount=="function"&&(a.flags|=4194308),d=!0}else if(t===null){b=a.stateNode;var R=a.memoizedProps,P=El(i,R);b.props=P;var X=b.context,ae=i.contextType;k=hi,typeof ae=="object"&&ae!==null&&(k=Jt(ae));var se=i.getDerivedStateFromProps;ae=typeof se=="function"||typeof b.getSnapshotBeforeUpdate=="function",R=a.pendingProps!==R,ae||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(R||X!==k)&&O_(a,b,d,k),Mr=!1;var J=a.memoizedState;b.state=J,Po(a,d,b,p),qo(),X=a.memoizedState,R||J!==X||Mr?(typeof se=="function"&&(Fm(a,i,se,d),X=a.memoizedState),(P=Mr||z_(a,i,P,d,J,X,k))?(ae||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(a.flags|=4194308)):(typeof b.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=d,a.memoizedState=X),b.props=d,b.state=X,b.context=k,d=P):(typeof b.componentDidMount=="function"&&(a.flags|=4194308),d=!1)}else{b=a.stateNode,pm(t,a),k=a.memoizedProps,ae=El(i,k),b.props=ae,se=a.pendingProps,J=b.context,X=i.contextType,P=hi,typeof X=="object"&&X!==null&&(P=Jt(X)),R=i.getDerivedStateFromProps,(X=typeof R=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(k!==se||J!==P)&&O_(a,b,d,P),Mr=!1,J=a.memoizedState,b.state=J,Po(a,d,b,p),qo();var ee=a.memoizedState;k!==se||J!==ee||Mr||t!==null&&t.dependencies!==null&&Yc(t.dependencies)?(typeof R=="function"&&(Fm(a,i,R,d),ee=a.memoizedState),(ae=Mr||z_(a,i,ae,d,J,ee,P)||t!==null&&t.dependencies!==null&&Yc(t.dependencies))?(X||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(d,ee,P),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(d,ee,P)),typeof b.componentDidUpdate=="function"&&(a.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof b.componentDidUpdate!="function"||k===t.memoizedProps&&J===t.memoizedState||(a.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||k===t.memoizedProps&&J===t.memoizedState||(a.flags|=1024),a.memoizedProps=d,a.memoizedState=ee),b.props=d,b.state=ee,b.context=P,d=ae):(typeof b.componentDidUpdate!="function"||k===t.memoizedProps&&J===t.memoizedState||(a.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||k===t.memoizedProps&&J===t.memoizedState||(a.flags|=1024),d=!1)}return b=d,uu(t,a),d=(a.flags&128)!==0,b||d?(b=a.stateNode,i=d&&typeof i.getDerivedStateFromError!="function"?null:b.render(),a.flags|=1,t!==null&&d?(a.child=Cl(a,t.child,null,p),a.child=Cl(a,null,i,p)):Zt(t,a,i,p),a.memoizedState=b.state,t=a.child):t=nr(t,a,p),t}function X_(t,a,i,d){return xl(),a.flags|=256,Zt(t,a,i,d),a.child}var Pm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function $m(t){return{baseLanes:t,cachePool:U1()}}function Ym(t,a,i){return t=t!==null?t.childLanes&~i:0,a&&(t|=qn),t}function J_(t,a,i){var d=a.pendingProps,p=!1,b=(a.flags&128)!==0,k;if((k=b)||(k=t!==null&&t.memoizedState===null?!1:(Lt.current&2)!==0),k&&(p=!0,a.flags&=-129),k=(a.flags&32)!==0,a.flags&=-33,t===null){if(Xe){if(p?Lr(a):zr(),(t=_t)?(t=i2(t,sa),t=t!==null&&t.data!=="&"?t:null,t!==null&&(a.memoizedState={dehydrated:t,treeContext:Er!==null?{id:La,overflow:za}:null,retryLane:536870912,hydrationErrors:null},i=M1(t),i.return=a,a.child=i,Xt=a,_t=null)):t=null,t===null)throw Tr(a);return Ep(t)?a.lanes=32:a.lanes=536870912,null}var R=d.children;return d=d.fallback,p?(zr(),p=a.mode,R=du({mode:"hidden",children:R},p),d=bl(d,p,i,null),R.return=a,d.return=a,R.sibling=d,a.child=R,d=a.child,d.memoizedState=$m(i),d.childLanes=Ym(t,k,i),a.memoizedState=Pm,Vo(null,d)):(Lr(a),Gm(a,R))}var P=t.memoizedState;if(P!==null&&(R=P.dehydrated,R!==null)){if(b)a.flags&256?(Lr(a),a.flags&=-257,a=Km(t,a,i)):a.memoizedState!==null?(zr(),a.child=t.child,a.flags|=128,a=null):(zr(),R=d.fallback,p=a.mode,d=du({mode:"visible",children:d.children},p),R=bl(R,p,i,null),R.flags|=2,d.return=a,R.return=a,d.sibling=R,a.child=d,Cl(a,t.child,null,i),d=a.child,d.memoizedState=$m(i),d.childLanes=Ym(t,k,i),a.memoizedState=Pm,a=Vo(null,d));else if(Lr(a),Ep(R)){if(k=R.nextSibling&&R.nextSibling.dataset,k)var X=k.dgst;k=X,d=Error(l(419)),d.stack="",d.digest=k,Oo({value:d,source:null,stack:null}),a=Km(t,a,i)}else if(qt||yi(t,a,i,!1),k=(i&t.childLanes)!==0,qt||k){if(k=mt,k!==null&&(d=Le(k,i),d!==0&&d!==P.retryLane))throw P.retryLane=d,yl(t,d),En(k,t,d),Hm;jp(R)||vu(),a=Km(t,a,i)}else jp(R)?(a.flags|=192,a.child=t.child,a=null):(t=P.treeContext,_t=ua(R.nextSibling),Xt=a,Xe=!0,Nr=null,sa=!1,t!==null&&L1(a,t),a=Gm(a,d.children),a.flags|=4096);return a}return p?(zr(),R=d.fallback,p=a.mode,P=t.child,X=P.sibling,d=Wa(P,{mode:"hidden",children:d.children}),d.subtreeFlags=P.subtreeFlags&65011712,X!==null?R=Wa(X,R):(R=bl(R,p,i,null),R.flags|=2),R.return=a,d.return=a,d.sibling=R,a.child=d,Vo(null,d),d=a.child,R=t.child.memoizedState,R===null?R=$m(i):(p=R.cachePool,p!==null?(P=Ut._currentValue,p=p.parent!==P?{parent:P,pool:P}:p):p=U1(),R={baseLanes:R.baseLanes|i,cachePool:p}),d.memoizedState=R,d.childLanes=Ym(t,k,i),a.memoizedState=Pm,Vo(t.child,d)):(Lr(a),i=t.child,t=i.sibling,i=Wa(i,{mode:"visible",children:d.children}),i.return=a,i.sibling=null,t!==null&&(k=a.deletions,k===null?(a.deletions=[t],a.flags|=16):k.push(t)),a.child=i,a.memoizedState=null,i)}function Gm(t,a){return a=du({mode:"visible",children:a},t.mode),a.return=t,t.child=a}function du(t,a){return t=Fn(22,t,null,a),t.lanes=0,t}function Km(t,a,i){return Cl(a,t.child,null,i),t=Gm(a,a.pendingProps.children),t.flags|=2,a.memoizedState=null,t}function Z_(t,a,i){t.lanes|=a;var d=t.alternate;d!==null&&(d.lanes|=a),sm(t.return,a,i)}function Vm(t,a,i,d,p,b){var k=t.memoizedState;k===null?t.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:d,tail:i,tailMode:p,treeForkCount:b}:(k.isBackwards=a,k.rendering=null,k.renderingStartTime=0,k.last=d,k.tail=i,k.tailMode=p,k.treeForkCount=b)}function ew(t,a,i){var d=a.pendingProps,p=d.revealOrder,b=d.tail;d=d.children;var k=Lt.current,R=(k&2)!==0;if(R?(k=k&1|2,a.flags|=128):k&=1,z(Lt,k),Zt(t,a,d,i),d=Xe?zo:0,!R&&t!==null&&(t.flags&128)!==0)e:for(t=a.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Z_(t,i,a);else if(t.tag===19)Z_(t,i,a);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===a)break e;for(;t.sibling===null;){if(t.return===null||t.return===a)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(p){case"forwards":for(i=a.child,p=null;i!==null;)t=i.alternate,t!==null&&Zc(t)===null&&(p=i),i=i.sibling;i=p,i===null?(p=a.child,a.child=null):(p=i.sibling,i.sibling=null),Vm(a,!1,p,i,b,d);break;case"backwards":case"unstable_legacy-backwards":for(i=null,p=a.child,a.child=null;p!==null;){if(t=p.alternate,t!==null&&Zc(t)===null){a.child=p;break}t=p.sibling,p.sibling=i,i=p,p=t}Vm(a,!0,i,null,b,d);break;case"together":Vm(a,!1,null,null,void 0,d);break;default:a.memoizedState=null}return a.child}function nr(t,a,i){if(t!==null&&(a.dependencies=t.dependencies),Fr|=a.lanes,(i&a.childLanes)===0)if(t!==null){if(yi(t,a,i,!1),(i&a.childLanes)===0)return null}else return null;if(t!==null&&a.child!==t.child)throw Error(l(153));if(a.child!==null){for(t=a.child,i=Wa(t,t.pendingProps),a.child=i,i.return=a;t.sibling!==null;)t=t.sibling,i=i.sibling=Wa(t,t.pendingProps),i.return=a;i.sibling=null}return a.child}function Qm(t,a){return(t.lanes&a)!==0?!0:(t=t.dependencies,!!(t!==null&&Yc(t)))}function XL(t,a,i){switch(a.tag){case 3:Te(a,a.stateNode.containerInfo),Ar(a,Ut,t.memoizedState.cache),xl();break;case 27:case 5:ke(a);break;case 4:Te(a,a.stateNode.containerInfo);break;case 10:Ar(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,vm(a),null;break;case 13:var d=a.memoizedState;if(d!==null)return d.dehydrated!==null?(Lr(a),a.flags|=128,null):(i&a.child.childLanes)!==0?J_(t,a,i):(Lr(a),t=nr(t,a,i),t!==null?t.sibling:null);Lr(a);break;case 19:var p=(t.flags&128)!==0;if(d=(i&a.childLanes)!==0,d||(yi(t,a,i,!1),d=(i&a.childLanes)!==0),p){if(d)return ew(t,a,i);a.flags|=128}if(p=a.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),z(Lt,Lt.current),d)break;return null;case 22:return a.lanes=0,G_(t,a,i,a.pendingProps);case 24:Ar(a,Ut,t.memoizedState.cache)}return nr(t,a,i)}function tw(t,a,i){if(t!==null)if(t.memoizedProps!==a.pendingProps)qt=!0;else{if(!Qm(t,i)&&(a.flags&128)===0)return qt=!1,XL(t,a,i);qt=(t.flags&131072)!==0}else qt=!1,Xe&&(a.flags&1048576)!==0&&D1(a,zo,a.index);switch(a.lanes=0,a.tag){case 16:e:{var d=a.pendingProps;if(t=kl(a.elementType),a.type=t,typeof t=="function")em(t)?(d=El(t,d),a.tag=1,a=W_(null,a,t,d,i)):(a.tag=0,a=qm(null,a,t,d,i));else{if(t!=null){var p=t.$$typeof;if(p===D){a.tag=11,a=P_(null,a,t,d,i);break e}else if(p===A){a.tag=14,a=$_(null,a,t,d,i);break e}}throw a=G(t)||t,Error(l(306,a,""))}}return a;case 0:return qm(t,a,a.type,a.pendingProps,i);case 1:return d=a.type,p=El(d,a.pendingProps),W_(t,a,d,p,i);case 3:e:{if(Te(a,a.stateNode.containerInfo),t===null)throw Error(l(387));d=a.pendingProps;var b=a.memoizedState;p=b.element,pm(t,a),Po(a,d,null,i);var k=a.memoizedState;if(d=k.cache,Ar(a,Ut,d),d!==b.cache&&cm(a,[Ut],i,!0),qo(),d=k.element,b.isDehydrated)if(b={element:d,isDehydrated:!1,cache:k.cache},a.updateQueue.baseState=b,a.memoizedState=b,a.flags&256){a=X_(t,a,d,i);break e}else if(d!==p){p=la(Error(l(424)),a),Oo(p),a=X_(t,a,d,i);break e}else{switch(t=a.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(_t=ua(t.firstChild),Xt=a,Xe=!0,Nr=null,sa=!0,i=G1(a,null,d,i),a.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(xl(),d===p){a=nr(t,a,i);break e}Zt(t,a,d,i)}a=a.child}return a;case 26:return uu(t,a),t===null?(i=f2(a.type,null,a.pendingProps,null))?a.memoizedState=i:Xe||(i=a.type,t=a.pendingProps,d=Eu(ve.current).createElement(i),d[Bt]=a,d[Wt]=t,en(d,i,t),Ct(d),a.stateNode=d):a.memoizedState=f2(a.type,t.memoizedProps,a.pendingProps,t.memoizedState),null;case 27:return ke(a),t===null&&Xe&&(d=a.stateNode=c2(a.type,a.pendingProps,ve.current),Xt=a,sa=!0,p=_t,Pr(a.type)?(Np=p,_t=ua(d.firstChild)):_t=p),Zt(t,a,a.pendingProps.children,i),uu(t,a),t===null&&(a.flags|=4194304),a.child;case 5:return t===null&&Xe&&((p=d=_t)&&(d=Ez(d,a.type,a.pendingProps,sa),d!==null?(a.stateNode=d,Xt=a,_t=ua(d.firstChild),sa=!1,p=!0):p=!1),p||Tr(a)),ke(a),p=a.type,b=a.pendingProps,k=t!==null?t.memoizedProps:null,d=b.children,kp(p,b)?d=null:k!==null&&kp(p,k)&&(a.flags|=32),a.memoizedState!==null&&(p=wm(t,a,qL,null,null,i),cs._currentValue=p),uu(t,a),Zt(t,a,d,i),a.child;case 6:return t===null&&Xe&&((t=i=_t)&&(i=Nz(i,a.pendingProps,sa),i!==null?(a.stateNode=i,Xt=a,_t=null,t=!0):t=!1),t||Tr(a)),null;case 13:return J_(t,a,i);case 4:return Te(a,a.stateNode.containerInfo),d=a.pendingProps,t===null?a.child=Cl(a,null,d,i):Zt(t,a,d,i),a.child;case 11:return P_(t,a,a.type,a.pendingProps,i);case 7:return Zt(t,a,a.pendingProps,i),a.child;case 8:return Zt(t,a,a.pendingProps.children,i),a.child;case 12:return Zt(t,a,a.pendingProps.children,i),a.child;case 10:return d=a.pendingProps,Ar(a,a.type,d.value),Zt(t,a,d.children,i),a.child;case 9:return p=a.type._context,d=a.pendingProps.children,_l(a),p=Jt(p),d=d(p),a.flags|=1,Zt(t,a,d,i),a.child;case 14:return $_(t,a,a.type,a.pendingProps,i);case 15:return Y_(t,a,a.type,a.pendingProps,i);case 19:return ew(t,a,i);case 31:return WL(t,a,i);case 22:return G_(t,a,i,a.pendingProps);case 24:return _l(a),d=Jt(Ut),t===null?(p=fm(),p===null&&(p=mt,b=um(),p.pooledCache=b,b.refCount++,b!==null&&(p.pooledCacheLanes|=i),p=b),a.memoizedState={parent:d,cache:p},mm(a),Ar(a,Ut,p)):((t.lanes&i)!==0&&(pm(t,a),Po(a,null,null,i),qo()),p=t.memoizedState,b=a.memoizedState,p.parent!==d?(p={parent:d,cache:d},a.memoizedState=p,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=p),Ar(a,Ut,d)):(d=b.cache,Ar(a,Ut,d),d!==p.cache&&cm(a,[Ut],i,!0))),Zt(t,a,a.pendingProps.children,i),a.child;case 29:throw a.pendingProps}throw Error(l(156,a.tag))}function ar(t){t.flags|=4}function Wm(t,a,i,d,p){if((a=(t.mode&32)!==0)&&(a=!1),a){if(t.flags|=16777216,(p&335544128)===p)if(t.stateNode.complete)t.flags|=8192;else if(Nw())t.flags|=8192;else throw Sl=Qc,hm}else t.flags&=-16777217}function nw(t,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!y2(a))if(Nw())t.flags|=8192;else throw Sl=Qc,hm}function fu(t,a){a!==null&&(t.flags|=4),t.flags&16384&&(a=t.tag!==22?Sr():536870912,t.lanes|=a,Ti|=a)}function Qo(t,a){if(!Xe)switch(t.tailMode){case"hidden":a=t.tail;for(var i=null;a!==null;)a.alternate!==null&&(i=a),a=a.sibling;i===null?t.tail=null:i.sibling=null;break;case"collapsed":i=t.tail;for(var d=null;i!==null;)i.alternate!==null&&(d=i),i=i.sibling;d===null?a||t.tail===null?t.tail=null:t.tail.sibling=null:d.sibling=null}}function wt(t){var a=t.alternate!==null&&t.alternate.child===t.child,i=0,d=0;if(a)for(var p=t.child;p!==null;)i|=p.lanes|p.childLanes,d|=p.subtreeFlags&65011712,d|=p.flags&65011712,p.return=t,p=p.sibling;else for(p=t.child;p!==null;)i|=p.lanes|p.childLanes,d|=p.subtreeFlags,d|=p.flags,p.return=t,p=p.sibling;return t.subtreeFlags|=d,t.childLanes=i,a}function JL(t,a,i){var d=a.pendingProps;switch(rm(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wt(a),null;case 1:return wt(a),null;case 3:return i=a.stateNode,d=null,t!==null&&(d=t.memoizedState.cache),a.memoizedState.cache!==d&&(a.flags|=2048),Za(Ut),re(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(t===null||t.child===null)&&(gi(a)?ar(a):t===null||t.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,im())),wt(a),null;case 26:var p=a.type,b=a.memoizedState;return t===null?(ar(a),b!==null?(wt(a),nw(a,b)):(wt(a),Wm(a,p,null,d,i))):b?b!==t.memoizedState?(ar(a),wt(a),nw(a,b)):(wt(a),a.flags&=-16777217):(t=t.memoizedProps,t!==d&&ar(a),wt(a),Wm(a,p,t,d,i)),null;case 27:if(Ze(a),i=ve.current,p=a.type,t!==null&&a.stateNode!=null)t.memoizedProps!==d&&ar(a);else{if(!d){if(a.stateNode===null)throw Error(l(166));return wt(a),null}t=oe.current,gi(a)?z1(a):(t=c2(p,d,i),a.stateNode=t,ar(a))}return wt(a),null;case 5:if(Ze(a),p=a.type,t!==null&&a.stateNode!=null)t.memoizedProps!==d&&ar(a);else{if(!d){if(a.stateNode===null)throw Error(l(166));return wt(a),null}if(b=oe.current,gi(a))z1(a);else{var k=Eu(ve.current);switch(b){case 1:b=k.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:b=k.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":b=k.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":b=k.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":b=k.createElement("div"),b.innerHTML="<script><\/script>",b=b.removeChild(b.firstChild);break;case"select":b=typeof d.is=="string"?k.createElement("select",{is:d.is}):k.createElement("select"),d.multiple?b.multiple=!0:d.size&&(b.size=d.size);break;default:b=typeof d.is=="string"?k.createElement(p,{is:d.is}):k.createElement(p)}}b[Bt]=a,b[Wt]=d;e:for(k=a.child;k!==null;){if(k.tag===5||k.tag===6)b.appendChild(k.stateNode);else if(k.tag!==4&&k.tag!==27&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===a)break e;for(;k.sibling===null;){if(k.return===null||k.return===a)break e;k=k.return}k.sibling.return=k.return,k=k.sibling}a.stateNode=b;e:switch(en(b,p,d),p){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&ar(a)}}return wt(a),Wm(a,a.type,t===null?null:t.memoizedProps,a.pendingProps,i),null;case 6:if(t&&a.stateNode!=null)t.memoizedProps!==d&&ar(a);else{if(typeof d!="string"&&a.stateNode===null)throw Error(l(166));if(t=ve.current,gi(a)){if(t=a.stateNode,i=a.memoizedProps,d=null,p=Xt,p!==null)switch(p.tag){case 27:case 5:d=p.memoizedProps}t[Bt]=a,t=!!(t.nodeValue===i||d!==null&&d.suppressHydrationWarning===!0||Jw(t.nodeValue,i)),t||Tr(a,!0)}else t=Eu(t).createTextNode(d),t[Bt]=a,a.stateNode=t}return wt(a),null;case 31:if(i=a.memoizedState,t===null||t.memoizedState!==null){if(d=gi(a),i!==null){if(t===null){if(!d)throw Error(l(318));if(t=a.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(557));t[Bt]=a}else xl(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;wt(a),t=!1}else i=im(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=i),t=!0;if(!t)return a.flags&256?(Un(a),a):(Un(a),null);if((a.flags&128)!==0)throw Error(l(558))}return wt(a),null;case 13:if(d=a.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(p=gi(a),d!==null&&d.dehydrated!==null){if(t===null){if(!p)throw Error(l(318));if(p=a.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(l(317));p[Bt]=a}else xl(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;wt(a),p=!1}else p=im(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=p),p=!0;if(!p)return a.flags&256?(Un(a),a):(Un(a),null)}return Un(a),(a.flags&128)!==0?(a.lanes=i,a):(i=d!==null,t=t!==null&&t.memoizedState!==null,i&&(d=a.child,p=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(p=d.alternate.memoizedState.cachePool.pool),b=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(b=d.memoizedState.cachePool.pool),b!==p&&(d.flags|=2048)),i!==t&&i&&(a.child.flags|=8192),fu(a,a.updateQueue),wt(a),null);case 4:return re(),t===null&&bp(a.stateNode.containerInfo),wt(a),null;case 10:return Za(a.type),wt(a),null;case 19:if(Z(Lt),d=a.memoizedState,d===null)return wt(a),null;if(p=(a.flags&128)!==0,b=d.rendering,b===null)if(p)Qo(d,!1);else{if(Tt!==0||t!==null&&(t.flags&128)!==0)for(t=a.child;t!==null;){if(b=Zc(t),b!==null){for(a.flags|=128,Qo(d,!1),t=b.updateQueue,a.updateQueue=t,fu(a,t),a.subtreeFlags=0,t=i,i=a.child;i!==null;)A1(i,t),i=i.sibling;return z(Lt,Lt.current&1|2),Xe&&Xa(a,d.treeForkCount),a.child}t=t.sibling}d.tail!==null&&tt()>yu&&(a.flags|=128,p=!0,Qo(d,!1),a.lanes=4194304)}else{if(!p)if(t=Zc(b),t!==null){if(a.flags|=128,p=!0,t=t.updateQueue,a.updateQueue=t,fu(a,t),Qo(d,!0),d.tail===null&&d.tailMode==="hidden"&&!b.alternate&&!Xe)return wt(a),null}else 2*tt()-d.renderingStartTime>yu&&i!==536870912&&(a.flags|=128,p=!0,Qo(d,!1),a.lanes=4194304);d.isBackwards?(b.sibling=a.child,a.child=b):(t=d.last,t!==null?t.sibling=b:a.child=b,d.last=b)}return d.tail!==null?(t=d.tail,d.rendering=t,d.tail=t.sibling,d.renderingStartTime=tt(),t.sibling=null,i=Lt.current,z(Lt,p?i&1|2:i&1),Xe&&Xa(a,d.treeForkCount),t):(wt(a),null);case 22:case 23:return Un(a),xm(),d=a.memoizedState!==null,t!==null?t.memoizedState!==null!==d&&(a.flags|=8192):d&&(a.flags|=8192),d?(i&536870912)!==0&&(a.flags&128)===0&&(wt(a),a.subtreeFlags&6&&(a.flags|=8192)):wt(a),i=a.updateQueue,i!==null&&fu(a,i.retryQueue),i=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),d=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(d=a.memoizedState.cachePool.pool),d!==i&&(a.flags|=2048),t!==null&&Z(wl),null;case 24:return i=null,t!==null&&(i=t.memoizedState.cache),a.memoizedState.cache!==i&&(a.flags|=2048),Za(Ut),wt(a),null;case 25:return null;case 30:return null}throw Error(l(156,a.tag))}function ZL(t,a){switch(rm(a),a.tag){case 1:return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 3:return Za(Ut),re(),t=a.flags,(t&65536)!==0&&(t&128)===0?(a.flags=t&-65537|128,a):null;case 26:case 27:case 5:return Ze(a),null;case 31:if(a.memoizedState!==null){if(Un(a),a.alternate===null)throw Error(l(340));xl()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 13:if(Un(a),t=a.memoizedState,t!==null&&t.dehydrated!==null){if(a.alternate===null)throw Error(l(340));xl()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 19:return Z(Lt),null;case 4:return re(),null;case 10:return Za(a.type),null;case 22:case 23:return Un(a),xm(),t!==null&&Z(wl),t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 24:return Za(Ut),null;case 25:return null;default:return null}}function aw(t,a){switch(rm(a),a.tag){case 3:Za(Ut),re();break;case 26:case 27:case 5:Ze(a);break;case 4:re();break;case 31:a.memoizedState!==null&&Un(a);break;case 13:Un(a);break;case 19:Z(Lt);break;case 10:Za(a.type);break;case 22:case 23:Un(a),xm(),t!==null&&Z(wl);break;case 24:Za(Ut)}}function Wo(t,a){try{var i=a.updateQueue,d=i!==null?i.lastEffect:null;if(d!==null){var p=d.next;i=p;do{if((i.tag&t)===t){d=void 0;var b=i.create,k=i.inst;d=b(),k.destroy=d}i=i.next}while(i!==p)}}catch(R){st(a,a.return,R)}}function Or(t,a,i){try{var d=a.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var b=p.next;d=b;do{if((d.tag&t)===t){var k=d.inst,R=k.destroy;if(R!==void 0){k.destroy=void 0,p=a;var P=i,X=R;try{X()}catch(ae){st(p,P,ae)}}}d=d.next}while(d!==b)}}catch(ae){st(a,a.return,ae)}}function rw(t){var a=t.updateQueue;if(a!==null){var i=t.stateNode;try{V1(a,i)}catch(d){st(t,t.return,d)}}}function lw(t,a,i){i.props=El(t.type,t.memoizedProps),i.state=t.memoizedState;try{i.componentWillUnmount()}catch(d){st(t,a,d)}}function Xo(t,a){try{var i=t.ref;if(i!==null){switch(t.tag){case 26:case 27:case 5:var d=t.stateNode;break;case 30:d=t.stateNode;break;default:d=t.stateNode}typeof i=="function"?t.refCleanup=i(d):i.current=d}}catch(p){st(t,a,p)}}function Oa(t,a){var i=t.ref,d=t.refCleanup;if(i!==null)if(typeof d=="function")try{d()}catch(p){st(t,a,p)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(p){st(t,a,p)}else i.current=null}function iw(t){var a=t.type,i=t.memoizedProps,d=t.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":i.autoFocus&&d.focus();break e;case"img":i.src?d.src=i.src:i.srcSet&&(d.srcset=i.srcSet)}}catch(p){st(t,t.return,p)}}function Xm(t,a,i){try{var d=t.stateNode;_z(d,t.type,i,a),d[Wt]=a}catch(p){st(t,t.return,p)}}function ow(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Pr(t.type)||t.tag===4}function Jm(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||ow(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Pr(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Zm(t,a,i){var d=t.tag;if(d===5||d===6)t=t.stateNode,a?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(t,a):(a=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,a.appendChild(t),i=i._reactRootContainer,i!=null||a.onclick!==null||(a.onclick=Va));else if(d!==4&&(d===27&&Pr(t.type)&&(i=t.stateNode,a=null),t=t.child,t!==null))for(Zm(t,a,i),t=t.sibling;t!==null;)Zm(t,a,i),t=t.sibling}function hu(t,a,i){var d=t.tag;if(d===5||d===6)t=t.stateNode,a?i.insertBefore(t,a):i.appendChild(t);else if(d!==4&&(d===27&&Pr(t.type)&&(i=t.stateNode),t=t.child,t!==null))for(hu(t,a,i),t=t.sibling;t!==null;)hu(t,a,i),t=t.sibling}function sw(t){var a=t.stateNode,i=t.memoizedProps;try{for(var d=t.type,p=a.attributes;p.length;)a.removeAttributeNode(p[0]);en(a,d,i),a[Bt]=t,a[Wt]=i}catch(b){st(t,t.return,b)}}var rr=!1,Pt=!1,ep=!1,cw=typeof WeakSet=="function"?WeakSet:Set,Vt=null;function ez(t,a){if(t=t.containerInfo,_p=Lu,t=_1(t),Kh(t)){if("selectionStart"in t)var i={start:t.selectionStart,end:t.selectionEnd};else e:{i=(i=t.ownerDocument)&&i.defaultView||window;var d=i.getSelection&&i.getSelection();if(d&&d.rangeCount!==0){i=d.anchorNode;var p=d.anchorOffset,b=d.focusNode;d=d.focusOffset;try{i.nodeType,b.nodeType}catch{i=null;break e}var k=0,R=-1,P=-1,X=0,ae=0,se=t,J=null;t:for(;;){for(var ee;se!==i||p!==0&&se.nodeType!==3||(R=k+p),se!==b||d!==0&&se.nodeType!==3||(P=k+d),se.nodeType===3&&(k+=se.nodeValue.length),(ee=se.firstChild)!==null;)J=se,se=ee;for(;;){if(se===t)break t;if(J===i&&++X===p&&(R=k),J===b&&++ae===d&&(P=k),(ee=se.nextSibling)!==null)break;se=J,J=se.parentNode}se=ee}i=R===-1||P===-1?null:{start:R,end:P}}else i=null}i=i||{start:0,end:0}}else i=null;for(wp={focusedElem:t,selectionRange:i},Lu=!1,Vt=a;Vt!==null;)if(a=Vt,t=a.child,(a.subtreeFlags&1028)!==0&&t!==null)t.return=a,Vt=t;else for(;Vt!==null;){switch(a=Vt,b=a.alternate,t=a.flags,a.tag){case 0:if((t&4)!==0&&(t=a.updateQueue,t=t!==null?t.events:null,t!==null))for(i=0;i<t.length;i++)p=t[i],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&b!==null){t=void 0,i=a,p=b.memoizedProps,b=b.memoizedState,d=i.stateNode;try{var we=El(i.type,p);t=d.getSnapshotBeforeUpdate(we,b),d.__reactInternalSnapshotBeforeUpdate=t}catch(Ae){st(i,i.return,Ae)}}break;case 3:if((t&1024)!==0){if(t=a.stateNode.containerInfo,i=t.nodeType,i===9)Cp(t);else if(i===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Cp(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(l(163))}if(t=a.sibling,t!==null){t.return=a.return,Vt=t;break}Vt=a.return}}function uw(t,a,i){var d=i.flags;switch(i.tag){case 0:case 11:case 15:ir(t,i),d&4&&Wo(5,i);break;case 1:if(ir(t,i),d&4)if(t=i.stateNode,a===null)try{t.componentDidMount()}catch(k){st(i,i.return,k)}else{var p=El(i.type,a.memoizedProps);a=a.memoizedState;try{t.componentDidUpdate(p,a,t.__reactInternalSnapshotBeforeUpdate)}catch(k){st(i,i.return,k)}}d&64&&rw(i),d&512&&Xo(i,i.return);break;case 3:if(ir(t,i),d&64&&(t=i.updateQueue,t!==null)){if(a=null,i.child!==null)switch(i.child.tag){case 27:case 5:a=i.child.stateNode;break;case 1:a=i.child.stateNode}try{V1(t,a)}catch(k){st(i,i.return,k)}}break;case 27:a===null&&d&4&&sw(i);case 26:case 5:ir(t,i),a===null&&d&4&&iw(i),d&512&&Xo(i,i.return);break;case 12:ir(t,i);break;case 31:ir(t,i),d&4&&hw(t,i);break;case 13:ir(t,i),d&4&&mw(t,i),d&64&&(t=i.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(i=cz.bind(null,i),Tz(t,i))));break;case 22:if(d=i.memoizedState!==null||rr,!d){a=a!==null&&a.memoizedState!==null||Pt,p=rr;var b=Pt;rr=d,(Pt=a)&&!b?or(t,i,(i.subtreeFlags&8772)!==0):ir(t,i),rr=p,Pt=b}break;case 30:break;default:ir(t,i)}}function dw(t){var a=t.alternate;a!==null&&(t.alternate=null,dw(a)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(a=t.stateNode,a!==null&&Ft(a)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var jt=null,kn=!1;function lr(t,a,i){for(i=i.child;i!==null;)fw(t,a,i),i=i.sibling}function fw(t,a,i){if(it&&typeof it.onCommitFiberUnmount=="function")try{it.onCommitFiberUnmount(bt,i)}catch{}switch(i.tag){case 26:Pt||Oa(i,a),lr(t,a,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Pt||Oa(i,a);var d=jt,p=kn;Pr(i.type)&&(jt=i.stateNode,kn=!1),lr(t,a,i),is(i.stateNode),jt=d,kn=p;break;case 5:Pt||Oa(i,a);case 6:if(d=jt,p=kn,jt=null,lr(t,a,i),jt=d,kn=p,jt!==null)if(kn)try{(jt.nodeType===9?jt.body:jt.nodeName==="HTML"?jt.ownerDocument.body:jt).removeChild(i.stateNode)}catch(b){st(i,a,b)}else try{jt.removeChild(i.stateNode)}catch(b){st(i,a,b)}break;case 18:jt!==null&&(kn?(t=jt,r2(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,i.stateNode),Bi(t)):r2(jt,i.stateNode));break;case 4:d=jt,p=kn,jt=i.stateNode.containerInfo,kn=!0,lr(t,a,i),jt=d,kn=p;break;case 0:case 11:case 14:case 15:Or(2,i,a),Pt||Or(4,i,a),lr(t,a,i);break;case 1:Pt||(Oa(i,a),d=i.stateNode,typeof d.componentWillUnmount=="function"&&lw(i,a,d)),lr(t,a,i);break;case 21:lr(t,a,i);break;case 22:Pt=(d=Pt)||i.memoizedState!==null,lr(t,a,i),Pt=d;break;default:lr(t,a,i)}}function hw(t,a){if(a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Bi(t)}catch(i){st(a,a.return,i)}}}function mw(t,a){if(a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Bi(t)}catch(i){st(a,a.return,i)}}function tz(t){switch(t.tag){case 31:case 13:case 19:var a=t.stateNode;return a===null&&(a=t.stateNode=new cw),a;case 22:return t=t.stateNode,a=t._retryCache,a===null&&(a=t._retryCache=new cw),a;default:throw Error(l(435,t.tag))}}function mu(t,a){var i=tz(t);a.forEach(function(d){if(!i.has(d)){i.add(d);var p=uz.bind(null,t,d);d.then(p,p)}})}function Sn(t,a){var i=a.deletions;if(i!==null)for(var d=0;d<i.length;d++){var p=i[d],b=t,k=a,R=k;e:for(;R!==null;){switch(R.tag){case 27:if(Pr(R.type)){jt=R.stateNode,kn=!1;break e}break;case 5:jt=R.stateNode,kn=!1;break e;case 3:case 4:jt=R.stateNode.containerInfo,kn=!0;break e}R=R.return}if(jt===null)throw Error(l(160));fw(b,k,p),jt=null,kn=!1,b=p.alternate,b!==null&&(b.return=null),p.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)pw(a,t),a=a.sibling}var _a=null;function pw(t,a){var i=t.alternate,d=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Sn(a,t),Cn(t),d&4&&(Or(3,t,t.return),Wo(3,t),Or(5,t,t.return));break;case 1:Sn(a,t),Cn(t),d&512&&(Pt||i===null||Oa(i,i.return)),d&64&&rr&&(t=t.updateQueue,t!==null&&(d=t.callbacks,d!==null&&(i=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=i===null?d:i.concat(d))));break;case 26:var p=_a;if(Sn(a,t),Cn(t),d&512&&(Pt||i===null||Oa(i,i.return)),d&4){var b=i!==null?i.memoizedState:null;if(d=t.memoizedState,i===null)if(d===null)if(t.stateNode===null){e:{d=t.type,i=t.memoizedProps,p=p.ownerDocument||p;t:switch(d){case"title":b=p.getElementsByTagName("title")[0],(!b||b[We]||b[Bt]||b.namespaceURI==="http://www.w3.org/2000/svg"||b.hasAttribute("itemprop"))&&(b=p.createElement(d),p.head.insertBefore(b,p.querySelector("head > title"))),en(b,d,i),b[Bt]=t,Ct(b),d=b;break e;case"link":var k=p2("link","href",p).get(d+(i.href||""));if(k){for(var R=0;R<k.length;R++)if(b=k[R],b.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&b.getAttribute("rel")===(i.rel==null?null:i.rel)&&b.getAttribute("title")===(i.title==null?null:i.title)&&b.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){k.splice(R,1);break t}}b=p.createElement(d),en(b,d,i),p.head.appendChild(b);break;case"meta":if(k=p2("meta","content",p).get(d+(i.content||""))){for(R=0;R<k.length;R++)if(b=k[R],b.getAttribute("content")===(i.content==null?null:""+i.content)&&b.getAttribute("name")===(i.name==null?null:i.name)&&b.getAttribute("property")===(i.property==null?null:i.property)&&b.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&b.getAttribute("charset")===(i.charSet==null?null:i.charSet)){k.splice(R,1);break t}}b=p.createElement(d),en(b,d,i),p.head.appendChild(b);break;default:throw Error(l(468,d))}b[Bt]=t,Ct(b),d=b}t.stateNode=d}else g2(p,t.type,t.stateNode);else t.stateNode=m2(p,d,t.memoizedProps);else b!==d?(b===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):b.count--,d===null?g2(p,t.type,t.stateNode):m2(p,d,t.memoizedProps)):d===null&&t.stateNode!==null&&Xm(t,t.memoizedProps,i.memoizedProps)}break;case 27:Sn(a,t),Cn(t),d&512&&(Pt||i===null||Oa(i,i.return)),i!==null&&d&4&&Xm(t,t.memoizedProps,i.memoizedProps);break;case 5:if(Sn(a,t),Cn(t),d&512&&(Pt||i===null||Oa(i,i.return)),t.flags&32){p=t.stateNode;try{ii(p,"")}catch(we){st(t,t.return,we)}}d&4&&t.stateNode!=null&&(p=t.memoizedProps,Xm(t,p,i!==null?i.memoizedProps:p)),d&1024&&(ep=!0);break;case 6:if(Sn(a,t),Cn(t),d&4){if(t.stateNode===null)throw Error(l(162));d=t.memoizedProps,i=t.stateNode;try{i.nodeValue=d}catch(we){st(t,t.return,we)}}break;case 3:if(Au=null,p=_a,_a=Nu(a.containerInfo),Sn(a,t),_a=p,Cn(t),d&4&&i!==null&&i.memoizedState.isDehydrated)try{Bi(a.containerInfo)}catch(we){st(t,t.return,we)}ep&&(ep=!1,gw(t));break;case 4:d=_a,_a=Nu(t.stateNode.containerInfo),Sn(a,t),Cn(t),_a=d;break;case 12:Sn(a,t),Cn(t);break;case 31:Sn(a,t),Cn(t),d&4&&(d=t.updateQueue,d!==null&&(t.updateQueue=null,mu(t,d)));break;case 13:Sn(a,t),Cn(t),t.child.flags&8192&&t.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(gu=tt()),d&4&&(d=t.updateQueue,d!==null&&(t.updateQueue=null,mu(t,d)));break;case 22:p=t.memoizedState!==null;var P=i!==null&&i.memoizedState!==null,X=rr,ae=Pt;if(rr=X||p,Pt=ae||P,Sn(a,t),Pt=ae,rr=X,Cn(t),d&8192)e:for(a=t.stateNode,a._visibility=p?a._visibility&-2:a._visibility|1,p&&(i===null||P||rr||Pt||Nl(t)),i=null,a=t;;){if(a.tag===5||a.tag===26){if(i===null){P=i=a;try{if(b=P.stateNode,p)k=b.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{R=P.stateNode;var se=P.memoizedProps.style,J=se!=null&&se.hasOwnProperty("display")?se.display:null;R.style.display=J==null||typeof J=="boolean"?"":(""+J).trim()}}catch(we){st(P,P.return,we)}}}else if(a.tag===6){if(i===null){P=a;try{P.stateNode.nodeValue=p?"":P.memoizedProps}catch(we){st(P,P.return,we)}}}else if(a.tag===18){if(i===null){P=a;try{var ee=P.stateNode;p?l2(ee,!0):l2(P.stateNode,!1)}catch(we){st(P,P.return,we)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===t)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;a.sibling===null;){if(a.return===null||a.return===t)break e;i===a&&(i=null),a=a.return}i===a&&(i=null),a.sibling.return=a.return,a=a.sibling}d&4&&(d=t.updateQueue,d!==null&&(i=d.retryQueue,i!==null&&(d.retryQueue=null,mu(t,i))));break;case 19:Sn(a,t),Cn(t),d&4&&(d=t.updateQueue,d!==null&&(t.updateQueue=null,mu(t,d)));break;case 30:break;case 21:break;default:Sn(a,t),Cn(t)}}function Cn(t){var a=t.flags;if(a&2){try{for(var i,d=t.return;d!==null;){if(ow(d)){i=d;break}d=d.return}if(i==null)throw Error(l(160));switch(i.tag){case 27:var p=i.stateNode,b=Jm(t);hu(t,b,p);break;case 5:var k=i.stateNode;i.flags&32&&(ii(k,""),i.flags&=-33);var R=Jm(t);hu(t,R,k);break;case 3:case 4:var P=i.stateNode.containerInfo,X=Jm(t);Zm(t,X,P);break;default:throw Error(l(161))}}catch(ae){st(t,t.return,ae)}t.flags&=-3}a&4096&&(t.flags&=-4097)}function gw(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var a=t;gw(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),t=t.sibling}}function ir(t,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)uw(t,a.alternate,a),a=a.sibling}function Nl(t){for(t=t.child;t!==null;){var a=t;switch(a.tag){case 0:case 11:case 14:case 15:Or(4,a,a.return),Nl(a);break;case 1:Oa(a,a.return);var i=a.stateNode;typeof i.componentWillUnmount=="function"&&lw(a,a.return,i),Nl(a);break;case 27:is(a.stateNode);case 26:case 5:Oa(a,a.return),Nl(a);break;case 22:a.memoizedState===null&&Nl(a);break;case 30:Nl(a);break;default:Nl(a)}t=t.sibling}}function or(t,a,i){for(i=i&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var d=a.alternate,p=t,b=a,k=b.flags;switch(b.tag){case 0:case 11:case 15:or(p,b,i),Wo(4,b);break;case 1:if(or(p,b,i),d=b,p=d.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(X){st(d,d.return,X)}if(d=b,p=d.updateQueue,p!==null){var R=d.stateNode;try{var P=p.shared.hiddenCallbacks;if(P!==null)for(p.shared.hiddenCallbacks=null,p=0;p<P.length;p++)K1(P[p],R)}catch(X){st(d,d.return,X)}}i&&k&64&&rw(b),Xo(b,b.return);break;case 27:sw(b);case 26:case 5:or(p,b,i),i&&d===null&&k&4&&iw(b),Xo(b,b.return);break;case 12:or(p,b,i);break;case 31:or(p,b,i),i&&k&4&&hw(p,b);break;case 13:or(p,b,i),i&&k&4&&mw(p,b);break;case 22:b.memoizedState===null&&or(p,b,i),Xo(b,b.return);break;case 30:break;default:or(p,b,i)}a=a.sibling}}function tp(t,a){var i=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),t=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(t=a.memoizedState.cachePool.pool),t!==i&&(t!=null&&t.refCount++,i!=null&&Bo(i))}function np(t,a){t=null,a.alternate!==null&&(t=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==t&&(a.refCount++,t!=null&&Bo(t))}function wa(t,a,i,d){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)yw(t,a,i,d),a=a.sibling}function yw(t,a,i,d){var p=a.flags;switch(a.tag){case 0:case 11:case 15:wa(t,a,i,d),p&2048&&Wo(9,a);break;case 1:wa(t,a,i,d);break;case 3:wa(t,a,i,d),p&2048&&(t=null,a.alternate!==null&&(t=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==t&&(a.refCount++,t!=null&&Bo(t)));break;case 12:if(p&2048){wa(t,a,i,d),t=a.stateNode;try{var b=a.memoizedProps,k=b.id,R=b.onPostCommit;typeof R=="function"&&R(k,a.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(P){st(a,a.return,P)}}else wa(t,a,i,d);break;case 31:wa(t,a,i,d);break;case 13:wa(t,a,i,d);break;case 23:break;case 22:b=a.stateNode,k=a.alternate,a.memoizedState!==null?b._visibility&2?wa(t,a,i,d):Jo(t,a):b._visibility&2?wa(t,a,i,d):(b._visibility|=2,ji(t,a,i,d,(a.subtreeFlags&10256)!==0||!1)),p&2048&&tp(k,a);break;case 24:wa(t,a,i,d),p&2048&&np(a.alternate,a);break;default:wa(t,a,i,d)}}function ji(t,a,i,d,p){for(p=p&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var b=t,k=a,R=i,P=d,X=k.flags;switch(k.tag){case 0:case 11:case 15:ji(b,k,R,P,p),Wo(8,k);break;case 23:break;case 22:var ae=k.stateNode;k.memoizedState!==null?ae._visibility&2?ji(b,k,R,P,p):Jo(b,k):(ae._visibility|=2,ji(b,k,R,P,p)),p&&X&2048&&tp(k.alternate,k);break;case 24:ji(b,k,R,P,p),p&&X&2048&&np(k.alternate,k);break;default:ji(b,k,R,P,p)}a=a.sibling}}function Jo(t,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var i=t,d=a,p=d.flags;switch(d.tag){case 22:Jo(i,d),p&2048&&tp(d.alternate,d);break;case 24:Jo(i,d),p&2048&&np(d.alternate,d);break;default:Jo(i,d)}a=a.sibling}}var Zo=8192;function Ei(t,a,i){if(t.subtreeFlags&Zo)for(t=t.child;t!==null;)bw(t,a,i),t=t.sibling}function bw(t,a,i){switch(t.tag){case 26:Ei(t,a,i),t.flags&Zo&&t.memoizedState!==null&&Hz(i,_a,t.memoizedState,t.memoizedProps);break;case 5:Ei(t,a,i);break;case 3:case 4:var d=_a;_a=Nu(t.stateNode.containerInfo),Ei(t,a,i),_a=d;break;case 22:t.memoizedState===null&&(d=t.alternate,d!==null&&d.memoizedState!==null?(d=Zo,Zo=16777216,Ei(t,a,i),Zo=d):Ei(t,a,i));break;default:Ei(t,a,i)}}function xw(t){var a=t.alternate;if(a!==null&&(t=a.child,t!==null)){a.child=null;do a=t.sibling,t.sibling=null,t=a;while(t!==null)}}function es(t){var a=t.deletions;if((t.flags&16)!==0){if(a!==null)for(var i=0;i<a.length;i++){var d=a[i];Vt=d,_w(d,t)}xw(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)vw(t),t=t.sibling}function vw(t){switch(t.tag){case 0:case 11:case 15:es(t),t.flags&2048&&Or(9,t,t.return);break;case 3:es(t);break;case 12:es(t);break;case 22:var a=t.stateNode;t.memoizedState!==null&&a._visibility&2&&(t.return===null||t.return.tag!==13)?(a._visibility&=-3,pu(t)):es(t);break;default:es(t)}}function pu(t){var a=t.deletions;if((t.flags&16)!==0){if(a!==null)for(var i=0;i<a.length;i++){var d=a[i];Vt=d,_w(d,t)}xw(t)}for(t=t.child;t!==null;){switch(a=t,a.tag){case 0:case 11:case 15:Or(8,a,a.return),pu(a);break;case 22:i=a.stateNode,i._visibility&2&&(i._visibility&=-3,pu(a));break;default:pu(a)}t=t.sibling}}function _w(t,a){for(;Vt!==null;){var i=Vt;switch(i.tag){case 0:case 11:case 15:Or(8,i,a);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var d=i.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:Bo(i.memoizedState.cache)}if(d=i.child,d!==null)d.return=i,Vt=d;else e:for(i=t;Vt!==null;){d=Vt;var p=d.sibling,b=d.return;if(dw(d),d===i){Vt=null;break e}if(p!==null){p.return=b,Vt=p;break e}Vt=b}}}var nz={getCacheForType:function(t){var a=Jt(Ut),i=a.data.get(t);return i===void 0&&(i=t(),a.data.set(t,i)),i},cacheSignal:function(){return Jt(Ut).controller.signal}},az=typeof WeakMap=="function"?WeakMap:Map,rt=0,mt=null,qe=null,Ge=0,ot=0,Hn=null,Br=!1,Ni=!1,ap=!1,sr=0,Tt=0,Fr=0,Tl=0,rp=0,qn=0,Ti=0,ts=null,jn=null,lp=!1,gu=0,ww=0,yu=1/0,bu=null,Ir=null,Gt=0,Ur=null,Ai=null,cr=0,ip=0,op=null,kw=null,ns=0,sp=null;function Pn(){return(rt&2)!==0&&Ge!==0?Ge&-Ge:V.T!==null?mp():fl()}function Sw(){if(qn===0)if((Ge&536870912)===0||Xe){var t=Xn;Xn<<=1,(Xn&3932160)===0&&(Xn=262144),qn=t}else qn=536870912;return t=In.current,t!==null&&(t.flags|=32),qn}function En(t,a,i){(t===mt&&(ot===2||ot===9)||t.cancelPendingCommit!==null)&&(Mi(t,0),Hr(t,Ge,qn,!1)),xa(t,i),((rt&2)===0||t!==mt)&&(t===mt&&((rt&2)===0&&(Tl|=i),Tt===4&&Hr(t,Ge,qn,!1)),Ba(t))}function Cw(t,a,i){if((rt&6)!==0)throw Error(l(327));var d=!i&&(a&127)===0&&(a&t.expiredLanes)===0||ba(t,a),p=d?iz(t,a):up(t,a,!0),b=d;do{if(p===0){Ni&&!d&&Hr(t,a,0,!1);break}else{if(i=t.current.alternate,b&&!rz(i)){p=up(t,a,!1),b=!1;continue}if(p===2){if(b=a,t.errorRecoveryDisabledLanes&b)var k=0;else k=t.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){a=k;e:{var R=t;p=ts;var P=R.current.memoizedState.isDehydrated;if(P&&(Mi(R,k).flags|=256),k=up(R,k,!1),k!==2){if(ap&&!P){R.errorRecoveryDisabledLanes|=b,Tl|=b,p=4;break e}b=jn,jn=p,b!==null&&(jn===null?jn=b:jn.push.apply(jn,b))}p=k}if(b=!1,p!==2)continue}}if(p===1){Mi(t,0),Hr(t,a,0,!0);break}e:{switch(d=t,b=p,b){case 0:case 1:throw Error(l(345));case 4:if((a&4194048)!==a)break;case 6:Hr(d,a,qn,!Br);break e;case 2:jn=null;break;case 3:case 5:break;default:throw Error(l(329))}if((a&62914560)===a&&(p=gu+300-tt(),10<p)){if(Hr(d,a,qn,!Br),Zn(d,0,!0)!==0)break e;cr=a,d.timeoutHandle=n2(jw.bind(null,d,i,jn,bu,lp,a,qn,Tl,Ti,Br,b,"Throttled",-0,0),p);break e}jw(d,i,jn,bu,lp,a,qn,Tl,Ti,Br,b,null,-0,0)}}break}while(!0);Ba(t)}function jw(t,a,i,d,p,b,k,R,P,X,ae,se,J,ee){if(t.timeoutHandle=-1,se=a.subtreeFlags,se&8192||(se&16785408)===16785408){se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Va},bw(a,b,se);var we=(b&62914560)===b?gu-tt():(b&4194048)===b?ww-tt():0;if(we=qz(se,we),we!==null){cr=b,t.cancelPendingCommit=we(Lw.bind(null,t,a,b,i,d,p,k,R,P,ae,se,null,J,ee)),Hr(t,b,k,!X);return}}Lw(t,a,b,i,d,p,k,R,P)}function rz(t){for(var a=t;;){var i=a.tag;if((i===0||i===11||i===15)&&a.flags&16384&&(i=a.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var d=0;d<i.length;d++){var p=i[d],b=p.getSnapshot;p=p.value;try{if(!Bn(b(),p))return!1}catch{return!1}}if(i=a.child,a.subtreeFlags&16384&&i!==null)i.return=a,a=i;else{if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Hr(t,a,i,d){a&=~rp,a&=~Tl,t.suspendedLanes|=a,t.pingedLanes&=~a,d&&(t.warmLanes|=a),d=t.expirationTimes;for(var p=a;0<p;){var b=31-Ie(p),k=1<<b;d[b]=-1,p&=~k}i!==0&&dl(t,i,a)}function xu(){return(rt&6)===0?(as(0),!1):!0}function cp(){if(qe!==null){if(ot===0)var t=qe.return;else t=qe,Ja=vl=null,Cm(t),_i=null,Io=0,t=qe;for(;t!==null;)aw(t.alternate,t),t=t.return;qe=null}}function Mi(t,a){var i=t.timeoutHandle;i!==-1&&(t.timeoutHandle=-1,Sz(i)),i=t.cancelPendingCommit,i!==null&&(t.cancelPendingCommit=null,i()),cr=0,cp(),mt=t,qe=i=Wa(t.current,null),Ge=a,ot=0,Hn=null,Br=!1,Ni=ba(t,a),ap=!1,Ti=qn=rp=Tl=Fr=Tt=0,jn=ts=null,lp=!1,(a&8)!==0&&(a|=a&32);var d=t.entangledLanes;if(d!==0)for(t=t.entanglements,d&=a;0<d;){var p=31-Ie(d),b=1<<p;a|=t[p],d&=~b}return sr=a,Uc(),i}function Ew(t,a){ze=null,V.H=Ko,a===vi||a===Vc?(a=P1(),ot=3):a===hm?(a=P1(),ot=4):ot=a===Hm?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,Hn=a,qe===null&&(Tt=1,su(t,la(a,t.current)))}function Nw(){var t=In.current;return t===null?!0:(Ge&4194048)===Ge?ca===null:(Ge&62914560)===Ge||(Ge&536870912)!==0?t===ca:!1}function Tw(){var t=V.H;return V.H=Ko,t===null?Ko:t}function Aw(){var t=V.A;return V.A=nz,t}function vu(){Tt=4,Br||(Ge&4194048)!==Ge&&In.current!==null||(Ni=!0),(Fr&134217727)===0&&(Tl&134217727)===0||mt===null||Hr(mt,Ge,qn,!1)}function up(t,a,i){var d=rt;rt|=2;var p=Tw(),b=Aw();(mt!==t||Ge!==a)&&(bu=null,Mi(t,a)),a=!1;var k=Tt;e:do try{if(ot!==0&&qe!==null){var R=qe,P=Hn;switch(ot){case 8:cp(),k=6;break e;case 3:case 2:case 9:case 6:In.current===null&&(a=!0);var X=ot;if(ot=0,Hn=null,Ri(t,R,P,X),i&&Ni){k=0;break e}break;default:X=ot,ot=0,Hn=null,Ri(t,R,P,X)}}lz(),k=Tt;break}catch(ae){Ew(t,ae)}while(!0);return a&&t.shellSuspendCounter++,Ja=vl=null,rt=d,V.H=p,V.A=b,qe===null&&(mt=null,Ge=0,Uc()),k}function lz(){for(;qe!==null;)Mw(qe)}function iz(t,a){var i=rt;rt|=2;var d=Tw(),p=Aw();mt!==t||Ge!==a?(bu=null,yu=tt()+500,Mi(t,a)):Ni=ba(t,a);e:do try{if(ot!==0&&qe!==null){a=qe;var b=Hn;t:switch(ot){case 1:ot=0,Hn=null,Ri(t,a,b,1);break;case 2:case 9:if(H1(b)){ot=0,Hn=null,Rw(a);break}a=function(){ot!==2&&ot!==9||mt!==t||(ot=7),Ba(t)},b.then(a,a);break e;case 3:ot=7;break e;case 4:ot=5;break e;case 7:H1(b)?(ot=0,Hn=null,Rw(a)):(ot=0,Hn=null,Ri(t,a,b,7));break;case 5:var k=null;switch(qe.tag){case 26:k=qe.memoizedState;case 5:case 27:var R=qe;if(k?y2(k):R.stateNode.complete){ot=0,Hn=null;var P=R.sibling;if(P!==null)qe=P;else{var X=R.return;X!==null?(qe=X,_u(X)):qe=null}break t}}ot=0,Hn=null,Ri(t,a,b,5);break;case 6:ot=0,Hn=null,Ri(t,a,b,6);break;case 8:cp(),Tt=6;break e;default:throw Error(l(462))}}oz();break}catch(ae){Ew(t,ae)}while(!0);return Ja=vl=null,V.H=d,V.A=p,rt=i,qe!==null?0:(mt=null,Ge=0,Uc(),Tt)}function oz(){for(;qe!==null&&!sn();)Mw(qe)}function Mw(t){var a=tw(t.alternate,t,sr);t.memoizedProps=t.pendingProps,a===null?_u(t):qe=a}function Rw(t){var a=t,i=a.alternate;switch(a.tag){case 15:case 0:a=Q_(i,a,a.pendingProps,a.type,void 0,Ge);break;case 11:a=Q_(i,a,a.pendingProps,a.type.render,a.ref,Ge);break;case 5:Cm(a);default:aw(i,a),a=qe=A1(a,sr),a=tw(i,a,sr)}t.memoizedProps=t.pendingProps,a===null?_u(t):qe=a}function Ri(t,a,i,d){Ja=vl=null,Cm(a),_i=null,Io=0;var p=a.return;try{if(QL(t,p,a,i,Ge)){Tt=1,su(t,la(i,t.current)),qe=null;return}}catch(b){if(p!==null)throw qe=p,b;Tt=1,su(t,la(i,t.current)),qe=null;return}a.flags&32768?(Xe||d===1?t=!0:Ni||(Ge&536870912)!==0?t=!1:(Br=t=!0,(d===2||d===9||d===3||d===6)&&(d=In.current,d!==null&&d.tag===13&&(d.flags|=16384))),Dw(a,t)):_u(a)}function _u(t){var a=t;do{if((a.flags&32768)!==0){Dw(a,Br);return}t=a.return;var i=JL(a.alternate,a,sr);if(i!==null){qe=i;return}if(a=a.sibling,a!==null){qe=a;return}qe=a=t}while(a!==null);Tt===0&&(Tt=5)}function Dw(t,a){do{var i=ZL(t.alternate,t);if(i!==null){i.flags&=32767,qe=i;return}if(i=t.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!a&&(t=t.sibling,t!==null)){qe=t;return}qe=t=i}while(t!==null);Tt=6,qe=null}function Lw(t,a,i,d,p,b,k,R,P){t.cancelPendingCommit=null;do wu();while(Gt!==0);if((rt&6)!==0)throw Error(l(327));if(a!==null){if(a===t.current)throw Error(l(177));if(b=a.lanes|a.childLanes,b|=Jh,ai(t,i,b,k,R,P),t===mt&&(qe=mt=null,Ge=0),Ai=a,Ur=t,cr=i,ip=b,op=p,kw=d,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,dz(je,function(){return Iw(),null})):(t.callbackNode=null,t.callbackPriority=0),d=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||d){d=V.T,V.T=null,p=le.p,le.p=2,k=rt,rt|=4;try{ez(t,a,i)}finally{rt=k,le.p=p,V.T=d}}Gt=1,zw(),Ow(),Bw()}}function zw(){if(Gt===1){Gt=0;var t=Ur,a=Ai,i=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||i){i=V.T,V.T=null;var d=le.p;le.p=2;var p=rt;rt|=4;try{pw(a,t);var b=wp,k=_1(t.containerInfo),R=b.focusedElem,P=b.selectionRange;if(k!==R&&R&&R.ownerDocument&&v1(R.ownerDocument.documentElement,R)){if(P!==null&&Kh(R)){var X=P.start,ae=P.end;if(ae===void 0&&(ae=X),"selectionStart"in R)R.selectionStart=X,R.selectionEnd=Math.min(ae,R.value.length);else{var se=R.ownerDocument||document,J=se&&se.defaultView||window;if(J.getSelection){var ee=J.getSelection(),we=R.textContent.length,Ae=Math.min(P.start,we),dt=P.end===void 0?Ae:Math.min(P.end,we);!ee.extend&&Ae>dt&&(k=dt,dt=Ae,Ae=k);var Q=x1(R,Ae),Y=x1(R,dt);if(Q&&Y&&(ee.rangeCount!==1||ee.anchorNode!==Q.node||ee.anchorOffset!==Q.offset||ee.focusNode!==Y.node||ee.focusOffset!==Y.offset)){var W=se.createRange();W.setStart(Q.node,Q.offset),ee.removeAllRanges(),Ae>dt?(ee.addRange(W),ee.extend(Y.node,Y.offset)):(W.setEnd(Y.node,Y.offset),ee.addRange(W))}}}}for(se=[],ee=R;ee=ee.parentNode;)ee.nodeType===1&&se.push({element:ee,left:ee.scrollLeft,top:ee.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<se.length;R++){var ie=se[R];ie.element.scrollLeft=ie.left,ie.element.scrollTop=ie.top}}Lu=!!_p,wp=_p=null}finally{rt=p,le.p=d,V.T=i}}t.current=a,Gt=2}}function Ow(){if(Gt===2){Gt=0;var t=Ur,a=Ai,i=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||i){i=V.T,V.T=null;var d=le.p;le.p=2;var p=rt;rt|=4;try{uw(t,a.alternate,a)}finally{rt=p,le.p=d,V.T=i}}Gt=3}}function Bw(){if(Gt===4||Gt===3){Gt=0,ya();var t=Ur,a=Ai,i=cr,d=kw;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?Gt=5:(Gt=0,Ai=Ur=null,Fw(t,t.pendingLanes));var p=t.pendingLanes;if(p===0&&(Ir=null),ea(i),a=a.stateNode,it&&typeof it.onCommitFiberRoot=="function")try{it.onCommitFiberRoot(bt,a,void 0,(a.current.flags&128)===128)}catch{}if(d!==null){a=V.T,p=le.p,le.p=2,V.T=null;try{for(var b=t.onRecoverableError,k=0;k<d.length;k++){var R=d[k];b(R.value,{componentStack:R.stack})}}finally{V.T=a,le.p=p}}(cr&3)!==0&&wu(),Ba(t),p=t.pendingLanes,(i&261930)!==0&&(p&42)!==0?t===sp?ns++:(ns=0,sp=t):ns=0,as(0)}}function Fw(t,a){(t.pooledCacheLanes&=a)===0&&(a=t.pooledCache,a!=null&&(t.pooledCache=null,Bo(a)))}function wu(){return zw(),Ow(),Bw(),Iw()}function Iw(){if(Gt!==5)return!1;var t=Ur,a=ip;ip=0;var i=ea(cr),d=V.T,p=le.p;try{le.p=32>i?32:i,V.T=null,i=op,op=null;var b=Ur,k=cr;if(Gt=0,Ai=Ur=null,cr=0,(rt&6)!==0)throw Error(l(331));var R=rt;if(rt|=4,vw(b.current),yw(b,b.current,k,i),rt=R,as(0,!1),it&&typeof it.onPostCommitFiberRoot=="function")try{it.onPostCommitFiberRoot(bt,b)}catch{}return!0}finally{le.p=p,V.T=d,Fw(t,a)}}function Uw(t,a,i){a=la(i,a),a=Um(t.stateNode,a,2),t=Dr(t,a,2),t!==null&&(xa(t,2),Ba(t))}function st(t,a,i){if(t.tag===3)Uw(t,t,i);else for(;a!==null;){if(a.tag===3){Uw(a,t,i);break}else if(a.tag===1){var d=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Ir===null||!Ir.has(d))){t=la(i,t),i=H_(2),d=Dr(a,i,2),d!==null&&(q_(i,d,a,t),xa(d,2),Ba(d));break}}a=a.return}}function dp(t,a,i){var d=t.pingCache;if(d===null){d=t.pingCache=new az;var p=new Set;d.set(a,p)}else p=d.get(a),p===void 0&&(p=new Set,d.set(a,p));p.has(i)||(ap=!0,p.add(i),t=sz.bind(null,t,a,i),a.then(t,t))}function sz(t,a,i){var d=t.pingCache;d!==null&&d.delete(a),t.pingedLanes|=t.suspendedLanes&i,t.warmLanes&=~i,mt===t&&(Ge&i)===i&&(Tt===4||Tt===3&&(Ge&62914560)===Ge&&300>tt()-gu?(rt&2)===0&&Mi(t,0):rp|=i,Ti===Ge&&(Ti=0)),Ba(t)}function Hw(t,a){a===0&&(a=Sr()),t=yl(t,a),t!==null&&(xa(t,a),Ba(t))}function cz(t){var a=t.memoizedState,i=0;a!==null&&(i=a.retryLane),Hw(t,i)}function uz(t,a){var i=0;switch(t.tag){case 31:case 13:var d=t.stateNode,p=t.memoizedState;p!==null&&(i=p.retryLane);break;case 19:d=t.stateNode;break;case 22:d=t.stateNode._retryCache;break;default:throw Error(l(314))}d!==null&&d.delete(a),Hw(t,i)}function dz(t,a){return bn(t,a)}var ku=null,Di=null,fp=!1,Su=!1,hp=!1,qr=0;function Ba(t){t!==Di&&t.next===null&&(Di===null?ku=Di=t:Di=Di.next=t),Su=!0,fp||(fp=!0,hz())}function as(t,a){if(!hp&&Su){hp=!0;do for(var i=!1,d=ku;d!==null;){if(t!==0){var p=d.pendingLanes;if(p===0)var b=0;else{var k=d.suspendedLanes,R=d.pingedLanes;b=(1<<31-Ie(42|t)+1)-1,b&=p&~(k&~R),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(i=!0,Yw(d,b))}else b=Ge,b=Zn(d,d===mt?b:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(b&3)===0||ba(d,b)||(i=!0,Yw(d,b));d=d.next}while(i);hp=!1}}function fz(){qw()}function qw(){Su=fp=!1;var t=0;qr!==0&&kz()&&(t=qr);for(var a=tt(),i=null,d=ku;d!==null;){var p=d.next,b=Pw(d,a);b===0?(d.next=null,i===null?ku=p:i.next=p,p===null&&(Di=i)):(i=d,(t!==0||(b&3)!==0)&&(Su=!0)),d=p}Gt!==0&&Gt!==5||as(t),qr!==0&&(qr=0)}function Pw(t,a){for(var i=t.suspendedLanes,d=t.pingedLanes,p=t.expirationTimes,b=t.pendingLanes&-62914561;0<b;){var k=31-Ie(b),R=1<<k,P=p[k];P===-1?((R&i)===0||(R&d)!==0)&&(p[k]=kr(R,a)):P<=a&&(t.expiredLanes|=R),b&=~R}if(a=mt,i=Ge,i=Zn(t,t===a?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),d=t.callbackNode,i===0||t===a&&(ot===2||ot===9)||t.cancelPendingCommit!==null)return d!==null&&d!==null&&Wn(d),t.callbackNode=null,t.callbackPriority=0;if((i&3)===0||ba(t,i)){if(a=i&-i,a===t.callbackPriority)return a;switch(d!==null&&Wn(d),ea(i)){case 2:case 8:i=pe;break;case 32:i=je;break;case 268435456:i=de;break;default:i=je}return d=$w.bind(null,t),i=bn(i,d),t.callbackPriority=a,t.callbackNode=i,a}return d!==null&&d!==null&&Wn(d),t.callbackPriority=2,t.callbackNode=null,2}function $w(t,a){if(Gt!==0&&Gt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var i=t.callbackNode;if(wu()&&t.callbackNode!==i)return null;var d=Ge;return d=Zn(t,t===mt?d:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),d===0?null:(Cw(t,d,a),Pw(t,tt()),t.callbackNode!=null&&t.callbackNode===i?$w.bind(null,t):null)}function Yw(t,a){if(wu())return null;Cw(t,a,!0)}function hz(){Cz(function(){(rt&6)!==0?bn(te,fz):qw()})}function mp(){if(qr===0){var t=bi;t===0&&(t=zn,zn<<=1,(zn&261888)===0&&(zn=256)),qr=t}return qr}function Gw(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Rc(""+t)}function Kw(t,a){var i=a.ownerDocument.createElement("input");return i.name=a.name,i.value=a.value,t.id&&i.setAttribute("form",t.id),a.parentNode.insertBefore(i,a),t=new FormData(t),i.parentNode.removeChild(i),t}function mz(t,a,i,d,p){if(a==="submit"&&i&&i.stateNode===p){var b=Gw((p[Wt]||null).action),k=d.submitter;k&&(a=(a=k[Wt]||null)?Gw(a.formAction):k.getAttribute("formAction"),a!==null&&(b=a,k=null));var R=new Oc("action","action",null,d,p);t.push({event:R,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(qr!==0){var P=k?Kw(p,k):new FormData(p);Lm(i,{pending:!0,data:P,method:p.method,action:b},null,P)}}else typeof b=="function"&&(R.preventDefault(),P=k?Kw(p,k):new FormData(p),Lm(i,{pending:!0,data:P,method:p.method,action:b},b,P))},currentTarget:p}]})}}for(var pp=0;pp<Xh.length;pp++){var gp=Xh[pp],pz=gp.toLowerCase(),gz=gp[0].toUpperCase()+gp.slice(1);va(pz,"on"+gz)}va(S1,"onAnimationEnd"),va(C1,"onAnimationIteration"),va(j1,"onAnimationStart"),va("dblclick","onDoubleClick"),va("focusin","onFocus"),va("focusout","onBlur"),va(RL,"onTransitionRun"),va(DL,"onTransitionStart"),va(LL,"onTransitionCancel"),va(E1,"onTransitionEnd"),It("onMouseEnter",["mouseout","mouseover"]),It("onMouseLeave",["mouseout","mouseover"]),It("onPointerEnter",["pointerout","pointerover"]),It("onPointerLeave",["pointerout","pointerover"]),Dt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Dt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Dt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Dt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Dt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Dt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var rs="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(" "),yz=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(rs));function Vw(t,a){a=(a&4)!==0;for(var i=0;i<t.length;i++){var d=t[i],p=d.event;d=d.listeners;e:{var b=void 0;if(a)for(var k=d.length-1;0<=k;k--){var R=d[k],P=R.instance,X=R.currentTarget;if(R=R.listener,P!==b&&p.isPropagationStopped())break e;b=R,p.currentTarget=X;try{b(p)}catch(ae){Ic(ae)}p.currentTarget=null,b=P}else for(k=0;k<d.length;k++){if(R=d[k],P=R.instance,X=R.currentTarget,R=R.listener,P!==b&&p.isPropagationStopped())break e;b=R,p.currentTarget=X;try{b(p)}catch(ae){Ic(ae)}p.currentTarget=null,b=P}}}}function Pe(t,a){var i=a[ge];i===void 0&&(i=a[ge]=new Set);var d=t+"__bubble";i.has(d)||(Qw(a,t,2,!1),i.add(d))}function yp(t,a,i){var d=0;a&&(d|=4),Qw(i,t,d,a)}var Cu="_reactListening"+Math.random().toString(36).slice(2);function bp(t){if(!t[Cu]){t[Cu]=!0,So.forEach(function(i){i!=="selectionchange"&&(yz.has(i)||yp(i,!1,t),yp(i,!0,t))});var a=t.nodeType===9?t:t.ownerDocument;a===null||a[Cu]||(a[Cu]=!0,yp("selectionchange",!1,a))}}function Qw(t,a,i,d){switch(S2(a)){case 2:var p=Yz;break;case 8:p=Gz;break;default:p=Dp}i=p.bind(null,a,i,t),p=void 0,!Fh||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(p=!0),d?p!==void 0?t.addEventListener(a,i,{capture:!0,passive:p}):t.addEventListener(a,i,!0):p!==void 0?t.addEventListener(a,i,{passive:p}):t.addEventListener(a,i,!1)}function xp(t,a,i,d,p){var b=d;if((a&1)===0&&(a&2)===0&&d!==null)e:for(;;){if(d===null)return;var k=d.tag;if(k===3||k===4){var R=d.stateNode.containerInfo;if(R===p)break;if(k===4)for(k=d.return;k!==null;){var P=k.tag;if((P===3||P===4)&&k.stateNode.containerInfo===p)return;k=k.return}for(;R!==null;){if(k=He(R),k===null)return;if(P=k.tag,P===5||P===6||P===26||P===27){d=b=k;continue e}R=R.parentNode}}d=d.return}e1(function(){var X=b,ae=Oh(i),se=[];e:{var J=N1.get(t);if(J!==void 0){var ee=Oc,we=t;switch(t){case"keypress":if(Lc(i)===0)break e;case"keydown":case"keyup":ee=uL;break;case"focusin":we="focus",ee=qh;break;case"focusout":we="blur",ee=qh;break;case"beforeblur":case"afterblur":ee=qh;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ee=a1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ee=JD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ee=hL;break;case S1:case C1:case j1:ee=tL;break;case E1:ee=pL;break;case"scroll":case"scrollend":ee=WD;break;case"wheel":ee=yL;break;case"copy":case"cut":case"paste":ee=aL;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ee=l1;break;case"toggle":case"beforetoggle":ee=xL}var Ae=(a&4)!==0,dt=!Ae&&(t==="scroll"||t==="scrollend"),Q=Ae?J!==null?J+"Capture":null:J;Ae=[];for(var Y=X,W;Y!==null;){var ie=Y;if(W=ie.stateNode,ie=ie.tag,ie!==5&&ie!==26&&ie!==27||W===null||Q===null||(ie=jo(Y,Q),ie!=null&&Ae.push(ls(Y,ie,W))),dt)break;Y=Y.return}0<Ae.length&&(J=new ee(J,we,null,i,ae),se.push({event:J,listeners:Ae}))}}if((a&7)===0){e:{if(J=t==="mouseover"||t==="pointerover",ee=t==="mouseout"||t==="pointerout",J&&i!==zh&&(we=i.relatedTarget||i.fromElement)&&(He(we)||we[$]))break e;if((ee||J)&&(J=ae.window===ae?ae:(J=ae.ownerDocument)?J.defaultView||J.parentWindow:window,ee?(we=i.relatedTarget||i.toElement,ee=X,we=we?He(we):null,we!==null&&(dt=u(we),Ae=we.tag,we!==dt||Ae!==5&&Ae!==27&&Ae!==6)&&(we=null)):(ee=null,we=X),ee!==we)){if(Ae=a1,ie="onMouseLeave",Q="onMouseEnter",Y="mouse",(t==="pointerout"||t==="pointerover")&&(Ae=l1,ie="onPointerLeave",Q="onPointerEnter",Y="pointer"),dt=ee==null?J:_n(ee),W=we==null?J:_n(we),J=new Ae(ie,Y+"leave",ee,i,ae),J.target=dt,J.relatedTarget=W,ie=null,He(ae)===X&&(Ae=new Ae(Q,Y+"enter",we,i,ae),Ae.target=W,Ae.relatedTarget=dt,ie=Ae),dt=ie,ee&&we)t:{for(Ae=bz,Q=ee,Y=we,W=0,ie=Q;ie;ie=Ae(ie))W++;ie=0;for(var Ee=Y;Ee;Ee=Ae(Ee))ie++;for(;0<W-ie;)Q=Ae(Q),W--;for(;0<ie-W;)Y=Ae(Y),ie--;for(;W--;){if(Q===Y||Y!==null&&Q===Y.alternate){Ae=Q;break t}Q=Ae(Q),Y=Ae(Y)}Ae=null}else Ae=null;ee!==null&&Ww(se,J,ee,Ae,!1),we!==null&&dt!==null&&Ww(se,dt,we,Ae,!0)}}e:{if(J=X?_n(X):window,ee=J.nodeName&&J.nodeName.toLowerCase(),ee==="select"||ee==="input"&&J.type==="file")var nt=h1;else if(d1(J))if(m1)nt=TL;else{nt=EL;var Ce=jL}else ee=J.nodeName,!ee||ee.toLowerCase()!=="input"||J.type!=="checkbox"&&J.type!=="radio"?X&&Lh(X.elementType)&&(nt=h1):nt=NL;if(nt&&(nt=nt(t,X))){f1(se,nt,i,ae);break e}Ce&&Ce(t,J,X),t==="focusout"&&X&&J.type==="number"&&X.memoizedProps.value!=null&&Dh(J,"number",J.value)}switch(Ce=X?_n(X):window,t){case"focusin":(d1(Ce)||Ce.contentEditable==="true")&&(ui=Ce,Vh=X,Lo=null);break;case"focusout":Lo=Vh=ui=null;break;case"mousedown":Qh=!0;break;case"contextmenu":case"mouseup":case"dragend":Qh=!1,w1(se,i,ae);break;case"selectionchange":if(ML)break;case"keydown":case"keyup":w1(se,i,ae)}var Be;if($h)e:{switch(t){case"compositionstart":var Ke="onCompositionStart";break e;case"compositionend":Ke="onCompositionEnd";break e;case"compositionupdate":Ke="onCompositionUpdate";break e}Ke=void 0}else ci?c1(t,i)&&(Ke="onCompositionEnd"):t==="keydown"&&i.keyCode===229&&(Ke="onCompositionStart");Ke&&(i1&&i.locale!=="ko"&&(ci||Ke!=="onCompositionStart"?Ke==="onCompositionEnd"&&ci&&(Be=t1()):(jr=ae,Ih="value"in jr?jr.value:jr.textContent,ci=!0)),Ce=ju(X,Ke),0<Ce.length&&(Ke=new r1(Ke,t,null,i,ae),se.push({event:Ke,listeners:Ce}),Be?Ke.data=Be:(Be=u1(i),Be!==null&&(Ke.data=Be)))),(Be=_L?wL(t,i):kL(t,i))&&(Ke=ju(X,"onBeforeInput"),0<Ke.length&&(Ce=new r1("onBeforeInput","beforeinput",null,i,ae),se.push({event:Ce,listeners:Ke}),Ce.data=Be)),mz(se,t,X,i,ae)}Vw(se,a)})}function ls(t,a,i){return{instance:t,listener:a,currentTarget:i}}function ju(t,a){for(var i=a+"Capture",d=[];t!==null;){var p=t,b=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||b===null||(p=jo(t,i),p!=null&&d.unshift(ls(t,p,b)),p=jo(t,a),p!=null&&d.push(ls(t,p,b))),t.tag===3)return d;t=t.return}return[]}function bz(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Ww(t,a,i,d,p){for(var b=a._reactName,k=[];i!==null&&i!==d;){var R=i,P=R.alternate,X=R.stateNode;if(R=R.tag,P!==null&&P===d)break;R!==5&&R!==26&&R!==27||X===null||(P=X,p?(X=jo(i,b),X!=null&&k.unshift(ls(i,X,P))):p||(X=jo(i,b),X!=null&&k.push(ls(i,X,P)))),i=i.return}k.length!==0&&t.push({event:a,listeners:k})}var xz=/\r\n?/g,vz=/\u0000|\uFFFD/g;function Xw(t){return(typeof t=="string"?t:""+t).replace(xz,`
`).replace(vz,"")}function Jw(t,a){return a=Xw(a),Xw(t)===a}function ut(t,a,i,d,p,b){switch(i){case"children":typeof d=="string"?a==="body"||a==="textarea"&&d===""||ii(t,d):(typeof d=="number"||typeof d=="bigint")&&a!=="body"&&ii(t,""+d);break;case"className":hl(t,"class",d);break;case"tabIndex":hl(t,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":hl(t,i,d);break;case"style":Jv(t,d,b);break;case"data":if(a!=="object"){hl(t,"data",d);break}case"src":case"href":if(d===""&&(a!=="a"||i!=="href")){t.removeAttribute(i);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){t.removeAttribute(i);break}d=Rc(""+d),t.setAttribute(i,d);break;case"action":case"formAction":if(typeof d=="function"){t.setAttribute(i,"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 b=="function"&&(i==="formAction"?(a!=="input"&&ut(t,a,"name",p.name,p,null),ut(t,a,"formEncType",p.formEncType,p,null),ut(t,a,"formMethod",p.formMethod,p,null),ut(t,a,"formTarget",p.formTarget,p,null)):(ut(t,a,"encType",p.encType,p,null),ut(t,a,"method",p.method,p,null),ut(t,a,"target",p.target,p,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){t.removeAttribute(i);break}d=Rc(""+d),t.setAttribute(i,d);break;case"onClick":d!=null&&(t.onclick=Va);break;case"onScroll":d!=null&&Pe("scroll",t);break;case"onScrollEnd":d!=null&&Pe("scrollend",t);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(l(61));if(i=d.__html,i!=null){if(p.children!=null)throw Error(l(60));t.innerHTML=i}}break;case"multiple":t.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":t.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){t.removeAttribute("xlink:href");break}i=Rc(""+d),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?t.setAttribute(i,""+d):t.removeAttribute(i);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":d&&typeof d!="function"&&typeof d!="symbol"?t.setAttribute(i,""):t.removeAttribute(i);break;case"capture":case"download":d===!0?t.setAttribute(i,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?t.setAttribute(i,d):t.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?t.setAttribute(i,d):t.removeAttribute(i);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?t.removeAttribute(i):t.setAttribute(i,d);break;case"popover":Pe("beforetoggle",t),Pe("toggle",t),On(t,"popover",d);break;case"xlinkActuate":Ka(t,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":Ka(t,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":Ka(t,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":Ka(t,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":Ka(t,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":Ka(t,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":Ka(t,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":Ka(t,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":Ka(t,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":On(t,"is",d);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=VD.get(i)||i,On(t,i,d))}}function vp(t,a,i,d,p,b){switch(i){case"style":Jv(t,d,b);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(l(61));if(i=d.__html,i!=null){if(p.children!=null)throw Error(l(60));t.innerHTML=i}}break;case"children":typeof d=="string"?ii(t,d):(typeof d=="number"||typeof d=="bigint")&&ii(t,""+d);break;case"onScroll":d!=null&&Pe("scroll",t);break;case"onScrollEnd":d!=null&&Pe("scrollend",t);break;case"onClick":d!=null&&(t.onclick=Va);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Co.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(p=i.endsWith("Capture"),a=i.slice(2,p?i.length-7:void 0),b=t[Wt]||null,b=b!=null?b[i]:null,typeof b=="function"&&t.removeEventListener(a,b,p),typeof d=="function")){typeof b!="function"&&b!==null&&(i in t?t[i]=null:t.hasAttribute(i)&&t.removeAttribute(i)),t.addEventListener(a,d,p);break e}i in t?t[i]=d:d===!0?t.setAttribute(i,""):On(t,i,d)}}}function en(t,a,i){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Pe("error",t),Pe("load",t);var d=!1,p=!1,b;for(b in i)if(i.hasOwnProperty(b)){var k=i[b];if(k!=null)switch(b){case"src":d=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,a));default:ut(t,a,b,k,i,null)}}p&&ut(t,a,"srcSet",i.srcSet,i,null),d&&ut(t,a,"src",i.src,i,null);return;case"input":Pe("invalid",t);var R=b=k=p=null,P=null,X=null;for(d in i)if(i.hasOwnProperty(d)){var ae=i[d];if(ae!=null)switch(d){case"name":p=ae;break;case"type":k=ae;break;case"checked":P=ae;break;case"defaultChecked":X=ae;break;case"value":b=ae;break;case"defaultValue":R=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(l(137,a));break;default:ut(t,a,d,ae,i,null)}}Vv(t,b,R,P,X,k,p,!1);return;case"select":Pe("invalid",t),d=k=b=null;for(p in i)if(i.hasOwnProperty(p)&&(R=i[p],R!=null))switch(p){case"value":b=R;break;case"defaultValue":k=R;break;case"multiple":d=R;default:ut(t,a,p,R,i,null)}a=b,i=k,t.multiple=!!d,a!=null?li(t,!!d,a,!1):i!=null&&li(t,!!d,i,!0);return;case"textarea":Pe("invalid",t),b=p=d=null;for(k in i)if(i.hasOwnProperty(k)&&(R=i[k],R!=null))switch(k){case"value":d=R;break;case"defaultValue":p=R;break;case"children":b=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(l(91));break;default:ut(t,a,k,R,i,null)}Wv(t,d,p,b);return;case"option":for(P in i)if(i.hasOwnProperty(P)&&(d=i[P],d!=null))switch(P){case"selected":t.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:ut(t,a,P,d,i,null)}return;case"dialog":Pe("beforetoggle",t),Pe("toggle",t),Pe("cancel",t),Pe("close",t);break;case"iframe":case"object":Pe("load",t);break;case"video":case"audio":for(d=0;d<rs.length;d++)Pe(rs[d],t);break;case"image":Pe("error",t),Pe("load",t);break;case"details":Pe("toggle",t);break;case"embed":case"source":case"link":Pe("error",t),Pe("load",t);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 i)if(i.hasOwnProperty(X)&&(d=i[X],d!=null))switch(X){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,a));default:ut(t,a,X,d,i,null)}return;default:if(Lh(a)){for(ae in i)i.hasOwnProperty(ae)&&(d=i[ae],d!==void 0&&vp(t,a,ae,d,i,void 0));return}}for(R in i)i.hasOwnProperty(R)&&(d=i[R],d!=null&&ut(t,a,R,d,i,null))}function _z(t,a,i,d){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,b=null,k=null,R=null,P=null,X=null,ae=null;for(ee in i){var se=i[ee];if(i.hasOwnProperty(ee)&&se!=null)switch(ee){case"checked":break;case"value":break;case"defaultValue":P=se;default:d.hasOwnProperty(ee)||ut(t,a,ee,null,d,se)}}for(var J in d){var ee=d[J];if(se=i[J],d.hasOwnProperty(J)&&(ee!=null||se!=null))switch(J){case"type":b=ee;break;case"name":p=ee;break;case"checked":X=ee;break;case"defaultChecked":ae=ee;break;case"value":k=ee;break;case"defaultValue":R=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(l(137,a));break;default:ee!==se&&ut(t,a,J,ee,d,se)}}Rh(t,k,R,P,X,ae,b,p);return;case"select":ee=k=R=J=null;for(b in i)if(P=i[b],i.hasOwnProperty(b)&&P!=null)switch(b){case"value":break;case"multiple":ee=P;default:d.hasOwnProperty(b)||ut(t,a,b,null,d,P)}for(p in d)if(b=d[p],P=i[p],d.hasOwnProperty(p)&&(b!=null||P!=null))switch(p){case"value":J=b;break;case"defaultValue":R=b;break;case"multiple":k=b;default:b!==P&&ut(t,a,p,b,d,P)}a=R,i=k,d=ee,J!=null?li(t,!!i,J,!1):!!d!=!!i&&(a!=null?li(t,!!i,a,!0):li(t,!!i,i?[]:"",!1));return;case"textarea":ee=J=null;for(R in i)if(p=i[R],i.hasOwnProperty(R)&&p!=null&&!d.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:ut(t,a,R,null,d,p)}for(k in d)if(p=d[k],b=i[k],d.hasOwnProperty(k)&&(p!=null||b!=null))switch(k){case"value":J=p;break;case"defaultValue":ee=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(l(91));break;default:p!==b&&ut(t,a,k,p,d,b)}Qv(t,J,ee);return;case"option":for(var we in i)if(J=i[we],i.hasOwnProperty(we)&&J!=null&&!d.hasOwnProperty(we))switch(we){case"selected":t.selected=!1;break;default:ut(t,a,we,null,d,J)}for(P in d)if(J=d[P],ee=i[P],d.hasOwnProperty(P)&&J!==ee&&(J!=null||ee!=null))switch(P){case"selected":t.selected=J&&typeof J!="function"&&typeof J!="symbol";break;default:ut(t,a,P,J,d,ee)}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 Ae in i)J=i[Ae],i.hasOwnProperty(Ae)&&J!=null&&!d.hasOwnProperty(Ae)&&ut(t,a,Ae,null,d,J);for(X in d)if(J=d[X],ee=i[X],d.hasOwnProperty(X)&&J!==ee&&(J!=null||ee!=null))switch(X){case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(l(137,a));break;default:ut(t,a,X,J,d,ee)}return;default:if(Lh(a)){for(var dt in i)J=i[dt],i.hasOwnProperty(dt)&&J!==void 0&&!d.hasOwnProperty(dt)&&vp(t,a,dt,void 0,d,J);for(ae in d)J=d[ae],ee=i[ae],!d.hasOwnProperty(ae)||J===ee||J===void 0&&ee===void 0||vp(t,a,ae,J,d,ee);return}}for(var Q in i)J=i[Q],i.hasOwnProperty(Q)&&J!=null&&!d.hasOwnProperty(Q)&&ut(t,a,Q,null,d,J);for(se in d)J=d[se],ee=i[se],!d.hasOwnProperty(se)||J===ee||J==null&&ee==null||ut(t,a,se,J,d,ee)}function Zw(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function wz(){if(typeof performance.getEntriesByType=="function"){for(var t=0,a=0,i=performance.getEntriesByType("resource"),d=0;d<i.length;d++){var p=i[d],b=p.transferSize,k=p.initiatorType,R=p.duration;if(b&&R&&Zw(k)){for(k=0,R=p.responseEnd,d+=1;d<i.length;d++){var P=i[d],X=P.startTime;if(X>R)break;var ae=P.transferSize,se=P.initiatorType;ae&&Zw(se)&&(P=P.responseEnd,k+=ae*(P<R?1:(R-X)/(P-X)))}if(--d,a+=8*(b+k)/(p.duration/1e3),t++,10<t)break}}if(0<t)return a/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var _p=null,wp=null;function Eu(t){return t.nodeType===9?t:t.ownerDocument}function e2(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function t2(t,a){if(t===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&a==="foreignObject"?0:t}function kp(t,a){return t==="textarea"||t==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var Sp=null;function kz(){var t=window.event;return t&&t.type==="popstate"?t===Sp?!1:(Sp=t,!0):(Sp=null,!1)}var n2=typeof setTimeout=="function"?setTimeout:void 0,Sz=typeof clearTimeout=="function"?clearTimeout:void 0,a2=typeof Promise=="function"?Promise:void 0,Cz=typeof queueMicrotask=="function"?queueMicrotask:typeof a2<"u"?function(t){return a2.resolve(null).then(t).catch(jz)}:n2;function jz(t){setTimeout(function(){throw t})}function Pr(t){return t==="head"}function r2(t,a){var i=a,d=0;do{var p=i.nextSibling;if(t.removeChild(i),p&&p.nodeType===8)if(i=p.data,i==="/$"||i==="/&"){if(d===0){t.removeChild(p),Bi(a);return}d--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")d++;else if(i==="html")is(t.ownerDocument.documentElement);else if(i==="head"){i=t.ownerDocument.head,is(i);for(var b=i.firstChild;b;){var k=b.nextSibling,R=b.nodeName;b[We]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&b.rel.toLowerCase()==="stylesheet"||i.removeChild(b),b=k}}else i==="body"&&is(t.ownerDocument.body);i=p}while(i);Bi(a)}function l2(t,a){var i=t;t=0;do{var d=i.nextSibling;if(i.nodeType===1?a?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(a?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),d&&d.nodeType===8)if(i=d.data,i==="/$"){if(t===0)break;t--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||t++;i=d}while(i)}function Cp(t){var a=t.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var i=a;switch(a=a.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Cp(i),Ft(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}t.removeChild(i)}}function Ez(t,a,i,d){for(;t.nodeType===1;){var p=i;if(t.nodeName.toLowerCase()!==a.toLowerCase()){if(!d&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(d){if(!t[We])switch(a){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(b=t.getAttribute("rel"),b==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(b!==p.rel||t.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||t.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||t.getAttribute("title")!==(p.title==null?null:p.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(b=t.getAttribute("src"),(b!==(p.src==null?null:p.src)||t.getAttribute("type")!==(p.type==null?null:p.type)||t.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&b&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(a==="input"&&t.type==="hidden"){var b=p.name==null?null:""+p.name;if(p.type==="hidden"&&t.getAttribute("name")===b)return t}else return t;if(t=ua(t.nextSibling),t===null)break}return null}function Nz(t,a,i){if(a==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=ua(t.nextSibling),t===null))return null;return t}function i2(t,a){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=ua(t.nextSibling),t===null))return null;return t}function jp(t){return t.data==="$?"||t.data==="$~"}function Ep(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function Tz(t,a){var i=t.ownerDocument;if(t.data==="$~")t._reactRetry=a;else if(t.data!=="$?"||i.readyState!=="loading")a();else{var d=function(){a(),i.removeEventListener("DOMContentLoaded",d)};i.addEventListener("DOMContentLoaded",d),t._reactRetry=d}}function ua(t){for(;t!=null;t=t.nextSibling){var a=t.nodeType;if(a===1||a===3)break;if(a===8){if(a=t.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return t}var Np=null;function o2(t){t=t.nextSibling;for(var a=0;t;){if(t.nodeType===8){var i=t.data;if(i==="/$"||i==="/&"){if(a===0)return ua(t.nextSibling);a--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||a++}t=t.nextSibling}return null}function s2(t){t=t.previousSibling;for(var a=0;t;){if(t.nodeType===8){var i=t.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(a===0)return t;a--}else i!=="/$"&&i!=="/&"||a++}t=t.previousSibling}return null}function c2(t,a,i){switch(a=Eu(i),t){case"html":if(t=a.documentElement,!t)throw Error(l(452));return t;case"head":if(t=a.head,!t)throw Error(l(453));return t;case"body":if(t=a.body,!t)throw Error(l(454));return t;default:throw Error(l(451))}}function is(t){for(var a=t.attributes;a.length;)t.removeAttributeNode(a[0]);Ft(t)}var da=new Map,u2=new Set;function Nu(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var ur=le.d;le.d={f:Az,r:Mz,D:Rz,C:Dz,L:Lz,m:zz,X:Bz,S:Oz,M:Fz};function Az(){var t=ur.f(),a=xu();return t||a}function Mz(t){var a=vn(t);a!==null&&a.tag===5&&a.type==="form"?E_(a):ur.r(t)}var Li=typeof document>"u"?null:document;function d2(t,a,i){var d=Li;if(d&&typeof a=="string"&&a){var p=aa(a);p='link[rel="'+t+'"][href="'+p+'"]',typeof i=="string"&&(p+='[crossorigin="'+i+'"]'),u2.has(p)||(u2.add(p),t={rel:t,crossOrigin:i,href:a},d.querySelector(p)===null&&(a=d.createElement("link"),en(a,"link",t),Ct(a),d.head.appendChild(a)))}}function Rz(t){ur.D(t),d2("dns-prefetch",t,null)}function Dz(t,a){ur.C(t,a),d2("preconnect",t,a)}function Lz(t,a,i){ur.L(t,a,i);var d=Li;if(d&&t&&a){var p='link[rel="preload"][as="'+aa(a)+'"]';a==="image"&&i&&i.imageSrcSet?(p+='[imagesrcset="'+aa(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(p+='[imagesizes="'+aa(i.imageSizes)+'"]')):p+='[href="'+aa(t)+'"]';var b=p;switch(a){case"style":b=zi(t);break;case"script":b=Oi(t)}da.has(b)||(t=g({rel:"preload",href:a==="image"&&i&&i.imageSrcSet?void 0:t,as:a},i),da.set(b,t),d.querySelector(p)!==null||a==="style"&&d.querySelector(os(b))||a==="script"&&d.querySelector(ss(b))||(a=d.createElement("link"),en(a,"link",t),Ct(a),d.head.appendChild(a)))}}function zz(t,a){ur.m(t,a);var i=Li;if(i&&t){var d=a&&typeof a.as=="string"?a.as:"script",p='link[rel="modulepreload"][as="'+aa(d)+'"][href="'+aa(t)+'"]',b=p;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=Oi(t)}if(!da.has(b)&&(t=g({rel:"modulepreload",href:t},a),da.set(b,t),i.querySelector(p)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(ss(b)))return}d=i.createElement("link"),en(d,"link",t),Ct(d),i.head.appendChild(d)}}}function Oz(t,a,i){ur.S(t,a,i);var d=Li;if(d&&t){var p=ta(d).hoistableStyles,b=zi(t);a=a||"default";var k=p.get(b);if(!k){var R={loading:0,preload:null};if(k=d.querySelector(os(b)))R.loading=5;else{t=g({rel:"stylesheet",href:t,"data-precedence":a},i),(i=da.get(b))&&Tp(t,i);var P=k=d.createElement("link");Ct(P),en(P,"link",t),P._p=new Promise(function(X,ae){P.onload=X,P.onerror=ae}),P.addEventListener("load",function(){R.loading|=1}),P.addEventListener("error",function(){R.loading|=2}),R.loading|=4,Tu(k,a,d)}k={type:"stylesheet",instance:k,count:1,state:R},p.set(b,k)}}}function Bz(t,a){ur.X(t,a);var i=Li;if(i&&t){var d=ta(i).hoistableScripts,p=Oi(t),b=d.get(p);b||(b=i.querySelector(ss(p)),b||(t=g({src:t,async:!0},a),(a=da.get(p))&&Ap(t,a),b=i.createElement("script"),Ct(b),en(b,"link",t),i.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},d.set(p,b))}}function Fz(t,a){ur.M(t,a);var i=Li;if(i&&t){var d=ta(i).hoistableScripts,p=Oi(t),b=d.get(p);b||(b=i.querySelector(ss(p)),b||(t=g({src:t,async:!0,type:"module"},a),(a=da.get(p))&&Ap(t,a),b=i.createElement("script"),Ct(b),en(b,"link",t),i.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},d.set(p,b))}}function f2(t,a,i,d){var p=(p=ve.current)?Nu(p):null;if(!p)throw Error(l(446));switch(t){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(a=zi(i.href),i=ta(p).hoistableStyles,d=i.get(a),d||(d={type:"style",instance:null,count:0,state:null},i.set(a,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){t=zi(i.href);var b=ta(p).hoistableStyles,k=b.get(t);if(k||(p=p.ownerDocument||p,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(t,k),(b=p.querySelector(os(t)))&&!b._p&&(k.instance=b,k.state.loading=5),da.has(t)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},da.set(t,i),b||Iz(p,t,i,k.state))),a&&d===null)throw Error(l(528,""));return k}if(a&&d!==null)throw Error(l(529,""));return null;case"script":return a=i.async,i=i.src,typeof i=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=Oi(i),i=ta(p).hoistableScripts,d=i.get(a),d||(d={type:"script",instance:null,count:0,state:null},i.set(a,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,t))}}function zi(t){return'href="'+aa(t)+'"'}function os(t){return'link[rel="stylesheet"]['+t+"]"}function h2(t){return g({},t,{"data-precedence":t.precedence,precedence:null})}function Iz(t,a,i,d){t.querySelector('link[rel="preload"][as="style"]['+a+"]")?d.loading=1:(a=t.createElement("link"),d.preload=a,a.addEventListener("load",function(){return d.loading|=1}),a.addEventListener("error",function(){return d.loading|=2}),en(a,"link",i),Ct(a),t.head.appendChild(a))}function Oi(t){return'[src="'+aa(t)+'"]'}function ss(t){return"script[async]"+t}function m2(t,a,i){if(a.count++,a.instance===null)switch(a.type){case"style":var d=t.querySelector('style[data-href~="'+aa(i.href)+'"]');if(d)return a.instance=d,Ct(d),d;var p=g({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return d=(t.ownerDocument||t).createElement("style"),Ct(d),en(d,"style",p),Tu(d,i.precedence,t),a.instance=d;case"stylesheet":p=zi(i.href);var b=t.querySelector(os(p));if(b)return a.state.loading|=4,a.instance=b,Ct(b),b;d=h2(i),(p=da.get(p))&&Tp(d,p),b=(t.ownerDocument||t).createElement("link"),Ct(b);var k=b;return k._p=new Promise(function(R,P){k.onload=R,k.onerror=P}),en(b,"link",d),a.state.loading|=4,Tu(b,i.precedence,t),a.instance=b;case"script":return b=Oi(i.src),(p=t.querySelector(ss(b)))?(a.instance=p,Ct(p),p):(d=i,(p=da.get(b))&&(d=g({},i),Ap(d,p)),t=t.ownerDocument||t,p=t.createElement("script"),Ct(p),en(p,"link",d),t.head.appendChild(p),a.instance=p);case"void":return null;default:throw Error(l(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(d=a.instance,a.state.loading|=4,Tu(d,i.precedence,t));return a.instance}function Tu(t,a,i){for(var d=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=d.length?d[d.length-1]:null,b=p,k=0;k<d.length;k++){var R=d[k];if(R.dataset.precedence===a)b=R;else if(b!==p)break}b?b.parentNode.insertBefore(t,b.nextSibling):(a=i.nodeType===9?i.head:i,a.insertBefore(t,a.firstChild))}function Tp(t,a){t.crossOrigin==null&&(t.crossOrigin=a.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=a.referrerPolicy),t.title==null&&(t.title=a.title)}function Ap(t,a){t.crossOrigin==null&&(t.crossOrigin=a.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=a.referrerPolicy),t.integrity==null&&(t.integrity=a.integrity)}var Au=null;function p2(t,a,i){if(Au===null){var d=new Map,p=Au=new Map;p.set(i,d)}else p=Au,d=p.get(i),d||(d=new Map,p.set(i,d));if(d.has(t))return d;for(d.set(t,null),i=i.getElementsByTagName(t),p=0;p<i.length;p++){var b=i[p];if(!(b[We]||b[Bt]||t==="link"&&b.getAttribute("rel")==="stylesheet")&&b.namespaceURI!=="http://www.w3.org/2000/svg"){var k=b.getAttribute(a)||"";k=t+k;var R=d.get(k);R?R.push(b):d.set(k,[b])}}return d}function g2(t,a,i){t=t.ownerDocument||t,t.head.insertBefore(i,a==="title"?t.querySelector("head > title"):null)}function Uz(t,a,i){if(i===1||a.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return t=a.disabled,typeof a.precedence=="string"&&t==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function y2(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Hz(t,a,i,d){if(i.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var p=zi(d.href),b=a.querySelector(os(p));if(b){a=b._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(t.count++,t=Mu.bind(t),a.then(t,t)),i.state.loading|=4,i.instance=b,Ct(b);return}b=a.ownerDocument||a,d=h2(d),(p=da.get(p))&&Tp(d,p),b=b.createElement("link"),Ct(b);var k=b;k._p=new Promise(function(R,P){k.onload=R,k.onerror=P}),en(b,"link",d),i.instance=b}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(i,a),(a=i.state.preload)&&(i.state.loading&3)===0&&(t.count++,i=Mu.bind(t),a.addEventListener("load",i),a.addEventListener("error",i))}}var Mp=0;function qz(t,a){return t.stylesheets&&t.count===0&&Du(t,t.stylesheets),0<t.count||0<t.imgCount?function(i){var d=setTimeout(function(){if(t.stylesheets&&Du(t,t.stylesheets),t.unsuspend){var b=t.unsuspend;t.unsuspend=null,b()}},6e4+a);0<t.imgBytes&&Mp===0&&(Mp=62500*wz());var p=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Du(t,t.stylesheets),t.unsuspend)){var b=t.unsuspend;t.unsuspend=null,b()}},(t.imgBytes>Mp?50:800)+a);return t.unsuspend=i,function(){t.unsuspend=null,clearTimeout(d),clearTimeout(p)}}:null}function Mu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Du(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Ru=null;function Du(t,a){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Ru=new Map,a.forEach(Pz,t),Ru=null,Mu.call(t))}function Pz(t,a){if(!(a.state.loading&4)){var i=Ru.get(t);if(i)var d=i.get(null);else{i=new Map,Ru.set(t,i);for(var p=t.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b<p.length;b++){var k=p[b];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(i.set(k.dataset.precedence,k),d=k)}d&&i.set(null,d)}p=a.instance,k=p.getAttribute("data-precedence"),b=i.get(k)||d,b===d&&i.set(null,p),i.set(k,p),this.count++,d=Mu.bind(this),p.addEventListener("load",d),p.addEventListener("error",d),b?b.parentNode.insertBefore(p,b.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(p,t.firstChild)),a.state.loading|=4}}var cs={$$typeof:N,Provider:null,Consumer:null,_currentValue:me,_currentValue2:me,_threadCount:0};function $z(t,a,i,d,p,b,k,R,P){this.tag=1,this.containerInfo=t,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=Ya(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ya(0),this.hiddenUpdates=Ya(null),this.identifierPrefix=d,this.onUncaughtError=p,this.onCaughtError=b,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=P,this.incompleteTransitions=new Map}function b2(t,a,i,d,p,b,k,R,P,X,ae,se){return t=new $z(t,a,i,k,P,X,ae,se,R),a=1,b===!0&&(a|=24),b=Fn(3,null,null,a),t.current=b,b.stateNode=t,a=um(),a.refCount++,t.pooledCache=a,a.refCount++,b.memoizedState={element:d,isDehydrated:i,cache:a},mm(b),t}function x2(t){return t?(t=hi,t):hi}function v2(t,a,i,d,p,b){p=x2(p),d.context===null?d.context=p:d.pendingContext=p,d=Rr(a),d.payload={element:i},b=b===void 0?null:b,b!==null&&(d.callback=b),i=Dr(t,d,a),i!==null&&(En(i,t,a),Ho(i,t,a))}function _2(t,a){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var i=t.retryLane;t.retryLane=i!==0&&i<a?i:a}}function Rp(t,a){_2(t,a),(t=t.alternate)&&_2(t,a)}function w2(t){if(t.tag===13||t.tag===31){var a=yl(t,67108864);a!==null&&En(a,t,67108864),Rp(t,67108864)}}function k2(t){if(t.tag===13||t.tag===31){var a=Pn();a=Qe(a);var i=yl(t,a);i!==null&&En(i,t,a),Rp(t,a)}}var Lu=!0;function Yz(t,a,i,d){var p=V.T;V.T=null;var b=le.p;try{le.p=2,Dp(t,a,i,d)}finally{le.p=b,V.T=p}}function Gz(t,a,i,d){var p=V.T;V.T=null;var b=le.p;try{le.p=8,Dp(t,a,i,d)}finally{le.p=b,V.T=p}}function Dp(t,a,i,d){if(Lu){var p=Lp(d);if(p===null)xp(t,a,d,zu,i),C2(t,d);else if(Vz(p,t,a,i,d))d.stopPropagation();else if(C2(t,d),a&4&&-1<Kz.indexOf(t)){for(;p!==null;){var b=vn(p);if(b!==null)switch(b.tag){case 3:if(b=b.stateNode,b.current.memoizedState.isDehydrated){var k=Et(b.pendingLanes);if(k!==0){var R=b;for(R.pendingLanes|=2,R.entangledLanes|=2;k;){var P=1<<31-Ie(k);R.entanglements[1]|=P,k&=~P}Ba(b),(rt&6)===0&&(yu=tt()+500,as(0))}}break;case 31:case 13:R=yl(b,2),R!==null&&En(R,b,2),xu(),Rp(b,2)}if(b=Lp(d),b===null&&xp(t,a,d,zu,i),b===p)break;p=b}p!==null&&d.stopPropagation()}else xp(t,a,d,null,i)}}function Lp(t){return t=Oh(t),zp(t)}var zu=null;function zp(t){if(zu=null,t=He(t),t!==null){var a=u(t);if(a===null)t=null;else{var i=a.tag;if(i===13){if(t=c(a),t!==null)return t;t=null}else if(i===31){if(t=f(a),t!==null)return t;t=null}else if(i===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;t=null}else a!==t&&(t=null)}}return zu=t,null}function S2(t){switch(t){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(xn()){case te:return 2;case pe:return 8;case je:case Re:return 32;case de:return 268435456;default:return 32}default:return 32}}var Op=!1,$r=null,Yr=null,Gr=null,us=new Map,ds=new Map,Kr=[],Kz="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 C2(t,a){switch(t){case"focusin":case"focusout":$r=null;break;case"dragenter":case"dragleave":Yr=null;break;case"mouseover":case"mouseout":Gr=null;break;case"pointerover":case"pointerout":us.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":ds.delete(a.pointerId)}}function fs(t,a,i,d,p,b){return t===null||t.nativeEvent!==b?(t={blockedOn:a,domEventName:i,eventSystemFlags:d,nativeEvent:b,targetContainers:[p]},a!==null&&(a=vn(a),a!==null&&w2(a)),t):(t.eventSystemFlags|=d,a=t.targetContainers,p!==null&&a.indexOf(p)===-1&&a.push(p),t)}function Vz(t,a,i,d,p){switch(a){case"focusin":return $r=fs($r,t,a,i,d,p),!0;case"dragenter":return Yr=fs(Yr,t,a,i,d,p),!0;case"mouseover":return Gr=fs(Gr,t,a,i,d,p),!0;case"pointerover":var b=p.pointerId;return us.set(b,fs(us.get(b)||null,t,a,i,d,p)),!0;case"gotpointercapture":return b=p.pointerId,ds.set(b,fs(ds.get(b)||null,t,a,i,d,p)),!0}return!1}function j2(t){var a=He(t.target);if(a!==null){var i=u(a);if(i!==null){if(a=i.tag,a===13){if(a=c(i),a!==null){t.blockedOn=a,ko(t.priority,function(){k2(i)});return}}else if(a===31){if(a=f(i),a!==null){t.blockedOn=a,ko(t.priority,function(){k2(i)});return}}else if(a===3&&i.stateNode.current.memoizedState.isDehydrated){t.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Ou(t){if(t.blockedOn!==null)return!1;for(var a=t.targetContainers;0<a.length;){var i=Lp(t.nativeEvent);if(i===null){i=t.nativeEvent;var d=new i.constructor(i.type,i);zh=d,i.target.dispatchEvent(d),zh=null}else return a=vn(i),a!==null&&w2(a),t.blockedOn=i,!1;a.shift()}return!0}function E2(t,a,i){Ou(t)&&i.delete(a)}function Qz(){Op=!1,$r!==null&&Ou($r)&&($r=null),Yr!==null&&Ou(Yr)&&(Yr=null),Gr!==null&&Ou(Gr)&&(Gr=null),us.forEach(E2),ds.forEach(E2)}function Bu(t,a){t.blockedOn===a&&(t.blockedOn=null,Op||(Op=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Qz)))}var Fu=null;function N2(t){Fu!==t&&(Fu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Fu===t&&(Fu=null);for(var a=0;a<t.length;a+=3){var i=t[a],d=t[a+1],p=t[a+2];if(typeof d!="function"){if(zp(d||i)===null)continue;break}var b=vn(i);b!==null&&(t.splice(a,3),a-=3,Lm(b,{pending:!0,data:p,method:i.method,action:d},d,p))}}))}function Bi(t){function a(P){return Bu(P,t)}$r!==null&&Bu($r,t),Yr!==null&&Bu(Yr,t),Gr!==null&&Bu(Gr,t),us.forEach(a),ds.forEach(a);for(var i=0;i<Kr.length;i++){var d=Kr[i];d.blockedOn===t&&(d.blockedOn=null)}for(;0<Kr.length&&(i=Kr[0],i.blockedOn===null);)j2(i),i.blockedOn===null&&Kr.shift();if(i=(t.ownerDocument||t).$$reactFormReplay,i!=null)for(d=0;d<i.length;d+=3){var p=i[d],b=i[d+1],k=p[Wt]||null;if(typeof b=="function")k||N2(i);else if(k){var R=null;if(b&&b.hasAttribute("formAction")){if(p=b,k=b[Wt]||null)R=k.formAction;else if(zp(p)!==null)continue}else R=k.action;typeof R=="function"?i[d+1]=R:(i.splice(d,3),d-=3),N2(i)}}}function T2(){function t(b){b.canIntercept&&b.info==="react-transition"&&b.intercept({handler:function(){return new Promise(function(k){return p=k})},focusReset:"manual",scroll:"manual"})}function a(){p!==null&&(p(),p=null),d||setTimeout(i,20)}function i(){if(!d&&!navigation.transition){var b=navigation.currentEntry;b&&b.url!=null&&navigation.navigate(b.url,{state:b.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,p=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(i,100),function(){d=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),p!==null&&(p(),p=null)}}}function Bp(t){this._internalRoot=t}Iu.prototype.render=Bp.prototype.render=function(t){var a=this._internalRoot;if(a===null)throw Error(l(409));var i=a.current,d=Pn();v2(i,d,t,a,null,null)},Iu.prototype.unmount=Bp.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var a=t.containerInfo;v2(t.current,2,null,t,null,null),xu(),a[$]=null}};function Iu(t){this._internalRoot=t}Iu.prototype.unstable_scheduleHydration=function(t){if(t){var a=fl();t={blockedOn:null,target:t,priority:a};for(var i=0;i<Kr.length&&a!==0&&a<Kr[i].priority;i++);Kr.splice(i,0,t),i===0&&j2(t)}};var A2=n.version;if(A2!=="19.2.4")throw Error(l(527,A2,"19.2.4"));le.findDOMNode=function(t){var a=t._reactInternals;if(a===void 0)throw typeof t.render=="function"?Error(l(188)):(t=Object.keys(t).join(","),Error(l(268,t)));return t=m(a),t=t!==null?y(t):null,t=t===null?null:t.stateNode,t};var Wz={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Uu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Uu.isDisabled&&Uu.supportsFiber)try{bt=Uu.inject(Wz),it=Uu}catch{}}return Ii.createRoot=function(t,a){if(!o(t))throw Error(l(299));var i=!1,d="",p=B_,b=F_,k=I_;return a!=null&&(a.unstable_strictMode===!0&&(i=!0),a.identifierPrefix!==void 0&&(d=a.identifierPrefix),a.onUncaughtError!==void 0&&(p=a.onUncaughtError),a.onCaughtError!==void 0&&(b=a.onCaughtError),a.onRecoverableError!==void 0&&(k=a.onRecoverableError)),a=b2(t,1,!1,null,null,i,d,null,p,b,k,T2),t[$]=a.current,bp(t),new Bp(a)},Ii.hydrateRoot=function(t,a,i){if(!o(t))throw Error(l(299));var d=!1,p="",b=B_,k=F_,R=I_,P=null;return i!=null&&(i.unstable_strictMode===!0&&(d=!0),i.identifierPrefix!==void 0&&(p=i.identifierPrefix),i.onUncaughtError!==void 0&&(b=i.onUncaughtError),i.onCaughtError!==void 0&&(k=i.onCaughtError),i.onRecoverableError!==void 0&&(R=i.onRecoverableError),i.formState!==void 0&&(P=i.formState)),a=b2(t,1,!0,a,i!=null?i:null,d,p,P,b,k,R,T2),a.context=x2(null),i=a.current,d=Pn(),d=Qe(d),p=Rr(d),p.callback=null,Dr(i,p,d),i=d,a.current.lanes=i,xa(a,i),Ba(a),t[$]=a.current,bp(t),new Iu(a)},Ii.version="19.2.4",Ii}var Qp;function H2(){if(Qp)return $u.exports;Qp=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(n){console.error(n)}}return e(),$u.exports=U2(),$u.exports}var q2=H2();const Wp=gt(q2);/**
 * react-router v7.13.0
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */var Xp="popstate";function P2(e={}){let{initialEntries:n=["/"],initialIndex:r,v5Compat:l=!1}=e,o;o=n.map((v,w)=>y(v,typeof v=="string"?null:v.state,w===0?"default":void 0));let u=h(r==null?o.length-1:r),c="POP",f=null;function h(v){return Math.min(Math.max(v,0),o.length-1)}function m(){return o[u]}function y(v,w=null,j){let T=hs(o?m().pathname:"/",v,w,j);return Nn(T.pathname.charAt(0)==="/",`relative pathnames are not supported in memory history: ${JSON.stringify(v)}`),T}function g(v){return typeof v=="string"?v:Al(v)}return{get index(){return u},get action(){return c},get location(){return m()},createHref:g,createURL(v){return new URL(g(v),"http://localhost")},encodeLocation(v){let w=typeof v=="string"?Qr(v):v;return{pathname:w.pathname||"",search:w.search||"",hash:w.hash||""}},push(v,w){c="PUSH";let j=y(v,w);u+=1,o.splice(u,o.length,j),l&&f&&f({action:c,location:j,delta:1})},replace(v,w){c="REPLACE";let j=y(v,w);o[u]=j,l&&f&&f({action:c,location:j,delta:0})},go(v){c="POP";let w=h(u+v),j=o[w];u=w,f&&f({action:c,location:j,delta:v})},listen(v){return f=v,()=>{f=null}}}}function $2(e={}){function n(l,o){let{pathname:u,search:c,hash:f}=l.location;return hs("",{pathname:u,search:c,hash:f},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function r(l,o){return typeof o=="string"?o:Al(o)}return G2(n,r,null,e)}function kt(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function Nn(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function Y2(){return Math.random().toString(36).substring(2,10)}function Jp(e,n){return{usr:e.state,key:e.key,idx:n}}function hs(e,n,r=null,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?Qr(n):n,state:r,key:n&&n.key||l||Y2()}}function Al({pathname:e="/",search:n="",hash:r=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Qr(e){let n={};if(e){let r=e.indexOf("#");r>=0&&(n.hash=e.substring(r),e=e.substring(0,r));let l=e.indexOf("?");l>=0&&(n.search=e.substring(l),e=e.substring(0,l)),e&&(n.pathname=e)}return n}function G2(e,n,r,l={}){let{window:o=document.defaultView,v5Compat:u=!1}=l,c=o.history,f="POP",h=null,m=y();m==null&&(m=0,c.replaceState({...c.state,idx:m},""));function y(){return(c.state||{idx:null}).idx}function g(){f="POP";let T=y(),C=T==null?null:T-m;m=T,h&&h({action:f,location:j.location,delta:C})}function _(T,C){f="PUSH";let E=hs(j.location,T,C);m=y()+1;let N=Jp(E,m),D=j.createHref(E);try{c.pushState(N,"",D)}catch(F){if(F instanceof DOMException&&F.name==="DataCloneError")throw F;o.location.assign(D)}u&&h&&h({action:f,location:j.location,delta:1})}function v(T,C){f="REPLACE";let E=hs(j.location,T,C);m=y();let N=Jp(E,m),D=j.createHref(E);c.replaceState(N,"",D),u&&h&&h({action:f,location:j.location,delta:0})}function w(T){return K2(T)}let j={get action(){return f},get location(){return e(o,c)},listen(T){if(h)throw new Error("A history only accepts one active listener");return o.addEventListener(Xp,g),h=T,()=>{o.removeEventListener(Xp,g),h=null}},createHref(T){return n(o,T)},createURL:w,encodeLocation(T){let C=w(T);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:_,replace:v,go(T){return c.go(T)}};return j}function K2(e,n=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),kt(r,"No window.location.(origin|href) available to create URL");let l=typeof e=="string"?e:Al(e);return l=l.replace(/ $/,"%20"),!n&&l.startsWith("//")&&(l=r+l),new URL(l,r)}function Zp(e,n,r="/"){return V2(e,n,r,!1)}function V2(e,n,r,l){let o=typeof n=="string"?Qr(n):n,u=Ia(o.pathname||"/",r);if(u==null)return null;let c=eg(e);Q2(c);let f=null;for(let h=0;f==null&&h<c.length;++h){let m=ik(u);f=rk(c[h],m,l)}return f}function eg(e,n=[],r=[],l="",o=!1){let u=(c,f,h=o,m)=>{let y={relativePath:m===void 0?c.path||"":m,caseSensitive:c.caseSensitive===!0,childrenIndex:f,route:c};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(l)&&h)return;kt(y.relativePath.startsWith(l),`Absolute route path "${y.relativePath}" nested under path "${l}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(l.length)}let g=Ua([l,y.relativePath]),_=r.concat(y);c.children&&c.children.length>0&&(kt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),eg(c.children,n,_,g,h)),!(c.path==null&&!c.index)&&n.push({path:g,score:nk(g,c.index),routesMeta:_})};return e.forEach((c,f)=>{var h;if(c.path===""||!((h=c.path)!=null&&h.includes("?")))u(c,f);else for(let m of tg(c.path))u(c,f,!0,m)}),n}function tg(e){let n=e.split("/");if(n.length===0)return[];let[r,...l]=n,o=r.endsWith("?"),u=r.replace(/\?$/,"");if(l.length===0)return o?[u,""]:[u];let c=tg(l.join("/")),f=[];return f.push(...c.map(h=>h===""?u:[u,h].join("/"))),o&&f.push(...c),f.map(h=>e.startsWith("/")&&h===""?"/":h)}function Q2(e){e.sort((n,r)=>n.score!==r.score?r.score-n.score:ak(n.routesMeta.map(l=>l.childrenIndex),r.routesMeta.map(l=>l.childrenIndex)))}var W2=/^:[\w-]+$/,X2=3,J2=2,Z2=1,ek=10,tk=-2,ng=e=>e==="*";function nk(e,n){let r=e.split("/"),l=r.length;return r.some(ng)&&(l+=tk),n&&(l+=J2),r.filter(o=>!ng(o)).reduce((o,u)=>o+(W2.test(u)?X2:u===""?Z2:ek),l)}function ak(e,n){return e.length===n.length&&e.slice(0,-1).every((l,o)=>l===n[o])?e[e.length-1]-n[n.length-1]:0}function rk(e,n,r=!1){let{routesMeta:l}=e,o={},u="/",c=[];for(let f=0;f<l.length;++f){let h=l[f],m=f===l.length-1,y=u==="/"?n:n.slice(u.length)||"/",g=ms({path:h.relativePath,caseSensitive:h.caseSensitive,end:m},y),_=h.route;if(!g&&m&&r&&!l[l.length-1].route.index&&(g=ms({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},y)),!g)return null;Object.assign(o,g.params),c.push({params:o,pathname:Ua([u,g.pathname]),pathnameBase:uk(Ua([u,g.pathnameBase])),route:_}),g.pathnameBase!=="/"&&(u=Ua([u,g.pathnameBase]))}return c}function ms(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,l]=lk(e.path,e.caseSensitive,e.end),o=n.match(r);if(!o)return null;let u=o[0],c=u.replace(/(.)\/+$/,"$1"),f=o.slice(1);return{params:l.reduce((m,{paramName:y,isOptional:g},_)=>{if(y==="*"){let w=f[_]||"";c=u.slice(0,u.length-w.length).replace(/(.)\/+$/,"$1")}const v=f[_];return g&&!v?m[y]=void 0:m[y]=(v||"").replace(/%2F/g,"/"),m},{}),pathname:u,pathnameBase:c,pattern:e}}function lk(e,n=!1,r=!0){Nn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let l=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,f,h)=>(l.push({paramName:f,isOptional:h!=null}),h?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(l.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,n?void 0:"i"),l]}function ik(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Nn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),e}}function Ia(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let r=n.endsWith("/")?n.length-1:n.length,l=e.charAt(r);return l&&l!=="/"?null:e.slice(r)||"/"}var ok=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function sk(e,n="/"){let{pathname:r,search:l="",hash:o=""}=typeof e=="string"?Qr(e):e,u;return r?(r=r.replace(/\/\/+/g,"/"),r.startsWith("/")?u=ag(r.substring(1),"/"):u=ag(r,n)):u=n,{pathname:u,search:dk(l),hash:fk(o)}}function ag(e,n){let r=n.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function Vu(e,n,r,l){return`Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(l)}].  Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function ck(e){return e.filter((n,r)=>r===0||n.route.path&&n.route.path.length>0)}function Qu(e){let n=ck(e);return n.map((r,l)=>l===n.length-1?r.pathname:r.pathnameBase)}function Wu(e,n,r,l=!1){let o;typeof e=="string"?o=Qr(e):(o={...e},kt(!o.pathname||!o.pathname.includes("?"),Vu("?","pathname","search",o)),kt(!o.pathname||!o.pathname.includes("#"),Vu("#","pathname","hash",o)),kt(!o.search||!o.search.includes("#"),Vu("#","search","hash",o)));let u=e===""||o.pathname==="",c=u?"/":o.pathname,f;if(c==null)f=r;else{let g=n.length-1;if(!l&&c.startsWith("..")){let _=c.split("/");for(;_[0]==="..";)_.shift(),g-=1;o.pathname=_.join("/")}f=g>=0?n[g]:"/"}let h=sk(o,f),m=c&&c!=="/"&&c.endsWith("/"),y=(u||c===".")&&r.endsWith("/");return!h.pathname.endsWith("/")&&(m||y)&&(h.pathname+="/"),h}var Ua=e=>e.join("/").replace(/\/\/+/g,"/"),uk=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),dk=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,fk=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,hk=class{constructor(e,n,r,l=!1){this.status=e,this.statusText=n||"",this.internal=l,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function mk(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function pk(e){return e.map(n=>n.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var rg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function lg(e,n){let r=e;if(typeof r!="string"||!ok.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let l=r,o=!1;if(rg)try{let u=new URL(window.location.href),c=r.startsWith("//")?new URL(u.protocol+r):new URL(r),f=Ia(c.pathname,n);c.origin===u.origin&&f!=null?r=f+c.search+c.hash:o=!0}catch{Nn(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:l,isExternal:o,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var ig=["POST","PUT","PATCH","DELETE"];new Set(ig);var gk=["GET",...ig];new Set(gk);var Ml=x.createContext(null);Ml.displayName="DataRouter";var ps=x.createContext(null);ps.displayName="DataRouterState";var yk=x.createContext(!1),og=x.createContext({isTransitioning:!1});og.displayName="ViewTransition";var bk=x.createContext(new Map);bk.displayName="Fetchers";var xk=x.createContext(null);xk.displayName="Await";var Tn=x.createContext(null);Tn.displayName="Navigation";var Ui=x.createContext(null);Ui.displayName="Location";var fa=x.createContext({outlet:null,matches:[],isDataRoute:!1});fa.displayName="Route";var Xu=x.createContext(null);Xu.displayName="RouteError";var sg="REACT_ROUTER_ERROR",vk="REDIRECT",_k="ROUTE_ERROR_RESPONSE";function wk(e){if(e.startsWith(`${sg}:${vk}:{`))try{let n=JSON.parse(e.slice(28));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.location=="string"&&typeof n.reloadDocument=="boolean"&&typeof n.replace=="boolean")return n}catch{}}function kk(e){if(e.startsWith(`${sg}:${_k}:{`))try{let n=JSON.parse(e.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new hk(n.status,n.statusText,n.data)}catch{}}function Sk(e,{relative:n}={}){kt(Rl(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:l}=x.useContext(Tn),{hash:o,pathname:u,search:c}=Hi(e,{relative:n}),f=u;return r!=="/"&&(f=u==="/"?r:Ua([r,u])),l.createHref({pathname:f,search:c,hash:o})}function Rl(){return x.useContext(Ui)!=null}function $n(){return kt(Rl(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(Ui).location}var cg="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ug(e){x.useContext(Tn).static||x.useLayoutEffect(e)}function Wr(){let{isDataRoute:e}=x.useContext(fa);return e?Ik():Ck()}function Ck(){kt(Rl(),"useNavigate() may be used only in the context of a <Router> component.");let e=x.useContext(Ml),{basename:n,navigator:r}=x.useContext(Tn),{matches:l}=x.useContext(fa),{pathname:o}=$n(),u=JSON.stringify(Qu(l)),c=x.useRef(!1);return ug(()=>{c.current=!0}),x.useCallback((h,m={})=>{if(Nn(c.current,cg),!c.current)return;if(typeof h=="number"){r.go(h);return}let y=Wu(h,JSON.parse(u),o,m.relative==="path");e==null&&n!=="/"&&(y.pathname=y.pathname==="/"?n:Ua([n,y.pathname])),(m.replace?r.replace:r.push)(y,m.state,m)},[n,r,u,o,e])}var dg=x.createContext(null);function jk(){return x.useContext(dg)}function Ek(e){let n=x.useContext(fa).outlet;return x.useMemo(()=>n&&x.createElement(dg.Provider,{value:e},n),[n,e])}function Hi(e,{relative:n}={}){let{matches:r}=x.useContext(fa),{pathname:l}=$n(),o=JSON.stringify(Qu(r));return x.useMemo(()=>Wu(e,JSON.parse(o),l,n==="path"),[e,o,l,n])}function Nk(e,n){return fg(e,n)}function fg(e,n,r,l,o){var E;kt(Rl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=x.useContext(Tn),{matches:c}=x.useContext(fa),f=c[c.length-1],h=f?f.params:{},m=f?f.pathname:"/",y=f?f.pathnameBase:"/",g=f&&f.route;{let N=g&&g.path||"";pg(m,!g||N.endsWith("*")||N.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${N}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.

Please change the parent <Route path="${N}"> to <Route path="${N==="/"?"*":`${N}/*`}">.`)}let _=$n(),v;if(n){let N=typeof n=="string"?Qr(n):n;kt(y==="/"||((E=N.pathname)==null?void 0:E.startsWith(y)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${y}" but pathname "${N.pathname}" was given in the \`location\` prop.`),v=N}else v=_;let w=v.pathname||"/",j=w;if(y!=="/"){let N=y.replace(/^\//,"").split("/");j="/"+w.replace(/^\//,"").split("/").slice(N.length).join("/")}let T=Zp(e,{pathname:j});Nn(g||T!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Nn(T==null||T[T.length-1].route.element!==void 0||T[T.length-1].route.Component!==void 0||T[T.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let C=Dk(T&&T.map(N=>Object.assign({},N,{params:Object.assign({},h,N.params),pathname:Ua([y,u.encodeLocation?u.encodeLocation(N.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?y:Ua([y,u.encodeLocation?u.encodeLocation(N.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathnameBase])})),c,r,l,o);return n&&C?x.createElement(Ui.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...v},navigationType:"POP"}},C):C}function Tk(){let e=Fk(),n=mk(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,l="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:l},u={padding:"2px 4px",backgroundColor:l},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:u},"ErrorBoundary")," or"," ",x.createElement("code",{style:u},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},n),r?x.createElement("pre",{style:o},r):null,c)}var Ak=x.createElement(Tk,null),hg=class extends x.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){this.props.onError?this.props.onError(e,n):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=kk(e.digest);r&&(e=r)}let n=e!==void 0?x.createElement(fa.Provider,{value:this.props.routeContext},x.createElement(Xu.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?x.createElement(Mk,{error:e},n):n}};hg.contextType=yk;var Ju=new WeakMap;function Mk({children:e,error:n}){let{basename:r}=x.useContext(Tn);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let l=wk(n.digest);if(l){let o=Ju.get(n);if(o)throw o;let u=lg(l.location,r);if(rg&&!Ju.get(n))if(u.isExternal||l.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:l.replace}));throw Ju.set(n,c),c}return x.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return e}function Rk({routeContext:e,match:n,children:r}){let l=x.useContext(Ml);return l&&l.static&&l.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=n.route.id),x.createElement(fa.Provider,{value:e},r)}function Dk(e,n=[],r=null,l=null,o=null){if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(n.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let u=e,c=r==null?void 0:r.errors;if(c!=null){let y=u.findIndex(g=>g.route.id&&(c==null?void 0:c[g.route.id])!==void 0);kt(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),u=u.slice(0,Math.min(u.length,y+1))}let f=!1,h=-1;if(r)for(let y=0;y<u.length;y++){let g=u[y];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(h=y),g.route.id){let{loaderData:_,errors:v}=r,w=g.route.loader&&!_.hasOwnProperty(g.route.id)&&(!v||v[g.route.id]===void 0);if(g.route.lazy||w){f=!0,h>=0?u=u.slice(0,h+1):u=[u[0]];break}}}let m=r&&l?(y,g)=>{var _,v,w;l(y,{location:r.location,params:(w=(v=(_=r.matches)==null?void 0:_[0])==null?void 0:v.params)!=null?w:{},unstable_pattern:pk(r.matches),errorInfo:g})}:void 0;return u.reduceRight((y,g,_)=>{let v,w=!1,j=null,T=null;r&&(v=c&&g.route.id?c[g.route.id]:void 0,j=g.route.errorElement||Ak,f&&(h<0&&_===0?(pg("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,T=null):h===_&&(w=!0,T=g.route.hydrateFallbackElement||null)));let C=n.concat(u.slice(0,_+1)),E=()=>{let N;return v?N=j:w?N=T:g.route.Component?N=x.createElement(g.route.Component,null):g.route.element?N=g.route.element:N=y,x.createElement(Rk,{match:g,routeContext:{outlet:y,matches:C,isDataRoute:r!=null},children:N})};return r&&(g.route.ErrorBoundary||g.route.errorElement||_===0)?x.createElement(hg,{location:r.location,revalidation:r.revalidation,component:j,error:v,children:E(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:m}):E()},null)}function Zu(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function Lk(e){let n=x.useContext(Ml);return kt(n,Zu(e)),n}function zk(e){let n=x.useContext(ps);return kt(n,Zu(e)),n}function Ok(e){let n=x.useContext(fa);return kt(n,Zu(e)),n}function ed(e){let n=Ok(e),r=n.matches[n.matches.length-1];return kt(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Bk(){return ed("useRouteId")}function Fk(){var l;let e=x.useContext(Xu),n=zk("useRouteError"),r=ed("useRouteError");return e!==void 0?e:(l=n.errors)==null?void 0:l[r]}function Ik(){let{router:e}=Lk("useNavigate"),n=ed("useNavigate"),r=x.useRef(!1);return ug(()=>{r.current=!0}),x.useCallback(async(o,u={})=>{Nn(r.current,cg),r.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:n,...u}))},[e,n])}var mg={};function pg(e,n,r){!n&&!mg[e]&&(mg[e]=!0,Nn(!1,r))}x.memo(Uk);function Uk({routes:e,future:n,state:r,onError:l}){return fg(e,void 0,r,l,n)}function Hk({basename:e,children:n,initialEntries:r,initialIndex:l,unstable_useTransitions:o}){let u=x.useRef();u.current==null&&(u.current=P2({initialEntries:r,initialIndex:l,v5Compat:!0}));let c=u.current,[f,h]=x.useState({action:c.action,location:c.location}),m=x.useCallback(y=>{o===!1?h(y):x.startTransition(()=>h(y))},[o]);return x.useLayoutEffect(()=>c.listen(m),[c,m]),x.createElement(gg,{basename:e,children:n,location:f.location,navigationType:f.action,navigator:c,unstable_useTransitions:o})}function qk({to:e,replace:n,state:r,relative:l}){kt(Rl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=x.useContext(Tn);Nn(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:u}=x.useContext(fa),{pathname:c}=$n(),f=Wr(),h=Wu(e,Qu(u),c,l==="path"),m=JSON.stringify(h);return x.useEffect(()=>{f(JSON.parse(m),{replace:n,state:r,relative:l})},[f,m,l,n,r]),null}function Pk(e){return Ek(e.context)}function At(e){kt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function gg({basename:e="/",children:n=null,location:r,navigationType:l="POP",navigator:o,static:u=!1,unstable_useTransitions:c}){kt(!Rl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),h=x.useMemo(()=>({basename:f,navigator:o,static:u,unstable_useTransitions:c,future:{}}),[f,o,u,c]);typeof r=="string"&&(r=Qr(r));let{pathname:m="/",search:y="",hash:g="",state:_=null,key:v="default"}=r,w=x.useMemo(()=>{let j=Ia(m,f);return j==null?null:{location:{pathname:j,search:y,hash:g,state:_,key:v},navigationType:l}},[f,m,y,g,_,v,l]);return Nn(w!=null,`<Router basename="${f}"> is not able to match the URL "${m}${y}${g}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:x.createElement(Tn.Provider,{value:h},x.createElement(Ui.Provider,{children:n,value:w}))}function $k({children:e,location:n}){return Nk(td(e),n)}function td(e,n=[]){let r=[];return x.Children.forEach(e,(l,o)=>{if(!x.isValidElement(l))return;let u=[...n,o];if(l.type===x.Fragment){r.push.apply(r,td(l.props.children,u));return}kt(l.type===At,`[${typeof l.type=="string"?l.type:l.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),kt(!l.props.index||!l.props.children,"An index route cannot have child routes.");let c={id:l.props.id||u.join("-"),caseSensitive:l.props.caseSensitive,element:l.props.element,Component:l.props.Component,index:l.props.index,path:l.props.path,middleware:l.props.middleware,loader:l.props.loader,action:l.props.action,hydrateFallbackElement:l.props.hydrateFallbackElement,HydrateFallback:l.props.HydrateFallback,errorElement:l.props.errorElement,ErrorBoundary:l.props.ErrorBoundary,hasErrorBoundary:l.props.hasErrorBoundary===!0||l.props.ErrorBoundary!=null||l.props.errorElement!=null,shouldRevalidate:l.props.shouldRevalidate,handle:l.props.handle,lazy:l.props.lazy};l.props.children&&(c.children=td(l.props.children,u)),r.push(c)}),r}var gs="get",ys="application/x-www-form-urlencoded";function bs(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Yk(e){return bs(e)&&e.tagName.toLowerCase()==="button"}function Gk(e){return bs(e)&&e.tagName.toLowerCase()==="form"}function Kk(e){return bs(e)&&e.tagName.toLowerCase()==="input"}function Vk(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Qk(e,n){return e.button===0&&(!n||n==="_self")&&!Vk(e)}function nd(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((n,r)=>{let l=e[r];return n.concat(Array.isArray(l)?l.map(o=>[r,o]):[[r,l]])},[]))}function Wk(e,n){let r=nd(e);return n&&n.forEach((l,o)=>{r.has(o)||n.getAll(o).forEach(u=>{r.append(o,u)})}),r}var xs=null;function Xk(){if(xs===null)try{new FormData(document.createElement("form"),0),xs=!1}catch{xs=!0}return xs}var Jk=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ad(e){return e!=null&&!Jk.has(e)?(Nn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ys}"`),null):e}function Zk(e,n){let r,l,o,u,c;if(Gk(e)){let f=e.getAttribute("action");l=f?Ia(f,n):null,r=e.getAttribute("method")||gs,o=ad(e.getAttribute("enctype"))||ys,u=new FormData(e)}else if(Yk(e)||Kk(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||f.getAttribute("action");if(l=h?Ia(h,n):null,r=e.getAttribute("formmethod")||f.getAttribute("method")||gs,o=ad(e.getAttribute("formenctype"))||ad(f.getAttribute("enctype"))||ys,u=new FormData(f,e),!Xk()){let{name:m,type:y,value:g}=e;if(y==="image"){let _=m?`${m}.`:"";u.append(`${_}x`,"0"),u.append(`${_}y`,"0")}else m&&u.append(m,g)}}else{if(bs(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=gs,l=null,o=ys,c=e}return u&&o==="text/plain"&&(c=u,u=void 0),{action:l,method:r.toLowerCase(),encType:o,formData:u,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function rd(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function eS(e,n,r,l){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${l}`:o.pathname=`${o.pathname}.${l}`:o.pathname==="/"?o.pathname=`_root.${l}`:n&&Ia(o.pathname,n)==="/"?o.pathname=`${n.replace(/\/$/,"")}/_root.${l}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${l}`,o}async function tS(e,n){if(e.id in n)return n[e.id];try{let r=await import(e.module);return n[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function nS(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function aS(e,n,r){let l=await Promise.all(e.map(async o=>{let u=n.routes[o.route.id];if(u){let c=await tS(u,r);return c.links?c.links():[]}return[]}));return oS(l.flat(1).filter(nS).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function yg(e,n,r,l,o,u){let c=(h,m)=>r[m]?h.route.id!==r[m].route.id:!0,f=(h,m)=>{var y;return r[m].pathname!==h.pathname||((y=r[m].route.path)==null?void 0:y.endsWith("*"))&&r[m].params["*"]!==h.params["*"]};return u==="assets"?n.filter((h,m)=>c(h,m)||f(h,m)):u==="data"?n.filter((h,m)=>{var g;let y=l.routes[h.route.id];if(!y||!y.hasLoader)return!1;if(c(h,m)||f(h,m))return!0;if(h.route.shouldRevalidate){let _=h.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((g=r[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof _=="boolean")return _}return!0}):[]}function rS(e,n,{includeHydrateFallback:r}={}){return lS(e.map(l=>{let o=n.routes[l.route.id];if(!o)return[];let u=[o.module];return o.clientActionModule&&(u=u.concat(o.clientActionModule)),o.clientLoaderModule&&(u=u.concat(o.clientLoaderModule)),r&&o.hydrateFallbackModule&&(u=u.concat(o.hydrateFallbackModule)),o.imports&&(u=u.concat(o.imports)),u}).flat(1))}function lS(e){return[...new Set(e)]}function iS(e){let n={},r=Object.keys(e).sort();for(let l of r)n[l]=e[l];return n}function oS(e,n){let r=new Set;return new Set(n),e.reduce((l,o)=>{let u=JSON.stringify(iS(o));return r.has(u)||(r.add(u),l.push({key:u,link:o})),l},[])}function bg(){let e=x.useContext(Ml);return rd(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function sS(){let e=x.useContext(ps);return rd(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var ld=x.createContext(void 0);ld.displayName="FrameworkContext";function xg(){let e=x.useContext(ld);return rd(e,"You must render this element inside a <HydratedRouter> element"),e}function cS(e,n){let r=x.useContext(ld),[l,o]=x.useState(!1),[u,c]=x.useState(!1),{onFocus:f,onBlur:h,onMouseEnter:m,onMouseLeave:y,onTouchStart:g}=n,_=x.useRef(null);x.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let j=C=>{C.forEach(E=>{c(E.isIntersecting)})},T=new IntersectionObserver(j,{threshold:.5});return _.current&&T.observe(_.current),()=>{T.disconnect()}}},[e]),x.useEffect(()=>{if(l){let j=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(j)}}},[l]);let v=()=>{o(!0)},w=()=>{o(!1),c(!1)};return r?e!=="intent"?[u,_,{}]:[u,_,{onFocus:qi(f,v),onBlur:qi(h,w),onMouseEnter:qi(m,v),onMouseLeave:qi(y,w),onTouchStart:qi(g,v)}]:[!1,_,{}]}function qi(e,n){return r=>{e&&e(r),r.defaultPrevented||n(r)}}function uS({page:e,...n}){let{router:r}=bg(),l=x.useMemo(()=>Zp(r.routes,e,r.basename),[r.routes,e,r.basename]);return l?x.createElement(fS,{page:e,matches:l,...n}):null}function dS(e){let{manifest:n,routeModules:r}=xg(),[l,o]=x.useState([]);return x.useEffect(()=>{let u=!1;return aS(e,n,r).then(c=>{u||o(c)}),()=>{u=!0}},[e,n,r]),l}function fS({page:e,matches:n,...r}){let l=$n(),{future:o,manifest:u,routeModules:c}=xg(),{basename:f}=bg(),{loaderData:h,matches:m}=sS(),y=x.useMemo(()=>yg(e,n,m,u,l,"data"),[e,n,m,u,l]),g=x.useMemo(()=>yg(e,n,m,u,l,"assets"),[e,n,m,u,l]),_=x.useMemo(()=>{if(e===l.pathname+l.search+l.hash)return[];let j=new Set,T=!1;if(n.forEach(E=>{var D;let N=u.routes[E.route.id];!N||!N.hasLoader||(!y.some(F=>F.route.id===E.route.id)&&E.route.id in h&&((D=c[E.route.id])!=null&&D.shouldRevalidate)||N.hasClientLoader?T=!0:j.add(E.route.id))}),j.size===0)return[];let C=eS(e,f,o.unstable_trailingSlashAwareDataRequests,"data");return T&&j.size>0&&C.searchParams.set("_routes",n.filter(E=>j.has(E.route.id)).map(E=>E.route.id).join(",")),[C.pathname+C.search]},[f,o.unstable_trailingSlashAwareDataRequests,h,l,u,y,n,e,c]),v=x.useMemo(()=>rS(g,u),[g,u]),w=dS(g);return x.createElement(x.Fragment,null,_.map(j=>x.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...r})),v.map(j=>x.createElement("link",{key:j,rel:"modulepreload",href:j,...r})),w.map(({key:j,link:T})=>{var C;return x.createElement("link",{key:j,nonce:r.nonce,...T,crossOrigin:(C=T.crossOrigin)!=null?C:r.crossOrigin})}))}function hS(...e){return n=>{e.forEach(r=>{typeof r=="function"?r(n):r!=null&&(r.current=n)})}}var mS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{mS&&(window.__reactRouterVersion="7.13.0")}catch{}function pS({basename:e,children:n,unstable_useTransitions:r,window:l}){let o=x.useRef();o.current==null&&(o.current=$2({window:l,v5Compat:!0}));let u=o.current,[c,f]=x.useState({action:u.action,location:u.location}),h=x.useCallback(m=>{r===!1?f(m):x.startTransition(()=>f(m))},[r]);return x.useLayoutEffect(()=>u.listen(h),[u,h]),x.createElement(gg,{basename:e,children:n,location:c.location,navigationType:c.action,navigator:u,unstable_useTransitions:r})}var vg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_g=x.forwardRef(function({onClick:n,discover:r="render",prefetch:l="none",relative:o,reloadDocument:u,replace:c,state:f,target:h,to:m,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:_,...v},w){let{basename:j,unstable_useTransitions:T}=x.useContext(Tn),C=typeof m=="string"&&vg.test(m),E=lg(m,j);m=E.to;let N=Sk(m,{relative:o}),[D,F,M]=cS(l,v),A=xS(m,{replace:c,state:f,target:h,preventScrollReset:y,relative:o,viewTransition:g,unstable_defaultShouldRevalidate:_,unstable_useTransitions:T});function U(L){n&&n(L),L.defaultPrevented||A(L)}let I=x.createElement("a",{...v,...M,href:E.absoluteURL||N,onClick:E.isExternal||u?n:U,ref:hS(w,F),target:h,"data-discover":!C&&r==="render"?"true":void 0});return D&&!C?x.createElement(x.Fragment,null,I,x.createElement(uS,{page:N})):I});_g.displayName="Link";var gS=x.forwardRef(function({"aria-current":n="page",caseSensitive:r=!1,className:l="",end:o=!1,style:u,to:c,viewTransition:f,children:h,...m},y){let g=Hi(c,{relative:m.relative}),_=$n(),v=x.useContext(ps),{navigator:w,basename:j}=x.useContext(Tn),T=v!=null&&CS(g)&&f===!0,C=w.encodeLocation?w.encodeLocation(g).pathname:g.pathname,E=_.pathname,N=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;r||(E=E.toLowerCase(),N=N?N.toLowerCase():null,C=C.toLowerCase()),N&&j&&(N=Ia(N,j)||N);const D=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let F=E===C||!o&&E.startsWith(C)&&E.charAt(D)==="/",M=N!=null&&(N===C||!o&&N.startsWith(C)&&N.charAt(C.length)==="/"),A={isActive:F,isPending:M,isTransitioning:T},U=F?n:void 0,I;typeof l=="function"?I=l(A):I=[l,F?"active":null,M?"pending":null,T?"transitioning":null].filter(Boolean).join(" ");let L=typeof u=="function"?u(A):u;return x.createElement(_g,{...m,"aria-current":U,className:I,ref:y,style:L,to:c,viewTransition:f},typeof h=="function"?h(A):h)});gS.displayName="NavLink";var yS=x.forwardRef(({discover:e="render",fetcherKey:n,navigate:r,reloadDocument:l,replace:o,state:u,method:c=gs,action:f,onSubmit:h,relative:m,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:_,...v},w)=>{let{unstable_useTransitions:j}=x.useContext(Tn),T=kS(),C=SS(f,{relative:m}),E=c.toLowerCase()==="get"?"get":"post",N=typeof f=="string"&&vg.test(f),D=F=>{if(h&&h(F),F.defaultPrevented)return;F.preventDefault();let M=F.nativeEvent.submitter,A=(M==null?void 0:M.getAttribute("formmethod"))||c,U=()=>T(M||F.currentTarget,{fetcherKey:n,method:A,navigate:r,replace:o,state:u,relative:m,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:_});j&&r!==!1?x.startTransition(()=>U()):U()};return x.createElement("form",{ref:w,method:E,action:C,onSubmit:l?h:D,...v,"data-discover":!N&&e==="render"?"true":void 0})});yS.displayName="Form";function bS(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function wg(e){let n=x.useContext(Ml);return kt(n,bS(e)),n}function xS(e,{target:n,replace:r,state:l,preventScrollReset:o,relative:u,viewTransition:c,unstable_defaultShouldRevalidate:f,unstable_useTransitions:h}={}){let m=Wr(),y=$n(),g=Hi(e,{relative:u});return x.useCallback(_=>{if(Qk(_,n)){_.preventDefault();let v=r!==void 0?r:Al(y)===Al(g),w=()=>m(e,{replace:v,state:l,preventScrollReset:o,relative:u,viewTransition:c,unstable_defaultShouldRevalidate:f});h?x.startTransition(()=>w()):w()}},[y,m,g,r,l,n,e,o,u,c,f,h])}function vS(e){Nn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let n=x.useRef(nd(e)),r=x.useRef(!1),l=$n(),o=x.useMemo(()=>Wk(l.search,r.current?null:n.current),[l.search]),u=Wr(),c=x.useCallback((f,h)=>{const m=nd(typeof f=="function"?f(new URLSearchParams(o)):f);r.current=!0,u("?"+m,h)},[u,o]);return[o,c]}var _S=0,wS=()=>`__${String(++_S)}__`;function kS(){let{router:e}=wg("useSubmit"),{basename:n}=x.useContext(Tn),r=Bk(),l=e.fetch,o=e.navigate;return x.useCallback(async(u,c={})=>{let{action:f,method:h,encType:m,formData:y,body:g}=Zk(u,n);if(c.navigate===!1){let _=c.fetcherKey||wS();await l(_,r,c.action||f,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:y,body:g,formMethod:c.method||h,formEncType:c.encType||m,flushSync:c.flushSync})}else await o(c.action||f,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:y,body:g,formMethod:c.method||h,formEncType:c.encType||m,replace:c.replace,state:c.state,fromRouteId:r,flushSync:c.flushSync,viewTransition:c.viewTransition})},[l,o,n,r])}function SS(e,{relative:n}={}){let{basename:r}=x.useContext(Tn),l=x.useContext(fa);kt(l,"useFormAction must be used inside a RouteContext");let[o]=l.matches.slice(-1),u={...Hi(e||".",{relative:n})},c=$n();if(e==null){u.search=c.search;let f=new URLSearchParams(u.search),h=f.getAll("index");if(h.some(y=>y==="")){f.delete("index"),h.filter(g=>g).forEach(g=>f.append("index",g));let y=f.toString();u.search=y?`?${y}`:""}}return(!e||e===".")&&o.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(u.pathname=u.pathname==="/"?r:Ua([r,u.pathname])),Al(u)}function CS(e,{relative:n}={}){let r=x.useContext(og);kt(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:l}=wg("useViewTransitionState"),o=Hi(e,{relative:n});if(!r.isTransitioning)return!1;let u=Ia(r.currentLocation.pathname,l)||r.currentLocation.pathname,c=Ia(r.nextLocation.pathname,l)||r.nextLocation.pathname;return ms(o.pathname,c)!=null||ms(o.pathname,u)!=null}var Dl=Kp();const vs='"Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", "Noto Sans CJK SC", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif',kg={system:`system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", ${vs}`,inter:`"Inter", system-ui, ${vs}`,segoe:`"Segoe UI", system-ui, ${vs}`,sf:`-apple-system, BlinkMacSystemFont, "SF Pro Text", ${vs}`},Sg={jetbrains:'"JetBrains Mono", "Fira Code", "Cascadia Code", monospace',fira:'"Fira Code", "JetBrains Mono", "Cascadia Code", monospace',cascadia:'"Cascadia Code", "JetBrains Mono", "Fira Code", monospace',"system-mono":'ui-monospace, "SF Mono", "Cascadia Code", "Fira Code", monospace'},Cg=x.createContext({theme:"dark",accent:"cyan",colorTheme:"default-dark",uiFont:"system",monoFont:"jetbrains",uiFontSize:15,monoFontSize:14,resolvedTheme:"dark",setTheme:()=>{},setAccent:()=>{},setColorTheme:()=>{},setUiFont:()=>{},setMonoFont:()=>{},setUiFontSize:()=>{},setMonoFontSize:()=>{}});function nn(e,n,r,l,o,u,c,f,h,m,y){const g=parseInt(m.slice(1,3),16),_=parseInt(m.slice(3,5),16),v=parseInt(m.slice(5,7),16);return{"--pc-bg-base":e,"--color-scheme":"dark","--pc-bg-surface":n,"--pc-bg-elevated":r,"--pc-bg-input":l,"--pc-bg-sidebar":`${e}f2`,"--pc-bg-code":o,"--pc-border":"rgba(255,255,255,0.08)","--pc-border-strong":"rgba(255,255,255,0.12)","--pc-text-primary":u,"--pc-text-secondary":c,"--pc-text-muted":f,"--pc-text-faint":h,"--pc-scrollbar-thumb":h,"--pc-scrollbar-track":n,"--pc-scrollbar-thumb-hover":f,"--pc-hover":"rgba(255,255,255,0.05)","--pc-hover-strong":"rgba(255,255,255,0.08)","--pc-separator":"rgba(255,255,255,0.05)","--pc-accent":m,"--pc-accent-light":y,"--pc-accent-dim":`rgba(${g},${_},${v},0.3)`,"--pc-accent-glow":`rgba(${g},${_},${v},0.1)`,"--pc-accent-rgb":`${g},${_},${v}`}}function fr(e,n,r,l,o,u,c,f,h,m,y){const g=parseInt(m.slice(1,3),16),_=parseInt(m.slice(3,5),16),v=parseInt(m.slice(5,7),16);return{"--pc-bg-base":e,"--color-scheme":"light","--pc-bg-surface":n,"--pc-bg-elevated":r,"--pc-bg-input":l,"--pc-bg-sidebar":`${n}f2`,"--pc-bg-code":o,"--pc-border":"rgba(0,0,0,0.08)","--pc-border-strong":"rgba(0,0,0,0.12)","--pc-text-primary":u,"--pc-text-secondary":c,"--pc-text-muted":f,"--pc-text-faint":h,"--pc-scrollbar-thumb":h,"--pc-scrollbar-track":r,"--pc-scrollbar-thumb-hover":f,"--pc-hover":"rgba(0,0,0,0.04)","--pc-hover-strong":"rgba(0,0,0,0.07)","--pc-separator":"rgba(0,0,0,0.06)","--pc-accent":m,"--pc-accent-light":y,"--pc-accent-dim":`rgba(${g},${_},${v},0.25)`,"--pc-accent-glow":`rgba(${g},${_},${v},0.08)`,"--pc-accent-rgb":`${g},${_},${v}`}}const jS=[{id:"default-dark",name:"Default Dark",scheme:"dark",preview:["#1e1e24","#22d3ee","#a78bfa","#f59e0b","#d4d4d8"],vars:nn("#1e1e24","#232329","#27272a","#1a1a20","#1a1a20","#d4d4d8","#a1a1aa","#71717a","#52525b","#22d3ee","#67e8f9")},{id:"default-light",name:"Default Light",scheme:"light",preview:["#f4f4f5","#22d3ee","#8b5cf6","#f59e0b","#18181b"],vars:{...fr("#f7f7f5","#fbfbfa","#ffffff","#ffffff","#f3f3f1","#2f3137","#5f6572","#858b97","#adb2bd","#4a8cff","#7db0ff"),"--pc-bg-sidebar":"#f1f1ef","--pc-border":"#e7e9ee","--pc-border-strong":"#dde1e8","--pc-hover":"rgba(74,140,255,0.06)","--pc-hover-strong":"rgba(74,140,255,0.1)","--pc-separator":"#eceef2","--pc-scrollbar-track":"#f0f1f4","--pc-scrollbar-thumb":"#c5cad4","--pc-scrollbar-thumb-hover":"#9ea5b2"}},{id:"oled-black",name:"OLED Black",scheme:"dark",preview:["#000000","#22d3ee","#8b5cf6","#10b981","#d4d4d8"],vars:nn("#000000","#0a0a0a","#141414","#0a0a0a","#0a0a0a","#d4d4d8","#a1a1aa","#71717a","#3f3f46","#22d3ee","#67e8f9")},{id:"nord-dark",name:"Nord Dark",scheme:"dark",preview:["#2e3440","#88c0d0","#81a1c1","#a3be8c","#eceff4"],vars:nn("#2e3440","#3b4252","#434c5e","#2e3440","#2e3440","#eceff4","#d8dee9","#7b88a1","#4c566a","#88c0d0","#8fbcbb")},{id:"nord-light",name:"Nord Light",scheme:"light",preview:["#eceff4","#5e81ac","#88c0d0","#a3be8c","#2e3440"],vars:fr("#eceff4","#e5e9f0","#d8dee9","#e5e9f0","#e5e9f0","#2e3440","#3b4252","#4c566a","#7b88a1","#5e81ac","#81a1c1")},{id:"dracula",name:"Dracula",scheme:"dark",preview:["#282a36","#bd93f9","#ff79c6","#50fa7b","#f8f8f2"],vars:nn("#282a36","#21222c","#343746","#1e1f29","#1e1f29","#f8f8f2","#c0c0d0","#6272a4","#44475a","#bd93f9","#caa9fa")},{id:"monokai",name:"Monokai",scheme:"dark",preview:["#272822","#f92672","#a6e22e","#e6db74","#f8f8f2"],vars:nn("#272822","#2d2e27","#3e3d32","#1e1f1c","#1e1f1c","#f8f8f2","#c0c0b0","#75715e","#49483e","#f92672","#fd5fa0")},{id:"solarized-dark",name:"Solarized Dark",scheme:"dark",preview:["#002b36","#268bd2","#2aa198","#b58900","#839496"],vars:nn("#002b36","#073642","#0a4050","#002028","#002028","#839496","#93a1a1","#657b83","#586e75","#268bd2","#6cb6e8")},{id:"solarized-light",name:"Solarized Light",scheme:"light",preview:["#fdf6e3","#268bd2","#2aa198","#b58900","#073642"],vars:fr("#fdf6e3","#eee8d5","#ddd6c1","#fdf6e3","#eee8d5","#073642","#586e75","#657b83","#93a1a1","#268bd2","#2aa198")},{id:"kanagawa-wave",name:"Kanagawa Wave",scheme:"dark",preview:["#1f1f28","#7e9cd8","#957fb8","#e6c384","#dcd7ba"],vars:nn("#1f1f28","#2a2a37","#363646","#16161d","#16161d","#dcd7ba","#c8c093","#727169","#54546d","#7e9cd8","#7fb4ca")},{id:"kanagawa-dragon",name:"Kanagawa Dragon",scheme:"dark",preview:["#181616","#8ba4b0","#a292a3","#c4b28a","#c5c9c5"],vars:nn("#181616","#201d1d","#2d2a2a","#12120f","#12120f","#c5c9c5","#a6a69c","#737c73","#625e5a","#8ba4b0","#9cabba")},{id:"kanagawa-lotus",name:"Kanagawa Lotus",scheme:"light",preview:["#f2ecbc","#4d699b","#b35b79","#836f4a","#1f1f28"],vars:fr("#f2ecbc","#e7dba0","#d5cea3","#f2ecbc","#e7dba0","#1f1f28","#545464","#716e61","#8a8980","#4d699b","#6693bf")},{id:"rose-pine",name:"Rosé Pine",scheme:"dark",preview:["#191724","#ebbcba","#c4a7e7","#f6c177","#e0def4"],vars:nn("#191724","#1f1d2e","#26233a","#13111e","#13111e","#e0def4","#908caa","#6e6a86","#524f67","#ebbcba","#f2d5ce")},{id:"rose-pine-moon",name:"Rosé Pine Moon",scheme:"dark",preview:["#232136","#ea9a97","#c4a7e7","#f6c177","#e0def4"],vars:nn("#232136","#2a273f","#393552","#1b1930","#1b1930","#e0def4","#908caa","#6e6a86","#44415a","#ea9a97","#f0b8b6")},{id:"rose-pine-dawn",name:"Rosé Pine Dawn",scheme:"light",preview:["#faf4ed","#d7827e","#907aa9","#ea9d34","#575279"],vars:fr("#faf4ed","#fffaf3","#f2e9de","#fffaf3","#f2e9de","#575279","#797593","#9893a5","#cecacd","#d7827e","#b4637a")},{id:"night-owl",name:"Night Owl",scheme:"dark",preview:["#011627","#82aaff","#c792ea","#addb67","#d6deeb"],vars:nn("#011627","#0b2942","#122d42","#010e1a","#010e1a","#d6deeb","#a7bbc7","#5f7e97","#37536b","#82aaff","#a0c4ff")},{id:"everforest-dark",name:"Everforest Dark",scheme:"dark",preview:["#2d353b","#a7c080","#83c092","#dbbc7f","#d3c6aa"],vars:nn("#2d353b","#343f44","#3d484d","#272e33","#272e33","#d3c6aa","#9da9a0","#7a8478","#56635f","#a7c080","#83c092")},{id:"everforest-light",name:"Everforest Light",scheme:"light",preview:["#fdf6e3","#8da101","#35a77c","#dfa000","#5c6a72"],vars:fr("#fdf6e3","#f3ead3","#e9dfc4","#f3ead3","#eee8d5","#5c6a72","#708089","#829181","#a6b0a0","#8da101","#93b259")},{id:"cobalt2",name:"Cobalt2",scheme:"dark",preview:["#193549","#ffc600","#ff9d00","#80ffbb","#ffffff"],vars:nn("#193549","#1f4662","#234d6e","#0d2b3e","#0d2b3e","#ffffff","#a0c4d8","#507a8f","#305a6f","#ffc600","#ffd740")},{id:"flexoki-dark",name:"Flexoki Dark",scheme:"dark",preview:["#100f0f","#ce5d97","#879a39","#da702c","#cecdc3"],vars:nn("#100f0f","#1c1b1a","#282726","#100f0f","#1c1b1a","#cecdc3","#b7b5ac","#878580","#575653","#ce5d97","#d68fb2")},{id:"flexoki-light",name:"Flexoki Light",scheme:"light",preview:["#fffcf0","#ce5d97","#879a39","#da702c","#100f0f"],vars:fr("#fffcf0","#f2f0e5","#e6e4d9","#fffcf0","#f2f0e5","#100f0f","#343331","#575653","#878580","#ce5d97","#a02f6f")},{id:"hacker-green",name:"Hacker Green",scheme:"dark",preview:["#0a0e0a","#00ff41","#00cc33","#008f11","#33ff66"],vars:nn("#0a0e0a","#0d120d","#121a12","#080c08","#080c08","#00ff41","#00cc33","#008f11","#005a0a","#00ff41","#33ff66")},{id:"material-dark",name:"Material Dark",scheme:"dark",preview:["#212121","#89ddff","#c792ea","#ffcb6b","#eeffff"],vars:nn("#212121","#292929","#333333","#1a1a1a","#1a1a1a","#eeffff","#b0bec5","#616161","#424242","#89ddff","#80cbc4")},{id:"material-light",name:"Material Light",scheme:"light",preview:["#fafafa","#6182b8","#7c4dff","#f76d47","#212121"],vars:fr("#fafafa","#ffffff","#eaeaea","#ffffff","#f5f5f5","#212121","#424242","#757575","#bdbdbd","#6182b8","#7c4dff")}],Ll=Object.fromEntries(jS.map(e=>[e.id,e])),id="default-dark",jg="default-light",Eg="kylinbot-theme",zl={theme:"light",accent:"cyan",colorTheme:"default-light",uiFont:"system",monoFont:"jetbrains",uiFontSize:15,monoFontSize:14},ES=["dark","light","oled","system"],NS=["cyan","violet","emerald","amber","rose","blue"];function TS(e){switch(e){case"light":return"default-light";case"oled":return"oled-black";default:return"default-dark"}}function AS(){try{const e=localStorage.getItem(Eg);if(e){const n=JSON.parse(e),r=ES.includes(n.theme),l=NS.includes(n.accent),o=kg[n.uiFont]?n.uiFont:zl.uiFont,u=Sg[n.monoFont]?n.monoFont:zl.monoFont,c=Number.isFinite(n.uiFontSize)?Math.min(20,Math.max(12,Number(n.uiFontSize))):zl.uiFontSize,f=Number.isFinite(n.monoFontSize)?Math.min(20,Math.max(12,Number(n.monoFontSize))):zl.monoFontSize;let h=zl.colorTheme;if(n.colorTheme&&Ll[n.colorTheme]?h=n.colorTheme:r&&(h=TS(n.theme)),r&&l)return{theme:n.theme,accent:n.accent,colorTheme:h,uiFont:o,monoFont:u,uiFontSize:c,monoFontSize:f}}}catch{}return zl}const Ng=new Set;function Ol(e,n,r=[{weight:400,style:"normal",file:"Regular"},{weight:500,style:"normal",file:"Medium"},{weight:600,style:"normal",file:"SemiBold"}]){const l=`lfont-${e.replace(/\s+/g,"-").toLowerCase()}`;if(Ng.has(l))return;Ng.add(l);const o="/fonts";let u="";for(const{weight:f,style:h,file:m}of r)u+=`
@font-face {
  font-family: '${e}';
  src: url('${o}/${n}-${m}.woff2') format('woff2'),
       url('${o}/${n}-${m}.woff') format('woff'),
       url('${o}/${n}-${m}.ttf') format('truetype');
  font-weight: ${f};
  font-style: ${h};
  font-display: swap;
}`;const c=document.createElement("style");c.id=l,c.textContent=u,document.head.appendChild(c)}function Tg(e){e==="inter"&&Ol("Inter","Inter"),e==="segoe"&&Ol("Segoe UI","SegoeUI"),e==="sf"&&Ol("SF Pro Text","SFProText")}function Ag(e){e==="jetbrains"&&Ol("JetBrains Mono","JetBrainsMono"),e==="fira"&&Ol("Fira Code","FiraCode"),e==="cascadia"&&Ol("Cascadia Code","CascadiaCode")}const MS={cyan:{"--pc-accent":"#22d3ee","--pc-accent-light":"#67e8f9","--pc-accent-dim":"rgba(34,211,238,0.3)","--pc-accent-glow":"rgba(34,211,238,0.1)","--pc-accent-rgb":"34,211,238"},violet:{"--pc-accent":"#8b5cf6","--pc-accent-light":"#a78bfa","--pc-accent-dim":"rgba(139,92,246,0.3)","--pc-accent-glow":"rgba(139,92,246,0.1)","--pc-accent-rgb":"139,92,246"},emerald:{"--pc-accent":"#10b981","--pc-accent-light":"#34d399","--pc-accent-dim":"rgba(16,185,129,0.3)","--pc-accent-glow":"rgba(16,185,129,0.1)","--pc-accent-rgb":"16,185,129"},amber:{"--pc-accent":"#f59e0b","--pc-accent-light":"#fbbf24","--pc-accent-dim":"rgba(245,158,11,0.3)","--pc-accent-glow":"rgba(245,158,11,0.1)","--pc-accent-rgb":"245,158,11"},rose:{"--pc-accent":"#f43f5e","--pc-accent-light":"#fb7185","--pc-accent-dim":"rgba(244,63,94,0.3)","--pc-accent-glow":"rgba(244,63,94,0.1)","--pc-accent-rgb":"244,63,94"},blue:{"--pc-accent":"#3b82f6","--pc-accent-light":"#60a5fa","--pc-accent-dim":"rgba(59,130,246,0.3)","--pc-accent-glow":"rgba(59,130,246,0.1)","--pc-accent-rgb":"59,130,246"}};function RS(e){const n=document.documentElement;for(const[r,l]of Object.entries(e))r==="--color-scheme"?n.style.colorScheme=l:n.style.setProperty(r,l)}function Mg(e,n){const r=Ll[n];if(e==="system"){const l=window.matchMedia("(prefers-color-scheme: light)").matches;return r&&(l&&r.scheme==="light"||!l&&r.scheme==="dark")?n:l?jg:id}return e==="oled"?"oled-black":e==="light"&&(r==null?void 0:r.scheme)!=="light"?jg:e==="dark"&&(r==null?void 0:r.scheme)!=="dark"?id:n}function DS(e,n){var o;if(e==="oled")return"oled";const r=Mg(e,n),l=Ll[r];return(o=l==null?void 0:l.scheme)!=null?o:"dark"}function LS(e,n,r,l){return{"--pc-font-ui":kg[e],"--pc-font-mono":Sg[n],"--pc-font-size":`${r}px`,"--pc-font-size-mono":`${l}px`}}function zS({children:e}){const[n]=x.useState(AS),[r,l]=x.useState(n.theme),[o,u]=x.useState(n.accent),[c,f]=x.useState(n.colorTheme),[h,m]=x.useState(n.uiFont),[y,g]=x.useState(n.monoFont),[_,v]=x.useState(n.uiFontSize),[w,j]=x.useState(n.monoFontSize),T=x.useCallback(B=>{localStorage.setItem(Eg,JSON.stringify({theme:B.theme,accent:B.accent,colorTheme:B.colorTheme,uiFont:B.uiFont,monoFont:B.monoFont,uiFontSize:B.uiFontSize,monoFontSize:B.monoFontSize}))},[]),C=x.useCallback(B=>{var ne;const q=Mg(B.theme,B.colorTheme),K=Ll[q],G=(ne=K==null?void 0:K.vars)!=null?ne:Ll[id].vars;RS({...G,...MS[B.accent],...LS(B.uiFont,B.monoFont,B.uiFontSize,B.monoFontSize)})},[]),E=x.useCallback(B=>{l(B);const q={theme:B,accent:o,colorTheme:c,uiFont:h,monoFont:y,uiFontSize:_,monoFontSize:w};C(q),T(q)},[o,c,h,y,_,w,C,T]),N=x.useCallback(B=>{u(B);const q={theme:r,accent:B,colorTheme:c,uiFont:h,monoFont:y,uiFontSize:_,monoFontSize:w};C(q),T(q)},[r,c,h,y,_,w,C,T]),D=x.useCallback(B=>{f(B);const q=Ll[B];let K=r;q&&r!=="system"&&(B==="oled-black"?K="oled":K=q.scheme,l(K));const G={theme:K,accent:o,colorTheme:B,uiFont:h,monoFont:y,uiFontSize:_,monoFontSize:w};C(G),T(G)},[r,o,h,y,_,w,C,T]),F=x.useCallback(B=>{m(B),Tg(B);const q={theme:r,accent:o,colorTheme:c,uiFont:B,monoFont:y,uiFontSize:_,monoFontSize:w};C(q),T(q)},[r,o,c,C,T,y,_,w]),M=x.useCallback(B=>{g(B),Ag(B);const q={theme:r,accent:o,colorTheme:c,uiFont:h,monoFont:B,uiFontSize:_,monoFontSize:w};C(q),T(q)},[r,o,c,C,T,h,_,w]),A=x.useCallback(B=>{const q=Math.min(20,Math.max(12,B));v(q);const K={theme:r,accent:o,colorTheme:c,uiFont:h,monoFont:y,uiFontSize:q,monoFontSize:w};C(K),T(K)},[r,o,c,C,T,h,y,w]),U=x.useCallback(B=>{const q=Math.min(20,Math.max(12,B));j(q);const K={theme:r,accent:o,colorTheme:c,uiFont:h,monoFont:y,uiFontSize:_,monoFontSize:q};C(K),T(K)},[r,o,c,C,T,h,y,_]);x.useEffect(()=>{C({theme:r,accent:o,colorTheme:c,uiFont:h,monoFont:y,uiFontSize:_,monoFontSize:w}),Tg(h),Ag(y)},[]),x.useEffect(()=>{if(r!=="system")return;const B=window.matchMedia("(prefers-color-scheme: light)"),q=()=>C({theme:r,accent:o,colorTheme:c,uiFont:h,monoFont:y,uiFontSize:_,monoFontSize:w});return B.addEventListener("change",q),()=>B.removeEventListener("change",q)},[r,o,c,C,h,y,_,w]);const I=DS(r,c),L={theme:r,accent:o,colorTheme:c,uiFont:h,monoFont:y,uiFontSize:_,monoFontSize:w,resolvedTheme:I,setTheme:E,setAccent:N,setColorTheme:D,setUiFont:F,setMonoFont:M,setUiFontSize:A,setMonoFontSize:U};return s.jsx(Cg.Provider,{value:L,children:e})}/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const OS=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Rg=(...e)=>e.filter((n,r,l)=>!!n&&n.trim()!==""&&l.indexOf(n)===r).join(" ").trim();/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var BS={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const FS=x.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:r=2,absoluteStrokeWidth:l,className:o="",children:u,iconNode:c,...f},h)=>x.createElement("svg",{ref:h,...BS,width:n,height:n,stroke:e,strokeWidth:l?Number(r)*24/Number(n):r,className:Rg("lucide",o),...f},[...c.map(([m,y])=>x.createElement(m,y)),...Array.isArray(u)?u:[u]]));/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xe=(e,n)=>{const r=x.forwardRef(({className:l,...o},u)=>x.createElement(FS,{ref:u,iconNode:n,className:Rg(`lucide-${OS(e)}`,l),...o}));return r.displayName=`${e}`,r};/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _s=xe("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const IS=xe("AlarmClock",[["circle",{cx:"12",cy:"13",r:"8",key:"3y4lt7"}],["path",{d:"M12 9v4l2 2",key:"1c63tq"}],["path",{d:"M5 3 2 6",key:"18tl5t"}],["path",{d:"m22 6-3-3",key:"1opdir"}],["path",{d:"M6.38 18.7 4 21",key:"17xu3x"}],["path",{d:"M17.64 18.67 20 21",key:"kv2oe2"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const US=xe("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hr=xe("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const od=xe("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const HS=xe("Calculator",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["line",{x1:"8",x2:"16",y1:"6",y2:"6",key:"x4nwl0"}],["line",{x1:"16",x2:"16",y1:"14",y2:"18",key:"wjye3r"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M8 18h.01",key:"lrp35t"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qS=xe("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Pi=xe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ha=xe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const PS=xe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ws=xe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ks=xe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $S=xe("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const YS=xe("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const GS=xe("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const sd=xe("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Dg=xe("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Lg=xe("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const zg=xe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const KS=xe("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const VS=xe("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cd=xe("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ud=xe("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Og=xe("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const QS=xe("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Bg=xe("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Fg=xe("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const WS=xe("FilePen",[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1y4qbx"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const XS=xe("FilePlus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ig=xe("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ug=xe("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const JS=xe("FolderSearch",[["path",{d:"M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ZS=xe("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dd=xe("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ss=xe("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const eC=xe("HeartPulse",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}],["path",{d:"M3.22 12H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27",key:"1uw2ng"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const tC=xe("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const nC=xe("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const aC=xe("Laptop",[["path",{d:"M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16",key:"tarvll"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const rC=xe("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lC=xe("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Yn=xe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const iC=xe("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const oC=xe("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fd=xe("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const sC=xe("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cC=xe("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const uC=xe("Paperclip",[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dC=xe("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Hg=xe("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hd=xe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qg=xe("Puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Pg=xe("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fC=xe("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hC=xe("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Bl=xe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const mC=xe("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pC=xe("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gC=xe("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $g=xe("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yC=xe("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Yg=xe("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Gg=xe("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bC=xe("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Kg=xe("Stethoscope",[["path",{d:"M11 2v2",key:"1539x4"}],["path",{d:"M5 2v2",key:"1yf1q8"}],["path",{d:"M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1",key:"rb5t3r"}],["path",{d:"M8 15a6 6 0 0 0 12 0v-3",key:"x18d4x"}],["circle",{cx:"20",cy:"10",r:"2",key:"ts1r5v"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xC=xe("Store",[["path",{d:"m2 7 4.41-4.41A2 2 0 0 1 7.83 2h8.34a2 2 0 0 1 1.42.59L22 7",key:"ztvudi"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["path",{d:"M15 22v-4a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v4",key:"2ebpfo"}],["path",{d:"M2 7h20",key:"1fcdvo"}],["path",{d:"M22 7v3a2 2 0 0 1-2 2a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 16 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 12 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 8 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 4 12a2 2 0 0 1-2-2V7",key:"6c3vgh"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vC=xe("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _C=xe("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Vg=xe("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Cs=xe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wC=xe("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const js=xe("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kC=xe("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Qg=xe("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const SC=xe("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Wg=xe("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Xg=xe("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ma=xe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
 * @license lucide-react v0.468.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Jg=xe("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),Es="kylinbot_token";function CC(){var e;if(!(typeof window>"u"))try{const n=new URLSearchParams(window.location.search),r=(e=n.get("token"))==null?void 0:e.trim();if(!r)return;localStorage.setItem(Es,r);try{n.delete("token");const l=n.toString(),o=`${window.location.pathname}${l?"?"+l:""}${window.location.hash}`;window.history.replaceState(window.history.state,"",o)}catch{}}catch{}}CC();function mr(){try{return localStorage.getItem(Es)}catch{return null}}function Zg(e){try{localStorage.setItem(Es,e)}catch{}}function md(){try{localStorage.removeItem(Es)}catch{}}function pd(){const e=mr();return e!==null&&e.length>0}const eO=(function(){const n=typeof document<"u"&&document.createElement("link").relList;return n&&n.supports&&n.supports("modulepreload")?"modulepreload":"preload"})(),tO=function(e,n){return new URL(e,n).href},nO={},jC=function(n,r,l){let o=Promise.resolve();function u(c){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=c,window.dispatchEvent(f),!f.defaultPrevented)throw c}return o.then(c=>{for(const f of c||[])f.status==="rejected"&&u(f.reason);return n().catch(u)})},$i=()=>!!(window.isTauri||window.__TAURI_INTERNALS__||window.__TAURI__),ey=()=>{var e;return(e=window.__KYLINBOT_GATEWAY__)!=null?e:"http://127.0.0.1:42617"};async function Fl(){if(!$i())return null;try{return(await jC(()=>Promise.resolve().then(()=>$D),void 0,xt&&xt.tagName.toUpperCase()==="SCRIPT"&&xt.src||new URL("assets/index.js",document.baseURI).href)).getCurrentWindow()}catch(e){return console.error("Failed to import Tauri window API:",e),null}}async function EC(){const e=await Fl();await(e==null?void 0:e.close())}async function ty(){const e=await Fl();await(e==null?void 0:e.minimize())}async function NC(){const e=await Fl();await(e==null?void 0:e.toggleMaximize())}async function ny(){const e=await Fl();if(!e){console.warn("Not running in Tauri environment");return}try{const n=await e.isAlwaysOnTop();await e.setAlwaysOnTop(!n)}catch(n){console.error("Failed to toggle always on top:",n)}}async function ay(){const e=await Fl();if(!e)return!1;try{return await e.isAlwaysOnTop()}catch(n){return console.error("Failed to get always on top status:",n),!1}}async function TC(){const e=await Fl();await(e==null?void 0:e.startDragging())}const AC="kylinbot_close_action";function MC(){try{const e=localStorage.getItem(AC);if(e==="hide"||e==="exit")return e}catch{}return"exit"}async function RC(){MC()==="hide"?await ty():await EC()}const an=typeof window<"u"&&window.location.protocol==="qrc:",Il=an||$i()?"":((Yv=window.__KYLINBOT_BASE__)!=null?Yv:"").replace(/\/+$/,""),DC="./".replace(/\/+$/,""),$e=an?".":$i()?`${ey().replace(/\/+$/,"")}/_app`:`${Il}${DC}`,Ns=an?"":$i()?ey():"";let ka=null,Ts=null;const As=new Map;let LC=0;function zC(e,n){var l;const r=(l=n.split("?")[0])!=null?l:n;return e.toUpperCase()==="POST"&&/^\/api\/cron\/[^/]+\/run$/.test(r)?6e5:3e4}function gd(){return Ts||(Ts=new Promise((e,n)=>{var o;const r=window.QWebChannel,l=(o=window.qt)==null?void 0:o.webChannelTransport;if(console.log("[apiBridge] init: QWebChannel=",!!r,"transport=",!!l),!r||!l){const u=new Error("QWebChannel not available: QWebChannel="+!!r+" transport="+!!l);console.error("[apiBridge]",u.message),n(u);return}new r(l,u=>{console.log("[apiBridge] channel connected, objects:",Object.keys(u.objects));const c=u.objects.webApiBridge;if(!c){const f=new Error("webApiBridge not found in WebChannel objects: "+Object.keys(u.objects).join(", "));console.error("[apiBridge]",f.message),n(f);return}c.httpResponse.connect((f,h,m)=>{console.log("[apiBridge] response:",f,h,m.substring(0,100));const y=As.get(f);y&&(As.delete(f),y.resolve({status:h,body:m}))}),ka=c,console.log("[apiBridge] bridge ready"),e(c)})}),Ts)}async function yd(e,n={}){var f,h;const r=ka!=null?ka:await gd(),l=`req_${++LC}_${Date.now()}`,o=((f=n.method)!=null?f:"GET").toUpperCase(),u=(h=n.body)!=null?h:"",c=n.headers?JSON.stringify(n.headers):"";return console.log("[apiBridge] request:",l,o,e,"body.length:",u.length,"has headers:",!!n.headers),new Promise((m,y)=>{const g=zC(o,e),_=setTimeout(()=>{As.delete(l),y(new Error(`Bridge request timeout: ${o} ${e}`))},g);As.set(l,{resolve:v=>{clearTimeout(_),m(v)},reject:v=>{clearTimeout(_),y(v)}}),r.httpRequest(l,o,e,u,c)})}async function OC(){const e=ka!=null?ka:await gd();if(typeof e.isGatewayReachable!="function")throw new Error("webApiBridge.isGatewayReachable is not available");return e.isGatewayReachable()}async function BC(){const e=ka!=null?ka:await gd();if(typeof e.startGatewayDaemon!="function")throw new Error("webApiBridge.startGatewayDaemon is not available — rebuild kylin-aiassistant");return e.startGatewayDaemon()}/*!
 * Copyright (c) Squirrel Chat et al., All rights reserved.
 * SPDX-License-Identifier: BSD-3-Clause
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this
 *    list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 *    this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the copyright holder nor the names of its contributors
 *    may be used to endorse or promote products derived from this software without
 *    specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */function FC(e,n){let r=e.slice(0,n).split(/\r\n|\n|\r/g);return[r.length,r.pop().length+1]}function IC(e,n,r){let l=e.split(/\r\n|\n|\r/g),o="",u=(Math.log10(n+1)|0)+1;for(let c=n-1;c<=n+1;c++){let f=l[c-1];f&&(o+=c.toString().padEnd(u," "),o+=":  ",o+=f,o+=`
`,c===n&&(o+=" ".repeat(u+r+2),o+=`^
`))}return o}class et extends Error{constructor(r,l){const[o,u]=FC(l.toml,l.ptr),c=IC(l.toml,o,u);super(`Invalid TOML document: ${r}

${c}`,l);pt(this,"line");pt(this,"column");pt(this,"codeblock");this.line=o,this.column=u,this.codeblock=c}}/*!
 * Copyright (c) Squirrel Chat et al., All rights reserved.
 * SPDX-License-Identifier: BSD-3-Clause
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this
 *    list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 *    this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the copyright holder nor the names of its contributors
 *    may be used to endorse or promote products derived from this software without
 *    specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */function UC(e,n){let r=0;for(;e[n-++r]==="\\";);return--r&&r%2}function bd(e,n=0,r=e.length){let l=e.indexOf(`
`,n);return e[l-1]==="\r"&&l--,l<=r?l:-1}function Ms(e,n){for(let r=n;r<e.length;r++){let l=e[r];if(l===`
`)return r;if(l==="\r"&&e[r+1]===`
`)return r+1;if(l<" "&&l!=="	"||l==="")throw new et("control characters are not allowed in comments",{toml:e,ptr:n})}return e.length}function Ha(e,n,r,l){let o;for(;;){for(;(o=e[n])===" "||o==="	"||!r&&(o===`
`||o==="\r"&&e[n+1]===`
`);)n++;if(l||o!=="#")break;n=Ms(e,n)}return n}function HC(e,n,r,l,o=!1){if(!l)return n=bd(e,n),n<0?e.length:n;for(let u=n;u<e.length;u++){let c=e[u];if(c==="#")u=bd(e,u);else{if(c===r)return u+1;if(c===l||o&&(c===`
`||c==="\r"&&e[u+1]===`
`))return u}}throw new et("cannot find end of structure",{toml:e,ptr:n})}function ry(e,n){let r=e[n],l=r===e[n+1]&&e[n+1]===e[n+2]?e.slice(n,n+3):r;n+=l.length-1;do n=e.indexOf(l,++n);while(n>-1&&r!=="'"&&UC(e,n));return n>-1&&(n+=l.length,l.length>1&&(e[n]===r&&n++,e[n]===r&&n++)),n}/*!
 * Copyright (c) Squirrel Chat et al., All rights reserved.
 * SPDX-License-Identifier: BSD-3-Clause
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this
 *    list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 *    this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the copyright holder nor the names of its contributors
 *    may be used to endorse or promote products derived from this software without
 *    specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */let qC=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;const ni=class ni extends Date{constructor(r){let l=!0,o=!0,u="Z";if(typeof r=="string"){let c=r.match(qC);c?(c[1]||(l=!1,r=`0000-01-01T${r}`),o=!!c[2],o&&r[10]===" "&&(r=r.replace(" ","T")),c[2]&&+c[2]>23?r="":(u=c[3]||null,r=r.toUpperCase(),!u&&o&&(r+="Z"))):r=""}super(r);Hu(this,Ta,!1);Hu(this,Aa,!1);Hu(this,fn,null);isNaN(this.getTime())||(Fa(this,Ta,l),Fa(this,Aa,o),Fa(this,fn,u))}isDateTime(){return Qt(this,Ta)&&Qt(this,Aa)}isLocal(){return!Qt(this,Ta)||!Qt(this,Aa)||!Qt(this,fn)}isDate(){return Qt(this,Ta)&&!Qt(this,Aa)}isTime(){return Qt(this,Aa)&&!Qt(this,Ta)}isValid(){return Qt(this,Ta)||Qt(this,Aa)}toISOString(){let r=super.toISOString();if(this.isDate())return r.slice(0,10);if(this.isTime())return r.slice(11,23);if(Qt(this,fn)===null)return r.slice(0,-1);if(Qt(this,fn)==="Z")return r;let l=+Qt(this,fn).slice(1,3)*60+ +Qt(this,fn).slice(4,6);return l=Qt(this,fn)[0]==="-"?l:-l,new Date(this.getTime()-l*6e4).toISOString().slice(0,-1)+Qt(this,fn)}static wrapAsOffsetDateTime(r,l="Z"){let o=new ni(r);return Fa(o,fn,l),o}static wrapAsLocalDateTime(r){let l=new ni(r);return Fa(l,fn,null),l}static wrapAsLocalDate(r){let l=new ni(r);return Fa(l,Aa,!1),Fa(l,fn,null),l}static wrapAsLocalTime(r){let l=new ni(r);return Fa(l,Ta,!1),Fa(l,fn,null),l}};Ta=new WeakMap,Aa=new WeakMap,fn=new WeakMap;let xd=ni;/*!
 * Copyright (c) Squirrel Chat et al., All rights reserved.
 * SPDX-License-Identifier: BSD-3-Clause
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this
 *    list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 *    this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the copyright holder nor the names of its contributors
 *    may be used to endorse or promote products derived from this software without
 *    specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */let PC=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,$C=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,YC=/^[+-]?0[0-9_]/,GC=/^[0-9a-f]{2,8}$/i,ly={b:"\b",t:"	",n:`
`,f:"\f",r:"\r",e:"\x1B",'"':'"',"\\":"\\"};function iy(e,n=0,r=e.length){let l=e[n]==="'",o=e[n++]===e[n]&&e[n]===e[n+1];o&&(r-=2,e[n+=2]==="\r"&&n++,e[n]===`
`&&n++);let u=0,c,f="",h=n;for(;n<r-1;){let m=e[n++];if(m===`
`||m==="\r"&&e[n]===`
`){if(!o)throw new et("newlines are not allowed in strings",{toml:e,ptr:n-1})}else if(m<" "&&m!=="	"||m==="")throw new et("control characters are not allowed in strings",{toml:e,ptr:n-1});if(c){if(c=!1,m==="x"||m==="u"||m==="U"){let y=e.slice(n,n+=m==="x"?2:m==="u"?4:8);if(!GC.test(y))throw new et("invalid unicode escape",{toml:e,ptr:u});try{f+=String.fromCodePoint(parseInt(y,16))}catch{throw new et("invalid unicode escape",{toml:e,ptr:u})}}else if(o&&(m===`
`||m===" "||m==="	"||m==="\r")){if(n=Ha(e,n-1,!0),e[n]!==`
`&&e[n]!=="\r")throw new et("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:u});n=Ha(e,n)}else if(m in ly)f+=ly[m];else throw new et("unrecognized escape sequence",{toml:e,ptr:u});h=n}else!l&&m==="\\"&&(u=n-1,c=!0,f+=e.slice(h,u))}return f+e.slice(h,r-1)}function KC(e,n,r,l){if(e==="true")return!0;if(e==="false")return!1;if(e==="-inf")return-1/0;if(e==="inf"||e==="+inf")return 1/0;if(e==="nan"||e==="+nan"||e==="-nan")return NaN;if(e==="-0")return l?BigInt(0):0;let o=PC.test(e);if(o||$C.test(e)){if(YC.test(e))throw new et("leading zeroes are not allowed",{toml:n,ptr:r});e=e.replace(/_/g,"");let c=+e;if(isNaN(c))throw new et("invalid number",{toml:n,ptr:r});if(o){if((o=!Number.isSafeInteger(c))&&!l)throw new et("integer value cannot be represented losslessly",{toml:n,ptr:r});(o||l===!0)&&(c=BigInt(e))}return c}const u=new xd(e);if(!u.isValid())throw new et("invalid value",{toml:n,ptr:r});return u}/*!
 * Copyright (c) Squirrel Chat et al., All rights reserved.
 * SPDX-License-Identifier: BSD-3-Clause
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this
 *    list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 *    this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the copyright holder nor the names of its contributors
 *    may be used to endorse or promote products derived from this software without
 *    specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */function VC(e,n,r){let l=e.slice(n,r),o=l.indexOf("#");return o>-1&&(Ms(e,o),l=l.slice(0,o)),[l.trimEnd(),o]}function vd(e,n,r,l,o){if(l===0)throw new et("document contains excessively nested structures. aborting.",{toml:e,ptr:n});let u=e[n];if(u==="["||u==="{"){let[h,m]=u==="["?XC(e,n,l,o):WC(e,n,l,o);if(r){if(m=Ha(e,m),e[m]===",")m++;else if(e[m]!==r)throw new et("expected comma or end of structure",{toml:e,ptr:m})}return[h,m]}let c;if(u==='"'||u==="'"){c=ry(e,n);let h=iy(e,n,c);if(r){if(c=Ha(e,c),e[c]&&e[c]!==","&&e[c]!==r&&e[c]!==`
`&&e[c]!=="\r")throw new et("unexpected character encountered",{toml:e,ptr:c});c+=+(e[c]===",")}return[h,c]}c=HC(e,n,",",r);let f=VC(e,n,c-+(e[c-1]===","));if(!f[0])throw new et("incomplete key-value declaration: no value specified",{toml:e,ptr:n});return r&&f[1]>-1&&(c=Ha(e,n+f[1]),c+=+(e[c]===",")),[KC(f[0],e,n,o),c]}/*!
 * Copyright (c) Squirrel Chat et al., All rights reserved.
 * SPDX-License-Identifier: BSD-3-Clause
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this
 *    list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 *    this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the copyright holder nor the names of its contributors
 *    may be used to endorse or promote products derived from this software without
 *    specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */let QC=/^[a-zA-Z0-9-_]+[ \t]*$/;function _d(e,n,r="="){let l=n-1,o=[],u=e.indexOf(r,n);if(u<0)throw new et("incomplete key-value: cannot find end of key",{toml:e,ptr:n});do{let c=e[n=++l];if(c!==" "&&c!=="	")if(c==='"'||c==="'"){if(c===e[n+1]&&c===e[n+2])throw new et("multiline strings are not allowed in keys",{toml:e,ptr:n});let f=ry(e,n);if(f<0)throw new et("unfinished string encountered",{toml:e,ptr:n});l=e.indexOf(".",f);let h=e.slice(f,l<0||l>u?u:l),m=bd(h);if(m>-1)throw new et("newlines are not allowed in keys",{toml:e,ptr:n+l+m});if(h.trimStart())throw new et("found extra tokens after the string part",{toml:e,ptr:f});if(u<f&&(u=e.indexOf(r,f),u<0))throw new et("incomplete key-value: cannot find end of key",{toml:e,ptr:n});o.push(iy(e,n,f))}else{l=e.indexOf(".",n);let f=e.slice(n,l<0||l>u?u:l);if(!QC.test(f))throw new et("only letter, numbers, dashes and underscores are allowed in keys",{toml:e,ptr:n});o.push(f.trimEnd())}}while(l+1&&l<u);return[o,Ha(e,u+1,!0,!0)]}function WC(e,n,r,l){let o={},u=new Set,c;for(n++;(c=e[n++])!=="}"&&c;){if(c===",")throw new et("expected value, found comma",{toml:e,ptr:n-1});if(c==="#")n=Ms(e,n);else if(c!==" "&&c!=="	"&&c!==`
`&&c!=="\r"){let f,h=o,m=!1,[y,g]=_d(e,n-1);for(let w=0;w<y.length;w++){if(w&&(h=m?h[f]:h[f]={}),f=y[w],(m=Object.hasOwn(h,f))&&(typeof h[f]!="object"||u.has(h[f])))throw new et("trying to redefine an already defined value",{toml:e,ptr:n});!m&&f==="__proto__"&&Object.defineProperty(h,f,{enumerable:!0,configurable:!0,writable:!0})}if(m)throw new et("trying to redefine an already defined value",{toml:e,ptr:n});let[_,v]=vd(e,g,"}",r-1,l);u.add(_),h[f]=_,n=v}}if(!c)throw new et("unfinished table encountered",{toml:e,ptr:n});return[o,n]}function XC(e,n,r,l){let o=[],u;for(n++;(u=e[n++])!=="]"&&u;){if(u===",")throw new et("expected value, found comma",{toml:e,ptr:n-1});if(u==="#")n=Ms(e,n);else if(u!==" "&&u!=="	"&&u!==`
`&&u!=="\r"){let c=vd(e,n-1,"]",r-1,l);o.push(c[0]),n=c[1]}}if(!u)throw new et("unfinished array encountered",{toml:e,ptr:n});return[o,n]}/*!
 * Copyright (c) Squirrel Chat et al., All rights reserved.
 * SPDX-License-Identifier: BSD-3-Clause
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this
 *    list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 *    this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the copyright holder nor the names of its contributors
 *    may be used to endorse or promote products derived from this software without
 *    specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */function oy(e,n,r,l){var m,y;let o=n,u=r,c,f=!1,h;for(let g=0;g<e.length;g++){if(g){if(o=f?o[c]:o[c]={},u=(h=u[c]).c,l===0&&(h.t===1||h.t===2))return null;if(h.t===2){let _=o.length-1;o=o[_],u=u[_].c}}if(c=e[g],(f=Object.hasOwn(o,c))&&((m=u[c])==null?void 0:m.t)===0&&((y=u[c])!=null&&y.d))return null;f||(c==="__proto__"&&(Object.defineProperty(o,c,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(u,c,{enumerable:!0,configurable:!0,writable:!0})),u[c]={t:g<e.length-1&&l===2?3:l,d:!1,i:0,c:{}})}if(h=u[c],h.t!==l&&!(l===1&&h.t===3)||(l===2&&(h.d||(h.d=!0,o[c]=[]),o[c].push(o={}),h.c[h.i++]=h={t:1,d:!1,i:0,c:{}}),h.d))return null;if(h.d=!0,l===1)o=f?o[c]:o[c]={};else if(l===0&&f)return null;return[c,o,h.c]}function Rs(e,{maxDepth:n=1e3,integersAsBigInt:r}={}){let l={},o={},u=l,c=o;for(let f=Ha(e,0);f<e.length;){if(e[f]==="["){let h=e[++f]==="[",m=_d(e,f+=+h,"]");if(h){if(e[m[1]-1]!=="]")throw new et("expected end of table declaration",{toml:e,ptr:m[1]-1});m[1]++}let y=oy(m[0],l,o,h?2:1);if(!y)throw new et("trying to redefine an already defined table or value",{toml:e,ptr:f});c=y[2],u=y[1],f=m[1]}else{let h=_d(e,f),m=oy(h[0],u,c,0);if(!m)throw new et("trying to redefine an already defined table or value",{toml:e,ptr:f});let y=vd(e,h[1],void 0,n,r);m[1][m[0]]=y[0],f=y[1]}if(f=Ha(e,f,!0),e[f]&&e[f]!==`
`&&e[f]!=="\r")throw new et("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:f});f=Ha(e,f)}return l}/*!
 * Copyright (c) Squirrel Chat et al., All rights reserved.
 * SPDX-License-Identifier: BSD-3-Clause
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this
 *    list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 *    this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the copyright holder nor the names of its contributors
 *    may be used to endorse or promote products derived from this software without
 *    specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */let sy=/^[a-z0-9-_]+$/i;function Yi(e){let n=typeof e;if(n==="object"){if(Array.isArray(e))return"array";if(e instanceof Date)return"date"}return n}function JC(e){for(let n=0;n<e.length;n++)if(Yi(e[n])!=="object")return!1;return e.length!=0}function wd(e){return JSON.stringify(e).replace(/\x7f/g,"\\u007f")}function kd(e,n,r,l){if(r===0)throw new Error("Could not stringify the object: maximum object depth exceeded");if(n==="number")return isNaN(e)?"nan":e===1/0?"inf":e===-1/0?"-inf":l&&Number.isInteger(e)?e.toFixed(1):e.toString();if(n==="bigint"||n==="boolean")return e.toString();if(n==="string")return wd(e);if(n==="date"){if(isNaN(e.getTime()))throw new TypeError("cannot serialize invalid date");return e.toISOString()}if(n==="object")return ZC(e,r,l);if(n==="array")return e4(e,r,l)}function ZC(e,n,r){let l=Object.keys(e);if(l.length===0)return"{}";let o="{ ";for(let u=0;u<l.length;u++){let c=l[u];u&&(o+=", "),o+=sy.test(c)?c:wd(c),o+=" = ",o+=kd(e[c],Yi(e[c]),n-1,r)}return o+" }"}function e4(e,n,r){if(e.length===0)return"[]";let l="[ ";for(let o=0;o<e.length;o++){if(o&&(l+=", "),e[o]===null||e[o]===void 0)throw new TypeError("arrays cannot contain null or undefined values");l+=kd(e[o],Yi(e[o]),n-1,r)}return l+" ]"}function t4(e,n,r,l){if(r===0)throw new Error("Could not stringify the object: maximum object depth exceeded");let o="";for(let u=0;u<e.length;u++)o+=`${o&&`
`}[[${n}]]
`,o+=Sd(0,e[u],n,r,l);return o}function Sd(e,n,r,l,o){if(l===0)throw new Error("Could not stringify the object: maximum object depth exceeded");let u="",c="",f=Object.keys(n);for(let h=0;h<f.length;h++){let m=f[h];if(n[m]!==null&&n[m]!==void 0){let y=Yi(n[m]);if(y==="symbol"||y==="function")throw new TypeError(`cannot serialize values of type '${y}'`);let g=sy.test(m)?m:wd(m);if(y==="array"&&JC(n[m]))c+=(c&&`
`)+t4(n[m],r?`${r}.${g}`:g,l-1,o);else if(y==="object"){let _=r?`${r}.${g}`:g;c+=(c&&`
`)+Sd(_,n[m],_,l-1,o)}else u+=g,u+=" = ",u+=kd(n[m],y,l,o),u+=`
`}}return e&&(u||!c)&&(u=u?`[${e}]
${u}`:`[${e}]`),u&&c?`${u}
${c}`:u||c}function cy(e,{maxDepth:n=1e3,numbersAsFloat:r=!1}={}){if(Yi(e)!=="object")throw new TypeError("stringify can only be called with an object");let l=Sd(0,e,"",n,r);return l[l.length-1]!==`
`?l+`
`:l}function un(e){if(/^https?:\/\//.test(e))return e;const n=e.startsWith("/")?e:`/${e}`;if(an)return n;const r=`${Ns}${Il}`;return r?/^https?:\/\//.test(r)?new URL(n,`${r.replace(/\/+$/,"")}/`).toString():`${r}${n}`:n}async function pn(e,n){if(!an)return fetch(e,n);const r={};if(n!=null&&n.headers)if(n.headers instanceof Headers)n.headers.forEach((c,f)=>{r[f]=c});else if(Array.isArray(n.headers))for(const[c,f]of n.headers)r[c]=f;else Object.assign(r,n.headers);let l;if((n==null?void 0:n.body)instanceof FormData){const c=`----WebKitFormBoundary${Math.random().toString(36).substring(2)}`,f=new TextEncoder,h=[];for(const[w,j]of n.body.entries())if(typeof j=="string"){const T=`--${c}\r
Content-Disposition: form-data; name="${w}"\r
\r
${j}\r
`;h.push(f.encode(T))}else if(j instanceof File){console.log("[compatFetch] File entry:",w,j.name,j.size,j.type,"has arrayBuffer:",typeof j.arrayBuffer);let T;typeof j.arrayBuffer=="function"?T=new Uint8Array(await j.arrayBuffer()):T=await new Promise((M,A)=>{const U=new FileReader;U.onload=()=>M(new Uint8Array(U.result)),U.onerror=()=>A(new Error("FileReader error: "+U.error)),U.readAsArrayBuffer(j)}),console.log("[compatFetch] fileBytes length:",T.length);const C=`--${c}\r
Content-Disposition: form-data; name="${w}"; filename="${j.name}"\r
`,E=j.type?`Content-Type: ${j.type}\r
`:"",N=f.encode(C+E+`\r
`),D=f.encode(`\r
`),F=new Uint8Array(N.length+T.length+D.length);F.set(N,0),F.set(T,N.length),F.set(D,N.length+T.length),h.push(F)}h.push(f.encode(`--${c}--\r
`));const m=h.reduce((w,j)=>w+j.length,0);console.log("[compatFetch] total multipart body length:",m);const y=new Uint8Array(m);let g=0;for(const w of h)y.set(w,g),g+=w.length;let _="";const v=8192;for(let w=0;w<y.length;w+=v)_+=String.fromCharCode(...y.subarray(w,w+v));l=btoa(_),console.log("[compatFetch] base64 body length:",l.length),console.log("[compatFetch] boundary:",c),r["Content-Type"]=`multipart/form-data; boundary=${c}`,r["X-Body-Encoding"]="base64"}else typeof(n==null?void 0:n.body)=="string"&&(l=n.body);const o=e.startsWith("/")?e:`/${e}`,u=await yd(o,{method:n==null?void 0:n.method,headers:r,body:l});return{ok:u.status>=200&&u.status<300,status:u.status,statusText:"",json:()=>Promise.resolve(JSON.parse(u.body||"{}")),text:()=>Promise.resolve(u.body||"")}}class uy extends Error{constructor(){super("Unauthorized"),this.name="UnauthorizedError"}}class Gi extends Error{constructor(n,r){super(`[${r.code}] ${r.message}`),this.status=n,this.envelope=r,this.name="ApiError"}}async function Me(e,n={}){const r=mr();if(an){const c={};if(r&&(c.Authorization=`Bearer ${r}`),n.body&&typeof n.body=="string"&&!c["Content-Type"]&&(c["Content-Type"]="application/json"),n.headers)if(n.headers instanceof Headers)n.headers.forEach((m,y)=>{c[y]=m});else if(Array.isArray(n.headers))for(const[m,y]of n.headers)c[m]=y;else Object.assign(c,n.headers);const f=e.startsWith("/")?e:`/${e}`,h=await yd(f,{method:n.method,headers:c,body:typeof n.body=="string"?n.body:void 0});if(h.status===401)throw md(),window.dispatchEvent(new Event("kylinbot-unauthorized")),new uy;if(h.status<200||h.status>=300){if(h.body)try{const m=JSON.parse(h.body);if(m&&typeof m=="object"&&typeof m.code=="string"&&typeof m.message=="string")throw new Gi(h.status,m)}catch(m){if(m instanceof Gi)throw m}throw new Error(`API ${h.status}: ${h.body||"Unknown error"}`)}return h.status===204||!h.body?void 0:JSON.parse(h.body)}const l=new Headers(n.headers);r&&l.set("Authorization",`Bearer ${r}`),n.body&&typeof n.body=="string"&&!l.has("Content-Type")&&l.set("Content-Type","application/json");const o=n.body instanceof FormData?{...n,headers:r?{Authorization:`Bearer ${r}`}:{}}:{...n,headers:l},u=await fetch(un(e),o);if(u.status===401)throw md(),window.dispatchEvent(new Event("kylinbot-unauthorized")),new uy;if(!u.ok){const c=await u.text().catch(()=>"");if(c)try{const f=JSON.parse(c);if(f&&typeof f=="object"&&typeof f.code=="string"&&typeof f.message=="string")throw new Gi(u.status,f)}catch(f){if(f instanceof Gi)throw f}throw new Error(`API ${u.status}: ${c||u.statusText}`)}if(u.status!==204)return u.json()}function Sa(e,n){if(e!==null&&typeof e=="object"&&!Array.isArray(e)&&n in e){const r=e[n];if(r!==void 0)return r}return e}async function n4(e){const n=await pn(un("/pair"),{method:"POST",headers:{"X-Pairing-Code":e}});if(!n.ok){const l=await n.text().catch(()=>"");throw new Error(`Pairing failed (${n.status}): ${l||n.statusText}`)}const r=await n.json();return Zg(r.token),r}async function dy(){const e=await pn(un("/pair/code"));if(e.ok)return e.json();const n=await pn(un("/admin/paircode"));if(!n.ok)throw new Error(`Failed to fetch pairing code (${n.status})`);return n.json()}async function a4(){const e=await pn(un("/health"));if(!e.ok)throw new Error(`Health check failed (${e.status})`);return e.json()}function r4(e){return e>=200&&e<300}async function l4(){if(an){const n=await yd("/health");return r4(n.status)}return(await pn(un("/health"),{cache:"no-store"})).ok}async function Ds(){const e=an?4:1;for(let n=0;n<e;n++)try{return await l4()}catch{if(n+1>=e){if(an)try{return await OC()}catch{return!1}return!1}await new Promise(l=>setTimeout(l,250*(n+1)))}return!1}async function i4(){if(an)try{return await BC()}catch(e){return console.error("[checkGateway] startGatewayDaemon failed:",e),!1}return!1}function Ls(){return Me("/api/status")}function Cd(){return Me("/api/config").then(e=>typeof e=="string"?e:e.content)}function o4(e){return Me("/api/config",{method:"PUT",headers:{"Content-Type":"application/toml"},body:e})}function s4(){return Me("/api/tools").then(e=>Sa(e,"tools"))}function c4(){return Me("/api/skills").then(e=>Sa(e,"skills"))}function u4(e,n){return Me(`/api/skills/${encodeURIComponent(e)}/toggle`,{method:"PUT",body:JSON.stringify({enabled:n})})}function d4(e){return Me(`/api/skills/${encodeURIComponent(e)}/open-folder`,{method:"POST"})}function f4(e,n){return Me(`/api/skills/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(n)})}function jd(e){return Me(`/api/skills/${encodeURIComponent(e)}`,{method:"DELETE"})}function h4(e){const n=new FormData;n.append("file",e);const r=mr();return pn(un("/api/skills/import"),{method:"POST",body:n,headers:r?{Authorization:`Bearer ${r}`}:{}}).then(async l=>{if(!l.ok){const o=await l.text().catch(()=>"");let u=null;try{u=JSON.parse(o)}catch{}if(u&&u.duplicate&&l.status===409){const c=new Error(`API ${l.status}: ${o}`);throw c.duplicate=!0,c.skillName=u.name||"",c}throw new Error(`API ${l.status}: ${o||l.statusText}`)}return l.json()})}function m4(){return Me("/api/cron").then(e=>Sa(e,"jobs"))}function p4(e){return Me("/api/cron",{method:"POST",body:JSON.stringify(e)}).then(n=>typeof n.job=="object"?n.job:n)}function g4(e){return Me(`/api/cron/${encodeURIComponent(e)}`,{method:"DELETE"})}function y4(e,n){return Me(`/api/cron/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(n)}).then(r=>typeof r.job=="object"?r.job:r)}function b4(e,n=!1){return Me(`/api/cron/${encodeURIComponent(e)}/run`,{method:"POST",body:JSON.stringify({approved:n})})}function x4(e){return Me(`/api/cron/${encodeURIComponent(e)}/pause`,{method:"POST"}).then(n=>typeof n.job=="object"?n.job:n)}function v4(e){return Me(`/api/cron/${encodeURIComponent(e)}/resume`,{method:"POST"}).then(n=>typeof n.job=="object"?n.job:n)}function _4(){return Me("/api/integrations").then(e=>Sa(e,"integrations"))}function w4(){return Me("/api/doctor",{method:"POST",body:JSON.stringify({})}).then(e=>Array.isArray(e)?e:e.results)}function k4(e,n){const r=new URLSearchParams;e&&r.set("query",e),n&&r.set("category",n);const l=r.toString();return Me(`/api/memory${l?`?${l}`:""}`).then(o=>Sa(o,"entries"))}function S4(e,n,r){return Me("/api/memory",{method:"POST",body:JSON.stringify({key:e,content:n,category:r})}).then(()=>{})}function C4(e){return Me(`/api/memory/${encodeURIComponent(e)}`,{method:"DELETE"})}function zs(){return Me("/api/cost").then(e=>Sa(e,"cost"))}function j4(e){return Me("/api/cost/purge",{method:"POST",body:JSON.stringify({models:e})}).then(n=>{var r;return{removed_records:(r=n.removed_records)!=null?r:0}})}function fy(){return Me("/api/sessions").then(e=>Sa(e,"sessions"))}function E4(e){return Me(`/api/sessions/${encodeURIComponent(e)}/messages`)}function hy(){return Me("/api/channels").then(e=>Sa(e,"channels"))}function N4(){return Me("/api/agents").then(e=>Sa(e,"agents"))}function T4(){return Me("/api/cli-tools").then(e=>Sa(e,"cli_tools"))}function A4(){return pn(un("/api/wechat/qrcode")).then(e=>e.ok?e.json():e.json().then(n=>Promise.reject(new Error(n.error||`QR code request failed (${e.status})`))))}function M4(e){const n=new URLSearchParams({qrcode:e});return pn(un(`/api/wechat/status?${n}`)).then(r=>r.ok?r.json():r.json().then(l=>Promise.reject(new Error(l.error||`Status poll failed (${r.status})`))))}function R4(){return pn(un("/api/feishu/register/begin"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(e=>e.ok?e.json():e.json().then(n=>Promise.reject(new Error(n.error||`Feishu registration begin failed (${e.status})`))))}function D4(e){return pn(un("/api/feishu/register/poll"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({device_code:e})}).then(n=>n.ok?n.json():n.json().then(r=>Promise.reject(new Error(r.error||`Feishu registration poll failed (${n.status})`))))}function L4(e,n){return Me("/api/feishu/config",{method:"POST",body:JSON.stringify({app_id:e,app_secret:n})})}function z4(){return pn(un("/api/dingtalk/register/begin"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(e=>e.ok?e.json():e.json().then(n=>Promise.reject(new Error(n.error||`DingTalk registration begin failed (${e.status})`))))}function O4(e){return pn(un("/api/dingtalk/register/poll"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({device_code:e})}).then(n=>n.ok?n.json():n.json().then(r=>Promise.reject(new Error(r.error||`DingTalk registration poll failed (${n.status})`))))}function B4(e,n){return Me("/api/dingtalk/config",{method:"POST",body:JSON.stringify({client_id:e,client_secret:n})})}function F4(){return pn(un("/api/wecom/qrcode"),{method:"GET",headers:{"Content-Type":"application/json"}}).then(e=>e.ok?e.json():e.json().then(n=>Promise.reject(new Error(n.error||`WeCom QR code request failed (${e.status})`))))}function I4(e){return pn(un(`/api/wecom/status?scode=${encodeURIComponent(e)}`),{method:"GET",headers:{"Content-Type":"application/json"}}).then(n=>n.ok?n.json():n.json().then(r=>Promise.reject(new Error(r.error||`WeCom status check failed (${n.status})`))))}function U4(e,n){return Me("/api/wecom/config",{method:"POST",body:JSON.stringify({bot_id:e,secret:n})})}const H4="https://apigw-cec.cec.com.cn/open/apigw";function q4(e,n,r){const l=r==null?void 0:r.trim();return{app_id:e,app_secret:n,...l?{api_gateway_url:l}:{}}}function P4(e,n,r){return Me("/api/lansenger/config",{method:"POST",body:JSON.stringify(q4(e,n,r))})}function $4(){return Me("/api/wechat/account")}const Xr={wechat:"Bot ID",wecom:"Bot ID",dingtalk:"Client ID",feishu:"App ID",lansenger:"App ID"};async function Y4(e){var r,l,o,u,c,f;const n=(await hy()).find(h=>{const m=h.type.toLowerCase();return m===e||e==="wechat"&&m==="weixin"});if((r=n==null?void 0:n.identifier)!=null&&r.value)return{label:Xr[e],value:n.identifier.value};switch(e){case"wechat":try{const h=await $4();return{label:Xr[e],value:((l=h.account_id)==null?void 0:l.split("@")[0])||"—"}}catch{return{label:Xr[e],value:"—"}}case"wecom":case"dingtalk":case"feishu":case"lansenger":{const h=await Cd(),y=Rs(h).channels,g=y==null?void 0:y[e];switch(e){case"wecom":return{label:Xr[e],value:String((o=g==null?void 0:g.bot_id)!=null?o:"—")};case"dingtalk":return{label:Xr[e],value:String((u=g==null?void 0:g.client_id)!=null?u:"—")};case"feishu":return{label:Xr[e],value:String((c=g==null?void 0:g.app_id)!=null?c:"—")};case"lansenger":return{label:Xr[e],value:String((f=g==null?void 0:g.app_id)!=null?f:"—")};default:return{label:"ID",value:"—"}}}}}async function G4(e){await Me(`/api/channels/${encodeURIComponent(e)}`,{method:"DELETE"})}function Ki(e){return Me(`/api/config/prop?path=${encodeURIComponent(e)}`)}function my(e){const n=`?prefix=${encodeURIComponent(e)}`;return Me(`/api/config/list${n}`)}function pr(e){return Me("/api/config",{method:"PATCH",body:JSON.stringify(e)})}function py(e,n){return Me(`/api/onboard/sections/${encodeURIComponent(e)}/items/${encodeURIComponent(n)}`,{method:"POST"})}function K4(e){return Me(`/api/onboard/catalog/models?provider=${encodeURIComponent(e)}`)}const Os={zh:{"nav.dashboard":"仪表盘","nav.agent":"智能体","nav.tools":"工具","nav.cron":"定时任务","nav.integrations":"集成","nav.modelswitch":"模型配置","nav.skills":"技能","nav.history":"历史对话","nav.general":"常规","nav.memory":"记忆","nav.config":"配置","nav.cost":"成本追踪","nav.logs":"日志","nav.doctor":"诊断","nav.canvas":"画布","dashboard.title":"仪表盘","dashboard.provider":"提供商","dashboard.model":"模型","dashboard.uptime":"运行时间","dashboard.temperature":"温度","dashboard.gateway_port":"网关端口","dashboard.memory_backend":"记忆后端","dashboard.paired":"已配对","dashboard.channels":"频道","dashboard.health":"健康状态","dashboard.status":"状态","dashboard.overview":"概览","dashboard.system_info":"系统信息","dashboard.quick_actions":"快速操作","agent.title":"智能体对话","agent.send":"发送","agent.placeholder":"输入任务或问我任何问题","agent.start_conversation":"发送消息开始对话","agent.type_message":"输入消息...","agent.light_greeting_title":"你好，我是小K！","agent.light_greeting_subtitle":"描述你的任务，我将为你自动执行，让复杂工作变得简单。","agent.light_try_label":"你可以尝试：","agent.light_refresh_label":"换一换","agent.light_card_recommended":"推荐问题","agent.light_card_knowledge":"知识库","agent.light_card_knowledge_prompt":"帮我总结知识库里的重点内容。","agent.light_suggestion_one":"如何去除白色衣服上的咖啡渍？","agent.light_suggestion_two":"有哪些适合团队破冰的小游戏？","agent.light_suggestion_three":"帮我写一封简短的客户跟进邮件。","agent.light_suggestion_four":"如何把一篇长文章总结成要点？","agent.light_suggestion_five":"Excel 里怎么按条件求和？","agent.light_suggestion_six":"帮我写一段产品上线的通知文案。","agent.light_suggestion_seven":"初学者如何开始学习编程？","agent.light_suggestion_eight":"出差三天需要带什么清单？","agent.light_suggestion_nine":"用通俗语言解释什么是 API。","agent.light_type_message":"输入任务或问我任何问题","agent.light_tool_model":"智能模型调度","agent.light_tool_expand":"深度思考","agent.light_tool_search":"联网搜索","agent.model_selector_title":"选择模型","agent.model_selector_configured":"已配置模型","agent.model_selector_no_configured":"未配置其他模型","agent.connecting":"连接中...","agent.connected":"已连接","agent.disconnected":"已断开","agent.reconnecting":"重新连接中...","agent.thinking":"思考中...","agent.tool_call":"工具调用","agent.tool_result":"工具结果","agent.connection_error":"连接错误，正在尝试重连...","agent.tool_call_prefix":"[工具调用]","agent.tool_result_prefix":"[工具结果]","agent.error_prefix":"[错误]","agent.unknown_error":"未知错误","agent.send_error":"发送消息失败，请重试。","agent.copy_message":"复制消息","agent.show_json":"展开 JSON","agent.hide_json":"收起 JSON","agent.toggle_system_messages":"切换系统消息显示","agent.connected_status":"已连接","agent.disconnected_status":"已断开","agent.generating_block_tip":"正在生成回答，请完成后再试","header.new_session":"开启新对话","header.window_pin":"置顶","header.window_minimize":"最小化","header.window_maximize":"最大化","header.window_close":"关闭","modelswitch.tab.general":"常规","modelswitch.tab.model":"模型配置","modelswitch.always_on_top":"窗口置顶","modelswitch.close_action":"关闭窗口时","modelswitch.close_action_hide":"隐藏窗口","modelswitch.close_action_exit":"直接退出","tools.title":"可用工具","tools.name":"名称","tools.description":"描述","tools.parameters":"参数","tools.search":"搜索工具...","tools.empty":"暂无可用工具。","tools.count":"工具总数","tools.agent_tools":"智能体工具箱","tools.cli_tools":"CLI 工具箱","tools.parameter_schema":"参数结构","tools.path":"路径","tools.version":"版本","tools.category":"类别","tools.load_error":"加载工具失败","cron.title":"定时任务","cron.task_list":"任务列表","cron.prompt_col":"指令","cron.status_success":"成功","cron.status_failed":"失败","cron.scheduled_tasks":"定时任务","cron.add":"添加任务","cron.add_job":"添加任务","cron.modal_add":"添加","cron.add_modal_title":"添加任务","cron.delete":"删除","cron.enable":"启用","cron.disable":"禁用","cron.name":"名称","cron.name_optional":"名称（可选）","cron.command":"命令","cron.command_required":"命令","cron.schedule":"计划","cron.schedule_required":"计划","cron.schedule_kind_cron":"Cron 表达式","cron.schedule_kind_at":"指定时间","cron.schedule_kind_every":"固定间隔","cron.schedule_cron_placeholder":"例如 0 0 * * *","cron.schedule_tz_optional":"时区（可选，例如 Asia/Shanghai）","cron.schedule_every_ms_placeholder":"间隔毫秒数（例如 60000）","cron.next_run":"下次执行","cron.last_run":"上次执行","cron.last_status":"上次状态","cron.enabled":"已启用","cron.enabled_status":"启用","cron.disabled_status":"禁用","cron.empty":"暂无定时任务。","cron.confirm_delete":"确定要删除此任务吗？","cron.delete_desc":"删除后，将不再自动执行该任务，且无法恢复。","cron.load_error":"加载定时任务失败","cron.validation_error":"计划和命令是必需的。","cron.add_error":"添加任务失败","cron.delete_error":"删除任务失败","cron.cancel":"取消","cron.adding":"添加中...","cron.id":"ID","cron.actions":"操作","cron.loading_run_history":"加载运行历史...","cron.load_run_history_error":"加载运行历史失败","cron.no_runs":"暂无运行记录。","cron.recent_runs":"最近运行","cron.yes":"是","cron.no":"否","cron.edit":"编辑","cron.edit_modal_title":"编辑任务","cron.edit_error":"更新任务失败","cron.saving":"保存中...","cron.save":"保存","cron.confirm":"确定","cron.job_type":"任务类型","cron.job_type_shell":"Shell","cron.job_type_agent":"Agent","cron.session_target":"会话目标","cron.session_target_isolated":"隔离会话","cron.session_target_main":"主会话","cron.model_optional":"模型（可选）","cron.allowed_tools":"允许工具（逗号分隔）","cron.delivery_mode":"投递模式","cron.delivery_mode_none":"无","cron.delivery_mode_announce":"通告","cron.delivery_channel":"投递通道","cron.delivery_target":"投递目标","cron.delivery_best_effort":"尽力投递","cron.enable_job":"启用任务","cron.delete_after_run":"运行后删除","cron.run_now":"立即执行","cron.pause_job":"暂停任务","cron.resume_job":"恢复任务","cron.run_error":"执行任务失败","cron.toggle_error":"切换任务状态失败","cron.catch_up_title":"启动时补跑错过任务","cron.catch_up_desc":"KylinBot 重启后补执行停机期间应执行的任务","cron.name_placeholder":"例如 每日清理","cron.command_shell_placeholder":"例如 cleanup --older-than 7d","cron.command_agent_placeholder":"输入要交给 Agent 执行的提示词","cron.model_placeholder":"例如 gpt-4.1","cron.allowed_tools_placeholder":"file_read,web_search","cron.toggle_run_history":"展开/收起运行历史","cron.task_name":"任务名称","cron.task_prompt_label":"任务指令","cron.task_name_placeholder":"请输入任务名称","cron.task_prompt_placeholder":"请输入任务指令。例如：每天推荐5个实用英语单词","cron.exec_time":"执行时间","cron.daily_time_step_up":"增加一分钟","cron.daily_time_step_down":"减少一分钟","cron.once_run_date":"执行日期","cron.once_date_step_up":"增加一天","cron.once_date_step_down":"减少一天","cron.once_open_calendar":"打开日历","cron.once_time_past":"执行时间不能早于当前时间","cron.cal_prev_year":"上一年","cron.cal_prev_month":"上个月","cron.cal_next_month":"下个月","cron.cal_next_year":"下一年","cron.cal_head_1":"一","cron.cal_head_2":"二","cron.cal_head_3":"三","cron.cal_head_4":"四","cron.cal_head_5":"五","cron.cal_head_6":"六","cron.cal_head_7":"日","cron.schedule_daily_label":"每天","cron.schedule_interval_label":"间隔","cron.schedule_once_label":"单次","cron.schedule_custom_label":"自定义","cron.remote_channel":"远控通道","cron.exec_model":"执行模型","cron.channel_main":"主对话","cron.interval_every":"每","cron.interval_row_label":"每间隔","cron.interval_step_up":"间隔数值加一","cron.interval_step_down":"间隔数值减一","cron.interval_unit_minute":"分钟","cron.interval_unit_hour":"小时","cron.interval_unit_day":"天","cron.interval_effective_time":"生效时间","cron.date_range":"日期区间","cron.date_range_start":"开始时间","cron.date_range_end":"结束时间","cron.model_default":"默认","cron.weekday_1":"周一","cron.weekday_2":"周二","cron.weekday_3":"周三","cron.weekday_4":"周四","cron.weekday_5":"周五","cron.weekday_6":"周六","cron.weekday_7":"周日","integrations.title":"集成","integrations.available":"可用","integrations.active":"活跃","integrations.coming_soon":"即将推出","integrations.category":"类别","integrations.status":"状态","integrations.search":"搜索集成...","integrations.empty":"未找到集成。","integrations.activate":"激活","integrations.deactivate":"停用","integrations.load_error":"加载集成失败","integrations.status_active":"活跃","integrations.status_available":"可用","integrations.status_coming_soon":"即将推出","modelswitch.title":"模型配置","modelswitch.all":"全部","modelswitch.empty":"未找到模型。","modelswitch.status_active":"已激活","modelswitch.status_available":"可用","modelswitch.status_coming_soon":"即将推出","skills.title":"技能","skills.all":"全部","skills.empty":"未找到技能。","skills.enabled":"已启用","skills.disabled":"已禁用","skills.status_active":"已激活","skills.status_available":"可用","skills.status_coming_soon":"即将推出","memory.title":"记忆存储","memory.memory_title":"记忆","memory.search":"搜索记忆...","memory.search_placeholder":"搜索记忆条目...","memory.add":"存储记忆","memory.add_memory":"添加记忆","memory.add_modal_title":"添加记忆","memory.delete":"删除","memory.key":"键","memory.key_required":"键","memory.content":"内容","memory.content_required":"内容","memory.category":"类别","memory.category_optional":"类别（可选）","memory.timestamp":"时间戳","memory.session":"会话","memory.score":"分数","memory.empty":"未找到记忆条目。","memory.confirm_delete":"确定要删除此记忆条目吗？","memory.all_categories":"所有类别","memory.search_button":"搜索","memory.load_error":"加载记忆失败","memory.saving":"保存中...","memory.validation_error":"键和内容是必需的。","memory.store_error":"保存记忆失败","memory.delete_error":"删除记忆失败","memory.delete_confirm":"删除？","memory.yes":"是","memory.no":"否","memory.cancel":"取消","config.title":"配置","config.save":"保存","config.saving":"保存中...","config.reset":"重置","config.saved":"配置保存成功。","config.error":"配置保存失败。","config.loading":"加载配置中...","config.editor_placeholder":"TOML 配置...","config.configuration_title":"配置","config.sensitive_title":"敏感字段已隐藏","config.sensitive_hint":"API 密钥、令牌和密码已隐藏以保护安全。要更新已隐藏的字段，请将整个隐藏值替换为您的新值。","config.save_success":"配置保存成功。","config.save_error":"保存配置失败","config.toml_label":"TOML 配置","config.lines":"行","config.mode.form":"表单","config.mode.advanced":"高级","config.section.general":"常规","config.section.agent":"智能体","config.section.gateway":"网关","config.section.cost":"成本","config.section.memory":"记忆","config.section.web_search":"网页搜索","config.section.heartbeat":"心跳","config.field.default_provider":"默认模型提供商","config.field.default_provider.desc":"LLM 提供商（如 openrouter、ollama、anthropic）","config.field.default_model":"默认模型","config.field.default_model.desc":"默认提供商的模型名称","config.field.default_temperature":"温度","config.field.default_temperature.desc":"控制随机性（0 = 确定性，2 = 最大创造力）","config.field.provider_timeout_secs":"提供商超时（秒）","config.field.provider_timeout_secs.desc":"LLM API 调用的 HTTP 超时时间","config.field.locale":"语言","config.field.locale.desc":"UI 语言设置","config.field.compact_context":"紧凑上下文","config.field.compact_context.desc":"为小模型（13B 或更小）减少上下文大小","config.field.max_tool_iterations":"最大工具迭代次数","config.field.max_tool_iterations.desc":"每条用户消息的最大工具调用循环次数","config.field.max_history_messages":"最大历史消息数","config.field.max_history_messages.desc":"每个会话的最大对话历史消息数","config.field.max_context_tokens":"最大上下文令牌数","config.field.max_context_tokens.desc":"超过时触发历史压缩","config.field.parallel_tools":"并行工具","config.field.parallel_tools.desc":"在单次轮中启用并行工具执行","config.field.gateway_port":"端口","config.field.gateway_port.desc":"网关服务器端口","config.field.gateway_host":"主机","config.field.gateway_host.desc":"网关绑定地址","config.field.require_pairing":"需要配对","config.field.require_pairing.desc":"接受请求前需要设备配对","config.field.session_persistence":"会话持久化","config.field.session_persistence.desc":"将 WebSocket 会话持久化到 SQLite","config.field.session_ttl_hours":"会话 TTL（小时）","config.field.session_ttl_hours.desc":"自动归档过期会话（0 = 禁用）","config.field.allow_public_bind":"允许公网绑定","config.field.allow_public_bind.desc":"允许在无隧道情况下绑定非本地地址","config.field.daily_limit_usd":"每日限额（美元）","config.field.daily_limit_usd.desc":"每日支出限额","config.field.monthly_limit_usd":"每月限额（美元）","config.field.monthly_limit_usd.desc":"每月支出限额","config.field.warn_at_percent":"警告阈值（%）","config.field.warn_at_percent.desc":"预算使用超过此百分比时发出警告","config.field.allow_override":"允许覆盖","config.field.allow_override.desc":"允许 --override 标志超出预算限制","config.field.memory_enabled":"开启记忆","config.field.memory_enabled.desc":"启用智能体记忆功能","config.field.memory_backend":"后端","config.field.memory_backend.desc":"智能体记忆的存储后端","config.field.heartbeat_enabled":"开启心跳","config.field.heartbeat_enabled.desc":"按计划触发心跳检查","config.field.web_search_enabled":"开启网页搜索","config.field.web_search_enabled.desc":"允许智能体使用网页搜索工具","config.field.cost_enabled":"开启成本限制","config.field.cost_enabled.desc":"启用预算与支出追踪","config.field.web_search_provider":"搜索提供商","config.field.web_search_provider.desc":"使用的网页搜索引擎","config.field.max_results":"最大结果数","config.field.max_results.desc":"每次搜索查询的结果数","config.field.web_search_timeout":"超时（秒）","config.field.web_search_timeout.desc":"搜索请求超时时间","config.field.interval_minutes":"间隔（分钟）","config.field.interval_minutes.desc":"心跳检查之间的分钟数","config.field.two_phase":"两阶段","config.field.two_phase.desc":"执行前询问 LLM 是否运行（节省成本）","config.field.adaptive":"自适应","config.field.adaptive.desc":"根据活动自动调整间隔","config.field.min_interval_minutes":"最小间隔（分钟）","config.field.min_interval_minutes.desc":"自适应模式启用时的最小间隔","config.field.max_interval_minutes":"最大间隔（分钟）","config.field.max_interval_minutes.desc":"自适应模式回退时的最大间隔","config.field.heartbeat_message":"备用消息","config.field.heartbeat_message.desc":"HEARTBEAT.md 无条目时的备用任务文本","config.field.heartbeat_target":"目标频道","config.field.heartbeat_target.desc":"心跳输出的投递频道（如 telegram）","config.field.task_timeout_secs":"任务超时（秒）","config.field.task_timeout_secs.desc":"单次心跳智能体调用的最大秒数","config.error.serialize_failed":"序列化配置失败","config.error.invalid_toml_switch":"TOML 无效 — 请先修正错误再切换到表单视图","config.error.reload_failed":"重新加载配置失败","config.error.initial_parse_failed":"无法解析配置文件，已显示空表单；请检查 TOML 或改用其他方式编辑。","cost.title":"成本追踪","cost.session":"会话成本","cost.daily":"每日成本","cost.monthly":"每月成本","cost.total_tokens":"总 Tokens","cost.request_count":"请求数","cost.by_model":"按模型统计","cost.model":"模型","cost.tokens":"Token","cost.requests":"请求","cost.usd":"成本（美元）","cost.load_error":"加载成本数据失败","cost.session_cost":"会话成本","cost.daily_cost":"每日成本","cost.monthly_cost":"每月成本","cost.total_requests":"总请求数","cost.token_statistics":"Token 统计","cost.avg_tokens_per_request":"平均 Token / 请求","cost.cost_per_1k_tokens":"每 1K Token 成本","cost.model_breakdown":"模型细分","cost.no_model_data":"没有模型数据可用。","cost.cost":"成本","cost.share":"占比","model.title":"模型","model.add":"添加","model.edit":"编辑","model.delete":"删除","model.more":"更多","model.dialog.add_title":"添加模型","model.dialog.edit_title":"编辑模型","model.field.provider":"模型提供商","model.field.name":"模型名称","model.field.api_key":"APIKey","model.field.base_url":"请求地址","model.field.name_placeholder":"必填（例如：deepseek-v3.2）","model.field.api_key_placeholder":"选填（云端服务必填）","model.field.base_url_placeholder":"https://api.minimaxi.com/v1","model.delete_confirm":"删除后将无法恢复，是否确认删除该模型？","model.error.duplicate":"该模型已存在，请使用不同的模型名称","model.error.invalid_url":"请求地址需以 http:// 或 https:// 开头","model.empty_stats_hint":"暂未配置模型，添加后将自动显示用量统计。","model.no_models_chat_prompt":"未检测到可用 AI 模型，当前无法开始任务，请前往模型管理完成配置。","model.no_models_chat_action":"立即配置","logs.title":"实时日志","logs.live_logs":"实时日志","logs.clear":"清除","logs.pause":"暂停","logs.resume":"继续","logs.filter":"筛选日志...","logs.filter_label":"筛选","logs.empty":"暂无日志条目。","logs.connected":"已连接","logs.disconnected":"已断开","logs.events":"事件","logs.jump_to_bottom":"跳转到底部","logs.paused_hint":"日志流已暂停。","logs.waiting_hint":"等待事件...","doctor.title":"系统诊断","doctor.diagnostics_title":"系统诊断","doctor.run":"运行诊断","doctor.run_diagnostics":"运行诊断","doctor.running":"正在运行诊断...","doctor.running_btn":"运行中...","doctor.running_desc":"正在运行诊断...","doctor.running_hint":"这可能需要几秒钟。","doctor.ok":"正常","doctor.warn":"警告","doctor.error":"错误","global.refresh":"刷新","doctor.severity":"严重程度","doctor.category":"类别","doctor.message":"消息","doctor.empty":"尚未运行诊断。","doctor.summary":"诊断摘要","doctor.issues_found":"发现问题","doctor.warnings_summary":"警告","doctor.all_clear":"一切正常","doctor.system_diagnostics":"系统诊断","doctor.empty_hint":'点击"运行诊断"检查您的 KylinBot 安装。',"auth.pair":"配对设备","auth.pairing_code":"配对码","auth.pair_button":"配对","auth.logout":"退出","auth.pairing_success":"配对成功！","auth.pairing_failed":"配对失败，请重试。","auth.enter_code":"请输入配对码以连接到智能体。","common.loading":"加载中...","common.error":"发生错误。","common.retry":"重试","common.cancel":"取消","common.confirm":"确认","common.save":"保存","common.delete":"删除","common.edit":"编辑","common.close":"关闭","common.yes":"是","common.no":"否","common.search":"搜索...","common.no_data":"暂无数据。","common.refresh":"刷新","common.back":"返回","common.actions":"操作","common.name":"名称","common.description":"描述","common.status":"状态","common.created":"创建时间","common.updated":"更新时间","health.title":"系统健康","health.component":"组件","health.status":"状态","health.last_ok":"上次正常","health.last_error":"上次错误","health.restart_count":"重启次数","health.pid":"进程 ID","health.uptime":"运行时间","health.updated_at":"最后更新","dashboard.provider_model":"提供商 / 模型","dashboard.since_last_restart":"自上次重启","dashboard.paired_yes":"是","dashboard.paired_no":"否","dashboard.cost_overview":"成本概览","dashboard.active_channels":"活跃频道","dashboard.filter_active":"活跃","dashboard.filter_all":"全部","dashboard.no_active_channels":"没有活跃频道","dashboard.component_health":"组件健康","dashboard.load_error":"加载仪表盘失败","dashboard.session_label":"会话","dashboard.daily_label":"每日","dashboard.monthly_label":"每月","dashboard.total_tokens_label":"总 Tokens","dashboard.requests_label":"请求","dashboard.no_channels":"未配置频道","dashboard.active":"活跃","dashboard.inactive":"非活跃","dashboard.no_components":"没有组件报告","dashboard.restarts":"重启次数","dashboard.tab_overview":"概览","dashboard.tab_sessions":"会话","dashboard.tab_channels":"频道","dashboard.sessions_title":"活跃会话","dashboard.no_sessions":"没有活跃会话","dashboard.session_id":"会话 ID","dashboard.session_channel":"频道","dashboard.session_started":"开始时间","dashboard.session_last_activity":"最近活动","dashboard.session_status":"状态","dashboard.session_messages":"消息数","dashboard.session_details":"会话详情","dashboard.session_history":"查看历史","dashboard.channels_title":"频道状态","dashboard.no_channels_detail":"没有频道详情","dashboard.channel_type":"类型","dashboard.channel_messages":"消息数","dashboard.channel_last_message":"最近消息","dashboard.channel_config":"配置摘要","dashboard.channel_enabled":"已启用","dashboard.channel_disabled":"已禁用","dashboard.loading_sessions":"加载会话中...","dashboard.loading_channels":"加载频道中...","dashboard.load_sessions_error":"加载会话失败","dashboard.load_channels_error":"加载频道失败","dashboard.never":"从未","dashboard.agents_title":"智能体","dashboard.agents_empty":"未配置委托智能体。","dashboard.agent_general_purpose":"通用型","dashboard.agent_not_running":"-","dashboard.agentic":"Agentic","dashboard.single_turn":"单轮","dashboard.depth":"深度","dashboard.iterations":"轮","dashboard.current_task":"当前任务","dashboard.run_time":"运行时长","dashboard.progress":"进度","dashboard.last_active":"最近活动","dashboard.capabilities":"能力","dashboard.no_tool_allowlist":"未显式限制工具白名单","dashboard.idle":"空闲","dashboard.primary_agent_title":"主智能体","dashboard.primary_agent_status":"运行中","dashboard.primary_agent_style":"默认交互智能体，负责处理 Web 对话与工具调用。","dashboard.primary_agent_kind":"Web 对话","dashboard.primary_agent_tooling":"工具已启用","dashboard.primary_agent_task":"始终可用","dashboard.primary_agent_progress":"就绪","dashboard.primary_agent_last_active":"持续运行","dashboard.delegate_agents_title":"子代理","settings.title":"设置","settings.theme_title":"主题设置","settings.tab.appearance":"外观","settings.tab.typography":"排版","settings.dark_presets":"深色主题","settings.light_presets":"浅色主题","settings.appearance":"外观设置","settings.typography":"字体设置","settings.fontUi":"界面字体","settings.fontMono":"代码字体","settings.fontSize":"界面字号","settings.fontMonoSize":"代码字号","settings.preview":"预览","settings.previewText":"界面字体预览文本","settings.fontNote":"字体设置需要刷新页面后生效","settings.language":"界面语言","settings.window":"窗口","theme.mode":"主题模式","theme.accent":"强调色","theme.system":"跟随系统","theme.dark":"深色","theme.light":"浅色","theme.oled":"纯黑","channel.title":"通道列表","channel.configure":"配置","channel.connected":"已连接","channel.not_configured":"未配置","channel.not_connected":"未连接","channel.disconnecting":"断开中...","channel.disconnect":"断开连接","service.not_started_message":"小K服务尚未启动，部分内容暂时无法加载","service.start_now":"立即启动","service.starting":"正在启动…","channel.wechat":"微信","channel.wechat.desc":"扫码接入个人微信，在聊天中随时调用小K，快速处理日常问题与任务","channel.wecom":"企业微信","channel.wecom.desc":"关联企业微信账号，在群聊或私聊中直接调用小K，协助团队高效沟通与协作","channel.dingtalk":"钉钉","channel.dingtalk.desc":"接入钉钉机器人，在会话中向小K下达任务指令，自动执行工作流程","channel.feishu":"飞书","channel.feishu.desc":"接入飞书机器人，在群聊或私聊中即可与小K协同处理任务，无缝融入办公流程","channel.lansenger":"蓝信","channel.lansenger.desc":"关联蓝信工作账号，在安全通信环境中直接调用小K，快速处理协同办公与任务指令","channel.wechat.connected":"微信配置成功","channel.wecom.connected":"企业微信配置成功","channel.dingtalk.connected":"钉钉配置成功","channel.feishu.connected":"飞书配置成功","channel.lansenger.connected":"蓝信配置成功","channel.wechat.disconnected":"微信已断开连接","channel.wecom.disconnected":"企业微信已断开连接","channel.dingtalk.disconnected":"钉钉已断开连接","channel.feishu.disconnected":"飞书已断开连接","channel.lansenger.disconnected":"蓝信已断开连接","channel.scan_connect":"扫码接入","channel.websocket_connect":"WebSocket 长连接","channel.stream_connect":"WebSocket 长连接","channel.bind_success":"绑定成功","channel.qr_expired":"二维码已过期，请刷新","channel.qr_fetch_failed":"获取二维码失败","channel.refresh_qr":"刷新二维码","channel.scanned_confirm":"已扫描，请在手机上确认...","channel.bind_error":"出错了","channel.connect":"连接","channel.scan_tip":"请使用微信扫描下方二维码","channel.confirm":"确定","channel.retry":"重试","channel.cancel":"取消","channel.bot_id":"Bot ID","channel.wecom.bot_id_placeholder":"请输入Bot ID","channel.wecom.secret_placeholder":"请输入Secret","channel.wecom.fill_required":"请填写 Bot ID 和 Secret","channel.dingtalk.client_id_placeholder":"请输入Client ID","channel.dingtalk.client_secret_placeholder":"请输入Client Secret","channel.dingtalk.fill_required":"请填写 Client ID 和 Client Secret","channel.dingtalk.auth_failed":"授权失败","channel.feishu.app_id_placeholder":"请输入App ID","channel.feishu.app_secret_placeholder":"请输入App Secret","channel.feishu.fill_required":"请填写 App ID 和 App Secret","channel.feishu.access_denied":"用户拒绝了授权","channel.lansenger.app_id_placeholder":"请输入App ID","channel.lansenger.app_secret_placeholder":"请输入App Secret","channel.lansenger.api_gateway_placeholder":"请输入API Gateway URL","channel.lansenger.fill_required":"请填写 App ID 和 App Secret","agent.approval_required":"需要审批","agent.allow_once":"允许一次","agent.always_this_session":"本次会话始终允许","agent.deny":"拒绝","agent.expires_at":"过期时间","identity.setup":"设置身份","identity.setup_desc":"设置你的AI助手","identity.name_placeholder":"给你的AI助手起个名字","identity.name_example":"例如：小K、小智、助手","identity.role_label":"描述它的角色（可选）","identity.role_example":"例如：专业的编程助手，擅长代码优化和Debug","history.title":"历史对话","history.task_title":"历史任务","history.today":"今天","history.last_7_days":"最近7天","history.last_30_days":"最近30天","history.last_year":"最近一年","history.earlier":"更早","history.empty":"暂无历史对话","history.loading":"加载中...","chat.attachment_too_large":"附件总体积过大，请控制在 40MB 内。","chat.file_too_large":"文件 {name} 超过 15MB 限制。","chat.read_attachment_failed":"读取附件失败，请重试。","chat.remove_attachment":"移除附件 {name}","chat.unnamed_session":"未命名会话","chat.yesterday":"昨天","chat.weekday.sun":"周日","chat.weekday.mon":"周一","chat.weekday.tue":"周二","chat.weekday.wed":"周三","chat.weekday.thu":"周四","chat.weekday.fri":"周五","chat.weekday.sat":"周六","chat.date.month_day":"{m}月{d}日","chat.date.year_month_day":"{y}年{m}月{d}日","model.edit_config":"编辑模型配置","model.add_config":"新增模型配置","model.cancel_edit":"取消编辑","model.save_edit_sync":"保存编辑并同步配置","model.add_write_remote":"添加并写入远端配置","model.saving":"保存中...","model.current_model":"当前配置模型","model.view":"查看","model.not_set":"未设置","model.not_saved_locally":"未保存到本地","model.provider_model_required":"请先填写 provider 和 model","model.update_sync_success":"模型信息已更新并同步到本地/远端配置","model.add_remote_success":"模型已写入远端配置并加入可切换列表","model.save_failed":"保存失败","model.deleted":"模型已从可切换列表删除","model.model_placeholder":"例如 gpt-5.2 / qwen-plus / claude-sonnet-4-6","model.qwen_api_key_required":"Qwen 需要 API Key。请填写 Key（DASHSCOPE_API_KEY）后再保存。","model.qwen_api_key_hint":"Qwen 必填：DASHSCOPE_API_KEY","model.qwen_oauth_hint":"Qwen Code：QWEN_OAUTH_TOKEN（可选填）","model.key_optional_hint":"可选（建议填写，避免 provider 启动失败）","model.base_url_hint_qwen":"可选，如 https://dashscope.aliyuncs.com/compatible-mode/v1","model.base_url_hint_openai":"可选，如 https://api.openai.com/v1","model.custom_base_url_required":"custom provider 需要填写 Base URL，例如 https://api.openai.com/v1","model.provider_model_empty":"provider 和 model 不能为空","model.configured_model":"已配置模型","model.qwen_plus":"通义千问 Plus","model.qwen_qwq":"通义千问 QWQ-32B","model.desc_general":"通用对话，平衡性能与成本","model.desc_thinking":"思考模型，强推理能力","model.desc_deep_reasoning":"深度推理模型","model.desc_new_thinking":"新一代深度思考模型","provider.category_recommended":"推荐（聚合与直连）","provider.category_fast":"快速推理","provider.category_gateway":"网关 / 云厂商","provider.category_domestic":"国内与专项","provider.category_local":"本地 / 自定义 OpenAI 兼容","provider.openrouter_notes":"多模型路由，OpenAI兼容 Chat Completions","provider.anthropic_notes":"Messages API；需在配置中设置对应密钥","provider.openai_notes":"Chat Completions / Responses 视 wire_api","provider.ollama_notes":"可配 api_url 指向本机或远程","provider.custom_notes":"供应商 ID 形如 custom:https://host...","skillhub.title":"技能商店","skillhub.tab.hot":"🔥 下载热榜","skillhub.tab.featured":"⭐ 为你推荐","skillhub.tab.newest":"🆕 最近上新","skillhub.tab.installed":"✅ 已安装","skillhub.tab.installed_count":"✅ 已安装 ({count})","skillhub.search.placeholder":"搜索技能...","skillhub.search.results":"搜索结果：{query}","skillhub.install":"安装","skillhub.installing":"安装中...","skillhub.installed":"已安装","skillhub.uninstall":"卸载","skillhub.author":"作者：{author}","skillhub.empty.installed":"暂无已安装的技能","skillhub.empty.skills":"暂无技能","skillhub.retry":"重试","skillhub.load_failed":"加载失败","skillhub.scroll_more":"↓ 下滑加载更多","skillhub.detail.source_clawhub":"源自 ClawHub","skillhub.detail.source":"源自 {source}","skillhub.detail.safe":"通过安全检测","skillhub.detail.unsafe":"待检测","skillhub.detail.downloads":"下载量","skillhub.detail.stars":"收藏","skillhub.detail.security_check":"安全检测","skillhub.detail.lab_keen":"科恩实验室","skillhub.detail.lab_sanbu":"云鼎实验室","skillhub.detail.security_disclaimer":"安全检测结果由第三方机构出具，仅作参考，不构成平台对Skill绝对安全的承诺。网络安全具有动态性，请您自行做好安全防护和风险管控。","skillhub.modal.install_title":"安装技能","skillhub.modal.install_confirm":"从 SkillHub 安装 {name}？","skillhub.modal.force_overwrite":"如已安装则强制覆盖","skillhub.modal.cancel":"取消","skillhub.modal.install_btn":"安装","skillhub.modal.installing":"正在安装 {name}...","skillhub.modal.success":"{name} 安装成功！","skillhub.modal.error":"安装失败","skillhub.modal.close":"关闭","skillhub.modal.retry":"重试"},en:{"nav.dashboard":"Dashboard","nav.agent":"Agent","nav.tools":"Tools","nav.cron":"Scheduled Jobs","nav.integrations":"Integrations","nav.modelswitch":"Model Switch","nav.skills":"Skills","nav.history":"History","nav.general":"General","nav.memory":"Memory","nav.config":"Configuration","nav.cost":"Cost Tracker","nav.logs":"Logs","nav.doctor":"Doctor","nav.canvas":"Canvas","dashboard.title":"Dashboard","dashboard.provider":"Provider","dashboard.model":"Model","dashboard.uptime":"Uptime","dashboard.temperature":"Temperature","dashboard.gateway_port":"Gateway Port","dashboard.memory_backend":"Memory Backend","dashboard.paired":"Paired","dashboard.channels":"Channels","dashboard.health":"Health","dashboard.status":"Status","dashboard.overview":"Overview","dashboard.system_info":"System Information","dashboard.quick_actions":"Quick Actions","agent.title":"Agent Chat","agent.send":"Send","agent.placeholder":"Type a message...","agent.start_conversation":"Send a message to start the conversation","agent.type_message":"Type a message...","agent.light_greeting_title":"Hello, I am KylinBot!","agent.light_greeting_subtitle":"I can help with questions, writing, summaries, retrieval, and everyday task coordination.","agent.light_try_label":"You can try:","agent.light_refresh_label":"Refresh","agent.light_card_recommended":"Recommended prompts","agent.light_card_knowledge":"Knowledge base","agent.light_card_knowledge_prompt":"Summarize the key points from my knowledge base.","agent.light_suggestion_one":"How do I remove coffee stains from a white shirt?","agent.light_suggestion_two":"What are good icebreaker games for a team meetup?","agent.light_suggestion_three":"Draft a short follow-up email for a client.","agent.light_suggestion_four":"How can I summarize a long article into bullet points?","agent.light_suggestion_five":"How do I sum values conditionally in Excel?","agent.light_suggestion_six":"Write a short launch announcement for a product release.","agent.light_suggestion_seven":"How should a beginner start learning to program?","agent.light_suggestion_eight":"What should I pack for a three-day business trip?","agent.light_suggestion_nine":"Explain what an API is in simple terms.","agent.light_type_message":'Ask a question or type "/" to use skills',"agent.light_tool_model":"Smart model routing","agent.light_tool_expand":"Deep reasoning","agent.light_tool_search":"Web search","agent.model_selector_title":"Select Model","agent.model_selector_configured":"Configured Models","agent.model_selector_no_configured":"No other models configured","agent.connecting":"Connecting...","agent.connected":"Connected","agent.disconnected":"Disconnected","agent.reconnecting":"Reconnecting...","agent.thinking":"Thinking...","agent.tool_call":"Tool Call","agent.tool_result":"Tool Result","agent.connection_error":"Connection error. Attempting to reconnect...","agent.tool_call_prefix":"[Tool Call]","agent.tool_result_prefix":"[Tool Result]","agent.error_prefix":"[Error]","agent.unknown_error":"Unknown error","agent.send_error":"Failed to send message. Please try again.","agent.copy_message":"Copy message","agent.show_json":"Show JSON","agent.hide_json":"Hide JSON","agent.toggle_system_messages":"Toggle system messages","agent.connected_status":"Connected","agent.disconnected_status":"Disconnected","agent.generating_block_tip":"Generating answer, please try again after completion","header.new_session":"New Session","header.window_pin":"Pin on Top","header.window_minimize":"Minimize","header.window_maximize":"Maximize","header.window_close":"Close","tools.title":"Available Tools","tools.name":"Name","tools.description":"Description","tools.parameters":"Parameters","tools.search":"Search tools...","tools.empty":"No tools available.","tools.count":"Total tools","tools.agent_tools":"Agent Tools","tools.cli_tools":"CLI Tools","tools.parameter_schema":"Parameter Schema","tools.path":"Path","tools.version":"Version","tools.category":"Category","tools.load_error":"Failed to load tools","cron.title":"Scheduled Jobs","cron.task_list":"Task List","cron.prompt_col":"Prompt","cron.status_success":"Success","cron.status_failed":"Failed","cron.scheduled_tasks":"Scheduled Tasks","cron.add":"Add Job","cron.add_job":"Add Job","cron.modal_add":"Add","cron.add_modal_title":"Add Task","cron.delete":"Delete","cron.enable":"Enable","cron.disable":"Disable","cron.name":"Name","cron.name_optional":"Name (optional)","cron.command":"Command","cron.command_required":"Command","cron.schedule":"Schedule","cron.schedule_required":"Schedule","cron.schedule_kind_cron":"Cron expression","cron.schedule_kind_at":"Specific time","cron.schedule_kind_every":"Fixed interval","cron.schedule_cron_placeholder":"e.g. 0 0 * * *","cron.schedule_tz_optional":"Timezone (optional, e.g. UTC)","cron.schedule_every_ms_placeholder":"Interval in milliseconds (e.g. 60000)","cron.next_run":"Next Run","cron.last_run":"Last Run","cron.last_status":"Last Status","cron.enabled":"Enabled","cron.enabled_status":"Enabled","cron.disabled_status":"Disabled","cron.empty":"No scheduled jobs.","cron.confirm_delete":"Are you sure you want to delete this job?","cron.delete_desc":"Once deleted, this task will no longer run automatically and cannot be restored.","cron.load_error":"Failed to load cron jobs","cron.validation_error":"Schedule and command are required.","cron.add_error":"Failed to add job","cron.delete_error":"Failed to delete job","cron.cancel":"Cancel","cron.adding":"Adding...","cron.id":"ID","cron.actions":"Actions","cron.loading_run_history":"Loading run history...","cron.load_run_history_error":"Failed to load run history","cron.no_runs":"No runs recorded yet.","cron.recent_runs":"Recent Runs","cron.yes":"Yes","cron.no":"No","cron.edit":"Edit","cron.edit_modal_title":"Edit Task","cron.edit_error":"Failed to update job","cron.saving":"Saving...","cron.save":"Save","cron.confirm":"Confirm","cron.job_type":"Job Type","cron.job_type_shell":"Shell","cron.job_type_agent":"Agent","cron.session_target":"Session Target","cron.session_target_isolated":"Isolated","cron.session_target_main":"Main","cron.model_optional":"Model (optional)","cron.allowed_tools":"Allowed Tools (comma-separated)","cron.delivery_mode":"Delivery Mode","cron.delivery_mode_none":"None","cron.delivery_mode_announce":"Announce","cron.delivery_channel":"Delivery Channel","cron.delivery_target":"Delivery Target","cron.delivery_best_effort":"Best effort delivery","cron.enable_job":"Enable job","cron.delete_after_run":"Delete after run","cron.run_now":"Run now","cron.pause_job":"Pause job","cron.resume_job":"Resume job","cron.run_error":"Failed to run job","cron.toggle_error":"Failed to toggle job status","cron.catch_up_title":"Catch up missed jobs on startup","cron.catch_up_desc":"Run overdue jobs after KylinBot restarts from downtime","cron.name_placeholder":"e.g. Daily cleanup","cron.command_shell_placeholder":"e.g. cleanup --older-than 7d","cron.command_agent_placeholder":"Prompt for Agent job execution","cron.model_placeholder":"e.g. gpt-4.1","cron.allowed_tools_placeholder":"file_read,web_search","cron.toggle_run_history":"Toggle run history","cron.task_name":"Task Name","cron.task_prompt_label":"Task Instruction","cron.task_name_placeholder":"Enter task name","cron.task_prompt_placeholder":"Enter task instruction. e.g. Recommend 5 practical English words every day","cron.exec_time":"Schedule","cron.daily_time_step_up":"Add one minute","cron.daily_time_step_down":"Subtract one minute","cron.once_run_date":"Run date","cron.once_date_step_up":"Next day","cron.once_date_step_down":"Previous day","cron.once_open_calendar":"Open calendar","cron.once_time_past":"Execution time cannot be earlier than the current time","cron.cal_prev_year":"Previous year","cron.cal_prev_month":"Previous month","cron.cal_next_month":"Next month","cron.cal_next_year":"Next year","cron.cal_head_1":"Mo","cron.cal_head_2":"Tu","cron.cal_head_3":"We","cron.cal_head_4":"Th","cron.cal_head_5":"Fr","cron.cal_head_6":"Sa","cron.cal_head_7":"Su","cron.schedule_daily_label":"Daily","cron.schedule_interval_label":"Interval","cron.schedule_once_label":"Once","cron.schedule_custom_label":"Custom","cron.remote_channel":"Remote Channel","cron.exec_model":"Execution Model","cron.channel_main":"Main Session","cron.interval_every":"Every","cron.interval_row_label":"Every interval","cron.interval_step_up":"Increase interval value","cron.interval_step_down":"Decrease interval value","cron.interval_unit_minute":"minutes","cron.interval_unit_hour":"hours","cron.interval_unit_day":"days","cron.interval_effective_time":"Effective time","cron.date_range":"Date Range","cron.date_range_start":"Start date","cron.date_range_end":"End date","cron.model_default":"Default","cron.weekday_1":"Mon","cron.weekday_2":"Tue","cron.weekday_3":"Wed","cron.weekday_4":"Thu","cron.weekday_5":"Fri","cron.weekday_6":"Sat","cron.weekday_7":"Sun","integrations.title":"Integrations","integrations.available":"Available","integrations.active":"Active","integrations.coming_soon":"Coming Soon","integrations.category":"Category","integrations.status":"Status","integrations.search":"Search integrations...","integrations.empty":"No integrations found.","integrations.activate":"Activate","integrations.deactivate":"Deactivate","integrations.load_error":"Failed to load integrations","integrations.status_active":"Active","integrations.status_available":"Available","integrations.status_coming_soon":"Coming Soon","modelswitch.title":"Model Switch","modelswitch.all":"All","modelswitch.empty":"No models found.","modelswitch.status_active":"Active","modelswitch.status_available":"Available","modelswitch.status_coming_soon":"Coming Soon","skills.title":"Skills","skills.all":"All","skills.empty":"No skills found.","skills.enabled":"Enabled","skills.disabled":"Disabled","skills.status_active":"Active","skills.status_available":"Available","skills.status_coming_soon":"Coming Soon","memory.title":"Memory Store","memory.memory_title":"Memory","memory.search":"Search memory...","memory.search_placeholder":"Search memory entries...","memory.add":"Store Memory","memory.add_memory":"Add Memory","memory.add_modal_title":"Add Memory","memory.delete":"Delete","memory.key":"Key","memory.key_required":"Key","memory.content":"Content","memory.content_required":"Content","memory.category":"Category","memory.category_optional":"Category (optional)","memory.timestamp":"Timestamp","memory.session":"Session","memory.score":"Score","memory.empty":"No memory entries found.","memory.confirm_delete":"Are you sure you want to delete this memory entry?","memory.all_categories":"All Categories","memory.search_button":"Search","memory.load_error":"Failed to load memory","memory.saving":"Saving...","memory.validation_error":"Key and content are required.","memory.store_error":"Failed to store memory","memory.delete_error":"Failed to delete memory","memory.delete_confirm":"Delete?","memory.yes":"Yes","memory.no":"No","memory.cancel":"Cancel","config.title":"Configuration","config.save":"Save","config.saving":"Saving...","config.reset":"Reset","config.saved":"Configuration saved successfully.","config.error":"Failed to save configuration.","config.loading":"Loading configuration...","config.editor_placeholder":"TOML configuration...","config.configuration_title":"Configuration","config.sensitive_title":"Sensitive fields are masked","config.sensitive_hint":"API keys, tokens, and passwords are hidden for security. To update a masked field, replace the entire masked value with your new value.","config.save_success":"Configuration saved successfully.","config.save_error":"Failed to save configuration","config.toml_label":"TOML Configuration","config.lines":"lines","config.mode.form":"Form","config.mode.advanced":"Advanced","config.section.general":"General","config.section.agent":"Agent","config.section.gateway":"Gateway","config.section.cost":"Cost","config.section.memory":"Memory","config.section.web_search":"Web Search","config.section.heartbeat":"Heartbeat","config.field.default_provider":"Default Model Provider","config.field.default_provider.desc":"LLM provider to use (e.g. openrouter, ollama, anthropic)","config.field.default_model":"Default Model","config.field.default_model.desc":"Model name for the default provider","config.field.default_temperature":"Temperature","config.field.default_temperature.desc":"Controls randomness (0 = deterministic, 2 = max creativity)","config.field.provider_timeout_secs":"Provider Timeout (s)","config.field.provider_timeout_secs.desc":"HTTP timeout for LLM API calls in seconds","config.field.locale":"Locale","config.field.locale.desc":"UI language override","config.field.compact_context":"Compact Context","config.field.compact_context.desc":"Reduce context size for small models (13B or less)","config.field.max_tool_iterations":"Max Tool Iterations","config.field.max_tool_iterations.desc":"Max tool-call loop turns per user message","config.field.max_history_messages":"Max History Messages","config.field.max_history_messages.desc":"Max conversation history messages per session","config.field.max_context_tokens":"Max Context Tokens","config.field.max_context_tokens.desc":"Triggers history compaction when exceeded","config.field.parallel_tools":"Parallel Tools","config.field.parallel_tools.desc":"Enable parallel tool execution within a turn","config.field.gateway_port":"Port","config.field.gateway_port.desc":"Gateway server port","config.field.gateway_host":"Host","config.field.gateway_host.desc":"Gateway bind address","config.field.require_pairing":"Require Pairing","config.field.require_pairing.desc":"Require device pairing before accepting requests","config.field.session_persistence":"Session Persistence","config.field.session_persistence.desc":"Persist WebSocket sessions to SQLite","config.field.session_ttl_hours":"Session TTL (hours)","config.field.session_ttl_hours.desc":"Auto-archive stale sessions (0 = disabled)","config.field.allow_public_bind":"Allow Public Bind","config.field.allow_public_bind.desc":"Allow non-localhost binding without tunnel","config.field.daily_limit_usd":"Daily Limit (USD)","config.field.daily_limit_usd.desc":"Daily spending limit in US dollars","config.field.monthly_limit_usd":"Monthly Limit (USD)","config.field.monthly_limit_usd.desc":"Monthly spending limit in US dollars","config.field.warn_at_percent":"Warning Threshold (%)","config.field.warn_at_percent.desc":"Warn when budget usage exceeds this percentage","config.field.allow_override":"Allow Override","config.field.allow_override.desc":"Allow --override flag to exceed budget limits","config.field.memory_enabled":"Enable memory","config.field.memory_enabled.desc":"Turn agent memory storage on or off","config.field.memory_backend":"Backend","config.field.memory_backend.desc":"Storage backend for agent memory","config.field.heartbeat_enabled":"Enable heartbeat","config.field.heartbeat_enabled.desc":"Run scheduled heartbeat checks","config.field.web_search_enabled":"Enable web search","config.field.web_search_enabled.desc":"Allow the agent to use web search tools","config.field.cost_enabled":"Enable cost limits","config.field.cost_enabled.desc":"Track spending and enforce budget limits","config.field.web_search_provider":"Search Provider","config.field.web_search_provider.desc":"Web search engine to use","config.field.max_results":"Max Results","config.field.max_results.desc":"Number of results per search query","config.field.web_search_timeout":"Timeout (s)","config.field.web_search_timeout.desc":"Search request timeout","config.field.interval_minutes":"Interval (minutes)","config.field.interval_minutes.desc":"Minutes between heartbeat checks","config.field.two_phase":"Two-phase","config.field.two_phase.desc":"Ask the LLM whether to run before executing (saves cost)","config.field.adaptive":"Adaptive","config.field.adaptive.desc":"Automatically adjust interval based on activity","config.field.min_interval_minutes":"Min Interval (minutes)","config.field.min_interval_minutes.desc":"Minimum interval when adaptive mode is on","config.field.max_interval_minutes":"Max Interval (minutes)","config.field.max_interval_minutes.desc":"Maximum interval when adaptive mode backs off","config.field.heartbeat_message":"Fallback Message","config.field.heartbeat_message.desc":"Fallback task text when HEARTBEAT.md has no entries","config.field.heartbeat_target":"Target Channel","config.field.heartbeat_target.desc":"Delivery channel for heartbeat output (e.g. telegram)","config.field.task_timeout_secs":"Task Timeout (s)","config.field.task_timeout_secs.desc":"Max seconds for a single heartbeat agent invocation","config.error.serialize_failed":"Failed to serialize configuration","config.error.invalid_toml_switch":"Invalid TOML — fix errors before switching to form view","config.error.reload_failed":"Failed to reload configuration","config.error.initial_parse_failed":"Could not parse configuration; showing an empty form. Fix the TOML or edit it elsewhere.","cost.title":"Cost Tracker","cost.session":"Session Cost","cost.daily":"Daily Cost","cost.monthly":"Monthly Cost","cost.total_tokens":"Total Tokens","cost.request_count":"Requests","cost.by_model":"Cost by Model","cost.model":"Model","cost.tokens":"Tokens","cost.requests":"Requests","cost.usd":"Cost (USD)","cost.load_error":"Failed to load cost data","cost.session_cost":"Session Cost","cost.daily_cost":"Daily Cost","cost.monthly_cost":"Monthly Cost","cost.total_requests":"Total Requests","cost.token_statistics":"Token Statistics","cost.avg_tokens_per_request":"Avg Tokens / Request","cost.cost_per_1k_tokens":"Cost per 1K Tokens","cost.model_breakdown":"Model Breakdown","cost.no_model_data":"No model data available.","cost.cost":"Cost","cost.share":"Share","logs.title":"Live Logs","logs.live_logs":"Live Logs","logs.clear":"Clear","logs.pause":"Pause","logs.resume":"Resume","logs.filter":"Filter logs...","logs.filter_label":"Filter","logs.empty":"No log entries.","logs.connected":"Connected","logs.disconnected":"Disconnected","logs.events":"events","logs.jump_to_bottom":"Jump to bottom","logs.paused_hint":"Log streaming is paused.","logs.waiting_hint":"Waiting for events...","doctor.title":"System Diagnostics","doctor.diagnostics_title":"Diagnostics","doctor.run":"Run Diagnostics","doctor.run_diagnostics":"Run Diagnostics","doctor.running":"Running diagnostics...","doctor.running_btn":"Running...","doctor.running_desc":"Running diagnostics...","doctor.running_hint":"This may take a few seconds.","doctor.ok":"OK","doctor.warn":"Warning","doctor.error":"Error","global.refresh":"Refresh","doctor.severity":"Severity","doctor.category":"Category","doctor.message":"Message","doctor.empty":"No diagnostics have been run yet.","doctor.summary":"Diagnostic Summary","doctor.issues_found":"Issues Found","doctor.warnings_summary":"Warnings","doctor.all_clear":"All Clear","doctor.system_diagnostics":"System Diagnostics","doctor.empty_hint":'Click "Run Diagnostics" to check your KylinBot installation.',"auth.pair":"Pair Device","auth.pairing_code":"Pairing Code","auth.pair_button":"Pair","auth.logout":"Logout","auth.pairing_success":"Pairing successful!","auth.pairing_failed":"Pairing failed. Please try again.","auth.enter_code":"Enter your pairing code to connect to the agent.","common.loading":"Loading...","common.error":"An error occurred.","common.retry":"Retry","common.cancel":"Cancel","common.confirm":"Confirm","common.save":"Save","common.delete":"Delete","common.edit":"Edit","common.close":"Close","common.yes":"Yes","common.no":"No","common.search":"Search...","common.no_data":"No data available.","common.refresh":"Refresh","common.back":"Back","common.actions":"Actions","common.name":"Name","common.description":"Description","common.status":"Status","common.created":"Created","common.updated":"Updated","health.title":"System Health","health.component":"Component","health.status":"Status","health.last_ok":"Last OK","health.last_error":"Last Error","health.restart_count":"Restarts","health.pid":"Process ID","health.uptime":"Uptime","health.updated_at":"Last Updated","dashboard.provider_model":"Provider / Model","dashboard.since_last_restart":"Since last restart","dashboard.paired_yes":"Yes","dashboard.paired_no":"No","dashboard.cost_overview":"Cost Overview","dashboard.active_channels":"Active Channels","dashboard.filter_active":"Active","dashboard.filter_all":"All","dashboard.no_active_channels":"No active channels","dashboard.component_health":"Component Health","dashboard.load_error":"Failed to load dashboard","dashboard.session_label":"Session","dashboard.daily_label":"Daily","dashboard.monthly_label":"Monthly","dashboard.total_tokens_label":"Total Tokens","dashboard.requests_label":"Requests","dashboard.no_channels":"No channels configured","dashboard.active":"Active","dashboard.inactive":"Inactive","dashboard.no_components":"No components reporting","dashboard.restarts":"Restarts","dashboard.tab_overview":"Overview","dashboard.tab_sessions":"Sessions","dashboard.tab_channels":"Channels","dashboard.sessions_title":"Active Sessions","dashboard.no_sessions":"No active sessions","dashboard.session_id":"Session ID","dashboard.session_channel":"Channel","dashboard.session_started":"Started","dashboard.session_last_activity":"Last Activity","dashboard.session_status":"Status","dashboard.session_messages":"Messages","dashboard.session_details":"Session Details","dashboard.session_history":"View History","dashboard.channels_title":"Channel Status","dashboard.no_channels_detail":"No channel details available","dashboard.channel_type":"Type","dashboard.channel_messages":"Messages","dashboard.channel_last_message":"Last Message","dashboard.channel_config":"Configuration","dashboard.channel_enabled":"Enabled","dashboard.channel_disabled":"Disabled","dashboard.loading_sessions":"Loading sessions...","dashboard.loading_channels":"Loading channels...","dashboard.load_sessions_error":"Failed to load sessions","dashboard.load_channels_error":"Failed to load channels","dashboard.never":"Never","dashboard.agents_title":"Agents","dashboard.agents_empty":"No delegate agents configured.","dashboard.agent_general_purpose":"General purpose","dashboard.agent_not_running":"-","dashboard.agentic":"Agentic","dashboard.single_turn":"Single turn","dashboard.depth":"depth","dashboard.iterations":"iters","dashboard.current_task":"Current task","dashboard.run_time":"Run time","dashboard.progress":"Progress","dashboard.last_active":"Last active","dashboard.capabilities":"Capabilities","dashboard.no_tool_allowlist":"No explicit tool allowlist","dashboard.idle":"Idle","dashboard.primary_agent_title":"Primary Agent","dashboard.primary_agent_status":"Running","dashboard.primary_agent_style":"Default interactive agent for web chat and tool-enabled turns.","dashboard.primary_agent_kind":"Web chat","dashboard.primary_agent_tooling":"Tool-enabled","dashboard.primary_agent_task":"Always available","dashboard.primary_agent_progress":"Ready","dashboard.primary_agent_last_active":"Always on","dashboard.delegate_agents_title":"Delegate Agents","settings.title":"Settings","settings.theme_title":"Theme Settings","settings.tab.appearance":"Appearance","settings.tab.typography":"Typography","settings.dark_presets":"Dark Themes","settings.light_presets":"Light Themes","settings.appearance":"Appearance","settings.typography":"Typography","settings.fontUi":"UI Font","settings.fontMono":"Code Font","settings.fontSize":"UI Font Size","settings.fontMonoSize":"Code Font Size","settings.preview":"Preview","settings.previewText":"The quick brown fox jumps over the lazy dog.","settings.fontNote":"Font changes apply on page reload.","settings.language":"Language","settings.window":"Window","theme.mode":"Theme Mode","theme.accent":"Accent Color","theme.system":"System","theme.dark":"Dark","theme.light":"Light","theme.oled":"OLED Black","channel.title":"Channels","channel.configure":"Configure","channel.connected":"Connected","channel.not_configured":"Not Configured","channel.not_connected":"Not Connected","channel.disconnecting":"Disconnecting...","channel.disconnect":"Disconnect","service.not_started_message":"Kylin service has not started yet. Some content cannot be loaded temporarily.","service.start_now":"Start Now","service.starting":"Starting…","channel.wechat":"WeChat","channel.wechat.desc":"Connect your WeChat to invoke KylinBot directly in chats for daily tasks","channel.wecom":"WeCom","channel.wecom.desc":"Link your WeCom account to invoke KylinBot in group or private chats for team collaboration","channel.dingtalk":"DingTalk","channel.dingtalk.desc":"Connect a DingTalk bot to issue task commands and automate workflows in conversations","channel.feishu":"Feishu","channel.feishu.desc":"Connect a Feishu bot to invoke KylinBot in messages for task processing and workflow coordination","channel.lansenger":"Lansenger","channel.lansenger.desc":"Connect a Lansenger bot to receive messages over a long connection and invoke KylinBot in Lansenger chats","channel.wechat.connected":"WeChat configured successfully","channel.wecom.connected":"WeCom configured successfully","channel.dingtalk.connected":"DingTalk configured successfully","channel.feishu.connected":"Feishu configured successfully","channel.lansenger.connected":"Lansenger configured successfully","channel.wechat.disconnected":"WeChat disconnected","channel.wecom.disconnected":"WeCom disconnected","channel.dingtalk.disconnected":"DingTalk disconnected","channel.feishu.disconnected":"Feishu disconnected","channel.lansenger.disconnected":"Lansenger disconnected","channel.scan_connect":"Scan to Connect","channel.websocket_connect":"WebSocket Connection","channel.stream_connect":"Stream Connection","channel.bind_success":"Bound successfully","channel.qr_expired":"QR code expired, please refresh","channel.qr_fetch_failed":"Failed to get QR code","channel.refresh_qr":"Refresh QR Code","channel.scanned_confirm":"Scanned, please confirm on your phone...","channel.bind_error":"An error occurred","channel.connect":"Connect","channel.scan_tip":"Please scan the QR code below with WeChat","channel.confirm":"OK","channel.retry":"Retry","channel.cancel":"Cancel","channel.bot_id":"Bot ID","channel.wecom.bot_id_placeholder":"Enter Bot ID","channel.wecom.secret_placeholder":"Enter Secret","channel.wecom.fill_required":"Please fill in Bot ID and Secret","channel.dingtalk.client_id_placeholder":"Enter Client ID","channel.dingtalk.client_secret_placeholder":"Enter Client Secret","channel.dingtalk.fill_required":"Please fill in Client ID and Client Secret","channel.dingtalk.auth_failed":"Authorization failed","channel.feishu.app_id_placeholder":"Enter App ID","channel.feishu.app_secret_placeholder":"Enter App Secret","channel.feishu.fill_required":"Please fill in App ID and App Secret","channel.feishu.access_denied":"User denied authorization","channel.lansenger.app_id_placeholder":"Enter App ID","channel.lansenger.app_secret_placeholder":"Enter App Secret","channel.lansenger.api_gateway_placeholder":"Enter API Gateway URL","channel.lansenger.fill_required":"Please fill in App ID and App Secret","agent.approval_required":"Approval Required","agent.allow_once":"Allow Once","agent.always_this_session":"Always This Session","agent.deny":"Deny","agent.expires_at":"Expires at","identity.setup":"Set Identity","identity.setup_desc":"Set up your AI assistant","identity.name_placeholder":"Give your AI assistant a name","identity.name_example":"e.g. Kylin, Xiao Zhi, Assistant","identity.role_label":"Describe its role (optional)","identity.role_example":"e.g. A professional coding assistant skilled in code optimization and debugging","history.title":"Chat History","history.task_title":"Task History","history.today":"Today","history.last_7_days":"Last 7 Days","history.last_30_days":"Last 30 Days","history.last_year":"Last Year","history.earlier":"Earlier","history.empty":"No chat history yet","history.loading":"Loading...","chat.attachment_too_large":"Total attachment size too large, please keep within 40MB.","chat.file_too_large":"File {name} exceeds the 15MB limit.","chat.read_attachment_failed":"Failed to read attachment, please retry.","chat.remove_attachment":"Remove attachment {name}","chat.unnamed_session":"Unnamed Session","chat.yesterday":"Yesterday","chat.weekday.sun":"Sun","chat.weekday.mon":"Mon","chat.weekday.tue":"Tue","chat.weekday.wed":"Wed","chat.weekday.thu":"Thu","chat.weekday.fri":"Fri","chat.weekday.sat":"Sat","chat.date.month_day":"{m}/{d}","chat.date.year_month_day":"{y}/{m}/{d}","model.edit_config":"Edit Model Config","model.add_config":"Add Model Config","model.cancel_edit":"Cancel Edit","model.save_edit_sync":"Save Edit & Sync Config","model.add_write_remote":"Add & Write to Remote Config","model.saving":"Saving...","model.current_model":"Current Model","model.view":"View","model.not_set":"Not Set","model.not_saved_locally":"Not Saved Locally","model.provider_model_required":"Please fill in provider and model first","model.update_sync_success":"Model info updated and synced to local/remote config","model.add_remote_success":"Model written to remote config and added to switchable list","model.save_failed":"Save failed","model.deleted":"Model removed from switchable list","model.model_placeholder":"e.g. gpt-5.2 / qwen-plus / claude-sonnet-4-6","model.qwen_api_key_required":"Qwen requires an API Key. Please fill in DASHSCOPE_API_KEY before saving.","model.qwen_api_key_hint":"Qwen required: DASHSCOPE_API_KEY","model.qwen_oauth_hint":"Qwen Code: QWEN_OAUTH_TOKEN (optional)","model.key_optional_hint":"Optional (recommended to avoid provider startup failure)","model.base_url_hint_qwen":"Optional, e.g. https://dashscope.aliyuncs.com/compatible-mode/v1","model.base_url_hint_openai":"Optional, e.g. https://api.openai.com/v1","model.custom_base_url_required":"Custom provider requires a Base URL, e.g. https://api.openai.com/v1","model.provider_model_empty":"Provider and model cannot be empty","model.configured_model":"Configured Model","model.qwen_plus":"Qwen Plus","model.qwen_qwq":"Qwen QWQ-32B","model.desc_general":"General conversation, balanced performance and cost","model.desc_thinking":"Thinking model, strong reasoning capability","model.desc_deep_reasoning":"Deep reasoning model","model.desc_new_thinking":"Next-gen deep thinking model","provider.category_recommended":"Recommended (Aggregation & Direct)","provider.category_fast":"Fast Inference","provider.category_gateway":"Gateway / Cloud Providers","provider.category_domestic":"Domestic & Specialized","provider.category_local":"Local / Custom OpenAI-Compatible","provider.openrouter_notes":"Multi-model routing, OpenAI-compatible Chat Completions","provider.anthropic_notes":"Messages API; requires setting the corresponding key in config","provider.openai_notes":"Chat Completions / Responses per wire_api","provider.ollama_notes":"Configurable api_url pointing to local or remote","provider.custom_notes":"Provider ID like custom:https://host...","skillhub.title":"SkillHub","skillhub.tab.hot":"🔥 Trending","skillhub.tab.featured":"⭐ Featured","skillhub.tab.newest":"🆕 Newest","skillhub.tab.installed":"✅ Installed","skillhub.tab.installed_count":"✅ Installed ({count})","skillhub.search.placeholder":"Search skills...","skillhub.search.results":'Search results for "{query}"',"skillhub.install":"Install","skillhub.installing":"Installing...","skillhub.installed":"Installed","skillhub.uninstall":"Uninstall","skillhub.author":"Author: {author}","skillhub.empty.installed":"No installed skills","skillhub.empty.skills":"No skills available","skillhub.retry":"Retry","skillhub.load_failed":"Failed to load","skillhub.scroll_more":"↓ Scroll for more","skillhub.detail.source_clawhub":"From ClawHub","skillhub.detail.source":"From {source}","skillhub.detail.safe":"Passed security check","skillhub.detail.unsafe":"Pending check","skillhub.detail.downloads":"Downloads","skillhub.detail.stars":"Stars","skillhub.detail.security_check":"Security Check","skillhub.detail.lab_keen":"Keen Lab","skillhub.detail.lab_sanbu":"Sanbu Lab","skillhub.detail.security_disclaimer":"Security check results are provided by third-party organizations and are for reference only. They do not constitute a guarantee of absolute safety. Cybersecurity is dynamic — please take proper security measures and risk management.","skillhub.modal.install_title":"Install Skill","skillhub.modal.install_confirm":"Install {name} from SkillHub?","skillhub.modal.force_overwrite":"Force overwrite if already installed","skillhub.modal.cancel":"Cancel","skillhub.modal.install_btn":"Install","skillhub.modal.installing":"Installing {name}...","skillhub.modal.success":"{name} installed successfully!","skillhub.modal.error":"Installation failed","skillhub.modal.close":"Close","skillhub.modal.retry":"Retry"},tr:{"nav.dashboard":"Kontrol Paneli","nav.agent":"Ajan","nav.tools":"Araçlar","nav.cron":"Zamanlanmış Görevler","nav.integrations":"Entegrasyonlar","nav.modelswitch":"Model Değiştirme","nav.skills":"Beceriler","nav.history":"Geçmiş","nav.memory":"Hafıza","nav.config":"Yapılandırma","nav.cost":"Maliyet Takibi","nav.logs":"Kayıtlar","nav.doctor":"Doktor","nav.canvas":"Tuval","dashboard.title":"Kontrol Paneli","dashboard.provider":"Sağlayıcı","dashboard.model":"Model","dashboard.uptime":"Çalışma Süresi","dashboard.temperature":"Sıcaklık","dashboard.gateway_port":"Ağ Geçidi Portu","dashboard.locale":"Dil","dashboard.memory_backend":"Hafıza Motoru","dashboard.paired":"Eşleştirilmiş","dashboard.channels":"Kanallar","dashboard.health":"Sağlık","dashboard.status":"Durum","dashboard.overview":"Genel Bakış","dashboard.system_info":"Sistem Bilgisi","dashboard.quick_actions":"Hızlı İşlemler","dashboard.provider_model":"Sağlayıcı / Model","dashboard.since_last_restart":"Son Yeniden Başlatmadan Beri","dashboard.paired_yes":"Evet","dashboard.paired_no":"Hayır","dashboard.cost_overview":"Maliyet Genel Bakışı","dashboard.active_channels":"Aktif Kanallar","dashboard.filter_active":"Aktif","dashboard.filter_all":"Tümü","dashboard.no_active_channels":"Aktif kanal yok","dashboard.component_health":"Bileşen Sağlığı","dashboard.load_error":"Kontrol paneli yüklenemedi","dashboard.session_label":"Oturum","dashboard.daily_label":"Günlük","dashboard.monthly_label":"Aylık","dashboard.total_tokens_label":"Toplam Token","dashboard.requests_label":"İstekler","dashboard.no_channels":"Kanal yapılandırılmamış","dashboard.active":"Aktif","dashboard.inactive":"Aktif Değil","dashboard.no_components":"Bileşen raporlamıyor","dashboard.restarts":"Yeniden Başlatmalar","dashboard.tab_overview":"Genel Bakış","dashboard.tab_sessions":"Oturumlar","dashboard.tab_channels":"Kanallar","dashboard.sessions_title":"Aktif Oturumlar","dashboard.no_sessions":"Aktif oturum yok","dashboard.session_id":"Oturum Kimliği","dashboard.session_channel":"Kanal","dashboard.session_started":"Başlangıç","dashboard.session_last_activity":"Son Etkinlik","dashboard.session_status":"Durum","dashboard.session_messages":"Mesajlar","dashboard.session_details":"Oturum Ayrıntıları","dashboard.session_history":"Geçmişi Görüntüle","dashboard.channels_title":"Kanal Durumu","dashboard.no_channels_detail":"Kanal ayrıntısı yok","dashboard.channel_type":"Tür","dashboard.channel_messages":"Mesajlar","dashboard.channel_last_message":"Son Mesaj","dashboard.channel_config":"Yapılandırma","dashboard.channel_enabled":"Etkin","dashboard.channel_disabled":"Devre Dışı","dashboard.loading_sessions":"Oturumlar yükleniyor...","dashboard.loading_channels":"Kanallar yükleniyor...","dashboard.load_sessions_error":"Oturumlar yüklenemedi","dashboard.load_channels_error":"Kanallar yüklenemedi","dashboard.never":"Hiç","dashboard.agents_title":"Ajanlar","dashboard.agents_empty":"Yapılandırılmış temsilci ajan yok.","dashboard.agent_general_purpose":"Genel amaçlı","dashboard.agent_not_running":"-","dashboard.agentic":"Ajanik","dashboard.single_turn":"Tek tur","dashboard.depth":"derinlik","dashboard.iterations":"tur","dashboard.current_task":"Geçerli görev","dashboard.run_time":"Çalışma süresi","dashboard.progress":"İlerleme","dashboard.last_active":"Son etkinlik","dashboard.capabilities":"Yetenekler","dashboard.no_tool_allowlist":"Açık araç izin listesi yok","dashboard.idle":"Boşta","dashboard.primary_agent_title":"Birincil Ajan","dashboard.primary_agent_status":"Çalışıyor","dashboard.primary_agent_style":"Web sohbeti ve araç kullanımlı dönüşler için varsayılan etkileşimli ajan.","dashboard.primary_agent_kind":"Web sohbeti","dashboard.primary_agent_tooling":"Araç etkin","dashboard.primary_agent_task":"Her zaman hazır","dashboard.primary_agent_progress":"Hazır","dashboard.primary_agent_last_active":"Sürekli çalışıyor","dashboard.delegate_agents_title":"Alt Ajanlar","agent.title":"Ajan Sohbeti","agent.send":"Gönder","agent.placeholder":"Bir mesaj yazın...","agent.start_conversation":"Sohbeti başlatmak için mesaj gönderin","agent.type_message":"Bir mesaj yazın...","agent.light_greeting_title":"Merhaba, ben KylinBot!","agent.light_greeting_subtitle":"Sorular, yazma, özetleme, bilgi erişimi ve günlük görevlerde yardımcı olabilirim.","agent.light_try_label":"Şunları deneyebilirsiniz:","agent.light_refresh_label":"Değiştir","agent.light_card_recommended":"Önerilen istemler","agent.light_card_knowledge":"Bilgi tabanı","agent.light_card_knowledge_prompt":"Bilgi tabanımdaki temel noktaları özetle.","agent.light_suggestion_one":"Beyaz bir gömlekten kahve lekesi nasıl çıkarılır?","agent.light_suggestion_two":"Takım buluşması için iyi buz kırıcı oyunlar nelerdir?","agent.light_suggestion_three":"Bir müşteri için kısa bir takip e-postası yaz.","agent.light_suggestion_four":"Uzun bir makaleyi madde madde nasıl özetlerim?","agent.light_suggestion_five":"Excel'de koşullu toplam nasıl alınır?","agent.light_suggestion_six":"Kısa bir ürün lansmanı duyuru metni yaz.","agent.light_suggestion_seven":"Programlamaya yeni başlayan biri nereden başlamalı?","agent.light_suggestion_eight":"Üç günlük iş seyahati için neleri paketlemeliyim?","agent.light_suggestion_nine":"API nedir, basit bir dille açıkla.","agent.light_type_message":'Bir soru sorun veya becerileri kullanmak için "/" yazın',"agent.light_tool_model":"Akıllı model yönlendirme","agent.light_tool_expand":"Derin düşünme","agent.light_tool_search":"Web arama","agent.model_selector_title":"Model Seç","agent.model_selector_configured":"Yapılandırılmış Modeller","agent.model_selector_no_configured":"Başka model yapılandırılmamış","agent.connecting":"Bağlanıyor...","agent.connected":"Bağlandı","agent.disconnected":"Bağlantı kesildi","agent.reconnecting":"Yeniden bağlanıyor...","agent.thinking":"Düşünüyor...","agent.tool_call":"Araç Çağrısı","agent.tool_result":"Araç Sonucu","agent.connection_error":"Bağlantı hatası. Yeniden bağlanmaya çalışılıyor...","agent.tool_call_prefix":"[Araç Çağrısı]","agent.tool_result_prefix":"[Araç Sonucu]","agent.error_prefix":"[Hata]","agent.unknown_error":"Bilinmeyen hata","agent.send_error":"Mesaj gönderilemedi. Lütfen tekrar deneyin.","agent.copy_message":"Mesajı kopyala","agent.show_json":"JSON Goster","agent.hide_json":"JSON Gizle","agent.toggle_system_messages":"Sistem mesajlarini goster/gizle","agent.connected_status":"Bağlandı","agent.disconnected_status":"Bağlantı kesildi","agent.generating_block_tip":"Yanıt oluşturuluyor, lütfen tamamlandıktan sonra tekrar deneyin","header.new_session":"Yeni Oturum","header.window_pin":"Üste Sabitle","header.window_minimize":"Simge Durumuna Küçült","header.window_maximize":"Büyüt","header.window_close":"Kapat","tools.title":"Mevcut Araçlar","tools.name":"Ad","tools.description":"Açıklama","tools.parameters":"Parametreler","tools.search":"Araç ara...","tools.empty":"Araç bulunamadı.","tools.count":"Toplam araç","tools.agent_tools":"Ajan Araçları","tools.cli_tools":"CLI Araçları","tools.parameter_schema":"Parametre Şeması","tools.path":"Yol","tools.version":"Sürüm","tools.category":"Kategori","tools.load_error":"Araçlar yüklenemedi","cron.title":"Zamanlanmış Görevler","cron.scheduled_tasks":"Zamanlanmış Görevler","cron.add":"Görev Ekle","cron.add_job":"Görev Ekle","cron.modal_add":"Ekle","cron.add_modal_title":"Görev Ekle","cron.delete":"Sil","cron.enable":"Etkinleştir","cron.disable":"Devre Dışı Bırak","cron.name":"Ad","cron.name_optional":"Ad (isteğe bağlı)","cron.command":"Komut","cron.command_required":"Komut","cron.schedule":"Zamanlama","cron.schedule_required":"Zamanlama","cron.schedule_kind_cron":"Cron ifadesi","cron.schedule_kind_at":"Belirli zaman","cron.schedule_kind_every":"Sabit aralık","cron.schedule_cron_placeholder":"örn. 0 0 * * *","cron.schedule_tz_optional":"Saat dilimi (isteğe bağlı, örn. Europe/Istanbul)","cron.schedule_every_ms_placeholder":"Milisaniye aralığı (örn. 60000)","cron.next_run":"Sonraki Çalıştırma","cron.last_run":"Son Çalıştırma","cron.last_status":"Son Durum","cron.enabled":"Etkin","cron.enabled_status":"Etkin","cron.disabled_status":"Devre Dışı","cron.empty":"Zamanlanmış görev bulunamadı.","cron.confirm_delete":"Bu görevi silmek istediğinizden emin misiniz?","cron.delete_desc":"Silindikten sonra bu görev artık otomatik olarak çalışmayacak ve geri yüklenemeyecektir.","cron.load_error":"Cron görevleri yüklenemedi","cron.validation_error":"Zamanlama ve komut gereklidir.","cron.add_error":"Görev eklenemedi","cron.delete_error":"Görev silinemedi","cron.cancel":"İptal","cron.adding":"Ekleniyor...","cron.id":"ID","cron.actions":"İşlemler","cron.loading_run_history":"Çalıştırma geçmişi yükleniyor...","cron.load_run_history_error":"Çalıştırma geçmişi yüklenemedi","cron.no_runs":"Henüz çalıştırma kaydı yok.","cron.recent_runs":"Son Çalıştırmalar","cron.yes":"Evet","cron.no":"Hayır","cron.edit":"Düzenle","cron.edit_modal_title":"Görevi Düzenle","cron.edit_error":"Görev güncellenemedi","cron.saving":"Kaydediliyor...","cron.save":"Kaydet","cron.confirm":"Onayla","cron.job_type":"Görev Türü","cron.job_type_shell":"Shell","cron.job_type_agent":"Ajan","cron.session_target":"Oturum Hedefi","cron.session_target_isolated":"İzole","cron.session_target_main":"Ana","cron.model_optional":"Model (isteğe bağlı)","cron.allowed_tools":"İzinli Araçlar (virgülle)","cron.delivery_mode":"Teslim Modu","cron.delivery_mode_none":"Yok","cron.delivery_mode_announce":"Duyuru","cron.delivery_channel":"Teslim Kanalı","cron.delivery_target":"Teslim Hedefi","cron.delivery_best_effort":"En iyi çaba teslim","cron.enable_job":"Görevi etkinleştir","cron.delete_after_run":"Çalıştırma sonrası sil","cron.run_now":"Şimdi çalıştır","cron.pause_job":"Görevi duraklat","cron.resume_job":"Görevi sürdür","cron.run_error":"Görev çalıştırılamadı","cron.toggle_error":"Görev durumu değiştirilemedi","cron.catch_up_title":"Başlangıçta kaçırılan görevleri telafi et","cron.catch_up_desc":"KylinBot yeniden başladığında geciken görevleri çalıştır","cron.name_placeholder":"örn. Günlük temizlik","cron.command_shell_placeholder":"örn. cleanup --older-than 7d","cron.command_agent_placeholder":"Ajan görevi için istem girin","cron.model_placeholder":"örn. gpt-4.1","cron.allowed_tools_placeholder":"file_read,web_search","cron.toggle_run_history":"Çalıştırma geçmişini aç/kapat","cron.task_name":"Görev Adı","cron.task_prompt_label":"Görev Talimatı","cron.task_name_placeholder":"Görev adı girin","cron.task_prompt_placeholder":"Görev talimatı girin. Örn: Her gün 5 pratik İngilizce kelime öner","cron.exec_time":"Zamanlama","cron.daily_time_step_up":"Bir dakika ekle","cron.daily_time_step_down":"Bir dakika çıkar","cron.once_run_date":"Çalıştırma tarihi","cron.once_date_step_up":"Sonraki gün","cron.once_date_step_down":"Önceki gün","cron.once_open_calendar":"Takvimi aç","cron.once_time_past":"Yürütme zamanı mevcut zamandan önce olamaz","cron.cal_prev_year":"Önceki yıl","cron.cal_prev_month":"Önceki ay","cron.cal_next_month":"Sonraki ay","cron.cal_next_year":"Sonraki yıl","cron.cal_head_1":"Pt","cron.cal_head_2":"Sa","cron.cal_head_3":"Ça","cron.cal_head_4":"Pe","cron.cal_head_5":"Cu","cron.cal_head_6":"Ct","cron.cal_head_7":"Pa","cron.schedule_daily_label":"Günlük","cron.schedule_interval_label":"Aralık","cron.schedule_once_label":"Bir Kez","cron.schedule_custom_label":"Özel","cron.remote_channel":"Uzak Kanal","cron.exec_model":"Yürütme Modeli","cron.channel_main":"Ana Oturum","cron.interval_every":"Her","cron.interval_row_label":"Her aralık","cron.interval_step_up":"Aralık değerini artır","cron.interval_step_down":"Aralık değerini azalt","cron.interval_unit_minute":"dakika","cron.interval_unit_hour":"saat","cron.interval_unit_day":"gün","cron.interval_effective_time":"Geçerli saat aralığı","cron.date_range":"Tarih Aralığı","cron.date_range_start":"Başlangıç tarihi","cron.date_range_end":"Bitiş tarihi","cron.model_default":"Varsayılan","cron.weekday_1":"Pzt","cron.weekday_2":"Sal","cron.weekday_3":"Çar","cron.weekday_4":"Per","cron.weekday_5":"Cum","cron.weekday_6":"Cmt","cron.weekday_7":"Paz","integrations.title":"Entegrasyonlar","integrations.available":"Mevcut","integrations.active":"Aktif","integrations.coming_soon":"Yakında","integrations.category":"Kategori","integrations.status":"Durum","integrations.search":"Entegrasyon ara...","integrations.empty":"Entegrasyon bulunamadı.","integrations.activate":"Etkinleştir","integrations.deactivate":"Devre Dışı Bırak","integrations.load_error":"Entegrasyonlar yüklenemedi","integrations.all":"Tümü","integrations.status_active":"Aktif","integrations.status_available":"Mevcut","integrations.status_coming_soon":"Yakında","modelswitch.title":"Model Değiştirme","modelswitch.all":"Tümü","modelswitch.empty":"Model bulunamadı.","modelswitch.status_active":"Aktif","modelswitch.status_available":"Mevcut","modelswitch.status_coming_soon":"Yakında","skills.title":"Beceriler","skills.all":"Tümü","skills.empty":"Beceri bulunamadı.","skills.enabled":"Etkin","skills.disabled":"Devre Dışı","skills.status_active":"Aktif","skills.status_available":"Mevcut","skills.status_coming_soon":"Yakında","memory.title":"Hafıza Deposu","memory.memory_title":"Hafıza","memory.search":"Hafıza ara...","memory.search_placeholder":"Hafıza girişleri ara...","memory.add":"Hafıza Ekle","memory.add_memory":"Hafıza Ekle","memory.add_modal_title":"Hafıza Ekle","memory.delete":"Sil","memory.key":"Anahtar","memory.key_required":"Anahtar","memory.content":"İçerik","memory.content_required":"İçerik","memory.category":"Kategori","memory.category_optional":"Kategori (isteğe bağlı)","memory.timestamp":"Zaman Damgası","memory.session":"Oturum","memory.score":"Puan","memory.empty":"Hafıza girişi bulunamadı.","memory.confirm_delete":"Bu hafıza girişini silmek istediğinizden emin misiniz?","memory.all_categories":"Tüm Kategoriler","memory.search_button":"Ara","memory.load_error":"Hafıza yüklenemedi","memory.saving":"Kaydediliyor...","memory.validation_error":"Anahtar ve içerik gereklidir.","memory.store_error":"Hafıza kaydedilemedi","memory.delete_error":"Hafıza silinemedi","memory.delete_confirm":"Sil?","memory.yes":"Evet","memory.no":"Hayır","memory.cancel":"İptal","config.title":"Yapılandırma","config.save":"Kaydet","config.saving":"Kaydediliyor...","config.reset":"Sıfırla","config.saved":"Yapılandırma başarıyla kaydedildi.","config.error":"Yapılandırma kaydedilemedi.","config.loading":"Yapılandırma yükleniyor...","config.editor_placeholder":"TOML yapılandırması...","config.configuration_title":"Yapılandırma","config.sensitive_title":"Hassas alanlar gizlendi","config.sensitive_hint":"API anahtarları, belirteçler ve parolalar güvenlik için gizlendi. Maskeli bir alanı güncellemek için, tüm maskeli değeri yeni değerinizle değiştirin.","config.save_success":"Yapılandırma başarıyla kaydedildi.","config.save_error":"Yapılandırma kaydedilemedi","config.toml_label":"TOML Yapılandırması","config.lines":"satır","config.mode.form":"Form","config.mode.advanced":"Gelişmiş","config.section.general":"Genel","config.section.agent":"Ajan","config.section.gateway":"Ağ Geçidi","config.section.cost":"Maliyet","config.section.memory":"Hafıza","config.section.web_search":"Web Arama","config.section.heartbeat":"Kalp Atışı","config.field.default_provider":"Varsayılan Model Sağlayıcısı","config.field.default_provider.desc":"Kullanılacak LLM sağlayıcısı (ör. openrouter, ollama)","config.field.default_model":"Varsayılan Model","config.field.default_model.desc":"Varsayılan sağlayıcı için model adı","config.field.default_temperature":"Sıcaklık","config.field.default_temperature.desc":"Rastgeleliği kontrol eder (0 = belirleyici, 2 = maks yaratıcılık)","config.field.provider_timeout_secs":"Sağlayıcı Zaman Aşımı (sn)","config.field.provider_timeout_secs.desc":"LLM API çağrıları için HTTP zaman aşımı","config.field.locale":"Dil","config.field.locale.desc":"Arayüz dili ayarı","config.field.compact_context":"Kompakt Bağlam","config.field.compact_context.desc":"Küçük modeller için bağlam boyutunu azalt (13B veya daha az)","config.field.max_tool_iterations":"Maks Araç Yinelemesi","config.field.max_tool_iterations.desc":"Kullanıcı mesajı başına maks araç çağrısı döngüsü","config.field.max_history_messages":"Maks Geçmiş Mesajı","config.field.max_history_messages.desc":"Oturum başına maks konuşma geçmişi mesajı","config.field.max_context_tokens":"Maks Bağlam Token","config.field.max_context_tokens.desc":"Aşıldığında geçmiş sıkıştırma tetiklenir","config.field.parallel_tools":"Paralel Araçlar","config.field.parallel_tools.desc":"Bir turda paralel araç yürütmeyi etkinleştir","config.field.gateway_port":"Port","config.field.gateway_port.desc":"Ağ geçidi sunucu portu","config.field.gateway_host":"Ana Bilgisayar","config.field.gateway_host.desc":"Ağ geçidi bağlama adresi","config.field.require_pairing":"Eşleştirme Gerekli","config.field.require_pairing.desc":"İstekleri kabul etmeden önce cihaz eşleştirmesi gerektirir","config.field.session_persistence":"Oturum Kalıcılığı","config.field.session_persistence.desc":"WebSocket oturumlarını SQLite'a kaydet","config.field.session_ttl_hours":"Oturum TTL (saat)","config.field.session_ttl_hours.desc":"Eski oturumları otomatik arşivle (0 = devre dışı)","config.field.allow_public_bind":"Herkese Açık Bağlamaya İzin Ver","config.field.allow_public_bind.desc":"Tünel olmadan localhost dışı bağlamaya izin ver","config.field.daily_limit_usd":"Günlük Limit (USD)","config.field.daily_limit_usd.desc":"Günlük harcama limiti","config.field.monthly_limit_usd":"Aylık Limit (USD)","config.field.monthly_limit_usd.desc":"Aylık harcama limiti","config.field.warn_at_percent":"Uyarı Eşiği (%)","config.field.warn_at_percent.desc":"Bütçe kullanımı bu yüzdeyi aştığında uyar","config.field.allow_override":"Geçersiz Kılmaya İzin Ver","config.field.allow_override.desc":"--override bayrağının bütçe limitlerini aşmasına izin ver","config.field.memory_enabled":"Hafızayı etkinleştir","config.field.memory_enabled.desc":"Ajan hafıza depolamasını aç veya kapat","config.field.memory_backend":"Arka Uç","config.field.memory_backend.desc":"Ajan hafızası için depolama arka ucu","config.field.heartbeat_enabled":"Kalp atışını etkinleştir","config.field.heartbeat_enabled.desc":"Zamanlanmış kalp atışı kontrollerini çalıştır","config.field.web_search_enabled":"Web aramayı etkinleştir","config.field.web_search_enabled.desc":"Ajanın web arama araçlarını kullanmasına izin ver","config.field.cost_enabled":"Maliyet limitlerini etkinleştir","config.field.cost_enabled.desc":"Harcamayı izle ve bütçe limitlerini uygula","config.field.web_search_provider":"Arama Sağlayıcısı","config.field.web_search_provider.desc":"Kullanılacak web arama motoru","config.field.max_results":"Maks Sonuç","config.field.max_results.desc":"Arama sorgusu başına sonuç sayısı","config.field.web_search_timeout":"Zaman Aşımı (sn)","config.field.web_search_timeout.desc":"Arama isteği zaman aşımı","config.field.interval_minutes":"Aralık (dk)","config.field.interval_minutes.desc":"Kalp atışı kontrolleri arasındaki dakika","config.field.two_phase":"İki Aşamalı","config.field.two_phase.desc":"Yürütmeden önce LLM'e çalıştırıp çalıştırmayacağını sor","config.field.adaptive":"Uyarlanabilir","config.field.adaptive.desc":"Etkinliğe göre aralığı otomatik ayarla","config.field.min_interval_minutes":"Min Aralık (dk)","config.field.min_interval_minutes.desc":"Uyarlanabilir mod etkinken minimum aralık","config.field.max_interval_minutes":"Maks Aralık (dk)","config.field.max_interval_minutes.desc":"Uyarlanabilir mod geri çekildiğinde maksimum aralık","config.field.heartbeat_message":"Yedek Mesaj","config.field.heartbeat_message.desc":"HEARTBEAT.md boşken yedek görev metni","config.field.heartbeat_target":"Hedef Kanal","config.field.heartbeat_target.desc":"Kalp atışı çıktısı için teslim kanalı (ör. telegram)","config.field.task_timeout_secs":"Görev Zaman Aşımı (sn)","config.field.task_timeout_secs.desc":"Tek bir kalp atışı ajan çağrısı için maks saniye","config.error.serialize_failed":"Yapılandırma serileştirilemedi","config.error.invalid_toml_switch":"Geçersiz TOML — form görünümüne geçmeden önce hataları düzeltin","config.error.reload_failed":"Yapılandırma yeniden yüklenemedi","config.error.initial_parse_failed":"Yapılandırma ayrıştırılamadı; boş form gösteriliyor. TOML'u düzeltin veya başka yerde düzenleyin.","cost.title":"Maliyet Takibi","cost.session":"Oturum Maliyeti","cost.daily":"Günlük Maliyet","cost.monthly":"Aylık Maliyet","cost.total_tokens":"Toplam Token","cost.request_count":"İstek Sayısı","cost.by_model":"Modele Göre Maliyet","cost.model":"Model","cost.tokens":"Token","cost.requests":"İstekler","cost.usd":"Maliyet (USD)","cost.load_error":"Maliyet verileri yüklenemedi","cost.session_cost":"Oturum Maliyeti","cost.daily_cost":"Günlük Maliyet","cost.monthly_cost":"Aylık Maliyet","cost.total_requests":"Toplam İstek","cost.token_statistics":"Token İstatistikleri","cost.avg_tokens_per_request":"Ortalama Token / İstek","cost.cost_per_1k_tokens":"1K Token Başına Maliyet","cost.model_breakdown":"Model Detayı","cost.no_model_data":"Model verisi mevcut değil.","cost.cost":"Maliyet","cost.share":"Pay","logs.title":"Canlı Kayıtlar","logs.live_logs":"Canlı Kayıtlar","logs.clear":"Temizle","logs.pause":"Duraklat","logs.resume":"Devam Et","logs.filter":"Kayıtları filtrele...","logs.filter_label":"Filtre","logs.empty":"Kayıt girişi bulunamadı.","logs.connected":"Bağlandı","logs.disconnected":"Bağlantı kesildi","logs.events":"olay","logs.jump_to_bottom":"En alta atla","logs.paused_hint":"Kayıt akışı duraklatıldı.","logs.waiting_hint":"Olay bekleniyor...","doctor.title":"Sistem Tanıları","doctor.diagnostics_title":"Tanılar","doctor.run":"Tanı Çalıştır","doctor.run_diagnostics":"Tanı Çalıştır","doctor.running":"Tanı çalıştırılıyor...","doctor.running_btn":"Çalıştırılıyor...","doctor.running_desc":"Tanı çalıştırılıyor...","doctor.running_hint":"Bu birkaç saniye sürebilir.","doctor.ok":"Tamam","doctor.warn":"Uyarı","doctor.error":"Hata","global.refresh":"Yenile","doctor.severity":"Şiddet","doctor.category":"Kategori","doctor.message":"Mesaj","doctor.empty":"Henüz tanı çalıştırılmadı.","doctor.summary":"Tanı Özeti","doctor.issues_found":"Sorunlar Bulundu","doctor.warnings_summary":"Uyarılar","doctor.all_clear":"Her Şey Yolunda","doctor.system_diagnostics":"Sistem Tanıları","doctor.empty_hint":'KylinBot kurulumunuzu kontrol etmek için "Tanı Çalıştır" düğmesine tıklayın.',"auth.pair":"Cihaz Eşleştir","auth.pairing_code":"Eşleştirme Kodu","auth.pair_button":"Eşleştir","auth.logout":"Çıkış Yap","auth.pairing_success":"Eşleştirme başarılı!","auth.pairing_failed":"Eşleştirme başarısız. Lütfen tekrar deneyin.","auth.enter_code":"Akıllı birine bağlanmak için eşleştirme kodunuzu girin.","common.loading":"Yükleniyor...","common.error":"Bir hata oluştu.","common.retry":"Tekrar Dene","common.cancel":"İptal","common.confirm":"Onayla","common.save":"Kaydet","common.delete":"Sil","common.edit":"Düzenle","common.close":"Kapat","common.yes":"Evet","common.no":"Hayır","common.search":"Ara...","common.no_data":"Veri mevcut değil.","common.refresh":"Yenile","common.back":"Geri","common.actions":"İşlemler","common.name":"Ad","common.description":"Açıklama","common.status":"Durum","common.created":"Oluşturulma","common.updated":"Güncellenme","health.title":"Sistem Sağlığı","health.component":"Bileşen","health.status":"Durum","health.last_ok":"Son Başarılı","health.last_error":"Son Hata","health.restart_count":"Yeniden Başlatmalar","health.pid":"İşlem Kimliği","health.uptime":"Çalışma Süresi","health.updated_at":"Son Güncelleme","settings.title":"Ayarlar","settings.theme_title":"Tema Ayarları","settings.tab.appearance":"Görünüm","settings.tab.typography":"Tipografi","settings.dark_presets":"Koyu Temalar","settings.light_presets":"Açık Temalar","settings.appearance":"Görünüm","settings.typography":"Tipografi","settings.fontUi":"Arayüz Yazı Tipi","settings.fontMono":"Kod Yazı Tipi","settings.fontSize":"Arayüz Boyutu","settings.fontMonoSize":"Kod Boyutu","settings.preview":"Önizleme","settings.previewText":"Tembel köpek üzerinde hızlı kahverengi tilki zıplar.","settings.fontNote":"Yazı tipi değişiklikleri sayfa yeniden yüklendikten sonra geçerli olur.","settings.language":"Dil","settings.window":"Pencere","theme.mode":"Tema Modu","theme.accent":"Vurgu Rengi","theme.system":"Sistem","theme.dark":"Koyu","theme.light":"Açık","theme.oled":"OLED Siyah","channel.title":"Kanallar","channel.configure":"Yapılandır","channel.connected":"Bağlı","channel.not_configured":"Yapılandırılmamış","channel.not_connected":"Bağlı Değil","channel.disconnecting":"Bağlantı kesiliyor...","channel.disconnect":"Bağlantıyı Kes","service.not_started_message":"Kylin hizmeti henüz başlatılmadı. Bazı içerikler geçici olarak yüklenemiyor.","service.start_now":"Hemen Başlat","service.starting":"Başlatılıyor…","channel.wechat":"WeChat","channel.wechat.desc":"Günlük görevler için sohbetlerde doğrudan KylinBot çağırmak üzere WeChat bağlayın","channel.wecom":"WeCom","channel.wecom.desc":"Takım işbirliği için grup veya özel sohbetlerde KylinBot çağırmak üzere WeCom hesabınızı bağlayın","channel.dingtalk":"DingTalk","channel.dingtalk.desc":"Görev komutları vermek ve iş akışlarını otomatikleştirmek için DingTalk botu bağlayın","channel.feishu":"Feishu","channel.feishu.desc":"Görev işleme ve iş akışı koordinasyonu için Feishu botu bağlayın","channel.lansenger":"Lansenger","channel.lansenger.desc":"Mesajları uzun bağlantı üzerinden almak ve Lansenger sohbetlerinde KylinBot çağırmak için Lansenger botu bağlayın","channel.wechat.connected":"WeChat başarıyla yapılandırıldı","channel.wecom.connected":"WeCom başarıyla yapılandırıldı","channel.dingtalk.connected":"DingTalk başarıyla yapılandırıldı","channel.feishu.connected":"Feishu başarıyla yapılandırıldı","channel.lansenger.connected":"Lansenger başarıyla yapılandırıldı","channel.wechat.disconnected":"WeChat bağlantısı kesildi","channel.wecom.disconnected":"WeCom bağlantısı kesildi","channel.dingtalk.disconnected":"DingTalk bağlantısı kesildi","channel.feishu.disconnected":"Feishu bağlantısı kesildi","channel.lansenger.disconnected":"Lansenger bağlantısı kesildi","channel.scan_connect":"Tara ve Bağlan","channel.websocket_connect":"WebSocket Bağlantısı","channel.stream_connect":"Stream Bağlantısı","channel.bind_success":"Başarıyla bağlandı","channel.qr_expired":"QR kodunun süresi doldu, lütfen yenileyin","channel.qr_fetch_failed":"QR kodu alınamadı","channel.refresh_qr":"QR Kodunu Yenile","channel.scanned_confirm":"Tarandı, lütfen telefonunuzda onaylayın...","channel.bind_error":"Bir hata oluştu","channel.connect":"Bağlan","channel.scan_tip":"Lütfen aşağıdaki QR kodunu WeChat ile tarayın","channel.confirm":"Tamam","channel.retry":"Tekrar Dene","channel.cancel":"İptal","channel.bot_id":"Bot ID","channel.wecom.bot_id_placeholder":"Bot ID girin","channel.wecom.secret_placeholder":"Secret girin","channel.wecom.fill_required":"Lütfen Bot ID ve Secret doldurun","channel.dingtalk.client_id_placeholder":"Client ID girin","channel.dingtalk.client_secret_placeholder":"Client Secret girin","channel.dingtalk.fill_required":"Lütfen Client ID ve Client Secret doldurun","channel.dingtalk.auth_failed":"Yetkilendirme başarısız","channel.feishu.app_id_placeholder":"App ID girin","channel.feishu.app_secret_placeholder":"App Secret girin","channel.feishu.fill_required":"Lütfen App ID ve App Secret doldurun","channel.feishu.access_denied":"Kullanıcı yetkilendirmeyi reddetti","channel.lansenger.app_id_placeholder":"App ID girin","channel.lansenger.app_secret_placeholder":"App Secret girin","channel.lansenger.api_gateway_placeholder":"API Gateway URL girin","channel.lansenger.fill_required":"Lütfen App ID ve App Secret doldurun","agent.approval_required":"Onay Gerekli","agent.allow_once":"Bir Kez İzin Ver","agent.always_this_session":"Bu Oturumda Her Zaman","agent.deny":"Reddet","agent.expires_at":"Son kullanma","identity.setup":"Kimlik Ayarla","identity.setup_desc":"AI asistanınızı ayarlayın","identity.name_placeholder":"AI asistanınıza bir isim verin","identity.name_example":"örn: Kylin, Xiao Zhi, Asistan","identity.role_label":"Rolünü tanımlayın (isteğe bağlı)","identity.role_example":"örn: Kod optimizasyonu ve hata ayıklamada uzman profesyonel kodlama asistanı","history.title":"Sohbet Geçmişi","history.task_title":"Görev Geçmişi","history.today":"Bugün","history.last_7_days":"Son 7 Gün","history.last_30_days":"Son 30 Gün","history.last_year":"Son Yıl","history.earlier":"Daha Önce","history.empty":"Henüz sohbet geçmişi yok","history.loading":"Yükleniyor...","chat.attachment_too_large":"Toplam ek boyutu çok büyük, lütfen 40MB içinde tutun.","chat.file_too_large":"{name} dosyası 15MB sınırını aşıyor.","chat.read_attachment_failed":"Ek okunamadı, lütfen tekrar deneyin.","chat.remove_attachment":"{name} ekini kaldır","chat.unnamed_session":"İsimsiz Oturum","chat.yesterday":"Dün","chat.weekday.sun":"Paz","chat.weekday.mon":"Pzt","chat.weekday.tue":"Sal","chat.weekday.wed":"Çar","chat.weekday.thu":"Per","chat.weekday.fri":"Cum","chat.weekday.sat":"Cmt","chat.date.month_day":"{d}.{m}","chat.date.year_month_day":"{d}.{m}.{y}","model.edit_config":"Model Yapılandırmasını Düzenle","model.add_config":"Model Yapılandırması Ekle","model.cancel_edit":"Düzenlemeyi İptal Et","model.save_edit_sync":"Düzenlemeyi Kaydet ve Yapılandırmayı Senkronize Et","model.add_write_remote":"Ekle ve Uzak Yapılandırmaya Yaz","model.saving":"Kaydediliyor...","model.current_model":"Mevcut Model","model.view":"Görüntüle","model.not_set":"Ayarlanmamış","model.not_saved_locally":"Yerel Olarak Kaydedilmedi","model.provider_model_required":"Lütfen önce provider ve modeli doldurun","model.update_sync_success":"Model bilgisi güncellendi ve yerel/uzak yapılandırmaya senkronize edildi","model.add_remote_success":"Model uzak yapılandırmaya yazıldı ve değiştirilebilir listeye eklendi","model.save_failed":"Kaydetme başarısız","model.deleted":"Model değiştirilebilir listeden kaldırıldı","model.model_placeholder":"örn. gpt-5.2 / qwen-plus / claude-sonnet-4-6","model.qwen_api_key_required":"Qwen bir API Anahtarı gerektirir. Lütfen kaydetmeden önce DASHSCOPE_API_KEY doldurun.","model.qwen_api_key_hint":"Qwen gerekli: DASHSCOPE_API_KEY","model.qwen_oauth_hint":"Qwen Code: QWEN_OAUTH_TOKEN (isteğe bağlı)","model.key_optional_hint":"İsteğe bağlı (provider başlatma hatasını önlemek için önerilir)","model.base_url_hint_qwen":"İsteğe bağlı, ör. https://dashscope.aliyuncs.com/compatible-mode/v1","model.base_url_hint_openai":"İsteğe bağlı, ör. https://api.openai.com/v1","model.custom_base_url_required":"Özel provider bir Base URL gerektirir, ör. https://api.openai.com/v1","model.provider_model_empty":"Provider ve model boş olamaz","model.configured_model":"Yapılandırılmış Model","model.qwen_plus":"Qwen Plus","model.qwen_qwq":"Qwen QWQ-32B","model.desc_general":"Genel konuşma, dengeli performans ve maliyet","model.desc_thinking":"Düşünme modeli, güçlü akıl yürütme yeteneği","model.desc_deep_reasoning":"Derin akıl yürütme modeli","model.desc_new_thinking":"Yeni nesil derin düşünme modeli","provider.category_recommended":"Önerilen (Toplama ve Doğrudan)","provider.category_fast":"Hızlı Çıkarım","provider.category_gateway":"Ağ Geçidi / Bulut Sağlayıcılar","provider.category_domestic":"Yerel ve Uzman","provider.category_local":"Yerel / Özel OpenAI Uyumlu","provider.openrouter_notes":"Çok model yönlendirme, OpenAI uyumlu Chat Completions","provider.anthropic_notes":"Messages API; yapılandırmada karşılık gelen anahtarı ayarlamayı gerektirir","provider.openai_notes":"wire_api göre Chat Completions / Responses","provider.ollama_notes":"Yerel veya uzak noktaya yapılandırılabilir api_url","provider.custom_notes":"custom:https://host... gibi Sağlayıcı ID","skillhub.title":"SkillHub","skillhub.tab.hot":"🔥 Trending","skillhub.tab.featured":"⭐ Önerilen","skillhub.tab.newest":"🆕 En Yeni","skillhub.tab.installed":"✅ Yüklü","skillhub.tab.installed_count":"✅ Yüklü ({count})","skillhub.search.placeholder":"Becerileri ara...","skillhub.search.results":'"{query}" için arama sonuçları',"skillhub.install":"Yükle","skillhub.installing":"Yükleniyor...","skillhub.installed":"Yüklü","skillhub.uninstall":"Kaldır","skillhub.author":"Yazar: {author}","skillhub.empty.installed":"Yüklü beceri yok","skillhub.empty.skills":"Beceri yok","skillhub.retry":"Tekrar Dene","skillhub.load_failed":"Yükleme başarısız","skillhub.detail.source_clawhub":"ClawHub Kaynaklı","skillhub.detail.source":"{source} Kaynaklı","skillhub.detail.safe":"Güvenlik kontrolünden geçti","skillhub.detail.unsafe":"Kontrol bekliyor","skillhub.detail.downloads":"İndirmeler","skillhub.detail.stars":"Yıldızlar","skillhub.detail.security_check":"Güvenlik Kontrolü","skillhub.detail.lab_keen":"Keen Lab","skillhub.detail.lab_sanbu":"Sanbu Lab","skillhub.detail.security_disclaimer":"Güvenlik kontrol sonuçları üçüncü taraf kuruluşlar tarafından sağlanır ve yalnızca referans içindir. Mutlak güvenlik garantisi oluşturmaz. Siber güvenlik dinamiktir — lütfen uygun güvenlik önlemleri ve risk yönetimi uygulayın.","skillhub.modal.install_title":"Beceri Yükle","skillhub.modal.install_confirm":"{name} SkillHub'dan yüklensin mi?","skillhub.modal.force_overwrite":"Zaten yüklüyse üzerine yaz","skillhub.modal.cancel":"İptal","skillhub.modal.install_btn":"Yükle","skillhub.modal.installing":"{name} yükleniyor...","skillhub.modal.success":"{name} başarıyla yüklendi!","skillhub.modal.error":"Yükleme başarısız","skillhub.modal.close":"Kapat","skillhub.modal.retry":"Tekrar Dene"}};function V4(){var n;if(typeof navigator>"u")return"en";const e=(navigator.language||((n=navigator.languages)==null?void 0:n[0])||"en").toLowerCase();return e.startsWith("zh")?"zh":e.startsWith("tr")?"tr":"en"}let Ed=V4();function Bs(e){Ed=e}function S(e){var n,r,l;return(l=(r=(n=Os[Ed])==null?void 0:n[e])!=null?r:Os.en[e])!=null?l:e}function Q4(e,n){var r,l,o;return(o=(l=(r=Os[n])==null?void 0:r[e])!=null?l:Os.en[e])!=null?o:e}function qa(){const[e,n]=x.useState(Ed);return x.useEffect(()=>{let r=!1;return Ls().then(l=>{var c,f;if(r)return;const o=(f=(c=l.locale)==null?void 0:c.toLowerCase())!=null?f:"";let u;o.startsWith("zh")?u="zh":o.startsWith("tr")?u="tr":u="en",Bs(u),n(u)}).catch(()=>{}),()=>{r=!0}},[]),{locale:e,t:r=>Q4(r,e)}}const Fs=()=>x.useContext(Cg),W4=[{value:"system",icon:aC,labelKey:"theme.system"},{value:"dark",icon:sC,labelKey:"theme.dark"},{value:"light",icon:vC,labelKey:"theme.light"},{value:"oled",icon:fd,labelKey:"theme.oled"}],X4=[{value:"cyan",color:"#22d3ee"},{value:"violet",color:"#8b5cf6"},{value:"emerald",color:"#10b981"},{value:"amber",color:"#f59e0b"},{value:"rose",color:"#f43f5e"},{value:"blue",color:"#3b82f6"}];function J4({open:e,onClose:n}){const{theme:r,accent:l,setTheme:o,setAccent:u}=Fs();return x.useEffect(()=>{if(!e)return;const c=f=>{f.key==="Escape"&&n()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[e,n]),e?s.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":S("settings.theme_title"),className:"fixed inset-0 z-50 flex items-center justify-center",onClick:n,children:[s.jsx("div",{className:"absolute inset-0",style:{background:"rgba(0,0,0,0.6)",backdropFilter:"blur(8px)"}}),s.jsxs("div",{className:"relative w-full max-w-2xl mx-4 rounded-3xl border shadow-2xl animate-fade-in",style:{background:"var(--pc-bg-base)",borderColor:"var(--pc-border)"},onClick:c=>c.stopPropagation(),children:[s.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b",style:{borderColor:"var(--pc-border)"},children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx(gC,{size:18,style:{color:"var(--pc-accent-light)"}}),s.jsx("h2",{className:"text-sm font-semibold",style:{color:"var(--pc-text-primary)"},children:S("settings.theme_title")})]}),s.jsx("button",{onClick:n,className:"h-8 w-8 rounded-xl flex items-center justify-center transition-colors",style:{color:"var(--pc-text-muted)",background:"transparent",border:"none",cursor:"default"},onMouseEnter:c=>{c.currentTarget.style.color="var(--pc-text-primary)",c.currentTarget.style.background="var(--pc-hover)"},onMouseLeave:c=>{c.currentTarget.style.color="var(--pc-text-muted)",c.currentTarget.style.background="transparent"},"aria-label":"Close",children:s.jsx(ma,{size:16})})]}),s.jsxs("div",{className:"px-6 py-4 max-h-[65vh] overflow-y-auto space-y-4",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-xs mb-2",style:{color:"var(--pc-text-secondary)"},children:S("theme.mode")}),s.jsx("div",{className:"flex gap-1.5",children:W4.map(c=>{const f=c.icon,h=r===c.value;return s.jsxs("button",{onClick:()=>o(c.value),"aria-pressed":h,className:"flex-1 flex flex-col items-center gap-1 py-2 rounded-xl border text-xs transition-all",style:h?{borderColor:"var(--pc-accent-dim)",background:"var(--pc-accent-glow)",color:"var(--pc-accent-light)"}:{borderColor:"var(--pc-border)",color:"var(--pc-text-muted)",background:"transparent"},onMouseEnter:m=>{h||(m.currentTarget.style.background="var(--pc-hover)")},onMouseLeave:m=>{h||(m.currentTarget.style.background="transparent")},children:[s.jsx(f,{size:16}),s.jsx("span",{children:S(c.labelKey)})]},c.value)})})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs mb-2",style:{color:"var(--pc-text-secondary)"},children:S("theme.accent")}),s.jsx("div",{className:"flex gap-2",children:X4.map(c=>s.jsx("button",{onClick:()=>u(c.value),className:"relative h-7 w-7 rounded-full transition-all flex items-center justify-center",style:{backgroundColor:c.color,border:l===c.value?`2px solid ${c.color}`:"2px solid transparent",boxShadow:l===c.value?`0 0 8px ${c.color}40`:"none"},"aria-pressed":l===c.value,"aria-label":`${c.value} accent`,children:l===c.value&&s.jsx(Pi,{size:14,style:{color:"white"}})},c.value))})]})]})]})]}):null}function Z4({onMenuToggle:e=()=>{},onNewAgentSession:n}){const r=$n(),[l,o]=x.useState(!1),[u,c]=x.useState(!1),{resolvedTheme:f}=Fs(),h=f==="light",m=r.pathname==="/agent";return x.useEffect(()=>{let y=!1;return ay().then(g=>{y||c(g)}),()=>{y=!0}},[]),s.jsxs(s.Fragment,{children:[s.jsxs("header",{"data-testid":"app-header","data-header-mode":"default",className:"h-10 flex items-center justify-between animate-fade-in px-2",style:{background:"transparent"},children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx("div",{style:{display:"none"},children:s.jsx("button",{type:"button",onClick:e,className:"md:hidden p-1.5 -ml-1.5 rounded-lg transition-colors duration-200",style:{color:"var(--pc-text-muted)"},onMouseEnter:y=>{y.currentTarget.style.color="var(--pc-text-primary)",y.currentTarget.style.background="var(--pc-hover)"},onMouseLeave:y=>{y.currentTarget.style.color="var(--pc-text-muted)",y.currentTarget.style.background="transparent"},"aria-label":"Open menu",children:s.jsx(iC,{className:"h-5 w-5"})})}),m&&s.jsx("button",{type:"button","data-testid":"header-new-session",className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg transition-colors",style:{color:"var(--pc-text-muted)",background:"transparent",border:"none",cursor:"default"},onMouseEnter:y=>{y.currentTarget.style.background="var(--pc-hover)"},onMouseLeave:y=>{y.currentTarget.style.background="transparent"},"aria-label":S("header.new_session"),title:S("header.new_session"),onClick:()=>n==null?void 0:n(),children:s.jsx(gy,{fileName:"new-chat.svg",sizeClass:"h-4 w-4"})})]}),s.jsx("div",{"data-tauri-drag-region":!0,className:"hidden md:block h-8 flex-1",onMouseDown:y=>{y.button===0&&TC()}}),s.jsx("div",{className:`flex items-center ${h?"gap-1.5 h-8":"gap-2 h-8"}`,children:s.jsxs("div",{className:`ml-2 flex items-center ${h?"gap-1.5":"gap-2"}`,children:[s.jsx("div",{style:{display:"none"},children:s.jsx(Is,{fileName:u?"ukui-fixed-symbolic.svg":"ukui-unfixed-symbolic.svg",label:S("header.window_pin"),active:u,onClick:async()=>{await ny(),c(y=>!y)}})}),s.jsx(Is,{fileName:"arrow-address-2.svg",label:S("header.window_minimize"),active:!1,onClick:ty}),s.jsx(Is,{fileName:"arrow-address.svg",label:S("header.window_maximize"),active:!1,onClick:NC}),s.jsx(Is,{fileName:"arrow-address-3.svg",label:S("header.window_close"),active:!1,onClick:RC})]})})]}),s.jsx(J4,{open:l,onClose:()=>o(!1)})]})}function Is({fileName:e,label:n,active:r,onClick:l}){return s.jsx("button",{type:"button",onClick:()=>{l()},className:"hidden md:flex h-8 w-8 shrink-0 items-center justify-center rounded-[6px] transition-colors","aria-pressed":r,style:{background:r?"var(--pc-hover)":"transparent",border:"none",cursor:"default",color:r?"var(--pc-text-primary)":"var(--pc-text-muted)"},onMouseEnter:o=>{o.currentTarget.style.background="var(--pc-hover)"},onMouseLeave:o=>{o.currentTarget.style.background=r?"var(--pc-hover)":"transparent"},"aria-label":n,title:n,children:s.jsx(gy,{fileName:e,sizeClass:"h-4 w-4"})})}function gy({fileName:e,sizeClass:n}){return s.jsx("span",{"aria-hidden":"true",className:`block ${n}`,style:{backgroundColor:"currentColor",opacity:.88,WebkitMaskImage:`url(${$e}/icons/${e})`,WebkitMaskRepeat:"no-repeat",WebkitMaskPosition:"center",WebkitMaskSize:"contain",maskImage:`url(${$e}/icons/${e})`,maskRepeat:"no-repeat",maskPosition:"center",maskSize:"contain"}})}const ej=["/agent","/general","/model","/skills","/skillhub","/cost","/memory","/cron"],yy=[{key:"agent",railTo:"/agent",matches:e=>e==="/agent"||e==="/agent/history",visibleNavItems:["/agent","/agent/history"]},{key:"config",railTo:"/general",matches:e=>ej.includes(e),visibleNavItems:["/general","/model","/skills","/skillhub","/cost","/memory","/cron"]}];function tj(e){var n;return(n=yy.find(r=>r.matches(e)))!=null?n:yy[0]}const by=x.createContext(null);function nj({children:e}){const n=x.useRef(null),r=x.useCallback(u=>{n.current=u},[]),l=x.useCallback(()=>{var u;(u=n.current)==null||u.call(n)},[]),o=x.useMemo(()=>({registerNewSessionHandler:r,requestNewSession:l}),[r,l]);return s.jsx(by.Provider,{value:o,children:e})}function xy(){const e=x.useContext(by);if(!e)throw new Error("useAgentNewSession must be used within AgentNewSessionProvider");return e}function aj(){if(typeof document>"u")return!1;try{return document.documentElement.classList.contains("kybot-embedded-qt-webengine")}catch{return!1}}function rj(){var T;const{pathname:e}=$n(),[n]=vS(),{requestNewSession:r}=xy(),[l,o]=x.useState(!1),[u,c]=x.useState(!1),[f,h]=x.useState(""),{resolvedTheme:m}=Fs(),y=m==="light",g=tj(e),_=n.get("kybotModelNoChrome")==="1"||((T=n.get("kybotModelNoChrome"))==null?void 0:T.toLowerCase())==="true",v=(e==="/model"||e==="/skills"||e==="/cron")&&(aj()||_),w=()=>{h(S("agent.generating_block_tip")),c(!0)},j=C=>{if(l){w();return}C()};return x.useEffect(()=>{if(!u)return;const C=window.setTimeout(()=>{c(!1)},3e3);return()=>window.clearTimeout(C)},[u,f]),s.jsxs("div",{className:"min-h-screen",style:{background:"var(--pc-bg-base)",color:"var(--pc-text-primary)"},children:[s.jsxs("div",{"data-testid":"layout-main-shell","data-nav-mode":g.key,"data-embedded-chromeless":v?"true":void 0,className:"ml-0 flex flex-col flex-1 min-w-0 h-screen",style:y?{background:"#FFFFFF"}:void 0,children:[!v&&s.jsx(Z4,{onNewAgentSession:()=>j(r)}),s.jsx("main",{className:"flex-1 overflow-y-auto overflow-x-hidden min-h-0",style:y?{background:"#FFFFFF"}:void 0,children:s.jsx(ED,{children:s.jsx(Pk,{context:{setAgentGenerating:o}})},e)})]}),u&&s.jsx("div",{className:"pointer-events-none fixed inset-0 z-[70] flex items-center justify-center px-4",children:s.jsxs("div",{className:"inline-flex min-h-[52px] w-fit max-w-[calc(100vw-2rem)] items-center gap-2 rounded-lg border px-4 py-3",style:{background:"#FFFFFF",borderColor:"rgba(0, 0, 0, 0.1)",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.2)"},role:"status","aria-live":"polite",children:[s.jsx("img",{src:`${$e}/icons/newbuttontips.svg`,alt:"",className:"h-4 w-4 shrink-0","aria-hidden":"true"}),s.jsx("span",{className:"text-sm",style:{color:"#000000"},children:f})]})})]})}function lj(){return s.jsx(nj,{children:s.jsx(rj,{})})}function aO(){}function rO(){}function ij(e,n){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const oj=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,sj=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,cj={};function vy(e,n){return(cj.jsx?sj:oj).test(e)}const uj=/[ \t\n\f\r]/g;function dj(e){return typeof e=="object"?e.type==="text"?_y(e.value):!1:_y(e)}function _y(e){return e.replace(uj,"")===""}class Vi{constructor(n,r,l){this.normal=r,this.property=n,l&&(this.space=l)}}Vi.prototype.normal={},Vi.prototype.property={},Vi.prototype.space=void 0;function wy(e,n){const r={},l={};for(const o of e)Object.assign(r,o.property),Object.assign(l,o.normal);return new Vi(r,l,n)}function Nd(e){return e.toLowerCase()}class gn{constructor(n,r){this.attribute=r,this.property=n}}gn.prototype.attribute="",gn.prototype.booleanish=!1,gn.prototype.boolean=!1,gn.prototype.commaOrSpaceSeparated=!1,gn.prototype.commaSeparated=!1,gn.prototype.defined=!1,gn.prototype.mustUseProperty=!1,gn.prototype.number=!1,gn.prototype.overloadedBoolean=!1,gn.prototype.property="",gn.prototype.spaceSeparated=!1,gn.prototype.space=void 0;let fj=0;const Oe=Jr(),Ot=Jr(),Td=Jr(),he=Jr(),yt=Jr(),Ul=Jr(),An=Jr();function Jr(){return 2**++fj}const Ad=Object.freeze(Object.defineProperty({__proto__:null,boolean:Oe,booleanish:Ot,commaOrSpaceSeparated:An,commaSeparated:Ul,number:he,overloadedBoolean:Td,spaceSeparated:yt},Symbol.toStringTag,{value:"Module"})),Md=Object.keys(Ad);class Rd extends gn{constructor(n,r,l,o){let u=-1;if(super(n,r),ky(this,"space",o),typeof l=="number")for(;++u<Md.length;){const c=Md[u];ky(this,Md[u],(l&Ad[c])===Ad[c])}}}Rd.prototype.defined=!0;function ky(e,n,r){r&&(e[n]=r)}function Hl(e){const n={},r={};for(const[l,o]of Object.entries(e.properties)){const u=new Rd(l,e.transform(e.attributes||{},l),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(l)&&(u.mustUseProperty=!0),n[l]=u,r[Nd(l)]=l,r[Nd(u.attribute)]=l}return new Vi(n,r,e.space)}const Sy=Hl({properties:{ariaActiveDescendant:null,ariaAtomic:Ot,ariaAutoComplete:null,ariaBusy:Ot,ariaChecked:Ot,ariaColCount:he,ariaColIndex:he,ariaColSpan:he,ariaControls:yt,ariaCurrent:null,ariaDescribedBy:yt,ariaDetails:null,ariaDisabled:Ot,ariaDropEffect:yt,ariaErrorMessage:null,ariaExpanded:Ot,ariaFlowTo:yt,ariaGrabbed:Ot,ariaHasPopup:null,ariaHidden:Ot,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:yt,ariaLevel:he,ariaLive:null,ariaModal:Ot,ariaMultiLine:Ot,ariaMultiSelectable:Ot,ariaOrientation:null,ariaOwns:yt,ariaPlaceholder:null,ariaPosInSet:he,ariaPressed:Ot,ariaReadOnly:Ot,ariaRelevant:null,ariaRequired:Ot,ariaRoleDescription:yt,ariaRowCount:he,ariaRowIndex:he,ariaRowSpan:he,ariaSelected:Ot,ariaSetSize:he,ariaSort:null,ariaValueMax:he,ariaValueMin:he,ariaValueNow:he,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function Cy(e,n){return n in e?e[n]:n}function jy(e,n){return Cy(e,n.toLowerCase())}const hj=Hl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ul,acceptCharset:yt,accessKey:yt,action:null,allow:null,allowFullScreen:Oe,allowPaymentRequest:Oe,allowUserMedia:Oe,alt:null,as:null,async:Oe,autoCapitalize:null,autoComplete:yt,autoFocus:Oe,autoPlay:Oe,blocking:yt,capture:null,charSet:null,checked:Oe,cite:null,className:yt,cols:he,colSpan:null,content:null,contentEditable:Ot,controls:Oe,controlsList:yt,coords:he|Ul,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Oe,defer:Oe,dir:null,dirName:null,disabled:Oe,download:Td,draggable:Ot,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Oe,formTarget:null,headers:yt,height:he,hidden:Td,high:he,href:null,hrefLang:null,htmlFor:yt,httpEquiv:yt,id:null,imageSizes:null,imageSrcSet:null,inert:Oe,inputMode:null,integrity:null,is:null,isMap:Oe,itemId:null,itemProp:yt,itemRef:yt,itemScope:Oe,itemType:yt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Oe,low:he,manifest:null,max:null,maxLength:he,media:null,method:null,min:null,minLength:he,multiple:Oe,muted:Oe,name:null,nonce:null,noModule:Oe,noValidate:Oe,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:Oe,optimum:he,pattern:null,ping:yt,placeholder:null,playsInline:Oe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Oe,referrerPolicy:null,rel:yt,required:Oe,reversed:Oe,rows:he,rowSpan:he,sandbox:yt,scope:null,scoped:Oe,seamless:Oe,selected:Oe,shadowRootClonable:Oe,shadowRootDelegatesFocus:Oe,shadowRootMode:null,shape:null,size:he,sizes:null,slot:null,span:he,spellCheck:Ot,src:null,srcDoc:null,srcLang:null,srcSet:null,start:he,step:null,style:null,tabIndex:he,target:null,title:null,translate:null,type:null,typeMustMatch:Oe,useMap:null,value:Ot,width:he,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:yt,axis:null,background:null,bgColor:null,border:he,borderColor:null,bottomMargin:he,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Oe,declare:Oe,event:null,face:null,frame:null,frameBorder:null,hSpace:he,leftMargin:he,link:null,longDesc:null,lowSrc:null,marginHeight:he,marginWidth:he,noResize:Oe,noHref:Oe,noShade:Oe,noWrap:Oe,object:null,profile:null,prompt:null,rev:null,rightMargin:he,rules:null,scheme:null,scrolling:Ot,standby:null,summary:null,text:null,topMargin:he,valueType:null,version:null,vAlign:null,vLink:null,vSpace:he,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Oe,disableRemotePlayback:Oe,prefix:null,property:null,results:he,security:null,unselectable:null},space:"html",transform:jy}),mj=Hl({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:An,accentHeight:he,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:he,amplitude:he,arabicForm:null,ascent:he,attributeName:null,attributeType:null,azimuth:he,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:he,by:null,calcMode:null,capHeight:he,className:yt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:he,diffuseConstant:he,direction:null,display:null,dur:null,divisor:he,dominantBaseline:null,download:Oe,dx:null,dy:null,edgeMode:null,editable:null,elevation:he,enableBackground:null,end:null,event:null,exponent:he,externalResourcesRequired:null,fill:null,fillOpacity:he,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:Ul,g2:Ul,glyphName:Ul,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:he,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:he,horizOriginX:he,horizOriginY:he,id:null,ideographic:he,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:he,k:he,k1:he,k2:he,k3:he,k4:he,kernelMatrix:An,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:he,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:he,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:he,overlineThickness:he,paintOrder:null,panose1:null,path:null,pathLength:he,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:yt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:he,pointsAtY:he,pointsAtZ:he,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:An,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:An,rev:An,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:An,requiredFeatures:An,requiredFonts:An,requiredFormats:An,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:he,specularExponent:he,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:he,strikethroughThickness:he,string:null,stroke:null,strokeDashArray:An,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:he,strokeOpacity:he,strokeWidth:null,style:null,surfaceScale:he,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:An,tabIndex:he,tableValues:null,target:null,targetX:he,targetY:he,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:An,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:he,underlineThickness:he,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:he,values:null,vAlphabetic:he,vMathematical:he,vectorEffect:null,vHanging:he,vIdeographic:he,version:null,vertAdvY:he,vertOriginX:he,vertOriginY:he,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:he,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Cy}),Ey=Hl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),Ny=Hl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:jy}),Ty=Hl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),pj={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"},gj=/[A-Z]/g,Ay=/-[a-z]/g,yj=/^data[-\w.:]+$/i;function bj(e,n){const r=Nd(n);let l=n,o=gn;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&yj.test(n)){if(n.charAt(4)==="-"){const u=n.slice(5).replace(Ay,vj);l="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=n.slice(4);if(!Ay.test(u)){let c=u.replace(gj,xj);c.charAt(0)!=="-"&&(c="-"+c),n="data"+c}}o=Rd}return new o(l,n)}function xj(e){return"-"+e.toLowerCase()}function vj(e){return e.charAt(1).toUpperCase()}const _j=wy([Sy,hj,Ey,Ny,Ty],"html"),Dd=wy([Sy,mj,Ey,Ny,Ty],"svg");function wj(e){return e.join(" ").trim()}var ql={},Ld,My;function kj(){if(My)return Ld;My=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
`,m="/",y="*",g="",_="comment",v="declaration";function w(T,C){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];C=C||{};var E=1,N=1;function D(G){var ne=G.match(n);ne&&(E+=ne.length);var V=G.lastIndexOf(h);N=~V?G.length-V:N+G.length}function F(){var G={line:E,column:N};return function(ne){return ne.position=new M(G),I(),ne}}function M(G){this.start=G,this.end={line:E,column:N},this.source=C.source}M.prototype.content=T;function A(G){var ne=new Error(C.source+":"+E+":"+N+": "+G);if(ne.reason=G,ne.filename=C.source,ne.line=E,ne.column=N,ne.source=T,!C.silent)throw ne}function U(G){var ne=G.exec(T);if(ne){var V=ne[0];return D(V),T=T.slice(V.length),ne}}function I(){U(r)}function L(G){var ne;for(G=G||[];ne=B();)ne!==!1&&G.push(ne);return G}function B(){var G=F();if(!(m!=T.charAt(0)||y!=T.charAt(1))){for(var ne=2;g!=T.charAt(ne)&&(y!=T.charAt(ne)||m!=T.charAt(ne+1));)++ne;if(ne+=2,g===T.charAt(ne-1))return A("End of comment missing");var V=T.slice(2,ne-2);return N+=2,D(V),T=T.slice(ne),N+=2,G({type:_,comment:V})}}function q(){var G=F(),ne=U(l);if(ne){if(B(),!U(o))return A("property missing ':'");var V=U(u),le=G({type:v,property:j(ne[0].replace(e,g)),value:V?j(V[0].replace(e,g)):g});return U(c),le}}function K(){var G=[];L(G);for(var ne;ne=q();)ne!==!1&&(G.push(ne),L(G));return G}return I(),K()}function j(T){return T?T.replace(f,g):g}return Ld=w,Ld}var Ry;function Sj(){if(Ry)return ql;Ry=1;var e=ql&&ql.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(ql,"__esModule",{value:!0}),ql.default=r;const n=e(kj());function r(l,o){let u=null;if(!l||typeof l!="string")return u;const c=(0,n.default)(l),f=typeof o=="function";return c.forEach(h=>{if(h.type!=="declaration")return;const{property:m,value:y}=h;f?o(m,y,h):y&&(u=u||{},u[m]=y)}),u}return ql}var Qi={},Dy;function Cj(){if(Dy)return Qi;Dy=1,Object.defineProperty(Qi,"__esModule",{value:!0}),Qi.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,l=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,u=function(m){return!m||r.test(m)||e.test(m)},c=function(m,y){return y.toUpperCase()},f=function(m,y){return"".concat(y,"-")},h=function(m,y){return y===void 0&&(y={}),u(m)?m:(m=m.toLowerCase(),y.reactCompat?m=m.replace(o,f):m=m.replace(l,f),m.replace(n,c))};return Qi.camelCase=h,Qi}var Wi,Ly;function jj(){if(Ly)return Wi;Ly=1;var e=Wi&&Wi.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},n=e(Sj()),r=Cj();function l(o,u){var c={};return!o||typeof o!="string"||(0,n.default)(o,function(f,h){f&&h&&(c[(0,r.camelCase)(f,u)]=h)}),c}return l.default=l,Wi=l,Wi}var Ej=jj();const Nj=gt(Ej),zy=Oy("end"),zd=Oy("start");function Oy(e){return n;function n(r){const l=r&&r.position&&r.position[e]||{};if(typeof l.line=="number"&&l.line>0&&typeof l.column=="number"&&l.column>0)return{line:l.line,column:l.column,offset:typeof l.offset=="number"&&l.offset>-1?l.offset:void 0}}}function Tj(e){const n=zd(e),r=zy(e);if(n&&r)return{start:n,end:r}}function Xi(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?By(e.position):"start"in e||"end"in e?By(e):"line"in e||"column"in e?Od(e):""}function Od(e){return Fy(e&&e.line)+":"+Fy(e&&e.column)}function By(e){return Od(e&&e.start)+"-"+Od(e&&e.end)}function Fy(e){return e&&typeof e=="number"?e:1}class rn extends Error{constructor(n,r,l){super(),typeof r=="string"&&(l=r,r=void 0);let o="",u={},c=!1;if(r&&("line"in r&&"column"in r?u={place:r}:"start"in r&&"end"in r?u={place:r}:"type"in r?u={ancestors:[r],place:r.position}:u={...r}),typeof n=="string"?o=n:!u.cause&&n&&(c=!0,o=n.message,u.cause=n),!u.ruleId&&!u.source&&typeof l=="string"){const h=l.indexOf(":");h===-1?u.ruleId=l:(u.source=l.slice(0,h),u.ruleId=l.slice(h+1))}if(!u.place&&u.ancestors&&u.ancestors){const h=u.ancestors[u.ancestors.length-1];h&&(u.place=h.position)}const f=u.place&&"start"in u.place?u.place.start:u.place;this.ancestors=u.ancestors||void 0,this.cause=u.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=f?f.line:void 0,this.name=Xi(u.place)||"1:1",this.place=u.place||void 0,this.reason=this.message,this.ruleId=u.ruleId||void 0,this.source=u.source||void 0,this.stack=c&&u.cause&&typeof u.cause.stack=="string"?u.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}rn.prototype.file="",rn.prototype.name="",rn.prototype.reason="",rn.prototype.message="",rn.prototype.stack="",rn.prototype.column=void 0,rn.prototype.line=void 0,rn.prototype.ancestors=void 0,rn.prototype.cause=void 0,rn.prototype.fatal=void 0,rn.prototype.place=void 0,rn.prototype.ruleId=void 0,rn.prototype.source=void 0;const Bd={}.hasOwnProperty,Aj=new Map,Mj=/[A-Z]/g,Rj=new Set(["table","tbody","thead","tfoot","tr"]),Dj=new Set(["td","th"]),Iy="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Lj(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=n.filePath||void 0;let l;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");l=qj(r,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");l=Hj(r,n.jsx,n.jsxs)}const o={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:l,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Dd:_j,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},u=Uy(o,e,void 0);return u&&typeof u!="string"?u:o.create(e,o.Fragment,{children:u||void 0},void 0)}function Uy(e,n,r){if(n.type==="element")return zj(e,n,r);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Oj(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Fj(e,n,r);if(n.type==="mdxjsEsm")return Bj(e,n);if(n.type==="root")return Ij(e,n,r);if(n.type==="text")return Uj(e,n)}function zj(e,n,r){const l=e.schema;let o=l;n.tagName.toLowerCase()==="svg"&&l.space==="html"&&(o=Dd,e.schema=o),e.ancestors.push(n);const u=qy(e,n.tagName,!1),c=Pj(e,n);let f=Id(e,n);return Rj.has(n.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!dj(h):!0})),Hy(e,c,u,n),Fd(c,f),e.ancestors.pop(),e.schema=l,e.create(n,u,c,r)}function Oj(e,n){if(n.data&&n.data.estree&&e.evaluater){const l=n.data.estree.body[0];return l.type,e.evaluater.evaluateExpression(l.expression)}Ji(e,n.position)}function Bj(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);Ji(e,n.position)}function Fj(e,n,r){const l=e.schema;let o=l;n.name==="svg"&&l.space==="html"&&(o=Dd,e.schema=o),e.ancestors.push(n);const u=n.name===null?e.Fragment:qy(e,n.name,!0),c=$j(e,n),f=Id(e,n);return Hy(e,c,u,n),Fd(c,f),e.ancestors.pop(),e.schema=l,e.create(n,u,c,r)}function Ij(e,n,r){const l={};return Fd(l,Id(e,n)),e.create(n,e.Fragment,l,r)}function Uj(e,n){return n.value}function Hy(e,n,r,l){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(n.node=l)}function Fd(e,n){if(n.length>0){const r=n.length>1?n:n[0];r&&(e.children=r)}}function Hj(e,n,r){return l;function l(o,u,c,f){const m=Array.isArray(c.children)?r:n;return f?m(u,c,f):m(u,c)}}function qj(e,n){return r;function r(l,o,u,c){const f=Array.isArray(u.children),h=zd(l);return n(o,u,c,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function Pj(e,n){const r={};let l,o;for(o in n.properties)if(o!=="children"&&Bd.call(n.properties,o)){const u=Yj(e,o,n.properties[o]);if(u){const[c,f]=u;e.tableCellAlignToStyle&&c==="align"&&typeof f=="string"&&Dj.has(n.tagName)?l=f:r[c]=f}}if(l){const u=r.style||(r.style={});u[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=l}return r}function $j(e,n){const r={};for(const l of n.attributes)if(l.type==="mdxJsxExpressionAttribute")if(l.data&&l.data.estree&&e.evaluater){const u=l.data.estree.body[0];u.type;const c=u.expression;c.type;const f=c.properties[0];f.type,Object.assign(r,e.evaluater.evaluateExpression(f.argument))}else Ji(e,n.position);else{const o=l.name;let u;if(l.value&&typeof l.value=="object")if(l.value.data&&l.value.data.estree&&e.evaluater){const f=l.value.data.estree.body[0];f.type,u=e.evaluater.evaluateExpression(f.expression)}else Ji(e,n.position);else u=l.value===null?!0:l.value;r[o]=u}return r}function Id(e,n){const r=[];let l=-1;const o=e.passKeys?new Map:Aj;for(;++l<n.children.length;){const u=n.children[l];let c;if(e.passKeys){const h=u.type==="element"?u.tagName:u.type==="mdxJsxFlowElement"||u.type==="mdxJsxTextElement"?u.name:void 0;if(h){const m=o.get(h)||0;c=h+"-"+m,o.set(h,m+1)}}const f=Uy(e,u,c);f!==void 0&&r.push(f)}return r}function Yj(e,n,r){const l=bj(e.schema,n);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=l.commaSeparated?ij(r):wj(r)),l.property==="style"){let o=typeof r=="object"?r:Gj(e,String(r));return e.stylePropertyNameCase==="css"&&(o=Kj(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&l.space?pj[l.property]||l.property:l.attribute,r]}}function Gj(e,n){try{return Nj(n,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const l=r,o=new rn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:l,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=Iy+"#cannot-parse-style-attribute",o}}function qy(e,n,r){let l;if(!r)l={type:"Literal",value:n};else if(n.includes(".")){const o=n.split(".");let u=-1,c;for(;++u<o.length;){const f=vy(o[u])?{type:"Identifier",name:o[u]}:{type:"Literal",value:o[u]};c=c?{type:"MemberExpression",object:c,property:f,computed:!!(u&&f.type==="Literal"),optional:!1}:f}l=c}else l=vy(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(l.type==="Literal"){const o=l.value;return Bd.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(l);Ji(e)}function Ji(e,n){const r=new rn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=Iy+"#cannot-handle-mdx-estrees-without-createevaluater",r}function Kj(e){const n={};let r;for(r in e)Bd.call(e,r)&&(n[Vj(r)]=e[r]);return n}function Vj(e){let n=e.replace(Mj,Qj);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function Qj(e){return"-"+e.toLowerCase()}const Ud={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"]},Wj={};function Hd(e,n){const r=Wj,l=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,o=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return Py(e,l,o)}function Py(e,n,r){if(Xj(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return $y(e.children,n,r)}return Array.isArray(e)?$y(e,n,r):""}function $y(e,n,r){const l=[];let o=-1;for(;++o<e.length;)l[o]=Py(e[o],n,r);return l.join("")}function Xj(e){return!!(e&&typeof e=="object")}const Yy=document.createElement("i");function qd(e){const n="&"+e+";";Yy.innerHTML=n;const r=Yy.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===n?!1:r}function Mn(e,n,r,l){const o=e.length;let u=0,c;if(n<0?n=-n>o?0:o+n:n=n>o?o:n,r=r>0?r:0,l.length<1e4)c=Array.from(l),c.unshift(n,r),e.splice(...c);else for(r&&e.splice(n,r);u<l.length;)c=l.slice(u,u+1e4),c.unshift(n,0),e.splice(...c),u+=1e4,n+=1e4}function Gn(e,n){return e.length>0?(Mn(e,e.length,0,n),e):n}const Gy={}.hasOwnProperty;function Ky(e){const n={};let r=-1;for(;++r<e.length;)Jj(n,e[r]);return n}function Jj(e,n){let r;for(r in n){const o=(Gy.call(e,r)?e[r]:void 0)||(e[r]={}),u=n[r];let c;if(u)for(c in u){Gy.call(o,c)||(o[c]=[]);const f=u[c];Zj(o[c],Array.isArray(f)?f:f?[f]:[])}}}function Zj(e,n){let r=-1;const l=[];for(;++r<n.length;)(n[r].add==="after"?e:l).push(n[r]);Mn(e,0,0,l)}function Vy(e,n){const r=Number.parseInt(e,n);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 pa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const dn=gr(/[A-Za-z]/),ln=gr(/[\dA-Za-z]/),e3=gr(/[#-'*+\--9=?A-Z^-~]/);function Us(e){return e!==null&&(e<32||e===127)}const Pd=gr(/\d/),t3=gr(/[\dA-Fa-f]/),n3=gr(/[!-/:-@[-`{-~]/);function Ne(e){return e!==null&&e<-2}function ft(e){return e!==null&&(e<0||e===32)}function Ue(e){return e===-2||e===-1||e===32}const Hs=gr(new RegExp("\\p{P}|\\p{S}","u")),Zr=gr(/\s/);function gr(e){return n;function n(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function Pl(e){const n=[];let r=-1,l=0,o=0;for(;++r<e.length;){const u=e.charCodeAt(r);let c="";if(u===37&&ln(e.charCodeAt(r+1))&&ln(e.charCodeAt(r+2)))o=2;else if(u<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(u))||(c=String.fromCharCode(u));else if(u>55295&&u<57344){const f=e.charCodeAt(r+1);u<56320&&f>56319&&f<57344?(c=String.fromCharCode(u,f),o=1):c="�"}else c=String.fromCharCode(u);c&&(n.push(e.slice(l,r),encodeURIComponent(c)),l=r+o+1,c=""),o&&(r+=o,o=0)}return n.join("")+e.slice(l)}function Je(e,n,r,l){const o=l?l-1:Number.POSITIVE_INFINITY;let u=0;return c;function c(h){return Ue(h)?(e.enter(r),f(h)):n(h)}function f(h){return Ue(h)&&u++<o?(e.consume(h),f):(e.exit(r),n(h))}}const a3={tokenize:r3};function r3(e){const n=e.attempt(this.parser.constructs.contentInitial,l,o);let r;return n;function l(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Je(e,n,"linePrefix")}function o(f){return e.enter("paragraph"),u(f)}function u(f){const h=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=h),r=h,c(f)}function c(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Ne(f)?(e.consume(f),e.exit("chunkText"),u):(e.consume(f),c)}}const l3={tokenize:i3},Qy={tokenize:o3};function i3(e){const n=this,r=[];let l=0,o,u,c;return f;function f(N){if(l<r.length){const D=r[l];return n.containerState=D[1],e.attempt(D[0].continuation,h,m)(N)}return m(N)}function h(N){if(l++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,o&&E();const D=n.events.length;let F=D,M;for(;F--;)if(n.events[F][0]==="exit"&&n.events[F][1].type==="chunkFlow"){M=n.events[F][1].end;break}C(l);let A=D;for(;A<n.events.length;)n.events[A][1].end={...M},A++;return Mn(n.events,F+1,0,n.events.slice(D)),n.events.length=A,m(N)}return f(N)}function m(N){if(l===r.length){if(!o)return _(N);if(o.currentConstruct&&o.currentConstruct.concrete)return w(N);n.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(Qy,y,g)(N)}function y(N){return o&&E(),C(l),_(N)}function g(N){return n.parser.lazy[n.now().line]=l!==r.length,c=n.now().offset,w(N)}function _(N){return n.containerState={},e.attempt(Qy,v,w)(N)}function v(N){return l++,r.push([n.currentConstruct,n.containerState]),_(N)}function w(N){if(N===null){o&&E(),C(0),e.consume(N);return}return o=o||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:u}),j(N)}function j(N){if(N===null){T(e.exit("chunkFlow"),!0),C(0),e.consume(N);return}return Ne(N)?(e.consume(N),T(e.exit("chunkFlow")),l=0,n.interrupt=void 0,f):(e.consume(N),j)}function T(N,D){const F=n.sliceStream(N);if(D&&F.push(null),N.previous=u,u&&(u.next=N),u=N,o.defineSkip(N.start),o.write(F),n.parser.lazy[N.start.line]){let M=o.events.length;for(;M--;)if(o.events[M][1].start.offset<c&&(!o.events[M][1].end||o.events[M][1].end.offset>c))return;const A=n.events.length;let U=A,I,L;for(;U--;)if(n.events[U][0]==="exit"&&n.events[U][1].type==="chunkFlow"){if(I){L=n.events[U][1].end;break}I=!0}for(C(l),M=A;M<n.events.length;)n.events[M][1].end={...L},M++;Mn(n.events,U+1,0,n.events.slice(A)),n.events.length=M}}function C(N){let D=r.length;for(;D-- >N;){const F=r[D];n.containerState=F[1],F[0].exit.call(n,e)}r.length=N}function E(){o.write([null]),u=void 0,o=void 0,n.containerState._closeFlow=void 0}}function o3(e,n,r){return Je(e,e.attempt(this.parser.constructs.document,n,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function $l(e){if(e===null||ft(e)||Zr(e))return 1;if(Hs(e))return 2}function qs(e,n,r){const l=[];let o=-1;for(;++o<e.length;){const u=e[o].resolveAll;u&&!l.includes(u)&&(n=u(n,r),l.push(u))}return n}const $d={name:"attention",resolveAll:s3,tokenize:c3};function s3(e,n){let r=-1,l,o,u,c,f,h,m,y;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(l=r;l--;)if(e[l][0]==="exit"&&e[l][1].type==="attentionSequence"&&e[l][1]._open&&n.sliceSerialize(e[l][1]).charCodeAt(0)===n.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[l][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[l][1].end.offset-e[l][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;h=e[l][1].end.offset-e[l][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const g={...e[l][1].end},_={...e[r][1].start};Wy(g,-h),Wy(_,h),c={type:h>1?"strongSequence":"emphasisSequence",start:g,end:{...e[l][1].end}},f={type:h>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:_},u={type:h>1?"strongText":"emphasisText",start:{...e[l][1].end},end:{...e[r][1].start}},o={type:h>1?"strong":"emphasis",start:{...c.start},end:{...f.end}},e[l][1].end={...c.start},e[r][1].start={...f.end},m=[],e[l][1].end.offset-e[l][1].start.offset&&(m=Gn(m,[["enter",e[l][1],n],["exit",e[l][1],n]])),m=Gn(m,[["enter",o,n],["enter",c,n],["exit",c,n],["enter",u,n]]),m=Gn(m,qs(n.parser.constructs.insideSpan.null,e.slice(l+1,r),n)),m=Gn(m,[["exit",u,n],["enter",f,n],["exit",f,n],["exit",o,n]]),e[r][1].end.offset-e[r][1].start.offset?(y=2,m=Gn(m,[["enter",e[r][1],n],["exit",e[r][1],n]])):y=0,Mn(e,l-1,r-l+3,m),r=l+m.length-y-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function c3(e,n){const r=this.parser.constructs.attentionMarkers.null,l=this.previous,o=$l(l);let u;return c;function c(h){return u=h,e.enter("attentionSequence"),f(h)}function f(h){if(h===u)return e.consume(h),f;const m=e.exit("attentionSequence"),y=$l(h),g=!y||y===2&&o||r.includes(h),_=!o||o===2&&y||r.includes(l);return m._open=!!(u===42?g:g&&(o||!_)),m._close=!!(u===42?_:_&&(y||!g)),n(h)}}function Wy(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const u3={name:"autolink",tokenize:d3};function d3(e,n,r){let l=0;return o;function o(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),u}function u(v){return dn(v)?(e.consume(v),c):v===64?r(v):m(v)}function c(v){return v===43||v===45||v===46||ln(v)?(l=1,f(v)):m(v)}function f(v){return v===58?(e.consume(v),l=0,h):(v===43||v===45||v===46||ln(v))&&l++<32?(e.consume(v),f):(l=0,m(v))}function h(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),n):v===null||v===32||v===60||Us(v)?r(v):(e.consume(v),h)}function m(v){return v===64?(e.consume(v),y):e3(v)?(e.consume(v),m):r(v)}function y(v){return ln(v)?g(v):r(v)}function g(v){return v===46?(e.consume(v),l=0,y):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),n):_(v)}function _(v){if((v===45||ln(v))&&l++<63){const w=v===45?_:g;return e.consume(v),w}return r(v)}}const Zi={partial:!0,tokenize:f3};function f3(e,n,r){return l;function l(u){return Ue(u)?Je(e,o,"linePrefix")(u):o(u)}function o(u){return u===null||Ne(u)?n(u):r(u)}}const Xy={continuation:{tokenize:m3},exit:p3,name:"blockQuote",tokenize:h3};function h3(e,n,r){const l=this;return o;function o(c){if(c===62){const f=l.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),u}return r(c)}function u(c){return Ue(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(c))}}function m3(e,n,r){const l=this;return o;function o(c){return Ue(c)?Je(e,u,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):u(c)}function u(c){return e.attempt(Xy,n,r)(c)}}function p3(e){e.exit("blockQuote")}const Jy={name:"characterEscape",tokenize:g3};function g3(e,n,r){return l;function l(u){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(u),e.exit("escapeMarker"),o}function o(u){return n3(u)?(e.enter("characterEscapeValue"),e.consume(u),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):r(u)}}const Zy={name:"characterReference",tokenize:y3};function y3(e,n,r){const l=this;let o=0,u,c;return f;function f(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),h}function h(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),u=31,c=ln,y(g))}function m(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),u=6,c=t3,y):(e.enter("characterReferenceValue"),u=7,c=Pd,y(g))}function y(g){if(g===59&&o){const _=e.exit("characterReferenceValue");return c===ln&&!qd(l.sliceSerialize(_))?r(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return c(g)&&o++<u?(e.consume(g),y):r(g)}}const eb={partial:!0,tokenize:x3},tb={concrete:!0,name:"codeFenced",tokenize:b3};function b3(e,n,r){const l=this,o={partial:!0,tokenize:F};let u=0,c=0,f;return h;function h(M){return m(M)}function m(M){const A=l.events[l.events.length-1];return u=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,f=M,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(M)}function y(M){return M===f?(c++,e.consume(M),y):c<3?r(M):(e.exit("codeFencedFenceSequence"),Ue(M)?Je(e,g,"whitespace")(M):g(M))}function g(M){return M===null||Ne(M)?(e.exit("codeFencedFence"),l.interrupt?n(M):e.check(eb,j,D)(M)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),_(M))}function _(M){return M===null||Ne(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(M)):Ue(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Je(e,v,"whitespace")(M)):M===96&&M===f?r(M):(e.consume(M),_)}function v(M){return M===null||Ne(M)?g(M):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(M))}function w(M){return M===null||Ne(M)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(M)):M===96&&M===f?r(M):(e.consume(M),w)}function j(M){return e.attempt(o,D,T)(M)}function T(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),C}function C(M){return u>0&&Ue(M)?Je(e,E,"linePrefix",u+1)(M):E(M)}function E(M){return M===null||Ne(M)?e.check(eb,j,D)(M):(e.enter("codeFlowValue"),N(M))}function N(M){return M===null||Ne(M)?(e.exit("codeFlowValue"),E(M)):(e.consume(M),N)}function D(M){return e.exit("codeFenced"),n(M)}function F(M,A,U){let I=0;return L;function L(ne){return M.enter("lineEnding"),M.consume(ne),M.exit("lineEnding"),B}function B(ne){return M.enter("codeFencedFence"),Ue(ne)?Je(M,q,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ne):q(ne)}function q(ne){return ne===f?(M.enter("codeFencedFenceSequence"),K(ne)):U(ne)}function K(ne){return ne===f?(I++,M.consume(ne),K):I>=c?(M.exit("codeFencedFenceSequence"),Ue(ne)?Je(M,G,"whitespace")(ne):G(ne)):U(ne)}function G(ne){return ne===null||Ne(ne)?(M.exit("codeFencedFence"),A(ne)):U(ne)}}}function x3(e,n,r){const l=this;return o;function o(c){return c===null?r(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u)}function u(c){return l.parser.lazy[l.now().line]?r(c):n(c)}}const Yd={name:"codeIndented",tokenize:_3},v3={partial:!0,tokenize:w3};function _3(e,n,r){const l=this;return o;function o(m){return e.enter("codeIndented"),Je(e,u,"linePrefix",5)(m)}function u(m){const y=l.events[l.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?c(m):r(m)}function c(m){return m===null?h(m):Ne(m)?e.attempt(v3,c,h)(m):(e.enter("codeFlowValue"),f(m))}function f(m){return m===null||Ne(m)?(e.exit("codeFlowValue"),c(m)):(e.consume(m),f)}function h(m){return e.exit("codeIndented"),n(m)}}function w3(e,n,r){const l=this;return o;function o(c){return l.parser.lazy[l.now().line]?r(c):Ne(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o):Je(e,u,"linePrefix",5)(c)}function u(c){const f=l.events[l.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?n(c):Ne(c)?o(c):r(c)}}const k3={name:"codeText",previous:C3,resolve:S3,tokenize:j3};function S3(e){let n=e.length-4,r=3,l,o;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(l=r;++l<n;)if(e[l][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[n][1].type="codeTextPadding",r+=2,n-=2;break}}for(l=r-1,n++;++l<=n;)o===void 0?l!==n&&e[l][1].type!=="lineEnding"&&(o=l):(l===n||e[l][1].type==="lineEnding")&&(e[o][1].type="codeTextData",l!==o+2&&(e[o][1].end=e[l-1][1].end,e.splice(o+2,l-o-2),n-=l-o-2,l=o+2),o=void 0);return e}function C3(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function j3(e,n,r){let l=0,o,u;return c;function c(g){return e.enter("codeText"),e.enter("codeTextSequence"),f(g)}function f(g){return g===96?(e.consume(g),l++,f):(e.exit("codeTextSequence"),h(g))}function h(g){return g===null?r(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),h):g===96?(u=e.enter("codeTextSequence"),o=0,y(g)):Ne(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),h):(e.enter("codeTextData"),m(g))}function m(g){return g===null||g===32||g===96||Ne(g)?(e.exit("codeTextData"),h(g)):(e.consume(g),m)}function y(g){return g===96?(e.consume(g),o++,y):o===l?(e.exit("codeTextSequence"),e.exit("codeText"),n(g)):(u.type="codeTextData",m(g))}}class E3{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,r){const l=r==null?Number.POSITIVE_INFINITY:r;return l<this.left.length?this.left.slice(n,l):n>this.left.length?this.right.slice(this.right.length-l+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-l+this.left.length).reverse())}splice(n,r,l){const o=r||0;this.setCursor(Math.trunc(n));const u=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return l&&eo(this.left,l),u.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),eo(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),eo(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const r=this.left.splice(n,Number.POSITIVE_INFINITY);eo(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);eo(this.left,r.reverse())}}}function eo(e,n){let r=0;if(n.length<1e4)e.push(...n);else for(;r<n.length;)e.push(...n.slice(r,r+1e4)),r+=1e4}function nb(e){const n={};let r=-1,l,o,u,c,f,h,m;const y=new E3(e);for(;++r<y.length;){for(;r in n;)r=n[r];if(l=y.get(r),r&&l[1].type==="chunkFlow"&&y.get(r-1)[1].type==="listItemPrefix"&&(h=l[1]._tokenizer.events,u=0,u<h.length&&h[u][1].type==="lineEndingBlank"&&(u+=2),u<h.length&&h[u][1].type==="content"))for(;++u<h.length&&h[u][1].type!=="content";)h[u][1].type==="chunkText"&&(h[u][1]._isInFirstContentOfListItem=!0,u++);if(l[0]==="enter")l[1].contentType&&(Object.assign(n,N3(y,r)),r=n[r],m=!0);else if(l[1]._container){for(u=r,o=void 0;u--;)if(c=y.get(u),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(o&&(y.get(o)[1].type="lineEndingBlank"),c[1].type="lineEnding",o=u);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;o&&(l[1].end={...y.get(o)[1].start},f=y.slice(o,r),f.unshift(l),y.splice(o,r-o+1,f))}}return Mn(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!m}function N3(e,n){const r=e.get(n)[1],l=e.get(n)[2];let o=n-1;const u=[];let c=r._tokenizer;c||(c=l.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const f=c.events,h=[],m={};let y,g,_=-1,v=r,w=0,j=0;const T=[j];for(;v;){for(;e.get(++o)[1]!==v;);u.push(o),v._tokenizer||(y=l.sliceStream(v),v.next||y.push(null),g&&c.defineSkip(v.start),v._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(y),v._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),g=v,v=v.next}for(v=r;++_<f.length;)f[_][0]==="exit"&&f[_-1][0]==="enter"&&f[_][1].type===f[_-1][1].type&&f[_][1].start.line!==f[_][1].end.line&&(j=_+1,T.push(j),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(c.events=[],v?(v._tokenizer=void 0,v.previous=void 0):T.pop(),_=T.length;_--;){const C=f.slice(T[_],T[_+1]),E=u.pop();h.push([E,E+C.length-1]),e.splice(E,2,C)}for(h.reverse(),_=-1;++_<h.length;)m[w+h[_][0]]=w+h[_][1],w+=h[_][1]-h[_][0]-1;return m}const T3={resolve:M3,tokenize:R3},A3={partial:!0,tokenize:D3};function M3(e){return nb(e),e}function R3(e,n){let r;return l;function l(f){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),o(f)}function o(f){return f===null?u(f):Ne(f)?e.check(A3,c,u)(f):(e.consume(f),o)}function u(f){return e.exit("chunkContent"),e.exit("content"),n(f)}function c(f){return e.consume(f),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,o}}function D3(e,n,r){const l=this;return o;function o(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Je(e,u,"linePrefix")}function u(c){if(c===null||Ne(c))return r(c);const f=l.events[l.events.length-1];return!l.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?n(c):e.interrupt(l.parser.constructs.flow,r,n)(c)}}function ab(e,n,r,l,o,u,c,f,h){const m=h||Number.POSITIVE_INFINITY;let y=0;return g;function g(C){return C===60?(e.enter(l),e.enter(o),e.enter(u),e.consume(C),e.exit(u),_):C===null||C===32||C===41||Us(C)?r(C):(e.enter(l),e.enter(c),e.enter(f),e.enter("chunkString",{contentType:"string"}),j(C))}function _(C){return C===62?(e.enter(u),e.consume(C),e.exit(u),e.exit(o),e.exit(l),n):(e.enter(f),e.enter("chunkString",{contentType:"string"}),v(C))}function v(C){return C===62?(e.exit("chunkString"),e.exit(f),_(C)):C===null||C===60||Ne(C)?r(C):(e.consume(C),C===92?w:v)}function w(C){return C===60||C===62||C===92?(e.consume(C),v):v(C)}function j(C){return!y&&(C===null||C===41||ft(C))?(e.exit("chunkString"),e.exit(f),e.exit(c),e.exit(l),n(C)):y<m&&C===40?(e.consume(C),y++,j):C===41?(e.consume(C),y--,j):C===null||C===32||C===40||Us(C)?r(C):(e.consume(C),C===92?T:j)}function T(C){return C===40||C===41||C===92?(e.consume(C),j):j(C)}}function rb(e,n,r,l,o,u){const c=this;let f=0,h;return m;function m(v){return e.enter(l),e.enter(o),e.consume(v),e.exit(o),e.enter(u),y}function y(v){return f>999||v===null||v===91||v===93&&!h||v===94&&!f&&"_hiddenFootnoteSupport"in c.parser.constructs?r(v):v===93?(e.exit(u),e.enter(o),e.consume(v),e.exit(o),e.exit(l),n):Ne(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===null||v===91||v===93||Ne(v)||f++>999?(e.exit("chunkString"),y(v)):(e.consume(v),h||(h=!Ue(v)),v===92?_:g)}function _(v){return v===91||v===92||v===93?(e.consume(v),f++,g):g(v)}}function lb(e,n,r,l,o,u){let c;return f;function f(_){return _===34||_===39||_===40?(e.enter(l),e.enter(o),e.consume(_),e.exit(o),c=_===40?41:_,h):r(_)}function h(_){return _===c?(e.enter(o),e.consume(_),e.exit(o),e.exit(l),n):(e.enter(u),m(_))}function m(_){return _===c?(e.exit(u),h(c)):_===null?r(_):Ne(_)?(e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),Je(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(_))}function y(_){return _===c||_===null||Ne(_)?(e.exit("chunkString"),m(_)):(e.consume(_),_===92?g:y)}function g(_){return _===c||_===92?(e.consume(_),y):y(_)}}function to(e,n){let r;return l;function l(o){return Ne(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r=!0,l):Ue(o)?Je(e,l,r?"linePrefix":"lineSuffix")(o):n(o)}}const L3={name:"definition",tokenize:O3},z3={partial:!0,tokenize:B3};function O3(e,n,r){const l=this;let o;return u;function u(v){return e.enter("definition"),c(v)}function c(v){return rb.call(l,e,f,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function f(v){return o=pa(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),h):r(v)}function h(v){return ft(v)?to(e,m)(v):m(v)}function m(v){return ab(e,y,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function y(v){return e.attempt(z3,g,g)(v)}function g(v){return Ue(v)?Je(e,_,"whitespace")(v):_(v)}function _(v){return v===null||Ne(v)?(e.exit("definition"),l.parser.defined.push(o),n(v)):r(v)}}function B3(e,n,r){return l;function l(f){return ft(f)?to(e,o)(f):r(f)}function o(f){return lb(e,u,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function u(f){return Ue(f)?Je(e,c,"whitespace")(f):c(f)}function c(f){return f===null||Ne(f)?n(f):r(f)}}const F3={name:"hardBreakEscape",tokenize:I3};function I3(e,n,r){return l;function l(u){return e.enter("hardBreakEscape"),e.consume(u),o}function o(u){return Ne(u)?(e.exit("hardBreakEscape"),n(u)):r(u)}}const U3={name:"headingAtx",resolve:H3,tokenize:q3};function H3(e,n){let r=e.length-2,l=3,o,u;return e[l][1].type==="whitespace"&&(l+=2),r-2>l&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(l===r-1||r-4>l&&e[r-2][1].type==="whitespace")&&(r-=l+1===r?2:4),r>l&&(o={type:"atxHeadingText",start:e[l][1].start,end:e[r][1].end},u={type:"chunkText",start:e[l][1].start,end:e[r][1].end,contentType:"text"},Mn(e,l,r-l+1,[["enter",o,n],["enter",u,n],["exit",u,n],["exit",o,n]])),e}function q3(e,n,r){let l=0;return o;function o(y){return e.enter("atxHeading"),u(y)}function u(y){return e.enter("atxHeadingSequence"),c(y)}function c(y){return y===35&&l++<6?(e.consume(y),c):y===null||ft(y)?(e.exit("atxHeadingSequence"),f(y)):r(y)}function f(y){return y===35?(e.enter("atxHeadingSequence"),h(y)):y===null||Ne(y)?(e.exit("atxHeading"),n(y)):Ue(y)?Je(e,f,"whitespace")(y):(e.enter("atxHeadingText"),m(y))}function h(y){return y===35?(e.consume(y),h):(e.exit("atxHeadingSequence"),f(y))}function m(y){return y===null||y===35||ft(y)?(e.exit("atxHeadingText"),f(y)):(e.consume(y),m)}}const P3=["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"],ib=["pre","script","style","textarea"],$3={concrete:!0,name:"htmlFlow",resolveTo:K3,tokenize:V3},Y3={partial:!0,tokenize:W3},G3={partial:!0,tokenize:Q3};function K3(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function V3(e,n,r){const l=this;let o,u,c,f,h;return m;function m(z){return y(z)}function y(z){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(z),g}function g(z){return z===33?(e.consume(z),_):z===47?(e.consume(z),u=!0,j):z===63?(e.consume(z),o=3,l.interrupt?n:O):dn(z)?(e.consume(z),c=String.fromCharCode(z),T):r(z)}function _(z){return z===45?(e.consume(z),o=2,v):z===91?(e.consume(z),o=5,f=0,w):dn(z)?(e.consume(z),o=4,l.interrupt?n:O):r(z)}function v(z){return z===45?(e.consume(z),l.interrupt?n:O):r(z)}function w(z){const oe="CDATA[";return z===oe.charCodeAt(f++)?(e.consume(z),f===oe.length?l.interrupt?n:q:w):r(z)}function j(z){return dn(z)?(e.consume(z),c=String.fromCharCode(z),T):r(z)}function T(z){if(z===null||z===47||z===62||ft(z)){const oe=z===47,ue=c.toLowerCase();return!oe&&!u&&ib.includes(ue)?(o=1,l.interrupt?n(z):q(z)):P3.includes(c.toLowerCase())?(o=6,oe?(e.consume(z),C):l.interrupt?n(z):q(z)):(o=7,l.interrupt&&!l.parser.lazy[l.now().line]?r(z):u?E(z):N(z))}return z===45||ln(z)?(e.consume(z),c+=String.fromCharCode(z),T):r(z)}function C(z){return z===62?(e.consume(z),l.interrupt?n:q):r(z)}function E(z){return Ue(z)?(e.consume(z),E):L(z)}function N(z){return z===47?(e.consume(z),L):z===58||z===95||dn(z)?(e.consume(z),D):Ue(z)?(e.consume(z),N):L(z)}function D(z){return z===45||z===46||z===58||z===95||ln(z)?(e.consume(z),D):F(z)}function F(z){return z===61?(e.consume(z),M):Ue(z)?(e.consume(z),F):N(z)}function M(z){return z===null||z===60||z===61||z===62||z===96?r(z):z===34||z===39?(e.consume(z),h=z,A):Ue(z)?(e.consume(z),M):U(z)}function A(z){return z===h?(e.consume(z),h=null,I):z===null||Ne(z)?r(z):(e.consume(z),A)}function U(z){return z===null||z===34||z===39||z===47||z===60||z===61||z===62||z===96||ft(z)?F(z):(e.consume(z),U)}function I(z){return z===47||z===62||Ue(z)?N(z):r(z)}function L(z){return z===62?(e.consume(z),B):r(z)}function B(z){return z===null||Ne(z)?q(z):Ue(z)?(e.consume(z),B):r(z)}function q(z){return z===45&&o===2?(e.consume(z),V):z===60&&o===1?(e.consume(z),le):z===62&&o===4?(e.consume(z),H):z===63&&o===3?(e.consume(z),O):z===93&&o===5?(e.consume(z),ce):Ne(z)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(Y3,Z,K)(z)):z===null||Ne(z)?(e.exit("htmlFlowData"),K(z)):(e.consume(z),q)}function K(z){return e.check(G3,G,Z)(z)}function G(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),ne}function ne(z){return z===null||Ne(z)?K(z):(e.enter("htmlFlowData"),q(z))}function V(z){return z===45?(e.consume(z),O):q(z)}function le(z){return z===47?(e.consume(z),c="",me):q(z)}function me(z){if(z===62){const oe=c.toLowerCase();return ib.includes(oe)?(e.consume(z),H):q(z)}return dn(z)&&c.length<8?(e.consume(z),c+=String.fromCharCode(z),me):q(z)}function ce(z){return z===93?(e.consume(z),O):q(z)}function O(z){return z===62?(e.consume(z),H):z===45&&o===2?(e.consume(z),O):q(z)}function H(z){return z===null||Ne(z)?(e.exit("htmlFlowData"),Z(z)):(e.consume(z),H)}function Z(z){return e.exit("htmlFlow"),n(z)}}function Q3(e,n,r){const l=this;return o;function o(c){return Ne(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u):r(c)}function u(c){return l.parser.lazy[l.now().line]?r(c):n(c)}}function W3(e,n,r){return l;function l(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Zi,n,r)}}const X3={name:"htmlText",tokenize:J3};function J3(e,n,r){const l=this;let o,u,c;return f;function f(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),h}function h(O){return O===33?(e.consume(O),m):O===47?(e.consume(O),F):O===63?(e.consume(O),N):dn(O)?(e.consume(O),U):r(O)}function m(O){return O===45?(e.consume(O),y):O===91?(e.consume(O),u=0,w):dn(O)?(e.consume(O),E):r(O)}function y(O){return O===45?(e.consume(O),v):r(O)}function g(O){return O===null?r(O):O===45?(e.consume(O),_):Ne(O)?(c=g,le(O)):(e.consume(O),g)}function _(O){return O===45?(e.consume(O),v):g(O)}function v(O){return O===62?V(O):O===45?_(O):g(O)}function w(O){const H="CDATA[";return O===H.charCodeAt(u++)?(e.consume(O),u===H.length?j:w):r(O)}function j(O){return O===null?r(O):O===93?(e.consume(O),T):Ne(O)?(c=j,le(O)):(e.consume(O),j)}function T(O){return O===93?(e.consume(O),C):j(O)}function C(O){return O===62?V(O):O===93?(e.consume(O),C):j(O)}function E(O){return O===null||O===62?V(O):Ne(O)?(c=E,le(O)):(e.consume(O),E)}function N(O){return O===null?r(O):O===63?(e.consume(O),D):Ne(O)?(c=N,le(O)):(e.consume(O),N)}function D(O){return O===62?V(O):N(O)}function F(O){return dn(O)?(e.consume(O),M):r(O)}function M(O){return O===45||ln(O)?(e.consume(O),M):A(O)}function A(O){return Ne(O)?(c=A,le(O)):Ue(O)?(e.consume(O),A):V(O)}function U(O){return O===45||ln(O)?(e.consume(O),U):O===47||O===62||ft(O)?I(O):r(O)}function I(O){return O===47?(e.consume(O),V):O===58||O===95||dn(O)?(e.consume(O),L):Ne(O)?(c=I,le(O)):Ue(O)?(e.consume(O),I):V(O)}function L(O){return O===45||O===46||O===58||O===95||ln(O)?(e.consume(O),L):B(O)}function B(O){return O===61?(e.consume(O),q):Ne(O)?(c=B,le(O)):Ue(O)?(e.consume(O),B):I(O)}function q(O){return O===null||O===60||O===61||O===62||O===96?r(O):O===34||O===39?(e.consume(O),o=O,K):Ne(O)?(c=q,le(O)):Ue(O)?(e.consume(O),q):(e.consume(O),G)}function K(O){return O===o?(e.consume(O),o=void 0,ne):O===null?r(O):Ne(O)?(c=K,le(O)):(e.consume(O),K)}function G(O){return O===null||O===34||O===39||O===60||O===61||O===96?r(O):O===47||O===62||ft(O)?I(O):(e.consume(O),G)}function ne(O){return O===47||O===62||ft(O)?I(O):r(O)}function V(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),n):r(O)}function le(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),me}function me(O){return Ue(O)?Je(e,ce,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):ce(O)}function ce(O){return e.enter("htmlTextData"),c(O)}}const Gd={name:"labelEnd",resolveAll:nE,resolveTo:aE,tokenize:rE},Z3={tokenize:lE},eE={tokenize:iE},tE={tokenize:oE};function nE(e){let n=-1;const r=[];for(;++n<e.length;){const l=e[n][1];if(r.push(e[n]),l.type==="labelImage"||l.type==="labelLink"||l.type==="labelEnd"){const o=l.type==="labelImage"?4:2;l.type="data",n+=o}}return e.length!==r.length&&Mn(e,0,e.length,r),e}function aE(e,n){let r=e.length,l=0,o,u,c,f;for(;r--;)if(o=e[r][1],u){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[r][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(c){if(e[r][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(u=r,o.type!=="labelLink")){l=2;break}}else o.type==="labelEnd"&&(c=r);const h={type:e[u][1].type==="labelLink"?"link":"image",start:{...e[u][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[u][1].start},end:{...e[c][1].end}},y={type:"labelText",start:{...e[u+l+2][1].end},end:{...e[c-2][1].start}};return f=[["enter",h,n],["enter",m,n]],f=Gn(f,e.slice(u+1,u+l+3)),f=Gn(f,[["enter",y,n]]),f=Gn(f,qs(n.parser.constructs.insideSpan.null,e.slice(u+l+4,c-3),n)),f=Gn(f,[["exit",y,n],e[c-2],e[c-1],["exit",m,n]]),f=Gn(f,e.slice(c+1)),f=Gn(f,[["exit",h,n]]),Mn(e,u,e.length,f),e}function rE(e,n,r){const l=this;let o=l.events.length,u,c;for(;o--;)if((l.events[o][1].type==="labelImage"||l.events[o][1].type==="labelLink")&&!l.events[o][1]._balanced){u=l.events[o][1];break}return f;function f(_){return u?u._inactive?g(_):(c=l.parser.defined.includes(pa(l.sliceSerialize({start:u.end,end:l.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(_),e.exit("labelMarker"),e.exit("labelEnd"),h):r(_)}function h(_){return _===40?e.attempt(Z3,y,c?y:g)(_):_===91?e.attempt(eE,y,c?m:g)(_):c?y(_):g(_)}function m(_){return e.attempt(tE,y,g)(_)}function y(_){return n(_)}function g(_){return u._balanced=!0,r(_)}}function lE(e,n,r){return l;function l(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),o}function o(g){return ft(g)?to(e,u)(g):u(g)}function u(g){return g===41?y(g):ab(e,c,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function c(g){return ft(g)?to(e,h)(g):y(g)}function f(g){return r(g)}function h(g){return g===34||g===39||g===40?lb(e,m,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function m(g){return ft(g)?to(e,y)(g):y(g)}function y(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),n):r(g)}}function iE(e,n,r){const l=this;return o;function o(f){return rb.call(l,e,u,c,"reference","referenceMarker","referenceString")(f)}function u(f){return l.parser.defined.includes(pa(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)))?n(f):r(f)}function c(f){return r(f)}}function oE(e,n,r){return l;function l(u){return e.enter("reference"),e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),o}function o(u){return u===93?(e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),e.exit("reference"),n):r(u)}}const sE={name:"labelStartImage",resolveAll:Gd.resolveAll,tokenize:cE};function cE(e,n,r){const l=this;return o;function o(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),u}function u(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),c):r(f)}function c(f){return f===94&&"_hiddenFootnoteSupport"in l.parser.constructs?r(f):n(f)}}const uE={name:"labelStartLink",resolveAll:Gd.resolveAll,tokenize:dE};function dE(e,n,r){const l=this;return o;function o(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),u}function u(c){return c===94&&"_hiddenFootnoteSupport"in l.parser.constructs?r(c):n(c)}}const Kd={name:"lineEnding",tokenize:fE};function fE(e,n){return r;function r(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Je(e,n,"linePrefix")}}const Ps={name:"thematicBreak",tokenize:hE};function hE(e,n,r){let l=0,o;return u;function u(m){return e.enter("thematicBreak"),c(m)}function c(m){return o=m,f(m)}function f(m){return m===o?(e.enter("thematicBreakSequence"),h(m)):l>=3&&(m===null||Ne(m))?(e.exit("thematicBreak"),n(m)):r(m)}function h(m){return m===o?(e.consume(m),l++,h):(e.exit("thematicBreakSequence"),Ue(m)?Je(e,f,"whitespace")(m):f(m))}}const yn={continuation:{tokenize:yE},exit:xE,name:"list",tokenize:gE},mE={partial:!0,tokenize:vE},pE={partial:!0,tokenize:bE};function gE(e,n,r){const l=this,o=l.events[l.events.length-1];let u=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,c=0;return f;function f(v){const w=l.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!l.containerState.marker||v===l.containerState.marker:Pd(v)){if(l.containerState.type||(l.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Ps,r,m)(v):m(v);if(!l.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(v)}return r(v)}function h(v){return Pd(v)&&++c<10?(e.consume(v),h):(!l.interrupt||c<2)&&(l.containerState.marker?v===l.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),m(v)):r(v)}function m(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),l.containerState.marker=l.containerState.marker||v,e.check(Zi,l.interrupt?r:y,e.attempt(mE,_,g))}function y(v){return l.containerState.initialBlankLine=!0,u++,_(v)}function g(v){return Ue(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),_):r(v)}function _(v){return l.containerState.size=u+l.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(v)}}function yE(e,n,r){const l=this;return l.containerState._closeFlow=void 0,e.check(Zi,o,u);function o(f){return l.containerState.furtherBlankLines=l.containerState.furtherBlankLines||l.containerState.initialBlankLine,Je(e,n,"listItemIndent",l.containerState.size+1)(f)}function u(f){return l.containerState.furtherBlankLines||!Ue(f)?(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,c(f)):(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,e.attempt(pE,n,c)(f))}function c(f){return l.containerState._closeFlow=!0,l.interrupt=void 0,Je(e,e.attempt(yn,n,r),"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function bE(e,n,r){const l=this;return Je(e,o,"listItemIndent",l.containerState.size+1);function o(u){const c=l.events[l.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===l.containerState.size?n(u):r(u)}}function xE(e){e.exit(this.containerState.type)}function vE(e,n,r){const l=this;return Je(e,o,"listItemPrefixWhitespace",l.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(u){const c=l.events[l.events.length-1];return!Ue(u)&&c&&c[1].type==="listItemPrefixWhitespace"?n(u):r(u)}}const ob={name:"setextUnderline",resolveTo:_E,tokenize:wE};function _E(e,n){let r=e.length,l,o,u;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){l=r;break}e[r][1].type==="paragraph"&&(o=r)}else e[r][1].type==="content"&&e.splice(r,1),!u&&e[r][1].type==="definition"&&(u=r);const c={type:"setextHeading",start:{...e[l][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",u?(e.splice(o,0,["enter",c,n]),e.splice(u+1,0,["exit",e[l][1],n]),e[l][1].end={...e[u][1].end}):e[l][1]=c,e.push(["exit",c,n]),e}function wE(e,n,r){const l=this;let o;return u;function u(m){let y=l.events.length,g;for(;y--;)if(l.events[y][1].type!=="lineEnding"&&l.events[y][1].type!=="linePrefix"&&l.events[y][1].type!=="content"){g=l.events[y][1].type==="paragraph";break}return!l.parser.lazy[l.now().line]&&(l.interrupt||g)?(e.enter("setextHeadingLine"),o=m,c(m)):r(m)}function c(m){return e.enter("setextHeadingLineSequence"),f(m)}function f(m){return m===o?(e.consume(m),f):(e.exit("setextHeadingLineSequence"),Ue(m)?Je(e,h,"lineSuffix")(m):h(m))}function h(m){return m===null||Ne(m)?(e.exit("setextHeadingLine"),n(m)):r(m)}}const kE={tokenize:SE};function SE(e){const n=this,r=e.attempt(Zi,l,e.attempt(this.parser.constructs.flowInitial,o,Je(e,e.attempt(this.parser.constructs.flow,o,e.attempt(T3,o)),"linePrefix")));return r;function l(u){if(u===null){e.consume(u);return}return e.enter("lineEndingBlank"),e.consume(u),e.exit("lineEndingBlank"),n.currentConstruct=void 0,r}function o(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),n.currentConstruct=void 0,r}}const CE={resolveAll:cb()},jE=sb("string"),EE=sb("text");function sb(e){return{resolveAll:cb(e==="text"?NE:void 0),tokenize:n};function n(r){const l=this,o=this.parser.constructs[e],u=r.attempt(o,c,f);return c;function c(y){return m(y)?u(y):f(y)}function f(y){if(y===null){r.consume(y);return}return r.enter("data"),r.consume(y),h}function h(y){return m(y)?(r.exit("data"),u(y)):(r.consume(y),h)}function m(y){if(y===null)return!0;const g=o[y];let _=-1;if(g)for(;++_<g.length;){const v=g[_];if(!v.previous||v.previous.call(l,l.previous))return!0}return!1}}}function cb(e){return n;function n(r,l){let o=-1,u;for(;++o<=r.length;)u===void 0?r[o]&&r[o][1].type==="data"&&(u=o,o++):(!r[o]||r[o][1].type!=="data")&&(o!==u+2&&(r[u][1].end=r[o-1][1].end,r.splice(u+2,o-u-2),o=u+2),u=void 0);return e?e(r,l):r}}function NE(e,n){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const l=e[r-1][1],o=n.sliceStream(l);let u=o.length,c=-1,f=0,h;for(;u--;){const m=o[u];if(typeof m=="string"){for(c=m.length;m.charCodeAt(c-1)===32;)f++,c--;if(c)break;c=-1}else if(m===-2)h=!0,f++;else if(m!==-1){u++;break}}if(n._contentTypeTextTrailing&&r===e.length&&(f=0),f){const m={type:r===e.length||h||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:u?c:l.start._bufferIndex+c,_index:l.start._index+u,line:l.end.line,column:l.end.column-f,offset:l.end.offset-f},end:{...l.end}};l.end={...m.start},l.start.offset===l.end.offset?Object.assign(l,m):(e.splice(r,0,["enter",m,n],["exit",m,n]),r+=2)}r++}return e}const TE=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:L3},disable:{null:[]},document:{42:yn,43:yn,45:yn,48:yn,49:yn,50:yn,51:yn,52:yn,53:yn,54:yn,55:yn,56:yn,57:yn,62:Xy},flow:{35:U3,42:Ps,45:[ob,Ps],60:$3,61:ob,95:Ps,96:tb,126:tb},flowInitial:{[-2]:Yd,[-1]:Yd,32:Yd},insideSpan:{null:[$d,CE]},string:{38:Zy,92:Jy},text:{[-5]:Kd,[-4]:Kd,[-3]:Kd,33:sE,38:Zy,42:$d,60:[u3,X3],91:uE,92:[F3,Jy],93:Gd,95:$d,96:k3}},Symbol.toStringTag,{value:"Module"}));function AE(e,n,r){let l={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const o={},u=[];let c=[],f=[];const h={attempt:A(F),check:A(M),consume:E,enter:N,exit:D,interrupt:A(M,{interrupt:!0})},m={code:null,containerState:{},defineSkip:j,events:[],now:w,parser:e,previous:null,sliceSerialize:_,sliceStream:v,write:g};let y=n.tokenize.call(m,h);return n.resolveAll&&u.push(n),m;function g(B){return c=Gn(c,B),T(),c[c.length-1]!==null?[]:(U(n,0),m.events=qs(u,m.events,m),m.events)}function _(B,q){return RE(v(B),q)}function v(B){return ME(c,B)}function w(){const{_bufferIndex:B,_index:q,line:K,column:G,offset:ne}=l;return{_bufferIndex:B,_index:q,line:K,column:G,offset:ne}}function j(B){o[B.line]=B.column,L()}function T(){let B;for(;l._index<c.length;){const q=c[l._index];if(typeof q=="string")for(B=l._index,l._bufferIndex<0&&(l._bufferIndex=0);l._index===B&&l._bufferIndex<q.length;)C(q.charCodeAt(l._bufferIndex));else C(q)}}function C(B){y=y(B)}function E(B){Ne(B)?(l.line++,l.column=1,l.offset+=B===-3?2:1,L()):B!==-1&&(l.column++,l.offset++),l._bufferIndex<0?l._index++:(l._bufferIndex++,l._bufferIndex===c[l._index].length&&(l._bufferIndex=-1,l._index++)),m.previous=B}function N(B,q){const K=q||{};return K.type=B,K.start=w(),m.events.push(["enter",K,m]),f.push(K),K}function D(B){const q=f.pop();return q.end=w(),m.events.push(["exit",q,m]),q}function F(B,q){U(B,q.from)}function M(B,q){q.restore()}function A(B,q){return K;function K(G,ne,V){let le,me,ce,O;return Array.isArray(G)?Z(G):"tokenize"in G?Z([G]):H(G);function H(ve){return Se;function Se(Te){const re=Te!==null&&ve[Te],ke=Te!==null&&ve.null,Ze=[...Array.isArray(re)?re:re?[re]:[],...Array.isArray(ke)?ke:ke?[ke]:[]];return Z(Ze)(Te)}}function Z(ve){return le=ve,me=0,ve.length===0?V:z(ve[me])}function z(ve){return Se;function Se(Te){return O=I(),ce=ve,ve.partial||(m.currentConstruct=ve),ve.name&&m.parser.constructs.disable.null.includes(ve.name)?ue():ve.tokenize.call(q?Object.assign(Object.create(m),q):m,h,oe,ue)(Te)}}function oe(ve){return B(ce,O),ne}function ue(ve){return O.restore(),++me<le.length?z(le[me]):V}}}function U(B,q){B.resolveAll&&!u.includes(B)&&u.push(B),B.resolve&&Mn(m.events,q,m.events.length-q,B.resolve(m.events.slice(q),m)),B.resolveTo&&(m.events=B.resolveTo(m.events,m))}function I(){const B=w(),q=m.previous,K=m.currentConstruct,G=m.events.length,ne=Array.from(f);return{from:G,restore:V};function V(){l=B,m.previous=q,m.currentConstruct=K,m.events.length=G,f=ne,L()}}function L(){l.line in o&&l.column<2&&(l.column=o[l.line],l.offset+=o[l.line]-1)}}function ME(e,n){const r=n.start._index,l=n.start._bufferIndex,o=n.end._index,u=n.end._bufferIndex;let c;if(r===o)c=[e[r].slice(l,u)];else{if(c=e.slice(r,o),l>-1){const f=c[0];typeof f=="string"?c[0]=f.slice(l):c.shift()}u>0&&c.push(e[o].slice(0,u))}return c}function RE(e,n){let r=-1;const l=[];let o;for(;++r<e.length;){const u=e[r];let c;if(typeof u=="string")c=u;else switch(u){case-5:{c="\r";break}case-4:{c=`
`;break}case-3:{c=`\r
`;break}case-2:{c=n?" ":"	";break}case-1:{if(!n&&o)continue;c=" ";break}default:c=String.fromCharCode(u)}o=u===-2,l.push(c)}return l.join("")}function DE(e){const l={constructs:Ky([TE,...(e||{}).extensions||[]]),content:o(a3),defined:[],document:o(l3),flow:o(kE),lazy:{},string:o(jE),text:o(EE)};return l;function o(u){return c;function c(f){return AE(l,u,f)}}}function LE(e){for(;!nb(e););return e}const ub=/[\0\t\n\r]/g;function zE(){let e=1,n="",r=!0,l;return o;function o(u,c,f){const h=[];let m,y,g,_,v;for(u=n+(typeof u=="string"?u.toString():new TextDecoder(c||void 0).decode(u)),g=0,n="",r&&(u.charCodeAt(0)===65279&&g++,r=void 0);g<u.length;){if(ub.lastIndex=g,m=ub.exec(u),_=m&&m.index!==void 0?m.index:u.length,v=u.charCodeAt(_),!m){n=u.slice(g);break}if(v===10&&g===_&&l)h.push(-3),l=void 0;else switch(l&&(h.push(-5),l=void 0),g<_&&(h.push(u.slice(g,_)),e+=_-g),v){case 0:{h.push(65533),e++;break}case 9:{for(y=Math.ceil(e/4)*4,h.push(-2);e++<y;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:l=!0,e=1}g=_+1}return f&&(l&&h.push(-5),n&&h.push(n),h.push(null)),h}}const OE=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function BE(e){return e.replace(OE,FE)}function FE(e,n,r){if(n)return n;if(r.charCodeAt(0)===35){const o=r.charCodeAt(1),u=o===120||o===88;return Vy(r.slice(u?2:1),u?16:10)}return qd(r)||e}const db={}.hasOwnProperty;function IE(e,n,r){return n&&typeof n=="object"&&(r=n,n=void 0),UE(r)(LE(DE(r).document().write(zE()(e,n,!0))))}function UE(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(Rt),autolinkProtocol:I,autolinkEmail:I,atxHeading:u(hn),blockQuote:u(ke),characterEscape:I,characterReference:I,codeFenced:u(Ze),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:u(Ze,c),codeText:u(Fe,c),codeTextData:I,data:I,codeFlowValue:I,definition:u(Mt),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:u(vt),hardBreakEscape:u(Yt),hardBreakTrailing:u(Yt),htmlFlow:u(Ma,c),htmlFlowData:I,htmlText:u(Ma,c),htmlTextData:I,image:u(Ln),label:c,link:u(Rt),listItem:u(Wn),listItemValue:_,listOrdered:u(bn,g),listUnordered:u(bn),paragraph:u(sn),reference:z,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:u(hn),strong:u(ya),thematicBreak:u(xn)},exit:{atxHeading:h(),atxHeadingSequence:F,autolink:h(),autolinkEmail:re,autolinkProtocol:Te,blockQuote:h(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:ue,characterReferenceMarkerNumeric:ue,characterReferenceValue:ve,characterReference:Se,codeFenced:h(T),codeFencedFence:j,codeFencedFenceInfo:v,codeFencedFenceMeta:w,codeFlowValue:L,codeIndented:h(C),codeText:h(ne),codeTextData:L,data:L,definition:h(),definitionDestinationString:D,definitionLabelString:E,definitionTitleString:N,emphasis:h(),hardBreakEscape:h(q),hardBreakTrailing:h(q),htmlFlow:h(K),htmlFlowData:L,htmlText:h(G),htmlTextData:L,image:h(le),label:ce,labelText:me,lineEnding:B,link:h(V),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:oe,resourceDestinationString:O,resourceTitleString:H,resource:Z,setextHeading:h(U),setextHeadingLineSequence:A,setextHeadingText:M,strong:h(),thematicBreak:h()}};fb(n,(e||{}).mdastExtensions||[]);const r={};return l;function l(te){let pe={type:"root",children:[]};const je={stack:[pe],tokenStack:[],config:n,enter:f,exit:m,buffer:c,resume:y,data:r},Re=[];let de=-1;for(;++de<te.length;)if(te[de][1].type==="listOrdered"||te[de][1].type==="listUnordered")if(te[de][0]==="enter")Re.push(de);else{const Ve=Re.pop();de=o(te,Ve,de)}for(de=-1;++de<te.length;){const Ve=n[te[de][0]];db.call(Ve,te[de][1].type)&&Ve[te[de][1].type].call(Object.assign({sliceSerialize:te[de][2].sliceSerialize},je),te[de][1])}if(je.tokenStack.length>0){const Ve=je.tokenStack[je.tokenStack.length-1];(Ve[1]||hb).call(je,void 0,Ve[0])}for(pe.position={start:yr(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:yr(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},de=-1;++de<n.transforms.length;)pe=n.transforms[de](pe)||pe;return pe}function o(te,pe,je){let Re=pe-1,de=-1,Ve=!1,lt,bt,it,St;for(;++Re<=je;){const Ie=te[Re];switch(Ie[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ie[0]==="enter"?de++:de--,St=void 0;break}case"lineEndingBlank":{Ie[0]==="enter"&&(lt&&!St&&!de&&!it&&(it=Re),St=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:St=void 0}if(!de&&Ie[0]==="enter"&&Ie[1].type==="listItemPrefix"||de===-1&&Ie[0]==="exit"&&(Ie[1].type==="listUnordered"||Ie[1].type==="listOrdered")){if(lt){let cn=Re;for(bt=void 0;cn--;){const Kt=te[cn];if(Kt[1].type==="lineEnding"||Kt[1].type==="lineEndingBlank"){if(Kt[0]==="exit")continue;bt&&(te[bt][1].type="lineEndingBlank",Ve=!0),Kt[1].type="lineEnding",bt=cn}else if(!(Kt[1].type==="linePrefix"||Kt[1].type==="blockQuotePrefix"||Kt[1].type==="blockQuotePrefixWhitespace"||Kt[1].type==="blockQuoteMarker"||Kt[1].type==="listItemIndent"))break}it&&(!bt||it<bt)&&(lt._spread=!0),lt.end=Object.assign({},bt?te[bt][1].start:Ie[1].end),te.splice(bt||Re,0,["exit",lt,Ie[2]]),Re++,je++}if(Ie[1].type==="listItemPrefix"){const cn={type:"listItem",_spread:!1,start:Object.assign({},Ie[1].start),end:void 0};lt=cn,te.splice(Re,0,["enter",cn,Ie[2]]),Re++,je++,it=void 0,St=!0}}}return te[pe][1]._spread=Ve,je}function u(te,pe){return je;function je(Re){f.call(this,te(Re),Re),pe&&pe.call(this,Re)}}function c(){this.stack.push({type:"fragment",children:[]})}function f(te,pe,je){this.stack[this.stack.length-1].children.push(te),this.stack.push(te),this.tokenStack.push([pe,je||void 0]),te.position={start:yr(pe.start),end:void 0}}function h(te){return pe;function pe(je){te&&te.call(this,je),m.call(this,je)}}function m(te,pe){const je=this.stack.pop(),Re=this.tokenStack.pop();if(Re)Re[0].type!==te.type&&(pe?pe.call(this,te,Re[0]):(Re[1]||hb).call(this,te,Re[0]));else throw new Error("Cannot close `"+te.type+"` ("+Xi({start:te.start,end:te.end})+"): it’s not open");je.position.end=yr(te.end)}function y(){return Hd(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function _(te){if(this.data.expectingFirstListItemValue){const pe=this.stack[this.stack.length-2];pe.start=Number.parseInt(this.sliceSerialize(te),10),this.data.expectingFirstListItemValue=void 0}}function v(){const te=this.resume(),pe=this.stack[this.stack.length-1];pe.lang=te}function w(){const te=this.resume(),pe=this.stack[this.stack.length-1];pe.meta=te}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function T(){const te=this.resume(),pe=this.stack[this.stack.length-1];pe.value=te.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const te=this.resume(),pe=this.stack[this.stack.length-1];pe.value=te.replace(/(\r?\n|\r)$/g,"")}function E(te){const pe=this.resume(),je=this.stack[this.stack.length-1];je.label=pe,je.identifier=pa(this.sliceSerialize(te)).toLowerCase()}function N(){const te=this.resume(),pe=this.stack[this.stack.length-1];pe.title=te}function D(){const te=this.resume(),pe=this.stack[this.stack.length-1];pe.url=te}function F(te){const pe=this.stack[this.stack.length-1];if(!pe.depth){const je=this.sliceSerialize(te).length;pe.depth=je}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function A(te){const pe=this.stack[this.stack.length-1];pe.depth=this.sliceSerialize(te).codePointAt(0)===61?1:2}function U(){this.data.setextHeadingSlurpLineEnding=void 0}function I(te){const je=this.stack[this.stack.length-1].children;let Re=je[je.length-1];(!Re||Re.type!=="text")&&(Re=tt(),Re.position={start:yr(te.start),end:void 0},je.push(Re)),this.stack.push(Re)}function L(te){const pe=this.stack.pop();pe.value+=this.sliceSerialize(te),pe.position.end=yr(te.end)}function B(te){const pe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const je=pe.children[pe.children.length-1];je.position.end=yr(te.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(pe.type)&&(I.call(this,te),L.call(this,te))}function q(){this.data.atHardBreak=!0}function K(){const te=this.resume(),pe=this.stack[this.stack.length-1];pe.value=te}function G(){const te=this.resume(),pe=this.stack[this.stack.length-1];pe.value=te}function ne(){const te=this.resume(),pe=this.stack[this.stack.length-1];pe.value=te}function V(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=pe,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function le(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=pe,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function me(te){const pe=this.sliceSerialize(te),je=this.stack[this.stack.length-2];je.label=BE(pe),je.identifier=pa(pe).toLowerCase()}function ce(){const te=this.stack[this.stack.length-1],pe=this.resume(),je=this.stack[this.stack.length-1];if(this.data.inReference=!0,je.type==="link"){const Re=te.children;je.children=Re}else je.alt=pe}function O(){const te=this.resume(),pe=this.stack[this.stack.length-1];pe.url=te}function H(){const te=this.resume(),pe=this.stack[this.stack.length-1];pe.title=te}function Z(){this.data.inReference=void 0}function z(){this.data.referenceType="collapsed"}function oe(te){const pe=this.resume(),je=this.stack[this.stack.length-1];je.label=pe,je.identifier=pa(this.sliceSerialize(te)).toLowerCase(),this.data.referenceType="full"}function ue(te){this.data.characterReferenceType=te.type}function ve(te){const pe=this.sliceSerialize(te),je=this.data.characterReferenceType;let Re;je?(Re=Vy(pe,je==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Re=qd(pe);const de=this.stack[this.stack.length-1];de.value+=Re}function Se(te){const pe=this.stack.pop();pe.position.end=yr(te.end)}function Te(te){L.call(this,te);const pe=this.stack[this.stack.length-1];pe.url=this.sliceSerialize(te)}function re(te){L.call(this,te);const pe=this.stack[this.stack.length-1];pe.url="mailto:"+this.sliceSerialize(te)}function ke(){return{type:"blockquote",children:[]}}function Ze(){return{type:"code",lang:null,meta:null,value:""}}function Fe(){return{type:"inlineCode",value:""}}function Mt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function vt(){return{type:"emphasis",children:[]}}function hn(){return{type:"heading",depth:0,children:[]}}function Yt(){return{type:"break"}}function Ma(){return{type:"html",value:""}}function Ln(){return{type:"image",title:null,url:"",alt:null}}function Rt(){return{type:"link",title:null,url:"",children:[]}}function bn(te){return{type:"list",ordered:te.type==="listOrdered",start:null,spread:te._spread,children:[]}}function Wn(te){return{type:"listItem",spread:te._spread,checked:null,children:[]}}function sn(){return{type:"paragraph",children:[]}}function ya(){return{type:"strong",children:[]}}function tt(){return{type:"text",value:""}}function xn(){return{type:"thematicBreak"}}}function yr(e){return{line:e.line,column:e.column,offset:e.offset}}function fb(e,n){let r=-1;for(;++r<n.length;){const l=n[r];Array.isArray(l)?fb(e,l):HE(e,l)}}function HE(e,n){let r;for(r in n)if(db.call(n,r))switch(r){case"canContainEols":{const l=n[r];l&&e[r].push(...l);break}case"transforms":{const l=n[r];l&&e[r].push(...l);break}case"enter":case"exit":{const l=n[r];l&&Object.assign(e[r],l);break}}}function hb(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+Xi({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+Xi({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+Xi({start:n.start,end:n.end})+") is still open")}function qE(e){const n=this;n.parser=r;function r(l){return IE(l,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function PE(e,n){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,r),e.applyData(n,r)}function $E(e,n){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,r),[e.applyData(n,r),{type:"text",value:`
`}]}function YE(e,n){const r=n.value?n.value+`
`:"",l={},o=n.lang?n.lang.split(/\s+/):[];o.length>0&&(l.className=["language-"+o[0]]);let u={type:"element",tagName:"code",properties:l,children:[{type:"text",value:r}]};return n.meta&&(u.data={meta:n.meta}),e.patch(n,u),u=e.applyData(n,u),u={type:"element",tagName:"pre",properties:{},children:[u]},e.patch(n,u),u}function GE(e,n){const r={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function KE(e,n){const r={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function VE(e,n){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",l=String(n.identifier).toUpperCase(),o=Pl(l.toLowerCase()),u=e.footnoteOrder.indexOf(l);let c,f=e.footnoteCounts.get(l);f===void 0?(f=0,e.footnoteOrder.push(l),c=e.footnoteOrder.length):c=u+1,f+=1,e.footnoteCounts.set(l,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(c)}]};e.patch(n,h);const m={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(n,m),e.applyData(n,m)}function QE(e,n){const r={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function WE(e,n){if(e.options.allowDangerousHtml){const r={type:"raw",value:n.value};return e.patch(n,r),e.applyData(n,r)}}function mb(e,n){const r=n.referenceType;let l="]";if(r==="collapsed"?l+="[]":r==="full"&&(l+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+l}];const o=e.all(n),u=o[0];u&&u.type==="text"?u.value="["+u.value:o.unshift({type:"text",value:"["});const c=o[o.length-1];return c&&c.type==="text"?c.value+=l:o.push({type:"text",value:l}),o}function XE(e,n){const r=String(n.identifier).toUpperCase(),l=e.definitionById.get(r);if(!l)return mb(e,n);const o={src:Pl(l.url||""),alt:n.alt};l.title!==null&&l.title!==void 0&&(o.title=l.title);const u={type:"element",tagName:"img",properties:o,children:[]};return e.patch(n,u),e.applyData(n,u)}function JE(e,n){const r={src:Pl(n.url)};n.alt!==null&&n.alt!==void 0&&(r.alt=n.alt),n.title!==null&&n.title!==void 0&&(r.title=n.title);const l={type:"element",tagName:"img",properties:r,children:[]};return e.patch(n,l),e.applyData(n,l)}function ZE(e,n){const r={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,r);const l={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(n,l),e.applyData(n,l)}function e6(e,n){const r=String(n.identifier).toUpperCase(),l=e.definitionById.get(r);if(!l)return mb(e,n);const o={href:Pl(l.url||"")};l.title!==null&&l.title!==void 0&&(o.title=l.title);const u={type:"element",tagName:"a",properties:o,children:e.all(n)};return e.patch(n,u),e.applyData(n,u)}function t6(e,n){const r={href:Pl(n.url)};n.title!==null&&n.title!==void 0&&(r.title=n.title);const l={type:"element",tagName:"a",properties:r,children:e.all(n)};return e.patch(n,l),e.applyData(n,l)}function n6(e,n,r){const l=e.all(n),o=r?a6(r):pb(n),u={},c=[];if(typeof n.checked=="boolean"){const y=l[0];let g;y&&y.type==="element"&&y.tagName==="p"?g=y:(g={type:"element",tagName:"p",properties:{},children:[]},l.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),u.className=["task-list-item"]}let f=-1;for(;++f<l.length;){const y=l[f];(o||f!==0||y.type!=="element"||y.tagName!=="p")&&c.push({type:"text",value:`
`}),y.type==="element"&&y.tagName==="p"&&!o?c.push(...y.children):c.push(y)}const h=l[l.length-1];h&&(o||h.type!=="element"||h.tagName!=="p")&&c.push({type:"text",value:`
`});const m={type:"element",tagName:"li",properties:u,children:c};return e.patch(n,m),e.applyData(n,m)}function a6(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const r=e.children;let l=-1;for(;!n&&++l<r.length;)n=pb(r[l])}return n}function pb(e){const n=e.spread;return n==null?e.children.length>1:n}function r6(e,n){const r={},l=e.all(n);let o=-1;for(typeof n.start=="number"&&n.start!==1&&(r.start=n.start);++o<l.length;){const c=l[o];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const u={type:"element",tagName:n.ordered?"ol":"ul",properties:r,children:e.wrap(l,!0)};return e.patch(n,u),e.applyData(n,u)}function l6(e,n){const r={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function i6(e,n){const r={type:"root",children:e.wrap(e.all(n))};return e.patch(n,r),e.applyData(n,r)}function o6(e,n){const r={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function s6(e,n){const r=e.all(n),l=r.shift(),o=[];if(l){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([l],!0)};e.patch(n.children[0],c),o.push(c)}if(r.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},f=zd(n.children[1]),h=zy(n.children[n.children.length-1]);f&&h&&(c.position={start:f,end:h}),o.push(c)}const u={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(n,u),e.applyData(n,u)}function c6(e,n,r){const l=r?r.children:void 0,u=(l?l.indexOf(n):1)===0?"th":"td",c=r&&r.type==="table"?r.align:void 0,f=c?c.length:n.children.length;let h=-1;const m=[];for(;++h<f;){const g=n.children[h],_={},v=c?c[h]:void 0;v&&(_.align=v);let w={type:"element",tagName:u,properties:_,children:[]};g&&(w.children=e.all(g),e.patch(g,w),w=e.applyData(g,w)),m.push(w)}const y={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(n,y),e.applyData(n,y)}function u6(e,n){const r={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}const gb=9,yb=32;function d6(e){const n=String(e),r=/\r?\n|\r/g;let l=r.exec(n),o=0;const u=[];for(;l;)u.push(bb(n.slice(o,l.index),o>0,!0),l[0]),o=l.index+l[0].length,l=r.exec(n);return u.push(bb(n.slice(o),o>0,!1)),u.join("")}function bb(e,n,r){let l=0,o=e.length;if(n){let u=e.codePointAt(l);for(;u===gb||u===yb;)l++,u=e.codePointAt(l)}if(r){let u=e.codePointAt(o-1);for(;u===gb||u===yb;)o--,u=e.codePointAt(o-1)}return o>l?e.slice(l,o):""}function f6(e,n){const r={type:"text",value:d6(String(n.value))};return e.patch(n,r),e.applyData(n,r)}function h6(e,n){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,r),e.applyData(n,r)}const m6={blockquote:PE,break:$E,code:YE,delete:GE,emphasis:KE,footnoteReference:VE,heading:QE,html:WE,imageReference:XE,image:JE,inlineCode:ZE,linkReference:e6,link:t6,listItem:n6,list:r6,paragraph:l6,root:i6,strong:o6,table:s6,tableCell:u6,tableRow:c6,text:f6,thematicBreak:h6,toml:$s,yaml:$s,definition:$s,footnoteDefinition:$s};function $s(){}const xb=-1,Ys=0,no=1,Gs=2,Vd=3,Qd=4,Wd=5,Xd=6,vb=7,_b=8,wb=typeof self=="object"?self:globalThis,p6=(e,n)=>{const r=(o,u)=>(e.set(u,o),o),l=o=>{if(e.has(o))return e.get(o);const[u,c]=n[o];switch(u){case Ys:case xb:return r(c,o);case no:{const f=r([],o);for(const h of c)f.push(l(h));return f}case Gs:{const f=r({},o);for(const[h,m]of c)f[l(h)]=l(m);return f}case Vd:return r(new Date(c),o);case Qd:{const{source:f,flags:h}=c;return r(new RegExp(f,h),o)}case Wd:{const f=r(new Map,o);for(const[h,m]of c)f.set(l(h),l(m));return f}case Xd:{const f=r(new Set,o);for(const h of c)f.add(l(h));return f}case vb:{const{name:f,message:h}=c;return r(new wb[f](h),o)}case _b:return r(BigInt(c),o);case"BigInt":return r(Object(BigInt(c)),o);case"ArrayBuffer":return r(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:f}=new Uint8Array(c);return r(new DataView(f),c)}}return r(new wb[u](c),o)};return l},kb=e=>p6(new Map,e)(0),Yl="",{toString:g6}={},{keys:y6}=Object,ao=e=>{const n=typeof e;if(n!=="object"||!e)return[Ys,n];const r=g6.call(e).slice(8,-1);switch(r){case"Array":return[no,Yl];case"Object":return[Gs,Yl];case"Date":return[Vd,Yl];case"RegExp":return[Qd,Yl];case"Map":return[Wd,Yl];case"Set":return[Xd,Yl];case"DataView":return[no,r]}return r.includes("Array")?[no,r]:r.includes("Error")?[vb,r]:[Gs,r]},Ks=([e,n])=>e===Ys&&(n==="function"||n==="symbol"),b6=(e,n,r,l)=>{const o=(c,f)=>{const h=l.push(c)-1;return r.set(f,h),h},u=c=>{if(r.has(c))return r.get(c);let[f,h]=ao(c);switch(f){case Ys:{let y=c;switch(h){case"bigint":f=_b,y=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);y=null;break;case"undefined":return o([xb],c)}return o([f,y],c)}case no:{if(h){let _=c;return h==="DataView"?_=new Uint8Array(c.buffer):h==="ArrayBuffer"&&(_=new Uint8Array(c)),o([h,[..._]],c)}const y=[],g=o([f,y],c);for(const _ of c)y.push(u(_));return g}case Gs:{if(h)switch(h){case"BigInt":return o([h,c.toString()],c);case"Boolean":case"Number":case"String":return o([h,c.valueOf()],c)}if(n&&"toJSON"in c)return u(c.toJSON());const y=[],g=o([f,y],c);for(const _ of y6(c))(e||!Ks(ao(c[_])))&&y.push([u(_),u(c[_])]);return g}case Vd:return o([f,c.toISOString()],c);case Qd:{const{source:y,flags:g}=c;return o([f,{source:y,flags:g}],c)}case Wd:{const y=[],g=o([f,y],c);for(const[_,v]of c)(e||!(Ks(ao(_))||Ks(ao(v))))&&y.push([u(_),u(v)]);return g}case Xd:{const y=[],g=o([f,y],c);for(const _ of c)(e||!Ks(ao(_)))&&y.push(u(_));return g}}const{message:m}=c;return o([f,{name:h,message:m}],c)};return u},Sb=(e,{json:n,lossy:r}={})=>{const l=[];return b6(!(n||r),!!n,new Map,l)(e),l},Vs=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?kb(Sb(e,n)):structuredClone(e):(e,n)=>kb(Sb(e,n));function x6(e,n){const r=[{type:"text",value:"↩"}];return n>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),r}function v6(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function _6(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||x6,l=e.options.footnoteBackLabel||v6,o=e.options.footnoteLabel||"Footnotes",u=e.options.footnoteLabelTagName||"h2",c=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 y=e.all(m),g=String(m.identifier).toUpperCase(),_=Pl(g.toLowerCase());let v=0;const w=[],j=e.footnoteCounts.get(g);for(;j!==void 0&&++v<=j;){w.length>0&&w.push({type:"text",value:" "});let E=typeof r=="string"?r:r(h,v);typeof E=="string"&&(E={type:"text",value:E}),w.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+_+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof l=="string"?l:l(h,v),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const T=y[y.length-1];if(T&&T.type==="element"&&T.tagName==="p"){const E=T.children[T.children.length-1];E&&E.type==="text"?E.value+=" ":T.children.push({type:"text",value:" "}),T.children.push(...w)}else y.push(...w);const C={type:"element",tagName:"li",properties:{id:n+"fn-"+_},children:e.wrap(y,!0)};e.patch(m,C),f.push(C)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...Vs(c),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
`}]}}const Qs=(function(e){if(e==null)return C6;if(typeof e=="function")return Ws(e);if(typeof e=="object")return Array.isArray(e)?w6(e):k6(e);if(typeof e=="string")return S6(e);throw new Error("Expected function, string, or object as test")});function w6(e){const n=[];let r=-1;for(;++r<e.length;)n[r]=Qs(e[r]);return Ws(l);function l(...o){let u=-1;for(;++u<n.length;)if(n[u].apply(this,o))return!0;return!1}}function k6(e){const n=e;return Ws(r);function r(l){const o=l;let u;for(u in e)if(o[u]!==n[u])return!1;return!0}}function S6(e){return Ws(n);function n(r){return r&&r.type===e}}function Ws(e){return n;function n(r,l,o){return!!(j6(r)&&e.call(this,r,typeof l=="number"?l:void 0,o||void 0))}}function C6(){return!0}function j6(e){return e!==null&&typeof e=="object"&&"type"in e}function mO(e){return e}const Cb=[],E6=!0,Jd=!1,N6="skip";function jb(e,n,r,l){let o;typeof n=="function"&&typeof r!="function"?(l=r,r=n):o=n;const u=Qs(o),c=l?-1:1;f(e,void 0,[])();function f(h,m,y){const g=h&&typeof h=="object"?h:{};if(typeof g.type=="string"){const v=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(_,"name",{value:"node ("+(h.type+(v?"<"+v+">":""))+")"})}return _;function _(){let v=Cb,w,j,T;if((!n||u(h,m,y[y.length-1]||void 0))&&(v=T6(r(h,y)),v[0]===Jd))return v;if("children"in h&&h.children){const C=h;if(C.children&&v[0]!==N6)for(j=(l?C.children.length:-1)+c,T=y.concat(C);j>-1&&j<C.children.length;){const E=C.children[j];if(w=f(E,j,T)(),w[0]===Jd)return w;j=typeof w[1]=="number"?w[1]:j+c}}return v}}}function T6(e){return Array.isArray(e)?e:typeof e=="number"?[E6,e]:e==null?Cb:[e]}function Zd(e,n,r,l){let o,u,c;typeof n=="function"&&typeof r!="function"?(u=void 0,c=n,o=r):(u=n,c=r,o=l),jb(e,u,f,o);function f(h,m){const y=m[m.length-1],g=y?y.children.indexOf(h):void 0;return c(h,g,y)}}const ef={}.hasOwnProperty,A6={};function M6(e,n){const r=n||A6,l=new Map,o=new Map,u=new Map,c={...m6,...r.handlers},f={all:m,applyData:D6,definitionById:l,footnoteById:o,footnoteCounts:u,footnoteOrder:[],handlers:c,one:h,options:r,patch:R6,wrap:z6};return Zd(e,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const g=y.type==="definition"?l:o,_=String(y.identifier).toUpperCase();g.has(_)||g.set(_,y)}}),f;function h(y,g){const _=y.type,v=f.handlers[_];if(ef.call(f.handlers,_)&&v)return v(f,y,g);if(f.options.passThrough&&f.options.passThrough.includes(_)){if("children"in y){const{children:j,...T}=y,C=Vs(T);return C.children=f.all(y),C}return Vs(y)}return(f.options.unknownHandler||L6)(f,y,g)}function m(y){const g=[];if("children"in y){const _=y.children;let v=-1;for(;++v<_.length;){const w=f.one(_[v],y);if(w){if(v&&_[v-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=Eb(w.value)),!Array.isArray(w)&&w.type==="element")){const j=w.children[0];j&&j.type==="text"&&(j.value=Eb(j.value))}Array.isArray(w)?g.push(...w):g.push(w)}}}return g}}function R6(e,n){e.position&&(n.position=Tj(e))}function D6(e,n){let r=n;if(e&&e.data){const l=e.data.hName,o=e.data.hChildren,u=e.data.hProperties;if(typeof l=="string")if(r.type==="element")r.tagName=l;else{const c="children"in r?r.children:[r];r={type:"element",tagName:l,properties:{},children:c}}r.type==="element"&&u&&Object.assign(r.properties,Vs(u)),"children"in r&&r.children&&o!==null&&o!==void 0&&(r.children=o)}return r}function L6(e,n){const r=n.data||{},l="value"in n&&!(ef.call(r,"hProperties")||ef.call(r,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,l),e.applyData(n,l)}function z6(e,n){const r=[];let l=-1;for(n&&r.push({type:"text",value:`
`});++l<e.length;)l&&r.push({type:"text",value:`
`}),r.push(e[l]);return n&&e.length>0&&r.push({type:"text",value:`
`}),r}function Eb(e){let n=0,r=e.charCodeAt(n);for(;r===9||r===32;)n++,r=e.charCodeAt(n);return e.slice(n)}function Nb(e,n){const r=M6(e,n),l=r.one(e,void 0),o=_6(r),u=Array.isArray(l)?{type:"root",children:l}:l||{type:"root",children:[]};return o&&u.children.push({type:"text",value:`
`},o),u}function O6(e,n){return e&&"run"in e?async function(r,l){const o=Nb(r,{file:l,...n});await e.run(o,l)}:function(r,l){return Nb(r,{file:l,...e||n})}}function Tb(e){if(e)throw e}var tf,Ab;function B6(){if(Ab)return tf;Ab=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,l=Object.getOwnPropertyDescriptor,o=function(m){return typeof Array.isArray=="function"?Array.isArray(m):n.call(m)==="[object Array]"},u=function(m){if(!m||n.call(m)!=="[object Object]")return!1;var y=e.call(m,"constructor"),g=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!y&&!g)return!1;var _;for(_ in m);return typeof _>"u"||e.call(m,_)},c=function(m,y){r&&y.name==="__proto__"?r(m,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):m[y.name]=y.newValue},f=function(m,y){if(y==="__proto__")if(e.call(m,y)){if(l)return l(m,y).value}else return;return m[y]};return tf=function h(){var m,y,g,_,v,w,j=arguments[0],T=1,C=arguments.length,E=!1;for(typeof j=="boolean"&&(E=j,j=arguments[1]||{},T=2),(j==null||typeof j!="object"&&typeof j!="function")&&(j={});T<C;++T)if(m=arguments[T],m!=null)for(y in m)g=f(j,y),_=f(m,y),j!==_&&(E&&_&&(u(_)||(v=o(_)))?(v?(v=!1,w=g&&o(g)?g:[]):w=g&&u(g)?g:{},c(j,{name:y,newValue:h(E,w,_)})):typeof _<"u"&&c(j,{name:y,newValue:_}));return j},tf}var F6=B6();const nf=gt(F6);function af(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function I6(){const e=[],n={run:r,use:l};return n;function r(...o){let u=-1;const c=o.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);f(null,...o);function f(h,...m){const y=e[++u];let g=-1;if(h){c(h);return}for(;++g<o.length;)(m[g]===null||m[g]===void 0)&&(m[g]=o[g]);o=m,y?U6(y,f)(...m):c(null,...m)}}function l(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),n}}function U6(e,n){let r;return l;function l(...c){const f=e.length>c.length;let h;f&&c.push(o);try{h=e.apply(this,c)}catch(m){const y=m;if(f&&r)throw y;return o(y)}f||(h&&h.then&&typeof h.then=="function"?h.then(u,o):h instanceof Error?o(h):u(h))}function o(c,...f){r||(r=!0,n(c,...f))}function u(c){o(null,c)}}const Ca={basename:H6,dirname:q6,extname:P6,join:$6,sep:"/"};function H6(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');ro(e);let r=0,l=-1,o=e.length,u;if(n===void 0||n.length===0||n.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(u){r=o+1;break}}else l<0&&(u=!0,l=o+1);return l<0?"":e.slice(r,l)}if(n===e)return"";let c=-1,f=n.length-1;for(;o--;)if(e.codePointAt(o)===47){if(u){r=o+1;break}}else c<0&&(u=!0,c=o+1),f>-1&&(e.codePointAt(o)===n.codePointAt(f--)?f<0&&(l=o):(f=-1,l=c));return r===l?l=c:l<0&&(l=e.length),e.slice(r,l)}function q6(e){if(ro(e),e.length===0)return".";let n=-1,r=e.length,l;for(;--r;)if(e.codePointAt(r)===47){if(l){n=r;break}}else l||(l=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function P6(e){ro(e);let n=e.length,r=-1,l=0,o=-1,u=0,c;for(;n--;){const f=e.codePointAt(n);if(f===47){if(c){l=n+1;break}continue}r<0&&(c=!0,r=n+1),f===46?o<0?o=n:u!==1&&(u=1):o>-1&&(u=-1)}return o<0||r<0||u===0||u===1&&o===r-1&&o===l+1?"":e.slice(o,r)}function $6(...e){let n=-1,r;for(;++n<e.length;)ro(e[n]),e[n]&&(r=r===void 0?e[n]:r+"/"+e[n]);return r===void 0?".":Y6(r)}function Y6(e){ro(e);const n=e.codePointAt(0)===47;let r=G6(e,!n);return r.length===0&&!n&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),n?"/"+r:r}function G6(e,n){let r="",l=0,o=-1,u=0,c=-1,f,h;for(;++c<=e.length;){if(c<e.length)f=e.codePointAt(c);else{if(f===47)break;f=47}if(f===47){if(!(o===c-1||u===1))if(o!==c-1&&u===2){if(r.length<2||l!==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="",l=0):(r=r.slice(0,h),l=r.length-1-r.lastIndexOf("/")),o=c,u=0;continue}}else if(r.length>0){r="",l=0,o=c,u=0;continue}}n&&(r=r.length>0?r+"/..":"..",l=2)}else r.length>0?r+="/"+e.slice(o+1,c):r=e.slice(o+1,c),l=c-o-1;o=c,u=0}else f===46&&u>-1?u++:u=-1}return r}function ro(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const K6={cwd:V6};function V6(){return"/"}function rf(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Q6(e){if(typeof e=="string")e=new URL(e);else if(!rf(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return W6(e)}function W6(e){if(e.hostname!==""){const l=new TypeError('File URL host must be "localhost" or empty on darwin');throw l.code="ERR_INVALID_FILE_URL_HOST",l}const n=e.pathname;let r=-1;for(;++r<n.length;)if(n.codePointAt(r)===37&&n.codePointAt(r+1)===50){const l=n.codePointAt(r+2);if(l===70||l===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(n)}const lf=["history","path","basename","stem","extname","dirname"];class Mb{constructor(n){let r;n?rf(n)?r={path:n}:typeof n=="string"||X6(n)?r={value:n}:r=n:r={},this.cwd="cwd"in r?"":K6.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let l=-1;for(;++l<lf.length;){const u=lf[l];u in r&&r[u]!==void 0&&r[u]!==null&&(this[u]=u==="history"?[...r[u]]:r[u])}let o;for(o in r)lf.includes(o)||(this[o]=r[o])}get basename(){return typeof this.path=="string"?Ca.basename(this.path):void 0}set basename(n){sf(n,"basename"),of(n,"basename"),this.path=Ca.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?Ca.dirname(this.path):void 0}set dirname(n){Rb(this.basename,"dirname"),this.path=Ca.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?Ca.extname(this.path):void 0}set extname(n){if(of(n,"extname"),Rb(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ca.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){rf(n)&&(n=Q6(n)),sf(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?Ca.basename(this.path,this.extname):void 0}set stem(n){sf(n,"stem"),of(n,"stem"),this.path=Ca.join(this.dirname||"",n+(this.extname||""))}fail(n,r,l){const o=this.message(n,r,l);throw o.fatal=!0,o}info(n,r,l){const o=this.message(n,r,l);return o.fatal=void 0,o}message(n,r,l){const o=new rn(n,r,l);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function of(e,n){if(e&&e.includes(Ca.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+Ca.sep+"`")}function sf(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function Rb(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function X6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const J6=(function(e){const l=this.constructor.prototype,o=l[e],u=function(){return o.apply(u,arguments)};return Object.setPrototypeOf(u,l),u}),Z6={}.hasOwnProperty;class cf extends J6{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=I6()}copy(){const n=new cf;let r=-1;for(;++r<this.attachers.length;){const l=this.attachers[r];n.use(...l)}return n.data(nf(!0,{},this.namespace)),n}data(n,r){return typeof n=="string"?arguments.length===2?(ff("data",this.frozen),this.namespace[n]=r,this):Z6.call(this.namespace,n)&&this.namespace[n]||void 0:n?(ff("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...l]=this.attachers[this.freezeIndex];if(l[0]===!1)continue;l[0]===!0&&(l[0]=void 0);const o=r.call(n,...l);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const r=Xs(n),l=this.parser||this.Parser;return uf("parse",l),l(String(r),r)}process(n,r){const l=this;return this.freeze(),uf("process",this.parser||this.Parser),df("process",this.compiler||this.Compiler),r?o(void 0,r):new Promise(o);function o(u,c){const f=Xs(n),h=l.parse(f);l.run(h,f,function(y,g,_){if(y||!g||!_)return m(y);const v=g,w=l.stringify(v,_);n5(w)?_.value=w:_.result=w,m(y,_)});function m(y,g){y||!g?c(y):u?u(g):r(void 0,g)}}}processSync(n){let r=!1,l;return this.freeze(),uf("processSync",this.parser||this.Parser),df("processSync",this.compiler||this.Compiler),this.process(n,o),Lb("processSync","process",r),l;function o(u,c){r=!0,Tb(u),l=c}}run(n,r,l){Db(n),this.freeze();const o=this.transformers;return!l&&typeof r=="function"&&(l=r,r=void 0),l?u(void 0,l):new Promise(u);function u(c,f){const h=Xs(r);o.run(n,h,m);function m(y,g,_){const v=g||n;y?f(y):c?c(v):l(void 0,v,_)}}}runSync(n,r){let l=!1,o;return this.run(n,r,u),Lb("runSync","run",l),o;function u(c,f){Tb(c),o=f,l=!0}}stringify(n,r){this.freeze();const l=Xs(r),o=this.compiler||this.Compiler;return df("stringify",o),Db(n),o(n,l)}use(n,...r){const l=this.attachers,o=this.namespace;if(ff("use",this.frozen),n!=null)if(typeof n=="function")h(n,r);else if(typeof n=="object")Array.isArray(n)?f(n):c(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function u(m){if(typeof m=="function")h(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[y,...g]=m;h(y,g)}else c(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function c(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=nf(!0,o.settings,m.settings))}function f(m){let y=-1;if(m!=null)if(Array.isArray(m))for(;++y<m.length;){const g=m[y];u(g)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function h(m,y){let g=-1,_=-1;for(;++g<l.length;)if(l[g][0]===m){_=g;break}if(_===-1)l.push([m,...y]);else if(y.length>0){let[v,...w]=y;const j=l[_][1];af(j)&&af(v)&&(v=nf(!0,j,v)),l[_]=[m,v,...w]}}}}const e5=new cf().freeze();function uf(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function df(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ff(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Db(e){if(!af(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Lb(e,n,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function Xs(e){return t5(e)?e:new Mb(e)}function t5(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function n5(e){return typeof e=="string"||a5(e)}function a5(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const r5="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",zb=[],Ob={allowDangerousHtml:!0},l5=/^(https?|ircs?|mailto|xmpp)$/i,i5=[{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 Bb(e){const n=o5(e),r=s5(e);return c5(n.runSync(n.parse(r),r),e)}function o5(e){const n=e.rehypePlugins||zb,r=e.remarkPlugins||zb,l=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ob}:Ob;return e5().use(qE).use(r).use(O6,l).use(n)}function s5(e){const n=e.children||"",r=new Mb;return typeof n=="string"&&(r.value=n),r}function c5(e,n){const r=n.allowedElements,l=n.allowElement,o=n.components,u=n.disallowedElements,c=n.skipHtml,f=n.unwrapDisallowed,h=n.urlTransform||u5;for(const y of i5)Object.hasOwn(n,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+r5+y.id,void 0);return Zd(e,m),Lj(e,{Fragment:s.Fragment,components:o,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function m(y,g,_){if(y.type==="raw"&&_&&typeof g=="number")return c?_.children.splice(g,1):_.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let v;for(v in Ud)if(Object.hasOwn(Ud,v)&&Object.hasOwn(y.properties,v)){const w=y.properties[v],j=Ud[v];(j===null||j.includes(y.tagName))&&(y.properties[v]=h(String(w||""),v,y))}}if(y.type==="element"){let v=r?!r.includes(y.tagName):u?u.includes(y.tagName):!1;if(!v&&l&&typeof g=="number"&&(v=!l(y,g,_)),v&&_&&typeof g=="number")return f&&y.children?_.children.splice(g,1,...y.children):_.children.splice(g,1),g}}}function u5(e){const n=e.indexOf(":"),r=e.indexOf("?"),l=e.indexOf("#"),o=e.indexOf("/");return n===-1||o!==-1&&n>o||r!==-1&&n>r||l!==-1&&n>l||l5.test(e.slice(0,n))?e:""}function Fb(e,n){const r=String(e);if(typeof n!="string")throw new TypeError("Expected character");let l=0,o=r.indexOf(n);for(;o!==-1;)l++,o=r.indexOf(n,o+n.length);return l}function d5(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function f5(e,n,r){const o=Qs((r||{}).ignore||[]),u=h5(n);let c=-1;for(;++c<u.length;)jb(e,"text",f);function f(m,y){let g=-1,_;for(;++g<y.length;){const v=y[g],w=_?_.children:void 0;if(o(v,w?w.indexOf(v):void 0,_))return;_=v}if(_)return h(m,y)}function h(m,y){const g=y[y.length-1],_=u[c][0],v=u[c][1];let w=0;const T=g.children.indexOf(m);let C=!1,E=[];_.lastIndex=0;let N=_.exec(m.value);for(;N;){const D=N.index,F={index:N.index,input:N.input,stack:[...y,m]};let M=v(...N,F);if(typeof M=="string"&&(M=M.length>0?{type:"text",value:M}:void 0),M===!1?_.lastIndex=D+1:(w!==D&&E.push({type:"text",value:m.value.slice(w,D)}),Array.isArray(M)?E.push(...M):M&&E.push(M),w=D+N[0].length,C=!0),!_.global)break;N=_.exec(m.value)}return C?(w<m.value.length&&E.push({type:"text",value:m.value.slice(w)}),g.children.splice(T,1,...E)):E=[m],T+E.length}}function h5(e){const n=[];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 l=-1;for(;++l<r.length;){const o=r[l];n.push([m5(o[0]),p5(o[1])])}return n}function m5(e){return typeof e=="string"?new RegExp(d5(e),"g"):e}function p5(e){return typeof e=="function"?e:function(){return e}}const hf="phrasing",mf=["autolink","link","image","label"];function g5(){return{transforms:[k5],enter:{literalAutolink:b5,literalAutolinkEmail:pf,literalAutolinkHttp:pf,literalAutolinkWww:pf},exit:{literalAutolink:w5,literalAutolinkEmail:_5,literalAutolinkHttp:x5,literalAutolinkWww:v5}}}function y5(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:hf,notInConstruct:mf},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:hf,notInConstruct:mf},{character:":",before:"[ps]",after:"\\/",inConstruct:hf,notInConstruct:mf}]}}function b5(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function pf(e){this.config.enter.autolinkProtocol.call(this,e)}function x5(e){this.config.exit.autolinkProtocol.call(this,e)}function v5(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.type,n.url="http://"+this.sliceSerialize(e)}function _5(e){this.config.exit.autolinkEmail.call(this,e)}function w5(e){this.exit(e)}function k5(e){f5(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,S5],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),C5]],{ignore:["link","linkReference"]})}function S5(e,n,r,l,o){let u="";if(!Ib(o)||(/^w/i.test(n)&&(r=n+r,n="",u="http://"),!j5(r)))return!1;const c=E5(r+l);if(!c[0])return!1;const f={type:"link",title:null,url:u+n+c[0],children:[{type:"text",value:n+c[0]}]};return c[1]?[f,{type:"text",value:c[1]}]:f}function C5(e,n,r,l){return!Ib(l,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+r,children:[{type:"text",value:n+"@"+r}]}}function j5(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function E5(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let r=n[0],l=r.indexOf(")");const o=Fb(e,"(");let u=Fb(e,")");for(;l!==-1&&o>u;)e+=r.slice(0,l+1),r=r.slice(l+1),l=r.indexOf(")"),u++;return[e,r]}function Ib(e,n){const r=e.input.charCodeAt(e.index-1);return(e.index===0||Zr(r)||Hs(r))&&(!n||r!==47)}Ub.peek=O5;function N5(){this.buffer()}function T5(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function A5(){this.buffer()}function M5(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function R5(e){const n=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=pa(this.sliceSerialize(e)).toLowerCase(),r.label=n}function D5(e){this.exit(e)}function L5(e){const n=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=pa(this.sliceSerialize(e)).toLowerCase(),r.label=n}function z5(e){this.exit(e)}function O5(){return"["}function Ub(e,n,r,l){const o=r.createTracker(l);let u=o.move("[^");const c=r.enter("footnoteReference"),f=r.enter("reference");return u+=o.move(r.safe(r.associationId(e),{after:"]",before:u})),f(),c(),u+=o.move("]"),u}function B5(){return{enter:{gfmFootnoteCallString:N5,gfmFootnoteCall:T5,gfmFootnoteDefinitionLabelString:A5,gfmFootnoteDefinition:M5},exit:{gfmFootnoteCallString:R5,gfmFootnoteCall:D5,gfmFootnoteDefinitionLabelString:L5,gfmFootnoteDefinition:z5}}}function F5(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:r,footnoteReference:Ub},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(l,o,u,c){const f=u.createTracker(c);let h=f.move("[^");const m=u.enter("footnoteDefinition"),y=u.enter("label");return h+=f.move(u.safe(u.associationId(l),{before:h,after:"]"})),y(),h+=f.move("]:"),l.children&&l.children.length>0&&(f.shift(4),h+=f.move((n?`
`:" ")+u.indentLines(u.containerFlow(l,f.current()),n?Hb:I5))),m(),h}}function I5(e,n,r){return n===0?e:Hb(e,n,r)}function Hb(e,n,r){return(r?"":"    ")+e}const U5=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];qb.peek=Y5;function H5(){return{canContainEols:["delete"],enter:{strikethrough:P5},exit:{strikethrough:$5}}}function q5(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:U5}],handlers:{delete:qb}}}function P5(e){this.enter({type:"delete",children:[]},e)}function $5(e){this.exit(e)}function qb(e,n,r,l){const o=r.createTracker(l),u=r.enter("strikethrough");let c=o.move("~~");return c+=r.containerPhrasing(e,{...o.current(),before:c,after:"~"}),c+=o.move("~~"),u(),c}function Y5(){return"~"}function G5(e){return e.length}function K5(e,n){const r=n||{},l=(r.align||[]).concat(),o=r.stringLength||G5,u=[],c=[],f=[],h=[];let m=0,y=-1;for(;++y<e.length;){const j=[],T=[];let C=-1;for(e[y].length>m&&(m=e[y].length);++C<e[y].length;){const E=V5(e[y][C]);if(r.alignDelimiters!==!1){const N=o(E);T[C]=N,(h[C]===void 0||N>h[C])&&(h[C]=N)}j.push(E)}c[y]=j,f[y]=T}let g=-1;if(typeof l=="object"&&"length"in l)for(;++g<m;)u[g]=Pb(l[g]);else{const j=Pb(l);for(;++g<m;)u[g]=j}g=-1;const _=[],v=[];for(;++g<m;){const j=u[g];let T="",C="";j===99?(T=":",C=":"):j===108?T=":":j===114&&(C=":");let E=r.alignDelimiters===!1?1:Math.max(1,h[g]-T.length-C.length);const N=T+"-".repeat(E)+C;r.alignDelimiters!==!1&&(E=T.length+E+C.length,E>h[g]&&(h[g]=E),v[g]=E),_[g]=N}c.splice(1,0,_),f.splice(1,0,v),y=-1;const w=[];for(;++y<c.length;){const j=c[y],T=f[y];g=-1;const C=[];for(;++g<m;){const E=j[g]||"";let N="",D="";if(r.alignDelimiters!==!1){const F=h[g]-(T[g]||0),M=u[g];M===114?N=" ".repeat(F):M===99?F%2?(N=" ".repeat(F/2+.5),D=" ".repeat(F/2-.5)):(N=" ".repeat(F/2),D=N):D=" ".repeat(F)}r.delimiterStart!==!1&&!g&&C.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&E==="")&&(r.delimiterStart!==!1||g)&&C.push(" "),r.alignDelimiters!==!1&&C.push(N),C.push(E),r.alignDelimiters!==!1&&C.push(D),r.padding!==!1&&C.push(" "),(r.delimiterEnd!==!1||g!==m-1)&&C.push("|")}w.push(r.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return w.join(`
`)}function V5(e){return e==null?"":String(e)}function Pb(e){const n=typeof e=="string"?e.codePointAt(0):0;return n===67||n===99?99:n===76||n===108?108:n===82||n===114?114:0}function Q5(e,n,r,l){const o=r.enter("blockquote"),u=r.createTracker(l);u.move("> "),u.shift(2);const c=r.indentLines(r.containerFlow(e,u.current()),W5);return o(),c}function W5(e,n,r){return">"+(r?"":" ")+e}function X5(e,n){return $b(e,n.inConstruct,!0)&&!$b(e,n.notInConstruct,!1)}function $b(e,n,r){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return r;let l=-1;for(;++l<n.length;)if(e.includes(n[l]))return!0;return!1}function Yb(e,n,r,l){let o=-1;for(;++o<r.unsafe.length;)if(r.unsafe[o].character===`
`&&X5(r.stack,r.unsafe[o]))return/[ \t]/.test(l.before)?"":" ";return`\\
`}function J5(e,n){const r=String(e);let l=r.indexOf(n),o=l,u=0,c=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;l!==-1;)l===o?++u>c&&(c=u):u=1,o=l+n.length,l=r.indexOf(n,o);return c}function Z5(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function eN(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function tN(e,n,r,l){const o=eN(r),u=e.value||"",c=o==="`"?"GraveAccent":"Tilde";if(Z5(e,r)){const g=r.enter("codeIndented"),_=r.indentLines(u,nN);return g(),_}const f=r.createTracker(l),h=o.repeat(Math.max(J5(u,o)+1,3)),m=r.enter("codeFenced");let y=f.move(h);if(e.lang){const g=r.enter(`codeFencedLang${c}`);y+=f.move(r.safe(e.lang,{before:y,after:" ",encode:["`"],...f.current()})),g()}if(e.lang&&e.meta){const g=r.enter(`codeFencedMeta${c}`);y+=f.move(" "),y+=f.move(r.safe(e.meta,{before:y,after:`
`,encode:["`"],...f.current()})),g()}return y+=f.move(`
`),u&&(y+=f.move(u+`
`)),y+=f.move(h),m(),y}function nN(e,n,r){return(r?"":"    ")+e}function gf(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function aN(e,n,r,l){const o=gf(r),u=o==='"'?"Quote":"Apostrophe",c=r.enter("definition");let f=r.enter("label");const h=r.createTracker(l);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?" ":`
`,...h.current()}))),f(),e.title&&(f=r.enter(`title${u}`),m+=h.move(" "+o),m+=h.move(r.safe(e.title,{before:m,after:o,...h.current()})),m+=h.move(o),f()),c(),m}function rN(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function lo(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Js(e,n,r){const l=$l(e),o=$l(n);return l===void 0?o===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:l===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}}Gb.peek=lN;function Gb(e,n,r,l){const o=rN(r),u=r.enter("emphasis"),c=r.createTracker(l),f=c.move(o);let h=c.move(r.containerPhrasing(e,{after:o,before:f,...c.current()}));const m=h.charCodeAt(0),y=Js(l.before.charCodeAt(l.before.length-1),m,o);y.inside&&(h=lo(m)+h.slice(1));const g=h.charCodeAt(h.length-1),_=Js(l.after.charCodeAt(0),g,o);_.inside&&(h=h.slice(0,-1)+lo(g));const v=c.move(o);return u(),r.attentionEncodeSurroundingInfo={after:_.outside,before:y.outside},f+h+v}function lN(e,n,r){return r.options.emphasis||"*"}function iN(e,n){let r=!1;return Zd(e,function(l){if("value"in l&&/\r?\n|\r/.test(l.value)||l.type==="break")return r=!0,Jd}),!!((!e.depth||e.depth<3)&&Hd(e)&&(n.options.setext||r))}function oN(e,n,r,l){const o=Math.max(Math.min(6,e.depth||1),1),u=r.createTracker(l);if(iN(e,r)){const y=r.enter("headingSetext"),g=r.enter("phrasing"),_=r.containerPhrasing(e,{...u.current(),before:`
`,after:`
`});return g(),y(),_+`
`+(o===1?"=":"-").repeat(_.length-(Math.max(_.lastIndexOf("\r"),_.lastIndexOf(`
`))+1))}const c="#".repeat(o),f=r.enter("headingAtx"),h=r.enter("phrasing");u.move(c+" ");let m=r.containerPhrasing(e,{before:"# ",after:`
`,...u.current()});return/^[\t ]/.test(m)&&(m=lo(m.charCodeAt(0))+m.slice(1)),m=m?c+" "+m:c,r.options.closeAtx&&(m+=" "+c),h(),f(),m}Kb.peek=sN;function Kb(e){return e.value||""}function sN(){return"<"}Vb.peek=cN;function Vb(e,n,r,l){const o=gf(r),u=o==='"'?"Quote":"Apostrophe",c=r.enter("image");let f=r.enter("label");const h=r.createTracker(l);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${u}`),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(")"),c(),m}function cN(){return"!"}Qb.peek=uN;function Qb(e,n,r,l){const o=e.referenceType,u=r.enter("imageReference");let c=r.enter("label");const f=r.createTracker(l);let h=f.move("![");const m=r.safe(e.alt,{before:h,after:"]",...f.current()});h+=f.move(m+"]["),c();const y=r.stack;r.stack=[],c=r.enter("reference");const g=r.safe(r.associationId(e),{before:h,after:"]",...f.current()});return c(),r.stack=y,u(),o==="full"||!m||m!==g?h+=f.move(g+"]"):o==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function uN(){return"!"}Wb.peek=dN;function Wb(e,n,r){let l=e.value||"",o="`",u=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(l);)o+="`";for(/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^`|`$/.test(l))&&(l=" "+l+" ");++u<r.unsafe.length;){const c=r.unsafe[u],f=r.compilePattern(c);let h;if(c.atBreak)for(;h=f.exec(l);){let m=h.index;l.charCodeAt(m)===10&&l.charCodeAt(m-1)===13&&m--,l=l.slice(0,m)+" "+l.slice(h.index+1)}}return o+l+o}function dN(){return"`"}function Xb(e,n){const r=Hd(e);return!!(!n.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))}Jb.peek=fN;function Jb(e,n,r,l){const o=gf(r),u=o==='"'?"Quote":"Apostrophe",c=r.createTracker(l);let f,h;if(Xb(e,r)){const y=r.stack;r.stack=[],f=r.enter("autolink");let g=c.move("<");return g+=c.move(r.containerPhrasing(e,{before:g,after:">",...c.current()})),g+=c.move(">"),f(),r.stack=y,g}f=r.enter("link"),h=r.enter("label");let m=c.move("[");return m+=c.move(r.containerPhrasing(e,{before:m,after:"](",...c.current()})),m+=c.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=r.enter("destinationLiteral"),m+=c.move("<"),m+=c.move(r.safe(e.url,{before:m,after:">",...c.current()})),m+=c.move(">")):(h=r.enter("destinationRaw"),m+=c.move(r.safe(e.url,{before:m,after:e.title?" ":")",...c.current()}))),h(),e.title&&(h=r.enter(`title${u}`),m+=c.move(" "+o),m+=c.move(r.safe(e.title,{before:m,after:o,...c.current()})),m+=c.move(o),h()),m+=c.move(")"),f(),m}function fN(e,n,r){return Xb(e,r)?"<":"["}Zb.peek=hN;function Zb(e,n,r,l){const o=e.referenceType,u=r.enter("linkReference");let c=r.enter("label");const f=r.createTracker(l);let h=f.move("[");const m=r.containerPhrasing(e,{before:h,after:"]",...f.current()});h+=f.move(m+"]["),c();const y=r.stack;r.stack=[],c=r.enter("reference");const g=r.safe(r.associationId(e),{before:h,after:"]",...f.current()});return c(),r.stack=y,u(),o==="full"||!m||m!==g?h+=f.move(g+"]"):o==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function hN(){return"["}function yf(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function mN(e){const n=yf(e),r=e.options.bulletOther;if(!r)return n==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+r+"`) to be different");return r}function pN(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function e0(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function gN(e,n,r,l){const o=r.enter("list"),u=r.bulletCurrent;let c=e.ordered?pN(r):yf(r);const f=e.ordered?c==="."?")":".":mN(r);let h=n&&r.bulletLastUsed?c===r.bulletLastUsed:!1;if(!e.ordered){const y=e.children?e.children[0]:void 0;if((c==="*"||c==="-")&&y&&(!y.children||!y.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),e0(r)===c&&y){let g=-1;for(;++g<e.children.length;){const _=e.children[g];if(_&&_.type==="listItem"&&_.children&&_.children[0]&&_.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(c=f),r.bulletCurrent=c;const m=r.containerFlow(e,l);return r.bulletLastUsed=c,r.bulletCurrent=u,o(),m}function yN(e){const n=e.options.listItemIndent||"one";if(n!=="tab"&&n!=="one"&&n!=="mixed")throw new Error("Cannot serialize items with `"+n+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return n}function bN(e,n,r,l){const o=yN(r);let u=r.bulletCurrent||yf(r);n&&n.type==="list"&&n.ordered&&(u=(typeof n.start=="number"&&n.start>-1?n.start:1)+(r.options.incrementListMarker===!1?0:n.children.indexOf(e))+u);let c=u.length+1;(o==="tab"||o==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(c=Math.ceil(c/4)*4);const f=r.createTracker(l);f.move(u+" ".repeat(c-u.length)),f.shift(c);const h=r.enter("listItem"),m=r.indentLines(r.containerFlow(e,f.current()),y);return h(),m;function y(g,_,v){return _?(v?"":" ".repeat(c))+g:(v?u:u+" ".repeat(c-u.length))+g}}function xN(e,n,r,l){const o=r.enter("paragraph"),u=r.enter("phrasing"),c=r.containerPhrasing(e,l);return u(),o(),c}const vN=Qs(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function _N(e,n,r,l){return(e.children.some(function(c){return vN(c)})?r.containerPhrasing:r.containerFlow).call(r,e,l)}function wN(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}t0.peek=kN;function t0(e,n,r,l){const o=wN(r),u=r.enter("strong"),c=r.createTracker(l),f=c.move(o+o);let h=c.move(r.containerPhrasing(e,{after:o,before:f,...c.current()}));const m=h.charCodeAt(0),y=Js(l.before.charCodeAt(l.before.length-1),m,o);y.inside&&(h=lo(m)+h.slice(1));const g=h.charCodeAt(h.length-1),_=Js(l.after.charCodeAt(0),g,o);_.inside&&(h=h.slice(0,-1)+lo(g));const v=c.move(o+o);return u(),r.attentionEncodeSurroundingInfo={after:_.outside,before:y.outside},f+h+v}function kN(e,n,r){return r.options.strong||"*"}function SN(e,n,r,l){return r.safe(e.value,l)}function CN(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function jN(e,n,r){const l=(e0(r)+(r.options.ruleSpaces?" ":"")).repeat(CN(r));return r.options.ruleSpaces?l.slice(0,-1):l}const n0={blockquote:Q5,break:Yb,code:tN,definition:aN,emphasis:Gb,hardBreak:Yb,heading:oN,html:Kb,image:Vb,imageReference:Qb,inlineCode:Wb,link:Jb,linkReference:Zb,list:gN,listItem:bN,paragraph:xN,root:_N,strong:t0,text:SN,thematicBreak:jN};function EN(){return{enter:{table:NN,tableData:a0,tableHeader:a0,tableRow:AN},exit:{codeText:MN,table:TN,tableData:bf,tableHeader:bf,tableRow:bf}}}function NN(e){const n=e._align;this.enter({type:"table",align:n.map(function(r){return r==="none"?null:r}),children:[]},e),this.data.inTable=!0}function TN(e){this.exit(e),this.data.inTable=void 0}function AN(e){this.enter({type:"tableRow",children:[]},e)}function bf(e){this.exit(e)}function a0(e){this.enter({type:"tableCell",children:[]},e)}function MN(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,RN));const r=this.stack[this.stack.length-1];r.type,r.value=n,this.exit(e)}function RN(e,n){return n==="|"?n:e}function DN(e){const n=e||{},r=n.tableCellPadding,l=n.tablePipeAlign,o=n.stringLength,u=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[	 :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:_,table:c,tableCell:h,tableRow:f}};function c(v,w,j,T){return m(y(v,j,T),v.align)}function f(v,w,j,T){const C=g(v,j,T),E=m([C]);return E.slice(0,E.indexOf(`
`))}function h(v,w,j,T){const C=j.enter("tableCell"),E=j.enter("phrasing"),N=j.containerPhrasing(v,{...T,before:u,after:u});return E(),C(),N}function m(v,w){return K5(v,{align:w,alignDelimiters:l,padding:r,stringLength:o})}function y(v,w,j){const T=v.children;let C=-1;const E=[],N=w.enter("table");for(;++C<T.length;)E[C]=g(T[C],w,j);return N(),E}function g(v,w,j){const T=v.children;let C=-1;const E=[],N=w.enter("tableRow");for(;++C<T.length;)E[C]=h(T[C],v,w,j);return N(),E}function _(v,w,j){let T=n0.inlineCode(v,w,j);return j.stack.includes("tableCell")&&(T=T.replace(/\|/g,"\\$&")),T}}function LN(){return{exit:{taskListCheckValueChecked:r0,taskListCheckValueUnchecked:r0,paragraph:ON}}}function zN(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:BN}}}function r0(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function ON(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const l=r.children[0];if(l&&l.type==="text"){const o=n.children;let u=-1,c;for(;++u<o.length;){const f=o[u];if(f.type==="paragraph"){c=f;break}}c===r&&(l.value=l.value.slice(1),l.value.length===0?r.children.shift():r.position&&l.position&&typeof l.position.start.offset=="number"&&(l.position.start.column++,l.position.start.offset++,r.position.start=Object.assign({},l.position.start)))}}this.exit(e)}function BN(e,n,r,l){const o=e.children[0],u=typeof e.checked=="boolean"&&o&&o.type==="paragraph",c="["+(e.checked?"x":" ")+"] ",f=r.createTracker(l);u&&f.move(c);let h=n0.listItem(e,n,r,{...l,...f.current()});return u&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),h;function m(y){return y+c}}function FN(){return[g5(),B5(),H5(),EN(),LN()]}function IN(e){return{extensions:[y5(),F5(e),q5(),DN(e),zN()]}}const UN={tokenize:GN,partial:!0},l0={tokenize:KN,partial:!0},i0={tokenize:VN,partial:!0},o0={tokenize:QN,partial:!0},HN={tokenize:WN,partial:!0},s0={name:"wwwAutolink",tokenize:$N,previous:u0},c0={name:"protocolAutolink",tokenize:YN,previous:d0},Pa={name:"emailAutolink",tokenize:PN,previous:f0},ja={};function qN(){return{text:ja}}let el=48;for(;el<123;)ja[el]=Pa,el++,el===58?el=65:el===91&&(el=97);ja[43]=Pa,ja[45]=Pa,ja[46]=Pa,ja[95]=Pa,ja[72]=[Pa,c0],ja[104]=[Pa,c0],ja[87]=[Pa,s0],ja[119]=[Pa,s0];function PN(e,n,r){const l=this;let o,u;return c;function c(g){return!xf(g)||!f0.call(l,l.previous)||vf(l.events)?r(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(g))}function f(g){return xf(g)?(e.consume(g),f):g===64?(e.consume(g),h):r(g)}function h(g){return g===46?e.check(HN,y,m)(g):g===45||g===95||ln(g)?(u=!0,e.consume(g),h):y(g)}function m(g){return e.consume(g),o=!0,h}function y(g){return u&&o&&dn(l.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(g)):r(g)}}function $N(e,n,r){const l=this;return o;function o(c){return c!==87&&c!==119||!u0.call(l,l.previous)||vf(l.events)?r(c):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(UN,e.attempt(l0,e.attempt(i0,u),r),r)(c))}function u(c){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(c)}}function YN(e,n,r){const l=this;let o="",u=!1;return c;function c(g){return(g===72||g===104)&&d0.call(l,l.previous)&&!vf(l.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(g),e.consume(g),f):r(g)}function f(g){if(dn(g)&&o.length<5)return o+=String.fromCodePoint(g),e.consume(g),f;if(g===58){const _=o.toLowerCase();if(_==="http"||_==="https")return e.consume(g),h}return r(g)}function h(g){return g===47?(e.consume(g),u?m:(u=!0,h)):r(g)}function m(g){return g===null||Us(g)||ft(g)||Zr(g)||Hs(g)?r(g):e.attempt(l0,e.attempt(i0,y),r)(g)}function y(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(g)}}function GN(e,n,r){let l=0;return o;function o(c){return(c===87||c===119)&&l<3?(l++,e.consume(c),o):c===46&&l===3?(e.consume(c),u):r(c)}function u(c){return c===null?r(c):n(c)}}function KN(e,n,r){let l,o,u;return c;function c(m){return m===46||m===95?e.check(o0,h,f)(m):m===null||ft(m)||Zr(m)||m!==45&&Hs(m)?h(m):(u=!0,e.consume(m),c)}function f(m){return m===95?l=!0:(o=l,l=void 0),e.consume(m),c}function h(m){return o||l||!u?r(m):n(m)}}function VN(e,n){let r=0,l=0;return o;function o(c){return c===40?(r++,e.consume(c),o):c===41&&l<r?u(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?e.check(o0,n,u)(c):c===null||ft(c)||Zr(c)?n(c):(e.consume(c),o)}function u(c){return c===41&&l++,e.consume(c),o}}function QN(e,n,r){return l;function l(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),l):f===38?(e.consume(f),u):f===93?(e.consume(f),o):f===60||f===null||ft(f)||Zr(f)?n(f):r(f)}function o(f){return f===null||f===40||f===91||ft(f)||Zr(f)?n(f):l(f)}function u(f){return dn(f)?c(f):r(f)}function c(f){return f===59?(e.consume(f),l):dn(f)?(e.consume(f),c):r(f)}}function WN(e,n,r){return l;function l(u){return e.consume(u),o}function o(u){return ln(u)?r(u):n(u)}}function u0(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ft(e)}function d0(e){return!dn(e)}function f0(e){return!(e===47||xf(e))}function xf(e){return e===43||e===45||e===46||e===95||ln(e)}function vf(e){let n=e.length,r=!1;for(;n--;){const l=e[n][1];if((l.type==="labelLink"||l.type==="labelImage")&&!l._balanced){r=!0;break}if(l._gfmAutolinkLiteralWalkedInto){r=!1;break}}return e.length>0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const XN={tokenize:lT,partial:!0};function JN(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:nT,continuation:{tokenize:aT},exit:rT}},text:{91:{name:"gfmFootnoteCall",tokenize:tT},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:ZN,resolveTo:eT}}}}function ZN(e,n,r){const l=this;let o=l.events.length;const u=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let c;for(;o--;){const h=l.events[o][1];if(h.type==="labelImage"){c=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(!c||!c._balanced)return r(h);const m=pa(l.sliceSerialize({start:c.end,end:l.now()}));return m.codePointAt(0)!==94||!u.includes(m.slice(1))?r(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),n(h))}}function eT(e,n){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 l={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 u={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},c={type:"chunkString",contentType:"string",start:Object.assign({},u.start),end:Object.assign({},u.end)},f=[e[r+1],e[r+2],["enter",l,n],e[r+3],e[r+4],["enter",o,n],["exit",o,n],["enter",u,n],["enter",c,n],["exit",c,n],["exit",u,n],e[e.length-2],e[e.length-1],["exit",l,n]];return e.splice(r,e.length-r+1,...f),e}function tT(e,n,r){const l=this,o=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let u=0,c;return f;function f(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),h}function h(g){return g!==94?r(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",m)}function m(g){if(u>999||g===93&&!c||g===null||g===91||ft(g))return r(g);if(g===93){e.exit("chunkString");const _=e.exit("gfmFootnoteCallString");return o.includes(pa(l.sliceSerialize(_)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):r(g)}return ft(g)||(c=!0),u++,e.consume(g),g===92?y:m}function y(g){return g===91||g===92||g===93?(e.consume(g),u++,m):m(g)}}function nT(e,n,r){const l=this,o=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let u,c=0,f;return h;function h(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",y):r(w)}function y(w){if(c>999||w===93&&!f||w===null||w===91||ft(w))return r(w);if(w===93){e.exit("chunkString");const j=e.exit("gfmFootnoteDefinitionLabelString");return u=pa(l.sliceSerialize(j)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),_}return ft(w)||(f=!0),c++,e.consume(w),w===92?g:y}function g(w){return w===91||w===92||w===93?(e.consume(w),c++,y):y(w)}function _(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),o.includes(u)||o.push(u),Je(e,v,"gfmFootnoteDefinitionWhitespace")):r(w)}function v(w){return n(w)}}function aT(e,n,r){return e.check(Zi,n,e.attempt(XN,n,r))}function rT(e){e.exit("gfmFootnoteDefinition")}function lT(e,n,r){const l=this;return Je(e,o,"gfmFootnoteDefinitionIndent",5);function o(u){const c=l.events[l.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?n(u):r(u)}}function iT(e){let r=(e||{}).singleTilde;const l={name:"strikethrough",tokenize:u,resolveAll:o};return r==null&&(r=!0),{text:{126:l},insideSpan:{null:[l]},attentionMarkers:{null:[126]}};function o(c,f){let h=-1;for(;++h<c.length;)if(c[h][0]==="enter"&&c[h][1].type==="strikethroughSequenceTemporary"&&c[h][1]._close){let m=h;for(;m--;)if(c[m][0]==="exit"&&c[m][1].type==="strikethroughSequenceTemporary"&&c[m][1]._open&&c[h][1].end.offset-c[h][1].start.offset===c[m][1].end.offset-c[m][1].start.offset){c[h][1].type="strikethroughSequence",c[m][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},c[m][1].start),end:Object.assign({},c[h][1].end)},g={type:"strikethroughText",start:Object.assign({},c[m][1].end),end:Object.assign({},c[h][1].start)},_=[["enter",y,f],["enter",c[m][1],f],["exit",c[m][1],f],["enter",g,f]],v=f.parser.constructs.insideSpan.null;v&&Mn(_,_.length,0,qs(v,c.slice(m+1,h),f)),Mn(_,_.length,0,[["exit",g,f],["enter",c[h][1],f],["exit",c[h][1],f],["exit",y,f]]),Mn(c,m-1,h-m+3,_),h=m+_.length-2;break}}for(h=-1;++h<c.length;)c[h][1].type==="strikethroughSequenceTemporary"&&(c[h][1].type="data");return c}function u(c,f,h){const m=this.previous,y=this.events;let g=0;return _;function _(w){return m===126&&y[y.length-1][1].type!=="characterEscape"?h(w):(c.enter("strikethroughSequenceTemporary"),v(w))}function v(w){const j=$l(m);if(w===126)return g>1?h(w):(c.consume(w),g++,v);if(g<2&&!r)return h(w);const T=c.exit("strikethroughSequenceTemporary"),C=$l(w);return T._open=!C||C===2&&!!j,T._close=!j||j===2&&!!C,f(w)}}}class oT{constructor(){this.map=[]}add(n,r,l){sT(this,n,r,l)}consume(n){if(this.map.sort(function(u,c){return u[0]-c[0]}),this.map.length===0)return;let r=this.map.length;const l=[];for(;r>0;)r-=1,l.push(n.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),n.length=this.map[r][0];l.push(n.slice()),n.length=0;let o=l.pop();for(;o;){for(const u of o)n.push(u);o=l.pop()}this.map.length=0}}function sT(e,n,r,l){let o=0;if(!(r===0&&l.length===0)){for(;o<e.map.length;){if(e.map[o][0]===n){e.map[o][1]+=r,e.map[o][2].push(...l);return}o+=1}e.map.push([n,r,l])}}function cT(e,n){let r=!1;const l=[];for(;n<e.length;){const o=e[n];if(r){if(o[0]==="enter")o[1].type==="tableContent"&&l.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const u=l.length-1;l[u]=l[u]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(r=!0);n+=1}return l}function uT(){return{flow:{null:{name:"table",tokenize:dT,resolveAll:fT}}}}function dT(e,n,r){const l=this;let o=0,u=0,c;return f;function f(L){let B=l.events.length-1;for(;B>-1;){const G=l.events[B][1].type;if(G==="lineEnding"||G==="linePrefix")B--;else break}const q=B>-1?l.events[B][1].type:null,K=q==="tableHead"||q==="tableRow"?M:h;return K===M&&l.parser.lazy[l.now().line]?r(L):K(L)}function h(L){return e.enter("tableHead"),e.enter("tableRow"),m(L)}function m(L){return L===124||(c=!0,u+=1),y(L)}function y(L){return L===null?r(L):Ne(L)?u>1?(u=0,l.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),v):r(L):Ue(L)?Je(e,y,"whitespace")(L):(u+=1,c&&(c=!1,o+=1),L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),c=!0,y):(e.enter("data"),g(L)))}function g(L){return L===null||L===124||ft(L)?(e.exit("data"),y(L)):(e.consume(L),L===92?_:g)}function _(L){return L===92||L===124?(e.consume(L),g):g(L)}function v(L){return l.interrupt=!1,l.parser.lazy[l.now().line]?r(L):(e.enter("tableDelimiterRow"),c=!1,Ue(L)?Je(e,w,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):w(L))}function w(L){return L===45||L===58?T(L):L===124?(c=!0,e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),j):F(L)}function j(L){return Ue(L)?Je(e,T,"whitespace")(L):T(L)}function T(L){return L===58?(u+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),C):L===45?(u+=1,C(L)):L===null||Ne(L)?D(L):F(L)}function C(L){return L===45?(e.enter("tableDelimiterFiller"),E(L)):F(L)}function E(L){return L===45?(e.consume(L),E):L===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),N):(e.exit("tableDelimiterFiller"),N(L))}function N(L){return Ue(L)?Je(e,D,"whitespace")(L):D(L)}function D(L){return L===124?w(L):L===null||Ne(L)?!c||o!==u?F(L):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(L)):F(L)}function F(L){return r(L)}function M(L){return e.enter("tableRow"),A(L)}function A(L){return L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),A):L===null||Ne(L)?(e.exit("tableRow"),n(L)):Ue(L)?Je(e,A,"whitespace")(L):(e.enter("data"),U(L))}function U(L){return L===null||L===124||ft(L)?(e.exit("data"),A(L)):(e.consume(L),L===92?I:U)}function I(L){return L===92||L===124?(e.consume(L),U):U(L)}}function fT(e,n){let r=-1,l=!0,o=0,u=[0,0,0,0],c=[0,0,0,0],f=!1,h=0,m,y,g;const _=new oT;for(;++r<e.length;){const v=e[r],w=v[1];v[0]==="enter"?w.type==="tableHead"?(f=!1,h!==0&&(h0(_,n,h,m,y),y=void 0,h=0),m={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},_.add(r,0,[["enter",m,n]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(l=!0,g=void 0,u=[0,0,0,0],c=[0,r+1,0,0],f&&(f=!1,y={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},_.add(r,0,[["enter",y,n]])),o=w.type==="tableDelimiterRow"?2:y?3:1):o&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(l=!1,c[2]===0&&(u[1]!==0&&(c[0]=c[1],g=Zs(_,n,u,o,void 0,g),u=[0,0,0,0]),c[2]=r)):w.type==="tableCellDivider"&&(l?l=!1:(u[1]!==0&&(c[0]=c[1],g=Zs(_,n,u,o,void 0,g)),u=c,c=[u[1],r,0,0])):w.type==="tableHead"?(f=!0,h=r):w.type==="tableRow"||w.type==="tableDelimiterRow"?(h=r,u[1]!==0?(c[0]=c[1],g=Zs(_,n,u,o,r,g)):c[1]!==0&&(g=Zs(_,n,c,o,r,g)),o=0):o&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(c[3]=r)}for(h!==0&&h0(_,n,h,m,y),_.consume(n.events),r=-1;++r<n.events.length;){const v=n.events[r];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=cT(n.events,r))}return e}function Zs(e,n,r,l,o,u){const c=l===1?"tableHeader":l===2?"tableDelimiter":"tableData",f="tableContent";r[0]!==0&&(u.end=Object.assign({},Gl(n.events,r[0])),e.add(r[0],0,[["exit",u,n]]));const h=Gl(n.events,r[1]);if(u={type:c,start:Object.assign({},h),end:Object.assign({},h)},e.add(r[1],0,[["enter",u,n]]),r[2]!==0){const m=Gl(n.events,r[2]),y=Gl(n.events,r[3]),g={type:f,start:Object.assign({},m),end:Object.assign({},y)};if(e.add(r[2],0,[["enter",g,n]]),l!==2){const _=n.events[r[2]],v=n.events[r[3]];if(_[1].end=Object.assign({},v[1].end),_[1].type="chunkText",_[1].contentType="text",r[3]>r[2]+1){const w=r[2]+1,j=r[3]-r[2]-1;e.add(w,j,[])}}e.add(r[3]+1,0,[["exit",g,n]])}return o!==void 0&&(u.end=Object.assign({},Gl(n.events,o)),e.add(o,0,[["exit",u,n]]),u=void 0),u}function h0(e,n,r,l,o){const u=[],c=Gl(n.events,r);o&&(o.end=Object.assign({},c),u.push(["exit",o,n])),l.end=Object.assign({},c),u.push(["exit",l,n]),e.add(r+1,0,u)}function Gl(e,n){const r=e[n],l=r[0]==="enter"?"start":"end";return r[1][l]}const hT={name:"tasklistCheck",tokenize:pT};function mT(){return{text:{91:hT}}}function pT(e,n,r){const l=this;return o;function o(h){return l.previous!==null||!l._gfmTasklistFirstContentOfListItem?r(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),u)}function u(h){return ft(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),c):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),c):r(h)}function c(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):r(h)}function f(h){return Ne(h)?n(h):Ue(h)?e.check({tokenize:gT},n,r)(h):r(h)}}function gT(e,n,r){return Je(e,l,"whitespace");function l(o){return o===null?r(o):n(o)}}function yT(e){return Ky([qN(),JN(),iT(e),uT(),mT()])}const bT={};function m0(e){const n=this,r=e||bT,l=n.data(),o=l.micromarkExtensions||(l.micromarkExtensions=[]),u=l.fromMarkdownExtensions||(l.fromMarkdownExtensions=[]),c=l.toMarkdownExtensions||(l.toMarkdownExtensions=[]);o.push(yT(r)),u.push(FN()),c.push(IN(r))}function on(){if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();const e=globalThis.crypto,n=new Uint8Array(16);e.getRandomValues(n),n[6]=n[6]&15|64,n[8]=n[8]&63|128;const r=Array.from(n,l=>l.toString(16).padStart(2,"0")).join("");return`${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20)}`}const xT=1e3,vT=3e4,ec="kylinbot_session_id";function _T(e,n){const r=n.startsWith("/")?n:`/${n}`;return/^wss?:\/\//.test(e)?new URL(r,`${e.replace(/\/+$/,"")}/`).toString():`${e}${r}`}function _f(){let e=sessionStorage.getItem(ec);return e||(e=on(),sessionStorage.setItem(ec,e)),e}function wT(){const e=on();return sessionStorage.setItem(ec,e),e}function kT(e){sessionStorage.setItem(ec,e)}class ST{constructor(n={}){pt(this,"ws",null);pt(this,"currentDelay");pt(this,"reconnectTimer",null);pt(this,"intentionallyClosed",!1);pt(this,"onMessage",null);pt(this,"onOpen",null);pt(this,"onClose",null);pt(this,"onError",null);pt(this,"baseUrl");pt(this,"reconnectDelay");pt(this,"maxReconnectDelay");pt(this,"autoReconnect");var l,o,u,c;let r;$i()&&Ns?r=Ns.replace(/^http/,"ws"):r=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`,this.baseUrl=(l=n.baseUrl)!=null?l:r,this.reconnectDelay=(o=n.reconnectDelay)!=null?o:xT,this.maxReconnectDelay=(u=n.maxReconnectDelay)!=null?u:vT,this.autoReconnect=(c=n.autoReconnect)!=null?c:!0,this.currentDelay=this.reconnectDelay}connect(){this.intentionallyClosed=!1,this.clearReconnectTimer();const n=mr(),r=_f(),l=new URLSearchParams;n&&l.set("token",n),l.set("session_id",r);const o=`${_T(this.baseUrl,`${Il}/ws/chat`)}?${l.toString()}`;this.ws=new WebSocket(o),this.ws.onopen=()=>{var u;this.currentDelay=this.reconnectDelay,(u=this.onOpen)==null||u.call(this)},this.ws.onmessage=u=>{var c;try{const f=JSON.parse(u.data);(c=this.onMessage)==null||c.call(this,f)}catch{}},this.ws.onclose=u=>{var c;(c=this.onClose)==null||c.call(this,u),this.scheduleReconnect()},this.ws.onerror=u=>{var c;(c=this.onError)==null||c.call(this,u)}}sendMessage(n,r){if(!this.ws||this.ws.readyState!==WebSocket.OPEN)throw new Error("WebSocket is not connected");const l={type:"message",content:n};r&&r.length>0&&(l.attachments=r),this.ws.send(JSON.stringify(l))}sendJson(n){if(!this.ws||this.ws.readyState!==WebSocket.OPEN)throw new Error("WebSocket is not connected");this.ws.send(JSON.stringify(n))}sendApprovalResponse(n,r){if(!this.ws||this.ws.readyState!==WebSocket.OPEN)throw new Error("WebSocket is not connected");this.ws.send(JSON.stringify({type:"approval_response",request_id:n,decision:r}))}cancel(){if(!this.ws||this.ws.readyState!==WebSocket.OPEN)throw new Error("WebSocket is not connected");this.ws.send(JSON.stringify({type:"cancel"}))}disconnect(){this.intentionallyClosed=!0,this.clearReconnectTimer(),this.ws&&(this.ws.close(),this.ws=null)}get connected(){var n;return((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN}scheduleReconnect(){this.intentionallyClosed||!this.autoReconnect||(this.reconnectTimer=setTimeout(()=>{this.currentDelay=Math.min(this.currentDelay*2,this.maxReconnectDelay),this.connect()},this.currentDelay))}clearReconnectTimer(){this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}const p0=x.createContext({getDraft:()=>"",setDraft:()=>{},clearDraft:()=>{}});function CT(){const e=x.useRef(new Map),n=x.useCallback(o=>{var u;return(u=e.current.get(o))!=null?u:""},[]),r=x.useCallback((o,u)=>{e.current.set(o,u)},[]),l=x.useCallback(o=>{e.current.delete(o)},[]);return{getDraft:n,setDraft:r,clearDraft:l}}function jT(e){const{getDraft:n,setDraft:r,clearDraft:l}=x.useContext(p0);return{draft:n(e),saveDraft:o=>r(e,o),clearDraft:()=>l(e)}}const ET={shell:Vg,file_read:Ig,file_write:XS,file_edit:WS,content_search:Bl,glob_search:JS,browser:dd,browser_open:QS,text_browser:dd,web_search_tool:Bl,web_fetch:Og,http_request:Wg,memory_store:cd,memory_recall:cd,git_operations:ZS,image_gen:nC,screenshot:qS,calculator:HS},NT=80,TT=100;function AT(e){var n;return(n=ET[e])!=null?n:Xg}function MT(e,n){return e.length<=n?e:e.slice(0,n)+"..."}function RT({toolCall:e}){var c;const n=AT(e.name),r=e.output!==void 0,l=e.args!=null?JSON.stringify(e.args,null,2):null,o=(c=e.output)!=null?c:"",u=o.length<=NT;return s.jsxs("div",{className:"tool-card",children:[s.jsxs("div",{className:"tool-card__header",children:[s.jsx(n,{className:"h-4 w-4 flex-shrink-0",style:{color:"var(--pc-accent)"}}),s.jsx("span",{children:e.name}),r?s.jsx(Dg,{className:"h-3.5 w-3.5 flex-shrink-0",style:{color:"#34d399"}}):s.jsx(Yn,{className:"h-3.5 w-3.5 flex-shrink-0 animate-spin",style:{color:"var(--pc-accent)"}})]}),l&&s.jsxs("details",{children:[s.jsx("summary",{children:"args"}),s.jsx("pre",{children:l})]}),r&&(u?o&&s.jsx("div",{className:"tool-card__inline",children:o}):s.jsxs("details",{children:[s.jsx("summary",{children:MT(o,TT)}),s.jsx("pre",{children:o})]}))]})}const tl="kylinbot-cost-summary-stale";function g0(){typeof window>"u"||window.dispatchEvent(new Event(tl))}const nl="kylinbot:model-config-updated",DT=new Set(["deepseek","glm","minimax","moonshot","ollama","qianfan","qwen","doubao"]),y0="kylinbot_model_api_keys_v2",wf="kylinbot_model_order_v1";function kf(){try{if(typeof localStorage>"u")return{};const e=localStorage.getItem(y0);if(!e)return{};const n=JSON.parse(e);return n&&typeof n=="object"?n:{}}catch{return{}}}function b0(e){try{if(typeof localStorage>"u")return;localStorage.setItem(y0,JSON.stringify(e))}catch{}}function Sf(e,n){if(!n)return;const r=kf();r[e]=n,b0(r)}function x0(e){const n=kf();e in n&&(delete n[e],b0(n))}function tc(){try{if(typeof localStorage>"u")return[];const e=localStorage.getItem(wf);if(!e)return[];const n=JSON.parse(e);return Array.isArray(n)?n.filter(r=>typeof r=="string"):[]}catch{return[]}}function Kl(e){try{if(typeof localStorage>"u")return;localStorage.setItem(wf,JSON.stringify(e))}catch{}}function v0(e){const n=tc();n.includes(e)||Kl([e,...n])}function LT(e,n){if(e===n){v0(n);return}const r=tc(),l=r.indexOf(e),o=r.indexOf(n),u=r.filter(c=>c!==e&&c!==n);if(l>=0){const c=Math.min(l,u.length),f=[...u];f.splice(c,0,n),Kl(f)}else o<0&&Kl([n,...r])}function zT(e){const n=tc();n.includes(e)&&Kl(n.filter(r=>r!==e))}function OT(e,n){const r=new Set(n),l=e.filter(u=>r.has(u));return[...n.filter(u=>!l.includes(u)),...l]}function nc(e){typeof window>"u"||window.dispatchEvent(new CustomEvent(nl,{detail:e}))}function BT(e){return new Set(e.map(n=>n.value.trim()).filter(n=>n.length>0))}async function FT(e){const n=[...new Set(e.map(r=>r.trim()).filter(Boolean))];if(n.length!==0)try{await j4(n),g0()}catch(r){console.warn("[models] failed to purge model usage stats",r)}}async function Cf(e,n){const r=BT(n),l=[...new Set(e.map(o=>o.trim()).filter(o=>o.length>0&&!r.has(o)))];await FT(l)}function IT(e,n,r){var l;return e.filter(o=>o.provider!==n.provider).concat([{...n,provider:r.storageProvider,value:r.modelName,label:((l=r.label)==null?void 0:l.trim())||r.modelName}])}function UT(e,n,r){return e.map(l=>l.provider===n?{...l,value:r}:l)}function io(e,n){const r=e.trim(),l=n==null?void 0:n.trim();if(r==="custom"){if(!l)throw new Error("自定义模型需要填写请求地址（例如 https://api.openai.com/v1）");return`custom:${l}`}return r.startsWith("custom:"),r}function al(e){if(!e)return!1;const n=e.trim();return n.length>0&&n!=="<unset>"}function HT(e){const n="providers.models.";if(!e.startsWith(n))return null;const r=e.slice(n.length),l=r.lastIndexOf(".");return l<=0?null:{key:r.slice(0,l),field:r.slice(l+1)}}function qT(e){return!!(al(e.model)||al(e.baseUrl)||al(e.name)||e.apiKeyPopulated)}function _0(e){return e.trim().replace(/\/+$/,"")}function PT(e,n){const r=e.trim();if(!r)return!1;if(r.startsWith("custom:")){const l=_0(r.slice(7));return l?Object.entries(n).some(([o,u])=>{var f;if(o===r||o.startsWith("custom:"))return!1;const c=(f=u.baseUrl)==null?void 0:f.trim();return!!(c&&_0(c)===l)}):!1}return!1}async function jf(){var c;let e;try{e=(await my("providers.models")).entries}catch{return[]}const n={};for(const f of e){const h=HT(f.path);if(!h)continue;const m=(c=n[h.key])!=null?c:n[h.key]={},y=h.field;y==="api-key"||y==="api_key"?f.is_secret?m.apiKeyPopulated=f.populated:typeof f.value=="string"&&(m.apiKeyPopulated=f.value.length>0):y==="base-url"||y==="base_url"?typeof f.value=="string"&&f.populated&&al(f.value)&&(m.baseUrl=f.value.trim()):y==="model"&&typeof f.value=="string"?f.populated&&al(f.value)&&(m.model=f.value.trim()):y==="name"&&typeof f.value=="string"&&f.populated&&al(f.value)&&(m.name=f.value.trim())}const r=kf(),l=[];for(const[f,h]of Object.entries(n)){if(PT(f,n)||!qT(h))continue;let m,y;f.startsWith("custom:")?(m=f,y=f.slice(7)):(m=f,y=h.baseUrl);const g=al(h.model)?h.model.trim():f;l.push({label:g,value:g,provider:m,description:"已配置模型",baseUrl:y,apiKey:r[f]})}const o=l.map(f=>f.provider),u=OT(tc(),o);if(o.length>0&&u.length>0){try{const h=typeof localStorage<"u"?localStorage.getItem(wf):null,m=JSON.stringify(u);h!==m&&Kl(u)}catch{Kl(u)}const f=new Map(u.map((h,m)=>[h,m]));l.sort((h,m)=>{var _,v;const y=(_=f.get(h.provider))!=null?_:u.length,g=(v=f.get(m.provider))!=null?v:u.length;return y!==g?y-g:0})}return l}function Ef(e,n){const r=[];return r.push({op:"replace",path:`providers.models.${e}.model`,value:n.model}),DT.has(e)&&r.push({op:"replace",path:`providers.models.${e}.name`,value:e}),n.apiKey&&n.apiKey.length>0&&r.push({op:"replace",path:`providers.models.${e}.api-key`,value:n.apiKey}),e.startsWith("custom:")||n.baseUrl&&n.baseUrl.length>0&&r.push({op:"replace",path:`providers.models.${e}.base-url`,value:n.baseUrl}),n.pricing?r.push({op:"replace",path:`providers.models.${e}.pricing`,value:{input:n.pricing.input,output:n.pricing.output}}):n.pricing===null&&r.push({op:"remove",path:`providers.models.${e}.pricing`}),r}function ac(e){const n=e.value;if(typeof n!="string")return null;const r=n.trim();return r.length===0||r==="<unset>"?null:r}async function rc(){try{const e=await Ki("providers.fallback");return ac(e)}catch{}return null}async function oo(e){await pr([{op:"replace",path:"providers.fallback",value:e}])}async function w0(){try{await pr([{op:"remove",path:"providers.fallback"}])}catch{try{await pr([{op:"replace",path:"providers.fallback",value:""}])}catch{}}}async function $T(e){var f,h,m;const n=io(e.provider,e.baseUrl),r=e.model.trim();if(!n||!r)throw new Error("provider 和 model 不能为空");const l=(f=e.apiKey)==null?void 0:f.trim();e.replacedModel&&e.replacedModel.trim()!==r&&await Cf([e.replacedModel],e.configuredAfter);const o=await rc();await py("providers",n);const u=Ef(n,{model:r,apiKey:l,baseUrl:(h=e.baseUrl)==null?void 0:h.trim(),pricing:e.pricing});if(await pr(u),o&&o!==n)try{const y=await Ki(`providers.models.${o}.model`);ac(y)&&await oo(o)}catch{}Sf(n,l),v0(n);const c=(m=e.baseUrl)==null?void 0:m.trim();nc({action:"add",current:{provider:n,model:r},credentialsChanged:!!l||!!c})}async function YT(e,n){var h,m,y,g;const r=io(e.provider,void 0),l=io(n.provider,n.baseUrl),o=n.model.trim();if(!l||!o)throw new Error("provider 和 model 不能为空");const u=(h=n.apiKey)==null?void 0:h.trim();e.model.trim()!==o&&await Cf([e.model],n.configuredAfter);const c=await rc();if(r===l){const _=Ef(l,{model:o,apiKey:u,baseUrl:(m=n.baseUrl)==null?void 0:m.trim(),pricing:n.pricing});await pr(_),Sf(l,u)}else if(await py("providers",l),await pr(Ef(l,{model:o,apiKey:u,baseUrl:(y=n.baseUrl)==null?void 0:y.trim(),pricing:n.pricing})),await S0(r),x0(r),Sf(l,u),c===r)await oo(l);else if(c&&c!==l)try{const _=await Ki(`providers.models.${c}.model`);ac(_)&&await oo(c)}catch{}LT(r,l);const f=(g=n.baseUrl)==null?void 0:g.trim();nc({action:"update",original:{provider:e.provider,model:e.model},current:{provider:l,model:o},credentialsChanged:!!u||!!f})}const k0="providers.models.";function GT(e){if(!e.startsWith(k0))return null;const n=e.slice(k0.length),r=n.lastIndexOf(".");return r<=0?null:n.slice(0,r)}function KT(e,n){return GT(e)===n}async function VT(e){try{const{entries:n}=await my("providers.models");return n.map(r=>r.path).filter(r=>KT(r,e))}catch{return[]}}async function S0(e){const n=await VT(e),r=n.length>0?n:[`providers.models.${e}.model`,`providers.models.${e}.name`,`providers.models.${e}.api-key`,`providers.models.${e}.base-url`],l=[...new Set(r)].sort((o,u)=>{const c=o.split(".").length,f=u.split(".").length;return c!==f?f-c:u.localeCompare(o)});try{await pr(l.map(o=>({op:"remove",path:o})))}catch(o){if(o instanceof Gi)for(const u of l)try{await pr([{op:"remove",path:u}])}catch{}else throw o}}async function QT(e){const n=io(e.provider,void 0);if(!n)return;await Cf([e.model],e.remainingAfterDelete);const r=await rc();await S0(n),x0(n),zT(n);let l;if(e.remainingAfterDelete.length===0)await w0();else if(r===n){const o=e.remainingAfterDelete[0];o?(await oo(o.provider),l={provider:o.provider,model:o.value}):await w0()}nc({action:"delete",original:{provider:e.provider,model:e.model},...l?{current:l}:{}})}async function WT(){const e=await rc();if(!e)return null;try{const n=await Ki(`providers.models.${e}.model`),r=ac(n);return r?{provider:e,model:r}:null}catch{return null}}async function C0(e){const n=io(e.provider,void 0);if(!n)throw new Error("provider 不能为空");await oo(n),nc({action:"update",current:{provider:e.provider,model:e.model}})}const XT=100,JT="kylinbot_chat_history_v1:";function j0(e){return`${JT}${e}`}function E0(e){var n;try{const r=localStorage.getItem(j0(e));if(!r)return[];const l=JSON.parse(r);return(n=l.messages)!=null&&n.length?l.messages:[]}catch{return[]}}function N0(e,n){try{const r=n.slice(-XT);localStorage.setItem(j0(e),JSON.stringify({messages:r}))}catch{}}let lc=null;async function ZT(){if(lc)return lc;try{return lc=(await fy()).map(n=>({sessionId:n.id,title:n.channel||"未命名会话",preview:"",updatedAt:n.last_activity,messageCount:n.message_count})),lc}catch{return[]}}function e8(e){if(!e)return{cleanContent:"",attachments:[]};const n=[],r=/\[IMAGE:(data:([^;]+);base64,([A-Za-z0-9+/=]+))\]/gi;return{cleanContent:e.replace(r,(u,c,f,h)=>{const m=on(),g=`screen-capture.${f.split("/")[1]||"png"}`;return n.push({id:m,name:g,mimeType:f,kind:"image",dataBase64:h}),""}).replace(/\s{2,}/g," ").trim(),attachments:n}}function t8(e){var o;const n=Date.now()-e.length*1e3,r=[];let l=0;for(const u of e){if(u.role==="system")continue;const c=new Date(n+l*1e3).toISOString();l+=1;const{cleanContent:f,attachments:h}=e8((o=u.content)!=null?o:"");u.role==="user"?r.push({id:on(),role:"user",content:f,attachments:h.length>0?h:void 0,timestamp:c}):u.role==="assistant"?r.push({id:on(),role:"agent",content:f,markdown:!0,attachments:h.length>0?h:void 0,timestamp:c}):r.push({id:on(),role:"agent",content:f,markdown:!1,attachments:h.length>0?h:void 0,timestamp:c})}return r}function Nf(e){return e.map(n=>({id:n.id,role:n.role,content:n.content,thinking:n.thinking,markdown:n.markdown,attachments:n.attachments,timestamp:new Date(n.timestamp)}))}function T0(e){return e.map(n=>({id:n.id,role:n.role,content:n.content,thinking:n.thinking,markdown:n.markdown,attachments:n.attachments,timestamp:n.timestamp.toISOString()}))}function n8({open:e,onClose:n,onConfirm:r}){const[l,o]=x.useState(""),[u,c]=x.useState("");if(x.useEffect(()=>{e||(o(""),c(""))},[e]),x.useEffect(()=>{if(!e)return;const h=m=>{m.key==="Escape"&&n()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[e,n]),!e)return null;const f=()=>{(l.trim()||u.trim())&&r(l.trim(),u.trim())};return s.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":"设置身份",className:"fixed inset-0 z-50 flex items-center justify-center",onClick:n,children:[s.jsx("div",{className:"absolute inset-0",style:{background:"rgba(0,0,0,0.6)",backdropFilter:"blur(8px)"}}),s.jsxs("div",{className:"relative w-full max-w-sm mx-4 rounded-3xl border shadow-2xl animate-fade-in",style:{background:"var(--pc-bg-base)",borderColor:"var(--pc-border)"},onClick:h=>h.stopPropagation(),children:[s.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b",style:{borderColor:"var(--pc-border)"},children:[s.jsx("h2",{className:"text-sm font-semibold",style:{color:"var(--pc-text-primary)"},children:"设置你的AI助手"}),s.jsx("button",{onClick:n,className:"h-7 w-7 rounded-lg flex items-center justify-center transition-colors",style:{color:"var(--pc-text-muted)",background:"transparent",border:"none",cursor:"default"},onMouseEnter:h=>{h.currentTarget.style.color="var(--pc-text-primary)",h.currentTarget.style.background="var(--pc-hover)"},onMouseLeave:h=>{h.currentTarget.style.color="var(--pc-text-muted)",h.currentTarget.style.background="transparent"},"aria-label":"关闭",children:s.jsx(ma,{size:16})})]}),s.jsxs("div",{className:"px-5 py-4 space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"text-xs mb-1.5 block",style:{color:"var(--pc-text-secondary)"},children:"给你的AI助手起个名字"}),s.jsx("input",{type:"text",value:l,onChange:h=>o(h.target.value),placeholder:"例如：小K、小智、助手",className:"w-full px-3 py-2 rounded-xl border text-sm transition-all",style:{background:"var(--pc-bg-input)",borderColor:"var(--pc-border)",color:"var(--pc-text-primary)"},autoFocus:!0})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs mb-1.5 block",style:{color:"var(--pc-text-secondary)"},children:"描述它的角色（可选）"}),s.jsx("textarea",{value:u,onChange:h=>c(h.target.value),placeholder:"例���：专业的编程助手，擅长代码优化和Debug",rows:2,className:"w-full px-3 py-2 rounded-xl border text-sm transition-all resize-none",style:{background:"var(--pc-bg-input)",borderColor:"var(--pc-border)",color:"var(--pc-text-primary)"}})]}),s.jsx("button",{onClick:f,className:"w-full py-2.5 rounded-xl font-medium text-sm transition-all",style:{background:"var(--pc-accent)",color:"white",border:"none",cursor:"default"},onMouseEnter:h=>{h.currentTarget.style.opacity="0.9"},onMouseLeave:h=>{h.currentTarget.style.opacity="1"},children:"确定"})]})]})]})}const a8="agent-chat",A0="kylinbot_agent_chat_",Tf="kylinbot_agent_selected_model_v1",M0=100,r8=300*1e3,l8=15*1024*1024,i8=40*1024*1024,o8="image/*,audio/*,video/*,*/*",ic=[["agent.light_suggestion_one","agent.light_suggestion_two","agent.light_suggestion_three"],["agent.light_suggestion_four","agent.light_suggestion_five","agent.light_suggestion_six"],["agent.light_suggestion_seven","agent.light_suggestion_eight","agent.light_suggestion_nine"]];function s8(){var e,n;try{const r=localStorage.getItem(Tf);if(!r)return{};const l=JSON.parse(r);return{model:((e=l.model)==null?void 0:e.trim())||void 0,provider:((n=l.provider)==null?void 0:n.trim())||void 0}}catch{return{}}}function c8(e){try{if(!e.model||!e.provider){localStorage.removeItem(Tf);return}localStorage.setItem(Tf,JSON.stringify(e))}catch{}}function oc(e,n){var c,f,h,m;const r=(c=e.provider)==null?void 0:c.trim().toLowerCase(),l=(f=e.model)==null?void 0:f.trim().toLowerCase(),o=(h=n.provider)==null?void 0:h.trim().toLowerCase(),u=(m=n.model)==null?void 0:m.trim().toLowerCase();return!!(r&&l&&r===o&&l===u)}function R0(e){return`${$e}/icons/${encodeURIComponent(e)}`}function u8({fileName:e,alt:n,className:r,style:l={}}){const u=e==="send_text_white.svg"?{...l,transform:"rotate(0deg)"}:l;return s.jsx("img",{src:R0(e),alt:n,className:r,style:u})}const sc={default:"rgba(0, 0, 0, 0.6)",hover:"#3790FA",pressed:"#2C73C8"};function d8({text:e,className:n,style:r}){const l=x.useRef(null),[o,u]=x.useState(!1),c=x.useCallback(()=>{const f=l.current;f&&u(f.scrollWidth>f.clientWidth)},[e]);return x.useLayoutEffect(()=>{c();const f=l.current;if(!f||typeof ResizeObserver>"u")return;const h=new ResizeObserver(()=>c());return h.observe(f),()=>h.disconnect()},[c,e]),s.jsx("span",{ref:l,className:n,style:r,title:o?e:void 0,children:e})}function f8({prompts:e,suggestionGroupIndex:n,disabled:r,onSelect:l}){const[o,u]=x.useState(!1),[c,f]=x.useState(null),[h,m]=x.useState(null);x.useEffect(()=>{f(null),m(null)},[n]);const y=!r&&(o||c!==null||h!==null);return s.jsx("div",{className:"w-full min-h-[140px] rounded-lg",style:{boxSizing:"border-box",borderWidth:1,borderStyle:"solid",borderColor:y?"rgba(0, 0, 0, 0.1)":"transparent",background:"transparent"},onMouseEnter:()=>{r||u(!0)},onMouseLeave:()=>{u(!1),f(null),m(null)},children:s.jsxs("div",{className:"relative min-h-[138px] w-full overflow-hidden rounded-[8px]",children:[s.jsx("div",{className:"pointer-events-none absolute inset-0 z-0 rounded-[8px] bg-white"}),s.jsx("div",{className:"pointer-events-none absolute inset-0 z-[1] rounded-[8px]",style:{opacity:.05,background:"linear-gradient(90deg, #6135FF 0%, #355DFF 100%)"}}),s.jsxs("div",{className:"relative z-[2] pt-4",children:[s.jsxs("div",{className:"flex h-4 items-center gap-2 px-4",children:[s.jsx("img",{src:R0("ask.svg"),alt:"",className:"h-4 w-4 shrink-0"}),s.jsx("span",{className:"text-[14px] font-semibold leading-4",style:{color:"#1A1A1A"},children:S("agent.light_card_recommended")})]}),s.jsx("div",{className:"flex flex-col gap-2 pb-4 pl-5 pr-4 pt-2",children:e.map((g,_)=>{const j=r?sc.default:h===_?sc.pressed:c===_?sc.hover:sc.default;return s.jsx("div",{className:"flex h-5 items-center",children:s.jsxs("button",{type:"button",disabled:r,className:"flex h-5 w-full min-w-0 items-center gap-2 bg-transparent text-left disabled:cursor-not-allowed disabled:opacity-50",onMouseEnter:()=>{r||f(_)},onMouseLeave:()=>{f(T=>T===_?null:T),m(T=>T===_?null:T)},onMouseDown:()=>{r||m(_)},onMouseUp:()=>{m(T=>T===_?null:T)},onClick:()=>l(g),children:[s.jsx("span",{"aria-hidden":"true",className:"shrink-0 rounded-[2px]",style:{width:4,height:4,backgroundColor:j}}),s.jsx(d8,{text:g,className:"min-w-0 flex-1 truncate text-[13px] leading-5",style:{color:j}})]})},`${n}-${_}-${g}`)})})]})]})})}function D0(){return`${A0}${_f()}`}function h8(e,n){return n?e.getTime()-n.getTime()>=r8:!0}function m8(e,n=new Date){const r=e.getFullYear()===n.getFullYear(),l=new Date(n.getFullYear(),n.getMonth(),n.getDate()),o=new Date(l);o.setDate(l.getDate()-1);const u=new Date(l);u.setDate(l.getDate()-6);const c=e.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit",hour12:!1});if(e>=l)return c;if(e>=o)return`${S("chat.yesterday")} ${c}`;if(e>=u)return`${[S("chat.weekday.sun"),S("chat.weekday.mon"),S("chat.weekday.tue"),S("chat.weekday.wed"),S("chat.weekday.thu"),S("chat.weekday.fri"),S("chat.weekday.sat")][e.getDay()]} ${c}`;const f=e.getMonth()+1,h=e.getDate(),m=e.getFullYear();return`${r?S("chat.date.month_day").replace("{m}",String(f)).replace("{d}",String(h)):S("chat.date.year_month_day").replace("{y}",String(m)).replace("{m}",String(f)).replace("{d}",String(h))} ${c}`}function rl(e){return e.length<=M0?e:e.slice(e.length-M0)}function p8(e){return e?e.startsWith("image/")?"image":e.startsWith("audio/")?"audio":e.startsWith("video/")?"video":"file":"file"}function g8(e){return new Promise((n,r)=>{const l=new FileReader;l.onload=()=>{typeof l.result=="string"?n(l.result):r(new Error("Failed to read file"))},l.onerror=()=>{var o;return r((o=l.error)!=null?o:new Error("Failed to read file"))},l.readAsDataURL(e)})}function y8(){try{const e=sessionStorage.getItem(D0());if(!e)return[];const n=JSON.parse(e);return rl(n.map(r=>{var l;return{...r,kind:(l=r.kind)!=null?l:"text",timestamp:new Date(r.timestamp)}}))}catch{return[]}}function b8(e){try{sessionStorage.setItem(D0(),JSON.stringify(rl(e)))}catch{}}function L0(e){return e.filter(n=>n.kind!=="event"&&typeof n.content=="string")}function z0(e){var o;if(e.name&&e.name.trim())return e.name.trim();const n=(o=e.content)==null?void 0:o.trim();if(!n)return"tool";const r=n.match(/`([^`]+)`/);if(r!=null&&r[1])return r[1];const l=n.match(/^Running\s+([A-Za-z0-9_.-]+)/i);return l!=null&&l[1]?l[1]:"tool"}function x8(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Vl(e){return typeof e=="string"&&e.trim()?e:void 0}function v8(e){var l,o,u,c,f,h,m,y,g,_,v;const n=(l=e.event_type)==null?void 0:l.trim().toLowerCase(),r=x8(e.payload);return n==="tool_call_start"?{...e,type:"tool_call",name:(c=(u=(o=e.name)!=null?o:e.tool)!=null?u:Vl(r==null?void 0:r.tool))!=null?c:Vl(r==null?void 0:r.name),args:(h=(f=e.args)!=null?f:r==null?void 0:r.arguments)!=null?h:r==null?void 0:r.args}:n==="tool_call_result"?{...e,type:"tool_result",name:(g=(y=(m=e.name)!=null?m:e.tool)!=null?y:Vl(r==null?void 0:r.tool))!=null?g:Vl(r==null?void 0:r.name),output:(v=(_=e.output)!=null?_:Vl(r==null?void 0:r.output))!=null?v:Vl(r==null?void 0:r.content)}:e}function _8(e){return e.toLowerCase()==="llm"?"LLM":e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function w8(e){const n=e.trim().toLowerCase();return n?n==="tool_call"||n==="tool_call_start"||n==="tool_result"||n==="tool_call_result"?"Tool":n==="llm_request"||n==="llm_response"?"LLM":n.replace(/^(web_|ws_)/,"").replace(/_(start|end|request|response|call|result|event)$/,"").split(/[_\-.]+/).filter(Boolean).map(_8).join(" "):"Event"}function k8(e){var r,l,o;const n=(o=(l=(r=e.event_type)!=null?r:e.type)!=null?l:e.name)!=null?o:z0(e);return w8(n)}function O0(e){return JSON.stringify(e,null,2)}function S8(e){var n,r,l,o;switch(e.type){case"tool_call":case"tool_result":return(n=e.name)!=null?n:z0(e);case"approval_request":case"approval_restored":return(r=e.tool_name)!=null?r:"tool";case"approval_resolved":return e.decision?`decision: ${e.decision}`:void 0;case"approval_expired":return(o=(l=e.request_id)!=null?l:e.message_id)!=null?o:void 0;default:return}}function C8(e){switch(e.type){case"approval_request":case"approval_restored":case"approval_resolved":case"approval_expired":return!0;default:return!1}}function j8(){var Wt;const e=x.useRef(_f()),{registerNewSessionHandler:n}=xy(),r=jk(),{draft:l,saveDraft:o,clearDraft:u}=jT(a8),{resolvedTheme:c}=Fs(),f=c==="light",[h,m]=x.useState(()=>y8()),y=x.useRef(h);y.current=h;const[g,_]=x.useState(0),[v,w]=x.useState(!1),[j,T]=x.useState(l),[C,E]=x.useState(!1),[N,D]=x.useState(!1),[F,M]=x.useState(null),[A,U]=x.useState(null),[I,L]=x.useState([]),[B,q]=x.useState(),[K,G]=x.useState(),[ne,V]=x.useState(new Set),[le,me]=x.useState(0),O=((Wt=ic[le%ic.length])!=null?Wt:ic[0]).map($=>S($)),H=x.useRef(null),Z=x.useRef(!1),z=x.useRef(null),oe=x.useRef(null),ue=x.useRef(null),ve=x.useRef(null),[Se,Te]=x.useState(null),re=x.useRef(""),ke=x.useRef(""),Ze=x.useRef([]),Fe=x.useRef(""),[Mt,vt]=x.useState(""),[hn,Yt]=x.useState(""),[Ma,Ln]=x.useState(!1),[Rt,bn]=x.useState(()=>{try{return localStorage.getItem("kylinbot_identity_setup_done")==="true"}catch{return!1}}),[Wn,sn]=x.useState(null),ya=x.useRef(null),[tt,xn]=x.useState(!1),[te,pe]=x.useState([]),[je,Re]=x.useState(!1),[de,Ve]=x.useState(null),[lt,bt]=x.useState(null),[it,St]=x.useState(!1),Ie=x.useCallback(()=>{var $;if(C&&(($=H.current)!=null&&$.connected))try{H.current.cancel()}catch{}re.current="",ke.current="",Fe.current="",vt(""),Yt(""),E(!1),Z.current=!0,_(ge=>ge+1)},[C]),cn=x.useCallback(async()=>{Re(!0);try{const $=await jf();pe($.map(ge=>{var be;return{...ge,description:(be=ge.description)!=null?be:S("agent.model_selector_configured")}}))}finally{Re(!1)}},[]),Kt=x.useCallback(async $=>{var ge;if(!(it||!N)){xn(!1),St(!0);try{const be=$.provider==="custom"&&((ge=$.baseUrl)!=null&&ge.trim())?`custom:${$.baseUrl.trim()}`:$.provider;await C0({provider:be,model:$.value}),G(be),q($.value),Ie()}catch{Z.current=!1,St(!1),M(S("agent.send_error"))}}},[N,it,Ie]),wr=x.useCallback(async()=>{if(tt){xn(!1);return}xn(!0),await cn()},[tt,cn]),zn=x.useCallback($=>{var be;if(!B)return!1;if(K&&B===$.value&&K===$.provider)return!0;const ge=te.filter(_e=>_e.value===B);return ge.length===1&&((be=ge[0])==null?void 0:be.provider)===$.provider},[te,B,K]),Xn=x.useMemo(()=>{var ge,be,_e;const $=(be=(ge=te.find(ht=>ht.value===B&&(K?ht.provider===K:!0)))==null?void 0:ge.label)!=null?be:null;return $||((_e=te[0])!=null&&_e.label?te[0].label:B||S("agent.model_selector_title"))},[te,B,K]),Jn=Wr(),Et=r==null?void 0:r.setAgentGenerating;x.useEffect(()=>{let $=!1;const ge=()=>{jf().then(_e=>{$||sn(_e.length)}).catch(()=>{$||sn(null)})};ge();const be=()=>ge();return window.addEventListener(nl,be),()=>{$=!0,window.removeEventListener(nl,be)}},[]),x.useEffect(()=>{o(j)},[j,o]),x.useEffect(()=>{Et==null||Et(C)},[C,Et]),x.useEffect(()=>()=>{Et==null||Et(!1)},[Et]),x.useEffect(()=>{const $=s8();$.model&&$.provider&&(q($.model),G($.provider)),Ls().then(ge=>{!$.model&&ge.model&&q(ge.model),!$.provider&&ge.provider&&G(ge.provider)}).catch(()=>{})},[]),x.useEffect(()=>{c8({model:B,provider:K})},[B,K]);const Zn=x.useCallback($=>{const ge={provider:K,model:B};if($.action==="delete"&&$.original){if(!oc(ge,$.original))return;$.current?(G($.current.provider),q($.current.model)):(G(void 0),q(void 0)),N&&Ie();return}const be=$.original?oc(ge,{provider:$.original.provider,model:$.original.model}):!1,_e=$.current?oc(ge,{provider:$.current.provider,model:$.current.model}):!1;!be&&!_e||($.action==="update"&&$.current&&(oc(ge,{provider:$.current.provider,model:$.current.model})||(G($.current.provider),q($.current.model))),N&&Ie())},[N,B,K,Ie]);x.useEffect(()=>{const $=ge=>{const _e=ge.detail;if(_e){if(C){z.current=_e;return}Zn(_e)}};return window.addEventListener(nl,$),()=>window.removeEventListener(nl,$)},[C,Zn]),x.useEffect(()=>{if(C)return;const $=z.current;$&&(z.current=null,Zn($))},[C,Zn]),x.useEffect(()=>{if(!tt)return;const $=ge=>{ya.current&&!ya.current.contains(ge.target)&&xn(!1)};return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[tt]),x.useEffect(()=>(n(()=>{const ge=e.current;N0(ge,T0(L0(y.current)));try{sessionStorage.removeItem(`${A0}${ge}`)}catch{}e.current=wT(),m([]),T(""),u(),M(null),U(null),E(!1),re.current="",ke.current="",Fe.current="",vt(""),Yt(""),V(new Set),Te(null),w(!1),_(be=>be+1)}),()=>n(null)),[n,u]),x.useEffect(()=>{const $=e.current;let ge=!1;return(async()=>{try{const be=await E4($);if(ge)return;be.session_persistence&&be.messages.length>0?m(_e=>_e.length>0?_e:Nf(t8(be.messages))):be.session_persistence||m(_e=>{if(_e.length>0)return _e;const ht=E0($);return ht.length?Nf(ht):_e})}catch{ge||m(be=>{if(be.length>0)return be;const _e=E0($);return _e.length?Nf(_e):be})}finally{ge||w(!0)}})(),()=>{ge=!0}},[g]),x.useEffect(()=>{v&&N0(e.current,T0(L0(h)))},[h,v]),x.useEffect(()=>{const $=new ST,ge=be=>{C8(be)&&m(_e=>rl([..._e,{id:on(),role:"agent",kind:"event",eventTitle:k8(be),eventSummary:S8(be),eventPayload:be,timestamp:new Date}]))};return $.onOpen=()=>{D(!0),M(null),Z.current&&(Z.current=!1,St(!1))},$.onClose=be=>{D(!1),be.code!==1e3&&be.code!==1001&&M(`Connection closed unexpectedly (code: ${be.code}). Please check your configuration.`)},$.onError=()=>{M(S("agent.connection_error"))},$.onMessage=be=>{var ht,We,Ft,He,vn,_n,ta,Ct,So,Co;const _e=v8(be);switch(_e.type){case"connected":break;case"thinking":E(!0),ke.current+=(ht=_e.content)!=null?ht:"",Yt(ke.current);break;case"chunk":E(!0),re.current+=(We=_e.content)!=null?We:"",vt(re.current);break;case"chunk_reset":Fe.current=ke.current,re.current="",ke.current="",vt(""),Yt("");break;case"message":case"done":{const Dt=(He=(Ft=_e.full_response)!=null?Ft:_e.content)!=null?He:re.current,It=Fe.current||ke.current||void 0;Dt&&m(Da=>rl([...Da,{id:on(),role:"agent",content:Dt,thinking:It,markdown:!0,timestamp:new Date}])),re.current="",ke.current="",Fe.current="",vt(""),Yt(""),E(!1),g0();break}case"tool_call":{const Dt=(vn=_e.name)!=null?vn:"unknown",It=_e.args;m(Da=>{const Cr=JSON.stringify(It!=null?It:{});return Da.some(Ga=>{var On;return Ga.toolCall&&Ga.toolCall.output===void 0&&Ga.toolCall.name===Dt&&JSON.stringify((On=Ga.toolCall.args)!=null?On:{})===Cr})?Da:[...Da,{id:on(),role:"agent",content:`${S("agent.tool_call_prefix")} ${Dt}(${Cr})`,toolCall:{name:Dt,args:It},timestamp:new Date}]});break}case"approval_request":case"approval_restored":ge(_e),U({requestId:(ta=(_n=_e.request_id)!=null?_n:_e.message_id)!=null?ta:on(),toolName:(Ct=_e.tool_name)!=null?Ct:"tool",argumentsSummary:(So=_e.arguments_summary)!=null?So:"",expiresAt:typeof _e.expires_at=="number"?_e.expires_at:null,choices:(Co=_e.choices)!=null?Co:["yes","no","always"],submitting:!1}),E(!1);break;case"approval_resolved":ge(_e),U(null);break;case"approval_expired":ge(_e),U(null);break;case"message_cancelled":E(!1),re.current="",ke.current="",vt(""),Yt("");break;case"tool_result":{m(Dt=>{var Da,Cr,ri,Ga;const It=Dt.findIndex(On=>On.toolCall&&On.toolCall.output===void 0);if(It!==-1){const On=[...Dt],hl=Dt[It];return On[It]={...hl,toolCall:{...hl.toolCall,output:(Da=_e.output)!=null?Da:""}},On}return[...Dt,{id:on(),role:"agent",content:`${S("agent.tool_result_prefix")} ${(Cr=_e.output)!=null?Cr:""}`,toolCall:{name:(ri=_e.name)!=null?ri:"unknown",output:(Ga=_e.output)!=null?Ga:""},timestamp:new Date}]});break}case"error":m(Dt=>{var It;return rl([...Dt,{id:on(),role:"agent",content:`${S("agent.error_prefix")} ${(It=_e.message)!=null?It:S("agent.unknown_error")}`,timestamp:new Date}])}),_e.code==="AGENT_INIT_FAILED"||_e.code==="AUTH_ERROR"||_e.code==="PROVIDER_ERROR"?M(`Configuration error: ${_e.message}. Please check your provider settings (API key, model, etc.).`):(_e.code==="INVALID_JSON"||_e.code==="UNKNOWN_MESSAGE_TYPE"||_e.code==="EMPTY_CONTENT")&&M(`Message error: ${_e.message}`),E(!1),re.current="",ke.current="",vt(""),Yt("");break}},$.connect(),H.current=$,()=>{$.disconnect()}},[g]),x.useEffect(()=>{b8(h)},[h]),x.useEffect(()=>{Ze.current=I},[I]),x.useEffect(()=>()=>{Ze.current.forEach($=>{$.previewUrl&&URL.revokeObjectURL($.previewUrl)})},[]),x.useEffect(()=>{var $;($=oe.current)==null||$.scrollIntoView({behavior:"smooth"})},[h,C,Mt]);const ba=($,ge)=>{var ht;if(!$&&ge.length===0||!((ht=H.current)!=null&&ht.connected)||A)return!1;const be=ge.map(We=>({file_name:We.name,data_base64:We.dataBase64,mime_type:We.mimeType})),_e=ge.map(We=>({...We,previewUrl:void 0}));m(We=>rl([...We,{id:on(),role:"user",content:$,attachments:_e,timestamp:new Date}]));try{H.current.sendMessage($,be),E(!0),re.current="",ke.current="",ge.forEach(We=>{We.previewUrl&&URL.revokeObjectURL(We.previewUrl)}),ge.length>0&&L([]),M(null)}catch{return M(S("agent.send_error")),!1}return!0},kr=()=>{const $=j.trim();if(/^(你是谁|who.*are.*you|你是干什么的|你是什么|what.*are.*you)/i.test($)&&h.length===0&&!Rt){Ln(!0);return}if(Wn===0&&($||I.length>0)){m(be=>rl([...be,{id:on(),role:"user",content:$,attachments:I.map(_e=>({..._e,previewUrl:void 0})),timestamp:new Date},{id:on(),role:"agent",kind:"no-model-error",timestamp:new Date}])),I.forEach(be=>{be.previewUrl&&URL.revokeObjectURL(be.previewUrl)}),L([]),T(""),u(),ue.current&&(ue.current.style.height="auto",ue.current.focus());return}ba($,I)&&(T(""),u(),ue.current&&(ue.current.style.height="auto",ue.current.focus()))},Sr=()=>{var $;if(($=H.current)!=null&&$.connected)try{H.current.cancel()}catch{M(S("agent.send_error"))}},Ya=$=>{$.key!=="Enter"||$.nativeEvent.isComposing||$.shiftKey||$.ctrlKey||$.metaKey||($.preventDefault(),kr())},xa=$=>{T($.target.value),$.target.style.height="auto",$.target.style.height=`${Math.min($.target.scrollHeight,200)}px`},ai=()=>{var $;!N||A||($=ve.current)==null||$.click()},dl=$=>{L(ge=>{const be=ge.find(_e=>_e.id===$);return be!=null&&be.previewUrl&&URL.revokeObjectURL(be.previewUrl),ge.filter(_e=>_e.id!==$)})},fe=async $=>{var ht;const ge=Array.from((ht=$.target.files)!=null?ht:[]);if($.target.value="",ge.length===0)return;const be=I.reduce((We,Ft)=>{const He=Math.floor(Ft.dataBase64.length*3/4);return We+He},0),_e=ge.reduce((We,Ft)=>We+Ft.size,0);if(be+_e>i8){M(S("chat.attachment_too_large"));return}for(const We of ge)if(We.size>l8){M(S("chat.file_too_large").replace("{name}",We.name));return}try{const We=await Promise.all(ge.map(async Ft=>{var Ct;const vn=(Ct=(await g8(Ft)).split(",")[1])!=null?Ct:"",_n=Ft.type||void 0,ta=p8(_n);return{id:on(),name:Ft.name,mimeType:_n,kind:ta,dataBase64:vn,previewUrl:ta==="image"?URL.createObjectURL(Ft):void 0}}));L(Ft=>[...Ft,...We]),M(null)}catch{M(S("chat.read_attachment_failed"))}},Le=$=>{const ge=$.trim();ba(ge,[])&&(T(""),u(),ue.current&&(ue.current.style.height="auto",ue.current.focus()))},Qe=()=>{me($=>($+1)%ic.length)},ea=($,ge)=>{var be;if((be=H.current)!=null&&be.connected)try{H.current.sendJson({type:"set_identity",name:$||void 0,role:ge||void 0}),Ln(!1),bn(!0);try{localStorage.setItem("kylinbot_identity_setup_done","true")}catch{}}catch{M(S("agent.send_error"))}},fl=$=>{var ge;if(!(!A||!((ge=H.current)!=null&&ge.connected))){U(be=>be&&{...be,submitting:!0});try{H.current.sendApprovalResponse(A.requestId,$)}catch{U(be=>be&&{...be,submitting:!1}),M(S("agent.send_error"))}}},ko=x.useCallback(($,ge)=>{var _e;const be=()=>{Te($),setTimeout(()=>Te(ht=>ht===$?null:ht),2e3)};(_e=navigator.clipboard)!=null&&_e.writeText?navigator.clipboard.writeText(ge).then(be).catch(()=>{Bt(ge)&&be()}):Bt(ge)&&be()},[]),Ra=x.useCallback($=>{V(ge=>{const be=new Set(ge);return be.has($)?be.delete($):be.add($),be})},[]);function Bt($){const ge=document.createElement("textarea");ge.value=$,ge.style.position="fixed",ge.style.opacity="0",document.body.appendChild(ge),ge.select();try{return document.execCommand("copy"),!0}catch{return!1}finally{document.body.removeChild(ge)}}return s.jsxs("div",{className:"flex flex-col h-[calc(100vh-3.5rem)] overflow-hidden",children:[F&&s.jsxs("div",{className:"px-4 py-2 border-b flex items-center gap-2 text-sm animate-fade-in",style:{background:"rgba(239, 68, 68, 0.08)",borderColor:"rgba(239, 68, 68, 0.2)",color:"#f87171"},children:[s.jsx(GS,{className:"h-4 w-4 shrink-0"}),F]}),s.jsxs("div",{className:`flex-1 overflow-y-auto space-y-4 ${f?"px-8 pb-8 pt-10 md:px-12":"p-4"}`,children:[h.length===0&&(f?s.jsxs("div",{"data-testid":"agent-light-welcome",className:"mx-auto flex w-full max-w-5xl flex-col items-center text-center animate-fade-in",style:{color:"var(--pc-text-muted)"},children:[s.jsx("div",{className:"mt-2 flex h-12 w-12 shrink-0 items-center justify-center overflow-hidden rounded-full leading-none",children:s.jsx("img",{src:`${$e}/kylin-ai-assistant.png`,alt:"KylinBot",className:"block h-full w-full object-contain",onError:$=>{$.currentTarget.style.display="none"}})}),s.jsx("p",{className:"mt-3 text-[20px] font-semibold tracking-[-0.02em]",style:{color:"var(--pc-text-primary)"},children:S("agent.light_greeting_title")}),s.jsx("p",{className:"mt-2 max-w-3xl text-[13px] leading-[1.95]",style:{color:"var(--pc-text-muted)"},children:S("agent.light_greeting_subtitle")}),s.jsxs("div",{className:"mt-6 flex w-full items-center justify-between px-1 text-[13px]",style:{color:"var(--pc-text-secondary)"},children:[s.jsx("span",{children:S("agent.light_try_label")}),s.jsx("button",{type:"button",className:"text-[12px] font-medium",style:{color:"#3790FA"},onClick:Qe,children:S("agent.light_refresh_label")})]}),s.jsx("div",{"data-testid":"agent-light-suggestions",className:"mt-3 w-full",children:s.jsx(f8,{prompts:O,suggestionGroupIndex:le,disabled:!N||!!A,onSelect:Le})})]}):s.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center animate-fade-in",style:{color:"var(--pc-text-muted)"},children:[s.jsx("div",{className:"h-16 w-16 rounded-3xl flex items-center justify-center mb-4 animate-float",style:{background:"var(--pc-accent-glow)"},children:s.jsx(hr,{className:"h-8 w-8",style:{color:"var(--pc-accent)"}})}),s.jsx("p",{className:"text-lg font-semibold mb-1",style:{color:"var(--pc-text-primary)"},children:"KylinBot Agent"}),s.jsx("p",{className:"text-sm",style:{color:"var(--pc-text-muted)"},children:S("agent.start_conversation")})]})),h.map(($,ge)=>{var _e,ht,We,Ft;const be=ge>0?(_e=h[ge-1])==null?void 0:_e.timestamp:void 0;return s.jsxs("div",{children:[h8($.timestamp,be)&&s.jsx("div",{className:"flex justify-center py-2",style:{color:f?"#b0b4bc":"var(--pc-text-faint)"},children:s.jsx("span",{className:`${f?"text-[12px]":"text-[11px]"}`,children:m8($.timestamp)})}),s.jsxs("div",{className:`group flex items-start gap-3 ${$.role==="user"?"flex-row-reverse animate-slide-in-right":"animate-slide-in-left"}`,style:{animationDelay:`${Math.min(ge*30,200)}ms`},children:[s.jsx("div",{className:`flex-shrink-0 flex items-center justify-center border ${f?"w-8 h-8 rounded-[12px]":"w-9 h-9 rounded-2xl"}`,style:{background:$.role==="user"?f?"#ffffff":"var(--pc-accent)":"var(--pc-bg-elevated)",borderColor:$.role==="user"?f?"#d9dde5":"var(--pc-accent)":"var(--pc-border)"},children:$.role==="user"?s.jsx(kC,{className:"h-4 w-4",style:{color:f?"#9097a3":"#ffffff"}}):s.jsx(hr,{className:"h-4 w-4",style:{color:"var(--pc-accent)"}})}),s.jsxs("div",{className:`relative ${f?"max-w-[78%]":"max-w-[75%]"}`,children:[s.jsxs("div",{className:`${f?"rounded-[8px] px-[14px] py-[11px]":"rounded-2xl px-4 py-3"} border`,style:$.role==="user"?{background:f?"#cfeeff":"var(--pc-accent-glow)",borderColor:f?"#c7e7fb":"var(--pc-accent-dim)",color:f?"#1f2d3d":"var(--pc-text-primary)"}:{background:f?"#ffffff":"var(--pc-bg-elevated)",borderColor:f?"#ececf1":"var(--pc-border)",color:"var(--pc-text-primary)",boxShadow:f?"0 1px 2px rgba(39, 47, 61, 0.05)":"none"},children:[$.role==="agent"&&$.kind!=="event"&&$.thinking&&s.jsxs("details",{className:"mb-2",children:[s.jsx("summary",{className:"text-xs select-none",style:{color:"var(--pc-text-muted)"},children:"Thinking"}),s.jsx("pre",{className:"text-xs mt-1 whitespace-pre-wrap break-words leading-relaxed overflow-auto max-h-60 p-2 rounded-lg",style:{color:"var(--pc-text-muted)",background:"var(--pc-bg-surface)"},children:$.thinking})]}),$.toolCall?s.jsx(RT,{toolCall:$.toolCall}):$.role==="agent"&&$.kind==="no-model-error"?s.jsxs("div",{className:"text-sm space-y-2",children:[s.jsx("p",{className:"text-sm leading-relaxed",style:{color:"var(--color-status-error)"},children:S("model.no_models_chat_prompt")}),s.jsx("div",{className:"flex justify-end",children:s.jsx("button",{type:"button",onClick:()=>Jn("/model"),className:"text-xs",style:{color:"#3B82F6",background:"transparent",border:"none",cursor:"default",padding:0,textDecoration:"underline"},children:S("model.no_models_chat_action")})}),s.jsx("div",{className:"text-[10px] text-right",style:{color:"var(--pc-text-faint)"},children:"由AI助手生成"})]}):$.role==="agent"&&$.kind==="event"&&$.eventPayload?s.jsxs("div",{className:"text-sm",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("button",{type:"button",onClick:()=>Ra($.id),"aria-label":ne.has($.id)?S("agent.hide_json"):S("agent.show_json"),className:"inline-flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-lg border transition-colors",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg)",color:"var(--pc-text-muted)"},onMouseEnter:He=>{He.currentTarget.style.borderColor="var(--pc-accent-dim)",He.currentTarget.style.color="var(--pc-text-primary)"},onMouseLeave:He=>{He.currentTarget.style.borderColor="var(--pc-border)",He.currentTarget.style.color="var(--pc-text-muted)"},children:ne.has($.id)?s.jsx(ha,{className:"h-3.5 w-3.5"}):s.jsx(ws,{className:"h-3.5 w-3.5"})}),s.jsx("p",{className:"break-words text-[13px] font-semibold",style:{color:"var(--pc-text-primary)"},children:(ht=$.eventTitle)!=null?ht:"Event"}),$.eventSummary&&s.jsx("p",{className:"break-words rounded-md border px-2 py-0.5 text-[11px]",style:{color:"var(--pc-text-muted)",borderColor:"var(--pc-border)",background:"var(--pc-bg)"},children:$.eventSummary})]}),ne.has($.id)&&s.jsx("pre",{className:"mt-3 overflow-x-auto rounded-xl border p-3 text-[12px] leading-6",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg)",color:"var(--pc-text-secondary)"},children:O0($.eventPayload)})]}):$.role==="agent"&&$.markdown?s.jsx("div",{"data-testid":"chat-markdown",className:`${f?"text-[14px] leading-[1.45]":"text-sm leading-relaxed"} break-words chat-markdown`,children:s.jsx(Bb,{remarkPlugins:[m0],children:(We=$.content)!=null?We:""})}):$.role==="agent"?s.jsx("p",{className:`${f?"text-[14px] leading-[1.45]":"text-sm leading-relaxed"} whitespace-pre-wrap break-words`,children:(Ft=$.content)!=null?Ft:""}):s.jsxs("div",{className:"space-y-2",children:[$.content&&s.jsx("p",{className:`${f?"text-[14px] leading-[1.45]":"text-sm leading-relaxed"} whitespace-pre-wrap break-words`,children:$.content}),$.attachments&&$.attachments.length>0&&s.jsx("div",{className:"flex flex-wrap gap-2",children:$.attachments.map(He=>{var vn,_n;return He.kind==="image"?s.jsx("img",{src:(_n=He.previewUrl)!=null?_n:`data:${(vn=He.mimeType)!=null?vn:"image/*"};base64,${He.dataBase64}`,alt:He.name,className:"h-[88px] w-[88px] rounded-[10px] border object-cover",style:{borderColor:"rgba(80, 104, 127, 0.2)"}},He.id):s.jsx("div",{className:"max-w-[240px] rounded-[10px] border px-2 py-1 text-[12px] truncate",style:{borderColor:"rgba(80, 104, 127, 0.2)",background:"rgba(255, 255, 255, 0.45)"},title:He.name,children:He.name},He.id)})})]})]}),s.jsx("button",{onClick:()=>{var He;return ko($.id,$.kind==="event"&&$.eventPayload?O0($.eventPayload):(He=$.content)!=null?He:"")},"aria-label":S("agent.copy_message"),className:"absolute top-1 right-1 opacity-0 group-hover:opacity-100 transition-all p-1.5 rounded-xl",style:{background:"var(--pc-bg-elevated)",border:"1px solid var(--pc-border)",color:"var(--pc-text-muted)"},onMouseEnter:He=>{He.currentTarget.style.color="var(--pc-text-primary)",He.currentTarget.style.borderColor="var(--pc-accent-dim)"},onMouseLeave:He=>{He.currentTarget.style.color="var(--pc-text-muted)",He.currentTarget.style.borderColor="var(--pc-border)"},children:Se===$.id?s.jsx(Pi,{className:"h-3 w-3",style:{color:"#34d399"}}):s.jsx(KS,{className:"h-3 w-3"})})]})]})]},$.id)}),C&&s.jsxs("div",{className:"flex items-start gap-3 animate-fade-in",children:[s.jsx("div",{className:"flex-shrink-0 w-9 h-9 rounded-2xl flex items-center justify-center border",style:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)"},children:s.jsx(hr,{className:"h-4 w-4",style:{color:"var(--pc-accent)"}})}),Mt||hn?s.jsxs("div",{className:"rounded-2xl px-4 py-3 border max-w-[75%]",style:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)",color:"var(--pc-text-primary)"},children:[hn&&s.jsxs("details",{className:"mb-2",open:!Mt,children:[s.jsxs("summary",{className:"text-xs select-none",style:{color:"var(--pc-text-muted)"},children:["Thinking",!Mt&&"..."]}),s.jsx("pre",{className:"text-xs mt-1 whitespace-pre-wrap break-words leading-relaxed overflow-auto max-h-60 p-2 rounded-lg",style:{color:"var(--pc-text-muted)",background:"var(--pc-bg-surface)"},children:hn})]}),Mt&&s.jsx("div",{className:"text-sm break-words chat-markdown leading-relaxed",children:s.jsx(Bb,{remarkPlugins:[m0],children:Mt})})]}):s.jsxs("div",{className:"rounded-2xl px-4 py-3 border flex items-center gap-1.5",style:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)"},children:[s.jsx("span",{className:"bounce-dot w-1.5 h-1.5 rounded-full",style:{background:"var(--pc-accent)"}}),s.jsx("span",{className:"bounce-dot w-1.5 h-1.5 rounded-full",style:{background:"var(--pc-accent)"}}),s.jsx("span",{className:"bounce-dot w-1.5 h-1.5 rounded-full",style:{background:"var(--pc-accent)"}})]})]}),A&&s.jsx("div",{className:"rounded-2xl border p-4 max-w-3xl mx-auto animate-fade-in",style:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-accent-dim)"},children:s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-xs uppercase tracking-[0.18em]",style:{color:"var(--pc-accent)"},children:"Approval Required"}),s.jsx("p",{className:"mt-1 text-sm font-semibold",style:{color:"var(--pc-text-primary)"},children:A.toolName}),A.argumentsSummary&&s.jsx("p",{className:"mt-2 text-sm leading-relaxed",style:{color:"var(--pc-text-muted)"},children:A.argumentsSummary}),A.expiresAt&&s.jsxs("p",{className:"mt-2 text-[11px]",style:{color:"var(--pc-text-faint)"},children:["Expires at ",new Date(A.expiresAt*1e3).toLocaleTimeString()]})]}),s.jsxs("div",{className:"flex flex-col gap-2 min-w-[150px]",children:[A.choices.includes("yes")&&s.jsx("button",{type:"button",onClick:()=>fl("yes"),disabled:A.submitting,className:"btn-electric rounded-xl px-3 py-2 text-sm",style:{color:"white"},children:"Allow Once"}),A.choices.includes("always")&&s.jsx("button",{type:"button",onClick:()=>fl("always"),disabled:A.submitting,className:"rounded-xl px-3 py-2 text-sm border",style:{borderColor:"var(--pc-accent-dim)",color:"var(--pc-text-primary)",background:"var(--pc-bg)"},children:"Always This Session"}),A.choices.includes("no")&&s.jsx("button",{type:"button",onClick:()=>fl("no"),disabled:A.submitting,className:"rounded-xl px-3 py-2 text-sm border",style:{borderColor:"rgba(239, 68, 68, 0.3)",color:"#fca5a5",background:"rgba(239, 68, 68, 0.08)"},children:"Deny"})]})]})}),s.jsx("div",{ref:oe})]}),s.jsx("div",{className:f?"px-4 pb-1 pt-2 md:px-6":"border-t p-4",style:f?void 0:{borderColor:"var(--pc-border)",background:"var(--pc-bg-surface)"},children:s.jsxs("div",{"data-testid":f?"agent-light-composer-shell":void 0,className:`mx-auto ${f?"agent-light-composer-shell max-w-5xl rounded-[14px] px-[10px] pb-[6px] pt-[8px]":"max-w-4xl"}`,style:f?{background:"#F6F6F6"}:void 0,children:[s.jsxs("div",{className:f?"flex flex-col gap-2":"flex items-center gap-3",children:[s.jsx("input",{ref:ve,type:"file",multiple:!0,accept:o8,className:"hidden",onChange:fe}),f?s.jsx("div",{className:"relative",children:s.jsx("textarea",{ref:ue,rows:1,value:j,onChange:xa,onKeyDown:Ya,placeholder:S(N?"agent.light_type_message":"agent.connecting"),disabled:!N||!!A,className:"w-full resize-none border-0 px-1 pr-10 text-[14px] outline-none disabled:opacity-40",style:{minHeight:"44px",maxHeight:"200px",paddingTop:"1px",paddingBottom:"0",color:"var(--pc-text-primary)",lineHeight:"1.55",background:"transparent"}})}):s.jsx("textarea",{ref:ue,rows:1,value:j,onChange:xa,onKeyDown:Ya,placeholder:S(N?"agent.type_message":"agent.connecting"),disabled:!N||!!A,className:"input-electric flex-1 px-4 text-sm resize-none disabled:opacity-40",style:{minHeight:"44px",maxHeight:"200px",paddingTop:"10px",paddingBottom:"10px"}}),I.length>0&&s.jsx("div",{className:"flex flex-wrap items-center gap-2 px-1",children:I.map($=>s.jsxs("div",{className:`group relative border ${$.kind==="image"?"h-[54px] w-[54px] overflow-hidden rounded-[10px]":"flex max-w-[260px] items-center gap-2 rounded-[10px] px-2 py-1.5"}`,style:{borderColor:"#d8dde6",background:"#f7f9fc"},children:[$.kind==="image"?s.jsx("img",{src:$.previewUrl,alt:$.name,className:"h-full w-full object-cover"}):s.jsx("span",{className:"truncate text-[12px] leading-4",style:{color:"#4d5057"},children:$.name}),s.jsx("button",{type:"button",onClick:()=>dl($.id),className:"absolute right-1 top-1 inline-flex h-4 w-4 items-center justify-center rounded-full border bg-white",style:{borderColor:"#c8cfda",color:"#586171"},"aria-label":S("chat.remove_attachment").replace("{name}",$.name),children:s.jsx(ma,{className:"h-3 w-3"})})]},$.id))}),f?s.jsxs("div",{className:"flex items-center justify-between gap-4 pt-[9px]",children:[s.jsx("div",{className:"flex flex-wrap items-center gap-[14px] text-[12px]",style:{color:"#4d5057"},children:s.jsxs("div",{className:"relative",ref:ya,children:[s.jsxs("button",{type:"button",onClick:()=>void wr(),disabled:!N||it,className:"inline-flex items-center gap-1 text-[12px] leading-none transition-all disabled:opacity-40 h-[36px] w-auto px-2 rounded-lg",style:{color:"#262626",background:tt?"rgba(0, 0, 0, 0.08)":"rgba(0, 0, 0, 0.03)"},onMouseEnter:$=>{tt||($.currentTarget.style.background="rgba(0, 0, 0, 0.05)")},onMouseLeave:$=>{tt||($.currentTarget.style.background="rgba(0, 0, 0, 0.03)")},children:[s.jsx(hr,{className:"h-4 w-4 opacity-[0.86] flex-shrink-0"}),s.jsx("span",{className:"max-w-[208px] truncate",children:Xn}),s.jsx(ha,{className:"h-4 w-4 opacity-60 transition-transform flex-shrink-0",style:{transform:tt?"rotate(180deg)":"none"}})]}),tt&&s.jsx("div",{className:"absolute bottom-full left-0 mb-2 rounded-lg overflow-hidden animate-fade-in",style:{width:"290px",background:"#FFFFFF",border:"1px solid rgba(0, 0, 0, 0.1)",borderRadius:"8px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.2)",zIndex:9999,maxHeight:"378px"},children:s.jsx("div",{className:"overflow-y-auto",style:{maxHeight:"376px"},children:s.jsxs("div",{className:"py-[7px] px-1",children:[te.length>0&&s.jsxs("div",{className:"space-y-[2px]",children:[s.jsx("div",{className:"py-1.5 text-[10px] font-semibold uppercase tracking-wider",style:{color:"rgba(0, 0, 0, 0.35)",paddingLeft:"32px"},children:S("agent.model_selector_configured")}),te.map($=>{const ge=zn($),be=`configured-${$.provider}-${$.value}`,_e=de===be,ht=lt===be,We=_e||ht;return s.jsxs("button",{type:"button",onClick:()=>void Kt($),onMouseDown:()=>Ve(be),onMouseUp:()=>Ve(null),onMouseEnter:()=>bt(be),onMouseLeave:()=>{bt(null),Ve(null)},className:"w-full text-left flex items-center gap-2 transition-colors",style:{height:"36px",borderRadius:"6px",padding:"0 8px",background:_e?"rgba(44, 115, 200, 1)":ht?"rgba(55, 144, 250, 1)":"transparent"},children:[s.jsx("div",{className:"w-4 h-4 flex-shrink-0 flex items-center justify-center",style:{opacity:ge?1:0},children:s.jsx(Pi,{className:"h-4 w-4",style:{color:We?"#FFFFFF":"currentColor"}})}),s.jsx(hr,{className:"h-4 w-4 flex-shrink-0",style:{color:We?"#FFFFFF":"currentColor"}}),s.jsx("span",{className:"model-label text-[13px] font-medium truncate flex-1",style:{color:We?"#FFFFFF":"rgba(0, 0, 0, 0.85)"},children:$.label})]},be)})]}),je&&te.length===0&&s.jsx("div",{className:"px-4 py-3 text-[12px]",style:{color:"rgba(0, 0, 0, 0.35)"},children:S("common.loading")}),!je&&te.length===0&&s.jsx("div",{className:"px-4 py-3 text-[12px]",style:{color:"rgba(0, 0, 0, 0.35)"},children:S("agent.model_selector_no_configured")})]})})})]})}),s.jsxs("div",{className:"flex items-center gap-[10px]",children:[s.jsx("div",{className:"flex items-center justify-center",style:{width:"32px",height:"32px",borderRadius:"6px",background:"transparent",border:"none",cursor:"default"},onClick:ai,onMouseEnter:$=>{$.currentTarget.style.background="#DCDCDC"},onMouseLeave:$=>{$.currentTarget.style.background="transparent"},onMouseDown:$=>{$.currentTarget.style.background="#B9B9B9"},onMouseUp:$=>{$.currentTarget.style.background="#DCDCDC"},children:s.jsx(uC,{className:"h-4 w-4",style:{color:"#5c6067"},strokeWidth:1.9})}),C?s.jsx("button",{type:"button",onClick:Sr,disabled:!N,className:"flex h-[32px] w-[32px] items-center justify-center transition-colors",style:{borderRadius:"6px",background:N?"#3790FA":"rgba(55, 144, 250, 0.45)"},"aria-label":"Stop generating",onMouseEnter:$=>{N&&($.currentTarget.style.background="#3489EE")},onMouseLeave:$=>{$.currentTarget.style.background=N?"#3790FA":"rgba(55, 144, 250, 0.45)"},onMouseDown:$=>{N&&($.currentTarget.style.background="#2C73C8")},onMouseUp:$=>{N&&($.currentTarget.style.background="#3790FA")},children:s.jsx(Gg,{className:"h-3.5 w-3.5 fill-white text-white"})}):s.jsx("button",{type:"button",onClick:kr,disabled:!N||!!A||!j.trim()&&I.length===0,className:"flex h-[32px] w-[32px] items-center justify-center transition-colors",style:{borderRadius:"6px",background:!N||A||!j.trim()&&I.length===0?"rgba(55, 144, 250, 0.45)":"#3790FA"},"aria-label":"Send message",onMouseEnter:$=>{N&&!A&&(j.trim()||I.length>0)&&($.currentTarget.style.background="#3489EE")},onMouseLeave:$=>{N&&!A&&(j.trim()||I.length>0)?$.currentTarget.style.background="#3790FA":$.currentTarget.style.background="rgba(55, 144, 250, 0.45)"},onMouseDown:$=>{N&&!A&&(j.trim()||I.length>0)&&($.currentTarget.style.background="#2C73C8")},onMouseUp:$=>{N&&!A&&(j.trim()||I.length>0)&&($.currentTarget.style.background="#3790FA")},children:s.jsx(u8,{fileName:"send_text_white.svg",alt:"Send message",className:"h-4 w-4 opacity-[0.84]",style:{transform:"rotate(0deg)"}})})]})]}):C?s.jsx(s.Fragment,{children:s.jsx("button",{type:"button",onClick:Sr,disabled:!N,className:"btn-electric flex-shrink-0 flex items-center justify-center",style:{color:"white",width:"32px",height:"32px",borderRadius:"6px",background:"#3790FA"},children:s.jsx(Gg,{className:"h-4 w-4 fill-white"})})}):s.jsx(s.Fragment,{children:s.jsx("button",{type:"button",onClick:kr,disabled:!N||!j.trim()||!!A,className:"btn-electric flex-shrink-0 flex items-center justify-center",style:{color:"white",width:"32px",height:"32px",borderRadius:"6px"},children:s.jsx(mC,{className:"h-4 w-4"})})})]}),!f&&s.jsxs("div",{className:"flex items-center justify-center mt-2 gap-2",children:[s.jsx("span",{className:"status-dot",style:N?{background:"var(--color-status-success)",boxShadow:"0 0 6px var(--color-status-success)"}:{background:"var(--color-status-error)",boxShadow:"0 0 6px var(--color-status-error)"}}),s.jsx("span",{className:"text-[10px]",style:{color:"var(--pc-text-faint)"},children:S(N?"agent.connected_status":"agent.disconnected_status")})]})]})}),s.jsx(n8,{open:Ma,onClose:()=>Ln(!1),onConfirm:ea})]})}function E8(e){const n=new Date(e);if(Number.isNaN(n.getTime()))return"";const r=n.getFullYear(),l=String(n.getMonth()+1).padStart(2,"0"),o=String(n.getDate()).padStart(2,"0"),u=String(n.getHours()).padStart(2,"0"),c=String(n.getMinutes()).padStart(2,"0");return`${r}/${l}/${o} ${u}:${c}`}function N8(e){const n=new Date,r=new Date(n.getFullYear(),n.getMonth(),n.getDate()),l=new Date(r.getTime()-10080*60*1e3),o=new Date(r.getTime()-720*60*60*1e3),u=new Date(r.getTime()-365*24*60*60*1e3),c={today:{label:S("history.today"),sessions:[]},last7days:{label:S("history.last_7_days"),sessions:[]},last30days:{label:S("history.last_30_days"),sessions:[]},lastYear:{label:S("history.last_year"),sessions:[]},older:{label:S("history.earlier"),sessions:[]}};return e.forEach(f=>{const h=new Date(f.updatedAt);h>=r?c.today.sessions.push(f):h>=l?c.last7days.sessions.push(f):h>=o?c.last30days.sessions.push(f):h>=u?c.lastYear.sessions.push(f):c.older.sessions.push(f)}),[{key:"today",...c.today},{key:"last7days",...c.last7days},{key:"last30days",...c.last30days},{key:"lastYear",...c.lastYear},{key:"older",...c.older}].filter(f=>f.sessions.length>0)}function T8(){const{locale:e}=qa(),n=Wr(),[r,l]=x.useState([]),[o,u]=x.useState(!0),[c,f]=x.useState(new Set),[h,m]=x.useState(!1);x.useEffect(()=>{ZT().then(w=>{l(w),u(!1)})},[]);const y=x.useMemo(()=>{const w=[...r].sort((j,T)=>new Date(T.updatedAt).getTime()-new Date(j.updatedAt).getTime());return N8(w)},[r,e]),g=()=>{f(h?new Set:new Set(r.map(w=>w.sessionId))),m(!h)},_=w=>{const j=new Set(c);j.has(w)?j.delete(w):j.add(w),f(j)},v=w=>{kT(w),n("/agent")};return s.jsx("div",{className:"h-[calc(100vh-3.5rem)] overflow-y-auto px-6 py-5 md:px-10",children:s.jsxs("div",{className:"mx-auto w-full max-w-4xl",children:[s.jsx("div",{className:"mb-5",children:s.jsx("h2",{className:"text-lg font-semibold",style:{color:"var(--pc-text-primary)"},children:S("history.title")})}),r.length>0&&s.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[s.jsx("input",{type:"checkbox",checked:h,onChange:g,className:"h-4 w-4 accent-blue-500"}),s.jsx("span",{className:"text-sm font-medium",style:{color:"var(--pc-text-primary)"},children:S("history.task_title")})]}),o&&s.jsx("div",{className:"text-sm",style:{color:"var(--pc-text-muted)"},children:S("history.loading")}),!o&&r.length===0&&s.jsx("div",{className:"text-sm",style:{color:"var(--pc-text-muted)"},children:S("history.empty")}),r.length>0&&s.jsx("div",{className:"space-y-4",children:y.map(w=>s.jsxs("div",{children:[s.jsx("div",{className:"mb-2 px-1 py-1 text-xs font-medium",style:{color:"var(--pc-text-muted)"},children:w.label}),s.jsx("div",{className:"space-y-1",children:w.sessions.map(j=>s.jsxs("div",{className:"flex cursor-pointer items-center gap-3 px-2 py-2",onClick:()=>v(j.sessionId),children:[s.jsx("input",{type:"checkbox",checked:c.has(j.sessionId),onChange:T=>{T.stopPropagation(),_(j.sessionId)},className:"h-4 w-4 shrink-0 accent-blue-500"}),s.jsx(Ig,{className:"h-4 w-4 shrink-0",style:{color:"var(--pc-text-muted)"}}),s.jsx("div",{className:"min-w-0 flex-1",children:s.jsx("p",{className:"truncate text-sm",style:{color:"var(--pc-text-primary)"},children:j.title})}),s.jsx("span",{className:"shrink-0 text-xs",style:{color:"var(--pc-text-faint)"},children:E8(j.updatedAt)})]},j.sessionId))})]},w.key))})]})})}const A8=1e3,M8=3e4,R8=/\r?\n\r?\n/,D8=/\r?\n/;function L8(e){const n=e.startsWith("/")?e:`/${e}`,r=`${Ns}${Il}`;return r?/^https?:\/\//.test(r)?new URL(n,`${r.replace(/\/+$/,"")}/`).toString():`${r}${n}`:n}class B0{constructor(n={}){pt(this,"controller",null);pt(this,"reconnectTimer",null);pt(this,"currentDelay");pt(this,"intentionallyClosed",!1);pt(this,"onEvent",null);pt(this,"onError",null);pt(this,"onConnect",null);pt(this,"path");pt(this,"reconnectDelay");pt(this,"maxReconnectDelay");pt(this,"autoReconnect");var r,l,o,u;this.path=L8((r=n.path)!=null?r:"/api/events"),this.reconnectDelay=(l=n.reconnectDelay)!=null?l:A8,this.maxReconnectDelay=(o=n.maxReconnectDelay)!=null?o:M8,this.autoReconnect=(u=n.autoReconnect)!=null?u:!0,this.currentDelay=this.reconnectDelay}connect(){this.intentionallyClosed=!1,this.clearReconnectTimer(),this.controller=new AbortController;const n=mr(),r={Accept:"text/event-stream"};n&&(r.Authorization=`Bearer ${n}`),fetch(this.path,{headers:r,signal:this.controller.signal}).then(l=>{var o;if(!l.ok)throw new Error(`SSE connection failed: ${l.status}`);if(!l.body)throw new Error("SSE response has no body");return this.currentDelay=this.reconnectDelay,(o=this.onConnect)==null||o.call(this),this.consumeStream(l.body)}).catch(l=>{var o;l instanceof DOMException&&l.name==="AbortError"||((o=this.onError)==null||o.call(this,l instanceof Error?l:new Error(String(l))),this.scheduleReconnect())})}disconnect(){this.intentionallyClosed=!0,this.clearReconnectTimer(),this.controller&&(this.controller.abort(),this.controller=null)}async consumeStream(n){var u,c;const r=n.getReader(),l=new TextDecoder;let o="";try{for(;;){const{done:f,value:h}=await r.read();if(f)break;o+=l.decode(h,{stream:!0});const m=o.split(R8);o=(u=m.pop())!=null?u:"";for(const y of m)this.parseEvent(y)}}catch(f){if(f instanceof DOMException&&f.name==="AbortError")return;(c=this.onError)==null||c.call(this,f instanceof Error?f:new Error(String(f)))}finally{r.releaseLock()}this.scheduleReconnect()}parseEvent(n){var c,f;let r="message";const l=[];for(const h of n.split(D8)){const m=h.replace(/\r$/,"");m.startsWith("event:")?r=m.slice(6).trim():m.startsWith("data:")&&l.push(m.slice(5).trim())}if(l.length===0)return;const o=l.join(`
`);let u;try{u=JSON.parse(o),u.type=(c=u.type)!=null?c:r}catch{u={type:r,data:o}}(f=this.onEvent)==null||f.call(this,u)}scheduleReconnect(){this.intentionallyClosed||!this.autoReconnect||(this.reconnectTimer=setTimeout(()=>{this.currentDelay=Math.min(this.currentDelay*2,this.maxReconnectDelay),this.connect()},this.currentDelay))}clearReconnectTimer(){this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}function F0(e={}){const{autoConnect:n=!0,maxEvents:r=500,filterTypes:l,...o}=e,u=x.useRef(null),[c,f]=x.useState("disconnected"),[h,m]=x.useState([]),y=x.useRef(l);y.current=l;const g=x.useRef(r);g.current=r;const _=x.useCallback(()=>(u.current||(u.current=new B0(o)),u.current),[]);x.useEffect(()=>{const T=_();return T.onConnect=()=>{f("connected")},T.onEvent=C=>{y.current&&y.current.length>0&&!y.current.includes(C.type)||m(E=>{const N=[...E,C];return N.length>g.current?N.slice(N.length-g.current):N})},T.onError=()=>{f("disconnected")},n&&(f("connecting"),T.connect()),()=>{T.disconnect(),u.current=null}},[_,n]);const v=x.useCallback(()=>{const T=_();f("connecting"),T.connect()},[_]),w=x.useCallback(()=>{_().disconnect(),f("disconnected")},[_]),j=x.useCallback(()=>{m([])},[]);return{events:h,status:c,connect:v,disconnect:w,clearEvents:j}}function I0(e){const n=Math.floor(e/86400),r=Math.floor(e%86400/3600),l=Math.floor(e%3600/60);return n>0?`${n}d ${r}h ${l}m`:r>0?`${r}h ${l}m`:`${l}m`}function z8(e){return`$${e.toFixed(4)}`}function O8(e){try{return new Date(e).toLocaleString()}catch{return e}}function so(e){try{const n=Date.now()-new Date(e).getTime(),r=Math.floor(n/1e3);if(r<60)return`${r}s ago`;const l=Math.floor(r/60);if(l<60)return`${l}m ago`;const o=Math.floor(l/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}catch{return e}}function co(e){switch(e.toLowerCase()){case"ok":case"healthy":return"var(--color-status-success)";case"warn":case"warning":case"degraded":return"var(--color-status-warning)";case"idle":case"inactive":return"var(--pc-text-faint)";default:return"var(--color-status-error)"}}function ll(e){switch(e.toLowerCase()){case"ok":case"healthy":return"rgba(0, 230, 138, 0.2)";case"warn":case"warning":case"degraded":return"rgba(255, 170, 0, 0.2)";case"idle":case"inactive":return"rgba(148, 163, 184, 0.18)";default:return"rgba(255, 68, 102, 0.2)"}}function cc(e){switch(e.toLowerCase()){case"ok":case"healthy":return"rgba(0, 230, 138, 0.05)";case"warn":case"warning":case"degraded":return"rgba(255, 170, 0, 0.05)";case"idle":case"inactive":return"rgba(148, 163, 184, 0.06)";default:return"rgba(255, 68, 102, 0.05)"}}function uc(e){switch(e){case"active":return"var(--color-status-success)";case"idle":return"var(--color-status-warning)";default:return"var(--pc-text-faint)"}}function Ql(e){switch(e){case"running":return"var(--color-status-success)";case"error":return"var(--color-status-error)";default:return"var(--pc-text-faint)"}}function B8(e){var o;const n=e==null?void 0:e.trim();if(!n)return S("dashboard.agent_general_purpose");const r=n.replace(/\s+/g," "),l=(o=r.split(new RegExp("(?<=[.!?])\\s"))[0])!=null?o:r;return l.length>96?`${l.slice(0,93)}...`:l}function F8(e){return e.split(/[_\-.]+/).filter(Boolean).slice(0,2).map(n=>n.charAt(0).toUpperCase()).join("")||"AG"}function I8(e){if(!e)return S("dashboard.agent_not_running");const n=Math.max(0,Math.floor((Date.now()-new Date(e).getTime())/1e3));if(n<60)return`${n}s`;const r=Math.floor(n/60),l=n%60;if(r<60)return`${r}m ${l}s`;const o=Math.floor(r/60),u=r%60;return`${o}h ${u}m`}function U8(e){const n=e==null?void 0:e.trim();return n?`${n.slice(0,8)}...`:"-"}const H8=[{icon:VS,accent:"var(--pc-accent)",labelKey:"dashboard.provider_model",getValue:e=>{var n;return(n=e.provider)!=null?n:"Unknown"},getSub:e=>{var n;return(n=e.model)!=null?n:""}},{icon:zg,accent:"#34d399",labelKey:"dashboard.uptime",getValue:e=>I0(e.uptime_seconds),getSub:()=>S("dashboard.since_last_restart")},{icon:dd,accent:"#a78bfa",labelKey:"dashboard.gateway_port",getValue:e=>`:${e.gateway_port}`,getSub:()=>""},{icon:cd,accent:"#fbbf24",labelKey:"dashboard.memory_backend",getValue:e=>e.memory_backend,getSub:e=>`${S("dashboard.paired")}: ${e.paired?S("dashboard.paired_yes"):S("dashboard.paired_no")}`}],q8=[{id:"overview",labelKey:"dashboard.tab_overview",icon:lC},{id:"sessions",labelKey:"dashboard.tab_sessions",icon:Qg},{id:"channels",labelKey:"dashboard.tab_channels",icon:Wg}];function P8({status:e,cost:n,agents:r,showAllChannels:l,setShowAllChannels:o}){var c;const u=Math.max(n.session_cost_usd,n.daily_cost_usd,n.monthly_cost_usd,.001);return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 stagger-children",children:H8.map(({icon:f,accent:h,labelKey:m,getValue:y,getSub:g})=>s.jsxs("div",{className:"card p-5 animate-slide-in-up",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[s.jsx("div",{className:"p-2 rounded-2xl",style:{background:"rgba(var(--pc-accent-rgb), 0.08)",color:h},children:s.jsx(f,{className:"h-5 w-5"})}),s.jsx("span",{className:"text-xs uppercase tracking-wider font-medium",style:{color:"var(--pc-text-muted)"},children:S(m)})]}),s.jsx("p",{className:"text-lg font-semibold truncate capitalize",style:{color:"var(--pc-text-primary)"},children:y(e)}),s.jsx("p",{className:"text-sm truncate",style:{color:"var(--pc-text-muted)"},children:g(e)})]},m))}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 stagger-children",children:[s.jsxs("div",{className:"card p-5 animate-slide-in-up",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-5",children:[s.jsx(ud,{className:"h-5 w-5",style:{color:"var(--pc-accent)"}}),s.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wider",style:{color:"var(--pc-text-primary)"},children:S("dashboard.cost_overview")})]}),s.jsx("div",{className:"space-y-4",children:[{label:S("dashboard.session_label"),value:n.session_cost_usd,color:"var(--pc-accent)"},{label:S("dashboard.daily_label"),value:n.daily_cost_usd,color:"#34d399"},{label:S("dashboard.monthly_label"),value:n.monthly_cost_usd,color:"#a78bfa"}].map(({label:f,value:h,color:m})=>s.jsxs("div",{children:[s.jsxs("div",{className:"flex justify-between text-sm mb-1.5",children:[s.jsx("span",{style:{color:"var(--pc-text-muted)"},children:f}),s.jsx("span",{className:"font-medium font-mono",style:{color:"var(--pc-text-primary)"},children:z8(h)})]}),s.jsx("div",{className:"w-full h-1.5 rounded-full overflow-hidden",style:{background:"var(--pc-hover)"},children:s.jsx("div",{className:"h-full rounded-full progress-bar-animated transition-all duration-700 ease-out",style:{width:`${Math.max(h/u*100,2)}%`,background:m}})})]},f))}),s.jsxs("div",{className:"mt-5 pt-4 border-t flex justify-between text-sm",style:{borderColor:"var(--pc-border)"},children:[s.jsx("span",{style:{color:"var(--pc-text-muted)"},children:S("dashboard.total_tokens_label")}),s.jsx("span",{className:"font-mono",style:{color:"var(--pc-text-primary)"},children:n.total_tokens.toLocaleString()})]}),s.jsxs("div",{className:"flex justify-between text-sm mt-1",children:[s.jsx("span",{style:{color:"var(--pc-text-muted)"},children:S("dashboard.requests_label")}),s.jsx("span",{className:"font-mono",style:{color:"var(--pc-text-primary)"},children:n.request_count.toLocaleString()})]})]}),s.jsxs("div",{className:"card p-5 animate-slide-in-up",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-5",children:[s.jsx(Pg,{className:"h-5 w-5",style:{color:"var(--pc-accent)"}}),s.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wider",style:{color:"var(--pc-text-primary)"},children:S("dashboard.channels")}),s.jsx("button",{onClick:()=>o(f=>!f),className:"ml-auto flex items-center gap-1 rounded-full px-2.5 py-1 text-[10px] font-medium border transition-all",style:l?{background:"rgba(var(--pc-accent-rgb), 0.1)",borderColor:"rgba(var(--pc-accent-rgb), 0.3)",color:"var(--pc-accent-light)"}:{background:"rgba(0, 230, 138, 0.08)",borderColor:"rgba(0, 230, 138, 0.25)",color:"#34d399"},"aria-label":S(l?"dashboard.filter_active":"dashboard.filter_all"),children:S(l?"dashboard.filter_all":"dashboard.filter_active")})]}),s.jsx("div",{className:"space-y-2 overflow-y-auto max-h-48 pr-1",children:Object.entries(e.channels).length===0?s.jsx("p",{className:"text-sm",style:{color:"var(--pc-text-faint)"},children:S("dashboard.no_channels")}):(()=>{const f=Object.entries(e.channels).filter(([,h])=>l||h);return f.length===0?s.jsx("p",{className:"text-sm",style:{color:"var(--pc-text-faint)"},children:S("dashboard.no_active_channels")}):f.map(([h,m])=>s.jsxs("div",{className:"flex items-center justify-between py-2.5 px-3 rounded-xl transition-all",style:{background:"var(--pc-bg-elevated)"},onMouseEnter:y=>{y.currentTarget.style.background="var(--pc-hover)"},onMouseLeave:y=>{y.currentTarget.style.background="var(--pc-bg-elevated)"},children:[s.jsx("span",{className:"text-sm font-medium capitalize",style:{color:"var(--pc-text-primary)"},children:h}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"status-dot",style:m?{background:"var(--color-status-success)",boxShadow:"0 0 6px var(--color-status-success)"}:{background:"var(--pc-text-faint)"}}),s.jsx("span",{className:"text-xs",style:{color:"var(--pc-text-muted)"},children:S(m?"dashboard.active":"dashboard.inactive")})]})]},h))})()})]}),s.jsxs("div",{className:"card p-5 animate-slide-in-up",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-5",children:[s.jsx(_s,{className:"h-5 w-5",style:{color:"var(--pc-accent)"}}),s.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wider",style:{color:"var(--pc-text-primary)"},children:S("dashboard.component_health")})]}),s.jsx("div",{className:"grid grid-cols-2 gap-3",children:Object.entries(e.health.components).length===0?s.jsx("p",{className:"text-sm col-span-2",style:{color:"var(--pc-text-faint)"},children:S("dashboard.no_components")}):Object.entries(e.health.components).map(([f,h])=>s.jsxs("div",{className:"rounded-2xl p-3 transition-all",style:{border:`1px solid ${ll(h.status)}`,background:cc(h.status)},onMouseEnter:m=>{m.currentTarget.style.transform="scale(1.02)"},onMouseLeave:m=>{m.currentTarget.style.transform="scale(1)"},children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("span",{className:"status-dot",style:{background:co(h.status),boxShadow:`0 0 6px ${co(h.status)}`}}),s.jsx("span",{className:"text-sm font-medium truncate capitalize",style:{color:"var(--pc-text-primary)"},children:f})]}),s.jsx("p",{className:"text-xs capitalize",style:{color:"var(--pc-text-muted)"},children:h.status}),h.restart_count>0&&s.jsxs("p",{className:"text-xs mt-1",style:{color:"var(--color-status-warning)"},children:[S("dashboard.restarts"),": ",h.restart_count]})]},f))})]})]}),s.jsxs("div",{className:"card p-5 animate-slide-in-up",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-5",children:[s.jsx(Yg,{className:"h-5 w-5",style:{color:"var(--pc-accent)"}}),s.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wider",style:{color:"var(--pc-text-primary)"},children:S("dashboard.agents_title")}),s.jsx("span",{className:"ml-auto text-[10px] font-mono",style:{color:"var(--pc-text-faint)"},children:r.length})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"rounded-3xl border p-4",style:{borderColor:ll("healthy"),background:"linear-gradient(180deg, color-mix(in srgb, var(--pc-bg-elevated) 92%, transparent), color-mix(in srgb, var(--pc-bg-surface) 94%, transparent))"},children:s.jsxs("div",{className:"flex items-start gap-4",children:[s.jsx("div",{className:"h-12 w-12 rounded-2xl flex items-center justify-center text-sm font-semibold",style:{background:"var(--pc-accent-glow)",color:"var(--pc-accent)"},children:"ZA"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("h3",{className:"text-base font-semibold truncate",style:{color:"var(--pc-text-primary)"},children:S("dashboard.primary_agent_title")}),s.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] uppercase tracking-[0.16em]",style:{color:Ql("running"),borderColor:ll("healthy"),background:cc("healthy")},children:[s.jsx("span",{className:"status-dot",style:{background:Ql("running"),boxShadow:`0 0 6px ${Ql("running")}`}}),S("dashboard.primary_agent_status")]})]}),s.jsx("p",{className:"mt-1 text-sm leading-6",style:{color:"var(--pc-text-muted)"},children:S("dashboard.primary_agent_style")})]}),s.jsxs("div",{className:"text-right text-[11px]",style:{color:"var(--pc-text-faint)"},children:[s.jsx("p",{children:(c=e.provider)!=null?c:"Unknown"}),s.jsx("p",{className:"font-mono",children:e.model})]})]}),s.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[s.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border px-2.5 py-1 text-[10px]",style:{borderColor:"var(--pc-border)",color:"var(--pc-text-secondary)"},children:[s.jsx(hr,{className:"h-3 w-3"}),S("dashboard.primary_agent_kind")]}),s.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border px-2.5 py-1 text-[10px]",style:{borderColor:"var(--pc-border)",color:"var(--pc-text-secondary)"},children:[s.jsx(Yg,{className:"h-3 w-3"}),S("dashboard.primary_agent_tooling")]}),s.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border px-2.5 py-1 text-[10px]",style:{borderColor:"var(--pc-border)",color:"var(--pc-text-secondary)"},children:[s.jsx(Ss,{className:"h-3 w-3"}),"temp ",e.temperature]})]}),s.jsxs("div",{className:"mt-4 grid grid-cols-2 gap-3 text-sm",children:[s.jsxs("div",{className:"rounded-2xl border px-3 py-2.5",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg)"},children:[s.jsx("p",{style:{color:"var(--pc-text-faint)"},children:S("dashboard.current_task")}),s.jsx("p",{className:"mt-1 line-clamp-2",style:{color:"var(--pc-text-primary)"},children:S("dashboard.primary_agent_task")})]}),s.jsxs("div",{className:"rounded-2xl border px-3 py-2.5",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg)"},children:[s.jsx("p",{style:{color:"var(--pc-text-faint)"},children:S("dashboard.run_time")}),s.jsx("p",{className:"mt-1 font-mono",style:{color:"var(--pc-text-primary)"},children:I0(e.uptime_seconds)})]}),s.jsxs("div",{className:"rounded-2xl border px-3 py-2.5",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg)"},children:[s.jsx("p",{style:{color:"var(--pc-text-faint)"},children:S("dashboard.progress")}),s.jsx("p",{className:"mt-1 capitalize",style:{color:"var(--pc-text-primary)"},children:S("dashboard.primary_agent_progress")})]}),s.jsxs("div",{className:"rounded-2xl border px-3 py-2.5",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg)"},children:[s.jsx("p",{style:{color:"var(--pc-text-faint)"},children:S("dashboard.last_active")}),s.jsx("p",{className:"mt-1",style:{color:"var(--pc-text-primary)"},children:S("dashboard.primary_agent_last_active")})]})]})]})]})}),s.jsxs("div",{children:[s.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[s.jsx("h3",{className:"text-[11px] font-semibold uppercase tracking-[0.18em]",style:{color:"var(--pc-text-faint)"},children:S("dashboard.delegate_agents_title")}),s.jsx("span",{className:"text-[10px] font-mono",style:{color:"var(--pc-text-faint)"},children:r.length})]}),r.length===0?s.jsx("p",{className:"text-sm py-6 text-center",style:{color:"var(--pc-text-faint)"},children:S("dashboard.agents_empty")}):s.jsx("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-4",children:r.map(f=>{var h;return s.jsx("div",{className:"rounded-3xl border p-4",style:{borderColor:ll(f.runtime.status==="error"?"error":f.runtime.status==="running"?"healthy":"inactive"),background:"linear-gradient(180deg, color-mix(in srgb, var(--pc-bg-elevated) 92%, transparent), color-mix(in srgb, var(--pc-bg-surface) 94%, transparent))"},children:s.jsxs("div",{className:"flex items-start gap-4",children:[s.jsx("div",{className:"h-12 w-12 rounded-2xl flex items-center justify-center text-sm font-semibold",style:{background:"var(--pc-accent-glow)",color:"var(--pc-accent)"},children:F8(f.name)}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("h3",{className:"text-base font-semibold truncate",style:{color:"var(--pc-text-primary)"},children:f.name}),s.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] uppercase tracking-[0.16em]",style:{color:Ql(f.runtime.status),borderColor:ll(f.runtime.status),background:cc(f.runtime.status)},children:[s.jsx("span",{className:"status-dot",style:{background:Ql(f.runtime.status),boxShadow:`0 0 6px ${Ql(f.runtime.status)}`}}),f.runtime.status]})]}),s.jsx("p",{className:"mt-1 text-sm leading-6",style:{color:"var(--pc-text-muted)"},children:B8(f.system_prompt)})]}),s.jsxs("div",{className:"text-right text-[11px]",style:{color:"var(--pc-text-faint)"},children:[s.jsx("p",{children:f.provider}),s.jsx("p",{className:"font-mono",children:f.model})]})]}),s.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[s.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border px-2.5 py-1 text-[10px]",style:{borderColor:"var(--pc-border)",color:"var(--pc-text-secondary)"},children:[s.jsx(hr,{className:"h-3 w-3"}),f.agentic?S("dashboard.agentic"):S("dashboard.single_turn")]}),s.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border px-2.5 py-1 text-[10px]",style:{borderColor:"var(--pc-border)",color:"var(--pc-text-secondary)"},children:[s.jsx(SC,{className:"h-3 w-3"}),S("dashboard.depth")," ",f.max_depth]}),s.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border px-2.5 py-1 text-[10px]",style:{borderColor:"var(--pc-border)",color:"var(--pc-text-secondary)"},children:[s.jsx(Ss,{className:"h-3 w-3"}),f.max_iterations," ",S("dashboard.iterations")]})]}),s.jsxs("div",{className:"mt-4 grid grid-cols-2 gap-3 text-sm",children:[s.jsxs("div",{className:"rounded-2xl border px-3 py-2.5",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg)"},children:[s.jsx("p",{style:{color:"var(--pc-text-faint)"},children:S("dashboard.current_task")}),s.jsx("p",{className:"mt-1 line-clamp-2",style:{color:"var(--pc-text-primary)"},children:(h=f.runtime.current_task)!=null?h:S("dashboard.idle")})]}),s.jsxs("div",{className:"rounded-2xl border px-3 py-2.5",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg)"},children:[s.jsx("p",{style:{color:"var(--pc-text-faint)"},children:S("dashboard.run_time")}),s.jsx("p",{className:"mt-1 font-mono",style:{color:"var(--pc-text-primary)"},children:f.runtime.status==="running"?I8(f.runtime.started_at):S("dashboard.agent_not_running")})]}),s.jsxs("div",{className:"rounded-2xl border px-3 py-2.5",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg)"},children:[s.jsx("p",{style:{color:"var(--pc-text-faint)"},children:S("dashboard.progress")}),s.jsx("p",{className:"mt-1 capitalize",style:{color:"var(--pc-text-primary)"},children:f.runtime.stage})]}),s.jsxs("div",{className:"rounded-2xl border px-3 py-2.5",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg)"},children:[s.jsx("p",{style:{color:"var(--pc-text-faint)"},children:S("dashboard.last_active")}),s.jsx("p",{className:"mt-1",style:{color:"var(--pc-text-primary)"},children:f.runtime.last_finished_at?so(f.runtime.last_finished_at):f.runtime.last_started_at?so(f.runtime.last_started_at):S("dashboard.never")})]})]}),s.jsxs("div",{className:"mt-4",children:[s.jsx("p",{className:"text-[11px] uppercase tracking-[0.16em]",style:{color:"var(--pc-text-faint)"},children:S("dashboard.capabilities")}),s.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:f.allowed_tools.length>0?f.allowed_tools.map(m=>s.jsx("span",{className:"rounded-full px-2.5 py-1 text-[10px] font-mono border",style:{borderColor:"var(--pc-border)",color:"var(--pc-text-secondary)",background:"var(--pc-bg)"},children:m},m)):s.jsx("span",{className:"text-sm",style:{color:"var(--pc-text-faint)"},children:S("dashboard.no_tool_allowlist")})})]}),f.runtime.last_error&&s.jsx("div",{className:"mt-4 rounded-2xl border px-3 py-2.5 text-sm",style:{borderColor:"rgba(255, 68, 102, 0.2)",background:"rgba(255, 68, 102, 0.08)",color:"#fda4af"},children:f.runtime.last_error})]})]})},f.name)})})]})]})]})]})}function $8(){var y;const[e,n]=x.useState([]),[r,l]=x.useState(!0),[o,u]=x.useState(null),[c,f]=x.useState(null),{events:h}=F0({filterTypes:["session_update","session_created","session_closed"],autoConnect:!0}),m=x.useCallback(()=>{fy().then(g=>{n(g),l(!1)}).catch(g=>{u(g.message),l(!1)})},[]);return x.useEffect(()=>{m()},[m]),x.useEffect(()=>{h.length!==0&&m()},[h.length,m]),r?s.jsx("div",{className:"flex items-center justify-center h-48",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"h-6 w-6 border-2 rounded-full animate-spin",style:{borderColor:"var(--pc-border)",borderTopColor:"var(--pc-accent)"}}),s.jsx("span",{className:"text-sm",style:{color:"var(--pc-text-muted)"},children:S("dashboard.loading_sessions")})]})}):o?s.jsxs("div",{className:"rounded-2xl border p-4",style:{background:"rgba(239, 68, 68, 0.08)",borderColor:"rgba(239, 68, 68, 0.2)",color:"#f87171"},children:[S("dashboard.load_sessions_error"),": ",o]}):s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[s.jsxs("div",{className:"lg:col-span-2 card p-5 animate-slide-in-up",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-5",children:[s.jsx(Qg,{className:"h-5 w-5",style:{color:"var(--pc-accent)"}}),s.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wider",style:{color:"var(--pc-text-primary)"},children:S("dashboard.sessions_title")}),s.jsx("span",{className:"ml-auto text-xs font-mono px-2 py-0.5 rounded-full",style:{background:"rgba(var(--pc-accent-rgb), 0.1)",color:"var(--pc-accent)"},children:e.length})]}),e.length===0?s.jsx("p",{className:"text-sm py-8 text-center",style:{color:"var(--pc-text-faint)"},children:S("dashboard.no_sessions")}):s.jsx("div",{className:"space-y-2 overflow-y-auto max-h-96",children:e.map(g=>s.jsxs("button",{onClick:()=>f(g),className:"w-full text-left flex items-center justify-between py-3 px-4 rounded-xl transition-all",style:{background:(c==null?void 0:c.id)===g.id?"rgba(var(--pc-accent-rgb), 0.08)":"var(--pc-bg-elevated)",border:(c==null?void 0:c.id)===g.id?"1px solid rgba(var(--pc-accent-rgb), 0.2)":"1px solid transparent"},onMouseEnter:_=>{(c==null?void 0:c.id)!==g.id&&(_.currentTarget.style.background="var(--pc-hover)")},onMouseLeave:_=>{(c==null?void 0:c.id)!==g.id&&(_.currentTarget.style.background="var(--pc-bg-elevated)")},children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("span",{className:"text-sm font-medium font-mono truncate",style:{color:"var(--pc-text-primary)"},children:U8(g.id)}),s.jsx("span",{className:"text-[10px] uppercase font-medium px-2 py-0.5 rounded-full",style:{background:`${uc(g.status)}15`,color:uc(g.status)},children:g.status})]}),s.jsxs("div",{className:"flex items-center gap-3 text-xs",style:{color:"var(--pc-text-muted)"},children:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(Ss,{className:"h-3 w-3"}),g.channel]}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(oC,{className:"h-3 w-3"}),g.message_count]}),s.jsx("span",{children:so(g.last_activity)})]})]}),s.jsx(ws,{className:"h-4 w-4 flex-shrink-0",style:{color:"var(--pc-text-faint)"}})]},g.id))})]}),s.jsxs("div",{className:"card p-5 animate-slide-in-up",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-5",children:[s.jsx(_s,{className:"h-5 w-5",style:{color:"var(--pc-accent)"}}),s.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wider",style:{color:"var(--pc-text-primary)"},children:S("dashboard.session_details")})]}),c?s.jsxs("div",{className:"space-y-4",children:[[{label:S("dashboard.session_id"),value:((y=c.id)==null?void 0:y.trim())||"-"},{label:S("dashboard.session_channel"),value:c.channel},{label:S("dashboard.session_started"),value:O8(c.started_at)},{label:S("dashboard.session_last_activity"),value:so(c.last_activity)},{label:S("dashboard.session_status"),value:c.status},{label:S("dashboard.session_messages"),value:String(c.message_count)}].map(({label:g,value:_})=>s.jsxs("div",{children:[s.jsx("p",{className:"text-xs uppercase tracking-wider mb-1",style:{color:"var(--pc-text-faint)"},children:g}),s.jsx("p",{className:"text-sm font-medium capitalize truncate",style:{color:"var(--pc-text-primary)"},children:_})]},g)),s.jsx("div",{className:"pt-3 mt-3 border-t",style:{borderColor:"var(--pc-border)"},children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"status-dot",style:{background:uc(c.status),boxShadow:`0 0 6px ${uc(c.status)}`}}),s.jsx("span",{className:"text-xs capitalize",style:{color:"var(--pc-text-muted)"},children:c.status})]})})]}):s.jsx("p",{className:"text-sm py-8 text-center",style:{color:"var(--pc-text-faint)"},children:S("dashboard.session_history")})]})]})}function Y8(){const[e,n]=x.useState([]),[r,l]=x.useState(!0),[o,u]=x.useState(null),{events:c}=F0({filterTypes:["channel_update","channel_status"],autoConnect:!0}),f=x.useCallback(()=>{hy().then(h=>{n(h),l(!1)}).catch(h=>{u(h.message),l(!1)})},[]);return x.useEffect(()=>{f()},[f]),x.useEffect(()=>{c.length!==0&&f()},[c.length,f]),r?s.jsx("div",{className:"flex items-center justify-center h-48",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"h-6 w-6 border-2 rounded-full animate-spin",style:{borderColor:"var(--pc-border)",borderTopColor:"var(--pc-accent)"}}),s.jsx("span",{className:"text-sm",style:{color:"var(--pc-text-muted)"},children:S("dashboard.loading_channels")})]})}):o?s.jsxs("div",{className:"rounded-2xl border p-4",style:{background:"rgba(239, 68, 68, 0.08)",borderColor:"rgba(239, 68, 68, 0.2)",color:"#f87171"},children:[S("dashboard.load_channels_error"),": ",o]}):e.length===0?s.jsx("div",{className:"card p-5 animate-slide-in-up",children:s.jsx("p",{className:"text-sm py-8 text-center",style:{color:"var(--pc-text-faint)"},children:S("dashboard.no_channels_detail")})}):s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 stagger-children",children:e.map(h=>s.jsxs("div",{className:"card p-5 animate-slide-in-up transition-all",style:{border:`1px solid ${ll(h.health)}`,background:cc(h.health)},onMouseEnter:m=>{m.currentTarget.style.transform="translateY(-2px)",m.currentTarget.style.boxShadow=`0 4px 12px ${ll(h.health)}`},onMouseLeave:m=>{m.currentTarget.style.transform="translateY(0)",m.currentTarget.style.boxShadow="none"},children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"p-2 rounded-2xl",style:{background:"rgba(var(--pc-accent-rgb), 0.08)",color:"var(--pc-accent)"},children:s.jsx(Pg,{className:"h-5 w-5"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-semibold capitalize",style:{color:"var(--pc-text-primary)"},children:h.name}),s.jsx("span",{className:"text-xs",style:{color:"var(--pc-text-muted)"},children:h.type})]})]}),s.jsx("span",{className:"status-dot",style:{background:co(h.health),boxShadow:`0 0 6px ${co(h.health)}`}})]}),s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx("span",{className:"text-[10px] uppercase font-medium px-2 py-0.5 rounded-full",style:{background:h.status==="active"?"rgba(0, 230, 138, 0.1)":h.status==="error"?"rgba(255, 68, 102, 0.1)":"rgba(var(--pc-accent-rgb), 0.08)",color:h.status==="active"?"#34d399":h.status==="error"?"#f87171":"var(--pc-text-muted)"},children:h.status}),s.jsx("span",{className:"text-[10px] uppercase font-medium px-2 py-0.5 rounded-full",style:{background:h.enabled?"rgba(0, 230, 138, 0.1)":"rgba(255, 68, 102, 0.1)",color:h.enabled?"#34d399":"#f87171"},children:h.enabled?S("dashboard.channel_enabled"):S("dashboard.channel_disabled")})]}),s.jsxs("div",{className:"pt-3 border-t space-y-2",style:{borderColor:"var(--pc-border)"},children:[s.jsxs("div",{className:"flex justify-between text-xs",children:[s.jsx("span",{style:{color:"var(--pc-text-muted)"},children:S("dashboard.channel_messages")}),s.jsx("span",{className:"font-mono",style:{color:"var(--pc-text-primary)"},children:h.message_count.toLocaleString()})]}),s.jsxs("div",{className:"flex justify-between text-xs",children:[s.jsx("span",{style:{color:"var(--pc-text-muted)"},children:S("dashboard.channel_last_message")}),s.jsx("span",{className:"font-mono",style:{color:"var(--pc-text-primary)"},children:h.last_message_at?so(h.last_message_at):S("dashboard.never")})]}),s.jsxs("div",{className:"flex justify-between text-xs",children:[s.jsx("span",{style:{color:"var(--pc-text-muted)"},children:S("dashboard.health")}),s.jsx("span",{className:"capitalize",style:{color:co(h.health)},children:h.health})]})]})]},h.name))})}function G8(){const[e,n]=x.useState(null),[r,l]=x.useState(null),[o,u]=x.useState(null),[c,f]=x.useState([]),[h,m]=x.useState(!1),[y,g]=x.useState("overview"),_=x.useCallback(()=>{Promise.all([Ls().then(w=>({status:"fulfilled",value:w}),w=>({status:"rejected",reason:w})),zs().then(w=>({status:"fulfilled",value:w}),w=>({status:"rejected",reason:w}))]).then(w=>{const[j,T]=w,C=[];j.status==="fulfilled"?n(j.value):C.push(`status: ${j.reason instanceof Error?j.reason.message:String(j.reason)}`),T.status==="fulfilled"?l(T.value):C.push(`cost: ${T.reason instanceof Error?T.reason.message:String(T.reason)}`),C.length>0?u(C.join(" | ")):u(null)}).catch(w=>u(w instanceof Error?w.message:String(w)))},[]),v=x.useCallback(()=>{N4().then(w=>{f(w)}).catch(w=>{f([]),console.warn("[Dashboard] Failed to load agents:",w instanceof Error?w.message:String(w))})},[]);return x.useEffect(()=>{_()},[_]),x.useEffect(()=>{const w=window.setInterval(_,5e3);return()=>window.clearInterval(w)},[_]),x.useEffect(()=>{let w;const j=()=>{w!==void 0&&clearTimeout(w),w=window.setTimeout(()=>{w=void 0,_()},400)};return window.addEventListener(tl,j),()=>{window.removeEventListener(tl,j),w!==void 0&&clearTimeout(w)}},[_]),x.useEffect(()=>{y==="overview"&&v()},[y,v]),o?s.jsx("div",{className:"p-6 animate-fade-in",children:s.jsxs("div",{className:"rounded-2xl border p-4",style:{background:"rgba(239, 68, 68, 0.08)",borderColor:"rgba(239, 68, 68, 0.2)",color:"#f87171"},children:[S("dashboard.load_error"),": ",o]})}):!e||!r?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"h-8 w-8 border-2 rounded-full animate-spin",style:{borderColor:"var(--pc-border)",borderTopColor:"var(--pc-accent)"}})}):s.jsxs("div",{className:"p-6 space-y-6 animate-fade-in",children:[s.jsx("div",{className:"flex items-center gap-1 p-1 rounded-2xl",style:{background:"var(--pc-bg-elevated)"},children:q8.map(({id:w,labelKey:j,icon:T})=>s.jsxs("button",{onClick:()=>g(w),className:"flex items-center gap-2 px-4 py-2.5 rounded-xl text-sm font-medium transition-all",style:y===w?{background:"var(--pc-bg-primary)",color:"var(--pc-accent)",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.1)"}:{background:"transparent",color:"var(--pc-text-muted)"},onMouseEnter:C=>{y!==w&&(C.currentTarget.style.color="var(--pc-text-primary)")},onMouseLeave:C=>{y!==w&&(C.currentTarget.style.color="var(--pc-text-muted)")},children:[s.jsx(T,{className:"h-4 w-4"}),S(j)]},w))}),y==="overview"&&s.jsx(P8,{status:e,cost:r,agents:c,showAllChannels:h,setShowAllChannels:m}),y==="sessions"&&s.jsx($8,{}),y==="channels"&&s.jsx(Y8,{})]})}function K8(){const[e,n]=x.useState([]),[r,l]=x.useState([]),[o,u]=x.useState(""),[c,f]=x.useState(null),[h,m]=x.useState(!0),[y,g]=x.useState(!0),[_,v]=x.useState(!0),[w,j]=x.useState(null);x.useEffect(()=>{Promise.all([s4(),T4()]).then(([E,N])=>{n(E),l(N)}).catch(E=>j(E.message)).finally(()=>v(!1))},[]);const T=e.filter(E=>E.name.toLowerCase().includes(o.toLowerCase())||E.description.toLowerCase().includes(o.toLowerCase())),C=r.filter(E=>E.name.toLowerCase().includes(o.toLowerCase())||E.category.toLowerCase().includes(o.toLowerCase()));return w?s.jsx("div",{className:"p-6 animate-fade-in",children:s.jsxs("div",{className:"rounded-2xl border p-4",style:{background:"rgba(239, 68, 68, 0.08)",borderColor:"rgba(239, 68, 68, 0.2)",color:"#f87171"},children:[S("tools.load_error"),": ",w]})}):_?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"h-8 w-8 border-2 rounded-full animate-spin",style:{borderColor:"var(--pc-border)",borderTopColor:"var(--pc-accent)"}})}):s.jsxs("div",{className:"p-6 space-y-6 animate-fade-in",children:[s.jsxs("div",{className:"relative max-w-md",children:[s.jsx(Bl,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4",style:{color:"var(--pc-text-faint)"}}),s.jsx("input",{type:"text",value:o,onChange:E=>u(E.target.value),placeholder:S("tools.search"),className:"input-electric w-full pl-10 pr-4 py-2.5 text-sm"})]}),s.jsxs("div",{children:[s.jsxs("button",{onClick:()=>m(E=>!E),className:"flex items-center gap-2 mb-4 w-full text-left group",style:{background:"transparent",border:"none",cursor:"default",padding:0},"aria-expanded":h,"aria-controls":"agent-tools-section",children:[s.jsx(Xg,{className:"h-5 w-5",style:{color:"var(--pc-accent)"}}),s.jsxs("span",{className:"text-sm font-semibold uppercase tracking-wider flex-1",role:"heading","aria-level":2,style:{color:"var(--pc-text-primary)"},children:[S("tools.agent_tools")," (",T.length,")"]}),s.jsx(ha,{className:"h-4 w-4 opacity-40 group-hover:opacity-100",style:{color:"var(--pc-text-muted)",transform:h?"rotate(0deg)":"rotate(-90deg)",transition:"transform 0.2s ease, opacity 0.2s ease"}})]}),s.jsx("div",{id:"agent-tools-section",children:h&&(T.length===0?s.jsx("p",{className:"text-sm",style:{color:"var(--pc-text-muted)"},children:S("tools.empty")}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4 stagger-children",children:T.map(E=>{const N=c===E.name;return s.jsxs("div",{className:"card overflow-hidden animate-slide-in-up",children:[s.jsxs("button",{onClick:()=>f(N?null:E.name),className:"w-full text-left p-4 transition-all",style:{background:"transparent"},onMouseEnter:D=>{D.currentTarget.style.background="var(--pc-hover)"},onMouseLeave:D=>{D.currentTarget.style.background="transparent"},children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx(cC,{className:"h-4 w-4 flex-shrink-0",style:{color:"var(--pc-accent)"}}),s.jsx("h3",{className:"text-sm font-semibold truncate",style:{color:"var(--pc-text-primary)"},children:E.name})]}),N?s.jsx(ha,{className:"h-4 w-4 flex-shrink-0",style:{color:"var(--pc-accent)"}}):s.jsx(ws,{className:"h-4 w-4 flex-shrink-0",style:{color:"var(--pc-text-faint)"}})]}),s.jsx("p",{className:"text-sm mt-2 line-clamp-2",style:{color:"var(--pc-text-muted)"},children:E.description})]}),N&&E.parameters&&s.jsxs("div",{className:"border-t p-4 animate-fade-in",style:{borderColor:"var(--pc-border)"},children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider mb-2",style:{color:"var(--pc-text-muted)"},children:S("tools.parameter_schema")}),s.jsx("pre",{className:"text-xs rounded-xl p-3 overflow-x-auto max-h-64 overflow-y-auto font-mono",style:{background:"var(--pc-bg-base)",color:"var(--pc-text-secondary)"},children:JSON.stringify(E.parameters,null,2)})]})]},E.name)})}))})]}),C.length>0&&s.jsxs("div",{className:"animate-slide-in-up",style:{animationDelay:"200ms"},children:[s.jsxs("button",{onClick:()=>g(E=>!E),className:"flex items-center gap-2 mb-4 w-full text-left group",style:{background:"transparent",border:"none",cursor:"default",padding:0},"aria-expanded":y,"aria-controls":"cli-tools-section",children:[s.jsx(Vg,{className:"h-5 w-5",style:{color:"var(--color-status-success)"}}),s.jsxs("span",{className:"text-sm font-semibold uppercase tracking-wider flex-1",role:"heading","aria-level":2,style:{color:"var(--pc-text-primary)"},children:[S("tools.cli_tools")," (",C.length,")"]}),s.jsx(ha,{className:"h-4 w-4 opacity-40 group-hover:opacity-100",style:{color:"var(--pc-text-muted)",transform:y?"rotate(0deg)":"rotate(-90deg)",transition:"transform 0.2s ease, opacity 0.2s ease"}})]}),s.jsx("div",{id:"cli-tools-section",children:y&&s.jsx("div",{className:"card overflow-hidden rounded-2xl",children:s.jsxs("table",{className:"table-electric",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:S("tools.name")}),s.jsx("th",{children:S("tools.path")}),s.jsx("th",{children:S("tools.version")}),s.jsx("th",{children:S("tools.category")})]})}),s.jsx("tbody",{children:C.map(E=>{var N;return s.jsxs("tr",{children:[s.jsx("td",{className:"font-medium text-sm",style:{color:"var(--pc-text-primary)"},children:E.name}),s.jsx("td",{className:"font-mono text-xs truncate max-w-[200px]",style:{color:"var(--pc-text-muted)"},children:E.path}),s.jsx("td",{style:{color:"var(--pc-text-muted)"},children:(N=E.version)!=null?N:"-"}),s.jsx("td",{children:s.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-[10px] font-semibold capitalize border",style:{borderColor:"var(--pc-border)",color:"var(--pc-text-secondary)",background:"var(--pc-accent-glow)"},children:E.category})})]},E.name)})})]})})})]})]})}const V8=304,Q8="'Noto Sans CJK SC', 'Source Han Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif";function Af({selected:e,onPick:n,children:r,reserveCheckmarkSlot:l=!1,fullWidth:o=!1}){return s.jsxs("button",{type:"button",role:"option","aria-selected":e,onClick:n,onMouseDown:u=>u.preventDefault(),className:`model-dialog-dropdown-option box-border flex cursor-default flex-row flex-nowrap items-center overflow-hidden border-none outline-none ${o?"w-full max-w-full":"shrink-0"}`,style:{width:o?"100%":V8,height:36,paddingLeft:8,paddingRight:8,borderRadius:4,color:"rgba(0, 0, 0, 0.85)",fontFamily:Q8,fontSize:14,fontWeight:400,boxSizing:"border-box"},children:[s.jsx("span",{className:"inline-flex shrink-0 items-center justify-center",style:{width:16,height:16,flexShrink:0},children:e?s.jsx("img",{src:`${$e}/icons/object-select-symbolic.svg`,alt:"",width:16,height:16,className:"block object-contain",draggable:!1}):l?s.jsx("span",{className:"block",style:{width:16,height:16},"aria-hidden":!0}):null}),s.jsx("span",{className:"flex min-w-0 flex-1 flex-row flex-nowrap items-center truncate text-left",style:{marginLeft:8},children:r})]})}const W8="...",X8=3,J8=100,Z8={chinese:100,english:199,mixed:100};function Mf(e){return[...e]}function U0(e){const n=e.codePointAt(0);return n===void 0?!1:n>=19968&&n<=40959||n>=13312&&n<=19903||n>=63744&&n<=64255||n>=12288&&n<=12351||n>=65280&&n<=65519}function eA(e){return/[A-Za-z0-9]/.test(e)}function tA(e){return U0(e)?2:1}function nA(e){let n=!1,r=!1;for(const l of Mf(e))if(U0(l)?n=!0:eA(l)&&(r=!0),n&&r)return"mixed";return r?"english":"chinese"}function aA(e){return Z8[e]}function rA(e){const n=nA(e),r=aA(n),l=Mf(e);if(l.length<=r)return e;const o=r-X8;return l.slice(0,o).join("")+W8}function lA(e){const n=[],r=e.split(/\r\n|\r|\n/);for(const l of r){if(l===""){n.push("");continue}let o="",u=0;for(const c of Mf(l)){const f=tA(c);u+f>J8&&o.length>0?(n.push(o),o=c,u=f):(o+=c,u+=f)}o.length>0&&n.push(o)}return n.join(`
`)}function iA(e){return lA(rA(e))}const oA=500,Rf=4,Df=16,H0=12,sA=700,cA=300;function uA(e,n,r=Rf,l=Df){const o=window.innerWidth,u=window.innerHeight,c=H0;let f=e.x+r,h=e.y+l;return f+n.width>o-c&&(f=e.x-n.width-r),f<c&&(f=c),f+n.width>o-c&&(f=Math.max(c,o-n.width-c)),h+n.height>u-c&&(h=e.y-n.height-l),h<c&&(h=c),h+n.height>u-c&&(h=Math.max(c,u-n.height-c)),{left:f,top:h}}function dA(e){return`min(${e}px, calc(100vw - ${H0*2}px))`}const q0={background:"#fff",border:"1px solid rgba(0,0,0,0.1)",borderRadius:8,boxShadow:"0 4px 16px rgba(0,0,0,0.2)",padding:"8px",boxSizing:"border-box",fontSize:14,color:"var(--pc-text-primary)",whiteSpace:"nowrap",pointerEvents:"none"};function fA(e){return e.scrollWidth>e.clientWidth}function P0({visible:e,label:n,mousePos:r,zIndex:l=300}){return!e||typeof document>"u"?null:Dl.createPortal(s.jsx("div",{style:{position:"fixed",top:r.y+Df,left:r.x+Rf,zIndex:l,...q0},children:n}),document.body)}function hA({displayText:e,mousePos:n,zIndex:r,variant:l}){var y,g;const o=x.useRef(null),[u,c]=x.useState(null),f=l==="longText";x.useLayoutEffect(()=>{const _=o.current;if(!_)return;const{width:v,height:w}=_.getBoundingClientRect();c(uA(n,{width:v,height:w}))},[e,n.x,n.y]);const h=n.x+Rf,m=n.y+Df;return s.jsx("div",{ref:o,style:{position:"fixed",left:(y=u==null?void 0:u.left)!=null?y:h,top:(g=u==null?void 0:u.top)!=null?g:m,zIndex:r,visibility:u?"visible":"hidden",...q0,fontSize:f?14:12,whiteSpace:"pre-wrap",maxWidth:dA(f?sA:cA),width:"max-content",wordBreak:"break-word",overflowWrap:"anywhere",overflow:"hidden",lineHeight:f?1.5:void 0},children:e})}function mA({visible:e,text:n,mousePos:r,zIndex:l=150,variant:o="default"}){if(!e||typeof document>"u")return null;const c=o==="longText"?iA(n):n;return Dl.createPortal(s.jsx(hA,{displayText:c,mousePos:r,zIndex:l,variant:o}),document.body)}function $0(e=!0){const[n,r]=x.useState(!1),[l,o]=x.useState({x:0,y:0}),u=x.useRef(null),c=m=>{e&&(o({x:m.clientX,y:m.clientY}),u.current=setTimeout(()=>{u.current=null,r(!0)},oA))},f=m=>{u.current!==null&&o({x:m.clientX,y:m.clientY})},h=()=>{u.current&&clearTimeout(u.current),u.current=null,r(!1)};return x.useEffect(()=>()=>{u.current&&clearTimeout(u.current)},[]),{tooltipVisible:n,mousePos:l,onMouseEnter:c,onMouseMove:f,onMouseLeave:h}}function br({onClick:e}){const{tooltipVisible:n,mousePos:r,onMouseEnter:l,onMouseMove:o,onMouseLeave:u}=$0();return s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{position:"relative",display:"inline-flex"},children:s.jsx("button",{type:"button",className:"skill-dialog-close-btn",onClick:e,"aria-label":"关闭",style:{cursor:"default"},onMouseEnter:l,onMouseMove:o,onMouseLeave:u,children:s.jsx(ma,{size:16})})}),s.jsx(P0,{visible:n,label:"关闭",mousePos:r})]})}function Y0(e){const{tooltipVisible:n,mousePos:r,onMouseEnter:l,onMouseMove:o,onMouseLeave:u}=$0(!e);return{onMouseEnter:l,onMouseMove:o,onMouseLeave:u,tooltip:n&&!e?s.jsx(P0,{visible:!0,label:"更多",mousePos:r,zIndex:100}):null}}function dc({text:e,className:n,style:r,tooltipVariant:l="default"}){const o=x.useRef(null),[u,c]=x.useState(!1),[f,h]=x.useState({x:0,y:0});return s.jsxs(s.Fragment,{children:[s.jsx("span",{ref:o,className:`block min-w-0 truncate whitespace-nowrap ${n!=null?n:""}`,style:r,onMouseEnter:m=>{const y=o.current;!y||!fA(y)||(h({x:m.clientX,y:m.clientY}),c(!0))},onMouseLeave:()=>c(!1),children:e}),s.jsx(mA,{visible:u,text:e,mousePos:f,variant:l})]})}function G0({size:e=28}){return s.jsx("div",{className:"animate-spin","aria-hidden":"true",style:{width:e,height:e,border:"2px solid #e0e0e0",borderTopColor:"#1890ff",borderRadius:"50%"}})}function Lf({size:e=28,height:n=200}){return s.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:n},children:s.jsx(G0,{size:e})})}const K0="rgba(0, 0, 0, 0.1)",V0="rgba(0, 0, 0, 0.15)",pA="rgba(0, 0, 0, 0.2)",Q0="#3790FA",W0="#3489ee",gA="#2c73c8",X0="rgba(0, 0, 0, 0.85)",J0=32,Z0=1e3;function yA(e){return[...e].length}function zf(e,n){const r=[...e];return r.length<=n?e:r.slice(0,n).join("")}function ex(e){return e.replace(/\r\n|\r|\n/g,"")}function tx(e,n){const r=yA(e)>n;return{value:zf(e,n),overflow:r}}function bA(e){if(!e)return"-";const n=new Date(e);return`${n.getFullYear()}/${n.getMonth()+1}/${n.getDate()} ${String(n.getHours()).padStart(2,"0")}:${String(n.getMinutes()).padStart(2,"0")}:${String(n.getSeconds()).padStart(2,"0")}`}function xA(e){return e.schedule.kind==="at"&&e.last_status!=null?!1:e.enabled}function vA({checked:e,onChange:n,disabled:r}){return s.jsx("button",{onClick:n,disabled:r,style:{position:"relative",display:"inline-flex",alignItems:"center",width:40,height:22,borderRadius:11,background:e?"#1890ff":"#d9d9d9",border:"none",cursor:r?"not-allowed":"pointer",transition:"background 0.25s",flexShrink:0,opacity:r?.5:1,padding:0},children:s.jsx("span",{style:{position:"absolute",left:e?20:2,width:18,height:18,borderRadius:"50%",background:"#fff",boxShadow:"0 1px 4px rgba(0,0,0,0.2)",transition:"left 0.25s"}})})}const _A="'Noto Sans CJK SC', 'Source Han Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif";function wA({status:e}){if(!e)return s.jsx("span",{style:{color:"#bbb",fontSize:"var(--model-font-size)"},children:"-"});const n=e.toLowerCase(),r=n==="ok"||n==="success",l=r?"#00cc66":"#ff4d4f",o=r?"rgba(0, 204, 102, 0.1)":"rgba(255, 77, 79, 0.1)",u=S(r?"cron.status_success":"cron.status_failed");return s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",boxSizing:"border-box",height:24,padding:"0 4px",color:l,background:o,borderRadius:12,whiteSpace:"nowrap"},children:[s.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,style:{display:"block",flexShrink:0,marginRight:4},children:[s.jsx("circle",{cx:"7",cy:"7",r:"7",fill:l}),r?s.jsx("path",{d:"M4.5 7.5L6 9L9.5 5",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}):s.jsx("path",{d:"M4.5 4.5L9.5 9.5M9.5 4.5L4.5 9.5",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),s.jsx("span",{style:{display:"inline-flex",alignItems:"center",height:24,fontFamily:_A,fontSize:12,fontWeight:500,lineHeight:"24px"},children:u})]})}const kA=180,nx=124,SA=92;function CA({onEdit:e,onDelete:n,onRunNow:r}){const[l,o]=x.useState(!1),[u,c]=x.useState(!1),[f,h]=x.useState(!1),[m,y]=x.useState({}),g=x.useRef(null),_=x.useRef(null),{onMouseEnter:v,onMouseMove:w,onMouseLeave:j,tooltip:T}=Y0(l),C=x.useCallback(()=>{const D=_.current;if(!D)return;const F=D.getBoundingClientRect(),A=F.bottom+nx>window.innerHeight?F.top-nx:F.bottom,U=Math.max(8,F.right-kA+SA);y({position:"fixed",top:A,left:U,zIndex:1e4})},[]),E=x.useCallback(()=>{o(D=>(D||C(),!D))},[C]);x.useLayoutEffect(()=>{if(!l)return;C();const D=()=>o(!1);return window.addEventListener("resize",D),window.addEventListener("scroll",D,!0),()=>{window.removeEventListener("resize",D),window.removeEventListener("scroll",D,!0)}},[l,C]),x.useEffect(()=>{if(!l)return;const D=M=>{const A=M.target;g.current&&!g.current.contains(A)&&_.current&&!_.current.contains(A)&&o(!1)},F=()=>o(!1);return document.addEventListener("mousedown",D),window.addEventListener("blur",F),()=>{document.removeEventListener("mousedown",D),window.removeEventListener("blur",F)}},[l]);const N=l?"var(--model-alpha-hover)":f?"var(--model-alpha-active)":u?"var(--model-alpha-hover)":"transparent";return s.jsxs("div",{className:"relative inline-flex shrink-0",children:[s.jsx("button",{ref:_,type:"button","aria-expanded":l,"aria-label":"更多",className:"inline-flex shrink-0 cursor-default items-center justify-center transition-colors border-none",style:{width:36,height:36,borderRadius:6,background:N},onMouseEnter:D=>{c(!0),v(D)},onMouseMove:w,onMouseLeave:()=>{c(!1),h(!1),j()},onMouseDown:()=>h(!0),onMouseUp:()=>h(!1),onClick:E,children:s.jsx("img",{src:`${$e}/icons/view-more-horizontal-symbolic.svg`,alt:"",width:16,height:16,className:"pointer-events-none object-contain select-none",draggable:!1})}),l&&Dl.createPortal(s.jsxs("div",{ref:g,className:"model-more-menu-panel shrink-0",style:m,onMouseDown:D=>D.stopPropagation(),onClick:D=>D.stopPropagation(),children:[s.jsx("button",{type:"button",className:"skill-uninstall-btn",style:{width:164,height:36},onMouseDown:D=>D.stopPropagation(),onClick:()=>{o(!1),r()},children:S("cron.run_now")}),s.jsx("button",{type:"button",className:"skill-uninstall-btn",style:{width:164,height:36},onMouseDown:D=>D.stopPropagation(),onClick:()=>{o(!1),e()},children:S("cron.edit")}),s.jsx("button",{type:"button",className:"skill-uninstall-btn",style:{width:164,height:36},onMouseDown:D=>D.stopPropagation(),onClick:()=>{o(!1),n()},children:S("cron.delete")})]}),document.body),T]})}const ax="kylinbot_cron_interval_ui_meta_v1";function Wl(){const e=new Date;return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`}function Of(e){const n=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),l=String(e.getDate()).padStart(2,"0");return`${n}-${r}-${l}`}function rx(e,n){const r=e.trim(),l=n.trim();if(!/^\d{4}-\d{2}-\d{2}$/.test(r)||!/^\d{2}:\d{2}$/.test(l))return null;const o=new Date(`${r}T${l}:00`);return Number.isNaN(o.getTime())?null:o}function jA(e,n,r=new Date){const l=rx(e,n);return l?l.getTime()<r.getTime():!1}function EA(e){const n=(e!=null?e:"").trim().split(/\s+/);if(n.length!==5)return!1;const[r,l,o,u,c]=n;return!(r===void 0||l===void 0||o===void 0||u===void 0||c===void 0||o!=="*"||u!=="*"||!/^\d{1,2}$/.test(r)||!/^\d{1,2}$/.test(l)||c!=="*"&&!/^[\d,\s]+$/.test(c))}function NA(e){var r,l,o;const n=(e!=null?e:"").trim().split(/\s+/);if(n.length>=5){const u=(r=n[0])!=null?r:"0",c=(l=n[1])!=null?l:"0",f=(o=n[4])!=null?o:"*",h=`${c.padStart(2,"0")}:${u.padStart(2,"0")}`,m=f==="*"?[1,2,3,4,5,6,7]:f.split(",").map(y=>{const g=parseInt(y,10);return g===0?7:g}).filter(y=>y>=1&&y<=7);return{time:h,weekdays:m}}return{time:Wl(),weekdays:[1,2,3,4,5,6,7]}}function ga(e,n){return`${String(e).padStart(2,"0")}:${String(n).padStart(2,"0")}`}function lx(e){const n=(e!=null?e:"").trim().split(/\s+/);if(n.length!==5)return!1;const[r,l]=n;return!!(r!=null&&r.startsWith("*/")||r!=null&&r.includes("/")||r!=null&&r.includes("-")||l!=null&&l.includes("-"))}function TA(e){var _,v,w,j,T,C;const n=(e!=null?e:"").trim().split(/\s+/);if(n.length!==5)return null;const[r,l,o,u,c]=n;if(o!=="*"||u!=="*")return null;const f=c==="*"?[1,2,3,4,5,6,7]:c.split(",").map(E=>{const N=parseInt(E,10);return N===0?7:N}).filter(E=>E>=1&&E<=7);if(r.match(/^\d{1,2}(?:,\d{1,2})+$/)){const E=r.split(",").map(A=>parseInt(A,10));if(E.some((A,U)=>{var I;return!Number.isInteger(A)||A<0||A>59||U>0&&A<=((I=E[U-1])!=null?I:-1)}))return null;const N=((_=E[1])!=null?_:0)-((v=E[0])!=null?v:0);if(N<1||E.some((A,U)=>{var I;return U>0&&A-((I=E[U-1])!=null?I:A)!==N}))return null;const D=l.match(/^(\d{1,2})-(\d{1,2})$/);if(!D)return null;const F=parseInt(D[1],10),M=parseInt(D[2],10);return{value:String(N),unit:"minute",weekdays:f,windowStart:ga(F,(w=E[0])!=null?w:0),windowEnd:ga(M,(j=E[E.length-1])!=null?j:59)}}const m=r.match(/^(\d{1,2})\/(\d{1,2})$/);if(m){const E=parseInt(m[1],10),N=m[2],D=l.match(/^(\d{1,2})-(\d{1,2})$/);if(!D)return null;const F=parseInt(D[1],10),M=parseInt(D[2],10);return{value:N,unit:"minute",weekdays:f,windowStart:ga(F,E),windowEnd:F===M?ga(M,E):ga(M,59)}}if(r.startsWith("*/")){const E=r.slice(2),N=l.match(/^(\d{1,2})-(\d{1,2})$/);if(!N)return null;const D=parseInt(N[1],10),F=parseInt(N[2],10);return{value:E,unit:"minute",weekdays:f,windowStart:ga(D,0),windowEnd:ga(F,59)}}const y=r.match(/^(\d{1,2})(?:-(\d{1,2}))?$/),g=l.match(/^(\d{1,2})-(\d{1,2})(?:\/(\d{1,2}))?$/);if(g&&y){const E=parseInt(y[1],10),N=y[2]?parseInt(y[2],10):E,D=parseInt(g[1],10),F=parseInt(g[2],10);return{value:(T=g[3])!=null?T:"1",unit:"hour",weekdays:f,windowStart:ga(D,E),windowEnd:ga(F,N)}}if(r==="0"&&l.includes("-")){const E=l.match(/^(\d{1,2})-(\d{1,2})(?:\/(\d{1,2}))?$/);if(!E)return null;const N=parseInt(E[1],10),D=parseInt(E[2],10);return{value:(C=E[3])!=null?C:"1",unit:"hour",weekdays:f,windowStart:ga(N,0),windowEnd:ga(D,59)}}return null}function Xl(e){var o,u;const n=e.trim().match(/^(\d{1,2}):(\d{2})$/);if(!n)return null;const r=parseInt((o=n[1])!=null?o:"",10),l=parseInt((u=n[2])!=null?u:"",10);return!Number.isFinite(r)||!Number.isFinite(l)||r<0||r>23||l<0||l>59?null:r*60+l}function AA(e,n){if(!Number.isInteger(e)||!Number.isInteger(n)||e<0||e>59||n<1||n>59)return null;const r=[];for(let l=e;l<=59;l+=n)r.push(l);return r.join(",")}function ix(e){var n,r,l,o,u;return e.schedule.kind==="cron"?`cron:${(r=(n=e.schedule.expr)!=null?n:e.expression)!=null?r:""}:${(l=e.schedule.tz)!=null?l:""}`:e.schedule.kind==="every"?`every:${(o=e.schedule.every_ms)!=null?o:""}`:`at:${(u=e.schedule.at)!=null?u:""}`}function ox(e){if(!Array.isArray(e))return null;const n=[...new Set(e.filter(r=>typeof r=="number"&&Number.isInteger(r)&&r>=1&&r<=7))].sort((r,l)=>r-l);return n.length>0?n:null}function sx(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Bf(){if(typeof localStorage>"u")return{};try{const e=localStorage.getItem(ax);if(!e)return{};const n=JSON.parse(e);return sx(n)?n:{}}catch{return{}}}function Ff(e){if(!(typeof localStorage>"u"))try{localStorage.setItem(ax,JSON.stringify(e))}catch{}}function MA(e){const n=Bf()[e.id];if(!sx(n))return null;const r=n;if(!r||r.scheduleSignature!==ix(e)||r.unit!=="minute"&&r.unit!=="hour"||typeof r.value!="string"||!/^\d+$/.test(r.value)||typeof r.windowStart!="string"||typeof r.windowEnd!="string")return null;const l=Xl(r.windowStart),o=Xl(r.windowEnd);if(l===null||o===null||o<l)return null;const u=ox(r.weekdays);return u?{value:r.value,unit:r.unit,weekdays:u,windowStart:r.windowStart,windowEnd:r.windowEnd}:null}function RA(e,n){const r=Bf();if(!n){delete r[e.id],Ff(r);return}const l=ox(n.weekdays),o=Xl(n.windowStart),u=Xl(n.windowEnd);!l||o===null||u===null||u<o||(r[e.id]={scheduleSignature:ix(e),value:n.value,unit:n.unit,weekdays:l,windowStart:n.windowStart,windowEnd:n.windowEnd},Ff(r))}function DA(e){const n=Bf();delete n[e],Ff(n)}function LA(e,n,r,l,o){const u=n==="hour"?23:59;if(!Number.isFinite(e)||e<1||e>u||r.length===0)return null;const c=Xl(l),f=Xl(o);if(c===null||f===null||f<c)return null;const h=l==="00:00"&&o==="23:59",m=r.length===7;if(h&&m)return{kind:"every",every_ms:e*(n==="minute"?6e4:36e5)};const y=c%60,g=f%60,_=Math.floor(c/60),v=Math.floor(f/60);if(v<_)return null;const w=r.map(E=>E===7?0:E).sort((E,N)=>E-N).join(",");if(n==="minute"){const E=AA(y,e);return E?{kind:"cron",expr:`${E} ${_}-${v} * * ${w}`}:null}const j=e===1?`${_}-${v}`:`${_}-${v}/${e}`;return{kind:"cron",expr:`${y===g?String(y):`${y}-${g}`} ${j} * * ${w}`}}function cx(e,n,r,l,o,u,c,f,h,m,y){if(e==="daily"){const[_="0",v="0"]=n.split(":"),w=parseInt(_,10);return{kind:"cron",expr:`${parseInt(v,10)} ${w} * * *`}}if(e==="custom"){if(l.length===0)return null;const[_="0",v="0"]=r.split(":"),w=parseInt(_,10),j=parseInt(v,10),T=l.length===7?"*":l.map(C=>C===7?0:C).join(",");return{kind:"cron",expr:`${j} ${w} * * ${T}`}}if(e==="interval"){const _=parseInt(o,10);return LA(_,u,c,f,h)}const g=rx(y,m);return g?{kind:"at",at:g.toISOString()}:null}function ux({weekdays:e,onChange:n}){const r=[1,2,3,4,5,6,7],l={1:"cron.weekday_1",2:"cron.weekday_2",3:"cron.weekday_3",4:"cron.weekday_4",5:"cron.weekday_5",6:"cron.weekday_6",7:"cron.weekday_7"};return s.jsx("div",{style:{display:"flex",flexWrap:"wrap",marginTop:8},children:r.map((o,u)=>{var v;const c=e.includes(o),f=c&&e.length===1,h=(v=l[o])!=null?v:"cron.weekday_1",m=c?"rgba(55, 144, 250, 0.1)":"#e6e6e6",y=c?"rgba(55, 144, 250, 0.15)":"#dcdcdc",g=c?"rgba(55, 144, 250, 0.2)":"#b9b9b9",_=c?"#3790fa":"rgba(0, 0, 0, 0.85)";return s.jsxs(Fi.Fragment,{children:[s.jsx("button",{type:"button",onClick:()=>{if(c){if(e.length<=1)return;n(e.filter(w=>w!==o));return}n([...e,o].sort((w,j)=>w-j))},onMouseEnter:w=>w.currentTarget.style.background=y,onMouseLeave:w=>w.currentTarget.style.background=m,onMouseDown:w=>w.currentTarget.style.background=g,onMouseUp:w=>w.currentTarget.style.background=y,style:{boxSizing:"border-box",display:"inline-flex",alignItems:"center",justifyContent:"center",height:36,padding:"0 8px",width:"auto",borderRadius:6,border:"none",background:m,color:_,fontSize:14,fontWeight:400,cursor:f?"not-allowed":"pointer",transition:"background 0.15s"},children:S(h)}),u<6&&s.jsx("span",{style:{width:"8px",flexShrink:0,display:"inline-block"},"aria-hidden":!0})]},o)})})}const xr="rgba(0, 0, 0, 0.85)",zA="rgba(0, 0, 0, 0.85)";function dx(e,n){const r=!!e.focused,l=!!(e.hovered&&!r);return{boxSizing:"border-box",borderRadius:6,border:r?"2px solid #3790FA":"1px solid transparent",background:r?"#FFFFFF":l?"#DCDCDC":"#E6E6E6",outline:"none",color:zA,...n}}const OA=36,BA=16;function fx({value:e,onChange:n,options:r,triggerStyle:l,containerStyle:o}){var F,M;const[u,c]=x.useState(!1),[f,h]=x.useState(!1),[m,y]=x.useState({}),g=x.useRef(null),_=x.useRef(null),v=x.useRef(null),w=r.length*OA+BA,j=x.useCallback(()=>{const A=_.current;if(!A)return;const U=A.getBoundingClientRect(),I=4,L=window.innerHeight-U.bottom-I,B=U.top-I,q=L<w&&B>=L;h(q);const K=q?Math.max(8,U.top-w-I):U.bottom+I;y({position:"fixed",top:K,left:U.left,width:U.width,zIndex:10100})},[w]),T=x.useCallback(()=>{c(A=>(A||j(),!A))},[j]);x.useLayoutEffect(()=>{if(!u)return;j();const A=()=>c(!1);return window.addEventListener("resize",A),window.addEventListener("scroll",A,!0),()=>{window.removeEventListener("resize",A),window.removeEventListener("scroll",A,!0)}},[u,j]),x.useEffect(()=>{if(!u)return;const A=I=>{var B,q,K;const L=I.target;(B=v.current)!=null&&B.contains(L)||(q=_.current)!=null&&q.contains(L)||(K=g.current)!=null&&K.contains(L)||c(!1)},U=()=>c(!1);return document.addEventListener("mousedown",A),window.addEventListener("blur",U),()=>{document.removeEventListener("mousedown",A),window.removeEventListener("blur",U)}},[u]);const C=(M=(F=r.find(A=>A.value===e))==null?void 0:F.label)!=null?M:e!==""?e:"",E={...l,display:"flex",alignItems:"center",gap:8,width:"100%",justifyContent:"space-between",textAlign:"left",cursor:"pointer",fontFamily:"inherit"},N={position:"relative",width:"100%",...o},D=s.jsx("div",{ref:v,className:"model-dialog-dropdown cron-modal-list-dropdown box-border flex flex-col overflow-hidden",style:{...m,padding:"8px 6px 8px 8px",borderRadius:8,border:"1px solid #E5E7EB",background:"#FFFFFF",boxSizing:"border-box"},onMouseDown:A=>A.stopPropagation(),children:s.jsx("div",{role:"listbox",className:"flex w-full flex-col",style:{width:"100%"},onMouseDown:A=>A.stopPropagation(),children:r.map((A,U)=>{const I=e===A.value;return s.jsx(Af,{selected:I,reserveCheckmarkSlot:!0,fullWidth:!0,onPick:()=>{n(A.value),c(!1)},children:A.label},`${A.value}:${U}:${A.label}`)})})});return s.jsxs("div",{ref:g,style:N,children:[s.jsxs("button",{ref:_,type:"button","aria-expanded":u,"aria-haspopup":"listbox",onClick:T,style:E,children:[s.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,minWidth:0,color:xr},children:C}),u&&f?s.jsx(ks,{size:16,style:{flexShrink:0,color:xr},"aria-hidden":!0}):s.jsx(ha,{size:16,style:{flexShrink:0,color:xr},"aria-hidden":!0})]}),u&&Dl.createPortal(D,document.body)]})}function FA({value:e,onChange:n,triggerStyle:r}){return s.jsx(fx,{value:e,onChange:l=>l==="daily"||l==="interval"||l==="once"||l==="custom"?n(l):void 0,triggerStyle:r,options:[{value:"daily",label:S("cron.schedule_daily_label")},{value:"interval",label:S("cron.schedule_interval_label")},{value:"once",label:S("cron.schedule_once_label")},{value:"custom",label:S("cron.schedule_custom_label")}]})}function IA({value:e,onChange:n,triggerStyle:r}){return s.jsx(fx,{value:e,containerStyle:{flex:1,minWidth:0},onChange:l=>l==="minute"||l==="hour"?n(l):void 0,triggerStyle:r,options:[{value:"minute",label:S("cron.interval_unit_minute")},{value:"hour",label:S("cron.interval_unit_hour")}]})}function uo({value:e,onChange:n,style:r}){var D,F;const[l,o]=x.useState(!1),[u,c]=x.useState("h"),[f,h]=x.useState(null),m=x.useRef(null),y=e.split(":"),g=Math.min(23,Math.max(0,parseInt((D=y[0])!=null?D:"0",10)||0)),_=Math.min(59,Math.max(0,parseInt((F=y[1])!=null?F:"0",10)||0)),v=String(g).padStart(2,"0"),w=String(_).padStart(2,"0"),j=(M,A)=>n(`${String((M%24+24)%24).padStart(2,"0")}:${String((A%60+60)%60).padStart(2,"0")}`),T=M=>{u==="h"?j(g+M,_):j(g,_+M)},C=M=>{const A=parseInt(M,10);if(u==="h")if(f===null)j(A,_),A>=3?(h(null),c("m")):h(M);else{const U=parseInt(f,10)*10+A;j(U<=23?U:A,_),h(null),c("m")}else if(f===null)j(g,A),A>=6?h(null):h(M);else{const U=parseInt(f,10)*10+A;j(g,U<=59?U:A),h(null)}},E=M=>{switch(M.key){case"ArrowUp":M.preventDefault(),T(1);break;case"ArrowDown":M.preventDefault(),T(-1);break;case"ArrowLeft":M.preventDefault(),c("h"),h(null);break;case"ArrowRight":M.preventDefault(),c("m"),h(null);break;default:/^\d$/.test(M.key)&&(M.preventDefault(),C(M.key))}},N=M=>({padding:"0 3px",borderRadius:2,background:l&&M?"#3790FA":"transparent",color:l&&M?"#fff":"rgba(0,0,0,0.85)",fontSize:13,minWidth:22,textAlign:"center",display:"inline-block",lineHeight:"22px",cursor:"default"});return s.jsxs("div",{ref:m,tabIndex:0,onFocus:()=>o(!0),onBlur:M=>{var A;(A=m.current)!=null&&A.contains(M.relatedTarget)||(o(!1),h(null))},onKeyDown:E,style:{...r,display:"flex",alignItems:"center",paddingLeft:12,paddingRight:36,position:"relative",cursor:"default",outline:"none",border:l?"1px solid #3790FA":"1px solid transparent",borderRadius:6,background:"#E6E6E6",height:36,boxSizing:"border-box",userSelect:"none"},children:[s.jsx("span",{style:N(u==="h"),onClick:()=>{var M;c("h"),(M=m.current)==null||M.focus()},children:v}),s.jsx("span",{style:{fontSize:13,color:"rgba(0,0,0,0.85)",padding:"0 1px"},children:":"}),s.jsx("span",{style:N(u==="m"),onClick:()=>{var M;c("m"),(M=m.current)==null||M.focus()},children:w}),s.jsxs("div",{style:{position:"absolute",right:8,top:0,bottom:0,width:16,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[s.jsx("button",{type:"button",tabIndex:-1,onClick:M=>{var A;M.preventDefault(),T(1),(A=m.current)==null||A.focus()},"aria-label":S("cron.daily_time_step_up"),style:{padding:0,margin:0,border:"none",background:"transparent",cursor:"pointer",height:18,width:16,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:xr},children:s.jsx(ks,{size:16,strokeWidth:2,"aria-hidden":!0})}),s.jsx("button",{type:"button",tabIndex:-1,onClick:M=>{var A;M.preventDefault(),T(-1),(A=m.current)==null||A.focus()},"aria-label":S("cron.daily_time_step_down"),style:{padding:0,margin:0,border:"none",background:"transparent",cursor:"pointer",height:18,width:16,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:xr},children:s.jsx(ha,{size:16,strokeWidth:2,"aria-hidden":!0})})]})]})}function UA({value:e,onChange:n,style:r}){const l=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e.trim()),o=l?parseInt(l[1],10):new Date().getFullYear(),u=l?parseInt(l[2],10):new Date().getMonth()+1,c=l?parseInt(l[3],10):new Date().getDate(),f=x.useRef(null),h=x.useRef(null),[m,y]=x.useState(!1),[g,_]=x.useState({}),[v,w]=x.useState(o),[j,T]=x.useState(u),C=`${String(o).padStart(4,"0")}/${String(u).padStart(2,"0")}/${String(c).padStart(2,"0")}`;x.useEffect(()=>{m&&(w(o),T(u))},[m,o,u]);const E=x.useCallback(()=>{var B;const I=(B=f.current)==null?void 0:B.getBoundingClientRect();if(!I)return;_({position:"fixed",right:window.innerWidth-I.right,bottom:window.innerHeight-I.top+4,width:"min(300px, calc(100vw - 32px))",zIndex:10100,background:"#fff",borderRadius:12,boxShadow:"0 8px 28px rgba(0,0,0,0.14)",padding:"12px 12px 14px",boxSizing:"border-box"})},[]);x.useLayoutEffect(()=>{m&&E()},[m,E]),x.useEffect(()=>{if(m)return window.addEventListener("resize",E),window.addEventListener("scroll",E,!0),()=>{window.removeEventListener("resize",E),window.removeEventListener("scroll",E,!0)}},[m,E]),x.useEffect(()=>{if(!m)return;const I=B=>{var K,G;const q=B.target;(K=f.current)!=null&&K.contains(q)||(G=h.current)!=null&&G.contains(q)||y(!1)},L=()=>y(!1);return document.addEventListener("mousedown",I),window.addEventListener("blur",L),()=>{document.removeEventListener("mousedown",I),window.removeEventListener("blur",L)}},[m]);const N=x.useMemo(()=>{const L=(new Date(v,j-1,1).getDay()+6)%7,B=new Date(v,j,0).getDate(),q=[];for(let G=L;G>0;G--)q.push({date:new Date(v,j-1,1-G),inMonth:!1});for(let G=1;G<=B;G++)q.push({date:new Date(v,j-1,G),inMonth:!0});let K=new Date(v,j-1,B);for(;q.length%7!==0;)K.setDate(K.getDate()+1),q.push({date:new Date(K),inMonth:!1});for(;q.length<42;)K.setDate(K.getDate()+1),q.push({date:new Date(K),inMonth:!1});return q},[v,j]),D=I=>{const L=new Date(v,j-1+I,1);w(L.getFullYear()),T(L.getMonth()+1)},F=I=>{w(L=>L+I)},M=`${v}/${j}/${c}`,A=(I,L,B,q)=>I.getFullYear()===L&&I.getMonth()+1===B&&I.getDate()===q,U={padding:4,border:"none",background:"transparent",cursor:"pointer",borderRadius:4,color:xr,display:"flex",alignItems:"center",justifyContent:"center"};return s.jsxs("div",{ref:f,style:{...r,position:"relative",minWidth:0},children:[s.jsxs("button",{type:"button",onClick:()=>{y(I=>(I||E(),!I))},"aria-label":S("cron.once_open_calendar"),"aria-expanded":m,style:{width:"100%",height:36,boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:12,paddingRight:10,border:m?"1px solid #3790FA":"1px solid transparent",borderRadius:6,background:"#E6E6E6",cursor:"pointer",fontSize:13,color:"rgba(0,0,0,0.85)",outline:"none",textAlign:"left",fontFamily:"inherit"},children:[s.jsx("span",{children:C}),s.jsx("img",{src:`${$e}/icons/ukui-datetime-symbolic.svg`,width:18,height:18,alt:"","aria-hidden":!0,style:{flexShrink:0,display:"block",opacity:.45,objectFit:"contain"}})]}),m&&Dl.createPortal(s.jsxs("div",{ref:h,style:g,onMouseDown:I=>I.stopPropagation(),children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:10,gap:4},children:[s.jsx("button",{type:"button",style:U,"aria-label":S("cron.cal_prev_year"),onClick:()=>F(-1),children:s.jsx($S,{size:18,strokeWidth:2})}),s.jsx("button",{type:"button",style:U,"aria-label":S("cron.cal_prev_month"),onClick:()=>D(-1),children:s.jsx(PS,{size:18,strokeWidth:2})}),s.jsx("span",{style:{fontSize:14,color:"rgba(0,0,0,0.85)",fontWeight:500,flex:1,textAlign:"center"},children:M}),s.jsx("button",{type:"button",style:U,"aria-label":S("cron.cal_next_month"),onClick:()=>D(1),children:s.jsx(ws,{size:18,strokeWidth:2})}),s.jsx("button",{type:"button",style:U,"aria-label":S("cron.cal_next_year"),onClick:()=>F(1),children:s.jsx(YS,{size:18,strokeWidth:2})})]}),s.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:2,textAlign:"center",fontSize:12,color:"rgba(0,0,0,0.45)",marginBottom:6},children:[1,2,3,4,5,6,7].map(I=>s.jsx("span",{children:S(`cron.cal_head_${I}`)},I))}),s.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:4},children:N.map(({date:I,inMonth:L},B)=>{const q=I.getDate(),K=A(I,o,u,c);return s.jsx("button",{type:"button",onClick:()=>{n(Of(I)),y(!1)},style:{height:32,border:"none",borderRadius:6,cursor:"pointer",fontSize:13,fontWeight:K?600:400,background:K?"#3790FA":"transparent",color:K?"#fff":L?"rgba(0,0,0,0.85)":"rgba(0,0,0,0.28)"},children:q},`${B}-${I.getTime()}`)})})]}),document.body)]})}function HA({job:e,onClose:n,onSaved:r}){var Ie,cn,Kt,wr,zn,Xn,Jn,Et,Zn,ba,kr,Sr,Ya,xa,ai,dl;const l=e!=="add",o=l?e:null,u=()=>{var fe,Le;if(!o)return"daily";if(o.schedule.kind==="cron"){const Qe=(fe=o.schedule.expr)!=null?fe:"";if(lx(Qe))return"interval";const ea=!!(o.schedule.tz&&String(o.schedule.tz).trim());return!EA(Qe)||ea?"custom":((Le=Qe.trim().split(/\s+/)[4])!=null?Le:"*")==="*"?"daily":"custom"}return o.schedule.kind==="every"?"interval":"once"},c=(o==null?void 0:o.schedule.kind)==="cron"&&o.schedule.expr?NA(o.schedule.expr):null,f=(o==null?void 0:o.schedule.kind)==="cron"&&o.schedule.expr&&lx(o.schedule.expr)?TA(o.schedule.expr):null,h=(Ie=o?MA(o):null)!=null?Ie:f,m=()=>{if((o==null?void 0:o.schedule.kind)==="every"&&o.schedule.every_ms){const fe=o.schedule.every_ms;return fe%36e5===0?String(fe/36e5):fe%6e4===0?String(fe/6e4):String(Math.max(1,Math.round(fe/6e4)))}return h?h.value:"5"},y=()=>(o==null?void 0:o.schedule.kind)==="every"&&o.schedule.every_ms?o.schedule.every_ms%36e5===0?"hour":"minute":h?h.unit:"minute",[g,_]=x.useState(()=>{var fe;return zf(ex((fe=o==null?void 0:o.name)!=null?fe:""),J0)}),[v,w]=x.useState(()=>{var fe,Le;return zf((Le=(fe=o==null?void 0:o.prompt)!=null?fe:o==null?void 0:o.command)!=null?Le:"",Z0)}),[j,T]=x.useState(!1),[C,E]=x.useState(!1),[N,D]=x.useState(u()),[F,M]=x.useState((cn=c==null?void 0:c.time)!=null?cn:Wl()),[A,U]=x.useState((Kt=c==null?void 0:c.time)!=null?Kt:Wl()),[I,L]=x.useState((wr=c==null?void 0:c.weekdays)!=null?wr:[1,2,3,4,5,6,7]),[B,q]=x.useState(m()),[K,G]=x.useState(y()),[ne,V]=x.useState((zn=h==null?void 0:h.weekdays)!=null?zn:[1,2,3,4,5,6,7]),[le,me]=x.useState((Xn=h==null?void 0:h.windowStart)!=null?Xn:"00:00"),[ce,O]=x.useState((Jn=h==null?void 0:h.windowEnd)!=null?Jn:"23:59"),H=()=>{if((o==null?void 0:o.schedule.kind)==="at"&&o.schedule.at){const fe=new Date(o.schedule.at);return`${String(fe.getHours()).padStart(2,"0")}:${String(fe.getMinutes()).padStart(2,"0")}`}return Wl()},Z=()=>(o==null?void 0:o.schedule.kind)==="at"&&o.schedule.at?Of(new Date(o.schedule.at)):Of(new Date),[z,oe]=x.useState(H()),[ue,ve]=x.useState(Z()),[Se,Te]=x.useState(null),[re,ke]=x.useState(!1),[Ze,Fe]=x.useState(!1),[Mt,vt]=x.useState(!1),[hn,Yt]=x.useState(!1),[Ma,Ln]=x.useState(!1),Rt=x.useRef({name:(Et=o==null?void 0:o.name)!=null?Et:"",prompt:(ba=(Zn=o==null?void 0:o.prompt)!=null?Zn:o==null?void 0:o.command)!=null?ba:"",scheduleKind:u(),dailyTime:(kr=c==null?void 0:c.time)!=null?kr:Wl(),customTime:(Sr=c==null?void 0:c.time)!=null?Sr:Wl(),customWeekdays:[...(Ya=c==null?void 0:c.weekdays)!=null?Ya:[1,2,3,4,5,6,7]],intervalValue:m(),intervalUnit:y(),intervalWeekdays:(xa=h==null?void 0:h.weekdays)!=null?xa:[1,2,3,4,5,6,7],intervalWindowStart:(ai=h==null?void 0:h.windowStart)!=null?ai:"00:00",intervalWindowEnd:(dl=h==null?void 0:h.windowEnd)!=null?dl:"23:59",onceTime:H(),onceDate:Z()}),bn=x.useMemo(()=>N==="once"&&jA(ue,z),[N,ue,z]),Wn=x.useMemo(()=>cx(N,F,A,I,B,K,ne,le,ce,z,ue)!==null,[N,F,A,I,B,K,ne,le,ce,z,ue]),sn=x.useMemo(()=>{if(!Wn||bn)return!1;if(!l)return g.trim().length>0&&v.trim().length>0;const fe=Rt.current;return g!==fe.name||v!==fe.prompt||N!==fe.scheduleKind||F!==fe.dailyTime||A!==fe.customTime||I.length!==fe.customWeekdays.length||I.some((Le,Qe)=>Le!==fe.customWeekdays[Qe])||B!==fe.intervalValue||K!==fe.intervalUnit||ne.length!==fe.intervalWeekdays.length||ne.some((Le,Qe)=>Le!==fe.intervalWeekdays[Qe])||le!==fe.intervalWindowStart||ce!==fe.intervalWindowEnd||z!==fe.onceTime||ue!==fe.onceDate},[Wn,bn,l,g,v,N,F,A,I,B,K,ne,le,ce,z,ue]),ya=async()=>{if(!v.trim()){Te(S("cron.validation_error"));return}const fe=cx(N,F,A,I,B,K,ne,le,ce,z,ue);if(fe){ke(!0),Te(null);try{const Le={name:g.trim()||void 0,schedule:fe,prompt:v.trim(),job_type:"agent",session_target:"main",...l?{}:{enabled:!0}};let Qe;l?Qe=await y4(o.id,Le):Qe=await p4(Le),RA(Qe,N==="interval"?{value:B,unit:K,weekdays:ne,windowStart:le,windowEnd:ce}:null),r(Qe)}catch(Le){Te(Le instanceof Error?Le.message:S(l?"cron.edit_error":"cron.add_error"))}finally{ke(!1)}}},tt={display:"block",fontSize:14,color:"rgba(0,0,0,0.85)",marginBottom:6,fontWeight:400},xn={marginTop:4,fontSize:12,fontWeight:400,color:"#F53F3F",lineHeight:"16px",minHeight:16},te=(fe,Le)=>({...dx({focused:fe,hovered:Le}),display:"block",width:"100%",height:36,padding:fe?"0 11px":"0 12px",fontSize:13}),pe=(fe,Le)=>({...dx({focused:fe,hovered:Le}),display:"block",width:"100%",height:120,padding:fe?"7px 11px":"8px 12px",resize:"none",lineHeight:"1.5",fontSize:13}),je={display:"block",width:"100%",boxSizing:"border-box",height:36,padding:"0 12px",border:"none",borderRadius:6,fontSize:13,color:"rgba(0,0,0,0.85)",background:"#E6E6E6",outline:"none"},Re={...je,padding:"0 8px 0 12px",cursor:"pointer",appearance:"none"},de=1,Ve=K==="hour"?23:59,lt=parseInt(B,10),bt=B===""||!Number.isFinite(lt)||lt<=de,it=Number.isFinite(lt)&&lt>=Ve,St=fe=>{const Le=parseInt(B,10),Qe=Number.isFinite(Le)&&Le>=de?Le:de;q(String(Math.min(Ve,Math.max(de,Qe+fe))))};return s.jsxs("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",background:"transparent",display:"flex",alignItems:"center",justifyContent:"center",zIndex:200},children:[s.jsx("style",{children:`
        .cron-add-task-modal input::-webkit-input-placeholder,
        .cron-add-task-modal textarea::-webkit-input-placeholder {
          color: rgba(0, 0, 0, 0.35) !important;
          -webkit-text-fill-color: rgba(0, 0, 0, 0.35) !important;
          opacity: 1 !important;
        }
        .cron-add-task-modal input::-moz-placeholder,
        .cron-add-task-modal textarea::-moz-placeholder {
          color: rgba(0, 0, 0, 0.35) !important;
          opacity: 1 !important;
        }
        .cron-add-task-modal input:-ms-input-placeholder,
        .cron-add-task-modal textarea:-ms-input-placeholder {
          color: rgba(0, 0, 0, 0.35) !important;
        }
        .cron-add-task-modal input::placeholder,
        .cron-add-task-modal textarea::placeholder {
          color: rgba(0, 0, 0, 0.35) !important;
          opacity: 1 !important;
        }
        .cron-add-task-modal input.cron-interval-number-input::-webkit-outer-spin-button,
        .cron-add-task-modal input.cron-interval-number-input::-webkit-inner-spin-button {
          -webkit-appearance: none;
          margin: 0;
        }
        .cron-add-task-modal input.cron-interval-number-input {
          appearance: none;
          -moz-appearance: textfield;
        }
      `}),s.jsxs("div",{className:"cron-add-task-modal",style:{background:"#fff",borderRadius:14,width:424,maxHeight:520,display:"flex",flexDirection:"column",boxShadow:"0 8px 32px rgba(0,0,0,0.18)",transform:"translate(-28px, -40px)"},children:[s.jsxs("div",{style:{height:40,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:12,paddingRight:8,boxSizing:"border-box"},children:[s.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",alignSelf:"stretch",flex:"1 1 auto",minWidth:0,lineHeight:0},children:[s.jsx("span",{style:{display:"inline-flex",flexShrink:0,alignItems:"center",justifyContent:"center",alignSelf:"center"},children:s.jsx("img",{src:`${$e}/icons/logo.png`,alt:"",width:24,height:24,style:{width:24,height:24,objectFit:"contain",display:"block"},onError:fe=>{fe.target.style.display="none"}})}),s.jsx("span",{style:{display:"inline-flex",alignItems:"center",alignSelf:"center",marginLeft:8,lineHeight:"20px",fontSize:14,fontWeight:400,color:"rgba(0,0,0,0.85)"},children:S(l?"cron.edit_modal_title":"cron.add_modal_title")})]}),s.jsx(br,{onClick:n})]}),s.jsxs("div",{style:{padding:"0 24px 4px",overflowY:"auto",flex:1},children:[Se&&s.jsx("div",{style:{background:"#fff2f0",border:"1px solid #ffa39e",borderRadius:6,padding:"8px 12px",marginBottom:12,fontSize:13,color:"#cf1322"},children:Se}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,paddingBottom:8},children:[s.jsxs("div",{children:[s.jsx("label",{style:tt,children:S("cron.task_name")}),s.jsx("input",{type:"text",value:g,onChange:fe=>{const Le=ex(fe.target.value),{value:Qe,overflow:ea}=tx(Le,J0);T(ea),_(Qe)},onFocus:()=>Fe(!0),onBlur:()=>Fe(!1),onMouseEnter:()=>vt(!0),onMouseLeave:()=>vt(!1),placeholder:S("cron.task_name_placeholder"),style:te(Ze,Mt)}),s.jsx("div",{style:xn,children:j?"长度不得大于 32 字符":" "})]}),s.jsxs("div",{children:[s.jsx("label",{style:tt,children:S("cron.task_prompt_label")}),s.jsx("textarea",{value:v,onChange:fe=>{const{value:Le,overflow:Qe}=tx(fe.target.value,Z0);E(Qe),w(Le)},onFocus:()=>Yt(!0),onBlur:()=>Yt(!1),onMouseEnter:()=>Ln(!0),onMouseLeave:()=>Ln(!1),placeholder:S("cron.task_prompt_placeholder"),style:pe(hn,Ma)}),s.jsx("div",{style:xn,children:C?"长度不得大于 1000 字符":" "})]}),s.jsxs("div",{children:[s.jsx("label",{style:tt,children:S("cron.exec_time")}),s.jsx(FA,{value:N,onChange:D,triggerStyle:Re}),N==="daily"&&s.jsx("div",{style:{marginTop:8},children:s.jsx(uo,{value:F,onChange:M,style:{width:"100%"}})}),N==="custom"&&s.jsxs("div",{style:{marginTop:8},children:[s.jsx(uo,{value:A,onChange:U,style:{width:"100%"}}),s.jsx(ux,{weekdays:I,onChange:L})]}),N==="interval"&&s.jsxs("div",{style:{marginTop:8,display:"flex",flexDirection:"column"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",width:"100%",flexWrap:"nowrap"},children:[s.jsx("span",{style:{fontSize:14,color:"rgba(0,0,0,0.85)",whiteSpace:"nowrap",flexShrink:0},children:S("cron.interval_row_label")}),s.jsx("span",{style:{width:"8px",flexShrink:0,display:"inline-block"},"aria-hidden":!0}),s.jsxs("div",{style:{flex:1,minWidth:0,position:"relative"},children:[s.jsx("input",{type:"text",inputMode:"numeric",className:"cron-interval-number-input",value:B,onKeyDown:fe=>{fe.key==="Backspace"||fe.key==="Delete"||fe.key==="Tab"||fe.key==="Escape"||fe.key==="Enter"||fe.key==="ArrowLeft"||fe.key==="ArrowRight"||fe.key==="Home"||fe.key==="End"||fe.ctrlKey||fe.metaKey||/^\d$/.test(fe.key)||fe.preventDefault()},onPaste:fe=>{fe.preventDefault();const Le=fe.clipboardData.getData("text").replace(/\D/g,"");if(!Le)return;const Qe=parseInt(Le,10);Number.isFinite(Qe)&&q(String(Math.min(Ve,Math.max(de,Qe))))},onChange:fe=>{const Le=fe.target.value;if(Le===""){q("");return}if(!/^\d+$/.test(Le))return;const Qe=parseInt(Le,10);!Number.isFinite(Qe)||Qe<de||Qe>Ve||q(String(Qe))},style:{...je,width:"100%",paddingLeft:12,paddingRight:36,textAlign:"left"}}),s.jsxs("div",{style:{position:"absolute",right:8,top:0,bottom:0,width:16,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:0},children:[s.jsx("button",{type:"button",disabled:it,onClick:fe=>{fe.preventDefault(),St(1)},"aria-label":S("cron.interval_step_up"),style:{padding:0,margin:0,border:"none",background:"transparent",cursor:it?"not-allowed":"pointer",height:18,width:16,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:xr,opacity:it?.3:1},children:s.jsx(ks,{size:16,strokeWidth:2,"aria-hidden":!0})}),s.jsx("button",{type:"button",disabled:bt,onClick:fe=>{fe.preventDefault(),St(-1)},"aria-label":S("cron.interval_step_down"),style:{padding:0,margin:0,border:"none",background:"transparent",cursor:bt?"not-allowed":"pointer",height:18,width:16,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:xr,opacity:bt?.3:1},children:s.jsx(ha,{size:16,strokeWidth:2,"aria-hidden":!0})})]})]}),s.jsx("span",{style:{width:"8px",flexShrink:0,display:"inline-block"},"aria-hidden":!0}),s.jsx(IA,{value:K,triggerStyle:Re,onChange:fe=>{G(fe);const Le=fe==="hour"?23:59;q(Qe=>{if(Qe==="")return"";const ea=parseInt(Qe,10);return Number.isFinite(ea)?String(Math.min(Le,Math.max(1,ea))):String(Math.min(Le,Math.max(1,5)))})}})]}),s.jsx("div",{style:{marginBottom:"8px"},children:s.jsx(ux,{weekdays:ne,onChange:V})}),s.jsxs("div",{style:{marginTop:8,display:"flex",alignItems:"center",width:"100%"},children:[s.jsx("span",{style:{fontSize:14,color:"rgba(0,0,0,0.85)",whiteSpace:"nowrap",flexShrink:0,fontWeight:400},children:S("cron.interval_effective_time")}),s.jsx("span",{style:{width:"8px",flexShrink:0,display:"inline-block"},"aria-hidden":!0}),s.jsx(uo,{value:le,onChange:me,style:{flex:1,minWidth:0}}),s.jsx("span",{style:{width:"8px",flexShrink:0,display:"inline-block"},"aria-hidden":!0}),s.jsx(uo,{value:ce,onChange:O,style:{flex:1,minWidth:0}})]})]}),N==="once"&&s.jsxs("div",{style:{marginTop:8},children:[s.jsxs("div",{style:{display:"flex",alignItems:"stretch",width:"100%"},children:[s.jsx(uo,{value:z,onChange:oe,style:{flex:1,minWidth:0}}),s.jsx("span",{style:{width:"8px",flexShrink:0,display:"inline-block"},"aria-hidden":!0}),s.jsx(UA,{value:ue,onChange:ve,style:{flex:1,minWidth:0}})]}),s.jsx("div",{style:xn,children:bn?S("cron.once_time_past"):" "})]})]})]})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",justifyContent:"flex-end",alignItems:"center",boxSizing:"border-box",padding:"16px 24px 24px"},children:[s.jsx("button",{type:"button",onClick:n,style:{height:36,paddingLeft:16,paddingRight:16,borderRadius:6,background:K0,color:X0,border:"none",cursor:"pointer",fontSize:14,fontWeight:400,boxSizing:"border-box"},onMouseEnter:fe=>{fe.currentTarget.style.background=V0},onMouseLeave:fe=>{fe.currentTarget.style.background=K0},onMouseDown:fe=>{fe.currentTarget.style.background=pA},onMouseUp:fe=>{fe.currentTarget.style.background=V0},children:S("cron.cancel")}),s.jsx("button",{type:"button",onClick:ya,disabled:re||!sn,style:{marginLeft:8,height:36,paddingLeft:16,paddingRight:16,borderRadius:6,background:re||!sn?"rgba(55, 144, 250, 0.45)":Q0,color:"#FFFFFF",border:"none",cursor:re||!sn?"not-allowed":"pointer",fontSize:14,fontWeight:400,boxSizing:"border-box"},onMouseEnter:fe=>{re||!sn||(fe.currentTarget.style.background=W0)},onMouseLeave:fe=>{re||!sn||(fe.currentTarget.style.background=Q0)},onMouseDown:fe=>{re||!sn||(fe.currentTarget.style.background=gA)},onMouseUp:fe=>{re||!sn||(fe.currentTarget.style.background=W0)},children:S(re?l?"cron.saving":"cron.adding":l?"cron.confirm":"cron.modal_add")})]})]})]})}function qA({onConfirm:e,onCancel:n}){return x.useEffect(()=>{const r=l=>{l.key==="Enter"&&(l.preventDefault(),l.stopPropagation(),e())};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[e]),s.jsx("div",{role:"dialog","aria-modal":"true","aria-label":S("cron.confirm_delete"),style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",background:"transparent",display:"flex",alignItems:"center",justifyContent:"center",zIndex:300},children:s.jsxs("div",{style:{background:"#fff",borderRadius:8,width:376,minHeight:172,boxShadow:"0 6px 30px rgba(0, 0, 0, 0.12)",display:"flex",flexDirection:"column",overflow:"hidden",transform:"translate(-28px, -40px)"},children:[s.jsx("div",{style:{width:376,height:40,display:"flex",alignItems:"center",justifyContent:"flex-end",paddingRight:8,boxSizing:"border-box",flexShrink:0},children:s.jsx(br,{onClick:n})}),s.jsxs("div",{style:{paddingLeft:24,paddingRight:24,paddingBottom:24,flex:1,display:"flex",flexDirection:"column"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"flex-start",paddingTop:2},children:[s.jsx("img",{src:`${$e}/icons/dialog-question.svg`,alt:"",width:16,height:16,style:{flexShrink:0,marginTop:2,display:"block",objectFit:"contain"}}),s.jsx("span",{style:{width:8,flexShrink:0},"aria-hidden":!0}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{style:{margin:0,fontSize:14,fontWeight:500,color:X0,lineHeight:1.5},children:S("cron.confirm_delete")}),s.jsx("p",{style:{margin:"8px 0 0",fontSize:14,color:"rgba(0, 0, 0, 0.55)",lineHeight:1.5},children:S("cron.delete_desc")})]})]}),s.jsx("div",{style:{flex:1}}),s.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:16},children:[s.jsx("button",{type:"button",onClick:n,className:"skill-dialog-cancel-btn",children:S("cron.cancel")}),s.jsx("span",{style:{width:8,flexShrink:0},"aria-hidden":!0}),s.jsx("button",{type:"button",onClick:e,className:"skill-dialog-uninstall-btn",children:S("cron.delete")})]})]})]})})}function PA(){const[e,n]=x.useState([]),[r,l]=x.useState(!0),[o,u]=x.useState(null),[c,f]=x.useState(null),[h,m]=x.useState(null),[y,g]=x.useState(null),[_,v]=x.useState(null),[w,j]=x.useState(null),T=x.useRef(0),C=x.useCallback(re=>{var Fe;const ke=(Fe=re==null?void 0:re.silent)!=null?Fe:!1,Ze=++T.current;return ke||(l(!0),u(null)),m4().then(Mt=>{Ze===T.current&&(n(Mt),ke&&f(null))}).catch(Mt=>{if(Ze!==T.current)return;const vt=Mt instanceof Error?Mt.message:String(Mt);ke?f(vt):u(vt)}).finally(()=>{Ze===T.current&&(ke||l(!1))})},[]);x.useEffect(()=>{C()},[C]),x.useEffect(()=>{const re=window.setInterval(()=>{C({silent:!0})},5e3);return()=>window.clearInterval(re)},[C]);const E=async re=>{v(re.id),f(null),T.current+=1;try{const ke=re.enabled?await x4(re.id):await v4(re.id);T.current+=1,n(Ze=>Ze.map(Fe=>Fe.id===ke.id?ke:Fe))}catch(ke){f(ke instanceof Error?ke.message:S("cron.toggle_error")),C({silent:!0})}finally{v(null)}},N=async re=>{f(null);try{await g4(re),DA(re),n(ke=>ke.filter(Ze=>Ze.id!==re))}catch(ke){f(ke instanceof Error?ke.message:S("cron.delete_error"))}finally{g(null)}},D=async re=>{j(re.id),f(null);try{await b4(re.id),await C({silent:!0})}catch(ke){f(ke instanceof Error?ke.message:S("cron.run_error"))}finally{j(null)}},F=re=>{n(ke=>{const Ze=ke.findIndex(Fe=>Fe.id===re.id);if(Ze>=0){const Fe=[...ke];return Fe[Ze]=re,Fe}return[...ke,re]}),m(null)},M=212,A=164,U=144,I=84,L=120,B=M+U+I+L,q=6,K=8,G={width:M,maxWidth:M,minWidth:M},ne={width:U,maxWidth:U,minWidth:U},V={width:I,maxWidth:I,minWidth:I},le={width:L,maxWidth:L,minWidth:L},me={marginLeft:24,marginRight:24,marginTop:0},ce={boxSizing:"border-box",textAlign:"left",fontSize:"var(--model-font-size)",fontFamily:"var(--model-font-family)",background:"#f5f5f5",borderBottom:"1px solid #fff"},O={...ce,height:36,fontWeight:500,color:"rgba(0, 0, 0, 0.6)",whiteSpace:"nowrap"},H={...ce,height:60,color:"var(--model-text-primary)",verticalAlign:"middle"},Z={padding:"0 8px 0 16px"},z={padding:"0 8px"},oe={padding:"0 16px 0 8px"};if(o&&e.length===0)return s.jsx("div",{className:"model-page box-border",style:me,children:s.jsxs("div",{style:{background:"#fff2f0",border:"1px solid #ffa39e",borderRadius:8,padding:"12px 16px",color:"#cf1322",fontSize:13},children:[S("cron.load_error"),": ",o]})});if(r)return s.jsx(Lf,{});const ue="#F6F6F6",ve="#F2F2F2",Se="#EEEEEE",Te="rgba(0, 0, 0, 0.85)";return s.jsxs("div",{className:"model-page box-border",style:me,children:[c&&s.jsx("div",{style:{background:"#fff2f0",border:"1px solid #ffa39e",borderRadius:8,padding:"12px 16px",color:"#cf1322",fontSize:13,marginBottom:12},children:c}),s.jsx("h2",{className:"model-section-title",children:e.length>0?`${S("cron.task_list")}（${e.length}）`:S("cron.task_list")}),e.length===0?s.jsx("div",{style:{border:"1px solid #f0f0f0",borderRadius:q,background:ue},onMouseEnter:re=>re.currentTarget.style.background=ve,onMouseLeave:re=>re.currentTarget.style.background=ue,onMouseDown:re=>re.currentTarget.style.background=Se,onMouseUp:re=>re.currentTarget.style.background=ve,children:s.jsxs("button",{onClick:()=>m("add"),style:{display:"flex",alignItems:"center",justifyContent:"center",gap:8,width:"100%",padding:"16px",background:"transparent",border:"none",cursor:"pointer",fontFamily:"var(--model-add-font-family)",fontSize:"var(--model-font-size)",color:Te},children:[s.jsx(hd,{size:16}),S("cron.add_job")]})}):s.jsx("div",{style:{borderRadius:q,background:"#fff",overflow:"auto",flex:1},children:s.jsxs("table",{style:{width:"100%",minWidth:B+120,tableLayout:"fixed",borderCollapse:"separate",borderSpacing:0},children:[s.jsxs("colgroup",{children:[s.jsx("col",{style:{width:`${M}px`}}),s.jsx("col",{style:{width:`calc(100% - ${B}px)`}}),s.jsx("col",{style:{width:`${U}px`}}),s.jsx("col",{style:{width:`${I}px`}}),s.jsx("col",{style:{width:`${L}px`}})]}),s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{style:{...O,...Z,...G,borderRadius:`${q}px 0 0 0`},children:S("cron.name")}),s.jsx("th",{style:{...O,...z,minWidth:0},children:S("cron.prompt_col")}),s.jsx("th",{style:{...O,...z,...ne,whiteSpace:"nowrap"},children:S("cron.next_run")}),s.jsx("th",{style:{...O,...z,...V,whiteSpace:"nowrap"},children:S("cron.last_status")}),s.jsx("th",{style:{...O,...oe,...le,whiteSpace:"nowrap",borderRadius:`0 ${q}px 0 0`},"aria-label":S("cron.actions")})]})}),s.jsxs("tbody",{children:[e.map(re=>{var ke,Ze,Fe;return s.jsxs("tr",{children:[s.jsx("td",{style:{...H,...Z,...G},children:s.jsxs("div",{style:{display:"flex",alignItems:"center",minWidth:0,color:"var(--model-text-primary)",fontWeight:400},children:[s.jsx("span",{style:{display:"inline-flex",flexShrink:0,width:16,height:16,marginRight:K,alignItems:"center",justifyContent:"center"},children:s.jsx(IS,{size:16,style:{color:"#262626",display:"block"}})}),s.jsx(dc,{text:(ke=re.name)!=null?ke:re.id.slice(0,8),style:{width:A,maxWidth:A,flex:`0 0 ${A}px`,minWidth:0}})]})}),s.jsx("td",{style:{...H,...z,minWidth:0,color:"var(--model-text-secondary)",overflow:"hidden"},children:s.jsx("div",{style:{minWidth:0,overflow:"hidden",width:"100%"},children:s.jsx(dc,{text:(Fe=(Ze=re.prompt)!=null?Ze:re.command)!=null?Fe:"",tooltipVariant:"longText",style:{color:"var(--model-text-secondary)",display:"block",width:"100%"}})})}),s.jsx("td",{style:{...H,...z,...ne,color:"var(--model-text-secondary)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:xA(re)?bA(re.next_run):null}),s.jsx("td",{style:{...H,...z,...V,overflow:"hidden"},children:s.jsx(wA,{status:re.last_status})}),s.jsx("td",{style:{...H,...oe,...le,overflow:"visible"},children:s.jsxs("div",{style:{display:"inline-flex",alignItems:"center"},children:[s.jsx(CA,{onEdit:()=>m(re),onDelete:()=>g(re.id),onRunNow:()=>D(re)}),s.jsx("div",{style:{marginLeft:16,flexShrink:0},children:s.jsx(vA,{checked:re.enabled,onChange:()=>E(re),disabled:_===re.id||w===re.id})})]})})]},re.id)}),s.jsx("tr",{children:s.jsx("td",{colSpan:5,onClick:()=>m("add"),onMouseEnter:re=>re.currentTarget.style.background=ve,onMouseLeave:re=>re.currentTarget.style.background=ue,onMouseDown:re=>re.currentTarget.style.background=Se,onMouseUp:re=>re.currentTarget.style.background=ve,style:{...H,padding:"0 16px",textAlign:"center",borderBottom:"none",borderRadius:`0 0 ${q}px ${q}px`,cursor:"pointer",background:ue,color:Te},children:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:8,fontFamily:"var(--model-add-font-family)",fontSize:"var(--model-font-size)",color:Te},children:[s.jsx(hd,{size:16}),S("cron.add_job")]})})})]})]})}),h!==null&&s.jsx(HA,{job:h,onClose:()=>m(null),onSaved:F}),y!==null&&s.jsx(qA,{onConfirm:()=>N(y),onCancel:()=>g(null)})]})}function $A(e){switch(e){case"Active":return{icon:Pi,label:S("integrations.status_active"),color:"var(--color-status-success)",border:"rgba(0, 230, 138, 0.2)",bg:"rgba(0, 230, 138, 0.06)"};case"Available":return{icon:Jg,label:S("integrations.status_available"),color:"var(--pc-accent)",border:"var(--pc-accent-dim)",bg:"var(--pc-accent-glow)"};case"ComingSoon":return{icon:zg,label:S("integrations.status_coming_soon"),color:"var(--pc-text-muted)",border:"var(--pc-border)",bg:"transparent"}}}function YA(){const[e,n]=x.useState([]),[r,l]=x.useState(!0),[o,u]=x.useState(null),[c,f]=x.useState("all");x.useEffect(()=>{_4().then(n).catch(g=>u(g.message)).finally(()=>l(!1))},[]);const h=["all",...Array.from(new Set(e.map(g=>g.category))).sort()],y=(c==="all"?e:e.filter(g=>g.category===c)).reduce((g,_)=>{const v=_.category;return g[v]||(g[v]=[]),g[v].push(_),g},{});return o?s.jsx("div",{className:"p-6 animate-fade-in",children:s.jsxs("div",{className:"rounded-2xl border p-4",style:{background:"rgba(239, 68, 68, 0.08)",borderColor:"rgba(239, 68, 68, 0.2)",color:"#f87171"},children:[S("integrations.load_error"),": ",o]})}):r?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"h-8 w-8 border-2 rounded-full animate-spin",style:{borderColor:"var(--pc-border)",borderTopColor:"var(--pc-accent)"}})}):s.jsxs("div",{className:"p-6 space-y-6 animate-fade-in",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(qg,{className:"h-5 w-5",style:{color:"var(--pc-accent)"}}),s.jsxs("h2",{className:"text-sm font-semibold uppercase tracking-wider",style:{color:"var(--pc-text-primary)"},children:[S("integrations.title")," (",e.length,")"]})]}),s.jsx("div",{className:"flex flex-wrap gap-2",children:h.map(g=>s.jsx("button",{onClick:()=>f(g),className:"px-3.5 py-1.5 rounded-xl text-xs font-semibold transition-all capitalize",style:c===g?{background:"var(--pc-accent)",color:"white"}:{color:"var(--pc-text-muted)",border:"1px solid var(--pc-border)",background:"transparent"},children:g},g))}),Object.keys(y).length===0?s.jsxs("div",{className:"card p-8 text-center",children:[s.jsx(qg,{className:"h-10 w-10 mx-auto mb-3",style:{color:"var(--pc-text-faint)"}}),s.jsx("p",{style:{color:"var(--pc-text-muted)"},children:S("integrations.empty")})]}):Object.entries(y).sort(([g],[_])=>g.localeCompare(_)).map(([g,_])=>s.jsxs("div",{children:[s.jsx("h3",{className:"text-[10px] font-semibold uppercase tracking-wider mb-3 capitalize",style:{color:"var(--pc-text-faint)"},children:g}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4 stagger-children",children:_.map(v=>{const w=$A(v.status),j=w.icon;return s.jsx("div",{className:"card p-5 animate-slide-in-up",children:s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("h4",{className:"text-sm font-semibold truncate",style:{color:"var(--pc-text-primary)"},children:v.name}),s.jsx("p",{className:"text-sm mt-1 line-clamp-2",style:{color:"var(--pc-text-muted)"},children:v.description})]}),s.jsxs("span",{className:"flex-shrink-0 inline-flex items-center gap-1 px-2.5 py-1 rounded-full text-[10px] font-semibold border",style:w,children:[s.jsx(j,{className:"h-3 w-3"}),w.label]})]})},v.name)})})]},g))]})}const hx="kylinbot_close_action";function GA(){try{const e=localStorage.getItem(hx);if(e==="hide"||e==="exit")return e}catch{}return"exit"}function KA(e){try{localStorage.setItem(hx,e)}catch{}}function VA(){const[e,n]=x.useState({alwaysOnTop:!1,closeAction:GA()});x.useEffect(()=>{ay().then(o=>{n(u=>({...u,alwaysOnTop:o}))})},[]);const r=o=>{n(u=>({...u,closeAction:o})),KA(o)},l=async()=>{const o=!e.alwaysOnTop;n(u=>({...u,alwaysOnTop:o})),await ny()};return s.jsxs("div",{className:"p-6 animate-fade-in",children:[s.jsx("h2",{className:"mb-4 text-sm font-semibold text-black",children:S("settings.window")}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{style:{display:"none"},children:s.jsx("div",{className:"h-[60px] rounded-[6px] px-4 flex items-center",style:{background:"#F6F6F6"},children:s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsx("div",{className:"flex items-center gap-3",children:s.jsx("span",{className:"text-sm font-medium",style:{color:"#222222"},children:S("modelswitch.always_on_top")})}),s.jsx("button",{onClick:l,className:"relative w-10 h-6 rounded-full transition-colors",style:{background:e.alwaysOnTop?"#3790FA":"#DFDFDF"},"aria-pressed":e.alwaysOnTop,"aria-label":S("modelswitch.always_on_top"),children:s.jsx("span",{className:"absolute top-1 left-1 w-4 h-4 rounded-full bg-white transition-transform",style:{transform:e.alwaysOnTop?"translateX(16px)":"translateX(0)"}})})]})})}),s.jsx("div",{className:"h-[60px] rounded-[6px] px-4 flex items-center",style:{background:"#F6F6F6"},children:s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 w-full",children:[s.jsx("span",{className:"text-sm font-medium",style:{color:"#222222"},children:S("modelswitch.close_action")}),s.jsxs("div",{className:"flex items-center gap-6",children:[s.jsxs("label",{className:"flex items-center gap-2 select-none",children:[s.jsx("input",{type:"radio",name:"closeAction",checked:e.closeAction==="hide",onChange:()=>r("hide"),className:"h-4 w-4",style:{accentColor:"#3790FA"}}),s.jsx("span",{className:"text-sm",style:{color:"#444444"},children:S("modelswitch.close_action_hide")})]}),s.jsxs("label",{className:"flex items-center gap-2 select-none",children:[s.jsx("input",{type:"radio",name:"closeAction",checked:e.closeAction==="exit",onChange:()=>r("exit"),className:"h-4 w-4",style:{accentColor:"#3790FA"}}),s.jsx("span",{className:"text-sm",style:{color:"#444444"},children:S("modelswitch.close_action_exit")})]})]})]})})]})]})}function QA(e,n=[]){const[r,l]=x.useState(null),[o,u]=x.useState(null),[c,f]=x.useState(!0),h=x.useRef(!0),m=x.useRef(0),y=x.useCallback(()=>{m.current+=1,f(!0),u(null),e().then(g=>{h.current&&(l(g),u(null))}).catch(g=>{h.current&&u(g instanceof Error?g:new Error(String(g)))}).finally(()=>{h.current&&f(!1)})},[e,...n]);return x.useEffect(()=>(h.current=!0,y(),()=>{h.current=!1}),[y]),{data:r,error:o,loading:c,refetch:y}}function WA(){return QA(c4)}const Jl="/api/skillhub";function XA(e,n){const r=new URLSearchParams({q:e});return r.set("limit",String(n)),Me(`${Jl}/search?${r}`)}function JA(e){const n=new URLSearchParams({cat:e});return Me(`${Jl}/showcase?${n}`)}function ZA(e,n=!1,r=30){return Me(`${Jl}/install`,{method:"POST",body:JSON.stringify({source:e,force:n,timeout:r})})}function eM(){return Me(`${Jl}/list`)}function mx(e){return Me(`${Jl}/uninstall`,{method:"POST",body:JSON.stringify({slug:e})})}function tM(e){const n=new URLSearchParams({slug:e});return Me(`${Jl}/detail?${n}`)}function nM({onImportResult:e,onAddClick:n}){const[r,l]=x.useState(!1),[o,u]=x.useState(!1),[c,f]=x.useState(null),[h,m]=x.useState(null),[y,g]=x.useState(!1),_=x.useRef(null),v=x.useRef(null);x.useEffect(()=>{if(!r)return;const N=F=>{v.current&&!v.current.contains(F.target)&&l(!1)},D=()=>l(!1);return document.addEventListener("mousedown",N),window.addEventListener("blur",D),()=>{document.removeEventListener("mousedown",N),window.removeEventListener("blur",D)}},[r]);const w=()=>{l(N=>{if(!N&&v.current){const D=v.current.getBoundingClientRect();u(D.bottom+170>window.innerHeight)}return!N})},j=()=>{var N;(N=_.current)==null||N.click()},T=async N=>{var F;const D=(F=N.target.files)==null?void 0:F[0];D&&(N.target.value="",l(!1),await C(D))},C=async N=>{try{console.log("[Skills] doImport starting for:",N.name,N.size,N.type),await h4(N),console.log("[Skills] importSkill succeeded"),e(!0)}catch(D){const F=D;if(console.error("[Skills] importSkill failed:",String(D),"type:",typeof D,"stack:",D==null?void 0:D.stack),console.error("[Skills] raw error:",D),F.duplicate&&F.skillName){f(F.skillName),m(N);return}e(!1)}},E=async()=>{if(!(!h||!c)){g(!0);try{await jd(c),await C(h),f(null),m(null)}catch{e(!1)}finally{g(!1)}}};return s.jsxs("div",{ref:v,style:{position:"relative",display:"inline-block"},children:[s.jsxs("button",{className:"skill-toolbar-btn",onClick:w,children:[s.jsx("span",{style:{fontSize:18,lineHeight:1},children:"+"}),s.jsx("span",{children:"添加"})]}),r&&s.jsxs("div",{onMouseDown:N=>N.stopPropagation(),style:{position:"absolute",right:0,...o?{bottom:"100%"}:{top:"100%"},zIndex:100,background:"#fff",border:"1px solid #e8e8e8",borderRadius:8,boxShadow:"0 4px 16px rgba(0,0,0,0.12)",width:180,padding:8,boxSizing:"border-box",display:"flex",flexDirection:"column"},children:[s.jsx("button",{className:"skill-uninstall-btn",style:{width:164,height:36},onClick:()=>{l(!1),n()},children:"自定义"}),s.jsx("button",{className:"skill-uninstall-btn",style:{width:164,height:36,marginTop:2},onClick:j,children:"上传文件"})]}),s.jsx("input",{ref:_,type:"file",accept:".md,.zip",style:{display:"none"},onChange:T}),s.jsx(px,{open:!!c,onCancel:()=>{f(null),m(null)},onConfirm:E,overwriting:y,skillName:c||""})]})}function aM({open:e,onCancel:n,onCreated:r,existingSlugs:l}){const[o,u]=x.useState(""),[c,f]=x.useState(""),[h,m]=x.useState(""),[y,g]=x.useState(!1),[_,v]=x.useState(!1),[w,j]=x.useState(!1),[T,C]=x.useState(!1),[E,N]=x.useState(null),[D,F]=x.useState(!1),[M,A]=x.useState(!1),[U,I]=x.useState(!1),[L,B]=x.useState(!1),q=x.useRef(null),K=oe=>new TextEncoder().encode(oe).length,G=["\\","/",":","*","?",'"',"<",">","|"],ne=oe=>G.some(ue=>oe.includes(ue)),V=(oe,ue)=>{let ve=0;for(let Se=0;Se<oe.length;Se++)if(ve+=new TextEncoder().encode(oe[Se]).length,ve>ue)return Se;return oe.length};x.useEffect(()=>{e&&(u(""),f(""),m(""),g(!1),v(!1),j(!1),C(!1),N(null),F(!1),requestAnimationFrame(()=>{var oe;return(oe=q.current)==null?void 0:oe.focus()}))},[e]);const le=async()=>{const oe=o.trim();if(oe){if(l.some(ue=>ue.toLowerCase()===oe.toLowerCase())){N(oe);return}await me(oe)}},me=async oe=>{g(!0);try{const ue={};c.trim()&&(ue.description=c.trim()),h.trim()&&(ue.prompts=[h.trim()]),await f4(oe,ue),r()}catch(ue){console.error("Failed to create skill:",ue)}finally{g(!1)}},ce=async()=>{if(E){F(!0);try{await jd(E),await me(E),N(null)}catch(oe){console.error("Failed to overwrite skill:",oe)}finally{F(!1)}}},O=oe=>({width:"100%",height:36,padding:"0 10px",fontSize:14,color:"var(--pc-text-primary)",border:oe?"2px solid #3790FA":"2px solid transparent",borderRadius:4,background:oe?"#FFFFFF":"#E6E6E6",outline:"none",boxSizing:"border-box"}),H={display:"block",fontSize:14,color:"rgba(0, 0, 0, 0.85)",marginBottom:4,fontWeight:400},Z={fontSize:12,color:"#F53F3F",minHeight:18,lineHeight:"18px"},z=o.trim()&&c.trim();return!e&&!E?null:s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",display:"flex",alignItems:"center",justifyContent:"center",zIndex:200,transform:"translate(-28px, -40px)"},children:s.jsxs("div",{style:{width:424,height:520,background:"#fff",borderRadius:8,boxSizing:"border-box",display:"flex",flexDirection:"column",overflow:"hidden",boxShadow:"0 6px 30px rgba(0,0,0,0.12)"},children:[s.jsxs("div",{style:{height:40,display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:12,paddingRight:8,flexShrink:0},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[s.jsx("img",{src:`${$e}/icons/logo.png`,alt:"",width:24,height:24,style:{width:24,height:24,objectFit:"contain",display:"block",flexShrink:0},onError:oe=>{oe.target.style.display="none"}}),s.jsx("span",{style:{fontSize:14,fontWeight:400,color:"rgba(0, 0, 0, 0.85)",marginLeft:8},children:"添加技能"})]}),s.jsx(br,{onClick:n})]}),s.jsxs("div",{style:{paddingLeft:24,paddingRight:24,paddingTop:8,paddingBottom:24,display:"flex",flexDirection:"column",flex:1,overflowY:"auto"},children:[s.jsxs("div",{children:[s.jsx("label",{style:H,children:"技能名称"}),s.jsx("input",{ref:q,value:o,onChange:oe=>{const ue=oe.target.value;if(ne(ue)){C(!0);return}C(!1),K(ue)>255?(v(!0),u(ue.slice(0,V(ue,255)))):(v(!1),u(ue))},onFocus:()=>A(!0),onBlur:()=>A(!1),placeholder:"必填",className:"placeholder-[#A6A6A6]",style:O(M)}),s.jsx("div",{style:Z,children:T?'文件名中不能包含以下字符：\\/:*?"<>|':_?"长度不得大于255字符":" "})]}),s.jsxs("div",{children:[s.jsx("label",{style:H,children:"技能简介"}),s.jsx("input",{value:c,onChange:oe=>{const ue=oe.target.value;K(ue)>255?(j(!0),f(ue.slice(0,V(ue,255)))):(j(!1),f(ue))},onFocus:()=>I(!0),onBlur:()=>I(!1),placeholder:"必填",className:"placeholder-[#A6A6A6]",style:O(U)}),s.jsx("div",{style:Z,children:w?"长度不得大于255字符":" "})]}),s.jsxs("div",{children:[s.jsx("label",{style:H,children:"技能能力"}),s.jsx("textarea",{value:h,onChange:oe=>m(oe.target.value),onFocus:()=>B(!0),onBlur:()=>B(!1),placeholder:"选填。例如：文件分类、重复文件识别、自动归档、通知提醒",className:"placeholder-[#A6A6A6]",rows:9,style:{width:"100%",padding:"8px 10px",fontSize:14,color:"var(--pc-text-primary)",border:L?"2px solid #3790FA":"2px solid transparent",borderRadius:4,background:L?"#FFFFFF":"#E6E6E6",outline:"none",boxSizing:"border-box",resize:"none",lineHeight:"20px"}})]}),s.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"auto"},children:[s.jsx("button",{className:"skill-dialog-cancel-btn",onClick:n,style:{width:64,height:36},children:"取消"}),s.jsx("button",{className:"skill-dialog-uninstall-btn",onClick:le,disabled:y||!z,style:{opacity:z?void 0:.5,width:64,height:36,cursor:z?"pointer":"default",marginLeft:8},children:y?s.jsx(Yn,{className:"h-4 w-4 animate-spin",style:{color:"#fff"}}):"添加"})]})]})]})}),s.jsx(px,{open:!!E,onCancel:()=>N(null),onConfirm:ce,overwriting:D,skillName:E||""})]})}function rM({enabled:e,loading:n,onToggle:r}){return s.jsx("button",{onClick:r,disabled:n,className:"relative rounded-full transition-colors disabled:opacity-50 flex-shrink-0",style:{width:44,height:22,background:e?"#3790FA":"var(--pc-border)"},"aria-pressed":e,"aria-label":S(e?"skills.enabled":"skills.disabled"),children:s.jsx("span",{className:"absolute top-1 left-1 w-[14px] h-[14px] rounded-full bg-white transition-transform",style:{transform:e?"translateX(22px)":"translateX(0)"}})})}function px({open:e,onCancel:n,onConfirm:r,overwriting:l,skillName:o}){return e?s.jsx("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",display:"flex",alignItems:"center",justifyContent:"center",zIndex:200,transform:"translate(-28px, -40px)"},children:s.jsxs("div",{style:{width:376,height:212,background:"#fff",borderRadius:8,boxSizing:"border-box",display:"flex",flexDirection:"column",overflow:"hidden",boxShadow:"0 6px 30px rgba(0,0,0,0.12)"},children:[s.jsx("div",{style:{width:376,height:40,display:"flex",alignItems:"center",justifyContent:"flex-end",paddingRight:8,boxSizing:"border-box",flexShrink:0},children:s.jsx(br,{onClick:n})}),s.jsxs("div",{style:{paddingLeft:24,paddingRight:24,paddingBottom:24,flex:1,display:"flex",flexDirection:"column"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"flex-start",marginBottom:4},children:[s.jsx("img",{src:`${$e}/icons/dialog-question.svg`,alt:"question",width:16,height:16,style:{flexShrink:0,marginTop:2}}),s.jsx("span",{style:{fontSize:14,color:"var(--pc-text-primary)",lineHeight:"20px",marginLeft:8},children:"确定覆盖现有技能？"})]}),s.jsxs("span",{style:{fontSize:14,color:"var(--pc-text-muted)",lineHeight:"20px",marginLeft:24},children:["当前技能列表中已存在“",o,"”，是否进行覆盖？"]}),s.jsx("div",{style:{flex:1}}),s.jsxs("div",{style:{display:"flex",justifyContent:"flex-end"},children:[s.jsx("button",{className:"skill-dialog-cancel-btn",onClick:n,children:"取消"}),s.jsx("button",{className:"skill-dialog-uninstall-btn",onClick:r,disabled:l,style:{marginLeft:8},children:l?s.jsx(Yn,{className:"h-4 w-4 animate-spin",style:{color:"#fff"}}):"覆盖"})]})]})]})}):null}function lM({open:e,onCancel:n,onConfirm:r,uninstalling:l}){const o=x.useRef(null);return x.useEffect(()=>{var u;e&&((u=o.current)==null||u.focus())},[e]),e?s.jsx("div",{ref:o,tabIndex:-1,onKeyDown:u=>{u.key==="Enter"&&!l&&(u.preventDefault(),r())},style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",display:"flex",alignItems:"center",justifyContent:"center",zIndex:200,transform:"translate(-28px, -40px)"},children:s.jsxs("div",{style:{width:376,height:212,background:"#fff",borderRadius:8,boxSizing:"border-box",display:"flex",flexDirection:"column",overflow:"hidden",boxShadow:"0 6px 30px rgba(0,0,0,0.12)"},children:[s.jsx("div",{style:{width:376,height:40,display:"flex",alignItems:"center",justifyContent:"flex-end",paddingRight:8,boxSizing:"border-box",flexShrink:0},children:s.jsx(br,{onClick:n})}),s.jsxs("div",{style:{paddingLeft:24,paddingRight:24,paddingBottom:24,flex:1,display:"flex",flexDirection:"column"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"flex-start",marginBottom:4},children:[s.jsx("img",{src:`${$e}/icons/dialog-question.svg`,alt:"question",width:16,height:16,style:{flexShrink:0,marginTop:2}}),s.jsx("span",{style:{fontSize:14,color:"var(--pc-text-primary)",lineHeight:"20px",marginLeft:8},children:"确认卸载该技能？"})]}),s.jsx("span",{style:{fontSize:14,color:"var(--pc-text-muted)",lineHeight:"20px",marginLeft:24},children:"卸载后，该技能的本地文件与配置数据将被删除，且无法恢复。"}),s.jsx("div",{style:{flex:1}}),s.jsxs("div",{style:{display:"flex",justifyContent:"flex-end"},children:[s.jsx("button",{className:"skill-dialog-cancel-btn",onClick:n,children:"取消"}),s.jsx("button",{className:"skill-dialog-uninstall-btn",onClick:r,disabled:l,style:{marginLeft:8},children:l?s.jsx(Yn,{className:"h-4 w-4 animate-spin",style:{color:"#fff"}}):"卸载"})]})]})]})}):null}function iM({skillSlug:e,onUninstalled:n}){const[r,l]=x.useState(!1),[o,u]=x.useState(!1),[c,f]=x.useState(!1),[h,m]=x.useState(!1),[y,g]=x.useState(!1),[_,v]=x.useState({x:0,y:0}),w=x.useRef(null),j=x.useRef(null);x.useEffect(()=>{if(!r)return;const E=D=>{j.current&&!j.current.contains(D.target)&&l(!1)},N=()=>l(!1);return document.addEventListener("mousedown",E),window.addEventListener("blur",N),()=>{document.removeEventListener("mousedown",E),window.removeEventListener("blur",N)}},[r]);const T=()=>{l(E=>{if(!E&&j.current){const N=j.current.getBoundingClientRect();m(N.bottom+80>window.innerHeight)}return!E})},C=async()=>{f(!0);try{await Promise.all([mx(e).catch(()=>{}),jd(e).catch(()=>{})]),u(!1),l(!1),n()}catch(E){console.error("Failed to uninstall skill:",E)}finally{f(!1)}};return s.jsxs(s.Fragment,{children:[s.jsx(lM,{open:o,onCancel:()=>u(!1),onConfirm:C,uninstalling:c}),s.jsxs("div",{ref:j,style:{position:"relative",display:"inline-block"},children:[s.jsx("button",{className:"skill-operate-btn",style:{cursor:"default"},onClick:T,onMouseEnter:E=>{v({x:E.clientX,y:E.clientY}),w.current=setTimeout(()=>g(!0),500)},onMouseLeave:()=>{w.current&&clearTimeout(w.current),w.current=null,g(!1)},children:s.jsx("img",{src:`${$e}/icons/operate-omit.svg`,alt:"更多",width:16,height:16})}),y&&!r&&s.jsx("div",{style:{position:"fixed",left:_.x+8,top:_.y+8,zIndex:100,background:"#fff",border:"1px solid #e8e8e8",borderRadius:8,boxShadow:"0 4px 16px rgba(0,0,0,0.12)",padding:"8px 12px",boxSizing:"border-box",fontSize:14,color:"var(--pc-text-primary)",whiteSpace:"nowrap",pointerEvents:"none"},children:"更多"}),r&&s.jsxs("div",{style:{position:"absolute",right:0,...h?{bottom:"100%"}:{top:"100%"},zIndex:100,background:"#fff",border:"1px solid #e8e8e8",borderRadius:8,boxShadow:"0 4px 16px rgba(0,0,0,0.12)",width:180,padding:8,boxSizing:"border-box",display:"flex",flexDirection:"column"},children:[s.jsx("button",{className:"skill-uninstall-btn",style:{height:32},onClick:async()=>{l(!1);try{await d4(e)}catch(E){console.error("Failed to open folder:",E)}},children:"文件所在位置"}),s.jsx("button",{className:"skill-uninstall-btn",style:{height:32,marginTop:2},onClick:()=>{l(!1),u(!0)},children:"卸载"})]})]})]})}function oM({skill:e,isDefault:n,isToggling:r,onToggle:l,onUninstalled:o}){const u=x.useRef(null),c=x.useRef(null),[f,h]=x.useState(!1),[m,y]=x.useState(!1),[g,_]=x.useState(!1),[v,w]=x.useState(!1),[j,T]=x.useState(!1),[C,E]=x.useState(!1);return x.useEffect(()=>{requestAnimationFrame(()=>{u.current&&h(u.current.scrollHeight-u.current.clientHeight>1),c.current&&w(c.current.scrollWidth>c.current.clientWidth)})},[e.description,e.name]),s.jsxs("div",{style:{width:326,height:140,padding:16,background:"#F6F6F6",borderRadius:6,boxSizing:"border-box",position:"relative"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",height:20},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",minWidth:0,flex:1},children:[s.jsx("div",{style:{width:32,height:32,background:"#E1EEFE",borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:s.jsx("span",{style:{fontSize:16,color:"#3790FA",fontWeight:600,lineHeight:1},children:e.name.charAt(0).toUpperCase()})}),s.jsxs("div",{className:"relative",onMouseEnter:()=>{if(v){if(c.current){const N=c.current.getBoundingClientRect();E(N.bottom+100>window.innerHeight)}T(!0)}},onMouseLeave:()=>T(!1),style:{flex:1,minWidth:0,marginLeft:8},children:[s.jsx("div",{ref:c,style:{fontSize:14,color:"var(--pc-text-primary)",fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),v&&j&&s.jsx("div",{className:`absolute z-50 left-0 p-2 rounded-md text-xs whitespace-pre-wrap shadow-lg border ${C?"bottom-full mb-1":"top-full mt-1"}`,style:{background:"#ffffff",color:"var(--pc-text-primary)",borderColor:"var(--pc-border)",maxWidth:300,overflowWrap:"break-word"},children:e.name})]})]}),s.jsxs("div",{style:{display:"flex",alignItems:"center",flexShrink:0},children:[!n&&s.jsx(iM,{skillSlug:e.slug,onUninstalled:o}),s.jsx("div",{style:n?void 0:{marginLeft:4},children:s.jsx(rM,{enabled:e.enabled,loading:r,onToggle:l})})]})]}),s.jsxs("div",{className:"relative",onMouseEnter:()=>{if(f){if(u.current){const N=u.current.getBoundingClientRect();_(N.bottom+100>window.innerHeight)}y(!0)}},onMouseLeave:()=>y(!1),children:[s.jsx("p",{ref:u,style:{width:294,height:40,fontSize:14,color:"var(--pc-text-muted)",margin:0,marginTop:14,lineHeight:"20px",overflow:"hidden",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",wordBreak:"break-all"},children:e.description}),f&&m&&s.jsx("div",{className:`absolute z-50 left-0 p-2 rounded-md whitespace-pre-wrap shadow-lg border ${g?"bottom-full mb-1":"top-full mt-1"}`,style:{background:"#ffffff",color:"var(--pc-text-primary)",borderColor:"var(--pc-border)",maxWidth:300,wordBreak:"break-all",fontSize:14},children:e.description})]}),s.jsx("div",{style:{position:"absolute",bottom:16,left:16},children:n?s.jsx("span",{style:{display:"inline-flex",alignItems:"center",height:24,paddingLeft:8,paddingRight:8,fontSize:12,color:"#3790FA",background:"#E1EEFE",borderRadius:10,boxSizing:"border-box"},children:"麒麟认证"}):s.jsx("span",{style:{display:"inline-flex",alignItems:"center",height:24,paddingLeft:8,paddingRight:8,fontSize:12,color:"var(--pc-text-secondary)",background:"#E6E6E6",borderRadius:10,boxSizing:"border-box"},children:"未认证"})})]})}function sM(){const{data:e,loading:n,error:r,refetch:l}=WA(),[o,u]=x.useState(null),c=x.useRef(null),f=x.useRef(0),[h,m]=x.useState(""),[y,g]=x.useState(!1),_=x.useRef(null),[v,w]=x.useState(!1),[j,T]=x.useState(null),[C,E]=x.useState(!1),N=x.useRef(null),D=x.useCallback(B=>{const q=B.currentTarget,K=q.scrollHeight-q.scrollTop-q.clientHeight<1;E(K)},[]);x.useEffect(()=>{const B=q=>q.preventDefault();return document.addEventListener("contextmenu",B),()=>document.removeEventListener("contextmenu",B)},[]);const F=async(B,q)=>{const K=Date.now();if(!(K-f.current<500)&&(f.current=K,c.current!==B)){c.current=B,u(B);try{await u4(B,!q),l()}catch(G){console.error("Failed to toggle skill:",G),u(null),c.current=null}}};x.useEffect(()=>{o&&(u(null),c.current=null)},[e,r]);const M=h.trim().toLowerCase(),A=M.length>0,I=(e||[]).filter(B=>{if(!A)return!0;const q=M;return B.name.toLowerCase().includes(q)}),L=((e==null?void 0:e.length)||0)===0?"无任何技能":A?"无搜索结果":"无任何技能";return n&&!e?s.jsx(Lf,{}):r?s.jsx("div",{style:{textAlign:"center",padding:24},children:s.jsx("p",{style:{color:"var(--pc-text-muted)"},children:S("skills.empty")})}):s.jsxs("div",{style:{maxWidth:1040,width:"100%",padding:"0 0 0 24px",boxSizing:"border-box",height:"100%",display:"flex",flexDirection:"column"},children:[s.jsxs("div",{style:{height:36,display:"flex",alignItems:"center",flexShrink:0,paddingRight:24},children:[s.jsx("div",{style:{display:"flex",alignItems:"center",marginLeft:16},children:s.jsxs("span",{style:{fontSize:14,color:"#000000",fontWeight:500},children:["技能列表（",(e==null?void 0:e.length)||0,"）"]})}),s.jsx("div",{style:{flex:1}}),s.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[s.jsx("div",{onClick:()=>{var B;return(B=_.current)==null?void 0:B.focus()},style:{width:236,height:36,background:y?"#FFFFFF":"#E6E6E6",borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",paddingLeft:10,paddingRight:10,boxSizing:"border-box",border:y?"2px solid #3790FA":"2px solid transparent",transition:"background 0.2s ease, border-color 0.2s ease",cursor:"text"},children:s.jsxs("div",{style:{display:"flex",alignItems:"center",width:"100%",justifyContent:y||h?"flex-start":"center"},children:[s.jsx("img",{src:`${$e}/icons/search.svg`,alt:"search",width:14,height:14,style:{flexShrink:0}}),s.jsx("input",{style:{border:"none",outline:"none",background:"transparent",fontSize:14,color:"var(--pc-text-primary)",width:y||h?"100%":40,flex:y||h?1:"none",padding:0,textAlign:"left",marginLeft:6},ref:_,type:"text",value:h,onChange:B=>m(B.target.value),onFocus:()=>g(!0),onBlur:()=>g(!1),placeholder:"搜索",className:"placeholder-[#A6A6A6]"}),h&&s.jsx("button",{onClick:()=>m(""),style:{border:"none",background:"transparent",cursor:"pointer",padding:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:"var(--pc-text-muted)"},children:s.jsx(ma,{size:14})})]})}),s.jsx("div",{style:{marginLeft:8},children:s.jsx(nM,{onImportResult:B=>{T({success:B,message:B?"技能添加成功":"技能添加失败"}),B&&l(),setTimeout(()=>T(null),3e3)},onAddClick:()=>w(!0)})})]})]}),s.jsx("div",{className:"skill-list-scroll scrollbar-auto-hide",ref:N,onScroll:D,style:{flex:1,minHeight:0,overflowY:"overlay",overflowX:"hidden",marginTop:8,paddingRight:24,paddingBottom:C?16:0,position:"relative"},children:I.length===0?s.jsxs("div",{style:{position:"absolute",top:0,right:0,bottom:0,left:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",transform:"translate(-28px, -60px)"},children:[s.jsx("img",{src:`${$e}/icons/noDialogue.png`,alt:"",style:{width:128,height:128,display:"block"}}),s.jsx("span",{style:{marginTop:0,fontSize:14,color:"rgba(0, 0, 0, 0.35)"},children:L})]}):s.jsx("div",{style:{width:992,display:"flex",flexWrap:"wrap"},children:I.map((B,q)=>{const K=(q+1)%3===0;return s.jsx("div",{style:{marginRight:K?0:7,marginBottom:7},children:s.jsx(oM,{skill:B,isDefault:B.is_default,isToggling:o===B.slug,onToggle:()=>F(B.slug,B.enabled),onUninstalled:()=>l()})},B.name)})})}),s.jsx(aM,{open:v,onCancel:()=>w(!1),onCreated:()=>{w(!1),l(),T({success:!0,message:"技能添加成功"}),setTimeout(()=>T(null),3e3)},existingSlugs:(e!=null?e:[]).map(B=>B.slug)}),j&&s.jsx("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",display:"flex",alignItems:"center",justifyContent:"center",zIndex:300,pointerEvents:"none"},onClick:()=>T(null),children:s.jsxs("div",{style:{padding:"16px 24px",borderRadius:8,fontSize:14,color:"var(--pc-text-primary)",background:"#ffffff",border:"1px solid var(--pc-border)",boxShadow:"0 6px 30px rgba(0,0,0,0.12)",display:"flex",alignItems:"center",pointerEvents:"auto"},onClick:B=>B.stopPropagation(),children:[s.jsx("img",{src:`${$e}/icons/${j.success?"dialog-success.svg":"dialog-error.svg"}`,alt:j.success?"success":"error",width:16,height:16,style:{flexShrink:0}}),s.jsx("span",{style:{marginLeft:8},children:j.message})]})})]})}function cM(e,n){return e.length<=n?e:e.slice(0,n)+"..."}function uM(e){return new Date(e).toLocaleString()}function dM(){const[e,n]=x.useState([]),[r,l]=x.useState(!0),[o,u]=x.useState(null),[c,f]=x.useState(""),[h,m]=x.useState(""),[y,g]=x.useState(!1),[_,v]=x.useState(null),[w,j]=x.useState(""),[T,C]=x.useState(""),[E,N]=x.useState(""),[D,F]=x.useState(null),[M,A]=x.useState(!1),U=(G,ne)=>{l(!0),k4(G||void 0,ne||void 0).then(n).catch(V=>u(V.message)).finally(()=>l(!1))};x.useEffect(()=>{U()},[]);const I=()=>{U(c,h)},L=G=>{G.key==="Enter"&&I()},B=Array.from(new Set(e.map(G=>G.category))).sort(),q=async()=>{if(!w.trim()||!T.trim()){F(S("memory.validation_error"));return}A(!0),F(null);try{await S4(w.trim(),T.trim(),E.trim()||void 0),U(c,h),g(!1),j(""),C(""),N("")}catch(G){F(G instanceof Error?G.message:S("memory.store_error"))}finally{A(!1)}},K=async G=>{try{await C4(G),n(ne=>ne.filter(V=>V.key!==G))}catch(ne){u(ne instanceof Error?ne.message:S("memory.delete_error"))}finally{v(null)}};return o&&e.length===0?s.jsx("div",{className:"p-6 animate-fade-in",children:s.jsxs("div",{className:"rounded-2xl border p-4",style:{background:"rgba(239, 68, 68, 0.08)",borderColor:"rgba(239, 68, 68, 0.2)",color:"#f87171"},children:[S("memory.load_error"),": ",o]})}):s.jsxs("div",{className:"flex flex-col h-full p-6 gap-6 animate-fade-in overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(od,{className:"h-5 w-5",style:{color:"var(--pc-accent)"}}),s.jsxs("h2",{className:"text-sm font-semibold uppercase tracking-wider",style:{color:"var(--pc-text-primary)"},children:[S("memory.memory_title")," (",e.length,")"]})]}),s.jsxs("button",{onClick:()=>g(!0),className:"btn-electric flex items-center gap-2 text-sm px-4 py-2",children:[s.jsx(hd,{className:"h-4 w-4"}),S("memory.add_memory")]})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(Bl,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4",style:{color:"var(--pc-text-faint)"}}),s.jsx("input",{type:"text",value:c,onChange:G=>f(G.target.value),onKeyDown:L,placeholder:S("memory.search_placeholder"),className:"input-electric w-full pl-10 pr-4 py-2.5 text-sm"})]}),s.jsxs("div",{className:"relative",children:[s.jsx(Ug,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4",style:{color:"var(--pc-text-faint)"}}),s.jsxs("select",{value:h,onChange:G=>m(G.target.value),className:"input-electric pl-10 pr-8 py-2.5 text-sm appearance-none",children:[s.jsx("option",{value:"",children:S("memory.all_categories")}),B.map(G=>s.jsx("option",{value:G,children:G},G))]})]}),s.jsx("button",{onClick:I,className:"btn-electric px-4 py-2.5 text-sm",children:S("memory.search_button")})]}),o&&s.jsx("div",{className:"rounded-xl border p-3 text-sm animate-fade-in",style:{background:"rgba(239, 68, 68, 0.08)",borderColor:"rgba(239, 68, 68, 0.2)",color:"#f87171"},children:o}),y&&s.jsx("div",{className:"fixed inset-0 modal-backdrop flex items-center justify-center z-50",children:s.jsxs("div",{className:"surface-panel p-6 w-full max-w-md mx-4 animate-fade-in-scale",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{className:"text-lg font-semibold",style:{color:"var(--pc-text-primary)"},children:S("memory.add_modal_title")}),s.jsx("button",{onClick:()=>{g(!1),F(null)},className:"btn-icon",children:s.jsx(ma,{className:"h-5 w-5"})})]}),D&&s.jsx("div",{className:"mb-4 rounded-xl border p-3 text-sm animate-fade-in",style:{background:"rgba(239, 68, 68, 0.08)",borderColor:"rgba(239, 68, 68, 0.2)",color:"#f87171"},children:D}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsxs("label",{className:"block text-xs font-semibold mb-1.5 uppercase tracking-wider",style:{color:"var(--pc-text-secondary)"},children:[S("memory.key_required")," ",s.jsx("span",{style:{color:"var(--color-status-error)"},children:"*"})]}),s.jsx("input",{type:"text",value:w,onChange:G=>j(G.target.value),placeholder:"e.g. user_preferences",className:"input-electric w-full px-3 py-2.5 text-sm"})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"block text-xs font-semibold mb-1.5 uppercase tracking-wider",style:{color:"var(--pc-text-secondary)"},children:[S("memory.content_required")," ",s.jsx("span",{style:{color:"var(--color-status-error)"},children:"*"})]}),s.jsx("textarea",{value:T,onChange:G=>C(G.target.value),placeholder:"Memory content...",rows:4,className:"input-electric w-full px-3 py-2.5 text-sm resize-none"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs font-semibold mb-1.5 uppercase tracking-wider",style:{color:"var(--pc-text-secondary)"},children:S("memory.category_optional")}),s.jsx("input",{type:"text",value:E,onChange:G=>N(G.target.value),placeholder:"e.g. preferences, context, facts",className:"input-electric w-full px-3 py-2.5 text-sm"})]})]}),s.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[s.jsx("button",{onClick:()=>{g(!1),F(null)},className:"btn-secondary px-4 py-2 text-sm font-medium",children:S("memory.cancel")}),s.jsx("button",{onClick:q,disabled:M,className:"btn-electric px-4 py-2 text-sm font-medium",children:S(M?"memory.saving":"common.save")})]})]})}),r?s.jsx("div",{className:"flex items-center justify-center h-32",children:s.jsx("div",{className:"h-8 w-8 border-2 rounded-full animate-spin",style:{borderColor:"var(--pc-border)",borderTopColor:"var(--pc-accent)"}})}):e.length===0?s.jsxs("div",{className:"card p-8 text-center",children:[s.jsx(od,{className:"h-10 w-10 mx-auto mb-3",style:{color:"var(--pc-text-faint)"}}),s.jsx("p",{style:{color:"var(--pc-text-muted)"},children:S("memory.empty")})]}):s.jsx("div",{className:"card overflow-x-auto rounded-2xl",children:s.jsxs("table",{className:"table-electric",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:S("memory.key")}),s.jsx("th",{children:S("memory.content")}),s.jsx("th",{children:S("memory.category")}),s.jsx("th",{children:S("memory.timestamp")}),s.jsx("th",{className:"text-right",children:S("common.actions")})]})}),s.jsx("tbody",{children:e.map(G=>s.jsxs("tr",{children:[s.jsx("td",{className:"font-mono text-xs",style:{color:"var(--pc-text-primary)"},children:G.key}),s.jsx("td",{className:"max-w-[300px] text-sm",style:{color:"var(--pc-text-secondary)"},children:s.jsx("span",{title:G.content,children:cM(G.content,80)})}),s.jsx("td",{children:s.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-[10px] font-semibold capitalize border",style:{borderColor:"var(--pc-border)",color:"var(--pc-text-secondary)",background:"var(--pc-accent-glow)"},children:G.category})}),s.jsx("td",{className:"text-xs whitespace-nowrap",style:{color:"var(--pc-text-muted)"},children:uM(G.timestamp)}),s.jsx("td",{className:"text-right",children:_===G.key?s.jsxs("div",{className:"flex items-center justify-end gap-2 animate-fade-in",children:[s.jsx("span",{className:"text-xs",style:{color:"var(--color-status-error)"},children:S("memory.delete_confirm")}),s.jsx("button",{onClick:()=>K(G.key),className:"text-xs font-medium",style:{color:"var(--color-status-error)"},children:S("memory.yes")}),s.jsx("button",{onClick:()=>v(null),className:"text-xs font-medium",style:{color:"var(--pc-text-muted)"},children:S("memory.no")})]}):s.jsx("button",{onClick:()=>v(G.key),className:"btn-icon",children:s.jsx(Cs,{className:"h-4 w-4"})})})]},G.id))})]})})]})}function fM(e,n){const r=n.split(".");let l=e;for(const o of r){if(l==null||typeof l!="object")return;l=l[o]}return l}function gx(e,n,r){const l=n.split(".");if(l.length===0)return e;const o={...e},u=l[0];if(l.length===1)return o[u]=r,o;const c=l.slice(1),f=typeof o[u]=="object"&&o[u]!==null?{...o[u]}:{};return o[u]=gx(f,c.join("."),r),o}function hM(){const[e,n]=x.useState(""),[r,l]=x.useState({}),[o,u]=x.useState("form"),[c,f]=x.useState(!0),[h,m]=x.useState(!1),[y,g]=x.useState(!1),[_,v]=x.useState(null),[w,j]=x.useState(null),[T,C]=x.useState(null);x.useEffect(()=>{Cd().then(U=>{const I=typeof U=="string"?U:JSON.stringify(U,null,2);n(I);try{l(Rs(I))}catch(L){l({}),C(L instanceof Error?L.message:S("config.error.initial_parse_failed"))}}).catch(U=>v(U.message)).finally(()=>f(!1))},[]),x.useEffect(()=>{if(!w)return;const U=setTimeout(()=>j(null),4e3);return()=>clearTimeout(U)},[w]);const E=x.useCallback((U,I)=>{l(L=>{const B=gx(L,U,I);return g(!0),B})},[]),N=x.useCallback(U=>fM(r,U),[r]),D=x.useCallback(U=>{if(U!==o){if(C(null),U==="advanced")try{n(cy(r))}catch(I){C(I instanceof Error?I.message:S("config.error.serialize_failed"));return}else try{l(Rs(e))}catch(I){C(I instanceof Error?I.message:S("config.error.invalid_toml_switch"));return}u(U)}},[o,r,e]),F=x.useCallback(U=>{n(U),g(!0)},[]),M=x.useCallback(async()=>{m(!0),v(null),j(null);try{const U=cy(r);await o4(U),j(S("config.save_success")),g(!1),n(U)}catch(U){v(U instanceof Error?U.message:S("config.save_error"))}finally{m(!1)}},[r]),A=x.useCallback(async()=>{f(!0),v(null);try{const U=await Cd(),I=typeof U=="string"?U:JSON.stringify(U,null,2);n(I);try{l(Rs(I))}catch{}g(!1)}catch(U){v(U instanceof Error?U.message:S("config.error.reload_failed"))}finally{f(!1)}},[]);return{parsedConfig:r,rawToml:e,mode:o,loading:c,saving:h,dirty:y,error:_,success:w,parseError:T,updateField:E,getField:N,switchMode:D,updateRawToml:F,save:M,reload:A,setError:v,setSuccess:j}}function il({title:e,children:n}){return s.jsxs("section",{className:"w-full min-w-0",children:[s.jsx("h3",{className:"mb-2 px-4 text-left text-sm font-semibold",style:{color:"var(--pc-text-primary)"},children:e}),s.jsx("div",{className:"rounded-[6px] overflow-hidden flex w-full min-w-0 flex-col gap-px bg-white",children:n})]})}function Ye({label:e,description:n,children:r}){return s.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 min-h-[68px] w-full min-w-0 flex-shrink-0 box-border",style:{background:"#F6F6F6"},children:[s.jsxs("div",{className:"flex-1 min-w-0 py-2",children:[s.jsx("div",{className:"text-sm font-semibold",style:{color:"#1a1a1a"},children:e}),n&&s.jsx("div",{className:"text-xs mt-0.5 leading-snug",style:{color:"#737373"},children:n})]}),s.jsx("div",{className:"flex-shrink-0 flex items-center justify-end min-w-0",children:r})]})}const mM="./icons/ukui-up-symbolic.svg",pM="./icons/ukui-down-symbolic.svg";function yx(e,n,r){let l=e;return n!==void 0&&(l=Math.max(n,l)),r!==void 0&&(l=Math.min(r,l)),l}function Rn({value:e,onChange:n,min:r,max:l,step:o=1,disabled:u}){const c=o!=null?o:1,f=y=>{n(yx(e+y*c,r,l))},h=r!==void 0&&e<=r,m=l!==void 0&&e>=l;return s.jsxs("div",{className:"config-form-number-wrap box-border flex shrink-0 items-stretch overflow-hidden rounded-md pr-2",style:{width:468,height:36,background:"#e6e6e6"},children:[s.jsx("input",{type:"number",value:e,min:r,max:l,step:o,disabled:u,onChange:y=>{const g=Number(y.target.value);Number.isNaN(g)||n(yx(g,r,l))},className:"config-form-number-input min-h-0 min-w-0 flex-1 border-0 bg-transparent py-0 pl-3 pr-2 font-mono text-sm outline-none disabled:opacity-50",style:{color:"#1a1a1a"}}),s.jsxs("div",{className:"flex min-w-[28px] shrink-0 flex-col gap-0","aria-hidden":!0,children:[s.jsx("button",{type:"button",disabled:u||m,className:"flex flex-1 items-center justify-center border-0 bg-transparent outline-none hover:bg-black/[0.04] focus:outline-none focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-30","aria-label":"Increase",onClick:()=>f(1),children:s.jsx("img",{src:mM,alt:"",width:16,height:16,className:"pointer-events-none block",draggable:!1})}),s.jsx("button",{type:"button",disabled:u||h,className:"flex flex-1 items-center justify-center border-0 bg-transparent outline-none hover:bg-black/[0.04] focus:outline-none focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-30","aria-label":"Decrease",onClick:()=>f(-1),children:s.jsx("img",{src:pM,alt:"",width:16,height:16,className:"pointer-events-none block",draggable:!1})})]})]})}function bx(e,n){return n<1?(Number.isInteger(e),e.toFixed(1)):String(Math.round(e))}function If({value:e,onChange:n,min:r,max:l,step:o=1,disabled:u}){const c=l===r?0:(e-r)/(l-r)*100;return s.jsxs("div",{className:`flex items-center gap-2 min-w-0 ${u?"opacity-40":""}`,children:[s.jsx("span",{className:"text-xs font-mono tabular-nums flex-shrink-0 w-9 text-left",style:{color:"#525252"},children:bx(r,o)}),s.jsx("div",{className:"w-[410px] shrink-0",children:s.jsx("input",{type:"range",min:r,max:l,step:o,value:e,disabled:u,onChange:f=>n(Number(f.target.value)),className:"config-form-slider w-full cursor-pointer disabled:cursor-not-allowed",style:{"--slider-pct":`${c}%`}})}),s.jsx("span",{className:"text-xs font-mono tabular-nums flex-shrink-0 w-9 text-right",style:{color:"#525252"},children:bx(l,o)})]})}function fo({value:e,onChange:n,options:r,disabled:l}){return s.jsxs("div",{className:"relative shrink-0 overflow-hidden rounded-md",style:{width:468,height:36},children:[s.jsx("select",{value:e,onChange:o=>n(o.target.value),disabled:l,className:"absolute inset-0 w-full rounded-md border-0 text-sm outline-none cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",style:{height:36,paddingLeft:12,paddingRight:36,background:"#e6e6e6",color:"#1a1a1a",appearance:"none",WebkitAppearance:"none",lineHeight:"36px"},children:r.map(o=>s.jsx("option",{value:o.value,children:o.label},o.value))}),s.jsx("div",{className:"pointer-events-none absolute top-0 bottom-0 right-3 flex items-center justify-center","aria-hidden":!0,children:s.jsx(ha,{className:"h-4 w-4 shrink-0",style:{color:"#525252"}})})]})}const gM=[{value:"",label:"Auto-detect"},{value:"en",label:"English"},{value:"zh",label:"中文"},{value:"tr",label:"Türkçe"}],yM=[{value:"openrouter",label:"OpenRouter"},{value:"anthropic",label:"Anthropic"},{value:"openai",label:"OpenAI"},{value:"ollama",label:"Ollama"},{value:"gemini",label:"Google Gemini"},{value:"azure-openai",label:"Azure OpenAI"},{value:"bedrock",label:"AWS Bedrock"},{value:"groq",label:"Groq"},{value:"mistral",label:"Mistral"},{value:"deepseek",label:"DeepSeek"},{value:"xai",label:"xAI (Grok)"},{value:"together",label:"Together AI"},{value:"fireworks",label:"Fireworks AI"},{value:"perplexity",label:"Perplexity"},{value:"cohere",label:"Cohere"},{value:"cerebras",label:"Cerebras"},{value:"sambanova",label:"SambaNova"},{value:"lmstudio",label:"LM Studio"},{value:"llamacpp",label:"llama.cpp"},{value:"vllm",label:"vLLM"},{value:"qwen",label:"Qwen"},{value:"deepinfra",label:"DeepInfra"},{value:"huggingface",label:"Hugging Face"},{value:"nvidia",label:"NVIDIA NIM"},{value:"cloudflare",label:"Cloudflare AI"},{value:"litellm",label:"LiteLLM"}],xx={openrouter:[{value:"anthropic/claude-sonnet-4-6",label:"Claude Sonnet 4.6"},{value:"anthropic/claude-opus-4-6",label:"Claude Opus 4.6"},{value:"anthropic/claude-4.5-sonnet",label:"Claude 4.5 Sonnet"},{value:"anthropic/claude-opus-4-20250514",label:"Claude Opus 4"},{value:"openai/gpt-5.4",label:"GPT-5.4"},{value:"openai/gpt-5.4-pro",label:"GPT-5.4 Pro"},{value:"openai/gpt-4o",label:"GPT-4o"},{value:"google/gemini-3.1-pro",label:"Gemini 3.1 Pro"},{value:"google/gemini-3.1-flash-lite",label:"Gemini 3.1 Flash Lite"},{value:"google/gemini-2.5-pro",label:"Gemini 2.5 Pro"},{value:"deepseek/deepseek-v3.2",label:"DeepSeek V3.2"},{value:"deepseek/deepseek-r1-0528",label:"DeepSeek R1"},{value:"x-ai/grok-4.1-fast",label:"Grok 4.1 Fast"},{value:"meta-llama/llama-4-maverick",label:"Llama 4 Maverick 400B"},{value:"meta-llama/llama-4-70b",label:"Llama 4 70B"},{value:"mistralai/devstral-2",label:"Devstral 2"},{value:"qwen/qwen-3.6-plus-preview",label:"Qwen 3.6 Plus Preview"}],anthropic:[{value:"claude-sonnet-4-6",label:"Claude Sonnet 4.6"},{value:"claude-opus-4-6",label:"Claude Opus 4.6"},{value:"claude-4.5-sonnet",label:"Claude 4.5 Sonnet"},{value:"claude-opus-4-20250514",label:"Claude Opus 4"},{value:"claude-haiku-4-5-20251001",label:"Claude Haiku 4.5"}],openai:[{value:"gpt-5.4",label:"GPT-5.4"},{value:"gpt-5.4-pro",label:"GPT-5.4 Pro"},{value:"gpt-4o",label:"GPT-4o"},{value:"gpt-4o-mini",label:"GPT-4o Mini"},{value:"o1-preview",label:"o1 Preview"}],gemini:[{value:"gemini-3.1-pro",label:"Gemini 3.1 Pro"},{value:"gemini-3.1-flash-lite",label:"Gemini 3.1 Flash Lite"},{value:"gemini-3-pro",label:"Gemini 3 Pro"},{value:"gemini-2.5-pro",label:"Gemini 2.5 Pro"},{value:"gemini-2.5-flash",label:"Gemini 2.5 Flash"}],groq:[{value:"llama-4-70b",label:"Llama 4 70B"},{value:"gpt-oss-120b",label:"GPT-OSS 120B"},{value:"llama-3.3-70b-versatile",label:"Llama 3.3 70B"}],mistral:[{value:"mistral-large-latest",label:"Mistral Large"},{value:"devstral-2",label:"Devstral 2"},{value:"mistral-small-latest",label:"Mistral Small"},{value:"codestral-latest",label:"Codestral"}],deepseek:[{value:"deepseek-chat",label:"DeepSeek V3.2 Chat"},{value:"deepseek-reasoner",label:"DeepSeek R1 Reasoner"}],xai:[{value:"grok-4.1-fast",label:"Grok 4.1 Fast"},{value:"grok-3",label:"Grok 3"},{value:"grok-3-mini",label:"Grok 3 Mini"}],together:[{value:"meta-llama/Llama-4-Maverick-400B",label:"Llama 4 Maverick 400B"},{value:"meta-llama/Llama-4-70B",label:"Llama 4 70B"},{value:"meta-llama/Llama-3.3-70B-Instruct-Turbo",label:"Llama 3.3 70B Turbo"}],fireworks:[{value:"accounts/fireworks/models/llama-4-maverick-400b",label:"Llama 4 Maverick 400B"},{value:"accounts/fireworks/models/llama-v3p3-70b-instruct",label:"Llama 3.3 70B"}],cerebras:[{value:"llama-4-70b",label:"Llama 4 70B"},{value:"llama-3.3-70b",label:"Llama 3.3 70B"}],bedrock:[{value:"anthropic.claude-sonnet-4-6",label:"Claude Sonnet 4.6"},{value:"anthropic.claude-opus-4-6",label:"Claude Opus 4.6"},{value:"anthropic.claude-haiku-4-5",label:"Claude Haiku 4.5"}],"azure-openai":[{value:"gpt-5.4",label:"GPT-5.4"},{value:"gpt-4o",label:"GPT-4o"},{value:"gpt-4o-mini",label:"GPT-4o Mini"}],qwen:[{value:"qwen-3.6-plus-preview",label:"Qwen 3.6 Plus Preview"},{value:"qwen-max",label:"Qwen Max"},{value:"qwen-plus",label:"Qwen Plus"},{value:"qwen-turbo",label:"Qwen Turbo"}],perplexity:[{value:"sonar-pro",label:"Sonar Pro"},{value:"sonar",label:"Sonar"}],sambanova:[{value:"llama-4-maverick-400b",label:"Llama 4 Maverick 400B"},{value:"llama-3.3-70b",label:"Llama 3.3 70B"}]};function bM({config:e,onUpdate:n}){var c,f,h,m,y;const r=(c=e.default_provider)!=null?c:"openrouter",l=xx[r],o=(f=e.default_model)!=null?f:"",u=g=>{n("default_provider",g);const _=xx[g];_&&_.length>0&&n("default_model",_[0].value)};return s.jsxs(il,{title:S("config.section.general"),children:[s.jsx(Ye,{label:S("config.field.default_provider"),description:S("config.field.default_provider.desc"),children:s.jsx(fo,{value:r,onChange:u,options:yM})}),s.jsx(Ye,{label:S("config.field.default_model"),description:S("config.field.default_model.desc"),children:l?s.jsx(fo,{value:l.some(g=>g.value===o)?o:"",onChange:g=>n("default_model",g),options:[...o&&!l.some(g=>g.value===o)?[{value:o,label:o}]:[],...l]}):s.jsx("input",{type:"text",value:o,onChange:g=>n("default_model",g.target.value),placeholder:"model name",className:"rounded-md border-0 text-sm px-3 font-mono outline-none",style:{width:"min(468px, 100%)",maxWidth:"100%",height:36,background:"#e6e6e6",color:"#1a1a1a"}})}),s.jsx(Ye,{label:S("config.field.default_temperature"),description:S("config.field.default_temperature.desc"),children:s.jsx(If,{value:(h=e.default_temperature)!=null?h:.7,onChange:g=>n("default_temperature",g),min:0,max:2,step:.1})}),s.jsx(Ye,{label:S("config.field.provider_timeout_secs"),description:S("config.field.provider_timeout_secs.desc"),children:s.jsx(Rn,{value:(m=e.provider_timeout_secs)!=null?m:120,onChange:g=>n("provider_timeout_secs",g),min:1})}),s.jsx(Ye,{label:S("config.field.locale"),description:S("config.field.locale.desc"),children:s.jsx(fo,{value:(y=e.locale)!=null?y:"",onChange:g=>n("locale",g||void 0),options:gM})})]})}function Kn({value:e,onChange:n,disabled:r}){const l="#3790FA";return s.jsx("button",{type:"button",role:"switch","aria-checked":e,disabled:r,onClick:()=>n(!e),className:"relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-[opacity,transform] duration-200 focus:outline-none disabled:cursor-not-allowed disabled:opacity-40",style:{backgroundColor:e?l:"#e6e6e6",border:e?`1px solid ${l}`:"1px solid #e5e5e5",opacity:r?.4:1,cursor:r?"not-allowed":"pointer"},children:s.jsx("span",{className:`inline-block h-4 w-4 rounded-full bg-white transition-transform duration-200 ${e?"":"shadow-[inset_0_0_0_1px_rgba(0,0,0,0.06)]"}`,style:{transform:e?"translateX(22px)":"translateX(4px)"}})})}function xM({config:e,onUpdate:n}){var l,o,u,c,f,h;const r=(l=e.agent)!=null?l:{};return s.jsxs(il,{title:S("config.section.agent"),children:[s.jsx(Ye,{label:S("config.field.compact_context"),description:S("config.field.compact_context.desc"),children:s.jsx(Kn,{value:(o=r.compact_context)!=null?o:!0,onChange:m=>n("agent.compact_context",m)})}),s.jsx(Ye,{label:S("config.field.max_tool_iterations"),description:S("config.field.max_tool_iterations.desc"),children:s.jsx(Rn,{value:(u=r.max_tool_iterations)!=null?u:10,onChange:m=>n("agent.max_tool_iterations",m),min:1,max:100})}),s.jsx(Ye,{label:S("config.field.max_history_messages"),description:S("config.field.max_history_messages.desc"),children:s.jsx(Rn,{value:(c=r.max_history_messages)!=null?c:50,onChange:m=>n("agent.max_history_messages",m),min:1})}),s.jsx(Ye,{label:S("config.field.max_context_tokens"),description:S("config.field.max_context_tokens.desc"),children:s.jsx(Rn,{value:(f=r.max_context_tokens)!=null?f:32e3,onChange:m=>n("agent.max_context_tokens",m),min:1e3,step:1e3})}),s.jsx(Ye,{label:S("config.field.parallel_tools"),description:S("config.field.parallel_tools.desc"),children:s.jsx(Kn,{value:(h=r.parallel_tools)!=null?h:!1,onChange:m=>n("agent.parallel_tools",m)})})]})}function Uf({value:e,onChange:n,placeholder:r,disabled:l,masked:o,variant:u="default"}){const[c,f]=x.useState(!1),h=e==="***MASKED***",m=o&&!c,y=u==="config"?{width:"min(468px, 100%)",maxWidth:"100%",height:36,background:"#e6e6e6",color:"#1a1a1a"}:void 0;return s.jsxs("div",{className:"relative flex items-center min-w-0",style:u==="config"?{width:"min(468px, 100%)",maxWidth:"100%"}:void 0,children:[s.jsx("input",{type:m?"password":"text",value:e,onChange:g=>n(g.target.value),placeholder:r,disabled:l,className:u==="config"?"rounded-md border-0 text-sm px-3 font-mono outline-none w-full disabled:opacity-50":"input-electric text-sm px-3 py-1.5 w-52 font-mono",style:u==="config"?{...y!=null?y:{},...h?{color:"var(--pc-text-muted)"}:{}}:h?{color:"var(--pc-text-muted)"}:void 0}),o&&s.jsx("button",{type:"button",onClick:()=>f(!c),className:"absolute right-2 p-0.5",style:{color:"var(--pc-text-muted)"},children:c?s.jsx(Bg,{className:"h-3.5 w-3.5"}):s.jsx(Fg,{className:"h-3.5 w-3.5"})})]})}function vM({config:e,onUpdate:n}){var l,o,u,c,f,h,m;const r=(l=e.gateway)!=null?l:{};return s.jsxs(il,{title:S("config.section.gateway"),children:[s.jsx(Ye,{label:S("config.field.gateway_port"),description:S("config.field.gateway_port.desc"),children:s.jsx(Rn,{value:(o=r.port)!=null?o:42617,onChange:y=>n("gateway.port",y),min:1,max:65535})}),s.jsx(Ye,{label:S("config.field.gateway_host"),description:S("config.field.gateway_host.desc"),children:s.jsx(Uf,{variant:"config",value:(u=r.host)!=null?u:"127.0.0.1",onChange:y=>n("gateway.host",y),placeholder:"127.0.0.1"})}),s.jsx(Ye,{label:S("config.field.require_pairing"),description:S("config.field.require_pairing.desc"),children:s.jsx(Kn,{value:(c=r.require_pairing)!=null?c:!0,onChange:y=>n("gateway.require_pairing",y)})}),s.jsx(Ye,{label:S("config.field.session_persistence"),description:S("config.field.session_persistence.desc"),children:s.jsx(Kn,{value:(f=r.session_persistence)!=null?f:!0,onChange:y=>n("gateway.session_persistence",y)})}),s.jsx(Ye,{label:S("config.field.session_ttl_hours"),description:S("config.field.session_ttl_hours.desc"),children:s.jsx(Rn,{value:(h=r.session_ttl_hours)!=null?h:0,onChange:y=>n("gateway.session_ttl_hours",y),min:0})}),s.jsx(Ye,{label:S("config.field.allow_public_bind"),description:S("config.field.allow_public_bind.desc"),children:s.jsx(Kn,{value:(m=r.allow_public_bind)!=null?m:!1,onChange:y=>n("gateway.allow_public_bind",y)})})]})}function _M({config:e,onUpdate:n}){var l,o,u,c,f,h;const r=(l=e.cost)!=null?l:{};return s.jsxs(il,{title:S("config.section.cost"),children:[s.jsx(Ye,{label:S("config.field.cost_enabled"),description:S("config.field.cost_enabled.desc"),children:s.jsx(Kn,{value:(o=r.enabled)!=null?o:!0,onChange:m=>n("cost.enabled",m)})}),s.jsx(Ye,{label:S("config.field.daily_limit_usd"),description:S("config.field.daily_limit_usd.desc"),children:s.jsx(Rn,{value:(u=r.daily_limit_usd)!=null?u:10,onChange:m=>n("cost.daily_limit_usd",m),min:0,step:1})}),s.jsx(Ye,{label:S("config.field.monthly_limit_usd"),description:S("config.field.monthly_limit_usd.desc"),children:s.jsx(Rn,{value:(c=r.monthly_limit_usd)!=null?c:100,onChange:m=>n("cost.monthly_limit_usd",m),min:0,step:5})}),s.jsx(Ye,{label:S("config.field.warn_at_percent"),description:S("config.field.warn_at_percent.desc"),children:s.jsx(If,{value:(f=r.warn_at_percent)!=null?f:80,onChange:m=>n("cost.warn_at_percent",m),min:0,max:100,step:5})}),s.jsx(Ye,{label:S("config.field.allow_override"),description:S("config.field.allow_override.desc"),children:s.jsx(Kn,{value:(h=r.allow_override)!=null?h:!1,onChange:m=>n("cost.allow_override",m)})})]})}const wM=[{value:"sqlite",label:"SQLite"},{value:"markdown",label:"Markdown"},{value:"embeddings",label:"Embeddings"},{value:"hybrid",label:"Hybrid"}];function kM({config:e,onUpdate:n}){var l,o,u;const r=(l=e.memory)!=null?l:{};return s.jsxs(il,{title:S("config.section.memory"),children:[s.jsx(Ye,{label:S("config.field.memory_enabled"),description:S("config.field.memory_enabled.desc"),children:s.jsx(Kn,{value:(o=r.enabled)!=null?o:!0,onChange:c=>n("memory.enabled",c)})}),s.jsx(Ye,{label:S("config.field.memory_backend"),description:S("config.field.memory_backend.desc"),children:s.jsx(fo,{value:(u=r.backend)!=null?u:"sqlite",onChange:c=>n("memory.backend",c),options:wM})})]})}const SM=[{value:"duckduckgo",label:"DuckDuckGo"},{value:"brave",label:"Brave"},{value:"searxng",label:"SearXNG"}];function CM({config:e,onUpdate:n}){var l,o,u,c,f;const r=(l=e.web_search)!=null?l:{};return s.jsxs(il,{title:S("config.section.web_search"),children:[s.jsx(Ye,{label:S("config.field.web_search_enabled"),description:S("config.field.web_search_enabled.desc"),children:s.jsx(Kn,{value:(o=r.enabled)!=null?o:!0,onChange:h=>n("web_search.enabled",h)})}),s.jsx(Ye,{label:S("config.field.web_search_provider"),description:S("config.field.web_search_provider.desc"),children:s.jsx(fo,{value:(u=r.provider)!=null?u:"duckduckgo",onChange:h=>n("web_search.provider",h),options:SM})}),s.jsx(Ye,{label:S("config.field.max_results"),description:S("config.field.max_results.desc"),children:s.jsx(If,{value:(c=r.max_results)!=null?c:5,onChange:h=>n("web_search.max_results",h),min:1,max:10})}),s.jsx(Ye,{label:S("config.field.web_search_timeout"),description:S("config.field.web_search_timeout.desc"),children:s.jsx(Rn,{value:(f=r.timeout_secs)!=null?f:15,onChange:h=>n("web_search.timeout_secs",h),min:1})})]})}function jM({config:e,onUpdate:n}){var l,o,u,c,f,h,m,y,g,_;const r=(l=e.heartbeat)!=null?l:{};return s.jsxs(il,{title:S("config.section.heartbeat"),children:[s.jsx(Ye,{label:S("config.field.heartbeat_enabled"),description:S("config.field.heartbeat_enabled.desc"),children:s.jsx(Kn,{value:(o=r.enabled)!=null?o:!0,onChange:v=>n("heartbeat.enabled",v)})}),s.jsx(Ye,{label:S("config.field.interval_minutes"),description:S("config.field.interval_minutes.desc"),children:s.jsx(Rn,{value:(u=r.interval_minutes)!=null?u:30,onChange:v=>n("heartbeat.interval_minutes",v),min:1})}),s.jsx(Ye,{label:S("config.field.two_phase"),description:S("config.field.two_phase.desc"),children:s.jsx(Kn,{value:(c=r.two_phase)!=null?c:!0,onChange:v=>n("heartbeat.two_phase",v)})}),s.jsx(Ye,{label:S("config.field.adaptive"),description:S("config.field.adaptive.desc"),children:s.jsx(Kn,{value:(f=r.adaptive)!=null?f:!1,onChange:v=>n("heartbeat.adaptive",v)})}),s.jsx(Ye,{label:S("config.field.min_interval_minutes"),description:S("config.field.min_interval_minutes.desc"),children:s.jsx(Rn,{value:(h=r.min_interval_minutes)!=null?h:5,onChange:v=>n("heartbeat.min_interval_minutes",v),min:1})}),s.jsx(Ye,{label:S("config.field.max_interval_minutes"),description:S("config.field.max_interval_minutes.desc"),children:s.jsx(Rn,{value:(m=r.max_interval_minutes)!=null?m:120,onChange:v=>n("heartbeat.max_interval_minutes",v),min:1})}),s.jsx(Ye,{label:S("config.field.heartbeat_message"),description:S("config.field.heartbeat_message.desc"),children:s.jsx(Uf,{variant:"config",value:(y=r.message)!=null?y:"",onChange:v=>n("heartbeat.message",v||void 0),placeholder:"Optional fallback task"})}),s.jsx(Ye,{label:S("config.field.heartbeat_target"),description:S("config.field.heartbeat_target.desc"),children:s.jsx(Uf,{variant:"config",value:(g=r.target)!=null?g:"",onChange:v=>n("heartbeat.target",v||void 0),placeholder:"e.g. telegram"})}),s.jsx(Ye,{label:S("config.field.task_timeout_secs"),description:S("config.field.task_timeout_secs.desc"),children:s.jsx(Rn,{value:(_=r.task_timeout_secs)!=null?_:600,onChange:v=>n("heartbeat.task_timeout_secs",v),min:0})})]})}const EM=[{key:"general",icon:Jg,label:()=>S("config.section.general")},{key:"memory",icon:od,label:()=>S("config.section.memory")},{key:"heartbeat",icon:eC,label:()=>S("config.section.heartbeat")},{key:"web_search",icon:Bl,label:()=>S("config.section.web_search")},{key:"cost",icon:ud,label:()=>S("config.section.cost")},{key:"agent",icon:hr,label:()=>S("config.section.agent")},{key:"gateway",icon:pC,label:()=>S("config.section.gateway")}];function NM({config:e,onUpdate:n}){const r=x.useRef({}),l=x.useCallback(u=>{var c;(c=r.current[u])==null||c.scrollIntoView({behavior:"smooth",block:"start"})},[]),o=x.useCallback(u=>c=>{r.current[u]=c},[]);return s.jsxs("div",{className:"flex flex-1 min-h-0 gap-4 overflow-hidden",children:[s.jsx("nav",{className:"hidden md:flex flex-col gap-1 w-44 flex-shrink-0 pt-1",children:EM.map(({key:u,icon:c,label:f})=>s.jsxs("button",{type:"button",onClick:()=>l(u),className:"flex items-center gap-2.5 px-3 py-2 rounded-xl text-xs font-medium transition-colors text-left",style:{color:"var(--pc-text-secondary)"},onMouseEnter:h=>{h.currentTarget.style.background="var(--pc-bg-elevated)",h.currentTarget.style.color="var(--pc-text-primary)"},onMouseLeave:h=>{h.currentTarget.style.background="transparent",h.currentTarget.style.color="var(--pc-text-secondary)"},children:[s.jsx(c,{className:"h-4 w-4",style:{color:"var(--pc-accent)"}}),f()]},u))}),s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-[40px] overflow-y-auto pr-1",children:[s.jsx("div",{ref:o("general"),children:s.jsx(bM,{config:e,onUpdate:n})}),s.jsx("div",{ref:o("memory"),children:s.jsx(kM,{config:e,onUpdate:n})}),s.jsx("div",{ref:o("heartbeat"),children:s.jsx(jM,{config:e,onUpdate:n})}),s.jsx("div",{ref:o("web_search"),children:s.jsx(CM,{config:e,onUpdate:n})}),s.jsx("div",{ref:o("cost"),children:s.jsx(_M,{config:e,onUpdate:n})}),s.jsx("div",{ref:o("agent"),children:s.jsx(xM,{config:e,onUpdate:n})}),s.jsx("div",{ref:o("gateway"),children:s.jsx(vM,{config:e,onUpdate:n})})]})]})}function TM(){const{parsedConfig:e,loading:n,saving:r,error:l,success:o,parseError:u,updateField:c,save:f}=hM();return n?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"h-8 w-8 border-2 rounded-full animate-spin",style:{borderColor:"var(--pc-border)",borderTopColor:"var(--pc-accent)"}})}):s.jsxs("div",{className:"flex h-full flex-col gap-2 overflow-hidden px-6 pb-6 pt-0 animate-fade-in",children:[s.jsx("div",{className:"flex justify-end flex-shrink-0",children:s.jsxs("button",{type:"button",onClick:()=>void f(),disabled:r,className:"flex items-center gap-2 rounded-xl border-0 px-4 py-2 text-sm font-medium text-white transition-opacity bg-[#3790FA] hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-40",children:[s.jsx(hC,{className:"h-4 w-4"}),S(r?"config.saving":"config.save")]})}),o&&s.jsxs("div",{className:"flex items-center gap-2 rounded-xl p-3 border animate-fade-in flex-shrink-0",style:{borderColor:"rgba(0, 230, 138, 0.2)",background:"rgba(0, 230, 138, 0.06)"},children:[s.jsx(sd,{className:"h-4 w-4 flex-shrink-0",style:{color:"var(--color-status-success)"}}),s.jsx("span",{className:"text-sm",style:{color:"var(--color-status-success)"},children:o})]}),(l||u)&&s.jsxs("div",{className:"flex items-center gap-2 rounded-xl p-3 border animate-fade-in flex-shrink-0",style:{borderColor:"rgba(239, 68, 68, 0.2)",background:"rgba(239, 68, 68, 0.06)"},children:[s.jsx(js,{className:"h-4 w-4 flex-shrink-0",style:{color:"var(--color-status-error)"}}),s.jsx("span",{className:"text-sm",style:{color:"var(--color-status-error)"},children:l||u})]}),s.jsx(NM,{config:e,onUpdate:c})]})}function ho(e){return`$${e.toFixed(4)}`}function AM(){const[e,n]=x.useState(null),[r,l]=x.useState(!0),[o,u]=x.useState(null),c=x.useCallback(()=>{zs().then(h=>{n(h),u(null)}).catch(h=>u(h instanceof Error?h.message:String(h)))},[]);if(x.useEffect(()=>{l(!0),zs().then(h=>{n(h),u(null)}).catch(h=>u(h instanceof Error?h.message:String(h))).finally(()=>l(!1))},[]),x.useEffect(()=>{let h;const m=()=>{h!==void 0&&clearTimeout(h),h=window.setTimeout(()=>{h=void 0,c()},400)},y=()=>{document.visibilityState==="visible"&&m()};return window.addEventListener(tl,m),document.addEventListener("visibilitychange",y),()=>{window.removeEventListener(tl,m),document.removeEventListener("visibilitychange",y),h!==void 0&&clearTimeout(h)}},[c]),o)return s.jsx("div",{className:"p-6 animate-fade-in",children:s.jsxs("div",{className:"rounded-2xl border p-4",style:{background:"rgba(239, 68, 68, 0.08)",borderColor:"rgba(239, 68, 68, 0.2)",color:"#f87171"},children:[S("cost.load_error"),": ",o]})});if(r||!e)return s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"h-8 w-8 border-2 rounded-full animate-spin",style:{borderColor:"var(--pc-border)",borderTopColor:"var(--pc-accent)"}})});const f=Object.values(e.by_model);return s.jsxs("div",{className:"p-6 space-y-6 animate-fade-in",children:[s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 stagger-children",children:[{icon:ud,accent:"var(--pc-accent)",bg:"rgba(var(--pc-accent-rgb), 0.08)",label:S("cost.session_cost"),value:ho(e.session_cost_usd)},{icon:wC,accent:"var(--color-status-success)",bg:"rgba(0, 230, 138, 0.08)",label:S("cost.daily_cost"),value:ho(e.daily_cost_usd)},{icon:rC,accent:"#a78bfa",bg:"rgba(167, 139, 250, 0.08)",label:S("cost.monthly_cost"),value:ho(e.monthly_cost_usd)},{icon:Ss,accent:"var(--color-status-warning)",bg:"rgba(255, 170, 0, 0.08)",label:S("cost.total_requests"),value:e.request_count.toLocaleString()}].map(({icon:h,accent:m,bg:y,label:g,value:_})=>s.jsxs("div",{className:"card p-5 animate-slide-in-up",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[s.jsx("div",{className:"p-2 rounded-2xl",style:{background:y,color:m},children:s.jsx(h,{className:"h-5 w-5"})}),s.jsx("span",{className:"text-xs uppercase tracking-wider font-medium",style:{color:"var(--pc-text-muted)"},children:g})]}),s.jsx("p",{className:"text-2xl font-bold font-mono",style:{color:"var(--pc-text-primary)"},children:_})]},g))}),s.jsxs("div",{className:"card p-5 animate-slide-in-up",style:{animationDelay:"200ms"},children:[s.jsx("h3",{className:"text-sm font-semibold mb-4 uppercase tracking-wider",style:{color:"var(--pc-text-primary)"},children:S("cost.token_statistics")}),s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[{label:S("cost.total_tokens"),value:e.total_tokens.toLocaleString()},{label:S("cost.avg_tokens_per_request"),value:e.request_count>0?Math.round(e.total_tokens/e.request_count).toLocaleString():"0"},{label:S("cost.cost_per_1k_tokens"),value:e.total_tokens>0?ho(e.monthly_cost_usd/e.total_tokens*1e3):"$0.0000"}].map(({label:h,value:m})=>s.jsxs("div",{className:"rounded-2xl p-4 border",style:{background:"var(--pc-accent-glow)",borderColor:"var(--pc-border)"},children:[s.jsx("p",{className:"text-xs uppercase tracking-wider",style:{color:"var(--pc-text-muted)"},children:h}),s.jsx("p",{className:"text-xl font-bold mt-1 font-mono",style:{color:"var(--pc-text-primary)"},children:m})]},h))})]}),s.jsxs("div",{className:"card overflow-hidden animate-slide-in-up rounded-2xl",style:{animationDelay:"300ms"},children:[s.jsx("div",{className:"px-5 py-4 border-b",style:{borderColor:"var(--pc-border)"},children:s.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wider",style:{color:"var(--pc-text-primary)"},children:S("cost.model_breakdown")})}),f.length===0?s.jsx("div",{className:"p-8 text-center",style:{color:"var(--pc-text-faint)"},children:S("cost.no_model_data")}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"table-electric",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:S("cost.model")}),s.jsx("th",{className:"text-right",children:S("cost.cost")}),s.jsx("th",{className:"text-right",children:S("cost.tokens")}),s.jsx("th",{className:"text-right",children:S("cost.requests")}),s.jsx("th",{children:S("cost.share")})]})}),s.jsx("tbody",{children:f.sort((h,m)=>m.cost_usd-h.cost_usd).map(h=>{const m=e.monthly_cost_usd>0?h.cost_usd/e.monthly_cost_usd*100:0;return s.jsxs("tr",{children:[s.jsx("td",{className:"font-medium text-sm",style:{color:"var(--pc-text-primary)"},children:h.model}),s.jsx("td",{className:"text-right font-mono text-sm",style:{color:"var(--pc-text-secondary)"},children:ho(h.cost_usd)}),s.jsx("td",{className:"text-right text-sm",style:{color:"var(--pc-text-secondary)"},children:h.total_tokens.toLocaleString()}),s.jsx("td",{className:"text-right text-sm",style:{color:"var(--pc-text-secondary)"},children:h.request_count.toLocaleString()}),s.jsx("td",{children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-20 h-1.5 rounded-full overflow-hidden",style:{background:"var(--pc-hover)"},children:s.jsx("div",{className:"h-full rounded-full progress-bar-animated transition-all duration-700",style:{width:`${Math.max(m,2)}%`,background:"var(--pc-accent)"}})}),s.jsxs("span",{className:"text-xs font-mono w-10 text-right",style:{color:"var(--pc-text-muted)"},children:[m.toFixed(1),"%"]})]})})]},h.model)})})]})})]})]})}const Zl=[{key:"qianfan",label:"百度千帆",displayTag:"百度千帆",storageProvider:"qianfan",isCustom:!1,iconColor:"#ffffff",iconBg:"#5B54E6",glyph:"千",iconAsset:"qianfan.svg"},{key:"deepseek",label:"DeepSeek",displayTag:"DeepSeek",storageProvider:"deepseek",isCustom:!1,iconColor:"#ffffff",iconBg:"#4D6BFE",glyph:"D",iconAsset:"deepseek.svg"},{key:"doubao",label:"火山引擎",displayTag:"火山引擎",storageProvider:"doubao",isCustom:!1,iconColor:"#ffffff",iconBg:"#3B7BF5",glyph:"火",iconAsset:"doubao.svg"},{key:"minimax",label:"MiniMax",displayTag:"MiniMax",storageProvider:"minimax-cn",isCustom:!1,iconColor:"#ffffff",iconBg:"#E14B99",glyph:"M",iconAsset:"minimax.svg"},{key:"moonshot",label:"Moonshot",displayTag:"Moonshot",storageProvider:"moonshot",isCustom:!1,iconColor:"#ffffff",iconBg:"#1C1C1E",glyph:"M",iconAsset:"moonshot.svg"},{key:"ollama",label:"Ollama",displayTag:"Ollama",storageProvider:"ollama",isCustom:!1,iconColor:"#ffffff",iconBg:"#1C6B3A",glyph:"O",iconAsset:"ollama.svg"},{key:"qwen",label:"Qwen",displayTag:"Qwen",storageProvider:"qwen",isCustom:!1,iconColor:"#ffffff",iconBg:"#5946F5",glyph:"Q",iconAsset:"qwen.svg"},{key:"glm",label:"Zhipu AI",displayTag:"Zhipu AI",storageProvider:"glm-cn",isCustom:!1,iconColor:"#ffffff",iconBg:"#3B7BF5",glyph:"Z",iconAsset:"zhipu.svg"},{key:"custom",label:"自定义",displayTag:"自定义",storageProvider:"custom",isCustom:!0,iconColor:"#ffffff",iconBg:"#3790FA",glyph:"+",iconAsset:"custom.svg"}],vx=Zl[0].key,ol=Zl.find(e=>e.key==="custom"),MM={qianfan:"qianfan",baidu:"qianfan",deepseek:"deepseek",doubao:"doubao",doubao_cn:"doubao","doubao-cn":"doubao",volcengine:"doubao",ark:"doubao",minimax:"minimax","minimax-cn":"minimax","minimax-intl":"minimax",minimaxi:"minimax",moonshot:"moonshot",kimi:"moonshot","moonshot-cn":"moonshot","kimi-cn":"moonshot","moonshot-intl":"moonshot","kimi-intl":"moonshot","moonshot-global":"moonshot",ollama:"ollama",qwen:"qwen",dashscope:"qwen","qwen-intl":"qwen","qwen-intl-dashscope":"qwen","dashscope-intl":"qwen","qwen-us":"qwen",glm:"glm",zhipu:"glm","glm-cn":"glm","zhipu-cn":"glm","glm-global":"glm","zhipu-global":"glm",custom:"custom"};function Hf(e){if(!e)return{meta:ol};const n=e.trim();if(n.startsWith("custom:"))return{meta:ol,baseUrl:n.slice(7),iconAsset:ol.iconAsset};if(n==="custom")return{meta:ol,iconAsset:ol.iconAsset};const r=MM[n.toLowerCase()];if(r){const l=Zl.find(o=>o.key===r);if(l)return{meta:l,iconAsset:l.iconAsset}}return{meta:ol}}function _x(e){var n;return(n=Zl.find(r=>r.key===e))!=null?n:ol}function RM(e){const n=e.replace(/^\//,""),r=n.includes("/")?n:`icons/${n}`,l=$e.replace(/\/+$/,"");return l?`${l}/${r}`:`/${r}`}function qf({meta:e,bundledIcon:n,size:r=24,className:l}){return n?s.jsx("img",{src:RM(n),alt:"",className:`inline-block flex-shrink-0 object-contain ${l!=null?l:""}`,style:{width:r,height:r}}):s.jsx("span",{className:`inline-flex items-center justify-center flex-shrink-0 rounded-full font-semibold ${l!=null?l:""}`,style:{width:r,height:r,background:e.iconBg,color:e.iconColor,fontSize:r<=16?11:r<=20?10:12,letterSpacing:0},children:e.glyph})}function DM({model:e,isDefault:n,onSelect:r,onEdit:l,onDelete:o,rowRadiusStyle:u}){const[c,f]=x.useState(!1),[h,m]=x.useState(!1),[y,g]=x.useState(!1),_=x.useRef(null),v=x.useRef(null),w=x.useRef(null),{onMouseEnter:j,onMouseMove:T,onMouseLeave:C,tooltip:E}=Y0(c),{meta:N,iconAsset:D}=Hf(e.provider);x.useEffect(()=>{if(!c)return;const L=q=>{const K=q.target;_.current&&!_.current.contains(K)&&v.current&&!v.current.contains(K)&&f(!1)},B=()=>f(!1);return document.addEventListener("mousedown",L),window.addEventListener("blur",B),()=>{document.removeEventListener("mousedown",L),window.removeEventListener("blur",B)}},[c]);const F="#f6f6f6",M=c?"var(--model-alpha-hover)":y?"var(--model-alpha-active)":h?"var(--model-alpha-hover)":"transparent",A=()=>{n||r()},U=L=>{var q;const B=L.target;(q=w.current)!=null&&q.contains(B)||A()},I=L=>{n||(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),r())};return s.jsxs("div",{className:"relative flex min-w-0 box-border shrink-0 items-center",role:n?void 0:"button",tabIndex:n?void 0:0,"aria-label":n?void 0:"设为默认模型",style:{...u,height:60,paddingLeft:16,paddingRight:16,background:F,overflow:"visible",cursor:n?"default":"pointer"},onClick:U,onKeyDown:I,children:[s.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-row items-center overflow-hidden",style:{cursor:"inherit"},children:[s.jsxs("div",{className:"flex min-h-0 min-w-0 shrink flex-row items-center overflow-hidden",style:{width:"fit-content",maxWidth:"var(--model-row-info-width)"},children:[s.jsx(qf,{meta:N,bundledIcon:D,size:24}),s.jsx(dc,{className:"min-w-0 shrink",text:e.label||e.value,style:{marginLeft:8,fontFamily:"var(--model-font-family)",fontSize:"var(--model-font-size)",color:"var(--model-text-primary)"}}),s.jsx("span",{"aria-hidden":!0,className:"shrink-0",style:{width:1,height:16,marginLeft:4,marginRight:4,background:"var(--model-divider-bg)",opacity:1}}),s.jsx("span",{className:"shrink-0 whitespace-nowrap",style:{fontFamily:"var(--model-font-family)",fontSize:"var(--model-font-size)",color:"var(--model-text-secondary)"},children:N.displayTag})]}),s.jsx("div",{"aria-hidden":!0,className:"min-h-0 min-w-0 flex-1"})]}),s.jsxs("div",{ref:w,className:"flex shrink-0 flex-row items-center",onClick:L=>L.stopPropagation(),onMouseDown:L=>L.stopPropagation(),children:[s.jsxs("div",{className:"relative inline-flex shrink-0",children:[s.jsx("button",{ref:v,type:"button","aria-expanded":c,"aria-label":"更多",className:"inline-flex shrink-0 cursor-default items-center justify-center transition-colors border-none",style:{width:36,height:36,borderRadius:6,background:M},onMouseEnter:L=>{m(!0),j(L)},onMouseMove:T,onMouseLeave:()=>{m(!1),g(!1),C()},onMouseDown:L=>{L.stopPropagation(),g(!0)},onMouseUp:()=>g(!1),onClick:L=>{L.stopPropagation(),f(B=>!B)},children:s.jsx("img",{src:`${$e}/icons/view-more-horizontal-symbolic.svg`,alt:"",width:16,height:16,className:"pointer-events-none object-contain select-none",draggable:!1})}),c&&s.jsxs("div",{ref:_,className:"model-more-menu-panel absolute z-[100] shrink-0",style:{top:"100%",right:0},onMouseDown:L=>L.stopPropagation(),onClick:L=>L.stopPropagation(),children:[s.jsx("button",{type:"button",className:"skill-uninstall-btn",style:{width:164,height:36},onMouseDown:L=>L.stopPropagation(),onClick:()=>{f(!1),l()},children:"编辑"}),s.jsx("button",{type:"button",className:"skill-uninstall-btn",style:{width:164,height:36},onMouseDown:L=>L.stopPropagation(),onClick:()=>{f(!1),o()},children:"删除"})]}),E]}),s.jsx(LM,{isDefault:n,onSelect:r})]})]})}function LM({isDefault:e,onSelect:n}){const r=e?"当前默认模型":"设为默认模型",l=e?"radio-select.svg":"radio.svg";return s.jsx("button",{type:"button","aria-label":r,"aria-pressed":e,className:"inline-flex shrink-0 cursor-default items-center justify-center bg-transparent overflow-visible border-none p-0",style:{marginLeft:16,marginRight:0,cursor:e?"default":"pointer"},onClick:o=>{o.stopPropagation(),e||n()},onMouseEnter:o=>{e||(o.currentTarget.style.opacity="0.85")},onMouseLeave:o=>{o.currentTarget.style.opacity="1"},children:s.jsx("img",{src:`${$e}/icons/${l}`,alt:"",width:16,height:16,className:"pointer-events-none object-contain select-none",draggable:!1})})}function wx(e,n){return`${e}::${n}`}function zM(){const[e,n]=x.useState([]),[r,l]=x.useState(null),[o,u]=x.useState(!0),c=x.useCallback(async()=>{u(!0);try{const[f,h]=await Promise.all([jf(),WT()]);n(f),l(h?wx(h.provider,h.model):null)}finally{u(!1)}},[]);return x.useEffect(()=>{c()},[c]),x.useEffect(()=>{const f=()=>{c()};return window.addEventListener(nl,f),()=>{window.removeEventListener(nl,f)}},[c]),{models:e,defaultKey:r,loading:o,refresh:c}}function kx(e,n){return wx(e,n)}function OM({models:e,defaultKey:n,onSelect:r,onEdit:l,onDelete:o,onAdd:u}){const c=e.length+1,f=h=>{const m=h===0,y=h===c-1;return m&&y?{borderRadius:8}:m?{borderRadius:"8px 8px 0 0"}:y?{borderRadius:"0 0 8px 8px"}:{borderRadius:0}};return s.jsxs("div",{style:{background:"#ffffff",width:"100%"},children:[e.map((h,m)=>s.jsx("div",{style:{marginBottom:1},children:s.jsx(DM,{model:h,isDefault:n===kx(h.provider,h.value),onSelect:()=>r(h),onEdit:()=>l(h),onDelete:()=>o(h),rowRadiusStyle:f(m)})},kx(h.provider,h.value))),s.jsx(BM,{rowRadiusStyle:f(e.length),onClick:u})]})}function BM({rowRadiusStyle:e,onClick:n}){const[r,l]=x.useState(!1),[o,u]=x.useState(!1),c=o?"#e0e0e0":r?"#eaeaea":"#f6f6f6";return s.jsxs("button",{type:"button",onClick:n,className:"inline-flex min-w-0 w-full cursor-default border-none transition-colors flex-row flex-nowrap items-center justify-center box-border",style:{...e,height:60,background:c,color:"var(--model-text-primary)"},onMouseEnter:()=>l(!0),onMouseLeave:()=>{l(!1),u(!1)},onMouseDown:()=>u(!0),onMouseUp:()=>u(!1),children:[s.jsx("img",{src:`${$e}/icons/list-add-symbolic.svg`,alt:"",width:16,height:16,className:"shrink-0 object-contain pointer-events-none select-none",draggable:!1}),s.jsx("span",{className:"shrink-0",style:{marginLeft:8,fontFamily:"var(--model-add-font-family)",fontSize:"var(--model-font-size)",color:"var(--model-text-primary)"},children:"添加"})]})}const Pf={position:"fixed",top:0,left:0,width:"100vw",height:"100vh",display:"flex",alignItems:"center",justifyContent:"center",zIndex:200,transform:"translate(-28px, -40px)"},FM={...Pf,zIndex:300},$f="'Noto Sans CJK SC', 'Source Han Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif",IM=36,UM=16;function HM(){return typeof window>"u"?!1:new URLSearchParams(window.location.search).get("providerDropdownSafeMode")==="1"}function qM({value:e,onChange:n,disabled:r}){const[l,o]=x.useState(!1),[u,c]=x.useState({}),f=x.useRef(null),h=x.useRef(null),m=x.useRef(null),y=_x(e),g=HM(),_=x.useCallback(()=>{if(!g)return;const C=h.current;if(!C)return;const E=C.getBoundingClientRect(),N=4,D=Zl.length*IM+UM,F=window.innerHeight-E.bottom-N,M=E.top-N,U=F<D&&M>=F?Math.max(8,E.top-D-N):E.bottom+N;c({position:"fixed",top:U,left:E.left,width:E.width,zIndex:10100})},[g]),v=x.useCallback(()=>{r||o(C=>(!C&&g&&_(),!C))},[r,g,_]);x.useEffect(()=>{r&&o(!1)},[r]),x.useLayoutEffect(()=>{if(!l||!g)return;_();const C=()=>o(!1);return window.addEventListener("resize",C),window.addEventListener("scroll",C,!0),()=>{window.removeEventListener("resize",C),window.removeEventListener("scroll",C,!0)}},[l,g,_]),x.useEffect(()=>{if(!l)return;const C=N=>{var F,M,A;const D=N.target;(F=m.current)!=null&&F.contains(D)||(M=h.current)!=null&&M.contains(D)||(A=f.current)!=null&&A.contains(D)||o(!1)},E=()=>o(!1);return document.addEventListener("mousedown",C),window.addEventListener("blur",E),()=>{document.removeEventListener("mousedown",C),window.removeEventListener("blur",E)}},[l]);const w=C=>Zl.map(E=>s.jsxs(Af,{selected:E.key===e,reserveCheckmarkSlot:!0,fullWidth:C,onPick:()=>{n(E.key),o(!1)},children:[s.jsx("span",{style:{display:"flex",flexShrink:0,alignItems:"center"},children:s.jsx(qf,{meta:E,bundledIcon:E.iconAsset,size:16})}),s.jsx("span",{className:"min-w-0 flex-1 truncate whitespace-nowrap text-left",style:{marginLeft:8,fontFamily:$f,fontSize:14,fontWeight:400,color:"rgba(0,0,0,0.85)"},children:E.label})]},E.key)),j=s.jsx("div",{ref:m,className:"model-dialog-dropdown model-dialog-provider-dropdown box-border border border-solid",style:{...u,padding:"8px 6px 8px 8px",borderRadius:8,borderColor:"#E5E7EB",background:"#FFFFFF"},onMouseDown:C=>C.stopPropagation(),children:s.jsx("div",{role:"listbox",className:"flex w-full flex-col",style:{width:"100%"},onMouseDown:C=>C.stopPropagation(),children:w(!0)})}),T=s.jsx("div",{ref:m,className:"model-dialog-dropdown model-dialog-provider-dropdown absolute left-0 z-[120] box-border flex flex-col overflow-hidden border border-solid",style:{top:"calc(100% - 36px)",width:328,height:274,padding:"8px 6px 8px 8px",borderRadius:8,borderColor:"#E5E7EB",background:"#FFFFFF"},children:s.jsx("div",{className:"model-dialog-scrollbar min-h-0 flex-1 overscroll-contain",role:"listbox",onMouseDown:C=>C.stopPropagation(),children:w(!1)})});return s.jsxs("div",{ref:f,className:"relative w-full",style:{fontFamily:$f},children:[s.jsxs("button",{ref:h,type:"button",disabled:r,onClick:v,"aria-expanded":l,"aria-haspopup":"listbox",className:"w-full box-border cursor-default border-none outline-none transition-colors",style:{height:36,padding:8,borderRadius:6,background:"#E6E6E6",color:"rgba(0, 0, 0, 0.85)",opacity:r?.6:1,display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",justifyContent:"space-between",columnGap:8,boxSizing:"border-box"},children:[s.jsxs("span",{className:"min-w-0 flex-1",style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",marginRight:"auto"},children:[s.jsx(qf,{meta:y,bundledIcon:y.iconAsset,size:16}),s.jsx("span",{className:"min-w-0 truncate whitespace-nowrap",style:{fontFamily:$f,fontSize:14,fontWeight:400,marginLeft:8,flexShrink:1,minWidth:0},children:y.label})]}),s.jsx("span",{style:{display:"flex",flexShrink:0,alignItems:"center",justifyContent:"center",height:20,lineHeight:0},children:s.jsx("img",{src:`${$e}/icons/${l?"ukui-up-symbolic.svg":"ukui-down-symbolic.svg"}`,alt:"",width:16,height:16,className:"object-contain",draggable:!1,style:{opacity:r?.35:1,display:"block"}})})]}),l&&!r&&(g?Dl.createPortal(j,document.body):T)]})}function PM(e){return e.length>0&&e.trim().length===0}const Yf="rgba(0,0,0,0.35)",Ea="'Noto Sans CJK SC', 'Source Han Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif",Sx="rgba(0, 0, 0, 0.1)",Cx="rgba(0, 0, 0, 0.15)",$M="rgba(0, 0, 0, 0.2)",jx="#3790FA",Ex="#3489ee",YM="#2c73c8",GM="元 / 百万Tokens",$a="rgba(0, 0, 0, 0.85)",Nx=6;function KM(e,n){const r=!!e.focused,l=!!(e.hovered&&!r);return{boxSizing:"border-box",borderRadius:6,border:r?"2px solid #3790FA":"1px solid transparent",background:r?"#FFFFFF":l?"#DCDCDC":"#E6E6E6",outline:"none",color:$a,...n}}function fc({value:e,onChange:n,placeholder:r,type:l="text",inputMode:o,id:u,autoComplete:c,color:f=$a,paddingRight:h=8,width:m="100%",style:y}){const[g,_]=x.useState(!1),[v,w]=x.useState(!1),j=8;return s.jsx("input",{id:u,type:l,inputMode:o,value:e,onChange:n,placeholder:r,autoComplete:c,onFocus:()=>_(!0),onBlur:()=>_(!1),onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),style:{...KM({focused:g,hovered:v}),width:m,height:36,paddingLeft:g?j-1:j,paddingRight:g?h-1:h,fontFamily:Ea,fontSize:14,fontWeight:400,color:f,...y}})}function VM(e){const n=e.replace(/[^\d.]/g,""),r=n.indexOf(".");if(r===-1)return n;const l=n.slice(0,r+1),o=n.slice(r+1).replace(/\./g,"");return l+o}function Tx(e){const n=e.trim();if(n.length===0)return null;const r=Number(n);return!Number.isFinite(r)||r<0?null:r}function QM(e,n){const r=e.trim(),l=n.trim();if(r.length===0&&l.length===0)return{ok:!0,value:null};const o=Tx(e),u=Tx(n);return r.length>0&&o===null?{ok:!1,message:"模型输入 Tokens 单价需为非负数字"}:l.length>0&&u===null?{ok:!1,message:"模型输出 Tokens 单价需为非负数字"}:{ok:!0,value:{input:o!=null?o:0,output:u!=null?u:0}}}function Ax(e){if(typeof e=="number"&&Number.isFinite(e))return e>=0?e:null;if(typeof e=="string"){const n=e.trim();if(n.length===0)return null;const r=Number(n);return!Number.isFinite(r)||r<0?null:r}return null}function WM(e){const n=e.match(/(?:^|[\s,{])input\s*=\s*([0-9]+(?:\.[0-9]+)?)/),r=e.match(/(?:^|[\s,{])output\s*=\s*([0-9]+(?:\.[0-9]+)?)/);if(!n&&!r)return null;const l=n?Number(n[1]):0,o=r?Number(r[1]):0;return l===0&&o===0?null:{input:l,output:o}}function XM(e){var o,u;if(e==null)return null;let n=null;if(typeof e=="object"&&!Array.isArray(e))n=e;else if(typeof e=="string"){const c=e.trim();if(c.length===0||c==="<unset>")return null;try{const f=JSON.parse(c);f&&typeof f=="object"&&!Array.isArray(f)&&(n=f)}catch{return WM(c)}}if(!n)return null;const r=(o=Ax(n.input))!=null?o:0,l=(u=Ax(n.output))!=null?u:0;return r===0&&l===0?null:{input:r,output:l}}function JM({open:e,mode:n,onCancel:r,onSubmit:l,keyboardShortcuts:o=!0,interactionLocked:u=!1}){var Re;const c=(n==null?void 0:n.kind)==="edit",f=(Re=n==null?void 0:n.kind)!=null?Re:null,h=(n==null?void 0:n.kind)==="edit"?`${n.original.provider}\0${n.original.value}`:null,[m,y]=x.useState(vx),[g,_]=x.useState(""),[v,w]=x.useState(""),[j,T]=x.useState(""),[C,E]=x.useState(!1),[N,D]=x.useState(null),[F,M]=x.useState(!1),[A,U]=x.useState(!1),[I,L]=x.useState(""),[B,q]=x.useState(""),[K,G]=x.useState(null),[ne,V]=x.useState(null),[le,me]=x.useState(!1),[ce,O]=x.useState(!1),[H,Z]=x.useState(!1),z=x.useRef(null),oe=x.useRef(null),ue=x.useRef(h),ve=x.useCallback(async()=>{me(!0),O(!1),V(null);try{const de=await K4("ollama");de.live&&de.models.length>0?V(de.models):O(!0)}catch{O(!0)}finally{me(!1)}},[]);x.useEffect(()=>{var de,Ve;if(!(!e||!n)){if(n.kind==="add")y(vx),_(""),w(""),T(""),L(""),q(""),G(null),U(!1),V(null),O(!1);else{const{meta:lt,baseUrl:bt}=Hf(n.original.provider),it=n.original.value,St=(de=n.original.apiKey)!=null?de:"",Ie=(Ve=bt!=null?bt:n.original.baseUrl)!=null?Ve:"";y(lt.key),_(it),w(St),T(Ie),L(""),q(""),G({modelName:it.trim(),apiKey:St.trim(),baseUrl:Ie.trim(),pricingInput:"",pricingOutput:""}),U(!1),lt.key==="ollama"&&ve();const cn=n.original.provider,Kt=h;(async()=>{try{const wr=await Ki(`providers.models.${cn}.pricing`);if(Kt!==ue.current)return;const zn=XM(wr.value);if(zn){const Xn=String(zn.input),Jn=String(zn.output);L(Xn),q(Jn),G(Et=>Et&&{...Et,pricingInput:Xn,pricingOutput:Jn})}}catch{}})()}E(!1),D(null),M(!1),Z(!1)}},[e,f,h,ve]),x.useEffect(()=>{ue.current=h},[h]),x.useEffect(()=>{m!=="ollama"||!e||!n||!ne&&!ce&&!le&&ve()},[m,e,n,ne,ce,le,ve]),x.useEffect(()=>{if(!H)return;const de=Ve=>{const lt=Ve.target;z.current&&!z.current.contains(lt)&&Z(!1)};return document.addEventListener("mousedown",de),()=>document.removeEventListener("mousedown",de)},[H]),x.useEffect(()=>{if(!e||!n)return;const de=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=de}},[e,n]);const Se=_x(m),Te=Se.isCustom,re=m==="ollama",ke=Te||re,Ze=g.trim(),Fe=j.trim(),Mt=Ze.length>0&&!PM(g),vt=!ke||Fe.length>0,hn=!ke||Fe.length===0||/^https?:\/\//i.test(Fe),Yt=ke&&Fe.length>0&&!hn,Ma=re&&ce,Ln=x.useMemo(()=>!c||!K||Ze!==K.modelName||v.trim()!==K.apiKey||Fe!==K.baseUrl||!re&&(I.trim()!==K.pricingInput.trim()||B.trim()!==K.pricingOutput.trim()),[c,K,Ze,v,Fe,I,B,re]),Rt=Mt&&vt&&hn&&!F&&!Ma&&Ln,bn=376,Wn=x.useMemo(()=>re?"选填":"选填（云端服务必填）",[re]),sn=x.useMemo(()=>re?"请求地址":"请求地址（OpenAI 兼容）",[re]),ya=x.useMemo(()=>Te?"必填（例如：https://api.example.com/v1）":"必填（例如：http://localhost:11434）",[Te]),tt=async()=>{if(!Rt||!n||(D(null),ke&&Fe.length>0&&!/^https?:\/\//i.test(Fe)))return;const de=QM(I,B);if(!de.ok){D(de.message);return}const Ve=Te?`custom:${Fe}`:Se.storageProvider;M(!0);try{await l({provider:m,storageProvider:Ve,modelName:Ze,apiKey:v.trim(),baseUrl:Fe,label:Ze,pricing:de.value!==null?de.value:c?null:void 0})===!1&&M(!1)}catch(lt){D(lt instanceof Error?lt.message:String(lt)),M(!1)}},xn=x.useMemo(()=>c?"确定":"添加",[c]),te=c?"编辑模型":"添加模型";x.useEffect(()=>{if(!e||!n||!o)return;const de=Ve=>{if(Ve.key==="Escape"){Ve.stopPropagation(),r();return}if(Ve.key==="Enter"&&Rt){const lt=Ve.target;if((lt==null?void 0:lt.tagName)==="TEXTAREA")return;Ve.preventDefault(),tt()}};return window.addEventListener("keydown",de),()=>window.removeEventListener("keydown",de)},[e,n,o,r,Rt,tt]);const pe=de=>{c||de!==m&&(y(de),D(null),_(""),w(""),T(""),L(""),q(""),U(!1),E(!1),Z(!1))},je=de=>{_(de),Z(!1)};return!n||!e?null:s.jsx("div",{role:"dialog","aria-modal":"true","aria-label":te,style:{...Pf,pointerEvents:u?"none":void 0},children:s.jsxs("div",{ref:oe,style:{width:bn,maxHeight:"85vh",background:"#fff",borderRadius:8,boxSizing:"border-box",display:"flex",flexDirection:"column",overflow:"hidden",boxShadow:"0 6px 30px rgba(0, 0, 0, 0.12)",fontFamily:Ea,fontSize:14,fontWeight:400},onClick:de=>de.stopPropagation(),children:[s.jsxs("div",{style:{height:40,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:12,paddingRight:8,boxSizing:"border-box"},children:[s.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",alignSelf:"stretch",flex:"1 1 auto",minWidth:0,lineHeight:0},children:[s.jsx("span",{style:{display:"inline-flex",flexShrink:0,alignItems:"center",justifyContent:"center",alignSelf:"center"},children:s.jsx("img",{src:`${$e}/icons/logo.png`,alt:"",width:24,height:24,style:{width:24,height:24,objectFit:"contain",display:"block"},onError:de=>{de.currentTarget.style.display="none"}})}),s.jsx("span",{style:{display:"inline-flex",alignItems:"center",alignSelf:"center",marginLeft:8,lineHeight:"20px",fontSize:14,color:$a},children:te})]}),s.jsx("div",{style:{display:"inline-flex"},children:s.jsx(br,{onClick:r})})]}),s.jsx("div",{className:"model-dialog-scrollbar",style:{flex:1,minHeight:0,maxHeight:A&&!re?520:void 0,overflowY:A&&!re?"overlay":"visible",marginRight:Nx,paddingLeft:24,paddingRight:24,boxSizing:"border-box"},children:s.jsxs("div",{className:"flex flex-col [&_input::placeholder]:text-[rgb(0_0_0_/_0.35)]",children:[s.jsx("div",{style:{marginTop:8,marginBottom:4},children:s.jsx(hc,{label:"模型提供商",children:s.jsx(qM,{value:m,onChange:pe,disabled:c})})}),s.jsx("div",{style:{marginTop:18,marginBottom:4},children:s.jsx(hc,{label:"模型名称",children:re&&ne&&ne.length>0?s.jsxs("div",{ref:z,className:"relative w-full",style:{fontFamily:Ea},children:[s.jsxs("button",{type:"button",onClick:()=>Z(de=>!de),className:"box-border w-full border-none outline-none",style:{height:36,padding:8,borderRadius:6,background:"#E6E6E6",display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",justifyContent:"space-between",columnGap:8,cursor:"default",color:g.trim()?$a:Yf},children:[s.jsx("span",{className:"min-w-0 flex-1 truncate text-left",style:{fontSize:14,fontWeight:400},children:g.trim()?g:"请选择本地模型"}),s.jsx("span",{style:{display:"flex",flexShrink:0,alignItems:"center",justifyContent:"center",height:20,lineHeight:0},children:s.jsx("img",{src:`${$e}/icons/${H?"ukui-up-symbolic.svg":"ukui-down-symbolic.svg"}`,alt:"",width:16,height:16,className:"object-contain",draggable:!1,style:{display:"block"}})})]}),H&&s.jsx("div",{className:"model-dialog-dropdown absolute left-0 z-[120] box-border flex flex-col overflow-hidden",style:{top:"calc(100% - 36px)",width:328,maxHeight:274,padding:"8px 6px 8px 8px",borderRadius:8,border:"1px solid #E5E7EB",background:"#FFFFFF"},children:s.jsx("div",{role:"listbox",className:"model-dialog-scrollbar overscroll-contain",style:{maxHeight:258},onMouseDown:de=>de.stopPropagation(),children:ne.map(de=>s.jsx(Af,{selected:de===g,onPick:()=>je(de),children:s.jsx("span",{className:"min-w-0 flex-1 truncate text-left",children:de})},de))})})]}):re&&le?s.jsx("div",{style:{height:36,paddingLeft:8,paddingRight:8,borderRadius:6,background:"#E6E6E6",color:Yf,display:"flex",alignItems:"center",fontSize:14,fontWeight:400,boxSizing:"border-box"},children:"加载中…"}):re&&ce?s.jsx("div",{style:{height:36,paddingLeft:8,paddingRight:8,borderRadius:6,background:"#E6E6E6",color:Yf,display:"flex",alignItems:"center",fontSize:14,fontWeight:400,boxSizing:"border-box",pointerEvents:"none",userSelect:"none"},children:"无可用本地模型"}):s.jsx(fc,{value:g,onChange:de=>_(de.target.value),placeholder:"必填（例如：deepseek-v3.2）"})})}),s.jsx("div",{style:{marginTop:18,marginBottom:4},children:s.jsx(hc,{label:"APIKey",children:s.jsxs("div",{style:{position:"relative",height:36},children:[s.jsx(fc,{type:C?"text":"password",value:v,onChange:de=>w(de.target.value),placeholder:Wn,paddingRight:40,color:C?$a:"#000000",autoComplete:"off"}),s.jsx("button",{type:"button",onClick:()=>E(de=>!de),"aria-label":C?"隐藏 API Key":"显示 API Key",style:{position:"absolute",right:8,top:0,bottom:0,width:24,background:"transparent",border:"none",padding:0,margin:0,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s.jsx("img",{src:`${$e}/icons/${C?"ukui-eye-display-symbolic.svg":"ukui-eye-hidden-symbolic.svg"}`,alt:"",width:16,height:16,draggable:!1,style:{display:"block"}})})]})})}),ke&&s.jsxs("div",{style:{marginTop:18,marginBottom:4},children:[s.jsx(hc,{label:sn,children:s.jsx(fc,{value:j,onChange:de=>T(de.target.value),placeholder:ya})}),Yt?s.jsx("div",{style:{marginTop:4,fontSize:12,fontWeight:400,color:"#F53F3F",fontFamily:Ea,lineHeight:"16px"},children:"请求地址需以 http:// 或 https:// 开头"}):null]}),!re&&s.jsxs("div",{style:{marginTop:18},children:[s.jsxs("button",{type:"button",className:"model-dialog-advanced-toggle border-none bg-transparent p-0 outline-none",style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:8,cursor:"pointer",fontFamily:Ea,fontSize:14,fontWeight:400},onClick:()=>U(de=>!de),children:[s.jsx("span",{className:"text-left",children:"高级设置（可配置模型用量统计）"}),s.jsx("span",{style:{display:"inline-flex",flexShrink:0,lineHeight:0},children:A?s.jsx(ks,{size:16,strokeWidth:2,"aria-hidden":!0}):s.jsx(ha,{size:16,strokeWidth:2,"aria-hidden":!0})})]}),A?s.jsxs("div",{style:{marginTop:16,display:"flex",flexDirection:"column",gap:16},children:[s.jsx(Mx,{label:"模型输入 Tokens 单价",value:I,onChange:L}),s.jsx(Mx,{label:"模型输出 Tokens 单价",value:B,onChange:q,labelMarginTop:4})]}):null]}),N&&s.jsx("div",{style:{color:"#F53F3F",marginTop:8,fontSize:12,fontFamily:Ea},children:N})]})}),s.jsx("div",{style:{flexShrink:0,marginRight:Nx,paddingLeft:24,paddingRight:24,paddingBottom:24,paddingTop:32,boxSizing:"border-box"},children:s.jsxs("div",{style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",justifyContent:"flex-end",alignItems:"center",boxSizing:"border-box"},children:[s.jsx("button",{type:"button",onClick:r,style:{height:36,paddingLeft:16,paddingRight:16,borderRadius:6,background:Sx,color:$a,border:"none",cursor:"pointer",fontFamily:Ea,fontSize:14,fontWeight:400,boxSizing:"border-box"},onMouseEnter:de=>{de.currentTarget.style.background=Cx},onMouseLeave:de=>{de.currentTarget.style.background=Sx},onMouseDown:de=>{de.currentTarget.style.background=$M},onMouseUp:de=>{de.currentTarget.style.background=Cx},children:"取消"}),s.jsx("button",{type:"button",disabled:!Rt,onClick:()=>void tt(),style:{marginLeft:8,height:36,paddingLeft:16,paddingRight:16,borderRadius:6,background:Rt?jx:"rgba(55, 144, 250, 0.45)",color:"#FFFFFF",border:"none",cursor:Rt?"pointer":"not-allowed",fontFamily:Ea,fontSize:14,fontWeight:400,boxSizing:"border-box"},onMouseEnter:de=>{Rt&&(de.currentTarget.style.background=Ex)},onMouseLeave:de=>{Rt&&(de.currentTarget.style.background=jx)},onMouseDown:de=>{Rt&&(de.currentTarget.style.background=YM)},onMouseUp:de=>{Rt&&(de.currentTarget.style.background=Ex)},children:xn})]})})]})})}function hc({label:e,children:n}){return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0,fontFamily:Ea},children:[s.jsx("label",{style:{fontSize:14,fontWeight:400,color:$a,marginBottom:4},children:e}),n]})}function Mx({label:e,value:n,onChange:r,labelMarginTop:l}){const o=x.useId();return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0,fontFamily:Ea},children:[s.jsx("label",{htmlFor:o,style:{fontSize:14,fontWeight:400,color:$a,marginBottom:4,...l!=null?{marginTop:l}:{}},children:e}),s.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"},children:[s.jsx(fc,{id:o,inputMode:"decimal",placeholder:"选填",value:n,onChange:u=>r(VM(u.target.value)),width:204,style:{maxWidth:"100%",flexShrink:0}}),s.jsx("span",{style:{flexShrink:0,marginLeft:24,whiteSpace:"nowrap",fontSize:14,fontWeight:400,color:$a},children:GM})]})]})}function ZM({open:e,ariaLabel:n,message:r,confirmLabel:l,iconSrc:o,onCancel:u,onConfirm:c,dialogHeight:f}){const[h,m]=x.useState(!1);x.useEffect(()=>{if(!e)return;const _=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=_}},[e]);const y=x.useCallback(async()=>{if(!h){m(!0);try{await c()}finally{m(!1)}}},[h,c]);if(x.useEffect(()=>{if(!e)return;const _=v=>{v.key==="Escape"&&(v.stopPropagation(),u()),v.key==="Enter"&&!h&&(v.preventDefault(),v.stopPropagation(),y())};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[e,u,h,y]),!e)return null;const g={width:376,background:"#fff",borderRadius:8,boxSizing:"border-box",display:"flex",flexDirection:"column",overflow:"hidden",boxShadow:"0 6px 30px rgba(0, 0, 0, 0.12)",...f!==void 0?{height:f}:{minHeight:172}};return s.jsx("div",{role:"dialog","aria-modal":"true","aria-label":n,style:Pf,children:s.jsxs("div",{style:g,onClick:_=>_.stopPropagation(),children:[s.jsx("div",{style:{width:376,height:40,display:"flex",alignItems:"center",justifyContent:"flex-end",paddingRight:8,boxSizing:"border-box",flexShrink:0},children:s.jsx(br,{onClick:u})}),s.jsxs("div",{style:{paddingLeft:24,paddingRight:24,paddingBottom:24,flex:1,display:"flex",flexDirection:"column"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"flex-start",paddingTop:2},children:[s.jsx("img",{src:`${$e}/${o.replace(/^\//,"")}`,alt:"",width:16,height:16,style:{flexShrink:0,marginTop:2,display:"block"}}),s.jsx("span",{style:{width:8,flexShrink:0},"aria-hidden":!0}),s.jsx("p",{className:"text-sm leading-relaxed min-w-0",style:{color:"rgba(0, 0, 0, 0.55)"},children:r})]}),s.jsx("div",{style:{flex:1}}),s.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:16},children:[s.jsx("button",{type:"button",onClick:u,className:"skill-dialog-cancel-btn",children:"取消"}),s.jsx("span",{style:{width:8,flexShrink:0},"aria-hidden":!0}),s.jsx("button",{type:"button",disabled:h,onClick:()=>void y(),className:"skill-dialog-uninstall-btn",children:l})]})]})]})})}function e9({open:e,onCancel:n,onConfirm:r}){return s.jsx(ZM,{open:e,ariaLabel:"删除后将无法恢复，是否确认删除该模型？",dialogHeight:172,message:"删除后将无法恢复，是否确认删除该模型？",confirmLabel:"删除",iconSrc:"icons/dialog-question.svg",onCancel:n,onConfirm:r})}const Gf="…",mc="当前模型列表中已存在“",Rx="”模型提供商，是否进行覆盖？",Dx="”请求地址，是否进行覆盖？",Kf=4,t9=42;function n9(e){let n=0;for(let r=0;r<e.length;r++){const l=e.codePointAt(r);l>65535&&r++,n+=l<=127?.56:1}return n}function Vf(e){return n9(e)<=t9}function a9(e,n){const r=e==="preset"?Rx:Dx,l=n.trim();if(l.length===0)return"";const o=`${mc}${l}${r}`;if(Vf(o))return l;let u=Kf,c=l.length,f=Kf;for(;u<=c;){const y=u+c>>1,g=y>=l.length?l:`${l.slice(0,y)}${Gf}`;Vf(`${mc}${g}${r}`)?(f=y,u=y+1):c=y-1}if(f>=l.length)return l;let h=f,m=`${l.slice(0,h)}${Gf}`;for(;h>Kf&&!Vf(`${mc}${m}${r}`);)h--,m=`${l.slice(0,h)}${Gf}`;return m}function r9(e,n){const r=e==="preset"?Rx:Dx,l=a9(e,n);return{prefix:mc,inner:l,suffix:r}}const Lx="确定覆盖现有模型？";function l9({open:e,isCustom:n,quotedInner:r,onClose:l,onConfirm:o}){const[u,c]=x.useState(!1),f=x.useMemo(()=>r9(n?"custom":"preset",r),[n,r]),h=x.useMemo(()=>({fontSize:14,color:"var(--pc-text-muted)",lineHeight:"20px",marginLeft:24,wordBreak:"break-word",overflowWrap:"anywhere"}),[]);x.useEffect(()=>{if(!e){c(!1);return}const g=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=g}},[e]);const m=x.useCallback(async()=>{if(!u){c(!0);try{await o()}finally{c(!1)}}},[u,o]);if(x.useEffect(()=>{if(!e)return;const g=_=>{_.key==="Escape"&&(_.stopPropagation(),l()),_.key==="Enter"&&!u&&(_.preventDefault(),_.stopPropagation(),m())};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[e,l,u,m]),!e)return null;const y={width:376,height:212,background:"#fff",borderRadius:8,boxSizing:"border-box",display:"flex",flexDirection:"column",overflow:"hidden",boxShadow:"0 6px 30px rgba(0, 0, 0, 0.12)"};return s.jsx("div",{role:"dialog","aria-modal":"true","aria-label":Lx,style:FM,children:s.jsxs("div",{style:y,onClick:g=>g.stopPropagation(),children:[s.jsx("div",{style:{width:376,height:40,display:"flex",alignItems:"center",justifyContent:"flex-end",paddingRight:8,boxSizing:"border-box",flexShrink:0},children:s.jsx(br,{onClick:l})}),s.jsxs("div",{style:{paddingLeft:24,paddingRight:24,paddingBottom:24,flex:1,display:"flex",flexDirection:"column",minHeight:0},children:[s.jsxs("div",{style:{display:"flex",alignItems:"flex-start",marginBottom:4},children:[s.jsx("img",{src:`${$e}/icons/dialog-question.svg`,alt:"",width:16,height:16,style:{flexShrink:0,marginTop:2,display:"block"}}),s.jsx("span",{style:{width:8,flexShrink:0},"aria-hidden":!0}),s.jsx("span",{style:{fontSize:14,color:"var(--pc-text-primary)",lineHeight:"20px",minWidth:0},children:Lx})]}),s.jsxs("span",{style:h,children:[s.jsx("span",{children:f.prefix}),s.jsx("span",{style:{wordBreak:"break-all"},children:f.inner}),s.jsx("span",{children:f.suffix})]}),s.jsx("div",{style:{flex:1}}),s.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center"},children:[s.jsx("button",{type:"button",onClick:g=>{g.stopPropagation(),l()},className:"skill-dialog-cancel-btn",children:"取消"}),s.jsx("span",{style:{width:8,flexShrink:0},"aria-hidden":!0}),s.jsx("button",{type:"button",disabled:u,className:"skill-dialog-uninstall-btn",onClick:()=>void m(),children:u?"覆盖中…":"覆盖"})]})]})]})})}function i9(e,n){return Object.values(e.by_model).filter(r=>n.has(r.model))}function o9(e,n){const r=i9(e,n);return{models:r,request_count:r.reduce((l,o)=>l+o.request_count,0),total_tokens:r.reduce((l,o)=>l+o.total_tokens,0)}}function mo(e){return Number.isFinite(e)?`¥${e.toFixed(4)}`:"¥0.0000"}function po(e){return Number.isFinite(e)?Math.trunc(e).toLocaleString("zh-CN"):"0"}function s9(e){return Number.isFinite(e)?`${Math.round(e)}%`:"0%"}const sl="var(--model-text-primary)",pc="#F6F6F6",c9="#E6E6E6",u9="#3790FA",d9=242,zx="minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr)",go={fontFamily:"var(--model-font-family)",fontSize:"var(--model-font-size)",color:sl,textAlign:"left"};function f9({modelTagLookup:e}){var T,C,E,N;const[n,r]=x.useState(null),[l,o]=x.useState(null),u=x.useCallback(()=>{zs().then(D=>{r(D),o(null)}).catch(D=>o(D instanceof Error?D.message:String(D)))},[]);if(x.useEffect(()=>{u()},[u]),x.useEffect(()=>{let D;const F=()=>{D!==void 0&&clearTimeout(D),D=window.setTimeout(()=>{D=void 0,u()},400)},M=()=>{document.visibilityState==="visible"&&F()};return window.addEventListener(tl,F),document.addEventListener("visibilitychange",M),()=>{window.removeEventListener(tl,F),document.removeEventListener("visibilitychange",M),D!==void 0&&clearTimeout(D)}},[u]),l)return s.jsxs("div",{className:"rounded-xl border p-3 text-sm",style:{background:"rgba(255, 68, 102, 0.08)",borderColor:"rgba(255, 68, 102, 0.2)",color:"var(--color-status-error)"},children:["加载用量统计失败：",l]});const c=n?o9(n,e):{models:[],request_count:0,total_tokens:0},f=c.request_count,h=c.total_tokens,m=f>0?Math.floor(h/f):0,y=h>0?((T=n==null?void 0:n.monthly_cost_usd)!=null?T:0)/h*1e3:0,g=[{label:"会话成本",value:mo((C=n==null?void 0:n.session_cost_usd)!=null?C:0)},{label:"每日成本",value:mo((E=n==null?void 0:n.daily_cost_usd)!=null?E:0)},{label:"每月成本",value:mo((N=n==null?void 0:n.monthly_cost_usd)!=null?N:0)},{label:"总请求数",value:po(f)}],_=[{label:"总Tokens",value:po(h)},{label:"平均 Token/请求",value:po(m)},{label:"每 1K Token 成本",value:mo(y)}],v=[...c.models];v.sort((D,F)=>F.cost_usd-D.cost_usd);const w=v.reduce((D,F)=>D+F.request_count,0),j=v.length>0;return s.jsxs("div",{className:"flex flex-col min-w-0 box-border w-full",style:{gap:0},children:[s.jsx("h3",{className:"model-section-title",children:"用量统计"}),s.jsx("div",{className:"flex min-w-0 flex-nowrap",style:{gap:8,width:"100%",justifyContent:"space-between",marginBottom:8},children:g.map(D=>s.jsx(h9,{label:D.label,value:D.value},D.label))}),s.jsxs("div",{className:"flex min-h-0 min-w-0 shrink-0 flex-col box-border",style:{width:"100%",boxSizing:"border-box",paddingLeft:16,paddingRight:16,paddingTop:16,paddingBottom:16,marginBottom:8,background:pc,borderRadius:6,gap:0},children:[s.jsx("div",{style:{flexShrink:0,marginBottom:8,fontFamily:"var(--model-font-family)",fontSize:"var(--model-font-size)",color:sl,fontWeight:"normal",lineHeight:1},children:"Token 统计"}),s.jsx("div",{className:"grid min-h-0 min-w-0 shrink-0 w-full",style:{gridTemplateColumns:"repeat(3, minmax(0, 1fr))",columnGap:8,alignItems:"stretch"},children:_.map(D=>s.jsxs("div",{className:"flex min-h-0 min-w-0 flex-col justify-between box-border",style:{height:60,minHeight:0,flexShrink:0,boxSizing:"border-box",padding:8,background:"#FFFFFF",borderRadius:6},children:[s.jsx("span",{style:{fontFamily:"var(--model-font-family)",fontSize:"var(--model-font-size)",color:sl,lineHeight:"20px"},children:D.label}),s.jsx("span",{style:{fontFamily:"var(--model-font-family)",fontSize:"var(--model-font-size)",fontWeight:"bold",color:sl,lineHeight:"20px"},children:D.value})]},D.label))})]}),s.jsxs("div",{className:"flex min-w-0 shrink-0 flex-col box-border",style:{width:"100%",background:"#ffffff"},children:[s.jsx("div",{style:{marginBottom:j?1:0},children:s.jsx("div",{className:"grid min-w-0 items-center",style:{height:36,boxSizing:"border-box",paddingLeft:16,paddingRight:16,background:pc,borderRadius:j?"6px 6px 0 0":6,gridTemplateColumns:zx,alignItems:"center"},children:["模型名称","成本","Token","请求次数","占比"].map(D=>s.jsx("span",{style:go,children:D},D))})}),v.map((D,F)=>{var I;const M=e.get(D.model),A=w>0?D.request_count/w*100:0,U=F===v.length-1;return s.jsx("div",{style:{marginBottom:U?0:1},children:s.jsxs("div",{className:"grid min-w-0 items-center",style:{height:36,boxSizing:"border-box",paddingLeft:16,paddingRight:16,background:pc,gridTemplateColumns:zx,borderRadius:U?"0 0 6px 6px":0},children:[s.jsx(dc,{className:"min-w-0",text:(I=M==null?void 0:M.displayLabel)!=null?I:D.model,style:go}),s.jsx("span",{style:go,children:mo(D.cost_usd)}),s.jsx("span",{style:go,children:po(D.total_tokens)}),s.jsx("span",{style:go,children:po(D.request_count)}),s.jsx(m9,{share:A})]})},D.model)})]})]})}function h9({label:e,value:n}){return s.jsxs("div",{className:"flex flex-col box-border justify-between min-w-0",style:{flex:"1 1 0%",maxWidth:d9,height:80,padding:16,background:pc,borderRadius:6},children:[s.jsx("span",{style:{fontFamily:"var(--model-font-family)",fontSize:"var(--model-font-size)",color:sl},children:e}),s.jsx("span",{style:{fontFamily:"var(--model-font-family)",fontSize:"var(--model-font-size)",fontWeight:"bold",color:sl},children:n})]})}function m9({share:e}){const n=Math.max(Math.min(e,100),0);return s.jsxs("div",{className:"flex min-w-0 items-center",style:{gap:8,justifyContent:"flex-start"},children:[s.jsx("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden",style:{height:6,borderRadius:3,background:c9},children:s.jsx("div",{style:{height:"100%",width:`${n}%`,background:u9,borderRadius:3,transition:"width 0.5s ease"}})}),s.jsx("span",{className:"flex-shrink-0 whitespace-nowrap",style:{fontFamily:"var(--model-font-family)",fontSize:"var(--model-font-size)",color:sl},children:s9(e)})]})}const p9={kind:"add"};function g9(){var F,M;const{models:e,defaultKey:n,loading:r,refresh:l}=zM(),[o,u]=x.useState({kind:"idle"}),[c,f]=x.useState(null),h=x.useMemo(()=>o.kind==="add"?p9:o.kind==="edit"?{kind:"edit",original:o.original}:null,[o]),m=x.useMemo(()=>{const A=new Map;for(const U of e)A.set(U.value,{displayLabel:U.label||U.value,providerKey:U.provider});return A},[e]),y=x.useCallback(()=>{f(null),u({kind:"idle"})},[]),g=x.useCallback(()=>{f(null)},[]),_=()=>u({kind:"add"}),v=A=>u({kind:"edit",original:A}),w=A=>u({kind:"delete",target:A}),j=async A=>{try{await C0({provider:A.provider,model:A.value})}catch(U){console.error("[Model] failed to set default",U)}},T=async(A,U)=>{var B;const L={provider:A.storageProvider.startsWith("custom:")?"custom":A.storageProvider,model:A.modelName,apiKey:A.apiKey||void 0,baseUrl:A.baseUrl||void 0,label:A.label,pricing:A.pricing,replacedModel:U==null?void 0:U.replacedModel,configuredAfter:(B=U==null?void 0:U.configuredAfter)!=null?B:U!=null&&U.replacedModel?UT(e,A.storageProvider,A.modelName):e};await $T(L)},C=A=>A.startsWith("custom:")?A.slice(7):Hf(A).meta.displayTag,E=async A=>{if(o.kind==="add"){if(e.find(I=>I.provider===A.storageProvider))return f({value:A,providerLabel:C(A.storageProvider)}),!1;await T(A)}else if(o.kind==="edit"){const I={provider:A.storageProvider.startsWith("custom:")?"custom":A.storageProvider,model:A.modelName,apiKey:A.apiKey||void 0,baseUrl:A.baseUrl||void 0,label:A.label,pricing:A.pricing};await YT({provider:o.original.provider,model:o.original.value},{...I,configuredAfter:IT(e,o.original,{storageProvider:A.storageProvider,modelName:A.modelName,label:A.label})})}y(),await l()},N=async()=>{if(!c)return;const A=e.find(U=>U.provider===c.value.storageProvider);await T(c.value,{replacedModel:A==null?void 0:A.value}),f(null),y(),await l()},D=async()=>{if(o.kind!=="delete")return;const A=o.target,U=e.filter(I=>!(I.provider===A.provider&&I.value===A.value));await QT({provider:A.provider,model:A.value,remainingAfterDelete:U}),y(),await l()};return s.jsxs("div",{className:"model-page box-border",style:{marginLeft:24,marginRight:24,marginTop:0},children:[s.jsx("h2",{className:"model-section-title",children:"模型"}),r?s.jsx(Lf,{size:24}):s.jsx(OM,{models:e,defaultKey:n,onSelect:A=>void j(A),onEdit:v,onDelete:w,onAdd:_}),!r&&e.length>0&&s.jsx("div",{style:{marginTop:32},children:s.jsx(f9,{modelTagLookup:m})}),s.jsx(JM,{open:o.kind==="add"||o.kind==="edit",mode:h,onCancel:y,onSubmit:E,keyboardShortcuts:c===null,interactionLocked:c!==null}),s.jsx(l9,{open:c!==null,isCustom:(F=c==null?void 0:c.value.storageProvider.startsWith("custom:"))!=null?F:!1,quotedInner:(M=c==null?void 0:c.providerLabel)!=null?M:"",onClose:g,onConfirm:N}),s.jsx(e9,{open:o.kind==="delete",onCancel:y,onConfirm:D})]})}function y9(e){return e?new Date(e).toLocaleTimeString():new Date().toLocaleTimeString()}function b9(e){switch(e.toLowerCase()){case"error":return{color:"var(--color-status-error)",bg:"rgba(239, 68, 68, 0.06)",border:"rgba(239, 68, 68, 0.2)"};case"warn":case"warning":return{color:"var(--color-status-warning)",bg:"rgba(255, 170, 0, 0.06)",border:"rgba(255, 170, 0, 0.2)"};case"tool_call":case"tool_result":case"tool_call_start":return{color:"#a78bfa",bg:"rgba(167, 139, 250, 0.06)",border:"rgba(167, 139, 250, 0.2)"};case"llm_request":return{color:"#38bdf8",bg:"rgba(56, 189, 248, 0.06)",border:"rgba(56, 189, 248, 0.2)"};case"agent_start":case"agent_end":return{color:"#34d399",bg:"rgba(52, 211, 153, 0.06)",border:"rgba(52, 211, 153, 0.2)"};case"message":case"chat":return{color:"var(--pc-accent)",bg:"var(--pc-accent-glow)",border:"var(--pc-accent-dim)"};case"health":case"status":return{color:"var(--color-status-success)",bg:"rgba(0, 230, 138, 0.06)",border:"rgba(0, 230, 138, 0.2)"};default:return{color:"var(--pc-text-muted)",bg:"var(--pc-hover)",border:"var(--pc-border)"}}}function x9(){const[e,n]=x.useState([]),[r,l]=x.useState(!1),[o,u]=x.useState(!1),[c,f]=x.useState(!0),[h,m]=x.useState(!1),[y,g]=x.useState(new Set),_=x.useRef(null),v=x.useRef(null),w=x.useRef(!1),j=x.useRef(0);x.useEffect(()=>{w.current=r},[r]),x.useEffect(()=>{const F=new B0;return F.onConnect=()=>{u(!0)},F.onError=()=>{u(!1)},F.onEvent=M=>{if(w.current)return;j.current+=1;const A={id:`log-${j.current}`,event:M};n(U=>{const I=[...U,A];return I.length>500?I.slice(-500):I})},F.connect(),v.current=F,()=>{F.disconnect()}},[]),x.useEffect(()=>{c&&_.current&&(_.current.scrollTop=_.current.scrollHeight)},[e,c]);const T=x.useCallback(()=>{if(!_.current)return;const{scrollTop:F,scrollHeight:M,clientHeight:A}=_.current,U=M-F-A<50;f(U)},[]),C=()=>{_.current&&(_.current.scrollTop=_.current.scrollHeight),f(!0)},E=Array.from(new Set(e.map(F=>F.event.type))).sort(),N=F=>{g(M=>{const A=new Set(M);return A.has(F)?A.delete(F):A.add(F),A})},D=y.size===0?e:e.filter(F=>y.has(F.event.type));return s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b animate-fade-in",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg-surface)"},children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(_s,{className:"h-5 w-5",style:{color:"var(--pc-accent)"}}),s.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wider",style:{color:"var(--pc-text-primary)"},children:S("logs.live_logs")}),s.jsxs("span",{className:"text-[10px] font-mono ml-2",style:{color:"var(--pc-text-faint)"},children:[D.length," ",S("logs.events")]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{onClick:()=>l(!r),className:"btn-electric flex items-center gap-1.5 px-3 py-1.5 text-xs font-semibold",style:{background:r?"var(--color-status-success)":"var(--color-status-warning)",color:"white"},children:r?s.jsxs(s.Fragment,{children:[s.jsx(Hg,{className:"h-3.5 w-3.5"})," ",S("logs.resume")]}):s.jsxs(s.Fragment,{children:[s.jsx(dC,{className:"h-3.5 w-3.5"})," ",S("logs.pause")]})}),!c&&s.jsxs("button",{onClick:C,className:"btn-electric flex items-center gap-1.5 px-3 py-1.5 text-xs font-semibold",children:[s.jsx(US,{className:"h-3.5 w-3.5"}),S("logs.jump_to_bottom")]})]})]}),E.length>0&&s.jsxs("div",{className:"flex items-center gap-2 px-6 py-2 border-b overflow-x-auto",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg-base)"},children:[s.jsx(Ug,{className:"h-3.5 w-3.5 flex-shrink-0",style:{color:"var(--pc-text-faint)"}}),s.jsxs("span",{className:"text-[10px] uppercase tracking-wider flex-shrink-0",style:{color:"var(--pc-text-faint)"},children:[S("logs.filter_label"),":"]}),E.map(F=>s.jsxs("label",{className:"flex items-center gap-1.5 flex-shrink-0",children:[s.jsx("input",{type:"checkbox",checked:y.has(F),onChange:()=>N(F),className:"rounded",style:{accentColor:"var(--pc-accent)"}}),s.jsx("span",{className:"text-[10px] capitalize",style:{color:"var(--pc-text-muted)"},children:F})]},F)),y.size>0&&s.jsx("button",{onClick:()=>g(new Set),className:"text-[10px] flex-shrink-0 ml-1 transition-colors",style:{color:"var(--pc-accent)"},children:S("logs.clear")})]}),!h&&s.jsxs("div",{className:"flex items-start gap-3 px-6 py-3 border-b flex-shrink-0",style:{borderColor:"rgba(56, 189, 248, 0.2)",background:"rgba(56, 189, 248, 0.05)"},children:[s.jsxs("div",{className:"flex-1 text-xs",style:{color:"var(--pc-text-secondary)"},children:[s.jsx("span",{className:"font-semibold",style:{color:"#38bdf8"},children:"What appears here: "}),"agent activity over SSE — LLM requests, tool calls, agent start/end, and errors."," ",s.jsx("span",{className:"font-semibold",style:{color:"var(--pc-text-muted)"},children:"What does not: "}),"daemon stdout and ",s.jsx("code",{children:"RUST_LOG"})," tracing output go to the terminal or log file, not this stream."," ","To see tracing logs, run the daemon with ",s.jsx("code",{children:"RUST_LOG=info kylinbot"})," and check your terminal."]}),s.jsx("button",{onClick:()=>m(!0),className:"flex-shrink-0 text-[10px] btn-icon","aria-label":"Dismiss",style:{color:"var(--pc-text-faint)"},children:"✕"})]}),s.jsx("div",{ref:_,onScroll:T,className:"flex-1 overflow-y-auto p-4 space-y-2 min-h-0",children:D.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full animate-fade-in",style:{color:"var(--pc-text-muted)"},children:[s.jsx(_s,{className:"h-10 w-10 mb-3",style:{color:"var(--pc-text-faint)"}}),s.jsx("p",{className:"text-sm",children:S(r?"logs.paused_hint":"logs.waiting_hint")})]}):D.map(F=>{var I,L,B;const{event:M}=F,A=b9(M.type),U=(B=(L=(I=M.message)!=null?I:M.content)!=null?L:M.data)!=null?B:JSON.stringify(Object.fromEntries(Object.entries(M).filter(([q])=>q!=="type"&&q!=="timestamp")));return s.jsx("div",{className:"card rounded-xl p-3",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"text-[10px] font-mono whitespace-nowrap mt-0.5",style:{color:"var(--pc-text-faint)"},children:y9(M.timestamp)}),s.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-[10px] font-semibold border capitalize flex-shrink-0",style:A,children:M.type}),s.jsx("p",{className:"text-sm break-all min-w-0",style:{color:"var(--pc-text-secondary)"},children:typeof U=="string"?U:JSON.stringify(U)})]})},F.id)})}),s.jsxs("div",{className:"flex items-center justify-center gap-2 px-6 py-2 border-t flex-shrink-0",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg-surface)"},children:[s.jsx("span",{className:"status-dot",style:o?{background:"var(--color-status-success)",boxShadow:"0 0 6px var(--color-status-success)"}:{background:"var(--color-status-error)",boxShadow:"0 0 6px var(--color-status-error)"}}),s.jsx("span",{className:"text-[10px]",style:{color:"var(--pc-text-faint)"},children:S(o?"logs.connected":"logs.disconnected")})]})]})}function v9(e){switch(e){case"ok":return s.jsx(sd,{className:"h-4 w-4 flex-shrink-0",style:{color:"var(--color-status-success)"}});case"warn":return s.jsx(js,{className:"h-4 w-4 flex-shrink-0",style:{color:"var(--color-status-warning)"}});case"error":return s.jsx(Lg,{className:"h-4 w-4 flex-shrink-0",style:{color:"var(--color-status-error)"}})}}function _9(e){switch(e){case"ok":return"rgba(0, 230, 138, 0.04)";case"warn":return"rgba(255, 170, 0, 0.04)";case"error":return"rgba(239, 68, 68, 0.04)"}}function w9(e){switch(e){case"ok":return"border-[rgba(0,230,138,0.3)]";case"warn":return"border-[rgba(255,170,0,0.3)]";case"error":return"border-[rgba(239,68,68,0.3)]"}}function k9(){var g,_,v,w;const[e,n]=x.useState(null),[r,l]=x.useState(!1),[o,u]=x.useState(null),c=async()=>{l(!0),u(null),n(null);try{const j=await w4();n(j)}catch(j){u(j instanceof Error?j.message:"Failed to run diagnostics")}finally{l(!1)}},f=(g=e==null?void 0:e.filter(j=>j.severity==="ok").length)!=null?g:0,h=(_=e==null?void 0:e.filter(j=>j.severity==="warn").length)!=null?_:0,m=(v=e==null?void 0:e.filter(j=>j.severity==="error").length)!=null?v:0,y=(w=e==null?void 0:e.reduce((j,T)=>{const C=T.category;return j[C]||(j[C]=[]),j[C].push(T),j},{}))!=null?w:{};return s.jsxs("div",{className:"p-6 space-y-6 animate-fade-in",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Kg,{className:"h-5 w-5",style:{color:"var(--pc-accent)"}}),s.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wider",style:{color:"var(--pc-text-primary)"},children:S("doctor.diagnostics_title")})]}),s.jsx("button",{onClick:c,disabled:r,className:"btn-electric flex items-center gap-2 text-sm px-4 py-2",children:r?s.jsxs(s.Fragment,{children:[s.jsx(Yn,{className:"h-4 w-4 animate-spin"}),S("doctor.running_btn")]}):s.jsxs(s.Fragment,{children:[s.jsx(Hg,{className:"h-4 w-4"}),S("doctor.run_diagnostics")]})})]}),o&&s.jsx("div",{className:"rounded-xl p-4 border animate-fade-in",style:{background:"rgba(239,68,68,0.06)",borderColor:"rgba(239,68,68,0.2)",color:"#f87171"},children:o}),r&&s.jsxs("div",{className:"flex flex-col items-center justify-center py-16 animate-fade-in",children:[s.jsx("div",{className:"h-12 w-12 border-2 rounded-full animate-spin mb-4",style:{borderColor:"rgba(255,255,255,0.1)",borderTopColor:"var(--pc-accent)"}}),s.jsx("p",{className:"text-sm",style:{color:"var(--pc-text-muted)"},children:S("doctor.running_desc")}),s.jsx("p",{className:"text-[13px] mt-1",style:{color:"var(--pc-text-faint)"},children:S("doctor.running_hint")})]}),e&&!r&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-4 p-4 rounded-xl border animate-fade-in",style:{background:"var(--pc-bg-surface)",borderColor:"var(--pc-border)"},children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(sd,{className:"h-5 w-5",style:{color:"var(--color-status-success)"}}),s.jsxs("span",{className:"text-sm font-medium",style:{color:"var(--pc-text-primary)"},children:[f," ",s.jsx("span",{className:"text-sm font-normal",style:{color:"var(--pc-text-muted)"},children:"ok"})]})]}),s.jsx("div",{className:"w-px h-5",style:{background:"var(--pc-border)"}}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(js,{className:"h-5 w-5",style:{color:"var(--color-status-warning)"}}),s.jsxs("span",{className:"text-sm font-medium",style:{color:"var(--pc-text-primary)"},children:[h," ",s.jsxs("span",{className:"text-sm font-normal",style:{color:"var(--pc-text-muted)"},children:["warning",h!==1?"s":""]})]})]}),s.jsx("div",{className:"w-px h-5",style:{background:"var(--pc-border)"}}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Lg,{className:"h-5 w-5",style:{color:"var(--color-status-error)"}}),s.jsxs("span",{className:"text-sm font-medium",style:{color:"var(--pc-text-primary)"},children:[m," ",s.jsxs("span",{className:"text-sm font-normal",style:{color:"var(--pc-text-muted)"},children:["error",m!==1?"s":""]})]})]}),s.jsx("div",{className:"ml-auto",children:m>0?s.jsx("span",{className:"inline-flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-medium border",style:{background:"rgba(239,68,68,0.06)",borderColor:"rgba(239,68,68,0.3)",color:"#f87171"},children:S("doctor.issues_found")}):h>0?s.jsx("span",{className:"inline-flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-medium border",style:{background:"rgba(255,170,0,0.06)",borderColor:"rgba(255,170,0,0.3)",color:"#fbbf24"},children:S("doctor.warnings_summary")}):s.jsx("span",{className:"inline-flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-medium border",style:{background:"rgba(0,230,138,0.06)",borderColor:"rgba(0,230,138,0.3)",color:"#34d399"},children:S("doctor.all_clear")})})]}),Object.entries(y).sort(([j],[T])=>j.localeCompare(T)).map(([j,T])=>s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wider mb-3 capitalize",style:{color:"var(--pc-text-muted)"},children:j}),s.jsx("div",{className:"space-y-2",children:T.map((C,E)=>s.jsxs("div",{className:`flex items-start gap-3 rounded-xl border p-3 ${w9(C.severity)} ${_9(C.severity)}`,children:[v9(C.severity),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm",style:{color:"var(--pc-text-primary)"},children:C.message}),s.jsx("p",{className:"text-xs capitalize mt-0.5",style:{color:"var(--pc-text-faint)"},children:C.severity})]})]},`${j}-${E}`))})]},j))]}),!e&&!r&&!o&&s.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-[var(--pc-text-muted)]",children:[s.jsx("div",{className:"h-16 w-16 rounded-2xl flex items-center justify-center mb-4 animate-float",style:{background:"linear-gradient(135deg, var(--pc-accent-glow), transparent)"},children:s.jsx(Kg,{className:"h-8 w-8",style:{color:"var(--pc-accent)"}})}),s.jsx("p",{className:"text-lg font-semibold mb-1",style:{color:"var(--pc-text-primary)"},children:S("doctor.system_diagnostics")}),s.jsx("p",{className:"text-sm",style:{color:"var(--pc-text-muted)"},children:S("doctor.empty_hint")})]})]})}function S9(){const[e,n]=x.useState([]),[r,l]=x.useState(!0),[o,u]=x.useState(null),[c,f]=x.useState(null),h=localStorage.getItem("kylinbot_token")||"",m=x.useCallback(async()=>{try{const _=await fetch("/api/devices",{headers:{Authorization:`Bearer ${h}`}});if(_.ok){const v=await _.json();n(v.devices||[])}}catch{f("Failed to load devices")}finally{l(!1)}},[h]);x.useEffect(()=>{dy().then(_=>{_.pairing_code&&u(_.pairing_code)}).catch(()=>{})},[]),x.useEffect(()=>{m()},[m]);const y=async()=>{try{const _=await fetch("/api/pairing/initiate",{method:"POST",headers:{Authorization:`Bearer ${h}`}});if(_.ok){const v=await _.json();u(v.pairing_code)}else f("Failed to generate pairing code")}catch{f("Failed to generate pairing code")}},g=async _=>{try{(await fetch(`/api/devices/${_}`,{method:"DELETE",headers:{Authorization:`Bearer ${h}`}})).ok&&n(e.filter(w=>w.id!==_))}catch{f("Failed to revoke device")}};return r?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"h-8 w-8 border-2 rounded-full animate-spin",style:{borderColor:"var(--pc-border)",borderTopColor:"var(--pc-accent)"}})}):s.jsxs("div",{className:"p-6 space-y-6 animate-fade-in",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wider",style:{color:"var(--pc-text-primary)"},children:S("pairing.title")}),s.jsxs("button",{onClick:y,className:"btn-electric flex items-center gap-2 text-sm px-4 py-2",children:[s.jsx(yC,{className:"h-4 w-4"}),S("pairing.pair_new_device")]})]}),c&&s.jsxs("div",{className:"rounded-xl border p-3 text-sm animate-fade-in",style:{background:"rgba(239, 68, 68, 0.08)",borderColor:"rgba(239, 68, 68, 0.2)",color:"#f87171"},children:[c,s.jsx("button",{onClick:()=>f(null),className:"ml-2 font-bold",children:"×"})]}),o&&s.jsxs("div",{className:"card p-6 text-center rounded-2xl",children:[s.jsx("p",{className:"text-xs uppercase tracking-wider mb-2",style:{color:"var(--pc-text-muted)"},children:S("pairing.pairing_code")}),s.jsx("div",{className:"text-4xl font-mono font-bold tracking-[0.4em] py-4",style:{color:"var(--pc-text-primary)"},children:o}),s.jsx("p",{className:"text-xs",style:{color:"var(--pc-text-muted)"},children:S("pairing.code_hint")})]}),s.jsxs("div",{className:"card rounded-2xl overflow-hidden",children:[s.jsx("div",{className:"px-5 py-4 border-b",style:{borderColor:"var(--pc-border)"},children:s.jsxs("h3",{className:"text-sm font-semibold",style:{color:"var(--pc-text-primary)"},children:[S("pairing.paired_devices")," (",e.length,")"]})}),e.length===0?s.jsx("div",{className:"p-8 text-center",style:{color:"var(--pc-text-muted)"},children:S("pairing.no_devices")}):s.jsxs("table",{className:"table-electric",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:S("pairing.name")}),s.jsx("th",{children:S("pairing.type")}),s.jsx("th",{children:S("pairing.paired")}),s.jsx("th",{children:S("pairing.last_seen")}),s.jsx("th",{children:"IP"}),s.jsx("th",{className:"text-right",children:S("pairing.actions")})]})}),s.jsx("tbody",{children:e.map(_=>s.jsxs("tr",{children:[s.jsx("td",{style:{color:"var(--pc-text-primary)"},children:_.name||"Unnamed"}),s.jsx("td",{style:{color:"var(--pc-text-secondary)"},children:_.device_type||"Unknown"}),s.jsx("td",{className:"text-xs",style:{color:"var(--pc-text-muted)"},children:new Date(_.paired_at).toLocaleDateString()}),s.jsx("td",{className:"text-xs",style:{color:"var(--pc-text-muted)"},children:new Date(_.last_seen).toLocaleString()}),s.jsx("td",{className:"font-mono text-xs",style:{color:"var(--pc-text-secondary)"},children:_.ip_address||"-"}),s.jsx("td",{className:"text-right",children:s.jsx("button",{onClick:()=>g(_.id),className:"btn-icon",children:s.jsx(Cs,{className:"h-4 w-4"})})})]},_.id))})]})]})]})}function C9(){const[e,n]=x.useState("default"),[r,l]=x.useState("default"),[o,u]=x.useState(null),[c,f]=x.useState([]),[h,m]=x.useState(!1),[y,g]=x.useState(!1),[_,v]=x.useState([]),w=x.useRef(null),j=x.useRef(null),T=x.useCallback(F=>{const M=location.protocol==="https:"?"wss:":"ws:",A=Il||"";return`${M}//${location.host}${A}/ws/canvas/${encodeURIComponent(F)}`},[]),C=x.useCallback(F=>{w.current&&w.current.close();const M=mr(),A=M?["kylinbot.v1",`bearer.${M}`]:["kylinbot.v1"],U=new WebSocket(T(F),A);U.onopen=()=>m(!0),U.onclose=()=>m(!1),U.onerror=()=>m(!1),U.onmessage=I=>{try{const L=JSON.parse(I.data);L.type==="frame"&&L.frame&&(L.frame.content_type==="clear"?(u(null),f([])):(u(L.frame),f(B=>[...B.slice(-49),L.frame])))}catch{}},w.current=U},[T]);x.useEffect(()=>(C(e),()=>{var F;(F=w.current)==null||F.close()}),[e,C]),x.useEffect(()=>{const F=async()=>{try{const A=await Me("/api/canvas");v(A.canvases||[])}catch{}};F();const M=setInterval(F,5e3);return()=>clearInterval(M)},[]),x.useEffect(()=>{if(!j.current||!o||o.content_type==="eval")return;const M=j.current.contentDocument;if(!M)return;let A=o.content;o.content_type==="svg"?A=`<!DOCTYPE html><html><head><style>body{margin:0;display:flex;align-items:center;justify-content:center;min-height:100vh;background:#1a1a2e;}</style></head><body>${o.content}</body></html>`:o.content_type==="markdown"?A=`<!DOCTYPE html><html><head><style>body{margin:1rem;font-family:system-ui,sans-serif;color:#e0e0e0;background:#1a1a2e;line-height:1.6;}pre{white-space:pre-wrap;word-wrap:break-word;}</style></head><body><pre>${o.content.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}</pre></body></html>`:o.content_type==="text"&&(A=`<!DOCTYPE html><html><head><style>body{margin:1rem;font-family:monospace;color:#e0e0e0;background:#1a1a2e;white-space:pre-wrap;}</style></head><body>${o.content.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}</body></html>`),M.open(),M.write(A),M.close()},[o]);const E=()=>{r.trim()&&(n(r.trim()),u(null),f([]))},N=async()=>{try{await Me(`/api/canvas/${encodeURIComponent(e)}`,{method:"DELETE"}),u(null),f([])}catch{}},D=F=>{u(F)};return s.jsxs("div",{className:"p-6 space-y-4 h-full flex flex-col",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(fd,{className:"h-6 w-6",style:{color:"var(--pc-accent)"}}),s.jsx("h1",{className:"text-xl font-semibold",style:{color:"var(--pc-text-primary)"},children:"Live Canvas"}),s.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full font-medium",style:{background:h?"rgba(34, 197, 94, 0.15)":"rgba(239, 68, 68, 0.15)",color:h?"#22c55e":"#ef4444"},children:h?"Connected":"Disconnected"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{onClick:()=>g(!y),className:"p-2 rounded-lg transition-colors hover:opacity-80",style:{background:"var(--pc-bg-elevated)",color:"var(--pc-text-muted)"},title:"Toggle history",children:s.jsx(tC,{className:"h-4 w-4"})}),s.jsx("button",{onClick:N,className:"p-2 rounded-lg transition-colors hover:opacity-80",style:{background:"var(--pc-bg-elevated)",color:"var(--pc-text-muted)"},title:"Clear canvas",children:s.jsx(Cs,{className:"h-4 w-4"})}),s.jsx("button",{onClick:()=>C(e),className:"p-2 rounded-lg transition-colors hover:opacity-80",style:{background:"var(--pc-bg-elevated)",color:"var(--pc-text-muted)"},title:"Reconnect",children:s.jsx(fC,{className:"h-4 w-4"})})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("input",{type:"text",value:r,onChange:F=>l(F.target.value),onKeyDown:F=>F.key==="Enter"&&E(),placeholder:"Canvas ID",className:"px-3 py-1.5 rounded-lg text-sm border",style:{background:"var(--pc-bg-elevated)",borderColor:"var(--pc-border)",color:"var(--pc-text-primary)"}}),s.jsx("button",{onClick:E,className:"px-3 py-1.5 rounded-lg text-sm font-medium",style:{background:"var(--pc-accent)",color:"#fff"},children:"Switch"}),_.length>0&&s.jsxs("div",{className:"flex items-center gap-1 ml-2",children:[s.jsx("span",{className:"text-xs",style:{color:"var(--pc-text-muted)"},children:"Active:"}),_.map(F=>s.jsx("button",{onClick:()=>{l(F),n(F),u(null),f([])},className:"px-2 py-0.5 rounded text-xs font-mono transition-colors",style:{background:F===e?"var(--pc-accent-dim)":"var(--pc-bg-elevated)",color:F===e?"var(--pc-accent)":"var(--pc-text-muted)",borderColor:"var(--pc-border)"},children:F},F))]})]}),s.jsxs("div",{className:"flex-1 flex gap-4 min-h-0",children:[s.jsx("div",{className:"flex-1 rounded-lg border overflow-hidden",style:{borderColor:"var(--pc-border)",background:"#1a1a2e"},children:o?s.jsx("iframe",{ref:j,sandbox:"allow-scripts",className:"w-full h-full border-0",title:`Canvas: ${e}`,style:{background:"#1a1a2e"}}):s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx(fd,{className:"h-12 w-12 mx-auto mb-3 opacity-30",style:{color:"var(--pc-text-muted)"}}),s.jsxs("p",{className:"text-sm",style:{color:"var(--pc-text-muted)"},children:["Waiting for content on canvas ",s.jsxs("span",{className:"font-mono",children:['"',e,'"']})]}),s.jsx("p",{className:"text-xs mt-1",style:{color:"var(--pc-text-muted)",opacity:.6},children:"The agent can push content here using the canvas tool"})]})})}),y&&s.jsxs("div",{className:"w-64 rounded-lg border overflow-y-auto",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg-elevated)"},children:[s.jsxs("div",{className:"px-3 py-2 border-b text-xs font-medium sticky top-0",style:{borderColor:"var(--pc-border)",background:"var(--pc-bg-elevated)",color:"var(--pc-text-muted)"},children:["Frame History (",c.length,")"]}),c.length===0?s.jsx("p",{className:"p-3 text-xs",style:{color:"var(--pc-text-muted)"},children:"No frames yet"}):s.jsx("div",{className:"space-y-1 p-2",children:[...c].reverse().map(F=>s.jsxs("button",{onClick:()=>D(F),className:"w-full text-left px-2 py-1.5 rounded text-xs transition-colors",style:{background:(o==null?void 0:o.frame_id)===F.frame_id?"var(--pc-accent-dim)":"transparent",color:"var(--pc-text-primary)"},children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"font-mono truncate",style:{color:"var(--pc-accent)"},children:F.content_type}),s.jsx("span",{style:{color:"var(--pc-text-muted)"},children:new Date(F.timestamp).toLocaleTimeString()})]}),s.jsxs("div",{className:"truncate mt-0.5",style:{color:"var(--pc-text-muted)",fontSize:"0.65rem"},children:[F.content.substring(0,60),F.content.length>60?"...":""]})]},F.frame_id))})]})]}),o&&s.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 rounded-lg text-xs",style:{background:"var(--pc-bg-elevated)",color:"var(--pc-text-muted)"},children:[s.jsxs("span",{children:["Type: ",s.jsx("span",{className:"font-mono",children:o.content_type})," | Frame:"," ",s.jsx("span",{className:"font-mono",children:o.frame_id.substring(0,8)})]}),s.jsx("span",{children:new Date(o.timestamp).toLocaleString()})]})]})}var ei={},Qf,Ox;function j9(){return Ox||(Ox=1,Qf=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),Qf}var Wf={},vr={},Bx;function cl(){if(Bx)return vr;Bx=1;let e;const n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return vr.getSymbolSize=function(l){if(!l)throw new Error('"version" cannot be null or undefined');if(l<1||l>40)throw new Error('"version" should be in range from 1 to 40');return l*4+17},vr.getSymbolTotalCodewords=function(l){return n[l]},vr.getBCHDigit=function(r){let l=0;for(;r!==0;)l++,r>>>=1;return l},vr.setToSJISFunction=function(l){if(typeof l!="function")throw new Error('"toSJISFunc" is not a valid function.');e=l},vr.isKanjiModeEnabled=function(){return typeof e<"u"},vr.toSJIS=function(l){return e(l)},vr}var Xf={},Fx;function Jf(){return Fx||(Fx=1,(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function n(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+r)}}e.isValid=function(l){return l&&typeof l.bit<"u"&&l.bit>=0&&l.bit<4},e.from=function(l,o){if(e.isValid(l))return l;try{return n(l)}catch{return o}}})(Xf)),Xf}var Zf,Ix;function E9(){if(Ix)return Zf;Ix=1;function e(){this.buffer=[],this.length=0}return e.prototype={get:function(n){const r=Math.floor(n/8);return(this.buffer[r]>>>7-n%8&1)===1},put:function(n,r){for(let l=0;l<r;l++)this.putBit((n>>>r-l-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(n){const r=Math.floor(this.length/8);this.buffer.length<=r&&this.buffer.push(0),n&&(this.buffer[r]|=128>>>this.length%8),this.length++}},Zf=e,Zf}var eh,Ux;function N9(){if(Ux)return eh;Ux=1;function e(n){if(!n||n<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=n,this.data=new Uint8Array(n*n),this.reservedBit=new Uint8Array(n*n)}return e.prototype.set=function(n,r,l,o){const u=n*this.size+r;this.data[u]=l,o&&(this.reservedBit[u]=!0)},e.prototype.get=function(n,r){return this.data[n*this.size+r]},e.prototype.xor=function(n,r,l){this.data[n*this.size+r]^=l},e.prototype.isReserved=function(n,r){return this.reservedBit[n*this.size+r]},eh=e,eh}var th={},Hx;function T9(){return Hx||(Hx=1,(function(e){const n=cl().getSymbolSize;e.getRowColCoords=function(l){if(l===1)return[];const o=Math.floor(l/7)+2,u=n(l),c=u===145?26:Math.ceil((u-13)/(2*o-2))*2,f=[u-7];for(let h=1;h<o-1;h++)f[h]=f[h-1]-c;return f.push(6),f.reverse()},e.getPositions=function(l){const o=[],u=e.getRowColCoords(l),c=u.length;for(let f=0;f<c;f++)for(let h=0;h<c;h++)f===0&&h===0||f===0&&h===c-1||f===c-1&&h===0||o.push([u[f],u[h]]);return o}})(th)),th}var nh={},qx;function A9(){if(qx)return nh;qx=1;const e=cl().getSymbolSize,n=7;return nh.getPositions=function(l){const o=e(l);return[[0,0],[o-n,0],[0,o-n]]},nh}var ah={},Px;function M9(){return Px||(Px=1,(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const n={N1:3,N2:3,N3:40,N4:10};e.isValid=function(o){return o!=null&&o!==""&&!isNaN(o)&&o>=0&&o<=7},e.from=function(o){return e.isValid(o)?parseInt(o,10):void 0},e.getPenaltyN1=function(o){const u=o.size;let c=0,f=0,h=0,m=null,y=null;for(let g=0;g<u;g++){f=h=0,m=y=null;for(let _=0;_<u;_++){let v=o.get(g,_);v===m?f++:(f>=5&&(c+=n.N1+(f-5)),m=v,f=1),v=o.get(_,g),v===y?h++:(h>=5&&(c+=n.N1+(h-5)),y=v,h=1)}f>=5&&(c+=n.N1+(f-5)),h>=5&&(c+=n.N1+(h-5))}return c},e.getPenaltyN2=function(o){const u=o.size;let c=0;for(let f=0;f<u-1;f++)for(let h=0;h<u-1;h++){const m=o.get(f,h)+o.get(f,h+1)+o.get(f+1,h)+o.get(f+1,h+1);(m===4||m===0)&&c++}return c*n.N2},e.getPenaltyN3=function(o){const u=o.size;let c=0,f=0,h=0;for(let m=0;m<u;m++){f=h=0;for(let y=0;y<u;y++)f=f<<1&2047|o.get(m,y),y>=10&&(f===1488||f===93)&&c++,h=h<<1&2047|o.get(y,m),y>=10&&(h===1488||h===93)&&c++}return c*n.N3},e.getPenaltyN4=function(o){let u=0;const c=o.data.length;for(let h=0;h<c;h++)u+=o.data[h];return Math.abs(Math.ceil(u*100/c/5)-10)*n.N4};function r(l,o,u){switch(l){case e.Patterns.PATTERN000:return(o+u)%2===0;case e.Patterns.PATTERN001:return o%2===0;case e.Patterns.PATTERN010:return u%3===0;case e.Patterns.PATTERN011:return(o+u)%3===0;case e.Patterns.PATTERN100:return(Math.floor(o/2)+Math.floor(u/3))%2===0;case e.Patterns.PATTERN101:return o*u%2+o*u%3===0;case e.Patterns.PATTERN110:return(o*u%2+o*u%3)%2===0;case e.Patterns.PATTERN111:return(o*u%3+(o+u)%2)%2===0;default:throw new Error("bad maskPattern:"+l)}}e.applyMask=function(o,u){const c=u.size;for(let f=0;f<c;f++)for(let h=0;h<c;h++)u.isReserved(h,f)||u.xor(h,f,r(o,h,f))},e.getBestMask=function(o,u){const c=Object.keys(e.Patterns).length;let f=0,h=1/0;for(let m=0;m<c;m++){u(m),e.applyMask(m,o);const y=e.getPenaltyN1(o)+e.getPenaltyN2(o)+e.getPenaltyN3(o)+e.getPenaltyN4(o);e.applyMask(m,o),y<h&&(h=y,f=m)}return f}})(ah)),ah}var gc={},$x;function Yx(){if($x)return gc;$x=1;const e=Jf(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return gc.getBlocksCount=function(o,u){switch(u){case e.L:return n[(o-1)*4+0];case e.M:return n[(o-1)*4+1];case e.Q:return n[(o-1)*4+2];case e.H:return n[(o-1)*4+3];default:return}},gc.getTotalCodewordsCount=function(o,u){switch(u){case e.L:return r[(o-1)*4+0];case e.M:return r[(o-1)*4+1];case e.Q:return r[(o-1)*4+2];case e.H:return r[(o-1)*4+3];default:return}},gc}var rh={},yo={},Gx;function R9(){if(Gx)return yo;Gx=1;const e=new Uint8Array(512),n=new Uint8Array(256);return(function(){let l=1;for(let o=0;o<255;o++)e[o]=l,n[l]=o,l<<=1,l&256&&(l^=285);for(let o=255;o<512;o++)e[o]=e[o-255]})(),yo.log=function(l){if(l<1)throw new Error("log("+l+")");return n[l]},yo.exp=function(l){return e[l]},yo.mul=function(l,o){return l===0||o===0?0:e[n[l]+n[o]]},yo}var Kx;function D9(){return Kx||(Kx=1,(function(e){const n=R9();e.mul=function(l,o){const u=new Uint8Array(l.length+o.length-1);for(let c=0;c<l.length;c++)for(let f=0;f<o.length;f++)u[c+f]^=n.mul(l[c],o[f]);return u},e.mod=function(l,o){let u=new Uint8Array(l);for(;u.length-o.length>=0;){const c=u[0];for(let h=0;h<o.length;h++)u[h]^=n.mul(o[h],c);let f=0;for(;f<u.length&&u[f]===0;)f++;u=u.slice(f)}return u},e.generateECPolynomial=function(l){let o=new Uint8Array([1]);for(let u=0;u<l;u++)o=e.mul(o,new Uint8Array([1,n.exp(u)]));return o}})(rh)),rh}var lh,Vx;function L9(){if(Vx)return lh;Vx=1;const e=D9();function n(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}return n.prototype.initialize=function(l){this.degree=l,this.genPoly=e.generateECPolynomial(this.degree)},n.prototype.encode=function(l){if(!this.genPoly)throw new Error("Encoder not initialized");const o=new Uint8Array(l.length+this.degree);o.set(l);const u=e.mod(o,this.genPoly),c=this.degree-u.length;if(c>0){const f=new Uint8Array(this.degree);return f.set(u,c),f}return u},lh=n,lh}var ih={},oh={},sh={},Qx;function Wx(){return Qx||(Qx=1,sh.isValid=function(n){return!isNaN(n)&&n>=1&&n<=40}),sh}var Na={},Xx;function Jx(){if(Xx)return Na;Xx=1;const e="[0-9]+",n="[A-Z $%*+\\-./:]+";let r="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";r=r.replace(/u/g,"\\u");const l="(?:(?![A-Z0-9 $%*+\\-./:]|"+r+`)(?:.|[\r
]))+`;Na.KANJI=new RegExp(r,"g"),Na.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Na.BYTE=new RegExp(l,"g"),Na.NUMERIC=new RegExp(e,"g"),Na.ALPHANUMERIC=new RegExp(n,"g");const o=new RegExp("^"+r+"$"),u=new RegExp("^"+e+"$"),c=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return Na.testKanji=function(h){return o.test(h)},Na.testNumeric=function(h){return u.test(h)},Na.testAlphanumeric=function(h){return c.test(h)},Na}var Zx;function ul(){return Zx||(Zx=1,(function(e){const n=Wx(),r=Jx();e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(u,c){if(!u.ccBits)throw new Error("Invalid mode: "+u);if(!n.isValid(c))throw new Error("Invalid version: "+c);return c>=1&&c<10?u.ccBits[0]:c<27?u.ccBits[1]:u.ccBits[2]},e.getBestModeForData=function(u){return r.testNumeric(u)?e.NUMERIC:r.testAlphanumeric(u)?e.ALPHANUMERIC:r.testKanji(u)?e.KANJI:e.BYTE},e.toString=function(u){if(u&&u.id)return u.id;throw new Error("Invalid mode")},e.isValid=function(u){return u&&u.bit&&u.ccBits};function l(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+o)}}e.from=function(u,c){if(e.isValid(u))return u;try{return l(u)}catch{return c}}})(oh)),oh}var ev;function z9(){return ev||(ev=1,(function(e){const n=cl(),r=Yx(),l=Jf(),o=ul(),u=Wx(),c=7973,f=n.getBCHDigit(c);function h(_,v,w){for(let j=1;j<=40;j++)if(v<=e.getCapacity(j,w,_))return j}function m(_,v){return o.getCharCountIndicator(_,v)+4}function y(_,v){let w=0;return _.forEach(function(j){const T=m(j.mode,v);w+=T+j.getBitsLength()}),w}function g(_,v){for(let w=1;w<=40;w++)if(y(_,w)<=e.getCapacity(w,v,o.MIXED))return w}e.from=function(v,w){return u.isValid(v)?parseInt(v,10):w},e.getCapacity=function(v,w,j){if(!u.isValid(v))throw new Error("Invalid QR Code version");typeof j>"u"&&(j=o.BYTE);const T=n.getSymbolTotalCodewords(v),C=r.getTotalCodewordsCount(v,w),E=(T-C)*8;if(j===o.MIXED)return E;const N=E-m(j,v);switch(j){case o.NUMERIC:return Math.floor(N/10*3);case o.ALPHANUMERIC:return Math.floor(N/11*2);case o.KANJI:return Math.floor(N/13);case o.BYTE:default:return Math.floor(N/8)}},e.getBestVersionForData=function(v,w){let j;const T=l.from(w,l.M);if(Array.isArray(v)){if(v.length>1)return g(v,T);if(v.length===0)return 1;j=v[0]}else j=v;return h(j.mode,j.getLength(),T)},e.getEncodedBits=function(v){if(!u.isValid(v)||v<7)throw new Error("Invalid QR Code version");let w=v<<12;for(;n.getBCHDigit(w)-f>=0;)w^=c<<n.getBCHDigit(w)-f;return v<<12|w}})(ih)),ih}var ch={},tv;function O9(){if(tv)return ch;tv=1;const e=cl(),n=1335,r=21522,l=e.getBCHDigit(n);return ch.getEncodedBits=function(u,c){const f=u.bit<<3|c;let h=f<<10;for(;e.getBCHDigit(h)-l>=0;)h^=n<<e.getBCHDigit(h)-l;return(f<<10|h)^r},ch}var uh={},dh,nv;function B9(){if(nv)return dh;nv=1;const e=ul();function n(r){this.mode=e.NUMERIC,this.data=r.toString()}return n.getBitsLength=function(l){return 10*Math.floor(l/3)+(l%3?l%3*3+1:0)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(l){let o,u,c;for(o=0;o+3<=this.data.length;o+=3)u=this.data.substr(o,3),c=parseInt(u,10),l.put(c,10);const f=this.data.length-o;f>0&&(u=this.data.substr(o),c=parseInt(u,10),l.put(c,f*3+1))},dh=n,dh}var fh,av;function F9(){if(av)return fh;av=1;const e=ul(),n=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function r(l){this.mode=e.ALPHANUMERIC,this.data=l}return r.getBitsLength=function(o){return 11*Math.floor(o/2)+6*(o%2)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(o){let u;for(u=0;u+2<=this.data.length;u+=2){let c=n.indexOf(this.data[u])*45;c+=n.indexOf(this.data[u+1]),o.put(c,11)}this.data.length%2&&o.put(n.indexOf(this.data[u]),6)},fh=r,fh}var hh,rv;function I9(){if(rv)return hh;rv=1;const e=ul();function n(r){this.mode=e.BYTE,typeof r=="string"?this.data=new TextEncoder().encode(r):this.data=new Uint8Array(r)}return n.getBitsLength=function(l){return l*8},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(r){for(let l=0,o=this.data.length;l<o;l++)r.put(this.data[l],8)},hh=n,hh}var mh,lv;function U9(){if(lv)return mh;lv=1;const e=ul(),n=cl();function r(l){this.mode=e.KANJI,this.data=l}return r.getBitsLength=function(o){return o*13},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(l){let o;for(o=0;o<this.data.length;o++){let u=n.toSJIS(this.data[o]);if(u>=33088&&u<=40956)u-=33088;else if(u>=57408&&u<=60351)u-=49472;else throw new Error("Invalid SJIS character: "+this.data[o]+`
Make sure your charset is UTF-8`);u=(u>>>8&255)*192+(u&255),l.put(u,13)}},mh=r,mh}var ph={exports:{}},iv;function H9(){return iv||(iv=1,(function(e){var n={single_source_shortest_paths:function(r,l,o){var u={},c={};c[l]=0;var f=n.PriorityQueue.make();f.push(l,0);for(var h,m,y,g,_,v,w,j,T;!f.empty();){h=f.pop(),m=h.value,g=h.cost,_=r[m]||{};for(y in _)_.hasOwnProperty(y)&&(v=_[y],w=g+v,j=c[y],T=typeof c[y]>"u",(T||j>w)&&(c[y]=w,f.push(y,w),u[y]=m))}if(typeof o<"u"&&typeof c[o]>"u"){var C=["Could not find a path from ",l," to ",o,"."].join("");throw new Error(C)}return u},extract_shortest_path_from_predecessor_list:function(r,l){for(var o=[],u=l;u;)o.push(u),r[u],u=r[u];return o.reverse(),o},find_path:function(r,l,o){var u=n.single_source_shortest_paths(r,l,o);return n.extract_shortest_path_from_predecessor_list(u,o)},PriorityQueue:{make:function(r){var l=n.PriorityQueue,o={},u;r=r||{};for(u in l)l.hasOwnProperty(u)&&(o[u]=l[u]);return o.queue=[],o.sorter=r.sorter||l.default_sorter,o},default_sorter:function(r,l){return r.cost-l.cost},push:function(r,l){var o={value:r,cost:l};this.queue.push(o),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=n})(ph)),ph.exports}var ov;function q9(){return ov||(ov=1,(function(e){const n=ul(),r=B9(),l=F9(),o=I9(),u=U9(),c=Jx(),f=cl(),h=H9();function m(C){return unescape(encodeURIComponent(C)).length}function y(C,E,N){const D=[];let F;for(;(F=C.exec(N))!==null;)D.push({data:F[0],index:F.index,mode:E,length:F[0].length});return D}function g(C){const E=y(c.NUMERIC,n.NUMERIC,C),N=y(c.ALPHANUMERIC,n.ALPHANUMERIC,C);let D,F;return f.isKanjiModeEnabled()?(D=y(c.BYTE,n.BYTE,C),F=y(c.KANJI,n.KANJI,C)):(D=y(c.BYTE_KANJI,n.BYTE,C),F=[]),E.concat(N,D,F).sort(function(A,U){return A.index-U.index}).map(function(A){return{data:A.data,mode:A.mode,length:A.length}})}function _(C,E){switch(E){case n.NUMERIC:return r.getBitsLength(C);case n.ALPHANUMERIC:return l.getBitsLength(C);case n.KANJI:return u.getBitsLength(C);case n.BYTE:return o.getBitsLength(C)}}function v(C){return C.reduce(function(E,N){const D=E.length-1>=0?E[E.length-1]:null;return D&&D.mode===N.mode?(E[E.length-1].data+=N.data,E):(E.push(N),E)},[])}function w(C){const E=[];for(let N=0;N<C.length;N++){const D=C[N];switch(D.mode){case n.NUMERIC:E.push([D,{data:D.data,mode:n.ALPHANUMERIC,length:D.length},{data:D.data,mode:n.BYTE,length:D.length}]);break;case n.ALPHANUMERIC:E.push([D,{data:D.data,mode:n.BYTE,length:D.length}]);break;case n.KANJI:E.push([D,{data:D.data,mode:n.BYTE,length:m(D.data)}]);break;case n.BYTE:E.push([{data:D.data,mode:n.BYTE,length:m(D.data)}])}}return E}function j(C,E){const N={},D={start:{}};let F=["start"];for(let M=0;M<C.length;M++){const A=C[M],U=[];for(let I=0;I<A.length;I++){const L=A[I],B=""+M+I;U.push(B),N[B]={node:L,lastCount:0},D[B]={};for(let q=0;q<F.length;q++){const K=F[q];N[K]&&N[K].node.mode===L.mode?(D[K][B]=_(N[K].lastCount+L.length,L.mode)-_(N[K].lastCount,L.mode),N[K].lastCount+=L.length):(N[K]&&(N[K].lastCount=L.length),D[K][B]=_(L.length,L.mode)+4+n.getCharCountIndicator(L.mode,E))}}F=U}for(let M=0;M<F.length;M++)D[F[M]].end=0;return{map:D,table:N}}function T(C,E){let N;const D=n.getBestModeForData(C);if(N=n.from(E,D),N!==n.BYTE&&N.bit<D.bit)throw new Error('"'+C+'" cannot be encoded with mode '+n.toString(N)+`.
 Suggested mode is: `+n.toString(D));switch(N===n.KANJI&&!f.isKanjiModeEnabled()&&(N=n.BYTE),N){case n.NUMERIC:return new r(C);case n.ALPHANUMERIC:return new l(C);case n.KANJI:return new u(C);case n.BYTE:return new o(C)}}e.fromArray=function(E){return E.reduce(function(N,D){return typeof D=="string"?N.push(T(D,null)):D.data&&N.push(T(D.data,D.mode)),N},[])},e.fromString=function(E,N){const D=g(E,f.isKanjiModeEnabled()),F=w(D),M=j(F,N),A=h.find_path(M.map,"start","end"),U=[];for(let I=1;I<A.length-1;I++)U.push(M.table[A[I]].node);return e.fromArray(v(U))},e.rawSplit=function(E){return e.fromArray(g(E,f.isKanjiModeEnabled()))}})(uh)),uh}var sv;function P9(){if(sv)return Wf;sv=1;const e=cl(),n=Jf(),r=E9(),l=N9(),o=T9(),u=A9(),c=M9(),f=Yx(),h=L9(),m=z9(),y=O9(),g=ul(),_=q9();function v(M,A){const U=M.size,I=u.getPositions(A);for(let L=0;L<I.length;L++){const B=I[L][0],q=I[L][1];for(let K=-1;K<=7;K++)if(!(B+K<=-1||U<=B+K))for(let G=-1;G<=7;G++)q+G<=-1||U<=q+G||(K>=0&&K<=6&&(G===0||G===6)||G>=0&&G<=6&&(K===0||K===6)||K>=2&&K<=4&&G>=2&&G<=4?M.set(B+K,q+G,!0,!0):M.set(B+K,q+G,!1,!0))}}function w(M){const A=M.size;for(let U=8;U<A-8;U++){const I=U%2===0;M.set(U,6,I,!0),M.set(6,U,I,!0)}}function j(M,A){const U=o.getPositions(A);for(let I=0;I<U.length;I++){const L=U[I][0],B=U[I][1];for(let q=-2;q<=2;q++)for(let K=-2;K<=2;K++)q===-2||q===2||K===-2||K===2||q===0&&K===0?M.set(L+q,B+K,!0,!0):M.set(L+q,B+K,!1,!0)}}function T(M,A){const U=M.size,I=m.getEncodedBits(A);let L,B,q;for(let K=0;K<18;K++)L=Math.floor(K/3),B=K%3+U-8-3,q=(I>>K&1)===1,M.set(L,B,q,!0),M.set(B,L,q,!0)}function C(M,A,U){const I=M.size,L=y.getEncodedBits(A,U);let B,q;for(B=0;B<15;B++)q=(L>>B&1)===1,B<6?M.set(B,8,q,!0):B<8?M.set(B+1,8,q,!0):M.set(I-15+B,8,q,!0),B<8?M.set(8,I-B-1,q,!0):B<9?M.set(8,15-B-1+1,q,!0):M.set(8,15-B-1,q,!0);M.set(I-8,8,1,!0)}function E(M,A){const U=M.size;let I=-1,L=U-1,B=7,q=0;for(let K=U-1;K>0;K-=2)for(K===6&&K--;;){for(let G=0;G<2;G++)if(!M.isReserved(L,K-G)){let ne=!1;q<A.length&&(ne=(A[q]>>>B&1)===1),M.set(L,K-G,ne),B--,B===-1&&(q++,B=7)}if(L+=I,L<0||U<=L){L-=I,I=-I;break}}}function N(M,A,U){const I=new r;U.forEach(function(G){I.put(G.mode.bit,4),I.put(G.getLength(),g.getCharCountIndicator(G.mode,M)),G.write(I)});const L=e.getSymbolTotalCodewords(M),B=f.getTotalCodewordsCount(M,A),q=(L-B)*8;for(I.getLengthInBits()+4<=q&&I.put(0,4);I.getLengthInBits()%8!==0;)I.putBit(0);const K=(q-I.getLengthInBits())/8;for(let G=0;G<K;G++)I.put(G%2?17:236,8);return D(I,M,A)}function D(M,A,U){const I=e.getSymbolTotalCodewords(A),L=f.getTotalCodewordsCount(A,U),B=I-L,q=f.getBlocksCount(A,U),K=I%q,G=q-K,ne=Math.floor(I/q),V=Math.floor(B/q),le=V+1,me=ne-V,ce=new h(me);let O=0;const H=new Array(q),Z=new Array(q);let z=0;const oe=new Uint8Array(M.buffer);for(let re=0;re<q;re++){const ke=re<G?V:le;H[re]=oe.slice(O,O+ke),Z[re]=ce.encode(H[re]),O+=ke,z=Math.max(z,ke)}const ue=new Uint8Array(I);let ve=0,Se,Te;for(Se=0;Se<z;Se++)for(Te=0;Te<q;Te++)Se<H[Te].length&&(ue[ve++]=H[Te][Se]);for(Se=0;Se<me;Se++)for(Te=0;Te<q;Te++)ue[ve++]=Z[Te][Se];return ue}function F(M,A,U,I){let L;if(Array.isArray(M))L=_.fromArray(M);else if(typeof M=="string"){let ne=A;if(!ne){const V=_.rawSplit(M);ne=m.getBestVersionForData(V,U)}L=_.fromString(M,ne||40)}else throw new Error("Invalid data");const B=m.getBestVersionForData(L,U);if(!B)throw new Error("The amount of data is too big to be stored in a QR Code");if(!A)A=B;else if(A<B)throw new Error(`
The chosen QR Code version cannot contain this amount of data.
Minimum version required to store current data is: `+B+`.
`);const q=N(A,U,L),K=e.getSymbolSize(A),G=new l(K);return v(G,A),w(G),j(G,A),C(G,U,0),A>=7&&T(G,A),E(G,q),isNaN(I)&&(I=c.getBestMask(G,C.bind(null,G,U))),c.applyMask(I,G),C(G,U,I),{modules:G,version:A,errorCorrectionLevel:U,maskPattern:I,segments:L}}return Wf.create=function(A,U){if(typeof A>"u"||A==="")throw new Error("No input text");let I=n.M,L,B;return typeof U<"u"&&(I=n.from(U.errorCorrectionLevel,n.M),L=m.from(U.version),B=c.from(U.maskPattern),U.toSJISFunc&&e.setToSJISFunction(U.toSJISFunc)),F(A,L,I,B)},Wf}var gh={},yh={},cv;function uv(){return cv||(cv=1,(function(e){function n(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let l=r.slice().replace("#","").split("");if(l.length<3||l.length===5||l.length>8)throw new Error("Invalid hex color: "+r);(l.length===3||l.length===4)&&(l=Array.prototype.concat.apply([],l.map(function(u){return[u,u]}))),l.length===6&&l.push("F","F");const o=parseInt(l.join(""),16);return{r:o>>24&255,g:o>>16&255,b:o>>8&255,a:o&255,hex:"#"+l.slice(0,6).join("")}}e.getOptions=function(l){l||(l={}),l.color||(l.color={});const o=typeof l.margin>"u"||l.margin===null||l.margin<0?4:l.margin,u=l.width&&l.width>=21?l.width:void 0,c=l.scale||4;return{width:u,scale:u?4:c,margin:o,color:{dark:n(l.color.dark||"#000000ff"),light:n(l.color.light||"#ffffffff")},type:l.type,rendererOpts:l.rendererOpts||{}}},e.getScale=function(l,o){return o.width&&o.width>=l+o.margin*2?o.width/(l+o.margin*2):o.scale},e.getImageWidth=function(l,o){const u=e.getScale(l,o);return Math.floor((l+o.margin*2)*u)},e.qrToImageData=function(l,o,u){const c=o.modules.size,f=o.modules.data,h=e.getScale(c,u),m=Math.floor((c+u.margin*2)*h),y=u.margin*h,g=[u.color.light,u.color.dark];for(let _=0;_<m;_++)for(let v=0;v<m;v++){let w=(_*m+v)*4,j=u.color.light;if(_>=y&&v>=y&&_<m-y&&v<m-y){const T=Math.floor((_-y)/h),C=Math.floor((v-y)/h);j=g[f[T*c+C]?1:0]}l[w++]=j.r,l[w++]=j.g,l[w++]=j.b,l[w]=j.a}}})(yh)),yh}var dv;function $9(){return dv||(dv=1,(function(e){const n=uv();function r(o,u,c){o.clearRect(0,0,u.width,u.height),u.style||(u.style={}),u.height=c,u.width=c,u.style.height=c+"px",u.style.width=c+"px"}function l(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(u,c,f){let h=f,m=c;typeof h>"u"&&(!c||!c.getContext)&&(h=c,c=void 0),c||(m=l()),h=n.getOptions(h);const y=n.getImageWidth(u.modules.size,h),g=m.getContext("2d"),_=g.createImageData(y,y);return n.qrToImageData(_.data,u,h),r(g,m,y),g.putImageData(_,0,0),m},e.renderToDataURL=function(u,c,f){let h=f;typeof h>"u"&&(!c||!c.getContext)&&(h=c,c=void 0),h||(h={});const m=e.render(u,c,h),y=h.type||"image/png",g=h.rendererOpts||{};return m.toDataURL(y,g.quality)}})(gh)),gh}var bh={},fv;function Y9(){if(fv)return bh;fv=1;const e=uv();function n(o,u){const c=o.a/255,f=u+'="'+o.hex+'"';return c<1?f+" "+u+'-opacity="'+c.toFixed(2).slice(1)+'"':f}function r(o,u,c){let f=o+u;return typeof c<"u"&&(f+=" "+c),f}function l(o,u,c){let f="",h=0,m=!1,y=0;for(let g=0;g<o.length;g++){const _=Math.floor(g%u),v=Math.floor(g/u);!_&&!m&&(m=!0),o[g]?(y++,g>0&&_>0&&o[g-1]||(f+=m?r("M",_+c,.5+v+c):r("m",h,0),h=0,m=!1),_+1<u&&o[g+1]||(f+=r("h",y),y=0)):h++}return f}return bh.render=function(u,c,f){const h=e.getOptions(c),m=u.modules.size,y=u.modules.data,g=m+h.margin*2,_=h.color.light.a?"<path "+n(h.color.light,"fill")+' d="M0 0h'+g+"v"+g+'H0z"/>':"",v="<path "+n(h.color.dark,"stroke")+' d="'+l(y,m,h.margin)+'"/>',w='viewBox="0 0 '+g+" "+g+'"',T='<svg xmlns="http://www.w3.org/2000/svg" '+(h.width?'width="'+h.width+'" height="'+h.width+'" ':"")+w+' shape-rendering="crispEdges">'+_+v+`</svg>
`;return typeof f=="function"&&f(null,T),T},bh}var hv;function G9(){if(hv)return ei;hv=1;const e=j9(),n=P9(),r=$9(),l=Y9();function o(u,c,f,h,m){const y=[].slice.call(arguments,1),g=y.length,_=typeof y[g-1]=="function";if(!_&&!e())throw new Error("Callback required as last argument");if(_){if(g<2)throw new Error("Too few arguments provided");g===2?(m=f,f=c,c=h=void 0):g===3&&(c.getContext&&typeof m>"u"?(m=h,h=void 0):(m=h,h=f,f=c,c=void 0))}else{if(g<1)throw new Error("Too few arguments provided");return g===1?(f=c,c=h=void 0):g===2&&!c.getContext&&(h=f,f=c,c=void 0),new Promise(function(v,w){try{const j=n.create(f,h);v(u(j,c,h))}catch(j){w(j)}})}try{const v=n.create(f,h);m(null,u(v,c,h))}catch(v){m(v)}}return ei.create=n.create,ei.toCanvas=o.bind(null,r.render),ei.toDataURL=o.bind(null,r.renderToDataURL),ei.toString=o.bind(null,function(u,c,f){return l.render(u,f)}),ei}var K9=G9();const yc=gt(K9),bc=160,mv=176;function V9(){return{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",background:"#fff",border:"1px solid rgba(0, 0, 0, 0.1)",borderRadius:6,width:mv,height:mv,overflow:"hidden",cursor:"default"}}function Q9(e,n){return{position:"static",width:bc,height:bc,display:"block",visibility:e?"visible":"hidden",filter:n?"blur(4px) opacity(0.12)":"none"}}function W9(e){return{position:"absolute",top:0,right:0,bottom:0,left:0,borderRadius:6,backgroundImage:`linear-gradient(0deg, rgba(255,255,255,0.9), rgba(255,255,255,0.9)), url(${e})`,backgroundSize:"cover",backgroundPosition:"center",filter:"blur(5px)",zIndex:0}}function X9(){return{position:"absolute",left:53,top:67,zIndex:2,width:70,height:41,display:"flex",flexDirection:"column",alignItems:"center"}}function J9(){return{width:70,height:21,fontFamily:"'Noto Sans CJK SC', sans-serif",fontSize:14,fontWeight:400,lineHeight:"21px",color:"rgba(0, 0, 0, 0.85)",textAlign:"center",marginTop:4}}function pv(){return s.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[s.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.89999962779541,6.4000000907348635L10.59999942779541,6.4000000907348635L10.09999942779541,6.4000000907348635L10.09999942779541,5.4000000907348635L10.59999942779541,5.4000000907348635L11.89999962779541,5.4000000907348635L12.69999982779541,5.4000000907348635L12.69999982779541,3.3000001907348633L12.69999982779541,2.8000001907348633L13.69999982779541,2.8000001907348633L13.69999982779541,3.3000001907348633L13.69999982779541,4.600000390734863L13.69999982779541,5.700000290734863C13.69999982779541,5.9000000907348635,13.59999942779541,6.100000390734863,13.50000002779541,6.200000290734863C13.39999962779541,6.300000190734863,13.19999982779541,6.4000000907348635,13.00000002779541,6.4000000907348635L11.89999962779541,6.4000000907348635Z",fill:"#1A1A1A"}),s.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.499999523162842,3.00000018Q10.380733923162841,3.00000024,12.087978523162842,5.4832643999999995L12.088060523162842,5.4832076999999995Q12.158005523162842,5.5849452,12.267271523162842,5.6424224Q12.376537523162842,5.6998997,12.499999523162842,5.6998999Q12.549234523162841,5.6998997,12.597525523162842,5.6902943Q12.645814523162842,5.6806889,12.691302523162841,5.6618469000000005Q12.736789523162841,5.6430049,12.777728523162843,5.6156511Q12.818665523162842,5.5882971,12.853481523162841,5.553482300000001Q12.888296523162841,5.518667199999999,12.915649523162841,5.4777287999999995Q12.943004523162841,5.4367906999999995,12.961845523162841,5.3913025999999995Q12.980687523162842,5.3458147,12.990293523162842,5.2975252Q12.999898523162841,5.2492354,12.999899523162842,5.1999998000000005Q12.999899523162842,5.0447361,12.911938523162842,4.9167924L12.912021523162842,4.9167354Q10.906764523162842,1.99999994,7.499999523162842,2.00000018Q4.8178928231628415,2,2.908946423162842,3.9089465Q0.9999994631628418,5.8178933,0.9999995231628418,8.5Q0.9999995231628418,11.182107,2.9089463231628416,13.091053Q4.817892523162842,15,7.499999523162842,15Q9.929027123162841,15,11.752977523162842,13.414899Q13.568589523162842,11.8370476,13.895309523162842,9.4683189L13.899999523162842,9.43432L13.899999523162842,9.399999600000001Q13.899999523162842,9.349510200000001,13.940289523162841,9.148057900000001Q13.999999523162842,8.849509699999999,13.999999523162842,8.6999998L13.999899523162842,8.6999998Q13.999898523162841,8.6507635,13.990293523162842,8.602473700000001Q13.980687523162842,8.554184,13.961844523162842,8.5086961Q13.943003523162842,8.4632082,13.915648523162842,8.422269799999999Q13.888295523162842,8.3813314,13.853480523162842,8.346516600000001Q13.818665523162842,8.3117018,13.777728523162843,8.284348Q13.736789523162841,8.2569938,13.691301523162842,8.238152Q13.645814523162842,8.219310799999999,13.597525523162842,8.2097054Q13.549235523162842,8.2000999,13.499999523162842,8.2000999Q13.450763523162841,8.2000999,13.402471523162841,8.2097054Q13.354182523162843,8.219310799999999,13.308694523162842,8.238152Q13.263205523162842,8.2569938,13.222268523162843,8.284347499999999Q13.181331523162841,8.3117018,13.146516523162841,8.346516600000001Q13.111701523162841,8.3813314,13.084347523162842,8.422269799999999Q13.056992523162842,8.4632077,13.038150523162841,8.5086956Q13.019309523162843,8.554184,13.009704523162842,8.602473700000001Q13.000098523162842,8.6507635,13.000099523162842,8.6999998L12.999999523162842,8.6999998Q12.999999523162842,8.7504902,12.959708523162842,8.9519424Q12.907934523162842,9.2108116,12.901053523162842,9.357626Q12.619300523162842,11.3371658,11.097021623162842,12.6601Q9.555218223162841,14,7.499999523162842,14Q5.232107123162842,14,3.6160531231628417,12.3839455Q1.9999995231628418,10.7678928,1.9999995231628418,8.5Q1.9999995831628419,6.2321072,3.6160531231628417,4.6160533Q5.2321067231628415,3,7.499999523162842,3.00000018Z",fill:"#1A1A1A"})]})}function Z9({label:e}){return s.jsxs("div",{style:X9(),children:[s.jsx(pv,{}),s.jsx("span",{style:J9(),children:e})]})}function eR({label:e}){return s.jsx("div",{style:{marginTop:8,height:21,display:"flex",alignItems:"center",justifyContent:"center"},children:s.jsx("span",{style:{width:98,height:21,fontFamily:"'Noto Sans CJK SC', sans-serif",fontSize:14,fontWeight:400,lineHeight:"21px",color:"#F53F3F",textAlign:"center"},children:e})})}function xc({label:e}){return s.jsx("span",{style:{fontSize:14,color:"#F53F3F",fontWeight:400},children:e})}function gv({label:e}){return s.jsx("span",{className:"inline-flex items-center rounded-full",style:{display:"inline-flex",alignItems:"center",background:"rgba(59,130,246,0.08)",color:"#3b82f6",border:"1px solid rgba(59,130,246,0.2)",fontSize:14,padding:"8px 16px",borderRadius:999},children:e})}function tR({color:e}){return s.jsxs("svg",{"data-testid":"channel-qr-loading-spinner",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",style:{width:32,height:32,display:"block"},children:[s.jsx("circle",{cx:"16",cy:"16",r:"12",stroke:e,strokeWidth:"3",strokeOpacity:"0.18"}),s.jsx("circle",{cx:"16",cy:"16",r:"12",pathLength:"100",stroke:e,strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"28 72",strokeDashoffset:"0",children:s.jsx("animate",{attributeName:"stroke-dashoffset",values:"0;-100",dur:"0.9s",repeatCount:"indefinite"})})]})}function vc({canvasRef:e,phase:n,qrRendered:r,isQrFetchError:l,placeholderSrc:o,brandColor:u,onRefresh:c,refreshLabel:f,fetchFailedLabel:h,bindSuccessLabel:m,confirmedFontSize:y=12,statusContent:g}){const _=n==="expired"||l;return s.jsxs(s.Fragment,{children:[s.jsx(nR,{canvasRef:e,visible:r&&n!=="loading"&&!_,dimmed:n==="expired"||n==="confirmed"||l,placeholderSrc:_?o:void 0,clickable:n==="loading"||n==="expired"||l,onClick:c,children:n==="expired"||l?s.jsx(Z9,{label:f}):(n==="loading"||!r||n==="confirmed")&&s.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",style:{position:"absolute",top:0,right:0,bottom:0,left:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[n==="confirmed"?null:n==="loading"||!r?s.jsx(tR,{color:u}):s.jsx(pv,{}),n==="confirmed"?s.jsx("span",{style:{fontFamily:"'Noto Sans CJK SC', sans-serif",fontSize:y,fontWeight:500,color:"#10b981",textAlign:"center",padding:"0 16px"},children:m}):null]})}),l?s.jsx(eR,{label:h}):s.jsx("div",{className:"flex items-center justify-center",style:{marginTop:8,height:28,display:"flex",alignItems:"center",justifyContent:"center"},children:g})]})}function nR({canvasRef:e,visible:n,dimmed:r,placeholderSrc:l,clickable:o=!1,onClick:u,children:c}){return s.jsxs("div",{"data-testid":"channel-qr-frame",style:{...V9(),cursor:o?"pointer":"default"},onClick:o?u:void 0,children:[l?s.jsx("div",{"data-testid":"channel-qr-placeholder",style:W9(l)}):null,s.jsx("canvas",{ref:e,"data-testid":"channel-qr-canvas",width:bc,height:bc,style:Q9(n,r)}),c]})}const aR="#E5E5E5",rR="#D9D9D9",lR="#CCCCCC",iR="#3790FA",oR="#2F7DE1",sR="#2568C7",cR={fontFamily:"'Noto Sans CJK SC', sans-serif",fontSize:24,fontWeight:500,lineHeight:"normal",textAlign:"center",letterSpacing:0,color:"#000000",marginTop:0,marginBottom:2},uR={fontFamily:"'Noto Sans CJK SC', sans-serif",fontSize:14,fontWeight:400,lineHeight:"normal",textAlign:"center",letterSpacing:0,color:"rgba(0, 0, 0, 0.6)",marginTop:0,marginBottom:16};function bo({icon:e,alt:n,title:r,description:l,descriptionMaxWidth:o=400}){return s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{marginBottom:8},children:s.jsx("img",{src:`${$e}/icons/${e}`,alt:n,width:"64",height:"64"})}),s.jsx("h1",{style:cR,children:r}),s.jsx("p",{style:{...uR,maxWidth:o},children:l})]})}function xo({message:e,visible:n=!0}){return!e||!n?null:s.jsxs("div",{className:"flex items-center rounded-lg",style:{display:"flex",alignItems:"center",background:"rgba(239,68,68,0.06)",borderRadius:6,marginBottom:16,padding:"8px 16px"},children:[s.jsx(js,{className:"flex-shrink-0",style:{color:"#ef4444",width:16,height:16,marginRight:8}}),s.jsx("span",{style:{fontSize:14,color:"#ef4444"},children:e})]})}function _c({label:e}){return s.jsxs("div",{className:"flex flex-col items-center",style:{display:"flex",flexDirection:"column",alignItems:"center",marginTop:16},children:[s.jsx(Dg,{style:{color:"#10b981",width:48,height:48,marginBottom:16}}),s.jsx("span",{style:{fontFamily:"'Noto Sans CJK SC', sans-serif",fontSize:12,fontWeight:500,color:"#10b981",textAlign:"center"},children:e})]})}function dR(e){return e==="filled"?{display:"flex",flexShrink:0,justifyContent:"flex-start",alignItems:"flex-start",marginBottom:16}:{display:"flex",alignItems:"center",marginBottom:16}}function fR(e){return e==="filled"?{display:"flex",alignItems:"center",height:16,overflow:"hidden",cursor:"pointer"}:{display:"flex",alignItems:"center",cursor:"pointer"}}function hR(e,n){return n==="filled"?{display:"flex",alignItems:"center",justifyContent:"center",width:16,height:16,minWidth:16,maxWidth:16,minHeight:16,maxHeight:16,borderRadius:8,border:"1px solid rgba(0, 0, 0, 0.1)",background:e?"#3790FA":"#E6E6E6",marginRight:8}:{display:"flex",alignItems:"center",justifyContent:"center",width:16,height:16,borderRadius:"50%",border:e?"5px solid #3790FA":"1.5px solid #d0d0d0",background:e?"#fff":"transparent",marginRight:8}}function mR(e){return e==="filled"?{flexShrink:0,fontFamily:"'Source Han Sans', 'Noto Sans CJK SC', sans-serif",fontSize:14,fontWeight:400,lineHeight:"20px",color:"rgba(0, 0, 0, 0.85)"}:{fontSize:14,fontWeight:400,color:"rgba(0,0,0,0.85)"}}function xh({value:e,options:n,onChange:r,visible:l=!0,variant:o="ring"}){return l?s.jsx("div",{style:dR(o),children:n.map((u,c)=>{const f=u.value===e;return s.jsxs("label",{onClick:()=>r(u.value),style:{...fR(o),marginRight:c===n.length-1?0:24},children:[s.jsx("div",{className:"flex items-center justify-center",style:hR(f,o),children:o==="filled"&&f?s.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"#FFFFFF"}}):null}),s.jsx("span",{style:mR(o),children:u.label})]},u.value)})}):null}const pR={fontFamily:"'Noto Sans CJK SC', sans-serif",fontSize:14,fontWeight:400,color:"rgba(0, 0, 0, 0.85)",height:21,lineHeight:"21px"},gR={fontFamily:"'Noto Sans CJK SC', sans-serif",fontSize:14,fontWeight:400,borderRadius:4,color:"#333",height:36,width:"100%",paddingLeft:12,paddingRight:12,boxSizing:"border-box",outline:"none"};function yv({label:e,value:n,onChange:r,placeholder:l,required:o=!0,type:u="text",rightControl:c}){const[f,h]=x.useState(!1),m={...gR,background:f?"#FFFFFF":"#E6E6E6",border:f?"2px solid #3790FA":"2px solid transparent"};return s.jsxs("div",{className:"flex flex-col",style:{display:"flex",flexDirection:"column",height:61,padding:0},children:[s.jsxs("label",{style:pR,children:[e," ",o?s.jsx("span",{style:{color:"#F53F3F"},children:"*"}):null]}),c?s.jsxs("div",{className:"relative",style:{position:"relative",marginTop:4},children:[s.jsx("input",{type:u,value:n,onChange:y=>r(y.target.value),placeholder:l,className:"channel-input",style:{...m,paddingRight:36},onFocus:()=>h(!0),onBlur:()=>h(!1)}),c]}):s.jsx("input",{type:u,value:n,onChange:y=>r(y.target.value),placeholder:l,className:"channel-input",style:{...m,marginTop:4},onFocus:()=>h(!0),onBlur:()=>h(!1)})]})}function yR({label:e,value:n,onChange:r,placeholder:l,showSecret:o,onToggleSecret:u}){const c={width:16,height:16,color:"#999"};return s.jsx(yv,{label:e,value:n,onChange:r,placeholder:l,type:o?"text":"password",rightControl:s.jsx("button",{type:"button",onClick:u,className:"rounded hover:bg-gray-100 transition-colors",style:{position:"absolute",right:10,top:6,width:24,height:24,padding:2,border:"none",background:"transparent",cursor:"pointer"},children:o?s.jsx(Fg,{className:"w-4 h-4",style:c}):s.jsx(Bg,{className:"w-4 h-4",style:c})})})}function bR(){return s.jsx("svg",{className:"w-4 h-4 animate-spin",viewBox:"0 0 50 50",fill:"none",style:{width:16,height:16},children:s.jsx("circle",{cx:"25",cy:"25",r:"20",stroke:"#fff",strokeWidth:"4",strokeLinecap:"round",strokeDasharray:"90 200"})})}function xR({cancelLabel:e,submitLabel:n,onCancel:r,onSubmit:l,submitting:o,canSubmit:u,compact:c=!1}){const[f,h]=x.useState(!1),[m,y]=x.useState(!1),[g,_]=x.useState(!1),[v,w]=x.useState(!1),j={fontFamily:"'Noto Sans CJK SC', sans-serif",fontSize:14,fontWeight:400,borderRadius:6,border:"none"},T=c?{width:64,height:36,padding:0}:{padding:"8px 20px"},C=o||!u,E=m?lR:f?rR:aR,N=v?sR:g?oR:iR;return s.jsxs("div",{className:"flex items-end justify-end",style:{display:"flex",alignItems:"flex-end",justifyContent:"flex-end",height:52,padding:0},children:[s.jsx("button",{onClick:r,disabled:o,style:{...j,...T,background:E,color:"rgba(0, 0, 0, 0.85)",cursor:o?"not-allowed":"pointer",marginRight:c?8:12,transition:"background 0.15s ease"},onMouseEnter:()=>{o||h(!0)},onMouseLeave:()=>{h(!1),y(!1)},onMouseDown:D=>{!o&&D.button===0&&y(!0)},onMouseUp:D=>{!o&&D.button===0&&y(!1)},onBlur:()=>{h(!1),y(!1)},children:e}),s.jsxs("button",{onClick:l,disabled:C,className:"inline-flex items-center justify-center transition-all disabled:opacity-50",style:{...j,...T,display:"inline-flex",alignItems:"center",justifyContent:"center",background:N,color:"#FFFFFF",cursor:C?"not-allowed":"pointer",transition:"background 0.15s ease"},onMouseEnter:()=>{C||_(!0)},onMouseLeave:()=>{_(!1),w(!1)},onMouseDown:D=>{!C&&D.button===0&&w(!0)},onMouseUp:D=>{!C&&D.button===0&&w(!1)},onBlur:()=>{_(!1),w(!1)},children:[o?s.jsx("span",{style:{display:"inline-flex",marginRight:8},children:s.jsx(bR,{})}):null,n]})]})}function wc({primary:e,secret:n,showSecret:r,onToggleSecret:l,cancelLabel:o,submitLabel:u,onCancel:c,onSubmit:f,submitting:h,canSubmit:m,compactActions:y=!1}){return s.jsxs("div",{className:"w-full flex flex-col",style:{width:"100%",display:"flex",flexDirection:"column"},children:[s.jsx("div",{style:{marginBottom:16},children:s.jsx(yv,{...e})}),s.jsx("div",{style:{marginBottom:16},children:s.jsx(yR,{...n,showSecret:r,onToggleSecret:l})}),s.jsx(xR,{cancelLabel:o,submitLabel:u,onCancel:c,onSubmit:f,submitting:h,canSubmit:m,compact:y})]})}const vR=480,_R=32,wR=384,kR=16,vh=48;function SR(e,n,r){return Math.min(r,Math.max(n,e))}function bv(e,n=vR){return!Number.isFinite(e)||e<=0?n:Math.max(0,Math.min(n,e-_R))}function xv(e){return!Number.isFinite(e)||e<=0?vh:SR((e-wR)/2,kR,vh)}function vv(){return{position:"fixed",top:0,right:0,bottom:0,left:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",padding:16,background:"transparent"}}function _v(e){return{position:"relative",top:-38,marginLeft:-28,width:424,maxWidth:"calc(100vw - 32px)",height:e,overflowY:"auto",borderRadius:8,border:"1px solid #e8e8e8",boxShadow:"0 4px 16px rgba(0,0,0,0.12)",paddingLeft:24,paddingRight:24,background:"#FFFFFF"}}function vo(e){return{display:"flex",flexDirection:"column",alignItems:"center",fontFamily:"'Noto Sans CJK SC', sans-serif",paddingTop:e!=null?e:vh}}function CR(){if(typeof document>"u")return!1;try{return document.documentElement.classList.contains("kybot-embedded-qt-webengine")}catch{return!1}}function kc(e){const n=CR()?150:0;return window.setTimeout(e,n)}const jR=2e3;function ER({onBindSuccess:e,contentPaddingTop:n}){const{t:r}=qa(),[l,o]=x.useState("loading"),[u,c]=x.useState(null),[f,h]=x.useState(null),[m,y]=x.useState(null),[g,_]=x.useState(!1),[v,w]=x.useState(!1),j=x.useRef(null),T=x.useRef(null),C=x.useRef(""),E=x.useCallback(()=>{T.current&&(clearInterval(T.current),T.current=null),C.current=""},[]),N=x.useCallback(async A=>{const U=j.current;if(U){w(!1);try{await yc.toCanvas(U,A,{width:160,margin:2,color:{dark:"#000000",light:"#ffffff"}}),w(!0)}catch(I){console.error("Failed to render QR code:",I)}}},[]);x.useEffect(()=>{if(!u||!(l==="waiting_scan"||l==="scanned"))return;const A=u.qrcode_img_url||u.qrcode,U=kc(()=>{N(A)});return()=>window.clearTimeout(U)},[u,l,N]);const D=x.useCallback(A=>{E(),C.current=A,T.current=setInterval(async()=>{if(C.current===A)try{const U=await M4(A);if(C.current!==A)return;switch(U.status){case"scaned":o(I=>I==="scanned"?I:"scanned");break;case"confirmed":E(),h(U),o("confirmed"),e==null||e();break;case"expired":E(),o("expired");break;default:o(I=>I==="scanned"||I==="waiting_scan"?I:"waiting_scan")}}catch(U){console.warn("WeChat status poll error:",U)}},jR)},[E]),F=x.useCallback(async()=>{E(),o("loading"),y(null),_(!1),h(null),w(!1);try{const A=await A4();c(A),o("waiting_scan"),D(A.qrcode)}catch(A){o("error"),_(!0),y(A instanceof Error?A.message:String(A))}},[E,D]);x.useEffect(()=>(F(),()=>{E()}),[]);const M=l==="error"&&g;return s.jsxs("div",{style:vo(n),children:[s.jsx(bo,{icon:"wechat.svg",alt:"WeChat",title:r("channel.wechat"),description:r("channel.wechat.desc")}),s.jsx(xo,{message:m,visible:!M}),(l==="loading"||l==="waiting_scan"||l==="scanned"||l==="expired"||l==="confirmed"||M)&&s.jsxs(s.Fragment,{children:[s.jsx("p",{style:{fontFamily:"'Noto Sans CJK SC', sans-serif",fontSize:14,fontWeight:700,color:"rgba(0, 0, 0, 0.85)",marginTop:0,marginBottom:16},children:r("channel.scan_tip")}),s.jsx(vc,{canvasRef:j,placeholderSrc:`${$e}/images/channel-qr-placeholder.png`,phase:l,qrRendered:v,isQrFetchError:M,brandColor:"#1890ff",onRefresh:F,refreshLabel:r("channel.refresh_qr"),fetchFailedLabel:r("channel.qr_fetch_failed"),bindSuccessLabel:r("channel.bind_success"),confirmedFontSize:10,statusContent:l==="scanned"?s.jsx(gv,{label:r("channel.scanned_confirm")}):l==="expired"?s.jsx(xc,{label:r("channel.qr_expired")}):l==="confirmed"?s.jsxs("span",{style:{fontSize:14,color:"rgba(0,0,0,0.45)"},children:["Bot ID: ",(f==null?void 0:f.ilink_bot_id)||"-"]}):null})]})]})}const NR=3e3,TR=12e4;function AR({onBindSuccess:e,onClose:n,contentPaddingTop:r}){const{t:l}=qa(),[o,u]=x.useState("qrcode"),[c,f]=x.useState("loading"),[h,m]=x.useState(null),[y,g]=x.useState(null),[_,v]=x.useState(!1),[w,j]=x.useState(!1),[T,C]=x.useState(""),[E,N]=x.useState(""),[D,F]=x.useState(!1),[M,A]=x.useState(!1),U=x.useRef(null),I=x.useRef(null),L=x.useRef(""),B=x.useRef(null),q=x.useCallback(()=>{I.current&&(clearInterval(I.current),I.current=null),B.current&&(clearTimeout(B.current),B.current=null),L.current=""},[]),K=x.useCallback(async O=>{const H=U.current;if(H){j(!1);try{await yc.toCanvas(H,O,{width:160,margin:2,color:{dark:"#000000",light:"#ffffff"}}),j(!0)}catch(Z){console.error("Failed to render QR code:",Z)}}},[]);x.useEffect(()=>{if(!h||!(c==="waiting_scan"||c==="confirmed"))return;const O=kc(()=>{K(h)});return()=>window.clearTimeout(O)},[h,c,K]);const G=x.useCallback(O=>{q(),L.current=O,I.current=setInterval(async()=>{if(L.current===O)try{const H=await I4(O);if(L.current!==O)return;if(H.status==="success"&&H.bot_id&&H.secret){q(),f("confirmed"),e==null||e();return}H.status==="expired"&&(q(),f("expired"))}catch(H){console.warn("WeCom status poll error:",H)}},NR)},[q]),ne=x.useCallback(async()=>{q(),f("loading"),g(null),v(!1),j(!1);try{const O=await F4();m(O.auth_url),f("waiting_scan"),G(O.scode),B.current=setTimeout(()=>{L.current===O.scode&&(q(),f("expired"))},TR)}catch(O){f("error"),v(!0),g(O instanceof Error?O.message:String(O))}},[q,G]);x.useEffect(()=>(o==="qrcode"&&ne(),()=>{q()}),[o]);const V=O=>{u(O),O==="manual"?(q(),f("loading"),g(null),v(!1),C(""),N(""),setTimeout(()=>f("loading"),100)):ne()},le=async()=>{if(!T.trim()||!E.trim()){v(!1),g(l("channel.wecom.fill_required"));return}A(!0),g(null),v(!1);try{await U4(T.trim(),E.trim()),f("confirmed"),e==null||e()}catch(O){f("error"),g(O instanceof Error?O.message:String(O))}finally{A(!1)}},me=()=>{C(""),N(""),F(!1),g(null),v(!1),n==null||n()},ce=c==="error"&&_;return s.jsxs("div",{style:vo(r),children:[s.jsx(bo,{icon:"wecom.svg",alt:"WeCom",title:l("channel.wecom"),description:l("channel.wecom.desc")}),s.jsx(xh,{value:o,options:[{value:"qrcode",label:l("channel.scan_connect")},{value:"manual",label:l("channel.websocket_connect")}],onChange:O=>V(O),visible:c!=="error"||o==="manual"||ce}),s.jsx(xo,{message:y,visible:!ce}),o==="manual"&&s.jsx(s.Fragment,{children:c==="confirmed"?s.jsx(_c,{label:l("channel.bind_success")}):s.jsx(wc,{primary:{label:"Bot ID",value:T,onChange:C,placeholder:l("channel.wecom.bot_id_placeholder")},secret:{label:"Secret",value:E,onChange:N,placeholder:l("channel.wecom.secret_placeholder")},showSecret:D,onToggleSecret:()=>F(!D),cancelLabel:l("channel.cancel"),submitLabel:l("channel.connect"),onCancel:me,onSubmit:le,submitting:M,canSubmit:!!(!M&&T.trim()&&E.trim())})}),o==="qrcode"&&s.jsx(s.Fragment,{children:(c==="loading"||c==="waiting_scan"||c==="expired"||c==="confirmed"||ce)&&s.jsx(vc,{canvasRef:U,phase:c,qrRendered:w,isQrFetchError:ce,placeholderSrc:`${$e}/images/channel-qr-placeholder.png`,brandColor:"#1890ff",onRefresh:ne,refreshLabel:l("channel.refresh_qr"),fetchFailedLabel:l("channel.qr_fetch_failed"),bindSuccessLabel:l("channel.bind_success"),statusContent:c==="expired"?s.jsx(xc,{label:l("channel.qr_expired")}):null})})]})}const MR=2e3;function RR({onBindSuccess:e,onClose:n,contentPaddingTop:r}){const{t:l}=qa(),[o,u]=x.useState("qrcode"),[c,f]=x.useState("loading"),[h,m]=x.useState(null),[y,g]=x.useState(null),[_,v]=x.useState(!1),[w,j]=x.useState(!1),[T,C]=x.useState(""),[E,N]=x.useState(""),[D,F]=x.useState(!1),[M,A]=x.useState(!1),U=x.useRef(null),I=x.useRef(null),L=x.useRef(""),B=x.useCallback(()=>{I.current&&(clearInterval(I.current),I.current=null),L.current=""},[]),q=x.useCallback(async ce=>{const O=U.current;if(O){j(!1);try{await yc.toCanvas(O,ce,{width:160,margin:2,color:{dark:"#000000",light:"#ffffff"}}),j(!0)}catch(H){console.error("Failed to render QR code:",H)}}},[]);x.useEffect(()=>{if(!h||!(c==="waiting_scan"||c==="confirmed"))return;const ce=kc(()=>{q(h)});return()=>window.clearTimeout(ce)},[h,c,q]);const K=x.useCallback(ce=>{B(),L.current=ce,I.current=setInterval(async()=>{if(L.current===ce)try{const O=await O4(ce);if(L.current!==ce)return;if(O.client_id&&O.client_secret){B(),f("confirmed"),e==null||e();return}switch(O.status){case"WAITING":break;case"FAIL":B(),v(!1),g(O.fail_reason||l("channel.dingtalk.auth_failed")),f("error");break;case"EXPIRED":B(),f("expired");break;default:O.error&&console.warn("DingTalk poll error:",O.error)}}catch(O){console.warn("DingTalk status poll error:",O)}},MR)},[B]),G=x.useCallback(async()=>{B(),f("loading"),g(null),v(!1),j(!1);try{const ce=await z4();m(ce.verification_uri_complete),f("waiting_scan"),K(ce.device_code)}catch(ce){f("error"),v(!0),g(ce instanceof Error?ce.message:String(ce))}},[B,K]);x.useEffect(()=>(o==="qrcode"&&G(),()=>{B()}),[o]);const ne=ce=>{u(ce),ce==="stream"?(B(),f("loading"),g(null),v(!1),C(""),N(""),setTimeout(()=>f("ws_success"),100)):G()},V=async()=>{if(!T.trim()||!E.trim()){v(!1),g(l("channel.dingtalk.fill_required"));return}A(!0),g(null),v(!1);try{await B4(T.trim(),E.trim()),f("confirmed"),e==null||e()}catch(ce){f("error"),g(ce instanceof Error?ce.message:String(ce))}finally{A(!1)}},le=()=>{C(""),N(""),F(!1),g(null),v(!1),n==null||n()},me=c==="error"&&_;return s.jsxs("div",{style:vo(r),children:[s.jsx(bo,{icon:"dingtalk.svg",alt:"DingTalk",title:l("channel.dingtalk"),description:l("channel.dingtalk.desc")}),s.jsx(xh,{value:o,options:[{value:"qrcode",label:l("channel.scan_connect")},{value:"stream",label:l("channel.stream_connect")}],onChange:ce=>ne(ce),visible:c!=="error"||o==="stream"||me}),s.jsx(xo,{message:y,visible:!me}),o==="stream"&&s.jsx(s.Fragment,{children:c==="confirmed"?s.jsx(_c,{label:l("channel.bind_success")}):s.jsx(wc,{primary:{label:"Client ID",value:T,onChange:C,placeholder:l("channel.dingtalk.client_id_placeholder")},secret:{label:"Client Secret",value:E,onChange:N,placeholder:l("channel.dingtalk.client_secret_placeholder")},showSecret:D,onToggleSecret:()=>F(!D),cancelLabel:l("channel.cancel"),submitLabel:l("channel.connect"),onCancel:le,onSubmit:V,submitting:M,canSubmit:!!(!M&&T.trim()&&E.trim())})}),o==="qrcode"&&s.jsx(s.Fragment,{children:(c==="loading"||c==="waiting_scan"||c==="expired"||c==="confirmed"||me)&&s.jsx(vc,{canvasRef:U,phase:c,qrRendered:w,isQrFetchError:me,placeholderSrc:`${$e}/images/channel-qr-placeholder.png`,brandColor:"#1890ff",onRefresh:G,refreshLabel:l("channel.refresh_qr"),fetchFailedLabel:l("channel.qr_fetch_failed"),bindSuccessLabel:l("channel.bind_success"),statusContent:c==="expired"?s.jsx(xc,{label:l("channel.qr_expired")}):null})})]})}const DR=2e3;function LR({onBindSuccess:e,onClose:n,contentPaddingTop:r}){const{t:l}=qa(),[o,u]=x.useState("qrcode"),[c,f]=x.useState("loading"),[h,m]=x.useState(null),[y,g]=x.useState(null),[_,v]=x.useState(!1),[w,j]=x.useState(!1),[T,C]=x.useState(""),[E,N]=x.useState(""),[D,F]=x.useState(!1),[M,A]=x.useState(!1),U=x.useRef(null),I=x.useRef(null),L=x.useRef(""),B=x.useCallback(()=>{I.current&&(clearInterval(I.current),I.current=null),L.current=""},[]),q=x.useCallback(async ce=>{const O=U.current;if(O){j(!1);try{await yc.toCanvas(O,ce,{width:160,margin:2,color:{dark:"#000000",light:"#ffffff"}}),j(!0)}catch(H){console.error("Failed to render QR code:",H)}}},[]);x.useEffect(()=>{if(!h||!(c==="waiting_scan"||c==="scanned"))return;const ce=kc(()=>{q(h)});return()=>window.clearTimeout(ce)},[h,c,q]);const K=x.useCallback(ce=>{B(),L.current=ce,I.current=setInterval(async()=>{if(L.current===ce)try{const O=await D4(ce);if(L.current!==ce)return;if(O.client_id&&O.client_secret){B(),f("confirmed"),e==null||e();return}switch(O.error){case"authorization_pending":case void 0:break;case"slow_down":console.log("Server requested slower polling");break;case"access_denied":B(),v(!1),g(O.error_description||l("channel.feishu.access_denied")),f("error");break;case"expired_token":B(),f("expired");break;default:O.error&&console.warn("Feishu poll error:",O.error,O.error_description)}}catch(O){console.warn("Feishu status poll error:",O)}},DR)},[B]),G=x.useCallback(async()=>{B(),f("loading"),g(null),v(!1),j(!1);try{const ce=await R4();m(ce.verification_uri_complete),f("waiting_scan"),K(ce.device_code)}catch(ce){f("error"),v(!0),g(ce instanceof Error?ce.message:String(ce))}},[B,K]);x.useEffect(()=>(o==="qrcode"&&G(),()=>{B()}),[o]);const ne=ce=>{u(ce),ce==="websocket"?(B(),f("loading"),g(null),v(!1),C(""),N(""),setTimeout(()=>f("ws_success"),100)):G()},V=async()=>{if(!T.trim()||!E.trim()){v(!1),g(l("channel.feishu.fill_required"));return}A(!0),g(null),v(!1);try{await L4(T.trim(),E.trim()),f("confirmed"),e==null||e()}catch(ce){f("error"),g(ce instanceof Error?ce.message:String(ce))}finally{A(!1)}},le=()=>{C(""),N(""),F(!1),g(null),v(!1),n==null||n()},me=c==="error"&&_;return s.jsxs("div",{style:vo(r),children:[s.jsx(bo,{icon:"feishu.svg",alt:"Feishu",title:l("channel.feishu"),description:l("channel.feishu.desc")}),s.jsx(xh,{value:o,options:[{value:"qrcode",label:l("channel.scan_connect")},{value:"websocket",label:l("channel.websocket_connect")}],onChange:ce=>ne(ce),visible:c!=="error"||o==="websocket"||me}),s.jsx(xo,{message:y,visible:!me}),o==="websocket"&&s.jsx(s.Fragment,{children:c==="confirmed"?s.jsx(_c,{label:l("channel.bind_success")}):s.jsx(wc,{primary:{label:"App ID",value:T,onChange:C,placeholder:l("channel.feishu.app_id_placeholder")},secret:{label:"App Secret",value:E,onChange:N,placeholder:l("channel.feishu.app_secret_placeholder")},showSecret:D,onToggleSecret:()=>F(!D),cancelLabel:l("channel.cancel"),submitLabel:l("channel.connect"),onCancel:le,onSubmit:V,submitting:M,canSubmit:!!(!M&&T.trim()&&E.trim())})}),o==="qrcode"&&s.jsx(s.Fragment,{children:(c==="loading"||c==="waiting_scan"||c==="scanned"||c==="expired"||c==="confirmed"||me)&&s.jsx(vc,{canvasRef:U,phase:c,qrRendered:w,isQrFetchError:me,placeholderSrc:`${$e}/images/channel-qr-placeholder.png`,brandColor:"#1890ff",onRefresh:G,refreshLabel:l("channel.refresh_qr"),fetchFailedLabel:l("channel.qr_fetch_failed"),bindSuccessLabel:l("channel.bind_success"),confirmedFontSize:10,statusContent:c==="scanned"?s.jsx(gv,{label:l("channel.scanned_confirm")}):c==="expired"?s.jsx(xc,{label:l("channel.qr_expired")}):null})})]})}function zR({onBindSuccess:e,onClose:n,contentPaddingTop:r}){const{t:l}=qa(),[o,u]=x.useState("editing"),[c,f]=x.useState(""),[h,m]=x.useState(""),[y]=x.useState(H4),[g,_]=x.useState(!1),[v,w]=x.useState(!1),[j,T]=x.useState(null),C=async()=>{if(!c.trim()||!h.trim()){T(l("channel.lansenger.fill_required")),u("error");return}w(!0),T(null);try{await P4(c.trim(),h.trim(),y.trim()),u("confirmed"),e==null||e()}catch(D){u("error"),T(D instanceof Error?D.message:String(D))}finally{w(!1)}},E=()=>{f(""),m(""),_(!1),T(null),u("editing"),n==null||n()},N=!!(c.trim()&&h.trim()&&!v);return s.jsxs("div",{style:vo(r),children:[s.jsx(bo,{icon:"lansenger.svg",alt:"Lansenger",title:l("channel.lansenger"),description:l("channel.lansenger.desc"),descriptionMaxWidth:376}),s.jsx(xo,{message:j}),o==="confirmed"?s.jsx(_c,{label:l("channel.bind_success")}):s.jsx(wc,{primary:{label:"App ID",value:c,onChange:D=>{f(D),T(null),u("editing")},placeholder:l("channel.lansenger.app_id_placeholder")},secret:{label:"App Secret",value:h,onChange:D=>{m(D),T(null),u("editing")},placeholder:l("channel.lansenger.app_secret_placeholder")},showSecret:g,onToggleSecret:()=>_(!g),cancelLabel:l("channel.cancel"),submitLabel:l("channel.connect"),onCancel:E,onSubmit:C,submitting:v,canSubmit:N,compactActions:!0})]})}const _h="#E5E5E5",wh="#D9D9D9",wv="#CCCCCC",OR="#F53F3F",BR="#D93030",FR="#B82020",IR=298,UR=1e3,HR=12,qR=18;function PR({tooltip:e}){return e?s.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:e.left,top:e.top,padding:"7px 5px",background:"#ffffff",border:"1px solid #e8e8e8",borderRadius:6,fontFamily:"'Noto Sans CJK SC', sans-serif",fontSize:12,fontWeight:400,lineHeight:"18px",color:"#374151",whiteSpace:"nowrap",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.1)",pointerEvents:"none",zIndex:100},children:e.label}):null}function kv({label:e,onClose:n,tooltipHandlers:r}){const l=x.useRef(null),o=x.useRef({clientX:0,clientY:0}),u=x.useRef(!1),c=x.useCallback(()=>{l.current!==null&&(window.clearTimeout(l.current),l.current=null)},[]),f=(y,g)=>{o.current={clientX:y,clientY:g}},h=x.useCallback(()=>{c(),u.current=!1,r.hide()},[c,r]),m=x.useCallback(()=>{c(),u.current=!1,r.hide(),l.current=window.setTimeout(()=>{l.current=null,u.current=!0,r.show(e,o.current.clientX,o.current.clientY)},UR)},[c,e,r]);return x.useEffect(()=>h,[h]),s.jsx("button",{type:"button",onClick:()=>{h(),n()},"aria-label":e,className:"skill-dialog-close-btn absolute z-10",style:{top:4,right:4},onMouseEnter:y=>{f(y.clientX,y.clientY),m()},onMouseMove:y=>{!u.current&&l.current!==null&&f(y.clientX,y.clientY)},onMouseLeave:()=>{h()},onBlur:()=>{h()},children:s.jsx(ma,{size:16,"aria-hidden":"true"})})}function $R({channel:e,onClose:n,onBindSuccess:r,closeTooltipHandlers:l}){const{t:o}=qa(),u=o("common.close"),c=e==="lansenger"?446:void 0,[f,h]=x.useState(()=>bv(typeof window>"u"?0:window.innerHeight,c)),[m,y]=x.useState(()=>xv(typeof window>"u"?0:window.innerHeight));return x.useEffect(()=>{const g=()=>{h(bv(window.innerHeight,c)),y(xv(window.innerHeight))};return g(),window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[c]),s.jsx("div",{className:"animate-fade-in",style:vv(),children:s.jsxs("div",{className:"animate-fade-in-scale",style:_v(f),children:[s.jsx(kv,{label:u,onClose:n,tooltipHandlers:l}),e==="wechat"&&s.jsx(ER,{onBindSuccess:r,contentPaddingTop:m}),e==="wecom"&&s.jsx(AR,{onBindSuccess:r,onClose:n,contentPaddingTop:m}),e==="dingtalk"&&s.jsx(RR,{onBindSuccess:r,onClose:n,contentPaddingTop:m}),e==="feishu"&&s.jsx(LR,{onBindSuccess:r,onClose:n,contentPaddingTop:m}),e==="lansenger"&&s.jsx(zR,{onBindSuccess:r,onClose:n,contentPaddingTop:m})]})})}function YR({channel:e,onClose:n,onDisconnected:r,closeTooltipHandlers:l}){var F,M;const[o,u]=x.useState(null),[c,f]=x.useState(!1),[h,m]=x.useState(!1),[y,g]=x.useState(!1),[_,v]=x.useState(!1),[w,j]=x.useState(!1),{t:T}=qa(),C=T("common.close"),E=y?wv:h?wh:_h,N=c?"rgba(245, 63, 63, 0.5)":w?FR:_?BR:OR;x.useEffect(()=>{Y4(e.key).then(u).catch(()=>{})},[e.key]);const D=async()=>{if(!c){f(!0);try{await G4(e.key),r()}catch{f(!1)}}};return s.jsx("div",{className:"animate-fade-in",style:vv(),children:s.jsxs("div",{className:"animate-fade-in-scale",style:{..._v(IR),display:"flex",flexDirection:"column",overflowY:"hidden"},children:[s.jsx(kv,{label:C,onClose:n,tooltipHandlers:l}),s.jsxs("div",{className:"flex flex-col items-center",style:{display:"flex",flexDirection:"column",alignItems:"center",paddingTop:32},children:[s.jsx("img",{src:`${$e}/icons/${e.icon}`,alt:e.name,width:"64",height:"64",style:{borderRadius:16}}),s.jsxs("h2",{style:{fontFamily:"'Noto Sans CJK SC', sans-serif",fontSize:20,fontWeight:500,color:"#000000",margin:0,marginTop:16},children:[e.name," ",T("channel.connected")]}),s.jsxs("div",{className:"flex flex-col items-center",style:{display:"flex",flexDirection:"column",alignItems:"center",marginTop:20},children:[s.jsxs("span",{style:{fontFamily:"'Noto Sans CJK SC', sans-serif",fontSize:14,fontWeight:400,color:"rgba(0, 0, 0, 0.85)",marginBottom:4},children:[e.name," ",(F=o==null?void 0:o.label)!=null?F:T("channel.bot_id"),"："]}),s.jsx("span",{style:{fontFamily:"'Noto Sans CJK SC', sans-serif",fontSize:14,fontWeight:400,color:"rgba(0, 0, 0, 0.85)"},children:(M=o==null?void 0:o.value)!=null?M:"—"})]})]}),s.jsxs("div",{className:"flex items-center justify-end",style:{display:"flex",alignItems:"center",justifyContent:"flex-end",marginTop:"auto",paddingBottom:24},children:[s.jsx("button",{onClick:n,style:{fontFamily:"'Noto Sans CJK SC', sans-serif",fontSize:14,fontWeight:400,minWidth:88,padding:"8px 16px",borderRadius:6,background:E,color:"rgba(0, 0, 0, 0.85)",border:"none",cursor:"pointer",whiteSpace:"nowrap",marginRight:12,transition:"background 0.15s ease"},onMouseEnter:()=>m(!0),onMouseLeave:()=>{m(!1),g(!1)},onMouseDown:A=>{A.button===0&&g(!0)},onMouseUp:A=>{A.button===0&&g(!1)},onBlur:()=>{m(!1),g(!1)},children:T("channel.confirm")}),s.jsx("button",{onClick:D,disabled:c,style:{fontFamily:"'Noto Sans CJK SC', sans-serif",fontSize:14,fontWeight:400,minWidth:88,padding:"8px 16px",borderRadius:6,background:N,color:"#FFFFFF",border:"none",cursor:c?"not-allowed":"pointer",whiteSpace:"nowrap",transition:"background 0.15s ease"},onMouseEnter:()=>{c||v(!0)},onMouseLeave:()=>{v(!1),j(!1)},onMouseDown:A=>{!c&&A.button===0&&j(!0)},onMouseUp:A=>{!c&&A.button===0&&j(!1)},onBlur:()=>{v(!1),j(!1)},children:T(c?"channel.disconnecting":"channel.disconnect")})]})]})})}const Sv={WeChat:"wechat",WeCom:"wecom",DingTalk:"dingtalk",Feishu:"feishu",Lansenger:"lansenger"};function GR(e){return e.ctrlKey||e.metaKey}function KR(e){return!e.ctrlKey&&!e.metaKey?!1:["+","=","-","_","0"].includes(e.key)||["NumpadAdd","NumpadSubtract","Numpad0"].includes(e.code)}function VR(e){return e.touches.length>1}function QR(){x.useEffect(()=>{var c;try{if(typeof document<"u"&&document.documentElement.classList.contains("kybot-embedded-qt-webengine"))return}catch{}const e=document.querySelector('meta[name="viewport"]'),n=(c=e==null?void 0:e.getAttribute("content"))!=null?c:null;e==null||e.setAttribute("content","width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no");const r=f=>{f.preventDefault()},l=f=>{GR(f)&&f.preventDefault()},o=f=>{KR(f)&&f.preventDefault()},u=f=>{VR(f)&&f.preventDefault()};return document.addEventListener("contextmenu",r),document.addEventListener("wheel",l,{passive:!1}),document.addEventListener("keydown",o),document.addEventListener("touchmove",u,{passive:!1}),document.addEventListener("gesturestart",r),document.addEventListener("gesturechange",r),document.addEventListener("gestureend",r),()=>{document.removeEventListener("contextmenu",r),document.removeEventListener("wheel",l),document.removeEventListener("keydown",o),document.removeEventListener("touchmove",u),document.removeEventListener("gesturestart",r),document.removeEventListener("gesturechange",r),document.removeEventListener("gestureend",r),e&&(n===null?e.removeAttribute("content"):e.setAttribute("content",n))}},[])}function WR(){const{t:e}=qa();QR();const n=x.useRef(null),[r,l]=x.useState(null),[o,u]=x.useState(null),[c,f]=x.useState(null),h=[{name:e("channel.wechat"),icon:"wechat.svg",key:"wechat",description:e("channel.wechat.desc")},{name:e("channel.wecom"),icon:"wecom.svg",key:"wecom",description:e("channel.wecom.desc")},{name:e("channel.dingtalk"),icon:"dingtalk.svg",key:"dingtalk",description:e("channel.dingtalk.desc")},{name:e("channel.feishu"),icon:"feishu.svg",key:"feishu",description:e("channel.feishu.desc")},{name:e("channel.lansenger"),icon:"lansenger.svg",key:"lansenger",description:e("channel.lansenger.desc")}],m=E=>({status:E?"connected":"unconfigured"}),y={wechat:e("channel.wechat.connected"),wecom:e("channel.wecom.connected"),dingtalk:e("channel.dingtalk.connected"),feishu:e("channel.feishu.connected"),lansenger:e("channel.lansenger.connected")},g={wechat:e("channel.wechat.disconnected"),wecom:e("channel.wecom.disconnected"),dingtalk:e("channel.dingtalk.disconnected"),feishu:e("channel.feishu.disconnected"),lansenger:e("channel.lansenger.disconnected")},[_,v]=x.useState(h.map(E=>({...E,status:"unconfigured"}))),w=x.useCallback((E,N,D)=>{var M,A,U;const F=(M=n.current)==null?void 0:M.getBoundingClientRect();f({label:E,left:N-((A=F==null?void 0:F.left)!=null?A:0)+HR,top:D-((U=F==null?void 0:F.top)!=null?U:0)+qR})},[]),j=x.useCallback(()=>{f(null)},[]),T=x.useMemo(()=>({show:w,hide:j}),[j,w]),C=x.useCallback(()=>{Ls().then(E=>{const N={wechat:!1,wecom:!1,dingtalk:!1,feishu:!1,lansenger:!1};for(const[D,F]of Object.entries(E.channels)){const M=Sv[D];M&&(N[M]=F)}v(D=>D.map(F=>({...F,...m(N[F.key])})))}).catch(()=>{})},[Sv]);return x.useEffect(()=>{C()},[C]),s.jsxs("div",{ref:n,className:"pr-6 pb-6 pl-6 animate-fade-in",style:{position:"relative",paddingTop:10,paddingRight:24,paddingBottom:24,paddingLeft:24,background:"#FFFFFF",minHeight:"100vh"},children:[s.jsx("h2",{className:"mb-2",style:{margin:0,fontSize:14,fontWeight:500,color:"rgba(0, 0, 0, 0.85)",marginLeft:8,marginBottom:8},children:e("channel.title")}),s.jsx("div",{className:"grid grid-cols-2 gap-x-2 gap-y-2 stagger-children",children:_.map(E=>{const N={background:"#F6F6F6",borderRadius:8,paddingLeft:20,paddingRight:20,boxSizing:"border-box"};return s.jsxs("div",{className:"animate-slide-in-up flex items-center transition-all",style:{...N,height:89,display:"flex",alignItems:"center"},children:[s.jsx("img",{src:`${$e}/icons/${E.icon}`,alt:E.name,className:"h-8 w-8 shrink-0",style:{width:32,height:32,flexShrink:0,marginRight:16}}),s.jsxs("div",{className:"flex-1 min-w-0",style:{flex:"1 1 0%",minWidth:0,marginRight:16},children:[s.jsxs("div",{className:"flex items-center mb-0.5",style:{display:"flex",alignItems:"center",marginBottom:2},children:[s.jsx("span",{className:"text-sm",style:{color:"var(--pc-text-primary)",fontWeight:400},children:E.name}),E.status==="connected"?s.jsx("span",{className:"inline-flex items-center justify-center",style:{minWidth:44,height:20,padding:"0 8px",borderRadius:10,background:"rgba(0, 180, 42, 0.05)",fontSize:12,fontWeight:400,color:"#00B42A",whiteSpace:"nowrap",marginLeft:8},children:e("channel.connected")}):null]}),s.jsx("p",{className:"text-sm leading-relaxed line-clamp-2",style:{margin:0,color:"var(--pc-text-muted)"},children:E.description})]}),s.jsx("button",{onClick:()=>l(E.key),className:"shrink-0 rounded-lg text-sm font-medium transition-all flex items-center justify-center",style:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:64,height:36,padding:"0 14px",background:_h,border:"1px solid var(--pc-border)",color:"rgba(0, 0, 0, 0.85)",whiteSpace:"nowrap"},onMouseEnter:D=>{D.currentTarget.style.background=wh,D.currentTarget.style.borderColor="var(--pc-border-strong)"},onMouseLeave:D=>{D.currentTarget.style.background=_h,D.currentTarget.style.borderColor="var(--pc-border)"},onMouseDown:D=>{D.button===0&&(D.currentTarget.style.background=wv)},onMouseUp:D=>{D.button===0&&(D.currentTarget.style.background=wh)},children:e("channel.configure")})]},E.key)})}),r&&(()=>{const E=_.find(N=>N.key===r);return E?E.status==="connected"?s.jsx(YR,{channel:E,closeTooltipHandlers:T,onClose:()=>{l(null),C()},onDisconnected:()=>{l(null),u({text:g[E.key],channel:E.key}),C(),setTimeout(()=>u(null),3e3)}}):s.jsx($R,{channel:r,onClose:()=>{l(null),C()},onBindSuccess:()=>{l(null),u({text:y[r],channel:r}),C(),setTimeout(()=>u(null),3e3)},closeTooltipHandlers:T}):null})(),s.jsx(PR,{tooltip:c}),o&&(()=>{const E=o.channel==="lansenger";return s.jsxs("div",{className:"flex items-center rounded-lg shadow-lg",style:{position:"fixed",display:"flex",alignItems:"center",left:"50%",top:"50%",transform:"translate(-50%, -50%)",marginTop:E?-40:0,marginLeft:E?-28:0,zIndex:100,padding:"18px 16px",borderRadius:8,background:"#FFFFFF",border:"1px solid rgba(0,0,0,0.08)",fontSize:14,color:"rgba(0,0,0,0.85)",fontWeight:500,animation:"channelToastFadeInScale 0.3s ease-out both"},children:[s.jsx("div",{style:{width:16,height:16,flexShrink:0,marginRight:8,display:"flex",alignItems:"center",justifyContent:"center"},children:s.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",style:{flexShrink:0},children:[s.jsx("circle",{cx:"8",cy:"8",r:"7",fill:"#4ade80"}),s.jsx("path",{d:"M4.5 8L7 10.5L11.5 5.5",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})]})}),s.jsx("span",{children:o.text})]})})()]})}function XR({onSearch:e,isLoading:n}){const[r,l]=x.useState(""),o=x.useRef(void 0);return x.useEffect(()=>(o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{e(r.trim())},300),()=>{o.current&&clearTimeout(o.current)}),[r,e]),s.jsxs("div",{className:"relative",children:[s.jsx(Bl,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4",style:{color:"rgba(0, 0, 0, 0.3)"}}),s.jsx("input",{type:"text",value:r,onChange:u=>l(u.target.value),placeholder:S("skillhub.search.placeholder"),className:"w-full pl-10 pr-10 py-2.5 text-sm rounded-lg outline-none transition-all placeholder:text-gray-400",style:{background:"#F5F5F7",border:"1px solid rgba(0, 0, 0, 0.06)",color:"rgba(0, 0, 0, 0.9)"},onFocus:u=>{u.currentTarget.style.borderColor="rgba(0, 122, 255, 0.5)",u.currentTarget.style.boxShadow="0 0 0 3px rgba(0, 122, 255, 0.1)"},onBlur:u=>{u.currentTarget.style.borderColor="rgba(0, 0, 0, 0.06)",u.currentTarget.style.boxShadow="none"}}),n&&s.jsx(Yn,{className:"absolute right-10 top-1/2 -translate-y-1/2 h-4 w-4 animate-spin",style:{color:"rgba(0, 0, 0, 0.3)"}}),r&&s.jsx("button",{onClick:()=>l(""),className:"absolute right-3 top-1/2 -translate-y-1/2 p-0.5 rounded transition-colors",style:{color:"rgba(0, 0, 0, 0.3)"},onMouseEnter:u=>{u.currentTarget.style.color="rgba(0, 0, 0, 0.6)"},onMouseLeave:u=>{u.currentTarget.style.color="rgba(0, 0, 0, 0.3)"},children:s.jsx(ma,{className:"h-4 w-4"})})]})}function JR(e){return"category"in e}function ZR(e){return e>=1e4?`${(e/1e4).toFixed(1)} 万`:e>=1e3?`${(e/1e3).toFixed(1)} 千`:String(e)}function eD({active:e,detail:n}){const[r,l]=x.useState(!1);x.useEffect(()=>{if(!e){l(!1);return}n&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{l(!0)})})},[e,n]);const o=n!==null;return s.jsx("div",{children:s.jsx("div",{style:{opacity:r&&e?1:0,transform:r&&e?"translateY(0)":"translateY(4px)",transition:"opacity 0.55s ease-out, transform 0.55s cubic-bezier(0.16, 1, 0.3, 1)",willChange:"opacity, transform"},children:o?s.jsx("div",{className:"pt-3 pb-4 px-4 space-y-4",style:{borderTop:"1px solid rgba(0,0,0,0.06)"},children:s.jsx(tD,{detail:n})}):s.jsx("div",{className:"py-6"})})})}function tD({detail:e}){const{skill:n,latestVersion:r,securityReports:l}=e,o=l.keen.status==="benign"||l.sanbu.status==="benign",u=(e.owner.displayName||e.owner.handle||"").trim(),c=n.source==="clawhub"?S("skillhub.detail.source_clawhub"):S("skillhub.detail.source").replace("{source}",n.source);return s.jsxs(s.Fragment,{children:[u&&s.jsx("div",{className:"inline-flex max-w-full items-center rounded-xl px-2.5 py-1 text-[12px] font-medium",title:S("skillhub.author").replace("{author}",u),"aria-label":S("skillhub.author").replace("{author}",u),style:{background:"rgba(0, 0, 0, 0.035)",color:"rgba(0, 0, 0, 0.55)"},children:s.jsx("span",{className:"truncate",children:S("skillhub.author").replace("{author}",u)})}),s.jsx("p",{className:"text-[13px] leading-relaxed",style:{color:"rgba(0,0,0,0.55)",letterSpacing:"-0.01em",whiteSpace:"pre-line"},children:n.summary_zh||n.summary}),s.jsx("div",{className:"flex items-stretch gap-3 py-1",children:[{label:c,sub:""},{label:`V ${r.version}`,sub:""},{label:S(o?"skillhub.detail.safe":"skillhub.detail.unsafe"),sub:"",safe:o},{label:ZR(n.stats.downloads),sub:S("skillhub.detail.downloads")},{label:`${n.stats.stars}`,sub:S("skillhub.detail.stars")}].map((f,h)=>s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1 py-2 rounded-lg",style:{background:"rgba(0,0,0,0.02)"},children:[h===2?s.jsx($g,{className:"h-4 w-4",style:{color:f.safe?"#52c41a":"rgba(0,0,0,0.25)"}}):h===1?s.jsx(_C,{className:"h-4 w-4",style:{color:"rgba(0,0,0,0.35)"}}):h===0?s.jsx("span",{className:"text-[11px]",style:{color:"rgba(0,0,0,0.25)"},children:"🏆"}):s.jsx("span",{className:"text-[11px]",style:{color:"rgba(0,0,0,0.25)"},children:h===3?"📥":"⭐"}),s.jsx("span",{className:"text-[13px] font-medium",style:{color:f.safe!==void 0&&f.safe?"#52c41a":"rgba(0,0,0,0.65)",letterSpacing:"-0.01em"},children:f.label}),f.sub&&s.jsx("span",{className:"text-[11px]",style:{color:"rgba(0,0,0,0.3)"},children:f.sub})]},h))}),o&&s.jsxs("div",{className:"rounded-xl p-3 space-y-2.5",style:{background:"rgba(82,196,26,0.04)",border:"1px solid rgba(82,196,26,0.12)"},children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx($g,{className:"h-4 w-4",style:{color:"#52c41a"}}),s.jsx("span",{className:"text-[13px] font-medium",style:{color:"#52c41a"},children:S("skillhub.detail.security_check")})]}),s.jsx("div",{className:"flex gap-3",children:[{lab:S("skillhub.detail.lab_keen"),report:l.keen},{lab:S("skillhub.detail.lab_sanbu"),report:l.sanbu}].map(({lab:f,report:h})=>s.jsxs("div",{className:"flex-1 flex items-center gap-2 rounded-lg px-3 py-2",style:{background:"white",boxShadow:"0 1px 3px rgba(0,0,0,0.04)"},children:[s.jsx("span",{className:"text-[13px] font-medium shrink-0",style:{color:"rgba(0,0,0,0.75)"},children:f}),s.jsxs("span",{className:"inline-flex items-center gap-1 text-[12px] px-1.5 py-0.5 rounded-full shrink-0",style:{background:h.status==="benign"?"rgba(82,196,26,0.1)":"rgba(250,173,20,0.1)",color:h.status==="benign"?"#52c41a":"#fa8c16",fontWeight:500},children:["● ",h.statusText]})]},f))}),s.jsx("p",{className:"text-[11px] leading-relaxed",style:{color:"rgba(0,0,0,0.3)",whiteSpace:"pre-line"},children:S("skillhub.detail.security_disclaimer")})]})]})}function nD(e){return e>=1e4?`${(e/1e4).toFixed(1)}万`:e>=1e3?`${(e/1e3).toFixed(1)}千`:String(e)}const Cv=["rgba(0, 122, 255, 0.1)","rgba(52, 199, 89, 0.1)","rgba(255, 149, 0, 0.1)","rgba(175, 82, 222, 0.1)","rgba(255, 45, 85, 0.1)","rgba(0, 199, 190, 0.1)","rgba(255, 204, 0, 0.1)","rgba(88, 86, 214, 0.1)","rgba(255, 59, 48, 0.1)","rgba(48, 209, 88, 0.1)"],jv=["rgba(0, 122, 255, 0.9)","rgba(52, 199, 89, 0.9)","rgba(255, 149, 0, 0.9)","rgba(175, 82, 222, 0.9)","rgba(255, 45, 85, 0.9)","rgba(0, 199, 190, 0.9)","rgba(204, 163, 0, 0.9)","rgba(88, 86, 214, 0.9)","rgba(255, 59, 48, 0.9)","rgba(48, 209, 88, 0.9)"];function aD(e){let n=0;for(let l=0;l<e.length;l++)n=e.charCodeAt(l)+((n<<5)-n);const r=Math.abs(n)%Cv.length;return Cv[r]}function rD(e){let n=0;for(let l=0;l<e.length;l++)n=e.charCodeAt(l)+((n<<5)-n);const r=Math.abs(n)%jv.length;return jv[r]}function Ev(e){return"author"in e}function Nv(e){return"installed_at"in e}function lD({skill:e,isInstalled:n,isInstalling:r,onInstall:l,isInstalledMode:o=!1,expanded:u=!1,onToggle:c,onUninstall:f,isUninstalling:h=!1,isRemoving:m=!1}){var U,I,L,B,q,K;const y=JR(e)?e:null,g=e.name||e.slug,_=(y==null?void 0:y.description_zh)||(Ev(e)?e.description:"")||(Nv(e)?`v${e.version} · ${e.source}`:""),v=(I=(U=y==null?void 0:y.downloads)!=null?U:e.downloads)!=null?I:0,w=(B=(L=y==null?void 0:y.stars)!=null?L:e.stars)!=null?B:0,j=(q=y==null?void 0:y.icon_url)!=null?q:null,T=Ev(e)?e.tags:[],C=Nv(e)&&(K=e.detail)!=null?K:null,[E,N]=x.useState(C),D=[S("skillhub.install"),S("skillhub.installing"),S("skillhub.installed"),S("skillhub.uninstall")],F=`${Math.max(...D.map(G=>G.length))+4}ch`,M=aD(e.slug),A=rD(e.slug);return x.useEffect(()=>{if(!u||E)return;let G=!1;return tM(e.slug).then(ne=>{G||N(ne)}).catch(()=>{}),()=>{G=!0}},[E,u,e.slug]),x.useEffect(()=>{N(C)},[C,e.slug]),s.jsx("div",{className:o?"skill-row-clip":"",children:s.jsxs("div",{className:`w-full rounded-xl overflow-hidden transition-[background-color,border-color,box-shadow] duration-200 ${o?"skill-installed-item":""} ${m?"removing":""}`,style:{background:u?"#FFFFFF":"transparent",border:"1px solid",borderColor:u?"rgba(0, 0, 0, 0.08)":"transparent",boxShadow:u?"0 1px 4px rgba(0,0,0,0.06)":"none"},children:[s.jsxs("div",{className:"flex items-center gap-3 w-full py-3 px-5 transition-all duration-200 hover:bg-[#F9F9F9] cursor-pointer",style:{borderRadius:u?0:void 0},onClick:()=>c==null?void 0:c(),children:[s.jsx("div",{className:"w-10 h-10 rounded-[8px] flex items-center justify-center shrink-0 font-bold text-[14px]",style:{background:M,color:A},children:j?s.jsx("img",{src:j,alt:"",className:"h-8 w-8 rounded object-cover",onError:G=>{G.currentTarget.style.display="none"}}):g.charAt(0).toUpperCase()}),s.jsxs("div",{className:"min-w-0 flex-1 flex flex-col gap-1",children:[s.jsx("span",{className:"text-[14px] font-medium truncate",style:{color:"rgba(0, 0, 0, 0.9)",letterSpacing:"-0.015em",lineHeight:"1.57em"},children:g}),s.jsxs("div",{className:"flex items-center gap-2",children:[T.length>0&&s.jsx("span",{className:"shrink-0 text-[10px] font-normal px-2 h-5 inline-flex items-center rounded-xl leading-none",style:{border:"1px solid rgba(0, 0, 0, 0.08)",color:"rgba(0, 0, 0, 0.4)"},children:T[0]}),!o&&s.jsxs(s.Fragment,{children:[w>0&&s.jsxs("span",{className:"inline-flex items-center gap-1 text-[12px] font-light tabular-nums",style:{color:"rgba(0, 0, 0, 0.4)",letterSpacing:"-0.015em",lineHeight:"1.67em"},children:[s.jsx(bC,{className:"h-3 w-3",style:{color:"rgba(0, 0, 0, 0.4)"}}),w]}),s.jsxs("span",{className:"inline-flex items-center gap-1 text-[12px] font-light tabular-nums",style:{color:"rgba(0, 0, 0, 0.4)",letterSpacing:"-0.015em",lineHeight:"1.67em"},children:[s.jsx(Og,{className:"h-3 w-3",style:{color:"rgba(0, 0, 0, 0.4)"}}),nD(v)]})]}),o&&_&&s.jsx("span",{className:"text-[12px] font-light truncate",style:{color:"rgba(0, 0, 0, 0.4)"},children:_})]})]}),s.jsx(ha,{className:"h-4 w-4 shrink-0 transition-transform duration-300 ease-out",style:{color:"rgba(0,0,0,0.25)",transform:u?"rotate(180deg)":"rotate(0deg)"}}),!o&&s.jsx("button",{onClick:G=>{G.stopPropagation(),l()},disabled:r||h||n,className:"px-3 py-1.5 rounded-md text-xs font-semibold transition-all shrink-0 inline-flex items-center justify-center gap-1.5 whitespace-nowrap",style:n?{width:F,background:"rgba(0, 230, 138, 0.08)",color:"var(--color-status-success)",border:"1px solid rgba(0, 230, 138, 0.2)",cursor:"default"}:r?{width:F,background:"var(--pc-accent)",color:"white",opacity:.7,cursor:"wait"}:{width:F,background:"var(--pc-accent)",color:"white",border:"none",cursor:"pointer"},children:r?s.jsxs(s.Fragment,{children:[s.jsx(Yn,{className:"h-3 w-3 animate-spin"}),S("skillhub.installing")]}):S(n?"skillhub.installed":"skillhub.install")}),o&&f&&s.jsxs("button",{onClick:G=>{G.stopPropagation(),f()},disabled:h||m,className:"px-3 py-1.5 rounded-md text-xs font-semibold transition-all shrink-0 inline-flex items-center justify-center gap-1.5 whitespace-nowrap",style:{width:F,color:"var(--color-status-error)",border:"1px solid rgba(239, 68, 68, 0.2)",background:"rgba(239, 68, 68, 0.06)",cursor:h||m?"wait":"pointer",opacity:h||m?.5:1},children:[h?s.jsx(Yn,{className:"h-3 w-3 animate-spin"}):s.jsx(Cs,{className:"h-3 w-3"}),S("skillhub.uninstall")]})]}),s.jsx("div",{className:`skill-detail-wrapper ${u?"expanded":""}`,children:s.jsx("div",{children:s.jsx(eD,{active:u,detail:E})})})]})})}const iD=10;function Tv({skills:e,installedSlugs:n,installingSlug:r,onInstall:l,isInstalledMode:o=!1,onUninstall:u,uninstallingSlug:c,removingSlug:f,pageSize:h}){const[m,y]=x.useState(new Set),[g,_]=x.useState(h!=null?h:1/0),v=x.useRef(null);x.useEffect(()=>{_(h!=null?h:1/0),y(new Set)},[e,h]);const w=x.useCallback(()=>{if(!h)return;const E=v.current;E&&E.scrollHeight-E.scrollTop-E.clientHeight<50&&_(N=>Math.min(N+iD,e.length))},[h,e.length]),j=E=>{y(N=>{const D=new Set(N);return D.has(E)?D.delete(E):D.add(E),D})};if(e.length===0)return s.jsx("div",{className:"p-8 text-center",style:{background:"#FFFFFF",border:"1px solid rgba(0, 0, 0, 0.08)",borderRadius:12},children:s.jsx("p",{style:{color:"rgba(0, 0, 0, 0.4)"},children:S(o?"skillhub.empty.installed":"skillhub.empty.skills")})});const T=h?e.slice(0,g):e,C=h?g<e.length:!1;return s.jsx("div",{style:{background:"#FFFFFF",border:"1px solid rgba(0, 0, 0, 0.08)",borderRadius:12,overflow:"hidden",display:"flex",flexDirection:"column",flex:1,minHeight:0},children:s.jsxs("div",{ref:v,onScroll:w,className:"flex-1 min-h-0 overflow-y-auto scrollbar-auto-hide",style:{paddingLeft:8,paddingRight:8,paddingTop:8,paddingBottom:8},children:[T.map(E=>s.jsx(lD,{skill:E,isInstalled:n.has(E.slug),isInstalling:r===E.slug,onInstall:()=>l(E.slug),isInstalledMode:o,expanded:m.has(E.slug),onToggle:()=>j(E.slug),onUninstall:u?()=>u(E.slug):void 0,isUninstalling:c===E.slug,isRemoving:f===E.slug},E.slug)),C&&s.jsx("div",{style:{textAlign:"center",padding:"8px 0 4px",color:"rgba(0, 0, 0, 0.25)",fontSize:12},children:S("skillhub.scroll_more")})]})})}const kh=["hot","featured","newest","installed"],oD=1e3;function Av(e){return e.map(n=>{var r;return{name:n.name||n.slug,slug:n.slug,description:`v${n.version} · ${n.source}`,version:n.version,source:n.source,zip_url:n.zip_url,update_url:n.update_url,sha256:n.sha256,installed_at:n.installed_at,detail:(r=n.detail)!=null?r:null}})}function sD({category:e,installedSlugs:n,installedSkills:r,onInstall:l,onUninstalled:o,onLoadingChange:u}){var U;const c=Math.max(0,kh.indexOf(e)),[f,h]=x.useState({hot:[],featured:[],newest:[],installed:Av(r)}),[m,y]=x.useState(!0),[g,_]=x.useState({}),[v,w]=x.useState(null),[j,T]=x.useState(null),[C,E]=x.useState(null),[N,D]=x.useState(null),F=x.useCallback(I=>{y(I),u==null||u(I)},[u]),M=x.useCallback(async()=>{F(!0);const I={},B=(await Promise.all(kh.filter(q=>q!=="installed").map(async q=>{try{const K=await JA(q);return[q,K.skills]}catch(K){return I[q]=K instanceof Error?K.message:S("skillhub.load_failed"),[q,[]]}}))).reduce((q,[K,G])=>({...q,[K]:G}),{});h(q=>({...q,...B})),_(I),F(!1)},[F]);x.useEffect(()=>{M()},[M]),x.useEffect(()=>{h(I=>({...I,installed:Av(r)}))},[r]);const A=async I=>{w(I),T(null);try{await mx(I),E(null),D(I),window.setTimeout(()=>{h(L=>({...L,installed:L.installed.filter(B=>B.slug!==I)})),D(L=>L===I?null:L),o==null||o()},oD)}catch(L){T(L instanceof Error?L.message:S("skillhub.load_failed"))}finally{w(null)}};return s.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[j&&s.jsx("div",{className:"p-3 rounded-lg text-xs shrink-0 mb-4",style:{background:j.toLowerCase().includes("fail")?"rgba(239, 68, 68, 0.1)":"rgba(0, 230, 138, 0.1)",color:j.toLowerCase().includes("fail")?"var(--color-status-error)":"var(--color-status-success)"},children:j}),m?s.jsx("div",{className:"flex items-center justify-center py-12",children:s.jsx(Yn,{className:"h-8 w-8 animate-spin",style:{color:"var(--pc-accent)"}})}):s.jsx("div",{style:{position:"relative",flex:1,minHeight:0,overflow:"hidden",contain:"layout paint"},children:kh.map((I,L)=>{const B=L-c,q=Math.abs(B)<=1;return s.jsx("div",{style:{position:"absolute",inset:0,minHeight:0,display:"flex",flexDirection:"column",transform:`translate3d(${B*100}%, 0, 0)`,transition:"transform 0.32s cubic-bezier(0.16, 1, 0.3, 1)",visibility:q?"visible":"hidden",pointerEvents:B===0?"auto":"none",willChange:q?"transform":void 0,contain:"layout paint"},children:g[I]?s.jsxs("div",{className:"p-8 text-center",style:{background:"#FFFFFF",border:"1px solid rgba(0, 0, 0, 0.08)",borderRadius:12},children:[s.jsx("p",{style:{color:"var(--color-status-error)"},children:g[I]}),s.jsx("button",{onClick:M,className:"btn-electric mt-4 px-4 py-2 text-sm font-medium",children:S("skillhub.retry")})]}):s.jsx(Tv,{skills:f[I],installedSlugs:n,installingSlug:null,onInstall:l,isInstalledMode:I==="installed",onUninstall:I==="installed"?E:void 0,uninstallingSlug:v,removingSlug:N})},I)})}),C&&s.jsx(cD,{skill:(U=f.installed.find(I=>I.slug===C))!=null?U:null,busy:v===C,onCancel:()=>E(null),onConfirm:()=>A(C)})]})}function cD({skill:e,busy:n,onCancel:r,onConfirm:l}){const o=(e==null?void 0:e.name)||(e==null?void 0:e.slug)||"this skill";return s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",style:{background:"rgba(0, 0, 0, 0.28)"},onClick:()=>{n||r()},children:s.jsxs("div",{className:"w-full max-w-sm rounded-xl bg-white p-5 shadow-xl",onClick:u=>u.stopPropagation(),children:[s.jsxs("div",{className:"mb-4 flex items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-base font-semibold",style:{color:"var(--pc-text-primary)"},children:"确认卸载技能？"}),s.jsxs("p",{className:"mt-2 text-sm leading-6",style:{color:"var(--pc-text-muted)"},children:["将从本地移除 ",o,"，并清理安装记录。"]})]}),s.jsx("button",{onClick:r,disabled:n,className:"rounded-lg p-1 transition-colors hover:bg-black/5",style:{color:"var(--pc-text-faint)",cursor:n?"not-allowed":"pointer"},"aria-label":"关闭",children:s.jsx(ma,{className:"h-4 w-4"})})]}),s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx("button",{onClick:r,disabled:n,className:"rounded-lg px-4 py-2 text-sm font-medium transition-all",style:{color:"var(--pc-text-muted)",border:"1px solid rgba(0,0,0,0.1)",cursor:n?"not-allowed":"pointer"},children:"取消"}),s.jsxs("button",{onClick:l,disabled:n,className:"inline-flex items-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-all",style:{background:"rgba(239, 68, 68, 0.92)",color:"white",cursor:n?"wait":"pointer",opacity:n?.75:1},children:[n&&s.jsx(Yn,{className:"h-4 w-4 animate-spin"}),"确认卸载"]})]})]})})}const uD=["hot","featured","newest","installed"];function dD({active:e,onChange:n,installedCount:r,disabled:l}){return s.jsx("div",{className:"flex gap-2 overflow-x-auto pb-1",children:uD.map(o=>{const u=o==="installed"?S("skillhub.tab.installed_count").replace("{count}",String(r!=null?r:0)):S(`skillhub.tab.${o}`);return s.jsx("button",{onClick:()=>n(o),disabled:l,className:"px-4 py-2.5 rounded-[8px] text-[13px] font-medium transition-all whitespace-nowrap",style:e===o?{background:"rgba(0, 0, 0, 0.9)",color:"#FFFFFF",opacity:l?.5:1}:{color:"rgba(0, 0, 0, 0.55)",background:"rgba(0, 0, 0, 0.04)",border:"none",opacity:l?.5:1,cursor:l?"not-allowed":"pointer"},children:u},o)})})}function fD({slug:e,name:n,isOpen:r,onClose:l,onSuccess:o}){const[u,c]=x.useState("confirm"),[f,h]=x.useState(!1),[m,y]=x.useState("");if(!r)return null;const g=async()=>{c("installing"),y("");try{const v=e.includes(":")?e:`clawhub:${e}`,w=await ZA(v,f,60);w.success?(c("success"),o(),setTimeout(()=>{l(),c("confirm")},2e3)):(c("error"),y(w.message))}catch(v){c("error"),y(v instanceof Error?v.message:S("skillhub.modal.error"))}},_=()=>{u!=="installing"&&(l(),c("confirm"),y(""))};return s.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center px-4",onClick:_,children:[s.jsx("div",{className:"absolute inset-0",style:{background:"rgba(0,0,0,0.5)"}}),s.jsxs("div",{className:"relative surface-panel p-6 w-full max-w-md rounded-2xl animate-fade-in-scale",onClick:v=>v.stopPropagation(),children:[s.jsx("button",{onClick:_,disabled:u==="installing",className:"absolute top-4 right-4 p-1 rounded-lg transition-colors",style:{color:"var(--pc-text-muted)"},onMouseEnter:v=>{v.currentTarget.style.color="var(--pc-text-primary)"},onMouseLeave:v=>{v.currentTarget.style.color="var(--pc-text-muted)"},children:s.jsx(ma,{className:"h-4 w-4"})}),s.jsx("h3",{className:"text-lg font-semibold mb-4",style:{color:"var(--pc-text-primary)"},children:S("skillhub.modal.install_title")}),u==="confirm"&&s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"text-sm mb-4",style:{color:"var(--pc-text-muted)"},children:S("skillhub.modal.install_confirm").replace("{name}",n||e)}),s.jsxs("label",{className:"flex items-center gap-2 mb-6 cursor-pointer",children:[s.jsx("input",{type:"checkbox",checked:f,onChange:v=>h(v.target.checked),className:"rounded"}),s.jsx("span",{className:"text-xs",style:{color:"var(--pc-text-muted)"},children:S("skillhub.modal.force_overwrite")})]}),s.jsxs("div",{className:"flex justify-end gap-3",children:[s.jsx("button",{onClick:_,className:"px-4 py-2 rounded-lg text-sm font-medium transition-colors",style:{color:"var(--pc-text-muted)",border:"1px solid var(--pc-border)"},children:S("skillhub.modal.cancel")}),s.jsx("button",{onClick:g,className:"btn-electric px-4 py-2 text-sm font-medium",children:S("skillhub.modal.install_btn")})]})]}),u==="installing"&&s.jsxs("div",{className:"flex flex-col items-center gap-3 py-4",children:[s.jsx(Yn,{className:"h-8 w-8 animate-spin",style:{color:"var(--pc-accent)"}}),s.jsx("p",{className:"text-sm",style:{color:"var(--pc-text-muted)"},children:S("skillhub.modal.installing").replace("{name}",n||e)})]}),u==="success"&&s.jsxs("div",{className:"flex flex-col items-center gap-3 py-4",children:[s.jsx(Pi,{className:"h-8 w-8",style:{color:"var(--color-status-success)"}}),s.jsx("p",{className:"text-sm",style:{color:"var(--color-status-success)"},children:S("skillhub.modal.success").replace("{name}",n||e)})]}),u==="error"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex flex-col items-center gap-3 py-4",children:[s.jsx(ma,{className:"h-8 w-8",style:{color:"var(--color-status-error)"}}),s.jsx("p",{className:"text-sm text-center",style:{color:"var(--color-status-error)"},children:S("skillhub.modal.error")}),s.jsx("p",{className:"text-xs text-center max-w-full break-words",style:{color:"var(--pc-text-muted)"},children:m})]}),s.jsxs("div",{className:"flex justify-end gap-3",children:[s.jsx("button",{onClick:_,className:"px-4 py-2 rounded-lg text-sm font-medium transition-colors",style:{color:"var(--pc-text-muted)",border:"1px solid var(--pc-border)"},children:S("skillhub.modal.close")}),s.jsx("button",{onClick:g,className:"btn-electric px-4 py-2 text-sm font-medium",children:S("skillhub.modal.retry")})]})]})]})]})}function hD(){const[e,n]=x.useState(""),[r,l]=x.useState([]),[o,u]=x.useState(!1),[c,f]=x.useState([]),[h,m]=x.useState("hot"),[y,g]=x.useState(null),[_,v]=x.useState(""),[w,j]=x.useState(!0),T=new Set(c.map(F=>F.slug)),C=x.useCallback(async()=>{try{const F=await eM();f(F.skills)}catch{}},[]);x.useEffect(()=>{C()},[C]);const E=x.useCallback(async F=>{if(n(F),!F){l([]);return}u(!0);try{const M=await XA(F,100);l(M.results)}catch{l([])}finally{u(!1)}},[]),N=F=>{const M=r.find(A=>A.slug===F);g(F),v((M==null?void 0:M.name)||F)},D=()=>{C()};return s.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100vh",overflow:"hidden",background:"#F5F5F7"},children:[s.jsxs("div",{className:"shrink-0",style:{paddingTop:10,paddingLeft:24,paddingRight:24,background:"#FFFFFF"},children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",style:{marginLeft:8},children:[s.jsx(xC,{className:"h-5 w-5",style:{color:"var(--pc-accent)"}}),s.jsx("h2",{style:{fontSize:14,fontWeight:500,color:"rgba(0, 0, 0, 0.85)"},children:S("skillhub.title")})]}),s.jsx("div",{className:"mb-5",children:s.jsx(XR,{onSearch:E,isLoading:o})}),!e&&s.jsx("div",{className:"mb-4",children:s.jsx(dD,{active:h,onChange:m,installedCount:c.length,disabled:w})})]}),s.jsxs("div",{className:"flex-1 min-h-0",style:{display:"flex",flexDirection:"column",paddingLeft:24,paddingRight:24,paddingTop:16,paddingBottom:24,background:"#F5F5F7"},children:[s.jsx("div",{style:{display:e?"none":"flex",flex:1,minHeight:0,flexDirection:"column"},children:s.jsx(sD,{category:h,installedSlugs:T,installedSkills:c,onInstall:N,onUninstalled:C,onLoadingChange:j})}),e&&s.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1,minHeight:0},className:"space-y-4",children:[s.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider shrink-0",style:{color:"var(--pc-text-faint)"},children:S("skillhub.search.results").replace("{query}",e)}),o?s.jsx("div",{className:"flex items-center justify-center py-12",children:s.jsx(Yn,{className:"h-8 w-8 animate-spin",style:{color:"var(--pc-accent)"}})}):s.jsx(Tv,{skills:r,installedSlugs:T,installingSlug:null,onInstall:N,pageSize:12})]})]}),y&&s.jsx(fD,{slug:y,name:_,isOpen:!0,onClose:()=>g(null),onSuccess:D})]})}const Mv={position:"fixed",top:0,left:0,width:"100vw",height:"100vh",display:"flex",alignItems:"center",justifyContent:"center",background:"#FFFFFF",transform:"translate(-28px, -40px)",zIndex:1},mD={display:"flex",flexDirection:"column",alignItems:"center",width:266,gap:0},pD={width:96,height:96,display:"block",flexShrink:0,margin:0},gD={position:"static",margin:0,marginTop:-4,width:266,height:21,opacity:1,display:"flex",alignItems:"center",justifyContent:"center",whiteSpace:"nowrap",fontFamily:"'Noto Sans CJK SC', sans-serif",fontSize:14,fontWeight:"normal",lineHeight:"normal",letterSpacing:"0em",color:"rgba(0, 0, 0, 0.6)",zIndex:1},Rv={marginTop:16,padding:"6px 16px",borderRadius:6,border:"none",background:"#3790FA",color:"#FFFFFF",cursor:"pointer",fontWeight:500,fontFamily:"'Noto Sans CJK SC', sans-serif"},yD={...Rv,background:"#EEEEEE",color:"rgba(0, 0, 0, 0.35)",cursor:"not-allowed"};function bD({starting:e=!1,onStart:n}){return s.jsx("div",{"data-testid":"kybot-service-unavailable",style:Mv,children:s.jsxs("div",{style:mD,children:[s.jsx("img",{src:`${$e}/icons/noweb.svg`,alt:"","aria-hidden":"true",style:pD}),s.jsx("p",{style:gD,children:S("service.not_started_message")}),s.jsx("button",{type:"button",onClick:n,disabled:e,style:e?yD:Rv,children:S(e?"service.starting":"service.start_now")})]})})}const xD=500,vD=3e4,_D=800;function Dv(e){return new Promise(n=>setTimeout(n,e))}function wD(e){const[n,r]=x.useState(null),[l,o]=x.useState(!1),[u,c]=x.useState(0),f=x.useRef(!1),h=x.useCallback(g=>{r(_=>_===g?_:(g&&_===!1&&c(v=>v+1),g))},[]),m=x.useCallback(async()=>{const g=await Ds();return h(g),g},[h]);x.useEffect(()=>{let g=!1;return r(null),Ds().then(_=>{!g&&!f.current&&h(_)}),()=>{g=!0}},[e,h]);const y=x.useCallback(async()=>{if(!f.current){f.current=!0,o(!0);try{await i4()||console.error("[useKybotService] failed to launch kylin-bot daemon");const _=Date.now()+vD;for(;Date.now()<_;)if(await Dv(xD),!!await Ds()&&(await Dv(_D),!!await Ds())){f.current=!1,o(!1),h(!0);return}}finally{f.current=!1,o(!1)}}},[h]);return{available:n,starting:l,start:y,recheck:m,contentEpoch:u}}function Sc({children:e}){const{pathname:n}=$n(),{available:r,starting:l,start:o,contentEpoch:u}=wD(n);return r===null?s.jsx("div",{style:Mv,children:s.jsx(G0,{})}):r?s.jsx("div",{style:{width:"100%",height:"100%"},children:e},u):s.jsx(bD,{starting:l,onStart:()=>void o()})}const Lv=x.createContext(null);function kD({children:e}){const[n,r]=x.useState(mr),[l,o]=x.useState(an||pd()),[u,c]=x.useState(!an),[f,h]=x.useState(an?!1:!pd());x.useEffect(()=>{if(an||pd())return;let _=!1;return a4().then(v=>{_||v.require_pairing||(c(!1),o(!0))}).catch(()=>{}).finally(()=>{_||h(!1)}),()=>{_=!0}},[]),x.useEffect(()=>{const _=v=>{if(v.key==="kylinbot_token"){const w=mr();r(w),o(w!==null&&w.length>0)}};return window.addEventListener("storage",_),()=>window.removeEventListener("storage",_)},[]);const m=x.useCallback(async _=>{const{token:v}=await n4(_);Zg(v),r(v),o(!0)},[]),y=x.useCallback(()=>{md(),r(null),o(!1)},[]),g={token:n,isAuthenticated:l,requiresPairing:u,loading:f,pair:m,logout:y};return Fi.createElement(Lv.Provider,{value:g},e)}function SD(){const e=x.useContext(Lv);if(!e)throw new Error("useAuth must be used within an <AuthProvider>");return e}const CD="kylinbot-locale";function zv(e){console.log("saveLocale",e),localStorage.setItem(CD,e)}const jD=x.createContext({locale:"zh",setAppLocale:()=>{}});class ED extends x.Component{constructor(n){super(n),this.state={error:null}}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,r){console.error("[KylinBot] Render error:",n,r.componentStack)}render(){return this.state.error?s.jsx("div",{className:"p-6",children:s.jsxs("div",{className:"card p-6 w-full max-w-lg",style:{borderColor:"rgba(239, 68, 68, 0.3)"},children:[s.jsx("h2",{className:"text-lg font-semibold mb-2",style:{color:"var(--color-status-error)"},children:"Something went wrong"}),s.jsx("p",{className:"text-sm mb-4",style:{color:"var(--pc-text-muted)"},children:"A render error occurred. Check the browser console for details."}),s.jsx("pre",{className:"text-xs rounded-lg p-3 overflow-x-auto whitespace-pre-wrap break-all font-mono",style:{background:"var(--pc-bg-base)",color:"var(--color-status-error)"},children:this.state.error.message}),s.jsx("button",{onClick:()=>this.setState({error:null}),className:"btn-electric mt-6 px-4 py-2 text-sm font-medium",children:"Try again"})]})}):this.props.children}}function ND({onPair:e}){const[n,r]=x.useState(""),[l,o]=x.useState(""),[u,c]=x.useState(!1),[f,h]=x.useState(null),[m,y]=x.useState(!0);x.useEffect(()=>{let _=!1;return dy().then(v=>{!_&&v.pairing_code&&h(v.pairing_code)}).catch(()=>{}).finally(()=>{_||y(!1)}),()=>{_=!0}},[]);const g=async _=>{_.preventDefault(),c(!0),o("");try{await e(n)}catch(v){o(v instanceof Error?v.message:"Pairing failed")}finally{c(!1)}};return s.jsx("div",{className:"min-h-screen flex items-center justify-center",style:{background:"var(--pc-bg-base)"},children:s.jsxs("div",{className:"relative surface-panel p-8 w-full max-w-md animate-fade-in-scale",children:[s.jsxs("div",{className:"text-center mb-8",children:[s.jsx("img",{src:`${$e}/kylin-bot.svg`,alt:"KylinBot",className:"h-20 w-20 rounded-2xl object-cover mx-auto mb-4 animate-float",onError:_=>{_.currentTarget.style.display="none"}}),s.jsx("h1",{className:"text-2xl font-bold mb-2 text-gradient-blue",children:"KylinBot"}),s.jsx("p",{className:"text-sm",style:{color:"var(--pc-text-muted)"},children:f?"Your pairing code":"Enter the pairing code from your terminal"})]}),!m&&f&&s.jsxs("div",{className:"mb-6 p-4 rounded-2xl text-center border",style:{background:"var(--pc-accent-glow)",borderColor:"var(--pc-accent-dim)"},children:[s.jsx("div",{className:"text-4xl font-mono font-bold tracking-[0.4em] py-2",style:{color:"var(--pc-text-primary)"},children:f}),s.jsx("p",{className:"text-xs mt-2",style:{color:"var(--pc-text-muted)"},children:"Enter this code below or on another device"})]}),s.jsxs("form",{onSubmit:g,children:[s.jsx("input",{type:"text",value:n,onChange:_=>r(_.target.value),placeholder:"6-digit code",className:"input-electric w-full px-4 py-4 text-center text-2xl tracking-[0.3em] font-medium mb-4",maxLength:6,autoFocus:!0}),l&&s.jsx("p",{"aria-live":"polite",className:"text-sm mb-4 text-center animate-fade-in",style:{color:"var(--color-status-error)"},children:l}),s.jsx("button",{type:"submit",disabled:u||n.length<6,className:"btn-electric w-full py-3.5 text-sm font-semibold tracking-wide",children:u?s.jsxs("span",{className:"flex items-center justify-center gap-2",children:[s.jsx("span",{className:"h-4 w-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Pairing..."]}):"Pair"})]})]})})}function TD(){const{isAuthenticated:e,requiresPairing:n,loading:r,pair:l,logout:o}=SD(),u=Wr(),[c,f]=x.useState("zh"),h=CT();Bs(c),x.useEffect(()=>{if(!an)return;const y=window,g=_=>u(_);y.__kylinbotNavigateImpl=g,y.__kylinbotNavigate=g,typeof y.__kylinbotFlushNavigate=="function"&&y.__kylinbotFlushNavigate()},[u]);const m=y=>{f("zh"),Bs("zh"),zv("zh")};return x.useEffect(()=>{f("zh"),Bs("zh"),zv("zh")},[]),x.useEffect(()=>{const y=()=>{o()};return window.addEventListener("kylinbot-unauthorized",y),()=>window.removeEventListener("kylinbot-unauthorized",y)},[o]),r?s.jsx("div",{className:"min-h-screen flex items-center justify-center",style:{background:"var(--pc-bg-base)"},children:s.jsxs("div",{className:"flex flex-col items-center gap-4 animate-fade-in",children:[s.jsx("div",{className:"h-10 w-10 border-2 rounded-full animate-spin",style:{borderColor:"var(--pc-border)",borderTopColor:"var(--pc-accent)"}}),s.jsx("p",{className:"text-sm",style:{color:"var(--pc-text-muted)"},children:"Connecting..."})]})}):!e&&n?s.jsx(ND,{onPair:l}):s.jsx(p0.Provider,{value:h,children:s.jsx(jD.Provider,{value:{locale:c,setAppLocale:m},children:s.jsxs($k,{children:[s.jsxs(At,{element:s.jsx(lj,{}),children:[s.jsx(At,{path:"/",element:s.jsx(G8,{})}),s.jsx(At,{path:"/agent",element:s.jsx(j8,{})}),s.jsx(At,{path:"/agent/history",element:s.jsx(T8,{})}),s.jsx(At,{path:"/tools",element:s.jsx(K8,{})}),s.jsx(At,{path:"/cron",element:s.jsx(Sc,{children:s.jsx(PA,{})})}),s.jsx(At,{path:"/integrations",element:s.jsx(YA,{})}),s.jsx(At,{path:"/general",element:s.jsx(VA,{})}),s.jsx(At,{path:"/skills",element:s.jsx(Sc,{children:s.jsx(sM,{})})}),s.jsx(At,{path:"/memory",element:s.jsx(dM,{})}),s.jsx(At,{path:"/config",element:s.jsx(TM,{})}),s.jsx(At,{path:"/cost",element:s.jsx(AM,{})}),s.jsx(At,{path:"/model",element:s.jsx(Sc,{children:s.jsx(g9,{})})}),s.jsx(At,{path:"/logs",element:s.jsx(x9,{})}),s.jsx(At,{path:"/doctor",element:s.jsx(k9,{})}),s.jsx(At,{path:"/pairing",element:s.jsx(S9,{})}),s.jsx(At,{path:"/canvas",element:s.jsx(C9,{})})]}),s.jsx(At,{path:"/channel",element:s.jsx(Sc,{children:s.jsx(WR,{})})}),s.jsx(At,{path:"/skillhub",element:s.jsx(hD,{})}),s.jsx(At,{path:"*",element:s.jsx(qk,{to:"/agent",replace:!0})})]})})})}function Ov(){return s.jsx(kD,{children:s.jsx(zS,{children:s.jsx(TD,{})})})}document.addEventListener("contextmenu",e=>e.preventDefault());function AD(){try{const e=window.location.hash;return e.startsWith("#")?e.slice(1):"/"}catch{return"/"}}let _o=null;function MD(){const e=Wr();return Fi.useEffect(()=>{_o=e,Bv(n=>{_o&&_o(n)})},[e]),null}function Bv(e){const n=window;n.__kylinbotNavigateImpl=e,n.__kylinbotNavigate=e,typeof n.__kylinbotFlushNavigate=="function"&&n.__kylinbotFlushNavigate()}Bv(e=>{_o&&_o(e)});function Fv(){const e=document.getElementById("root");if(!e){console.error("[KylinBot] #root not found — check index.html script order for qrc embed");return}an?Wp.createRoot(e).render(s.jsx(Fi.StrictMode,{children:s.jsxs(Hk,{initialEntries:[AD()],children:[s.jsx(MD,{}),s.jsx(Ov,{})]})})):Wp.createRoot(e).render(s.jsx(Fi.StrictMode,{children:s.jsx(pS,{basename:Il||"/",children:s.jsx(Ov,{})})}))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Fv):Fv();function RD(e,n,r,l){if(typeof n=="function"?e!==n||!l:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?l:r==="a"?l.call(e):l?l.value:n.get(e)}function DD(e,n,r,l,o){if(typeof n=="function"?e!==n||!0:!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n.set(e,r),r}typeof SuppressedError=="function"&&SuppressedError;var Cc;const Vn="__TAURI_TO_IPC_KEY__";function LD(e,n=!1){return window.__TAURI_INTERNALS__.transformCallback(e,n)}async function ye(e,n={},r){return window.__TAURI_INTERNALS__.invoke(e,n,r)}class zD{get rid(){return RD(this,Cc,"f")}constructor(n){Cc.set(this,void 0),DD(this,Cc,n)}async close(){return ye("plugin:resources|close",{rid:this.rid})}}Cc=new WeakMap;class Sh{constructor(...n){this.type="Logical",n.length===1?"Logical"in n[0]?(this.width=n[0].Logical.width,this.height=n[0].Logical.height):(this.width=n[0].width,this.height=n[0].height):(this.width=n[0],this.height=n[1])}toPhysical(n){return new _r(this.width*n,this.height*n)}[Vn](){return{width:this.width,height:this.height}}toJSON(){return this[Vn]()}}class _r{constructor(...n){this.type="Physical",n.length===1?"Physical"in n[0]?(this.width=n[0].Physical.width,this.height=n[0].Physical.height):(this.width=n[0].width,this.height=n[0].height):(this.width=n[0],this.height=n[1])}toLogical(n){return new Sh(this.width/n,this.height/n)}[Vn](){return{width:this.width,height:this.height}}toJSON(){return this[Vn]()}}class ti{constructor(n){this.size=n}toLogical(n){return this.size instanceof Sh?this.size:this.size.toLogical(n)}toPhysical(n){return this.size instanceof _r?this.size:this.size.toPhysical(n)}[Vn](){return{[`${this.size.type}`]:{width:this.size.width,height:this.size.height}}}toJSON(){return this[Vn]()}}class Ch{constructor(...n){this.type="Logical",n.length===1?"Logical"in n[0]?(this.x=n[0].Logical.x,this.y=n[0].Logical.y):(this.x=n[0].x,this.y=n[0].y):(this.x=n[0],this.y=n[1])}toPhysical(n){return new Qn(this.x*n,this.y*n)}[Vn](){return{x:this.x,y:this.y}}toJSON(){return this[Vn]()}}class Qn{constructor(...n){this.type="Physical",n.length===1?"Physical"in n[0]?(this.x=n[0].Physical.x,this.y=n[0].Physical.y):(this.x=n[0].x,this.y=n[0].y):(this.x=n[0],this.y=n[1])}toLogical(n){return new Ch(this.x/n,this.y/n)}[Vn](){return{x:this.x,y:this.y}}toJSON(){return this[Vn]()}}class jc{constructor(n){this.position=n}toLogical(n){return this.position instanceof Ch?this.position:this.position.toLogical(n)}toPhysical(n){return this.position instanceof Qn?this.position:this.position.toPhysical(n)}[Vn](){return{[`${this.position.type}`]:{x:this.position.x,y:this.position.y}}}toJSON(){return this[Vn]()}}var Dn;(function(e){e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_CREATED="tauri://window-created",e.WEBVIEW_CREATED="tauri://webview-created",e.DRAG_ENTER="tauri://drag-enter",e.DRAG_OVER="tauri://drag-over",e.DRAG_DROP="tauri://drag-drop",e.DRAG_LEAVE="tauri://drag-leave"})(Dn||(Dn={}));async function Iv(e,n){window.__TAURI_EVENT_PLUGIN_INTERNALS__.unregisterListener(e,n),await ye("plugin:event|unlisten",{event:e,eventId:n})}async function Uv(e,n,r){var l;const o=typeof(r==null?void 0:r.target)=="string"?{kind:"AnyLabel",label:r.target}:(l=r==null?void 0:r.target)!==null&&l!==void 0?l:{kind:"Any"};return ye("plugin:event|listen",{event:e,target:o,handler:LD(n)}).then(u=>async()=>Iv(e,u))}async function OD(e,n,r){return Uv(e,l=>{Iv(e,l.id),n(l)},r)}async function BD(e,n){await ye("plugin:event|emit",{event:e,payload:n})}async function FD(e,n,r){await ye("plugin:event|emit_to",{target:typeof e=="string"?{kind:"AnyLabel",label:e}:e,event:n,payload:r})}class wo extends zD{constructor(n){super(n)}static async new(n,r,l){return ye("plugin:image|new",{rgba:Ec(n),width:r,height:l}).then(o=>new wo(o))}static async fromBytes(n){return ye("plugin:image|from_bytes",{bytes:Ec(n)}).then(r=>new wo(r))}static async fromPath(n){return ye("plugin:image|from_path",{path:n}).then(r=>new wo(r))}async rgba(){return ye("plugin:image|rgba",{rid:this.rid}).then(n=>new Uint8Array(n))}async size(){return ye("plugin:image|size",{rid:this.rid})}}function Ec(e){return e==null?null:typeof e=="string"?e:e instanceof wo?e.rid:e}var Nc;(function(e){e[e.Critical=1]="Critical",e[e.Informational=2]="Informational"})(Nc||(Nc={}));class Hv{constructor(n){this._preventDefault=!1,this.event=n.event,this.id=n.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}}var jh;(function(e){e.None="none",e.Normal="normal",e.Indeterminate="indeterminate",e.Paused="paused",e.Error="error"})(jh||(jh={}));function qv(){return new Nh(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}async function Tc(){return ye("plugin:window|get_all_windows").then(e=>e.map(n=>new Nh(n,{skip:!0})))}const Eh=["tauri://created","tauri://error"];class Nh{constructor(n,r={}){var l;this.label=n,this.listeners=Object.create(null),r!=null&&r.skip||ye("plugin:window|create",{options:{...r,parent:typeof r.parent=="string"?r.parent:(l=r.parent)===null||l===void 0?void 0:l.label,label:n}}).then(async()=>this.emit("tauri://created")).catch(async o=>this.emit("tauri://error",o))}static async getByLabel(n){var r;return(r=(await Tc()).find(l=>l.label===n))!==null&&r!==void 0?r:null}static getCurrent(){return qv()}static async getAll(){return Tc()}static async getFocusedWindow(){for(const n of await Tc())if(await n.isFocused())return n;return null}async listen(n,r){return this._handleTauriEvent(n,r)?()=>{const l=this.listeners[n];l.splice(l.indexOf(r),1)}:Uv(n,r,{target:{kind:"Window",label:this.label}})}async once(n,r){return this._handleTauriEvent(n,r)?()=>{const l=this.listeners[n];l.splice(l.indexOf(r),1)}:OD(n,r,{target:{kind:"Window",label:this.label}})}async emit(n,r){if(Eh.includes(n)){for(const l of this.listeners[n]||[])l({event:n,id:-1,payload:r});return}return BD(n,r)}async emitTo(n,r,l){if(Eh.includes(r)){for(const o of this.listeners[r]||[])o({event:r,id:-1,payload:l});return}return FD(n,r,l)}_handleTauriEvent(n,r){return Eh.includes(n)?(n in this.listeners?this.listeners[n].push(r):this.listeners[n]=[r],!0):!1}async scaleFactor(){return ye("plugin:window|scale_factor",{label:this.label})}async innerPosition(){return ye("plugin:window|inner_position",{label:this.label}).then(n=>new Qn(n))}async outerPosition(){return ye("plugin:window|outer_position",{label:this.label}).then(n=>new Qn(n))}async innerSize(){return ye("plugin:window|inner_size",{label:this.label}).then(n=>new _r(n))}async outerSize(){return ye("plugin:window|outer_size",{label:this.label}).then(n=>new _r(n))}async isFullscreen(){return ye("plugin:window|is_fullscreen",{label:this.label})}async isMinimized(){return ye("plugin:window|is_minimized",{label:this.label})}async isMaximized(){return ye("plugin:window|is_maximized",{label:this.label})}async isFocused(){return ye("plugin:window|is_focused",{label:this.label})}async isDecorated(){return ye("plugin:window|is_decorated",{label:this.label})}async isResizable(){return ye("plugin:window|is_resizable",{label:this.label})}async isMaximizable(){return ye("plugin:window|is_maximizable",{label:this.label})}async isMinimizable(){return ye("plugin:window|is_minimizable",{label:this.label})}async isClosable(){return ye("plugin:window|is_closable",{label:this.label})}async isVisible(){return ye("plugin:window|is_visible",{label:this.label})}async title(){return ye("plugin:window|title",{label:this.label})}async theme(){return ye("plugin:window|theme",{label:this.label})}async isAlwaysOnTop(){return ye("plugin:window|is_always_on_top",{label:this.label})}async center(){return ye("plugin:window|center",{label:this.label})}async requestUserAttention(n){let r=null;return n&&(n===Nc.Critical?r={type:"Critical"}:r={type:"Informational"}),ye("plugin:window|request_user_attention",{label:this.label,value:r})}async setResizable(n){return ye("plugin:window|set_resizable",{label:this.label,value:n})}async setEnabled(n){return ye("plugin:window|set_enabled",{label:this.label,value:n})}async isEnabled(){return ye("plugin:window|is_enabled",{label:this.label})}async setMaximizable(n){return ye("plugin:window|set_maximizable",{label:this.label,value:n})}async setMinimizable(n){return ye("plugin:window|set_minimizable",{label:this.label,value:n})}async setClosable(n){return ye("plugin:window|set_closable",{label:this.label,value:n})}async setTitle(n){return ye("plugin:window|set_title",{label:this.label,value:n})}async maximize(){return ye("plugin:window|maximize",{label:this.label})}async unmaximize(){return ye("plugin:window|unmaximize",{label:this.label})}async toggleMaximize(){return ye("plugin:window|toggle_maximize",{label:this.label})}async minimize(){return ye("plugin:window|minimize",{label:this.label})}async unminimize(){return ye("plugin:window|unminimize",{label:this.label})}async show(){return ye("plugin:window|show",{label:this.label})}async hide(){return ye("plugin:window|hide",{label:this.label})}async close(){return ye("plugin:window|close",{label:this.label})}async destroy(){return ye("plugin:window|destroy",{label:this.label})}async setDecorations(n){return ye("plugin:window|set_decorations",{label:this.label,value:n})}async setShadow(n){return ye("plugin:window|set_shadow",{label:this.label,value:n})}async setEffects(n){return ye("plugin:window|set_effects",{label:this.label,value:n})}async clearEffects(){return ye("plugin:window|set_effects",{label:this.label,value:null})}async setAlwaysOnTop(n){return ye("plugin:window|set_always_on_top",{label:this.label,value:n})}async setAlwaysOnBottom(n){return ye("plugin:window|set_always_on_bottom",{label:this.label,value:n})}async setContentProtected(n){return ye("plugin:window|set_content_protected",{label:this.label,value:n})}async setSize(n){return ye("plugin:window|set_size",{label:this.label,value:n instanceof ti?n:new ti(n)})}async setMinSize(n){return ye("plugin:window|set_min_size",{label:this.label,value:n instanceof ti?n:n?new ti(n):null})}async setMaxSize(n){return ye("plugin:window|set_max_size",{label:this.label,value:n instanceof ti?n:n?new ti(n):null})}async setSizeConstraints(n){function r(l){return l?{Logical:l}:null}return ye("plugin:window|set_size_constraints",{label:this.label,value:{minWidth:r(n==null?void 0:n.minWidth),minHeight:r(n==null?void 0:n.minHeight),maxWidth:r(n==null?void 0:n.maxWidth),maxHeight:r(n==null?void 0:n.maxHeight)}})}async setPosition(n){return ye("plugin:window|set_position",{label:this.label,value:n instanceof jc?n:new jc(n)})}async setFullscreen(n){return ye("plugin:window|set_fullscreen",{label:this.label,value:n})}async setSimpleFullscreen(n){return ye("plugin:window|set_simple_fullscreen",{label:this.label,value:n})}async setFocus(){return ye("plugin:window|set_focus",{label:this.label})}async setFocusable(n){return ye("plugin:window|set_focusable",{label:this.label,value:n})}async setIcon(n){return ye("plugin:window|set_icon",{label:this.label,value:Ec(n)})}async setSkipTaskbar(n){return ye("plugin:window|set_skip_taskbar",{label:this.label,value:n})}async setCursorGrab(n){return ye("plugin:window|set_cursor_grab",{label:this.label,value:n})}async setCursorVisible(n){return ye("plugin:window|set_cursor_visible",{label:this.label,value:n})}async setCursorIcon(n){return ye("plugin:window|set_cursor_icon",{label:this.label,value:n})}async setBackgroundColor(n){return ye("plugin:window|set_background_color",{color:n})}async setCursorPosition(n){return ye("plugin:window|set_cursor_position",{label:this.label,value:n instanceof jc?n:new jc(n)})}async setIgnoreCursorEvents(n){return ye("plugin:window|set_ignore_cursor_events",{label:this.label,value:n})}async startDragging(){return ye("plugin:window|start_dragging",{label:this.label})}async startResizeDragging(n){return ye("plugin:window|start_resize_dragging",{label:this.label,value:n})}async setBadgeCount(n){return ye("plugin:window|set_badge_count",{label:this.label,value:n})}async setBadgeLabel(n){return ye("plugin:window|set_badge_label",{label:this.label,value:n})}async setOverlayIcon(n){return ye("plugin:window|set_overlay_icon",{label:this.label,value:n?Ec(n):void 0})}async setProgressBar(n){return ye("plugin:window|set_progress_bar",{label:this.label,value:n})}async setVisibleOnAllWorkspaces(n){return ye("plugin:window|set_visible_on_all_workspaces",{label:this.label,value:n})}async setTitleBarStyle(n){return ye("plugin:window|set_title_bar_style",{label:this.label,value:n})}async setTheme(n){return ye("plugin:window|set_theme",{label:this.label,value:n})}async onResized(n){return this.listen(Dn.WINDOW_RESIZED,r=>{r.payload=new _r(r.payload),n(r)})}async onMoved(n){return this.listen(Dn.WINDOW_MOVED,r=>{r.payload=new Qn(r.payload),n(r)})}async onCloseRequested(n){return this.listen(Dn.WINDOW_CLOSE_REQUESTED,async r=>{const l=new Hv(r);await n(l),l.isPreventDefault()||await this.destroy()})}async onDragDropEvent(n){const r=await this.listen(Dn.DRAG_ENTER,c=>{n({...c,payload:{type:"enter",paths:c.payload.paths,position:new Qn(c.payload.position)}})}),l=await this.listen(Dn.DRAG_OVER,c=>{n({...c,payload:{type:"over",position:new Qn(c.payload.position)}})}),o=await this.listen(Dn.DRAG_DROP,c=>{n({...c,payload:{type:"drop",paths:c.payload.paths,position:new Qn(c.payload.position)}})}),u=await this.listen(Dn.DRAG_LEAVE,c=>{n({...c,payload:{type:"leave"}})});return()=>{r(),o(),l(),u()}}async onFocusChanged(n){const r=await this.listen(Dn.WINDOW_FOCUS,o=>{n({...o,payload:!0})}),l=await this.listen(Dn.WINDOW_BLUR,o=>{n({...o,payload:!1})});return()=>{r(),l()}}async onScaleChanged(n){return this.listen(Dn.WINDOW_SCALE_FACTOR_CHANGED,n)}async onThemeChanged(n){return this.listen(Dn.WINDOW_THEME_CHANGED,n)}}var Pv;(function(e){e.Disabled="disabled",e.Throttle="throttle",e.Suspend="suspend"})(Pv||(Pv={}));var $v;(function(e){e.Default="default",e.FluentOverlay="fluentOverlay"})($v||($v={}));var Th;(function(e){e.AppearanceBased="appearanceBased",e.Light="light",e.Dark="dark",e.MediumLight="mediumLight",e.UltraDark="ultraDark",e.Titlebar="titlebar",e.Selection="selection",e.Menu="menu",e.Popover="popover",e.Sidebar="sidebar",e.HeaderView="headerView",e.Sheet="sheet",e.WindowBackground="windowBackground",e.HudWindow="hudWindow",e.FullScreenUI="fullScreenUI",e.Tooltip="tooltip",e.ContentBackground="contentBackground",e.UnderWindowBackground="underWindowBackground",e.UnderPageBackground="underPageBackground",e.Mica="mica",e.Blur="blur",e.Acrylic="acrylic",e.Tabbed="tabbed",e.TabbedDark="tabbedDark",e.TabbedLight="tabbedLight"})(Th||(Th={}));var Ah;(function(e){e.FollowsWindowActiveState="followsWindowActiveState",e.Active="active",e.Inactive="inactive"})(Ah||(Ah={}));function Ac(e){return e===null?null:{name:e.name,scaleFactor:e.scaleFactor,position:new Qn(e.position),size:new _r(e.size),workArea:{position:new Qn(e.workArea.position),size:new _r(e.workArea.size)}}}async function ID(){return ye("plugin:window|current_monitor").then(Ac)}async function UD(){return ye("plugin:window|primary_monitor").then(Ac)}async function HD(e,n){return ye("plugin:window|monitor_from_point",{x:e,y:n}).then(Ac)}async function qD(){return ye("plugin:window|available_monitors").then(e=>e.map(Ac))}async function PD(){return ye("plugin:window|cursor_position").then(e=>new Qn(e))}const $D=Object.freeze(Object.defineProperty({__proto__:null,CloseRequestedEvent:Hv,get Effect(){return Th},get EffectState(){return Ah},LogicalPosition:Ch,LogicalSize:Sh,PhysicalPosition:Qn,PhysicalSize:_r,get ProgressBarStatus(){return jh},get UserAttentionType(){return Nc},Window:Nh,availableMonitors:qD,currentMonitor:ID,cursorPosition:PD,getAllWindows:Tc,getCurrentWindow:qv,monitorFromPoint:HD,primaryMonitor:UD},Symbol.toStringTag,{value:"Module"}))})();
