@streamapp/stream 0.0.1
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 +24 -0
- package/bin/stream.mjs +89 -0
- package/package.json +34 -0
- package/resources/app/dist-panel/panel-boards.js +6 -0
- package/resources/app/dist-panel/panel-detail.css +1 -0
- package/resources/app/dist-panel/panel-detail.js +2141 -0
- package/resources/app/dist-panel/panel-manage.css +1 -0
- package/resources/app/dist-panel/panel-manage.js +2246 -0
- package/resources/app/dist-panel/panel-movie.css +1 -0
- package/resources/app/dist-panel/panel-movie.js +2268 -0
- package/resources/app/dist-panel/panel-research.css +1 -0
- package/resources/app/dist-panel/panel-research.js +316 -0
- package/resources/app/dist-panel/panel.css +1 -0
- package/resources/app/dist-panel/panel.js +463 -0
- package/resources/dsh-engine-lock/package-lock.json +9032 -0
- package/resources/extension/.output/chrome-mv3/assets/popup-C2NUZZQW.css +2 -0
- package/resources/extension/.output/chrome-mv3/background.js +1 -0
- package/resources/extension/.output/chrome-mv3/chunks/popup-BeBts9v2.js +50 -0
- package/resources/extension/.output/chrome-mv3/icon/128.png +0 -0
- package/resources/extension/.output/chrome-mv3/icon/16.png +0 -0
- package/resources/extension/.output/chrome-mv3/icon/32.png +0 -0
- package/resources/extension/.output/chrome-mv3/icon/48.png +0 -0
- package/resources/extension/.output/chrome-mv3/icon/96.png +0 -0
- package/resources/extension/.output/chrome-mv3/manifest.json +1 -0
- package/resources/extension/.output/chrome-mv3/popup.html +21 -0
- package/resources/packages/1lou/1lou-search.recipe.json +102 -0
- package/resources/packages/1lou/README.md +7 -0
- package/resources/packages/1lou/package.json +15 -0
- package/resources/packages/Douyin_TikTok_Download_API/README.md +23 -0
- package/resources/packages/Douyin_TikTok_Download_API/activate.ts +14 -0
- package/resources/packages/Douyin_TikTok_Download_API/adapter/adapter.ts +321 -0
- package/resources/packages/Douyin_TikTok_Download_API/adapter/danmaku.ts +21 -0
- package/resources/packages/Douyin_TikTok_Download_API/adapter/executor.ts +75 -0
- package/resources/packages/Douyin_TikTok_Download_API/adapter/normalize.ts +20 -0
- package/resources/packages/Douyin_TikTok_Download_API/manifests.yaml +521 -0
- package/resources/packages/Douyin_TikTok_Download_API/package.json +32 -0
- package/resources/packages/alist/README.md +14 -0
- package/resources/packages/alist/activate.ts +12 -0
- package/resources/packages/alist/adapter.ts +74 -0
- package/resources/packages/alist/manifests.yaml +76 -0
- package/resources/packages/alist/mounts.ts +120 -0
- package/resources/packages/alist/package.json +24 -0
- package/resources/packages/alist/presets.ts +53 -0
- package/resources/packages/alist/provision.ts +84 -0
- package/resources/packages/baidu/baidu-share.recipe.json +93 -0
- package/resources/packages/baidu/package.json +16 -0
- package/resources/packages/baidu-search/baidu-search.recipe.json +129 -0
- package/resources/packages/baidu-search/package.json +25 -0
- package/resources/packages/brave/brave-search.recipe.json +129 -0
- package/resources/packages/brave/package.json +25 -0
- package/resources/packages/browser/README.md +3 -0
- package/resources/packages/browser/adapter.ts +44 -0
- package/resources/packages/browser/manifests.yaml +20 -0
- package/resources/packages/browser/package.json +13 -0
- package/resources/packages/bt0/README.md +7 -0
- package/resources/packages/bt0/bt0-search.recipe.json +69 -0
- package/resources/packages/bt0/bt0-tlist.recipe.json +74 -0
- package/resources/packages/bt0/package.json +15 -0
- package/resources/packages/btbtla/README.md +6 -0
- package/resources/packages/btbtla/btbtla-detail.recipe.json +76 -0
- package/resources/packages/btbtla/btbtla-search.recipe.json +74 -0
- package/resources/packages/btbtla/package.json +15 -0
- package/resources/packages/builtin/README.md +8 -0
- package/resources/packages/builtin/manifests.yaml +487 -0
- package/resources/packages/builtin/package.json +14 -0
- package/resources/packages/douyin/README.md +39 -0
- package/resources/packages/douyin/douyin-collection.recipe.json +127 -0
- package/resources/packages/douyin/douyin-search.recipe.json +163 -0
- package/resources/packages/douyin/package.json +16 -0
- package/resources/packages/firecrawl/firecrawl-create-key.recipe.json +81 -0
- package/resources/packages/firecrawl/firecrawl-read-key.recipe.json +56 -0
- package/resources/packages/firecrawl/package.json +16 -0
- package/resources/packages/google/google-search.recipe.json +127 -0
- package/resources/packages/google/package.json +24 -0
- package/resources/packages/groq/groq-create-key.recipe.json +67 -0
- package/resources/packages/groq/package.json +16 -0
- package/resources/packages/huggingface/README.md +7 -0
- package/resources/packages/huggingface/huggingface-spaces.recipe.json +73 -0
- package/resources/packages/huggingface/package.json +15 -0
- package/resources/packages/imdb/imdb-chart.recipe.json +75 -0
- package/resources/packages/imdb/package.json +15 -0
- package/resources/packages/index.ts +15 -0
- package/resources/packages/iqiyi/README.md +10 -0
- package/resources/packages/iqiyi/iqiyi-cn-album.recipe.json +80 -0
- package/resources/packages/iqiyi/iqiyi-cn-search.recipe.json +71 -0
- package/resources/packages/iqiyi/package.json +15 -0
- package/resources/packages/lizhi/README.md +35 -0
- package/resources/packages/lizhi/lizhi-user.recipe.json +80 -0
- package/resources/packages/lizhi/package.json +15 -0
- package/resources/packages/manmanbuy/README.md +16 -0
- package/resources/packages/manmanbuy/manmanbuy-search.recipe.json +115 -0
- package/resources/packages/manmanbuy/package.json +15 -0
- package/resources/packages/mineru/README.md +38 -0
- package/resources/packages/mineru/package.json +28 -0
- package/resources/packages/pansou/README.md +14 -0
- package/resources/packages/pansou/activate.ts +11 -0
- package/resources/packages/pansou/adapter.ts +94 -0
- package/resources/packages/pansou/manifests.yaml +50 -0
- package/resources/packages/pansou/package.json +27 -0
- package/resources/packages/qq/package.json +15 -0
- package/resources/packages/qq/qq-send.recipe.json +104 -0
- package/resources/packages/quark/package.json +16 -0
- package/resources/packages/quark/quark-share.recipe.json +40 -0
- package/resources/packages/reddit/package.json +15 -0
- package/resources/packages/reddit/reddit-sub.recipe.json +77 -0
- package/resources/packages/replay/README.md +7 -0
- package/resources/packages/replay/package.json +13 -0
- package/resources/packages/rsshub/README.md +16 -0
- package/resources/packages/rsshub/manifests.yaml +107 -0
- package/resources/packages/rsshub/package.json +21 -0
- package/resources/packages/telegram/package.json +15 -0
- package/resources/packages/telegram/telegram-search.recipe.json +125 -0
- package/resources/packages/tencent/README.md +11 -0
- package/resources/packages/tencent/package.json +15 -0
- package/resources/packages/tencent/tencent-cn-episode.recipe.json +98 -0
- package/resources/packages/toubiec/README.md +38 -0
- package/resources/packages/toubiec/package.json +15 -0
- package/resources/packages/toubiec/toubiec-download.recipe.json +58 -0
- package/resources/packages/toubiec/toubiec-playlist.recipe.json +49 -0
- package/resources/packages/toubiec/toubiec-search.recipe.json +80 -0
- package/resources/packages/voiceprint/README.md +31 -0
- package/resources/packages/voiceprint/package.json +36 -0
- package/resources/packages/wikipedia/package.json +15 -0
- package/resources/packages/wikipedia/wikipedia-award-list.recipe.json +102 -0
- package/resources/packages/xhs/README.md +32 -0
- package/resources/packages/xhs/package.json +21 -0
- package/resources/packages/xhs/xhs-detail.recipe.json +129 -0
- package/resources/packages/xhs/xhs-home.recipe.json +144 -0
- package/resources/packages/xhs/xhs-like.recipe.json +96 -0
- package/resources/packages/xhs/xhs-search.recipe.json +138 -0
- package/resources/packages/xueqiu/README.md +9 -0
- package/resources/packages/xueqiu/package.json +16 -0
- package/resources/packages/xueqiu/xueqiu-detail.recipe.json +92 -0
- package/resources/packages/xueqiu/xueqiu-user.recipe.json +75 -0
- package/resources/packages/zhipu/package.json +16 -0
- package/resources/packages/zhipu/zhipu-create-key.recipe.json +74 -0
- package/resources/packages/zuna/README.md +31 -0
- package/resources/packages/zuna/package.json +15 -0
- package/resources/packages/zuna/zuna-album.recipe.json +46 -0
- package/resources/packages/zuna/zuna-download.recipe.json +53 -0
- package/resources/packages/zuna/zuna-playlist.recipe.json +46 -0
- package/resources/packages/zuna/zuna-search.recipe.json +96 -0
- package/resources/server.mjs +238876 -0
- package/resources/sidequest.jobs.js +1 -0
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
var __streamPanel=(function(Zt){"use strict";var hz=Zt=>{throw TypeError(Zt)};var mz=(Zt,rr,wr)=>rr.has(Zt)||hz("Cannot "+wr);var Fn=(Zt,rr,wr)=>(mz(Zt,rr,"read from private field"),wr?wr.call(Zt):rr.get(Zt)),pz=(Zt,rr,wr)=>rr.has(Zt)?hz("Cannot add the same private member more than once"):rr instanceof WeakSet?rr.add(Zt):rr.set(Zt,wr),uw=(Zt,rr,wr,Ao)=>(mz(Zt,rr,"write to private field"),Ao?Ao.call(Zt,wr):rr.set(Zt,wr),wr);var fn,Rr,zM;function rr(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function wr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ao={exports:{}},dc={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var dw;function xz(){if(dw)return dc;dw=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,o){var c=null;if(o!==void 0&&(c=""+o),i.key!==void 0&&(c=""+i.key),"key"in i){o={};for(var d in i)d!=="key"&&(o[d]=i[d])}else o=i;return i=o.ref,{$$typeof:e,type:r,key:c,ref:i!==void 0?i:null,props:o}}return dc.Fragment=t,dc.jsx=n,dc.jsxs=n,dc}var fw;function vz(){return fw||(fw=1,Ao.exports=xz()),Ao.exports}var l=vz(),lp={exports:{}},st={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var hw;function yz(){if(hw)return st;hw=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),v=Symbol.iterator;function S(P){return P===null||typeof P!="object"?null:(P=v&&P[v]||P["@@iterator"],typeof P=="function"?P:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,C={};function k(P,L,G){this.props=P,this.context=L,this.refs=C,this.updater=G||b}k.prototype.isReactComponent={},k.prototype.setState=function(P,L){if(typeof P!="object"&&typeof P!="function"&&P!=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,P,L,"setState")},k.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function N(){}N.prototype=k.prototype;function E(P,L,G){this.props=P,this.context=L,this.refs=C,this.updater=G||b}var R=E.prototype=new N;R.constructor=E,j(R,k.prototype),R.isPureReactComponent=!0;var A=Array.isArray;function _(){}var z={H:null,A:null,T:null,S:null},D=Object.prototype.hasOwnProperty;function V(P,L,G){var J=G.ref;return{$$typeof:e,type:P,key:L,ref:J!==void 0?J:null,props:G}}function I(P,L){return V(P.type,L,P.props)}function Q(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function B(P){var L={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(G){return L[G]})}var H=/\/+/g;function ee(P,L){return typeof P=="object"&&P!==null&&P.key!=null?B(""+P.key):L.toString(36)}function W(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(_,_):(P.status="pending",P.then(function(L){P.status==="pending"&&(P.status="fulfilled",P.value=L)},function(L){P.status==="pending"&&(P.status="rejected",P.reason=L)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function M(P,L,G,J,$){var se=typeof P;(se==="undefined"||se==="boolean")&&(P=null);var oe=!1;if(P===null)oe=!0;else switch(se){case"bigint":case"string":case"number":oe=!0;break;case"object":switch(P.$$typeof){case e:case t:oe=!0;break;case x:return oe=P._init,M(oe(P._payload),L,G,J,$)}}if(oe)return $=$(P),oe=J===""?"."+ee(P,0):J,A($)?(G="",oe!=null&&(G=oe.replace(H,"$&/")+"/"),M($,L,G,"",function(ve){return ve})):$!=null&&(Q($)&&($=I($,G+($.key==null||P&&P.key===$.key?"":(""+$.key).replace(H,"$&/")+"/")+oe)),L.push($)),1;oe=0;var ie=J===""?".":J+":";if(A(P))for(var Z=0;Z<P.length;Z++)J=P[Z],se=ie+ee(J,Z),oe+=M(J,L,G,se,$);else if(Z=S(P),typeof Z=="function")for(P=Z.call(P),Z=0;!(J=P.next()).done;)J=J.value,se=ie+ee(J,Z++),oe+=M(J,L,G,se,$);else if(se==="object"){if(typeof P.then=="function")return M(W(P),L,G,J,$);throw L=String(P),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.")}return oe}function U(P,L,G){if(P==null)return P;var J=[],$=0;return M(P,J,"","",function(se){return L.call(G,se,$++)}),J}function K(P){if(P._status===-1){var L=P._result;L=L(),L.then(function(G){(P._status===0||P._status===-1)&&(P._status=1,P._result=G)},function(G){(P._status===0||P._status===-1)&&(P._status=2,P._result=G)}),P._status===-1&&(P._status=0,P._result=L)}if(P._status===1)return P._result.default;throw P._result}var ne=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var L=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof P=="object"&&P!==null&&typeof P.message=="string"?String(P.message):String(P),error:P});if(!window.dispatchEvent(L))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},q={map:U,forEach:function(P,L,G){U(P,function(){L.apply(this,arguments)},G)},count:function(P){var L=0;return U(P,function(){L++}),L},toArray:function(P){return U(P,function(L){return L})||[]},only:function(P){if(!Q(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return st.Activity=g,st.Children=q,st.Component=k,st.Fragment=n,st.Profiler=i,st.PureComponent=E,st.StrictMode=r,st.Suspense=h,st.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,st.__COMPILER_RUNTIME={__proto__:null,c:function(P){return z.H.useMemoCache(P)}},st.cache=function(P){return function(){return P.apply(null,arguments)}},st.cacheSignal=function(){return null},st.cloneElement=function(P,L,G){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var J=j({},P.props),$=P.key;if(L!=null)for(se in L.key!==void 0&&($=""+L.key),L)!D.call(L,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&L.ref===void 0||(J[se]=L[se]);var se=arguments.length-2;if(se===1)J.children=G;else if(1<se){for(var oe=Array(se),ie=0;ie<se;ie++)oe[ie]=arguments[ie+2];J.children=oe}return V(P.type,$,J)},st.createContext=function(P){return P={$$typeof:c,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:o,_context:P},P},st.createElement=function(P,L,G){var J,$={},se=null;if(L!=null)for(J in L.key!==void 0&&(se=""+L.key),L)D.call(L,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&($[J]=L[J]);var oe=arguments.length-2;if(oe===1)$.children=G;else if(1<oe){for(var ie=Array(oe),Z=0;Z<oe;Z++)ie[Z]=arguments[Z+2];$.children=ie}if(P&&P.defaultProps)for(J in oe=P.defaultProps,oe)$[J]===void 0&&($[J]=oe[J]);return V(P,se,$)},st.createRef=function(){return{current:null}},st.forwardRef=function(P){return{$$typeof:d,render:P}},st.isValidElement=Q,st.lazy=function(P){return{$$typeof:x,_payload:{_status:-1,_result:P},_init:K}},st.memo=function(P,L){return{$$typeof:m,type:P,compare:L===void 0?null:L}},st.startTransition=function(P){var L=z.T,G={};z.T=G;try{var J=P(),$=z.S;$!==null&&$(G,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(_,ne)}catch(se){ne(se)}finally{L!==null&&G.types!==null&&(L.types=G.types),z.T=L}},st.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},st.use=function(P){return z.H.use(P)},st.useActionState=function(P,L,G){return z.H.useActionState(P,L,G)},st.useCallback=function(P,L){return z.H.useCallback(P,L)},st.useContext=function(P){return z.H.useContext(P)},st.useDebugValue=function(){},st.useDeferredValue=function(P,L){return z.H.useDeferredValue(P,L)},st.useEffect=function(P,L){return z.H.useEffect(P,L)},st.useEffectEvent=function(P){return z.H.useEffectEvent(P)},st.useId=function(){return z.H.useId()},st.useImperativeHandle=function(P,L,G){return z.H.useImperativeHandle(P,L,G)},st.useInsertionEffect=function(P,L){return z.H.useInsertionEffect(P,L)},st.useLayoutEffect=function(P,L){return z.H.useLayoutEffect(P,L)},st.useMemo=function(P,L){return z.H.useMemo(P,L)},st.useOptimistic=function(P,L){return z.H.useOptimistic(P,L)},st.useReducer=function(P,L,G){return z.H.useReducer(P,L,G)},st.useRef=function(P){return z.H.useRef(P)},st.useState=function(P){return z.H.useState(P)},st.useSyncExternalStore=function(P,L,G){return z.H.useSyncExternalStore(P,L,G)},st.useTransition=function(){return z.H.useTransition()},st.version="19.2.7",st}var mw;function Ed(){return mw||(mw=1,lp.exports=yz()),lp.exports}var p=Ed();const Re=wr(p),Mo=rr({__proto__:null,default:Re},[p]);var cp={exports:{}},fc={},up={exports:{}},dp={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var pw;function bz(){return pw||(pw=1,(function(e){function t(M,U){var K=M.length;M.push(U);e:for(;0<K;){var ne=K-1>>>1,q=M[ne];if(0<i(q,U))M[ne]=U,M[K]=q,K=ne;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var U=M[0],K=M.pop();if(K!==U){M[0]=K;e:for(var ne=0,q=M.length,P=q>>>1;ne<P;){var L=2*(ne+1)-1,G=M[L],J=L+1,$=M[J];if(0>i(G,K))J<q&&0>i($,G)?(M[ne]=$,M[J]=K,ne=J):(M[ne]=G,M[L]=K,ne=L);else if(J<q&&0>i($,K))M[ne]=$,M[J]=K,ne=J;else break e}}return U}function i(M,U){var K=M.sortIndex-U.sortIndex;return K!==0?K:M.id-U.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var h=[],m=[],x=1,g=null,v=3,S=!1,b=!1,j=!1,C=!1,k=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function R(M){for(var U=n(m);U!==null;){if(U.callback===null)r(m);else if(U.startTime<=M)r(m),U.sortIndex=U.expirationTime,t(h,U);else break;U=n(m)}}function A(M){if(j=!1,R(M),!b)if(n(h)!==null)b=!0,_||(_=!0,B());else{var U=n(m);U!==null&&W(A,U.startTime-M)}}var _=!1,z=-1,D=5,V=-1;function I(){return C?!0:!(e.unstable_now()-V<D)}function Q(){if(C=!1,_){var M=e.unstable_now();V=M;var U=!0;try{e:{b=!1,j&&(j=!1,N(z),z=-1),S=!0;var K=v;try{t:{for(R(M),g=n(h);g!==null&&!(g.expirationTime>M&&I());){var ne=g.callback;if(typeof ne=="function"){g.callback=null,v=g.priorityLevel;var q=ne(g.expirationTime<=M);if(M=e.unstable_now(),typeof q=="function"){g.callback=q,R(M),U=!0;break t}g===n(h)&&r(h),R(M)}else r(h);g=n(h)}if(g!==null)U=!0;else{var P=n(m);P!==null&&W(A,P.startTime-M),U=!1}}break e}finally{g=null,v=K,S=!1}U=void 0}}finally{U?B():_=!1}}}var B;if(typeof E=="function")B=function(){E(Q)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,ee=H.port2;H.port1.onmessage=Q,B=function(){ee.postMessage(null)}}else B=function(){k(Q,0)};function W(M,U){z=k(function(){M(e.unstable_now())},U)}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(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(M){switch(v){case 1:case 2:case 3:var U=3;break;default:U=v}var K=v;v=U;try{return M()}finally{v=K}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(M,U){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var K=v;v=M;try{return U()}finally{v=K}},e.unstable_scheduleCallback=function(M,U,K){var ne=e.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?ne+K:ne):K=ne,M){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=K+q,M={id:x++,callback:U,priorityLevel:M,startTime:K,expirationTime:q,sortIndex:-1},K>ne?(M.sortIndex=K,t(m,M),n(h)===null&&M===n(m)&&(j?(N(z),z=-1):j=!0,W(A,K-ne))):(M.sortIndex=q,t(h,M),b||S||(b=!0,_||(_=!0,B()))),M},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(M){var U=v;return function(){var K=v;v=U;try{return M.apply(this,arguments)}finally{v=K}}}})(dp)),dp}var gw;function wz(){return gw||(gw=1,up.exports=bz()),up.exports}var fp={exports:{}},$n={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var xw;function Sz(){if(xw)return $n;xw=1;var e=Ed();function t(h){var m="https://react.dev/errors/"+h;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)m+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+h+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function o(h,m,x){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:g==null?null:""+g,children:h,containerInfo:m,implementation:x}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(h,m){if(h==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return $n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,$n.createPortal=function(h,m){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return o(h,m,null,x)},$n.flushSync=function(h){var m=c.T,x=r.p;try{if(c.T=null,r.p=2,h)return h()}finally{c.T=m,r.p=x,r.d.f()}},$n.preconnect=function(h,m){typeof h=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,r.d.C(h,m))},$n.prefetchDNS=function(h){typeof h=="string"&&r.d.D(h)},$n.preinit=function(h,m){if(typeof h=="string"&&m&&typeof m.as=="string"){var x=m.as,g=d(x,m.crossOrigin),v=typeof m.integrity=="string"?m.integrity:void 0,S=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;x==="style"?r.d.S(h,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:g,integrity:v,fetchPriority:S}):x==="script"&&r.d.X(h,{crossOrigin:g,integrity:v,fetchPriority:S,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},$n.preinitModule=function(h,m){if(typeof h=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var x=d(m.as,m.crossOrigin);r.d.M(h,{crossOrigin:x,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&r.d.M(h)},$n.preload=function(h,m){if(typeof h=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var x=m.as,g=d(x,m.crossOrigin);r.d.L(h,x,{crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},$n.preloadModule=function(h,m){if(typeof h=="string")if(m){var x=d(m.as,m.crossOrigin);r.d.m(h,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:x,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(h)},$n.requestFormReset=function(h){r.d.r(h)},$n.unstable_batchedUpdates=function(h,m){return h(m)},$n.useFormState=function(h,m,x){return c.H.useFormState(h,m,x)},$n.useFormStatus=function(){return c.H.useHostTransitionStatus()},$n.version="19.2.7",$n}var vw;function yw(){if(vw)return fp.exports;vw=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),fp.exports=Sz(),fp.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var bw;function jz(){if(bw)return fc;bw=1;var e=wz(),t=Ed(),n=yw();function r(s){var a="https://react.dev/errors/"+s;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)a+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+s+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function o(s){var a=s,u=s;if(s.alternate)for(;a.return;)a=a.return;else{s=a;do a=s,(a.flags&4098)!==0&&(u=a.return),s=a.return;while(s)}return a.tag===3?u:null}function c(s){if(s.tag===13){var a=s.memoizedState;if(a===null&&(s=s.alternate,s!==null&&(a=s.memoizedState)),a!==null)return a.dehydrated}return null}function d(s){if(s.tag===31){var a=s.memoizedState;if(a===null&&(s=s.alternate,s!==null&&(a=s.memoizedState)),a!==null)return a.dehydrated}return null}function h(s){if(o(s)!==s)throw Error(r(188))}function m(s){var a=s.alternate;if(!a){if(a=o(s),a===null)throw Error(r(188));return a!==s?null:s}for(var u=s,f=a;;){var y=u.return;if(y===null)break;var w=y.alternate;if(w===null){if(f=y.return,f!==null){u=f;continue}break}if(y.child===w.child){for(w=y.child;w;){if(w===u)return h(y),s;if(w===f)return h(y),a;w=w.sibling}throw Error(r(188))}if(u.return!==f.return)u=y,f=w;else{for(var T=!1,O=y.child;O;){if(O===u){T=!0,u=y,f=w;break}if(O===f){T=!0,f=y,u=w;break}O=O.sibling}if(!T){for(O=w.child;O;){if(O===u){T=!0,u=w,f=y;break}if(O===f){T=!0,f=w,u=y;break}O=O.sibling}if(!T)throw Error(r(189))}}if(u.alternate!==f)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?s:a}function x(s){var a=s.tag;if(a===5||a===26||a===27||a===6)return s;for(s=s.child;s!==null;){if(a=x(s),a!==null)return a;s=s.sibling}return null}var g=Object.assign,v=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),E=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),Q=Symbol.iterator;function B(s){return s===null||typeof s!="object"?null:(s=Q&&s[Q]||s["@@iterator"],typeof s=="function"?s:null)}var H=Symbol.for("react.client.reference");function ee(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===H?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case j:return"Fragment";case k:return"Profiler";case C:return"StrictMode";case A:return"Suspense";case _:return"SuspenseList";case V:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case b:return"Portal";case E:return s.displayName||"Context";case N:return(s._context.displayName||"Context")+".Consumer";case R:var a=s.render;return s=s.displayName,s||(s=a.displayName||a.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case z:return a=s.displayName||null,a!==null?a:ee(s.type)||"Memo";case D:a=s._payload,s=s._init;try{return ee(s(a))}catch{}}return null}var W=Array.isArray,M=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},ne=[],q=-1;function P(s){return{current:s}}function L(s){0>q||(s.current=ne[q],ne[q]=null,q--)}function G(s,a){q++,ne[q]=s.current,s.current=a}var J=P(null),$=P(null),se=P(null),oe=P(null);function ie(s,a){switch(G(se,a),G($,s),G(J,null),a.nodeType){case 9:case 11:s=(s=a.documentElement)&&(s=s.namespaceURI)?PO(s):0;break;default:if(s=a.tagName,a=a.namespaceURI)a=PO(a),s=LO(a,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}L(J),G(J,s)}function Z(){L(J),L($),L(se)}function ve(s){s.memoizedState!==null&&G(oe,s);var a=J.current,u=LO(a,s.type);a!==u&&(G($,s),G(J,u))}function Ee(s){$.current===s&&(L(J),L($)),oe.current===s&&(L(oe),Cd._currentValue=K)}var Te,Ie;function Fe(s){if(Te===void 0)try{throw Error()}catch(u){var a=u.stack.trim().match(/\n( *(at )?)/);Te=a&&a[1]||"",Ie=-1<u.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+Te+s+Ie}var fe=!1;function Se(s,a){if(!s||fe)return"";fe=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={DetermineComponentFrameRoot:function(){try{if(a){var xe=function(){throw Error()};if(Object.defineProperty(xe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xe,[])}catch(de){var ue=de}Reflect.construct(s,[],xe)}else{try{xe.call()}catch(de){ue=de}s.call(xe.prototype)}}else{try{throw Error()}catch(de){ue=de}(xe=s())&&typeof xe.catch=="function"&&xe.catch(function(){})}}catch(de){if(de&&ue&&typeof de.stack=="string")return[de.stack,ue.stack]}return[null,null]}};f.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(f.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(f.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=f.DetermineComponentFrameRoot(),T=w[0],O=w[1];if(T&&O){var X=T.split(`
|
|
44
|
+
`),ce=O.split(`
|
|
45
|
+
`);for(y=f=0;f<X.length&&!X[f].includes("DetermineComponentFrameRoot");)f++;for(;y<ce.length&&!ce[y].includes("DetermineComponentFrameRoot");)y++;if(f===X.length||y===ce.length)for(f=X.length-1,y=ce.length-1;1<=f&&0<=y&&X[f]!==ce[y];)y--;for(;1<=f&&0<=y;f--,y--)if(X[f]!==ce[y]){if(f!==1||y!==1)do if(f--,y--,0>y||X[f]!==ce[y]){var me=`
|
|
46
|
+
`+X[f].replace(" at new "," at ");return s.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",s.displayName)),me}while(1<=f&&0<=y);break}}}finally{fe=!1,Error.prepareStackTrace=u}return(u=s?s.displayName||s.name:"")?Fe(u):""}function ye(s,a){switch(s.tag){case 26:case 27:case 5:return Fe(s.type);case 16:return Fe("Lazy");case 13:return s.child!==a&&a!==null?Fe("Suspense Fallback"):Fe("Suspense");case 19:return Fe("SuspenseList");case 0:case 15:return Se(s.type,!1);case 11:return Se(s.type.render,!1);case 1:return Se(s.type,!0);case 31:return Fe("Activity");default:return""}}function Qe(s){try{var a="",u=null;do a+=ye(s,u),u=s,s=s.return;while(s);return a}catch(f){return`
|
|
47
|
+
Error generating stack: `+f.message+`
|
|
48
|
+
`+f.stack}}var nt=Object.prototype.hasOwnProperty,re=e.unstable_scheduleCallback,_e=e.unstable_cancelCallback,Pe=e.unstable_shouldYield,Xe=e.unstable_requestPaint,ge=e.unstable_now,Ye=e.unstable_getCurrentPriorityLevel,je=e.unstable_ImmediatePriority,kt=e.unstable_UserBlockingPriority,zt=e.unstable_NormalPriority,Qn=e.unstable_LowPriority,hn=e.unstable_IdlePriority,Zn=e.log,sn=e.unstable_setDisableYieldValue,Jn=null,we=null;function Oe(s){if(typeof Zn=="function"&&sn(s),we&&typeof we.setStrictMode=="function")try{we.setStrictMode(Jn,s)}catch{}}var lt=Math.clz32?Math.clz32:bt,an=Math.log,en=Math.LN2;function bt(s){return s>>>=0,s===0?32:31-(an(s)/en|0)|0}var Ft=256,jn=262144,Me=4194304;function Ue(s){var a=s&42;if(a!==0)return a;switch(s&-s){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 s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function ke(s,a,u){var f=s.pendingLanes;if(f===0)return 0;var y=0,w=s.suspendedLanes,T=s.pingedLanes;s=s.warmLanes;var O=f&134217727;return O!==0?(f=O&~w,f!==0?y=Ue(f):(T&=O,T!==0?y=Ue(T):u||(u=O&~s,u!==0&&(y=Ue(u))))):(O=f&~w,O!==0?y=Ue(O):T!==0?y=Ue(T):u||(u=f&~s,u!==0&&(y=Ue(u)))),y===0?0:a!==0&&a!==y&&(a&w)===0&&(w=y&-y,u=a&-a,w>=u||w===32&&(u&4194048)!==0)?a:y}function ft(s,a){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&a)===0}function Pt(s,a){switch(s){case 1:case 2:case 4:case 8:case 64:return a+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Qt(){var s=Me;return Me<<=1,(Me&62914560)===0&&(Me=4194304),s}function An(s){for(var a=[],u=0;31>u;u++)a.push(s);return a}function At(s,a){s.pendingLanes|=a,a!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function On(s,a,u,f,y,w){var T=s.pendingLanes;s.pendingLanes=u,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=u,s.entangledLanes&=u,s.errorRecoveryDisabledLanes&=u,s.shellSuspendCounter=0;var O=s.entanglements,X=s.expirationTimes,ce=s.hiddenUpdates;for(u=T&~u;0<u;){var me=31-lt(u),xe=1<<me;O[me]=0,X[me]=-1;var ue=ce[me];if(ue!==null)for(ce[me]=null,me=0;me<ue.length;me++){var de=ue[me];de!==null&&(de.lane&=-536870913)}u&=~xe}f!==0&&vs(s,f,0),w!==0&&y===0&&s.tag!==0&&(s.suspendedLanes|=w&~(T&~a))}function vs(s,a,u){s.pendingLanes|=a,s.suspendedLanes&=~a;var f=31-lt(a);s.entangledLanes|=a,s.entanglements[f]=s.entanglements[f]|1073741824|u&261930}function Ht(s,a){var u=s.entangledLanes|=a;for(s=s.entanglements;u;){var f=31-lt(u),y=1<<f;y&a|s[f]&a&&(s[f]|=a),u&=~y}}function Mn(s,a){var u=a&-a;return u=(u&42)!==0?1:xa(u),(u&(s.suspendedLanes|a))!==0?0:u}function xa(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=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:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function er(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function fr(){var s=U.p;return s!==0?s:(s=window.event,s===void 0?32:iz(s.type))}function Yh(s,a){var u=U.p;try{return U.p=s,a()}finally{U.p=u}}var Bs=Math.random().toString(36).slice(2),Cn="__reactFiber$"+Bs,kn="__reactProps$"+Bs,Wr="__reactContainer$"+Bs,ii="__reactEvents$"+Bs,mn="__reactListeners$"+Bs,qt="__reactHandles$"+Bs,Al="__reactResources$"+Bs,ho="__reactMarker$"+Bs;function va(s){delete s[Cn],delete s[kn],delete s[ii],delete s[mn],delete s[qt]}function oi(s){var a=s[Cn];if(a)return a;for(var u=s.parentNode;u;){if(a=u[Wr]||u[Cn]){if(u=a.alternate,a.child!==null||u!==null&&u.child!==null)for(s=HO(s);s!==null;){if(u=s[Cn])return u;s=HO(s)}return a}s=u,u=s.parentNode}return null}function Xr(s){if(s=s[Cn]||s[Wr]){var a=s.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return s}return null}function Us(s){var a=s.tag;if(a===5||a===26||a===27||a===6)return s.stateNode;throw Error(r(33))}function ya(s){var a=s[Al];return a||(a=s[Al]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function Yt(s){s[ho]=!0}var Wh=new Set,Ml={};function ba(s,a){Vs(s,a),Vs(s+"Capture",a)}function Vs(s,a){for(Ml[s]=a,s=0;s<a.length;s++)Wh.add(a[s])}var zu=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]*$"),Pu={},Dl={};function li(s){return nt.call(Dl,s)?!0:nt.call(Pu,s)?!1:zu.test(s)?Dl[s]=!0:(Pu[s]=!0,!1)}function wa(s,a,u){if(li(a))if(u===null)s.removeAttribute(a);else{switch(typeof u){case"undefined":case"function":case"symbol":s.removeAttribute(a);return;case"boolean":var f=a.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){s.removeAttribute(a);return}}s.setAttribute(a,""+u)}}function _l(s,a,u){if(u===null)s.removeAttribute(a);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(a);return}s.setAttribute(a,""+u)}}function Qr(s,a,u,f){if(f===null)s.removeAttribute(u);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(u);return}s.setAttributeNS(a,u,""+f)}}function tr(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Lu(s){var a=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function cb(s,a,u){var f=Object.getOwnPropertyDescriptor(s.constructor.prototype,a);if(!s.hasOwnProperty(a)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var y=f.get,w=f.set;return Object.defineProperty(s,a,{configurable:!0,get:function(){return y.call(this)},set:function(T){u=""+T,w.call(this,T)}}),Object.defineProperty(s,a,{enumerable:f.enumerable}),{getValue:function(){return u},setValue:function(T){u=""+T},stopTracking:function(){s._valueTracker=null,delete s[a]}}}}function Sa(s){if(!s._valueTracker){var a=Lu(s)?"checked":"value";s._valueTracker=cb(s,a,""+s[a])}}function Xh(s){if(!s)return!1;var a=s._valueTracker;if(!a)return!0;var u=a.getValue(),f="";return s&&(f=Lu(s)?s.checked?"true":"false":s.value),s=f,s!==u?(a.setValue(s),!0):!1}function Ol(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var zl=/[\n"\\]/g;function hr(s){return s.replace(zl,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function Iu(s,a,u,f,y,w,T,O){s.name="",T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?s.type=T:s.removeAttribute("type"),a!=null?T==="number"?(a===0&&s.value===""||s.value!=a)&&(s.value=""+tr(a)):s.value!==""+tr(a)&&(s.value=""+tr(a)):T!=="submit"&&T!=="reset"||s.removeAttribute("value"),a!=null?$u(s,T,tr(a)):u!=null?$u(s,T,tr(u)):f!=null&&s.removeAttribute("value"),y==null&&w!=null&&(s.defaultChecked=!!w),y!=null&&(s.checked=y&&typeof y!="function"&&typeof y!="symbol"),O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?s.name=""+tr(O):s.removeAttribute("name")}function Qh(s,a,u,f,y,w,T,O){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(s.type=w),a!=null||u!=null){if(!(w!=="submit"&&w!=="reset"||a!=null)){Sa(s);return}u=u!=null?""+tr(u):"",a=a!=null?""+tr(a):u,O||a===s.value||(s.value=a),s.defaultValue=a}f=f??y,f=typeof f!="function"&&typeof f!="symbol"&&!!f,s.checked=O?s.checked:!!f,s.defaultChecked=!!f,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(s.name=T),Sa(s)}function $u(s,a,u){a==="number"&&Ol(s.ownerDocument)===s||s.defaultValue===""+u||(s.defaultValue=""+u)}function ci(s,a,u,f){if(s=s.options,a){a={};for(var y=0;y<u.length;y++)a["$"+u[y]]=!0;for(u=0;u<s.length;u++)y=a.hasOwnProperty("$"+s[u].value),s[u].selected!==y&&(s[u].selected=y),y&&f&&(s[u].defaultSelected=!0)}else{for(u=""+tr(u),a=null,y=0;y<s.length;y++){if(s[y].value===u){s[y].selected=!0,f&&(s[y].defaultSelected=!0);return}a!==null||s[y].disabled||(a=s[y])}a!==null&&(a.selected=!0)}}function Zh(s,a,u){if(a!=null&&(a=""+tr(a),a!==s.value&&(s.value=a),u==null)){s.defaultValue!==a&&(s.defaultValue=a);return}s.defaultValue=u!=null?""+tr(u):""}function Bu(s,a,u,f){if(a==null){if(f!=null){if(u!=null)throw Error(r(92));if(W(f)){if(1<f.length)throw Error(r(93));f=f[0]}u=f}u==null&&(u=""),a=u}u=tr(a),s.defaultValue=u,f=s.textContent,f===u&&f!==""&&f!==null&&(s.value=f),Sa(s)}function ja(s,a){if(a){var u=s.firstChild;if(u&&u===s.lastChild&&u.nodeType===3){u.nodeValue=a;return}}s.textContent=a}var Jh=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 F(s,a,u){var f=a.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?f?s.setProperty(a,""):a==="float"?s.cssFloat="":s[a]="":f?s.setProperty(a,u):typeof u!="number"||u===0||Jh.has(a)?a==="float"?s.cssFloat=u:s[a]=(""+u).trim():s[a]=u+"px"}function he(s,a,u){if(a!=null&&typeof a!="object")throw Error(r(62));if(s=s.style,u!=null){for(var f in u)!u.hasOwnProperty(f)||a!=null&&a.hasOwnProperty(f)||(f.indexOf("--")===0?s.setProperty(f,""):f==="float"?s.cssFloat="":s[f]="");for(var y in a)f=a[y],a.hasOwnProperty(y)&&u[y]!==f&&F(s,y,f)}else for(var w in a)a.hasOwnProperty(w)&&F(s,w,a[w])}function Ae(s){if(s.indexOf("-")===-1)return!1;switch(s){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 Ve=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Ke=/^[\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 mt(s){return Ke.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function at(){}var Rt=null;function ct(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var jt=null,mr=null;function ys(s){var a=Xr(s);if(a&&(s=a.stateNode)){var u=s[kn]||null;e:switch(s=a.stateNode,a.type){case"input":if(Iu(s,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),a=u.name,u.type==="radio"&&a!=null){for(u=s;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+hr(""+a)+'"][type="radio"]'),a=0;a<u.length;a++){var f=u[a];if(f!==s&&f.form===s.form){var y=f[kn]||null;if(!y)throw Error(r(90));Iu(f,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(a=0;a<u.length;a++)f=u[a],f.form===s.form&&Xh(f)}break e;case"textarea":Zh(s,u.value,u.defaultValue);break e;case"select":a=u.value,a!=null&&ci(s,!!u.multiple,a,!1)}}}var Fs=!1;function PM(s,a,u){if(Fs)return s(a,u);Fs=!0;try{var f=s(a);return f}finally{if(Fs=!1,(jt!==null||mr!==null)&&(Bm(),jt&&(a=jt,s=mr,mr=jt=null,ys(a),s)))for(a=0;a<s.length;a++)ys(s[a])}}function Uu(s,a){var u=s.stateNode;if(u===null)return null;var f=u[kn]||null;if(f===null)return null;u=f[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(s=s.type,f=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!f;break e;default:s=!1}if(s)return null;if(u&&typeof u!="function")throw Error(r(231,a,typeof u));return u}var Ca=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ub=!1;if(Ca)try{var Vu={};Object.defineProperty(Vu,"passive",{get:function(){ub=!0}}),window.addEventListener("test",Vu,Vu),window.removeEventListener("test",Vu,Vu)}catch{ub=!1}var ui=null,db=null,em=null;function LM(){if(em)return em;var s,a=db,u=a.length,f,y="value"in ui?ui.value:ui.textContent,w=y.length;for(s=0;s<u&&a[s]===y[s];s++);var T=u-s;for(f=1;f<=T&&a[u-f]===y[w-f];f++);return em=y.slice(s,1<f?1-f:void 0)}function tm(s){var a=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&a===13&&(s=13)):s=a,s===10&&(s=13),32<=s||s===13?s:0}function nm(){return!0}function IM(){return!1}function pr(s){function a(u,f,y,w,T){this._reactName=u,this._targetInst=y,this.type=f,this.nativeEvent=w,this.target=T,this.currentTarget=null;for(var O in s)s.hasOwnProperty(O)&&(u=s[O],this[O]=u?u(w):w[O]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?nm:IM,this.isPropagationStopped=IM,this}return g(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=nm)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=nm)},persist:function(){},isPersistent:nm}),a}var mo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},rm=pr(mo),Fu=g({},mo,{view:0,detail:0}),hJ=pr(Fu),fb,hb,Hu,sm=g({},Fu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pb,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Hu&&(Hu&&s.type==="mousemove"?(fb=s.screenX-Hu.screenX,hb=s.screenY-Hu.screenY):hb=fb=0,Hu=s),fb)},movementY:function(s){return"movementY"in s?s.movementY:hb}}),$M=pr(sm),mJ=g({},sm,{dataTransfer:0}),pJ=pr(mJ),gJ=g({},Fu,{relatedTarget:0}),mb=pr(gJ),xJ=g({},mo,{animationName:0,elapsedTime:0,pseudoElement:0}),vJ=pr(xJ),yJ=g({},mo,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),bJ=pr(yJ),wJ=g({},mo,{data:0}),BM=pr(wJ),SJ={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},jJ={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"},CJ={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kJ(s){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(s):(s=CJ[s])?!!a[s]:!1}function pb(){return kJ}var NJ=g({},Fu,{key:function(s){if(s.key){var a=SJ[s.key]||s.key;if(a!=="Unidentified")return a}return s.type==="keypress"?(s=tm(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?jJ[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pb,charCode:function(s){return s.type==="keypress"?tm(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?tm(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),TJ=pr(NJ),EJ=g({},sm,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),UM=pr(EJ),RJ=g({},Fu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pb}),AJ=pr(RJ),MJ=g({},mo,{propertyName:0,elapsedTime:0,pseudoElement:0}),DJ=pr(MJ),_J=g({},sm,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),OJ=pr(_J),zJ=g({},mo,{newState:0,oldState:0}),PJ=pr(zJ),LJ=[9,13,27,32],gb=Ca&&"CompositionEvent"in window,qu=null;Ca&&"documentMode"in document&&(qu=document.documentMode);var IJ=Ca&&"TextEvent"in window&&!qu,VM=Ca&&(!gb||qu&&8<qu&&11>=qu),FM=" ",HM=!1;function qM(s,a){switch(s){case"keyup":return LJ.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function KM(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Pl=!1;function $J(s,a){switch(s){case"compositionend":return KM(a);case"keypress":return a.which!==32?null:(HM=!0,FM);case"textInput":return s=a.data,s===FM&&HM?null:s;default:return null}}function BJ(s,a){if(Pl)return s==="compositionend"||!gb&&qM(s,a)?(s=LM(),em=db=ui=null,Pl=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return VM&&a.locale!=="ko"?null:a.data;default:return null}}var UJ={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 GM(s){var a=s&&s.nodeName&&s.nodeName.toLowerCase();return a==="input"?!!UJ[s.type]:a==="textarea"}function YM(s,a,u,f){jt?mr?mr.push(f):mr=[f]:jt=f,a=Gm(a,"onChange"),0<a.length&&(u=new rm("onChange","change",null,u,f),s.push({event:u,listeners:a}))}var Ku=null,Gu=null;function VJ(s){AO(s,0)}function am(s){var a=Us(s);if(Xh(a))return s}function WM(s,a){if(s==="change")return a}var XM=!1;if(Ca){var xb;if(Ca){var vb="oninput"in document;if(!vb){var QM=document.createElement("div");QM.setAttribute("oninput","return;"),vb=typeof QM.oninput=="function"}xb=vb}else xb=!1;XM=xb&&(!document.documentMode||9<document.documentMode)}function ZM(){Ku&&(Ku.detachEvent("onpropertychange",JM),Gu=Ku=null)}function JM(s){if(s.propertyName==="value"&&am(Gu)){var a=[];YM(a,Gu,s,ct(s)),PM(VJ,a)}}function FJ(s,a,u){s==="focusin"?(ZM(),Ku=a,Gu=u,Ku.attachEvent("onpropertychange",JM)):s==="focusout"&&ZM()}function HJ(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return am(Gu)}function qJ(s,a){if(s==="click")return am(a)}function KJ(s,a){if(s==="input"||s==="change")return am(a)}function GJ(s,a){return s===a&&(s!==0||1/s===1/a)||s!==s&&a!==a}var Ar=typeof Object.is=="function"?Object.is:GJ;function Yu(s,a){if(Ar(s,a))return!0;if(typeof s!="object"||s===null||typeof a!="object"||a===null)return!1;var u=Object.keys(s),f=Object.keys(a);if(u.length!==f.length)return!1;for(f=0;f<u.length;f++){var y=u[f];if(!nt.call(a,y)||!Ar(s[y],a[y]))return!1}return!0}function eD(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function tD(s,a){var u=eD(s);s=0;for(var f;u;){if(u.nodeType===3){if(f=s+u.textContent.length,s<=a&&f>=a)return{node:u,offset:a-s};s=f}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=eD(u)}}function nD(s,a){return s&&a?s===a?!0:s&&s.nodeType===3?!1:a&&a.nodeType===3?nD(s,a.parentNode):"contains"in s?s.contains(a):s.compareDocumentPosition?!!(s.compareDocumentPosition(a)&16):!1:!1}function rD(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var a=Ol(s.document);a instanceof s.HTMLIFrameElement;){try{var u=typeof a.contentWindow.location.href=="string"}catch{u=!1}if(u)s=a.contentWindow;else break;a=Ol(s.document)}return a}function yb(s){var a=s&&s.nodeName&&s.nodeName.toLowerCase();return a&&(a==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||a==="textarea"||s.contentEditable==="true")}var YJ=Ca&&"documentMode"in document&&11>=document.documentMode,Ll=null,bb=null,Wu=null,wb=!1;function sD(s,a,u){var f=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;wb||Ll==null||Ll!==Ol(f)||(f=Ll,"selectionStart"in f&&yb(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),Wu&&Yu(Wu,f)||(Wu=f,f=Gm(bb,"onSelect"),0<f.length&&(a=new rm("onSelect","select",null,a,u),s.push({event:a,listeners:f}),a.target=Ll)))}function po(s,a){var u={};return u[s.toLowerCase()]=a.toLowerCase(),u["Webkit"+s]="webkit"+a,u["Moz"+s]="moz"+a,u}var Il={animationend:po("Animation","AnimationEnd"),animationiteration:po("Animation","AnimationIteration"),animationstart:po("Animation","AnimationStart"),transitionrun:po("Transition","TransitionRun"),transitionstart:po("Transition","TransitionStart"),transitioncancel:po("Transition","TransitionCancel"),transitionend:po("Transition","TransitionEnd")},Sb={},aD={};Ca&&(aD=document.createElement("div").style,"AnimationEvent"in window||(delete Il.animationend.animation,delete Il.animationiteration.animation,delete Il.animationstart.animation),"TransitionEvent"in window||delete Il.transitionend.transition);function go(s){if(Sb[s])return Sb[s];if(!Il[s])return s;var a=Il[s],u;for(u in a)if(a.hasOwnProperty(u)&&u in aD)return Sb[s]=a[u];return s}var iD=go("animationend"),oD=go("animationiteration"),lD=go("animationstart"),WJ=go("transitionrun"),XJ=go("transitionstart"),QJ=go("transitioncancel"),cD=go("transitionend"),uD=new Map,jb="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");jb.push("scrollEnd");function bs(s,a){uD.set(s,a),ba(a,[s])}var im=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},Zr=[],$l=0,Cb=0;function om(){for(var s=$l,a=Cb=$l=0;a<s;){var u=Zr[a];Zr[a++]=null;var f=Zr[a];Zr[a++]=null;var y=Zr[a];Zr[a++]=null;var w=Zr[a];if(Zr[a++]=null,f!==null&&y!==null){var T=f.pending;T===null?y.next=y:(y.next=T.next,T.next=y),f.pending=y}w!==0&&dD(u,y,w)}}function lm(s,a,u,f){Zr[$l++]=s,Zr[$l++]=a,Zr[$l++]=u,Zr[$l++]=f,Cb|=f,s.lanes|=f,s=s.alternate,s!==null&&(s.lanes|=f)}function kb(s,a,u,f){return lm(s,a,u,f),cm(s)}function xo(s,a){return lm(s,null,null,a),cm(s)}function dD(s,a,u){s.lanes|=u;var f=s.alternate;f!==null&&(f.lanes|=u);for(var y=!1,w=s.return;w!==null;)w.childLanes|=u,f=w.alternate,f!==null&&(f.childLanes|=u),w.tag===22&&(s=w.stateNode,s===null||s._visibility&1||(y=!0)),s=w,w=w.return;return s.tag===3?(w=s.stateNode,y&&a!==null&&(y=31-lt(u),s=w.hiddenUpdates,f=s[y],f===null?s[y]=[a]:f.push(a),a.lane=u|536870912),w):null}function cm(s){if(50<xd)throw xd=0,O0=null,Error(r(185));for(var a=s.return;a!==null;)s=a,a=s.return;return s.tag===3?s.stateNode:null}var Bl={};function ZJ(s,a,u,f){this.tag=s,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mr(s,a,u,f){return new ZJ(s,a,u,f)}function Nb(s){return s=s.prototype,!(!s||!s.isReactComponent)}function ka(s,a){var u=s.alternate;return u===null?(u=Mr(s.tag,a,s.key,s.mode),u.elementType=s.elementType,u.type=s.type,u.stateNode=s.stateNode,u.alternate=s,s.alternate=u):(u.pendingProps=a,u.type=s.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=s.flags&65011712,u.childLanes=s.childLanes,u.lanes=s.lanes,u.child=s.child,u.memoizedProps=s.memoizedProps,u.memoizedState=s.memoizedState,u.updateQueue=s.updateQueue,a=s.dependencies,u.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},u.sibling=s.sibling,u.index=s.index,u.ref=s.ref,u.refCleanup=s.refCleanup,u}function fD(s,a){s.flags&=65011714;var u=s.alternate;return u===null?(s.childLanes=0,s.lanes=a,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=u.childLanes,s.lanes=u.lanes,s.child=u.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=u.memoizedProps,s.memoizedState=u.memoizedState,s.updateQueue=u.updateQueue,s.type=u.type,a=u.dependencies,s.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),s}function um(s,a,u,f,y,w){var T=0;if(f=s,typeof s=="function")Nb(s)&&(T=1);else if(typeof s=="string")T=rte(s,u,J.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case V:return s=Mr(31,u,a,y),s.elementType=V,s.lanes=w,s;case j:return vo(u.children,y,w,a);case C:T=8,y|=24;break;case k:return s=Mr(12,u,a,y|2),s.elementType=k,s.lanes=w,s;case A:return s=Mr(13,u,a,y),s.elementType=A,s.lanes=w,s;case _:return s=Mr(19,u,a,y),s.elementType=_,s.lanes=w,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case E:T=10;break e;case N:T=9;break e;case R:T=11;break e;case z:T=14;break e;case D:T=16,f=null;break e}T=29,u=Error(r(130,s===null?"null":typeof s,"")),f=null}return a=Mr(T,u,a,y),a.elementType=s,a.type=f,a.lanes=w,a}function vo(s,a,u,f){return s=Mr(7,s,f,a),s.lanes=u,s}function Tb(s,a,u){return s=Mr(6,s,null,a),s.lanes=u,s}function hD(s){var a=Mr(18,null,null,0);return a.stateNode=s,a}function Eb(s,a,u){return a=Mr(4,s.children!==null?s.children:[],s.key,a),a.lanes=u,a.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},a}var mD=new WeakMap;function Jr(s,a){if(typeof s=="object"&&s!==null){var u=mD.get(s);return u!==void 0?u:(a={value:s,source:a,stack:Qe(a)},mD.set(s,a),a)}return{value:s,source:a,stack:Qe(a)}}var Ul=[],Vl=0,dm=null,Xu=0,es=[],ts=0,di=null,Hs=1,qs="";function Na(s,a){Ul[Vl++]=Xu,Ul[Vl++]=dm,dm=s,Xu=a}function pD(s,a,u){es[ts++]=Hs,es[ts++]=qs,es[ts++]=di,di=s;var f=Hs;s=qs;var y=32-lt(f)-1;f&=~(1<<y),u+=1;var w=32-lt(a)+y;if(30<w){var T=y-y%5;w=(f&(1<<T)-1).toString(32),f>>=T,y-=T,Hs=1<<32-lt(a)+y|u<<y|f,qs=w+s}else Hs=1<<w|u<<y|f,qs=s}function Rb(s){s.return!==null&&(Na(s,1),pD(s,1,0))}function Ab(s){for(;s===dm;)dm=Ul[--Vl],Ul[Vl]=null,Xu=Ul[--Vl],Ul[Vl]=null;for(;s===di;)di=es[--ts],es[ts]=null,qs=es[--ts],es[ts]=null,Hs=es[--ts],es[ts]=null}function gD(s,a){es[ts++]=Hs,es[ts++]=qs,es[ts++]=di,Hs=a.id,qs=a.overflow,di=s}var zn=null,Kt=null,yt=!1,fi=null,ns=!1,Mb=Error(r(519));function hi(s){var a=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Qu(Jr(a,s)),Mb}function xD(s){var a=s.stateNode,u=s.type,f=s.memoizedProps;switch(a[Cn]=s,a[kn]=f,u){case"dialog":gt("cancel",a),gt("close",a);break;case"iframe":case"object":case"embed":gt("load",a);break;case"video":case"audio":for(u=0;u<yd.length;u++)gt(yd[u],a);break;case"source":gt("error",a);break;case"img":case"image":case"link":gt("error",a),gt("load",a);break;case"details":gt("toggle",a);break;case"input":gt("invalid",a),Qh(a,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":gt("invalid",a);break;case"textarea":gt("invalid",a),Bu(a,f.value,f.defaultValue,f.children)}u=f.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||a.textContent===""+u||f.suppressHydrationWarning===!0||OO(a.textContent,u)?(f.popover!=null&&(gt("beforetoggle",a),gt("toggle",a)),f.onScroll!=null&>("scroll",a),f.onScrollEnd!=null&>("scrollend",a),f.onClick!=null&&(a.onclick=at),a=!0):a=!1,a||hi(s,!0)}function vD(s){for(zn=s.return;zn;)switch(zn.tag){case 5:case 31:case 13:ns=!1;return;case 27:case 3:ns=!0;return;default:zn=zn.return}}function Fl(s){if(s!==zn)return!1;if(!yt)return vD(s),yt=!0,!1;var a=s.tag,u;if((u=a!==3&&a!==27)&&((u=a===5)&&(u=s.type,u=!(u!=="form"&&u!=="button")||W0(s.type,s.memoizedProps)),u=!u),u&&Kt&&hi(s),vD(s),a===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));Kt=FO(s)}else if(a===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));Kt=FO(s)}else a===27?(a=Kt,Ti(s.type)?(s=ew,ew=null,Kt=s):Kt=a):Kt=zn?ss(s.stateNode.nextSibling):null;return!0}function yo(){Kt=zn=null,yt=!1}function Db(){var s=fi;return s!==null&&(yr===null?yr=s:yr.push.apply(yr,s),fi=null),s}function Qu(s){fi===null?fi=[s]:fi.push(s)}var _b=P(null),bo=null,Ta=null;function mi(s,a,u){G(_b,a._currentValue),a._currentValue=u}function Ea(s){s._currentValue=_b.current,L(_b)}function Ob(s,a,u){for(;s!==null;){var f=s.alternate;if((s.childLanes&a)!==a?(s.childLanes|=a,f!==null&&(f.childLanes|=a)):f!==null&&(f.childLanes&a)!==a&&(f.childLanes|=a),s===u)break;s=s.return}}function zb(s,a,u,f){var y=s.child;for(y!==null&&(y.return=s);y!==null;){var w=y.dependencies;if(w!==null){var T=y.child;w=w.firstContext;e:for(;w!==null;){var O=w;w=y;for(var X=0;X<a.length;X++)if(O.context===a[X]){w.lanes|=u,O=w.alternate,O!==null&&(O.lanes|=u),Ob(w.return,u,s),f||(T=null);break e}w=O.next}}else if(y.tag===18){if(T=y.return,T===null)throw Error(r(341));T.lanes|=u,w=T.alternate,w!==null&&(w.lanes|=u),Ob(T,u,s),T=null}else T=y.child;if(T!==null)T.return=y;else for(T=y;T!==null;){if(T===s){T=null;break}if(y=T.sibling,y!==null){y.return=T.return,T=y;break}T=T.return}y=T}}function Hl(s,a,u,f){s=null;for(var y=a,w=!1;y!==null;){if(!w){if((y.flags&524288)!==0)w=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var T=y.alternate;if(T===null)throw Error(r(387));if(T=T.memoizedProps,T!==null){var O=y.type;Ar(y.pendingProps.value,T.value)||(s!==null?s.push(O):s=[O])}}else if(y===oe.current){if(T=y.alternate,T===null)throw Error(r(387));T.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(s!==null?s.push(Cd):s=[Cd])}y=y.return}s!==null&&zb(a,s,u,f),a.flags|=262144}function fm(s){for(s=s.firstContext;s!==null;){if(!Ar(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function wo(s){bo=s,Ta=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Pn(s){return yD(bo,s)}function hm(s,a){return bo===null&&wo(s),yD(s,a)}function yD(s,a){var u=a._currentValue;if(a={context:a,memoizedValue:u,next:null},Ta===null){if(s===null)throw Error(r(308));Ta=a,s.dependencies={lanes:0,firstContext:a},s.flags|=524288}else Ta=Ta.next=a;return u}var JJ=typeof AbortController<"u"?AbortController:function(){var s=[],a=this.signal={aborted:!1,addEventListener:function(u,f){s.push(f)}};this.abort=function(){a.aborted=!0,s.forEach(function(u){return u()})}},eee=e.unstable_scheduleCallback,tee=e.unstable_NormalPriority,pn={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Pb(){return{controller:new JJ,data:new Map,refCount:0}}function Zu(s){s.refCount--,s.refCount===0&&eee(tee,function(){s.controller.abort()})}var Ju=null,Lb=0,ql=0,Kl=null;function nee(s,a){if(Ju===null){var u=Ju=[];Lb=0,ql=B0(),Kl={status:"pending",value:void 0,then:function(f){u.push(f)}}}return Lb++,a.then(bD,bD),a}function bD(){if(--Lb===0&&Ju!==null){Kl!==null&&(Kl.status="fulfilled");var s=Ju;Ju=null,ql=0,Kl=null;for(var a=0;a<s.length;a++)(0,s[a])()}}function ree(s,a){var u=[],f={status:"pending",value:null,reason:null,then:function(y){u.push(y)}};return s.then(function(){f.status="fulfilled",f.value=a;for(var y=0;y<u.length;y++)(0,u[y])(a)},function(y){for(f.status="rejected",f.reason=y,y=0;y<u.length;y++)(0,u[y])(void 0)}),f}var wD=M.S;M.S=function(s,a){sO=ge(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&nee(s,a),wD!==null&&wD(s,a)};var So=P(null);function Ib(){var s=So.current;return s!==null?s:Ut.pooledCache}function mm(s,a){a===null?G(So,So.current):G(So,a.pool)}function SD(){var s=Ib();return s===null?null:{parent:pn._currentValue,pool:s}}var Gl=Error(r(460)),$b=Error(r(474)),pm=Error(r(542)),gm={then:function(){}};function jD(s){return s=s.status,s==="fulfilled"||s==="rejected"}function CD(s,a,u){switch(u=s[u],u===void 0?s.push(a):u!==a&&(a.then(at,at),a=u),a.status){case"fulfilled":return a.value;case"rejected":throw s=a.reason,ND(s),s;default:if(typeof a.status=="string")a.then(at,at);else{if(s=Ut,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=a,s.status="pending",s.then(function(f){if(a.status==="pending"){var y=a;y.status="fulfilled",y.value=f}},function(f){if(a.status==="pending"){var y=a;y.status="rejected",y.reason=f}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw s=a.reason,ND(s),s}throw Co=a,Gl}}function jo(s){try{var a=s._init;return a(s._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(Co=u,Gl):u}}var Co=null;function kD(){if(Co===null)throw Error(r(459));var s=Co;return Co=null,s}function ND(s){if(s===Gl||s===pm)throw Error(r(483))}var Yl=null,ed=0;function xm(s){var a=ed;return ed+=1,Yl===null&&(Yl=[]),CD(Yl,s,a)}function td(s,a){a=a.props.ref,s.ref=a!==void 0?a:null}function vm(s,a){throw a.$$typeof===v?Error(r(525)):(s=Object.prototype.toString.call(a),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":s)))}function TD(s){function a(ae,te){if(s){var le=ae.deletions;le===null?(ae.deletions=[te],ae.flags|=16):le.push(te)}}function u(ae,te){if(!s)return null;for(;te!==null;)a(ae,te),te=te.sibling;return null}function f(ae){for(var te=new Map;ae!==null;)ae.key!==null?te.set(ae.key,ae):te.set(ae.index,ae),ae=ae.sibling;return te}function y(ae,te){return ae=ka(ae,te),ae.index=0,ae.sibling=null,ae}function w(ae,te,le){return ae.index=le,s?(le=ae.alternate,le!==null?(le=le.index,le<te?(ae.flags|=67108866,te):le):(ae.flags|=67108866,te)):(ae.flags|=1048576,te)}function T(ae){return s&&ae.alternate===null&&(ae.flags|=67108866),ae}function O(ae,te,le,pe){return te===null||te.tag!==6?(te=Tb(le,ae.mode,pe),te.return=ae,te):(te=y(te,le),te.return=ae,te)}function X(ae,te,le,pe){var Ze=le.type;return Ze===j?me(ae,te,le.props.children,pe,le.key):te!==null&&(te.elementType===Ze||typeof Ze=="object"&&Ze!==null&&Ze.$$typeof===D&&jo(Ze)===te.type)?(te=y(te,le.props),td(te,le),te.return=ae,te):(te=um(le.type,le.key,le.props,null,ae.mode,pe),td(te,le),te.return=ae,te)}function ce(ae,te,le,pe){return te===null||te.tag!==4||te.stateNode.containerInfo!==le.containerInfo||te.stateNode.implementation!==le.implementation?(te=Eb(le,ae.mode,pe),te.return=ae,te):(te=y(te,le.children||[]),te.return=ae,te)}function me(ae,te,le,pe,Ze){return te===null||te.tag!==7?(te=vo(le,ae.mode,pe,Ze),te.return=ae,te):(te=y(te,le),te.return=ae,te)}function xe(ae,te,le){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=Tb(""+te,ae.mode,le),te.return=ae,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case S:return le=um(te.type,te.key,te.props,null,ae.mode,le),td(le,te),le.return=ae,le;case b:return te=Eb(te,ae.mode,le),te.return=ae,te;case D:return te=jo(te),xe(ae,te,le)}if(W(te)||B(te))return te=vo(te,ae.mode,le,null),te.return=ae,te;if(typeof te.then=="function")return xe(ae,xm(te),le);if(te.$$typeof===E)return xe(ae,hm(ae,te),le);vm(ae,te)}return null}function ue(ae,te,le,pe){var Ze=te!==null?te.key:null;if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Ze!==null?null:O(ae,te,""+le,pe);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case S:return le.key===Ze?X(ae,te,le,pe):null;case b:return le.key===Ze?ce(ae,te,le,pe):null;case D:return le=jo(le),ue(ae,te,le,pe)}if(W(le)||B(le))return Ze!==null?null:me(ae,te,le,pe,null);if(typeof le.then=="function")return ue(ae,te,xm(le),pe);if(le.$$typeof===E)return ue(ae,te,hm(ae,le),pe);vm(ae,le)}return null}function de(ae,te,le,pe,Ze){if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return ae=ae.get(le)||null,O(te,ae,""+pe,Ze);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case S:return ae=ae.get(pe.key===null?le:pe.key)||null,X(te,ae,pe,Ze);case b:return ae=ae.get(pe.key===null?le:pe.key)||null,ce(te,ae,pe,Ze);case D:return pe=jo(pe),de(ae,te,le,pe,Ze)}if(W(pe)||B(pe))return ae=ae.get(le)||null,me(te,ae,pe,Ze,null);if(typeof pe.then=="function")return de(ae,te,le,xm(pe),Ze);if(pe.$$typeof===E)return de(ae,te,le,hm(te,pe),Ze);vm(te,pe)}return null}function $e(ae,te,le,pe){for(var Ze=null,Nt=null,He=te,ot=te=0,vt=null;He!==null&&ot<le.length;ot++){He.index>ot?(vt=He,He=null):vt=He.sibling;var Tt=ue(ae,He,le[ot],pe);if(Tt===null){He===null&&(He=vt);break}s&&He&&Tt.alternate===null&&a(ae,He),te=w(Tt,te,ot),Nt===null?Ze=Tt:Nt.sibling=Tt,Nt=Tt,He=vt}if(ot===le.length)return u(ae,He),yt&&Na(ae,ot),Ze;if(He===null){for(;ot<le.length;ot++)He=xe(ae,le[ot],pe),He!==null&&(te=w(He,te,ot),Nt===null?Ze=He:Nt.sibling=He,Nt=He);return yt&&Na(ae,ot),Ze}for(He=f(He);ot<le.length;ot++)vt=de(He,ae,ot,le[ot],pe),vt!==null&&(s&&vt.alternate!==null&&He.delete(vt.key===null?ot:vt.key),te=w(vt,te,ot),Nt===null?Ze=vt:Nt.sibling=vt,Nt=vt);return s&&He.forEach(function(Di){return a(ae,Di)}),yt&&Na(ae,ot),Ze}function et(ae,te,le,pe){if(le==null)throw Error(r(151));for(var Ze=null,Nt=null,He=te,ot=te=0,vt=null,Tt=le.next();He!==null&&!Tt.done;ot++,Tt=le.next()){He.index>ot?(vt=He,He=null):vt=He.sibling;var Di=ue(ae,He,Tt.value,pe);if(Di===null){He===null&&(He=vt);break}s&&He&&Di.alternate===null&&a(ae,He),te=w(Di,te,ot),Nt===null?Ze=Di:Nt.sibling=Di,Nt=Di,He=vt}if(Tt.done)return u(ae,He),yt&&Na(ae,ot),Ze;if(He===null){for(;!Tt.done;ot++,Tt=le.next())Tt=xe(ae,Tt.value,pe),Tt!==null&&(te=w(Tt,te,ot),Nt===null?Ze=Tt:Nt.sibling=Tt,Nt=Tt);return yt&&Na(ae,ot),Ze}for(He=f(He);!Tt.done;ot++,Tt=le.next())Tt=de(He,ae,ot,Tt.value,pe),Tt!==null&&(s&&Tt.alternate!==null&&He.delete(Tt.key===null?ot:Tt.key),te=w(Tt,te,ot),Nt===null?Ze=Tt:Nt.sibling=Tt,Nt=Tt);return s&&He.forEach(function(mte){return a(ae,mte)}),yt&&Na(ae,ot),Ze}function $t(ae,te,le,pe){if(typeof le=="object"&&le!==null&&le.type===j&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case S:e:{for(var Ze=le.key;te!==null;){if(te.key===Ze){if(Ze=le.type,Ze===j){if(te.tag===7){u(ae,te.sibling),pe=y(te,le.props.children),pe.return=ae,ae=pe;break e}}else if(te.elementType===Ze||typeof Ze=="object"&&Ze!==null&&Ze.$$typeof===D&&jo(Ze)===te.type){u(ae,te.sibling),pe=y(te,le.props),td(pe,le),pe.return=ae,ae=pe;break e}u(ae,te);break}else a(ae,te);te=te.sibling}le.type===j?(pe=vo(le.props.children,ae.mode,pe,le.key),pe.return=ae,ae=pe):(pe=um(le.type,le.key,le.props,null,ae.mode,pe),td(pe,le),pe.return=ae,ae=pe)}return T(ae);case b:e:{for(Ze=le.key;te!==null;){if(te.key===Ze)if(te.tag===4&&te.stateNode.containerInfo===le.containerInfo&&te.stateNode.implementation===le.implementation){u(ae,te.sibling),pe=y(te,le.children||[]),pe.return=ae,ae=pe;break e}else{u(ae,te);break}else a(ae,te);te=te.sibling}pe=Eb(le,ae.mode,pe),pe.return=ae,ae=pe}return T(ae);case D:return le=jo(le),$t(ae,te,le,pe)}if(W(le))return $e(ae,te,le,pe);if(B(le)){if(Ze=B(le),typeof Ze!="function")throw Error(r(150));return le=Ze.call(le),et(ae,te,le,pe)}if(typeof le.then=="function")return $t(ae,te,xm(le),pe);if(le.$$typeof===E)return $t(ae,te,hm(ae,le),pe);vm(ae,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,te!==null&&te.tag===6?(u(ae,te.sibling),pe=y(te,le),pe.return=ae,ae=pe):(u(ae,te),pe=Tb(le,ae.mode,pe),pe.return=ae,ae=pe),T(ae)):u(ae,te)}return function(ae,te,le,pe){try{ed=0;var Ze=$t(ae,te,le,pe);return Yl=null,Ze}catch(He){if(He===Gl||He===pm)throw He;var Nt=Mr(29,He,null,ae.mode);return Nt.lanes=pe,Nt.return=ae,Nt}finally{}}}var ko=TD(!0),ED=TD(!1),pi=!1;function Bb(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ub(s,a){s=s.updateQueue,a.updateQueue===s&&(a.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function gi(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function xi(s,a,u){var f=s.updateQueue;if(f===null)return null;if(f=f.shared,(Et&2)!==0){var y=f.pending;return y===null?a.next=a:(a.next=y.next,y.next=a),f.pending=a,a=cm(s),dD(s,null,u),a}return lm(s,f,a,u),cm(s)}function nd(s,a,u){if(a=a.updateQueue,a!==null&&(a=a.shared,(u&4194048)!==0)){var f=a.lanes;f&=s.pendingLanes,u|=f,a.lanes=u,Ht(s,u)}}function Vb(s,a){var u=s.updateQueue,f=s.alternate;if(f!==null&&(f=f.updateQueue,u===f)){var y=null,w=null;if(u=u.firstBaseUpdate,u!==null){do{var T={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};w===null?y=w=T:w=w.next=T,u=u.next}while(u!==null);w===null?y=w=a:w=w.next=a}else y=w=a;u={baseState:f.baseState,firstBaseUpdate:y,lastBaseUpdate:w,shared:f.shared,callbacks:f.callbacks},s.updateQueue=u;return}s=u.lastBaseUpdate,s===null?u.firstBaseUpdate=a:s.next=a,u.lastBaseUpdate=a}var Fb=!1;function rd(){if(Fb){var s=Kl;if(s!==null)throw s}}function sd(s,a,u,f){Fb=!1;var y=s.updateQueue;pi=!1;var w=y.firstBaseUpdate,T=y.lastBaseUpdate,O=y.shared.pending;if(O!==null){y.shared.pending=null;var X=O,ce=X.next;X.next=null,T===null?w=ce:T.next=ce,T=X;var me=s.alternate;me!==null&&(me=me.updateQueue,O=me.lastBaseUpdate,O!==T&&(O===null?me.firstBaseUpdate=ce:O.next=ce,me.lastBaseUpdate=X))}if(w!==null){var xe=y.baseState;T=0,me=ce=X=null,O=w;do{var ue=O.lane&-536870913,de=ue!==O.lane;if(de?(xt&ue)===ue:(f&ue)===ue){ue!==0&&ue===ql&&(Fb=!0),me!==null&&(me=me.next={lane:0,tag:O.tag,payload:O.payload,callback:null,next:null});e:{var $e=s,et=O;ue=a;var $t=u;switch(et.tag){case 1:if($e=et.payload,typeof $e=="function"){xe=$e.call($t,xe,ue);break e}xe=$e;break e;case 3:$e.flags=$e.flags&-65537|128;case 0:if($e=et.payload,ue=typeof $e=="function"?$e.call($t,xe,ue):$e,ue==null)break e;xe=g({},xe,ue);break e;case 2:pi=!0}}ue=O.callback,ue!==null&&(s.flags|=64,de&&(s.flags|=8192),de=y.callbacks,de===null?y.callbacks=[ue]:de.push(ue))}else de={lane:ue,tag:O.tag,payload:O.payload,callback:O.callback,next:null},me===null?(ce=me=de,X=xe):me=me.next=de,T|=ue;if(O=O.next,O===null){if(O=y.shared.pending,O===null)break;de=O,O=de.next,de.next=null,y.lastBaseUpdate=de,y.shared.pending=null}}while(!0);me===null&&(X=xe),y.baseState=X,y.firstBaseUpdate=ce,y.lastBaseUpdate=me,w===null&&(y.shared.lanes=0),Si|=T,s.lanes=T,s.memoizedState=xe}}function RD(s,a){if(typeof s!="function")throw Error(r(191,s));s.call(a)}function AD(s,a){var u=s.callbacks;if(u!==null)for(s.callbacks=null,s=0;s<u.length;s++)RD(u[s],a)}var Wl=P(null),ym=P(0);function MD(s,a){s=La,G(ym,s),G(Wl,a),La=s|a.baseLanes}function Hb(){G(ym,La),G(Wl,Wl.current)}function qb(){La=ym.current,L(Wl),L(ym)}var Dr=P(null),rs=null;function vi(s){var a=s.alternate;G(on,on.current&1),G(Dr,s),rs===null&&(a===null||Wl.current!==null||a.memoizedState!==null)&&(rs=s)}function Kb(s){G(on,on.current),G(Dr,s),rs===null&&(rs=s)}function DD(s){s.tag===22?(G(on,on.current),G(Dr,s),rs===null&&(rs=s)):yi()}function yi(){G(on,on.current),G(Dr,Dr.current)}function _r(s){L(Dr),rs===s&&(rs=null),L(on)}var on=P(0);function bm(s){for(var a=s;a!==null;){if(a.tag===13){var u=a.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Z0(u)||J0(u)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break;for(;a.sibling===null;){if(a.return===null||a.return===s)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var Ra=0,it=null,Lt=null,gn=null,wm=!1,Xl=!1,No=!1,Sm=0,ad=0,Ql=null,see=0;function tn(){throw Error(r(321))}function Gb(s,a){if(a===null)return!1;for(var u=0;u<a.length&&u<s.length;u++)if(!Ar(s[u],a[u]))return!1;return!0}function Yb(s,a,u,f,y,w){return Ra=w,it=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,M.H=s===null||s.memoizedState===null?p_:c0,No=!1,w=u(f,y),No=!1,Xl&&(w=OD(a,u,f,y)),_D(s),w}function _D(s){M.H=ld;var a=Lt!==null&&Lt.next!==null;if(Ra=0,gn=Lt=it=null,wm=!1,ad=0,Ql=null,a)throw Error(r(300));s===null||xn||(s=s.dependencies,s!==null&&fm(s)&&(xn=!0))}function OD(s,a,u,f){it=s;var y=0;do{if(Xl&&(Ql=null),ad=0,Xl=!1,25<=y)throw Error(r(301));if(y+=1,gn=Lt=null,s.updateQueue!=null){var w=s.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}M.H=g_,w=a(u,f)}while(Xl);return w}function aee(){var s=M.H,a=s.useState()[0];return a=typeof a.then=="function"?id(a):a,s=s.useState()[0],(Lt!==null?Lt.memoizedState:null)!==s&&(it.flags|=1024),a}function Wb(){var s=Sm!==0;return Sm=0,s}function Xb(s,a,u){a.updateQueue=s.updateQueue,a.flags&=-2053,s.lanes&=~u}function Qb(s){if(wm){for(s=s.memoizedState;s!==null;){var a=s.queue;a!==null&&(a.pending=null),s=s.next}wm=!1}Ra=0,gn=Lt=it=null,Xl=!1,ad=Sm=0,Ql=null}function nr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return gn===null?it.memoizedState=gn=s:gn=gn.next=s,gn}function ln(){if(Lt===null){var s=it.alternate;s=s!==null?s.memoizedState:null}else s=Lt.next;var a=gn===null?it.memoizedState:gn.next;if(a!==null)gn=a,Lt=s;else{if(s===null)throw it.alternate===null?Error(r(467)):Error(r(310));Lt=s,s={memoizedState:Lt.memoizedState,baseState:Lt.baseState,baseQueue:Lt.baseQueue,queue:Lt.queue,next:null},gn===null?it.memoizedState=gn=s:gn=gn.next=s}return gn}function jm(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function id(s){var a=ad;return ad+=1,Ql===null&&(Ql=[]),s=CD(Ql,s,a),a=it,(gn===null?a.memoizedState:gn.next)===null&&(a=a.alternate,M.H=a===null||a.memoizedState===null?p_:c0),s}function Cm(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return id(s);if(s.$$typeof===E)return Pn(s)}throw Error(r(438,String(s)))}function Zb(s){var a=null,u=it.updateQueue;if(u!==null&&(a=u.memoCache),a==null){var f=it.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(a={data:f.data.map(function(y){return y.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),u===null&&(u=jm(),it.updateQueue=u),u.memoCache=a,u=a.data[a.index],u===void 0)for(u=a.data[a.index]=Array(s),f=0;f<s;f++)u[f]=I;return a.index++,u}function Aa(s,a){return typeof a=="function"?a(s):a}function km(s){var a=ln();return Jb(a,Lt,s)}function Jb(s,a,u){var f=s.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=u;var y=s.baseQueue,w=f.pending;if(w!==null){if(y!==null){var T=y.next;y.next=w.next,w.next=T}a.baseQueue=y=w,f.pending=null}if(w=s.baseState,y===null)s.memoizedState=w;else{a=y.next;var O=T=null,X=null,ce=a,me=!1;do{var xe=ce.lane&-536870913;if(xe!==ce.lane?(xt&xe)===xe:(Ra&xe)===xe){var ue=ce.revertLane;if(ue===0)X!==null&&(X=X.next={lane:0,revertLane:0,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),xe===ql&&(me=!0);else if((Ra&ue)===ue){ce=ce.next,ue===ql&&(me=!0);continue}else xe={lane:0,revertLane:ce.revertLane,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},X===null?(O=X=xe,T=w):X=X.next=xe,it.lanes|=ue,Si|=ue;xe=ce.action,No&&u(w,xe),w=ce.hasEagerState?ce.eagerState:u(w,xe)}else ue={lane:xe,revertLane:ce.revertLane,gesture:ce.gesture,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},X===null?(O=X=ue,T=w):X=X.next=ue,it.lanes|=xe,Si|=xe;ce=ce.next}while(ce!==null&&ce!==a);if(X===null?T=w:X.next=O,!Ar(w,s.memoizedState)&&(xn=!0,me&&(u=Kl,u!==null)))throw u;s.memoizedState=w,s.baseState=T,s.baseQueue=X,f.lastRenderedState=w}return y===null&&(f.lanes=0),[s.memoizedState,f.dispatch]}function e0(s){var a=ln(),u=a.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=s;var f=u.dispatch,y=u.pending,w=a.memoizedState;if(y!==null){u.pending=null;var T=y=y.next;do w=s(w,T.action),T=T.next;while(T!==y);Ar(w,a.memoizedState)||(xn=!0),a.memoizedState=w,a.baseQueue===null&&(a.baseState=w),u.lastRenderedState=w}return[w,f]}function zD(s,a,u){var f=it,y=ln(),w=yt;if(w){if(u===void 0)throw Error(r(407));u=u()}else u=a();var T=!Ar((Lt||y).memoizedState,u);if(T&&(y.memoizedState=u,xn=!0),y=y.queue,r0(ID.bind(null,f,y,s),[s]),y.getSnapshot!==a||T||gn!==null&&gn.memoizedState.tag&1){if(f.flags|=2048,Zl(9,{destroy:void 0},LD.bind(null,f,y,u,a),null),Ut===null)throw Error(r(349));w||(Ra&127)!==0||PD(f,a,u)}return u}function PD(s,a,u){s.flags|=16384,s={getSnapshot:a,value:u},a=it.updateQueue,a===null?(a=jm(),it.updateQueue=a,a.stores=[s]):(u=a.stores,u===null?a.stores=[s]:u.push(s))}function LD(s,a,u,f){a.value=u,a.getSnapshot=f,$D(a)&&BD(s)}function ID(s,a,u){return u(function(){$D(a)&&BD(s)})}function $D(s){var a=s.getSnapshot;s=s.value;try{var u=a();return!Ar(s,u)}catch{return!0}}function BD(s){var a=xo(s,2);a!==null&&br(a,s,2)}function t0(s){var a=nr();if(typeof s=="function"){var u=s;if(s=u(),No){Oe(!0);try{u()}finally{Oe(!1)}}}return a.memoizedState=a.baseState=s,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Aa,lastRenderedState:s},a}function UD(s,a,u,f){return s.baseState=u,Jb(s,Lt,typeof f=="function"?f:Aa)}function iee(s,a,u,f,y){if(Em(s))throw Error(r(485));if(s=a.action,s!==null){var w={payload:y,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(T){w.listeners.push(T)}};M.T!==null?u(!0):w.isTransition=!1,f(w),u=a.pending,u===null?(w.next=a.pending=w,VD(a,w)):(w.next=u.next,a.pending=u.next=w)}}function VD(s,a){var u=a.action,f=a.payload,y=s.state;if(a.isTransition){var w=M.T,T={};M.T=T;try{var O=u(y,f),X=M.S;X!==null&&X(T,O),FD(s,a,O)}catch(ce){n0(s,a,ce)}finally{w!==null&&T.types!==null&&(w.types=T.types),M.T=w}}else try{w=u(y,f),FD(s,a,w)}catch(ce){n0(s,a,ce)}}function FD(s,a,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(f){HD(s,a,f)},function(f){return n0(s,a,f)}):HD(s,a,u)}function HD(s,a,u){a.status="fulfilled",a.value=u,qD(a),s.state=u,a=s.pending,a!==null&&(u=a.next,u===a?s.pending=null:(u=u.next,a.next=u,VD(s,u)))}function n0(s,a,u){var f=s.pending;if(s.pending=null,f!==null){f=f.next;do a.status="rejected",a.reason=u,qD(a),a=a.next;while(a!==f)}s.action=null}function qD(s){s=s.listeners;for(var a=0;a<s.length;a++)(0,s[a])()}function KD(s,a){return a}function GD(s,a){if(yt){var u=Ut.formState;if(u!==null){e:{var f=it;if(yt){if(Kt){t:{for(var y=Kt,w=ns;y.nodeType!==8;){if(!w){y=null;break t}if(y=ss(y.nextSibling),y===null){y=null;break t}}w=y.data,y=w==="F!"||w==="F"?y:null}if(y){Kt=ss(y.nextSibling),f=y.data==="F!";break e}}hi(f)}f=!1}f&&(a=u[0])}}return u=nr(),u.memoizedState=u.baseState=a,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:KD,lastRenderedState:a},u.queue=f,u=f_.bind(null,it,f),f.dispatch=u,f=t0(!1),w=l0.bind(null,it,!1,f.queue),f=nr(),y={state:a,dispatch:null,action:s,pending:null},f.queue=y,u=iee.bind(null,it,y,w,u),y.dispatch=u,f.memoizedState=s,[a,u,!1]}function YD(s){var a=ln();return WD(a,Lt,s)}function WD(s,a,u){if(a=Jb(s,a,KD)[0],s=km(Aa)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var f=id(a)}catch(T){throw T===Gl?pm:T}else f=a;a=ln();var y=a.queue,w=y.dispatch;return u!==a.memoizedState&&(it.flags|=2048,Zl(9,{destroy:void 0},oee.bind(null,y,u),null)),[f,w,s]}function oee(s,a){s.action=a}function XD(s){var a=ln(),u=Lt;if(u!==null)return WD(a,u,s);ln(),a=a.memoizedState,u=ln();var f=u.queue.dispatch;return u.memoizedState=s,[a,f,!1]}function Zl(s,a,u,f){return s={tag:s,create:u,deps:f,inst:a,next:null},a=it.updateQueue,a===null&&(a=jm(),it.updateQueue=a),u=a.lastEffect,u===null?a.lastEffect=s.next=s:(f=u.next,u.next=s,s.next=f,a.lastEffect=s),s}function QD(){return ln().memoizedState}function Nm(s,a,u,f){var y=nr();it.flags|=s,y.memoizedState=Zl(1|a,{destroy:void 0},u,f===void 0?null:f)}function Tm(s,a,u,f){var y=ln();f=f===void 0?null:f;var w=y.memoizedState.inst;Lt!==null&&f!==null&&Gb(f,Lt.memoizedState.deps)?y.memoizedState=Zl(a,w,u,f):(it.flags|=s,y.memoizedState=Zl(1|a,w,u,f))}function ZD(s,a){Nm(8390656,8,s,a)}function r0(s,a){Tm(2048,8,s,a)}function lee(s){it.flags|=4;var a=it.updateQueue;if(a===null)a=jm(),it.updateQueue=a,a.events=[s];else{var u=a.events;u===null?a.events=[s]:u.push(s)}}function JD(s){var a=ln().memoizedState;return lee({ref:a,nextImpl:s}),function(){if((Et&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}function e_(s,a){return Tm(4,2,s,a)}function t_(s,a){return Tm(4,4,s,a)}function n_(s,a){if(typeof a=="function"){s=s();var u=a(s);return function(){typeof u=="function"?u():a(null)}}if(a!=null)return s=s(),a.current=s,function(){a.current=null}}function r_(s,a,u){u=u!=null?u.concat([s]):null,Tm(4,4,n_.bind(null,a,s),u)}function s0(){}function s_(s,a){var u=ln();a=a===void 0?null:a;var f=u.memoizedState;return a!==null&&Gb(a,f[1])?f[0]:(u.memoizedState=[s,a],s)}function a_(s,a){var u=ln();a=a===void 0?null:a;var f=u.memoizedState;if(a!==null&&Gb(a,f[1]))return f[0];if(f=s(),No){Oe(!0);try{s()}finally{Oe(!1)}}return u.memoizedState=[f,a],f}function a0(s,a,u){return u===void 0||(Ra&1073741824)!==0&&(xt&261930)===0?s.memoizedState=a:(s.memoizedState=u,s=iO(),it.lanes|=s,Si|=s,u)}function i_(s,a,u,f){return Ar(u,a)?u:Wl.current!==null?(s=a0(s,u,f),Ar(s,a)||(xn=!0),s):(Ra&42)===0||(Ra&1073741824)!==0&&(xt&261930)===0?(xn=!0,s.memoizedState=u):(s=iO(),it.lanes|=s,Si|=s,a)}function o_(s,a,u,f,y){var w=U.p;U.p=w!==0&&8>w?w:8;var T=M.T,O={};M.T=O,l0(s,!1,a,u);try{var X=y(),ce=M.S;if(ce!==null&&ce(O,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var me=ree(X,f);od(s,a,me,Pr(s))}else od(s,a,f,Pr(s))}catch(xe){od(s,a,{then:function(){},status:"rejected",reason:xe},Pr())}finally{U.p=w,T!==null&&O.types!==null&&(T.types=O.types),M.T=T}}function cee(){}function i0(s,a,u,f){if(s.tag!==5)throw Error(r(476));var y=l_(s).queue;o_(s,y,a,K,u===null?cee:function(){return c_(s),u(f)})}function l_(s){var a=s.memoizedState;if(a!==null)return a;a={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Aa,lastRenderedState:K},next:null};var u={};return a.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Aa,lastRenderedState:u},next:null},s.memoizedState=a,s=s.alternate,s!==null&&(s.memoizedState=a),a}function c_(s){var a=l_(s);a.next===null&&(a=s.alternate.memoizedState),od(s,a.next.queue,{},Pr())}function o0(){return Pn(Cd)}function u_(){return ln().memoizedState}function d_(){return ln().memoizedState}function uee(s){for(var a=s.return;a!==null;){switch(a.tag){case 24:case 3:var u=Pr();s=gi(u);var f=xi(a,s,u);f!==null&&(br(f,a,u),nd(f,a,u)),a={cache:Pb()},s.payload=a;return}a=a.return}}function dee(s,a,u){var f=Pr();u={lane:f,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Em(s)?h_(a,u):(u=kb(s,a,u,f),u!==null&&(br(u,s,f),m_(u,a,f)))}function f_(s,a,u){var f=Pr();od(s,a,u,f)}function od(s,a,u,f){var y={lane:f,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Em(s))h_(a,y);else{var w=s.alternate;if(s.lanes===0&&(w===null||w.lanes===0)&&(w=a.lastRenderedReducer,w!==null))try{var T=a.lastRenderedState,O=w(T,u);if(y.hasEagerState=!0,y.eagerState=O,Ar(O,T))return lm(s,a,y,0),Ut===null&&om(),!1}catch{}finally{}if(u=kb(s,a,y,f),u!==null)return br(u,s,f),m_(u,a,f),!0}return!1}function l0(s,a,u,f){if(f={lane:2,revertLane:B0(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},Em(s)){if(a)throw Error(r(479))}else a=kb(s,u,f,2),a!==null&&br(a,s,2)}function Em(s){var a=s.alternate;return s===it||a!==null&&a===it}function h_(s,a){Xl=wm=!0;var u=s.pending;u===null?a.next=a:(a.next=u.next,u.next=a),s.pending=a}function m_(s,a,u){if((u&4194048)!==0){var f=a.lanes;f&=s.pendingLanes,u|=f,a.lanes=u,Ht(s,u)}}var ld={readContext:Pn,use:Cm,useCallback:tn,useContext:tn,useEffect:tn,useImperativeHandle:tn,useLayoutEffect:tn,useInsertionEffect:tn,useMemo:tn,useReducer:tn,useRef:tn,useState:tn,useDebugValue:tn,useDeferredValue:tn,useTransition:tn,useSyncExternalStore:tn,useId:tn,useHostTransitionStatus:tn,useFormState:tn,useActionState:tn,useOptimistic:tn,useMemoCache:tn,useCacheRefresh:tn};ld.useEffectEvent=tn;var p_={readContext:Pn,use:Cm,useCallback:function(s,a){return nr().memoizedState=[s,a===void 0?null:a],s},useContext:Pn,useEffect:ZD,useImperativeHandle:function(s,a,u){u=u!=null?u.concat([s]):null,Nm(4194308,4,n_.bind(null,a,s),u)},useLayoutEffect:function(s,a){return Nm(4194308,4,s,a)},useInsertionEffect:function(s,a){Nm(4,2,s,a)},useMemo:function(s,a){var u=nr();a=a===void 0?null:a;var f=s();if(No){Oe(!0);try{s()}finally{Oe(!1)}}return u.memoizedState=[f,a],f},useReducer:function(s,a,u){var f=nr();if(u!==void 0){var y=u(a);if(No){Oe(!0);try{u(a)}finally{Oe(!1)}}}else y=a;return f.memoizedState=f.baseState=y,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:y},f.queue=s,s=s.dispatch=dee.bind(null,it,s),[f.memoizedState,s]},useRef:function(s){var a=nr();return s={current:s},a.memoizedState=s},useState:function(s){s=t0(s);var a=s.queue,u=f_.bind(null,it,a);return a.dispatch=u,[s.memoizedState,u]},useDebugValue:s0,useDeferredValue:function(s,a){var u=nr();return a0(u,s,a)},useTransition:function(){var s=t0(!1);return s=o_.bind(null,it,s.queue,!0,!1),nr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,a,u){var f=it,y=nr();if(yt){if(u===void 0)throw Error(r(407));u=u()}else{if(u=a(),Ut===null)throw Error(r(349));(xt&127)!==0||PD(f,a,u)}y.memoizedState=u;var w={value:u,getSnapshot:a};return y.queue=w,ZD(ID.bind(null,f,w,s),[s]),f.flags|=2048,Zl(9,{destroy:void 0},LD.bind(null,f,w,u,a),null),u},useId:function(){var s=nr(),a=Ut.identifierPrefix;if(yt){var u=qs,f=Hs;u=(f&~(1<<32-lt(f)-1)).toString(32)+u,a="_"+a+"R_"+u,u=Sm++,0<u&&(a+="H"+u.toString(32)),a+="_"}else u=see++,a="_"+a+"r_"+u.toString(32)+"_";return s.memoizedState=a},useHostTransitionStatus:o0,useFormState:GD,useActionState:GD,useOptimistic:function(s){var a=nr();a.memoizedState=a.baseState=s;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=u,a=l0.bind(null,it,!0,u),u.dispatch=a,[s,a]},useMemoCache:Zb,useCacheRefresh:function(){return nr().memoizedState=uee.bind(null,it)},useEffectEvent:function(s){var a=nr(),u={impl:s};return a.memoizedState=u,function(){if((Et&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},c0={readContext:Pn,use:Cm,useCallback:s_,useContext:Pn,useEffect:r0,useImperativeHandle:r_,useInsertionEffect:e_,useLayoutEffect:t_,useMemo:a_,useReducer:km,useRef:QD,useState:function(){return km(Aa)},useDebugValue:s0,useDeferredValue:function(s,a){var u=ln();return i_(u,Lt.memoizedState,s,a)},useTransition:function(){var s=km(Aa)[0],a=ln().memoizedState;return[typeof s=="boolean"?s:id(s),a]},useSyncExternalStore:zD,useId:u_,useHostTransitionStatus:o0,useFormState:YD,useActionState:YD,useOptimistic:function(s,a){var u=ln();return UD(u,Lt,s,a)},useMemoCache:Zb,useCacheRefresh:d_};c0.useEffectEvent=JD;var g_={readContext:Pn,use:Cm,useCallback:s_,useContext:Pn,useEffect:r0,useImperativeHandle:r_,useInsertionEffect:e_,useLayoutEffect:t_,useMemo:a_,useReducer:e0,useRef:QD,useState:function(){return e0(Aa)},useDebugValue:s0,useDeferredValue:function(s,a){var u=ln();return Lt===null?a0(u,s,a):i_(u,Lt.memoizedState,s,a)},useTransition:function(){var s=e0(Aa)[0],a=ln().memoizedState;return[typeof s=="boolean"?s:id(s),a]},useSyncExternalStore:zD,useId:u_,useHostTransitionStatus:o0,useFormState:XD,useActionState:XD,useOptimistic:function(s,a){var u=ln();return Lt!==null?UD(u,Lt,s,a):(u.baseState=s,[s,u.queue.dispatch])},useMemoCache:Zb,useCacheRefresh:d_};g_.useEffectEvent=JD;function u0(s,a,u,f){a=s.memoizedState,u=u(f,a),u=u==null?a:g({},a,u),s.memoizedState=u,s.lanes===0&&(s.updateQueue.baseState=u)}var d0={enqueueSetState:function(s,a,u){s=s._reactInternals;var f=Pr(),y=gi(f);y.payload=a,u!=null&&(y.callback=u),a=xi(s,y,f),a!==null&&(br(a,s,f),nd(a,s,f))},enqueueReplaceState:function(s,a,u){s=s._reactInternals;var f=Pr(),y=gi(f);y.tag=1,y.payload=a,u!=null&&(y.callback=u),a=xi(s,y,f),a!==null&&(br(a,s,f),nd(a,s,f))},enqueueForceUpdate:function(s,a){s=s._reactInternals;var u=Pr(),f=gi(u);f.tag=2,a!=null&&(f.callback=a),a=xi(s,f,u),a!==null&&(br(a,s,u),nd(a,s,u))}};function x_(s,a,u,f,y,w,T){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(f,w,T):a.prototype&&a.prototype.isPureReactComponent?!Yu(u,f)||!Yu(y,w):!0}function v_(s,a,u,f){s=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(u,f),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(u,f),a.state!==s&&d0.enqueueReplaceState(a,a.state,null)}function To(s,a){var u=a;if("ref"in a){u={};for(var f in a)f!=="ref"&&(u[f]=a[f])}if(s=s.defaultProps){u===a&&(u=g({},u));for(var y in s)u[y]===void 0&&(u[y]=s[y])}return u}function y_(s){im(s)}function b_(s){console.error(s)}function w_(s){im(s)}function Rm(s,a){try{var u=s.onUncaughtError;u(a.value,{componentStack:a.stack})}catch(f){setTimeout(function(){throw f})}}function S_(s,a,u){try{var f=s.onCaughtError;f(u.value,{componentStack:u.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function f0(s,a,u){return u=gi(u),u.tag=3,u.payload={element:null},u.callback=function(){Rm(s,a)},u}function j_(s){return s=gi(s),s.tag=3,s}function C_(s,a,u,f){var y=u.type.getDerivedStateFromError;if(typeof y=="function"){var w=f.value;s.payload=function(){return y(w)},s.callback=function(){S_(a,u,f)}}var T=u.stateNode;T!==null&&typeof T.componentDidCatch=="function"&&(s.callback=function(){S_(a,u,f),typeof y!="function"&&(ji===null?ji=new Set([this]):ji.add(this));var O=f.stack;this.componentDidCatch(f.value,{componentStack:O!==null?O:""})})}function fee(s,a,u,f,y){if(u.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(a=u.alternate,a!==null&&Hl(a,u,y,!0),u=Dr.current,u!==null){switch(u.tag){case 31:case 13:return rs===null?Um():u.alternate===null&&nn===0&&(nn=3),u.flags&=-257,u.flags|=65536,u.lanes=y,f===gm?u.flags|=16384:(a=u.updateQueue,a===null?u.updateQueue=new Set([f]):a.add(f),L0(s,f,y)),!1;case 22:return u.flags|=65536,f===gm?u.flags|=16384:(a=u.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([f])},u.updateQueue=a):(u=a.retryQueue,u===null?a.retryQueue=new Set([f]):u.add(f)),L0(s,f,y)),!1}throw Error(r(435,u.tag))}return L0(s,f,y),Um(),!1}if(yt)return a=Dr.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=y,f!==Mb&&(s=Error(r(422),{cause:f}),Qu(Jr(s,u)))):(f!==Mb&&(a=Error(r(423),{cause:f}),Qu(Jr(a,u))),s=s.current.alternate,s.flags|=65536,y&=-y,s.lanes|=y,f=Jr(f,u),y=f0(s.stateNode,f,y),Vb(s,y),nn!==4&&(nn=2)),!1;var w=Error(r(520),{cause:f});if(w=Jr(w,u),gd===null?gd=[w]:gd.push(w),nn!==4&&(nn=2),a===null)return!0;f=Jr(f,u),u=a;do{switch(u.tag){case 3:return u.flags|=65536,s=y&-y,u.lanes|=s,s=f0(u.stateNode,f,s),Vb(u,s),!1;case 1:if(a=u.type,w=u.stateNode,(u.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(ji===null||!ji.has(w))))return u.flags|=65536,y&=-y,u.lanes|=y,y=j_(y),C_(y,s,u,f),Vb(u,y),!1}u=u.return}while(u!==null);return!1}var h0=Error(r(461)),xn=!1;function Ln(s,a,u,f){a.child=s===null?ED(a,null,u,f):ko(a,s.child,u,f)}function k_(s,a,u,f,y){u=u.render;var w=a.ref;if("ref"in f){var T={};for(var O in f)O!=="ref"&&(T[O]=f[O])}else T=f;return wo(a),f=Yb(s,a,u,T,w,y),O=Wb(),s!==null&&!xn?(Xb(s,a,y),Ma(s,a,y)):(yt&&O&&Rb(a),a.flags|=1,Ln(s,a,f,y),a.child)}function N_(s,a,u,f,y){if(s===null){var w=u.type;return typeof w=="function"&&!Nb(w)&&w.defaultProps===void 0&&u.compare===null?(a.tag=15,a.type=w,T_(s,a,w,f,y)):(s=um(u.type,null,f,a,a.mode,y),s.ref=a.ref,s.return=a,a.child=s)}if(w=s.child,!w0(s,y)){var T=w.memoizedProps;if(u=u.compare,u=u!==null?u:Yu,u(T,f)&&s.ref===a.ref)return Ma(s,a,y)}return a.flags|=1,s=ka(w,f),s.ref=a.ref,s.return=a,a.child=s}function T_(s,a,u,f,y){if(s!==null){var w=s.memoizedProps;if(Yu(w,f)&&s.ref===a.ref)if(xn=!1,a.pendingProps=f=w,w0(s,y))(s.flags&131072)!==0&&(xn=!0);else return a.lanes=s.lanes,Ma(s,a,y)}return m0(s,a,u,f,y)}function E_(s,a,u,f){var y=f.children,w=s!==null?s.memoizedState:null;if(s===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.mode==="hidden"){if((a.flags&128)!==0){if(w=w!==null?w.baseLanes|u:u,s!==null){for(f=a.child=s.child,y=0;f!==null;)y=y|f.lanes|f.childLanes,f=f.sibling;f=y&~w}else f=0,a.child=null;return R_(s,a,w,u,f)}if((u&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},s!==null&&mm(a,w!==null?w.cachePool:null),w!==null?MD(a,w):Hb(),DD(a);else return f=a.lanes=536870912,R_(s,a,w!==null?w.baseLanes|u:u,u,f)}else w!==null?(mm(a,w.cachePool),MD(a,w),yi(),a.memoizedState=null):(s!==null&&mm(a,null),Hb(),yi());return Ln(s,a,y,u),a.child}function cd(s,a){return s!==null&&s.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function R_(s,a,u,f,y){var w=Ib();return w=w===null?null:{parent:pn._currentValue,pool:w},a.memoizedState={baseLanes:u,cachePool:w},s!==null&&mm(a,null),Hb(),DD(a),s!==null&&Hl(s,a,f,!0),a.childLanes=y,null}function Am(s,a){return a=Dm({mode:a.mode,children:a.children},s.mode),a.ref=s.ref,s.child=a,a.return=s,a}function A_(s,a,u){return ko(a,s.child,null,u),s=Am(a,a.pendingProps),s.flags|=2,_r(a),a.memoizedState=null,s}function hee(s,a,u){var f=a.pendingProps,y=(a.flags&128)!==0;if(a.flags&=-129,s===null){if(yt){if(f.mode==="hidden")return s=Am(a,f),a.lanes=536870912,cd(null,s);if(Kb(a),(s=Kt)?(s=VO(s,ns),s=s!==null&&s.data==="&"?s:null,s!==null&&(a.memoizedState={dehydrated:s,treeContext:di!==null?{id:Hs,overflow:qs}:null,retryLane:536870912,hydrationErrors:null},u=hD(s),u.return=a,a.child=u,zn=a,Kt=null)):s=null,s===null)throw hi(a);return a.lanes=536870912,null}return Am(a,f)}var w=s.memoizedState;if(w!==null){var T=w.dehydrated;if(Kb(a),y)if(a.flags&256)a.flags&=-257,a=A_(s,a,u);else if(a.memoizedState!==null)a.child=s.child,a.flags|=128,a=null;else throw Error(r(558));else if(xn||Hl(s,a,u,!1),y=(u&s.childLanes)!==0,xn||y){if(f=Ut,f!==null&&(T=Mn(f,u),T!==0&&T!==w.retryLane))throw w.retryLane=T,xo(s,T),br(f,s,T),h0;Um(),a=A_(s,a,u)}else s=w.treeContext,Kt=ss(T.nextSibling),zn=a,yt=!0,fi=null,ns=!1,s!==null&&gD(a,s),a=Am(a,f),a.flags|=4096;return a}return s=ka(s.child,{mode:f.mode,children:f.children}),s.ref=a.ref,a.child=s,s.return=a,s}function Mm(s,a){var u=a.ref;if(u===null)s!==null&&s.ref!==null&&(a.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(s===null||s.ref!==u)&&(a.flags|=4194816)}}function m0(s,a,u,f,y){return wo(a),u=Yb(s,a,u,f,void 0,y),f=Wb(),s!==null&&!xn?(Xb(s,a,y),Ma(s,a,y)):(yt&&f&&Rb(a),a.flags|=1,Ln(s,a,u,y),a.child)}function M_(s,a,u,f,y,w){return wo(a),a.updateQueue=null,u=OD(a,f,u,y),_D(s),f=Wb(),s!==null&&!xn?(Xb(s,a,w),Ma(s,a,w)):(yt&&f&&Rb(a),a.flags|=1,Ln(s,a,u,w),a.child)}function D_(s,a,u,f,y){if(wo(a),a.stateNode===null){var w=Bl,T=u.contextType;typeof T=="object"&&T!==null&&(w=Pn(T)),w=new u(f,w),a.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=d0,a.stateNode=w,w._reactInternals=a,w=a.stateNode,w.props=f,w.state=a.memoizedState,w.refs={},Bb(a),T=u.contextType,w.context=typeof T=="object"&&T!==null?Pn(T):Bl,w.state=a.memoizedState,T=u.getDerivedStateFromProps,typeof T=="function"&&(u0(a,u,T,f),w.state=a.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(T=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),T!==w.state&&d0.enqueueReplaceState(w,w.state,null),sd(a,f,w,y),rd(),w.state=a.memoizedState),typeof w.componentDidMount=="function"&&(a.flags|=4194308),f=!0}else if(s===null){w=a.stateNode;var O=a.memoizedProps,X=To(u,O);w.props=X;var ce=w.context,me=u.contextType;T=Bl,typeof me=="object"&&me!==null&&(T=Pn(me));var xe=u.getDerivedStateFromProps;me=typeof xe=="function"||typeof w.getSnapshotBeforeUpdate=="function",O=a.pendingProps!==O,me||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(O||ce!==T)&&v_(a,w,f,T),pi=!1;var ue=a.memoizedState;w.state=ue,sd(a,f,w,y),rd(),ce=a.memoizedState,O||ue!==ce||pi?(typeof xe=="function"&&(u0(a,u,xe,f),ce=a.memoizedState),(X=pi||x_(a,u,X,f,ue,ce,T))?(me||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(a.flags|=4194308)):(typeof w.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=f,a.memoizedState=ce),w.props=f,w.state=ce,w.context=T,f=X):(typeof w.componentDidMount=="function"&&(a.flags|=4194308),f=!1)}else{w=a.stateNode,Ub(s,a),T=a.memoizedProps,me=To(u,T),w.props=me,xe=a.pendingProps,ue=w.context,ce=u.contextType,X=Bl,typeof ce=="object"&&ce!==null&&(X=Pn(ce)),O=u.getDerivedStateFromProps,(ce=typeof O=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(T!==xe||ue!==X)&&v_(a,w,f,X),pi=!1,ue=a.memoizedState,w.state=ue,sd(a,f,w,y),rd();var de=a.memoizedState;T!==xe||ue!==de||pi||s!==null&&s.dependencies!==null&&fm(s.dependencies)?(typeof O=="function"&&(u0(a,u,O,f),de=a.memoizedState),(me=pi||x_(a,u,me,f,ue,de,X)||s!==null&&s.dependencies!==null&&fm(s.dependencies))?(ce||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(f,de,X),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(f,de,X)),typeof w.componentDidUpdate=="function"&&(a.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof w.componentDidUpdate!="function"||T===s.memoizedProps&&ue===s.memoizedState||(a.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||T===s.memoizedProps&&ue===s.memoizedState||(a.flags|=1024),a.memoizedProps=f,a.memoizedState=de),w.props=f,w.state=de,w.context=X,f=me):(typeof w.componentDidUpdate!="function"||T===s.memoizedProps&&ue===s.memoizedState||(a.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||T===s.memoizedProps&&ue===s.memoizedState||(a.flags|=1024),f=!1)}return w=f,Mm(s,a),f=(a.flags&128)!==0,w||f?(w=a.stateNode,u=f&&typeof u.getDerivedStateFromError!="function"?null:w.render(),a.flags|=1,s!==null&&f?(a.child=ko(a,s.child,null,y),a.child=ko(a,null,u,y)):Ln(s,a,u,y),a.memoizedState=w.state,s=a.child):s=Ma(s,a,y),s}function __(s,a,u,f){return yo(),a.flags|=256,Ln(s,a,u,f),a.child}var p0={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function g0(s){return{baseLanes:s,cachePool:SD()}}function x0(s,a,u){return s=s!==null?s.childLanes&~u:0,a&&(s|=zr),s}function O_(s,a,u){var f=a.pendingProps,y=!1,w=(a.flags&128)!==0,T;if((T=w)||(T=s!==null&&s.memoizedState===null?!1:(on.current&2)!==0),T&&(y=!0,a.flags&=-129),T=(a.flags&32)!==0,a.flags&=-33,s===null){if(yt){if(y?vi(a):yi(),(s=Kt)?(s=VO(s,ns),s=s!==null&&s.data!=="&"?s:null,s!==null&&(a.memoizedState={dehydrated:s,treeContext:di!==null?{id:Hs,overflow:qs}:null,retryLane:536870912,hydrationErrors:null},u=hD(s),u.return=a,a.child=u,zn=a,Kt=null)):s=null,s===null)throw hi(a);return J0(s)?a.lanes=32:a.lanes=536870912,null}var O=f.children;return f=f.fallback,y?(yi(),y=a.mode,O=Dm({mode:"hidden",children:O},y),f=vo(f,y,u,null),O.return=a,f.return=a,O.sibling=f,a.child=O,f=a.child,f.memoizedState=g0(u),f.childLanes=x0(s,T,u),a.memoizedState=p0,cd(null,f)):(vi(a),v0(a,O))}var X=s.memoizedState;if(X!==null&&(O=X.dehydrated,O!==null)){if(w)a.flags&256?(vi(a),a.flags&=-257,a=y0(s,a,u)):a.memoizedState!==null?(yi(),a.child=s.child,a.flags|=128,a=null):(yi(),O=f.fallback,y=a.mode,f=Dm({mode:"visible",children:f.children},y),O=vo(O,y,u,null),O.flags|=2,f.return=a,O.return=a,f.sibling=O,a.child=f,ko(a,s.child,null,u),f=a.child,f.memoizedState=g0(u),f.childLanes=x0(s,T,u),a.memoizedState=p0,a=cd(null,f));else if(vi(a),J0(O)){if(T=O.nextSibling&&O.nextSibling.dataset,T)var ce=T.dgst;T=ce,f=Error(r(419)),f.stack="",f.digest=T,Qu({value:f,source:null,stack:null}),a=y0(s,a,u)}else if(xn||Hl(s,a,u,!1),T=(u&s.childLanes)!==0,xn||T){if(T=Ut,T!==null&&(f=Mn(T,u),f!==0&&f!==X.retryLane))throw X.retryLane=f,xo(s,f),br(T,s,f),h0;Z0(O)||Um(),a=y0(s,a,u)}else Z0(O)?(a.flags|=192,a.child=s.child,a=null):(s=X.treeContext,Kt=ss(O.nextSibling),zn=a,yt=!0,fi=null,ns=!1,s!==null&&gD(a,s),a=v0(a,f.children),a.flags|=4096);return a}return y?(yi(),O=f.fallback,y=a.mode,X=s.child,ce=X.sibling,f=ka(X,{mode:"hidden",children:f.children}),f.subtreeFlags=X.subtreeFlags&65011712,ce!==null?O=ka(ce,O):(O=vo(O,y,u,null),O.flags|=2),O.return=a,f.return=a,f.sibling=O,a.child=f,cd(null,f),f=a.child,O=s.child.memoizedState,O===null?O=g0(u):(y=O.cachePool,y!==null?(X=pn._currentValue,y=y.parent!==X?{parent:X,pool:X}:y):y=SD(),O={baseLanes:O.baseLanes|u,cachePool:y}),f.memoizedState=O,f.childLanes=x0(s,T,u),a.memoizedState=p0,cd(s.child,f)):(vi(a),u=s.child,s=u.sibling,u=ka(u,{mode:"visible",children:f.children}),u.return=a,u.sibling=null,s!==null&&(T=a.deletions,T===null?(a.deletions=[s],a.flags|=16):T.push(s)),a.child=u,a.memoizedState=null,u)}function v0(s,a){return a=Dm({mode:"visible",children:a},s.mode),a.return=s,s.child=a}function Dm(s,a){return s=Mr(22,s,null,a),s.lanes=0,s}function y0(s,a,u){return ko(a,s.child,null,u),s=v0(a,a.pendingProps.children),s.flags|=2,a.memoizedState=null,s}function z_(s,a,u){s.lanes|=a;var f=s.alternate;f!==null&&(f.lanes|=a),Ob(s.return,a,u)}function b0(s,a,u,f,y,w){var T=s.memoizedState;T===null?s.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:f,tail:u,tailMode:y,treeForkCount:w}:(T.isBackwards=a,T.rendering=null,T.renderingStartTime=0,T.last=f,T.tail=u,T.tailMode=y,T.treeForkCount=w)}function P_(s,a,u){var f=a.pendingProps,y=f.revealOrder,w=f.tail;f=f.children;var T=on.current,O=(T&2)!==0;if(O?(T=T&1|2,a.flags|=128):T&=1,G(on,T),Ln(s,a,f,u),f=yt?Xu:0,!O&&s!==null&&(s.flags&128)!==0)e:for(s=a.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&z_(s,u,a);else if(s.tag===19)z_(s,u,a);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break e;for(;s.sibling===null;){if(s.return===null||s.return===a)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(y){case"forwards":for(u=a.child,y=null;u!==null;)s=u.alternate,s!==null&&bm(s)===null&&(y=u),u=u.sibling;u=y,u===null?(y=a.child,a.child=null):(y=u.sibling,u.sibling=null),b0(a,!1,y,u,w,f);break;case"backwards":case"unstable_legacy-backwards":for(u=null,y=a.child,a.child=null;y!==null;){if(s=y.alternate,s!==null&&bm(s)===null){a.child=y;break}s=y.sibling,y.sibling=u,u=y,y=s}b0(a,!0,u,null,w,f);break;case"together":b0(a,!1,null,null,void 0,f);break;default:a.memoizedState=null}return a.child}function Ma(s,a,u){if(s!==null&&(a.dependencies=s.dependencies),Si|=a.lanes,(u&a.childLanes)===0)if(s!==null){if(Hl(s,a,u,!1),(u&a.childLanes)===0)return null}else return null;if(s!==null&&a.child!==s.child)throw Error(r(153));if(a.child!==null){for(s=a.child,u=ka(s,s.pendingProps),a.child=u,u.return=a;s.sibling!==null;)s=s.sibling,u=u.sibling=ka(s,s.pendingProps),u.return=a;u.sibling=null}return a.child}function w0(s,a){return(s.lanes&a)!==0?!0:(s=s.dependencies,!!(s!==null&&fm(s)))}function mee(s,a,u){switch(a.tag){case 3:ie(a,a.stateNode.containerInfo),mi(a,pn,s.memoizedState.cache),yo();break;case 27:case 5:ve(a);break;case 4:ie(a,a.stateNode.containerInfo);break;case 10:mi(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,Kb(a),null;break;case 13:var f=a.memoizedState;if(f!==null)return f.dehydrated!==null?(vi(a),a.flags|=128,null):(u&a.child.childLanes)!==0?O_(s,a,u):(vi(a),s=Ma(s,a,u),s!==null?s.sibling:null);vi(a);break;case 19:var y=(s.flags&128)!==0;if(f=(u&a.childLanes)!==0,f||(Hl(s,a,u,!1),f=(u&a.childLanes)!==0),y){if(f)return P_(s,a,u);a.flags|=128}if(y=a.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),G(on,on.current),f)break;return null;case 22:return a.lanes=0,E_(s,a,u,a.pendingProps);case 24:mi(a,pn,s.memoizedState.cache)}return Ma(s,a,u)}function L_(s,a,u){if(s!==null)if(s.memoizedProps!==a.pendingProps)xn=!0;else{if(!w0(s,u)&&(a.flags&128)===0)return xn=!1,mee(s,a,u);xn=(s.flags&131072)!==0}else xn=!1,yt&&(a.flags&1048576)!==0&&pD(a,Xu,a.index);switch(a.lanes=0,a.tag){case 16:e:{var f=a.pendingProps;if(s=jo(a.elementType),a.type=s,typeof s=="function")Nb(s)?(f=To(s,f),a.tag=1,a=D_(null,a,s,f,u)):(a.tag=0,a=m0(null,a,s,f,u));else{if(s!=null){var y=s.$$typeof;if(y===R){a.tag=11,a=k_(null,a,s,f,u);break e}else if(y===z){a.tag=14,a=N_(null,a,s,f,u);break e}}throw a=ee(s)||s,Error(r(306,a,""))}}return a;case 0:return m0(s,a,a.type,a.pendingProps,u);case 1:return f=a.type,y=To(f,a.pendingProps),D_(s,a,f,y,u);case 3:e:{if(ie(a,a.stateNode.containerInfo),s===null)throw Error(r(387));f=a.pendingProps;var w=a.memoizedState;y=w.element,Ub(s,a),sd(a,f,null,u);var T=a.memoizedState;if(f=T.cache,mi(a,pn,f),f!==w.cache&&zb(a,[pn],u,!0),rd(),f=T.element,w.isDehydrated)if(w={element:f,isDehydrated:!1,cache:T.cache},a.updateQueue.baseState=w,a.memoizedState=w,a.flags&256){a=__(s,a,f,u);break e}else if(f!==y){y=Jr(Error(r(424)),a),Qu(y),a=__(s,a,f,u);break e}else{switch(s=a.stateNode.containerInfo,s.nodeType){case 9:s=s.body;break;default:s=s.nodeName==="HTML"?s.ownerDocument.body:s}for(Kt=ss(s.firstChild),zn=a,yt=!0,fi=null,ns=!0,u=ED(a,null,f,u),a.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(yo(),f===y){a=Ma(s,a,u);break e}Ln(s,a,f,u)}a=a.child}return a;case 26:return Mm(s,a),s===null?(u=YO(a.type,null,a.pendingProps,null))?a.memoizedState=u:yt||(u=a.type,s=a.pendingProps,f=Ym(se.current).createElement(u),f[Cn]=a,f[kn]=s,In(f,u,s),Yt(f),a.stateNode=f):a.memoizedState=YO(a.type,s.memoizedProps,a.pendingProps,s.memoizedState),null;case 27:return ve(a),s===null&&yt&&(f=a.stateNode=qO(a.type,a.pendingProps,se.current),zn=a,ns=!0,y=Kt,Ti(a.type)?(ew=y,Kt=ss(f.firstChild)):Kt=y),Ln(s,a,a.pendingProps.children,u),Mm(s,a),s===null&&(a.flags|=4194304),a.child;case 5:return s===null&&yt&&((y=f=Kt)&&(f=Hee(f,a.type,a.pendingProps,ns),f!==null?(a.stateNode=f,zn=a,Kt=ss(f.firstChild),ns=!1,y=!0):y=!1),y||hi(a)),ve(a),y=a.type,w=a.pendingProps,T=s!==null?s.memoizedProps:null,f=w.children,W0(y,w)?f=null:T!==null&&W0(y,T)&&(a.flags|=32),a.memoizedState!==null&&(y=Yb(s,a,aee,null,null,u),Cd._currentValue=y),Mm(s,a),Ln(s,a,f,u),a.child;case 6:return s===null&&yt&&((s=u=Kt)&&(u=qee(u,a.pendingProps,ns),u!==null?(a.stateNode=u,zn=a,Kt=null,s=!0):s=!1),s||hi(a)),null;case 13:return O_(s,a,u);case 4:return ie(a,a.stateNode.containerInfo),f=a.pendingProps,s===null?a.child=ko(a,null,f,u):Ln(s,a,f,u),a.child;case 11:return k_(s,a,a.type,a.pendingProps,u);case 7:return Ln(s,a,a.pendingProps,u),a.child;case 8:return Ln(s,a,a.pendingProps.children,u),a.child;case 12:return Ln(s,a,a.pendingProps.children,u),a.child;case 10:return f=a.pendingProps,mi(a,a.type,f.value),Ln(s,a,f.children,u),a.child;case 9:return y=a.type._context,f=a.pendingProps.children,wo(a),y=Pn(y),f=f(y),a.flags|=1,Ln(s,a,f,u),a.child;case 14:return N_(s,a,a.type,a.pendingProps,u);case 15:return T_(s,a,a.type,a.pendingProps,u);case 19:return P_(s,a,u);case 31:return hee(s,a,u);case 22:return E_(s,a,u,a.pendingProps);case 24:return wo(a),f=Pn(pn),s===null?(y=Ib(),y===null&&(y=Ut,w=Pb(),y.pooledCache=w,w.refCount++,w!==null&&(y.pooledCacheLanes|=u),y=w),a.memoizedState={parent:f,cache:y},Bb(a),mi(a,pn,y)):((s.lanes&u)!==0&&(Ub(s,a),sd(a,null,null,u),rd()),y=s.memoizedState,w=a.memoizedState,y.parent!==f?(y={parent:f,cache:f},a.memoizedState=y,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=y),mi(a,pn,f)):(f=w.cache,mi(a,pn,f),f!==y.cache&&zb(a,[pn],u,!0))),Ln(s,a,a.pendingProps.children,u),a.child;case 29:throw a.pendingProps}throw Error(r(156,a.tag))}function Da(s){s.flags|=4}function S0(s,a,u,f,y){if((a=(s.mode&32)!==0)&&(a=!1),a){if(s.flags|=16777216,(y&335544128)===y)if(s.stateNode.complete)s.flags|=8192;else if(uO())s.flags|=8192;else throw Co=gm,$b}else s.flags&=-16777217}function I_(s,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!JO(a))if(uO())s.flags|=8192;else throw Co=gm,$b}function _m(s,a){a!==null&&(s.flags|=4),s.flags&16384&&(a=s.tag!==22?Qt():536870912,s.lanes|=a,nc|=a)}function ud(s,a){if(!yt)switch(s.tailMode){case"hidden":a=s.tail;for(var u=null;a!==null;)a.alternate!==null&&(u=a),a=a.sibling;u===null?s.tail=null:u.sibling=null;break;case"collapsed":u=s.tail;for(var f=null;u!==null;)u.alternate!==null&&(f=u),u=u.sibling;f===null?a||s.tail===null?s.tail=null:s.tail.sibling=null:f.sibling=null}}function Gt(s){var a=s.alternate!==null&&s.alternate.child===s.child,u=0,f=0;if(a)for(var y=s.child;y!==null;)u|=y.lanes|y.childLanes,f|=y.subtreeFlags&65011712,f|=y.flags&65011712,y.return=s,y=y.sibling;else for(y=s.child;y!==null;)u|=y.lanes|y.childLanes,f|=y.subtreeFlags,f|=y.flags,y.return=s,y=y.sibling;return s.subtreeFlags|=f,s.childLanes=u,a}function pee(s,a,u){var f=a.pendingProps;switch(Ab(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Gt(a),null;case 1:return Gt(a),null;case 3:return u=a.stateNode,f=null,s!==null&&(f=s.memoizedState.cache),a.memoizedState.cache!==f&&(a.flags|=2048),Ea(pn),Z(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(s===null||s.child===null)&&(Fl(a)?Da(a):s===null||s.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Db())),Gt(a),null;case 26:var y=a.type,w=a.memoizedState;return s===null?(Da(a),w!==null?(Gt(a),I_(a,w)):(Gt(a),S0(a,y,null,f,u))):w?w!==s.memoizedState?(Da(a),Gt(a),I_(a,w)):(Gt(a),a.flags&=-16777217):(s=s.memoizedProps,s!==f&&Da(a),Gt(a),S0(a,y,s,f,u)),null;case 27:if(Ee(a),u=se.current,y=a.type,s!==null&&a.stateNode!=null)s.memoizedProps!==f&&Da(a);else{if(!f){if(a.stateNode===null)throw Error(r(166));return Gt(a),null}s=J.current,Fl(a)?xD(a):(s=qO(y,f,u),a.stateNode=s,Da(a))}return Gt(a),null;case 5:if(Ee(a),y=a.type,s!==null&&a.stateNode!=null)s.memoizedProps!==f&&Da(a);else{if(!f){if(a.stateNode===null)throw Error(r(166));return Gt(a),null}if(w=J.current,Fl(a))xD(a);else{var T=Ym(se.current);switch(w){case 1:w=T.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:w=T.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":w=T.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":w=T.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":w=T.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof f.is=="string"?T.createElement("select",{is:f.is}):T.createElement("select"),f.multiple?w.multiple=!0:f.size&&(w.size=f.size);break;default:w=typeof f.is=="string"?T.createElement(y,{is:f.is}):T.createElement(y)}}w[Cn]=a,w[kn]=f;e:for(T=a.child;T!==null;){if(T.tag===5||T.tag===6)w.appendChild(T.stateNode);else if(T.tag!==4&&T.tag!==27&&T.child!==null){T.child.return=T,T=T.child;continue}if(T===a)break e;for(;T.sibling===null;){if(T.return===null||T.return===a)break e;T=T.return}T.sibling.return=T.return,T=T.sibling}a.stateNode=w;e:switch(In(w,y,f),y){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}f&&Da(a)}}return Gt(a),S0(a,a.type,s===null?null:s.memoizedProps,a.pendingProps,u),null;case 6:if(s&&a.stateNode!=null)s.memoizedProps!==f&&Da(a);else{if(typeof f!="string"&&a.stateNode===null)throw Error(r(166));if(s=se.current,Fl(a)){if(s=a.stateNode,u=a.memoizedProps,f=null,y=zn,y!==null)switch(y.tag){case 27:case 5:f=y.memoizedProps}s[Cn]=a,s=!!(s.nodeValue===u||f!==null&&f.suppressHydrationWarning===!0||OO(s.nodeValue,u)),s||hi(a,!0)}else s=Ym(s).createTextNode(f),s[Cn]=a,a.stateNode=s}return Gt(a),null;case 31:if(u=a.memoizedState,s===null||s.memoizedState!==null){if(f=Fl(a),u!==null){if(s===null){if(!f)throw Error(r(318));if(s=a.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[Cn]=a}else yo(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Gt(a),s=!1}else u=Db(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=u),s=!0;if(!s)return a.flags&256?(_r(a),a):(_r(a),null);if((a.flags&128)!==0)throw Error(r(558))}return Gt(a),null;case 13:if(f=a.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(y=Fl(a),f!==null&&f.dehydrated!==null){if(s===null){if(!y)throw Error(r(318));if(y=a.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[Cn]=a}else yo(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Gt(a),y=!1}else y=Db(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=y),y=!0;if(!y)return a.flags&256?(_r(a),a):(_r(a),null)}return _r(a),(a.flags&128)!==0?(a.lanes=u,a):(u=f!==null,s=s!==null&&s.memoizedState!==null,u&&(f=a.child,y=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(y=f.alternate.memoizedState.cachePool.pool),w=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(w=f.memoizedState.cachePool.pool),w!==y&&(f.flags|=2048)),u!==s&&u&&(a.child.flags|=8192),_m(a,a.updateQueue),Gt(a),null);case 4:return Z(),s===null&&H0(a.stateNode.containerInfo),Gt(a),null;case 10:return Ea(a.type),Gt(a),null;case 19:if(L(on),f=a.memoizedState,f===null)return Gt(a),null;if(y=(a.flags&128)!==0,w=f.rendering,w===null)if(y)ud(f,!1);else{if(nn!==0||s!==null&&(s.flags&128)!==0)for(s=a.child;s!==null;){if(w=bm(s),w!==null){for(a.flags|=128,ud(f,!1),s=w.updateQueue,a.updateQueue=s,_m(a,s),a.subtreeFlags=0,s=u,u=a.child;u!==null;)fD(u,s),u=u.sibling;return G(on,on.current&1|2),yt&&Na(a,f.treeForkCount),a.child}s=s.sibling}f.tail!==null&&ge()>Im&&(a.flags|=128,y=!0,ud(f,!1),a.lanes=4194304)}else{if(!y)if(s=bm(w),s!==null){if(a.flags|=128,y=!0,s=s.updateQueue,a.updateQueue=s,_m(a,s),ud(f,!0),f.tail===null&&f.tailMode==="hidden"&&!w.alternate&&!yt)return Gt(a),null}else 2*ge()-f.renderingStartTime>Im&&u!==536870912&&(a.flags|=128,y=!0,ud(f,!1),a.lanes=4194304);f.isBackwards?(w.sibling=a.child,a.child=w):(s=f.last,s!==null?s.sibling=w:a.child=w,f.last=w)}return f.tail!==null?(s=f.tail,f.rendering=s,f.tail=s.sibling,f.renderingStartTime=ge(),s.sibling=null,u=on.current,G(on,y?u&1|2:u&1),yt&&Na(a,f.treeForkCount),s):(Gt(a),null);case 22:case 23:return _r(a),qb(),f=a.memoizedState!==null,s!==null?s.memoizedState!==null!==f&&(a.flags|=8192):f&&(a.flags|=8192),f?(u&536870912)!==0&&(a.flags&128)===0&&(Gt(a),a.subtreeFlags&6&&(a.flags|=8192)):Gt(a),u=a.updateQueue,u!==null&&_m(a,u.retryQueue),u=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),f=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),f!==u&&(a.flags|=2048),s!==null&&L(So),null;case 24:return u=null,s!==null&&(u=s.memoizedState.cache),a.memoizedState.cache!==u&&(a.flags|=2048),Ea(pn),Gt(a),null;case 25:return null;case 30:return null}throw Error(r(156,a.tag))}function gee(s,a){switch(Ab(a),a.tag){case 1:return s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 3:return Ea(pn),Z(),s=a.flags,(s&65536)!==0&&(s&128)===0?(a.flags=s&-65537|128,a):null;case 26:case 27:case 5:return Ee(a),null;case 31:if(a.memoizedState!==null){if(_r(a),a.alternate===null)throw Error(r(340));yo()}return s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 13:if(_r(a),s=a.memoizedState,s!==null&&s.dehydrated!==null){if(a.alternate===null)throw Error(r(340));yo()}return s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 19:return L(on),null;case 4:return Z(),null;case 10:return Ea(a.type),null;case 22:case 23:return _r(a),qb(),s!==null&&L(So),s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 24:return Ea(pn),null;case 25:return null;default:return null}}function $_(s,a){switch(Ab(a),a.tag){case 3:Ea(pn),Z();break;case 26:case 27:case 5:Ee(a);break;case 4:Z();break;case 31:a.memoizedState!==null&&_r(a);break;case 13:_r(a);break;case 19:L(on);break;case 10:Ea(a.type);break;case 22:case 23:_r(a),qb(),s!==null&&L(So);break;case 24:Ea(pn)}}function dd(s,a){try{var u=a.updateQueue,f=u!==null?u.lastEffect:null;if(f!==null){var y=f.next;u=y;do{if((u.tag&s)===s){f=void 0;var w=u.create,T=u.inst;f=w(),T.destroy=f}u=u.next}while(u!==y)}}catch(O){Dt(a,a.return,O)}}function bi(s,a,u){try{var f=a.updateQueue,y=f!==null?f.lastEffect:null;if(y!==null){var w=y.next;f=w;do{if((f.tag&s)===s){var T=f.inst,O=T.destroy;if(O!==void 0){T.destroy=void 0,y=a;var X=u,ce=O;try{ce()}catch(me){Dt(y,X,me)}}}f=f.next}while(f!==w)}}catch(me){Dt(a,a.return,me)}}function B_(s){var a=s.updateQueue;if(a!==null){var u=s.stateNode;try{AD(a,u)}catch(f){Dt(s,s.return,f)}}}function U_(s,a,u){u.props=To(s.type,s.memoizedProps),u.state=s.memoizedState;try{u.componentWillUnmount()}catch(f){Dt(s,a,f)}}function fd(s,a){try{var u=s.ref;if(u!==null){switch(s.tag){case 26:case 27:case 5:var f=s.stateNode;break;case 30:f=s.stateNode;break;default:f=s.stateNode}typeof u=="function"?s.refCleanup=u(f):u.current=f}}catch(y){Dt(s,a,y)}}function Ks(s,a){var u=s.ref,f=s.refCleanup;if(u!==null)if(typeof f=="function")try{f()}catch(y){Dt(s,a,y)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(y){Dt(s,a,y)}else u.current=null}function V_(s){var a=s.type,u=s.memoizedProps,f=s.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":u.autoFocus&&f.focus();break e;case"img":u.src?f.src=u.src:u.srcSet&&(f.srcset=u.srcSet)}}catch(y){Dt(s,s.return,y)}}function j0(s,a,u){try{var f=s.stateNode;Iee(f,s.type,u,a),f[kn]=a}catch(y){Dt(s,s.return,y)}}function F_(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Ti(s.type)||s.tag===4}function C0(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||F_(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&Ti(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function k0(s,a,u){var f=s.tag;if(f===5||f===6)s=s.stateNode,a?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(s,a):(a=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,a.appendChild(s),u=u._reactRootContainer,u!=null||a.onclick!==null||(a.onclick=at));else if(f!==4&&(f===27&&Ti(s.type)&&(u=s.stateNode,a=null),s=s.child,s!==null))for(k0(s,a,u),s=s.sibling;s!==null;)k0(s,a,u),s=s.sibling}function Om(s,a,u){var f=s.tag;if(f===5||f===6)s=s.stateNode,a?u.insertBefore(s,a):u.appendChild(s);else if(f!==4&&(f===27&&Ti(s.type)&&(u=s.stateNode),s=s.child,s!==null))for(Om(s,a,u),s=s.sibling;s!==null;)Om(s,a,u),s=s.sibling}function H_(s){var a=s.stateNode,u=s.memoizedProps;try{for(var f=s.type,y=a.attributes;y.length;)a.removeAttributeNode(y[0]);In(a,f,u),a[Cn]=s,a[kn]=u}catch(w){Dt(s,s.return,w)}}var _a=!1,vn=!1,N0=!1,q_=typeof WeakSet=="function"?WeakSet:Set,Dn=null;function xee(s,a){if(s=s.containerInfo,G0=tp,s=rD(s),yb(s)){if("selectionStart"in s)var u={start:s.selectionStart,end:s.selectionEnd};else e:{u=(u=s.ownerDocument)&&u.defaultView||window;var f=u.getSelection&&u.getSelection();if(f&&f.rangeCount!==0){u=f.anchorNode;var y=f.anchorOffset,w=f.focusNode;f=f.focusOffset;try{u.nodeType,w.nodeType}catch{u=null;break e}var T=0,O=-1,X=-1,ce=0,me=0,xe=s,ue=null;t:for(;;){for(var de;xe!==u||y!==0&&xe.nodeType!==3||(O=T+y),xe!==w||f!==0&&xe.nodeType!==3||(X=T+f),xe.nodeType===3&&(T+=xe.nodeValue.length),(de=xe.firstChild)!==null;)ue=xe,xe=de;for(;;){if(xe===s)break t;if(ue===u&&++ce===y&&(O=T),ue===w&&++me===f&&(X=T),(de=xe.nextSibling)!==null)break;xe=ue,ue=xe.parentNode}xe=de}u=O===-1||X===-1?null:{start:O,end:X}}else u=null}u=u||{start:0,end:0}}else u=null;for(Y0={focusedElem:s,selectionRange:u},tp=!1,Dn=a;Dn!==null;)if(a=Dn,s=a.child,(a.subtreeFlags&1028)!==0&&s!==null)s.return=a,Dn=s;else for(;Dn!==null;){switch(a=Dn,w=a.alternate,s=a.flags,a.tag){case 0:if((s&4)!==0&&(s=a.updateQueue,s=s!==null?s.events:null,s!==null))for(u=0;u<s.length;u++)y=s[u],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&w!==null){s=void 0,u=a,y=w.memoizedProps,w=w.memoizedState,f=u.stateNode;try{var $e=To(u.type,y);s=f.getSnapshotBeforeUpdate($e,w),f.__reactInternalSnapshotBeforeUpdate=s}catch(et){Dt(u,u.return,et)}}break;case 3:if((s&1024)!==0){if(s=a.stateNode.containerInfo,u=s.nodeType,u===9)Q0(s);else if(u===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Q0(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(r(163))}if(s=a.sibling,s!==null){s.return=a.return,Dn=s;break}Dn=a.return}}function K_(s,a,u){var f=u.flags;switch(u.tag){case 0:case 11:case 15:za(s,u),f&4&&dd(5,u);break;case 1:if(za(s,u),f&4)if(s=u.stateNode,a===null)try{s.componentDidMount()}catch(T){Dt(u,u.return,T)}else{var y=To(u.type,a.memoizedProps);a=a.memoizedState;try{s.componentDidUpdate(y,a,s.__reactInternalSnapshotBeforeUpdate)}catch(T){Dt(u,u.return,T)}}f&64&&B_(u),f&512&&fd(u,u.return);break;case 3:if(za(s,u),f&64&&(s=u.updateQueue,s!==null)){if(a=null,u.child!==null)switch(u.child.tag){case 27:case 5:a=u.child.stateNode;break;case 1:a=u.child.stateNode}try{AD(s,a)}catch(T){Dt(u,u.return,T)}}break;case 27:a===null&&f&4&&H_(u);case 26:case 5:za(s,u),a===null&&f&4&&V_(u),f&512&&fd(u,u.return);break;case 12:za(s,u);break;case 31:za(s,u),f&4&&W_(s,u);break;case 13:za(s,u),f&4&&X_(s,u),f&64&&(s=u.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(u=Nee.bind(null,u),Kee(s,u))));break;case 22:if(f=u.memoizedState!==null||_a,!f){a=a!==null&&a.memoizedState!==null||vn,y=_a;var w=vn;_a=f,(vn=a)&&!w?Pa(s,u,(u.subtreeFlags&8772)!==0):za(s,u),_a=y,vn=w}break;case 30:break;default:za(s,u)}}function G_(s){var a=s.alternate;a!==null&&(s.alternate=null,G_(a)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(a=s.stateNode,a!==null&&va(a)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var Wt=null,gr=!1;function Oa(s,a,u){for(u=u.child;u!==null;)Y_(s,a,u),u=u.sibling}function Y_(s,a,u){if(we&&typeof we.onCommitFiberUnmount=="function")try{we.onCommitFiberUnmount(Jn,u)}catch{}switch(u.tag){case 26:vn||Ks(u,a),Oa(s,a,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:vn||Ks(u,a);var f=Wt,y=gr;Ti(u.type)&&(Wt=u.stateNode,gr=!1),Oa(s,a,u),wd(u.stateNode),Wt=f,gr=y;break;case 5:vn||Ks(u,a);case 6:if(f=Wt,y=gr,Wt=null,Oa(s,a,u),Wt=f,gr=y,Wt!==null)if(gr)try{(Wt.nodeType===9?Wt.body:Wt.nodeName==="HTML"?Wt.ownerDocument.body:Wt).removeChild(u.stateNode)}catch(w){Dt(u,a,w)}else try{Wt.removeChild(u.stateNode)}catch(w){Dt(u,a,w)}break;case 18:Wt!==null&&(gr?(s=Wt,BO(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,u.stateNode),uc(s)):BO(Wt,u.stateNode));break;case 4:f=Wt,y=gr,Wt=u.stateNode.containerInfo,gr=!0,Oa(s,a,u),Wt=f,gr=y;break;case 0:case 11:case 14:case 15:bi(2,u,a),vn||bi(4,u,a),Oa(s,a,u);break;case 1:vn||(Ks(u,a),f=u.stateNode,typeof f.componentWillUnmount=="function"&&U_(u,a,f)),Oa(s,a,u);break;case 21:Oa(s,a,u);break;case 22:vn=(f=vn)||u.memoizedState!==null,Oa(s,a,u),vn=f;break;default:Oa(s,a,u)}}function W_(s,a){if(a.memoizedState===null&&(s=a.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{uc(s)}catch(u){Dt(a,a.return,u)}}}function X_(s,a){if(a.memoizedState===null&&(s=a.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{uc(s)}catch(u){Dt(a,a.return,u)}}function vee(s){switch(s.tag){case 31:case 13:case 19:var a=s.stateNode;return a===null&&(a=s.stateNode=new q_),a;case 22:return s=s.stateNode,a=s._retryCache,a===null&&(a=s._retryCache=new q_),a;default:throw Error(r(435,s.tag))}}function zm(s,a){var u=vee(s);a.forEach(function(f){if(!u.has(f)){u.add(f);var y=Tee.bind(null,s,f);f.then(y,y)}})}function xr(s,a){var u=a.deletions;if(u!==null)for(var f=0;f<u.length;f++){var y=u[f],w=s,T=a,O=T;e:for(;O!==null;){switch(O.tag){case 27:if(Ti(O.type)){Wt=O.stateNode,gr=!1;break e}break;case 5:Wt=O.stateNode,gr=!1;break e;case 3:case 4:Wt=O.stateNode.containerInfo,gr=!0;break e}O=O.return}if(Wt===null)throw Error(r(160));Y_(w,T,y),Wt=null,gr=!1,w=y.alternate,w!==null&&(w.return=null),y.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)Q_(a,s),a=a.sibling}var ws=null;function Q_(s,a){var u=s.alternate,f=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:xr(a,s),vr(s),f&4&&(bi(3,s,s.return),dd(3,s),bi(5,s,s.return));break;case 1:xr(a,s),vr(s),f&512&&(vn||u===null||Ks(u,u.return)),f&64&&_a&&(s=s.updateQueue,s!==null&&(f=s.callbacks,f!==null&&(u=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=u===null?f:u.concat(f))));break;case 26:var y=ws;if(xr(a,s),vr(s),f&512&&(vn||u===null||Ks(u,u.return)),f&4){var w=u!==null?u.memoizedState:null;if(f=s.memoizedState,u===null)if(f===null)if(s.stateNode===null){e:{f=s.type,u=s.memoizedProps,y=y.ownerDocument||y;t:switch(f){case"title":w=y.getElementsByTagName("title")[0],(!w||w[ho]||w[Cn]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=y.createElement(f),y.head.insertBefore(w,y.querySelector("head > title"))),In(w,f,u),w[Cn]=s,Yt(w),f=w;break e;case"link":var T=QO("link","href",y).get(f+(u.href||""));if(T){for(var O=0;O<T.length;O++)if(w=T[O],w.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&w.getAttribute("rel")===(u.rel==null?null:u.rel)&&w.getAttribute("title")===(u.title==null?null:u.title)&&w.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){T.splice(O,1);break t}}w=y.createElement(f),In(w,f,u),y.head.appendChild(w);break;case"meta":if(T=QO("meta","content",y).get(f+(u.content||""))){for(O=0;O<T.length;O++)if(w=T[O],w.getAttribute("content")===(u.content==null?null:""+u.content)&&w.getAttribute("name")===(u.name==null?null:u.name)&&w.getAttribute("property")===(u.property==null?null:u.property)&&w.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&w.getAttribute("charset")===(u.charSet==null?null:u.charSet)){T.splice(O,1);break t}}w=y.createElement(f),In(w,f,u),y.head.appendChild(w);break;default:throw Error(r(468,f))}w[Cn]=s,Yt(w),f=w}s.stateNode=f}else ZO(y,s.type,s.stateNode);else s.stateNode=XO(y,f,s.memoizedProps);else w!==f?(w===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):w.count--,f===null?ZO(y,s.type,s.stateNode):XO(y,f,s.memoizedProps)):f===null&&s.stateNode!==null&&j0(s,s.memoizedProps,u.memoizedProps)}break;case 27:xr(a,s),vr(s),f&512&&(vn||u===null||Ks(u,u.return)),u!==null&&f&4&&j0(s,s.memoizedProps,u.memoizedProps);break;case 5:if(xr(a,s),vr(s),f&512&&(vn||u===null||Ks(u,u.return)),s.flags&32){y=s.stateNode;try{ja(y,"")}catch($e){Dt(s,s.return,$e)}}f&4&&s.stateNode!=null&&(y=s.memoizedProps,j0(s,y,u!==null?u.memoizedProps:y)),f&1024&&(N0=!0);break;case 6:if(xr(a,s),vr(s),f&4){if(s.stateNode===null)throw Error(r(162));f=s.memoizedProps,u=s.stateNode;try{u.nodeValue=f}catch($e){Dt(s,s.return,$e)}}break;case 3:if(Qm=null,y=ws,ws=Wm(a.containerInfo),xr(a,s),ws=y,vr(s),f&4&&u!==null&&u.memoizedState.isDehydrated)try{uc(a.containerInfo)}catch($e){Dt(s,s.return,$e)}N0&&(N0=!1,Z_(s));break;case 4:f=ws,ws=Wm(s.stateNode.containerInfo),xr(a,s),vr(s),ws=f;break;case 12:xr(a,s),vr(s);break;case 31:xr(a,s),vr(s),f&4&&(f=s.updateQueue,f!==null&&(s.updateQueue=null,zm(s,f)));break;case 13:xr(a,s),vr(s),s.child.flags&8192&&s.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Lm=ge()),f&4&&(f=s.updateQueue,f!==null&&(s.updateQueue=null,zm(s,f)));break;case 22:y=s.memoizedState!==null;var X=u!==null&&u.memoizedState!==null,ce=_a,me=vn;if(_a=ce||y,vn=me||X,xr(a,s),vn=me,_a=ce,vr(s),f&8192)e:for(a=s.stateNode,a._visibility=y?a._visibility&-2:a._visibility|1,y&&(u===null||X||_a||vn||Eo(s)),u=null,a=s;;){if(a.tag===5||a.tag===26){if(u===null){X=u=a;try{if(w=X.stateNode,y)T=w.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none";else{O=X.stateNode;var xe=X.memoizedProps.style,ue=xe!=null&&xe.hasOwnProperty("display")?xe.display:null;O.style.display=ue==null||typeof ue=="boolean"?"":(""+ue).trim()}}catch($e){Dt(X,X.return,$e)}}}else if(a.tag===6){if(u===null){X=a;try{X.stateNode.nodeValue=y?"":X.memoizedProps}catch($e){Dt(X,X.return,$e)}}}else if(a.tag===18){if(u===null){X=a;try{var de=X.stateNode;y?UO(de,!0):UO(X.stateNode,!1)}catch($e){Dt(X,X.return,$e)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===s)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break e;for(;a.sibling===null;){if(a.return===null||a.return===s)break e;u===a&&(u=null),a=a.return}u===a&&(u=null),a.sibling.return=a.return,a=a.sibling}f&4&&(f=s.updateQueue,f!==null&&(u=f.retryQueue,u!==null&&(f.retryQueue=null,zm(s,u))));break;case 19:xr(a,s),vr(s),f&4&&(f=s.updateQueue,f!==null&&(s.updateQueue=null,zm(s,f)));break;case 30:break;case 21:break;default:xr(a,s),vr(s)}}function vr(s){var a=s.flags;if(a&2){try{for(var u,f=s.return;f!==null;){if(F_(f)){u=f;break}f=f.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var y=u.stateNode,w=C0(s);Om(s,w,y);break;case 5:var T=u.stateNode;u.flags&32&&(ja(T,""),u.flags&=-33);var O=C0(s);Om(s,O,T);break;case 3:case 4:var X=u.stateNode.containerInfo,ce=C0(s);k0(s,ce,X);break;default:throw Error(r(161))}}catch(me){Dt(s,s.return,me)}s.flags&=-3}a&4096&&(s.flags&=-4097)}function Z_(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var a=s;Z_(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),s=s.sibling}}function za(s,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)K_(s,a.alternate,a),a=a.sibling}function Eo(s){for(s=s.child;s!==null;){var a=s;switch(a.tag){case 0:case 11:case 14:case 15:bi(4,a,a.return),Eo(a);break;case 1:Ks(a,a.return);var u=a.stateNode;typeof u.componentWillUnmount=="function"&&U_(a,a.return,u),Eo(a);break;case 27:wd(a.stateNode);case 26:case 5:Ks(a,a.return),Eo(a);break;case 22:a.memoizedState===null&&Eo(a);break;case 30:Eo(a);break;default:Eo(a)}s=s.sibling}}function Pa(s,a,u){for(u=u&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var f=a.alternate,y=s,w=a,T=w.flags;switch(w.tag){case 0:case 11:case 15:Pa(y,w,u),dd(4,w);break;case 1:if(Pa(y,w,u),f=w,y=f.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(ce){Dt(f,f.return,ce)}if(f=w,y=f.updateQueue,y!==null){var O=f.stateNode;try{var X=y.shared.hiddenCallbacks;if(X!==null)for(y.shared.hiddenCallbacks=null,y=0;y<X.length;y++)RD(X[y],O)}catch(ce){Dt(f,f.return,ce)}}u&&T&64&&B_(w),fd(w,w.return);break;case 27:H_(w);case 26:case 5:Pa(y,w,u),u&&f===null&&T&4&&V_(w),fd(w,w.return);break;case 12:Pa(y,w,u);break;case 31:Pa(y,w,u),u&&T&4&&W_(y,w);break;case 13:Pa(y,w,u),u&&T&4&&X_(y,w);break;case 22:w.memoizedState===null&&Pa(y,w,u),fd(w,w.return);break;case 30:break;default:Pa(y,w,u)}a=a.sibling}}function T0(s,a){var u=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),s=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(s=a.memoizedState.cachePool.pool),s!==u&&(s!=null&&s.refCount++,u!=null&&Zu(u))}function E0(s,a){s=null,a.alternate!==null&&(s=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==s&&(a.refCount++,s!=null&&Zu(s))}function Ss(s,a,u,f){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)J_(s,a,u,f),a=a.sibling}function J_(s,a,u,f){var y=a.flags;switch(a.tag){case 0:case 11:case 15:Ss(s,a,u,f),y&2048&&dd(9,a);break;case 1:Ss(s,a,u,f);break;case 3:Ss(s,a,u,f),y&2048&&(s=null,a.alternate!==null&&(s=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==s&&(a.refCount++,s!=null&&Zu(s)));break;case 12:if(y&2048){Ss(s,a,u,f),s=a.stateNode;try{var w=a.memoizedProps,T=w.id,O=w.onPostCommit;typeof O=="function"&&O(T,a.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(X){Dt(a,a.return,X)}}else Ss(s,a,u,f);break;case 31:Ss(s,a,u,f);break;case 13:Ss(s,a,u,f);break;case 23:break;case 22:w=a.stateNode,T=a.alternate,a.memoizedState!==null?w._visibility&2?Ss(s,a,u,f):hd(s,a):w._visibility&2?Ss(s,a,u,f):(w._visibility|=2,Jl(s,a,u,f,(a.subtreeFlags&10256)!==0||!1)),y&2048&&T0(T,a);break;case 24:Ss(s,a,u,f),y&2048&&E0(a.alternate,a);break;default:Ss(s,a,u,f)}}function Jl(s,a,u,f,y){for(y=y&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var w=s,T=a,O=u,X=f,ce=T.flags;switch(T.tag){case 0:case 11:case 15:Jl(w,T,O,X,y),dd(8,T);break;case 23:break;case 22:var me=T.stateNode;T.memoizedState!==null?me._visibility&2?Jl(w,T,O,X,y):hd(w,T):(me._visibility|=2,Jl(w,T,O,X,y)),y&&ce&2048&&T0(T.alternate,T);break;case 24:Jl(w,T,O,X,y),y&&ce&2048&&E0(T.alternate,T);break;default:Jl(w,T,O,X,y)}a=a.sibling}}function hd(s,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var u=s,f=a,y=f.flags;switch(f.tag){case 22:hd(u,f),y&2048&&T0(f.alternate,f);break;case 24:hd(u,f),y&2048&&E0(f.alternate,f);break;default:hd(u,f)}a=a.sibling}}var md=8192;function ec(s,a,u){if(s.subtreeFlags&md)for(s=s.child;s!==null;)eO(s,a,u),s=s.sibling}function eO(s,a,u){switch(s.tag){case 26:ec(s,a,u),s.flags&md&&s.memoizedState!==null&&ste(u,ws,s.memoizedState,s.memoizedProps);break;case 5:ec(s,a,u);break;case 3:case 4:var f=ws;ws=Wm(s.stateNode.containerInfo),ec(s,a,u),ws=f;break;case 22:s.memoizedState===null&&(f=s.alternate,f!==null&&f.memoizedState!==null?(f=md,md=16777216,ec(s,a,u),md=f):ec(s,a,u));break;default:ec(s,a,u)}}function tO(s){var a=s.alternate;if(a!==null&&(s=a.child,s!==null)){a.child=null;do a=s.sibling,s.sibling=null,s=a;while(s!==null)}}function pd(s){var a=s.deletions;if((s.flags&16)!==0){if(a!==null)for(var u=0;u<a.length;u++){var f=a[u];Dn=f,rO(f,s)}tO(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)nO(s),s=s.sibling}function nO(s){switch(s.tag){case 0:case 11:case 15:pd(s),s.flags&2048&&bi(9,s,s.return);break;case 3:pd(s);break;case 12:pd(s);break;case 22:var a=s.stateNode;s.memoizedState!==null&&a._visibility&2&&(s.return===null||s.return.tag!==13)?(a._visibility&=-3,Pm(s)):pd(s);break;default:pd(s)}}function Pm(s){var a=s.deletions;if((s.flags&16)!==0){if(a!==null)for(var u=0;u<a.length;u++){var f=a[u];Dn=f,rO(f,s)}tO(s)}for(s=s.child;s!==null;){switch(a=s,a.tag){case 0:case 11:case 15:bi(8,a,a.return),Pm(a);break;case 22:u=a.stateNode,u._visibility&2&&(u._visibility&=-3,Pm(a));break;default:Pm(a)}s=s.sibling}}function rO(s,a){for(;Dn!==null;){var u=Dn;switch(u.tag){case 0:case 11:case 15:bi(8,u,a);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var f=u.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:Zu(u.memoizedState.cache)}if(f=u.child,f!==null)f.return=u,Dn=f;else e:for(u=s;Dn!==null;){f=Dn;var y=f.sibling,w=f.return;if(G_(f),f===u){Dn=null;break e}if(y!==null){y.return=w,Dn=y;break e}Dn=w}}}var yee={getCacheForType:function(s){var a=Pn(pn),u=a.data.get(s);return u===void 0&&(u=s(),a.data.set(s,u)),u},cacheSignal:function(){return Pn(pn).controller.signal}},bee=typeof WeakMap=="function"?WeakMap:Map,Et=0,Ut=null,pt=null,xt=0,Mt=0,Or=null,wi=!1,tc=!1,R0=!1,La=0,nn=0,Si=0,Ro=0,A0=0,zr=0,nc=0,gd=null,yr=null,M0=!1,Lm=0,sO=0,Im=1/0,$m=null,ji=null,Nn=0,Ci=null,rc=null,Ia=0,D0=0,_0=null,aO=null,xd=0,O0=null;function Pr(){return(Et&2)!==0&&xt!==0?xt&-xt:M.T!==null?B0():fr()}function iO(){if(zr===0)if((xt&536870912)===0||yt){var s=jn;jn<<=1,(jn&3932160)===0&&(jn=262144),zr=s}else zr=536870912;return s=Dr.current,s!==null&&(s.flags|=32),zr}function br(s,a,u){(s===Ut&&(Mt===2||Mt===9)||s.cancelPendingCommit!==null)&&(sc(s,0),ki(s,xt,zr,!1)),At(s,u),((Et&2)===0||s!==Ut)&&(s===Ut&&((Et&2)===0&&(Ro|=u),nn===4&&ki(s,xt,zr,!1)),Gs(s))}function oO(s,a,u){if((Et&6)!==0)throw Error(r(327));var f=!u&&(a&127)===0&&(a&s.expiredLanes)===0||ft(s,a),y=f?jee(s,a):P0(s,a,!0),w=f;do{if(y===0){tc&&!f&&ki(s,a,0,!1);break}else{if(u=s.current.alternate,w&&!wee(u)){y=P0(s,a,!1),w=!1;continue}if(y===2){if(w=a,s.errorRecoveryDisabledLanes&w)var T=0;else T=s.pendingLanes&-536870913,T=T!==0?T:T&536870912?536870912:0;if(T!==0){a=T;e:{var O=s;y=gd;var X=O.current.memoizedState.isDehydrated;if(X&&(sc(O,T).flags|=256),T=P0(O,T,!1),T!==2){if(R0&&!X){O.errorRecoveryDisabledLanes|=w,Ro|=w,y=4;break e}w=yr,yr=y,w!==null&&(yr===null?yr=w:yr.push.apply(yr,w))}y=T}if(w=!1,y!==2)continue}}if(y===1){sc(s,0),ki(s,a,0,!0);break}e:{switch(f=s,w=y,w){case 0:case 1:throw Error(r(345));case 4:if((a&4194048)!==a)break;case 6:ki(f,a,zr,!wi);break e;case 2:yr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((a&62914560)===a&&(y=Lm+300-ge(),10<y)){if(ki(f,a,zr,!wi),ke(f,0,!0)!==0)break e;Ia=a,f.timeoutHandle=IO(lO.bind(null,f,u,yr,$m,M0,a,zr,Ro,nc,wi,w,"Throttled",-0,0),y);break e}lO(f,u,yr,$m,M0,a,zr,Ro,nc,wi,w,null,-0,0)}}break}while(!0);Gs(s)}function lO(s,a,u,f,y,w,T,O,X,ce,me,xe,ue,de){if(s.timeoutHandle=-1,xe=a.subtreeFlags,xe&8192||(xe&16785408)===16785408){xe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:at},eO(a,w,xe);var $e=(w&62914560)===w?Lm-ge():(w&4194048)===w?sO-ge():0;if($e=ate(xe,$e),$e!==null){Ia=w,s.cancelPendingCommit=$e(gO.bind(null,s,a,w,u,f,y,T,O,X,me,xe,null,ue,de)),ki(s,w,T,!ce);return}}gO(s,a,w,u,f,y,T,O,X)}function wee(s){for(var a=s;;){var u=a.tag;if((u===0||u===11||u===15)&&a.flags&16384&&(u=a.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var f=0;f<u.length;f++){var y=u[f],w=y.getSnapshot;y=y.value;try{if(!Ar(w(),y))return!1}catch{return!1}}if(u=a.child,a.subtreeFlags&16384&&u!==null)u.return=a,a=u;else{if(a===s)break;for(;a.sibling===null;){if(a.return===null||a.return===s)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function ki(s,a,u,f){a&=~A0,a&=~Ro,s.suspendedLanes|=a,s.pingedLanes&=~a,f&&(s.warmLanes|=a),f=s.expirationTimes;for(var y=a;0<y;){var w=31-lt(y),T=1<<w;f[w]=-1,y&=~T}u!==0&&vs(s,u,a)}function Bm(){return(Et&6)===0?(vd(0),!1):!0}function z0(){if(pt!==null){if(Mt===0)var s=pt.return;else s=pt,Ta=bo=null,Qb(s),Yl=null,ed=0,s=pt;for(;s!==null;)$_(s.alternate,s),s=s.return;pt=null}}function sc(s,a){var u=s.timeoutHandle;u!==-1&&(s.timeoutHandle=-1,Uee(u)),u=s.cancelPendingCommit,u!==null&&(s.cancelPendingCommit=null,u()),Ia=0,z0(),Ut=s,pt=u=ka(s.current,null),xt=a,Mt=0,Or=null,wi=!1,tc=ft(s,a),R0=!1,nc=zr=A0=Ro=Si=nn=0,yr=gd=null,M0=!1,(a&8)!==0&&(a|=a&32);var f=s.entangledLanes;if(f!==0)for(s=s.entanglements,f&=a;0<f;){var y=31-lt(f),w=1<<y;a|=s[y],f&=~w}return La=a,om(),u}function cO(s,a){it=null,M.H=ld,a===Gl||a===pm?(a=kD(),Mt=3):a===$b?(a=kD(),Mt=4):Mt=a===h0?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,Or=a,pt===null&&(nn=1,Rm(s,Jr(a,s.current)))}function uO(){var s=Dr.current;return s===null?!0:(xt&4194048)===xt?rs===null:(xt&62914560)===xt||(xt&536870912)!==0?s===rs:!1}function dO(){var s=M.H;return M.H=ld,s===null?ld:s}function fO(){var s=M.A;return M.A=yee,s}function Um(){nn=4,wi||(xt&4194048)!==xt&&Dr.current!==null||(tc=!0),(Si&134217727)===0&&(Ro&134217727)===0||Ut===null||ki(Ut,xt,zr,!1)}function P0(s,a,u){var f=Et;Et|=2;var y=dO(),w=fO();(Ut!==s||xt!==a)&&($m=null,sc(s,a)),a=!1;var T=nn;e:do try{if(Mt!==0&&pt!==null){var O=pt,X=Or;switch(Mt){case 8:z0(),T=6;break e;case 3:case 2:case 9:case 6:Dr.current===null&&(a=!0);var ce=Mt;if(Mt=0,Or=null,ac(s,O,X,ce),u&&tc){T=0;break e}break;default:ce=Mt,Mt=0,Or=null,ac(s,O,X,ce)}}See(),T=nn;break}catch(me){cO(s,me)}while(!0);return a&&s.shellSuspendCounter++,Ta=bo=null,Et=f,M.H=y,M.A=w,pt===null&&(Ut=null,xt=0,om()),T}function See(){for(;pt!==null;)hO(pt)}function jee(s,a){var u=Et;Et|=2;var f=dO(),y=fO();Ut!==s||xt!==a?($m=null,Im=ge()+500,sc(s,a)):tc=ft(s,a);e:do try{if(Mt!==0&&pt!==null){a=pt;var w=Or;t:switch(Mt){case 1:Mt=0,Or=null,ac(s,a,w,1);break;case 2:case 9:if(jD(w)){Mt=0,Or=null,mO(a);break}a=function(){Mt!==2&&Mt!==9||Ut!==s||(Mt=7),Gs(s)},w.then(a,a);break e;case 3:Mt=7;break e;case 4:Mt=5;break e;case 7:jD(w)?(Mt=0,Or=null,mO(a)):(Mt=0,Or=null,ac(s,a,w,7));break;case 5:var T=null;switch(pt.tag){case 26:T=pt.memoizedState;case 5:case 27:var O=pt;if(T?JO(T):O.stateNode.complete){Mt=0,Or=null;var X=O.sibling;if(X!==null)pt=X;else{var ce=O.return;ce!==null?(pt=ce,Vm(ce)):pt=null}break t}}Mt=0,Or=null,ac(s,a,w,5);break;case 6:Mt=0,Or=null,ac(s,a,w,6);break;case 8:z0(),nn=6;break e;default:throw Error(r(462))}}Cee();break}catch(me){cO(s,me)}while(!0);return Ta=bo=null,M.H=f,M.A=y,Et=u,pt!==null?0:(Ut=null,xt=0,om(),nn)}function Cee(){for(;pt!==null&&!Pe();)hO(pt)}function hO(s){var a=L_(s.alternate,s,La);s.memoizedProps=s.pendingProps,a===null?Vm(s):pt=a}function mO(s){var a=s,u=a.alternate;switch(a.tag){case 15:case 0:a=M_(u,a,a.pendingProps,a.type,void 0,xt);break;case 11:a=M_(u,a,a.pendingProps,a.type.render,a.ref,xt);break;case 5:Qb(a);default:$_(u,a),a=pt=fD(a,La),a=L_(u,a,La)}s.memoizedProps=s.pendingProps,a===null?Vm(s):pt=a}function ac(s,a,u,f){Ta=bo=null,Qb(a),Yl=null,ed=0;var y=a.return;try{if(fee(s,y,a,u,xt)){nn=1,Rm(s,Jr(u,s.current)),pt=null;return}}catch(w){if(y!==null)throw pt=y,w;nn=1,Rm(s,Jr(u,s.current)),pt=null;return}a.flags&32768?(yt||f===1?s=!0:tc||(xt&536870912)!==0?s=!1:(wi=s=!0,(f===2||f===9||f===3||f===6)&&(f=Dr.current,f!==null&&f.tag===13&&(f.flags|=16384))),pO(a,s)):Vm(a)}function Vm(s){var a=s;do{if((a.flags&32768)!==0){pO(a,wi);return}s=a.return;var u=pee(a.alternate,a,La);if(u!==null){pt=u;return}if(a=a.sibling,a!==null){pt=a;return}pt=a=s}while(a!==null);nn===0&&(nn=5)}function pO(s,a){do{var u=gee(s.alternate,s);if(u!==null){u.flags&=32767,pt=u;return}if(u=s.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!a&&(s=s.sibling,s!==null)){pt=s;return}pt=s=u}while(s!==null);nn=6,pt=null}function gO(s,a,u,f,y,w,T,O,X){s.cancelPendingCommit=null;do Fm();while(Nn!==0);if((Et&6)!==0)throw Error(r(327));if(a!==null){if(a===s.current)throw Error(r(177));if(w=a.lanes|a.childLanes,w|=Cb,On(s,u,w,T,O,X),s===Ut&&(pt=Ut=null,xt=0),rc=a,Ci=s,Ia=u,D0=w,_0=y,aO=f,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,Eee(zt,function(){return wO(),null})):(s.callbackNode=null,s.callbackPriority=0),f=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||f){f=M.T,M.T=null,y=U.p,U.p=2,T=Et,Et|=4;try{xee(s,a,u)}finally{Et=T,U.p=y,M.T=f}}Nn=1,xO(),vO(),yO()}}function xO(){if(Nn===1){Nn=0;var s=Ci,a=rc,u=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||u){u=M.T,M.T=null;var f=U.p;U.p=2;var y=Et;Et|=4;try{Q_(a,s);var w=Y0,T=rD(s.containerInfo),O=w.focusedElem,X=w.selectionRange;if(T!==O&&O&&O.ownerDocument&&nD(O.ownerDocument.documentElement,O)){if(X!==null&&yb(O)){var ce=X.start,me=X.end;if(me===void 0&&(me=ce),"selectionStart"in O)O.selectionStart=ce,O.selectionEnd=Math.min(me,O.value.length);else{var xe=O.ownerDocument||document,ue=xe&&xe.defaultView||window;if(ue.getSelection){var de=ue.getSelection(),$e=O.textContent.length,et=Math.min(X.start,$e),$t=X.end===void 0?et:Math.min(X.end,$e);!de.extend&&et>$t&&(T=$t,$t=et,et=T);var ae=tD(O,et),te=tD(O,$t);if(ae&&te&&(de.rangeCount!==1||de.anchorNode!==ae.node||de.anchorOffset!==ae.offset||de.focusNode!==te.node||de.focusOffset!==te.offset)){var le=xe.createRange();le.setStart(ae.node,ae.offset),de.removeAllRanges(),et>$t?(de.addRange(le),de.extend(te.node,te.offset)):(le.setEnd(te.node,te.offset),de.addRange(le))}}}}for(xe=[],de=O;de=de.parentNode;)de.nodeType===1&&xe.push({element:de,left:de.scrollLeft,top:de.scrollTop});for(typeof O.focus=="function"&&O.focus(),O=0;O<xe.length;O++){var pe=xe[O];pe.element.scrollLeft=pe.left,pe.element.scrollTop=pe.top}}tp=!!G0,Y0=G0=null}finally{Et=y,U.p=f,M.T=u}}s.current=a,Nn=2}}function vO(){if(Nn===2){Nn=0;var s=Ci,a=rc,u=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||u){u=M.T,M.T=null;var f=U.p;U.p=2;var y=Et;Et|=4;try{K_(s,a.alternate,a)}finally{Et=y,U.p=f,M.T=u}}Nn=3}}function yO(){if(Nn===4||Nn===3){Nn=0,Xe();var s=Ci,a=rc,u=Ia,f=aO;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?Nn=5:(Nn=0,rc=Ci=null,bO(s,s.pendingLanes));var y=s.pendingLanes;if(y===0&&(ji=null),er(u),a=a.stateNode,we&&typeof we.onCommitFiberRoot=="function")try{we.onCommitFiberRoot(Jn,a,void 0,(a.current.flags&128)===128)}catch{}if(f!==null){a=M.T,y=U.p,U.p=2,M.T=null;try{for(var w=s.onRecoverableError,T=0;T<f.length;T++){var O=f[T];w(O.value,{componentStack:O.stack})}}finally{M.T=a,U.p=y}}(Ia&3)!==0&&Fm(),Gs(s),y=s.pendingLanes,(u&261930)!==0&&(y&42)!==0?s===O0?xd++:(xd=0,O0=s):xd=0,vd(0)}}function bO(s,a){(s.pooledCacheLanes&=a)===0&&(a=s.pooledCache,a!=null&&(s.pooledCache=null,Zu(a)))}function Fm(){return xO(),vO(),yO(),wO()}function wO(){if(Nn!==5)return!1;var s=Ci,a=D0;D0=0;var u=er(Ia),f=M.T,y=U.p;try{U.p=32>u?32:u,M.T=null,u=_0,_0=null;var w=Ci,T=Ia;if(Nn=0,rc=Ci=null,Ia=0,(Et&6)!==0)throw Error(r(331));var O=Et;if(Et|=4,nO(w.current),J_(w,w.current,T,u),Et=O,vd(0,!1),we&&typeof we.onPostCommitFiberRoot=="function")try{we.onPostCommitFiberRoot(Jn,w)}catch{}return!0}finally{U.p=y,M.T=f,bO(s,a)}}function SO(s,a,u){a=Jr(u,a),a=f0(s.stateNode,a,2),s=xi(s,a,2),s!==null&&(At(s,2),Gs(s))}function Dt(s,a,u){if(s.tag===3)SO(s,s,u);else for(;a!==null;){if(a.tag===3){SO(a,s,u);break}else if(a.tag===1){var f=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(ji===null||!ji.has(f))){s=Jr(u,s),u=j_(2),f=xi(a,u,2),f!==null&&(C_(u,f,a,s),At(f,2),Gs(f));break}}a=a.return}}function L0(s,a,u){var f=s.pingCache;if(f===null){f=s.pingCache=new bee;var y=new Set;f.set(a,y)}else y=f.get(a),y===void 0&&(y=new Set,f.set(a,y));y.has(u)||(R0=!0,y.add(u),s=kee.bind(null,s,a,u),a.then(s,s))}function kee(s,a,u){var f=s.pingCache;f!==null&&f.delete(a),s.pingedLanes|=s.suspendedLanes&u,s.warmLanes&=~u,Ut===s&&(xt&u)===u&&(nn===4||nn===3&&(xt&62914560)===xt&&300>ge()-Lm?(Et&2)===0&&sc(s,0):A0|=u,nc===xt&&(nc=0)),Gs(s)}function jO(s,a){a===0&&(a=Qt()),s=xo(s,a),s!==null&&(At(s,a),Gs(s))}function Nee(s){var a=s.memoizedState,u=0;a!==null&&(u=a.retryLane),jO(s,u)}function Tee(s,a){var u=0;switch(s.tag){case 31:case 13:var f=s.stateNode,y=s.memoizedState;y!==null&&(u=y.retryLane);break;case 19:f=s.stateNode;break;case 22:f=s.stateNode._retryCache;break;default:throw Error(r(314))}f!==null&&f.delete(a),jO(s,u)}function Eee(s,a){return re(s,a)}var Hm=null,ic=null,I0=!1,qm=!1,$0=!1,Ni=0;function Gs(s){s!==ic&&s.next===null&&(ic===null?Hm=ic=s:ic=ic.next=s),qm=!0,I0||(I0=!0,Aee())}function vd(s,a){if(!$0&&qm){$0=!0;do for(var u=!1,f=Hm;f!==null;){if(s!==0){var y=f.pendingLanes;if(y===0)var w=0;else{var T=f.suspendedLanes,O=f.pingedLanes;w=(1<<31-lt(42|s)+1)-1,w&=y&~(T&~O),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(u=!0,TO(f,w))}else w=xt,w=ke(f,f===Ut?w:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(w&3)===0||ft(f,w)||(u=!0,TO(f,w));f=f.next}while(u);$0=!1}}function Ree(){CO()}function CO(){qm=I0=!1;var s=0;Ni!==0&&Bee()&&(s=Ni);for(var a=ge(),u=null,f=Hm;f!==null;){var y=f.next,w=kO(f,a);w===0?(f.next=null,u===null?Hm=y:u.next=y,y===null&&(ic=u)):(u=f,(s!==0||(w&3)!==0)&&(qm=!0)),f=y}Nn!==0&&Nn!==5||vd(s),Ni!==0&&(Ni=0)}function kO(s,a){for(var u=s.suspendedLanes,f=s.pingedLanes,y=s.expirationTimes,w=s.pendingLanes&-62914561;0<w;){var T=31-lt(w),O=1<<T,X=y[T];X===-1?((O&u)===0||(O&f)!==0)&&(y[T]=Pt(O,a)):X<=a&&(s.expiredLanes|=O),w&=~O}if(a=Ut,u=xt,u=ke(s,s===a?u:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),f=s.callbackNode,u===0||s===a&&(Mt===2||Mt===9)||s.cancelPendingCommit!==null)return f!==null&&f!==null&&_e(f),s.callbackNode=null,s.callbackPriority=0;if((u&3)===0||ft(s,u)){if(a=u&-u,a===s.callbackPriority)return a;switch(f!==null&&_e(f),er(u)){case 2:case 8:u=kt;break;case 32:u=zt;break;case 268435456:u=hn;break;default:u=zt}return f=NO.bind(null,s),u=re(u,f),s.callbackPriority=a,s.callbackNode=u,a}return f!==null&&f!==null&&_e(f),s.callbackPriority=2,s.callbackNode=null,2}function NO(s,a){if(Nn!==0&&Nn!==5)return s.callbackNode=null,s.callbackPriority=0,null;var u=s.callbackNode;if(Fm()&&s.callbackNode!==u)return null;var f=xt;return f=ke(s,s===Ut?f:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),f===0?null:(oO(s,f,a),kO(s,ge()),s.callbackNode!=null&&s.callbackNode===u?NO.bind(null,s):null)}function TO(s,a){if(Fm())return null;oO(s,a,!0)}function Aee(){Vee(function(){(Et&6)!==0?re(je,Ree):CO()})}function B0(){if(Ni===0){var s=ql;s===0&&(s=Ft,Ft<<=1,(Ft&261888)===0&&(Ft=256)),Ni=s}return Ni}function EO(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:mt(""+s)}function RO(s,a){var u=a.ownerDocument.createElement("input");return u.name=a.name,u.value=a.value,s.id&&u.setAttribute("form",s.id),a.parentNode.insertBefore(u,a),s=new FormData(s),u.parentNode.removeChild(u),s}function Mee(s,a,u,f,y){if(a==="submit"&&u&&u.stateNode===y){var w=EO((y[kn]||null).action),T=f.submitter;T&&(a=(a=T[kn]||null)?EO(a.formAction):T.getAttribute("formAction"),a!==null&&(w=a,T=null));var O=new rm("action","action",null,f,y);s.push({event:O,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(Ni!==0){var X=T?RO(y,T):new FormData(y);i0(u,{pending:!0,data:X,method:y.method,action:w},null,X)}}else typeof w=="function"&&(O.preventDefault(),X=T?RO(y,T):new FormData(y),i0(u,{pending:!0,data:X,method:y.method,action:w},w,X))},currentTarget:y}]})}}for(var U0=0;U0<jb.length;U0++){var V0=jb[U0],Dee=V0.toLowerCase(),_ee=V0[0].toUpperCase()+V0.slice(1);bs(Dee,"on"+_ee)}bs(iD,"onAnimationEnd"),bs(oD,"onAnimationIteration"),bs(lD,"onAnimationStart"),bs("dblclick","onDoubleClick"),bs("focusin","onFocus"),bs("focusout","onBlur"),bs(WJ,"onTransitionRun"),bs(XJ,"onTransitionStart"),bs(QJ,"onTransitionCancel"),bs(cD,"onTransitionEnd"),Vs("onMouseEnter",["mouseout","mouseover"]),Vs("onMouseLeave",["mouseout","mouseover"]),Vs("onPointerEnter",["pointerout","pointerover"]),Vs("onPointerLeave",["pointerout","pointerover"]),ba("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ba("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ba("onBeforeInput",["compositionend","keypress","textInput","paste"]),ba("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ba("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ba("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var yd="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(" "),Oee=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(yd));function AO(s,a){a=(a&4)!==0;for(var u=0;u<s.length;u++){var f=s[u],y=f.event;f=f.listeners;e:{var w=void 0;if(a)for(var T=f.length-1;0<=T;T--){var O=f[T],X=O.instance,ce=O.currentTarget;if(O=O.listener,X!==w&&y.isPropagationStopped())break e;w=O,y.currentTarget=ce;try{w(y)}catch(me){im(me)}y.currentTarget=null,w=X}else for(T=0;T<f.length;T++){if(O=f[T],X=O.instance,ce=O.currentTarget,O=O.listener,X!==w&&y.isPropagationStopped())break e;w=O,y.currentTarget=ce;try{w(y)}catch(me){im(me)}y.currentTarget=null,w=X}}}}function gt(s,a){var u=a[ii];u===void 0&&(u=a[ii]=new Set);var f=s+"__bubble";u.has(f)||(MO(a,s,2,!1),u.add(f))}function F0(s,a,u){var f=0;a&&(f|=4),MO(u,s,f,a)}var Km="_reactListening"+Math.random().toString(36).slice(2);function H0(s){if(!s[Km]){s[Km]=!0,Wh.forEach(function(u){u!=="selectionchange"&&(Oee.has(u)||F0(u,!1,s),F0(u,!0,s))});var a=s.nodeType===9?s:s.ownerDocument;a===null||a[Km]||(a[Km]=!0,F0("selectionchange",!1,a))}}function MO(s,a,u,f){switch(iz(a)){case 2:var y=lte;break;case 8:y=cte;break;default:y=aw}u=y.bind(null,a,u,s),y=void 0,!ub||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(y=!0),f?y!==void 0?s.addEventListener(a,u,{capture:!0,passive:y}):s.addEventListener(a,u,!0):y!==void 0?s.addEventListener(a,u,{passive:y}):s.addEventListener(a,u,!1)}function q0(s,a,u,f,y){var w=f;if((a&1)===0&&(a&2)===0&&f!==null)e:for(;;){if(f===null)return;var T=f.tag;if(T===3||T===4){var O=f.stateNode.containerInfo;if(O===y)break;if(T===4)for(T=f.return;T!==null;){var X=T.tag;if((X===3||X===4)&&T.stateNode.containerInfo===y)return;T=T.return}for(;O!==null;){if(T=oi(O),T===null)return;if(X=T.tag,X===5||X===6||X===26||X===27){f=w=T;continue e}O=O.parentNode}}f=f.return}PM(function(){var ce=w,me=ct(u),xe=[];e:{var ue=uD.get(s);if(ue!==void 0){var de=rm,$e=s;switch(s){case"keypress":if(tm(u)===0)break e;case"keydown":case"keyup":de=TJ;break;case"focusin":$e="focus",de=mb;break;case"focusout":$e="blur",de=mb;break;case"beforeblur":case"afterblur":de=mb;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":de=$M;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":de=pJ;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":de=AJ;break;case iD:case oD:case lD:de=vJ;break;case cD:de=DJ;break;case"scroll":case"scrollend":de=hJ;break;case"wheel":de=OJ;break;case"copy":case"cut":case"paste":de=bJ;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":de=UM;break;case"toggle":case"beforetoggle":de=PJ}var et=(a&4)!==0,$t=!et&&(s==="scroll"||s==="scrollend"),ae=et?ue!==null?ue+"Capture":null:ue;et=[];for(var te=ce,le;te!==null;){var pe=te;if(le=pe.stateNode,pe=pe.tag,pe!==5&&pe!==26&&pe!==27||le===null||ae===null||(pe=Uu(te,ae),pe!=null&&et.push(bd(te,pe,le))),$t)break;te=te.return}0<et.length&&(ue=new de(ue,$e,null,u,me),xe.push({event:ue,listeners:et}))}}if((a&7)===0){e:{if(ue=s==="mouseover"||s==="pointerover",de=s==="mouseout"||s==="pointerout",ue&&u!==Rt&&($e=u.relatedTarget||u.fromElement)&&(oi($e)||$e[Wr]))break e;if((de||ue)&&(ue=me.window===me?me:(ue=me.ownerDocument)?ue.defaultView||ue.parentWindow:window,de?($e=u.relatedTarget||u.toElement,de=ce,$e=$e?oi($e):null,$e!==null&&($t=o($e),et=$e.tag,$e!==$t||et!==5&&et!==27&&et!==6)&&($e=null)):(de=null,$e=ce),de!==$e)){if(et=$M,pe="onMouseLeave",ae="onMouseEnter",te="mouse",(s==="pointerout"||s==="pointerover")&&(et=UM,pe="onPointerLeave",ae="onPointerEnter",te="pointer"),$t=de==null?ue:Us(de),le=$e==null?ue:Us($e),ue=new et(pe,te+"leave",de,u,me),ue.target=$t,ue.relatedTarget=le,pe=null,oi(me)===ce&&(et=new et(ae,te+"enter",$e,u,me),et.target=le,et.relatedTarget=$t,pe=et),$t=pe,de&&$e)t:{for(et=zee,ae=de,te=$e,le=0,pe=ae;pe;pe=et(pe))le++;pe=0;for(var Ze=te;Ze;Ze=et(Ze))pe++;for(;0<le-pe;)ae=et(ae),le--;for(;0<pe-le;)te=et(te),pe--;for(;le--;){if(ae===te||te!==null&&ae===te.alternate){et=ae;break t}ae=et(ae),te=et(te)}et=null}else et=null;de!==null&&DO(xe,ue,de,et,!1),$e!==null&&$t!==null&&DO(xe,$t,$e,et,!0)}}e:{if(ue=ce?Us(ce):window,de=ue.nodeName&&ue.nodeName.toLowerCase(),de==="select"||de==="input"&&ue.type==="file")var Nt=WM;else if(GM(ue))if(XM)Nt=KJ;else{Nt=HJ;var He=FJ}else de=ue.nodeName,!de||de.toLowerCase()!=="input"||ue.type!=="checkbox"&&ue.type!=="radio"?ce&&Ae(ce.elementType)&&(Nt=WM):Nt=qJ;if(Nt&&(Nt=Nt(s,ce))){YM(xe,Nt,u,me);break e}He&&He(s,ue,ce),s==="focusout"&&ce&&ue.type==="number"&&ce.memoizedProps.value!=null&&$u(ue,"number",ue.value)}switch(He=ce?Us(ce):window,s){case"focusin":(GM(He)||He.contentEditable==="true")&&(Ll=He,bb=ce,Wu=null);break;case"focusout":Wu=bb=Ll=null;break;case"mousedown":wb=!0;break;case"contextmenu":case"mouseup":case"dragend":wb=!1,sD(xe,u,me);break;case"selectionchange":if(YJ)break;case"keydown":case"keyup":sD(xe,u,me)}var ot;if(gb)e:{switch(s){case"compositionstart":var vt="onCompositionStart";break e;case"compositionend":vt="onCompositionEnd";break e;case"compositionupdate":vt="onCompositionUpdate";break e}vt=void 0}else Pl?qM(s,u)&&(vt="onCompositionEnd"):s==="keydown"&&u.keyCode===229&&(vt="onCompositionStart");vt&&(VM&&u.locale!=="ko"&&(Pl||vt!=="onCompositionStart"?vt==="onCompositionEnd"&&Pl&&(ot=LM()):(ui=me,db="value"in ui?ui.value:ui.textContent,Pl=!0)),He=Gm(ce,vt),0<He.length&&(vt=new BM(vt,s,null,u,me),xe.push({event:vt,listeners:He}),ot?vt.data=ot:(ot=KM(u),ot!==null&&(vt.data=ot)))),(ot=IJ?$J(s,u):BJ(s,u))&&(vt=Gm(ce,"onBeforeInput"),0<vt.length&&(He=new BM("onBeforeInput","beforeinput",null,u,me),xe.push({event:He,listeners:vt}),He.data=ot)),Mee(xe,s,ce,u,me)}AO(xe,a)})}function bd(s,a,u){return{instance:s,listener:a,currentTarget:u}}function Gm(s,a){for(var u=a+"Capture",f=[];s!==null;){var y=s,w=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||w===null||(y=Uu(s,u),y!=null&&f.unshift(bd(s,y,w)),y=Uu(s,a),y!=null&&f.push(bd(s,y,w))),s.tag===3)return f;s=s.return}return[]}function zee(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function DO(s,a,u,f,y){for(var w=a._reactName,T=[];u!==null&&u!==f;){var O=u,X=O.alternate,ce=O.stateNode;if(O=O.tag,X!==null&&X===f)break;O!==5&&O!==26&&O!==27||ce===null||(X=ce,y?(ce=Uu(u,w),ce!=null&&T.unshift(bd(u,ce,X))):y||(ce=Uu(u,w),ce!=null&&T.push(bd(u,ce,X)))),u=u.return}T.length!==0&&s.push({event:a,listeners:T})}var Pee=/\r\n?/g,Lee=/\u0000|\uFFFD/g;function _O(s){return(typeof s=="string"?s:""+s).replace(Pee,`
|
|
49
|
+
`).replace(Lee,"")}function OO(s,a){return a=_O(a),_O(s)===a}function It(s,a,u,f,y,w){switch(u){case"children":typeof f=="string"?a==="body"||a==="textarea"&&f===""||ja(s,f):(typeof f=="number"||typeof f=="bigint")&&a!=="body"&&ja(s,""+f);break;case"className":_l(s,"class",f);break;case"tabIndex":_l(s,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":_l(s,u,f);break;case"style":he(s,f,w);break;case"data":if(a!=="object"){_l(s,"data",f);break}case"src":case"href":if(f===""&&(a!=="a"||u!=="href")){s.removeAttribute(u);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){s.removeAttribute(u);break}f=mt(""+f),s.setAttribute(u,f);break;case"action":case"formAction":if(typeof f=="function"){s.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof w=="function"&&(u==="formAction"?(a!=="input"&&It(s,a,"name",y.name,y,null),It(s,a,"formEncType",y.formEncType,y,null),It(s,a,"formMethod",y.formMethod,y,null),It(s,a,"formTarget",y.formTarget,y,null)):(It(s,a,"encType",y.encType,y,null),It(s,a,"method",y.method,y,null),It(s,a,"target",y.target,y,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){s.removeAttribute(u);break}f=mt(""+f),s.setAttribute(u,f);break;case"onClick":f!=null&&(s.onclick=at);break;case"onScroll":f!=null&>("scroll",s);break;case"onScrollEnd":f!=null&>("scrollend",s);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(u=f.__html,u!=null){if(y.children!=null)throw Error(r(60));s.innerHTML=u}}break;case"multiple":s.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":s.muted=f&&typeof f!="function"&&typeof f!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(f==null||typeof f=="function"||typeof f=="boolean"||typeof f=="symbol"){s.removeAttribute("xlink:href");break}u=mt(""+f),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":f!=null&&typeof f!="function"&&typeof f!="symbol"?s.setAttribute(u,""+f):s.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":f&&typeof f!="function"&&typeof f!="symbol"?s.setAttribute(u,""):s.removeAttribute(u);break;case"capture":case"download":f===!0?s.setAttribute(u,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?s.setAttribute(u,f):s.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?s.setAttribute(u,f):s.removeAttribute(u);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?s.removeAttribute(u):s.setAttribute(u,f);break;case"popover":gt("beforetoggle",s),gt("toggle",s),wa(s,"popover",f);break;case"xlinkActuate":Qr(s,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":Qr(s,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":Qr(s,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":Qr(s,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":Qr(s,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":Qr(s,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":Qr(s,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":Qr(s,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":Qr(s,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":wa(s,"is",f);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=Ve.get(u)||u,wa(s,u,f))}}function K0(s,a,u,f,y,w){switch(u){case"style":he(s,f,w);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(u=f.__html,u!=null){if(y.children!=null)throw Error(r(60));s.innerHTML=u}}break;case"children":typeof f=="string"?ja(s,f):(typeof f=="number"||typeof f=="bigint")&&ja(s,""+f);break;case"onScroll":f!=null&>("scroll",s);break;case"onScrollEnd":f!=null&>("scrollend",s);break;case"onClick":f!=null&&(s.onclick=at);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ml.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(y=u.endsWith("Capture"),a=u.slice(2,y?u.length-7:void 0),w=s[kn]||null,w=w!=null?w[u]:null,typeof w=="function"&&s.removeEventListener(a,w,y),typeof f=="function")){typeof w!="function"&&w!==null&&(u in s?s[u]=null:s.hasAttribute(u)&&s.removeAttribute(u)),s.addEventListener(a,f,y);break e}u in s?s[u]=f:f===!0?s.setAttribute(u,""):wa(s,u,f)}}}function In(s,a,u){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":gt("error",s),gt("load",s);var f=!1,y=!1,w;for(w in u)if(u.hasOwnProperty(w)){var T=u[w];if(T!=null)switch(w){case"src":f=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:It(s,a,w,T,u,null)}}y&&It(s,a,"srcSet",u.srcSet,u,null),f&&It(s,a,"src",u.src,u,null);return;case"input":gt("invalid",s);var O=w=T=y=null,X=null,ce=null;for(f in u)if(u.hasOwnProperty(f)){var me=u[f];if(me!=null)switch(f){case"name":y=me;break;case"type":T=me;break;case"checked":X=me;break;case"defaultChecked":ce=me;break;case"value":w=me;break;case"defaultValue":O=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,a));break;default:It(s,a,f,me,u,null)}}Qh(s,w,O,X,ce,T,y,!1);return;case"select":gt("invalid",s),f=T=w=null;for(y in u)if(u.hasOwnProperty(y)&&(O=u[y],O!=null))switch(y){case"value":w=O;break;case"defaultValue":T=O;break;case"multiple":f=O;default:It(s,a,y,O,u,null)}a=w,u=T,s.multiple=!!f,a!=null?ci(s,!!f,a,!1):u!=null&&ci(s,!!f,u,!0);return;case"textarea":gt("invalid",s),w=y=f=null;for(T in u)if(u.hasOwnProperty(T)&&(O=u[T],O!=null))switch(T){case"value":f=O;break;case"defaultValue":y=O;break;case"children":w=O;break;case"dangerouslySetInnerHTML":if(O!=null)throw Error(r(91));break;default:It(s,a,T,O,u,null)}Bu(s,f,y,w);return;case"option":for(X in u)if(u.hasOwnProperty(X)&&(f=u[X],f!=null))switch(X){case"selected":s.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:It(s,a,X,f,u,null)}return;case"dialog":gt("beforetoggle",s),gt("toggle",s),gt("cancel",s),gt("close",s);break;case"iframe":case"object":gt("load",s);break;case"video":case"audio":for(f=0;f<yd.length;f++)gt(yd[f],s);break;case"image":gt("error",s),gt("load",s);break;case"details":gt("toggle",s);break;case"embed":case"source":case"link":gt("error",s),gt("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ce in u)if(u.hasOwnProperty(ce)&&(f=u[ce],f!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:It(s,a,ce,f,u,null)}return;default:if(Ae(a)){for(me in u)u.hasOwnProperty(me)&&(f=u[me],f!==void 0&&K0(s,a,me,f,u,void 0));return}}for(O in u)u.hasOwnProperty(O)&&(f=u[O],f!=null&&It(s,a,O,f,u,null))}function Iee(s,a,u,f){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,w=null,T=null,O=null,X=null,ce=null,me=null;for(de in u){var xe=u[de];if(u.hasOwnProperty(de)&&xe!=null)switch(de){case"checked":break;case"value":break;case"defaultValue":X=xe;default:f.hasOwnProperty(de)||It(s,a,de,null,f,xe)}}for(var ue in f){var de=f[ue];if(xe=u[ue],f.hasOwnProperty(ue)&&(de!=null||xe!=null))switch(ue){case"type":w=de;break;case"name":y=de;break;case"checked":ce=de;break;case"defaultChecked":me=de;break;case"value":T=de;break;case"defaultValue":O=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(137,a));break;default:de!==xe&&It(s,a,ue,de,f,xe)}}Iu(s,T,O,X,ce,me,w,y);return;case"select":de=T=O=ue=null;for(w in u)if(X=u[w],u.hasOwnProperty(w)&&X!=null)switch(w){case"value":break;case"multiple":de=X;default:f.hasOwnProperty(w)||It(s,a,w,null,f,X)}for(y in f)if(w=f[y],X=u[y],f.hasOwnProperty(y)&&(w!=null||X!=null))switch(y){case"value":ue=w;break;case"defaultValue":O=w;break;case"multiple":T=w;default:w!==X&&It(s,a,y,w,f,X)}a=O,u=T,f=de,ue!=null?ci(s,!!u,ue,!1):!!f!=!!u&&(a!=null?ci(s,!!u,a,!0):ci(s,!!u,u?[]:"",!1));return;case"textarea":de=ue=null;for(O in u)if(y=u[O],u.hasOwnProperty(O)&&y!=null&&!f.hasOwnProperty(O))switch(O){case"value":break;case"children":break;default:It(s,a,O,null,f,y)}for(T in f)if(y=f[T],w=u[T],f.hasOwnProperty(T)&&(y!=null||w!=null))switch(T){case"value":ue=y;break;case"defaultValue":de=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(r(91));break;default:y!==w&&It(s,a,T,y,f,w)}Zh(s,ue,de);return;case"option":for(var $e in u)if(ue=u[$e],u.hasOwnProperty($e)&&ue!=null&&!f.hasOwnProperty($e))switch($e){case"selected":s.selected=!1;break;default:It(s,a,$e,null,f,ue)}for(X in f)if(ue=f[X],de=u[X],f.hasOwnProperty(X)&&ue!==de&&(ue!=null||de!=null))switch(X){case"selected":s.selected=ue&&typeof ue!="function"&&typeof ue!="symbol";break;default:It(s,a,X,ue,f,de)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var et in u)ue=u[et],u.hasOwnProperty(et)&&ue!=null&&!f.hasOwnProperty(et)&&It(s,a,et,null,f,ue);for(ce in f)if(ue=f[ce],de=u[ce],f.hasOwnProperty(ce)&&ue!==de&&(ue!=null||de!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,a));break;default:It(s,a,ce,ue,f,de)}return;default:if(Ae(a)){for(var $t in u)ue=u[$t],u.hasOwnProperty($t)&&ue!==void 0&&!f.hasOwnProperty($t)&&K0(s,a,$t,void 0,f,ue);for(me in f)ue=f[me],de=u[me],!f.hasOwnProperty(me)||ue===de||ue===void 0&&de===void 0||K0(s,a,me,ue,f,de);return}}for(var ae in u)ue=u[ae],u.hasOwnProperty(ae)&&ue!=null&&!f.hasOwnProperty(ae)&&It(s,a,ae,null,f,ue);for(xe in f)ue=f[xe],de=u[xe],!f.hasOwnProperty(xe)||ue===de||ue==null&&de==null||It(s,a,xe,ue,f,de)}function zO(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function $ee(){if(typeof performance.getEntriesByType=="function"){for(var s=0,a=0,u=performance.getEntriesByType("resource"),f=0;f<u.length;f++){var y=u[f],w=y.transferSize,T=y.initiatorType,O=y.duration;if(w&&O&&zO(T)){for(T=0,O=y.responseEnd,f+=1;f<u.length;f++){var X=u[f],ce=X.startTime;if(ce>O)break;var me=X.transferSize,xe=X.initiatorType;me&&zO(xe)&&(X=X.responseEnd,T+=me*(X<O?1:(O-ce)/(X-ce)))}if(--f,a+=8*(w+T)/(y.duration/1e3),s++,10<s)break}}if(0<s)return a/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var G0=null,Y0=null;function Ym(s){return s.nodeType===9?s:s.ownerDocument}function PO(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function LO(s,a){if(s===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&a==="foreignObject"?0:s}function W0(s,a){return s==="textarea"||s==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var X0=null;function Bee(){var s=window.event;return s&&s.type==="popstate"?s===X0?!1:(X0=s,!0):(X0=null,!1)}var IO=typeof setTimeout=="function"?setTimeout:void 0,Uee=typeof clearTimeout=="function"?clearTimeout:void 0,$O=typeof Promise=="function"?Promise:void 0,Vee=typeof queueMicrotask=="function"?queueMicrotask:typeof $O<"u"?function(s){return $O.resolve(null).then(s).catch(Fee)}:IO;function Fee(s){setTimeout(function(){throw s})}function Ti(s){return s==="head"}function BO(s,a){var u=a,f=0;do{var y=u.nextSibling;if(s.removeChild(u),y&&y.nodeType===8)if(u=y.data,u==="/$"||u==="/&"){if(f===0){s.removeChild(y),uc(a);return}f--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")f++;else if(u==="html")wd(s.ownerDocument.documentElement);else if(u==="head"){u=s.ownerDocument.head,wd(u);for(var w=u.firstChild;w;){var T=w.nextSibling,O=w.nodeName;w[ho]||O==="SCRIPT"||O==="STYLE"||O==="LINK"&&w.rel.toLowerCase()==="stylesheet"||u.removeChild(w),w=T}}else u==="body"&&wd(s.ownerDocument.body);u=y}while(u);uc(a)}function UO(s,a){var u=s;s=0;do{var f=u.nextSibling;if(u.nodeType===1?a?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(a?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),f&&f.nodeType===8)if(u=f.data,u==="/$"){if(s===0)break;s--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||s++;u=f}while(u)}function Q0(s){var a=s.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var u=a;switch(a=a.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Q0(u),va(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}s.removeChild(u)}}function Hee(s,a,u,f){for(;s.nodeType===1;){var y=u;if(s.nodeName.toLowerCase()!==a.toLowerCase()){if(!f&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(f){if(!s[ho])switch(a){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(w=s.getAttribute("rel"),w==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(w!==y.rel||s.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||s.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||s.getAttribute("title")!==(y.title==null?null:y.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(w=s.getAttribute("src"),(w!==(y.src==null?null:y.src)||s.getAttribute("type")!==(y.type==null?null:y.type)||s.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&w&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(a==="input"&&s.type==="hidden"){var w=y.name==null?null:""+y.name;if(y.type==="hidden"&&s.getAttribute("name")===w)return s}else return s;if(s=ss(s.nextSibling),s===null)break}return null}function qee(s,a,u){if(a==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!u||(s=ss(s.nextSibling),s===null))return null;return s}function VO(s,a){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!a||(s=ss(s.nextSibling),s===null))return null;return s}function Z0(s){return s.data==="$?"||s.data==="$~"}function J0(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function Kee(s,a){var u=s.ownerDocument;if(s.data==="$~")s._reactRetry=a;else if(s.data!=="$?"||u.readyState!=="loading")a();else{var f=function(){a(),u.removeEventListener("DOMContentLoaded",f)};u.addEventListener("DOMContentLoaded",f),s._reactRetry=f}}function ss(s){for(;s!=null;s=s.nextSibling){var a=s.nodeType;if(a===1||a===3)break;if(a===8){if(a=s.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return s}var ew=null;function FO(s){s=s.nextSibling;for(var a=0;s;){if(s.nodeType===8){var u=s.data;if(u==="/$"||u==="/&"){if(a===0)return ss(s.nextSibling);a--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||a++}s=s.nextSibling}return null}function HO(s){s=s.previousSibling;for(var a=0;s;){if(s.nodeType===8){var u=s.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(a===0)return s;a--}else u!=="/$"&&u!=="/&"||a++}s=s.previousSibling}return null}function qO(s,a,u){switch(a=Ym(u),s){case"html":if(s=a.documentElement,!s)throw Error(r(452));return s;case"head":if(s=a.head,!s)throw Error(r(453));return s;case"body":if(s=a.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function wd(s){for(var a=s.attributes;a.length;)s.removeAttributeNode(a[0]);va(s)}var as=new Map,KO=new Set;function Wm(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var $a=U.d;U.d={f:Gee,r:Yee,D:Wee,C:Xee,L:Qee,m:Zee,X:ete,S:Jee,M:tte};function Gee(){var s=$a.f(),a=Bm();return s||a}function Yee(s){var a=Xr(s);a!==null&&a.tag===5&&a.type==="form"?c_(a):$a.r(s)}var oc=typeof document>"u"?null:document;function GO(s,a,u){var f=oc;if(f&&typeof a=="string"&&a){var y=hr(a);y='link[rel="'+s+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),KO.has(y)||(KO.add(y),s={rel:s,crossOrigin:u,href:a},f.querySelector(y)===null&&(a=f.createElement("link"),In(a,"link",s),Yt(a),f.head.appendChild(a)))}}function Wee(s){$a.D(s),GO("dns-prefetch",s,null)}function Xee(s,a){$a.C(s,a),GO("preconnect",s,a)}function Qee(s,a,u){$a.L(s,a,u);var f=oc;if(f&&s&&a){var y='link[rel="preload"][as="'+hr(a)+'"]';a==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+hr(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+hr(u.imageSizes)+'"]')):y+='[href="'+hr(s)+'"]';var w=y;switch(a){case"style":w=lc(s);break;case"script":w=cc(s)}as.has(w)||(s=g({rel:"preload",href:a==="image"&&u&&u.imageSrcSet?void 0:s,as:a},u),as.set(w,s),f.querySelector(y)!==null||a==="style"&&f.querySelector(Sd(w))||a==="script"&&f.querySelector(jd(w))||(a=f.createElement("link"),In(a,"link",s),Yt(a),f.head.appendChild(a)))}}function Zee(s,a){$a.m(s,a);var u=oc;if(u&&s){var f=a&&typeof a.as=="string"?a.as:"script",y='link[rel="modulepreload"][as="'+hr(f)+'"][href="'+hr(s)+'"]',w=y;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=cc(s)}if(!as.has(w)&&(s=g({rel:"modulepreload",href:s},a),as.set(w,s),u.querySelector(y)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(jd(w)))return}f=u.createElement("link"),In(f,"link",s),Yt(f),u.head.appendChild(f)}}}function Jee(s,a,u){$a.S(s,a,u);var f=oc;if(f&&s){var y=ya(f).hoistableStyles,w=lc(s);a=a||"default";var T=y.get(w);if(!T){var O={loading:0,preload:null};if(T=f.querySelector(Sd(w)))O.loading=5;else{s=g({rel:"stylesheet",href:s,"data-precedence":a},u),(u=as.get(w))&&tw(s,u);var X=T=f.createElement("link");Yt(X),In(X,"link",s),X._p=new Promise(function(ce,me){X.onload=ce,X.onerror=me}),X.addEventListener("load",function(){O.loading|=1}),X.addEventListener("error",function(){O.loading|=2}),O.loading|=4,Xm(T,a,f)}T={type:"stylesheet",instance:T,count:1,state:O},y.set(w,T)}}}function ete(s,a){$a.X(s,a);var u=oc;if(u&&s){var f=ya(u).hoistableScripts,y=cc(s),w=f.get(y);w||(w=u.querySelector(jd(y)),w||(s=g({src:s,async:!0},a),(a=as.get(y))&&nw(s,a),w=u.createElement("script"),Yt(w),In(w,"link",s),u.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},f.set(y,w))}}function tte(s,a){$a.M(s,a);var u=oc;if(u&&s){var f=ya(u).hoistableScripts,y=cc(s),w=f.get(y);w||(w=u.querySelector(jd(y)),w||(s=g({src:s,async:!0,type:"module"},a),(a=as.get(y))&&nw(s,a),w=u.createElement("script"),Yt(w),In(w,"link",s),u.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},f.set(y,w))}}function YO(s,a,u,f){var y=(y=se.current)?Wm(y):null;if(!y)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(a=lc(u.href),u=ya(y).hoistableStyles,f=u.get(a),f||(f={type:"style",instance:null,count:0,state:null},u.set(a,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){s=lc(u.href);var w=ya(y).hoistableStyles,T=w.get(s);if(T||(y=y.ownerDocument||y,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(s,T),(w=y.querySelector(Sd(s)))&&!w._p&&(T.instance=w,T.state.loading=5),as.has(s)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},as.set(s,u),w||nte(y,s,u,T.state))),a&&f===null)throw Error(r(528,""));return T}if(a&&f!==null)throw Error(r(529,""));return null;case"script":return a=u.async,u=u.src,typeof u=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=cc(u),u=ya(y).hoistableScripts,f=u.get(a),f||(f={type:"script",instance:null,count:0,state:null},u.set(a,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function lc(s){return'href="'+hr(s)+'"'}function Sd(s){return'link[rel="stylesheet"]['+s+"]"}function WO(s){return g({},s,{"data-precedence":s.precedence,precedence:null})}function nte(s,a,u,f){s.querySelector('link[rel="preload"][as="style"]['+a+"]")?f.loading=1:(a=s.createElement("link"),f.preload=a,a.addEventListener("load",function(){return f.loading|=1}),a.addEventListener("error",function(){return f.loading|=2}),In(a,"link",u),Yt(a),s.head.appendChild(a))}function cc(s){return'[src="'+hr(s)+'"]'}function jd(s){return"script[async]"+s}function XO(s,a,u){if(a.count++,a.instance===null)switch(a.type){case"style":var f=s.querySelector('style[data-href~="'+hr(u.href)+'"]');if(f)return a.instance=f,Yt(f),f;var y=g({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return f=(s.ownerDocument||s).createElement("style"),Yt(f),In(f,"style",y),Xm(f,u.precedence,s),a.instance=f;case"stylesheet":y=lc(u.href);var w=s.querySelector(Sd(y));if(w)return a.state.loading|=4,a.instance=w,Yt(w),w;f=WO(u),(y=as.get(y))&&tw(f,y),w=(s.ownerDocument||s).createElement("link"),Yt(w);var T=w;return T._p=new Promise(function(O,X){T.onload=O,T.onerror=X}),In(w,"link",f),a.state.loading|=4,Xm(w,u.precedence,s),a.instance=w;case"script":return w=cc(u.src),(y=s.querySelector(jd(w)))?(a.instance=y,Yt(y),y):(f=u,(y=as.get(w))&&(f=g({},u),nw(f,y)),s=s.ownerDocument||s,y=s.createElement("script"),Yt(y),In(y,"link",f),s.head.appendChild(y),a.instance=y);case"void":return null;default:throw Error(r(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(f=a.instance,a.state.loading|=4,Xm(f,u.precedence,s));return a.instance}function Xm(s,a,u){for(var f=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=f.length?f[f.length-1]:null,w=y,T=0;T<f.length;T++){var O=f[T];if(O.dataset.precedence===a)w=O;else if(w!==y)break}w?w.parentNode.insertBefore(s,w.nextSibling):(a=u.nodeType===9?u.head:u,a.insertBefore(s,a.firstChild))}function tw(s,a){s.crossOrigin==null&&(s.crossOrigin=a.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=a.referrerPolicy),s.title==null&&(s.title=a.title)}function nw(s,a){s.crossOrigin==null&&(s.crossOrigin=a.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=a.referrerPolicy),s.integrity==null&&(s.integrity=a.integrity)}var Qm=null;function QO(s,a,u){if(Qm===null){var f=new Map,y=Qm=new Map;y.set(u,f)}else y=Qm,f=y.get(u),f||(f=new Map,y.set(u,f));if(f.has(s))return f;for(f.set(s,null),u=u.getElementsByTagName(s),y=0;y<u.length;y++){var w=u[y];if(!(w[ho]||w[Cn]||s==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var T=w.getAttribute(a)||"";T=s+T;var O=f.get(T);O?O.push(w):f.set(T,[w])}}return f}function ZO(s,a,u){s=s.ownerDocument||s,s.head.insertBefore(u,a==="title"?s.querySelector("head > title"):null)}function rte(s,a,u){if(u===1||a.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return s=a.disabled,typeof a.precedence=="string"&&s==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function JO(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function ste(s,a,u,f){if(u.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var y=lc(f.href),w=a.querySelector(Sd(y));if(w){a=w._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(s.count++,s=Zm.bind(s),a.then(s,s)),u.state.loading|=4,u.instance=w,Yt(w);return}w=a.ownerDocument||a,f=WO(f),(y=as.get(y))&&tw(f,y),w=w.createElement("link"),Yt(w);var T=w;T._p=new Promise(function(O,X){T.onload=O,T.onerror=X}),In(w,"link",f),u.instance=w}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(u,a),(a=u.state.preload)&&(u.state.loading&3)===0&&(s.count++,u=Zm.bind(s),a.addEventListener("load",u),a.addEventListener("error",u))}}var rw=0;function ate(s,a){return s.stylesheets&&s.count===0&&ep(s,s.stylesheets),0<s.count||0<s.imgCount?function(u){var f=setTimeout(function(){if(s.stylesheets&&ep(s,s.stylesheets),s.unsuspend){var w=s.unsuspend;s.unsuspend=null,w()}},6e4+a);0<s.imgBytes&&rw===0&&(rw=62500*$ee());var y=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&ep(s,s.stylesheets),s.unsuspend)){var w=s.unsuspend;s.unsuspend=null,w()}},(s.imgBytes>rw?50:800)+a);return s.unsuspend=u,function(){s.unsuspend=null,clearTimeout(f),clearTimeout(y)}}:null}function Zm(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ep(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Jm=null;function ep(s,a){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Jm=new Map,a.forEach(ite,s),Jm=null,Zm.call(s))}function ite(s,a){if(!(a.state.loading&4)){var u=Jm.get(s);if(u)var f=u.get(null);else{u=new Map,Jm.set(s,u);for(var y=s.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<y.length;w++){var T=y[w];(T.nodeName==="LINK"||T.getAttribute("media")!=="not all")&&(u.set(T.dataset.precedence,T),f=T)}f&&u.set(null,f)}y=a.instance,T=y.getAttribute("data-precedence"),w=u.get(T)||f,w===f&&u.set(null,y),u.set(T,y),this.count++,f=Zm.bind(this),y.addEventListener("load",f),y.addEventListener("error",f),w?w.parentNode.insertBefore(y,w.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(y,s.firstChild)),a.state.loading|=4}}var Cd={$$typeof:E,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function ote(s,a,u,f,y,w,T,O,X){this.tag=1,this.containerInfo=s,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=An(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=An(0),this.hiddenUpdates=An(null),this.identifierPrefix=f,this.onUncaughtError=y,this.onCaughtError=w,this.onRecoverableError=T,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=X,this.incompleteTransitions=new Map}function ez(s,a,u,f,y,w,T,O,X,ce,me,xe){return s=new ote(s,a,u,T,X,ce,me,xe,O),a=1,w===!0&&(a|=24),w=Mr(3,null,null,a),s.current=w,w.stateNode=s,a=Pb(),a.refCount++,s.pooledCache=a,a.refCount++,w.memoizedState={element:f,isDehydrated:u,cache:a},Bb(w),s}function tz(s){return s?(s=Bl,s):Bl}function nz(s,a,u,f,y,w){y=tz(y),f.context===null?f.context=y:f.pendingContext=y,f=gi(a),f.payload={element:u},w=w===void 0?null:w,w!==null&&(f.callback=w),u=xi(s,f,a),u!==null&&(br(u,s,a),nd(u,s,a))}function rz(s,a){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var u=s.retryLane;s.retryLane=u!==0&&u<a?u:a}}function sw(s,a){rz(s,a),(s=s.alternate)&&rz(s,a)}function sz(s){if(s.tag===13||s.tag===31){var a=xo(s,67108864);a!==null&&br(a,s,67108864),sw(s,67108864)}}function az(s){if(s.tag===13||s.tag===31){var a=Pr();a=xa(a);var u=xo(s,a);u!==null&&br(u,s,a),sw(s,a)}}var tp=!0;function lte(s,a,u,f){var y=M.T;M.T=null;var w=U.p;try{U.p=2,aw(s,a,u,f)}finally{U.p=w,M.T=y}}function cte(s,a,u,f){var y=M.T;M.T=null;var w=U.p;try{U.p=8,aw(s,a,u,f)}finally{U.p=w,M.T=y}}function aw(s,a,u,f){if(tp){var y=iw(f);if(y===null)q0(s,a,f,np,u),oz(s,f);else if(dte(y,s,a,u,f))f.stopPropagation();else if(oz(s,f),a&4&&-1<ute.indexOf(s)){for(;y!==null;){var w=Xr(y);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var T=Ue(w.pendingLanes);if(T!==0){var O=w;for(O.pendingLanes|=2,O.entangledLanes|=2;T;){var X=1<<31-lt(T);O.entanglements[1]|=X,T&=~X}Gs(w),(Et&6)===0&&(Im=ge()+500,vd(0))}}break;case 31:case 13:O=xo(w,2),O!==null&&br(O,w,2),Bm(),sw(w,2)}if(w=iw(f),w===null&&q0(s,a,f,np,u),w===y)break;y=w}y!==null&&f.stopPropagation()}else q0(s,a,f,null,u)}}function iw(s){return s=ct(s),ow(s)}var np=null;function ow(s){if(np=null,s=oi(s),s!==null){var a=o(s);if(a===null)s=null;else{var u=a.tag;if(u===13){if(s=c(a),s!==null)return s;s=null}else if(u===31){if(s=d(a),s!==null)return s;s=null}else if(u===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;s=null}else a!==s&&(s=null)}}return np=s,null}function iz(s){switch(s){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ye()){case je:return 2;case kt:return 8;case zt:case Qn:return 32;case hn:return 268435456;default:return 32}default:return 32}}var lw=!1,Ei=null,Ri=null,Ai=null,kd=new Map,Nd=new Map,Mi=[],ute="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 oz(s,a){switch(s){case"focusin":case"focusout":Ei=null;break;case"dragenter":case"dragleave":Ri=null;break;case"mouseover":case"mouseout":Ai=null;break;case"pointerover":case"pointerout":kd.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Nd.delete(a.pointerId)}}function Td(s,a,u,f,y,w){return s===null||s.nativeEvent!==w?(s={blockedOn:a,domEventName:u,eventSystemFlags:f,nativeEvent:w,targetContainers:[y]},a!==null&&(a=Xr(a),a!==null&&sz(a)),s):(s.eventSystemFlags|=f,a=s.targetContainers,y!==null&&a.indexOf(y)===-1&&a.push(y),s)}function dte(s,a,u,f,y){switch(a){case"focusin":return Ei=Td(Ei,s,a,u,f,y),!0;case"dragenter":return Ri=Td(Ri,s,a,u,f,y),!0;case"mouseover":return Ai=Td(Ai,s,a,u,f,y),!0;case"pointerover":var w=y.pointerId;return kd.set(w,Td(kd.get(w)||null,s,a,u,f,y)),!0;case"gotpointercapture":return w=y.pointerId,Nd.set(w,Td(Nd.get(w)||null,s,a,u,f,y)),!0}return!1}function lz(s){var a=oi(s.target);if(a!==null){var u=o(a);if(u!==null){if(a=u.tag,a===13){if(a=c(u),a!==null){s.blockedOn=a,Yh(s.priority,function(){az(u)});return}}else if(a===31){if(a=d(u),a!==null){s.blockedOn=a,Yh(s.priority,function(){az(u)});return}}else if(a===3&&u.stateNode.current.memoizedState.isDehydrated){s.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}s.blockedOn=null}function rp(s){if(s.blockedOn!==null)return!1;for(var a=s.targetContainers;0<a.length;){var u=iw(s.nativeEvent);if(u===null){u=s.nativeEvent;var f=new u.constructor(u.type,u);Rt=f,u.target.dispatchEvent(f),Rt=null}else return a=Xr(u),a!==null&&sz(a),s.blockedOn=u,!1;a.shift()}return!0}function cz(s,a,u){rp(s)&&u.delete(a)}function fte(){lw=!1,Ei!==null&&rp(Ei)&&(Ei=null),Ri!==null&&rp(Ri)&&(Ri=null),Ai!==null&&rp(Ai)&&(Ai=null),kd.forEach(cz),Nd.forEach(cz)}function sp(s,a){s.blockedOn===a&&(s.blockedOn=null,lw||(lw=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,fte)))}var ap=null;function uz(s){ap!==s&&(ap=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ap===s&&(ap=null);for(var a=0;a<s.length;a+=3){var u=s[a],f=s[a+1],y=s[a+2];if(typeof f!="function"){if(ow(f||u)===null)continue;break}var w=Xr(u);w!==null&&(s.splice(a,3),a-=3,i0(w,{pending:!0,data:y,method:u.method,action:f},f,y))}}))}function uc(s){function a(X){return sp(X,s)}Ei!==null&&sp(Ei,s),Ri!==null&&sp(Ri,s),Ai!==null&&sp(Ai,s),kd.forEach(a),Nd.forEach(a);for(var u=0;u<Mi.length;u++){var f=Mi[u];f.blockedOn===s&&(f.blockedOn=null)}for(;0<Mi.length&&(u=Mi[0],u.blockedOn===null);)lz(u),u.blockedOn===null&&Mi.shift();if(u=(s.ownerDocument||s).$$reactFormReplay,u!=null)for(f=0;f<u.length;f+=3){var y=u[f],w=u[f+1],T=y[kn]||null;if(typeof w=="function")T||uz(u);else if(T){var O=null;if(w&&w.hasAttribute("formAction")){if(y=w,T=w[kn]||null)O=T.formAction;else if(ow(y)!==null)continue}else O=T.action;typeof O=="function"?u[f+1]=O:(u.splice(f,3),f-=3),uz(u)}}}function dz(){function s(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(T){return y=T})},focusReset:"manual",scroll:"manual"})}function a(){y!==null&&(y(),y=null),f||setTimeout(u,20)}function u(){if(!f&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var f=!1,y=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(u,100),function(){f=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),y!==null&&(y(),y=null)}}}function cw(s){this._internalRoot=s}ip.prototype.render=cw.prototype.render=function(s){var a=this._internalRoot;if(a===null)throw Error(r(409));var u=a.current,f=Pr();nz(u,f,s,a,null,null)},ip.prototype.unmount=cw.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var a=s.containerInfo;nz(s.current,2,null,s,null,null),Bm(),a[Wr]=null}};function ip(s){this._internalRoot=s}ip.prototype.unstable_scheduleHydration=function(s){if(s){var a=fr();s={blockedOn:null,target:s,priority:a};for(var u=0;u<Mi.length&&a!==0&&a<Mi[u].priority;u++);Mi.splice(u,0,s),u===0&&lz(s)}};var fz=t.version;if(fz!=="19.2.7")throw Error(r(527,fz,"19.2.7"));U.findDOMNode=function(s){var a=s._reactInternals;if(a===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=m(a),s=s!==null?x(s):null,s=s===null?null:s.stateNode,s};var hte={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var op=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!op.isDisabled&&op.supportsFiber)try{Jn=op.inject(hte),we=op}catch{}}return fc.createRoot=function(s,a){if(!i(s))throw Error(r(299));var u=!1,f="",y=y_,w=b_,T=w_;return a!=null&&(a.unstable_strictMode===!0&&(u=!0),a.identifierPrefix!==void 0&&(f=a.identifierPrefix),a.onUncaughtError!==void 0&&(y=a.onUncaughtError),a.onCaughtError!==void 0&&(w=a.onCaughtError),a.onRecoverableError!==void 0&&(T=a.onRecoverableError)),a=ez(s,1,!1,null,null,u,f,null,y,w,T,dz),s[Wr]=a.current,H0(s),new cw(a)},fc.hydrateRoot=function(s,a,u){if(!i(s))throw Error(r(299));var f=!1,y="",w=y_,T=b_,O=w_,X=null;return u!=null&&(u.unstable_strictMode===!0&&(f=!0),u.identifierPrefix!==void 0&&(y=u.identifierPrefix),u.onUncaughtError!==void 0&&(w=u.onUncaughtError),u.onCaughtError!==void 0&&(T=u.onCaughtError),u.onRecoverableError!==void 0&&(O=u.onRecoverableError),u.formState!==void 0&&(X=u.formState)),a=ez(s,1,!0,a,u??null,f,y,X,w,T,O,dz),a.context=tz(null),u=a.current,f=Pr(),f=xa(f),y=gi(f),y.callback=null,xi(u,y,f),u=f,a.current.lanes=u,At(a,u),Gs(a),s[Wr]=a.current,H0(s),new ip(a)},fc.version="19.2.7",fc}var ww;function Cz(){if(ww)return cp.exports;ww=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),cp.exports=jz(),cp.exports}var kz=Cz();const rt=e=>typeof e=="string",hc=()=>{let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n},Sw=e=>e==null?"":String(e),Nz=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},Tz=/###/g,jw=e=>e&&e.includes("###")?e.replace(Tz,"."):e,Cw=e=>!e||rt(e),mc=(e,t,n)=>{const r=rt(t)?t.split("."):t;let i=0;for(;i<r.length-1;){if(Cw(e))return{};const o=jw(r[i]);!e[o]&&n&&(e[o]=new n),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={},++i}return Cw(e)?{}:{obj:e,k:jw(r[i])}},kw=(e,t,n)=>{const{obj:r,k:i}=mc(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let o=t[t.length-1],c=t.slice(0,t.length-1),d=mc(e,c,Object);for(;d.obj===void 0&&c.length;)o=`${c[c.length-1]}.${o}`,c=c.slice(0,c.length-1),d=mc(e,c,Object),d!=null&&d.obj&&typeof d.obj[`${d.k}.${o}`]<"u"&&(d.obj=void 0);d.obj[`${d.k}.${o}`]=n},Ez=(e,t,n,r)=>{const{obj:i,k:o}=mc(e,t,Object);i[o]=i[o]||[],i[o].push(n)},Rd=(e,t)=>{const{obj:n,k:r}=mc(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Rz=(e,t,n)=>{const r=Rd(e,n);return r!==void 0?r:Rd(t,n)},Nw=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?rt(e[r])||e[r]instanceof String||rt(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Nw(e[r],t[r],n):e[r]=t[r]);return e},Ys=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),Az={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},Mz=e=>rt(e)?e.replace(/[&<>"'\/]/g,t=>Az[t]):e;class Dz{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const _z=[" ",",","?","!",";"],Oz=new Dz(20),zz=(e,t,n)=>{t=t||"",n=n||"";const r=_z.filter(c=>!t.includes(c)&&!n.includes(c));if(r.length===0)return!0;const i=Oz.getRegExp(`(${r.map(c=>c==="?"?"\\?":c).join("|")})`);let o=!i.test(e);if(!o){const c=e.indexOf(n);c>0&&!i.test(e.substring(0,c))&&(o=!0)}return o},hp=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let i=e;for(let o=0;o<r.length;){if(!i||typeof i!="object")return;let c,d="";for(let h=o;h<r.length;++h)if(h!==o&&(d+=n),d+=r[h],c=i[d],c!==void 0){if(["string","number","boolean"].includes(typeof c)&&h<r.length-1)continue;o+=h-o+1;break}i=c}return i},pc=e=>e==null?void 0:e.replace(/_/g,"-"),Pz={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,r;(r=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||r.call(n,console,t)}};class Ad{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||Pz,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,i){return i&&!this.debug?null:(t=t.map(o=>rt(o)?o.replace(/[\r\n\x00-\x1F\x7F]/g," "):o),rt(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new Ad(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Ad(this.logger,t)}}var js=new Ad;class Md{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}once(t,n){const r=(...i)=>{n(...i),this.off(t,r)};return this.on(t,r),this}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([i,o])=>{for(let c=0;c<o;c++)i(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([i,o])=>{for(let c=0;c<o;c++)i(t,...n)})}}class Tw extends Md{constructor(t,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.includes(t)||this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r,i={}){var m,x;const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,c=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let d;t.includes(".")?d=t.split("."):(d=[t,n],r&&(Array.isArray(r)?d.push(...r):rt(r)&&o?d.push(...r.split(o)):d.push(r)));const h=Rd(this.data,d);return!h&&!n&&!r&&t.includes(".")&&(t=d[0],n=d[1],r=d.slice(2).join(".")),h||!c||!rt(r)?h:hp((x=(m=this.data)==null?void 0:m[t])==null?void 0:x[n],r,o)}addResource(t,n,r,i,o={silent:!1}){const c=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let d=[t,n];r&&(d=d.concat(c?r.split(c):r)),t.includes(".")&&(d=t.split("."),i=n,n=d[1]),this.addNamespaces(n),kw(this.data,d,i),o.silent||this.emit("added",t,n,r,i)}addResources(t,n,r,i={silent:!1}){for(const o in r)(rt(r[o])||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});i.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,i,o,c={silent:!1,skipCopy:!1}){let d=[t,n];t.includes(".")&&(d=t.split("."),i=r,r=n,n=d[1]),this.addNamespaces(n);let h=Rd(this.data,d)||{};c.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?Nw(h,r,o):h={...h,...r},kw(this.data,d,h),c.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var Ew={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(o=>{var c;t=((c=this.processors[o])==null?void 0:c.process(t,n,r,i))??t}),t}};const Rw=Symbol("i18next/PATH_KEY");function Lz(){const e=[],t=Object.create(null);let n;return t.get=(r,i)=>{var o;return(o=n==null?void 0:n.revoke)==null||o.call(n),i===Rw?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Do(e,t){const{[Rw]:n}=e(Lz()),r=(t==null?void 0:t.keySeparator)??".",i=(t==null?void 0:t.nsSeparator)??":",o=(t==null?void 0:t.enableSelector)==="strict";if(n.length>1&&i){const c=t==null?void 0:t.ns,d=o?Array.isArray(c)?c:c?[c]:null:Array.isArray(c)?c:null;if(d&&(o?d:d.length>1?d.slice(1):[]).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}const mp=e=>!rt(e)&&typeof e!="boolean"&&typeof e!="number";class Dd extends Md{constructor(t,n={}){super(),Nz(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=js.create("translator"),this.checkedLoadedFor={}}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const r={...n};if(t==null)return!1;const i=this.resolve(t,r);if((i==null?void 0:i.res)===void 0)return!1;const o=mp(i.res);return!(r.returnObjects===!1&&o)}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const c=r&&t.includes(r),d=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!zz(t,r,i);if(c&&!d){const h=t.match(this.interpolator.nestingRegexp);if(h&&h.length>0)return{key:t,namespaces:rt(o)?[o]:o};const m=t.split(r);(r!==i||r===i&&this.options.ns.includes(m[0]))&&(o=m.shift()),t=m.join(i)}return{key:t,namespaces:rt(o)?[o]:o}}translate(t,n,r){let i=typeof n=="object"?{...n}:n;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i={...i}),i||(i={}),t==null)return"";typeof t=="function"&&(t=Do(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(H=>typeof H=="function"?Do(H,{...this.options,...i}):String(H));const o=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,c=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:d,namespaces:h}=this.extractFromKey(t[t.length-1],i),m=h[h.length-1];let x=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;x===void 0&&(x=":");const g=i.lng||this.language,v=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((g==null?void 0:g.toLowerCase())==="cimode")return v?o?{res:`${m}${x}${d}`,usedKey:d,exactUsedKey:d,usedLng:g,usedNS:m,usedParams:this.getUsedParamsDetails(i)}:`${m}${x}${d}`:o?{res:d,usedKey:d,exactUsedKey:d,usedLng:g,usedNS:m,usedParams:this.getUsedParamsDetails(i)}:d;const S=this.resolve(t,i);let b=S==null?void 0:S.res;const j=(S==null?void 0:S.usedKey)||d,C=(S==null?void 0:S.exactUsedKey)||d,k=["[object Number]","[object Function]","[object RegExp]"],N=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,E=!this.i18nFormat||this.i18nFormat.handleAsObject,R=i.count!==void 0&&!rt(i.count),A=Dd.hasDefaultValue(i),_=R?this.pluralResolver.getSuffix(g,i.count,i):"",z=i.ordinal&&R?this.pluralResolver.getSuffix(g,i.count,{ordinal:!1}):"",D=R&&!i.ordinal&&i.count===0,V=D&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${_}`]||i[`defaultValue${z}`]||i.defaultValue;let I=b;E&&!b&&A&&(I=V);const Q=mp(I),B=Object.prototype.toString.apply(I);if(E&&I&&Q&&!k.includes(B)&&!(rt(N)&&Array.isArray(I))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const H=this.options.returnedObjectHandler?this.options.returnedObjectHandler(j,I,{...i,ns:h}):`key '${d} (${this.language})' returned an object instead of string.`;return o?(S.res=H,S.usedParams=this.getUsedParamsDetails(i),S):H}if(c){const H=Array.isArray(I),ee=H?[]:{},W=H?C:j;for(const M in I)if(Object.prototype.hasOwnProperty.call(I,M)){const U=`${W}${c}${M}`;A&&!b?ee[M]=this.translate(U,{...i,defaultValue:mp(V)?V[M]:void 0,joinArrays:!1,ns:h}):ee[M]=this.translate(U,{...i,joinArrays:!1,ns:h}),ee[M]===U&&(ee[M]=I[M])}b=ee}}else if(E&&rt(N)&&Array.isArray(b))b=b.join(N),b&&(b=this.extendTranslation(b,t,i,r));else{let H=!1,ee=!1;!this.isValidLookup(b)&&A&&(H=!0,b=V),this.isValidLookup(b)||(ee=!0,b=d);const M=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&ee?void 0:b,U=A&&V!==b&&this.options.updateMissing;if(ee||H||U){if(this.logger.log(U?"updateKey":"missingKey",g,m,R&&!U?`${d}${this.pluralResolver.getSuffix(g,i.count,i)}`:d,U?V:b),c){const P=this.resolve(d,{...i,keySeparator:!1});P&&P.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let K=[];const ne=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ne&&ne[0])for(let P=0;P<ne.length;P++)K.push(ne[P]);else this.options.saveMissingTo==="all"?K=this.languageUtils.toResolveHierarchy(i.lng||this.language):K.push(i.lng||this.language);const q=(P,L,G)=>{var $;const J=A&&G!==b?G:M;this.options.missingKeyHandler?this.options.missingKeyHandler(P,m,L,J,U,i):($=this.backendConnector)!=null&&$.saveMissing&&this.backendConnector.saveMissing(P,m,L,J,U,i),this.emit("missingKey",P,m,L,b)};this.options.saveMissing&&(this.options.saveMissingPlurals&&R?K.forEach(P=>{const L=this.pluralResolver.getSuffixes(P,i);D&&i[`defaultValue${this.options.pluralSeparator}zero`]&&!L.includes(`${this.options.pluralSeparator}zero`)&&L.push(`${this.options.pluralSeparator}zero`),L.forEach(G=>{q([P],d+G,i[`defaultValue${G}`]||V)})}):q(K,d,V))}b=this.extendTranslation(b,t,i,S,r),ee&&b===d&&this.options.appendNamespaceToMissingKey&&(b=`${m}${x}${d}`),(ee||H)&&this.options.parseMissingKeyHandler&&(b=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${m}${x}${d}`:d,H?b:void 0,i))}return o?(S.res=b,S.usedParams=this.getUsedParamsDetails(i),S):b}extendTranslation(t,n,r,i,o){var h,m;if((h=this.i18nFormat)!=null&&h.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const x=rt(t)&&(((m=r==null?void 0:r.interpolation)==null?void 0:m.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let g;if(x){const S=t.match(this.interpolator.nestingRegexp);g=S&&S.length}let v=r.replace&&!rt(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(v={...this.options.interpolation.defaultVariables,...v}),t=this.interpolator.interpolate(t,v,r.lng||this.language||i.usedLng,r),x){const S=t.match(this.interpolator.nestingRegexp),b=S&&S.length;g<b&&(r.nest=!1)}!r.lng&&i&&i.res&&(r.lng=this.language||i.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,(...S)=>(o==null?void 0:o[0])===S[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${S[0]} in key: ${n[0]}`),null):this.translate(...S,n),r)),r.interpolation&&this.interpolator.reset()}const c=r.postProcess||this.options.postProcess,d=rt(c)?[c]:c;return t!=null&&(d!=null&&d.length)&&r.applyPostProcessor!==!1&&(t=Ew.handle(d,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,n={}){let r,i,o,c,d;return rt(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(h=>typeof h=="function"?Do(h,{...this.options,...n}):h)),t.forEach(h=>{if(this.isValidLookup(r))return;const m=this.extractFromKey(h,n),x=m.key;i=x;let g=m.namespaces;this.options.fallbackNS&&(g=g.concat(this.options.fallbackNS));const v=n.count!==void 0&&!rt(n.count),S=v&&!n.ordinal&&n.count===0,b=n.context!==void 0&&(rt(n.context)||typeof n.context=="number")&&n.context!=="",j=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);g.forEach(C=>{var k,N;this.isValidLookup(r)||(d=C,!this.checkedLoadedFor[`${j[0]}-${C}`]&&((k=this.utils)!=null&&k.hasLoadedNamespace)&&!((N=this.utils)!=null&&N.hasLoadedNamespace(d))&&(this.checkedLoadedFor[`${j[0]}-${C}`]=!0,this.logger.warn(`key "${i}" for languages "${j.join(", ")}" won't get resolved as namespace "${d}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),j.forEach(E=>{var _;if(this.isValidLookup(r))return;c=E;const R=[x];if((_=this.i18nFormat)!=null&&_.addLookupKeys)this.i18nFormat.addLookupKeys(R,x,E,C,n);else{let z;v&&(z=this.pluralResolver.getSuffix(E,n.count,n));const D=`${this.options.pluralSeparator}zero`,V=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(v&&(n.ordinal&&z.startsWith(V)&&R.push(x+z.replace(V,this.options.pluralSeparator)),R.push(x+z),S&&R.push(x+D)),b){const I=`${x}${this.options.contextSeparator||"_"}${n.context}`;R.push(I),v&&(n.ordinal&&z.startsWith(V)&&R.push(I+z.replace(V,this.options.pluralSeparator)),R.push(I+z),S&&R.push(I+D))}}let A;for(;A=R.pop();)this.isValidLookup(r)||(o=A,r=this.getResource(E,C,A,n))}))})}),{res:r,usedKey:i,exactUsedKey:o,usedLng:c,usedNS:d}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r,i={}){var o;return(o=this.i18nFormat)!=null&&o.getResource?this.i18nFormat.getResource(t,n,r,i):this.resourceStore.getResource(t,n,r,i)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!rt(t.replace);let i=r?t.replace:t;if(r&&typeof t.count<"u"&&(i.count=t.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const o of n)delete i[o]}return i}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&r.startsWith(n)&&t[r]!==void 0)return!0;return!1}}class Aw{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=js.create("languageUtils")}getScriptPartFromCode(t){if(t=pc(t),!t||!t.includes("-"))return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=pc(t),!t||!t.includes("-"))return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(rt(t)&&t.includes("-")){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(t)}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const i=this.getScriptPartFromCode(r);if(this.isSupportedCode(i))return n=i;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(c=>c===o?!0:!c.includes("-")&&!o.includes("-")?!1:!!(c.includes("-")&&!o.includes("-")&&c.slice(0,c.indexOf("-"))===o||c.startsWith(o)&&o.length>1))}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),rt(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),i=[],o=c=>{c&&(this.isSupportedCode(c)?i.push(c):this.logger.warn(`rejecting language code not found in supportedLngs: ${c}`))};return rt(t)&&(t.includes("-")||t.includes("_"))?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):rt(t)&&o(this.formatLanguageCode(t)),r.forEach(c=>{i.includes(c)||o(this.formatLanguageCode(c))}),i}}const Mw={zero:0,one:1,two:2,few:3,many:4,other:5},Dw={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Iz{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=js.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const r=pc(t==="dev"?"en":t),i=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let c;try{c=new Intl.PluralRules(r,{type:i})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),Dw;if(!t.match(/-|_/))return Dw;const h=this.languageUtils.getLanguagePartFromCode(t);c=this.getRule(h,n)}return this.pluralRulesCache[o]=c,c}needsPlural(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,r={}){return this.getSuffixes(t,r).map(i=>`${n}${i}`)}getSuffixes(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((i,o)=>Mw[i]-Mw[o]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(t,n,r={}){const i=this.getRule(t,r);return i?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const _w=(e,t,n,r=".",i=!0)=>{let o=Rz(e,t,n);return!o&&i&&rt(n)&&(o=hp(e,n,r),o===void 0&&(o=hp(t,n,r))),o},pp=e=>e.replace(/\$/g,"$$$$");class Ow{constructor(t={}){var n;this.logger=js.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(r=>r),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:i,prefix:o,prefixEscaped:c,suffix:d,suffixEscaped:h,formatSeparator:m,unescapeSuffix:x,unescapePrefix:g,nestingPrefix:v,nestingPrefixEscaped:S,nestingSuffix:b,nestingSuffixEscaped:j,nestingOptionsSeparator:C,maxReplaces:k,alwaysFormat:N}=t.interpolation;this.escape=n!==void 0?n:Mz,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=o?Ys(o):c||"{{",this.suffix=d?Ys(d):h||"}}",this.formatSeparator=m||",",this.unescapePrefix=x?"":g?Ys(g):"-",this.unescapeSuffix=this.unescapePrefix?"":x?Ys(x):"",this.nestingPrefix=v?Ys(v):S||Ys("$t("),this.nestingSuffix=b?Ys(b):j||Ys(")"),this.nestingOptionsSeparator=C||",",this.maxReplaces=k||1e3,this.alwaysFormat=N!==void 0?N:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,r,i){var S;let o,c,d;const h=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},m=b=>{if(!b.includes(this.formatSeparator)){const N=_w(n,h,b,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(N,void 0,r,{...i,...n,interpolationkey:b}):N}const j=b.split(this.formatSeparator),C=j.shift().trim(),k=j.join(this.formatSeparator).trim();return this.format(_w(n,h,C,this.options.keySeparator,this.options.ignoreJSONStructure),k,r,{...i,...n,interpolationkey:C})};this.resetRegExp(),!this.escapeValue&&typeof t=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(t)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const x=(i==null?void 0:i.missingInterpolationHandler)||this.options.missingInterpolationHandler,g=((S=i==null?void 0:i.interpolation)==null?void 0:S.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:b=>pp(b)},{regex:this.regexp,safeValue:b=>this.escapeValue?pp(this.escape(b)):pp(b)}].forEach(b=>{for(d=0;o=b.regex.exec(t);){const j=o[1].trim();if(c=m(j),c===void 0)if(typeof x=="function"){const k=x(t,o,i);c=rt(k)?k:""}else if(i&&Object.prototype.hasOwnProperty.call(i,j))c="";else if(g){c=o[0];continue}else this.logger.warn(`missed to pass in variable ${j} for interpolating ${t}`),c="";else!rt(c)&&!this.useRawValueToEscape&&(c=Sw(c));const C=b.safeValue(c);if(t=t.replace(o[0],C),g?(b.regex.lastIndex+=c.length,b.regex.lastIndex-=o[0].length):b.regex.lastIndex=0,d++,d>=this.maxReplaces)break}}),t}nest(t,n,r={}){let i,o,c;const d=(h,m)=>{const x=this.nestingOptionsSeparator;if(!h.includes(x))return h;const g=h.split(new RegExp(`${Ys(x)}[ ]*{`));let v=`{${g[1]}`;h=g[0],v=this.interpolate(v,c);const S=v.match(/'/g),b=v.match(/"/g);(((S==null?void 0:S.length)??0)%2===0&&!b||((b==null?void 0:b.length)??0)%2!==0)&&(v=v.replace(/'/g,'"'));try{c=JSON.parse(v),m&&(c={...m,...c})}catch(j){return this.logger.warn(`failed parsing options string in nesting for key ${h}`,j),`${h}${x}${v}`}return c.defaultValue&&c.defaultValue.includes(this.prefix)&&delete c.defaultValue,h};for(;i=this.nestingRegexp.exec(t);){let h=[];c={...r},c=c.replace&&!rt(c.replace)?c.replace:c,c.applyPostProcessor=!1,delete c.defaultValue;const m=/{.*}/.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(m!==-1&&(h=i[1].slice(m).split(this.formatSeparator).map(x=>x.trim()).filter(Boolean),i[1]=i[1].slice(0,m)),o=n(d.call(this,i[1].trim(),c),c),o&&i[0]===t&&!rt(o))return o;rt(o)||(o=Sw(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),h.length&&(o=h.reduce((x,g)=>this.format(x,g,r.lng,{...r,interpolationkey:i[1].trim()}),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}const $z=e=>{let t=e.toLowerCase().trim();const n={};if(e.includes("(")){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].slice(0,-1);t==="currency"&&!i.includes(":")?n.currency||(n.currency=i.trim()):t==="relativetime"&&!i.includes(":")?n.range||(n.range=i.trim()):i.split(";").forEach(c=>{if(c){const[d,...h]=c.split(":"),m=h.join(":").trim().replace(/^'+|'+$/g,""),x=d.trim();n[x]||(n[x]=m),m==="false"&&(n[x]=!1),m==="true"&&(n[x]=!0),isNaN(m)||(n[x]=parseInt(m,10))}})}return{formatName:t,formatOptions:n}},zw=e=>{const t={};return(n,r,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const c=r+JSON.stringify(o);let d=t[c];return d||(d=e(pc(r),i),t[c]=d),d(n)}},Bz=e=>(t,n,r)=>e(pc(n),r)(t);class Uz{constructor(t={}){this.logger=js.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?zw:Bz;this.formats={number:r((i,o)=>{const c=new Intl.NumberFormat(i,{...o});return d=>c.format(d)}),currency:r((i,o)=>{const c=new Intl.NumberFormat(i,{...o,style:"currency"});return d=>c.format(d)}),datetime:r((i,o)=>{const c=new Intl.DateTimeFormat(i,{...o});return d=>c.format(d)}),relativetime:r((i,o)=>{const c=new Intl.RelativeTimeFormat(i,{...o});return d=>c.format(d,o.range||"day")}),list:r((i,o)=>{const c=new Intl.ListFormat(i,{...o});return d=>c.format(d)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=zw(n)}format(t,n,r,i={}){if(!n||t==null)return t;const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&!o[0].includes(")")&&o.find(d=>d.includes(")"))){const d=o.findIndex(h=>h.includes(")"));o[0]=[o[0],...o.splice(1,d)].join(this.formatSeparator)}return o.reduce((d,h)=>{var g;const{formatName:m,formatOptions:x}=$z(h);if(this.formats[m]){let v=d;try{const S=((g=i==null?void 0:i.formatParams)==null?void 0:g[i.interpolationkey])||{},b=S.locale||S.lng||i.locale||i.lng||r;v=this.formats[m](d,b,{...x,...i,...S})}catch(S){this.logger.warn(S)}return v}else this.logger.warn(`there was no format function for ${m}`);return d},t)}}const Vz=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class Fz extends Md{constructor(t,n,r,i={}){var o,c;super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=js.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],(c=(o=this.backend)==null?void 0:o.init)==null||c.call(o,r,i.backend,i)}queueLoad(t,n,r,i){const o={},c={},d={},h={};return t.forEach(m=>{let x=!0;n.forEach(g=>{const v=`${m}|${g}`;!r.reload&&this.store.hasResourceBundle(m,g)?this.state[v]=2:this.state[v]<0||(this.state[v]===1?c[v]===void 0&&(c[v]=!0):(this.state[v]=1,x=!1,c[v]===void 0&&(c[v]=!0),o[v]===void 0&&(o[v]=!0),h[g]===void 0&&(h[g]=!0)))}),x||(d[m]=!0)}),(Object.keys(o).length||Object.keys(c).length)&&this.queue.push({pending:c,pendingCount:Object.keys(c).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(c),toLoadLanguages:Object.keys(d),toLoadNamespaces:Object.keys(h)}}loaded(t,n,r){const i=t.split("|"),o=i[0],c=i[1];n&&this.emit("failedLoading",o,c,n),!n&&r&&this.store.addResourceBundle(o,c,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const d={};this.queue.forEach(h=>{Ez(h.loaded,[o],c),Vz(h,t),n&&h.errors.push(n),h.pendingCount===0&&!h.done&&(Object.keys(h.loaded).forEach(m=>{d[m]||(d[m]={});const x=h.loaded[m];x.length&&x.forEach(g=>{d[m][g]===void 0&&(d[m][g]=!0)})}),h.done=!0,h.errors.length?h.callback(h.errors):h.callback())}),this.emit("loaded",d),this.queue=this.queue.filter(h=>!h.done)}read(t,n,r,i=0,o=this.retryTimeout,c){if(!t.length)return c(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:i,wait:o,callback:c});return}this.readingCalls++;const d=(m,x)=>{if(this.readingCalls--,this.waitingReads.length>0){const g=this.waitingReads.shift();this.read(g.lng,g.ns,g.fcName,g.tried,g.wait,g.callback)}if(m&&x&&i<this.maxRetries){setTimeout(()=>{this.read(t,n,r,i+1,o*2,c)},o);return}c(m,x)},h=this.backend[r].bind(this.backend);if(h.length===2){try{const m=h(t,n);m&&typeof m.then=="function"?m.then(x=>d(null,x)).catch(d):d(null,m)}catch(m){d(m)}return}return h(t,n,d)}prepareLoading(t,n,r={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();rt(t)&&(t=this.languageUtils.toResolveHierarchy(t)),rt(n)&&(n=[n]);const o=this.queueLoad(t,n,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(c=>{this.loadOne(c)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t,n=""){const r=t.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(c,d)=>{c&&this.logger.warn(`${n}loading namespace ${o} for language ${i} failed`,c),!c&&d&&this.logger.log(`${n}loaded namespace ${o} for language ${i}`,d),this.loaded(t,c,d)})}saveMissing(t,n,r,i,o,c={},d=()=>{}){var h,m,x,g,v;if((m=(h=this.services)==null?void 0:h.utils)!=null&&m.hasLoadedNamespace&&!((g=(x=this.services)==null?void 0:x.utils)!=null&&g.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if((v=this.backend)!=null&&v.create){const S={...c,isUpdate:o},b=this.backend.create.bind(this.backend);if(b.length<6)try{let j;b.length===5?j=b(t,n,r,i,S):j=b(t,n,r,i),j&&typeof j.then=="function"?j.then(C=>d(null,C)).catch(d):d(null,j)}catch(j){d(j)}else b(t,n,r,i,d,S)}!t||!t[0]||this.store.addResource(t[0],n,r,i)}}}const gp=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),rt(e[1])&&(t.defaultValue=e[1]),rt(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Pw=e=>(rt(e.ns)&&(e.ns=[e.ns]),rt(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),rt(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),_d=()=>{},Hz=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class gc extends Md{constructor(t={},n){if(super(),this.options=Pw(t),this.services={},this.logger=js,this.modules={external:[]},Hz(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(rt(t.ns)?t.defaultNS=t.ns:t.ns.includes("translation")||(t.defaultNS=t.ns[0]));const r=gp();this.options={...r,...this.options,...Pw(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=r.overloadTranslationOptionHandler);const i=m=>m?typeof m=="function"?new m:m:null;if(!this.options.isClone){this.modules.logger?js.init(i(this.modules.logger),this.options):js.init(null,this.options);let m;this.modules.formatter?m=this.modules.formatter:m=Uz;const x=new Aw(this.options);this.store=new Tw(this.options.resources,this.options);const g=this.services;g.logger=js,g.resourceStore=this.store,g.languageUtils=x,g.pluralResolver=new Iz(x,{prepend:this.options.pluralSeparator}),m&&(g.formatter=i(m),g.formatter.init&&g.formatter.init(g,this.options),this.options.interpolation.format=g.formatter.format.bind(g.formatter)),g.interpolator=new Ow(this.options),g.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},g.backendConnector=new Fz(i(this.modules.backend),g.resourceStore,g,this.options),g.backendConnector.on("*",(v,...S)=>{this.emit(v,...S)}),this.modules.languageDetector&&(g.languageDetector=i(this.modules.languageDetector),g.languageDetector.init&&g.languageDetector.init(g,this.options.detection,this.options)),this.modules.i18nFormat&&(g.i18nFormat=i(this.modules.i18nFormat),g.i18nFormat.init&&g.i18nFormat.init(this)),this.translator=new Dd(this.services,this.options),this.translator.on("*",(v,...S)=>{this.emit(v,...S)}),this.modules.external.forEach(v=>{v.init&&v.init(this)})}if(this.format=this.options.interpolation.format,n||(n=_d),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const m=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);m.length>0&&m[0]!=="dev"&&(this.options.lng=m[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(m=>{this[m]=(...x)=>this.store[m](...x)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(m=>{this[m]=(...x)=>(this.store[m](...x),this)});const d=hc(),h=()=>{const m=(x,g)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),d.resolve(g),n(x,g)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return m(null,this.t.bind(this));this.changeLanguage(this.options.lng,m)};return this.options.resources||!this.options.initAsync?h():setTimeout(h,0),d}loadResources(t,n=_d){var o,c;let r=n;const i=rt(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if((i==null?void 0:i.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const d=[],h=m=>{if(!m||m==="cimode")return;this.services.languageUtils.toResolveHierarchy(m).forEach(g=>{g!=="cimode"&&(d.includes(g)||d.push(g))})};i?h(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(x=>h(x)),(c=(o=this.options.preload)==null?void 0:o.forEach)==null||c.call(o,m=>h(m)),this.services.backendConnector.load(d,this.options.ns,m=>{!m&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(m)})}else r(null)}reloadResources(t,n,r){const i=hc();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=_d),this.services.backendConnector.reload(t,n,o=>{i.resolve(),r(o)}),i}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&Ew.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!["cimode","dev"].includes(t)){for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!["cimode","dev"].includes(r)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&!this.languages.includes(t)&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,n){this.isLanguageChangingTo=t;const r=hc();this.emit("languageChanging",t);const i=d=>{this.language=d,this.languages=this.services.languageUtils.toResolveHierarchy(d),this.resolvedLanguage=void 0,this.setResolvedLanguage(d)},o=(d,h)=>{h?this.isLanguageChangingTo===t&&(i(h),this.translator.changeLanguage(h),this.isLanguageChangingTo=void 0,this.emit("languageChanged",h),this.logger.log("languageChanged",h)):this.isLanguageChangingTo=void 0,r.resolve((...m)=>this.t(...m)),n&&n(d,(...m)=>this.t(...m))},c=d=>{var x,g;!t&&!d&&this.services.languageDetector&&(d=[]);const h=rt(d)?d:d&&d[0],m=this.store.hasLanguageSomeTranslations(h)?h:this.services.languageUtils.getBestMatchFromCodes(rt(d)?[d]:d);m&&(this.language||i(m),this.translator.language||this.translator.changeLanguage(m),(g=(x=this.services.languageDetector)==null?void 0:x.cacheUserLanguage)==null||g.call(x,m)),this.loadResources(m,v=>{o(v,m)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(c):this.services.languageDetector.detect(c):c(t),r}getFixedT(t,n,r,i){const o=i==null?void 0:i.scopeNs,c=(d,h,...m)=>{let x;typeof h!="object"?x=this.options.overloadTranslationOptionHandler([d,h].concat(m)):x={...h},x.lng=x.lng||c.lng,x.lngs=x.lngs||c.lngs;const g=x.ns!==void 0&&x.ns!==null;x.ns=x.ns||c.ns,x.keyPrefix!==""&&(x.keyPrefix=x.keyPrefix||r||c.keyPrefix);const v={...this.options,...x};Array.isArray(o)&&!g&&(v.ns=o),typeof x.keyPrefix=="function"&&(x.keyPrefix=Do(x.keyPrefix,v));const S=this.options.keySeparator||".";let b;return x.keyPrefix&&Array.isArray(d)?b=d.map(j=>(typeof j=="function"&&(j=Do(j,v)),`${x.keyPrefix}${S}${j}`)):(typeof d=="function"&&(d=Do(d,v)),b=x.keyPrefix?`${x.keyPrefix}${S}${d}`:d),this.t(b,x)};return rt(t)?c.lng=t:c.lngs=t,c.ns=n,c.keyPrefix=r,c}t(...t){var n;return(n=this.translator)==null?void 0:n.translate(...t)}exists(...t){var n;return(n=this.translator)==null?void 0:n.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const c=(d,h)=>{const m=this.services.backendConnector.state[`${d}|${h}`];return m===-1||m===0||m===2};if(n.precheck){const d=n.precheck(this,c);if(d!==void 0)return d}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||c(r,t)&&(!i||c(o,t)))}loadNamespaces(t,n){const r=hc();return this.options.ns?(rt(t)&&(t=[t]),t.forEach(i=>{this.options.ns.includes(i)||this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=hc();rt(t)&&(t=[t]);const i=this.options.preload||[],o=t.filter(c=>!i.includes(c)&&this.services.languageUtils.isSupportedCode(c));return o.length?(this.options.preload=i.concat(o),this.loadResources(c=>{r.resolve(),n&&n(c)}),r):(n&&n(),Promise.resolve())}dir(t){var i,o;if(t||(t=this.resolvedLanguage||(((i=this.languages)==null?void 0:i.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const c=new Intl.Locale(t);if(c&&c.getTextInfo){const d=c.getTextInfo();if(d&&d.direction)return d.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=((o=this.services)==null?void 0:o.languageUtils)||new Aw(gp());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.includes(r.getLanguagePartFromCode(t))||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const r=new gc(t,n);return r.createInstance=gc.createInstance,r}cloneInstance(t={},n=_d){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},o=new gc(i);if((t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(d=>{o[d]=this[d]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r){const d=Object.keys(this.store.data).reduce((h,m)=>(h[m]={...this.store.data[m]},h[m]=Object.keys(h[m]).reduce((x,g)=>(x[g]={...h[m][g]},x),h[m]),h),{});o.store=new Tw(d,i),o.services.resourceStore=o.store}if(t.interpolation){const h={...gp().interpolation,...this.options.interpolation,...t.interpolation},m={...i,interpolation:h};o.services.interpolator=new Ow(m)}return o.translator=new Dd(o.services,i),o.translator.on("*",(d,...h)=>{o.emit(d,...h)}),o.init(i,n),o.translator.options=i,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Hn=gc.createInstance();Hn.createInstance,Hn.dir,Hn.init,Hn.loadResources,Hn.reloadResources,Hn.use,Hn.changeLanguage,Hn.getFixedT,Hn.t,Hn.exists,Hn.setDefaultNamespace,Hn.hasLoadedNamespace,Hn.loadNamespaces,Hn.loadLanguages;const qz=(e,t,n,r)=>{var o,c,d,h;const i=[n,{code:t,...r||{}}];if((c=(o=e==null?void 0:e.services)==null?void 0:o.logger)!=null&&c.forward)return e.services.logger.forward(i,"warn","react-i18next::",!0);_i(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),(h=(d=e==null?void 0:e.services)==null?void 0:d.logger)!=null&&h.warn?e.services.logger.warn(...i):console!=null&&console.warn&&console.warn(...i)},Lw={},xp=(e,t,n,r)=>{_i(n)&&Lw[n]||(_i(n)&&(Lw[n]=new Date),qz(e,t,n,r))},Iw=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},vp=(e,t,n)=>{e.loadNamespaces(t,Iw(e,n))},$w=(e,t,n,r)=>{if(_i(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return vp(e,n,r);n.forEach(i=>{e.options.ns.indexOf(i)<0&&e.options.ns.push(i)}),e.loadLanguages(t,Iw(e,r))},Kz=(e,t,n={})=>!t.languages||!t.languages.length?(xp(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,i)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,e))return!1}}),_i=e=>typeof e=="string",Gz=e=>typeof e=="object"&&e!==null,Yz=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Wz={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Xz=e=>Wz[e];let yp={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(Yz,Xz),transDefaultProps:void 0};const Qz=(e={})=>{yp={...yp,...e}},Zz=()=>yp;let Bw;const Jz=e=>{Bw=e},eP=()=>Bw,tP={type:"3rdParty",init(e){Qz(e.options.react),Jz(e)}},nP=p.createContext();class rP{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var bp={exports:{}},wp={};/**
|
|
50
|
+
* @license React
|
|
51
|
+
* use-sync-external-store-shim.production.js
|
|
52
|
+
*
|
|
53
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
54
|
+
*
|
|
55
|
+
* This source code is licensed under the MIT license found in the
|
|
56
|
+
* LICENSE file in the root directory of this source tree.
|
|
57
|
+
*/var Uw;function sP(){if(Uw)return wp;Uw=1;var e=Ed();function t(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,c=e.useDebugValue;function d(g,v){var S=v(),b=r({inst:{value:S,getSnapshot:v}}),j=b[0].inst,C=b[1];return o(function(){j.value=S,j.getSnapshot=v,h(j)&&C({inst:j})},[g,S,v]),i(function(){return h(j)&&C({inst:j}),g(function(){h(j)&&C({inst:j})})},[g]),c(S),S}function h(g){var v=g.getSnapshot;g=g.value;try{var S=v();return!n(g,S)}catch{return!0}}function m(g,v){return v()}var x=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:d;return wp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:x,wp}var Vw;function aP(){return Vw||(Vw=1,bp.exports=sP()),bp.exports}var iP=aP();const oP={t:(e,t)=>{if(_i(t))return t;if(Gz(t)&&_i(t.defaultValue))return t.defaultValue;if(typeof e=="function")return"";if(Array.isArray(e)){const n=e[e.length-1];return typeof n=="function"?"":n}return e},ready:!1},lP=()=>()=>{},Sp=(e,t={})=>{var V,I,Q;const{i18n:n}=t,{i18n:r,defaultNS:i}=p.useContext(nP)||{},o=n||r||eP();o&&!o.reportNamespaces&&(o.reportNamespaces=new rP),o||xp(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const c=p.useMemo(()=>{var B;return{...Zz(),...(B=o==null?void 0:o.options)==null?void 0:B.react,...t}},[o,t]),{useSuspense:d,keyPrefix:h}=c,m=i||((V=o==null?void 0:o.options)==null?void 0:V.defaultNS),x=_i(m)?[m]:m||["translation"],g=p.useMemo(()=>x,x);(Q=(I=o==null?void 0:o.reportNamespaces)==null?void 0:I.addUsedNamespaces)==null||Q.call(I,g);const v=p.useRef(0),S=p.useCallback(B=>{if(!o)return lP;const{bindI18n:H,bindI18nStore:ee}=c,W=()=>{v.current+=1,B()};return H&&o.on(H,W),ee&&o.store.on(ee,W),()=>{H&&H.split(" ").forEach(M=>o.off(M,W)),ee&&ee.split(" ").forEach(M=>o.store.off(M,W))}},[o,c]),b=p.useRef(),j=p.useCallback(()=>{if(!o)return oP;const B=!!(o.isInitialized||o.initializedStoreOnce)&&g.every(K=>Kz(K,o,c)),H=t.lng||o.language,ee=v.current,W=b.current;if(W&&W.ready===B&&W.lng===H&&W.keyPrefix===h&&W.revision===ee)return W;const U={t:o.getFixedT(H,c.nsMode==="fallback"?g:g[0],h,{scopeNs:g}),ready:B,lng:H,keyPrefix:h,revision:ee};return b.current=U,U},[o,g,h,c,t.lng]),[C,k]=p.useState(0),{t:N,ready:E}=iP.useSyncExternalStore(S,j,j);p.useEffect(()=>{if(o&&!E&&!d){const B=()=>k(H=>H+1);t.lng?$w(o,t.lng,g,B):vp(o,g,B)}},[o,t.lng,g,E,d,C]);const R=o||{},A=p.useRef(null),_=p.useRef(),z=B=>{const H=Object.getOwnPropertyDescriptors(B);H.__original&&delete H.__original;const ee=Object.create(Object.getPrototypeOf(B),H);if(!Object.prototype.hasOwnProperty.call(ee,"__original"))try{Object.defineProperty(ee,"__original",{value:B,writable:!1,enumerable:!1,configurable:!1})}catch{}return ee},D=p.useMemo(()=>{const B=R,H=B==null?void 0:B.language;let ee=B;B&&(A.current&&A.current.__original===B?_.current!==H?(ee=z(B),A.current=ee,_.current=H):ee=A.current:(ee=z(B),A.current=ee,_.current=H));const W=!E&&!d?(...U)=>(xp(o,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),N(...U)):N,M=[W,ee,E];return M.t=W,M.i18n=ee,M.ready=E,M},[N,R,E,R.resolvedLanguage,R.language,R.languages]);if(o&&d&&!E)throw new Promise(B=>{const H=()=>B();t.lng?$w(o,t.lng,g,H):vp(o,g,H)});return D},{slice:cP,forEach:uP}=[];function dP(e){return uP.call(cP.call(arguments,1),t=>{if(t)for(const n in t)e[n]===void 0&&(e[n]=t[n])}),e}function fP(e){return typeof e!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(n=>n.test(e))}const Fw=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,hP=function(e,t){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},i=encodeURIComponent(t);let o=`${e}=${i}`;if(r.maxAge>0){const c=r.maxAge-0;if(Number.isNaN(c))throw new Error("maxAge should be a Number");o+=`; Max-Age=${Math.floor(c)}`}if(r.domain){if(!Fw.test(r.domain))throw new TypeError("option domain is invalid");o+=`; Domain=${r.domain}`}if(r.path){if(!Fw.test(r.path))throw new TypeError("option path is invalid");o+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(o+="; Partitioned"),o},Hw={create(e,t,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+n*60*1e3)),r&&(i.domain=r),document.cookie=hP(e,t,i)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let i=n[r];for(;i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return i.substring(t.length,i.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var mP={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<"u")return Hw.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:i,cookieOptions:o}=t;n&&typeof document<"u"&&Hw.create(n,e,r,i,o)}},pP={name:"querystring",lookup(e){var r;let{lookupQuerystring:t}=e,n;if(typeof window<"u"){let{search:i}=window.location;!window.location.search&&((r=window.location.hash)==null?void 0:r.indexOf("?"))>-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));const c=i.substring(1).split("&");for(let d=0;d<c.length;d++){const h=c[d].indexOf("=");h>0&&c[d].substring(0,h)===t&&(n=c[d].substring(h+1))}}return n}},gP={name:"hash",lookup(e){var i;let{lookupHash:t,lookupFromHashIndex:n}=e,r;if(typeof window<"u"){const{hash:o}=window.location;if(o&&o.length>2){const c=o.substring(1);if(t){const d=c.split("&");for(let h=0;h<d.length;h++){const m=d[h].indexOf("=");m>0&&d[h].substring(0,m)===t&&(r=d[h].substring(m+1))}}if(r)return r;if(!r&&n>-1){const d=o.match(/\/([a-zA-Z-]*)/g);return Array.isArray(d)?(i=d[typeof n=="number"?n:0])==null?void 0:i.replace("/",""):void 0}}}return r}};let _o=null;const qw=()=>{if(_o!==null)return _o;try{if(_o=typeof window<"u"&&window.localStorage!==null,!_o)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{_o=!1}return _o};var xP={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&qw())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&qw()&&window.localStorage.setItem(n,e)}};let Oo=null;const Kw=()=>{if(Oo!==null)return Oo;try{if(Oo=typeof window<"u"&&window.sessionStorage!==null,!Oo)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{Oo=!1}return Oo};var vP={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&Kw())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&Kw()&&window.sessionStorage.setItem(n,e)}},yP={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:i}=navigator;if(n)for(let o=0;o<n.length;o++)t.push(n[o]);r&&t.push(r),i&&t.push(i)}return t.length>0?t:void 0}},bP={name:"htmlTag",lookup(e){let{htmlTag:t}=e,n;const r=t||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},wP={name:"path",lookup(e){var i;let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(i=n[typeof t=="number"?t:0])==null?void 0:i.replace("/",""):void 0}},SP={name:"subdomain",lookup(e){var i,o;let{lookupFromSubdomainIndex:t}=e;const n=typeof t=="number"?t+1:1,r=typeof window<"u"&&((o=(i=window.location)==null?void 0:i.hostname)==null?void 0:o.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[n]}};let Gw=!1;try{document.cookie,Gw=!0}catch{}const Yw=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Gw||Yw.splice(1,1);const jP=()=>({order:Yw,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class Ww{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,n)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=dP(n,this.options||{},jP()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=i=>i.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(mP),this.addDetector(pP),this.addDetector(xP),this.addDetector(vP),this.addDetector(yP),this.addDetector(bP),this.addDetector(wP),this.addDetector(SP),this.addDetector(gP)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return t.forEach(r=>{if(this.detectors[r]){let i=this.detectors[r].lookup(this.options);i&&typeof i=="string"&&(i=[i]),i&&(n=n.concat(i))}}),n=n.filter(r=>r!=null&&!fP(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(t,this.options)}))}}Ww.type="languageDetector";const CP={common:{timeline:{commentsLoading:"评论加载中…",commentsFailed:"评论加载失败",commentsEmpty:"暂无评论",viewAllComments:"查看全部 {{countText}} 条评论",collapse:"收起",expand:"展开",expandDetail:"展开详情",play:"播放",pause:"暂停",openSource:"打开原始链接",comments:"评论",extract:"转成文字",download:"下载",viewDetail:"查看详情",refresh:"换一批",reharvest:"重新抓取",layout:"布局",layoutList:"列表",layoutWaterfall:"瀑布流",harvesting:"正在重新抓取…",harvestDone:"抓取 {{fetched}} 条,新增 {{written}} 条",harvestPartial:"{{total}} 个源里 {{failed}} 个没抓成",harvestReloaded:"已刷新",harvestFailed:"抓取失败:{{reason}}",viewNew:"查看新内容",newItems:"{{count}} 条新内容",itemsCount:"{{count}} 条",channelsCount:"{{count}} 个频道",loading:"加载中…",bodyLoadFailed:"正文 / 评论加载失败",source:"源",back:"返回",noItems:"暂无内容",noPreview:"暂无预览",noItemSelected:"未选择内容",wordCount:"{{n}} 字",open:"打开",save:"保存",likes:"{{count}} 赞"},video:{searchTitle:"视频搜索",searchButton:"搜索",searching:"搜索中…",placeholderNormal:"搜电影 / 电视剧 / 番剧名…",placeholderNsfw:"搜番号 / 演员 / 关键词…",nsfwToggleOn:"当前:成人源(点击切回常规)",nsfwToggleOff:"当前:常规源(点击切成人)",sourceHintNormal:"常规源:Nyaa / 漫猫 / BT影视 / 盘搜",sourceHintNsfw:"成人源:Nyaa(R18) / U3C3 / JavDB",sourceHintSuffix:"—— 按清晰度·剧集聚合",emptyTitle:"没有找到视频结果",emptyResult:"没有结果 —— 换个关键词,或片名更通用些",initialTitle:"搜索视频资源",initialPrompt:"输入片名开始聚合搜索",looseHeader:"其它结果(未归类)",qualitySd:"标清",qualityOther:"其他",sourceTypeQuark:"夸克",sourceTypeBaidu:"百度",sourceTypeAliyun:"阿里",sourceTypeMagnet:"磁力",sourceTypeUnknown:"未知",copyResolving:"解析中…",copyCopied:"已复制",copyFailed:"失败",copyUnresolvable:"无可用解析",copyLink:"复制链接",copyMagnet:"复制磁力",coveragePack:"全{{n}}集",coverageComplete:"整季",coverageMovie:"整部",previewSource:"在右侧预览源站页面",totalEpisodes:"共{{n}}集",hasPack:"有整季包 · ",missingEpisodes:"缺集 {{list}}",allEpisodesComplete:"全{{n}}集齐",episodesAvailableUnknownTotal:"共 {{n}} 集可下(总集数未知)",collapse:"收起",expandReleases:"展开剩余 {{n}} 条 ▾",copyPassword:"复制提取码",passwordLabel:"提取码 {{pw}}",passwordSuffix:"提取码:{{pw}}",copy:"复制",channelSource:"频道来源",openOriginalPost:"打开原始帖子(Telegram)",originalText:"原文",expandFullText:"展开全文 ▾",netdiskLinks:"{{n}} 个网盘链接",openSourcePage:"在 {{label}} 打开此条源页面",searchInSource:"在 {{label}} 站内搜索",elapsedHeader:"各源耗时({{done}}/{{all}})",hiddenCount:"· 隐藏 {{n}}",collapsePanel:"收起 ▴",expandPanel:"展开 ▾",timingHint:"点击某行可隐藏/恢复该源的结果",restoreSource:"恢复 {{label}} 的结果",hideSource:"隐藏 {{label}} 的结果",resultCount:"{{n}} 条",timing:"计时中",statusEmpty:"无结果",statusTimeout:"超时",statusError:"失败",findResource:"找资源",finderTitle:"找资源:{{query}}",finderClose:"关闭",finderSearching:"搜索中…",finderAlistDown:"AList 不可达,只显示磁力 / ed2k(网盘类型无法确认)",finderFilteredOut:"{{n}} 条被过滤(你未挂载这些网盘)",finderDeduped:"{{n}} 条重复已合并",alsoOn:"另存于",typeLabel:"类型",finderShowAll:"显示全部",finderShowUsable:"只看可用",finderEmptyNone:"没有找到资源",finderEmptyAllDupes:"搜到的都是重复项,已全部合并",finderEmptyNoUsable:"没有可用类型的资源,试试「显示全部」",finderCopy:"复制 {{title}}",finderCopied:"已复制",finderPassword:"码 {{pw}}",finderVerifying:"验活中…",finderDead:"已失效",finderDeadTip:"分享已失效或被封禁,复制了也打不开",finderNeedsLogin:"需登录",finderNeedsLoginTip:"这条要登录才能看——夸克登录态可能过期了",finderVerifiedFiles:"{{n}} 个文件",finderSave:"转存 {{title}}",finderSaving:"转存中…",finderSaved:"已转存到 {{dest}}",finderSaveFailed:"转存失败:{{reason}}",finderDeadCount:"{{n}} 条已失效",finderShowDead:"显示失效的",finderHideDead:"隐藏失效的",finderNotMatched:"网盘未匹配",notAired:"未播出"},collect:{collect:"收藏",collected:"已收藏",addTo:"添加到列表",noLists:"还没有列表",newListPlaceholder:"新建列表…"},movie:{back:"返回",channelTitle:"影视",loading:"加载中…",noContent:"还没有内容(等待下次抓取)。",nowFollowing:"正在追的",continueWatching:"继续观看",continueWatchingSubtitleEp:"看到 {{ep}} · {{time}}",continueWatchingSubtitleMovie:"看到 {{time}}",removeFromContinue:"从继续观看移除",continueWatchingLoadFailed:"加载「继续观看」失败。",continueWatchingRemoveFailed:"从「继续观看」移除失败。",searchPlaceholder:"搜索影视…",searching:"搜索中…",searchEmpty:"没有找到匹配的作品。",searchFailed:"搜索来源未配置或暂时失败。",viewOriginal:"查看原始条目",viewOnTmdb:"在 TMDB 查看",credits:"演职员",runtimeMinutes:"{{n}} 分钟",episodeCount:"{{n}} 集",refreshDetail:"刷新详情",loadingMetadata:"加载元数据…",noVerifiedMetadata:"未找到可验证的外部元数据,当前显示发现源提供的信息。",noVerifiedMetadataBare:"未找到可验证的外部元数据。",discoveryFallback:"TMDb / IMDb 未找到可验证匹配;以下详情来自豆瓣发现源。",partialUnavailable:"部分详情来源暂不可用,已显示现有数据。",episodesSection:"分集",noEpisodes:"还没有分集(等待下次抓取)。",closePlayer:"关闭播放",closePlayerTitle:"关闭 (Esc)",prevPage:"上一页",play:"播放",bindNetdisk:"绑定网盘",bindRebind:"换目录",bindMatched:"已配上 {{matched}} / {{total}} 集",bindMatchedShort:"{{matched}}/{{total}}",bindActions:"网盘",bindResync:"刷新匹配",bindResynced:"已刷新,配上 {{matched}} / {{total}} 集",bindResyncFailed:"刷新失败:{{reason}}",bindMatchDetail:"匹配详情",bindMatchDetailDesc:"逐集查看网盘文件对照、手动订正匹配",bindDedupe:"一键去重",bindDedupeTitle:"一键去重",bindDedupeDesc:"同一集攒了几份时只留质量最高的那份。先看清单——删哪几份、各自留的是哪份,确认后才动网盘。",bindDedupeDone:"已去重:删除 {{deleted}} 份",bindDelete:"删除网盘文件",bindDeleteTitle:"删除这部作品的网盘文件?",bindDeleteDesc:"整个目录 {{path}} 连同里面的文件都会从网盘删掉,同时解除绑定。夸克进回收站,约 10 天内可找回。",bindDeleteConfirm:"删除",bindDeleteCancel:"取消",bindDeleteDone:"已删除网盘目录并解绑",bindDeleteFailed:"删除失败:{{reason}}",bindBroken:"绑定目录已失效——文件在网盘中被删除或移动,请换目录",bindUnavailable:"未能确认这部作品的 TMDb 身份,暂时不能绑定网盘",bindOpenNetdisk:"在网盘中打开 {{path}}",bindOpenNetdiskLabel:"打开网盘目录",seasonLabel:"第 {{n}} 季",episodeShort:"E{{n}}",nextPage:"下一页"},channels:{timeline:"时间线",resourceSearch:"资源搜索",audio:"音乐/播客",video:"影视",ads:"推广屏蔽"},nav:{inbox:"收件箱",sources:"源",manageChannel:"管理频道",manage:"管理",channels:"频道管理",providers:"Provider 工作台",packages:"组件",netdisk:"网盘绑定",library:"资料库",smartViews:"智能视图",management:"管理",systemDefaults:"系统默认",customChannels:"自定义",subscriptions:"订阅频道",settings:"设置",searchPlaceholder:"过滤消息… ⏎ 搜小红书/B站",unsubscribe:"取消订阅"},packages:{updatesLine:"{{count}} 个有更新",searchPlaceholder:"搜包名、站点、能力…",checkUpdates:"检查更新",add:"添加包",addTitle:"添加包",addBody:"按关键词搜,或者直接把完整的 npm 包名粘进来。",containerBand:"容器",containerSummary:"其余 {{count}} 个容器正常",brokenWhy:"起不来",restart:"重试",restarting:"重启中…",restartOk:"{{name}} 已重启",restartFailed:"{{name}} 还是没起来:{{message}}",netdiskSettings:"网盘设置",builtinBand:"内置能力",builtinWhy:"跟着 Stream 一起跑,没有单独会崩的活件。点进去看它提供了什么。",recipeBand:"抓取配方",recipeWhy:"只是数据:告诉 Stream 怎么从某个站点取内容。随时装、随时卸,不影响别的。",providerBand:"能力行 (Provider)",providerWhy:"全局按需能力:搜索、解析、下载、转换。成员与路由在工作台里编排。",providerMembers:"{{count}} 个成员",providerParked:"未激活",wishlistTitle:"待接入",wishlistWhy:"对话里撞上、但现在没有源能吃的站。写一份 recipe 或一条 RSSHub 路由就能把它接进来。",wishlistDrop:"删掉这条",openInSources:"在「源」里打开",stateRunning:"运行中",stateIdle:"休眠中 · 用到时自动唤醒",stateError:"出错了",stateUnknown:"状态未知",viewLogs:"看日志",slotSources:"{{count}} 个源",slotRecipes:"{{count}} 条",unreadable:"读不动",slotCredential:"要 {{domain}} 的登录态",builtinVersion:"内置",hasUpdateTo:"可更新 {{version}}",updateTo:"更新到 {{version}}",uninstall:"卸载",rowMenu:"{{name}} 的操作",empty:"没有匹配的包",loadFailed:"加载失败:{{message}}",unavailableTitle:"功能未启用",unavailableBody:"这台后端没有装配包目录能力。",logsTitle:"{{name}} 的日志",logsBody:"容器的最后 200 行输出(stdout 与 stderr 合流,带时间戳)。",logsRefresh:"重新读取",logsLoading:"读取中…",logsEmpty:"这个容器还没有输出任何东西。",logsTruncated:"只显示最后 200 行,上面还有。",logsNoContainer:"这个包没有容器,或者它的容器从没建起来。",logsNoDocker:"够不着 Docker:没装、daemon 没跑,或者 socket 够不着。"},recipes:{installedTitle:"已安装",installedEmpty:"还没有装任何 recipe 包。在下面搜索,或直接粘贴完整包名。",discoverTitle:"发现",searchPlaceholder:"搜关键词,或直接粘贴完整包名(如 @streamapp/telegram)",search:"搜索",searching:"搜索中…",searchEmptyHint:"没搜到。刚发布的包可能尚未进入 npm 搜索索引,可直接粘贴完整包名安装。",installDirect:"安装 {{name}}",install:"安装",installing:"安装中…",previewing:"读取包信息…",uninstall:"卸载",uninstallTitle:"卸载 {{name}}",uninstallBody:"将删除该包的全部文件;它覆盖过的内置源会自动恢复。",uninstallCodeNote:"这个包带代码:文件立刻删除,但已经加载进来的那份模块要重启 Stream 后才真正卸下——在那之前它仍在跑。",cancel:"取消",updateTo:"更新到 {{version}}",loadFailed:"加载失败:{{message}}",unavailableTitle:"功能未启用",unavailableBody:"这台后端没有装配 recipe 包能力,市场页暂不可用。",installedToast:"已安装 {{name}}",uninstalledToast:"已卸载 {{name}}",dialogTitle:"安装 {{name}}@{{version}}",facility:"所属 facility",cookieDomainLabel:"会用到的登录域",rateLimit:"限流(已按宿主上限钳制)",rateLimitValue:"并发 {{burst}} · 每分钟 {{perMinute}}",rateLimitValueHourly:"并发 {{burst}} · 每分钟 {{perMinute}} · 每小时 {{perHour}}",disclaimer:"能力与副作用由包作者自述,宿主不核实。",overridesLabel:"将覆盖的内置源",capabilitiesLabel:"能力",effectsLabel:"副作用",paramsLabel:"参数",writeBadge:"会写入账户",riskWrite:"该包会写我的账户({{ids}})",riskShadow:"用第三方包替换官方的 {{ids}}",riskHeading:"这次安装需要你再确认一次",riskCodeHeading:"这个包会在 Stream 里跑它自己的代码",riskCode:"这个包的代码和 Stream 同权限:能读我全部 cookie 和 token、能以我的身份向任意地址发请求,并占用 {{names}} 这些注册名",riskCodeNoNames:"这个包的代码和 Stream 同权限:能读我全部 cookie 和 token、能以我的身份向任意地址发请求",codeEntryLabel:"代码入口",codeAdaptersLabel:"会注册的 adapter",codeNormalizersLabel:"会注册的 normalizer",codeRestartNote:"代码格的包,卸载和升级都要重启 Stream 后才生效——已加载的模块无法在运行中卸掉。",riskContainerHeading:"这个包会在你的机器上跑一个容器",riskContainer:"在我的机器上跑一个我看不到内容的镜像 {{image}},它能联网",riskContainerWithCreds:"在我的机器上跑一个我看不到内容的镜像 {{image}},它能联网,并能取 {{domains}} 的登录态",backendImageLabel:"容器镜像",backendMemLabel:"内存上限",backendVolumesLabel:"数据卷",backendEnvLabel:"环境变量(只列键名)",credentialsLabel:"它能取的登录态",backendStandbyNote:"闲置 {{minutes}} 分钟后自动停掉这个容器;下次用到时再唤醒,数据卷原地留着。",confirmInstall:"确认安装",refresh:"刷新"},llm:{baseUrl:"API 地址",baseUrlPlaceholder:"https://host/v1",model:"模型",apiKey:"API Key",apiKeyKeep:"(留空保持不变)",prompt:"总结提示词",promptPlaceholder:"留空使用默认(去废话、提炼要点、保留结论与数字)",save:"保存并应用",saved:"LLM 配置已更新",saveFailed:"保存失败",backendDown:"后端未响应",required:"API 地址和模型必填",configured:"已配置",notConfigured:"未配置"},slot:{providedBy:"由 {{name}} 提供",default:"默认(跟随全局)",unset:"默认",broken:"Provider 失效,点此更换",saveFailed:"切换 Provider 失败:{{message}}"}},sources:{"douyin-follow":"抖音·关注","douyin-collection":"抖音·收藏","douyin-user":"抖音·用户","xhs-user":"小红书·用户","36kr-newsflash":"36氪·快讯","hackernews-best":"Hacker News","v2ex-hot":"V2EX·热门"}},kP={common:{timeline:{commentsLoading:"Loading comments…",commentsFailed:"Failed to load comments",commentsEmpty:"No comments yet",viewAllComments:"View all {{count}} comments",collapse:"Collapse",expand:"Expand",expandDetail:"Expand detail",play:"Play",pause:"Pause",openSource:"Open original link",comments:"Comments",extract:"Convert to text",download:"Download",viewDetail:"View detail",refresh:"Refresh",reharvest:"Re-harvest",layout:"Layout",layoutList:"List",layoutWaterfall:"Waterfall",harvesting:"Re-harvesting…",harvestDone:"Fetched {{fetched}}, {{written}} new",harvestPartial:"{{failed}} of {{total}} sources failed",harvestReloaded:"Reloaded",harvestFailed:"Harvest failed: {{reason}}",viewNew:"View new",newItems:"{{count}} new",itemsCount:"{{count}} items",channelsCount:"{{count}} channels",loading:"Loading…",bodyLoadFailed:"Failed to load content / comments",source:"Source",back:"Back",noItems:"No items yet.",noPreview:"No preview available",noItemSelected:"No item selected",wordCount:"{{n}} words",open:"Open",save:"Save",likes:"{{count}} likes"},video:{searchTitle:"Video Search",searchButton:"Search",searching:"Searching…",placeholderNormal:"Search movies / TV shows / anime…",placeholderNsfw:"Search code / actor / keyword…",nsfwToggleOn:"Mode: Adult (click to switch back)",nsfwToggleOff:"Mode: Normal (click to switch)",sourceHintNormal:"Sources: Nyaa / 漫猫 / BT影视 / 盘搜",sourceHintNsfw:"Adult sources: Nyaa(R18) / U3C3 / JavDB",sourceHintSuffix:"— grouped by quality · episode",emptyTitle:"No video results found",emptyResult:"No results — try a different keyword or a more general title",initialTitle:"Search video sources",initialPrompt:"Enter a title to start searching",looseHeader:"Other results (uncategorised)",qualitySd:"SD",qualityOther:"Other",sourceTypeQuark:"Quark",sourceTypeMagnet:"Magnet",sourceTypeUnknown:"Unknown",sourceTypeBaidu:"Baidu",sourceTypeAliyun:"Aliyun",copyResolving:"Resolving…",copyCopied:"Copied",copyFailed:"Failed",copyUnresolvable:"No resolver",copyLink:"Copy link",copyMagnet:"Copy magnet",coveragePack:"Ep 1–{{n}}",coverageComplete:"Full season",coverageMovie:"Full movie",previewSource:"Preview source page on the right",totalEpisodes:"{{n}} ep",hasPack:"Full-season pack · ",missingEpisodes:"Missing {{list}}",allEpisodesComplete:"All {{n}} ep",episodesAvailableUnknownTotal:"{{n}} ep available (total unknown)",collapse:"Collapse",expandReleases:"{{n}} more ▾",copyPassword:"Copy password",passwordLabel:"pw: {{pw}}",passwordSuffix:"pw:{{pw}}",copy:"Copy",channelSource:"Channel source",openOriginalPost:"Open original post (Telegram)",originalText:"Original",expandFullText:"Expand ▾",netdiskLinks:"{{n}} cloud links",openSourcePage:"Open this item on {{label}}",searchInSource:"Search {{label}}",elapsedHeader:"Source timings ({{done}}/{{all}})",hiddenCount:"· {{n}} hidden",collapsePanel:"Collapse ▴",expandPanel:"Expand ▾",timingHint:"Click a row to hide/restore that source",restoreSource:"Restore results from {{label}}",hideSource:"Hide results from {{label}}",resultCount:"{{n}} results",timing:"Timing…",statusEmpty:"No results",statusTimeout:"Timeout",statusError:"Error",findResource:"Find sources",finderTitle:"Find sources: {{query}}",finderClose:"Close",finderSearching:"Searching…",finderAlistDown:"AList unreachable — magnet / ed2k only (netdisk types unknown)",finderFilteredOut:"{{n}} filtered out (those netdisks are not mounted)",finderDeduped:"{{n}} duplicates merged",alsoOn:"also on",typeLabel:"type",finderShowAll:"Show all",finderShowUsable:"Usable only",finderEmptyNone:"No sources found",finderEmptyAllDupes:"Every hit was a duplicate — all merged",finderEmptyNoUsable:"Nothing in a usable format — try “Show all”",finderCopy:"Copy {{title}}",finderCopied:"Copied",finderPassword:"Code {{pw}}",finderVerifying:"Checking…",finderDead:"Dead",finderDeadTip:"This share is expired or banned — copying it will not help",finderNeedsLogin:"Login needed",finderNeedsLoginTip:"This one needs a login — the quark session may have expired",finderVerifiedFiles:"{{n}} file(s)",finderSave:"Save {{title}}",finderSaving:"Saving…",finderSaved:"Saved to {{dest}}",finderSaveFailed:"Save failed: {{reason}}",finderDeadCount:"{{n}} dead",finderShowDead:"Show dead",finderHideDead:"Hide dead",finderNotMatched:"Not matched in netdisk",notAired:"Not aired yet"},collect:{collect:"Collect",collected:"Collected",addTo:"Add to list",noLists:"No lists yet.",newListPlaceholder:"New list…"},movie:{back:"Back",channelTitle:"Film & TV",loading:"Loading…",noContent:"No content yet (waiting for the next harvest).",nowFollowing:"Following",continueWatching:"Continue Watching",continueWatchingSubtitleEp:"Watched to {{ep}} · {{time}}",continueWatchingSubtitleMovie:"Watched to {{time}}",removeFromContinue:"Remove from Continue Watching",continueWatchingLoadFailed:"Failed to load Continue Watching.",continueWatchingRemoveFailed:"Failed to remove from Continue Watching.",searchPlaceholder:"Search films & shows…",searching:"Searching…",searchEmpty:"No matching titles found.",searchFailed:"Search source unconfigured or temporarily unavailable.",viewOriginal:"View original item",viewOnTmdb:"View on TMDB",credits:"Cast & Crew",runtimeMinutes:"{{n}} min",episodeCount:"{{n}} eps",refreshDetail:"Refresh details",loadingMetadata:"Loading metadata…",noVerifiedMetadata:"No verifiable external metadata found; showing discovery-source info.",noVerifiedMetadataBare:"No verifiable external metadata found.",discoveryFallback:"No verifiable TMDb / IMDb match; details below are from the Douban discovery source.",partialUnavailable:"Some detail sources are temporarily unavailable; showing what we have.",episodesSection:"Episodes",noEpisodes:"No episodes yet (waiting for the next harvest).",closePlayer:"Close player",closePlayerTitle:"Close (Esc)",prevPage:"Previous",play:"Play",bindNetdisk:"Bind netdisk",bindRebind:"Change folder",bindMatched:"{{matched}} / {{total}} episodes matched",bindMatchedShort:"{{matched}}/{{total}}",bindActions:"Netdisk",bindResync:"Re-sync matches",bindResynced:"Re-synced — {{matched}} / {{total}} matched",bindResyncFailed:"Re-sync failed: {{reason}}",bindMatchDetail:"Match details",bindMatchDetailDesc:"Review per-episode file matches and fix them by hand",bindDedupe:"Remove duplicates",bindDedupeTitle:"Remove duplicates",bindDedupeDesc:"When an episode has several copies, only the highest-quality one is kept. Review the list first — what gets deleted and what stays — nothing is touched until you confirm.",bindDedupeDone:"Done — deleted {{deleted}} file(s)",bindDelete:"Delete netdisk files",bindDeleteTitle:"Delete this work’s netdisk files?",bindDeleteDesc:"The whole folder {{path}} and everything in it is deleted from the netdisk, and the binding is removed. On quark it goes to the recycle bin — recoverable for about 10 days.",bindDeleteConfirm:"Delete",bindDeleteCancel:"Cancel",bindDeleteDone:"Folder deleted and unbound",bindDeleteFailed:"Delete failed: {{reason}}",bindBroken:"Bound folder is gone — the files were deleted or moved on the netdisk; pick a new folder",bindUnavailable:"Cannot confirm this title on TMDb — binding is unavailable for now",bindOpenNetdisk:"Open {{path}} in netdisk",bindOpenNetdiskLabel:"Open netdisk folder",seasonLabel:"Season {{n}}",episodeShort:"E{{n}}",nextPage:"Next"},channels:{timeline:"Timeline",resourceSearch:"Resource Search",audio:"Music/Podcasts",video:"Film & TV",ads:"Ad Filter"},nav:{inbox:"Inbox",sources:"Sources",manageChannel:"Manage channel",manage:"Manage",channels:"Channel Management",providers:"Provider Workbench",packages:"Components",netdisk:"Netdisk Bindings",library:"Library",smartViews:"Smart Views",management:"Management",systemDefaults:"System Defaults",customChannels:"Custom",subscriptions:"Subscriptions",settings:"Settings",searchPlaceholder:"Filter messages… ⏎ search 小红书/Bilibili",unsubscribe:"Unsubscribe"},packages:{updatesLine:"{{count}} with updates",searchPlaceholder:"Search by name, site, capability…",checkUpdates:"Check for updates",add:"Add package",addTitle:"Add a package",addBody:"Search by keyword, or paste a full npm package name.",containerBand:"Containers",containerSummary:"{{count}} other containers are fine",brokenWhy:"won't start",restart:"Retry",restarting:"Restarting…",restartOk:"{{name}} restarted",restartFailed:"{{name}} still won't start: {{message}}",netdiskSettings:"Netdisk settings",builtinBand:"Built-in capabilities",builtinWhy:"They run inside Stream — nothing separate to crash. Open one to see what it provides.",recipeBand:"Harvest recipes",recipeWhy:"Just data: how to pull content from a given site. Install and remove freely.",providerBand:"Capability rows (Providers)",providerWhy:"Global on-demand capabilities: search, resolve, download, transform. Members and routing are edited in the workbench.",providerMembers:"{{count}} members",providerParked:"parked",wishlistTitle:"Waiting for a recipe",wishlistWhy:"Sites that came up in chat but no source can read yet. One recipe — or one RSSHub route — brings them in.",wishlistDrop:"Drop this entry",openInSources:"Open in Sources",stateRunning:"Running",stateIdle:"Sleeping · wakes on demand",stateError:"Error",stateUnknown:"Unknown",viewLogs:"Logs",slotSources:"{{count}} sources",slotRecipes:"{{count}} recipes",unreadable:"unreadable",slotCredential:"needs {{domain}} login",builtinVersion:"built-in",hasUpdateTo:"Update to {{version}}",updateTo:"Update to {{version}}",uninstall:"Uninstall",rowMenu:"Actions for {{name}}",empty:"No matching packages",loadFailed:"Failed to load: {{message}}",unavailableTitle:"Not available",unavailableBody:"This backend has no package catalog wired.",logsTitle:"{{name}} logs",logsBody:"Last 200 lines of container output (stdout and stderr, with timestamps).",logsRefresh:"Reload",logsLoading:"Loading…",logsEmpty:"This container has not written anything yet.",logsTruncated:"Showing the last 200 lines — there is more above.",logsNoContainer:"This package has no container, or its container was never created.",logsNoDocker:"Can't reach Docker: not installed, daemon down, or socket unreachable."},recipes:{installedTitle:"Installed",installedEmpty:"No recipe packages installed yet. Search below, or paste a full package name.",discoverTitle:"Discover",searchPlaceholder:"Search keywords, or paste a full package name (e.g. @streamapp/telegram)",search:"Search",searching:"Searching…",searchEmptyHint:"Nothing found. A freshly published package may not be in the npm search index yet — paste its full name to install it directly.",installDirect:"Install {{name}}",install:"Install",installing:"Installing…",previewing:"Reading package…",uninstall:"Uninstall",uninstallTitle:"Uninstall {{name}}",uninstallBody:"Removes all files of this package; any builtin source it shadowed comes back.",uninstallCodeNote:"This package ships code: the files go away immediately, but the module already loaded is only unloaded after Stream restarts — until then it keeps running.",cancel:"Cancel",updateTo:"Update to {{version}}",loadFailed:"Failed to load: {{message}}",unavailableTitle:"Not enabled",unavailableBody:"This backend has no recipe-package capability wired in, so the market is unavailable.",installedToast:"Installed {{name}}",uninstalledToast:"Uninstalled {{name}}",dialogTitle:"Install {{name}}@{{version}}",facility:"Facility",cookieDomainLabel:"Login domain it uses",rateLimit:"Rate limit (clamped by the host)",rateLimitValue:"burst {{burst}} · {{perMinute}}/min",rateLimitValueHourly:"burst {{burst}} · {{perMinute}}/min · {{perHour}}/hour",disclaimer:"Capabilities and effects are self-declared by the package author; the host does not verify them.",overridesLabel:"Builtin sources it will shadow",capabilitiesLabel:"Capabilities",effectsLabel:"Effects",paramsLabel:"Params",writeBadge:"writes to your account",riskWrite:"This package writes to my account ({{ids}})",riskShadow:"Replace the official {{ids}} with a third-party package",riskHeading:"This install needs one more confirmation",riskCodeHeading:"This package runs its own code inside Stream",riskCode:"This package's code runs with Stream's own permissions: it can read every cookie and token I have and send requests anywhere as me, and it takes over the names {{names}}",riskCodeNoNames:"This package's code runs with Stream's own permissions: it can read every cookie and token I have and send requests anywhere as me",codeEntryLabel:"Code entry",codeAdaptersLabel:"Adapters it registers",codeNormalizersLabel:"Normalizers it registers",codeRestartNote:"For packages with code, uninstalling and upgrading only take effect after Stream restarts — a loaded module cannot be unloaded at runtime.",riskContainerHeading:"This package runs a container on your machine",riskContainer:"Run the image {{image}}, whose contents I cannot see, on my machine with network access",riskContainerWithCreds:"Run the image {{image}}, whose contents I cannot see, on my machine with network access and my logins for {{domains}}",backendImageLabel:"Container image",backendMemLabel:"Memory cap",backendVolumesLabel:"Volumes",backendEnvLabel:"Environment variables (names only)",credentialsLabel:"Logins it can read",backendStandbyNote:"The container is stopped after {{minutes}} idle minutes and woken again when next used; its volumes stay put.",confirmInstall:"Confirm install",refresh:"Refresh"},llm:{baseUrl:"API base URL",baseUrlPlaceholder:"https://host/v1",model:"Model",apiKey:"API Key",apiKeyKeep:"(leave blank to keep)",prompt:"Summary prompt",promptPlaceholder:"Blank = default (de-fluff, keep conclusions & numbers)",save:"Save & apply",saved:"LLM config updated",saveFailed:"Save failed",backendDown:"backend unreachable",required:"API base URL and model are required",configured:"configured",notConfigured:"not configured"},slot:{providedBy:"Provided by {{name}}",default:"Default (follow global)",unset:"default",broken:"Provider broken — click to switch",saveFailed:"Failed to switch provider: {{message}}"}},sources:{"douyin-follow":"Douyin · Following","douyin-collection":"Douyin · Saved","douyin-user":"Douyin · User","xhs-user":"小红书 · User","36kr-newsflash":"36Kr · Newsflash","hackernews-best":"Hacker News","v2ex-hot":"V2EX · Hot"}};Hn.use(Ww).use(tP).init({resources:{zh:CP,en:kP},fallbackLng:"zh",supportedLngs:["zh","en"],ns:["common","sources"],defaultNS:"common",detection:{order:["localStorage","navigator"],caches:["localStorage"],lookupLocalStorage:"stream.lang"},interpolation:{escapeValue:!1},react:{useSuspense:!1}});function jp(e,t){return/^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(t)?t:`${e}${t}`}function NP(e){return e.startsWith("data:")?"data":e.startsWith("blob:")?"blob":e.includes("/api/media/image?")?"already-proxied":e.startsWith("/")&&!e.startsWith("//")?"backend-route":null}function is(e,t){const n=NP(t);if(n==="backend-route")return jp(e,t);if(n)return t;const r=t.startsWith("//")?`https:${t}`:t;return`${e}/api/media/image?url=${encodeURIComponent(r)}`}const Xw="stream.accessToken";function TP(){if(typeof window>"u")return;const e=new URL(window.location.href),t=e.searchParams.get("token");if(t){e.searchParams.delete("token"),window.history.replaceState(null,"",e.toString());try{window.localStorage.setItem(Xw,t)}catch{}return t}}function EP(){try{return TP()??window.localStorage.getItem(Xw)??void 0}catch{return}}const ut={baseUrl:"",token:EP()};function RP(e,t){ut.baseUrl=e,ut.wsBase=t||void 0}function AP(e,t){if(!(!t||!/^https?:\/\//i.test(t)))return`${e}/api/media/image?site=${encodeURIComponent(t)}`}function Oi(e){return e.token?{Authorization:`Bearer ${e.token}`}:{}}class sr extends Error{constructor(t,n,r){super(t),this.status=n,this.code=r,this.name="ApiError",n===401&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("stream:unauthorized"))}}function zi(e){if(!e||typeof e!="object"||!("error"in e))return;const t=e.error;if(typeof t=="string")return t;if(t&&typeof t=="object"&&"message"in t&&typeof t.message=="string")return t.message}function Pi(e){if(!e||typeof e!="object"||!("error"in e))return;const t=e.error;if(t&&typeof t=="object"&&"code"in t&&typeof t.code=="string")return t.code}async function De(e,t){const n=await fetch(e.baseUrl+t,{headers:Oi(e)});if(!n.ok){const r=await n.json().catch(()=>null);throw new sr(zi(r)||`GET ${t} → ${n.status}`,n.status,Pi(r))}return n.json()}async function tt(e,t,n){const r=await fetch(e.baseUrl+t,{method:"POST",headers:{"content-type":"application/json",...Oi(e)},body:JSON.stringify(n)});if(!r.ok){const i=await r.json().catch(()=>null);throw new sr(zi(i)||`POST ${t} → ${r.status}`,r.status,Pi(i))}return r.json()}async function MP(e,t){const n=await fetch(e.baseUrl+t,{method:"POST",headers:Oi(e)});if(!n.ok){const r=await n.json().catch(()=>null);throw new sr(zi(r)||`POST ${t} → ${n.status}`,n.status,Pi(r))}}async function Lr(e,t,n,r){const i=await fetch(e.baseUrl+t,{method:"PUT",headers:{"content-type":"application/json",...Oi(e)},body:JSON.stringify(n),...r!=null&&r.keepalive?{keepalive:!0}:{}});if(!i.ok){const o=await i.json().catch(()=>null);throw new sr(zi(o)||`PUT ${t} → ${i.status}`,i.status,Pi(o))}return i.json()}async function Ir(e,t,n){const r=await fetch(e.baseUrl+t,{method:"PATCH",headers:{"content-type":"application/json",...Oi(e)},body:JSON.stringify(n)});if(!r.ok){const i=await r.json().catch(()=>null);throw new sr(zi(i)||`PATCH ${t} → ${r.status}`,r.status,Pi(i))}return r.json()}async function ar(e,t){const n=await fetch(e.baseUrl+t,{method:"DELETE",headers:Oi(e)});if(!n.ok){const r=await n.json().catch(()=>null);throw new sr(zi(r)||`DELETE ${t} → ${n.status}`,n.status,Pi(r))}if(n.status!==204)return n.json()}function DP(e){const t=new URLSearchParams;e!=null&&e.stream&&t.set("stream",e.stream),e!=null&&e.limit&&t.set("limit",String(e.limit)),e!=null&&e.order&&t.set("order",e.order);const n=t.toString();return n?`?${n}`:""}function Od(e){return e.kind==="stream"?`stream:${e.streamId}`:e.kind==="tmdb"?`tmdb:${e.media}:${e.id}`:e.kind==="episode"?`episode:${e.streamId}:${e.itemId}`:`track:${e.platform}:${e.trackId}`}const be={streams:e=>De(e,"/api/streams"),config:{get:(e,t)=>De(e,`/api/config/${encodeURIComponent(t)}`),put:(e,t,n)=>Lr(e,`/api/config/${encodeURIComponent(t)}`,n)},storyFoldGroup:(e,t)=>De(e,`/api/story-fold/${encodeURIComponent(t)}`),unfoldStory:(e,t)=>ar(e,`/api/story-fold/${encodeURIComponent(t)}`),sourceLeaderboard:e=>De(e,"/api/story-fold/leaderboard"),providers:e=>De(e,"/api/providers").then(t=>t.items),createProvider:(e,t)=>tt(e,"/api/providers",t),patchProvider:(e,t,n)=>Ir(e,`/api/providers/${encodeURIComponent(t)}`,n),providerCallsites:e=>De(e,"/api/provider-callsites").then(t=>t.items),presents:e=>De(e,"/api/presents"),packages:e=>De(e,"/api/packages").then(t=>t.packages),packageLogs:(e,t,n=200)=>De(e,`/api/packages/${encodeURIComponent(t)}/logs?tail=${n}`),restartPackage:(e,t)=>tt(e,`/api/packages/${encodeURIComponent(t)}/restart`,{}),searchRecipePackages:(e,t)=>De(e,`/api/recipes/packages/search?q=${encodeURIComponent(t)}`),listInstalledRecipePackages:e=>De(e,"/api/recipes/packages"),previewRecipePackage:(e,t,n)=>tt(e,"/api/recipes/packages/preview",{name:t,version:n}),installRecipePackage:(e,t,n,r)=>tt(e,"/api/recipes/packages/install",{name:t,version:n,confirm:r}),uninstallRecipePackage:(e,t)=>tt(e,"/api/recipes/packages/uninstall",{name:t}),recipePackageUpdates:e=>De(e,"/api/recipes/packages/updates"),setProviderCallsiteBinding:(e,t,n,r)=>Lr(e,`/api/provider-callsites/${encodeURIComponent(t)}/binding`,{providerIds:n,...r!==void 0?{params:r}:{}}),patchStreamMembers:(e,t,n)=>Ir(e,`/api/streams/${encodeURIComponent(t)}`,{members:n}),markStreamSeen:(e,t)=>tt(e,`/api/streams/${encodeURIComponent(t)}/seen`,{}),channels:(e,t)=>De(e,`/api/channels${t?`?kind=${encodeURIComponent(t)}`:""}`),createChannel:(e,t)=>tt(e,"/api/channels",t),updateChannel:(e,t,n)=>Ir(e,`/api/channels/${encodeURIComponent(t)}`,n),deleteChannel:(e,t)=>ar(e,`/api/channels/${encodeURIComponent(t)}`),spaces:e=>De(e,"/api/spaces"),createSpace:(e,t)=>tt(e,"/api/spaces",t),updateSpace:(e,t,n)=>Ir(e,`/api/spaces/${encodeURIComponent(t)}`,n),deleteSpace:(e,t)=>ar(e,`/api/spaces/${encodeURIComponent(t)}`),onboardWishlist:e=>De(e,"/api/onboard/wishlist"),deleteWishlistEntry:(e,t)=>ar(e,`/api/onboard/wishlist/${encodeURIComponent(t)}`),channelItems:(e,t,n)=>{const r=new URLSearchParams;n!=null&&n.limit&&r.set("limit",String(n.limit)),n!=null&&n.cursor&&r.set("cursor",n.cursor);const i=r.toString();return De(e,`/api/channels/${encodeURIComponent(t)}/items${i?`?${i}`:""}`)},previewStream:(e,t,n)=>De(e,`/api/streams/${encodeURIComponent(t)}/preview${n?`?limit=${encodeURIComponent(String(n))}`:""}`),previewSource:(e,t,n)=>tt(e,"/api/sources/preview",{sourceId:t,params:n}),refreshStream:(e,t)=>tt(e,`/api/streams/${encodeURIComponent(t)}/refresh`,{}),refreshChannel:(e,t)=>tt(e,`/api/channels/${encodeURIComponent(t)}/refresh`,{}),items:(e,t)=>De(e,"/api/items"+DP(t)),search:(e,t,n,r)=>De(e,`/api/sources?q=${encodeURIComponent(t)}${n?`&k=${n}`:""}${r?`&category=${encodeURIComponent(r)}`:""}`),categories:e=>De(e,"/api/categories"),sources:e=>De(e,"/api/sources"),setStreamTitleFilter:(e,t,n,r)=>Ir(e,`/api/channels/${encodeURIComponent(t)}/streams/${encodeURIComponent(n)}/title-filter`,r.length?{keywords:r}:null),setStreamAdFilter:(e,t,n,r)=>Ir(e,`/api/channels/${encodeURIComponent(t)}/streams/${encodeURIComponent(n)}/ad-filter`,r),reclassifyStreamAdFilter:(e,t,n)=>tt(e,`/api/channels/${encodeURIComponent(t)}/streams/${encodeURIComponent(n)}/ad-filter/reclassify`,void 0),resolveTargets:e=>De(e,"/api/resolve/targets"),biliUserByName:(e,t)=>De(e,`/api/enrich?source=bilibili-user&name=${encodeURIComponent(t)}`),biliOwner:(e,t)=>De(e,`/api/enrich?source=bilibili-owner&${t.startsWith("av")?`aid=${t.slice(2)}`:`bvid=${t}`}`),biliConnect:e=>tt(e,"/api/credentials/bilibili.com/connect",{}),enrich:(e,t)=>{const n=new URLSearchParams({source:t.source});return t.source==="link"?n.set("url",t.url):t.source==="hackernews"?(n.set("id",t.id),t.commentsOnly&&n.set("comments","1")):t.source==="v2ex"?n.set("id",t.id):t.source==="bilibili-comments"?(n.set("vid",t.vid),t.page&&n.set("page",String(t.page))):t.source==="douyin"?(n.set("url",t.url),t.isGallery&&n.set("isGallery","true")):t.source==="xhs"?(n.set("noteId",t.noteId),n.set("xsec_token",t.xsecToken)):t.source==="xueqiu"&&n.set("permalink",t.permalink),De(e,`/api/enrich?${n.toString()}`)},interactXhs:(e,t)=>tt(e,"/api/discover/interact",t),closeFacility:(e,t)=>tt(e,`/api/facilities/${encodeURIComponent(t)}/close`,{}),contentSearch:(e,t)=>De(e,`/api/search?scope=content&q=${encodeURIComponent(t)}`).then(n=>({items:n.items,warnings:n.warnings??[],timings:n.timings??[]})),musicSearch:(e,t)=>De(e,`/api/search?scope=music&q=${encodeURIComponent(t)}`).then(n=>n.items),lyrics:(e,t)=>De(e,`/api/resolutions?type=lyrics&key=${encodeURIComponent(t)}`),videoTitleSearch:(e,t)=>De(e,`/api/search?scope=video&q=${encodeURIComponent(t)}`).then(n=>({candidates:n.candidates,warnings:n.warnings??[]})),collections:(e,t,n)=>De(e,`/api/collections${[t&&`domain=${t}`,n&&`anchor=${encodeURIComponent(n)}`].filter(Boolean).join("&").replace(/^(.)/,"?$1")}`),createCollection:(e,t,n,r)=>tt(e,"/api/collections",{domain:t,label:n,...r?{anchorStreamId:r}:{}}),renameCollection:(e,t,n)=>Ir(e,`/api/collections/${encodeURIComponent(t)}`,{label:n}),deleteCollection:(e,t)=>ar(e,`/api/collections/${encodeURIComponent(t)}`),collectionItems:(e,t)=>De(e,`/api/collections/${encodeURIComponent(t)}/items`),reorderCollection:(e,t,n)=>Lr(e,`/api/collections/${encodeURIComponent(t)}/order`,{keys:n}),addToCollection:(e,t,n,r)=>Lr(e,`/api/collections/${encodeURIComponent(t)}/items/${encodeURIComponent(Od(n))}`,r),addToCollectionBatch:(e,t,n)=>tt(e,`/api/collections/${encodeURIComponent(t)}/items`,{items:n.map(({key:r,...i})=>({key:Od(r),...i}))}),removeFromCollection:(e,t,n)=>ar(e,`/api/collections/${encodeURIComponent(t)}/items/${encodeURIComponent(Od(n))}`),whereCollected:(e,t)=>De(e,`/api/collected/${encodeURIComponent(Od(t))}`),watchProgressGet:(e,t)=>De(e,`/api/watch-progress/${encodeURIComponent(t)}`),watchProgressPut:(e,t,n,r)=>Lr(e,`/api/watch-progress/${encodeURIComponent(t)}`,n,r),watchProgressList:(e,t)=>De(e,"/api/watch-progress"+(t!=null&&t.length?`?${t.map(n=>`channel=${encodeURIComponent(n)}`).join("&")}`:"")),watchProgressRemove:(e,t)=>ar(e,`/api/watch-progress/${encodeURIComponent(t)}`),videoSearch:(e,t,n=!1,r)=>De(e,`/api/search?scope=resources&q=${encodeURIComponent(t)}${n?"&nsfw=1":""}${r?`&channelId=${encodeURIComponent(r)}`:""}`),videoSearchStream:async(e,t,n,r,i,o)=>{const c=await fetch(`${e.baseUrl}/api/search?scope=resources&stream=1&q=${encodeURIComponent(t)}${n?"&nsfw=1":""}${o?`&channelId=${encodeURIComponent(o)}`:""}`,{headers:Oi(e),signal:i});if(!c.ok||!c.body){const x=await c.json().catch(()=>null);throw new sr(zi(x)||`video stream → ${c.status}`,c.status,Pi(x))}const d=c.body.getReader(),h=new TextDecoder;let m="";for(;;){const{done:x,value:g}=await d.read();if(x)break;m+=h.decode(g,{stream:!0});let v;for(;(v=m.indexOf(`
|
|
58
|
+
`))>=0;){const S=m.slice(0,v).trim();m=m.slice(v+1),S&&r(JSON.parse(S))}}},videoResolve:(e,t)=>De(e,`/api/download-options?url=${encodeURIComponent(t)}`),status:e=>De(e,"/api/status"),topics:e=>De(e,"/api/topics"),subscribe:(e,t)=>tt(e,"/api/streams",t),unsubscribe:(e,t)=>ar(e,`/api/streams/${encodeURIComponent(t)}`),renameStream:(e,t,n)=>Ir(e,`/api/streams/${encodeURIComponent(t)}`,{label:n}),updateStream:(e,t,n)=>Ir(e,`/api/streams/${encodeURIComponent(t)}`,n),label:(e,t,n)=>Ir(e,`/api/items/${encodeURIComponent(t)}`,{label:n}),wsUrl:e=>(e.wsBase??e.baseUrl.replace(/^http/,"ws"))+"/ws"+(e.token?`?token=${encodeURIComponent(e.token)}`:""),plugins:e=>De(e,"/api/plugins"),setPluginEnabled:(e,t,n)=>Lr(e,`/api/plugins/${encodeURIComponent(t)}/enabled`,{enabled:n}),alist:{get:e=>De(e,"/api/settings/alist"),set:(e,t)=>Lr(e,"/api/settings/alist",t),test:(e,t)=>tt(e,"/api/settings/alist/test",t)},pluginSources:(e,t,n)=>{const r=new URLSearchParams;n!=null&&n.query&&r.set("query",n.query),n!=null&&n.category&&r.set("category",n.category),(n==null?void 0:n.group)!==void 0&&r.set("group",n.group),n!=null&&n.limit&&r.set("limit",String(n.limit)),n!=null&&n.cursor&&r.set("cursor",n.cursor),n!=null&&n.surface&&r.set("surface",n.surface);const i=r.toString();return De(e,`/api/plugins/${encodeURIComponent(t)}/sources${i?`?${i}`:""}`)},pluginSourceDetail:(e,t,n)=>De(e,`/api/plugins/${encodeURIComponent(t)}/sources/${encodeURIComponent(n)}`),searchAllPluginSources:(e,t)=>{const n=new URLSearchParams;t!=null&&t.query&&n.set("query",t.query),t!=null&&t.category&&n.set("category",t.category),t!=null&&t.capability&&n.set("capability",t.capability),t!=null&&t.searchable&&n.set("searchable","1"),t!=null&&t.limit&&n.set("limit",String(t.limit)),t!=null&&t.cursor&&n.set("cursor",t.cursor),t!=null&&t.surface&&n.set("surface",t.surface);const r=n.toString();return De(e,`/api/plugins/sources${r?`?${r}`:""}`)},dsh:{status:e=>De(e,"/api/dsh/status"),start:e=>tt(e,"/api/dsh/start",{}),stop:e=>tt(e,"/api/dsh/stop",{})},harvestBrowser:{get:e=>De(e,"/api/settings/harvest-browser"),set:(e,t)=>Lr(e,"/api/settings/harvest-browser",{exe:t})},extension:{capability:e=>De(e,"/api/browser-capability"),onboarding:e=>De(e,"/api/extension/onboarding"),materialize:e=>tt(e,"/api/extension/materialize",{}),install:e=>tt(e,"/api/extension/install",{}),decline:e=>MP(e,"/api/extension/decline")},accessToken:{get:e=>De(e,"/api/access-token")},cookieCloud:{get:e=>De(e,"/api/settings/cookiecloud"),set:(e,t)=>Lr(e,"/api/settings/cookiecloud",t)},summaryPrompt:{get:e=>De(e,"/api/settings/summary-prompt"),set:(e,t)=>Lr(e,"/api/settings/summary-prompt",{prompt:t})},conversions:{start:(e,t,n,r)=>tt(e,"/api/conversions",{kind:t,item:n,media:r==null?void 0:r.media,snapshot:r==null?void 0:r.snapshot,options:r==null?void 0:r.options,input:r==null?void 0:r.input,force:r==null?void 0:r.force}),forItem:(e,t,n)=>De(e,`/api/conversions?item=${encodeURIComponent(t)}${n!=null&&n.expandResult?"&expand=result":""}`),latest:async(e,t,n,r)=>(await De(e,`/api/conversions?item=${encodeURIComponent(t)}&kind=${n}${r!=null&&r.expandResult?"&expand=result":""}`)).items[0]??null,list:(e,t)=>De(e,`/api/conversions?${new URLSearchParams({...t!=null&&t.kind?{kind:t.kind}:{},...t!=null&&t.limit?{limit:String(t.limit)}:{}})}`),remove:(e,t)=>ar(e,`/api/conversions/${encodeURIComponent(t)}`),kinds:e=>De(e,"/api/conversion-kinds")},download:(e,t)=>tt(e,"/api/downloads",t),downloadJobs:(e,t)=>De(e,`/api/downloads${t?`?platform=${encodeURIComponent(t)}`:""}`).then(n=>({jobs:n.items})),archiveStatus:async(e,t)=>{const r=[];for(let o=0;o<t.length;o+=200)r.push(t.slice(o,o+200));const i=await Promise.all(r.map(o=>De(e,`/api/media/assets?refs=${o.map(c=>`${encodeURIComponent(c.platform)}:${encodeURIComponent(c.trackId)}`).join(",")}`)));return{archived:Object.assign({},...i.map(o=>o.archived))}},deleteArchived:(e,t,n)=>ar(e,`/api/media/assets/${encodeURIComponent(t)}/${encodeURIComponent(n)}`),setSync:(e,t,n)=>Ir(e,`/api/streams/${encodeURIComponent(t)}`,{options:{autoDownload:n}}),exportStreamPlaylist:(e,t)=>tt(e,`/api/streams/${encodeURIComponent(t)}/playlist-export`,{}),exportCollectionPlaylist:(e,t)=>tt(e,`/api/collections/${encodeURIComponent(t)}/playlist-export`,{}),netdisk:{verifyShare:(e,t)=>tt(e,"/api/netdisk/share/verify",t),saveShare:(e,t)=>tt(e,"/api/netdisk/share/save",t),list:e=>De(e,"/api/netdisk/mappings"),get:(e,t)=>De(e,`/api/netdisk/mappings/${encodeURIComponent(t)}`),create:(e,t)=>tt(e,"/api/netdisk/mappings",t),sync:(e,t)=>tt(e,`/api/netdisk/mappings/${encodeURIComponent(t)}/sync`,{}),rebind:(e,t,n)=>tt(e,`/api/netdisk/mappings/${encodeURIComponent(t)}/rebind`,{dirPath:n}),remove:(e,t)=>ar(e,`/api/netdisk/mappings/${encodeURIComponent(t)}`),removeWithFiles:(e,t)=>ar(e,`/api/netdisk/mappings/${encodeURIComponent(t)}?files=1`),patchEntry:(e,t,n,r)=>Ir(e,`/api/netdisk/mappings/${encodeURIComponent(t)}/entries/${encodeURIComponent(n)}`,r),listFs:(e,t,n)=>De(e,`/api/netdisk/fs?path=${encodeURIComponent(t)}${n!=null&&n.recursive?"&recursive=1":""}${n!=null&&n.dirs?"&dirs=1":""}${n!=null&&n.refresh?"&refresh=1":""}`),mkdir:(e,t)=>tt(e,"/api/netdisk/fs/mkdir",{path:t}),mounts:e=>De(e,"/api/netdisk/mounts"),setMounts:(e,t)=>Lr(e,"/api/netdisk/mounts",{mounts:t}),reconcileMounts:e=>tt(e,"/api/netdisk/mounts/reconcile",{})},netdiskFsMove:(e,t,n,r)=>tt(e,"/api/netdisk/fs/move",{srcDir:t,dstDir:n,names:r}),netdiskFsRemove:(e,t,n)=>tt(e,"/api/netdisk/fs/remove",{dir:t,names:n}),reconcile:{config:e=>De(e,"/api/netdisk/reconcile/config"),putConfig:(e,t)=>Lr(e,"/api/netdisk/reconcile/config",{shows:t}),streamAuthority:(e,t)=>De(e,`/api/netdisk/reconcile/streams/${encodeURIComponent(t)}/authority`),preview:(e,t)=>tt(e,`/api/netdisk/reconcile/${encodeURIComponent(t)}/preview`,{}),execute:(e,t)=>tt(e,`/api/netdisk/reconcile/${encodeURIComponent(t)}/execute`,{}),previewBinding:(e,t)=>tt(e,`/api/netdisk/reconcile/bindings/${encodeURIComponent(t)}/preview`,{}),executeBinding:(e,t)=>tt(e,`/api/netdisk/reconcile/bindings/${encodeURIComponent(t)}/execute`,{}),setDecision:(e,t,n,r)=>tt(e,"/api/netdisk/reconcile/decisions",{key:t,verdict:n,note:r}),setNotEpisode:(e,t,n,r=!0)=>tt(e,"/api/netdisk/reconcile/decisions",{leftKey:t,path:n,verdict:r?"not-episode":null}),setIsEpisode:(e,t,n,r=!0)=>tt(e,"/api/netdisk/reconcile/decisions",{leftKey:t,path:n,verdict:r?"is-episode":null}),setPreferred:(e,t,n,r=!0)=>tt(e,"/api/netdisk/reconcile/decisions",{keptPath:t,loserPath:n,verdict:r?"prefer":null}),suggestions:(e,t={})=>{const n=new URLSearchParams;for(const[i,o]of Object.entries(t))o!=null&&n.set(i,String(o));const r=n.toString();return De(e,`/api/netdisk/reconcile/suggestions${r?`?${r}`:""}`)}},sharing:{exportBundle:(e,t,n,r)=>tt(e,"/api/sharing/exports",{root:t,meta:n,...r}),importBundle:(e,t)=>tt(e,"/api/sharing/imports",t),imports:e=>De(e,"/api/sharing/imports").then(t=>t.items),importRun:(e,t)=>De(e,`/api/sharing/imports/${encodeURIComponent(t)}`),decide:(e,t,n,r)=>tt(e,`/api/sharing/imports/${encodeURIComponent(t)}/decisions`,{itemId:n,choice:r})},voiceprint:{listPersons:e=>De(e,"/api/voiceprint/persons").then(t=>t.persons),createPerson:(e,t)=>tt(e,"/api/voiceprint/persons",{name:t}),deletePerson:(e,t)=>ar(e,`/api/voiceprint/persons/${encodeURIComponent(t)}`),recluster:(e,t)=>tt(e,`/api/voiceprint/item/${encodeURIComponent(t)}/clusters`,{}),listClusters:(e,t)=>De(e,`/api/voiceprint/item/${encodeURIComponent(t)}/clusters`).then(n=>n.clusters),enroll:(e,t,n,r)=>tt(e,`/api/voiceprint/item/${encodeURIComponent(t)}/clusters/${encodeURIComponent(n)}/enroll`,{personId:r}),rejectPending:(e,t,n)=>ar(e,`/api/voiceprint/item/${encodeURIComponent(t)}/pending/${encodeURIComponent(n)}`),blocks:(e,t,n)=>{const r=new URLSearchParams;n!=null&&n.person&&r.set("person",n.person),n!=null&&n.minSeconds&&r.set("minSeconds",String(n.minSeconds));const i=r.toString();return De(e,`/api/voiceprint/item/${encodeURIComponent(t)}/blocks${i?`?${i}`:""}`).then(o=>o.blocks)}}};var Ba=yw();const _P=wr(Ba);function OP(e){if(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))}const zP=e=>{switch(e){case"success":return IP;case"info":return BP;case"warning":return $P;case"error":return UP;default:return null}},PP=Array(12).fill(0),LP=({visible:e,className:t})=>Re.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Re.createElement("div",{className:"sonner-spinner"},PP.map((n,r)=>Re.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),IP=Re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Re.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"})),$P=Re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Re.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"})),BP=Re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Re.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"})),UP=Re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Re.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"})),VP=Re.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"},Re.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Re.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),FP=()=>{const[e,t]=Re.useState(document.hidden);return Re.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Cp=1;class HP{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...i}=t,o=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Cp++,c=this.toasts.find(h=>h.id===o),d=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),c?this.toasts=this.toasts.map(h=>h.id===o?(this.publish({...h,...t,id:o,title:r}),{...h,...t,id:o,dismissible:d,title:r}):h):this.addToast({title:r,...i,dismissible:d,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let o=r!==void 0,c;const d=i.then(async m=>{if(c=["resolve",m],Re.isValidElement(m))o=!1,this.create({id:r,type:"default",message:m});else if(KP(m)&&!m.ok){o=!1;const g=typeof n.error=="function"?await n.error(`HTTP error! status: ${m.status}`):n.error,v=typeof n.description=="function"?await n.description(`HTTP error! status: ${m.status}`):n.description,b=typeof g=="object"&&!Re.isValidElement(g)?g:{message:g};this.create({id:r,type:"error",description:v,...b})}else if(m instanceof Error){o=!1;const g=typeof n.error=="function"?await n.error(m):n.error,v=typeof n.description=="function"?await n.description(m):n.description,b=typeof g=="object"&&!Re.isValidElement(g)?g:{message:g};this.create({id:r,type:"error",description:v,...b})}else if(n.success!==void 0){o=!1;const g=typeof n.success=="function"?await n.success(m):n.success,v=typeof n.description=="function"?await n.description(m):n.description,b=typeof g=="object"&&!Re.isValidElement(g)?g:{message:g};this.create({id:r,type:"success",description:v,...b})}}).catch(async m=>{if(c=["reject",m],n.error!==void 0){o=!1;const x=typeof n.error=="function"?await n.error(m):n.error,g=typeof n.description=="function"?await n.description(m):n.description,S=typeof x=="object"&&!Re.isValidElement(x)?x:{message:x};this.create({id:r,type:"error",description:g,...S})}}).finally(()=>{o&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),h=()=>new Promise((m,x)=>d.then(()=>c[0]==="reject"?x(c[1]):m(c[1])).catch(x));return typeof r!="string"&&typeof r!="number"?{unwrap:h}:Object.assign(r,{unwrap:h})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||Cp++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const ir=new HP,qP=(e,t)=>{const n=(t==null?void 0:t.id)||Cp++;return ir.addToast({title:e,...t,id:n}),n},KP=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",GP=qP,YP=()=>ir.toasts,WP=()=>ir.getActiveToasts(),os=Object.assign(GP,{success:ir.success,info:ir.info,warning:ir.warning,error:ir.error,custom:ir.custom,message:ir.message,promise:ir.promise,dismiss:ir.dismiss,loading:ir.loading},{getHistory:YP,getToasts:WP});OP("[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}[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(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);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]{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 zd(e){return e.label!==void 0}const XP=3,QP="24px",ZP="16px",Qw=4e3,JP=356,e5=14,t5=45,n5=200;function Cs(...e){return e.filter(Boolean).join(" ")}function r5(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const s5=e=>{var t,n,r,i,o,c,d,h,m;const{invert:x,toast:g,unstyled:v,interacting:S,setHeights:b,visibleToasts:j,heights:C,index:k,toasts:N,expanded:E,removeToast:R,defaultRichColors:A,closeButton:_,style:z,cancelButtonStyle:D,actionButtonStyle:V,className:I="",descriptionClassName:Q="",duration:B,position:H,gap:ee,expandByDefault:W,classNames:M,icons:U,closeButtonAriaLabel:K="Close toast"}=e,[ne,q]=Re.useState(null),[P,L]=Re.useState(null),[G,J]=Re.useState(!1),[$,se]=Re.useState(!1),[oe,ie]=Re.useState(!1),[Z,ve]=Re.useState(!1),[Ee,Te]=Re.useState(!1),[Ie,Fe]=Re.useState(0),[fe,Se]=Re.useState(0),ye=Re.useRef(g.duration||B||Qw),Qe=Re.useRef(null),nt=Re.useRef(null),re=k===0,_e=k+1<=j,Pe=g.type,Xe=g.dismissible!==!1,ge=g.className||"",Ye=g.descriptionClassName||"",je=Re.useMemo(()=>C.findIndex(ke=>ke.toastId===g.id)||0,[C,g.id]),kt=Re.useMemo(()=>{var ke;return(ke=g.closeButton)!=null?ke:_},[g.closeButton,_]),zt=Re.useMemo(()=>g.duration||B||Qw,[g.duration,B]),Qn=Re.useRef(0),hn=Re.useRef(0),Zn=Re.useRef(0),sn=Re.useRef(null),[Jn,we]=H.split("-"),Oe=Re.useMemo(()=>C.reduce((ke,ft,Pt)=>Pt>=je?ke:ke+ft.height,0),[C,je]),lt=FP(),an=g.invert||x,en=Pe==="loading";hn.current=Re.useMemo(()=>je*ee+Oe,[je,Oe]),Re.useEffect(()=>{ye.current=zt},[zt]),Re.useEffect(()=>{J(!0)},[]),Re.useEffect(()=>{const ke=nt.current;if(ke){const ft=ke.getBoundingClientRect().height;return Se(ft),b(Pt=>[{toastId:g.id,height:ft,position:g.position},...Pt]),()=>b(Pt=>Pt.filter(Qt=>Qt.toastId!==g.id))}},[b,g.id]),Re.useLayoutEffect(()=>{if(!G)return;const ke=nt.current,ft=ke.style.height;ke.style.height="auto";const Pt=ke.getBoundingClientRect().height;ke.style.height=ft,Se(Pt),b(Qt=>Qt.find(At=>At.toastId===g.id)?Qt.map(At=>At.toastId===g.id?{...At,height:Pt}:At):[{toastId:g.id,height:Pt,position:g.position},...Qt])},[G,g.title,g.description,b,g.id,g.jsx,g.action,g.cancel]);const bt=Re.useCallback(()=>{se(!0),Fe(hn.current),b(ke=>ke.filter(ft=>ft.toastId!==g.id)),setTimeout(()=>{R(g)},n5)},[g,R,b,hn]);Re.useEffect(()=>{if(g.promise&&Pe==="loading"||g.duration===1/0||g.type==="loading")return;let ke;return E||S||lt?(()=>{if(Zn.current<Qn.current){const Qt=new Date().getTime()-Qn.current;ye.current=ye.current-Qt}Zn.current=new Date().getTime()})():(()=>{ye.current!==1/0&&(Qn.current=new Date().getTime(),ke=setTimeout(()=>{g.onAutoClose==null||g.onAutoClose.call(g,g),bt()},ye.current))})(),()=>clearTimeout(ke)},[E,S,g,Pe,lt,bt]),Re.useEffect(()=>{g.delete&&(bt(),g.onDismiss==null||g.onDismiss.call(g,g))},[bt,g.delete]);function Ft(){var ke;if(U!=null&&U.loading){var ft;return Re.createElement("div",{className:Cs(M==null?void 0:M.loader,g==null||(ft=g.classNames)==null?void 0:ft.loader,"sonner-loader"),"data-visible":Pe==="loading"},U.loading)}return Re.createElement(LP,{className:Cs(M==null?void 0:M.loader,g==null||(ke=g.classNames)==null?void 0:ke.loader),visible:Pe==="loading"})}const jn=g.icon||(U==null?void 0:U[Pe])||zP(Pe);var Me,Ue;return Re.createElement("li",{tabIndex:0,ref:nt,className:Cs(I,ge,M==null?void 0:M.toast,g==null||(t=g.classNames)==null?void 0:t.toast,M==null?void 0:M.default,M==null?void 0:M[Pe],g==null||(n=g.classNames)==null?void 0:n[Pe]),"data-sonner-toast":"","data-rich-colors":(Me=g.richColors)!=null?Me:A,"data-styled":!(g.jsx||g.unstyled||v),"data-mounted":G,"data-promise":!!g.promise,"data-swiped":Ee,"data-removed":$,"data-visible":_e,"data-y-position":Jn,"data-x-position":we,"data-index":k,"data-front":re,"data-swiping":oe,"data-dismissible":Xe,"data-type":Pe,"data-invert":an,"data-swipe-out":Z,"data-swipe-direction":P,"data-expanded":!!(E||W&&G),"data-testid":g.testId,style:{"--index":k,"--toasts-before":k,"--z-index":N.length-k,"--offset":`${$?Ie:hn.current}px`,"--initial-height":W?"auto":`${fe}px`,...z,...g.style},onDragEnd:()=>{ie(!1),q(null),sn.current=null},onPointerDown:ke=>{ke.button!==2&&(en||!Xe||(Qe.current=new Date,Fe(hn.current),ke.target.setPointerCapture(ke.pointerId),ke.target.tagName!=="BUTTON"&&(ie(!0),sn.current={x:ke.clientX,y:ke.clientY})))},onPointerUp:()=>{var ke,ft,Pt;if(Z||!Xe)return;sn.current=null;const Qt=Number(((ke=nt.current)==null?void 0:ke.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),An=Number(((ft=nt.current)==null?void 0:ft.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),At=new Date().getTime()-((Pt=Qe.current)==null?void 0:Pt.getTime()),On=ne==="x"?Qt:An,vs=Math.abs(On)/At;if(Math.abs(On)>=t5||vs>.11){Fe(hn.current),g.onDismiss==null||g.onDismiss.call(g,g),L(ne==="x"?Qt>0?"right":"left":An>0?"down":"up"),bt(),ve(!0);return}else{var Ht,Mn;(Ht=nt.current)==null||Ht.style.setProperty("--swipe-amount-x","0px"),(Mn=nt.current)==null||Mn.style.setProperty("--swipe-amount-y","0px")}Te(!1),ie(!1),q(null)},onPointerMove:ke=>{var ft,Pt,Qt;if(!sn.current||!Xe||((ft=window.getSelection())==null?void 0:ft.toString().length)>0)return;const At=ke.clientY-sn.current.y,On=ke.clientX-sn.current.x;var vs;const Ht=(vs=e.swipeDirections)!=null?vs:r5(H);!ne&&(Math.abs(On)>1||Math.abs(At)>1)&&q(Math.abs(On)>Math.abs(At)?"x":"y");let Mn={x:0,y:0};const xa=er=>1/(1.5+Math.abs(er)/20);if(ne==="y"){if(Ht.includes("top")||Ht.includes("bottom"))if(Ht.includes("top")&&At<0||Ht.includes("bottom")&&At>0)Mn.y=At;else{const er=At*xa(At);Mn.y=Math.abs(er)<Math.abs(At)?er:At}}else if(ne==="x"&&(Ht.includes("left")||Ht.includes("right")))if(Ht.includes("left")&&On<0||Ht.includes("right")&&On>0)Mn.x=On;else{const er=On*xa(On);Mn.x=Math.abs(er)<Math.abs(On)?er:On}(Math.abs(Mn.x)>0||Math.abs(Mn.y)>0)&&Te(!0),(Pt=nt.current)==null||Pt.style.setProperty("--swipe-amount-x",`${Mn.x}px`),(Qt=nt.current)==null||Qt.style.setProperty("--swipe-amount-y",`${Mn.y}px`)}},kt&&!g.jsx&&Pe!=="loading"?Re.createElement("button",{"aria-label":K,"data-disabled":en,"data-close-button":!0,onClick:en||!Xe?()=>{}:()=>{bt(),g.onDismiss==null||g.onDismiss.call(g,g)},className:Cs(M==null?void 0:M.closeButton,g==null||(r=g.classNames)==null?void 0:r.closeButton)},(Ue=U==null?void 0:U.close)!=null?Ue:VP):null,(Pe||g.icon||g.promise)&&g.icon!==null&&((U==null?void 0:U[Pe])!==null||g.icon)?Re.createElement("div",{"data-icon":"",className:Cs(M==null?void 0:M.icon,g==null||(i=g.classNames)==null?void 0:i.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||Ft():null,g.type!=="loading"?jn:null):null,Re.createElement("div",{"data-content":"",className:Cs(M==null?void 0:M.content,g==null||(o=g.classNames)==null?void 0:o.content)},Re.createElement("div",{"data-title":"",className:Cs(M==null?void 0:M.title,g==null||(c=g.classNames)==null?void 0:c.title)},g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title),g.description?Re.createElement("div",{"data-description":"",className:Cs(Q,Ye,M==null?void 0:M.description,g==null||(d=g.classNames)==null?void 0:d.description)},typeof g.description=="function"?g.description():g.description):null),Re.isValidElement(g.cancel)?g.cancel:g.cancel&&zd(g.cancel)?Re.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||D,onClick:ke=>{zd(g.cancel)&&Xe&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,ke),bt())},className:Cs(M==null?void 0:M.cancelButton,g==null||(h=g.classNames)==null?void 0:h.cancelButton)},g.cancel.label):null,Re.isValidElement(g.action)?g.action:g.action&&zd(g.action)?Re.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||V,onClick:ke=>{zd(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,ke),!ke.defaultPrevented&&bt())},className:Cs(M==null?void 0:M.actionButton,g==null||(m=g.classNames)==null?void 0:m.actionButton)},g.action.label):null)};function Zw(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function a5(e,t){const n={};return[e,t].forEach((r,i)=>{const o=i===1,c=o?"--mobile-offset":"--offset",d=o?ZP:QP;function h(m){["top","right","bottom","left"].forEach(x=>{n[`${c}-${x}`]=typeof m=="number"?`${m}px`:m})}typeof r=="number"||typeof r=="string"?h(r):typeof r=="object"?["top","right","bottom","left"].forEach(m=>{r[m]===void 0?n[`${c}-${m}`]=d:n[`${c}-${m}`]=typeof r[m]=="number"?`${r[m]}px`:r[m]}):h(d)}),n}const i5=Re.forwardRef(function(t,n){const{id:r,invert:i,position:o="bottom-right",hotkey:c=["altKey","KeyT"],expand:d,closeButton:h,className:m,offset:x,mobileOffset:g,theme:v="light",richColors:S,duration:b,style:j,visibleToasts:C=XP,toastOptions:k,dir:N=Zw(),gap:E=e5,icons:R,containerAriaLabel:A="Notifications"}=t,[_,z]=Re.useState([]),D=Re.useMemo(()=>r?_.filter(G=>G.toasterId===r):_.filter(G=>!G.toasterId),[_,r]),V=Re.useMemo(()=>Array.from(new Set([o].concat(D.filter(G=>G.position).map(G=>G.position)))),[D,o]),[I,Q]=Re.useState([]),[B,H]=Re.useState(!1),[ee,W]=Re.useState(!1),[M,U]=Re.useState(v!=="system"?v:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),K=Re.useRef(null),ne=c.join("+").replace(/Key/g,"").replace(/Digit/g,""),q=Re.useRef(null),P=Re.useRef(!1),L=Re.useCallback(G=>{z(J=>{var $;return($=J.find(se=>se.id===G.id))!=null&&$.delete||ir.dismiss(G.id),J.filter(({id:se})=>se!==G.id)})},[]);return Re.useEffect(()=>ir.subscribe(G=>{if(G.dismiss){requestAnimationFrame(()=>{z(J=>J.map($=>$.id===G.id?{...$,delete:!0}:$))});return}setTimeout(()=>{_P.flushSync(()=>{z(J=>{const $=J.findIndex(se=>se.id===G.id);return $!==-1?[...J.slice(0,$),{...J[$],...G},...J.slice($+1)]:[G,...J]})})})}),[_]),Re.useEffect(()=>{if(v!=="system"){U(v);return}if(v==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;const G=window.matchMedia("(prefers-color-scheme: dark)");try{G.addEventListener("change",({matches:J})=>{U(J?"dark":"light")})}catch{G.addListener(({matches:$})=>{try{U($?"dark":"light")}catch(se){console.error(se)}})}},[v]),Re.useEffect(()=>{_.length<=1&&H(!1)},[_]),Re.useEffect(()=>{const G=J=>{var $;if(c.every(ie=>J[ie]||J.code===ie)){var oe;H(!0),(oe=K.current)==null||oe.focus()}J.code==="Escape"&&(document.activeElement===K.current||($=K.current)!=null&&$.contains(document.activeElement))&&H(!1)};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[c]),Re.useEffect(()=>{if(K.current)return()=>{q.current&&(q.current.focus({preventScroll:!0}),q.current=null,P.current=!1)}},[K.current]),Re.createElement("section",{ref:n,"aria-label":`${A} ${ne}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},V.map((G,J)=>{var $;const[se,oe]=G.split("-");return D.length?Re.createElement("ol",{key:G,dir:N==="auto"?Zw():N,tabIndex:-1,ref:K,className:m,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":se,"data-x-position":oe,style:{"--front-toast-height":`${(($=I[0])==null?void 0:$.height)||0}px`,"--width":`${JP}px`,"--gap":`${E}px`,...j,...a5(x,g)},onBlur:ie=>{P.current&&!ie.currentTarget.contains(ie.relatedTarget)&&(P.current=!1,q.current&&(q.current.focus({preventScroll:!0}),q.current=null))},onFocus:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||P.current||(P.current=!0,q.current=ie.relatedTarget)},onMouseEnter:()=>H(!0),onMouseMove:()=>H(!0),onMouseLeave:()=>{ee||H(!1)},onDragEnd:()=>H(!1),onPointerDown:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||W(!0)},onPointerUp:()=>W(!1)},D.filter(ie=>!ie.position&&J===0||ie.position===G).map((ie,Z)=>{var ve,Ee;return Re.createElement(s5,{key:ie.id,icons:R,index:Z,toast:ie,defaultRichColors:S,duration:(ve=k==null?void 0:k.duration)!=null?ve:b,className:k==null?void 0:k.className,descriptionClassName:k==null?void 0:k.descriptionClassName,invert:i,visibleToasts:C,closeButton:(Ee=k==null?void 0:k.closeButton)!=null?Ee:h,interacting:ee,position:G,style:k==null?void 0:k.style,unstyled:k==null?void 0:k.unstyled,classNames:k==null?void 0:k.classNames,cancelButtonStyle:k==null?void 0:k.cancelButtonStyle,actionButtonStyle:k==null?void 0:k.actionButtonStyle,closeButtonAriaLabel:k==null?void 0:k.closeButtonAriaLabel,removeToast:L,toasts:D.filter(Te=>Te.position==ie.position),heights:I.filter(Te=>Te.position==ie.position),setHeights:Q,expandByDefault:d,gap:E,expanded:B,swipeDirections:t.swipeDirections})})):null}))});function Jw(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=Jw(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function e1(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Jw(e))&&(r&&(r+=" "),r+=t);return r}const o5=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},l5=(e,t)=>({classGroupId:e,validator:t}),t1=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Pd="-",n1=[],c5="arbitrary..",u5=e=>{const t=f5(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return d5(c);const d=c.split(Pd),h=d[0]===""&&d.length>1?1:0;return r1(d,h,t)},getConflictingClassGroupIds:(c,d)=>{if(d){const h=r[c],m=n[c];return h?m?o5(m,h):h:m||n1}return n[c]||n1}}},r1=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],o=n.nextPart.get(i);if(o){const m=r1(e,t+1,o);if(m)return m}const c=n.validators;if(c===null)return;const d=t===0?e.join(Pd):e.slice(t).join(Pd),h=c.length;for(let m=0;m<h;m++){const x=c[m];if(x.validator(d))return x.classGroupId}},d5=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?c5+r:void 0})(),f5=e=>{const{theme:t,classGroups:n}=e;return h5(n,t)},h5=(e,t)=>{const n=t1();for(const r in e){const i=e[r];kp(i,n,r,t)}return n},kp=(e,t,n,r)=>{const i=e.length;for(let o=0;o<i;o++){const c=e[o];m5(c,t,n,r)}},m5=(e,t,n,r)=>{if(typeof e=="string"){p5(e,t,n);return}if(typeof e=="function"){g5(e,t,n,r);return}x5(e,t,n,r)},p5=(e,t,n)=>{const r=e===""?t:s1(t,e);r.classGroupId=n},g5=(e,t,n,r)=>{if(v5(e)){kp(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(l5(n,e))},x5=(e,t,n,r)=>{const i=Object.entries(e),o=i.length;for(let c=0;c<o;c++){const[d,h]=i[c];kp(h,s1(t,d),n,r)}},s1=(e,t)=>{let n=e;const r=t.split(Pd),i=r.length;for(let o=0;o<i;o++){const c=r[o];let d=n.nextPart.get(c);d||(d=t1(),n.nextPart.set(c,d)),n=d}return n},v5=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,y5=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(o,c)=>{n[o]=c,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(o){let c=n[o];if(c!==void 0)return c;if((c=r[o])!==void 0)return i(o,c),c},set(o,c){o in n?n[o]=c:i(o,c)}}},Np="!",a1=":",b5=[],i1=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),w5=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const o=[];let c=0,d=0,h=0,m;const x=i.length;for(let j=0;j<x;j++){const C=i[j];if(c===0&&d===0){if(C===a1){o.push(i.slice(h,j)),h=j+1;continue}if(C==="/"){m=j;continue}}C==="["?c++:C==="]"?c--:C==="("?d++:C===")"&&d--}const g=o.length===0?i:i.slice(h);let v=g,S=!1;g.endsWith(Np)?(v=g.slice(0,-1),S=!0):g.startsWith(Np)&&(v=g.slice(1),S=!0);const b=m&&m>h?m-h:void 0;return i1(o,S,v,b)};if(t){const i=t+a1,o=r;r=c=>c.startsWith(i)?o(c.slice(i.length)):i1(b5,!1,c,void 0,!0)}if(n){const i=r;r=o=>n({className:o,parseClassName:i})}return r},S5=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let o=0;o<n.length;o++){const c=n[o],d=c[0]==="[",h=t.has(c);d||h?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(c)):i.push(c)}return i.length>0&&(i.sort(),r.push(...i)),r}},j5=e=>({cache:y5(e.cacheSize),parseClassName:w5(e),sortModifiers:S5(e),postfixLookupClassGroupIds:C5(e),...u5(e)}),C5=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},k5=/\s+/,N5=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:o,postfixLookupClassGroupIds:c}=t,d=[],h=e.trim().split(k5);let m="";for(let x=h.length-1;x>=0;x-=1){const g=h[x],{isExternal:v,modifiers:S,hasImportantModifier:b,baseClassName:j,maybePostfixModifierPosition:C}=n(g);if(v){m=g+(m.length>0?" "+m:m);continue}let k=!!C,N;if(k){const z=j.substring(0,C);N=r(z);const D=N&&c[N]?r(j):void 0;D&&D!==N&&(N=D,k=!1)}else N=r(j);if(!N){if(!k){m=g+(m.length>0?" "+m:m);continue}if(N=r(j),!N){m=g+(m.length>0?" "+m:m);continue}k=!1}const E=S.length===0?"":S.length===1?S[0]:o(S).join(":"),R=b?E+Np:E,A=R+N;if(d.indexOf(A)>-1)continue;d.push(A);const _=i(N,k);for(let z=0;z<_.length;++z){const D=_[z];d.push(R+D)}m=g+(m.length>0?" "+m:m)}return m},T5=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=o1(n))&&(i&&(i+=" "),i+=r);return i},o1=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=o1(e[r]))&&(n&&(n+=" "),n+=t);return n},E5=(e,...t)=>{let n,r,i,o;const c=h=>{const m=t.reduce((x,g)=>g(x),e());return n=j5(m),r=n.cache.get,i=n.cache.set,o=d,d(h)},d=h=>{const m=r(h);if(m)return m;const x=N5(h,n);return i(h,x),x};return o=c,(...h)=>o(T5(...h))},R5=[],yn=e=>{const t=n=>n[e]||R5;return t.isThemeGetter=!0,t},l1=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,c1=/^\((?:(\w[\w-]*):)?(.+)\)$/i,A5=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,M5=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,D5=/\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$/,_5=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,O5=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,z5=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ua=e=>A5.test(e),dt=e=>!!e&&!Number.isNaN(Number(e)),ks=e=>!!e&&Number.isInteger(Number(e)),Tp=e=>e.endsWith("%")&&dt(e.slice(0,-1)),Ws=e=>M5.test(e),u1=()=>!0,P5=e=>D5.test(e)&&!_5.test(e),Ep=()=>!1,L5=e=>O5.test(e),I5=e=>z5.test(e),$5=e=>!ze(e)&&!Le(e),B5=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)),U5=e=>Va(e,g1,Ep),ze=e=>l1.test(e),Li=e=>Va(e,x1,P5),d1=e=>Va(e,W5,dt),V5=e=>Va(e,y1,u1),F5=e=>Va(e,v1,Ep),f1=e=>Va(e,m1,Ep),H5=e=>Va(e,p1,I5),Ld=e=>Va(e,b1,L5),Le=e=>c1.test(e),xc=e=>Ii(e,x1),q5=e=>Ii(e,v1),h1=e=>Ii(e,m1),K5=e=>Ii(e,g1),G5=e=>Ii(e,p1),Id=e=>Ii(e,b1,!0),Y5=e=>Ii(e,y1,!0),Va=(e,t,n)=>{const r=l1.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ii=(e,t,n=!1)=>{const r=c1.exec(e);return r?r[1]?t(r[1]):n:!1},m1=e=>e==="position"||e==="percentage",p1=e=>e==="image"||e==="url",g1=e=>e==="length"||e==="size"||e==="bg-size",x1=e=>e==="length",W5=e=>e==="number",v1=e=>e==="family-name",y1=e=>e==="number"||e==="weight",b1=e=>e==="shadow",X5=E5(()=>{const e=yn("color"),t=yn("font"),n=yn("text"),r=yn("font-weight"),i=yn("tracking"),o=yn("leading"),c=yn("breakpoint"),d=yn("container"),h=yn("spacing"),m=yn("radius"),x=yn("shadow"),g=yn("inset-shadow"),v=yn("text-shadow"),S=yn("drop-shadow"),b=yn("blur"),j=yn("perspective"),C=yn("aspect"),k=yn("ease"),N=yn("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[...R(),Le,ze],_=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],D=()=>[Le,ze,h],V=()=>[Ua,"full","auto",...D()],I=()=>[ks,"none","subgrid",Le,ze],Q=()=>["auto",{span:["full",ks,Le,ze]},ks,Le,ze],B=()=>[ks,"auto",Le,ze],H=()=>["auto","min","max","fr",Le,ze],ee=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...D()],U=()=>[Ua,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],K=()=>[Ua,"screen","full","dvw","lvw","svw","min","max","fit",...D()],ne=()=>[Ua,"screen","full","lh","dvh","lvh","svh","min","max","fit",...D()],q=()=>[e,Le,ze],P=()=>[...R(),h1,f1,{position:[Le,ze]}],L=()=>["no-repeat",{repeat:["","x","y","space","round"]}],G=()=>["auto","cover","contain",K5,U5,{size:[Le,ze]}],J=()=>[Tp,xc,Li],$=()=>["","none","full",m,Le,ze],se=()=>["",dt,xc,Li],oe=()=>["solid","dashed","dotted","double"],ie=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Z=()=>[dt,Tp,h1,f1],ve=()=>["","none",b,Le,ze],Ee=()=>["none",dt,Le,ze],Te=()=>["none",dt,Le,ze],Ie=()=>[dt,Le,ze],Fe=()=>[Ua,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ws],breakpoint:[Ws],color:[u1],container:[Ws],"drop-shadow":[Ws],ease:["in","out","in-out"],font:[$5],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ws],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ws],shadow:[Ws],spacing:["px",dt],text:[Ws],"text-shadow":[Ws],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ua,ze,Le,C]}],container:["container"],"container-type":[{"@container":["","normal","size",Le,ze]}],"container-named":[B5],columns:[{columns:[dt,ze,Le,d]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"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:A()}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:V()}],"inset-x":[{"inset-x":V()}],"inset-y":[{"inset-y":V()}],start:[{"inset-s":V(),start:V()}],end:[{"inset-e":V(),end:V()}],"inset-bs":[{"inset-bs":V()}],"inset-be":[{"inset-be":V()}],top:[{top:V()}],right:[{right:V()}],bottom:[{bottom:V()}],left:[{left:V()}],visibility:["visible","invisible","collapse"],z:[{z:[ks,"auto",Le,ze]}],basis:[{basis:[Ua,"full","auto",d,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[dt,Ua,"auto","initial","none",ze]}],grow:[{grow:["",dt,Le,ze]}],shrink:[{shrink:["",dt,Le,ze]}],order:[{order:[ks,"first","last","none",Le,ze]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:Q()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:Q()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":H()}],"auto-rows":[{"auto-rows":H()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...ee(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...ee()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pbs:[{pbs:D()}],pbe:[{pbe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:U()}],"inline-size":[{inline:["auto",...K()]}],"min-inline-size":[{"min-inline":["auto",...K()]}],"max-inline-size":[{"max-inline":["none",...K()]}],"block-size":[{block:["auto",...ne()]}],"min-block-size":[{"min-block":["auto",...ne()]}],"max-block-size":[{"max-block":["none",...ne()]}],w:[{w:[d,"screen",...U()]}],"min-w":[{"min-w":[d,"screen","none",...U()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[c]},...U()]}],h:[{h:["screen","lh",...U()]}],"min-h":[{"min-h":["screen","lh","none",...U()]}],"max-h":[{"max-h":["screen","lh",...U()]}],"font-size":[{text:["base",n,xc,Li]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Y5,V5]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Tp,ze]}],"font-family":[{font:[q5,F5,t]}],"font-features":[{"font-features":[ze]}],"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,Le,ze]}],"line-clamp":[{"line-clamp":[dt,"none",Le,d1]}],leading:[{leading:[o,...D()]}],"list-image":[{"list-image":["none",Le,ze]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Le,ze]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:q()}],"text-color":[{text:q()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...oe(),"wavy"]}],"text-decoration-thickness":[{decoration:[dt,"from-font","auto",Le,Li]}],"text-decoration-color":[{decoration:q()}],"underline-offset":[{"underline-offset":[dt,"auto",Le,ze]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"tab-size":[{tab:[ks,Le,ze]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Le,ze]}],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",Le,ze]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:L()}],"bg-size":[{bg:G()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ks,Le,ze],radial:["",Le,ze],conic:[ks,Le,ze]},G5,H5]}],"bg-color":[{bg:q()}],"gradient-from-pos":[{from:J()}],"gradient-via-pos":[{via:J()}],"gradient-to-pos":[{to:J()}],"gradient-from":[{from:q()}],"gradient-via":[{via:q()}],"gradient-to":[{to:q()}],rounded:[{rounded:$()}],"rounded-s":[{"rounded-s":$()}],"rounded-e":[{"rounded-e":$()}],"rounded-t":[{"rounded-t":$()}],"rounded-r":[{"rounded-r":$()}],"rounded-b":[{"rounded-b":$()}],"rounded-l":[{"rounded-l":$()}],"rounded-ss":[{"rounded-ss":$()}],"rounded-se":[{"rounded-se":$()}],"rounded-ee":[{"rounded-ee":$()}],"rounded-es":[{"rounded-es":$()}],"rounded-tl":[{"rounded-tl":$()}],"rounded-tr":[{"rounded-tr":$()}],"rounded-br":[{"rounded-br":$()}],"rounded-bl":[{"rounded-bl":$()}],"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:[...oe(),"hidden","none"]}],"divide-style":[{divide:[...oe(),"hidden","none"]}],"border-color":[{border:q()}],"border-color-x":[{"border-x":q()}],"border-color-y":[{"border-y":q()}],"border-color-s":[{"border-s":q()}],"border-color-e":[{"border-e":q()}],"border-color-bs":[{"border-bs":q()}],"border-color-be":[{"border-be":q()}],"border-color-t":[{"border-t":q()}],"border-color-r":[{"border-r":q()}],"border-color-b":[{"border-b":q()}],"border-color-l":[{"border-l":q()}],"divide-color":[{divide:q()}],"outline-style":[{outline:[...oe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[dt,Le,ze]}],"outline-w":[{outline:["",dt,xc,Li]}],"outline-color":[{outline:q()}],shadow:[{shadow:["","none",x,Id,Ld]}],"shadow-color":[{shadow:q()}],"inset-shadow":[{"inset-shadow":["none",g,Id,Ld]}],"inset-shadow-color":[{"inset-shadow":q()}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:q()}],"ring-offset-w":[{"ring-offset":[dt,Li]}],"ring-offset-color":[{"ring-offset":q()}],"inset-ring-w":[{"inset-ring":se()}],"inset-ring-color":[{"inset-ring":q()}],"text-shadow":[{"text-shadow":["none",v,Id,Ld]}],"text-shadow-color":[{"text-shadow":q()}],opacity:[{opacity:[dt,Le,ze]}],"mix-blend":[{"mix-blend":[...ie(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ie()}],"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":[dt]}],"mask-image-linear-from-pos":[{"mask-linear-from":Z()}],"mask-image-linear-to-pos":[{"mask-linear-to":Z()}],"mask-image-linear-from-color":[{"mask-linear-from":q()}],"mask-image-linear-to-color":[{"mask-linear-to":q()}],"mask-image-t-from-pos":[{"mask-t-from":Z()}],"mask-image-t-to-pos":[{"mask-t-to":Z()}],"mask-image-t-from-color":[{"mask-t-from":q()}],"mask-image-t-to-color":[{"mask-t-to":q()}],"mask-image-r-from-pos":[{"mask-r-from":Z()}],"mask-image-r-to-pos":[{"mask-r-to":Z()}],"mask-image-r-from-color":[{"mask-r-from":q()}],"mask-image-r-to-color":[{"mask-r-to":q()}],"mask-image-b-from-pos":[{"mask-b-from":Z()}],"mask-image-b-to-pos":[{"mask-b-to":Z()}],"mask-image-b-from-color":[{"mask-b-from":q()}],"mask-image-b-to-color":[{"mask-b-to":q()}],"mask-image-l-from-pos":[{"mask-l-from":Z()}],"mask-image-l-to-pos":[{"mask-l-to":Z()}],"mask-image-l-from-color":[{"mask-l-from":q()}],"mask-image-l-to-color":[{"mask-l-to":q()}],"mask-image-x-from-pos":[{"mask-x-from":Z()}],"mask-image-x-to-pos":[{"mask-x-to":Z()}],"mask-image-x-from-color":[{"mask-x-from":q()}],"mask-image-x-to-color":[{"mask-x-to":q()}],"mask-image-y-from-pos":[{"mask-y-from":Z()}],"mask-image-y-to-pos":[{"mask-y-to":Z()}],"mask-image-y-from-color":[{"mask-y-from":q()}],"mask-image-y-to-color":[{"mask-y-to":q()}],"mask-image-radial":[{"mask-radial":[Le,ze]}],"mask-image-radial-from-pos":[{"mask-radial-from":Z()}],"mask-image-radial-to-pos":[{"mask-radial-to":Z()}],"mask-image-radial-from-color":[{"mask-radial-from":q()}],"mask-image-radial-to-color":[{"mask-radial-to":q()}],"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":R()}],"mask-image-conic-pos":[{"mask-conic":[dt]}],"mask-image-conic-from-pos":[{"mask-conic-from":Z()}],"mask-image-conic-to-pos":[{"mask-conic-to":Z()}],"mask-image-conic-from-color":[{"mask-conic-from":q()}],"mask-image-conic-to-color":[{"mask-conic-to":q()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:L()}],"mask-size":[{mask:G()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Le,ze]}],filter:[{filter:["","none",Le,ze]}],blur:[{blur:ve()}],brightness:[{brightness:[dt,Le,ze]}],contrast:[{contrast:[dt,Le,ze]}],"drop-shadow":[{"drop-shadow":["","none",S,Id,Ld]}],"drop-shadow-color":[{"drop-shadow":q()}],grayscale:[{grayscale:["",dt,Le,ze]}],"hue-rotate":[{"hue-rotate":[dt,Le,ze]}],invert:[{invert:["",dt,Le,ze]}],saturate:[{saturate:[dt,Le,ze]}],sepia:[{sepia:["",dt,Le,ze]}],"backdrop-filter":[{"backdrop-filter":["","none",Le,ze]}],"backdrop-blur":[{"backdrop-blur":ve()}],"backdrop-brightness":[{"backdrop-brightness":[dt,Le,ze]}],"backdrop-contrast":[{"backdrop-contrast":[dt,Le,ze]}],"backdrop-grayscale":[{"backdrop-grayscale":["",dt,Le,ze]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[dt,Le,ze]}],"backdrop-invert":[{"backdrop-invert":["",dt,Le,ze]}],"backdrop-opacity":[{"backdrop-opacity":[dt,Le,ze]}],"backdrop-saturate":[{"backdrop-saturate":[dt,Le,ze]}],"backdrop-sepia":[{"backdrop-sepia":["",dt,Le,ze]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Le,ze]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[dt,"initial",Le,ze]}],ease:[{ease:["linear","initial",k,Le,ze]}],delay:[{delay:[dt,Le,ze]}],animate:[{animate:["none",N,Le,ze]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,Le,ze]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:Ee()}],"rotate-x":[{"rotate-x":Ee()}],"rotate-y":[{"rotate-y":Ee()}],"rotate-z":[{"rotate-z":Ee()}],scale:[{scale:Te()}],"scale-x":[{"scale-x":Te()}],"scale-y":[{"scale-y":Te()}],"scale-z":[{"scale-z":Te()}],"scale-3d":["scale-3d"],skew:[{skew:Ie()}],"skew-x":[{"skew-x":Ie()}],"skew-y":[{"skew-y":Ie()}],transform:[{transform:[Le,ze,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Fe()}],"translate-x":[{"translate-x":Fe()}],"translate-y":[{"translate-y":Fe()}],"translate-z":[{"translate-z":Fe()}],"translate-none":["translate-none"],zoom:[{zoom:[ks,Le,ze]}],accent:[{accent:q()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:q()}],"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",Le,ze]}],"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":q()}],"scrollbar-track-color":[{"scrollbar-track":q()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mbs":[{"scroll-mbs":D()}],"scroll-mbe":[{"scroll-mbe":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pbs":[{"scroll-pbs":D()}],"scroll-pbe":[{"scroll-pbe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"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",Le,ze]}],fill:[{fill:["none",...q()]}],"stroke-w":[{stroke:[dt,xc,Li,d1]}],stroke:[{stroke:["none",...q()]}],"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":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["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-r","border-w-l"],"border-w-y":["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-r","border-color-l"],"border-color-y":["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-mr","scroll-ml"],"scroll-my":["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-pr","scroll-pl"],"scroll-py":["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 Y(...e){return X5(e1(e))}/**
|
|
59
|
+
* @license lucide-react v0.460.0 - ISC
|
|
60
|
+
*
|
|
61
|
+
* This source code is licensed under the ISC license.
|
|
62
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
63
|
+
*/const Q5=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),w1=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
64
|
+
* @license lucide-react v0.460.0 - ISC
|
|
65
|
+
*
|
|
66
|
+
* This source code is licensed under the ISC license.
|
|
67
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
68
|
+
*/var Z5={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
69
|
+
* @license lucide-react v0.460.0 - ISC
|
|
70
|
+
*
|
|
71
|
+
* This source code is licensed under the ISC license.
|
|
72
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
73
|
+
*/const J5=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:c,...d},h)=>p.createElement("svg",{ref:h,...Z5,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:w1("lucide",i),...d},[...c.map(([m,x])=>p.createElement(m,x)),...Array.isArray(o)?o:[o]]));/**
|
|
74
|
+
* @license lucide-react v0.460.0 - ISC
|
|
75
|
+
*
|
|
76
|
+
* This source code is licensed under the ISC license.
|
|
77
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
78
|
+
*/const We=(e,t)=>{const n=p.forwardRef(({className:r,...i},o)=>p.createElement(J5,{ref:o,iconNode:t,className:w1(`lucide-${Q5(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
|
|
79
|
+
* @license lucide-react v0.460.0 - ISC
|
|
80
|
+
*
|
|
81
|
+
* This source code is licensed under the ISC license.
|
|
82
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
83
|
+
*/const eL=We("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
84
|
+
* @license lucide-react v0.460.0 - ISC
|
|
85
|
+
*
|
|
86
|
+
* This source code is licensed under the ISC license.
|
|
87
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
88
|
+
*/const Rp=We("AtSign",[["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"}]]);/**
|
|
89
|
+
* @license lucide-react v0.460.0 - ISC
|
|
90
|
+
*
|
|
91
|
+
* This source code is licensed under the ISC license.
|
|
92
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
93
|
+
*/const tL=We("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
|
|
94
|
+
* @license lucide-react v0.460.0 - ISC
|
|
95
|
+
*
|
|
96
|
+
* This source code is licensed under the ISC license.
|
|
97
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
98
|
+
*/const nL=We("Bookmark",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]]);/**
|
|
99
|
+
* @license lucide-react v0.460.0 - ISC
|
|
100
|
+
*
|
|
101
|
+
* This source code is licensed under the ISC license.
|
|
102
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
103
|
+
*/const Ns=We("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
104
|
+
* @license lucide-react v0.460.0 - ISC
|
|
105
|
+
*
|
|
106
|
+
* This source code is licensed under the ISC license.
|
|
107
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
108
|
+
*/const zo=We("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
109
|
+
* @license lucide-react v0.460.0 - ISC
|
|
110
|
+
*
|
|
111
|
+
* This source code is licensed under the ISC license.
|
|
112
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
113
|
+
*/const S1=We("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
114
|
+
* @license lucide-react v0.460.0 - ISC
|
|
115
|
+
*
|
|
116
|
+
* This source code is licensed under the ISC license.
|
|
117
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
118
|
+
*/const Ts=We("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
119
|
+
* @license lucide-react v0.460.0 - ISC
|
|
120
|
+
*
|
|
121
|
+
* This source code is licensed under the ISC license.
|
|
122
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
123
|
+
*/const rL=We("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
124
|
+
* @license lucide-react v0.460.0 - ISC
|
|
125
|
+
*
|
|
126
|
+
* This source code is licensed under the ISC license.
|
|
127
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
128
|
+
*/const sL=We("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
|
|
129
|
+
* @license lucide-react v0.460.0 - ISC
|
|
130
|
+
*
|
|
131
|
+
* This source code is licensed under the ISC license.
|
|
132
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
+
*/const aL=We("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
134
|
+
* @license lucide-react v0.460.0 - ISC
|
|
135
|
+
*
|
|
136
|
+
* This source code is licensed under the ISC license.
|
|
137
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
138
|
+
*/const iL=We("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
139
|
+
* @license lucide-react v0.460.0 - ISC
|
|
140
|
+
*
|
|
141
|
+
* This source code is licensed under the ISC license.
|
|
142
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
143
|
+
*/const $d=We("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
144
|
+
* @license lucide-react v0.460.0 - ISC
|
|
145
|
+
*
|
|
146
|
+
* This source code is licensed under the ISC license.
|
|
147
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
148
|
+
*/const j1=We("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
149
|
+
* @license lucide-react v0.460.0 - ISC
|
|
150
|
+
*
|
|
151
|
+
* This source code is licensed under the ISC license.
|
|
152
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
153
|
+
*/const vc=We("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
154
|
+
* @license lucide-react v0.460.0 - ISC
|
|
155
|
+
*
|
|
156
|
+
* This source code is licensed under the ISC license.
|
|
157
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
158
|
+
*/const Ap=We("Ellipsis",[["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"}]]);/**
|
|
159
|
+
* @license lucide-react v0.460.0 - ISC
|
|
160
|
+
*
|
|
161
|
+
* This source code is licensed under the ISC license.
|
|
162
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
163
|
+
*/const Mp=We("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
164
|
+
* @license lucide-react v0.460.0 - ISC
|
|
165
|
+
*
|
|
166
|
+
* This source code is licensed under the ISC license.
|
|
167
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
168
|
+
*/const oL=We("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
169
|
+
* @license lucide-react v0.460.0 - ISC
|
|
170
|
+
*
|
|
171
|
+
* This source code is licensed under the ISC license.
|
|
172
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
173
|
+
*/const lL=We("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
174
|
+
* @license lucide-react v0.460.0 - ISC
|
|
175
|
+
*
|
|
176
|
+
* This source code is licensed under the ISC license.
|
|
177
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
178
|
+
*/const cL=We("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/**
|
|
179
|
+
* @license lucide-react v0.460.0 - ISC
|
|
180
|
+
*
|
|
181
|
+
* This source code is licensed under the ISC license.
|
|
182
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
183
|
+
*/const $i=We("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
|
|
184
|
+
* @license lucide-react v0.460.0 - ISC
|
|
185
|
+
*
|
|
186
|
+
* This source code is licensed under the ISC license.
|
|
187
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
188
|
+
*/const uL=We("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
189
|
+
* @license lucide-react v0.460.0 - ISC
|
|
190
|
+
*
|
|
191
|
+
* This source code is licensed under the ISC license.
|
|
192
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
193
|
+
*/const dL=We("FolderSync",[["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v.5",key:"1dkoa9"}],["path",{d:"M12 10v4h4",key:"1czhmt"}],["path",{d:"m12 14 1.535-1.605a5 5 0 0 1 8 1.5",key:"lvuxfi"}],["path",{d:"M22 22v-4h-4",key:"1ewp4q"}],["path",{d:"m22 18-1.535 1.605a5 5 0 0 1-8-1.5",key:"14ync0"}]]);/**
|
|
194
|
+
* @license lucide-react v0.460.0 - ISC
|
|
195
|
+
*
|
|
196
|
+
* This source code is licensed under the ISC license.
|
|
197
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
198
|
+
*/const C1=We("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
199
|
+
* @license lucide-react v0.460.0 - ISC
|
|
200
|
+
*
|
|
201
|
+
* This source code is licensed under the ISC license.
|
|
202
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
203
|
+
*/const fL=We("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["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"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
|
|
204
|
+
* @license lucide-react v0.460.0 - ISC
|
|
205
|
+
*
|
|
206
|
+
* This source code is licensed under the ISC license.
|
|
207
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
208
|
+
*/const Bd=We("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/**
|
|
209
|
+
* @license lucide-react v0.460.0 - ISC
|
|
210
|
+
*
|
|
211
|
+
* This source code is licensed under the ISC license.
|
|
212
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
213
|
+
*/const hL=We("ImageOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]]);/**
|
|
214
|
+
* @license lucide-react v0.460.0 - ISC
|
|
215
|
+
*
|
|
216
|
+
* This source code is licensed under the ISC license.
|
|
217
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
218
|
+
*/const Dp=We("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
219
|
+
* @license lucide-react v0.460.0 - ISC
|
|
220
|
+
*
|
|
221
|
+
* This source code is licensed under the ISC license.
|
|
222
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
223
|
+
*/const k1=We("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
|
|
224
|
+
* @license lucide-react v0.460.0 - ISC
|
|
225
|
+
*
|
|
226
|
+
* This source code is licensed under the ISC license.
|
|
227
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
228
|
+
*/const mL=We("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
|
|
229
|
+
* @license lucide-react v0.460.0 - ISC
|
|
230
|
+
*
|
|
231
|
+
* This source code is licensed under the ISC license.
|
|
232
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
233
|
+
*/const Xs=We("ListMusic",[["path",{d:"M21 15V6",key:"h1cx4g"}],["path",{d:"M18.5 18a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z",key:"8saifv"}],["path",{d:"M12 12H3",key:"18klou"}],["path",{d:"M16 6H3",key:"1wxfjs"}],["path",{d:"M12 18H3",key:"11ftsu"}]]);/**
|
|
234
|
+
* @license lucide-react v0.460.0 - ISC
|
|
235
|
+
*
|
|
236
|
+
* This source code is licensed under the ISC license.
|
|
237
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
238
|
+
*/const _p=We("ListPlus",[["path",{d:"M11 12H3",key:"51ecnj"}],["path",{d:"M16 6H3",key:"1wxfjs"}],["path",{d:"M16 18H3",key:"12xzn7"}],["path",{d:"M18 9v6",key:"1twb98"}],["path",{d:"M21 12h-6",key:"bt1uis"}]]);/**
|
|
239
|
+
* @license lucide-react v0.460.0 - ISC
|
|
240
|
+
*
|
|
241
|
+
* This source code is licensed under the ISC license.
|
|
242
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
243
|
+
*/const Sr=We("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
244
|
+
* @license lucide-react v0.460.0 - ISC
|
|
245
|
+
*
|
|
246
|
+
* This source code is licensed under the ISC license.
|
|
247
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
248
|
+
*/const Op=We("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
249
|
+
* @license lucide-react v0.460.0 - ISC
|
|
250
|
+
*
|
|
251
|
+
* This source code is licensed under the ISC license.
|
|
252
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
253
|
+
*/const pL=We("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
254
|
+
* @license lucide-react v0.460.0 - ISC
|
|
255
|
+
*
|
|
256
|
+
* This source code is licensed under the ISC license.
|
|
257
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
258
|
+
*/const N1=We("Music2",[["circle",{cx:"8",cy:"18",r:"4",key:"1fc0mg"}],["path",{d:"M12 18V2l7 4",key:"g04rme"}]]);/**
|
|
259
|
+
* @license lucide-react v0.460.0 - ISC
|
|
260
|
+
*
|
|
261
|
+
* This source code is licensed under the ISC license.
|
|
262
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
263
|
+
*/const T1=We("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 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.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]);/**
|
|
264
|
+
* @license lucide-react v0.460.0 - ISC
|
|
265
|
+
*
|
|
266
|
+
* This source code is licensed under the ISC license.
|
|
267
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
268
|
+
*/const Bi=We("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
|
|
269
|
+
* @license lucide-react v0.460.0 - ISC
|
|
270
|
+
*
|
|
271
|
+
* This source code is licensed under the ISC license.
|
|
272
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
273
|
+
*/const gL=We("PencilLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}],["path",{d:"m15 5 3 3",key:"1w25hb"}]]);/**
|
|
274
|
+
* @license lucide-react v0.460.0 - ISC
|
|
275
|
+
*
|
|
276
|
+
* This source code is licensed under the ISC license.
|
|
277
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
278
|
+
*/const yc=We("Pencil",[["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"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
279
|
+
* @license lucide-react v0.460.0 - ISC
|
|
280
|
+
*
|
|
281
|
+
* This source code is licensed under the ISC license.
|
|
282
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
283
|
+
*/const qn=We("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
284
|
+
* @license lucide-react v0.460.0 - ISC
|
|
285
|
+
*
|
|
286
|
+
* This source code is licensed under the ISC license.
|
|
287
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
288
|
+
*/const bc=We("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
289
|
+
* @license lucide-react v0.460.0 - ISC
|
|
290
|
+
*
|
|
291
|
+
* This source code is licensed under the ISC license.
|
|
292
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
293
|
+
*/const xL=We("Podcast",[["path",{d:"M16.85 18.58a9 9 0 1 0-9.7 0",key:"d71mpg"}],["path",{d:"M8 14a5 5 0 1 1 8 0",key:"fc81rn"}],["circle",{cx:"12",cy:"11",r:"1",key:"1gvufo"}],["path",{d:"M13 17a1 1 0 1 0-2 0l.5 4.5a.5.5 0 1 0 1 0Z",key:"za5kbj"}]]);/**
|
|
294
|
+
* @license lucide-react v0.460.0 - ISC
|
|
295
|
+
*
|
|
296
|
+
* This source code is licensed under the ISC license.
|
|
297
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
298
|
+
*/const Ud=We("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
299
|
+
* @license lucide-react v0.460.0 - ISC
|
|
300
|
+
*
|
|
301
|
+
* This source code is licensed under the ISC license.
|
|
302
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
303
|
+
*/const zp=We("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
304
|
+
* @license lucide-react v0.460.0 - ISC
|
|
305
|
+
*
|
|
306
|
+
* This source code is licensed under the ISC license.
|
|
307
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
308
|
+
*/const vL=We("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
|
|
309
|
+
* @license lucide-react v0.460.0 - ISC
|
|
310
|
+
*
|
|
311
|
+
* This source code is licensed under the ISC license.
|
|
312
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
313
|
+
*/const yL=We("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
314
|
+
* @license lucide-react v0.460.0 - ISC
|
|
315
|
+
*
|
|
316
|
+
* This source code is licensed under the ISC license.
|
|
317
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
318
|
+
*/const E1=We("SkipBack",[["polygon",{points:"19 20 9 12 19 4 19 20",key:"o2sva"}],["line",{x1:"5",x2:"5",y1:"19",y2:"5",key:"1ocqjk"}]]);/**
|
|
319
|
+
* @license lucide-react v0.460.0 - ISC
|
|
320
|
+
*
|
|
321
|
+
* This source code is licensed under the ISC license.
|
|
322
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
323
|
+
*/const R1=We("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/**
|
|
324
|
+
* @license lucide-react v0.460.0 - ISC
|
|
325
|
+
*
|
|
326
|
+
* This source code is licensed under the ISC license.
|
|
327
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
328
|
+
*/const A1=We("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
|
|
329
|
+
* @license lucide-react v0.460.0 - ISC
|
|
330
|
+
*
|
|
331
|
+
* This source code is licensed under the ISC license.
|
|
332
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
333
|
+
*/const Po=We("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
334
|
+
* @license lucide-react v0.460.0 - ISC
|
|
335
|
+
*
|
|
336
|
+
* This source code is licensed under the ISC license.
|
|
337
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
338
|
+
*/const bL=We("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
339
|
+
* @license lucide-react v0.460.0 - ISC
|
|
340
|
+
*
|
|
341
|
+
* This source code is licensed under the ISC license.
|
|
342
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
343
|
+
*/const wL=We("Volume1",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}]]);/**
|
|
344
|
+
* @license lucide-react v0.460.0 - ISC
|
|
345
|
+
*
|
|
346
|
+
* This source code is licensed under the ISC license.
|
|
347
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
348
|
+
*/const M1=We("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
|
|
349
|
+
* @license lucide-react v0.460.0 - ISC
|
|
350
|
+
*
|
|
351
|
+
* This source code is licensed under the ISC license.
|
|
352
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
353
|
+
*/const SL=We("VolumeX",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/**
|
|
354
|
+
* @license lucide-react v0.460.0 - ISC
|
|
355
|
+
*
|
|
356
|
+
* This source code is licensed under the ISC license.
|
|
357
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
358
|
+
*/const Ui=We("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function jL({className:e,size:t=16,...n}){return l.jsx(Sr,{"data-slot":"spinner",role:"status","aria-label":"Loading",width:t,height:t,className:Y("animate-spin",e),...n})}function wc(e,t){const n=e==="icon",r=n?"group/toast-icon !pl-4 !gap-2.5":"group/toast-img !pl-[10px] !gap-1.5";if(!t)return{className:r,classNames:{icon:n?"!size-5 [&_svg]:!size-5":"!size-8"},style:{"--loader-size":n?"20px":"32px"}};const{className:i,classNames:o={},style:c,...d}=t;return{...d,className:Y(r,i),classNames:{...o,icon:Y(n?"!size-5 [&_svg]:!size-5":"!size-8",o.icon)},style:{"--loader-size":n?"20px":"32px",...c}}}const CL=(e,t)=>{const n=(t==null?void 0:t.variant)||(t!=null&&t.icon?"img":void 0),r=n?wc(n,t):t;return os(e,r)},Lo=(e,t)=>(n,r)=>{const i=(r==null?void 0:r.variant)||t,o=wc(i,r);return e(n,o)},Ge=Object.assign(CL,{success:Lo(os.success,"icon"),error:Lo(os.error,"icon"),warning:Lo(os.warning,"icon"),info:Lo(os.info,"icon"),loading:Lo(os.loading,"icon"),custom:os.custom,dismiss:os.dismiss,message:Lo(os.message,"img"),promise:(e,t)=>{if(!t)return os.promise(e,t);const{loading:n,success:r,error:i,...o}=t,c=o.variant||"icon",d=wc(c,o),h=(m,x)=>{if(typeof m=="string"||p.isValidElement(m))return m;if(m&&typeof m=="object"){const g=m.variant||x;return wc(g,m)}return typeof m=="function"?g=>{const v=m(g);if(typeof v=="string"||p.isValidElement(v))return v;if(v&&typeof v=="object"){const S=v.variant||x;return wc(S,v)}return v}:m};return os.promise(e,{loading:h(n,"icon"),success:h(r,"icon"),error:h(i,"icon"),...d})}});function kL(){const e=p.useCallback(()=>typeof document<"u"&&document.documentElement.classList.contains("dark")?"dark":"light",[]),[t,n]=p.useState(e);return p.useEffect(()=>{n(e());const r=new MutationObserver(()=>n(e()));return r.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>r.disconnect()},[e]),t}function NL({className:e,toastOptions:t,...n}){const r=kL();return l.jsx(i5,{theme:r,position:"top-center",offset:56,className:Y("toaster group",e),icons:{loading:l.jsx(jL,{})},style:{fontFamily:"inherit","--normal-bg":"var(--acr-toast)","--normal-text":"var(--foreground)","--normal-border":"transparent","--border-radius":"16px","--width":"344px","--toast-icon-margin-start":"0px","--toast-icon-margin-end":"0px","--toast-svg-margin-start":"0px","--toast-svg-margin-end":"0px"},toastOptions:{...t,classNames:{toast:Y("group/toast items-center text-foreground !py-3 !pr-[14px] !shadow-[0_8px_30px_rgba(0,0,0,0.22)] backdrop-blur-2xl backdrop-saturate-150","group-[&:not(.group/toast-icon):not(.group/toast-img)]/toast:!pl-[10px] group-[&:not(.group/toast-icon):not(.group/toast-img)]/toast:!gap-1.5","[&:not(:has([data-icon]))]:!pl-4"),icon:Y("shrink-0 flex items-center justify-center","group-[&:not(.group/toast-icon):not(.group/toast-img)]/toast:!size-8"),content:"gap-0",title:"text-[13px] !font-bold leading-tight",description:"text-[13px] leading-snug !text-muted-foreground",actionButton:"self-center !h-5 !gap-1 !rounded-[5px] !bg-primary !px-[10px] !text-[11px] !font-medium !text-primary-foreground !shadow-sm hover:!brightness-110 [&_svg]:!size-3",cancelButton:"self-center !h-5 !gap-1 !rounded-[5px] !bg-[var(--acr-chip)] !px-[10px] !text-[11px] !font-medium !text-foreground hover:!bg-[var(--acr-chip-hover)] [&_svg]:!size-3",closeButton:"border-[var(--acr-border-soft)] bg-[var(--acr-chip)] text-foreground hover:bg-[var(--acr-chip-hover)]",...t==null?void 0:t.classNames}},...n})}function TL(e){return`请对「${e.title}」(item:${e.id}) 调用 extract 转成文字(音视频走转写、图片/PDF 走 OCR),取到后简述要点。`}let Io;function D1(e){Io=e}function EL(){return Io}const RL="stream-ask";async function Pp(e,t,n){return AL(e,{kind:"send",text:t},n)}async function _1(e,t){if(Io===void 0){Ge.error(`${t}要在对话工作台里进行`,{description:"当前这一页没有对话输入框——从侧栏底部把工作台打开。"});return}try{await Io(e)}catch(n){Ge.error(`${t}没能进输入框`,{description:n instanceof Error?n.message:String(n)})}}async function AL(e,t,n){const r=t.text;if(Io!==void 0){try{await Io(t)}catch(o){Ge.error(`${n}没能进对话`,{description:o instanceof Error?o.message:String(o)})}return}const i=window.open("","_blank");try{const o=await be.dsh.status(e);if(!o.running||o.url===void 0){i==null||i.close(),Ge.error("对话工作台没在跑",{description:`${n}要在对话里进行——先从侧栏底部把工作台打开。`});return}const c=`${o.url.replace(/\/+$/,"")}/?${RL}=${encodeURIComponent(r)}`;i===null?window.open(c,"_blank"):i.location.href=c}catch(o){i==null||i.close(),Ge.error("打不开对话工作台",{description:o instanceof Error?o.message:String(o)})}}async function ML(e,t){return Pp(e,TL(t),"转成文字")}function DL(e,t){return[`请整理「${t}」:先用 reconcile_status 查它的状态(show: ${e}),`,"按各工具描述里的裁决规则处理待决项(reconcile_decide),拿不准的把证据摆给我选,","然后 reconcile_execute 执行搬运,最后汇报结果。"].join("")}async function _L(e,t,n){return Pp(e,DL(t,n),"让 AI 整理")}function OL(e,t){return[`我要整理「${t}」(stream:${e})。`,"先问我要整理哪个网盘目录(可以用 netdisk_browse 帮我找,别自己猜),","确认后用 reconcile_open 把它接起来,然后按 reconcile_status → reconcile_decide → reconcile_execute 走完,最后汇报结果。"].join("")}async function zL(e,t,n){return Pp(e,OL(t,n),"让 AI 整理")}function PL(e,t){return`「${t}」(stream:${e})`}async function LL(e,t){return _1({kind:"compose",text:PL(e,t)},"引用订阅")}async function O1(e){return _1({kind:"ref-item",id:e.id,label:e.title},"引用内容")}var IL=Object.defineProperty,Lp=(e,t)=>IL(e,"name",{value:t,configurable:!0});function Ip(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Lp(Ip,"setRef");function Vi(...e){return t=>{let n=!1;const r=e.map(i=>{const o=Ip(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():Ip(e[i],null)}}}}Lp(Vi,"composeRefs");function Je(...e){return p.useCallback(Vi(...e),e)}Lp(Je,"useComposedRefs");var $L=Object.defineProperty,ls=(e,t)=>$L(e,"name",{value:t,configurable:!0});function cs(e){const t=p.forwardRef((n,r)=>{let{children:i,...o}=n,c=null,d=!1;const h=[];$p(i)&&typeof Vd=="function"&&(i=Vd(i._payload)),p.Children.forEach(i,v=>{var S;if($1(v)){d=!0;const b=v;let j="child"in b.props?b.props.child:b.props.children;$p(j)&&typeof Vd=="function"&&(j=Vd(j._payload)),c=BL(b,j),h.push((S=c==null?void 0:c.props)==null?void 0:S.children)}else h.push(v)}),c?c=p.cloneElement(c,void 0,h):!d&&p.Children.count(i)===1&&p.isValidElement(i)&&(c=i);const m=c?I1(c):void 0,x=Je(r,m);if(!c){if(i||i===0)throw new Error(d?FL(e):VL(e));return i}const g=L1(o,c.props??{});return c.type!==p.Fragment&&(g.ref=r?x:m),p.cloneElement(c,g)});return t.displayName=`${e}.Slot`,t}ls(cs,"createSlot");var Fi=cs("Slot"),z1=Symbol.for("radix.slottable");function P1(e){const t=ls(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=z1,t}ls(P1,"createSlottable");var BL=ls((e,t)=>{if("child"in e.props){const n=e.props.child;return p.isValidElement(n)?p.cloneElement(n,void 0,e.props.children(n.props.children)):null}return p.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function L1(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...d)=>{const h=o(...d);return i(...d),h}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}ls(L1,"mergeProps");function I1(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}ls(I1,"getElementRef");function $1(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===z1}ls($1,"isSlottable");var UL=Symbol.for("react.lazy");function $p(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===UL&&"_payload"in e&&B1(e._payload)}ls($p,"isLazyComponent");function B1(e){return typeof e=="object"&&e!==null&&"then"in e}ls(B1,"isPromiseLike");var VL=ls(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),FL=ls(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Vd=Mo[" use ".trim().toString()],HL=Object.defineProperty,qL=(e,t)=>HL(e,"name",{value:t,configurable:!0}),KL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],qe=KL.reduce((e,t)=>{const n=cs(`Primitive.${t}`),r=p.forwardRef((i,o)=>{const{asChild:c,...d}=i,h=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(h,{...d,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Bp(e,t){e&&Ba.flushSync(()=>e.dispatchEvent(t))}qL(Bp,"dispatchDiscreteCustomEvent");var GL=Object.defineProperty,YL=(e,t)=>GL(e,"name",{value:t,configurable:!0}),U1=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"}),WL=p.forwardRef(YL(function(t,n){return l.jsx(qe.span,{...t,ref:n,style:{...U1,...t.style}})},"VisuallyHidden")),XL=WL,QL=Object.defineProperty,$r=(e,t)=>QL(e,"name",{value:t,configurable:!0});function ZL(e,t){const n=p.createContext(t);n.displayName=e+"Context";const r=$r(o=>{const{children:c,...d}=o,h=p.useMemo(()=>d,Object.values(d));return l.jsx(n.Provider,{value:h,children:c})},"Provider");r.displayName=e+"Provider";function i(o,c={}){const{optional:d=!1}=c,h=p.useContext(n);if(h)return h;if(t!==void 0)return t;if(!d)throw new Error(`\`${o}\` must be used within \`${e}\``)}return $r(i,"useContext"),[r,i]}$r(ZL,"createContext");function bn(e,t=[]){let n=[];function r(o,c){const d=p.createContext(c);d.displayName=o+"Context";const h=n.length;n=[...n,c];const m=$r(g=>{var k;const{scope:v,children:S,...b}=g,j=((k=v==null?void 0:v[e])==null?void 0:k[h])||d,C=p.useMemo(()=>b,Object.values(b));return l.jsx(j.Provider,{value:C,children:S})},"Provider");m.displayName=o+"Provider";function x(g,v,S={}){var k;const{optional:b=!1}=S,j=((k=v==null?void 0:v[e])==null?void 0:k[h])||d,C=p.useContext(j);if(C)return C;if(c!==void 0)return c;if(!b)throw new Error(`\`${g}\` must be used within \`${o}\``)}return $r(x,"useContext"),[m,x]}$r(r,"createContext");const i=$r(()=>{const o=n.map(c=>p.createContext(c));return $r(function(d){const h=(d==null?void 0:d[e])||o;return p.useMemo(()=>({[`__scope${e}`]:{...d,[e]:h}}),[d,h])},"useScope")},"createScope");return i.scopeName=e,[r,V1(i,...t)]}$r(bn,"createContextScope");function V1(...e){const t=e[0];if(e.length===1)return t;const n=$r(()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return $r(function(o){const c=r.reduce((d,{useScope:h,scopeName:m})=>{const g=h(o)[`__scope${m}`];return{...d,...g}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}$r(V1,"composeContextScopes");var JL=Object.defineProperty,Tn=(e,t)=>JL(e,"name",{value:t,configurable:!0});function Sc(e){const t=e+"CollectionProvider",[n,r]=bn(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=Tn(j=>{const{scope:C,children:k}=j,N=p.useRef(null),E=p.useRef(new Map).current;return l.jsx(i,{scope:C,itemMap:E,collectionRef:N,children:k})},"CollectionProvider");c.displayName=t;const d=e+"CollectionSlot",h=cs(d),m=p.forwardRef((j,C)=>{const{scope:k,children:N}=j,E=o(d,k),R=Je(C,E.collectionRef);return l.jsx(h,{ref:R,children:N})});m.displayName=d;const x=e+"CollectionItemSlot",g="data-radix-collection-item",v=cs(x),S=p.forwardRef((j,C)=>{const{scope:k,children:N,...E}=j,R=p.useRef(null),A=Je(C,R),_=o(x,k);return p.useEffect(()=>(_.itemMap.set(R,{ref:R,...E}),()=>void _.itemMap.delete(R))),l.jsx(v,{[g]:"",ref:A,children:N})});S.displayName=x;function b(j){const C=o(e+"CollectionConsumer",j);return p.useCallback(()=>{const N=C.collectionRef.current;if(!N)return[];const E=Array.from(N.querySelectorAll(`[${g}]`));return Array.from(C.itemMap.values()).sort((_,z)=>E.indexOf(_.ref.current)-E.indexOf(z.ref.current))},[C.collectionRef,C.itemMap])}return Tn(b,"useCollection"),[{Provider:c,Slot:m,ItemSlot:S},b,r]}Tn(Sc,"createCollection");var F1=new WeakMap,Up=(Rr=class extends Map{constructor(n){super(n);pz(this,fn);uw(this,fn,[...super.keys()]),F1.set(this,!0)}set(n,r){return F1.get(this)&&(this.has(n)?Fn(this,fn)[Fn(this,fn).indexOf(n)]=n:Fn(this,fn).push(n)),super.set(n,r),this}insert(n,r,i){const o=this.has(r),c=Fn(this,fn).length,d=Vp(n);let h=d>=0?d:c+d;const m=h<0||h>=c?-1:h;if(m===this.size||o&&m===this.size-1||m===-1)return this.set(r,i),this;const x=this.size+(o?0:1);d<0&&h++;const g=[...Fn(this,fn)];let v,S=!1;for(let b=h;b<x;b++)if(h===b){let j=g[b];g[b]===r&&(j=g[b+1]),o&&this.delete(r),v=this.get(j),this.set(r,i)}else{!S&&g[b-1]===r&&(S=!0);const j=g[S?b:b-1],C=v;v=this.get(j),this.delete(j),this.set(j,C)}return this}with(n,r,i){const o=new Rr(this);return o.insert(n,r,i),o}before(n){const r=Fn(this,fn).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,i){const o=Fn(this,fn).indexOf(n);return o===-1?this:this.insert(o,r,i)}after(n){let r=Fn(this,fn).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,i){const o=Fn(this,fn).indexOf(n);return o===-1?this:this.insert(o+1,r,i)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return uw(this,fn,[]),super.clear()}delete(n){const r=super.delete(n);return r&&Fn(this,fn).splice(Fn(this,fn).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=Fd(Fn(this,fn),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=Fd(Fn(this,fn),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return Fn(this,fn).indexOf(n)}keyAt(n){return Fd(Fn(this,fn),n)}from(n,r){const i=this.indexOf(n);if(i===-1)return;let o=i+r;return o<0&&(o=0),o>=this.size&&(o=this.size-1),this.at(o)}keyFrom(n,r){const i=this.indexOf(n);if(i===-1)return;let o=i+r;return o<0&&(o=0),o>=this.size&&(o=this.size-1),this.keyAt(o)}find(n,r){let i=0;for(const o of this){if(Reflect.apply(n,r,[o,i,this]))return o;i++}}findIndex(n,r){let i=0;for(const o of this){if(Reflect.apply(n,r,[o,i,this]))return i;i++}return-1}filter(n,r){const i=[];let o=0;for(const c of this)Reflect.apply(n,r,[c,o,this])&&i.push(c),o++;return new Rr(i)}map(n,r){const i=[];let o=0;for(const c of this)i.push([c[0],Reflect.apply(n,r,[c,o,this])]),o++;return new Rr(i)}reduce(...n){const[r,i]=n;let o=0,c=i??this.at(0);for(const d of this)o===0&&n.length===1?c=d:c=Reflect.apply(r,this,[c,d,o,this]),o++;return c}reduceRight(...n){const[r,i]=n;let o=i??this.at(-1);for(let c=this.size-1;c>=0;c--){const d=this.at(c);c===this.size-1&&n.length===1?o=d:o=Reflect.apply(r,this,[o,d,c,this])}return o}toSorted(n){const r=[...this.entries()].sort(n);return new Rr(r)}toReversed(){const n=new Rr;for(let r=this.size-1;r>=0;r--){const i=this.keyAt(r),o=this.get(i);n.set(i,o)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new Rr(r)}slice(n,r){const i=new Rr;let o=this.size-1;if(n===void 0)return i;n<0&&(n=n+this.size),r!==void 0&&r>0&&(o=r-1);for(let c=n;c<=o;c++){const d=this.keyAt(c),h=this.get(d);i.set(d,h)}return i}every(n,r){let i=0;for(const o of this){if(!Reflect.apply(n,r,[o,i,this]))return!1;i++}return!0}some(n,r){let i=0;for(const o of this){if(Reflect.apply(n,r,[o,i,this]))return!0;i++}return!1}},fn=new WeakMap,Tn(Rr,"OrderedDict"),Rr);function Fd(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=H1(e,t);return n===-1?void 0:e[n]}Tn(Fd,"at");function H1(e,t){const n=e.length,r=Vp(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Tn(H1,"toSafeIndex");function Vp(e){return e!==e||e===0?0:Math.trunc(e)}Tn(Vp,"toSafeInteger");function eI(e){const t=e+"CollectionProvider",[n,r]=bn(t),[i,o]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Up,setItemMap:Tn(()=>{},"setItemMap")}),c=Tn(({state:E,...R})=>E?l.jsx(h,{...R,state:E}):l.jsx(d,{...R}),"CollectionProvider");c.displayName=t;const d=Tn(E=>{const R=C();return l.jsx(h,{...E,state:R})},"CollectionInit");d.displayName=t+"Init";const h=Tn(E=>{const{scope:R,children:A,state:_}=E,z=p.useRef(null),[D,V]=p.useState(null),I=Je(z,V),[Q,B]=_;return p.useEffect(()=>{if(!D)return;const H=G1(()=>{});return H.observe(D,{childList:!0,subtree:!0}),()=>{H.disconnect()}},[D]),l.jsx(i,{scope:R,itemMap:Q,setItemMap:B,collectionRef:I,collectionRefObject:z,collectionElement:D,children:A})},"CollectionProviderImpl");h.displayName=t+"Impl";const m=e+"CollectionSlot",x=cs(m),g=p.forwardRef((E,R)=>{const{scope:A,children:_}=E,z=o(m,A),D=Je(R,z.collectionRef);return l.jsx(x,{ref:D,children:_})});g.displayName=m;const v=e+"CollectionItemSlot",S="data-radix-collection-item",b=cs(v),j=p.forwardRef((E,R)=>{const{scope:A,children:_,...z}=E,D=p.useRef(null),[V,I]=p.useState(null),Q=Je(R,D,I),B=o(v,A),{setItemMap:H}=B,ee=p.useRef(z);q1(ee.current,z)||(ee.current=z);const W=ee.current;return p.useEffect(()=>{const M=W;return H(U=>V?U.has(V)?U.set(V,{...M,element:V}).toSorted(Fp):(U.set(V,{...M,element:V}),U.toSorted(Fp)):U),()=>{H(U=>!V||!U.has(V)?U:(U.delete(V),new Up(U)))}},[V,W,H]),l.jsx(b,{[S]:"",ref:Q,children:_})});j.displayName=v;function C(){return p.useState(new Up)}Tn(C,"useInitCollection");function k(E){const{itemMap:R}=o(e+"CollectionConsumer",E);return R}return Tn(k,"useCollection"),[{Provider:c,Slot:g,ItemSlot:j},{createCollectionScope:r,useCollection:k,useInitCollection:C}]}Tn(eI,"createCollection");function q1(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n)if(!Object.prototype.hasOwnProperty.call(t,i)||e[i]!==t[i])return!1;return!0}Tn(q1,"shallowEqual");function K1(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Tn(K1,"isElementPreceding");function Fp(e,t){return!e[1].element||!t[1].element?0:K1(e[1].element,t[1].element)?-1:1}Tn(Fp,"sortByDocumentPosition");function G1(e){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){e();return}})}Tn(G1,"getChildListObserver");var tI=Object.defineProperty,$o=(e,t)=>tI(e,"name",{value:t,configurable:!0}),Y1=!!(typeof window<"u"&&window.document&&window.document.createElement);function Ce(e,t,{checkForDefaultPrevented:n=!0}={}){return $o(function(i){if(e==null||e(i),n===!1||!i||!i.defaultPrevented)return t==null?void 0:t(i)},"handleEvent")}$o(Ce,"composeEventHandlers");function nI(e){var t;if(!Y1)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}$o(nI,"getOwnerWindow");function Hp(e){if(!Y1)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}$o(Hp,"getOwnerDocument");function W1(e,t=!1){const{activeElement:n}=Hp(e);if(!(n!=null&&n.nodeName))return null;if(X1(n)&&n.contentDocument)return W1(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const i=Hp(n).getElementById(r);if(i)return i}}return n}$o(W1,"getActiveElement");function X1(e){return e.tagName==="IFRAME"}$o(X1,"isFrame");var Vt=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},rI=Object.defineProperty,sI=(e,t)=>rI(e,"name",{value:t,configurable:!0}),Q1=Mo[" useEffectEvent ".trim().toString()],Z1=Mo[" useInsertionEffect ".trim().toString()];function J1(e){if(typeof Q1=="function")return Q1(e);const t=p.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Z1=="function"?Z1(()=>{t.current=e}):Vt(()=>{t.current=e}),p.useMemo(()=>((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)}),[])}sI(J1,"useEffectEvent");var aI=Object.defineProperty,jc=(e,t)=>aI(e,"name",{value:t,configurable:!0}),iI=Mo[" useInsertionEffect ".trim().toString()]||Vt;function Kn({prop:e,defaultProp:t,onChange:n=jc(()=>{},"onChange"),caller:r}){const[i,o,c]=eS({defaultProp:t,onChange:n}),d=e!==void 0,h=d?e:i,m=p.useCallback(x=>{var g;if(d){const v=tS(x)?x(e):x;v!==e&&((g=c.current)==null||g.call(c,v))}else o(x)},[d,e,o,c]);return[h,m]}jc(Kn,"useControllableState");function eS({defaultProp:e,onChange:t}){const[n,r]=p.useState(e),i=p.useRef(n),o=p.useRef(t);return iI(()=>{o.current=t},[t]),p.useEffect(()=>{var c;i.current!==n&&((c=o.current)==null||c.call(o,n),i.current=n)},[n,i]),[n,r,o]}jc(eS,"useUncontrolledState");function tS(e){return typeof e=="function"}jc(tS,"isFunction");var nS=Symbol("RADIX:SYNC_STATE");function oI(e,t,n,r){const{prop:i,defaultProp:o,onChange:c,caller:d}=t,h=i!==void 0,m=J1(c),x=[{...n,state:o}];r&&x.push(r);const[g,v]=p.useReducer((C,k)=>{if(k.type===nS)return{...C,state:k.state};const N=e(C,k);return h&&!Object.is(N.state,C.state)&&m(N.state),N},...x),S=g.state,b=p.useRef(S);p.useEffect(()=>{b.current!==S&&(b.current=S,h||m(S))},[S,b,h]);const j=p.useMemo(()=>i!==void 0?{...g,state:i}:g,[g,i]);return p.useEffect(()=>{h&&!Object.is(i,g.state)&&v({type:nS,state:i})},[i,g.state,h]),[j,v]}jc(oI,"useControllableStateReducer");var lI=Object.defineProperty,Qs=(e,t)=>lI(e,"name",{value:t,configurable:!0});function rS(e,t){return p.useReducer((n,r)=>t[n][r]??n,e)}Qs(rS,"useStateMachine");var wn=Qs(e=>{const{present:t,children:n}=e,r=sS(t),i=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),o=aS(r.ref,iS(i));return typeof n=="function"||r.isPresent?p.cloneElement(i,{ref:o}):null},"Presence");function sS(e){const[t,n]=p.useState(),r=p.useRef(null),i=p.useRef(e),o=p.useRef("none"),c=p.useRef(void 0),d=e?"mounted":"unmounted",[h,m]=rS(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{h==="mounted"?(o.current=c.current??Bo(r.current),c.current=void 0):o.current="none"},[h]),Vt(()=>{const x=r.current,g=i.current;if(g!==e){const S=o.current,b=Bo(x);e?(c.current=b,m("MOUNT")):b==="none"||(x==null?void 0:x.display)==="none"?m("UNMOUNT"):m(g&&S!==b?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,m]),Vt(()=>{if(t){let x;const g=t.ownerDocument.defaultView??window,v=Qs(b=>{const C=Bo(r.current).includes(CSS.escape(b.animationName));if(b.target===t&&C&&(m("ANIMATION_END"),!i.current)){const k=t.style.animationFillMode;t.style.animationFillMode="forwards",x=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=k)})}},"handleAnimationEnd"),S=Qs(b=>{b.target===t&&(o.current=Bo(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",S),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{g.clearTimeout(x),t.removeEventListener("animationstart",S),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:p.useCallback(x=>{if(x){const g=getComputedStyle(x);r.current=g,c.current=Bo(g)}else r.current=null;n(x)},[])}}Qs(sS,"usePresence");function qp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Qs(qp,"setRef");function aS(...e){const t=p.useRef(e);return t.current=e,p.useCallback(n=>{const r=t.current;let i=!1;const o=r.map(c=>{const d=qp(c,n);return!i&&typeof d=="function"&&(i=!0),d});if(i)return()=>{for(let c=0;c<o.length;c++){const d=o[c];typeof d=="function"?d():qp(r[c],null)}}},[])}Qs(aS,"useStableComposedRefs");function Bo(e){return(e==null?void 0:e.animationName)||"none"}Qs(Bo,"getAnimationName");function iS(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Qs(iS,"getElementRef");var cI=Object.defineProperty,uI=(e,t)=>cI(e,"name",{value:t,configurable:!0}),dI=Mo[" useId ".trim().toString()]||(()=>{}),fI=0;function cn(e){const[t,n]=p.useState(dI());return Vt(()=>{e||n(r=>r??String(fI++))},[e]),e||(t?`radix-${t}`:"")}uI(cn,"useId");var hI=Object.defineProperty,Cc=(e,t)=>hI(e,"name",{value:t,configurable:!0}),Kp="Collapsible",[mI,vte]=bn(Kp),[pI,Gp]=mI(Kp),gI=p.forwardRef(Cc(function(t,n){const{__scopeCollapsible:r,open:i,defaultOpen:o,disabled:c,onOpenChange:d,...h}=t,[m,x]=Kn({prop:i,defaultProp:o??!1,onChange:d,caller:Kp});return l.jsx(pI,{scope:r,disabled:c,contentId:cn(),open:m,onOpenToggle:p.useCallback(()=>x(g=>!g),[x]),children:l.jsx(qe.div,{"data-state":Hd(m),"data-disabled":c?"":void 0,...h,ref:n})})},"Collapsible")),xI="CollapsibleTrigger",vI=p.forwardRef(Cc(function(t,n){const{__scopeCollapsible:r,...i}=t,o=Gp(xI,r);return l.jsx(qe.button,{type:"button","aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open||!1,"data-state":Hd(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...i,ref:n,onClick:Ce(t.onClick,o.onOpenToggle)})},"CollapsibleTrigger")),oS="CollapsibleContent",yI=p.forwardRef(Cc(function(t,n){const{forceMount:r,...i}=t,o=Gp(oS,t.__scopeCollapsible);return l.jsx(wn,{present:r||o.open,children:({present:c})=>l.jsx(bI,{...i,ref:n,present:c})})},"CollapsibleContent")),bI=p.forwardRef(Cc(function(t,n){const{__scopeCollapsible:r,present:i,children:o,...c}=t,d=Gp(oS,r),[h,m]=p.useState(i),x=p.useRef(null),g=Je(n,x),v=p.useRef(0),S=v.current,b=p.useRef(0),j=b.current,C=d.open||h,k=p.useRef(C),N=p.useRef(void 0);return p.useEffect(()=>{const E=requestAnimationFrame(()=>k.current=!1);return()=>cancelAnimationFrame(E)},[]),Vt(()=>{const E=x.current;if(E){N.current=N.current||{transitionDuration:E.style.transitionDuration,animationName:E.style.animationName},E.style.transitionDuration="0s",E.style.animationName="none";const R=E.getBoundingClientRect();v.current=R.height,b.current=R.width,k.current||(E.style.transitionDuration=N.current.transitionDuration,E.style.animationName=N.current.animationName),m(i)}},[d.open,i]),l.jsx(qe.div,{"data-state":Hd(d.open),"data-disabled":d.disabled?"":void 0,id:d.contentId,hidden:!C,...c,ref:g,style:{"--radix-collapsible-content-height":S?`${S}px`:void 0,"--radix-collapsible-content-width":j?`${j}px`:void 0,...t.style},children:C&&o})},"CollapsibleContentImpl"));function Hd(e){return e?"open":"closed"}Cc(Hd,"getState");var wI=gI,SI=Object.defineProperty,jI=(e,t)=>SI(e,"name",{value:t,configurable:!0}),CI=p.createContext(void 0);function Uo(e){const t=p.useContext(CI);return e||t||"ltr"}jI(Uo,"useDirection");var kI=Object.defineProperty,NI=(e,t)=>kI(e,"name",{value:t,configurable:!0});function rn(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)}),[])}NI(rn,"useCallbackRef");var TI=Object.defineProperty,En=(e,t)=>TI(e,"name",{value:t,configurable:!0}),Yp="dismissableLayer.update",EI="dismissableLayer.pointerDownOutside",RI="dismissableLayer.focusOutside",lS,cS=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Vo=p.forwardRef(En(function(t,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:h,onDismiss:m,...x}=t,g=p.useContext(cS),[v,S]=p.useState(null),b=(v==null?void 0:v.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,j]=p.useState({}),C=Je(n,S),k=Array.from(g.layers),[N]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),E=N?k.indexOf(N):-1,R=v?k.indexOf(v):-1,A=g.layersWithOutsidePointerEventsDisabled.size>0,_=R>=E,z=p.useRef(!1),D=dS(B=>{c==null||c(B),h==null||h(B),B.defaultPrevented||m==null||m()},{ownerDocument:b,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:z,dismissableSurfaces:g.dismissableSurfaces,shouldHandlePointerDownOutside:p.useCallback(B=>{if(!(B instanceof Node))return!1;const H=[...g.branches].some(ee=>ee.contains(B));return _&&!H},[g.branches,_])}),V=fS(B=>{if(i&&z.current)return;const H=B.target;[...g.branches].some(W=>W.contains(H))||(d==null||d(B),h==null||h(B),B.defaultPrevented||m==null||m())},b),I=v?R===k.length-1:!1,Q=rn(B=>{B.key==="Escape"&&(o==null||o(B),!B.defaultPrevented&&m&&(B.preventDefault(),m()))});return p.useEffect(()=>{if(I)return b.addEventListener("keydown",Q,{capture:!0}),()=>b.removeEventListener("keydown",Q,{capture:!0})},[b,I,Q]),p.useEffect(()=>{if(v)return r&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(lS=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(v)),g.layers.add(v),Wp(),()=>{r&&(g.layersWithOutsidePointerEventsDisabled.delete(v),g.layersWithOutsidePointerEventsDisabled.size===0&&(b.body.style.pointerEvents=lS))}},[v,b,r,g]),p.useEffect(()=>()=>{v&&(g.layers.delete(v),g.layersWithOutsidePointerEventsDisabled.delete(v),Wp())},[v,g]),p.useEffect(()=>{const B=En(()=>j({}),"handleUpdate");return document.addEventListener(Yp,B),()=>document.removeEventListener(Yp,B)},[]),l.jsx(qe.div,{...x,ref:C,style:{pointerEvents:A?_?"auto":"none":void 0,...t.style},onFocusCapture:Ce(t.onFocusCapture,V.onFocusCapture),onBlurCapture:Ce(t.onBlurCapture,V.onBlurCapture),onPointerDownCapture:Ce(t.onPointerDownCapture,D.onPointerDownCapture)})},"DismissableLayer"));function uS(){const e=p.useContext(cS),[t,n]=p.useState(null);return p.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}En(uS,"useDismissableLayerSurface");var AI=En(()=>!0,"IS_TRUE");function dS(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:o,shouldHandlePointerDownOutside:c=AI}=t,d=rn(e),h=p.useRef(!1),m=p.useRef(!1),x=p.useRef(new Map),g=p.useRef(()=>{});return p.useEffect(()=>{function v(){m.current=!1,i.current=!1,x.current.clear()}En(v,"resetOutsideInteraction");function S(){return Array.from(x.current.values()).some(Boolean)}En(S,"isOutsideInteractionIntercepted");function b(E){if(!m.current)return;const R=E.target;R instanceof Node&&[...o].some(_=>_.contains(R))||x.current.set(E.type,!0),E.type==="click"&&window.setTimeout(()=>{m.current&&g.current()},0)}En(b,"handleInteractionCapture");function j(E){m.current&&x.current.set(E.type,!1)}En(j,"handleInteractionBubble");const C=En(E=>{if(E.target&&!h.current){let R=function(){n.removeEventListener("click",g.current);const _=S();v(),_||Xp(EI,d,A,{discrete:!0})};if(En(R,"handleAndDispatchPointerDownOutsideEvent"),!c(E.target)){n.removeEventListener("click",g.current),v(),h.current=!1;return}const A={originalEvent:E};m.current=!0,i.current=r&&E.button===0,x.current.clear(),!r||E.button!==0?R():(n.removeEventListener("click",g.current),g.current=R,n.addEventListener("click",g.current,{once:!0}))}else n.removeEventListener("click",g.current),v();h.current=!1},"handlePointerDown"),k=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const E of k)n.addEventListener(E,b,!0),n.addEventListener(E,j);const N=window.setTimeout(()=>{n.addEventListener("pointerdown",C)},0);return()=>{window.clearTimeout(N),n.removeEventListener("pointerdown",C),n.removeEventListener("click",g.current);for(const E of k)n.removeEventListener(E,b,!0),n.removeEventListener(E,j)}},[n,d,r,i,o,c]),{onPointerDownCapture:En(()=>h.current=!0,"onPointerDownCapture")}}En(dS,"usePointerDownOutside");function fS(e,t=globalThis==null?void 0:globalThis.document){const n=rn(e),r=p.useRef(!1);return p.useEffect(()=>{const i=En(o=>{o.target&&!r.current&&Xp(RI,n,{originalEvent:o},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:En(()=>r.current=!0,"onFocusCapture"),onBlurCapture:En(()=>r.current=!1,"onBlurCapture")}}En(fS,"useFocusOutside");function Wp(){const e=new CustomEvent(Yp);document.dispatchEvent(e)}En(Wp,"dispatchUpdate");function Xp(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Bp(i,o):i.dispatchEvent(o)}En(Xp,"handleAndDispatchCustomEvent");var MI=Object.defineProperty,Gn=(e,t)=>MI(e,"name",{value:t,configurable:!0}),Qp="focusScope.autoFocusOnMount",Zp="focusScope.autoFocusOnUnmount",hS={bubbles:!1,cancelable:!0},qd=p.forwardRef(Gn(function(t,n){const{loop:r=!1,trapped:i=!1,onMountAutoFocus:o,onUnmountAutoFocus:c,...d}=t,[h,m]=p.useState(null),x=rn(o),g=rn(c),v=p.useRef(null),S=Je(n,m),b=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(i){let C=function(R){if(b.paused||!h)return;const A=R.target;h.contains(A)?v.current=A:Zs(v.current,{select:!0})},k=function(R){if(b.paused||!h)return;const A=R.relatedTarget;A!==null&&(h.contains(A)||Zs(v.current,{select:!0}))},N=function(R){if(document.activeElement===document.body)for(const _ of R)_.removedNodes.length>0&&Zs(h)};Gn(C,"handleFocusIn"),Gn(k,"handleFocusOut"),Gn(N,"handleMutations"),document.addEventListener("focusin",C),document.addEventListener("focusout",k);const E=new MutationObserver(N);return h&&E.observe(h,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",k),E.disconnect()}}},[i,h,b.paused]),p.useEffect(()=>{if(h){vS.add(b);const C=document.activeElement;if(!h.contains(C)){const N=new CustomEvent(Qp,hS);h.addEventListener(Qp,x),h.dispatchEvent(N),N.defaultPrevented||(mS(bS(Jp(h)),{select:!0}),document.activeElement===C&&Zs(h))}return()=>{h.removeEventListener(Qp,x),setTimeout(()=>{const N=new CustomEvent(Zp,hS);h.addEventListener(Zp,g),h.dispatchEvent(N),N.defaultPrevented||Zs(C??document.body,{select:!0}),h.removeEventListener(Zp,g),vS.remove(b)},0)}}},[h,x,g,b]);const j=p.useCallback(C=>{if(!r&&!i||b.paused)return;const k=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,N=document.activeElement;if(k&&N){const E=C.currentTarget,[R,A]=pS(E);R&&A?!C.shiftKey&&N===A?(C.preventDefault(),r&&Zs(R,{select:!0})):C.shiftKey&&N===R&&(C.preventDefault(),r&&Zs(A,{select:!0})):N===E&&C.preventDefault()}},[r,i,b.paused]);return l.jsx(qe.div,{tabIndex:-1,...d,ref:S,onKeyDown:j})},"FocusScope"));function mS(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Zs(r,{select:t}),document.activeElement!==n)return}Gn(mS,"focusFirst");function pS(e){const t=Jp(e),n=eg(t,e),r=eg(t.reverse(),e);return[n,r]}Gn(pS,"getTabbableEdges");function Jp(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Gn(r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}Gn(Jp,"getTabbableCandidates");function eg(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):gS(r,{upTo:t})))return r}Gn(eg,"findVisible");function gS(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}Gn(gS,"isHidden");function xS(e){return e instanceof HTMLInputElement&&"select"in e}Gn(xS,"isSelectableInput");function Zs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&xS(e)&&t&&e.select()}}Gn(Zs,"focus");var vS=yS();function yS(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=tg(e,t),e.unshift(t)},remove(t){var n;e=tg(e,t),(n=e[0])==null||n.resume()}}}Gn(yS,"createFocusScopesStack");function tg(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Gn(tg,"arrayRemove");function bS(e){return e.filter(t=>t.tagName!=="A")}Gn(bS,"removeLinks");var DI=Object.defineProperty,_I=(e,t)=>DI(e,"name",{value:t,configurable:!0}),Fo=p.forwardRef(_I(function(t,n){var h;const{container:r,...i}=t,[o,c]=p.useState(!1);Vt(()=>c(!0),[]);const d=r||o&&((h=globalThis==null?void 0:globalThis.document)==null?void 0:h.body);return d?Ba.createPortal(l.jsx(qe.div,{...i,ref:n}),d):null},"Portal")),OI=Object.defineProperty,ng=(e,t)=>OI(e,"name",{value:t,configurable:!0}),Kd=0,Es=null;function zI(e){return Ho(),e.children}ng(zI,"FocusGuards");function Ho(){p.useEffect(()=>{Es||(Es={start:rg(),end:rg()});const{start:e,end:t}=Es;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Kd++,()=>{Kd===1&&(Es==null||Es.start.remove(),Es==null||Es.end.remove(),Es=null),Kd=Math.max(0,Kd-1)}},[])}ng(Ho,"useFocusGuards");function rg(){const 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}ng(rg,"createFocusGuard");var Rs=function(){return Rs=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Rs.apply(this,arguments)};function wS(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 PI(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Gd="right-scroll-bar-position",Yd="width-before-scroll-bar",LI="with-scroll-bars-hidden",II="--removed-body-scroll-bar-size";function sg(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function $I(e,t){var n=p.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var BI=typeof window<"u"?p.useLayoutEffect:p.useEffect,SS=new WeakMap;function UI(e,t){var n=$I(null,function(r){return e.forEach(function(i){return sg(i,r)})});return BI(function(){var r=SS.get(n);if(r){var i=new Set(r),o=new Set(e),c=n.current;i.forEach(function(d){o.has(d)||sg(d,null)}),o.forEach(function(d){i.has(d)||sg(d,c)})}SS.set(n,e)},[e]),n}function VI(e){return e}function FI(e,t){t===void 0&&(t=VI);var n=[],r=!1,i={read:function(){if(r)throw new 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(o){var c=t(o,r);return n.push(c),function(){n=n.filter(function(d){return d!==c})}},assignSyncMedium:function(o){for(r=!0;n.length;){var c=n;n=[],c.forEach(o)}n={push:function(d){return o(d)},filter:function(){return n}}},assignMedium:function(o){r=!0;var c=[];if(n.length){var d=n;n=[],d.forEach(o),c=n}var h=function(){var x=c;c=[],x.forEach(o)},m=function(){return Promise.resolve().then(h)};m(),n={push:function(x){c.push(x),m()},filter:function(x){return c=c.filter(x),n}}}};return i}function HI(e){e===void 0&&(e={});var t=FI(null);return t.options=Rs({async:!0,ssr:!1},e),t}var jS=function(e){var t=e.sideCar,n=wS(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return p.createElement(r,Rs({},n))};jS.isSideCarExport=!0;function qI(e,t){return e.useMedium(t),jS}var CS=HI(),ag=function(){},Wd=p.forwardRef(function(e,t){var n=p.useRef(null),r=p.useState({onScrollCapture:ag,onWheelCapture:ag,onTouchMoveCapture:ag}),i=r[0],o=r[1],c=e.forwardProps,d=e.children,h=e.className,m=e.removeScrollBar,x=e.enabled,g=e.shards,v=e.sideCar,S=e.noRelative,b=e.noIsolation,j=e.inert,C=e.allowPinchZoom,k=e.as,N=k===void 0?"div":k,E=e.gapMode,R=wS(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=v,_=UI([n,t]),z=Rs(Rs({},R),i);return p.createElement(p.Fragment,null,x&&p.createElement(A,{sideCar:CS,removeScrollBar:m,shards:g,noRelative:S,noIsolation:b,inert:j,setCallbacks:o,allowPinchZoom:!!C,lockRef:n,gapMode:E}),c?p.cloneElement(p.Children.only(d),Rs(Rs({},z),{ref:_})):p.createElement(N,Rs({},z,{className:h,ref:_}),d))});Wd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Wd.classNames={fullWidth:Yd,zeroRight:Gd};var KI=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function GI(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=KI();return t&&e.setAttribute("nonce",t),e}function YI(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function WI(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var XI=function(){var e=0,t=null;return{add:function(n){e==0&&(t=GI())&&(YI(t,n),WI(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},QI=function(){var e=XI();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},kS=function(){var e=QI(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},ZI={left:0,top:0,right:0,gap:0},ig=function(e){return parseInt(e||"",10)||0},JI=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[ig(n),ig(r),ig(i)]},e3=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ZI;var t=JI(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])}},t3=kS(),qo="data-scroll-locked",n3=function(e,t,n,r){var i=e.left,o=e.top,c=e.right,d=e.gap;return n===void 0&&(n="margin"),`
|
|
359
|
+
.`.concat(LI,` {
|
|
360
|
+
overflow: hidden `).concat(r,`;
|
|
361
|
+
padding-right: `).concat(d,"px ").concat(r,`;
|
|
362
|
+
}
|
|
363
|
+
body[`).concat(qo,`] {
|
|
364
|
+
overflow: hidden `).concat(r,`;
|
|
365
|
+
overscroll-behavior: contain;
|
|
366
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
367
|
+
padding-left: `.concat(i,`px;
|
|
368
|
+
padding-top: `).concat(o,`px;
|
|
369
|
+
padding-right: `).concat(c,`px;
|
|
370
|
+
margin-left:0;
|
|
371
|
+
margin-top:0;
|
|
372
|
+
margin-right: `).concat(d,"px ").concat(r,`;
|
|
373
|
+
`),n==="padding"&&"padding-right: ".concat(d,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.`).concat(Gd,` {
|
|
377
|
+
right: `).concat(d,"px ").concat(r,`;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
.`).concat(Yd,` {
|
|
381
|
+
margin-right: `).concat(d,"px ").concat(r,`;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
.`).concat(Gd," .").concat(Gd,` {
|
|
385
|
+
right: 0 `).concat(r,`;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.`).concat(Yd," .").concat(Yd,` {
|
|
389
|
+
margin-right: 0 `).concat(r,`;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
body[`).concat(qo,`] {
|
|
393
|
+
`).concat(II,": ").concat(d,`px;
|
|
394
|
+
}
|
|
395
|
+
`)},NS=function(){var e=parseInt(document.body.getAttribute(qo)||"0",10);return isFinite(e)?e:0},r3=function(){p.useEffect(function(){return document.body.setAttribute(qo,(NS()+1).toString()),function(){var e=NS()-1;e<=0?document.body.removeAttribute(qo):document.body.setAttribute(qo,e.toString())}},[])},s3=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;r3();var o=p.useMemo(function(){return e3(i)},[i]);return p.createElement(t3,{styles:n3(o,!t,i,n?"":"!important")})},og=!1;if(typeof window<"u")try{var Xd=Object.defineProperty({},"passive",{get:function(){return og=!0,!0}});window.addEventListener("test",Xd,Xd),window.removeEventListener("test",Xd,Xd)}catch{og=!1}var Ko=og?{passive:!1}:!1,a3=function(e){return e.tagName==="TEXTAREA"},TS=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!a3(e)&&n[t]==="visible")},i3=function(e){return TS(e,"overflowY")},o3=function(e){return TS(e,"overflowX")},ES=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=RS(e,r);if(i){var o=AS(e,r),c=o[1],d=o[2];if(c>d)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},l3=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},c3=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},RS=function(e,t){return e==="v"?i3(t):o3(t)},AS=function(e,t){return e==="v"?l3(t):c3(t)},u3=function(e,t){return e==="h"&&t==="rtl"?-1:1},d3=function(e,t,n,r,i){var o=u3(e,window.getComputedStyle(t).direction),c=o*r,d=n.target,h=t.contains(d),m=!1,x=c>0,g=0,v=0;do{if(!d)break;var S=AS(e,d),b=S[0],j=S[1],C=S[2],k=j-C-o*b;(b||k)&&RS(e,d)&&(g+=k,v+=b);var N=d.parentNode;d=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!h&&d!==document.body||h&&(t.contains(d)||t===d));return(x&&Math.abs(g)<1||!x&&Math.abs(v)<1)&&(m=!0),m},Qd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},MS=function(e){return[e.deltaX,e.deltaY]},DS=function(e){return e&&"current"in e?e.current:e},f3=function(e,t){return e[0]===t[0]&&e[1]===t[1]},h3=function(e){return`
|
|
396
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
397
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
398
|
+
`)},m3=0,Go=[];function p3(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),i=p.useState(m3++)[0],o=p.useState(kS)[0],c=p.useRef(e);p.useEffect(function(){c.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var j=PI([e.lockRef.current],(e.shards||[]).map(DS),!0).filter(Boolean);return j.forEach(function(C){return C.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),j.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var d=p.useCallback(function(j,C){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!c.current.allowPinchZoom;var k=Qd(j),N=n.current,E="deltaX"in j?j.deltaX:N[0]-k[0],R="deltaY"in j?j.deltaY:N[1]-k[1],A,_=j.target,z=Math.abs(E)>Math.abs(R)?"h":"v";if("touches"in j&&z==="h"&&_.type==="range")return!1;var D=window.getSelection(),V=D&&D.anchorNode,I=V?V===_||V.contains(_):!1;if(I)return!1;var Q=ES(z,_);if(!Q)return!0;if(Q?A=z:(A=z==="v"?"h":"v",Q=ES(z,_)),!Q)return!1;if(!r.current&&"changedTouches"in j&&(E||R)&&(r.current=A),!A)return!0;var B=r.current||A;return d3(B,C,j,B==="h"?E:R)},[]),h=p.useCallback(function(j){var C=j;if(!(!Go.length||Go[Go.length-1]!==o)){var k="deltaY"in C?MS(C):Qd(C),N=t.current.filter(function(A){return A.name===C.type&&(A.target===C.target||C.target===A.shadowParent)&&f3(A.delta,k)})[0];if(N&&N.should){C.cancelable&&C.preventDefault();return}if(!N){var E=(c.current.shards||[]).map(DS).filter(Boolean).filter(function(A){return A.contains(C.target)}),R=E.length>0?d(C,E[0]):!c.current.noIsolation;R&&C.cancelable&&C.preventDefault()}}},[]),m=p.useCallback(function(j,C,k,N){var E={name:j,delta:C,target:k,should:N,shadowParent:g3(k)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(R){return R!==E})},1)},[]),x=p.useCallback(function(j){n.current=Qd(j),r.current=void 0},[]),g=p.useCallback(function(j){m(j.type,MS(j),j.target,d(j,e.lockRef.current))},[]),v=p.useCallback(function(j){m(j.type,Qd(j),j.target,d(j,e.lockRef.current))},[]);p.useEffect(function(){return Go.push(o),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:v}),document.addEventListener("wheel",h,Ko),document.addEventListener("touchmove",h,Ko),document.addEventListener("touchstart",x,Ko),function(){Go=Go.filter(function(j){return j!==o}),document.removeEventListener("wheel",h,Ko),document.removeEventListener("touchmove",h,Ko),document.removeEventListener("touchstart",x,Ko)}},[]);var S=e.removeScrollBar,b=e.inert;return p.createElement(p.Fragment,null,b?p.createElement(o,{styles:h3(i)}):null,S?p.createElement(s3,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function g3(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const x3=qI(CS,p3);var kc=p.forwardRef(function(e,t){return p.createElement(Wd,Rs({},e,{ref:t,sideCar:x3}))});kc.classNames=Wd.classNames;var v3=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Yo=new WeakMap,Zd=new WeakMap,Jd={},lg=0,_S=function(e){return e&&(e.host||_S(e.parentNode))},y3=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=_S(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},b3=function(e,t,n,r){var i=y3(t,Array.isArray(e)?e:[e]);Jd[n]||(Jd[n]=new WeakMap);var o=Jd[n],c=[],d=new Set,h=new Set(i),m=function(g){!g||d.has(g)||(d.add(g),m(g.parentNode))};i.forEach(m);var x=function(g){!g||h.has(g)||Array.prototype.forEach.call(g.children,function(v){if(d.has(v))x(v);else try{var S=v.getAttribute(r),b=S!==null&&S!=="false",j=(Yo.get(v)||0)+1,C=(o.get(v)||0)+1;Yo.set(v,j),o.set(v,C),c.push(v),j===1&&b&&Zd.set(v,!0),C===1&&v.setAttribute(n,"true"),b||v.setAttribute(r,"true")}catch(k){console.error("aria-hidden: cannot operate on ",v,k)}})};return x(t),d.clear(),lg++,function(){c.forEach(function(g){var v=Yo.get(g)-1,S=o.get(g)-1;Yo.set(g,v),o.set(g,S),v||(Zd.has(g)||g.removeAttribute(r),Zd.delete(g)),S||g.removeAttribute(n)}),lg--,lg||(Yo=new WeakMap,Yo=new WeakMap,Zd=new WeakMap,Jd={})}},ef=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=v3(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),b3(r,i,n,"aria-hidden")):function(){return null}},w3=Object.defineProperty,jr=(e,t)=>w3(e,"name",{value:t,configurable:!0}),cg="Dialog",[OS,zS]=bn(cg),[S3,us]=OS(cg),Nc=jr(e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:c=!0}=e,d=p.useRef(null),h=p.useRef(null),[m,x]=Kn({prop:r,defaultProp:i??!1,onChange:o,caller:cg}),[g,v]=p.useState(0),[S,b]=p.useState(0);return l.jsx(S3,{scope:t,triggerRef:d,contentRef:h,contentId:cn(),titleId:cn(),descriptionId:cn(),titlePresent:g>0,descriptionPresent:S>0,setTitleCount:v,setDescriptionCount:b,open:m,onOpenChange:x,onOpenToggle:p.useCallback(()=>x(j=>!j),[x]),modal:c,children:n})},"Dialog"),j3="DialogTrigger",PS=p.forwardRef(jr(function(t,n){const{__scopeDialog:r,...i}=t,o=us(j3,r),c=Je(n,o.triggerRef);return l.jsx(qe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":tf(o.open),...i,ref:c,onClick:Ce(t.onClick,o.onOpenToggle)})},"DialogTrigger")),LS="DialogPortal",[C3,IS]=OS(LS,{forceMount:void 0}),Tc=jr(e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=us(LS,t);return l.jsx(C3,{scope:t,forceMount:n,children:p.Children.map(r,c=>l.jsx(wn,{present:n||o.open,children:l.jsx(Fo,{asChild:!0,container:i,children:c})}))})},"DialogPortal"),ug="DialogOverlay",Wo=p.forwardRef(jr(function(t,n){const r=IS(ug,t.__scopeDialog),{forceMount:i=r.forceMount,...o}=t,c=us(ug,t.__scopeDialog);return c.modal?l.jsx(wn,{present:i||c.open,children:l.jsx(N3,{...o,ref:n})}):null},"DialogOverlay")),k3=cs("DialogOverlay.RemoveScroll"),N3=p.forwardRef(jr(function(t,n){const{__scopeDialog:r,...i}=t,o=us(ug,r),c=uS(),d=Je(n,c);return l.jsx(kc,{as:k3,allowPinchZoom:!0,shards:[o.contentRef],children:l.jsx(qe.div,{"data-state":tf(o.open),...i,ref:d,style:{pointerEvents:"auto",...i.style}})})},"DialogOverlayImpl")),Ec="DialogContent",Xo=p.forwardRef(jr(function(t,n){const r=IS(Ec,t.__scopeDialog),{forceMount:i=r.forceMount,...o}=t,c=us(Ec,t.__scopeDialog);return l.jsx(wn,{present:i||c.open,children:c.modal?l.jsx(T3,{...o,ref:n}):l.jsx(E3,{...o,ref:n})})},"DialogContent")),T3=p.forwardRef(jr(function(t,n){const r=us(Ec,t.__scopeDialog),i=p.useRef(null),o=Je(n,r.contentRef,i);return p.useEffect(()=>{const c=i.current;if(c)return ef(c)},[]),l.jsx($S,{...t,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Ce(t.onCloseAutoFocus,c=>{var d;c.preventDefault(),(d=r.triggerRef.current)==null||d.focus()}),onPointerDownOutside:Ce(t.onPointerDownOutside,c=>{const d=c.detail.originalEvent,h=d.button===0&&d.ctrlKey===!0;(d.button===2||h)&&c.preventDefault()}),onFocusOutside:Ce(t.onFocusOutside,c=>c.preventDefault())})},"DialogContentModal")),E3=p.forwardRef(jr(function(t,n){const r=us(Ec,t.__scopeDialog),i=p.useRef(!1),o=p.useRef(!1);return l.jsx($S,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{var d,h;(d=t.onCloseAutoFocus)==null||d.call(t,c),c.defaultPrevented||(i.current||(h=r.triggerRef.current)==null||h.focus(),c.preventDefault()),i.current=!1,o.current=!1},onInteractOutside:c=>{var m,x;(m=t.onInteractOutside)==null||m.call(t,c),c.defaultPrevented||(i.current=!0,c.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const d=c.target;((x=r.triggerRef.current)==null?void 0:x.contains(d))&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&o.current&&c.preventDefault()}})},"DialogContentNonModal")),$S=p.forwardRef(jr(function(t,n){const{__scopeDialog:r,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:c,...d}=t,h=us(Ec,r);return Ho(),l.jsx(l.Fragment,{children:l.jsx(qd,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:o,onUnmountAutoFocus:c,children:l.jsx(Vo,{role:"dialog",id:h.contentId,"aria-describedby":h.descriptionPresent?h.descriptionId:void 0,"aria-labelledby":h.titlePresent?h.titleId:void 0,"data-state":tf(h.open),...d,ref:n,deferPointerDownOutside:!0,onDismiss:()=>h.onOpenChange(!1)})})})},"DialogContentImpl")),R3="DialogTitle",Rc=p.forwardRef(jr(function(t,n){const{__scopeDialog:r,...i}=t,o=us(R3,r),{setTitleCount:c}=o;return Vt(()=>(c(d=>d+1),()=>c(d=>d-1)),[c]),l.jsx(qe.h2,{id:o.titleId,...i,ref:n})},"DialogTitle")),A3="DialogDescription",Ac=p.forwardRef(jr(function(t,n){const{__scopeDialog:r,...i}=t,o=us(A3,r),{setDescriptionCount:c}=o;return Vt(()=>(c(d=>d+1),()=>c(d=>d-1)),[c]),l.jsx(qe.p,{id:o.descriptionId,...i,ref:n})},"DialogDescription")),M3="DialogClose",Hi=p.forwardRef(jr(function(t,n){const{__scopeDialog:r,...i}=t,o=us(M3,r);return l.jsx(qe.button,{type:"button",...i,ref:n,onClick:Ce(t.onClick,()=>o.onOpenChange(!1))})},"DialogClose"));function tf(e){return e?"open":"closed"}jr(tf,"getState");var D3=Object.defineProperty,Js=(e,t)=>D3(e,"name",{value:t,configurable:!0}),_3="AlertDialog",[O3,yte]=bn(_3,[zS]),ea=zS(),z3=Js(e=>{const{__scopeAlertDialog:t,...n}=e,r=ea(t);return l.jsx(Nc,{...r,...n,modal:!0})},"AlertDialog");p.forwardRef(Js(function(t,n){const{__scopeAlertDialog:r,...i}=t,o=ea(r);return l.jsx(PS,{...o,...i,ref:n})},"AlertDialogTrigger"));var P3=Js(e=>{const{__scopeAlertDialog:t,...n}=e,r=ea(t);return l.jsx(Tc,{...r,...n})},"AlertDialogPortal"),L3=p.forwardRef(Js(function(t,n){const{__scopeAlertDialog:r,...i}=t,o=ea(r);return l.jsx(Wo,{...o,...i,ref:n})},"AlertDialogOverlay")),I3="AlertDialogContent",[$3,B3]=O3(I3),U3=p.forwardRef(Js(function(t,n){const{__scopeAlertDialog:r,children:i,...o}=t,c=ea(r),d=p.useRef(null),h=Je(n,d),m=p.useRef(null);return l.jsx($3,{scope:r,cancelRef:m,children:l.jsx(Xo,{role:"alertdialog",...c,...o,ref:h,onOpenAutoFocus:Ce(o.onOpenAutoFocus,x=>{var g;x.preventDefault(),(g=m.current)==null||g.focus({preventScroll:!0})}),onPointerDownOutside:x=>x.preventDefault(),onInteractOutside:x=>x.preventDefault(),children:i})})},"AlertDialogContent")),V3=p.forwardRef(Js(function(t,n){const{__scopeAlertDialog:r,...i}=t,o=ea(r);return l.jsx(Rc,{...o,...i,ref:n})},"AlertDialogTitle")),F3=p.forwardRef(Js(function(t,n){const{__scopeAlertDialog:r,...i}=t,o=ea(r);return l.jsx(Ac,{...o,...i,ref:n})},"AlertDialogDescription")),H3=p.forwardRef(Js(function(t,n){const{__scopeAlertDialog:r,...i}=t,o=ea(r);return l.jsx(Hi,{...o,...i,ref:n})},"AlertDialogAction")),q3="AlertDialogCancel",K3=p.forwardRef(Js(function(t,n){const{__scopeAlertDialog:r,...i}=t,{cancelRef:o}=B3(q3,r),c=ea(r),d=Je(n,o);return l.jsx(Hi,{...c,...i,ref:d})},"AlertDialogCancel")),G3=z3,Y3=P3,BS=L3,US=U3,VS=H3,FS=K3,HS=V3,qS=F3,W3=Object.defineProperty,ta=(e,t)=>W3(e,"name",{value:t,configurable:!0}),KS="Avatar",[X3,bte]=bn(KS),Q3=[0,()=>{}],[Z3,GS]=X3(KS),J3=p.forwardRef(ta(function(t,n){const{__scopeAvatar:r,...i}=t,[o,c]=p.useState("idle"),[d,h]=WS();return l.jsx(Z3,{scope:r,imageLoadingStatus:o,setImageLoadingStatus:c,imageCount:d,setImageCount:h,children:l.jsx(qe.span,{...i,ref:n})})},"Avatar")),e$="AvatarImage",t$=p.forwardRef(ta(function(t,n){const{__scopeAvatar:r,src:i,onLoadingStatusChange:o,...c}=t,d=GS(e$,r);d.setImageCount;const h=YS(i,{referrerPolicy:c.referrerPolicy,crossOrigin:c.crossOrigin,loadingStatus:d.imageLoadingStatus,setLoadingStatus:d.setImageLoadingStatus}),m=rn(g=>{o==null||o(g)}),x=p.useRef(h);return Vt(()=>{const g=x.current;x.current=h,h!==g&&m(h)},[h,m]),h==="loaded"?l.jsx(qe.img,{...c,ref:n,src:i}):null},"AvatarImage")),n$="AvatarFallback",r$=p.forwardRef(ta(function(t,n){const{__scopeAvatar:r,delayMs:i,...o}=t,c=GS(n$,r),[d,h]=p.useState(i===void 0);return p.useEffect(()=>{if(i!==void 0){const m=window.setTimeout(()=>h(!0),i);return()=>window.clearTimeout(m)}},[i]),d&&c.imageLoadingStatus!=="loaded"?l.jsx(qe.span,{...o,ref:n}):null},"AvatarFallback"));function YS(e,{loadingStatus:t,setLoadingStatus:n,referrerPolicy:r,crossOrigin:i}){return Vt(()=>{if(!e){n("error");return}const o=new window.Image,c=ta(h=>{const m=h.currentTarget;n(dg(m))},"handleLoad"),d=ta(()=>n("error"),"handleError");return o.addEventListener("load",c),o.addEventListener("error",d),r&&(o.referrerPolicy=r),o.crossOrigin=i??null,o.src=e,n(dg(o)),()=>{o.removeEventListener("load",c),o.removeEventListener("error",d),n("idle")}},[e,i,r,n]),t}ta(YS,"useImageLoadingStatus");function dg(e){return e.complete?e.naturalWidth>0?"loaded":"error":"loading"}ta(dg,"getImageLoadingStatus");function WS(){return Q3}ta(WS,"useImageCount");function s$(e){}ta(s$,"useUpdateImageCount");var a$=Object.defineProperty,i$=(e,t)=>a$(e,"name",{value:t,configurable:!0});function nf(e){const[t,n]=p.useState(void 0);return Vt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let c,d;if("borderBoxSize"in o){const h=o.borderBoxSize,m=Array.isArray(h)?h[0]:h;c=m.inlineSize,d=m.blockSize}else c=e.offsetWidth,d=e.offsetHeight;n({width:c,height:d})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}i$(nf,"useSize");const o$=["top","right","bottom","left"],Fa=Math.min,na=Math.max,rf=Math.round,sf=Math.floor,ra=e=>({x:e,y:e}),l$={left:"right",right:"left",bottom:"top",top:"bottom"};function XS(e,t,n){return na(e,Fa(t,n))}function sa(e,t){return typeof e=="function"?e(t):e}function Ha(e){return e.split("-")[0]}function Qo(e){return e.split("-")[1]}function fg(e){return e==="x"?"y":"x"}function hg(e){return e==="y"?"height":"width"}function As(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function mg(e){return fg(As(e))}function c$(e,t,n){n===void 0&&(n=!1);const r=Qo(e),i=mg(e),o=hg(i);let c=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(c=af(c)),[c,af(c)]}function u$(e){const t=af(e);return[pg(e),t,pg(t)]}function pg(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const QS=["left","right"],ZS=["right","left"],d$=["top","bottom"],f$=["bottom","top"];function h$(e,t,n){switch(e){case"top":case"bottom":return n?t?ZS:QS:t?QS:ZS;case"left":case"right":return t?d$:f$;default:return[]}}function m$(e,t,n,r){const i=Qo(e);let o=h$(Ha(e),n==="start",r);return i&&(o=o.map(c=>c+"-"+i),t&&(o=o.concat(o.map(pg)))),o}function af(e){const t=Ha(e);return l$[t]+e.slice(t.length)}function p$(e){var t,n,r,i;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(i=e.left)!=null?i:0}}function JS(e){return typeof e!="number"?p$(e):{top:e,right:e,bottom:e,left:e}}function of(e){const{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 ej(e,t,n){let{reference:r,floating:i}=e;const o=As(t),c=mg(t),d=hg(c),h=Ha(t),m=o==="y",x=r.x+r.width/2-i.width/2,g=r.y+r.height/2-i.height/2,v=r[d]/2-i[d]/2;let S;switch(h){case"top":S={x,y:r.y-i.height};break;case"bottom":S={x,y:r.y+r.height};break;case"right":S={x:r.x+r.width,y:g};break;case"left":S={x:r.x-i.width,y:g};break;default:S={x:r.x,y:r.y}}const b=Qo(t);return b&&(S[c]+=v*(b==="end"?1:-1)*(n&&m?-1:1)),S}async function g$(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:c,elements:d,strategy:h}=e,{boundary:m="clippingAncestors",rootBoundary:x="viewport",elementContext:g="floating",altBoundary:v=!1,padding:S=0}=sa(t,e),b=JS(S),C=d[v?g==="floating"?"reference":"floating":g],k=of(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(C)))==null||n?C:C.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(d.floating)),boundary:m,rootBoundary:x,strategy:h})),N=g==="floating"?{x:r,y:i,width:c.floating.width,height:c.floating.height}:c.reference,E=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d.floating)),R=await(o.isElement==null?void 0:o.isElement(E))&&await(o.getScale==null?void 0:o.getScale(E))||{x:1,y:1},A=of(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:N,offsetParent:E,strategy:h}):N);return{top:(k.top-A.top+b.top)/R.y,bottom:(A.bottom-k.bottom+b.bottom)/R.y,left:(k.left-A.left+b.left)/R.x,right:(A.right-k.right+b.right)/R.x}}const x$=50,v$=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:c}=n,d=c.detectOverflow?c:{...c,detectOverflow:g$},h=await(c.isRTL==null?void 0:c.isRTL(t));let m=await c.getElementRects({reference:e,floating:t,strategy:i}),{x,y:g}=ej(m,r,h),v=r,S=0;const b={};for(let j=0;j<o.length;j++){const C=o[j];if(!C)continue;const{name:k,fn:N}=C,{x:E,y:R,data:A,reset:_}=await N({x,y:g,initialPlacement:r,placement:v,strategy:i,middlewareData:b,rects:m,platform:d,elements:{reference:e,floating:t}});x=E??x,g=R??g,b[k]={...b[k],...A},_&&S<x$&&(S++,typeof _=="object"&&(_.placement&&(v=_.placement),_.rects&&(m=_.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:i}):_.rects),{x,y:g}=ej(m,v,h)),j=-1)}return{x,y:g,placement:v,strategy:i,middlewareData:b}},y$=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:c,elements:d,middlewareData:h}=t,{element:m,padding:x=0}=sa(e,t)||{};if(m==null)return{};const g=JS(x),v={x:n,y:r},S=mg(i),b=hg(S),j=await c.getDimensions(m),C=S==="y",k=C?"top":"left",N=C?"bottom":"right",E=C?"clientHeight":"clientWidth",R=o.reference[b]+o.reference[S]-v[S]-o.floating[b],A=v[S]-o.reference[S],_=await(c.getOffsetParent==null?void 0:c.getOffsetParent(m));let z=_?_[E]:0;(!z||!await(c.isElement==null?void 0:c.isElement(_)))&&(z=d.floating[E]||o.floating[b]);const D=R/2-A/2,V=z/2-j[b]/2-1,I=Fa(g[k],V),Q=Fa(g[N],V),B=z-j[b]-Q,H=z/2-j[b]/2+D,ee=XS(I,H,B),W=!h.arrow&&Qo(i)!=null&&H!==ee&&o.reference[b]/2-(H<I?I:Q)-j[b]/2<0,M=W?H<I?H-I:H-B:0;return{[S]:v[S]+M,data:{[S]:ee,centerOffset:H-ee-M,...W&&{alignmentOffset:M}},reset:W}}}),b$=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:c,initialPlacement:d,platform:h,elements:m}=t,{mainAxis:x=!0,crossAxis:g=!0,fallbackPlacements:v,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:j=!0,...C}=sa(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const k=Ha(i),N=As(d),E=Ha(d)===d,R=await(h.isRTL==null?void 0:h.isRTL(m.floating)),A=v||(E||!j?[af(d)]:u$(d)),_=b!=="none";!v&&_&&A.push(...m$(d,j,b,R));const z=[d,...A],D=await h.detectOverflow(t,C),V=[];let I=((r=o.flip)==null?void 0:r.overflows)||[];if(x&&V.push(D[k]),g){const ee=c$(i,c,R);V.push(D[ee[0]],D[ee[1]])}if(I=[...I,{placement:i,overflows:V}],!V.every(ee=>ee<=0)){var Q,B;const ee=(((Q=o.flip)==null?void 0:Q.index)||0)+1,W=z[ee];if(W&&(!(g==="alignment"?N!==As(W):!1)||I.every(K=>As(K.placement)===N?K.overflows[0]>0:!0)))return{data:{index:ee,overflows:I},reset:{placement:W}};let M=(B=I.filter(U=>U.overflows[0]<=0).sort((U,K)=>U.overflows[1]-K.overflows[1])[0])==null?void 0:B.placement;if(!M)switch(S){case"bestFit":{var H;const U=(H=I.filter(K=>{if(_){const ne=As(K.placement);return ne===N||ne==="y"}return!0}).map(K=>[K.placement,K.overflows.filter(ne=>ne>0).reduce((ne,q)=>ne+q,0)]).sort((K,ne)=>K[1]-ne[1])[0])==null?void 0:H[0];U&&(M=U);break}case"initialPlacement":M=d;break}if(i!==M)return{reset:{placement:M}}}return{}}}};function tj(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function nj(e){return o$.some(t=>e[t]>=0)}const w$=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...o}=sa(e,t);switch(i){case"referenceHidden":{const c=await r.detectOverflow(t,{...o,elementContext:"reference"}),d=tj(c,n.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:nj(d)}}}case"escaped":{const c=await r.detectOverflow(t,{...o,altBoundary:!0}),d=tj(c,n.floating);return{data:{escapedOffsets:d,escaped:nj(d)}}}default:return{}}}}},rj=new Set(["left","top"]);async function S$(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),c=Ha(n),d=Qo(n),h=As(n)==="y",m=rj.has(c)?-1:1,x=o&&h?-1:1,g=sa(t,e);let{mainAxis:v,crossAxis:S,alignmentAxis:b}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return d&&typeof b=="number"&&(S=d==="end"?b*-1:b),h?{x:S*x,y:v*m}:{x:v*m,y:S*x}}const j$=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:c,middlewareData:d}=t,h=await S$(t,e);return c===((n=d.offset)==null?void 0:n.placement)&&(r=d.arrow)!=null&&r.alignmentOffset?{}:{x:i+h.x,y:o+h.y,data:{...h,placement:c}}}}},C$=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:o}=t,{mainAxis:c=!0,crossAxis:d=!1,limiter:h={fn:N=>{let{x:E,y:R}=N;return{x:E,y:R}}},...m}=sa(e,t),x={x:n,y:r},g=await o.detectOverflow(t,m),v=As(i),S=fg(v);let b=x[S],j=x[v];const C=(N,E)=>XS(E+g[N==="y"?"top":"left"],E,E-g[N==="y"?"bottom":"right"]);c&&(b=C(S,b)),d&&(j=C(v,j));const k=h.fn({...t,[S]:b,[v]:j});return{...k,data:{x:k.x-n,y:k.y-r,enabled:{[S]:c,[v]:d}}}}}},k$=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:i,y:o,placement:c,rects:d,middlewareData:h}=t,{offset:m=0,mainAxis:x=!0,crossAxis:g=!0}=sa(e,t),v={x:i,y:o},S=As(c),b=fg(S);let j=v[b],C=v[S];const k=sa(m,t),N=typeof k=="number"?{mainAxis:k,crossAxis:0}:{mainAxis:(n=k.mainAxis)!=null?n:0,crossAxis:(r=k.crossAxis)!=null?r:0};if(x){const A=b==="y"?"height":"width",_=d.reference[b]-d.floating[A]+N.mainAxis,z=d.reference[b]+d.reference[A]-N.mainAxis;j<_?j=_:j>z&&(j=z)}if(g){var E,R;const A=b==="y"?"width":"height",_=rj.has(Ha(c)),z=d.reference[S]-d.floating[A]+(_&&((E=h.offset)==null?void 0:E[S])||0)+(_?0:N.crossAxis),D=d.reference[S]+d.reference[A]+(_?0:((R=h.offset)==null?void 0:R[S])||0)-(_?N.crossAxis:0);C<z?C=z:C>D&&(C=D)}return{[b]:j,[S]:C}}}},N$=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:o}=t,{apply:c=()=>{},...d}=sa(e,t),h=await i.detectOverflow(t,d),m=Ha(n),x=Qo(n),g=As(n)==="y",{width:v,height:S}=r.floating;let b,j;m==="top"||m==="bottom"?(b=m,j=x===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(j=m,b=x==="end"?"top":"bottom");const C=S-h.top-h.bottom,k=v-h.left-h.right,N=Fa(S-h[b],C),E=Fa(v-h[j],k),R=t.middlewareData.shift,A=!R;let _=N,z=E;R!=null&&R.enabled.x&&(z=k),R!=null&&R.enabled.y&&(_=C),A&&!x&&(g?z=v-2*na(h.left,h.right):_=S-2*na(h.top,h.bottom)),await c({...t,availableWidth:z,availableHeight:_});const D=await i.getDimensions(o.floating);return v!==D.width||S!==D.height?{reset:{rects:!0}}:{}}}};function lf(){return typeof window<"u"}function Zo(e){return sj(e)?(e.nodeName||"").toLowerCase():"#document"}function or(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function aa(e){var t;return(t=(sj(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function sj(e){return lf()?e instanceof Node||e instanceof or(e).Node:!1}function Ms(e){return lf()?e instanceof Element||e instanceof or(e).Element:!1}function qa(e){return lf()?e instanceof HTMLElement||e instanceof or(e).HTMLElement:!1}function aj(e){return!lf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof or(e).ShadowRoot}function cf(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Ds(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function T$(e){return/^(table|td|th)$/.test(Zo(e))}function uf(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const E$=/transform|translate|scale|rotate|perspective|filter/,R$=/paint|layout|strict|content/,qi=e=>!!e&&e!=="none";let gg;function xg(e){const t=Ms(e)?Ds(e):e;return qi(t.transform)||qi(t.translate)||qi(t.scale)||qi(t.rotate)||qi(t.perspective)||!vg()&&(qi(t.backdropFilter)||qi(t.filter))||E$.test(t.willChange||"")||R$.test(t.contain||"")}function A$(e){let t=Ki(e);for(;qa(t)&&!Mc(t);){if(xg(t))return t;if(uf(t))return null;t=Ki(t)}return null}function vg(){return gg==null&&(gg=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),gg}function Mc(e){return/^(html|body|#document)$/.test(Zo(e))}function Ds(e){return or(e).getComputedStyle(e)}function df(e){return Ms(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ki(e){if(Zo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||aj(e)&&e.host||aa(e);return aj(t)?t.host:t}function ij(e){const t=Ki(e);return Mc(t)?(e.ownerDocument||e).body:qa(t)&&cf(t)?t:ij(t)}function Dc(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=ij(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),c=or(i);if(o){const d=yg(c);return t.concat(c,c.visualViewport||[],cf(i)?i:[],d&&n?Dc(d):[])}else return t.concat(i,Dc(i,[],n))}function yg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function oj(e){const t=Ds(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=qa(e),o=i?e.offsetWidth:n,c=i?e.offsetHeight:r,d=rf(n)!==o||rf(r)!==c;return d&&(n=o,r=c),{width:n,height:r,$:d}}function bg(e){return Ms(e)?e:e.contextElement}function Jo(e){const t=bg(e);if(!qa(t))return ra(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=oj(t);let c=(o?rf(n.width):n.width)/r,d=(o?rf(n.height):n.height)/i;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const M$=ra(0);function lj(e){const t=or(e);return!vg()||!t.visualViewport?M$:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function D$(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===or(e)}function Gi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=bg(e);let c=ra(1);t&&(r?Ms(r)&&(c=Jo(r)):c=Jo(e));const d=D$(o,n,r)?lj(o):ra(0);let h=(i.left+d.x)/c.x,m=(i.top+d.y)/c.y,x=i.width/c.x,g=i.height/c.y;if(o&&r){const v=or(o),S=Ms(r)?or(r):r;let b=v,j=yg(b);for(;j&&S!==b;){const C=Jo(j),k=j.getBoundingClientRect(),N=Ds(j),E=k.left+(j.clientLeft+parseFloat(N.paddingLeft))*C.x,R=k.top+(j.clientTop+parseFloat(N.paddingTop))*C.y;h*=C.x,m*=C.y,x*=C.x,g*=C.y,h+=E,m+=R,b=or(j),j=yg(b)}}return of({width:x,height:g,x:h,y:m})}function ff(e,t){const n=df(e).scrollLeft;return t?t.left+n:Gi(aa(e)).left+n}function cj(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ff(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function _$(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",c=aa(r),d=t?uf(t.floating):!1;if(r===c||d&&o)return n;let h={scrollLeft:0,scrollTop:0},m=ra(1);const x=ra(0),g=qa(r);if((g||!o)&&((Zo(r)!=="body"||cf(c))&&(h=df(r)),g)){const S=Gi(r);m=Jo(r),x.x=S.x+r.clientLeft,x.y=S.y+r.clientTop}const v=c&&!g&&!o?cj(c,h):ra(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-h.scrollLeft*m.x+x.x+v.x,y:n.y*m.y-h.scrollTop*m.y+x.y+v.y}}function O$(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function z$(e){const t=df(e),n=e.ownerDocument.body,r=na(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=na(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-t.scrollLeft+ff(e);const c=-t.scrollTop;return Ds(n).direction==="rtl"&&(o+=na(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:o,y:c}}const P$=25;function L$(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",i=or(e),o=aa(e),c=i.visualViewport;let d=o.clientWidth,h=o.clientHeight,m=0,x=0;if(c){const v=!vg()||t==="fixed";r?v||(m=-c.offsetLeft,x=-c.offsetTop):(d=c.width,h=c.height,v&&(m=c.offsetLeft,x=c.offsetTop))}if(ff(o)<=0){const v=o.ownerDocument,S=v.body,b=getComputedStyle(S),j=v.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,C=Math.abs(o.clientWidth-S.clientWidth-j),k=getComputedStyle(o).scrollbarGutter==="stable both-edges"?C/2:C;k<=P$&&(d-=k)}return{width:d,height:h,x:m,y:x}}function I$(e,t){const n=Gi(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Jo(e),c=e.clientWidth*o.x,d=e.clientHeight*o.y,h=i*o.x,m=r*o.y;return{width:c,height:d,x:h,y:m}}function uj(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=L$(e,n,t);else if(t==="document")r=z$(aa(e));else if(Ms(t))r=I$(t,n);else{const i=lj(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return of(r)}function $$(e,t){const n=t.get(e);if(n)return n;let r=Dc(e,[],!1).filter(d=>Ms(d)&&Zo(d)!=="body"),i=null;const o=Ds(e).position==="fixed";let c=o?Ki(e):e;for(;Ms(c)&&!Mc(c);){const d=Ds(c),h=xg(c),m=i?i.position:o?"fixed":"";!h&&(m==="fixed"||m==="absolute"&&d.position==="static")?r=r.filter(g=>g!==c):i=d,c=Ki(c)}return t.set(e,r),r}function B$(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const c=[...n==="clippingAncestors"?uf(t)?[]:$$(t,this._c):[].concat(n),r],d=uj(t,c[0],i);let h=d.top,m=d.right,x=d.bottom,g=d.left;for(let v=1;v<c.length;v++){const S=uj(t,c[v],i);h=na(S.top,h),m=Fa(S.right,m),x=Fa(S.bottom,x),g=na(S.left,g)}return{width:m-g,height:x-h,x:g,y:h}}function U$(e){const{width:t,height:n}=oj(e);return{width:t,height:n}}function V$(e,t,n){const r=qa(t),i=aa(t),o=n==="fixed",c=Gi(e,!0,o,t);let d={scrollLeft:0,scrollTop:0};const h=ra(0);if((r||!o)&&((Zo(t)!=="body"||cf(i))&&(d=df(t)),r)){const v=Gi(t,!0,o,t);h.x=v.x+t.clientLeft,h.y=v.y+t.clientTop}!r&&i&&(h.x=ff(i));const m=i&&!r&&!o?cj(i,d):ra(0),x=c.left+d.scrollLeft-h.x-m.x,g=c.top+d.scrollTop-h.y-m.y;return{x,y:g,width:c.width,height:c.height}}function wg(e){return Ds(e).position==="static"}function dj(e,t){if(!qa(e)||Ds(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return aa(e)===n&&(n=n.ownerDocument.body),n}function fj(e,t){const n=or(e);if(uf(e))return n;if(!qa(e)){let i=Ki(e);for(;i&&!Mc(i);){if(Ms(i)&&!wg(i))return i;i=Ki(i)}return n}let r=dj(e,t);for(;r&&T$(r)&&wg(r);)r=dj(r,t);return r&&Mc(r)&&wg(r)&&!xg(r)?n:r||A$(e)||n}const F$=async function(e){const t=this.getOffsetParent||fj,n=this.getDimensions,r=await n(e.floating);return{reference:V$(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function H$(e){return Ds(e).direction==="rtl"}const q$={convertOffsetParentRelativeRectToViewportRelativeRect:_$,getDocumentElement:aa,getClippingRect:B$,getOffsetParent:fj,getElementRects:F$,getClientRects:O$,getDimensions:U$,getScale:Jo,isElement:Ms,isRTL:H$};function hj(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function K$(e,t,n){let r=null,i;const o=aa(e);function c(){var x;clearTimeout(i),(x=r)==null||x.disconnect(),r=null}function d(x,g){x===void 0&&(x=!1),g===void 0&&(g=1),c();const v=e.getBoundingClientRect(),{left:S,top:b,width:j,height:C}=v;if(x||t(),!j||!C)return;const k=sf(b),N=sf(o.clientWidth-(S+j)),E=sf(o.clientHeight-(b+C)),R=sf(S),_={rootMargin:-k+"px "+-N+"px "+-E+"px "+-R+"px",threshold:na(0,Fa(1,g))||1};let z=!0;function D(V){const I=V[0].intersectionRatio;if(!hj(v,e.getBoundingClientRect()))return d();if(I!==g){if(!z)return d();I?d(!1,I):i=setTimeout(()=>{d(!1,1e-7)},1e3)}z=!1}try{r=new IntersectionObserver(D,{..._,root:o.ownerDocument})}catch{r=new IntersectionObserver(D,_)}r.observe(e)}const h=or(e),m=()=>d(n);return h.addEventListener("resize",m),d(!0),()=>{h.removeEventListener("resize",m),c()}}function G$(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:h=!1}=r,m=bg(e),x=i||o?[...m?Dc(m):[],...t?Dc(t):[]]:[];x.forEach(k=>{i&&k.addEventListener("scroll",n),o&&k.addEventListener("resize",n)});const g=m&&d?K$(m,n,o):null;let v=-1,S=null;c&&(S=new ResizeObserver(k=>{let[N]=k;N&&N.target===m&&S&&t&&(S.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var E;(E=S)==null||E.observe(t)})),n()}),m&&!h&&S.observe(m),t&&S.observe(t));let b,j=h?Gi(e):null;h&&C();function C(){const k=Gi(e);j&&!hj(j,k)&&n(),j=k,b=requestAnimationFrame(C)}return n(),()=>{var k;x.forEach(N=>{i&&N.removeEventListener("scroll",n),o&&N.removeEventListener("resize",n)}),g==null||g(),(k=S)==null||k.disconnect(),S=null,h&&cancelAnimationFrame(b)}}const Y$=j$,W$=C$,X$=b$,Q$=N$,Z$=w$,mj=y$,J$=k$,e4=(e,t,n)=>{const r=new Map,i=n??{},o={...q$,...i.platform,_c:r};return v$(e,t,{...i,platform:o})};var t4=typeof document<"u",n4=function(){},hf=t4?p.useLayoutEffect:n4;function mf(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(!mf(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;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!mf(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function pj(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gj(e,t){const n=pj(e);return Math.round(t*n)/n}function Sg(e){const t=p.useRef(e);return hf(()=>{t.current=e}),t}function r4(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:c}={},transform:d=!0,whileElementsMounted:h,open:m}=e,[x,g]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,S]=p.useState(r);mf(v,r)||S(r);const[b,j]=p.useState(null),[C,k]=p.useState(null),N=p.useCallback(K=>{K!==_.current&&(_.current=K,j(K))},[]),E=p.useCallback(K=>{K!==z.current&&(z.current=K,k(K))},[]),R=o||b,A=c||C,_=p.useRef(null),z=p.useRef(null),D=p.useRef(x),V=h!=null,I=Sg(h),Q=Sg(i),B=Sg(m),H=p.useCallback(()=>{if(!_.current||!z.current)return;const K={placement:t,strategy:n,middleware:v};Q.current&&(K.platform=Q.current),e4(_.current,z.current,K).then(ne=>{const q={...ne,isPositioned:B.current!==!1};ee.current&&!mf(D.current,q)&&(D.current=q,Ba.flushSync(()=>{g(q)}))})},[v,t,n,Q,B]);hf(()=>{m===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,g(K=>({...K,isPositioned:!1})))},[m]);const ee=p.useRef(!1);hf(()=>(ee.current=!0,()=>{ee.current=!1}),[]),hf(()=>{if(R&&(_.current=R),A&&(z.current=A),R&&A){if(I.current)return I.current(R,A,H);H()}},[R,A,H,I,V]);const W=p.useMemo(()=>({reference:_,floating:z,setReference:N,setFloating:E}),[N,E]),M=p.useMemo(()=>({reference:R,floating:A}),[R,A]),U=p.useMemo(()=>{const K={position:n,left:0,top:0};if(!M.floating)return K;const ne=gj(M.floating,x.x),q=gj(M.floating,x.y);return d?{...K,transform:"translate("+ne+"px, "+q+"px)",...pj(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ne,top:q}},[n,d,M.floating,x.x,x.y]);return p.useMemo(()=>({...x,update:H,refs:W,elements:M,floatingStyles:U}),[x,H,W,M,U])}const s4=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?mj({element:r.current,padding:i}).fn(n):{}:r?mj({element:r,padding:i}).fn(n):{}}}},a4=(e,t)=>{const n=Y$(e);return{name:n.name,fn:n.fn,options:[e,t]}},i4=(e,t)=>{const n=W$(e);return{name:n.name,fn:n.fn,options:[e,t]}},o4=(e,t)=>({fn:J$(e).fn,options:[e,t]}),l4=(e,t)=>{const n=X$(e);return{name:n.name,fn:n.fn,options:[e,t]}},c4=(e,t)=>{const n=Q$(e);return{name:n.name,fn:n.fn,options:[e,t]}},u4=(e,t)=>{const n=Z$(e);return{name:n.name,fn:n.fn,options:[e,t]}},d4=(e,t)=>{const n=s4(e);return{name:n.name,fn:n.fn,options:[e,t]}};var f4=Object.defineProperty,Ka=(e,t)=>f4(e,"name",{value:t,configurable:!0}),xj="Popper",[vj,_s]=bn(xj),[h4,yj]=vj(xj),m4=Ka(e=>{const{__scopePopper:t,children:n}=e,[r,i]=p.useState(null),[o,c]=p.useState(void 0);return l.jsx(h4,{scope:t,anchor:r,onAnchorChange:i,placementState:o,setPlacementState:c,children:n})},"Popper"),p4="PopperAnchor",g4=p.forwardRef(Ka(function(t,n){const{__scopePopper:r,virtualRef:i,...o}=t,c=yj(p4,r),d=p.useRef(null),h=c.onAnchorChange,m=p.useCallback(j=>{d.current=j,j&&h(j)},[h]),x=Je(n,m),g=p.useRef(null);p.useEffect(()=>{if(!i)return;const j=g.current;g.current=i.current,j!==g.current&&h(g.current)});const v=c.placementState&&pf(c.placementState),S=v==null?void 0:v[0],b=v==null?void 0:v[1];return i?null:l.jsx(qe.div,{"data-radix-popper-side":S,"data-radix-popper-align":b,...o,ref:x})},"PopperAnchor")),bj="PopperContent",[x4,wte]=vj(bj),v4=p.forwardRef(Ka(function(t,n){var Z,ve,Ee,Te,Ie,Fe,fe;const{__scopePopper:r,side:i="bottom",sideOffset:o=0,align:c="center",alignOffset:d=0,arrowPadding:h=0,avoidCollisions:m=!0,collisionBoundary:x=[],collisionPadding:g=0,sticky:v="partial",hideWhenDetached:S=!1,updatePositionStrategy:b="optimized",onPlaced:j,...C}=t,k=yj(bj,r),[N,E]=p.useState(null),R=Je(n,E),[A,_]=p.useState(null),z=nf(A),D=(z==null?void 0:z.width)??0,V=(z==null?void 0:z.height)??0,I=i+(c!=="center"?"-"+c:""),Q=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},B=Array.isArray(x)?x:[x],H=B.length>0,ee={padding:Q,boundary:B.filter(wj),altBoundary:H},{refs:W,floatingStyles:M,placement:U,isPositioned:K,middlewareData:ne}=r4({strategy:"fixed",placement:I,whileElementsMounted:Ka((...Se)=>G$(...Se,{animationFrame:b==="always"}),"whileElementsMounted"),elements:{reference:k.anchor},middleware:[a4({mainAxis:o+V,alignmentAxis:d}),m&&i4({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?o4():void 0,...ee}),m&&l4({...ee}),c4({...ee,apply:Ka(({elements:Se,rects:ye,availableWidth:Qe,availableHeight:nt})=>{const{width:re,height:_e}=ye.reference,Pe=Se.floating.style;Pe.setProperty("--radix-popper-available-width",`${Qe}px`),Pe.setProperty("--radix-popper-available-height",`${nt}px`),Pe.setProperty("--radix-popper-anchor-width",`${re}px`),Pe.setProperty("--radix-popper-anchor-height",`${_e}px`)},"apply")}),A&&d4({element:A,padding:h}),y4({arrowWidth:D,arrowHeight:V}),S&&u4({strategy:"referenceHidden",...ee,boundary:H?ee.boundary:void 0})]}),q=k.setPlacementState;Vt(()=>(q(U),()=>{q(void 0)}),[U,q]);const[P,L]=pf(U),G=rn(j);Vt(()=>{K&&(G==null||G())},[K,G]);const J=(Z=ne.arrow)==null?void 0:Z.x,$=(ve=ne.arrow)==null?void 0:ve.y,se=((Ee=ne.arrow)==null?void 0:Ee.centerOffset)!==0,[oe,ie]=p.useState();return Vt(()=>{N&&ie(window.getComputedStyle(N).zIndex)},[N]),l.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:K?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:oe,"--radix-popper-transform-origin":[(Te=ne.transformOrigin)==null?void 0:Te.x,(Ie=ne.transformOrigin)==null?void 0:Ie.y].join(" "),...((Fe=ne.hide)==null?void 0:Fe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:l.jsx(x4,{scope:r,placedSide:P,placedAlign:L,onArrowChange:_,arrowX:J,arrowY:$,shouldHideArrow:se,children:l.jsx(qe.div,{"data-side":P,"data-align":L,...C,ref:R,style:{...C.style,animation:K?(fe=C.style)==null?void 0:fe.animation:"none"}})})})},"PopperContent"));function wj(e){return e!==null}Ka(wj,"isNotNull");var y4=Ka(e=>({name:"transformOrigin",options:e,fn(t){var C,k,N;const{placement:n,rects:r,middlewareData:i}=t,c=((C=i.arrow)==null?void 0:C.centerOffset)!==0,d=c?0:e.arrowWidth,h=c?0:e.arrowHeight,[m,x]=pf(n),g={start:"0%",center:"50%",end:"100%"}[x],v=(((k=i.arrow)==null?void 0:k.x)??0)+d/2,S=(((N=i.arrow)==null?void 0:N.y)??0)+h/2;let b="",j="";return m==="bottom"?(b=c?g:`${v}px`,j=`${-h}px`):m==="top"?(b=c?g:`${v}px`,j=`${r.floating.height+h}px`):m==="right"?(b=`${-h}px`,j=c?g:`${S}px`):m==="left"&&(b=`${r.floating.width+h}px`,j=c?g:`${S}px`),{data:{x:b,y:j}}}}),"transformOrigin");function pf(e){const[t,n="center"]=e.split("-");return[t,n]}Ka(pf,"getSideAndAlignFromPlacement");var el=m4,_c=g4,Oc=v4,b4=Object.defineProperty,jg=(e,t)=>b4(e,"name",{value:t,configurable:!0}),Cg=!1;function Sj(){const[e,t]=p.useState(Cg);return p.useEffect(()=>{Cg||(Cg=!0,t(!0))},[]),e}jg(Sj,"useIsHydrated");var jj=Mo[" useSyncExternalStore ".trim().toString()];function Cj(){return()=>{}}jg(Cj,"subscribe");function kj(){return jj(Cj,()=>!0,()=>!1)}jg(kj,"useIsHydratedModern");var w4=typeof jj=="function"?kj:Sj,S4=Object.defineProperty,Yi=(e,t)=>S4(e,"name",{value:t,configurable:!0}),kg="rovingFocusGroup.onEntryFocus",j4={bubbles:!1,cancelable:!0},gf="RovingFocusGroup",[Ng,Nj,C4]=Sc(gf),[k4,Tj]=bn(gf,[C4]),[N4,T4]=k4(gf),E4=p.forwardRef(Yi(function(t,n){return l.jsx(Ng.Provider,{scope:t.__scopeRovingFocusGroup,children:l.jsx(Ng.Slot,{scope:t.__scopeRovingFocusGroup,children:l.jsx(R4,{...t,ref:n})})})},"RovingFocusGroup")),R4=p.forwardRef(Yi(function(t,n){const{__scopeRovingFocusGroup:r,orientation:i,loop:o=!1,dir:c,currentTabStopId:d,defaultCurrentTabStopId:h,onCurrentTabStopIdChange:m,onEntryFocus:x,preventScrollOnEntryFocus:g=!1,...v}=t,S=p.useRef(null),b=Je(n,S),j=Uo(c),[C,k]=Kn({prop:d,defaultProp:h??null,onChange:m,caller:gf}),[N,E]=p.useState(!1),R=rn(x),A=Nj(r),_=p.useRef(!1),[z,D]=p.useState(0);return p.useEffect(()=>{const V=S.current;if(V)return V.addEventListener(kg,R),()=>V.removeEventListener(kg,R)},[R]),l.jsx(N4,{scope:r,orientation:i,dir:j,loop:o,currentTabStopId:C,onItemFocus:p.useCallback(V=>k(V),[k]),onItemShiftTab:p.useCallback(()=>E(!0),[]),onFocusableItemAdd:p.useCallback(()=>D(V=>V+1),[]),onFocusableItemRemove:p.useCallback(()=>D(V=>V-1),[]),children:l.jsx(qe.div,{tabIndex:N||z===0?-1:0,"data-orientation":i,...v,ref:b,style:{outline:"none",...t.style},onMouseDown:Ce(t.onMouseDown,()=>{_.current=!0}),onFocus:Ce(t.onFocus,V=>{const I=!_.current;if(V.target===V.currentTarget&&I&&!N){const Q=new CustomEvent(kg,j4);if(V.currentTarget.dispatchEvent(Q),!Q.defaultPrevented){const B=A().filter(U=>U.focusable),H=B.find(U=>U.active),ee=B.find(U=>U.id===C),M=[H,ee,...B].filter(Boolean).map(U=>U.ref.current);Tg(M,g)}}_.current=!1}),onBlur:Ce(t.onBlur,()=>E(!1))})})},"RovingFocusGroupImpl")),A4="RovingFocusGroupItem",M4=p.forwardRef(Yi(function(t,n){const{__scopeRovingFocusGroup:r,focusable:i=!0,active:o=!1,tabStopId:c,children:d,...h}=t,m=cn(),x=c||m,g=T4(A4,r),v=g.currentTabStopId===x,S=Nj(r),{onFocusableItemAdd:b,onFocusableItemRemove:j,currentTabStopId:C}=g,k=w4();return Vt(()=>{if(!(!k||!i))return b(),()=>j()},[k,i,b,j]),p.useEffect(()=>{if(!(k||!i))return b(),()=>j()},[k,i,b,j]),l.jsx(Ng.ItemSlot,{scope:r,id:x,focusable:i,active:o,children:l.jsx(qe.span,{tabIndex:v?0:-1,"data-orientation":g.orientation,...h,ref:n,onMouseDown:Ce(t.onMouseDown,N=>{i?g.onItemFocus(x):N.preventDefault()}),onFocus:Ce(t.onFocus,()=>g.onItemFocus(x)),onKeyDown:Ce(t.onKeyDown,N=>{if(N.key==="Tab"&&N.shiftKey){g.onItemShiftTab();return}if(N.target!==N.currentTarget)return;const E=Rj(N,g.orientation,g.dir);if(E!==void 0){if(N.metaKey||N.ctrlKey||N.altKey||N.shiftKey)return;N.preventDefault();let A=S().filter(_=>_.focusable).map(_=>_.ref.current);if(E==="last")A.reverse();else if(E==="prev"||E==="next"){E==="prev"&&A.reverse();const _=A.indexOf(N.currentTarget);A=g.loop?Aj(A,_+1):A.slice(_+1)}setTimeout(()=>Tg(A))}}),children:typeof d=="function"?d({isCurrentTabStop:v,hasTabStop:C!=null}):d})})},"RovingFocusGroupItem")),D4={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ej(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Yi(Ej,"getDirectionAwareKey");function Rj(e,t,n){const r=Ej(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return D4[r]}Yi(Rj,"getFocusIntent");function Tg(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Yi(Tg,"focusFirst");function Aj(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Yi(Aj,"wrapArray");var _4=E4,O4=M4,z4=Object.defineProperty,wt=(e,t)=>z4(e,"name",{value:t,configurable:!0}),Eg=["Enter"," "],P4=["ArrowDown","PageUp","Home"],Mj=["ArrowUp","PageDown","End"],L4=[...P4,...Mj],I4={ltr:[...Eg,"ArrowRight"],rtl:[...Eg,"ArrowLeft"]},$4={ltr:["ArrowLeft"],rtl:["ArrowRight"]},xf="Menu",[zc,B4,U4]=Sc(xf),[Wi,vf]=bn(xf,[U4,_s,Tj]),yf=_s(),Dj=Tj(),[_j,Ga]=Wi(xf),[V4,Pc]=Wi(xf),F4=wt(e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:c=!0}=e,d=yf(t),[h,m]=p.useState(null),x=p.useRef(!1),g=rn(o),v=Uo(i);return p.useEffect(()=>{const S=wt(()=>{x.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},"handleKeyDown"),b=wt(()=>x.current=!1,"handlePointer");return document.addEventListener("keydown",S,{capture:!0}),()=>{document.removeEventListener("keydown",S,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),p.useEffect(()=>{if(!n)return;const S=wt(()=>g(!1),"handleBlur");return window.addEventListener("blur",S),()=>window.removeEventListener("blur",S)},[n,g]),l.jsx(el,{...d,children:l.jsx(_j,{scope:t,open:n,onOpenChange:g,content:h,onContentChange:m,children:l.jsx(V4,{scope:t,onClose:p.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:x,dir:v,modal:c,children:r})})})},"Menu"),Oj=p.forwardRef(wt(function(t,n){const{__scopeMenu:r,...i}=t,o=yf(r);return l.jsx(_c,{...o,...i,ref:n})},"MenuAnchor")),zj="MenuPortal",[H4,Pj]=Wi(zj,{forceMount:void 0}),q4=wt(e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=Ga(zj,t);return l.jsx(H4,{scope:t,forceMount:n,children:l.jsx(wn,{present:n||o.open,children:l.jsx(Fo,{asChild:!0,container:i,children:r})})})},"MenuPortal"),ds="MenuContent",[K4,Rg]=Wi(ds),G4=p.forwardRef(wt(function(t,n){const r=Pj(ds,t.__scopeMenu),{forceMount:i=r.forceMount,...o}=t,c=Ga(ds,t.__scopeMenu),d=Pc(ds,t.__scopeMenu);return l.jsx(zc.Provider,{scope:t.__scopeMenu,children:l.jsx(wn,{present:i||c.open,children:l.jsx(zc.Slot,{scope:t.__scopeMenu,children:d.modal?l.jsx(Y4,{...o,ref:n}):l.jsx(W4,{...o,ref:n})})})})},"MenuContent")),Y4=p.forwardRef(wt(function(t,n){const r=Ga(ds,t.__scopeMenu),i=p.useRef(null),o=Je(n,i);return p.useEffect(()=>{const c=i.current;if(c)return ef(c)},[]),l.jsx(Ag,{...t,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Ce(t.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),W4=p.forwardRef(wt(function(t,n){const r=Ga(ds,t.__scopeMenu);return l.jsx(Ag,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),X4=cs("MenuContent.ScrollLock"),Ag=p.forwardRef(wt(function(t,n){const{__scopeMenu:r,loop:i=!1,trapFocus:o,onOpenAutoFocus:c,onCloseAutoFocus:d,disableOutsidePointerEvents:h,onEntryFocus:m,onEscapeKeyDown:x,onPointerDownOutside:g,onFocusOutside:v,onInteractOutside:S,onDismiss:b,disableOutsideScroll:j,...C}=t,k=Ga(ds,r),N=Pc(ds,r),E=yf(r),R=Dj(r),A=B4(r),[_,z]=p.useState(null),D=p.useRef(null),V=Je(n,D,k.onContentChange),I=p.useRef(0),Q=p.useRef(""),B=p.useRef(0),H=p.useRef(null),ee=p.useRef("right"),W=p.useRef(0),M=j?kc:p.Fragment,U=j?{as:X4,allowPinchZoom:!0}:void 0,K=wt(q=>{var ie,Z;const P=Q.current+q,L=A().filter(ve=>!ve.disabled),G=document.activeElement,J=(ie=L.find(ve=>ve.ref.current===G))==null?void 0:ie.textValue,$=L.map(ve=>ve.textValue),se=qj($,P,J),oe=(Z=L.find(ve=>ve.textValue===se))==null?void 0:Z.ref.current;wt((function ve(Ee){Q.current=Ee,window.clearTimeout(I.current),Ee!==""&&(I.current=window.setTimeout(()=>ve(""),1e3))}),"updateSearch")(P),oe&&setTimeout(()=>oe.focus())},"handleTypeaheadSearch");p.useEffect(()=>()=>window.clearTimeout(I.current),[]),Ho();const ne=p.useCallback(q=>{var L,G;return ee.current===((L=H.current)==null?void 0:L.side)&&Gj(q,(G=H.current)==null?void 0:G.area)},[]);return l.jsx(K4,{scope:r,searchRef:Q,onItemEnter:p.useCallback(q=>{ne(q)&&q.preventDefault()},[ne]),onItemLeave:p.useCallback(q=>{var P;ne(q)||((P=D.current)==null||P.focus(),z(null))},[ne]),onTriggerLeave:p.useCallback(q=>{ne(q)&&q.preventDefault()},[ne]),pointerGraceTimerRef:B,onPointerGraceIntentChange:p.useCallback(q=>{H.current=q},[]),children:l.jsx(M,{...U,children:l.jsx(qd,{asChild:!0,trapped:o,onMountAutoFocus:Ce(c,q=>{var P;q.preventDefault(),(P=D.current)==null||P.focus({preventScroll:!0})}),onUnmountAutoFocus:d,children:l.jsx(Vo,{asChild:!0,disableOutsidePointerEvents:h,onEscapeKeyDown:x,onPointerDownOutside:g,onFocusOutside:v,onInteractOutside:S,onDismiss:b,children:l.jsx(_4,{asChild:!0,...R,dir:N.dir,orientation:"vertical",loop:i,currentTabStopId:_,onCurrentTabStopIdChange:z,onEntryFocus:Ce(m,q=>{N.isUsingKeyboardRef.current||q.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(Oc,{role:"menu","aria-orientation":"vertical","data-state":_g(k.open),"data-radix-menu-content":"",dir:N.dir,...E,...C,ref:V,style:{outline:"none",...C.style},onKeyDown:Ce(C.onKeyDown,q=>{const L=q.target.closest("[data-radix-menu-content]")===q.currentTarget,G=q.ctrlKey||q.altKey||q.metaKey,J=q.key.length===1;L&&(q.key==="Tab"&&q.preventDefault(),!G&&J&&K(q.key));const $=D.current;if(q.target!==$||!L4.includes(q.key))return;q.preventDefault();const oe=A().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);Mj.includes(q.key)&&oe.reverse(),Fj(oe)}),onBlur:Ce(t.onBlur,q=>{q.currentTarget.contains(q.target)||(window.clearTimeout(I.current),Q.current="")}),onPointerMove:Ce(t.onPointerMove,tl(q=>{const P=q.target,L=W.current!==q.clientX;if(q.currentTarget.contains(P)&&L){const G=q.clientX>W.current?"right":"left";ee.current=G,W.current=q.clientX}}))})})})})})})},"MenuContentImpl")),Q4=p.forwardRef(wt(function(t,n){const{__scopeMenu:r,...i}=t;return l.jsx(qe.div,{...i,ref:n})},"MenuLabel")),Mg="MenuItem",Lj="menu.itemSelect",Dg=p.forwardRef(wt(function(t,n){const{disabled:r=!1,onSelect:i,...o}=t,c=p.useRef(null),d=Pc(Mg,t.__scopeMenu),h=Rg(Mg,t.__scopeMenu),m=Je(n,c),x=p.useRef(!1),g=wt(()=>{const v=c.current;if(!r&&v){const S=new CustomEvent(Lj,{bubbles:!0,cancelable:!0});v.addEventListener(Lj,b=>i==null?void 0:i(b),{once:!0}),Bp(v,S),S.defaultPrevented?x.current=!1:d.onClose()}},"handleSelect");return l.jsx(Ij,{...o,ref:m,disabled:r,onClick:Ce(t.onClick,g),onPointerDown:v=>{var S;(S=t.onPointerDown)==null||S.call(t,v),x.current=!0},onPointerUp:Ce(t.onPointerUp,v=>{var S;x.current||(S=v.currentTarget)==null||S.click()}),onKeyDown:Ce(t.onKeyDown,v=>{r||v.target!==v.currentTarget||h.searchRef.current!==""&&v.key===" "||Eg.includes(v.key)&&(v.currentTarget.click(),v.preventDefault())})})},"MenuItem")),Ij=p.forwardRef(wt(function(t,n){const{__scopeMenu:r,disabled:i=!1,textValue:o,...c}=t,d=Rg(Mg,r),h=Dj(r),m=p.useRef(null),x=Je(n,m),[g,v]=p.useState(!1),[S,b]=p.useState("");return p.useEffect(()=>{const j=m.current;j&&b((j.textContent??"").trim())},[c.children]),l.jsx(zc.ItemSlot,{scope:r,disabled:i,textValue:o??S,children:l.jsx(O4,{asChild:!0,...h,focusable:!i,children:l.jsx(qe.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":i||void 0,"data-disabled":i?"":void 0,...c,ref:x,onPointerMove:Ce(t.onPointerMove,tl(j=>{i?d.onItemLeave(j):(d.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ce(t.onPointerLeave,tl(j=>d.onItemLeave(j))),onFocus:Ce(t.onFocus,()=>v(!0)),onBlur:Ce(t.onBlur,()=>v(!1))})})})},"MenuItemImpl")),Z4=p.forwardRef(wt(function(t,n){const{checked:r=!1,onCheckedChange:i,...o}=t;return l.jsx(Bj,{scope:t.__scopeMenu,checked:r,children:l.jsx(Dg,{role:"menuitemcheckbox","aria-checked":Lc(r)?"mixed":r,...o,ref:n,"data-state":wf(r),onSelect:Ce(o.onSelect,()=>i==null?void 0:i(Lc(r)?!0:!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),J4="MenuRadioGroup",[Ste,eB]=Wi(J4,{value:void 0,onValueChange:wt(()=>{},"onValueChange")}),tB="MenuRadioItem",nB=p.forwardRef(wt(function(t,n){const{value:r,...i}=t,o=eB(tB,t.__scopeMenu),c=r===o.value;return l.jsx(Bj,{scope:t.__scopeMenu,checked:c,children:l.jsx(Dg,{role:"menuitemradio","aria-checked":c,...i,ref:n,"data-state":wf(c),onSelect:Ce(i.onSelect,()=>{var d;return(d=o.onValueChange)==null?void 0:d.call(o,r)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),$j="MenuItemIndicator",[Bj,rB]=Wi($j,{checked:!1}),sB=p.forwardRef(wt(function(t,n){const{__scopeMenu:r,forceMount:i,...o}=t,c=rB($j,r);return l.jsx(wn,{present:i||Lc(c.checked)||c.checked===!0,children:l.jsx(qe.span,{...o,ref:n,"data-state":wf(c.checked)})})},"MenuItemIndicator")),aB=p.forwardRef(wt(function(t,n){const{__scopeMenu:r,...i}=t;return l.jsx(qe.div,{role:"separator","aria-orientation":"horizontal",...i,ref:n})},"MenuSeparator")),Uj="MenuSub",[iB,Vj]=Wi(Uj),oB=wt(e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,o=Ga(Uj,t),c=yf(t),[d,h]=p.useState(null),[m,x]=p.useState(null),g=rn(i);return p.useEffect(()=>(o.open===!1&&g(!1),()=>g(!1)),[o.open,g]),l.jsx(el,{...c,children:l.jsx(_j,{scope:t,open:r,onOpenChange:g,content:m,onContentChange:x,children:l.jsx(iB,{scope:t,contentId:cn(),triggerId:cn(),trigger:d,onTriggerChange:h,children:n})})})},"MenuSub"),bf="MenuSubTrigger",lB=p.forwardRef(wt(function(t,n){const r=Ga(bf,t.__scopeMenu),i=Pc(bf,t.__scopeMenu),o=Vj(bf,t.__scopeMenu),c=Rg(bf,t.__scopeMenu),d=p.useRef(null),{pointerGraceTimerRef:h,onPointerGraceIntentChange:m}=c,x={__scopeMenu:t.__scopeMenu},g=p.useCallback(()=>{d.current&&window.clearTimeout(d.current),d.current=null},[]);p.useEffect(()=>g,[g]),p.useEffect(()=>{const S=h.current;return()=>{window.clearTimeout(S),m(null)}},[h,m]);const v=Je(n,o.onTriggerChange);return l.jsx(Oj,{asChild:!0,...x,children:l.jsx(Ij,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?o.contentId:void 0,"data-state":_g(r.open),...t,ref:v,onClick:S=>{var b;(b=t.onClick)==null||b.call(t,S),!(t.disabled||S.defaultPrevented)&&(S.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Ce(t.onPointerMove,tl(S=>{c.onItemEnter(S),!S.defaultPrevented&&!t.disabled&&!r.open&&!d.current&&(c.onPointerGraceIntentChange(null),d.current=window.setTimeout(()=>{r.onOpenChange(!0),g()},100))})),onPointerLeave:Ce(t.onPointerLeave,tl(S=>{var j,C;g();const b=(j=r.content)==null?void 0:j.getBoundingClientRect();if(b){const k=(C=r.content)==null?void 0:C.dataset.side,N=k==="right",E=N?-5:5,R=b[N?"left":"right"],A=b[N?"right":"left"];c.onPointerGraceIntentChange({area:[{x:S.clientX+E,y:S.clientY},{x:R,y:b.top},{x:A,y:b.top},{x:A,y:b.bottom},{x:R,y:b.bottom}],side:k}),window.clearTimeout(h.current),h.current=window.setTimeout(()=>c.onPointerGraceIntentChange(null),300)}else{if(c.onTriggerLeave(S),S.defaultPrevented)return;c.onPointerGraceIntentChange(null)}})),onKeyDown:Ce(t.onKeyDown,S=>{var j;t.disabled||S.target!==S.currentTarget||c.searchRef.current!==""&&S.key===" "||I4[i.dir].includes(S.key)&&(r.onOpenChange(!0),(j=r.content)==null||j.focus(),S.preventDefault())})})})},"MenuSubTrigger")),cB="MenuSubContent",uB=p.forwardRef(wt(function(t,n){const r=Pj(ds,t.__scopeMenu),{forceMount:i=r.forceMount,align:o="start",...c}=t,d=Ga(ds,t.__scopeMenu),h=Pc(ds,t.__scopeMenu),m=Vj(cB,t.__scopeMenu),x=p.useRef(null),g=Je(n,x);return l.jsx(zc.Provider,{scope:t.__scopeMenu,children:l.jsx(wn,{present:i||d.open,children:l.jsx(zc.Slot,{scope:t.__scopeMenu,children:l.jsx(Ag,{id:m.contentId,"aria-labelledby":m.triggerId,...c,ref:g,align:o,side:h.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:v=>{var S;h.isUsingKeyboardRef.current&&((S=x.current)==null||S.focus()),v.preventDefault()},onCloseAutoFocus:v=>v.preventDefault(),onFocusOutside:Ce(t.onFocusOutside,v=>{v.target!==m.trigger&&d.onOpenChange(!1)}),onEscapeKeyDown:Ce(t.onEscapeKeyDown,v=>{h.onClose(),v.preventDefault()}),onKeyDown:Ce(t.onKeyDown,v=>{var j;const S=v.currentTarget.contains(v.target),b=$4[h.dir].includes(v.key);S&&b&&(d.onOpenChange(!1),(j=m.trigger)==null||j.focus(),v.preventDefault())})})})})})},"MenuSubContent"));function _g(e){return e?"open":"closed"}wt(_g,"getOpenState");function Lc(e){return e==="indeterminate"}wt(Lc,"isIndeterminate");function wf(e){return Lc(e)?"indeterminate":e?"checked":"unchecked"}wt(wf,"getCheckedState");function Fj(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}wt(Fj,"focusFirst");function Hj(e,t){return e.map((n,r)=>e[(t+r)%e.length])}wt(Hj,"wrapArray");function qj(e,t,n){const i=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let c=Hj(e,Math.max(o,0));i.length===1&&(c=c.filter(m=>m!==n));const h=c.find(m=>m.toLowerCase().startsWith(i.toLowerCase()));return h!==n?h:void 0}wt(qj,"getNextMatch");function Kj(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,c=t.length-1;o<t.length;c=o++){const d=t[o],h=t[c],m=d.x,x=d.y,g=h.x,v=h.y;x>r!=v>r&&n<(g-m)*(r-x)/(v-x)+m&&(i=!i)}return i}wt(Kj,"isPointInPolygon");function Gj(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Kj(n,t)}wt(Gj,"isPointerInGraceArea");function tl(e){return t=>t.pointerType==="mouse"?e(t):void 0}wt(tl,"whenMouse");var Yj=F4,Wj=Oj,Xj=q4,Qj=G4,Zj=Q4,Jj=Dg,eC=Z4,tC=nB,nC=sB,rC=aB,sC=oB,aC=lB,iC=uB,dB=Object.defineProperty,Bn=(e,t)=>dB(e,"name",{value:t,configurable:!0}),Og="ContextMenu",[fB,jte]=bn(Og,[vf]),Cr=vf(),[hB,oC]=fB(Og),mB=Bn(e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,dir:o,modal:c=!0}=e,d=p.useRef(!1),[h,m]=Kn({prop:i,defaultProp:!1,onChange:r,caller:Og}),x=Cr(t);return l.jsx(hB,{scope:t,open:h,onOpenChange:m,modal:c,hasInteractedRef:d,children:l.jsx(Yj,{...x,dir:o,open:h,onOpenChange:m,modal:c,children:n})})},"ContextMenu"),pB="ContextMenuTrigger",gB=p.forwardRef(Bn(function(t,n){const{__scopeContextMenu:r,disabled:i=!1,...o}=t,c=oC(pB,r),d=Cr(r),[h,m]=p.useState({x:0,y:0}),x=p.useMemo(()=>({current:{getBoundingClientRect:Bn(()=>DOMRect.fromRect({width:0,height:0,...h}),"getBoundingClientRect")}}),[h]),g=p.useRef(0),v=p.useCallback(()=>window.clearTimeout(g.current),[]),S=Bn(b=>{c.hasInteractedRef.current=!0,m({x:b.clientX,y:b.clientY}),c.onOpenChange(!0)},"handleOpen");return p.useEffect(()=>v,[v]),p.useEffect(()=>void(i&&v()),[i,v]),l.jsxs(l.Fragment,{children:[l.jsx(Wj,{...d,virtualRef:x}),l.jsx(qe.span,{"data-state":c.open?"open":"closed","data-disabled":i?"":void 0,...o,ref:n,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:i?t.onContextMenu:Ce(t.onContextMenu,b=>{v(),S(b),b.preventDefault()}),onPointerDown:i?t.onPointerDown:Ce(t.onPointerDown,Ic(b=>{v(),c.open&&c.onOpenChange(!1),g.current=window.setTimeout(()=>S(b),700)})),onPointerMove:i?t.onPointerMove:Ce(t.onPointerMove,Ic(v)),onPointerCancel:i?t.onPointerCancel:Ce(t.onPointerCancel,Ic(v)),onPointerUp:i?t.onPointerUp:Ce(t.onPointerUp,Ic(v))})]})},"ContextMenuTrigger")),xB=Bn(e=>{const{__scopeContextMenu:t,...n}=e,r=Cr(t);return l.jsx(Xj,{...r,...n})},"ContextMenuPortal"),vB="ContextMenuContent",yB=p.forwardRef(Bn(function(t,n){const{__scopeContextMenu:r,...i}=t,o=oC(vB,r),c=Cr(r),d=p.useRef(!1);return l.jsx(Qj,{...c,...i,ref:n,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:h=>{var m;(m=t.onCloseAutoFocus)==null||m.call(t,h),!h.defaultPrevented&&d.current&&h.preventDefault(),d.current=!1},onInteractOutside:h=>{var m;(m=t.onInteractOutside)==null||m.call(t,h),!h.defaultPrevented&&!o.modal&&(d.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuContent")),bB=p.forwardRef(Bn(function(t,n){const{__scopeContextMenu:r,...i}=t,o=Cr(r);return l.jsx(Zj,{...o,...i,ref:n})},"ContextMenuLabel")),wB=p.forwardRef(Bn(function(t,n){const{__scopeContextMenu:r,...i}=t,o=Cr(r);return l.jsx(Jj,{...o,...i,ref:n})},"ContextMenuItem")),SB=p.forwardRef(Bn(function(t,n){const{__scopeContextMenu:r,...i}=t,o=Cr(r);return l.jsx(eC,{...o,...i,ref:n})},"ContextMenuCheckboxItem")),jB=p.forwardRef(Bn(function(t,n){const{__scopeContextMenu:r,...i}=t,o=Cr(r);return l.jsx(tC,{...o,...i,ref:n})},"ContextMenuRadioItem")),CB=p.forwardRef(Bn(function(t,n){const{__scopeContextMenu:r,...i}=t,o=Cr(r);return l.jsx(nC,{...o,...i,ref:n})},"ContextMenuItemIndicator")),kB=p.forwardRef(Bn(function(t,n){const{__scopeContextMenu:r,...i}=t,o=Cr(r);return l.jsx(rC,{...o,...i,ref:n})},"ContextMenuSeparator")),NB="ContextMenuSub",TB=Bn(e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,defaultOpen:o}=e,c=Cr(t),[d,h]=Kn({prop:i,defaultProp:o??!1,onChange:r,caller:NB});return l.jsx(sC,{...c,open:d,onOpenChange:h,children:n})},"ContextMenuSub"),EB=p.forwardRef(Bn(function(t,n){const{__scopeContextMenu:r,...i}=t,o=Cr(r);return l.jsx(aC,{...o,...i,ref:n})},"ContextMenuSubTrigger")),RB=p.forwardRef(Bn(function(t,n){const{__scopeContextMenu:r,...i}=t,o=Cr(r);return l.jsx(iC,{...o,...i,ref:n,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuSubContent"));function Ic(e){return t=>t.pointerType!=="mouse"?e(t):void 0}Bn(Ic,"whenTouchOrPen");var AB=mB,MB=gB,lC=xB,DB=yB,_B=bB,OB=wB,zB=SB,PB=jB,cC=CB,LB=kB,IB=TB,$B=EB,BB=RB,UB=Object.defineProperty,kr=(e,t)=>UB(e,"name",{value:t,configurable:!0}),zg="DropdownMenu",[VB,Cte]=bn(zg,[vf]),Nr=vf(),[FB,uC]=VB(zg),HB=kr(e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:c,modal:d=!0}=e,h=Nr(t),m=p.useRef(null),[x,g]=Kn({prop:i,defaultProp:o??!1,onChange:c,caller:zg});return l.jsx(FB,{scope:t,triggerId:cn(),triggerRef:m,contentId:cn(),open:x,onOpenChange:g,onOpenToggle:p.useCallback(()=>g(v=>!v),[g]),modal:d,children:l.jsx(Yj,{...h,open:x,onOpenChange:g,dir:r,modal:d,children:n})})},"DropdownMenu"),qB="DropdownMenuTrigger",KB=p.forwardRef(kr(function(t,n){const{__scopeDropdownMenu:r,disabled:i=!1,...o}=t,c=uC(qB,r),d=Nr(r),h=Je(n,c.triggerRef);return l.jsx(Wj,{asChild:!0,...d,children:l.jsx(qe.button,{type:"button",id:c.triggerId,"aria-haspopup":"menu","aria-expanded":c.open,"aria-controls":c.open?c.contentId:void 0,"data-state":c.open?"open":"closed","data-disabled":i?"":void 0,disabled:i,...o,ref:h,onPointerDown:Ce(t.onPointerDown,m=>{!i&&m.button===0&&m.ctrlKey===!1&&(c.onOpenToggle(),c.open||m.preventDefault())}),onKeyDown:Ce(t.onKeyDown,m=>{i||(["Enter"," "].includes(m.key)&&c.onOpenToggle(),m.key==="ArrowDown"&&c.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(m.key)&&m.preventDefault())})})})},"DropdownMenuTrigger")),GB=kr(e=>{const{__scopeDropdownMenu:t,...n}=e,r=Nr(t);return l.jsx(Xj,{...r,...n})},"DropdownMenuPortal"),YB="DropdownMenuContent",WB=p.forwardRef(kr(function(t,n){const{__scopeDropdownMenu:r,...i}=t,o=uC(YB,r),c=Nr(r),d=p.useRef(!1);return l.jsx(Qj,{id:o.contentId,"aria-labelledby":o.triggerId,...c,...i,ref:n,onCloseAutoFocus:Ce(t.onCloseAutoFocus,h=>{var m;d.current||(m=o.triggerRef.current)==null||m.focus(),d.current=!1,h.preventDefault()}),onInteractOutside:Ce(t.onInteractOutside,h=>{const m=h.detail.originalEvent,x=m.button===0&&m.ctrlKey===!0,g=m.button===2||x;(!o.modal||g)&&(d.current=!0)}),style:{...t.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")),XB=p.forwardRef(kr(function(t,n){const{__scopeDropdownMenu:r,...i}=t,o=Nr(r);return l.jsx(Zj,{...o,...i,ref:n})},"DropdownMenuLabel")),QB=p.forwardRef(kr(function(t,n){const{__scopeDropdownMenu:r,...i}=t,o=Nr(r);return l.jsx(Jj,{...o,...i,ref:n})},"DropdownMenuItem")),ZB=p.forwardRef(kr(function(t,n){const{__scopeDropdownMenu:r,...i}=t,o=Nr(r);return l.jsx(eC,{...o,...i,ref:n})},"DropdownMenuCheckboxItem")),JB=p.forwardRef(kr(function(t,n){const{__scopeDropdownMenu:r,...i}=t,o=Nr(r);return l.jsx(tC,{...o,...i,ref:n})},"DropdownMenuRadioItem")),eU=p.forwardRef(kr(function(t,n){const{__scopeDropdownMenu:r,...i}=t,o=Nr(r);return l.jsx(nC,{...o,...i,ref:n})},"DropdownMenuItemIndicator")),tU=p.forwardRef(kr(function(t,n){const{__scopeDropdownMenu:r,...i}=t,o=Nr(r);return l.jsx(rC,{...o,...i,ref:n})},"DropdownMenuSeparator")),nU=kr(e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:o}=e,c=Nr(t),[d,h]=Kn({prop:r,defaultProp:o??!1,onChange:i,caller:"DropdownMenuSub"});return l.jsx(sC,{...c,open:d,onOpenChange:h,children:n})},"DropdownMenuSub"),rU=p.forwardRef(kr(function(t,n){const{__scopeDropdownMenu:r,...i}=t,o=Nr(r);return l.jsx(aC,{...o,...i,ref:n})},"DropdownMenuSubTrigger")),sU=p.forwardRef(kr(function(t,n){const{__scopeDropdownMenu:r,...i}=t,o=Nr(r);return l.jsx(iC,{...o,...i,ref:n,style:{...t.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)"}})},"DropdownMenuSubContent")),dC=HB,fC=KB,Sf=GB,hC=WB,mC=XB,pC=QB,gC=ZB,xC=JB,jf=eU,vC=tU,aU=nU,yC=rU,bC=sU,iU=Object.defineProperty,ia=(e,t)=>iU(e,"name",{value:t,configurable:!0}),Pg,Lg="HoverCard",[wC,kte]=bn(Lg,[_s]),Ig=_s(),[oU,Cf]=wC(Lg),lU=ia(e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:i,onOpenChange:o,openDelay:c=700,closeDelay:d=300}=e,h=Ig(t),m=p.useRef(0),x=p.useRef(0),g=p.useRef(!1),v=p.useRef(!1),[S,b]=Kn({prop:r,defaultProp:i??!1,onChange:o,caller:Lg}),j=p.useCallback(()=>{clearTimeout(x.current),m.current=window.setTimeout(()=>b(!0),c)},[c,b]),C=p.useCallback(()=>{clearTimeout(m.current),!g.current&&!v.current&&(x.current=window.setTimeout(()=>b(!1),d))},[d,b]),k=p.useCallback(()=>b(!1),[b]);return p.useEffect(()=>()=>{clearTimeout(m.current),clearTimeout(x.current)},[]),l.jsx(oU,{scope:t,open:S,onOpenChange:b,onOpen:j,onClose:C,onDismiss:k,hasSelectionRef:g,isPointerDownOnContentRef:v,children:l.jsx(el,{...h,children:n})})},"HoverCard"),cU="HoverCardTrigger",uU=p.forwardRef(ia(function(t,n){const{__scopeHoverCard:r,...i}=t,o=Cf(cU,r),c=Ig(r);return l.jsx(_c,{asChild:!0,...c,children:l.jsx(qe.a,{"data-state":o.open?"open":"closed",...i,ref:n,onPointerEnter:Ce(t.onPointerEnter,$c(o.onOpen)),onPointerLeave:Ce(t.onPointerLeave,$c(o.onClose)),onFocus:Ce(t.onFocus,o.onOpen),onBlur:Ce(t.onBlur,o.onClose),onTouchStart:Ce(t.onTouchStart,d=>d.preventDefault())})})},"HoverCardTrigger")),SC="HoverCardPortal",[dU,fU]=wC(SC,{forceMount:void 0}),hU=ia(e=>{const{__scopeHoverCard:t,forceMount:n,children:r,container:i}=e,o=Cf(SC,t);return l.jsx(dU,{scope:t,forceMount:n,children:l.jsx(wn,{present:n||o.open,children:l.jsx(Fo,{asChild:!0,container:i,children:r})})})},"HoverCardPortal"),$g="HoverCardContent",mU=p.forwardRef(ia(function(t,n){const r=fU($g,t.__scopeHoverCard),{forceMount:i=r.forceMount,...o}=t,c=Cf($g,t.__scopeHoverCard);return l.jsx(wn,{present:i||c.open,children:l.jsx(pU,{"data-state":c.open?"open":"closed",...o,onPointerEnter:Ce(t.onPointerEnter,$c(c.onOpen)),onPointerLeave:Ce(t.onPointerLeave,$c(c.onClose)),ref:n})})},"HoverCardContent")),pU=p.forwardRef(ia(function(t,n){const{__scopeHoverCard:r,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:c,onInteractOutside:d,...h}=t,m=Cf($g,r),x=Ig(r),g=p.useRef(null),v=Je(n,g),[S,b]=p.useState(!1);return p.useEffect(()=>{if(S){const j=document.body;return Pg=j.style.userSelect||j.style.webkitUserSelect,j.style.userSelect="none",j.style.webkitUserSelect="none",()=>{j.style.userSelect=Pg,j.style.webkitUserSelect=Pg}}},[S]),p.useEffect(()=>{if(g.current){const j=ia(()=>{b(!1),m.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var k;((k=document.getSelection())==null?void 0:k.toString())!==""&&(m.hasSelectionRef.current=!0)})},"handlePointerUp");return document.addEventListener("pointerup",j),()=>{document.removeEventListener("pointerup",j),m.hasSelectionRef.current=!1,m.isPointerDownOnContentRef.current=!1}}},[m.isPointerDownOnContentRef,m.hasSelectionRef]),p.useEffect(()=>{g.current&&jC(g.current).forEach(C=>C.setAttribute("tabindex","-1"))}),l.jsx(Vo,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:d,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:Ce(c,j=>{j.preventDefault()}),onDismiss:m.onDismiss,children:l.jsx(Oc,{...x,...h,onPointerDown:Ce(h.onPointerDown,j=>{j.currentTarget.contains(j.target)&&b(!0),m.hasSelectionRef.current=!1,m.isPointerDownOnContentRef.current=!0}),ref:v,style:{...h.style,userSelect:S?"text":void 0,WebkitUserSelect:S?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})},"HoverCardContentImpl"));function $c(e){return t=>t.pointerType==="touch"?void 0:e()}ia($c,"excludeTouch");function jC(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:ia(r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP,"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}ia(jC,"getTabbableNodes");var Bg=lU,Ug=uU,Vg=hU,kf=mU,gU=Object.defineProperty,xU=(e,t)=>gU(e,"name",{value:t,configurable:!0});function Fg(e){const t=p.useRef({value:e,previous:e});return p.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}xU(Fg,"usePrevious");var vU=Object.defineProperty,yU=(e,t)=>vU(e,"name",{value:t,configurable:!0});function nl(e,[t,n]){return Math.min(n,Math.max(t,e))}yU(nl,"clamp");var bU=Object.defineProperty,Ya=(e,t)=>bU(e,"name",{value:t,configurable:!0}),Hg="Popover",[CC,Nte]=bn(Hg,[_s]),qg=_s(),[wU,rl]=CC(Hg),SU=Ya(e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:c=!1}=e,d=qg(t),h=p.useRef(null),[m,x]=p.useState(!1),[g,v]=Kn({prop:r,defaultProp:i??!1,onChange:o,caller:Hg});return l.jsx(el,{...d,children:l.jsx(wU,{scope:t,contentId:cn(),triggerRef:h,open:g,onOpenChange:v,onOpenToggle:p.useCallback(()=>v(S=>!S),[v]),hasCustomAnchor:m,onCustomAnchorAdd:p.useCallback(()=>x(!0),[]),onCustomAnchorRemove:p.useCallback(()=>x(!1),[]),modal:c,children:n})})},"Popover"),jU="PopoverTrigger",CU=p.forwardRef(Ya(function(t,n){const{__scopePopover:r,...i}=t,o=rl(jU,r),c=qg(r),d=Je(n,o.triggerRef),h=l.jsx(qe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":Kg(o.open),...i,ref:d,onClick:Ce(t.onClick,o.onOpenToggle)});return o.hasCustomAnchor?h:l.jsx(_c,{asChild:!0,...c,children:h})},"PopoverTrigger")),kC="PopoverPortal",[kU,NU]=CC(kC,{forceMount:void 0}),TU=Ya(e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,o=rl(kC,t);return l.jsx(kU,{scope:t,forceMount:n,children:l.jsx(wn,{present:n||o.open,children:l.jsx(Fo,{asChild:!0,container:i,children:r})})})},"PopoverPortal"),Bc="PopoverContent",EU=p.forwardRef(Ya(function(t,n){const r=NU(Bc,t.__scopePopover),{forceMount:i=r.forceMount,...o}=t,c=rl(Bc,t.__scopePopover);return l.jsx(wn,{present:i||c.open,children:c.modal?l.jsx(AU,{...o,ref:n}):l.jsx(MU,{...o,ref:n})})},"PopoverContent")),RU=cs("PopoverContent.RemoveScroll"),AU=p.forwardRef(Ya(function(t,n){const r=rl(Bc,t.__scopePopover),i=p.useRef(null),o=Je(n,i),c=p.useRef(!1);return p.useEffect(()=>{const d=i.current;if(d)return ef(d)},[]),l.jsx(kc,{as:RU,allowPinchZoom:!0,children:l.jsx(NC,{...t,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ce(t.onCloseAutoFocus,d=>{var h;d.preventDefault(),c.current||(h=r.triggerRef.current)==null||h.focus()}),onPointerDownOutside:Ce(t.onPointerDownOutside,d=>{const h=d.detail.originalEvent,m=h.button===0&&h.ctrlKey===!0,x=h.button===2||m;c.current=x},{checkForDefaultPrevented:!1}),onFocusOutside:Ce(t.onFocusOutside,d=>d.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),MU=p.forwardRef(Ya(function(t,n){const r=rl(Bc,t.__scopePopover),i=p.useRef(!1),o=p.useRef(!1);return l.jsx(NC,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{var d,h;(d=t.onCloseAutoFocus)==null||d.call(t,c),c.defaultPrevented||(i.current||(h=r.triggerRef.current)==null||h.focus(),c.preventDefault()),i.current=!1,o.current=!1},onInteractOutside:c=>{var m,x;(m=t.onInteractOutside)==null||m.call(t,c),c.defaultPrevented||(i.current=!0,c.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const d=c.target;((x=r.triggerRef.current)==null?void 0:x.contains(d))&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&o.current&&c.preventDefault()}})},"PopoverContentNonModal")),NC=p.forwardRef(Ya(function(t,n){const{__scopePopover:r,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:c,disableOutsidePointerEvents:d,onEscapeKeyDown:h,onPointerDownOutside:m,onFocusOutside:x,onInteractOutside:g,...v}=t,S=rl(Bc,r),b=qg(r);return Ho(),l.jsx(qd,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:o,onUnmountAutoFocus:c,children:l.jsx(Vo,{asChild:!0,disableOutsidePointerEvents:d,onInteractOutside:g,onEscapeKeyDown:h,onPointerDownOutside:m,onFocusOutside:x,onDismiss:()=>S.onOpenChange(!1),deferPointerDownOutside:!0,children:l.jsx(Oc,{"data-state":Kg(S.open),role:"dialog",id:S.contentId,...b,...v,ref:n,style:{...v.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl"));function Kg(e){return e?"open":"closed"}Ya(Kg,"getState");var DU=SU,_U=CU,OU=TU,TC=EU,zU=Object.defineProperty,ht=(e,t)=>zU(e,"name",{value:t,configurable:!0});function EC(e,t){return p.useReducer((n,r)=>t[n][r]??n,e)}ht(EC,"useStateMachine");var RC="ScrollArea",[AC,Tte]=bn(RC),[PU,Br]=AC(RC),LU=p.forwardRef(ht(function(t,n){const{__scopeScrollArea:r,type:i="hover",dir:o,scrollHideDelay:c=600,...d}=t,[h,m]=p.useState(null),[x,g]=p.useState(null),[v,S]=p.useState(null),[b,j]=p.useState(null),[C,k]=p.useState(null),[N,E]=p.useState(0),[R,A]=p.useState(0),[_,z]=p.useState(!1),[D,V]=p.useState(!1),I=Je(n,m),Q=Uo(o);return l.jsx(PU,{scope:r,type:i,dir:Q,scrollHideDelay:c,scrollArea:h,viewport:x,onViewportChange:g,content:v,onContentChange:S,scrollbarX:b,onScrollbarXChange:j,scrollbarXEnabled:_,onScrollbarXEnabledChange:z,scrollbarY:C,onScrollbarYChange:k,scrollbarYEnabled:D,onScrollbarYEnabledChange:V,onCornerWidthChange:E,onCornerHeightChange:A,children:l.jsx(qe.div,{dir:Q,...d,ref:I,style:{position:"relative","--radix-scroll-area-corner-width":N+"px","--radix-scroll-area-corner-height":R+"px",...t.style}})})},"ScrollArea")),IU="ScrollAreaViewport",$U=p.forwardRef(ht(function(t,n){const{__scopeScrollArea:r,children:i,nonce:o,...c}=t,d=Br(IU,r),h=p.useRef(null),m=Je(n,h,d.onViewportChange);return l.jsxs(l.Fragment,{children:[l.jsx(BU,{nonce:o}),l.jsx(qe.div,{"data-radix-scroll-area-viewport":"",...c,ref:m,style:{overflowX:d.scrollbarXEnabled?"scroll":"hidden",overflowY:d.scrollbarYEnabled?"scroll":"hidden",...t.style},children:l.jsx("div",{ref:d.onContentChange,style:{minWidth:"100%",display:"table"},children:i})})]})},"ScrollAreaViewport")),BU=p.memo(ht(function({nonce:t}){return l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t})},"ScrollAreaViewportStyle"),(e,t)=>e.nonce===t.nonce),oa="ScrollAreaScrollbar",MC=p.forwardRef(ht(function(t,n){const{forceMount:r,...i}=t,o=Br(oa,t.__scopeScrollArea),{onScrollbarXEnabledChange:c,onScrollbarYEnabledChange:d}=o,h=t.orientation==="horizontal";return p.useEffect(()=>(h?c(!0):d(!0),()=>{h?c(!1):d(!1)}),[h,c,d]),o.type==="hover"?l.jsx(UU,{...i,ref:n,forceMount:r}):o.type==="scroll"?l.jsx(VU,{...i,ref:n,forceMount:r}):o.type==="auto"?l.jsx(DC,{...i,ref:n,forceMount:r}):o.type==="always"?l.jsx(Gg,{...i,ref:n,"data-state":"visible"}):null},"ScrollAreaScrollbar")),UU=p.forwardRef(ht(function(t,n){const{forceMount:r,...i}=t,o=Br(oa,t.__scopeScrollArea),[c,d]=p.useState(!1);return p.useEffect(()=>{const h=o.scrollArea;let m=0;if(h){const x=ht(()=>{window.clearTimeout(m),d(!0)},"handlePointerEnter"),g=ht(()=>{m=window.setTimeout(()=>d(!1),o.scrollHideDelay)},"handlePointerLeave");return h.addEventListener("pointerenter",x),h.addEventListener("pointerleave",g),()=>{window.clearTimeout(m),h.removeEventListener("pointerenter",x),h.removeEventListener("pointerleave",g)}}},[o.scrollArea,o.scrollHideDelay]),l.jsx(wn,{present:r||c,children:l.jsx(DC,{"data-state":c?"visible":"hidden",...i,ref:n})})},"ScrollAreaScrollbarHover")),VU=p.forwardRef(ht(function(t,n){const{forceMount:r,...i}=t,o=Br(oa,t.__scopeScrollArea),c=t.orientation==="horizontal",d=Fc(()=>m("SCROLL_END"),100),[h,m]=EC("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return p.useEffect(()=>{if(h==="idle"){const x=window.setTimeout(()=>m("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(x)}},[h,o.scrollHideDelay,m]),p.useEffect(()=>{const x=o.viewport,g=c?"scrollLeft":"scrollTop";if(x){let v=x[g];const S=ht(()=>{const b=x[g];v!==b&&(m("SCROLL"),d()),v=b},"handleScroll");return x.addEventListener("scroll",S),()=>x.removeEventListener("scroll",S)}},[o.viewport,c,m,d]),l.jsx(wn,{present:r||h!=="hidden",children:l.jsx(Gg,{"data-state":h==="hidden"?"hidden":"visible",...i,ref:n,onPointerEnter:Ce(t.onPointerEnter,()=>m("POINTER_ENTER")),onPointerLeave:Ce(t.onPointerLeave,()=>m("POINTER_LEAVE"))})})},"ScrollAreaScrollbarScroll")),DC=p.forwardRef(ht(function(t,n){const r=Br(oa,t.__scopeScrollArea),{forceMount:i,...o}=t,[c,d]=p.useState(!1),h=t.orientation==="horizontal",m=Fc(()=>{if(r.viewport){const x=r.viewport.offsetWidth<r.viewport.scrollWidth,g=r.viewport.offsetHeight<r.viewport.scrollHeight;d(h?x:g)}},10);return Xi(r.viewport,m),Xi(r.content,m),l.jsx(wn,{present:i||c,children:l.jsx(Gg,{"data-state":c?"visible":"hidden",...o,ref:n})})},"ScrollAreaScrollbarAuto")),Gg=p.forwardRef(ht(function(t,n){const{orientation:r="vertical",...i}=t,o=Br(oa,t.__scopeScrollArea),c=p.useRef(null),d=p.useRef(0),[h,m]=p.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),x=Wg(h.viewport,h.content),g={...i,sizes:h,onSizesChange:m,hasThumb:x>0&&x<1,onThumbChange:ht(S=>c.current=S,"onThumbChange"),onThumbPointerUp:ht(()=>d.current=0,"onThumbPointerUp"),onThumbPointerDown:ht(S=>d.current=S,"onThumbPointerDown")};function v(S,b){return PC(S,d.current,h,b)}return ht(v,"getScrollPosition"),r==="horizontal"?l.jsx(FU,{...g,ref:n,onThumbPositionChange:()=>{if(o.viewport&&c.current){const S=o.viewport.scrollLeft,b=Xg(S,h,o.dir);c.current.style.transform=`translate3d(${b}px, 0, 0)`}},onWheelScroll:S=>{o.viewport&&(o.viewport.scrollLeft=S)},onDragScroll:S=>{o.viewport&&(o.viewport.scrollLeft=v(S,o.dir))}}):r==="vertical"?l.jsx(HU,{...g,ref:n,onThumbPositionChange:()=>{if(o.viewport&&c.current){const S=o.viewport.scrollTop,b=Xg(S,h);c.current.style.transform=`translate3d(0, ${b}px, 0)`}},onWheelScroll:S=>{o.viewport&&(o.viewport.scrollTop=S)},onDragScroll:S=>{o.viewport&&(o.viewport.scrollTop=v(S))}}):null},"ScrollAreaScrollbarVisible")),FU=p.forwardRef(ht(function(t,n){const{sizes:r,onSizesChange:i,...o}=t,c=Br(oa,t.__scopeScrollArea),[d,h]=p.useState(),m=p.useRef(null),x=Je(n,m,c.onScrollbarXChange);return p.useEffect(()=>{m.current&&h(getComputedStyle(m.current))},[m]),l.jsx(OC,{"data-orientation":"horizontal",...o,ref:x,sizes:r,style:{bottom:0,left:c.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:c.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Vc(r)+"px",...t.style},onThumbPointerDown:g=>t.onThumbPointerDown(g.x),onDragScroll:g=>t.onDragScroll(g.x),onWheelScroll:(g,v)=>{if(c.viewport){const S=c.viewport.scrollLeft+g.deltaX;t.onWheelScroll(S),Zg(S,v)&&g.preventDefault()}},onResize:()=>{m.current&&c.viewport&&d&&i({content:c.viewport.scrollWidth,viewport:c.viewport.offsetWidth,scrollbar:{size:m.current.clientWidth,paddingStart:Uc(d.paddingLeft),paddingEnd:Uc(d.paddingRight)}})}})},"ScrollAreaScrollbarX")),HU=p.forwardRef(ht(function(t,n){const{sizes:r,onSizesChange:i,...o}=t,c=Br(oa,t.__scopeScrollArea),[d,h]=p.useState(),m=p.useRef(null),x=Je(n,m,c.onScrollbarYChange);return p.useEffect(()=>{m.current&&h(getComputedStyle(m.current))},[m]),l.jsx(OC,{"data-orientation":"vertical",...o,ref:x,sizes:r,style:{top:0,right:c.dir==="ltr"?0:void 0,left:c.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Vc(r)+"px",...t.style},onThumbPointerDown:g=>t.onThumbPointerDown(g.y),onDragScroll:g=>t.onDragScroll(g.y),onWheelScroll:(g,v)=>{if(c.viewport){const S=c.viewport.scrollTop+g.deltaY;t.onWheelScroll(S),Zg(S,v)&&g.preventDefault()}},onResize:()=>{m.current&&c.viewport&&d&&i({content:c.viewport.scrollHeight,viewport:c.viewport.offsetHeight,scrollbar:{size:m.current.clientHeight,paddingStart:Uc(d.paddingTop),paddingEnd:Uc(d.paddingBottom)}})}})},"ScrollAreaScrollbarY")),[qU,_C]=AC(oa),OC=p.forwardRef(ht(function(t,n){const{__scopeScrollArea:r,sizes:i,hasThumb:o,onThumbChange:c,onThumbPointerUp:d,onThumbPointerDown:h,onThumbPositionChange:m,onDragScroll:x,onWheelScroll:g,onResize:v,...S}=t,b=Br(oa,r),[j,C]=p.useState(null),k=Je(n,C),N=p.useRef(null),E=p.useRef(""),R=b.viewport,A=i.content-i.viewport,_=rn(g),z=rn(m),D=Fc(v,10);function V(I){if(N.current){const Q=I.clientX-N.current.left,B=I.clientY-N.current.top;x({x:Q,y:B})}}return ht(V,"handleDragScroll"),p.useEffect(()=>{const I=ht(Q=>{const B=Q.target;(j==null?void 0:j.contains(B))&&_(Q,A)},"handleWheel");return document.addEventListener("wheel",I,{passive:!1}),()=>document.removeEventListener("wheel",I,{passive:!1})},[R,j,A,_]),p.useEffect(z,[i,z]),Xi(j,D),Xi(b.content,D),l.jsx(qU,{scope:r,scrollbar:j,hasThumb:o,onThumbChange:rn(c),onThumbPointerUp:rn(d),onThumbPositionChange:z,onThumbPointerDown:rn(h),children:l.jsx(qe.div,{...S,ref:k,style:{position:"absolute",...S.style},onPointerDown:Ce(t.onPointerDown,I=>{I.button===0&&(I.target.setPointerCapture(I.pointerId),N.current=j.getBoundingClientRect(),E.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",b.viewport&&(b.viewport.style.scrollBehavior="auto"),V(I))}),onPointerMove:Ce(t.onPointerMove,V),onPointerUp:Ce(t.onPointerUp,I=>{const Q=I.target;Q.hasPointerCapture(I.pointerId)&&Q.releasePointerCapture(I.pointerId),document.body.style.webkitUserSelect=E.current,b.viewport&&(b.viewport.style.scrollBehavior=""),N.current=null})})})},"ScrollAreaScrollbarImpl")),Yg="ScrollAreaThumb",KU=p.forwardRef(ht(function(t,n){const{forceMount:r,...i}=t,o=_C(Yg,t.__scopeScrollArea);return l.jsx(wn,{present:r||o.hasThumb,children:l.jsx(GU,{ref:n,...i})})},"ScrollAreaThumb")),GU=p.forwardRef(ht(function(t,n){const{__scopeScrollArea:r,style:i,...o}=t,c=Br(Yg,r),d=_C(Yg,r),{onThumbPositionChange:h}=d,m=Je(n,d.onThumbChange),x=p.useRef(void 0),g=Fc(()=>{x.current&&(x.current(),x.current=void 0)},100);return p.useEffect(()=>{const v=c.viewport;if(v){const S=ht(()=>{if(g(),!x.current){const b=XU(v,h);x.current=b,h()}},"handleScroll");return h(),v.addEventListener("scroll",S),()=>v.removeEventListener("scroll",S)}},[c.viewport,g,h]),l.jsx(qe.div,{"data-state":d.hasThumb?"visible":"hidden",...o,ref:m,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...i},onPointerDownCapture:Ce(t.onPointerDownCapture,v=>{const b=v.target.getBoundingClientRect(),j=v.clientX-b.left,C=v.clientY-b.top;d.onThumbPointerDown({x:j,y:C})}),onPointerUp:Ce(t.onPointerUp,d.onThumbPointerUp)})},"ScrollAreaThumbImpl")),zC="ScrollAreaCorner",YU=p.forwardRef(ht(function(t,n){const r=Br(zC,t.__scopeScrollArea),i=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&i?l.jsx(WU,{...t,ref:n}):null},"ScrollAreaCorner")),WU=p.forwardRef(ht(function(t,n){const{__scopeScrollArea:r,...i}=t,o=Br(zC,r),[c,d]=p.useState(0),[h,m]=p.useState(0),x=!!(c&&h),{onCornerWidthChange:g,onCornerHeightChange:v}=o;return Xi(o.scrollbarX,()=>{var b;const S=((b=o.scrollbarX)==null?void 0:b.offsetHeight)||0;o.onCornerHeightChange(S),m(S)}),Xi(o.scrollbarY,()=>{var b;const S=((b=o.scrollbarY)==null?void 0:b.offsetWidth)||0;o.onCornerWidthChange(S),d(S)}),p.useEffect(()=>()=>{g(0),v(0)},[g,v]),x?l.jsx(qe.div,{...i,ref:n,style:{width:c,height:h,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null},"ScrollAreaCornerImpl"));function Uc(e){return e?parseInt(e,10):0}ht(Uc,"toInt");function Wg(e,t){const n=e/t;return isNaN(n)?0:n}ht(Wg,"getThumbRatio");function Vc(e){const t=Wg(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}ht(Vc,"getThumbSize");function PC(e,t,n,r="ltr"){const i=Vc(n),o=i/2,c=t||o,d=i-c,h=n.scrollbar.paddingStart+c,m=n.scrollbar.size-n.scrollbar.paddingEnd-d,x=n.content-n.viewport,g=r==="ltr"?[0,x]:[x*-1,0];return Qg([h,m],g)(e)}ht(PC,"getScrollPositionFromPointer");function Xg(e,t,n="ltr"){const r=Vc(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,c=t.content-t.viewport,d=o-r,h=n==="ltr"?[0,c]:[c*-1,0],m=nl(e,h);return Qg([0,c],[0,d])(m)}ht(Xg,"getThumbOffsetFromScroll");function Qg(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}ht(Qg,"linearScale");function Zg(e,t){return e>0&&e<t}ht(Zg,"isScrollingWithinScrollbarBounds");var XU=ht((e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return ht((function i(){const o={left:e.scrollLeft,top:e.scrollTop},c=n.left!==o.left,d=n.top!==o.top;(c||d)&&t(),n=o,r=window.requestAnimationFrame(i)}),"loop")(),()=>window.cancelAnimationFrame(r)},"addUnlinkedScrollListener");function Fc(e,t){const n=rn(e),r=p.useRef(0);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),p.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}ht(Fc,"useDebounceCallback");function Xi(e,t){const n=rn(t);Vt(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}ht(Xi,"useResizeObserver");var LC=LU,QU=$U,ZU=YU,JU=Object.defineProperty,St=(e,t)=>JU(e,"name",{value:t,configurable:!0}),e6=[" ","Enter","ArrowUp","ArrowDown"],t6=[" ","Enter"],sl="Select",[Nf,Tf,n6]=Sc(sl),[Qi,Ete]=bn(sl,[n6,_s]),Jg=_s(),[r6,Wa]=Qi(sl),[s6,a6]=Qi(sl);function IC(e){const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:c,defaultValue:d,onValueChange:h,dir:m,name:x,autoComplete:g,disabled:v,required:S,form:b,internal_do_not_use_render:j}=e,C=Jg(t),[k,N]=p.useState(null),[E,R]=p.useState(null),[A,_]=p.useState(!1),z=Uo(m),[D,V]=Kn({prop:r,defaultProp:i??!1,onChange:o,caller:sl}),[I,Q]=Kn({prop:c,defaultProp:d,onChange:h,caller:sl}),B=p.useRef(null),H=p.useRef(I);p.useEffect(()=>{const L=b?k==null?void 0:k.ownerDocument.getElementById(b):k==null?void 0:k.form;if(L instanceof HTMLFormElement){const G=St(()=>Q(H.current),"reset");return L.addEventListener("reset",G),()=>L.removeEventListener("reset",G)}},[b,k,Q]);const ee=k?!!b||!!k.closest("form"):!0,[W,M]=p.useState(new Set),U=cn(),K=Array.from(W).map(L=>L.props.value).join(";"),ne=p.useCallback(L=>{M(G=>new Set(G).add(L))},[]),q=p.useCallback(L=>{M(G=>{const J=new Set(G);return J.delete(L),J})},[]),P={required:S,trigger:k,onTriggerChange:N,valueNode:E,onValueNodeChange:R,valueNodeHasChildren:A,onValueNodeHasChildrenChange:_,contentId:U,value:I,onValueChange:Q,open:D,onOpenChange:V,dir:z,triggerPointerDownPosRef:B,disabled:v,name:x,autoComplete:g,form:b,nativeOptions:W,nativeSelectKey:K,isFormControl:ee};return l.jsx(el,{...C,children:l.jsx(r6,{scope:t,...P,children:l.jsx(Nf.Provider,{scope:t,children:l.jsx(s6,{scope:t,onNativeOptionAdd:ne,onNativeOptionRemove:q,children:KC(j)?j(P):n})})})})}St(IC,"SelectProvider");var i6=St(e=>{const{__scopeSelect:t,children:n,...r}=e;return l.jsx(IC,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:i})=>l.jsxs(l.Fragment,{children:[n,i?l.jsx(D6,{__scopeSelect:t}):null]})})},"Select"),o6="SelectTrigger",l6=p.forwardRef(St(function(t,n){const{__scopeSelect:r,disabled:i=!1,...o}=t,c=Jg(r),d=Wa(o6,r),h=d.disabled||i,m=Je(n,d.onTriggerChange),x=Tf(r),g=p.useRef("touch"),[v,S,b]=nx(C=>{const k=x().filter(R=>!R.disabled),N=k.find(R=>R.value===d.value),E=rx(k,C,N);E!==void 0&&d.onValueChange(E.value)}),j=St(C=>{h||(d.onOpenChange(!0),b()),C&&(d.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})},"handleOpen");return l.jsx(_c,{asChild:!0,...c,children:l.jsx(qe.button,{type:"button",role:"combobox","aria-controls":d.open?d.contentId:void 0,"aria-expanded":d.open,"aria-required":d.required,"aria-autocomplete":"none",dir:d.dir,"data-state":d.open?"open":"closed",disabled:h,"data-disabled":h?"":void 0,"data-placeholder":Hc(d.value)?"":void 0,...o,ref:m,onClick:Ce(o.onClick,C=>{C.currentTarget.focus(),g.current!=="mouse"&&j(C)}),onPointerDown:Ce(o.onPointerDown,C=>{g.current=C.pointerType;const k=C.target;k.hasPointerCapture(C.pointerId)&&k.releasePointerCapture(C.pointerId),C.button===0&&C.ctrlKey===!1&&C.pointerType==="mouse"&&(j(C),C.preventDefault())}),onKeyDown:Ce(o.onKeyDown,C=>{const k=v.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&S(C.key),!(k&&C.key===" ")&&e6.includes(C.key)&&(j(),C.preventDefault())})})})},"SelectTrigger")),c6="SelectValue",u6=p.forwardRef(St(function(t,n){const{__scopeSelect:r,className:i,style:o,children:c,placeholder:d="",...h}=t,m=Wa(c6,r),{onValueNodeHasChildrenChange:x}=m,g=c!==void 0,v=Je(n,m.onValueNodeChange);Vt(()=>{x(g)},[x,g]);const S=Hc(m.value);return l.jsx(qe.span,{...h,asChild:S?!1:h.asChild,ref:v,style:{pointerEvents:"none"},children:l.jsx(p.Fragment,{children:S?d:c},S?"placeholder":"value")})},"SelectValue")),d6=p.forwardRef(St(function(t,n){const{__scopeSelect:r,children:i,...o}=t;return l.jsx(qe.span,{"aria-hidden":!0,...o,ref:n,children:i||"▼"})},"SelectIcon")),f6="SelectPortal",[h6,m6]=Qi(f6,{forceMount:void 0}),p6=St(e=>{const{__scopeSelect:t,forceMount:n,...r}=e;return l.jsx(h6,{scope:e.__scopeSelect,forceMount:n,children:l.jsx(Fo,{asChild:!0,...r})})},"SelectPortal"),Zi="SelectContent",g6=p.forwardRef(St(function(t,n){const r=m6(Zi,t.__scopeSelect),{forceMount:i=r.forceMount,...o}=t,c=Wa(Zi,t.__scopeSelect),[d,h]=p.useState();return Vt(()=>{h(new DocumentFragment)},[]),l.jsx(wn,{present:i||c.open,children:({present:m})=>m?l.jsx(y6,{...o,ref:n}):l.jsx(x6,{...o,fragment:d})})},"SelectContent")),x6=p.forwardRef(St(function(t,n){const{__scopeSelect:r,children:i,fragment:o}=t;return o?Ba.createPortal(l.jsx($C,{scope:r,children:l.jsx(Nf.Slot,{scope:r,children:l.jsx("div",{ref:n,children:i})})}),o):null},"SelectContentFragment")),fs=10,[$C,Ji]=Qi(Zi),v6=cs("SelectContent.RemoveScroll"),y6=p.forwardRef(St(function(t,n){const{__scopeSelect:r}=t,{position:i="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:c,onPointerDownOutside:d,side:h,sideOffset:m,align:x,alignOffset:g,arrowPadding:v,collisionBoundary:S,collisionPadding:b,sticky:j,hideWhenDetached:C,avoidCollisions:k,...N}=t,E=Wa(Zi,r),[R,A]=p.useState(null),[_,z]=p.useState(null),D=Je(n,A),[V,I]=p.useState(null),[Q,B]=p.useState(null),H=Tf(r),[ee,W]=p.useState(!1),M=p.useRef(!1);p.useEffect(()=>{if(R)return ef(R)},[R]),Ho();const U=p.useCallback(ie=>{const[Z,...ve]=H().map(Ie=>Ie.ref.current),[Ee]=ve.slice(-1),Te=document.activeElement;for(const Ie of ie)if(Ie===Te||(Ie==null||Ie.scrollIntoView({block:"nearest"}),Ie===Z&&_&&(_.scrollTop=0),Ie===Ee&&_&&(_.scrollTop=_.scrollHeight),Ie==null||Ie.focus(),document.activeElement!==Te))return},[H,_]),K=p.useCallback(()=>U([V,R]),[U,V,R]);p.useEffect(()=>{ee&&K()},[ee,K]);const{onOpenChange:ne,triggerPointerDownPosRef:q}=E;p.useEffect(()=>{if(R){let ie={x:0,y:0};const Z=St(Ee=>{var Te,Ie;ie={x:Math.abs(Math.round(Ee.pageX)-(((Te=q.current)==null?void 0:Te.x)??0)),y:Math.abs(Math.round(Ee.pageY)-(((Ie=q.current)==null?void 0:Ie.y)??0))}},"handlePointerMove"),ve=St(Ee=>{ie.x<=10&&ie.y<=10?Ee.preventDefault():Ee.composedPath().includes(R)||ne(!1),document.removeEventListener("pointermove",Z),q.current=null},"handlePointerUp");return q.current!==null&&(document.addEventListener("pointermove",Z),document.addEventListener("pointerup",ve,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Z),document.removeEventListener("pointerup",ve,{capture:!0})}}},[R,ne,q]),p.useEffect(()=>{const ie=St(()=>ne(!1),"close");return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[ne]);const[P,L]=nx(ie=>{const Z=H().filter(Te=>!Te.disabled),ve=Z.find(Te=>Te.ref.current===document.activeElement),Ee=rx(Z,ie,ve);Ee&&setTimeout(()=>{var Te;return(Te=Ee.ref.current)==null?void 0:Te.focus()})}),G=p.useCallback((ie,Z,ve)=>{const Ee=!M.current&&!ve;(E.value!==void 0&&E.value===Z||Ee)&&(I(ie),Ee&&(M.current=!0))},[E.value]),J=p.useCallback(()=>R==null?void 0:R.focus(),[R]),$=p.useCallback((ie,Z,ve)=>{const Ee=!M.current&&!ve;(E.value!==void 0&&E.value===Z||Ee)&&B(ie)},[E.value]),se=i==="popper"?BC:b6,oe=se===BC?{side:h,sideOffset:m,align:x,alignOffset:g,arrowPadding:v,collisionBoundary:S,collisionPadding:b,sticky:j,hideWhenDetached:C,avoidCollisions:k}:{};return l.jsx($C,{scope:r,content:R,viewport:_,onViewportChange:z,itemRefCallback:G,selectedItem:V,onItemLeave:J,itemTextRefCallback:$,focusSelectedItem:K,selectedItemText:Q,position:i,isPositioned:ee,searchRef:P,children:l.jsx(kc,{as:v6,allowPinchZoom:!0,children:l.jsx(qd,{asChild:!0,trapped:E.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:Ce(o,ie=>{var Z;(Z=E.trigger)==null||Z.focus({preventScroll:!0}),ie.preventDefault()}),children:l.jsx(Vo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:l.jsx(se,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:ie=>ie.preventDefault(),...N,...oe,onPlaced:()=>W(!0),ref:D,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:Ce(N.onKeyDown,ie=>{const Z=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!Z&&ie.key.length===1&&L(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let Ee=H().filter(Te=>!Te.disabled).map(Te=>Te.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(Ee=Ee.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const Te=ie.target,Ie=Ee.indexOf(Te);Ee=Ee.slice(Ie+1)}setTimeout(()=>U(Ee)),ie.preventDefault()}})})})})})})},"SelectContentImpl")),b6=p.forwardRef(St(function(t,n){const{__scopeSelect:r,onPlaced:i,...o}=t,c=Wa(Zi,r),d=Ji(Zi,r),[h,m]=p.useState(null),[x,g]=p.useState(null),v=Je(n,g),S=Tf(r),b=p.useRef(!1),j=p.useRef(!0),{viewport:C,selectedItem:k,selectedItemText:N,focusSelectedItem:E}=d,R=p.useCallback(()=>{if(c.trigger&&c.valueNode&&h&&x&&C&&k&&N){const D=c.trigger.getBoundingClientRect(),V=x.getBoundingClientRect(),I=c.valueNode.getBoundingClientRect(),Q=N.getBoundingClientRect();if(c.dir!=="rtl"){const Te=Q.left-V.left,Ie=I.left-Te,Fe=D.left-Ie,fe=D.width+Fe,Se=Math.max(fe,V.width),ye=window.innerWidth-fs,Qe=nl(Ie,[fs,Math.max(fs,ye-Se)]);h.style.minWidth=fe+"px",h.style.left=Qe+"px"}else{const Te=V.right-Q.right,Ie=window.innerWidth-I.right-Te,Fe=window.innerWidth-D.right-Ie,fe=D.width+Fe,Se=Math.max(fe,V.width),ye=window.innerWidth-fs,Qe=nl(Ie,[fs,Math.max(fs,ye-Se)]);h.style.minWidth=fe+"px",h.style.right=Qe+"px"}const B=S(),H=window.innerHeight-fs*2,ee=C.scrollHeight,W=window.getComputedStyle(x),M=parseInt(W.borderTopWidth,10),U=parseInt(W.paddingTop,10),K=parseInt(W.borderBottomWidth,10),ne=parseInt(W.paddingBottom,10),q=M+U+ee+ne+K,P=Math.min(k.offsetHeight*5,q),L=window.getComputedStyle(C),G=parseInt(L.paddingTop,10),J=parseInt(L.paddingBottom,10),$=D.top+D.height/2-fs,se=H-$,oe=k.offsetHeight/2,ie=k.offsetTop+oe,Z=M+U+ie,ve=q-Z;if(Z<=$){const Te=B.length>0&&k===B[B.length-1].ref.current;h.style.bottom="0px";const Ie=x.clientHeight-C.offsetTop-C.offsetHeight,Fe=Math.max(se,oe+(Te?J:0)+Ie+K),fe=Z+Fe;h.style.height=fe+"px"}else{const Te=B.length>0&&k===B[0].ref.current;h.style.top="0px";const Fe=Math.max($,M+C.offsetTop+(Te?G:0)+oe)+ve;h.style.height=Fe+"px",C.scrollTop=Z-$+C.offsetTop}h.style.margin=`${fs}px 0`,h.style.minHeight=P+"px",h.style.maxHeight=H+"px",i==null||i(),requestAnimationFrame(()=>b.current=!0)}},[S,c.trigger,c.valueNode,h,x,C,k,N,c.dir,i]);Vt(()=>R(),[R]);const[A,_]=p.useState();Vt(()=>{x&&_(window.getComputedStyle(x).zIndex)},[x]);const z=p.useCallback(D=>{D&&j.current===!0&&(R(),E==null||E(),j.current=!1)},[R,E]);return l.jsx(w6,{scope:r,contentWrapper:h,shouldExpandOnScrollRef:b,onScrollButtonChange:z,children:l.jsx("div",{ref:m,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:l.jsx(qe.div,{...o,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})},"SelectItemAlignedPosition")),BC=p.forwardRef(St(function(t,n){const{__scopeSelect:r,align:i="start",collisionPadding:o=fs,...c}=t,d=Jg(r);return l.jsx(Oc,{...d,...c,ref:n,align:i,collisionPadding:o,style:{boxSizing:"border-box",...c.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")),[w6,ex]=Qi(Zi,{}),UC="SelectViewport",S6=p.forwardRef(St(function(t,n){const{__scopeSelect:r,nonce:i,...o}=t,c=Ji(UC,r),d=ex(UC,r),h=Je(n,c.onViewportChange),m=p.useRef(0);return l.jsxs(l.Fragment,{children:[l.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:i}),l.jsx(Nf.Slot,{scope:r,children:l.jsx(qe.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:h,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Ce(o.onScroll,x=>{const g=x.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:S}=d;if(S!=null&&S.current&&v){const b=Math.abs(m.current-g.scrollTop);if(b>0){const j=window.innerHeight-fs*2,C=parseFloat(v.style.minHeight),k=parseFloat(v.style.height),N=Math.max(C,k);if(N<j){const E=N+b,R=Math.min(j,E),A=E-R;v.style.height=R+"px",v.style.bottom==="0px"&&(g.scrollTop=A>0?A:0,v.style.justifyContent="flex-end")}}}m.current=g.scrollTop})})})]})},"SelectViewport")),j6="SelectGroup",[Rte,Ate]=Qi(j6),tx="SelectItem",[C6,VC]=Qi(tx),k6=p.forwardRef(St(function(t,n){const{__scopeSelect:r,value:i,disabled:o=!1,textValue:c,...d}=t,h=Wa(tx,r),m=Ji(tx,r),x=h.value===i,[g,v]=p.useState(c??""),[S,b]=p.useState(!1),j=rn(R=>{var A;return(A=m.itemRefCallback)==null?void 0:A.call(m,R,i,o)}),C=Je(n,j),k=cn(),N=p.useRef("touch"),E=St(()=>{o||(h.onValueChange(i),h.onOpenChange(!1))},"handleSelect");return l.jsx(C6,{scope:r,value:i,disabled:o,textId:k,isSelected:x,onItemTextChange:p.useCallback(R=>{v(A=>A||((R==null?void 0:R.textContent)??"").trim())},[]),children:l.jsx(Nf.ItemSlot,{scope:r,value:i,disabled:o,textValue:g,children:l.jsx(qe.div,{role:"option","aria-labelledby":k,"data-highlighted":S?"":void 0,"aria-selected":x&&S,"data-state":x?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...d,ref:C,onFocus:Ce(d.onFocus,()=>b(!0)),onBlur:Ce(d.onBlur,()=>b(!1)),onClick:Ce(d.onClick,()=>{N.current!=="mouse"&&E()}),onPointerUp:Ce(d.onPointerUp,()=>{N.current==="mouse"&&E()}),onPointerDown:Ce(d.onPointerDown,R=>{N.current=R.pointerType}),onPointerMove:Ce(d.onPointerMove,R=>{var A;N.current=R.pointerType,o?(A=m.onItemLeave)==null||A.call(m):N.current==="mouse"&&R.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ce(d.onPointerLeave,R=>{var A;R.currentTarget===document.activeElement&&((A=m.onItemLeave)==null||A.call(m))}),onKeyDown:Ce(d.onKeyDown,R=>{var _;o||R.target!==R.currentTarget||((_=m.searchRef)==null?void 0:_.current)!==""&&R.key===" "||(t6.includes(R.key)&&E(),R.key===" "&&R.preventDefault())})})})})},"SelectItem")),Ef="SelectItemText",N6=p.forwardRef(St(function(t,n){const{__scopeSelect:r,className:i,style:o,...c}=t,d=Wa(Ef,r),h=Ji(Ef,r),m=VC(Ef,r),x=a6(Ef,r),[g,v]=p.useState(null),S=rn(E=>{var R;return(R=h.itemTextRefCallback)==null?void 0:R.call(h,E,m.value,m.disabled)}),b=Je(n,v,m.onItemTextChange,S),j=g==null?void 0:g.textContent,C=p.useMemo(()=>l.jsx("option",{value:m.value,disabled:m.disabled,children:j},m.value),[m.disabled,m.value,j]),{onNativeOptionAdd:k,onNativeOptionRemove:N}=x;return Vt(()=>(k(C),()=>N(C)),[k,N,C]),l.jsxs(l.Fragment,{children:[l.jsx(qe.span,{id:m.textId,...c,ref:b}),m.isSelected&&d.valueNode&&!d.valueNodeHasChildren&&!Hc(d.value)?Ba.createPortal(c.children,d.valueNode):null]})},"SelectItemText")),T6="SelectItemIndicator",E6=p.forwardRef(St(function(t,n){const{__scopeSelect:r,...i}=t;return VC(T6,r).isSelected?l.jsx(qe.span,{"aria-hidden":!0,...i,ref:n}):null},"SelectItemIndicator")),FC="SelectScrollUpButton",R6=p.forwardRef(St(function(t,n){const r=Ji(FC,t.__scopeSelect),i=ex(FC,t.__scopeSelect),[o,c]=p.useState(!1),d=Je(n,i.onScrollButtonChange);return Vt(()=>{if(r.viewport&&r.isPositioned){let h=function(){const x=m.scrollTop>0;c(x)};St(h,"handleScroll");const m=r.viewport;return h(),m.addEventListener("scroll",h),()=>m.removeEventListener("scroll",h)}},[r.viewport,r.isPositioned]),o?l.jsx(qC,{...t,ref:d,onAutoScroll:()=>{const{viewport:h,selectedItem:m}=r;h&&m&&(h.scrollTop=h.scrollTop-m.offsetHeight)}}):null},"SelectScrollUpButton")),HC="SelectScrollDownButton",A6=p.forwardRef(St(function(t,n){const r=Ji(HC,t.__scopeSelect),i=ex(HC,t.__scopeSelect),[o,c]=p.useState(!1),d=Je(n,i.onScrollButtonChange);return Vt(()=>{if(r.viewport&&r.isPositioned){let h=function(){const x=m.scrollHeight-m.clientHeight,g=Math.ceil(m.scrollTop)<x;c(g)};St(h,"handleScroll");const m=r.viewport;return h(),m.addEventListener("scroll",h),()=>m.removeEventListener("scroll",h)}},[r.viewport,r.isPositioned]),o?l.jsx(qC,{...t,ref:d,onAutoScroll:()=>{const{viewport:h,selectedItem:m}=r;h&&m&&(h.scrollTop=h.scrollTop+m.offsetHeight)}}):null},"SelectScrollDownButton")),qC=p.forwardRef(St(function(t,n){const{__scopeSelect:r,onAutoScroll:i,...o}=t,c=Ji("SelectScrollButton",r),d=p.useRef(null),h=Tf(r),m=p.useCallback(()=>{d.current!==null&&(window.clearInterval(d.current),d.current=null)},[]);return p.useEffect(()=>()=>m(),[m]),Vt(()=>{var g;const x=h().find(v=>v.ref.current===document.activeElement);(g=x==null?void 0:x.ref.current)==null||g.scrollIntoView({block:"nearest"})},[h]),l.jsx(qe.div,{"aria-hidden":!0,...o,ref:n,style:{flexShrink:0,...o.style},onPointerDown:Ce(o.onPointerDown,()=>{d.current===null&&(d.current=window.setInterval(i,50))}),onPointerMove:Ce(o.onPointerMove,()=>{var x;(x=c.onItemLeave)==null||x.call(c),d.current===null&&(d.current=window.setInterval(i,50))}),onPointerLeave:Ce(o.onPointerLeave,()=>{m()})})},"SelectScrollButtonImpl")),M6="SelectBubbleInput",D6=p.forwardRef(St(function({__scopeSelect:t,...n},r){const i=Wa(M6,t),{value:o,onValueChange:c,required:d,disabled:h,name:m,autoComplete:x,form:g}=i,{nativeOptions:v,nativeSelectKey:S}=i,b=p.useRef(null),j=Je(r,b),C=o??"",k=Fg(C),N=Array.from(v).some(E=>(E.props.value??"")==="");return p.useEffect(()=>{const E=b.current;if(!E)return;const R=window.HTMLSelectElement.prototype,_=Object.getOwnPropertyDescriptor(R,"value").set;if(k!==C&&_){const z=new Event("change",{bubbles:!0});_.call(E,C),E.dispatchEvent(z)}},[k,C]),l.jsxs(qe.select,{"aria-hidden":!0,required:d,tabIndex:-1,name:m,autoComplete:x,disabled:h,form:g,onChange:E=>c(E.target.value),...n,style:{...U1,...n.style},ref:j,defaultValue:C,children:[Hc(o)&&!N?l.jsx("option",{value:""}):null,Array.from(v)]},S)},"SelectBubbleInput"));function KC(e){return typeof e=="function"}St(KC,"isFunction");function Hc(e){return e===""||e===void 0}St(Hc,"shouldShowPlaceholder");function nx(e){const t=rn(e),n=p.useRef(""),r=p.useRef(0),i=p.useCallback(c=>{const d=n.current+c;t(d),St((function h(m){n.current=m,window.clearTimeout(r.current),m!==""&&(r.current=window.setTimeout(()=>h(""),1e3))}),"updateSearch")(d)},[t]),o=p.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}St(nx,"useTypeaheadSearch");function rx(e,t,n){const i=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let c=GC(e,Math.max(o,0));i.length===1&&(c=c.filter(m=>m!==n));const h=c.find(m=>m.textValue.toLowerCase().startsWith(i.toLowerCase()));return h!==n?h:void 0}St(rx,"findNextItem");function GC(e,t){return e.map((n,r)=>e[(t+r)%e.length])}St(GC,"wrapArray");var _6=Object.defineProperty,Ct=(e,t)=>_6(e,"name",{value:t,configurable:!0}),YC=["PageUp","PageDown"],WC=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],XC={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},qc="Slider",[sx,O6,z6]=Sc(qc),[ax,Mte]=bn(qc,[z6]),[P6,Kc]=ax(qc),L6=p.forwardRef(Ct(function(t,n){const{name:r,min:i=0,max:o=100,step:c=1,orientation:d="horizontal",disabled:h=!1,minStepsBetweenThumbs:m=0,defaultValue:x=[i],value:g,onValueChange:v=Ct(()=>{},"onValueChange"),onValueCommit:S=Ct(()=>{},"onValueCommit"),inverted:b=!1,form:j,...C}=t,k=p.useRef(new Set),N=p.useRef(0),E=p.useRef(!1),A=d==="horizontal"?I6:$6,[_,z]=p.useState(null),D=Je(n,z),[V=[],I]=Kn({prop:g,defaultProp:x,onChange:Ct(U=>{var ne;(ne=[...k.current][N.current])==null||ne.focus({preventScroll:!0,focusVisible:E.current}),E.current=!1,v(U)},"onChange")}),Q=p.useRef(V),B=p.useRef(V);p.useEffect(()=>{const U=j?_==null?void 0:_.ownerDocument.getElementById(j):_==null?void 0:_.closest("form");if(U instanceof HTMLFormElement){const K=Ct(()=>I(B.current),"reset");return U.addEventListener("reset",K),()=>U.removeEventListener("reset",K)}},[_,j,I]);function H(U){const K=ak(V,U);M(U,K)}Ct(H,"handleSlideStart");function ee(U){M(U,N.current)}Ct(ee,"handleSlideMove");function W(){String(V)!==String(Q.current)&&S(V)}Ct(W,"handleSlideEnd");function M(U,K,{commit:ne}={commit:!1}){const q=lx(c),P=Gc(Math.round((U-i)/c)*c+i,q),L=nl(P,[i,o]);I((G=[])=>{const J=rk(G,L,K);if(lk(J,m*c)){N.current=J.indexOf(L);const $=String(J)!==String(G);return $&&ne&&S(J),$?J:G}else return G})}return Ct(M,"updateValues"),l.jsx(P6,{scope:t.__scopeSlider,name:r,disabled:h,min:i,max:o,valueIndexToChangeRef:N,thumbs:k.current,values:V,orientation:d,form:j,children:l.jsx(sx.Provider,{scope:t.__scopeSlider,children:l.jsx(sx.Slot,{scope:t.__scopeSlider,children:l.jsx(A,{"aria-disabled":h,"data-disabled":h?"":void 0,...C,ref:D,onPointerDown:Ce(C.onPointerDown,()=>{h||(Q.current=V,E.current=!1)}),min:i,max:o,inverted:b,onSlideStart:h?void 0:H,onSlideMove:h?void 0:ee,onSlideEnd:h?void 0:W,onHomeKeyDown:()=>{h||(E.current=!0,M(i,0,{commit:!0}))},onEndKeyDown:()=>{h||(E.current=!0,M(o,V.length-1,{commit:!0}))},onStepKeyDown:({event:U,direction:K})=>{if(!h){E.current=!0;const P=YC.includes(U.key)||U.shiftKey&&WC.includes(U.key)?10:1,L=N.current,G=V[L],J=ck(G,{min:i,step:c,direction:K,multiplier:P});M(J,L,{commit:!0})}}})})})})},"Slider")),[QC,ZC]=ax(qc,{startEdge:"left",endEdge:"right",size:"width",direction:1}),I6=p.forwardRef(Ct(function(t,n){const{min:r,max:i,dir:o,inverted:c,onSlideStart:d,onSlideMove:h,onSlideEnd:m,onStepKeyDown:x,...g}=t,[v,S]=p.useState(null),b=Je(n,S),j=p.useRef(void 0),C=Uo(o),k=C==="ltr",N=k&&!c||!k&&c;function E(R){const A=j.current||v.getBoundingClientRect(),_=[0,A.width],D=Rf(_,N?[r,i]:[i,r]);return j.current=A,D(R-A.left)}return Ct(E,"getValueFromPointer"),l.jsx(QC,{scope:t.__scopeSlider,startEdge:N?"left":"right",endEdge:N?"right":"left",direction:N?1:-1,size:"width",children:l.jsx(JC,{dir:C,"data-orientation":"horizontal",...g,ref:b,style:{...g.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:R=>{const A=E(R.clientX);d==null||d(A)},onSlideMove:R=>{const A=E(R.clientX);h==null||h(A)},onSlideEnd:()=>{j.current=void 0,m==null||m()},onStepKeyDown:R=>{const _=XC[N?"from-left":"from-right"].includes(R.key);x==null||x({event:R,direction:_?-1:1})}})})},"SliderHorizontal")),$6=p.forwardRef(Ct(function(t,n){const{min:r,max:i,inverted:o,onSlideStart:c,onSlideMove:d,onSlideEnd:h,onStepKeyDown:m,...x}=t,g=p.useRef(null),v=Je(n,g),S=p.useRef(void 0),b=!o;function j(C){const k=S.current||g.current.getBoundingClientRect(),N=[0,k.height],R=Rf(N,b?[i,r]:[r,i]);return S.current=k,R(C-k.top)}return Ct(j,"getValueFromPointer"),l.jsx(QC,{scope:t.__scopeSlider,startEdge:b?"bottom":"top",endEdge:b?"top":"bottom",size:"height",direction:b?1:-1,children:l.jsx(JC,{"data-orientation":"vertical",...x,ref:v,style:{...x.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:C=>{const k=j(C.clientY);c==null||c(k)},onSlideMove:C=>{const k=j(C.clientY);d==null||d(k)},onSlideEnd:()=>{S.current=void 0,h==null||h()},onStepKeyDown:C=>{const N=XC[b?"from-bottom":"from-top"].includes(C.key);m==null||m({event:C,direction:N?-1:1})}})})},"SliderVertical")),JC=p.forwardRef(Ct(function(t,n){const{__scopeSlider:r,onSlideStart:i,onSlideMove:o,onSlideEnd:c,onHomeKeyDown:d,onEndKeyDown:h,onStepKeyDown:m,...x}=t,g=Kc(qc,r);return l.jsx(qe.span,{...x,ref:n,onKeyDown:Ce(t.onKeyDown,v=>{v.key==="Home"?(d(v),v.preventDefault()):v.key==="End"?(h(v),v.preventDefault()):YC.concat(WC).includes(v.key)&&(m(v),v.preventDefault())}),onPointerDown:Ce(t.onPointerDown,v=>{const S=v.target;S.setPointerCapture(v.pointerId),v.preventDefault(),g.thumbs.has(S)?S.focus({preventScroll:!0,focusVisible:!1}):i(v)}),onPointerMove:Ce(t.onPointerMove,v=>{v.target.hasPointerCapture(v.pointerId)&&o(v)}),onPointerUp:Ce(t.onPointerUp,v=>{const S=v.target;S.hasPointerCapture(v.pointerId)&&(S.releasePointerCapture(v.pointerId),c(v))})})},"SliderImpl")),B6="SliderTrack",U6=p.forwardRef(Ct(function(t,n){const{__scopeSlider:r,...i}=t,o=Kc(B6,r);return l.jsx(qe.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...i,ref:n})},"SliderTrack")),ek="SliderRange",V6=p.forwardRef(Ct(function(t,n){const{__scopeSlider:r,...i}=t,o=Kc(ek,r),c=ZC(ek,r),d=p.useRef(null),h=Je(n,d),m=o.values.length,x=o.values.map(S=>ox(S,o.min,o.max)),g=m>1?Math.min(...x):0,v=100-Math.max(...x);return l.jsx(qe.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,...i,ref:h,style:{...t.style,[c.startEdge]:g+"%",[c.endEdge]:v+"%"}})},"SliderRange")),F6="SliderThumb",[H6,tk]=ax(F6),q6="SliderThumbProvider";function nk(e){const{__scopeSlider:t,name:n,children:r,internal_do_not_use_render:i}=e,o=Kc(q6,t),c=O6(t),[d,h]=p.useState(null),m=p.useMemo(()=>d?c().findIndex(C=>C.ref.current===d):-1,[c,d]),x=nf(d),g=d?!!o.form||!!d.closest("form"):!0,v=o.values[m],S=n??(o.name?o.name+(o.values.length>1?"[]":""):void 0),b=v===void 0?0:ox(v,o.min,o.max);p.useEffect(()=>{if(d)return o.thumbs.add(d),()=>{o.thumbs.delete(d)}},[d,o.thumbs]);const j={value:v,name:S,form:o.form,isFormControl:g,index:m,thumb:d,onThumbChange:h,percent:b,size:x};return l.jsx(H6,{scope:t,...j,children:uk(i)?i(j):r})}Ct(nk,"SliderThumbProvider");var ix="SliderThumbTrigger",K6=p.forwardRef(Ct(function(t,n){const{__scopeSlider:r,...i}=t,o=Kc(ix,r),c=ZC(ix,r),{index:d,value:h,percent:m,size:x,onThumbChange:g}=tk(ix,r),v=Je(n,g),S=sk(d,o.values.length),b=x==null?void 0:x[c.size],j=b?ik(b,m,c.direction):0;return l.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${m}% + ${j}px)`},children:l.jsx(sx.ItemSlot,{scope:r,children:l.jsx(qe.span,{role:"slider","aria-label":t["aria-label"]||S,"aria-valuemin":o.min,"aria-valuenow":h,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...i,ref:v,style:h===void 0?{display:"none"}:t.style,onFocus:Ce(t.onFocus,()=>{o.valueIndexToChangeRef.current=d})})})})},"SliderThumbTrigger")),G6=p.forwardRef(Ct(function(t,n){const{__scopeSlider:r,name:i,...o}=t;return l.jsx(nk,{__scopeSlider:r,name:i,internal_do_not_use_render:({index:c,isFormControl:d})=>l.jsxs(l.Fragment,{children:[l.jsx(K6,{...o,ref:n,__scopeSlider:r}),d?l.jsx(W6,{__scopeSlider:r},c):null]})})},"SliderThumb")),Y6="SliderBubbleInput",W6=p.forwardRef(Ct(function({__scopeSlider:t,...n},r){const{value:i,name:o,form:c}=tk(Y6,t),d=p.useRef(null),h=Je(d,r),m=Fg(i);return p.useEffect(()=>{const x=d.current;if(!x)return;const g=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(g,"value").set;if(m!==i&&S){const b=new Event("input",{bubbles:!0});S.call(x,i),x.dispatchEvent(b)}},[m,i]),l.jsx(qe.input,{style:{display:"none"},name:o,form:c,...n,ref:h,defaultValue:i})},"SliderBubbleInput"));function rk(e=[],t,n){const r=[...e];return r[n]=t,r.sort((i,o)=>i-o)}Ct(rk,"getNextSortedValues");function ox(e,t,n){const o=100/(n-t)*(e-t);return nl(o,[0,100])}Ct(ox,"convertValueToPercentage");function sk(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}Ct(sk,"getLabel");function ak(e,t){if(e.length===1)return 0;const n=e.map(i=>Math.abs(i-t)),r=Math.min(...n);return n.indexOf(r)}Ct(ak,"getClosestValueIndex");function ik(e,t,n){const r=e/2,o=Rf([0,50],[0,r]);return(r-o(t)*n)*n}Ct(ik,"getThumbInBoundsOffset");function ok(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}Ct(ok,"getStepsBetweenValues");function lk(e,t){if(t>0){const n=ok(e);return Math.min(...n)>=t}return!0}Ct(lk,"hasMinStepsBetweenValues");function Rf(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}Ct(Rf,"linearScale");function lx(e){if(!Number.isFinite(e))return 0;const t=e.toString();if(t.includes("e")){const[r,i]=t.split("e"),o=r.split(".")[1]||"",c=Number(i);return Math.max(0,o.length-c)}const n=t.split(".")[1];return n?n.length:0}Ct(lx,"getDecimalCount");function Gc(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}Ct(Gc,"roundValue");function ck(e,{min:t,step:n,direction:r,multiplier:i}){const o=lx(n),c=(e-t)/n,d=Math.round(c),h=Gc(d*n+t,o)===Gc(e,o);let m;return h?m=d+i*r:r>0?m=Math.ceil(c):m=Math.floor(c),Gc(m*n+t,o)}Ct(ck,"getNextStepValue");function uk(e){return typeof e=="function"}Ct(uk,"isFunction");var X6=Object.defineProperty,Xa=(e,t)=>X6(e,"name",{value:t,configurable:!0}),cx="Switch",[Q6,Dte]=bn(cx),[Z6,ux]=Q6(cx);function dk(e){const{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:o,form:c,name:d,onCheckedChange:h,required:m,value:x="on",internal_do_not_use_render:g}=e,[v,S]=Kn({prop:n,defaultProp:i??!1,onChange:h,caller:cx}),[b,j]=p.useState(null),[C,k]=p.useState(null),N=p.useRef(!1),[E,R]=p.useReducer(z=>z+1,0),A=b?!!c||!!b.closest("form"):!0,_={checked:v,setChecked:S,disabled:o,control:b,setControl:j,name:d,form:c,value:x,hasConsumerStoppedPropagationRef:N,userInteractionCount:E,onUserInteraction:R,required:m,defaultChecked:i,isFormControl:A,bubbleInput:C,setBubbleInput:k};return l.jsx(Z6,{scope:t,..._,children:hk(g)?g(_):r})}Xa(dk,"SwitchProvider");var J6="SwitchTrigger",eV=p.forwardRef(Xa(function({__scopeSwitch:t,onClick:n,...r},i){const{control:o,form:c,value:d,disabled:h,checked:m,required:x,setControl:g,setChecked:v,hasConsumerStoppedPropagationRef:S,onUserInteraction:b,isFormControl:j,bubbleInput:C}=ux(J6,t),k=Je(i,g),N=p.useRef(m);return p.useEffect(()=>{const E=c?o==null?void 0:o.ownerDocument.getElementById(c):o==null?void 0:o.form;if(E instanceof HTMLFormElement){const R=Xa(()=>v(N.current),"reset");return E.addEventListener("reset",R),()=>E.removeEventListener("reset",R)}},[o,c,v]),l.jsx(qe.button,{type:"button",role:"switch","aria-checked":m,"aria-required":x,"data-state":dx(m),"data-disabled":h?"":void 0,disabled:h,value:d,...r,ref:k,onClick:Ce(n,E=>{b(),v(R=>!R),C&&j&&(S.current=E.isPropagationStopped(),S.current||E.stopPropagation())})})},"SwitchTrigger")),fk=p.forwardRef(Xa(function(t,n){const{__scopeSwitch:r,name:i,checked:o,defaultChecked:c,required:d,disabled:h,value:m,onCheckedChange:x,form:g,...v}=t;return l.jsx(dk,{__scopeSwitch:r,checked:o,defaultChecked:c,disabled:h,required:d,onCheckedChange:x,name:i,form:g,value:m,internal_do_not_use_render:({isFormControl:S})=>l.jsxs(l.Fragment,{children:[l.jsx(eV,{...v,ref:n,__scopeSwitch:r}),S&&l.jsx(sV,{__scopeSwitch:r})]})})},"Switch")),tV="SwitchThumb",nV=p.forwardRef(Xa(function(t,n){const{__scopeSwitch:r,...i}=t,o=ux(tV,r);return l.jsx(qe.span,{"data-state":dx(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:n})},"SwitchThumb")),rV="SwitchBubbleInput",sV=p.forwardRef(Xa(function({__scopeSwitch:t,onClick:n,...r},i){const{control:o,hasConsumerStoppedPropagationRef:c,userInteractionCount:d,checked:h,defaultChecked:m,required:x,disabled:g,name:v,value:S,form:b,bubbleInput:j,setBubbleInput:C}=ux(rV,t),k=Je(i,C),N=nf(o),E=p.useRef(!1),R=p.useRef(h),A=p.useRef(d);p.useEffect(()=>{const z=j;if(!z)return;const D=window.HTMLInputElement.prototype,I=Object.getOwnPropertyDescriptor(D,"checked").set,Q=d!==A.current;A.current=d;const B=R.current!==h;R.current=h;const H=!(Q&&c.current);if(B&&I){E.current=!Q;const ee=new Event("click",{bubbles:H});I.call(z,h),z.dispatchEvent(ee),E.current=!1}},[j,h,c,d]);const _=p.useRef(h);return l.jsx(qe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:m??_.current,required:x,disabled:g,name:v,value:S,form:b,...r,tabIndex:-1,ref:k,onClick:Ce(n,z=>{E.current&&z.stopPropagation()}),style:{...r.style,...N,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function hk(e){return typeof e=="function"}Xa(hk,"isFunction");function dx(e){return e?"checked":"unchecked"}Xa(dx,"getState");var aV=Object.defineProperty,Rn=(e,t)=>aV(e,"name",{value:t,configurable:!0}),[fx,_te]=bn("Tooltip",[_s]),hx=_s(),iV="TooltipProvider",oV=700,mx="tooltip.open",[lV,px]=fx(iV),cV=Rn(e=>{const{__scopeTooltip:t,delayDuration:n=oV,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,c=p.useRef(!0),d=p.useRef(!1),h=p.useRef(0);return p.useEffect(()=>{const m=h.current;return()=>window.clearTimeout(m)},[]),l.jsx(lV,{scope:t,isOpenDelayedRef:c,delayDuration:n,onOpen:p.useCallback(()=>{r<=0||(window.clearTimeout(h.current),c.current=!1)},[r]),onClose:p.useCallback(()=>{r<=0||(window.clearTimeout(h.current),h.current=window.setTimeout(()=>c.current=!0,r))},[r]),isPointerInTransitRef:d,onPointerInTransitChange:p.useCallback(m=>{d.current=m},[]),disableHoverableContent:i,children:o})},"TooltipProvider"),gx="Tooltip",[uV,Yc]=fx(gx),dV=Rn(e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:o,disableHoverableContent:c,delayDuration:d}=e,h=px(gx,e.__scopeTooltip),m=hx(t),[x,g]=p.useState(null),[v,S]=p.useState(void 0),b=cn(),j=p.useRef(0),C=c??h.disableHoverableContent,k=d??h.delayDuration,N=p.useRef(!1),[E,R]=Kn({prop:r,defaultProp:i??!1,onChange:Rn(I=>{I?(h.onOpen(),document.dispatchEvent(new CustomEvent(mx))):h.onClose(),o==null||o(I)},"onChange"),caller:gx}),A=p.useMemo(()=>E?N.current?"delayed-open":"instant-open":"closed",[E]),_=p.useCallback(()=>{window.clearTimeout(j.current),j.current=0,N.current=!1,R(!0)},[R]),z=p.useCallback(()=>{window.clearTimeout(j.current),j.current=0,R(!1)},[R]),D=p.useCallback(()=>{window.clearTimeout(j.current),j.current=window.setTimeout(()=>{N.current=!0,R(!0),j.current=0},k)},[k,R]);p.useEffect(()=>()=>{j.current&&(window.clearTimeout(j.current),j.current=0)},[]);const V=v??b;return l.jsx(el,{...m,children:l.jsx(uV,{scope:t,contentId:V,setContentId:S,open:E,stateAttribute:A,trigger:x,onTriggerChange:g,onTriggerEnter:p.useCallback(()=>{h.isOpenDelayedRef.current?D():_()},[h.isOpenDelayedRef,D,_]),onTriggerLeave:p.useCallback(()=>{C?z():(window.clearTimeout(j.current),j.current=0)},[z,C]),onOpen:_,onClose:z,disableHoverableContent:C,children:n})})},"Tooltip"),mk="TooltipTrigger",fV=p.forwardRef(Rn(function(t,n){const{__scopeTooltip:r,...i}=t,o=Yc(mk,r),c=px(mk,r),d=hx(r),h=p.useRef(null),m=Je(n,h,o.onTriggerChange),x=p.useRef(!1),g=p.useRef(!1),v=p.useCallback(()=>x.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),l.jsx(_c,{asChild:!0,...d,children:l.jsx(qe.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...i,ref:m,onPointerMove:Ce(t.onPointerMove,S=>{S.pointerType!=="touch"&&!g.current&&!c.isPointerInTransitRef.current&&(o.onTriggerEnter(),g.current=!0)}),onPointerLeave:Ce(t.onPointerLeave,()=>{o.onTriggerLeave(),g.current=!1}),onPointerDown:Ce(t.onPointerDown,()=>{o.open&&o.onClose(),x.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:Ce(t.onFocus,()=>{x.current||o.onOpen()}),onBlur:Ce(t.onBlur,o.onClose),onClick:Ce(t.onClick,o.onClose)})})},"TooltipTrigger")),pk="TooltipPortal",[hV,mV]=fx(pk,{forceMount:void 0}),pV=Rn(e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,o=Yc(pk,t);return l.jsx(hV,{scope:t,forceMount:n,children:l.jsx(wn,{present:n||o.open,children:l.jsx(Fo,{asChild:!0,container:i,children:r})})})},"TooltipPortal"),Wc="TooltipContent",gV=p.forwardRef(Rn(function(t,n){const r=mV(Wc,t.__scopeTooltip),{forceMount:i=r.forceMount,side:o="top",...c}=t,d=Yc(Wc,t.__scopeTooltip);return l.jsx(wn,{present:i||d.open,children:d.disableHoverableContent?l.jsx(gk,{side:o,...c,ref:n}):l.jsx(xV,{side:o,...c,ref:n})})},"TooltipContent")),xV=p.forwardRef(Rn(function(t,n){const r=Yc(Wc,t.__scopeTooltip),i=px(Wc,t.__scopeTooltip),o=p.useRef(null),c=Je(n,o),[d,h]=p.useState(null),{trigger:m,onClose:x}=r,g=o.current,{onPointerInTransitChange:v}=i,S=p.useCallback(()=>{h(null),v(!1)},[v]),b=p.useCallback((j,C)=>{const k=j.currentTarget,N={x:j.clientX,y:j.clientY},E=xk(N,k.getBoundingClientRect()),R=vk(N,E),A=yk(C.getBoundingClientRect()),_=wk([...R,...A]);h(_),v(!0)},[v]);return p.useEffect(()=>()=>S(),[S]),p.useEffect(()=>{if(m&&g){const j=Rn(k=>b(k,g),"handleTriggerLeave"),C=Rn(k=>b(k,m),"handleContentLeave");return m.addEventListener("pointerleave",j),g.addEventListener("pointerleave",C),()=>{m.removeEventListener("pointerleave",j),g.removeEventListener("pointerleave",C)}}},[m,g,b,S]),p.useEffect(()=>{if(d){const j=Rn(C=>{const k=C.target,N={x:C.clientX,y:C.clientY},E=(m==null?void 0:m.contains(k))||(g==null?void 0:g.contains(k)),R=!bk(N,d);E?S():R&&(S(),x())},"handleTrackPointerGrace");return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[m,g,d,x,S]),l.jsx(gk,{...t,ref:c})},"TooltipContentHoverable")),vV=P1("TooltipContent"),gk=p.forwardRef(Rn(function(t,n){const{__scopeTooltip:r,children:i,"aria-label":o,id:c,onEscapeKeyDown:d,onPointerDownOutside:h,...m}=t,x=Yc(Wc,r),g=hx(r),{onClose:v}=x;p.useEffect(()=>(document.addEventListener(mx,v),()=>document.removeEventListener(mx,v)),[v]),p.useEffect(()=>{if(x.trigger){const b=Rn(j=>{j.target instanceof Node&&j.target.contains(x.trigger)&&v()},"handleScroll");return window.addEventListener("scroll",b,{capture:!0}),()=>window.removeEventListener("scroll",b,{capture:!0})}},[x.trigger,v]);const{setContentId:S}=x;return Vt(()=>(S(c),()=>{S(void 0)}),[c,S]),l.jsx(Vo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:b=>b.preventDefault(),onDismiss:v,children:l.jsxs(Oc,{"data-state":x.stateAttribute,role:o?void 0:"tooltip",id:o?void 0:x.contentId,...g,...m,ref:n,style:{...m.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:[l.jsx(vV,{children:i}),o?l.jsx(XL,{id:x.contentId,role:"tooltip",children:o}):null]})})},"TooltipContentImpl"));function xk(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}Rn(xk,"getExitSideFromRect");function vk(e,t,n=5){const 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});break}return r}Rn(vk,"getPaddedExitPoints");function yk(e){const{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}]}Rn(yk,"getPointsFromRect");function bk(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,c=t.length-1;o<t.length;c=o++){const d=t[o],h=t[c],m=d.x,x=d.y,g=h.x,v=h.y;x>r!=v>r&&n<(g-m)*(r-x)/(v-x)+m&&(i=!i)}return i}Rn(bk,"isPointInPolygon");function wk(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Sk(t)}Rn(wk,"getHull");function Sk(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const o=t[t.length-1],c=t[t.length-2];if((o.x-c.x)*(i.y-c.y)>=(o.y-c.y)*(i.x-c.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],c=n[n.length-2];if((o.x-c.x)*(i.y-c.y)>=(o.y-c.y)*(i.x-c.x))n.pop();else break}n.push(i)}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)}Rn(Sk,"getHullPresorted");var yV=cV,bV=dV,wV=fV,SV=pV,jV=gV;const jk=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ck=e1,Ur=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Ck(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,c=Object.keys(i).map(m=>{const x=n==null?void 0:n[m],g=o==null?void 0:o[m];if(x===null)return null;const v=jk(x)||jk(g);return i[m][v]}),d=n&&Object.entries(n).reduce((m,x)=>{let[g,v]=x;return v===void 0||(m[g]=v),m},{}),h=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((m,x)=>{let{class:g,className:v,...S}=x;return Object.entries(S).every(b=>{let[j,C]=b;return Array.isArray(C)?C.includes({...o,...d}[j]):{...o,...d}[j]===C})?[...m,g,v]:m},[]);return Ck(e,c,h,n==null?void 0:n.class,n==null?void 0:n.className)},CV=dC,kV=fC,kk=p.createContext("default"),Nk="z-50 min-w-[10rem] rounded-[12px] border border-[var(--acr-border-soft)] bg-[var(--acr-surface)] p-1.5 text-foreground backdrop-blur-xl shadow-[0_8px_28px_rgba(0,0,0,0.18)] outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",Af=Ur("group/mi relative flex cursor-default select-none items-center rounded-[6px] px-2 outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-40 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{size:{default:"gap-2 py-1 text-[13px] leading-4 [&_svg]:size-4 data-[inset]:pl-8",sm:"gap-2 py-1 text-[11px] leading-[14px] [&_svg]:size-3.5 data-[inset]:pl-7",xs:"gap-1.5 py-[3px] text-[10px] leading-[13px] [&_svg]:size-3 data-[inset]:pl-6"}},defaultVariants:{size:"default"}}),Mf="data-[highlighted]:bg-[var(--primary)] data-[highlighted]:text-primary-foreground";function Df(){return p.useContext(kk)}const Tk=p.forwardRef(({className:e,size:t="default",children:n,...r},i)=>l.jsx(kk.Provider,{value:t,children:l.jsx(Sf,{children:l.jsx(hC,{ref:i,"data-slot":"dropdown-menu-content",sideOffset:4,className:Y(Nk,e),...r,children:n})})}));Tk.displayName="DropdownMenuContent";const xx=p.forwardRef(({className:e,inset:t,variant:n="default",...r},i)=>{const o=Df();return l.jsx(pC,{ref:i,"data-slot":"dropdown-menu-item","data-inset":t||void 0,"data-variant":n,className:Y(Af({size:o}),n==="default"?Mf:"data-[highlighted]:bg-destructive/15 data-[highlighted]:text-destructive",e),...r})});xx.displayName="DropdownMenuItem";const NV=p.forwardRef(({className:e,children:t,checked:n,...r},i)=>{const o=Df();return l.jsxs(gC,{ref:i,"data-slot":"dropdown-menu-checkbox-item",className:Y(Af({size:o}),"relative pl-8",Mf,e),checked:n,...r,children:[l.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:l.jsx(jf,{children:l.jsx(Ns,{className:"size-3.5"})})}),t]})});NV.displayName="DropdownMenuCheckboxItem";const TV=p.forwardRef(({className:e,children:t,...n},r)=>{const i=Df();return l.jsxs(xC,{ref:r,"data-slot":"dropdown-menu-radio-item",className:Y(Af({size:i}),"relative pl-8",Mf,e),...n,children:[l.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:l.jsx(jf,{children:l.jsx($d,{className:"size-2 fill-current"})})}),t]})});TV.displayName="DropdownMenuRadioItem";const EV=p.forwardRef(({className:e,inset:t,...n},r)=>l.jsx(mC,{ref:r,"data-slot":"dropdown-menu-label","data-inset":t||void 0,className:Y("px-2 py-1.5 text-[10px] font-medium text-muted-foreground/70 data-[inset]:pl-8",e),...n}));EV.displayName="DropdownMenuLabel";const RV=p.forwardRef(({className:e,...t},n)=>l.jsx(vC,{ref:n,"data-slot":"dropdown-menu-separator",className:Y("-mx-1 my-1 h-px bg-[var(--acr-border-soft)]",e),...t}));RV.displayName="DropdownMenuSeparator";const AV=p.forwardRef(({className:e,inset:t,children:n,...r},i)=>{const o=Df();return l.jsxs(yC,{ref:i,"data-slot":"dropdown-menu-sub-trigger","data-inset":t||void 0,className:Y(Af({size:o}),"data-[state=open]:bg-[var(--acr-hover)] data-[state=open]:text-foreground",Mf,e),...r,children:[n,l.jsx(Ts,{className:"ml-auto"})]})});AV.displayName="DropdownMenuSubTrigger";const MV=p.forwardRef(({className:e,...t},n)=>l.jsx(Sf,{children:l.jsx(bC,{ref:n,"data-slot":"dropdown-menu-sub-content",className:Y(Nk,e),...t})}));MV.displayName="DropdownMenuSubContent";const vx=Ur("inline-flex shrink-0 select-none items-center justify-center whitespace-nowrap font-medium transition-[background-color,box-shadow,filter,opacity,scale] [transition-timing-function:var(--acr-spring-default)] [transition-duration:var(--acr-spring-default-duration)] active:scale-[0.97] outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-40 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:brightness-110 active:brightness-95",secondary:"bg-primary/10 text-primary hover:bg-primary/15 active:bg-primary/20",destructive:"bg-destructive/25 text-destructive hover:bg-destructive/35 active:bg-destructive/45",neutral:"bg-[var(--acr-chip)] text-foreground hover:bg-[var(--acr-chip-hover)]",ghost:"bg-transparent text-foreground hover:bg-[var(--acr-chip)] active:bg-[var(--acr-chip-hover)]",link:"bg-transparent text-primary hover:underline hover:underline-offset-4 active:opacity-80 active:scale-100"},size:{mini:"h-4 gap-1 rounded-[4px] px-[7px] text-[10px] [letter-spacing:var(--text-footnote-tracking)] [&_svg]:size-3",small:"h-5 gap-1 rounded-[5px] px-[10px] text-[11px] [letter-spacing:var(--text-subheadline-tracking)] [&_svg]:size-3",medium:"h-6 gap-1 rounded-[6px] px-4 text-[13px] [letter-spacing:var(--text-body-tracking)] [&_svg]:size-3.5",large:"h-7 gap-1 rounded-[14px] px-4 text-[13px] [letter-spacing:var(--text-body-tracking)] [&_svg]:size-4",xl:"h-9 gap-1 rounded-[18px] px-4 text-[13px] [letter-spacing:var(--text-body-tracking)] [&_svg]:size-[18px]"},icon:{true:"rounded-full p-0",false:""}},compoundVariants:[{icon:!0,size:"mini",class:"size-4 [&_svg]:size-3"},{icon:!0,size:"small",class:"size-5 [&_svg]:size-3.5"},{icon:!0,size:"medium",class:"size-6 [&_svg]:size-4"},{icon:!0,size:"large",class:"size-7 [&_svg]:size-[18px]"},{icon:!0,size:"xl",class:"size-9 [&_svg]:size-[22px]"}],defaultVariants:{variant:"default",size:"medium",icon:!1}}),Ne=p.forwardRef(({className:e,variant:t,size:n,icon:r,asChild:i=!1,...o},c)=>{const d=i?Fi:"button";return l.jsx(d,{ref:c,"data-slot":"button","data-variant":t,"data-size":n,"data-icon":r||void 0,className:Y(vx({variant:t,size:n,icon:r,className:e})),...o})});Ne.displayName="Button";const DV="[role=dialog][data-state=open],[role=alertdialog][data-state=open]";let al=null,_f=0;function Of(){const e=document.querySelector(DV)!=null;document.documentElement.classList.toggle("modal-acrylic",e)}function _V(){_f+=1,al||(al=new MutationObserver(Of),al.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-state"]})),Of()}function OV(){_f=Math.max(0,_f-1),queueMicrotask(Of),_f===0&&al&&(al.disconnect(),al=null,queueMicrotask(Of))}function zV(){p.useEffect(()=>(_V(),OV),[])}function yx(){return zV(),p.createElement("span",{"aria-hidden":!0,style:{display:"none"}})}const hs=Nc,PV=Tc,Ek=p.forwardRef(({className:e,...t},n)=>l.jsx(Wo,{ref:n,className:Y("fixed inset-0 z-50 bg-[var(--acr-overlay)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,style:{backdropFilter:"blur(20px) saturate(1.3)",WebkitBackdropFilter:"blur(20px) saturate(1.3)"}}));Ek.displayName=Wo.displayName;const Vr=p.forwardRef(({className:e,children:t,showCloseButton:n=!0,...r},i)=>l.jsxs(PV,{children:[l.jsx(Ek,{}),l.jsxs(Xo,{ref:i,onOpenAutoFocus:o=>o.preventDefault(),className:Y("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg [&>*]:min-w-0 translate-x-[-50%] translate-y-[-50%] gap-4 rounded-[20px] bg-[var(--acr-panel)] backdrop-blur-xl p-6 shadow-[0_0_0_1px_rgba(190,190,190,0.16),0_16px_48px_rgba(0,0,0,0.45)] duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",e),...r,children:[l.jsx(yx,{}),t,n&&l.jsx(Hi,{asChild:!0,children:l.jsxs(Ne,{variant:"ghost",icon:!0,"aria-label":"Close",className:"absolute right-3 top-3 text-muted-foreground",children:[l.jsx(Ui,{}),l.jsx("span",{className:"sr-only",children:"Close"})]})})]})]}));Vr.displayName=Xo.displayName;const Os=({className:e,...t})=>l.jsx("div",{className:Y("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Os.displayName="DialogHeader";const Xc=({className:e,...t})=>l.jsx("div",{className:Y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Xc.displayName="DialogFooter";const Fr=p.forwardRef(({className:e,...t},n)=>l.jsx(Rc,{ref:n,className:Y("text-lg font-semibold leading-none tracking-tight",e),...t}));Fr.displayName=Rc.displayName;const Qa=p.forwardRef(({className:e,...t},n)=>l.jsx(Ac,{ref:n,className:Y("text-sm text-muted-foreground",e),...t}));Qa.displayName=Ac.displayName;const Rk=Ur(Y("flex w-full min-w-0 border border-[var(--acr-input-border)] bg-[var(--acr-input)] text-foreground outline-none","transition-[color,background-color,border-color,box-shadow] [transition-timing-function:var(--acr-spring-default)] [transition-duration:var(--acr-spring-default-duration)]","placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground","hover:border-[var(--acr-border)] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/25","disabled:cursor-not-allowed disabled:opacity-50","file:inline-flex file:border-0 file:bg-transparent file:font-medium file:text-foreground"),{variants:{size:{mini:"h-4 rounded-[4px] px-1.5 text-[10px] [letter-spacing:var(--text-footnote-tracking)]",small:"h-5 rounded-[5px] px-1.5 text-[11px] [letter-spacing:var(--text-subheadline-tracking)]",medium:"h-6 rounded-[6px] px-2 text-[13px]",large:"h-7 rounded-[7px] px-2 text-[15px]",xl:"h-9 rounded-[9px] px-2.5 text-[17px] [letter-spacing:var(--text-title2-tracking)]"}},defaultVariants:{size:"medium"}});function Jt({className:e,type:t,size:n,...r}){return l.jsx("input",{type:t,"data-slot":"input","data-size":n,className:Y(Rk({size:n,className:e})),...r})}function LV({conn:e,mode:t,root:n,seededBundle:r}){const[i,o]=p.useState(!1),[c,d]=p.useState([]),[h,m]=p.useState(null),[x,g]=p.useState(""),[v,S]=p.useState([]),[b,j]=p.useState(new Set),[C,k]=p.useState([]),[N,E]=p.useState(new Set),R=async I=>{o(!0);try{m(await be.sharing.importBundle(e,I))}catch(Q){Ge.error(`导入失败:${Q.message}`)}finally{o(!1)}},A=async(I,Q)=>{if(h){try{await be.sharing.decide(e,h.id,I.id,Q)}catch(B){Ge[B instanceof sr&&B.status===409?"warning":"error"](`处理失败:${B.message}`)}m(await be.sharing.importRun(e,h.id).catch(()=>h))}};p.useEffect(()=>{t==="import"&&r&&R({bundle:r}),t==="export"&&(be.providers(e).then(I=>S(I.filter(Q=>Q.system!==!0))).catch(()=>S([])),be.netdisk.list(e).then(I=>k(I)).catch(()=>k([])))},[]);const _=async()=>{var I;if(n){o(!0);try{const Q={...b.size?{providerIds:[...b]}:{},...N.size?{netdiskBindingIds:[...N]}:{}},{bundle:B,warnings:H}=await be.sharing.exportBundle(e,n,void 0,Object.keys(Q).length?Q:void 0);d(H);const ee=JSON.stringify(B,null,2),W=String(((I=B.meta)==null?void 0:I.title)??"stream"),M=new Blob([ee],{type:"application/json"}),U=URL.createObjectURL(M),K=document.createElement("a");K.href=U,K.download=`${W}.stream-bundle.json`,K.click(),URL.revokeObjectURL(U),Ge.success("分享包已导出")}catch(Q){Ge.error(`导出失败:${Q.message}`)}finally{o(!1)}}},z=async I=>{var B;const Q=(B=I.target.files)==null?void 0:B[0];if(Q)try{const H=JSON.parse(await Q.text());await R({bundle:H})}catch(H){Ge.error(`文件不是合法 JSON:${H.message}`)}};if(t==="export")return l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsxs("p",{className:"text-sm text-[var(--acr-text-secondary)]",children:["把这个编排导出为单个 ",l.jsx("code",{children:"stream-bundle/v1"})," JSON——凭证永不进包,可发到 gist / 任意 git 让别人导入。"]}),l.jsxs("details",{className:"text-sm",children:[l.jsx("summary",{className:"cursor-pointer text-[var(--acr-text-secondary)]",children:"带上我改过的能力(可选)"}),v.length===0?l.jsx("p",{className:"mt-1 text-xs text-[var(--acr-text-secondary)]",children:"没有可搭车的自定义 Provider(系统默认行不进包)。"}):l.jsx("ul",{className:"mt-1 flex flex-col gap-1",children:v.map(I=>l.jsx("li",{children:l.jsxs("label",{className:"flex items-center gap-2",children:[l.jsx("input",{type:"checkbox",checked:b.has(I.id),onChange:Q=>{j(B=>{const H=new Set(B);return Q.target.checked?H.add(I.id):H.delete(I.id),H})}}),l.jsxs("span",{children:[I.label,l.jsx("span",{className:"ml-1 text-xs text-[var(--acr-text-secondary)]",children:I.id})]})]})},I.id))}),C.length>0&&l.jsxs("div",{className:"mt-2",children:[l.jsx("div",{className:"text-xs text-[var(--acr-text-secondary)]",children:"网盘对齐 binding(matchSpec 随包,对方转存后自动重算;不带 fileId/凭证):"}),l.jsx("ul",{className:"mt-1 flex flex-col gap-1",children:C.map(I=>l.jsx("li",{children:l.jsxs("label",{className:"flex items-center gap-2",children:[l.jsx("input",{type:"checkbox",checked:N.has(I.id),onChange:Q=>{E(B=>{const H=new Set(B);return Q.target.checked?H.add(I.id):H.delete(I.id),H})}}),l.jsx("span",{children:I.left.title})]})},I.id))})]})]}),l.jsx(Ne,{onClick:_,disabled:i||!n,children:i?"导出中…":"生成并下载分享包"}),c.length>0&&l.jsx("ul",{className:"text-xs text-amber-500 list-disc pl-4",children:c.map((I,Q)=>l.jsx("li",{children:I},Q))})]});const D=(h==null?void 0:h.items.filter(I=>I.status==="open"))??[],V=((h==null?void 0:h.items.length)??0)-D.length;return l.jsxs("div",{className:"flex flex-col gap-3",children:[!r&&l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsxs("div",{className:"flex gap-2",children:[l.jsx(Jt,{placeholder:"贴一个分享包 URL(raw / gist / 任意 git)",value:x,onChange:I=>g(I.target.value)}),l.jsx(Ne,{onClick:()=>R({url:x}),disabled:i||!x,children:"导入"})]}),l.jsxs("label",{className:"text-sm",children:["或选一个本地分享包文件:",l.jsx("input",{type:"file",accept:"application/json,.json",onChange:z,className:"ml-2"})]})]}),i&&l.jsx("p",{className:"text-sm",children:"导入中…"}),h&&l.jsxs("div",{className:"flex flex-col gap-2 text-sm",children:[l.jsxs("div",{className:"text-[var(--acr-text-secondary)]",children:["已导入「",h.meta.title,"」",Object.keys(h.remaps).length>0&&l.jsxs(l.Fragment,{children:["(已重映射 ",Object.keys(h.remaps).length," 个撞车 id,未改动你已有的编排)"]})]}),h.netdiskBindings.length>0&&l.jsxs("div",{children:[l.jsxs("div",{className:"font-medium",children:["网盘对齐 binding 待转存(",h.netdiskBindings.length,"):"]}),l.jsx("ul",{className:"list-disc pl-4",children:h.netdiskBindings.map(I=>l.jsxs("li",{children:[I.title,I.shareUrl&&l.jsxs(l.Fragment,{children:[" — ",l.jsx("a",{href:I.shareUrl,target:"_blank",rel:"noreferrer",className:"underline",children:"分享链接"})]})]},I.id))}),l.jsx("div",{className:"mt-1 text-xs text-[var(--acr-text-secondary)]",children:"用你自己的夸克登录态转存 → 挂进 AList → 在网盘对齐里对该绑定 rebind 到新目录,随包 matchSpec 会自动重算映射。"})]}),D.length>0&&l.jsxs("div",{className:"font-medium",children:["待处理(",D.length,"):"]}),D.map(I=>l.jsx(IV,{item:I,onDecide:A},I.id)),D.length===0&&V===h.items.length&&h.items.length>0&&l.jsx("div",{className:"text-xs text-[var(--acr-text-secondary)]",children:"全部事项已处理。"}),D.length===0&&h.items.length===0&&l.jsx("div",{className:"text-xs text-[var(--acr-text-secondary)]",children:"没有需要处理的事项。"})]})]})}function IV({item:e,onDecide:t}){var i;const n={"use-imported":"用导入的","keep-mine":"用本机的",append:"按序并存",dismiss:"先不管"},r=l.jsx("div",{className:"mt-1 flex gap-2",children:e.choices.map(o=>l.jsx(Ne,{variant:o==="use-imported"?void 0:"neutral",onClick:()=>t(e,o),children:n[o]??o},o))});if(e.kind==="slot-conflict"){const o=[{title:"本机(现在生效)",side:e.mine},{title:"包内传入",side:e.theirs}];return l.jsxs("div",{className:"rounded border border-[var(--acr-border-soft)] p-2",children:[l.jsxs("div",{children:[String(e.subject.channelId)," · ",String(e.subject.callsiteId)]}),l.jsx("div",{className:"mt-1 grid grid-cols-2 gap-2",children:o.map(({title:c,side:d})=>l.jsxs("div",{className:"rounded border border-[var(--acr-border-soft)] p-2",children:[l.jsx("div",{className:"text-xs text-[var(--acr-text-secondary)]",children:c}),l.jsx("ul",{children:((d==null?void 0:d.providers)??(d==null?void 0:d.providerIds.map(h=>({id:h,label:h,parked:!1})))??[]).map(h=>l.jsxs("li",{children:[h.label,h.parked&&l.jsx("span",{className:"ml-1 text-xs text-amber-500",children:"(未激活)"})]},h.id))})]},c))}),r]})}if(e.kind==="parked-provider"){const o=e.subject;return l.jsxs("div",{className:"rounded border border-[var(--acr-border-soft)] p-2",children:[l.jsxs("div",{children:[o.label,l.jsx("span",{className:"ml-1 text-xs text-[var(--acr-text-secondary)]",children:(o.serves??[]).join(", ")})]}),(((i=e.conflicts)==null?void 0:i.length)??0)>0&&l.jsx("div",{className:"mt-1 text-xs text-amber-500",children:e.conflicts.map(c=>c.kind==="serves-overlap"?`与本机 ${c.rivalProviderId} 在 [${(c.overlapKeys??[]).join(", ")}] 上重叠`:c.kind==="fallback-overlap"?`与本机 ${c.rivalProviderId} 同为 ${c.category} 的兜底行,未命中的键归谁将由 id 序决定`:`binding 覆盖抢占已占用的 ${c.callsiteId}`).join(";")}),r]})}return l.jsxs("div",{className:"rounded border border-[var(--acr-border-soft)] p-2 text-[var(--acr-text-secondary)]",children:[l.jsx("div",{children:e.detail}),r]})}function zf({title:e,onRefresh:t,refreshLabel:n,exportChannel:r,className:i}){const{t:o}=Sp(),[c,d]=p.useState(!1);return l.jsxs(CV,{children:[l.jsx(kV,{asChild:!0,children:l.jsx("button",{type:"button",className:Y("flex min-w-0 items-center rounded-xl px-2 py-1 text-left text-[14px]/[20px] font-medium text-foreground outline-none transition-colors hover:bg-accent/15 focus-visible:ring-2 focus-visible:ring-ring/50",i),children:l.jsx("span",{className:"min-w-0 flex-1 truncate",children:e})})}),l.jsxs(Tk,{align:"start",children:[l.jsx(xx,{onSelect:t,children:n??o("timeline.reharvest")}),r?l.jsx(xx,{onSelect:()=>d(!0),children:"导出为分享包"}):null]}),r?l.jsx(hs,{open:c,onOpenChange:d,children:l.jsxs(Vr,{children:[l.jsxs(Os,{children:[l.jsx(Fr,{children:"导出为分享包"}),l.jsx(Qa,{children:"单个 JSON,凭证永不进包;可发到 gist / 任意 git 让别人导入。"})]}),c?l.jsx(LV,{conn:r.conn,mode:"export",root:{kind:"channel",id:r.id}}):null]})}):null]})}const $V=e=>({materialize:()=>be.extension.materialize(e),install:()=>be.extension.install(e),decline:()=>be.extension.decline(e)});function Ak({variant:e,actions:t,onDismiss:n,onConnected:r}){const[i,o]=p.useState({kind:"idle"}),c=async()=>{o({kind:"running"});try{const m=await t.install();o({kind:"done",outcome:m}),m.status==="connected"&&(r==null||r())}catch(m){o({kind:"failed",message:m instanceof Error?m.message:String(m)})}},d=async()=>{o({kind:"manual"});try{const{dir:m}=await t.materialize();o({kind:"manual",dir:m})}catch(m){o({kind:"manual",error:m instanceof Error?m.message:String(m)})}},h=async()=>{await t.decline().catch(()=>{}),n==null||n()};return l.jsxs("div",{className:e==="banner"?"space-y-2 border-b border-[var(--acr-border-soft)] px-3 py-2.5 text-[12px] leading-relaxed":"space-y-2 rounded-md border border-[var(--acr-border-soft)] px-3 py-2.5 text-[12px] leading-relaxed",children:[l.jsxs("p",{className:"text-muted-foreground",children:[e==="inline"?"这一步需要 Chrome 扩展(要用你的登录态)。":null,"Stream 采集你关注的内容时要借你自己那个 Chrome 的",l.jsx("span",{className:"text-foreground",children:"登录态"}),"——小红书、B站、抖音这些站,不登录就只能看到游客能看的东西。所以要在你的 Chrome 里装一个小扩展。"]}),i.kind==="confirm"&&l.jsxs("div",{className:"space-y-1.5 rounded-md bg-foreground/5 px-2.5 py-2 text-muted-foreground",children:[l.jsxs("p",{children:["我会打开 Chrome 的扩展管理页,打开右上角的开发者模式开关,然后选中 Stream 的扩展目录把它装上。这几步你会在屏幕上看到——期间屏幕顶部会有一条提示告诉你 AI 正在操作,按 ",l.jsx("span",{className:"text-foreground",children:"Ctrl+Alt+Esc"})," 随时能停。"]}),l.jsxs("p",{children:["装好之后 Chrome 每次启动会问你要不要停用",l.jsx("span",{className:"text-foreground",children:"开发者模式扩展"}),",点「保留」就行——这是 Chrome 对所有非商店扩展的固定提醒,不是出了问题。"]}),l.jsxs("div",{className:"flex gap-2 pt-0.5",children:[l.jsx(Qc,{onClick:c,children:"确认"}),l.jsx(Qc,{onClick:()=>o({kind:"idle"}),children:"再想想"})]})]}),i.kind==="running"&&l.jsxs("p",{className:"flex items-center gap-1.5 text-muted-foreground",children:[l.jsx(Sr,{className:"size-3.5 animate-spin"}),"正在装……屏幕上能看到操作过程,按 Ctrl+Alt+Esc 可以随时停下。"]}),i.kind==="done"&&l.jsx(BV,{outcome:i.outcome,onManual:d}),i.kind==="failed"&&l.jsxs("p",{className:"text-amber-500",children:["代装没能跑起来:",i.message,l.jsx("span",{className:"text-muted-foreground",children:"(这一趟根本没开始,不是装到一半坏了。)"})]}),i.kind==="manual"&&l.jsx("div",{className:"space-y-1 text-muted-foreground",children:i.error?l.jsxs("p",{className:"text-amber-500",children:["拿不到扩展目录:",i.error]}):i.dir===void 0?l.jsx("p",{children:"准备扩展目录……"}):l.jsxs(l.Fragment,{children:[l.jsxs("p",{children:["打开 ",l.jsx("code",{className:"text-foreground",children:"chrome://extensions"}),",右上角打开「开发者模式」,点「加载未打包的扩展程序」,选这个目录:"]}),l.jsx("p",{children:l.jsx("code",{className:"break-all text-foreground",children:i.dir})})]})}),(i.kind==="idle"||i.kind==="manual"||i.kind==="failed"||i.kind==="done")&&l.jsxs("div",{className:"flex flex-wrap gap-2",children:[l.jsx(Qc,{onClick:()=>o({kind:"confirm"}),children:"帮我装"}),l.jsx(Qc,{onClick:d,children:"我自己来"}),e==="banner"&&l.jsx(Qc,{onClick:h,children:"以后再说"})]})]})}function BV({outcome:e,onManual:t}){return e.status==="connected"?l.jsx("p",{className:"text-foreground",children:"装好了,扩展已经连上 Stream。"}):e.status==="needs-chrome-restart"?l.jsxs("p",{className:"text-muted-foreground",children:["扩展装上了,但还没和 Stream 握上手。多半是 Chrome 需要",l.jsx("span",{className:"text-foreground",children:"重启一次"}),"才能读到本机的通道配置——你自己重启一下 Chrome,然后回来看这里。"]}):l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"text-amber-500",children:e.reason}),l.jsxs("p",{className:"text-muted-foreground",children:["也可以",l.jsx("button",{type:"button",onClick:t,className:"mx-1 underline underline-offset-2",children:"自己装"}),"——步骤和目录我给你。"]})]})}function Qc({onClick:e,children:t}){return l.jsx("button",{type:"button",onClick:e,className:"rounded-md border border-[var(--acr-border-soft)] px-2.5 py-1 text-[12px] transition-colors hover:border-foreground/40",children:t})}function UV({actions:e,onConnected:t}){return l.jsx("div",{role:"status",className:"px-3 py-2",children:l.jsx(Ak,{variant:"inline",actions:e,onConnected:t})})}function VV(e){const[t,n]=p.useState(void 0),[r,i]=p.useState(void 0),[o,c]=p.useState(0);return p.useEffect(()=>{let d=!0;return be.extension.capability(e).then(h=>{d&&n(h.state)}).catch(()=>{d&&n(void 0)}),be.extension.onboarding(e).then(h=>{d&&i(h.declinedAt)}).catch(()=>{d&&i(void 0)}),()=>{d=!1}},[e,o]),{state:t,declinedAt:r,refresh:p.useCallback(()=>c(d=>d+1),[])}}const Mk="stream.extension-prompt",FV=1440*60*1e3;function HV(e,t,n){const r=t.lastPromptedAt;if(!r)return!0;const i=Date.parse(r);return Number.isNaN(i)?!0:n.getTime()-i>=FV}function Dk(){try{const e=localStorage.getItem(Mk);return e?JSON.parse(e):{}}catch{return{}}}function qV(e){return Dk()[e]??{}}function KV(e,t){try{const n=Dk();n[e]={lastPromptedAt:t.toISOString()},localStorage.setItem(Mk,JSON.stringify(n))}catch{}}const GV=Ur("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium leading-none whitespace-nowrap transition-[color,background-color,box-shadow] [transition-timing-function:var(--acr-spring-default)] [transition-duration:var(--acr-spring-default-duration)] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-[var(--acr-chip)] text-foreground [a&]:hover:bg-[var(--acr-chip-hover)] group-data-[selected=true]/item:bg-white/15 group-data-[selected=true]/item:text-primary-foreground",destructive:"bg-destructive text-white focus-visible:ring-destructive/20 [a&]:hover:bg-destructive/90",outline:"border-[var(--acr-border)] text-foreground [a&]:hover:bg-[var(--acr-hover)] group-data-[selected=true]/item:border-primary-foreground/30 group-data-[selected=true]/item:text-primary-foreground",ghost:"[a&]:hover:bg-[var(--acr-hover)]",link:"text-primary underline-offset-4 [a&]:hover:underline"},size:{default:"",sm:"px-1.5 text-[11px] leading-none [letter-spacing:var(--text-subheadline-tracking)]"}},defaultVariants:{variant:"default",size:"default"}});function Bt({className:e,variant:t="default",size:n="default",asChild:r=!1,...i}){const o=r?Fi:"span";return l.jsx(o,{"data-slot":"badge","data-variant":t,className:Y(GV({variant:t,size:n}),e),...i})}const YV=Ur(Y("flex w-fit min-w-0 select-none items-center justify-between gap-2 border border-[var(--acr-control-border)] bg-[var(--acr-control)] text-foreground outline-none transition-colors","data-[placeholder]:text-muted-foreground","hover:border-[var(--acr-border)] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/25","disabled:cursor-not-allowed disabled:opacity-50","[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:opacity-60"),{variants:{size:{mini:"h-4 rounded-[4px] pl-1.5 pr-1 text-[10px] [&_svg]:size-3",small:"h-5 rounded-[5px] pl-2 pr-1 text-[11px] [&_svg]:size-3",medium:"h-6 rounded-[6px] pl-2 pr-1.5 text-[13px] [&_svg]:size-3.5",large:"h-7 rounded-[14px] pl-3 pr-2 text-[13px] [&_svg]:size-3.5",xl:"h-9 rounded-[18px] pl-3.5 pr-2.5 text-[13px] [&_svg]:size-4"}},defaultVariants:{size:"medium"}});function la({...e}){return l.jsx(i6,{"data-slot":"select",...e})}function ca({...e}){return l.jsx(u6,{"data-slot":"select-value",...e})}function ua({className:e,size:t,children:n,...r}){return l.jsxs(l6,{"data-slot":"select-trigger","data-size":t,className:Y(YV({size:t,className:e})),...r,children:[l.jsx("span",{className:"truncate",children:n}),l.jsx(d6,{asChild:!0,children:l.jsx(sL,{})})]})}function da({className:e,children:t,position:n="popper",...r}){return l.jsx(p6,{children:l.jsxs(g6,{"data-slot":"select-content",position:n,className:Y("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] overflow-hidden rounded-[10px] border border-[var(--acr-border)] bg-[var(--acr-panel)] p-1 text-foreground backdrop-blur-xl shadow-[0_0_0_1px_rgba(190,190,190,0.16),0_16px_48px_rgba(0,0,0,0.45)] outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),...r,children:[l.jsx(WV,{}),l.jsx(S6,{className:Y("scrollbar-mac",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),l.jsx(XV,{})]})})}function lr({className:e,children:t,...n}){return l.jsxs(k6,{"data-slot":"select-item",className:Y("relative flex w-full cursor-default select-none items-center gap-2 rounded-[6px] py-1.5 pl-2 pr-7 text-[13px] outline-none","data-[highlighted]:bg-[var(--acr-hover)] data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[l.jsx(N6,{children:t}),l.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:l.jsx(E6,{children:l.jsx(Ns,{className:"size-3.5"})})})]})}function WV({className:e,...t}){return l.jsx(R6,{"data-slot":"select-scroll-up-button",className:Y("flex cursor-default items-center justify-center py-1 text-muted-foreground",e),...t,children:l.jsx(rL,{className:"size-3.5"})})}function XV({className:e,...t}){return l.jsx(A6,{"data-slot":"select-scroll-down-button",className:Y("flex cursor-default items-center justify-center py-1 text-muted-foreground",e),...t,children:l.jsx(zo,{className:"size-3.5"})})}function Un(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)}function Zc(e,t,n,r,i){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}typeof SuppressedError=="function"&&SuppressedError;var eo,Hr,il,Pf;const _k="__TAURI_TO_IPC_KEY__";function QV(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}class ZV{constructor(t){eo.set(this,void 0),Hr.set(this,0),il.set(this,[]),Pf.set(this,void 0),Zc(this,eo,t||(()=>{})),this.id=QV(n=>{const r=n.index;if("end"in n){r==Un(this,Hr,"f")?this.cleanupCallback():Zc(this,Pf,r);return}const i=n.message;if(r==Un(this,Hr,"f")){for(Un(this,eo,"f").call(this,i),Zc(this,Hr,Un(this,Hr,"f")+1);Un(this,Hr,"f")in Un(this,il,"f");){const o=Un(this,il,"f")[Un(this,Hr,"f")];Un(this,eo,"f").call(this,o),delete Un(this,il,"f")[Un(this,Hr,"f")],Zc(this,Hr,Un(this,Hr,"f")+1)}Un(this,Hr,"f")===Un(this,Pf,"f")&&this.cleanupCallback()}else Un(this,il,"f")[r]=i})}cleanupCallback(){window.__TAURI_INTERNALS__.unregisterCallback(this.id)}set onmessage(t){Zc(this,eo,t)}get onmessage(){return Un(this,eo,"f")}[(eo=new WeakMap,Hr=new WeakMap,il=new WeakMap,Pf=new WeakMap,_k)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[_k]()}}async function Ok(e,t={},n){return window.__TAURI_INTERNALS__.invoke(e,t,n)}function JV(){return!!(globalThis||window).isTauri}const eF={fetch:(e,t)=>globalThis.fetch(e,t),openSocket(e,t){const n=new WebSocket(e);return n.onopen=()=>{var r;return(r=t.onOpen)==null?void 0:r.call(t)},n.onmessage=r=>t.onMessage(String(r.data)),n.onclose=()=>{var r;return(r=t.onClose)==null?void 0:r.call(t)},n.onerror=()=>n.close(),{send(r){if(n.readyState!==WebSocket.OPEN)throw new Error("socket is not open");n.send(r)},close(){n.readyState===WebSocket.CONNECTING?n.onopen=()=>n.close():n.close()}}}},tF={fetch:(e,t)=>globalThis.fetch(e,t),openSocket(e,t){let n=null,r=!1;return(async()=>{var i,o;try{const{default:c}=await Promise.resolve().then(()=>fJ),d=await c.connect(e);if(r){d.disconnect();return}n=d,(i=t.onOpen)==null||i.call(t),d.addListener(h=>{var m;h.type==="Text"?t.onMessage(h.data):h.type==="Close"&&((m=t.onClose)==null||m.call(t))})}catch{(o=t.onClose)==null||o.call(t)}})(),{send(i){if(!n)throw new Error("socket is not open");n.send(i)},close(){r=!0,n&&n.disconnect()}}}};function zk(){return JV()?tF:eF}const Lf=new Map;function Pk(e,t){let n=null;try{n=zk().openSocket(e,{onOpen:()=>{t.retry=1e3},onMessage:r=>{let i;try{i=JSON.parse(r)}catch{return}if((i==null?void 0:i.type)==="inventory")for(const o of t.listeners)o()},onClose:()=>{t.closed||(t.timer=setTimeout(()=>Pk(e,t),t.retry),t.retry=Math.min(t.retry*2,15e3))}})}catch{return}t.handle=n}function Lk(e,t){let n=Lf.get(e);return n===void 0&&(n={listeners:new Set,handle:null,closed:!1,retry:1e3},Lf.set(e,n),Pk(e,n)),n.listeners.add(t),()=>{var i;const r=Lf.get(e);r!==void 0&&(r.listeners.delete(t),!(r.listeners.size>0)&&(r.closed=!0,r.timer!==void 0&&clearTimeout(r.timer),(i=r.handle)==null||i.close(),Lf.delete(e)))}}const Ik=p.createContext(null);function If(){const e=p.useContext(Ik);if(!e)throw new Error("useChannels outside ChannelsProvider");return e}function bx({conn:e,children:t}){const[n,r]=p.useState([]),[i,o]=p.useState(!1),[c,d]=p.useState(null),h=p.useCallback(async()=>{try{const x=await be.channels(e);return r(x),d(null),o(!0),x}catch(x){throw d(x.message),x}},[e]),m=p.useCallback(async(x,g)=>{const v=await be.updateChannel(e,x,g);return r(S=>S.some(b=>b.id===x)?S.map(b=>b.id===x?v:b):[...S,v]),v},[e]);return p.useEffect(()=>{h().catch(()=>{})},[h]),p.useEffect(()=>Lk(be.wsUrl(e),()=>{h().catch(()=>{})}),[e,h]),l.jsx(Ik.Provider,{value:{channels:n,loaded:i,error:c,reload:h,patchChannel:m},children:t})}const nF=Ur("group/field data-[invalid=true]:text-destructive",{variants:{orientation:{horizontal:"grid grid-cols-[auto_1fr] items-center gap-x-4 gap-y-1 [&>[data-slot=field-description]]:col-start-2 [&>[data-slot=field-error]]:col-start-2",vertical:"flex flex-col gap-1.5",responsive:"flex flex-col gap-1.5 @md/field-group:grid @md/field-group:grid-cols-[auto_1fr] @md/field-group:items-center @md/field-group:gap-x-4 @md/field-group:gap-y-1 @md/field-group:[&>[data-slot=field-description]]:col-start-2 @md/field-group:[&>[data-slot=field-error]]:col-start-2"}},defaultVariants:{orientation:"horizontal"}});function cr({className:e,orientation:t,size:n="medium",...r}){return l.jsx("div",{role:"group","data-slot":"field","data-orientation":t??"horizontal","data-size":n,className:Y(nF({orientation:t,className:e})),...r})}const rF=Y("text-[13px]","group-data-[size=mini]/field:text-[10px] group-data-[size=mini]/field:[letter-spacing:var(--text-footnote-tracking)]","group-data-[size=small]/field:text-[11px] group-data-[size=small]/field:[letter-spacing:var(--text-subheadline-tracking)]","group-data-[size=large]/field:text-[15px]","group-data-[size=xl]/field:text-[17px] group-data-[size=xl]/field:[letter-spacing:var(--text-title2-tracking)]");function ur({className:e,asChild:t=!1,...n}){const r=t?Fi:"label";return l.jsx(r,{"data-slot":"field-label",className:Y("flex select-none items-center gap-2 font-medium text-foreground",rF,"group-data-[disabled=true]/field:text-muted-foreground","group-data-[invalid=true]/field:text-destructive","has-[[disabled]]:text-muted-foreground",e),...n})}function to({className:e,...t}){return l.jsx("p",{"data-slot":"field-description",className:Y("text-[11px] font-normal leading-snug [letter-spacing:var(--text-subheadline-tracking)] text-muted-foreground","group-data-[size=large]/field:text-[12px] group-data-[size=xl]/field:text-[13px] group-data-[size=xl]/field:[letter-spacing:normal]","group-data-[disabled=true]/field:opacity-60",e),...t})}const sF=Ur("@container/field-group",{variants:{variant:{rows:"flex flex-col gap-5",aligned:Y("grid grid-cols-[max-content_1fr] gap-x-4 gap-y-5","[&>[data-slot=field]]:col-span-2 [&>[data-slot=field]]:grid [&>[data-slot=field]]:grid-cols-subgrid [&>[data-slot=field]]:items-center [&>[data-slot=field]]:gap-y-1","[&_[data-slot=field-label]]:justify-self-end [&_[data-slot=field-label]]:text-right","[&>[data-slot=field-separator]]:col-span-2")}},defaultVariants:{variant:"rows"}});function aF({className:e,variant:t,...n}){return l.jsx("div",{"data-slot":"field-group","data-variant":t??"rows",className:Y(sF({variant:t,className:e})),...n})}const wx="__default__";function iF(e,t,n){var o;const r=n===wx?"":n,i={...((o=e.options)==null?void 0:o.slots)??{}};return r?i[t]=[r]:delete i[t],i}function oF({channel:e,slots:t,providers:n,onSaved:r,columns:i=1}){const[o,c]=p.useState(!1),[d,h]=p.useState(null),{patchChannel:m}=If(),x=async(g,v)=>{c(!0),h(null);try{await m(e.id,{options:{...e.options,slots:iF(e,g,v)}}),r()}catch(S){h(S.message)}finally{c(!1)}};return l.jsxs(aF,{className:`grid items-center gap-x-4 gap-y-3 [&>[data-slot=field]]:col-span-2 [&>[data-slot=field]]:grid [&>[data-slot=field]]:grid-cols-subgrid [&>[data-slot=field]]:items-center ${i===2?"grid-cols-[max-content_1fr] @xl:grid-cols-[max-content_1fr_max-content_1fr]":"grid-cols-[max-content_1fr]"}`,children:[t.map(g=>{var b,j,C;const v=n.filter(k=>k.category===g.category&&!k.parked),S=((C=(j=(b=e.options)==null?void 0:b.slots)==null?void 0:j[g.callsiteId])==null?void 0:C[0])??"";return l.jsxs(cr,{children:[l.jsx(ur,{children:g.label}),l.jsxs(la,{value:S||wx,disabled:o,onValueChange:k=>void x(g.callsiteId,k),children:[l.jsx(ua,{size:"xl",className:"w-full","aria-label":g.label,children:l.jsx(ca,{})}),l.jsxs(da,{children:[l.jsx(lr,{value:wx,children:"默认(跟随全局)"}),v.map(k=>l.jsx(lr,{value:k.id,children:k.label},k.id))]})]})]},g.callsiteId)}),d?l.jsx("p",{className:"col-span-full text-[12px] text-destructive",children:d}):null]})}function lF(e){const t=e.indexOf(":");return t>0?{pluginId:e.slice(0,t),templateId:e.slice(t+1)}:{pluginId:"custom",templateId:e}}function cF(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n)|0;return(t>>>0).toString(36)}const $k=200;function uF(e,t,n){const r=Object.keys(n).sort().map(c=>`${c}=${n[c]==null?"":String(n[c])}`).join("&"),i=`${e} ${t} ${r}`;return i.length<=$k?i:`${i.slice(0,$k-12)}#${cF(i)}`}function Sx(e,t){const{pluginId:n,templateId:r}=lF(e);return uF(n,r,t)}const $f={backfillLimit:1e3,incrementalLimit:50};async function dF(e,t,n,r){const i=Sx(t.sourceId,t.params),o=n.members.find(h=>h.key===i);if(!o)return{removed:!1,deleted:!1};const c=n.streamIds.filter(h=>h!==o.streamId);await e.setChannelStreams(n.id,c);const d=!r.some(h=>h.id!==n.id&&h.streamIds.includes(o.streamId));return d&&await e.deleteStream(o.streamId),{removed:!0,deleted:d}}const fF=["timeline","search","audio","video"];function hF(e){return fF.includes(e)?e:"timeline"}function mF(e){return e.map(t=>({id:t.id,label:t.label,variant:hF(t.kind),streamIds:t.streams.map(n=>n.id),members:t.streams.flatMap(n=>n.sources.map(r=>({key:Sx(r.source.id,r.params),streamId:n.id})))}))}function pF(e){return{createStream:t=>be.subscribe(e,t).then(n=>({id:n.id})),setChannelStreams:(t,n)=>be.updateChannel(e,t,{stream_ids:n}).then(()=>{}),deleteStream:t=>be.unsubscribe(e,t).then(()=>{})}}function Tr({className:e,variant:t="default",size:n="default",selected:r,asChild:i=!1,...o}){const c=i?Fi:"div";return l.jsx(c,{"data-slot":"item","data-variant":t,"data-size":n,"data-selected":r||void 0,className:Y(gF({variant:t,size:n}),e),...o})}function gF({variant:e,size:t}){return Y("group/item flex min-w-0 items-center gap-3 rounded-[10px] text-left outline-none","has-data-[slot=item-header]:flex-wrap has-data-[slot=item-footer]:flex-wrap","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","data-[selected=true]:bg-primary data-[selected=true]:text-primary-foreground",e==="outline"&&"acr-frosted bg-[var(--acr-surface)] backdrop-blur-xl",e==="muted"&&"bg-[var(--acr-card-nested)]",t==="default"&&"p-3",t==="sm"&&"gap-2 rounded-[8px] px-2.5 py-2",t==="xs"&&"gap-2 rounded-[7px] px-2 py-1.5")}function Jc({className:e,variant:t="default",...n}){return l.jsx("div",{"data-slot":"item-media","data-variant":t,className:Y("flex shrink-0 items-center justify-center rounded-[8px] text-muted-foreground","group-data-[size=sm]/item:rounded-[6px] group-data-[size=xs]/item:rounded-[5px]","group-data-[selected=true]/item:text-primary-foreground/85",t==="default"&&"size-10 group-data-[size=sm]/item:size-8 group-data-[size=xs]/item:size-7 [&>svg]:size-5 group-data-[size=sm]/item:[&>svg]:size-4 group-data-[size=xs]/item:[&>svg]:size-3.5",t==="icon"&&"size-10 bg-[var(--acr-card-nested)] group-data-[selected=true]/item:bg-white/15 group-data-[size=sm]/item:size-8 group-data-[size=xs]/item:size-7 [&>svg]:size-5 group-data-[size=sm]/item:[&>svg]:size-4 group-data-[size=xs]/item:[&>svg]:size-3.5",t==="image"&&"size-12 overflow-hidden bg-[var(--acr-card-nested)] group-data-[selected=true]/item:bg-white/15 group-data-[size=sm]/item:size-10 group-data-[size=xs]/item:size-8 [&>img]:size-full [&>img]:object-cover",t==="avatar"&&"size-10 rounded-full bg-transparent group-data-[size=sm]/item:size-8 group-data-[size=xs]/item:size-7",e),...n})}function xF({className:e,...t}){return l.jsx("div",{"data-slot":"item-row",className:Y("flex min-w-0 basis-full items-start gap-2",e),...t})}function vF({className:e,...t}){return l.jsx("div",{"data-slot":"item-header",className:Y("flex basis-full flex-col gap-1",e),...t})}function zs({className:e,...t}){return l.jsx("div",{"data-slot":"item-content",className:Y("min-w-0 flex-1",e),...t})}function fa({className:e,...t}){return l.jsx("div",{"data-slot":"item-title",className:Y("truncate text-[13px] font-medium leading-snug text-foreground group-data-[size=sm]/item:text-[12px] group-data-[size=xs]/item:text-[11px]","group-data-[selected=true]/item:text-primary-foreground",e),...t})}function no({className:e,...t}){return l.jsx("p",{"data-slot":"item-description",className:Y("line-clamp-2 text-[12px] leading-snug text-muted-foreground group-data-[size=sm]/item:text-[11px] group-data-[size=xs]/item:text-[10px]","group-data-[selected=true]/item:text-primary-foreground/80",e),...t})}function jx({className:e,...t}){return l.jsx("div",{"data-slot":"item-meta",className:Y("shrink-0 whitespace-nowrap text-[11px] leading-snug text-muted-foreground group-data-[size=xs]/item:text-[10px]","group-data-[selected=true]/item:text-primary-foreground/80",e),...t})}function Bk({className:e,...t}){return l.jsx("div",{"data-slot":"item-actions",className:Y("flex shrink-0 items-center justify-end gap-1","group-data-[selected=true]/item:text-primary-foreground/80",e),...t})}function eu({className:e,...t}){return l.jsx("div",{"data-slot":"item-group",className:Y("flex flex-col gap-2",e),...t})}function Uk({className:e,...t}){return l.jsx("div",{"data-slot":"item-separator",role:"separator",className:Y("h-px bg-[var(--acr-border)]",e),...t})}const Cx=dC,kx=fC,Vk=aU,Fk=p.createContext("default"),Hk="z-50 min-w-[10rem] rounded-[12px] border border-[var(--acr-border-soft)] bg-[var(--acr-surface)] p-1.5 text-foreground backdrop-blur-xl shadow-[0_8px_28px_rgba(0,0,0,0.18)] outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",Bf=Ur("group/mi relative flex cursor-default select-none items-center rounded-[6px] px-2 outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-40 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{size:{default:"gap-2 py-1 text-[13px] leading-4 [&_svg]:size-4 data-[inset]:pl-8",sm:"gap-2 py-1 text-[11px] leading-[14px] [&_svg]:size-3.5 data-[inset]:pl-7",xs:"gap-1.5 py-[3px] text-[10px] leading-[13px] [&_svg]:size-3 data-[inset]:pl-6"}},defaultVariants:{size:"default"}}),Uf="data-[highlighted]:bg-[var(--primary)] data-[highlighted]:text-primary-foreground";function Vf(){return p.useContext(Fk)}const Ff=p.forwardRef(({className:e,size:t="default",children:n,...r},i)=>l.jsx(Fk.Provider,{value:t,children:l.jsx(Sf,{children:l.jsx(hC,{ref:i,"data-slot":"dropdown-menu-content",sideOffset:4,className:Y(Hk,e),...r,children:n})})}));Ff.displayName="DropdownMenuContent";const ms=p.forwardRef(({className:e,inset:t,variant:n="default",...r},i)=>{const o=Vf();return l.jsx(pC,{ref:i,"data-slot":"dropdown-menu-item","data-inset":t||void 0,"data-variant":n,className:Y(Bf({size:o}),n==="default"?Uf:"data-[highlighted]:bg-destructive/15 data-[highlighted]:text-destructive",e),...r})});ms.displayName="DropdownMenuItem";const qk=p.forwardRef(({className:e,children:t,checked:n,...r},i)=>{const o=Vf();return l.jsxs(gC,{ref:i,"data-slot":"dropdown-menu-checkbox-item",className:Y(Bf({size:o}),"relative pl-8",Uf,e),checked:n,...r,children:[l.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:l.jsx(jf,{children:l.jsx(Ns,{className:"size-3.5"})})}),t]})});qk.displayName="DropdownMenuCheckboxItem";const yF=p.forwardRef(({className:e,children:t,...n},r)=>{const i=Vf();return l.jsxs(xC,{ref:r,"data-slot":"dropdown-menu-radio-item",className:Y(Bf({size:i}),"relative pl-8",Uf,e),...n,children:[l.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:l.jsx(jf,{children:l.jsx($d,{className:"size-2 fill-current"})})}),t]})});yF.displayName="DropdownMenuRadioItem";const bF=p.forwardRef(({className:e,inset:t,...n},r)=>l.jsx(mC,{ref:r,"data-slot":"dropdown-menu-label","data-inset":t||void 0,className:Y("px-2 py-1.5 text-[10px] font-medium text-muted-foreground/70 data-[inset]:pl-8",e),...n}));bF.displayName="DropdownMenuLabel";const tu=p.forwardRef(({className:e,...t},n)=>l.jsx(vC,{ref:n,"data-slot":"dropdown-menu-separator",className:Y("-mx-1 my-1 h-px bg-[var(--acr-border-soft)]",e),...t}));tu.displayName="DropdownMenuSeparator";const Nx=p.forwardRef(({className:e,inset:t,children:n,...r},i)=>{const o=Vf();return l.jsxs(yC,{ref:i,"data-slot":"dropdown-menu-sub-trigger","data-inset":t||void 0,className:Y(Bf({size:o}),"data-[state=open]:bg-[var(--acr-hover)] data-[state=open]:text-foreground",Uf,e),...r,children:[n,l.jsx(Ts,{className:"ml-auto"})]})});Nx.displayName="DropdownMenuSubTrigger";const Tx=p.forwardRef(({className:e,...t},n)=>l.jsx(Sf,{children:l.jsx(bC,{ref:n,"data-slot":"dropdown-menu-sub-content",className:Y(Hk,e),...t})}));Tx.displayName="DropdownMenuSubContent";const Kk=p.forwardRef(({className:e,interactive:t=!1,nestedSurface:n=!1,...r},i)=>l.jsx("div",{ref:i,"data-slot":"card","data-nested-surface":n||void 0,className:Y("acr-frosted relative rounded-xl bg-[var(--acr-surface)] backdrop-blur-xl","transition-[transform,background-color] duration-200",t&&"hover:-translate-y-px hover:bg-[var(--acr-surface-hover)] before:pointer-events-none before:absolute before:inset-0 before:-z-10 before:rounded-xl before:shadow-[0_12px_28px_rgba(0,0,0,0.28)] before:opacity-0 before:transition-opacity before:duration-200 hover:before:opacity-100",e),...r}));Kk.displayName="Card";function wF({className:e,...t}){return l.jsx("div",{"data-slot":"card-header",className:Y("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto]",e),...t})}function SF({className:e,...t}){return l.jsx("div",{"data-slot":"card-title",className:Y("self-center text-[15px] font-semibold leading-none tracking-tight",e),...t})}function jF({className:e,...t}){return l.jsx("div",{"data-slot":"card-action",className:Y("col-start-2 row-start-1 flex items-start self-start justify-self-end",e),...t})}function CF({className:e,...t}){return l.jsx("div",{"data-slot":"card-content",className:Y("px-6",e),...t})}function Gk({className:e,...t}){return l.jsx("div",{"data-slot":"empty",className:Y("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12",e),...t})}function Yk({className:e,...t}){return l.jsx("div",{"data-slot":"empty-header",className:Y("flex max-w-sm flex-col items-center gap-2 text-center",e),...t})}function Wk({className:e,...t}){return l.jsx("div",{"data-slot":"empty-title",className:Y("text-lg font-medium tracking-tight",e),...t})}function Xk({className:e,...t}){return l.jsx("div",{"data-slot":"empty-description",className:Y("text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",e),...t})}const Hf={mini:{well:"p-0.5",item:"h-4 gap-1 px-2 text-[10px] [&_svg]:size-3",divider:"inset-y-0.5",text:"h-4 px-2 text-[10px]"},small:{well:"p-0.5",item:"h-5 gap-1 px-2.5 text-[11px] [&_svg]:size-3",divider:"inset-y-0.5",text:"h-5 px-2.5 text-[11px]"},medium:{well:"p-0.5",item:"h-6 gap-1.5 px-4 text-[13px] [&_svg]:size-3.5",divider:"inset-y-1",text:"h-6 px-3 text-[13px]"},large:{well:"p-0.5",item:"h-7 gap-1.5 px-4 text-[13px] [&_svg]:size-4",divider:"inset-y-1.5",text:"h-7 px-3.5 text-[13px]"},xl:{well:"p-0.5",item:"h-9 gap-2 px-5 text-[13px] [&_svg]:size-4",divider:"inset-y-2",text:"h-9 px-4 text-[13px]"}},kF={auto:{mini:{well:"rounded-[4px]",childrenL:"[&>*:first-child]:rounded-l-[2px]",childrenR:"[&>*:last-child]:rounded-r-[2px]",childrenAll:"[&>*]:rounded-[2px]",pill:"rounded-[2px]",item:"rounded-[2px]"},small:{well:"rounded-[5px]",childrenL:"[&>*:first-child]:rounded-l-[3px]",childrenR:"[&>*:last-child]:rounded-r-[3px]",childrenAll:"[&>*]:rounded-[3px]",pill:"rounded-[3px]",item:"rounded-[3px]"},medium:{well:"rounded-[6px]",childrenL:"[&>*:first-child]:rounded-l-[4px]",childrenR:"[&>*:last-child]:rounded-r-[4px]",childrenAll:"[&>*]:rounded-[4px]",pill:"rounded-[4px]",item:"rounded-[4px]"},large:{well:"rounded-full",childrenL:"[&>*:first-child]:rounded-l-full",childrenR:"[&>*:last-child]:rounded-r-full",childrenAll:"[&>*]:rounded-full",pill:"rounded-full",item:"rounded-full"},xl:{well:"rounded-full",childrenL:"[&>*:first-child]:rounded-l-full",childrenR:"[&>*:last-child]:rounded-r-full",childrenAll:"[&>*]:rounded-full",pill:"rounded-full",item:"rounded-full"}},rect:{mini:{well:"rounded-[4px]",childrenL:"[&>*:first-child]:rounded-l-[2px]",childrenR:"[&>*:last-child]:rounded-r-[2px]",childrenAll:"[&>*]:rounded-[2px]",pill:"rounded-[2px]",item:"rounded-[2px]"},small:{well:"rounded-[5px]",childrenL:"[&>*:first-child]:rounded-l-[3px]",childrenR:"[&>*:last-child]:rounded-r-[3px]",childrenAll:"[&>*]:rounded-[3px]",pill:"rounded-[3px]",item:"rounded-[3px]"},medium:{well:"rounded-[6px]",childrenL:"[&>*:first-child]:rounded-l-[4px]",childrenR:"[&>*:last-child]:rounded-r-[4px]",childrenAll:"[&>*]:rounded-[4px]",pill:"rounded-[4px]",item:"rounded-[4px]"},large:{well:"rounded-[8px]",childrenL:"[&>*:first-child]:rounded-l-[6px]",childrenR:"[&>*:last-child]:rounded-r-[6px]",childrenAll:"[&>*]:rounded-[6px]",pill:"rounded-[6px]",item:"rounded-[6px]"},xl:{well:"rounded-[10px]",childrenL:"[&>*:first-child]:rounded-l-[8px]",childrenR:"[&>*:last-child]:rounded-r-[8px]",childrenAll:"[&>*]:rounded-[8px]",pill:"rounded-[8px]",item:"rounded-[8px]"}},capsule:{mini:{well:"rounded-full",childrenL:"[&>*:first-child]:rounded-l-full",childrenR:"[&>*:last-child]:rounded-r-full",childrenAll:"[&>*]:rounded-full",pill:"rounded-full",item:"rounded-full"},small:{well:"rounded-full",childrenL:"[&>*:first-child]:rounded-l-full",childrenR:"[&>*:last-child]:rounded-r-full",childrenAll:"[&>*]:rounded-full",pill:"rounded-full",item:"rounded-full"},medium:{well:"rounded-full",childrenL:"[&>*:first-child]:rounded-l-full",childrenR:"[&>*:last-child]:rounded-r-full",childrenAll:"[&>*]:rounded-full",pill:"rounded-full",item:"rounded-full"},large:{well:"rounded-full",childrenL:"[&>*:first-child]:rounded-l-full",childrenR:"[&>*:last-child]:rounded-r-full",childrenAll:"[&>*]:rounded-full",pill:"rounded-full",item:"rounded-full"},xl:{well:"rounded-full",childrenL:"[&>*:first-child]:rounded-l-full",childrenR:"[&>*:last-child]:rounded-r-full",childrenAll:"[&>*]:rounded-full",pill:"rounded-full",item:"rounded-full"}}},qf=p.createContext("medium"),Kf=p.createContext("auto"),Qk=()=>p.useContext(qf),NF=()=>p.useContext(Kf),Gf=(e,t)=>kF[e][t],TF=Ur("inline-flex isolate text-foreground",{variants:{variant:{attached:Y("items-stretch bg-[var(--acr-field)]","[&>[data-slot=button]]:bg-transparent [&>[data-slot=button]]:text-foreground [&>[data-slot=button]]:shadow-none","[&>[data-slot=button]:hover]:bg-[var(--acr-hover)]","[&>*]:rounded-none"),segmented:Y("items-stretch gap-px bg-[var(--acr-field)]","[&>*]:shadow-none [&>*]:bg-transparent","[&>[data-active=true]]:bg-[var(--acr-control)] [&>[aria-pressed=true]]:bg-[var(--acr-control)]","[&>[data-active=true]]:shadow-[0_1px_2px_rgba(0,0,0,0.16),0_0_0_0.5px_rgba(0,0,0,0.04)]","[&>[aria-pressed=true]]:shadow-[0_1px_2px_rgba(0,0,0,0.16),0_0_0_0.5px_rgba(0,0,0,0.04)]"),ghost:Y("items-stretch bg-transparent","[&>[data-slot=button]]:bg-transparent [&>[data-slot=button]]:text-foreground [&>[data-slot=button]]:shadow-none","[&>[data-slot=button]:hover]:bg-[var(--acr-hover)]","[&>*]:rounded-none"),split:"items-center gap-1.5"}},defaultVariants:{variant:"attached"}}),Zk=p.createContext(null),EF=p.createContext(null);function RF(e,t,n){const r=Hf[t],i=Gf(n,t);return e==="split"?"":e==="segmented"?Y(r.well,i.well,i.childrenAll):Y(r.well,i.well,i.childrenAll,i.childrenL,i.childrenR)}function Jk(e){if(e.type==="multiple"){const{className:v,size:S,shape:b,value:j,defaultValue:C,onValueChange:k,children:N,...E}=e;return l.jsx(AF,{className:v,size:S,shape:b,value:j,defaultValue:C,onValueChange:k,...E,children:N})}const{className:t,variant:n,size:r="medium",shape:i="auto",value:o,defaultValue:c,onValueChange:d,children:h,type:m,...x}=e;return n==="segmented"&&(o!==void 0||c!==void 0||d!==void 0)?l.jsx(MF,{className:t,size:r,shape:i,value:o,defaultValue:c,onValueChange:d,...x,children:h}):l.jsx(qf.Provider,{value:r,children:l.jsx(Kf.Provider,{value:i,children:l.jsx("div",{role:"group","data-slot":"button-group","data-variant":n??"attached","data-size":r,"data-shape":i,className:Y(TF({variant:n}),RF(n??"attached",r,i),t),...x,children:h})})})}function AF({className:e,size:t="medium",shape:n="auto",value:r,defaultValue:i,onValueChange:o,children:c,...d}){const h=Hf[t],m=Gf(n,t),[x,g]=p.useState(i??[]),v=r!==void 0,S=v?r:x,b=p.useCallback(j=>{const C=S.includes(j)?S.filter(k=>k!==j):[...S,j];v||g(C),o==null||o(C)},[S,v,o]);return l.jsx("div",{role:"group","data-slot":"button-group","data-variant":"multiple","data-size":t,"data-shape":n,className:Y("inline-flex isolate items-stretch bg-[var(--acr-field)] text-foreground","[&>*]:rounded-none",h.well,m.well,m.childrenAll,m.childrenL,m.childrenR,e),...d,children:l.jsx(qf.Provider,{value:t,children:l.jsx(Kf.Provider,{value:n,children:l.jsx(EF.Provider,{value:{value:S,toggle:b},children:c})})})})}function MF({className:e,size:t="medium",shape:n="auto",value:r,defaultValue:i,onValueChange:o,children:c,...d}){const h=Hf[t],m=Gf(n,t),x=p.useMemo(()=>p.Children.toArray(c).filter(A=>{var _;return p.isValidElement(A)&&((_=A.type)==null?void 0:_.__isButtonGroupItem)===!0}),[c]),g=x.map(A=>A.props.value),[v,S]=p.useState(i??g[0]),b=r!==void 0,j=b?r:v,C=p.useCallback(A=>{b||S(A),o==null||o(A)},[b,o]),k=Math.max(0,g.indexOf(j)),N=x.length||1,E=A=>{if(A.key==="ArrowRight"||A.key==="ArrowLeft"){A.preventDefault();const _=A.key==="ArrowRight"?1:-1,z=(k+_+N)%N;C(g[z])}},R={width:`${100/N}%`,transform:`translateX(${k*100}%)`};return l.jsx("div",{role:"radiogroup","data-slot":"button-group","data-variant":"segmented","data-size":t,"data-shape":n,onKeyDown:E,className:Y("inline-flex isolate bg-[var(--acr-field)] text-foreground",h.well,m.well,e),...d,children:l.jsxs("div",{"data-slot":"button-group-track",className:"relative isolate grid flex-1",style:{gridTemplateColumns:`repeat(${N}, minmax(0, 1fr))`},children:[l.jsx("div",{"aria-hidden":!0,"data-slot":"button-group-indicator",className:Y("pointer-events-none absolute left-0 top-0 z-0 h-full bg-[var(--acr-button-group-control)]",m.pill,"shadow-[0_1px_2px_rgba(0,0,0,0.35)]","transition-[transform,width] duration-200 ease-[cubic-bezier(0.32,0.72,0,1)]","motion-reduce:transition-none"),style:R}),N>1&&Array.from({length:N-1},(A,_)=>{const z=_+1,D=k===z-1||k===z,V=`${z/N*100}%`;return l.jsx("span",{"aria-hidden":!0,"data-slot":"button-group-divider",className:Y("pointer-events-none absolute z-[1] w-px -translate-x-1/2 bg-[var(--acr-button-group-divider)]",h.divider,"transition-opacity duration-200 ease-[cubic-bezier(0.32,0.72,0,1)] motion-reduce:transition-none",D&&"opacity-0"),style:{left:V}},_)}),l.jsx(qf.Provider,{value:t,children:l.jsx(Kf.Provider,{value:n,children:l.jsx(Zk.Provider,{value:{value:j,setValue:C},children:c})})})]})})}function eN({className:e,value:t,asChild:n=!1,onClick:r,...i}){const o=p.useContext(Zk),c=Qk(),d=NF(),h=(o==null?void 0:o.value)===t,m=n?Fi:"button";return l.jsx(m,{type:n?void 0:"button",role:"radio","aria-checked":h,"data-slot":"button-group-item","data-active":h,tabIndex:h?0:-1,onClick:x=>{o==null||o.setValue(t),r==null||r(x)},className:Y("relative z-10 inline-flex flex-1 select-none items-center justify-center whitespace-nowrap",Hf[c].item,Gf(d,c).item,"font-medium outline-none transition-colors","bg-transparent text-foreground focus-visible:ring-2 focus-visible:ring-ring/50","disabled:pointer-events-none disabled:opacity-40","[&_svg]:pointer-events-none [&_svg]:shrink-0",e),...i})}eN.__isButtonGroupItem=!0;function DF({className:e,orientation:t="vertical",...n}){const r=Qk(),i={mini:"my-0.5 w-px",small:"my-0.5 w-px",medium:"my-1 w-px",large:"my-1.5 w-px",xl:"my-2 w-px"},o={mini:"mx-0.5 h-px",small:"mx-0.5 h-px",medium:"mx-1 h-px",large:"mx-1.5 h-px",xl:"mx-2 h-px"};return l.jsx("div",{role:"separator","aria-orientation":t,"data-slot":"button-group-separator",className:Y("shrink-0 self-stretch bg-[var(--acr-button-group-divider)]",t==="vertical"?i[r]:o[r],e),...n})}const Ex={81:{d:"81.cn",n:"中国军网"},121:{d:"121.com.cn",n:"深圳台风网"},163:{d:"163.com",n:"网易公开课"},591:{d:"rent.591.com.tw",n:"591 Rental house"},2048:{d:"hjd2048.com",n:"2048 核基地"},8264:{d:"8264.com",n:"8264"},12306:{d:"kyfw.12306.cn",n:"12306"},12371:{d:"www.12371.cn",n:"共产党员网"},"005":{d:"005.tv",n:"幻之羁绊动漫网"},"0818tuan":{d:"0818tuan.com",n:"0818 团"},"0x80":{d:"0x80.pl",n:"Wojciech Muła"},"0xxx":{d:"0xxx.ws",n:"0xxx.ws"},"10000link":{d:"10000link.com",n:"10000万联网"},"10jqka":{d:"10jqka.com.cn",n:"同花顺财经"},"141jav":{d:"141jav.com",n:"141JAV"},"141ppv":{d:"141ppv.com",n:"141PPV"},"18comic":{d:"18comic.org",n:"禁漫天堂"},"19lou":{d:"19lou.com",n:"19 楼"},"1lou":{d:"1lou.me",n:"BT 之家 1LOU 站"},"1point3acres":{d:"blog.1point3acres.com",n:"一亩三分地"},"1x":{d:"1x.com",n:"1x.com"},"2023game":{d:"www.2023game.com",n:"游戏星辰"},"21caijing":{d:"21caijing.com",n:"21财经"},"2cycd":{d:"2cycd.com",n:"二次元虫洞"},"30secondsofcode":{d:"www.30secondsofcode.org",n:"30 Seconds of code"},"36kr":{d:"36kr.com",n:"36kr"},"3dmgame":{d:"3dmgame.com",n:"3DMGame"},"3kns":{d:"www.3kns.com",n:"3k-Switch游戏库"},"423down":{d:"423down.com",n:"423Down"},"4chan":{d:"4chan.org",n:"4chan"},"4gamers":{d:"www.4gamers.com.tw",n:"4Gamers"},"4khd":{d:"www.4khd.com",n:"4KHD"},"4ksj":{d:"4ksj.com",n:"4k 世界"},"4kup":{d:"4kup.net",n:"4KUP"},"500px":{d:"500px.com.cn",n:"500px 摄影社区"},"50forum":{d:"50forum.org.cn",n:"经济 50 人论坛"},"51cto":{d:"51cto.com",n:"51CTO"},"51read":{d:"m.51read.org",n:"51Read"},"52hrtt":{d:"52hrtt.com",n:"52hrtt 华人头条"},"56kog":{d:"56kog.com",n:"明月中文网"},"5eplay":{d:"csgo.5eplay.com",n:"5EPLAY"},"5music":{d:"5music.com.tw",n:"五大唱片"},"69shu":{d:"69shuba.cx",n:"69书吧"},"6park":{d:"club.6parkbbs.com",n:"留园网"},"6v123":{d:"hao6v.cc",n:"6v 电影"},"78dm":{d:"78dm.net",n:"78 动漫"},"7mmtv":{d:"7mmtv.tv",n:"7mmtv"},"8kcos":{d:"8kcosplay.com",n:"8KCosplay"},"8world":{d:"8world.com",n:"8 视界"},"91porn":{d:"91porn.com",n:"91porn"},"95mm":{d:"95mm.org",n:"MM 范"},"9to5":{d:"9to5toys.com",n:"9To5"},a9vg:{d:"a9vg.com",n:"A9VG 电玩部落"},aa1:{d:"aa1.cn",n:"夏柔"},aamacau:{d:"aamacau.com",n:"論盡媒體 AllAboutMacau Media"},abc:{d:"abc.net.au",n:"ABC News (Australian Broadcasting Corporation)"},abmedia:{d:"www.abmedia.io",n:"链新闻 ABMedia"},abskoop:{d:"nsfw.abskoop.com",n:"A 姐分享"},academia:{d:"www.academia.edu",n:"Academia"},accessbriefing:{d:"accessbriefing.com",n:"Access Briefing"},acfun:{d:"www.acfun.cn",n:"AcFun"},acg17:{d:"acg17.com",n:"ACG17"},acgvinyl:{d:"www.acgvinyl.com",n:"ACG Vinyl - 黑胶"},acpaa:{d:"acpaa.cn",n:"中华全国专利代理师协会"},acs:{d:"pubs.acs.org",n:"ACS Publications"},adquan:{d:"adquan.com",n:"广告门"},aeaweb:{d:"aeaweb.org",n:"American Economic Association"},aeon:{d:"aeon.co",n:"AEON"},afdian:{d:"afdian.net",n:"爱发电"},aflcio:{d:"aflcio.org",n:"AFL-CIO"},afr:{d:"afr.com",n:"The Australian Financial Review"},agefans:{d:"agemys.cc",n:"AGE 动漫"},agirls:{d:"agirls.aotter.net",n:"电獭少女"},agora0:{d:"agorahub.github.io",n:"AG⓪RA"},agri:{d:"agri.cn",n:"中国农业农村信息网"},ahjzu:{d:"news.ahjzu.edu.cn",n:"安徽建筑大学"},"ai-bot":{d:"ai-bot.cn",n:"AI工具集"},aiaa:{d:"arc.aiaa.org",n:"AIAA Aerospace Research Central"},aibase:{d:"aibase.com",n:"AIbase"},"aiblog-2xv":{d:"aiblog-2xv.pages.dev",n:"AI 博客"},aicaijing:{d:"www.aicaijing.com",n:"AI 财经社"},aiea:{d:"www.aiea.org",n:"Asian Innovation and Entrepreneurship Association"},aijishu:{d:"www.aijishu",n:"极术社区"},ainvest:{d:"ainvest.com",n:"AInvest"},aip:{d:"pubs.aip.org",n:"American Institute of Physics"},"air-level":{d:"air-level.com",n:"Air-Level"},airchina:{d:"www.airchina.com.cn",n:"中国国际航空公司"},aisixiang:{d:"aisixiang.com",n:"爱思想"},ajcass:{d:"ajcass.com",n:"社科期刊网"},ajmide:{d:"m.ajmide.com",n:"阿基米德 FM"},ali213:{d:"ali213.net",n:"游侠网"},alicesoft:{d:"www.alicesoft.com",n:"ALICESOFT"},alipan:{d:"www.alipan.com",n:"阿里云盘"},aliresearch:{d:"aliresearch.com",n:"阿里研究院"},alistapart:{d:"alistapart.com",n:"A List Apart"},aliyun:{d:"developer.aliyun.com",n:"阿里云"},aljazeera:{d:"aljazeera.com",n:"Aljazeera"},ally:{d:"rail.ally.net.cn",n:"艾莱资讯"},alpinelinux:{d:"alpinelinux.org",n:"Alpine Linux"},alternativeto:{d:"www.alternativeto.net",n:"AlternativeTo"},altotrain:{d:"altotrain.ca",n:"Alto - Toronto-Québec City High-Speed Rail Network"},alwayscontrol:{d:"alwayscontrol.com.cn",n:"Always Control"},amazfitwatchfaces:{d:"amazfitwatchfaces.com",n:"Amazfitwatchfaces"},amazon:{d:"amazon.com",n:"Amazon"},amz123:{d:"www.amz123.com",n:"Amz123"},android:{d:"developer.android.com",n:"Android"},anime1:{d:"anime1.me",n:"Anime1"},annualreviews:{d:"annualreviews.org",n:"Annual Reviews"},anquanke:{d:"anquanke.com",n:"安全客"},anthropic:{d:"anthropic.com",n:"Anthropic"},anytxt:{d:"anytxt.net",n:"Anytxt Searcher"},apache:{d:"apisix.apache.org",n:"Apache"},apiseven:{d:"apiseven.com",n:"支流科技"},apkpure:{d:"apkpure.com",n:"APKPure"},apnews:{d:"apnews.com",n:"AP News"},apnic:{d:"blog.apnic.net",n:"APNIC"},"app-center":{d:"install.appcenter.ms",n:"App Center"},"app-sales":{d:"app-sales.net",n:"AppSales"},apple:{d:"apple.com",n:"Apple"},appleinsider:{d:"appleinsider.com",n:"AppleInsider"},appstare:{d:"appstare.net",n:"AppStare"},appstore:{d:"apps.apple.com",n:"App Store/Mac App Store"},appstorrent:{d:"appstorrent.ru",n:"AppsTorrent"},aqara:{d:"aqara.com",n:"Aqara"},aqicn:{d:"aqicn.org",n:"空气质量"},arcteryx:{d:"arcteryx.com",n:"Arcteryx"},artstation:{d:"www.artstation.com",n:"ArtStation"},aschmelyun:{d:"aschmelyun.com",n:"Andrew Schmelyun"},asiafruitchina:{d:"asiafruitchina.net",n:"亚洲水果"},asianfanfics:{d:"asianfanfics.com",n:"Asianfanfics"},asiantolick:{d:"asiantolick.com",n:"Asian to lick"},"asmr-200":{d:"asmr-200.com",n:"ASMR Online"},asus:{d:"asus.com.cn",n:"ASUS"},atcoder:{d:"atcoder.jp",n:"AtCoder"},atptour:{d:"www.atptour.com",n:"ATP Tour"},augmentcode:{d:"augmentcode.com",n:"Augment Code"},"auto-stats":{d:"auto-stats.org.cn",n:"中国汽车工业协会统计信息网"},autocentre:{d:"autocentre.ua",n:"Автоцентр.ua"},azul:{d:"azul.com",n:"Azul"},baai:{d:"hub.baai.ac.cn",n:"北京智源人工智能研究院"},backlinko:{d:"backlinko.com",n:"Backlinko"},bad:{d:"bad.news",n:"Bad.news"},baidu:{d:"www.baidu.com",n:"百度"},baijing:{d:"baijing.cn",n:"白鲸出海"},bakamh:{d:"bakamh.com",n:"巴卡漫画"},bandcamp:{d:"bandcamp.com",n:"Bandcamp"},bandisoft:{d:"bandisoft.com",n:"Bandisoft"},"bangumi.moe":{d:"bangumi.online",n:"萌番组"},"bangumi.online":{d:"bangumi.online",n:"アニメ新番組"},"bangumi.tv":{d:"bangumi.tv",n:"Bangumi 番组计划"},banshujiang:{d:"banshujiang.cn",n:"搬书匠"},banyuetan:{d:"banyuetan.org",n:"半月谈"},baobua:{d:"baobua.com",n:"BaoBua"},baoyu:{d:"baoyu.io",n:"宝玉"},baozimh:{d:"www.baozimh.com",n:"包子漫画"},barronschina:{d:"barronschina.com.cn",n:"巴伦周刊中文版"},baselang:{n:"BaseLang"},bast:{d:"bast.net.cn",n:"北京市科学技术协会"},bbc:{d:"bbc.com",n:"BBC"},bbcnewslabs:{d:"bbcnewslabs.co.uk",n:"BBC News Labs"},bc3ts:{d:"web.bc3ts.net",n:"爆料公社"},bdys:{d:"52bdys.com",n:"哔嘀影视"},behance:{d:"www.behance.net",n:"Behance"},beijingprice:{d:"beijingprice.cn",n:"北京价格"},bellroy:{d:"bellroy.com",n:"Bellroy"},bendibao:{d:"bendibao.com",n:"本地宝"},bestblogs:{d:"www.bestblogs.dev",n:"bestblogs.dev"},bestofjs:{d:"bestofjs.org",n:"Best of JS"},bfl:{d:"bfl.ai",n:"BFL AI"},bgmlist:{d:"bgmlist.com",n:"番组放送"},bigquant:{d:"bigquant.com",n:"BigQuant"},bilibili:{d:"www.bilibili.com",n:"哔哩哔哩 bilibili"},binance:{d:"binance.com",n:"Binance"},bing:{d:"cn.bing.com",n:"Bing"},biodiscover:{d:"www.biodiscover.com",n:"biodiscover.com 生物探索"},bioone:{d:"bioone.org",n:"BioOne"},biquge:{d:"xbiquwx.la",n:"笔趣阁"},bit:{d:"cs.bit.edu.cn",n:"北京理工大学"},bitbucket:{d:"bitbucket.com",n:"Bitbucket"},bitget:{d:"bitget.com",n:"Bitget"},bitmovin:{d:"bitmovin.com",n:"Bitmovin"},bjfu:{d:"graduate.bjfu.edu.cn",n:"北京林业大学"},bjnews:{d:"www.bjnews.com.cn",n:"新京报"},bjp:{d:"www.bjp.org.cn",n:"北京天文馆"},bjsk:{d:"bjsk.org.cn",n:"北京社科网"},bjtu:{d:"bjtu.edu.cn",n:"Beijing Jiaotong University"},bjwxdxh:{d:"www.bjwxdxh.org.cn",n:"北京无线电协会"},bjx:{d:"www.bjx.com.cn",n:"北极星电力网"},blizzard:{d:"news.blizzard.com",n:"Blizzard"},blockworks:{d:"blockworks.co",n:"Blockworks"},blogread:{d:"blogread.cn",n:"技术头条"},bloomberg:{d:"www.bloomberg.com",n:"Bloomberg"},bluearchive:{d:"bluearchive.jp",n:"Blue Archive"},bluestacks:{d:"bluestacks.com",n:"BlueStacks"},bmkg:{d:"bmkg.go.id",n:"BADAN METEOROLOGI, KLIMATOLOGI, DAN GEOFISIKA(Indonesian)"},bnext:{d:"bnext.com.tw",n:"數位時代 BusinessNext"},bntnews:{d:"bntnews.co.kr",n:"bntnews"},bnu:{d:"bs.bnu.edu.cn",n:"北京师范大学"},boc:{d:"boc.cn",n:"中国银行"},bookfere:{d:"bookfere.com",n:"书伴"},bookwalker:{d:"bookwalker.com.tw",n:"BOOKWALKER電子書"},booru:{d:"mmda.booru.org",n:"Booru"},bossdesign:{d:"bossdesign.cn",n:"Boss 设计"},brave:{d:"brave.com",n:"Brave"},brooklynmuseum:{d:"www.brooklynmuseum.org",n:"Brooklyn Museum"},bse:{d:"bse.cn",n:"北京证券交易所"},bsky:{d:"bsky.app",n:"Bluesky (bsky)"},bt0:{d:"2bt0.com",n:"不太灵影视"},btbtla:{d:"www.btbtla.com",n:"BT影视"},btzj:{d:"btbtt20.com",n:"BT 之家"},buaa:{d:"news.buaa.edu.cn",n:"北京航空航天大学"},buct:{d:"buct.edu.cn",n:"北京化工大学"},bugzilla:{d:"bugzilla.org",n:"Bugzilla"},bulianglin:{d:"bulianglin.com",n:"不良林"},bullionvault:{d:"bullionvault.com",n:"BullionVault"},bupt:{d:"bupt.edu.cn",n:"北京邮电大学"},bvisness:{d:"bvisness.me",n:"Ben Visness"},bwsg:{d:"bwsg.at",n:"BWSG"},byau:{d:"byau.edu.cn",n:"黑龙江八一农垦大学"},byteclicks:{d:"byteclicks.com",n:"字节点击"},bytes:{d:"bytes.dev",n:"ui.dev"},c114:{d:"c114.com.cn",n:"C114 通信网"},caai:{d:"caai.cn",n:"中国人工智能学会"},caam:{d:"caam.org.cn",n:"中国汽车工业协会"},caareviews:{d:"caareviews.org",n:"caa.reviews"},cags:{d:"cags.cgs.gov.cn",n:"Chinese Academy of Geological Sciences"},cahkms:{d:"cahkms.org",n:"全国港澳研究会"},caicai:{d:"www.caicai.me",n:"CaiCai"},caijing:{d:"roll.caijing.com.cn",n:"财经网"},caixin:{d:"caixin.com",n:"财新博客"},caixinglobal:{d:"caixinglobal.com",n:"Caixin Global"},camchina:{d:"cste.org.cn",n:"中国管理现代化研究会"},"canada.ca":{d:"www.canada.ca",n:"Canada.ca"},cankaoxiaoxi:{d:"cankaoxiaoxi.com",n:"参考消息"},capitalmind:{d:"capitalmind.in",n:"Capitalmind"},cara:{d:"cara.app",n:"Cara"},carousell:{d:"carousell.com",n:"Carousell"},cartoonmad:{d:"cartoonmad.com",n:"動漫狂"},cas:{d:"www.cas.cn",n:"中国科学院"},casssp:{d:"casssp.org.cn",n:"中国科学学与科技政策研究会"},cast:{d:"cast.org.cn",n:"中国科学技术协会"},castanet:{d:"www.castanet.net",n:"Castanet"},castbox:{d:"castbox.fm",n:"Castbox"},catti:{d:"www.catticenter.com",n:"全国翻译专业资格水平考试 (CATTI)"},cau:{d:"ciee.cau.edu.cn",n:"中国农业大学"},caus:{d:"caus.com",n:"加美财经"},cbaigui:{d:"cbaigui.com",n:"纪妖"},cbc:{d:"cbc.ca",n:"Canadian Broadcasting Corporation"},cbndata:{d:"cbndata.com",n:"CBNData"},cbnweek:{d:"cbnweek.com",n:"第一财经杂志"},cbpanet:{d:"cbpanet.com",n:"中国豆制品网"},ccac:{d:"ccac.org.mo",n:"Macau Independent Commission Against Corruption 澳门廉政公署"},ccagm:{d:"ccagm.org.cn",n:"中国百货商业协会"},cccfna:{d:"www.cccfna.org.cn",n:"中国食品土畜进出口商会"},cccmc:{d:"www.cccmc.org.cn",n:"中国五矿化工进出口商会"},ccf:{d:"ccf.org.cn",n:"中国计算机学会"},ccfa:{d:"ccfa.org.cn",n:"中国连锁经营协会"},ccg:{d:"ccg.org.cn",n:"全球化智库"},ccmn:{d:"www.ccmn.cn",n:"长江有色网"},ccnu:{d:"ccnu.91wllm.com",n:"华中师范大学"},ccreports:{d:"www.ccreports.com.cn",n:"消费者报道"},cctv:{d:"news.cctv.com",n:"央视新闻"},cde:{d:"www.cde.org.cn",n:"国家药品审评网站"},cdi:{d:"cdi.com.cn",n:"国家高端智库 / 综合开发研究院"},cdu:{d:"www.cdu.edu.cn",n:"成都大学"},cdzjryb:{d:"zw.cdzjryb.com",n:"成都住建蓉 e 办"},ce:{d:"www.ce.cn",n:"中国经济网"},cebbank:{d:"cebbank.com",n:"中国光大银行"},ceph:{d:"ceph.io",n:"Ceph"},cfachina:{d:"cfachina.org",n:"中国期货业协会"},cffex:{d:"cffex.com.cn",n:"中国金融期货交易所"},cfmmc:{d:"cfmmc.com",n:"中国期货市场监控中心"},cfr:{d:"www.cfr.org",n:"Council on Foreign Relations"},cgtn:{d:"cgtn.com",n:"中国环球电视网"},chaincatcher:{d:"chaincatcher.com",n:"链捕手 ChainCatcher"},changba:{d:"changba.com",n:"唱吧"},chaoxing:{d:"chaoxing.com",n:"超星"},chaping:{d:"chaping.cn",n:"差评"},cherrytimes:{d:"cherrytimes.it",n:"Cherry Times"},chiculture:{d:"chiculture.org.hk",n:"通識・現代中國"},chikubi:{d:"chikubi.jp",n:"乳首ふぇち"},china:{d:"finance.china.com",n:"China.com 中华网"},chinacdc:{d:"www.chinacdc.cn",n:"中国疾病预防控制中心"},chinadaily:{d:"chinadaily.com.cn",n:"中国日报网"},chinadegrees:{d:"chinadegrees.com.cn",n:"中华人民共和国学位证书查询"},chinafactcheck:{d:"chinafactcheck.com",n:"有据"},chinaisa:{d:"chinaisa.org.cn",n:"中国钢铁工业协会"},chinamoney:{d:"chinamoney.com.cn",n:"中国货币网"},chinanews:{d:"chinanews.com.cn",n:"中国新闻网"},chinania:{d:"chinania.org.cn",n:"中国有色金属工业网"},chinaratings:{d:"chinaratings.com.cn",n:"中债资信评估有限责任公司"},chinathinktanks:{d:"www.chinathinktanks.org.cn",n:"中国智库网"},chinatimes:{d:"www.chinatimes.com",n:"中時新聞網"},chinaventure:{d:"chinaventure.com.cn",n:"投中网"},chinawriter:{d:"chinawriter.com.cn",n:"中国作家网"},chiphell:{d:"www.chiphell.com",n:"Chiphell"},chnmus:{d:"www.chnmus.net",n:"Henan Museum"},chnmuseum:{d:"www.chnmuseum.cn",n:"National Museum Of China"},chocolatey:{d:"chocolatey.org",n:"Chocolatey"},chongbuluo:{d:"www.chongbuluo.com",n:"虫部落"},chongdiantou:{d:"www.chongdiantou.com",n:"充电头网"},chsi:{d:"yz.chsi.com.cn",n:"中国研究生招生信息网"},chuanliu:{d:"chuanliu.org",n:"川流"},chuapp:{d:"chuapp.com",n:"触乐"},chub:{d:"chub.ai",n:"Chub"},cib:{d:"cib.com.cn",n:"中国兴业银行"},"cih-index":{d:"www.cih-index.com",n:"中指研究院"},ciidbnu:{d:"ciidbnu.org",n:"中国收入分配研究院"},cisia:{d:"www.cisia.org",n:"中国无机盐工业协会"},civitai:{d:"civitai.com",n:"Civitai"},ciweimao:{d:"wap.ciweimao.com",n:"刺猬猫"},cjlu:{d:"www.cjlu.edu.cn",n:"China Jiliang University"},claude:{d:"claude.com",n:"Claude"},clickme:{d:"clickme.net",n:"ClickMe"},cline:{d:"cline.bot",n:"Cline Offcial Blog"},cloudflarestatus:{d:"cloudflarestatus.com",n:"Cloudflare Status"},cloudnative:{d:"cloudnative.to",n:"云原生社区"},cls:{d:"cls.cn",n:"财联社"},cma:{d:"weather.cma.cn",n:"中国气象局"},cmde:{d:"www.cmde.org.cn",n:"国家药品监督管理局医疗器械技术审评中心"},cmpxchg8b:{d:"lock.cmpxchg8b.com",n:"cmpxchg8b"},cmu:{d:"www.cmu.edu",n:"Carnegie Mellon University"},"cn-healthcare":{d:"cn-healthcare.com",n:"健康界"},cna:{d:"cna.com.tw",n:"中央通讯社"},cnbc:{d:"search.cnbc.com",n:"CNBC"},cnbeta:{d:"cnbeta.com.tw",n:"cnBeta.COM"},cnblogs:{d:"www.cnblogs.com",n:"博客园"},cncf:{d:"cncf.io",n:"CNCF"},cneb:{d:"cneb.gov.cn",n:"中国国家应急广播"},cngal:{d:"www.cngal.org",n:"CnGal"},cngold:{d:"cngold.org.cn",n:"中国黄金协会"},cnjxol:{d:"cnjxol.com",n:"南湖清风"},cnki:{d:"navi.cnki.net",n:"中国知网"},cnljxh:{d:"cnljxh.com",n:"中国炼焦行业协会"},cntheory:{d:"paper.cntheory.com",n:"理论网"},cntv:{d:"navi.cctv.com",n:"CNTV"},cnu:{d:"cnu.edu.cn",n:"首都师范大学"},cockroachlabs:{d:"cockroachlabs.com",n:"Cockroach Labs"},codefather:{d:"www.codefather.cn",n:"编程导航"},codeforces:{d:"codeforces.com",n:"Codeforces"},cohere:{d:"cohere.com",n:"Cohere"},coindesk:{d:"coindesk.com",n:"CoinDesk"},cointelegraph:{d:"cointelegraph.com",n:"Cointelegraph"},colamanga:{d:"www.colamanga.com",n:"COLAMANGA"},"collabo-cafe":{d:"collabo-cafe.com",n:"コラボカフェ"},"comic-fuz":{d:"comic-fuz.com",n:"COMIC FUZ"},"comic-walker":{d:"comic-walker.com",n:"カドコミ(Kadocomi)"},comicat:{d:"comicat.org",n:"Comicat"},comicskingdom:{d:"comicskingdom.com",n:"Comics Kingdom"},commonhealth:{d:"commonhealth.com.tw",n:"康健"},consumer:{d:"consumer.org.hk",n:"消费者委员会"},cool18:{d:"cool18.com",n:"禁忌书屋"},coolapk:{d:"coolapk.com",n:"酷安"},coolbuy:{d:"coolbuy.com",n:"玩物志"},coolidge:{d:"coolidge.org",n:"Coolidge Corner Theatre"},coolpc:{d:"www.coolpc.com.tw",n:"原價屋"},coomer:{d:"coomer.st",n:"Coomer"},copymanga:{d:"copymanga.com",n:"拷贝漫画"},cosplaytele:{d:"cosplaytele.com",n:"CosplayTele"},costar:{d:"costar.com",n:"CoStar"},"counter-strike":{d:"counter-strike.net",n:"Counter Strike"},cpcaauto:{d:"中国汽车流通协会汽车市场研究分会",n:"cpcaauto.com"},cpcey:{d:"cpc.ey.gov.tw",n:"台湾行政院消费者保护会"},cpta:{d:"www.cpta.com.cn",n:"中国人事考试网"},cpuid:{d:"cpuid.com",n:"CPUID"},cqgas:{d:"cqgas.cn",n:"重庆燃气"},cqu:{d:"cqu.edu.cn",n:"重庆大学"},cqwu:{d:"www.cqwu.net",n:"重庆文理学院"},crac:{d:"www.crac.org.cn",n:"中国无线电协会业余无线电分会"},"creative-comic":{d:"creative-comic.tw",n:"CCC 創作集"},crossbell:{d:"crossbell.io",n:"Crossbell"},crush:{d:"www.crush.ninja",n:"CrushNinja"},cryptoslate:{d:"cryptoslate.com",n:"CryptoSlate"},cs:{d:"cs.com.cn",n:"中证网"},csdn:{d:"blog.csdn.net",n:"CSDN"},"css-tricks":{d:"css-tricks.com",n:"CSS-Tricks"},cssn:{d:"iolaw.cssn.cn",n:"Chinese Social Science Net"},cste:{d:"cste.org.cn",n:"中国技术经济学会"},csu:{d:"career.csu.edu.cn",n:"中南大学"},csust:{d:"www.csust.edu.cn",n:"长沙理工大学"},ctbu:{d:"www.ctbu.edu.cn",n:"重庆工商大学"},ctinews:{d:"ctinews.com",n:"中天新聞網"},cts:{d:"news.cts.com.tw",n:"華視"},cuc:{d:"yz.cuc.edu.cn",n:"中国传媒大学"},cuilingmag:{d:"cuilingmag.com",n:"萃嶺网"},cupl:{d:"jwc.cupl.edu.cn",n:"CUPL"},curiouscat:{d:"curiouscat.live",n:"CuriousCat"},curius:{d:"curius.app",n:"Curius"},cursor:{d:"cursor.com",n:"Cursor"},cw:{d:"cw.com.tw",n:"天下雜誌"},cybersecurityventures:{d:"cybersecurityventures.com",n:"Cybercrime Magazine"},cyzone:{d:"cyzone.cn",n:"创业邦"},cztv:{d:"cztv.com",n:"新蓝网(浙江广播电视集团)"},dahecube:{d:"dahecube.com",n:"大河财立方"},daily:{d:"app.daily.dev",n:"Daily.dev"},dailypush:{d:"dailypush.dev",n:"DailyPush"},damai:{d:"search.damai.cn",n:"大麦网"},dangdang:{d:"open.dangdang.com",n:"当当开放平台"},daoxuan:{d:"daoxuan.cc",n:"道宣的窝"},dapenti:{d:"dapenti.com",n:"喷嚏"},darwinawards:{d:"darwinawards.com",n:"Darwin Awards"},dataguidance:{d:"dataguidance.com",n:"DataGuidance"},dayanzai:{d:"dayanzai.me",n:"大眼仔旭"},dbaplus:{d:"dbaplus.cn",n:"dbaplus社群"},dblp:{d:"dblp.org",n:"DBLP"},dcard:{d:"www.dcard.tw",n:"Dcard"},dcfever:{d:"dcfever.com",n:"DCFever"},ddosi:{d:"ddosi.org",n:"雨苁博客"},deadbydaylight:{d:"deadbydaylight.com",n:"DeadbyDaylight"},deadline:{d:"deadline.com",n:"Deadline"},dealstreetasia:{d:"dealstreetasia.com",n:"DealStreetAsia"},decrypt:{d:"decrypt.co",n:"Decrypt"},dedao:{d:"dedao.cn",n:"得到"},deepin:{d:"bbs.deepin.org",n:"Deepin"},deepl:{d:"deepl.com",n:"DeepL"},deeplearning:{d:"www.deeplearning.ai",n:"DeepLearning.AI"},deepmind:{d:"deepmind.com",n:"DeepMind"},deepseek:{d:"api-docs.deepseek.com",n:"Deepseek"},dehenglaw:{d:"dehenglaw.com",n:"德恒律师事务所"},deltaio:{d:"delta.io",n:"Delta Lake"},denonbu:{d:"denonbu.jp",n:"電音部"},"dev.to":{d:"dev.to",n:"DEV Community"},devolverdigital:{d:"devolverdigital.com",n:"DevolverDigital"},devtrium:{d:"devtrium.com",n:"Devtrium"},dewu:{d:"dewu.com",n:"得物"},dgjyw:{d:"dgjyw.com",n:"东莞教研网"},dgtle:{d:"dgtle.com",n:"数字尾巴"},dgut:{d:"www.dgut.edu.cn",n:"东莞理工学院"},dhu:{d:"www.dhu.edu.cn",n:"东华大学"},diandong:{d:"diandong.com",n:"电动邦"},dianping:{d:"dianping.com",n:"大众点评"},diariofruticola:{d:"diariofruticola.cl",n:"Diario Frutícola"},diershoubing:{d:"diershoubing.com",n:"二柄 APP"},digg:{d:"digg.com",n:"Digg"},digitalcameraworld:{d:"digitalcameraworld.com",n:"Digital Camera World"},digitalpolicyalert:{d:"digitalpolicyalert.org",n:"Digital Policy Alert"},dingshao:{d:"www.dingshao.cn",n:"盯梢"},discord:{d:"discord.com",n:"Discord"},discourse:{n:"Discourse"},discuz:{d:"www.discuz.vip",n:"Discuz"},disinfo:{d:"disinfo.eu",n:"EU Disinfo Lab"},diskanalyzer:{d:"diskanalyzer.com",n:"WizTree"},distill:{d:"distill.pub",n:"Distill"},dlnews:{d:"dlnews.com",n:"DL NEWS"},dlsite:{d:"dlsite.com",n:"DLsite"},dmzj:{d:"news.dmzj.com",n:"动漫之家"},dn:{d:"dn.com",n:"DN.com"},dnaindia:{d:"dnaindia.com",n:"DNA India"},dockerhub:{d:"hub.docker.com",n:"Docker Hub"},docschina:{d:"docschina.org",n:"印记中文"},dol:{d:"announce.dol.go.th",n:"Thailand Department of Lands"},domp4:{d:"www.xlmp4.com",n:"DoMP4 影视"},dongqiudi:{d:"m.dongqiudi.com",n:"懂球帝"},"dora-world":{d:"www.dora-world.com",n:"Doraemon Channel"},dorohedoro:{d:"dorohedoro.net",n:"Dorohedoro"},douban:{d:"www.douban.com",n:"豆瓣"},douyin:{d:"douyin.com",n:"抖音直播"},douyu:{d:"www.douyu.com",n:"斗鱼直播"},dpm:{d:"www.dpm.org.cn",n:"The Palace Museum"},dribbble:{d:"dribbble.com",n:"Dribbble"},dtcj:{d:"dtcj.com",n:"DT 财经"},duckdb:{d:"duckdb.org",n:"DuckDB Foundation"},duozhi:{d:"duozhi.com",n:"多知网"},duozhuayu:{d:"duozhuayu.com",n:"多抓鱼"},dushu:{d:"card.dushu.io",n:"樊登读书"},dut:{d:"dutdice.dlut.edu.cn",n:"大连理工大学"},dw:{d:"dw.com",n:"DW Deutsche Welle"},dx2025:{d:"dx2025.com",n:"东西智库"},dxy:{d:"dxy.cn",n:"丁香园"},dykszx:{d:"www.dykszx.com",n:"德阳人事考试网"},dytt:{d:"www.dydytt.net",n:"电影天堂"},"e-hentai":{d:"e-hentai.org",n:"E-Hentai"},ea:{d:"www.ea.com",n:"EA Games"},eagle:{d:"cn.eagle.cool",n:"Eagle"},earthquake:{d:"www.ceic.ac.cn",n:"地震速报"},eastday:{d:"mini.eastday.com",n:"东方网"},eastmoney:{d:"data.eastmoney.com",n:"东方财富"},easynomad:{d:"easynomad.cn",n:"轻松游牧-远程工作聚集地"},ebc:{d:"ebc.net.tw",n:"東森新聞"},ecnu:{d:"www.ecnu.edu.cn",n:"East China Normal University 华东师范大学"},economist:{d:"economist.com",n:"The Economist"},ecust:{d:"e.ecust.edu.cn",n:"华东理工大学"},eeo:{d:"eeo.com.cn",n:"经济观察网"},efe:{d:"efe.com",n:"EFE Noticias"},egsea:{d:"egsea.com",n:"e 公司"},ehentai:{n:"E-Hentai"},ekantipur:{d:"ekantipur.com",n:"Ekantipur / कान्तिपुर (Nepal)"},elamigos:{d:"elamigos.site",n:"ElAmigos"},"elasticsearch-cn":{d:"elasticsearch.cn",n:"Elastic 中文社区"},elecfans:{d:"www.elecfans.com",n:"电子发烧友"},eleduck:{d:"eleduck.com",n:"电鸭社区"},elsevier:{d:"www.sciencedirect.com",n:"ELSEVIER"},embassy:{d:"ca.china-embassy.org",n:"中国驻外使领馆"},engineering:{d:"engineering.fyi",n:"Engineering.fyi"},englishhome:{d:"englishhome.org",n:"英語之家"},enterprisecraftsmanship:{d:"enterprisecraftsmanship.com",n:"Enterprise Craftsmanship"},epicgames:{d:"store.epicgames.com",n:"Epic Games Store"},eprice:{d:"eprice.com.tw",n:"ePrice"},eshukan:{d:"eshukan.com",n:"万维书刊网"},espn:{d:"espn.com",n:"ESPN"},esquirehk:{d:"www.esquirehk.com",n:"Esquire Hong Kong"},europechinese:{d:"europechinese.blogspot.com",n:"歐洲動態(國際)"},eventbrite:{d:"eventbrite.com",n:"Eventbrite"},eventernote:{d:"www.eventernote.com",n:"Eventernote"},everia:{d:"everia.club",n:"EVERIA.CLUB"},expats:{d:"expats.cz",n:"Expats.cz"},"f-droid":{d:"f-droid.org",n:"F-Droid"},f95zone:{d:"f95zone.to",n:"F95zone"},famitsu:{d:"famitsu.com",n:"ファミ通"},fanbox:{d:"www.fanbox.cc",n:"fanbox"},fangchan:{d:"fangchan.com",n:"中房网"},fanqienovel:{d:"fanqienovel.com",n:"番茄小说"},fansly:{d:"fansly.com",n:"Fansly"},fantia:{d:"fantia.jp",n:"Fantia"},fantube:{d:"www.fantube.tokyo",n:"FANTUBE"},fanxinzhui:{d:"fanxinzhui.com",n:"追新番"},farcaster:{d:"www.farcaster.xyz",n:"Farcaster"},farmatters:{d:"farmatters.com",n:"Farmatters"},fashionnetwork:{d:"fashionnetwork.cn",n:"FashionNetwork"},fastbull:{d:"fastbull.com",n:"FastBull"},fcbayern:{d:"fcbayern.com",n:"FC Bayern München"},fda:{d:"fda.gov",n:"U.S. Food and Drug Administration"},fediverse:{d:"fediverse.observer",n:"Fediverse"},feng:{d:"feng.com",n:"威锋"},ff14:{d:"eu.finalfantasyxiv.com",n:"FINAL FANTASY XIV"},fffdm:{d:"manhua.fffdm.com",n:"风之动漫"},finology:{d:"insider.finology.in",n:"Finology Insider"},finviz:{d:"finviz.com",n:"finviz"},firecore:{d:"firecore.com",n:"Infuse"},firefox:{d:"monitor.firefox.com",n:"Mozilla"},"fisher-spb":{d:"fisher.spb.ru",n:"Fisher Spb"},fishshell:{d:"fishshell.com",n:"fish shell"},fjdaily:{d:"fjdaily.com",n:"福建日报"},fjksbm:{d:"fjksbm.com",n:"福建考试报名网"},flashcat:{d:"flashcat.cloud",n:"Flashcat"},flyert:{d:"flyert.com.cn",n:"飞客茶馆"},focustaiwan:{d:"focustaiwan.tw",n:"Focus Taiwan"},follow:{d:"app.follow.is",n:"Follow"},followin:{d:"followin.io",n:"Followin"},foodtalks:{d:"www.foodtalks.cn",n:"FoodTalks全球食品资讯网"},foreignaffairs:{d:"www.foreignaffairs.com",n:"Foreign Affairs"},foresightnews:{d:"foresightnews.pro",n:"Foresight News"},foreverblog:{d:"www.foreverblog.cn",n:"十年之约"},forklog:{d:"forklog.com",n:"Forklog"},fortnite:{d:"fortnite.com",n:"Fortnite"},fortunechina:{d:"fortunechina.com",n:"财富中文网"},fosshub:{d:"fosshub.com",n:"FossHub"},free:{d:"free.com.tw",n:"免費資源網路社群"},freebuf:{d:"freebuf.com",n:"FreeBuf"},freecomputerbooks:{d:"freecomputerbooks.com",n:"Free Computer Books"},freewechat:{d:"freewechat.com",n:"自由微信"},freexcomic:{d:"freexcomic.com",n:"漫小肆韓漫"},ft:{d:"ft.com",n:"Financial Times"},ftchinese:{d:"ftchinese.com",n:"FT 中文网"},ftm:{d:"www.ftm.eu",n:"Follow The Money"},fuliba:{d:"fuliba2023.net",n:"福利吧"},furaffinity:{d:"furaffinity.net",n:"Furaffinity"},furstar:{d:"furstar.jp",n:"Furstar"},futunn:{d:"news.futunn.com",n:"Futubull 富途牛牛"},"fx-markets":{d:"fx-markets.com",n:"FX Markets"},fx678:{d:"fx678.com",n:"汇通网"},fxiaoke:{d:"fxiaoke.com",n:"纷享销客 CRM"},fzmtr:{d:"www.fzmtr.com",n:"福州地铁"},galxe:{d:"app.galxe.com",n:"Galxe"},gameapps:{d:"gameapps.hk",n:"GameApps.hk 香港手机游戏网"},gamebase:{d:"news.gamebase.com.tw",n:"遊戲基地 Gamebase"},gamegene:{d:"news.gamegene.cn",n:"游戏基因"},gamekee:{d:"www.gamekee.com",n:"GameKee | 游戏百科攻略"},gamer:{d:"acg.gamer.com.tw",n:"巴哈姆特電玩資訊站"},gamer520:{d:"www.gamer520.com",n:"全球游戏交流中心"},gamersecret:{d:"gamersecret.com",n:"Gamer Secret"},gamersky:{d:"gamersky.com",n:"GamerSky"},gamme:{d:"news.gamme.com.tw",n:"卡卡洛普"},ganjingworld:{d:"www.ganjingworld.com",n:"Ganjing World"},gaoyu:{d:"gaoyu.me",n:"Yu Gao"},"gc.ca":{d:"pm.gc.ca",n:"Prime Minister of Canada"},gcores:{d:"gcores.com",n:"机核网"},gdsrx:{d:"gdsrx.org.cn",n:"广东省食品药品审评认证技术协会"},gdufs:{d:"gdufs.edu.cn",n:"广东外语外贸大学"},gdut:{d:"oas.gdut.edu.cn",n:"广东工业大学"},geekpark:{d:"geekpark.net",n:"极客公园"},gelbooru:{d:"gelbooru.com",n:"Gelbooru"},gelonghui:{d:"gelonghui.com",n:"格隆汇"},genossenschaften:{d:"genossenschaften.immo",n:"Genossenschaften.immo"},geocaching:{d:"geocaching.com",n:"Geocaching"},gesiba:{d:"gesiba.at",n:"Gesiba"},getdr:{d:"getdr.com",n:"趨勢科技防詐達人"},getitfree:{d:"getitfree.cn",n:"正版中国"},gettr:{d:"gettr.com",n:"GETTR"},"gf-cn":{d:"sunborngame.com",n:"少女前线"},gigazine:{d:"gigazine.net",n:"GIGAZINE"},gihyo:{d:"gihyo.jp",n:"gihyo.jp"},gisreportsonline:{d:"www.gisreportsonline.com",n:"GIS Reports"},gitcode:{d:"gitcode.com",n:"GitCode"},gitee:{d:"gitee.com",n:"Gitee"},github:{d:"github.com",n:"GitHub"},gitkraken:{d:"gitkraken.com",n:"GitKraken"},gitpod:{d:"gitpod.io",n:"Gitpod"},"gitstar-ranking":{d:"gitstar-ranking.com",n:"Gitstar Ranking"},globallawreview:{d:"globallawreview.org",n:"环球法律评论"},gmcmonline:{d:"gmcmonline.com",n:"国门传媒在线"},gmu:{d:"gmu.cn",n:"赣南医科大学"},go:{d:"go.jp",n:"JapanGov"},gocn:{d:"gocn.vip",n:"GoCN"},gofans:{d:"gofans.cn",n:"GoFans"},gogoanimehd:{d:"developer.anitaku.to",n:"Gogoanimehd"},google:{d:"www.google.com",n:"Google"},gq:{d:"gq.com",n:"GQ"},grainoil:{d:"load.grainoil.com.cn",n:"国家粮油信息中心"},greasyfork:{d:"greasyfork.org",n:"Greasy Fork"},grist:{d:"grist.org",n:"Grist"},grubstreet:{d:"grubstreet.com",n:"Grub Street"},grupoanimal:{d:"grupoanimal.mx",n:"Grupo Animal"},gs:{d:"goldmansachs.com",n:"Goldman Sachs"},guancha:{d:"guancha.cn",n:"观察者网"},guangdiu:{d:"guangdiu.com",n:"逛丢"},guangzhoumetro:{d:"www.gzmtr.com",n:"广州地铁"},guanhai:{d:"guanhai.com.cn",n:"观海新闻"},guduodata:{d:"data.guduodata.com",n:"骨朵数据"},gumroad:{d:"gumroad.com",n:"Gumroad"},guokr:{d:"guokr.com",n:"果壳网"},guozaoke:{d:"guozaoke.com",n:"guozaoke"},gxmzu:{d:"ai.gxmzu.edu.cn",n:"广西民族大学"},gzdaily:{d:"gzdaily.cn",n:"广州日报"},gzhu:{d:"yjsy.gzhu.edu.cn",n:"广州大学"},hackernews:{d:"ycombinator.com",n:"Hacker News"},hackertalk:{d:"hackertalk.net",n:"HACKER TALK 黑客说"},hacking8:{d:"hacking8.com",n:"Hacking8"},hackmd:{d:"hackmd.io",n:"HackMD"},hackyournews:{d:"hackyournews.com",n:"HackYourNews"},hafu:{d:"www.hafu.edu.cn",n:"河南财政金融学院"},hakkatv:{d:"hakkatv.org.tw",n:"客家電視台"},hamel:{d:"hamel.dev",n:"Hamel"},hameln:{d:"syosetu.org",n:"hameln"},hanime1:{d:"hanime1.me",n:"Hanime1"},harvard:{d:"www.health.harvard.edu",n:"Harvard Health Publishing"},hashnode:{d:"hashnode.dev",n:"hashnode"},hbooker:{d:"hbooker.com",n:"欢乐书客"},hbr:{d:"hbr.org",n:"Harvard Business Review"},hdu:{d:"hdu.edu.cn",n:"杭州电子科技大学"},hebeimuseum:{d:"www.hebeimuseum.org.cn",n:"Hebei Museum"},hebtv:{d:"web.cmc.hebtv.com",n:"河北网络广播电视台"},hedwig:{d:"hedwig.pub",n:"Hedwig"},hellobtc:{d:"hellobtc.com",n:"白话区块链"},hellogithub:{d:"hellogithub.com",n:"HelloGitHub"},"hex-rays":{d:"hex-rays.com",n:"Hex-Rays"},hexun:{d:"hexun.com",n:"和讯网"},hfut:{d:"hfut.edu.cn",n:"合肥工业大学"},hicairo:{d:"hicairo.com",n:"HiFeng"},hinatazaka46:{d:"hinatazaka46.com",n:"Sakamichi Series 坂道系列官网资讯"},"hiring.cafe":{d:"hiring.cafe",n:"HiringCafe"},hit:{d:"www.hit.edu.cn",n:"哈尔滨工业大学"},hitcon:{d:"hitcon.org",n:"HITCON"},hitsz:{d:"hitsz.edu.cn",n:"哈尔滨工业大学(深圳)"},hitwh:{d:"hitwh.edu.cn",n:"哈尔滨工业大学(威海)"},hizu:{d:"hizh.cn",n:"珠海网"},hk01:{d:"hk01.com",n:"香港 01"},hkej:{d:"hkej.com",n:"信报财经新闻"},hkepc:{d:"hkepc.com",n:"HKEPC"},hket:{d:"china.hket.com",n:"香港经济日报"},hkjunkcall:{d:"hkjunkcall.com",n:"HKJunkCall 資訊中心"},hko:{d:"www.hko.gov.hk",n:"Hong Kong Observatory"},hkushop:{d:"hkushop.com",n:"環球唱片(香港)官方網上商店"},hlju:{d:"hlju.edu.cn",n:"黑龙江大学"},hljucm:{d:"yjsy.hljucm.net",n:"黑龙江中医药大学"},hnrb:{d:"voc.com.cn",n:"湖南日报"},hnu:{d:"scc.hnu.edu.cn",n:"湖南大学"},"home-assistant":{d:"www.home-assistant.io",n:"Home Assistant"},hongkong:{d:"dh.gov.hk",n:"Hong Kong Department of Health 香港卫生署"},hostmonit:{d:"stock.hostmonit.com",n:"全球主机监控"},hottoys:{d:"www.hottoys.com.hk",n:"Hot Toys"},hotukdeals:{d:"www.hotukdeals.com",n:"hotukdeals"},houxu:{d:"houxu.app",n:"后续"},howtoforge:{d:"howtoforge.com",n:"Howtoforge Linux Tutorials"},hoyolab:{d:"hoyolab.com",n:"HoYoLAB"},hpoi:{d:"www.hpoi.net",n:"Hpoi 手办维基"},hrbeu:{d:"yjsy.hrbeu.edu.cn",n:"哈尔滨工程大学"},hrbust:{d:"hrbust.edu.cn",n:"哈尔滨理工大学"},huanqiu:{d:"huanqiu.com",n:"环球网"},huawei:{d:"developer.huawei.com",n:"华为开发者联盟"},hubu:{d:"hubu.edu.cn",n:"湖北大学"},hudsonrivertrading:{d:"hudsonrivertrading.com",n:"Hudson River Trading"},huggingface:{d:"huggingface.co",n:"Huggingface"},"huijin-inv":{d:"www.huijin-inv.cn",n:"中央汇金投资有限责任公司"},huitun:{d:"www.huitun.com",n:"灰豚数据"},humanlayer:{d:"www.humanlayer.dev",n:"HumanLayer"},hunanpea:{d:"rsks.hunanpea.com",n:"湖南人事考试网"},hunau:{d:"gfxy.hunau.edu.cn",n:"湖南农业大学"},huoxian:{d:"zone.huoxian.cn",n:"火线"},hupu:{d:".hupu.com",n:"虎扑"},hust:{d:"hust.edu.cn",n:"华中科技大学"},huxiu:{d:"huxiu.com",n:"虎嗅"},hyperdash:{d:"hyperdash.info",n:"HyperDash"},hypergryph:{d:"www.hypergryph.com",n:"鹰角网络"},"i-cable":{d:"i-cable.com",n:"有線新聞"},ianspriggs:{d:"ianspriggs.com",n:"Ian Spriggss"},iapp:{d:"iapp.org",n:"IAPP"},icac:{d:"icac.org.hk",n:"Hong Kong Independent Commission Against Corruption 香港廉政公署"},icbc:{d:"icbc.com.cn",n:"中国工商银行"},idaily:{d:"idai.ly",n:"iDaily"},idolmaster:{d:"idolmaster-official.jp",n:"アイドルマスター THE IDOLM@STER"},idolypride:{d:"idolypride.jp",n:"IDOLY PRIDE 偶像荣耀"},ieee:{d:"www.ieee.org",n:"IEEE Xplore"},"ieee-security":{d:"ieee-security.org",n:"IEEE Computer Society"},iehou:{d:"iehou.com",n:"网猴线报"},ielts:{d:"ielts.neea.cn",n:"IELTS 雅思"},ifanr:{d:"www.ifanr.com",n:"爱范儿"},ifeng:{d:"feng.ifeng.com",n:"凤凰网"},"ifi-audio":{d:"ifi-audio.com",n:"iFi audio"},ifun:{d:"ifun.cool",n:"趣集"},iguoguo:{d:"iguoguo.net",n:"爱果果"},iheima:{d:"www.iheima.com",n:"i黑马网"},iiilab:{d:"www.iiilab.com",n:"人人都是自媒体"},ikea:{d:"ikea.com",n:"IKEA"},iknowwhatyoudownload:{d:"iknowwhatyoudownload.com",n:"I Know What You Download"},imagemagick:{d:"imagemagick.org",n:"ImageMagick"},imdb:{d:"www.imdb.com",n:"IMDb"},imhcg:{d:"infos.imhcg.cn",n:"imhcg的信息站"},imiker:{d:"imiker.com",n:"米课"},immich:{d:"immich.app",n:"Immich"},imop:{d:"imop.com",n:"imop"},"in-en":{d:"www.in-en.com",n:"国际能源网"},inceptionlabs:{d:"inceptionlabs.ai",n:"Inception Labs"},indianexpress:{d:"indianexpress.com",n:"The Indian Express"},indiansinkuwait:{d:"indiansinkuwait.com",n:"Indians in Kuwait"},indienova:{d:"indienova.com",n:"indienova 独立游戏"},inewsweek:{d:"inewsweek.cn",n:"中国新闻周刊"},infoq:{d:"infoq.cn",n:"InfoQ 中文"},informs:{d:"pubsonline.informs.org",n:"INFORMS"},infzm:{d:"www.infzm.com",n:"南方周末"},inoreader:{d:"inoreader.com",n:"Inoreader"},inspirehep:{d:"inspirehep.net",n:"INSPIRE"},instagram:{d:"www.instagram.com",n:"Instagram"},instructables:{d:"instructables.com",n:"Instructables"},investor:{d:"investor.org.cn",n:"中国投资者网"},iplaysoft:{d:"www.iplaysoft.com",n:"异次元软件世界"},ippa:{d:"ippa.top",n:"子方有料"},ipsw:{d:"ipsw.me",n:"IPSW.me"},"ipsw.dev":{d:"ipsw.dev",n:"IPSW.dev"},iqilu:{d:"v.iqilu.com",n:"齐鲁网"},iqiyi:{d:"iq.com",n:"爱奇艺"},iqnew:{d:"iqnew.com",n:"爱 Q 生活网"},iresearch:{d:"iresearch.com.cn",n:"艾瑞咨询"},isct:{d:"isct.ac.jp",n:"Institute of Science Tokyo"},issuehunt:{d:"issuehunt.io",n:"Issue Hunt"},itc:{d:"open.itc.cn",n:"Open Github社区"},itch:{d:"itch.io",n:"itch.io"},ithome:{d:"ithome.com",n:"iThome 台灣"},itsec:{d:"www.itsec.gov.cn",n:"中国信息安全测评中心"},iwara:{d:"www.iwara.tv",n:"iwara"},ixigua:{d:"ixigua.com",n:"西瓜视频"},"j-test":{d:"www.j-test.com",n:"实用日本语鉴定考试(J.TEST)"},jamesclear:{d:"jamesclear.com",n:"James Clear"},jandan:{d:"jandan.net",n:"煎蛋"},japanpost:{d:"trackings.post.japanpost.jp",n:"Japanpost"},javbus:{d:"www.javbus.com",n:"JavBus"},javdb:{d:"javdb.com",n:"JavDB"},javlibrary:{d:"javlibrary.com",n:"JAVLibrary"},javtiful:{d:"javtiful.com",n:"Javtiful"},javtrailers:{d:"javtrailers.com",n:"JavTrailers"},jbma:{d:"jbma.net",n:"Japan Bullion Market Association"},jd:{d:"item.jd.com",n:"京东"},jetbrains:{d:"jetbrains.com",n:"JetBrains"},jewishmuseum:{d:"thejewishmuseum.org",n:"The Jewish Museum"},jianshu:{d:"www.jianshu.com",n:"简书"},jiaoliudao:{d:"jiaoliudao.com",n:"交流岛资源网"},jiemian:{d:"jiemian.com",n:"界面新闻"},jike:{d:"m.okjike.com",n:"即刻"},jimmyspa:{d:"www.jimmyspa.com",n:"幾米 JIMMY S.P.A. Official Website"},jin10:{d:"jin10.com",n:"金十数据"},jingzhengu:{d:"www.jingzhengu.com",n:"精真估"},jinritemai:{d:"op.jinritemai.com",n:"抖店开放平台"},jinse:{d:"jinse.com.cn",n:"金色财经"},jisilu:{d:"jisilu.cn",n:"集思录"},jiuyangongshe:{d:"www.jiuyangongshe.com",n:"韭研公社"},jjwxc:{d:"jjwxc.net",n:"晋江文学城"},jl1mall:{d:"jl1mall.com",n:"吉林一号网"},jlu:{d:"jlu.edu.cn",n:"吉林大学"},joins:{d:"joins.com",n:"中央日报"},joneslanglasalle:{d:"joneslanglasalle.com.cn",n:"Jones Lang LaSalle"},jornada:{d:"jornada.com.mx",n:"La Jornada"},joshwcomeau:{d:"www.joshwcomeau.com",n:"Josh W Comeau"},jou:{d:"www.jou.edu.cn",n:"江苏海洋大学"},jpmorganchase:{d:"www.jpmorganchase.com",n:"JPMorgan Chase"},jpxgmn:{d:"www.jpxgmn.com",n:"极品性感美女"},jrj:{d:"www.jrj.com.cn",n:"金融界"},jseea:{d:"jseea.cn",n:"Unknown"},jsu:{d:"jsu.edu.cn",n:"吉首大学"},juejin:{d:"juejin.cn",n:"掘金"},jumeili:{d:"jumeili.cn",n:"聚美丽"},jump:{d:"switch.jumpvg.com",n:"JUMP"},junhe:{d:"junhe.com",n:"君合律师事务所"},kadokawa:{d:"kadokawa.com.tw",n:"台灣角川"},kakuyomu:{d:"kakuyomu.jp",n:"カクヨム"},"kamen-rider-official":{d:"kamen-rider-official.com",n:"仮面ライダ"},kantarworldpanel:{d:"kantarworldpanel.com",n:"Kantar Worldpanel"},kanxue:{d:"kanxue.com",n:"看雪"},kaopu:{d:"kaopu.news",n:"靠谱新闻"},kbs:{d:"world.kbs.co.kr",n:"KBS"},kcna:{d:"www.kcna.kp",n:"Korean Central News Agency (KCNA) 朝鲜中央通讯社"},ke:{d:"www.research.ke.com",n:"贝壳研究院"},keep:{d:"gotokeep.com",n:"Keep"},keepass:{d:"keepass.info",n:"KeePass"},kelownacapnews:{d:"www.kelownacapnews.com",n:"Kelowna Capital News"},kemono:{d:"kemono.cr",n:"Kemono"},kepu:{d:"live.kepu.net.cn",n:"中国科普博览"},keylol:{d:"keylol.com",n:"其乐"},kimlaw:{d:"kimlaw.or.kr",n:"The Korea Institute of Marine Law"},kiro:{d:"kiro.dev",n:"Kiro"},kisskiss:{d:"www.kisskiss.tv",n:"KISS"},kleinanzeigen:{d:"www.kleinanzeigen.de",n:"Kleinanzeigen"},komiic:{d:"komiic.com",n:"Komiic"},konachan:{d:"konachan.com",n:"Konachan.com Anime Wallpapers"},konghq:{d:"konghq.com",n:"Kong API 网关平台"},koreaherald:{d:"koreaherald.com",n:"The Korea Herald"},kovidgoyal:{d:"sw.kovidgoyal.net",n:"Kovid"},koyso:{d:"koyso.to",n:"Koyso"},kpmg:{d:"kpmg.com",n:"KPMG"},kpopping:{d:"kpopping.com",n:"kpopping"},ktown4u:{d:"ktown4u.com",n:"Ktown4u"},kuaidi100:{d:"kuaidi100.com",n:"快递 100"},kuaishou:{d:"kuaishou.com",n:"快手"},kunchengblog:{d:"kunchengblog.com",n:"Kun Cheng"},kurogames:{d:"www.kurogames.com",n:"库洛游戏 | Kuro Games"},kuwaitlocal:{d:"kuwaitlocal.com",n:"Kuwait Local"},kyodonews:{d:"china.kyodonews.net",n:"共同网"},laimanhua:{d:"www.laimanhua8.com",n:"来漫画"},lala:{d:"lala.im",n:"荒岛"},lancedb:{d:"lancedb.com",n:"LanceDB"},landiannews:{d:"landiannews.com",n:"蓝点网"},lang:{d:"lang.live",n:"浪 Play 直播"},langchain:{d:"blog.langchain.dev",n:"LangChain Blog"},lanqiao:{d:"lanqiao.cn",n:"蓝桥云课"},laohu8:{d:"laohu8.com",n:"老虎社区"},"last-origin":{d:"www.last-origin.com",n:"LastOrigin"},latepost:{d:"latepost.com",n:"晚点 LatePost"},layoffs:{d:"layoffs.fyi",n:"Layoffs.fyi"},leagueoflegends:{d:"leagueoflegends.com",n:"League of Legends"},learnblockchain:{d:"learnblockchain.cn",n:"登链社区"},learnku:{d:"learnku.com",n:"LearnKu"},leetcode:{d:"leetcode.com",n:"LeetCode"},leiphone:{d:"leiphone.com",n:"雷峰网"},lemmy:{d:"join-lemmy.org",n:"Lemmy"},lemonde:{d:"lemonde.fr",n:"Le Monde"},lenovo:{d:"lenovo.com.cn",n:"联想"},lens:{d:"www.lens.xyz",n:"Lens"},lephoceen:{d:"lephoceen.fr",n:"Le Phocéen"},letterboxd:{d:"letterboxd.com",n:"Letterboxd"},lfsyd:{d:"www.iyingdi.com",n:"旅法师营地"},lhratings:{d:"lhratings.com",n:"联合资信评估股份有限公司"},lianxh:{d:"www.lianxh.cn",n:"连享会"},lifeweek:{d:"lifeweek.com.cn",n:"三联生活周刊"},lightnovel:{d:"lightNovel.us",n:"轻之国度"},likeshop:{d:"likeshop.me",n:"LikeShop"},line:{d:"today.line.me",n:"LINE"},lineageos:{d:"lineageos.org",n:"LineageOS"},link3:{d:"link3.to",n:"Link3"},linkedin:{d:"linkedin.com",n:"LinkedIn"},linkresearcher:{d:"www.linkresearcher.com",n:"Link Research"},linovelib:{d:"linovelib.com",n:"哔哩轻小说"},liquipedia:{d:"liquipedia.net",n:"Liquipedia"},literotica:{d:"literotica.com",n:"Literotica"},liulinblog:{d:"liulinblog.com",n:"木木博客"},liveuamap:{d:"liveuamap.com",n:"Live Universal Awareness Map"},lkong:{d:"lkong.com",n:"龙空"},lmu:{d:"www.lmu.de",n:"Ludwig Maximilian University of Munich"},locals:{d:"locals.com",n:"Locals"},lofter:{d:"www.lofter.com",n:"Lofter"},logclub:{d:"logclub.com",n:"罗戈网"},logonews:{d:"logonews.cn",n:"LogoNews 标志情报局"},logrocket:{d:"blog.logrocket.com",n:"logrocket blog"},loltw:{d:"lol.garena.tw",n:"英雄联盟"},loongarch:{d:"loongarch.org",n:"LA UOSC社区"},lorientlejour:{d:"lorientlejour.com",n:"L"},"lovelive-anime":{d:"www.lovelive-anime.jp",n:"Love Live! Official Website"},lrepacks:{d:"lrepacks.net",n:"REPACK скачать"},lsnu:{d:"lsnu.edu.cn",n:"乐山师范学院"},ltaaa:{d:"ltaaa.cn",n:"龙腾网"},luma:{d:"lu.ma",n:"LuMa"},luogu:{d:"luogu.com.cn",n:"洛谷"},luolei:{d:"luolei.org",n:"罗磊的独立博客"},luxiangdong:{d:"luxiangdong.com",n:"土猛的员外"},lvv2:{d:"lvv2.com",n:"LVV2"},lxixsxa:{d:"www.sonymusic.co.jp",n:"LiSA"},"m-78":{d:"m-78.jp",n:"円谷ステーション"},m4:{d:"news.m4.cn",n:"四月网"},maccms:{n:"通用影视采集站视频采集接口路由"},macfilos:{d:"macfilos.com",n:"Macfilos"},macmenubar:{d:"macmenubar.com",n:"MacMenuBar"},macupdate:{d:"macupdate.com",n:"MacUpdate"},magazinelib:{d:"magazinelib.com",n:"MagazineLib"},magnumphotos:{d:"magnumphotos.com",n:"Magnum Photos"},mail:{n:"Email"},makerworld:{d:"makerworld.com",n:"MakerWorld"},malaysiakini:{d:"malaysiakini.com",n:"Malaysiakini"},mangadex:{d:"mangadex.org",n:"MangaDex"},manhuagui:{d:"www.manhuagui.com",n:"看漫画"},manus:{d:"manus.im",n:"Manus"},manyvids:{d:"www.manyvids.com",n:"ManyVids"},maoyan:{d:"maoyan.com",n:"猫眼电影"},mashiro:{d:"mashiro.best",n:"Mashiro"},mastodon:{d:"mastodon.social",n:"Mastodon"},mathpix:{d:"mathpix.com",n:"Mathpix"},matters:{d:"matters.town",n:"Matters"},maven:{d:"repo1.maven.org",n:"Maven"},mckinsey:{d:"mckinsey.com.cn",n:"麦肯锡"},mcmod:{d:"www.mcmod.cn",n:"MC百科"},mdpi:{d:"www.mdpi.com",n:"MDPI"},"medieval-china":{d:"medieval-china.club",n:"中国的中古"},medium:{d:"medium.com",n:"Medium"},medsci:{d:"medsci.cn",n:"梅斯医学 MedSci"},meishichina:{d:"meishichina.com",n:"美食天下"},meituan:{d:"meituan.com",n:"美团"},melonbooks:{d:"www.melonbooks.co.jp",n:"メロンブックス"},mercari:{d:"jp.mercari.com",n:"Mercari"},meritalk:{d:"meritalk.com",n:"MeriTalk"},meta:{d:"www.meta.com",n:"Meta"},metacritic:{d:"metacritic.com",n:"Metacritic"},meteoblue:{d:"meteoblue.com",n:"meteoblue"},meteor:{d:"meteor.today",n:"Meteor"},metmuseum:{d:"www.metmuseum.org",n:"The Metropolitan Museum of Art"},mhlw:{d:"www.mhlw.go.jp",n:"厚生労働省"},mi:{d:"mi.com",n:"小米"},microsoft:{d:"microsoft.com",n:"Microsoft"},mihoyo:{d:"genshin.hoyoverse.com",n:"米哈游"},mindmeister:{d:"mindmeister.com",n:"MindMeister"},minecraft:{d:"minecraft.net",n:"Minecraft"},mingpao:{d:"mingpao.com",n:"明報"},miniflux:{d:"miniflux.app",n:"MiniFlux"},mirror:{d:"mirror.xyz",n:"Mirror"},mirrormedia:{d:"mirrormedia.mg",n:"鏡週刊 Mirror Media"},missav:{d:"missav.ws",n:"MissAV"},misskey:{d:"misskey.io",n:"Misskey"},misskon:{d:"misskon.com",n:"MissKON"},mit:{d:"mit.edu",n:"Massachusetts Institute of Technology"},mittrchina:{d:"mittrchina.com",n:"麻省理工科技评论"},miui:{d:"miui.com",n:"MIUI"},mixcloud:{d:"www.mixcloud.com",n:"Mixcloud"},mixi2:{d:"mixi.social",n:"mixi2"},miyuki:{d:"miyuki.jp",n:"中島みゆき Official"},modb:{d:"modb.pro",n:"墨天轮"},modelscope:{d:"modelscope.cn",n:"ModelScope 魔搭社区"},modian:{d:"modian.com",n:"摩点"},modrinth:{d:"modrinth.com",n:"Modrinth"},mohw:{d:"mohw.gov.tw",n:"台灣衛生福利部"},moodysmismicrosite:{d:"www.moodysmismicrosite.com",n:"穆迪评级"},mox:{d:"mox.moe",n:"Mox.moe"},mpaypass:{d:"mpaypass.com.cn",n:"移动支付网"},mrdx:{d:"mrdx.cn",n:"新华每日电讯"},mrinalxdev:{d:"mrinalxdev.github.io",n:"Mrinal Pramanick"},mrm:{d:"mrm.com.cn",n:"华储网"},msn:{d:"msn.com",n:"MSN"},musify:{d:"musify.club",n:"musify"},musikguru:{d:"musikguru.de",n:"MusikGuru"},mwm:{d:"mwm.net.cn",n:"管理世界"},"my-formosa":{d:"my-formosa.com",n:"美麗島電子報"},mycard520:{d:"mycard520.com.tw",n:"MyCard娛樂中心"},mydrivers:{d:"m.mydrivers.com",n:"快科技"},myfans:{d:"myfans.jp",n:"myfans"},myfigurecollection:{d:"myfigurecollection.net",n:"MyFigureCollection"},mygopen:{d:"mygopen.com",n:"MyGoPen"},mymusicsheet:{d:"mymusicfive.com",n:"mymusic5 (MyMusicSheet)"},mysql:{d:"dev.mysql.com",n:"MySQL"},nanhua:{d:"mall.nanhua.net",n:"南华期货"},nankai:{d:"yzb.nankai.edu.cn",n:"南开大学"},nasa:{d:"apod.nasa.gov",n:"NASA"},natgeo:{d:"nationalgeographic.com",n:"National Geographic"},nationalgeographic:{d:"www.nationalgeographic.com",n:"National Geographic"},naturalism:{d:"naturalism.org",n:"Naturalism.org"},nature:{d:"nature.com",n:"Nature Journal"},nautil:{d:"nautil.us",n:"Nautilus"},nautiljon:{d:"nautiljon.com",n:"Nautiljon"},naver:{d:"naver.com",n:"네이버"},nbd:{d:"nbd.com.cn",n:"每经网"},nber:{d:"nber.org",n:"National Bureau of Economic Research"},"ncc-cma":{d:"cmdp.ncc-cma.net",n:"国家气候中心"},ncepu:{d:"yjsy.ncepu.edu.cn",n:"华北电力大学"},ncku:{d:"www.ncku.edu.tw",n:"National Cheng Kung University"},ncpssd:{d:"ncpssd.cn",n:"国家哲学社会科学文献中心"},ncu:{d:"jwc.ncu.edu.cn",n:"南昌大学"},ncwu:{d:"ncwu.edu.cn",n:"华北水利水电大学"},"ndss-symposium":{d:"ndss-symposium.org",n:"Network and Distributed System Security (NDSS) Symposium"},neatdownloadmanager:{d:"neatdownloadmanager.com",n:"Neat Download Manager"},neea:{d:"www.neea.cn",n:"中国教育考试网"},nenu:{d:"sohac.nenu.edu.cn",n:"东北师范大学"},netflav:{d:"netflav.com",n:"Netflav"},netflix:{d:"netflix.com",n:"Netflix"},neu:{d:"neunews.neu.edu.cn",n:"东北大学"},newmuseum:{d:"www.newmuseum.org",n:"New Museum"},newrank:{d:"newrank.cn",n:"新榜"},news:{d:"news.cn",n:"新华社"},newseed:{d:"newseed.cn",n:"新芽"},newslaundry:{d:"newslaundry.com",n:"Newslaundry"},newsmarket:{d:"newsmarket.com.tw",n:"上下游 News&Market"},newswav:{d:"newswav.com",n:"Newswav"},newyorker:{d:"newyorker.com",n:"New Yorker"},newzmz:{d:"newzmz.com",n:"NEW 字幕组"},nextapple:{d:"tw.nextapple.com",n:"壹蘋新聞網"},nextjs:{d:"nextjs.org",n:"Next.js"},nga:{d:"bbs.nga.cn",n:"NGA"},ngocn2:{d:"ngocn2.org",n:"NGOCN"},nhentai:{d:"nhentai.net",n:"nhentai"},nhk:{d:"www3.nhk.or.jp",n:"NHK"},niaogebiji:{d:"niaogebiji.com",n:"鸟哥笔记"},nicovideo:{d:"www.nicovideo.jp",n:"Niconico"},nielsberglund:{d:"nielsberglund.com",n:"Niels Berglund Blog"},nifd:{d:"www.nifd.cn",n:"国家金融与发展实验室"},nikkei:{d:"nikkei.com",n:"The Nikkei 日本経済新聞"},nintendo:{d:"nintendo.com",n:"Nintendo"},nio:{d:"nio.com",n:"NIO"},nippon:{d:"www.nippon.com",n:"走进日本"},njglyy:{d:"njglyy.com",n:"南京鼓楼医院"},njit:{d:"jwc.njit.edu.cn",n:"南京工程学院"},njnu:{d:"ceai.njnu.edu.cn",n:"南京师范大学"},nju:{d:"admission.nju.edu.cn",n:"南京大学"},njucm:{d:"lib.njucm.edu.cn",n:"南京中医药大学"},njuferret:{d:"njuferret.github.io",n:"njuferret"},njupt:{d:"jwc.njupt.edu.cn",n:"南京邮电大学"},njust:{d:"jwc.njust.edu.cn",n:"南京理工大学"},njxzc:{d:"lib.njxzc.edu.cn",n:"南京晓庄学院"},nlc:{d:"read.nlc.cn",n:"中国国家图书馆"},nltimes:{d:"nltimes.nl",n:"NL Times"},nmc:{d:"nmc.cn",n:"中央气象台"},nmtv:{d:"nmtv.cn",n:"内蒙古广播电视台"},nodejs:{d:"nodejs.org",n:"Node.js"},nogizaka46:{d:"news.nogizaka46.com",n:"Sakamichi Series 坂道系列官网资讯"},nosec:{d:"nosec.org",n:"NOSEC 安全讯息平台"},notateslaapp:{d:"notateslaapp.com",n:"Not a Tesla App"},notefolio:{d:"notefolio.net",n:"Notefolio"},notion:{d:"notion.so",n:"Notion"},now:{d:"news.now.com",n:"Now 新聞"},nowcoder:{d:"nowcoder.com",n:"牛客网"},npm:{d:"npmjs.com",n:"NPM"},npr:{d:"npr.org",n:"NPR (National Public Radio)"},ntdm:{d:"www.ntdm9.com",n:"NT动漫"},ntdtv:{d:"www.ntdtv.com",n:"新唐人电视台"},ntrblog:{d:"ntrblog.com",n:"NTR BLOG(寝取られブログ)"},nua:{d:"index.nua.edu.cn",n:"Nanjing University of the Arts 南京艺术学院"},nuaa:{d:"aao.nuaa.edu.cn",n:"南京航空航天大学"},nudt:{d:"www.nudt.edu.cn",n:"中国人民解放军国防科技大学"},nuist:{d:"bulletin.nuist.edu.cn",n:"南京信息工程大学"},nwafu:{d:"nwafu.edu.cn",n:"西北农林科技大学"},nwnu:{d:"www.nwnu.edu.cn",n:"西北师范大学"},nyaa:{d:"nyaa.si",n:"Nyaa"},nyc:{d:"nyc.gov",n:"New York City Government"},nycu:{d:"nycu.edu.tw",n:"National Yang Ming Chiao Tung University"},nymity:{d:"censorbib.nymity.ch",n:"nymity"},nytimes:{d:"nytimes.com",n:"The New York Times"},obsidian:{d:"obsidian.md",n:"Obsidian"},oceanengine:{d:"trendinsight.oceanengine.com",n:"巨量算数 - 算数指数"},oct0pu5:{d:"Oct0pu5.cn",n:"Oct0pu5 blog"},odaily:{d:"odaily.news",n:"Odaily 星球日报"},oeeee:{d:"oeeee.com",n:"南方都市报"},oesw:{d:"oesw.at",n:"ÖSW"},oevw:{d:"oevw.at",n:"ÖVW"},oilchem:{d:"oilchem.net",n:"隆众资讯"},okx:{d:"www.okx.com",n:"欧易 OKX"},olevod:{d:"olevod.one",n:"欧乐影院"},ollama:{d:"ollama.com",n:"Ollama"},oncc:{d:"hk.on.cc",n:"东网"},onehu:{d:"onehu.xyz",n:"我不是盐神"},onet:{d:"wiadomosci.onet.pl",n:"Onet"},"oo-software":{d:"oo-software.com",n:"O&O Software"},openai:{d:"openai.com",n:"OpenAI"},openalex:{d:"openalex.org",n:"OpenAlex"},openrice:{d:"www.openrice.com",n:"Openrice開飯喇"},openwrt:{d:"openwrt.org",n:"OpenWrt"},orcid:{d:"orcid.org",n:"ORCID"},oreno3d:{d:"oreno3d.com",n:"俺の 3D エロ動画 (oreno3d)"},ornl:{d:"ornl.gov",n:"Oak Ridge National Laboratory"},oschina:{d:"oschina.net",n:"开源中国"},oshwhub:{d:"oshwhub.com",n:"oshwhub 立创开源硬件平台"},osu:{d:"osu.ppy.sh",n:"osu!"},otobanana:{d:"otobanana.com",n:"OTOBANANA"},ouc:{d:"it.ouc.edu.cn",n:"中国海洋大学"},oup:{d:"academic.oup.com",n:"Oxford University Press"},outagereport:{d:"outage.report",n:"Outage.Report"},"p-articles":{d:"p-articles.com",n:"虚词"},pacilution:{d:"www.pacilution.com",n:"普世社会科学研究所"},panewslab:{d:"panewslab.com",n:"PANews"},papers:{d:"papers.cool",n:"Cool Papers"},paradigm:{d:"paradigm.xyz",n:"Paradigm"},parliament:{d:"parliament.go.th",n:"Thailand Parliament"},"parliament.uk":{d:"parliament.uk",n:"UK Parliament"},patagonia:{d:"patagonia.com",n:"Patagonia"},patreon:{d:"www.patreon.com",n:"Patreon"},paulgraham:{d:"paulgraham.com",n:"Paul Graham"},pconline:{d:"pconline.com.cn",n:"太平洋科技"},pencilnews:{d:"www.pencilnews.cn",n:"铅笔道"},"penguin-random-house":{d:"penguinrandomhouse.com",n:"Penguin Random House"},people:{d:"people.com.cn",n:"人民网"},peopo:{d:"peopo.org",n:"PeoPo 公民新聞"},perplexity:{d:"www.perplexity.ai",n:"Perplexity"},peterwunder:{d:"projects.peterwunder.de",n:"Peter Wunder"},phoronix:{d:"phoronix.com",n:"Phoronix"},pianyivps:{d:"pianyivps.com",n:"便宜VPS网"},pianyuan:{d:"pianyuan.org",n:"片源网"},picnob:{d:"www.instagram.com",n:"Instagram"},"picnob.info":{d:"www.instagram.com",n:"Instagram"},pikabu:{d:"pikabu.ru",n:"Pikabu"},pincong:{d:"pincong.rocks",n:"品葱"},pingwest:{d:"pingwest.com",n:"品玩"},pinterest:{d:"www.pinterest.com",n:"Pinterest"},pixabay:{d:"pixabay.com",n:"Pixabay"},pixelstech:{d:"pixelstech.net",n:"PixelsTech"},pixiv:{d:"www.pixiv.net",n:"pixiv"},pixivision:{d:"www.pixivision.net",n:"pixivision"},piyao:{d:"piyao.org.cn",n:"中国互联网联合辟谣平台"},pkmer:{d:"pkmer.cn",n:"PKMer"},pku:{d:"admission.pku.edu.cn",n:"北京大学"},playno1:{d:"stno1.playno1.com",n:"PLAYNO.1 玩樂達人"},playpcesor:{d:"playpcesor.com",n:"电脑玩物"},plurk:{d:"plurk.com",n:"Plurk"},pnas:{d:"pnas.org",n:"Proceedings of The National Academy of Sciences"},podwise:{d:"podwise.ai",n:"Podwise"},polymarket:{d:"polymarket.com",n:"Polymarket"},pornhub:{d:"pornhub.com",n:"PornHub"},postman:{d:"postman.com",n:"Postman"},"priconne-redive":{d:"priconne-redive.jp",n:"PRINCESS CONNECT! Re Dive プリンセスコネクト!Re Dive"},producereport:{d:"producereport.com",n:"Produce Report"},producthunt:{d:"www.producthunt.com",n:"Product Hunt"},projectjav:{d:"projectjav.com",n:"ProjectJAV"},ps:{d:"www.playstation.com",n:"PlayStation Store"},psnine:{d:"psnine.com",n:"PSN 中文站"},psyche:{d:"psyche.co",n:"Psyche"},pts:{d:"news.pts.org.tw",n:"公視新聞網"},publico:{d:"publico.es",n:"Público"},pubmed:{d:"pubmed.ncbi.nlm.nih.gov",n:"PubMed"},pubscholar:{d:"pubscholar.cn",n:"PubScholar 公益学术平台"},pumc:{d:"mdadmission.pumc.edu.cn",n:"北京协和医学院"},putty:{d:"www.chiark.greenend.org.uk",n:"PuTTY"},pwc:{d:"strategyand.pwc.com",n:"PwC Strategy&"},python:{d:"python.org",n:"Python"},qbitai:{d:"qbitai.com",n:"量子位"},qbittorrent:{d:"qbittorrent.org",n:"qBittorrent"},qdu:{d:"jwc.qdu.edu.cn",n:"青岛大学"},qianp:{d:"qianp.com",n:"千篇网"},qianzhan:{d:"qianzhan.com",n:"前瞻网"},qiche365:{d:"qiche365.org.cn",n:"汽车召回网"},qidian:{d:"qidian.com",n:"起点"},qingting:{d:"qingting.fm",n:"蜻蜓 FM"},qipamaijia:{d:"qipamaijia.com",n:"奇葩买家秀"},qiyoujiage:{d:"qiyoujiage.com",n:"汽油价格网"},qlu:{d:"qlu.edu.cn",n:"齐鲁工业大学"},qm120:{d:"qm120.com",n:"全民健康网"},"qoo-app":{d:"apps.qoo-app.com",n:"QooApp"},qq:{d:"qq.com",n:"腾讯网"},qq88:{d:"qq88.info",n:"秋爸日字"},qqorw:{d:"qqorw.cn",n:"早报网"},qstheory:{d:"www.qstheory.cn",n:"求是网"},quantamagazine:{d:"quantamagazine.org",n:"Quanta Magazine"},questmobile:{d:"questmobile.com.cn",n:"QuestMobile"},questn:{d:"app.questn.com",n:"QuestN"},quicker:{d:"getquicker.net",n:"Quicker"},qust:{d:"jw.qust.edu.cn",n:"青岛科技大学"},qweather:{d:"qweather.com",n:"和风天气"},qwen:{d:"qwen.ai",n:"Qwen Research"},qztc:{d:"www.qztc.edu.cn",n:"泉州师范学院"},radio:{d:"radio.cn",n:"云听"},"radio-canada":{d:"ici.radio-canada.ca",n:"Radio-Canada.ca"},railway:{d:"railway.com",n:"Railway"},rarehistoricalphotos:{d:"rarehistoricalphotos.com",n:"Rare Historical Photos"},raspberrypi:{d:"raspberrypi.com",n:"Raspberry Pi"},rattibha:{d:"rattibha.com",n:"Rattibha"},rawkuma:{d:"rawkuma.com",n:"Rawkuma"},raycast:{d:"raycast.com",n:"Raycast"},react:{d:"react.dev",n:"React"},reactiflux:{d:"reactiflux.com",n:"Reactiflux"},reactnewsletter:{d:"bytes.dev",n:"ui.dev"},readhub:{d:"readhub.cn",n:"Readhub"},readsomethingwonderful:{d:"readsomethingwonderful.com",n:"Read Something Wonderful"},readwise:{d:"readwise.io",n:"Readwise"},rebase:{d:"rebase.network",n:"Rebase Network"},remnote:{d:"remnote.com",n:"RemNote"},researchgate:{d:"researchgate.net",n:"ResearchGate"},resetera:{d:"resetera.com",n:"ResetEra"},resonac:{d:"www.resonac.com",n:"Resonac"},reuters:{d:"reuters.com",n:"Reuters"},rfa:{d:"rfa.org",n:"Radio Free Asia (RFA) 自由亚洲电台"},rfi:{d:"rfi.fr",n:"Radio France Internationale"},right:{d:"right.com.cn",n:"恩山无线论坛"},rockthejvm:{d:"rockthejvm.com",n:"Rock the JVM"},rodong:{d:"rodong.rep.kp",n:"Rodong Sinmun 劳动新闻"},routledge:{d:"routledge.com",n:"Routledge"},rsc:{d:"pubs.rsc.org",n:"Royal Society of Chemistry"},rss3:{d:"rss3.io",n:"RSS3"},rsshub:{d:"docs.rsshub.app",n:"RSSHub"},ruancan:{d:"ruancan.com",n:"软餐"},ruankao:{d:"www.ruankao.org.cn",n:"中国计算机职业技术资格考试"},ruc:{d:"ruc.edu.cn",n:"Renmin University of China"},rule34video:{d:"rule34video.com",n:"Rule34Video"},runyeah:{d:"runyeah.world",n:"跑野大爆炸"},rustcc:{d:"rustcc.cn",n:"Rust 语言中文社区"},sakurazaka46:{d:"sakurazaka46.com",n:"Sakamichi Series 坂道系列官网资讯"},samd:{d:"www.samd.org.cn",n:"深圳市医疗器械行业协会"},samrdprc:{d:"www.samrdprc.org.cn",n:"国家市场监督管理总局缺陷产品管理中心"},samsung:{d:"research.samsung.com",n:"Samsung"},sankei:{d:"sankei.com",n:"Sankei Shimbun 産経新聞"},sara:{d:"www.sara.org.cn",n:"上海业余无线电协会"},saraba1st:{d:"stage1st.com",n:"Saraba1st"},sass:{d:"gs.sass.org.cn",n:"上海社会科学院"},scau:{d:"yzb.scau.edu.cn",n:"华南农业大学"},science:{d:"science.org",n:"Science Magazine"},sciencedirect:{d:"sciencedirect.com",n:"ScienceDirect"},sciencenet:{d:"blog.sciencenet.cn",n:"科学网"},scientificamerican:{d:"scientificamerican.com",n:"Scientific American"},scitechvista:{d:"scitechvista.nat.gov.tw",n:"科技大觀園"},scmp:{d:"scmp.com",n:"Corona Virus Disease 2019"},scnu:{d:"cs.scnu.edu.cn",n:"华南师范大学"},scoop:{d:"scoop.sh",n:"Scoop"},scpta:{d:"www.scpta.com.cn",n:"四川省人力资源和社会保障厅人事考试专栏"},sctv:{d:"sctv.com",n:"四川广播电视台"},scu:{d:"www.scu.edu.cn",n:"四川大学"},scut:{d:"jw.scut.edu.cn",n:"华南理工大学"},scvtc:{d:"scvtc.edu.cn",n:"四川职业技术学院"},sdmuseum:{d:"www.sdmuseum.com",n:"Shan Dong Museum"},sdo:{d:"sdo.com",n:"盛趣游戏在线"},sdu:{d:"www.sdu.edu.cn",n:"山东大学"},sdust:{d:"sdust.edu.cn",n:"山东科技大学"},sdzk:{d:"sdzk.cn",n:"山东省教育招生考试院"},"sec-in":{d:"sec-in.com",n:"SecIN 信息安全技术社区"},"sec-wiki":{d:"www.sec-wiki.com",n:"SecWiki - 安全维基"},secretsanfrancisco:{d:"secretsanfrancisco.com",n:"Secret San francisco"},secrss:{d:"secrss.com",n:"安全内参"},seekingalpha:{d:"seekingalpha.com",n:"Seeking Alpha"},sega:{d:"pjsekai.sega.jp",n:"SEGA"},segmentfault:{d:"segmentfault.com",n:"SegmentFault"},sehuatang:{d:"sehuatang.net",n:"色花堂"},semiconductors:{d:"semiconductors.org",n:"Semiconductor Industry Association"},sensortower:{d:"sensortower.com",n:"Sensor Tower"},setn:{d:"setn.com",n:"三立新聞網"},seu:{d:"cse.seu.edu.cn",n:"东南大学"},sfacg:{d:"book.sfacg.com",n:"SF 轻小说"},shanghaimuseum:{d:"www.shanghaimuseum.net",n:"Shanghai Museum"},shanximuseum:{d:"www.shanximuseum.com.cn",n:"Shanxi Museum"},shcstheatre:{d:"www.shcstheatre.com",n:"上海文化广场"},shiep:{d:"bwc.shiep.edu.cn",n:"上海电力大学"},shisu:{d:"shisu.edu.cn",n:"上海外国语大学"},shmeea:{d:"www.shmeea.edu.cn",n:"上海市教育考试院"},shmtu:{d:"jwc.shmtu.edu.cn",n:"上海海事大学"},shoac:{d:"shoac.com.cn",n:"上海东方艺术中心"},shopback:{d:"shopback.com.tw",n:"ShopBack"},shopify:{d:"shopify.com",n:"Shopify"},shoppingdesign:{d:"www.shoppingdesign.com.tw",n:"Shopping Design"},showstart:{d:"www.showstart.com",n:"秀动网"},shu:{d:"www.shu.edu.cn",n:"上海大学"},shuiguopai:{d:"shuiguopai.com",n:"水果派"},sicau:{d:"www.sicau.edu.cn",n:"四川农业大学"},sigsac:{d:"sigsac.org",n:"ACM Special Interest Group on Security Audit and Control"},simpleinfo:{d:"blog.simpleinfo.cc",n:"簡訊設計"},sina:{d:"finance.sina.com.cn",n:"新浪"},sinchew:{d:"sinchew.com.my",n:"星洲网"},sis001:{d:"sis001.com",n:"第一会所"},sjtu:{d:"www.sjtu.edu.cn",n:"上海交通大学"},skeb:{d:"skeb.jp",n:"Skeb"},skebetter:{d:"skebetter.com",n:"Skebetter"},sketis:{d:"sketis.net",n:"Sketis | Website of Dr. Makarius Wenzel"},skysports:{d:"skysports.com",n:"Sky Sports"},slashdot:{d:"slashdot.org",n:"Slashdot"},slowmist:{d:"slowmist.com",n:"慢雾科技"},smartlink:{d:"smartlink.bio",n:"SmartLink"},smashingmagazine:{d:"smashingmagazine.com",n:"Smashing Magazine"},smzdm:{d:"post.smzdm.com",n:"什么值得买"},snnu:{d:"snnu.edu.cn",n:"Shaanxi Normal University"},snowpeak:{d:"snowpeak.com",n:"Snow Peak"},sobooks:{d:"sobooks.net",n:"SoBooks"},sogou:{d:"www.sogou.com",n:"搜狗"},sohu:{d:"sohu.com",n:"搜狐号"},solidot:{d:"www.solidot.org",n:"Solidot"},sony:{d:"sony.com",n:"Sony"},sorrycc:{d:"sorrycc.com",n:"云谦的博客"},soundofhope:{d:"soundofhope.org",n:"希望之声"},soundon:{d:"player.soundon.fm",n:"SoundOn"},sourceforge:{d:"www.sourceforge.net",n:"SourceForge"},southcn:{d:"nfapp.southcn.com",n:"南方网"},soweather:{d:"wx.soweather.com",n:"SoWeather"},spankbang:{d:"spankbang.com",n:"SpankBang"},spglobal:{d:"www.spglobal.com",n:"S&P Global"},spotify:{d:"open.spotify.com",n:"Spotify"},springer:{d:"www.springer.com",n:"Springer"},sputniknews:{d:"sputniknews.cn",n:"Sputnik News 俄罗斯卫星通讯社"},sqmc:{d:"sqmc.edu.cn",n:"新乡医学院三全学院"},sse:{d:"bond.sse.com.cn",n:"上海证券交易所"},ssm:{d:"www.ssm.gov.mo",n:"澳门卫生局"},sspai:{d:"sspai.com",n:"少数派 sspai"},sspu:{d:"jwc.sspu.edu.cn",n:"上海第二工业大学"},stanford:{d:"hazyresearch.stanford.edu",n:"Stanford"},startuplatte:{d:"startuplatte.com",n:"創新拿鐵"},stbu:{d:"stbu.edu.cn",n:"四川工商学院"},stcn:{d:"stcn.com",n:"证券时报网"},stdaily:{d:"epaper.stdaily.com",n:"中国科技网"},steam:{d:"store.steampowered.com",n:"Steam"},stheadline:{d:"std.stheadline.com",n:"星島日報"},stockedge:{d:"web.stockedge.com",n:"Stock Edge"},storm:{d:"storm.mg",n:"風傳媒"},storyfm:{d:"storyfm.cn",n:"故事 FM"},straitstimes:{d:"straitstimes.com",n:"The Strait Times"},stratechery:{d:"blog.stratechery.com",n:"Stratechery by Ben Thompson"},"stream-capital":{d:"www.stream-capital.com",n:"远川研究所"},studygolang:{d:"studygolang.com",n:"Go 语言中文网"},subhd:{d:"subhd.tv",n:"Sub HD"},substack:{d:"substack.com",n:"Substack"},supchina:{d:"supchina.com",n:"SupChina"},supercell:{d:"supercell.com",n:"Supercell"},surfshark:{d:"surfshark.com",n:"Surfshark"},sustainabilitymag:{d:"sustainabilitymag.com",n:"Sustainability Magazine"},sustech:{d:"biddingoffice.sustech.edu.cn",n:"南方科技大学"},swissinfo:{d:"swissinfo.ch",n:"swissinfo"},swjtu:{d:"www.swjtu.edu.cn",n:"西南交通大学"},swpu:{d:"swpu.edu.cn",n:"西南石油大学"},sycl:{d:"sycl.tech",n:"SYCL"},syosetu:{d:"syosetu.com",n:"Syosetu"},sysu:{d:"cse.sysu.edu.cn",n:"中山大学"},szftedu:{d:"ylxx.szftedu.cn",n:"园岭小学"},szse:{d:"szse.cn",n:"深圳证券交易所"},szu:{d:"yz.szu.edu.cn",n:"深圳大学"},t66y:{d:"t66y.com",n:"草榴社区"},tableau:{d:"public.tableau.com",n:"Tableau"},tailwindcss:{d:"tailwindcss.com",n:"TailwindCSS"},taiwanmobile:{d:"www.taiwanmobile.com",n:"台灣大哥大"},taiwannews:{d:"taiwannews.com.tw",n:"Taiwan News"},tangshufang:{d:"tangshufang.com",n:"唐书房"},taobao:{d:"taobao.com",n:"淘宝网"},taoguba:{d:"tgb.cn",n:"淘股吧"},taptap:{d:"www.taptap.io",n:"TapTap"},tass:{d:"tass.com",n:"Russian News Agency TASS"},tctmd:{d:"www.tctmd.com",n:"TCTMD"},techcrunch:{d:"techcrunch.com",n:"TechCrunch"},techflowpost:{d:"techflowpost.com",n:"深潮 TechFlow"},techpowerup:{d:"www.techpowerup.com",n:"TechPowerUp"},techsir:{d:"techsir.com",n:"TechSir"},telecompaper:{d:"telecompaper.com",n:"Telecompaper"},telegram:{d:"t.me",n:"Telegram"},tencent:{d:"tencent.com",n:"腾讯"},tesla:{d:"tesla.cn",n:"特斯拉中国"},test:{n:"RSSHub Test"},"tfc-taiwan":{d:"tfc-taiwan.org.tw",n:"Taiwan FactCheck Center"},tgbus:{d:"tgbus.com",n:"电玩巴士 TGBUS"},the:{d:"river.to",n:"River.to (江河日下)"},theatlantic:{d:"www.theatlantic.com",n:"The Atlantic"},theblock:{d:"theblock.co",n:"TheBlock"},theblockbeats:{d:"www.theblockbeats.info",n:"律动 BlockBeats"},thebrain:{d:"thebrain.com",n:"TheBrain"},thecover:{d:"thecover.cn",n:"封面新闻"},thegadgetflow:{d:"thegadgetflow.com",n:"Gadget Flow"},thegradient:{d:"thegradient.pub",n:"The Gradient"},thehindu:{d:"thehindu.com",n:"The Hindu"},theinitium:{d:"theinitium.com",n:"The Initium"},themoviedb:{d:"themoviedb.org",n:"The Movie Database"},thenewslens:{d:"thenewslens.com",n:"The News Lens 關鍵評論"},thepaper:{d:"thepaper.cn",n:"澎湃新闻"},thepetcity:{d:"thepetcity.co",n:"PetCity 毛孩日常"},theverge:{d:"theverge.com",n:"The Verge"},thewirehindi:{d:"thewirehindi.com",n:"The Wire Hindi"},thinkingmachines:{d:"thinkingmachines.ai",n:"Thinking Machines Lab"},thoughtco:{d:"thoughtco.com",n:"ThoughtCo"},thoughtworks:{d:"www.thoughtworks.com",n:"ThoughtWorks"},threads:{d:"threads.net",n:"Threads"},thwiki:{d:"thwiki.cc",n:"THBWiki"},thzt:{d:"thzt.github.io",n:"thzt"},tidb:{d:"tidb.net",n:"TiDB 社区"},tiddlywiki:{d:"tiddlywiki.com",n:"TiddlyWiki"},tiktok:{d:"tiktok.com",n:"TikTok"},timednews:{d:"timednews.com",n:"时刻新闻"},tingshuitz:{d:"swj.dl.gov.cn",n:"停水通知"},tingtingfm:{d:"mobile.tingtingfm.com",n:"听听 FM"},tisi:{d:"tisi.org",n:"腾讯研究院"},tju:{d:"cic.tju.edu.cn",n:"Tianjin University 天津大学"},tkww:{d:"www.tkww.hk",n:"大公文匯網"},tmtpost:{d:"tmtpost.com",n:"钛媒体"},tokeninsight:{d:"tokeninsight.com",n:"TokenInsight"},tongji:{d:"bksy.tongji.edu.cn",n:"同济大学"},tongli:{d:"tongli.com.tw",n:"東立出版社"},toodaylab:{d:"toodaylab.com",n:"理想生活实验室"},tophub:{d:"tophub.today",n:"今日热榜"},topys:{d:"topys.cn",n:"TOPYS"},toranoana:{d:"toranoana.jp",n:"とらのあな"},toutiao:{d:"www.toutiao.com",n:"今日头条"},towardsdatascience:{d:"towardsdatascience.com",n:"Towards Data Science"},tqyb:{d:"www.tqyb.com.cn",n:"广东天气"},tradingview:{d:"tradingview.com",n:"TradingView"},transcriptforest:{d:"www.transcriptforest.com",n:"Transcript Forest"},"transformer-circuits":{d:"transformer-circuits.pub",n:"Transformer Circuits"},trendforce:{d:"trendforce.com",n:"TrendForce"},trendingpapers:{d:"trendingpapers.com",n:"Trending Papers"},tribalfootball:{d:"tribalfootball.com",n:"Tribal Football"},trow:{d:"trow.cc",n:"The Ring of Wonder"},tsdm39:{d:"www.tsdm39.com",n:"天使动漫论坛"},tsinghua:{d:"tsinghua.edu.cn",n:"清华大学"},ttv:{d:"news.ttv.com.tw",n:"台視新聞網"},tumblr:{d:"tumblr.com",n:"Tumblr"},tvb:{d:"tvb.com",n:"无线新闻"},tver:{d:"tver.jp",n:"TVer"},tvtropes:{d:"tvtropes.org",n:"TV Tropes"},"tw-nongmu":{d:"www.tw-nongmu.com",n:"通威农业发展"},twitch:{d:"www.twitch.tv",n:"Twitch"},twitter:{d:"x.com",n:"X (Twitter)"},twreporter:{d:"twreporter.org",n:"報導者"},txks:{d:"www.txks.org.cn",n:"全国通信专业技术人员职业水平考试"},txrjy:{d:"txrjy.com",n:"通信人家园"},tynu:{d:"tynu.edu.cn",n:"太原师范学院"},typeless:{d:"typeless.com",n:"Typeless"},typora:{d:"typora.io",n:"Typora"},typst:{d:"typst.com",n:"Typst"},u3c3:{d:"u3c3.com",n:"U3C3"},u9a9:{d:"u9a9.com",n:"U9A9"},uber:{d:"www.uber.com",n:"Uber"},ucas:{d:"ai.ucas.ac.cn",n:"中国科学院大学"},uchicago:{d:"journals.uchicago.edu",n:"The University of Chicago Press: Journals"},udn:{d:"udn.com",n:"聯合新聞網"},uestc:{d:"www.uestc.edu.cn",n:"电子科技大学"},uibe:{d:"hr.uibe.edu.cn",n:"对外经济贸易大学"},ulapia:{d:"www.ulapia.com",n:"乌拉邦"},unipd:{d:"unipd.it",n:"Università di Padova"},uniqlo:{d:"www.uniqlo.com",n:"Uniqlo"},unraid:{d:"unraid.net",n:"Unraid"},unusualwhales:{d:"unusualwhales.com",n:"Unusual Whales"},upc:{d:"computer.upc.edu.cn",n:"中国石油大学(华东)"},ups:{d:"ups.com",n:"UPS"},uptimerobot:{d:"rss.uptimerobot.com",n:"Uptime Robot"},"uraaka-joshi":{d:"uraaka-joshi.com",n:"裏垢女子まとめ"},urbandictionary:{d:"urbandictionary.com",n:"Urban Dictionary"},usenix:{d:"usenix.org",n:"USENIX"},usepanda:{d:"usepanda.com",n:"Panda"},ustb:{d:"gs.ustb.edu.cn",n:"北京科技大学"},ustc:{d:"ustc.edu.cn",n:"中国科学技术大学"},usts:{d:"jwch.usts.edu.cn",n:"苏州科技大学"},utgd:{d:"utgd.net",n:"UNTAG"},uw:{d:"gixnetwork.org",n:"University of Washington"},v1tx:{d:"v1tx.com",n:"v1tx"},v2ex:{d:"v2ex.com",n:"V2EX"},v2rayshare:{d:"v2rayshare.com",n:"V2rayShare"},"vcb-s":{d:"vcb-s.com",n:"VCB-Studio"},verfghbw:{d:"verfgh.baden-wuerttemberg.de",n:"Constitutional Court of Baden-Württemberg (Germany)"},vertikal:{d:"vertikal.net",n:"Vertikal.net"},vice:{d:"vice.com",n:"VICE"},vimeo:{d:"vimeo.com",n:"Vimeo"},visionias:{d:"visionias.in",n:"VisionIAS"},visualstudio:{d:"visualstudio.com",n:"Visual Studio"},vocus:{d:"vocus.cc",n:"方格子"},vom:{d:"vom.mn",n:"Voice of Mongolia"},voronoiapp:{d:"voronoiapp.com",n:"Voronoi"},wabei:{d:"www.wabei.cn",n:"挖贝网"},wainao:{d:"wainao.me",n:"歪脑"},wallhaven:{d:"wallhaven.cc",n:"wallhaven"},wallpaperhub:{d:"wallpaperhub.app",n:"WallpaperHub"},wallstreetcn:{d:"wallstreetcn.com",n:"华尔街见闻"},wanqu:{d:"wanqu.co",n:"湾区日报"},"warhammer-community":{d:"www.warhammer-community.com",n:"Warhammer Community"},warp:{d:"warp.dev",n:"Warp"},warthunder:{d:"warthunder.com",n:"War Thunder"},washingtonpost:{d:"www.washingtonpost.com",n:"The Washington Post"},"wbv-gpa":{d:"wbv-gpa.at",n:"WBV-GPA"},wchscu:{d:"www.wchscu.cn",n:"华西医院"},wdc:{d:"support.wdc.com",n:"Western Digital"},wdfxw:{d:"wdfxw.net",n:"WDFXW文档分享网"},web:{d:"web.dev",n:"web.dev"},web3caff:{d:"web3caff.com",n:"Web3Caff"},webcatalog:{d:"desktop.webcatalog.io",n:"WebCatalog"},wechat:{d:"posts.careerengine.us",n:"微信小程序"},weekendhk:{d:"weekendhk.com",n:"新假期周刊"},weibo:{d:"weibo.com",n:"微博"},wellcee:{d:"wellcee.com",n:"Wellcee 唯心所寓"},wenku8:{d:"www.wenku8.net",n:"轻小说文库"},wfdf:{d:"wfdf.sport",n:"WFDF"},wfu:{d:"jwc.wfu.edu.cn",n:"潍坊学院"},whitehouse:{d:"whitehouse.gov",n:"The White House"},who:{d:"who.int",n:"World Health Organization | WHO"},whu:{d:"cs.whu.edu.cn",n:"武汉大学"},wiensued:{d:"wiensued.at",n:"Wien-Süd"},wikinews:{d:"zh.wikinews.org",n:"维基新闻"},wikipedia:{d:"en.wikipedia.org",n:"Wikipedia"},windsurf:{d:"windsurf.com",n:"Windsurf"},winstall:{d:"winstall.app",n:"winstall"},wired:{d:"www.wired.com",n:"WIRED"},wise:{d:"wise.com",n:"Wise"},withgoogle:{d:"pair.withgoogle.com",n:"People + AI Research (PAIR)"},wizfile:{d:"antibody-software.com",n:"WziFile"},wkjyqh:{d:"www.wkjyqh.com",n:"五矿期货"},"wmc-bj":{d:"wmc-bj.net",n:"World Meteorological Centre Beijing"},wmpvp:{d:"wmpvp.com",n:"完美世界电竞"},wnacg:{d:"wnacg.org",n:"紳士漫畫"},wogem:{d:"wogem.at",n:"WOGEM"},wohnnet:{d:"wohnnet.at",n:"wohnnet.at"},wordpress:{d:"wordpress.org",n:"WordPress"},worldjournal:{d:"worldjournal.com",n:"世界新聞網"},worldofwarships:{d:"worldofwarships.com",n:"World of Warships"},woshipm:{d:"woshipm.com",n:"人人都是产品经理"},wsj:{d:"cn.wsj.com",n:"The Wall Street Journal (WSJ) 华尔街日报"},wsyu:{d:"www.wsyu.edu.cn",n:"武昌首义学院"},wtu:{d:"wtu.91wllm.com",n:"武汉纺织大学"},wufazhuce:{d:"wufazhuce.com",n:"「ONE · 一个」"},wyzxwk:{d:"wyzxwk.com",n:"乌有之乡"},wzu:{d:"wzu.edu.cn",n:"温州大学"},"x-mol":{d:"x-mol.com",n:"X-MOL"},x6d:{d:"xd.x6d.com",n:"小刀娱乐网"},xaufe:{d:"jiaowu.xaufe.edu.cn",n:"西安财经大学"},xaut:{d:"www.xaut.edu.cn",n:"西安理工大学"},xbmu:{d:"www.xbmu.edu.cn",n:"西北民族大学"},xbookcn:{d:"www.xbookcn.net",n:"中文成人文學網"},xboxfan:{d:"xboxfan.com",n:"盒心光环"},xhamster:{d:"xhamster.com",n:"xHamster"},xianbao:{d:"new.xianbao.fun",n:"线报酷"},xiaoheihe:{d:"xiaoheihe.cn",n:"小黑盒"},xiaohongshu:{d:"xiaohongshu.com",n:"小红书"},xiaomiyoupin:{d:"xiaomiyoupin.com",n:"小米有品"},xiaote:{d:"xiaote.com",n:"小特社区"},xiaoyuzhou:{d:"xiaoyuzhoufm.com",n:"小宇宙"},xiaozhuanlan:{d:"xiaozhuanlan.com",n:"小专栏"},xidian:{d:"www.xidian.edu.cn",n:"西安电子科技大学"},ximalaya:{d:"ximalaya.com",n:"喜马拉雅"},xinpianchang:{d:"xinpianchang.com",n:"新片场"},xjtlu:{d:"www.xjtlu.edu.cn",n:"Xi"},xjtu:{d:"2yuan.xjtu.edu.cn",n:"西安交通大学"},xkb:{d:"xkb.com.cn",n:"新快报"},xmanhua:{d:"xmanhua.com",n:"X 漫画"},xmnn:{d:"epaper.xmnn.cn",n:"厦门网"},xmu:{d:"soe.xmu.edu.cn",n:"Xiamen University"},xmut:{d:"jwc.xmut.edu.cn",n:"厦门理工大学"},xsijishe:{d:"xsijishe.com",n:"司机社"},xueqiu:{d:"danjuanapp.com",n:"雪球"},xunhupay:{d:"www.xunhupay.com",n:"虎皮椒"},xupt:{d:"xupt.edu.cn",n:"西安邮电大学"},xwenming:{d:"xwenming.com",n:"未知文明"},xys:{d:"xys.org",n:"新语丝"},xyu:{d:"xyc.edu.cn",n:"新余学院"},xyzrank:{d:"xyzrank.com",n:"中文播客榜"},yahoo:{d:"news.yahoo.com",n:"Yahoo"},yamap:{d:"yamap.com",n:"YAMAP"},yamibo:{d:"yamibo.com",n:"百合会"},yande:{d:"yande.re",n:"yande.re"},yangtzeu:{d:"yangtzeu.edu.cn",n:"长江大学"},ycwb:{d:"xwlb.com.cn",n:"羊城晚报金羊网"},yenpress:{d:"yenpress.com",n:"Yen Press"},ygkkk:{d:"ygkkk.blogspot.com",n:"甬哥侃侃侃YouTube教程摘要随笔"},yicai:{d:"yicai.com",n:"第一财经"},yilinzazhi:{d:"www.yilinzazhi.com",n:"意林杂志"},ymgal:{d:"ymgal.games",n:"月幕 Galgame"},yna:{d:"yna.co.kr",n:"Yonhap News Agency"},ynet:{d:"ynet.com",n:"北青网"},"yoasobi-music":{d:"www.yoasobi-music.jp",n:"Yoasobi Official"},yomiuri:{d:"www.yomiuri.co.jp",n:"Yomiuri Shimbun 読売新聞"},yomujp:{d:"yomujp.com",n:"日本語多読道場"},youku:{d:"i.youku.com",n:"优酷"},youmemark:{d:"youmemark.com",n:"YouMeMark"},youtube:{d:"youtube.com",n:"YouTube"},youzhiyouxing:{d:"youzhiyouxing.cn",n:"有知有行"},yuanliao:{d:"yuanliao.info",n:"猿料"},yuque:{d:"yuque.com",n:"语雀"},yxdown:{d:"yxdown.com",n:"游讯网"},yxdzqb:{d:"yxdzqb.com",n:"游戏打折情报"},yxrb:{d:"news.yxrb.net",n:"游戏日报"},yyets:{d:"yysub.net",n:"人人影视"},yystv:{d:"yystv.cn",n:"游研社"},zagg:{d:"zagg.com",n:"Zagg"},zaimanhua:{d:"manhua.zaimanhua.com",n:"再漫画"},zaker:{d:"myzaker.com",n:"ZAKER"},zaobao:{d:"www.zaobao.com",n:"联合早报"},zaozao:{d:"www.zaozao.run",n:"前端早早聊"},zcmu:{d:"jwc.zcmu.edu.cn",n:"浙江中医药大学"},zcool:{d:"www.zcool.com.cn",n:"站酷"},zed:{d:"zed.dev",n:"Zed"},zhibo8:{d:"zhibo8.cc",n:"直播吧"},zhihu:{d:"www.zhihu.com",n:"知乎"},zhitongcaijing:{d:"zhitongcaijing.com",n:"智通财经网"},zhiy:{d:"zhiy.cc",n:"知园"},zhizhuan100:{d:"www.zhizhuan100.com.cn",n:"智篆商业"},zhonglun:{d:"zhonglun.com",n:"中伦律师事务所"},zhubai:{d:"zhubai.love",n:"竹白"},zhujiceping:{d:"zhujiceping.com",n:"国外主机测评"},zhuwang:{d:"zhujia.zhuwang.cc",n:"中国养猪网"},zimuxia:{d:"zimuxia.cn",n:"FIX 字幕侠"},zjgtjy:{d:"zjgtjy.cn",n:"浙江省土地使用权网上交易系统"},zjol:{d:"zjol.com.cn",n:"浙江在线"},zju:{d:"physics.zju.edu.cn",n:"浙江大学"},zjut:{d:"www.zjut.edu.cn",n:"浙江工业大学"},zjuvag:{d:"zjuvag.org",n:"浙江大学可视分析小组"},zodgame:{d:"zodgame.xyz",n:"ZodGame"},zongheng:{d:"www.zongheng.com",n:"纵横中文网"},zotero:{d:"zotero.org",n:"Zotero"},zrblog:{d:"zrblog.net",n:"赵容部落"},zsxq:{d:"zsxq.com",n:"知识星球"},zuel:{d:"wap.zuel.edu.cn",n:"中南财经政法大学"},zuvio:{d:"irs.zuvio.com.tw",n:"Zuvio"},zxcs:{d:"zxcs.click",n:"知轩藏书"},zyshow:{d:"zyshow.net",n:"综艺秀"},zyw:{d:"hot.zyw.asia",n:"zyw"},zzu:{d:"www.zzu.edu.cn",n:"郑州大学"}},tN={xhs:"xiaohongshu"};function _F(e){const t=e.startsWith("rsshub:")?e.slice(7).split("/")[0].toLowerCase():e.split("-")[0].toLowerCase();return tN[t]??t}function nN(e,t){return t?tN[t]??t:_F(e)}function OF(e,t){var r;const n=(r=Ex[nN(e,t)])==null?void 0:r.d;return n?`https://icons.folo.is/${n}`:void 0}function rN(e,t){var r;const n=(r=Ex[nN(e,t)])==null?void 0:r.d;return n?`${ut.baseUrl}/api/media/image?site=${encodeURIComponent(`https://${n}`)}`:void 0}function Rx({id:e,name:t,facilityKey:n,className:r}){const i=OF(e,n),o=rN(e,n),[c,d]=p.useState("primary"),h=c==="primary"?i:c==="fallback"?o:void 0;if(p.useEffect(()=>{d("primary")},[e,n]),h)return l.jsx("img",{src:h,alt:"",loading:"lazy",onError:()=>d(c==="primary"&&o?"fallback":"letter"),className:Y("size-full object-cover",r)});const m=(t||e).replace(/^rsshub:/,"").trim().charAt(0).toUpperCase()||"?";return l.jsx("span",{className:Y("flex size-full items-center justify-center bg-muted text-[13px] font-semibold text-muted-foreground",r),children:m})}function sN({source:e,status:t,meta:n,actions:r,onClick:i,htmlId:o,className:c,size:d="default",variant:h="outline",tooltip:m,muted:x=!1}){var v;const g=l.jsxs(l.Fragment,{children:[l.jsx(Jc,{variant:"icon",className:`overflow-hidden ${x?"opacity-40":""}`,children:l.jsx(Rx,{id:e.id,name:e.title,facilityKey:(v=e.facility)==null?void 0:v.key})}),l.jsxs(zs,{children:[l.jsxs(fa,{className:`flex items-center gap-2 ${x?"text-muted-foreground":""}`,children:[l.jsx("span",{className:"truncate font-extrabold",children:e.title}),t,e.pluginName?l.jsx(Bt,{variant:"secondary",size:"sm",className:"shrink-0",children:e.pluginName}):null]}),e.description&&e.description!==e.title?l.jsx(no,{className:"line-clamp-1",children:e.description}):null]}),n?l.jsx(jx,{children:n}):null,r?l.jsx(Bk,{children:r}):null]});return i?l.jsx(Tr,{asChild:!0,variant:h,size:d,title:m,id:o,className:`cursor-pointer transition-colors ${c??""}`,children:l.jsx("button",{type:"button",onClick:i,className:"w-full",children:g})}):l.jsx(Tr,{variant:x?"muted":h,size:d,title:m,id:o,className:c,children:g})}const zF=Bg,PF=Ug,aN=p.forwardRef(({className:e,align:t="start",sideOffset:n=6,...r},i)=>l.jsx(Vg,{children:l.jsx(kf,{ref:i,"data-slot":"hover-card-content",align:t,sideOffset:n,className:Y("z-50 w-72 rounded-[12px] border border-[var(--acr-border-soft)] bg-[var(--acr-surface)] p-3 text-foreground backdrop-blur-xl shadow-[0_8px_28px_rgba(0,0,0,0.18)] outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",e),...r})}));aN.displayName=kf.displayName;const iN={drift:"源结构变化",auth:"登录失效",timeout:"超时",network:"网络错误",blocked:"被拦截/限流",empty:"持续无内容",unknown:"未知错误"};function oN(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function LF(e,t,n){return[t?`来源: ${t}`:null,`状态: ${n}`,`类别: ${iN[e.category]} (${e.category})`,`时间: ${oN(e.at)}`,`错误: ${e.message}`].filter(Boolean).join(`
|
|
399
|
+
`)}function IF({colorClass:e,label:t}){return l.jsx("span",{title:t,className:`inline-block size-2 shrink-0 rounded-full ${e}`})}function $F({error:e,sourceLabel:t,stateLabel:n,children:r}){if(!e)return l.jsx(l.Fragment,{children:r});const i=async()=>{try{await navigator.clipboard.writeText(LF(e,t,n)),Ge.success("已复制错误信息")}catch{Ge.error("复制失败")}};return l.jsxs(zF,{openDelay:120,closeDelay:80,children:[l.jsx(PF,{asChild:!0,children:l.jsx("div",{className:"w-full cursor-help",children:r})}),l.jsx(aN,{children:l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("span",{className:"text-[12px] font-medium",children:[iN[e.category],l.jsxs("span",{className:"ml-1 text-muted-foreground",children:["· ",n]})]}),l.jsxs("button",{type:"button",onClick:i,title:"复制错误信息",className:"inline-flex items-center gap-1 rounded-[6px] px-1.5 py-0.5 text-[11px] text-muted-foreground transition-colors hover:bg-[var(--acr-border-soft)] hover:text-foreground",children:[l.jsx(j1,{className:"size-3"}),"复制"]})]}),l.jsx("p",{className:"whitespace-pre-wrap break-words font-mono text-[11px] leading-relaxed text-foreground/90",children:e.message}),l.jsx("p",{className:"text-[10px] text-muted-foreground",children:oN(e.at)})]})})]})}const BF=e=>e.replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-+|-+$/g,"").toLowerCase();function lN(e,t){var r;const n={...t};for(const[i,o]of Object.entries(e))if(!n[i]&&o.default&&(n[i]=o.default),o.required&&!((r=n[i])!=null&&r.trim()))return{ok:!1,missing:i};return{ok:!0,params:n}}function UF(e){return Array.isArray(e.options)?e.options.filter(t=>typeof(t==null?void 0:t.value)=="string"&&t.value).map(t=>({value:t.value,label:t.label||t.value})):[]}function VF(e){return e.title||e.id.replace(/^rsshub:/,"")}function FF(e){var n;const t=(n=e.description)==null?void 0:n.replace(/\s+/g," ").trim();return t&&t!==VF(e)?t:e.id.replace(/^rsshub:/,"")}function HF(e){return`source-row-${e.id.replace(/[^a-zA-Z0-9]+/g,"-")}`}function qF(e){var t,n;return((n=(t=e.docs)==null?void 0:t.markdown)==null?void 0:n.trim())||""}function cN(e,t){const n=(t==null?void 0:t.headingBase)??2,r=e.replace(/\r\n/g,`
|
|
400
|
+
`).split(`
|
|
401
|
+
`),i=[];let o=[],c=null,d=null,h="",m=null,x=[];const g=()=>{o.length&&i.push({type:"paragraph",text:o.join(" ").trim()}),o=[]},v=()=>{c!=null&&c.items.length&&i.push({type:"list",ordered:c.ordered,items:c.items}),c=null},S=()=>{m&&i.push({type:"callout",tone:m.tone,text:m.lines.join(`
|
|
402
|
+
`).trim()}),m=null},b=()=>{x.length&&i.push({type:"table",rows:x}),x=[]},j=()=>{g(),v(),b()},C=E=>E.replace(/^\||\|$/g,"").split("|").map(R=>R.trim()),k=E=>/^\|.+\|$/.test(E),N=E=>/^\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?$/.test(E);for(const E of r){const R=E.trimEnd(),A=R.trim();if(d){A.startsWith("```")?(i.push({type:"code",lang:h,text:d.join(`
|
|
403
|
+
`)}),d=null,h=""):d.push(R);continue}if(A.startsWith("```")){j(),S(),d=[],h=A.replace(/^```/,"").trim();continue}if(A.startsWith(":::")){j(),m?S():m={tone:A.replace(/^:::\s*/,"").trim()||"tip",lines:[]};continue}if(m){m.lines.push(R);continue}if(!A){j();continue}const _=A.match(/^(#{1,4})\s+(.+)$/);if(_){j();const V=Math.min(Math.max(_[1].length+(n-1),n),4);i.push({type:"heading",level:V,text:_[2]});continue}const z=A.match(/^>\s?(.+)$/);if(z){j(),i.push({type:"blockquote",text:z[1]});continue}if(N(A)&&x.length)continue;if(k(A)){g(),v(),x.push(C(A));continue}x.length&&b();const D=A.match(/^([-*]|\d+\.)\s+(.+)$/);if(D){g();const V=/\d+\./.test(D[1]);c&&c.ordered!==V&&v(),c??(c={ordered:V,items:[]}),c.items.push(D[2]);continue}v(),o.push(A)}return j(),S(),i}function uN(e){var n,r;const t=((n=e.facility)==null?void 0:n.key)||(e.id.startsWith("rsshub:")?e.id.slice(7).split("/")[0]:"");return e.id.startsWith("rsshub:")&&t?`https://docs.rsshub.app/routes/${t}`:(r=e.docs)==null?void 0:r.url}function dN(e){var n;const t=(n=Ex[e])==null?void 0:n.d;if(!(!t||!/^[a-z0-9.-]+\.[a-z]{2,}$/i.test(t)))return`https://${t}`}function KF(e){return`https://docs.rsshub.app/routes/${e}`}const GF={timeline:"时间线",search:"搜索",audio:"音频"};function YF(e){return GF[e]??e}function WF(e){var t;return((t=e.sources[0])==null?void 0:t.source.id)||e.id}function XF({id:e,name:t,stream:n,className:r}){const i=e||(n?WF(n):"");return l.jsx(Rx,{id:i,name:t||(n==null?void 0:n.description)||i,className:r})}var fN=1,QF=.9,ZF=.8,JF=.17,Ax=.1,Mx=.999,e8=.9999,t8=.99,n8=/[\\\/_+.#"@\[\(\{&]/,r8=/[\\\/_+.#"@\[\(\{&]/g,s8=/[\s-]/,hN=/[\s-]/g;function Dx(e,t,n,r,i,o,c){if(o===t.length)return i===e.length?fN:t8;var d=`${i},${o}`;if(c[d]!==void 0)return c[d];for(var h=r.charAt(o),m=n.indexOf(h,i),x=0,g,v,S,b;m>=0;)g=Dx(e,t,n,r,m+1,o+1,c),g>x&&(m===i?g*=fN:n8.test(e.charAt(m-1))?(g*=ZF,S=e.slice(i,m-1).match(r8),S&&i>0&&(g*=Math.pow(Mx,S.length))):s8.test(e.charAt(m-1))?(g*=QF,b=e.slice(i,m-1).match(hN),b&&i>0&&(g*=Math.pow(Mx,b.length))):(g*=JF,i>0&&(g*=Math.pow(Mx,m-i))),e.charAt(m)!==t.charAt(o)&&(g*=e8)),(g<Ax&&n.charAt(m-1)===r.charAt(o+1)||r.charAt(o+1)===r.charAt(o)&&n.charAt(m-1)!==r.charAt(o))&&(v=Dx(e,t,n,r,m+1,o+2,c),v*Ax>g&&(g=v*Ax)),g>x&&(x=g),m=n.indexOf(h,m+1);return c[d]=x,x}function mN(e){return e.toLowerCase().replace(hN," ")}function a8(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Dx(e,t,mN(e),mN(t),0,0,{})}var nu='[cmdk-group=""]',_x='[cmdk-group-items=""]',i8='[cmdk-group-heading=""]',pN='[cmdk-item=""]',gN=`${pN}:not([aria-disabled="true"])`,Ox="cmdk-item-select",ol="data-value",o8=(e,t,n)=>a8(e,t,n),xN=p.createContext(void 0),ru=()=>p.useContext(xN),vN=p.createContext(void 0),zx=()=>p.useContext(vN),yN=p.createContext(void 0),bN=p.forwardRef((e,t)=>{let n=cl(()=>{var L,G;return{search:"",value:(G=(L=e.value)!=null?L:e.defaultValue)!=null?G:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=cl(()=>new Set),i=cl(()=>new Map),o=cl(()=>new Map),c=cl(()=>new Set),d=wN(e),{label:h,children:m,value:x,onValueChange:g,filter:v,shouldFilter:S,loop:b,disablePointerSelection:j=!1,vimBindings:C=!0,...k}=e,N=cn(),E=cn(),R=cn(),A=p.useRef(null),_=v8();ro(()=>{if(x!==void 0){let L=x.trim();n.current.value=L,z.emit()}},[x]),ro(()=>{_(6,H)},[]);let z=p.useMemo(()=>({subscribe:L=>(c.current.add(L),()=>c.current.delete(L)),snapshot:()=>n.current,setState:(L,G,J)=>{var $,se,oe,ie;if(!Object.is(n.current[L],G)){if(n.current[L]=G,L==="search")B(),I(),_(1,Q);else if(L==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Z=document.getElementById(R);Z?Z.focus():($=document.getElementById(N))==null||$.focus()}if(_(7,()=>{var Z;n.current.selectedItemId=(Z=ee())==null?void 0:Z.id,z.emit()}),J||_(5,H),((se=d.current)==null?void 0:se.value)!==void 0){let Z=G??"";(ie=(oe=d.current).onValueChange)==null||ie.call(oe,Z);return}}z.emit()}},emit:()=>{c.current.forEach(L=>L())}}),[]),D=p.useMemo(()=>({value:(L,G,J)=>{var $;G!==(($=o.current.get(L))==null?void 0:$.value)&&(o.current.set(L,{value:G,keywords:J}),n.current.filtered.items.set(L,V(G,J)),_(2,()=>{I(),z.emit()}))},item:(L,G)=>(r.current.add(L),G&&(i.current.has(G)?i.current.get(G).add(L):i.current.set(G,new Set([L]))),_(3,()=>{B(),I(),n.current.value||Q(),z.emit()}),()=>{o.current.delete(L),r.current.delete(L),n.current.filtered.items.delete(L);let J=ee();_(4,()=>{B(),(J==null?void 0:J.getAttribute("id"))===L&&Q(),z.emit()})}),group:L=>(i.current.has(L)||i.current.set(L,new Set),()=>{o.current.delete(L),i.current.delete(L)}),filter:()=>d.current.shouldFilter,label:h||e["aria-label"],getDisablePointerSelection:()=>d.current.disablePointerSelection,listId:N,inputId:R,labelId:E,listInnerRef:A}),[]);function V(L,G){var J,$;let se=($=(J=d.current)==null?void 0:J.filter)!=null?$:o8;return L?se(L,n.current.search,G):0}function I(){if(!n.current.search||d.current.shouldFilter===!1)return;let L=n.current.filtered.items,G=[];n.current.filtered.groups.forEach($=>{let se=i.current.get($),oe=0;se.forEach(ie=>{let Z=L.get(ie);oe=Math.max(Z,oe)}),G.push([$,oe])});let J=A.current;W().sort(($,se)=>{var oe,ie;let Z=$.getAttribute("id"),ve=se.getAttribute("id");return((oe=L.get(ve))!=null?oe:0)-((ie=L.get(Z))!=null?ie:0)}).forEach($=>{let se=$.closest(_x);se?se.appendChild($.parentElement===se?$:$.closest(`${_x} > *`)):J.appendChild($.parentElement===J?$:$.closest(`${_x} > *`))}),G.sort(($,se)=>se[1]-$[1]).forEach($=>{var se;let oe=(se=A.current)==null?void 0:se.querySelector(`${nu}[${ol}="${encodeURIComponent($[0])}"]`);oe==null||oe.parentElement.appendChild(oe)})}function Q(){let L=W().find(J=>J.getAttribute("aria-disabled")!=="true"),G=L==null?void 0:L.getAttribute(ol);z.setState("value",G||void 0)}function B(){var L,G,J,$;if(!n.current.search||d.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let se=0;for(let oe of r.current){let ie=(G=(L=o.current.get(oe))==null?void 0:L.value)!=null?G:"",Z=($=(J=o.current.get(oe))==null?void 0:J.keywords)!=null?$:[],ve=V(ie,Z);n.current.filtered.items.set(oe,ve),ve>0&&se++}for(let[oe,ie]of i.current)for(let Z of ie)if(n.current.filtered.items.get(Z)>0){n.current.filtered.groups.add(oe);break}n.current.filtered.count=se}function H(){var L,G,J;let $=ee();$&&(((L=$.parentElement)==null?void 0:L.firstChild)===$&&((J=(G=$.closest(nu))==null?void 0:G.querySelector(i8))==null||J.scrollIntoView({block:"nearest"})),$.scrollIntoView({block:"nearest"}))}function ee(){var L;return(L=A.current)==null?void 0:L.querySelector(`${pN}[aria-selected="true"]`)}function W(){var L;return Array.from(((L=A.current)==null?void 0:L.querySelectorAll(gN))||[])}function M(L){let G=W()[L];G&&z.setState("value",G.getAttribute(ol))}function U(L){var G;let J=ee(),$=W(),se=$.findIndex(ie=>ie===J),oe=$[se+L];(G=d.current)!=null&&G.loop&&(oe=se+L<0?$[$.length-1]:se+L===$.length?$[0]:$[se+L]),oe&&z.setState("value",oe.getAttribute(ol))}function K(L){let G=ee(),J=G==null?void 0:G.closest(nu),$;for(;J&&!$;)J=L>0?g8(J,nu):x8(J,nu),$=J==null?void 0:J.querySelector(gN);$?z.setState("value",$.getAttribute(ol)):U(L)}let ne=()=>M(W().length-1),q=L=>{L.preventDefault(),L.metaKey?ne():L.altKey?K(1):U(1)},P=L=>{L.preventDefault(),L.metaKey?M(0):L.altKey?K(-1):U(-1)};return p.createElement(qe.div,{ref:t,tabIndex:-1,...k,"cmdk-root":"",onKeyDown:L=>{var G;(G=k.onKeyDown)==null||G.call(k,L);let J=L.nativeEvent.isComposing||L.keyCode===229;if(!(L.defaultPrevented||J))switch(L.key){case"n":case"j":{C&&L.ctrlKey&&q(L);break}case"ArrowDown":{q(L);break}case"p":case"k":{C&&L.ctrlKey&&P(L);break}case"ArrowUp":{P(L);break}case"Home":{L.preventDefault(),M(0);break}case"End":{L.preventDefault(),ne();break}case"Enter":{L.preventDefault();let $=ee();if($){let se=new Event(Ox);$.dispatchEvent(se)}}}}},p.createElement("label",{"cmdk-label":"",htmlFor:D.inputId,id:D.labelId,style:b8},h),Yf(e,L=>p.createElement(vN.Provider,{value:z},p.createElement(xN.Provider,{value:D},L))))}),l8=p.forwardRef((e,t)=>{var n,r;let i=cn(),o=p.useRef(null),c=p.useContext(yN),d=ru(),h=wN(e),m=(r=(n=h.current)==null?void 0:n.forceMount)!=null?r:c==null?void 0:c.forceMount;ro(()=>{if(!m)return d.item(i,c==null?void 0:c.id)},[m]);let x=SN(i,o,[e.value,e.children,o],e.keywords),g=zx(),v=Za(_=>_.value&&_.value===x.current),S=Za(_=>m||d.filter()===!1?!0:_.search?_.filtered.items.get(i)>0:!0);p.useEffect(()=>{let _=o.current;if(!(!_||e.disabled))return _.addEventListener(Ox,b),()=>_.removeEventListener(Ox,b)},[S,e.onSelect,e.disabled]);function b(){var _,z;j(),(z=(_=h.current).onSelect)==null||z.call(_,x.current)}function j(){g.setState("value",x.current,!0)}if(!S)return null;let{disabled:C,value:k,onSelect:N,forceMount:E,keywords:R,...A}=e;return p.createElement(qe.div,{ref:Vi(o,t),...A,id:i,"cmdk-item":"",role:"option","aria-disabled":!!C,"aria-selected":!!v,"data-disabled":!!C,"data-selected":!!v,onPointerMove:C||d.getDisablePointerSelection()?void 0:j,onClick:C?void 0:b},e.children)}),c8=p.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...o}=e,c=cn(),d=p.useRef(null),h=p.useRef(null),m=cn(),x=ru(),g=Za(S=>i||x.filter()===!1?!0:S.search?S.filtered.groups.has(c):!0);ro(()=>x.group(c),[]),SN(c,d,[e.value,e.heading,h]);let v=p.useMemo(()=>({id:c,forceMount:i}),[i]);return p.createElement(qe.div,{ref:Vi(d,t),...o,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},n&&p.createElement("div",{ref:h,"cmdk-group-heading":"","aria-hidden":!0,id:m},n),Yf(e,S=>p.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?m:void 0},p.createElement(yN.Provider,{value:v},S))))}),u8=p.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=p.useRef(null),o=Za(c=>!c.search);return!n&&!o?null:p.createElement(qe.div,{ref:Vi(i,t),...r,"cmdk-separator":"",role:"separator"})}),d8=p.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=zx(),c=Za(m=>m.search),d=Za(m=>m.selectedItemId),h=ru();return p.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),p.createElement(qe.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":h.listId,"aria-labelledby":h.labelId,"aria-activedescendant":d,id:h.inputId,type:"text",value:i?e.value:c,onChange:m=>{i||o.setState("search",m.target.value),n==null||n(m.target.value)}})}),f8=p.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,o=p.useRef(null),c=p.useRef(null),d=Za(m=>m.selectedItemId),h=ru();return p.useEffect(()=>{if(c.current&&o.current){let m=c.current,x=o.current,g,v=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let S=m.offsetHeight;x.style.setProperty("--cmdk-list-height",S.toFixed(1)+"px")})});return v.observe(m),()=>{cancelAnimationFrame(g),v.unobserve(m)}}},[]),p.createElement(qe.div,{ref:Vi(o,t),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":d,"aria-label":r,id:h.listId},Yf(e,m=>p.createElement("div",{ref:Vi(c,h.listInnerRef),"cmdk-list-sizer":""},m)))}),h8=p.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:c,...d}=e;return p.createElement(Nc,{open:n,onOpenChange:r},p.createElement(Tc,{container:c},p.createElement(Wo,{"cmdk-overlay":"",className:i}),p.createElement(Xo,{"aria-label":e.label,"cmdk-dialog":"",className:o},p.createElement(bN,{ref:t,...d}))))}),m8=p.forwardRef((e,t)=>Za(n=>n.filtered.count===0)?p.createElement(qe.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),p8=p.forwardRef((e,t)=>{let{progress:n,children:r,label:i="Loading...",...o}=e;return p.createElement(qe.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Yf(e,c=>p.createElement("div",{"aria-hidden":!0},c)))}),ll=Object.assign(bN,{List:f8,Item:l8,Input:d8,Group:c8,Separator:u8,Dialog:h8,Empty:m8,Loading:p8});function g8(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function x8(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function wN(e){let t=p.useRef(e);return ro(()=>{t.current=e}),t}var ro=typeof window>"u"?p.useEffect:p.useLayoutEffect;function cl(e){let t=p.useRef();return t.current===void 0&&(t.current=e()),t}function Za(e){let t=zx(),n=()=>e(t.snapshot());return p.useSyncExternalStore(t.subscribe,n,n)}function SN(e,t,n,r=[]){let i=p.useRef(),o=ru();return ro(()=>{var c;let d=(()=>{var m;for(let x of n){if(typeof x=="string")return x.trim();if(typeof x=="object"&&"current"in x)return x.current?(m=x.current.textContent)==null?void 0:m.trim():i.current}})(),h=r.map(m=>m.trim());o.value(e,d,h),(c=t.current)==null||c.setAttribute(ol,d),i.current=d}),i}var v8=()=>{let[e,t]=p.useState(),n=cl(()=>new Map);return ro(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}};function y8(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Yf({asChild:e,children:t},n){return e&&p.isValidElement(t)?p.cloneElement(y8(t),{ref:t.ref},n(t.props.children)):n(t)}var b8={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function jN({className:e,...t}){return l.jsx(ll,{"data-slot":"command",className:Y("flex h-full w-full flex-col overflow-hidden rounded-md bg-transparent text-foreground",e),...t})}function CN({className:e,...t}){return l.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--acr-border)] px-2","cmdk-input-wrapper":"",children:[l.jsx(zp,{className:"size-3.5 shrink-0 text-muted-foreground"}),l.jsx(ll.Input,{"data-slot":"command-input",className:Y("flex h-8 w-full bg-transparent text-[13px] outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function kN({className:e,...t}){return l.jsx(ll.List,{"data-slot":"command-list",className:Y("scrollbar-mac max-h-64 overflow-y-auto overflow-x-hidden p-1",e),...t})}function NN(e){return l.jsx(ll.Empty,{"data-slot":"command-empty",className:"py-4 text-center text-[13px] text-muted-foreground",...e})}function TN({className:e,...t}){return l.jsx(ll.Group,{"data-slot":"command-group",className:Y("overflow-hidden text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1 [&_[cmdk-group-heading]]:text-[11px] [&_[cmdk-group-heading]]:[letter-spacing:var(--text-subheadline-tracking)] [&_[cmdk-group-heading]]:text-muted-foreground",e),...t})}function EN({className:e,...t}){return l.jsx(ll.Item,{"data-slot":"command-item",className:Y("relative flex cursor-default select-none items-center gap-2 rounded-[6px] px-2 py-1.5 text-[13px] outline-none","data-[selected=true]:bg-[var(--acr-hover)] data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50",e),...t})}function w8({open:e,onOpenChange:t,conn:n,onPick:r,surface:i}){const[o,c]=p.useState(""),[d,h]=p.useState(null),[m,x]=p.useState(!1),g=p.useRef(0);p.useEffect(()=>{if(!e)return;const b=++g.current;x(!0);const j=setTimeout(()=>{be.searchAllPluginSources(n,{query:o,limit:o.trim()?100:60,surface:i}).then(C=>{g.current===b&&h(C)}).catch(()=>{g.current===b&&h(null)}).finally(()=>{g.current===b&&x(!1)})},160);return()=>clearTimeout(j)},[e,o,n.baseUrl,i]),p.useEffect(()=>{e&&c("")},[e]);const v=(d==null?void 0:d.sources)??[],S=(d==null?void 0:d.plugins)??[];return l.jsx(hs,{open:e,onOpenChange:t,children:l.jsxs(Vr,{showCloseButton:!1,className:"max-w-xl gap-0 overflow-hidden p-0",children:[l.jsx(Fr,{className:"sr-only",children:"搜索全部插件源"}),l.jsxs(jN,{shouldFilter:!1,className:"max-h-[60vh]",children:[l.jsx(CN,{value:o,onValueChange:c,placeholder:"搜索全部插件的源…",autoFocus:!0}),l.jsxs(kN,{className:"max-h-[52vh] p-1.5",children:[!m&&v.length===0?l.jsx(NN,{children:"没有匹配的源"}):null,S.map(b=>{const j=v.filter(C=>C.pluginId===b.id);return j.length?l.jsx(TN,{heading:`${b.name} · ${b.count}`,children:j.map(C=>{var k;return l.jsxs(EN,{value:`${C.pluginId}:${C.id}`,onSelect:()=>{t(!1),r(C)},children:[l.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center overflow-hidden rounded-[5px] bg-[var(--acr-card-nested)]",children:l.jsx(Rx,{id:C.id,name:C.title,facilityKey:(k=C.facility)==null?void 0:k.key})}),l.jsx("span",{className:"min-w-0 flex-1 truncate",children:C.title}),C.description&&C.description!==C.title?l.jsx("span",{className:"hidden max-w-[45%] shrink truncate text-[11px] text-muted-foreground sm:block",children:C.description}):null]},`${C.pluginId}:${C.id}`)})},b.id):null})]})]})]})})}const S8=Ur(Y("relative flex items-center w-full min-w-0 rounded-full outline-none","transition-[background-color,border-color,box-shadow] [transition-timing-function:var(--acr-spring-default)] [transition-duration:var(--acr-spring-default-duration)]","text-foreground selection:bg-primary selection:text-primary-foreground","disabled:cursor-not-allowed disabled:opacity-50"),{variants:{variant:{default:"border border-[var(--acr-input-border)] bg-[var(--acr-input)] hover:border-[var(--acr-border)] focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/25","over-glass":"bg-[var(--acr-chip)] hover:bg-[var(--acr-chip-hover)] border border-transparent focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/25"},size:{mini:"h-4 pl-5 pr-4 text-[10px] [letter-spacing:var(--text-footnote-tracking)]",small:"h-5 pl-6 pr-5 text-[11px] [letter-spacing:var(--text-subheadline-tracking)]",medium:"h-6 pl-7 pr-6 text-[13px]",large:"h-7 pl-8 pr-6 text-[15px]",xl:"h-9 pl-9 pr-8 text-[17px] [letter-spacing:var(--text-title2-tracking)]"}},defaultVariants:{variant:"default",size:"medium"}}),Wf=p.forwardRef(({className:e,variant:t,size:n="medium",onClear:r,shortcut:i,value:o,onChange:c,disabled:d,...h},m)=>{const[x,g]=p.useState(""),v=o!==void 0,S=v?o:x,b=()=>{v||g(""),r==null||r(),c&&c({target:{value:""},currentTarget:{value:""}})},j=k=>{v||g(k.target.value),c==null||c(k)},C=S!=="";return l.jsxs("div",{"data-slot":"searchbar",className:Y(S8({variant:t,size:n,className:e})),children:[l.jsx(zp,{className:Y("absolute text-muted-foreground pointer-events-none",{"left-1.5 size-3":n==="mini"||n==="small","left-2 size-3.5":n==="medium"||!n,"left-2 size-4":n==="large","left-2.5 size-4.5":n==="xl"})}),l.jsx("input",{ref:m,type:"text",value:S,onChange:j,disabled:d,className:Y("w-full h-full bg-transparent border-0 outline-none p-0 focus:ring-0 focus:outline-none placeholder:text-muted-foreground"),...h}),C&&!d&&l.jsx("button",{type:"button",onClick:b,className:Y("absolute top-1/2 -translate-y-1/2 flex items-center justify-center rounded-full bg-muted-foreground/30 hover:bg-muted-foreground/45 text-background focus:outline-none transition-[background-color,scale] active:scale-90",{"right-1 size-3":n==="mini","right-1 size-3.5":n==="small","right-1.5 size-3.5":n==="medium"||!n,"right-1.5 size-4":n==="large","right-2 size-4.5":n==="xl"}),children:l.jsx(Ui,{className:Y({"size-2":n==="mini","size-2.5":n==="small"||n==="medium"||n==="large"||!n,"size-3":n==="xl"})})}),!C&&i&&!d?l.jsx("kbd",{"aria-hidden":!0,className:Y("pointer-events-none absolute top-1/2 -translate-y-1/2 inline-flex items-center gap-0.5 rounded border border-[var(--acr-border-soft)] bg-[var(--acr-chip)] font-sans font-medium leading-none text-muted-foreground",{"right-1 px-1 py-0.5 text-[9px]":n==="mini"||n==="small","right-1.5 px-1 py-0.5 text-[10px]":n==="medium"||n==="large"||!n,"right-2 px-1.5 py-1 text-[11px]":n==="xl"}),children:i}):null]})});Wf.displayName="Searchbar";function Px({...e}){return l.jsx(Bg,{"data-slot":"hover-card",...e})}function Lx({...e}){return l.jsx(Ug,{"data-slot":"hover-card-trigger",...e})}function Ix({className:e,align:t="center",sideOffset:n=4,container:r,...i}){return l.jsx(Vg,{container:r,children:l.jsx(kf,{"data-slot":"hover-card-content",align:t,sideOffset:n,className:Y("z-50 w-64 rounded-[10px] bg-[var(--acr-panel)] p-4 text-foreground backdrop-blur-xl shadow-[0_0_0_1px_rgba(190,190,190,0.16),0_16px_48px_rgba(0,0,0,0.45)] outline-none","origin-(--radix-hover-card-content-transform-origin) data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 [animation-timing-function:var(--acr-spring-default)]! [animation-duration:var(--acr-spring-default-duration)]!",e),...i})})}const RN=p.createContext({});function $x(e){const t=p.useRef(null);return t.current===null&&(t.current=e()),t.current}const AN=typeof window<"u"?p.useLayoutEffect:p.useEffect,Bx=p.createContext(null);function Ux(e,t){e.indexOf(t)===-1&&e.push(t)}function ul(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Ps=(e,t,n)=>n>t?t:n<e?e:n;function MN(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let dl=()=>{},Ja=()=>{};typeof process<"u"&&((zM=process.env)==null?void 0:zM.NODE_ENV)!=="production"&&(dl=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(MN(t,n))},Ja=(e,t,n)=>{if(!e)throw new Error(MN(t,n))});const ei={},DN=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),_N=e=>typeof e=="object"&&e!==null,ON=e=>/^0[^.\s]+$/u.test(e);function zN(e){let t;return()=>(t===void 0&&(t=e()),t)}const qr=e=>e,su=(...e)=>e.reduce((t,n)=>r=>n(t(r))),fl=(e,t,n)=>{const r=t-e;return r?(n-e)/r:1};class Vx{constructor(){this.subscriptions=[]}add(t){return Ux(this.subscriptions,t),()=>ul(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let o=0;o<i;o++){const c=this.subscriptions[o];c&&c(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Yn=e=>e*1e3,Kr=e=>e/1e3,PN=(e,t)=>t?e*(1e3/t):0,j8=(e,t,n)=>{const r=t-e;return((n-e)%r+r)%r+e},LN=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,C8=1e-7,k8=12;function N8(e,t,n,r,i){let o,c,d=0;do c=t+(n-t)/2,o=LN(c,r,i)-e,o>0?n=c:t=c;while(Math.abs(o)>C8&&++d<k8);return c}function au(e,t,n,r){if(e===t&&n===r)return qr;const i=o=>N8(o,0,1,e,n);return o=>o===0||o===1?o:LN(i(o),t,r)}const IN=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Fx=e=>t=>1-e(1-t),$N=au(.33,1.53,.69,.99),Hx=Fx($N),BN=IN(Hx),UN=e=>e>=1?1:(e*=2)<1?.5*Hx(e):.5*(2-Math.pow(2,-10*(e-1))),qx=e=>1-Math.sin(Math.acos(e)),VN=Fx(qx),FN=IN(qx),T8=au(.42,0,1,1),E8=au(0,0,.58,1),HN=au(.42,0,.58,1),qN=e=>Array.isArray(e)&&typeof e[0]!="number";function KN(e,t){return qN(e)?e[j8(0,e.length,t)]:e}const GN=e=>Array.isArray(e)&&typeof e[0]=="number",YN={linear:qr,easeIn:T8,easeInOut:HN,easeOut:E8,circIn:qx,circInOut:FN,circOut:VN,backIn:Hx,backInOut:BN,backOut:$N,anticipate:UN},R8=e=>typeof e=="string",WN=e=>{if(GN(e)){Ja(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,i]=e;return au(t,n,r,i)}else if(R8(e))return Ja(YN[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),YN[e];return e},Xf=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function A8(e){let t=new Set,n=new Set,r=!1,i=!1;const o=new WeakSet;let c={delta:0,timestamp:0,isProcessing:!1};function d(m){o.has(m)&&(h.schedule(m),e()),m(c)}const h={schedule:(m,x=!1,g=!1)=>{const S=g&&r?t:n;return x&&o.add(m),S.add(m),m},cancel:m=>{n.delete(m),o.delete(m)},process:m=>{if(c=m,r){i=!0;return}r=!0;const x=t;t=n,n=x,t.forEach(d),t.clear(),r=!1,i&&(i=!1,h.process(m))}};return h}const M8=40;function XN(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,c=Xf.reduce((E,R)=>(E[R]=A8(o),E),{}),{setup:d,read:h,resolveKeyframes:m,preUpdate:x,update:g,preRender:v,render:S,postRender:b}=c,j=()=>{const E=ei.useManualTiming,R=E?i.timestamp:performance.now();n=!1,E||(i.delta=r?1e3/60:Math.max(Math.min(R-i.timestamp,M8),1)),i.timestamp=R,i.isProcessing=!0,d.process(i),h.process(i),m.process(i),x.process(i),g.process(i),v.process(i),S.process(i),b.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(j))},C=()=>{n=!0,r=!0,i.isProcessing||e(j)};return{schedule:Xf.reduce((E,R)=>{const A=c[R];return E[R]=(_,z=!1,D=!1)=>(n||C(),A.schedule(_,z,D)),E},{}),cancel:E=>{for(let R=0;R<Xf.length;R++)c[Xf[R]].cancel(E)},state:i,steps:c}}const{schedule:_t,cancel:ha,state:_n,steps:Kx}=XN(typeof requestAnimationFrame<"u"?requestAnimationFrame:qr,!0);let Qf;function D8(){Qf=void 0}const Wn={now:()=>(Qf===void 0&&Wn.set(_n.isProcessing||ei.useManualTiming?_n.timestamp:performance.now()),Qf),set:e=>{Qf=e,queueMicrotask(D8)}},QN=e=>t=>typeof t=="string"&&t.startsWith(e),ZN=QN("--"),_8=QN("var(--"),Gx=e=>_8(e)?O8.test(e.split("/*")[0].trim()):!1,O8=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function JN(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const hl={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},iu={...hl,transform:e=>Ps(0,1,e)},Zf={...hl,default:1},ou=e=>Math.round(e*1e5)/1e5,Yx=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function z8(e){return e==null}const P8=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Wx=(e,t)=>n=>!!(typeof n=="string"&&P8.test(n)&&n.startsWith(e)||t&&!z8(n)&&Object.prototype.hasOwnProperty.call(n,t)),eT=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,o,c,d]=r.match(Yx);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(c),alpha:d!==void 0?parseFloat(d):1}},L8=e=>Ps(0,255,e),Xx={...hl,transform:e=>Math.round(L8(e))},so={test:Wx("rgb","red"),parse:eT("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Xx.transform(e)+", "+Xx.transform(t)+", "+Xx.transform(n)+", "+ou(iu.transform(r))+")"};function I8(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const Qx={test:Wx("#"),parse:I8,transform:so.transform},lu=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ma=lu("deg"),Ls=lu("%"),Be=lu("px"),$8=lu("vh"),B8=lu("vw"),tT={...Ls,parse:e=>Ls.parse(e)/100,transform:e=>Ls.transform(e*100)},ml={test:Wx("hsl","hue"),parse:eT("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Ls.transform(ou(t))+", "+Ls.transform(ou(n))+", "+ou(iu.transform(r))+")"},un={test:e=>so.test(e)||Qx.test(e)||ml.test(e),parse:e=>so.test(e)?so.parse(e):ml.test(e)?ml.parse(e):Qx.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?so.transform(e):ml.transform(e),getAnimatableNone:e=>{const t=un.parse(e);return t.alpha=0,un.transform(t)}},U8=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function V8(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Yx))==null?void 0:t.length)||0)+(((n=e.match(U8))==null?void 0:n.length)||0)>0}const nT="number",rT="color",F8="var",H8="var(",sT="${}",q8=/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+)/giu;function pl(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let o=0;const d=t.replace(q8,h=>(un.test(h)?(r.color.push(o),i.push(rT),n.push(un.parse(h))):h.startsWith(H8)?(r.var.push(o),i.push(F8),n.push(h)):(r.number.push(o),i.push(nT),n.push(parseFloat(h))),++o,sT)).split(sT);return{values:n,split:d,indexes:r,types:i}}function K8(e){return pl(e).values}function aT({split:e,types:t}){const n=e.length;return r=>{let i="";for(let o=0;o<n;o++)if(i+=e[o],r[o]!==void 0){const c=t[o];c===nT?i+=ou(r[o]):c===rT?i+=un.transform(r[o]):i+=r[o]}return i}}function G8(e){return aT(pl(e))}const Y8=e=>typeof e=="number"?0:un.test(e)?un.getAnimatableNone(e):e,W8=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:Y8(e);function X8(e){const t=pl(e);return aT(t)(t.values.map((r,i)=>W8(r,t.split[i])))}const ps={test:V8,parse:K8,createTransformer:G8,getAnimatableNone:X8};function Zx(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<.16666666666666666?e+(t-e)*6*n:n<.5?t:n<.6666666666666666?e+(t-e)*(.6666666666666666-n)*6:e}function Q8({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,o=0,c=0;if(!t)i=o=c=n;else{const d=n<.5?n*(1+t):n+t-n*t,h=2*n-d;i=Zx(h,d,e+.3333333333333333),o=Zx(h,d,e),c=Zx(h,d,e-.3333333333333333)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(c*255),alpha:r}}function Jf(e,t){return n=>n>0?t:e}const Ot=(e,t,n)=>e+(t-e)*n,Jx=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Z8=[Qx,so,ml],J8=e=>Z8.find(t=>t.test(e));function iT(e){const t=J8(e);if(dl(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===ml&&(n=Q8(n)),n}const oT=(e,t)=>{const n=iT(e),r=iT(t);if(!n||!r)return Jf(e,t);const i={...n};return o=>(i.red=Jx(n.red,r.red,o),i.green=Jx(n.green,r.green,o),i.blue=Jx(n.blue,r.blue,o),i.alpha=Ot(n.alpha,r.alpha,o),so.transform(i))},ev=new Set(["none","hidden"]);function eH(e,t){return ev.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function tH(e,t){return n=>Ot(e,t,n)}function tv(e){return typeof e=="number"?tH:typeof e=="string"?Gx(e)?Jf:un.test(e)?oT:sH:Array.isArray(e)?lT:typeof e=="object"?un.test(e)?oT:nH:Jf}function lT(e,t){const n=[...e],r=n.length,i=e.map((o,c)=>tv(o)(o,t[c]));return o=>{for(let c=0;c<r;c++)n[c]=i[c](o);return n}}function nH(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=tv(e[i])(e[i],t[i]));return i=>{for(const o in r)n[o]=r[o](i);return n}}function rH(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const o=t.types[i],c=e.indexes[o][r[o]],d=e.values[c]??0;n[i]=d,r[o]++}return n}const sH=(e,t)=>{const n=ps.createTransformer(t),r=pl(e),i=pl(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?ev.has(e)&&!i.values.length||ev.has(t)&&!r.values.length?eH(e,t):su(lT(rH(r,i),i.values),n):(dl(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Jf(e,t))};function cT(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Ot(e,t,n):tv(e)(e,t)}const aH=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>_t.update(t,n),stop:()=>ha(t),now:()=>_n.isProcessing?_n.timestamp:Wn.now()}},uT=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let o=0;o<i;o++)r+=Math.round(e(o/(i-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},eh=2e4;function nv(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<eh;)t+=n,r=e.next(t);return t>=eh?1/0:t}function dT(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(nv(r),eh);return{type:"keyframes",ease:o=>r.next(i*o).value/t,duration:Kr(i)}}const Xt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function rv(e,t){return e*Math.sqrt(1-t*t)}const iH=12;function oH(e,t,n){let r=n;for(let i=1;i<iH;i++)r=r-e(r)/t(r);return r}const sv=.001;function lH({duration:e=Xt.duration,bounce:t=Xt.bounce,velocity:n=Xt.velocity,mass:r=Xt.mass}){let i,o;dl(e<=Yn(Xt.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let c=1-t;c=Ps(Xt.minDamping,Xt.maxDamping,c),e=Ps(Xt.minDuration,Xt.maxDuration,Kr(e)),c<1?(i=m=>{const x=m*c,g=x*e,v=x-n,S=rv(m,c),b=Math.exp(-g);return sv-v/S*b},o=m=>{const g=m*c*e,v=g*n+n,S=Math.pow(c,2)*Math.pow(m,2)*e,b=Math.exp(-g),j=rv(Math.pow(m,2),c);return(-i(m)+sv>0?-1:1)*((v-S)*b)/j}):(i=m=>{const x=Math.exp(-m*e),g=(m-n)*e+1;return-sv+x*g},o=m=>{const x=Math.exp(-m*e),g=(n-m)*(e*e);return x*g});const d=5/e,h=oH(i,o,d);if(e=Yn(e),isNaN(h))return{stiffness:Xt.stiffness,damping:Xt.damping,duration:e};{const m=Math.pow(h,2)*r;return{stiffness:m,damping:c*2*Math.sqrt(r*m),duration:e}}}const cH=["duration","bounce"],uH=["stiffness","damping","mass"];function fT(e,t){return t.some(n=>e[n]!==void 0)}function dH(e){let t={velocity:Xt.velocity,stiffness:Xt.stiffness,damping:Xt.damping,mass:Xt.mass,isResolvedFromDuration:!1,...e};if(!fT(e,uH)&&fT(e,cH))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,o=2*Ps(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Xt.mass,stiffness:i,damping:o}}else{const n=lH({...e,velocity:0});t={...t,...n,mass:Xt.mass},t.isResolvedFromDuration=!0}return t}function cu(e=Xt.visualDuration,t=Xt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const o=n.keyframes[0],c=n.keyframes[n.keyframes.length-1],d={done:!1,value:o},{stiffness:h,damping:m,mass:x,duration:g,velocity:v,isResolvedFromDuration:S}=dH({...n,velocity:-Kr(n.velocity||0)}),b=v||0,j=m/(2*Math.sqrt(h*x)),C=c-o,k=Kr(Math.sqrt(h/x)),N=Math.abs(C)<5;r||(r=N?Xt.restSpeed.granular:Xt.restSpeed.default),i||(i=N?Xt.restDelta.granular:Xt.restDelta.default);let E,R,A,_,z,D;if(j<1)A=rv(k,j),_=(b+j*k*C)/A,E=I=>{const Q=Math.exp(-j*k*I);return c-Q*(_*Math.sin(A*I)+C*Math.cos(A*I))},z=j*k*_+C*A,D=j*k*C-_*A,R=I=>Math.exp(-j*k*I)*(z*Math.sin(A*I)+D*Math.cos(A*I));else if(j===1){E=Q=>c-Math.exp(-k*Q)*(C+(b+k*C)*Q);const I=b+k*C;R=Q=>Math.exp(-k*Q)*(k*I*Q-b)}else{const I=k*Math.sqrt(j*j-1);E=ee=>{const W=Math.exp(-j*k*ee),M=Math.min(I*ee,300);return c-W*((b+j*k*C)*Math.sinh(M)+I*C*Math.cosh(M))/I};const Q=(b+j*k*C)/I,B=j*k*Q-C*I,H=j*k*C-Q*I;R=ee=>{const W=Math.exp(-j*k*ee),M=Math.min(I*ee,300);return W*(B*Math.sinh(M)+H*Math.cosh(M))}}const V={calculatedDuration:S&&g||null,velocity:I=>Yn(R(I)),next:I=>{if(!S&&j<1){const B=Math.exp(-j*k*I),H=Math.sin(A*I),ee=Math.cos(A*I),W=c-B*(_*H+C*ee),M=Yn(B*(z*H+D*ee));return d.done=Math.abs(M)<=r&&Math.abs(c-W)<=i,d.value=d.done?c:W,d}const Q=E(I);if(S)d.done=I>=g;else{const B=Yn(R(I));d.done=Math.abs(B)<=r&&Math.abs(c-Q)<=i}return d.value=d.done?c:Q,d},toString:()=>{const I=Math.min(nv(V),eh),Q=uT(B=>V.next(I*B).value,I,30);return I+"ms "+Q},toTransition:()=>{}};return V}cu.applyToOptions=e=>{const t=dT(e,100,cu);return e.ease=t.ease,e.duration=Yn(t.duration),e.type="keyframes",e};const fH=5;function hT(e,t,n){const r=Math.max(t-fH,0);return PN(n-e(r),t-r)}function av({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:c,min:d,max:h,restDelta:m=.5,restSpeed:x}){const g=e[0],v={done:!1,value:g},S=D=>d!==void 0&&D<d||h!==void 0&&D>h,b=D=>d===void 0?h:h===void 0||Math.abs(d-D)<Math.abs(h-D)?d:h;let j=n*t;const C=g+j,k=c===void 0?C:c(C);k!==C&&(j=k-g);const N=D=>-j*Math.exp(-D/r),E=D=>k+N(D),R=D=>{const V=N(D),I=E(D);v.done=Math.abs(V)<=m,v.value=v.done?k:I};let A,_;const z=D=>{S(v.value)&&(A=D,_=cu({keyframes:[v.value,b(v.value)],velocity:hT(E,D,v.value),damping:i,stiffness:o,restDelta:m,restSpeed:x}))};return z(0),{calculatedDuration:null,next:D=>{let V=!1;return!_&&A===void 0&&(V=!0,R(D),z(D)),A!==void 0&&D>=A?_.next(D-A):(!V&&R(D),v)}}}function hH(e,t,n){const r=[],i=n||ei.mix||cT,o=e.length-1;for(let c=0;c<o;c++){let d=i(e[c],e[c+1]);if(t){const h=Array.isArray(t)?t[c]||qr:t;d=su(h,d)}r.push(d)}return r}function mT(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;if(Ja(o===t.length,"Both input and output ranges must be the same length","range-length"),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const c=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const d=hH(t,r,i),h=d.length,m=x=>{if(c&&x<e[0])return t[0];let g=0;if(h>1)for(;g<e.length-2&&!(x<e[g+1]);g++);const v=fl(e[g],e[g+1],x);return d[g](v)};return n?x=>m(Ps(e[0],e[o-1],x)):m}function pT(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=fl(0,t,r);e.push(Ot(n,1,i))}}function gT(e){const t=[0];return pT(t,e.length-1),t}function mH(e,t){return e.map(n=>n*t)}function pH(e,t){return e.map(()=>t||HN).splice(0,e.length-1)}function uu({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=qN(r)?r.map(WN):WN(r),o={done:!1,value:t[0]},c=mH(n&&n.length===t.length?n:gT(t),e),d=mT(c,t,{ease:Array.isArray(i)?i:pH(t,i)});return{calculatedDuration:e,next:h=>(o.value=d(h),o.done=h>=e,o)}}const gH=e=>e!==null;function th(e,{repeat:t,repeatType:n="loop"},r,i=1){const o=e.filter(gH),d=i<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!d||r===void 0?o[d]:r}const xH={decay:av,inertia:av,tween:uu,keyframes:uu,spring:cu};function xT(e){typeof e.type=="string"&&(e.type=xH[e.type])}class iv{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const vH=e=>e/100;class nh extends iv{constructor(t){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=()=>{var r,i;const{motionValue:n}=this.options;n&&n.updatedAt!==Wn.now()&&this.tick(Wn.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(r=this.options).onStop)==null||i.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;xT(t);const{type:n=uu,repeat:r=0,repeatDelay:i=0,repeatType:o,velocity:c=0}=t;let{keyframes:d}=t;const h=n||uu;h!==uu&&typeof d[0]!="number"&&(this.mixKeyframes=su(vH,cT(d[0],d[1])),d=[0,100]);const m=h({...t,keyframes:d});o==="mirror"&&(this.mirroredGenerator=h({...t,keyframes:[...d].reverse(),velocity:-c})),m.calculatedDuration===null&&(m.calculatedDuration=nv(m));const{calculatedDuration:x}=m;this.calculatedDuration=x,this.resolvedDuration=x+i,this.totalDuration=this.resolvedDuration*(r+1)-i,this.generator=m}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:i,mixKeyframes:o,mirroredGenerator:c,resolvedDuration:d,calculatedDuration:h}=this;if(this.startTime===null)return r.next(0);const{delay:m=0,keyframes:x,repeat:g,repeatType:v,repeatDelay:S,type:b,onUpdate:j,finalKeyframe:C}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const k=this.currentTime-m*(this.playbackSpeed>=0?1:-1),N=this.playbackSpeed>=0?k<0:k>i;this.currentTime=Math.max(k,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let E=this.currentTime,R=r;if(g){const D=Math.min(this.currentTime,i)/d;let V=Math.floor(D),I=D%1;!I&&D>=1&&(I=1),I===1&&V--,V=Math.min(V,g+1),!!(V%2)&&(v==="reverse"?(I=1-I,S&&(I-=S/d)):v==="mirror"&&(R=c)),E=Ps(0,1,I)*d}let A;N?(this.delayState.value=x[0],A=this.delayState):A=R.next(E),o&&!N&&(A.value=o(A.value));let{done:_}=A;!N&&h!==null&&(_=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const z=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&_);return z&&b!==av&&(A.value=th(x,this.options,C,this.speed)),j&&j(A.value),z&&this.finish(),A}then(t,n){return this.finished.then(t,n)}get duration(){return Kr(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Kr(t)}get time(){return Kr(this.currentTime)}set time(t){t=Yn(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return hT(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(Wn.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=Kr(this.currentTime))}play(){var i,o;if(this.isStopped)return;const{driver:t=aH,startTime:n}=this.options;this.driver||(this.driver=t(c=>this.tick(c))),(o=(i=this.options).onPlay)==null||o.call(i);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),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(Wn.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function yH(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ao=e=>e*180/Math.PI,ov=e=>{const t=ao(Math.atan2(e[1],e[0]));return lv(t)},bH={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ov,rotateZ:ov,skewX:e=>ao(Math.atan(e[1])),skewY:e=>ao(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},lv=e=>(e=e%360,e<0&&(e+=360),e),vT=ov,yT=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),bT=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),wH={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:yT,scaleY:bT,scale:e=>(yT(e)+bT(e))/2,rotateX:e=>lv(ao(Math.atan2(e[6],e[5]))),rotateY:e=>lv(ao(Math.atan2(-e[2],e[0]))),rotateZ:vT,rotate:vT,skewX:e=>ao(Math.atan(e[4])),skewY:e=>ao(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function cv(e){return e.includes("scale")?1:0}function uv(e,t){if(!e||e==="none")return cv(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=wH,i=n;else{const d=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=bH,i=d}if(!i)return cv(t);const o=r[t],c=i[1].split(",").map(jH);return typeof o=="function"?o(c):c[o]}const SH=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return uv(n,t)};function jH(e){return parseFloat(e.trim())}const gl=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],xl=new Set([...gl,"pathRotation"]),wT=e=>e===hl||e===Be,CH=new Set(["x","y","z"]),kH=gl.filter(e=>!CH.has(e));function NH(e){const t=[];return kH.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const ti={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const i=e.max-e.min;return r==="border-box"?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const i=e.max-e.min;return r==="border-box"?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>uv(t,"x"),y:(e,{transform:t})=>uv(t,"y")};ti.translateX=ti.x,ti.translateY=ti.y;const io=new Set;let dv=!1,fv=!1,hv=!1;function ST(){if(fv){const e=Array.from(io).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=NH(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([o,c])=>{var d;(d=r.getValue(o))==null||d.set(c)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}fv=!1,dv=!1,io.forEach(e=>e.complete(hv)),io.clear()}function jT(){io.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(fv=!0)})}function TH(){hv=!0,jT(),ST(),hv=!1}class mv{constructor(t,n,r,i,o,c=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=o,this.isAsync=c}scheduleResolve(){this.state="scheduled",this.isAsync?(io.add(this),dv||(dv=!0,_t.read(jT),_t.resolveKeyframes(ST))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;if(t[0]===null){const o=i==null?void 0:i.get(),c=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const d=r.readValue(n,c);d!=null&&(t[0]=d)}t[0]===void 0&&(t[0]=c),i&&o===void 0&&i.set(t[0])}yH(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),io.delete(this)}cancel(){this.state==="scheduled"&&(io.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const EH=e=>e.startsWith("--");function CT(e,t,n){EH(t)?e.style.setProperty(t,n):e.style[t]=n}const RH={};function kT(e,t){const n=zN(e);return()=>RH[t]??n()}const AH=kT(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),NT=kT(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),du=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,TT={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:du([0,.65,.55,1]),circOut:du([.55,0,1,.45]),backIn:du([.31,.01,.66,-.59]),backOut:du([.33,1.53,.69,.99])};function ET(e,t){if(e)return typeof e=="function"?NT()?uT(e,t):"ease-out":GN(e)?du(e):Array.isArray(e)?e.map(n=>ET(n,t)||TT.easeOut):TT[e]}function MH(e,t,n,{delay:r=0,duration:i=300,repeat:o=0,repeatType:c="loop",ease:d="easeOut",times:h}={},m=void 0){const x={[t]:n};h&&(x.offset=h);const g=ET(d,i);Array.isArray(g)&&(x.easing=g);const v={delay:r,duration:i,easing:Array.isArray(g)?"linear":g,fill:"both",iterations:o+1,direction:c==="reverse"?"alternate":"normal"};return m&&(v.pseudoElement=m),e.animate(x,v)}function pv(e){return typeof e=="function"&&"applyToOptions"in e}function DH({type:e,...t}){return pv(e)&&NT()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class RT extends iv{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:i,pseudoElement:o,allowFlatten:c=!1,finalKeyframe:d,onComplete:h}=t;this.isPseudoElement=!!o,this.allowFlatten=c,this.options=t,Ja(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const m=DH(t);this.animation=MH(n,r,i,m,o),m.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const x=th(i,this.options,d,this.speed);this.updateMotionValue&&this.updateMotionValue(x),CT(n,r,x),this.animation.cancel()}h==null||h(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,i;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((i=(r=this.animation).commitStyles)==null||i.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return Kr(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Kr(t)}get time(){return Kr(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Yn(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:i}){var o;return this.allowFlatten&&((o=this.animation.effect)==null||o.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&AH()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),qr):i(this)}}const AT={anticipate:UN,backInOut:BN,circInOut:FN};function _H(e){return e in AT}function OH(e){typeof e.ease=="string"&&_H(e.ease)&&(e.ease=AT[e.ease])}const gv=10;class zH extends RT{constructor(t){OH(t),xT(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:i,element:o,...c}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const d=new nh({...c,autoplay:!1}),h=Math.max(gv,Wn.now()-this.startTime),m=Ps(0,gv,h-gv),x=d.sample(h).value,{name:g}=this.options;o&&g&&CT(o,g,x),n.setWithVelocity(d.sample(Math.max(0,h-m)).value,x,m),d.stop()}}const MT=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ps.test(e)||e==="0")&&!e.startsWith("url("));function PH(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function LH(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],c=MT(i,t),d=MT(o,t);return dl(c===d,`You are trying to animate ${t} from "${i}" to "${o}". "${c?o:i}" is not an animatable value.`,"value-not-animatable"),!c||!d?!1:PH(e)||(n==="spring"||pv(n))&&r}function xv(e){e.duration=0,e.type="keyframes"}const DT=new Set(["opacity","clipPath","filter","transform"]),IH=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function $H(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&IH.test(e[t]))return!0;return!1}const BH=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),UH=zN(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function VH(e){var g;const{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:o,type:c,keyframes:d}=e;if(!(((g=t==null?void 0:t.owner)==null?void 0:g.current)instanceof HTMLElement))return!1;const{onUpdate:m,transformTemplate:x}=t.owner.getProps();return UH()&&n&&(DT.has(n)||BH.has(n)&&$H(d))&&(n!=="transform"||!x)&&!m&&!r&&i!=="mirror"&&o!==0&&c!=="inertia"}const FH=40;class HH extends iv{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:c="loop",keyframes:d,name:h,motionValue:m,element:x,...g}){var b;super(),this.stop=()=>{var j,C;this._animation&&(this._animation.stop(),(j=this.stopTimeline)==null||j.call(this)),(C=this.keyframeResolver)==null||C.cancel()},this.createdAt=Wn.now();const v={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:o,repeatType:c,name:h,motionValue:m,element:x,...g},S=(x==null?void 0:x.KeyframeResolver)||mv;this.keyframeResolver=new S(d,(j,C,k)=>this.onKeyframesResolved(j,C,v,!k),h,m,x),(b=this.keyframeResolver)==null||b.scheduleResolve()}onKeyframesResolved(t,n,r,i){var k,N;this.keyframeResolver=void 0;const{name:o,type:c,velocity:d,delay:h,isHandoff:m,onUpdate:x}=r;this.resolvedAt=Wn.now();let g=!0;LH(t,o,c,d)||(g=!1,(ei.instantAnimations||!h)&&(x==null||x(th(t,r,n))),t[0]=t[t.length-1],xv(r),r.repeat=0);const S={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>FH?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},b=g&&!m&&VH(S),j=(N=(k=S.motionValue)==null?void 0:k.owner)==null?void 0:N.current;let C;if(b)try{C=new zH({...S,element:j})}catch{C=new nh(S)}else C=new nh(S);C.finished.then(()=>{this.notifyFinished()}).catch(qr),this.pendingTimeline&&(this.stopTimeline=C.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=C}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),TH()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}class qH{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t){const n=this.animations.map(r=>r.attachTimeline(t));return()=>{n.forEach((r,i)=>{r&&r(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return _T(this.animations,"duration")}get iterationDuration(){return _T(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(n=>n[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function _T(e,t){let n=0;for(let r=0;r<e.length;r++){const i=e[r][t];i!==null&&i>n&&(n=i)}return n}class KH extends qH{then(t,n){return this.finished.finally(t).then(()=>{})}}function OT(e,t,n,r=0,i=1){const o=Array.from(e).sort((m,x)=>m.sortNodePosition(x)).indexOf(t),c=e.size,d=(c-1)*r;return typeof n=="function"?n(o,c):i===1?o*r:d-o*r}const zT=30,GH=e=>!isNaN(parseFloat(e)),fu={current:void 0};class YH{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var o;const i=Wn.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((o=this.events.change)==null||o.notify(this.current),this.dependents))for(const c of this.dependents)c.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Wn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=GH(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Vx);const r=this.events[t].add(n);return t==="change"?()=>{r(),_t.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return fu.current&&fu.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=Wn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>zT)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,zT);return PN(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ni(e,t){return new YH(e,t)}function PT(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function vv(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?PT(n,e):n}const WH={type:"spring",stiffness:500,damping:25,restSpeed:10},XH=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),QH={type:"keyframes",duration:.8},ZH={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},JH=(e,{keyframes:t})=>t.length>2?QH:xl.has(e)?e.startsWith("scale")?XH(t[1]):WH:ZH,e9=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function t9(e){for(const t in e)if(!e9.has(t))return!0;return!1}const yv=(e,t,n,r={},i,o)=>c=>{const d=vv(r,e)||{},h=d.delay||r.delay||0;let{elapsed:m=0}=r;m=m-Yn(h);const x={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...d,delay:-m,onUpdate:v=>{t.set(v),d.onUpdate&&d.onUpdate(v)},onComplete:()=>{c(),d.onComplete&&d.onComplete()},name:e,motionValue:t,element:o?void 0:i};t9(d)||Object.assign(x,JH(e,x)),x.duration&&(x.duration=Yn(x.duration)),x.repeatDelay&&(x.repeatDelay=Yn(x.repeatDelay)),x.from!==void 0&&(x.keyframes[0]=x.from);let g=!1;if((x.type===!1||x.duration===0&&!x.repeatDelay)&&(xv(x),x.delay===0&&(g=!0)),(ei.instantAnimations||ei.skipAnimations||i!=null&&i.shouldSkipAnimations||d.skipAnimations)&&(g=!0,xv(x),x.delay=0),x.allowFlatten=!d.type&&!d.ease,g&&!o&&t.get()!==void 0){const v=th(x.keyframes,d);if(v!==void 0){_t.update(()=>{x.onUpdate(v),x.onComplete()});return}}return d.isSync?new nh(x):new HH(x)},n9=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function r9(e){const t=n9.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}const s9=4;function LT(e,t,n=1){Ja(n<=s9,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,i]=r9(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const c=o.trim();return DN(c)?parseFloat(c):c}return Gx(i)?LT(i,t,n+1):i}function IT(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function bv(e,t,n,r){if(typeof t=="function"){const[i,o]=IT(r);t=t(n!==void 0?n:e.custom,i,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,o]=IT(r);t=t(n!==void 0?n:e.custom,i,o)}return t}function oo(e,t,n){const r=e.getProps();return bv(r,t,n!==void 0?n:r.custom,e)}const $T=new Set(["width","height","top","left","right","bottom",...gl]),wv=e=>Array.isArray(e);function a9(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,ni(n))}function i9(e){return wv(e)?e[e.length-1]||0:e}function o9(e,t){const n=oo(e,t);let{transitionEnd:r={},transition:i={},...o}=n||{};o={...o,...r};for(const c in o){const d=i9(o[c]);a9(e,c,d)}}const Sn=e=>!!(e&&e.getVelocity);function l9(e){return!!(Sn(e)&&e.add)}function Sv(e,t){const n=e.getValue("willChange");if(l9(n))return n.add(t);if(!n&&ei.WillChange){const r=new ei.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function jv(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const BT="data-"+jv("framerAppearId");function UT(e){return e.props[BT]}function c9({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Cv(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:o,transitionEnd:c,...d}=t;const h=e.getDefaultTransition();o=o?PT(o,h):h;const m=o==null?void 0:o.reduceMotion,x=o==null?void 0:o.skipAnimations;r&&(o=r);const g=[],v=i&&e.animationState&&e.animationState.getState()[i],S=o==null?void 0:o.path;S&&S.animateVisualElement(e,d,o,n,g);for(const b in d){const j=e.getValue(b,e.latestValues[b]??null),C=d[b];if(C===void 0||v&&c9(v,b))continue;const k={delay:n,...vv(o||{},b)};x&&(k.skipAnimations=!0);const N=j.get();if(N!==void 0&&!j.isAnimating()&&!Array.isArray(C)&&C===N&&!k.velocity){_t.update(()=>j.set(C));continue}let E=!1;if(window.MotionHandoffAnimation){const _=UT(e);if(_){const z=window.MotionHandoffAnimation(_,b,_t);z!==null&&(k.startTime=z,E=!0)}}Sv(e,b);const R=m??e.shouldReduceMotion;j.start(yv(b,j,C,R&&$T.has(b)?{type:!1}:k,e,E));const A=j.animation;A&&g.push(A)}if(c){const b=()=>_t.update(()=>{c&&o9(e,c)});g.length?Promise.all(g).then(b):b()}return g}function kv(e,t,n={}){var h;const r=oo(e,t,n.type==="exit"?(h=e.presenceContext)==null?void 0:h.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const o=r?()=>Promise.all(Cv(e,r,n)):()=>Promise.resolve(),c=e.variantChildren&&e.variantChildren.size?(m=0)=>{const{delayChildren:x=0,staggerChildren:g,staggerDirection:v}=i;return u9(e,t,m,x,g,v,n)}:()=>Promise.resolve(),{when:d}=i;if(d){const[m,x]=d==="beforeChildren"?[o,c]:[c,o];return m().then(()=>x())}else return Promise.all([o(),c(n.delay)])}function u9(e,t,n=0,r=0,i=0,o=1,c){const d=[];for(const h of e.variantChildren)h.notify("AnimationStart",t),d.push(kv(h,t,{...c,delay:n+(typeof r=="function"?0:r)+OT(e.variantChildren,h,r,i,o)}).then(()=>h.notify("AnimationComplete",t)));return Promise.all(d)}function d9(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(o=>kv(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=kv(e,t,n);else{const i=typeof t=="function"?oo(e,t,n.custom):t;r=Promise.all(Cv(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const f9={test:e=>e==="auto",parse:e=>e},VT=e=>t=>t.test(e),FT=[hl,Be,Ls,ma,B8,$8,f9],HT=e=>FT.find(VT(e));function h9(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||ON(e):!0}const m9=new Set(["brightness","contrast","saturate","opacity"]);function p9(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Yx)||[];if(!r)return e;const i=n.replace(r,"");let o=m9.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const g9=/\b([a-z-]*)\(.*?\)/gu,Nv={...ps,getAnimatableNone:e=>{const t=e.match(g9);return t?t.map(p9).join(" "):e}},Tv={...ps,getAnimatableNone:e=>{const t=ps.parse(e);return ps.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},qT={...hl,transform:Math.round},rh={borderWidth:Be,borderTopWidth:Be,borderRightWidth:Be,borderBottomWidth:Be,borderLeftWidth:Be,borderRadius:Be,borderTopLeftRadius:Be,borderTopRightRadius:Be,borderBottomRightRadius:Be,borderBottomLeftRadius:Be,width:Be,maxWidth:Be,height:Be,maxHeight:Be,top:Be,right:Be,bottom:Be,left:Be,inset:Be,insetBlock:Be,insetBlockStart:Be,insetBlockEnd:Be,insetInline:Be,insetInlineStart:Be,insetInlineEnd:Be,padding:Be,paddingTop:Be,paddingRight:Be,paddingBottom:Be,paddingLeft:Be,paddingBlock:Be,paddingBlockStart:Be,paddingBlockEnd:Be,paddingInline:Be,paddingInlineStart:Be,paddingInlineEnd:Be,margin:Be,marginTop:Be,marginRight:Be,marginBottom:Be,marginLeft:Be,marginBlock:Be,marginBlockStart:Be,marginBlockEnd:Be,marginInline:Be,marginInlineStart:Be,marginInlineEnd:Be,fontSize:Be,backgroundPositionX:Be,backgroundPositionY:Be,...{rotate:ma,pathRotation:ma,rotateX:ma,rotateY:ma,rotateZ:ma,scale:Zf,scaleX:Zf,scaleY:Zf,scaleZ:Zf,skew:ma,skewX:ma,skewY:ma,distance:Be,translateX:Be,translateY:Be,translateZ:Be,x:Be,y:Be,z:Be,perspective:Be,transformPerspective:Be,opacity:iu,originX:tT,originY:tT,originZ:Be},zIndex:qT,fillOpacity:iu,strokeOpacity:iu,numOctaves:qT},x9={...rh,color:un,backgroundColor:un,outlineColor:un,fill:un,stroke:un,borderColor:un,borderTopColor:un,borderRightColor:un,borderBottomColor:un,borderLeftColor:un,filter:Nv,WebkitFilter:Nv,mask:Tv,WebkitMask:Tv},KT=e=>x9[e],v9=new Set([Nv,Tv]);function GT(e,t){let n=KT(e);return v9.has(n)||(n=ps),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const y9=new Set(["auto","none","0"]);function b9(e,t,n){let r=0,i;for(;r<e.length&&!i;){const o=e[r];typeof o=="string"&&!y9.has(o)&&pl(o).values.length&&(i=e[r]),r++}if(i&&n)for(const o of t)e[o]=GT(n,i)}class w9 extends mv{constructor(t,n,r,i,o){super(t,n,r,i,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let x=0;x<t.length;x++){let g=t[x];if(typeof g=="string"&&(g=g.trim(),Gx(g))){const v=LT(g,n.current);v!==void 0&&(t[x]=v),x===t.length-1&&(this.finalKeyframe=g)}}if(this.resolveNoneKeyframes(),!$T.has(r)||t.length!==2)return;const[i,o]=t,c=HT(i),d=HT(o),h=JN(i),m=JN(o);if(h!==m&&ti[r]){this.needsMeasurement=!0;return}if(c!==d)if(wT(c)&&wT(d))for(let x=0;x<t.length;x++){const g=t[x];typeof g=="string"&&(t[x]=parseFloat(g))}else ti[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)(t[i]===null||h9(t[i]))&&r.push(i);r.length&&b9(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ti[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var d;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);const o=r.length-1,c=r[o];r[o]=ti[n](t.measureViewportBox(),window.getComputedStyle(t.current)),c!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=c),(d=this.removedTransforms)!=null&&d.length&&this.removedTransforms.forEach(([h,m])=>{t.getValue(h).set(m)}),this.resolveNoneKeyframes()}}const Ev=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function Rv(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;t&&(r=t.current);const i=(n==null?void 0:n[e])??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(r=>r!=null)}const Av=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function S9(e){return _N(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Mv}=XN(queueMicrotask,!1),gs={x:!1,y:!1};function YT(){return gs.x||gs.y}function j9(e){return e==="x"||e==="y"?gs[e]?null:(gs[e]=!0,()=>{gs[e]=!1}):gs.x||gs.y?null:(gs.x=gs.y=!0,()=>{gs.x=gs.y=!1})}function WT(e,t){const n=Rv(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function C9(e){return!(e.pointerType==="touch"||YT())}function k9(e,t,n={}){const[r,i,o]=WT(e,n);return r.forEach(c=>{let d=!1,h=!1,m;const x=()=>{c.removeEventListener("pointerleave",b)},g=C=>{m&&(m(C),m=void 0),x()},v=C=>{d=!1,window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v),h&&(h=!1,g(C))},S=()=>{d=!0,window.addEventListener("pointerup",v,i),window.addEventListener("pointercancel",v,i)},b=C=>{if(C.pointerType!=="touch"){if(d){h=!0;return}g(C)}},j=C=>{if(!C9(C))return;h=!1;const k=t(c,C);typeof k=="function"&&(m=k,c.addEventListener("pointerleave",b,i))};c.addEventListener("pointerenter",j,i),c.addEventListener("pointerdown",S,i)}),o}const XT=(e,t)=>t?e===t?!0:XT(e,t.parentElement):!1,Dv=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,N9=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function T9(e){return N9.has(e.tagName)||e.isContentEditable===!0}const E9=new Set(["INPUT","SELECT","TEXTAREA"]);function R9(e){return E9.has(e.tagName)||e.isContentEditable===!0}const sh=new WeakSet;function QT(e){return t=>{t.key==="Enter"&&e(t)}}function _v(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const A9=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=QT(()=>{if(sh.has(n))return;_v(n,"down");const i=QT(()=>{_v(n,"up")}),o=()=>_v(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function ZT(e){return Dv(e)&&!YT()}const JT=new WeakSet;function M9(e,t,n={}){const[r,i,o]=WT(e,n),c=d=>{const h=d.currentTarget;if(!ZT(d)||JT.has(d))return;sh.add(h),n.stopPropagation&&JT.add(d);const m=t(h,d),x={...i,capture:!0},g=(b,j)=>{window.removeEventListener("pointerup",v,x),window.removeEventListener("pointercancel",S,x),sh.has(h)&&sh.delete(h),ZT(b)&&typeof m=="function"&&m(b,{success:j})},v=b=>{g(b,h===window||h===document||n.useGlobalTarget||XT(h,b.target))},S=b=>{g(b,!1)};window.addEventListener("pointerup",v,x),window.addEventListener("pointercancel",S,x)};return r.forEach(d=>{(n.useGlobalTarget?window:d).addEventListener("pointerdown",c,i),S9(d)&&(d.addEventListener("focus",m=>A9(m,i)),!T9(d)&&!d.hasAttribute("tabindex")&&(d.tabIndex=0))}),o}function ah(e){return _N(e)&&"ownerSVGElement"in e}const ih=new WeakMap;let ri;const e2=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+"Size"]:ah(r)&&"getBBox"in r?r.getBBox()[t]:r[n],D9=e2("inline","width","offsetWidth"),_9=e2("block","height","offsetHeight");function O9({target:e,borderBoxSize:t}){var n;(n=ih.get(e))==null||n.forEach(r=>{r(e,{get width(){return D9(e,t)},get height(){return _9(e,t)}})})}function z9(e){e.forEach(O9)}function P9(){typeof ResizeObserver>"u"||(ri=new ResizeObserver(z9))}function L9(e,t){ri||P9();const n=Rv(e);return n.forEach(r=>{let i=ih.get(r);i||(i=new Set,ih.set(r,i)),i.add(t),ri==null||ri.observe(r)}),()=>{n.forEach(r=>{const i=ih.get(r);i==null||i.delete(t),i!=null&&i.size||ri==null||ri.unobserve(r)})}}const oh=new Set;let vl;function I9(){vl=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};oh.forEach(t=>t(e))},window.addEventListener("resize",vl)}function $9(e){return oh.add(e),vl||I9(),()=>{oh.delete(e),!oh.size&&typeof vl=="function"&&(window.removeEventListener("resize",vl),vl=void 0)}}function t2(e,t){return typeof e=="function"?$9(e):L9(e,t)}function n2(e){return ah(e)&&e.tagName==="svg"}function B9(...e){const t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],o=e[2+n],c=e[3+n],d=mT(i,o,c);return t?d(r):d}const U9=[...FT,un,ps],V9=e=>U9.find(VT(e)),r2=()=>({translate:0,scale:1,origin:0,originPoint:0}),yl=()=>({x:r2(),y:r2()}),s2=()=>({min:0,max:0}),dn=()=>({x:s2(),y:s2()}),hu=new WeakMap;function lh(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function mu(e){return typeof e=="string"||Array.isArray(e)}const Ov=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],zv=["initial",...Ov];function ch(e){return lh(e.animate)||zv.some(t=>mu(e[t]))}function a2(e){return!!(ch(e)||e.variants)}function F9(e,t,n){for(const r in t){const i=t[r],o=n[r];if(Sn(i))e.addValue(r,i);else if(Sn(o))e.addValue(r,ni(i,{owner:e}));else if(o!==i)if(e.hasValue(r)){const c=e.getValue(r);c.liveStyle===!0?c.jump(i):c.hasAnimated||c.set(i)}else{const c=e.getStaticValue(r);e.addValue(r,ni(c!==void 0?c:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Pv={current:null},i2={current:!1},H9=typeof window<"u";function q9(){if(i2.current=!0,!!H9)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Pv.current=e.matches;e.addEventListener("change",t),t()}else Pv.current=!1}const o2=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let uh={};function l2(e){uh=e}function K9(){return uh}class c2{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,skipAnimations:o,blockInitialAnimation:c,visualState:d},h={}){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=mv,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=()=>{const S=Wn.now();this.renderScheduledAt<S&&(this.renderScheduledAt=S,_t.render(this.render,!1,!0))};const{latestValues:m,renderState:x}=d;this.latestValues=m,this.baseTarget={...m},this.initialValues=n.initial?{...m}:{},this.renderState=x,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=o,this.options=h,this.blockInitialAnimation=!!c,this.isControllingVariants=ch(n),this.isVariantNode=a2(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:g,...v}=this.scrapeMotionValuesFromProps(n,{},this);for(const S in v){const b=v[S];m[S]!==void 0&&Sn(b)&&b.set(m[S])}}mount(t){var n,r;if(this.hasBeenMounted)for(const i in this.initialValues)(n=this.values.get(i))==null||n.jump(this.initialValues[i]),this.latestValues[i]=this.initialValues[i];this.current=t,hu.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,o)=>this.bindToMotionValue(o,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(i2.current||q9(),this.shouldReduceMotion=Pv.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),ha(this.notifyUpdate),ha(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&DT.has(t)&&this.current instanceof HTMLElement){const{factory:c,keyframes:d,times:h,ease:m,duration:x}=n.accelerate,g=new RT({element:this.current,name:t,keyframes:d,times:h,ease:m,duration:Yn(x)}),v=c(g);this.valueSubscriptions.set(t,()=>{v(),g.cancel()});return}const r=xl.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",c=>{this.latestValues[t]=c,this.props.onUpdate&&_t.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),o&&o()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in uh){const n=uh[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):dn()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<o2.length;r++){const i=o2[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o="on"+i,c=t[o];c&&(this.propEventSubscriptions[i]=this.on(i,c))}this.prevMotionValues=F9(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=ni(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(DN(r)||ON(r))?r=parseFloat(r):!V9(r)&&ps.test(n)&&(r=GT(t,n)),this.setBaseTarget(t,Sn(r)?r.get():r)),Sn(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var o;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const c=bv(this.props,n,(o=this.presenceContext)==null?void 0:o.custom);c&&(r=c[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Sn(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Vx),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Mv.render(this.render)}}class u2 extends c2{constructor(){super(...arguments),this.KeyframeResolver=w9}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Sn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class si{constructor(t){this.isMounted=!1,this.node=t}update(){}}function d2({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function G9({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Y9(e,t){if(!t)return e;const 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 Lv(e){return e===void 0||e===1}function Iv({scale:e,scaleX:t,scaleY:n}){return!Lv(e)||!Lv(t)||!Lv(n)}function lo(e){return Iv(e)||f2(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function f2(e){return h2(e.x)||h2(e.y)}function h2(e){return e&&e!=="0%"}function dh(e,t,n){const r=e-n,i=t*r;return n+i}function m2(e,t,n,r,i){return i!==void 0&&(e=dh(e,i,r)),dh(e,n,r)+t}function $v(e,t=0,n=1,r,i){e.min=m2(e.min,t,n,r,i),e.max=m2(e.max,t,n,r,i)}function p2(e,{x:t,y:n}){$v(e.x,t.translate,t.scale,t.originPoint),$v(e.y,n.translate,n.scale,n.originPoint)}const g2=.999999999999,x2=1.0000000000001;function W9(e,t,n,r=!1){var d;const i=n.length;if(!i)return;t.x=t.y=1;let o,c;for(let h=0;h<i;h++){o=n[h],c=o.projectionDelta;const{visualElement:m}=o.options;m&&m.props.style&&m.props.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&(Is(e.x,-o.scroll.offset.x),Is(e.y,-o.scroll.offset.y)),c&&(t.x*=c.x.scale,t.y*=c.y.scale,p2(e,c)),r&&lo(o.latestValues)&&fh(e,o.latestValues,(d=o.layout)==null?void 0:d.layoutBox))}t.x<x2&&t.x>g2&&(t.x=1),t.y<x2&&t.y>g2&&(t.y=1)}function Is(e,t){e.min+=t,e.max+=t}function v2(e,t,n,r,i=.5){const o=Ot(e.min,e.max,i);$v(e,t,n,o,r)}function y2(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function fh(e,t,n){const r=n??e;v2(e.x,y2(t.x,r.x),t.scaleX,t.scale,t.originX),v2(e.y,y2(t.y,r.y),t.scaleY,t.scale,t.originY)}function b2(e,t){return d2(Y9(e.getBoundingClientRect(),t))}function X9(e,t,n){const r=b2(e,n),{scroll:i}=t;return i&&(Is(r.x,i.offset.x),Is(r.y,i.offset.y)),r}const Q9={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Z9=gl.length;function J9(e,t,n){let r="",i=!0;for(let c=0;c<Z9;c++){const d=gl[c],h=e[d];if(h===void 0)continue;let m=!0;if(typeof h=="number")m=h===(d.startsWith("scale")?1:0);else{const x=parseFloat(h);m=d.startsWith("scale")?x===1:x===0}if(!m||n){const x=Av(h,rh[d]);if(!m){i=!1;const g=Q9[d]||d;r+=`${g}(${x}) `}n&&(t[d]=x)}}const o=e.pathRotation;return o&&(i=!1,r+=`rotate(${Av(o,rh.pathRotation)}) `),r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function Bv(e,t,n){const{style:r,vars:i,transformOrigin:o}=e;let c=!1,d=!1;for(const h in t){const m=t[h];if(xl.has(h)){c=!0;continue}else if(ZN(h)){i[h]=m;continue}else{const x=Av(m,rh[h]);h.startsWith("origin")?(d=!0,o[h]=x):r[h]=x}}if(t.transform||(c||n?r.transform=J9(t,e.transform,n):r.transform&&(r.transform="none")),d){const{originX:h="50%",originY:m="50%",originZ:x=0}=o;r.transformOrigin=`${h} ${m} ${x}`}}function w2(e,{style:t,vars:n},r,i){const o=e.style;let c;for(c in t)o[c]=t[c];i==null||i.applyProjectionStyles(o,r);for(c in n)o.setProperty(c,n[c])}function S2(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const pu={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Be.test(e))e=parseFloat(e);else return e;const n=S2(e,t.target.x),r=S2(e,t.target.y);return`${n}% ${r}%`}},e7={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=ps.parse(e);if(i.length>5)return r;const o=ps.createTransformer(e),c=typeof i[0]!="number"?1:0,d=n.x.scale*t.x,h=n.y.scale*t.y;i[0+c]/=d,i[1+c]/=h;const m=Ot(d,h,.5);return typeof i[2+c]=="number"&&(i[2+c]/=m),typeof i[3+c]=="number"&&(i[3+c]/=m),o(i)}},Uv={borderRadius:{...pu,applyTo:[...Ev]},borderTopLeftRadius:pu,borderTopRightRadius:pu,borderBottomLeftRadius:pu,borderBottomRightRadius:pu,boxShadow:e7};function j2(e,{layout:t,layoutId:n}){return xl.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Uv[e]||e==="opacity")}function Vv(e,t,n){var c;const r=e.style,i=t==null?void 0:t.style,o={};if(!r)return o;for(const d in r)(Sn(r[d])||i&&Sn(i[d])||j2(d,e)||((c=n==null?void 0:n.getValue(d))==null?void 0:c.liveStyle)!==void 0)&&(o[d]=r[d]);return o}function t7(e){return window.getComputedStyle(e)}class C2 extends u2{constructor(){super(...arguments),this.type="html",this.renderInstance=w2}readValueFromInstance(t,n){var r;if(xl.has(n))return(r=this.projection)!=null&&r.isProjecting?cv(n):SH(t,n);{const i=t7(t),o=(ZN(n)?i.getPropertyValue(n):i[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return b2(t,n)}build(t,n,r){Bv(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Vv(t,n,r)}}function n7(e,t){return e in t}class r7 extends c2{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,n){if(n7(n,t)){const r=t[n];if(typeof r=="string"||typeof r=="number")return r}}getBaseTargetFromProps(){}removeValueFromRenderState(t,n){delete n.output[t]}measureInstanceViewportBox(){return dn()}build(t,n){Object.assign(t.output,n)}renderInstance(t,{output:n}){Object.assign(t,n)}sortInstanceNodePosition(){return 0}}const s7={offset:"stroke-dashoffset",array:"stroke-dasharray"},a7={offset:"strokeDashoffset",array:"strokeDasharray"};function i7(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?s7:a7;e[o.offset]=`${-r}`,e[o.array]=`${t} ${n}`}const o7=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function k2(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:o=1,pathOffset:c=0,...d},h,m,x){if(Bv(e,d,m),h){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:g,style:v}=e;g.transform&&(v.transform=g.transform,delete g.transform),(v.transform||g.transformOrigin)&&(v.transformOrigin=g.transformOrigin??"50% 50%",delete g.transformOrigin),v.transform&&(v.transformBox=(x==null?void 0:x.transformBox)??"fill-box",delete g.transformBox);for(const S of o7)g[S]!==void 0&&(v[S]=g[S],delete g[S]);t!==void 0&&(g.x=t),n!==void 0&&(g.y=n),r!==void 0&&(g.scale=r),i!==void 0&&i7(g,i,o,c,!1)}const N2=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"]),T2=e=>typeof e=="string"&&e.toLowerCase()==="svg";function l7(e,t,n,r){w2(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(N2.has(i)?i:jv(i),t.attrs[i])}function E2(e,t,n){const r=Vv(e,t,n);for(const i in e)if(Sn(e[i])||Sn(t[i])){const o=gl.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[o]=e[i]}return r}class R2 extends u2{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=dn}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(xl.has(n)){const r=KT(n);return r&&r.default||0}return n=N2.has(n)?n:jv(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return E2(t,n,r)}build(t,n,r){k2(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,i){l7(t,n,r,i)}mount(t){this.isSVGTag=T2(t.tagName),super.mount(t)}}const c7=zv.length;function A2(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?A2(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<c7;n++){const r=zv[n],i=e.props[r];(mu(i)||i===!1)&&(t[r]=i)}return t}function M2(e,t){if(!Array.isArray(t))return!1;const 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}const u7=[...Ov].reverse(),d7=Ov.length;function f7(e){return t=>Promise.all(t.map(({animation:n,options:r})=>d9(e,n,r)))}function h7(e){let t=f7(e),n=D2(),r=!0,i=!1;const o=m=>(x,g)=>{var S;const v=oo(e,g,m==="exit"?(S=e.presenceContext)==null?void 0:S.custom:void 0);if(v){const{transition:b,transitionEnd:j,...C}=v;x={...x,...C,...j}}return x};function c(m){t=m(e)}function d(m){const{props:x}=e,g=A2(e.parent)||{},v=[],S=new Set;let b={},j=1/0;for(let k=0;k<d7;k++){const N=u7[k],E=n[N],R=x[N]!==void 0?x[N]:g[N],A=mu(R),_=N===m?E.isActive:null;_===!1&&(j=k);let z=R===g[N]&&R!==x[N]&&A;if(z&&(r||i)&&e.manuallyAnimateOnMount&&(z=!1),E.protectedKeys={...b},!E.isActive&&_===null||!R&&!E.prevProp||lh(R)||typeof R=="boolean")continue;if(N==="exit"&&E.isActive&&_!==!0){E.prevResolvedValues&&(b={...b,...E.prevResolvedValues});continue}const D=m7(E.prevProp,R);let V=D||N===m&&E.isActive&&!z&&A||k>j&&A,I=!1;const Q=Array.isArray(R)?R:[R];let B=Q.reduce(o(N),{});_===!1&&(B={});const{prevResolvedValues:H={}}=E,ee={...H,...B},W=K=>{V=!0,S.has(K)&&(I=!0,S.delete(K)),E.needsAnimating[K]=!0;const ne=e.getValue(K);ne&&(ne.liveStyle=!1)};for(const K in ee){const ne=B[K],q=H[K];if(b.hasOwnProperty(K))continue;let P=!1;wv(ne)&&wv(q)?P=!M2(ne,q)||D:P=ne!==q,P?ne!=null?W(K):S.add(K):ne!==void 0&&S.has(K)?W(K):E.protectedKeys[K]=!0}E.prevProp=R,E.prevResolvedValues=B,E.isActive&&(b={...b,...B}),(r||i)&&e.blockInitialAnimation&&(V=!1);const M=z&&D;V&&(!M||I)&&v.push(...Q.map(K=>{const ne={type:N};if(typeof K=="string"&&(r||i)&&!M&&e.manuallyAnimateOnMount&&e.parent){const{parent:q}=e,P=oo(q,K);if(q.enteringChildren&&P){const{delayChildren:L}=P.transition||{};ne.delay=OT(q.enteringChildren,e,L)}}return{animation:K,options:ne}}))}if(S.size){const k={};if(typeof x.initial!="boolean"){const N=oo(e,Array.isArray(x.initial)?x.initial[0]:x.initial);N&&N.transition&&(k.transition=N.transition)}S.forEach(N=>{const E=e.getBaseTarget(N),R=e.getValue(N);R&&(R.liveStyle=!0),k[N]=E??null}),v.push({animation:k})}let C=!!v.length;return r&&(x.initial===!1||x.initial===x.animate)&&!e.manuallyAnimateOnMount&&(C=!1),r=!1,i=!1,C?t(v):Promise.resolve()}function h(m,x){var v;if(n[m].isActive===x)return Promise.resolve();(v=e.variantChildren)==null||v.forEach(S=>{var b;return(b=S.animationState)==null?void 0:b.setActive(m,x)}),n[m].isActive=x;const g=d(m);for(const S in n)n[S].protectedKeys={};return g}return{animateChanges:d,setActive:h,setAnimateFunction:c,getState:()=>n,reset:()=>{n=D2(),i=!0}}}function m7(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!M2(t,e):!1}function co(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function D2(){return{animate:co(!0),whileInView:co(),whileHover:co(),whileTap:co(),whileDrag:co(),whileFocus:co(),exit:co()}}function Fv(e,t){e.min=t.min,e.max=t.max}function xs(e,t){Fv(e.x,t.x),Fv(e.y,t.y)}function _2(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const O2=1e-4,p7=1-O2,g7=1+O2,z2=.01,x7=0-z2,v7=0+z2;function Xn(e){return e.max-e.min}function y7(e,t,n){return Math.abs(e-t)<=n}function P2(e,t,n,r=.5){e.origin=r,e.originPoint=Ot(t.min,t.max,e.origin),e.scale=Xn(n)/Xn(t),e.translate=Ot(n.min,n.max,e.origin)-e.originPoint,(e.scale>=p7&&e.scale<=g7||isNaN(e.scale))&&(e.scale=1),(e.translate>=x7&&e.translate<=v7||isNaN(e.translate))&&(e.translate=0)}function gu(e,t,n,r){P2(e.x,t.x,n.x,r?r.originX:void 0),P2(e.y,t.y,n.y,r?r.originY:void 0)}function L2(e,t,n,r=0){const i=r?Ot(n.min,n.max,r):n.min;e.min=i+t.min,e.max=e.min+Xn(t)}function b7(e,t,n,r){L2(e.x,t.x,n.x,r==null?void 0:r.x),L2(e.y,t.y,n.y,r==null?void 0:r.y)}function I2(e,t,n,r=0){const i=r?Ot(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+Xn(t)}function hh(e,t,n,r){I2(e.x,t.x,n.x,r==null?void 0:r.x),I2(e.y,t.y,n.y,r==null?void 0:r.y)}function $2(e,t,n,r,i){return e-=t,e=dh(e,1/n,r),i!==void 0&&(e=dh(e,1/i,r)),e}function w7(e,t=0,n=1,r=.5,i,o=e,c=e){if(Ls.test(t)&&(t=parseFloat(t),t=Ot(c.min,c.max,t/100)-c.min),typeof t!="number")return;let d=Ot(o.min,o.max,r);e===o&&(d-=t),e.min=$2(e.min,t,n,d,i),e.max=$2(e.max,t,n,d,i)}function B2(e,t,[n,r,i],o,c){w7(e,t[n],t[r],t[i],t.scale,o,c)}const S7=["x","scaleX","originX"],j7=["y","scaleY","originY"];function U2(e,t,n,r){B2(e.x,t,S7,n?n.x:void 0,r?r.x:void 0),B2(e.y,t,j7,n?n.y:void 0,r?r.y:void 0)}function V2(e){return e.translate===0&&e.scale===1}function F2(e){return V2(e.x)&&V2(e.y)}function H2(e,t){return e.min===t.min&&e.max===t.max}function C7(e,t){return H2(e.x,t.x)&&H2(e.y,t.y)}function q2(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function K2(e,t){return q2(e.x,t.x)&&q2(e.y,t.y)}function G2(e){return Xn(e.x)/Xn(e.y)}function Y2(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function $s(e){return[e("x"),e("y")]}function k7(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y,c=(n==null?void 0:n.z)||0;if((i||o||c)&&(r=`translate3d(${i}px, ${o}px, ${c}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:m,rotate:x,pathRotation:g,rotateX:v,rotateY:S,skewX:b,skewY:j}=n;m&&(r=`perspective(${m}px) ${r}`),x&&(r+=`rotate(${x}deg) `),g&&(r+=`rotate(${g}deg) `),v&&(r+=`rotateX(${v}deg) `),S&&(r+=`rotateY(${S}deg) `),b&&(r+=`skewX(${b}deg) `),j&&(r+=`skewY(${j}deg) `)}const d=e.x.scale*t.x,h=e.y.scale*t.y;return(d!==1||h!==1)&&(r+=`scale(${d}, ${h})`),r||"none"}const N7=Ev.length,W2=e=>typeof e=="string"?parseFloat(e):e,X2=e=>typeof e=="number"||Be.test(e);function T7(e,t,n,r,i,o){i?(e.opacity=Ot(0,n.opacity??1,E7(r)),e.opacityExit=Ot(t.opacity??1,0,R7(r))):o&&(e.opacity=Ot(t.opacity??1,n.opacity??1,r));for(let c=0;c<N7;c++){const d=Ev[c];let h=Q2(t,d),m=Q2(n,d);if(h===void 0&&m===void 0)continue;h||(h=0),m||(m=0),h===0||m===0||X2(h)===X2(m)?(e[d]=Math.max(Ot(W2(h),W2(m),r),0),(Ls.test(m)||Ls.test(h))&&(e[d]+="%")):e[d]=m}(t.rotate||n.rotate)&&(e.rotate=Ot(t.rotate||0,n.rotate||0,r))}function Q2(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const E7=Z2(0,.5,VN),R7=Z2(.5,.95,qr);function Z2(e,t,n){return r=>r<e?0:r>t?1:n(fl(e,t,r))}function J2(e,t,n){const r=Sn(e)?e:ni(e);return r.start(yv("",r,t,n)),r.animation}function xu(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}const A7=(e,t)=>e.depth-t.depth;class M7{constructor(){this.children=[],this.isDirty=!1}add(t){Ux(this.children,t),this.isDirty=!0}remove(t){ul(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(A7),this.isDirty=!1,this.children.forEach(t)}}function D7(e,t){const n=Wn.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(ha(r),e(o-t))};return _t.setup(r,!0),()=>ha(r)}function mh(e){return Sn(e)?e.get():e}class _7{constructor(){this.members=[]}add(t){Ux(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const i=r.instance;(!i||i.isConnected===!1)&&!r.snapshot&&(ul(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(ul(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){var n;for(let r=this.members.indexOf(t)-1;r>=0;r--){const i=this.members[r];if(i.isPresent!==!1&&((n=i.instance)==null?void 0:n.isConnected)!==!1)return this.promote(i),!0}return!1}promote(t,n){var i;const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:o}=r.options,{layoutDependency:c}=t.options;(o===void 0||o!==c)&&(t.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),(i=t.root)!=null&&i.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,i,o,c;(r=(n=t.options).onExitComplete)==null||r.call(n),(c=(i=t.resumingFrom)==null?void 0:(o=i.options).onExitComplete)==null||c.call(o)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const ph={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Hv=["","X","Y","Z"],O7=1e3;let z7=0;function qv(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function eE(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=UT(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",_t,!(i||o))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&eE(r)}function tE({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(c={},d=t==null?void 0:t()){this.id=z7++,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.layoutVersion=0,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(I7),this.nodes.forEach(H7),this.nodes.forEach(q7),this.nodes.forEach($7)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=c,this.root=d?d.root||d:this,this.path=d?[...d.path,d]:[],this.parent=d,this.depth=d?d.depth+1:0;for(let h=0;h<this.path.length;h++)this.path[h].shouldResetTransform=!0;this.root===this&&(this.nodes=new M7)}addEventListener(c,d){return this.eventHandlers.has(c)||this.eventHandlers.set(c,new Vx),this.eventHandlers.get(c).add(d)}notifyListeners(c,...d){const h=this.eventHandlers.get(c);h&&h.notify(...d)}hasListeners(c){return this.eventHandlers.has(c)}mount(c){if(this.instance)return;this.isSVG=ah(c)&&!n2(c),this.instance=c;const{layoutId:d,layout:h,visualElement:m}=this.options;if(m&&!m.current&&m.mount(c),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(h||d)&&(this.isLayoutDirty=!0),e){let x,g=0;const v=()=>this.root.updateBlockedByResize=!1;_t.read(()=>{g=window.innerWidth}),e(c,()=>{const S=window.innerWidth;S!==g&&(g=S,this.root.updateBlockedByResize=!0,x&&x(),x=D7(v,250),ph.hasAnimatedSinceResize&&(ph.hasAnimatedSinceResize=!1,this.nodes.forEach(sE)))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&m&&(d||h)&&this.addEventListener("didUpdate",({delta:x,hasLayoutChanged:g,hasRelativeLayoutChanged:v,layout:S})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||m.getDefaultTransition()||X7,{onLayoutAnimationStart:j,onLayoutAnimationComplete:C}=m.getProps(),k=!this.targetLayout||!K2(this.targetLayout,S),N=!g&&v;if(this.options.layoutRoot||this.resumeFrom||N||g&&(k||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const E={...vv(b,"layout"),onPlay:j,onComplete:C};(m.shouldReduceMotion||this.options.layoutRoot)&&(E.delay=0,E.type=!1),this.startAnimation(E),this.setAnimationOrigin(x,N,E.path)}else g||sE(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=S})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const c=this.getStack();c&&c.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ha(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(K7),this.animationId++)}getTransformTemplate(){const{visualElement:c}=this.options;return c&&c.getProps().transformTemplate}willUpdate(c=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&eE(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let x=0;x<this.path.length;x++){const g=this.path[x];g.shouldResetTransform=!0,(typeof g.latestValues.x=="string"||typeof g.latestValues.y=="string")&&(g.isLayoutDirty=!0),g.updateScroll("snapshot"),g.options.layoutRoot&&g.willUpdate(!1)}const{layoutId:d,layout:h}=this.options;if(d===void 0&&!h)return;const m=this.getTransformTemplate();this.prevTransformTemplateValue=m?m(this.latestValues,""):void 0,this.updateSnapshot(),c&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const h=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),h&&this.nodes.forEach(U7),this.nodes.forEach(nE);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(rE);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(V7),this.nodes.forEach(F7),this.nodes.forEach(P7),this.nodes.forEach(L7)):this.nodes.forEach(rE),this.clearAllSnapshots();const d=Wn.now();_n.delta=Ps(0,16.666666666666668,d-_n.timestamp),_n.timestamp=d,_n.isProcessing=!0,Kx.update.process(_n),Kx.preRender.process(_n),Kx.render.process(_n),_n.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Mv.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(B7),this.sharedNodes.forEach(G7)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,_t.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){_t.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Xn(this.snapshot.measuredBox.x)&&!Xn(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 h=0;h<this.path.length;h++)this.path[h].updateScroll();const c=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=dn()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:d}=this.options;d&&d.notify("LayoutMeasure",this.layout.layoutBox,c?c.layoutBox:void 0)}updateScroll(c="measure"){let d=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===c&&(d=!1),d&&this.instance){const h=r(this.instance);this.scroll={animationId:this.root.animationId,phase:c,isRoot:h,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:h}}}resetTransform(){if(!i)return;const c=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,d=this.projectionDelta&&!F2(this.projectionDelta),h=this.getTransformTemplate(),m=h?h(this.latestValues,""):void 0,x=m!==this.prevTransformTemplateValue;c&&this.instance&&(d||lo(this.latestValues)||x)&&(i(this.instance,m),this.shouldResetTransform=!1,this.scheduleRender())}measure(c=!0){const d=this.measurePageBox();let h=this.removeElementScroll(d);return c&&(h=this.removeTransform(h)),Q7(h),{animationId:this.root.animationId,measuredBox:d,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){var m;const{visualElement:c}=this.options;if(!c)return dn();const d=c.measureViewportBox();if(!(((m=this.scroll)==null?void 0:m.wasRoot)||this.path.some(Z7))){const{scroll:x}=this.root;x&&(Is(d.x,x.offset.x),Is(d.y,x.offset.y))}return d}removeElementScroll(c){var h;const d=dn();if(xs(d,c),(h=this.scroll)!=null&&h.wasRoot)return d;for(let m=0;m<this.path.length;m++){const x=this.path[m],{scroll:g,options:v}=x;x!==this.root&&g&&v.layoutScroll&&(g.wasRoot&&xs(d,c),Is(d.x,g.offset.x),Is(d.y,g.offset.y))}return d}applyTransform(c,d=!1,h){var x,g;const m=h||dn();xs(m,c);for(let v=0;v<this.path.length;v++){const S=this.path[v];!d&&S.options.layoutScroll&&S.scroll&&S!==S.root&&(Is(m.x,-S.scroll.offset.x),Is(m.y,-S.scroll.offset.y)),lo(S.latestValues)&&fh(m,S.latestValues,(x=S.layout)==null?void 0:x.layoutBox)}return lo(this.latestValues)&&fh(m,this.latestValues,(g=this.layout)==null?void 0:g.layoutBox),m}removeTransform(c){var h;const d=dn();xs(d,c);for(let m=0;m<this.path.length;m++){const x=this.path[m];if(!lo(x.latestValues))continue;let g;x.instance&&(Iv(x.latestValues)&&x.updateSnapshot(),g=dn(),xs(g,x.measurePageBox())),U2(d,x.latestValues,(h=x.snapshot)==null?void 0:h.layoutBox,g)}return lo(this.latestValues)&&U2(d,this.latestValues),d}setTargetDelta(c){this.targetDelta=c,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(c){this.options={...this.options,...c,crossfade:c.crossfade!==void 0?c.crossfade:!0}}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!==_n.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(c=!1){var S;const d=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=d.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=d.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=d.isSharedProjectionDirty);const h=!!this.resumingFrom||this!==d;if(!(c||h&&this.isSharedProjectionDirty||this.isProjectionDirty||(S=this.parent)!=null&&S.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:x,layoutId:g}=this.options;if(!this.layout||!(x||g))return;this.resolvedRelativeTargetAt=_n.timestamp;const v=this.getClosestProjectingParent();v&&this.linkedParentVersion!==v.layoutVersion&&!v.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&v&&v.layout?this.createRelativeTarget(v,this.layout.layoutBox,v.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=dn(),this.targetWithTransforms=dn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),b7(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):xs(this.target,this.layout.layoutBox),p2(this.target,this.targetDelta)):xs(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&v&&!!v.resumingFrom==!!this.resumingFrom&&!v.options.layoutScroll&&v.target&&this.animationProgress!==1?this.createRelativeTarget(v,this.target,v.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Iv(this.parent.latestValues)||f2(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(c,d,h){this.relativeParent=c,this.linkedParentVersion=c.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=dn(),this.relativeTargetOrigin=dn(),hh(this.relativeTargetOrigin,d,h,this.options.layoutAnchor||void 0),xs(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var b;const c=this.getLead(),d=!!this.resumingFrom||this!==c;let h=!0;if((this.isProjectionDirty||(b=this.parent)!=null&&b.isProjectionDirty)&&(h=!1),d&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(h=!1),this.resolvedRelativeTargetAt===_n.timestamp&&(h=!1),h)return;const{layout:m,layoutId:x}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(m||x))return;xs(this.layoutCorrected,this.layout.layoutBox);const g=this.treeScale.x,v=this.treeScale.y;W9(this.layoutCorrected,this.treeScale,this.path,d),c.layout&&!c.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(c.target=c.layout.layoutBox,c.targetWithTransforms=dn());const{target:S}=c;if(!S){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(_2(this.prevProjectionDelta.x,this.projectionDelta.x),_2(this.prevProjectionDelta.y,this.projectionDelta.y)),gu(this.projectionDelta,this.layoutCorrected,S,this.latestValues),(this.treeScale.x!==g||this.treeScale.y!==v||!Y2(this.projectionDelta.x,this.prevProjectionDelta.x)||!Y2(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",S))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(c=!0){var d;if((d=this.options.visualElement)==null||d.scheduleRender(),c){const h=this.getStack();h&&h.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=yl(),this.projectionDelta=yl(),this.projectionDeltaWithTransform=yl()}setAnimationOrigin(c,d=!1,h){const m=this.snapshot,x=m?m.latestValues:{},g={...this.latestValues},v=yl();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!d;const S=dn(),b=m?m.source:void 0,j=this.layout?this.layout.source:void 0,C=b!==j,k=this.getStack(),N=!k||k.members.length<=1,E=!!(C&&!N&&this.options.crossfade===!0&&!this.path.some(W7));this.animationProgress=0;let R;const A=h==null?void 0:h.interpolateProjection(c);this.mixTargetDelta=_=>{const z=_/1e3,D=A==null?void 0:A(z);D?(v.x.translate=D.x,v.x.scale=Ot(c.x.scale,1,z),v.x.origin=c.x.origin,v.x.originPoint=c.x.originPoint,v.y.translate=D.y,v.y.scale=Ot(c.y.scale,1,z),v.y.origin=c.y.origin,v.y.originPoint=c.y.originPoint):(aE(v.x,c.x,z),aE(v.y,c.y,z)),this.setTargetDelta(v),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(hh(S,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Y7(this.relativeTarget,this.relativeTargetOrigin,S,z),R&&C7(this.relativeTarget,R)&&(this.isProjectionDirty=!1),R||(R=dn()),xs(R,this.relativeTarget)),C&&(this.animationValues=g,T7(g,x,this.latestValues,z,E,N)),D&&D.rotate!==void 0&&(this.animationValues||(this.animationValues=g),this.animationValues.pathRotation=D.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=z},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(c){var d,h,m;this.notifyListeners("animationStart"),(d=this.currentAnimation)==null||d.stop(),(m=(h=this.resumingFrom)==null?void 0:h.currentAnimation)==null||m.stop(),this.pendingAnimation&&(ha(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=_t.update(()=>{ph.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=ni(0)),this.motionValue.jump(0,!1),this.currentAnimation=J2(this.motionValue,[0,1e3],{...c,velocity:0,isSync:!0,onUpdate:x=>{this.mixTargetDelta(x),c.onUpdate&&c.onUpdate(x)},onComplete:()=>{c.onComplete&&c.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const c=this.getStack();c&&c.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(O7),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const c=this.getLead();let{targetWithTransforms:d,target:h,layout:m,latestValues:x}=c;if(!(!d||!h||!m)){if(this!==c&&this.layout&&m&&uE(this.options.animationType,this.layout.layoutBox,m.layoutBox)){h=this.target||dn();const g=Xn(this.layout.layoutBox.x);h.x.min=c.target.x.min,h.x.max=h.x.min+g;const v=Xn(this.layout.layoutBox.y);h.y.min=c.target.y.min,h.y.max=h.y.min+v}xs(d,h),fh(d,x),gu(this.projectionDeltaWithTransform,this.layoutCorrected,d,x)}}registerSharedNode(c,d){this.sharedNodes.has(c)||this.sharedNodes.set(c,new _7),this.sharedNodes.get(c).add(d);const m=d.options.initialPromotionConfig;d.promote({transition:m?m.transition:void 0,preserveFollowOpacity:m&&m.shouldPreserveFollowOpacity?m.shouldPreserveFollowOpacity(d):void 0})}isLead(){const c=this.getStack();return c?c.lead===this:!0}getLead(){var d;const{layoutId:c}=this.options;return c?((d=this.getStack())==null?void 0:d.lead)||this:this}getPrevLead(){var d;const{layoutId:c}=this.options;return c?(d=this.getStack())==null?void 0:d.prevLead:void 0}getStack(){const{layoutId:c}=this.options;if(c)return this.root.sharedNodes.get(c)}promote({needsReset:c,transition:d,preserveFollowOpacity:h}={}){const m=this.getStack();m&&m.promote(this,h),c&&(this.projectionDelta=void 0,this.needsReset=!0),d&&this.setOptions({transition:d})}relegate(){const c=this.getStack();return c?c.relegate(this):!1}resetSkewAndRotation(){const{visualElement:c}=this.options;if(!c)return;let d=!1;const{latestValues:h}=c;if((h.z||h.rotate||h.rotateX||h.rotateY||h.rotateZ||h.skewX||h.skewY)&&(d=!0),!d)return;const m={};h.z&&qv("z",c,m,this.animationValues);for(let x=0;x<Hv.length;x++)qv(`rotate${Hv[x]}`,c,m,this.animationValues),qv(`skew${Hv[x]}`,c,m,this.animationValues);c.render();for(const x in m)c.setStaticValue(x,m[x]),this.animationValues&&(this.animationValues[x]=m[x]);c.scheduleRender()}applyProjectionStyles(c,d){if(!this.instance||this.isSVG)return;if(!this.isVisible){c.visibility="hidden";return}const h=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,c.visibility="",c.opacity="",c.pointerEvents=mh(d==null?void 0:d.pointerEvents)||"",c.transform=h?h(this.latestValues,""):"none";return}const m=this.getLead();if(!this.projectionDelta||!this.layout||!m.target){this.options.layoutId&&(c.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,c.pointerEvents=mh(d==null?void 0:d.pointerEvents)||""),this.hasProjected&&!lo(this.latestValues)&&(c.transform=h?h({},""):"none",this.hasProjected=!1);return}c.visibility="";const x=m.animationValues||m.latestValues;this.applyTransformsToTarget();let g=k7(this.projectionDeltaWithTransform,this.treeScale,x);h&&(g=h(x,g)),c.transform=g;const{x:v,y:S}=this.projectionDelta;c.transformOrigin=`${v.origin*100}% ${S.origin*100}% 0`,m.animationValues?c.opacity=m===this?x.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:x.opacityExit:c.opacity=m===this?x.opacity!==void 0?x.opacity:"":x.opacityExit!==void 0?x.opacityExit:0;for(const b in Uv){if(x[b]===void 0)continue;const{correct:j,applyTo:C,isCSSVariable:k}=Uv[b],N=g==="none"?x[b]:j(x[b],m);if(C){const E=C.length;for(let R=0;R<E;R++)c[C[R]]=N}else k?this.options.visualElement.renderState.vars[b]=N:c[b]=N}this.options.layoutId&&(c.pointerEvents=m===this?mh(d==null?void 0:d.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(c=>{var d;return(d=c.currentAnimation)==null?void 0:d.stop()}),this.root.nodes.forEach(nE),this.root.sharedNodes.clear()}}}function P7(e){e.updateLayout()}function L7(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:o}=e.options,c=t.source!==e.layout.source;if(o==="size")$s(g=>{const v=c?t.measuredBox[g]:t.layoutBox[g],S=Xn(v);v.min=r[g].min,v.max=v.min+S});else if(o==="x"||o==="y"){const g=o==="x"?"y":"x";Fv(c?t.measuredBox[g]:t.layoutBox[g],r[g])}else uE(o,t.layoutBox,r)&&$s(g=>{const v=c?t.measuredBox[g]:t.layoutBox[g],S=Xn(r[g]);v.max=v.min+S,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[g].max=e.relativeTarget[g].min+S)});const d=yl();gu(d,r,t.layoutBox);const h=yl();c?gu(h,e.applyTransform(i,!0),t.measuredBox):gu(h,r,t.layoutBox);const m=!F2(d);let x=!1;if(!e.resumeFrom){const g=e.getClosestProjectingParent();if(g&&!g.resumeFrom){const{snapshot:v,layout:S}=g;if(v&&S){const b=e.options.layoutAnchor||void 0,j=dn();hh(j,t.layoutBox,v.layoutBox,b);const C=dn();hh(C,r,S.layoutBox,b),K2(j,C)||(x=!0),g.options.layoutRoot&&(e.relativeTarget=C,e.relativeTargetOrigin=j,e.relativeParent=g)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:h,layoutDelta:d,hasLayoutChanged:m,hasRelativeLayoutChanged:x})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function I7(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function $7(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function B7(e){e.clearSnapshot()}function nE(e){e.clearMeasurements()}function U7(e){e.isLayoutDirty=!0,e.updateLayout()}function rE(e){e.isLayoutDirty=!1}function V7(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function F7(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function sE(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function H7(e){e.resolveTargetDelta()}function q7(e){e.calcProjection()}function K7(e){e.resetSkewAndRotation()}function G7(e){e.removeLeadSnapshot()}function aE(e,t,n){e.translate=Ot(t.translate,0,n),e.scale=Ot(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function iE(e,t,n,r){e.min=Ot(t.min,n.min,r),e.max=Ot(t.max,n.max,r)}function Y7(e,t,n,r){iE(e.x,t.x,n.x,r),iE(e.y,t.y,n.y,r)}function W7(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const X7={duration:.45,ease:[.4,0,.1,1]},oE=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),lE=oE("applewebkit/")&&!oE("chrome/")?Math.round:qr;function cE(e){e.min=lE(e.min),e.max=lE(e.max)}function Q7(e){cE(e.x),cE(e.y)}function uE(e,t,n){return e==="position"||e==="preserve-aspect"&&!y7(G2(t),G2(n),.2)}function Z7(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const J7=tE({attachResizeListener:(e,t)=>xu(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Kv={current:void 0},dE=tE({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Kv.current){const e=new J7({});e.mount(window),e.setOptions({layoutScroll:!0}),Kv.current=e}return Kv.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Gv=p.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function eq(e=!0){const t=p.useContext(Bx);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,o=p.useId();p.useEffect(()=>{if(e)return i(o)},[e]);const c=p.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,c]:[!0]}const fE=p.createContext({strict:!1}),hE={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],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"]};let mE=!1;function tq(){if(mE)return;const e={};for(const t in hE)e[t]={isEnabled:n=>hE[t].some(r=>!!n[r])};l2(e),mE=!0}function pE(){return tq(),K9()}function nq(e){const t=pE();for(const n in e)t[n]={...t[n],...e[n]};l2(t)}const rq=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function gh(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||rq.has(e)}let gE=e=>!gh(e);function sq(e){typeof e=="function"&&(gE=t=>t.startsWith("on")?!gh(t):e(t))}try{sq(require("@emotion/is-prop-valid").default)}catch{}function aq(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||Sn(e[i])||(gE(i)||n===!0&&gh(i)||!t&&!gh(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}const xh=p.createContext({});function iq(e,t){if(ch(e)){const{initial:n,animate:r}=e;return{initial:n===!1||mu(n)?n:void 0,animate:mu(r)?r:void 0}}return e.inherit!==!1?t:{}}function oq(e){const{initial:t,animate:n}=iq(e,p.useContext(xh));return p.useMemo(()=>({initial:t,animate:n}),[xE(t),xE(n)])}function xE(e){return Array.isArray(e)?e.join(" "):e}const Yv=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function vE(e,t,n){for(const r in t)!Sn(t[r])&&!j2(r,n)&&(e[r]=t[r])}function lq({transformTemplate:e},t){return p.useMemo(()=>{const n=Yv();return Bv(n,t,e),Object.assign({},n.vars,n.style)},[t])}function cq(e,t){const n=e.style||{},r={};return vE(r,n,e),Object.assign(r,lq(e,t)),r}function uq(e,t){const n={},r=cq(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}const yE=()=>({...Yv(),attrs:{}});function dq(e,t,n,r){const i=p.useMemo(()=>{const o=yE();return k2(o,t,T2(r),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};vE(o,e.style,e),i.style={...o,...i.style}}return i}const fq=["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 Wv(e){return typeof e!="string"||e.includes("-")?!1:!!(fq.indexOf(e)>-1||/[A-Z]/u.test(e))}function hq(e,t,n,{latestValues:r},i,o=!1,c){const h=(c??Wv(e)?dq:uq)(t,r,i,e),m=aq(t,typeof e=="string",o),x=e!==p.Fragment?{...m,...h,ref:n}:{},{children:g}=t,v=p.useMemo(()=>Sn(g)?g.get():g,[g]);return p.createElement(e,{...x,children:v})}function mq({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:pq(n,r,i,e),renderState:t()}}function pq(e,t,n,r){const i={},o=r(e,{});for(const v in o)i[v]=mh(o[v]);let{initial:c,animate:d}=e;const h=ch(e),m=a2(e);t&&m&&!h&&e.inherit!==!1&&(c===void 0&&(c=t.initial),d===void 0&&(d=t.animate));let x=n?n.initial===!1:!1;x=x||c===!1;const g=x?d:c;if(g&&typeof g!="boolean"&&!lh(g)){const v=Array.isArray(g)?g:[g];for(let S=0;S<v.length;S++){const b=bv(e,v[S]);if(b){const{transitionEnd:j,transition:C,...k}=b;for(const N in k){let E=k[N];if(Array.isArray(E)){const R=x?E.length-1:0;E=E[R]}E!==null&&(i[N]=E)}for(const N in j)i[N]=j[N]}}}return i}const bE=e=>(t,n)=>{const r=p.useContext(xh),i=p.useContext(Bx),o=()=>mq(e,t,r,i);return n?o():$x(o)},gq=bE({scrapeMotionValuesFromProps:Vv,createRenderState:Yv}),xq=bE({scrapeMotionValuesFromProps:E2,createRenderState:yE}),vq=Symbol.for("motionComponentSymbol");function yq(e,t,n){const r=p.useRef(n);p.useInsertionEffect(()=>{r.current=n});const i=p.useRef(null);return p.useCallback(o=>{var d;o&&((d=e.onMount)==null||d.call(e,o)),t&&(o?t.mount(o):t.unmount());const c=r.current;if(typeof c=="function")if(o){const h=c(o);typeof h=="function"&&(i.current=h)}else i.current?(i.current(),i.current=null):c(o);else c&&(c.current=o)},[t])}const wE=p.createContext({});function bl(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function bq(e,t,n,r,i,o){var E,R;const{visualElement:c}=p.useContext(xh),d=p.useContext(fE),h=p.useContext(Bx),m=p.useContext(Gv),x=m.reducedMotion,g=m.skipAnimations,v=p.useRef(null),S=p.useRef(!1);r=r||d.renderer,!v.current&&r&&(v.current=r(e,{visualState:t,parent:c,props:n,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:x,skipAnimations:g,isSVG:o}),S.current&&v.current&&(v.current.manuallyAnimateOnMount=!0));const b=v.current,j=p.useContext(wE);b&&!b.projection&&i&&(b.type==="html"||b.type==="svg")&&wq(v.current,n,i,j);const C=p.useRef(!1);p.useInsertionEffect(()=>{b&&C.current&&b.update(n,h)});const k=n[BT],N=p.useRef(!!k&&typeof window<"u"&&!((E=window.MotionHandoffIsComplete)!=null&&E.call(window,k))&&((R=window.MotionHasOptimisedAnimation)==null?void 0:R.call(window,k)));return AN(()=>{S.current=!0,b&&(C.current=!0,window.MotionIsMounted=!0,b.updateFeatures(),b.scheduleRenderMicrotask(),N.current&&b.animationState&&b.animationState.animateChanges())}),p.useEffect(()=>{b&&(!N.current&&b.animationState&&b.animationState.animateChanges(),N.current&&(queueMicrotask(()=>{var A;(A=window.MotionHandoffMarkAsComplete)==null||A.call(window,k)}),N.current=!1),b.enteringChildren=void 0)}),b}function wq(e,t,n,r){const{layoutId:i,layout:o,drag:c,dragConstraints:d,layoutScroll:h,layoutRoot:m,layoutAnchor:x,layoutCrossfade:g}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:SE(e.parent)),e.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!c||d&&bl(d),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,crossfade:g,layoutScroll:h,layoutRoot:m,layoutAnchor:x})}function SE(e){if(e)return e.options.allowProjection!==!1?e.projection:SE(e.parent)}function Xv(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&nq(r);const o=n?n==="svg":Wv(e),c=o?xq:gq;function d(m,x){let g;const v={...p.useContext(Gv),...m,layoutId:Sq(m)},{isStatic:S}=v,b=oq(m),j=c(m,S);if(!S&&typeof window<"u"){jq();const C=Cq(v);g=C.MeasureLayout,b.visualElement=bq(e,j,v,i,C.ProjectionNode,o)}return l.jsxs(xh.Provider,{value:b,children:[g&&b.visualElement?l.jsx(g,{visualElement:b.visualElement,...v}):null,hq(e,m,yq(j,b.visualElement,x),j,S,t,o)]})}d.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const h=p.forwardRef(d);return h[vq]=e,h}function Sq({layoutId:e}){const t=p.useContext(RN).id;return t&&e!==void 0?t+"-"+e:e}function jq(e,t){p.useContext(fE).strict}function Cq(e){const t=pE(),{drag:n,layout:r}=t;if(!n&&!r)return{};const i={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function kq(e,t){if(typeof Proxy>"u")return Xv;const n=new Map,r=(o,c)=>Xv(o,c,e,t),i=(o,c)=>r(o,c);return new Proxy(i,{get:(o,c)=>c==="create"?r:(n.has(c)||n.set(c,Xv(c,void 0,e,t)),n.get(c))})}const Nq=(e,t)=>t.isSVG??Wv(e)?new R2(t):new C2(t,{allowProjection:e!==p.Fragment});class Tq extends si{constructor(t){super(t),t.animationState||(t.animationState=h7(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();lh(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let Eq=0;class Rq extends si{constructor(){super(...arguments),this.id=Eq++,this.isExitComplete=!1}update(){var o;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:c,custom:d}=this.node.getProps();if(typeof c=="string"||typeof c=="object"&&c!==null&&!Array.isArray(c)){const h=oo(this.node,c,d);if(h){const{transition:m,transitionEnd:x,...g}=h;for(const v in g)(o=this.node.getValue(v))==null||o.jump(g[v])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Aq={animation:{Feature:Tq},exit:{Feature:Rq}};function vu(e){return{point:{x:e.pageX,y:e.pageY}}}const Mq=e=>t=>Dv(t)&&e(t,vu(t));function yu(e,t,n,r){return xu(e,t,Mq(n),r)}const jE=({current:e})=>e?e.ownerDocument.defaultView:null,CE=(e,t)=>Math.abs(e-t);function Dq(e,t){const n=CE(e.x,t.x),r=CE(e.y,t.y);return Math.sqrt(n**2+r**2)}const kE=new Set(["auto","scroll"]);class NE{constructor(t,n,{transformPagePoint:r,contextWindow:i=window,dragSnapToOrigin:o=!1,distanceThreshold:c=3,element:d}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=b=>{this.handleScroll(b.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=vh(this.lastRawMoveEventInfo,this.transformPagePoint));const b=Qv(this.lastMoveEventInfo,this.history),j=this.startEvent!==null,C=Dq(b.offset,{x:0,y:0})>=this.distanceThreshold;if(!j&&!C)return;const{point:k}=b,{timestamp:N}=_n;this.history.push({...k,timestamp:N});const{onStart:E,onMove:R}=this.handlers;j||(E&&E(this.lastMoveEvent,b),this.startEvent=this.lastMoveEvent),R&&R(this.lastMoveEvent,b)},this.handlePointerMove=(b,j)=>{this.lastMoveEvent=b,this.lastRawMoveEventInfo=j,this.lastMoveEventInfo=vh(j,this.transformPagePoint),_t.update(this.updatePoint,!0)},this.handlePointerUp=(b,j)=>{this.end();const{onEnd:C,onSessionEnd:k,resumeAnimation:N}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&N&&N(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const E=Qv(b.type==="pointercancel"?this.lastMoveEventInfo:vh(j,this.transformPagePoint),this.history);this.startEvent&&C&&C(b,E),k&&k(b,E)},!Dv(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=c,this.contextWindow=i||window;const h=vu(t),m=vh(h,this.transformPagePoint),{point:x}=m,{timestamp:g}=_n;this.history=[{...x,timestamp:g}];const{onSessionStart:v}=n;v&&v(t,Qv(m,this.history));const S={passive:!0,capture:!0};this.removeListeners=su(yu(this.contextWindow,"pointermove",this.handlePointerMove,S),yu(this.contextWindow,"pointerup",this.handlePointerUp,S),yu(this.contextWindow,"pointercancel",this.handlePointerUp,S)),d&&this.startScrollTracking(d)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(kE.has(r.overflowX)||kE.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,i=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},o={x:i.x-n.x,y:i.y-n.y};o.x===0&&o.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(t,i),_t.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ha(this.updatePoint)}}function vh(e,t){return t?{point:t(e.point)}:e}function TE(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Qv({point:e},t){return{point:e,delta:TE(e,EE(t)),offset:TE(e,_q(t)),velocity:Oq(t,.1)}}function _q(e){return e[0]}function EE(e){return e[e.length-1]}function Oq(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=EE(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Yn(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>Yn(t)*2&&(r=e[1]);const o=Kr(i.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const c={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return c.x===1/0&&(c.x=0),c.y===1/0&&(c.y=0),c}function zq(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Ot(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Ot(n,e,r.max):Math.min(e,n)),e}function RE(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function Pq(e,{top:t,left:n,bottom:r,right:i}){return{x:RE(e.x,n,i),y:RE(e.y,t,r)}}function AE(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 Lq(e,t){return{x:AE(e.x,t.x),y:AE(e.y,t.y)}}function Iq(e,t){let n=.5;const r=Xn(e),i=Xn(t);return i>r?n=fl(t.min,t.max-r,e.min):r>i&&(n=fl(e.min,e.max-i,t.min)),Ps(0,1,n)}function $q(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Zv=.35;function Bq(e=Zv){return e===!1?e=0:e===!0&&(e=Zv),{x:ME(e,"left","right"),y:ME(e,"top","bottom")}}function ME(e,t,n){return{min:DE(e,t),max:DE(e,n)}}function DE(e,t){return typeof e=="number"?e:e[t]||0}const Uq=new WeakMap;class Vq{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=dn(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const o=g=>{n&&this.snapToCursor(vu(g).point),this.stopAnimation()},c=(g,v)=>{const{drag:S,dragPropagation:b,onDragStart:j}=this.getProps();if(S&&!b&&(this.openDragLock&&this.openDragLock(),this.openDragLock=j9(S),!this.openDragLock))return;this.latestPointerEvent=g,this.latestPanInfo=v,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),$s(k=>{let N=this.getAxisMotionValue(k).get()||0;if(Ls.test(N)){const{projection:E}=this.visualElement;if(E&&E.layout){const R=E.layout.layoutBox[k];R&&(N=Xn(R)*(parseFloat(N)/100))}}this.originPoint[k]=N}),j&&_t.update(()=>j(g,v),!1,!0),Sv(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},d=(g,v)=>{this.latestPointerEvent=g,this.latestPanInfo=v;const{dragPropagation:S,dragDirectionLock:b,onDirectionLock:j,onDrag:C}=this.getProps();if(!S&&!this.openDragLock)return;const{offset:k}=v;if(b&&this.currentDirection===null){this.currentDirection=Hq(k),this.currentDirection!==null&&j&&j(this.currentDirection);return}this.updateAxis("x",v.point,k),this.updateAxis("y",v.point,k),this.visualElement.render(),C&&_t.update(()=>C(g,v),!1,!0)},h=(g,v)=>{this.latestPointerEvent=g,this.latestPanInfo=v,this.stop(g,v),this.latestPointerEvent=null,this.latestPanInfo=null},m=()=>{const{dragSnapToOrigin:g}=this.getProps();(g||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:x}=this.getProps();this.panSession=new NE(t,{onSessionStart:o,onStart:c,onMove:d,onSessionEnd:h,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:x,distanceThreshold:r,contextWindow:jE(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,i=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!i||!r)return;const{velocity:c}=i;this.startAnimation(c);const{onDragEnd:d}=this.getProps();d&&_t.postRender(()=>d(r,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!yh(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let c=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(c=zq(c,this.constraints[t],this.elastic[t])),o.set(c)}resolveConstraints(){var o;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(o=this.visualElement.projection)==null?void 0:o.layout,i=this.constraints;t&&bl(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=Pq(r.layoutBox,t):this.constraints=!1,this.elastic=Bq(n),i!==this.constraints&&!bl(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&$s(c=>{this.constraints!==!1&&this.getAxisMotionValue(c)&&(this.constraints[c]=$q(r.layoutBox[c],this.constraints[c]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!bl(t))return!1;const r=t.current;Ja(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;i.root&&(i.root.scroll=void 0,i.root.updateScroll());const o=X9(r,i.root,this.visualElement.getTransformPagePoint());let c=Lq(i.layout.layoutBox,o);if(n){const d=n(G9(c));this.hasMutatedConstraints=!!d,d&&(c=d2(d))}return c}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:c,onDragTransitionEnd:d}=this.getProps(),h=this.constraints||{},m=$s(x=>{if(!yh(x,n,this.currentDirection))return;let g=h&&h[x]||{};(c===!0||c===x)&&(g={min:0,max:0});const v=i?200:1e6,S=i?40:1e7,b={type:"inertia",velocity:r?t[x]:0,bounceStiffness:v,bounceDamping:S,timeConstant:750,restDelta:1,restSpeed:10,...o,...g};return this.startAxisValueAnimation(x,b)});return Promise.all(m).then(d)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Sv(this.visualElement,t),r.start(yv(t,r,0,n,this.visualElement,!1))}stopAnimation(){$s(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps()[n];return i||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){$s(n=>{const{drag:r}=this.getProps();if(!yh(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:c,max:d}=i.layout.layoutBox[n],h=o.get()||0;o.set(t[n]-Ot(c,d,.5)+h)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!bl(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};$s(c=>{const d=this.getAxisMotionValue(c);if(d&&this.constraints!==!1){const h=d.get();i[c]=Iq({min:h,max:h},this.constraints[c])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),$s(c=>{if(!yh(c,t,null))return;const d=this.getAxisMotionValue(c),{min:h,max:m}=this.constraints[c];d.set(Ot(h,m,i[c]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Uq.set(this.visualElement,this);const t=this.visualElement.current,n=yu(t,"pointerdown",m=>{const{drag:x,dragListener:g=!0}=this.getProps(),v=m.target,S=v!==t&&R9(v);x&&g&&!S&&this.start(m)});let r;const i=()=>{const{dragConstraints:m}=this.getProps();bl(m)&&m.current&&(this.constraints=this.resolveRefConstraints(),r||(r=Fq(t,m.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,c=o.addEventListener("measure",i);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),_t.read(i);const d=xu(window,"resize",()=>this.scalePositionWithinConstraints()),h=o.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:x})=>{this.isDragging&&x&&($s(g=>{const v=this.getAxisMotionValue(g);v&&(this.originPoint[g]+=m[g].translate,v.set(v.get()+m[g].translate))}),this.visualElement.render())}));return()=>{d(),n(),c(),h&&h(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:c=Zv,dragMomentum:d=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:c,dragMomentum:d}}}function _E(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Fq(e,t,n){const r=t2(e,_E(n)),i=t2(t,_E(n));return()=>{r(),i()}}function yh(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Hq(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class qq extends si{constructor(t){super(t),this.removeGroupControls=qr,this.removeListeners=qr,this.controls=new Vq(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||qr}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Jv=e=>(t,n)=>{e&&_t.update(()=>e(t,n),!1,!0)};class Kq extends si{constructor(){super(...arguments),this.removePointerDownListener=qr}onPointerDown(t){this.session=new NE(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:jE(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:Jv(t),onStart:Jv(n),onMove:Jv(r),onEnd:(o,c)=>{delete this.session,i&&_t.postRender(()=>i(o,c))}}}mount(){this.removePointerDownListener=yu(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let ey=!1;class Gq extends p.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),ey&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ph.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,{projection:c}=r;return c&&(c.isPresent=o,t.layoutDependency!==n&&c.setOptions({...c.options,layoutDependency:n}),ey=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==o?c.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?c.promote():c.relegate()||_t.postRender(()=>{const d=c.getStack();(!d||!d.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),Mv.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;ey=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function OE(e){const[t,n]=eq(),r=p.useContext(RN);return l.jsx(Gq,{...e,layoutGroup:r,switchLayoutGroup:p.useContext(wE),isPresent:t,safeToRemove:n})}const Yq={pan:{Feature:Kq},drag:{Feature:qq,ProjectionNode:dE,MeasureLayout:OE}};function zE(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,o=r[i];o&&_t.postRender(()=>o(t,vu(t)))}class Wq extends si{mount(){const{current:t}=this.node;t&&(this.unmount=k9(t,(n,r)=>(zE(this.node,r,"Start"),i=>zE(this.node,i,"End"))))}unmount(){}}class Xq extends si{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=su(xu(this.node.current,"focus",()=>this.onFocus()),xu(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function PE(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),o=r[i];o&&_t.postRender(()=>o(t,vu(t)))}class Qq extends si{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=M9(t,(i,o)=>(PE(this.node,o,"Start"),(c,{success:d})=>PE(this.node,c,d?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const ty=new WeakMap,ny=new WeakMap,Zq=e=>{const t=ty.get(e.target);t&&t(e)},Jq=e=>{e.forEach(Zq)};function eK({root:e,...t}){const n=e||document;ny.has(n)||ny.set(n,{});const r=ny.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Jq,{root:e,...t})),r[i]}function tK(e,t,n){const r=eK(t);return ty.set(e,n),r.observe(e),()=>{ty.delete(e),r.unobserve(e)}}const nK={some:0,all:1};class rK extends si{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var h;(h=this.stopObserver)==null||h.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:o}=t,c={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:nK[i]},d=m=>{const{isIntersecting:x}=m;if(this.isInView===x||(this.isInView=x,o&&!x&&this.hasEnteredView))return;x&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",x);const{onViewportEnter:g,onViewportLeave:v}=this.node.getProps(),S=x?g:v;S&&S(m)};this.stopObserver=tK(this.node.current,c,d)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(sK(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function sK({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const aK={...Aq,...{inView:{Feature:rK},tap:{Feature:Qq},focus:{Feature:Xq},hover:{Feature:Wq}},...Yq,...{layout:{ProjectionNode:dE,MeasureLayout:OE}}},iK=kq(aK,Nq);function bh(e){const t=$x(()=>ni(e)),{isStatic:n}=p.useContext(Gv);if(n){const[,r]=p.useState(e);p.useEffect(()=>t.on("change",r),[])}return t}function LE(e,t){const n=bh(t()),r=()=>n.set(t());return r(),AN(()=>{const i=()=>_t.preRender(r,!1,!0),o=e.map(c=>c.on("change",i));return()=>{o.forEach(c=>c()),ha(r)}}),n}function oK(e){fu.current=[],e();const t=LE(fu.current,e);return fu.current=void 0,t}function IE(e,t,n,r){if(typeof e=="function")return oK(e);const o=typeof t=="function"?t:B9(t,n,r),c=Array.isArray(e)?$E(e,o):$E([e],([h])=>o(h)),d=Array.isArray(e)?void 0:e.accelerate;return d&&!d.isTransformed&&typeof t!="function"&&Array.isArray(n)&&(r==null?void 0:r.clamp)!==!1&&(c.accelerate={...d,times:t,keyframes:n,isTransformed:!0}),c}function $E(e,t){const n=$x(()=>[]);return LE(e,()=>{n.length=0;const r=e.length;for(let i=0;i<r;i++)n[i]=e[i].get();return t(n)})}function ry(e){return typeof e=="object"&&!Array.isArray(e)}function BE(e,t,n,r){return e==null?[]:typeof e=="string"&&ry(t)?Rv(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(i=>i!=null):[e]}function lK(e,t,n){return e*(t+1)+n*t}function UE(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))):r.get(t)??e}function cK(e,t,n){for(let r=0;r<e.length;r++){const i=e[r];i.at>t&&i.at<n&&(ul(e,i),r--)}}function uK(e,t,n,r,i,o){cK(e,i,o);for(let c=0;c<t.length;c++)e.push({value:t[c],at:Ot(i,o,r[c]),easing:KN(n,c)})}function dK(e,t,n=0){const r=t+1+t*n;for(let i=0;i<e.length;i++)e[i]=e[i]/r}function fK(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}const hK="easeInOut",sy=20;function mK(e,{defaultTransition:t={},...n}={},r,i){const o=t.duration||.3,c=new Map,d=new Map,h={},m=new Map;let x=0,g=0,v=0;for(let S=0;S<e.length;S++){const b=e[S];if(typeof b=="string"){m.set(b,g);continue}else if(!Array.isArray(b)){m.set(b.name,UE(g,b.at,x,m));continue}let[j,C,k={}]=b;k.at!==void 0&&(g=UE(g,k.at,x,m));let N=0;const E=(R,A,_,z=0,D=0)=>{const V=pK(R),{delay:I=0,times:Q=gT(V),type:B=t.type||"keyframes",repeat:H,repeatType:ee,repeatDelay:W=0,...M}=A;let{ease:U=t.ease||"easeOut",duration:K}=A;const ne=typeof I=="function"?I(z,D):I,q=V.length,P=pv(B)?B:i==null?void 0:i[B||"keyframes"];if(q<=2&&P){let $=100;if(q===2&&vK(V)){const ie=V[1]-V[0];$=Math.abs(ie)}const se={...t,...M};K!==void 0&&(se.duration=Yn(K));const oe=dT(se,$,P);U=oe.ease,K=oe.duration}K??(K=o);const L=g+ne;Q.length===1&&Q[0]===0&&(Q[1]=1);const G=Q.length-V.length;if(G>0&&pT(Q,G),V.length===1&&V.unshift(null),H&&dl(H<sy,`Sequence segments can't repeat ${H} times — ignoring repeat option. Use a value below ${sy} or apply repeat at the sequence level instead.`),H&&H<sy){const $=K>0?W/K:0;K=lK(K,H,W);const se=[...V],oe=[...Q];U=Array.isArray(U)?[...U]:[U];const ie=[...U],Z=ee==="reverse"||ee==="mirror";let ve=se,Ee=ie;Z&&(ve=[...se].reverse(),ee==="reverse"&&(Ee=[...ie].reverse().map(Te=>typeof Te=="function"?Fx(Te):Te)));for(let Te=0;Te<H;Te++){const Ie=Z&&Te%2===0,Fe=Ie?ve:se,fe=Ie?Ee:ie,Se=(Te+1)*(1+$);$>0&&(V.push(V[V.length-1]),Q.push(Se),U.push("linear")),V.push(...Fe);for(let ye=0;ye<Fe.length;ye++)Q.push(oe[ye]+Se),U.push(ye===0?"linear":KN(fe,ye-1))}dK(Q,H,$)}const J=L+K;uK(_,V,U,Q,L,J),N=Math.max(ne+K,N),v=Math.max(J,v)};if(Sn(j)){const R=VE(j,d);E(C,k,FE("default",R))}else{const R=BE(j,C,r,h),A=R.length;for(let _=0;_<A;_++){C=C,k=k;const z=R[_],D=VE(z,d);for(const V in C)E(C[V],gK(k,V),FE(V,D),_,A)}}x=g,g+=N}return d.forEach((S,b)=>{for(const j in S){const C=S[j];C.sort(fK);const k=[],N=[],E=[];for(let z=0;z<C.length;z++){const{at:D,value:V,easing:I}=C[z];k.push(V),N.push(fl(0,v,D)),E.push(I||"easeOut")}N[0]!==0&&(N.unshift(0),k.unshift(k[0]),E.unshift(hK)),N[N.length-1]!==1&&(N.push(1),k.push(null)),c.has(b)||c.set(b,{keyframes:{},transition:{}});const R=c.get(b);R.keyframes[j]=k;const{type:A,..._}=t;R.transition[j]={..._,duration:v,ease:E,times:N,...n}}}),c}function VE(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function FE(e,t){return t[e]||(t[e]=[]),t[e]}function pK(e){return Array.isArray(e)?e:[e]}function gK(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}const xK=e=>typeof e=="number",vK=e=>e.every(xK);function yK(e){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=ah(e)&&!n2(e)?new R2(t):new C2(t);n.mount(e),hu.set(e,n)}function bK(e){const t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new r7(t);n.mount(e),hu.set(e,n)}function wK(e,t){return Sn(e)||typeof e=="number"||typeof e=="string"&&!ry(t)}function HE(e,t,n,r){const i=[];if(wK(e,t))i.push(J2(e,ry(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;const o=BE(e,t,r),c=o.length;Ja(!!c,"No valid elements provided.","no-valid-elements");for(let d=0;d<c;d++){const h=o[d],m=h instanceof Element?yK:bK;hu.has(h)||m(h);const x=hu.get(h),g={...n};"delay"in g&&typeof g.delay=="function"&&(g.delay=g.delay(d,c)),i.push(...Cv(x,{...t,transition:g},{}))}}return i}function SK(e,t,n){const r=[],i=e.map(c=>{if(Array.isArray(c)&&typeof c[0]=="function"){const d=c[0],h=ni(0);return h.on("change",d),c.length===1?[h,[0,1]]:c.length===2?[h,[0,1],c[1]]:[h,c[1],c[2]]}return c});return mK(i,t,n,{spring:cu}).forEach(({keyframes:c,transition:d},h)=>{r.push(...HE(h,c,d))}),r}function jK(e){return Array.isArray(e)&&e.some(Array.isArray)}function CK(e={}){const{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(o,c,d){let h=[],m;const x={};if(n!==void 0&&(x.reduceMotion=n),r!==void 0&&(x.skipAnimations=r),jK(o)){const{onComplete:v,...S}=c||{};typeof v=="function"&&(m=v),h=SK(o,{...x,...S},t)}else{const{onComplete:v,...S}=d||{};typeof v=="function"&&(m=v),h=HE(o,c,{...x,...S},t)}const g=new KH(h);return m&&g.finished.then(m),t&&(t.animations.push(g),g.finished.then(()=>{ul(t.animations,g)})),g}return i}const wl=CK(),qE=iK,kK={right:"x",left:"x",top:"y",bottom:"y"},NK={right:1,bottom:1,left:-1,top:-1};function TK(e,t=.998){return e/1e3*t/(1-t)}function EK(e,t,n=.55){return e*t*n/(t+n*e)}const RK=5,AK=100;function MK(e,t){return e.scrollHeight<=e.clientHeight?!1:t>0?e.scrollTop<e.scrollHeight-e.clientHeight-1:e.scrollTop>0}function DK(e,t,n,r,i,o){if(e!=null&&e.closest("[data-acr-no-drag]"))return!1;if(n==="x")return!0;if(Date.now()<o||!(i*r>0))return!1;const d=r>0?-1:1;let h=e;for(;h;){if(MK(h,d))return!1;if(h===t)break;h=h.parentElement}return!0}function _K(){const[e,t]=p.useState(!1);return p.useEffect(()=>{const n=window.matchMedia("(prefers-reduced-motion: reduce)"),r=()=>t(n.matches);return r(),n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e}const KE=p.createContext(null);function OK(){const e=p.useContext(KE);if(!e)throw new Error("Sheet components must be used within <Sheet>");return e}function ay({open:e,defaultOpen:t,onOpenChange:n,children:r,...i}){const[o,c]=p.useState(t??!1),d=e!==void 0,h=d?!!e:o,m=p.useCallback(x=>{d||c(x),n==null||n(x)},[d,n]);return l.jsx(KE.Provider,{value:{open:h,setOpen:m},children:l.jsx(Nc,{"data-slot":"sheet",open:h,onOpenChange:m,...i,children:r})})}function zK({...e}){return l.jsx(PS,{"data-slot":"sheet-trigger",...e})}function PK({...e}){return l.jsx(Tc,{"data-slot":"sheet-portal",...e})}function iy({className:e,children:t,side:n="right",style:r,...i}){const{open:o,setOpen:c}=OK(),d=_K(),h=kK[n],m=NK[n],x=bh(o?0:1),g=bh(1),v=bh(o?1:0),S=p.useRef(!1),b=p.useRef(!1),j=p.useRef(null),C=p.useRef(null),k=p.useRef({start:0,startPos:0,size:1}),N=p.useRef(null),E=p.useRef(0),R=p.useRef([]),[A,_]=p.useState(o),z=p.useMemo(()=>({type:"spring",bounce:.2,duration:.3}),[]),D=IE(x,M=>`${m*M*100}%`);p.useEffect(()=>{o&&_(!0)},[o]),p.useLayoutEffect(()=>{!A||!o||(v.set(o?v.get():0),d&&x.get()!==0&&(x.set(0),g.set(0)))},[A]),p.useEffect(()=>{if(!A)return;const M=wl(v,o?1:0,{duration:.2,ease:"easeOut"});if(d){x.set(0);const K=wl(g,o?1:0,{duration:.15,ease:"linear",onComplete:o?void 0:()=>_(!1)});return()=>{K.stop(),M.stop()}}const U=wl(x,o?0:1,{...z,onComplete:o?void 0:()=>_(!1)});return C.current=U,()=>{U.stop(),M.stop()}},[o,A,z,d]);const V=IE([x,v],([M,U])=>S.current?Math.min(U,Math.max(0,1-M)):U),I=p.useCallback(M=>h==="x"?M.clientX:M.clientY,[h]),Q=p.useCallback(M=>{if(M.pointerType!=="touch"||d||M.target.closest('input, textarea, select, button, a, [contenteditable="true"], [data-acr-no-drag]'))return;N.current=M.target;const U=j.current;if(!U)return;const K=U.getBoundingClientRect();k.current={start:I(M),startPos:x.get(),size:(h==="x"?K.width:K.height)||1},R.current=[{c:I(M),t:M.timeStamp}],b.current=!0},[d,h,I,x]),B=p.useCallback(M=>{var J,$;if(!b.current&&!S.current)return;const U=I(M),{start:K,startPos:ne,size:q}=k.current,P=U-K;if(b.current){if(Math.abs(P)<RK)return;if(!DK(N.current,j.current,h,m,P,E.current)){b.current=!1,E.current=Date.now()+AK;return}b.current=!1,S.current=!0,(J=C.current)==null||J.stop();try{($=j.current)==null||$.setPointerCapture(M.pointerId)}catch{}}let L=ne+m*P/q;L<0&&(L=-EK(-L*q,q)/q),x.set(L);const G=R.current;G.push({c:U,t:M.timeStamp}),G.length>5&&G.shift()},[I,m,x]),H=p.useCallback(M=>{var L;if(b.current){b.current=!1;return}if(!S.current)return;S.current=!1;try{(L=j.current)==null||L.releasePointerCapture(M.pointerId)}catch{}const{size:U}=k.current,K=R.current;let ne=0;if(K.length>=2){const G=K[0],J=K[K.length-1],$=J.t-G.t||16;ne=(J.c-G.c)/$*1e3}const q=x.get()+m*TK(ne)/U,P=m*ne/U;q>.4?(wl(v,0,{duration:.2,ease:"easeOut"}),C.current=wl(x,1,{...z,velocity:P,onComplete:()=>{_(!1),c(!1)}})):C.current=wl(x,0,{...z,velocity:P})},[m,x,v,z,c]);if(!A)return null;const ee=n==="right"?"inset-y-0 right-0 h-full w-3/4 sm:max-w-sm":n==="left"?"inset-y-0 left-0 h-full w-3/4 sm:max-w-sm":n==="top"?"inset-x-0 top-0 h-auto":"inset-x-0 bottom-0 h-auto",W=d?{}:{onPointerDown:Q,onPointerMove:B,onPointerUp:H,onPointerCancel:H};return l.jsxs(PK,{forceMount:!0,children:[l.jsx(Wo,{asChild:!0,forceMount:!0,children:l.jsx(qE.div,{"data-slot":"sheet-overlay",style:{opacity:V},className:"fixed inset-0 z-50 bg-[var(--acr-overlay)] backdrop-blur-[20px] backdrop-saturate-[1.3]"})}),l.jsx(Xo,{asChild:!0,forceMount:!0,...i,children:l.jsxs(qE.div,{ref:j,"data-slot":"sheet-content",style:{...r,opacity:g,...h==="x"?{x:D}:{y:D}},...W,className:Y("fixed z-50 flex flex-col gap-4 bg-[var(--acr-panel)] backdrop-blur-xl shadow-[0_0_0_1px_var(--acr-border-soft),0_16px_48px_rgba(0,0,0,0.35)]",h==="x"?"touch-pan-y":"touch-pan-x",ee,e),children:[l.jsx(yx,{}),t,l.jsxs(Hi,{className:"absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:outline-hidden focus-visible:ring-2 focus-visible:ring-[var(--ring)] disabled:pointer-events-none",children:[l.jsx(Ui,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})})]})}function GE({className:e,...t}){return l.jsx("div",{"data-slot":"sheet-header",className:Y("flex flex-col gap-1.5 p-4",e),...t})}function LK({className:e,...t}){return l.jsx("div",{"data-slot":"sheet-footer",className:Y("mt-auto flex flex-col gap-2 p-4",e),...t})}function YE({className:e,...t}){return l.jsx(Rc,{"data-slot":"sheet-title",className:Y("text-foreground font-semibold",e),...t})}function IK({className:e,...t}){return l.jsx(Ac,{"data-slot":"sheet-description",className:Y("text-muted-foreground text-sm",e),...t})}function oy({className:e,...t}){return l.jsx("div",{"data-slot":"skeleton",className:Y("animate-pulse rounded-md bg-[var(--acr-chip)]",e),...t})}function $K({delayDuration:e=0,...t}){return l.jsx(yV,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function BK({...e}){return l.jsx($K,{children:l.jsx(bV,{"data-slot":"tooltip",...e})})}function UK({...e}){return l.jsx(wV,{"data-slot":"tooltip-trigger",...e})}function VK({className:e,sideOffset:t=4,children:n,...r}){return l.jsx(SV,{children:l.jsx(jV,{"data-slot":"tooltip-content",sideOffset:t,className:Y("z-50 w-fit rounded-md bg-[var(--acr-panel)] px-2.5 py-1 text-[11px] text-foreground backdrop-blur-xl shadow-[0_0_0_1px_var(--acr-border-soft),0_6px_16px_rgba(0,0,0,0.18)] origin-(--radix-tooltip-content-transform-origin) data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 [animation-timing-function:var(--acr-spring-default)]! [animation-duration:var(--acr-spring-default-duration)]!",e),...r,children:n})})}p.createContext(null);function ly({className:e,variant:t="default",...n}){return l.jsx("section",{"data-slot":"shell-panel","data-variant":t,className:Y("flex min-w-0 flex-1 flex-col overflow-hidden","[&+&]:border-l [&+&]:border-[var(--acr-border-soft)]",t==="list"&&"w-72 flex-none",t==="detail"&&"flex-[1.35]",e),...n})}function WE({className:e,size:t="default",...n}){return l.jsx("div",{"data-slot":"shell-navbar","data-size":t,className:Y("flex shrink-0 items-center gap-2 border-b border-[var(--acr-border-soft)] px-3",t==="compact"&&"h-10",t==="default"&&"h-11",t==="large"&&"h-[52px]",e),...n})}function FK({className:e,...t}){return l.jsx("div",{"data-slot":"shell-navbar-actions",className:Y("ml-auto flex shrink-0 items-center gap-1",e),...t})}function HK({className:e,...t}){return l.jsx("div",{"data-slot":"shell-panel-header",className:Y("flex min-h-11 shrink-0 items-center gap-2 border-b border-[var(--acr-border-soft)] px-3",e),...t})}function qK({className:e,...t}){return l.jsx("div",{"data-slot":"shell-panel-title",className:Y("min-w-0 truncate text-[13px] font-semibold",e),...t})}function KK({className:e,...t}){return l.jsx("div",{"data-slot":"shell-panel-description",className:Y("min-w-0 truncate text-[11px] text-muted-foreground",e),...t})}function GK({className:e,...t}){return l.jsx("div",{"data-slot":"shell-panel-actions",className:Y("ml-auto flex shrink-0 items-center gap-1",e),...t})}function cy({className:e,padding:t="flush",...n}){return l.jsx("div",{"data-slot":"shell-content","data-padding":t,className:Y("min-h-0 flex-1 overflow-auto",t==="default"&&"p-3",t==="reading"&&"px-8 py-7",e),...n})}const YK="overflow-hidden rounded-[10px] bg-[var(--acr-card-nested)] [&>*+*]:border-t [&>*+*]:border-[var(--acr-border-soft)]",XE="rounded-none hover:bg-[var(--acr-hover)]",uy=120;function WK({conn:e,onPick:t,surface:n,onOpenPackage:r}){const[i,o]=p.useState(""),[c,d]=p.useState([]),[h,m]=p.useState(!0),[x,g]=p.useState(!1),[v,S]=p.useState(null),[b,j]=p.useState(null),[C,k]=p.useState(!1),[N,E]=p.useState(null),R=p.useMemo(()=>c.length?c.find(W=>W.id===v)??c[0]:null,[v,c]),A=(b==null?void 0:b.sources)??[],_=b==null?void 0:b.plugin.sourceGrouping,z=(_==null?void 0:_.resolver)==="adapter.groupByNamespace",D=(b==null?void 0:b.groups)??[],V=N===null?null:D.find(W=>W.key===N)??{key:N,label:N,count:(b==null?void 0:b.total)??A.length},I=(b==null?void 0:b.total)??(V==null?void 0:V.count)??A.length,Q=!!(_!=null&&_.enabled)&&N===null&&D.length>0,B=b!=null&&b.facets.categories.length?b.facets.categories:(R==null?void 0:R.topCategories)??[];p.useEffect(()=>{let W=!0;return m(!0),be.plugins(e).then(M=>{W&&(d(M),S(U=>U&&!M.some(K=>K.id===U)?null:U))}).catch(()=>{}).finally(()=>{W&&m(!1)}),()=>{W=!1}},[]),p.useEffect(()=>{if(!R)return;let W=!0;const M=i.trim()?60:N!==null?500:200;return k(!0),be.pluginSources(e,R.id,{query:i,limit:M,group:N??void 0,surface:n}).then(U=>{W&&j(U)}).catch(()=>{}).finally(()=>{W&&k(!1)}),()=>{W=!1}},[R==null?void 0:R.id,i,N,n]),p.useEffect(()=>{const W=M=>{M.key.toLowerCase()==="k"&&(M.metaKey||M.ctrlKey)&&(M.preventDefault(),g(U=>!U))};return window.addEventListener("keydown",W),()=>window.removeEventListener("keydown",W)},[]);function H(W){S(W),o(""),E(null)}function ee(W){var M,U;return l.jsx(sN,{htmlId:HF(W),source:W,size:"sm",variant:"default",className:XE,onClick:()=>t(W),actions:l.jsxs(l.Fragment,{children:[(M=W.badges)!=null&&M.includes("needs_config")?l.jsx(Bt,{variant:"secondary",size:"sm",className:"text-amber-500/90",children:"需配置"}):null,(U=W.badges)!=null&&U.includes("nsfw")?l.jsx(Bt,{variant:"secondary",size:"sm",className:"text-pink-500/90",children:"NSFW"}):null,l.jsx(Ts,{className:"size-4 text-muted-foreground"})]})},W.id)}return l.jsxs(l.Fragment,{children:[l.jsxs(ly,{variant:"list",className:"w-[22rem]",children:[l.jsxs(HK,{className:"h-[49px] px-3",children:[l.jsx(qK,{children:"我的插件"}),l.jsx(GK,{children:l.jsxs(KK,{children:[c.length," plugins"]})})]}),l.jsxs(cy,{padding:"flush",className:"scrollbar-mac relative",children:[l.jsx("section",{"aria-label":"我的插件",children:l.jsxs("div",{"data-slot":"source-plugin-list",children:[c.map((W,M)=>{const U=(R==null?void 0:R.id)===W.id,K=c[M+1],ne=K&&!U&&(R==null?void 0:R.id)!==K.id;return l.jsxs(p.Fragment,{children:[l.jsx(Tr,{asChild:!0,size:"xs",selected:U,className:["w-full cursor-pointer rounded-none transition-colors",U?"hover:bg-primary":"hover:bg-[var(--acr-card-nested)]"].join(" "),children:l.jsx("button",{type:"button",onClick:()=>H(W.id),className:`w-full items-start px-3 py-2 ${W.enabled===!1?"opacity-55":""}`,children:l.jsxs(zs,{className:"flex min-w-0 flex-col",children:[l.jsxs(xF,{className:"h-4 items-center gap-1.5",children:[l.jsx(fa,{className:"min-w-0 flex-1 text-[13px] font-semibold leading-4",children:W.name}),W.enabled===!1?l.jsx(Bt,{variant:"secondary",size:"sm",className:"text-muted-foreground",children:"已停用"}):null,l.jsxs(jx,{className:"text-[11px] leading-4",children:[W.sourceCount," sources"]})]}),l.jsx(no,{className:"mt-1 text-[11px] leading-[13px]",children:W.tagline||W.description||(W.capabilities.length?W.capabilities.join(" / "):"暂无 sources")}),W.description&&W.description!==W.tagline?l.jsx(no,{className:"mt-1 text-[11px] leading-[13px]",children:W.description}):null]})})}),ne?l.jsx(Uk,{}):null]},W.id)}),!h&&c.length===0?l.jsx(Tr,{variant:"muted",className:"m-3",children:l.jsxs(zs,{children:[l.jsx(fa,{children:"暂无插件"}),l.jsx(no,{children:"当前没有可用的信息源插件。"})]})}):null]})}),h?l.jsx("div",{"data-slot":"source-plugin-loading-overlay",className:"absolute inset-0 z-20 flex items-center justify-center bg-[var(--acr-panel)]/70 backdrop-blur-sm",children:l.jsx(Sr,{className:"size-5 animate-spin text-muted-foreground"})}):null]})]}),l.jsxs(ly,{variant:"detail","data-nested-surface":"true",children:[l.jsxs(WE,{className:"h-[49px] gap-2 px-2",children:[N!==null?l.jsx("button",{type:"button","data-slot":"source-back-slot","aria-label":"返回上一级",onClick:()=>E(null),className:"flex size-8 shrink-0 items-center justify-center rounded-full text-foreground/80 transition-colors hover:bg-white/10 hover:text-foreground",children:l.jsx(S1,{className:"size-5"})}):l.jsx("span",{"data-slot":"source-back-slot","aria-hidden":"true",className:"size-8 shrink-0"}),l.jsxs("nav",{"aria-label":"位置",className:"flex min-w-0 shrink items-center gap-1 text-[12px] text-muted-foreground",children:[l.jsx("span",{className:"truncate",children:(R==null?void 0:R.name)??""}),V?l.jsxs(l.Fragment,{children:[l.jsx(Ts,{className:"size-3 shrink-0 opacity-60"}),l.jsx("span",{className:"truncate text-foreground",children:V.label})]}):null]}),l.jsx(FK,{className:"min-w-0 flex-1",children:l.jsx(Wf,{"data-slot":"source-discovery-search",size:"large",className:"w-full min-w-0 max-w-[26rem]",value:i,onChange:W=>{const M=W.target.value;o(M),M.trim()&&E(null)},onClear:()=>o(""),placeholder:R?`搜索 ${R.name} 的源`:"搜索源","aria-label":R?`搜索 ${R.name} 的源`:"搜索源",shortcut:l.jsx("button",{type:"button",tabIndex:-1,onClick:()=>g(!0),title:"搜索全部插件的源",className:"pointer-events-auto -mx-1.5 -my-0.5 px-1.5 py-0.5 font-mono transition-colors hover:text-foreground",children:"⌘K"})})})]}),l.jsxs(cy,{padding:"flush",className:"scrollbar-mac relative px-3 py-3",children:[l.jsx("section",{"aria-label":"插件源详情",className:"min-h-full",children:l.jsxs("div",{children:[R&&N===null?l.jsx("section",{"aria-label":"插件说明",className:"mb-4 px-2",children:l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[15px] font-semibold leading-5",children:R.name}),R.tagline?l.jsx("div",{className:"mt-0.5 text-[12px] leading-4 text-muted-foreground",children:R.tagline}):null]}),r===void 0?null:l.jsxs(Ne,{variant:"secondary",size:"small",className:"shrink-0",onClick:()=>{r(R.id)},children:[l.jsx(vL,{}),"这是什么包"]})]}),R.enabled===!1?l.jsx("div",{className:"text-[11px] text-amber-500/90",children:"已停用:它的源不再注册。要重新打开它,去「包」页。"}):null,R.description?l.jsx("p",{className:"max-w-3xl text-[13px] leading-relaxed text-muted-foreground",children:R.description}):null,l.jsx("div",{className:"flex flex-wrap items-center gap-1.5",children:R.capabilities.map(W=>l.jsx(Bt,{variant:"secondary",size:"sm",children:YF(W)},W))}),B.length?l.jsx("div",{className:"flex flex-wrap gap-1.5",children:B.slice(0,8).map(W=>l.jsxs("span",{className:"rounded-md bg-[var(--acr-chip)] px-2 py-1 text-[11px] text-muted-foreground",children:[W.label," · ",W.count]},W.key))}):null]})}):null,V&&z?l.jsxs("section",{"aria-label":"Source 分组说明",className:"mb-3 flex flex-wrap items-center gap-3 px-2 text-[12px]",children:[dN(V.key)?l.jsxs("a",{href:dN(V.key),target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-primary underline-offset-2 hover:underline",children:[l.jsx(Mp,{className:"size-3.5"}),"访问站点"]}):null,l.jsxs("a",{href:KF(V.key),target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-muted-foreground underline-offset-2 hover:text-foreground hover:underline",children:[l.jsx(tL,{className:"size-3.5"}),"RSSHub 路由说明"]})]}):null,Q?l.jsx(QE,{ariaLabel:"源分组",heading:`${i.trim()?"搜索结果":"全部分组"} · ${D.length}`,count:D.length,renderRow:W=>{const M=D[W];return l.jsx(Tr,{asChild:!0,size:"sm",className:`cursor-pointer ${XE}`,children:l.jsxs("button",{type:"button",onClick:()=>E(M.key),className:"w-full",children:[l.jsx(Jc,{variant:"image",className:"rounded-[6px] bg-[var(--acr-chip)]",children:l.jsx(XF,{id:M.key||"unclassified",name:M.label})}),l.jsx(zs,{children:l.jsx(fa,{className:"font-semibold",children:M.label})}),l.jsxs(jx,{children:[M.count," 个源"]}),l.jsx(Ts,{className:"size-4 shrink-0 text-muted-foreground"})]})},M.key)}}):l.jsx(QE,{ariaLabel:"源列表",heading:V?`${V.label} · ${I} 个源`:`${A.length} 个源`,count:A.length,empty:!C&&A.length===0?"没有匹配的源":void 0,renderRow:W=>ee(A[W])})]})}),C?l.jsx("div",{"data-slot":"source-loading-overlay",className:"absolute inset-0 z-20 flex items-center justify-center bg-[var(--acr-panel)]/70 backdrop-blur-sm",children:l.jsx(Sr,{className:"size-6 animate-spin text-muted-foreground"})}):null]})]}),l.jsx(w8,{open:x,onOpenChange:g,conn:e,onPick:t,surface:n})]})}function QE({ariaLabel:e,heading:t,count:n,empty:r,renderRow:i}){const[o,c]=p.useState(uy),d=p.useRef(null);return p.useEffect(()=>{c(uy)},[t,n]),p.useEffect(()=>{const h=d.current;if(!h||o>=n)return;if(typeof IntersectionObserver>"u"){c(n);return}const m=new IntersectionObserver(x=>{x.some(g=>g.isIntersecting)&&c(g=>Math.min(n,g+uy))},{rootMargin:"400px"});return m.observe(h),()=>m.disconnect()},[o,n]),r?l.jsx("section",{"aria-label":e,className:"px-3 py-10 text-center text-[12px] text-muted-foreground",children:r}):l.jsxs("section",{"aria-label":e,className:"px-1",children:[l.jsxs("div",{className:"sticky top-0 z-10 -mx-1 mb-1.5 px-3 py-1.5",children:[l.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 backdrop-blur-md [mask-image:linear-gradient(to_bottom,black_55%,transparent)]"}),l.jsx("span",{className:"relative text-[11px] font-semibold tracking-[0.06em] text-muted-foreground",children:t})]}),l.jsx("div",{className:YK,children:Array.from({length:Math.min(o,n)},(h,m)=>i(m))}),o<n?l.jsx("div",{ref:d,"aria-hidden":"true",className:"h-8"}):null]})}function XK({open:e,onOpenChange:t,conn:n,onPick:r,surface:i}){return l.jsx(hs,{open:e,onOpenChange:t,children:l.jsxs(Vr,{className:"h-[80vh] max-w-[64rem] overflow-hidden p-0",children:[l.jsx(Fr,{className:"sr-only",children:"选择来源"}),l.jsx("div",{className:"flex h-full min-h-0",children:l.jsx(WK,{conn:n,onPick:r,surface:i})})]})})}const ZE="text-[11px] font-semibold tracking-[0.06em] text-muted-foreground",QK="text-[11px] leading-snug text-muted-foreground";function ZK({className:e,children:t}){return l.jsx("div",{className:Y("flex flex-col gap-5",e),children:t})}function JE({title:e,footnote:t,collapsible:n=!1,open:r,onOpenChange:i,actions:o,children:c}){const d=!n||!!r;return l.jsxs("section",{className:"min-w-0",children:[e?n?l.jsxs("button",{type:"button",onClick:()=>i==null?void 0:i(!r),"aria-expanded":d,className:"group flex w-full items-center gap-1 px-3 pb-1.5 text-left",children:[l.jsx(Ts,{"aria-hidden":"true",className:Y("size-3 shrink-0 text-muted-foreground","transition-transform duration-[var(--acr-spring-default-duration)] ease-[var(--acr-spring-default)]",d&&"rotate-90")}),l.jsx("span",{className:ZE,children:e}),o?l.jsx("span",{className:"ml-auto",children:o}):null]}):l.jsxs("div",{className:"flex items-center gap-2 px-3 pb-1.5",children:[l.jsx("span",{className:ZE,children:e}),o?l.jsx("span",{className:"ml-auto",children:o}):null]}):null,d?l.jsx("div",{className:"overflow-hidden rounded-[10px] bg-[var(--acr-card-nested)] [&>*+*]:border-t [&>*+*]:border-[var(--acr-border-soft)]",children:c}):null,d&&t?l.jsx("p",{className:Y("mt-1.5 px-3",QK),children:t}):null]})}function dy({className:e,children:t}){return l.jsx("div",{className:Y("px-3 py-3",e),children:t})}const fy=DU,hy=_U,wh=p.forwardRef(({className:e,align:t="start",sideOffset:n=4,container:r,...i},o)=>l.jsx(OU,{container:r,children:l.jsx(TC,{ref:o,align:t,sideOffset:n,className:Y("z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-[10px] bg-[var(--acr-panel)] p-4 text-foreground backdrop-blur-xl shadow-[0_0_0_1px_rgba(190,190,190,0.16),0_16px_48px_rgba(0,0,0,0.45)] outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 [animation-timing-function:var(--acr-spring-default)]! [animation-duration:var(--acr-spring-default-duration)]!",e),...i})}));wh.displayName=TC.displayName;function JK({options:e=[],groups:t,value:n,onValueChange:r,placeholder:i="Select…",searchPlaceholder:o="Search…",emptyText:c="No results.",size:d="medium",className:h,contentClassName:m,modal:x,container:g}){const[v,S]=p.useState(!1),b=t??[{options:e}],C=b.flatMap(N=>N.options).find(N=>N.value===n),k=N=>l.jsxs(EN,{value:N.label,onSelect:()=>{r==null||r(N.value===n?"":N.value),S(!1)},children:[l.jsx(Ns,{className:Y("size-3.5",N.value===n?"opacity-100":"opacity-0")}),N.label]},N.value);return l.jsxs(fy,{open:v,onOpenChange:S,modal:x,children:[l.jsx(hy,{asChild:!0,children:l.jsxs("button",{type:"button",role:"combobox","aria-expanded":v,"data-slot":"combobox-trigger",className:Y(Rk({size:d}),"items-center justify-between gap-2",!C&&"text-muted-foreground",h),children:[l.jsx("span",{className:"truncate",children:C?C.label:i}),l.jsx(zo,{className:"size-3.5 shrink-0 opacity-60"})]})}),l.jsx(wh,{align:"start",container:g,className:Y("w-[var(--radix-popover-trigger-width)] min-w-[12rem] p-0",m),children:l.jsxs(jN,{children:[l.jsx(CN,{placeholder:o}),l.jsxs(kN,{children:[l.jsx(NN,{children:c}),b.map((N,E)=>l.jsx(TN,{heading:N.heading,children:N.options.map(k)},N.heading??E))]})]})})]})}const eG=p.createContext(null);function tG(){const e=p.useContext(eG);if(!e)throw new Error("usePreview must be used inside <PreviewContext.Provider>");return e}function eR({...e}){return l.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function tR({className:e,...t}){return l.jsx("ol",{"data-slot":"breadcrumb-list",className:Y("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...t})}function Sh({className:e,...t}){return l.jsx("li",{"data-slot":"breadcrumb-item",className:Y("inline-flex items-center gap-1.5",e),...t})}function nR({asChild:e,className:t,...n}){const r=e?Fi:"a";return l.jsx(r,{"data-slot":"breadcrumb-link",className:Y("hover:text-foreground transition-colors",t),...n})}function rR({className:e,...t}){return l.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:Y("text-foreground font-normal",e),...t})}function my({children:e,className:t,...n}){return l.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:Y("text-[var(--label-tertiary)] [&>svg]:size-3.5",t),...n,children:e??l.jsx(Ts,{})})}function jh({className:e,...t}){return l.jsx("div",{"data-slot":"input-group",role:"group",className:Y("group/input-group relative flex w-full min-w-0 flex-wrap items-center","border border-[var(--acr-control-border)] bg-[var(--acr-control)] rounded-[6px]","text-foreground outline-none transition-colors","hover:border-[var(--acr-border)]","focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/25","has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-50","has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:items-stretch","has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:items-stretch",e),onClick:n=>{var i;n.target.closest("button, a, input, textarea, select")||(i=n.currentTarget.querySelector("[data-slot=input-group-control]"))==null||i.focus()},...t})}function nG({className:e,...t}){return l.jsx("input",{"data-slot":"input-group-control",className:Y("order-1 h-6 min-w-0 flex-1 border-0 bg-transparent px-2 text-[13px] text-foreground outline-none","placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground","disabled:cursor-not-allowed",e),...t})}const Ch=p.forwardRef(({autoResize:e=!1,maxRows:t=3,className:n,value:r,onChange:i,onInput:o,...c},d)=>{const h=p.useRef(null),m=g=>{h.current=g,typeof d=="function"?d(g):d&&(d.current=g)},x=p.useCallback(()=>{if(!e)return;const g=h.current;if(!g)return;g.style.height="auto";const v=getComputedStyle(g),S=parseFloat(v.lineHeight)||20,b=parseFloat(v.paddingTop)+parseFloat(v.paddingBottom),j=S*t+b;g.style.height=`${Math.min(g.scrollHeight,j)}px`,g.style.overflowY=g.scrollHeight>j?"auto":"hidden"},[e,t]);return p.useEffect(x,[x,r]),l.jsx("textarea",{ref:m,"data-slot":"input-group-control",rows:1,value:r,onChange:g=>{i==null||i(g),x()},onInput:g=>{o==null||o(g),x()},className:Y("order-1 min-w-0 flex-1 resize-none border-0 bg-transparent px-2 py-1.5 text-[13px] leading-5 text-foreground outline-none","placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground","disabled:cursor-not-allowed scrollbar-mac",n),...c})});Ch.displayName="InputGroupTextarea";function rG({className:e,align:t="inline-start",...n}){return l.jsx("div",{"data-slot":"input-group-addon","data-align":t,className:Y("flex items-center gap-1.5 text-muted-foreground [&_svg]:pointer-events-none [&_svg]:size-3.5 [&_svg]:shrink-0",t==="inline-start"&&"order-0 pl-2 has-[>[data-slot=input-group-button]]:pl-0.5",t==="inline-end"&&"order-2 pr-2 has-[>[data-slot=input-group-button]]:pr-0.5",t==="block-start"&&"order-0 w-full px-2 pt-1.5 [&_[data-slot=input-group-text]]:text-[11px] has-[>[data-slot=input-group-button]]:pt-0.5 has-[>[data-slot=input-group-button]]:pr-0.5",t==="block-end"&&"order-2 w-full px-2 pb-1.5 [&_[data-slot=input-group-text]]:text-[11px] has-[>[data-slot=input-group-button]]:pb-0.5 has-[>[data-slot=input-group-button]]:pr-0.5",e),onClick:r=>{var o,c;r.target.closest("button, a, input, textarea, select")||(c=(o=r.currentTarget.closest("[data-slot=input-group]"))==null?void 0:o.querySelector("[data-slot=input-group-control]"))==null||c.focus()},...n})}const sR={root:"All files",loading:"Loading…",empty:"This folder is empty",noMatches:"No matches",selectionEmpty:"Nothing selected",searchLocal:"Search this folder…",searchSubtree:"Search everything below…",newFolder:"New folder",newFolderPlaceholder:"Folder name",nameRequired:"Name required",nameTaken:"That name is taken",title:"Choose a location",description:"Browse the list below, then confirm your selection.",cancel:"Cancel",confirm:"Choose"};function bu(e,t){return e==="/"||e===""?`/${t}`:`${e}/${t}`}function sG(e,t){const n=[{label:t,path:"/"}];let r="";for(const i of e.split("/").filter(Boolean))r=`${r}/${i}`,n.push({label:i,path:r});return n}function aG({loadDir:e,searchDir:t,onCreateFolder:n,defaultPath:r="/",path:i,onPathChange:o,select:c="dir",value:d,onValueChange:h,labels:m,className:x}){const g={...sR,...m},[v,S]=p.useState(r),b=i??v,[j,C]=p.useState([]),[k,N]=p.useState(!0),[E,R]=p.useState(null),A=c==="dir"||c==="any",[_,z]=p.useState("in"),D=p.useRef(null),V=p.useRef(!1),I=p.useCallback((ge,Ye)=>{var kt;V.current=!!((kt=D.current)!=null&&kt.contains(document.activeElement));const je=zt=>zt.split("/").filter(Boolean).length;z(je(ge)<je(b)?"out":"in"),i===void 0&&S(ge),o==null||o(ge),A&&(h==null||h(ge,Ye))},[b,i,o,A,h]),Q=p.useRef(!1);p.useEffect(()=>{A&&!Q.current&&(Q.current=!0,h==null||h(b,null))},[A,b,h]);const B=p.useRef(e);B.current=e,p.useEffect(()=>{let ge=!0;return N(!0),R(null),B.current(b).then(Ye=>{ge&&C(Ye)}).catch(Ye=>{ge&&(C([]),R(Ye instanceof Error?Ye.message:String(Ye)))}).finally(()=>{ge&&N(!1)}),()=>{ge=!1}},[b]);const[H,ee]=p.useState(""),[W,M]=p.useState(null),[U,K]=p.useState(null),[ne,q]=p.useState(null),[P,L]=p.useState(null),[G,J]=p.useState(0),[$,se]=p.useState(!1);p.useLayoutEffect(()=>{D.current&&(D.current.scrollTop=0),se(!1)},[b]);const[oe,ie]=p.useState(b),[Z,ve]=p.useState(H);b!==oe?(ie(b),ee(""),ve(""),M(null),K(null),q(null),L(null),J(0)):H!==Z&&(ve(H),J(0));const Ee=p.useRef(t);Ee.current=t,p.useEffect(()=>{const ge=H.trim();if(!Ee.current||!ge){M(null),K(null);return}let Ye=!0;return Ee.current(b,ge).then(je=>{Ye&&(M(je),K(null))}).catch(je=>{Ye&&(M(null),K(je instanceof Error?je.message:String(je)))}),()=>{Ye=!1}},[b,H]);const[Te,Ie]=p.useState(!1),Fe=p.useRef(!0);p.useEffect(()=>(Fe.current=!0,()=>{Fe.current=!1}),[]);const fe=p.useCallback(async()=>{if(Te||!n||ne===null)return;const ge=ne.trim();if(!ge){L(g.nameRequired);return}if(j.some(Ye=>Ye.name===ge)){L(g.nameTaken);return}Ie(!0),L(null);try{if(await n(b,ge),!Fe.current)return;q(null);const Ye=await B.current(b);if(!Fe.current)return;C(Ye),I(bu(b,ge),{name:ge,isDir:!0})}catch(Ye){if(!Fe.current)return;L(Ye instanceof Error?Ye.message:String(Ye))}finally{Fe.current&&Ie(!1)}},[n,ne,Te,j,b,g.nameRequired,g.nameTaken,I]),Se=p.useMemo(()=>{const ge=H.trim().toLowerCase();return[...W??(ge?j.filter(je=>je.name.toLowerCase().includes(ge)):j)].sort((je,kt)=>Number(kt.isDir)-Number(je.isDir))},[j,W,H]),ye=Se.length===0?-1:Math.min(G,Se.length-1),Qe=H.trim().length>0,nt=sG(b,g.root),re=p.useCallback(ge=>{var kt;const Ye=(kt=D.current)==null?void 0:kt.querySelectorAll('[role="option"]');if(!Ye||Ye.length===0)return;const je=Math.max(0,Math.min(ge,Ye.length-1));J(je),Ye[je].focus()},[]),_e=p.useRef(k);p.useEffect(()=>{const ge=_e.current;_e.current=k,ge&&!k&&V.current&&(V.current=!1,Se.length>0&&re(0))},[k,Se,re]);const Pe=p.useMemo(()=>{const ge=b.split("/").filter(Boolean);return ge.pop(),ge.length===0?"/":`/${ge.join("/")}`},[b]),Xe=ge=>{if(!ge.target.closest('[role="option"]'))return;const je=Se[ye];switch(ge.key){case"ArrowDown":ge.preventDefault(),re(ye+1);break;case"ArrowUp":ge.preventDefault(),re(ye-1);break;case"ArrowRight":je!=null&&je.isDir&&(ge.preventDefault(),I(bu(b,je.name),je));break;case"ArrowLeft":b!=="/"&&(ge.preventDefault(),I(Pe,null));break;case"Enter":{if(!je)break;if(ge.preventDefault(),je.isDir){I(bu(b,je.name),je);break}c!=="dir"&&(h==null||h(bu(b,je.name),je));break}}};return l.jsxs("div",{className:Y("flex min-h-0 flex-col gap-2",x),children:[l.jsx(eR,{children:l.jsx(tR,{className:"gap-1 sm:gap-1.5",children:nt.map((ge,Ye)=>l.jsxs(p.Fragment,{children:[l.jsx(Sh,{children:Ye===nt.length-1?l.jsx(rR,{children:ge.label}):l.jsx(nR,{asChild:!0,children:l.jsx("button",{type:"button",onClick:()=>I(ge.path,null),children:ge.label})})}),Ye<nt.length-1&&l.jsx(my,{})]},ge.path))})}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(jh,{className:"flex-1",children:[l.jsx(nG,{type:"search",value:H,onChange:ge=>ee(ge.target.value),placeholder:t?g.searchSubtree:g.searchLocal,"aria-label":t?g.searchSubtree:g.searchLocal}),l.jsx(rG,{children:l.jsx(zp,{})})]}),n&&l.jsx(Ne,{type:"button",icon:!0,size:"medium",variant:"ghost","aria-label":g.newFolder,disabled:Te,onClick:()=>{q(""),L(null)},children:l.jsx(uL,{})})]}),l.jsxs("div",{ref:D,role:"listbox","aria-label":nt[nt.length-1].label,onKeyDown:Xe,onScroll:ge=>se(ge.currentTarget.scrollTop>0),style:$?{maskImage:"linear-gradient(to bottom, transparent 0, black 12px)",WebkitMaskImage:"linear-gradient(to bottom, transparent 0, black 12px)"}:void 0,className:"min-h-[12rem] flex-1 overflow-y-auto overflow-x-hidden scrollbar-mac",children:[ne!==null&&l.jsxs("div",{className:"flex flex-col gap-1 px-2 py-1.5",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(C1,{className:"size-3.5 shrink-0 text-muted-foreground"}),l.jsx("input",{autoFocus:!0,"aria-label":g.newFolder,placeholder:g.newFolderPlaceholder,value:ne,disabled:Te,onChange:ge=>q(ge.target.value),onKeyDown:ge=>{ge.key==="Enter"&&(ge.preventDefault(),fe()),ge.key==="Escape"&&(ge.preventDefault(),q(null),L(null))},className:"min-w-0 flex-1 border-0 bg-transparent text-sm outline-none"})]}),P&&l.jsx("p",{className:"pl-6 text-sm text-destructive",children:P})]}),l.jsx("div",{role:"presentation","data-direction":_,className:Y("flex flex-col gap-0.5","motion-safe:animate-in motion-safe:fade-in","motion-safe:data-[direction=in]:slide-in-from-right-2","motion-safe:data-[direction=out]:slide-in-from-left-2"),style:{animationDuration:"var(--acr-spring-default-duration)",animationTimingFunction:"var(--acr-spring-default)"},children:k?l.jsxs("div",{className:"flex flex-col gap-1 p-1",children:[l.jsx(oy,{className:"h-8 w-full"}),l.jsx(oy,{className:"h-8 w-2/3"})]}):E?l.jsx("p",{className:"px-2 py-3 text-sm text-destructive",children:E}):Qe&&U?l.jsx("p",{className:"px-2 py-3 text-sm text-destructive",children:U}):Se.length===0?l.jsx("p",{className:"px-2 py-3 text-sm text-muted-foreground",children:Qe?g.noMatches:g.empty}):Se.map((ge,Ye)=>{const je=bu(b,ge.name),kt=ge.isDir?c!=="file":c!=="dir",zt=d!=null&&d===je,Qn=ge.isDir||kt;return l.jsx(Tr,{asChild:!0,size:"xs",selected:zt,className:Y("w-full",Qn?"cursor-pointer active:scale-[0.995] [&:not([data-selected])]:hover:bg-[var(--acr-hover)]":"cursor-default opacity-45"),children:l.jsxs("div",{role:"option","aria-selected":zt,"aria-disabled":!kt&&!ge.isDir?!0:void 0,tabIndex:Ye===ye?0:-1,onFocus:()=>J(Ye),onClick:()=>{if(ge.isDir){I(je,ge);return}kt&&(h==null||h(je,ge))},children:[l.jsx(Jc,{className:"group-data-[size=xs]/item:size-4",children:ge.isDir?l.jsx(C1,{}):l.jsx(cL,{})}),l.jsx(zs,{className:"min-w-0 truncate text-sm",children:ge.name})]})},`${ge.isDir}:${ge.name}`)})},b)]}),d!==b&&l.jsx("div",{"data-testid":"file-picker-selection",className:"shrink-0 truncate text-sm text-muted-foreground",children:d??g.selectionEmpty})]})}function aR({open:e,onOpenChange:t,commitOnSelect:n,onCommit:r,value:i,onValueChange:o,labels:c,className:d,...h}){const m={...sR,...c},[x,g]=p.useState(null),[v,S]=p.useState(e);e!==v&&(S(e),e&&g(null));const b=i!==void 0?i:(x==null?void 0:x.path)??null,j=(C,k)=>{r==null||r(C,k),t(!1)};return l.jsx(hs,{open:e,onOpenChange:t,children:l.jsxs(Vr,{showCloseButton:!1,children:[l.jsxs(Os,{children:[l.jsx(Fr,{children:m.title}),l.jsx(Qa,{className:"sr-only",children:m.description})]}),l.jsx(aG,{...h,labels:c,value:b,className:Y("h-[26rem]",d),onValueChange:(C,k)=>{g(C===null?null:{path:C,entry:k}),o==null||o(C,k),n&&C!==null&&k!==null&&!k.isDir&&j(C,k)}}),l.jsxs(Xc,{children:[l.jsx(Ne,{variant:"neutral",onClick:()=>t(!1),children:m.cancel}),l.jsx(Ne,{disabled:!b,onClick:()=>{b&&j(b,(x==null?void 0:x.path)===b?x.entry:null)},children:m.confirm})]})]})})}const iR={root:"根目录",loading:"加载中…",empty:"空目录",noMatches:"没有匹配项",selectionEmpty:"未选择",searchLocal:"搜索当前目录…",searchSubtree:"搜索这个目录下的全部目录…",newFolder:"新建文件夹",newFolderPlaceholder:"文件夹名",nameRequired:"名字不能为空",nameTaken:"这个名字已经被占用",title:"选择网盘目录",description:"浏览下面的列表,选中一个目录后确认。",cancel:"取消",confirm:"选定此目录"};function oR(e){return e.map(t=>({name:t.name,isDir:t.isDir,meta:{size:t.size}}))}function lR(e,t){return e==="/"||e===""?`/${t}`:`${e}/${t}`}function py(e){const t=e.replace(/\/+$/,"");return t===""?"/":t}function cR(e,t){const n=py(t);if(e===n)return!0;const r=n==="/"?"/":`${n}/`;return e.startsWith(r)}function iG(e,t){const n=py(t);return cR(e,n)?n==="/"?e.slice(1):e.slice(n.length+1):null}function uR(e,t={}){const n=p.useRef(null),r=t.dirs;return{fetchRecursive:o=>{var c;return((c=n.current)==null?void 0:c.path)!==o&&(n.current={path:o,entries:be.netdisk.listFs(e,o,{recursive:!0,refresh:!0,dirs:r}).then(d=>oR(d.files))},n.current.entries.catch(()=>{var d;((d=n.current)==null?void 0:d.path)===o&&(n.current=null)})),n.current.entries},invalidate:()=>{n.current=null}}}function Sl({apiBase:e="",open:t,onOpenChange:n,initialPath:r="/",onPick:i}){const o={baseUrl:e},[c,d]=p.useState(r),{fetchRecursive:h,invalidate:m}=uR(o,{dirs:!0}),[x,g]=p.useState(t);return t!==x&&(g(t),t&&(d(r),m())),l.jsx(aR,{open:t,onOpenChange:n,select:"dir",path:c,onPathChange:d,labels:iR,loadDir:async v=>oR((await be.netdisk.listFs(o,v)).files),searchDir:(v,S)=>h(v).then(b=>{const j=S.trim().toLowerCase(),C=b.filter(k=>k.isDir);return j?C.filter(k=>k.name.toLowerCase().includes(j)):C}),onCreateFolder:async(v,S)=>{await be.netdisk.mkdir(o,lR(v,S))},onCommit:v=>i(v)})}function dR({apiBase:e="",open:t,onOpenChange:n,dirPath:r,entryTitle:i,current:o=null,onPick:c}){const d={baseUrl:e},h=py(r),{fetchRecursive:m,invalidate:x}=uR(d),[g,v]=p.useState(h),[S,b]=p.useState(t);return t!==S&&(b(t),t&&(x(),v(h))),l.jsx(aR,{open:t,onOpenChange:n,select:"file",commitOnSelect:!0,path:g,onPathChange:j=>{cR(j,h)&&v(j)},labels:{...iR,title:i?`选择网盘文件 · ${i}`:"选择网盘文件",description:"浏览下面的列表,点选一个文件即可提交。",confirm:"选定此文件",searchSubtree:"搜索这个目录下的全部文件…"},value:o!=null?lR(h,o):void 0,loadDir:m,searchDir:(j,C)=>m(j).then(k=>{const N=C.trim().toLowerCase();return N?k.filter(E=>E.name.toLowerCase().includes(N)):k}),onCommit:j=>{const C=iG(j,h);C!==null&&c(C)}})}function uo(e=""){var i;const t=[],n=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\))/g;let r=0;for(const o of e.matchAll(n)){o.index>r&&t.push(e.slice(r,o.index));const c=o[0];if(c.startsWith("`"))t.push(l.jsx("code",{className:"rounded bg-[var(--acr-card-nested)] px-1 py-0.5 font-mono text-[12px] text-foreground",children:c.slice(1,-1)},`${o.index}-code`));else if(c.startsWith("**"))t.push(l.jsx("strong",{className:"font-semibold text-foreground",children:c.slice(2,-2)},`${o.index}-strong`));else{const d=c.match(/^\[([^\]]+)\]\(([^)]+)\)$/),h=(i=d==null?void 0:d[2])==null?void 0:i.trim();t.push(h&&d?l.jsx("a",{href:h,target:"_blank",rel:"noreferrer",className:"text-primary underline-offset-2 hover:underline",children:d[1]},`${o.index}-link`):c)}r=o.index+c.length}return r<e.length&&t.push(e.slice(r)),t}function gy({text:e,headingBase:t}){return l.jsx(fR,{blocks:cN(e,{headingBase:t})})}function fR({blocks:e}){return l.jsx("div",{className:"space-y-3 text-[13px] leading-relaxed text-muted-foreground",children:e.map((t,n)=>{if(t.type==="heading"){const r=t.level===1?"pt-2 text-[18px] font-bold text-foreground":t.level===2?"pt-2 text-[16px] font-semibold text-foreground":"pt-1 text-[14px] font-semibold text-foreground",i=`h${t.level}`;return l.jsx(i,{className:r,children:uo(t.text)},n)}if(t.type==="callout")return l.jsxs("div",{className:"rounded-lg border border-primary/20 bg-primary/10 px-3 py-2 text-[13px] text-foreground/90",children:[l.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase text-primary/80",children:t.tone||"tip"}),l.jsx("div",{className:"whitespace-pre-wrap",children:uo(t.text)})]},n);if(t.type==="list"){const r=t.ordered?"ol":"ul";return l.jsx(r,{className:`${t.ordered?"list-decimal":"list-disc"} space-y-1 pl-5`,children:t.items.map((i,o)=>l.jsx("li",{children:uo(i)},o))},n)}if(t.type==="code")return l.jsx("pre",{className:"overflow-x-auto rounded-lg bg-[var(--acr-card-nested)] px-3 py-2 font-mono text-[12px] text-foreground/90",children:l.jsx("code",{children:t.text})},n);if(t.type==="blockquote")return l.jsx("blockquote",{className:"border-l-2 border-[var(--acr-border)] pl-3 text-foreground/80",children:uo(t.text)},n);if(t.type==="table"){const[r,...i]=t.rows;return l.jsx("div",{className:"overflow-x-auto rounded-lg border border-[var(--acr-border-soft)]",children:l.jsxs("table",{className:"w-full min-w-[28rem] border-collapse text-left text-[12px]",children:[r?l.jsx("thead",{className:"bg-[var(--acr-card-nested)] text-foreground",children:l.jsx("tr",{children:r.map((o,c)=>l.jsx("th",{className:"border-b border-[var(--acr-border-soft)] px-3 py-2 font-semibold",children:uo(o)},c))})}):null,l.jsx("tbody",{children:i.map((o,c)=>l.jsx("tr",{className:"border-t border-[var(--acr-border-soft)] first:border-t-0",children:o.map((d,h)=>l.jsx("td",{className:"px-3 py-2 align-top",children:uo(d)},h))},c))})]})},n)}return l.jsx("p",{children:uo(t.text)},n)})})}const oG={"netdisk-dir":cG};function lG({name:e,spec:t,value:n,onChange:r,container:i,apiBase:o=""}){const c=t.widget?oG[t.widget]:void 0,d=UF(t),h=`param-${e}`;return l.jsxs(cr,{orientation:"vertical",children:[l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsxs(ur,{htmlFor:h,children:[e,t.required?" *":""]}),t.description?l.jsxs(Px,{openDelay:100,children:[l.jsx(Lx,{asChild:!0,children:l.jsx("button",{type:"button",tabIndex:-1,"aria-label":`${e} 说明`,className:"inline-flex text-muted-foreground/70 transition-colors hover:text-foreground",children:l.jsx(Dp,{className:"size-3.5"})})}),l.jsx(Ix,{container:i,align:"start",className:"max-h-80 w-80 overflow-y-auto",children:l.jsx(gy,{text:t.description})})]}):null]}),c?l.jsx(c,{id:h,value:n,onChange:r,apiBase:o}):d.length?l.jsxs(la,{value:n||t.default||void 0,onValueChange:r,children:[l.jsx(ua,{id:h,className:"w-full",children:l.jsx(ca,{placeholder:t.default||"选择一个选项"})}),l.jsx(da,{children:d.map(m=>l.jsx(lr,{value:m.value,children:m.label},m.value))})]}):l.jsx(Jt,{id:h,value:n,onChange:m=>r(m.target.value)})]})}function cG({id:e,value:t,onChange:n,apiBase:r}){const[i,o]=p.useState(!1);return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex w-full items-center gap-2",children:[l.jsx(Jt,{id:e,className:"flex-1",value:t,placeholder:"/夸克网盘/我的转存/某节目",onChange:c=>n(c.target.value)}),l.jsxs(Ne,{type:"button",size:"small",variant:"neutral",onClick:()=>o(!0),children:[l.jsx($i,{})," 浏览"]})]}),l.jsx(Sl,{apiBase:r,open:i,onOpenChange:o,initialPath:t||"/",onPick:c=>{n(c),o(!1)}})]})}function hR(e){return e.kind==="pick"?null:e.kind==="stream"?e.memberIndex===void 0?{action:"append-stream",streamId:e.streamId}:{action:"edit-stream-member",streamId:e.streamId,memberIndex:e.memberIndex}:e.memberIndex===void 0?{action:"append-provider",providerId:e.providerId}:{action:"edit-provider-member",providerId:e.providerId,memberIndex:e.memberIndex}}function xy(e){return e.sources.map(t=>({plugin:uG(t),source:dG(t),params:t.params}))}function uG(e){var t;return((t=e.source)==null?void 0:t.pluginId)??e.plugin_id??""}function dG(e){var t;return((t=e.source)==null?void 0:t.id)??e.source_template_id??""}async function fG(e){const{conn:t,source:n,dest:r,params:i}=e,o={plugin:n.pluginId,source:n.id,params:i},c={source:n.id,...e.memberName?{name:e.memberName}:{},params:i};switch(r.action){case"create-stream":{const d=e.channels.find(x=>x.id===r.channelId);if(!d)throw new Error("channel not found");const h=BF(n.id),m=h+"-"+Math.random().toString(36).slice(2,7);await be.subscribe(t,{id:m,label:e.name||n.id,strategy:"fanout",cadence_seconds:172800,members:[o],options:{vault_subdir:h},channel_id:d.id});return}case"append-stream":{const d=e.streams.find(h=>h.id===r.streamId);if(!d)throw new Error("stream not found");await be.patchStreamMembers(t,d.id,[...xy(d),o]);return}case"edit-stream-member":{const d=e.streams.find(m=>m.id===r.streamId);if(!d)throw new Error("stream not found");const h=xy(d);h[r.memberIndex]=o,await be.patchStreamMembers(t,d.id,h);return}case"append-provider":{const d=e.providers.find(h=>h.id===r.providerId);if(!d)throw new Error("provider not found");await be.patchProvider(t,d.id,{members:[...d.members,c]});return}case"edit-provider-member":{const d=e.providers.find(m=>m.id===r.providerId);if(!d)throw new Error("provider not found");const h=d.members.map((m,x)=>x===r.memberIndex&&"source"in m?{source:m.source,...m.name?{name:m.name}:{},params:i}:m);await be.patchProvider(t,d.id,{members:h});return}}}function mR({open:e,onOpenChange:t,conn:n,source:r,target:i,streams:o,providers:c,channels:d,initialParams:h,initialName:m,defaultChannelId:x,onSubmitted:g}){const v=p.useMemo(()=>Object.entries(r.paramsSchema),[r]),S=p.useMemo(()=>{const fe=qF(r);return fe?cN(fe):[]},[r]),[b,j]=p.useState(()=>hR(i)),[C,k]=p.useState(m??r.title??r.id),[N,E]=p.useState(x??""),[R,A]=p.useState(h??{}),[_,z]=p.useState(!1),[D,V]=p.useState(null),[I,Q]=p.useState(!1),[B,H]=p.useState(null),{openPreview:ee}=tG(),W=r.runtimeConfig,[M,U]=p.useState({}),[K,ne]=p.useState({}),q=!!(W!=null&&W.perInstance),P=gR(h==null?void 0:h.tokenName),[L,G]=p.useState(P),J=q&&L?vy(L):void 0,$=JSON.stringify(i);p.useEffect(()=>{e&&(j(hR(i)),k(m??r.title??r.id),E(x??""),A(h??{}),G(gR(h==null?void 0:h.tokenName)),Q(!1),V(null))},[e,r.id,$]);const se=fe=>Object.fromEntries(Object.entries(fe).filter(([Se,ye])=>{var Qe;return ye&&((Qe=W==null?void 0:W.fields[Se])==null?void 0:Qe.type)==="secret"}));p.useEffect(()=>{if(!W||!e)return;if(q&&!J){U(se),ne({});return}let fe=!0;const Se=setTimeout(()=>{fetch(`${n.baseUrl}/api/source-runtime-config/status`,{method:"POST",headers:{"content-type":"application/json",...n.token?{Authorization:`Bearer ${n.token}`}:{}},body:JSON.stringify({pluginId:r.pluginId,sourceId:r.id,...J?{ref:J}:{}})}).then(ye=>ye.ok?ye.json():Promise.reject()).then(ye=>{fe&&(U(Qe=>({...ye.values,...se(Qe)})),ne(Object.fromEntries(Object.entries(ye.secrets).map(([Qe,nt])=>[Qe,nt.configured]))))}).catch(()=>{fe&&(U(se),ne({}))})},300);return()=>{fe=!1,clearTimeout(Se)}},[n.baseUrl,n.token,e,W,q,J,r.id,r.pluginId]);const oe=(b==null?void 0:b.action)==="create-stream",ie=(b==null?void 0:b.action)==="edit-stream-member"||(b==null?void 0:b.action)==="edit-provider-member",{pickMap:Z,pickGroups:ve}=p.useMemo(()=>{const fe={"create-stream":{action:"create-stream",channelId:""}},Se=[{options:[{value:"create-stream",label:"新建 Stream"}]}];if(o.length){Se.push({heading:"Stream",options:o.map(ye=>({value:"stream:"+ye.id,label:ye.description||ye.id}))});for(const ye of o)fe["stream:"+ye.id]={action:"append-stream",streamId:ye.id}}if(c.length){Se.push({heading:"Provider",options:c.map(ye=>({value:"provider:"+ye.id,label:ye.label}))});for(const ye of c)fe["provider:"+ye.id]={action:"append-provider",providerId:ye.id}}return{pickMap:fe,pickGroups:Se}},[o,c]);async function Ee(){if(!b){V("请选择目的地");return}let fe=b;if(b.action==="create-stream"){if(!N){V("请选择频道");return}fe={action:"create-stream",channelId:N}}const Se=lN(r.paramsSchema,R);if(!Se.ok){V(`缺少必填参数: ${Se.missing}`);return}if(q&&!pR.test(L)){V("实例名必填,且只能用字母、数字、下划线或短横线");return}const ye=W&&Object.entries(W.fields).find(([Qe,nt])=>nt.required&&!M[Qe]&&!K[Qe]);if(ye){V(`缺少运行时配置: ${ye[1].label}`);return}if(z(!0),V(null),!I)try{const Qe=q?{...Se.params,tokenName:vy(L)}:Se.params;await fG({conn:n,source:r,dest:fe,name:C,memberName:q?L:void 0,params:Qe,streams:o,providers:c,channels:d}),Q(!0)}catch(Qe){V(Qe.message),z(!1);return}if(W&&Object.keys(W.fields).length)try{await Ie()}catch(Qe){g==null||g(),V(`成员已保存,但 key 未保存(${Qe.message})——请重新打开这一档补填 key`),z(!1);return}g==null||g(),t(!1),z(!1)}function Te(){const fe=lN(r.paramsSchema,R);if(!fe.ok){V(`缺少必填参数: ${fe.missing}`);return}V(null),ee({kind:"source",sourceId:r.id,params:fe.params,label:C||r.title||r.id})}async function Ie(){if(!W)return;const fe=await fetch(`${n.baseUrl}/api/source-runtime-config`,{method:"PUT",headers:{"content-type":"application/json",...n.token?{Authorization:`Bearer ${n.token}`}:{}},body:JSON.stringify({pluginId:r.pluginId,sourceId:r.id,...J?{ref:J}:{},values:M})});if(!fe.ok)throw new Error("保存 Source 配置失败");const Se=await fe.json();U(Se.values),ne(Object.fromEntries(Object.entries(Se.secrets).map(([ye,Qe])=>[ye,Qe.configured])))}const Fe=ie?"保存":oe?"新建 Stream":"添加";return l.jsx(ay,{open:e,onOpenChange:t,children:l.jsx(iy,{side:"right",className:"w-[max(26rem,50vw)] p-0 sm:max-w-none",children:l.jsxs("div",{ref:H,className:"flex min-h-0 flex-1 flex-col",children:[l.jsx(GE,{className:"px-4 pt-4",children:l.jsx(YE,{children:r.title||r.id})}),l.jsx("div",{className:"scrollbar-mac min-h-0 flex-1 overflow-y-auto px-4 pb-6 pt-1",children:l.jsxs(ZK,{children:[l.jsxs(JE,{title:"说明",actions:r.facility&&uN(r)?l.jsxs("a",{href:uN(r),target:"_blank",rel:"noreferrer",className:"inline-flex h-5 shrink-0 items-center gap-1 rounded-md px-1.5 text-[11px] text-muted-foreground transition-colors hover:bg-[var(--acr-card-nested)] hover:text-foreground",children:[l.jsx("span",{className:"max-w-[8rem] truncate",children:r.facility.label}),l.jsx(Mp,{className:"size-3 shrink-0"})]}):null,children:[l.jsxs(dy,{children:[l.jsx("code",{className:"mb-2 block truncate font-mono text-[11px] text-muted-foreground",children:r.id.replace(/^rsshub:/,"")}),S.length?l.jsx(fR,{blocks:S}):l.jsx("div",{className:"text-[13px] leading-relaxed text-muted-foreground",children:l.jsx(gy,{text:FF(r)})})]}),v.length?l.jsxs(dy,{children:[l.jsx("div",{className:"mb-1.5 text-[11px] font-semibold tracking-[0.06em] text-muted-foreground",children:"参数"}),l.jsx("div",{className:"space-y-1.5",children:v.map(([fe,Se])=>l.jsxs("div",{className:"grid grid-cols-[7rem_minmax(0,1fr)] gap-2 text-[11px]",children:[l.jsxs("code",{className:"font-mono text-foreground",children:[fe,Se.required?" *":""]}),l.jsx("div",{className:"text-muted-foreground",children:Se.description?l.jsx(gy,{text:Se.description}):"string"})]},fe))})]}):null]}),l.jsxs("div",{className:"flex flex-col gap-4",children:[i.kind==="pick"?l.jsxs(cr,{orientation:"vertical",children:[l.jsx(ur,{children:"加到哪里"}),l.jsx(JK,{groups:ve,value:hG(b),onValueChange:fe=>j(Z[fe]??null),placeholder:"选择目的地",searchPlaceholder:"搜索 Stream / Provider",emptyText:"无匹配",className:"w-full",container:B})]}):null,oe?l.jsxs(l.Fragment,{children:[l.jsxs(cr,{orientation:"vertical",children:[l.jsx(ur,{children:"频道"}),l.jsxs(la,{value:N,onValueChange:E,children:[l.jsx(ua,{className:"w-full","aria-label":"选择频道",children:l.jsx(ca,{placeholder:"选择一个频道"})}),l.jsx(da,{children:d.map(fe=>l.jsxs(lr,{value:fe.id,children:[fe.label,fe.kind==="audio"?" · 歌单":""]},fe.id))})]})]}),l.jsxs(cr,{orientation:"vertical",children:[l.jsx(ur,{htmlFor:"stream-name",children:"名称"}),l.jsx(Jt,{id:"stream-name",value:C,onChange:fe=>k(fe.target.value)})]})]}):null,v.map(([fe,Se])=>l.jsx(lG,{name:fe,spec:Se,value:R[fe]??"",onChange:ye=>A(Qe=>({...Qe,[fe]:ye})),container:B,apiBase:n.baseUrl},fe))]}),W?l.jsx(JE,{title:"运行时配置",children:l.jsxs(dy,{children:[q?l.jsxs(cr,{orientation:"vertical",className:"mb-2",children:[l.jsx(ur,{htmlFor:"member-instance",children:"实例名 *"}),l.jsx(Jt,{id:"member-instance",value:L,disabled:!!P,placeholder:"kimi / deepseek…",onChange:fe=>G(fe.target.value.trim())}),l.jsx(to,{children:P?"这一档在梯子上的名字,同时决定它的 key 存在哪里;建好之后不能改名。":"这一档在梯子上的名字(同一个源可以有多档,各自端点/模型/key)。key 存为 "+vy(L||"<实例名>")+"。"})]}):null,Object.keys(W.fields).length?l.jsx("div",{className:"flex flex-col gap-2",children:Object.entries(W.fields).map(([fe,Se])=>l.jsxs(cr,{orientation:"vertical",children:[l.jsxs(ur,{htmlFor:`runtime-${fe}`,children:[Se.label,Se.required?" *":"",Se.type==="secret"&&K[fe]?"(留空保持不变)":""]}),l.jsx(Jt,{id:`runtime-${fe}`,type:Se.type==="secret"?"password":"text",placeholder:Se.type==="secret"&&K[fe]?"••••••••":Se.default,value:M[fe]??"",onChange:ye=>U(Qe=>({...Qe,[fe]:ye.target.value}))}),Se.description||Se.helpUrl?l.jsxs(to,{children:[Se.description,Se.description&&Se.helpUrl?" ":"",Se.helpUrl?l.jsx("a",{className:"underline underline-offset-2 hover:text-foreground",href:Se.helpUrl,target:"_blank",rel:"noreferrer",children:"前往申请"}):null]}):null]},fe))}):null]})}):null,v.length===0?l.jsx("p",{className:"px-3 text-[11px] text-muted-foreground",children:"无需参数"}):null]})}),l.jsxs(LK,{className:"flex-row gap-2 border-t border-[var(--acr-border-soft)] px-4 py-3",children:[D?l.jsx("div",{role:"alert",className:"mr-auto min-w-0 flex-1 truncate text-[11px] text-destructive",title:D,children:D}):null,l.jsxs(Ne,{variant:"secondary",onClick:Te,disabled:_,className:"shrink-0","aria-label":"预览抓取效果,不入库",children:[l.jsx(oL,{}),"预览"]}),l.jsx(Ne,{onClick:Ee,disabled:_,className:"min-w-[7rem]",children:_?"处理中…":Fe})]})]})})})}const pR=/^[\w-]+$/,vy=e=>`llm:${e}`;function gR(e){const t=typeof e=="string"&&e.startsWith("llm:")?e.slice(4):"";return pR.test(t)?t:""}function hG(e){if(e){if(e.action==="create-stream")return"create-stream";if(e.action==="append-stream")return"stream:"+e.streamId;if(e.action==="append-provider")return"provider:"+e.providerId}}function xR(e){return new Set(e.sources.map(t=>Sx(t.source.id,t.params)))}function mG(e,t,n){const r=e.description||e.id;if(n.streams.some(c=>c.id===e.id))return{kind:"already-there",message:`「${r}」本来就在「${n.label}」里,已把它从「${t.label}」移除`};const i=xR(e),o=n.streams.find(c=>[...xR(c)].some(d=>i.has(d)));if(o){const c=o.description||o.id;return{kind:"duplicate-source",clashWith:o.id,message:`「${n.label}」里已经有同一个来源的「${c}」,没有移动`}}return{kind:"move"}}const kh={audioLiked:"col_audio_liked"},Nh="default-timeline";function pG(e,t){return e.streams.filter(n=>!t.some(r=>r.id!==e.id&&r.streams.some(i=>i.id===n.id)))}function vR(e,t,n){const r=new Set(e.streams.map(i=>i.id));return t.filter(i=>!r.has(i.id)).map(i=>({stream:i,referencedBy:n.filter(o=>o.id!==e.id&&o.streams.some(c=>c.id===i.id)).map(o=>o.label)}))}const yR={healthy:"bg-emerald-500",degraded:"bg-amber-500",dead:"bg-rose-500"},Th={healthy:"正常",degraded:"降级",dead:"失效"},gG={fanout:"聚合",exclusive:"互斥·优先级"};function xG(e){let t="healthy";for(const n of e.sources){if(n.health==="dead")return"dead";n.health==="degraded"&&(t="degraded")}return t}function vG(e){return e<60?`${e}s`:e<3600?`${Math.round(e/60)}m`:e<86400?`${Math.round(e/3600)}h`:`${Math.round(e/86400)}d`}function yG(e){return{id:e.source.id,title:e.source.title,description:e.source.description,pluginName:e.source.pluginName,facility:e.source.facility,active:e.active,health:e.health,healthError:e.healthError,dependencyIssues:e.dependencyIssues}}function bG({issues:e}){return e.length?l.jsx("div",{className:"mt-0.5 flex flex-col gap-0.5 pl-1",children:e.map(t=>l.jsxs("p",{className:"flex items-start gap-1 text-[11px] leading-relaxed text-amber-500",children:[l.jsx(bL,{className:"mt-0.5 size-3 shrink-0"}),l.jsx("span",{children:t.kind==="broken"?`依赖的「${t.title||t.id}」${Th[t.health]}——本来源自己仍在正常采集,但内容可能是残的。`:`申报依赖的「${t.id}」找不到(对应的包没装,或 id 写错了)——内容可能是残的。`})]},t.kind+t.id))}):null}function wG({conn:e,channel:t,present:n,title:r,columns:i=1,onChanged:o,onEditStream:c,onPreview:d}){const{channels:h,reload:m,patchChannel:x}=If(),[g,v]=p.useState(!1),[S,b]=p.useState([]),[j,C]=p.useState(!1),[k,N]=p.useState(null),[E,R]=p.useState(""),[A,_]=p.useState(null),[z,D]=p.useState(null),[V,I]=p.useState(null),[Q,B]=p.useState(null),H=async()=>{await m(),o==null||o()},ee=t.streams,W=$=>{const se=$.description||$.id,oe=be.refreshStream(e,$.id);Ge.promise(oe,{loading:`正在重新抓取「${se}」…`,success:ie=>`「${se}」已刷新:抓取 ${ie.fetched} 条,新增 ${ie.written} 条`,error:ie=>`刷新失败:${ie instanceof Error?ie.message:String(ie)}`}),oe.then(()=>void H()).catch(()=>{})},M=async $=>{const se=E.trim();if(N(null),!(!se||se===$.description))try{await be.renameStream(e,$.id,se),await H()}catch(oe){Ge.error(`重命名失败:${oe.message}`)}},U=async($,se)=>{const oe=h.find(ve=>ve.id===se),ie=ee.find(ve=>ve.id===$);if(!oe||!ie||oe.id===t.id)return;const Z=mG(ie,t,oe);if(Z.kind==="duplicate-source"){Ge.error(Z.message);return}v(!0);try{await x(oe.id,{stream_ids:[...new Set([...oe.streams.map(ve=>ve.id),$])]}),await x(t.id,{stream_ids:ee.map(ve=>ve.id).filter(ve=>ve!==$)}),await H(),Z.kind==="already-there"&&Ge.info(Z.message)}catch(ve){Ge.error(`移动失败:${ve.message}`)}finally{v(!1)}},K=async()=>{if(A===null)return;const{stream:$}=A;v(!0);try{const se=mF(h),oe=se.find(Z=>Z.id===t.id),ie=$.sources[0];oe&&ie?await dF(pF(e),{sourceId:ie.source.id,params:ie.params,title:$.description},oe,se):oe&&await x(t.id,{stream_ids:oe.streamIds.filter(Z=>Z!==$.id)}),_(null),await H()}catch(se){Ge.error(`删除失败:${se.message}`)}finally{v(!1)}},ne=async($,se)=>{if($.sources.length<=1){_({stream:$,reason:"last-source"});return}v(!0);try{await be.patchStreamMembers(e,$.id,xy($).filter((oe,ie)=>ie!==se)),await H()}catch(oe){Ge.error(`删除来源失败:${oe.message}`)}finally{v(!1)}},q=async($,se)=>{const oe=$.sources[se];if(oe!==void 0)try{const ie=await be.pluginSourceDetail(e,oe.source.pluginId,oe.source.id);B({streamId:$.id,memberIndex:se,source:ie,params:Object.fromEntries(Object.entries(oe.params??{}).map(([Z,ve])=>[Z,String(ve??"")]))})}catch(ie){Ge.error(ie.message)}},P=async($,se)=>{try{const oe=await be.pluginSourceDetail(e,se.pluginId,se.id);D(null),I({target:$,source:oe})}catch(oe){Ge.error(oe.message)}},L=()=>{C(!0),be.streams(e).then(b).catch($=>{Ge.error(`读不到流库存:${$.message}`)})},G=async $=>{v(!0);try{await x(t.id,{stream_ids:[...ee.map(se=>se.id),$]}),C(!1),await H()}catch(se){Ge.error(`挂入失败:${se.message}`)}finally{v(!1)}},J=l.jsxs("div",{className:"flex shrink-0 gap-2",children:[l.jsxs(Ne,{type:"button",variant:"neutral",size:"small",onClick:()=>D({kind:"pick"}),children:[l.jsx(bc,{}),"添加来源"]}),l.jsx(Ne,{type:"button",variant:"neutral",size:"small",onClick:L,children:"挂已有的"})]});return l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r===void 0?l.jsx("span",{}):l.jsx("h3",{className:"text-[12px] font-semibold text-muted-foreground",children:r}),J]}),(n==null?void 0:n.data)==="live"?l.jsx("p",{className:"text-[11px] text-muted-foreground",children:"这类频道的数据是打开时现读的,不入库——因此没有未读和订阅提醒。"}):null,ee.length===0?l.jsx(Gk,{children:l.jsxs(Yk,{children:[l.jsx(Wk,{children:"这个频道还没有内容源"}),l.jsxs(Xk,{children:["用上面的「添加来源」为「",t.label,"」加一个来源,开始采集内容。"]})]})}):l.jsx(l.Fragment,{children:l.jsx("div",{className:Y("grid gap-4",i>=2?"@xl:grid-cols-2":"",i>=3?"@3xl:grid-cols-3":""),children:ee.map($=>{const se=xG($),oe=$.sources.map(yG),ie=$.description||$.id;return l.jsxs(Kk,{className:"flex flex-col py-4",children:[l.jsxs(wF,{className:"px-4",children:[l.jsxs(SF,{className:"flex min-w-0 items-center gap-2 text-[13.5px]",children:[k===$.id?l.jsx(Jt,{autoFocus:!0,size:"medium",value:E,onChange:Z=>R(Z.target.value),onBlur:()=>void M($),onKeyDown:Z=>{Z.key==="Enter"?(Z.preventDefault(),M($)):Z.key==="Escape"&&(Z.preventDefault(),N(null))},className:"min-w-0 flex-1","aria-label":`重命名 ${ie}`}):l.jsx("span",{className:"min-w-0 cursor-text truncate",onDoubleClick:()=>{R($.description||""),N($.id)},children:ie}),l.jsx("span",{title:Th[se],className:`inline-block size-2 shrink-0 rounded-full ${yR[se]}`}),$.strategy?l.jsx(Bt,{variant:"secondary",size:"sm",className:"shrink-0",children:gG[$.strategy]??$.strategy}):null,l.jsx(Bt,{variant:"secondary",size:"sm",className:"shrink-0",children:vG($.cadence_seconds)})]}),l.jsxs(jF,{className:"flex shrink-0 items-center gap-1.5",children:[d!==void 0||c!==void 0?l.jsxs(Jk,{variant:"attached",size:"small",children:[d!==void 0?l.jsx(Ne,{variant:"ghost",size:"small","aria-label":`预览 ${ie} 的时间线效果`,title:"预览",onClick:()=>d({kind:"stream",streamId:$.id,label:ie}),children:"预览"}):null,d!==void 0&&c!==void 0?l.jsx(DF,{}):null,c!==void 0?l.jsx(Ne,{variant:"ghost",size:"small",onClick:()=>c($),children:"编辑"}):null]}):null,l.jsxs(Cx,{children:[l.jsx(kx,{asChild:!0,children:l.jsx(Ne,{variant:"ghost",size:"small",icon:!0,"aria-label":`${ie} 更多操作`,disabled:g,children:l.jsx(Ap,{})})}),l.jsxs(Ff,{align:"end",onCloseAutoFocus:Z=>Z.preventDefault(),children:[l.jsxs(ms,{onSelect:()=>W($),children:[l.jsx(Ud,{className:"size-3.5"}),"手动刷新"]}),l.jsx(tu,{}),l.jsx(ms,{onSelect:()=>D({kind:"stream",streamId:$.id}),children:"添加来源"}),l.jsx(ms,{onSelect:()=>{R($.description||""),N($.id)},children:"重命名"}),l.jsx(tu,{}),l.jsxs(Vk,{children:[l.jsx(Nx,{children:"移动到…"}),l.jsx(Tx,{children:h.filter(Z=>Z.id!==t.id).length===0?l.jsx(ms,{disabled:!0,children:"无其他频道"}):h.filter(Z=>Z.id!==t.id).map(Z=>l.jsxs(ms,{onSelect:()=>void U($.id,Z.id),children:[l.jsx("span",{className:"min-w-0 flex-1 truncate",children:Z.label}),l.jsx(Bt,{variant:"secondary",size:"sm",children:Z.system?"系统":"自定义"})]},Z.id))})]}),l.jsx(tu,{}),l.jsx(ms,{onSelect:()=>{var Z;(Z=navigator.clipboard)==null||Z.writeText($.id)},children:"复制 StreamID"}),l.jsx(ms,{className:"text-destructive data-[highlighted]:bg-destructive data-[highlighted]:text-destructive-foreground",onSelect:()=>_({stream:$}),children:"删除"})]})]})]})]}),l.jsx(CF,{className:"space-y-3 px-4",children:oe.length===0?l.jsx("p",{className:"text-[12px] text-muted-foreground italic",children:"暂无来源。"}):l.jsx(eu,{className:"gap-1",children:oe.map((Z,ve)=>l.jsxs("div",{children:[l.jsx($F,{error:Z.healthError,sourceLabel:Z.title,stateLabel:Z.health?Th[Z.health]:"",children:l.jsx(sN,{source:Z,muted:Z.health==="dead",status:Z.health?l.jsx(IF,{colorClass:yR[Z.health],label:Th[Z.health]}):void 0,actions:l.jsxs(l.Fragment,{children:[Z.active?l.jsx(Bt,{size:"sm",children:"主力"}):null,l.jsxs("div",{className:"flex flex-col gap-0.5",children:[l.jsx(Ne,{variant:"ghost",size:"mini",disabled:g,onClick:()=>void q($,ve),children:"编辑"}),l.jsx(Ne,{variant:"ghost",size:"mini",disabled:g,onClick:()=>void ne($,ve),children:"删除"})]})]})})}),l.jsx(bG,{issues:Z.dependencyIssues??[]})]},Z.id+ve))})})]},$.id)})})}),l.jsx(hs,{open:A!==null,onOpenChange:$=>{$||_(null)},children:l.jsxs(Vr,{children:[l.jsxs(Os,{children:[l.jsx(Fr,{children:(A==null?void 0:A.reason)==="last-source"?"删除最后一个来源":"删除 Stream"}),l.jsx(Qa,{children:(A==null?void 0:A.reason)==="last-source"?l.jsxs(l.Fragment,{children:["这是「",A.stream.description||A.stream.id,"」的最后一个来源,删除它将删除整个订阅流并停止抓取。"]}):l.jsxs(l.Fragment,{children:["将从本频道移除「",(A==null?void 0:A.stream.description)||(A==null?void 0:A.stream.id),"」;若没有其他频道引用它,将一并停止抓取并删除。"]})})]}),l.jsxs(Xc,{children:[l.jsx(Ne,{type:"button",variant:"neutral",size:"large",disabled:g,onClick:()=>_(null),children:"取消"}),l.jsx(Ne,{type:"button",variant:"destructive",size:"large",disabled:g,onClick:()=>void K(),children:g?"删除中…":"删除"})]})]})}),l.jsx(hs,{open:j,onOpenChange:C,children:l.jsxs(Vr,{children:[l.jsxs(Os,{children:[l.jsx(Fr,{children:"挂入已有的 Stream"}),l.jsx(Qa,{children:"Stream 是全局身份,可被多个频道同时引用;挂入不影响它在其他频道的存在。"})]}),l.jsx("div",{className:"flex max-h-80 flex-col gap-1 overflow-y-auto px-4 pb-4 scrollbar-mac",children:vR(t,S,h).length===0?l.jsx("p",{className:"text-[12px] text-muted-foreground",children:"库里没有可挂入的流。"}):vR(t,S,h).map(({stream:$,referencedBy:se})=>l.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border px-2.5 py-1.5",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("div",{className:"truncate text-[13px]",children:$.description||$.id}),l.jsx("div",{className:"text-[11px] text-muted-foreground",children:se.length>0?`已在:${se.join("、")}`:"未被任何频道引用"})]}),l.jsx(Ne,{size:"mini",disabled:g,"aria-label":`挂入 ${$.description||$.id}`,onClick:()=>void G($.id),children:"挂入"})]},$.id))})]})}),z!==null?l.jsx(XK,{open:!0,onOpenChange:$=>{$||D(null)},conn:e,surface:"stream",onPick:$=>void P(z,$)}):null,V!==null?l.jsx(mR,{open:!0,onOpenChange:$=>{$||I(null)},conn:e,source:V.source,target:V.target,streams:ee,providers:[],channels:h,defaultChannelId:t.id,onSubmitted:()=>void H()}):null,Q!==null?l.jsx(mR,{open:!0,onOpenChange:$=>{$||B(null)},conn:e,source:Q.source,target:{kind:"stream",streamId:Q.streamId,memberIndex:Q.memberIndex},initialParams:Q.params,streams:ee,providers:[],channels:h,onSubmitted:()=>void H()}):null]})}function SG({channel:e}){var h;const{patchChannel:t}=If(),[n,r]=p.useState(null),[i,o]=p.useState(!1),c=typeof((h=e.options)==null?void 0:h.url)=="string"?e.options.url:"",d=async m=>{const x=m.trim();if(!(x===c||i)){o(!0),r(null);try{const{url:g,...v}=e.options??{};await t(e.id,{options:x?{...v,url:x}:v})}catch(g){r(g.message)}finally{o(!1)}}};return l.jsxs("section",{className:"flex flex-col gap-2",children:[l.jsx("h3",{className:"text-[12px] font-semibold text-muted-foreground",children:"面板地址"}),l.jsx(Jt,{size:"xl",type:"url",defaultValue:c,placeholder:"https://…",disabled:i,onBlur:m=>void d(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),d(m.target.value))},"aria-label":"面板地址"},c),l.jsx("p",{className:"text-[12px] text-muted-foreground",children:"整个主窗格装这张网页。对方得允许被嵌入(没有 X-Frame-Options / frame-ancestors 限制)。"}),n?l.jsx("p",{className:"text-[12px] text-destructive",children:n}):null]})}const jG={embed:SG};function yy({conn:e,channelId:t,onChanged:n,onDeleted:r,onEditStream:i,onPreview:o,showHeader:c=!0}){const{channels:d,reload:h,patchChannel:m}=If(),[x,g]=p.useState([]),[v,S]=p.useState([]),[b,j]=p.useState([]),[C,k]=p.useState(!1),[N,E]=p.useState(!1),[R,A]=p.useState(null),[_,z]=p.useState(!1),D=p.useRef(!1),V=p.useRef(null),I=async()=>{const[,ne,q,P]=await Promise.all([h(),be.presents(e).then(L=>L.items),be.providers(e),be.spaces(e).catch(()=>[])]);g(ne),j(q),S(P),A(null),z(!0)},Q=()=>void I().catch(ne=>{const q=ne.message;Ge.error(q),A(q)});p.useEffect(()=>{z(!1),Q()},[t]);const B=d.find(ne=>ne.id===t)??null,H=B?x.find(ne=>ne.id===B.present):null,ee=()=>{Q(),n==null||n()},W=async ne=>{if(D.current||!B)return;D.current=!0;const q=ne.trim();if(!(!q||q===B.label))try{await m(B.id,{label:q}),ee()}catch(P){Ge.error(`重命名失败:${P.message}`),V.current&&(V.current.value=B.label)}},M=async()=>{if(B){E(!0);try{await be.deleteChannel(e,B.id),k(!1),r==null||r(),n==null||n()}catch(ne){Ge.error(`删除失败:${ne.message}`)}finally{E(!1)}}};if(!B||!H)return l.jsx("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-[12px] text-muted-foreground",children:R!==null?l.jsxs(l.Fragment,{children:[l.jsxs("span",{children:["加载失败:",R]}),l.jsx(Ne,{type:"button",variant:"neutral",size:"small",onClick:Q,children:"重试"})]}):_?B?l.jsxs("span",{children:["这个频道的 Present「",B.present,"」已不存在,无法管理。"]}):l.jsx("span",{children:"这个频道已不存在(可能在别处被删除了)。"}):l.jsx("span",{children:"加载中…"})});const U=jG[B.present],K=pG(B,d);return l.jsxs("div",{className:"@container flex flex-col gap-5 px-4 py-4",children:[c?l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx("span",{className:"min-w-0 truncate",children:B.label}),l.jsx(Bt,{variant:"secondary",size:"sm",children:H.label}),B.system?l.jsx(Bt,{variant:"secondary",size:"sm",children:"系统保留"}):null]}):null,l.jsxs("div",{className:"grid gap-4 @xl:grid-cols-2",children:[l.jsxs("section",{className:"flex flex-col gap-2",children:[l.jsx("h3",{className:"text-[12px] font-semibold text-muted-foreground",children:"名称"}),l.jsx(Jt,{ref:V,size:"xl",defaultValue:B.label,disabled:B.system,onFocus:()=>{D.current=!1},onBlur:ne=>void W(ne.target.value),onKeyDown:ne=>{ne.key==="Enter"&&(ne.preventDefault(),W(ne.target.value))},"aria-label":"频道名称"},B.label)]}),v.length>0?l.jsxs("section",{className:"flex flex-col gap-2",children:[l.jsx("h3",{className:"text-[12px] font-semibold text-muted-foreground",children:"所属空间"}),l.jsxs(la,{value:v.some(ne=>ne.id===B.space_id)?B.space_id:v[0].id,disabled:N,onValueChange:ne=>{E(!0),m(B.id,{space_id:ne}).then(ee).catch(q=>{Ge.error(`换空间失败:${q.message}`)}).finally(()=>{E(!1)})},children:[l.jsx(ua,{size:"xl",className:"w-full","aria-label":"所属空间",children:l.jsx(ca,{})}),l.jsx(da,{children:v.map(ne=>l.jsx(lr,{value:ne.id,children:ne.label},ne.id))})]})]}):null]}),H.needsStreams?l.jsx("section",{className:"flex flex-col gap-2",children:l.jsx(wG,{conn:e,channel:B,present:H,title:H.data==="live"?"绑定的数据源":"订阅列表",columns:2,onChanged:n,onEditStream:i,onPreview:o})}):null,H.slots.length>0?l.jsxs("section",{className:"flex flex-col gap-2",children:[l.jsx("h3",{className:"text-[12px] font-semibold text-muted-foreground",children:"能力槽位"}),l.jsx(oF,{channel:B,slots:H.slots,providers:b,columns:2,onSaved:ee})]}):null,U?l.jsx(U,{conn:e,channel:B}):null,B.system?null:l.jsx("section",{className:"border-t border-border pt-4",children:l.jsx(Ne,{type:"button",variant:"destructive",size:"medium",onClick:()=>k(!0),children:"删除频道"})}),l.jsx(hs,{open:C,onOpenChange:k,children:l.jsxs(Vr,{children:[l.jsxs(Os,{children:[l.jsx(Fr,{children:"删除频道"}),l.jsxs(Qa,{children:["将删除「",B.label,"」。Stream 不会被删除,只解除引用",K.length>0?l.jsxs(l.Fragment,{children:[";以下流将不再被任何频道引用:",K.map(ne=>ne.description||ne.id).join("、")]}):null,"。"]})]}),l.jsxs(Xc,{children:[l.jsx(Ne,{type:"button",variant:"neutral",size:"large",disabled:N,onClick:()=>k(!1),children:"取消"}),l.jsx(Ne,{type:"button",variant:"destructive",size:"large",disabled:N,onClick:()=>void M(),children:N?"删除中…":"删除"})]})]})})]})}const CG=[{id:"content",label:"内容"},{id:"config",label:"配置"}];function by({value:e,onChange:t,className:n}){return l.jsxs("div",{"data-testid":"channel-tabs",role:"tablist","aria-label":"频道视图",className:Y("relative isolate flex shrink-0 items-end gap-9 px-4 pl-6",n),children:[l.jsx("span",{"aria-hidden":!0,className:"absolute inset-x-0 bottom-px z-0 h-px bg-border"}),CG.map(r=>{const i=r.id===e;return l.jsxs("button",{type:"button",role:"tab","aria-selected":i,onClick:()=>{i||t(r.id)},className:Y("relative z-10 pb-[11px] text-[13px] font-medium transition-colors",i?"text-primary":"text-muted-foreground hover:text-foreground"),children:[r.label,i?l.jsx("span",{"aria-hidden":!0,className:"absolute inset-x-0 bottom-px h-0.5 rounded-sm bg-primary"}):null]},r.id)})]})}const wy=p.forwardRef(({className:e,...t},n)=>l.jsx(fk,{className:Y("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-[color-mix(in_srgb,var(--muted-foreground)_45%,transparent)]",e),...t,ref:n,children:l.jsx(nV,{className:Y("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));wy.displayName=fk.displayName;const fo=p.forwardRef(({className:e,interactive:t=!1,nestedSurface:n=!1,...r},i)=>l.jsx("div",{ref:i,"data-slot":"card","data-nested-surface":n||void 0,className:Y("acr-frosted relative isolate rounded-xl bg-[var(--acr-surface)] backdrop-blur-xl","transition-[translate,background-color] [transition-timing-function:var(--acr-spring-default)] [transition-duration:var(--acr-spring-default-duration)]",t&&"hover:-translate-y-px hover:bg-[var(--acr-surface-hover)] before:pointer-events-none before:absolute before:inset-0 before:-z-10 before:rounded-xl before:shadow-[0_12px_28px_rgba(0,0,0,0.28)] before:opacity-0 before:transition-opacity before:[transition-timing-function:var(--acr-spring-default)] before:[transition-duration:var(--acr-spring-default-duration)] hover:before:opacity-100",e),...r}));fo.displayName="Card";function Eh({className:e,...t}){return l.jsx("div",{"data-slot":"card-title",className:Y("self-center text-[15px] font-semibold leading-none [letter-spacing:var(--text-title3-tracking)]",e),...t})}function Sy({className:e,...t}){return l.jsx("div",{"data-slot":"card-description",className:Y("text-[13px] leading-snug text-muted-foreground",e),...t})}function kG({className:e,...t}){return l.jsx("div",{"data-slot":"card-footer",className:Y("flex items-center px-6",e),...t})}const NG=2,TG=800;function jy({className:e,ratio:t,style:n,src:r,alt:i="",fallback:o,imageClassName:c,maxRetries:d=NG,retryDelayMs:h=TG,onNaturalSize:m,children:x,...g}){const v=p.useRef(null),[S,b]=p.useState(!1),[j,C]=p.useState(0),[k,N]=p.useState(!1),E=p.useCallback(()=>{v.current&&(clearTimeout(v.current),v.current=null)},[]);p.useLayoutEffect(()=>{E(),b(!1),C(0),N(!1)},[r,E]),p.useEffect(()=>E,[E]);const R=p.useCallback(()=>{if(j>=d){b(!0);return}N(!0);const _=h*2**j;v.current=setTimeout(()=>{v.current=null,C(z=>z+1),N(!1)},_)},[j,d,h]),A=!k&&(S||!r&&o!=null);return l.jsxs("div",{"data-slot":"card-media",className:Y("relative w-full overflow-hidden [&>img]:size-full [&>img]:object-cover",e),style:t?{aspectRatio:t,...n}:n,...g,children:[r&&!S&&!k?l.jsx("img",{src:r,alt:i,loading:"lazy",referrerPolicy:"no-referrer",className:Y("size-full object-cover",c),onLoad:_=>{j!==0&&C(0);const z=_.currentTarget;z.naturalWidth&&z.naturalHeight&&(m==null||m(z.naturalWidth,z.naturalHeight))},onError:R},j):null,A?l.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-[var(--acr-card-nested)] text-muted-foreground/50",children:o??l.jsx(hL,{className:"size-7"})}):null,x]})}function EG({className:e,...t}){return l.jsx("div",{"data-slot":"card-media-overlay",className:Y("absolute inset-x-0 bottom-0 flex flex-col gap-0.5 bg-gradient-to-t from-black/85 to-transparent px-3 pb-2.5 pt-8","[&_[data-slot=card-title]]:self-stretch [&_[data-slot=card-title]]:truncate [&_[data-slot=card-title]]:text-[13px] [&_[data-slot=card-title]]:leading-snug [&_[data-slot=card-title]]:text-white","[&_[data-slot=card-description]]:truncate [&_[data-slot=card-description]]:text-[12px] [&_[data-slot=card-description]]:leading-snug [&_[data-slot=card-description]]:text-white/70",e),...t})}const RG={confirmed:"自动",auto:"自动",pending:"待定",rejected:"未配对",unmatched:"未配对"},AG={confirmed:"secondary",auto:"secondary",pending:"outline",rejected:"outline",unmatched:"outline"};function bR(e){return e.corrected?{label:"人工",variant:"secondary"}:{label:RG[e.status],variant:AG[e.status]}}function MG(e){if(!e)return"从未同步";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function wR(e){let t=0,n=0,r=0,i=0;for(const o of e.entries)o.corrected?t++:o.status==="auto"||o.status==="confirmed"?n++:o.status==="pending"?r++:i++;return[n&&`自动 ${n}`,r&&`待定 ${r}`,i&&`未配对 ${i}`,t&&`人工 ${t}`].filter(Boolean).join(" · ")}function Cy({apiBase:e="",streamId:t,focusSetId:n,className:r}){var ye,Qe,nt;const i={baseUrl:e},[o,c]=p.useState([]),[d,h]=p.useState(null),[m,x]=p.useState(!0),[g,v]=p.useState(!1),[S,b]=p.useState(null),[j,C]=p.useState([]),[k,N]=p.useState(t??""),[E,R]=p.useState(""),[A,_]=p.useState(!1),[z,D]=p.useState(!1),[V,I]=p.useState(null),[Q,B]=p.useState(!1),[H,ee]=p.useState(null),[W,M]=p.useState(""),[U,K]=p.useState(!1),[ne,q]=p.useState(!1),[P,L]=p.useState(null),G=!!t;p.useEffect(()=>{if(t)return;let re=!0;return be.streams(i).then(_e=>{re&&C(_e)}).catch(()=>{}),()=>{re=!1}},[e,t]);const J=p.useMemo(()=>n?o.filter(re=>re.id===n):t?o.filter(re=>re.left.streamId===t):o,[o,t,n]),$=p.useMemo(()=>J.find(re=>re.id===d)??null,[J,d]),se=p.useMemo(()=>G?Array.from(new Set(J.flatMap(_e=>_e.entries.map(Pe=>Pe.leftKey)))).map(_e=>{var ge;const Xe=J.map(Ye=>{const je=Ye.entries.find(kt=>kt.leftKey===_e);return je?{entry:je,setId:Ye.id,path:Ye.right.path}:null}).filter(Boolean).sort((Ye,je)=>{const kt=zt=>zt.entry.rightFile?zt.entry.corrected?3:zt.entry.status==="confirmed"?2:zt.entry.status==="auto"?1:0:0;return kt(je)-kt(Ye)})[0];return{leftKey:_e,leftTitle:(Xe==null?void 0:Xe.entry.leftTitle)??"",rightFile:(Xe==null?void 0:Xe.entry.rightFile)??null,status:(Xe==null?void 0:Xe.entry.status)??"unmatched",corrected:(Xe==null?void 0:Xe.entry.corrected)??!1,confidence:Xe==null?void 0:Xe.entry.confidence,lastError:Xe==null?void 0:Xe.entry.lastError,setId:(Xe==null?void 0:Xe.setId)??((ge=J[0])==null?void 0:ge.id)??"",path:(Xe==null?void 0:Xe.path)??""}}):[],[J,G]),oe=p.useMemo(()=>se.find(re=>re.leftKey===H)??null,[se,H]),ie=p.useMemo(()=>J.find(re=>re.id===W)??J[0]??null,[J,W]),Z=async()=>{x(!0),b(null);try{const re=await be.netdisk.list(i);c(re);const _e=n?re.filter(Pe=>Pe.id===n):t?re.filter(Pe=>Pe.left.streamId===t):re;h(Pe=>{var Xe;return Pe&&_e.some(ge=>ge.id===Pe)?Pe:((Xe=_e[0])==null?void 0:Xe.id)??null})}catch(re){b(re instanceof Error?re.message:"加载失败")}finally{x(!1)}};p.useEffect(()=>{Z()},[e]),p.useEffect(()=>{h(re=>{var _e;return re&&J.some(Pe=>Pe.id===re)?re:((_e=J[0])==null?void 0:_e.id)??null})},[J]),p.useEffect(()=>{L(null),q(!1)},[$==null?void 0:$.id]);const ve=re=>c(_e=>_e.map(Pe=>Pe.id===re.id?re:Pe)),Ee=async()=>{var _e;const re=(t??k).trim();if(!(!re||!E.trim())){v(!0),b(null);try{const Pe=(_e=j.find(ge=>ge.id===re))==null?void 0:_e.description,Xe=await be.netdisk.create(i,{streamId:re,title:Pe,dirPath:E.trim()});c(ge=>[...ge,Xe]),h(Xe.id),t||N(""),R("")}catch(Pe){b(Pe instanceof Error?Pe.message:"建绑定失败")}finally{v(!1)}}},Te=async re=>{v(!0),b(null);try{ve(await be.netdisk.sync(i,re))}catch(_e){b(_e instanceof Error?_e.message:"同步失败")}finally{v(!1)}},Ie=async()=>{v(!0),b(null);try{await Promise.all(J.map(async re=>{const _e=await be.netdisk.sync(i,re.id);ve(_e)})),Ge.success("所有绑定的目录已同步完成")}catch(re){b(re instanceof Error?re.message:"同步失败")}finally{v(!1)}},Fe=async(re,_e)=>{if(_e.trim()){v(!0),b(null);try{ve(await be.netdisk.rebind(i,re,_e.trim()))}catch(Pe){b(Pe instanceof Error?Pe.message:"重绑失败")}finally{v(!1)}}},fe=async re=>{v(!0),b(null);try{await be.netdisk.remove(i,re),c(_e=>_e.filter(Pe=>Pe.id!==re)),h(_e=>_e===re?null:_e)}catch(_e){b(_e instanceof Error?_e.message:"删除失败")}finally{v(!1)}},Se=async(re,_e,Pe)=>{v(!0),b(null);try{ve(await be.netdisk.patchEntry(i,re,_e,Pe))}catch(Xe){b(Xe instanceof Error?Xe.message:"修正失败")}finally{v(!1)}};return l.jsx("div",{className:`flex flex-col gap-4 ${r??""}`,children:l.jsxs("div",{className:"flex min-h-0 gap-4",children:[!G&&!n&&l.jsxs("aside",{className:"flex w-64 flex-none flex-col gap-2 min-h-0",children:[S&&l.jsx("p",{className:"text-[12px] text-destructive",children:S}),l.jsxs("div",{className:"sticky top-0 z-10 bg-[var(--acr-panel)] flex flex-col gap-1.5 rounded-md border border-[var(--acr-border-soft)] p-2",children:[l.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:"新建绑定"}),j.length?l.jsxs(la,{value:k||void 0,onValueChange:N,children:[l.jsx(ua,{size:"small","aria-label":"选择订阅",className:"w-full",children:l.jsx(ca,{placeholder:"选择订阅…"})}),l.jsx(da,{children:j.map(re=>l.jsx(lr,{value:re.id,children:re.description||re.id},re.id))})]}):l.jsx(Jt,{placeholder:"播单 streamId",value:k,onChange:re=>N(re.target.value)}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(Jt,{placeholder:"AList 目录(如 /夸克/剧集)",value:E,onChange:re=>R(re.target.value)}),l.jsx(Ne,{variant:"ghost",size:"small","aria-label":"浏览网盘目录",onClick:()=>_(!0),children:l.jsx($i,{})})]}),l.jsx(Sl,{apiBase:e,open:A,onOpenChange:_,initialPath:E.trim()||"/",onPick:R}),l.jsxs(Ne,{variant:"neutral",size:"small",disabled:g||!k.trim()||!E.trim(),onClick:()=>void Ee(),children:[l.jsx(bc,{}),"建绑定并同步"]})]}),m&&J.length===0?l.jsx(oy,{className:"h-40 w-full"}):l.jsxs("ul",{className:"flex flex-col gap-1 flex-1 min-h-0 max-h-[70vh] overflow-y-auto scrollbar-mac",children:[J.map(re=>l.jsx("li",{children:l.jsxs("button",{type:"button",onClick:()=>h(re.id),"aria-label":`绑定 ${re.left.title}`,className:`w-full rounded-md border px-3 py-2 text-left text-[12px] ${re.id===d?"border-[var(--acr-border)] bg-[var(--acr-card-nested)]":"border-transparent hover:bg-[var(--acr-card-nested)]"}`,children:[l.jsx("div",{className:"truncate font-medium text-foreground",children:re.left.title}),l.jsx("div",{className:"truncate text-[11px] text-muted-foreground",children:re.right.path}),l.jsx("div",{className:"mt-1 flex items-center justify-between gap-1",children:l.jsx("span",{className:"truncate text-[10.5px] text-muted-foreground",children:wR(re)||"空"})}),l.jsxs("div",{className:"text-[10px] text-muted-foreground",children:["同步:",MG(re.lastSyncAt)]})]})},re.id)),!m&&J.length===0?l.jsx("li",{className:"rounded-md border border-dashed border-[var(--acr-border-soft)] px-3 py-4 text-center text-[11px] text-muted-foreground",children:"还没有任何网盘绑定。"}):null]})]}),l.jsxs("div",{className:"min-w-0 flex-1",children:[S&&G&&l.jsx("p",{className:"text-[12px] text-destructive mb-2",children:S}),G?J.length===0?l.jsxs("div",{className:"flex flex-col items-center justify-center p-8 border border-dashed border-[var(--acr-border-soft)] rounded-xl bg-[var(--acr-card-nested)] max-w-md mx-auto my-8 text-center space-y-4 shadow-sm",children:[l.jsx($i,{className:"size-10 text-muted-foreground opacity-60"}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("h3",{className:"text-[13.5px] font-semibold text-foreground",children:"该订阅还没有网盘绑定。"}),l.jsx("p",{className:"text-[11.5px] text-muted-foreground leading-normal",children:"将 AList 网盘中的特定剧集目录与当前订阅绑定,系统会自动将网盘文件与订阅剧集进行对齐。"})]}),l.jsxs("div",{className:"w-full flex items-center gap-1.5 pt-2",children:[l.jsx(Jt,{placeholder:"AList 目录(如 /夸克/剧集)",value:E,onChange:re=>R(re.target.value),className:"text-[12px]"}),l.jsx(Ne,{variant:"ghost",size:"small","aria-label":"浏览网盘目录",onClick:()=>_(!0),children:l.jsx($i,{})})]}),l.jsxs(Ne,{variant:"neutral",className:"w-full",size:"small",disabled:g||!E.trim(),onClick:()=>void Ee(),children:[l.jsx(bc,{}),"建绑定并同步"]}),l.jsx(Sl,{apiBase:e,open:A,onOpenChange:_,initialPath:E.trim()||"/",onPick:R})]}):l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsxs(fo,{className:"rounded-xl border border-[var(--acr-border-soft)] p-3 shadow-none",children:[l.jsxs("div",{className:"flex items-center justify-between pb-2 border-b border-[var(--acr-border-soft)] mb-2",children:[l.jsxs("span",{className:"text-[12px] font-semibold text-foreground flex items-center gap-1.5",children:[l.jsx($i,{className:"size-3.5 text-primary shrink-0"}),"网盘绑定目录"]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsxs(Ne,{variant:"ghost",size:"small",onClick:()=>B(!0),children:[l.jsx(bc,{}),"添加绑定目录"]}),l.jsxs(Ne,{variant:"ghost",size:"small",disabled:g,onClick:Ie,children:[l.jsx(Ud,{}),"立即同步"]})]})]}),l.jsx("div",{className:"flex flex-wrap gap-2",children:J.map(re=>{const _e=re.coverage?`利用 ${re.coverage.right.matched}/${re.coverage.right.total}`:"未同步",Pe=`${wR(re)||"空"} · ${_e}`;return l.jsxs(Tr,{variant:"muted",size:"sm",className:"min-w-[240px] max-w-[320px] border border-[var(--acr-border-soft)]",children:[l.jsxs(zs,{children:[l.jsx(fa,{className:"font-mono text-[11px] truncate max-w-[200px]",title:re.right.path,children:re.right.path}),l.jsx(no,{className:"text-[10px] text-muted-foreground mt-0.5 flex flex-wrap items-center gap-1.5",children:l.jsx("span",{children:Pe})})]}),l.jsxs(Bk,{className:"border-l border-[var(--acr-border-soft)] pl-2 ml-1 shrink-0 flex-col gap-1",children:[l.jsx(Ne,{variant:"ghost",size:"mini",className:"px-1.5 py-0 text-[10px] h-4.5 rounded-[4px] w-10 text-center",disabled:g,onClick:()=>{I(re.id),D(!0)},children:"重绑"}),l.jsx(Ne,{variant:"ghost",size:"mini",className:"px-1.5 py-0 text-[10px] h-4.5 rounded-[4px] w-10 text-center text-destructive hover:text-destructive hover:bg-destructive/10",disabled:g,onClick:()=>void fe(re.id),children:"删除"})]})]},re.id)})})]}),l.jsxs("div",{className:"flex items-center justify-between gap-2 mt-2",children:[l.jsxs("span",{className:"text-[11px] text-muted-foreground",children:["共 ",se.length," 条 · 未匹配 ",se.filter(re=>!re.rightFile).length," 条"]}),l.jsxs("div",{className:"flex items-center gap-2",children:[J.length>1&&l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"shrink-0 text-[11px] text-muted-foreground",children:"订正时浏览:"}),l.jsxs(la,{value:(ie==null?void 0:ie.id)??"",onValueChange:re=>{M(re),K(!0)},children:[l.jsx(ua,{size:"small",className:"w-[200px] font-mono text-[11px]","aria-label":"切换订正时浏览的目录",children:l.jsx(ca,{placeholder:"选择目录…"})}),l.jsx(da,{children:J.map(re=>l.jsx(lr,{value:re.id,className:"font-mono text-[11px]",children:re.right.path},re.id))})]})]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(wy,{id:"only-unmatched",checked:ne,onCheckedChange:q}),l.jsx("label",{htmlFor:"only-unmatched",className:"cursor-pointer select-none text-[11px] text-muted-foreground",children:"只看未匹配"})]})]})]}),l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full border-collapse text-[12px]",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-[var(--acr-border-soft)] text-left text-muted-foreground font-medium",children:[l.jsx("th",{className:"py-1.5 pr-2 font-medium",children:"清单条目"}),l.jsx("th",{className:"py-1.5 pr-2 font-medium",children:"网盘文件"}),l.jsx("th",{className:"py-1.5 pr-2 font-medium",children:"状态"}),l.jsx("th",{className:"py-1.5 font-medium",children:"操作"})]})}),l.jsx("tbody",{children:(ne?se.filter(re=>!re.rightFile):se).map(re=>{const _e=bR(re),Pe=re.path.split("/").filter(Boolean).pop()||"根";return l.jsxs("tr",{className:"border-b border-[var(--acr-border-soft)] align-top",children:[l.jsxs("td",{className:"py-1.5 pr-2",children:[l.jsx("div",{className:"text-foreground",children:re.leftTitle}),l.jsx("code",{className:"text-[10px] text-muted-foreground",children:re.leftKey}),re.lastError&&l.jsxs("div",{className:"mt-1 rounded bg-amber-500/15 px-1.5 py-0.5 text-[10.5px] text-amber-700 dark:text-amber-400",children:["最近走了回落:",re.lastError.message]})]}),l.jsx("td",{className:"py-1.5 pr-2",children:re.rightFile?l.jsxs("button",{type:"button",title:`文件路径:${re.path}/${re.rightFile}`,onClick:()=>{var Xe;(Xe=navigator.clipboard)==null||Xe.writeText(re.rightFile),Ge.success("已复制文件名")},className:"inline-flex flex-wrap items-center gap-1.5 max-w-[320px] text-left text-[11px] text-foreground hover:text-primary break-all",children:[l.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground bg-[var(--acr-card-nested)] px-1 py-0.2 rounded font-mono border border-[var(--acr-border-soft)]",title:re.path,children:Pe}),l.jsx("span",{children:re.rightFile})]}):l.jsx("span",{className:"text-[11px] text-muted-foreground",children:"未配对"})}),l.jsxs("td",{className:"py-1.5 pr-2",children:[l.jsx(Bt,{variant:_e.variant,size:"sm",children:_e.label}),typeof re.confidence=="number"&&!re.corrected&&l.jsx("span",{className:"ml-1 text-[10px] text-muted-foreground",children:re.confidence.toFixed(2)})]}),l.jsxs("td",{className:"py-1.5 whitespace-nowrap",children:[l.jsxs(Ne,{variant:"ghost",size:"mini",disabled:g,"aria-label":`编辑 ${re.leftTitle}`,onClick:()=>{ee(re.leftKey),re.rightFile&&!U&&M(re.setId)},children:[l.jsx(yc,{}),"编辑"]}),re.rightFile&&l.jsxs(Ne,{variant:"ghost",size:"mini",disabled:g,className:"text-muted-foreground","aria-label":`清除配对 ${re.leftTitle}`,onClick:()=>void Se(re.setId,re.leftKey,{rightFile:null}),children:[l.jsx(Ui,{}),"清除"]})]})]},re.leftKey)})})]})}),ie&&l.jsx(dR,{apiBase:e,open:H!=null,onOpenChange:re=>{re||(ee(null),K(!1))},dirPath:ie.right.path,entryTitle:oe==null?void 0:oe.leftTitle,current:oe&&oe.setId===ie.id?oe.rightFile:null,onPick:re=>{if(!H)return;const _e=oe;_e&&_e.setId!==ie.id&&_e.rightFile&&Se(_e.setId,H,{rightFile:null}),Se(ie.id,H,{rightFile:re})}}),l.jsx(Sl,{apiBase:e,open:z,onOpenChange:D,initialPath:((ye=J.find(re=>re.id===V))==null?void 0:ye.right.path)||"/",onPick:re=>{V&&Fe(V,re)}}),l.jsx(hs,{open:Q,onOpenChange:B,children:l.jsxs(Vr,{className:"max-w-md",children:[l.jsxs(Os,{children:[l.jsx(Fr,{children:"添加网盘目录绑定"}),l.jsx(Qa,{children:"为当前订阅绑定另一个 AList 网盘目录,系统将同时跟踪和对齐该目录下的文件。"})]}),l.jsxs("div",{className:"space-y-4 py-4",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(Jt,{placeholder:"AList 目录(如 /夸克/剧集2)",value:E,onChange:re=>R(re.target.value),className:"text-[12px]"}),l.jsx(Ne,{variant:"ghost",size:"small","aria-label":"浏览网盘目录",onClick:()=>_(!0),children:l.jsx($i,{})})]}),l.jsx(Sl,{apiBase:e,open:A,onOpenChange:_,initialPath:E.trim()||"/",onPick:R})]}),l.jsxs(Xc,{children:[l.jsx(Ne,{variant:"ghost",size:"small",onClick:()=>B(!1),children:"取消"}),l.jsxs(Ne,{variant:"neutral",size:"small",disabled:g||!E.trim(),onClick:()=>{Ee().then(()=>B(!1))},children:[l.jsx(bc,{}),"建绑定并同步"]})]})]})})]}):$?l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsxs("div",{className:"flex items-center justify-between pb-3 border-b border-[var(--acr-border-soft)] mb-2",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"text-[13px] font-semibold text-foreground flex items-center gap-1.5",children:[l.jsx($i,{className:"size-3.5 text-primary"}),l.jsxs("span",{children:["已绑定:",$.left.title]})]}),l.jsx("code",{className:"mt-1 block w-fit rounded border border-[var(--acr-border-soft)] bg-[var(--acr-card-nested)] px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:$.right.path})]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsxs(Ne,{variant:"ghost",size:"small",disabled:g,onClick:()=>void Te($.id),children:[l.jsx(Ud,{}),"立即同步"]}),l.jsxs(Ne,{variant:"ghost",size:"small",disabled:g,onClick:()=>D(!0),children:[l.jsx(dL,{}),"重新绑定目录"]}),l.jsxs(Ne,{variant:"destructive",size:"small",disabled:g,onClick:()=>void fe($.id),children:[l.jsx(Po,{}),"删除绑定"]})]})]}),$.coverage&&l.jsxs("div",{className:"rounded-md border border-[var(--acr-border-soft)] bg-[var(--acr-card-nested)] px-3 py-2 text-[11px]","data-slot":"netdisk-coverage",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("span",{className:"min-w-0 truncate text-muted-foreground",children:["文件利用 右 ",$.coverage.right.total," · 已配 ",$.coverage.right.matched," · ","未用 ",$.coverage.right.orphan]}),$.coverage.orphanFiles.length>0&&l.jsx(Ne,{variant:"ghost",size:"mini",className:"flex-none",onClick:()=>L(P===$.id?null:$.id),children:P===$.id?"收起":"看未用"})]}),P===$.id&&l.jsx("ul",{className:"mt-1 max-h-28 space-y-0.5 overflow-y-auto rounded bg-[var(--acr-card)] px-2 py-1 text-[10.5px] text-muted-foreground font-mono",children:$.coverage.orphanFiles.map(re=>l.jsx("li",{className:"break-all",children:re},re))})]}),l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("span",{className:"text-[11px] text-muted-foreground",children:["共 ",$.entries.length," 条 · 未匹配 ",$.entries.filter(re=>!re.rightFile).length]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(wy,{id:"only-unmatched",checked:ne,onCheckedChange:q}),l.jsx("label",{htmlFor:"only-unmatched",className:"cursor-pointer select-none text-[11px] text-muted-foreground",children:"只看未匹配"})]})]}),l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full border-collapse text-[12px]",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-[var(--acr-border-soft)] text-left text-muted-foreground",children:[l.jsx("th",{className:"py-1.5 pr-2 font-medium",children:"清单条目"}),l.jsx("th",{className:"py-1.5 pr-2 font-medium",children:"网盘文件"}),l.jsx("th",{className:"py-1.5 pr-2 font-medium",children:"状态"}),l.jsx("th",{className:"py-1.5 font-medium",children:"操作"})]})}),l.jsx("tbody",{children:(ne?$.entries.filter(re=>!re.rightFile):$.entries).map(re=>{const _e=bR(re);return l.jsxs("tr",{className:"border-b border-[var(--acr-border-soft)] align-top",children:[l.jsxs("td",{className:"py-1.5 pr-2",children:[l.jsx("div",{className:"text-foreground",children:re.leftTitle}),l.jsx("code",{className:"text-[10px] text-muted-foreground",children:re.leftKey}),re.lastError&&l.jsxs("div",{className:"mt-1 rounded bg-amber-500/15 px-1.5 py-0.5 text-[10.5px] text-amber-700 dark:text-amber-400",children:["最近走了回落:",re.lastError.message]})]}),l.jsx("td",{className:"py-1.5 pr-2",children:re.rightFile?l.jsx("button",{type:"button",title:"点击复制文件名","aria-label":`复制文件名 ${re.rightFile}`,onClick:()=>{var Pe;(Pe=navigator.clipboard)==null||Pe.writeText(re.rightFile),Ge.success("已复制文件名")},className:"block max-w-[280px] whitespace-normal break-all text-left text-[11px] text-foreground hover:text-primary",children:re.rightFile}):l.jsx("span",{className:"text-[11px] text-muted-foreground",children:"未配对"})}),l.jsxs("td",{className:"py-1.5 pr-2",children:[l.jsx(Bt,{variant:_e.variant,size:"sm",children:_e.label}),typeof re.confidence=="number"&&!re.corrected&&l.jsx("span",{className:"ml-1 text-[10px] text-muted-foreground",children:re.confidence.toFixed(2)})]}),l.jsxs("td",{className:"py-1.5 whitespace-nowrap",children:[l.jsxs(Ne,{variant:"ghost",size:"mini",disabled:g,"aria-label":`编辑 ${re.leftTitle}`,onClick:()=>ee(re.leftKey),children:[l.jsx(yc,{}),"编辑"]}),re.rightFile&&l.jsxs(Ne,{variant:"ghost",size:"mini",disabled:g,className:"text-muted-foreground","aria-label":`清除配对 ${re.leftTitle}`,onClick:()=>void Se($.id,re.leftKey,{rightFile:null}),children:[l.jsx(Ui,{}),"清除"]})]})]},re.leftKey)})})]})}),l.jsx(dR,{apiBase:e,open:H!=null,onOpenChange:re=>{re||ee(null)},dirPath:$.right.path,entryTitle:(Qe=$.entries.find(re=>re.leftKey===H))==null?void 0:Qe.leftTitle,current:((nt=$.entries.find(re=>re.leftKey===H))==null?void 0:nt.rightFile)??null,onPick:re=>{H&&Se($.id,H,{rightFile:re})}}),l.jsx(Sl,{apiBase:e,open:z,onOpenChange:D,initialPath:$.right.path||"/",onPick:re=>void Fe($.id,re)})]}):l.jsx(Gk,{children:l.jsxs(Yk,{children:[l.jsx(Wk,{children:"未选择绑定"}),l.jsx(Xk,{children:"在左侧选择或新建一个网盘绑定。"})]})})]})]})})}function DG({...e}){return l.jsx(wI,{"data-slot":"collapsible",...e})}function _G({...e}){return l.jsx(vI,{"data-slot":"collapsible-trigger",...e})}function OG({...e}){return l.jsx(yI,{"data-slot":"collapsible-content",...e})}const zG={s:1,m:60,h:3600,d:86400};function PG(e){return e>0&&e%86400===0?{value:e/86400,unit:"d"}:e>0&&e%3600===0?{value:e/3600,unit:"h"}:e>0&&e%60===0?{value:e/60,unit:"m"}:{value:e,unit:"s"}}function ky(e){return e.split(`
|
|
404
|
+
`).map(t=>t.trim()).filter(Boolean)}function SR({title:e,defaultOpen:t=!1,children:n}){const[r,i]=p.useState(t);return l.jsxs(DG,{open:r,onOpenChange:i,className:"rounded-md border border-[var(--acr-border-soft)] bg-[var(--acr-card-nested)]",children:[l.jsxs(_G,{className:"group flex w-full items-center justify-between px-3 py-2.5 text-[13px] font-medium text-foreground",children:[e,l.jsx(zo,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),l.jsx(OG,{className:"space-y-3 border-t border-[var(--acr-border-soft)] px-3 py-3",children:n})]})}function LG({conn:e,channelId:t,stream:n,onBack:r,onSaved:i,channelName:o,open:c,onOpenChange:d}){var $,se,oe,ie;const h=PG(n.cadence_seconds),[m,x]=p.useState(n.strategy??"fanout"),[g,v]=p.useState(String(h.value)),[S,b]=p.useState(h.unit),[j,C]=p.useState(((($=n.ad_filter)==null?void 0:$.keywords)??[]).join(`
|
|
405
|
+
`)),[k,N]=p.useState((((se=n.ad_filter)==null?void 0:se.domains)??[]).join(`
|
|
406
|
+
`)),[E,R]=p.useState((n.title_include??[]).join(`
|
|
407
|
+
`)),A=((oe=n.harvest)==null?void 0:oe.backfillLimit)??$f.backfillLimit,_=((ie=n.harvest)==null?void 0:ie.incrementalLimit)??$f.incrementalLimit,z=A===$f.backfillLimit&&_===$f.incrementalLimit,[D,V]=p.useState(String(A)),[I,Q]=p.useState(String(_)),[B,H]=p.useState(!1),[ee,W]=p.useState(null),[M,U]=p.useState(null),K=Math.round(Number(g)*zG[S]),ne=Math.round(Number(D)),q=Math.round(Number(I)),P=()=>{r&&r(),d&&d(!1)};async function L(){return!Number.isFinite(K)||K<=0?(W("抓取时间必须大于 0"),!1):!(ne>0)||!(q>0)?(W("抓取条数必须大于 0"),!1):(W(null),await be.updateStream(e,n.id,{strategy:m,cadence_seconds:K,options:{harvest:{backfillLimit:ne,incrementalLimit:q}}}),await be.setStreamAdFilter(e,t,n.id,{keywords:ky(j),domains:ky(k)}),await be.setStreamTitleFilter(e,t,n.id,ky(E)),!0)}async function G(){H(!0);try{if(!await L())return;i==null||i(),P()}catch(Z){W(Z.message)}finally{H(!1)}}async function J(){H(!0);try{if(!await L())return;const{changed:Z}=await be.reclassifyStreamAdFilter(e,t,n.id);U(Z),i==null||i()}catch(Z){W(Z.message)}finally{H(!1)}}return l.jsxs("div",{className:"flex h-full w-full flex-col bg-[var(--acr-bg)]","data-slot":"stream-setting-page",children:[l.jsxs(WE,{className:"h-[49px] border-b border-[var(--acr-border-soft)] px-4 flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(Ne,{variant:"ghost",size:"large",icon:!0,onClick:P,"aria-label":"返回",children:l.jsx(eL,{})}),l.jsx(eR,{className:"select-none",children:l.jsxs(tR,{className:"text-[12.5px] gap-1 sm:gap-1.5",children:[l.jsx(Sh,{children:l.jsx(nR,{onClick:P,className:"cursor-pointer",children:"频道"})}),l.jsx(my,{children:"/"}),l.jsx(Sh,{children:l.jsx("span",{className:"text-muted-foreground",children:o||t})}),l.jsx(my,{children:"/"}),l.jsx(Sh,{children:l.jsx(rR,{className:"font-semibold text-foreground",children:n.description||n.id})})]})})]}),l.jsx("div",{className:"flex items-center gap-2",children:l.jsx(Ne,{onClick:()=>void G(),disabled:B,size:"small",children:B?"保存中…":"保存并返回"})})]}),l.jsxs("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[l.jsxs(ly,{className:"w-80 flex-none border-r border-[var(--acr-border-soft)] overflow-y-auto p-6 space-y-4",children:[l.jsx("div",{className:"text-[12.5px] font-semibold text-muted-foreground tracking-wider uppercase mb-2",children:"配置与过滤规则"}),l.jsxs(cr,{orientation:"vertical",children:[l.jsx(ur,{children:"抓取方式"}),l.jsxs(la,{value:m,onValueChange:Z=>x(Z),children:[l.jsx(ua,{size:"medium",className:"w-full","aria-label":"抓取方式",children:l.jsx(ca,{})}),l.jsxs(da,{children:[l.jsx(lr,{value:"fanout",children:"聚合(全部抓取后合并)"}),l.jsx(lr,{value:"exclusive",children:"互斥·优先级(首个健康来源生效)"})]})]})]}),l.jsxs(cr,{orientation:"vertical",children:[l.jsx(ur,{children:"抓取间隔"}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(Jt,{type:"number",min:1,size:"medium",className:"w-16",value:g,onChange:Z=>v(Z.target.value),"aria-label":"抓取间隔数值"}),l.jsxs(la,{value:S,onValueChange:Z=>b(Z),children:[l.jsx(ua,{size:"medium",className:"w-20","aria-label":"抓取间隔单位",children:l.jsx(ca,{})}),l.jsxs(da,{children:[l.jsx(lr,{value:"s",children:"秒"}),l.jsx(lr,{value:"m",children:"分钟"}),l.jsx(lr,{value:"h",children:"小时"}),l.jsx(lr,{value:"d",children:"天"})]})]})]})]}),l.jsxs(SR,{title:`更多设置 · 抓取深度${z?"(默认)":""}`,defaultOpen:!z,children:[l.jsxs(cr,{orientation:"vertical",children:[l.jsx(ur,{htmlFor:`ss-bf-${n.id}`,children:"回填深度"}),l.jsx(to,{children:"首次订阅时拉取的条数"}),l.jsx(Jt,{id:`ss-bf-${n.id}`,type:"number",min:1,size:"medium",className:"w-20",value:D,onChange:Z=>V(Z.target.value),"aria-label":"回填深度"})]}),l.jsxs(cr,{orientation:"vertical",children:[l.jsx(ur,{htmlFor:`ss-inc-${n.id}`,children:"增量条数"}),l.jsx(to,{children:"每次刷新拉取的条数"}),l.jsx(Jt,{id:`ss-inc-${n.id}`,type:"number",min:1,size:"medium",className:"w-20",value:I,onChange:Z=>Q(Z.target.value),"aria-label":"增量条数"})]})]}),l.jsxs(SR,{title:"过滤条件",children:[l.jsxs(cr,{orientation:"vertical",children:[l.jsx(ur,{htmlFor:`ss-include-${n.id}`,children:"只看包含"}),l.jsx(to,{children:"标题命中才保留 · 每行一个"}),l.jsx(jh,{children:l.jsx(Ch,{id:`ss-include-${n.id}`,"aria-label":"只看包含标题关键词(每行一个)",placeholder:"留空 = 不限",autoResize:!0,maxRows:5,value:E,onChange:Z=>R(Z.target.value)})})]}),l.jsxs(cr,{orientation:"vertical",children:[l.jsx(ur,{htmlFor:`ss-kw-${n.id}`,children:"屏蔽关键词"}),l.jsx(to,{children:"命中即折叠 · 每行一个"}),l.jsx(jh,{children:l.jsx(Ch,{id:`ss-kw-${n.id}`,"aria-label":"过滤关键词(每行一个)",autoResize:!0,maxRows:6,value:j,onChange:Z=>C(Z.target.value)})})]}),l.jsxs(cr,{orientation:"vertical",children:[l.jsx(ur,{htmlFor:`ss-dm-${n.id}`,children:"屏蔽域名"}),l.jsx(to,{children:"每行一个"}),l.jsx(jh,{children:l.jsx(Ch,{id:`ss-dm-${n.id}`,"aria-label":"过滤域名(每行一个)",autoResize:!0,maxRows:5,value:k,onChange:Z=>N(Z.target.value)})})]}),l.jsxs("div",{className:"space-y-1.5 pt-1",children:[l.jsx("p",{className:"text-[11px] leading-snug text-muted-foreground",children:"规则对之后抓取的内容自动生效;已入库的旧内容点下方按钮重算。"}),l.jsx(Ne,{variant:"neutral",size:"medium",disabled:B,className:"w-full",onClick:()=>void J(),children:"应用到历史内容"}),M!==null&&l.jsxs("span",{className:"block text-center text-[11px] text-muted-foreground",children:["已更新 ",M," 条"]})]})]}),ee?l.jsx("div",{className:"rounded bg-destructive/60 px-2 py-1 text-xs text-destructive-foreground",children:ee}):null]}),l.jsxs(cy,{className:"flex-1 overflow-y-auto p-6",children:[l.jsx("div",{className:"text-[12.5px] font-semibold text-muted-foreground tracking-wider uppercase mb-4",children:"AList 网盘对照绑定"}),l.jsx(Cy,{streamId:n.id,apiBase:e.baseUrl})]})]})]})}function Ny(e){return e.present==="timeline"||e.present==="audio"||e.present==="video"||e.present==="research"||e.present==="tasks"||e.present==="embed"}function jR(e){const t=n=>n.id===Nh?0:n.system?1:2;return[...e].sort((n,r)=>t(n)-t(r))}function IG({channels:e,selected:t,onSelect:n}){return e.length===0?null:l.jsx("div",{"data-testid":"panel-channel-bar",role:"tablist","aria-label":"频道",className:"flex shrink-0 gap-1.5 overflow-x-auto border-b border-border/60 px-3 py-2 [scrollbar-width:none]",children:jR(e).map(r=>{const i=Ny(r),o=i&&r.id===t;return l.jsxs("button",{type:"button",role:"tab","aria-selected":o,disabled:!i,title:i?r.label:`${r.label}:这类频道要另一套视图,面板暂不支持`,onClick:()=>{i&&n(r.id)},className:Y("shrink-0 rounded-full px-2.5 py-1 text-xs whitespace-nowrap transition-colors",o?"bg-primary text-primary-foreground":i?"bg-muted text-muted-foreground hover:text-foreground":"cursor-not-allowed text-muted-foreground/50"),children:[r.label,i?null:l.jsx("span",{className:"ml-1 opacity-70",children:"·暂不支持"})]},r.id)})})}const CR=1200,$G=30;function BG(e){var r;const t=((r=e.content)==null?void 0:r.text)??e.body_text;if(t===void 0)return;const n=t.trim();return n===""?void 0:n}function kR(e){var r;const t=BG(e),n=t!==void 0&&t.length>CR;return{id:e.id,title:(((r=e.content)==null?void 0:r.title)??e.title??"").trim()||e.id,...e.url!==void 0?{url:e.url}:{},...e.author!==void 0?{author:e.author}:{},...e.stream_id!==void 0?{streamId:e.stream_id}:{},...t!==void 0?{excerpt:n?t.slice(0,CR):t}:{},...n?{truncated:!0}:{}}}function UG(e,t,n){const r=new Array(e);return new Proxy(r,{get(i,o,c){if(typeof o=="string"){const d=o.charCodeAt(0);if(d>=48&&d<=57){const h=+o;if(Number.isInteger(h)&&h>=0&&h<e){let m=i[h];if(!m){const x=t[h*2];m=i[h]={index:h,key:n(h),start:x,size:t[h*2+1],end:x+t[h*2+1],lane:0}}return m}}if(o==="length")return e}return Reflect.get(i,o,c)}})}function jl(e,t,n){let r=n.initialDeps??[],i,o=!0;function c(){const d=e();return(d.length!==r.length||d.some((m,x)=>r[x]!==m))&&(r=d,i=t(...d),n!=null&&n.onChange&&!(o&&n.skipInitialOnChange)&&n.onChange(i),o=!1),i}return c.updateDeps=d=>{r=d},c}function NR(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const VG=(e,t)=>Math.abs(e-t)<1.01,FG=(e,t,n)=>{let r;return Object.assign(function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)},{cancel:()=>{e.clearTimeout(r)}})};let wu;const Ty=()=>{if(wu!==void 0)return wu;if(typeof navigator>"u")return wu=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return wu=!0;const e=navigator.maxTouchPoints;return wu=navigator.platform==="MacIntel"&&e!==void 0&&e>0},TR=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},HG=e=>e,qG=e=>{const t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,i=new Array(r);for(let o=0;o<r;o++)i[o]=t+o;return i},KG=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const i=c=>{const{width:d,height:h}=c;t({width:Math.round(d),height:Math.round(h)})};if(i(TR(n)),!r.ResizeObserver)return()=>{};const o=new r.ResizeObserver(c=>{const d=()=>{const h=c[0];if(h!=null&&h.borderBoxSize){const m=h.borderBoxSize[0];if(m){i({width:m.inlineSize,height:m.blockSize});return}}i(TR(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(d):d()});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},Rh={passive:!0},GG=typeof window>"u"?!0:"onscrollend"in window,YG=(e,t,n)=>{const r=e.scrollElement;if(!r)return;const i=e.targetWindow;if(!i)return;const o=e.options.useScrollendEvent&&GG;let c=0;const d=o?null:FG(i,()=>t(c,!1),e.options.isScrollingResetDelay),h=g=>()=>{c=n(r),d==null||d(),t(c,g)},m=h(!0),x=h(!1);return r.addEventListener("scroll",m,Rh),o&&r.addEventListener("scrollend",x,Rh),()=>{r.removeEventListener("scroll",m),o&&r.removeEventListener("scrollend",x),d==null||d.cancel()}},WG=(e,t)=>YG(e,t,n=>{const{horizontal:r,isRtl:i}=e.options;return r?n.scrollLeft*(i&&-1||1):n.scrollTop}),XG=(e,t,n)=>{if(n.options.useCachedMeasurements){const r=n.indexFromElement(e),i=n.options.getItemKey(r);return n.itemSizeCache.get(i)??n.options.estimateSize(r)}if(t!=null&&t.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}if(!t){const r=n.indexFromElement(e),i=n.options.getItemKey(r),o=n.itemSizeCache.get(i);if(o!==void 0)return o}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},QG=(e,{adjustments:t=0,behavior:n},r)=>{var i,o;(o=(i=r.scrollElement)==null?void 0:i.scrollTo)==null||o.call(i,{[r.options.horizontal?"left":"top"]:e+t,behavior:n})};class ZG{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var n,r,i;return((i=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:i.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(i=>{i.forEach(o=>{const c=()=>{const d=o.target,h=this.indexFromElement(d);if(!d.isConnected){this.observer.unobserve(d);for(const[m,x]of this.elementsCache)if(x===d){this.elementsCache.delete(m);break}return}this.isIndexInRange(h)&&this.shouldMeasureDuringScroll(h)&&this.resizeItem(h,this.options.measureElement(d,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()})}));return{disconnect:()=>{var i;(i=r())==null||i.disconnect(),n=null},observe:i=>{var o;return(o=r())==null?void 0:o.observe(i,{box:"border-box"})},unobserve:i=>{var o;return(o=r())==null?void 0:o.unobserve(i)}}})(),this.range=null,this.setOptions=n=>{var r,i;const o={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:HG,rangeExtractor:qG,onChange:()=>{},measureElement:XG,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const v in n){const S=n[v];S!==void 0&&(o[v]=S)}const c=this.options;let d=null,h=null,m=!1;if(c!==void 0&&c.enabled&&o.enabled&&o.anchorTo==="end"&&this.scrollElement!==null){const v=c.count,S=o.count,b=this.getMeasurements(),j=v>0?((r=b[0])==null?void 0:r.key)??c.getItemKey(0):null,C=v>0?((i=b[v-1])==null?void 0:i.key)??c.getItemKey(v-1):null;if(S!==v||v>0&&S>0&&(o.getItemKey(0)!==j||o.getItemKey(S-1)!==C)){m=!0;const E=v>0?this.getVirtualItemForOffset(this.getScrollOffset())??b[0]:null;E&&(d=[E.key,this.getScrollOffset()-E.start]);const R=o.followOnAppend===!0?"auto":o.followOnAppend||null;R&&S>v&&this.isAtEnd(c.scrollEndThreshold)&&(v===0||o.getItemKey(S-1)!==C)&&(h=R)}}this.options=o,m&&(this.pendingMin=0,this.itemSizeCacheVersion++);let x=!1,g=0;if(d&&this.scrollOffset!==null){const[v,S]=d,b=this.getMeasurements(),{count:j,getItemKey:C}=this.options;let k=0;for(;k<j&&C(k)!==v;)k++;if(k<j){const N=b[k];if(N){const E=Math.max(0,N.start+S);E!==this.scrollOffset&&(g=E-this.scrollOffset,this.scrollOffset=E,x=!0)}}}(x||h)&&(this.pendingScrollAnchor=[x?d[0]:null,x?d[1]:0,h,g])},this.notify=n=>{var r,i;(i=(r=this.options).onChange)==null||i.call(r,this,n)},this.maybeNotify=jl(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}if(this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,c)=>{if(c&&this._intendedScrollOffset===null&&o===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(o-this._intendedScrollOffset)<1.5&&(o=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const d=this.getScrollOffset();this.scrollDirection=c?d===o?this.scrollDirection:d<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=c,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const o=this.scrollElement,c=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},d=()=>{this._iosTouching=!1,!(!Ty()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};o.addEventListener("touchstart",c,Rh),o.addEventListener("touchend",d,Rh),this.unsubs.push(()=>{o.removeEventListener("touchstart",c),o.removeEventListener("touchend",d),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const i=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,i&&this.scrollElement&&this.options.enabled){const[o,c,d,h]=i;o!==null&&!d&&(Ty()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?h!==0&&(this._iosDeferredAdjustment+=h):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),d&&this.scrollToEnd({behavior:d})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const n=this.getScrollOffset(),r=this.getMaxScrollOffset();if(n<0||n>r)return;if(this._iosDeferredAdjustment<0&&n>=r-1){this._iosDeferredAdjustment=0;return}const i=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(n,{adjustments:this.scrollAdjustments+=i,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=jl(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(n,r,i,o,c,d,h,m)=>(this.prevLanes!==void 0&&this.prevLanes!==d&&(this.lanesChangedFlag=!0),this.prevLanes=d,this.pendingMin=null,{count:n,paddingStart:r,scrollMargin:i,getItemKey:o,enabled:c,lanes:d,laneAssignmentMode:h,gap:m}),{key:!1}),this.isIndexInRange=n=>n>=0&&n<this.options.count,this.getMeasurements=jl(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:r,scrollMargin:i,getItemKey:o,enabled:c,lanes:d,laneAssignmentMode:h,gap:m},x)=>{const g=this.itemSizeCache;if(!c)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const k of this.laneAssignments.keys())k>=n&&this.laneAssignments.delete(k);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(k=>{this.itemSizeCache.set(k.key,k.size)}));const v=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),d===1){const k=n*2;let N=this._flatMeasurements;if(!N||N.length<k){const A=new Float64Array(k);N&&v>0&&A.set(N.subarray(0,v*2)),N=A,this._flatMeasurements=N}let E;if(v===0)E=r+i;else{const A=v-1;E=N[A*2]+N[A*2+1]+m}for(let A=v;A<n;A++){const _=o(A),z=g.get(_),D=typeof z=="number"?z:this.options.estimateSize(A);N[A*2]=E,N[A*2+1]=D,E+=D+m}const R=UG(n,N,o);return this.measurementsCache=R,R}const S=this.measurementsCache.slice(0,v),b=new Array(d).fill(void 0),j=new Float64Array(d);let C=0;for(let k=0;k<v;k++){const N=S[k];N&&(b[N.lane]===void 0&&C++,b[N.lane]=k,j[N.lane]=N.end)}for(let k=v;k<n;k++){const N=o(k),E=this.laneAssignments.get(k);let R,A;const _=h==="estimate"||g.has(N);if(E!==void 0&&this.options.lanes>1){R=E;const I=b[R],Q=I!==void 0?S[I]:void 0;A=Q?Q.end+m:r+i}else if(C===d){let I=0,Q=j[0],B=b[0];for(let H=1;H<d;H++){const ee=j[H];(ee<Q||ee===Q&&b[H]<B)&&(I=H,Q=ee,B=b[H])}R=I,A=Q+m,_&&this.laneAssignments.set(k,R)}else R=k%this.options.lanes,A=r+i,_&&this.laneAssignments.set(k,R);const z=g.get(N),D=typeof z=="number"?z:this.options.estimateSize(k),V=A+D;S[k]={index:k,start:A,size:D,end:V,key:N,lane:R},b[R]===void 0&&C++,b[R]=k,j[R]=V}return this.measurementsCache=S,S},{key:!1,debug:()=>this.options.debug}),this.calculateRange=jl(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,i,o)=>n.length===0||r===0?(this.range=null,null):(this.range=eY(n,r,i,o,o===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=jl(()=>{let n=null,r=null;const i=this.calculateRange();return i&&(n=i.startIndex,r=i.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,i,o,c)=>o===null||c===null?[]:n({startIndex:o,endIndex:c,overscan:r,count:i}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,i=n.getAttribute(r);return i?parseInt(i,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const i=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(i!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),c=Math.max(0,i-o),d=Math.min(this.options.count-1,i+o);return n>=c&&n<=d}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((c,d)=>{c.isConnected||(this.observer.unobserve(c),this.elementsCache.delete(d))});return}const r=this.indexFromElement(n);if(!this.isIndexInRange(r))return;const i=this.options.getItemKey(r),o=this.elementsCache.get(i);o!==n&&(o&&this.observer.unobserve(o),this.observer.observe(n),this.elementsCache.set(i,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var i,o;if(!this.isIndexInRange(n))return;let c,d,h;const m=this._flatMeasurements;if(this.options.lanes===1&&m!==null)h=this.options.getItemKey(n),d=m[n*2],c=m[n*2+1];else{const v=this.measurementsCache[n];if(!v)return;h=v.key,d=v.start,c=v.size}const x=this.itemSizeCache.get(h)??c,g=r-x;if(g!==0){const v=this.options.anchorTo==="end"&&((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,S=v?this.getTotalSize():0,b=this.getScrollOffset()+this.scrollAdjustments,C=!this.itemSizeCache.has(h)?d<b:d+x<=b&&this.scrollDirection!=="backward",k=((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:h,start:d,size:c,end:d+c,lane:0},g,this):C);(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(h,r),this.itemSizeCacheVersion++;let N=!1;v?N=this.applyScrollAdjustment(this.getTotalSize()-S):k&&(N=this.applyScrollAdjustment(g)),this.notify(N)}},this.getVirtualItems=jl(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const i=[];for(let o=0,c=n.length;o<c;o++){const d=n[o],h=r[d];i.push(h)}return i},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length===0)return;const i=this._flatMeasurements,o=this.options.lanes===1&&i!=null,c=ER(0,r.length-1,o?d=>i[d*2]:d=>NR(r[d]).start,n);return NR(r[c])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(n=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=n,this.getOffsetForAlignment=(n,r,i=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),c=this.getScrollOffset();r==="auto"&&(r=n>=c+o?"end":"start"),r==="center"?n+=(i-o)/2:r==="end"&&(n-=o);const d=this.getMaxScrollOffset();return Math.max(Math.min(d,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const i=this.getSize(),o=this.getScrollOffset(),c=this.measurementsCache[n];if(!c)return;if(r==="auto")if(c.end>=o+i-this.options.scrollPaddingEnd)r="end";else if(c.start<=o+this.options.scrollPaddingStart)r="start";else return[o,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const d=r==="end"?c.end+this.options.scrollPaddingEnd:c.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(d,r,c.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:i="auto"}={})=>{this._iosDeferredAdjustment=0;const o=this.getOffsetForAlignment(n,r),c=this.now();this.scrollState={index:null,align:r,behavior:i,startedAt:c,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:i="auto"}={})=>{this._iosDeferredAdjustment=0,n=Math.max(0,Math.min(n,this.options.count-1));const o=this.getOffsetForIndex(n,r);if(!o)return;const[c,d]=o,h=this.now();this.scrollState={index:n,align:d,behavior:i,startedAt:h,lastTargetOffset:c,stableFrames:0},this._scrollToOffset(c,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const i=this.getScrollOffset()+n,o=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:n="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:n});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:n})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let i;if(r.length===0)i=this.options.paddingStart;else if(this.options.lanes===1){const o=r.length-1,c=this._flatMeasurements;c!=null?i=c[o*2]+c[o*2+1]:i=((n=r[o])==null?void 0:n.end)??0}else{const o=Array(this.options.lanes).fill(null);let c=r.length-1;for(;c>=0&&o.some(d=>d===null);){const d=r[c];o[d.lane]===null&&(o[d.lane]=d.end),c--}i=Math.max(...o.filter(d=>d!==null))}return Math.max(i-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const n=[];if(this.itemSizeCache.size===0)return n;const r=this.getMeasurements();for(const i of r)i&&this.itemSizeCache.has(i.key)&&n.push({index:i.index,key:i.key,start:i.start,size:i.size,end:i.end,lane:i.lane});return n},this._scrollToOffset=(n,{adjustments:r,behavior:i})=>{this._intendedScrollOffset=n+(r??0),this.options.scrollToFn(n,{behavior:i,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(t)}applyScrollAdjustment(t,n){return t===0?!1:Ty()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=t,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=t,behavior:n}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,i=r?r[0]:this.scrollState.lastTargetOffset,o=1,c=i!==this.scrollState.lastTargetOffset;if(!c&&VG(i,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.getScrollOffset()!==i&&this._scrollToOffset(i,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,c){const d=this.getSize()||600,h=Math.abs(i-this.getScrollOffset()),m=this.scrollState.behavior==="smooth"&&h>d;this.scrollState.lastTargetOffset=i,m||(this.scrollState.behavior="auto"),this._scrollToOffset(i,{adjustments:void 0,behavior:m?"smooth":"auto"})}this.scheduleScrollReconcile()}}const ER=(e,t,n,r)=>{for(;e<=t;){const i=(e+t)/2|0,o=n(i);if(o<r)e=i+1;else if(o>r)t=i-1;else return i}return e>0?e-1:0};function JG(e,t,n){let r=0;for(;r<=t;){const i=(r+t)/2|0,o=e[i*2];if(o<n)r=i+1;else if(o>n)t=i-1;else return i}return r>0?r-1:0}function eY(e,t,n,r,i){const o=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:o};if(r===1&&i!==null){const m=JG(i,o,n);let x=m;const g=n+t;for(;x<o&&i[x*2]+i[x*2+1]<g;)x++;return{startIndex:m,endIndex:x}}let d=ER(0,o,m=>e[m].start,n),h=d;if(r===1)for(;h<o&&e[h].end<n+t;)h++;else if(r>1){const m=Array(r).fill(0);for(;h<o&&m.some(g=>g<n+t);){const g=e[h];m[g.lane]=g.end,h++}const x=Array(r).fill(n+t);for(;d>=0&&x.some(g=>g>=n);){const g=e[d];x[g.lane]=g.start,d--}d=Math.max(0,d-d%r),h=Math.min(o,h+(r-1-h%r))}return{startIndex:d,endIndex:h}}const Ey=typeof document<"u"?p.useLayoutEffect:p.useEffect;function tY({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n="transform",...r}){const i=p.useReducer(x=>x+1,0)[1],o=p.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});o.current.enabled=t,o.current.mode=n;const c=x=>{const g=o.current;if(!g.enabled||!g.container)return;const v=x.getTotalSize();if(v!==g.lastSize){g.lastSize=v;const S=x.options.horizontal?"width":"height";g.container.style[S]=`${v}px`}},d=x=>{const g=o.current;if(!g.enabled||!g.container)return;c(x);const v=!!x.options.horizontal,S=g.mode==="transform",b=v?"left":"top",j=x.options.scrollMargin,C=x.getVirtualItems();for(const k of C){const N=k.start-j,E=x.elementsCache.get(k.key);E&&g.lastPositions.get(E)!==N&&(g.lastPositions.set(E,N),S?E.style.transform=v?`translate3d(${N}px, 0, 0)`:`translate3d(0, ${N}px, 0)`:E.style[b]=`${N}px`)}},h={...r,onChange:(x,g)=>{var v;const S=o.current;let b=!0;if(S.enabled){d(x);const j=x.range,C=S.prevRange;b=!C||C.isScrolling!==x.isScrolling||C.startIndex!==(j==null?void 0:j.startIndex)||C.endIndex!==(j==null?void 0:j.endIndex),b&&(S.prevRange=j?{startIndex:j.startIndex,endIndex:j.endIndex,isScrolling:x.isScrolling}:null)}b&&(e&&g?Ba.flushSync(i):i()),(v=r.onChange)==null||v.call(r,x,g)}},[m]=p.useState(()=>{const x=new ZG(h);return Object.assign(x,{containerRef:g=>{const v=o.current;if(v.container=g,v.lastSize=null,g&&v.enabled){const S=x.getTotalSize();v.lastSize=S;const b=x.options.horizontal?"width":"height";g.style[b]=`${S}px`}}})});return m.setOptions(h),Ey(()=>m._didMount(),[]),Ey(()=>(c(m),m._willUpdate())),Ey(()=>{d(m)}),m}function nY(e){return tY({observeElementRect:KG,observeElementOffset:WG,scrollToFn:QG,...e})}const rY=G3,sY=Y3,RR=p.forwardRef(({className:e,...t},n)=>l.jsx(BS,{ref:n,className:Y("fixed inset-0 z-50 bg-[var(--acr-overlay)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,style:{backdropFilter:"blur(20px) saturate(1.3)",WebkitBackdropFilter:"blur(20px) saturate(1.3)"}}));RR.displayName=BS.displayName;const AR=p.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(sY,{children:[l.jsx(RR,{}),l.jsxs(US,{ref:r,className:Y("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg [&>*]:min-w-0 translate-x-[-50%] translate-y-[-50%] gap-4 rounded-[26px] bg-[var(--acr-panel)] backdrop-blur-xl p-6 shadow-[0_0_0_1px_rgba(190,190,190,0.16),0_16px_48px_rgba(0,0,0,0.45)] duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",e),...n,children:[l.jsx(yx,{}),t]})]}));AR.displayName=US.displayName;const MR=({className:e,...t})=>l.jsx("div",{className:Y("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});MR.displayName="AlertDialogHeader";const DR=({className:e,...t})=>l.jsx("div",{className:Y("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t});DR.displayName="AlertDialogFooter";const _R=p.forwardRef(({className:e,...t},n)=>l.jsx(HS,{ref:n,className:Y("text-lg font-semibold leading-none tracking-tight",e),...t}));_R.displayName=HS.displayName;const OR=p.forwardRef(({className:e,...t},n)=>l.jsx(qS,{ref:n,className:Y("text-sm text-muted-foreground",e),...t}));OR.displayName=qS.displayName;const zR=p.forwardRef(({className:e,...t},n)=>l.jsx(VS,{ref:n,className:Y(vx({variant:"default",size:"large"}),e),...t}));zR.displayName=VS.displayName;const aY=p.forwardRef(({className:e,...t},n)=>l.jsx(FS,{ref:n,className:Y(vx({variant:"neutral",size:"large"}),e),...t}));aY.displayName=FS.displayName;function iY(e){var r;const t=(e??"").match(/专辑[::]\s*(.+?)(?:<br>|<\/|\r?\n|发行|$)/);return((r=t==null?void 0:t[1])==null?void 0:r.trim())||void 0}const Ry=p.createContext(null);function Ay(){const e=p.useContext(Ry);if(!e)throw new Error("useAudioStage must be used inside <AudioStageContext.Provider>");return e}function oY(){return p.useContext(Ry)}function lY(e,t){if(!t||e.length===0)return;const n=e.findIndex(r=>r.id===t);return n>=0?e[n+1]:void 0}function Ah(e){(!Number.isFinite(e)||e<0)&&(e=0);const t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${String(n).padStart(2,"0")}`}function cY(e){if(!e)return;const t=e.indexOf("?");if(t>=0){const n=new URLSearchParams(e.slice(t+1)).get("fallback");if(n)return n}if(!e.includes("/resolve")&&/^https?:\/\//i.test(e))return e}function Mh(e,t,n="music"){var g;let r,i,o,c,d,h;for(const v of((g=e.content)==null?void 0:g.media)??[]){if(v.kind==="audio"&&v.platform&&v.track_id){r=v.platform,i=v.track_id,h=v.url,o=v.poster,c=v.duration_s;break}v.kind==="audio"&&v.url&&!d&&(d=v.url,o=o??v.poster,c=c??v.duration_s),v.kind==="link"&&v.platform&&v.track_id&&!r&&(r=v.platform,i=v.track_id,o=v.image,c=v.duration_s)}const m=r&&i?Dh(t,{platform:r,trackId:i,fallback:cY(h)}):d&&jp(t,d);if(!m)return null;const x=typeof e.author=="string"?e.author:void 0;return{id:e.id,kind:n,url:m,title:My(e),author:x,poster:o?is(t,o):void 0,durationS:c,...r&&i?{platform:r,trackId:i}:{}}}function uY(e,t,n){const r=[];for(const i of e){const o=Mh(i,t,n);o&&r.push(o)}return r}function Dh(e,t){const n=new URLSearchParams({platform:t.platform,id:t.trackId});return t.fallback&&n.set("fallback",t.fallback),`${e}/api/media/tracks/resolve?${n.toString()}`}function My(e){const t=e.title||e.id,n=typeof e.author=="string"?e.author:"";return n&&t.endsWith(` - ${n}`)?t.slice(0,-(n.length+3)).trim():t}function dY(e){return(e.sources??[]).some(n=>{var r;return(((r=n.source)==null?void 0:r.categories)??[]).includes("podcast")})?"podcast":"music"}function fY(e){const t=[],n=[];for(const r of e)(dY(r)==="podcast"?n:t).push(r);return{playlists:t,podcasts:n}}function PR(e){var t;for(const n of((t=e.content)==null?void 0:t.media)??[])if((n.kind==="audio"||n.kind==="link")&&n.platform&&n.track_id)return`${n.platform}:${n.track_id}`;return null}function LR(e,t){var r;if(!e)return;const n=e.source_id??"";if(n.startsWith("alist:"))return{label:(t==null?void 0:t(n))||"网盘",kind:"netdisk"};if((r=e.content)!=null&&r.paid)return{label:"付费",kind:"paid"}}function hY(e){var n;const t=new Map;for(const r of e??[]){const o=(typeof((n=r.params)==null?void 0:n.path)=="string"?r.params.path:"").replace(/\/+$/,"").split("/").pop();r.plugin_id&&r.source_template_id&&o&&t.set(`${r.plugin_id}:${r.source_template_id}`,o)}return r=>t.get(r)}const mY=/^(\d{3})[..]/;function pY(e){const t=mY.exec(e.trim());return t?Number(t[1]):null}function gY(e,t){const n=[],r=[];if(e.forEach((o,c)=>{const d=pY(t(o));d!==null&&(n.push(c),r.push({item:o,no:d}))}),r.length*2<=e.length)return e;r.sort((o,c)=>c.no-o.no);const i=e.slice();return n.forEach((o,c)=>{i[o]=r[c].item}),i}function Su(e,t){return e.collectKey?e.collectKey:e.likeRef?{kind:"track",platform:e.likeRef.platform,trackId:e.likeRef.trackId}:t?{kind:"episode",streamId:t,itemId:e.id}:null}function xY(e,t){const n=t.trim().toLowerCase();return n?e.filter(r=>[r.title,r.author,r.album].some(i=>i==null?void 0:i.toLowerCase().includes(n))):e}function IR(e,t){const n=[],r=new Map,i=[];for(const o of e){if(o.kind==="track"){i.push(o);continue}o.kind!=="episode"||!o.itemId||!o.streamId||(o.streamId===t?n.push(o.itemId):r.set(o.streamId,[...r.get(o.streamId)??[],o.itemId]))}return{liveItemIds:n,fetchStreams:r,trackMembers:i}}function $R(e,t,n){const r=[];return{rows:e.map(o=>{if(o.kind==="track"){const h={id:`scope:${o.platform}:${o.trackId}`,kind:"music",url:Dh(n,{platform:o.platform,trackId:o.trackId}),title:o.title,author:o.artist,poster:o.poster?is(n,o.poster):void 0,durationS:o.durationS};return{id:h.id,title:o.title,author:o.artist,album:o.album,poster:o.poster,durationS:o.durationS,track:h,playIndex:r.push(h)-1,trackKey:`${o.platform}:${o.trackId}`,likeRef:{platform:o.platform,trackId:o.trackId},sourceUrl:o.sourceUrl,collectKey:{kind:"track",platform:o.platform,trackId:o.trackId}}}const c=t(o.itemId),d=c?Mh(c,n):null;return{id:o.key,title:o.title,author:o.artist,album:o.album,poster:(d==null?void 0:d.poster)??o.poster,durationS:(d==null?void 0:d.durationS)??o.durationS,track:d??void 0,playIndex:d?r.push(d)-1:-1,trackKey:c?PR(c):null,sourceUrl:o.sourceUrl,muted:!d,sourceItem:c,origin:LR(c),collectKey:{kind:"episode",streamId:o.streamId,itemId:o.itemId}}}),tracks:r}}function vY(e){return!!e.selCollection&&e.membersLoaded&&e.metaLoaded&&e.meta===null}function yY(e,t){return e.filter(n=>!n.system).map(n=>{const r=n.anchorStreamId?t.get(n.anchorStreamId):void 0;return{id:n.id,label:n.label,subtitle:r?`来自「${r}」`:void 0,itemCount:n.itemCount??0}})}function bY(e,t,n){if(t===n||t<0||t>=e.length||n<0||n>=e.length)return e;const r=e.slice(),[i]=r.splice(t,1);return r.splice(n,0,i),r}function wY(e){if(!e)return"";const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const n=r=>String(r).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}function SY(e){return e.timestamp===e.fetched_at?"入库时间":"发布时间"}function Dy(e){var o;const t=[],n=e.author??((o=e.sourceItem)==null?void 0:o.author);n&&t.push({label:"作者",value:n}),e.album&&t.push({label:"专辑",value:e.album}),e.durationS&&t.push({label:"时长",value:Ah(e.durationS)});const r=e.sourceItem,i=wY(r==null?void 0:r.timestamp);return r&&i&&t.push({label:SY(r),value:i}),t}const jY=/^\s*[^::\s]{1,8}[::]\s*(.+?)\s*$/;function BR(e){var i;const t=e.sourceItem,n=(((i=t==null?void 0:t.content)==null?void 0:i.text)??(t==null?void 0:t.body_text)??"").trim();if(!n)return"";const r=new Set(Dy(e).map(o=>o.value));return n.split(`
|
|
408
|
+
`).filter(o=>{var d;const c=(d=jY.exec(o))==null?void 0:d[1];return!(c&&r.has(c))}).join(`
|
|
409
|
+
`).replace(/\n{3,}/g,`
|
|
410
|
+
|
|
411
|
+
`).trim()}function CY(e){return Dy(e).length>0||!!BR(e)||!!e.sourceUrl}function kY(e){const t=[];e.downloadAll&&t.push({kind:"item",key:"downloadAll",label:"下载整单"}),e.sync&&t.push({kind:"checkbox",key:"sync",label:"自动下载新曲目",checked:e.sync.on}),e.netdisk&&t.push({kind:"item",key:"netdisk",label:"网盘"}),e.exportM3u&&t.push({kind:"item",key:"exportM3u",label:"生成 m3u"});const n=[];return e.rename&&n.push({kind:"item",key:"rename",label:"重命名"}),e.remove&&n.push({kind:"item",key:"remove",label:"删除播单",destructive:!0}),t.length===0?n:n.length===0?t:[...t,{kind:"separator",key:"sep"},...n]}function UR(e){return e.collectionRows??e.scopeRows??(e.isLikedPlaylist?e.likedRows:e.tableRows)}function NY(e){return e.isCollection||e.isLikedPlaylist||e.scopeId||!e.streamId?{kind:"rows"}:{kind:"stream",streamId:e.streamId}}function TY(e){return e.isLikedPlaylist?null:e.isCollection?e.collectionId?{kind:"collection",id:e.collectionId}:null:e.streamId?{kind:"stream",id:e.streamId}:null}function _y(e,t){if(t)return e.flatMap(n=>n.streams).find(n=>n.id===t)}function VR(e){var t;return!!((t=e==null?void 0:e.options)!=null&&t.autoDownload)}function FR(e){const t=e.selection,n=t?e.rows.filter(i=>t.ids.has(t.idOf(i))):e.rows,r=n.filter(e.canDownload);return{targets:r,skipped:n.length-r.length}}function HR(e){const t=e.archived??0,n=[];e.failed>0&&n.push(`${e.failed} 首失败`),t>0&&n.push(`${t} 首已下载过`),e.skipped>0&&n.push(`${e.skipped} 首无可下载来源`);const r=n.length?`(${n.join(",")})`:"";return e.succeeded>0?{kind:"success",text:`已加入下载队列:${e.succeeded} 首${r}`}:e.failed===0?t>0&&e.skipped===0?{kind:"success",text:`这 ${t} 首都已经下载过了`}:{kind:"success",text:`没有需要下载的${r}`}:{kind:"error",text:`加入下载队列失败${r}`}}function EY({streamId:e,apiBase:t=""}){const[n,r]=p.useState(null);if(p.useEffect(()=>{const o={baseUrl:t};let c=!1;return r(null),be.reconcile.streamAuthority(o,e).then(d=>{c||r(d.stats)}).catch(()=>{}),()=>{c=!0}},[e,t]),!n||n.entries===0)return null;const i=n.needsSupply>0;return l.jsx("div",{"data-testid":"netdisk-advice",className:"mb-3 rounded-lg border border-border/60 bg-muted/40 px-3 py-2 text-sm leading-relaxed",children:i?l.jsxs(l.Fragment,{children:["这条订阅有 ",l.jsx("b",{children:n.needsSupply})," 集源站放不出来(共 ",n.entries," 集)。",l.jsxs("span",{className:"text-muted-foreground",children:[" ","网盘里的文件要配到这些集上 —— 用频道菜单里的",l.jsx("b",{children:"「整理」"}),"。"]})]}):l.jsxs(l.Fragment,{children:["这条订阅 ",l.jsx("b",{children:n.entries})," 集源站都能放,没有要补的。",l.jsxs("span",{className:"text-muted-foreground",children:[" ","网盘目录里的东西是",l.jsx("b",{children:"另一批节目"}),",用",l.jsx("b",{children:"「添加来源」"}),"挑「网盘目录(音频)」把那个目录当成一条来源加进来,别拿去配对。"]})]})})}const _h={R1:"人工订正预置",R2:"时长唯一命中免检",R3:"时长唯一命中 × 名字地板不过",R4:"时长桶零竞争出口",R5:"时长撞车 × 标题消歧",R6:"季集结构键",R7:"期号分段复合键",R8:"集号分桶 × 标题消歧",R9:"标题相似度兜底",R10:"电影唯一视频文件",R11:"横向时长矛盾闸",R12:"同集其余份收尾",R13:"双集冲突",R14:"名字命中 × 时长矛盾"},RY={"duration-contradict":"两边时长差出量级,不是同一段内容","name-floor":"时长撞上了,但名字连地板都不沾——不足以认成这一集","zero-competition-loser":"时长巧合撞进来的别的集文件,不是竞争者","below-threshold":"相似度没到这条规则的门槛","no-margin":"和次佳拉不开差距,谁都不敢认","left-claimed":"该集已被别的文件认领,这条证据没被评估","file-claimed":"这份文件已被别的集认领","quality-dedup":"同集去重时被另一份吸收(清晰度/码率落选)","no-adjudicable-fact":"只有字节孪生这类不可裁决的事实,本就不是候选",unevaluated:"走完全部规则都没人评估它——规则覆盖有漏洞,不是正常终态"};function AY(e){return RY[e]??e}const MY={claimed:"认领(这一集的正主)",copy:"同集其余份",asked:"出卡(要你决定)",residual:"残差(没配上任何一集)"},DY={"season-episode":"季集","episode-part":"期号分段",epnum:"集号"},_Y={sim:"相似度",nameFloor:"名字地板"};function Oy(e){return String(Number(e.toFixed(3)))}function OY(e){return e.slice(e.lastIndexOf("/")+1)}function zY(e,t,n){switch(e.kind){case"duration":{const i=`(差 ${Math.round(Math.abs(e.deltaS))}s,容差 ${e.toleranceS}s)${e.state==="hit"?"✓命中":"✗矛盾"}`;return t!=null&&n!=null?`时长 ${Math.round(t)}s vs ${Math.round(n)}s${i}`:`时长${i}`}case"name":return e.method==="identity-exact"?"名字 清洗后全等(identity-exact)✓命中":`名字 sim ${Oy(e.score)}`;case"struct-key":return`结构键 ${DY[e.key]??e.key}=${e.value}`;case"byte-identity":return`与 ${OY(e.peerPath)} 字节全等`}}const PY={won:"✓ 胜出",vetoed:"✗ 被驳回",informational:"仅供参考"},LY={won:"text-[var(--acr-green)]",vetoed:"text-destructive",informational:"text-muted-foreground"};function zy({title:e,children:t}){return l.jsxs("section",{className:"flex flex-col gap-1",children:[l.jsx("h4",{className:"text-[10px] font-medium text-muted-foreground",children:e}),t]})}function IY({edge:e,fileDurationS:t}){return l.jsxs("div",{className:"flex flex-col gap-0.5","data-testid":"evidence-edge","data-outcome":e.outcome,children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-x-1 gap-y-0.5",children:[l.jsxs("span",{className:"min-w-0 break-words text-[11px] font-medium",children:["↔《",e.episode.title,"》"]}),e.episode.paid!=null&&l.jsx(Bt,{variant:"secondary",size:"sm",className:"shrink-0",children:e.episode.paid?"付费":"免费"}),l.jsx("span",{className:`shrink-0 text-[10px] ${LY[e.outcome]}`,children:PY[e.outcome]})]}),l.jsx("ul",{className:"flex flex-col gap-px pl-3",children:e.facts.map((n,r)=>l.jsx("li",{className:"tabular-nums text-[10px] text-muted-foreground",children:zY(n,t,e.episode.durationS)},r))}),e.vetoReason&&l.jsxs("p",{className:"pl-3 text-[10px] text-muted-foreground",children:["驳回理由:",AY(e.vetoReason),e.rule&&l.jsxs("span",{className:"text-muted-foreground/70",children:["(",e.rule,_h[e.rule]?` ${_h[e.rule]}`:"",")"]})]})]})}function $Y({explain:e}){const{file:t,edges:n,verdict:r,truncatedCount:i}=e,o=[t.durationS!=null?Gr(t.durationS):null,ju(t.sizeBytes),t.kbps!=null?`${t.kbps}kbps`:null].filter(c=>!!c);return l.jsxs("div",{className:"flex flex-col gap-2.5","data-testid":"evidence-card",children:[l.jsxs(zy,{title:"文件事实",children:[l.jsx("p",{className:"break-all font-mono text-[10px] text-muted-foreground",children:t.path}),l.jsx("p",{className:"tabular-nums text-[11px]",children:o.join(" · ")})]}),l.jsxs(zy,{title:"证据清单",children:[n.length===0?l.jsx("p",{className:"text-[10px] text-muted-foreground",children:"一条证据边都没有——节目单里没有任何一集与它沾边。"}):l.jsx("div",{className:"flex flex-col gap-1.5",children:n.map(c=>l.jsx(IY,{edge:c,fileDurationS:t.durationS},c.episode.leftKey))}),i!=null&&i>0&&l.jsxs("p",{className:"text-[10px] text-muted-foreground/70",children:["另有 ",i," 条弱证据边未列(轨迹里有)"]})]}),l.jsxs(zy,{title:"裁决",children:[l.jsxs("p",{className:"text-[11px]",children:[r.rule?l.jsxs("span",{children:[l.jsx("span",{className:"font-medium",children:r.rule}),_h[r.rule]?` ${_h[r.rule]}`:""]}):l.jsx("span",{children:"没有任何规则认领它"})," → ",MY[r.disposition]??r.disposition]}),r.thresholds&&Object.keys(r.thresholds).length>0&&l.jsx("ul",{className:"flex flex-col gap-px",children:Object.entries(r.thresholds).map(([c,{got:d,need:h}])=>l.jsxs("li",{className:"tabular-nums text-[10px] text-muted-foreground",children:[_Y[c]??c," 命中 ",Oy(d)," / 门槛 ",Oy(h)," ",l.jsx("span",{className:d>=h?"text-[var(--acr-green)]":"text-destructive",children:d>=h?"✓":"✗"})]},c))})]})]})}function BY(){const[e,t]=p.useState(!1);return p.useEffect(()=>{var i;const n=window.matchMedia("(hover: hover) and (pointer: fine)");t(n.matches);const r=()=>t(n.matches);return(i=n.addEventListener)==null||i.call(n,"change",r),()=>{var o;return(o=n.removeEventListener)==null?void 0:o.call(n,"change",r)}},[]),e}const qR="scrollbar-mac max-h-[var(--radix-popper-available-height)] w-[22rem] overflow-y-auto bg-[var(--acr-panel-solid)] p-3",KR=12;function UY({explain:e}){const t=BY(),[n,r]=p.useState(!1),[i,o]=p.useState(void 0),c=p.useRef(null),d=x=>{var g;x&&o(((g=c.current)==null?void 0:g.closest('[role="dialog"]'))??void 0),r(x)},h=l.jsx(Ne,{ref:c,icon:!0,size:"medium",variant:"ghost","aria-label":"这条判定的证据",children:l.jsx(Dp,{})}),m=l.jsx("div",{className:"text-foreground",children:l.jsx($Y,{explain:e})});return t?l.jsxs(Px,{open:n,onOpenChange:d,openDelay:120,closeDelay:80,children:[l.jsx(Lx,{asChild:!0,children:h}),l.jsx(Ix,{container:i,align:"end",collisionPadding:KR,className:qR,children:m})]}):l.jsxs(fy,{open:n,onOpenChange:d,children:[l.jsx(hy,{asChild:!0,children:h}),l.jsx(wh,{container:i,align:"end",collisionPadding:KR,className:qR,children:m})]})}function Gr(e){return e?`${Math.floor(e/60)}:${String(Math.round(e%60)).padStart(2,"0")}`:""}function Py(e,t=!1){const n=Math.round(Math.abs(e));if(!t&&n>=600)return`${Math.floor(n/60)} 分钟`;const r=Math.floor(n/60),i=n%60;return r?i?`${r} 分 ${i} 秒`:`${r} 分`:`${i} 秒`}const Cl=(e,t)=>e.facts.filter(n=>n.kind===t),pa=(e,t)=>Cl(e,"duration").find(n=>n.state===t),VY=e=>Cl(e,"name").find(t=>t.method==="identity-exact"),FY=8;function HY(e){const t=e.filter(n=>typeof n=="number"&&n>0).sort((n,r)=>n-r);if(!(t.length<FY))return t[Math.floor(t.length/2)]}const qY=.4;function GR(e,t){const n=e.file.kbps;return!t||!n||n>=t*qY?null:{tone:"warn",label:"码率",value:`${n}k,同批别的文件是 ${t}k`}}function KY(e,t,n){var m;const r=t.edges.find(x=>x.episode.leftKey===e.collidesWith);if(!r)return null;const i=[];for(const x of Cl(r,"struct-key"))i.push({tone:"ok",label:YR[x.key],value:x.value});const o=Cl(r,"name").sort((x,g)=>g.score-x.score)[0];o&&i.push(o.method==="identity-exact"?{tone:"ok",label:"名字",value:`${o.cleanedLeft} · 完全一致`}:{tone:o.score>=.6?"ok":"no",label:"名字",value:`${o.cleanedRight} ↔ ${o.cleanedLeft} · 相似度 ${o.score.toFixed(2)}`});const c=pa(r,"contradict"),d=r.episode.durationS??((m=e.compare)==null?void 0:m.authorityDurationS);if(c&&e.src.durationS!=null&&d!=null){const x=e.src.durationS<d?"短":"长";i.push({tone:"no",label:"时长",value:`${Gr(e.src.durationS)},比节目单 ${Gr(d)} ${x} ${Py(c.deltaS,!0)}`})}else pa(r,"hit")&&e.src.durationS!=null&&i.push({tone:"ok",label:"时长",value:`${Gr(e.src.durationS)},与节目单一致`});const h=GR(t,n);return h&&i.push(h),i.length?{signals:i,hint:GY(e.basis)}:null}const YR={epnum:"集号","season-episode":"季集号","episode-part":"分段号"};function GY(e){var n;const t=(n=/^ambiguous:([a-z-]+):/.exec(e??""))==null?void 0:n[1];if(t==="duration-contradiction")return"可能是分享者贴错了名字,也可能是节目单时长不准或这份被截断了。";if(t==="name-floor")return"长音频撞时长很常见,光凭这一条不足以判定是同一集。";if(t==="low-confidence")return'名字像,但够不着"直接认下来"那条线。';if(t==="no-margin")return"几个候选拉不开差距,机器挑不出哪个更像。";if(t)return"名字的相似度没到门槛。"}function YY(e,t,n){const r=WY(e.basis),i=e.candidateEpisodes??(e.episode?[e.episode]:[]);if(!i.length)return null;const o=[],c=r.length?r.map(x=>t.edges.find(g=>g.episode.leftKey===x)).filter(x=>!!x&&!!pa(x,"hit")):t.edges.filter(x=>pa(x,"hit")&&i.includes(x.episode.title));if(c.length&&e.src.durationS!=null){const x=Math.max(...c.map(v=>Math.abs(pa(v,"hit").deltaS))),g=WR(i);o.push({tone:"ok",label:"时长",value:`${Gr(e.src.durationS)},与${g}${c.length>1?"都":""}${x===0?"一秒不差":`只差 ${x} 秒`}`})}const d=t.edges.find(x=>VY(x)&&pa(x,"contradict")),h=d==null?void 0:d.episode.durationS;if(d&&h!=null&&e.src.durationS!=null){const x=h<e.src.durationS;o.push({tone:"no",label:"同名集",value:`《${d.episode.title}》${x?"只有":"有"} ${Gr(h)},差了 ${Py(pa(d,"contradict").deltaS)}——不可能是它`})}const m=GR(t,n);return m&&o.push(m),o.length?{signals:o,conclusion:QY(i)}:null}function WY(e){const t=/^redundant-free(?:-candidates)?:(.+)$/.exec(e??"");return t?t[1].split(",").filter(Boolean):[]}const XY=3;function WR(e){const t=e.slice(0,XY),n=e.length>t.length?`等 ${e.length} 个集`:"";return t.map(r=>`《${r}》`).join("")+n}function QY(e){const t="删掉(夸克回收站里还能捞回来)";return e.length===1?`所以这份装的是《${e[0]}》,那一集源站自己放得出 —— 是冗余,${t}`:`所以这份是${WR(e)}之一——机器分不出是哪一集,但这几集源站都放得出,不论哪一集都是冗余,${t}`}function ZY(e,t){return t?e.map(n=>{const r=t==null?void 0:t.edges.find(i=>i.episode.leftKey===n);return r?{leftKey:n,title:r.episode.title,evidence:JY(r)}:{leftKey:n,title:"",evidence:"判决书里没有这条边(本轮证据被截断)"}}):[]}function JY(e){const t=[],n=pa(e,"hit");n&&t.push(Math.abs(n.deltaS)===0?"时长一秒不差":`时长只差 ${Math.round(Math.abs(n.deltaS))} 秒`);for(const o of Cl(e,"struct-key"))t.push(`${YR[o.key]} ${o.value}`);const r=Cl(e,"name").sort((o,c)=>c.score-o.score)[0];r&&t.push(r.method==="identity-exact"?"名字全等":`名字 sim ${r.score.toFixed(2)}`);const i=pa(e,"contradict");return i&&t.push(`时长差 ${Py(i.deltaS)}`),t.join(" · ")||"无可裁决证据"}function eW(e,t,n){return t?e.kind==="pending"&&e.pendingKind==="duration-collision"?KY(e,t,n==null?void 0:n.kbpsBaseline):e.kind==="delete-redundant"?YY(e,t,n==null?void 0:n.kbpsBaseline):null:null}const tW=3;function XR(e){var r,i,o;const t=[...((r=e==null?void 0:e.ledger)==null?void 0:r.rows)??[],...((o=(i=e==null?void 0:e.ledger)==null?void 0:i.secondaryReview)==null?void 0:o.rows)??[]],n=new Map(t.flatMap(c=>c.explain?[[c.path,c.explain]]:[]));return c=>n.get(c)}function Ly(e){return e.kind==="replace"?e.oldPath??null:e.kind==="move"||e.kind==="delete-dup"||e.kind==="delete-loser"||e.kind==="delete-redundant"?e.src.path:null}function nW(e,t){const n=new Map;for(const i of t){if(!i.blockedBy)continue;const o=n.get(i.blockedBy)??[];o.push(i),n.set(i.blockedBy,o)}const r=new Set;for(const i of e){const o=Ly(i);if(o)for(const c of n.get(o)??[])r.add(c)}return{unblocks:i=>{const o=Ly(i);return o?n.get(o)??[]:[]},stranded:t.filter(i=>!r.has(i))}}function QR(e,t){if(!e)return()=>null;const n=[e.claimed,...e.secondary?[e.secondary]:[]],r=t??[],i=(o,c)=>o===c||o.startsWith(`${c}/`);return o=>n.some(c=>i(o,c))?"lib":r.some(c=>i(o,c))?"source":null}function Iy(e,t){return e.flatMap(n=>{var v,S,b,j;const r=(C,k)=>{var E;const N=(E=n.compare)==null?void 0:E.candidates.find(R=>R.path===C);return{path:C,size:(N==null?void 0:N.size)??(k==null?void 0:k.size),durationS:(N==null?void 0:N.durationS)??(k==null?void 0:k.durationS),where:t.where(C)}},i=r(n.src.path,n.src),o=n.origin==="file"?Vy(n.src.path):void 0,c={groupLabel:t.showGroupLabel||!(n.episode||o)?t.groupLabel:void 0,episode:n.episode,fileName:o,origin:n.origin,authorityDurationS:(v=n.compare)==null?void 0:v.authorityDurationS,basis:n.basis,explain:(S=t.explainOf)==null?void 0:S.call(t,n.src.path),chain:eW(n,(b=t.explainOf)==null?void 0:b.call(t,n.src.path),{kbpsBaseline:t.kbpsBaseline})??void 0},d=(((j=t.unblocks)==null?void 0:j.call(t,n))??[]).map(C=>({kind:"file",mark:"下轮搬入",tone:"incoming",swap:"in",facts:{path:C.src.path,size:C.src.size,durationS:C.src.durationS,where:t.where(C.src.path)}})),h=d.length>0?Ly(n):null,m=C=>C.path===h?{swap:"out"}:{},x=C=>[t.keyPrefix,n.kind,C,n.src.path].filter(Boolean).join("|");if(n.kind==="move"&&n.dstDir)return[{key:x(n.dstDir),label:`移入${rA(n.dstDir)}`,labelTone:"move",...c,slots:[{kind:"file",mark:"搬入",tone:"kept",facts:i,...m(i)},{kind:"dest",slot:"去向",dir:n.dstDir},...d],reason:wW(n)}];if(n.kind==="pending")return aW(n,t,c,x);if(n.kind==="delete-redundant")return[{key:x("origin"),label:"删除免费集副本",labelTone:"delete",...c,slots:[{kind:"file",mark:"删除",tone:"gone",facts:i,...m(i)},...d],goneSize:i.size,reason:rW(n.candidateEpisodes)}];const g=(C,k)=>({key:x(C.path),label:bW(n),labelTone:k?"swap":"delete",...c,slots:[{kind:"file",mark:k?"移出":"保留",tone:k?"gone":"kept",facts:C,...m(C)},{kind:"file",mark:k?"上位":"删除",tone:k?"kept":"gone",facts:i,...m(i)},...d],goneSize:k?C.size:i.size,reason:jW(n,C,i,k)});return n.kind==="delete-dup"||n.kind==="delete-loser"?[g(r(CW(n)),!1)]:n.kind==="replace"&&n.oldPath?[g(r(n.oldPath),!0)]:[]})}function rW(e){const t="删除,夸克回收站里还能捞回来";if(!e||e.length===0)return`这一集源站自己能播,网盘这份是冗余——${t}`;if(e.length===1)return`实际对应「${e[0]}」,这一集源站自己能播,网盘这份是冗余——${t}`;const n=e.slice(0,tW),r=n.map(o=>`「${o}」`).join(""),i=e.length>n.length?`等 ${e.length} 个集`:"";return`证据指向这几集之一:${r}${i}。它们源站都自己能播,所以不论是哪一集,网盘这份都是冗余——${t}`}const sW={"duration-collision":"是不是这一集","evidence-conflict":"到底是哪一集",replace:"留哪一份"};function aW(e,t,n,r){var c,d;if(e.pendingKind==="swap-hold")return[{key:r("swap-hold"),label:"位置被占着",labelTone:"decide",...n,fileName:Vy(e.src.path),groupLabel:t.showGroupLabel?t.groupLabel:void 0,slots:[{kind:"file",mark:"待定",tone:"undecided",facts:{path:e.src.path,size:e.src.size,durationS:e.src.durationS,where:t.where(e.src.path)}},...e.blockedBy?[{kind:"dest",slot:"占位",dir:e.blockedBy}]:[]],reason:e.blockedBy?"这个位置被上面那份占着,而本轮计划里没有任何一条动作会挪走它——它不会自己腾空,这一份也就搬不进去。先处置占位的那份,或者「不再提醒」。":"位置被货架上另一份占着,本轮搬不进去(后端没说是哪一份)。"}];const i=e.pendingKind?sW[e.pendingKind]:void 0;if(!i)return[];const o=((c=e.compare)==null?void 0:c.candidates)??[{path:e.src.path,size:e.src.size,durationS:e.src.durationS}];return[{key:r(e.pendingKind),label:i,labelTone:"decide",...n,slots:[...o.map(h=>({kind:"file",mark:"待定",tone:"undecided",facts:{path:h.path,size:h.size,durationS:h.durationS,where:t.where(h.path)}})),...e.pendingKind==="evidence-conflict"?ZY(e.conflictsWith??[],(d=t.explainOf)==null?void 0:d.call(t,e.src.path)).map(h=>({kind:"episode",...h})):[]],reason:e.reason??""}]}const ZR=" ".repeat(7);function iW(e){const t=[],n=[e.origin&&JR[e.origin],e.label,e.groupLabel,e.episode,e.fileName].filter(Boolean).join(" · "),r=e.authorityDurationS!=null?`(节目单 ${Gr(e.authorityDurationS)})`:"";t.push(`${n}${r}`);for(const i of e.slots){if(i.kind==="episode"){t.push(`? ${i.title||i.leftKey}`),t.push(`${ZR}${i.evidence}`);continue}if(i.kind==="dest"){t.push(`→ ${i.slot} ${i.dir}`);continue}t.push(`${uW[i.tone]} ${i.mark} ${i.facts.path}`);const o=nA(i.facts);o.length>0&&t.push(`${ZR}${o.join(" · ")}`)}if(e.chain){for(const i of e.chain.signals)t.push(`${eA[i.tone].glyph} ${i.label} ${i.value}`);e.chain.conclusion&&t.push(`⇒ ${e.chain.conclusion}`),e.chain.hint&&t.push(`· ${e.chain.hint}`)}else t.push(`原因:${e.reason}`);return e.basis&&t.push(`判据:${e.basis}`),t.join(`
|
|
412
|
+
`)}function oW(e){var r;const t=i=>Ge.error("复制失败",{description:i}),n=(r=navigator.clipboard)==null?void 0:r.writeText(iW(e));if(!n){t("浏览器不允许在当前上下文写剪贴板(需要 https 或 localhost)");return}n.then(()=>Ge.success("已复制这条决策"),i=>t(i instanceof Error?i.message:String(i)))}const JR={authority:"从清单出发",file:"从网盘文件出发"},lW={authority:"bg-teal-500/15 text-teal-400",file:"bg-zinc-500/20 text-zinc-300"},cW={delete:"bg-red-500/15 text-red-400",swap:"bg-amber-500/15 text-amber-400",move:"bg-sky-500/15 text-sky-500",decide:"bg-violet-500/15 text-violet-400"},uW={gone:"✗",kept:"✓",undecided:"○",incoming:"✓"};function $y({row:e,actions:t,onPickEpisode:n,busy:r}){return l.jsxs(fo,{className:"flex flex-col gap-1.5 p-2",children:[l.jsxs("div",{className:"flex items-start justify-between gap-2",children:[l.jsxs(Eh,{className:"flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-0.5 self-start text-[13px] leading-snug",children:[e.groupLabel&&l.jsx("span",{className:`min-w-0 break-words ${e.episode||e.fileName?"font-normal text-muted-foreground":""}`,children:e.groupLabel}),e.episode&&l.jsx("span",{...e.fileName?{}:{"data-testid":"action-subject"},className:`min-w-0 break-words ${e.fileName?"font-normal text-muted-foreground":""}`,children:e.episode}),e.fileName&&l.jsx("span",{"data-testid":"action-subject",className:"min-w-0 break-all font-mono text-[12px]",children:e.fileName}),e.origin&&l.jsx("span",{"data-testid":"action-origin","data-origin":e.origin,className:`shrink-0 rounded px-1 py-px text-[9px] font-medium ${lW[e.origin]}`,children:JR[e.origin]}),l.jsx("span",{className:`shrink-0 rounded px-1 py-px text-[9px] font-medium ${cW[e.labelTone]}`,children:e.label}),e.authorityDurationS!=null&&l.jsxs(Bt,{variant:"secondary",size:"sm",className:"shrink-0 tabular-nums",children:["节目单 ",Gr(e.authorityDurationS)]})]}),l.jsxs("span",{className:"flex shrink-0 items-center",children:[e.explain&&l.jsx(UY,{explain:e.explain}),l.jsx(Ne,{icon:!0,size:"medium",variant:"ghost","aria-label":"复制这条决策",onClick:()=>oW(e),children:l.jsx(j1,{})})]})]}),l.jsx(eu,{className:"gap-0.5",children:e.slots.map((i,o)=>l.jsx(hW,{slot:i,onPickEpisode:n,busy:r},kW(i,o)))}),e.chain?l.jsx(dW,{chain:e.chain,actions:t}):l.jsxs(kG,{className:"flex items-end justify-between gap-2 px-0 text-[10px] leading-snug text-muted-foreground",children:[l.jsxs("span",{className:"min-w-0",children:["原因:",e.reason]}),t&&l.jsx("span",{className:"flex shrink-0 items-center gap-1",children:t})]})]})}function dW({chain:e,actions:t}){return l.jsxs("div",{"data-testid":"action-chain",className:"flex flex-col gap-1",children:[l.jsx("div",{className:"flex flex-col gap-px",children:e.signals.map(n=>l.jsx(fW,{signal:n},`${n.label}:${n.value}`))}),e.conclusion&&l.jsx("p",{"data-testid":"chain-conclusion",className:"rounded bg-muted/50 px-1.5 py-1 text-[10px] leading-snug text-foreground",children:e.conclusion}),l.jsxs("div",{className:"flex items-end justify-between gap-2",children:[e.hint?l.jsx("span",{"data-testid":"chain-hint",className:"min-w-0 text-[9.5px] leading-snug text-muted-foreground",children:e.hint}):l.jsx("span",{}),t&&l.jsx("span",{className:"flex shrink-0 items-center gap-1",children:t})]})]})}const eA={ok:{glyph:"✓",cls:"text-[var(--acr-green)]"},no:{glyph:"✗",cls:"text-destructive"},warn:{glyph:"!",cls:"text-amber-500"}};function fW({signal:e}){const t=eA[e.tone];return l.jsxs("span",{"data-testid":"chain-signal","data-tone":e.tone,className:"flex items-baseline gap-1.5 text-[10px] leading-snug",children:[l.jsx("span",{className:`w-2.5 shrink-0 text-center font-bold ${t.cls}`,children:t.glyph}),l.jsx("span",{className:"w-11 shrink-0 whitespace-nowrap text-[9.5px] text-muted-foreground",children:e.label}),l.jsx("span",{className:"min-w-0 tabular-nums text-muted-foreground",children:e.value})]})}function tA({path:e}){const t=e||"(未知)",n=t.lastIndexOf("/")+1;return l.jsxs("span",{className:"min-w-0 break-all font-mono text-[10px] text-muted-foreground",children:[t.slice(0,n),l.jsx("span",{className:"font-medium text-foreground",children:t.slice(n)})]})}function By({children:e}){return l.jsx(zs,{className:"flex flex-col gap-y-0.5",children:e})}function hW({slot:e,onPickEpisode:t,busy:n}){return e.kind==="episode"?l.jsxs(Tr,{variant:"muted",size:"xs",className:"items-start","data-testid":"episode-slot","data-left-key":e.leftKey,children:[l.jsxs(By,{children:[l.jsx("span",{className:"min-w-0 break-words text-[11px] font-medium",children:e.title||l.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:e.leftKey})}),l.jsx("span",{className:"text-[10px] leading-snug text-muted-foreground",children:e.evidence})]}),t&&l.jsx(Ne,{size:"mini",variant:"ghost",disabled:n,onClick:()=>t(e.leftKey),children:"就是它"})]}):e.kind==="dest"?l.jsx(Tr,{variant:"muted",size:"xs",className:"items-start",children:l.jsx(By,{children:l.jsxs("span",{className:"flex min-w-0 flex-wrap items-baseline gap-x-1.5 gap-y-0.5",children:[l.jsx("span",{className:"shrink-0 rounded bg-muted px-1 py-px text-[9px] font-medium text-muted-foreground",children:e.slot}),l.jsx(tA,{path:e.dir})]})})}):l.jsx(yW,{...e})}function nA(e){const t=Uy(e);return[e.where?e.where==="lib"?"库内":"来源":null,e.durationS!=null?Gr(e.durationS):null,e.size!=null?ju(e.size):null,t!=null?`${t}k`:null].filter(n=>!!n)}const mW={out:"border-l-2 border-l-destructive/45",in:"border-l-2 border-l-sky-500/50"},pW={gone:Ui,kept:Ns,undecided:$d,incoming:Ns},gW={gone:"text-destructive",kept:"text-[var(--acr-green)]",undecided:"text-muted-foreground",incoming:"text-sky-500"},xW=/\.(mp3|m4a|m4b|aac|flac|wav|ogg|opus|weba)$/i;let ai=null;function vW({path:e}){const t=p.useRef(null),[n,r]=p.useState(!1),i=p.useRef({stop:()=>{}});i.current.stop=()=>{var c;(c=t.current)==null||c.pause(),r(!1)},p.useEffect(()=>{const c=i.current;return()=>{c.stop(),ai===c&&(ai=null)}},[]);const o=()=>{var c,d;if(n){i.current.stop(),ai===i.current&&(ai=null);return}ai&&ai!==i.current&&ai.stop(),ai=i.current,r(!0),(d=(c=t.current)==null?void 0:c.play())==null||d.catch(h=>{r(!1),Ge.error("放不出来",{description:h instanceof Error?h.message:String(h)})})};return l.jsxs(l.Fragment,{children:[l.jsx(Ne,{icon:!0,size:"medium",variant:"ghost","data-testid":"action-play","data-playing":n,"aria-label":n?"暂停":"试听这份文件",onClick:o,children:n?l.jsx(Bi,{}):l.jsx(qn,{})}),l.jsx("audio",{ref:t,preload:"none",src:`/api/netdisk/raw?path=${encodeURIComponent(e)}`,onEnded:()=>r(!1),onError:()=>{n&&(r(!1),Ge.error("放不出来",{description:"取不到这份文件的直链(文件已删,或网盘登录态过期)"}))}})]})}function yW({mark:e,tone:t,facts:n,swap:r}){const i=nA(n),o=pW[t];return l.jsxs(Tr,{variant:"muted",size:"xs",className:`items-start ${r?mW[r]:""}`,...r?{"data-swap":r}:{},children:[l.jsxs(Jc,{"data-tone":t,className:`self-start group-data-[size=xs]/item:size-4 ${gW[t]}`,children:[l.jsx(o,{strokeWidth:2.5}),l.jsx("span",{className:"sr-only",children:e})]}),l.jsxs(By,{children:[l.jsx(tA,{path:n.path}),i.length>0&&l.jsx("span",{className:"tabular-nums text-[10px] text-muted-foreground",children:i.join(" · ")})]}),r==="in"&&l.jsx("span",{"data-testid":"slot-phase",title:"删掉上面那份、位置腾空后,下一次整理时自动搬进来——再预览一次即可,定时轮也会跑到",className:"shrink-0 self-start rounded bg-sky-500/15 px-1 py-px text-[9px] font-medium leading-relaxed text-sky-500",children:"下轮落位"}),xW.test(n.path)&&l.jsx(vW,{path:n.path})]})}function bW(e){return e.kind==="replace"?"换正主":e.kind==="delete-loser"?"删除同集副本":"删除重复"}function rA(e){if(!e)return"";const t=e.split("/"),n=t.pop()??"",r=t.pop()??"";return r==="付费"?`${r}/${n}`:n}function wW(e){const t=e.basis??"";return t.startsWith("authority:")?"匹配器把它认成节目单里的这一集":t.startsWith("sole-candidate:")?"这一集还空着,它是唯一候选(时长或名字对得上)——直接认领搬入":t.startsWith("no-duration-hit:")?"时长和名字都对不上节目单任何一集 → 进下架货架(那儿本身是一条可播的来源,不是消失)":t.startsWith("relisted:")?"源站重新上架了这一集,而下架货架那份是唯一副本——接回付费货架":`搬进${rA(e.dstDir)}`}const SW=/(2160p|1080p|720p|540p|480p|4k)/i;function sA(e){const t=SW.exec(Vy(e));if(!t)return null;const n=t[1].toLowerCase();return n==="4k"?"2160p":n}function Uy(e){return e.size&&e.durationS?Math.round(e.size*8/e.durationS/1e3):null}function aA(e,t,n){const[r,i]=[sA(e.path),sA(t.path)];if(r&&i&&r!==i)return`清晰度 ${r} ${n} ${i}`;const[o,c]=[Uy(e),Uy(t)];return o!=null&&c!=null?`码率 ${o}k ${n} ${c}k`:null}function jW(e,t,n,r){var c;const i=e.basis??"",o=(d,h,m="")=>`${d}${h?`(${h})`:""}${m}`;if(i.startsWith("size-dup-of:")||!e.basis&&e.kind==="delete-dup"){const d=n.size??t.size;return o("两份字节数完全相同 = 同一份文件",d!=null?ju(d):null)}if(i.startsWith("quality-upgrade:"))return o("这份质量更高",aA(n,t,">"),",换上去");if(i.startsWith("authority-duration:")){const[d,h]=r?[n,t]:[t,n],[m,x]=r?["这份","现任"]:["现任","这份"],g=(c=e.compare)==null?void 0:c.authorityDurationS;if(g!=null&&d.durationS!=null&&h.durationS!=null){const v=Math.round(Math.abs(h.durationS-g));return`${m}时长 ${Gr(d.durationS)} 更贴近节目单 ${Gr(g)}(${x} ${Gr(h.durationS)},差 ${v} 秒)`}return`${m}的时长更贴近节目单,留它`}if(i.startsWith("name-authority:")){const[d,h]=r?["这份","现任"]:["现任","这份"];return`${d}文件名和节目单这一集对得上,${h}对不上`}if(i.startsWith("quality-unknown:")){const d=t.durationS!=null&&n.durationS!=null?Math.round(Math.abs(t.durationS-n.durationS)):null;return`两份比不出高下(${d?`时长差 ${d} 秒,不是同一份内容`:"清晰度与码率都比不出来"}),保留新来的这份`}return i.startsWith("shelf-copy-of:")?"下架货架上这份是同一集的另一份,正主已经在付费货架上——留正主,删这份":e.kind==="replace"?"换上这份、移出现任":o("现任质量不低于这份",aA(t,n,"≥"))}function CW(e){return e.keptPath??e.dupOf??""}function Vy(e){return e?e.slice(e.lastIndexOf("/")+1):""}function kW(e,t){return e.kind==="dest"?`dest:${e.dir}`:e.kind==="episode"?`ep:${e.leftKey}`:e.facts.path||String(t)}function ju(e){return e>=1073741824?`${(e/1073741824).toFixed(2)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${Math.round(e/1024)} KiB`:`${e} B`}const NW={replace:"下架货架上已有同一集,比不出高下","no-duration":"时长还没探到,下一轮续探","swap-hold":"位置被货架上同集/同名的旧份占着,本轮搬不进去","suspect-dir":"目录疑似认领错误","duration-collision":"时长撞上某一集,但名字完全不沾——是不是同一集要你定"};function TW({groups:e,loading:t,executing:n,executed:r,onConfirm:i}){const o=p.useMemo(()=>e.flatMap(m=>{var x,g,v;return Iy((((x=m.preview)==null?void 0:x.plan)??[]).filter(S=>S.kind==="delete-dup"||S.kind==="delete-loser"||S.kind==="delete-redundant"||S.kind==="replace"),{where:QR((g=m.preview)==null?void 0:g.shelves,(v=m.preview)==null?void 0:v.sourceDirs),groupLabel:m.label,showGroupLabel:e.length>1,keyPrefix:m.bindingId,explainOf:XR(m.preview)})}),[e]),c=o.reduce((m,x)=>m+(x.goneSize??0),0),d=e.reduce((m,x)=>{var g;return m+(((g=x.preview)==null?void 0:g.counts.pending)??0)},0),h=e.flatMap(m=>{var x,g;return(((g=(x=m.preview)==null?void 0:x.ledger)==null?void 0:g.errors)??[]).map(v=>({label:m.label,...v}))});return l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsxs("p",{className:"text-[12px] text-muted-foreground","data-testid":"dedupe-summary",children:["将删 ",l.jsx("span",{className:"font-medium text-foreground",children:o.length})," 份,共省"," ",l.jsx("span",{className:"font-medium text-foreground",children:ju(c)}),d>0&&l.jsxs(l.Fragment,{children:[",另有 ",d," 条待定(机器不替你裁,这次不动)"]})]}),t&&l.jsxs("div",{className:"flex items-center gap-2 text-[12px] text-muted-foreground",children:[l.jsx(Sr,{className:"size-4 animate-spin"})," 正在核对网盘…"]}),e.filter(m=>m.error).length>0&&l.jsxs("section",{className:"flex flex-col gap-1",children:[l.jsxs("h3",{className:"px-1 text-[12px] font-medium text-destructive",children:["算不出清单 ",l.jsx(Bt,{variant:"secondary",size:"sm",children:e.filter(m=>m.error).length})]}),e.filter(m=>m.error).map(m=>l.jsxs("p",{className:"px-1 text-[11px] text-muted-foreground",children:[l.jsx("span",{className:"text-foreground",children:m.label}),":",m.error]},m.bindingId))]}),o.length===0&&!t?l.jsx("p",{className:"px-1 py-6 text-center text-[12px] text-muted-foreground",children:"没有要删的——每一集都只有一份。"}):l.jsx("div",{className:"scrollbar-mac flex max-h-[40vh] flex-col gap-1.5 overflow-y-auto",children:o.map(m=>l.jsx($y,{row:m},m.key))}),l.jsx(EW,{groups:e}),h.length>0&&l.jsxs("section",{className:"flex flex-col gap-1",children:[l.jsxs("h3",{className:"px-1 text-[12px] font-medium text-muted-foreground",children:["核对时出的错 ",l.jsx(Bt,{variant:"secondary",size:"sm",children:h.length})]}),h.map((m,x)=>l.jsxs("p",{className:"px-1 font-mono text-[10px] text-muted-foreground",children:["[",m.stage,"] ",m.path?`${AW(m.path)}:`:"",m.detail]},x))]}),!r&&l.jsx(Ne,{variant:"neutral",size:"small",className:"self-start",disabled:n||t||o.length===0,onClick:i,children:n?l.jsxs(l.Fragment,{children:[l.jsx(Sr,{className:"size-3.5 animate-spin"})," 执行中…"]}):l.jsxs(l.Fragment,{children:[l.jsx(Po,{className:"size-3.5"})," 确认执行(删 ",o.length," 份)"]})}),l.jsx(RW,{groups:e})]})}function EW({groups:e}){var n;const t=new Map;for(const r of e)for(const i of((n=r.preview)==null?void 0:n.plan)??[]){if(i.kind!=="pending")continue;const o=i.pendingKind??"no-duration";t.set(o,(t.get(o)??0)+1)}return t.size===0?null:l.jsxs("section",{className:"flex flex-col gap-1",children:[l.jsxs("h3",{className:"px-1 text-[12px] font-medium text-muted-foreground",children:["这次不动的 ",l.jsx(Bt,{variant:"secondary",size:"sm",children:[...t.values()].reduce((r,i)=>r+i,0)})]}),[...t.entries()].map(([r,i])=>l.jsxs("p",{className:"px-1 text-[11px] text-muted-foreground","data-testid":`pending-${r}`,children:[NW[r]??r," ",l.jsxs("span",{className:"tabular-nums",children:["× ",i]})]},r))]})}function RW({groups:e}){const t=e.filter(n=>n.result||n.resultError);return t.length===0?null:l.jsxs("section",{className:"flex flex-col gap-1",children:[l.jsx("h3",{className:"px-1 text-[12px] font-medium text-muted-foreground",children:"执行结果"}),t.map(n=>{var r;return l.jsxs("div",{className:"flex flex-col gap-0.5 px-1",children:[l.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[l.jsx("span",{className:"text-foreground",children:n.label}),":",n.resultError?n.resultError:`删除 ${n.result.deleted},移动 ${n.result.moved}${n.result.errors.length?`,${n.result.errors.length} 条出错`:""}`]}),(((r=n.result)==null?void 0:r.errors)??[]).map((i,o)=>l.jsx("p",{className:"font-mono text-[10px] text-destructive",children:i},o))]},n.bindingId)})]})}function AW(e){return e?e.slice(e.lastIndexOf("/")+1):""}const MW={move:{verb:"移动",noun:"",frees:()=>{}},"delete-dup":{verb:"删除",noun:"字节全等的重复",frees:e=>e.src.size},"delete-loser":{verb:"删除",noun:"同集落选副本",frees:e=>e.src.size},"delete-redundant":{verb:"删除",noun:"免费集副本(源站自己放得出)",frees:e=>e.src.size},replace:{verb:"换掉",noun:"库里的旧版本(删旧的、新的上位)",frees:e=>{var t,n;return e.oldPath?(n=(t=e.compare)==null?void 0:t.candidates.find(r=>r.path===e.oldPath))==null?void 0:n.size:void 0}}};function DW(e){var r;let t=0,n=!1;for(const i of e){const o=(r=MW[i.kind])==null?void 0:r.frees(i);typeof o=="number"&&Number.isFinite(o)&&(t+=o,n=!0)}return n&&t>0?t:null}function _W({summary:e}){const t=e==null?void 0:e.byKind["is-episode"],n=((t==null?void 0:t.agreed)??0)+((t==null?void 0:t.disagreed)??0);return!t||n===0?null:l.jsxs("div",{"data-testid":"ai-track-record",className:"px-1 text-[11px] text-muted-foreground",children:["它建议「就是这一集」的 ",n," 次里,你认同 ",t.agreed," 次、改判 ",t.disagreed," 次",t.open>0&&`(另有 ${t.open} 条还没答)`]})}function iA(e,t,n){const r=new Set(t.filter(i=>i.left.streamId===n).map(i=>i.id));return e.filter(i=>r.has(i.bindingId))}function OW({apiBase:e="",open:t,onOpenChange:n,streamId:r,streamTitle:i,bindingId:o}){const c={baseUrl:e},d=!!o,[h,m]=p.useState(null),[x,g]=p.useState(null),[v,S]=p.useState(null),[b,j]=p.useState(null),[C,k]=p.useState(!1),[N,E]=p.useState(null),[R,A]=p.useState(null),[_,z]=p.useState(null),[D,V]=p.useState(null),[I,Q]=p.useState(0),B=p.useRef(0),H=p.useCallback(()=>{const we=++B.current;return g(null),m(null),be.reconcile.config(c).then(Oe=>(B.current===we&&m(Oe.shows),Oe.shows)).catch(Oe=>{throw B.current===we&&g(Oe instanceof sr&&Oe.status===503?"归档服务未接线":"加载归档配置失败"),Oe})},[e]);p.useEffect(()=>{if(!t||d)return;let we=!0;return H().catch(()=>{}),r&&(V(null),z(null),be.netdisk.list(c).then(Oe=>{we&&z(Oe)}).catch(Oe=>{we&&(console.error("加载网盘绑定失败",Oe),V(Oe instanceof sr?"加载网盘绑定失败":"加载网盘绑定失败:网络异常"))})),()=>{we=!1}},[t,e,r,d,H,I]);const ee=p.useMemo(()=>r?h?iA(h,_??[],r):null:h,[h,r,_]),W=!!r&&_!=null&&ee!=null&&ee.length===0;p.useEffect(()=>{ee&&ee.length>0&&(!v||!ee.some(we=>we.id===v))&&S(ee[0].id)},[ee,v]);const M=p.useCallback((we,Oe)=>{Oe!=null&&Oe.silent||k(!0),E(null),(d?be.reconcile.previewBinding(c,we):be.reconcile.preview(c,we)).then(lt=>j(lt)).catch(lt=>{Oe!=null&&Oe.silent||(j(null),E(lt instanceof sr?lt.message:"预览失败"))}).finally(()=>{Oe!=null&&Oe.silent||k(!1)})},[e,d]),U=o??v;p.useEffect(()=>{t&&U&&M(U)},[t,U,M]);const K=(b==null?void 0:b.plan.filter(we=>we.kind!=="pending"))??[],ne=(b==null?void 0:b.plan.filter(we=>we.kind==="pending"))??[],q=p.useMemo(()=>{const we=new Map;for(const Oe of ne)if(!(Oe.pendingKind!=="replace"&&Oe.pendingKind!=="duration-collision"&&Oe.pendingKind!=="evidence-conflict")){if(Oe.pendingKind==="evidence-conflict"){we.set(`${Oe.key}|${Oe.src.path}`,Oe);continue}we.has(Oe.key)||we.set(Oe.key,Oe)}return[...we.values()]},[ne]),P=ne.filter(we=>we.pendingKind==="suspect-dir"),L=ne.filter(we=>we.pendingKind==="swap-hold"),{unblocks:G,stranded:J}=p.useMemo(()=>nW(K,L),[b]),$=ne.filter(we=>we.pendingKind!=="suspect-dir"&&we.pendingKind!=="replace"&&we.pendingKind!=="swap-hold"&&we.pendingKind!=="duration-collision"&&we.pendingKind!=="evidence-conflict"),se=p.useMemo(()=>[...q,...J],[q,J]),[oe,ie]=p.useState(!1),[Z,ve]=p.useState(!1),[Ee,Te]=p.useState(!1),Ie=p.useMemo(()=>DW(K),[K]),Fe=p.useMemo(()=>new Set(P.map(we=>zW(we.src.path))).size,[P]),fe=p.useMemo(()=>{const we=[];return Ie!=null&&we.push(l.jsxs("span",{className:"font-medium text-foreground",children:["可省 ",ju(Ie)]},"reclaim")),K.length>0&&we.push(l.jsxs("span",{children:[K.length," 项可自动完成"]},"auto")),se.length>0&&we.push(l.jsxs("span",{children:[se.length," 项要你定"]},"decide")),Fe>0&&we.push(l.jsxs("span",{className:"text-destructive",children:[Fe," 个目录要你确认"]},"suspect")),we},[Ie,K.length,se.length,Fe]),Se=()=>be.reconcile.suggestions(c,{limit:1}).then(we=>A(we.summary)).catch(()=>{});p.useEffect(()=>{t&&Se()},[t,e]);const ye=p.useMemo(()=>(ee??[]).find(we=>we.id===v)??null,[ee,v]),Qe=p.useMemo(()=>{var we,Oe,lt;return HY([...((we=b==null?void 0:b.ledger)==null?void 0:we.rows)??[],...((lt=(Oe=b==null?void 0:b.ledger)==null?void 0:Oe.secondaryReview)==null?void 0:lt.rows)??[]].map(an=>{var en;return(en=an.explain)==null?void 0:en.file.kbps}))},[b]),nt={where:QR((b==null?void 0:b.shelves)??(ye==null?void 0:ye.shelves),(b==null?void 0:b.sourceDirs)??(ye==null?void 0:ye.sourceDirs)),groupLabel:ye==null?void 0:ye.label,explainOf:XR(b),unblocks:G,kbpsBaseline:Qe},re=Iy(K,nt),_e=se.map(we=>({action:we,row:Iy([we],nt)[0]})).filter(we=>!!we.row),[Pe,Xe]=p.useState(!1),[ge,Ye]=p.useState([]),[je,kt]=p.useState(!1),[zt,Qn]=p.useState(!1),[hn,Zn]=p.useState(!1),sn=async()=>{var we,Oe;Xe(!0),Ye([]),Zn(!1),kt(!0);try{const lt=await be.netdisk.list(c);for(const an of lt){const en={bindingId:an.id,label:((we=an.left)==null?void 0:we.title)||((Oe=an.right)==null?void 0:Oe.path)||an.id};try{const bt=await be.reconcile.previewBinding(c,an.id);Ye(Ft=>[...Ft,{...en,preview:bt}])}catch(bt){Ye(Ft=>[...Ft,{...en,preview:null,error:bt instanceof sr?bt.message:String(bt)}])}}}catch(lt){Ge.error("加载网盘绑定失败",{description:lt instanceof Error?lt.message:String(lt)})}finally{kt(!1)}},Jn=async()=>{var lt;Qn(!0);let we=0,Oe=0;for(const an of ge)if((((lt=an.preview)==null?void 0:lt.plan)??[]).some(bt=>bt.kind==="delete-dup"||bt.kind==="delete-loser"||bt.kind==="delete-redundant"||bt.kind==="replace"))try{const bt=await be.reconcile.executeBinding(c,an.bindingId);we+=bt.deleted,Oe+=bt.errors.length,Ye(Ft=>Ft.map(jn=>jn.bindingId===an.bindingId?{...jn,result:bt}:jn))}catch(bt){Oe++;const Ft=bt instanceof sr?bt.message:String(bt);Ye(jn=>jn.map(Me=>Me.bindingId===an.bindingId?{...Me,resultError:Ft}:Me))}Qn(!1),Zn(!0),Ge.success(`去重完成:删除 ${we} 份`,{description:Oe>0?`${Oe} 条出错,详情见清单`:void 0})};return l.jsxs(hs,{open:t,onOpenChange:n,children:[l.jsxs(Vr,{className:"max-w-xl",children:[l.jsxs(Os,{className:"space-y-1 pr-10",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs(Fr,{children:["整理",ye?` · ${ye.label}`:d&&i?` · ${i}`:""]}),l.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[ye&&l.jsxs(Ne,{size:"mini",variant:"default",onClick:()=>void _L(c,ye.id,ye.label),children:[l.jsx(A1,{})," 让 AI 整理"]}),!d&&l.jsxs(Ne,{size:"mini",variant:"ghost",disabled:je,onClick:()=>void sn(),children:[je?l.jsx(Sr,{className:"animate-spin"}):l.jsx(Po,{})," 扫全部绑定去重"]}),ye&&l.jsxs(BK,{children:[l.jsx(UK,{asChild:!0,children:l.jsx(Ne,{icon:!0,size:"small",variant:"ghost","aria-label":"来源目录",onClick:()=>Te(!0),children:l.jsx(yL,{})})}),l.jsx(VK,{children:"来源目录——整理从哪几个文件夹搬东西"})]})]})]}),b&&!W&&l.jsx("p",{"data-testid":"reconcile-summary",className:"text-[12px] text-muted-foreground",children:fe.length===0?"没有要你动手的":fe.map((we,Oe)=>l.jsxs(p.Fragment,{children:[Oe>0&&" · ",we]},Oe))})]}),x?l.jsx("p",{className:"px-1 py-6 text-center text-[12px] text-muted-foreground",children:x}):r&&D?l.jsxs("div",{className:"flex flex-col items-center gap-2 px-1 py-8 text-center text-[12px] text-muted-foreground",children:[l.jsx("p",{children:D}),l.jsx(Ne,{variant:"ghost",size:"small",onClick:()=>Q(we=>we+1),children:"重试"})]}):r&&_===null?l.jsxs("div",{className:"flex items-center justify-center gap-2 py-8 text-[12px] text-muted-foreground",children:[l.jsx(Sr,{className:"size-4 animate-spin"})," 正在核对网盘绑定…"]}):W?l.jsxs("div",{className:"flex flex-col gap-3 px-1 py-2",children:[l.jsx("p",{className:"text-[12px] text-muted-foreground",children:"这条订阅还没配过整理。整理是把网盘里的散文件认到节目单上的某一集——源站还列着、 但放不出来的那些集靠它补音频。"}),l.jsx("p",{className:"text-[12px] text-muted-foreground",children:"源站已经不再提供的集是另一回事,用「添加来源」把那个网盘目录当成一条来源加进来。"}),l.jsxs(Ne,{size:"small",variant:"default",className:"self-start",onClick:()=>void zL(c,r,i??r),children:[l.jsx(A1,{})," 让 AI 整理"]})]}):ee&&ee.length===0?l.jsx("p",{className:"px-1 py-6 text-center text-[12px] text-muted-foreground",children:"后端还没配置 show。"}):l.jsxs("div",{"data-nested-surface":"true",className:"scrollbar-mac flex max-h-[62vh] flex-col gap-4 overflow-y-auto pr-1",children:[ee&&ee.length>1&&l.jsxs(la,{value:v??void 0,onValueChange:S,children:[l.jsx(ua,{"aria-label":"选择节目",children:l.jsx(ca,{placeholder:"选择节目"})}),l.jsx(da,{children:ee.map(we=>l.jsx(lr,{value:we.id,children:we.label},we.id))})]}),ye&&!ye.shelves&&l.jsx("p",{className:"px-1 text-[11px] text-destructive",children:ye.shelvesProblem??"货架地址还没配齐——整理跑不了。"}),C?l.jsxs("div",{className:"flex items-center justify-center gap-2 py-8 text-[12px] text-muted-foreground",children:[l.jsx(Sr,{className:"size-4 animate-spin"})," 正在核对网盘与曲库…"]}):N?l.jsx("p",{className:"px-1 py-6 text-center text-[12px] text-muted-foreground",children:N}):b?l.jsxs(l.Fragment,{children:[K.length===0&&ne.length===0&&l.jsx("p",{className:"px-1 py-8 text-center text-[12px] text-muted-foreground",children:"没有要处理的——来源目录和曲库是对齐的。"}),K.length>0&&l.jsxs("section",{className:"flex flex-col gap-1.5",children:[l.jsx("div",{className:"flex items-center justify-between gap-2",children:l.jsxs("h3",{className:"px-1 text-[12px] font-medium text-foreground",children:["可以自动完成 ",l.jsx(Bt,{variant:"secondary",size:"sm",children:K.length})]})}),l.jsx("div",{className:"flex flex-col gap-1.5",children:re.map(we=>l.jsx($y,{row:we},we.key))})]}),se.length>0&&l.jsxs("section",{className:"flex flex-col gap-1.5",children:[l.jsxs("h3",{className:"px-1 text-[12px] font-medium text-muted-foreground",children:["要你决定 ",l.jsx(Bt,{variant:"secondary",size:"sm",children:se.length})]}),l.jsx("p",{className:"px-1 text-[11px] text-muted-foreground",children:"裁决在对话里进行——点上方「让 AI 整理」,拿不准的它会把证据摆给你选"}),l.jsx(_W,{summary:R}),l.jsx("div",{className:"flex flex-col gap-1.5",children:_e.map(({row:we})=>l.jsx($y,{row:we},we.key))})]}),P.length>0&&l.jsxs("section",{className:"flex flex-col gap-1",children:[l.jsxs("h3",{className:"px-1 text-[12px] font-medium text-destructive",children:["⚠ 这个目录多数文件认不出属于本节目 ",l.jsx(Bt,{variant:"secondary",size:"sm",children:P.length})]}),P[0].reason&&l.jsx("p",{className:"px-1 text-[11px] text-muted-foreground",children:P[0].reason}),l.jsx("p",{className:"px-1 text-[11px] text-muted-foreground",children:"多半是来源目录指错了。在对话里说一句换成哪个目录,AI 会重开一轮,这些行就没了。"}),l.jsxs(Ne,{size:"mini",variant:"ghost",className:"self-start text-[11px]","aria-expanded":Z,onClick:()=>ve(we=>!we),children:[Z?l.jsx(zo,{}):l.jsx(Ts,{}),Z?"收起":`看这 ${P.length} 个文件`]}),Z&&l.jsx(eu,{children:P.map(we=>l.jsx(Tr,{variant:"muted",size:"xs",children:l.jsx(zs,{children:l.jsx(fa,{className:"truncate",children:we.src.name})})},we.key+we.src.path))})]}),$.length>0&&l.jsxs("section",{className:"flex flex-col gap-1.5",children:[l.jsxs(Ne,{size:"mini",variant:"ghost",className:"self-start text-[11px] text-muted-foreground","aria-expanded":oe,onClick:()=>ie(we=>!we),children:[oe?l.jsx(zo,{}):l.jsx(Ts,{}),"处理中 ",$.length," 个还在探时长"]}),oe&&$.length>0&&l.jsxs("div",{className:"flex flex-col gap-1.5",children:[l.jsxs("h3",{className:"px-1 text-[12px] font-medium text-muted-foreground",children:["认不出 ",l.jsx(Bt,{variant:"secondary",size:"sm",children:$.length}),l.jsx("span",{className:"ml-1.5 font-normal",children:"连时长都拿不到,机器无从判断"})]}),l.jsx(eu,{children:$.map(we=>{const Oe=we.key+we.src.path;return l.jsx(Tr,{variant:"muted",size:"xs",children:l.jsx(zs,{children:l.jsx(fa,{className:"truncate",children:we.src.name})})},Oe)})})]})]})]}):null]})]}),ye&&l.jsx(hs,{open:Ee,onOpenChange:Te,children:l.jsxs(Vr,{className:"max-w-lg",children:[l.jsx(Os,{children:l.jsxs(Fr,{children:["这一轮从哪儿捡、搬去哪儿 ",l.jsx(Bt,{variant:"secondary",size:"sm",children:ye.sourceDirs.length})]})}),l.jsxs("div",{className:"flex flex-col gap-1.5",children:[l.jsxs("p",{className:"text-[12px] text-muted-foreground",children:["本轮从 ",ye.sourceDirs.length?ye.sourceDirs.join("、"):"(没有来源目录,只在库内去重)"," 捡文件。 要换目录在对话里说一句就行。"]}),ye.shelves&&l.jsxs("p",{className:"truncate text-[10px] text-muted-foreground",title:`${ye.shelves.claimed}${ye.shelves.secondary?` · ${ye.shelves.secondary}`:""}`,children:["认领的搬进 ",ye.shelves.claimed,"(绑定的目录)",ye.shelves.secondary&&`,认不出的搬进 ${ye.shelves.secondary}(「下架」那条来源扫的目录)`]})]})]})}),l.jsx(hs,{open:Pe,onOpenChange:we=>{Xe(we),we||Ye([])},children:l.jsxs(Vr,{className:"max-w-xl",children:[l.jsxs(Os,{children:[l.jsx(Fr,{children:"扫全部绑定去重"}),l.jsx(Qa,{children:"逐条绑定核对同一集攒了几份。先看清单——删哪几份、各自留的是哪份,确认后才动网盘;删除进夸克回收站,约 10 天内可找回。"})]}),l.jsx("div",{className:"scrollbar-mac max-h-[62vh] overflow-y-auto pr-1",children:l.jsx(TW,{groups:ge,loading:je,executing:zt,executed:hn,onConfirm:()=>void Jn()})})]})})]})}function zW(e){return e.slice(0,e.lastIndexOf("/"))}function PW({apiBase:e="",open:t,onOpenChange:n,streamId:r,bindingId:i,streamTitle:o,onChanged:c}){const d={baseUrl:e},h=!!i,[m,x]=p.useState(null),[g,v]=p.useState(null),[S,b]=p.useState(null),[j,C]=p.useState(!1),[k,N]=p.useState(!1),E=p.useCallback(()=>{h||(be.streams(d).then(A=>x(A.find(_=>_.id===r)??null)).catch(()=>{}),be.reconcile.config(d).then(A=>{v(A.shows),C(!1)}).catch(A=>{A instanceof sr&&A.status===503&&C(!0)}),be.netdisk.list(d).then(b).catch(()=>{}))},[e,r,h]);p.useEffect(()=>{t&&E()},[t,E]);const R=!h&&g&&S&&r?iA(g,S,r):null;return l.jsxs(l.Fragment,{children:[l.jsx(ay,{open:t,onOpenChange:n,children:l.jsxs(iy,{side:"right",className:"w-full gap-0 sm:max-w-3xl",children:[l.jsxs(GE,{children:[l.jsx(YE,{children:"网盘"}),l.jsx(IK,{children:o||(m==null?void 0:m.description)||r})]}),l.jsxs("div",{className:"shrink-0 space-y-3 border-b border-border px-4 pb-4",children:[r&&l.jsx(EY,{streamId:r,apiBase:e}),l.jsx("div",{className:"grid gap-4",children:l.jsxs("section",{"data-testid":"netdisk-block-reconcile",children:[l.jsx(oA,{children:h?"整理这个目录":"整理"}),h?l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{className:"text-[12px] text-muted-foreground",children:"同一集攒了几份时留质量最高的那份,剩下的进「将删清单」等你确认。判不出来的会 变成待你决定的卡,可以让 AI 听一段再判。"}),l.jsxs(Ne,{size:"small",variant:"neutral",onClick:()=>N(!0),children:[l.jsx(T1,{})," 打开整理"]})]}):j?l.jsx("p",{className:"text-[12px] text-muted-foreground",children:"整理服务没接线。"}):R===null?l.jsxs("p",{className:"flex items-center gap-2 text-[12px] text-muted-foreground",children:[l.jsx(Sr,{className:"size-3.5 animate-spin"})," 正在读整理配置…"]}):l.jsxs("div",{className:"space-y-2",children:[R.length===0?l.jsx("p",{className:"text-[12px] text-muted-foreground",children:"还没配。整理是把网盘文件认到节目单上的某一集——源站还列着但放不出来的那些集靠它补。"}):R.map(A=>l.jsxs("div",{className:"text-[12px]","data-testid":`reconcile-show-${A.id}`,children:[l.jsx("div",{className:"font-medium",children:A.label}),A.shelves&&l.jsxs("div",{className:"text-muted-foreground",children:["认上的搬去 ",A.shelves.claimed,A.shelves.secondary?`,下架的搬去 ${A.shelves.secondary}`:""]}),A.shelvesProblem&&l.jsx("div",{className:"text-destructive",children:A.shelvesProblem})]},A.id)),l.jsxs(Ne,{size:"small",variant:"neutral",onClick:()=>N(!0),children:[l.jsx(T1,{})," ",R.length===0?"整理":"打开整理"]})]})]})})]}),l.jsxs("section",{"data-testid":"netdisk-block-matching",className:"flex min-h-0 flex-1 flex-col",children:[l.jsx("div",{className:"px-4 pt-3",children:l.jsx(oA,{children:"配对情况"})}),l.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 pb-6 scrollbar-mac",children:h?l.jsx(Cy,{focusSetId:i,apiBase:e}):l.jsx(Cy,{streamId:r,apiBase:e})})]})]})}),l.jsx(OW,{apiBase:e,open:k,onOpenChange:A=>{N(A),A||(E(),c==null||c())},...h?{bindingId:i}:{streamId:r},streamTitle:o})]})}function oA({children:e}){return l.jsx("h3",{className:"mb-1.5 text-[13px] font-medium",children:e})}const Fy=p.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(LC,{ref:r,className:Y("relative overflow-hidden",e),...n,children:[l.jsx(QU,{className:"h-full w-full rounded-[inherit] pr-2.5 [&>div]:!block [&>div]:!min-w-0",children:t}),l.jsx(lA,{}),l.jsx(ZU,{})]}));Fy.displayName=LC.displayName;const lA=p.forwardRef(({className:e,orientation:t="vertical",...n},r)=>l.jsx(MC,{ref:r,orientation:t,className:Y("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:l.jsx(KU,{className:"relative flex-1 rounded-full bg-border"})}));lA.displayName=MC.displayName;const LW={pathname:()=>window.location.pathname,push:e=>{if(window.location.pathname!==e)try{window.history.pushState(null,"",e)}catch{}},subscribe:e=>(window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e))};function IW(e="/"){let t=e;const n=new Set;return{pathname:()=>t,push:r=>{if(r!==t){t=r;for(const i of n)i()}},subscribe:r=>(n.add(r),()=>{n.delete(r)})}}const cA=p.createContext(LW);function $W({location:e,children:t}){return p.createElement(cA.Provider,{value:e},t)}function uA(){return p.useContext(cA)}function BW(e,t){const n=uA(),[r,i]=p.useState(()=>e(n.pathname()));return p.useEffect(()=>n.subscribe(()=>i(e(n.pathname()))),[n,e]),{selection:r,navigate:c=>{i(c),n.push(t(c))}}}const dA=new Map;function UW(e,t){const n=p.useRef(null),r=p.useRef(t);r.current=t;const i=()=>{const o=n.current;return o?r.current?r.current(o):o:null};return p.useEffect(()=>{const o=i();if(!o)return;const c=()=>dA.set(e,o.scrollTop);return o.addEventListener("scroll",c,{passive:!0}),()=>o.removeEventListener("scroll",c)},[e]),p.useLayoutEffect(()=>{const o=i();o&&(o.scrollTop=dA.get(e)??0)},[e]),n}function fA(e){return e.querySelector("[data-radix-scroll-area-viewport]")}function VW({className:e,scrollable:t=!0,...n}){const r=l.jsx("table",{"data-slot":"table",className:Y("w-full caption-bottom border-separate border-spacing-0 text-sm",e),...n});return t?l.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto scrollbar-mac",children:r}):r}function FW({className:e,sticky:t=!1,...n}){return l.jsx("thead",{"data-slot":"table-header","data-sticky":t||void 0,className:Y("[&_th]:border-b [&_th]:border-b-[var(--acr-border)]",t&&"[&>tr>th]:sticky [&>tr>th]:top-0 [&>tr>th]:z-10 [&>tr>th]:bg-[var(--acr-surface)] [&>tr>th]:backdrop-blur-xl [&>tr>th:first-child]:rounded-tl-[7px] [&>tr>th:last-child]:rounded-tr-[7px]",e),...n})}function HW({className:e,...t}){return l.jsx("tbody",{"data-slot":"table-body",className:Y("[&_tr:not(:last-child)>td]:border-b [&_tr:not(:last-child)>td]:border-b-[var(--acr-border-soft)]","[&_tr:hover:not(:last-child)>td]:border-b-transparent [&_tr[data-state=selected]:not(:last-child)>td]:border-b-transparent","[&_tr:has(+tr:hover)>td]:border-b-transparent [&_tr:has(+tr[data-state=selected])>td]:border-b-transparent","[&_tr:hover:not([data-state=selected])>td]:bg-[var(--acr-hover)] [&_tr:hover>td:first-child]:rounded-l-[7px] [&_tr:hover>td:last-child]:rounded-r-[7px]",e),...t})}function Cu({className:e,...t}){return l.jsx("tr",{"data-slot":"table-row",className:Y("group/table-row","[&>td]:transition-colors [&>td]:[transition-timing-function:var(--acr-spring-default)] [&>td]:[transition-duration:var(--acr-spring-default-duration)]","data-[state=selected]:[&>td]:bg-primary data-[state=selected]:[&>td]:text-primary-foreground data-[state=selected]:[&>td:first-child]:rounded-l-[7px] data-[state=selected]:[&>td:last-child]:rounded-r-[7px]",e),...t})}function ku({className:e,...t}){return l.jsx("th",{"data-slot":"table-head",className:Y("h-9 px-3 text-left align-middle font-medium whitespace-nowrap text-muted-foreground text-[length:var(--text-subheadline)] [letter-spacing:var(--text-subheadline-tracking)] [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function Yr({className:e,...t}){return l.jsx("td",{"data-slot":"table-cell",className:Y("px-3 py-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function Hy({className:e,...t}){return l.jsx(Bt,{variant:"secondary",size:"sm",className:Y("absolute z-10 border-0 bg-black/55 font-semibold text-white backdrop-blur-sm",e),...t})}const hA="before:pointer-events-none before:absolute before:inset-0 before:-z-10 before:rounded-xl before:shadow-[0_12px_28px_rgba(0,0,0,0.28)] before:opacity-0 before:transition-opacity before:[transition-timing-function:var(--acr-spring-default)] before:[transition-duration:var(--acr-spring-default-duration)] hover:before:opacity-100";function qy({src:e,alt:t="",title:n,subtitle:r,ratio:i,caption:o="below",fallback:c,href:d,onOpen:h,ariaLabel:m,className:x,children:g,...v}){const S=r!=null&&r!=="",b=l.jsxs(fo,{className:Y("flex h-full flex-col overflow-hidden p-0 text-left",hA,x),children:[l.jsxs(jy,{ratio:i,src:e,alt:t,fallback:c,children:[g,o==="overlay"?l.jsxs(EG,{children:[l.jsx(Eh,{children:n}),S&&l.jsx(Sy,{children:r})]}):null]}),o==="below"?l.jsxs("div",{className:"flex flex-col gap-1 px-3 pb-3 pt-2.5",children:[l.jsx(Eh,{className:"self-stretch truncate",children:n}),S&&l.jsx(Sy,{className:"truncate",children:r})]}):null]});return d?l.jsx("a",{href:d,target:"_blank",rel:"noreferrer","data-nested-surface":"true",className:"group block focus:outline-none",...v,children:b}):h?l.jsx("div",{role:"button",tabIndex:0,"aria-label":m,"data-nested-surface":"true",onClick:h,onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),h==null||h())},className:"group block cursor-pointer text-left focus:outline-none",...v,children:b}):l.jsx("div",{"data-nested-surface":"true",className:"group block text-left",...v,children:b})}const Nu=AB,Tu=MB,qW=IB,mA=p.createContext("default"),pA="z-50 min-w-[10rem] rounded-[12px] border border-[var(--acr-border-soft)] bg-[var(--acr-surface)] p-1.5 text-foreground backdrop-blur-xl shadow-[0_8px_28px_rgba(0,0,0,0.18)] outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",Oh=Ur("group/mi relative flex cursor-default select-none items-center rounded-[6px] px-2 outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-40 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{size:{default:"gap-2 py-1 text-[13px] leading-4 [&_svg]:size-4 data-[inset]:pl-8",sm:"gap-2 py-1 text-[11px] leading-[14px] [&_svg]:size-3.5 data-[inset]:pl-7",xs:"gap-1.5 py-[3px] text-[10px] leading-[13px] [&_svg]:size-3 data-[inset]:pl-6"}},defaultVariants:{size:"default"}}),zh="data-[highlighted]:bg-[var(--primary)] data-[highlighted]:text-primary-foreground";function Eu(){return p.useContext(mA)}const kl=p.forwardRef(({className:e,size:t="default",children:n,...r},i)=>l.jsx(mA.Provider,{value:t,children:l.jsx(lC,{children:l.jsx(DB,{ref:i,"data-slot":"context-menu-content",className:Y(pA,e),...r,children:n})})}));kl.displayName="ContextMenuContent";const Er=p.forwardRef(({className:e,inset:t,variant:n="default",...r},i)=>{const o=Eu();return l.jsx(OB,{ref:i,"data-slot":"context-menu-item","data-inset":t||void 0,"data-variant":n,className:Y(Oh({size:o}),n==="default"?zh:"data-[highlighted]:bg-destructive/15 data-[highlighted]:text-destructive",e),...r})});Er.displayName="ContextMenuItem";const KW=p.forwardRef(({className:e,children:t,checked:n,...r},i)=>{const o=Eu();return l.jsxs(zB,{ref:i,"data-slot":"context-menu-checkbox-item",className:Y(Oh({size:o}),"relative pl-8",zh,e),checked:n,...r,children:[l.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:l.jsx(cC,{children:l.jsx(Ns,{className:"size-3.5"})})}),t]})});KW.displayName="ContextMenuCheckboxItem";const GW=p.forwardRef(({className:e,children:t,...n},r)=>{const i=Eu();return l.jsxs(PB,{ref:r,"data-slot":"context-menu-radio-item",className:Y(Oh({size:i}),"relative pl-8",zh,e),...n,children:[l.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:l.jsx(cC,{children:l.jsx($d,{className:"size-2 fill-current"})})}),t]})});GW.displayName="ContextMenuRadioItem";const YW=p.forwardRef(({className:e,inset:t,...n},r)=>{const i=Eu();return l.jsx(_B,{ref:r,"data-slot":"context-menu-label","data-inset":t||void 0,className:Y(i==="default"?"px-2 py-1 text-[12px]":i==="sm"?"px-2 py-1 text-[10px]":"px-1.5 py-[3px] text-[9px]","font-medium text-muted-foreground data-[inset]:pl-8",e),...n})});YW.displayName="ContextMenuLabel";const WW=p.forwardRef(({className:e,...t},n)=>l.jsx(LB,{ref:n,"data-slot":"context-menu-separator",className:Y("-mx-1 my-1 h-px bg-[var(--acr-border-soft)]",e),...t}));WW.displayName="ContextMenuSeparator";const gA=p.forwardRef(({className:e,inset:t,children:n,...r},i)=>{const o=Eu();return l.jsxs($B,{ref:i,"data-slot":"context-menu-sub-trigger","data-inset":t||void 0,className:Y(Oh({size:o}),"data-[state=open]:bg-[var(--acr-hover)] data-[state=open]:text-foreground",zh,e),...r,children:[n,l.jsx(Ts,{className:"ml-auto"})]})});gA.displayName="ContextMenuSubTrigger";const xA=p.forwardRef(({className:e,...t},n)=>l.jsx(lC,{children:l.jsx(BB,{ref:n,"data-slot":"context-menu-sub-content",className:Y(pA,e),...t})}));xA.displayName="ContextMenuSubContent";function XW({id:e,label:t,children:n}){return l.jsxs(Nu,{children:[l.jsx(Tu,{asChild:!0,children:n}),l.jsx(kl,{size:"sm",children:l.jsxs(Er,{onSelect:()=>void LL(e,t),children:[l.jsx(Rp,{}),"在对话中引用"]})})]})}function QW(){let e=0;const t=new Set;return{get:()=>e,set:n=>{if(!(Math.floor(n)===Math.floor(e)&&n>=e)){e=n;for(const r of t)r()}},subscribe:n=>(t.add(n),()=>t.delete(n))}}const vA=p.createContext(null);function ZW(){const e=p.useContext(vA);return p.useSyncExternalStore(e?e.subscribe:JW,e?e.get:eX)}const JW=()=>()=>{},eX=()=>0,tX={mini:{track:4,w:16,h:12},small:{track:4,w:18,h:14},medium:{track:6,w:20,h:16},large:{track:6,w:24,h:20},xl:{track:6,w:24,h:20}};function Ky({className:e,defaultValue:t,value:n,min:r=0,max:i=100,step:o=1,size:c="medium",variant:d="standard",marks:h=!1,orientation:m="horizontal",onValueChange:x,...g}){const{track:v,w:S,h:b}=tX[c],j=m==="vertical",C=j?b:S,k=j?S:b,[N,E]=p.useState(()=>Array.isArray(n)?n:Array.isArray(t)?t:[r]),R=Array.isArray(n)?n:N,A=R.length,_=p.useCallback(Q=>{E(Q),x==null||x(Q)},[x]),z=Q=>(Q-r)/(i-r)*100,D=d==="center"&&A===1,V=(()=>{const Q=z(R[0]),B=Math.min(Q,50),H=Math.abs(Q-50);return j?{bottom:`${B}%`,height:`${H}%`}:{left:`${B}%`,width:`${H}%`}})(),I=p.useMemo(()=>{if(Array.isArray(h))return h;if(!h)return[];const Q=i-r;if(o>0){const B=Math.round(Q/o);if(B>=1&&B<=40)return Array.from({length:B+1},(H,ee)=>r+ee*o)}return Array.from({length:9},(B,H)=>r+H*Q/8)},[h,r,i,o]);return l.jsxs(L6,{"data-slot":"slider","data-size":c,"data-variant":d,defaultValue:Array.isArray(n)?void 0:t,value:Array.isArray(n)?n:void 0,min:r,max:i,step:o,orientation:m,onValueChange:_,className:Y("relative flex w-full touch-none select-none items-center","data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",h&&!j&&"mb-3.5",h&&j&&"mr-3.5","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...g,children:[l.jsx(U6,{"data-slot":"slider-track",style:{"--slider-track":`${v}px`},className:Y("relative grow overflow-hidden rounded-full bg-[var(--acr-chip)]","data-[orientation=horizontal]:h-[var(--slider-track)] data-[orientation=horizontal]:w-full","data-[orientation=vertical]:w-[var(--slider-track)] data-[orientation=vertical]:h-full"),children:D?l.jsx("div",{"data-slot":"slider-range","data-variant":"center",style:V,className:Y("absolute rounded-full bg-primary",j?"inset-x-0 w-full":"inset-y-0 h-full")}):l.jsx(V6,{"data-slot":"slider-range",className:Y("absolute rounded-full bg-primary","data-[orientation=horizontal]:h-full","data-[orientation=vertical]:w-full")})}),Array.from({length:A},(Q,B)=>l.jsx(G6,{"data-slot":"slider-thumb",style:{"--slider-thumb-w":`${C}px`,"--slider-thumb-h":`${k}px`},className:"group/thumb relative block size-0 shrink-0 outline-none",children:l.jsx("span",{"aria-hidden":!0,className:Y("absolute left-1/2 top-1/2 block h-[var(--slider-thumb-h)] w-[var(--slider-thumb-w)] -translate-x-1/2 -translate-y-1/2 rounded-full bg-[var(--acr-control)]","border border-[var(--acr-control-border)]","shadow-[0_1px_3px_rgba(0,0,0,0.18),0_4px_10px_rgba(0,0,0,0.12)]","transition-[box-shadow,transform]","group-hover/thumb:shadow-[0_1px_3px_rgba(0,0,0,0.22),0_6px_14px_rgba(0,0,0,0.16)]","group-focus-visible/thumb:ring-4 group-focus-visible/thumb:ring-ring/25","group-active/thumb:scale-95")})},B)),I.length>0&&l.jsx("div",{"data-slot":"slider-marks","aria-hidden":!0,className:Y("pointer-events-none absolute",j?"inset-y-0 left-full ml-2 w-[2px]":"inset-x-0 top-full mt-2 h-[2px]"),children:I.map((Q,B)=>{const H=z(Q);return l.jsx("span",{style:j?{bottom:`${H}%`,transform:"translateY(50%)"}:{left:`${H}%`,transform:"translateX(-50%)"},className:"absolute size-[2px] rounded-full bg-foreground/25"},B)})})]})}const nX={previous:"Previous track",play:"Play",pause:"Pause",next:"Next track",volume:"Volume",nowPlaying:"Now playing",openNowPlaying:"Open now playing: {title}"},Gy="flex size-9 shrink-0 items-center justify-center rounded-full text-foreground/70 transition-colors hover:bg-[var(--acr-hover)] hover:text-foreground disabled:pointer-events-none disabled:opacity-30";function yA(e){(!Number.isFinite(e)||e<0)&&(e=0);const t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n.toString().padStart(2,"0")}`}function rX({variant:e="bar",onOpen:t,track:n,playing:r=!1,currentTime:i=0,duration:o=0,volume:c,hasPrev:d=!1,hasNext:h=!1,onPrev:m,onNext:x,onToggle:g,onSeek:v,onVolumeChange:S,actions:b,labels:j,className:C,...k}){const N={...nX,...j},E=n&&o?i/o*100:0,R=z=>{if(!n||!o||!v)return;const D=z.currentTarget.getBoundingClientRect();v(Math.max(0,Math.min(1,(z.clientX-D.left)/D.width))*o)};if(e==="mini"){if(!n)return null;const z=n.cover?l.jsx("img",{src:n.cover,alt:"",loading:"lazy",decoding:"async",className:"size-8 shrink-0 rounded-md object-cover shadow-sm"}):l.jsx("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-md bg-[var(--acr-chip)] text-muted-foreground",children:l.jsx(Xs,{className:"size-3.5"})});return l.jsxs("div",{"data-slot":"audio-player","data-variant":"mini",className:Y("relative flex min-w-0 items-center gap-2 rounded-xl bg-[var(--acr-chip)] px-2 pb-2.5 pt-1.5",C),...k,children:[l.jsxs("button",{onClick:t,"aria-label":N.openNowPlaying.replace("{title}",n.title||N.nowPlaying),className:"flex min-w-0 flex-1 items-center gap-2 text-left",children:[z,l.jsxs("span",{className:"min-w-0 flex-1",children:[l.jsx("span",{className:"block truncate text-[12px] font-semibold leading-tight",children:n.title||N.nowPlaying}),n.artist&&l.jsx("span",{className:"block truncate text-[10px] leading-tight text-muted-foreground",children:n.artist})]})]}),l.jsx("button",{onClick:g,"aria-label":r?N.pause:N.play,className:"flex size-7 shrink-0 items-center justify-center rounded-full bg-[var(--acr-chip-hover)] text-foreground transition-all hover:scale-105",children:r?l.jsx(Bi,{className:"size-3.5 fill-current"}):l.jsx(qn,{className:"size-3.5 translate-x-px fill-current"})}),l.jsx("div",{onClick:R,className:"absolute inset-x-2 bottom-1 h-[3px] cursor-pointer overflow-hidden rounded-full bg-foreground/15",children:l.jsx("div",{className:"h-full rounded-full bg-foreground/70",style:{width:`${E}%`}})})]})}const A=typeof c=="number"&&!!S,_=c===0?SL:(c??1)<.5?wL:M1;return l.jsxs("div",{"data-slot":"audio-player",className:Y("relative inline-flex w-full max-w-3xl items-center gap-1.5 rounded-full","bg-[var(--acr-panel)] px-3 py-2 backdrop-blur-xl","shadow-[0_0_0_1px_rgba(190,190,190,0.16),0_16px_48px_rgba(0,0,0,0.45)]",C),...k,children:[l.jsx("button",{onClick:m,disabled:!d,"aria-label":N.previous,className:Gy,children:l.jsx(E1,{className:"size-4 fill-current"})}),l.jsx("button",{onClick:g,disabled:!n,"aria-label":r?N.pause:N.play,className:"flex size-10 shrink-0 items-center justify-center rounded-full bg-[var(--acr-chip)] text-foreground transition-all hover:scale-105 hover:bg-[var(--acr-chip-hover)] disabled:pointer-events-none disabled:opacity-30",children:r?l.jsx(Bi,{className:"size-5 fill-current"}):l.jsx(qn,{className:"size-5 translate-x-px fill-current"})}),l.jsx("button",{onClick:x,disabled:!h,"aria-label":N.next,className:Gy,children:l.jsx(R1,{className:"size-4 fill-current"})}),n?l.jsxs("div",{className:"relative mx-1.5 flex min-w-0 flex-1 items-center gap-2.5 rounded-2xl bg-[var(--acr-chip)] px-2 pb-2.5 pt-1.5",children:[n.cover?l.jsx("img",{src:n.cover,alt:"",className:"size-9 shrink-0 rounded-md object-cover shadow-sm"}):l.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-md bg-[var(--acr-chip)] text-muted-foreground",children:l.jsx(Xs,{className:"size-4"})}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("div",{className:"truncate text-[13px] font-semibold leading-tight",children:n.title||N.nowPlaying}),n.artist&&l.jsx("div",{className:"truncate text-[11px] leading-tight text-muted-foreground",children:n.artist})]}),l.jsxs("span",{className:"shrink-0 font-mono text-[10px] tabular-nums text-muted-foreground",children:[yA(i),"/",yA(o)]}),l.jsx("div",{onClick:R,className:"absolute inset-x-2 bottom-1 h-[3px] cursor-pointer overflow-hidden rounded-full bg-[var(--acr-chip)]",children:l.jsx("div",{className:"h-full rounded-full bg-foreground/70",style:{width:`${E}%`}})})]}):l.jsx("div",{className:"mx-1.5 flex-1"}),A&&l.jsxs(Bg,{openDelay:60,closeDelay:120,children:[l.jsx(Ug,{asChild:!0,children:l.jsx("button",{"aria-label":N.volume,className:Gy,children:l.jsx(_,{className:"size-4"})})}),l.jsx(Vg,{children:l.jsx(kf,{side:"top",sideOffset:10,className:"z-50 flex h-32 w-9 flex-col items-center rounded-2xl bg-[var(--acr-panel)] px-2 py-2.5 shadow-[0_0_0_1px_rgba(190,190,190,0.16),0_16px_48px_rgba(0,0,0,0.45)] outline-none backdrop-blur-xl data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",children:l.jsx(Ky,{orientation:"vertical",size:"small",min:0,max:100,value:[Math.round((c??0)*100)],onValueChange:z=>S==null?void 0:S(z[0]/100),"aria-label":N.volume,style:{minHeight:0},className:"h-full"})})})]}),b]})}const sX=`
|
|
413
|
+
attribute vec2 aPos;
|
|
414
|
+
varying vec2 vUv;
|
|
415
|
+
void main() {
|
|
416
|
+
vUv = aPos * 0.5 + 0.5;
|
|
417
|
+
gl_Position = vec4(aPos, 0.0, 1.0);
|
|
418
|
+
}
|
|
419
|
+
`,aX=`
|
|
420
|
+
precision highp float;
|
|
421
|
+
varying vec2 vUv;
|
|
422
|
+
|
|
423
|
+
uniform float uTime;
|
|
424
|
+
uniform vec3 uColor;
|
|
425
|
+
uniform float uSpeed;
|
|
426
|
+
uniform float uScale;
|
|
427
|
+
uniform float uRotation;
|
|
428
|
+
uniform float uNoiseIntensity;
|
|
429
|
+
|
|
430
|
+
const float e = 2.71828182845904523536;
|
|
431
|
+
|
|
432
|
+
float noise(vec2 texCoord) {
|
|
433
|
+
float G = e;
|
|
434
|
+
vec2 r = (G * sin(G * texCoord));
|
|
435
|
+
return fract(r.x * r.y * (1.0 + texCoord.x));
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
vec2 rotateUvs(vec2 uv, float angle) {
|
|
439
|
+
float c = cos(angle);
|
|
440
|
+
float s = sin(angle);
|
|
441
|
+
mat2 rot = mat2(c, -s, s, c);
|
|
442
|
+
return rot * uv;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
void main() {
|
|
446
|
+
float rnd = noise(gl_FragCoord.xy);
|
|
447
|
+
vec2 uv = rotateUvs(vUv * uScale, uRotation);
|
|
448
|
+
vec2 tex = uv * uScale;
|
|
449
|
+
float tOffset = uSpeed * uTime;
|
|
450
|
+
|
|
451
|
+
tex.y += 0.03 * sin(8.0 * tex.x - tOffset);
|
|
452
|
+
|
|
453
|
+
float pattern = 0.6 +
|
|
454
|
+
0.4 * sin(5.0 * (tex.x + tex.y +
|
|
455
|
+
cos(3.0 * tex.x + 5.0 * tex.y) +
|
|
456
|
+
0.02 * tOffset) +
|
|
457
|
+
sin(20.0 * (tex.x + tex.y - 0.1 * tOffset)));
|
|
458
|
+
|
|
459
|
+
vec4 col = vec4(uColor, 1.0) * vec4(pattern) - rnd / 15.0 * uNoiseIntensity;
|
|
460
|
+
col.a = 1.0;
|
|
461
|
+
gl_FragColor = col;
|
|
462
|
+
}
|
|
463
|
+
`;function bA(e){const t=e.replace("#","");return[parseInt(t.slice(0,2),16)/255,parseInt(t.slice(2,4),16)/255,parseInt(t.slice(4,6),16)/255]}function wA(e,t,n){const r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}function iX({speed:e=5,scale:t=1,color:n="#7B7481",noiseIntensity:r=1.5,rotation:i=0,colorTransitionMs:o=0,className:c}){const d=p.useRef(null),h=p.useRef({speed:e,scale:t,color:n,noiseIntensity:r,rotation:i,colorTransitionMs:o});h.current={speed:e,scale:t,color:n,noiseIntensity:r,rotation:i,colorTransitionMs:o};const m=p.useRef(()=>{});return p.useEffect(()=>{const x=d.current;if(!x)return;const g=x.getContext("webgl",{antialias:!0,alpha:!1,powerPreference:"low-power"});if(!g)return;const v=g.createProgram();g.attachShader(v,wA(g,g.VERTEX_SHADER,sX)),g.attachShader(v,wA(g,g.FRAGMENT_SHADER,aX)),g.linkProgram(v),g.useProgram(v);const S=g.createBuffer();g.bindBuffer(g.ARRAY_BUFFER,S),g.bufferData(g.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),g.STATIC_DRAW);const b=g.getAttribLocation(v,"aPos");g.enableVertexAttribArray(b),g.vertexAttribPointer(b,2,g.FLOAT,!1,0,0);const j={time:g.getUniformLocation(v,"uTime"),color:g.getUniformLocation(v,"uColor"),speed:g.getUniformLocation(v,"uSpeed"),scale:g.getUniformLocation(v,"uScale"),rotation:g.getUniformLocation(v,"uRotation"),noise:g.getUniformLocation(v,"uNoiseIntensity")},C=bA(h.current.color),k=()=>{const I=h.current;g.uniform1f(j.speed,I.speed),g.uniform1f(j.scale,I.scale),g.uniform1f(j.rotation,I.rotation),g.uniform1f(j.noise,I.noiseIntensity)},N=window.matchMedia("(prefers-reduced-motion: reduce)").matches,E=()=>{const I=Math.min(window.devicePixelRatio||1,2),Q=Math.max(1,Math.floor(x.clientWidth*I)),B=Math.max(1,Math.floor(x.clientHeight*I));(x.width!==Q||x.height!==B)&&(x.width=Q,x.height=B,g.viewport(0,0,Q,B))},R=new ResizeObserver(E);R.observe(x),E();let A=0;const _=(I=0)=>{const Q=h.current,B=bA(Q.color),H=Q.colorTransitionMs??0;if(H<=0||document.hidden)C[0]=B[0],C[1]=B[1],C[2]=B[2];else if(I>0){const ee=1-Math.exp(-I/(H/3));C[0]+=(B[0]-C[0])*ee,C[1]+=(B[1]-C[1])*ee,C[2]+=(B[2]-C[2])*ee}k(),g.uniform3f(j.color,C[0],C[1],C[2]),g.uniform1f(j.time,A),g.drawArrays(g.TRIANGLE_STRIP,0,4)};m.current=_,_();let z=0,D=0;const V=I=>{if(z=requestAnimationFrame(V),document.hidden)return;const Q=D?I-D:16;D=I,N||(A+=.1*(Q/1e3)),_(Q)};return z=requestAnimationFrame(V),()=>{cancelAnimationFrame(z),R.disconnect(),g.deleteProgram(v),g.deleteBuffer(S),m.current=()=>{}}},[]),p.useEffect(()=>{m.current(0)},[e,t,n,r,i,o]),l.jsx("canvas",{ref:d,className:Y("block size-full",c)})}function SA(e){(!Number.isFinite(e)||e<0)&&(e=0);const t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n.toString().padStart(2,"0")}`}const jA=32,oX=40;function CA({children:e,className:t}){const n=p.useRef(null),r=p.useRef(null),[i,o]=p.useState(!1);return p.useLayoutEffect(()=>{const c=n.current,d=r.current;if(!c||!d)return;let h;const m=()=>{h==null||h.cancel(),h=void 0;const g=d.firstElementChild,v=(g==null?void 0:g.scrollWidth)??0,b=!window.matchMedia("(prefers-reduced-motion: reduce)").matches&&v>c.clientWidth+1;if(o(b),!b)return;const j=v+jA;h=d.animate([{transform:"translateX(0)"},{transform:`translateX(-${j}px)`}],{duration:j/oX*1e3,iterations:1/0,easing:"linear"})};m();const x=new ResizeObserver(m);return x.observe(c),()=>{x.disconnect(),h==null||h.cancel()}},[e]),l.jsx("div",{ref:n,className:Y("overflow-hidden",t),children:l.jsxs("div",{ref:r,className:Y("flex whitespace-nowrap",i&&"w-max will-change-transform"),children:[l.jsx("span",{className:Y("min-w-0",!i&&"truncate"),children:e}),i&&l.jsx("span",{"aria-hidden":!0,className:"shrink-0",style:{paddingLeft:jA},children:e})]})})}const lX={collapse:"Collapse",enterFullscreen:"Enter full screen",exitFullscreen:"Exit full screen",previous:"Previous track",play:"Play",pause:"Pause",next:"Next track",progress:"Progress",volume:"Volume",unknownTrack:"Unknown track"},cX="#5E3AA8";function uX(e,t,n){return"#"+[e,t,n].map(r=>Math.round(r).toString(16).padStart(2,"0")).join("")}function dX(e){const n=document.createElement("canvas");n.width=24,n.height=24;const r=n.getContext("2d",{willReadFrequently:!0});r.drawImage(e,0,0,24,24);let i;try{i=r.getImageData(0,0,24,24).data}catch{return null}const o=new Map;for(let d=0;d<i.length;d+=4){const h=i[d],m=i[d+1],x=i[d+2];if(i[d+3]<8)continue;const v=Math.max(h,m,x),S=Math.min(h,m,x),b=(h+m+x)/3,j=v===0?0:(v-S)/v;if(b<25||b>235||j<.15)continue;const C=h>>4<<8|m>>4<<4|x>>4,k=o.get(C)||{n:0,r:0,g:0,b:0};k.n++,k.r+=h,k.g+=m,k.b+=x,o.set(C,k)}let c=null;for(const d of o.values())(!c||d.n>c.n)&&(c=d);return c?[c.r/c.n,c.g/c.n,c.b/c.n]:null}function fX([e,t,n]){const r=Math.max(e,t,n);if(r<150){const i=150/Math.max(r,1);e=Math.min(255,e*i),t=Math.min(255,t*i),n=Math.min(255,n*i)}return uX(e,t,n)}function hX(e,t){const[n,r]=p.useState();return p.useEffect(()=>{if(!t||!e){r(void 0);return}let i=!1;const o=new Image;return o.crossOrigin="anonymous",o.onload=()=>{if(i)return;const c=dX(o);r(c?fX(c):void 0)},o.onerror=()=>!i&&r(void 0),o.src=e,()=>{i=!0}},[e,t]),n}function mX({track:e,playing:t=!1,currentTime:n=0,duration:r=0,volume:i,hasPrev:o=!0,hasNext:c=!0,accentColor:d,extractFromCover:h=!0,colorTransitionMs:m=400,nowPlayingLabel:x,labels:g,autoFullscreen:v=!1,onToggle:S,onPrev:b,onNext:j,onSeek:C,onVolumeChange:k,onClose:N,className:E,...R}){const A={...lX,...g},_=p.useRef(null),[z,D]=p.useState(!1),V=e.lyrics??[],I=V.length>0,Q=hX(e.cover,h&&!d&&!z),B=d??Q??cX,H=p.useRef(n),[ee,W]=p.useState(n);p.useEffect(()=>{Math.abs(n-H.current)>.75&&(H.current=n,W(n))},[n]),p.useEffect(()=>{H.current=n,W(n)},[e]),p.useEffect(()=>{if(!t)return;let Z=0,ve=0,Ee=0;const Te=Ie=>{Z=requestAnimationFrame(Te);const Fe=ve?(Ie-ve)/1e3:0;ve=Ie,H.current=Math.min(r||1/0,H.current+Fe),Ee+=Fe,Ee>=.08&&(Ee=0,W(H.current))};return Z=requestAnimationFrame(Te),()=>cancelAnimationFrame(Z)},[t,r]);const M=Z=>{H.current=Z,W(Z),C==null||C(Z)},U=p.useMemo(()=>{let Z=0;for(let ve=0;ve<V.length&&V[ve].time<=ee;ve++)Z=ve;return Z},[V,ee]),K=p.useRef(null),ne=p.useRef([]),q=p.useRef(!1),P=p.useRef(null),L=p.useCallback((Z="smooth")=>{const ve=ne.current[U],Ee=K.current;ve&&Ee&&Ee.scrollTo({top:ve.offsetTop-Ee.clientHeight/2+ve.clientHeight/2,behavior:Z})},[U]);p.useEffect(()=>{if(q.current)return;const Z=setTimeout(()=>L(),220);return()=>clearTimeout(Z)},[U,e,L]),p.useEffect(()=>()=>{P.current&&clearTimeout(P.current)},[]);const G=()=>{q.current=!0,P.current&&clearTimeout(P.current),P.current=setTimeout(()=>{q.current=!1,L()},5e3)},[J,$]=p.useState(!1);p.useEffect(()=>{const Z=()=>$(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",Z),()=>document.removeEventListener("fullscreenchange",Z)},[]);const se=()=>{var Z,ve;document.fullscreenElement?document.exitFullscreen():(ve=(Z=_.current)==null?void 0:Z.requestFullscreen)==null||ve.call(Z)};p.useEffect(()=>{var Z,ve;v&&!document.fullscreenElement&&((ve=(Z=_.current)==null?void 0:Z.requestFullscreen)==null||ve.call(Z).catch(()=>{}))},[]),p.useEffect(()=>{const Z=ve=>ve.key==="Escape"&&!document.fullscreenElement&&(N==null?void 0:N());return window.addEventListener("keydown",Z),()=>window.removeEventListener("keydown",Z)},[N]);const oe=typeof i=="number"&&!!k,ie=e.cover&&!z;return l.jsxs("div",{ref:_,"data-slot":"audio-player-stage",className:Y("fixed inset-0 z-[60] overflow-hidden",E),...R,children:[l.jsx(iX,{className:"!absolute inset-0",color:B,colorTransitionMs:m,speed:4,scale:.8,noiseIntensity:1,rotation:.05}),l.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-black/30 via-black/40 to-black/70"}),l.jsxs("div",{className:"relative flex h-full flex-col px-[5vw] pb-8 pt-5 text-white",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("button",{onClick:N,"aria-label":A.collapse,className:Y("flex size-9 items-center justify-center rounded-full text-white/80 transition-colors hover:bg-white/10 hover:text-white",!N&&"invisible"),children:l.jsx(zo,{className:"size-5"})}),x?l.jsx("span",{className:"text-[11px] font-medium uppercase tracking-widest text-white/60",children:x}):l.jsx("span",{"aria-hidden":!0}),l.jsx("button",{onClick:se,"aria-label":J?A.exitFullscreen:A.enterFullscreen,className:"flex size-9 items-center justify-center rounded-full text-white/70 transition-colors hover:bg-white/10 hover:text-white",children:J?l.jsx(pL,{className:"size-4"}):l.jsx(Op,{className:"size-4"})})]}),l.jsxs("div",{className:Y("flex min-h-0 flex-1 items-center gap-[6vw]",I?"justify-start":"justify-center"),children:[l.jsxs("div",{className:Y("flex w-full max-w-sm flex-col gap-7",I&&"shrink-0 md:w-[40%]"),children:[l.jsx("div",{className:Y("aspect-square w-[min(60vw,280px)] overflow-hidden rounded-3xl shadow-2xl ring-1 ring-white/10 transition-transform duration-500 ease-out",I?"":"mx-auto",t?"scale-100":"scale-95"),children:ie?l.jsx("img",{src:e.cover,alt:"",onError:()=>D(!0),className:"size-full object-cover"}):l.jsx("div",{className:"flex size-full items-center justify-center bg-white/10",children:l.jsx(Xs,{className:"size-16 text-white/50"})})}),l.jsxs("div",{className:Y("min-w-0",!I&&"text-center"),children:[l.jsx(CA,{className:"text-2xl font-bold leading-tight [text-shadow:0_1px_12px_rgba(0,0,0,0.4)]",children:e.title||A.unknownTrack}),e.artist&&l.jsx(CA,{className:"mt-1 text-base leading-tight text-white/70 [text-shadow:0_1px_10px_rgba(0,0,0,0.5)]",children:e.artist})]}),l.jsxs("div",{className:"flex flex-col gap-1.5",children:[l.jsx(Ky,{value:[Math.min(ee,r)],min:0,max:r||1,step:1,onValueChange:Z=>M(Z[0]),"aria-label":A.progress}),l.jsxs("div",{className:"flex justify-between font-mono text-[11px] tabular-nums text-white/50",children:[l.jsx("span",{children:SA(ee)}),l.jsxs("span",{children:["-",SA(Math.max(0,r-ee))]})]})]}),l.jsxs("div",{className:"flex items-center justify-center gap-8",children:[l.jsx("button",{onClick:b,disabled:!o,"aria-label":A.previous,className:"flex size-12 items-center justify-center rounded-full text-white/80 transition-transform hover:scale-105 hover:text-white disabled:pointer-events-none disabled:opacity-30",children:l.jsx(E1,{className:"size-7 fill-current"})}),l.jsx("button",{onClick:S,"aria-label":t?A.pause:A.play,className:"flex size-16 items-center justify-center rounded-full bg-white text-black shadow-lg transition-transform hover:scale-105",children:t?l.jsx(Bi,{className:"size-7 fill-current"}):l.jsx(qn,{className:"size-7 translate-x-0.5 fill-current"})}),l.jsx("button",{onClick:j,disabled:!c,"aria-label":A.next,className:"flex size-12 items-center justify-center rounded-full text-white/80 transition-transform hover:scale-105 hover:text-white disabled:pointer-events-none disabled:opacity-30",children:l.jsx(R1,{className:"size-7 fill-current"})})]}),oe&&l.jsxs("div",{className:"flex items-center gap-3 text-white/60",children:[l.jsx(M1,{className:"size-4 shrink-0"}),l.jsx(Ky,{value:[Math.round((i??0)*100)],min:0,max:100,onValueChange:Z=>k==null?void 0:k(Z[0]/100),"aria-label":A.volume,className:"flex-1"})]})]}),I&&l.jsx("div",{ref:K,onWheel:G,onTouchStart:G,onTouchMove:G,className:"relative hidden min-h-0 flex-1 self-stretch overflow-y-auto py-[38vh] [scrollbar-width:none] md:block [&::-webkit-scrollbar]:hidden",children:V.map((Z,ve)=>l.jsx("p",{ref:Ee=>{ne.current[ve]=Ee},onClick:()=>M(Z.time),className:Y("max-w-2xl cursor-pointer px-2 py-2.5 text-2xl font-semibold leading-snug transition-colors duration-300 lg:text-3xl",ve!==U&&"text-white/30 hover:text-white/55"),children:Z.text},ve))})]})]})]})}const pX={previous:"上一首",play:"播放",pause:"暂停",next:"下一首",volume:"音量",nowPlaying:"播放中",openNowPlaying:"打开播放中:{title}"},gX={collapse:"收起",enterFullscreen:"全屏",exitFullscreen:"退出全屏",previous:"上一首",play:"播放",pause:"暂停",next:"下一首",progress:"进度",volume:"音量",unknownTrack:"未知曲目"},xX="flex size-9 shrink-0 items-center justify-center rounded-full text-foreground/70 transition-colors hover:bg-[var(--acr-hover)] hover:text-foreground",kA={music:"音乐",podcast:"播客"};function vX(){const e=Ay(),[t,n]=p.useState(e.activeKind),r=e.queues[t];return l.jsxs(ay,{children:[l.jsx(zK,{asChild:!0,children:l.jsx("button",{"aria-label":"播放队列",className:xX,title:"播放队列",children:l.jsx(Xs,{className:"size-4"})})}),l.jsxs(iy,{className:"gap-0 p-0 text-foreground",children:[l.jsxs("div",{className:"flex items-baseline gap-1.5 px-4 pt-3 pb-2 pr-10",children:[l.jsx("h2",{className:"text-lg font-bold tracking-tight",children:"播放列表"}),l.jsx("span",{className:"text-xs text-muted-foreground",children:r.length})]}),l.jsx("div",{className:"mb-2 flex justify-center px-4",children:l.jsx(Jk,{variant:"segmented",size:"large",value:t,onValueChange:i=>n(i),"aria-label":"播放列表类型",children:["music","podcast"].map(i=>l.jsxs(eN,{value:i,className:"gap-1 px-4",children:[kA[i],l.jsx("span",{className:"text-[11px] opacity-60",children:e.queues[i].length})]},i))})}),l.jsx("div",{className:"scrollbar-mac min-h-0 flex-1 overflow-y-auto px-2 pb-3",children:r.length===0?l.jsxs("div",{className:"flex h-32 items-center justify-center text-sm text-muted-foreground",children:[kA[t],"队列为空"]}):r.map((i,o)=>{var d;const c=((d=e.current)==null?void 0:d.id)===i.id&&e.activeKind===t;return l.jsxs("button",{onClick:()=>e.playQueue(r,o,t),className:"group flex w-full items-center gap-3 rounded-xl px-2 py-2 text-left transition-colors hover:bg-[var(--acr-hover)]",children:[l.jsxs("div",{className:"relative size-11 shrink-0 overflow-hidden rounded-lg",children:[i.poster?l.jsx("img",{src:i.poster,alt:"",className:"size-full object-cover"}):l.jsx("span",{className:"flex size-full items-center justify-center bg-[var(--acr-chip)] text-muted-foreground",children:l.jsx(N1,{className:"size-4"})}),l.jsx("div",{className:Y("absolute inset-0 flex items-center justify-center bg-black/35 transition-opacity",c?"opacity-100":"opacity-0 group-hover:opacity-100"),children:l.jsx(qn,{className:"size-4 translate-x-px fill-white text-white"})})]}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("div",{className:Y("truncate text-sm font-medium",c&&"text-primary"),children:i.title||"未命名"}),i.author&&l.jsx("div",{className:"truncate text-xs text-muted-foreground",children:i.author})]}),i.durationS?l.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:Ah(i.durationS)}):null]},i.id)})})]})]})}const NA=/\[(\d{1,2}):(\d{1,2})(?:[.:](\d{1,3}))?\]/g;function yX(e){const t=[];for(const n of e.split(/\r?\n/)){const r=[...n.matchAll(NA)];if(!r.length)continue;const i=n.replace(NA,"").trim();if(i)for(const o of r){const c=Number(o[1]),d=Number(o[2]),h=o[3]?Number(o[3].padEnd(3,"0"))/1e3:0;t.push({time:c*60+d+h,text:i})}}return t.sort((n,r)=>n.time-r.time)}const bX="flex size-9 shrink-0 items-center justify-center rounded-full text-foreground/70 transition-colors hover:bg-[var(--acr-hover)] hover:text-foreground disabled:pointer-events-none disabled:opacity-30";function wX(e){if(e.platform==="netease"&&e.trackId)return`netease:${e.trackId}`;if(e.title&&e.author)return`${e.title}::${e.author}`}function SX(e,t){const[n,r]=p.useState(void 0);return p.useEffect(()=>{r(void 0);const i=t?wX(t):void 0;if(!i)return;let o=!1;return be.lyrics(e,i).then(c=>{var h;if(o)return;const d=(h=c.result)==null?void 0:h.items[0];if(d!=null&&d.matched&&d.lrc){const m=yX(d.lrc);m.length&&r(m)}}).catch(()=>{}),()=>{o=!0}},[e,t==null?void 0:t.id]),n}function TA(e,t){return{title:e.title||"播放中",artist:e.author,cover:e.poster,...t!=null&&t.length?{lyrics:t}:{}}}function jX({conn:e}){const t=Ay(),n=ZW(),{current:r,queue:i}=t,o=r?i.findIndex(j=>j.id===r.id):-1,c=o>0,d=o>=0&&o<i.length-1,[h,m]=p.useState(()=>t.getVolume()),[x,g]=p.useState(!1),v=SX(e,r),S=p.useMemo(()=>r?TA(r):null,[r]),b=p.useMemo(()=>r?TA(r,v):null,[r,v]);return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 z-20 flex justify-center px-4 pb-4",children:l.jsx(rX,{className:"pointer-events-auto",labels:pX,track:S,playing:t.playing,currentTime:n,duration:t.duration,volume:h,hasPrev:c,hasNext:d,onPrev:()=>c&&t.playQueue(i,o-1,t.activeKind),onNext:()=>d&&t.playQueue(i,o+1,t.activeKind),onToggle:t.toggle,onSeek:t.seek,onVolumeChange:j=>{m(j),t.setVolume(j)},actions:l.jsxs(l.Fragment,{children:[l.jsx(vX,{}),l.jsx("button",{onClick:()=>g(!0),disabled:!r,"aria-label":"Now Playing",title:"Now Playing",className:bX,children:l.jsx(Op,{className:"size-4"})})]})})}),x&&r&&b&&l.jsx(mX,{labels:gX,track:b,playing:t.playing,currentTime:n,duration:t.duration,volume:h,hasPrev:c,hasNext:d,onToggle:t.toggle,onPrev:()=>c&&t.playQueue(i,o-1,t.activeKind),onNext:()=>d&&t.playQueue(i,o+1,t.activeKind),onSeek:t.seek,onVolumeChange:j=>{m(j),t.setVolume(j)},onClose:()=>g(!1)})]})}function CX(e,t,n=!0){const r=p.useRef(t);r.current=t;const i=p.useRef(null),o=p.useRef([]);return p.useEffect(()=>{if(!n)return;const c=zk();let d=null,h=!1,m=1e3,x;const g=()=>{d=c.openSocket(e,{onOpen:()=>{m=1e3,i.current=d;for(const v of o.current.splice(0))d==null||d.send(v)},onMessage:v=>{try{r.current(JSON.parse(v))}catch{}},onClose:()=>{i.current===d&&(i.current=null),h||(x=setTimeout(g,m),m=Math.min(m*2,15e3))}})};return g(),()=>{h=!0,x&&clearTimeout(x),d==null||d.close(),i.current=null,o.current=[]}},[e,n]),c=>{const d=JSON.stringify(c),h=i.current;h?h.send(d):o.current.push(d)}}const kX=Ur("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-shadow duration-[400ms] hover:shadow-lg hover:shadow-black/30 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:bg-zinc-800 disabled:text-zinc-500 disabled:border-zinc-700 disabled:shadow-none disabled:hover:shadow-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow",destructive:"bg-destructive text-destructive-foreground shadow-sm",outline:"border border-zinc-700 bg-zinc-900 text-zinc-100 shadow-sm",secondary:"bg-zinc-800 text-zinc-100 shadow-sm",ghost:"text-zinc-200 hover:shadow-none hover:ring-1 hover:ring-white/10",link:"text-primary underline-offset-4 hover:underline hover:shadow-none"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),EA=p.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const c=r?Fi:"button";return l.jsx(c,{className:Y(kX({variant:t,size:n,className:e})),ref:o,...i})});EA.displayName="Button";function RA({...e}){return l.jsx(Nc,{"data-slot":"dialog",...e})}function NX({...e}){return l.jsx(Tc,{"data-slot":"dialog-portal",...e})}function AA({...e}){return l.jsx(Hi,{"data-slot":"dialog-close",...e})}function TX({className:e,...t}){return l.jsx(Wo,{"data-slot":"dialog-overlay",className:Y("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e),...t})}function MA({className:e,children:t,showCloseButton:n=!0,...r}){return l.jsxs(NX,{"data-slot":"dialog-portal",children:[l.jsx(TX,{}),l.jsxs(Xo,{"data-slot":"dialog-content",className:Y("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",e),...r,children:[t,n&&l.jsxs(Hi,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[l.jsx(Ui,{}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function DA({className:e,...t}){return l.jsx("div",{"data-slot":"dialog-header",className:Y("flex flex-col gap-2 text-center sm:text-left",e),...t})}function _A({className:e,showCloseButton:t=!1,children:n,...r}){return l.jsxs("div",{"data-slot":"dialog-footer",className:Y("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r,children:[n,t&&l.jsx(Hi,{asChild:!0,children:l.jsx(EA,{variant:"outline",children:"Close"})})]})}function OA({className:e,...t}){return l.jsx(Rc,{"data-slot":"dialog-title",className:Y("text-lg leading-none font-semibold",e),...t})}function zA({className:e,...t}){return l.jsx(Ac,{"data-slot":"dialog-description",className:Y("text-sm text-muted-foreground",e),...t})}function EX(e){const{renaming:t,deleting:n,renameLabel:r,onRenameLabelChange:i,onCloseRename:o,onCloseDelete:c,onConfirmRename:d,onConfirmDelete:h,renameSaving:m,deleteSaving:x,renameTitle:g,renameDesc:v,nameLabel:S,deleteTitle:b,deleteBody:j}=e;return l.jsxs(l.Fragment,{children:[l.jsx(RA,{open:t!==null,onOpenChange:C=>{C||o()},children:l.jsx(MA,{children:l.jsxs("form",{className:"flex flex-col gap-4",onSubmit:C=>{C.preventDefault(),d()},children:[l.jsxs(DA,{children:[l.jsx(OA,{children:g}),l.jsx(zA,{children:v})]}),l.jsx("div",{className:"px-4 py-2",children:l.jsx(Jt,{"aria-label":S,size:"xl",value:r,onChange:C=>i(C.target.value),autoFocus:!0})}),l.jsxs(_A,{children:[l.jsx(AA,{asChild:!0,children:l.jsx(Ne,{type:"button",variant:"neutral",size:"large",disabled:m,children:"取消"})}),l.jsx(Ne,{type:"submit",size:"large",disabled:m||!r.trim(),children:m?"保存中…":"保存"})]})]})})}),l.jsx(RA,{open:n!==null,onOpenChange:C=>{C||c()},children:l.jsxs(MA,{children:[l.jsxs(DA,{children:[l.jsx(OA,{children:b}),l.jsx(zA,{children:j((n==null?void 0:n.label)??"")})]}),l.jsxs(_A,{children:[l.jsx(AA,{asChild:!0,children:l.jsx(Ne,{type:"button",variant:"neutral",size:"large",disabled:x,children:"取消"})}),l.jsx(Ne,{type:"button",variant:"destructive",size:"large",disabled:x,onClick:h,children:x?"删除中…":"删除"})]})]})})]})}function RX(e){var n;const t=((n=e.content)==null?void 0:n.media)??[];return!t.some(r=>r.kind==="audio")&&t.some(r=>r.kind==="link"&&!!r.track_id)}function AX(e){var t;for(const n of((t=e.content)==null?void 0:t.media)??[]){if(n.kind==="audio"&&n.poster)return n.poster;if(n.kind==="link"&&n.image)return n.image;if(n.kind==="image"&&n.url)return n.url}}function MX(e){const t=(e.sources??[]).map(n=>{var r,i;return((r=n.source)==null?void 0:r.id)||((i=n.source)==null?void 0:i.pluginId)||""}).join(" ").toLowerCase();return t.includes("163")||t.includes("netease")?"网易云":t.includes("qqmusic")||t.includes("/qq/")?"QQ音乐":t.includes("spotify")?"Spotify":t.includes("youtube")||t.includes("ytmusic")?"YouTube":""}const Ru="__liked_songs__",DX=4,PA="grid grid-cols-[repeat(auto-fill,minmax(max(140px,calc((100%-60px)/6)),1fr))] gap-3";function LA(e){const[,t,n,...r]=e.split("/");return t!=="music"?{kind:"home"}:n==="liked"?{kind:"liked"}:n==="playlist"&&r[0]?{kind:"playlist",id:decodeURIComponent(r[0])}:n==="collection"&&r[0]?{kind:"collection",id:decodeURIComponent(r.join("/"))}:n==="search"&&r[0]?{kind:"search",q:decodeURIComponent(r.join("/"))}:{kind:"home"}}function _X(e){return e.kind==="liked"?"/music/liked":e.kind==="playlist"?"/music/playlist/"+encodeURIComponent(e.id):e.kind==="collection"?"/music/collection/"+encodeURIComponent(e.id):e.kind==="search"?"/music/search/"+encodeURIComponent(e.q):"/music"}function OX(e){return e.isCollection||e.sel&&(e.selStream||e.isLikedPlaylist)?"track-list":!e.channelsLoaded&&!e.isLikedPlaylist?"loading":"grid"}function Yy(e,t){Ge.error(e,{description:t,action:{label:"复制错误",onClick:()=>{var n;return void((n=navigator.clipboard)==null?void 0:n.writeText(t))}}})}const ga="group-data-[state=selected]/table-row:text-primary-foreground",Nl="group-data-[state=selected]/table-row:text-primary-foreground/80";function IA({origin:e}){const t=e.kind==="netdisk"?"bg-sky-500/15 text-sky-500":"bg-amber-500/15 text-amber-500",n=e.kind==="netdisk"?"来自挂载的网盘目录,文件在盘里直接播":"源站标记为付费集(与能不能播无关——网盘补上音频后依然是付费集)";return l.jsx("span",{title:n,className:Y("shrink-0 rounded px-1 py-px text-[9px] font-medium",t,"group-data-[state=selected]/table-row:bg-white/20",ga),children:e.label})}function zX(){return l.jsxs("span",{className:"eq","aria-hidden":!0,children:[l.jsx("i",{}),l.jsx("i",{}),l.jsx("i",{})]})}function Au(e){if(!e)return null;const t=e.indexOf(":");return t<=0?null:{platform:e.slice(0,t),trackId:e.slice(t+1)}}function Ph(e){return!!(e.sourceItem||e.likeRef||Au(e.trackKey))}function $A(e,t){if(!e||e.id!==void 0&&t.id!==void 0&&e.id!==t.id)return t;const n=e.downloadedBytes,r=t.downloadedBytes,i=n!==void 0&&r!==void 0?Math.max(n,r):r??n,o=e.totalBytes,c=t.totalBytes,d=o!==void 0&&c!==void 0?Math.max(o,c):c??o;return{...t,downloadedBytes:i,totalBytes:d,failedAt:t.state==="failed"?e.failedAt??t.failedAt:t.failedAt}}function PX({job:e}){const t=e.downloadedBytes??0,n=e.totalBytes??0,r=t>0,i=n>0?Math.max(0,Math.min(1,t/n)):r?.64:0,o=6,c=2*Math.PI*o,d=r?"下载中":"探测下载源";return r?l.jsxs("svg",{className:"size-4 shrink-0 -rotate-90 text-primary",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[l.jsx("title",{children:d}),l.jsx("circle",{cx:"8",cy:"8",r:o,className:"stroke-muted-foreground/25",strokeWidth:"2"}),l.jsx("circle",{cx:"8",cy:"8",r:o,stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:c,strokeDashoffset:c*(1-i)})]}):l.jsx("span",{className:Y("inline-flex size-4 shrink-0 items-center justify-center text-muted-foreground/75",Nl),title:d,children:l.jsx(Sr,{className:"size-4 animate-spin",strokeWidth:2})})}function BA({row:e,canDownload:t,active:n,onDownload:r}){const i=!t||n;return{disabled:i,onSelect:o=>{o.stopPropagation(),i||r==null||r(e)}}}function UA({conn:e,collectKey:t,meta:n,anchorStreamId:r,MenuItem:i,onChanged:o}){const[c,d]=p.useState([]),[h,m]=p.useState(new Set),[x,g]=p.useState("");p.useEffect(()=>{let b=!0;return Promise.all([be.collections(e,"audio"),be.whereCollected(e,t)]).then(([j,C])=>{b&&(d([...j.filter(k=>!k.system)].sort((k,N)=>+(N.anchorStreamId===r)-+(k.anchorStreamId===r))),m(new Set(C.collectionIds)))}).catch(()=>{}),()=>{b=!1}},[]);const v=(b,j)=>{m(C=>{const k=new Set(C);return j?k.delete(b):k.add(b),k}),(j?be.removeFromCollection(e,b,t):be.addToCollection(e,b,t,n)).then(()=>o==null?void 0:o()).catch(()=>m(C=>{const k=new Set(C);return j?k.add(b):k.delete(b),k}))},S=async()=>{const b=x.trim();if(!b)return;const j=await be.createCollection(e,"audio",b,r??void 0);g(""),d(C=>[j,...C]),v(j.id,!1),o==null||o()};return l.jsxs(l.Fragment,{children:[c.map(b=>{const j=h.has(b.id);return l.jsxs(i,{onSelect:C=>{C.preventDefault(),v(b.id,j)},children:[l.jsx(Ns,{className:Y("size-4",j?"opacity-100":"opacity-0")}),l.jsx("span",{className:"truncate",children:b.label})]},b.id)}),l.jsx("div",{className:"border-t border-[var(--acr-border-soft)] px-1.5 py-1",children:l.jsx(Jt,{placeholder:"新建播单…",value:x,onChange:b=>g(b.target.value),onKeyDown:b=>{b.stopPropagation(),b.key==="Enter"&&S()},onClick:b=>b.stopPropagation()})})]})}function LX({row:e,canDownload:t,job:n,isArchived:r,onDownload:i,collect:o}){const c=(n==null?void 0:n.state)==="queued"||(n==null?void 0:n.state)==="running",d=r?"重新下载":c?"下载中":"下载到本地",h=BA({row:e,canDownload:t,active:c,onDownload:i});return l.jsxs(Cx,{children:[l.jsx(kx,{asChild:!0,children:l.jsx("button",{type:"button",onClick:m=>m.stopPropagation(),className:"mx-auto inline-flex size-6 items-center justify-center rounded-full text-muted-foreground/70 opacity-0 transition-all hover:text-foreground group-hover/item:opacity-100 focus-visible:opacity-100 data-[state=open]:opacity-100","aria-label":"歌曲操作",title:"歌曲操作",children:l.jsx(Ap,{className:"size-4"})})}),l.jsxs(Ff,{align:"end",size:"sm",className:"w-36",children:[l.jsxs(ms,{...h,children:[l.jsx(vc,{}),l.jsx("span",{children:d})]}),o&&Su(e,o.streamId)&&l.jsxs(Vk,{children:[l.jsxs(Nx,{children:[l.jsx(_p,{}),l.jsx("span",{children:"加入播单"})]}),l.jsx(Tx,{className:"w-48",children:l.jsx(UA,{conn:o.conn,collectKey:Su(e,o.streamId),meta:{title:e.title,poster:e.poster,artist:e.author,album:e.album,durationS:e.durationS,sourceUrl:e.sourceUrl},anchorStreamId:o.streamId,MenuItem:ms,onChanged:o.onChanged})})]})]})]})}function VA({row:e,canDownload:t,job:n,isArchived:r,onDownload:i,collect:o,children:c}){const d=(n==null?void 0:n.state)==="queued"||(n==null?void 0:n.state)==="running",h=r?"重新下载":d?"下载中":"下载到本地",m=BA({row:e,canDownload:t,active:d,onDownload:i});return l.jsxs(Nu,{children:[l.jsx(Tu,{asChild:!0,children:c}),l.jsxs(kl,{size:"sm",className:"w-36",children:[l.jsxs(Er,{onSelect:()=>void O1({id:e.id,title:e.title,...e.author!==void 0?{author:e.author}:{}}),children:[l.jsx(Rp,{}),l.jsx("span",{children:"在对话中引用"})]}),l.jsxs(Er,{...m,children:[l.jsx(vc,{}),l.jsx("span",{children:h})]}),o&&Su(e,o.streamId)&&l.jsxs(qW,{children:[l.jsxs(gA,{children:[l.jsx(_p,{}),l.jsx("span",{children:"加入播单"})]}),l.jsx(xA,{className:"w-48",children:l.jsx(UA,{conn:o.conn,collectKey:Su(e,o.streamId),meta:{title:e.title,poster:e.poster,artist:e.author,album:e.album,durationS:e.durationS,sourceUrl:e.sourceUrl},anchorStreamId:o.streamId,MenuItem:Er,onChanged:o.onChanged})})]})]})]})}function IX({row:e,baseUrl:t}){const n=Dy(e),r=BR(e);return l.jsxs("div",{className:"flex flex-col gap-2.5",children:[l.jsxs("div",{className:"flex items-start gap-2.5",children:[e.poster&&l.jsx("img",{src:is(t,e.poster),alt:"",loading:"lazy",decoding:"async",className:"size-11 shrink-0 rounded-md object-cover ring-1 ring-[var(--acr-border-soft)]"}),l.jsx("div",{className:"min-w-0 break-words text-[13px] font-medium leading-snug",children:e.title})]}),n.length>0&&l.jsx("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-[11px]",children:n.map(i=>l.jsxs(p.Fragment,{children:[l.jsx("dt",{className:"text-muted-foreground",children:i.label}),l.jsx("dd",{className:"min-w-0 break-words text-foreground/90",children:i.value})]},i.label))}),r&&l.jsx("p",{className:"line-clamp-6 whitespace-pre-line text-[11px] leading-relaxed text-muted-foreground",children:r}),e.sourceUrl&&l.jsx("a",{href:e.sourceUrl,target:"_blank",rel:"noreferrer",onClick:i=>i.stopPropagation(),className:"truncate text-[11px] text-primary hover:underline",children:e.sourceUrl})]})}function $X({row:e,baseUrl:t}){return l.jsxs(Px,{openDelay:200,closeDelay:120,children:[l.jsx(Lx,{asChild:!0,children:l.jsx("button",{type:"button","aria-label":"节目信息",onClick:n=>n.stopPropagation(),onKeyDown:n=>n.stopPropagation(),className:Y("inline-flex size-4 shrink-0 items-center justify-center rounded-full text-muted-foreground/70 opacity-0 transition-opacity","group-hover/item:opacity-100 focus-visible:opacity-100 focus-visible:outline-none hover:text-foreground",Nl),children:l.jsx(Dp,{className:"size-3.5"})})}),l.jsx(Ix,{align:"start",side:"bottom",className:"w-80",children:l.jsx(IX,{row:e,baseUrl:t})})]})}const BX=53,UX=200,VX=p.memo(function({row:t,index:n,baseUrl:r,isCurrent:i,isPlaying:o,isLiked:c,job:d,isArchived:h,canDownload:m,selectMode:x,selected:g,onToggleLike:v,onToggleSelect:S,onDownload:b,onPlay:j,collect:C,rowRef:k,drag:N}){const E=N?{draggable:!0,onDragStart:M=>{M.dataTransfer.effectAllowed="move",N.onDragStart(n)},onDragEnter:()=>N.onDragEnter(n),onDragOver:M=>{M.preventDefault(),M.dataTransfer.dropEffect="move"},onDrop:M=>{M.preventDefault(),N.onDragEnd()},onDragEnd:()=>N.onDragEnd()}:{},R=N!=null&&N.isDropTarget?"[&>td]:border-t-2 [&>td]:border-t-primary":"",A=t.poster?l.jsx("img",{src:is(r,t.poster),alt:"",loading:"lazy",decoding:"async",className:"size-9 shrink-0 rounded-md object-cover shadow-sm ring-1 ring-[var(--acr-border-soft)]"}):l.jsx("span",{className:Y("flex size-9 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground shadow-sm ring-1 ring-[var(--acr-border-soft)]","group-data-[state=selected]/table-row:bg-white/15",ga),children:l.jsx(N1,{className:"size-4"})}),_=(d==null?void 0:d.state)==="queued"||(d==null?void 0:d.state)==="running",z=!!(d!=null&&d.failedAt)&&Date.now()-d.failedAt<5e3,D=_&&d?l.jsx(PX,{job:d}):t.trackKey&&h?l.jsx("span",{className:Y("inline-flex size-4 shrink-0 items-center justify-center text-emerald-500/90",ga),title:"已下载",children:l.jsx(iL,{className:"size-4",strokeWidth:2})}):z?l.jsx("span",{className:Y("inline-flex size-4 shrink-0 items-center justify-center text-destructive/90",ga),title:d!=null&&d.lastError?`下载失败:${d.lastError}`:"下载失败",children:l.jsx(aL,{className:"size-4",strokeWidth:2})}):null,V=l.jsx(LX,{row:t,canDownload:m,job:d,isArchived:h,onDownload:b,collect:C}),I=t.author?l.jsxs("div",{className:Y("flex min-w-0 items-center gap-1.5 text-[11px] text-muted-foreground",Nl),children:[D,l.jsx("span",{className:"truncate",children:t.author})]}):D?l.jsx("div",{className:Y("flex min-w-0 items-center gap-1.5 text-[11px] text-muted-foreground",Nl),children:D}):null,Q=CY(t)?l.jsx($X,{row:t,baseUrl:r}):null,B=t.likeRef?`${t.likeRef.platform}:${t.likeRef.trackId}`:t.trackKey,H=l.jsx("button",{onClick:M=>{M.stopPropagation(),v(t)},disabled:!B,className:Y("mx-auto inline-flex size-6 items-center justify-center rounded-full text-muted-foreground/70 transition-colors hover:text-foreground",Nl,"group-data-[state=selected]/table-row:hover:text-primary-foreground"),title:c?"取消喜欢":"喜欢",children:l.jsx(Bd,{className:Y("size-4",c&&"fill-primary text-primary",c&&"group-data-[state=selected]/table-row:fill-current",c&&ga)})}),ee=l.jsx("span",{className:Y("text-right text-[12px] tabular-nums text-muted-foreground",Nl),children:t.durationS?Ah(t.durationS):"--:--"}),W=l.jsx("button",{onClick:M=>{M.stopPropagation(),S==null||S(t)},"aria-label":g?"取消选择":"选择",className:Y("mx-auto inline-flex size-4.5 items-center justify-center rounded-full border transition-colors",g?"border-primary bg-primary text-primary-foreground group-data-[state=selected]/table-row:border-primary-foreground group-data-[state=selected]/table-row:bg-primary-foreground group-data-[state=selected]/table-row:text-primary":"border-[var(--acr-border)] text-transparent hover:border-foreground/50 group-data-[state=selected]/table-row:border-primary-foreground/50"),children:l.jsx(Ns,{className:"size-3",strokeWidth:3})});if(t.track&&!t.muted){const M=()=>{x?S==null||S(t):j(t)};return l.jsx(VA,{row:t,canDownload:m,job:d,isArchived:h,onDownload:b,collect:C,children:l.jsxs(Cu,{ref:k,role:"button",tabIndex:0,...E,onClick:M,onKeyDown:U=>{(U.key==="Enter"||U.key===" ")&&(U.preventDefault(),M())},"data-state":i?"selected":void 0,className:Y("group group/item cursor-pointer outline-none","focus-visible:[&>td]:bg-[var(--acr-hover)] focus-visible:[&>td]:border-b-transparent","focus-visible:[&>td:first-child]:rounded-l-[7px] focus-visible:[&>td:last-child]:rounded-r-[7px]",R),children:[l.jsx(Yr,{className:"text-center",children:l.jsx("span",{className:"relative flex h-5 items-center justify-center text-xs",children:x?W:o?l.jsx("span",{className:Y("text-primary",ga),children:l.jsx(zX,{})}):i?l.jsx(qn,{className:Y("size-3.5 fill-current text-primary",ga)}):l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"tabular-nums text-muted-foreground group-hover:opacity-0",children:n+1}),l.jsx(qn,{className:"absolute size-3.5 fill-current text-foreground opacity-0 group-hover:opacity-100"})]})})}),l.jsx(Yr,{children:l.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[A,l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:Y("flex items-center gap-1.5 text-[13px]",i?"font-medium text-primary":"text-foreground",ga),children:[l.jsx("span",{className:"truncate",children:t.title}),t.vip&&l.jsx("span",{className:Y("shrink-0 rounded bg-amber-500/15 px-1 py-px text-[9px] font-medium text-amber-500","group-data-[state=selected]/table-row:bg-white/20",ga),children:"VIP"}),t.origin&&l.jsx(IA,{origin:t.origin}),Q]}),I]})]})}),l.jsx(Yr,{className:"truncate text-[12px] text-muted-foreground",children:t.album}),l.jsx(Yr,{className:"text-center",children:H}),l.jsx(Yr,{className:"text-right",children:l.jsxs("div",{className:"flex items-center justify-end gap-1",children:[ee,V]})})]})})}return l.jsx(VA,{row:t,canDownload:m,job:d,isArchived:h,onDownload:b,collect:C,children:l.jsxs(Cu,{...E,className:Y("group/item opacity-50",R),children:[l.jsx(Yr,{className:"text-center text-xs text-muted-foreground/60",children:x?W:n+1}),l.jsx(Yr,{children:l.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[A,l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-[13px] text-foreground/70",children:[l.jsx("span",{className:"truncate",children:t.title}),t.origin&&l.jsx(IA,{origin:t.origin}),Q]}),I]})]})}),l.jsx(Yr,{className:"truncate text-[12px] text-muted-foreground",children:t.album}),l.jsx(Yr,{}),l.jsx(Yr,{className:"text-right",children:l.jsxs("div",{className:"flex items-center justify-end gap-1",children:[l.jsx("span",{className:"text-right text-[12px] tabular-nums text-muted-foreground",children:t.durationS?Ah(t.durationS):"--:--"}),V]})})]})})});function FA({height:e,side:t}){return l.jsx("tr",{"aria-hidden":!0,"data-testid":`track-vpad-${t}`,style:{height:e,pointerEvents:"none"},children:l.jsx("td",{colSpan:5,style:{height:e,padding:0,borderBottomWidth:0}})})}function HA({rows:e,queue:t,stage:n,baseUrl:r,liked:i,toggleLike:o,jobs:c={},archived:d={},onDownload:h,busy:m,busyText:x="加载中…",emptyText:g,selectMode:v,selectedIds:S,onToggleSelect:b,collect:j,jumpKey:C,onReorder:k}){var Fe;const N=p.useRef({toggleLike:o,onToggleSelect:b,onDownload:h,collect:j,stage:n,queue:t});N.current={toggleLike:o,onToggleSelect:b,onDownload:h,collect:j,stage:n,queue:t};const E=p.useCallback(fe=>N.current.toggleLike(fe),[]),R=p.useCallback(fe=>{var Se,ye;return(ye=(Se=N.current).onToggleSelect)==null?void 0:ye.call(Se,fe)},[]),A=p.useCallback(fe=>{var Se,ye;return(ye=(Se=N.current).onDownload)==null?void 0:ye.call(Se,fe)},[]),_=p.useCallback(()=>{var fe,Se;return(Se=(fe=N.current.collect)==null?void 0:fe.onChanged)==null?void 0:Se.call(fe)},[]),z=p.useCallback(fe=>{var Qe;const{stage:Se,queue:ye}=N.current;fe.track&&((Qe=Se.current)==null?void 0:Qe.id)===fe.track.id?Se.toggle():Se.playQueue(ye,fe.playIndex,"music")},[]),D=b?R:void 0,V=h?A:void 0,I=j==null?void 0:j.conn,Q=(j==null?void 0:j.streamId)??null,B=p.useMemo(()=>I?{conn:I,streamId:Q,onChanged:_}:void 0,[I,Q,_]),[H,ee]=p.useState(null),W=p.useCallback(fe=>{ee(fe?fA(fe):null)},[]),[M,U]=p.useState(null),[K,ne]=p.useState(null),q=p.useCallback(fe=>{U(fe),ne(fe)},[]),P=p.useCallback(fe=>ne(fe),[]),L=p.useRef({onReorder:k,dragFrom:M,dragOver:K});L.current={onReorder:k,dragFrom:M,dragOver:K};const G=p.useCallback(()=>{const{onReorder:fe,dragFrom:Se,dragOver:ye}=L.current;fe&&Se!==null&&ye!==null&&Se!==ye&&fe(Se,ye),U(null),ne(null)},[]),J=!m&&e.length>UX,$=nY({count:J?e.length:0,getScrollElement:()=>H,estimateSize:()=>BX,overscan:10}),se=J?$.getVirtualItems():[],oe=se.length?se[0].start:0,ie=se.length?$.getTotalSize()-se[se.length-1].end:0,Z=J?se.map(fe=>({row:e[fe.index],index:fe.index})):e.map((fe,Se)=>({row:fe,index:Se})),ve=p.useRef(null),Ee=p.useRef(null),Te=(Fe=n.current)==null?void 0:Fe.id,Ie=p.useMemo(()=>Te?e.findIndex(fe=>{var Se;return!fe.muted&&((Se=fe.track)==null?void 0:Se.id)===Te}):-1,[e,Te]);return p.useEffect(()=>{if(Ee.current===C||m||!Te)return;if(J){if(Ie<0||!H)return;Ee.current=C??null,$.scrollToIndex(Ie,{align:"center"});return}const fe=ve.current;fe&&(Ee.current=C??null,fe.scrollIntoView({block:"center"}))},[C,m,Te,e,J,Ie,H,$]),p.useEffect(()=>{Ee.current!==C&&(Ee.current=null)},[C]),l.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:l.jsx(Fy,{ref:W,className:"min-h-0 flex-1 px-2 py-1.5 pb-24 scrollbar-mac",children:l.jsxs(VW,{scrollable:!1,className:"table-fixed",children:[l.jsx(FW,{sticky:!0,children:l.jsxs(Cu,{children:[l.jsx(ku,{className:"w-8 text-center",children:"#"}),l.jsx(ku,{children:"标题"}),l.jsx(ku,{className:"w-[28%]",children:"专辑"}),l.jsx(ku,{className:"w-10 text-center",children:"喜欢"}),l.jsx(ku,{className:"w-[84px] text-right",children:"时长"})]})}),l.jsxs(HW,{children:[m&&l.jsx(Cu,{children:l.jsx(Yr,{colSpan:5,className:"whitespace-normal py-16 text-center text-sm text-muted-foreground",children:l.jsxs("span",{className:"inline-flex items-center gap-2",children:[l.jsx(Sr,{className:"size-5 animate-spin"}),x]})})}),oe>0&&l.jsx(FA,{height:oe,side:"top"}),!m&&Z.map(({row:fe,index:Se})=>{var re;const ye=fe.trackKey?c[fe.trackKey]:void 0,Qe=fe.likeRef?`${fe.likeRef.platform}:${fe.likeRef.trackId}`:fe.trackKey,nt=!!fe.track&&!fe.muted&&((re=n.current)==null?void 0:re.id)===fe.track.id;return l.jsx(VX,{row:fe,index:Se,baseUrl:r,isCurrent:nt,isPlaying:nt&&n.playing,isLiked:Qe?i.has(Qe):!1,job:ye,isArchived:fe.trackKey?d[fe.trackKey]||!!(ye!=null&&ye.archived):!1,canDownload:!!h&&Ph(fe),selectMode:!!v,selected:!!(S!=null&&S.has(fe.id)),onToggleLike:E,onToggleSelect:D,onDownload:V,onPlay:z,collect:B,rowRef:nt?ve:void 0,drag:k&&!v?{onDragStart:q,onDragEnter:P,onDragEnd:G,isDropTarget:M!==null&&K===Se&&K!==M}:void 0},fe.id)}),ie>0&&l.jsx(FA,{height:ie,side:"bottom"}),!m&&e.length===0&&l.jsx(Cu,{children:l.jsx(Yr,{colSpan:5,className:"whitespace-normal py-6 text-center text-sm text-muted-foreground",children:g})})]})]})})})}const FX={downloadAll:l.jsx(vc,{}),sync:l.jsx(Ud,{}),netdisk:l.jsx(fL,{}),exportM3u:l.jsx(Xs,{}),rename:l.jsx(yc,{}),remove:l.jsx(Po,{})};function HX({playDisabled:e,onPlayAll:t,selectMode:n,onToggleSelectMode:r,onDownloadAll:i,sync:o,onNetdisk:c,onRename:d,onRemove:h,onExportM3u:m}){const x={downloadAll:!!i,sync:o?{on:o.on}:null,netdisk:!!c,rename:!!d,remove:!!h,exportM3u:!!m},g=kY(x),v="[&>span:first-child]:hidden pl-2 pr-2",S={downloadAll:i,sync:o==null?void 0:o.onToggle,netdisk:c,rename:d,remove:h,exportM3u:m};return l.jsxs(l.Fragment,{children:[l.jsxs(Ne,{size:"small",disabled:e,onClick:t,children:[l.jsx(qn,{className:"size-4"})," 播放全部"]}),l.jsxs(Ne,{size:"small",variant:n?"default":"neutral","aria-pressed":n,onClick:r,children:[l.jsx(mL,{className:"size-4"})," 多选"]}),g.length>0&&l.jsxs(Cx,{children:[l.jsx(kx,{asChild:!0,children:l.jsx(Ne,{size:"small",variant:"neutral","aria-label":"更多操作",children:l.jsx(Ap,{className:"size-4"})})}),l.jsx(Ff,{align:"start",size:"sm",className:"w-44",children:g.map(b=>{if(b.kind==="separator")return l.jsx(tu,{},b.key);const j=FX[b.key];return b.kind==="checkbox"?l.jsxs(qk,{checked:b.checked,className:v,onSelect:C=>{var k;C.preventDefault(),(k=S[b.key])==null||k.call(S)},children:[j,b.label,b.checked&&l.jsx(Ns,{className:"ml-auto size-3.5"})]},b.key):l.jsxs(ms,{variant:b.destructive?"destructive":"default",onSelect:()=>{var C;return(C=S[b.key])==null?void 0:C.call(S)},children:[j,b.label]},b.key)})})]})]})}function qX({conn:e,count:t,anchorStreamId:n,onPick:r,onDownload:i,onCancel:o}){const[c,d]=p.useState(!1),[h,m]=p.useState([]),[x,g]=p.useState("");p.useEffect(()=>{c&&be.collections(e,"audio").then(S=>{const b=[...S.filter(j=>!j.system)].sort((j,C)=>+(C.anchorStreamId===n)-+(j.anchorStreamId===n));m(b)}).catch(()=>m([]))},[c,e,n]);const v=async()=>{const S=x.trim();if(!S)return;const b=await be.createCollection(e,"audio",S,n??void 0);g(""),d(!1),r(b.id)};return l.jsxs("div",{className:"pointer-events-auto absolute bottom-24 left-1/2 z-30 flex -translate-x-1/2 items-center gap-3 rounded-full bg-[var(--acr-panel)] px-4 py-2 shadow-[0_0_0_1px_rgba(190,190,190,0.16),0_16px_48px_rgba(0,0,0,0.45)] backdrop-blur-xl",children:[l.jsxs("span",{className:"text-[13px] tabular-nums",children:["已选 ",t," 首"]}),l.jsxs(Ne,{size:"small",variant:"neutral",onClick:i,children:[l.jsx(vc,{className:"size-4"})," 下载"]}),l.jsxs(fy,{open:c,onOpenChange:d,children:[l.jsx(hy,{asChild:!0,children:l.jsxs(Ne,{size:"small",children:[l.jsx(_p,{className:"size-4"})," 加入播单"]})}),l.jsxs(wh,{align:"center",side:"top",className:"w-56 p-1.5",children:[l.jsxs("div",{className:"flex max-h-64 flex-col gap-0.5 overflow-y-auto scrollbar-mac",children:[h.map(S=>l.jsxs("button",{onClick:()=>{d(!1),r(S.id)},className:"flex items-center gap-2 rounded-md px-2 py-1.5 text-left text-[13px] hover:bg-[var(--acr-hover)]",children:[l.jsx(Xs,{className:"size-4 shrink-0 text-muted-foreground"}),l.jsx("span",{className:"min-w-0 flex-1 truncate",children:S.label}),S.anchorStreamId===n&&l.jsx("span",{className:"text-[10px] text-muted-foreground",children:"本节目"})]},S.id)),h.length===0&&l.jsx("div",{className:"px-2 py-2 text-[12px] text-muted-foreground",children:"还没有播单。"})]}),l.jsx("div",{className:"mt-1 border-t border-[var(--acr-border-soft)] pt-1.5",children:l.jsx(Jt,{placeholder:"新建播单…",value:x,onChange:S=>g(S.target.value),onKeyDown:S=>{S.key==="Enter"&&v()}})})]})]}),l.jsx(Ne,{size:"small",variant:"ghost",onClick:o,children:"取消"})]})}function KX({conn:e,channels:t,onChannelsChanged:n,onReload:r}){var Bu,ja,Jh;const i=Ay(),[o,c]=p.useState("content"),d=uA(),h=LA(d.pathname()),m=p.useMemo(()=>{const F=new Set,he=[];for(const Ae of t)for(const Ve of Ae.streams)F.has(Ve.id)||(F.add(Ve.id),he.push(Ve));return he},[t]),x=p.useMemo(()=>fY(m),[m]),g=p.useMemo(()=>new Map(m.map(F=>[F.id,F.description||F.id])),[m]),{selection:v,navigate:S}=BW(LA,_X),b=v.kind==="playlist"?v.id:v.kind==="liked"?Ru:null,j=v.kind==="collection",C=v.kind==="collection"?v.id:null,k=v.kind==="search"?v.q:"",N=UW("music:grid",fA),[E,R]=p.useState(h.kind==="search"?h.q:""),[A,_]=p.useState(""),[z,D]=p.useState(!1),[V,I]=p.useState([]),[Q,B]=p.useState(!1),[H,ee]=p.useState([]),[W,M]=p.useState([]),[U,K]=p.useState(!1),[ne,q]=p.useState(null),[P,L]=p.useState({}),[G,J]=p.useState({}),[$,se]=p.useState(!1),[oe,ie]=p.useState(null),[Z,ve]=p.useState(!1),[Ee,Te]=p.useState(new Set),[Ie,Fe]=p.useState(!1),[fe,Se]=p.useState(new Set),[ye,Qe]=p.useState([]),[nt,re]=p.useState(null),[_e,Pe]=p.useState(null),[Xe,ge]=p.useState(new Map),[Ye,je]=p.useState(null),[kt,zt]=p.useState(""),[Qn,hn]=p.useState(!1),[Zn,sn]=p.useState(null),[Jn,we]=p.useState(!1),[Oe,lt]=p.useState([]),[an,en]=p.useState(!1),[bt,Ft]=p.useState(""),jn=p.useRef({}),Me=p.useRef(P);Me.current=P;const Ue=p.useRef(b);Ue.current=b;const ke=()=>{be.collectionItems(e,kh.audioLiked).then(F=>{Te(new Set(F.map(he=>`${he.platform}:${he.trackId}`))),M(F)}).catch(()=>{})},ft=F=>{const he=F.likeRef??Au(F.trackKey);if(!he)return;const Ae=`${he.platform}:${he.trackId}`,Ve=Ee.has(Ae);Te(at=>{const Rt=new Set(at);return Ve?Rt.delete(Ae):Rt.add(Ae),Rt});const Ke={kind:"track",platform:he.platform,trackId:he.trackId};if(Ve){M(at=>at.filter(Rt=>`${Rt.platform}:${Rt.trackId}`!==Ae)),be.removeFromCollection(e,kh.audioLiked,Ke).catch(ke);return}const mt={key:`track:${he.platform}:${he.trackId}`,kind:"track",domain:"audio",platform:he.platform,trackId:he.trackId,title:F.title,artist:F.author,album:F.album,poster:F.poster,durationS:F.durationS,sourceUrl:F.sourceUrl,firstCollectedAt:Date.now()};M(at=>[mt,...at.filter(Rt=>`${Rt.platform}:${Rt.trackId}`!==Ae)]),be.addToCollection(e,kh.audioLiked,Ke,{title:F.title,artist:F.author,album:F.album,poster:F.poster,durationS:F.durationS,sourceUrl:F.sourceUrl}).then(at=>{M(Rt=>[at,...Rt.filter(ct=>`${ct.platform}:${ct.trackId}`!==Ae)])}).catch(ke)};p.useEffect(()=>{ke()},[e]);const Pt=()=>{be.collections(e,"audio").then(F=>lt(F.filter(he=>!he.system))).catch(()=>lt([]))};p.useEffect(()=>{Pt()},[e]),p.useEffect(()=>{if(Fe(!1),Se(new Set),!b||b===Ru){ee([]),q(b),_("");return}let F=!0;return K(!0),se(VR(_y(t,b))),L({}),J({}),_(""),be.items(e,{stream:b,limit:2e3}).then(he=>F&&ee(he)).catch(()=>F&&ee([])).finally(()=>{F&&(K(!1),q(b))}),()=>{F=!1}},[e,b]);const Qt=VR(_y(t,b));p.useEffect(()=>{!b||b===Ru||se(Qt)},[Qt,b]),p.useEffect(()=>{Sa(),re(null),Pe(null),ge(new Map)},[e,b]),p.useEffect(()=>{if(ge(new Map),Se(new Set),!nt||!b){Pe(null);return}let F=!0;return be.collectionItems(e,nt).then(async he=>{if(!F)return;Pe(he);const Ae=IR(he,b),Ve=new Map;await Promise.all([...Ae.fetchStreams.keys()].map(async Ke=>{const mt=await be.items(e,{stream:Ke,limit:2e3}).catch(()=>[]);for(const at of mt)Ve.set(at.id,at)})),F&&ge(Ve)}).catch(()=>{F&&(Pe([]),Ge.error("播单成员加载失败"))}),()=>{F=!1}},[e,nt,b]);const[An,At]=p.useState(null),[On,vs]=p.useState(new Map),[Ht,Mn]=p.useState(null),[xa,er]=p.useState(!1);p.useEffect(()=>{if(_(""),!C){At(null),vs(new Map),Mn(null),er(!1);return}let F=!0;return At(null),vs(new Map),er(!1),be.collections(e,"audio").then(he=>{F&&(Mn(he.find(Ae=>Ae.id===C&&!Ae.system)??null),er(!0))}).catch(()=>{F&&Ge.error("播单信息加载失败")}),be.collectionItems(e,C).then(async he=>{if(!F)return;At(he);const Ae=IR(he,""),Ve=new Map;await Promise.all([...Ae.fetchStreams.keys()].map(async Ke=>{const mt=await be.items(e,{stream:Ke,limit:2e3}).catch(()=>[]);for(const at of mt)Ve.set(at.id,at)})),F&&vs(Ve)}).catch(()=>{F&&(At([]),Ge.error("播单加载失败"))}),()=>{F=!1}},[e,C]);const{collectionRows:fr,collectionTracks:Yh}=p.useMemo(()=>{if(!An)return{collectionRows:null,collectionTracks:[]};const{rows:F,tracks:he}=$R(An,Ae=>On.get(Ae),e.baseUrl);return{collectionRows:F,collectionTracks:he}},[An,On,e.baseUrl]);p.useEffect(()=>{vY({selCollection:C,membersLoaded:An!==null,metaLoaded:xa,meta:Ht})&&S({kind:"home"})},[C,An,xa,Ht]);const Bs=j?An===null:b!=null&&b!==Ru&&ne!==b,Cn=p.useMemo(()=>{var F;return hY((F=t.flatMap(he=>he.streams).find(he=>he.id===b))==null?void 0:F.sources)},[t,b]),{rows:kn,playableTracks:Wr}=p.useMemo(()=>{const F=[];return{rows:gY(H,My).map(Ae=>{const Ve=Mh(Ae,e.baseUrl),Ke=Ve?F.push(Ve)-1:-1;return{item:Ae,track:Ve,playIndex:Ke}}),playableTracks:F}},[H,e.baseUrl]),ii=p.useMemo(()=>kn.map(({item:F,track:he,playIndex:Ae})=>{var Ke;const Ve=PR(F);return{id:F.id,title:My(F),author:typeof F.author=="string"?F.author:void 0,album:iY((Ke=F.content)==null?void 0:Ke.text),poster:(he==null?void 0:he.poster)??AX(F),durationS:he==null?void 0:he.durationS,track:he??void 0,playIndex:Ae,vip:RX(F),origin:LR(F,Cn),trackKey:Ve,likeRef:Au(Ve)??void 0,sourceUrl:F.url,muted:!he,sourceItem:F}}),[kn]);p.useEffect(()=>{Q&&!U&&Wr.length>0&&(i.playQueue(Wr,0,"music"),B(!1))},[Q,U,Wr]);const mn=_y(t,b),qt=b===Ru,Al=OX({sel:b,selStream:!!mn,isLikedPlaylist:qt,channelsLoaded:t.length>0,isCollection:v.kind==="collection"});async function ho(){if(!mn)return;const F=await be.items(e,{stream:mn.id,limit:2e3}).catch(()=>null);F&&ee(F)}const va=TY({isCollection:j,isLikedPlaylist:qt,streamId:b,collectionId:C}),oi=async()=>{if(va)try{const F=va.kind==="collection"?await be.exportCollectionPlaylist(e,va.id):await be.exportStreamPlaylist(e,va.id);ie(F)}catch{Ge.error("生成 m3u 失败")}},Xr=p.useMemo(()=>W.map(F=>({id:`liked:${F.platform}:${F.trackId}`,kind:"music",url:Dh(e.baseUrl,{platform:F.platform,trackId:F.trackId}),title:F.title,author:F.artist,poster:F.poster?is(e.baseUrl,F.poster):void 0,durationS:F.durationS})),[e.baseUrl,W]),Us=p.useMemo(()=>W.map((F,he)=>({id:`liked:${F.platform}:${F.trackId}`,title:F.title,author:F.artist,album:F.album,poster:F.poster,durationS:F.durationS,track:Xr[he],playIndex:he,trackKey:`${F.platform}:${F.trackId}`,likeRef:{platform:F.platform,trackId:F.trackId},sourceUrl:F.sourceUrl})),[W,Xr]),ya=p.useMemo(()=>new Map(H.map(F=>[F.id,F])),[H]),{scopeRows:Yt,scopeTracks:Wh}=p.useMemo(()=>{if(!_e)return{scopeRows:null,scopeTracks:[]};const{rows:F,tracks:he}=$R(_e,Ae=>ya.get(Ae)??Xe.get(Ae),e.baseUrl);return{scopeRows:F,scopeTracks:he}},[_e,ya,Xe,e.baseUrl]),Ml=p.useMemo(()=>xY(UR({collectionRows:fr,scopeRows:Yt,isLikedPlaylist:qt,likedRows:Us,tableRows:ii}),A),[fr,Yt,qt,Us,ii,A]),ba=p.useMemo(()=>{const F=j&&C&&An?{id:C,members:An,set:At}:qt?{id:kh.audioLiked,members:W,set:M}:null;if(!F||A.trim())return;const{id:he,members:Ae,set:Ve}=F;return(Ke,mt)=>{const at=bY(Ae,Ke,mt);at!==Ae&&(Ve(at),be.reorderCollection(e,he,at.map(Rt=>Rt.key)).catch(Rt=>{Ve(Ae),Ge.error("排序没保存",{description:Rt instanceof Error?Rt.message:String(Rt)})}))}},[j,C,An,qt,W,A,e]),Vs=fr?Yh:Yt?Wh:qt?Xr:Wr,zu=p.useMemo(()=>V.map(F=>({id:F.id,kind:"music",url:Dh(e.baseUrl,{platform:F.platform,trackId:F.trackId}),title:F.title,author:F.artist,poster:F.poster?is(e.baseUrl,F.poster):void 0,durationS:F.durationS})),[e.baseUrl,V]),Pu=p.useMemo(()=>V.map((F,he)=>({id:F.id,title:F.title,author:F.artist,album:F.album,poster:F.poster,durationS:F.durationS,track:zu[he],playIndex:he,trackKey:`${F.platform}:${F.trackId}`,likeRef:{platform:F.platform,trackId:F.trackId},sourceUrl:F.sourceUrl})),[V,zu]),Dl=qt?Us:k?Pu:ii,li=p.useMemo(()=>Dl.map(F=>F.likeRef??Au(F.trackKey)).filter(F=>!!F),[Dl]);p.useEffect(()=>{if(li.length===0){J({});return}let F=!0;return be.archiveStatus(e,li).then(he=>{F&&J(he.archived)}).catch(()=>{F&&J({})}),()=>{F=!1}},[e,li]);const wa=async(F={})=>{var at,Rt;const he=await be.downloadJobs(e),Ae={},Ve=new Map(Dl.map(ct=>[ct.trackKey,ct.title])),Ke=li.length?(await be.archiveStatus(e,li)).archived:{},mt=new Map;for(const ct of he.jobs){const jt=`${ct.platform}:${ct.track_id}`,mr=mt.get(jt);(!mr||ct.id>mr.id)&&mt.set(jt,ct)}for(const[ct,jt]of mt)if(Ae[ct]={id:jt.id,state:jt.state,attempts:jt.attempts,lastError:jt.last_error,downloadedBytes:jt.downloaded_bytes,totalBytes:jt.total_bytes,archived:jt.archived,failedAt:jt.state==="failed"?((at=P[ct])==null?void 0:at.id)===jt.id?(Rt=P[ct])==null?void 0:Rt.failedAt:jn.current[ct]==="queued"||jn.current[ct]==="running"?Date.now():void 0:void 0},F.notify){const mr=jn.current[ct],ys=mr==="queued"||mr==="running";ys&&jt.state==="done"&&!jt.archived&&!Ke[ct]?Yy("归档失败",`${Ve.get(ct)??ct}:归档文件不存在或已被移动`):ys&&jt.state==="failed"&&Yy("下载失败",`${Ve.get(ct)??ct}${jt.last_error?`:${jt.last_error}`:""}`)}jn.current=Object.fromEntries(Object.entries(Ae).map(([ct,jt])=>[ct,jt.state])),L(ct=>{const jt={...ct},mr=new Set(Object.keys(Ae));for(const[ys,Fs]of Object.entries(Ae))jt[ys]=$A(ct[ys],Fs);for(const[ys,Fs]of Object.entries(ct))!mr.has(ys)&&(Fs.state==="queued"||Fs.state==="running"||Fs.failedAt)&&(jt[ys]=Fs);return jt}),J(ct=>({...ct,...Ke}))};p.useEffect(()=>{let F=!0;const he=()=>wa({notify:!0}).catch(()=>{});he();const Ae=setInterval(()=>{if(!F)return;Object.values(Me.current).some(Ke=>Ke.state==="queued"||Ke.state==="running")&&he()},5e3);return()=>{F=!1,clearInterval(Ae)}},[e,li]),CX(be.wsUrl(e),p.useCallback(F=>{if(F.type!=="audio-download")return;const he=`${F.job.platform}:${F.job.track_id}`;L(Ae=>{var mt,at;const Ve=$A(Ae[he],{id:F.job.id,state:F.job.state,attempts:F.job.attempts,lastError:F.job.last_error,downloadedBytes:F.job.downloaded_bytes,totalBytes:F.job.total_bytes,archived:F.job.archived,failedAt:F.job.state==="failed"?((mt=Ae[he])==null?void 0:mt.id)===F.job.id?(at=Ae[he])==null?void 0:at.failedAt:Date.now():void 0}),Ke=Ae[he];return(Ke==null?void 0:Ke.id)===Ve.id&&Ke.state===Ve.state&&Ke.attempts===Ve.attempts&&Ke.lastError===Ve.lastError&&Ke.downloadedBytes===Ve.downloadedBytes&&Ke.totalBytes===Ve.totalBytes&&Ke.archived===Ve.archived&&Ke.failedAt===Ve.failedAt?Ae:{...Ae,[he]:Ve}}),F.job.archived&&J(Ae=>({...Ae,[he]:!0}))},[])),p.useEffect(()=>{const F=Object.entries(P).filter(([,Ve])=>Ve.state==="failed"&&Ve.failedAt);if(!F.length)return;const he=Math.max(250,Math.min(...F.map(([,Ve])=>Math.max(0,5e3-(Date.now()-(Ve.failedAt??0)))))),Ae=setTimeout(()=>{const Ve=Date.now();L(Ke=>{let mt=!1;const at={...Ke};for(const[Rt,ct]of Object.entries(at))ct.state==="failed"&&ct.failedAt&&Ve-ct.failedAt>=5e3&&(delete at[Rt],mt=!0);return mt?at:Ke})},he);return()=>clearTimeout(Ae)},[P]);const _l=F=>{const he=E.trim();if(!he){S({kind:"home"});return}R(he),S({kind:"search",q:he})};p.useEffect(()=>{if(!k){I([]),D(!1);return}R(k);let F=!0;return D(!0),be.musicSearch(e,k).then(he=>{F&&I(he)}).catch(()=>{F&&I([])}).finally(()=>{F&&D(!1)}),()=>{F=!1}},[e,k]);const Qr=async(F,he={})=>{const Ae=F.likeRef??Au(F.trackKey);if(!F.sourceItem&&!Ae)return{ok:!1};const Ve=F.trackKey;Ve&&he.optimistic&&L(Ke=>{const mt=Ke[Ve];return(mt==null?void 0:mt.state)==="queued"||(mt==null?void 0:mt.state)==="running"?Ke:{...Ke,[Ve]:{state:"queued"}}});try{return{ok:!0,enqueued:(await be.download(e,F.sourceItem?{itemId:F.sourceItem.id,skipArchived:he.skipArchived,force:he.force}:{track:{platform:Ae.platform,trackId:Ae.trackId,title:F.title,artist:F.author,album:F.album||void 0,pageUrl:F.sourceUrl},skipArchived:he.skipArchived,force:he.force})).enqueued}}catch(Ke){return Ve&&L(mt=>{const at={...mt};return delete at[Ve],at}),{ok:!1,error:Ke}}},tr=async F=>{const he=await Qr(F,{optimistic:!0,force:!0});if(he.ok){await wa().catch(()=>{});return}"error"in he&&Yy("加入下载队列失败",he.error instanceof Error?he.error.message:F.title)},Lu=async(F,he)=>{let Ae=0,Ve=0,Ke=0,mt=0;const at=async()=>{for(;mt<F.length;){const ct=F[mt++],jt=await Qr(ct,{skipArchived:!0});if(!jt.ok){Ve++;continue}jt.enqueued>0?Ae++:Ke++}};await Promise.all(Array.from({length:Math.min(DX,F.length)},()=>at())),await wa().catch(()=>{});const Rt=HR({succeeded:Ae,failed:Ve,skipped:he,archived:Ke});Rt.kind==="success"?Ge.success(Rt.text):Ge.error(Rt.text)},cb=F=>{Se(he=>{const Ae=new Set(he);return Ae.has(F.id)?Ae.delete(F.id):Ae.add(F.id),Ae})},Sa=()=>{if(!b||qt){Qe([]);return}const F=b;be.collections(e,"audio",F).then(he=>{F===Ue.current&&Qe(he)}).catch(()=>{F===Ue.current&&Qe([])})},Xh=async()=>{if(!Ye)return;const F=kt.trim();if(F){hn(!0);try{await be.renameCollection(e,Ye.id,F),C===Ye.id&&Mn(he=>he&&{...he,label:F}),je(null),Sa(),Pt()}catch{Ge.error("重命名失败")}finally{hn(!1)}}},Ol=async()=>{if(!Zn)return;const F=Zn.id;we(!0);try{await be.deleteCollection(e,F),nt===F&&re(null);const he=C===F;sn(null),Sa(),he&&S({kind:"home"}),Pt()}catch{Ge.error("删除失败")}finally{we(!1)}},zl=UR({collectionRows:fr,scopeRows:Yt,isLikedPlaylist:qt,likedRows:Us,tableRows:ii}),hr=!!nt&&!Yt,Iu=()=>{const F=NY({isCollection:j,isLikedPlaylist:qt,scopeId:nt,streamId:b});if(F.kind==="stream"){be.download(e,{stream:F.streamId,skipArchived:!0}).then(Ve=>{const Ke=HR({succeeded:Ve.enqueued,failed:0,skipped:0,archived:Ve.skipped});Ke.kind==="success"?Ge.success(Ke.text):Ge.error(Ke.text),wa().catch(()=>{})}).catch(()=>Ge.error("加入下载队列失败"));return}const{targets:he,skipped:Ae}=FR({rows:zl,canDownload:Ph});if(he.length===0){Ge.error("这个列表里没有可下载的曲目");return}Lu(he,Ae)},Qh=async F=>{const he=!qt&&b?b:null,Ve=zl.filter(Ke=>fe.has(Ke.id)).flatMap(Ke=>{const mt=Su(Ke,he);return mt?[{key:mt,title:Ke.title,poster:Ke.poster,artist:Ke.author,album:Ke.album,durationS:Ke.durationS,sourceUrl:Ke.sourceUrl}]:[]});if(Ve.length!==0)try{await be.addToCollectionBatch(e,F,Ve),Ge.success(`已加入播单:${Ve.length} 首`),Fe(!1),Se(new Set),Sa(),Pt()}catch{Ge.error("加入播单失败")}},$u=()=>{const{targets:F,skipped:he}=FR({rows:zl,canDownload:Ph,selection:{ids:fe,idOf:Ae=>Ae.id}});if(F.length===0){Ge.error("选中的曲目都没有可下载的来源");return}Lu(F,he),Fe(!1),Se(new Set)},ci=()=>{Sa(),Pt()},Zh=async()=>{const F=bt.trim();if(F)try{const he=await be.createCollection(e,"audio",F);en(!1),Ft(""),lt(Ae=>[...Ae,he]),Ge.success(`已创建播单:${F}`)}catch{Ge.error("创建播单失败")}};return l.jsxs("div",{className:"relative flex h-full min-h-0 flex-col",children:[Al==="loading"?l.jsxs("div",{className:"flex flex-1 items-center justify-center gap-2 text-sm text-muted-foreground",children:[l.jsx(Sr,{className:"size-5 animate-spin"})," 载入中…"]}):Al==="track-list"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center gap-3 border-b border-border px-4 py-3",children:[l.jsx(Ne,{icon:!0,size:"large",variant:"neutral","aria-label":"返回",onClick:()=>S({kind:"home"}),children:l.jsx(S1,{})}),(()=>{var he,Ae;const F=j?void 0:qt?(he=W[0])==null?void 0:he.poster:(mn==null?void 0:mn.image)??((Ae=Wr[0])==null?void 0:Ae.poster);return F?l.jsx("img",{src:is(e.baseUrl,F),alt:"",className:"size-12 shrink-0 rounded-md object-cover"}):l.jsx("span",{className:"flex size-12 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground",children:qt?l.jsx(Bd,{className:"size-5 fill-primary text-primary"}):l.jsx(Xs,{className:"size-5"})})})(),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("div",{className:"truncate text-[15px] font-bold",children:j?(Ht==null?void 0:Ht.label)??"播单":qt?"我喜欢的歌曲":(mn==null?void 0:mn.description)||(mn==null?void 0:mn.id)}),l.jsx("div",{className:"text-[11px] text-muted-foreground",children:j?A?`${Ml.length} / ${(fr==null?void 0:fr.length)??0} 首`:`${(fr==null?void 0:fr.length)??0} 首`:A?`${Ml.length} / ${qt?W.length:kn.length} 首`:`${qt?W.length:kn.length} 首`})]}),l.jsx(Wf,{size:"large",className:"w-56 max-w-[48%] shrink-0",value:A,onChange:F=>_(F.target.value),onClear:()=>_(""),placeholder:"搜索本列表","aria-label":"在列表内搜索"}),l.jsx(HX,{playDisabled:Vs.length===0,onPlayAll:()=>i.playQueue(Vs,0,"music"),selectMode:Ie,onToggleSelectMode:()=>{Fe(!Ie),Se(new Set)},onDownloadAll:!hr&&zl.some(Ph)?Iu:void 0,sync:mn&&!qt&&!j?{on:$,onToggle:()=>{if(!b)return;const F=!$;se(F),be.setSync(e,b,F).catch(()=>se(!F))}}:void 0,onNetdisk:mn&&!qt&&!j?()=>ve(!0):void 0,onExportM3u:va?oi:void 0,onRename:j&&Ht?()=>{je(Ht),zt(Ht.label)}:void 0,onRemove:j&&Ht?()=>sn(Ht):void 0})]}),!j&&ye.length>0&&l.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 overflow-x-auto border-b border-border px-4 py-2 scrollbar-mac",children:[l.jsx(Ne,{size:"mini",variant:nt?"neutral":"default",className:"rounded-full",onClick:()=>re(null),children:"全部"}),ye.map(F=>l.jsxs(Nu,{children:[l.jsx(Tu,{asChild:!0,children:l.jsxs(Ne,{size:"mini",variant:nt===F.id?"default":"neutral",className:"rounded-full",onClick:()=>re(nt===F.id?null:F.id),children:[F.label,typeof F.itemCount=="number"?` (${F.itemCount})`:""]})}),l.jsxs(kl,{size:"sm",className:"w-32",children:[l.jsxs(Er,{onSelect:()=>{je(F),zt(F.label)},children:[l.jsx(yc,{}),l.jsx("span",{children:"重命名"})]}),l.jsxs(Er,{variant:"destructive",onSelect:()=>sn(F),children:[l.jsx(Po,{}),l.jsx("span",{children:"删除播单"})]})]})]},F.id))]}),mn&&!qt&&l.jsx(PW,{apiBase:e.baseUrl,open:Z,onOpenChange:ve,streamId:mn.id,streamTitle:mn.description||mn.id,onChanged:()=>{ho()}}),l.jsx(HA,{rows:Ml,queue:Vs,stage:i,baseUrl:e.baseUrl,liked:Ee,toggleLike:ft,jobs:P,archived:G,onDownload:tr,busy:Bs,selectMode:Ie,selectedIds:fe,onToggleSelect:cb,jumpKey:b??void 0,onReorder:ba,collect:{conn:e,streamId:!qt&&b?b:null,onChanged:ci},emptyText:j?A?"没有匹配的曲目。":"这个播单还是空的——去某个播客里用「加入播单」把节目收进来。":A?"没有匹配的节目。":qt?"还没有喜欢的歌曲。":"这个歌单还没有曲目(等待下次抓取)。"}),l.jsx(rY,{open:!!oe,onOpenChange:F=>{F||ie(null)},children:l.jsxs(AR,{children:[l.jsxs(MR,{children:[l.jsx(_R,{children:oe!=null&&oe.written?"已生成 m3u":"未生成 m3u"}),l.jsxs(OR,{children:["写入 ",(oe==null?void 0:oe.written)??0," 首",oe&&oe.skipped>0?`,跳过 ${oe.skipped} 首(还没有本地文件)`:"",oe!=null&&oe.path?l.jsxs(l.Fragment,{children:["。文件位置:",l.jsx("br",{}),l.jsx("code",{className:"break-all",children:oe.path})]}):"。没有可写入的曲目,未生成文件。"]})]}),l.jsx(DR,{children:l.jsx(zR,{onClick:()=>ie(null),children:"好"})})]})})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex h-8 shrink-0 items-center gap-2 px-4 pt-3 pb-0 box-content",children:[l.jsx(zf,{title:((Bu=t[0])==null?void 0:Bu.label)??((ja=t[0])==null?void 0:ja.description)??"歌单",onRefresh:r,exportChannel:t.length===1?{conn:e,id:t[0].id}:void 0,className:"min-w-0 flex-1"}),l.jsx(Wf,{size:"large",className:"w-56 max-w-[48%] shrink-0",value:E,onChange:F=>R(F.target.value),onClear:()=>R(""),onKeyDown:F=>{F.key==="Enter"&&_l()},placeholder:"搜索歌曲 / 歌手","aria-label":"搜索歌曲或歌手"})]}),t[0]?l.jsx(by,{value:o,onChange:c}):null,o==="config"&&t[0]?l.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:l.jsx(yy,{conn:e,channelId:t[0].id,showHeader:!1,onChanged:n,onDeleted:()=>{c("content")}})}):l.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:k?l.jsx(HA,{rows:Pu,queue:zu,stage:i,baseUrl:e.baseUrl,liked:Ee,toggleLike:ft,jobs:P,archived:G,onDownload:tr,busy:z,busyText:"搜索中…",jumpKey:`search:${k}`,collect:{conn:e,streamId:null},emptyText:"没有找到歌曲。"}):l.jsxs(Fy,{ref:N,className:"h-full p-4 pb-24 scrollbar-mac",children:[l.jsxs("div",{className:"mb-1.5 flex items-center gap-2",children:[l.jsx("span",{className:"text-[13px] font-semibold text-muted-foreground",children:"我的播单"}),an?l.jsx(Jt,{autoFocus:!0,className:"h-6 w-40 text-[12px]",placeholder:"播单名,回车创建",value:bt,onChange:F=>Ft(F.target.value),onKeyDown:F=>{F.key==="Enter"&&Zh(),F.key==="Escape"&&(en(!1),Ft(""))},onBlur:()=>{en(!1),Ft("")}}):l.jsx("button",{onClick:()=>en(!0),className:"text-[12px] text-muted-foreground transition-colors hover:text-foreground",children:"+ 新建播单"})]}),l.jsxs("div",{"data-testid":"music-liked-grid",className:PA,children:[l.jsxs(qy,{onOpen:()=>S({kind:"liked"}),ariaLabel:"我喜欢的歌曲",src:(Jh=W[0])!=null&&Jh.poster?is(e.baseUrl,W[0].poster):void 0,ratio:"1 / 1",fallback:l.jsx(Bd,{className:"size-10 fill-primary text-primary"}),caption:"overlay",title:"我喜欢的歌曲",children:[l.jsxs(Hy,{className:"right-1.5 top-1.5 tabular-nums",children:[W.length," 首"]}),l.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center bg-black/0 opacity-0 transition-all duration-200 group-hover:bg-black/25 group-hover:opacity-100",children:l.jsx("button",{onClick:F=>{F.stopPropagation(),S({kind:"liked"}),Xr.length&&i.playQueue(Xr,0,"music")},"aria-label":"播放",className:"pointer-events-auto flex size-14 items-center justify-center rounded-full border border-white/40 bg-white/20 text-white shadow-xl backdrop-blur-md transition-transform duration-200 hover:scale-110 hover:bg-white/30",children:l.jsx(qn,{className:"size-6 translate-x-0.5 fill-current"})})})]}),yY(Oe,g).map(F=>{const he=Oe.find(Ae=>Ae.id===F.id);return l.jsxs(Nu,{children:[l.jsx(Tu,{asChild:!0,children:l.jsx("div",{children:l.jsx(qy,{onOpen:()=>S({kind:"collection",id:F.id}),ariaLabel:F.label,ratio:"1 / 1",fallback:l.jsx(Xs,{className:"size-9"}),caption:"overlay",title:F.label,subtitle:F.subtitle,children:l.jsxs(Hy,{className:"right-1.5 top-1.5 tabular-nums",children:[F.itemCount," 首"]})})})}),l.jsxs(kl,{size:"sm",className:"w-32",children:[l.jsxs(Er,{onSelect:()=>{je(he),zt(he.label)},children:[l.jsx(yc,{}),l.jsx("span",{children:"重命名"})]}),l.jsxs(Er,{variant:"destructive",onSelect:()=>sn(he),children:[l.jsx(Po,{}),l.jsx("span",{children:"删除播单"})]})]})]},F.id)})]}),m.length===0?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"mt-6 mb-1.5 text-[13px] font-semibold text-muted-foreground",children:"歌单 / 播客"}),l.jsx("div",{className:"px-1 py-3 text-[13px] text-muted-foreground",children:"还没有歌单。去「添加来源」把音乐/电台源加为歌单。"})]}):l.jsx(l.Fragment,{children:[{key:"music",label:"歌单",list:x.playlists,icon:l.jsx(Xs,{className:"size-9"})},{key:"podcast",label:"播客",list:x.podcasts,icon:l.jsx(xL,{className:"size-9"})}].filter(F=>F.list.length>0).map(F=>l.jsxs("div",{children:[l.jsx("div",{className:"mt-6 mb-1.5 text-[13px] font-semibold text-muted-foreground",children:F.label}),l.jsx("div",{className:PA,children:F.list.map(he=>{const Ae=MX(he);return l.jsx(XW,{id:he.id,label:he.description||he.id,children:l.jsxs(qy,{onOpen:()=>S({kind:"playlist",id:he.id}),ariaLabel:he.description||he.id,src:he.image?is(e.baseUrl,he.image):void 0,ratio:"1 / 1",fallback:F.icon,caption:"overlay",title:he.description||he.id,children:[Ae&&l.jsx(Hy,{className:"right-1.5 top-1.5",children:Ae}),l.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center bg-black/0 opacity-0 transition-all duration-200 group-hover:bg-black/25 group-hover:opacity-100",children:l.jsx("button",{onClick:Ve=>{Ve.stopPropagation(),S({kind:"playlist",id:he.id}),B(!0)},"aria-label":"播放",className:"pointer-events-auto flex size-14 items-center justify-center rounded-full border border-white/40 bg-white/20 text-white shadow-xl backdrop-blur-md transition-transform duration-200 hover:scale-110 hover:bg-white/30",children:l.jsx(qn,{className:"size-6 translate-x-0.5 fill-current"})})})]})},he.id)})})]},F.key))})]})})]}),Al==="track-list"&&Ie&&fe.size>0&&l.jsx(qX,{conn:e,count:fe.size,anchorStreamId:!qt&&b?b:null,onPick:F=>void Qh(F),onDownload:()=>$u(),onCancel:()=>{Fe(!1),Se(new Set)}}),l.jsx(EX,{renaming:Ye,deleting:Zn,renameLabel:kt,onRenameLabelChange:zt,onCloseRename:()=>je(null),onCloseDelete:()=>sn(null),onConfirmRename:()=>void Xh(),onConfirmDelete:()=>void Ol(),renameSaving:Qn,deleteSaving:Jn,renameTitle:"重命名播单",renameDesc:"修改这个子列表的显示名称。",nameLabel:"播单名称",deleteTitle:"删除播单",deleteBody:F=>`将删除「${F}」这个子列表;其中的分集/曲目仍留在原 stream 里,不会被删除。此操作不可撤销。`}),o==="config"?null:l.jsx(jX,{conn:e})]})}function GX({channel:e,onChannelsChanged:t,onReload:n}){const r=p.useMemo(()=>IW("/music"),[]);return l.jsx("div",{"data-testid":"panel-music",className:"flex min-h-0 flex-1 flex-col",children:l.jsx($W,{location:r,children:l.jsx(bx,{conn:ut,children:l.jsx(KX,{conn:ut,channels:[e],onChannelsChanged:t,onReload:n})})})})}function Wy(e){let t;function n(r){if(document.querySelector(`link[${e.marker}]`)!==null)return;const i=document.createElement("link");i.rel="stylesheet",i.setAttribute(e.marker,""),i.href=`${r}/panel/${e.file}.css`,document.head.appendChild(i)}return{load(r){if(t!==void 0)return t;const i=(async()=>{n(r);const o=document.createElement("script");try{return o.setAttribute(e.marker,""),o.crossOrigin="anonymous",o.src=`${r}/panel/${e.file}.js`,await new Promise((c,d)=>{o.addEventListener("load",()=>{const h=globalThis[e.globalName];if(h===void 0){d(new Error(`${e.label} bundle 加载了但没有导出 ${e.globalName}`));return}c(h)}),o.addEventListener("error",()=>d(new Error(`${e.label} bundle 加载失败`))),document.head.appendChild(o)})}catch(c){throw o.remove(),t=void 0,c}})();return t=i,i}}}const YX=Wy({marker:"data-stream-panel-research",globalName:"__streamPanelResearch",file:"panel-research",label:"研究"}),WX=["everySeconds","everyMinutes","hourly","daily","weekly","monthly"],XX={everySeconds:"每隔几秒",everyMinutes:"每隔几分钟",hourly:"每小时",daily:"每天",weekly:"每周",monthly:"每月"},QX=["周日","周一","周二","周三","周四","周五","周六"];function Lh(e){return QX[e]??String(e)}function Tl(e,t,n){if(e==="*")return{all:!0,step:null,values:qA(t,n,1)};const r=new Set;let i=null;const o=e.split(",");for(const c of o){const d=/^(\*|\d{1,2}(?:-\d{1,2})?)(?:\/(\d{1,2}))?$/.exec(c);if(!d)return null;const[,h,m]=d,x=m===void 0?1:Number(m);if(x<1)return null;let g,v;if(h==="*")g=t,v=n;else if(h.includes("-")){const[S,b]=h.split("-").map(Number);g=S,v=b}else g=Number(h),v=m===void 0?Number(h):n;if(!Number.isInteger(g)||!Number.isInteger(v)||g<t||v>n||g>v)return null;for(const S of qA(g,v,x))r.add(S);o.length===1&&h==="*"&&m!==void 0&&(i=x)}return r.size===0?null:{all:!1,step:i,values:[...r].sort((c,d)=>c-d)}}function qA(e,t,n){const r=[];for(let i=e;i<=t;i+=n)r.push(i);return r}function Xy(e){const t=e.trim().split(/\s+/);if(t.length!==6)return null;const n=Tl(t[0],0,59),r=Tl(t[1],0,59),i=Tl(t[2],0,23),o=Tl(t[3],1,31),c=Tl(t[4],1,12),d=Tl(t[5],0,6);return!n||!r||!i||!o||!c||!d?null:{second:n,minute:r,hour:i,dayOfMonth:o,month:c,dayOfWeek:d}}function ZX(e){const t=e.trim()===""?[]:e.trim().split(/\s+/);return t.length!==6?`要 6 段(含秒),现在是 ${t.length} 段——每天 09:45 = "0 45 9 * * *"`:Xy(e)?null:"有一段看不懂:只支持 * / */n / a-b / a-b/n / 逗号列表,且秒分 0–59、时 0–23、日 1–31、月 1–12、周 0–6"}function Ih(e){return!e.all&&e.step===null&&e.values.length===1?e.values[0]:null}function Qy(e,t){return`${String(e).padStart(2,"0")}:${String(t).padStart(2,"0")}`}function JX(e){const t=[...e].sort((r,i)=>r-i);return t.every((r,i)=>i===0||r===t[i-1]+1)&&t.length>2?`${Lh(t[0])}至${Lh(t.at(-1))}`:t.map(Lh).join("、")}function eQ(e){const t=KA(e);if(!t)return null;switch(t.kind){case"everySeconds":return t.n===1?"每秒":`每 ${t.n} 秒`;case"everyMinutes":return t.n===1?"每分钟":`每 ${t.n} 分钟`;case"hourly":return`每小时第 ${t.minute} 分`;case"daily":return`每天 ${Qy(t.hour,t.minute)}`;case"weekly":return`${JX(t.weekdays)} ${Qy(t.hour,t.minute)}`;case"monthly":return`每月 ${t.day} 日 ${Qy(t.hour,t.minute)}`}}function tQ(e){switch(e.kind){case"everySeconds":return`*/${e.n} * * * * *`;case"everyMinutes":return`0 */${e.n} * * * *`;case"hourly":return`0 ${e.minute} * * * *`;case"daily":return`0 ${e.minute} ${e.hour} * * *`;case"weekly":return`0 ${e.minute} ${e.hour} * * ${[...e.weekdays].sort((t,n)=>t-n).join(",")}`;case"monthly":return`0 ${e.minute} ${e.hour} ${e.day} * *`}}function KA(e){const t=Xy(e);if(!t)return null;const{second:n,minute:r,hour:i,dayOfMonth:o,month:c,dayOfWeek:d}=t;if(!c.all)return null;if(n.step!==null&&r.all&&i.all&&o.all&&d.all)return{kind:"everySeconds",n:n.step};if(n.all&&r.all&&i.all&&o.all&&d.all)return{kind:"everySeconds",n:1};if(Ih(n)!==0)return null;if(i.all&&o.all&&d.all){if(r.step!==null)return{kind:"everyMinutes",n:r.step};if(r.all)return{kind:"everyMinutes",n:1}}const m=Ih(r);if(m===null)return null;if(i.all&&o.all&&d.all)return{kind:"hourly",minute:m};const x=Ih(i);if(x===null)return null;if(o.all&&d.all)return{kind:"daily",hour:x,minute:m};if(o.all&&!d.all&&d.step===null)return{kind:"weekly",weekdays:d.values,hour:x,minute:m};if(d.all){const g=Ih(o);if(g!==null)return{kind:"monthly",day:g,hour:x,minute:m}}return null}function nQ(e){const t=n=>Number.isInteger(n);switch(e.kind){case"everySeconds":return t(e.n)&&e.n>=1&&e.n<=59?null:"间隔必须是 1–59 秒";case"everyMinutes":return t(e.n)&&e.n>=1&&e.n<=59?null:"间隔必须是 1–59 分钟";case"hourly":return t(e.minute)&&e.minute>=0&&e.minute<=59?null:"分钟必须是 0–59 的整数";case"monthly":return!t(e.day)||e.day<1||e.day>31?"日必须是 1–31 的整数":Zy(e.hour,e.minute);case"weekly":return e.weekdays.length===0?"至少选一个星期几":e.weekdays.some(n=>!t(n)||n<0||n>6)?"周几只能是 0(周日)到 6(周六)":Zy(e.hour,e.minute);case"daily":return Zy(e.hour,e.minute)}}function Zy(e,t){return!Number.isInteger(e)||e<0||e>23?"小时必须是 0–23 的整数":!Number.isInteger(t)||t<0||t>59?"分钟必须是 0–59 的整数":null}const rQ=366*4;function sQ(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return""}}function aQ(e,{from:t=new Date,count:n=3,timeZone:r}={}){const i=Xy(e);if(!i||r!==void 0&&r!==""&&r!==sQ()||!i.dayOfMonth.all&&!i.dayOfWeek.all)return null;const o=[],c=new Date(t.getFullYear(),t.getMonth(),t.getDate());for(let d=0;d<rQ&&o.length<n;d+=1){const h=new Date(c.getFullYear(),c.getMonth(),c.getDate()+d);if(i.month.values.includes(h.getMonth()+1)&&!(!i.dayOfMonth.all&&!i.dayOfMonth.values.includes(h.getDate()))&&!(!i.dayOfWeek.all&&!i.dayOfWeek.values.includes(h.getDay())))for(const m of i.hour.values){for(const x of i.minute.values){for(const g of i.second.values){const v=new Date(h.getFullYear(),h.getMonth(),h.getDate(),m,x,g);if(!(v.getTime()<=t.getTime())&&(o.push(v),o.length>=n))break}if(o.length>=n)break}if(o.length>=n)break}}return o}function GA(e){const t=n=>String(n).padStart(2,"0");return`${t(e.getMonth()+1)}-${t(e.getDate())} ${t(e.getHours())}:${t(e.getMinutes())}:${t(e.getSeconds())}`}function YA(e,t){const n=Math.round((e-t)/1e3),r=Math.abs(n),i=r<60?`${r} 秒`:r<3600?`${Math.round(r/60)} 分钟`:r<86400?`${Math.round(r/3600)} 小时`:`${Math.round(r/86400)} 天`;return n>=0?`${i}后`:`${i}前`}function WA(e,t){const n=eQ(e);return n===null?null:t?`${n}(${t})`:n}function XA({schedule:e,timezone:t,count:n=3,now:r=Date.now(),testId:i}){const o=aQ(e,{from:new Date(r),count:n,timeZone:t});return o===null?l.jsxs("div",{"data-testid":i,className:"text-[12px] text-muted-foreground",children:["下次:按 ",t," 计算,本机算不出来"]}):o.length===0?l.jsx("div",{"data-testid":i,className:"text-[12px] text-destructive",children:"下次:永不触发——这条排期没有任何匹配的时刻"}):l.jsxs("div",{"data-testid":i,className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5 text-[12px] text-muted-foreground",children:[l.jsx("span",{children:"下次"}),l.jsx("span",{className:"text-foreground",children:GA(o[0])}),l.jsxs("span",{children:["(",YA(o[0].getTime(),r),")"]}),o.length>1&&l.jsxs("span",{className:"opacity-70",children:["此后 ",o.slice(1).map(GA).join(" · ")]})]})}function iQ(e){const t=KA(e);return t?{kind:t.kind,preset:t}:{kind:"raw",preset:{kind:"daily",hour:9,minute:0}}}function oQ(e,t){const n="hour"in e?e.hour:9,r="minute"in e?e.minute:0;switch(t){case"everySeconds":return{kind:t,n:30};case"everyMinutes":return{kind:t,n:5};case"hourly":return{kind:t,minute:r};case"daily":return{kind:t,hour:n,minute:r};case"weekly":return{kind:t,weekdays:e.kind==="weekly"?e.weekdays:[1,2,3,4,5],hour:n,minute:r};case"monthly":return{kind:t,day:e.kind==="monthly"?e.day:1,hour:n,minute:r}}}function El({label:e,value:t,min:n,max:r,onChange:i,testId:o,width:c="w-16"}){return l.jsxs("label",{className:"flex items-center gap-1.5 text-[13px] text-muted-foreground",children:[l.jsx(Jt,{type:"number",min:n,max:r,value:Number.isFinite(t)?t:"","data-testid":o,"aria-label":e,className:`${c} h-7 px-2 text-[13px]`,onChange:d=>i(d.target.value===""?NaN:Number(d.target.value))}),e]})}function Jy({hour:e,minute:t,onChange:n}){return l.jsxs(l.Fragment,{children:[l.jsx(El,{label:"时",value:e,min:0,max:23,testId:"sched-hour",onChange:r=>n({hour:r,minute:t})}),l.jsx(El,{label:"分",value:t,min:0,max:59,testId:"sched-minute",onChange:r=>n({hour:e,minute:r})})]})}function lQ({taskId:e,schedule:t,timezone:n,busy:r=!1,onCancel:i,onSave:o}){const c=p.useMemo(()=>iQ(t),[t]),[d,h]=p.useState(c.kind),[m,x]=p.useState(c.preset),[g,v]=p.useState(t),S=d==="raw"?null:nQ(m),b=d==="raw"?g.trim():S?null:tQ(m),j=d==="raw"?ZX(g):null,C=S??j,k=b!==null&&C===null?WA(b,n):null;return l.jsxs("div",{"data-testid":`task-schedule-editor-${e}`,className:"flex flex-col gap-2.5 rounded-lg bg-[var(--acr-card-nested)] p-3",children:[l.jsxs("div",{className:"flex flex-wrap gap-1",children:[WX.map(N=>l.jsx(Ne,{type:"button",size:"small",variant:d===N?"secondary":"ghost","data-testid":`sched-kind-${N}`,onClick:()=>{h(N),x(E=>oQ(E,N))},children:XX[N]},N)),l.jsx(Ne,{type:"button",size:"small",variant:d==="raw"?"secondary":"ghost","data-testid":"sched-kind-raw",onClick:()=>{h("raw"),v(b??t)},children:"自定义表达式"})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[d==="everySeconds"&&m.kind==="everySeconds"&&l.jsx(El,{label:"秒一次",value:m.n,min:1,max:59,testId:"sched-n",onChange:N=>x({kind:"everySeconds",n:N})}),d==="everyMinutes"&&m.kind==="everyMinutes"&&l.jsx(El,{label:"分钟一次",value:m.n,min:1,max:59,testId:"sched-n",onChange:N=>x({kind:"everyMinutes",n:N})}),d==="hourly"&&m.kind==="hourly"&&l.jsx(El,{label:"分(每小时)",value:m.minute,min:0,max:59,testId:"sched-minute",onChange:N=>x({kind:"hourly",minute:N})}),d==="monthly"&&m.kind==="monthly"&&l.jsxs(l.Fragment,{children:[l.jsx(El,{label:"日",value:m.day,min:1,max:31,testId:"sched-day",onChange:N=>x({...m,day:N})}),l.jsx(Jy,{hour:m.hour,minute:m.minute,onChange:N=>x({...m,...N})})]}),d==="weekly"&&m.kind==="weekly"&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"flex flex-wrap gap-1",children:[0,1,2,3,4,5,6].map(N=>{const E=m.weekdays.includes(N);return l.jsx(Ne,{type:"button",size:"small",variant:E?"secondary":"ghost","aria-pressed":E,"data-testid":`sched-weekday-${N}`,onClick:()=>x({...m,weekdays:E?m.weekdays.filter(R=>R!==N):[...m.weekdays,N].sort((R,A)=>R-A)}),children:Lh(N)},N)})}),l.jsx(Jy,{hour:m.hour,minute:m.minute,onChange:N=>x({...m,...N})})]}),d==="daily"&&m.kind==="daily"&&l.jsx(Jy,{hour:m.hour,minute:m.minute,onChange:N=>x({...m,...N})}),d==="raw"&&l.jsx(Jt,{"data-testid":"sched-raw","aria-label":"cron 表达式",value:g,spellCheck:!1,autoComplete:"off",className:"h-7 w-64 px-2 font-mono text-[12px]",onChange:N=>v(N.target.value)})]}),C!==null?l.jsx("div",{"data-testid":"sched-error",className:"text-[12px] text-destructive",children:C}):l.jsxs("div",{className:"flex flex-col gap-0.5",children:[l.jsx("div",{className:"text-[13px] text-foreground","data-testid":"sched-sentence",children:k??"这条表达式合法,但超出了能翻成人话的范围——请照下面的触发时刻确认它是不是你要的"}),l.jsx("div",{className:"font-mono text-[11px] text-muted-foreground","data-testid":"sched-expr",children:b}),b!==null&&l.jsx(XA,{schedule:b,timezone:n,testId:"sched-next"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Ne,{type:"button",size:"small",variant:"default","data-testid":`sched-save-${e}`,disabled:r||C!==null||b===null||b===t,onClick:()=>{b!==null&&o(b)},children:r?"保存中…":"保存排期"}),l.jsx(Ne,{type:"button",size:"small",variant:"ghost","data-testid":`sched-cancel-${e}`,onClick:i,children:"取消"})]})]})}async function $h(e){if(!e.ok){const t=await e.text();throw new Error(`${e.status} ${t.slice(0,300)}`)}return e.json()}async function cQ(e){return(await $h(await fetch(`${e}/api/tasks`))).tasks}async function uQ(e,t,n=50){return(await $h(await fetch(`${e}/api/tasks/${encodeURIComponent(t)}/runs?limit=${n}`))).runs}async function dQ(e,t){await $h(await fetch(`${e}/api/tasks/${encodeURIComponent(t)}/run`,{method:"POST"}))}async function fQ(e,t,n){if(t.source!=="user")throw new Error(`${t.id} 是内置运维任务,排期改代码不改库`);if(typeof t.command!="string")throw new Error(`${t.id} 这一行没有 command,改不了——请刷新页面重试`);const r={id:t.id,label:t.label,schedule:n.schedule??t.schedule,...t.timezone!==void 0?{timezone:t.timezone}:{},command:t.command,args:t.args??[],...t.cwd!==void 0?{cwd:t.cwd}:{},...t.env!==void 0?{env:t.env}:{},...t.timeoutMs!==void 0?{timeoutMs:t.timeoutMs}:{},serial:t.serial!==!1,maxAttempts:t.maxAttempts??1,effect:t.effect,enabled:n.enabled??t.enabled},i=await $h(await fetch(`${e}/api/tasks/${encodeURIComponent(t.id)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(r)}));return{...t,...i.task,source:"user"}}function hQ(e){return e===null?"—":new Date(e).toLocaleString()}function mQ(e){return e===null?"—":e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function pQ({run:e}){const[t,n]=p.useState(!1),r=e.state==="failed";return l.jsxs("div",{className:"border-t border-[var(--acr-border-soft)] py-1 text-[12px]",children:[l.jsxs("button",{type:"button",className:"flex w-full gap-3 text-left",onClick:()=>n(i=>!i),children:[l.jsx("span",{className:"w-40 shrink-0 text-muted-foreground",children:hQ(e.attemptedAt??e.insertedAt)}),l.jsx("span",{className:`w-16 shrink-0 ${r?"text-destructive":"text-muted-foreground"}`,children:e.state}),l.jsx("span",{className:"w-16 shrink-0 text-muted-foreground",children:mQ(e.durationMs)}),l.jsx("span",{className:"flex-1 truncate",children:e.summary??"(没报摘要)"})]}),t&&(e.detail!==void 0||e.errors!==void 0)&&l.jsx("pre",{className:"mt-1 overflow-x-auto rounded-md bg-[var(--acr-card-nested)] p-2 text-[11px]",children:JSON.stringify({detail:e.detail,errors:e.errors},null,2)})]})}const eb={external:{text:"动外部世界",variant:"destructive"},"writes-db":{text:"写库",variant:"secondary"},"writes-files":{text:"写文件",variant:"secondary"},"read-only":{text:"只读",variant:"secondary"}};function gQ(e){var n;if(e.shadowed)return{label:"不会执行",dot:"bg-destructive",tone:"text-destructive"};if(!e.enabled)return{label:"已停用",dot:"bg-muted-foreground/50",tone:"text-muted-foreground"};const t=(n=e.lastRun)==null?void 0:n.state;return t==="running"||t==="claimed"||t==="waiting"?{label:"在跑",dot:"bg-primary animate-pulse",tone:"text-primary"}:t==="failed"?{label:"上次失败",dot:"bg-destructive",tone:"text-destructive"}:{label:"正常",dot:"bg-muted-foreground/40",tone:"text-muted-foreground"}}function xQ({apiBase:e,task:t,onChanged:n}){const[r,i]=p.useState(null),[o,c]=p.useState(!1),[d,h]=p.useState(!1),[m,x]=p.useState(!1),[g,v]=p.useState(null),[S,b]=p.useState(!1),j=p.useRef(!0);p.useEffect(()=>(j.current=!0,()=>{j.current=!1}),[]),p.useEffect(()=>{if(!S)return;const _=setTimeout(()=>b(!1),5e3);return()=>clearTimeout(_)},[S]);const C=p.useCallback(async()=>{const _=!o;if(c(_),_&&r===null)try{const z=await uQ(e,t.id);j.current&&i(z)}catch(z){j.current&&v(z.message)}},[e,o,r,t.id]),k=p.useCallback(async _=>{x(!0),v(null);try{const z=await fQ(e,t,_);if(!j.current)return;n(z),h(!1)}catch(z){j.current&&v(z.message)}finally{j.current&&x(!1)}},[e,n,t]),N=gQ(t),E=WA(t.schedule,t.timezone),R=t.source==="user"&&!t.shadowed,A=t.lastRun;return l.jsxs(fo,{className:"flex flex-col gap-2 p-3","data-testid":`task-row-${t.source}-${t.id}`,children:[l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx("span",{className:`mt-[7px] size-1.5 shrink-0 rounded-full ${N.dot}`,"aria-hidden":!0}),l.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[l.jsx("span",{className:"text-[15px] font-semibold leading-tight [letter-spacing:var(--text-title3-tracking)]",children:t.label}),l.jsx("span",{"data-testid":`task-status-${t.source}-${t.id}`,className:`text-[12px] ${N.tone}`,children:N.label}),t.source==="builtin"&&l.jsx(Bt,{variant:"outline",size:"sm",children:"内置"}),eb[t.effect]&&l.jsx(Bt,{"data-testid":`task-effect-${t.id}`,size:"sm",variant:eb[t.effect].variant,children:eb[t.effect].text})]}),t.shadowed&&l.jsxs("div",{className:"text-[12px] text-destructive",children:["与内置任务 ",t.id," 重名,调度中心已丢弃这一行——它不会执行。删掉它:DELETE /api/tasks/",t.id]}),l.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2",children:[l.jsx("span",{className:"text-[13px] text-foreground",children:E??"这条排期翻不成人话,见右侧原始表达式"}),l.jsx("code",{"data-testid":`task-cron-${t.id}`,className:"font-mono text-[11px] text-muted-foreground",children:t.schedule})]}),t.enabled?l.jsx(XA,{schedule:t.schedule,timezone:t.timezone,testId:`task-next-${t.id}`}):l.jsx("div",{className:"text-[12px] text-muted-foreground",children:"已停用,节拍器上没有它"})]}),l.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[R&&l.jsxs(l.Fragment,{children:[l.jsxs(Ne,{type:"button",size:"small",variant:"ghost",disabled:m,"data-testid":`task-toggle-${t.id}`,onClick:()=>{k({enabled:!t.enabled})},children:[t.enabled?l.jsx(Bi,{}):l.jsx(qn,{}),t.enabled?"暂停":"恢复"]}),l.jsxs(Ne,{type:"button",size:"small",variant:"ghost","data-testid":`task-edit-${t.id}`,onClick:()=>h(_=>!_),children:[l.jsx(gL,{}),"改排期"]})]}),l.jsx(Ne,{type:"button",size:"small",variant:S?"destructive":"neutral","data-testid":`task-run-${t.id}`,onClick:()=>{if(t.effect==="external"&&!S){b(!0);return}b(!1),dQ(e,t.id).catch(_=>{j.current&&v(_.message)})},children:S?"确认执行?":"立即跑一次"})]})]}),d&&R&&l.jsx(lQ,{taskId:t.id,schedule:t.schedule,timezone:t.timezone,busy:m,onCancel:()=>h(!1),onSave:_=>{k({schedule:_})}}),l.jsxs("button",{type:"button","data-testid":`task-expand-${t.id}`,onClick:C,className:"flex items-baseline gap-2 rounded-md px-1 py-0.5 text-left transition-colors hover:bg-[var(--acr-hover)]",children:[l.jsx("span",{className:"shrink-0 text-[12px] text-muted-foreground",children:A?`上次 ${YA(A.attemptedAt??A.insertedAt,Date.now())}`:"上次"}),l.jsx("span",{className:`min-w-0 flex-1 truncate text-[13px] ${(A==null?void 0:A.state)==="failed"?"text-destructive":""}`,children:A?A.summary??"(没报摘要)":"还没跑过"})]}),g&&l.jsx("div",{"data-testid":`task-error-${t.id}`,className:"text-[12px] text-destructive",children:g}),o&&l.jsx("div",{"data-nested-surface":"true",children:r===null?l.jsx("div",{className:"text-[12px] text-muted-foreground",children:"读取中…"}):r.length===0?l.jsx("div",{className:"text-[12px] text-muted-foreground",children:"还没有执行记录"}):r.map(_=>l.jsx(pQ,{run:_},_.id))})]})}function vQ({apiBase:e,title:t="定时任务"}){const[n,r]=p.useState(null),[i,o]=p.useState(null),c=p.useRef(!0),d=p.useCallback(async()=>{try{const m=await cQ(e);c.current&&(r(m),o(null))}catch(m){c.current&&o(m.message)}},[e]);p.useEffect(()=>(c.current=!0,d(),()=>{c.current=!1}),[d]);const h=p.useCallback(m=>{r(x=>(x==null?void 0:x.map(g=>g.source===m.source&&g.id===m.id?m:g))??x)},[]);return l.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[l.jsx("div",{"data-testid":"panel-tasks-header",className:"flex h-8 shrink-0 items-center gap-2 px-4 pt-3 pb-0 box-content",children:l.jsx(zf,{title:t,onRefresh:()=>{d()},refreshLabel:"重新读取",className:"min-w-0 flex-1"})}),l.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 py-3",children:i!==null&&n===null?l.jsxs("div",{className:"text-[13px] text-destructive",children:["读不到任务列表:",i]}):n===null?l.jsx("div",{className:"text-[13px] text-muted-foreground",children:"读取中…"}):l.jsx("div",{className:"flex flex-col gap-2",children:n.map(m=>l.jsx(xQ,{apiBase:e,task:m,onChanged:h},`${m.source}:${m.id}`))})})]})}function QA(e,t){var r,i;const n=e.poster?is(t,e.poster):void 0;if(e.url){const o=jp(t,e.url),c=(r=e.url.match(/[?&]key=([^&]+)/))==null?void 0:r[1],d=(i=e.url.match(/[?&]id=([^&]+)/))==null?void 0:i[1],h=c?decodeURIComponent(c):d?`item:${decodeURIComponent(d)}`:void 0,m=c?`key=${c}`:d?`id=${d}`:void 0;return{kind:"file",src:o,poster:n,...h?{progressKey:h}:{},...m?{subtitleListUrl:`${t}/api/media/netdisk-subtitle-list?${m}`,subtitleUrlBase:`${t}/api/media/netdisk-subtitle?${m}`}:{}}}if(e.provider==="bilibili"&&e.vid){const o=e.vid.startsWith("BV")?`bvid=${e.vid}`:`aid=${e.vid.slice(2)}`;return{kind:"dash",dashUrl:`${t}/api/media/bilibili/dash?${o}`,progressiveUrl:`${t}/api/media/bilibili/play?${o}`,progressKey:`bilibili:${e.vid}`,poster:n}}return(e.provider==="douyin"||e.provider==="tiktok")&&e.page_url?{kind:"file",src:`${t}/api/media/douyin/video?u=${encodeURIComponent(e.page_url)}`,poster:n}:(e.provider==="xhs"||e.provider==="xiaohongshu"||e.provider==="douyin"||e.provider==="tiktok")&&e.embed?{kind:"file",src:`${t}${e.embed}`,poster:n}:e.embed?{kind:"iframe",src:e.embed}:n?{kind:"poster",src:n}:{kind:"none"}}function yQ(e){for(const t of e??[]){if(t.kind!=="video")continue;const n=QA(t,"").kind;if(n==="dash"||n==="file")return t}}function bQ(e,t,n){if(!e)return"";const r=QA(e,t),i=r.kind==="file"?r.src:r.kind==="dash"?r.progressiveUrl:"";return i?`${i}${i.includes("?")?"&":"?"}dl=1&name=${encodeURIComponent(n)}`:""}function wQ(e){const t=document.createElement("a");t.href=e,t.rel="noopener",document.body.appendChild(t),t.click(),t.remove()}function Bh(e){const t=Math.max(0,Math.floor(e));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function SQ(e,t){var o,c,d,h,m,x;const n=(t==null?void 0:t.excerpt)||(t==null?void 0:t.text)||((o=t==null?void 0:t.html)==null?void 0:o.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim())||"";if(n)return n;const r=eM(e),i=((c=e.content)==null?void 0:c.text)||((h=(d=e.content)==null?void 0:d.quoted)==null?void 0:h.text)||jQ((m=e.content)==null?void 0:m.media)||e.body_text||((x=e.body_html)==null?void 0:x.replace(/<[^>]+>/g," "))||"";return tM(i,[e.url,...r])}function tb(e){var i;const t=(i=e.content)==null?void 0:i.quoted;if(!t)return null;const n=(t.author??"").trim(),r=tM(t.text??"",[e.url,...eM(e)]);return!n&&!r?null:{author:n,text:r}}function ZA(e,t){const n=SQ(e,t),r=tb(e);return r&&n&&n===r.text?"":n}function JA(e,t){var c,d,h;const n=[],r=new Set,i=(m,x,g,v)=>{!m||r.has(m)||(r.add(m),n.push({src:is(ut.baseUrl,m),alt:x,w:g,h:v}))};for(const m of(t==null?void 0:t.media)??[])m.kind==="image"&&i(m.url,m.alt,m.w,m.h),m.kind==="video"&&i(m.poster,void 0,m.w,m.h);i(t==null?void 0:t.leadImage);const o=[...((c=e.content)==null?void 0:c.media)??[],...((h=(d=e.content)==null?void 0:d.quoted)==null?void 0:h.media)??[]];for(const m of o)m.kind==="image"&&i(m.thumb||m.url,m.alt,m.w,m.h),m.kind==="video"&&i(m.poster,void 0,m.w,m.h),m.kind==="audio"&&i(m.poster),m.kind==="link"&&i(m.image);for(const m of e.attachments??[])/\.(png|jpe?g|webp|gif)(\?|#|$)/i.test(m)&&i(m);return n}function eM(e){var i,o,c;const t=[],n=d=>{d&&!t.includes(d)&&t.push(d)},r=[...((i=e.content)==null?void 0:i.media)??[],...((c=(o=e.content)==null?void 0:o.quoted)==null?void 0:c.media)??[]];for(const d of r)d.kind==="image"&&(n(d.url),n(d.thumb)),d.kind==="video"&&(n(d.poster),n(d.embed),n(d.page_url)),d.kind==="audio"&&(n(d.url),n(d.poster),n(d.page_url)),d.kind==="link"&&(n(d.url),n(d.image));for(const d of e.attachments??[])n(d);return t}function jQ(e){const t=e==null?void 0:e.find(n=>n.kind==="link"&&!!n.summary);return(t==null?void 0:t.summary)??""}function tM(e,t){let n=e;for(const r of t)r&&(n=n.split(r).join(" "));return n.replace(/https?:\/\/\S+/g," ").replace(/\s+/g," ").trim()}function nM(e){const t=new Date(e).getTime();if(!Number.isFinite(t))return"";const n=Date.now()-t,r=6e4,i=60*r,o=24*i;return n<i?`${Math.max(1,Math.round(n/r))}m`:n<o?`${Math.round(n/i)}h`:`${Math.round(n/o)}d`}function rM(e){const t=(e.title??"").trim();return t&&!/^[((]\s*(?:无标题|untitled)\s*[))]$/i.test(t)?t:""}const sM=new Map;function CQ(e,t,n){!e||!t||!n||sM.set(e,{w:t,h:n})}function nb(e){return e?sM.get(e):void 0}const aM=210,kQ=2,NQ=6,TQ=3/4,EQ="4 / 3",RQ=9/16,AQ=5/4;function iM(e){return Math.min(AQ,Math.max(RQ,e))}const MQ=22,DQ=20,_Q=18,OQ=30,zQ=14,PQ=13,LQ=2,IQ=2,$Q=3,BQ=12,UQ=16.5,VQ=22,FQ=3,HQ=44;function qQ(e){const t=Math.floor(e/aM);return Math.min(NQ,Math.max(kQ,t))}function KQ(e,t){let n=0;for(const r of e)n+=/[⺀-鿿가--]/.test(r)?t:t*.55;return n}function rb(e,t,n,r){return e?Math.min(r,Math.max(1,Math.ceil(KQ(e,t)/Math.max(1,n)))):0}function GQ(e,t){let n=0;if(e.hasMedia){const o=e.mediaW&&e.mediaH?e.mediaH/e.mediaW:TQ;n+=t*iM(o)}const r=rb(e.title,zQ,t,LQ),i=rb(e.summary,PQ,t,r>0?IQ:$Q);if(n+=MQ+r*DQ+i*_Q+OQ,e.quote){const o=rb(e.quote,BQ,t-HQ,FQ);n+=VQ+o*UQ}return n}function YQ(e){const t=JA(e)[0],n=nb(t==null?void 0:t.src),r=tb(e);return{id:e.id,mediaW:(n==null?void 0:n.w)??(t==null?void 0:t.w),mediaH:(n==null?void 0:n.h)??(t==null?void 0:t.h),hasMedia:!!t,title:rM(e),summary:ZA(e),quote:r?`${r.author}${r.text}`:""}}function WQ(e){let t=0;for(let n=1;n<e.length;n++)e[n]<e[t]&&(t=n);return t}function XQ(e,t,n){var r;return!n||n.colCount!==t||e.length<n.itemCount?!1:n.itemCount===0?!0:((r=e[n.itemCount-1])==null?void 0:r.id)===n.lastId}function QQ(e,t,n,r){t=Math.max(1,t);const i=XQ(e,t,r),o=i?r.columns.map(h=>[...h]):Array.from({length:t},()=>[]),c=i?[...r.heights]:new Array(t).fill(0),d=i?r.itemCount:0;for(let h=d;h<e.length;h++){const m=e[h],x=WQ(c);o[x].push(m.id),c[x]+=GQ(m,n)}return{columns:o,heights:c,colCount:t,itemCount:e.length,lastId:e.length?e[e.length-1].id:null}}function ZQ(e,t){const n=new Set(e.filter(c=>{var d;return(d=c.storyGroup)==null?void 0:d.isRep}).map(c=>c.storyGroup.id)),r=new Map,i=new Map;return{rendered:e.filter(c=>{const d=c.storyGroup;return!d||(d.isRep||i.set(d.id,[...i.get(d.id)??[],c]),d.isRep)||!n.has(d.id)||t.has(d.id)?!0:(r.set(d.id,(r.get(d.id)??0)+1),!1)}),hidden:r,membersOf:i}}function JQ(e,t){return t?"收起同源的":`另有 ${e} 条同源`}function oM(e,t){const n=Date.parse(e.timestamp||e.fetched_at),r=t.map(o=>Date.parse(o.timestamp||o.fetched_at)).filter(o=>Number.isFinite(o)&&o>n);if(!Number.isFinite(n)||r.length===0)return null;const i=Math.round((Math.min(...r)-n)/1e3);return i<60?null:i<3600?`首发,早 ${Math.round(i/60)} 分钟`:i<86400?`首发,早 ${Math.round(i/3600)} 小时`:`首发,早 ${Math.round(i/86400)} 天`}function eZ(e,t){const n=new Set(e);return n.delete(t)||n.add(t),n}function tZ(e){var t,n,r;return(r=(n=(t=e.content)==null?void 0:t.media)==null?void 0:n.find(i=>i.kind==="video"&&i.provider==="bilibili"&&!!i.vid))==null?void 0:r.vid}const nZ=e=>e.stream_id.includes("bilibili"),lM=e=>{var t;return e.stream_id.includes("v2ex")||(((t=e.url)==null?void 0:t.includes("v2ex.com"))??!1)},rZ=e=>{var t;return e.stream_id.includes("douyin")||(((t=e.url)==null?void 0:t.includes("douyin.com"))??!1)},cM=e=>{var t;return e.stream_id.includes("xhs")||(((t=e.url)==null?void 0:t.includes("xiaohongshu.com"))??!1)},uM=e=>e.stream_id.includes("xueqiu");function sZ(e){var n,r;const t=(r=(n=e.content)==null?void 0:n.quoted)==null?void 0:r.text;return!!t&&/(\.\.\.|…)\s*$/.test(t.trim())}function dM(e){return!cM(e)&&!uM(e)}function aZ(e){var t,n;return e.note_id?e.note_id:(n=(t=e.url)==null?void 0:t.match(/\/(?:explore|discovery\/item)\/([0-9a-zA-Z]+)/))==null?void 0:n[1]}function iZ(e){var t,n,r,i;return((n=(t=e.url)==null?void 0:t.match(/v2ex\.com\/t\/(\d+)/))==null?void 0:n[1])??(lM(e)?(i=(r=e.url)==null?void 0:r.match(/\/t\/(\d+)/))==null?void 0:i[1]:void 0)}function oZ(e){var n,r,i,o;if(e.stream_id.includes("hackernews")){const c=e.source_guid;if(typeof c=="string"){const h=c.match(/^(\d+)/);if(h)return h[1]}const d=(((n=e.content)==null?void 0:n.media)??[]).map(h=>h.kind==="link"?h.url:"").map(h=>{var m;return(m=h.match(/item\?id=(\d+)/))==null?void 0:m[1]}).find(Boolean);return d||((r=`${e.url??""} ${e.body_html??""}`.match(/item\?id=(\d+)/))==null?void 0:r[1])}return(o=`${e.url??""} ${e.body_html??""} ${(((i=e.content)==null?void 0:i.media)??[]).map(c=>c.kind==="link"?c.url:"").join(" ")}`.match(/news\.ycombinator\.com\/item\?id=(\d+)/))==null?void 0:o[1]}function Mu(e){var n,r,i,o;if(nZ(e)){const c=tZ(e);return c?{source:"bilibili-comments",vid:c}:null}if(cM(e)){const c=aZ(e),d=e.url?new URLSearchParams(e.url.split("?")[1]??"").get("xsec_token")??void 0:void 0;return c&&d?{source:"xhs",noteId:c,xsecToken:d}:null}if(lM(e)){const c=iZ(e);return c?{source:"v2ex",id:c}:null}if(rZ(e))return e.url?{source:"douyin",url:e.url,isGallery:((n=e.content)==null?void 0:n.archetype)==="gallery"}:null;if(uM(e)&&sZ(e)){const c=(i=(r=e.content)==null?void 0:r.quoted)==null?void 0:i.permalink;return c?{source:"xueqiu",permalink:c}:null}const t=oZ(e);return t?{source:"hackernews",id:t}:((o=e.content)==null?void 0:o.archetype)==="link"&&e.url?{source:"link",url:e.url}:null}function lZ(e){const t=Mu(e);return!!t&&t.source!=="link"&&t.source!=="xueqiu"}const fM=300*1e3,cZ=240,uZ=800,dZ=3,hM="stream.preload-cache.v1",dr=new Map,sb=e=>!!e&&Date.now()-e.at<fM;function fZ(){if(typeof window>"u")return[];try{const e=window.sessionStorage.getItem(hM);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>n&&typeof n.key=="string"&&typeof n.at=="number"&&n.value):[]}catch{return[]}}function Uh(){if(!(typeof window>"u"))try{const e=[];for(const[t,n]of dr.entries())!n.value||!sb(n)||e.push({key:t,at:n.at,value:n.value});window.sessionStorage.setItem(hM,JSON.stringify(e))}catch{}}function hZ(){if(!(dr.size>0))for(const e of fZ()){if(Date.now()-e.at>=fM)continue;const t=Promise.resolve(e.value);dr.set(e.key,{at:e.at,value:e.value,promise:t})}}hZ();function mM(e,t){dr.delete(e),dr.set(e,t),Uh()}function mZ(e,t){for(dr.set(e,t);dr.size>cZ;){const n=dr.keys().next().value;if(n===void 0)break;dr.delete(n)}Uh()}const Vh=new Map,pM=e=>{var t;return(t=Vh.get(e))==null?void 0:t.forEach(n=>n())};let Fh=0;const gM=[];function pZ(){return Fh<dZ?(Fh++,Promise.resolve()):new Promise(e=>gM.push(e)).then(()=>void Fh++)}function gZ(){var e;Fh--,(e=gM.shift())==null||e()}function xZ(e,t,n){const r=JSON.stringify(t),i=dr.get(r);if(sb(i))return mM(r,i),i.promise;const c=(async()=>{await pZ();try{return await be.enrich(e,t)}finally{gZ()}})(),d={at:Date.now(),promise:c};return mZ(r,d),c.then(h=>{d.value=h,Uh(),pM(r)}).catch(()=>{dr.get(r)===d&&(dr.delete(r),Uh()),pM(r)}),c}function vZ(e){const t=e?Mu(e):null,n=t?JSON.stringify(t):"",[,r]=p.useState(0);p.useEffect(()=>{if(!n)return;const o=()=>r(d=>d+1);let c=Vh.get(n);return c||Vh.set(n,c=new Set),c.add(o),()=>{c.delete(o),c.size||Vh.delete(n)}},[n]);const i=n?dr.get(n):void 0;return i&&mM(n,i),(i==null?void 0:i.value)??null}function yZ(e,t){if(!dM(e))return;const n=Mu(e);n&&(sb(dr.get(JSON.stringify(n)))||xZ(t,n).catch(()=>{}))}function xM(e,t){const n=p.useRef(null);return p.useEffect(()=>{const r=n.current;if(!r||!dM(e)||!Mu(e))return;const i=r.closest("[data-radix-scroll-area-viewport]")??r.closest('[data-slot="shell-content"]'),o=new IntersectionObserver(c=>{c[0].isIntersecting&&yZ(e,t)},{root:i,rootMargin:`0px 0px ${uZ}px 0px`});return o.observe(r),()=>o.disconnect()},[e,t]),n}function vM(e,{onPlayAudio:t}={}){var z,D,V,I,Q;const n=vZ(e),r=JA(e,n==null?void 0:n.article),i=r[0],o=yQ((z=e.content)==null?void 0:z.media),c=((D=e.content)==null?void 0:D.archetype)==="video"||(((V=e.content)==null?void 0:V.media)??[]).some(B=>B.kind==="video"),d=oY(),h=d&&!o&&!c?Mh(e,ut.baseUrl,"podcast"):null,m=!!h&&((I=d==null?void 0:d.current)==null?void 0:I.id)===e.id,x=m&&!!(d!=null&&d.playing),g=!h||!d?void 0:()=>{m?d.toggle():t?t(e):d.play(h)},v=rM(e),S=ZA(e,n==null?void 0:n.article),b=tb(e),j=e.author_avatar||rN(e.stream_id)||AP(ut.baseUrl,e.url),C=e.comment_count??(n==null?void 0:n.total),k=lZ(e)||typeof C=="number",N=((Q=e.title)==null?void 0:Q.trim())||(typeof e.author=="string"?e.author:"")||"download",E=bQ(o,ut.baseUrl,N),R=!!E,A=Mu(e),_=(A==null?void 0:A.source)==="xhs";return{media:r,firstMedia:i,video:o??null,isVideoNote:c,audioTrack:h,audioPlaying:x,onAudioActivate:g,title:v,summary:S,quoted:b,avatar:j??"",commentCount:C,hasComments:k,videoDl:E,canDownload:R,xhsParams:A,isXhs:_}}function yM({className:e,...t}){return l.jsx(J3,{"data-slot":"avatar",className:Y("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...t})}function bM({className:e,...t}){return l.jsx(t$,{"data-slot":"avatar-image",className:Y("aspect-square size-full",e),...t})}function wM({className:e,...t}){return l.jsx(r$,{"data-slot":"avatar-fallback",className:Y("flex size-full items-center justify-center rounded-[inherit] border border-[var(--acr-border)] bg-[var(--acr-chip)] text-[11px] font-medium text-foreground",e),...t})}const bZ=/\.pdf(\?|#|$)/i;function SM(e,t,n){const r=t.media??[];return e==="stt"?t.resolvedByHandle?!0:r.some(i=>i.kind==="video"?!!i.url||!i.resolveOnly&&!!(i.vid||i.embed||i.page_url):i.kind==="audio"&&(!!i.url||!!(i.platform&&i.track_id))):e==="ocr"?r.some(i=>i.kind==="image"||i.kind==="link"&&bZ.test(i.url)):!!ab(t,n)}function ab(e,t){const n=(e.media??[]).find(r=>r.kind==="link");return(n==null?void 0:n.url)??t}const ib={stt:"语音转文字",ocr:"图片/PDF 识别",article:"网页正文抓取",inline:"直取条目原文"};function jM(e,t,n){if(e.archetype==="forward"){const i=e.quoted;return i!=null&&i.archetype?jM({archetype:i.archetype,text:i.text,media:i.media},t,n):CM(e)}if(e.archetype==="text"){const i=CM(e);if(!i.ok){const o=ab(e,n);if(o!==void 0)return t.article?{ok:!0,branch:"article",url:o}:{ok:!1,code:"branch_unavailable",branch:"article",message:`${ib.article}未配置`}}return i}const r=e.archetype==="video"||e.archetype==="audio"?"stt":e.archetype==="gallery"||SM("ocr",e,n)?"ocr":"article";return SM(r,e,n)?t[r]?r==="article"?{ok:!0,branch:r,url:ab(e,n)}:{ok:!0,branch:r}:{ok:!1,code:"branch_unavailable",branch:r,message:`${ib[r]}未配置`}:{ok:!1,code:"no_source",branch:r,message:`这条内容里没有可${ib[r]}的东西`}}function CM(e){var n;const t=(n=e.text)==null?void 0:n.trim();return t?{ok:!0,branch:"inline",text:t}:{ok:!1,code:"no_source",branch:"inline",message:"这条内容没有正文"}}const ob={stt:!1,ocr:!1,article:!1};function wZ(e){const t=e.content,n=(t==null?void 0:t.media)??[];return{archetype:(t==null?void 0:t.archetype)??((n??[]).some(i=>i.kind==="video"||i.kind==="audio")?"video":(n??[]).some(i=>i.kind==="image")?"gallery":e.url?"link":"text"),text:t==null?void 0:t.text,media:n,quoted:t==null?void 0:t.quoted}}function SZ(e,t){const n=jM(wZ(e),t,e.url);return n.ok&&n.branch!=="inline"}const kM=p.createContext(ob);function jZ({caps:e,children:t}){return l.jsx(kM.Provider,{value:e,children:t})}function CZ(){const e=p.useContext(kM);return p.useMemo(()=>t=>SZ(t,e),[e])}function kZ(e){var n;const t=(n=e.find(r=>r.kind==="extract"))==null?void 0:n.branches;return{stt:!!(t!=null&&t.stt),ocr:!!(t!=null&&t.ocr),article:!!(t!=null&&t.article)}}function NZ(e,t){const[n,r]=p.useState(()=>({caps:ob,status:"loading"})),i=e.baseUrl;return p.useEffect(()=>{let o=!1;return be.conversions.kinds(e).then(c=>{o||r({caps:kZ(c.items),status:"ready"})}).catch(()=>{o||r({caps:ob,status:"error"})}),()=>{o=!0}},[i,t]),n}function NM({item:e,videoDl:t,children:n}){const r=CZ();return l.jsxs(Nu,{children:[l.jsx(Tu,{asChild:!0,children:n}),l.jsxs(kl,{size:"sm",children:[l.jsxs(Er,{onSelect:()=>void O1(e),children:[l.jsx(Rp,{}),"在对话中引用"]}),r(e)?l.jsxs(Er,{onSelect:()=>void ML(ut,e),children:[l.jsx(lL,{}),"转成文字"]}):null,e.url?l.jsx(Er,{asChild:!0,children:l.jsxs("a",{href:e.url,target:"_blank",rel:"noreferrer",children:[l.jsx(Mp,{}),"打开原文"]})}):null,t?l.jsxs(Er,{onSelect:()=>wQ(t),children:[l.jsx(vc,{}),"下载视频"]}):null]})]})}function TM({noteId:e,initialLiked:t=!1,initialCollected:n=!1,likeCount:r,className:i}){const[o,c]=p.useState(t),[d,h]=p.useState(n),[m,x]=p.useState(!1);async function g(S){if(m)return;const b=S==="like"?o:d,j=S==="like"?c:h,C=S==="like"?b?"unlike":"like":b?"uncollect":"collect";j(!b),x(!0);try{await be.interactXhs(ut,{noteId:e,action:C})}catch(k){j(b),Ge.error(S==="like"?"点赞失败":"收藏失败",{description:k instanceof Error?k.message:""})}finally{x(!1)}}const v=r==null?null:r+(o===t?0:o?1:-1);return l.jsxs(l.Fragment,{children:[l.jsxs(Ne,{variant:"neutral",size:"small","aria-pressed":o,"aria-label":o?"取消点赞":"点赞",title:o?"取消点赞":"点赞",className:i,onClick:S=>{S.stopPropagation(),g("like")},children:[l.jsx(Bd,{className:Y(o&&"fill-current text-rose-500")}),v??null]}),l.jsx(Ne,{variant:"neutral",size:"small","aria-pressed":d,"aria-label":d?"取消收藏":"收藏",title:d?"取消收藏":"收藏",onClick:S=>{S.stopPropagation(),g("collect")},children:l.jsx(nL,{className:Y(d&&"fill-current text-amber-500")})})]})}const EM=60;function TZ({item:e,onOpen:t,onPlayAudio:n}){var U,K,ne;const{t:r}=Sp(),i=xM(e,ut),{firstMedia:o,isVideoNote:c,video:d,audioTrack:h,audioPlaying:m,onAudioActivate:x,title:g,summary:v,quoted:S,avatar:b,videoDl:j,canDownload:C,xhsParams:k}=vM(e,{onPlayAudio:n}),N=(k==null?void 0:k.source)==="xhs",E=o,[,R]=p.useState(0),_=nb(E==null?void 0:E.src)??(E!=null&&E.w&&(E!=null&&E.h)?{w:E.w,h:E.h}:void 0),z=_?_.h/_.w:void 0,D=z===void 0?void 0:iM(z),V=_&&D!==void 0?D===z?`${_.w} / ${_.h}`:`1 / ${D}`:EQ,I=v.length>EM?`${v.slice(0,EM)}…`:v,Q=g||I||e.author||e.stream_id,B=c||!!d,H=(ne=(K=(U=e.content)==null?void 0:U.media)==null?void 0:K.find(q=>q.kind==="video"))==null?void 0:ne.duration_s,ee=B?H:h==null?void 0:h.durationS,W=h&&x?l.jsx("button",{type:"button","aria-label":r(m?"timeline.pause":"timeline.play"),onClick:q=>{q.stopPropagation(),x()},className:"flex size-10 items-center justify-center rounded-full bg-black/55 text-white shadow-sm transition-colors hover:bg-black/70",children:m?l.jsx(Bi,{className:"size-5 fill-current"}):l.jsx(qn,{className:"size-5 translate-x-px fill-current"})}):null,M=l.jsx("div",{ref:i,"data-nested-surface":"true","data-item-id":e.id,role:"button",tabIndex:0,"aria-label":Q,onClick:()=>t(e,{intent:"read"}),onKeyDown:q=>{q.target===q.currentTarget&&(q.key!=="Enter"&&q.key!==" "||(q.preventDefault(),t(e,{intent:"read"})))},className:"group block w-full cursor-pointer rounded-xl text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:l.jsxs(fo,{nestedSurface:!0,className:Y("flex flex-col overflow-hidden p-0",hA),children:[E?l.jsxs(jy,{ratio:V,src:E.src,alt:E.alt??"",onClick:q=>{q.stopPropagation(),t(e,{intent:"watch"})},onNaturalSize:(q,P)=>{nb(E.src)||(CQ(E.src,q,P),R(L=>L+1))},children:[B?l.jsx("span",{"data-slot":"post-card-video-badge","aria-label":r("timeline.play"),className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:l.jsx("span",{className:"flex size-9 items-center justify-center rounded-full bg-black/55 text-white shadow-sm",children:l.jsx(qn,{className:"size-4 translate-x-px fill-current"})})}):null,!B&&W?l.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:W}):null,typeof ee=="number"?l.jsx("span",{className:"absolute bottom-1.5 right-1.5 rounded-full bg-black/55 px-2 py-0.5 text-[11px] tabular-nums text-white",children:Bh(ee)}):null]}):null,l.jsxs("div",{className:"flex flex-col gap-1 px-3 pb-2.5 pt-2.5",children:[g?l.jsx(Eh,{className:"self-stretch line-clamp-2 whitespace-normal",children:g}):null,v?l.jsx(Sy,{className:Y("whitespace-normal",g?"line-clamp-2":"line-clamp-3"),children:v}):null,S?l.jsx(fo,{"data-post-card-quote":"true",className:"mt-1.5 rounded-lg px-2.5 py-2 text-[12px] leading-snug text-muted-foreground",children:l.jsxs("div",{className:"line-clamp-3 whitespace-normal",children:[S.author?l.jsxs("span",{className:"font-medium text-foreground/70",children:["@",S.author,":"]}):null,S.text]})}):null,!E&&W?l.jsxs("div",{className:"mt-1 flex items-center gap-2.5",children:[W,typeof ee=="number"?l.jsx("span",{className:"text-[12px] tabular-nums text-muted-foreground",children:Bh(ee)}):null]}):null,l.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-1.5 text-[12px] text-muted-foreground",children:[l.jsxs(yM,{className:"size-4 shrink-0",children:[b?l.jsx(bM,{src:b,alt:"",className:"object-cover"}):null,l.jsx(wM,{children:l.jsx(k1,{className:"size-2.5"})})]}),l.jsx("span",{className:"truncate",children:e.author||e.stream_id}),l.jsx("span",{className:"shrink-0 opacity-70",children:"·"}),l.jsx("span",{className:"shrink-0 opacity-70",children:nM(e.timestamp)}),N&&k?l.jsx("div",{className:"ml-auto flex shrink-0 items-center gap-1 opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100",children:l.jsx(TM,{noteId:k.noteId})}):null]})]})]})});return l.jsx(NM,{item:e,videoDl:C?j:void 0,children:M})}const EZ=p.createContext(null);function RZ(){const e=p.useContext(EZ);if(!e)throw new Error("useVideoStage must be used inside <VideoStageContext.Provider>");return e}const Hh=507,AZ=510,MZ=16/9,DZ=2,_Z=800;function Vn(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function OZ(e,t){return e&&Vn(e.width)&&Vn(e.height)?e:t&&Vn(t.width)&&Vn(t.height)?t:null}function zZ({naturalWidth:e,naturalHeight:t,containerWidth:n,minWidth:r,maxWidth:i,maxHeight:o}){const c=Vn(e)&&Vn(t)?e/t:MZ;if(!Vn(n)&&!Vn(r))return{width:0,height:0,ratio:c};let d=Vn(n)?n:r;return Vn(i)&&(d=Math.min(d,i)),Vn(o)&&(d=Math.min(d,o*c)),Vn(r)&&(d=Math.max(d,r)),{width:Math.round(d),height:Math.round(d/c),ratio:c}}const qh=p.forwardRef(function({kind:t="image",src:n,alt:r="",naturalWidth:i,naturalHeight:o,mediaSize:c,minWidth:d,maxWidth:h,maxHeight:m,videoMaxHeight:x,frameClassName:g,imageClassName:v,fallback:S,onSizingChange:b,maxRetries:j=DZ,retryDelayMs:C=_Z,className:k,children:N,...E},R){const A=p.useRef(null),[_,z]=p.useState(0),[D,V]=p.useState(null),I=p.useCallback(ne=>{A.current=ne,typeof R=="function"?R(ne):R&&(R.current=ne)},[R]);p.useLayoutEffect(()=>{V(null)},[n]),p.useLayoutEffect(()=>{const ne=A.current;if(!ne)return;z(ne.clientWidth);const q=new ResizeObserver(P=>{var L;return z(((L=P[0])==null?void 0:L.contentRect.width)??0)});return q.observe(ne),()=>q.disconnect()},[]);const Q=Vn(i)&&Vn(o)?{width:i,height:o}:null,B=OZ(c,Q??D),H=Vn(m)?m:t==="video"?Hh:AZ,ee=t==="video"&&Vn(x)?Math.min(H,x):H,W=B?B.height>B.width:!1,M=t==="video"?W?9/16:16/9:B?B.width/B.height:16/9,U=zZ({naturalWidth:M,naturalHeight:1,containerWidth:_,minWidth:d,maxWidth:h,maxHeight:ee});p.useEffect(()=>{b==null||b({naturalW:(B==null?void 0:B.width)??0,naturalH:(B==null?void 0:B.height)??0,containerW:_,maxHeight:ee,box:U})},[_,U.width,U.height,U.ratio,B==null?void 0:B.width,B==null?void 0:B.height,ee,b]);const K=t==="video"?W?"9 / 16":"16 / 9":B?`${B.width} / ${B.height}`:"16 / 9";return l.jsx("div",{ref:I,"data-slot":"media-box",className:Y("w-full",k),style:{maxWidth:h},...E,children:l.jsx(jy,{"data-slot":"media-box-frame",ratio:K,style:{width:U.width||void 0},className:Y("block [transform:translateZ(0)] rounded-2xl border border-[var(--acr-border)] bg-black [&_video]:rounded-[inherit]",g),src:n,alt:r,fallback:S,imageClassName:v,maxRetries:j,retryDelayMs:C,onNaturalSize:(ne,q)=>{Q||V({width:ne,height:q})},children:N})})});var RM=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Kh="html",lb="svg",PZ="http://www.w3.org/2000/svg",LZ=function(e,t){var n,r,i,o=(n=e.ownerDocument)!==null&&n!==void 0?n:document,c=(i=(r=o.defaultView)!==null&&r!==void 0?r:o.parentWindow)!==null&&i!==void 0?i:window;switch(t){case Kh:return e instanceof c.HTMLElement;case lb:return e instanceof c.SVGElement;default:throw new Error('Unrecognized element type "'.concat(t,'" for validateElementType.'))}},AM=function(e,t){var n,r,i={},o,c,d;switch(e){case Kh:d=document.createElement((n=t==null?void 0:t.containerElement)!==null&&n!==void 0?n:"div");break;case lb:d=document.createElementNS(PZ,(r=t==null?void 0:t.containerElement)!==null&&r!==void 0?r:"g");break;default:throw new Error('Invalid element type "'.concat(e,'" for createPortalNode: must be "html" or "svg".'))}if(t&&typeof t=="object"&&t.attributes)for(var h=0,m=Object.entries(t.attributes);h<m.length;h++){var x=m[h],g=x[0],v=x[1];d.setAttribute(g,v)}var S={element:d,elementType:e,setPortalProps:function(b){i=b},getInitialPortalProps:function(){return i},mount:function(b,j){if(j!==c){if(S.unmount(),b!==o&&!LZ(b,e))throw new Error('Invalid element type for portal: "'.concat(e,'" portalNodes must be used with ').concat(e," elements, but OutPortal is within <").concat(b.tagName,">."));b.replaceChild(S.element,j),o=b,c=j}},unmount:function(b){b&&b!==c||o&&c&&(o.replaceChild(c,S.element),o=void 0,c=void 0)}};return S};(function(e){RM(t,e);function t(n){var r=e.call(this,n)||this;return r.addPropsChannel=function(){Object.assign(r.props.node,{setPortalProps:function(i){r.setState({nodeProps:i})}})},r.state={nodeProps:r.props.node.getInitialPortalProps()},r}return t.prototype.componentDidMount=function(){this.addPropsChannel()},t.prototype.componentDidUpdate=function(){this.addPropsChannel()},t.prototype.render=function(){var n=this,r=this.props,i=r.children,o=r.node;return Ba.createPortal(p.Children.map(i,function(c){return p.isValidElement(c)?p.cloneElement(c,n.state.nodeProps):c}),o.element)},t})(p.PureComponent);var IZ=(function(e){RM(t,e);function t(n){var r=e.call(this,n)||this;return r.placeholderNode=p.createRef(),r.passPropsThroughPortal(),r}return t.prototype.passPropsThroughPortal=function(){var n=Object.assign({},this.props,{node:void 0});this.props.node.setPortalProps(n)},t.prototype.componentDidMount=function(){var n=this.props.node;this.currentPortalNode=n;var r=this.placeholderNode.current,i=r.parentNode;n.mount(i,r),this.passPropsThroughPortal()},t.prototype.componentDidUpdate=function(){var n=this.props.node;this.currentPortalNode&&n!==this.currentPortalNode&&(this.currentPortalNode.unmount(this.placeholderNode.current),this.currentPortalNode.setPortalProps({}),this.currentPortalNode=n);var r=this.placeholderNode.current,i=r.parentNode;n.mount(i,r),this.passPropsThroughPortal()},t.prototype.componentWillUnmount=function(){var n=this.props.node;n.unmount(this.placeholderNode.current),n.setPortalProps({})},t.prototype.render=function(){var n=this.props.node.element.tagName,r=this.props.node.elementType===Kh?n.toLowerCase():n;return p.createElement(r,{ref:this.placeholderNode})},t})(p.PureComponent);AM.bind(null,Kh),AM.bind(null,lb);const $Z=IZ;function BZ({node:e,onExpand:t,expandTitle:n,expandAriaLabel:r}){return l.jsxs("div",{"data-slot":"media-box-player",className:"group absolute inset-0",children:[l.jsx("div",{className:"thumb-player absolute inset-0",children:l.jsx($Z,{node:e})}),t?l.jsx("button",{type:"button",onClick:i=>{i.stopPropagation(),t()},title:n,"aria-label":r||n,className:"absolute right-2 top-2 z-10 rounded-full bg-black/55 p-1.5 text-white opacity-0 transition-opacity hover:bg-black/75 group-hover:opacity-100",children:l.jsx(Op,{className:"size-4"})}):null]})}const Gh=520;function MM({label:e,onActivate:t,children:n}){return l.jsx("div",{"data-slot":"media-hit",role:"button",tabIndex:0,"aria-label":e,title:e,className:"absolute inset-0 flex items-center justify-center",onClick:r=>{r.stopPropagation(),t()},onKeyDown:r=>{r.key!=="Enter"&&r.key!==" "||(r.preventDefault(),r.stopPropagation(),t())},children:n})}function UZ({item:e,last:t,onOpen:n,onPlayAudio:r}){return l.jsxs(l.Fragment,{children:[l.jsx(VZ,{item:e,onOpen:n,onPlayAudio:r}),t?null:l.jsx(Uk,{className:"mx-3 bg-[var(--acr-border-soft)]"})]})}function VZ({item:e,onOpen:t,onPlayAudio:n}){const r=xM(e,ut),{media:i,firstMedia:o,video:c,isVideoNote:d,audioTrack:h,audioPlaying:m,onAudioActivate:x,title:g,summary:v,quoted:S,avatar:b,videoDl:j,canDownload:C,xhsParams:k}=vM(e,{onPlayAudio:n}),N=(k==null?void 0:k.source)==="xhs",E=l.jsxs(Tr,{ref:r,"data-item-id":e.id,variant:"outline",role:"button",tabIndex:0,onClick:()=>t(e,{intent:"read"}),onKeyDown:R=>{(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),t(e,{intent:"read"}))},className:"group/row w-full cursor-pointer items-start !bg-transparent !backdrop-blur-none hover:!bg-transparent focus-visible:border-transparent focus-visible:ring-0",children:[l.jsxs(vF,{className:"flex-row items-center gap-3",children:[l.jsx(Jc,{variant:"avatar",children:l.jsxs(yM,{children:[b?l.jsx(bM,{src:b,alt:"",className:"object-cover"}):null,l.jsx(wM,{children:l.jsx(k1,{className:"size-3.5"})})]})}),l.jsxs("div",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx(fa,{children:e.author||e.stream_id}),l.jsxs(no,{children:[e.stream_id," · ",nM(e.timestamp)]})]}),N&&k?l.jsx("div",{className:"flex shrink-0 items-center gap-1 opacity-0 transition-opacity focus-within:opacity-100 group-hover/row:opacity-100",children:l.jsx(TM,{noteId:k.noteId})}):null,l.jsx(Bt,{variant:"secondary",size:"sm",children:e.type})]})]}),l.jsxs(zs,{className:"-my-2 pl-[52px] pr-2.5",children:[g?l.jsx(fa,{className:"whitespace-normal text-[14px]",children:g}):null,v?l.jsx(no,{className:"mt-1 line-clamp-3",children:v}):null,S?l.jsxs("div",{className:"mt-2 line-clamp-2 border-l-2 border-[var(--acr-border-soft)] pl-2.5 text-[13px] text-muted-foreground",children:[S.author?l.jsxs("span",{className:"font-medium text-foreground/70",children:["@",S.author,":"]}):null,S.text]}):null,c?l.jsx(FZ,{item:e,media:c,poster:o==null?void 0:o.src,className:"mt-2"}):h&&x?l.jsx(HZ,{poster:o==null?void 0:o.src,playing:m,durationS:h.durationS,onActivate:x}):o?l.jsx(qZ,{media:i,compact:!0,isVideo:d,onOpen:R=>t(e,{mediaIndex:R,intent:"watch"})}):null]})]});return l.jsx(NM,{item:e,videoDl:C?j:void 0,children:E})}function FZ({item:e,media:t,poster:n,className:r="mt-3"}){const i=RZ(),o=p.useRef(null),c=!!i.node&&i.activeId===e.id&&i.openId!==e.id,d=n||t.poster;return p.useEffect(()=>{if(!c||typeof IntersectionObserver>"u")return;const h=o.current;if(!h)return;const m=h.closest('[data-slot="shell-content"]'),x=new IntersectionObserver(g=>{var v;g[0].isIntersecting||(v=h.querySelector("video"))==null||v.pause()},{root:m,threshold:0});return x.observe(h),()=>x.disconnect()},[c]),c?l.jsx("div",{ref:o,"data-slot":"acrylic-inline-video",children:l.jsx(qh,{kind:"video",src:d,mediaSize:i.videoSize?{width:i.videoSize.w,height:i.videoSize.h}:null,className:r,maxWidth:Gh,videoMaxHeight:Hh,children:l.jsx("div",{className:"h-full w-full",onClick:h=>h.stopPropagation(),children:l.jsx(BZ,{node:i.node})})})}):l.jsx(qh,{kind:"video",src:d,className:r,maxWidth:Gh,videoMaxHeight:Hh,children:l.jsx(MM,{label:"播放视频",onActivate:()=>i.play(e,t),children:l.jsx("span",{className:"flex size-10 items-center justify-center rounded-full bg-black/55 text-white shadow-sm",children:l.jsx(qn,{className:"size-5 translate-x-px fill-current"})})})})}function HZ({poster:e,playing:t,durationS:n,onActivate:r}){const{t:i}=Sp(),o=i(t?"timeline.pause":"timeline.play"),c=t?l.jsx(Bi,{className:"size-5 fill-current"}):l.jsx(qn,{className:"size-5 translate-x-px fill-current"}),d=l.jsx("button",{type:"button","aria-label":o,title:o,onClick:h=>{h.stopPropagation(),r()},className:"flex size-10 items-center justify-center rounded-full bg-black/55 text-white shadow-sm transition-colors hover:bg-black/70",children:c});return e?l.jsxs(qh,{kind:"image",src:e,className:"mt-2",maxWidth:Gh,children:[l.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:d}),typeof n=="number"?l.jsx("span",{className:"absolute bottom-1.5 right-1.5 rounded-full bg-black/55 px-2 py-0.5 text-[11px] tabular-nums text-white",children:Bh(n)}):null]}):l.jsxs("div",{className:"mt-2 flex items-center gap-2.5",onClick:h=>h.stopPropagation(),children:[d,typeof n=="number"?l.jsx("span",{className:"text-[12px] tabular-nums text-muted-foreground",children:Bh(n)}):null]})}function qZ({media:e,compact:t=!1,isVideo:n=!1,onOpen:r}){const i=e[0];return i?e.length>1&&!t?l.jsx("div",{className:"mt-3 grid max-w-xl grid-cols-2 gap-2",children:e.slice(0,4).map((o,c)=>l.jsxs("button",{type:"button",onClick:d=>{d.stopPropagation(),r==null||r(c)},className:"relative overflow-hidden rounded-[9px] border border-[var(--acr-border)] bg-[var(--acr-card-nested)]",children:[l.jsx("img",{src:o.src,alt:o.alt||"",referrerPolicy:"no-referrer",className:"aspect-square size-full object-cover",loading:"lazy"}),c===3&&e.length>4?l.jsxs("div",{className:"absolute inset-0 flex items-center justify-center bg-black/45 text-[13px] font-medium text-white",children:["+",e.length-4]}):null]},`${o.src}-${c}`))}):l.jsx(qh,{kind:n?"video":"image",src:i.src,alt:i.alt,naturalWidth:i.w,naturalHeight:i.h,className:"mt-2",maxWidth:t?Gh:void 0,videoMaxHeight:t&&n?Hh:void 0,children:r?l.jsx(MM,{label:n?"视频":"查看大图",onActivate:()=>r(0),children:n?l.jsx("span",{className:"flex size-9 items-center justify-center rounded-full bg-black/55 pl-0.5 text-[15px] text-white",children:"▶"}):null}):n?l.jsx("div",{"aria-label":"视频",className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:l.jsx("span",{className:"flex size-9 items-center justify-center rounded-full bg-black/55 pl-0.5 text-[15px] text-white",children:"▶"})}):null}):null}function KZ(e){const[t,n]=p.useState(0);p.useLayoutEffect(()=>{const o=e.current;if(!o||typeof ResizeObserver>"u")return;const c=new ResizeObserver(([d])=>n(d.contentRect.width));return c.observe(o),()=>c.disconnect()},[e]);const r=qQ(t),i=t>0?t/r:aM;return{colCount:r,colWidth:i}}function GZ(e,t,n){const r=p.useRef(null);return p.useMemo(()=>{const i=QQ(e.map(YQ),t,n,r.current??void 0);return r.current=i,i},[e,t,n])}function DM({n:e,expanded:t,lead:n,onToggle:r}){return l.jsxs("div",{className:"flex w-full items-center gap-2 px-3 py-1 text-xs text-muted-foreground",children:[l.jsxs("button",{type:"button","data-slot":"same-story-toggle",onClick:r,className:"flex items-center gap-1 text-left hover:text-foreground",children:[l.jsx("span",{"aria-hidden":!0,children:t?"▾":"▸"}),JQ(e,t)]}),n&&l.jsx("span",{"data-slot":"same-story-lead",className:"text-[11px] opacity-70",children:n})]})}function YZ({items:e,layout:t,channelId:n,onOpen:r,onPlayAudio:i,className:o}){const c=p.useRef(null),[d,h]=p.useState(()=>new Set),{rendered:m,hidden:x,membersOf:g}=p.useMemo(()=>ZQ(e,d),[e,d]),v=b=>h(j=>eZ(j,b)),S=p.useRef({layout:t,channelId:n});if(p.useEffect(()=>{var C,k;const b=S.current;if(S.current={layout:t,channelId:n},b.layout===t||b.channelId!==n)return;const j=(C=c.current)==null?void 0:C.closest('[data-slot="shell-content"]');(k=j==null?void 0:j.scrollTo)==null||k.call(j,{top:0})},[t,n]),t==="list"){const b={onOpen:r,onPlayAudio:i};return l.jsx("div",{ref:c,className:o,children:l.jsx(eu,{className:"w-full gap-0",children:m.map((j,C)=>{var E;const k=(E=j.storyGroup)!=null&&E.isRep?j.storyGroup.id:void 0,N=k?x.get(k)??0:0;return l.jsxs("div",{className:"w-full",children:[l.jsx(UZ,{item:j,last:C===m.length-1&&N===0,...b}),k&&(N>0||d.has(k))&&l.jsx(DM,{n:N,expanded:d.has(k),lead:oM(j,g.get(k)??[]),onToggle:()=>v(k)})]},j.id)})})})}return l.jsx(WZ,{rootRef:c,items:m,hidden:x,membersOf:g,expanded:d,onToggleGroup:v,handlers:{onOpen:r,onPlayAudio:i},className:o})}function WZ({rootRef:e,items:t,hidden:n,membersOf:r,expanded:i,onToggleGroup:o,handlers:c,className:d}){const{colCount:h,colWidth:m}=KZ(e),{columns:x}=GZ(t,h,m),g=p.useMemo(()=>new Map(t.map(v=>[v.id,v])),[t]);return l.jsx("div",{ref:e,"data-slot":"post-feed-masonry",className:Y("flex w-full items-start gap-3",d),children:x.map((v,S)=>l.jsx("div",{"data-slot":"post-feed-column",className:"flex min-w-0 flex-1 flex-col gap-3",children:v.map(b=>{var N;const j=g.get(b);if(!j)return null;const C=(N=j.storyGroup)!=null&&N.isRep?j.storyGroup.id:void 0,k=C?n.get(C)??0:0;return l.jsxs("div",{className:"flex flex-col",children:[l.jsx(TZ,{item:j,...c}),C&&(k>0||i.has(C))&&l.jsx(DM,{n:k,expanded:i.has(C),lead:oM(j,r.get(C)??[]),onToggle:()=>o(C)})]},b)})},S))})}function XZ(){let e=null;return{arm:(t,n)=>{e={trackId:t,seconds:n}},retarget:t=>{e&&e.trackId!==t&&(e=null)},redeem:t=>{const n=e&&e.trackId===t?e.seconds:null;return e=null,n},clear:()=>{e=null}}}function QZ(e,t,n){if(!t)return!1;const r=e.redeem(n);return r===null?!1:(t.currentTime=r,!0)}function ZZ({elementRef:e,stageRef:t,onMediaEvent:n,children:r}){const i=p.useRef(null),o=e??i,[c,d]=p.useState(null),[h,m]=p.useState({music:[],podcast:[]}),[x,g]=p.useState("music"),[v,S]=p.useState(!1),b=p.useMemo(()=>QW(),[]),[j,C]=p.useState(0),k=p.useRef((()=>{if(typeof window>"u")return 1;const z=Number(window.localStorage.getItem("audioVolume"));return Number.isFinite(z)&&z>0?Math.min(1,z):1})()),N=p.useMemo(()=>XZ(),[]);p.useEffect(()=>{b.set(0),C(0),N.retarget(c==null?void 0:c.id),c&&E()},[c==null?void 0:c.id]),p.useEffect(()=>{o.current&&(o.current.volume=k.current)},[c==null?void 0:c.id]);const E=()=>{const z=o.current;return z?z.play().catch(D=>{D==null||D.name}):Promise.resolve()},R=async(z,D)=>{const V=["","ABORTED","NETWORK","DECODE","SRC_NOT_SUPPORTED"][(D==null?void 0:D.code)??0]||"UNKNOWN";let I=D?`MEDIA_ERR_${V}${D.message?` — ${D.message}`:""}`:"无法播放";if(z.url&&((D==null?void 0:D.code)===2||(D==null?void 0:D.code)===4))try{const B=await fetch(z.url);if(!B.ok){const H=await B.json().catch(()=>null);I+=` | 上游:${(H==null?void 0:H.detail)||(H==null?void 0:H.error)||`HTTP ${B.status}`}`}}catch(B){I+=` | 网络:${(B==null?void 0:B.message)||"请求失败"}`}const Q=`${z.title||"音频"}:${I}`;Ge.error("播放失败",{description:Q,action:{label:"复制错误",onClick:()=>{var B;return void((B=navigator.clipboard)==null?void 0:B.writeText(Q))}}})},A=p.useMemo(()=>{const z={current:c,playing:v,duration:j||(c==null?void 0:c.durationS)||0,activeKind:x,queues:h,queue:h[x],play:D=>{m(V=>({...V,[D.kind]:[D]})),g(D.kind),D.id===(c==null?void 0:c.id)?E():d(D)},playQueue:(D,V,I)=>{const Q=D[Math.max(0,Math.min(V,D.length-1))];Q&&(m(B=>({...B,[I]:D})),g(I),Q.id===(c==null?void 0:c.id)?E():d(Q))},toggle:()=>{const D=o.current;D&&(D.paused?E():D.pause())},seek:D=>{o.current&&(o.current.currentTime=D)},playAt:(D,V)=>{if(D.id===(c==null?void 0:c.id)){o.current&&(o.current.currentTime=V),E();return}N.arm(D.id,V),m(I=>({...I,[D.kind]:[D]})),g(D.kind),d(D)},stop:()=>{var D;(D=o.current)==null||D.pause(),N.clear(),d(null)},getVolume:()=>k.current,setVolume:D=>{const V=Math.max(0,Math.min(1,D));k.current=V,o.current&&(o.current.volume=V),window.localStorage.setItem("audioVolume",String(V))}};return t&&(t.current=z),z},[c,v,j,h,x,t]),_=()=>{S(!1);const z=(c==null?void 0:c.kind)??x,D=lY(h[z],c==null?void 0:c.id);D&&d(D)};return l.jsxs(Ry.Provider,{value:A,children:[l.jsx(vA.Provider,{value:b,children:r}),l.jsx("audio",{ref:o,src:c==null?void 0:c.url,onPlay:()=>S(!0),onPause:()=>S(!1),onTimeUpdate:z=>b.set(z.currentTarget.currentTime),onDurationChange:z=>C(z.currentTarget.duration||0),onError:z=>{var D;N.clear(),c&&R(c,z.currentTarget.error),n==null||n("error",`code=${((D=z.currentTarget.error)==null?void 0:D.code)??0}`)},onEnded:_,onLoadStart:()=>n==null?void 0:n("loadstart"),onLoadedMetadata:()=>{QZ(N,o.current,c==null?void 0:c.id),n==null||n("loadedmetadata")},onPlaying:()=>n==null?void 0:n("playing"),onWaiting:()=>n==null?void 0:n("waiting"),onStalled:()=>n==null?void 0:n("stalled"),onSuspend:()=>n==null?void 0:n("suspend"),hidden:!0})]})}function JZ(e){return e==="watch"}const eJ=Wy({marker:"data-stream-panel-detail",globalName:"__streamPanelDetail",file:"panel-detail",label:"详情"}),tJ=Wy({marker:"data-stream-panel-movie",globalName:"__streamPanelMovie",file:"panel-movie",label:"影视"}),_M=60,nJ="420px",rJ="min(1100px, 100vw)";function sJ({onWidthChange:e,onChannelNavState:t,registerChannelSetter:n,registerChannelReloader:r,onItemContext:i}={}){const[o,c]=p.useState([]),[d,h]=p.useState(),[m,x]=p.useState(!1),[g,v]=p.useState([]),[S,b]=p.useState([]),[j,C]=p.useState(Nh),k=p.useRef([]);k.current=g;const N=p.useRef(0),[E,R]=p.useState(null),[A,_]=p.useState("content"),[z,D]=p.useState(0);p.useEffect(()=>{_("content")},[j]);const[V,I]=p.useState(null),Q=p.useRef(null),B=p.useRef(void 0),H=p.useRef(!1),ee=p.useRef(null),W=p.useRef(null),{caps:M,status:U}=NZ(ut),K=VV(ut),ne=p.useMemo(()=>$V(ut),[]),[q,P]=p.useState(!1),[L,G]=p.useState(!1),J=p.useRef(K.state);J.current=K.state;const $=p.useRef(void 0);p.useEffect(()=>{$.current=U==="ready"?M:void 0},[M,U]);const[se,oe]=p.useState(!1),[ie,Z]=p.useState(),ve=p.useRef(null),Ee=p.useRef(null),[Te,Ie]=p.useState(!1),[Fe,fe]=p.useState(!1),[Se,ye]=p.useState(),Qe=p.useRef(null),nt=p.useRef(null),[re,_e]=p.useState(!1),[Pe,Xe]=p.useState(),ge=p.useCallback(()=>{be.channels(ut).then(Me=>v(Me)).catch(()=>{}),be.spaces(ut).then(Me=>b(Me)).catch(()=>{})},[]);p.useEffect(()=>{ge()},[ge]),p.useEffect(()=>Lk(be.wsUrl(ut),ge),[ge]);const Ye=e===void 0,je=g.find(Me=>Me.id===j),kt=(je==null?void 0:je.present)==="video",zt=Ye&&(je==null?void 0:je.present)==="audio",Qn=kt&&Ye,hn=(je==null?void 0:je.present)==="research",Zn=(je==null?void 0:je.present)==="tasks",sn=(je==null?void 0:je.present)==="embed",Jn=sn?aJ(je==null?void 0:je.options):void 0,we=p.useRef(void 0);we.current=je;const Oe=p.useMemo(()=>g.filter(Me=>Me.id===j),[g,j]),lt=p.useRef(Oe);lt.current=Oe,p.useEffect(()=>{const Me=++N.current;ee.current!==null&&(ee.current.scrollTop=0),c([]),h(void 0),B.current=void 0,H.current=!1,x(!1),!(kt||zt||hn||Zn||sn)&&be.channelItems(ut,j,{limit:_M}).then(Ue=>{Me===N.current&&(c(Ue.items),B.current=Ue.next_cursor)}).catch(Ue=>{Me===N.current&&h(Ue instanceof Error?Ue.message:String(Ue))})},[j,kt,zt,hn,Zn,sn]);const an=p.useCallback(()=>{const Me=B.current;if(!Me||H.current)return;const Ue=N.current;H.current=!0,x(!0),be.channelItems(ut,j,{limit:_M,cursor:Me}).then(ke=>{Ue===N.current&&(c(ft=>{const Pt=new Set(ft.map(Qt=>Qt.id));return[...ft,...ke.items.filter(Qt=>!Pt.has(Qt.id))]}),B.current=ke.next_cursor)}).catch(()=>{}).finally(()=>{Ue===N.current&&(H.current=!1,x(!1))})},[j]),en=E!==null;p.useEffect(()=>{e==null||e(en?rJ:nJ)},[en,e]),p.useEffect(()=>{t==null||t({spaces:S.map(Me=>({id:Me.id,label:Me.label})),channels:jR(g).map(Me=>({id:Me.id,label:Me.label,supported:Ny(Me),space_id:Me.space_id})),active:j})},[S,g,j,t]),p.useEffect(()=>{i==null||i({open:E===null?null:kR(E.item),recent:o.slice(0,$G).map(kR),fullscreen:en||Fe})},[o,E,en,Fe,i]),p.useEffect(()=>{n==null||n(Me=>{C(Ue=>{const ke=k.current.find(ft=>ft.id===Me);return ke!==void 0&&Ny(ke)?Me:Ue})})},[n]),p.useEffect(()=>{r==null||r(ge)},[r,ge]),p.useEffect(()=>{if(E===null)return;oe(!1),Z(void 0);let Me=!1,Ue;return eJ.load(ut.baseUrl).then(ke=>{Me||W.current===null||(ke.mount(W.current,{backend:ut.baseUrl,item:E.item,startMediaIndex:E.mediaIndex,autoPlayMedia:E.autoPlay,extractCaps:$.current,askChat:EL(),onClose:()=>R(null)}),Ue=ke,oe(!0))}).catch(ke=>{Me||Z(ke instanceof Error?ke.message:String(ke))}),()=>{Me=!0;const ke=Ue;ke!==void 0&&queueMicrotask(()=>ke.unmount())}},[E]);const bt=p.useCallback(Me=>{var ft;const Ue=uY(o,ut.baseUrl,"podcast"),ke=Ue.findIndex(Pt=>Pt.id===Me.id);ke>=0&&((ft=Q.current)==null||ft.playQueue(Ue,ke,"podcast"))},[o]),Ft=p.useCallback(()=>{const Me=be.refreshChannel(ut,j);Ge.promise(Me,{loading:"正在重新抓取…",success:Ue=>{const ke=`抓取完成:取到 ${Ue.fetched} 条,新增 ${Ue.written} 条`;return Ue.failed>0?`${ke}(${Ue.failed}/${Ue.streams.length} 条源没成)`:ke},error:Ue=>`抓取失败:${Ue instanceof Error?Ue.message:String(Ue)}`}),Me.catch(()=>{if(J.current!=="never-seen")return;const Ue=new Date;HV("harvest",qV("harvest"),Ue)&&(KV("harvest",Ue),G(!0))}).finally(()=>ge())},[j,ge]);p.useEffect(()=>{if(!Qn)return;Ie(!1),ye(void 0),fe(!1);let Me=!1,Ue;return tJ.load(ut.baseUrl).then(ke=>{Me||ve.current===null||(ke.mount(ve.current,{backend:ut.baseUrl,channels:lt.current,onChannelsChanged:ge,onReload:Ft,onOverlayChange:fe}),Ue=ke,Ee.current=ke,Ie(!0))}).catch(ke=>{Me||ye(ke instanceof Error?ke.message:String(ke))}),()=>{Me=!0,Ee.current=null;const ke=Ue;ke!==void 0&&queueMicrotask(()=>ke.unmount())}},[Qn,j,ge,Ft]),p.useEffect(()=>{var Me;Te&&((Me=Ee.current)==null||Me.update({backend:ut.baseUrl,channels:Oe,onChannelsChanged:ge,onReload:Ft,onOverlayChange:fe}))},[Te,Oe,ge,Ft]),p.useEffect(()=>{if(!hn||je===void 0)return;_e(!1),Xe(void 0);let Me=!1,Ue;return YX.load(ut.baseUrl).then(ke=>{if(Me||Qe.current===null)return;const ft=we.current;ft!==void 0&&(ke.mount(Qe.current,{backend:ut.baseUrl,channel:ft,onChannelsChanged:ge}),Ue=ke,nt.current=ke,_e(!0))}).catch(ke=>{Me||Xe(ke instanceof Error?ke.message:String(ke))}),()=>{Me=!0,nt.current=null;const ke=Ue;ke!==void 0&&queueMicrotask(()=>ke.unmount())}},[hn,j]),p.useEffect(()=>{var Me;!re||je===void 0||(Me=nt.current)==null||Me.update({backend:ut.baseUrl,channel:je,onChannelsChanged:ge})},[re,je,ge]);const jn=p.useCallback(Me=>{const Ue=Me.currentTarget;Ue.scrollHeight-Ue.scrollTop-Ue.clientHeight<Ue.clientHeight&&an()},[an]);return l.jsx(jZ,{caps:M,children:l.jsxs("div",{className:"relative flex h-full flex-col text-foreground",children:[l.jsx(NL,{}),K.state==="never-seen"&&K.declinedAt===void 0&&!q&&l.jsx(Ak,{variant:"banner",actions:ne,onDismiss:()=>P(!0),onConnected:K.refresh}),L&&K.state==="never-seen"&&l.jsx(UV,{actions:ne,onConnected:K.refresh}),t===void 0?l.jsx(IG,{channels:g,selected:j,onSelect:Me=>C(Me)}):null,l.jsx(ZZ,{stageRef:Q,children:kt?Ye?l.jsxs("div",{"data-testid":"panel-movie-host",className:"relative min-h-0 flex-1",children:[l.jsx("div",{ref:ve,className:"absolute inset-0 flex flex-col"}),Se!==void 0?l.jsxs("div",{"data-testid":"panel-movie-error",className:"absolute inset-0 flex items-center justify-center p-4 text-center text-sm text-destructive",children:["影视频道加载失败:",Se]}):Te?null:l.jsx("div",{"data-testid":"panel-movie-loading",className:"absolute inset-0 flex items-center justify-center text-sm text-muted-foreground",children:"加载中…"})]}):l.jsx("div",{"data-testid":"panel-movie-too-narrow",className:"p-4 text-sm text-muted-foreground",children:"影视频道要更宽的版面,请在工作台里打开。"}):zt&&je!==void 0?l.jsx(GX,{channel:je,onChannelsChanged:ge,onReload:Ft}):hn?l.jsxs("div",{"data-testid":"panel-research-host",className:"relative min-h-0 flex-1",children:[l.jsx("div",{ref:Qe,className:"absolute inset-0 flex flex-col"}),Pe!==void 0?l.jsxs("div",{"data-testid":"panel-research-error",className:"absolute inset-0 flex items-center justify-center p-4 text-center text-sm text-destructive",children:["研究频道加载失败:",Pe]}):re?null:l.jsx("div",{"data-testid":"panel-research-loading",className:"absolute inset-0 flex items-center justify-center text-sm text-muted-foreground",children:"加载中…"})]}):Zn?l.jsx("div",{"data-testid":"panel-tasks-host",className:"min-h-0 flex-1",children:l.jsx(vQ,{apiBase:ut.baseUrl,title:(je==null?void 0:je.label)??"定时任务"})}):sn&&je!==void 0?l.jsxs(l.Fragment,{children:[l.jsx("div",{"data-testid":"panel-timeline-header",className:"flex h-8 shrink-0 items-center gap-2 px-4 pt-3 pb-0 box-content",children:l.jsx(zf,{title:je.label,onRefresh:()=>D(Me=>Me+1),refreshLabel:"重新载入面板",exportChannel:{conn:ut,id:je.id},className:"min-w-0 flex-1"})}),l.jsx(by,{value:A,onChange:_}),A==="config"?l.jsx("div",{"data-testid":"panel-config",className:"min-h-0 flex-1 overflow-y-auto",children:l.jsx(bx,{conn:ut,children:l.jsx(yy,{conn:ut,channelId:je.id,showHeader:!1,onChanged:ge,onDeleted:()=>{_("content"),C(Nh)}})})}):Jn!==void 0?l.jsx("iframe",{"data-testid":"panel-embed-frame",title:je.label,src:Jn,sandbox:"allow-scripts allow-same-origin allow-forms allow-popups",className:"min-h-0 w-full flex-1 border-0 bg-background"},`${Jn}#${z}`):l.jsx("div",{"data-testid":"panel-embed-empty",className:"flex flex-1 items-center justify-center p-6 text-center text-sm text-muted-foreground",children:"这个外接面板还没有地址。到「配置」分页填一个 http(s) 网址,这里就会整页装它。"})]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{"data-testid":"panel-timeline-header",className:"flex h-8 shrink-0 items-center gap-2 px-4 pt-3 pb-0 box-content",children:l.jsx(zf,{title:(je==null?void 0:je.label)??"时间线",onRefresh:Ft,exportChannel:je?{conn:ut,id:je.id}:void 0,className:"min-w-0 flex-1"})}),je!==void 0?l.jsx(by,{value:A,onChange:_}):null,A==="config"&&je!==void 0?l.jsx("div",{"data-testid":"panel-config",className:"min-h-0 flex-1 overflow-y-auto",children:l.jsx(bx,{conn:ut,children:l.jsx(yy,{conn:ut,channelId:je.id,showHeader:!1,onChanged:ge,onDeleted:()=>{_("content"),C(Nh)},onEditStream:I})})}):d!==void 0?l.jsxs("div",{"data-testid":"panel-error",className:"p-4 text-sm text-destructive",children:["取内容失败:",d]}):l.jsxs("div",{ref:ee,"data-testid":"panel-scroll",className:"min-h-0 flex-1 overflow-y-auto p-5",onScroll:jn,children:[l.jsx(YZ,{items:o,layout:"waterfall",channelId:j,onOpen:(Me,Ue)=>R({item:Me,mediaIndex:(Ue==null?void 0:Ue.mediaIndex)??0,autoPlay:JZ(Ue==null?void 0:Ue.intent)}),onPlayAudio:bt}),m?l.jsx("div",{className:"py-3 text-center text-xs text-muted-foreground",children:"加载中…"}):null]})]})}),E!==null?l.jsxs(l.Fragment,{children:[l.jsx("div",{ref:W,className:"absolute inset-0"}),ie!==void 0?l.jsxs("div",{className:"absolute inset-0 flex items-center justify-center p-4 text-center text-sm text-destructive",children:["详情加载失败:",ie]}):se?null:l.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-sm text-muted-foreground",children:"加载中…"})]}):null,V!==null?l.jsx("div",{"data-testid":"panel-stream-setting",className:"absolute inset-0 z-10 flex flex-col bg-background",children:l.jsx(LG,{conn:ut,channelId:j,channelName:je==null?void 0:je.label,stream:V,onBack:()=>I(null),onSaved:ge})}):null]})})}function aJ(e){const t=e==null?void 0:e.url;if(!(typeof t!="string"||t.trim()===""))try{const n=new URL(t);return n.protocol==="http:"||n.protocol==="https:"?t:void 0}catch{return}}const OM="data-ds-dark-theme";function iJ(){return document.body.hasAttribute(OM)}function oJ(e){const t=()=>{const r=iJ();e.classList.toggle("dark",r),document.body.classList.toggle("dark",r)};t();const n=new MutationObserver(t);return n.observe(document.body,{attributes:!0,attributeFilter:[OM]}),()=>{n.disconnect(),document.body.classList.remove("dark")}}let Rl,Du,_u,Ou;function lJ(e){_u==null||_u(e)}function cJ(){Ou==null||Ou()}function uJ(e,t){RP(t.backend,t.backend.replace(/^http/,"ws")),D1(t.onAskChat),Du=oJ(e),Rl=kz.createRoot(e),Rl.render(l.jsx(p.StrictMode,{children:l.jsx(sJ,{onWidthChange:t.manageWidth===!1?void 0:n=>{e.style.width=n},onChannelNavState:t.onChannelNavState,onItemContext:t.onItemContext,registerChannelSetter:t.onChannelNavState===void 0?void 0:n=>{_u=n},registerChannelReloader:n=>{Ou=n}})}))}function dJ(){Rl==null||Rl.unmount(),Rl=void 0,Du==null||Du(),Du=void 0,_u=void 0,Ou=void 0,D1(void 0)}const fJ=Object.freeze(Object.defineProperty({__proto__:null,default:class gz{constructor(t,n){this.id=t,this.listeners=n}static async connect(t,n){const r=new Set,i=new ZV;return i.onmessage=o=>{r.forEach(c=>{c(o)})},n!=null&&n.headers&&(n.headers=Array.from(new Headers(n.headers).entries())),await Ok("plugin:websocket|connect",{url:t,onMessage:i,config:n}).then(o=>new gz(o,r))}addListener(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}async send(t){let n;if(typeof t=="string")n={type:"Text",data:t};else if(typeof t=="object"&&"type"in t)n=t;else if(Array.isArray(t))n={type:"Binary",data:t};else throw new Error("invalid `message` type, expected a `{ type: string, data: any }` object, a string or a numeric array");await Ok("plugin:websocket|send",{id:this.id,message:n})}async disconnect(){await this.send({type:"Close",data:{code:1e3,reason:"Disconnected by client"}})}}},Symbol.toStringTag,{value:"Module"}));return Zt.mount=uJ,Zt.reloadChannels=cJ,Zt.setChannel=lJ,Zt.unmount=dJ,Object.defineProperty(Zt,Symbol.toStringTag,{value:"Module"}),Zt})({});
|