@asabot/core 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -1
- package/dist/core/bot-accounts.d.ts +2 -0
- package/dist/core/bot-accounts.js +7 -0
- package/dist/core/plugin/context.d.ts +9 -1
- package/dist/core/plugin/context.js +15 -0
- package/dist/core/plugin/credentials.d.ts +44 -0
- package/dist/core/plugin/credentials.js +45 -0
- package/dist/core/plugin/definition.d.ts +3 -0
- package/dist/core/plugin/manager.d.ts +8 -1
- package/dist/core/plugin/manager.js +73 -23
- package/dist/core/plugin/types.d.ts +13 -0
- package/dist/core/storage/credentials.d.ts +25 -0
- package/dist/core/storage/credentials.js +139 -0
- package/dist/core/storage/index.d.ts +2 -0
- package/dist/core/storage/index.js +10 -0
- package/dist/index.d.ts +2 -1
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +87 -21
- package/dist/server/schemas.d.ts +13 -0
- package/dist/server/schemas.js +28 -0
- package/dist/server/views.d.ts +5 -0
- package/dist/server/views.js +3 -1
- package/package.json +1 -1
- package/web/dist/assets/index-C3RsfNwC.js +51 -0
- package/web/dist/assets/index-Dz7T5hDM.css +2 -0
- package/web/dist/assets/{markdown-CIohfKSa.js → markdown-HrgPSKyp.js} +4 -4
- package/web/dist/assets/plugin-credentials-CuMBPnPO.js +1 -0
- package/web/dist/index.html +2 -2
- package/web/dist/assets/index-ogXTSYEt.css +0 -2
- package/web/dist/assets/index-r9XycpMd.js +0 -51
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=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,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ee=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function te(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,te(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(ee,`$&/`)+`/`),te(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ee,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=te(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=te(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return te(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function N(e,t,n){if(e==null)return e;var r=[],i=0;return te(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function P(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var ne=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function re(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,ne)}catch(e){ne(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function ie(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else re(ie.bind(null,e))}var ae={map:N,forEach:function(e,t,n){N(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return N(e,function(){t++}),t},toArray:function(e){return N(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ae,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=ie,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:P}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=re,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),d=o(((e,t)=>{t.exports=u()}));function f(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=f(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function p(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=f(e))&&(r&&(r+=` `),r+=t);return r}var m=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},h=(e,t)=>({classGroupId:e,validator:t}),g=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),_=`-`,v=[],y=`arbitrary..`,b=e=>{let t=C(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return S(e);let n=e.split(_);return x(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?m(i,t):t:i||v}return n[e]||v}}},x=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=x(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(_):e.slice(t).join(_),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},S=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?y+r:void 0})(),C=e=>{let{theme:t,classGroups:n}=e;return w(n,t)},w=(e,t)=>{let n=g();for(let r in e){let i=e[r];T(i,n,r,t)}return n},T=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];E(i,t,n,r)}},E=(e,t,n,r)=>{typeof e==`string`?D(e,t,n):typeof e==`function`?O(e,t,n,r):k(e,t,n,r)},D=(e,t,n)=>{let r=e===``?t:A(t,e);r.classGroupId=n},O=(e,t,n,r)=>{ee(e)?T(e(r),t,n,r):(t.validators===null&&(t.validators=[]),t.validators.push(h(n,e)))},k=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];T(o,A(t,a),n,r)}},A=(e,t)=>{let n=e,r=t.split(_),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=g(),n.nextPart.set(t,i)),n=i}return n},ee=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,j=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},M=`!`,te=`:`,N=[],P=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),ne=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===te){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(M)?(c=s.slice(0,-1),l=!0):s.startsWith(M)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return P(t,l,c,u)};if(t){let e=t+te,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):P(N,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},re=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},ie=e=>({cache:j(e.cacheSize),parseClassName:ne(e),sortModifiers:re(e),postfixLookupClassGroupIds:ae(e),...b(e)}),ae=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},oe=/\s+/,se=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(oe),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h||(g=r(p),!g)){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+M:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},ce=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=le(n))&&(i&&(i+=` `),i+=r);return i},le=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=le(e[r]))&&(n&&(n+=` `),n+=t);return n},ue=(e,...t)=>{let n,r,i,a,o=o=>(n=ie(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=se(e,n);return i(e,a),a};return a=o,(...e)=>a(ce(...e))},de=[],fe=e=>{let t=t=>t[e]||de;return t.isThemeGetter=!0,t.themeKey=e,t},pe=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,F=/^\((?:(\w[\w-]*):)?(.+)\)$/i,me=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,he=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ge=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,_e=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,ve=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ye=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,be=e=>me.test(e),I=e=>!!e&&!Number.isNaN(Number(e)),xe=e=>!!e&&Number.isInteger(Number(e)),Se=e=>e.endsWith(`%`)&&I(e.slice(0,-1)),Ce=e=>he.test(e),we=()=>!0,Te=e=>ge.test(e)&&!_e.test(e),Ee=()=>!1,De=e=>ve.test(e),Oe=e=>ye.test(e),ke=e=>!L(e)&&!R(e),Ae=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),je=e=>Ke(e,Xe,Ee),L=e=>pe.test(e),Me=e=>Ke(e,Ze,Te),Ne=e=>Ke(e,Qe,I),Pe=e=>Ke(e,et,we),Fe=e=>Ke(e,$e,Ee),Ie=e=>Ke(e,Je,Ee),Le=e=>Ke(e,Ye,Oe),Re=e=>Ke(e,tt,De),R=e=>F.test(e),ze=e=>qe(e,Ze),Be=e=>qe(e,$e),Ve=e=>qe(e,Je),He=e=>qe(e,Xe),Ue=e=>qe(e,Ye),We=e=>qe(e,tt,!0),Ge=e=>qe(e,et,!0),Ke=(e,t,n)=>{let r=pe.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},qe=(e,t,n=!1)=>{let r=F.exec(e);return r?r[1]?t(r[1]):n:!1},Je=e=>e===`position`||e===`percentage`,Ye=e=>e===`image`||e===`url`,Xe=e=>e===`length`||e===`size`||e===`bg-size`,Ze=e=>e===`length`,Qe=e=>e===`number`,$e=e=>e===`family-name`,et=e=>e===`number`||e===`weight`,tt=e=>e===`shadow`,nt=ue(()=>{let e=fe(`color`),t=fe(`font`),n=fe(`text`),r=fe(`font-weight`),i=fe(`tracking`),a=fe(`leading`),o=fe(`breakpoint`),s=fe(`container`),c=fe(`spacing`),l=fe(`radius`),u=fe(`shadow`),d=fe(`inset-shadow`),f=fe(`text-shadow`),p=fe(`drop-shadow`),m=fe(`blur`),h=fe(`perspective`),g=fe(`aspect`),_=fe(`ease`),v=fe(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),R,L],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[R,L,c],T=()=>[be,`full`,`auto`,...w()],E=()=>[xe,`none`,`subgrid`,R,L],D=()=>[`auto`,{span:[`full`,xe,R,L]},xe,R,L],O=()=>[xe,`auto`,R,L],k=()=>[`auto`,`min`,`max`,`fr`,R,L],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ee=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],j=()=>[`auto`,...w()],M=()=>[be,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],te=()=>[s,be,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],N=()=>[be,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[e,R,L],ne=()=>[...b(),Ve,Ie,{position:[R,L]}],re=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ie=()=>[`auto`,`cover`,`contain`,He,je,{size:[R,L]}],ae=()=>[Se,ze,Me],oe=()=>[``,`none`,`full`,l,R,L],se=()=>[``,I,ze,Me],ce=()=>[`solid`,`dashed`,`dotted`,`double`],le=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ue=()=>[I,Se,Ve,Ie],de=()=>[``,`none`,m,R,L],pe=()=>[`none`,I,R,L],F=()=>[`none`,I,R,L],me=()=>[I,R,L],he=()=>[be,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Ce],breakpoint:[Ce],color:[we],container:[Ce],"drop-shadow":[Ce],ease:[`in`,`out`,`in-out`],font:[ke],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Ce],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Ce],shadow:[Ce],spacing:[`px`,I],text:[Ce],"text-shadow":[Ce],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,be,L,R,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,R,L]}],"container-named":[Ae],columns:[{columns:[I,`auto`,L,R,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[xe,`auto`,R,L]}],basis:[{basis:[be,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[I,be,`auto`,`initial`,`none`,L]}],grow:[{grow:[``,I,R,L]}],shrink:[{shrink:[``,I,R,L]}],order:[{order:[xe,`first`,`last`,`none`,R,L]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...ee(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ee()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...ee(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ee(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...ee(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ee()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mbs:[{mbs:j()}],mbe:[{mbe:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:M()}],"inline-size":[{inline:[`auto`,...te()]}],"min-inline-size":[{"min-inline":[`auto`,...te()]}],"max-inline-size":[{"max-inline":[`none`,...te()]}],"block-size":[{block:[`auto`,...N()]}],"min-block-size":[{"min-block":[`auto`,...N()]}],"max-block-size":[{"max-block":[`none`,...N()]}],w:[{w:[s,`screen`,...M()]}],"min-w":[{"min-w":[s,`screen`,`none`,...M()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...M()]}],h:[{h:[`screen`,`lh`,...M()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...M()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...M()]}],"font-size":[{text:[`base`,n,ze,Me]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Ge,Pe]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Se,L]}],"font-family":[{font:[Be,Fe,t]}],"font-features":[{"font-features":[L]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,R,L]}],"line-clamp":[{"line-clamp":[I,`none`,R,Ne]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,R,L]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,R,L]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ce(),`wavy`]}],"text-decoration-thickness":[{decoration:[I,`from-font`,`auto`,R,Me]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[I,`auto`,R,L]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[xe,R,L]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,R,L]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,R,L]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ne()}],"bg-repeat":[{bg:re()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},xe,R,L],radial:[``,R,L],conic:[``,xe,R,L]},Ue,Le]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:ae()}],"gradient-via-pos":[{via:ae()}],"gradient-to-pos":[{to:ae()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"border-w":[{border:se()}],"border-w-x":[{"border-x":se()}],"border-w-y":[{"border-y":se()}],"border-w-s":[{"border-s":se()}],"border-w-e":[{"border-e":se()}],"border-w-bs":[{"border-bs":se()}],"border-w-be":[{"border-be":se()}],"border-w-t":[{"border-t":se()}],"border-w-r":[{"border-r":se()}],"border-w-b":[{"border-b":se()}],"border-w-l":[{"border-l":se()}],"divide-x":[{"divide-x":se()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":se()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ce(),`hidden`,`none`]}],"divide-style":[{divide:[...ce(),`hidden`,`none`]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-bs":[{"border-bs":P()}],"border-color-be":[{"border-be":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...ce(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[I,R,L]}],"outline-w":[{outline:[``,I,ze,Me]}],"outline-color":[{outline:P()}],shadow:[{shadow:[``,`inner`,`none`,u,We,Re]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":[`none`,d,We,Re]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:se()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[I,Me]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":se()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":[`none`,f,We,Re]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[I,R,L]}],"mix-blend":[{"mix-blend":[...le(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":le()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[I]}],"mask-image-linear-from-pos":[{"mask-linear-from":ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":ue()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":ue()}],"mask-image-t-to-pos":[{"mask-t-to":ue()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":ue()}],"mask-image-r-to-pos":[{"mask-r-to":ue()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":ue()}],"mask-image-b-to-pos":[{"mask-b-to":ue()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":ue()}],"mask-image-l-to-pos":[{"mask-l-to":ue()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":ue()}],"mask-image-x-to-pos":[{"mask-x-to":ue()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":ue()}],"mask-image-y-to-pos":[{"mask-y-to":ue()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[R,L]}],"mask-image-radial-from-pos":[{"mask-radial-from":ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":ue()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[I]}],"mask-image-conic-from-pos":[{"mask-conic-from":ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":ue()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ne()}],"mask-repeat":[{mask:re()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,R,L]}],filter:[{filter:[``,`none`,R,L]}],blur:[{blur:de()}],brightness:[{brightness:[I,R,L]}],contrast:[{contrast:[I,R,L]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,We,Re]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:[``,I,R,L]}],"hue-rotate":[{"hue-rotate":[I,R,L]}],invert:[{invert:[``,I,R,L]}],saturate:[{saturate:[I,R,L]}],sepia:[{sepia:[``,I,R,L]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,R,L]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[I,R,L]}],"backdrop-contrast":[{"backdrop-contrast":[I,R,L]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,I,R,L]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[I,R,L]}],"backdrop-invert":[{"backdrop-invert":[``,I,R,L]}],"backdrop-opacity":[{"backdrop-opacity":[I,R,L]}],"backdrop-saturate":[{"backdrop-saturate":[I,R,L]}],"backdrop-sepia":[{"backdrop-sepia":[``,I,R,L]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,R,L]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[I,`initial`,R,L]}],ease:[{ease:[`linear`,`initial`,_,R,L]}],delay:[{delay:[I,R,L]}],animate:[{animate:[`none`,v,R,L]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,R,L]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:F()}],"scale-x":[{"scale-x":F()}],"scale-y":[{"scale-y":F()}],"scale-z":[{"scale-z":F()}],"scale-3d":[`scale-3d`],skew:[{skew:me()}],"skew-x":[{"skew-x":me()}],"skew-y":[{"skew-y":me()}],transform:[{transform:[R,L,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:he()}],"translate-x":[{"translate-x":he()}],"translate-y":[{"translate-y":he()}],"translate-z":[{"translate-z":he()}],"translate-none":[`translate-none`],zoom:[{zoom:[xe,R,L]}],accent:[{accent:P()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,R,L]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":P()}],"scrollbar-track-color":[{"scrollbar-track":P()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,R,L]}],fill:[{fill:[`none`,...P()]}],"stroke-w":[{stroke:[I,ze,Me,Ne]}],stroke:[{stroke:[`none`,...P()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function z(...e){return nt(p(e))}function rt(){let e=crypto.getRandomValues(new Uint8Array(16)),t=Array.from(e,(e,t)=>(t===6?e&15|64:t===8?e&63|128:e).toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}var it=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),at=o(((e,t)=>{t.exports=it()})),B=l(d(),1),V=at(),ot=[`bg-[#efedff] text-[#5245de] dark:bg-[#8b7ffa]/15 dark:text-[#b4acff]`,`bg-[#e2f5ef] text-[#0e8a6c] dark:bg-[#2bbd95]/15 dark:text-[#5fd6b3]`,`bg-[#fdeef4] text-[#c2457a] dark:bg-[#f2a5c8]/15 dark:text-[#f2a5c8]`,`bg-[#e7effd] text-[#2f6fd6] dark:bg-[#5f9cf3]/15 dark:text-[#8ab8f7]`,`bg-[#fcf0d9] text-[#a76a05] dark:bg-[#e9a43a]/15 dark:text-[#f0bf70]`];function st(e){let t=0;for(let n of e)t=t*31+n.charCodeAt(0)>>>0;return t}function ct({id:e,name:t,src:n,size:r=32,className:i}){let[a,o]=(0,B.useState)(),s=(t?.trim()||e).slice(0,1).toUpperCase();return(0,V.jsxs)(`span`,{className:z(`relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full font-medium select-none`,ot[st(e)%ot.length],i),style:{width:r,height:r,fontSize:r*.4},children:[n&&n!==a?(0,V.jsx)(`img`,{src:n,alt:``,loading:`lazy`,referrerPolicy:`no-referrer`,className:`size-full object-cover`,onError:()=>o(n)}):s,(0,V.jsx)(`span`,{className:`absolute inset-0 rounded-full ring-1 ring-black/5 ring-inset dark:ring-white/10`})]})}var lt=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function ut(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:lt(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var dt=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},ft=e=>{let t=dt(e);return t.charAt(0).toUpperCase()+t.slice(1)},pt=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),mt={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function ht(e){return e!=null}function gt(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??mt.width,a=e.size??e.height??mt.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?pt(...c):pt(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??mt[`stroke-width`])*Number(e.size??e.width??mt.width)/Number(t.size??t.width??mt.width):t.strokeWidth??mt[`stroke-width`];return[`svg`,{...Object.entries(mt).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&ht(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&ht(t.width)&&{[r(`width`)]:t.width},...`height`in t&&ht(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function _t(e,t={}){return gt(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var vt=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},yt=(0,B.createContext)({}),bt=()=>(0,B.useContext)(yt),xt=(0,B.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:v=``}=bt()??{},y=!!c||vt(d),[b,x,S=[]]=_t(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:pt(v,s),hasA11yProp:y,attributes:d});return(0,B.createElement)(b,{ref:f,...x},[...S.map(([e,t])=>(0,B.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function H(e,t=[],n=[]){let r=typeof e==`string`?ut(e,t,n):e,i=(0,B.forwardRef)(({className:e,...t},n)=>(0,B.createElement)(xt,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=ft(r.name)),i}var St={name:`app-window`,size:24,node:[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}],[`path`,{d:`M10 4v4`,key:`pp8u80`}],[`path`,{d:`M2 8h20`,key:`d11cs7`}],[`path`,{d:`M6 4v4`,key:`1svtjw`}]]};St.node;var Ct=H(St),wt={name:`arrow-down-left`,size:24,node:[[`path`,{d:`M17 7 7 17`,key:`15tmo1`}],[`path`,{d:`M17 17H7V7`,key:`1org7z`}]]};wt.node;var Tt=H(wt),Et={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};Et.node;var Dt=H(Et),Ot={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};Ot.node;var kt=H(Ot),At={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};At.node;var jt=H(At),Mt={name:`arrow-up-right`,size:24,node:[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]};Mt.node;var Nt=H(Mt),Pt={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};Pt.node;var Ft=H(Pt),It={name:`at-sign`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8`,key:`7n84p3`}]]};It.node;var Lt=H(It),Rt={name:`ban`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]};Rt.node;var zt=H(Rt),Bt={name:`bell-ring`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M22 8c0-2.3-.8-4.3-2-6`,key:`5bb3ad`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}],[`path`,{d:`M4 2C2.8 3.7 2 5.7 2 8`,key:`tap9e0`}]]};Bt.node;var Vt=H(Bt),Ht={name:`book-open`,size:24,node:[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]};Ht.node;var Ut=H(Ht),Wt={name:`bot`,size:24,node:[[`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`}]]};Wt.node;var Gt=H(Wt),Kt={name:`braces`,size:24,node:[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]],aliases:[`curly-braces`]};Kt.node;var qt=H(Kt),Jt={name:`cable`,size:24,node:[[`path`,{d:`M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z`,key:`trhst0`}],[`path`,{d:`M17 21v-2`,key:`ds4u3f`}],[`path`,{d:`M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10`,key:`1mo9zo`}],[`path`,{d:`M21 21v-2`,key:`eo0ou`}],[`path`,{d:`M3 5V3`,key:`1k5hjh`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z`,key:`1dd30t`}],[`path`,{d:`M7 5V3`,key:`1t1388`}]]};Jt.node;var Yt=H(Jt),Xt={name:`calendar`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]};Xt.node;var Zt=H(Xt),Qt={name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],aliases:[`bar-chart-3`]};Qt.node;var $t=H(Qt),en={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};en.node;var tn=H(en),nn={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};nn.node;var rn=H(nn),an={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};an.node;var on=H(an),sn={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};sn.node;var cn=H(sn),ln={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};ln.node;var un=H(ln),dn={name:`circle-arrow-up`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 12-4-4-4 4`,key:`177agl`}],[`path`,{d:`M12 16V8`,key:`1sbj14`}]],aliases:[`arrow-up-circle`]};dn.node;var fn=H(dn),pn={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};pn.node;var mn=H(pn),hn={name:`circle-exclamation-point`,size:24,node:[[`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`}]],aliases:[`alert-circle`,`circle-alert`]};hn.node;var gn=H(hn),_n={name:`coins`,size:24,node:[[`path`,{d:`M13.744 17.736a6 6 0 1 1-7.48-7.48`,key:`bq4yh3`}],[`path`,{d:`M15 6h1v4`,key:`11y1tn`}],[`path`,{d:`m6.134 14.768.866-.5 2 3.464`,key:`17snzx`}],[`circle`,{cx:`16`,cy:`8`,r:`6`,key:`14bfc9`}]]};_n.node;var vn=H(_n),yn={name:`compass`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]};yn.node;var bn=H(yn),xn={name:`copy`,size:24,node:[[`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`}]]};xn.node;var Sn=H(xn),Cn={name:`corner-down-left`,size:24,node:[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]};Cn.node;var wn=H(Cn),Tn={name:`cpu`,size:24,node:[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]};Tn.node;var En=H(Tn),Dn={name:`crown`,size:24,node:[[`path`,{d:`M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z`,key:`1vdc57`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]};Dn.node;var On=H(Dn),kn={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};kn.node;var An=H(kn),jn={name:`eighth-notes`,size:24,node:[[`path`,{d:`M21 16V3a1 1 0 0 0-1.28-.96l-10 2.917a1 1 0 0 0-.72.96V19`,key:`uy6ho8`}],[`circle`,{cx:`18`,cy:`16`,r:`3`,key:`1hluhg`}],[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}]],aliases:[`music`]};jn.node;var Mn=H(jn),Nn={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};Nn.node;var Pn=H(Nn),Fn={name:`eraser`,size:24,node:[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]};Fn.node;var In=H(Fn),Ln={name:`external-link`,size:24,node:[[`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`}]]};Ln.node;var Rn=H(Ln),zn={name:`file-up`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]};zn.node;var Bn=H(zn),Vn={name:`flask-conical`,size:24,node:[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]};Vn.node;var Hn=H(Vn),Un={name:`gamepad-2`,size:24,node:[[`line`,{x1:`6`,x2:`10`,y1:`11`,y2:`11`,key:`1gktln`}],[`line`,{x1:`8`,x2:`8`,y1:`9`,y2:`13`,key:`qnk9ow`}],[`line`,{x1:`15`,x2:`15.01`,y1:`12`,y2:`12`,key:`krot7o`}],[`line`,{x1:`18`,x2:`18.01`,y1:`10`,y2:`10`,key:`1lcuu1`}],[`path`,{d:`M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z`,key:`mfqc10`}]]};Un.node;var Wn=H(Un),Gn={name:`gift`,size:24,node:[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M20 11v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8`,key:`1sqzm4`}],[`path`,{d:`M7.5 7a1 1 0 0 1 0-5A4.8 8 0 0 1 12 7a4.8 8 0 0 1 4.5-5 1 1 0 0 1 0 5`,key:`kc0143`}],[`rect`,{x:`3`,y:`7`,width:`18`,height:`4`,rx:`1`,key:`1hberx`}]]};Gn.node;var Kn=H(Gn),qn={name:`hand`,size:24,node:[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1fvzgz`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`,key:`1kc0my`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`,key:`10h0bg`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`1s1gnw`}]]};qn.node;var Jn=H(qn),Yn={name:`image-plus`,size:24,node:[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]};Yn.node;var Xn=H(Yn),Zn={name:`image`,size:24,node:[[`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`}]]};Zn.node;var Qn=H(Zn),$n={name:`inbox`,size:24,node:[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]};$n.node;var er=H($n),tr={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};tr.node;var nr=H(tr),rr={name:`layout-dashboard`,size:24,node:[[`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`}]]};rr.node;var ir=H(rr),ar={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};ar.node;var or=H(ar),sr={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};sr.node;var cr=H(sr),lr={name:`lock`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]};lr.node;var ur=H(lr),dr={name:`log-in`,size:24,node:[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]};dr.node;var fr=H(dr),pr={name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]};pr.node;var mr=H(pr),hr={name:`menu`,size:24,node:[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]};hr.node;var gr=H(hr),_r={name:`message-square-reply`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`m10 8-3 3 3 3`,key:`fp6dz7`}],[`path`,{d:`M17 14v-1a2 2 0 0 0-2-2H7`,key:`1tkjnz`}]]};_r.node;var vr=H(_r),yr={name:`messages-square`,size:24,node:[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]};yr.node;var br=H(yr),xr={name:`mic-off`,size:24,node:[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M15 9.34V5a3 3 0 0 0-5.68-1.33`,key:`1gzdoj`}],[`path`,{d:`M16.95 16.95A7 7 0 0 1 5 12v-2`,key:`cqa7eg`}],[`path`,{d:`M18.89 13.23A7 7 0 0 0 19 12v-2`,key:`16hl24`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v3a3 3 0 0 0 5.12 2.12`,key:`r2i35w`}]]};xr.node;var Sr=H(xr),Cr={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};Cr.node;var wr=H(Cr),Tr={name:`monitor`,size:24,node:[[`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`}]]};Tr.node;var Er=H(Tr),Dr={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};Dr.node;var Or=H(Dr),kr={name:`package-search`,size:24,node:[[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`path`,{d:`M20.27 18.27 22 20`,key:`er2am`}],[`path`,{d:`M21 10.498V8a2 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.729l7 4a2 2 0 0 0 2 .001l.98-.559`,key:`tok1h1`}],[`path`,{d:`M3.29 7 12 12l8.71-5`,key:`19ckod`}],[`path`,{d:`m7.5 4.27 8.997 5.148`,key:`9yrvtv`}],[`circle`,{cx:`18.5`,cy:`16.5`,r:`2.5`,key:`ke13xx`}]]};kr.node;var Ar=H(kr),jr={name:`package`,size:24,node:[[`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`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]};jr.node;var Mr=H(jr),Nr={name:`paperclip`,size:24,node:[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]};Nr.node;var Pr=H(Nr),Fr={name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]};Fr.node;var Ir=H(Fr),Lr={name:`pencil-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]};Lr.node;var Rr=H(Lr),zr={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};zr.node;var Br=H(zr),Vr={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};Vr.node;var Hr=H(Vr),Ur={name:`puzzle`,size:24,node:[[`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`}]]};Ur.node;var Wr=H(Ur),Gr={name:`radio`,size:24,node:[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]};Gr.node;var Kr=H(Gr),qr={name:`refresh-cw`,size:24,node:[[`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`}]]};qr.node;var Jr=H(qr),Yr={name:`reply`,size:24,node:[[`path`,{d:`M20 18v-2a4 4 0 0 0-4-4H4`,key:`5vmcpk`}],[`path`,{d:`m9 17-5-5 5-5`,key:`nvlc11`}]]};Yr.node;var Xr=H(Yr),Zr={name:`rotate-ccw`,size:24,node:[[`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`}]]};Zr.node;var Qr=H(Zr),$r={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};$r.node;var ei=H($r),ti={name:`save`,size:24,node:[[`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`}]]};ti.node;var ni=H(ti),ri={name:`scale`,size:24,node:[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`m19 8 3 8a5 5 0 0 1-6 0zV7`,key:`zcdpyk`}],[`path`,{d:`M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1`,key:`1yorad`}],[`path`,{d:`m5 8 3 8a5 5 0 0 1-6 0zV7`,key:`eua70x`}],[`path`,{d:`M7 21h10`,key:`1b0cd5`}]]};ri.node;var ii=H(ri),ai={name:`scan-line`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`path`,{d:`M7 12h10`,key:`b7w52i`}]]};ai.node;var oi=H(ai),si={name:`scroll-text`,size:24,node:[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]};si.node;var ci=H(si),li={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};li.node;var ui=H(li),di={name:`send`,size:24,node:[[`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`}]]};di.node;var fi=H(di),pi={name:`settings-2`,size:24,node:[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]};pi.node;var mi=H(pi),hi={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};hi.node;var gi=H(hi),_i={name:`share-2`,size:24,node:[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]};_i.node;var vi=H(_i),yi={name:`shield-check`,size:24,node:[[`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`}]]};yi.node;var bi=H(yi),xi={name:`shield-exclamation-point`,size:24,node:[[`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:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]],aliases:[`shield-alert`]};xi.node;var Si=H(xi),Ci={name:`shield`,size:24,node:[[`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`}]]};Ci.node;var wi=H(Ci),Ti={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};Ti.node;var Ei=H(Ti),Di={name:`smartphone`,size:24,node:[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]};Di.node;var Oi=H(Di),ki={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};ki.node;var Ai=H(ki),ji={name:`square-terminal`,size:24,node:[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]],aliases:[`terminal-square`]};ji.node;var Mi=H(ji),Ni={name:`star`,size:24,node:[[`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`}]]};Ni.node;var Pi=H(Ni),Fi={name:`store`,size:24,node:[[`path`,{d:`M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5`,key:`slp6dd`}],[`path`,{d:`M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244`,key:`o0xfot`}],[`path`,{d:`M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05`,key:`wn3emo`}]]};Fi.node;var Ii=H(Fi),Li={name:`sun`,size:24,node:[[`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`}]]};Li.node;var Ri=H(Li),zi={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};zi.node;var Bi=H(zi),Vi={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};Vi.node;var Hi=H(Vi),Ui={name:`triangle-exclamation-point`,size:24,node:[[`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`}]],aliases:[`alert-triangle`,`triangle-alert`]};Ui.node;var Wi=H(Ui),Gi={name:`trophy`,size:24,node:[[`path`,{d:`M10 14.66V17a1 1 0 0 1-1 1 2 2 0 0 0-2 2v2`,key:`pwuv1l`}],[`path`,{d:`M14 14.66V17a1 1 0 0 0 1 1 2 2 0 0 1 2 2v2`,key:`1y54w1`}],[`path`,{d:`M17.916 10H19.5A2.5 2.5 0 0 0 22 7.5V5a1 1 0 0 0-1-1h-3`,key:`e30mpu`}],[`path`,{d:`M4 22h16`,key:`57wxv0`}],[`path`,{d:`M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z`,key:`1mhfuq`}],[`path`,{d:`M6.084 10H4.5A2.5 2.5 0 0 1 2 7.5V5a1 1 0 0 1 1-1h3`,key:`i0yafy`}]]};Gi.node;var Ki=H(Gi),qi={name:`user-plus`,size:24,node:[[`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`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]};qi.node;var Ji=H(qi),Yi={name:`user`,size:24,node:[[`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`}]]};Yi.node;var Xi=H(Yi),Zi={name:`users`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]};Zi.node;var Qi=H(Zi),$i={name:`workflow`,size:24,node:[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]};$i.node;var ea=H($i),ta={name:`wrench`,size:24,node:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]};ta.node;var na=H(ta),ra={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};ra.node;var ia=H(ra),aa=(0,B.createContext)({});function oa(e){let t=(0,B.useRef)(null);return t.current===null&&(t.current=e()),t.current}var sa=typeof window<`u`?B.useLayoutEffect:B.useEffect,ca=(0,B.createContext)(null);function la(e,t){e.indexOf(t)===-1&&e.push(t)}function ua(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var da=(e,t,n)=>n>t?t:n<e?e:n,fa={},pa=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),ma=e=>typeof e==`object`&&!!e,ha=e=>/^0[^.\s]+$/u.test(e);function ga(e){let t;return()=>(t===void 0&&(t=e()),t)}var _a=e=>e,va=(...e)=>e.reduce((e,t)=>n=>t(e(n))),ya=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},ba=class{constructor(){this.subscriptions=[]}add(e){return la(this.subscriptions,e),()=>this.remove(e)}remove(e){ua(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},xa=e=>e*1e3,Sa=e=>e/1e3,Ca=(e,t)=>t?1e3/t*e:0,wa=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e},Ta=(e,t,n)=>e*(3*(1-e)*((1-e)*t+e*n)+e*e);function Ea(e,t,n,r){return e===t&&n===r?_a:i=>{let a=0,o=1,s=i;for(let t=0;;t++){s>=a&&s<=o||(s=(a+o)/2);let r=Ta(s,e,n)-i;if(r*r<1e-28||t===40)break;r>0?o=s:a=s,s-=r*1e-7/(Ta(s+1e-7,e,n)-i-r)}return Ta(s,t,r)}}var Da=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Oa=e=>t=>1-e(1-t),ka=Ea(.33,1.53,.69,.99),Aa=Oa(ka),ja=Da(Aa),Ma=e=>e>=1?1:(e*=2)<1?.5*Aa(e):.5*(2-2**(-10*(e-1))),Na=e=>1-Math.sin(Math.acos(e)),Pa=Oa(Na),Fa=Da(Na),Ia=Ea(.42,0,1,1),La=Ea(0,0,.58,1),Ra=Ea(.42,0,.58,1),za=e=>Array.isArray(e)&&typeof e[0]!=`number`;function Ba(e,t){return za(e)?e[wa(0,e.length,t)]:e}var Va=e=>Array.isArray(e)&&typeof e[0]==`number`,Ha={linear:_a,easeIn:Ia,easeInOut:Ra,easeOut:La,circIn:Na,circInOut:Fa,circOut:Pa,backIn:Aa,backInOut:ja,backOut:ka,anticipate:Ma},Ua=e=>typeof e==`string`,Wa=e=>{if(Va(e)){let[t,n,r,i]=e;return Ea(t,n,r,i)}return Ua(e)?Ha[e]:e},Ga={delta:0,timestamp:0,isProcessing:!1},Ka;function qa(){Ka=void 0}var Ja={now:()=>(Ka===void 0&&Ja.set(Ga.isProcessing||fa.useManualTiming?Ga.timestamp:performance.now()),Ka),set:e=>{Ka=e,queueMicrotask(qa)}},Ya=e=>Math.round(e*1e5)/1e5,Xa=e=>t=>typeof t==`string`&&t.startsWith(e),Za=Xa(`--`),Qa=Xa(`var(--`),$a=e=>Qa(e)?eo.test(e.split(`/*`)[0].trim()):!1,eo=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function to(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var no={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},ro={...no,transform:e=>da(0,1,e)},io={...no,default:1},ao=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function oo(e){return e==null}var so=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,co=(e,t)=>n=>!!(typeof n==`string`&&so.test(n)&&n.startsWith(e)||t&&!oo(n)&&Object.prototype.hasOwnProperty.call(n,t)),lo=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(ao);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},uo=e=>da(0,255,e),fo={...no,transform:e=>Math.round(uo(e))},po={test:co(`rgb`,`red`),parse:lo(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+fo.transform(e)+`, `+fo.transform(t)+`, `+fo.transform(n)+`, `+Ya(ro.transform(r))+`)`},mo=(e,t,n)=>{let r=e.substring(1+t*n,1+(t+1)*n);return n>1?r:r+r};function ho(e){let t=e.length>5?2:1,n=mo(e,3,t);return{red:parseInt(mo(e,0,t),16),green:parseInt(mo(e,1,t),16),blue:parseInt(mo(e,2,t),16),alpha:n?parseInt(n,16)/255:1}}var go={test:co(`#`),parse:ho,transform:po.transform},_o=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),vo=_o(`deg`),yo=_o(`%`),U=_o(`px`),bo=_o(`vh`),xo=_o(`vw`),So={...yo,parse:e=>yo.parse(e)/100,transform:e=>yo.transform(e*100)},Co={test:co(`hsl`,`hue`),parse:lo(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+yo.transform(Ya(t))+`, `+yo.transform(Ya(n))+`, `+Ya(ro.transform(r))+`)`},wo={test:e=>po.test(e)||go.test(e)||Co.test(e),parse:e=>po.test(e)?po.parse(e):Co.test(e)?Co.parse(e):go.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?po.transform(e):Co.transform(e),getAnimatableNone:e=>{let t=wo.parse(e);return t.alpha=0,wo.transform(t)}},To=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Eo=new RegExp(ao.source),Do=new RegExp(To.source,`i`);function Oo(e){return isNaN(e)&&typeof e==`string`&&(Eo.test(e)||Do.test(e))}var ko=`number`,Ao=`color`,jo=`var`,Mo=`var(`,No="${}",Po=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)(?![a-z]*\()/giu;function Fo(e){let t=e.toString();return Eo.test(t)||Do.test(t)}function Io(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Po,e=>(wo.test(e)?(r.color.push(a),i.push(Ao),n.push(wo.parse(e))):e.startsWith(Mo)?(r.var.push(a),i.push(jo),n.push(e)):(r.number.push(a),i.push(ko),n.push(parseFloat(e))),++a,No)).split(No),indexes:r,types:i}}function Lo(e){return Io(e).values}function W({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===ko?Ya(r[a]):e===Ao?wo.transform(r[a]):r[a]}return i}}function Ro(e){return W(Io(e))}var zo=e=>typeof e==`number`?0:wo.test(e)?wo.getAnimatableNone(e):e,Bo=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:zo(e);function Vo(e){let t=Io(e);return W(t)(t.values.map((e,n)=>Bo(e,t.split[n])))}var Ho={test:Oo,parse:Lo,createTransformer:Ro,getAnimatableNone:Vo};function Uo(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Wo({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Uo(s,r,e+1/3),a=Uo(s,r,e),o=Uo(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Go(e,t){return n=>n>0?t:e}var Ko=(e,t,n)=>e+(t-e)*n,qo=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Jo=[go,po,Co],Yo=e=>Jo.find(t=>t.test(e));function Xo(e){let t=Yo(e);if(!t)return!1;let n=t.parse(e);return t===Co&&(n=Wo(n)),n}var Zo=(e,t)=>{let n=Xo(e),r=Xo(t);if(!n||!r)return Go(e,t);let i={...n};return e=>(i.red=qo(n.red,r.red,e),i.green=qo(n.green,r.green,e),i.blue=qo(n.blue,r.blue,e),i.alpha=Ko(n.alpha,r.alpha,e),po.transform(i))},Qo=new Set([`none`,`hidden`]);function $o(e,t){return Qo.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function es(e,t){return n=>Ko(e,t,n)}function ts(e){return typeof e==`number`?es:typeof e==`string`?$a(e)?Go:wo.test(e)?Zo:as:Array.isArray(e)?ns:typeof e==`object`?wo.test(e)?Zo:rs:Go}function ns(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>ts(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function rs(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=ts(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function is(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var as=(e,t)=>{let n=Io(e),r=Io(t);return n.indexes.var.length===r.indexes.var.length&&n.indexes.color.length===r.indexes.color.length&&n.indexes.number.length>=r.indexes.number.length?Qo.has(e)&&!r.values.length||Qo.has(t)&&!n.values.length?$o(e,t):va(ns(is(n,r),r.values),W(r)):Go(e,t)},os=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function ss(e,t){let n=os.exec(e);if(!n)return;let r=os.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>Ya(Ko(a,o,e))+i}function cs(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return Ko(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=ss(e,t);if(n)return n}return ts(e)(e,t)}var ls=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function us(e){let t=new Set,n=new Set,r=!1,i=!1,a,o=new Set,s={delta:0,timestamp:0,isProcessing:!1};function c(t){o.has(t)&&(n.add(t),e()),(a=t)(s)}let l={schedule:(e,i=!1,s=!1)=>{let c=s&&r,l=c?t:n;return i&&o.add(e),c&&e!==a&&l.delete(e),l.add(e),e},cancel:e=>{n.delete(e),o.delete(e)},process:e=>{if(s=e,r){i=!0;return}r=!0;let o=t;t=n,n=o,t.forEach(c),t.clear(),a=void 0,r=!1,i&&(i=!1,l.process(e))}};return l}var ds=40;function fs(e,t,n={delta:0,timestamp:0,isProcessing:!1}){let r=!1,i=!0,a=()=>r=!0,o=ls.reduce((e,t)=>(e[t]=us(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=fa.useManualTiming,o=a?n.timestamp:performance.now();r=!1,a||(n.delta=i?1e3/60:Math.max(Math.min(o-n.timestamp,ds),1)),n.timestamp=o,n.isProcessing=!0,s.process(n),c.process(n),l.process(n),u.process(n),d.process(n),f.process(n),p.process(n),m.process(n),n.isProcessing=!1,r&&t&&(i=!1,e(h))},g=()=>{r=!0,i=!0,n.isProcessing||e(h)};return{schedule:ls.reduce((e,t)=>{let n=o[t];return e[t]=(e,t=!1,i=!1)=>(r||g(),n.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<ls.length;t++)o[ls[t]].cancel(e)},state:n,steps:o}}var{schedule:ps,cancel:ms,steps:hs}=fs(typeof requestAnimationFrame<`u`?requestAnimationFrame:_a,!0,Ga),gs=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>ps.update(t,e),stop:()=>ms(t),now:()=>Ga.isProcessing?Ga.timestamp:Ja.now()}},_s=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},vs=2e4;function ys(e,t=50,n=vs,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function bs(e,t=100,n){let{keyframes:r,velocity:i}=e,a=r&&r[r.length-1]-r[0],o=n({...e,velocity:i&&a?i*t/a:i,keyframes:[0,t]}),s=Math.min(ys(o),vs);return{type:`keyframes`,ease:e=>o.next(s*e).value/t,duration:Sa(s)}}var xs=100,Ss=10,Cs=1,ws=800,Ts=.3,Es=.3,Ds=.01,Os=2,ks=.005,As=.5,js=.01,Ms=10,Ns=.05,Ps=e=>e<0?1/Math.max(1+e,Ns):Math.max(1-e,Ns);function Fs(e,t){if(!(e>1))return 1;let n=Math.sqrt(e*e-1),r=e-n,i=e+n,a=2*n*Math.exp(-t)*(1+t);return Rs(e=>i*Math.exp(-r*e)-r*Math.exp(-i*e)-a,e=>Math.exp(-i*e)-Math.exp(-r*e),t)/t}function Is(e,t){return e*Math.sqrt(1-t*t)}var Ls=12;function Rs(e,t,n){let r=n;for(let n=1;n<Ls;n++)r-=e(r)/t(r);return r}var zs=.001;function Bs({duration:e=ws,bounce:t=Ts}){let n,r,i=Ps(t);e=da(js,Ms,Sa(e)),i<1?(n=t=>{let n=t*i,r=n*e,a=Is(t,i),o=Math.exp(-r);return zs-n/a*o},r=t=>{let r=t*i*e,a=i*i*t*t*e,o=Math.exp(-r),s=Is(t*t,i);return(-n(t)+zs>0?-1:1)*-a*o/s}):(n=t=>-.001+Math.exp(-t*e)*(t*e+1),r=t=>Math.exp(-t*e)*(-t*(e*e)));let a=5/e,o=Rs(n,r,a),s=o*Fs(i,o*e),c=s*s;return{stiffness:c,damping:i*2*Math.sqrt(c),duration:xa(e)}}var Vs=(e,t)=>(t?e>=0:e>0)&&e<1/0;function Hs(e,t){if(Vs(e,t))return e}function Us(e){let t=Hs(e.stiffness),n=Hs(e.damping,!0),r=Hs(e.mass),i={...e,stiffness:t??xs,damping:n??Ss,mass:r??Cs,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(i.isTimeDefined){if(e.visualDuration){let t=Ps(e.bounce||0),n=2*Math.PI/(e.visualDuration*1.2)*Fs(t,2*Math.PI/1.2);i.stiffness=n*n,i.damping=2*t*Math.sqrt(i.stiffness)}else Object.assign(i,Bs(i)),i.isResolvedFromDuration=!0;Vs(i.stiffness)&&Vs(i.damping,!0)||(i.stiffness=xs,i.damping=Ss)}return i}function Ws(e=Es,t=Ts){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,isResolvedFromDuration:u,isTimeDefined:d}=Us({...n}),f=e=>u?0:-Sa(e),p=s/(2*Math.sqrt(o*c)),m=Sa(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:f(n.velocity)||0,restSpeed:0,restDelta:0},_=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?Ds:Os),g.restDelta=n.restDelta||(e?ks:As)};_();let v,y,b;if(p<1){let e=Is(m,p),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};b=()=>{t.A=(g.velocity+h*g.delta)/e,t.sinC=h*t.A+g.delta*e,t.cosC=h*g.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-h*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};v=e=>(n(e),g.target-t.env*(t.A*t.sin+g.delta*t.cos)),y=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(p===1){v=e=>g.target-Math.exp(-m*e)*(g.delta+(g.velocity+m*g.delta)*e);let e={C:0};b=()=>{e.C=g.velocity+m*g.delta},y=t=>Math.exp(-m*t)*(m*e.C*t-g.velocity)}else{let e=m*Math.sqrt(p*p-1),t=h-e,n=h+e,r=e<1||d?1/0:300/e,i=(e,t)=>Math.exp(t>r?(h-e)*r-h*t:-e*t),a={S:0,F:0};b=()=>{let t=(g.velocity+h*g.delta)/e;a.S=(g.delta+t)/2,a.F=(g.delta-t)/2},v=e=>g.target-a.S*i(t,e)-a.F*i(n,e),y=e=>t*a.S*i(t,e)+n*a.F*i(n,e)}b();let x=u&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f(t),n.restSpeed&&n.restDelta||_(),S.calculatedDuration=x,a.done=!1,b()},velocity:e=>xa(y(e)),next:e=>{let t=v(e);if(u)a.done=e>=l;else{let n=xa(y(e));a.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-t)<=g.restDelta}return a.value=a.done?g.target:t,a},toString:()=>{let e=Math.min(ys(S),vs),t=_s(t=>S.next(e*t).value,e,30);return e+`ms `+t}};return S}var Gs=Object.assign(Ws,{applyToOptions:e=>{let t=bs(e,100,Ws);return e.ease=t.ease,e.duration=xa(t.duration),e.type=`keyframes`,e}});function Ks({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>e<s||e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o?o(g):g;_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:e?_+t:d},b,x,S=e=>{p(f.value)&&(b=e,x=Gs({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function qs(e,t,n){let r=[],i=fa.mix||cs,a=e.length-1;for(let o=0;o<a;o++){let a=n?.(e[o],e[o+1])||i(e[o],e[o+1]);t&&(a=va(Array.isArray(t)?t[o]||_a:t,a)),r.push(a)}return r}function Js(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=qs(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=ya(e[r],e[r+1],n);return s[r](i)};return n?t=>l(da(e[0],e[a-1],t)):l}function Ys(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=ya(0,t,r);e.push(Ko(n,1,i))}}function Xs(e){let t=[0];return Ys(t,e.length-1),t}function Zs(e,t){return e.map(e=>e*t)}function Qs(e,t){return e.map(()=>t||Ra).splice(0,e.length-1)}function $s({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`,mixer:i}){let a=typeof t[0]==`number`?void 0:i,o=za(r)?r.map(Wa):Wa(r)||Ra,s={done:!1,value:t[0]},c=-1;if(!a){for(let e=1;e<t.length;e++)if(t[e]!==t[e-1]){if(c>=0){c=-2;break}c=e-1}}if(c>=0){let r=n&&n.length===t.length?n:Xs(t),i=r[c]*e,a=r[c+1]*e,l=t[c],u=t[c+1],d=Array.isArray(o)?o[c]:o,f=(fa.mix||cs)(l,u),p=t.length-2;return{calculatedDuration:e,next:t=>(s.value=c&&t<i?f(0):c<p&&(t>=a||!e)?typeof u==`number`?u:f(1):f(d(t>=a||!e?1:t<=i?0:(t-i)/(a-i))),s.done=t>=e,s)}}let l=Js(Zs(n&&n.length===t.length?n:Xs(t),e),t,{ease:Array.isArray(o)?o:Qs(t,o),mixer:a});return{calculatedDuration:e,next:t=>(s.value=l(t),s.done=t>=e,s)}}var ec=5;function tc(e,t,n){let r=Math.max(t-ec,0);return Ca(n-e(r),t-r)}function nc(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):tc(t=>e.next(t).value,t,e.next(t).value)}function rc(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a,o,s=0;for(let t=0;t<e.length;t++){let n=e[t];n!==null&&(s++||(a=n),o=n)}let c=i<0||t&&n!==`loop`&&t%2==1?0:s-1;return!c||r===void 0?c?o:a:r}var ic={decay:Ks,inertia:Ks,tween:$s,keyframes:$s,spring:Gs};function ac(e){typeof e.type==`string`&&(e.type=ic[e.type])}var oc=40,sc=(e,t)=>t-e>oc&&!fa.useManualTiming?t:e;function cc(e,t){return{kind:e,animation:t,timestamp:Ja.now(),frameTimestamp:Ga.timestamp,frameIsProcessing:Ga.isProcessing}}function lc(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...cc(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function uc(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...cc(`layout-animation-start`,e),node:t})}catch{}}var dc=class{constructor(){this.isResolved=!1}get finished(){return this._finished||=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e}),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}},fc=e=>e/100,pc=e=>Math.round(e*1e4)/1e4,mc=class extends dc{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options,t=Ja.now();e&&e.updatedAt!==t&&this.tick(e.updatedAt=t),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),lc(this,this.options)}initAnimation(){let{options:e}=this;ac(e);let{type:t=$s,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||$s;this.mixKeyframes=void 0,s!==$s&&typeof o[0]!=`number`&&(this.mixKeyframes=va(fc,e.mixer?.(o[0],o[1])||cs(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=ys(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){this.currentTime=this.holdTime??Math.round(e-this.startTime)*this.playbackSpeed}tick(e,t=!1){let{generator:n,totalDuration:r,calculatedDuration:i}=this;if(this.startTime===null)return n.next(0);let{delay:a=0,keyframes:o,type:s,onUpdate:c,finalKeyframe:l}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=sc(this.startTime,e)),this.pendingStartTime=void 0,this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let u=this.currentTime-a*(this.playbackSpeed>=0?1:-1),d=this.playbackSpeed>=0?u<0:u>r;this.currentTime=Math.max(u,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let f=this.generate(this.currentTime,d),{done:p}=f;d||(p=this.playbackSpeed>=0?i<1/0?this.currentTime>=r:p:this.currentTime<=0);let m=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&p);return m&&s!==Ks&&(f.value=rc(o,this.options,l,this.speed)),c&&c(f.value),m&&this.finish(),f}at(e){return this.holdTime??pc((e-this.startTime)*this.playbackSpeed)}sampleAt(e,t){let{options:n,totalDuration:r}=this,i=this.at(e)-(n.delay||0);return i>=r&&n.type!==Ks?rc(n.keyframes,n,t?void 0:n.finalKeyframe):this.generate(Math.max(i,0),i<0).value}generate(e,t){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o}=this,{keyframes:s,repeat:c,repeatType:l,repeatDelay:u}=this.options,d=e,f=n;if(c){let t=Math.min(e,r)/o,n=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),i===1&&n--,n=Math.min(n,c+1),n%2&&(l===`reverse`?(i=1-i,u&&(i-=u/o)):l===`mirror`&&(f=a)),d=da(0,1,i)*o}let p;return t?(this.delayState.value=s[0],p=this.delayState):p=f.next(d),i&&!t&&(p.value=i(p.value)),p}get duration(){return Sa(this.calculatedDuration)}get iterationDuration(){return this.duration+Sa(this.options.delay??0)}get time(){return Sa(this.currentTime)}set time(e){this.state===`finished`&&this.updateFinished(),e=xa(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return nc(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(Ja.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=Sa(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=gs,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??(this.pendingStartTime=n):this.startTime=n-this.holdTime/(this.playbackSpeed||1),this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(Ja.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.driver?.stop(),this.driver=void 0,this.startTime=this.holdTime=null}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}},hc=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function gc(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(ao)||[];if(!r)return e;let i=n.replace(r,``),a=+!!hc.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var _c=/\b([a-z-]*)\(.*?\)/gu,vc={...Ho,getAnimatableNone:e=>{let t=e.match(_c);return t?t.map(gc).join(` `):e}},yc={...Ho,getAnimatableNone:e=>{let t=Ho.parse(e);return Ho.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},bc={...no,transform:Math.round},xc={rotate:vo,pathRotation:vo,rotateX:vo,rotateY:vo,rotateZ:vo,scale:io,scaleX:io,scaleY:io,scaleZ:io,skew:vo,skewX:vo,skewY:vo,distance:U,translateX:U,translateY:U,translateZ:U,x:U,y:U,z:U,perspective:U,transformPerspective:U,opacity:ro,originX:So,originY:So,originZ:U},Sc={borderWidth:U,borderTopWidth:U,borderRightWidth:U,borderBottomWidth:U,borderLeftWidth:U,borderRadius:U,borderTopLeftRadius:U,borderTopRightRadius:U,borderBottomRightRadius:U,borderBottomLeftRadius:U,width:U,maxWidth:U,height:U,maxHeight:U,top:U,right:U,bottom:U,left:U,inset:U,insetBlock:U,insetBlockStart:U,insetBlockEnd:U,insetInline:U,insetInlineStart:U,insetInlineEnd:U,padding:U,paddingTop:U,paddingRight:U,paddingBottom:U,paddingLeft:U,paddingBlock:U,paddingBlockStart:U,paddingBlockEnd:U,paddingInline:U,paddingInlineStart:U,paddingInlineEnd:U,margin:U,marginTop:U,marginRight:U,marginBottom:U,marginLeft:U,marginBlock:U,marginBlockStart:U,marginBlockEnd:U,marginInline:U,marginInlineStart:U,marginInlineEnd:U,fontSize:U,backgroundPositionX:U,backgroundPositionY:U,...xc,zIndex:bc,fillOpacity:ro,strokeOpacity:ro,numOctaves:bc},Cc={...Sc,color:wo,backgroundColor:wo,outlineColor:wo,fill:wo,stroke:wo,borderColor:wo,borderTopColor:wo,borderRightColor:wo,borderBottomColor:wo,borderLeftColor:wo,filter:vc,WebkitFilter:vc,mask:yc,WebkitMask:yc},wc=e=>Cc[e],Tc=new Set([vc,yc]),Ec,Dc,Oc;function kc(e,t){if(e===Ec&&t===Dc)return Oc;let n=wc(e);return Tc.has(n)||(n=Ho),Oc=n.getAnimatableNone?n.getAnimatableNone(t):void 0,Ec=e,Dc=t,Oc}function Ac(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var jc=e=>e*180/Math.PI,Mc=e=>Pc(jc(Math.atan2(e[1],e[0]))),Nc={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scaleZ:()=>1,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Mc,rotateZ:Mc,skewX:e=>jc(Math.atan(e[1])),skewY:e=>jc(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Pc=e=>(e%=360,e<0&&(e+=360),e),Fc=Mc,Ic=e=>Math.hypot(e[0],e[1]),Lc=e=>Math.hypot(e[4],e[5]),Rc={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ic,scaleY:Lc,scaleZ:e=>Math.hypot(e[8],e[9],e[10]),scale:e=>(Ic(e)+Lc(e))/2,rotateX:e=>Pc(jc(Math.atan2(e[6],e[5]))),rotateY:e=>Pc(jc(Math.atan2(-e[2],e[0]))),rotateZ:Fc,rotate:Fc,skewX:e=>jc(Math.atan(e[4])),skewY:e=>jc(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function zc(e){return+!!e.includes(`scale`)}function Bc(e,t){if(!e||e===`none`)return zc(t);let n=e.match(/^matrix(3d)?\(([-\d.e\s,]+)\)$/u);if(!n)return zc(t);let r=(n[1]?Rc:Nc)[t],i=n[2].split(`,`).map(e=>parseFloat(e));return typeof r==`function`?r(i):i[r]}var Vc=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return Bc(n,t)},Hc=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`scaleZ`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Uc=new Set([...Hc,`pathRotation`]),Wc=e=>e===no||e===U,Gc=new Set([`x`,`y`,`z`]),Kc=Hc.filter(e=>!Gc.has(e));function qc(e){let t=[];return Kc.forEach(n=>{let r=e.getValue(n);if(r!==void 0){let e=r.get(),i=+!!n.startsWith(`scale`);if(e===i)return;t.push([n,e]),r.set(i)}}),t}var Jc=new Set([`bottom`,`right`]);function Yc(e,t,n,r,i,a){let o=parseFloat(e);if(!isNaN(o))return o;let{min:s,max:c}=t()[n],l=c-s;return a===`border-box`?l:l-parseFloat(r)-parseFloat(i)}var Xc=({transform:e})=>Bc(e,`x`),Zc=({transform:e})=>Bc(e,`y`),Qc={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>Yc(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>Yc(e,i,`y`,t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{let{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:Xc,y:Zc,translateX:Xc,translateY:Zc},$c=new Set,el=!1,tl=!1,nl=!1;function rl(){if(tl){let e=[],t=new Set,n=new Set;$c.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),Jc.has(r.name)&&n.add(r.element))});let r=new Map;n.forEach(e=>{let t=qc(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}tl=!1,el=!1,$c.forEach(e=>e.complete(nl)),$c.clear()}function il(){$c.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(tl=!0)})}function al(){nl=!0,il(),rl(),nl=!1}function ol(e,t,n){if(typeof e==`string`){if(pa(e)||ha(e))return parseFloat(e);if(!Ho.test(e)&&Ho.test(n))return kc(t,n)}return e??void 0}var sl=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?($c.add(this),el||(el=!0,ps.read(il),ps.resolveKeyframes(rl))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=ol(n.readValue(t,a),t,a);r!==void 0&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}Ac(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),$c.delete(this)}cancel(){this.state===`scheduled`&&($c.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},cl=e=>e.startsWith(`--`);function ll(e,t,n){cl(t)?e.style.setProperty(t,n):e.style[t]=n}var ul={};function dl(e,t){let n=ga(e);return()=>ul[t]??n()}var fl=dl(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),pl=dl(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),ml=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,hl={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:ml([0,.65,.55,1]),circOut:ml([.55,0,1,.45]),backIn:ml([.31,.01,.66,-.59]),backOut:ml([.33,1.53,.69,.99])};function gl(e,t){if(e)return typeof e==`function`?pl()?_s(e,t):`ease-out`:Va(e)?ml(e):Array.isArray(e)?e.map(e=>gl(e,t)||hl.easeOut):hl[e]}function _l(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=gl(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function vl(e){return typeof e==`function`&&`applyToOptions`in e}function yl({type:e,...t}){return vl(e)&&pl()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var bl=class extends dc{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e;let c=yl(e);this.animation=_l(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=this.onFinish=()=>{if(this.animation.onfinish=null,this.finishedTime=this.time,!i){let e=rc(r,this.options,o,this.speed);this.updateMotionValue?.(e),ll(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},lc(this,e,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.onfinish=this.onFinish,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.isStopped||(this.animation.onfinish=this.onFinish),this.animation.finish?.()}cancel(){this.animation.onfinish=null;try{this.animation.cancel()}catch{}}stop(){this.isStopped||(this.isStopped=!0,this.state!==`idle`&&this.finishedTime===null&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel()))}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return Sa(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Sa(e)}get time(){return Sa(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=xa(e),t&&(this.animation.pause(),this.updateFinished())}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,onAttach:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=this.onFinish=null,e&&fl()?(this.animation.timeline=e,t?.(this.animation),_a):n(this)}},xl={anticipate:Ma,backInOut:ja,circInOut:Fa};function Sl(e){return e in xl}function Cl(e){typeof e.ease==`string`&&Sl(e.ease)&&(e.ease=xl[e.ease])}var wl=class extends bl{constructor(e){Cl(e),ac(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}elapsed(){return this.state===`running`?(Ja.now()-this.startTime)*this.speed:this.time*1e3}sample(e){if(!this.sampler){let{motionValue:e,onUpdate:t,onComplete:n,onPlay:r,onStop:i,element:a,...o}=this.options;this.sampler=new mc({...o,autoplay:!1}),this.sampler.stop()}return this.sampler.sample(Math.max(0,e)).value}liveValue(){let{state:e}=this;if(e===`running`||e===`paused`)return this.sample(this.elapsed())}updateMotionValue(e){let{motionValue:t,element:n,name:r}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let{speed:i}=this,a=this.elapsed(),o=this.state===`running`&&i?da(0,10,a):0,s=this.sample(a);n&&r&&ll(n,r,s),t.setWithVelocity(this.sample(a-o*Math.sign(i)),s,o/Math.abs(i||1))}},Tl=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Ho.test(e)||e===`0`)&&!e.startsWith(`url(`));function El(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Dl(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=Tl(i,t),s=Tl(a,t);return!o||!s?!1:El(e)||(n===`spring`||vl(n))&&r}function Ol(e){e.duration=0,e.type=`keyframes`}var kl=new Set([`opacity`,`clipPath`,`filter`,`transform`]),Al=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function jl(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&Al.test(e[t]))return!0;return!1}var Ml=({mixer:e,keyframes:t})=>e&&typeof t[0]!=`number`&&t.some((n,r)=>r&&e(t[r-1],n)),Nl=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),Pl=()=>!fa.useManualTiming&&Object.hasOwnProperty.call(Element.prototype,`animate`);function Fl(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(kl.has(n)||Nl.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return Pl()&&(kl.has(n)||Nl.has(n)&&jl(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`&&!Ml(e)}var Il=(e,t)=>t&&typeof e==`number`?t.transform(e):e,Ll={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},Rl=Hc.length,zl={},Bl=(e,t,n=Il(t,xc[e]))=>(zl[e]||(zl[e]=(Ll[e]||e)+`(`))+n+`)`,Vl=(e,t)=>(typeof t==`number`?t:parseFloat(t))===+!!e.startsWith(`scale`);function Hl(e,t,n){let r=``;for(let i=0;i<Rl;i++){let a=Hc[i],o=e[a];if(o===void 0)continue;let s=n&&(t[a]=Il(o,Sc[a]));Vl(a,o)||(r+=Bl(a,o,s||void 0)+` `)}let i=e.pathRotation;return i&&(r+=Bl(`rotate`,i)),r=r.trim(),n?n(t,r):r||`none`}var Ul=new WeakMap,Wl=200,Gl=.001,Kl=.1,ql=.001,Jl=100,Yl=100,Xl=new Set([`linear`,`easeIn`,`easeOut`,`easeInOut`]),Zl=e=>Xl.has(e),Ql=new WeakMap,$l=(e,t)=>{let n=Ql.get(e);return n?.[0]!==t&&(n=[t,`linear(`+Xs(Array(t+1)).map(t=>pc(e(t))+` `+pc(t*100)+`%`)+`)`],Ql.set(e,n)),n[1]},eu=(e,t)=>Math.min(Wl,Math.max(2,Math.ceil((t-e)/10))),tu=(e,t)=>Math.abs(e-t)<=Gl,nu=(e,t)=>e-t,ru=(e,t,n)=>Xs(Array(n+1)).map(n=>Ko(e,t,n)),iu=e=>e.motionValue.owner,au=e=>Ul.get(e),ou=({state:e})=>e===`idle`||e===`finished`,su=(e,t)=>e.latestValues?e.latestValues[t]:e.getValue(t)?.get(),cu=({name:e,motionValue:t})=>e&&Hc.includes(e)&&t?.owner?.current instanceof HTMLElement&&Pl()&&pl();function lu(e){let t=iu(e),{onUpdate:n,transformTemplate:r}=t.getProps();return!e.isHandoff&&!n&&!e.hasOnUpdate&&!r&&e.type!==`inertia`&&(su(t,`transform`)||`none`)===`none`&&!su(t,`pathRotation`)&&!t.projection?.isProjecting()&&!Ml(e)}var uu=class{constructor(e,t,n,r){this.element=e,this.update=t,this.makeDriver=n,this.animation=r}get js(){return this.driver||=this.makeDriver(this.update)}now(){return this.driver||this.makeDriver!==gs?this.js.now():Ga.isProcessing?Ga.timestamp:Ja.now()}start(e=!0){let t=au(this.element);!t||t.isJS?this.js.start(e):t.schedule(!1,!e)}stopJS(){this.driver?.stop()}stop(){this.stopJS();let e=au(this.element);e&&!e.isFinishing&&e.release(this.animation)}},du,fu=class extends mc{constructor(e){let t=iu(e).current,{driver:n=gs}=e,r,i=lu(e);e.driver=e=>new uu(t,e,n,r),super(e),r=this;let a=this.driver;a&&(a.animation=this),this.canAccelerate=i;let{stop:o}=this;this.stop=()=>{this.isAccelerated()&&this.sync(),o()}}offsets(){let{keyframes:e,times:t}=this.options;return t||(this.offsetsOf!==e&&(this.offsetsOf=e,this.cachedOffsets=Xs(e)),this.cachedOffsets)}get group(){return au(iu(this.options).current)}get js(){return this.driver?.js}stopJS(){this.driver?.stopJS()}get name(){return this.options.name}timing(){let{startTime:e,speed:t,totalDuration:n}=this,{delay:r=0,repeatType:i}=this.options;return this.holdTime===null?n===1/0?[e+r/t,this.resolvedDuration*(i===`loop`?1:2)/t||1]:[e+(r+n)/t,0]:[1/0,0]}isAccelerated(){let{group:e,state:t}=this;return e?.tracks.has(this)&&!e.isJS&&this.canAccelerate&&(t===`running`||t===`paused`)}liveValue(){return this.isAccelerated()?this.sampleAt(Ja.now()):void 0}tween(){let{keyframes:e,type:t,repeat:n,delay:r=0}=this.options,i=-1;if(n||t!==$s||this.holdTime!==null)return;for(let t=1;t<e.length;t++)if(e[t]!==e[t-1]){if(i>=0)return;i=t-1}let{ease:a}=this.options;za(a)&&(a=a[i]);let o=this.offsets(),s=e=>this.startTime+(r+o[e]*this.totalDuration)/this.speed;if(i>=0){let e=Va(a)?ml(a):Zl(a)?hl[a]:Wa(a);return[s(i),s(i+1),typeof e==`string`||tu(e(0),0)&&tu(e(1),1)?e:void 0]}}boundaries(e,t){let{startTime:n,speed:r,resolvedDuration:i,options:a}=this,{delay:o=0,repeat:s=0,repeatDelay:c=0,repeatType:l,type:u}=a,d=(u||$s)===$s?this.offsets():[0,1],f=n+o/r,p=[];if(this.holdTime!==null||!(i>0))return p;for(let n=Math.max(0,Math.floor((e-f)*r/i));n<=s;n++){let a=f+n*i/r;if(a>t)break;for(let o of d){let s=a+(n%2&&l&&l!==`loop`?1-o:o)*(i-c)/r;s>e&&s<t&&p.push(s)}}return p}numberAt(e){return parseFloat(this.sampleAt(e,!0))}sync(){let e=Ja.now(),t=this.sampleAt(e,!0);this.options.motionValue.setWithVelocity(this.holdTime===null?this.sampleAt(e-10,!0):t,t,10)}play(){this.isStopped||((this.group||hu(iu(this.options))).tracks.add(this),super.play())}pause(){super.pause(),this.isAccelerated()&&this.group.schedule(!1)}complete(){super.complete();let{group:e}=this;e&&!e.isJS&&this.tick(Ja.now())}get time(){return this.isAccelerated()?Sa(da(0,this.totalDuration,this.at(Ja.now())-(this.options.delay||0))):super.time}set time(e){(du??=Object.getOwnPropertyDescriptor(mc.prototype,`time`).set).call(this,e)}attachTimeline(e){return this.canAccelerate=!1,this.group?.demote(!0),super.attachTimeline(e)}},pu,mu=e=>{pu||queueMicrotask(()=>{let e=pu;pu=void 0,e.forEach(e=>e())}),(pu||=[]).push(e)};function hu(e){let t=e.current,n=new Set,r=new Map,i={},a=[],o=new Map,s=[],c=!1,l=!1,u=!1,d=!1,f=-1/0,p,m=1/0,h,g=e=>{for(let t of n)if(t.name===e)return!0},_=(t,n)=>{let o={};for(let s of t===void 0?Hc:a){let a=r.get(s),c=t===void 0?su(e,s):a?a.sampleAt(n>t&&!a.timing()[1]?n:t):i[s];c!==void 0&&(o[s]=c)}return o},v=(e,t)=>{let n=``;for(let r in e){let i=e[r];t&&Vl(r,i)||(n+=Bl(r,i)+` `)}return(t?n.trim():n)||`none`},y=(e,t)=>v(_(e,t)),b=(e=_())=>{t.style.transform=v(e,!0)},x=e=>{e.onfinish=e.oncancel=null,e.cancel()},S=(e=!0)=>{clearTimeout(p),m=1/0,h=void 0,e&&b(),s.forEach(({animation:e})=>x(e)),s=[]},C=(e,n)=>new Animation(new KeyframeEffect(t,e,n)),w=(e,t,n=1/0)=>{let r={animation:e,offset:t,end:n};e.startTime=Ja.now()+t,n<1/0&&(e.onfinish=()=>{r.isDone=!0,s.some(e=>e.end===1/0)&&(x(e),s=s.filter(e=>e!==r)),N.schedule(!1)}),e.oncancel=()=>s.includes(r)&&N.demote(),s.push(r)},T=(e,t,n)=>{let r=(t,n)=>Math.abs(e(n)-e(t)),i=r(t,n);for(;n-t>.01;){let e=(t+n)/2;r(t,e)>r(e,n)?n=e:t=e}return r(t,n)>i/2?[t,n]:[]},E=(e,t,n,r)=>{let i=eu(t,n);if(r.length*4>i)return;let a;for(let r of e){let e=r.numberAt(t),i=(r.numberAt((t+n)/2)-e)/(r.numberAt(n)-e);if(i===i){if(a===void 0)a=i;else if(!tu(i,a))return}}let o=ru(t,n,i).concat(r).sort(nu),s=e=>ya(t,n,e),c,l;for(let n of e){let e=n.numberAt(t),r=o.map(t=>n.numberAt(t)-e),i=r[r.length-1],a=r.some(e=>Math.abs(e)*Gl>Math.abs(i))?0:i,s=r.map(e=>a?e/a:e);if(a&&!c)c=s,l=t=>(n.numberAt(t)-e)/a;else if(s.some((e,t)=>!tu(e,a&&c[t])))return}if(!c||c.every((e,t)=>tu(e,s(o[t]))))return`linear`;let u=[],d=(e,t=l(e))=>u.push(pc(t)+` `+pc(s(e)*100)+`%`);return c.forEach((e,t)=>{t&&Math.abs(e-c[t-1])>.2&&T(l,o[t-1],o[t]).forEach(e=>d(e)),d(o[t],e)}),`linear(`+u+`)`},D=(e,t,n,r)=>{let i=[t],a=[],o=n,s=t;for(let r of e){let e=r.tween();if(e?.[2]!==`linear`){let[i,c]=r.timing(),[l,u]=e||[t,c?n:i];o=Math.min(o,l),s=Math.max(s,u),a.push(r)}}o=Math.max(t,o),s=Math.min(n,s);let c=(e,t)=>a.every(n=>!(Math.abs(n.numberAt((e+t)/2)-(n.numberAt(e)+n.numberAt(t))/2)>(n.name.startsWith(`scale`)?ql:Kl))),l=(t,n,r)=>{if(n-t<1||c(t,n))i.push(n);else if(r<4)l(t,(t+n)/2,r+1),l((t+n)/2,n,r+1);else{for(let r of e)i.push(...T(e=>r.numberAt(e),t,n));i.push(n)}},u=s>o?ru(o,s,Math.ceil((s-o)/100)):[];u.push(n);for(let e of r)u.push(e,Math.min(e+.01,n));let d=t;for(let e of u.sort(nu))e>d&&l(d,e,0),d=e;return i.sort(nu)},O=e=>{let t;for(let n of e){let e=n.tween();if(!e||t&&(Math.abs(e[0]-t[0])>1||Math.abs(e[1]-t[1])>1))return;t=[e[0],e[1],!t||e[2]===t[2]?e[2]:void 0]}return t},k=(e,t,n,r,i={fill:`both`},a)=>{let o=r?[]:e.flatMap(e=>e.boundaries(t,n)),s=r||E(e,t,n,o),c=s?[t,n]:D(e,t,n,o),l=c.map(e=>y(e,a)),u={transform:l};return s||(u.offset=c.map(e=>ya(t,n,e))),l.every(e=>e===l[0])&&(b(_(t,a)),u=null),C(u,{...i,duration:n-t,easing:s||`linear`})},A=e=>{let t=Ja.now()+e;t<m&&(clearTimeout(p),m=t,p=setTimeout(()=>{m=1/0,N.schedule(!1)},e))},ee=t=>{let c=t,l=0,u=0,d=[],f=[],p=new Set;r.clear(),o=new Map;for(let e of n){r.set(e.name,e);let[n,i]=e.timing(),a=n===1/0;if(o.set(e,[e.at(t),e.speed,a]),!a){if(e.speed<0)return;if(i){if(l){let e=(n-u)/i;if(Math.abs(i-l)>1||Math.abs(e-Math.round(e))*l>1)return}else l=i,u=n;f.push(e)}else p.add(n);d.push(e),c=Math.max(c,n)}}i={},a=Hc.filter(t=>{if(r.has(t))return!0;let n=i[t]=su(e,t);return n!==void 0&&!Vl(t,n)}),S(!1);let m=!l&&O(d);try{if(c>t){let e;if(m&&m[1]>t){let[n,r,i]=m;if(n-t>Yl)return d.forEach(e=>e.sync()),A(h=n-t-Yl),!0;e=typeof i==`string`?i:i?$l(i,eu(n,r)):E(d,n,r,[]),e&&w(k(d,n,r,e,{fill:`both`,endDelay:c-r}),n-t,c-n)}e||w(k(d,t,c),0,c-t),p.forEach(e=>e<c-1&&w(C(null,{duration:e-t}),0,e-t))}if(l){let e=u+Math.floor((c-u)/l)*l;w(k(f,e,e+l,void 0,{iterations:1/0,iterationStart:(c-e)/l,fill:`forwards`},c),c-t)}}catch{return}return s.length||S(),!0},j=(e,t)=>{let r,i=0;for(let t of n){let n=o.get(t);if(!n)return!1;let[a,c,l]=n,u=t.at(e),d=t.timing()[0]===1/0;if(l){if(d&&(u===a||!s.length))continue;return!1}let f=(u-a)/c,p=d?0:t.speed/c;if(r===void 0)r=f,i=p;else if(Math.abs(f-r)>1||p!==i)return!1}if(r===void 0)return!0;if(!s.length){if(h===void 0||t&&i)return!1;if(i){let e=(h-r)/i;if(e<1)return!1;A(e)}return!0}for(let{offset:e,end:n,isDone:i}of s){let a=r-e;if(n<1/0&&(i?a<n-1:a<0&&(t||e<=0)||a>=n))return!1}for(let{animation:t,offset:n,isDone:a}of s){if(a)continue;let o=r-n;i&&t.updatePlaybackRate&&t.playState===`running`&&Math.abs(Number(t.currentTime)-o)<20?t.playbackRate!==i&&t.updatePlaybackRate(i):i?(t.playbackRate!==i&&(t.playbackRate=i),t.startTime=e-o/i):(t.startTime=null,t.currentTime=o)}return!0},M=()=>!n.size&&(u=!0,au(t)===N&&Ul.delete(t),N.isJS||S(),!0),te=()=>{let t=Ja.now();if(N.isJS||(N.isFinishing=!0,n.forEach(n=>{let[r,a]=n.timing();n.state===`running`&&n.speed>0&&!a&&r<=t+1&&(n.complete(),i[n.name]=su(e,n.name),o.has(n)||(c=!0))}),N.isFinishing=!1),l=!1,u||(n.forEach(e=>ou(e)&&n.delete(e)),M()))return;for(let e of n)if(!e.canAccelerate)return N.demote(!0);N.isJS&&(N.isJS=!1,c=!0,n.forEach(e=>e.stopJS()));let r=c,a=d;if(c=d=!1,r||!j(t,a)){if(a){if(t-f<Jl)return N.demote();f=t}if(!ee(t))return N.demote()}else if(h!==void 0&&!a)return;n.forEach(e=>e.timing()[0]===1/0&&e.sync())},N={tracks:n,isJS:!1,isFinishing:!1,schedule(e,t){u||(c||=e,d||=!!t,l||(l=!0,Ga.isProcessing?ps.render(te,!1,!0):mu(te)))},release(e){ou(e)&&n.delete(e),M()||N.schedule(!0)},check(){if(!N.isJS){for(let t in i)if(su(e,t)!==i[t]&&!g(t))return N.schedule(!0,!0)}},demote(e){if(!(N.isJS||u))return n.forEach(t=>{t.isAccelerated()&&t.sync(),e||(t.canAccelerate=!1)}),N.isJS=!0,o=new Map,S(),n.forEach(e=>e.state===`running`&&e.js?.start()),!0}};return Ul.set(t,N),N}var gu=class extends dc{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Ja.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||sl;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=Ja.now();let u=Dl(e,i,a,o);u||((fa.instantAnimations||!s)&&l?.(rc(e,n,t)),e[0]=e[e.length-1],Ol(n),n.repeat=0);let{onComplete:d}=n;n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{d?.(),this.notifyFinished()};let f=u&&!c&&Fl(n),p=!f&&cu(n);r&&(f||p||this.resolvedAt!==this.createdAt)&&(n.startTime??=sc(this.createdAt,this.resolvedAt));let m;if(f){n.element=n.motionValue?.owner?.current;try{m=new wl(n)}catch{m=new mc(n)}}else m=p?new fu(n):new mc(n);this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}liveValue(){return this._animation?.liveValue?.()}get animation(){return this._animation||(this.keyframeResolver?.resume(),al()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation?.cancel(),this.keyframeResolver?.cancel()}},_u=class{constructor(e){this.stop=()=>{for(let e of this.animations)e.stop()},this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){for(let t of this.animations)t.time=e}get speed(){return this.getAll(`speed`)}set speed(e){for(let t of this.animations)t.speed=e}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return vu(this.animations,`duration`)}get iterationDuration(){return vu(this.animations,`iterationDuration`)}play(){for(let e of this.animations)e.play()}pause(){for(let e of this.animations)e.pause()}cancel(){for(let e of this.animations)e.cancel()}complete(){for(let e of this.animations)e.complete()}};function vu(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var yu=class extends _u{then(e,t){return this.finished.finally(e).then(()=>{})}};function bu(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var xu=30,Su=e=>!isNaN(parseFloat(e)),Cu={current:void 0},wu=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=Ja.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.dirty(),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=Ja.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Su(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){var n;return e===`change`?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new ba)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new ba,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){ps.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){t&&(this.updatedAt=Ja.now(),this.stop()),this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,this.stopPassiveEffect?.()}dirty(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){(this.dependents||=new Set).add(e)}removeDependent(e){this.dependents?.delete(e)}get(){Cu.current?.push(this);let e=this.animation?.liveValue?.();return e===void 0?this.current:e}getCurrent(){return this.current}getPrevious(){return this.prev}getVelocity(){let e=Ja.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>xu)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,xu);return Ca(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return new Promise(t=>this.run(e,t))}run(e,t){this.stop(),this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&(this.animation=void 0),t?.()}),n||(this.animation=r),this.events.animationStart?.notify()}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel?.notify()),this.animation=void 0}isAnimating(){return!!this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect?.()}};function Tu(e,t){return new wu(e,t)}function Eu(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function Du(e,t){let n=e?.[t]??e?.default??e;return n===e?n:Eu(n,e)}var Ou={type:`spring`,stiffness:500,damping:25,restSpeed:10},ku=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Au={type:`keyframes`,duration:.8},ju={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Mu=(e,{keyframes:t})=>t.length>2?Au:Uc.has(e)?e.startsWith(`scale`)?ku(t[1]):Ou:ju,Nu=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`,`out`,`mixer`]);function Pu(e){for(let t in e)if(!Nu.has(t))return!0;return!1}var Fu=(e,t,n,r={},i,a)=>o=>{let s=Du(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=xa(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i,hasOnUpdate:!!s.onUpdate};Pu(s)||Object.assign(u,Mu(e,u)),u.duration&&=xa(u.duration),u.repeatDelay&&=xa(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Ol(u),u.delay===0&&(d=!0)),(fa.instantAnimations||fa.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,Ol(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=rc(u.keyframes,s);if(e!==void 0){ps.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new mc(u):new gu(u)},Iu=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Lu(e){let t=Iu.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Ru(e,t,n=1){let[r,i]=Lu(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return pa(e)?parseFloat(e):e}return $a(i)?Ru(i,t,n+1):i}function zu(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Bu(e,t,n,r){let i=t=>typeof t==`function`?t(n===void 0?e.custom:n,...zu(r)):t;return t=i(t),typeof t==`string`&&(t=e.variants&&e.variants[t]),i(t)}function Vu(e,t,n){return Bu(e.getProps(),t,n,e)}var Hu=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,Uu=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Hc]),Wu=e=>Array.isArray(e);function Gu(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Tu(n))}function Ku(e){return Wu(e)?e[e.length-1]||0:e}function qu(e,t){let{transitionEnd:n={},transition:r={},...i}=Vu(e,t)||{};i={...i,...n};for(let t in i)Gu(e,t,Ku(i[t]))}var Ju=e=>!!(e&&e.getVelocity);function Yu(e){return!!(Ju(e)&&e.add)}function Xu(e,t){let n=e.getValue(`willChange`);if(Yu(n))return n.add(t);if(!n&&fa.WillChange){let n=new fa.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}var Zu=`data-framer-appear-id`;function Qu(e){return e.props[Zu]}var $u=typeof window<`u`;function ed({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function td(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?Eu(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState?.getState()[i],p=a?.path;p&&(p.animateValues?p.animateValues(t=>e.getValue(t,e.latestValues[t]??0),s,a,n,d):p.animateVisualElement?.(e,s,a,n,d));for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&ed(f,t))continue;let o={delay:n,...Du(f?.out[t]||a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){ps.update(()=>r.set(i));continue}let p=!1;if($u&&window.MotionHandoffAnimation){let n=Qu(e);if(n){let e=window.MotionHandoffAnimation(n,t,ps);e!==null&&(o.startTime=e,p=!0)}}Xu(e,t);let m=l??e.shouldReduceMotion;r.run(Fu(t,r,i,m&&Uu.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>ps.update(()=>{o&&qu(e,o)});d.length?Promise.all(d).then(t):t()}return d}function nd(e,t,n={}){let r=Vu(e,t,Hu(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?td(e,r,n):[]),o=(r=0)=>{let{variantChildren:a}=e,{delayChildren:o=0,staggerChildren:s,staggerDirection:c}=i,l=[];return a?.forEach(e=>{e.notify(`AnimationStart`,t),l.push(nd(e,t,{...n,delay:r+(typeof o==`function`?0:o)+bu(a,e,o,s,c)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(l)},{when:s}=i;return s?s===`beforeChildren`?a().then(()=>o()):o().then(a):Promise.all([a(),o(n.delay)])}function rd(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>nd(e,t,n))):typeof t==`string`?nd(e,t,n):Promise.all(td(e,Vu(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}var id={test:e=>e===`auto`,parse:e=>e},ad=e=>t=>t.test(e),od=[no,U,yo,vo,xo,bo,id],sd=e=>od.find(ad(e));function cd(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||ha(e)}var ld=new Set([`auto`,`none`,`0`]);function ud(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!ld.has(t)&&Fo(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=kc(n,i))}var dd=class extends sl{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}scheduleResolve(){if(this.canReadNow()&&(this.readKeyframes(),!this.needsMeasurement))return this.complete();super.scheduleResolve()}canReadNow(){let{unresolvedKeyframes:e,element:t,motionValue:n}=this,r=e[0]??n?.get();if(!t?.current||r===void 0)return!1;for(let t=0;t<e.length;t++)if(to(t?e[t]:r))return!1;return!0}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t?.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),$a(r))){let i=Ru(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Uu.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=sd(r),o=sd(i);if(to(r)!==to(i)&&Qc[n])this.needsMeasurement=!0;else if(a!==o){if(Wc(a)&&Wc(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else Qc[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||cd(e[t]))&&n.push(t);n.length&&ud(e,n,t)}measure(){let{element:e,name:t}=this;return Qc[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e?.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e?.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.resolveNoneKeyframes()}},fd=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`],pd=[];function md(e){hd(e),pd.unshift(e)}function hd(e){ua(pd,e)}function gd(e){return pd.find(t=>t.test(e))}function _d(e,t,n={},r){let i=[],{velocity:a,path:o}=n,s=n.reduceMotion??r?.shouldReduceMotion;o?.animateValues&&r&&(t={...t},o.animateValues(e,t,n,0,i));for(let o in t){if(o===`transition`||o===`transitionEnd`)continue;let c=t[o];if(c===void 0)continue;let l=e(o),u=l.get();u!==void 0&&!l.isAnimating()&&!Array.isArray(c)&&c===u&&!a?ps.update(()=>l.set(c)):(l.run(Fu(o,l,c,s&&Uu.has(o)?{type:!1}:n,r)),l.animation&&i.push(l.animation))}let{transitionEnd:c}=t;if(c){let t=()=>ps.update(()=>{for(let t in c)e(t).set(c[t])});i.length?Promise.all(i).then(t):t()}return i}function vd(e,t,n,r,i){let a,o=!1,s=_d(r=>{let s=a?.[r]??e.get(t,r);if(!s){let c;if(!i){let i=n[r];c=yd(i)??e.read(t,r,i)}s=Tu(c,{owner:i}),o?e(t,{[r]:s}):(a||={})[r]=s}return s},n,r,i);return o=!0,a&&e(t,a),s}function yd(e){let t=Array.isArray(e)?e[0]:void 0;return t===null?void 0:t}function bd(e){return ma(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function xd(e){return ma(e)&&`ownerSVGElement`in e}var Sd={};function Cd(e){return Sd.current?.add(e),e}var wd=e=>Sd.current?Sd.current.bind(e):e;function Td(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=t?t.current:Sd.current?.root||document,i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var Ed=class{constructor(e=ps.render){this.step=e,this.values=new Map,this.pending=[],this.numPending=0,this.flush=()=>{let{pending:e,numPending:t}=this;this.numPending=0;for(let n=0;n<t;n++)e[n]()}}set(e,t,n,r){if(this.values.get(e)?.onRemove(),r)for(let e of this.values.values())e.value===r&&(n=e.render);let i=()=>n&&this.schedule(n);t.get()!==void 0&&i();let a=t.on(`change`,i),o=()=>{a(),n&&!r&&this.cancel(n),this.values.get(e)?.onRemove===o&&this.values.delete(e)};return this.values.set(e,{value:t,render:r?void 0:n,onRemove:o}),o}get(e){return this.values.get(e)?.value}release(){let e=new Map;return this.values.forEach((t,n)=>{e.set(n,t.value),t.onRemove()}),this.transformKeys=this.transformValues=void 0,e}schedule(e){let{pending:t,numPending:n}=this;for(let r=0;r<n;r++)if(t[r]===e)return;n||this.step(this.flush),t[this.numPending++]=e}cancel(e){let{pending:t}=this;for(let n=0;n<this.numPending;n++)if(t[n]===e){t[n]=t[--this.numPending];return}}};function Dd(e,{step:t,...n}={}){let r=new WeakMap;return Object.assign((n,i)=>{let a=r.get(n)??new Ed(t);r.set(n,a);let o=[];for(let t in i){let r=i[t],s=e(n,a,t,r);o.push(s)}return()=>{for(let e of o)e()}},n,{get:(e,t)=>r.get(e)?.get(t),flush:e=>r.get(e)?.flush(),state:e=>r.get(e)})}function Od(e){let t=``,{transformKeys:n=[],transformValues:r={}}=e;for(let e=0;e<n.length;e++){let i=n[e],a=r[i].getCurrent();a!==void 0&&(Vl(i,a)||(t+=(t&&` `)+Bl(i,a)))}let i=e.get(`pathRotation`)?.get();return i&&(t+=(t&&` `)+Bl(`rotate`,i)),t||`none`}var kd=new Set([`originX`,`originY`,`originZ`]),Ad=(e,t)=>Il(e.get(t)?.get(),Sc[t]),jd=(e,t,n,r)=>{let i,a;if(Uc.has(n)){if(n!==`pathRotation`){let e=t.transformKeys??=[];(t.transformValues??={})[n]=r,e.includes(n)||(e.push(n),e.sort((e,t)=>Hc.indexOf(e)-Hc.indexOf(t)))}t.get(`transform`)||(!bd(e)&&!t.get(`transformBox`)&&jd(e,t,`transformBox`,new wu(`fill-box`)),t.set(`transform`,new wu(`none`),()=>{Ul.get(e)?.check(),e.style.transform=Od(t)})),a=t.get(`transform`)}else kd.has(n)?(t.get(`transformOrigin`)||t.set(`transformOrigin`,new wu(``),()=>{let n=Ad(t,`originX`)??`50%`,r=Ad(t,`originY`)??`50%`,i=Ad(t,`originZ`)??0;e.style.transformOrigin=`${n} ${r} ${i}`}),a=t.get(`transformOrigin`)):i=cl(n)?()=>{e.style.setProperty(n,r.getCurrent())}:()=>{e.style[n]=Il(r.getCurrent(),Sc[n])};return t.set(n,r,i,a)},Md=e=>bd(e)||xd(e),Nd=(e,t)=>{if(Uc.has(t))return Vc(e,t);let n=getComputedStyle(e),r=cl(t)?n.getPropertyValue(t):n[t];return typeof r==`string`&&r.trim()||0},Pd=Dd(jd,{test:Md,read:Nd});function Fd(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}function Id(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(Uc.has(e))o=!0;else if(Za(e))i[e]=n;else{let t=Il(n,Sc[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=Hl(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var Ld={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Rd={offset:`strokeDashoffset`,array:`strokeDasharray`};function zd(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Ld:Rd;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var Bd=[`transform`,`opacity`,`clipPath`,`filter`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function Vd(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Id(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;for(let e of Bd)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&zd(d,i,a,o,!1)}function Hd(e,t){if(!(t in e))return!1;let n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),t)||Object.getOwnPropertyDescriptor(e,t);return n&&typeof n.set==`function`}var Ud=(e,t,n,r,i=n)=>{let a=Hd(e,i);!a&&(i.startsWith(`data`)||i.startsWith(`aria`))&&(i=Fd(i));let o=Sc[n]||Sc[i],s=a?()=>{e[i]=Il(r.get(),Sc[n])}:()=>{let t=Il(r.get(),o);t==null?e.removeAttribute(i):e.setAttribute(i,String(t))};return t.set(n,r,s)};function Wd(e,t,n,r){return ps.render(()=>e.setAttribute(`pathLength`,`1`)),n===`pathOffset`?t.set(n,r,()=>{let t=r.get();e.setAttribute(`stroke-dashoffset`,`${-t}`)}):(t.get(`stroke-dasharray`)||t.set(`stroke-dasharray`,new wu(`1 1`),()=>{let n=t.get(`pathLength`)?.get()??1,r=t.get(`pathSpacing`)?.get();e.setAttribute(`stroke-dasharray`,`${n} ${r??1-Number(n)}`)}),t.set(n,r,void 0,t.get(`stroke-dasharray`)))}var Gd=Dd((e,t,n,r)=>n.startsWith(`path`)&&!Uc.has(n)?Wd(e,t,n,r):n.startsWith(`attr`)?Ud(e,t,n,r,Kd(n)):n===`d`?t.set(n,r,()=>{let t=r.get()?.replace(/path\(|["')]/g,``);t===void 0?e.removeAttribute(n):e.setAttribute(n,t)}):(Uc.has(n)||kd.has(n)||cl(n)||n in e.style?jd:Ud)(e,t,n,r),{test:xd,read:(e,t)=>Uc.has(t)?Sc[t]?.default||0:cl(t)||Bd.includes(t)?Nd(e,t)||e.getAttribute(Fd(t))||0:(t=Kd(t),e.getAttribute(Fd(t))??e.getAttribute(t)??void 0)});function Kd(e){return e.replace(/^attr([A-Z])/,(e,t)=>t.toLowerCase())}function qd({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Jd({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Yd(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Xd(e){return e===void 0||e===1}function Zd({scale:e,scaleX:t,scaleY:n}){return!Xd(e)||!Xd(t)||!Xd(n)}var Qd=[`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skewX`,`skewY`];function $d(e){return Zd(e)||tf(e)||ef(e)}function ef(e){return e.z||e.rotate||e.rotateX||e.rotateY||e.rotateZ||e.skewX||e.skewY}function tf(e){return nf(e.x)||nf(e.y)}function nf(e){return e&&e!==`0%`}function rf(e,t,n){return n+t*(e-n)}function af(e,t,n,r,i){return i!==void 0&&(e=rf(e,i,r)),rf(e,n,r)+t}function of(e,t=0,n=1,r,i){e.min=af(e.min,t,n,r,i),e.max=af(e.max,t,n,r,i)}function sf(e,{x:t,y:n}){of(e.x,t.translate,t.scale,t.originPoint),of(e.y,n.translate,n.scale,n.originPoint)}var cf=.999999999999,lf=1.0000000000001;function uf(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++)a=n[s],o=a.projectionDelta,a.options.visualElement?.props.style?.display!==`contents`&&(r===!0&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(df(e.x,-a.scroll.offset.x),df(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,sf(e,o)),r&&(r.path?.[s]||r)!==a&&$d(a.latestValues)&&mf(e,a.latestValues,a.layout?.layoutBox));t.x<lf&&t.x>cf&&(t.x=1),t.y<lf&&t.y>cf&&(t.y=1)}function df(e,t){e.min+=t,e.max+=t}function ff(e,t,n,r,i=.5){of(e,t,n,Ko(e.min,e.max,i),r)}function pf(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function mf(e,t,n){let r=n??e;ff(e.x,pf(t.x,r.x),t.scaleX,t.scale,t.originX),ff(e.y,pf(t.y,r.y),t.scaleY,t.scale,t.originY)}function hf(e,t){return qd(Yd(e.getBoundingClientRect(),t))}function gf(e,t,n){let r=hf(e,n),{scroll:i}=t;return i&&(df(r.x,i.offset.x),df(r.y,i.offset.y)),r}var _f=()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),vf={},yf=e=>xd(e)?Gd:Pd,bf=class{constructor(e,t){this.effect=e,this.current=t,this.KeyframeResolver=dd}getValue(e){return this.effect.get(this.current,e)}readValue(e,t){return this.effect.read(this.current,e,t)}render(){this.effect.flush(this.current)}measureViewportBox(){return hf(this.current)}getProps(){return vf}};function xf(e,t,n,r){if(Sd.current?.track(e),r)return _d(e=>r.getValue(e,null),t,n,r);let i=yf(e);return vd(i,e,t,n,new bf(i,e))}var Sf=Dd((e,t,n,r)=>t.set(n,r,()=>{e[n]=r.get()}),{test:e=>ma(e),read:(e,t)=>{let n=e[t];return typeof n==`string`||typeof n==`number`?n:void 0}}),{schedule:Cf,cancel:wf}=fs(queueMicrotask,!1);function Tf(e,t,n){let r=Ju(e)?e:Tu(e);return r.run(Fu(``,r,t,n)),r.animation}var Ef={},Df={value:null,addProjectionMetrics:null,countProjection:void 0};function Of(e,t){let n=Ja.now();e=wd(e);let r=({timestamp:i})=>{let a=i-n;a>=t&&(ms(r),e(a-t))};return ps.setup(r,!0),Cd(()=>ms(r))}function kf(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Af(e){return xd(e)&&e.tagName===`svg`}function jf(e){return Ju(e)?e.get():e}var Mf=e=>typeof e==`number`?e:parseFloat(e),Nf=fd.length,Pf=e=>typeof e==`number`||U.test(e);function Ff(e,t,n,r,i,a){i?(e.opacity=Ko(0,n.opacity??1,Lf(r)),e.opacityExit=Ko(t.opacity??1,0,Rf(r))):a&&(e.opacity=Ko(t.opacity??1,n.opacity??1,r));for(let i=0;i<Nf;i++){let a=fd[i],o=If(t,a),s=If(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||Pf(o)===Pf(s)?(e[a]=Math.max(Ko(Mf(o),Mf(s),r),0),(yo.test(s)||yo.test(o))&&(e[a]+=`%`)):e[a]=s)}for(let i=0;i<Qd.length;i++){let a=Qd[i];(t[a]||n[a])&&(e[a]=Ko(t[a]||0,n[a]||0,r))}}function If(e,t){return e[t]===void 0?e.borderRadius:e[t]}var Lf=zf(0,.5,Pa),Rf=zf(.5,.95,_a);function zf(e,t,n){return r=>r<e?0:r>t?1:n(ya(e,t,r))}function Bf(e,t){e.min=t.min,e.max=t.max}function Vf(e,t){Bf(e.x,t.x),Bf(e.y,t.y)}function Hf(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var Uf=.9999,Wf=1.0001,Gf=-.01,Kf=.01;function G(e){return e.max-e.min}function qf(e,t,n){return Math.abs(e-t)<=n}function Jf(e,t,n,r=.5){e.origin=r,e.originPoint=Ko(t.min,t.max,e.origin),e.scale=G(n)/G(t),e.translate=Ko(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Uf&&e.scale<=Wf||isNaN(e.scale))&&(e.scale=1),(e.translate>=Gf&&e.translate<=Kf||isNaN(e.translate))&&(e.translate=0)}function Yf(e,t,n,r){Jf(e.x,t.x,n.x,r?.originX),Jf(e.y,t.y,n.y,r?.originY)}function Xf(e,t,n,r=0){e.min=(r?Ko(n.min,n.max,r):n.min)+t.min,e.max=e.min+G(t)}function Zf(e,t,n,r){Xf(e.x,t.x,n.x,r?.x),Xf(e.y,t.y,n.y,r?.y)}function Qf(e,t,n,r=0){let i=r?Ko(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+G(t)}function $f(e,t,n,r){Qf(e.x,t.x,n.x,r?.x),Qf(e.y,t.y,n.y,r?.y)}function ep(e,t,n,r,i){return e-=t,e=rf(e,1/n,r),i!==void 0&&(e=rf(e,1/i,r)),e}function tp(e,t=0,n=1,r=.5,i,a=e,o=e){if(yo.test(t)&&(t=parseFloat(t),t=Ko(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=Ko(a.min,a.max,r);e===a&&(s-=t),e.min=ep(e.min,t,n,s,i),e.max=ep(e.max,t,n,s,i)}function np(e,t,[n,r,i],a,o){tp(e,t[n],t[r],t[i],t.scale,a,o)}var rp=[`x`,`scaleX`,`originX`],ip=[`y`,`scaleY`,`originY`];function ap(e,t,n,r){np(e.x,t,rp,n?.x,r?.x),np(e.y,t,ip,n?.y,r?.y)}var op=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),sp=op(`applewebkit/`)&&!op(`chrome/`)?Math.round:_a;function cp(e){e.min=sp(e.min),e.max=sp(e.max)}function lp(e){cp(e.x),cp(e.y)}var up=()=>({translate:0,scale:1,origin:0,originPoint:0}),dp=()=>({x:up(),y:up()}),fp=()=>({min:0,max:0}),pp=()=>({x:fp(),y:fp()});function mp(e){return e.translate===0&&e.scale===1}function hp(e){return mp(e.x)&&mp(e.y)}function gp(e,t){return e.min===t.min&&e.max===t.max}function _p(e,t){return gp(e.x,t.x)&&gp(e.y,t.y)}function vp(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function yp(e,t){return vp(e.x,t.x)&&vp(e.y,t.y)}function bp(e){return G(e.x)/G(e.y)}function xp(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var Sp=class{constructor(){this.members=[]}add(e){la(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;r&&r.isConnected!==!1||n.snapshot||(ua(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(ua(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}};function Cp(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var wp={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(U.test(e))e=parseFloat(e);else return e}return`${Cp(e,t.target.x)}% ${Cp(e,t.target.y)}%`}},Tp={borderRadius:Object.assign({},wp,{applyTo:fd.slice()}),borderTopLeftRadius:wp,borderTopRightRadius:wp,borderBottomLeftRadius:wp,borderBottomRightRadius:wp,boxShadow:{correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Ho.parse(e);if(i.length>5)return r;let a=Ho.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=Ko(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}}};function Ep(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;(i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `);let s=``;if(n){let{transformPerspective:e}=n;e&&(r=`perspective(${e}px) ${r}`);for(let e=0;e<Qd.length;e++){let t=Qd[e],r=n[t];r&&(s+=`${t}(${r}deg) `),!e&&n.pathRotation&&(s+=`rotate(${n.pathRotation}deg) `)}}if(s){(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),r+=s;let n=e.x.scale*t.x,i=e.y.scale*t.y;(n!==1||i!==1)&&(r+=`scale(${n}, ${i})`)}else e.x.scale!==1||e.y.scale!==1?r+=`scale(${e.x.scale}, ${e.y.scale})`:r||t.x===1&&t.y===1||(r=`scale(1, 1)`);return r||`none`}function Dp(e){return[e(`x`),e(`y`)]}var Op=(e,t)=>e.depth-t.depth,kp=class{constructor(){this.children=[],this.isDirty=!1}add(e){la(this.children,e),this.isDirty=!0}remove(e){ua(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Op),this.isDirty=!1,this.children.forEach(e)}},Ap={hasAnimatedSinceResize:!0,hasEverUpdated:!1},jp=[`z`,`skew`,`skewZ`],Mp=1e3,Np=0;function Pp(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}var Fp=e=>e.instance&&Ul.get(e.instance)?.demote()&&e.resetSkewAndRotation();function Ip(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Qu(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,ps,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Ip(r)}function Lp(e){if(e)return e.options.allowProjection===!1?Lp(e.parent):e.projection}function Rp({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return Object.assign(Ef,{...Tp,...Ef}),class{static create(e,t,n){let{layoutId:r,layout:i,drag:a,dragConstraints:o,layoutScroll:s,layoutRoot:c,layoutAnchor:l,layoutCrossfade:u}=t,d=e.projection=new this(e.latestValues,t[`data-framer-portal-id`]?void 0:Lp(e.parent));d.setOptions({layoutId:r,layout:i,alwaysMeasureLayout:!!a||o&&kf(o),visualElement:e,animationType:typeof i==`string`?i:`both`,initialPromotionConfig:n,crossfade:u,layoutScroll:s,layoutRoot:c,layoutAnchor:l});let f=d.getStack()?.lead;f&&!d.root.isUpdateBlocked()&&(f.willUpdate(),f.scheduleCheckAfterUnmount())}constructor(e={},n=t?.()){this.id=Np++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Vp),this.nodes.forEach(Qp),this.nodes.forEach($p),this.nodes.forEach(Hp),Df.countProjection?.()},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new kp)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new ba),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){this.eventHandlers.get(e)?.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=xd(t)&&!Af(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent?.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;ps.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n?.(),n=Of(i,250),Ap.hasAnimatedSinceResize&&(Ap.hasAnimatedSinceResize=!1,this.nodes.forEach(Zp)))})}n&&this.root.registerSharedNode(n,this),this.addLayoutListener()}addLayoutListener(){let{layoutId:e,layout:t,visualElement:n,animate:r}=this.options;this.instance&&!this.hasLayoutListener&&r!==!1&&n&&(e||t)&&(this.hasLayoutListener=!0,this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:r,layout:i})=>{if(this.isAnimationBlocked){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||n.getDefaultTransition()||am,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=n.getProps(),c=!this.targetLayout||!yp(this.targetLayout,i),l=!t&&r;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Du(a,`layout`),onPlay:o,onComplete:s};(n.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||Zp(this),this.isLead()&&this.options.onExitComplete?.();this.targetLayout=i}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),this.getStack()?.remove(this),this.parent?.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),this.hasLayoutListener=!1,ms(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes?.forEach(em),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete?.();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Ip(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;Fp(this),this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,Fp(t),(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1),t.isAnimationBlocked&&(t.dragSnapshot||=t.measure(),this.dragAncestor=t)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(Gp),this.nodes.forEach(Wp);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Kp);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Jp),this.nodes.forEach(Yp),this.nodes.forEach(Xp),this.nodes.forEach(zp),this.nodes.forEach(Bp)):this.nodes.forEach(Kp),this.clearAllSnapshots();let e=Ja.now();Ga.delta=da(0,1e3/60,e-Ga.timestamp),Ga.timestamp=e,Ga.isProcessing=!0,hs.update.process(Ga),hs.preRender.process(Ga),hs.render.process(Ga),Ga.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Cf.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Up),this.sharedNodes.forEach((e,t)=>e.members.length?e.removeLeadSnapshot():this.sharedNodes.delete(t))}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ps.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ps.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!G(this.snapshot.measuredBox.x)&&!G(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected||=pp(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t?.notify(`LayoutMeasure`,this.layout.layoutBox,e?.layoutBox)}updateScroll(e=`measure`){let{scroll:t,instance:i}=this,{animationId:a}=this.root;if(this.options.layoutScroll&&i&&!(t&&t.animationId===a&&t.phase===e)){let o=r(i);this.scroll={animationId:a,phase:e,isRoot:o,offset:n(i),wasRoot:t?t.isRoot:o}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout;e&&Fp(this);let t=this.projectionDelta&&!hp(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||$d(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),lp(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return pp();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(cm))){let{scroll:e}=this.root;e&&(df(t.x,e.offset.x),df(t.y,e.offset.y))}return t}removeElementScroll(e){let t=pp();if(Vf(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&Vf(t,e),df(t.x,i.offset.x),df(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n,r,i=0){let a=n||pp();Vf(a,e);for(let e=i;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(df(a.x,-n.scroll.offset.x),df(a.y,-n.scroll.offset.y)),$d(n.latestValues)&&mf(a,n.latestValues,n.layout?.layoutBox)}return!r&&$d(this.latestValues)&&mf(a,this.latestValues,this.layout?.layoutBox),a}removeTransform(e){let t=pp();Vf(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!$d(n.latestValues))continue;let r;n.instance&&(Zd(n.latestValues)&&n.updateSnapshot(),r=pp(),Vf(r,n.measurePageBox())),ap(t,n.latestValues,n.snapshot?.layoutBox,r)}return $d(this.latestValues)&&ap(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade},this.addLayoutListener()}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ga.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=Ga.timestamp;let a=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=pp(),this.targetWithTransforms=pp()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Zf(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target,!0):Vf(this.target,this.layout.layoutBox),sf(this.target,this.targetDelta)):Vf(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&(!a.resumingFrom==!this.resumingFrom||a.options.layoutRoot&&!a.resumingFrom)&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),Df.countProjection?.(1))}getClosestProjectingParent(){if(!(!this.parent||Zd(this.parent.latestValues)||tf(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=pp(),this.relativeTargetOrigin=pp(),$f(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),Vf(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===Ga.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent?.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;Vf(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;uf(this.layoutCorrected,this.treeScale,this.path,t&&(e.relativeTarget&&!e.relativeParent.resumingFrom?e.relativeParent:!0)),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=pp());let{target:s}=e;s?(!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Hf(this.prevProjectionDelta.x,this.projectionDelta.x),Hf(this.prevProjectionDelta.y,this.projectionDelta.y)),Yf(this.projectionDelta,this.layoutCorrected,s,this.latestValues),this.treeScale.x===a&&this.treeScale.y===o&&xp(this.projectionDelta.x,this.prevProjectionDelta.x)&&xp(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Df.countProjection?.(2)):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){this.options.visualElement?.scheduleRender(),e&&this.getStack()?.scheduleRender(),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=dp(),this.projectionDelta=dp(),this.projectionDeltaWithTransform=dp()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=dp();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=pp(),c=r?.source!==this.layout?.source,l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(im));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);tm(o.x,e.x,n),tm(o.y,e.y,n),r&&(o.x.translate=r.x,o.y.translate=r.y),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&($f(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),rm(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&_p(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=pp(),Vf(f,this.relativeTarget)),c&&(this.animationValues=a,Ff(a,i,this.latestValues,n,d,u)),r?.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(ms(this.pendingAnimation),void 0),this.pendingAnimation=ps.update(()=>{Ap.hasAnimatedSinceResize=!0,this.motionValue||=Tu(0),this.motionValue.jump(0,!1),this.currentAnimation=Tf(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),uc(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta?.(Mp),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&sm(this.options.animationType,this.layout.layoutBox,n.layoutBox)){let{layoutBox:e}=this.layout,t=i;i=this.target||pp(),om(i.x,t.x,e.x),om(i.y,t.y,e.y)}Vf(t,i),mf(t,r),Yf(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Sp),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?.transition,preserveFollowOpacity:n?.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){this.getStack()?.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){return this.getStack()?.relegate(this)||!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let{latestValues:t}=e;if(!ef(t))return;let n={};for(let t=0;t<jp.length;t++)Pp(jp[t],e,n,this.animationValues);for(let t=0;t<Qd.length;t++)Pp(Qd[t],e,n,this.animationValues);e.render();for(let t in n)e.setStaticValue(t,n[t]),this.animationValues&&(this.animationValues[t]=n[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;let n=this.getLead();if(!this.isVisible&&n!==this){e.visibility=`hidden`;return}let r=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=jf(t?.pointerEvents)||``,e.transform=r?r(this.latestValues,``):`none`;return}if(!this.projectionDelta||!this.layout||!n.target){(this.options.layoutId||this.needsShow)&&(this.needsShow=!1,e.visibility=``,e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=jf(t?.pointerEvents)||``),this.hasProjected&&!$d(this.latestValues)&&(e.transform=r?r({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=n.animationValues||n.latestValues;this.applyTransformsToTarget();let a=Ep(this.projectionDeltaWithTransform,this.treeScale,i);r&&(a=r(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=n.animationValues?n===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:n===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in Ef){if(i[t]===void 0)continue;let{correct:r,applyTo:o,isCSSVariable:s}=Ef[t],c=a===`none`?i[t]:r(i[t],n);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=n===this?jf(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=this.dragSnapshot=this.dragAncestor=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(Wp),this.root.sharedNodes.clear()}}}function zp(e){e.updateLayout(),qp(e)}function Bp(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source,o=(r,a)=>{if(i===`size`)Dp(e=>{let t=G(r[e]);r[e].min=a[e].min,r[e].max=r[e].min+t});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;Bf(r[e],a[e])}else sm(i,t.layoutBox,n)&&Dp(t=>{let n=G(a[t]);r[t].max=r[t].min+n,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[t].max=e.relativeTarget[t].min+n)})},s=a?t.measuredBox:t.layoutBox;o(s,n);let c=dp();Yf(c,n,t.layoutBox);let l=dp();Yf(l,a?e.applyTransform(r,!0):n,s);let u=!hp(c),d=!1,f=e.getClosestProjectingParent();if((!a||f?.options.layoutRoot&&e.resumeFrom?.path.includes(f))&&f&&!f.resumeFrom){let{snapshot:r,layout:i}=f;if(r&&i){let s=e.options.layoutAnchor||void 0,c=pp();$f(c,a?e.resumeFrom.applyTransform(t.layoutBox,!0,void 0,!0,f.depth+1):t.layoutBox,r.layoutBox,s);let l=pp();$f(l,n,i.layoutBox,s),a&&o(c,l),yp(c,l)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=l,e.relativeTargetOrigin=c,e.relativeParent=f)}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:l,layoutDelta:c,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else e.isLead()&&e.options.onExitComplete?.();e.options.transition=void 0}function Vp(e){Df.countProjection?.(0),e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Hp(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Up(e){e.clearSnapshot()}function Wp(e){e.clearMeasurements()}function Gp(e){e.isLayoutDirty=!0,e.updateLayout()}function Kp(e){e.isLayoutDirty=!1}function qp(e){let{snapshot:t,dragAncestor:n}=e,r=n?.isAnimationBlocked&&n.layout;if(!t||!r||e.resumeFrom||e.isAnimationBlocked)return;let i=n.dragSnapshot;Dp(e=>df(t.layoutBox[e],r.layoutBox[e].min-i.layoutBox[e].min))}function Jp(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.dragSnapshot||e.layout,e.isLayoutDirty=!0)}function Yp(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function Xp(e){let{visualElement:t}=e.options;t?.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Zp(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Qp(e){e.resolveTargetDelta()}function $p(e){e.calcProjection()}function em(e){e.resetSkewAndRotation()}function tm(e,t,n){e.translate=Ko(t.translate,0,n),e.scale=Ko(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function nm(e,t,n,r){e.min=Ko(t.min,n.min,r),e.max=Ko(t.max,n.max,r)}function rm(e,t,n,r){nm(e.x,t.x,n.x,r),nm(e.y,t.y,n.y,r)}function im(e){return e.animationValues?.opacityExit!==void 0}var am={duration:.45,ease:[.4,0,.1,1]};function om(e,t,n){e.max=G(n)+(e.min=t.min)}function sm(e,t,n){return e===`position`||e===`preserve-aspect`&&!qf(bp(t),bp(n),.2)}function cm(e){return e!==e.root&&e.scroll?.wasRoot}function lm(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var um=Rp({attachResizeListener:(e,t)=>lm(e,`resize`,t),measureScroll:_f,checkIsScrollRoot:()=>!0}),dm={current:void 0},fm=Rp({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!dm.current){let e=new um({});e.mount(window),e.setOptions({layoutScroll:!0}),dm.current=e}return dm.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),pm=new WeakMap;function mm(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function hm(e){return typeof e==`string`||Array.isArray(e)}var gm=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`whilePinch`,`exit`],_m=[`initial`].concat(gm);function vm(e){if(mm(e.animate))return!0;for(let t=0;t<_m.length;t++)if(hm(e[_m[t]]))return!0;return!1}function ym(e){return!!(vm(e)||e.variants)}function bm(e,t,n){for(let r in t){let i=t[r],a=n[r];if(Ju(i))e.addValue(r,i);else if(Ju(a))e.addValue(r,Tu(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,Tu(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var xm={current:null},Sm={current:!1},Cm=typeof window<`u`;function wm(){if(Sm.current=!0,Cm){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>xm.current=e.matches;e.addEventListener(`change`,t),t()}else xm.current=!1}}var Tm=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],Em={};function Dm(e){Em=e}function Om(){return Em}var km=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=sl,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=Ja.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,ps.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=vm(t),this.isVariantNode=ym(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&Ju(t)&&t.set(c[e])}}mount(e){let t=this.presenceContext;if(this.hasBeenMounted&&t?.isPresent!==!1&&!t?.keepValuesOnRemount)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];if(this.current=e,pm.set(e,this),this.projection?.instance||this.projection?.mount(e),this.isVariantNode&&!this.isControllingVariants){let e=this;do e=e.props.inherit!==!1&&e.parent;while(e&&!e.isVariantNode);if(e){let{variantChildren:t}=e;t.add(this),this.removeFromVariantTree=()=>t.delete(this)}}this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(Sm.current||wm(),this.shouldReduceMotion=xm.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection?.unmount(),ms(this.notifyUpdate),ms(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree?.(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),(this.enteringChildren||=new Set).add(e)}removeChild(e){this.children.delete(e),this.enteringChildren?.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.get(e)?.(),t.accelerate&&kl.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new bl({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:xa(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Uc.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&ps.preRender(this.notifyUpdate),n&&(this.projection&&(this.projection.isTransformDirty=!0),Ul.get(this.current)?.check()),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i?.()})}sortNodePosition(e){return!this.current||!e.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Em){let t=Em[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):pp()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){let{transformTemplate:n,onUpdate:r}=this.props;(e.transformTemplate||n)&&this.scheduleRender(),(e.transformTemplate&&!n||e.onUpdate&&!r)&&Ul.get(this.current)?.demote(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<Tm.length;t++){let n=Tm[t];this.propEventSubscriptions[n]?.(),delete this.propEventSubscriptions[n];let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=bm(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue?.()}getProps(){return this.props}getVariant(e){return this.props.variants?.[e]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(e,t){let n=this.values.get(e);if(t!==n){n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t);let r=t.get();r!==void 0&&(this.latestValues[e]=r)}}removeValue(e){this.values.delete(e),this.valueSubscriptions.get(e)?.(),this.valueSubscriptions.delete(e),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){let n=this.props.values?.[e];return n||(n=this.values.get(e),n===void 0&&t!==void 0&&(n=Tu(t??this.getDefaultValue?.(e),{owner:this}),this.addValue(e,n)),n)}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(pa(n)||ha(n))?n=parseFloat(n):typeof n!=`number`&&!Ho.test(n)&&Ho.test(t)&&(n=kc(e,t)),this.setBaseTarget(e,Ju(n)?n.get():n)),Ju(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}on(e,t){return(this.events[e]||(this.events[e]=new ba)).add(t)}notify(e,...t){this.events[e]?.notify(...t)}scheduleRenderMicrotask(){Cf.render(this.render)}},Am=class extends km{constructor(){super(...arguments),this.KeyframeResolver=dd}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;Ju(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function jm(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function Mm(e,{layout:t,layoutId:n}){return Uc.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Ef[e]||e===`opacity`)}function Nm(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(Ju(r[t])||i&&Ju(i[t])||Mm(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Pm(e){return window.getComputedStyle(e)}var Fm=class extends Am{constructor(){super(...arguments),this.type=`html`,this.renderInstance=jm}mount(e){super.mount(e)}readValueFromInstance(e,t){if(Uc.has(t))return this.projection?.isProjecting?zc(t):Vc(e,t);{let n=Pm(e),r=(Za(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return hf(e,t)}build(e,t,n){Id(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Nm(e,t,n)}},Im=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1;function Lm(e){return{point:{x:e.pageX,y:e.pageY}}}var Rm=e=>t=>Im(t)&&e(t,Lm(t));function zm(e,t,n,r){return lm(e,t,Rm(n),r)}var Bm=new WeakMap,Vm,Hm=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:xd(r)&&`getBBox`in r?r.getBBox()[t]:r[n],Um=Hm(`inline`,`width`,`offsetWidth`),Wm=Hm(`block`,`height`,`offsetHeight`);function Gm({target:e,borderBoxSize:t}){Bm.get(e)?.forEach(n=>{n(e,{get width(){return Um(e,t)},get height(){return Wm(e,t)}})})}function Km(e){e.forEach(Gm)}function qm(){typeof ResizeObserver<`u`&&(Vm=new ResizeObserver(Km))}function Jm(e,t){Vm||qm();let n=Td(e);return n.forEach(e=>{let n=Bm.get(e);n||(n=new Set,Bm.set(e,n)),n.add(t),Vm?.observe(e)}),()=>{n.forEach(e=>{let n=Bm.get(e);n?.delete(t),n?.size||Vm?.unobserve(e)})}}var Ym=new Set,Xm;function Zm(){Xm=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ym.forEach(t=>t(e))},window.addEventListener(`resize`,Xm)}function Qm(e){return Ym.add(e),Xm||Zm(),()=>{Ym.delete(e),!Ym.size&&typeof Xm==`function`&&(window.removeEventListener(`resize`,Xm),Xm=void 0)}}function $m(e,t){return Cd(typeof e==`function`?Qm(e):Jm(e,t))}var eh=(e,t)=>Math.abs(e-t);function th(e,t){let n=eh(e.x,t.x),r=eh(e.y,t.y);return Math.sqrt(n**2+r**2)}var nh=new Set([`auto`,`scroll`]),rh=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o,immediate:s}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=ah(this.lastRawMoveEventInfo,this.transformPagePoint));let e=sh(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=th(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:Ja.now()});let{onStart:i,onMove:a}=this.handlers;t||(i?.(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a?.(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.handleScroll(window),this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=ah(t,this.transformPagePoint),this.hasPendingMove=!0,ps.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i?.(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=sh(e.type===`pointercancel`?this.lastMoveEventInfo:ah(t,this.transformPagePoint),this.history);this.startEvent&&n?.(e,a),r?.(e,a)},!Im(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=s?0:a,this.contextWindow=r||window;let c=Lm(e),l=ah(c,this.transformPagePoint),{point:u}=l;this.history=[{...u,timestamp:Ja.now()}];let{onSessionStart:d}=t;d&&d(e,sh(l,this.history));let f={passive:!0,capture:!0};this.removeListeners=va(zm(this.contextWindow,`pointermove`,this.handlePointerMove,f),zm(this.contextWindow,`pointerup`,this.handlePointerUp,f),zm(this.contextWindow,`pointercancel`,this.handlePointerUp,f)),o&&this.startScrollTracking(o),s&&(this.handlePointerMove(e,c),this.updatePoint())}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(nh.has(e.overflowX)||nh.has(e.overflowY))&&this.scrollPositions.set(t,ih(t)),t=t.parentElement}this.scrollPositions.set(window,ih(window)),this.removeScrollListeners=va(lm(window,`scroll`,this.onElementScroll,{capture:!0}),lm(window,`scroll`,this.onWindowScroll,{}))}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=ih(e),i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),ps.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners?.(),this.removeScrollListeners?.(),this.scrollPositions.clear(),ms(this.updatePoint)}},ih=e=>e===window?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop};function ah(e,t){return t?{point:t(e.point)}:e}function oh(e,t){return{x:e.x-t.x,y:e.y-t.y}}function sh({point:e},t){return{point:e,delta:oh(e,lh(t)),offset:oh(e,ch(t)),velocity:uh(t,.1)}}function ch(e){return e[0]}function lh(e){return e[e.length-1]}function uh(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=lh(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>xa(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>xa(t)*2&&(r=e[1]);let a=Sa(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}var dh=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function fh(e){return dh.has(e.tagName)||e.isContentEditable===!0}var ph=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function mh(e){return ph.has(e.tagName)||e.isContentEditable===!0}var hh={x:!1,y:!1};function gh(){return hh.x||hh.y}function _h(e){return e===`x`||e===`y`?hh[e]?null:(hh[e]=!0,()=>{hh[e]=!1}):hh.x||hh.y?null:(hh.x=hh.y=!0,()=>{hh.x=hh.y=!1})}function vh(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Ko(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Ko(n,e,r.max):Math.min(e,n)),e}function yh(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function bh(e,{top:t,left:n,bottom:r,right:i}){return{x:yh(e.x,n,i),y:yh(e.y,t,r)}}function xh(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Sh(e,t){return{x:xh(e.x,t.x),y:xh(e.y,t.y)}}function Ch(e,t){let n=.5,r=G(e),i=G(t);return i>r?n=ya(t.min,t.max-r,e.min):r>i&&(n=ya(e.min,e.max-i,t.min)),da(0,1,n)}function wh(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var Th=.35;function Eh(e=Th){return e===!1?e=0:e===!0&&(e=Th),{x:Dh(e,`left`,`right`),y:Dh(e,`top`,`bottom`)}}function Dh(e,t,n){return{min:Oh(e,t),max:Oh(e,n)}}function Oh(e,t){return typeof e==`number`?e:e[t]||0}function kh(e){let t=``;for(let n of e.path){n.scroll=void 0,n.updateScroll();let{scroll:r}=n;n!==e.root&&r&&(t+=r.offset.x+`,`+r.offset.y+`,`)}return t}var Ah=new WeakMap,jh=class{constructor(e,t=()=>e.getProps()){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=pp(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e,this.readProps=t}start(e,t={}){if(this.visualElement.presenceContext?.isPresent===!1)return;let n=e=>{t.snapToCursor&&this.snapToCursor(e),this.stopAnimation()},r=(e,t)=>{let{drag:n,dragConstraints:r,dragPropagation:i,onDragStart:a}=this.getProps();if(n&&!i&&(this.openDragLock?.(),this.openDragLock=_h(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints();let{projection:o}=this.visualElement;o&&(o.isAnimationBlocked=!0,o.target=void 0),Dp(e=>{let t=this.getAxisMotionValue(e).get()||0;if($a(t)&&(t=Ru(t,this.visualElement.current)||0),U.test(t))t=parseFloat(t);else if(yo.test(t)){let n=o?.layout?.layoutBox[e];n&&(t=G(n)*(parseFloat(t)/100))}this.originPoint[e]=t}),this.point=typeof r==`function`&&r(this),a&&ps.update(()=>a(e,t),!1,!0),Xu(this.visualElement,`transform`),this.visualElement.animationState?.setActive(`whileDrag`,!0)},i=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){if(this.currentDirection=Lh(o),this.currentDirection===null)return;i&&i(this.currentDirection)}this.updateAxis(`x`,o),this.updateAxis(`y`,o),this.point&&this.point.move(),this.visualElement.render(),a&&ps.update(()=>a(e,t),!1,!0)},a=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},o=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints||this.point)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:s}=this.getProps();this.panSession=new rh(e,{onSessionStart:n,onStart:r,onMove:i,onSessionEnd:a,resumeAnimation:o},{...t,transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:s,contextWindow:this.visualElement.current?.ownerDocument.defaultView,element:this.visualElement.current})}stop(e,t,n){let r=e||this.latestPointerEvent,i=t||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!i||!r)return;let{velocity:o}=i;this.startAnimation(o,n);let{onDragEnd:s}=this.getProps();s&&ps.postRender(()=>s(r,i))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession(),!this.getProps().dragPropagation&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t?.setActive(`whileDrag`,!1)}endPanSession(){this.panSession?.end(),this.panSession=void 0}updateAxis(e,t){let{drag:n}=this.readProps();if(!t||!Ih(e,n,this.currentDirection))return;let r=this.getAxisMotionValue(e),i=this.originPoint[e]+t[e],a=this.constraints&&this.constraints[e];a&&(i=vh(i,a,this.elastic[e])),this.point?this.point[e]=i:r.set(i)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),{projection:n}=this.visualElement,r=n&&(n.layout||n.measure(!1)),i=this.constraints;Mh(e)?this.constraints&&this.scroll===kh(n)||(this.constraints=this.resolveRefConstraints()):this.constraints=e&&r&&typeof e==`object`?bh(r.layoutBox,e):!1,this.elastic=Eh(t),i!==this.constraints&&!Mh(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&Dp(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=wh(r.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!Mh(e))return!1;let n=Nh(e),{projection:r}=this.visualElement;if(!r||!r.layout)return!1;this.scroll=kh(r);let i=gf(n,r.root,this.visualElement.getTransformPagePoint()),a=Sh(r.layout.layoutBox,r.removeElementScroll(i));if(t){let e=t(Jd(a));this.hasMutatedConstraints=!!e,e&&(a=qd(e))}return a}startAnimation(e,t){let{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),c={bounceStiffness:i?200:1e6,bounceDamping:i?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...a},l=i=>r&&!(this.point&&o)&&Ih(i,t||n,this.currentDirection)?e[i]:0;if(this.point&&!o)return this.point.release({x:l(`x`),y:l(`y`)},c).then(s);let u=this.constraints||{},d=Dp(e=>{if(!Ih(e,t||n,this.currentDirection))return;let r=u[e]||{};(o===!0||o===e)&&(r={min:0,max:0});let i={type:`inertia`,velocity:l(e),...c,...r};return this.startAxisValueAnimation(e,i)});return Promise.all(d).then(s)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return Xu(this.visualElement,e),n.start(Fu(e,n,0,t,this.visualElement,!1))}stopAnimation(){Dp(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.readProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();Dp(e=>{if(!Ih(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-Ko(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Mh(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};Dp(e=>{let t=this.getAxisMotionValue(e).get();i[e]=Ch({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root?.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Dp(t=>{let n=this.getAxisMotionValue(t);if(!Ih(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(Ko(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Ah.set(this.visualElement,this);let e=this.visualElement.current,t=zm(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&mh(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps(),r=Mh(t)&&Nh(t);r&&(this.constraints=this.resolveRefConstraints(),n||=Fh(e,r,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i.layout||(i.root?.updateScroll(),i.updateLayout()),ps.read(r);let o=lm(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Dp(t=>{if(!Ih(t,this.getProps().drag,this.currentDirection))return;let n=this.getAxisMotionValue(t);this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate)}),this.visualElement.render())}));return()=>{o(),t(),a(),s(),n?.()}}getProps(){let e=this.readProps(),{dragElastic:t=Th,dragMomentum:n=!0}=e;return{...e,dragElastic:t,dragMomentum:n}}};function Mh(e){return!!e&&typeof e==`object`&&(`current`in e||`nodeType`in e)}var Nh=e=>`current`in e?e.current:e;function Ph(e){let t=!0;return()=>{t?t=!1:e()}}function Fh(e,t,n){let r=$m(e,Ph(n)),i=$m(t,Ph(n));return()=>{r(),i()}}function Ih(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Lh(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}function Rh(e,t){let n=Td(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},Cd(()=>r.abort())]}function zh(e){return!(e.pointerType===`touch`||gh())}function Bh(e,t,n={}){t=wd(t);let[r,i,a]=Rh(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{e.pointerType!==`touch`&&(n?r=!0:s(e))};e.addEventListener(`pointerenter`,n=>{if(!zh(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var Vh=(e,t)=>t?e===t||Vh(e,t.parentElement):!1,Hh=new WeakSet;function Uh(e){return t=>{t.key===`Enter`&&e(t)}}function Wh(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var Gh=(e,t)=>{let n=!1,r=Uh(()=>{n||Hh.has(e)||(n=!0,Wh(e,`down`))}),i=Uh(()=>{n&&(n=!1,Wh(e,`up`))});e.addEventListener(`keydown`,r,t),e.addEventListener(`keyup`,i,t),e.addEventListener(`blur`,()=>{e.removeEventListener(`keydown`,r),e.removeEventListener(`keyup`,i),n&&Wh(e,`cancel`)},{...t,once:!0})};function Kh(e){return Im(e)&&!gh()}var qh=new WeakSet,Jh=100,Yh=8,Xh=(e,t,n)=>Math.hypot(e.clientX-t.clientX,e.clientY-t.clientY)>n,Zh=e=>e.preventDefault();function Qh(e,t,n={}){t=wd(t);let[r,i,a]=Rh(e,n),o=new WeakMap,s=e=>{let r=e.currentTarget;if(!Kh(e)||qh.has(e))return;n.stopPropagation&&qh.add(e);let{count:a=1,countTimeout:s=.3,hold:c=0,repeat:l}=n,u=Ja.now(),d=xa(c),f=xa(s),p=o.get(r);p?.expire(Xh(p.event,e,Jh))?p=void 0:p&&(ms(p.expire),o.delete(r));let m=p?p.count+1:1,h=m>=a,g=h&&(c||l),_=!c,v=0,y;if(Hh.add(r),p)y=p.handlers;else{let n=t(r,e);y=typeof n==`function`?{onComplete:n}:n||{}}h&&_&&y.onActive?.();let b=xa(l),x=d||b,S=u+x,C=!0,w=()=>{if(i.signal.aborted)return ms(w);let e=Math.min(1-(S-Ja.now())/x,1);C&&e<1&&(e=0),C=!1,y.onHold?.(e),e<1||(_?y.onRepeat?.(++v):(_=!0,y.onActive?.()),l?(C=!0,S+=x=b):ms(w))},T={...i,capture:!0},E=(t,n)=>{if(Im(t)){if(window.removeEventListener(`pointerup`,D,T),window.removeEventListener(`pointercancel`,O,T),window.removeEventListener(`pointermove`,k,T),r.removeEventListener(`contextmenu`,Zh),ms(w),Hh.delete(r),gh()&&(n=!1),n&&!h){let n=Ja.now(),a=e=>{let s=i.signal.aborted;if(s||e===!0||Ja.now()-n>f)return ms(a),o.delete(r),s||y.onComplete?.(t,{success:!1}),!0};o.set(r,{count:m,event:e,handlers:y,expire:a}),ps.update(a,!0)}else y.onComplete?.(t,{success:n&&_})}},D=e=>{E(e,r===window||r===document||n.useGlobalTarget||Vh(r,e.target))},O=e=>{E(e,!1)},k=t=>{Im(t)&&((l||!_)&&Xh(e,t,Yh)||a>1&&gh())&&O(t)};window.addEventListener(`pointerup`,D,T),window.addEventListener(`pointercancel`,O,T),(g||a>1)&&window.addEventListener(`pointermove`,k,T),g&&(ps.update(w,!0),r.addEventListener(`contextmenu`,Zh,{...i,passive:!1}))};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,s,i),bd(e)&&(e.addEventListener(`focus`,()=>Gh(e,i),i),!fh(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function $h(...e){let t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],a=e[2+n],o=e[3+n],s=Js(i,a,o);return t?s(r):s}var eg=class{constructor(e){this.isMounted=!1,this.node=e}update(){}},tg=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),ng=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function rg(e,t,n,r){jm(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(tg.has(n)?n:Fd(n),t.attrs[n])}function ig(e,t,n){let r=Nm(e,t,n);for(let n in e)if(n!==`children`&&(Ju(e[n])||Ju(t[n]))){let t=Hc.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var ag=class extends Am{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=pp}getBaseTargetFromProps(e,t){return Uc.has(t)?super.getBaseTargetFromProps(e,t)??zc(t):e[t]}getDefaultValue(e){return Uc.has(e)?this.latestValues[e]??zc(e):void 0}readValueFromInstance(e,t){if(Uc.has(t)){let e=wc(t);return e&&e.default||0}if(Bd.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=tg.has(t)?t:Fd(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return ig(e,t,n)}build(e,t,n){Vd(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){rg(e,t,n,r)}mount(e){this.isSVGTag=ng(e.tagName),super.mount(e)}};function og(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var sg=[...gm].reverse(),cg=e=>e?.out===!0?e:e?.out;function lg(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>rd(e,t,n))),n=dg(),r=!0,i=!1;function a(a){let{props:o,parent:s,manuallyAnimateOnMount:c}=e,{initial:l}=o,u=r||i,d=[],f=(t=l)=>typeof t!=`boolean`&&Vu(e,Array.isArray(t)?t[0]:t,e.presenceContext?.custom)||void 0,p=new Map,m={},h=1/0,g=e;do g=g.props.inherit!==!1&&g.parent;while(g&&!g.isControllingVariants);let _=u&&cg(f(l??(g&&g.props.initial))?.transition);if(sg.forEach((t,r)=>{let i=n[t],l=o[t],f=g&&g.props[t],v=l===void 0?hm(f)||f===!1?f:void 0:l,y=hm(v),b=t===a?i.isActive:null,x=y&&l===void 0&&!(u&&c);if(i.protectedKeys={...m},!i.isActive&&b===null||!v&&!i.prevProp||mm(v)||typeof v==`boolean`)return;if(b===!1&&(h=r),t===`exit`&&i.isActive&&b!==!0){m={...m,...i.prevResolvedValues};return}let S=ug(i.prevProp,v),C=S||y&&(b&&!x||r>h),w=!1,T=Array.isArray(v)?v:[v],E={},D;if(b!==!1)for(let n of T){let{transition:r,transitionEnd:i,...a}=Vu(e,n,Hu(e,t))||{};E={...E,...a,...i},D=cg(r)||D}let{prevResolvedValues:O}=i;for(let t in{...O,...E}){if(t in m)continue;let n=E[t],r=O[t],a=Array.isArray(n)&&Array.isArray(r)?!og(n,r)||S:n!==r,o;if(a&&n==null)p.has(t)||p.set(t,i.prevOut);else if(a||n!==void 0&&p.has(t)){C=!0,o=p.get(t)||_,p.delete(t)&&(w=!0),i.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)}else i.protectedKeys[t]=!0;i.out[t]=o}if(i.prevProp=v,i.prevResolvedValues=E,i.prevOut=D,i.isActive&&(m={...m,...E}),C&&(!(x&&S)||w))for(let n of T){let r={type:t};if(typeof n==`string`&&u&&c&&s?.enteringChildren){let t=Vu(s,n)?.transition?.delayChildren;r.delay=bu(s.enteringChildren,e,t)}d.push({animation:n,options:r})}}),p.size){let t={},n=f(),r=n?.transition;p.forEach((i,a)=>{i&&(r={...r||e.getDefaultTransition(),[a]:i});let s=e.getValue(a);s&&(s.liveStyle=!0);let c=n&&!Array.isArray(l)?n[a]:void 0,u=e.getBaseTargetFromProps(o,a);t[a]=(c===void 0?u!==void 0&&!Ju(u)?u:e.initialValues[a]===void 0?e.baseTarget[a]:void 0:c)??null}),r&&(t.transition=r),d.push({animation:t})}let v=u&&e.blockInitialAnimation||r&&!c&&(o.initial===!1||o.initial===o.animate);return r=i=!1,!v&&d.length?t(d):Promise.resolve()}function o(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=a(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:a,setActive:o,setAnimateFunction:n=>{t=n(e)},getState:()=>n,reset:()=>{n=dg(),i=!0}}}function ug(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!og(t,e):!1}function dg(){let e={};for(let t of gm)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{},out:{}};return e}var fg=(0,B.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function pg(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function mg(...e){return t=>{let n=!1,r=e.map(e=>{let r=pg(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():pg(e[t],null)}}}}function hg(...e){return B.useCallback(mg(...e),e)}var gg=e=>{let{width:t,height:n}=e?.getBoundingClientRect()||{};return[t/e?.offsetWidth||1,n/e?.offsetHeight||1]},_g=e=>{let{left:t,top:n}=e.getBoundingClientRect(),r=e;for(;r=r.parentElement||r.parentNode?.host;){let{scrollLeft:e,scrollTop:i}=r;if(e||i){let[a,o]=gg(r);t+=e*a,n+=i*o}if(getComputedStyle(r).position===`fixed`)break}let[i,a]=gg(e.offsetParent);return[t/i,n/a]},vg=class extends B.Component{getSnapshotBeforeUpdate(e){let t=this.props.getElement();if(bd(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=bd(e)&&e.offsetWidth||0,r=bd(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction,a.point=_g(t)}return null}componentDidUpdate(){}render(){return this.props.children}};function yg({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a,popNode:o}){let s=(0,B.useId)(),c=(0,B.useRef)(null),l=(0,B.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:u}=(0,B.useContext)(fg),d=hg(c,a===!1?void 0:e.props?.ref??e?.ref),f=()=>c.current||o?.current?.current,p=e=>{let{width:t,height:i,top:a,left:o,right:c,bottom:u,direction:d}=l.current,f=d===`rtl`,p=n===`left`?f?`right:${c}`:`left:${o}`:f?`left:${o}`:`right:${c}`,m=r===`bottom`?`bottom:${u}`:`top:${a}`;e?.insertRule(`[data-motion-pop-id="${s}"]{position:absolute!important;width:${t}px!important;height:${i}px!important;${p}px!important;${m}px!important}`)};return(0,B.useInsertionEffect)(()=>{let{width:e,height:n}=l.current,r=f();if(t||a===!1||!r||!e||!n)return;r.dataset.motionPopId=s;let o=r.ownerDocument,c=o.createElement(`style`);u&&(c.nonce=u);let d=i??o.head;d.appendChild(c),p(c.sheet);let m=0,h=0;return Cf.setup(()=>{let[e,t]=_g(r);m=l.current.point[0]-e,h=l.current.point[1]-t}),Cf.read(()=>{let{sheet:e}=c;if(!e||!m&&!h)return;let t=l.current;t.left+=m,t.right-=m,t.top+=h,t.bottom-=h,e.deleteRule(0),p(e)}),()=>{r.removeAttribute(`data-motion-pop-id`),d.contains(c)&&d.removeChild(c)}},[t]),(0,V.jsx)(vg,{isPresent:t,getElement:f,sizeRef:l,pop:a,children:a===!1?e:B.cloneElement(e,{ref:d})})}var bg=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=oa(xg),d=(0,B.useId)(),f=(0,B.useRef)(),p=(0,B.useRef)(n),m=(0,B.useRef)(r);sa(()=>{p.current=n,m.current=r});let h=!0,g=(0,B.useMemo)(()=>(h=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:(e,t)=>(u.set(e,!1),t&&t.parent?.presenceContext?.id!==d&&(f.current=t),()=>{u.delete(e),!p.current&&!u.size&&m.current?.()})}),[n,u,r]);return a&&h&&(g={...g}),(0,B.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),B.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,V.jsx)(yg,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,popNode:f,children:e}),(0,V.jsx)(ca.Provider,{value:g,children:e})};function xg(){return new Map}function Sg(e=!0){let t=(0,B.useContext)(ca);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,B.useId)();(0,B.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,B.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var Cg=e=>e.key||``;function wg(e){let t=[];return B.Children.forEach(e,e=>{(0,B.isValidElement)(e)&&t.push(e)}),t}var Tg=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=Sg(o),f=(0,B.useMemo)(()=>wg(e),[e]),p=o&&!u?[]:f.map(Cg),m=(0,B.useRef)(!0),h=oa(()=>new Map),g=(0,B.useRef)(new Set),[_,v]=(0,B.useState)(f),[y,b]=(0,B.useState)(f);sa(()=>{o&&!u&&!y.length&&d?.()},[u,o,y.length,d]);let x=(0,B.useRef)();(0,B.useEffect)(()=>()=>{let e=x.current;x.current=void 0,e?.()},[y]),sa(()=>{m.current=!1;for(let e=0;e<y.length;e++){let t=Cg(y[e]);p.includes(t)?(h.delete(t),g.current.delete(t)):h.get(t)!==!0&&h.set(t,!1)}},[y,p.length,p.join(`-`)]);let S=[];if(f!==_){let e=[...f],t=0;for(let n of y){let r=p.indexOf(Cg(n));r===-1?(e.splice(t++,0,n),S.push(n)):t=r+S.length+1}return S.every(e=>h.get(Cg(e)))?e=f:a===`wait`&&(e=S),b(wg(e)),v(f),null}let{forceRender:C}=(0,B.useContext)(aa);return(0,V.jsx)(V.Fragment,{children:y.map(e=>{let _=Cg(e),b=o&&!u?!1:f===y||p.includes(_);return(0,V.jsx)(bg,{isPresent:b,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:b?void 0:()=>{if(g.current.has(_))return;if(h.has(_))g.current.add(_),h.set(_,!0);else return;let e=!0;h.forEach(t=>{t||(e=!1)}),e&&(C?.(),v([]),o&&d?.(),x.current=r)},anchorX:s,anchorY:c,children:e},_)})})},Eg=(0,B.createContext)({strict:!1}),Dg={animation:[`variants`,...gm],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},Og=!1;function kg(){if(Og)return;let e={};for(let t in Dg)e[t]={isEnabled:e=>Dg[t].some(t=>!!e[t])};Dm(e),Og=!0}function Ag(){return kg(),Om()}function jg(e){let t=Ag();for(let n in e)t[n]={...t[n],...e[n]};Dm(t)}function Mg({children:e,...t}){let n=(0,B.useContext)(fg);t={...n,...t},t.transition=Eu(t.transition,n.transition),t.isStatic=oa(()=>t.isStatic);let r=(0,B.useMemo)(()=>t,[JSON.stringify(t.transition),t.transformPagePoint,t.reducedMotion,t.skipAnimations,t.isValidProp]);return(0,V.jsx)(fg.Provider,{value:r,children:e})}var Ng=(0,B.createContext)({});function Pg(e,t){if(vm(e)){let{initial:t,animate:n}=e;return{initial:t===!1||hm(t)?t:void 0,animate:hm(n)?n:void 0}}return e.inherit===!1?{}:t}function Fg(e){let{initial:t,animate:n}=Pg(e,(0,B.useContext)(Ng));return(0,B.useMemo)(()=>({initial:t,animate:n}),[Ig(t),Ig(n)])}function Ig(e){return Array.isArray(e)?e.join(` `):e}var Lg=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Rg(e,t,n){for(let r in t)!Ju(t[r])&&!Mm(r,n)&&(e[r]=t[r])}function zg({transformTemplate:e},t){return(0,B.useMemo)(()=>{let n=Lg();return Id(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Bg(e,t){let n=e.style||{},r={};return Rg(r,n,e),Object.assign(r,zg(e,t)),r}function Vg(e,t){let n={},r=Bg(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var Hg=()=>({...Lg(),attrs:{}});function Ug(e,t,n,r){let i=(0,B.useMemo)(()=>{let n=Hg();return Vd(n,t,ng(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};return Rg(t,e.style,e),{...i,style:{...t,...i.style}}}return i}var Wg=new Set(`animate.exit.variants.initial.style.values.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.tap.propagate.ignoreStrict.viewport.pinch`.split(`.`));function Gg(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||Wg.has(e)}function Kg(e,t){return e.startsWith(`on`)?!Gg(e):t?.(e)??!Gg(e)}function qg(e,t,n,r){let i={};for(let a in e)a===`values`&&typeof e.values==`object`||Ju(e[a])||(Kg(a,r)||n===!0&&Gg(a)||!t&&!Gg(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]);return i}var Jg=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function Yg(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Jg.indexOf(e)>-1||/[A-Z]/u.test(e))}function Xg(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??Yg(e)?Ug:Vg)(t,r,i,e),l=qg(t,typeof e==`string`,a,s),u=e===B.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,B.useMemo)(()=>Ju(d)?d.get():d,[d]);return(0,B.createElement)(e,{...u,children:f})}function Zg({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Qg(n,r,i,e),renderState:t()}}function Qg(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=jf(a[e]);let{initial:o,animate:s}=e,c=vm(e),l=ym(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!mm(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=Bu(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var $g=e=>(t,n)=>{let r=(0,B.useContext)(Ng),i=(0,B.useContext)(ca),a=()=>Zg(e,t,r,i);return n?a():oa(a)},e_=$g({scrapeMotionValuesFromProps:Nm,createRenderState:Lg}),t_=$g({scrapeMotionValuesFromProps:ig,createRenderState:Hg}),n_=Symbol.for(`motionComponentSymbol`);function r_(e,t,n){let r=(0,B.useRef)(n);(0,B.useInsertionEffect)(()=>{r.current=n});let i=(0,B.useRef)(null);return(0,B.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var i_=(0,B.createContext)({});function a_(e,t,n,r,i,a){let{visualElement:o}=(0,B.useContext)(Ng),s=(0,B.useContext)(Eg),c=(0,B.useContext)(ca),l=(0,B.useContext)(fg),u=l.reducedMotion,d=l.skipAnimations,f=(0,B.useRef)(null),p=(0,B.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,B.useContext)(i_);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&i.create(m,n,h),(0,B.useInsertionEffect)(()=>{m&&m.props!==n&&m.update(n,c)});let g=n[Zu],_=(0,B.useRef)(!!g&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(g)&&window.MotionHasOptimisedAnimation?.(g));return sa(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),sa(()=>{p.current=!0,m&&(window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),_.current&&m.animationState&&m.animationState.animateChanges())}),(0,B.useEffect)(()=>{m&&(!_.current&&m.animationState&&m.animationState.animateChanges(),_.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(g)}),!1),m.enteringChildren=void 0)}),m}function o_(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&jg(r);let a=n?n===`svg`:Yg(e),o=a?t_:e_;function s(n,s){let c,l=s_(n);oa(()=>!!dm.current?.sharedNodes.get(l)?.lead&&n.initial)&&(n={...n,initial:!1});let u={...(0,B.useContext)(fg),...n,layoutId:l},{isStatic:d,isValidProp:f}=u,p=Fg(n),m=o(n,d);if(!d&&typeof window<`u`){c_(u,r);let t=l_(u);p.visualElement=a_(e,m,u,i,t.ProjectionNode,a),(t.isEnabled||p.visualElement?.projection?.options.layoutId)&&(c=t.MeasureLayout)}return(0,V.jsxs)(Ng.Provider,{value:p,children:[c&&p.visualElement?(0,V.jsx)(c,{visualElement:p.visualElement,...u}):null,Xg(e,n,r_(m,p.visualElement,s),m,d,t,a,f)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,B.forwardRef)(s);return c[n_]=e,c}function s_({layoutId:e}){let t=(0,B.useContext)(aa).id;return t&&e!==void 0?t+`-`+e:e}function c_(e,t){(0,B.useContext)(Eg).strict}function l_(e){let{drag:t,layout:n}=Ag();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:r.MeasureLayout,isEnabled:t?.isEnabled(e)||n?.isEnabled(e),ProjectionNode:r.ProjectionNode}}function u_(e,t){if(typeof Proxy>`u`)return o_;let n=new Map,r=(n,r)=>o_(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,o_(a,void 0,e,t)),n.get(a))})}var d_=(e,t)=>t.isSVG??Yg(e)?new ag(t):new Fm(t,{allowProjection:e!==B.Fragment}),f_=class extends eg{constructor(e){super(e),e.animationState||=lg(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();mm(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){this.node.getProps().animate!==this.node.prevProps?.animate&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},p_=0,m_={animation:{Feature:f_},exit:{Feature:class extends eg{constructor(){super(...arguments),this.id=p_++}update(){let{presenceContext:e,animationState:t}=this.node;if(!e||!t)return;let{isPresent:n,onExitComplete:r}=e;if(n===!this.exit)return;if(n){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=Vu(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,t.reset(),t.animateChanges()}else t.setActive(`exit`,!1);this.exit=void 0;return}let i=this.exit=t.setActive(`exit`,!0);r&&i.then(()=>{this.exit===i&&(this.exit=!0,r(this.id))})}mount(){let{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id,this.node)),this.update()}unmount(){}}}},h_=class extends eg{constructor(e){super(e),this.removeGroupControls=_a,this.removeListeners=_a,this.controls=new jh(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||_a}update(){let{dragControls:e,drag:t}=this.node.getProps(),{dragControls:n,drag:r}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls))),r&&!t&&this.controls.stop(void 0,void 0,r)}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},g_=e=>(t,n)=>{e&&ps.update(()=>e(t,n),!1,!0)},__=class extends eg{constructor(){super(...arguments),this.removePointerDownListener=_a}onPointerDown(e){this.session=new rh(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:this.node.current?.ownerDocument.defaultView})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:g_(e),onStart:g_(t),onMove:g_(n),onEnd:(e,t)=>{delete this.session,r&&ps.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=zm(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session?.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session?.end()}},v_=!1,y_=({layout:e,layoutDependency:t,layoutAnchor:n})=>({layout:e,layoutDependency:t,layoutAnchor:n,animationType:typeof e==`string`?e:`both`}),b_=(e,t)=>{let{snapshot:n}=e,r=e.getStack();r?.remove(e);let i=r?.lead;if(r?.prevLead===e&&i.resumeFrom===e&&(i.resumeFrom=i.currentAnimation=e.resumingFrom=void 0),e.options.layoutId=t,!t)e.needsShow=!0;else return e.root.registerSharedNode(t,e),()=>{let{resumeFrom:t}=e;t?.isPresent!==!1&&e.getStack().members.includes(t)&&(t.hide(),e.resumeFrom=void 0,e.snapshot=n)}},x_=class extends B.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group?.add(i),r&&n?.register?.(i),v_&&i.root.didUpdate(),i.options.layoutId!==r&&b_(i,r)?.(),i.addEventListener(`animationComplete`,()=>this.safeToRemove()),i.setOptions({...i.options,...y_(this.props),onExitComplete:()=>this.safeToRemove()})),Ap.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,layoutId:n,visualElement:r,drag:i,isPresent:a}=this.props,{projection:o}=r;return o&&(o.isPresent=a,this.takeOver=e.layoutId===n?void 0:(o.willUpdate(),b_(o,n)),o.setOptions({...o.options,...y_(this.props)}),v_=!0,i||e.layoutDependency!==t||t===void 0||e.isPresent!==a?o.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?o.promote():o.relegate()||ps.postRender(()=>{o.getStack()?.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(this.takeOver?.(),e.root.didUpdate(),Cf.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;v_=!0,r&&(r.scheduleCheckAfterUnmount(),t.group?.remove(r),n?.deregister?.(r))}safeToRemove(){this.props.safeToRemove?.()}render(){return null}};function S_(e){let[t,n]=Sg(),r=(0,B.useContext)(aa);return(0,V.jsx)(x_,{...e,layoutGroup:r,switchLayoutGroup:(0,B.useContext)(i_),isPresent:t,safeToRemove:n})}var C_={pan:{Feature:__},drag:{Feature:h_,ProjectionNode:fm,MeasureLayout:S_}};function w_(e,t,n,r,i){let{props:a}=e,o=`while`+n;!i&&e.animationState&&a[o]&&e.animationState.setActive(o,r===`Start`);let s=a[`on`+n+r];s&&ps.postRender(()=>s(t,Lm(t)))}var T_=class extends eg{mount(){let{current:e}=this.node;e&&(this.unmount=Bh(e,(e,t)=>(w_(this.node,t,`Hover`,`Start`),e=>w_(this.node,e,`Hover`,`End`))))}unmount(){}},E_=class extends eg{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=va(lm(this.node.current,`focus`,()=>this.onFocus()),lm(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function D_(e,t,n,r){e.current instanceof HTMLButtonElement&&e.current.disabled||w_(e,t,`Tap`,n,r)}var O_=class extends eg{constructor(){super(...arguments),this.options={}}mount(){let{current:e}=this.node;e&&(this.update(),this.unmount=Qh(e,(e,t)=>(D_(this.node,t,`Start`),{onComplete:(e,{success:t})=>D_(this.node,e,t?``:`Cancel`),onRepeat:()=>D_(this.node,t,``,!0)}),this.options))}update(){let{options:e,node:t}=this,{globalTapTarget:n,propagate:r,tap:i}=t.props;for(let t in e)delete e[t];Object.assign(e,i,{useGlobalTarget:n,stopPropagation:r?.tap===!1})}unmount(){}},k_=new WeakMap,A_=new WeakMap,j_=e=>{let t=k_.get(e.target);t&&t(e)},M_=e=>{e.forEach(j_)};function N_({root:e,...t}){let n=e||document;A_.has(n)||A_.set(n,{});let r=A_.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(M_,{root:e,...t})),r[i]}function P_(e,t,n){let r=N_(t);return k_.set(e,n),r.observe(e),()=>{k_.delete(e),r.unobserve(e)}}var F_={some:0,all:1},I_=class extends eg{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:F_[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=P_(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(L_(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function L_({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var R_=u_(Object.assign({},m_,{inView:{Feature:I_},tap:{Feature:O_},focus:{Feature:E_},hover:{Feature:T_}},C_,{layout:{ProjectionNode:fm,MeasureLayout:S_}}),d_);function z_(e){let t=oa(()=>Tu(e)),{isStatic:n}=(0,B.useContext)(fg);if(n){let[,n]=(0,B.useState)(e);(0,B.useEffect)(()=>t.on(`change`,n),[])}return t}function B_(e,t){let n=z_(t()),r=()=>n.set(t());return r(),sa(()=>{let t=()=>ps.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return r(),()=>{n.forEach(e=>e()),ms(r)}}),n}function V_(e){Cu.current=[],e();let t=B_(Cu.current,e);return Cu.current=void 0,t}function H_(e,t,n,r){if(typeof e==`function`)return V_(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return W_(e,t,n,r);let i=typeof t==`function`?t:$h(t,n,r),a=Array.isArray(e)?U_(e,i):U_([e],([e])=>i(e)),o=Array.isArray(e)?void 0:e.accelerate;if(o&&!o.isTransformed&&typeof t!=`function`&&Array.isArray(n)&&r?.clamp!==!1&&!r?.mixer){let e=r?.ease;a.accelerate={...o,times:[0,...t,1],keyframes:[n[0],...n,n[n.length-1]],isTransformed:!0,...e?{ease:Array.isArray(e)?[e[0],...e]:e}:{}}}return a}function U_(e,t){let n=oa(()=>[]);return B_(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function W_(e,t,n,r){let i=oa(()=>Object.keys(n)),a=oa(()=>({}));for(let o of i)a[o]=H_(e,t,n[o],r);return a}function G_(){!Sm.current&&wm();let[e]=(0,B.useState)(xm.current);return e}function K_(e){e.values.forEach(e=>e.stop())}function q_(e,t){[...t].reverse().forEach(n=>{let r=e.getVariant(n);r&&qu(e,r),e.variantChildren&&e.variantChildren.forEach(e=>{q_(e,t)})})}function J_(e,t){if(Array.isArray(t))return q_(e,t);if(typeof t==`string`)return q_(e,[t]);qu(e,t)}function Y_(){let e=new Set,t={subscribe(t){return e.add(t),()=>void e.delete(t)},start(t,n){let r=[];return e.forEach(e=>{r.push(rd(e,t,{transitionOverride:n}))}),Promise.all(r)},set(t){return e.forEach(e=>{J_(e,t)})},stop(){e.forEach(e=>{K_(e)})},mount(){return()=>{t.stop()}}};return t}function X_(e){return typeof e==`object`&&!Array.isArray(e)}function Z_(e,t,n,r){return e==null?[]:typeof e==`string`&&X_(t)?Td(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function Q_(e,t,n){return e*(t+1)+n*t}function $_(e,t){if(t.has(e))return t.get(e);let[,n,r]=e.match(/^(.+?)([+-][\d.]+)$/)||[];return t.has(n)?Math.max(0,t.get(n)+parseFloat(r)):void 0}function ev(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):$_(t,r)??e}function tv(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(ua(e,i),r--)}}function nv(e,t,n,r,i,a){tv(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:Ko(i,a,r[o]),easing:Ba(n,o)})}function rv(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function iv(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var av=`easeInOut`,ov=20;function sv(e,{defaultTransition:t={},...n}={},r,i,a){let o=t.duration||.3,s=new Map,c=new Map,l={},u=new Map,d=0,f=0,p=0,m=(e,n)=>{let a=n,s=e=>typeof e==`number`?n+e:ev(f,e,d,u);for(let n=0;n<e.length;n++){let h=e[n];if(typeof h==`string`){u.set(h,f);continue}if(!Array.isArray(h)){let e=h.at===void 0?f:s(h.at);`sequence`in h?(d=f=e,f=m(h.sequence,e),d=e,a=Math.max(a,f)):u.set(h.name,e);continue}let[g,_,v={}]=h;v.at!==void 0&&(f=s(v.at));let y=0,b=(e,n,r,a=0,s=0)=>{let c=uv(e),{delay:l=0,times:u=Xs(c),type:d=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:g=0,..._}=n,{ease:v=t.ease||`easeOut`,duration:b}=n;r.mixer||=n.mixer;let x=typeof l==`function`?l(a,s):l,S=c.length,C=vl(d)?d:i?.[d||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&pv(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,..._};b!==void 0&&(n.duration=xa(b));let r=bs(n,e,C);v=r.ease,b=r.duration}b??=o;let w=f+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&Ys(u,T),c.length===1&&c.unshift(null),m&&m<ov){let e=b>0?g/b:0;b=Q_(b,m,g);let t=[...c],n=[...u];v=Array.isArray(v)?[...v]:[v];let r=[...v],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?Oa(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),v.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),v.push(e===0?`linear`:Ba(f,e-1))}rv(u,m,e)}let E=w+b;nv(r,c,v,u,w,E),y=Math.max(x+b,y),p=Math.max(E,p)};if(Ju(g)){let e=cv(g,c);b(_,v,lv(`default`,e))}else{let e=Z_(g,_,r,l),t=e.length;for(let n=0;n<t;n++){_=_,v=v;let r=e[n],i=cv(r,c);for(let e in _)b(_[e],dv(v,e),lv(e,i),n,t)}}d=f,f+=y,a=Math.max(a,f)}return a};m(e,0),a&&(a.duration=p,a.labels=u);let{type:h,...g}=t;return c.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(iv);let o=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];o.push(n),c.push(ya(0,p,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),o.unshift(o[0]),l.unshift(av)),c[c.length-1]!==1&&(c.push(1),o.push(null)),s.has(r)||s.set(r,{keyframes:{},transition:{}});let u=s.get(r);u.keyframes[i]=o,u.transition[i]={...g,duration:p,ease:l,times:c,mixer:a.mixer||t.mixer,...n}}}),s}function cv(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function lv(e,t){return t[e]||(t[e]=[]),t[e]}function uv(e){return Array.isArray(e)?e:[e]}function dv(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var fv=e=>typeof e==`number`,pv=e=>e.every(fv);function mv(e,t){return Ju(e)||typeof e==`number`||typeof e==`string`&&!X_(t)}function hv(e,t,n,r){let i=[];if(mv(e,t))i.push(Tf(e,X_(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=Z_(e,t,r),o=a.length;for(let e=0;e<o;e++){let r=a[e],s={...n};`delay`in s&&typeof s.delay==`function`&&(s.delay=s.delay(e,o)),r instanceof Element?i.push(...xf(r,t,s,pm.get(r))):i.push(...vd(gd(r)??Sf,r,t,s))}}return i}function gv(e,t,n,r){let i=[],a=sv(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=Tu(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:Gs},r),o=t?.reduceMotion??t?.defaultTransition?.reduceMotion;return a.forEach(({keyframes:e,transition:t},n)=>{i.push(...hv(n,e,{...t,reduceMotion:o}))}),i}var _v=0;function vv({repeat:e=0,repeatDelay:t=0,repeatType:n=`loop`,delay:r=0},i,a,o){let s=i+t,c=o===void 0;if(c){let t=Math.max(0,a-r);o=s&&t>0?Math.min(e,Math.ceil(t/s-1e-9)-1):0,a=Math.min(t-o*s,i)}return n!==`loop`&&o%2&&(a=i-a),[o,c?a:r+o*s+a]}function yv(e,t){let n=[...e],r=typeof n[0]==`function`?Math.max(1,n.length-1):2;return n[r]={...n[r],at:t},n}var bv=(e,t)=>t===void 0?e:{name:e,at:t};function xv(e){e.pause(),e.time=0,e.stop()}var Sv=class e{constructor(e=[],t={},n){this.options=t,this.entries=[],this.repeatIndex=0,this.prevTime=0,this.markers=[],this.labels=new Map,this.totalDuration=0,this.isDirty=!1,this.isDone=!1,this.isRebuilding=!1,this.playbackSpeed=1,this.motionScope=Sd.current,this.isKilled=!1,this.isWrapped=!1,this.stop=()=>{this.flush(),this.group?.stop()},this.isPaused=t.autoplay===!1,this.newFinished(),e.forEach(e=>this.add(e)),n?(this.isDirty=!1,this.isWrapped=!0,this.group=new yu(n),this.watch()):(this.invalidate(),this.flush())}add(t,n){return t instanceof e&&t.adopt(this),this.push({item:t,at:n})}call(e,t){return this.push({item:e,at:t,marker:{name:`_m`+_v++,time:0,callback:e}})}addPause(e,t){return this.push({item:t||{},at:e,marker:{name:`_m`+_v++,time:0,callback:t,pause:!0}})}move(e,t){return this.entries.forEach(n=>{n.item===e&&(n.at=t)}),this.invalidate()}remove(t){return t instanceof e&&(t.parent=void 0),this.entries=this.entries.filter(e=>e.item!==t),this.invalidate()}clear(){return this.entries=[],this.invalidate()}getLabelTime(e){return this.flush(),this.labels.get(e)}seek(e){return this.time=this.resolve(e),this}playTo(e){let t=this.resolve(e),n=this.iterationDuration,r=this.time,[i]=vv(this.options,n,r),a=vv(this.options,n,t,i)[1],o=Math.abs(this.speed);return this.speed=a<r?-o:o,this.stopAt=t,this.clock||this.invalidate(),this.play(),this}reverse(){return this.speed=-this.speed,this.play(),this}get progress(){return this.duration?this.time/this.duration:0}set progress(e){this.time=e*this.duration}get time(){return this.active()?.time??0}set time(e){this.flush(),this.prevTime=e,this.group&&(this.group.time=e),this.repeatIndex=this.currentRepeat()}get speed(){return this.playbackSpeed}set speed(e){this.playbackSpeed=e,this.group&&(this.group.speed=e)}get duration(){return this.flush(),this.isWrapped?this.group.duration:this.totalDuration}get iterationDuration(){return this.flush(),this.isWrapped?this.group.iterationDuration:this.totalDuration}get state(){return this.active()?.state??`idle`}get startTime(){return this.active()?.startTime??null}play(){this.flush(),this.isPaused=!1,this.group?.play(),this.isDone&&(this.newFinished(),this.watch())}pause(){this.flush(),this.isPaused=!0,this.group?.pause()}cancel(){this.flush(),this.group?.cancel()}complete(){this.flush(),this.group?.complete()}attachTimeline(e){return this.flush(),this.scrollTimeline=e,this.detachScroll=this.group?.attachTimeline(e),()=>{this.scrollTimeline=void 0,this.detachScroll?.()}}then(e,t){return this.finished.then(e,t)}active(){return this.flush(),this.group?.animations.length?this.group:void 0}push(e){return this.entries.push(e),this.invalidate()}invalidate(){return this.parent?this.parent.invalidate():this.isDirty||(this.isDirty=!0,queueMicrotask(()=>this.flush())),this}flush(){this.isDirty&&!this.parent&&!this.isKilled&&this.build()}adopt(e){this.group&&=(xv(this.group),void 0),this.isDirty=!1,this.parent=e}build(){let e=this.isWrapped?this.group.iterationDuration:this.totalDuration;this.isDirty=!1,this.isWrapped=!1;let t=this.group,n=0;t&&(this.isRebuilding=!0,this.scrollTimeline?(this.detachScroll?.(),t.cancel()):(n=t.animations.length?t.time:0,xv(t)),this.isRebuilding=!1);let{defaultTransition:r,onComplete:i,onUpdate:a,onRepeat:o,onReverseComplete:s,autoplay:c,scope:l,...u}=this.options,d={};l?.reduceMotion!==void 0&&(d.reduceMotion=l.reduceMotion),l?.skipAnimations!==void 0&&(d.skipAnimations=l.skipAnimations),Object.assign(d,u);let f=new Map,p={},m=Sd.current;Sd.current=this.motionScope;let h;try{h=gv(this.toSequence(f),{defaultTransition:r,...d},l,p)}finally{Sd.current=m}let g=p.labels,_=d.duration??p.duration,v=p.duration?_/p.duration:1;if(g.forEach((e,t)=>g.set(t,e*v)),this.markers=[],f.forEach((e,t)=>{e.time=g.get(t),g.delete(t),_=Math.max(_,e.time),this.markers.push(e)}),this.markers.sort((e,t)=>e.time-t.time),this.labels=g,this.totalDuration=_,this.clock=this.clockAnimation=void 0,this.markers.length||this.stopAt!==void 0||a||o){let e=this.clock=Tu(0);e.on(`change`,t=>e===this.clock&&this.onClock(t)),h.unshift(this.clockAnimation=Tf(e,[0,_],{...d,duration:_,ease:`linear`}))}let y=this.group=new yu(h),{delay:b=0,repeat:x=0,repeatDelay:S=0}=this.options,[C,w]=vv(this.options,e,n);n>b&&(n=vv(this.options,_,Math.min(w,_),C)[1]),this.isDone&&n<b+(x+1)*(_+S)-S&&this.newFinished(),this.scrollTimeline?this.detachScroll=y.attachTimeline(this.scrollTimeline):(y.speed=this.playbackSpeed,this.isPaused&&y.pause(),n&&(y.time=n)),this.repeatIndex=this.currentRepeat(),this.prevTime=n||-1,this.watch()}toSequence(t){return this.entries.map(({item:n,at:r,marker:i})=>i?(t.set(i.name,i),bv(i.name,r)):n instanceof e?{sequence:n.toSequence(t),at:r}:typeof n==`string`?bv(n,r):r===void 0?n:Array.isArray(n)?yv(n,r):{...n,at:r})}resolve(e){return this.flush(),typeof e==`number`?e:$_(e,this.labels)??this.time}currentRepeat(){return vv(this.options,this.totalDuration,this.clockAnimation?.time??0)[0]}onClock(e){let t=this.prevTime;if(this.prevTime=e,this.isRebuilding)return;let{onUpdate:n,onRepeat:r,repeatType:i=`loop`}=this.options;n?.(e);let a=this.currentRepeat(),o=a>this.repeatIndex?1:-1;for(;a!==this.repeatIndex;){let e=this.speed>0==(i===`loop`||!(this.repeatIndex%2)),n=e?this.totalDuration:0;if(this.cross(t,n))return;this.repeatIndex+=o,r?.(),t=i===`loop`?e?-1:1/0:n}this.cross(t,e)}cross(e,t){if(e===t)return;let n=t>e,r=r=>n?r>e&&r<=t:r<e&&r>=t,i=n?this.markers:[...this.markers].reverse();for(let e of i)if(r(e.time)&&(e.callback?.(n?1:-1),e.pause))return this.pauseAt(e.time);if(this.stopAt!==void 0&&r(this.stopAt))return this.pauseAt(this.stopAt),this.stopAt=void 0,!0}pauseAt(e){return this.pause(),this.time=vv(this.options,this.totalDuration,e,this.repeatIndex)[1],!0}watch(){let e=this.group;e.finished.then(()=>{if(e!==this.group||this.isDone)return;this.isDone=!0;let{onComplete:t,onReverseComplete:n}=this.options,r=this.speed<0&&n||t,i=this.resolveFinished;r?.(),i()})}newFinished(){this.isDone=!1,this.finished=new Promise(e=>{this.resolveFinished=e});let{scope:e}=this.options,t=this.motionScope?.add(()=>{this.isKilled=!0,this.stop()});e?.animations.push(this),this.finished.then(()=>{t?.(),e&&ua(e.animations,this)})}};function Cv(e){return Array.isArray(e)&&e.some(e=>Array.isArray(e)||e?.sequence)}function wv(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=Sd.current?.transition,s={};n!==void 0&&(s.reduceMotion=n),r!==void 0&&(s.skipAnimations=r);let c;if(Cv(e)){let r={...s,...i,scope:t};o&&(r.defaultTransition={...o,...r.defaultTransition}),r.reduceMotion=i?.reduceMotion??r.defaultTransition?.reduceMotion??n,c=new Sv(e,r)}else{let{onComplete:n,...r}=a||{},l={...s,...o,...r},{onUpdate:u}=r;c=new Sv([typeof e==`number`||typeof e==`string`&&(typeof i==`string`||Array.isArray(i))?[u||(()=>{}),Array.isArray(i)?i:[e,i],{...l,onUpdate:void 0}]:[e,i,l]],{...s,onComplete:n,scope:t},hv(e,i,l,t))}return c}return i}var Tv=Object.assign(wv(),{addEffect:md,removeEffect:hd});function Ev(){let e=oa(Y_);return sa(e.mount,[]),e}var K=R_,Dv={type:`spring`,stiffness:420,damping:34,mass:.8},q={type:`spring`,stiffness:260,damping:30},Ov={type:`spring`,stiffness:600,damping:38};function kv(){let e=G_();return{initial:{opacity:0,y:e?0:8},animate:{opacity:1,y:0},exit:{opacity:0,y:e?0:-4,transition:{duration:.12}},transition:q}}var Av={animate:{transition:{staggerChildren:.035,delayChildren:.04}}},jv={initial:{opacity:0,y:10,scale:.985},animate:{opacity:1,y:0,scale:1,transition:q}};function J({className:e,...t}){return(0,V.jsx)(`div`,{className:z(`card`,e),...t})}function Mv({title:e,description:t,action:n,className:r}){return(0,V.jsxs)(`div`,{className:z(`flex items-start justify-between gap-4 px-5 pt-4 pb-3`,r),children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`h3`,{className:`text-[13.5px] font-semibold tracking-[-0.01em] text-fg`,children:e}),t&&(0,V.jsx)(`p`,{className:`mt-0.5 text-[12.5px] text-fg-3`,children:t})]}),n&&(0,V.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:n})]})}var Nv={neutral:`bg-surface-2 text-fg-2 border-border`,accent:`bg-accent-soft text-accent-soft-fg border-transparent`,success:`bg-success-soft text-success border-transparent`,warning:`bg-warning-soft text-warning border-transparent`,danger:`bg-danger-soft text-danger border-transparent`,info:`bg-info-soft text-info border-transparent`};function Pv({tone:e=`neutral`,dot:t=!1,pulse:n=!1,className:r,children:i}){return(0,V.jsxs)(`span`,{className:z(`inline-flex h-[22px] items-center gap-1.5 rounded-md border px-2 text-[11.5px] font-medium whitespace-nowrap`,Nv[e],r),children:[t&&(0,V.jsx)(Iv,{tone:e,pulse:n}),i]})}var Fv={neutral:`bg-fg-3`,accent:`bg-accent`,success:`bg-success`,warning:`bg-warning`,danger:`bg-danger`,info:`bg-info`};function Iv({tone:e,pulse:t=!1,className:n}){return(0,V.jsxs)(`span`,{className:z(`relative inline-flex size-1.5 shrink-0`,n),children:[t&&(0,V.jsx)(`span`,{className:z(`absolute inset-0 rounded-full motion-safe:animate-pulse-soft`,Fv[e])}),(0,V.jsx)(`span`,{className:z(`relative inline-flex size-full rounded-full`,Fv[e])})]})}function Lv({children:e,className:t}){return(0,V.jsx)(`kbd`,{className:z(`inline-flex h-5 min-w-5 items-center justify-center rounded-[5px] border border-border bg-surface-2 px-1 font-sans text-[11px] font-medium text-fg-3`,t),children:e})}function Rv({className:e}){return(0,V.jsxs)(`svg`,{className:z(`size-4 animate-spin`,e),viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":!0,children:[(0,V.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`,stroke:`currentColor`,strokeOpacity:`0.2`,strokeWidth:`3`}),(0,V.jsx)(`path`,{d:`M21 12a9 9 0 0 0-9-9`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`})]})}function zv({className:e}){return(0,V.jsx)(`div`,{className:z(`skeleton`,e)})}function Bv({icon:e,title:t,description:n,action:r,className:i}){return(0,V.jsxs)(K.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:q,className:z(`flex flex-col items-center justify-center px-6 py-14 text-center`,i),children:[(0,V.jsx)(`div`,{className:`mb-4 flex size-11 items-center justify-center rounded-xl border border-border bg-surface-2 text-fg-3 [&>svg]:size-5`,children:e}),(0,V.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t}),n&&(0,V.jsx)(`p`,{className:`mt-1 max-w-sm text-[13px] leading-relaxed text-fg-3`,children:n}),r&&(0,V.jsx)(`div`,{className:`mt-5`,children:r})]})}function Vv({error:e,onRetry:t,retrying:n=!1,className:r}){return(0,V.jsx)(Bv,{icon:(0,V.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,className:`text-danger`,children:[(0,V.jsx)(`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`}),(0,V.jsx)(`path`,{d:`M12 9v4`}),(0,V.jsx)(`path`,{d:`M12 17h.01`})]}),title:`加载失败`,description:e.message,className:r,action:(0,V.jsxs)(`button`,{type:`button`,onClick:t,disabled:n,className:`inline-flex h-8 cursor-pointer items-center gap-1.5 rounded-lg border border-border bg-surface px-3 text-[12.5px] font-medium text-fg shadow-card transition-colors hover:bg-surface-2 disabled:cursor-wait disabled:opacity-60`,children:[n&&(0,V.jsx)(Rv,{className:`size-3.5`}),`重试`]})})}function Hv({title:e,description:t,actions:n}){return(0,V.jsxs)(`div`,{className:`mb-6 flex flex-wrap items-end justify-between gap-4`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h1`,{className:`text-[22px] font-semibold tracking-[-0.025em] text-fg`,children:e}),t&&(0,V.jsx)(`p`,{className:`mt-1 text-[13.5px] text-fg-3`,children:t})]}),n&&(0,V.jsx)(`div`,{className:`flex items-center gap-2`,children:n})]})}function Uv({value:e}){return e?e.declared?!e.required.length&&!e.optional.length?(0,V.jsx)(Pv,{tone:`success`,children:`能力匹配`}):(0,V.jsxs)(`div`,{className:`space-y-1 text-[12px]`,children:[e.required.length>0&&(0,V.jsxs)(`p`,{className:`flex items-start gap-1.5 text-warning`,children:[(0,V.jsx)(Wi,{className:`mt-0.5 size-3.5 shrink-0`}),`缺少必须能力:`,e.required.map(e=>e.name).join(`、`)]}),e.optional.length>0&&(0,V.jsxs)(`p`,{className:`text-fg-3`,children:[`缺少可选能力:`,e.optional.map(e=>e.name).join(`、`)]}),(0,V.jsx)(`p`,{className:`text-fg-3`,children:`仍可启用;相关功能可能不可用或降级。`})]}):(0,V.jsx)(Pv,{children:`未声明能力要求`}):(0,V.jsx)(Pv,{children:`暂无能力记录`})}var Wv={not_sent:`未送达`,unknown:`结果未知`,partial:`部分送达`};function Gv({failure:e}){let{target:t,code:n,platformCode:r,confirmedMessageIds:i}=e,a=[t.platform,t.selfId,t.id,t.thread?.id].filter(Boolean).join(` / `);return(0,V.jsxs)(`div`,{className:`space-y-1.5 text-[12px] text-fg-3`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,V.jsx)(Pv,{tone:e.outcome===`not_sent`?`neutral`:`warning`,children:Wv[e.outcome]}),(0,V.jsxs)(`code`,{className:`break-all font-mono`,children:[n,r===void 0?``:` · ${r}`]})]}),(0,V.jsxs)(`p`,{className:`break-all`,children:[t.type===`group`?`群聊`:`私聊`,` `,(0,V.jsx)(`code`,{className:`font-mono`,children:a})]}),!!i?.length&&(0,V.jsxs)(`p`,{className:`break-all`,children:[`已确认消息 `,(0,V.jsx)(`code`,{className:`font-mono`,children:i.join(`、`)})]})]})}var Kv=new Intl.NumberFormat(`zh-CN`);function qv(e){return Kv.format(Math.round(e))}function Jv(e,t=!0){return new Date(e).toLocaleTimeString(`zh-CN`,{hour:`2-digit`,minute:`2-digit`,...t?{second:`2-digit`}:{},hour12:!1})}var Yv=[{value:10,name:`trace`},{value:20,name:`debug`},{value:30,name:`info`},{value:40,name:`warn`},{value:50,name:`error`},{value:60,name:`fatal`}];function Xv(e){return[...Yv].reverse().find(t=>e>=t.value)?.name??`trace`}var Zv={trace:`text-fg-3 bg-surface-2`,debug:`text-fg-3 bg-surface-2`,info:`text-info bg-info-soft`,warn:`text-warning bg-warning-soft`,error:`text-danger bg-danger-soft`,fatal:`text-white bg-danger`};function Qv({className:e}){let t=(0,B.useId)();return(0,V.jsxs)(`svg`,{viewBox:`0 0 32 32`,className:z(`size-7`,e),"aria-hidden":!0,children:[(0,V.jsx)(`defs`,{children:(0,V.jsxs)(`linearGradient`,{id:t,x1:`0`,y1:`0`,x2:`1`,y2:`1`,children:[(0,V.jsx)(`stop`,{offset:`0`,stopColor:`#8b7ffa`}),(0,V.jsx)(`stop`,{offset:`1`,stopColor:`#5b4cf0`})]})}),(0,V.jsx)(`rect`,{width:`32`,height:`32`,rx:`9`,fill:`url(#${t})`}),(0,V.jsx)(`rect`,{x:`0.5`,y:`0.5`,width:`31`,height:`31`,rx:`8.5`,fill:`none`,stroke:`white`,strokeOpacity:`0.18`}),(0,V.jsx)(`path`,{d:`M10 21.5 16 9l6 12.5M12.6 17h6.8`,stroke:`white`,strokeWidth:`2.6`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}var $v=232,ey={top:14,right:12,bottom:26,left:40},ty=[{key:`received`,label:`收到`,color:`var(--series-in)`},{key:`sent`,label:`发出`,color:`var(--series-out)`}];function ny(e){let t=e[0];if(!t)return``;let n=[],r=[];for(let i=1;i<e.length;i++){let[a,o]=e[i-1]??t,[s,c]=e[i]??t;r.push(s-a),n.push((c-o)/(s-a))}let i=e.map((e,t)=>{let i=n[t-1],a=n[t];if(i===void 0)return a??0;if(a===void 0||i*a<=0)return a===void 0?i:0;let o=r[t-1]??0,s=r[t]??0;return 3*(o+s)/((2*s+o)/i+(s+2*o)/a)}),a=`M${t[0]},${t[1]}`;for(let n=1;n<e.length;n++){let[r,o]=e[n-1]??t,[s,c]=e[n]??t,l=(s-r)/3;a+=`C${r+l},${o+l*(i[n-1]??0)},${s-l},${c-l*(i[n]??0)},${s},${c}`}return a}function ry(e){let t=Math.max(1,e)/4,n=10**Math.floor(Math.log10(t)),r=t/n,i=Math.max(1,(r<=1?1:r<=2?2:r<=5?5:10)*n);return{max:i*4,step:i}}function iy({points:e,range:t,dimmed:n=!1}){let r=(0,B.useRef)(null),[i,a]=(0,B.useState)(0),[o,s]=(0,B.useState)(null);(0,B.useLayoutEffect)(()=>{let e=r.current;if(!e)return;let t=new ResizeObserver(([e])=>a(e?.contentRect.width??0));return t.observe(e),()=>t.disconnect()},[]);let c=(0,B.useMemo)(()=>{if(i===0||e.length===0)return null;let n=i-ey.left-ey.right,r=$v-ey.top-ey.bottom,{max:a,step:o}=ry(Math.max(...e.map(e=>Math.max(e.received,e.sent)))),s=e.length>1?n/(e.length-1):0,c=e=>ey.left+e*s,l=e=>ey.top+r-e/a*r,u=Object.fromEntries(ty.map(t=>{let n=ny(e.map((e,n)=>[c(n),l(e[t.key])])),r=`${n}L${c(e.length-1)},${l(0)}L${c(0)},${l(0)}Z`;return[t.key,{line:n,area:r}]})),d=[0,1,2,3,4].map(e=>({value:e*o,y:l(e*o)})),f=t===`1h`?15:24;return{x:c,y:l,lines:u,ticks:d,xLabels:e.map((e,t)=>({index:t,t:e.t})).filter(({t:e,index:n})=>t===`1h`?new Date(e).getMinutes()%15==0:n%f===0),innerHeight:r,step:s}},[e,t,i]),l=t=>{if(!c||e.length===0)return;let n=t.currentTarget.getBoundingClientRect(),r=t.clientX-n.left,i=c.step===0?0:Math.round(r/c.step);s(Math.max(0,Math.min(e.length-1,i)))},u=o===null?null:e[o],d={received:e.reduce((e,t)=>e+t.received,0),sent:e.reduce((e,t)=>e+t.sent,0)},f=d.received===0&&d.sent===0;return(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`mb-3 flex items-center gap-5 px-5`,children:ty.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-[12.5px] text-fg-2`,children:[(0,V.jsx)(`span`,{className:`h-[2px] w-3.5 rounded-full`,style:{background:e.color}}),e.label,(0,V.jsx)(`span`,{className:`font-medium text-fg tabular`,children:qv(d[e.key])})]},e.key))}),(0,V.jsxs)(`div`,{ref:r,className:z(`relative transition-opacity duration-300`,n&&`opacity-50`),style:{height:$v},children:[c&&(0,V.jsxs)(`svg`,{width:i,height:$v,className:`block overflow-visible`,role:`img`,"aria-label":`消息趋势图`,children:[(0,V.jsx)(`defs`,{children:ty.map(e=>(0,V.jsxs)(`linearGradient`,{id:`fill-${e.key}`,x1:`0`,x2:`0`,y1:`0`,y2:`1`,children:[(0,V.jsx)(`stop`,{offset:`0%`,stopColor:e.color,stopOpacity:.14}),(0,V.jsx)(`stop`,{offset:`100%`,stopColor:e.color,stopOpacity:.01})]},e.key))}),c.ticks.map(e=>(0,V.jsxs)(`g`,{children:[(0,V.jsx)(`line`,{x1:ey.left,x2:i-ey.right,y1:e.y,y2:e.y,stroke:`var(--border)`,strokeWidth:1}),(0,V.jsx)(`text`,{x:ey.left-10,y:e.y,dy:`0.32em`,textAnchor:`end`,className:`fill-fg-3 text-[11px] tabular`,children:qv(e.value)})]},e.value)),c.xLabels.map(({index:e,t})=>(0,V.jsx)(`text`,{x:c.x(e),y:226,textAnchor:`middle`,className:`fill-fg-3 text-[11px] tabular`,children:Jv(t,!1)},t)),ty.map(e=>(0,V.jsx)(K.path,{d:c.lines[e.key].area,fill:`url(#fill-${e.key})`,initial:{opacity:0},animate:{opacity:1,d:c.lines[e.key].area},transition:q},`${e.key}-area`)),ty.map(e=>(0,V.jsx)(K.path,{d:c.lines[e.key].line,fill:`none`,stroke:e.color,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,initial:{pathLength:0},animate:{pathLength:1,d:c.lines[e.key].line},transition:{pathLength:{duration:1.1,ease:[.16,1,.3,1]},d:q}},`${e.key}-line`)),u&&o!==null&&(0,V.jsxs)(`g`,{pointerEvents:`none`,children:[(0,V.jsx)(`line`,{x1:c.x(o),x2:c.x(o),y1:ey.top,y2:ey.top+c.innerHeight,stroke:`var(--border-strong)`,strokeWidth:1}),ty.map(e=>(0,V.jsx)(K.circle,{initial:!1,animate:{cx:c.x(o),cy:c.y(u[e.key])},transition:{type:`spring`,stiffness:700,damping:40},r:4,fill:e.color,stroke:`var(--surface)`,strokeWidth:2},e.key))]}),(0,V.jsx)(`rect`,{x:ey.left,y:ey.top,width:Math.max(0,i-ey.left-ey.right),height:c.innerHeight,fill:`transparent`,onPointerMove:l,onPointerLeave:()=>s(null)})]}),(0,V.jsx)(Tg,{children:u&&o!==null&&c&&(0,V.jsxs)(K.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0,x:Math.min(Math.max(c.x(o)-70,0),i-150)},exit:{opacity:0},transition:{type:`spring`,stiffness:600,damping:40},className:`pointer-events-none absolute top-1 left-0 w-[150px] rounded-xl border border-border bg-surface/95 px-3 py-2.5 shadow-pop backdrop-blur`,children:[(0,V.jsxs)(`div`,{className:`mb-1.5 text-[11.5px] text-fg-3 tabular`,children:[Jv(u.t,!1),t===`24h`&&` – ${Jv(u.t+9e5,!1)}`]}),ty.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-[12.5px]`,children:[(0,V.jsx)(`span`,{className:`h-[2px] w-3 rounded-full`,style:{background:e.color}}),(0,V.jsx)(`span`,{className:`font-semibold text-fg tabular`,children:qv(u[e.key])}),(0,V.jsx)(`span`,{className:`text-fg-3`,children:e.label})]},e.key))]})}),f&&c&&(0,V.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center pb-6 text-[12.5px] text-fg-3`,children:`这段时间还没有消息`}),(0,V.jsxs)(`table`,{className:`sr-only`,children:[(0,V.jsx)(`caption`,{children:`每个时间段收到和发出的消息数`}),(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{children:`时间`}),(0,V.jsx)(`th`,{children:`收到`}),(0,V.jsx)(`th`,{children:`发出`})]})}),(0,V.jsx)(`tbody`,{children:e.map(e=>(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`td`,{children:Jv(e.t,!1)}),(0,V.jsx)(`td`,{children:e.received}),(0,V.jsx)(`td`,{children:e.sent})]},e.t))})]})]})]})}var ay=Object.defineProperty,oy=(e,t)=>ay(e,`name`,{value:t,configurable:!0}),sy=!!(typeof window<`u`&&window.document&&window.document.createElement);function Y(e,t,{checkForDefaultPrevented:n=!0}={}){return oy(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}oy(Y,`composeEventHandlers`);function cy(e){if(!sy)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}oy(cy,`getOwnerWindow`);function ly(e){if(!sy)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}oy(ly,`getOwnerDocument`);function uy(e,t=!1){let{activeElement:n}=ly(e);if(!n?.nodeName)return null;if(dy(n)&&n.contentDocument)return uy(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=ly(n).getElementById(e);if(t)return t}}return n}oy(uy,`getActiveElement`);function dy(e){return e.tagName===`IFRAME`}oy(dy,`isFrame`);var fy=Object.defineProperty,py=(e,t)=>fy(e,`name`,{value:t,configurable:!0});function my(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}py(my,`setRef`);function hy(...e){return t=>{let n=!1,r=e.map(e=>{let r=my(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():my(e[t],null)}}}}py(hy,`composeRefs`);function gy(...e){return B.useCallback(hy(...e),e)}py(gy,`useComposedRefs`);var _y=Object.defineProperty,vy=(e,t)=>_y(e,`name`,{value:t,configurable:!0});function yy(e,t){let n=B.createContext(t);n.displayName=e+`Context`;let r=vy(e=>{let{children:t,...r}=e,i=B.useMemo(()=>r,Object.values(r));return(0,V.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=B.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return vy(i,`useContext`),[r,i]}vy(yy,`createContext`);function by(e,t=[]){let n=[];function r(t,r){let i=B.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=vy(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=B.useMemo(()=>o,Object.values(o));return(0,V.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=B.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return vy(s,`useContext`),[o,s]}vy(r,`createContext`);let i=vy(()=>{let t=n.map(e=>B.createContext(e));return vy(function(n){let r=n?.[e]||t;return B.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,xy(i,...t)]}vy(by,`createContextScope`);function xy(...e){let t=e[0];if(e.length===1)return t;let n=vy(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return vy(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return B.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}vy(xy,`composeContextScopes`);var Sy=globalThis?.document?B.useLayoutEffect:()=>{},Cy=Object.defineProperty,wy=(e,t)=>Cy(e,`name`,{value:t,configurable:!0}),Ty=B.useEffectEvent,Ey=B.useInsertionEffect;function Dy(e){if(typeof Ty==`function`)return Ty(e);let t=B.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Ey==`function`?Ey(()=>{t.current=e}):Sy(()=>{t.current=e}),B.useMemo(()=>((...e)=>t.current?.(...e)),[])}wy(Dy,`useEffectEvent`);var Oy=Object.defineProperty,ky=(e,t)=>Oy(e,`name`,{value:t,configurable:!0}),Ay=B.useInsertionEffect||Sy;function jy({prop:e,defaultProp:t,onChange:n=ky(()=>{},`onChange`),caller:r}){let[i,a,o]=My({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,B.useCallback(t=>{if(s){let n=Ny(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}ky(jy,`useControllableState`);function My({defaultProp:e,onChange:t}){let[n,r]=B.useState(e),i=B.useRef(n),a=B.useRef(t);return Ay(()=>{a.current=t},[t]),B.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}ky(My,`useUncontrolledState`);function Ny(e){return typeof e==`function`}ky(Ny,`isFunction`);var Py=Symbol(`RADIX:SYNC_STATE`);function Fy(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Dy(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=B.useReducer((t,n)=>{if(n.type===Py)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=B.useRef(p);B.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=B.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return B.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Py,state:i})},[i,d.state,c]),[h,f]}ky(Fy,`useControllableStateReducer`);var Iy=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={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},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=u(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=u(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.1`})),Ly=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Iy()})),Ry=l(Ly(),1),zy=Object.defineProperty,By=(e,t)=>zy(e,`name`,{value:t,configurable:!0});function Vy(e){let t=B.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];r=Zy(r),B.Children.forEach(r,e=>{if(qy(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;Yy(n)&&typeof tb==`function`;)n=tb(n._payload);a=Wy(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=B.cloneElement(a,void 0,s):!o&&B.Children.count(r)===1&&B.isValidElement(r)&&(a=r);let c=a?Ky(a):void 0,l=gy(n,c);if(!a){if(r||r===0)throw Error(o?eb(e):$y(e));return r}let u=Gy(i,a.props??{});return a.type!==B.Fragment&&(u.ref=n?l:c),B.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}By(Vy,`createSlot`);var Hy=Symbol.for(`radix.slottable`);function Uy(e){let t=By(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Hy,t}By(Uy,`createSlottable`);var Wy=By((e,t)=>`child`in e.props?B.isValidElement(t)?B.cloneElement(t,void 0,e.props.children(t.props.children)):null:B.isValidElement(t)?t:null,`getSlottableElementFromSlottable`);function Gy(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`?n[r]=[i,a].filter(Boolean).join(` `):r===`aria-describedby`&&(n[r]=Qy(a,i))}return{...e,...n}}By(Gy,`mergeProps`);function Ky(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}By(Ky,`getElementRef`);function qy(e){return B.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Hy}By(qy,`isSlottable`);var Jy=Symbol.for(`react.lazy`);function Yy(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Jy&&`_payload`in e&&Xy(e._payload)}By(Yy,`isLazyComponent`);function Xy(e){return typeof e==`object`&&!!e&&`then`in e}By(Xy,`isPromiseLike`);function Zy(e){let t=e;for(;Yy(t)&&typeof tb==`function`;)t=tb(t._payload);return t}By(Zy,`useUnwrappedLazy`);function Qy(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}By(Qy,`concatAriaDescribedby`);var $y=By(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),eb=By(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),tb=B.use,nb=Object.defineProperty,rb=(e,t)=>nb(e,`name`,{value:t,configurable:!0}),ib=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Vy(`Primitive.${t}`),r=B.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,V.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ab(e,t){e&&Ry.flushSync(()=>e.dispatchEvent(t))}rb(ab,`dispatchDiscreteCustomEvent`);var ob=Object.defineProperty,sb=(e,t)=>ob(e,`name`,{value:t,configurable:!0});function cb(e){let t=e+`CollectionProvider`,[n,r]=by(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=sb(e=>{let{scope:t,children:n}=e,r=B.useRef(null),a=B.useRef(new Map).current;return(0,V.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=Vy(s),l=B.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=gy(t,a(s,n).collectionRef);return(0,V.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Vy(u),p=B.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=B.useRef(null),s=gy(t,o),c=a(u,n);return B.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,V.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return B.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return sb(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}sb(cb,`createCollection`);var lb=new WeakMap,ub=class e extends Map{static{sb(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],lb.set(this,!0)}set(e,t){return lb.get(this)&&!this.has(e)&&this.#e.push(e),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=r?this.size:this.size+1,a=pb(e),o=a>=0?Math.min(a,i-1):Math.max(i+a,0);if(r?this.#e.indexOf(t)===o:o===this.size)return this.set(t,n),this;let s=this.#e.filter(e=>e!==t);s.splice(o,0,t);let c=s.map(e=>[e,e===t?n:this.get(e)]);this.clear();for(let[e,t]of c)this.set(e,t);return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<r?r-1:r;return this.insert(a,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<=r?r:r+1;return this.insert(a,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=db(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=db(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return db(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=0,a=n;for(let e of this)a=i===0&&!r?e:Reflect.apply(t,this,[a,e,i,this]),i++;return a}reduceRight(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=n;for(let e=this.size-1;e>=0;e--){let n=this.entryAt(e);i=e===this.size-1&&!r?n:Reflect.apply(t,this,[i,n,e,this])}return i}sort(e){if(typeof e!=`function`)throw TypeError(`OrderedDict.sort requires a compare function`);let t=[...this.entries()].sort(e);this.clear();for(let[e,n]of t)this.set(e,n);return this}toSorted(t){if(typeof t!=`function`)throw TypeError(`OrderedDict.toSorted requires a compare function`);let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e;for(let e of this.#e.slice(t,n))r.set(e,this.get(e));return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function db(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=fb(e,t);return n===-1?void 0:e[n]}sb(db,`at`);function fb(e,t){let n=e.length,r=pb(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}sb(fb,`toSafeIndex`);function pb(e){return e!==e||e===0?0:Math.trunc(e)}sb(pb,`toSafeInteger`);function mb(e){let t=e+`CollectionProvider`,[n,r]=by(t),[i,a]=n(t);i.displayName=e+`CollectionStableContextProvider`;let[o,s]=n(t);o.displayName=e+`CollectionStatefulContextProvider`;let c=sb(({state:e,...t})=>e?(0,V.jsx)(u,{...t,state:e}):(0,V.jsx)(l,{...t}),`CollectionProvider`);c.displayName=t;let l=sb(e=>{let t=_();return(0,V.jsx)(u,{...e,state:t})},`CollectionInit`);l.displayName=e+`CollectionInit`;let u=sb(e=>{let{scope:t,children:n,state:r}=e,a=B.useRef(null),[s,c]=B.useState(null),l=gy(a,c),[u,d]=r,f=B.useRef(new ub),p=B.useCallback(()=>{let e=f.current;return _b(e)||e.sort(vb),e},[]);return B.useEffect(()=>{if(!s)return;let e=yb(()=>{d(e=>{let t=e.toSorted(vb);return t.some(([t],n)=>e.keyAt(n)!==t)?t:e})});return e.observe(s,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[s,d]),(0,V.jsx)(i,{scope:t,collectionElementRef:l,collectionElementRefObject:a,getCollection:p,setCollection:d,registryRef:f,children:(0,V.jsx)(o,{scope:t,collectionElement:s,collection:u,children:n})})},`CollectionProviderImpl`);u.displayName=e+`CollectionProviderImpl`;let d=e+`CollectionSlot`,f=Vy(d),p=B.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=gy(t,a(d,n).collectionElementRef);return(0,V.jsx)(f,{ref:i,children:r})});p.displayName=d;let m=e+`CollectionItemSlot`,h=Vy(m),g=B.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=B.useRef(null),{setCollection:s,registryRef:c}=a(m,n),l=B.useRef(i);hb(l.current,i)||(l.current=i);let u=l.current,d=gy(t,B.useCallback(e=>{let t=c.current;e?t.set(e,{...l.current,element:e}):o.current&&t.delete(o.current)},[c]),o);Sy(()=>{let e=o.current,t=c.current;e&&t.has(e)&&t.set(e,{...u,element:e})},[u,c]);let f=B.useRef(null);return B.useEffect(()=>{let e=o.current,t=f.current;((t?.element??null)!==e||e&&t?.itemData!==u)&&(f.current=e?{element:e,itemData:u}:null,s(n=>{let r=new ub(n);return t&&t.element!==e&&r.delete(t.element),e&&r.set(e,{...u,element:e}),r.sort(vb)}))}),B.useEffect(()=>()=>{let e=f.current;f.current=null,e&&s(t=>{if(!t.has(e.element))return t;let n=new ub(t);return n.delete(e.element),n})},[s]),(0,V.jsx)(h,{"data-radix-collection-item":``,ref:d,children:r})});g.displayName=m;function _(){return B.useState(new ub)}sb(_,`useInitCollection`);function v(t){let{collection:n}=s(e+`CollectionConsumer`,t);return n}sb(v,`useCollection`);function y(t){let{getCollection:n}=a(e+`CollectionConsumer`,t);return n}return sb(y,`useGetCollection`),[{Provider:c,Slot:p,ItemSlot:g},{createCollectionScope:r,useCollection:v,useGetCollection:y,useInitCollection:_}]}sb(mb,`createCollection`);function hb(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}sb(hb,`shallowEqual`);function gb(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}sb(gb,`isElementPreceding`);function _b(e){let t;for(let n of e.keys()){if(t){let e=t.compareDocumentPosition(n);if(!(e&Node.DOCUMENT_POSITION_DISCONNECTED)&&e&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}sb(_b,`isInDocumentOrder`);function vb(e,t){return!e[1].element||!t[1].element?0:gb(e[1].element,t[1].element)?-1:1}sb(vb,`sortByDocumentPosition`);function yb(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}sb(yb,`getChildListObserver`);var bb=Object.defineProperty,xb=(e,t)=>bb(e,`name`,{value:t,configurable:!0}),Sb={LTR:`ltr`,RTL:`rtl`},Cb=B.createContext(void 0);function wb(e){let t=B.useContext(Cb);return e||t||Sb.LTR}xb(wb,`useDirection`);var Tb=Object.defineProperty,Eb=(e,t)=>Tb(e,`name`,{value:t,configurable:!0}),Db=B.useInsertionEffect;function Ob(e){let t=B.useRef(e);return typeof Db==`function`?Db(()=>{t.current=e}):Sy(()=>{t.current=e}),B.useMemo(()=>((...e)=>t.current?.(...e)),[])}Eb(Ob,`useCallbackRef`);var kb=Object.defineProperty,Ab=(e,t)=>kb(e,`name`,{value:t,configurable:!0}),jb=`dismissableLayer.update`,Mb=`dismissableLayer.pointerDownOutside`,Nb=`dismissableLayer.focusOutside`,Pb,Fb=B.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ib=B.forwardRef(Ab(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=B.useContext(Fb),[d,f]=B.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=B.useState({}),h=gy(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=B.useRef(!1),C=zb(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:B.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),w=Bb(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),T=d?y===g.length-1:!1,E=Ob(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return B.useEffect(()=>{if(T)return p.addEventListener(`keydown`,E,{capture:!0}),()=>p.removeEventListener(`keydown`,E,{capture:!0})},[p,T,E]),B.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Pb=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Vb(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Pb))}},[d,p,n,u]),B.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Vb())},[d,u]),B.useEffect(()=>{let e=Ab(()=>m({}),`handleUpdate`);return document.addEventListener(jb,e),()=>document.removeEventListener(jb,e)},[]),(0,V.jsx)(ib.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:Y(e.onFocusCapture,w.onFocusCapture),onBlurCapture:Y(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:Y(e.onPointerDownCapture,C.onPointerDownCapture)})},`DismissableLayer`));function Lb(){let e=B.useContext(Fb),[t,n]=B.useState(null);return B.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Ab(Lb,`useDismissableLayerSurface`);var Rb=Ab(()=>!0,`IS_TRUE`);function zb(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Rb}=t,s=Ob(e),c=B.useRef(!1),l=B.useRef(!1),u=B.useRef(new Map),d=B.useRef(()=>{});return B.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Ab(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Ab(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}Ab(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Ab(p,`handleInteractionBubble`);let m=Ab(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||Hb(Mb,s,p,{discrete:!0})};if(Ab(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:Ab(()=>c.current=!0,`onPointerDownCapture`)}}Ab(zb,`usePointerDownOutside`);function Bb(e,t=globalThis?.document){let n=Ob(e),r=B.useRef(!1);return B.useEffect(()=>{let e=Ab(e=>{e.target&&!r.current&&Hb(Nb,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Ab(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Ab(()=>r.current=!1,`onBlurCapture`)}}Ab(Bb,`useFocusOutside`);function Vb(){let e=new CustomEvent(jb);document.dispatchEvent(e)}Ab(Vb,`dispatchUpdate`);function Hb(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?ab(i,a):i.dispatchEvent(a)}Ab(Hb,`handleAndDispatchCustomEvent`);var Ub=Object.defineProperty,Wb=(e,t)=>Ub(e,`name`,{value:t,configurable:!0}),Gb=0,Kb=null;function qb(e){return Jb(),e.children}Wb(qb,`FocusGuards`);function Jb(){B.useEffect(()=>{Kb||={start:Yb(),end:Yb()};let{start:e,end:t}=Kb;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Gb++,()=>{Gb===1&&(Kb?.start.remove(),Kb?.end.remove(),Kb=null),Gb=Math.max(0,Gb-1)}},[])}Wb(Jb,`useFocusGuards`);function Yb(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Wb(Yb,`createFocusGuard`);var Xb=Object.defineProperty,Zb=(e,t)=>Xb(e,`name`,{value:t,configurable:!0}),Qb=`focusScope.autoFocusOnMount`,$b=`focusScope.autoFocusOnUnmount`,ex={bubbles:!1,cancelable:!0},tx=B.forwardRef(Zb(function(e,t){let{loop:n=!1,trapped:r=!1,branches:i,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[c,l]=B.useState(null),u=Ob(a),d=Ob(o),f=B.useRef(null),p=gy(t,l),m=B.useRef(i);B.useEffect(()=>{m.current=i});let h=B.useCallback(e=>e?c?.contains(e)?!0:!!m.current?.some(t=>t.contains(e)):!1,[c]),g=B.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;B.useEffect(()=>{if(r){let e=function(e){if(g.paused||!c)return;let t=e.target;h(t)?f.current=t:fx(f.current,{select:!0})},t=function(e){if(g.paused||!c)return;let t=e.relatedTarget;t!==null&&(h(t)||fx(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&fx(c)};Zb(e,`handleFocusIn`),Zb(t,`handleFocusOut`),Zb(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,g.paused,h]),B.useEffect(()=>{if(c){px.add(g);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(Qb,ex);c.addEventListener(Qb,u),c.dispatchEvent(t),t.defaultPrevented||(ox(gx(cx(c)),{select:!0}),document.activeElement===e&&fx(c))}return()=>{c.removeEventListener(Qb,u);let t=c.ownerDocument,n=CustomEvent;setTimeout(()=>{let r=new n($b,ex);c.addEventListener($b,d),c.dispatchEvent(r),r.defaultPrevented||fx(e??t.body,{select:!0}),c.removeEventListener($b,d),px.remove(g)},0)}}},[c,u,d,g]);let _=B.useCallback(e=>{if(!n&&!r||g.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=sx(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&fx(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&fx(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,V.jsx)(ib.div,{tabIndex:-1,...s,ref:p,onKeyDown:_})},`FocusScope`)),nx=B.createContext(null);function rx({registry:e,children:t}){return e?(0,V.jsx)(nx.Provider,{value:e,children:t}):t}Zb(rx,`FocusScopeBranchProvider`);function ix(){let[e,t]=B.useState([]);return{nodes:e,registry:B.useMemo(()=>({add:Zb(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:Zb(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}Zb(ix,`useFocusScopeBranchRegistry`);function ax(e){let t=B.useContext(nx);B.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}Zb(ax,`useFocusScopeBranch`);function ox(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(fx(r,{select:t}),document.activeElement!==n)return}Zb(ox,`focusFirst`);function sx(e){let t=cx(e);return[lx(t,e),lx(t.reverse(),e)]}Zb(sx,`getTabbableEdges`);function cx(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Zb(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}Zb(cx,`getTabbableCandidates`);function lx(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):ux(r,{upTo:t})))return r}Zb(lx,`findVisible`);function ux(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}Zb(ux,`isHidden`);function dx(e){return e.tagName===`INPUT`&&typeof e.select==`function`}Zb(dx,`isSelectableInput`);function fx(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&dx(e)&&t&&e.select()}}Zb(fx,`focus`);var px=mx();function mx(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=hx(e,t),e.unshift(t)},remove(t){e=hx(e,t),e[0]?.resume()}}}Zb(mx,`createFocusScopesStack`);function hx(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Zb(hx,`arrayRemove`);function gx(e){return e.filter(e=>e.tagName!==`A`)}Zb(gx,`removeLinks`);var _x=Object.defineProperty,vx=(e,t)=>_x(e,`name`,{value:t,configurable:!0}),yx=B.useId||(()=>void 0),bx=0;function xx(e){let[t,n]=B.useState(yx());return Sy(()=>{e||n(e=>e??String(bx++))},[e]),e||(t?`radix-${t}`:``)}vx(xx,`useId`);var Sx=[`top`,`right`,`bottom`,`left`],Cx=Math.min,wx=Math.max,Tx=Math.round,Ex=Math.floor,Dx=e=>({x:e,y:e}),Ox={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function kx(e,t,n){return wx(e,Cx(t,n))}function Ax(e,t){return typeof e==`function`?e(t):e}function jx(e){return e.split(`-`)[0]}function Mx(e){return e.split(`-`)[1]}function Nx(e){return e===`x`?`y`:`x`}function Px(e){return e===`y`?`height`:`width`}function Fx(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Ix(e){return Nx(Fx(e))}function Lx(e,t,n){n===void 0&&(n=!1);let r=Mx(e),i=Ix(e),a=Px(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Kx(o)),[o,Kx(o)]}function Rx(e){let t=Kx(e);return[zx(e),t,zx(t)]}function zx(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Bx=[`left`,`right`],Vx=[`right`,`left`],Hx=[`top`,`bottom`],Ux=[`bottom`,`top`];function Wx(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Vx:Bx:t?Bx:Vx;case`left`:case`right`:return t?Hx:Ux;default:return[]}}function Gx(e,t,n,r){let i=Mx(e),a=Wx(jx(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(zx)))),a}function Kx(e){let t=jx(e);return Ox[t]+e.slice(t.length)}function qx(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Jx(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:qx(e)}function Yx(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Xx(e,t,n){let{reference:r,floating:i}=e,a=Fx(t),o=Ix(t),s=Px(o),c=jx(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Mx(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Zx(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Ax(t,e),p=Jx(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Yx(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Yx(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Qx=50,$x=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Zx},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Xx(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Qx&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Xx(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},eS=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Ax(e,t)||{};if(l==null)return{};let d=Jx(u),f={x:n,y:r},p=Ix(i),m=Px(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;C&&await(o.isElement==null?void 0:o.isElement(S))||(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Cx(d[_],T),D=Cx(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=kx(E,k,O),ee=!c.arrow&&Mx(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,j=ee?k<E?k-E:k-O:0;return{[p]:f[p]+j,data:{[p]:A,centerOffset:k-A-j,...ee&&{alignmentOffset:j}},reset:ee}}}),tS=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Ax(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=jx(r),_=Fx(o),v=jx(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Kx(o)]:Rx(o)),x=p!==`none`;!d&&x&&b.push(...Gx(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Lx(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Fx(t)||T.every(e=>Fx(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Fx(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function nS(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function rS(e){return Sx.some(t=>e[t]>=0)}var iS=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Ax(e,t);switch(i){case`referenceHidden`:{let e=nS(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:rS(e)}}}case`escaped`:{let e=nS(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:rS(e)}}}default:return{}}}}},aS=new Set([`left`,`top`]);async function oS(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=jx(n),s=Mx(n),c=Fx(n)===`y`,l=aS.has(o)?-1:1,u=a&&c?-1:1,d=Ax(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var sS=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await oS(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},cS=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Ax(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Fx(i),p=Nx(f),m=u[p],h=u[f],g=(e,t)=>kx(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},lS=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Ax(e,t),u={x:n,y:r},d=Fx(i),f=Nx(d),p=u[f],m=u[d],h=Ax(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=aS.has(jx(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},uS=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Ax(e,t),c=await i.detectOverflow(t,s),l=jx(n),u=Mx(n),d=Fx(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Cx(p-c[m],g),y=Cx(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*wx(c.left,c.right):S=p-2*wx(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function dS(){return typeof window<`u`}function fS(e){return hS(e)?(e.nodeName||``).toLowerCase():`#document`}function pS(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function mS(e){return((hS(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function hS(e){return dS()?e instanceof Node||e instanceof pS(e).Node:!1}function gS(e){return dS()?e instanceof Element||e instanceof pS(e).Element:!1}function _S(e){return dS()?e instanceof HTMLElement||e instanceof pS(e).HTMLElement:!1}function vS(e){return!dS()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof pS(e).ShadowRoot}function yS(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=AS(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function bS(e){return/^(table|td|th)$/.test(fS(e))}function xS(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var SS=/transform|translate|scale|rotate|perspective|filter/,CS=/paint|layout|strict|content/,wS=e=>!!e&&e!==`none`,TS;function ES(e){let t=gS(e)?AS(e):e;return wS(t.transform)||wS(t.translate)||wS(t.scale)||wS(t.rotate)||wS(t.perspective)||!OS()&&(wS(t.backdropFilter)||wS(t.filter))||SS.test(t.willChange||``)||CS.test(t.contain||``)}function DS(e){let t=MS(e);for(;_S(t)&&!kS(t);){if(ES(t))return t;if(xS(t))return null;t=MS(t)}return null}function OS(){return TS??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),TS}function kS(e){return/^(html|body|#document)$/.test(fS(e))}function AS(e){return pS(e).getComputedStyle(e)}function jS(e){return gS(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function MS(e){if(fS(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||vS(e)&&e.host||mS(e);return vS(t)?t.host:t}function NS(e){let t=MS(e);return kS(t)?(e.ownerDocument||e).body:_S(t)&&yS(t)?t:NS(t)}function PS(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=NS(e),i=r===e.ownerDocument?.body,a=pS(r);if(i){let e=FS(a);return t.concat(a,a.visualViewport||[],yS(r)?r:[],e&&n?PS(e):[])}return t.concat(r,PS(r,[],n))}function FS(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function IS(e){let t=AS(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=_S(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Tx(n)!==a||Tx(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function LS(e){return gS(e)?e:e.contextElement}function RS(e){let t=LS(e);if(!_S(t))return Dx(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=IS(t),o=(a?Tx(n.width):n.width)/r,s=(a?Tx(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var zS=Dx(0);function BS(e){let t=pS(e);return!OS()||!t.visualViewport?zS:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function VS(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===pS(e)}function HS(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=LS(e),o=Dx(1);t&&(r?gS(r)&&(o=RS(r)):o=RS(e));let s=VS(a,n,r)?BS(a):Dx(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=pS(a),t=gS(r)?pS(r):r,n=e,i=FS(n);for(;i&&t!==n;){let e=RS(i),t=i.getBoundingClientRect(),r=AS(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=pS(i),i=FS(n)}}return Yx({width:u,height:d,x:c,y:l})}function US(e,t){let n=jS(e).scrollLeft;return t?t.left+n:HS(mS(e)).left+n}function WS(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-US(e,n),y:n.top+t.scrollTop}}function GS(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=mS(r),s=t?xS(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Dx(1),u=Dx(0),d=_S(r);if((d||!a)&&((fS(r)!==`body`||yS(o))&&(c=jS(r)),d)){let e=HS(r);l=RS(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?WS(o,c):Dx(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function KS(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function qS(e){let t=jS(e),n=e.ownerDocument.body,r=wx(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=wx(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+US(e),o=-t.scrollTop;return AS(n).direction===`rtl`&&(a+=wx(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var JS=25;function YS(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=pS(e),a=mS(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!OS()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(US(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=JS&&(s-=o)}return{width:s,height:c,x:l,y:u}}function XS(e,t){let n=HS(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=RS(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function ZS(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=YS(e,n,t);else if(t===`document`)r=qS(mS(e));else if(gS(t))r=XS(t,n);else{let n=BS(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Yx(r)}function QS(e,t){let n=t.get(e);if(n)return n;let r=PS(e,[],!1).filter(e=>gS(e)&&fS(e)!==`body`),i=null,a=AS(e).position===`fixed`,o=a?MS(e):e;for(;gS(o)&&!kS(o);){let e=AS(o),t=ES(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=MS(o)}return t.set(e,r),r}function $S(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?xS(t)?[]:QS(t,this._c):[].concat(n),r],o=ZS(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=ZS(t,a[e],i);s=wx(n.top,s),c=Cx(n.right,c),l=Cx(n.bottom,l),u=wx(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function eC(e){let{width:t,height:n}=IS(e);return{width:t,height:n}}function tC(e,t,n){let r=_S(t),i=mS(t),a=n===`fixed`,o=HS(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Dx(0);if((r||!a)&&((fS(t)!==`body`||yS(i))&&(s=jS(t)),r)){let e=HS(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=US(i));let l=i&&!r&&!a?WS(i,s):Dx(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function nC(e){return AS(e).position===`static`}function rC(e,t){if(!_S(e)||AS(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return mS(e)===n&&(n=n.ownerDocument.body),n}function iC(e,t){let n=pS(e);if(xS(e))return n;if(!_S(e)){let t=MS(e);for(;t&&!kS(t);){if(gS(t)&&!nC(t))return t;t=MS(t)}return n}let r=rC(e,t);for(;r&&bS(r)&&nC(r);)r=rC(r,t);return r&&kS(r)&&nC(r)&&!ES(r)?n:r||DS(e)||n}var aC=async function(e){let t=this.getOffsetParent||iC,n=this.getDimensions,r=await n(e.floating);return{reference:tC(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function oC(e){return AS(e).direction===`rtl`}var sC={convertOffsetParentRelativeRectToViewportRelativeRect:GS,getDocumentElement:mS,getClippingRect:$S,getOffsetParent:iC,getElementRects:aC,getClientRects:KS,getDimensions:eC,getScale:RS,isElement:gS,isRTL:oC};function cC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function lC(e,t,n){let r=null,i,a=mS(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Ex(d),h=Ex(a.clientWidth-(u+f)),g=Ex(a.clientHeight-(d+p)),_=Ex(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:wx(0,Cx(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!cC(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=pS(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function uC(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=LS(e),u=i||a?[...l?PS(l):[],...t?PS(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?lC(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?HS(e):null;c&&g();function g(){let t=HS(e);h&&!cC(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var dC=sS,fC=cS,pC=tS,mC=uS,hC=iS,gC=eS,_C=lS,vC=(e,t,n)=>{let r=new Map,i=n??{},a={...sC,...i.platform,_c:r};return $x(e,t,{...i,platform:a})},yC=typeof document<`u`?B.useLayoutEffect:function(){};function bC(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!bC(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!bC(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function xC(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function SC(e,t){let n=xC(e);return Math.round(t*n)/n}function CC(e){let t=B.useRef(e);return yC(()=>{t.current=e}),t}function wC(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=B.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=B.useState(r);bC(f,r)||p(r);let[m,h]=B.useState(null),[g,_]=B.useState(null),v=B.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=B.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=B.useRef(null),C=B.useRef(null),w=B.useRef(u),T=c!=null,E=CC(c),D=CC(i),O=CC(l),k=B.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),vC(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!bC(w.current,t)&&(w.current=t,Ry.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);yC(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=B.useRef(!1);yC(()=>(A.current=!0,()=>{A.current=!1}),[]),yC(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let ee=B.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),j=B.useMemo(()=>({reference:b,floating:x}),[b,x]),M=B.useMemo(()=>{let e={position:n,left:0,top:0};if(!j.floating)return e;let t=SC(j.floating,u.x),r=SC(j.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...xC(j.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,j.floating,u.x,u.y]);return B.useMemo(()=>({...u,update:k,refs:ee,elements:j,floatingStyles:M}),[u,k,ee,j,M])}var TC=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:gC({element:r.current,padding:i}).fn(n):r?gC({element:r,padding:i}).fn(n):{}}}},EC=(e,t)=>{let n=dC(e);return{name:n.name,fn:n.fn,options:[e,t]}},DC=(e,t)=>{let n=fC(e);return{name:n.name,fn:n.fn,options:[e,t]}},OC=(e,t)=>({fn:_C(e).fn,options:[e,t]}),kC=(e,t)=>{let n=pC(e);return{name:n.name,fn:n.fn,options:[e,t]}},AC=(e,t)=>{let n=mC(e);return{name:n.name,fn:n.fn,options:[e,t]}},jC=(e,t)=>{let n=hC(e);return{name:n.name,fn:n.fn,options:[e,t]}},MC=(e,t)=>{let n=TC(e);return{name:n.name,fn:n.fn,options:[e,t]}},NC=Object.defineProperty,PC=(e,t)=>NC(e,`name`,{value:t,configurable:!0});function FC(e){let[t,n]=B.useState(void 0);return Sy(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=0,r=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let i=r[0];window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{let t,r;if(`borderBoxSize`in i){let e=i.borderBoxSize,n=Array.isArray(e)?e[0]:e;t=n.inlineSize,r=n.blockSize}else t=e.offsetWidth,r=e.offsetHeight;n({width:t,height:r})})});return r.observe(e,{box:`border-box`}),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}n(void 0)},[e]),t}PC(FC,`useSize`);var IC=Object.defineProperty,LC=(e,t)=>IC(e,`name`,{value:t,configurable:!0}),RC={Partial:`partial`,Always:`always`},zC={Optimized:`optimized`,Always:`always`},BC=`Popper`,[VC,HC]=by(BC),[UC,WC]=VC(BC),GC=LC(e=>{let{__scopePopper:t,children:n}=e,[r,i]=B.useState(null),[a,o]=B.useState(void 0);return(0,V.jsx)(UC,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),KC=`PopperAnchor`,qC=B.forwardRef(LC(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=WC(KC,n),o=B.useRef(null),s=a.onAnchorChange,c=gy(t,B.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=B.useRef(null);B.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&ew(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,V.jsx)(ib.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),JC=`PopperContent`,[YC,XC]=VC(JC),ZC=B.forwardRef(LC(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=RC.Partial,hideWhenDetached:f=!1,updatePositionStrategy:p=zC.Optimized,onPlaced:m,...h}=e,g=WC(JC,n),[_,v]=B.useState(null),y=gy(t,v),[b,x]=B.useState(null),S=FC(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],O=D.length>0,k={padding:E,boundary:D.filter(QC),altBoundary:O},{refs:A,floatingStyles:ee,placement:j,isPositioned:M,middlewareData:te}=wC({strategy:`fixed`,placement:T,whileElementsMounted:LC((...e)=>uC(...e,{animationFrame:p===zC.Always}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[EC({mainAxis:i+w,alignmentAxis:o}),c&&DC({mainAxis:!0,crossAxis:!1,...d===RC.Partial?{limiter:OC()}:{},...k}),c&&kC({...k}),AC({...k,apply:LC(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),b&&MC({element:b,padding:s}),$C({arrowWidth:C,arrowHeight:w}),f&&jC(O?{strategy:`referenceHidden`,...k}:{strategy:`referenceHidden`,padding:k.padding,altBoundary:k.altBoundary})]}),N=g.setPlacementState;Sy(()=>(N(j),()=>{N(void 0)}),[j,N]);let[P,ne]=ew(j),re=Ob(m);Sy(()=>{M&&re?.()},[M,re]);let ie=te.arrow?.x,ae=te.arrow?.y,oe=te.arrow?.centerOffset!==0,[se,ce]=B.useState();return Sy(()=>{_&&ce(window.getComputedStyle(_).zIndex)},[_]),(0,V.jsx)(`div`,{ref:A.setFloating,"data-radix-popper-content-wrapper":``,style:{...ee,transform:M?ee.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:se,"--radix-popper-transform-origin":[te.transformOrigin?.x,te.transformOrigin?.y].join(` `),...te.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,V.jsx)(YC,{scope:n,placedSide:P,placedAlign:ne,onArrowChange:x,arrowX:ie,arrowY:ae,shouldHideArrow:oe,children:(0,V.jsx)(ib.div,{"data-side":P,"data-align":ne,...h,ref:y,style:{...h.style,animation:M?h.style?.animation:`none`}})})})},`PopperContent`));function QC(e){return e!==null}LC(QC,`isNotNull`);var $C=LC(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=ew(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function ew(e){let[t,n=`center`]=e.split(`-`);return[t,n]}LC(ew,`getSideAndAlignFromPlacement`);var tw=Object.defineProperty,nw=B.forwardRef(((e,t)=>tw(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=B.useState(!1);Sy(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Ry.createPortal((0,V.jsx)(ib.div,{...r,ref:t}),o):null},`Portal`)),rw=Object.defineProperty,iw=(e,t)=>rw(e,`name`,{value:t,configurable:!0});function aw(e,t){return B.useReducer((e,n)=>t[e][n]??e,e)}iw(aw,`useStateMachine`);var ow=iw(e=>{let{present:t,children:n}=e,r=sw(t),i=typeof n==`function`?n({present:r.isPresent}):B.Children.only(n),a=lw(r.ref,dw(i));return typeof n==`function`||r.isPresent?B.cloneElement(i,{ref:a}):null},`Presence`);function sw(e){let[t,n]=B.useState(),r=B.useRef(null),i=B.useRef(e),a=B.useRef(`none`),o=B.useRef(void 0),[s,c]=aw(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return B.useEffect(()=>{s===`mounted`?(a.current=o.current??uw(r.current),o.current=void 0):a.current=`none`},[s]),Sy(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=uw(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),Sy(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=iw(a=>{let o=uw(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=iw(e=>{e.target===t&&(a.current=uw(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:B.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=uw(t)}else r.current=null;n(e)},[])}}iw(sw,`usePresence`);function cw(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}iw(cw,`setRef`);function lw(...e){let t=B.useRef(e);return t.current=e,B.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=cw(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():cw(n[e],null)}}},[])}iw(lw,`useStableComposedRefs`);function uw(e){return e?.animationName||`none`}iw(uw,`getAnimationName`);function dw(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}iw(dw,`getElementRef`);var fw=Object.defineProperty,pw=(e,t)=>fw(e,`name`,{value:t,configurable:!0}),mw=!1;function hw(){let[e,t]=B.useState(mw);return B.useEffect(()=>{mw||(mw=!0,t(!0))},[]),e}pw(hw,`useIsHydrated`);var gw=B.useSyncExternalStore;function _w(){return()=>{}}pw(_w,`subscribe`);function vw(){return gw(_w,()=>!0,()=>!1)}pw(vw,`useIsHydratedModern`);var yw=typeof gw==`function`?vw:hw,bw=Object.defineProperty,xw=(e,t)=>bw(e,`name`,{value:t,configurable:!0}),Sw=`rovingFocusGroup.onEntryFocus`,Cw={bubbles:!1,cancelable:!0},ww=`RovingFocusGroup`,[Tw,Ew,Dw]=cb(ww),[Ow,kw]=by(ww,[Dw]),Aw={Vertical:`vertical`,Horizontal:`horizontal`},jw={LTR:`ltr`,RTL:`rtl`},[Mw,Nw]=Ow(ww),Pw=B.forwardRef(xw(function(e,t){return(0,V.jsx)(Tw.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,V.jsx)(Tw.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,V.jsx)(Fw,{...e,ref:t})})})},`RovingFocusGroup`)),Fw=B.forwardRef(xw(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=B.useRef(null),p=gy(t,f),m=wb(a),[h,g]=jy({prop:o,defaultProp:s??null,onChange:c,caller:ww}),[_,v]=B.useState(!1),y=Ob(l),b=Ew(n),x=B.useRef(!1),[S,C]=B.useState(0);return B.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Sw,y),()=>e.removeEventListener(Sw,y)},[y]),(0,V.jsx)(Mw,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:B.useCallback(e=>g(e),[g]),onItemShiftTab:B.useCallback(()=>v(!0),[]),onFocusableItemAdd:B.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:B.useCallback(()=>C(e=>e-1),[]),children:(0,V.jsx)(ib.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:Y(e.onMouseDown,()=>{x.current=!0}),onFocus:Y(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(Sw,Cw);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);Vw([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:Y(e.onBlur,()=>v(!1))})})},`RovingFocusGroupImpl`)),Iw=`RovingFocusGroupItem`,Lw=B.forwardRef(xw(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=xx(),l=a||c,u=Nw(Iw,n),d=u.currentTabStopId===l,f=Ew(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=yw();return Sy(()=>{if(g&&r)return p(),()=>m()},[g,r,p,m]),B.useEffect(()=>{if(!g&&r)return p(),()=>m()},[g,r,p,m]),(0,V.jsx)(Tw.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,V.jsx)(ib.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:Y(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:Y(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:Y(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Bw(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Hw(n,r+1):n.slice(r+1)}setTimeout(()=>Vw(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),Rw={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function zw(e,t){return t===jw.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}xw(zw,`getDirectionAwareKey`);function Bw(e,t,n){let r=zw(e.key,n);if(!(t===Aw.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===Aw.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return Rw[r]}xw(Bw,`getFocusIntent`);function Vw(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}xw(Vw,`focusFirst`);function Hw(e,t){return e.map((n,r)=>e[(t+r)%e.length])}xw(Hw,`wrapArray`);var Uw=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Ww=new WeakMap,Gw=new WeakMap,Kw={},qw=0,Jw=function(e){return e&&(e.host||Jw(e.parentNode))},Yw=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Jw(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Xw=function(e,t,n,r){var i=Yw(t,Array.isArray(e)?e:[e]);Kw[n]||(Kw[n]=new WeakMap);var a=Kw[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Ww.get(e)||0)+1,l=(a.get(e)||0)+1;Ww.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Gw.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),qw++,function(){o.forEach(function(e){var t=Ww.get(e)-1,i=a.get(e)-1;Ww.set(e,t),a.set(e,i),t||(Gw.has(e)||e.removeAttribute(r),Gw.delete(e)),i||e.removeAttribute(n)}),qw--,qw||(Ww=new WeakMap,Ww=new WeakMap,Gw=new WeakMap,Kw={})}},Zw=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Uw(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Xw(r,i,n,`aria-hidden`)):function(){return null}},Qw=function(){return Qw=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Qw.apply(this,arguments)};function $w(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function eT(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var tT=`right-scroll-bar-position`,nT=`width-before-scroll-bar`,rT=`with-scroll-bars-hidden`,iT=`--removed-body-scroll-bar-size`;function aT(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function oT(e,t){var n=(0,B.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var sT=typeof window<`u`?B.useLayoutEffect:B.useEffect,cT=new WeakMap;function lT(e,t){var n=oT(t||null,function(t){return e.forEach(function(e){return aT(e,t)})});return sT(function(){var t=cT.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||aT(e,null)}),i.forEach(function(e){r.has(e)||aT(e,a)})}cT.set(n,e)},[e]),n}function uT(e){return e}function dT(e,t){t===void 0&&(t=uT);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function fT(e){e===void 0&&(e={});var t=dT(null);return t.options=Qw({async:!0,ssr:!1},e),t}var pT=function(e){var t=e.sideCar,n=$w(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return B.createElement(r,Qw({},n))};pT.isSideCarExport=!0;function mT(e,t){return e.useMedium(t),pT}var hT=fT(),gT=function(){},_T=B.forwardRef(function(e,t){var n=B.useRef(null),r=B.useState({onScrollCapture:gT,onWheelCapture:gT,onTouchMoveCapture:gT}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=$w(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=lT([n,t]),C=Qw(Qw({},b),i);return B.createElement(B.Fragment,null,u&&B.createElement(x,{sideCar:hT,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?B.cloneElement(B.Children.only(s),Qw(Qw({},C),{ref:S})):B.createElement(v,Qw({},C,{className:c,ref:S}),s))});_T.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},_T.classNames={fullWidth:nT,zeroRight:tT};var vT=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function yT(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=vT();return t&&e.setAttribute(`nonce`,t),e}function bT(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function xT(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var ST=function(){var e=0,t=null;return{add:function(n){e==0&&(t=yT())&&(bT(t,n),xT(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},CT=function(){var e=ST();return function(t,n){B.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},wT=function(){var e=CT();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},TT={left:0,top:0,right:0,gap:0},ET=function(e){return parseInt(e||``,10)||0},DT=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[ET(n),ET(r),ET(i)]},OT=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return TT;var t=DT(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},kT=wT(),AT=`data-scroll-locked`,jT=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
2
|
+
.${rT} {
|
|
3
|
+
overflow: hidden ${r};
|
|
4
|
+
padding-right: ${s}px ${r};
|
|
5
|
+
}
|
|
6
|
+
body[${AT}] {
|
|
7
|
+
overflow: hidden ${r};
|
|
8
|
+
overscroll-behavior: contain;
|
|
9
|
+
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
10
|
+
padding-left: ${i}px;
|
|
11
|
+
padding-top: ${a}px;
|
|
12
|
+
padding-right: ${o}px;
|
|
13
|
+
margin-left:0;
|
|
14
|
+
margin-top:0;
|
|
15
|
+
margin-right: ${s}px ${r};
|
|
16
|
+
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.${tT} {
|
|
20
|
+
right: ${s}px ${r};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.${nT} {
|
|
24
|
+
margin-right: ${s}px ${r};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.${tT} .${tT} {
|
|
28
|
+
right: 0 ${r};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.${nT} .${nT} {
|
|
32
|
+
margin-right: 0 ${r};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
body[${AT}] {
|
|
36
|
+
${iT}: ${s}px;
|
|
37
|
+
}
|
|
38
|
+
`},MT=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},NT=function(){B.useEffect(function(){return document.body.setAttribute(AT,(MT()+1).toString()),function(){var e=MT()-1;e<=0?document.body.removeAttribute(AT):document.body.setAttribute(AT,e.toString())}},[])},PT=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;NT();var a=B.useMemo(function(){return OT(i)},[i]);return B.createElement(kT,{styles:jT(a,!t,i,n?``:`!important`)})},FT=!1;if(typeof window<`u`)try{var IT=Object.defineProperty({},"passive",{get:function(){return FT=!0,!0}});window.addEventListener(`test`,IT,IT),window.removeEventListener(`test`,IT,IT)}catch{FT=!1}var LT=FT?{passive:!1}:!1,RT=function(e){return e.tagName===`TEXTAREA`},zT=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!RT(e)&&n[t]===`visible`)},BT=function(e){return zT(e,`overflowY`)},VT=function(e){return zT(e,`overflowX`)},HT=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),GT(e,r)){var i=KT(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},UT=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},WT=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},GT=function(e,t){return e===`v`?BT(t):VT(t)},KT=function(e,t){return e===`v`?UT(t):WT(t)},qT=function(e,t){return e===`h`&&t===`rtl`?-1:1},JT=function(e,t,n,r,i){var a=qT(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=KT(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&>(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},YT=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},XT=function(e){return[e.deltaX,e.deltaY]},ZT=function(e){return e&&`current`in e?e.current:e},QT=function(e,t){return e[0]===t[0]&&e[1]===t[1]},$T=function(e){return`
|
|
39
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
40
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
41
|
+
`},eE=0,tE=[];function nE(e){var t=B.useRef([]),n=B.useRef([0,0]),r=B.useRef(),i=B.useState(eE++)[0],a=B.useState(wT)[0],o=B.useRef(e);B.useEffect(function(){o.current=e},[e]),B.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=eT([e.lockRef.current],(e.shards||[]).map(ZT),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=B.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=YT(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=HT(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=HT(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return JT(h,t,e,h===`h`?s:c,!0)},[]),c=B.useCallback(function(e){var n=e;if(tE.length&&tE[tE.length-1]===a){var r=`deltaY`in n?XT(n):YT(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&QT(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(ZT).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=B.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:rE(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=B.useCallback(function(e){n.current=YT(e),r.current=void 0},[]),d=B.useCallback(function(t){l(t.type,XT(t),t.target,s(t,e.lockRef.current))},[]),f=B.useCallback(function(t){l(t.type,YT(t),t.target,s(t,e.lockRef.current))},[]);B.useEffect(function(){return tE.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,LT),document.addEventListener(`touchmove`,c,LT),document.addEventListener(`touchstart`,u,LT),function(){tE=tE.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,LT),document.removeEventListener(`touchmove`,c,LT),document.removeEventListener(`touchstart`,u,LT)}},[]);var p=e.removeScrollBar,m=e.inert;return B.createElement(B.Fragment,null,m?B.createElement(a,{styles:$T(i)}):null,p?B.createElement(PT,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function rE(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var iE=mT(hT,nE),aE=B.forwardRef(function(e,t){return B.createElement(_T,Qw({},e,{ref:t,sideCar:iE}))});aE.classNames=_T.classNames;var oE=Object.defineProperty,sE=(e,t)=>oE(e,`name`,{value:t,configurable:!0}),cE=[`Enter`,` `],lE=[`ArrowDown`,`PageUp`,`Home`],uE=[`ArrowUp`,`PageDown`,`End`],dE=[...lE,...uE];[...cE],[...cE];var fE=`Menu`,[pE,mE,hE]=cb(fE),[gE,_E]=by(fE,[hE,HC,kw]),vE=HC(),yE=kw(),[bE,xE]=gE(fE),[SE,CE]=gE(fE),wE=sE(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=vE(t),[c,l]=B.useState(null),u=B.useRef(!1),d=Ob(a),f=wb(i);return B.useEffect(()=>{let e=sE(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=sE(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),B.useEffect(()=>{if(!n)return;let e=sE(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,V.jsx)(GC,{...s,children:(0,V.jsx)(bE,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,V.jsx)(SE,{scope:t,onClose:B.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),TE=B.forwardRef(sE(function(e,t){let{__scopeMenu:n,...r}=e,i=vE(n);return(0,V.jsx)(qC,{...i,...r,ref:t})},`MenuAnchor`)),EE=`MenuPortal`,[DE,OE]=gE(EE,{forceMount:void 0}),kE=sE(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=xE(EE,t);return(0,V.jsx)(DE,{scope:t,forceMount:n,children:(0,V.jsx)(ow,{present:n||a.open,children:(0,V.jsx)(nw,{asChild:!0,container:i,children:r})})})},`MenuPortal`),AE=`MenuContent`,[jE,ME]=gE(AE),NE=B.forwardRef(sE(function(e,t){let n=OE(AE,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=xE(AE,e.__scopeMenu),o=CE(AE,e.__scopeMenu);return(0,V.jsx)(pE.Provider,{scope:e.__scopeMenu,children:(0,V.jsx)(ow,{present:r||a.open,children:(0,V.jsx)(pE.Slot,{scope:e.__scopeMenu,children:o.modal?(0,V.jsx)(PE,{...i,ref:t}):(0,V.jsx)(FE,{...i,ref:t})})})})},`MenuContent`)),PE=B.forwardRef(sE(function(e,t){let n=xE(AE,e.__scopeMenu),r=B.useRef(null),i=gy(t,r);return B.useEffect(()=>{let e=r.current;if(e)return Zw(e)},[]),(0,V.jsx)(LE,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Y(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),FE=B.forwardRef(sE(function(e,t){let n=xE(AE,e.__scopeMenu);return(0,V.jsx)(LE,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),IE=Vy(`MenuContent.ScrollLock`),LE=B.forwardRef(sE(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=xE(AE,n),_=CE(AE,n),v=vE(n),y=yE(n),b=mE(n),[x,S]=B.useState(null),C=B.useRef(null),[w,T]=B.useState(null);ax(w);let{nodes:E,registry:D}=ix(),O=!!(i||m),k=gy(t,C,g.onContentChange,T),A=B.useRef(0),ee=B.useRef(``),j=B.useRef(0),M=B.useRef(null),te=B.useRef(`right`),N=B.useRef(0),P=B.useMemo(()=>m?[C,...E.map(e=>({current:e}))]:[],[C,E,m]),ne=m?aE:B.Fragment,re=m?{as:IE,allowPinchZoom:!0,shards:P}:void 0,ie=sE(e=>{let t=ee.current+e,n=b().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=eD(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;function s(e){ee.current=e,window.clearTimeout(A.current),e!==``&&(A.current=window.setTimeout(()=>s(``),1e3))}sE(s,`updateSearch`),s(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);B.useEffect(()=>()=>window.clearTimeout(A.current),[]),Jb();let ae=B.useCallback(e=>te.current===M.current?.side&&nD(e,M.current?.area),[]);return(0,V.jsx)(jE,{scope:n,searchRef:ee,onItemEnter:B.useCallback(e=>{ae(e)&&e.preventDefault()},[ae]),onItemLeave:B.useCallback(e=>{ae(e)||(C.current?.focus(),S(null))},[ae]),onTriggerLeave:B.useCallback(e=>{ae(e)&&e.preventDefault()},[ae]),pointerGraceTimerRef:j,onPointerGraceIntentChange:B.useCallback(e=>{M.current=e},[]),children:(0,V.jsx)(rx,{registry:O?D:null,children:(0,V.jsx)(ne,{...re,children:(0,V.jsx)(tx,{asChild:!0,trapped:i,branches:E,onMountAutoFocus:Y(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,V.jsx)(Ib,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,V.jsx)(Pw,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:Y(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,V.jsx)(ZC,{role:`menu`,"aria-orientation":`vertical`,"data-state":YE(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:k,style:{outline:`none`,...h.style},onKeyDown:Y(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&ie(e.key));let i=C.current;if(e.target!==i||!dE.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);uE.includes(e.key)&&a.reverse(),QE(a)}),onBlur:Y(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(A.current),ee.current=``)}),onPointerMove:Y(e.onPointerMove,rD(e=>{let t=e.target,n=N.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>N.current?`right`:`left`;te.current=t,N.current=e.clientX}}))})})})})})})})},`MenuContentImpl`)),RE=`MenuItem`,zE=`menu.itemSelect`,BE=B.forwardRef(sE(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=B.useRef(null),o=CE(RE,e.__scopeMenu),s=ME(RE,e.__scopeMenu),c=gy(t,a),l=B.useRef(!1),u=sE(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(zE,{bubbles:!0,cancelable:!0});e.addEventListener(zE,e=>r?.(e),{once:!0}),ab(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,V.jsx)(VE,{...i,ref:c,disabled:n,onClick:Y(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:Y(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:Y(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&cE.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),VE=B.forwardRef(sE(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=ME(RE,n),s=yE(n),c=B.useRef(null),l=gy(t,c),[u,d]=B.useState(!1),[f,p]=B.useState(``);return B.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,V.jsx)(pE.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,V.jsx)(Lw,{asChild:!0,...s,focusable:!r,children:(0,V.jsx)(ib.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:Y(e.onPointerMove,rD(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Y(e.onPointerLeave,rD(e=>o.onItemLeave(e))),onFocus:Y(e.onFocus,()=>d(!0)),onBlur:Y(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),[HE,UE]=gE(`MenuRadioGroup`,{value:void 0,onValueChange:sE(()=>{},`onValueChange`)}),[WE,GE]=gE(`MenuItemIndicator`,{checked:!1}),KE=B.forwardRef(sE(function(e,t){let{__scopeMenu:n,...r}=e;return(0,V.jsx)(ib.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),[qE,JE]=gE(`MenuSub`);function YE(e){return e?`open`:`closed`}sE(YE,`getOpenState`);function XE(e){return e===`indeterminate`}sE(XE,`isIndeterminate`);function ZE(e){return XE(e)?`indeterminate`:e?`checked`:`unchecked`}sE(ZE,`getCheckedState`);function QE(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}sE(QE,`focusFirst`);function $E(e,t){return e.map((n,r)=>e[(t+r)%e.length])}sE($E,`wrapArray`);function eD(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=$E(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}sE(eD,`getNextMatch`);function tD(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}sE(tD,`isPointInPolygon`);function nD(e,t){return t?tD({x:e.clientX,y:e.clientY},t):!1}sE(nD,`isPointerInGraceArea`);function rD(e){return t=>t.pointerType===`mouse`?e(t):void 0}sE(rD,`whenMouse`);var iD=Object.defineProperty,aD=(e,t)=>iD(e,`name`,{value:t,configurable:!0}),oD=`DropdownMenu`,[sD,cD]=by(oD,[_E]),lD=_E(),[uD,dD]=sD(oD),fD=aD(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=lD(t),l=B.useRef(null),[u,d]=jy({prop:i,defaultProp:a??!1,onChange:o,caller:oD});return(0,V.jsx)(uD,{scope:t,triggerId:xx(),triggerRef:l,contentId:xx(),open:u,onOpenChange:d,onOpenToggle:B.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,V.jsx)(wE,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),pD=`DropdownMenuTrigger`,mD=B.forwardRef(aD(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=dD(pD,n),o=lD(n),s=gy(t,a.triggerRef);return(0,V.jsx)(TE,{asChild:!0,...o,children:(0,V.jsx)(ib.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:Y(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:Y(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),hD=aD(e=>{let{__scopeDropdownMenu:t,...n}=e,r=lD(t);return(0,V.jsx)(kE,{...r,...n})},`DropdownMenuPortal`),gD=`DropdownMenuContent`,_D=B.forwardRef(aD(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=dD(gD,n),a=lD(n),o=B.useRef(!1);return(0,V.jsx)(NE,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:Y(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:Y(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),vD=B.forwardRef(aD(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=lD(n);return(0,V.jsx)(BE,{...i,...r,ref:t})},`DropdownMenuItem`)),yD=B.forwardRef(aD(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=lD(n);return(0,V.jsx)(KE,{...i,...r,ref:t})},`DropdownMenuSeparator`)),bD=Object.defineProperty,xD=(e,t)=>bD(e,`name`,{value:t,configurable:!0}),SD={Automatic:`automatic`,Manual:`manual`},CD=`Tabs`,[wD,TD]=by(CD,[kw]),ED=kw(),[DD,OD]=wD(CD),kD=B.forwardRef(xD(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=SD.Automatic,...l}=e,u=wb(s),[d,f]=jy({prop:r,onChange:i,defaultProp:a??``,caller:CD});return(0,V.jsx)(DD,{scope:n,baseId:xx(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,V.jsx)(ib.div,{dir:u,"data-orientation":o,...l,ref:t})})},`Tabs`)),AD=`TabsList`,jD=B.forwardRef(xD(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=OD(AD,n),o=ED(n);return(0,V.jsx)(Pw,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,V.jsx)(ib.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})},`TabsList`)),MD=`TabsTrigger`,ND=B.forwardRef(xD(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=OD(MD,n),s=ED(n),c=ID(o.baseId,r),l=LD(o.baseId,r),u=r===o.value;return(0,V.jsx)(Lw,{asChild:!0,...s,focusable:!i,active:u,children:(0,V.jsx)(ib.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:Y(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?(e.currentTarget.focus(),o.onValueChange(r)):e.preventDefault()}),onKeyDown:Y(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:Y(e.onFocus,()=>{let e=o.activationMode!==SD.Manual;!u&&!i&&e&&o.onValueChange(r)})})})},`TabsTrigger`)),PD=`TabsContent`,FD=B.forwardRef(xD(function(e,t){let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=OD(PD,n),c=ID(s.baseId,r),l=LD(s.baseId,r),u=r===s.value,d=B.useRef(u);return B.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,V.jsx)(ow,{present:i||u,children:({present:n})=>(0,V.jsx)(ib.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})},`TabsContent`));function ID(e,t){return`${e}-trigger-${t}`}xD(ID,`makeTriggerId`);function LD(e,t){return`${e}-content-${t}`}xD(LD,`makeContentId`);var RD=Object.defineProperty,zD=(e,t)=>RD(e,`name`,{value:t,configurable:!0}),BD=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),VD=B.forwardRef(zD(function(e,t){return(0,V.jsx)(ib.span,{...e,ref:t,style:{...BD,...e.style}})},`VisuallyHidden`)),HD=Object.defineProperty,UD=(e,t)=>HD(e,`name`,{value:t,configurable:!0}),[WD,GD]=by(`Tooltip`,[HC]),KD=HC(),qD=`TooltipProvider`,JD=700,YD=`tooltip.open`,[XD,ZD]=WD(qD),QD=UD(e=>{let{__scopeTooltip:t,delayDuration:n=JD,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=B.useRef(!0),s=B.useRef(!1),c=B.useRef(0);return B.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,V.jsx)(XD,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:B.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:B.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:B.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),$D=`Tooltip`,[eO,tO]=WD($D),nO=UD(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=ZD($D,e.__scopeTooltip),l=KD(t),[u,d]=B.useState(null),[f,p]=B.useState(void 0),m=xx(),h=B.useRef(0),g=o??c.disableHoverableContent,_=s??c.delayDuration,v=B.useRef(!1),[y,b]=jy({prop:r,defaultProp:i??!1,onChange:UD(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(YD))):c.onClose(),a?.(e)},`onChange`),caller:$D}),x=B.useMemo(()=>y?v.current?`delayed-open`:`instant-open`:`closed`,[y]),S=B.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,b(!0)},[b]),C=B.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),w=B.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,b(!0),h.current=0},_)},[_,b]);B.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let T=f??m;return(0,V.jsx)(GC,{...l,children:(0,V.jsx)(eO,{scope:t,contentId:T,setContentId:p,open:y,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:B.useCallback(()=>{c.isOpenDelayedRef.current?w():S()},[c.isOpenDelayedRef,w,S]),onTriggerLeave:B.useCallback(()=>{g?C():(window.clearTimeout(h.current),h.current=0)},[C,g]),onOpen:S,onClose:C,disableHoverableContent:g,children:n})})},`Tooltip`),rO=`TooltipTrigger`,iO=B.forwardRef(UD(function(e,t){let{__scopeTooltip:n,"aria-describedby":r,...i}=e,a=tO(rO,n),o=ZD(rO,n),s=KD(n),c=gy(t,B.useRef(null),a.onTriggerChange),l=B.useRef(!1),u=B.useRef(!1),d=B.useCallback(()=>l.current=!1,[]);return B.useEffect(()=>()=>document.removeEventListener(`pointerup`,d),[d]),(0,V.jsx)(qC,{asChild:!0,...s,children:(0,V.jsx)(ib.button,{"aria-describedby":a.open?bO(r,a.contentId):r,"data-state":a.stateAttribute,...i,ref:c,onPointerMove:Y(e.onPointerMove,e=>{e.pointerType!==`touch`&&!u.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),u.current=!0)}),onPointerLeave:Y(e.onPointerLeave,()=>{a.onTriggerLeave(),u.current=!1}),onPointerDown:Y(e.onPointerDown,()=>{a.open&&a.onClose(),l.current=!0,document.addEventListener(`pointerup`,d,{once:!0})}),onFocus:Y(e.onFocus,()=>{l.current||a.onOpen()}),onBlur:Y(e.onBlur,a.onClose),onClick:Y(e.onClick,a.onClose)})})},`TooltipTrigger`)),aO=`TooltipPortal`,[oO,sO]=WD(aO,{forceMount:void 0}),cO=UD(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=tO(aO,t);return(0,V.jsx)(oO,{scope:t,forceMount:n,children:(0,V.jsx)(ow,{present:n||a.open,children:(0,V.jsx)(nw,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),lO=`TooltipContent`,uO=B.forwardRef(UD(function(e,t){let n=sO(lO,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=tO(lO,e.__scopeTooltip);return(0,V.jsx)(ow,{present:r||o.open,children:o.disableHoverableContent?(0,V.jsx)(pO,{side:i,...a,ref:t}):(0,V.jsx)(dO,{side:i,...a,ref:t})})},`TooltipContent`)),dO=B.forwardRef(UD(function(e,t){let n=tO(lO,e.__scopeTooltip),r=ZD(lO,e.__scopeTooltip),i=B.useRef(null),a=gy(t,i),[o,s]=B.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=B.useCallback(()=>{s(null),d(!1)},[d]),p=B.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=hO(r,mO(r,n.getBoundingClientRect())),a=gO(t.getBoundingClientRect()),o=vO([...i,...a]);s(o),d(!0)},[d]);return B.useEffect(()=>()=>f(),[f]),B.useEffect(()=>{if(c&&u){let e=UD(e=>p(e,u),`handleTriggerLeave`),t=UD(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),B.useEffect(()=>{if(o){let e=UD(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!_O(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,V.jsx)(pO,{...e,ref:a})},`TooltipContentHoverable`)),fO=Uy(`TooltipContent`),pO=B.forwardRef(UD(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=tO(lO,n),u=KD(n),{onClose:d}=l,[f,p]=B.useState(null),m=gy(t,p);ax(f),B.useEffect(()=>(document.addEventListener(YD,d),()=>document.removeEventListener(YD,d)),[d]),B.useEffect(()=>{if(l.trigger){let e=UD(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:h}=l;return Sy(()=>(h(a),()=>{h(void 0)}),[a,h]),(0,V.jsx)(Ib,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,V.jsxs)(ZC,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:m,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,V.jsx)(fO,{children:r}),i?(0,V.jsx)(VD,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`));function mO(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}UD(mO,`getExitSideFromRect`);function hO(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}UD(hO,`getPaddedExitPoints`);function gO(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}UD(gO,`getPointsFromRect`);function _O(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}UD(_O,`isPointInPolygon`);function vO(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),yO(t)}UD(vO,`getHull`);function yO(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}UD(yO,`getHullPresorted`);function bO(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}UD(bO,`concatAriaDescribedby`);function xO({content:e,children:t,side:n=`top`}){return(0,V.jsxs)(nO,{delayDuration:250,children:[(0,V.jsx)(iO,{asChild:!0,children:t}),(0,V.jsx)(cO,{children:(0,V.jsx)(uO,{side:n,sideOffset:6,className:`z-50 rounded-lg bg-fg px-2.5 py-1.5 text-[12px] font-medium text-bg shadow-pop data-[state=delayed-open]:animate-[pop-in_140ms_cubic-bezier(0.16,1,0.3,1)]`,children:e})})]})}var SO=QD;function CO({value:e,onChange:t,options:n,size:r=`md`,className:i}){let a=(0,B.useId)();return(0,V.jsx)(`fieldset`,{className:z(`m-0 inline-flex min-w-0 items-center rounded-[10px] border border-border bg-surface-2 p-0.5`,r===`sm`?`h-7`:`h-9`,i),children:n.map(n=>{let i=n.value===e;return(0,V.jsxs)(`button`,{type:`button`,"aria-pressed":i,onClick:()=>t(n.value),className:z(`relative h-full cursor-pointer rounded-lg px-3 font-medium transition-colors duration-150`,r===`sm`?`text-[12px]`:`text-[13px]`,i?`text-fg`:`text-fg-3 hover:text-fg-2`),children:[i&&(0,V.jsx)(K.span,{layoutId:`segmented-${a}`,transition:Dv,className:`absolute inset-0 rounded-lg border border-border bg-surface shadow-card`}),(0,V.jsx)(`span`,{className:`relative`,children:n.label})]},n.value)})})}function wO({value:e,onChange:t,tabs:n,className:r}){let i=(0,B.useId)();return(0,V.jsx)(`div`,{role:`tablist`,className:z(`flex flex-wrap gap-x-3 border-b border-border sm:gap-x-5`,r),children:n.map(n=>{let r=n.value===e;return(0,V.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":r,onClick:()=>t(n.value),className:z(`relative flex h-10 shrink-0 cursor-pointer items-center gap-1.5 whitespace-nowrap text-[13.5px] font-medium transition-colors`,r?`text-fg`:`text-fg-3 hover:text-fg-2`),children:[n.label,r&&(0,V.jsx)(K.span,{layoutId:`page-tab-${i}`,transition:Dv,className:`absolute inset-x-0 -bottom-px h-[2px] rounded-full bg-accent`})]},n.value)})})}function TO({value:e,onChange:t,tabs:n,children:r,className:i}){let a=(0,B.useId)();return(0,V.jsxs)(kD,{value:e,onValueChange:e=>t(e),className:i,children:[(0,V.jsx)(jD,{className:`flex gap-1 border-b border-border px-6`,children:n.map(t=>(0,V.jsxs)(ND,{value:t.value,className:z(`relative -mb-px flex h-10 cursor-pointer items-center gap-1.5 px-2 text-[13px] font-medium transition-colors outline-none`,t.value===e?`text-fg`:`text-fg-3 hover:text-fg-2`),children:[t.label,t.count!==void 0&&(0,V.jsx)(`span`,{className:`rounded-full bg-surface-2 px-1.5 text-[11px] text-fg-3 tabular`,children:t.count}),t.value===e&&(0,V.jsx)(K.span,{layoutId:`tab-${a}`,transition:Dv,className:`absolute inset-x-1 bottom-0 h-[2px] rounded-full bg-accent`})]},t.value))}),r]})}var EO=FD;function DO({trigger:e,children:t,align:n=`end`}){return(0,V.jsxs)(fD,{children:[(0,V.jsx)(mD,{asChild:!0,children:e}),(0,V.jsx)(hD,{children:(0,V.jsx)(_D,{align:n,sideOffset:6,className:`z-50 min-w-44 rounded-xl border border-border bg-surface p-1 shadow-pop data-[state=open]:animate-[pop-in_150ms_cubic-bezier(0.16,1,0.3,1)]`,children:t})})]})}function OO({icon:e,children:t,onSelect:n,danger:r=!1,disabled:i=!1}){return(0,V.jsxs)(vD,{disabled:i,onSelect:n,className:z(`flex h-8 cursor-pointer items-center gap-2 rounded-lg px-2.5 text-[13px] outline-none select-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 [&>svg]:size-3.5`,r?`text-danger data-[highlighted]:bg-danger-soft`:`text-fg-2 data-[highlighted]:bg-surface-2 data-[highlighted]:text-fg`),children:[e,t]})}var kO=()=>(0,V.jsx)(yD,{className:`my-1 h-px bg-border`});function AO({value:e,format:t,className:n}){let r=z_(0),i=H_(r,e=>t?t(e):Math.round(e).toLocaleString(`zh-CN`));return(0,B.useEffect)(()=>{let t=Tv(r,e,{...Ov,stiffness:120,damping:24});return()=>t.stop()},[r,e]),(0,V.jsx)(K.span,{className:z(`tabular`,n),children:i})}function jO({children:e}){return(0,V.jsx)(Mg,{reducedMotion:`user`,children:(0,V.jsx)(SO,{children:e})})}var MO={primary:`bg-accent text-accent-fg shadow-[0_1px_2px_rgb(0_0_0/0.12),inset_0_1px_0_rgb(255_255_255/0.16)] hover:bg-accent-hover`,secondary:`bg-surface text-fg border border-border shadow-card hover:bg-surface-2 hover:border-border-strong`,ghost:`text-fg-2 hover:text-fg hover:bg-surface-2`,soft:`bg-accent-soft text-accent-soft-fg hover:brightness-[0.97] dark:hover:brightness-125`,danger:`bg-danger text-white shadow-[0_1px_2px_rgb(0_0_0/0.12)] hover:brightness-105`,"danger-ghost":`text-danger hover:bg-danger-soft`},NO={sm:`h-7 gap-1.5 rounded-lg px-2.5 text-[12.5px]/[18px]`,md:`h-9 gap-2 rounded-[10px] px-3.5 text-[13.5px]`,lg:`h-10 gap-2 rounded-xl px-4 text-sm`,icon:`size-8 rounded-lg`,"icon-sm":`size-7 rounded-md`},X=(0,B.forwardRef)(function({variant:e=`secondary`,size:t=`md`,loading:n=!1,disabled:r,className:i,children:a,...o},s){return(0,V.jsxs)(K.button,{ref:s,whileTap:r||n?void 0:{scale:.97},transition:Ov,disabled:r||n,className:z(`relative inline-flex shrink-0 cursor-pointer select-none items-center justify-center font-medium whitespace-nowrap`,`transition-[background-color,border-color,color,filter,box-shadow] duration-150`,`disabled:cursor-not-allowed disabled:opacity-50`,MO[e],NO[t],i),...o,children:[(0,V.jsx)(`span`,{className:z(`inline-flex items-center gap-[inherit]`,n&&`opacity-0`),children:a}),n&&(0,V.jsx)(`span`,{className:`absolute inset-0 flex items-center justify-center`,children:(0,V.jsx)(Rv,{className:`size-4`})})]})}),PO=`w-full rounded-[10px] border border-border bg-surface text-[13.5px] text-fg placeholder:text-fg-3 shadow-[inset_0_1px_1px_rgb(0_0_0/0.02)] transition-[border-color,box-shadow] duration-150 outline-none hover:border-border-strong focus:border-accent focus:shadow-[0_0_0_3px_var(--ring)] disabled:cursor-not-allowed disabled:opacity-60 aria-[invalid=true]:border-danger aria-[invalid=true]:focus:shadow-[0_0_0_3px_var(--danger-soft)]`,FO=(0,B.forwardRef)(function({className:e,icon:t,...n},r){return t?(0,V.jsxs)(`div`,{className:z(`relative`,e),children:[(0,V.jsx)(`span`,{className:`pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 text-fg-3 [&>svg]:size-4`,children:t}),(0,V.jsx)(`input`,{ref:r,className:z(PO,`h-9 pr-3 pl-9`),...n})]}):(0,V.jsx)(`input`,{ref:r,className:z(PO,`h-9 px-3`,e),...n})}),IO=(0,B.forwardRef)(function({className:e,...t},n){return(0,V.jsx)(`textarea`,{ref:n,className:z(PO,`min-h-20 resize-y px-3 py-2 leading-relaxed`,e),...t})});function LO({label:e,hint:t,error:n,required:r,htmlFor:i,children:a,className:o}){return(0,V.jsxs)(`div`,{className:z(`space-y-1.5`,o),children:[(0,V.jsxs)(`label`,{htmlFor:i,className:`flex items-center gap-1 text-[12.5px] font-medium text-fg-2`,children:[e,r&&(0,V.jsx)(`span`,{className:`text-danger`,children:`*`})]}),a,n?(0,V.jsx)(`p`,{className:`text-[12px] text-danger`,children:n}):t&&(0,V.jsx)(`p`,{className:`text-[12px] leading-relaxed text-fg-3`,children:t})]})}var RO=Object.defineProperty,zO=(e,t)=>RO(e,`name`,{value:t,configurable:!0});function BO(e,[t,n]){return Math.min(n,Math.max(t,e))}zO(BO,`clamp`);var VO=Object.defineProperty,HO=(e,t)=>VO(e,`name`,{value:t,configurable:!0}),UO={ItemAligned:`item-aligned`,Popper:`popper`},WO={LTR:`ltr`,RTL:`rtl`},GO=[` `,`Enter`,`ArrowUp`,`ArrowDown`],KO=[` `,`Enter`],qO=`Select`,[JO,YO,XO]=cb(qO),[ZO,QO]=by(qO,[XO,HC]),$O=HC(),[ek,tk]=ZO(qO),[nk,rk]=ZO(qO);function ik(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m,internal_do_not_use_render:h}=e,g=$O(t),[_,v]=B.useState(null),[y,b]=B.useState(null),[x,S]=B.useState(!1),C=wb(l),[w,T]=jy({prop:r,defaultProp:i??!1,onChange:a,caller:qO}),[E,D]=jy({prop:o,defaultProp:s,onChange:c,caller:qO}),O=B.useRef(null),k=B.useRef(!1),[A,ee]=B.useState(null),j=HO(e=>{ee({value:e,hasConsumerStoppedPropagation:k.current}),D(e)},`handleUserSelect`),M=B.useRef(E);B.useEffect(()=>{let e=m?_?.ownerDocument.getElementById(m):_?.form;if(e instanceof HTMLFormElement){let t=HO(()=>D(M.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[m,_,D]);let te=!_||!!m||!!_.closest(`form`),[N,P]=B.useState(new Set),ne=xx(),re=Array.from(N).map(e=>e.props.value).join(`;`),ie=B.useCallback(e=>{P(t=>new Set(t).add(e))},[]),ae=B.useCallback(e=>{P(t=>{let n=new Set(t);return n.delete(e),n})},[]),oe={required:p,trigger:_,onTriggerChange:v,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:x,onValueNodeHasChildrenChange:S,contentId:ne,value:E,onValueChange:D,hasConsumerStoppedPropagationRef:k,userSelection:A,onUserSelect:j,open:w,onOpenChange:T,dir:C,triggerPointerDownPosRef:O,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:N,nativeSelectKey:re,isFormControl:te};return(0,V.jsx)(GC,{...g,children:(0,V.jsx)(ek,{scope:t,...oe,children:(0,V.jsx)(JO.Provider,{scope:t,children:(0,V.jsx)(nk,{scope:t,onNativeOptionAdd:ie,onNativeOptionRemove:ae,children:Gk(h)?h(oe):n})})})})}HO(ik,`SelectProvider`);var ak=HO(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,V.jsx)(ik,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,V.jsxs)(V.Fragment,{children:[n,e?(0,V.jsx)(Wk,{__scopeSelect:t}):null]})})},`Select`),ok=`SelectTrigger`,sk=B.forwardRef(HO(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=$O(n),o=tk(ok,n),s=o.disabled||r,c=gy(t,o.onTriggerChange),l=YO(n),u=B.useRef(`touch`),[d,f,p]=qk(e=>{let t=l().filter(e=>!e.disabled),n=Jk(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onUserSelect(n.value)}),m=HO(e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,V.jsx)(qC,{asChild:!0,...a,children:(0,V.jsx)(ib.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":Kk(o.value)?``:void 0,...i,ref:c,onClick:Y(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:Y(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:Y(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&(o.hasConsumerStoppedPropagationRef.current=e.isPropagationStopped(),f(e.key)),t&&e.key===` `||GO.includes(e.key)&&(m(),e.preventDefault())})})})},`SelectTrigger`)),ck=`SelectValue`,lk=B.forwardRef(HO(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=tk(ck,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=gy(t,c.onValueNodeChange);Sy(()=>{l(u)},[l,u]);let f=Kk(c.value);return(0,V.jsx)(ib.span,{...s,asChild:!f&&s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,V.jsx)(B.Fragment,{children:f?o:a},f?`placeholder`:`value`)})},`SelectValue`)),uk=B.forwardRef(HO(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,V.jsx)(ib.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[dk,fk]=ZO(`SelectPortal`,{forceMount:void 0}),pk=HO(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,V.jsx)(dk,{scope:e.__scopeSelect,forceMount:n,children:(0,V.jsx)(nw,{asChild:!0,...r})})},`SelectPortal`),mk=`SelectContent`,hk=B.forwardRef(HO(function(e,t){let n=fk(mk,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=tk(mk,e.__scopeSelect),[o,s]=B.useState();return Sy(()=>{s(new DocumentFragment)},[]),(0,V.jsx)(ow,{present:r||a.open,children:({present:e})=>e?(0,V.jsx)(xk,{...i,ref:t}):(0,V.jsx)(gk,{...i,fragment:o})})},`SelectContent`)),gk=B.forwardRef(HO(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?Ry.createPortal((0,V.jsx)(vk,{scope:n,children:(0,V.jsx)(JO.Slot,{scope:n,children:(0,V.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),_k=10,[vk,yk]=ZO(mk),bk=Vy(`SelectContent.RemoveScroll`),xk=B.forwardRef(HO(function(e,t){let{__scopeSelect:n}=e,{position:r=UO.ItemAligned,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=tk(mk,n),[y,b]=B.useState(null),[x,S]=B.useState(null),C=gy(t,b),[w,T]=B.useState(null),[E,D]=B.useState(null),O=YO(n),[k,A]=B.useState(!1),ee=B.useRef(!1),j=B.useRef(!1),M=B.useRef(!1);B.useEffect(()=>{if(y)return Zw(y)},[y]),Jb();let te=B.useCallback(e=>{let[t,...n]=O().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&x&&(x.scrollTop=0),n===r&&x&&(x.scrollTop=x.scrollHeight),n?.focus(),document.activeElement!==i))return},[O,x]),N=B.useCallback(()=>te([w,y]),[te,w,y]);B.useEffect(()=>{k&&N()},[k,N]);let{onOpenChange:P,triggerPointerDownPosRef:ne}=v;B.useEffect(()=>{if(y){let e={x:0,y:0},t=HO(t=>{e={x:Math.abs(Math.round(t.pageX)-(ne.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(ne.current?.y??0))}},`handlePointerMove`),n=HO(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(y)||P(!1),document.removeEventListener(`pointermove`,t),ne.current=null},`handlePointerUp`);return ne.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[y,P,ne]),B.useEffect(()=>{let e=HO(()=>P(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[P]);let[re,ie]=qk(e=>{let t=O().filter(e=>!e.disabled),n=Jk(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),ae=B.useCallback((e,t,n)=>{let r=!j.current;r&&(j.current=!0);let i=!ee.current&&!n;v.value!==void 0&&v.value===t||i?(T(e),i&&(ee.current=!0)):r&&T(e)},[v.value]),oe=B.useCallback(()=>y?.focus(),[y]),se=B.useCallback((e,t,n)=>{if(!e)return;let r=!M.current;r&&(M.current=!0);let i=!ee.current&&!n;(v.value!==void 0&&v.value===t||i||r)&&D(e)},[v.value]),ce=r===UO.Popper?Ck:Sk,le=ce===Ck?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,V.jsx)(vk,{scope:n,content:y,viewport:x,onViewportChange:S,itemRefCallback:ae,selectedItem:w,onItemLeave:oe,itemTextRefCallback:se,focusSelectedItem:N,selectedItemText:E,position:r,isPositioned:k,searchRef:re,children:(0,V.jsx)(aE,{as:bk,allowPinchZoom:!0,children:(0,V.jsx)(tx,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Y(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,V.jsx)(Ib,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,V.jsx)(ce,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...le,onPlaced:()=>A(!0),ref:C,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:Y(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ie(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=O().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>te(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),Sk=B.forwardRef(HO(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=tk(mk,n),o=yk(mk,n),[s,c]=B.useState(null),[l,u]=B.useState(null),d=gy(t,u),f=YO(n),p=B.useRef(!1),m=B.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=B.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==WO.RTL){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-_k,d=BO(a,[_k,Math.max(_k,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-_k,d=BO(a,[_k,Math.max(_k,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-_k*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-_k,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+v+k,ee=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+ee;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${_k}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);Sy(()=>y(),[y]);let[b,x]=B.useState();Sy(()=>{l&&x(window.getComputedStyle(l).zIndex)},[l]);let S=B.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]);return(0,V.jsx)(wk,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:S,children:(0,V.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:b},children:(0,V.jsx)(ib.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),Ck=B.forwardRef(HO(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=_k,...a}=e,o=$O(n);return(0,V.jsx)(ZC,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[wk,Tk]=ZO(mk,{}),Ek=`SelectViewport`,Dk=B.forwardRef(HO(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=yk(Ek,n),o=Tk(Ek,n),s=gy(t,a.onViewportChange),c=B.useRef(0);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,V.jsx)(JO.Slot,{scope:n,children:(0,V.jsx)(ib.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:Y(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-_k*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[Ok,kk]=ZO(`SelectGroup`),Ak=`SelectItem`,[jk,Mk]=ZO(Ak),Nk=B.forwardRef(HO(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=tk(Ak,n),c=yk(Ak,n),l=s.value===r,[u,d]=B.useState(a??``),[f,p]=B.useState(!1),m=gy(t,Ob(e=>c.itemRefCallback?.(e,r,i))),h=xx(),g=B.useRef(`touch`);function _(e){s.hasConsumerStoppedPropagationRef.current=e.isPropagationStopped(),s.onUserSelect(r),s.onOpenChange(!1)}return HO(_,`handleSelect`),(0,V.jsx)(jk,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:B.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,V.jsx)(JO.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,V.jsx)(ib.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:Y(o.onFocus,()=>p(!0)),onBlur:Y(o.onBlur,()=>p(!1)),onClick:Y(o.onClick,e=>{i||g.current!==`mouse`&&_(e)}),onPointerUp:Y(o.onPointerUp,e=>{i||g.current===`mouse`&&_(e)}),onPointerDown:Y(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:Y(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Y(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:Y(o.onKeyDown,e=>{i||e.target!==e.currentTarget||(c.searchRef?.current===``||e.key!==` `)&&(KO.includes(e.key)&&_(e),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),Pk=`SelectItemText`,Fk=B.forwardRef(HO(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=tk(Pk,n),s=yk(Pk,n),c=Mk(Pk,n),l=rk(Pk,n),[u,d]=B.useState(null),f=Ob(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=gy(t,d,c.onItemTextChange,f),m=u?.textContent,h=B.useMemo(()=>(0,V.jsx)(`option`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:_}=l;return Sy(()=>(g(h),()=>_(h)),[g,_,h]),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(ib.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!Kk(o.value)?Ry.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),Ik=`SelectItemIndicator`,Lk=B.forwardRef(HO(function(e,t){let{__scopeSelect:n,...r}=e;return Mk(Ik,n).isSelected?(0,V.jsx)(ib.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),Rk=`SelectScrollUpButton`,zk=B.forwardRef(HO(function(e,t){let n=yk(Rk,e.__scopeSelect),r=Tk(Rk,e.__scopeSelect),[i,a]=B.useState(!1),o=gy(t,r.onScrollButtonChange);return Sy(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)};HO(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,V.jsx)(Hk,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),Bk=`SelectScrollDownButton`,Vk=B.forwardRef(HO(function(e,t){let n=yk(Bk,e.__scopeSelect),r=Tk(Bk,e.__scopeSelect),[i,a]=B.useState(!1),o=gy(t,r.onScrollButtonChange);return Sy(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};HO(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,V.jsx)(Hk,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),Hk=B.forwardRef(HO(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=yk(`SelectScrollButton`,n),o=B.useRef(null),s=YO(n),c=B.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return B.useEffect(()=>()=>c(),[c]),Sy(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,V.jsx)(ib.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Y(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Y(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Y(i.onPointerLeave,()=>{c()})})},`SelectScrollButtonImpl`)),Uk=`SelectBubbleInput`,Wk=B.forwardRef(HO(function({__scopeSelect:e,...t},n){let r=tk(Uk,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u,userSelection:d}=r,{nativeOptions:f,nativeSelectKey:p}=r,m=B.useRef(null),h=gy(n,m),g=i??``,_=B.useRef(g),v=B.useRef(d),y=B.useRef(!1),b=Array.from(f).some(e=>(e.props.value??``)===``);return B.useEffect(()=>{let e=m.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set,r=d!==null&&d!==v.current;v.current=d;let i=_.current!==g;_.current=g;let a=r&&i;if(r&&!i&&d.value!==g&&!d.hasConsumerStoppedPropagation&&n){y.current=!0;try{n.call(e,d.value),e.dispatchEvent(new Event(`change`,{bubbles:!0}))}finally{y.current=!1,n.call(e,g)}return}let o=a&&!d.hasConsumerStoppedPropagation;if(i&&n){let t=new Event(`change`,{bubbles:o});n.call(e,g),e.dispatchEvent(t)}},[g,d]),(0,V.jsxs)(ib.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>{y.current||a(e.target.value)},...t,style:{...BD,...t.style},ref:h,defaultValue:g,children:[Kk(i)&&!b?(0,V.jsx)(`option`,{value:``}):null,Array.from(f)]},p)},`SelectBubbleInput`));function Gk(e){return typeof e==`function`}HO(Gk,`isFunction`);function Kk(e){return e===``||e===void 0}HO(Kk,`shouldShowPlaceholder`);function qk(e){let t=Ob(e),n=B.useRef(``),r=B.useRef(0),i=B.useCallback(e=>{let i=n.current+e;t(i);function a(e){n.current=e,window.clearTimeout(r.current),e!==``&&(r.current=window.setTimeout(()=>a(``),1e3))}HO(a,`updateSearch`),a(i)},[t]),a=B.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return B.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}HO(qk,`useTypeaheadSearch`);function Jk(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Yk(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}HO(Jk,`findNextItem`);function Yk(e,t){return e.map((n,r)=>e[(t+r)%e.length])}HO(Yk,`wrapArray`);var Xk=e=>`:${e}`;function Zk({id:e,value:t,onValueChange:n,options:r,placeholder:i,className:a,disabled:o,"aria-label":s,"aria-invalid":c}){return(0,V.jsxs)(ak,{disabled:o,value:t===void 0?``:Xk(t),onValueChange:e=>{let t=r.find(t=>Xk(t.value)===e);t&&n(t.value)},children:[(0,V.jsxs)(sk,{id:e,"aria-label":s,"aria-invalid":c,className:z(`group inline-flex h-9 min-w-0 max-w-full cursor-pointer items-center justify-between gap-2 rounded-[10px] border border-border bg-surface px-3 text-[13.5px] text-fg shadow-card outline-none transition-[border-color,box-shadow] hover:border-border-strong focus-visible:border-accent focus-visible:shadow-[0_0_0_3px_var(--ring)] data-[state=open]:border-accent data-[placeholder]:text-fg-3 disabled:cursor-not-allowed disabled:opacity-60 aria-[invalid=true]:border-danger`,a),children:[(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:(0,V.jsx)(lk,{placeholder:i})}),(0,V.jsx)(uk,{className:`shrink-0`,children:(0,V.jsx)(rn,{className:`size-3.5 text-fg-3 motion-safe:transition-transform group-data-[state=open]:rotate-180`})})]}),(0,V.jsx)(pk,{children:(0,V.jsxs)(hk,{position:`popper`,align:`start`,sideOffset:6,collisionPadding:8,className:`z-50 max-h-[min(18rem,var(--radix-select-content-available-height))] w-max min-w-[min(var(--radix-select-trigger-width),var(--radix-select-content-available-width))] max-w-[min(max(24rem,var(--radix-select-trigger-width)),var(--radix-select-content-available-width))] overflow-hidden rounded-xl border border-border bg-surface p-1 shadow-pop motion-safe:data-[state=open]:animate-[pop-in_160ms_cubic-bezier(0.16,1,0.3,1)]`,children:[(0,V.jsx)(zk,{className:`flex h-5 shrink-0 items-center justify-center text-fg-3`,children:(0,V.jsx)(un,{"aria-hidden":`true`,className:`size-3.5`})}),(0,V.jsx)(Dk,{className:`min-h-0`,children:r.map(e=>(0,V.jsxs)(Nk,{value:Xk(e.value),disabled:e.disabled,className:`relative flex min-h-8 cursor-pointer items-center rounded-md py-1.5 pr-8 pl-2.5 text-[13px] leading-snug wrap-anywhere text-fg-2 outline-none select-none data-[disabled]:cursor-not-allowed data-[disabled]:text-fg-3 data-[highlighted]:bg-accent-soft data-[highlighted]:text-accent-soft-fg data-[state=checked]:font-medium`,children:[(0,V.jsx)(Fk,{children:e.label}),(0,V.jsx)(Lk,{className:`absolute top-1/2 right-2.5 -translate-y-1/2`,children:(0,V.jsx)(tn,{className:`size-3.5 text-accent`,strokeWidth:2.5})})]},e.value))}),(0,V.jsx)(Vk,{className:`flex h-5 shrink-0 items-center justify-center text-fg-3`,children:(0,V.jsx)(rn,{"aria-hidden":`true`,className:`size-3.5`})})]})})]})}var Qk=Object.defineProperty,$k=(e,t)=>Qk(e,`name`,{value:t,configurable:!0}),eA=`Switch`,[tA,nA]=by(eA),[rA,iA]=tA(eA);function aA(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=jy({prop:n,defaultProp:i??!1,onChange:c,caller:eA}),[m,h]=B.useState(null),[g,_]=B.useState(null),[v,y]=B.useState(null),b={checked:f,setChecked:p,disabled:a,control:m,setControl:h,name:s,form:o,value:u,userClick:v,onUserClick:y,required:l,defaultChecked:i,isFormControl:!m||!!o||!!m.closest(`form`),bubbleInput:g,setBubbleInput:_};return(0,V.jsx)(rA,{scope:t,...b,children:pA(d)?d(b):r})}$k(aA,`SwitchProvider`);var oA=`SwitchTrigger`,sA=B.forwardRef($k(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,form:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,onUserClick:f,isFormControl:p,bubbleInput:m}=iA(oA,e),h=gy(r,u),g=B.useRef(c);return B.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=$k(()=>d(g.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,a,d]),(0,V.jsx)(ib.button,{type:`button`,role:`switch`,"aria-checked":c,"aria-required":l,"data-state":mA(c),"data-disabled":s?``:void 0,disabled:s,value:o,...n,ref:h,onClick:Y(t,e=>{let t=e.isPropagationStopped();f({requestedChecked:!c,hasConsumerStoppedPropagation:t}),d(e=>!e),m&&p&&(t||e.stopPropagation())})})},`SwitchTrigger`)),cA=B.forwardRef($k(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,V.jsx)(aA,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(sA,{...d,ref:t,__scopeSwitch:n}),e&&(0,V.jsx)(fA,{__scopeSwitch:n})]})})},`Switch`)),lA=`SwitchThumb`,uA=B.forwardRef($k(function(e,t){let{__scopeSwitch:n,...r}=e,i=iA(lA,n);return(0,V.jsx)(ib.span,{"data-state":mA(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})},`SwitchThumb`)),dA=`SwitchBubbleInput`,fA=B.forwardRef($k(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,userClick:a,checked:o,defaultChecked:s,required:c,disabled:l,name:u,value:d,form:f,bubbleInput:p,setBubbleInput:m}=iA(dA,e),h=gy(r,m),g=FC(i),_=B.useRef(!1),v=B.useRef(o),y=B.useRef(a),b=B.useRef(null);B.useEffect(()=>{let e=p;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set;if(!n)return;let r=v.current!==o;v.current=o;let i=a!==null&&a!==y.current;if(y.current=a,i)b.current=r?null:a,r&&n.call(e,o),e.dispatchEvent(new Event(`click`,{bubbles:!a.hasConsumerStoppedPropagation}));else if(r){let t=b.current;b.current=null;let r=t?.requestedChecked===o;_.current=!0,n.call(e,o),e.dispatchEvent(new Event(`click`,{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),_.current=!1}},[p,o,a]);let x=B.useRef(o);return(0,V.jsx)(ib.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:s??x.current,required:c,disabled:l,name:u,value:d,form:f,...n,tabIndex:-1,ref:h,onClick:Y(t,e=>{_.current&&e.stopPropagation()}),style:{...n.style,...g,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function pA(e){return typeof e==`function`}$k(pA,`isFunction`);function mA(e){return e?`checked`:`unchecked`}$k(mA,`getState`);function hA({id:e,checked:t,onCheckedChange:n,disabled:r,className:i,"aria-label":a}){return(0,V.jsx)(cA,{id:e,checked:t,onCheckedChange:n,disabled:r,"aria-label":a,className:z(`relative inline-flex h-[22px] w-[38px] shrink-0 cursor-pointer items-center rounded-full p-[2px] transition-colors duration-200`,`disabled:cursor-not-allowed disabled:opacity-50`,t?`bg-accent`:`bg-surface-3 shadow-[inset_0_0_0_1px_var(--border-strong)]`,i),children:(0,V.jsx)(uA,{asChild:!0,children:(0,V.jsx)(K.span,{layout:!0,transition:Ov,className:z(`block size-[18px] rounded-full bg-white shadow-[0_1px_3px_rgb(0_0_0/0.25),0_0_0_0.5px_rgb(0_0_0/0.04)]`,t?`ml-auto`:`ml-0`)})})})}var gA=new Set([`string`,`number`,`integer`,`boolean`]),_A=new Set([`accessToken`,`token`,`password`,`apiToken`,`appSecret`]);function vA(e){return Array.isArray(e.type)?e.type.find(e=>e!==`null`):e.type===void 0&&e.anyOf?.every(e=>gA.has(vA(e)??``))?`scalar`:e.type}function yA(e){if(e.oneOf?.length&&e.oneOf.every(e=>e.const!==void 0))return e.oneOf.map(e=>({value:e.const,label:e.title??String(e.const)}))}function bA(e){let t=vA(e);if(e.enum||e.const!==void 0||yA(e)||t===`scalar`||gA.has(t??``))return!0;if(t===`array`){let t=e.items?vA(e.items):void 0;return t===`object`?bA(e.items):t===`string`||t===`number`||t===`integer`}return t===`object`&&Object.values(e.properties??{}).every(bA)}function xA(e){if(e.const!==void 0)return e.const;if(e.default!==void 0)return e.default;if(vA(e)===`object`)return Object.fromEntries(Object.entries(e.properties??{}).map(([e,t])=>[e,xA(t)]))}function SA(e,t,n){if(t.length===0)return n;let[r,...i]=t;if(Array.isArray(e)){let t=[...e];return t[Number(r)]=SA(t[Number(r)],i,n),t}let a=e&&typeof e==`object`?e:{};return{...a,[r]:SA(a[r],i,n)}}function CA(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e.replace(/\[(\d+)\]/g,`.$1`),t]))}function wA(e){let t=e.default;if(t!==void 0&&t!==``&&typeof t!=`object`)return`默认 ${String(t)}`}function TA(e,t){return t.reduce((e,t)=>e&&typeof e==`object`?e[t]:void 0,e)}function EA({schema:e,value:t,issues:n,saving:r,onSubmit:i,resolveOptions:a,note:o=`保存后写回配置文件并重载插件`,submitLabel:s=`保存并重载`,submitWhenPristine:c=!1}){let l=(0,B.useMemo)(()=>CA(n),[n]),u=JSON.stringify(t??xA(e)),d=(0,B.useMemo)(()=>u===void 0?void 0:JSON.parse(u),[u]),f=(0,B.useMemo)(()=>bA(e),[e]),[p,m]=(0,B.useState)(d),[h,g]=(0,B.useState)(!f),[_,v]=(0,B.useState)(()=>JSON.stringify(d,null,2)),[y,b]=(0,B.useState)(null);(0,B.useEffect)(()=>{m(d),v(JSON.stringify(d,null,2))},[d]);let x=h?_!==JSON.stringify(d,null,2):JSON.stringify(p)!==JSON.stringify(d);return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`mb-4 flex items-center justify-between`,children:[(0,V.jsx)(`p`,{className:`text-[12.5px] text-fg-3`,children:o}),f&&(0,V.jsxs)(X,{variant:`ghost`,size:`sm`,onClick:()=>{if(!h)v(JSON.stringify(p,null,2));else try{m(JSON.parse(_)),b(null)}catch{b(`JSON 有误,无法切回表单`);return}g(!h)},children:[(0,V.jsx)(qt,{className:`size-3.5`}),h?`表单`:`JSON`]})]}),(0,V.jsx)(Tg,{mode:`wait`,initial:!1,children:h?(0,V.jsxs)(K.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},children:[(0,V.jsx)(IO,{value:_,onChange:e=>v(e.target.value),spellCheck:!1,className:`min-h-64 font-mono text-[12.5px]`,"aria-invalid":y!==null}),y&&(0,V.jsx)(`p`,{className:`mt-1.5 text-[12px] text-danger`,children:y}),Object.keys(l).length>0&&(0,V.jsx)(`ul`,{className:`mt-3 space-y-1 rounded-xl bg-danger-soft px-3 py-2.5 text-[12.5px] text-danger`,children:Object.entries(l).map(([e,t])=>(0,V.jsxs)(`li`,{children:[(0,V.jsx)(`span`,{className:`font-mono`,children:e||`(根)`}),`:`,t]},e))})]},`json`):(0,V.jsx)(K.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:`space-y-5`,children:(0,V.jsx)(DA,{schema:e,value:p,path:[],issues:l,resolveOptions:a,onChange:(e,t)=>m(n=>SA(n,e,t))})},`form`)}),(0,V.jsx)(Tg,{children:(x||c)&&(0,V.jsxs)(K.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:12},transition:q,className:`sticky bottom-0 mt-6 -mx-6 flex items-center justify-between gap-3 border-t border-border bg-surface/90 px-6 py-3 backdrop-blur`,children:[(0,V.jsx)(`span`,{className:`text-[12.5px] text-fg-3`,children:x?`有未保存的修改`:`填写完成后保存`}),(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsxs)(X,{variant:`ghost`,size:`sm`,onClick:()=>{m(d),v(JSON.stringify(d,null,2)),b(null)},children:[(0,V.jsx)(Qr,{className:`size-3.5`}),`还原`]}),(0,V.jsx)(X,{variant:`primary`,size:`sm`,loading:r,onClick:()=>{if(!h)return i(p);let e;try{e=JSON.parse(_)}catch{b(`不是合法的 JSON`);return}b(null),i(e)},children:s})]})]})})]})}function DA({schema:e,value:t,path:n,issues:r,resolveOptions:i,onChange:a}){let o=Object.entries(e.properties??{});return o.length===0?(0,V.jsx)(`p`,{className:`text-[13px] text-fg-3`,children:`这个插件没有可配置项。`}):(0,V.jsx)(V.Fragment,{children:o.map(([o,s])=>{let c=[...n,o],l=`field-${c.join(`-`)}`,u=s.title??o,d=e.required?.includes(o)&&s.default===void 0,f=r[c.join(`.`)],p=TA(t,[o]),m=vA(s);if(s.const!==void 0)return null;if(m===`array`&&s.items&&vA(s.items)===`object`){let e=s.items;return(0,V.jsx)(LO,{label:u,hint:s.description,error:f,htmlFor:l,children:(0,V.jsx)(AA,{schema:e,value:Array.isArray(p)?p:[],path:c,issues:r,resolveOptions:i,onChange:a})},o)}if(m===`object`&&!s.enum)return(0,V.jsxs)(`fieldset`,{className:`space-y-4 rounded-xl border border-border p-4`,children:[(0,V.jsx)(`legend`,{className:`px-1 text-[12.5px] font-medium text-fg-2`,children:u}),(0,V.jsx)(DA,{schema:s,value:p,path:c,issues:r,resolveOptions:i,onChange:a})]},o);if(m===`boolean`)return(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-4 rounded-xl border border-border px-4 py-3`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`label`,{htmlFor:l,className:`text-[13px] font-medium text-fg`,children:u}),s.description&&(0,V.jsx)(`p`,{className:`mt-0.5 text-[12px] text-fg-3`,children:s.description}),f&&(0,V.jsx)(`p`,{className:`mt-0.5 text-[12px] text-danger`,children:f})]}),(0,V.jsx)(hA,{"aria-label":u,checked:p===!0,onCheckedChange:e=>a(c,e)})]},o);let h=m===`string`?s[`x-asabot-options`]:void 0;return(0,V.jsx)(LO,{label:u,hint:s.description,error:f,required:d,htmlFor:l,children:h?.source===`plugins`&&i?(0,V.jsx)(OA,{id:l,value:typeof p==`string`&&p!==``?p:void 0,options:i(h),clearable:!d,invalid:!!f,onChange:e=>a(c,e)}):(0,V.jsx)(kA,{id:l,schema:s,value:p,secret:_A.has(o)||s.writeOnly===!0,invalid:!!f,onChange:e=>a(c,e)})},o)})})}function OA({id:e,value:t,options:n,clearable:r,invalid:i,onChange:a}){let o=n.state===`ready`,s=o?n.options:[],c=t!==void 0&&!s.some(e=>e.value===t);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Zk,{id:e,className:`w-full`,"aria-invalid":i,value:t,disabled:!o||!s.length&&!(r&&t!==void 0),placeholder:n.state===`loading`?`正在加载插件…`:n.state===`error`?`无法加载插件`:s.length?`选择插件`:`没有匹配的插件`,options:[...r&&o?[{value:``,label:n.emptyLabel??`不选择`}]:[],...c?[{value:t,label:o?`${t}(不可用)`:t,disabled:!0}]:[],...s],onValueChange:e=>a(e===``?void 0:e)}),n.state===`error`&&(0,V.jsxs)(`div`,{className:`mt-1 flex items-center gap-2 text-[12px] text-fg-3`,role:`status`,children:[`无法加载插件选项`,(0,V.jsx)(X,{size:`sm`,variant:`ghost`,onClick:n.retry,children:`重试`})]})]})}function kA({id:e,schema:t,value:n,secret:r=!1,invalid:i,onChange:a}){let o=vA(t);if(o===`scalar`){let r=t.anyOf?.some(e=>vA(e)===`number`||vA(e)===`integer`);return(0,V.jsx)(FO,{id:e,value:n===void 0?``:String(n),placeholder:wA(t),"aria-invalid":i,onChange:e=>{let t=e.target.value.trim();a(t===``?void 0:r&&/^-?\d+(?:\.\d+)?$/.test(t)?Number(t):t)},className:`font-mono`})}let s=yA(t);if(s)return(0,V.jsx)(Zk,{id:e,"aria-invalid":i,className:`w-full`,value:n===void 0?void 0:String(n),onValueChange:e=>a(s.find(t=>String(t.value)===e)?.value),options:s.map(e=>({value:String(e.value),label:e.label}))});if(t.enum)return(0,V.jsx)(Zk,{id:e,"aria-invalid":i,className:`w-full`,value:n===void 0?void 0:String(n),onValueChange:e=>a(t.enum?.find(t=>String(t)===e)),options:t.enum.map(e=>({value:String(e),label:String(e)}))});if(o===`number`||o===`integer`)return(0,V.jsx)(FO,{id:e,type:`number`,inputMode:o===`integer`?`numeric`:`decimal`,step:o===`integer`?1:`any`,min:t.minimum,max:t.maximum,value:typeof n==`number`?n:``,placeholder:wA(t),"aria-invalid":i,onChange:e=>a(e.target.value===``?void 0:Number(e.target.value)),className:`tabular`});if(o===`array`)return(0,V.jsx)(jA,{id:e,itemType:t.items?vA(t.items):`string`,value:Array.isArray(n)?n:[],onChange:a});let c=typeof n==`string`?n:``,l=r&&!c.startsWith("${");return(0,V.jsx)(FO,{id:e,type:l?`password`:`text`,autoComplete:r?`off`:void 0,value:c,placeholder:wA(t),"aria-invalid":i,onFocus:r?e=>e.target.select():void 0,onChange:e=>a(e.target.value),className:z(r&&`font-mono`)})}function AA({schema:e,value:t,path:n,issues:r,resolveOptions:i,onChange:a}){let[o,s]=(0,B.useState)(()=>t.map(rt)),c=t.map((e,t)=>o[t]??`item-${t}`);return(0,V.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,V.jsx)(Tg,{initial:!1,children:t.map((o,l)=>(0,V.jsxs)(K.div,{layout:!0,initial:{opacity:0,y:-6},animate:{opacity:1,y:0},exit:{opacity:0,scale:.97},transition:q,className:`rounded-xl border border-border bg-surface-2/40 p-4`,children:[(0,V.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,V.jsxs)(`span`,{className:`text-[12px] font-medium text-fg-3 tabular`,children:[`#`,l+1]}),(0,V.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":`删除第 ${l+1} 项`,onClick:()=>{s(c.filter((e,t)=>t!==l)),a(n,t.filter((e,t)=>t!==l))},children:(0,V.jsx)(Hi,{className:`size-3.5`})})]}),(0,V.jsx)(`div`,{className:`space-y-4`,children:(0,V.jsx)(DA,{schema:e,value:o,path:[...n,String(l)],issues:r,resolveOptions:i,onChange:a})})]},c[l]))}),(0,V.jsxs)(X,{variant:`secondary`,size:`sm`,onClick:()=>{s([...c,rt()]),a(n,[...t,xA(e)])},children:[(0,V.jsx)(Hr,{className:`size-3.5`}),`添加一项`]})]})}function jA({id:e,itemType:t,value:n,onChange:r}){let[i,a]=(0,B.useState)(``),o=t===`number`||t===`integer`,s=()=>{let e=i.trim();if(!e)return;let t=o?Number(e):e;o&&Number.isNaN(t)||(n.includes(t)||r([...n,t]),a(``))};return(0,V.jsx)(`div`,{className:`rounded-[10px] border border-border bg-surface p-1.5 transition-colors focus-within:border-accent focus-within:shadow-[0_0_0_3px_var(--ring)]`,children:(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,V.jsx)(Tg,{initial:!1,children:n.map((e,t)=>(0,V.jsxs)(K.span,{layout:!0,initial:{opacity:0,scale:.85},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.85},transition:q,className:`inline-flex h-7 items-center gap-1 rounded-lg bg-surface-2 pr-1 pl-2.5 font-mono text-[12.5px] text-fg`,children:[String(e),(0,V.jsx)(`button`,{type:`button`,"aria-label":`移除 ${String(e)}`,onClick:()=>r(n.filter((e,n)=>n!==t)),className:`flex size-5 cursor-pointer items-center justify-center rounded-md text-fg-3 hover:bg-surface-3 hover:text-fg`,children:(0,V.jsx)(ia,{className:`size-3`})})]},String(e)))}),(0,V.jsxs)(`div`,{className:`flex min-w-32 flex-1 items-center`,children:[(0,V.jsx)(`input`,{id:e,value:i,inputMode:o?`numeric`:void 0,placeholder:n.length===0?`输入后按回车添加`:``,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),s()):e.key===`Backspace`&&!i&&n.length>0&&r(n.slice(0,-1))},className:`h-7 flex-1 bg-transparent px-1.5 text-[13px] outline-none placeholder:text-fg-3`}),(0,V.jsx)(`button`,{type:`button`,"aria-label":`添加`,onClick:s,className:z(`flex size-7 cursor-pointer items-center justify-center rounded-md text-fg-3 hover:bg-surface-2 hover:text-fg`,!i&&`invisible`),children:(0,V.jsx)(Hr,{className:`size-3.5`})})]})]})})}var MA=`modulepreload`,NA=function(e){return`/`+e},PA={},FA=function(e){return e.pathname.endsWith(`.css`)},IA=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},LA=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=NA(t,n);let r=s(t),i=FA(r);return IA(PA,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:MA,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{let i=a=>{t.removeEventListener(`load`,i),t.removeEventListener(`error`,i),a.type===`error`?n(Error(`Unable to preload CSS for ${r}`)):e(a)};t.addEventListener(`load`,i),t.addEventListener(`error`,i)})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},RA=(0,B.lazy)(()=>LA(()=>import(`./markdown-HrgPSKyp.js`).then(e=>({default:e.Markdown})),[])),zA={bold:`font-semibold`,italic:`italic`,underline:`underline`,strike:`line-through`,code:`rounded bg-surface-3/70 px-1 font-mono text-[0.92em]`,spoiler:`rounded bg-fg-3/60 text-transparent transition-colors hover:bg-transparent hover:text-inherit`};function BA({children:e,icon:t}){return(0,V.jsxs)(`span`,{className:`mx-0.5 inline-flex items-center gap-1 rounded-md bg-surface-3/60 px-1.5 text-[0.92em] text-fg-2`,children:[t,e]})}function VA(e){let t=String(e.data.url??e.data.file??``);if(/^https?:\/\//i.test(t))return t;if(t.startsWith(`base64://`)&&!/\[\d+ bytes\]$/.test(t))return`data:image/png;base64,${t.slice(9)}`}function HA({message:e,renderReply:t}){return(0,V.jsx)(V.Fragment,{children:e.map((e,n)=>{let r=`${e.type}-${n}`,i=e.data;switch(e.type){case`text`:{let e=Array.isArray(i.style)?i.style:[];return(0,V.jsx)(`span`,{className:z(e.map(e=>zA[e])),children:String(i.text)},r)}case`markdown`:return(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(`span`,{className:`whitespace-pre-wrap`,children:String(i.content)}),children:(0,V.jsx)(RA,{className:`markdown-compact`,children:String(i.content)})},r);case`button`:{let e=String(i.label),t=String(i.value);return i.kind===`link`&&/^https?:\/\//i.test(t)?(0,V.jsx)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,className:`mx-0.5 my-0.5 inline-flex rounded-lg border border-border bg-surface px-2.5 py-0.5 text-[0.92em] font-medium text-accent hover:border-border-strong`,children:e},r):(0,V.jsx)(`span`,{title:t,className:`mx-0.5 my-0.5 inline-flex rounded-lg border border-border bg-surface px-2.5 py-0.5 text-[0.92em] font-medium text-fg`,children:e},r)}case`at`:return(0,V.jsxs)(`span`,{className:`mx-0.5 rounded bg-accent-soft px-1 text-accent-soft-fg`,children:[`@`,i.id===`all`?`全体成员`:String(i.id)]},r);case`image`:{let t=VA(e);return t?(0,V.jsx)(`img`,{src:t,alt:String(i.summary??`图片`),referrerPolicy:`no-referrer`,className:`my-1 block max-h-60 max-w-full rounded-lg`},r):(0,V.jsx)(BA,{children:`图片`},r)}case`face`:return(0,V.jsx)(BA,{children:`表情`},r);case`audio`:return(0,V.jsx)(BA,{children:`语音`},r);case`video`:return(0,V.jsx)(BA,{children:`视频`},r);case`file`:return(0,V.jsx)(BA,{icon:(0,V.jsx)(Pr,{className:`size-3`}),children:String(i.name??`文件`)},r);case`forward`:return(0,V.jsx)(BA,{icon:(0,V.jsx)(vi,{className:`size-3`}),children:`合并转发`},r);case`reply`:{let e=(Array.isArray(i.message)?i.message.map(e=>e.type===`text`?String(e.data.text):e.type===`file`?String(e.data.name??`[文件]`):{image:`[图片]`,audio:`[语音]`,video:`[视频]`}[e.type]??``).join(``):``)||(typeof i.title==`string`?i.title:``);return(0,V.jsx)(`span`,{className:`mb-1 block`,children:t?t(String(i.id)):(0,V.jsx)(BA,{icon:(0,V.jsx)(Xr,{className:`size-3 shrink-0`}),children:(0,V.jsx)(`span`,{className:`line-clamp-2 break-all`,children:e||`回复`})})},r)}default:return(0,V.jsx)(BA,{children:e.type},r)}})})}var UA={filter:`访问过滤`,observer:`监听器`,middleware:`中间件`,prompt:`对话等待`,command:`命令`,matcher:`匹配器`,suggest:`相似命令提示`},WA={handled:{label:`已处理`,tone:`success`},passed:{label:`放行`,tone:`neutral`},blocked:{label:`已拦截`,tone:`danger`},denied:{label:`权限不足`,tone:`warning`},cooldown:{label:`冷却中`,tone:`warning`},invalid:{label:`参数错误`,tone:`warning`},error:{label:`出错`,tone:`danger`},timeout:{label:`超时`,tone:`danger`}},GA={neutral:`bg-fg-3`,accent:`bg-accent`,success:`bg-success`,warning:`bg-warning`,danger:`bg-danger`,info:`bg-info`};function KA(e,t){let n=new Map;return e.map(e=>{let r=t(e),i=n.get(r)??0;return n.set(r,i+1),`${r}#${i}`})}function qA(e){return e<1?`<1 ms`:e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(1)} s`}function JA({trace:e,logs:t}){let n=KA(e.steps,e=>`${e.stage}|${e.plugin??``}|${e.command??``}`),r=KA(t??[],e=>`${e.time}|${e.msg}`);return(0,V.jsxs)(`div`,{className:`space-y-3 text-[12.5px]`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-fg-3`,children:[(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-medium text-fg-2`,children:[(0,V.jsx)(ea,{className:`size-3.5`}),`处理链`]}),(0,V.jsx)(`span`,{className:`font-mono`,children:e.name}),(0,V.jsxs)(`span`,{children:[`耗时 `,qA(e.duration)]}),e.sent.length>0&&(0,V.jsxs)(`span`,{children:[`发出 `,e.sent.length,` 条消息`]})]}),e.steps.length===0?(0,V.jsx)(`p`,{className:`text-fg-3`,children:`没有任何处理器处理这条消息。`}):(0,V.jsx)(`ol`,{className:`relative space-y-2 pl-4 before:absolute before:top-1.5 before:bottom-1.5 before:left-[3px] before:w-px before:bg-border`,children:e.steps.map((e,t)=>{let r=WA[e.outcome];return(0,V.jsxs)(`li`,{className:`relative`,children:[(0,V.jsx)(`span`,{className:z(`absolute top-[7px] -left-4 size-[7px] rounded-full ring-2 ring-surface`,GA[r.tone])}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,V.jsx)(`span`,{className:`text-fg-2`,children:UA[e.stage]}),e.plugin&&(0,V.jsx)(`span`,{className:`rounded bg-accent-soft px-1.5 text-[11.5px] leading-[18px] text-accent-soft-fg`,children:e.plugin}),e.command&&(0,V.jsxs)(`code`,{className:`font-mono text-fg`,children:[`/`,e.command]}),(0,V.jsx)(Pv,{tone:r.tone,children:r.label}),(0,V.jsx)(`span`,{className:`ml-auto text-fg-3 tabular`,children:qA(e.duration)})]}),e.error&&(0,V.jsx)(`p`,{className:`mt-1 break-words text-danger`,children:e.error}),e.deliveryFailure&&(0,V.jsx)(`div`,{className:`mt-2`,children:(0,V.jsx)(Gv,{failure:e.deliveryFailure})})]},n[t])})}),t&&t.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 font-medium text-fg-2`,children:[(0,V.jsx)(ci,{className:`size-3.5`}),`日志`]}),(0,V.jsx)(`ul`,{className:`space-y-1 rounded-lg bg-surface-2/60 px-3 py-2 font-mono text-[11.5px]`,children:t.map((e,t)=>{let n=Xv(e.level);return(0,V.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,V.jsx)(`span`,{className:`shrink-0 text-fg-3 tabular`,children:Jv(e.time)}),(0,V.jsx)(`span`,{className:z(`w-11 shrink-0 rounded px-1 text-center text-[10.5px] leading-[17px] uppercase`,Zv[n]),children:n}),e.plugin&&(0,V.jsx)(`span`,{className:`shrink-0 text-accent-soft-fg`,children:e.plugin}),(0,V.jsx)(`span`,{className:z(`min-w-0 break-words`,e.level>=50?`text-danger`:`text-fg`),children:e.msg})]},r[t])})})]})]})}var YA=Object.defineProperty,XA=(e,t)=>YA(e,`name`,{value:t,configurable:!0}),ZA=`Dialog`,[QA,$A]=by(ZA),[ej,tj]=QA(ZA),nj=XA(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=B.useRef(null),c=B.useRef(null),{nodes:l,registry:u}=ix(),[d,f]=jy({prop:r,defaultProp:i??!1,onChange:a,caller:ZA}),[p,m]=B.useState(0),[h,g]=B.useState(0);return(0,V.jsx)(ej,{scope:t,triggerRef:s,contentRef:c,contentId:xx(),titleId:xx(),descriptionId:xx(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:g,open:d,onOpenChange:f,onOpenToggle:B.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),rj=`DialogPortal`,[ij,aj]=QA(rj,{forceMount:void 0}),oj=XA(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=tj(rj,t);return(0,V.jsx)(ij,{scope:t,forceMount:n,children:B.Children.map(r,e=>(0,V.jsx)(ow,{present:n||a.open,children:(0,V.jsx)(nw,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),sj=`DialogOverlay`,cj=B.forwardRef(XA(function(e,t){let n=aj(sj,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=tj(sj,e.__scopeDialog);return a.modal?(0,V.jsx)(ow,{present:r||a.open,children:(0,V.jsx)(uj,{...i,ref:t})}):null},`DialogOverlay`)),lj=Vy(`DialogOverlay.RemoveScroll`),uj=B.forwardRef(XA(function(e,t){let{__scopeDialog:n,...r}=e,i=tj(sj,n),a=gy(t,Lb());return(0,V.jsx)(aE,{as:lj,allowPinchZoom:!0,shards:B.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:(0,V.jsx)(ib.div,{"data-state":bj(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),dj=`DialogContent`,fj=B.forwardRef(XA(function(e,t){let n=aj(dj,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=tj(dj,e.__scopeDialog);return(0,V.jsx)(ow,{present:r||a.open,children:a.modal?(0,V.jsx)(pj,{...i,ref:t}):(0,V.jsx)(mj,{...i,ref:t})})},`DialogContent`)),pj=B.forwardRef(XA(function(e,t){let n=tj(dj,e.__scopeDialog),r=B.useRef(null),i=gy(t,n.contentRef,r);return B.useEffect(()=>{let e=r.current;if(e)return Zw(e)},[]),(0,V.jsx)(hj,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Y(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Y(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Y(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),mj=B.forwardRef(XA(function(e,t){let n=tj(dj,e.__scopeDialog),r=B.useRef(!1),i=B.useRef(!1);return(0,V.jsx)(hj,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),hj=B.forwardRef(XA(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=tj(dj,n);return Jb(),(0,V.jsx)(rx,{registry:l.branchRegistry,children:(0,V.jsx)(tx,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,V.jsx)(Ib,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?yj(o,l.descriptionId):o,"data-state":bj(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`)),gj=B.forwardRef(XA(function(e,t){let{__scopeDialog:n,...r}=e,i=tj(`DialogTitle`,n),{setTitleCount:a}=i;return Sy(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,V.jsx)(ib.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),_j=`DialogClose`,vj=B.forwardRef(XA(function(e,t){let{__scopeDialog:n,...r}=e,i=tj(_j,n);return(0,V.jsx)(ib.button,{type:`button`,...r,ref:t,onClick:Y(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function yj(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}XA(yj,`concatAriaDescribedby`);function bj(e){return e?`open`:`closed`}XA(bj,`getState`);function xj(){return(0,V.jsx)(cj,{asChild:!0,forceMount:!0,children:(0,V.jsx)(K.div,{className:`fixed inset-0 z-40 bg-overlay backdrop-blur-[3px]`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2}})})}function Sj({open:e,onOpenChange:t,title:n,description:r,children:i,footer:a,className:o}){return(0,V.jsx)(nj,{open:e,onOpenChange:t,children:(0,V.jsx)(Tg,{children:e&&(0,V.jsxs)(oj,{forceMount:!0,children:[(0,V.jsx)(xj,{}),(0,V.jsx)(`div`,{className:`pointer-events-none fixed inset-0 z-50 flex items-center justify-center p-4`,children:(0,V.jsx)(fj,{asChild:!0,forceMount:!0,"aria-describedby":void 0,children:(0,V.jsxs)(K.div,{initial:{opacity:0,scale:.96,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.97,y:6},transition:Dv,className:z(`pointer-events-auto w-full max-w-md rounded-2xl border border-border bg-surface shadow-pop outline-none`,o),children:[(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-4 px-5 pt-5`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(gj,{className:`text-[15px] font-semibold tracking-[-0.01em] text-fg`,children:n}),r&&(0,V.jsx)(`p`,{className:`mt-1 text-[13px] leading-relaxed text-fg-3`,children:r})]}),(0,V.jsx)(vj,{asChild:!0,children:(0,V.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":`关闭`,children:(0,V.jsx)(ia,{className:`size-4`})})})]}),i&&(0,V.jsx)(`div`,{className:`px-5 pt-4 pb-1`,children:i}),a&&(0,V.jsx)(`div`,{className:`flex justify-end gap-2 px-5 pt-3 pb-5`,children:a})]})})})]})})})}function Cj({open:e,onOpenChange:t,title:n,subtitle:r,headerExtra:i,children:a,className:o}){return(0,V.jsx)(nj,{open:e,onOpenChange:t,children:(0,V.jsx)(Tg,{children:e&&(0,V.jsxs)(oj,{forceMount:!0,children:[(0,V.jsx)(xj,{}),(0,V.jsx)(fj,{asChild:!0,forceMount:!0,"aria-describedby":void 0,children:(0,V.jsxs)(K.aside,{initial:{x:`100%`,opacity:.6},animate:{x:0,opacity:1},exit:{x:`100%`,opacity:.6},transition:q,className:z(`fixed inset-y-2 right-2 z-50 flex w-[min(560px,calc(100vw-1rem))] flex-col overflow-hidden rounded-2xl border border-border bg-surface shadow-pop outline-none`,o),children:[(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-b border-border px-6 pt-5 pb-4`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(gj,{className:`truncate text-[17px] font-semibold tracking-[-0.02em] text-fg`,children:n}),r&&(0,V.jsx)(`div`,{className:`mt-1 text-[13px] text-fg-3`,children:r})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[i,(0,V.jsx)(vj,{asChild:!0,children:(0,V.jsx)(X,{variant:`ghost`,size:`icon`,"aria-label":`关闭`,children:(0,V.jsx)(ia,{className:`size-4`})})})]})]}),(0,V.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:a})]})})]})})})}var wj=B.createContext(void 0),Tj=e=>{let t=B.useContext(wj);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Ej=({client:e,children:t})=>(B.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,V.jsx)(wj.Provider,{value:e,children:t})),Dj={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Oj=new class{#e=Dj;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function kj(e){setTimeout(e,0)}var Aj=typeof window>`u`||`Deno`in globalThis;function jj(){}function Mj(e,t){return typeof e==`function`?e(t):e}function Nj(e){return typeof e==`number`&&e>=0&&e!==1/0}function Pj(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Fj(e,t){return typeof e==`function`?e(t):e}function Ij(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Rj(o,t.options))return!1}else if(!Bj(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Lj(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(zj(t.options.mutationKey)!==zj(a))return!1}else if(!Bj(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Rj(e,t){return(t?.queryKeyHashFn||zj)(e)}function zj(e){return JSON.stringify(e,(e,t)=>Gj(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Bj(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!Bj(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!Bj(e[r],t[r]))return!1;return!0}return!1}var Vj=Object.prototype.hasOwnProperty;function Hj(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Wj(e)&&Wj(t);if(!r&&!(Gj(e)&&Gj(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:Vj.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Hj(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function Uj(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n of Object.keys(e))if(!Vj.call(t,n)||e[n]!==t[n])return!1;return!0}function Wj(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Gj(e){if(!Kj(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!Kj(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function Kj(e){return Object.prototype.toString.call(e)===`[object Object]`}function qj(e){return new Promise(t=>{Oj.setTimeout(t,e)})}function Jj(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Hj(e,t)}function Yj(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(-n):r}function Xj(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,n):r}var Zj=Symbol();function Qj(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Zj?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function $j(e,t){return typeof e==`function`?e(...t):!!e}var eM=Symbol();function tM(e,t,n,r){let i=!1,a;return Object.defineProperties(e,{[eM]:{value:r},signal:{enumerable:!0,get:()=>(a??=t(),i||(i=!0,a.aborted?n():a.addEventListener(`abort`,n,{once:!0})),a)}}),e}var nM=()=>Aj,rM=()=>nM(),iM=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},aM=new class extends iM{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},oM=kj;function sM(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=oM,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var cM=sM(),lM=new class extends iM{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function uM(e){return Math.min(1e3*2**e,3e4)}function dM(e){return(e??`online`)!==`online`||lM.isOnline()}var fM=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function pM(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(jj);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new fM(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>aM.isFocused()&&(e.networkMode===`always`||lM.isOnline())&&e.canRun(),p=()=>dM(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=t=>new Promise(n=>{r=e=>{(c()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(rM()?0:3),a=e.retryDelay??uM,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?h(r):(n++,e.onFail?.(n,r),qj(o).then(()=>c()||f()?void 0:g(f)).then(()=>{t?h(r):_()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g(p).then(_),s)}}var mM=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Nj(this.gcTime)&&(this.#e=Oj.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(rM()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(Oj.clearTimeout(this.#e),this.#e=void 0)}};function hM(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=t,u=e=>{tM(e,()=>t.signal,()=>n=!0,l[eM])},d=Qj(t.options,t.fetchOptions),f=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return u(e),e})(),o=await d(a),{maxPages:s}=t.options,c=i?Xj:Yj;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?_M:gM,n={pages:a,pageParams:o};s=await f(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]===void 0?r.initialPageParam:o[0]:gM(r,s);if(c>0&&e==null)break;s=await f(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function gM(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function _M(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function vM(e,t){return t?gM(e,t)!=null:!1}function yM(e,t){return!t||!e.getPreviousPageParam?!1:_M(e,t)!=null}var bM=class extends mM{#e;#t;#n;#r;#i;#a;#o;#s;#c;constructor(e){super(),this.#c=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=CM(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#s,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=CM(this.options);e.data!==void 0&&(this.setState(SM(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Jj(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(jj).catch(jj):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Fj(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Zj||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.state.data!==void 0&&this.getObserversCount()>0&&this.observers.some(e=>Fj(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Pj(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#c||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a&&this.#o)return this.#a.continueRetry(),this.#o}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperties(e,{[eM]:{value:n.signal,enumerable:!0},signal:{enumerable:!0,get:()=>(this.#c=!0,n.signal)}})},i=()=>{let e=Qj(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#c=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?hM(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=pM({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof fM&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}),s=(async()=>{try{let e=await o.promise;if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof fM){if(e.silent){if(this.#a!==o&&this.#o)return this.#o;throw e}if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0,this.#o=void 0),this.scheduleGc()}})();return this.#o=s,o.start(),s}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...xM(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...SM(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),cM.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function xM(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:dM(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function SM(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function CM(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var wM=class extends iM{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),EM(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return DM(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return DM(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Fj(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Uj(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&OM(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||Fj(this.options.enabled,this.#t)!==Fj(t.enabled,this.#t)||Fj(this.options.staleTime,this.#t)!==Fj(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Fj(this.options.enabled,this.#t)!==Fj(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Uj(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch(t).then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(jj)),t}#h(e){return!rM()&&Fj(this.options.enabled,this.#t)!==!1&&Nj(e)}#g(){this.#b();let e=Fj(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=Pj(this.#r.dataUpdatedAt,e)+1;this.#u=Oj.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return Fj(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=Oj.setInterval(()=>{(this.options.refetchIntervalInBackground||aM.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(Oj.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(Oj.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&EM(e,t),o=i&&OM(e,n,t,r);(a||o)&&(l={...l,...xM(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=Jj(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=Jj(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=i?.error===f?i.errorUpdatedAt:Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:kM(e,t),refetch:this.refetch,isEnabled:Fj(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),Uj(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size||this.options.throwOnError&&this.#r.error!==e.error)return!0;for(let t of n??this.#p)if(this.#r[t]!==e[t])return!0;return!1})();cM.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function TM(e,t){return Fj(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||Fj(t.retryOnMount,e)!==!1)}function EM(e,t){return TM(e,t)||e.state.data!==void 0&&DM(e,t,t.refetchOnMount)}function DM(e,t,n){if(Fj(t.enabled,e)!==!1&&Fj(t.staleTime,e)!==`static`){let r=Fj(n,e);return r===`always`||r!==!1&&kM(e,t)}return!1}function OM(e,t,n,r){return(e!==t||Fj(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&kM(e,n)}function kM(e,t){return Fj(t.enabled,e)!==!1&&e.isStaleByTime(Fj(t.staleTime,e))}var AM=class extends wM{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:vM(t,n.data),hasPreviousPage:yM(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},jM=class extends mM{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||MM(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=pM({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}this.state.isPaused&&r.canStart()&&t();let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),cM.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function MM(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var NM=class extends iM{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new jM({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=PM(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=PM(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=PM(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=PM(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){cM.batch(()=>{let e=this.getAll();this.#e.clear(),this.#t.clear(),e.forEach(e=>{this.notify({type:`removed`,mutation:e})})})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Lj(t,e))}findAll(e={}){return this.getAll().filter(t=>Lj(e,t))}notify(e){cM.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return cM.batch(()=>Promise.all(e.map(e=>e.continue().catch(jj))))}};function PM(e){return e.options.scope?.id}var FM=class extends iM{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),Uj(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&zj(t.mutationKey)!==zj(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??MM();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){cM.batch(()=>{let t=this.#r;if(t&&this.hasListeners()){let n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{t.onSuccess?.(e.data,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(e.data,null,n,r,i)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{t.onError?.(e.error,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(void 0,e.error,n,r,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},IM=class extends iM{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??Rj(r,t),a=this.get(i);return a||(a=new bM({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){cM.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Ij(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Ij(e,t)):t}notify(e){cM.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){cM.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){cM.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},LM=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new IM,this.#t=e.mutationCache||new NM,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=aM.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=lM.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Fj(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Mj(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return cM.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;cM.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return cM.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=cM.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(jj).catch(jj)}invalidateQueries(e,t={}){return cM.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=cM.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n),r=e.state.fetchStatus===`paused`;return(!n.throwOnError||r)&&(t=t.catch(jj)),r?Promise.resolve():t}));return Promise.all(r).then(jj)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(Fj(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Fj(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(jj).catch(jj)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(jj).catch(jj)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return lM.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(zj(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Bj(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(zj(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Bj(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Rj(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Zj&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},RM=B.createContext(!1),zM=()=>B.useContext(RM);RM.Provider;function BM(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var VM=B.createContext(BM()),HM=()=>B.useContext(VM),UM=(e,t,n)=>{let r=n?.state.status===`error`&&typeof e.throwOnError==`function`?$j(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},WM=e=>{B.useEffect(()=>{e.clearReset()},[e])},GM=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||$j(n,[e.error,r])),KM=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},qM=(e,t)=>e?.suspense&&t.isPending,JM=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function YM(e,t,n){let r=zM(),i=HM(),a=Tj(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,KM(o),UM(o,i,s),WM(i);let[l]=B.useState(()=>new t(a,o)),u=l.getOptimisticResult(o);B.useEffect(()=>{l.setOptions(o)},[o,l]);let d=!r&&c;if(B.useSyncExternalStore(B.useCallback(e=>{let t=d?l.subscribe(cM.batchCalls(e)):jj;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),qM(o,u))throw JM(o,l,i);if(GM({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function Z(e,t){return YM(e,wM,t)}function XM(e,t){let n=Tj(t),[r]=B.useState(()=>new FM(n,e));B.useEffect(()=>{r.setOptions(e)},[r,e]);let i=B.useSyncExternalStore(B.useCallback(e=>r.subscribe(cM.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=B.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(jj)},[r]);if(i.error&&$j(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function ZM(e,t){return YM(e,AM,t)}var QM=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&ee(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ee(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function ee(t,n){C=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ee(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),$M=o(((e,t)=>{t.exports=QM()})),eN=o((e=>{var t=$M(),n=d(),r=Ly();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}function p(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&p(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function m(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function h(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function g(e){var t=[null,null],n=m(e);return n===null||_(t,e,n.child,{foundSelf:!1}),t}function _(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&_(e,t,n.child,r))return!0;n=n.sibling}return!1}function v(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var y=null,b=null;function x(e,t,n){return e===n||e===t&&(y=e,!0)}function S(e,t,n){return e===n?(b=e,!1):e===t&&(b!==null&&(y=e),!0)}function C(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function w(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var T=Object.assign,E=Symbol.for(`react.element`),D=Symbol.for(`react.transitional.element`),O=Symbol.for(`react.portal`),k=Symbol.for(`react.fragment`),A=Symbol.for(`react.strict_mode`),ee=Symbol.for(`react.profiler`),j=Symbol.for(`react.consumer`),M=Symbol.for(`react.context`),te=Symbol.for(`react.forward_ref`),N=Symbol.for(`react.suspense`),P=Symbol.for(`react.suspense_list`),ne=Symbol.for(`react.memo`),re=Symbol.for(`react.lazy`),ie=Symbol.for(`react.activity`),ae=Symbol.for(`react.legacy_hidden`),oe=Symbol.for(`react.memo_cache_sentinel`),se=Symbol.for(`react.view_transition`),ce=Symbol.for(`react.recoverable`),le=Symbol.iterator;function ue(e){return typeof e!=`object`||!e?null:(e=le&&e[le]||e[`@@iterator`],typeof e==`function`?e:null)}var de=Symbol.for(`react.client.reference`);function fe(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===de?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case k:return`Fragment`;case ee:return`Profiler`;case A:return`StrictMode`;case N:return`Suspense`;case P:return`SuspenseList`;case ie:return`Activity`;case se:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case O:return`Portal`;case M:return e.displayName||`Context`;case j:return(e._context.displayName||`Context`)+`.Consumer`;case te:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ne:return t=e.displayName||null,t===null?fe(e.type)||`Memo`:t;case re:t=e._payload,e=e._init;try{return fe(e(t))}catch{}}return null}var pe=Array.isArray,F=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,me=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,he={pending:!1,data:null,method:null,action:null},ge=[],_e=-1;function ve(e){return{current:e}}function ye(e){0>_e||(e.current=ge[_e],ge[_e]=null,_e--)}function be(e,t){_e++,ge[_e]=e.current,e.current=t}var I=ve(null),xe=ve(null),Se=ve(null),Ce=ve(null);function we(e,t){switch(be(Se,t),be(xe,e),be(I,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?gp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=gp(t),e=_p(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ye(I),be(I,e)}function Te(){ye(I),ye(xe),ye(Se)}function Ee(e){var t=e.memoizedState;t!==null&&(ph._currentValue=t.memoizedState,be(Ce,e)),t=I.current;var n=_p(t,e.type);t!==n&&(be(xe,e),be(I,n))}function De(e){xe.current===e&&(ye(I),ye(xe)),Ce.current===e&&(ye(Ce),ph._currentValue=he)}var Oe,ke;function Ae(e){if(Oe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Oe=t&&t[1]||``,ke=-1<e.stack.indexOf(`
|
|
42
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
43
|
+
`+Oe+e+ke}var je=!1;function L(e,t){if(!e||je)return``;je=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
44
|
+
`),l=s.split(`
|
|
45
|
+
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
46
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{je=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ae(n):``}function Me(e,t){switch(e.tag){case 26:case 27:case 5:return Ae(e.type);case 16:return Ae(`Lazy`);case 13:return e.child!==t&&t!==null?Ae(`Suspense Fallback`):Ae(`Suspense`);case 19:return Ae(`SuspenseList`);case 0:case 15:return L(e.type,!1);case 11:return L(e.type.render,!1);case 1:return L(e.type,!0);case 31:return Ae(`Activity`);case 30:return Ae(`ViewTransition`);default:return``}}function Ne(e){try{var t=``,n=null;do t+=Me(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
47
|
+
Error generating stack: `+e.message+`
|
|
48
|
+
`+e.stack}}var Pe=Object.prototype.hasOwnProperty,Fe=t.unstable_scheduleCallback,Ie=t.unstable_cancelCallback,Le=t.unstable_shouldYield,Re=t.unstable_requestPaint,R=t.unstable_now,ze=t.unstable_getCurrentPriorityLevel,Be=t.unstable_ImmediatePriority,Ve=t.unstable_UserBlockingPriority,He=t.unstable_NormalPriority,Ue=t.unstable_LowPriority,We=t.unstable_IdlePriority,Ge=t.log,Ke=t.unstable_setDisableYieldValue,qe=null,Je=null;function Ye(e){if(typeof Ge==`function`&&Ke(e),Je&&typeof Je.setStrictMode==`function`)try{Je.setStrictMode(qe,e)}catch{}}var Xe=Math.clz32?Math.clz32:$e,Ze=Math.log,Qe=Math.LN2;function $e(e){return e>>>=0,e===0?32:31-(Ze(e)/Qe|0)|0}var et=256,tt=262144,nt=4194304;function z(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function rt(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=z(n))):i=z(o):i=z(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=z(n))):i=z(o)):i=z(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function it(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function at(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Xe(n),i=1<<r;t|=e[r],n&=~i}return t}function B(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 V(){var e=nt;return nt<<=1,!(nt&62914560)&&(nt=4194304),e}function ot(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function st(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ct(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Xe(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&<(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function lt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Xe(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ut(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Xe(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function dt(e,t){var n=t&-t;return n=n&42?1:ft(n),(n&(e.suspendedLanes|t))===0?n:0}function ft(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function pt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function mt(){var e=me.p;return e===0?(e=window.event,e===void 0?32:kh(e.type)):e}function ht(e,t){var n=me.p;try{return me.p=e,t()}finally{me.p=n}}var gt=Math.random().toString(36).slice(2),_t=`__reactFiber$`+gt,vt=`__reactProps$`+gt,yt=`__reactContainer$`+gt,bt=`__reactEvents$`+gt,xt=`__reactListeners$`+gt,H=`__reactHandles$`+gt,St=`__reactResources$`+gt,Ct=`__reactMarker$`+gt,wt=`__reactLoad$`+gt;function Tt(e){delete e[_t],delete e[vt],delete e[xt],delete e[H]}function Et(e){var t;if(t=e[_t])return t;for(var n=e.parentNode;n;){if(t=n[yt]||n[_t]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=vm(e);e!==null;){if(n=e[_t])return n;e=vm(e)}return t}e=n,n=e.parentNode}return null}function Dt(e){if(e=e[_t]||e[yt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ot(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function kt(e){var t=e[St];return t||=e[St]={hoistableStyles:new Map,hoistableScripts:new Map},t}function At(e){e[Ct]=!0}function jt(e){e[wt]=void 0}var Mt=new Set,Nt={};function Pt(e,t){Ft(e,t),Ft(e+`Capture`,t)}function Ft(e,t){for(Nt[e]=t,e=0;e<t.length;e++)Mt.add(t[e])}var It=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]*$`),Lt={},Rt={};function zt(e){return Pe.call(Rt,e)?!0:Pe.call(Lt,e)?!1:It.test(e)?Rt[e]=!0:(Lt[e]=!0,!1)}var Bt=!1;function Vt(){var e=Bt;return Bt=!1,e}function Ht(e,t,n){if(zt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Ut(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Wt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function Gt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Kt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function qt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Jt(e){if(!e._valueTracker){var t=Kt(e)?`checked`:`value`;e._valueTracker=qt(e,t,``+e[t])}}function Yt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Kt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Xt=/[\n"\\]/g;function Zt(e){return e.replace(Xt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Qt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Gt(t)):e.value!==``+Gt(t)&&(e.value=``+Gt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):en(e,Gt(n)):o===`number`&&e.value==t?en(e,Gt(e.value)):en(e,Gt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Gt(s):e.removeAttribute(`name`)}function $t(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Jt(e);return}n=n==null?``:``+Gt(n),t=t==null?n:``+Gt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Jt(e)}function en(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function tn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Gt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function nn(e,t,n){t!=null&&(t=``+Gt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Gt(n)}function rn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(pe(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Gt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Jt(e)}function an(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var on=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 sn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||on.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function cn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,Bt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(sn(e,a,r),Bt=!0)}else for(var o in t)t.hasOwnProperty(o)&&sn(e,o,t[o])}function ln(e){if(e.indexOf(`-`)===-1)return!1;switch(e){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 un=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`],[`maskType`,`mask-type`],[`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`]]),dn=/^[\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 fn(e){return dn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function pn(){}var mn=null;function hn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var gn=null,_n=null;function vn(e){var t=Dt(e);if(t&&(e=t.stateNode)){var n=e[vt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Qt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Zt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[vt]||null;if(!a)throw Error(i(90));Qt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Yt(r)}break a;case`textarea`:nn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&tn(e,!!n.multiple,t,!1)}}}var yn=!1;function bn(e,t,n){if(yn)return e(t,n);yn=!0;try{return e(t)}finally{if(yn=!1,(gn!==null||_n!==null)&&(Ud(),gn&&(t=gn,e=_n,_n=gn=null,vn(t),e)))for(t=0;t<e.length;t++)vn(e[t])}}function xn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[vt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var Sn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Cn=!1;if(Sn)try{var wn={};Object.defineProperty(wn,"passive",{get:function(){Cn=!0}}),window.addEventListener(`test`,wn,wn),window.removeEventListener(`test`,wn,wn)}catch{Cn=!1}var Tn=null,En=null,Dn=null;function On(){if(Dn)return Dn;var e,t=En,n=t.length,r,i=`value`in Tn?Tn.value:Tn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Dn=i.slice(e,1<r?1-r:void 0)}function kn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function An(){return!0}function jn(){return!1}function Mn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?An:jn,this.isPropagationStopped=jn,this}return T(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=An)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=An)},persist:function(){},isPersistent:An}),t}var Nn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pn=Mn(Nn),Fn=T({},Nn,{view:0,detail:0}),In=Mn(Fn),Ln,Rn,zn,Bn=T({},Fn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Zn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==zn&&(zn&&e.type===`mousemove`?(Ln=e.screenX-zn.screenX,Rn=e.screenY-zn.screenY):Rn=Ln=0,zn=e),Ln)},movementY:function(e){return`movementY`in e?e.movementY:Rn}}),Vn=Mn(Bn),Hn=Mn(T({},Bn,{dataTransfer:0})),Un=Mn(T({},Fn,{relatedTarget:0})),Wn=Mn(T({},Nn,{animationName:0,elapsedTime:0,pseudoElement:0})),Gn=Mn(T({},Nn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Kn=Mn(T({},Nn,{data:0})),qn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Jn={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`},Yn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Xn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Yn[e])?!!t[e]:!1}function Zn(){return Xn}var Qn=Mn(T({},Fn,{key:function(e){if(e.key){var t=qn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=kn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Jn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Zn,charCode:function(e){return e.type===`keypress`?kn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?kn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),$n=Mn(T({},Bn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),er=Mn(T({},Nn,{submitter:0})),tr=Mn(T({},Fn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Zn})),nr=Mn(T({},Nn,{propertyName:0,elapsedTime:0,pseudoElement:0})),rr=Mn(T({},Bn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),ir=Mn(T({},Nn,{newState:0,oldState:0,source:0})),ar=[9,13,27,32],or=Sn&&`CompositionEvent`in window,sr=null;Sn&&`documentMode`in document&&(sr=document.documentMode);var cr=Sn&&`TextEvent`in window&&!sr,lr=Sn&&(!or||sr&&8<sr&&11>=sr),ur=` `,dr=!1;function fr(e,t){switch(e){case`keyup`:return ar.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function pr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var mr=!1;function hr(e,t){switch(e){case`compositionend`:return pr(t);case`keypress`:return t.which===32?(dr=!0,ur):null;case`textInput`:return e=t.data,e===ur&&dr?null:e;default:return null}}function gr(e,t){if(mr)return e===`compositionend`||!or&&fr(e,t)?(e=On(),Dn=En=Tn=null,mr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return lr&&t.locale!==`ko`?null:t.data;default:return null}}var _r={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 vr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!_r[e.type]:t===`textarea`}function yr(e,t,n,r){gn?_n?_n.push(r):_n=[r]:gn=r,t=$f(t,`onChange`),0<t.length&&(n=new Pn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var br=null,xr=null;function Sr(e){Kf(e,0)}function Cr(e){if(Yt(Ot(e)))return e}function wr(e,t){if(e===`change`)return t}var Tr=!1;if(Sn){var Er;if(Sn){var Dr=`oninput`in document;if(!Dr){var Or=document.createElement(`div`);Or.setAttribute(`oninput`,`return;`),Dr=typeof Or.oninput==`function`}Er=Dr}else Er=!1;Tr=Er&&(!document.documentMode||9<document.documentMode)}function kr(){br&&(br.detachEvent(`onpropertychange`,Ar),xr=br=null)}function Ar(e){if(e.propertyName===`value`&&Cr(xr)){var t=[];yr(t,xr,e,hn(e)),bn(Sr,t)}}function jr(e,t,n){e===`focusin`?(kr(),br=t,xr=n,br.attachEvent(`onpropertychange`,Ar)):e===`focusout`&&kr()}function Mr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Cr(xr)}function Nr(e,t){if(e===`click`)return Cr(t)}function Pr(e,t){if(e===`input`||e===`change`)return Cr(t)}function Fr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Ir=typeof Object.is==`function`?Object.is:Fr;function Lr(e,t){if(Ir(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Pe.call(t,i)||!Ir(e[i],t[i]))return!1}return!0}function Rr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function zr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Br(e,t){var n=zr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=zr(n)}}function Vr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Vr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Hr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Rr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Rr(e.document)}return t}function Ur(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Wr=Sn&&`documentMode`in document&&11>=document.documentMode,Gr=null,Kr=null,qr=null,Jr=!1;function Yr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Jr||Gr==null||Gr!==Rr(r)||(r=Gr,`selectionStart`in r&&Ur(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),qr&&Lr(qr,r)||(qr=r,r=$f(Kr,`onSelect`),0<r.length&&(t=new Pn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Gr)))}function Xr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Zr={animationend:Xr(`Animation`,`AnimationEnd`),animationiteration:Xr(`Animation`,`AnimationIteration`),animationstart:Xr(`Animation`,`AnimationStart`),transitionrun:Xr(`Transition`,`TransitionRun`),transitionstart:Xr(`Transition`,`TransitionStart`),transitioncancel:Xr(`Transition`,`TransitionCancel`),transitionend:Xr(`Transition`,`TransitionEnd`)},Qr={},$r={};Sn&&($r=document.createElement(`div`).style,`AnimationEvent`in window||(delete Zr.animationend.animation,delete Zr.animationiteration.animation,delete Zr.animationstart.animation),`TransitionEvent`in window||delete Zr.transitionend.transition);function ei(e){if(Qr[e])return Qr[e];if(!Zr[e])return e;var t=Zr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in $r)return Qr[e]=t[n];return e}var ti=ei(`animationend`),ni=ei(`animationiteration`),ri=ei(`animationstart`),ii=ei(`transitionrun`),ai=ei(`transitionstart`),oi=ei(`transitioncancel`),si=ei(`transitionend`),ci=new Map,li=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);li.push(`scrollEnd`);function ui(e,t){ci.set(e,t),Pt(t,[e])}var di=0;function fi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=wd.identifierPrefix;var n=di++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function pi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Md;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function mi(e,t){return e=pi(e),t=pi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var hi=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},gi=[],_i=0,vi=0;function yi(){for(var e=_i,t=vi=_i=0;t<e;){var n=gi[t];gi[t++]=null;var r=gi[t];gi[t++]=null;var i=gi[t];gi[t++]=null;var a=gi[t];if(gi[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Ci(n,i,a)}}function bi(e,t,n,r){gi[_i++]=e,gi[_i++]=t,gi[_i++]=n,gi[_i++]=r,vi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function xi(e,t,n,r){return bi(e,t,n,r),wi(e)}function Si(e,t){return bi(e,null,null,t),wi(e)}function Ci(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Xe(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function wi(e){if(50<Nd)throw Nd=0,Pd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ti={};function Ei(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Di(e,t,n,r){return new Ei(e,t,n,r)}function Oi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ki(e,t){var n=e.alternate;return n===null?(n=Di(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Ai(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ji(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Oi(r)&&(s=1);else if(typeof r==`string`)s=$m(e,n,I.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case ie:return e=Di(31,n,t,a),e.elementType=ie,e.lanes=o,e;case k:return Mi(n.children,a,o,t);case A:s=8,a|=24;break;case ee:return e=Di(12,n,t,a|2),e.elementType=ee,e.lanes=o,e;case N:return e=Di(13,n,t,a),e.elementType=N,e.lanes=o,e;case P:return e=Di(19,n,t,a),e.elementType=P,e.lanes=o,e;case ae:case se:return e=a|32,e=Di(30,n,t,e),e.elementType=se,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case M:s=10;break a;case j:s=9;break a;case te:s=11;break a;case ne:s=14;break a;case re:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Di(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Mi(e,t,n,r){return e=Di(7,e,r,t),e.lanes=n,e}function Ni(e,t,n){return e=Di(6,e,null,t),e.lanes=n,e}function Pi(e){var t=Di(18,null,null,0);return t.stateNode=e,t}function Fi(e,t,n){return t=Di(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ii=new WeakMap;function Li(e,t){if(typeof e==`object`&&e){var n=Ii.get(e);return n===void 0?(t={value:e,source:t,stack:Ne(t)},Ii.set(e,t),t):n}return{value:e,source:t,stack:Ne(t)}}var Ri=[],zi=0,Bi=null,Vi=0,Hi=[],Ui=0,Wi=null,Gi=1,Ki=``;function qi(e,t){Ri[zi++]=Vi,Ri[zi++]=Bi,Bi=e,Vi=t}function Ji(e,t,n){Hi[Ui++]=Gi,Hi[Ui++]=Ki,Hi[Ui++]=Wi,Wi=e;var r=Gi;e=Ki;var i=32-Xe(r)-1;r&=~(1<<i),n+=1;var a=32-Xe(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Gi=1<<32-Xe(t)+i|n<<i|r,Ki=a+e}else Gi=1<<a|n<<i|r,Ki=e}function Yi(e){e.return!==null&&(qi(e,1),Ji(e,1,0))}function Xi(e){for(;e===Bi;)Bi=Ri[--zi],Ri[zi]=null,Vi=Ri[--zi],Ri[zi]=null;for(;e===Wi;)Wi=Hi[--Ui],Hi[Ui]=null,Ki=Hi[--Ui],Hi[Ui]=null,Gi=Hi[--Ui],Hi[Ui]=null}function Zi(e,t){Hi[Ui++]=Gi,Hi[Ui++]=Ki,Hi[Ui++]=Wi,Gi=t.id,Ki=t.overflow,Wi=e}var Qi=null,$i=null,ea=!1,ta=null,na=!1,ra=Error(i(519));function ia(e){throw ua(Li(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ra}function aa(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[_t]=e,t[vt]=r,n){case`dialog`:G(`cancel`,t),G(`close`,t);break;case`iframe`:case`object`:case`embed`:G(`load`,t);break;case`video`:case`audio`:for(n=0;n<Wf.length;n++)G(Wf[n],t);break;case`source`:G(`error`,t);break;case`img`:case`image`:case`link`:G(`error`,t),G(`load`,t);break;case`details`:G(`toggle`,t);break;case`input`:G(`invalid`,t),$t(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:G(`invalid`,t);break;case`textarea`:G(`invalid`,t),rn(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||ap(t.textContent,n)?(r.popover!=null&&(G(`beforetoggle`,t),G(`toggle`,t)),r.onScroll!=null&&G(`scroll`,t),r.onScrollEnd!=null&&G(`scrollend`,t),r.onClick!=null&&(t.onclick=pn),t=!0):t=!1,t||ia(e,!0)}function oa(e){for(Qi=e.return;Qi;)switch(Qi.tag){case 5:case 31:case 13:na=!1;return;case 27:case 3:na=!0;return;default:Qi=Qi.return}}function sa(e){if(e!==Qi)return!1;if(!ea)return oa(e),ea=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||yp(e.type,e.memoizedProps)),n=!n),n&&$i&&ia(e),oa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));$i=_m(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));$i=_m(e)}else t===27?(t=$i,Op(e.type)?(e=gm,gm=null,$i=e):$i=t):$i=Qi?hm(e.stateNode.nextSibling):null;return!0}function ca(){$i=Qi=null,ea=!1}function la(){var e=ta;return e!==null&&(gd===null?gd=e:gd.push.apply(gd,e),ta=null),e}function ua(e){ta===null?ta=[e]:ta.push(e)}var da=ve(null),fa=null,pa=null;function ma(e,t,n){be(da,t._currentValue),t._currentValue=n}function ha(e){e._currentValue=da.current,ye(da)}function ga(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function _a(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),ga(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),ga(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),ga(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function va(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Ir(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Ce.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ph]:e.push(ph))}a=a.return}return e!==null&&_a(t,e,n,r),t.flags|=262144,e!==null}function ya(e){for(e=e.firstContext;e!==null;){if(!Ir(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ba(e){fa=e,pa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function xa(e){return Ca(fa,e)}function Sa(e,t){return fa===null&&ba(e),Ca(e,t)}function Ca(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},pa===null){if(e===null)throw Error(i(308));pa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else pa=pa.next=t;return n}var wa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Ta=t.unstable_scheduleCallback,Ea=t.unstable_NormalPriority,Da={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Oa(){return{controller:new wa,data:new Map,refCount:0}}function ka(e){e.refCount--,e.refCount===0&&Ta(Ea,function(){e.controller.abort()})}function Aa(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var ja=null;function Ma(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Na=null,Pa=0,Fa=0,Ia=null;function La(e,t){if(Na===null){var n=Na=[];Pa=0,Fa=zf(),Ia={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Pa++,t.then(Ra,Ra),t}function Ra(){if(--Pa===0&&(ja=null,Na!==null)){Ia!==null&&(Ia.status=`fulfilled`);var e=Na;Na=null,Fa=0,Ia=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function za(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ba=F.S;F.S=function(e,t){if(yd=R(),typeof t==`object`&&t&&typeof t.then==`function`&&La(e,t),ja!==null)for(var n=Tf;n!==null;)Aa(n,ja),n=n.next;if(n=e.types,n!==null){for(var r=Tf;r!==null;)Aa(r,n),r=r.next;if(Fa!==0){r=ja,r===null&&(r=ja=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ba!==null&&Ba(e,t)};var Va=ve(null);function Ha(){var e=Va.current;return e===null?ed.pooledCache:e}function Ua(e,t){t===null?be(Va,Va.current):be(Va,t.pool)}function Wa(){var e=Ha();return e===null?null:{parent:Da._currentValue,pool:e}}var Ga=Error(i(460)),Ka=Error(i(474)),qa=Error(i(542)),Ja={then:function(){}};function Ya(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Xa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(pn,pn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,eo(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(pn,pn);else{if(e=ed,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,eo(e),e}throw Qa=t,Ga}}function Za(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Qa=e,Ga):e}}var Qa=null;function $a(){if(Qa===null)throw Error(i(459));var e=Qa;return Qa=null,e}function eo(e){if(e===Ga||e===qa)throw Error(i(483))}var to=null,no=0;function ro(e){var t=no;return no+=1,to===null&&(to=[]),Xa(to,e,t)}function io(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ao(e,t){throw t.$$typeof===E?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function oo(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ki(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Ni(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===k?(e=d(e,t,n.props.children,r,n.key),io(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===re&&Za(i)===t.type)?(t=a(t,n.props),io(t,n),t.return=e,t):(t=ji(n.type,n.key,n.props,null,e.mode,r),io(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Fi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Mi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Ni(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case D:return n=ji(t.type,t.key,t.props,null,e.mode,n),io(n,t),n.return=e,n;case O:return t=Fi(t,e.mode,n),t.return=e,t;case re:return t=Za(t),f(e,t,n)}if(pe(t)||ue(t))return t=Mi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ro(t),n);if(t.$$typeof===M)return f(e,Sa(e,t),n);ao(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case D:return n.key===i?l(e,t,n,r):null;case O:return n.key===i?u(e,t,n,r):null;case re:return n=Za(n),p(e,t,n,r)}if(pe(n)||ue(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ro(n),r);if(n.$$typeof===M)return p(e,t,Sa(e,n),r);ao(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case D:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case O:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case re:return r=Za(r),m(e,t,n,r,i)}if(pe(r)||ue(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,ro(r),i);if(r.$$typeof===M)return m(e,t,n,Sa(t,r),i);ao(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),ea&&qi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return ea&&qi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),ea&&qi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),ea&&qi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return ea&&qi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),ea&&qi(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===k&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case D:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===k){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),io(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===re&&Za(l)===r.type){n(e,r.sibling),c=a(r,o.props),io(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===k?(c=Mi(o.props.children,e.mode,c,o.key),io(c,o),c.return=e,e=c):(c=ji(o.type,o.key,o.props,null,e.mode,c),io(c,o),c.return=e,e=c)}return s(e);case O:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Fi(o,e.mode,c),c.return=e,e=c}return s(e);case re:return o=Za(o),_(e,r,o,c)}if(pe(o))return h(e,r,o,c);if(ue(o)){if(l=ue(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,ro(o),c);if(o.$$typeof===M)return _(e,r,Sa(e,o),c);ao(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Ni(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{no=0;var i=_(e,t,n,r);return to=null,i}catch(t){if(t===Ga||t===qa)throw t;var a=Di(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var so=oo(!0),co=oo(!1),lo=!1;function uo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function po(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function mo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,$u&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=wi(e),Ci(e,null,n),t}return bi(e,r,t,n),wi(e)}function ho(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ut(e,n)}}function go(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var _o=!1;function vo(){if(_o){var e=Ia;if(e!==null)throw e}}function yo(e,t,n,r){_o=!1;var i=e.updateQueue;lo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(nd&f)===f:(r&f)===f){f!==0&&f===Fa&&(_o=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=T({},d,f);break a;case 2:lo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),ud|=o,e.lanes=o,e.memoizedState=d}}function U(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function bo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)U(n[e],t)}var xo=ve(null),So=ve(0);function Co(e,t){e=cd,be(So,e),be(xo,t),cd=e|t.baseLanes}function wo(){be(So,cd),be(xo,xo.current)}function To(){cd=So.current,ye(xo),ye(So)}var Eo=ve(null),Do=null;function Oo(e){var t=e.alternate;be(No,No.current&1),be(Eo,e),Do===null&&(t===null||xo.current!==null||t.memoizedState!==null)&&(Do=e)}function ko(e){be(No,No.current),be(Eo,e),Do===null&&(Do=e)}function Ao(e){e.tag===22?(be(No,No.current),be(Eo,e),Do===null&&(Do=e)):jo()}function jo(){be(No,No.current),be(Eo,Eo.current)}function Mo(e){ye(Eo),Do===e&&(Do=null),ye(No)}var No=ve(0);function Po(e,t){be(Eo,Eo.current),be(No,t)}function Fo(e){ye(No),ye(Eo),Do===e&&(Do=null)}function Io(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||fm(n)||pm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Lo=0,W=null,Ro=null,zo=null,Bo=!1,Vo=!1,Ho=!1,Uo=0,Wo=0,Go=null,Ko=0;function qo(){throw Error(i(321))}function Jo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ir(e[n],t[n]))return!1;return!0}function Yo(e,t,n,r,i,a){return Lo=a,W=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,F.H=e===null||e.memoizedState===null?fc:pc,Ho=!1,a=n(r,i),Ho=!1,Vo&&(a=Zo(t,n,r,i)),Xo(e),a}function Xo(e){F.H=dc;var t=Ro!==null&&Ro.next!==null;if(Lo=0,zo=Ro=W=null,Bo=!1,Wo=0,Go=null,t)throw Error(i(300));e===null||Ac||(e=e.dependencies,e!==null&&ya(e)&&(Ac=!0))}function Zo(e,t,n,r){W=e;var a=0;do{if(Vo&&(Go=null),Wo=0,Vo=!1,25<=a)throw Error(i(301));if(a+=1,zo=Ro=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}F.H=mc,o=t(n,r)}while(Vo);return o}function Qo(){var e=F.H,t=e.useState()[0];return t=typeof t.then==`function`?as(t):t,e=e.useState()[0],(Ro===null?null:Ro.memoizedState)!==e&&(W.flags|=1024),t}function $o(){var e=Uo!==0;return Uo=0,e}function es(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ts(e){if(Bo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Bo=!1}Lo=0,zo=Ro=W=null,Vo=!1,Wo=Uo=0,Go=null}function ns(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zo===null?W.memoizedState=zo=e:zo=zo.next=e,zo}function rs(){if(Ro===null){var e=W.alternate;e=e===null?null:e.memoizedState}else e=Ro.next;var t=zo===null?W.memoizedState:zo.next;if(t!==null)zo=t,Ro=e;else{if(e===null)throw W.alternate===null?Error(i(467)):Error(i(310));Ro=e,e={memoizedState:Ro.memoizedState,baseState:Ro.baseState,baseQueue:Ro.baseQueue,queue:Ro.queue,next:null},zo===null?W.memoizedState=zo=e:zo=zo.next=e}return zo}function is(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function as(e){var t=Wo;return Wo+=1,Go===null&&(Go=[]),e=Xa(Go,e,t),t=W,(zo===null?t.memoizedState:zo.next)===null&&(t=t.alternate,F.H=t===null||t.memoizedState===null?fc:pc),e}function os(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return as(e);if(e.$$typeof===ce)return;if(e.$$typeof===M)return xa(e)}throw Error(i(438,String(e)))}function ss(e){var t=null,n=W.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=W.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=is(),W.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=oe;return t.index++,n}function cs(e,t){return typeof t==`function`?t(e):t}function ls(e){return us(rs(),Ro,e)}function us(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Lo&f)===f:(nd&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Fa&&(d=!0);else if((Lo&p)===p){u=u.next,p===Fa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,W.lanes|=p,ud|=p;f=u.action,Ho&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,W.lanes|=f,ud|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Ir(o,e.memoizedState)&&(Ac=!0,d&&(n=Ia,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function ds(e){var t=rs(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Ir(o,t.memoizedState)||(Ac=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function fs(e,t,n){var r=W,a=rs(),o=ea;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Ir((Ro||a).memoizedState,n);if(s&&(a.memoizedState=n,Ac=!0),a=a.queue,Ls(hs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||zo!==null&&!!(zo.memoizedState.tag&1),Ms(e?9:8,{destroy:void 0},ms.bind(null,r,a,n,t),null),e){if(r.flags|=2048,ed===null)throw Error(i(349));o||Lo&127||ps(r,t,n)}return n}function ps(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=W.updateQueue,t===null?(t=is(),W.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ms(e,t,n,r){t.value=n,t.getSnapshot=r,gs(t)&&_s(e)}function hs(e,t,n){return n(function(){gs(t)&&_s(e)})}function gs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ir(e,n)}catch{return!0}}function _s(e){var t=Si(e,2);t!==null&&Rd(t,e,2)}function vs(e){var t=ns();if(typeof e==`function`){var n=e;if(e=n(),Ho){Ye(!0);try{n()}finally{Ye(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:e},t}function ys(e,t,n,r){return e.baseState=n,us(e,Ro,typeof r==`function`?r:cs)}function bs(e,t,n,r,a){if(cc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};F.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,xs(t,o)):(o.next=n.next,t.pending=n.next=o)}}function xs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=F.T,o={};o.types=a===null?null:a.types,F.T=o;try{var s=n(i,r),c=F.S;c!==null&&c(o,s),Ss(e,t,s)}catch(n){ws(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),F.T=a}}else try{a=n(i,r),Ss(e,t,a)}catch(n){ws(e,t,n)}}function Ss(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Cs(e,t,n)},function(n){return ws(e,t,n)}):Cs(e,t,n)}function Cs(e,t,n){t.status=`fulfilled`,t.value=n,Ts(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,xs(e,n)))}function ws(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ts(t),t=t.next;while(t!==r)}e.action=null}function Ts(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Es(e,t){return t}function Ds(e,t){if(ea){var n=ed.formState;if(n!==null){a:{var r=W;if(ea){if($i){b:{for(var i=$i,a=na;i.nodeType!==8;)if(!a||(i=hm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){$i=hm(i.nextSibling),r=i.data===`F!`;break a}}ia(r)}r=!1}r&&(t=n[0])}}return n=ns(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Es,lastRenderedState:t},n.queue=r,n=ac.bind(null,W,r),r.dispatch=n,r=vs(!1),a=sc.bind(null,W,!1,r.queue),r=ns(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=bs.bind(null,W,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Os(e){return ks(rs(),Ro,e)}function ks(e,t,n){if(t=us(e,t,Es)[0],e=ls(cs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=as(t)}catch(e){throw e===Ga?qa:e}else r=t;t=rs();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(W.flags|=2048,Ms(9,{destroy:void 0},As.bind(null,i,n),null)),[r,a,e]}function As(e,t){e.action=t}function js(e){var t=rs(),n=Ro;if(n!==null)return ks(t,n,e);rs(),t=t.memoizedState,n=rs();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ms(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=W.updateQueue,t===null&&(t=is(),W.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ns(){return rs().memoizedState}function Ps(e,t,n,r){var i=ns();W.flags|=e,i.memoizedState=Ms(1|t,{destroy:void 0},n,r===void 0?null:r)}function Fs(e,t,n,r){var i=rs();r=r===void 0?null:r;var a=i.memoizedState.inst;Ro!==null&&r!==null&&Jo(r,Ro.memoizedState.deps)?i.memoizedState=Ms(t,a,n,r):(W.flags|=e,i.memoizedState=Ms(1|t,a,n,r))}function Is(e,t){Ps(8390656,8,e,t)}function Ls(e,t){Fs(2048,8,e,t)}function Rs(e){W.flags|=4;var t=W.updateQueue;if(t===null)t=is(),W.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function zs(e){var t=rs().memoizedState;return Rs({ref:t,nextImpl:e}),function(){if($u&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Bs(e,t){return Fs(4,2,e,t)}function Vs(e,t){return Fs(4,4,e,t)}function Hs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Us(e,t,n){n=n==null?null:n.concat([e]),Fs(4,4,Hs.bind(null,t,e),n)}function Ws(){}function Gs(e,t){var n=rs();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Jo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ks(e,t){var n=rs();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Jo(t,r[1]))return r[0];if(r=e(),Ho){Ye(!0);try{e()}finally{Ye(!1)}}return n.memoizedState=[r,t],r}function qs(e,t,n){return n===void 0||Lo&1073741824&&!(nd&261930)?e.memoizedState=t:(e.memoizedState=n,e=Id(),W.lanes|=e,ud|=e,n)}function Js(e,t,n,r){return Ir(n,t)?n:xo.current===null?!(Lo&106)||Lo&1073741824&&!(nd&261930)?(Ac=!0,e.memoizedState=n):(e=Id(),W.lanes|=e,ud|=e,t):(e=qs(e,n,r),Ir(e,t)||(Ac=!0),e)}function Ys(e,t,n,r,i){var a=me.p;me.p=a!==0&&8>a?a:8;var o=F.T,s={};s.types=o===null?null:o.types,F.T=s,sc(e,!1,t,n);try{var c=i(),l=F.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?oc(e,t,za(c,r),Fd(e)):oc(e,t,r,Fd(e))}catch(n){oc(e,t,{then:function(){},status:`rejected`,reason:n},Fd())}finally{me.p=a,o!==null&&s.types!==null&&(o.types=s.types),F.T=o}}function Xs(){}function Zs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Qs(e).queue;Ys(e,a,t,he,n===null?Xs:function(){return $s(e),n(r)})}function Qs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:he,baseState:he,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:he},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function $s(e){var t=Qs(e);t.next===null&&(t=e.alternate.memoizedState),oc(e,t.next.queue,{},Fd())}function ec(){return xa(ph)}function tc(){return rs().memoizedState}function nc(){return rs().memoizedState}function rc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Fd();e=po(n);var r=mo(t,e,n);r!==null&&(Rd(r,t,n),ho(r,t,n)),t={cache:Oa()},e.payload=t;return}t=t.return}}function ic(e,t,n){var r=Fd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},cc(e)?lc(t,n):(n=xi(e,t,n,r),n!==null&&(Rd(n,e,r),uc(n,t,r)))}function ac(e,t,n){oc(e,t,n,Fd())}function oc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(cc(e))lc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Ir(s,o))return bi(e,t,i,0),ed===null&&yi(),!1}catch{}if(n=xi(e,t,i,r),n!==null)return Rd(n,e,r),uc(n,t,r),!0}return!1}function sc(e,t,n,r){if(r={lane:2,revertLane:zf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},cc(e)){if(t)throw Error(i(479))}else t=xi(e,n,r,2),t!==null&&Rd(t,e,2)}function cc(e){var t=e.alternate;return e===W||t!==null&&t===W}function lc(e,t){Vo=Bo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function uc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ut(e,n)}}var dc={readContext:xa,use:os,useCallback:qo,useContext:qo,useEffect:qo,useImperativeHandle:qo,useLayoutEffect:qo,useInsertionEffect:qo,useMemo:qo,useReducer:qo,useRef:qo,useState:qo,useDebugValue:qo,useDeferredValue:qo,useTransition:qo,useSyncExternalStore:qo,useId:qo,useHostTransitionStatus:qo,useFormState:qo,useActionState:qo,useOptimistic:qo,useMemoCache:qo,useCacheRefresh:qo,useEffectEvent:qo},fc={readContext:xa,use:os,useCallback:function(e,t){return ns().memoizedState=[e,t===void 0?null:t],e},useContext:xa,useEffect:Is,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ps(4194308,4,Hs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ps(4194308,4,e,t)},useInsertionEffect:function(e,t){Ps(4,2,e,t)},useMemo:function(e,t){var n=ns();t=t===void 0?null:t;var r=e();if(Ho){Ye(!0);try{e()}finally{Ye(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ns();if(n!==void 0){var i=n(t);if(Ho){Ye(!0);try{n(t)}finally{Ye(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ic.bind(null,W,e),[r.memoizedState,e]},useRef:function(e){var t=ns();return e={current:e},t.memoizedState=e},useState:function(e){e=vs(e);var t=e.queue,n=ac.bind(null,W,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ws,useDeferredValue:function(e,t){return qs(ns(),e,t)},useTransition:function(){var e=vs(!1);return e=Ys.bind(null,W,e.queue,!0,!1),ns().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=W,a=ns();if(ea){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),ed===null)throw Error(i(349));nd&127||ps(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Is(hs.bind(null,r,o,e),[e]),r.flags|=2048,Ms(9,{destroy:void 0},ms.bind(null,r,o,n,t),null),n},useId:function(){var e=ns(),t=ed.identifierPrefix;if(ea){var n=Ki,r=Gi;n=(r&~(1<<32-Xe(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Uo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Ko++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ec,useFormState:Ds,useActionState:Ds,useOptimistic:function(e){var t=ns();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=sc.bind(null,W,!0,n),n.dispatch=t,[e,t]},useMemoCache:ss,useCacheRefresh:function(){return ns().memoizedState=rc.bind(null,W)},useEffectEvent:function(e){var t=ns(),n={impl:e};return t.memoizedState=n,function(){if($u&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},pc={readContext:xa,use:os,useCallback:Gs,useContext:xa,useEffect:Ls,useImperativeHandle:Us,useInsertionEffect:Bs,useLayoutEffect:Vs,useMemo:Ks,useReducer:ls,useRef:Ns,useState:function(){return ls(cs)},useDebugValue:Ws,useDeferredValue:function(e,t){return Js(rs(),Ro.memoizedState,e,t)},useTransition:function(){var e=ls(cs)[0],t=rs().memoizedState;return[typeof e==`boolean`?e:as(e),t]},useSyncExternalStore:fs,useId:tc,useHostTransitionStatus:ec,useFormState:Os,useActionState:Os,useOptimistic:function(e,t){return ys(rs(),Ro,e,t)},useMemoCache:ss,useCacheRefresh:nc,useEffectEvent:zs},mc={readContext:xa,use:os,useCallback:Gs,useContext:xa,useEffect:Ls,useImperativeHandle:Us,useInsertionEffect:Bs,useLayoutEffect:Vs,useMemo:Ks,useReducer:ds,useRef:Ns,useState:function(){return ds(cs)},useDebugValue:Ws,useDeferredValue:function(e,t){var n=rs();return Ro===null?qs(n,e,t):Js(n,Ro.memoizedState,e,t)},useTransition:function(){var e=ds(cs)[0],t=rs().memoizedState;return[typeof e==`boolean`?e:as(e),t]},useSyncExternalStore:fs,useId:tc,useHostTransitionStatus:ec,useFormState:js,useActionState:js,useOptimistic:function(e,t){var n=rs();return Ro===null?(n.baseState=e,[e,n.queue.dispatch]):ys(n,Ro,e,t)},useMemoCache:ss,useCacheRefresh:nc,useEffectEvent:zs};function hc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:T({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var gc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Fd(),i=po(r);i.payload=t,n!=null&&(i.callback=n),t=mo(e,i,r),t!==null&&(Rd(t,e,r),ho(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Fd(),i=po(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=mo(e,i,r),t!==null&&(Rd(t,e,r),ho(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Fd(),r=po(n);r.tag=2,t!=null&&(r.callback=t),t=mo(e,r,n),t!==null&&(Rd(t,e,n),ho(t,e,n))}};function _c(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Lr(n,r)||!Lr(i,a):!0}function vc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&gc.enqueueReplaceState(t,t.state,null)}function yc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=T({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function bc(e){hi(e)}function xc(e){console.error(e)}function Sc(e){hi(e)}function Cc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function wc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Tc(e,t,n){return n=po(n),n.tag=3,n.payload={element:null},n.callback=function(){Cc(e,t)},n}function Ec(e){return e=po(e),e.tag=3,e}function Dc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){wc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){wc(t,n,r),typeof i!=`function`&&(Sd===null?Sd=new Set([this]):Sd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Oc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&va(t,n,a,!0),n=Eo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Do===null?Xd():n.alternate===null&&ld===0&&(ld=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ja?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),yf(e,r,a)),!1;case 22:return n.flags|=65536,r===Ja?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),yf(e,r,a)),!1}throw Error(i(435,n.tag))}return yf(e,r,a),Xd(),!1}if(ea)return t=Eo.current,t===null?(r!==ra&&(t=Error(i(423),{cause:r}),ua(Li(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Li(r,n),a=Tc(e.stateNode,r,a),go(e,a),ld!==4&&(ld=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ra&&(e=Error(i(422),{cause:r}),ua(Li(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Li(o,n),hd===null?hd=[o]:hd.push(o),ld!==4&&(ld=2),t===null)return!0;r=Li(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Tc(n.stateNode,r,e),go(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(Sd===null||!Sd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ec(a),Dc(a,e,n,r),go(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var kc=Error(i(461)),Ac=!1;function jc(e,t,n,r){t.child=e===null?co(t,null,n,r):so(t,e.child,n,r)}function Mc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ba(t),r=Yo(e,t,n,o,a,i),s=$o(),e!==null&&!Ac?(es(e,t,i),ol(e,t,i)):(ea&&s&&Yi(t),t.flags|=1,jc(e,t,r,i),t.child)}function Nc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Oi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Pc(e,t,a,r,i)):(e=ji(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!sl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Lr:n,n(o,r)&&e.ref===t.ref)return ol(e,t,i)}return t.flags|=1,e=ki(a,r),e.ref=t.ref,e.return=t,t.child=e}function Pc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Lr(a,r)&&e.ref===t.ref){if(Ac=!1,t.pendingProps=r=a,sl(e,i))e.flags&131072&&(Ac=!0);else return t.lanes=e.lanes,ol(e,t,i)}}return Hc(e,t,n,r,i)}function Fc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Lc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ua(t,a===null?null:a.cachePool),a===null?wo():Co(t,a),Ao(t);else return r=t.lanes=536870912,Lc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ua(t,null),wo(),jo()):(Ua(t,a.cachePool),Co(t,a),jo(),t.memoizedState=null);return jc(e,t,i,n),t.child}function Ic(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Lc(e,t,n,r,i){var a=Ha();return a=a===null?null:{parent:Da._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ua(t,null),wo(),Ao(t),e!==null&&va(e,t,r,!0),t.childLanes=i,null}function Rc(e,t){return t=Zc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function zc(e,t,n){return so(t,e.child,null,n),e=Rc(t,t.pendingProps),e.flags|=2,Mo(t),t.memoizedState=null,e}function Bc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(ea){if(r.mode===`hidden`)return e=Rc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Ic(null,e);if(ko(t),(e=$i)?(e=dm(e,na),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Wi===null?null:{id:Gi,overflow:Ki},retryLane:536870912,hydrationErrors:null},n=Pi(e),n.return=t,t.child=n,Qi=t,$i=null)):e=null,e===null)throw ia(t);return t.lanes=536870912,null}return Rc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(ko(t),a){if(t.flags&256)t.flags&=-257,t=zc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Ac||va(e,t,n,!1),a=(n&e.childLanes)!==0,Ac||a){if(xo.current===null){if(r=ed,r!==null&&(s=dt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Si(e,s),Rd(r,e,s),kc;Xd()}t=zc(e,t,n)}else e=o.treeContext,$i=hm(s.nextSibling),Qi=t,ea=!0,ta=null,na=!1,e!==null&&Zi(t,e),t=Rc(t,r),t.flags|=134221824;return t}return e=ki(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Vc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Hc(e,t,n,r,i){return ba(t),n=Yo(e,t,n,r,void 0,i),r=$o(),e!==null&&!Ac?(es(e,t,i),ol(e,t,i)):(ea&&r&&Yi(t),t.flags|=1,jc(e,t,n,i),t.child)}function Uc(e,t,n,r,i,a){return ba(t),t.updateQueue=null,n=Zo(t,r,n,i),Xo(e),r=$o(),e!==null&&!Ac?(es(e,t,a),ol(e,t,a)):(ea&&r&&Yi(t),t.flags|=1,jc(e,t,n,a),t.child)}function Wc(e,t,n,r,i){if(ba(t),t.stateNode===null){var a=Ti,o=n.contextType;typeof o==`object`&&o&&(a=xa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=gc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},uo(t),o=n.contextType,a.context=typeof o==`object`&&o?xa(o):Ti,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(hc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&gc.enqueueReplaceState(a,a.state,null),yo(t,r,a,i),vo(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=yc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ti,typeof u==`object`&&u&&(o=xa(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&vc(t,a,r,o),lo=!1;var f=t.memoizedState;a.state=f,yo(t,r,a,i),vo(),l=t.memoizedState,s||f!==l||lo?(typeof d==`function`&&(hc(t,n,d,r),l=t.memoizedState),(c=lo||_c(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,fo(e,t),o=t.memoizedProps,u=yc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ti,typeof l==`object`&&l&&(c=xa(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&vc(t,a,r,c),lo=!1,f=t.memoizedState,a.state=f,yo(t,r,a,i),vo();var p=t.memoizedState;o!==d||f!==p||lo||e!==null&&e.dependencies!==null&&ya(e.dependencies)?(typeof s==`function`&&(hc(t,n,s,r),p=t.memoizedState),(u=lo||_c(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ya(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Vc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=so(t,e.child,null,i),t.child=so(t,null,n,i)):jc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=ol(e,t,i),e}function Gc(e,t,n,r){return ca(),t.flags|=256,jc(e,t,n,r),t.child}var Kc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qc(e){return{baseLanes:e,cachePool:Wa()}}function Jc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=pd),e}function Yc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(No.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(ea){if(i?Oo(t):jo(),(e=$i)?(e=dm(e,na),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Wi===null?null:{id:Gi,overflow:Ki},retryLane:536870912,hydrationErrors:null},n=Pi(e),n.return=t,t.child=n,Qi=t,$i=null)):e=null,e===null)throw ia(t);return t.lanes=pm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(jo(),i=t.mode,a=Zc({mode:`hidden`,children:a},i),r=Mi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=qc(n),r.childLanes=Jc(e,o,n),t.memoizedState=Kc,Ic(null,r)):(Oo(t),Xc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return $c(e,t,a,o,r,c,s,n)}return i?(jo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=ki(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Mi(i,a,n,null),i.flags|=2):i=ki(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Ic(null,r),r=t.child,i=e.child.memoizedState,i===null?i=qc(n):(a=i.cachePool,a===null?a=Wa():(s=Da._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Jc(e,o,n),t.memoizedState=Kc,Ic(e.child,r)):(Oo(t),n=e.child,e=n.sibling,n=ki(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Xc(e,t){return t=Zc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Zc(e,t){return e=Di(22,e,null,t),e.lanes=0,e}function Qc(e,t,n){return so(t,e.child,null,n),e=Xc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function $c(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Oo(t),t.flags&=-257,Qc(e,t,c)):t.memoizedState===null?(jo(),o=a.fallback,s=t.mode,a=Zc({mode:`visible`,children:a.children},s),o=Mi(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,so(t,e.child,null,c),a=t.child,a.memoizedState=qc(c),a.childLanes=Jc(e,r,c),t.memoizedState=Kc,Ic(null,a)):(jo(),t.child=e.child,t.flags|=128,null);if(Oo(t),pm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,ua({value:a,source:null,stack:null})),Qc(e,t,c)}if(Ac||va(e,t,c,!1),r=(c&e.childLanes)!==0,Ac||r){if(xo.current!==null)return Qc(e,t,c);if(r=ed,r!==null&&(a=dt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Si(e,a),Rd(r,e,a),kc;return fm(o)||Xd(),Qc(e,t,c)}return fm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,$i=hm(o.nextSibling),Qi=t,ea=!0,ta=null,na=!1,e!==null&&Zi(t,e),t=Xc(t,a.children),t.flags|=134221824,t)}function el(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ga(e.return,t,n)}function tl(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Io(n)===null&&(t=e),e=e.sibling}return t}function nl(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function rl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function il(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=No.current;if(t.flags&128)return Po(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Po(t,o),i===`backwards`&&e!==null?(rl(e),jc(e,t,r,n),rl(e)):jc(e,t,r,n),r=ea?Vi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&el(e,n,t);else if(e.tag===19)el(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=tl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,rl(t)),nl(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Io(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}nl(t,!0,n,null,a,r);break;case`together`:nl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=tl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),nl(t,!1,i,n,a,r)}return t.child}function al(e,t,n){var r=t.pendingProps;return ma(t,t.type,r.value),jc(e,t,r.children,n),t.child}function ol(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ud|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(va(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ki(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ki(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function sl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ya(e)))}function cl(e,t,n){switch(t.tag){case 3:we(t,t.stateNode.containerInfo),ma(t,Da,e.memoizedState.cache),ca();break;case 27:case 5:Ee(t);break;case 4:we(t,t.stateNode.containerInfo);break;case 10:ma(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ko(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Oo(t),t.flags|=128,null;r=va(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Yc(e,t,n):(Oo(t),e=ol(e,t,n),e===null?null:e.sibling)}Oo(t);break;case 19:if(t.flags&128)return il(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(va(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return il(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Po(t,No.current),r)break;return null;case 22:return t.lanes=0,Fc(e,t,n,t.pendingProps);case 24:ma(t,Da,e.memoizedState.cache)}return ol(e,t,n)}function ll(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Ac=!0;else{if(!sl(e,n)&&!(t.flags&128))return Ac=!1,cl(e,t,n);Ac=!!(e.flags&131072)}}else Ac=!1,ea&&t.flags&1048576&&Ji(t,Vi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Za(t.elementType),t.type=e,typeof e==`function`)Oi(e)?(r=yc(e,r),t.tag=1,t=Wc(null,t,e,r,n)):(t.tag=0,t=Hc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===te){t.tag=11,t=Mc(null,t,e,r,n);break a}if(a===ne){t.tag=14,t=Nc(null,t,e,r,n);break a}if(a===M){t.tag=10,t.type=e,t=al(null,t,n);break a}}throw t=fe(e)||e,Error(i(306,t,``))}}return t;case 0:return Hc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=yc(r,t.pendingProps),Wc(e,t,r,a,n);case 3:a:{if(we(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,fo(e,t),yo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ma(t,Da,r),r!==o.cache&&_a(t,[Da],n,!0),vo(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Gc(e,t,r,n);break a}if(r!==a){a=Li(Error(i(424)),t),ua(a),t=Gc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for($i=hm(e.firstChild),Qi=t,ea=!0,ta=null,na=!0,n=co(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ca(),r===a){t=ol(e,t,n);break a}jc(e,t,r,n)}t=t.child}return t;case 26:return Vc(e,t),e===null?(n=zm(t.type,null,t.pendingProps,null))?t.memoizedState=n:ea||(t.stateNode=vp(t.type,t.pendingProps,Se.current,t)):t.memoizedState=zm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ee(t),e===null&&ea&&(r=t.stateNode=xm(t.type,t.pendingProps,Se.current),Qi=t,na=!0,a=$i,Op(t.type)?(gm=a,$i=hm(r.firstChild)):$i=a),jc(e,t,t.pendingProps.children,n),Vc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ea&&((a=r=$i)&&(r=lm(r,t.type,t.pendingProps,na),r===null?a=!1:(t.stateNode=r,Qi=t,$i=hm(r.firstChild),na=!1,a=!0)),a||ia(t)),Ee(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,yp(a,o)?r=null:s!==null&&yp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Yo(e,t,Qo,null,null,n),ph._currentValue=a),Vc(e,t),jc(e,t,r,n),t.child;case 6:return e===null&&ea&&((e=n=$i)&&(n=um(n,t.pendingProps,na),n===null?e=!1:(t.stateNode=n,Qi=t,$i=null,e=!0)),e||ia(t)),null;case 13:return Yc(e,t,n);case 4:return we(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=so(t,null,r,n):jc(e,t,r,n),t.child;case 11:return Mc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Vc(e,t),jc(e,t,r,n),t.child;case 8:return jc(e,t,t.pendingProps.children,n),t.child;case 12:return jc(e,t,t.pendingProps.children,n),t.child;case 10:return al(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,ba(t),a=xa(a),r=r(a),t.flags|=1,jc(e,t,r,n),t.child;case 14:return Nc(e,t,t.type,t.pendingProps,n);case 15:return Pc(e,t,t.type,t.pendingProps,n);case 19:return il(e,t,n);case 31:return Bc(e,t,n);case 22:return Fc(e,t,n,t.pendingProps);case 24:return ba(t),r=xa(Da),e===null?(a=Ha(),a===null&&(a=ed,o=Oa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},uo(t),ma(t,Da,a)):((e.lanes&n)!==0&&(fo(e,t),yo(t,null,null,n),vo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ma(t,Da,r),r!==a.cache&&_a(t,[Da],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ma(t,Da,r))),jc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:ea&&Yi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Vc(e,t),jc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function ul(e){e.flags|=4}function dl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?eh(t,r):eh(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(qd())e.flags|=8192;else throw Qa=Ja,Ka}}else e.flags&=-16777217}function fl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!th(t)){if(qd())e.flags|=8192;else throw Qa=Ja,Ka}}function pl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:V(),e.lanes|=t,md|=t)}function ml(e,t){if(!ea)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function hl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function gl(e,t,n){var r=t.pendingProps;switch(Xi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return hl(t),null;case 1:return hl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ha(Da),Te(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(sa(t)?ul(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,la())),hl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(ul(t),o===null?(hl(t),dl(t,a,null,r,n)):(hl(t),fl(t,o))):o?o===e.memoizedState?(hl(t),t.flags&=-16777217):(ul(t),hl(t),fl(t,o)):(e=e.memoizedProps,e!==r&&ul(t),hl(t),dl(t,a,e,r,n)),null;case 27:if(De(t),n=Se.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ul(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return hl(t),t.subtreeFlags&=-33554433,null}e=I.current,sa(t)?aa(t,e):(e=xm(a,r,n),t.stateNode=e,ul(t))}return hl(t),t.subtreeFlags&=-33554433,null;case 5:if(De(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ul(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return hl(t),t.subtreeFlags&=-33554433,null}if(o=I.current,sa(t))aa(t,o);else{var s=hp(Se.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[_t]=t,o[vt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(cp(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&ul(t)}}return hl(t),t.subtreeFlags&=-33554433,dl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ul(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Se.current,sa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Qi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[_t]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ap(e.nodeValue,n)),e||ia(t,!0)}else e=hp(e).createTextNode(r),e[_t]=t,t.stateNode=e}return hl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=sa(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[_t]=t}else ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;hl(t),e=!1}else n=la(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Mo(t),t):(Mo(t),null);if(t.flags&128)throw Error(i(558))}return hl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=sa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[_t]=t}else ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;hl(t),a=!1}else a=la(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Mo(t),t):(Mo(t),null)}return Mo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),pl(t,t.updateQueue),hl(t),null);case 4:return Te(),e===null&&Yf(t.stateNode.containerInfo),t.flags|=67108864,hl(t),null;case 10:return ha(t.type),hl(t),null;case 19:if(Fo(t),r=t.memoizedState,r===null)return hl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)ml(r,!1);else{if(ld!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Io(e),o!==null){for(t.flags|=128,ml(r,!1),e=o.updateQueue,t.updateQueue=e,pl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ai(n,e),n=n.sibling;return Po(t,No.current&1|2),ea&&qi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&R()>bd&&(t.flags|=128,a=!0,ml(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Io(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,pl(t,e),ml(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!ea)return hl(t),null}else 2*R()-r.renderingStartTime>bd&&n!==536870912&&(t.flags|=128,a=!0,ml(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=R(),e.sibling=null,o=No.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||ea?Po(t,o):(n=o,be(Eo,t),be(No,n),Do===null&&(Do=t)),ea&&qi(t,r.treeForkCount),e}return hl(t),null;case 22:case 23:return Mo(t),To(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(hl(t),t.subtreeFlags&6&&(t.flags|=8192)):hl(t),n=t.updateQueue,n!==null&&pl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ye(Va),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ha(Da),hl(t),null;case 25:return null;case 30:return t.flags|=33554432,hl(t),null}throw Error(i(156,t.tag))}function _l(e,t){switch(Xi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ha(Da),Te(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return De(t),null;case 31:if(t.memoizedState!==null){if(Mo(t),t.alternate===null)throw Error(i(340));ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Mo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Fo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Te(),null;case 10:return ha(t.type),null;case 22:case 23:return Mo(t),To(),e!==null&&ye(Va),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ha(Da),null;case 25:return null;default:return null}}function vl(e,t){switch(Xi(t),t.tag){case 3:ha(Da),Te();break;case 26:case 27:case 5:De(t);break;case 4:Te();break;case 31:t.memoizedState!==null&&Mo(t);break;case 13:Mo(t);break;case 19:Fo(t);break;case 10:ha(t.type);break;case 22:case 23:Mo(t),To(),e!==null&&ye(Va);break;case 24:ha(Da)}}function yl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){vf(t,t.return,e)}}function bl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){vf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){vf(t,t.return,e)}}function xl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{bo(t,n)}catch(t){vf(e,e.return,t)}}}function Sl(e,t,n){n.props=yc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){vf(e,t,n)}}function Cl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=fi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Bp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Vp(e);p(e.child,!1,im,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){vf(e,t,n)}}function wl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){vf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){vf(e,t,n)}else n.current=null}}function Tl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)om(e.stateNode,t[n])}function El(e){for(var t=e.return;t!==null&&(kl(t)&&om(e.stateNode,t.stateNode),!Ol(t));)t=t.return}function Dl(e){for(var t=e.return;t!==null&&(kl(t)&&sm(e.stateNode,t.stateNode),!Ol(t));)t=t.return}function Ol(e){return e.tag===5||e.tag===3||e.tag===27}function kl(e){return e&&e.tag===7&&e.stateNode!==null}function Al(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){vf(e,e.return,t)}}function jl(e,t,n){try{var r=e.stateNode;up(r,e.type,n,t),r[vt]=t}catch(t){vf(e,e.return,t)}}function Ml(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Op(e.type)||e.tag===4}function Nl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ml(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Op(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Pl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=pn)),Tl(e,r),Bt=!0;else if(i!==4&&(i===27&&(Tl(e,r),r=null,Op(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Pl(e,t,n,r),e=e.sibling;e!==null;)Pl(e,t,n,r),e=e.sibling}function Fl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Tl(e,r),Bt=!0;else if(i!==4&&(i===27&&(Tl(e,r),r=null,Op(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Fl(e,t,n,r),e=e.sibling;e!==null;)Fl(e,t,n,r),e=e.sibling}function Il(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);cp(t,r,n),t[_t]=e,t[vt]=n}catch(t){vf(e,e.return,t)}}var Ll=!1,Rl=null;function zl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Ll=!0)}var Bl=null;function Vl(){var e=Bl;return Bl=null,e}var Hl=0;function Ul(e,t,n,r,i){return Hl=0,Wl(e.child,t,n,r,i)}function Wl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Pp(o);r.push(s),s.view&&(a=!0)}else a||Pp(o).view&&(a=!0);Ll=!0,jp(o,Hl===0?t:t+`_`+Hl,n),Hl++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Wl(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function Gl(e,t){for(;e!==null;)e.tag===5?Mp(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||Gl(e.child,t),e=e.sibling}function Kl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Kl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=mi(t.default,t.share),t!==`none`&&(Ul(e,n,t,null,!1)||Gl(e.child,!1))}e=e.sibling}}function ql(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=fi(r,n),a=mi(r.default,n.paired?r.share:r.enter);a===`none`?Kl(e):Ul(e,i,a,null,!1)?(Kl(e),n.paired||t||Ld(e,r.onEnter)):Gl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ql(e,t),e=e.sibling;else Kl(e)}function Jl(e){if(Rl!==null&&Rl.size!==0){var t=Rl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=mi(n.default,n.share);if(a!==`none`&&(Ul(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Ld(e,n.onShare)):Gl(e.child,!1)),t.delete(r),t.size===0)break}}}Jl(e)}e=e.sibling}}}function Yl(e){if(e.tag===30){var t=e.memoizedProps,n=fi(t,e.stateNode),r=Rl===null?void 0:Rl.get(n),i=mi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Ul(e,n,i,null,!1)?r===void 0?Ld(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Rl.delete(n),Ld(e,t.onShare)):Gl(e.child,!1)),Rl!==null&&Jl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Yl(e),e=e.sibling;else Rl!==null&&Jl(e)}function Xl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=fi(t,e.stateNode);t=mi(t.default,t.update),e.flags&=-5,t!==`none`&&Ul(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Xl(e);e=e.sibling}}function Zl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Gl(e.child,!1))}Zl(e)}e=e.sibling}}function Ql(e){if(e.tag===30)e.stateNode.paired=null,Gl(e.child,!1),Zl(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ql(e),e=e.sibling;else Zl(e)}function $l(e){for(e=e.child;e!==null;)e.tag===30?Gl(e.child,!1):e.subtreeFlags&33554432&&$l(e),e=e.sibling}function eu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Hl<a.length){var l=a[Hl],u=Pp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&jp(c,Hl===0?n:n+`_`+Hl,i),s&&e.flags&4||(Bl===null&&(Bl=[]),Bl.push(c,Hl===0?r:r+`_`+Hl,t.memoizedProps)),Hl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:eu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function tu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=fi(n,r),a=mi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Fp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Hl=0,i=eu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Ld(e,n.onUpdate))}else e.subtreeFlags&33554432&&tu(e,t);e=e.sibling}}var nu=!1,ru=!1,iu=!1,au=!1,ou=typeof WeakSet==`function`?WeakSet:Set,su=null,cu=!1,lu=!1,uu=!1,du=!1;function fu(e,t,n){if(e=e.containerInfo,pp=Sh,e=Hr(e),Ur(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(mp={focusedElem:e,selectionRange:r},Sh=!1,n=(n&335544064)===n,su=t,t=n?9270:1024;su!==null;){if(e=su,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Yl(r[a]);if(e.alternate===null&&e.flags&2)n&&zl(e),pu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Yl(r),pu(n);continue}if(r!==null&&r.memoizedState!==null){n&&zl(e),pu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,su=r):(n&&Xl(e),pu(n))}}Rl=null}function pu(e){for(;su!==null;){var t=su,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=yc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){vf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)cm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:cm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=fi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=mi(a.default,a.update),a!==`none`&&Ul(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,su=r;break}su=t.return}}function mu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Pu(e,n),r&4&&yl(5,n);break;case 1:if(Pu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){vf(n,n.return,e)}else{var i=yc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){vf(n,n.return,e)}}}r&64&&xl(n),r&512&&Cl(n,n.return);break;case 3:if(Pu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{bo(e,t)}catch(e){vf(n,n.return,e)}}break;case 27:t===null&&r&4&&Il(n);case 26:case 5:Pu(e,n),t===null&&r&4&&Al(n),r&512&&Cl(n,n.return);break;case 12:Pu(e,n);break;case 31:Pu(e,n),r&4&&Cu(e,n);break;case 13:Pu(e,n),r&4&&wu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Sf.bind(null,n),mm(e,n))));break;case 22:if(r=n.memoizedState!==null||nu,!r){var a=t!==null&&t.memoizedState!==null||ru;t=nu,i=ru,nu=r,(ru=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Iu(e,n,r)):Pu(e,n),nu=t,ru=i}break;case 30:Pu(e,n),r&512&&Cl(n,n.return);break;case 7:r&512&&Cl(n,n.return);default:Pu(e,n)}}function hu(e,t){for(e=e.child;e!==null;)gu(e,t),e=e.sibling}function gu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){vf(e,e.return,t)}_u(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Bt=!0}catch(t){vf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Ap(s,!0):Ap(e.stateNode,!1)}catch(t){vf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&hu(e,t);break;default:hu(e,t)}}function _u(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:gu(n,r);break a;case 22:n.memoizedState===null&&_u(n,r);break a;default:_u(n,r)}}e=e.sibling}}function vu(e){var t=e.alternate;t!==null&&(e.alternate=null,vu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Tt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var yu=null,bu=!1;function xu(e,t,n){for(n=n.child;n!==null;)Su(e,t,n),n=n.sibling}function Su(e,t,n){if(Je&&typeof Je.onCommitFiberUnmount==`function`)try{Je.onCommitFiberUnmount(qe,n)}catch{}switch(n.tag){case 26:ru||wl(n,t),xu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!ru&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ru||wl(n,t),Dl(n);var r=yu,i=bu;Op(n.type)&&(yu=n.stateNode,bu=!1),xu(e,t,n),Sm(n.stateNode,n.type,n.memoizedProps),yu=r,bu=i;break;case 5:ru||wl(n,t),Dl(n);case 6:if(n.tag===6&&Dl(n),r=yu,i=bu,yu=null,xu(e,t,n),yu=r,bu=i,yu!==null){if(bu)try{(yu.nodeType===9?yu.body:yu.nodeName===`HTML`?yu.ownerDocument.body:yu).removeChild(n.stateNode),Bt=!0}catch(e){vf(n,t,e)}else try{yu.removeChild(n.stateNode),Bt=!0}catch(e){vf(n,t,e)}}break;case 18:yu!==null&&(bu?(e=yu,kp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Jh(e)):kp(yu,n.stateNode));break;case 4:r=yu,i=bu,yu=n.stateNode.containerInfo,bu=!0,xu(e,t,n),yu=r,bu=i;break;case 0:case 11:case 14:case 15:bl(2,n,t),ru||bl(4,n,t),xu(e,t,n);break;case 1:ru||(wl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Sl(n,t,r)),xu(e,t,n);break;case 21:xu(e,t,n);break;case 22:ru=(r=ru)||n.memoizedState!==null,xu(e,t,n),ru=r;break;case 30:wl(n,t),xu(e,t,n);break;case 7:ru||wl(n,t),xu(e,t,n);break;default:xu(e,t,n)}}function Cu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Jh(e)}catch(e){vf(t,t.return,e)}}}function wu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Jh(e)}catch(e){vf(t,t.return,e)}}function Tu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ou),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ou),t;default:throw Error(i(435,e.tag))}}function Eu(e,t){var n=Tu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Cf.bind(null,e,t);t.then(r,r)}})}function Du(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Op(l.type)){yu=l.stateNode,bu=!1;break a}break;case 5:yu=l.stateNode,bu=!1;break a;case 3:case 4:yu=l.stateNode.containerInfo,bu=!0;break a}l=l.return}if(yu===null)throw Error(i(160));Su(s,c,o),yu=null,bu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ku(t,e,n),t=t.sibling}var Ou=null;function ku(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Du(t,e,n),Au(e),a&4&&(bl(3,e,e.return),yl(3,e),bl(5,e,e.return));break;case 1:Du(t,e,n),Au(e),a&512&&(ru||r===null||wl(r,r.return)),a&64&&nu&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Ou,Du(t,e,n),Au(e),a&512&&(ru||r===null||wl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(nu)e.stateNode=vp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[Ct]||r[_t]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),cp(r,t,n),r[_t]=e,At(r),t=r;break a;case`link`:if(o=Zm(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),cp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Zm(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),cp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[_t]=e,At(r),t=r}e.stateNode=t}}else nu||Qm(o,e.type,e.stateNode)}else e.stateNode=Km(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&jl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||ru||t.parentNode.removeChild(t)):a.count--,n===null?nu||Qm(o,e.type,e.stateNode):Km(o,n,e.memoizedProps))}break;case 27:Du(t,e,n),Au(e),a&512&&(ru||r===null||wl(r,r.return)),r!==null&&a&4&&jl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=iu,iu=!1,Du(t,e,n),iu=o,Au(e),a&512&&(ru||r===null||wl(r,r.return)),e.flags&32){t=e.stateNode;try{an(t,``),Bt=!0}catch(t){vf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,jl(e,t,r===null?t:r.memoizedProps)),a&1024&&(au=!0);break;case 6:if(Du(t,e,n),Au(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Bt=!0}catch(t){vf(e,e.return,t)}}break;case 3:if(Bt=!1,Xm=null,o=Ou,Ou=Em(t.containerInfo),Du(t,e,n),Ou=o,Au(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Jh(t.containerInfo)}catch(t){vf(e,e.return,t)}au&&(au=!1,ju(e)),Bt=!1;break;case 4:a=iu,iu=nu,r=Vt(),o=Ou,Ou=Em(e.stateNode.containerInfo),Du(t,e,n),Au(e),Ou=o,Bt&&lu&&(uu=!0),Bt=r,iu=a;break;case 12:Du(t,e,n),Au(e);break;case 31:Du(t,e,n),Au(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eu(e,t)));break;case 13:Du(t,e,n),Au(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(vd=R()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=nu,l=ru,u=iu;nu=c||o,iu=u||o,ru=l||s,Du(t,e,n),ru=l,iu=u,nu=c,Au(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||nu||ru||(t=s||ru,n=nu,r=ru,nu=o||nu,ru=t,Fu(e,2),nu=n,ru=r),!o&&iu||hu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Eu(e,n))));break;case 19:Du(t,e,n),Au(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eu(e,t)));break;case 30:a&512&&(ru||r===null||wl(r,r.return)),a=Vt(),o=lu,s=(n&335544064)===n,c=e.memoizedProps,lu=s&&mi(c.default,c.update)!==`none`,Du(t,e,n),Au(e),s&&r!==null&&Bt&&(e.flags|=4),lu=o,Bt=a;break;case 21:break;case 7:a&512&&(ru||r===null||wl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Du(t,e,n),Au(e)}}function Au(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Ml(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(kl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Ol(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Fl(e,Nl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(an(l,``),n.flags&=-33),Fl(e,Nl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Pl(e,Nl(e),u,s);break;default:throw Error(i(161))}}catch(t){vf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ju(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ju(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Sh=!0,t.reset(),Sh=!1),e=e.sibling}}function Mu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Nu(t,e),t=t.sibling;else tu(t,!1)}function Nu(e,t){var n=e.alternate;if(n===null)ql(e,!1);else switch(e.tag){case 3:if(du=cu=!1,Vl(),Mu(t,e),!cu&&!uu){if(e=Bl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Mp(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),du=!0}Bl=null;break;case 5:Mu(t,e);break;case 4:r=cu,cu=!1,Mu(t,e),cu&&(uu=!0),cu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Mu(t,e):ql(e,!1));break;case 30:r=cu,i=Vl(),cu=!1,Mu(t,e),cu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=fi(a,o),o=fi(n.memoizedProps,o);var s=mi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Hl=0,t=eu(e,n,t,o,s,a,!0),Hl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Ld(e,e.memoizedProps.onUpdate),Bl=i):i!==null&&(i.push.apply(i,Bl),Bl=i),cu=e.flags&32?!0:r;break;default:Mu(t,e)}}function Pu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)mu(e,t.alternate,t),t=t.sibling}function Fu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:bl(4,n,n.return),Fu(n,r);break;case 1:wl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Sl(n,n.return,i),Fu(n,r);break;case 27:r&2&&Sm(n.stateNode,n.type,n.memoizedProps);case 5:wl(n,n.return),n.tag!==5&&n.tag!==27||Dl(n),Fu(n,r);break;case 6:Dl(n);break;case 26:wl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||ru||i.parentNode.removeChild(i),Fu(n,r);break;case 22:n.memoizedState===null&&Fu(n,r);break;case 30:wl(n,n.return),Fu(n,r);break;case 7:wl(n,n.return);default:Fu(n,r)}e=e.sibling}}function Iu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Iu(i,a,n),yl(4,a);break;case 1:if(Iu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){vf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)U(l[i],c)}catch(e){vf(r,r.return,e)}}s&&o&64&&xl(a),Cl(a,a.return);break;case 27:n&2&&Il(a);case 5:a.tag!==5&&a.tag!==27||El(a),Iu(i,a,n),s&&r===null&&o&4&&Al(a),Cl(a,a.return);break;case 6:El(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||nu||Qm(Em(c.ownerDocument),a.type,c),Iu(i,a,n),s&&r===null&&o&4&&Al(a),Cl(a,a.return);break;case 12:Iu(i,a,n);break;case 31:Iu(i,a,n),s&&o&4&&Cu(i,a);break;case 13:Iu(i,a,n),s&&o&4&&wu(i,a);break;case 22:a.memoizedState===null&&Iu(i,a,n),Cl(a,a.return);break;case 30:Iu(i,a,n),Cl(a,a.return);break;case 7:Cl(a,a.return);default:Iu(i,a,n)}t=t.sibling}}function Lu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ka(n))}function Ru(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ka(e))}function zu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Bu(e,t,n,r),t=t.sibling;else i&&$l(t)}function Bu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Ql(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:zu(e,t,n,r),a&2048&&yl(9,t);break;case 1:zu(e,t,n,r);break;case 3:zu(e,t,n,r),i&&du&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&ka(a)));break;case 12:if(a&2048){zu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){vf(t,t.return,e)}}else zu(e,t,n,r);break;case 31:zu(e,t,n,r);break;case 13:zu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&Ql(t),o._visibility&2?zu(e,t,n,r):(o._visibility|=2,Vu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Ql(s),o._visibility&2?zu(e,t,n,r):Hu(e,t)),a&2048&&Lu(s,t);break;case 24:zu(e,t,n,r),a&2048&&Ru(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Gl(a.child,!0),Gl(t.child,!0))),zu(e,t,n,r);break;default:zu(e,t,n,r)}}function Vu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Vu(a,o,s,c,i),yl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Vu(a,o,s,c,i)):u._visibility&2?Vu(a,o,s,c,i):Hu(a,o),i&&l&2048&&Lu(o.alternate,o);break;case 24:Vu(a,o,s,c,i),i&&l&2048&&Ru(o.alternate,o);break;default:Vu(a,o,s,c,i)}t=t.sibling}}function Hu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Hu(n,r),i&2048&&Lu(r.alternate,r);break;case 24:Hu(n,r),i&2048&&Ru(r.alternate,r);break;default:Hu(n,r)}t=t.sibling}}var Uu=8192;function Wu(e,t,n){if(e.subtreeFlags&Uu)for(e=e.child;e!==null;)Gu(e,t,n),e=e.sibling}function Gu(e,t,n){switch(e.tag){case 26:Wu(e,t,n),e.flags&Uu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&rh(n,e)):ih(n,Ou,e.memoizedState,e.memoizedProps));break;case 5:Wu(e,t,n),e.flags&Uu&&(e=e.stateNode,(t&335544128)===t&&rh(n,e));break;case 3:case 4:var r=Ou;Ou=Em(e.stateNode.containerInfo),Wu(e,t,n),Ou=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Uu,Uu=16777216,Wu(e,t,n),Uu=r):Wu(e,t,n));break;case 30:if((e.flags&Uu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Rl===null&&(Rl=new Map),Rl.set(r,i)}Wu(e,t,n);break;default:Wu(e,t,n)}}function Ku(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function qu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];su=r,Xu(r,e)}Ku(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ju(e),e=e.sibling}function Ju(e){switch(e.tag){case 0:case 11:case 15:qu(e),e.flags&2048&&bl(9,e,e.return);break;case 3:qu(e);break;case 12:qu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Yu(e)):qu(e);break;default:qu(e)}}function Yu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];su=r,Xu(r,e)}Ku(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:bl(8,t,t.return),Yu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Yu(t));break;default:Yu(t)}e=e.sibling}}function Xu(e,t){for(;su!==null;){var n=su;switch(n.tag){case 0:case 11:case 15:bl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ka(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,su=r;else a:for(n=e;su!==null;){r=su;var i=r.sibling,a=r.return;if(vu(r),r===n){su=null;break a}if(i!==null){i.return=a,su=i;break a}su=a}}}var Zu={getCacheForType:function(e){var t=xa(Da),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return xa(Da).controller.signal}},Qu=typeof WeakMap==`function`?WeakMap:Map,$u=0,ed=null,td=null,nd=0,rd=0,id=null,ad=!1,od=!1,sd=!1,cd=0,ld=0,ud=0,dd=0,fd=0,pd=0,md=0,hd=null,gd=null,_d=!1,vd=0,yd=0,bd=1/0,xd=null,Sd=null,Cd=0,wd=null,Td=null,Ed=0,Dd=0,Od=null,kd=null,Ad=null,jd=null,Md=null,Nd=0,Pd=null;function Fd(){return $u&2&&nd!==0?nd&-nd:F.T===null?mt():zf()}function Id(){if(pd===0){if(!(nd&536870912)||ea){var e=tt;tt<<=1,!(tt&3932160)&&(tt=262144),pd=e}else pd=536870912}return e=Eo.current,e!==null&&(e.flags|=32),pd}function Ld(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Bp(fi(e.memoizedProps,n))),jd===null&&(jd=[]),jd.push(t.bind(null,r))}}function Rd(e,t,n){(e===ed&&(rd===2||rd===9)||e.cancelPendingCommit!==null)&&(Gd(e,0),Hd(e,nd,pd,!1)),st(e,n),$u&2&&e===ed||(e===ed&&(!($u&2)&&(dd|=n),ld===4&&Hd(e,nd,pd,!1)),jf(e))}function zd(e,t,n){if($u&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||it(e,t),a=r?$d(e,t):Zd(e,t,!0),o=r;do{if(a===0){od&&!r&&Hd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Vd(n))a=Zd(e,t,!1),o=!1;else{if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=hd;var l=c.current.memoizedState.isDehydrated;if(l&&(Gd(c,s).flags|=256),s=Zd(c,s,!1),s!==2&&s!==6){if(sd&&!l){c.errorRecoveryDisabledLanes|=o,dd|=o,a=4;break a}o=gd,gd=a,o!==null&&(gd===null?gd=o:gd.push.apply(gd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Gd(e,0),Hd(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Hd(r,t,pd,!ad);break a;case 2:gd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=vd+300-R(),10<a)){if(Hd(r,t,pd,!ad),rt(r,0,!0)!==0)break a;Ed=t,r.timeoutHandle=Sp(Bd.bind(null,r,n,gd,xd,_d,t,pd,dd,md,ad,o,`Throttled`,-0,0),a);break a}Bd(r,n,gd,xd,_d,t,pd,dd,md,ad,o,null,-0,0)}break}}while(1);jf(e)}function Bd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:pn},Rl=null,Gu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=ch.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?vd-R():(a&4194048)===a?yd-R():0,m=oh(d,m),m!==null)?(Ed=a,e.cancelPendingCommit=m(sf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Hd(e,a,o,!l)):sf(e,t,a,n,r,i,o,s,c,l,u,d)}function Vd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Ir(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Hd(e,t,n,r){t=at(e,t),t&=~fd,t&=~dd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Xe(i),o=1<<a;r[a]=-1,i&=~o}n!==0&<(e,n,t)}function Ud(){return $u&6?!0:(Mf(0,!1),!1)}function Wd(){if(td!==null){if(rd===0)var e=td.return;else e=td,pa=fa=null,ts(e),to=null,no=0,e=td;for(;e!==null;)vl(e.alternate,e),e=e.return;td=null}}function Gd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Cp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ed=0,Wd(),ed=e,td=n=ki(e.current,null),nd=t,rd=0,id=null,ad=!1,od=it(e,t),sd=!1,md=pd=fd=dd=ud=ld=0,gd=hd=null,_d=!1,cd=at(e,t),yi(),n}function Kd(e,t){W=null,F.H=dc,t===Ga||t===qa?(t=$a(),rd=3):t===Ka?(t=$a(),rd=4):rd=t===kc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,id=t,td===null&&(ld=1,Cc(e,Li(t,e.current)))}function qd(){var e=Eo.current;return e===null?!0:(nd&4194048)===nd?Do===null:(nd&62914560)===nd||nd&536870912?e===Do:!1}function Jd(){var e=F.H;return F.H=dc,e===null?dc:e}function Yd(){var e=F.A;return F.A=Zu,e}function Xd(){ld=4,ad||(nd&4194048)!==nd&&Eo.current!==null||(od=!0),!(ud&134217727)&&!(dd&134217727)||ed===null||Hd(ed,nd,pd,!1)}function Zd(e,t,n){var r=$u;$u|=2;var i=Jd(),a=Yd();(ed!==e||nd!==t)&&(xd=null,Gd(e,t)),t=!1;var o=ld;a:do try{if(rd!==0&&td!==null){var s=td,c=id;switch(rd){case 8:Wd(),o=6;break a;case 3:case 2:case 9:case 6:Eo.current===null&&(t=!0);var l=rd;if(rd=0,id=null,rf(e,s,c,l),n&&od){o=0;break a}break;default:l=rd,rd=0,id=null,rf(e,s,c,l)}}Qd(),o=ld;break}catch(t){Kd(e,t)}while(1);return t&&e.shellSuspendCounter++,pa=fa=null,$u=r,F.H=i,F.A=a,td===null&&(ed=null,nd=0,yi()),o}function Qd(){for(;td!==null;)tf(td)}function $d(e,t){var n=$u;$u|=2;var r=Jd(),a=Yd();ed!==e||nd!==t?(xd=null,bd=R()+500,Gd(e,t)):od=it(e,t);a:do try{if(rd!==0&&td!==null){t=td;var o=id;b:switch(rd){case 1:rd=0,id=null,rf(e,t,o,1);break;case 2:case 9:if(Ya(o)){rd=0,id=null,nf(t);break}t=function(){rd!==2&&rd!==9||ed!==e||(rd=7),jf(e)},o.then(t,t);break a;case 3:rd=7;break a;case 4:rd=5;break a;case 7:Ya(o)?(rd=0,id=null,nf(t)):(rd=0,id=null,rf(e,t,o,7));break;case 5:var s=null;switch(td.tag){case 26:s=td.memoizedState;case 5:case 27:var c=td;if(s?th(s):c.stateNode.complete){rd=0,id=null;var l=c.sibling;if(l!==null)td=l;else{var u=c.return;u===null?td=null:(td=u,af(u))}break b}}rd=0,id=null,rf(e,t,o,5);break;case 6:rd=0,id=null,rf(e,t,o,6);break;case 8:Wd(),ld=6;break a;default:throw Error(i(462))}}ef();break}catch(t){Kd(e,t)}while(1);return pa=fa=null,F.H=r,F.A=a,$u=n,td===null?(ed=null,nd=0,yi(),ld):0}function ef(){for(;td!==null&&!Le();)tf(td)}function tf(e){var t=ll(e.alternate,e,cd);e.memoizedProps=e.pendingProps,t===null?af(e):td=t}function nf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Uc(n,t,t.pendingProps,t.type,void 0,nd);break;case 11:t=Uc(n,t,t.pendingProps,t.type.render,t.ref,nd);break;case 5:ts(t);var r=t;r===Qi&&(ea?(oa(r),r.tag===5&&r.stateNode!=null&&($i=r.stateNode)):(oa(r),ea=!0));default:vl(n,t),t=td=Ai(t,cd),t=ll(n,t,cd)}e.memoizedProps=e.pendingProps,t===null?af(e):td=t}function rf(e,t,n,r){pa=fa=null,ts(t),to=null,no=0;var i=t.return;try{if(Oc(e,i,t,n,nd)){ld=1,Cc(e,Li(n,e.current)),td=null;return}}catch(t){if(i!==null)throw td=i,t;ld=1,Cc(e,Li(n,e.current)),td=null;return}t.flags&32768?(ea||r===1?e=!0:od||nd&536870912?e=!1:(ad=e=!0,(r===2||r===9||r===3||r===6)&&(r=Eo.current,r!==null&&r.tag===13&&(r.flags|=16384))),of(t,e)):af(t)}function af(e){var t=e;do{if(t.flags&32768){of(t,ad);return}e=t.return;var n=gl(t.alternate,t,cd);if(n!==null){td=n;return}if(t=t.sibling,t!==null){td=t;return}td=t=e}while(t!==null);ld===0&&(ld=5)}function of(e,t){do{var n=_l(e.alternate,e);if(n!==null){n.flags&=32767,td=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){td=e;return}td=e=n}while(e!==null);ld=6,td=null}function sf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do hf();while(Cd!==0);if($u&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===ed&&(td=ed=null,nd=0),Td=t,wd=e,Ed=n,Od=a,kd=r,cf(e,t,n,s,c,l,f)}}function cf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Dd=s,s|=vi,ct(e,n,s,r,i,a),jd=null,(n&335544064)===n?(Md=Ma(e),r=10262):(Md=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,wf(He,function(){return gf(),null})):(e.callbackNode=null,e.callbackPriority=0),Ll=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=F.T,F.T=null,i=me.p,me.p=2,a=$u,$u|=4;try{fu(e,t,n)}finally{$u=a,me.p=i,F.T=r}}Cd=1,Ll?Ad=Rp(o,e.containerInfo,Md,df,ff,uf,pf,gf,lf,null,null):(df(),ff(),pf())}function lf(e){if(Cd!==0){var t=wd.onRecoverableError;t(e,{componentStack:null})}}function uf(){Cd===3&&(Cd=0,Nu(Td,wd),Cd=4)}function df(){if(Cd===1){Cd=0;var e=wd,t=Td,n=Ed,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=F.T,F.T=null;var i=me.p;me.p=2;var a=$u;$u|=4;try{lu=uu=!1,ku(t,e,n),n=mp;var o=Hr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Vr(s.ownerDocument.documentElement,s)){if(c!==null&&Ur(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Br(s,h),v=Br(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}Sh=!!pp,mp=pp=null}finally{$u=a,me.p=i,F.T=r}}e.current=t,Cd=2}}function ff(){if(Cd===2){Cd=0;var e=wd,t=Td,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=F.T,F.T=null;var r=me.p;me.p=2;var i=$u;$u|=4;try{mu(e,t.alternate,t)}finally{$u=i,me.p=r,F.T=n}}Cd=3}}function pf(){if(Cd===4||Cd===3){Cd=0;var e=Ad;Ad=null,Re();var t=wd,n=Td,r=Ed,i=kd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Cd=5:(Cd=0,Td=wd=null,mf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Sd=null),pt(r),n=n.stateNode,Je&&typeof Je.onCommitFiberRoot==`function`)try{Je.onCommitFiberRoot(qe,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=F.T,a=me.p,me.p=2,F.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{F.T=n,me.p=a}}if(i=jd,o=Md,Md=null,i!==null&&(jd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Ed&3&&hf(),jf(t),a=t.pendingLanes,r&261930&&a&42?t===Pd?Nd++:(Nd=0,Pd=t):(Nd=0,Pd=null),Mf(0,!1)}}function mf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ka(t)))}function hf(){return Ad!==null&&(Ad.skipTransition(),Ad=null),df(),ff(),pf(),gf()}function gf(){if(Cd!==5)return!1;var e=wd,t=Dd;Dd=0;var n=pt(Ed),r=F.T,a=me.p;try{me.p=32>n?32:n,F.T=null,n=Od,Od=null;var o=wd,s=Ed;if(Cd=0,Td=wd=null,Ed=0,$u&6)throw Error(i(331));var c=$u;if($u|=4,Ju(o.current),Bu(o,o.current,s,n),$u=c,Mf(0,!1),Je&&typeof Je.onPostCommitFiberRoot==`function`)try{Je.onPostCommitFiberRoot(qe,o)}catch{}return!0}finally{me.p=a,F.T=r,mf(e,t)}}function _f(e,t,n){t=Li(n,t),t=Tc(e.stateNode,t,2),e=mo(e,t,2),e!==null&&(st(e,2),jf(e))}function vf(e,t,n){if(e.tag===3)_f(e,e,n);else for(;t!==null;){if(t.tag===3){_f(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Sd===null||!Sd.has(r))){e=Li(n,e),n=Ec(2),r=mo(t,n,2),r!==null&&(Dc(n,r,t,e),st(r,2),jf(r));break}}t=t.return}}function yf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Qu;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(sd=!0,i.add(n),e=bf.bind(null,e,t,n),t.then(e,e))}function bf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ed===e&&(nd&n)===n&&(ld===4||ld===3&&(nd&62914560)===nd&&300>R()-vd?$u&2?fd|=n:Gd(e,0):fd|=n,md===nd&&(md=0)),jf(e)}function xf(e,t){t===0&&(t=V()),e=Si(e,t),e!==null&&(st(e,t),jf(e))}function Sf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),xf(e,n)}function Cf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),xf(e,n)}function wf(e,t){return Fe(e,t)}var Tf=null,Ef=null,Df=!1,Of=!1,kf=!1,Af=0;function jf(e){e!==Ef&&e.next===null&&(Ef===null?Tf=Ef=e:Ef=Ef.next=e),Of=!0,Df||(Df=!0,Rf())}function Mf(e,t){if(!kf&&Of){kf=!0;do for(var n=!1,r=Tf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Xe(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Lf(r,a))}else a=nd,a=rt(r,r===ed?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||it(r,a)||(n=!0,Lf(r,a))}r=r.next}while(n);kf=!1}}function Nf(){Pf()}function Pf(){Of=Df=!1;var e=0;Af!==0&&xp()&&(e=Af);for(var t=R(),n=null,r=Tf;r!==null;){var i=r.next,a=Ff(r,t);a===0?(r.next=null,n===null?Tf=i:n.next=i,i===null&&(Ef=n)):(n=r,(e!==0||a&3)&&(Of=!0)),r=i}Cd!==0&&Cd!==5||Mf(e,!1),Af!==0&&(Af=0)}function Ff(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Xe(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=B(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=ed,n=nd,n=rt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(rd===2||rd===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ie(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||it(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ie(r),pt(n)){case 2:case 8:n=Ve;break;case 32:n=He;break;case 268435456:n=We;break;default:n=He}return r=If.bind(null,e),n=Fe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ie(r),e.callbackPriority=2,e.callbackNode=null,2}function If(e,t){if(Cd!==0&&Cd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(hf()&&e.callbackNode!==n)return null;var r=nd;return r=rt(e,e===ed?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(zd(e,r,t),Ff(e,R()),e.callbackNode!=null&&e.callbackNode===n?If.bind(null,e):null)}function Lf(e,t){if(hf())return null;zd(e,t,!0)}function Rf(){Ep(function(){$u&6?Fe(Be,Nf):Pf()})}function zf(){if(Af===0){var e=Fa;e===0&&(e=et,et<<=1,!(et&261888)&&(et=256)),Af=e}return Af}function Bf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:fn(e)}function Vf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Bf((i[vt]||null).action),o=r.submitter;o&&(t=(t=o[vt]||null)?Bf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Pn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Af!==0){var e=new FormData(i,o);Zs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Zs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Hf=0;Hf<li.length;Hf++){var Uf=li[Hf];ui(Uf.toLowerCase(),`on`+(Uf[0].toUpperCase()+Uf.slice(1)))}ui(ti,`onAnimationEnd`),ui(ni,`onAnimationIteration`),ui(ri,`onAnimationStart`),ui(`dblclick`,`onDoubleClick`),ui(`focusin`,`onFocus`),ui(`focusout`,`onBlur`),ui(ii,`onTransitionRun`),ui(ai,`onTransitionStart`),ui(oi,`onTransitionCancel`),ui(si,`onTransitionEnd`),Ft(`onMouseEnter`,[`mouseout`,`mouseover`]),Ft(`onMouseLeave`,[`mouseout`,`mouseover`]),Ft(`onPointerEnter`,[`pointerout`,`pointerover`]),Ft(`onPointerLeave`,[`pointerout`,`pointerover`]),Pt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Pt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Pt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Pt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Pt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Pt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Wf=`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(` `),Gf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Wf));function Kf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){hi(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){hi(e)}i.currentTarget=null,a=c}}}}function G(e,t){var n=t[bt];n===void 0&&(n=t[bt]=new Set);var r=e+`__bubble`;n.has(r)||(Xf(t,e,2,!1),n.add(r))}function qf(e,t,n){var r=0;t&&(r|=4),Xf(n,e,r,t)}var Jf=`_reactListening`+Math.random().toString(36).slice(2);function Yf(e){if(!e[Jf]){e[Jf]=!0,Mt.forEach(function(t){t!==`selectionchange`&&(Gf.has(t)||qf(t,!1,e),qf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Jf]||(t[Jf]=!0,qf(`selectionchange`,!1,t))}}function Xf(e,t,n,r){switch(kh(t)){case 2:var i=Ch;break;case 8:i=wh;break;default:i=Th}n=i.bind(null,t,n,e),i=void 0,!Cn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Zf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=Et(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}bn(function(){var r=a,i=hn(n),s=[];a:{var c=ci.get(e);if(c!==void 0){var l=Pn,u=e;switch(e){case`keypress`:if(kn(n)===0)break a;case`keydown`:case`keyup`:l=Qn;break;case`focusin`:u=`focus`,l=Un;break;case`focusout`:u=`blur`,l=Un;break;case`beforeblur`:case`afterblur`:l=Un;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Vn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Hn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=tr;break;case ti:case ni:case ri:l=Wn;break;case si:l=nr;break;case`scroll`:case`scrollend`:l=In;break;case`wheel`:l=rr;break;case`copy`:case`cut`:case`paste`:l=Gn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=$n;break;case`submit`:l=er;break;case`toggle`:case`beforetoggle`:l=ir}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=xn(m,p),g!=null&&d.push(Qf(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==mn&&(u=n.relatedTarget||n.fromElement)&&(Et(u)||u[yt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Et(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Vn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=$n,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Ot(c),h=l==null?u:Ot(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Et(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?w(c,l,ep):null,c!==null&&tp(s,u,c,d,!1),l!==null&&f!==null&&tp(s,f,l,d,!0)))}a:{if(c=r?Ot(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=wr;else if(vr(c)){if(Tr)_=Pr;else{_=Mr;var v=jr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&ln(r.elementType)&&(_=wr):_=Nr;if(_&&=_(e,r)){yr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Ot(r):window,e){case`focusin`:(vr(v)||v.contentEditable===`true`)&&(Gr=v,Kr=r,qr=null);break;case`focusout`:qr=Kr=Gr=null;break;case`mousedown`:Jr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Jr=!1,Yr(s,n,i);break;case`selectionchange`:if(Wr)break;case`keydown`:case`keyup`:Yr(s,n,i)}var y;if(or)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else mr?fr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(lr&&n.locale!==`ko`&&(mr||b!==`onCompositionStart`?b===`onCompositionEnd`&&mr&&(y=On()):(Tn=i,En=`value`in Tn?Tn.value:Tn.textContent,mr=!0)),v=$f(r,b),0<v.length&&(b=new Kn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=pr(n),y!==null&&(b.data=y)))),(y=cr?hr(e,n):gr(e,n))&&(b=$f(r,`onBeforeInput`),0<b.length&&(v=new Kn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Vf(s,e,r,n,i)}Kf(s,t)})}function Qf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function $f(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=xn(e,n),i!=null&&r.unshift(Qf(e,i,a)),i=xn(e,t),i!=null&&r.push(Qf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function ep(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function tp(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=xn(n,a),l!=null&&o.unshift(Qf(n,l,c))):i||(l=xn(n,a),l!=null&&o.push(Qf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var np=/\r\n?/g,rp=/\u0000|\uFFFD/g;function ip(e){return(typeof e==`string`?e:``+e).replace(np,`
|
|
49
|
+
`).replace(rp,``)}function ap(e,t){return t=ip(t),ip(e)===t}function op(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||an(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&an(e,``+r);else return;break;case`className`:Ut(e,`class`,r);break;case`tabIndex`:Ut(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ut(e,n,r);break;case`style`:cn(e,r,o);return;case`data`:if(t!==`object`){Ut(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=fn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&op(e,t,`name`,a.name,a,null),op(e,t,`formEncType`,a.formEncType,a,null),op(e,t,`formMethod`,a.formMethod,a,null),op(e,t,`formTarget`,a.formTarget,a,null)):(op(e,t,`encType`,a.encType,a,null),op(e,t,`method`,a.method,a,null),op(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=fn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=pn);return;case`onScroll`:r!=null&&G(`scroll`,e);return;case`onScrollEnd`:r!=null&&G(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=fn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`: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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:G(`beforetoggle`,e),G(`toggle`,e),Ht(e,`popover`,r);break;case`xlinkActuate`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ht(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=un.get(n)||n,Ht(e,n,r);else return}Bt=!0}function sp(e,t,n,r,a,o){switch(n){case`style`:cn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)an(e,r);else if(typeof r==`number`||typeof r==`bigint`)an(e,``+r);else return;break;case`onScroll`:r!=null&&G(`scroll`,e);return;case`onScrollEnd`:r!=null&&G(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=pn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Nt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[vt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}Bt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ht(e,n,r)}return}Bt=!0}function cp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:G(`error`,e),G(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:op(e,t,o,s,n,null)}}a&&op(e,t,`srcSet`,n.srcSet,n,null),r&&op(e,t,`src`,n.src,n,null);return;case`input`:G(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:op(e,t,r,d,n,null)}}$t(e,o,c,l,u,s,a,!1);return;case`select`:for(a in G(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:op(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&tn(e,!!r,n,!0):tn(e,!!r,t,!1);return;case`textarea`:for(s in G(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:op(e,t,s,c,n,null)}rn(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:op(e,t,l,r,n,null)}return;case`dialog`:G(`beforetoggle`,e),G(`toggle`,e),G(`cancel`,e),G(`close`,e);break;case`iframe`:case`object`:G(`load`,e);break;case`video`:case`audio`:for(r=0;r<Wf.length;r++)G(Wf[r],e);break;case`image`:G(`error`,e),G(`load`,e);break;case`details`:G(`toggle`,e);break;case`embed`:case`source`:case`link`:G(`error`,e),G(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:op(e,t,u,r,n,null)}return;default:if(ln(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&sp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&op(e,t,c,r,n,null))}var lp={};function up(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||op(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(Bt=!0),o=m;break;case`name`:m!==f&&(Bt=!0),a=m;break;case`checked`:m!==f&&(Bt=!0),u=m;break;case`defaultChecked`:m!==f&&(Bt=!0),d=m;break;case`value`:m!==f&&(Bt=!0),s=m;break;case`defaultValue`:m!==f&&(Bt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&op(e,t,p,m,r,f)}}Qt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||op(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(Bt=!0),p=o;break;case`defaultValue`:o!==l&&(Bt=!0),c=o;break;case`multiple`:o!==l&&(Bt=!0),s=o;default:o!==l&&op(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?tn(e,!!n,n?[]:``,!1):tn(e,!!n,t,!0)):tn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:op(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(Bt=!0),p=a;break;case`defaultValue`:a!==o&&(Bt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&op(e,t,s,a,r,o)}nn(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:op(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(Bt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:op(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&op(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:op(e,t,u,p,r,m)}return;default:if(ln(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&sp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||sp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&op(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||op(e,t,f,p,r,m)}function dp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function fp(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&dp(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&dp(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var pp=null,mp=null;function hp(e){return e.nodeType===9?e:e.ownerDocument}function gp(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function _p(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function vp(e,t,n,r){return n=hp(n).createElement(e),n[_t]=r,n[vt]=t,cp(n,e,t),At(n),n}function yp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var bp=null;function xp(){var e=window.event;return e&&e.type===`popstate`?e!==bp&&(bp=e,!0):(bp=null,!1)}var Sp=typeof setTimeout==`function`?setTimeout:void 0,Cp=typeof clearTimeout==`function`?clearTimeout:void 0,wp=typeof Promise==`function`?Promise:void 0,Tp=typeof requestAnimationFrame==`function`?requestAnimationFrame:Sp,Ep=typeof queueMicrotask==`function`?queueMicrotask:wp===void 0?Sp:function(e){return wp.resolve(null).then(e).catch(Dp)};function Dp(e){setTimeout(function(){throw e})}function Op(e){return e===`head`}function kp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Jh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Cm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Cm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Ct]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Cm(e.ownerDocument.body)}n=i}while(n);Jh(t)}function Ap(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function jp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Mp(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Np(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Pp(e){return Np(e.getBoundingClientRect(),getComputedStyle(e),e)}function Fp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Np(t,n,e)}function Ip(e){return e.documentElement.clientHeight}function Lp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Rp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ip(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=nh(f),u>ah){s.length=o;break}f=new Promise(Lp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function zp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}zp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},zp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},zp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Bp(e){return{name:e,group:new zp(`group`,e),imagePair:new zp(`image-pair`,e),old:new zp(`old`,e),new:new zp(`new`,e)}}function Vp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Vp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Kp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Wp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),p(this._fragmentFiber.child,!1,Hp,e,s,r)}this._eventListeners=a}};function Hp(e,t,n,r){return v(e).addEventListener(t,n,r),!1}Vp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Kp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Wp(i.optionsOrUseCapture),p(this._fragmentFiber.child,!1,Up,e,n,i),r.splice(t,1),a!==null&&a()}};function Up(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function Wp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Gp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Kp(e,t,n,r){if(e.length===0)return-1;r=Gp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Gp(a.optionsOrUseCapture)===r)return i}return-1}Vp.prototype.dispatchEvent=function(e){var t=m(this._fragmentFiber);if(t===null)return!0;t=v(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Wp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Wp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Vp.prototype.focus=function(e){p(this._fragmentFiber.child,!0,qp,e,void 0,void 0)};function qp(e,t){return e.tag!==6&&(e=v(e),ym(e,t))}Vp.prototype.focusLast=function(e){var t=[];p(this._fragmentFiber.child,!0,Jp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!qp(t[n],e);n--);};function Jp(e,t){return t.push(e),!1}Vp.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=hp(e).activeElement,e!==null&&p(this._fragmentFiber.child,!1,Yp,e,void 0,void 0))};function Yp(e,t){return e.tag!==6&&(e=v(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Vp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),p(this._fragmentFiber.child,!1,Xp,e,void 0,void 0)};function Xp(e,t){return e.tag===6||(e=v(e),t.observe(e)),!1}Vp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),p(this._fragmentFiber.child,!1,Zp,e,void 0,void 0);for(var n=t=0;n<Qp.length;n++){var r=Qp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Qp[t++]=r}Qp.length=t}};function Zp(e,t){return e.tag===6||(e=v(e),t.unobserve(e)),!1}var Qp=[],$p=!1;function em(e,t,n){Qp.push({fragmentInstance:e,observer:t,instance:n}),$p||($p=!0,bm(function(){$p=!1;var e=Qp;Qp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Vp.prototype.getClientRects=function(){var e=[];return p(this._fragmentFiber.child,!1,tm,e,void 0,void 0),e};function tm(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=v(e),t.push.apply(t,e.getClientRects());return!1}Vp.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},Vp.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];p(this._fragmentFiber.child,!1,Jp,n,void 0,void 0);var r=v(t);if(n.length===0){if(n=r,h(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=g(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=v(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=v(n[0]),i=v(n[n.length-1]);var a=h(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||nm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function nm(e,t,n,r,i){var a=Et(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=m(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=w(n,a,C),t===null?t=!1:(p(t,!0,x,a,n),a=y,y=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=w(r,a,C),t===null?t=!1:(p(t,!0,S,a,r),a=y,b=y=null,t=a!==null)),t):!1}function rm(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Vp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];p(this._fragmentFiber.child,!1,Jp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=g(this._fragmentFiber);if(r=n?r[1]||r[0]||m(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=v(r),rm(e,n);return}if(r=v(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=v(a),rm(a,n)):v(a).scrollIntoView(e),r+=n?-1:1}};function im(e,t){return e=v(e),am(e,t),!1}function am(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function om(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Wp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Qp.length;i++){var a=Qp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Qp[r++]=a)}Qp.length=r,n.observe(e)}),am(e,t))}function sm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Wp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?em(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function cm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:cm(n),Tt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function lm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[Ct])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=hm(e.nextSibling),e===null)break}return null}function um(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=hm(e.nextSibling),e===null))return null;return e}function dm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=hm(e.nextSibling),e===null))return null;return e}function fm(e){return e.data===`$?`||e.data===`$~`}function pm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function mm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function hm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var gm=null;function _m(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return hm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function vm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ym(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function bm(e){Tp(function(){Tp(function(t){return e(t)})})}function xm(e,t,n){switch(t=hp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Sm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&op(e,t,r,null,lp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===pn&&(e.onclick=null),Tt(e)}function Cm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Tt(e)}var wm=new Map,Tm=new Set;function Em(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Dm=me.d;me.d={f:Om,r:km,D:Mm,C:Nm,L:Pm,m:Fm,X:Lm,S:Im,M:Rm};function Om(){var e=Dm.f(),t=Ud();return e||t}function km(e){var t=Dt(e);t!==null&&t.tag===5&&t.type===`form`?$s(t):Dm.r(e)}var Am=typeof document>`u`?null:document;function jm(e,t,n){var r=Am;if(r&&typeof t==`string`&&t){var i=Zt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Tm.has(i)||(Tm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),cp(t,`link`,e),At(t),r.head.appendChild(t)))}}function Mm(e){Dm.D(e),jm(`dns-prefetch`,e,null)}function Nm(e,t){Dm.C(e,t),jm(`preconnect`,e,t)}function Pm(e,t,n){Dm.L(e,t,n);var r=Am;if(r&&e&&t){var i=`link[rel="preload"][as="`+Zt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Zt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Zt(n.imageSizes)+`"]`)):i+=`[href="`+Zt(e)+`"]`;var a=i;switch(t){case`style`:a=Bm(e);break;case`script`:a=Wm(e)}if(!(wm.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),wm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Vm(a))||t===`script`&&r.querySelector(Gm(a))))){var o=r.createElement(`link`);cp(o,`link`,e),t===`style`&&(o[wt]=!0,o.onload=o.onerror=function(){jt(o)}),At(o),r.head.appendChild(o)}}}function Fm(e,t){Dm.m(e,t);var n=Am;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Zt(r)+`"][href="`+Zt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Wm(e)}if(!wm.has(a)&&(e=T({rel:`modulepreload`,href:e},t),wm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Gm(a)))return}r=n.createElement(`link`),cp(r,`link`,e),At(r),n.head.appendChild(r)}}}function Im(e,t,n){Dm.S(e,t,n);var r=Am;if(r&&e){var i=kt(r).hoistableStyles,a=Bm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Vm(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=wm.get(a))&&Jm(e,n);var c=o=r.createElement(`link`);At(c),cp(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,qm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Lm(e,t){Dm.X(e,t);var n=Am;if(n&&e){var r=kt(n).hoistableScripts,i=Wm(e),a=r.get(i);a||(a=n.querySelector(Gm(i)),a||(e=T({src:e,async:!0},t),(t=wm.get(i))&&Ym(e,t),a=n.createElement(`script`),At(a),cp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Rm(e,t){Dm.M(e,t);var n=Am;if(n&&e){var r=kt(n).hoistableScripts,i=Wm(e),a=r.get(i);a||(a=n.querySelector(Gm(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=wm.get(i))&&Ym(e,t),a=n.createElement(`script`),At(a),cp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function zm(e,t,n,r){var a=(a=Se.current)?Em(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Bm(n.href),t=kt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Bm(n.href);var o=kt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Vm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=wm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},wm.set(e,o)),Um(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Wm(n),t=kt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Bm(e){return`href="`+Zt(e)+`"`}function Vm(e){return`link[rel="stylesheet"][`+e+`]`}function Hm(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Um(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[wt]){r.loading=1;return}}else t=e.createElement(`link`),t[wt]=!0,t.onload=t.onerror=jt.bind(null,t),cp(t,`link`,n),At(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Wm(e){return`[src="`+Zt(e)+`"]`}function Gm(e){return`script[async]`+e}function Km(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Zt(n.href)+`"]`);if(r)return t.instance=r,At(r),r;var a=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),At(r),cp(r,`style`,a),qm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Bm(n.href);var o=e.querySelector(Vm(a));if(o)return t.state.loading|=4,t.instance=o,At(o),o;r=Hm(n),(a=wm.get(a))&&Jm(r,a),o=(e.ownerDocument||e).createElement(`link`),At(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),cp(o,`link`,r),t.state.loading|=4,qm(o,n.precedence,e),t.instance=o;case`script`:return o=Wm(n.src),(a=e.querySelector(Gm(o)))?(t.instance=a,At(a),a):(r=n,(a=wm.get(o))&&(r=T({},n),Ym(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),At(a),cp(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,qm(r,n.precedence,e));return t.instance}function qm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Jm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Ym(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Xm=null;function Zm(e,t,n){if(Xm===null){var r=new Map,i=Xm=new Map;i.set(n,r)}else i=Xm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Ct]||a[_t]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Qm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function $m(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function eh(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function th(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function nh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function rh(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=nh(t),e.suspenseyImages.push(t)),e=lh.bind(e),t.decode().then(e,e))}function ih(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Bm(r.href),a=t.querySelector(Vm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ch.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,At(a);return}a=t.ownerDocument||t,r=Hm(r),(i=wm.get(i))&&Jm(r,i),a=a.createElement(`link`),At(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),cp(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ch.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ah=0;function oh(e,t){return e.stylesheets&&e.count===0&&dh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&dh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ah===0&&(ah=62500*fp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&dh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ah?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function sh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)dh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ch(){this.count--,sh(this)}function lh(){this.imgCount--,sh(this)}var uh=null;function dh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,uh=new Map,t.forEach(fh,e),uh=null,ch.call(e))}function fh(e,t){if(!(t.state.loading&4)){var n=uh.get(e);if(n)var r=n.get(null);else{n=new Map,uh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=ch.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var ph={$$typeof:M,Provider:null,Consumer:null,_currentValue:he,_currentValue2:he,_threadCount:0};function mh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,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=ot(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ot(0),this.hiddenUpdates=ot(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function hh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new mh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Di(3,null,null,t),e.current=a,a.stateNode=e,t=Oa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},uo(a),e}function gh(e){return e?(e=Ti,e):Ti}function _h(e,t,n,r,i,a){i=gh(i),r.context===null?r.context=i:r.pendingContext=i,r=po(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=mo(e,r,t),n!==null&&(Rd(n,e,t),ho(n,e,t))}function vh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function yh(e,t){vh(e,t),(e=e.alternate)&&vh(e,t)}function bh(e){if(e.tag===13||e.tag===31){var t=Si(e,67108864);t!==null&&Rd(t,e,67108864),yh(e,67108864)}}function xh(e){if(e.tag===13||e.tag===31){var t=Fd();t=ft(t);var n=Si(e,t);n!==null&&Rd(n,e,t),yh(e,t)}}var Sh=!0;function Ch(e,t,n,r){var i=F.T;F.T=null;var a=me.p;try{me.p=2,Th(e,t,n,r)}finally{me.p=a,F.T=i}}function wh(e,t,n,r){var i=F.T;F.T=null;var a=me.p;try{me.p=8,Th(e,t,n,r)}finally{me.p=a,F.T=i}}function Th(e,t,n,r){if(Sh){var i=Eh(r);if(i===null)Zf(e,t,r,Dh,n),Rh(e,r);else if(Bh(i,e,t,n,r))r.stopPropagation();else if(Rh(e,r),t&4&&-1<Lh.indexOf(e)){for(;i!==null;){var a=Dt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=z(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Xe(o);s.entanglements[1]|=c,o&=~c}jf(a),!($u&6)&&(bd=R()+500,Mf(0,!1))}}break;case 31:case 13:s=Si(a,2),s!==null&&Rd(s,a,2),Ud(),yh(a,2)}if(a=Eh(r),a===null&&Zf(e,t,r,Dh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Zf(e,t,r,null,n)}}function Eh(e){return e=hn(e),Oh(e)}var Dh=null;function Oh(e){if(Dh=null,e=Et(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Dh=e,null}function kh(e){switch(e){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`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`fullscreenerror`: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`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(ze()){case Be:return 2;case Ve:return 8;case He:case Ue:return 32;case We:return 268435456;default:return 32}default:return 32}}var Ah=!1,jh=null,Mh=null,Nh=null,Ph=new Map,Fh=new Map,Ih=[],Lh=`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 Rh(e,t){switch(e){case`focusin`:case`focusout`:jh=null;break;case`dragenter`:case`dragleave`:Mh=null;break;case`mouseover`:case`mouseout`:Nh=null;break;case`pointerover`:case`pointerout`:Ph.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Fh.delete(t.pointerId)}}function zh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Dt(t),t!==null&&bh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Bh(e,t,n,r,i){switch(t){case`focusin`:return jh=zh(jh,e,t,n,r,i),!0;case`dragenter`:return Mh=zh(Mh,e,t,n,r,i),!0;case`mouseover`:return Nh=zh(Nh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Ph.set(a,zh(Ph.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Fh.set(a,zh(Fh.get(a)||null,e,t,n,r,i)),!0}return!1}function Vh(e){var t=Et(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,ht(e.priority,function(){xh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ht(e.priority,function(){xh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Hh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Eh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);mn=r,n.target.dispatchEvent(r),mn=null}else return t=Dt(n),t!==null&&bh(t),e.blockedOn=n,!1;t.shift()}return!0}function Uh(e,t,n){Hh(e)&&n.delete(t)}function Wh(){Ah=!1,jh!==null&&Hh(jh)&&(jh=null),Mh!==null&&Hh(Mh)&&(Mh=null),Nh!==null&&Hh(Nh)&&(Nh=null),Ph.forEach(Uh),Fh.forEach(Uh)}function Gh(e,n){e.blockedOn===n&&(e.blockedOn=null,Ah||(Ah=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Wh)))}var Kh=null;function qh(e){Kh!==e&&(Kh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Kh===e&&(Kh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Oh(r||n)===null)continue;break}var a=Dt(n);a!==null&&(e.splice(t,3),t-=3,Zs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Jh(e){function t(t){return Gh(t,e)}jh!==null&&Gh(jh,e),Mh!==null&&Gh(Mh,e),Nh!==null&&Gh(Nh,e),Ph.forEach(t),Fh.forEach(t);for(var n=0;n<Ih.length;n++){var r=Ih[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ih.length&&(n=Ih[0],n.blockedOn===null);)Vh(n),n.blockedOn===null&&Ih.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[vt]||null;if(typeof a==`function`)o||qh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[vt]||null)s=o.formAction;else if(Oh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),qh(n)}}}function Yh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Xh(e){this._internalRoot=e}Zh.prototype.render=Xh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;_h(n,Fd(),e,t,null,null)},Zh.prototype.unmount=Xh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;_h(e.current,2,null,e,null,null),Ud(),t[yt]=null}};function Zh(e){this._internalRoot=e}Zh.prototype.unstable_scheduleHydration=function(e){if(e){var t=mt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ih.length&&t!==0&&t<Ih[n].priority;n++);Ih.splice(n,0,e),n===0&&Vh(e)}};var Qh=n.version;if(Qh!==`19.3.1`)throw Error(i(527,Qh,`19.3.1`));me.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var $h={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:F,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var eg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!eg.isDisabled&&eg.supportsFiber)try{qe=eg.inject($h),Je=eg}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=bc,s=xc,c=Sc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=hh(e,1,!1,null,null,n,r,null,o,s,c,Yh),e[yt]=t.current,Yf(e),new Xh(t)}})),tN=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=eN()}))();function nN(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var rN=e=>{switch(e){case`success`:return oN;case`info`:return cN;case`warning`:return sN;case`error`:return lN;default:return null}},iN=Array(12).fill(0),aN=({visible:e,className:t})=>B.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},B.createElement(`div`,{className:`sonner-spinner`},iN.map((e,t)=>B.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),oN=B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},B.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),sN=B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},B.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),cN=B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},B.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),lN=B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},B.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),uN=B.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`},B.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),B.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),dN=()=>{let[e,t]=B.useState(document.hidden);return B.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e},fN=1,pN=100,mN=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:fN++,hN=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-pN;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=mN(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],B.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(_N(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!B.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!B.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!B.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!B.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=mN(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}},gN=(e,t)=>hN.message(e,t),_N=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,vN=Object.assign(gN,{success:hN.success,info:hN.info,warning:hN.warning,error:hN.error,custom:hN.custom,message:hN.message,promise:hN.promise,dismiss:hN.dismiss,loading:hN.loading},{getHistory:()=>hN.toasts,getToasts:()=>hN.getActiveToasts()});nN(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function yN(e){return e.label!==void 0}var bN=3,xN=`24px`,SN=`16px`,CN=4e3,wN=356,TN=14,EN=45,DN=200;function ON(...e){return e.filter(Boolean).join(` `)}function kN(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var AN=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:x,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,D]=B.useState(null),[O,k]=B.useState(null),[A,ee]=B.useState(!1),[j,M]=B.useState(!1),[te,N]=B.useState(!1),[P,ne]=B.useState(!1),[re,ie]=B.useState(!1),[ae,oe]=B.useState(0),[se,ce]=B.useState(0),le=B.useRef(n.duration||y||CN),ue=B.useRef(null),de=B.useRef(null),fe=c===0,pe=c+1<=o,F=n.type,me=F??`default`,he=n.dismissible!==!1,ge=n.className||``,_e=n.descriptionClassName||``,ve=B.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),ye=B.useMemo(()=>n.closeButton??p,[n.closeButton,p]),be=B.useMemo(()=>n.duration||y||CN,[n.duration,y]),I=B.useRef(0),xe=B.useRef(0),Se=B.useRef(0),Ce=B.useRef(null),[we,Te]=b.split(`-`),Ee=B.useMemo(()=>s.reduce((e,t,n)=>n>=ve?e:e+t.height,0),[s,ve]),De=dN(),Oe=B.useMemo(()=>e.swipeDirections??kN(b),[e.swipeDirections,b]),ke=n.invert||t,Ae=F===`loading`;xe.current=B.useMemo(()=>ve*x+Ee,[ve,Ee]),B.useEffect(()=>{le.current=be},[be]),B.useEffect(()=>{ee(!0)},[]),B.useEffect(()=>{let e=de.current;if(e){let t=e.getBoundingClientRect().height;return ce(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),B.useLayoutEffect(()=>{if(!A)return;let e=de.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,ce(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[A,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let je=B.useCallback(()=>{M(!0),oe(xe.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},DN)},[n,d,a,xe]);B.useEffect(()=>{if(n.promise&&F===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||De?(()=>{if(Se.current<I.current){let e=new Date().getTime()-I.current;le.current-=e}Se.current=new Date().getTime()})():le.current!==1/0&&(I.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),je()},le.current)),()=>clearTimeout(e)},[u,i,n,F,De,je]),B.useEffect(()=>{n.delete&&(je(),n.onDismiss==null||n.onDismiss.call(n,n))},[je,n.delete]);function L(){return w?.loading?B.createElement(`div`,{className:ON(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":F===`loading`},w.loading):B.createElement(aN,{className:ON(C?.loader,n?.classNames?.loader),visible:F===`loading`})}let Me=n.icon||w?.[F]||rN(F);return B.createElement(`li`,{tabIndex:0,ref:de,className:ON(_,ge,C?.toast,n?.classNames?.toast,C?.[me],n?.classNames?.[me]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":A,"data-promise":!!n.promise,"data-swiped":re,"data-removed":j,"data-visible":pe,"data-y-position":we,"data-x-position":Te,"data-index":c,"data-front":fe,"data-swiping":te,"data-dismissible":he,"data-type":F,"data-invert":ke,"data-swipe-out":P,"data-swipe-direction":O,"data-expanded":!!(u||S&&A),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${j?ae:xe.current}px`,"--initial-height":S?`auto`:`${se}px`,...m,...n.style},onDragEnd:()=>{N(!1),D(null),Ce.current=null},onPointerDown:e=>{e.button!==2&&!Ae&&he&&(ue.current=new Date,oe(xe.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(N(!0),Ce.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{if(P||!he)return;Ce.current=null;let e=Number(de.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(de.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-ue.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if((E===`x`?Oe.includes(e>0?`right`:`left`):Oe.includes(t>0?`bottom`:`top`))&&(Math.abs(i)>=EN||a>.11))oe(xe.current),n.onDismiss==null||n.onDismiss.call(n,n),k(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),je(),ne(!0);else{var o,s;(o=de.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=de.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),ie(!1),N(!1),D(null)}},onPointerMove:e=>{var t,n;if(!Ce.current||!he||window.getSelection()?.toString().length>0)return;let r=e.clientY-Ce.current.y,i=e.clientX-Ce.current.x;!E&&(Math.abs(i)>1||Math.abs(r)>1)&&D(Math.abs(i)>Math.abs(r)?`x`:`y`);let a={x:0,y:0},o=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(Oe.includes(`top`)||Oe.includes(`bottom`)){if(Oe.includes(`top`)&&r<0||Oe.includes(`bottom`)&&r>0)a.y=r;else{let e=r*o(r);a.y=Math.abs(e)<Math.abs(r)?e:r}}}else if(E===`x`&&(Oe.includes(`left`)||Oe.includes(`right`))){if(Oe.includes(`left`)&&i<0||Oe.includes(`right`)&&i>0)a.x=i;else{let e=i*o(i);a.x=Math.abs(e)<Math.abs(i)?e:i}}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&ie(!0),(t=de.current)==null||t.style.setProperty(`--swipe-amount-x`,`${a.x}px`),(n=de.current)==null||n.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}},ye&&!n.jsx&&F!==`loading`?B.createElement(`button`,{"aria-label":T,"data-disabled":Ae,"data-close-button":!0,onClick:Ae||!he?()=>{}:()=>{je(),n.onDismiss==null||n.onDismiss.call(n,n)},className:ON(C?.closeButton,n?.classNames?.closeButton)},w?.close??uN):null,(F||n.icon||n.promise)&&n.icon!==null&&(w?.[F]!==null||n.icon)?B.createElement(`div`,{"data-icon":``,className:ON(C?.icon,n?.classNames?.icon)},F===`loading`?n.icon||L():n.promise?L():null,F===`loading`?null:Me):null,B.createElement(`div`,{"data-content":``,className:ON(C?.content,n?.classNames?.content)},B.createElement(`div`,{"data-title":``,className:ON(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?B.createElement(`div`,{"data-description":``,className:ON(v,_e,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),B.isValidElement(n.cancel)?n.cancel:n.cancel&&yN(n.cancel)?B.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{yN(n.cancel)&&he&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),je())},className:ON(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,B.isValidElement(n.action)?n.action:n.action&&yN(n.action)?B.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{yN(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),e.defaultPrevented||je())},className:ON(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function jN(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function MN(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?SN:xN;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var NN=B.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=bN,toastOptions:g,dir:_=jN(),gap:v=TN,icons:y,customAriaLabel:b,containerAriaLabel:x=`Notifications`}=e,[S,C]=B.useState([]),w=B.useMemo(()=>n?S.filter(e=>e.toasterId===n):S.filter(e=>!e.toasterId),[S,n]),T=B.useMemo(()=>Array.from(new Set([i].concat(w.filter(e=>e.position).map(e=>e.position)))),[w,i]),[E,D]=B.useState([]),[O,k]=B.useState(!1),[A,ee]=B.useState(!1),[j,M]=B.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),te=B.useRef(null),N=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),P=B.useRef(null),ne=B.useRef(!1),re=B.useCallback(e=>{C(t=>(t.find(t=>t.id===e.id)?.delete||hN.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return B.useEffect(()=>hN.subscribe(e=>{e.dismiss?requestAnimationFrame(()=>{C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))}):setTimeout(()=>{Ry.flushSync(()=>{C(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),B.useEffect(()=>{if(d!==`system`){M(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?M(`dark`):M(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{M(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{M(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),B.useEffect(()=>{S.length<=1&&k(!1)},[S]),B.useEffect(()=>{let e=e=>{if(a.length>0&&a.every(t=>e[t]||e.code===t)){var t;k(!0),(t=te.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===te.current||te.current?.contains(document.activeElement))&&k(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),B.useEffect(()=>{if(te.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,ne.current=!1)}},[te.current]),B.createElement(`section`,{ref:t,"aria-label":b??`${x} ${N}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},T.map((t,n)=>{let[i,a]=t.split(`-`);return w.length?B.createElement(`ol`,{key:t,dir:_===`auto`?jN():_,tabIndex:-1,ref:te,className:c,"data-sonner-toaster":!0,"data-sonner-theme":j,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${E[0]?.height||0}px`,"--width":`${wN}px`,"--gap":`${v}px`,...m,...MN(l,u)},onBlur:e=>{ne.current&&!e.currentTarget.contains(e.relatedTarget)&&(ne.current=!1,P.current&&=(P.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||ne.current||(ne.current=!0,P.current=e.relatedTarget)},onMouseEnter:()=>k(!0),onMouseMove:()=>k(!0),onMouseLeave:()=>{A||k(!1)},onDragEnd:()=>k(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||ee(!0)},onPointerUp:()=>ee(!1)},w.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>B.createElement(AN,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:A,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:re,toasts:w.filter(e=>e.position==n.position),heights:E.filter(e=>e.position==n.position),setHeights:D,expandByDefault:o,gap:v,expanded:O,swipeDirections:e.swipeDirections}))):null}))}),PN=class extends Error{status;code;issues;constructor(e,t,n,r=[]){super(n),this.name=`ApiError`,this.status=e,this.code=t,this.issues=r}},FN=()=>{};function IN(e){FN=e}async function Q(e,t,n,r){let i;try{i=await fetch(`/api/panel${t}`,{method:e,signal:r,credentials:`same-origin`,headers:n===void 0?void 0:{"Content-Type":`application/json`},body:n===void 0?void 0:JSON.stringify(n)})}catch{throw new PN(0,`network`,`无法连接到 AsaBot,请确认服务正在运行`)}if(i.status===401&&t!==`/login`&&t!==`/setup`&&FN(),!i.ok){let e=(await i.json().catch(()=>null))?.error;throw new PN(i.status,e?.code??`http`,e?.message??`请求失败(HTTP ${i.status})`,e?.issues)}if(i.status!==204)return await i.json()}var LN=encodeURIComponent,$={session:()=>Q(`GET`,`/session`),setup:e=>Q(`POST`,`/setup`,e),login:e=>Q(`POST`,`/login`,{password:e}),logout:()=>Q(`POST`,`/logout`,{}),overview:()=>Q(`GET`,`/overview`),tasks:e=>Q(`GET`,`/tasks?${new URLSearchParams(e)}`),task:e=>Q(`GET`,`/tasks/${LN(e)}`),taskAttempts:e=>Q(`GET`,`/tasks/${LN(e)}/attempts`),taskAction:(e,t,n=!1)=>Q(`POST`,`/tasks/${LN(e)}/${t}${n?`?confirmDelivery=1`:``}`,{}),stats:e=>Q(`GET`,`/stats/messages?range=${e}`),bots:()=>Q(`GET`,`/bots`),bot:e=>Q(`GET`,`/bots/${LN(e.platform)}/${LN(e.selfId)}`),botAlias:(e,t)=>Q(`PUT`,`/bots/${LN(e.platform)}/${LN(e.selfId)}/alias`,{alias:t}),botAdmins:(e,t)=>Q(`PUT`,`/bots/${LN(e.platform)}/${LN(e.selfId)}/admins`,{admins:t}),botPlugin:(e,t,n)=>Q(`PUT`,`/bots/${LN(e.platform)}/${LN(e.selfId)}/plugins/${LN(t)}`,n),pluginBots:e=>Q(`GET`,`/plugins/${LN(e)}/bots`),adapters:()=>Q(`GET`,`/adapters`),connections:()=>Q(`GET`,`/connections`),saveConnection:(e,t=!1)=>t?Q(`POST`,`/connections`,e):Q(`PUT`,`/connections/${LN(e.id)}`,{name:e.name,adapter:e.adapter,enabled:e.enabled,config:e.config}),deleteConnection:e=>Q(`DELETE`,`/connections/${LN(e)}`,{}),reconnect:e=>Q(`POST`,`/connections/${LN(e)}/reconnect`,{}),startConnectionSetup:(e,t)=>Q(`POST`,`/connection-setups`,{adapter:e,connectionId:t}),connectionSetup:(e,t)=>Q(`GET`,`/connection-setups/${LN(e)}`,void 0,t),verifyConnectionSetup:(e,t)=>Q(`POST`,`/connection-setups/${LN(e)}/verify`,{code:t}),saveConnectionSetup:(e,t)=>Q(`POST`,`/connection-setups/${LN(e)}/save`,t),cancelConnectionSetup:e=>Q(`DELETE`,`/connection-setups/${LN(e)}`,{}),botGroups:e=>Q(`GET`,`/bots/${LN(e.platform)}/${LN(e.selfId)}/groups`),send:e=>Q(`POST`,`/send`,e),groups:(e=!1)=>Q(`GET`,`/groups${e?`?refresh=1`:``}`),group:e=>Q(`GET`,`/groups/${LN(e)}`),plugins:()=>Q(`GET`,`/plugins`),pluginCatalog:e=>Q(`GET`,`/plugin-catalog`,void 0,e),pluginReadme:e=>Q(`GET`,`/plugins/${LN(e)}/readme`),pluginCredentials:e=>Q(`GET`,`/plugins/${LN(e)}/credentials`),createPluginCredential:(e,t)=>Q(`POST`,`/plugins/${LN(e)}/credentials`,t),revealPluginCredential:(e,t,n)=>Q(`POST`,`/plugins/${LN(e)}/credentials/${LN(t)}/reveal`,{},n),revokePluginCredential:(e,t)=>Q(`DELETE`,`/plugins/${LN(e)}/credentials/${LN(t)}`,{}),pluginAction:(e,t)=>Q(`POST`,`/plugins/${LN(e)}/${t}`,{}),pluginBotDefault:(e,t)=>Q(`PUT`,`/plugins/${LN(e)}/bot-default`,{defaultOnNewBots:t}),pluginConfig:(e,t)=>Q(`PUT`,`/plugins/${LN(e)}/config`,{config:t}),pluginGroups:e=>Q(`GET`,`/plugins/${LN(e)}/groups`),setPluginGroup:(e,t,n)=>Q(`PUT`,`/plugins/${LN(e)}/groups/${LN(t)}`,n),rescanPlugins:()=>Q(`POST`,`/plugins/rescan`,{}),uploadPlugin:e=>Q(`POST`,`/plugins/upload`,e),uninstallPlugin:(e,t)=>Q(`POST`,`/plugins/${LN(e)}/uninstall`,{purge:t}),searchPackages:(e,t,n=0)=>Q(`GET`,`/packages/search?q=${LN(e)}&sort=${t}&from=${n}`),packageInfo:e=>Q(`GET`,`/packages/info?name=${LN(e)}`),installPackage:e=>Q(`POST`,`/packages/install`,e),updatePackage:e=>Q(`POST`,`/packages/update`,{name:e}),uninstallPackage:(e,t)=>Q(`POST`,`/packages/uninstall`,{name:e,purge:t}),packageOperations:()=>Q(`GET`,`/packages/operations`),commands:()=>Q(`GET`,`/commands`),setCommandOverride:(e,t)=>Q(`PUT`,`/commands/override`,{path:e,override:t}),setCommandGroup:(e,t,n)=>Q(`PUT`,`/commands/groups`,{path:e,groupKey:t,enabled:n}),acl:()=>Q(`GET`,`/acl`),addAcl:e=>Q(`POST`,`/acl`,e),removeAcl:e=>Q(`DELETE`,`/acl`,e),settings:()=>Q(`GET`,`/settings`),updateSettings:e=>Q(`PUT`,`/settings`,e),logs:(e=500,t)=>Q(`GET`,`/logs?limit=${e}&level=10${t===void 0?``:`&eventId=${LN(t)}`}`),logLevel:()=>Q(`GET`,`/logs/level`),setLogLevel:e=>Q(`PUT`,`/logs/level`,{level:e}),playground:e=>Q(`POST`,`/playground`,e),playgroundEvent:e=>Q(`POST`,`/playground/event`,e),ext:(e,t,n,r)=>Q(t,`/ext/${LN(e)}${n}`,r)};function RN(e){let t=e,n=new Set;return{get:()=>t,set(e){t=typeof e==`function`?e(t):e;for(let e of n)e()},subscribe(e){return n.add(e),()=>n.delete(e)}}}var zN=60,BN=0,VN=e=>({...e,seq:++BN}),HN=(0,B.createContext)(null),UN=e=>`${e.platform}:${e.selfId}`;function WN(e,t){if(!e)return e;let n=e.findIndex(e=>UN(e)===UN(t));return n===-1?[...e,t]:e.map((e,r)=>r===n?t:e)}function GN(e,t,n,r){switch(e.type){case`connections`:t.invalidateQueries({queryKey:[`connections`]}),t.invalidateQueries({queryKey:[`bots`]}),t.invalidateQueries({queryKey:[`bot`]}),t.invalidateQueries({queryKey:[`pluginBots`]}),t.invalidateQueries({queryKey:[`overview`]});break;case`policies`:t.invalidateQueries({queryKey:[`bot`]}),t.invalidateQueries({queryKey:[`pluginBots`]}),t.invalidateQueries({queryKey:[`group`]});break;case`task`:t.invalidateQueries({queryKey:[`tasks`]});break;case`hello`:t.setQueryData([`overview`],e.overview),t.setQueryData([`bots`],e.overview.bots);break;case`bot`:t.invalidateQueries({queryKey:[`bot`,e.bot.platform,e.bot.selfId]}),t.invalidateQueries({queryKey:[`pluginBots`]}),t.setQueryData([`bots`],t=>WN(t,e.bot)),t.setQueryData([`overview`],t=>t&&{...t,bots:WN(t.bots,e.bot)??t.bots});break;case`plugins-changed`:t.invalidateQueries({queryKey:[`plugins`]}),t.invalidateQueries({queryKey:[`pluginCatalog`]}),t.invalidateQueries({queryKey:[`pluginCredentials`]}),t.invalidateQueries({queryKey:[`overview`]}),t.invalidateQueries({queryKey:[`commands`]}),t.invalidateQueries({queryKey:[`bot`]}),t.invalidateQueries({queryKey:[`pluginBots`]}),t.invalidateQueries({queryKey:[`group`]});break;case`plugin`:{let n=t.getQueryData([`plugins`]),r=t=>t.name===e.plugin.name&&t.path===e.plugin.path;n?.some(r)?t.setQueryData([`plugins`],n.map(t=>r(t)?e.plugin:t)):t.invalidateQueries({queryKey:[`plugins`]}),t.invalidateQueries({queryKey:[`pluginCatalog`]}),t.invalidateQueries({queryKey:[`overview`]}),t.invalidateQueries({queryKey:[`commands`]}),t.invalidateQueries({queryKey:[`bot`]}),t.invalidateQueries({queryKey:[`pluginBots`]});break}case`message`:{let{type:r,...i}=e;n.messages.set(e=>[i,...e].slice(0,zN)),t.setQueryData([`overview`],e=>e&&{...e,today:{received:e.today.received+ +(i.direction===`in`),sent:e.today.sent+ +(i.direction===`out`)}});break}case`stats`:t.setQueryData([`stats`,`1h`],t=>t&&[...t.filter(t=>t.t!==e.point.t),e.point].sort((e,t)=>e.t-t.t).slice(-60));break;case`package`:{let r=e.operation;n.operations.set(e=>[r,...e.filter(e=>e.id!==r.id)].sort((e,t)=>t.startedAt-e.startedAt).slice(0,20)),(r.status===`succeeded`||r.status===`failed`)&&(t.invalidateQueries({queryKey:[`plugins`]}),t.invalidateQueries({queryKey:[`overview`]}),t.invalidateQueries({queryKey:[`commands`]}),t.invalidateQueries({queryKey:[`packageSearch`]}));break}case`plugin-event`:for(let t of KN)t(e);break;case`log`:r?r.push(e.record):n.logs.set(t=>[...t,VN(e.record)].slice(-2e3))}}var KN=new Set;function qN(e){return KN.add(e),()=>KN.delete(e)}function JN({children:e}){let t=Tj(),n=XN();return(0,B.useEffect)(()=>{let e,r,i=0,a=!1,o=()=>{n.connection.set(`connecting`);let s=window.location.protocol===`https:`?`wss`:`ws`,c=new WebSocket(`${s}://${window.location.host}/api/panel/ws`);e=c;let l=[];c.onopen=()=>{i=0,n.connection.set(`open`),$.logs(500).then(e=>{let t=e.at(-1)?.time??0,r=(l??[]).filter(e=>e.time>t);n.logs.set([...e,...r].slice(-2e3).map(VN))}).catch(()=>{n.logs.set(e=>[...e,...(l??[]).map(VN)].slice(-2e3))}).finally(()=>{l=null}),$.packageOperations().then(e=>n.operations.set(e)).catch(e=>console.warn(`Failed to load package operations`,e)),t.invalidateQueries()},c.onmessage=e=>{GN(JSON.parse(String(e.data)),t,n,l)},c.onclose=()=>{if(a)return;n.connection.set(`closed`);let e=Math.min(15e3,1e3*2**i);i+=1,r=window.setTimeout(o,e)}};return o(),()=>{a=!0,window.clearTimeout(r),e?.close()}},[t,n]),(0,V.jsx)(HN,{value:n,children:e})}var YN;function XN(){return YN??={connection:RN(`connecting`),logs:RN([]),messages:RN([]),operations:RN([])},YN}function ZN(){let e=(0,B.useContext)(HN);if(!e)throw Error(`Realtime hooks must be used inside RealtimeProvider`);return e}function QN(e){return(0,B.useSyncExternalStore)(e.subscribe,e.get)}var $N=()=>QN(ZN().connection),eP=()=>QN(ZN().logs),tP=()=>QN(ZN().messages),nP=()=>QN(ZN().operations),rP=()=>{let{operations:e}=ZN();return t=>e.set(e=>[t,...e.filter(e=>e.id!==t.id)].slice(0,20))},iP=()=>{let{logs:e}=ZN();return()=>e.set([])},aP=new Set;function oP(e){return aP.add(e),window.addEventListener(`popstate`,e),()=>{aP.delete(e),window.removeEventListener(`popstate`,e)}}function sP(e){if(e!==window.location.pathname+window.location.search){window.history.pushState(null,``,e);for(let e of aP)e()}}function cP(){return(0,B.useSyncExternalStore)(oP,()=>window.location.pathname)}function lP({to:e,onClick:t,...n}){return(0,V.jsx)(`a`,{...n,href:e,onClick:n=>{t?.(n),n.defaultPrevented||n.button!==0||n.metaKey||n.ctrlKey||n.shiftKey||(n.preventDefault(),sP(e))}})}function uP(){return(0,B.useSyncExternalStore)(oP,()=>window.location.pathname+window.location.search)}function dP(e,t){e.removeQueries({predicate:e=>e.queryKey[0]!==`session`}),e.setQueryData([`session`],{authenticated:t})}var fP=`asabot-theme`,pP=()=>window.matchMedia(`(prefers-color-scheme: dark)`),mP=(0,B.createContext)(null);function hP(e){return e===`system`?pP().matches?`dark`:`light`:e}function gP({children:e}){let[t,n]=(0,B.useState)(()=>localStorage.getItem(fP)??`system`),[r,i]=(0,B.useState)(()=>hP(t));(0,B.useEffect)(()=>{let e=()=>{let e=hP(t);i(e),document.documentElement.classList.toggle(`dark`,e===`dark`)};if(e(),t!==`system`)return;let n=pP();return n.addEventListener(`change`,e),()=>n.removeEventListener(`change`,e)},[t]);let a=(0,B.useCallback)(e=>{localStorage.setItem(fP,e),n(e)},[]);return(0,V.jsx)(mP,{value:{preference:t,resolved:r,setPreference:a},children:e})}function _P(){let e=(0,B.useContext)(mP);if(!e)throw Error(`useTheme must be used inside ThemeProvider`);return e}var vP=RN(null);function yP(e){if(vP.get())return;let t=document.activeElement,n=window.location.pathname;vP.set({restoreFocus(){window.location.pathname===n&&t instanceof HTMLElement&&t.isConnected&&(t.focus({preventScroll:!0}),e?.())}})}var bP=RN(null);function xP(){return(0,B.useSyncExternalStore)(vP.subscribe,vP.get)}function SP(){return(0,B.useSyncExternalStore)(bP.subscribe,bP.get)}function CP(){let e=Z({queryKey:[`bots`],queryFn:$.bots});return[...new Set((e.data??[]).map(e=>e.platform))]}function wP(e){return/^\S+$/.test(e.trim())}var TP={onebot11:`OneBot 11`,feishu:`飞书`,virtual:`虚拟适配器`,wecom:`企业微信`,"weixin-clawbot":`微信 ClawBot`};function EP(e){return TP[e]??e}var DP=(e,t)=>e.list===t.list&&e.subject===t.subject&&e.key===t.key;function OP(){let e=Tj(),t=Z({queryKey:[`acl`],queryFn:$.acl}),[n,r]=(0,B.useState)(null),i=XM({mutationFn:$.addAcl,onSuccess:(t,n)=>{e.setQueryData([`acl`],(e=[])=>[...e.filter(e=>!DP(e,n)),n]),r(null),vN.success(`已添加`)}}),a=XM({mutationFn:$.removeAcl,onSuccess:(t,n)=>{e.setQueryData([`acl`],(e=[])=>e.filter(e=>!DP(e,n))),vN(`已移除`,{description:n.key,action:{label:`撤销`,onClick:()=>i.mutate(n)}})}});return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Hv,{title:`访问控制`,description:`超管始终不受限制。用户和群两个维度分别生效:某一维度的白名单为空时,不限制这个维度。`}),(0,V.jsx)(`div`,{className:`grid gap-3 lg:grid-cols-2`,children:[{list:`block`,title:`屏蔽名单`,description:`名单中的用户或群发来的事件一律忽略`,icon:zt},{list:`allow`,title:`白名单`,description:`非空时,只有名单中的用户(或群)能使用机器人`,icon:mn}].map(({list:e,title:n,description:i,icon:o})=>{let s=t.data?.filter(t=>t.list===e)??[];return(0,V.jsxs)(J,{className:`flex flex-col`,children:[(0,V.jsx)(Mv,{title:(0,V.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(o,{className:e===`block`?`size-4 text-danger`:`size-4 text-success`}),n]}),description:i,action:(0,V.jsxs)(X,{size:`sm`,onClick:()=>r(e),children:[(0,V.jsx)(Hr,{className:`size-3.5`}),`添加`]})}),(0,V.jsx)(`div`,{className:`flex-1 px-2 pb-2`,children:t.error&&!t.data?(0,V.jsx)(Vv,{error:t.error,onRetry:()=>void t.refetch(),retrying:t.isFetching,className:`py-8`}):t.isPending?(0,V.jsxs)(`div`,{className:`space-y-2 px-3 pb-2`,children:[(0,V.jsx)(zv,{className:`h-11`}),(0,V.jsx)(zv,{className:`h-11`})]}):s.length===0?(0,V.jsx)(Bv,{icon:(0,V.jsx)(bi,{}),title:`名单为空`,className:`py-10`}):(0,V.jsx)(`ul`,{children:(0,V.jsx)(Tg,{initial:!1,children:s.map(e=>{let[t,...n]=e.key.split(`:`);return(0,V.jsxs)(K.li,{layout:!0,initial:{opacity:0,x:-8},animate:{opacity:1,x:0},exit:{opacity:0,x:8,transition:{duration:.15}},transition:q,className:`group flex items-center gap-3 rounded-xl px-3 py-2.5 hover:bg-surface-2/70`,children:[(0,V.jsx)(`span`,{className:`flex size-8 items-center justify-center rounded-lg bg-surface-2 text-fg-3`,children:e.subject===`user`?(0,V.jsx)(Xi,{className:`size-4`}):(0,V.jsx)(Qi,{className:`size-4`})}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`div`,{className:`font-mono text-[13px] text-fg`,children:n.join(`:`)}),(0,V.jsxs)(`div`,{className:`text-[11.5px] text-fg-3`,children:[e.subject===`user`?`用户`:`群`,` · `,t]})]}),(0,V.jsx)(X,{variant:`danger-ghost`,size:`icon-sm`,"aria-label":`移除`,className:`opacity-0 transition-opacity group-hover:opacity-100 focus-visible:opacity-100`,onClick:()=>a.mutate(e),children:(0,V.jsx)(Hi,{className:`size-3.5`})})]},`${e.subject}:${e.key}`)})})})})]},e)})}),(0,V.jsx)(kP,{list:n,pending:i.isPending,onClose:()=>r(null),onSubmit:e=>i.mutate(e)})]})}function kP({list:e,pending:t,onClose:n,onSubmit:r}){let[i,a]=(0,B.useState)(`user`),[o,s]=(0,B.useState)(``),c=CP(),[l,u]=(0,B.useState)(``),d=l||c[0]||``,f=wP(o)&&d.trim().length>0,p=t=>{t.preventDefault(),e&&f&&(r({list:e,subject:i,key:`${d.trim()}:${o.trim()}`}),s(``))};return(0,V.jsx)(Sj,{open:e!==null,onOpenChange:e=>!e&&n(),title:e===`block`?`添加到屏蔽名单`:`添加到白名单`,description:e===`allow`?`注意:白名单非空后,不在名单里的用户(或群)将无法使用机器人。`:void 0,footer:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(X,{variant:`ghost`,onClick:n,children:`取消`}),(0,V.jsx)(X,{variant:e===`block`?`danger`:`primary`,loading:t,disabled:!f,onClick:p,children:`添加`})]}),children:(0,V.jsxs)(`form`,{onSubmit:p,className:`space-y-4`,children:[(0,V.jsx)(CO,{value:i,onChange:a,options:[{value:`user`,label:`用户`},{value:`group`,label:`群`}]}),(0,V.jsxs)(`div`,{className:`grid grid-cols-[1fr_120px] gap-3`,children:[(0,V.jsx)(LO,{label:i===`user`?`用户 ID`:`群 ID`,htmlFor:`acl-id`,children:(0,V.jsx)(FO,{id:`acl-id`,autoFocus:!0,value:o,onChange:e=>s(e.target.value),className:`font-mono`})}),(0,V.jsx)(LO,{label:`平台`,htmlFor:`acl-platform`,children:(0,V.jsx)(FO,{id:`acl-platform`,value:d,placeholder:`平台`,onChange:e=>u(e.target.value),className:`font-mono`})})]})]})})}var AP=(e,t=`overview`)=>`/bots/${encodeURIComponent(e.platform)}/${encodeURIComponent(e.selfId)}/${t}`,jP=e=>e.alias||e.nickname||e.selfId,MP=e=>`/bots/connections/${encodeURIComponent(e)}`,NP=(e,t=`overview`)=>`/plugin/${encodeURIComponent(e)}/${t}`,PP=e=>`/adapters/${encodeURIComponent(e)}`,FP=e=>e===void 0?`—`:new Date(e).toLocaleString(`zh-CN`,{hour12:!1});function IP(e){for(let t of[`bot`,`pluginBots`,`groups`,`group`,`pluginGroups`])e.invalidateQueries({queryKey:[t]})}var LP={text:`文本`,at:`提及`,face:`表情`,image:`图片`,audio:`语音`,video:`视频`,file:`文件`,reply:`引用`,forward:`合并转发`,markdown:`Markdown`,button:`按钮`},RP={bold:`粗体`,italic:`斜体`,underline:`下划线`,strike:`删除线`,code:`代码`,spoiler:`剧透`},zP={sendPrivate:`私聊发送`,sendGroup:`群聊发送`,sendForward:`发送合并转发`,getForward:`读取合并转发`,deleteMessage:`撤回消息`,getMessage:`读取消息`,getSelf:`账号信息`,getGroupList:`群列表`,getGroupMember:`群成员信息`,getGroupMembers:`群成员列表`,getFriendList:`好友列表`,muteMember:`禁言`,kickMember:`踢出群`,setMemberCard:`修改群名片`,call:`平台 API 透传`,sendThread:`话题内发送`},BP={"feishu:card":`飞书卡片`,"feishu:emoji":`飞书表情`,"feishu:sticker":`飞书表情包`,"feishu:share_chat":`分享群名片`,"feishu:share_user":`分享个人名片`,"feishu.sendCard":`发送飞书卡片`,"feishu.updateCard":`更新飞书卡片`,"feishu.downloadResource":`下载消息资源`,"feishu.replyInThread":`开话题回复`,"feishu.listMessages":`会话与话题历史`,"feishu.forwardMessage":`转发消息`,"feishu.forwardThread":`转发话题`,"feishu.mergeForward":`合并转发已有消息`,"feishu.editMessage":`编辑文本消息`,"feishu.addReaction":`添加表情回复`,"feishu.removeReaction":`撤销表情回复`,"feishu.listReactions":`查询表情回复`,"feishu.pinMessage":`标记群消息`,"feishu.unpinMessage":`取消标记群消息`,"feishu.listPins":`查询群消息标记`,"feishu.listReadUsers":`查询消息已读成员`,"feishu.getChat":`查询会话信息`,"feishu.setChatMessageMode":`切换群消息模式`,"feishu.addChatMembers":`添加群成员`,"feishu.urgentApp":`应用内加急`,"wecom:card":`企业微信模板卡片`,"wecom.reply":`回复原消息`,"wecom.downloadMedia":`下载并解密媒体`,"wecom.stream.update":`更新流式回复`,"wecom.stream.finish":`结束流式回复`,"wecom.replyWelcome":`回复欢迎语`,"wecom.updateCard":`更新模板卡片`,"weixin-clawbot.downloadMedia":`下载并解密媒体`,"weixin-clawbot.setTyping":`设置或取消正在输入`};function VP(e,t){let n=new Set(t),r=Object.entries(e).map(([e,t])=>({key:e,label:t,supported:n.has(e)})),i=t.filter(t=>!(t in e)).map(e=>({key:e,label:BP[e]??(e.endsWith(`:*`)?`${e.slice(0,-2)} 专属段`:e),supported:!0}));return[...r,...i]}function HP(e){return{segments:VP(LP,e.segments),styles:VP(RP,e.textStyles),actions:VP(zP,e.actions)}}function UP(e){return`/groups/${encodeURIComponent(e)}`}function WP(e){let[t,n,r,...i]=e.split(`:`);return{platform:t,selfId:n,groupId:i.join(`:`)}}var GP={active:``,loading:`(加载中)`,disabled:`(已停用)`,failed:`(加载失败)`};function KP(e){let t=Z({queryKey:[`pluginCatalog`],queryFn:({signal:e})=>$.pluginCatalog(e)});return({consumes:n})=>t.data?{state:`ready`,emptyLabel:e,options:t.data.filter(e=>n===void 0||e.inject.some(({name:e})=>e===n)).sort((e,t)=>e.name.localeCompare(t.name)).map(({name:e,state:t})=>({value:e,label:`${e}${GP[t]}`}))}:t.error&&!t.isFetching?{state:`error`,retry:()=>void t.refetch()}:{state:`loading`}}function qP(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function JP(e,t){let n={};for(let[r,i]of Object.entries(e)){let e=t[r];if(i!==void 0&&JSON.stringify(i)!==JSON.stringify(e)){if(qP(i)&&qP(e)){let t=JP(i,e);Object.keys(t).length&&(n[r]=t)}else n[r]=i}}return n}var YP={global:`全局配置`,bot:`机器人覆盖`,group:`群组覆盖`,default:`插件默认值`};function XP({plugin:e,inherited:t,effective:n,override:r,sources:i,save:a,onSaved:o}){let s=KP(`继承上级配置`),c=XM({mutationFn:a,onSuccess:(e,t)=>{vN.success(t===null?`已恢复继承配置`:`配置覆盖已保存`),o()}}),l=c.error instanceof PN?Object.fromEntries(c.error.issues.map(t=>[t.path.replace(`plugins.${e.name}.config`,``).replace(/^\./,``),t.message])):{};return!e.configSchema||!qP(n)||!qP(t)?(0,V.jsx)(`p`,{className:`text-sm text-fg-3`,children:`这个插件没有可用的对象配置,可在插件详情中检查全局配置。`}):(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 text-[12.5px] text-fg-3`,children:[(0,V.jsx)(`span`,{children:r?`已覆盖:${Object.keys(r).join(`、`)}`:`当前继承上级配置`}),r&&(0,V.jsxs)(X,{variant:`ghost`,size:`sm`,loading:c.isPending,onClick:()=>c.mutate(null),children:[(0,V.jsx)(Qr,{className:`size-3.5`}),`恢复继承`]})]}),(0,V.jsx)(EA,{schema:e.configSchema,value:n,issues:l,saving:c.isPending,resolveOptions:s,note:`只保存修改的字段,立即生效`,submitLabel:`保存覆盖`,onSubmit:e=>{let n=JP(e,t);c.mutate(Object.keys(n).length?n:null)}}),(0,V.jsxs)(`details`,{className:`rounded-lg border border-border px-3 py-2 text-[12.5px]`,children:[(0,V.jsx)(`summary`,{className:`cursor-pointer text-fg-2`,children:`字段来源`}),(0,V.jsx)(`dl`,{className:`mt-2 divide-y divide-border`,children:Object.entries(i).map(([e,t])=>(0,V.jsxs)(`div`,{className:`flex justify-between gap-3 py-2`,children:[(0,V.jsx)(`dt`,{className:`break-all font-mono text-fg-2`,children:e}),(0,V.jsx)(`dd`,{className:`shrink-0 text-fg-3`,children:YP[t]??t})]},e))})]}),c.error&&(0,V.jsx)(`p`,{role:`alert`,className:`text-[13px] text-danger`,children:c.error.message})]})}function ZP({bot:e,plugins:t,initialOpen:n}){let[r,i]=(0,B.useState)(n??null);return(0,V.jsx)(`div`,{className:`space-y-3`,children:t.map(t=>(0,V.jsx)(QP,{bot:e,plugin:t,open:r===t.name,onOpen:()=>i(r===t.name?null:t.name)},t.name))})}function QP({bot:e,plugin:t,open:n,onOpen:r}){let i=Tj(),a=XM({mutationFn:n=>$.botPlugin(e,t.name,{enabled:n}),onSuccess:()=>IP(i)});return(0,V.jsxs)(J,{className:`overflow-hidden`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 p-4`,children:[(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(lP,{to:NP(t.name),className:`text-[14px] font-semibold hover:text-accent`,children:t.name}),(0,V.jsx)(Pv,{tone:t.state===`active`&&t.botEnabled?`success`:`neutral`,children:t.state===`active`&&t.botEnabled?`生效中`:t.state===`disabled`?`全局已停用`:t.state===`failed`?`全局加载失败`:t.state===`loading`?`全局加载中`:`本机器人停用`})]}),t.description&&(0,V.jsx)(`p`,{className:`mt-1 text-[12.5px] text-fg-3`,children:t.description}),(0,V.jsx)(`div`,{className:`mt-2`,children:(0,V.jsx)(Uv,{value:t.compatibility})})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[t.configSchema&&(0,V.jsxs)(X,{variant:`ghost`,size:`sm`,"aria-expanded":n,onClick:r,children:[(0,V.jsx)(mi,{className:`size-3.5`}),`配置`,(0,V.jsx)(rn,{className:`size-3.5`})]}),(0,V.jsx)(hA,{"aria-label":`在 ${jP(e)} 上启用 ${t.name}`,checked:t.overrideEnabled??t.botDefaultEnabled,disabled:a.isPending,onCheckedChange:e=>a.mutate(e)})]})]}),t.overrideEnabled!==void 0&&(0,V.jsxs)(`div`,{className:`flex items-center justify-between border-t border-border px-4 py-2 text-[12px] text-fg-3`,children:[(0,V.jsx)(`span`,{children:`机器人开关已单独设置`}),(0,V.jsx)(X,{variant:`ghost`,size:`sm`,loading:a.isPending,onClick:()=>a.mutate(null),children:`恢复初始设置`})]}),n&&(0,V.jsx)(`div`,{className:`border-t border-border p-5`,children:(0,V.jsx)(XP,{plugin:t,inherited:t.config,effective:t.effectiveConfig,override:t.override,sources:t.configSources,save:n=>$.botPlugin(e,t.name,{config:n}),onSaved:()=>IP(i)})})]})}var $P={starting:{label:`正在获取二维码`,Icon:cr},waiting:{label:`等待扫码`,detail:`请用手机扫描二维码。`,Icon:oi},scanned:{label:`在手机上确认`,detail:`按手机上的提示继续。`,Icon:Oi},verification:{label:`输入验证码`,Icon:Oi},authorized:{label:`已授权,待保存`,Icon:bi},saved:{label:`连接已保存`,Icon:bi},expired:{label:`二维码已失效`,detail:`请刷新二维码后重新扫码。`,Icon:gn},"already-bound":{label:`该机器人已绑定`,detail:`没有返回新授权。若已有有效连接,可直接重连。`,Icon:gn},failed:{label:`扫码未完成`,detail:`请刷新二维码后重试。`,Icon:gn}};function eF({adapter:e,connection:t,onSaved:n,onCancel:r}){let i=Tj(),a=kv(),o=(0,B.useId)(),s=(0,B.useId)(),c=(0,B.useId)(),[l,u]=(0,B.useState)(()=>({adapter:e.id,connectionId:t?.id})),[d,f]=(0,B.useState)(),[p,m]=(0,B.useState)(),[h,g]=(0,B.useState)(e.name),[_,v]=(0,B.useState)(!0),[y,b]=(0,B.useState)(``),[x,S]=(0,B.useState)(!1);(0,B.useEffect)(()=>{let e=!0,t;return Promise.resolve().then(async()=>{if(e)try{let n=await $.startConnectionSetup(l.adapter,l.connectionId);t=n.id,e?f(n):await $.cancelConnectionSetup(t)}catch(t){e&&m(t instanceof Error?t:Error(`扫码请求失败`))}}),()=>{e=!1,t&&$.cancelConnectionSetup(t).catch(()=>void 0)}},[l]);let C=[`connection-setup`,d?.id],w=Z({queryKey:C,enabled:!!d,queryFn:({signal:e})=>$.connectionSetup(d?.id??``,e),initialData:d,gcTime:0,retry:!1,refetchOnWindowFocus:!1,refetchInterval:({state:e})=>e.error||[`expired`,`failed`,`saved`,`already-bound`].includes(e.data?.status??``)?!1:1e3}),T=w.data,E=XM({mutationFn:async({id:e,code:t})=>(await i.cancelQueries({queryKey:C}),$.verifyConnectionSetup(e,t)),onSuccess:e=>{b(``),i.setQueryData(C,e)}}),D=XM({mutationFn:({id:e,replace:n})=>$.saveConnectionSetup(e,{...!t&&{name:h.trim(),enabled:_},replace:n}),onSuccess:({connectionId:e})=>n(e),onError:()=>S(!1)}),O=()=>{f(void 0),m(void 0),b(``),E.reset(),D.reset(),u({adapter:e.id,connectionId:t?.id})},k=p??w.error,A=k?`failed`:T?.status??`starting`,ee=$P[A],j=k?.message??(T?.status===`failed`?T.detail:void 0)??ee.detail,M=!k&&T?.status===`authorized`?T:void 0,te=A===`expired`||A===`already-bound`||A===`failed`;return(0,V.jsxs)(`div`,{className:`space-y-5`,children:[(0,V.jsx)(`section`,{"aria-label":`扫码授权`,className:`rounded-xl border border-border bg-surface-2/45 p-4 sm:p-5`,children:(0,V.jsx)(Tg,{mode:`wait`,initial:!1,children:(0,V.jsxs)(K.div,{...a,className:`flex flex-col gap-4 sm:flex-row sm:items-center`,children:[!k&&T?.status===`waiting`&&(0,V.jsx)(`img`,{src:T.image,alt:`${e.name} 授权二维码`,width:184,height:184,className:`mx-auto aspect-square h-auto w-full max-w-[184px] shrink-0 rounded-lg bg-white shadow-card sm:mx-0`}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-3`,children:[(0,V.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`space-y-1.5`,children:[(0,V.jsxs)(`h2`,{className:`flex items-center gap-2 text-sm font-semibold`,children:[(0,V.jsx)(ee.Icon,{"aria-hidden":`true`,className:`size-4 shrink-0 ${A===`starting`?`animate-spin motion-reduce:animate-none`:``} ${te?`text-danger`:`text-accent`}`}),ee.label]}),j&&(0,V.jsx)(`p`,{className:`text-[12.5px] leading-relaxed text-fg-3`,children:j}),M&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{className:`break-all font-mono text-xs text-fg-3`,children:M.selfId}),M.replaces&&(0,V.jsx)(`p`,{className:`text-[12.5px] text-fg-2`,children:`保存时需要确认替换当前机器人。`}),M.missingAdmin&&(0,V.jsx)(`p`,{className:`text-[12.5px] text-fg-2`,children:`未识别扫码用户,保存后可在机器人详情设置管理员。`})]})]}),!k&&T?.status===`verification`&&(0,V.jsxs)(`form`,{className:`flex flex-wrap items-end gap-2`,onSubmit:e=>{e.preventDefault(),!E.isPending&&y.trim()&&E.mutate({id:T.id,code:y.trim()})},children:[(0,V.jsx)(LO,{className:`min-w-32 flex-1`,htmlFor:c,label:`手机上显示的验证码`,error:E.error?.message??(T.retry?`请核对验证码后重试`:void 0),children:(0,V.jsx)(FO,{id:c,value:y,inputMode:`numeric`,autoComplete:`one-time-code`,maxLength:64,onChange:e=>b(e.target.value),disabled:E.isPending})}),(0,V.jsx)(X,{type:`submit`,loading:E.isPending,disabled:!y.trim(),children:`验证`})]}),te&&(0,V.jsxs)(X,{size:`sm`,onClick:O,children:[(0,V.jsx)(Jr,{className:`size-3.5`}),` 刷新二维码`]})]})]},A)})}),(0,V.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e.preventDefault(),M&&!D.isPending&&(M.replaces?S(!0):D.mutate({id:M.id,replace:!1}))},children:[!t&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(LO,{htmlFor:o,label:`连接名称`,required:!0,children:(0,V.jsx)(FO,{id:o,value:h,onChange:e=>g(e.target.value),required:!0,maxLength:120,disabled:D.isPending})}),(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,V.jsx)(`label`,{htmlFor:s,className:`text-[12.5px] font-medium text-fg-2`,children:`启用连接`}),(0,V.jsx)(hA,{id:s,checked:_,onCheckedChange:v,disabled:D.isPending})]})]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,V.jsx)(X,{type:`button`,variant:`ghost`,onClick:r,disabled:D.isPending,children:`取消`}),(0,V.jsx)(X,{type:`submit`,variant:`primary`,loading:D.isPending,disabled:!M||!t&&!h.trim(),children:`保存连接`})]}),D.error&&(0,V.jsx)(`p`,{role:`alert`,className:`text-[13px] text-danger`,children:D.error.message})]}),(0,V.jsx)(Sj,{open:x&&!!M,onOpenChange:e=>!D.isPending&&S(e),title:`替换已绑定的机器人?`,description:`保留这条连接的名称和启用状态。原机器人的管理员、插件设置、会话及历史不会迁移。`,footer:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(X,{variant:`ghost`,disabled:D.isPending,onClick:()=>S(!1),children:`取消`}),(0,V.jsx)(X,{variant:`danger`,loading:D.isPending,disabled:!M,onClick:()=>M&&D.mutate({id:M.id,replace:!0}),children:`确认替换`})]})})]})}var tF={disabled:{label:`已停用`,tone:`neutral`},connecting:{label:`连接中`,tone:`warning`},waiting:{label:`等待接入`,tone:`info`},online:{label:`在线`,tone:`success`},retrying:{label:`等待重试`,tone:`warning`},error:{label:`连接失败`,tone:`danger`},offline:{label:`离线`,tone:`danger`},reauthorize:{label:`需要重新扫码`,tone:`danger`}};function nF({state:e}){return(0,V.jsx)(Pv,{tone:tF[e].tone,dot:!0,children:tF[e].label})}function rF({view:e}){return(0,V.jsx)(wO,{value:e,onChange:e=>sP(e===`bots`?`/bots`:`/bots/connections`),tabs:[{value:`bots`,label:`机器人`},{value:`connections`,label:`连接`}],className:`mb-5`})}function iF({path:e}){let t=e.split(`/`).filter(Boolean).map(decodeURIComponent),n=Z({queryKey:[`connections`],queryFn:$.connections}),r=Z({queryKey:[`adapters`],queryFn:$.adapters});if(n.error||r.error)return(0,V.jsx)(Vv,{error:n.error??r.error,onRetry:()=>{n.refetch(),r.refetch()}});if(!n.data||!r.data)return(0,V.jsx)(zv,{className:`h-64 rounded-xl`});if(t[2]===`new`)return(0,V.jsx)(aF,{adapters:r.data,initialAdapter:t[3]},t.join(`/`));if(t[2]){let e=n.data.find(e=>e.id===t[2]);return e?(0,V.jsx)(aF,{connection:e,adapters:r.data},e.id):(0,V.jsx)(Bv,{icon:(0,V.jsx)(Yt,{}),title:`连接不存在`,action:(0,V.jsx)(X,{onClick:()=>sP(`/bots/connections`),children:`返回连接列表`})})}return(0,V.jsx)(V.Fragment,{children:n.data.length?(0,V.jsx)(`div`,{className:`space-y-3`,children:n.data.map(e=>(0,V.jsx)(lP,{to:MP(e.id),className:`block`,children:(0,V.jsxs)(J,{className:`flex items-start gap-4 p-5 transition-colors hover:border-border-strong`,children:[(0,V.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-2 text-fg-3`,children:(0,V.jsx)(Yt,{className:`size-5`})}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-[15px] font-semibold`,children:e.name}),(0,V.jsx)(nF,{state:e.state})]}),(0,V.jsxs)(`p`,{className:`mt-1 text-[12.5px] text-fg-3`,children:[r.data.find(t=>t.id===e.adapter)?.name??e.adapter,` `,`· `,e.bots.length,` 个已识别机器人`]}),e.lastError&&(0,V.jsx)(`p`,{className:`mt-2 truncate text-[12.5px] text-danger`,children:e.lastError}),e.nextRetryAt&&(0,V.jsxs)(`p`,{className:`mt-1 text-[12px] text-fg-3`,children:[`下次重试 `,FP(e.nextRetryAt)]})]}),(0,V.jsx)(cn,{className:`mt-2 size-4 text-fg-3`})]})},e.id))}):(0,V.jsx)(J,{children:(0,V.jsx)(Bv,{icon:(0,V.jsx)(Yt,{}),title:`还没有连接`,description:`选择适配器,按提示填写配置或扫码授权。`,action:(0,V.jsx)(X,{onClick:()=>sP(`/bots/connections/new`),children:`添加连接`})})})})}function aF({connection:e,adapters:t,initialAdapter:n}){let r=Tj(),i=Z({queryKey:[`bots`],queryFn:$.bots,enabled:!!e?.bots.length}),[a,o]=(0,B.useState)(e?.adapter??n??t[0]?.id??``),[s]=(0,B.useState)(()=>e?.id??rt()),[c,l]=(0,B.useState)(!1),[u,d]=(0,B.useState)(!1),f=t.find(e=>e.id===a),p=f?.setup?.kind===`qr`,m=()=>Promise.all([`connections`,`bots`,`bot`,`overview`].map(e=>r.invalidateQueries({queryKey:[e]}))),h=async e=>{await m(),d(!1),vN.success(`连接已保存`),sP(MP(e))},g=XM({mutationFn:t=>$.saveConnection({...t,id:s,adapter:a,...p&&{config:{}}},!e),onSuccess:()=>h(s)}),_=XM({mutationFn:()=>$.reconnect(s),onSuccess:m}),v=XM({mutationFn:()=>$.deleteConnection(s),onSuccess:()=>{m(),sP(`/bots/connections`),vN.success(`连接已删除`)}}),y=(0,B.useMemo)(()=>({type:`object`,required:[`name`],properties:{name:{type:`string`,title:`连接名称`,minLength:1,default:f?.name},enabled:{type:`boolean`,title:`启用连接`,default:!0},...f?.setup?.kind!==`qr`&&{config:{...f?.configSchema,title:`连接配置`}}}}),[f]),b=e?{name:e.name,enabled:e.enabled,...!p&&{config:e.config}}:void 0,x=g.error instanceof PN?Object.fromEntries(g.error.issues.map(e=>[e.path,e.message])):{};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(lP,{to:`/bots/connections`,className:`mb-4 inline-flex items-center gap-1.5 text-[13px] text-fg-3 hover:text-fg`,children:[(0,V.jsx)(kt,{className:`size-3.5`}),`连接列表`]}),(0,V.jsx)(Hv,{title:e?.name??`添加连接`,description:e?(0,V.jsx)(`span`,{className:`font-mono text-xs`,children:s}):`选择适配器并完成接入`,actions:e&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(X,{disabled:!e.enabled||u,loading:_.isPending,onClick:()=>_.mutate(),children:[(0,V.jsx)(Jr,{className:`size-3.5`}),`立即重连`]}),p&&(0,V.jsxs)(X,{variant:e.state===`reauthorize`?`primary`:`secondary`,disabled:u||_.isPending||g.isPending,onClick:()=>d(!0),children:[(0,V.jsx)(oi,{className:`size-3.5`}),`重新扫码`]}),(0,V.jsxs)(X,{variant:`danger-ghost`,disabled:u,onClick:()=>l(!0),children:[(0,V.jsx)(Hi,{className:`size-3.5`}),`删除`]})]})}),(0,V.jsxs)(`div`,{className:`grid items-start gap-5 lg:grid-cols-[minmax(0,1fr)_280px]`,children:[(0,V.jsxs)(J,{className:`min-w-0 p-4 sm:p-6`,children:[(0,V.jsx)(`div`,{className:`mb-5`,children:(0,V.jsx)(Zk,{"aria-label":`适配器`,value:a,onValueChange:o,disabled:!!e,options:t.map(e=>({value:e.id,label:e.name}))})}),f&&(p&&(!e||u)?(0,V.jsx)(eF,{adapter:f,connection:e,onSaved:e=>void h(e),onCancel:()=>e?d(!1):sP(`/bots/connections`)},f.id):(0,V.jsx)(EA,{schema:y,value:b,issues:x,saving:g.isPending,submitWhenPristine:!e,submitLabel:e?`保存连接`:`创建连接`,note:e?`保存后应用到这条连接`:`创建后开始连接`,onSubmit:e=>g.mutate(e)},f.id)),g.error&&(0,V.jsxs)(`p`,{role:`alert`,className:`mt-3 text-[13px] text-danger`,children:[g.error.message,g.error instanceof PN&&g.error.issues.map(e=>(0,V.jsx)(`span`,{className:`block`,children:e.message},e.path))]})]}),(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(J,{className:`space-y-4 p-5`,children:[(0,V.jsx)(`h2`,{className:`text-sm font-semibold`,children:e?`连接状态`:`适配器`}),e&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(nF,{state:e.state}),(0,V.jsxs)(`dl`,{className:`space-y-2 text-[12.5px] text-fg-3`,children:[(0,V.jsx)(`dt`,{children:`状态变更`}),(0,V.jsx)(`dd`,{children:FP(e.changedAt)}),(0,V.jsx)(`dt`,{children:`最近上线`}),(0,V.jsx)(`dd`,{children:FP(e.lastConnectedAt)}),e.nextRetryAt&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`dt`,{children:`下次重试`}),(0,V.jsx)(`dd`,{children:FP(e.nextRetryAt)})]})]})]}),(0,V.jsxs)(lP,{to:PP(a),className:`inline-flex items-center gap-1 text-[13px] text-accent`,children:[f?.name,` 能力与配置`,(0,V.jsx)(cn,{className:`size-3.5`})]})]}),e?.lastError&&(0,V.jsxs)(J,{className:`p-5`,children:[(0,V.jsx)(`p`,{className:`text-[13px] font-medium`,children:`最近异常`}),(0,V.jsx)(`p`,{className:`mt-1 text-[11.5px] text-fg-3`,children:FP(e.errorAt)}),(0,V.jsx)(`p`,{className:`mt-2 break-words text-[12.5px] text-danger`,children:e.lastError}),(0,V.jsx)(lP,{to:`/logs?connectionId=${encodeURIComponent(s)}`,className:`mt-3 inline-block text-[12.5px] text-accent`,children:`查看连接日志`})]}),e?.endpoints.map(e=>{let t=`${location.protocol===`https:`?`wss`:`ws`}://${location.host}${e}`;return(0,V.jsxs)(J,{className:`p-5`,children:[(0,V.jsx)(`p`,{className:`mb-2 text-[13px] font-medium`,children:`反向接入地址`}),(0,V.jsx)(`code`,{className:`break-all text-[12px] text-fg-2`,children:t}),(0,V.jsxs)(X,{className:`mt-3`,size:`sm`,onClick:()=>{navigator.clipboard.writeText(t).then(()=>vN.success(`地址已复制`)).catch(()=>vN.error(`复制失败,请手动复制地址`))},children:[(0,V.jsx)(Sn,{className:`size-3.5`}),`复制地址`]})]},e)}),e&&e.bots.length>0&&(0,V.jsxs)(J,{className:`p-5`,children:[(0,V.jsx)(`h2`,{className:`mb-3 text-sm font-semibold`,children:`关联机器人`}),(0,V.jsx)(`ul`,{className:`space-y-2`,children:e.bots.map(e=>{let t=i.data?.find(t=>t.platform===e.platform&&t.selfId===e.selfId);return(0,V.jsx)(`li`,{children:(0,V.jsx)(lP,{to:AP(e),title:e.selfId,className:`wrap-anywhere text-[13px] text-accent`,children:t?jP(t):e.selfId})},`${e.platform}:${e.selfId}`)})})]})]})]}),(0,V.jsx)(Sj,{open:c,onOpenChange:l,title:`删除连接`,description:`这条连接会断开并从配置文件中移除,机器人设置和历史数据会保留。`,footer:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(X,{variant:`ghost`,onClick:()=>l(!1),children:`取消`}),(0,V.jsx)(X,{variant:`danger`,loading:v.isPending,onClick:()=>v.mutate(),children:`删除连接`})]})})]})}function oF(e){return{type:`object`,properties:{admins:{type:`array`,title:`机器人管理员`,items:{type:`string`},description:e===`feishu`?`填写当前飞书应用下的用户 open_id(ou_ 开头),不是 user_id。可发送 whoami 命令查看。`:`填写这个机器人所属平台的用户 ID,可发送 whoami 命令查看。仅能管理本机器人的插件开关和群规则。`}}}}var sF=[{value:`overview`,label:`概览`},{value:`plugins`,label:`插件`},{value:`groups`,label:`群组`},{value:`settings`,label:`设置`}];function cF({path:e}){let t=kv(),n=e.split(`/`).filter(Boolean).map(decodeURIComponent),r={platform:n[1]??``,selfId:n[2]??``},i=(0,B.useMemo)(()=>oF(r.platform),[r.platform]),a=n[3]??`overview`,o=Tj(),s=Z({queryKey:[`bot`,r.platform,r.selfId],queryFn:()=>$.bot(r)}),c=Z({queryKey:[`connections`],queryFn:$.connections}),[l,u]=(0,B.useState)(null),d=XM({mutationFn:e=>$.botAdmins(r,e),onSuccess:()=>{IP(o),vN.success(`机器人管理员已保存`)}}),f=(0,B.useMemo)(()=>({admins:s.data?.admins??[]}),[s.data?.admins]);if(s.error)return(0,V.jsx)(Vv,{error:s.error,onRetry:()=>void s.refetch()});if(!s.data)return(0,V.jsx)(zv,{className:`h-64 rounded-xl`});let{bot:p,plugins:m}=s.data,h=c.data?.find(e=>e.id===p.connectionId);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(lP,{to:`/bots`,className:`mb-4 inline-flex items-center gap-1.5 text-[13px] text-fg-3 hover:text-fg`,children:[(0,V.jsx)(kt,{className:`size-3.5`}),`机器人列表`]}),(0,V.jsx)(Hv,{title:(0,V.jsxs)(`span`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(ct,{id:p.selfId,name:jP(p),src:p.avatar,size:44}),(0,V.jsx)(`span`,{className:`min-w-0 wrap-anywhere`,children:jP(p)}),(0,V.jsx)(Pv,{tone:p.status===`online`?`success`:`neutral`,dot:!0,children:p.status===`online`?`在线`:p.status===`connecting`?`连接中`:`离线`})]}),description:`${p.platform} · ${p.selfId}`,actions:(0,V.jsxs)(X,{disabled:p.status!==`online`,onClick:()=>u({bot:p}),children:[(0,V.jsx)(fi,{className:`size-3.5`}),`发送消息`]})}),(0,V.jsx)(wO,{value:a,onChange:e=>sP(AP(p,e)),tabs:sF,className:`mb-5`}),(0,V.jsx)(Tg,{mode:`wait`,initial:!1,children:(0,V.jsxs)(K.div,{...t,children:[a===`overview`&&(0,V.jsxs)(`div`,{className:`grid items-start gap-5 lg:grid-cols-[minmax(0,1fr)_300px]`,children:[(0,V.jsxs)(J,{className:`overflow-hidden`,children:[(0,V.jsx)(`div`,{className:`px-5 py-4`,children:(0,V.jsx)(`h2`,{className:`text-sm font-semibold`,children:`机器人能力`})}),p.capabilities?(0,V.jsx)(pF,{capabilities:p.capabilities}):(0,V.jsx)(`p`,{className:`px-5 pb-4 text-[13px] text-fg-3`,children:`暂无能力记录`})]}),(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(J,{className:`space-y-3 p-5`,children:[(0,V.jsxs)(`h2`,{className:`flex items-center gap-2 text-sm font-semibold`,children:[(0,V.jsx)(Yt,{className:`size-4 text-fg-3`}),`关联连接`]}),h?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(lP,{to:MP(h.id),className:`block text-[13.5px] text-accent`,children:h.name}),(0,V.jsx)(nF,{state:h.state}),h.lastError&&(0,V.jsx)(`p`,{className:`break-words text-[12.5px] text-danger`,children:h.lastError})]}):(0,V.jsx)(`p`,{className:`text-[13px] text-fg-3`,children:`未关联连接`}),(0,V.jsxs)(`p`,{className:`text-[12px] text-fg-3`,children:[`机器人最近上线 `,FP(p.lastOnlineAt)]})]}),(0,V.jsxs)(J,{className:`p-5`,children:[(0,V.jsx)(`h2`,{className:`text-sm font-semibold`,children:`插件应用`}),(0,V.jsxs)(`p`,{className:`mt-2 text-[13px] text-fg-3`,children:[m.filter(e=>e.botEnabled&&e.state===`active`).length,` `,`个插件生效`]}),(0,V.jsx)(lP,{to:AP(p,`plugins`),className:`mt-3 inline-block text-[13px] text-accent`,children:`管理插件与配置覆盖`})]}),(0,V.jsx)(lP,{to:`/logs?platform=${encodeURIComponent(p.platform)}&selfId=${encodeURIComponent(p.selfId)}`,className:`block px-1 text-[13px] text-accent`,children:`查看机器人日志`})]})]}),a===`plugins`&&(0,V.jsx)(ZP,{bot:p,plugins:m,initialOpen:n[4]},n[4]??`all`),a===`groups`&&(0,V.jsx)(J,{className:`overflow-hidden`,children:p.status===`online`?(0,V.jsx)(hF,{bot:p,onSend:e=>u({bot:p,target:{type:`group`,id:e}})}):(0,V.jsx)(Bv,{icon:(0,V.jsx)(Kr,{}),title:`机器人当前离线`,description:`连接恢复后可获取群列表,已保存的规则仍可在群组页面管理。`,action:(0,V.jsx)(X,{onClick:()=>sP(`/groups`),children:`已保存的群规则`})})}),a===`settings`&&(0,V.jsxs)(`div`,{className:`max-w-3xl space-y-4`,children:[p.platform!==`virtual`&&(0,V.jsx)(lF,{bot:p}),(0,V.jsxs)(J,{className:`p-6`,children:[(0,V.jsx)(`h2`,{className:`mb-4 text-sm font-semibold`,children:`管理员`}),(0,V.jsx)(EA,{schema:i,value:f,issues:{},saving:d.isPending,note:`保存后立即生效`,submitLabel:`保存管理员`,onSubmit:e=>d.mutate(e.admins)})]}),p.connectionId&&(0,V.jsxs)(J,{className:`flex items-center justify-between gap-3 p-5`,children:[(0,V.jsx)(`span`,{className:`text-sm text-fg-2`,children:`连接凭据、启停与重连`}),(0,V.jsx)(lP,{className:`text-[13px] text-accent`,to:MP(p.connectionId),children:`进入连接设置`})]})]})]},a)}),(0,V.jsx)(gF,{state:l,onClose:()=>u(null)})]})}function lF({bot:e}){let t=Tj(),n=(0,B.useRef)(null),[r,i]=(0,B.useState)(),a=r??e.alias??``,o=a.trim()||null,s=o!==(e.alias??null),c=XM({mutationFn:t=>$.botAlias(e,t),meta:{silent:!0},onSuccess:async n=>{let r=[`bot`,e.platform,e.selfId];t.setQueryData(r,e=>e&&{...e,bot:n}),i(void 0),await Promise.all([t.invalidateQueries({queryKey:r}),...[`bots`,`pluginBots`,`overview`].map(e=>t.invalidateQueries({queryKey:[e]}))])}}),l=c.error instanceof PN&&c.error.issues.find(e=>e.path===`alias`)?.message||c.error?.message,u=e=>{i(e),c.isError&&c.reset()};return(0,V.jsx)(J,{className:`p-6`,children:(0,V.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),s&&!c.isPending&&c.mutate(o)},children:(0,V.jsx)(LO,{label:`面板别名`,htmlFor:`bot-alias`,error:l,children:(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,V.jsxs)(`div`,{className:`relative min-w-0 flex-1 basis-40`,children:[(0,V.jsx)(FO,{ref:n,id:`bot-alias`,autoComplete:`off`,maxLength:80,value:a,placeholder:e.nickname||e.selfId,disabled:c.isPending,"aria-invalid":!!l,className:`pr-10`,onChange:e=>u(e.target.value)}),a&&(0,V.jsx)(xO,{content:`清空别名`,children:(0,V.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`absolute top-1/2 right-1 -translate-y-1/2`,"aria-label":`清空别名`,disabled:c.isPending,onClick:()=>{u(``),n.current?.focus()},children:(0,V.jsx)(ia,{className:`size-3.5`,"aria-hidden":!0})})})]}),(0,V.jsxs)(X,{type:`submit`,variant:`primary`,loading:c.isPending,disabled:!s,children:[(0,V.jsx)(ni,{className:`size-3.5`,"aria-hidden":!0}),`保存别名`]})]})})})})}function uF(){let e=cP(),t=kv(),n=e===`/bots`||e===`/bots/connections`,r=e.startsWith(`/bots/connections/`),i=n?`/bots`:r?e:e.split(`/`).slice(0,4).join(`/`);return(0,V.jsx)(Tg,{mode:`wait`,initial:!1,children:(0,V.jsx)(K.div,{...t,children:n?(0,V.jsx)(dF,{view:e===`/bots`?`bots`:`connections`}):r?(0,V.jsx)(iF,{path:e}):(0,V.jsx)(cF,{path:e})},i)})}function dF({view:e}){let t=kv();return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Hv,{title:`机器人`,description:`管理机器人账号与平台连接`,actions:(0,V.jsxs)(X,{variant:`primary`,onClick:()=>sP(`/bots/connections/new`),children:[(0,V.jsx)(Hr,{className:`size-4`}),`添加连接`]})}),(0,V.jsx)(rF,{view:e}),(0,V.jsx)(Tg,{mode:`wait`,initial:!1,children:(0,V.jsx)(K.div,{...t,children:e===`bots`?(0,V.jsx)(fF,{}):(0,V.jsx)(iF,{path:`/bots/connections`})},e)})]})}function fF(){let e=Z({queryKey:[`bots`],queryFn:$.bots});return e.error?(0,V.jsx)(Vv,{error:e.error,onRetry:()=>void e.refetch()}):e.data?e.data.length?(0,V.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:e.data.map(e=>(0,V.jsx)(lP,{to:AP(e),className:`block`,children:(0,V.jsxs)(J,{className:`flex items-center gap-4 p-5 transition-colors hover:border-border-strong`,children:[(0,V.jsx)(ct,{id:e.selfId,name:jP(e),src:e.avatar,size:48}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`truncate text-[15px] font-semibold`,children:jP(e)}),(0,V.jsx)(Pv,{tone:e.status===`online`?`success`:e.status===`connecting`?`warning`:`neutral`,dot:!0,children:e.status===`online`?`在线`:e.status===`connecting`?`连接中`:`离线`})]}),(0,V.jsx)(`p`,{className:`mt-1 text-[12px] text-fg-3`,children:e.platform}),(0,V.jsx)(`p`,{className:`mt-0.5 truncate font-mono text-[12px] text-fg-3`,children:e.selfId})]}),(0,V.jsx)(cn,{className:`size-4 shrink-0 text-fg-3`})]})},`${e.platform}:${e.selfId}`))}):(0,V.jsx)(J,{children:(0,V.jsx)(Bv,{icon:(0,V.jsx)(Kr,{}),title:`还没有机器人`,description:`添加平台连接后,成功登录的机器人会显示在这里。连接失败时可以在“连接”中查看原因。`,action:(0,V.jsx)(X,{onClick:()=>sP(`/bots/connections`),children:`查看连接`})})}):(0,V.jsx)(zv,{className:`h-48 rounded-xl`})}function pF({capabilities:e,adapter:t=!1}){let{segments:n,styles:r,actions:i}=HP(e);return(0,V.jsxs)(`div`,{className:`space-y-4 border-t border-border bg-surface-2/40 px-5 py-4`,children:[(0,V.jsxs)(`p`,{className:`text-[12.5px] leading-relaxed text-fg-3`,children:[t?`适配器声明的实现范围,具体机器人能力以机器人详情为准。`:`机器人上报的消息与操作能力。`,`平台应用授权需在平台侧配置。`]}),(0,V.jsx)(mF,{title:`消息内容`,rows:n}),(0,V.jsx)(mF,{title:`文本样式`,rows:r}),(0,V.jsx)(mF,{title:`操作`,rows:i})]})}function mF({title:e,rows:t}){return(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`mb-2 text-[12px] font-medium text-fg-2`,children:e}),(0,V.jsx)(`ul`,{className:`flex flex-wrap gap-1.5`,children:t.map(e=>(0,V.jsxs)(`li`,{title:e.key,className:z(`flex items-center gap-1 rounded-md border px-2 py-0.5 text-[12px]`,e.supported?`border-border bg-surface text-fg`:`border-dashed border-border text-fg-3 line-through decoration-fg-3/50`),children:[e.supported?(0,V.jsx)(tn,{className:`size-3 text-success`}):(0,V.jsx)(wr,{className:`size-3 text-fg-3`}),e.label]},e.key))})]})}function hF({bot:e,onSend:t}){let n=Z({queryKey:[`bot-groups`,e.platform,e.selfId],queryFn:()=>$.botGroups(e)}),[r,i]=(0,B.useState)(``),a=(0,B.useMemo)(()=>{let e=r.trim().toLowerCase();return(n.data??[]).filter(t=>!e||t.groupName.toLowerCase().includes(e)||t.groupId.includes(e))},[n.data,r]);return(0,V.jsxs)(`div`,{className:`border-t border-border bg-surface-2/40 px-5 py-4`,children:[(0,V.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,V.jsx)(`span`,{className:`text-[12.5px] text-fg-3`,children:n.data?`共 ${n.data.length} 个群`:`加载中…`}),(0,V.jsx)(FO,{icon:(0,V.jsx)(ui,{}),placeholder:`搜索群名或群号`,value:r,onChange:e=>i(e.target.value),className:`w-56`})]}),n.isPending?(0,V.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:[(0,V.jsx)(zv,{className:`h-14`}),(0,V.jsx)(zv,{className:`h-14`})]}):n.error?(0,V.jsx)(`p`,{className:`text-[13px] text-danger`,children:n.error.message}):(0,V.jsx)(K.ul,{variants:Av,initial:`initial`,animate:`animate`,className:`grid max-h-80 gap-2 overflow-y-auto sm:grid-cols-2`,children:a.map(n=>(0,V.jsxs)(K.li,{variants:jv,className:`group flex items-center gap-3 rounded-xl border border-border bg-surface px-3 py-2.5`,children:[(0,V.jsx)(`span`,{className:`flex size-8 items-center justify-center rounded-lg bg-surface-2 text-[12px] font-medium text-fg-2`,children:n.groupName.slice(0,1)}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`div`,{className:`truncate text-[13px] font-medium`,children:n.groupName}),(0,V.jsxs)(`div`,{className:`font-mono text-[11.5px] text-fg-3`,children:[n.groupId,n.memberCount!==void 0&&` · ${qv(n.memberCount)} 人`]})]}),(0,V.jsx)(lP,{className:`text-[12px] text-accent`,to:UP(`${e.platform}:${e.selfId}:group:${n.groupId}`),children:`群设置`}),(0,V.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":`向 ${n.groupName} 发送消息`,className:`shrink-0`,onClick:()=>t(n.groupId),children:(0,V.jsx)(fi,{className:`size-3.5`})})]},n.groupId))})]})}function gF({state:e,onClose:t}){let[n,r]=(0,B.useState)(`group`),[i,a]=(0,B.useState)(``),[o,s]=(0,B.useState)(``),[c,l]=(0,B.useState)(e);e!==c&&(l(e),e?.target&&(r(e.target.type),a(e.target.id)));let u=XM({mutationFn:$.send,onSuccess:()=>{vN.success(`已发送`),s(``),t()}}),d=wP(i)&&o.trim().length>0,f=t=>{t?.preventDefault(),e&&d&&u.mutate({target:{platform:e.bot.platform,selfId:e.bot.selfId,type:n,id:i.trim()},message:o})};return(0,V.jsx)(Sj,{open:e!==null,onOpenChange:e=>!e&&t(),title:`发送消息`,description:e?`以 ${jP(e.bot)} 的身份发送`:void 0,footer:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(X,{variant:`ghost`,onClick:t,children:`取消`}),(0,V.jsxs)(X,{variant:`primary`,loading:u.isPending,disabled:!d,onClick:()=>f(),children:[(0,V.jsx)(fi,{className:`size-3.5`}),`发送`]})]}),children:(0,V.jsxs)(`form`,{onSubmit:f,className:`space-y-4`,children:[(0,V.jsx)(CO,{value:n,onChange:r,options:[{value:`group`,label:`群聊`},{value:`private`,label:`私聊`}]}),(0,V.jsx)(LO,{label:n===`group`?`群 ID`:`用户 ID`,htmlFor:`send-id`,children:(0,V.jsx)(FO,{id:`send-id`,value:i,onChange:e=>a(e.target.value),className:`font-mono`})}),(0,V.jsx)(LO,{label:`内容`,htmlFor:`send-text`,hint:`按纯文本发送`,children:(0,V.jsx)(IO,{id:`send-text`,value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&f()}})})]})})}function _F({schema:e}){return(0,V.jsx)(`dl`,{className:`divide-y divide-border`,children:Object.entries(e.properties??{}).map(([t,n])=>(0,V.jsxs)(`div`,{className:`py-3`,children:[(0,V.jsxs)(`dt`,{className:`flex flex-wrap items-center gap-2 text-[13px] font-medium`,children:[n.title??t,(0,V.jsx)(`code`,{className:`font-mono text-[11.5px] font-normal text-fg-3`,children:t}),e.required?.includes(t)&&(0,V.jsx)(Pv,{children:`必填`}),n.writeOnly&&(0,V.jsx)(Pv,{tone:`warning`,children:`凭据`})]}),n.description&&(0,V.jsx)(`dd`,{className:`mt-1 text-[12.5px] text-fg-3`,children:n.description}),n.properties&&(0,V.jsx)(`dd`,{className:`ml-3 border-l border-border pl-3`,children:(0,V.jsx)(_F,{schema:n})})]},t))})}function vF(){let e=cP().split(`/`)[2],t=kv();return(0,V.jsx)(Tg,{mode:`wait`,initial:!1,children:(0,V.jsx)(K.div,{...t,children:(0,V.jsx)(yF,{id:e})},e??`/adapters`)})}function yF({id:e}){let t=Z({queryKey:[`adapters`],queryFn:$.adapters}),n=Z({queryKey:[`connections`],queryFn:$.connections}),r=Z({queryKey:[`bots`],queryFn:$.bots});if(t.error||n.error||r.error)return(0,V.jsx)(Vv,{error:t.error??n.error??r.error,onRetry:()=>{t.refetch(),n.refetch(),r.refetch()}});if(!t.data||!n.data||!r.data)return(0,V.jsx)(zv,{className:`h-64 rounded-xl`});let i=t.data.find(t=>t.id===(e?decodeURIComponent(e):``));if(e&&!i)return(0,V.jsx)(Bv,{icon:(0,V.jsx)(Yt,{}),title:`适配器未加载`,action:(0,V.jsx)(X,{onClick:()=>sP(`/adapters`),children:`返回适配器列表`})});if(!i)return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Hv,{title:`适配器`,description:`查看已加载的协议实现、连接方式和能力`}),(0,V.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:t.data.map(e=>(0,V.jsx)(bF,{adapter:e,count:n.data?.filter(t=>t.adapter===e.id).length??0},e.id))}),(0,V.jsxs)(J,{className:`mt-5 p-5`,children:[(0,V.jsx)(`h2`,{className:`text-sm font-semibold`,children:`添加外部适配器`}),(0,V.jsxs)(`p`,{className:`mt-2 text-[13px] leading-relaxed text-fg-3`,children:[`在项目目录通过包管理器安装适配器包,将包名加入配置文件的`,` `,(0,V.jsx)(`code`,{className:`font-mono`,children:`adapterModules`}),` 后重启服务。加载成功后会出现在这里。`]})]})]});let a=n.data?.filter(e=>e.adapter===i.id)??[],o=r.data?.filter(e=>a.some(t=>t.id===e.connectionId))??[];return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(lP,{to:`/adapters`,className:`mb-4 inline-flex items-center gap-1.5 text-[13px] text-fg-3 hover:text-fg`,children:[(0,V.jsx)(kt,{className:`size-3.5`}),`适配器列表`]}),(0,V.jsx)(Hv,{title:i.name,description:i.description,actions:(0,V.jsxs)(X,{variant:`primary`,onClick:()=>sP(`/bots/connections/new/${encodeURIComponent(i.id)}`),children:[(0,V.jsx)(Hr,{className:`size-3.5`}),`添加连接`]})}),(0,V.jsxs)(`div`,{className:`grid items-start gap-5 lg:grid-cols-[minmax(0,1fr)_300px]`,children:[(0,V.jsxs)(`div`,{className:`space-y-5`,children:[(0,V.jsxs)(J,{className:`overflow-hidden`,children:[(0,V.jsx)(`div`,{className:`px-5 py-4`,children:(0,V.jsx)(`h2`,{className:`text-sm font-semibold`,children:`适配器实现能力`})}),(0,V.jsx)(pF,{capabilities:i.capabilities,adapter:!0})]}),(0,V.jsx)(J,{className:`p-5`,children:i.setup?.kind===`qr`?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h2`,{className:`text-sm font-semibold`,children:`接入方式`}),(0,V.jsx)(`p`,{className:`mt-2 text-[13px] text-fg-3`,children:`扫码授权后保存连接。`})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h2`,{className:`text-sm font-semibold`,children:`配置字段`}),(0,V.jsx)(_F,{schema:i.configSchema})]})})]}),(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(J,{className:`space-y-3 p-5`,children:[(0,V.jsx)(`h2`,{className:`text-sm font-semibold`,children:`版本与来源`}),(0,V.jsxs)(`p`,{className:`font-mono text-[13px]`,children:[`v`,i.version]}),(0,V.jsx)(`p`,{className:`break-all text-[12.5px] text-fg-3`,children:i.source===`builtin`?`框架内置`:i.source}),(0,V.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:i.connectionTypes.map(e=>(0,V.jsx)(Pv,{children:e},e))})]}),(0,V.jsxs)(J,{className:`p-5`,children:[(0,V.jsx)(`h2`,{className:`mb-3 text-sm font-semibold`,children:`连接`}),a.length?(0,V.jsx)(`ul`,{className:`space-y-3`,children:a.map(e=>(0,V.jsxs)(`li`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,V.jsx)(lP,{to:MP(e.id),className:`text-[13px] text-accent`,children:e.name}),(0,V.jsx)(nF,{state:e.state})]},e.id))}):(0,V.jsx)(`p`,{className:`text-[13px] text-fg-3`,children:`尚未添加连接`})]}),o.length>0&&(0,V.jsxs)(J,{className:`p-5`,children:[(0,V.jsx)(`h2`,{className:`mb-3 text-sm font-semibold`,children:`机器人`}),(0,V.jsx)(`ul`,{className:`space-y-2`,children:o.map(e=>(0,V.jsx)(`li`,{children:(0,V.jsx)(lP,{className:`break-all text-[13px] text-accent`,to:AP(e),children:jP(e)})},`${e.platform}:${e.selfId}`))})]})]})]})]})}function bF({adapter:e,count:t}){return(0,V.jsx)(lP,{to:PP(e.id),children:(0,V.jsxs)(J,{className:`flex h-full flex-col gap-4 p-5 transition-colors hover:border-border-strong`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(`span`,{className:`flex size-10 items-center justify-center rounded-xl bg-surface-2 text-fg-3`,children:(0,V.jsx)(Kr,{className:`size-5`})}),(0,V.jsx)(`h2`,{className:`text-[15px] font-semibold`,children:e.name}),(0,V.jsxs)(`span`,{className:`ml-auto font-mono text-xs text-fg-3`,children:[`v`,e.version]})]}),(0,V.jsx)(`p`,{className:`flex-1 text-[13px] leading-relaxed text-fg-3`,children:e.description}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(Pv,{children:e.source===`builtin`?`内置`:`外部包`}),(0,V.jsxs)(`span`,{className:`text-[12px] text-fg-3`,children:[t,` 条连接`]}),(0,V.jsx)(cn,{className:`ml-auto size-4 text-fg-3`})]})]})})}function xF(e){if(e<1024)return`${e} B`;let t=[`KB`,`MB`,`GB`],n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n.toFixed(n>=100?0:1)} ${t[r]}`}function SF(e){let t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/86400),r=Math.floor(t%86400/3600),i=Math.floor(t%3600/60);return n>0?`${n} 天 ${r} 小时`:r>0?`${r} 小时 ${i} 分`:i>0?`${i} 分 ${t%60} 秒`:`${t} 秒`}function CF(e,t=Date.now()){let n=Math.max(0,t-e);return n<1e4?`刚刚`:n<6e4?`${Math.floor(n/1e3)} 秒前`:n<36e5?`${Math.floor(n/6e4)} 分钟前`:n<864e5?`${Math.floor(n/36e5)} 小时前`:new Date(e).toLocaleDateString(`zh-CN`)}function wF(e){if(typeof e==`string`)return e;if(e<=0)return`0s`;let t=[[`d`,864e5],[`h`,36e5],[`m`,6e4],[`s`,1e3],[`ms`,1]],n=e,r=``;for(let[e,i]of t){let t=Math.floor(n/i);t>0&&(r+=`${t}${e}`,n-=t*i)}return r}var TF={everyone:`所有人`,"group.admin":`群管理员`,"group.owner":`群主`,"bot.admin":`机器人管理员`,superuser:`超管`},EF={user:`每个用户`,group:`每个群`,global:`全局`};function DF(e){let t=e.override??{};return{enabled:t.enabled!==!1,hidden:t.hidden??e.hidden,aliases:[...e.aliases,...t.aliases??[]],permission:t.permission===void 0?e.permission?`插件限定`:void 0:t.permission===`everyone`?void 0:TF[t.permission],cooldown:t.cooldown===void 0||t.cooldown===!1?void 0:`${wF(t.cooldown.duration)} / ${EF[t.cooldown.scope??`user`]}`,modified:e.override!==void 0&&Object.keys(e.override).length>0}}function OF(){let e=Tj();return XM({mutationFn:({path:e,override:t})=>$.setCommandOverride(e,t),meta:{silent:!0},onSuccess:t=>{e.setQueryData([`commands`],(e=[])=>e.map(e=>e.path===t.path?t:e)),e.invalidateQueries({queryKey:[`plugins`]})}})}function kF(){let e=Z({queryKey:[`commands`],queryFn:$.commands}),[t,n]=(0,B.useState)(``),[r,i]=(0,B.useState)(!1),[a,o]=(0,B.useState)(null),s=(0,B.useMemo)(()=>{let n=t.trim().toLowerCase(),i=(e.data??[]).filter(e=>{let t=DF(e);return(r||!t.hidden)&&(!n||e.path.toLowerCase().includes(n)||e.description.toLowerCase().includes(n)||t.aliases.some(e=>e.toLowerCase().includes(n)))}),a=new Map;for(let e of i)a.set(e.owner,[...a.get(e.owner)??[],e]);return[...a.entries()].sort(([e],[t])=>e.localeCompare(t))},[e.data,t,r]),c=e.data?.find(e=>e.path===a);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Hv,{title:`命令`,description:`所有插件注册的命令。可以停用命令,或者修改别名、权限和冷却,不需要改插件代码`}),(0,V.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-3`,children:[(0,V.jsx)(FO,{icon:(0,V.jsx)(ui,{}),placeholder:`搜索命令、别名或说明`,value:t,onChange:e=>n(e.target.value),className:`w-72`}),(0,V.jsxs)(`div`,{className:`ml-auto flex items-center gap-2 text-[13px] text-fg-2`,children:[(0,V.jsx)(hA,{id:`show-hidden`,checked:r,onCheckedChange:i}),(0,V.jsx)(`label`,{htmlFor:`show-hidden`,className:`cursor-pointer`,children:`显示隐藏命令`})]})]}),e.error&&!e.data?(0,V.jsx)(J,{children:(0,V.jsx)(Vv,{error:e.error,onRetry:()=>void e.refetch(),retrying:e.isFetching})}):e.data?s.length===0?(0,V.jsx)(J,{children:(0,V.jsx)(Bv,{icon:(0,V.jsx)(Mi,{}),title:`没有匹配的命令`})}):(0,V.jsx)(K.div,{variants:Av,initial:`initial`,animate:`animate`,className:`space-y-4`,children:s.map(([e,t])=>(0,V.jsx)(K.div,{variants:jv,children:(0,V.jsxs)(J,{className:`overflow-hidden`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border bg-surface-2/50 px-5 py-2.5`,children:[(0,V.jsx)(`span`,{className:`text-[13px] font-semibold`,children:e}),(0,V.jsxs)(`span`,{className:`text-[12px] text-fg-3`,children:[t.length,` 条`]})]}),(0,V.jsx)(`ul`,{className:`divide-y divide-border`,children:t.map(e=>(0,V.jsx)(AF,{command:e,onEdit:()=>o(e.path)},e.path))})]})},e))}):(0,V.jsx)(zv,{className:`h-80 rounded-xl`}),(0,V.jsx)(NF,{command:c,onClose:()=>o(null)})]})}function AF({command:e,onEdit:t}){let[n,r]=(0,B.useState)(!1),i=DF(e),a=OF(),o=e.options.length>0||e.examples.length>0;return(0,V.jsxs)(`li`,{className:z(`transition-opacity`,!i.enabled&&`opacity-60`),children:[(0,V.jsxs)(`div`,{className:`group flex items-center gap-3 px-5 py-3`,children:[(0,V.jsxs)(`button`,{type:`button`,onClick:()=>o&&r(!n),className:z(`flex min-w-0 flex-1 items-center gap-3 text-left`,o&&`cursor-pointer`),children:[(0,V.jsx)(K.span,{animate:{rotate:n?90:0},transition:q,className:z(`text-fg-3`,!o&&`invisible`),children:(0,V.jsx)(cn,{className:`size-3.5`})}),(0,V.jsx)(`code`,{className:z(`shrink-0 font-mono text-[13px] font-medium`,i.enabled?`text-fg`:`text-fg-3 line-through`),children:e.usage}),(0,V.jsx)(`span`,{className:`truncate text-[13px] text-fg-3`,children:e.description})]}),(0,V.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[e.overrideIssues.length>0&&(0,V.jsx)(`span`,{title:e.overrideIssues.join(`
|
|
50
|
+
`),children:(0,V.jsxs)(Pv,{tone:`danger`,children:[(0,V.jsx)(Wi,{className:`size-3`}),`覆盖有冲突`]})}),i.modified&&(0,V.jsx)(Pv,{tone:`accent`,children:`已修改`}),i.aliases.slice(0,2).map(e=>(0,V.jsx)(Pv,{children:e},e)),i.aliases.length>2&&(0,V.jsxs)(Pv,{children:[`+`,i.aliases.length-2]}),i.permission&&(0,V.jsx)(Pv,{tone:`warning`,children:i.permission}),i.cooldown&&(0,V.jsxs)(Pv,{tone:`info`,children:[`冷却 `,i.cooldown]}),e.scope!==`all`&&(0,V.jsx)(Pv,{tone:`info`,children:e.scope===`group`?`群聊`:`私聊`}),e.disabledGroups.length>0&&(0,V.jsxs)(Pv,{children:[e.disabledGroups.length,` 个群停用`]}),i.hidden&&(0,V.jsx)(Pv,{children:`隐藏`}),(0,V.jsxs)(`div`,{className:`ml-1 flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100`,children:[(0,V.jsxs)(X,{variant:`ghost`,size:`sm`,onClick:t,children:[(0,V.jsx)(Rr,{className:`size-3.5`}),`编辑`]}),(0,V.jsxs)(X,{variant:`soft`,size:`sm`,disabled:!i.enabled,onClick:()=>{bP.set(`/${e.path} `),sP(`/playground`)},children:[(0,V.jsx)(Hn,{className:`size-3.5`}),`试用`]})]}),(0,V.jsx)(hA,{"aria-label":`启用 /${e.path}`,checked:i.enabled,disabled:a.isPending,onCheckedChange:t=>{let{enabled:n,...r}=e.override??{},i=t?r:{...r,enabled:!1};a.mutate({path:e.path,override:Object.keys(i).length>0?i:null},{onSuccess:()=>vN.success(t?`已启用 /${e.path}`:`已停用 /${e.path}`),onError:e=>vN.error(e.message)})},className:`ml-2`})]})]}),(0,V.jsx)(Tg,{initial:!1,children:n&&(0,V.jsx)(K.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:q,className:`overflow-hidden`,children:(0,V.jsxs)(`div`,{className:`grid gap-4 px-5 pb-4 pl-12 sm:grid-cols-2`,children:[e.options.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`mb-2 text-[11.5px] font-medium tracking-wide text-fg-3`,children:`选项`}),(0,V.jsx)(`ul`,{className:`space-y-1.5`,children:e.options.map(e=>(0,V.jsxs)(`li`,{className:`text-[12.5px]`,children:[(0,V.jsx)(`code`,{className:`font-mono text-fg`,children:e.flags.join(`, `)}),e.description&&(0,V.jsx)(`span`,{className:`ml-2 text-fg-3`,children:e.description}),e.default!==void 0&&(0,V.jsxs)(`span`,{className:`ml-2 text-fg-3`,children:[`(默认 `,JSON.stringify(e.default),`)`]})]},e.flags.join(`,`)))})]}),e.examples.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`mb-2 text-[11.5px] font-medium tracking-wide text-fg-3`,children:`示例`}),(0,V.jsx)(`ul`,{className:`space-y-1.5`,children:e.examples.map(e=>(0,V.jsx)(`li`,{children:(0,V.jsx)(`code`,{className:`rounded-md bg-surface-2 px-1.5 py-0.5 font-mono text-[12.5px] text-fg`,children:e})},e))})]})]})})})]})}function jF(e){let t=e.override??{},n=t.cooldown;return{enabled:t.enabled!==!1,aliases:t.aliases??[],permission:t.permission??`default`,cooldownMode:n===void 0?`default`:n===!1?`off`:`custom`,cooldownDuration:n?wF(n.duration):`10s`,cooldownScope:n?n.scope??`user`:`user`,hidden:t.hidden===void 0?`default`:t.hidden?`yes`:`no`}}function MF(e){let t={};return e.enabled||(t.enabled=!1),e.aliases.length>0&&(t.aliases=e.aliases),e.permission!=="default"&&(t.permission=e.permission),e.cooldownMode===`off`&&(t.cooldown=!1),e.cooldownMode===`custom`&&(t.cooldown={duration:e.cooldownDuration.trim(),scope:e.cooldownScope}),e.hidden!=="default"&&(t.hidden=e.hidden===`yes`),Object.keys(t).length>0?t:null}function NF({command:e,onClose:t}){let[n,r]=(0,B.useState)(null),[i,a]=(0,B.useState)(void 0);e!==i&&(a(e),r(e?jF(e):null));let o=OF(),s=Tj(),c=XM({mutationFn:({path:e,groupKey:t})=>$.setCommandGroup(e,t,!0),onSuccess:()=>void s.invalidateQueries({queryKey:[`commands`]})}),l=e=>r(t=>t&&{...t,...e}),u=n?.cooldownMode!==`custom`||n.cooldownDuration.trim().length>0,d=n=>{e&&o.mutate({path:e.path,override:n},{onSuccess:e=>{e.overrideIssues.length>0?vN.warning(e.overrideIssues.join(`;`)):vN.success(n===null?`已恢复插件默认设置`:`已保存`),t()},onError:e=>vN.error(e instanceof PN&&e.issues.length>0?e.issues.map(e=>e.message).join(`;`):e.message)})};return(0,V.jsx)(Sj,{open:e!==void 0,onOpenChange:e=>!e&&t(),title:e?`/${e.path}`:``,description:`这里的设置覆盖插件自己的声明,保存后立即生效,不需要重载插件`,footer:(0,V.jsxs)(V.Fragment,{children:[e?.override&&(0,V.jsxs)(X,{variant:`ghost`,className:`mr-auto`,onClick:()=>d(null),disabled:o.isPending,children:[(0,V.jsx)(Qr,{className:`size-3.5`}),`恢复默认`]}),(0,V.jsx)(X,{variant:`ghost`,onClick:t,children:`取消`}),(0,V.jsx)(X,{variant:`primary`,loading:o.isPending,disabled:!n||!u,onClick:()=>n&&d(MF(n)),children:`保存`})]}),children:e&&n&&(0,V.jsxs)(`div`,{className:`space-y-5`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-4 rounded-xl border border-border px-4 py-3`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[13px] font-medium`,children:`启用`}),(0,V.jsx)(`p`,{className:`mt-0.5 text-[12px] text-fg-3`,children:`停用后对所有人(包括超管)都不可用,消息交给其他处理器。`})]}),(0,V.jsx)(hA,{checked:n.enabled,onCheckedChange:e=>l({enabled:e})})]}),(0,V.jsx)(LO,{label:`追加别名`,htmlFor:`override-aliases`,hint:e.aliases.length>0?`插件自带:${e.aliases.join(`、`)}。别名是完整路径,例如“重载插件”或“plugin rl”`:`别名是完整路径,例如“重载插件”或“plugin rl”`,children:(0,V.jsx)(jA,{id:`override-aliases`,value:n.aliases,onChange:e=>l({aliases:e.map(String)})})}),(0,V.jsx)(LO,{label:`权限`,htmlFor:`override-permission`,hint:e.permission?`插件为这条命令声明了权限规则`:`插件没有限制权限`,children:(0,V.jsx)(Zk,{"aria-label":`权限`,value:n.permission,onValueChange:e=>l({permission:e}),options:[{value:`default`,label:`插件默认`},{value:`everyone`,label:`所有人`},{value:`group.admin`,label:`群管理员(含群主)`},{value:`group.owner`,label:`群主`},{value:`superuser`,label:`仅超管`}]})}),(0,V.jsx)(LO,{label:`冷却`,htmlFor:`override-cooldown`,hint:`超管不受冷却限制`,children:(0,V.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,V.jsx)(CO,{value:n.cooldownMode,onChange:e=>l({cooldownMode:e}),options:[{value:`default`,label:`插件默认`},{value:`off`,label:`取消冷却`},{value:`custom`,label:`自定义`}]}),n.cooldownMode===`custom`&&(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsx)(FO,{id:`override-cooldown`,placeholder:`例如 30s、5m`,value:n.cooldownDuration,onChange:e=>l({cooldownDuration:e.target.value}),className:`w-36 font-mono`}),(0,V.jsx)(Zk,{"aria-label":`冷却范围`,value:n.cooldownScope,onValueChange:e=>l({cooldownScope:e}),options:Object.keys(EF).map(e=>({value:e,label:EF[e]}))})]})]})}),(0,V.jsx)(LO,{label:`在帮助中`,htmlFor:`override-hidden`,children:(0,V.jsx)(CO,{value:n.hidden,onChange:e=>l({hidden:e}),options:[{value:`default`,label:e.hidden?`插件默认(隐藏)`:`插件默认(显示)`},{value:`no`,label:`显示`},{value:`yes`,label:`隐藏`}]})}),e.disabledGroups.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`mb-2 text-[13px] font-medium`,children:`已在这些群停用`}),(0,V.jsx)(`ul`,{className:`divide-y divide-border rounded-xl border border-border`,children:e.disabledGroups.map(t=>{let{platform:n,groupId:r}=WP(t);return(0,V.jsxs)(`li`,{className:`flex items-center justify-between px-3.5 py-2`,children:[(0,V.jsxs)(lP,{to:UP(t),className:`min-w-0 hover:underline`,children:[(0,V.jsx)(`span`,{className:`font-mono text-[12.5px]`,children:r}),(0,V.jsx)(`span`,{className:`ml-2 text-[11.5px] text-fg-3`,children:n})]}),(0,V.jsx)(X,{variant:`ghost`,size:`sm`,loading:c.isPending&&c.variables?.groupKey===t,onClick:()=>c.mutate({path:e.path,groupKey:t}),children:`恢复`})]},t)})})]}),e.overrideIssues.length>0&&(0,V.jsx)(`div`,{className:`rounded-xl bg-danger-soft px-4 py-3 text-[12.5px] text-danger`,children:e.overrideIssues.map(e=>(0,V.jsx)(`div`,{children:e},e))})]})})}function PF(e){let t=/^\/groups\/(.+)$/.exec(e);return t?decodeURIComponent(t[1]):null}function FF(){let e=Tj(),t=PF(cP()),n=Z({queryKey:[`groups`],queryFn:()=>$.groups()}),r=XM({mutationFn:()=>$.groups(!0),onSuccess:t=>e.setQueryData([`groups`],t)}),[i,a]=(0,B.useState)(``),[o,s]=(0,B.useState)(``),c=Z({queryKey:[`bots`],queryFn:$.bots}),[l,u]=(0,B.useState)(``),d=c.data?.find(e=>`${e.platform}:${e.selfId}`===l)??c.data?.[0],f=(0,B.useMemo)(()=>{let e=i.trim().toLowerCase();return(n.data??[]).filter(t=>!e||t.groupId.toLowerCase().includes(e)||t.name?.toLowerCase().includes(e)).sort((e,t)=>IF(t)-IF(e)||(e.name??e.groupId).localeCompare(t.name??t.groupId))},[n.data,i]);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Hv,{title:`群组`,description:`按群设置插件开关、配置覆盖、命令开关和访问控制。列表来自在线机器人的群,以及设置过规则的群`,actions:(0,V.jsxs)(X,{variant:`secondary`,loading:r.isPending,onClick:()=>r.mutate(),children:[(0,V.jsx)(Jr,{className:`size-3.5`}),`刷新群列表`]})}),(0,V.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-3`,children:[(0,V.jsx)(FO,{icon:(0,V.jsx)(ui,{}),placeholder:`搜索群名或群 ID`,value:i,onChange:e=>a(e.target.value),className:`w-72`}),(0,V.jsxs)(`form`,{className:`ml-auto flex gap-2`,onSubmit:e=>{e.preventDefault();let t=o.trim();if(!wP(t))return vN.error(`请输入群 ID`);if(!d)return vN.error(`请先添加机器人`);s(``),sP(UP(`${d.platform}:${d.selfId}:group:${t}`))},children:[(0,V.jsx)(Zk,{"aria-label":`机器人`,value:d?`${d.platform}:${d.selfId}`:``,onValueChange:u,options:(c.data??[]).map(e=>({value:`${e.platform}:${e.selfId}`,label:`${jP(e)} · ${e.platform}`}))}),(0,V.jsx)(FO,{icon:(0,V.jsx)(Qi,{}),placeholder:`按群 ID 打开`,value:o,onChange:e=>s(e.target.value),className:`w-44`}),(0,V.jsx)(X,{type:`submit`,variant:`secondary`,size:`icon`,"aria-label":`打开`,children:(0,V.jsx)(Hr,{className:`size-4`})})]})]}),n.error&&!n.data?(0,V.jsx)(J,{children:(0,V.jsx)(Vv,{error:n.error,onRetry:()=>void n.refetch(),retrying:n.isFetching})}):n.data?f.length===0?(0,V.jsx)(J,{children:(0,V.jsx)(Bv,{icon:(0,V.jsx)(Qi,{}),title:i?`没有匹配的群`:`还没有群`,description:i?void 0:`机器人上线后会列出它所在的群;也可以在右上角按群 ID 直接打开。`})}):(0,V.jsx)(J,{className:`overflow-hidden`,children:(0,V.jsx)(K.ul,{variants:Av,initial:`initial`,animate:`animate`,className:`divide-y divide-border`,children:f.map(e=>(0,V.jsx)(K.li,{variants:jv,children:(0,V.jsx)(LF,{group:e})},e.groupKey))})}):(0,V.jsx)(zv,{className:`h-72 rounded-xl`}),(0,V.jsx)(RF,{groupKey:t,known:n.data,onClose:()=>sP(`/groups`)})]})}function IF(e){return e.rules.plugins+e.rules.configs+e.rules.commands+ +!!e.access}function LF({group:e}){let t=e.name??e.groupId;return(0,V.jsxs)(`button`,{type:`button`,onClick:()=>sP(UP(e.groupKey)),className:`group flex w-full cursor-pointer items-center gap-3 px-5 py-3 text-left transition-colors hover:bg-surface-2/60`,children:[(0,V.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-[10px] bg-surface-2 text-[13px] font-medium text-fg-2`,children:t.slice(0,1)}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`div`,{className:`truncate text-[13.5px] font-medium`,children:t}),(0,V.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 text-[11.5px] text-fg-3`,children:[(0,V.jsx)(`span`,{className:`font-mono`,children:e.groupId}),(0,V.jsx)(`span`,{children:EP(e.platform)}),e.bots.length>0?(0,V.jsxs)(`span`,{children:[`机器人 `,e.selfId]}):(0,V.jsx)(`span`,{children:`机器人不在群内`})]})]}),(0,V.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[e.access===`block`&&(0,V.jsx)(Pv,{tone:`danger`,children:`已屏蔽`}),e.access===`allow`&&(0,V.jsx)(Pv,{tone:`success`,children:`白名单`}),e.rules.plugins>0&&(0,V.jsxs)(Pv,{children:[e.rules.plugins,` 个插件开关`]}),e.rules.configs>0&&(0,V.jsxs)(Pv,{tone:`accent`,children:[e.rules.configs,` 个配置覆盖`]}),e.rules.commands>0&&(0,V.jsxs)(Pv,{children:[e.rules.commands,` 条命令停用`]}),(0,V.jsx)(cn,{className:`size-4 text-fg-3 transition-transform group-hover:translate-x-0.5`})]})]})}function RF({groupKey:e,known:t,onClose:n}){let[r,i]=(0,B.useState)(`plugins`),a=Z({queryKey:[`group`,e],queryFn:()=>$.group(e),enabled:e!==null}),o=a.data?.group??t?.find(t=>t.groupKey===e);return(0,V.jsx)(Cj,{open:e!==null,onOpenChange:e=>!e&&n(),title:o?.name??o?.groupId??e??``,subtitle:o?(0,V.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`font-mono`,children:o.groupId}),(0,V.jsx)(`span`,{children:EP(o.platform)})]}):void 0,children:e!==null&&(a.error&&!a.data?(0,V.jsx)(Vv,{error:a.error,onRetry:()=>void a.refetch(),retrying:a.isFetching,className:`py-16`}):a.data?(0,V.jsx)(TO,{value:r,onChange:i,className:`flex h-full flex-col`,tabs:[{value:`plugins`,label:`插件`,count:a.data.plugins.length},{value:`commands`,label:`命令`,count:a.data.commands.length},{value:`access`,label:`访问控制`}],children:(0,V.jsx)(Tg,{mode:`wait`,initial:!1,children:(0,V.jsxs)(K.div,{initial:{opacity:0,x:8},animate:{opacity:1,x:0},exit:{opacity:0,x:-8},transition:{duration:.16},className:`px-6 py-5`,children:[(0,V.jsx)(EO,{value:`plugins`,forceMount:!0,hidden:r!==`plugins`,children:r===`plugins`&&(0,V.jsx)(BF,{detail:a.data,groupKey:e})}),(0,V.jsx)(EO,{value:`commands`,forceMount:!0,hidden:r!==`commands`,children:r===`commands`&&(0,V.jsx)(VF,{detail:a.data,groupKey:e})}),(0,V.jsx)(EO,{value:`access`,forceMount:!0,hidden:r!==`access`,children:r===`access`&&(0,V.jsx)(HF,{group:a.data.group})})]},r)})}):(0,V.jsxs)(`div`,{className:`space-y-3 p-6`,children:[(0,V.jsx)(zv,{className:`h-10`}),(0,V.jsx)(zv,{className:`h-40`})]}))})}function zF(e){let t=Tj();return()=>{t.invalidateQueries({queryKey:[`group`,e]}),t.invalidateQueries({queryKey:[`groups`]}),t.invalidateQueries({queryKey:[`pluginGroups`]}),t.invalidateQueries({queryKey:[`commands`]})}}function BF({detail:e,groupKey:t}){let n=Z({queryKey:[`plugins`],queryFn:$.plugins}),[r,i]=(0,B.useState)(null),a=zF(t),o=Tj(),s=XM({mutationFn:({name:e,enabled:n})=>$.setPluginGroup(e,t,{enabled:n}),onMutate:({name:e,enabled:n})=>{o.setQueryData([`group`,t],t=>t&&{...t,plugins:t.plugins.map(t=>t.name===e?{...t,enabled:n}:t)})},onSettled:a});return e.plugins.length===0?(0,V.jsx)(Bv,{icon:(0,V.jsx)(mi,{}),title:`没有已加载的插件`,className:`py-10`}):(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsx)(`p`,{className:`text-[13px] leading-relaxed text-fg-3`,children:`插件开关与配置仅应用于这台机器人的当前群。配置按全局、机器人、群组逐层继承,保存覆盖后立即生效。`}),(0,V.jsx)(`ul`,{className:`space-y-2`,children:e.plugins.map(e=>{let o=n.data?.find(t=>t.name===e.name),c=r===e.name;return(0,V.jsxs)(`li`,{className:`overflow-hidden rounded-xl border border-border`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3`,children:[(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-[13.5px] font-medium`,children:e.name}),e.override&&(0,V.jsx)(Pv,{tone:`accent`,children:`配置已覆盖`})]}),o?.description&&(0,V.jsx)(`div`,{className:`mt-0.5 truncate text-[12px] text-fg-3`,children:o.description})]}),e.configurable&&(0,V.jsxs)(X,{variant:`ghost`,size:`sm`,onClick:()=>i(c?null:e.name),children:[(0,V.jsx)(mi,{className:`size-3.5`}),`配置`,(0,V.jsx)(K.span,{animate:{rotate:c?90:0},transition:q,children:(0,V.jsx)(cn,{className:`size-3.5`})})]}),(0,V.jsx)(hA,{"aria-label":`在这个群启用 ${e.name}`,checked:e.enabled,onCheckedChange:t=>s.mutate({name:e.name,enabled:t})})]}),(0,V.jsx)(Tg,{initial:!1,children:c&&o&&(0,V.jsx)(K.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:q,className:`overflow-hidden`,children:(0,V.jsx)(`div`,{className:`border-t border-border bg-surface-2/40 px-4 py-4`,children:(0,V.jsx)(XP,{plugin:o,inherited:e.inheritedConfig,effective:e.effectiveConfig,override:e.override,sources:e.configSources??{},save:e=>$.setPluginGroup(o.name,t,{config:e}),onSaved:a})})})})]},e.name)})})]})}function VF({detail:e,groupKey:t}){let n=zF(t),r=Tj(),[i,a]=(0,B.useState)(``),o=XM({mutationFn:({path:e,enabled:n})=>$.setCommandGroup(e,t,n),onMutate:({path:e,enabled:n})=>{r.setQueryData([`group`,t],t=>t&&{...t,commands:t.commands.map(t=>t.path===e?{...t,enabled:n}:t)})},onSettled:n}),s=i.trim().toLowerCase(),c=e.commands.filter(e=>!s||e.path.toLowerCase().includes(s));return e.commands.length===0?(0,V.jsx)(Bv,{icon:(0,V.jsx)(Mi,{}),title:`没有已注册的命令`,className:`py-10`}):(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,V.jsx)(`p`,{className:`text-[13px] text-fg-3`,children:`在这个群停用的命令等于不存在,消息会交给其他处理器。`}),(0,V.jsx)(FO,{icon:(0,V.jsx)(ui,{}),placeholder:`搜索命令`,value:i,onChange:e=>a(e.target.value),className:`w-44`})]}),(0,V.jsx)(`ul`,{className:`divide-y divide-border rounded-xl border border-border`,children:c.map(e=>(0,V.jsxs)(`li`,{className:z(`flex items-center gap-3 px-4 py-2.5 transition-opacity`,!e.enabled&&`opacity-60`),children:[(0,V.jsxs)(`code`,{className:z(`font-mono text-[13px]`,!e.enabled&&`line-through`),children:[`/`,e.path]}),(0,V.jsx)(`span`,{className:`text-[12px] text-fg-3`,children:e.owner}),(0,V.jsx)(hA,{"aria-label":`在这个群启用 /${e.path}`,checked:e.enabled,onCheckedChange:t=>o.mutate({path:e.path,enabled:t}),className:`ml-auto`})]},e.path))})]})}function HF({group:e}){let t=Tj(),n=zF(e.groupKey),r=t=>({list:t,subject:`group`,key:`${e.platform}:${e.groupId}`}),i=XM({mutationFn:async({add:e,remove:t})=>{t&&await $.removeAcl(t),e&&await $.addAcl(e)},onSuccess:()=>{t.invalidateQueries({queryKey:[`acl`]}),n()}}),a=e.access;return(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(`p`,{className:`text-[13px] text-fg-3`,children:`访问控制按平台和群共享,会同时影响其他机器人收到的这个群的事件。`}),[{list:`block`,title:`屏蔽这个群`,description:`这个群发来的所有事件都会被忽略(超管除外)。`,icon:(0,V.jsx)(zt,{className:`size-4`})},{list:`allow`,title:`加入白名单`,description:`群白名单非空时,只有名单中的群能使用机器人;私聊不受影响。`,icon:(0,V.jsx)(mn,{className:`size-4`})}].map(e=>{let t=a===e.list;return(0,V.jsxs)(`div`,{className:z(`flex items-center gap-4 rounded-xl border px-4 py-3.5 transition-colors`,t?e.list===`block`?`border-danger/40 bg-danger-soft/40`:`border-success/40 bg-success-soft/40`:`border-border`),children:[(0,V.jsx)(`span`,{className:z(e.list===`block`?`text-danger`:`text-success`),children:e.icon}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`div`,{className:`text-[13.5px] font-medium`,children:e.title}),(0,V.jsx)(`p`,{className:`mt-0.5 text-[12px] text-fg-3`,children:e.description})]}),(0,V.jsx)(X,{variant:t?`ghost`:`secondary`,size:`sm`,loading:i.isPending&&i.variables?.add?.list===e.list,onClick:()=>i.mutate(t?{remove:r(e.list)}:{add:r(e.list),...a?{remove:r(a)}:{}}),children:t?`取消`:e.list===`block`?`屏蔽`:`加入`})]},e.list)}),(0,V.jsxs)(`p`,{className:`flex items-center gap-1.5 pt-1 text-[12px] text-fg-3`,children:[(0,V.jsx)(bi,{className:`size-3.5`}),`完整的名单在“访问控制”页面管理。`]})]})}function UF({eventId:e}){let t=Z({queryKey:[`trace`,e],queryFn:()=>$.ext(`history`,`GET`,`/traces/${encodeURIComponent(e)}`),retry:!1,staleTime:1/0}),n=Z({queryKey:[`logs`,`event`,e],queryFn:()=>$.logs(200,e),staleTime:3e4});return t.isPending?(0,V.jsx)(zv,{className:`h-20`}):t.error?(0,V.jsx)(`p`,{className:`text-[12.5px] text-fg-3`,children:t.error instanceof PN&&t.error.status===404?`这条消息没有处理记录(可能早于记录开始,或已被清理)。`:`无法加载处理记录:${t.error.message}`}):(0,V.jsx)(JA,{trace:t.data,logs:n.data})}var WF=50;function GF(){let e=Z({queryKey:[`groups`],queryFn:()=>$.groups()});return(0,B.useMemo)(()=>new Map((e.data??[]).flatMap(e=>e.name?[[e.groupKey,e.name]]:[])),[e.data])}function KF(e,t,n){return e.type===`group`?t.get(`${e.platform}:${e.selfId}:group:${e.id}`)??`群 ${e.id}`:n?`${n}(私聊)`:`私聊 ${e.id}`}function qF(e,t){return t?`${e} · 话题 ${t}`:e}function JF(e,t){return KF(e,t,e.last.direction===`in`?e.last.nickname:void 0)}function YF(){let e=Tj(),t=GF(),[n,r]=(0,B.useState)(null),[i,a]=(0,B.useState)(``),[o,s]=(0,B.useState)(``),c=(0,B.useDeferredValue)(o.trim()),l=tP(),u=Z({queryKey:[`history`,`channels`],queryFn:()=>$.ext(`history`,`GET`,`/channels`)}),d=ZM({queryKey:[`history`,`messages`,n,c],initialPageParam:void 0,queryFn:({pageParam:e})=>{let t=new URLSearchParams({limit:String(WF)});return n&&t.set(`channel`,n),c&&t.set(`q`,c),e!==void 0&&t.set(`before`,String(e)),$.ext(`history`,`GET`,`/messages?${t}`)},getNextPageParam:e=>e.more?e.items.at(-1)?.id:void 0}),f=l[0]?.time;(0,B.useEffect)(()=>{if(f===void 0)return;let t=window.setTimeout(()=>{e.invalidateQueries({queryKey:[`history`,`channels`]}),e.invalidateQueries({queryKey:[`history`,`messages`]})},600);return()=>window.clearTimeout(t)},[f,e]);let p=(0,B.useMemo)(()=>{let e=i.trim().toLowerCase();return(u.data??[]).filter(n=>!e||n.id.toLowerCase().includes(e)||n.thread?.id.toLowerCase().includes(e)||JF(n,t).toLowerCase().includes(e))},[u.data,i,t]),m=u.data?.find(e=>e.channel===n),h=m?qF(JF(m,t),m.thread?.id):`全部会话`,g=(0,B.useMemo)(()=>(d.data?.pages.flatMap(e=>e.items)??[]).toReversed(),[d.data]),_=(0,B.useRef)(null),v=(0,B.useRef)(null),y=d.data?.pages.length??0;(0,B.useLayoutEffect)(()=>{let e=_.current;if(!e||g.length===0)return;let t=v.current;!t||t.atBottom?e.scrollTop=e.scrollHeight:y>t.pages&&(e.scrollTop=e.scrollHeight-t.fromBottom)},[g,y]);let b=()=>{let e=_.current;if(!e)return;let t=e.scrollHeight-e.scrollTop;v.current={pages:y,fromBottom:t,atBottom:t-e.clientHeight<40}},x=e=>{v.current=null,r(e)};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Hv,{title:`消息记录`,description:`history 插件记录的收发消息,以及每条消息经过了哪些插件处理`,actions:(0,V.jsxs)(X,{variant:`secondary`,onClick:()=>{let e=n?`?channel=${encodeURIComponent(n)}`:``;window.location.href=`/api/panel/ext/history/export${e}`},children:[(0,V.jsx)(An,{className:`size-3.5`}),n?`导出这个会话`:`导出全部`]})}),(0,V.jsxs)(`div`,{className:`grid gap-3 lg:grid-cols-[300px_1fr]`,children:[(0,V.jsxs)(J,{className:`flex h-[calc(100dvh-190px)] min-h-[480px] flex-col overflow-hidden`,children:[(0,V.jsx)(`div`,{className:`border-b border-border p-3`,children:(0,V.jsx)(FO,{icon:(0,V.jsx)(ui,{}),placeholder:`筛选会话`,value:i,onChange:e=>a(e.target.value)})}),(0,V.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-1.5`,children:[(0,V.jsx)(XF,{active:n===null,onClick:()=>x(null),title:`全部会话`,subtitle:u.data?`${u.data.length} 个会话`:void 0,icon:(0,V.jsx)(er,{className:`size-4`})}),u.error&&!u.data?(0,V.jsx)(Vv,{error:u.error,onRetry:()=>void u.refetch(),retrying:u.isFetching,className:`py-8`}):u.data?p.map(e=>(0,V.jsx)(XF,{active:n===e.channel,onClick:()=>x(e.channel),title:JF(e,t),threadId:e.thread?.id,subtitle:`${e.last.direction===`out`?`机器人:`:e.last.nickname?`${e.last.nickname}:`:``}${e.last.text||`[非文本消息]`}`,time:e.last.time,icon:e.thread?(0,V.jsx)(br,{className:`size-4`}):e.type===`group`?(0,V.jsx)(`span`,{className:`text-[12px] font-medium`,children:JF(e,t).slice(0,1)}):(0,V.jsx)(ct,{id:e.id,name:e.last.nickname,size:32})},e.channel)):(0,V.jsxs)(`div`,{className:`space-y-1.5 p-1.5`,children:[(0,V.jsx)(zv,{className:`h-12`}),(0,V.jsx)(zv,{className:`h-12`}),(0,V.jsx)(zv,{className:`h-12`})]})]})]}),(0,V.jsxs)(J,{className:`flex h-[calc(100dvh-190px)] min-h-[480px] flex-col overflow-hidden`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-border px-5 py-3`,children:[(0,V.jsxs)(`div`,{className:`min-w-0 leading-tight`,children:[(0,V.jsx)(`div`,{className:`truncate text-[13.5px] font-semibold`,title:h,children:h}),(0,V.jsx)(`div`,{className:`text-[11.5px] text-fg-3`,children:m?`${EP(m.platform)} · 机器人 ${m.selfId} · 共 ${m.count} 条`:`所有会话的消息按时间排列`})]}),(0,V.jsx)(FO,{icon:(0,V.jsx)(ui,{}),placeholder:`搜索消息内容`,value:o,onChange:e=>{v.current=null,s(e.target.value)},className:`w-56`})]}),(0,V.jsx)(`div`,{ref:_,onScroll:b,className:`flex-1 overflow-y-auto px-5 py-4`,children:d.error&&!d.data?(0,V.jsx)(Vv,{error:d.error,onRetry:()=>void d.refetch(),retrying:d.isFetching}):d.data?g.length===0?(0,V.jsx)(Bv,{icon:(0,V.jsx)(br,{}),title:c?`没有匹配的消息`:`还没有消息记录`,description:c?void 0:`机器人收发消息后会出现在这里。`}):(0,V.jsxs)(`div`,{className:`space-y-1`,children:[d.hasNextPage&&(0,V.jsx)(`div`,{className:`flex justify-center pb-2`,children:(0,V.jsx)(X,{variant:`ghost`,size:`sm`,loading:d.isFetchingNextPage,onClick:()=>void d.fetchNextPage(),children:`加载更早的消息`})}),g.map(e=>(0,V.jsx)(ZF,{message:e,showChannel:n===null,names:t},e.id))]}):(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(zv,{className:`h-14`}),(0,V.jsx)(zv,{className:`h-14`}),(0,V.jsx)(zv,{className:`h-14`})]})})]})]})]})}function XF({active:e,onClick:t,title:n,threadId:r,subtitle:i,time:a,icon:o}){return(0,V.jsxs)(`button`,{type:`button`,onClick:t,"aria-pressed":e,"aria-label":r?qF(n,r):void 0,title:qF(n,r),className:z(`relative flex w-full cursor-pointer items-center gap-2.5 rounded-[10px] px-2.5 py-2 text-left transition-colors`,e?`text-fg`:`text-fg-2 hover:bg-surface-2/70`),children:[e&&(0,V.jsx)(K.span,{layoutId:`history-channel`,transition:q,className:`absolute inset-0 rounded-[10px] bg-accent-soft`}),(0,V.jsx)(`span`,{className:`relative flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-[9px] bg-surface-2 text-fg-2`,children:o}),(0,V.jsxs)(`span`,{className:`relative min-w-0 flex-1`,children:[(0,V.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] font-medium`,children:n}),r&&(0,V.jsxs)(`span`,{className:`shrink-0 text-[11px] text-fg-3`,children:[`话题 `,r.slice(-6)]}),a!==void 0&&(0,V.jsx)(`span`,{className:`shrink-0 text-[11px] text-fg-3`,children:CF(a)})]}),i&&(0,V.jsx)(`span`,{className:`block truncate text-[12px] text-fg-3`,children:i})]})]})}function ZF({message:e,showChannel:t,names:n}){let[r,i]=(0,B.useState)(!1),a=e.direction===`out`,o=e.direction===`in`&&e.eventId!==void 0;return(0,V.jsxs)(`div`,{className:z(`group rounded-xl px-2 py-2 transition-colors`,r?`bg-surface-2/60`:`hover:bg-surface-2/40`),children:[(0,V.jsxs)(`div`,{className:`flex gap-3`,children:[a?(0,V.jsx)(Qv,{className:`size-8 shrink-0`}):(0,V.jsx)(ct,{id:e.userId??`?`,name:e.nickname,size:32}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2 text-[12px]`,children:[(0,V.jsx)(`span`,{className:z(`font-medium`,a?`text-accent`:`text-fg`),children:a?`机器人`:e.nickname??e.userId}),!a&&e.nickname&&(0,V.jsx)(`span`,{className:`font-mono text-fg-3`,children:e.userId}),t&&(0,V.jsx)(`span`,{className:`break-all text-fg-3`,children:qF(KF(e.target,n),e.target.thread?.id)}),(0,V.jsx)(`span`,{className:`text-fg-3 tabular`,children:Jv(e.time)}),o&&(0,V.jsxs)(`button`,{type:`button`,onClick:()=>i(!r),className:z(`ml-auto inline-flex cursor-pointer items-center gap-1 rounded-md px-1.5 text-[11.5px] transition-opacity`,r?`text-accent`:`text-fg-3 opacity-0 group-hover:opacity-100 hover:text-fg-2`),children:[(0,V.jsx)(ea,{className:`size-3`}),`处理链`,(0,V.jsx)(K.span,{animate:{rotate:r?180:0},transition:q,children:(0,V.jsx)(rn,{className:`size-3`})})]})]}),(0,V.jsx)(`div`,{className:`mt-0.5 text-[13.5px] leading-relaxed break-words whitespace-pre-wrap text-fg`,children:(0,V.jsx)(HA,{message:e.message})})]})]}),(0,V.jsx)(Tg,{initial:!1,children:r&&e.eventId&&(0,V.jsx)(K.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:q,className:`overflow-hidden`,children:(0,V.jsx)(`div`,{className:`mt-2 ml-11 rounded-xl border border-border bg-surface px-4 py-3`,children:(0,V.jsx)(UF,{eventId:e.eventId})})})})]})}var QF=[{value:`trace`,label:`Trace`},{value:`debug`,label:`Debug`},{value:`info`,label:`Info`},{value:`warn`,label:`Warn`},{value:`error`,label:`Error`}],$F=new Set([`time`,`level`,`msg`,`plugin`,`eventId`,`pid`,`hostname`,`seq`]);function eI(){let e=uP(),t=(0,B.useMemo)(()=>new URLSearchParams(e.split(`?`)[1]),[e]),n=eP(),r=iP(),[i,a]=(0,B.useState)(`10`),[o,s]=(0,B.useState)(`*`),[c,l]=(0,B.useState)(``);(0,B.useEffect)(()=>{let t=new URLSearchParams(e.split(`?`)[1]);s(t.get(`plugin`)??`*`)},[e]);let[u,d]=(0,B.useState)(null),[f,p]=(0,B.useState)(!1),[m,h]=(0,B.useState)(null),[g,_]=(0,B.useState)(!0),v=(0,B.useRef)(null),y=f&&m?m:n,b=(0,B.useMemo)(()=>[...new Set(n.map(e=>e.plugin).filter(e=>!!e))].sort(),[n]),x=(0,B.useMemo)(()=>{let e=c.trim().toLowerCase(),n=Number(i);return y.filter(r=>r.level>=n&&(!t.has(`connectionId`)||r.connectionId===t.get(`connectionId`))&&(!t.has(`platform`)||r.platform===t.get(`platform`))&&(!t.has(`selfId`)||r.selfId===t.get(`selfId`))&&(u===null||r.eventId===u)&&(o===`*`||(o===`-`?!r.plugin:r.plugin===o))&&(!e||r.msg.toLowerCase().includes(e)||JSON.stringify(r).toLowerCase().includes(e))).slice(-600)},[y,i,o,c,u,t]);return(0,B.useEffect)(()=>{let e=v.current;e&&g&&x.length>0&&(e.scrollTop=e.scrollHeight)},[x,g]),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Hv,{title:`日志`,description:`实时日志,保留最近 2000 条`,actions:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(tI,{}),(0,V.jsxs)(X,{variant:f?`primary`:`secondary`,onClick:()=>{h(f?null:n),p(!f)},children:[f?(0,V.jsx)(Br,{className:`size-3.5`}):(0,V.jsx)(Ir,{className:`size-3.5`}),f?`继续`:`暂停`]}),(0,V.jsxs)(X,{variant:`ghost`,onClick:r,children:[(0,V.jsx)(In,{className:`size-3.5`}),`清空`]})]})}),(0,V.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center gap-2`,children:[(t.has(`connectionId`)||t.has(`selfId`))&&(0,V.jsxs)(`span`,{className:`inline-flex max-w-full items-center gap-1.5 rounded-lg border border-border py-1 pr-1 pl-2.5 text-xs text-fg-2`,children:[(0,V.jsx)(`span`,{className:`truncate`,children:t.has(`connectionId`)?`连接:${t.get(`connectionId`)}`:`机器人:${t.get(`platform`)} · ${t.get(`selfId`)}`}),(0,V.jsx)(`button`,{type:`button`,"aria-label":`清除来源范围`,className:`rounded p-1 hover:bg-surface-2`,onClick:()=>{let e=new URLSearchParams(t);e.delete(`connectionId`),e.delete(`selfId`),e.delete(`platform`),sP(`/logs${e.size?`?${e}`:``}`)},children:(0,V.jsx)(ia,{className:`size-3.5`})})]}),(0,V.jsx)(CO,{value:i,onChange:a,options:[{value:`10`,label:`全部`},{value:`30`,label:`Info+`},{value:`40`,label:`Warn+`},{value:`50`,label:`Error`}]}),(0,V.jsx)(Zk,{"aria-label":`按插件过滤`,value:o,onValueChange:s,options:[{value:`*`,label:`全部来源`},{value:`-`,label:`框架`},...b.map(e=>({value:e,label:e}))]}),u!==null&&(0,V.jsxs)(`span`,{className:`inline-flex h-8 items-center gap-1.5 rounded-lg border border-accent/30 bg-accent-soft py-0 pr-1 pl-2.5 text-[12.5px] text-accent-soft-fg`,children:[(0,V.jsx)(ea,{className:`size-3.5`}),`只看事件 `,(0,V.jsx)(`span`,{className:`font-mono`,children:u.slice(0,8)}),(0,V.jsx)(`button`,{type:`button`,"aria-label":`取消按事件过滤`,onClick:()=>d(null),className:`flex size-6 cursor-pointer items-center justify-center rounded-md hover:bg-accent/10`,children:(0,V.jsx)(ia,{className:`size-3.5`})})]}),(0,V.jsx)(FO,{icon:(0,V.jsx)(ui,{}),placeholder:`搜索日志内容`,value:c,onChange:e=>l(e.target.value),className:`ml-auto w-64`})]}),(0,V.jsxs)(J,{className:`relative overflow-hidden`,children:[(0,V.jsx)(`div`,{ref:v,onScroll:e=>{let t=e.currentTarget;_(t.scrollHeight-t.scrollTop-t.clientHeight<40)},className:`h-[calc(100vh-270px)] min-h-[360px] overflow-y-auto py-1.5 font-mono text-[12.5px]`,children:x.length===0?(0,V.jsx)(Bv,{icon:(0,V.jsx)(ci,{}),title:y.length===0?`暂无日志`:`没有匹配的日志`,className:`h-full`}):x.map(e=>(0,V.jsx)(nI,{record:e,onEvent:d},e.seq))}),(0,V.jsx)(Tg,{children:!g&&(0,V.jsx)(K.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:8},transition:q,className:`absolute right-4 bottom-4`,children:(0,V.jsxs)(X,{variant:`secondary`,size:`sm`,className:`shadow-pop`,onClick:()=>{_(!0),v.current?.scrollTo({top:v.current.scrollHeight,behavior:`smooth`})},children:[(0,V.jsx)(Dt,{className:`size-3.5`}),`最新`]})})}),f&&(0,V.jsx)(`div`,{className:`absolute top-3 right-4 rounded-md bg-warning-soft px-2 py-0.5 font-sans text-[11.5px] font-medium text-warning`,children:`已暂停`})]})]})}function tI(){let e=Tj(),t=Z({queryKey:[`log-level`],queryFn:$.logLevel}),n=XM({mutationFn:$.setLogLevel,onSuccess:t=>{e.setQueryData([`log-level`],t),vN.success(`记录级别已调整为 ${t.level}`,{description:`仅本次运行有效,重启后恢复为配置文件中的 log.level`})}});return t.error?null:(0,V.jsxs)(`div`,{className:`mr-1 flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-[12.5px] text-fg-3`,children:`记录级别`}),(0,V.jsx)(Zk,{"aria-label":`记录级别`,value:t.data?.level,onValueChange:e=>n.mutate(e),options:QF,placeholder:`…`,className:`min-w-24`})]})}var nI=(0,B.memo)(function({record:e,onEvent:t}){let[n,r]=(0,B.useState)(!1),i=Xv(e.level),a=Object.fromEntries(Object.entries(e).filter(([e])=>!$F.has(e))),o=Object.keys(a).length>0;return(0,V.jsxs)(`div`,{className:z(`group relative [content-visibility:auto] [contain-intrinsic-size:auto_28px]`,n&&`bg-surface-2/60`),children:[(0,V.jsxs)(`button`,{type:`button`,onClick:()=>o&&r(!n),className:z(`flex w-full items-start gap-3 px-4 py-[5px] text-left transition-colors hover:bg-surface-2/60`,o&&`cursor-pointer`),children:[(0,V.jsx)(`span`,{className:`shrink-0 text-fg-3 tabular`,children:Jv(e.time)}),(0,V.jsx)(`span`,{className:z(`w-12 shrink-0 rounded px-1 text-center text-[11px] leading-[18px] font-medium uppercase`,Zv[i]),children:i}),e.plugin&&(0,V.jsx)(`span`,{className:`shrink-0 rounded bg-accent-soft px-1.5 text-[11.5px] leading-[18px] text-accent-soft-fg`,children:e.plugin}),(0,V.jsx)(`span`,{className:z(`min-w-0 flex-1 break-words whitespace-pre-wrap`,e.level>=50?`text-danger`:`text-fg`),children:e.msg})]}),e.eventId&&(0,V.jsxs)(`button`,{type:`button`,title:`只看这次事件处理产生的日志`,onClick:()=>t(e.eventId),className:`absolute top-[5px] right-4 cursor-pointer rounded bg-surface-2 px-1.5 font-mono text-[11px] leading-[18px] text-fg-3 opacity-0 transition-opacity group-hover:opacity-100 hover:text-fg-2 focus-visible:opacity-100`,children:[`事件 `,e.eventId.slice(0,8)]}),(0,V.jsx)(Tg,{initial:!1,children:n&&(0,V.jsx)(K.pre,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:q,className:`overflow-hidden px-4 pl-[170px] text-[12px] leading-relaxed text-fg-2`,children:(0,V.jsx)(`code`,{className:`block pb-2`,children:JSON.stringify(a,null,2)})})})]})});function rI(){return(0,V.jsx)(J,{className:`mt-10`,children:(0,V.jsx)(Bv,{icon:(0,V.jsx)(bn,{}),title:`页面不存在`,description:`这个地址没有对应的页面。`,action:(0,V.jsx)(X,{variant:`primary`,onClick:()=>sP(`/`),children:`回到概览`})})})}function iI(){let e=Z({queryKey:[`overview`],queryFn:$.overview,refetchInterval:6e4}),[t,n]=(0,B.useState)(`1h`),r=Z({queryKey:[`stats`,t],queryFn:()=>$.stats(t),refetchInterval:t===`24h`&&3e5,placeholderData:e=>e}),i=e.data,a=i?.bots.filter(e=>e.status===`online`).length??0;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Hv,{title:`概览`,description:new Date().toLocaleDateString(`zh-CN`,{month:`long`,day:`numeric`,weekday:`long`})}),e.error&&!e.data&&(0,V.jsx)(J,{className:`mb-3`,children:(0,V.jsx)(Vv,{error:e.error,onRetry:()=>void e.refetch(),retrying:e.isFetching,className:`py-8`})}),(0,V.jsxs)(K.div,{variants:Av,initial:`initial`,animate:`animate`,className:`grid grid-cols-2 gap-3 lg:grid-cols-4`,children:[(0,V.jsx)(aI,{icon:(0,V.jsx)(Gt,{}),label:`在线机器人`,loading:!i,value:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(AO,{value:a}),(0,V.jsxs)(`span`,{className:`text-fg-3`,children:[` / `,i?.bots.length??0]})]}),footer:i&&i.bots.length===0?`尚未配置连接`:a===i?.bots.length?(0,V.jsx)(`span`,{className:`text-success`,children:`全部在线`}):(0,V.jsxs)(`span`,{className:`text-warning`,children:[(i?.bots.length??0)-a,` 个离线`]})}),(0,V.jsx)(aI,{icon:(0,V.jsx)(Tt,{}),label:`今日收到`,loading:!i,value:(0,V.jsx)(AO,{value:i?.today.received??0}),footer:`条消息`}),(0,V.jsx)(aI,{icon:(0,V.jsx)(Nt,{}),label:`今日发出`,loading:!i,value:(0,V.jsx)(AO,{value:i?.today.sent??0}),footer:`条消息`}),(0,V.jsx)(aI,{icon:(0,V.jsx)(Wr,{}),label:`运行中插件`,loading:!i,value:(0,V.jsx)(AO,{value:i?.plugins.active??0}),footer:i&&i.plugins.failed>0?(0,V.jsxs)(lP,{to:`/plugins`,className:`text-danger hover:underline`,children:[i.plugins.failed,` 个加载失败`]}):`${i?.plugins.disabled??0} 个已停用`})]}),(0,V.jsxs)(`div`,{className:`mt-3 grid gap-3 lg:grid-cols-3`,children:[(0,V.jsx)(K.div,{className:`lg:col-span-2`,initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{...q,delay:.12},children:(0,V.jsxs)(J,{className:`h-full pb-3`,children:[(0,V.jsx)(Mv,{title:`消息趋势`,description:t===`1h`?`最近一小时,按分钟统计`:`最近 24 小时,每 15 分钟统计`,action:(0,V.jsx)(CO,{size:`sm`,value:t,onChange:n,options:[{value:`1h`,label:`1 小时`},{value:`24h`,label:`24 小时`}]})}),r.error&&!r.data?(0,V.jsx)(Vv,{error:r.error,onRetry:()=>void r.refetch(),retrying:r.isFetching,className:`py-12`}):r.data?(0,V.jsx)(iy,{points:r.data,range:t,dimmed:r.isPlaceholderData}):(0,V.jsx)(`div`,{className:`px-5 pt-8 pb-4`,children:(0,V.jsx)(zv,{className:`h-[232px] w-full`})})]})}),(0,V.jsx)(K.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{...q,delay:.16},children:(0,V.jsx)(cI,{bots:i?.bots})})]}),(0,V.jsxs)(`div`,{className:`mt-3 grid gap-3 lg:grid-cols-3`,children:[(0,V.jsx)(K.div,{className:`lg:col-span-2`,initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{...q,delay:.2},children:(0,V.jsx)(lI,{})}),(0,V.jsx)(K.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{...q,delay:.24},children:(0,V.jsx)(uI,{startedAt:i?.startedAt,rss:i?.memory.rss,heap:i?.memory.heapUsed,node:i?.node,version:i?.version})})]})]})}function aI({icon:e,label:t,value:n,footer:r,loading:i}){return(0,V.jsx)(K.div,{variants:jv,whileHover:{y:-2},transition:q,children:(0,V.jsxs)(J,{className:`group relative overflow-hidden px-5 pt-4 pb-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between text-[12.5px] text-fg-3`,children:[t,(0,V.jsx)(`span`,{className:`flex size-7 items-center justify-center rounded-lg bg-surface-2 text-fg-3 transition-colors group-hover:bg-accent-soft group-hover:text-accent-soft-fg [&>svg]:size-3.5`,children:e})]}),i?(0,V.jsx)(zv,{className:`mt-2 h-8 w-20`}):(0,V.jsx)(`div`,{className:`mt-1.5 text-[28px] leading-9 font-semibold tracking-[-0.03em] text-fg`,children:n}),(0,V.jsx)(`div`,{className:`mt-1 text-[12px] text-fg-3`,children:r})]})})}function oI(e){return e.status===`online`?`success`:e.status===`connecting`?`warning`:`danger`}var sI={online:`在线`,connecting:`连接中`,offline:`离线`};function cI({bots:e}){return(0,V.jsxs)(J,{className:`flex h-full flex-col`,children:[(0,V.jsx)(Mv,{title:`机器人`,description:`账号与连接状态`,action:(0,V.jsx)(lP,{to:`/bots`,className:`text-[12.5px] text-fg-3 hover:text-fg`,children:`查看`})}),(0,V.jsx)(`div`,{className:`px-2 pb-3`,children:e?e.length===0?(0,V.jsx)(Bv,{icon:(0,V.jsx)(Kr,{}),title:`还没有连接`,description:`在配置文件的 adapters 段配置一个适配器,例如 OneBot 11 的正向或反向 WS。`,className:`py-8`}):(0,V.jsx)(`ul`,{children:e.map(e=>(0,V.jsxs)(`li`,{className:`flex items-center gap-3 rounded-xl px-3 py-2.5 transition-colors hover:bg-surface-2/70`,children:[(0,V.jsx)(ct,{id:e.selfId,name:jP(e),src:e.avatar,size:34}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`div`,{className:`truncate text-[13.5px] font-medium`,children:jP(e)}),(0,V.jsxs)(`div`,{className:`truncate font-mono text-[11.5px] text-fg-3`,children:[e.selfId,` · `,e.connection]})]}),(0,V.jsx)(Pv,{tone:oI(e),dot:!0,pulse:e.status===`online`,children:sI[e.status]})]},`${e.platform}:${e.selfId}`))}):(0,V.jsxs)(`div`,{className:`space-y-2 px-3`,children:[(0,V.jsx)(zv,{className:`h-12`}),(0,V.jsx)(zv,{className:`h-12`})]})}),(0,V.jsxs)(`div`,{className:`mt-auto border-t border-border px-2 py-2`,children:[(0,V.jsx)(`div`,{className:`px-3 pt-1 pb-1.5 text-[11.5px] font-medium text-fg-3`,children:`快捷入口`}),[{to:`/playground`,icon:(0,V.jsx)(Hn,{}),label:`在调试台试用插件`},{to:`/plugins`,icon:(0,V.jsx)(Wr,{}),label:`管理插件与配置`},{to:`/logs`,icon:(0,V.jsx)(ci,{}),label:`查看实时日志`}].map(e=>(0,V.jsxs)(lP,{to:e.to,className:`group flex h-9 items-center gap-2.5 rounded-lg px-3 text-[13px] text-fg-2 transition-colors hover:bg-surface-2/70 hover:text-fg [&>svg:first-child]:size-3.5 [&>svg:first-child]:text-fg-3`,children:[e.icon,(0,V.jsx)(`span`,{className:`flex-1`,children:e.label}),(0,V.jsx)(cn,{className:`size-3.5 text-fg-3 transition-transform group-hover:translate-x-0.5`})]},e.to))]})]})}function lI(){let e=tP(),[,t]=(0,B.useState)(0);return(0,B.useEffect)(()=>{let e=window.setInterval(()=>t(e=>e+1),15e3);return()=>window.clearInterval(e)},[]),(0,V.jsxs)(J,{className:`h-full`,children:[(0,V.jsx)(Mv,{title:`实时消息`,description:`机器人收到和发出的消息`,action:(0,V.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[12px] text-fg-3`,children:[(0,V.jsxs)(`span`,{className:`relative flex size-1.5`,children:[(0,V.jsx)(`span`,{className:`absolute inset-0 rounded-full bg-success motion-safe:animate-pulse-soft`}),(0,V.jsx)(`span`,{className:`relative size-full rounded-full bg-success`})]}),`实时`]})}),(0,V.jsx)(`div`,{className:`h-[316px] overflow-hidden px-2 pb-2 [mask-image:linear-gradient(to_bottom,black_85%,transparent)]`,children:e.length===0?(0,V.jsx)(Bv,{icon:(0,V.jsx)(br,{}),title:`等待消息中`,description:`有人和机器人说话时,消息会出现在这里。`,className:`py-12`}):(0,V.jsx)(`ul`,{children:(0,V.jsx)(Tg,{initial:!1,children:e.slice(0,14).map(e=>(0,V.jsxs)(K.li,{layout:!0,initial:{opacity:0,y:-14,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0},transition:q,className:`flex items-start gap-3 rounded-xl px-3 py-2`,children:[(0,V.jsx)(ct,{id:e.direction===`out`?e.selfId:e.userId??`?`,name:e.direction===`out`?`Bot`:e.nickname,src:e.avatar,size:28}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-[12px]`,children:[(0,V.jsx)(`span`,{className:`font-medium text-fg`,children:e.direction===`out`?`机器人`:e.nickname??e.userId}),(0,V.jsx)(`span`,{className:z(`rounded px-1 text-[10.5px] font-medium`,e.direction===`out`?`bg-success-soft text-success`:`bg-accent-soft text-accent-soft-fg`),children:e.direction===`out`?`发出`:`收到`}),(0,V.jsx)(`span`,{className:`truncate text-fg-3`,children:e.channel.type===`group`?`群 ${e.channel.id}`:`私聊`}),(0,V.jsx)(`span`,{className:`ml-auto shrink-0 text-fg-3 tabular`,children:CF(e.time)})]}),(0,V.jsx)(`p`,{className:`mt-0.5 truncate text-[13px] text-fg-2`,children:e.preview||`[非文本消息]`})]})]},`${e.time}-${e.direction}-${e.preview}-${e.userId??``}`))})})})]})}function uI({startedAt:e,rss:t,heap:n,node:r,version:i}){let[a,o]=(0,B.useState)(Date.now());(0,B.useEffect)(()=>{let e=window.setInterval(()=>o(Date.now()),1e3);return()=>window.clearInterval(e)},[]);let s=[{label:`已运行`,value:e?SF(a-e):`—`},{label:`内存(RSS)`,value:t?xF(t):`—`},{label:`JS 堆`,value:n?xF(n):`—`},{label:`Node.js`,value:r??`—`},{label:`AsaBot`,value:i?`v${i}`:`—`}];return(0,V.jsxs)(J,{className:`h-full`,children:[(0,V.jsx)(Mv,{title:`系统`,description:`运行环境`,action:(0,V.jsx)(En,{className:`size-4 text-fg-3`})}),(0,V.jsx)(`dl`,{className:`space-y-0.5 px-5 pb-4`,children:s.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border py-2.5 last:border-0`,children:[(0,V.jsx)(`dt`,{className:`text-[13px] text-fg-3`,children:e.label}),(0,V.jsx)(`dd`,{className:`text-[13px] font-medium text-fg tabular`,children:e.value})]},e.label))})]})}var dI={segments:[`text`],textStyles:[]},fI=1572864,pI=[{name:`notice.member.join`,label:`加入群聊`,icon:(0,V.jsx)(fr,{}),group:!0},{name:`notice.member.leave`,label:`退出群聊`,icon:(0,V.jsx)(mr,{}),group:!0},{name:`notice.member.mute`,label:`被禁言 10 分钟`,icon:(0,V.jsx)(Sr,{}),group:!0},{name:`notice.poke`,label:`戳一戳机器人`,icon:(0,V.jsx)(Jn,{})},{name:`notice.message.recall`,label:`撤回上一条消息`,icon:(0,V.jsx)(Hi,{})},{name:`request.friend`,label:`申请加好友`,icon:(0,V.jsx)(Ji,{})},{name:`request.group.join`,label:`申请加群`,icon:(0,V.jsx)(Qi,{}),group:!0},{name:`request.group.invite`,label:`邀请机器人进群`,icon:(0,V.jsx)(Vt,{}),group:!0}],mI=0;function hI(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result).replace(/^data:[^;]+;base64,/,``)),r.onerror=()=>n(r.error),r.readAsDataURL(e)})}function gI(){let e=SP(),t=Z({queryKey:[`commands`],queryFn:$.commands}),[n,r]=(0,B.useState)(`10001`),[i,a]=(0,B.useState)(`测试用户`),[o,s]=(0,B.useState)(`member`),[c,l]=(0,B.useState)(!1),[u,d]=(0,B.useState)(!1),[f,p]=(0,B.useState)(`group`),[m,h]=(0,B.useState)(`10000`),[g,_]=(0,B.useState)(``),[v,y]=(0,B.useState)(null),[b,x]=(0,B.useState)([]),[S,C]=(0,B.useState)(``),[w,T]=(0,B.useState)(null),[E,D]=(0,B.useState)([]),O=(0,B.useRef)(null),k=(0,B.useRef)(null),A=(0,B.useRef)(null);(0,B.useEffect)(()=>{e!==null&&(_(e),bP.set(null),O.current?.focus())},[e]),(0,B.useEffect)(()=>{E.length>0&&A.current?.scrollTo({top:A.current.scrollHeight,behavior:`smooth`})},[E]);let ee=()=>({id:n,nickname:i,role:f===`group`?o:void 0,superuser:c}),j=u?dI:void 0,M=(e,t)=>{let n=Date.now();D(r=>[...r.map(n=>n.id===e?{...n,...t.incoming?{messageId:t.incoming.messageId}:{},traces:t.traces,logs:t.logs}:n),...t.replies.map(e=>({id:mI++,from:`bot`,time:n,message:e.message,text:e.text,messageId:e.messageId})),...t.actions.map(e=>({id:mI++,from:`system`,time:n,text:`机器人执行了 ${e.action}${Object.keys(e.params).length>0?` ${JSON.stringify(e.params)}`:``}`})),...t.replies.length===0&&t.actions.length===0?[{id:mI++,from:`system`,time:n,text:`没有回复`}]:[]])},te=e=>D(t=>[...t,{id:mI++,from:`system`,time:Date.now(),text:`出错了:${e.message}`}]),N=XM({mutationFn:({message:e})=>$.playground({message:e,user:ee(),group:f===`group`?m:null,capabilities:j}),meta:{silent:!0},onSuccess:(e,{sourceId:t})=>M(t,e),onError:te}),P=XM({mutationFn:({name:e,fields:t})=>$.playgroundEvent({name:e,fields:t,user:ee(),group:f===`group`?m:null,capabilities:j}),meta:{silent:!0},onSuccess:(e,{sourceId:t})=>M(t,e),onError:te}),ne=N.isPending||P.isPending,re=(e=g)=>{let t=e.trim();if(!t&&!v||ne)return;let n=[...w?.messageId?[{type:`reply`,data:{id:w.messageId}}]:[],...b.flatMap(e=>[{type:`at`,data:{id:e}},{type:`text`,data:{text:` `}}]),...t?[{type:`text`,data:{text:t}}]:[],...v?[{type:`image`,data:{file:`base64://${v}`}}]:[]],r=mI++;D(e=>[...e,{id:r,from:`user`,time:Date.now(),message:n,text:t}]),_(``),y(null),x([]),T(null),N.mutate({sourceId:r,message:n})},ie=e=>{if(ne)return;let t=[...E].reverse().find(e=>e.from===`user`&&e.messageId);if(e.name===`notice.message.recall`&&!t)return vN.error(`还没有可以撤回的消息`);let n=e.name===`notice.member.mute`?{duration:6e5}:e.name===`notice.poke`?{targetId:`playground`}:e.name===`notice.message.recall`?{messageId:t?.messageId}:e.name.startsWith(`request.`)?{comment:`来自调试台的测试请求`}:void 0,r=mI++;D(t=>[...t,{id:r,from:`system`,time:Date.now(),text:`模拟事件:${e.label}`}]),P.mutate({sourceId:r,name:e.name,...n?{fields:n}:{}})},ae=e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),re())},oe=async e=>{if(e){if(!e.type.startsWith(`image/`))return vN.error(`只能附加图片`);if(e.size>fI)return vN.error(`图片不能超过 1.5 MB`);y(await hI(e))}},se=e=>E.find(t=>t.messageId===e),ce=(t.data??[]).filter(e=>!e.hidden).slice(0,8),le=(g.trim().length>0||v!==null)&&!ne;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Hv,{title:`调试台`,description:`模拟用户给机器人发消息或触发事件,走真实的插件和命令,但不会发到任何聊天平台`}),(0,V.jsxs)(`div`,{className:`grid gap-3 lg:grid-cols-[300px_1fr]`,children:[(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsxs)(J,{children:[(0,V.jsx)(Mv,{title:`身份`,description:`以谁的身份发言`}),(0,V.jsxs)(`div`,{className:`space-y-4 px-5 pb-5`,children:[(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,V.jsx)(LO,{label:`用户 ID`,htmlFor:`pg-user`,children:(0,V.jsx)(FO,{id:`pg-user`,value:n,onChange:e=>r(e.target.value),className:`font-mono`})}),(0,V.jsx)(LO,{label:`昵称`,htmlFor:`pg-nick`,children:(0,V.jsx)(FO,{id:`pg-nick`,value:i,onChange:e=>a(e.target.value)})})]}),(0,V.jsx)(Tg,{initial:!1,children:f===`group`&&(0,V.jsx)(K.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:q,className:`overflow-hidden`,children:(0,V.jsx)(LO,{label:`群角色`,children:(0,V.jsx)(CO,{className:`w-full [&>button]:flex-1`,value:o,onChange:s,options:[{value:`member`,label:(0,V.jsx)(yI,{icon:(0,V.jsx)(Xi,{className:`size-3`}),text:`成员`})},{value:`admin`,label:(0,V.jsx)(yI,{icon:(0,V.jsx)(wi,{className:`size-3`}),text:`管理员`})},{value:`owner`,label:(0,V.jsx)(yI,{icon:(0,V.jsx)(On,{className:`size-3`}),text:`群主`})}]})})})}),(0,V.jsx)(_I,{id:`pg-superuser`,title:`超管`,description:`仅在调试台内生效`,checked:c,onChange:l})]})]}),(0,V.jsxs)(J,{children:[(0,V.jsx)(Mv,{title:`会话`,description:`消息发在哪里`}),(0,V.jsxs)(`div`,{className:`grid gap-4 px-5 pb-5`,children:[(0,V.jsx)(CO,{className:`w-full [&>button]:flex-1`,value:f,onChange:p,options:[{value:`group`,label:`群聊`},{value:`private`,label:`私聊`}]}),(0,V.jsx)(Tg,{initial:!1,children:f===`group`&&(0,V.jsx)(K.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:q,className:`overflow-hidden`,children:(0,V.jsx)(LO,{label:`群号`,htmlFor:`pg-group`,hint:`群开关、白名单按这个群号判断`,children:(0,V.jsx)(FO,{id:`pg-group`,value:m,onChange:e=>h(e.target.value),className:`font-mono`})})})}),(0,V.jsx)(_I,{id:`pg-plain`,title:`模拟纯文本平台`,description:`图片、Markdown、按钮等会按平台能力降级`,checked:u,onChange:d})]})]})]}),(0,V.jsxs)(J,{className:`flex h-[calc(100dvh-200px)] min-h-[520px] flex-col overflow-hidden`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border px-5 py-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,V.jsx)(Qv,{className:`size-6`}),(0,V.jsxs)(`div`,{className:`leading-tight`,children:[(0,V.jsx)(`div`,{className:`text-[13.5px] font-semibold`,children:`AsaBot`}),(0,V.jsxs)(`div`,{className:`text-[11.5px] text-fg-3`,children:[f===`group`?`群 ${m}`:`与 ${i} 私聊`,u&&` · 纯文本平台`]})]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(DO,{trigger:(0,V.jsxs)(X,{variant:`ghost`,size:`sm`,disabled:ne,children:[(0,V.jsx)(Vt,{className:`size-3.5`}),`模拟事件`]}),children:pI.map((e,t)=>(0,V.jsxs)(`div`,{children:[t===3&&(0,V.jsx)(kO,{}),(0,V.jsx)(OO,{icon:e.icon,disabled:e.group&&f!==`group`,onSelect:()=>ie(e),children:e.label})]},e.name))}),(0,V.jsxs)(X,{variant:`ghost`,size:`sm`,disabled:E.length===0,onClick:()=>D([]),children:[(0,V.jsx)(In,{className:`size-3.5`}),`清空`]})]})]}),(0,V.jsxs)(`div`,{ref:A,className:`flex-1 space-y-3 overflow-y-auto px-5 py-5`,children:[E.length===0?(0,V.jsx)(bI,{suggestions:ce.map(e=>`/${e.path}`),onPick:e=>re(e)}):(0,V.jsx)(Tg,{initial:!1,children:E.map(e=>(0,V.jsx)(SI,{entry:e,userId:n,nickname:i,onQuote:e.messageId?()=>T(e):void 0,renderReply:e=>(0,V.jsx)(xI,{entry:se(e)})},e.id))}),(0,V.jsx)(Tg,{children:ne&&(0,V.jsx)(CI,{},`typing`)})]}),(0,V.jsxs)(`div`,{className:`border-t border-border p-3`,children:[ce.length>0&&E.length>0&&(0,V.jsx)(`div`,{className:`mb-2 flex gap-1.5 overflow-x-auto pb-1`,children:ce.map(e=>(0,V.jsxs)(`button`,{type:`button`,onClick:()=>{_(`/${e.path} `),O.current?.focus()},className:`shrink-0 cursor-pointer rounded-lg border border-border bg-surface px-2 py-1 font-mono text-[12px] text-fg-2 transition-colors hover:border-border-strong hover:text-fg`,children:[`/`,e.path]},e.path))}),(0,V.jsx)(Tg,{initial:!1,children:(w||b.length>0||v)&&(0,V.jsx)(K.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:q,className:`overflow-hidden`,children:(0,V.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-center gap-1.5`,children:[w&&(0,V.jsxs)(vI,{icon:(0,V.jsx)(Xr,{className:`size-3`}),onRemove:()=>T(null),children:[`回复:`,w.text?.slice(0,24)||`[消息]`]}),b.map(e=>(0,V.jsx)(vI,{icon:(0,V.jsx)(Lt,{className:`size-3`}),onRemove:()=>x(t=>t.filter(t=>t!==e)),children:e===`playground`?`机器人`:e},e)),v&&(0,V.jsxs)(vI,{onRemove:()=>y(null),children:[(0,V.jsx)(`img`,{src:`data:image/*;base64,${v}`,alt:`附图`,className:`h-6 rounded`}),`图片`]})]})})}),(0,V.jsxs)(`div`,{className:`flex items-end gap-1.5 rounded-xl border border-border bg-surface-2/50 p-1.5 transition-[border-color,box-shadow] focus-within:border-accent focus-within:shadow-[0_0_0_3px_var(--ring)]`,children:[(0,V.jsxs)(DO,{align:`start`,trigger:(0,V.jsx)(X,{variant:`ghost`,size:`icon`,"aria-label":`提及`,className:`size-9 rounded-[10px]`,children:(0,V.jsx)(Lt,{className:`size-4`})}),children:[(0,V.jsx)(OO,{icon:(0,V.jsx)(Ai,{}),onSelect:()=>x(e=>[...new Set([...e,`playground`])]),children:`提及机器人`}),(0,V.jsx)(kO,{}),(0,V.jsxs)(`form`,{className:`flex gap-1 p-1`,onSubmit:e=>{e.preventDefault();let t=S.trim();t&&(x(e=>[...new Set([...e,t])]),C(``))},children:[(0,V.jsx)(FO,{placeholder:`用户 ID`,value:S,onChange:e=>C(e.target.value),onKeyDown:e=>e.stopPropagation(),className:`h-8 w-32 font-mono`}),(0,V.jsx)(X,{type:`submit`,size:`sm`,variant:`secondary`,children:`添加`})]})]}),(0,V.jsx)(X,{variant:`ghost`,size:`icon`,"aria-label":`附加图片`,className:`size-9 rounded-[10px]`,onClick:()=>k.current?.click(),children:(0,V.jsx)(Xn,{className:`size-4`})}),(0,V.jsx)(`input`,{ref:k,type:`file`,accept:`image/*`,className:`hidden`,onChange:e=>{oe(e.target.files?.[0]),e.target.value=``}}),(0,V.jsx)(`textarea`,{ref:O,rows:1,value:g,placeholder:`输入消息,回车发送,Shift + 回车换行;可以直接粘贴图片`,onChange:e=>_(e.target.value),onKeyDown:ae,onPaste:e=>{let t=[...e.clipboardData.files].find(e=>e.type.startsWith(`image/`));t&&(e.preventDefault(),oe(t))},className:`max-h-36 min-h-9 flex-1 resize-none bg-transparent px-2 py-2 text-[13.5px] leading-5 outline-none [field-sizing:content] placeholder:text-fg-3`}),(0,V.jsx)(X,{variant:`primary`,size:`icon`,"aria-label":`发送`,disabled:!le,loading:N.isPending,onClick:()=>re(),className:`size-9 rounded-[10px]`,children:(0,V.jsx)(Ft,{className:`size-4`})})]})]})]})]})]})}function _I({id:e,title:t,description:n,checked:r,onChange:i}){return(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl border border-border px-3.5 py-2.5`,children:[(0,V.jsxs)(`label`,{htmlFor:e,className:`cursor-pointer`,children:[(0,V.jsx)(`span`,{className:`block text-[13px] font-medium`,children:t}),(0,V.jsx)(`span`,{className:`text-[12px] text-fg-3`,children:n})]}),(0,V.jsx)(hA,{id:e,checked:r,onCheckedChange:i})]})}function vI({icon:e,children:t,onRemove:n}){return(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-lg border border-border bg-surface py-0.5 pr-1 pl-2 text-[12px] text-fg-2`,children:[e,t,(0,V.jsx)(`button`,{type:`button`,"aria-label":`移除`,onClick:n,className:`flex size-5 cursor-pointer items-center justify-center rounded-md text-fg-3 hover:bg-surface-2 hover:text-fg`,children:(0,V.jsx)(ia,{className:`size-3`})})]})}function yI({icon:e,text:t}){return(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[e,t]})}function bI({suggestions:e,onPick:t}){return(0,V.jsxs)(K.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:q,className:`flex h-full flex-col items-center justify-center text-center`,children:[(0,V.jsx)(`div`,{className:`mb-4 flex size-12 items-center justify-center rounded-2xl bg-accent-soft text-accent-soft-fg`,children:(0,V.jsx)(Hn,{className:`size-5`})}),(0,V.jsx)(`p`,{className:`text-[14px] font-medium`,children:`试试和机器人说点什么`}),(0,V.jsx)(`p`,{className:`mt-1 max-w-sm text-[13px] leading-relaxed text-fg-3`,children:`多轮对话(比如猜数)也可以:机器人提问后,直接继续发消息回答即可。右上角可以模拟入群、戳一戳、好友申请等事件。`}),e.length>0&&(0,V.jsx)(`div`,{className:`mt-5 flex max-w-md flex-wrap justify-center gap-2`,children:e.slice(0,6).map((e,n)=>(0,V.jsxs)(K.button,{type:`button`,initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{...q,delay:.05+n*.04},whileHover:{y:-2},onClick:()=>t(e),className:`flex cursor-pointer items-center gap-1.5 rounded-xl border border-border bg-surface px-3 py-1.5 font-mono text-[12.5px] text-fg-2 shadow-card hover:border-border-strong hover:text-fg`,children:[(0,V.jsx)(Ai,{className:`size-3 text-accent`}),e]},e))})]})}function xI({entry:e}){return(0,V.jsxs)(`span`,{className:`inline-flex max-w-full items-center gap-1.5 rounded-lg border-l-2 border-current/40 bg-black/5 px-2 py-0.5 text-[12px] opacity-80 dark:bg-white/10`,children:[(0,V.jsx)(vr,{className:`size-3 shrink-0`}),(0,V.jsx)(`span`,{className:`truncate`,children:e?e.text||`[消息]`:`一条消息`})]})}function SI({entry:e,userId:t,nickname:n,onQuote:r,renderReply:i}){let[a,o]=(0,B.useState)(!1),s=e.traces??[],c=s.length>0&&(0,V.jsxs)(`button`,{type:`button`,onClick:()=>o(!a),className:z(`inline-flex cursor-pointer items-center gap-1 rounded-md px-1 text-[11px] transition-colors`,a?`text-accent`:`text-fg-3 hover:text-fg-2`),children:[(0,V.jsx)(ea,{className:`size-3`}),`处理链`]}),l=(0,V.jsx)(Tg,{initial:!1,children:a&&(0,V.jsx)(K.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:q,className:`w-full overflow-hidden`,children:(0,V.jsx)(`div`,{className:`mt-1 space-y-4 rounded-xl border border-border bg-surface px-4 py-3 text-left`,children:s.map(t=>(0,V.jsx)(JA,{trace:t,logs:(e.logs??[]).filter(e=>e.eventId===t.eventId)},t.eventId))})})});if(e.from===`system`)return(0,V.jsxs)(K.div,{layout:!0,initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:q,className:`flex flex-col items-center gap-1`,children:[(0,V.jsxs)(`span`,{className:`flex items-center gap-2 rounded-full bg-surface-2 px-3 py-1 text-[12px] text-fg-3`,children:[e.text,c]}),(0,V.jsx)(`div`,{className:`w-full max-w-xl`,children:l})]});let u=e.from===`user`;return(0,V.jsxs)(K.div,{layout:!0,initial:{opacity:0,y:10,scale:.96,x:u?10:-10},animate:{opacity:1,y:0,scale:1,x:0},transition:Dv,className:z(`group flex items-start gap-2.5`,u&&`flex-row-reverse`),children:[u?(0,V.jsx)(ct,{id:t,name:n,size:28}):(0,V.jsx)(Qv,{className:`size-7 shrink-0`}),(0,V.jsxs)(`div`,{className:z(`flex max-w-[72%] flex-col gap-1`,u?`items-end`:`items-start`),children:[(0,V.jsx)(`div`,{className:z(`rounded-2xl px-3.5 py-2 text-[13.5px] leading-relaxed break-words whitespace-pre-wrap`,u?`rounded-tr-md bg-accent text-accent-fg`:`rounded-tl-md border border-border bg-surface-2 text-fg`),children:e.message?(0,V.jsx)(HA,{message:e.message,renderReply:i}):e.text}),(0,V.jsxs)(`div`,{className:z(`flex items-center gap-1.5 px-1`,u&&`flex-row-reverse`),children:[(0,V.jsx)(`span`,{className:`text-[11px] text-fg-3 tabular`,children:Jv(e.time,!1)}),r&&(0,V.jsxs)(`button`,{type:`button`,onClick:r,className:`inline-flex cursor-pointer items-center gap-1 rounded-md px-1 text-[11px] text-fg-3 opacity-0 transition-opacity group-hover:opacity-100 hover:text-fg-2`,children:[(0,V.jsx)(Xr,{className:`size-3`}),`引用`]}),c]}),l]})]})}function CI(){return(0,V.jsxs)(K.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0},transition:q,className:`flex items-end gap-2.5`,children:[(0,V.jsx)(Qv,{className:`size-7 shrink-0`}),(0,V.jsx)(`div`,{className:`flex gap-1 rounded-2xl rounded-bl-md border border-border bg-surface-2 px-3.5 py-3`,children:[0,1,2].map(e=>(0,V.jsx)(K.span,{className:`size-1.5 rounded-full bg-fg-3`,animate:{y:[0,-4,0],opacity:[.5,1,.5]},transition:{duration:.9,repeat:1/0,delay:e*.15,ease:`easeInOut`}},e))})]})}var wI=`bg.bg-glow.surface.surface-2.surface-3.overlay.border.border-strong.fg.fg-2.fg-3.accent.accent-hover.accent-fg.accent-soft.accent-soft-fg.success.success-soft.warning.warning-soft.danger.danger-soft.info.info-soft.series-in.series-out.ring.shadow-card.shadow-pop.highlight`.split(`.`);function TI(){let e=getComputedStyle(document.documentElement);return Object.fromEntries(wI.map(t=>[t,e.getPropertyValue(`--${t}`).trim()]))}async function EI(e,t,n,r){let i=`/api/panel/ext/${encodeURIComponent(e)}`,a=new URL(i+t,window.location.origin);if(a.origin!==window.location.origin||!(a.pathname===i||a.pathname.startsWith(`${i}/`)))return{status:400,body:{error:{code:`BAD_REQUEST`,message:`Path escapes the plugin routes`}}};let o=/^(GET|POST|PUT|PATCH|DELETE)$/.test(n)?n:`GET`,s=o!==`GET`&&r!==void 0;try{let e=await fetch(a,{method:o,credentials:`same-origin`,headers:s?{"Content-Type":`application/json`}:void 0,body:s?JSON.stringify(r):void 0}),t=await e.text(),n=t;try{n=t?JSON.parse(t):void 0}catch{}return{status:e.status,body:n}}catch{return{status:0,body:void 0}}}function DI({path:e}){let t=e.slice(7),n=Z({queryKey:[`plugins`],queryFn:$.plugins}),r=n.data?.find(e=>e.name===t),i=(0,B.useRef)(null),{resolved:a}=_P(),[o,s]=(0,B.useState)(!1),c=r?.state===`active`&&r.page!==void 0;if((0,B.useEffect)(()=>{r?.page&&(document.title=`${r.page.title} · AsaBot`)},[r?.page]),(0,B.useEffect)(()=>{if(!c)return;let n=e=>i.current?.contentWindow?.postMessage({asabot:1,...e},`*`),r=r=>{let a=i.current;if(!a||r.source!==a.contentWindow||window.location.pathname!==e)return;let o=r.data;if(o?.asabot===1){if(o.kind===`ready`)n({kind:`theme`,mode:document.documentElement.classList.contains(`dark`)?`dark`:`light`,tokens:TI()});else if(o.kind===`open-command-palette`)document.activeElement===a&&document.hasFocus()&&yP(()=>n({kind:`restore-focus`}));else if(o.kind===`toast`){let e=String(o.text).slice(0,300);o.level===`error`?vN.error(e):o.level===`success`?vN.success(e):vN(e)}else o.kind===`fetch`&&typeof o.id==`number`&&typeof o.path==`string`&&EI(t,o.path.startsWith(`/`)?o.path:`/${o.path}`,String(o.method??`GET`).toUpperCase(),o.body).then(e=>n({id:o.id,...e}))}};window.addEventListener(`message`,r);let a=qN(e=>{e.plugin===t&&n({kind:`event`,topic:e.topic,data:e.data})});return()=>{window.removeEventListener(`message`,r),a()}},[c,t,e]),(0,B.useEffect)(()=>{o&&i.current?.contentWindow?.postMessage({asabot:1,kind:`theme`,mode:a,tokens:TI()},`*`)},[a,o]),n.error&&!n.data)return(0,V.jsx)(J,{className:`min-h-0 overflow-y-auto overscroll-contain`,children:(0,V.jsx)(Vv,{error:n.error,onRetry:()=>void n.refetch(),retrying:n.isFetching})});if(!n.data)return(0,V.jsx)(zv,{className:`min-h-0 flex-1 rounded-xl`});if(!c||!r?.page)return(0,V.jsx)(J,{className:`min-h-0 overflow-y-auto overscroll-contain`,children:(0,V.jsx)(Bv,{icon:(0,V.jsx)(Ct,{}),title:`这个插件页面不可用`,description:r?r.state===`active`?`插件没有提供页面。`:`插件当前没有运行,启用后页面会出现在侧边栏。`:`没有名为 ${t} 的插件。`})});let l=`/plugin-pages/${encodeURIComponent(t)}/`;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`shrink-0`,children:(0,V.jsx)(Hv,{title:r.page.title,description:(0,V.jsxs)(V.Fragment,{children:[`由插件 `,(0,V.jsx)(`span`,{className:`font-medium text-fg-2`,children:r.name}),` 提供`]})})}),(0,V.jsxs)(J,{className:`relative min-h-0 flex-1 overflow-clip`,children:[!o&&(0,V.jsx)(zv,{className:`absolute inset-0 rounded-none`}),(0,V.jsx)(`iframe`,{ref:i,title:r.page.title,src:l,sandbox:`allow-scripts allow-forms allow-popups`,onLoad:()=>s(!0),className:`block size-full border-0 bg-transparent`})]})]})}var OI=(0,B.lazy)(()=>LA(()=>import(`./markdown-HrgPSKyp.js`).then(e=>({default:e.Markdown})),[]));function kI({className:e}){return(0,V.jsxs)(`div`,{className:z(`space-y-2.5`,e),children:[(0,V.jsx)(zv,{className:`h-5 w-1/2`}),(0,V.jsx)(zv,{className:`h-4 w-full`}),(0,V.jsx)(zv,{className:`h-4 w-5/6`})]})}function AI({readme:e,className:t}){return e?.trim()?(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(kI,{className:t}),children:(0,V.jsx)(OI,{className:t,children:e})}):(0,V.jsx)(Bv,{icon:(0,V.jsx)(Ut,{}),title:`没有 README`,description:`这个插件包没有提供说明文档。`})}function jI({name:e,info:t}){let n=Z({queryKey:[`pluginReadme`,e,t.name,t.version],queryFn:()=>$.pluginReadme(e)});return n.error&&!n.data?(0,V.jsx)(Vv,{error:n.error,onRetry:()=>void n.refetch(),retrying:n.isFetching}):n.data?(0,V.jsx)(AI,{readme:n.data.readme}):(0,V.jsx)(kI,{})}function MI({src:e,className:t}){let[n,r]=(0,B.useState)();return(0,V.jsx)(`span`,{"aria-hidden":`true`,className:z(`inline-flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-[10px] border border-border bg-surface-2 text-fg-3 transition-colors`,t),children:e&&e!==n?(0,V.jsx)(`img`,{src:e,alt:``,loading:`lazy`,referrerPolicy:`no-referrer`,className:`size-full object-contain p-1`,onError:()=>r(e)}):(0,V.jsx)(Mr,{className:`size-4`})})}function NI(e,t){if(!e.installed)return`安装`;let n=e.versions.findIndex(e=>e.version===t),r=e.versions.findIndex(t=>t.version===e.installed);return r===-1?`切换到`:n<r?`升级到`:`降级到`}var PI=[{value:`relevance`,label:`相关度`},{value:`updated`,label:`最近更新`},{value:`name`,label:`名称`}];function FI(e,t){let[n,r]=(0,B.useState)(e);return(0,B.useEffect)(()=>{let n=window.setTimeout(()=>r(e),t);return()=>window.clearTimeout(n)},[e,t]),n}function II(){let[e,t]=(0,B.useState)(``),[n,r]=(0,B.useState)(`relevance`),i=FI(e.trim(),350),[a,o]=(0,B.useState)(null),[s,c]=(0,B.useState)(null),l=ZM({queryKey:[`packageSearch`,i,n],queryFn:({pageParam:e})=>$.searchPackages(i,n,e),initialPageParam:0,getNextPageParam:(e,t)=>{let n=t.reduce((e,t)=>e+t.items.length,0);return e.items.length>0&&n<e.total?n:void 0},placeholderData:e=>e,retry:!1}),u=l.data?.pages.flatMap(e=>e.items),d=l.data?.pages[0]?.total;return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-3`,children:[(0,V.jsx)(FO,{icon:(0,V.jsx)(ui,{}),placeholder:`搜索插件包(带有 asabot-plugin 关键词的 npm 包)`,value:e,onChange:e=>t(e.target.value),className:`w-full max-w-md`}),d!==void 0&&(0,V.jsxs)(`span`,{className:`text-[12.5px] text-fg-3`,children:[`共 `,d,` 个结果`]}),(0,V.jsx)(CO,{value:n,onChange:r,options:PI,size:`sm`,className:`ml-auto`})]}),l.isPending?(0,V.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[`a`,`b`,`c`,`d`].map(e=>(0,V.jsx)(zv,{className:`h-[132px] rounded-xl`},e))}):l.error&&!u?(0,V.jsx)(J,{children:(0,V.jsx)(Bv,{icon:(0,V.jsx)(Ar,{}),title:`无法连接插件源`,description:`${l.error.message}。可以在配置的 packages.registry 中换成可访问的镜像。`})}):!u||u.length===0?(0,V.jsx)(J,{children:(0,V.jsx)(Bv,{icon:(0,V.jsx)(Ar,{}),title:`没有找到插件包`,description:`换个关键词试试。`})}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(K.div,{variants:Av,initial:`initial`,animate:`animate`,className:z(`grid grid-cols-1 gap-3 sm:grid-cols-2 transition-opacity`,l.isPlaceholderData&&`opacity-60`),children:u.map(e=>(0,V.jsx)(LI,{item:e,onOpen:()=>o(e),onInstall:()=>c({name:e.name,version:e.version,description:e.description,verb:`安装`})},e.name))},`${i}:${n}`),l.hasNextPage&&(0,V.jsx)(`div`,{className:`mt-4 flex justify-center`,children:(0,V.jsxs)(X,{variant:`secondary`,loading:l.isFetchingNextPage,onClick:()=>void l.fetchNextPage(),children:[`加载更多`,(0,V.jsxs)(`span`,{className:`text-fg-3 tabular`,children:[u.length,` / `,d]})]})})]}),(0,V.jsx)(VI,{item:a,onClose:()=>o(null),onInstall:c}),(0,V.jsx)(HI,{target:s,onClose:()=>c(null)})]})}function LI({item:e,onOpen:t,onInstall:n}){let r=e.installed&&e.installedVersion!==e.version;return(0,V.jsx)(K.div,{variants:jv,whileHover:{y:-2},transition:q,children:(0,V.jsxs)(J,{className:`flex h-full cursor-pointer flex-col p-4 transition-[border-color] hover:border-border-strong`,onClick:t,children:[(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,V.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,V.jsx)(MI,{src:e.iconUrl}),(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,V.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),t()},className:`cursor-pointer truncate rounded font-mono text-[13.5px] font-semibold outline-none focus-visible:shadow-[0_0_0_3px_var(--ring)]`,children:e.name}),(0,V.jsxs)(`span`,{className:`font-mono text-[11px] text-fg-3`,children:[`v`,e.version]})]}),(0,V.jsx)(`div`,{className:`mt-0.5 text-[11.5px] text-fg-3`,children:[e.author,e.date&&CF(Date.parse(e.date))].filter(Boolean).join(` · `)})]})]}),e.installed?(0,V.jsx)(Pv,{tone:r?`info`:`success`,dot:!0,children:r?`已安装 v${e.installedVersion}`:`已安装`}):(0,V.jsxs)(X,{size:`sm`,variant:`primary`,onClick:e=>{e.stopPropagation(),n()},children:[(0,V.jsx)(An,{className:`size-3.5`}),`安装`]})]}),(0,V.jsx)(`p`,{className:`mt-3 line-clamp-2 min-h-[38px] text-[13px] leading-relaxed text-fg-2`,children:e.description||`没有描述`}),(0,V.jsx)(`div`,{className:`mt-auto pt-3`,children:(0,V.jsx)(RI,{links:e.links})})]})})}function RI({links:e}){return(0,V.jsx)(`div`,{className:`flex gap-3 text-[12px]`,children:[[`npm`,e.npm],[`主页`,e.homepage],[`源码`,e.repository]].filter(e=>!!e[1]).map(([e,t])=>(0,V.jsxs)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>e.stopPropagation(),className:`inline-flex items-center gap-1 text-fg-3 transition-colors hover:text-fg`,children:[e,(0,V.jsx)(Rn,{className:`size-3`})]},e))})}function zI(e){return e.versions.find(e=>e.compatible&&!e.deprecated)?.version??e.versions[0]?.version}function BI(e,t){return(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,V.jsxs)(`span`,{className:`font-mono`,children:[`v`,e.version]}),e.version===t.latest&&(0,V.jsx)(`span`,{className:`text-[11px] text-accent-soft-fg`,children:`最新`}),e.version===t.installed&&(0,V.jsx)(`span`,{className:`text-[11px] text-success`,children:`已安装`}),!e.compatible&&(0,V.jsx)(`span`,{className:`text-[11px] text-danger`,children:`不兼容`}),e.deprecated&&(0,V.jsx)(`span`,{className:`text-[11px] text-warning`,children:`已弃用`})]})}function VI({item:e,onClose:t,onInstall:n}){let[r,i]=(0,B.useState)(e);(0,B.useEffect)(()=>{e!==null&&i(e)},[e]);let a=e??r,o=Z({queryKey:[`packageInfo`,a?.name],queryFn:a===null?Zj:()=>$.packageInfo(a.name),staleTime:3e5,retry:!1}),[s,c]=(0,B.useState)(),l=o.data,u=s&&s.name===a?.name?s.version:l&&zI(l),d=l?.versions.find(e=>e.version===u);return(0,V.jsx)(Cj,{open:e!==null,onOpenChange:e=>!e&&t(),title:(0,V.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,V.jsx)(MI,{src:d?d.iconUrl:a?.iconUrl,className:`size-7 rounded-lg`}),(0,V.jsx)(`span`,{className:`truncate font-mono`,children:a?.name})]}),subtitle:l?.description??(o.isPending?`加载中…`:void 0),children:o.error&&!l?(0,V.jsx)(Vv,{error:o.error,onRetry:()=>void o.refetch(),retrying:o.isFetching}):!l||!u?(0,V.jsxs)(`div`,{className:`space-y-3 p-6`,children:[(0,V.jsx)(zv,{className:`h-10 w-full rounded-xl`}),(0,V.jsx)(zv,{className:`h-4 w-3/4`}),(0,V.jsx)(zv,{className:`h-4 w-2/3`}),(0,V.jsx)(zv,{className:`h-40 w-full rounded-xl`})]}):(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`space-y-3 border-b border-border px-6 py-4`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(Zk,{"aria-label":`选择版本`,value:u,onValueChange:e=>c({name:l.name,version:e}),options:l.versions.map(e=>({value:e.version,label:BI(e,l)})),className:`min-w-48`}),(0,V.jsxs)(X,{variant:`primary`,disabled:u===l.installed,onClick:()=>n({name:l.name,version:u,description:l.description,installed:l.installed,verb:NI(l,u)}),children:[l.installed?(0,V.jsx)(fn,{className:`size-3.5`}):(0,V.jsx)(An,{className:`size-3.5`}),u===l.installed?`已安装此版本`:`${NI(l,u)} v${u}`]})]}),(0,V.jsx)(Tg,{initial:!1,children:d&&(!d.compatible||d.deprecated)&&(0,V.jsx)(K.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:q,className:`overflow-hidden`,children:(0,V.jsxs)(`div`,{className:`space-y-1 rounded-xl bg-warning-soft px-3.5 py-2.5 text-[12.5px] leading-relaxed text-warning`,children:[!d.compatible&&(0,V.jsxs)(`p`,{className:`flex gap-2`,children:[(0,V.jsx)(Wi,{className:`mt-0.5 size-3.5 shrink-0`}),d.peerRange?`这个版本要求 asabot ${d.peerRange},与当前框架版本不兼容。`:`这个版本没有声明支持的 asabot 版本。`]}),d.deprecated&&(0,V.jsxs)(`p`,{className:`flex gap-2`,children:[(0,V.jsx)(Wi,{className:`mt-0.5 size-3.5 shrink-0`}),`已弃用:`,d.deprecated]})]})},u)}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1.5 text-[12px] text-fg-3`,children:[l.license&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,V.jsx)(ii,{className:`size-3.5`}),l.license]}),d?.date&&(0,V.jsxs)(`span`,{children:[`发布于 `,CF(Date.parse(d.date))]}),(0,V.jsx)(RI,{links:l.links})]})]}),(0,V.jsx)(AI,{className:`px-6 py-5`,readme:l.readme})]})})}function HI({target:e,onClose:t}){let n=rP(),[r,i]=(0,B.useState)(!1),[a,o]=(0,B.useState)(null),s=()=>{i(!1),o(null)},c=XM({mutationFn:e=>$.installPackage({name:e.name,version:e.version,force:r}),meta:{silent:!0},onSuccess:e=>{n(e),s(),t()},onError:e=>{e instanceof PN&&e.status===409?o(e.message):vN.error(e.message)}});return(0,V.jsx)(Sj,{open:e!==null,onOpenChange:e=>{e||(s(),t())},title:`${e?.verb===`安装`?`安装`:`更换版本`} ${e?.name??``}`,description:e?.installed?`从 v${e.installed} ${e.verb} v${e.version}。`:e?.description,footer:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(X,{variant:`ghost`,onClick:t,children:`取消`}),(0,V.jsxs)(X,{variant:`primary`,loading:c.isPending,disabled:a!==null&&!r,onClick:()=>e&&c.mutate(e),children:[(0,V.jsx)(An,{className:`size-3.5`}),e?.verb,` v`,e?.version]})]}),children:(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsxs)(`div`,{className:`flex gap-2.5 rounded-xl bg-warning-soft px-3.5 py-3 text-[12.5px] leading-relaxed text-warning`,children:[(0,V.jsx)(Si,{className:`mt-0.5 size-4 shrink-0`}),`插件与框架运行在同一进程中,拥有完整权限。只安装你信任的插件包。`]}),(0,V.jsx)(Tg,{children:a&&(0,V.jsx)(K.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:q,className:`overflow-hidden`,children:(0,V.jsxs)(`div`,{className:`space-y-3 rounded-xl border border-danger/30 bg-danger-soft px-3.5 py-3`,children:[(0,V.jsx)(`p`,{className:`text-[12.5px] text-danger`,children:a}),(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,V.jsx)(`label`,{htmlFor:`force-install`,className:`cursor-pointer text-[12.5px] text-fg-2`,children:`忽略版本要求,强制安装`}),(0,V.jsx)(hA,{id:`force-install`,checked:r,onCheckedChange:i})]})]})})})]})})}var UI=2097152;async function WI(e){let t=new Uint8Array(await e.arrayBuffer()),n=``;for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));return btoa(n)}function GI(e){let t=e.package;return!!(t?.latest&&t.latest!==t.version)}function KI({open:e,onOpenChange:t}){let n=Tj(),r=(0,B.useRef)(null),[i,a]=(0,B.useState)(null),[o,s]=(0,B.useState)(!1),[c,l]=(0,B.useState)(!1),u=XM({mutationFn:async({file:e,overwrite:t})=>$.uploadPlugin({filename:e.name,content:await WI(e),overwrite:t}),meta:{silent:!0},onSuccess:e=>{n.invalidateQueries({queryKey:[`plugins`]}),n.invalidateQueries({queryKey:[`commands`]}),e.state===`failed`?vN.error(`${e.name} 已上传,但加载失败`,{description:e.error}):vN.success(`已安装 ${e.name}`),d()},onError:e=>{e instanceof PN&&e.status===409?l(!0):vN.error(e.message)}}),d=()=>{t(!1),a(null),l(!1)},f=e=>{if(e){if(!/\.(ts|js|zip)$/i.test(e.name))return vN.error(`只支持 .ts、.js 或 .zip 文件`);if(e.size>UI)return vN.error(`文件不能超过 2 MB`);a(e),l(!1)}};return(0,V.jsxs)(Sj,{open:e,onOpenChange:e=>e?t(!0):d(),title:`上传插件`,description:`单个 .ts / .js 插件文件,或包含 index.ts 的 .zip 包。上传后立即加载。`,footer:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(X,{variant:`ghost`,onClick:d,children:`取消`}),(0,V.jsx)(X,{variant:c?`danger`:`primary`,disabled:!i,loading:u.isPending,onClick:()=>i&&u.mutate({file:i,overwrite:c}),children:c?`覆盖并重载`:`上传`})]}),children:[(0,V.jsx)(`input`,{ref:r,type:`file`,accept:`.ts,.js,.zip`,className:`hidden`,onChange:e=>f(e.target.files?.[0])}),(0,V.jsxs)(K.button,{type:`button`,onClick:()=>r.current?.click(),onDragOver:e=>{e.preventDefault(),s(!0)},onDragLeave:()=>s(!1),onDrop:e=>{e.preventDefault(),s(!1),f(e.dataTransfer.files[0])},animate:{scale:o?1.015:1},transition:Dv,className:z(`flex w-full cursor-pointer flex-col items-center justify-center rounded-xl border border-dashed px-6 py-9 text-center transition-colors`,o?`border-accent bg-accent-soft`:`border-border-strong bg-surface-2/50 hover:bg-surface-2`),children:[(0,V.jsx)(K.span,{animate:{y:o?-4:0},transition:Dv,className:`mb-3 flex size-10 items-center justify-center rounded-xl bg-surface text-accent shadow-card`,children:(0,V.jsx)(Bn,{className:`size-5`})}),i?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`font-mono text-[13px] text-fg`,children:i.name}),(0,V.jsxs)(`span`,{className:`mt-1 text-[12px] text-fg-3`,children:[(i.size/1024).toFixed(1),` KB · 点击更换`]})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`text-[13.5px] font-medium text-fg`,children:`拖拽文件到这里,或点击选择`}),(0,V.jsx)(`span`,{className:`mt-1 text-[12px] text-fg-3`,children:`最大 2 MB`})]})]}),(0,V.jsx)(Tg,{children:c&&(0,V.jsx)(K.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:q,className:`overflow-hidden`,children:(0,V.jsxs)(`div`,{className:`mt-3 flex gap-2 rounded-lg bg-warning-soft px-3 py-2.5 text-[12.5px] text-warning`,children:[(0,V.jsx)(Wi,{className:`mt-px size-4 shrink-0`}),`已存在同名插件。覆盖会替换原有文件并重新加载插件。`]})})})]})}function qI({plugin:e,onClose:t}){let n=Tj(),r=rP(),[i,a]=(0,B.useState)(!1),o=XM({mutationFn:async e=>e.source===`package`&&e.package?(r(await $.uninstallPackage(e.package.name,i)),`queued`):(await $.uninstallPlugin(e.name,i),`done`),onSuccess:(e,r)=>{e===`done`&&(vN.success(`已卸载 ${r.name}`),n.invalidateQueries({queryKey:[`plugins`]}),n.invalidateQueries({queryKey:[`commands`]})),a(!1),t()}});return(0,V.jsx)(Sj,{open:e!==null,onOpenChange:e=>!e&&t(),title:`卸载 ${e?.name??``}`,description:e?.source===`package`?`将通过 npm 卸载插件包 ${e.package?.name??``}。`:`将删除插件目录中的插件文件。依赖它的插件会被停用。`,footer:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(X,{variant:`ghost`,onClick:t,children:`取消`}),(0,V.jsxs)(X,{variant:`danger`,loading:o.isPending,onClick:()=>e&&o.mutate(e),children:[(0,V.jsx)(Hi,{className:`size-3.5`}),`卸载`]})]}),children:(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-4 rounded-xl border border-border px-4 py-3`,children:[(0,V.jsxs)(`label`,{htmlFor:`purge`,className:`cursor-pointer`,children:[(0,V.jsx)(`span`,{className:`block text-[13px] font-medium`,children:`同时清理数据`}),(0,V.jsx)(`span`,{className:`mt-0.5 block text-[12px] leading-relaxed text-fg-3`,children:`删除它的配置、存储的数据、数据表和数据目录。不清理的话,重新安装后可以继续使用原来的数据。`})]}),(0,V.jsx)(hA,{id:`purge`,checked:i,onCheckedChange:a})]})})}var JI={install:`安装`,update:`升级`,uninstall:`卸载`};function YI(){let e=nP(),[t,n]=(0,B.useState)(new Set),[r,i]=(0,B.useState)(Date.now());(0,B.useEffect)(()=>{let e=window.setInterval(()=>i(Date.now()),2e3);return()=>window.clearInterval(e)},[]);let a=e.filter(e=>!t.has(e.id)&&(e.status===`queued`||e.status===`running`||r-(e.finishedAt??r)<(e.status===`failed`?6e4:8e3)));return(0,V.jsx)(`div`,{className:`pointer-events-none fixed right-4 bottom-4 z-40 flex w-[360px] max-w-[calc(100vw-2rem)] flex-col gap-2`,children:(0,V.jsx)(Tg,{initial:!1,children:a.map(e=>(0,V.jsx)(XI,{operation:e,onDismiss:()=>n(t=>new Set(t).add(e.id))},e.id))})})}function XI({operation:e,onDismiss:t}){let[n,r]=(0,B.useState)(e.status===`failed`),i=(0,B.useRef)(null),a=e.status===`queued`||e.status===`running`;return(0,B.useEffect)(()=>{e.status===`failed`&&r(!0)},[e.status]),(0,B.useEffect)(()=>{n&&e.log.length>0&&i.current?.scrollTo({top:i.current.scrollHeight})},[n,e.log.length]),(0,V.jsxs)(K.div,{layout:!0,initial:{opacity:0,y:16,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,x:24,transition:{duration:.18}},transition:Dv,className:`pointer-events-auto overflow-hidden rounded-xl border border-border bg-surface shadow-pop`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3 px-3.5 py-3`,children:[(0,V.jsx)(`span`,{className:z(`flex size-7 shrink-0 items-center justify-center rounded-lg`,a&&`bg-accent-soft text-accent-soft-fg`,e.status===`succeeded`&&`bg-success-soft text-success`,e.status===`failed`&&`bg-danger-soft text-danger`),children:a?(0,V.jsx)(Rv,{className:`size-3.5`}):e.status===`succeeded`?(0,V.jsx)(tn,{className:`size-3.5`,strokeWidth:2.5}):(0,V.jsx)(ia,{className:`size-3.5`,strokeWidth:2.5})}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsxs)(`div`,{className:`truncate text-[13px] font-medium`,children:[JI[e.kind],` `,(0,V.jsx)(`span`,{className:`font-mono`,children:e.name})]}),(0,V.jsx)(`div`,{className:`truncate text-[12px] text-fg-3`,children:e.status===`queued`?`排队中…`:e.status===`running`?e.log.at(-1)??`正在执行 npm…`:e.status===`succeeded`?`完成${e.plugin?`,插件 ${e.plugin.name} 已${e.kind===`uninstall`?`移除`:`加载`}`:``}`:e.error??`失败`})]}),e.log.length>0&&(0,V.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":`查看日志`,onClick:()=>r(!n),children:(0,V.jsx)(K.span,{animate:{rotate:n?180:0},transition:q,children:(0,V.jsx)(rn,{className:`size-3.5`})})}),!a&&(0,V.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":`关闭`,onClick:t,children:(0,V.jsx)(ia,{className:`size-3.5`})})]}),a&&(0,V.jsx)(`div`,{className:`h-0.5 overflow-hidden bg-surface-2`,children:(0,V.jsx)(K.div,{className:`h-full w-1/3 rounded-full bg-accent`,animate:{x:[`-100%`,`300%`]},transition:{duration:1.4,repeat:1/0,ease:`easeInOut`}})}),(0,V.jsx)(Tg,{initial:!1,children:n&&(0,V.jsx)(K.div,{initial:{height:0},animate:{height:`auto`},exit:{height:0},transition:q,className:`overflow-hidden border-t border-border`,children:(0,V.jsx)(`pre`,{ref:i,className:`max-h-48 overflow-y-auto bg-surface-2/60 px-3.5 py-2.5 font-mono text-[11.5px] leading-relaxed whitespace-pre-wrap text-fg-2`,children:e.log.join(`
|
|
51
|
+
`)})})})]})}function ZI({plugin:e,size:t=`sm`}){let n=XM({mutationFn:()=>$.updatePackage(e.package?.name??e.name),onSuccess:rP()});return GI(e)?(0,V.jsxs)(X,{variant:`soft`,size:t,loading:n.isPending,onClick:()=>n.mutate(),children:[(0,V.jsx)(fn,{className:`size-3.5`}),`升级到 v`,e.package?.latest]}):null}var QI={active:{label:`运行中`,tone:`success`},loading:{label:`加载中`,tone:`warning`},failed:{label:`加载失败`,tone:`danger`},disabled:{label:`已停用`,tone:`neutral`}};function $I(e){return e.source===`builtin`?`内置`:e.source===`package`?`npm · ${e.package?.name??e.name}`:`本地文件`}var eL=[`a`,`b`,`c`,`d`,`e`,`f`],tL=(0,B.lazy)(()=>LA(()=>import(`./plugin-credentials-CuMBPnPO.js`).then(e=>({default:e.PluginCredentialsTab})),[]));function nL(e,t){e.setQueryData([`plugins`],e=>e?.map(e=>e.name===t.name?t:e))}function rL(){let e=Tj(),t=t=>nL(e,t);return{action:XM({mutationFn:({name:e,action:t})=>$.pluginAction(e,t),onMutate:({name:t,action:n})=>{n!==`reload`&&e.setQueryData([`plugins`],e=>e?.map(e=>e.name===t?{...e,enabled:n===`enable`}:e))},onSuccess:(n,{action:r})=>{t(n),e.invalidateQueries({queryKey:[`overview`]}),r===`reload`?vN.success(`已重载 ${n.name}`):n.state===`failed`&&vN.error(`${n.name} 启用失败`,{description:n.error})},onError:()=>void e.invalidateQueries({queryKey:[`plugins`]})}),update:t}}function iL(){let e=Z({queryKey:[`plugins`],queryFn:$.plugins}),[t,n]=(0,B.useState)(`all`),[r,i]=(0,B.useState)(``),[a,o]=(0,B.useState)(`installed`),[s,c]=(0,B.useState)(!1),[l,u]=(0,B.useState)(null),{action:d}=rL(),f=Tj(),p=XM({mutationFn:$.rescanPlugins,onSuccess:({added:e,removed:t,plugins:n})=>{f.setQueryData([`plugins`],n),f.invalidateQueries({queryKey:[`commands`]}),vN.success(e.length===0&&t.length===0?`没有发现变化`:[e.length>0&&`新增 ${e.join(`、`)}`,t.length>0&&`移除 ${t.join(`、`)}`].filter(Boolean).join(`;`))}}),m=(0,B.useMemo)(()=>{let n=r.trim().toLowerCase();return(e.data??[]).filter(e=>(t===`all`||e.state===t)&&(!n||e.name.toLowerCase().includes(n)||e.description?.toLowerCase().includes(n)))},[e.data,t,r]),h=(0,B.useMemo)(()=>{let t=e.data;if(t)return{all:t.length,active:t.filter(e=>e.state===`active`).length,disabled:t.filter(e=>e.state===`disabled`).length,failed:t.filter(e=>e.state===`failed`).length}},[e.data]);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Hv,{title:`插件`,description:h?`共 ${h.all} 个插件,${h.active} 个正在运行`:`管理插件的启停、配置和群开关`,actions:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(xO,{content:`发现插件目录中新增或删除的插件`,children:(0,V.jsxs)(X,{loading:!1,onClick:()=>p.mutate(),disabled:p.isPending,children:[(0,V.jsx)(K.span,{animate:p.isPending?{rotate:360}:{rotate:0},transition:p.isPending?{duration:.9,repeat:1/0,ease:`linear`}:q,className:`inline-flex`,children:(0,V.jsx)(Jr,{className:`size-3.5`})}),`重新扫描`]})}),(0,V.jsxs)(X,{variant:`primary`,onClick:()=>c(!0),children:[(0,V.jsx)(Bn,{className:`size-3.5`}),`上传插件`]})]})}),(0,V.jsx)(wO,{className:`mb-5`,value:a,onChange:o,tabs:[{value:`installed`,label:(0,V.jsxs)(V.Fragment,{children:[`已安装 `,(0,V.jsx)(aL,{n:h?.all})]})},{value:`market`,label:(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,V.jsx)(Ii,{className:`size-3.5`}),`插件市场`]})}]}),(0,V.jsx)(Tg,{mode:`wait`,initial:!1,children:a===`market`?(0,V.jsx)(K.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:q,children:(0,V.jsx)(II,{})},`market`):(0,V.jsxs)(K.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:q,children:[(0,V.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(CO,{value:t,onChange:n,options:[{value:`all`,label:(0,V.jsxs)(V.Fragment,{children:[`全部 `,(0,V.jsx)(aL,{n:h?.all})]})},{value:`active`,label:(0,V.jsxs)(V.Fragment,{children:[`运行中 `,(0,V.jsx)(aL,{n:h?.active})]})},{value:`disabled`,label:(0,V.jsxs)(V.Fragment,{children:[`已停用 `,(0,V.jsx)(aL,{n:h?.disabled})]})},{value:`failed`,label:(0,V.jsxs)(V.Fragment,{children:[`失败 `,(0,V.jsx)(aL,{n:h?.failed})]})}]}),(0,V.jsx)(FO,{icon:(0,V.jsx)(ui,{}),placeholder:`搜索插件`,value:r,onChange:e=>i(e.target.value),className:`ml-auto w-56`})]}),e.error&&!e.data?(0,V.jsx)(J,{children:(0,V.jsx)(Vv,{error:e.error,onRetry:()=>void e.refetch(),retrying:e.isFetching})}):e.data?m.length===0?(0,V.jsx)(J,{children:(0,V.jsx)(Bv,{icon:(0,V.jsx)(Wr,{}),title:r||t!==`all`?`没有符合条件的插件`:`还没有插件`,description:`上传插件、从插件市场安装,或把插件文件放进插件目录后点“重新扫描”。`})}):(0,V.jsx)(K.div,{variants:Av,initial:`initial`,animate:`animate`,className:`grid gap-3 sm:grid-cols-2 xl:grid-cols-3`,children:m.map(e=>(0,V.jsx)(oL,{plugin:e,onOpen:()=>sP(NP(e.name)),onToggle:t=>d.mutate({name:e.name,action:t?`enable`:`disable`}),onReload:()=>d.mutate({name:e.name,action:`reload`}),onUninstall:()=>u(e)},e.name))},t):(0,V.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 xl:grid-cols-3`,children:eL.map(e=>(0,V.jsx)(zv,{className:`h-[150px] rounded-xl`},e))})]},`installed`)}),(0,V.jsx)(KI,{open:s,onOpenChange:c}),(0,V.jsx)(qI,{plugin:l,onClose:()=>{u(null)}})]})}function aL({n:e}){return e===void 0?null:(0,V.jsx)(`span`,{className:`ml-0.5 text-fg-3 tabular`,children:e})}function oL({plugin:e,onOpen:t,onToggle:n,onReload:r,onUninstall:i}){let a=QI[e.state],o=e.commands.filter(e=>!e.hidden).length;return(0,V.jsx)(K.div,{variants:jv,layout:!0,whileHover:{y:-2},transition:q,children:(0,V.jsxs)(J,{role:`button`,tabIndex:0,onClick:e=>{e.target.closest(`[data-card-control]`)||t()},onKeyDown:e=>e.key===`Enter`&&e.target===e.currentTarget&&t(),className:`group flex h-full cursor-pointer flex-col p-4 transition-[border-color,box-shadow] hover:border-border-strong hover:shadow-pop`,children:[(0,V.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,V.jsx)(MI,{src:e.iconUrl,className:e.state===`active`?`bg-accent-soft text-accent-soft-fg`:void 0}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,V.jsx)(`span`,{className:`truncate text-[14px] font-semibold tracking-[-0.01em]`,children:e.name}),e.version&&(0,V.jsxs)(`span`,{className:`font-mono text-[11px] text-fg-3`,children:[`v`,e.version]})]}),(0,V.jsx)(`div`,{className:`truncate text-[11.5px] text-fg-3`,children:$I(e)})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1`,"data-card-control":!0,children:[(0,V.jsxs)(DO,{trigger:(0,V.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":`更多操作`,className:`opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100`,children:(0,V.jsx)(Pn,{className:`size-4`})}),children:[(0,V.jsx)(OO,{icon:(0,V.jsx)(ei,{}),onSelect:r,children:`重载`}),(0,V.jsx)(OO,{icon:(0,V.jsx)(mi,{}),onSelect:t,children:`详情与配置`}),e.removable&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(kO,{}),(0,V.jsx)(OO,{icon:(0,V.jsx)(Hi,{}),danger:!0,onSelect:i,children:`卸载`})]})]}),(0,V.jsx)(hA,{"aria-label":`启用 ${e.name}`,checked:e.enabled,onCheckedChange:n})]})]}),(0,V.jsx)(Tg,{mode:`wait`,initial:!1,children:e.state===`failed`&&e.error?(0,V.jsxs)(K.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:q,className:`mt-3 flex min-h-[38px] gap-2 rounded-lg bg-danger-soft px-2.5 py-1.5 text-[12px] leading-relaxed text-danger`,children:[(0,V.jsx)(Wi,{className:`mt-[3px] size-3.5 shrink-0`}),(0,V.jsx)(`span`,{className:`line-clamp-2 break-all`,children:e.error})]},`error`):(0,V.jsx)(K.p,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:`mt-3 line-clamp-2 min-h-[38px] text-[13px] leading-relaxed text-fg-2`,children:e.description||`没有描述`},`description`)}),(0,V.jsxs)(`div`,{className:`mt-auto flex items-center gap-2 pt-3`,children:[(0,V.jsx)(Pv,{tone:a.tone,dot:!0,pulse:e.state===`loading`,children:a.label}),(0,V.jsxs)(`span`,{className:`flex items-center gap-1 text-[12px] text-fg-3`,children:[(0,V.jsx)(Mi,{className:`size-3.5`}),o,` 条命令`]}),GI(e)&&(0,V.jsxs)(`span`,{className:`ml-auto inline-flex items-center gap-1 text-[12px] text-info`,children:[(0,V.jsx)(fn,{className:`size-3.5`}),`v`,e.package?.latest]})]})]})})}function sL(){let e=cP().split(`/`).filter(Boolean).map(decodeURIComponent),t=e[1]??``,n=Z({queryKey:[`plugins`],queryFn:$.plugins}),[r,i]=(0,B.useState)(null),{action:a}=rL();if(n.error)return(0,V.jsx)(Vv,{error:n.error,onRetry:()=>void n.refetch()});if(!n.data)return(0,V.jsx)(zv,{className:`h-64 rounded-xl`});let o=n.data.find(e=>e.name===t);if(!o)return(0,V.jsx)(Bv,{icon:(0,V.jsx)(Wr,{}),title:`插件不存在或已卸载`,action:(0,V.jsx)(X,{onClick:()=>sP(`/plugins`),children:`返回插件列表`})});let s=[{value:`overview`,label:`概览`},...o.package?[{value:`readme`,label:`README`}]:[],{value:`config`,label:`全局配置`},...o.hasCredentials?[{value:`credentials`,label:`凭据`}]:[],{value:`commands`,label:`命令`},{value:`bots`,label:`机器人`},{value:`groups`,label:`群组`}],c=s.find(t=>t.value===e[2])?.value??`overview`;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(lP,{to:`/plugins`,className:`mb-4 inline-flex items-center gap-1.5 text-[13px] text-fg-3 hover:text-fg`,children:[(0,V.jsx)(kt,{className:`size-3.5`}),`插件列表`]}),(0,V.jsx)(Hv,{title:(0,V.jsxs)(`span`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(MI,{src:o.iconUrl}),(0,V.jsx)(`span`,{className:`break-all`,children:o.name}),(0,V.jsx)(Pv,{tone:QI[o.state].tone,dot:!0,children:QI[o.state].label})]}),description:o.description,actions:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(X,{loading:a.isPending,onClick:()=>a.mutate({name:t,action:`reload`}),children:[(0,V.jsx)(ei,{className:`size-3.5`}),`重载`]}),(0,V.jsx)(hA,{"aria-label":`全局启用插件`,checked:o.enabled,disabled:t===`admin`||a.isPending,onCheckedChange:e=>a.mutate({name:t,action:e?`enable`:`disable`})})]})}),(0,V.jsxs)(`div`,{className:`mb-5 flex flex-wrap gap-4 text-[13px]`,children:[(0,V.jsx)(lP,{to:`/logs?plugin=${encodeURIComponent(t)}`,className:`text-accent`,children:`查看日志`}),(0,V.jsx)(lP,{to:`/tasks?plugin=${encodeURIComponent(t)}`,className:`text-accent`,children:`查看任务`})]}),(0,V.jsx)(wO,{value:c,onChange:e=>sP(NP(t,e)),tabs:s,className:`mb-5`}),(0,V.jsxs)(J,{className:`p-5 sm:p-6`,children:[c===`overview`&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(fL,{plugin:o,onUninstall:()=>i(o)}),(0,V.jsx)(cL,{plugin:o})]}),c===`readme`&&o.package&&(0,V.jsx)(jI,{name:t,info:o.package}),c===`config`&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`p`,{className:`mb-4 text-[13px] text-fg-3`,children:[`这里的配置是默认值,机器人与群组可分别覆盖。`,(0,V.jsx)(lP,{to:NP(t,`bots`),className:`ml-1 text-accent`,children:`查看机器人覆盖`})]}),(0,V.jsx)(mL,{plugin:o})]}),c===`credentials`&&(0,V.jsx)(B.Suspense,{fallback:(0,V.jsx)(zv,{className:`h-32`}),children:(0,V.jsx)(tL,{name:t},t)}),c===`commands`&&(0,V.jsx)(gL,{plugin:o}),c===`bots`&&(0,V.jsx)(lL,{plugin:o}),c===`groups`&&(0,V.jsx)(_L,{plugin:o})]}),(0,V.jsx)(qI,{plugin:r,onClose:()=>i(null)})]})}function cL({plugin:e}){return(0,V.jsxs)(`section`,{className:`mt-6 border-t border-border pt-5`,children:[(0,V.jsx)(`h2`,{className:`text-sm font-semibold`,children:`机器人能力要求`}),e.capabilities?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{className:`mt-2 text-[12.5px] text-fg-3`,children:`能力缺失会提示,不影响启用。各机器人的匹配情况可在“机器人”中查看。`}),[`required`,`optional`].map(t=>(0,V.jsxs)(`div`,{className:`mt-4`,children:[(0,V.jsx)(`h3`,{className:`mb-2 text-[12px] text-fg-3`,children:t===`required`?`必须能力`:`可选能力`}),(0,V.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:Object.entries(e.capabilities?.[t]??{}).flatMap(([e,t])=>t.map(t=>(0,V.jsxs)(Pv,{children:[(0,V.jsx)(`span`,{className:`text-fg-3`,children:e}),t]},`${e}:${t}`)))})]},t))]}):(0,V.jsx)(`p`,{className:`mt-2 text-[13px] text-fg-3`,children:`插件未声明能力要求。`})]})}function lL({plugin:e}){let t=Tj(),n=XM({mutationFn:t=>$.pluginBotDefault(e.name,t),onSuccess:e=>nL(t,e)});return(0,V.jsxs)(`div`,{className:`space-y-5`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 border-b border-border pb-5`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h2`,{className:`text-sm font-semibold`,children:(0,V.jsx)(`label`,{htmlFor:`new-bot-plugin-default`,className:`cursor-pointer`,children:`新机器人默认启用`})}),(0,V.jsx)(`p`,{className:`mt-1 text-[13px] text-fg-3`,children:`仅影响之后首次接入的机器人。`})]}),(0,V.jsx)(hA,{id:`new-bot-plugin-default`,className:`ml-auto`,checked:n.isPending?n.variables:e.defaultOnNewBots,disabled:n.isPending,onCheckedChange:e=>n.mutate(e)})]}),!e.enabled&&(0,V.jsx)(`p`,{className:`text-[13px] text-fg-3`,children:`重新全局启用后,会按各机器人的开关生效。`}),(0,V.jsx)(uL,{plugin:e})]})}function uL({plugin:e}){let t=Tj(),n=Z({queryKey:[`pluginBots`,e.name],queryFn:()=>$.pluginBots(e.name)}),r=XM({mutationFn:({bot:t,enabled:n})=>$.botPlugin(t,e.name,{enabled:n}),onSuccess:()=>IP(t)});return n.error?(0,V.jsx)(Vv,{error:n.error,onRetry:()=>void n.refetch()}):n.data?n.data.length?(0,V.jsx)(`ul`,{className:`divide-y divide-border`,children:n.data.map(({bot:t,application:n})=>(0,V.jsxs)(`li`,{className:`py-4 first:pt-0 last:pb-0`,children:[(0,V.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-3`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(lP,{to:AP(t),className:`text-sm font-medium hover:text-accent`,children:jP(t)}),(0,V.jsxs)(`p`,{className:`mt-1 break-all font-mono text-[11.5px] text-fg-3`,children:[t.platform,` · `,t.selfId]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(lP,{to:AP(t,`plugins/${encodeURIComponent(e.name)}`),className:`text-[12.5px] text-accent`,children:`配置与继承`}),(0,V.jsx)(hA,{"aria-label":`在 ${jP(t)} 上启用`,checked:n.overrideEnabled??n.botDefaultEnabled,disabled:r.isPending,onCheckedChange:e=>r.mutate({bot:t,enabled:e})})]})]}),(0,V.jsx)(Uv,{value:n.compatibility}),n.override&&(0,V.jsxs)(`p`,{className:`mt-2 text-[12px] text-fg-3`,children:[`配置已覆盖:`,Object.keys(n.override).join(`、`)]})]},`${t.platform}:${t.selfId}`))}):(0,V.jsx)(Bv,{icon:(0,V.jsx)(Gt,{}),title:`还没有机器人`,action:(0,V.jsx)(X,{onClick:()=>sP(`/bots/connections/new`),children:`添加连接`})}):(0,V.jsx)(zv,{className:`h-32`})}function dL({label:e,children:t}){return(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-6 border-b border-border py-3 last:border-0`,children:[(0,V.jsx)(`dt`,{className:`shrink-0 text-[13px] text-fg-3`,children:e}),(0,V.jsx)(`dd`,{className:`min-w-0 text-right text-[13px] break-all text-fg`,children:t})]})}function fL({plugin:e,onUninstall:t}){return(0,V.jsxs)(`div`,{className:`space-y-5`,children:[e.state===`failed`&&e.error&&(0,V.jsxs)(`div`,{className:`flex gap-2.5 rounded-xl bg-danger-soft px-3.5 py-3 text-[13px] text-danger`,children:[(0,V.jsx)(Wi,{className:`mt-0.5 size-4 shrink-0`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`font-medium`,children:`加载失败`}),(0,V.jsx)(`p`,{className:`mt-0.5 leading-relaxed break-all`,children:e.error})]})]}),(0,V.jsxs)(`dl`,{children:[(0,V.jsx)(dL,{label:`状态`,children:QI[e.state].label}),(0,V.jsx)(dL,{label:`全局开关`,children:e.enabled?`已启用`:`已停用`}),(0,V.jsx)(dL,{label:`版本`,children:e.version?(0,V.jsxs)(`span`,{className:`font-mono`,children:[`v`,e.version]}):`—`}),(0,V.jsx)(dL,{label:`来源`,children:e.source===`builtin`?`内置插件`:e.source===`package`?`npm 插件包`:`本地文件`}),e.package&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(dL,{label:`包名`,children:(0,V.jsx)(`span`,{className:`font-mono`,children:e.package.name})}),(0,V.jsxs)(dL,{label:`已安装版本`,children:[(0,V.jsxs)(`span`,{className:`font-mono`,children:[`v`,e.package.version]}),e.package.latest&&e.package.latest!==e.package.version&&(0,V.jsxs)(`span`,{className:`ml-2 text-info`,children:[`最新 v`,e.package.latest]})]}),e.package.peerRange&&(0,V.jsxs)(dL,{label:`要求框架版本`,children:[(0,V.jsx)(`span`,{className:z(`font-mono`,!e.package.compatible&&`text-danger`),children:e.package.peerRange}),!e.package.compatible&&(0,V.jsx)(`span`,{className:`ml-2 text-danger`,children:`与当前版本不兼容`})]})]}),e.path&&(0,V.jsx)(dL,{label:`文件`,children:(0,V.jsx)(`span`,{className:`font-mono text-[12px] text-fg-2`,children:e.path})}),(0,V.jsxs)(dL,{label:`命令`,children:[e.commands.length,` 条`]}),(0,V.jsx)(dL,{label:`可配置`,children:e.configSchema?`是`:`否`}),e.depends&&e.depends.length>0&&(0,V.jsx)(dL,{label:`依赖插件`,children:(0,V.jsx)(`span`,{className:`inline-flex flex-wrap justify-end gap-2`,children:e.depends.map(e=>(0,V.jsx)(lP,{to:NP(e),className:`text-accent`,children:e},e))})}),e.provides.length>0&&(0,V.jsx)(dL,{label:`提供服务`,children:(0,V.jsx)(hL,{services:e.provides.map(e=>({name:e,optional:!1}))})}),e.inject.length>0&&(0,V.jsx)(dL,{label:`依赖服务`,children:(0,V.jsx)(hL,{services:e.inject})})]}),GI(e)&&(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl bg-info-soft px-4 py-3`,children:[(0,V.jsxs)(`span`,{className:`text-[13px] text-info`,children:[`有新版本 v`,e.package?.latest,` 可用`]}),(0,V.jsx)(ZI,{plugin:e})]}),e.removable&&(0,V.jsx)(`div`,{className:`rounded-xl border border-danger/25 px-4 py-3.5`,children:(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[13px] font-medium text-fg`,children:`卸载插件`}),(0,V.jsxs)(`p`,{className:`mt-0.5 text-[12px] text-fg-3`,children:[e.source===`package`?`通过 npm 卸载这个插件包。`:`删除插件目录中的插件文件。`,`可以选择同时清理数据。`]})]}),(0,V.jsxs)(X,{variant:`danger-ghost`,size:`sm`,onClick:t,children:[(0,V.jsx)(Hi,{className:`size-3.5`}),`卸载`]})]})})]})}function pL(e,t){if(!(t instanceof PN))return{};let n=[`plugins.${e}.config.`,`plugins.${e}.config`,`config.`,`config`];return Object.fromEntries(t.issues.map(e=>{let t=n.find(t=>e.path.startsWith(t));return[t?e.path.slice(t.length):e.path,e.message]}))}function mL({plugin:e}){let t=KP(),{update:n}=rL(),r=XM({mutationFn:t=>$.pluginConfig(e.name,t),meta:{silent:!0},onSuccess:e=>{n(e),vN.success(`配置已保存,插件已重载`)},onError:e=>{e instanceof PN&&e.status===400||vN.error(e.message)}});return e.configSchema?(0,V.jsx)(EA,{schema:e.configSchema,value:e.config,issues:r.error?pL(e.name,r.error):{},saving:r.isPending,resolveOptions:t,onSubmit:e=>r.mutate(e)}):(0,V.jsx)(Bv,{icon:(0,V.jsx)(mi,{}),title:`没有可配置项`,description:`插件没有声明 config schema。`,className:`py-10`})}function hL({services:e}){return(0,V.jsx)(`span`,{className:`inline-flex flex-wrap justify-end gap-1.5`,children:e.map(({name:e,optional:t})=>(0,V.jsx)(`span`,{title:t?`可选:缺失时插件照常运行`:void 0,children:(0,V.jsxs)(Pv,{className:`font-mono`,children:[e,t&&(0,V.jsx)(`span`,{className:`font-sans text-fg-3`,children:`可选`})]})},e))})}function gL({plugin:e}){return e.commands.length===0?(0,V.jsx)(Bv,{icon:(0,V.jsx)(Mi,{}),title:`这个插件没有注册命令`,className:`py-10`}):(0,V.jsx)(`ul`,{className:`space-y-2`,children:e.commands.map(e=>(0,V.jsx)(`li`,{className:`group rounded-xl border border-border px-3.5 py-3`,children:(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`code`,{className:`font-mono text-[13px] font-medium text-fg`,children:e.usage}),e.description&&(0,V.jsx)(`p`,{className:`mt-1 text-[12.5px] text-fg-3`,children:e.description}),(0,V.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:[e.aliases.map(e=>(0,V.jsxs)(Pv,{children:[`别名 `,e]},e)),e.permission&&(0,V.jsx)(Pv,{tone:`warning`,children:`需要权限`}),e.scope!==`all`&&(0,V.jsx)(Pv,{tone:`info`,children:e.scope===`group`?`仅群聊`:`仅私聊`}),e.hidden&&(0,V.jsx)(Pv,{children:`隐藏`})]})]}),(0,V.jsxs)(X,{variant:`soft`,size:`sm`,className:`opacity-0 transition-opacity group-hover:opacity-100`,onClick:()=>{bP.set(`/${e.path} `),sP(`/playground`)},children:[(0,V.jsx)(Hn,{className:`size-3.5`}),`试用`]})]})},e.path))})}function _L({plugin:e}){let t=Tj(),n=Z({queryKey:[`pluginGroups`,e.name],queryFn:()=>$.pluginGroups(e.name)}),[r,i]=(0,B.useState)(``),a=Z({queryKey:[`bots`],queryFn:$.bots}),[o,s]=(0,B.useState)(``),c=a.data?.find(e=>`${e.platform}:${e.selfId}`===o)??a.data?.[0],l=XM({mutationFn:({groupKey:t,enabled:n})=>$.setPluginGroup(e.name,t,{enabled:n}),onMutate:({groupKey:n,enabled:r})=>{t.setQueryData([`pluginGroups`,e.name],(e=[])=>e.some(e=>e.groupKey===n)?e.map(e=>e.groupKey===n?{...e,enabled:r}:e):[...e,{groupKey:n,enabled:r}])},onSettled:()=>{t.invalidateQueries({queryKey:[`pluginGroups`,e.name]}),t.invalidateQueries({queryKey:[`groups`]})}});return(0,V.jsxs)(`div`,{className:`space-y-5`,children:[(0,V.jsxs)(`p`,{className:`text-[13px] leading-relaxed text-fg-3`,children:[`插件在机器人上启用后,默认在它的所有群生效。可单独关闭某个群,私聊不受影响。`,e.configSchema&&`按群覆盖配置请到“群组”页面中打开对应的群。`]}),(0,V.jsxs)(`form`,{className:`flex flex-wrap gap-2`,onSubmit:e=>{e.preventDefault();let t=r.trim();if(!wP(t))return vN.error(`请输入群 ID`);if(!c)return vN.error(`请先添加机器人`);l.mutate({groupKey:`${c.platform}:${c.selfId}:group:${t}`,enabled:!1}),i(``)},children:[(0,V.jsx)(Zk,{"aria-label":`机器人`,value:c?`${c.platform}:${c.selfId}`:``,onValueChange:s,options:(a.data??[]).map(e=>({value:`${e.platform}:${e.selfId}`,label:`${jP(e)} · ${e.platform}`}))}),(0,V.jsx)(FO,{icon:(0,V.jsx)(Qi,{}),placeholder:`群 ID`,value:r,onChange:e=>i(e.target.value),className:`flex-1`}),(0,V.jsxs)(X,{type:`submit`,variant:`secondary`,children:[(0,V.jsx)(Hr,{className:`size-4`}),`在该群关闭`]})]}),n.error&&!n.data?(0,V.jsx)(Vv,{error:n.error,onRetry:()=>void n.refetch(),retrying:n.isFetching,className:`py-8`}):n.isPending?(0,V.jsx)(zv,{className:`h-24`}):(n.data??[]).length===0?(0,V.jsx)(Bv,{icon:(0,V.jsx)(Qi,{}),title:`没有单独设置的群`,description:`当前在所有群都生效。`,className:`py-8`}):(0,V.jsx)(`ul`,{className:`divide-y divide-border rounded-xl border border-border`,children:(0,V.jsx)(Tg,{initial:!1,children:n.data?.map(e=>(0,V.jsxs)(K.li,{layout:!0,initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:q,className:`flex items-center justify-between px-4 py-3`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`font-mono text-[13px] text-fg`,children:e.groupKey.split(`:`).slice(3).join(`:`)}),e.config!==void 0&&(0,V.jsx)(lP,{to:UP(e.groupKey),children:(0,V.jsx)(Pv,{tone:`accent`,children:`配置已覆盖`})})]}),(0,V.jsx)(`div`,{className:`text-[11.5px] text-fg-3`,children:e.groupKey.split(`:`).slice(0,2).join(` · `)})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(`span`,{className:z(`text-[12.5px]`,e.enabled===!1?`text-fg-3`:`text-success`),children:e.enabled===!1?`已关闭`:`已开启`}),(0,V.jsx)(hA,{"aria-label":`${e.groupKey} 开关`,checked:e.enabled!==!1,onCheckedChange:t=>l.mutate({groupKey:e.groupKey,enabled:t})})]})]},e.groupKey))})})]})}var vL={type:`object`,properties:{superusers:{type:`array`,items:{type:`object`,required:[`platform`,`selfId`,`userId`],properties:{platform:{type:`string`,title:`平台`},selfId:{type:`string`,title:`机器人 ID`},userId:{type:`string`,title:`用户 ID`}}},title:`框架管理员`,description:`身份绑定平台、机器人和用户,可在聊天中管理全局插件、安装包与访问控制。各机器人的管理员在机器人设置中配置`},timezone:{type:`string`,title:`时区`,description:`IANA 时区名称,例如 Asia/Shanghai。用于定时任务和“今日”统计,重启后生效`}}},yL={type:`object`,properties:{prefixes:{type:`array`,items:{type:`string`},title:`命令前缀`,description:`消息以其中任一前缀开头时识别为命令`},mentionAsPrefix:{type:`boolean`,title:`@机器人时可省略前缀`,description:`群聊中 @机器人 后可以直接写命令名`},privateRequirePrefix:{type:`boolean`,title:`私聊也需要前缀`,description:`关闭时私聊可以直接写命令名`},replyOnError:{type:`boolean`,title:`出错时回复`,description:`命令处理出错时回复一条简短提示`},replyOnDenied:{type:`boolean`,title:`拒绝时回复`,description:`权限不足或冷却中时回复提示`},suggest:{type:`string`,title:`相似命令提示`,description:`命令写错时回复“你是不是想用 /xxx?”,只提示不执行`,oneOf:[{const:`direct`,title:`私聊和 @机器人 时`},{const:`always`,title:`所有带前缀的消息`},{const:`off`,title:`关闭`}]}}},bL={timezone:`时区`};function xL(e,t){return e instanceof PN?Object.fromEntries(e.issues.filter(e=>e.path.startsWith(t)).map(e=>[e.path.slice(t.length).replace(/^\./,``),e.message])):{}}function SL(){let e=Tj(),t=Z({queryKey:[`settings`],queryFn:$.settings}),n=XM({mutationFn:({input:e})=>$.updateSettings(e),meta:{silent:!0},onSuccess:(t,{message:n})=>{e.setQueryData([`settings`],t),vN.success(n)},onError:e=>{e instanceof PN&&e.status===400||vN.error(e.message)}}),r=e=>n.variables?.section===e?n.error:null,i=e=>n.isPending&&n.variables?.section===e;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Hv,{title:`设置`,description:`框架的核心配置,保存后写回配置文件`}),t.error&&!t.data?(0,V.jsx)(J,{children:(0,V.jsx)(Vv,{error:t.error,onRetry:()=>void t.refetch(),retrying:t.isFetching})}):t.data?(0,V.jsxs)(K.div,{variants:Av,initial:`initial`,animate:`animate`,className:`max-w-3xl space-y-3`,children:[(0,V.jsx)(Tg,{initial:!1,children:t.data.restartRequired.length>0&&(0,V.jsx)(K.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:q,className:`overflow-hidden`,children:(0,V.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-xl bg-warning-soft px-4 py-3 text-[13px] text-warning`,children:[(0,V.jsx)(ei,{className:`size-4 shrink-0`}),`以下修改已写入配置文件,重启 AsaBot 后生效:`,t.data.restartRequired.map(e=>bL[e]??e).join(`、`)]})})}),(0,V.jsx)(CL,{icon:(0,V.jsx)(Ei,{}),title:`基本`,description:`框架管理员与时区`,children:(0,V.jsx)(EA,{schema:vL,value:{superusers:t.data.superusers,timezone:t.data.timezone},issues:xL(r(`basic`),``),saving:i(`basic`),note:`管理员设置立即生效,时区在重启后生效`,submitLabel:`保存`,onSubmit:e=>n.mutate({section:`basic`,input:e,message:`基本设置已保存`})})}),(0,V.jsx)(CL,{icon:(0,V.jsx)(Mi,{}),title:`命令`,description:`命令的触发方式与回复行为`,children:(0,V.jsx)(EA,{schema:yL,value:t.data.command,issues:xL(r(`command`),`command`),saving:i(`command`),note:`保存后立即生效`,submitLabel:`保存`,onSubmit:e=>n.mutate({section:`command`,input:{command:e},message:`命令设置已保存`})})})]}):(0,V.jsxs)(`div`,{className:`max-w-3xl space-y-3`,children:[(0,V.jsx)(zv,{className:`h-56 rounded-xl`}),(0,V.jsx)(zv,{className:`h-72 rounded-xl`})]})]})}function CL({icon:e,title:t,description:n,action:r,children:i}){return(0,V.jsx)(K.div,{variants:jv,children:(0,V.jsxs)(J,{children:[(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-4 px-6 pt-5 pb-1`,children:[(0,V.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,V.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-lg border border-border bg-surface-2 text-fg-2 [&>svg]:size-4`,children:e}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h2`,{className:`text-[14px] font-semibold tracking-[-0.01em] text-fg`,children:t}),(0,V.jsx)(`p`,{className:`mt-0.5 text-[12.5px] text-fg-3`,children:n})]})]}),r]}),(0,V.jsx)(`div`,{className:`px-6 pt-4 pb-6`,children:i})]})})}var wL={pending:{label:`待执行`,tone:`neutral`},running:{label:`执行中`,tone:`accent`},retry_wait:{label:`等待重试`,tone:`warning`},cancelling:{label:`等待退出`,tone:`warning`},succeeded:{label:`已完成`,tone:`success`},failed:{label:`失败`,tone:`danger`},cancelled:{label:`已取消`,tone:`neutral`}},TL={running:`执行中`,succeeded:`成功`,failed:`失败`,cancelled:`取消`,interrupted:`中断`,timeout:`超时`},EL=e=>e===void 0?`—`:new Date(e).toLocaleString(`zh-CN`,{hour12:!1}),DL=e=>`/tasks/${encodeURIComponent(e)}${window.location.search}`;function OL(){let e=cP(),t=uP(),n=e.startsWith(`/tasks/`)?decodeURIComponent(e.slice(7)):null,[r,i]=(0,B.useState)(``),a=new URLSearchParams(t.split(`?`)[1]).get(`plugin`)??`all`,[o,s]=(0,B.useState)(`all`),[c,l]=(0,B.useState)({plugin:a,page:0}),u=c.plugin===a?c.page:0,d=e=>l({plugin:a,page:e}),f=Z({queryKey:[`plugins`],queryFn:$.plugins}),p={q:r,...a===`all`?{}:{plugin:a},...o===`all`?{}:{state:o},limit:`25`,offset:String(u*25)},m=Z({queryKey:[`tasks`,`list`,p],queryFn:()=>$.tasks(p),refetchInterval:15e3}),h=m.data?.total??0;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Hv,{title:`任务中心`,description:`查看插件的一次性任务、执行历史与重试状态。`,actions:(0,V.jsxs)(X,{variant:`secondary`,loading:m.isFetching,onClick:()=>void m.refetch(),children:[(0,V.jsx)(Jr,{className:`size-3.5`}),`刷新`]})}),(0,V.jsxs)(`div`,{className:`mb-4 flex flex-wrap gap-3`,children:[(0,V.jsx)(FO,{"aria-label":`搜索任务`,icon:(0,V.jsx)(ui,{}),placeholder:`搜索插件、任务名或键`,value:r,onChange:e=>{i(e.target.value),d(0)},className:`w-64`}),(0,V.jsx)(Zk,{"aria-label":`任务状态`,value:o,onValueChange:e=>{s(e),d(0)},options:[{value:`all`,label:`全部状态`},...Object.entries(wL).map(([e,{label:t}])=>({value:e,label:t}))]}),(0,V.jsx)(Zk,{"aria-label":`所属插件`,value:a,onValueChange:e=>{sP(e===`all`?`/tasks`:`/tasks?plugin=${encodeURIComponent(e)}`),d(0)},options:[{value:`all`,label:`全部插件`},...(f.data??[]).map(e=>({value:e.name,label:e.name}))]})]}),m.error?(0,V.jsx)(J,{children:(0,V.jsx)(Vv,{error:m.error,onRetry:()=>void m.refetch(),retrying:m.isFetching})}):m.data?m.data.items.length?(0,V.jsx)(J,{className:`overflow-hidden`,children:(0,V.jsx)(`div`,{className:`overflow-x-auto`,children:(0,V.jsxs)(`table`,{className:`w-full text-left text-[13px]`,children:[(0,V.jsx)(`thead`,{className:`bg-surface-2/50 text-fg-3`,children:(0,V.jsx)(`tr`,{children:[`任务 / 插件`,`状态`,`下次执行`,`尝试`,`最近更新`].map(e=>(0,V.jsx)(`th`,{className:`whitespace-nowrap px-5 py-3 font-medium`,children:e},e))})}),(0,V.jsx)(`tbody`,{className:`divide-y divide-border`,children:m.data.items.map(e=>(0,V.jsxs)(`tr`,{className:`hover:bg-surface-2/60`,children:[(0,V.jsxs)(`td`,{className:`max-w-64 px-5 py-3`,children:[(0,V.jsxs)(`button`,{type:`button`,onClick:()=>sP(DL(e.id)),className:`block w-full cursor-pointer truncate text-left font-medium text-accent hover:underline`,children:[e.name,` · `,e.key]}),(0,V.jsx)(`div`,{className:`mt-1 truncate text-xs text-fg-3`,children:e.plugin})]}),(0,V.jsxs)(`td`,{className:`px-5 py-3`,children:[(0,V.jsx)(Pv,{tone:wL[e.state].tone,children:wL[e.state].label}),e.blockedReason&&(0,V.jsx)(`div`,{className:`mt-1 max-w-44 text-xs text-fg-3`,children:e.blockedReason})]}),(0,V.jsx)(`td`,{className:`whitespace-nowrap px-5 py-3 text-fg-2`,children:e.state===`pending`||e.state===`retry_wait`?EL(e.nextRunAt):`—`}),(0,V.jsx)(`td`,{className:`px-5 py-3 tabular-nums`,children:e.attempt}),(0,V.jsx)(`td`,{className:`whitespace-nowrap px-5 py-3 text-fg-3`,children:EL(e.updatedAt)})]},e.id))})]})})}):(0,V.jsx)(J,{children:(0,V.jsx)(Bv,{icon:(0,V.jsx)(or,{}),title:r||o!==`all`||a!==`all`?`没有匹配的任务`:`暂无任务`,description:`插件通过 ctx.task 创建的任务会显示在这里。`})}):(0,V.jsx)(zv,{className:`h-72 rounded-xl`}),(0,V.jsxs)(`div`,{className:`mt-4 flex items-center justify-between text-xs text-fg-3`,children:[(0,V.jsxs)(`span`,{children:[`共 `,h,` 个任务 · 第 `,u+1,` 页`]}),(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsx)(X,{variant:`secondary`,size:`icon`,"aria-label":`上一页`,disabled:!u,onClick:()=>d(u-1),children:(0,V.jsx)(on,{className:`size-4`})}),(0,V.jsx)(X,{variant:`secondary`,size:`icon`,"aria-label":`下一页`,disabled:(u+1)*25>=h,onClick:()=>d(u+1),children:(0,V.jsx)(cn,{className:`size-4`})})]})]}),(0,V.jsx)(kL,{id:n})]})}function kL({id:e}){let t=Tj(),[n,r]=(0,B.useState)(null),i=Z({queryKey:[`tasks`,e],queryFn:()=>$.task(e),enabled:e!==null,refetchInterval:15e3}),a=Z({queryKey:[`tasks`,e,`attempts`],queryFn:()=>$.taskAttempts(e),enabled:e!==null,refetchInterval:15e3}),o=XM({mutationFn:({operation:t,confirmDelivery:n})=>$.taskAction(e,t,n),onSuccess:()=>{r(null),t.invalidateQueries({queryKey:[`tasks`]})},onError:e=>vN.error(e.message)}),s=i.data,c=s&&[`pending`,`running`,`retry_wait`].includes(s.state),l=s?`${s.id}:${s.attempt}`:null,u=s?.deliveryFailure&&s.deliveryFailure.outcome!==`not_sent`;return(0,V.jsx)(Cj,{open:e!==null,onOpenChange:e=>{e||(r(null),sP(`/tasks${window.location.search}`))},title:s?.name??`任务详情`,subtitle:s?.plugin,children:(0,V.jsx)(`div`,{className:`space-y-6 p-6`,children:i.error?(0,V.jsx)(Vv,{error:i.error,onRetry:()=>void i.refetch()}):s?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(Pv,{tone:wL[s.state].tone,children:wL[s.state].label}),(0,V.jsxs)(`div`,{className:`ml-auto flex gap-2`,children:[s.canRetry&&n!==l&&(0,V.jsx)(X,{variant:`secondary`,loading:o.isPending,onClick:()=>u?r(l):o.mutate({operation:`retry`}),children:`重试`}),c&&(0,V.jsx)(X,{variant:`secondary`,loading:o.isPending,onClick:()=>o.mutate({operation:`cancel`}),children:`取消任务`})]})]}),s.canRetry&&u&&n===l&&(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 rounded-lg border border-border p-3`,children:[(0,V.jsx)(`p`,{className:`mr-auto text-[13px] text-warning`,children:`重试可能重复发送。请先核对会话中的消息。`}),(0,V.jsx)(X,{variant:`ghost`,onClick:()=>r(null),children:`取消`}),(0,V.jsx)(X,{variant:`secondary`,loading:o.isPending,onClick:()=>o.mutate({operation:`retry`,confirmDelivery:!0}),children:`确认重试`})]}),s.blockedReason&&(0,V.jsx)(`p`,{className:`text-sm text-warning`,children:s.blockedReason}),s.state===`cancelling`&&(0,V.jsx)(`p`,{className:`text-sm text-fg-3`,children:`已发送中止信号,等待处理函数退出后释放执行名额。`}),(0,V.jsx)(`dl`,{className:`grid grid-cols-[auto_minmax(0,1fr)] gap-x-5 gap-y-3 text-[13px]`,children:[[`任务 ID`,s.id],[`逻辑键`,s.key],[`创建时间`,EL(s.createdAt)],[`原定执行`,EL(s.runAt)],[`下次执行`,EL(s.nextRunAt)],[`开始时间`,EL(s.startedAt)],[`结束时间`,EL(s.finishedAt)],[`执行次数`,String(s.attempt)],[`自动重试`,`${s.policy.maxRetries} 次 · ${s.policy.delay}ms 起`],[`超时`,s.policy.timeout?`${s.policy.timeout}ms`:`未设置`]].map(([e,t])=>(0,V.jsx)(AL,{label:e??``,value:t??``},e))}),s.error&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{className:`mb-2 text-sm font-medium`,children:`最近错误`}),(0,V.jsx)(`pre`,{className:`whitespace-pre-wrap break-all rounded-lg bg-danger-soft p-3 text-xs text-danger`,children:s.error}),s.deliveryFailure&&(0,V.jsx)(`div`,{className:`mt-3`,children:(0,V.jsx)(Gv,{failure:s.deliveryFailure})})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{className:`mb-2 text-sm font-medium`,children:`参数`}),(0,V.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-all rounded-lg bg-surface-2 p-3 text-xs text-fg-2`,children:JSON.stringify(s.payload,null,2)})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h3`,{className:`mb-3 text-sm font-medium`,children:`执行历史`}),a.error?(0,V.jsx)(Vv,{error:a.error,onRetry:()=>void a.refetch()}):a.data?a.data.length===0?(0,V.jsx)(`p`,{className:`text-sm text-fg-3`,children:`尚未开始执行`}):(0,V.jsx)(`ol`,{className:`space-y-3`,children:a.data.map(e=>(0,V.jsxs)(`li`,{className:`rounded-lg border border-border p-3 text-xs`,children:[(0,V.jsxs)(`div`,{className:`flex justify-between font-medium`,children:[(0,V.jsxs)(`span`,{children:[`第 `,e.attempt,` 次`]}),(0,V.jsx)(`span`,{children:TL[e.outcome]})]}),(0,V.jsxs)(`div`,{className:`mt-2 text-fg-3`,children:[EL(e.startedAt),` → `,EL(e.finishedAt)]}),e.finishedAt!==void 0&&(0,V.jsxs)(`div`,{className:`mt-1 text-fg-3`,children:[`耗时 `,e.finishedAt-e.startedAt,`ms`]}),e.error&&(0,V.jsx)(`pre`,{className:`mt-2 whitespace-pre-wrap break-all text-danger`,children:e.error}),e.deliveryFailure&&(0,V.jsx)(`div`,{className:`mt-2`,children:(0,V.jsx)(Gv,{failure:e.deliveryFailure})})]},e.id))}):(0,V.jsx)(zv,{className:`h-20`})]})]}):(0,V.jsx)(zv,{className:`h-56`})})})}function AL({label:e,value:t}){return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`dt`,{className:`text-fg-3`,children:e}),(0,V.jsx)(`dd`,{className:`break-all text-fg-2`,children:t})]})}var jL=1,ML=.9,NL=.8,PL=.17,FL=.1,IL=.999,LL=.9999,RL=.99,zL=/[\\\/_+.#"@\[\(\{&]/,BL=/[\\\/_+.#"@\[\(\{&]/g,VL=/[\s-]/,HL=/[\s-]/g;function UL(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?jL:RL;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=UL(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=jL:zL.test(e.charAt(l-1))?(d*=NL,p=e.slice(i,l-1).match(BL),p&&i>0&&(d*=IL**+p.length)):VL.test(e.charAt(l-1))?(d*=ML,m=e.slice(i,l-1).match(HL),m&&i>0&&(d*=IL**+m.length)):(d*=PL,i>0&&(d*=IL**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=LL)),(d<FL&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=UL(e,t,n,r,l+1,a+2,o),f*FL>d&&(d=f*FL)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function WL(e){return e.toLowerCase().replace(HL,` `)}function GL(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,UL(e,t,WL(e),WL(t),0,0,{})}var KL=`[cmdk-group=""]`,qL=`[cmdk-group-items=""]`,JL=`[cmdk-group-heading=""]`,YL=`[cmdk-item=""]`,XL=`${YL}:not([aria-disabled="true"])`,ZL=`cmdk-item-select`,QL=`data-value`,$L=(e,t,n)=>GL(e,t,n),eR=B.createContext(void 0),tR=()=>B.useContext(eR),nR=B.createContext(void 0),rR=()=>B.useContext(nR),iR=B.createContext(void 0),aR=B.forwardRef((e,t)=>{let n=yR(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=yR(()=>new Set),i=yR(()=>new Map),a=yR(()=>new Map),o=yR(()=>new Set),s=_R(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=xx(),y=xx(),b=xx(),x=B.useRef(null),S=SR();vR(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,C.emit()}},[u]),vR(()=>{S(6,k)},[]);let C=B.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)O(),E(),S(1,D);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(b);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(S(7,()=>{n.current.selectedItemId=A()?.id,C.emit()}),r||S(5,k),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}C.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),w=B.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,T(t,r)),S(2,()=>{E(),C.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),S(3,()=>{O(),E(),n.current.value||D(),C.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=A();S(4,()=>{O(),t?.getAttribute(`id`)===e&&D(),C.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:v,inputId:b,labelId:y,listInnerRef:x}),[]);function T(e,t){let r=s.current?.filter??$L;return e?r(e,n.current.search,t):0}function E(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=x.current;ee().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(qL);t?t.appendChild(e.parentElement===t?e:e.closest(`${qL} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${qL} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=x.current?.querySelector(`${KL}[${QL}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function D(){let e=ee().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(QL);C.setState(`value`,e||void 0)}function O(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=T(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function k(){var e;let t=A();t&&(t.parentElement?.firstChild===t&&((e=t.closest(KL)?.querySelector(JL))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function A(){return x.current?.querySelector(`${YL}[aria-selected="true"]`)}function ee(){return Array.from(x.current?.querySelectorAll(XL)||[])}function j(e){let t=ee()[e];t&&C.setState(`value`,t.getAttribute(QL))}function M(e){var t;let n=A(),r=ee(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&C.setState(`value`,a.getAttribute(QL))}function te(e){let t=A()?.closest(KL),n;for(;t&&!n;)t=e>0?hR(t,KL):gR(t,KL),n=t?.querySelector(XL);n?C.setState(`value`,n.getAttribute(QL)):M(e)}let N=()=>j(ee().length-1),P=e=>{e.preventDefault(),e.metaKey?N():e.altKey?te(1):M(1)},ne=e=>{e.preventDefault(),e.metaKey?j(0):e.altKey?te(-1):M(-1)};return B.createElement(ib.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&P(e);break;case`ArrowDown`:P(e);break;case`p`:case`k`:g&&e.ctrlKey&&ne(e);break;case`ArrowUp`:ne(e);break;case`Home`:e.preventDefault(),j(0);break;case`End`:e.preventDefault(),N();break;case`Enter`:{e.preventDefault();let t=A();if(t){let e=new Event(ZL);t.dispatchEvent(e)}}}}},B.createElement(`label`,{"cmdk-label":``,htmlFor:w.inputId,id:w.labelId,style:TR},c),wR(e,e=>B.createElement(nR.Provider,{value:C},B.createElement(eR.Provider,{value:w},e))))}),oR=B.forwardRef((e,t)=>{let n=xx(),r=B.useRef(null),i=B.useContext(iR),a=tR(),o=_R(e),s=o.current?.forceMount??i?.forceMount;vR(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=xR(n,r,[e.value,e.children,r],e.keywords),l=rR(),u=bR(e=>e.value&&e.value===c.current),d=bR(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);B.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(ZL,f),()=>t.removeEventListener(ZL,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:_,keywords:v,...y}=e;return B.createElement(ib.div,{ref:hy(r,t),...y,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),sR=B.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=xx(),s=B.useRef(null),c=B.useRef(null),l=xx(),u=tR(),d=bR(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));vR(()=>u.group(o),[]),xR(o,s,[e.value,e.heading,c]);let f=B.useMemo(()=>({id:o,forceMount:i}),[i]);return B.createElement(ib.div,{ref:hy(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&B.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),wR(e,e=>B.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},B.createElement(iR.Provider,{value:f},e))))}),cR=B.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=B.useRef(null),a=bR(e=>!e.search);return!n&&!a?null:B.createElement(ib.div,{ref:hy(i,t),...r,"cmdk-separator":``,role:`separator`})}),lR=B.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=rR(),o=bR(e=>e.search),s=bR(e=>e.selectedItemId),c=tR();return B.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),B.createElement(ib.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),uR=B.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=B.useRef(null),o=B.useRef(null),s=bR(e=>e.selectedItemId),c=tR();return B.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),B.createElement(ib.div,{ref:hy(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},wR(e,e=>B.createElement(`div`,{ref:hy(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),dR=B.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return B.createElement(nj,{open:n,onOpenChange:r},B.createElement(oj,{container:o},B.createElement(cj,{"cmdk-overlay":``,className:i}),B.createElement(fj,{"aria-label":e.label,"cmdk-dialog":``,className:a},B.createElement(aR,{ref:t,...s}))))}),fR=B.forwardRef((e,t)=>bR(e=>e.filtered.count===0)?B.createElement(ib.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),pR=B.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return B.createElement(ib.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},wR(e,e=>B.createElement(`div`,{"aria-hidden":!0},e)))}),mR=Object.assign(aR,{List:uR,Item:oR,Input:lR,Group:sR,Separator:cR,Dialog:dR,Empty:fR,Loading:pR});function hR(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function gR(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function _R(e){let t=B.useRef(e);return vR(()=>{t.current=e}),t}var vR=typeof window>`u`?B.useEffect:B.useLayoutEffect;function yR(e){let t=B.useRef();return t.current===void 0&&(t.current=e()),t}function bR(e){let t=rR(),n=()=>e(t.snapshot());return B.useSyncExternalStore(t.subscribe,n,n)}function xR(e,t,n,r=[]){let i=B.useRef(),a=tR();return vR(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(QL,s),i.current=s}),i}var SR=()=>{let[e,t]=B.useState(),n=yR(()=>new Map);return vR(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function CR(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function wR({asChild:e,children:t},n){return e&&B.isValidElement(t)?B.cloneElement(CR(t),{ref:t.ref},n(t.props.children)):n(t)}var TR={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},ER=[{label:`工作区`,items:[{to:`/`,label:`概览`,icon:ir},{to:`/plugins`,label:`插件`,icon:Wr},{to:`/commands`,label:`命令`,icon:Mi},{to:`/groups`,label:`群组`,icon:Qi},{to:`/bots`,label:`机器人`,icon:Gt},{to:`/adapters`,label:`适配器`,icon:Yt},{to:`/playground`,label:`调试台`,icon:Hn}]},{label:`运维`,items:[{to:`/tasks`,label:`任务中心`,icon:or},{to:`/logs`,label:`日志`,icon:ci},{to:`/acl`,label:`访问控制`,icon:bi},{to:`/settings`,label:`设置`,icon:gi}]}],DR=[{to:`/history`,label:`消息记录`,icon:br,plugin:`history`,group:`运维`}],OR={"app-window":Ct,"bar-chart":$t,calendar:Zt,coins:vn,gamepad:Wn,gift:Kn,image:Qn,"list-checks":or,music:Mn,sparkles:Ai,star:Pi,trophy:Ki,users:Qi,wrench:na};function kR(e){return`/pages/${encodeURIComponent(e)}`}function AR(e){return e.filter(e=>e.page&&e.state===`active`).map(e=>({to:kR(e.name),label:e.page?.title??e.name,icon:OR[e.page?.icon??``]??Ct}))}function jR(){let e=xP(),t=e!==null,n=(0,B.useRef)(null),r=(0,B.useRef)(null),i=Tj(),{setPreference:a}=_P(),o=Z({queryKey:[`plugins`],queryFn:$.plugins,enabled:t}),s=Z({queryKey:[`commands`],queryFn:$.commands,enabled:t}),c=XM({mutationFn:e=>$.pluginAction(e,`reload`),onSuccess:e=>{vN.success(`已重载 ${e.name}`),i.invalidateQueries({queryKey:[`plugins`]})}}),l=()=>vP.set(null),u=e=>{l(),e()};return(0,V.jsx)(nj,{open:t,onOpenChange:l,children:(0,V.jsx)(Tg,{children:t&&(0,V.jsxs)(oj,{forceMount:!0,children:[(0,V.jsx)(cj,{asChild:!0,forceMount:!0,children:(0,V.jsx)(K.div,{className:`fixed inset-0 z-40 bg-overlay backdrop-blur-[3px]`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.18}})}),(0,V.jsx)(`div`,{className:`pointer-events-none fixed inset-0 z-50 flex justify-center px-4 pt-[14dvh] pb-4`,children:(0,V.jsx)(fj,{asChild:!0,forceMount:!0,"aria-describedby":void 0,onOpenAutoFocus:t=>{t.preventDefault(),r.current=e?.restoreFocus??null,n.current?.focus({preventScroll:!0})},onCloseAutoFocus:e=>{e.preventDefault(),vP.get()||(r.current?.(),r.current=null)},children:(0,V.jsxs)(K.div,{initial:{opacity:0,scale:.97,y:-8},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,y:-4},transition:Dv,className:`pointer-events-auto flex h-fit max-h-full w-full max-w-[580px] flex-col overflow-hidden rounded-2xl border border-border bg-surface shadow-pop outline-none`,children:[(0,V.jsx)(gj,{className:`sr-only`,children:`命令面板`}),(0,V.jsxs)(mR,{loop:!0,className:`flex min-h-0 flex-col [&_[cmdk-group-heading]]:px-3 [&_[cmdk-group-heading]]:pt-3 [&_[cmdk-group-heading]]:pb-1.5 [&_[cmdk-group-heading]]:text-[11px] [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-fg-3`,children:[(0,V.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2.5 border-b border-border px-4`,children:[(0,V.jsx)(ui,{className:`size-4 text-fg-3`}),(0,V.jsx)(mR.Input,{ref:n,placeholder:`输入页面、插件或命令…`,className:`h-13 min-w-0 flex-1 bg-transparent text-[14.5px] text-fg outline-none placeholder:text-fg-3`}),(0,V.jsx)(Lv,{children:`Esc`})]}),(0,V.jsxs)(mR.List,{className:`min-h-0 max-h-[min(420px,60dvh)] overflow-y-auto overscroll-contain p-1.5 [&_[cmdk-list-sizer]]:transition-[height]`,children:[(0,V.jsx)(mR.Empty,{className:`py-10 text-center text-[13px] text-fg-3`,children:`没有匹配的结果`}),(0,V.jsx)(mR.Group,{heading:`跳转`,children:ER.flatMap(e=>e.items.map(e=>(0,V.jsx)(MR,{value:`page ${e.label} ${e.to}`,icon:(0,V.jsx)(e.icon,{className:`size-4`}),onSelect:()=>u(()=>sP(e.to)),children:e.label},e.to)))}),s.data&&s.data.length>0&&(0,V.jsx)(mR.Group,{heading:`在调试台中试用命令`,children:s.data.filter(e=>!e.hidden).map(e=>(0,V.jsxs)(MR,{value:`command ${e.path} ${e.aliases.join(` `)} ${e.description}`,icon:(0,V.jsx)(Hn,{className:`size-4`}),hint:e.owner,onSelect:()=>u(()=>{bP.set(`/${e.path} `),sP(`/playground`)}),children:[(0,V.jsx)(`span`,{className:`font-mono text-[12.5px]`,children:e.usage}),e.description&&(0,V.jsx)(`span`,{className:`ml-2 text-fg-3`,children:e.description})]},`${e.owner}:${e.path}`))}),o.data&&o.data.length>0&&(0,V.jsx)(mR.Group,{heading:`重载插件`,children:o.data.map(e=>(0,V.jsxs)(MR,{value:`reload ${e.name} ${e.description??``}`,icon:(0,V.jsx)(ei,{className:`size-4`}),onSelect:()=>u(()=>c.mutate(e.name)),children:[`重载 `,e.name]},e.name))}),(0,V.jsxs)(mR.Group,{heading:`偏好`,children:[(0,V.jsx)(MR,{value:`theme light 浅色`,icon:(0,V.jsx)(Ri,{className:`size-4`}),onSelect:()=>u(()=>a(`light`)),children:`切换到浅色主题`}),(0,V.jsx)(MR,{value:`theme dark 深色`,icon:(0,V.jsx)(Or,{className:`size-4`}),onSelect:()=>u(()=>a(`dark`)),children:`切换到深色主题`}),(0,V.jsx)(MR,{value:`theme system 跟随系统`,icon:(0,V.jsx)(Er,{className:`size-4`}),onSelect:()=>u(()=>a(`system`)),children:`主题跟随系统`}),(0,V.jsx)(MR,{value:`logout 退出登录`,icon:(0,V.jsx)(mr,{className:`size-4`}),onSelect:()=>u(()=>{$.logout().finally(()=>{dP(i,!1)})}),children:`退出登录`})]})]}),(0,V.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 border-t border-border bg-surface-2/60 px-4 py-2 text-[11.5px] text-fg-3`,children:[(0,V.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(Lv,{children:`↑`}),(0,V.jsx)(Lv,{children:`↓`}),`选择`]}),(0,V.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(Lv,{children:(0,V.jsx)(wn,{className:`size-3`})}),`执行`]})]})]})]})})})]})})})}function MR({value:e,icon:t,hint:n,onSelect:r,children:i}){return(0,V.jsxs)(mR.Item,{value:e,onSelect:r,className:`group flex h-10 cursor-pointer items-center gap-3 rounded-[10px] px-3 text-[13.5px] text-fg-2 select-none data-[selected=true]:bg-surface-2 data-[selected=true]:text-fg`,children:[(0,V.jsx)(`span`,{className:`text-fg-3 group-data-[selected=true]:text-accent`,children:t}),(0,V.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:i}),n&&(0,V.jsx)(`span`,{className:`text-[11.5px] text-fg-3`,children:n})]})}var NR={"/":iI,"/plugins":iL,"/commands":kF,"/groups":FF,"/history":YF,"/bots":uF,"/adapters":vF,"/playground":gI,"/logs":eI,"/acl":OP,"/settings":SL,"/tasks":OL};function PR(e){let t=NR[e];return t?{key:e,Page:t}:e.startsWith(`/bots/`)?{key:`/bots`,Page:uF}:e.startsWith(`/adapters/`)?{key:`/adapters`,Page:vF}:e.startsWith(`/plugin/`)?{key:`/plugins`,Page:sL}:e.startsWith(`/groups/`)?{key:`/groups`,Page:FF}:e.startsWith(`/tasks/`)?{key:`/tasks`,Page:OL}:e.startsWith(`/pages/`)?{key:e,pluginPage:!0}:{key:e,Page:rI}}function FR(){let e=Z({queryKey:[`plugins`],queryFn:$.plugins}),t=new Set((e.data??[]).filter(e=>e.state===`active`).map(e=>e.name)),n=AR(e.data??[]);return[...ER.map(e=>({...e,items:[...e.items,...DR.filter(n=>n.group===e.label&&t.has(n.plugin))]})),...n.length>0?[{label:`插件页面`,items:n}]:[]]}function IR(){let e=cP(),[t,n]=(0,B.useState)(!1),r=FR(),i=PR(e),{key:a}=i,o=`pluginPage`in i,s=r.flatMap(e=>e.items).find(e=>e.to===a);return(0,B.useEffect)(()=>{let e=e=>{!e.metaKey&&!e.ctrlKey||e.altKey||e.shiftKey||e.isComposing||e.key.toLowerCase()!==`k`||(e.preventDefault(),e.repeat||(vP.get()?vP.set(null):yP()))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,B.useEffect)(()=>{document.title=s?`${s.label} · AsaBot`:`AsaBot 控制台`},[s]),(0,V.jsxs)(`div`,{className:`relative flex h-full`,children:[(0,V.jsx)(`div`,{className:`pointer-events-none fixed inset-x-0 top-0 h-[420px] bg-[radial-gradient(ellipse_70%_60%_at_60%_-10%,var(--bg-glow),transparent_70%)]`}),(0,V.jsx)(`aside`,{className:`relative z-10 hidden w-[236px] shrink-0 lg:block`,children:(0,V.jsx)(LR,{path:a,groups:r})}),(0,V.jsx)(Tg,{children:t&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(K.div,{className:`fixed inset-0 z-40 bg-overlay backdrop-blur-[2px] lg:hidden`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>n(!1)}),(0,V.jsx)(K.aside,{className:`fixed inset-y-0 left-0 z-50 w-[260px] border-r border-border bg-bg lg:hidden`,initial:{x:-280},animate:{x:0},exit:{x:-280},transition:q,children:(0,V.jsx)(LR,{path:a,groups:r,onNavigate:()=>n(!1)})})]})}),(0,V.jsxs)(`div`,{className:`relative z-0 flex min-w-0 flex-1 flex-col`,children:[(0,V.jsxs)(`header`,{className:`flex h-14 shrink-0 items-center gap-3 px-4 lg:hidden`,children:[(0,V.jsx)(X,{variant:`ghost`,size:`icon`,"aria-label":`打开导航`,onClick:()=>n(!0),children:(0,V.jsx)(gr,{className:`size-4.5`})}),(0,V.jsx)(Qv,{className:`size-6`}),(0,V.jsx)(`span`,{className:`font-semibold tracking-tight`,children:`AsaBot`})]}),(0,V.jsx)(`main`,{className:z(`min-h-0 flex-1`,o?`overflow-clip`:`overflow-y-auto [scrollbar-gutter:stable]`),children:(0,V.jsx)(Tg,{mode:`wait`,initial:!1,children:(0,V.jsx)(K.div,{initial:{opacity:0,y:10,filter:`blur(3px)`},animate:{opacity:1,y:0,filter:`blur(0px)`},exit:{opacity:0,y:-6,filter:`blur(2px)`,transition:{duration:.12}},transition:q,className:z(`mx-auto w-full max-w-[1180px] px-5 lg:px-10`,o?`flex h-full min-h-0 flex-col py-4 lg:py-5`:`py-7 lg:py-9`),children:o?(0,V.jsx)(DI,{path:a}):(0,V.jsx)(i.Page,{})},a)})})]}),(0,V.jsx)(jR,{}),(0,V.jsx)(YI,{})]})}function LR({path:e,groups:t,onNavigate:n}){let r=Z({queryKey:[`overview`],queryFn:$.overview});return(0,V.jsxs)(`div`,{className:`flex h-full flex-col px-3 pt-4 pb-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2.5 px-2 pb-5`,children:[(0,V.jsx)(Qv,{}),(0,V.jsxs)(`div`,{className:`leading-tight`,children:[(0,V.jsx)(`div`,{className:`text-[14.5px] font-semibold tracking-[-0.02em]`,children:`AsaBot`}),(0,V.jsx)(`div`,{className:`text-[11.5px] text-fg-3`,children:r.data?`v${r.data.version}`:`控制台`})]})]}),(0,V.jsxs)(`button`,{type:`button`,onClick:()=>yP(),className:`group mb-5 flex h-9 cursor-pointer items-center gap-2 rounded-[10px] border border-border bg-surface px-2.5 text-[13px] text-fg-3 shadow-card transition-colors hover:border-border-strong hover:text-fg-2`,children:[(0,V.jsx)(ui,{className:`size-3.5`}),(0,V.jsx)(`span`,{className:`flex-1 text-left`,children:`搜索或跳转…`}),(0,V.jsx)(Lv,{children:navigator.platform.includes(`Mac`)?`⌘`:`Ctrl`}),(0,V.jsx)(Lv,{children:`K`})]}),(0,V.jsx)(`nav`,{className:`flex-1 space-y-5 overflow-y-auto`,children:t.map(t=>(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`mb-1 px-2.5 text-[11px] font-medium tracking-wide text-fg-3`,children:t.label}),(0,V.jsx)(`ul`,{className:`space-y-0.5`,children:t.items.map(t=>(0,V.jsx)(`li`,{children:(0,V.jsx)(RR,{item:t,active:t.to===e,onNavigate:n})},t.to))})]},t.label))}),(0,V.jsxs)(`div`,{className:`space-y-2 border-t border-border pt-3`,children:[(0,V.jsx)(zR,{}),(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-1`,children:[(0,V.jsx)(BR,{}),(0,V.jsx)(VR,{})]})]})]})}function RR({item:e,active:t,onNavigate:n}){let r=e.icon;return(0,V.jsxs)(lP,{to:e.to,onClick:n,className:z(`relative flex h-8 items-center gap-2.5 rounded-lg px-2.5 text-[13.5px] font-medium transition-colors duration-150`,t?`text-fg`:`text-fg-2 hover:bg-surface-2/70 hover:text-fg`),children:[t&&(0,V.jsx)(K.span,{layoutId:`nav-active`,transition:Dv,className:`absolute inset-0 rounded-lg border border-border bg-surface shadow-card`}),(0,V.jsx)(r,{className:z(`relative size-4 transition-colors`,t?`text-accent`:`text-fg-3`)}),(0,V.jsx)(`span`,{className:`relative`,children:e.label})]})}function zR(){let e=$N();return(0,V.jsxs)(`div`,{className:`flex h-8 items-center gap-2 rounded-lg px-2.5 text-[12.5px] text-fg-3`,children:[(0,V.jsx)(Iv,{tone:e===`open`?`success`:e===`connecting`?`warning`:`danger`,pulse:e===`open`}),(0,V.jsx)(Tg,{mode:`wait`,initial:!1,children:(0,V.jsx)(K.span,{initial:{opacity:0,y:3},animate:{opacity:1,y:0},exit:{opacity:0,y:-3},transition:{duration:.15},children:{open:`实时连接正常`,connecting:`正在连接…`,closed:`连接已断开,重试中`}[e]},e)})]})}function BR(){let{preference:e,setPreference:t}=_P();return(0,V.jsx)(`fieldset`,{"aria-label":`主题`,className:`m-0 inline-flex h-8 min-w-0 items-center rounded-lg border border-border bg-surface-2 p-0.5`,children:[{value:`light`,icon:(0,V.jsx)(Ri,{className:`size-3.5`}),label:`浅色`},{value:`system`,icon:(0,V.jsx)(Er,{className:`size-3.5`}),label:`跟随系统`},{value:`dark`,icon:(0,V.jsx)(Or,{className:`size-3.5`}),label:`深色`}].map(n=>(0,V.jsx)(xO,{content:n.label,children:(0,V.jsxs)(`button`,{type:`button`,"aria-pressed":e===n.value,"aria-label":n.label,onClick:()=>t(n.value),className:z(`relative flex h-full w-7 cursor-pointer items-center justify-center rounded-md transition-colors`,e===n.value?`text-fg`:`text-fg-3 hover:text-fg-2`),children:[e===n.value&&(0,V.jsx)(K.span,{layoutId:`theme-active`,transition:Dv,className:`absolute inset-0 rounded-md border border-border bg-surface shadow-card`}),(0,V.jsx)(`span`,{className:`relative`,children:n.icon})]})},n.value))})}function VR(){let e=Tj(),t=XM({mutationFn:$.logout,onSettled:()=>{dP(e,!1)}});return(0,V.jsx)(xO,{content:`退出登录`,children:(0,V.jsx)(X,{variant:`ghost`,size:`icon`,"aria-label":`退出登录`,loading:t.isPending,onClick:()=>t.mutate(),children:(0,V.jsx)(mr,{className:`size-4`})})})}function HR({onSuccess:e}){let[t,n]=(0,B.useState)(``),[r,i]=(0,B.useState)(null),a=Ev(),o=XM({mutationFn:$.login,meta:{silent:!0},onSuccess:e,onError:e=>{i(e instanceof PN&&e.status===401?`密码不正确`:e instanceof PN&&e.status===429?`尝试次数过多,请稍后再试`:e.message),a.start({x:[0,-8,7,-5,3,0],transition:{duration:.42}})}}),s=e=>{e.preventDefault(),t&&(i(null),o.mutate(t))};return(0,V.jsxs)(K.div,{className:`relative flex h-full items-center justify-center overflow-hidden px-4`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.2}},children:[(0,V.jsx)(UR,{}),(0,V.jsxs)(K.div,{className:`relative w-full max-w-[380px]`,initial:{opacity:0,y:16,scale:.98},animate:{opacity:1,y:0,scale:1},transition:{...q,delay:.05},children:[(0,V.jsxs)(`div`,{className:`mb-8 flex flex-col items-center text-center`,children:[(0,V.jsx)(K.div,{initial:{scale:.6,rotate:-12,opacity:0},animate:{scale:1,rotate:0,opacity:1},transition:{...Dv,delay:.12},className:`mb-5 rounded-[14px] shadow-[0_8px_24px_-6px_rgb(109_94_245/0.5)]`,children:(0,V.jsx)(Qv,{className:`size-12`})}),(0,V.jsx)(`h1`,{className:`text-[22px] font-semibold tracking-[-0.03em]`,children:`欢迎回到 AsaBot`}),(0,V.jsx)(`p`,{className:`mt-1.5 text-[13.5px] text-fg-3`,children:`输入面板密码以继续`})]}),(0,V.jsxs)(K.form,{animate:a,onSubmit:s,className:`card space-y-4 p-6`,children:[(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(`label`,{htmlFor:`password`,className:`text-[12.5px] font-medium text-fg-2`,children:`面板密码`}),(0,V.jsx)(FO,{id:`password`,type:`password`,autoFocus:!0,autoComplete:`current-password`,icon:(0,V.jsx)(nr,{}),placeholder:`server.panelPassword`,value:t,"aria-invalid":r!==null,onChange:e=>{n(e.target.value),i(null)}}),(0,V.jsx)(K.p,{initial:!1,animate:{height:r?`auto`:0,opacity:+!!r},transition:q,className:`overflow-hidden text-[12.5px] text-danger`,children:r??` `})]}),(0,V.jsxs)(X,{type:`submit`,variant:`primary`,size:`lg`,className:`w-full`,loading:o.isPending,disabled:!t,children:[`登录`,(0,V.jsx)(jt,{className:`size-4`})]})]}),(0,V.jsxs)(`p`,{className:`mt-6 text-center text-[12px] leading-relaxed text-fg-3`,children:[`密码来自配置文件中的 `,(0,V.jsx)(`code`,{className:`font-mono`,children:`server.panelPassword`})]})]})]})}function UR(){return(0,V.jsxs)(`div`,{className:`pointer-events-none absolute inset-0`,"aria-hidden":!0,children:[(0,V.jsx)(`div`,{className:`absolute inset-0 bg-[linear-gradient(to_right,var(--border)_1px,transparent_1px),linear-gradient(to_bottom,var(--border)_1px,transparent_1px)] bg-[size:44px_44px] opacity-50 [mask-image:radial-gradient(ellipse_55%_50%_at_50%_45%,black,transparent)]`}),(0,V.jsx)(K.div,{className:`absolute top-[12%] left-[18%] size-[420px] rounded-full bg-[#8b7ffa] opacity-[0.16] blur-[110px] dark:opacity-[0.14]`,animate:{x:[0,60,-20,0],y:[0,30,60,0]},transition:{duration:22,repeat:1/0,ease:`easeInOut`}}),(0,V.jsx)(K.div,{className:`absolute right-[14%] bottom-[10%] size-[380px] rounded-full bg-[#2bbd95] opacity-[0.12] blur-[110px] dark:opacity-[0.1]`,animate:{x:[0,-50,20,0],y:[0,-40,-10,0]},transition:{duration:26,repeat:1/0,ease:`easeInOut`}}),(0,V.jsx)(K.div,{className:`absolute top-[40%] right-[30%] size-[260px] rounded-full bg-[#f2a5c8] opacity-[0.1] blur-[100px] dark:opacity-[0.07]`,animate:{x:[0,40,-30,0],y:[0,-30,20,0]},transition:{duration:30,repeat:1/0,ease:`easeInOut`}})]})}var WR=[{title:`验证设置码`,description:`确认你能访问运行 AsaBot 的机器`},{title:`设置面板密码`,description:`之后用它登录面板,再到机器人页面添加连接`}];function GR(e){let t=e.toUpperCase().replace(/[^A-Z0-9]/g,``).slice(0,8);return t.length>4?`${t.slice(0,4)}-${t.slice(4)}`:t}function KR(){let e=Tj(),[t,n]=(0,B.useState)(0),[r,i]=(0,B.useState)(1),[a,o]=(0,B.useState)(``),[s,c]=(0,B.useState)(``),[l,u]=(0,B.useState)(``),[d,f]=(0,B.useState)({}),p=Ev(),m=e=>{i(e>t?1:-1),n(e)},h=(e,n)=>{f(n),e!==t&&m(e),p.start({x:[0,-8,7,-5,3,0],transition:{duration:.42}})},g=XM({mutationFn:e=>$.setup(e),meta:{silent:!0},onSuccess:()=>{vN.success(`设置完成,欢迎使用 AsaBot`),dP(e,!0)},onError:e=>{if(e instanceof PN&&e.status===401)h(0,{code:`设置码不正确,请对照控制台输出`});else if(e instanceof PN&&e.status===429)h(0,{code:`尝试次数过多,请稍后再试`});else if(e instanceof PN&&e.issues.length>0){let t=e.issues[0];h(+!!t.path.startsWith(`password`),{password:t.message})}else vN.error(e.message)}}),_=()=>t===0&&!/^[A-Z0-9]{4}-[A-Z0-9]{4}$/.test(a)?{code:`设置码是 8 位字符,形如 ABCD-EFGH`}:t===1&&s.length<8?{password:`至少 8 个字符`}:t===1&&s.includes("${")?{password:"密码不能包含 ${"}:t===1&&l!==s?{confirm:`两次输入的密码不一致`}:{},v=e=>{e.preventDefault();let n=_();if(Object.keys(n).length>0)return h(t,n);if(f({}),t<WR.length-1)return m(t+1);g.mutate({code:a,password:s,superusers:[]})},y=WR[t];return(0,V.jsxs)(K.div,{className:`relative flex h-full items-center justify-center overflow-hidden px-4`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.2}},children:[(0,V.jsx)(UR,{}),(0,V.jsxs)(K.div,{className:`relative w-full max-w-[440px]`,initial:{opacity:0,y:16,scale:.98},animate:{opacity:1,y:0,scale:1},transition:{...q,delay:.05},children:[(0,V.jsxs)(`div`,{className:`mb-7 flex flex-col items-center text-center`,children:[(0,V.jsx)(K.div,{initial:{scale:.6,rotate:-12,opacity:0},animate:{scale:1,rotate:0,opacity:1},transition:{...Dv,delay:.12},className:`mb-5 rounded-[14px] shadow-[0_8px_24px_-6px_rgb(109_94_245/0.5)]`,children:(0,V.jsx)(Qv,{className:`size-12`})}),(0,V.jsx)(`h1`,{className:`text-[22px] font-semibold tracking-[-0.03em]`,children:`初始化 AsaBot`}),(0,V.jsx)(`p`,{className:`mt-1.5 text-[13.5px] text-fg-3`,children:`只需几步,完成后进入管理面板`})]}),(0,V.jsxs)(K.form,{animate:p,onSubmit:v,className:`card overflow-hidden`,children:[(0,V.jsx)(`div`,{className:`flex gap-1.5 px-6 pt-5`,children:WR.map((e,n)=>(0,V.jsx)(`div`,{className:`h-1 flex-1 overflow-hidden rounded-full bg-surface-3`,children:(0,V.jsx)(K.div,{className:`h-full rounded-full bg-accent`,initial:!1,animate:{width:n<=t?`100%`:`0%`},transition:q})},e.title))}),(0,V.jsxs)(`div`,{className:`px-6 pt-5`,children:[(0,V.jsxs)(`p`,{className:`text-[11.5px] font-medium text-fg-3 tabular`,children:[`第 `,t+1,` 步,共 `,WR.length,` 步`]}),(0,V.jsx)(`h2`,{className:`mt-1 text-[16px] font-semibold tracking-[-0.015em]`,children:y.title}),(0,V.jsx)(`p`,{className:`mt-0.5 text-[12.5px] text-fg-3`,children:y.description})]}),(0,V.jsx)(`div`,{className:`relative min-h-[196px] px-6 pt-5 pb-2`,children:(0,V.jsx)(Tg,{mode:`wait`,initial:!1,custom:r,children:(0,V.jsxs)(K.div,{custom:r,initial:{opacity:0,x:r*24},animate:{opacity:1,x:0},exit:{opacity:0,x:r*-24},transition:{...q,opacity:{duration:.15}},className:`space-y-4`,children:[t===0&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(qR,{icon:(0,V.jsx)(Bi,{}),children:[`设置码在 AsaBot 启动时打印在控制台。Docker 部署可以用`,` `,(0,V.jsx)(`code`,{className:`font-mono text-[12px]`,children:`docker compose logs asabot`}),` 查看。`]}),(0,V.jsx)(LO,{label:`设置码`,error:d.code,htmlFor:`setup-code`,children:(0,V.jsx)(FO,{id:`setup-code`,autoFocus:!0,autoComplete:`off`,icon:(0,V.jsx)(nr,{}),placeholder:`ABCD-EFGH`,value:a,"aria-invalid":!!d.code,onChange:e=>{o(GR(e.target.value)),f({})},className:`font-mono tracking-[0.12em]`})})]}),t===1&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(LO,{label:`面板密码`,error:d.password,hint:`至少 8 个字符`,htmlFor:`setup-password`,children:(0,V.jsx)(FO,{id:`setup-password`,type:`password`,autoFocus:!0,autoComplete:`new-password`,icon:(0,V.jsx)(ur,{}),value:s,"aria-invalid":!!d.password,onChange:e=>{c(e.target.value),f({})}})}),(0,V.jsx)(LO,{label:`确认密码`,error:d.confirm,htmlFor:`setup-confirm`,children:(0,V.jsx)(FO,{id:`setup-confirm`,type:`password`,autoComplete:`new-password`,icon:(0,V.jsx)(ur,{}),value:l,"aria-invalid":!!d.confirm,onChange:e=>{u(e.target.value),f({})}})})]})]},t)})}),(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-t border-border px-6 py-4`,children:[(0,V.jsxs)(X,{type:`button`,variant:`ghost`,onClick:()=>m(t-1),className:z(t===0&&`invisible`),children:[(0,V.jsx)(kt,{className:`size-4`}),`上一步`]}),(0,V.jsx)(X,{type:`submit`,variant:`primary`,loading:g.isPending,children:t===WR.length-1?(0,V.jsxs)(V.Fragment,{children:[`完成设置`,(0,V.jsx)(tn,{className:`size-4`})]}):(0,V.jsxs)(V.Fragment,{children:[`下一步`,(0,V.jsx)(jt,{className:`size-4`})]})})]})]})]})]})}function qR({icon:e,children:t}){return(0,V.jsxs)(`div`,{className:`flex gap-2.5 rounded-xl bg-surface-2 px-3.5 py-3 text-[12.5px] leading-relaxed text-fg-2 [&>svg]:mt-0.5 [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-fg-3`,children:[e,(0,V.jsx)(`p`,{children:t})]})}function JR(){let e=Tj(),t=Z({queryKey:[`session`],queryFn:$.session,staleTime:1/0});(0,B.useEffect)(()=>{IN(()=>{e.setQueryData([`session`],{authenticated:!1})})},[e]);let n=t.isPending?`splash`:t.error?`error`:t.data?.authenticated?`app`:t.data?.setup?`setup`:`login`;return(0,V.jsxs)(Tg,{mode:`wait`,children:[n===`splash`&&(0,V.jsx)(K.div,{className:`flex h-full items-center justify-center`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:(0,V.jsx)(K.div,{animate:{scale:[1,1.06,1]},transition:{duration:1.6,repeat:1/0},children:(0,V.jsx)(Qv,{className:`size-10`})})},`splash`),n===`error`&&(0,V.jsx)(YR,{error:t.error,onRetry:()=>void t.refetch()},`error`),n===`setup`&&(0,V.jsx)(KR,{},`setup`),n===`login`&&(0,V.jsx)(HR,{onSuccess:()=>{dP(e,!0)}},`login`),n===`app`&&(0,V.jsx)(K.div,{className:`h-full`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:q,children:(0,V.jsx)(JN,{children:(0,V.jsx)(IR,{})})},`app`)]})}function YR({error:e,onRetry:t}){let n=e instanceof PN&&e.status===404;return(0,V.jsx)(K.div,{className:`flex h-full items-center justify-center p-6`,initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0},transition:q,children:(0,V.jsxs)(`div`,{className:`card max-w-md p-8 text-center`,children:[(0,V.jsx)(Qv,{className:`mx-auto mb-5 size-10`}),(0,V.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight`,children:n?`面板未启用`:`无法连接到 AsaBot`}),(0,V.jsx)(`p`,{className:`mt-2 text-[13.5px] leading-relaxed text-fg-3`,children:n?(0,V.jsxs)(V.Fragment,{children:[`在配置文件中设置`,` `,(0,V.jsx)(`code`,{className:`rounded bg-surface-2 px-1 font-mono text-[12.5px]`,children:`server.panelPassword`}),` `,`后重启 AsaBot。`]}):e?.message??`请确认 AsaBot 正在运行。`}),(0,V.jsx)(`button`,{type:`button`,onClick:t,className:`mt-6 cursor-pointer text-[13px] font-medium text-accent hover:underline`,children:`重试`})]})})}var XR=new LM({defaultOptions:{queries:{staleTime:15e3,refetchOnWindowFocus:!1,retry:(e,t)=>!(t instanceof PN&&t.status>0&&t.status<500)&&e<2}},mutationCache:new NM({onError:(e,t,n,r)=>{r.meta?.silent||vN.error(e instanceof Error?e.message:`操作失败`)}})});function ZR(){let{resolved:e}=_P();return(0,V.jsx)(NN,{theme:e,position:`top-right`,gap:10,toastOptions:{classNames:{toast:`!rounded-xl !border-border !bg-surface !text-fg !shadow-pop !font-sans !text-[13px]`,description:`!text-fg-3`}}})}var QR=document.getElementById(`root`);if(!QR)throw Error(`#root missing from index.html`);(0,tN.createRoot)(QR).render((0,V.jsx)(B.StrictMode,{children:(0,V.jsx)(gP,{children:(0,V.jsx)(Ej,{client:XR,children:(0,V.jsxs)(jO,{children:[(0,V.jsx)(JR,{}),(0,V.jsx)(ZR,{})]})})})}));export{z as C,l as D,s as E,at as S,o as T,Hi as _,XM as a,Sn as b,Sj as c,X as d,xO as f,zv as g,Vv as h,vN as i,LO as l,Bv as m,PN as n,Z as o,Pv as p,$ as r,Tj as s,FP as t,FO as u,Hr as v,d as w,H as x,nr as y};
|