tmex-cli 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +43 -0
- package/dist/runtime/server.js +1339 -135
- package/package.json +4 -3
- package/resources/fe-dist/assets/DevicePage-B2xsa-ys.js +21 -0
- package/resources/fe-dist/assets/DevicesPage-Bm7E9QAf.js +2 -0
- package/resources/fe-dist/assets/FilePage-DtXS6Krk.js +16 -0
- package/resources/fe-dist/assets/SettingsPage-Bxat-d_V.js +32 -0
- package/resources/fe-dist/assets/{arc-Wv219fq_.js → arc-CWkT1O24.js} +2 -2
- package/resources/fe-dist/assets/{architectureDiagram-3BPJPVTR-DkPPo2hY.js → architectureDiagram-3BPJPVTR-nu1LX68y.js} +2 -2
- package/resources/fe-dist/assets/{blockDiagram-GPEHLZMM-DPAThozG.js → blockDiagram-GPEHLZMM-DLFLNzT_.js} +2 -2
- package/resources/fe-dist/assets/{c4Diagram-AAUBKEIU-DBs_N-_p.js → c4Diagram-AAUBKEIU-BE8aWxc1.js} +2 -2
- package/resources/fe-dist/assets/{card-Dl0HC88A.js → card-Duis2VHj.js} +2 -2
- package/resources/fe-dist/assets/channel-zKL2OH3S.js +2 -0
- package/resources/fe-dist/assets/{chunk-2J33WTMH-D3mrUPCp.js → chunk-2J33WTMH-Dlc3MV0y.js} +2 -2
- package/resources/fe-dist/assets/{chunk-4BX2VUAB-C0DRv58j.js → chunk-4BX2VUAB-E9XGobks.js} +2 -2
- package/resources/fe-dist/assets/{chunk-55IACEB6-DheUp7iQ.js → chunk-55IACEB6-Bp7ueFZf.js} +2 -2
- package/resources/fe-dist/assets/{chunk-727SXJPM-Cvew2yIJ.js → chunk-727SXJPM-CQrvyHfQ.js} +2 -2
- package/resources/fe-dist/assets/{chunk-AQP2D5EJ-DUoa4Wdg.js → chunk-AQP2D5EJ-c0B1XNZr.js} +2 -2
- package/resources/fe-dist/assets/{chunk-FMBD7UC4-Bt9Oi52P.js → chunk-FMBD7UC4-BWQBkKWs.js} +2 -2
- package/resources/fe-dist/assets/{chunk-ND2GUHAM-DlWpyDaS.js → chunk-ND2GUHAM-D9TROogS.js} +2 -2
- package/resources/fe-dist/assets/{chunk-QZHKN3VN-BZtXwgRW.js → chunk-QZHKN3VN-DRXr6zVP.js} +2 -2
- package/resources/fe-dist/assets/classDiagram-4FO5ZUOK-Drw216KI.js +2 -0
- package/resources/fe-dist/assets/classDiagram-v2-Q7XG4LA2-Drw216KI.js +2 -0
- package/resources/fe-dist/assets/{cose-bilkent-S5V4N54A-yKy6sTY_.js → cose-bilkent-S5V4N54A-CBgJRn7g.js} +2 -2
- package/resources/fe-dist/assets/{dagre-BM42HDAG-DL4fpno6.js → dagre-BM42HDAG-ClYznWvX.js} +2 -2
- package/resources/fe-dist/assets/{diagram-2AECGRRQ-BueYws-9.js → diagram-2AECGRRQ-Br_41uIc.js} +2 -2
- package/resources/fe-dist/assets/{diagram-5GNKFQAL-GQEQSUeb.js → diagram-5GNKFQAL-BD9o1BrS.js} +2 -2
- package/resources/fe-dist/assets/{diagram-KO2AKTUF-LE3yI4ed.js → diagram-KO2AKTUF-Diq2zS9Y.js} +2 -2
- package/resources/fe-dist/assets/{diagram-LMA3HP47-BkHjYrU4.js → diagram-LMA3HP47-CLaOalPy.js} +2 -2
- package/resources/fe-dist/assets/{diagram-OG6HWLK6-DrnHic-P.js → diagram-OG6HWLK6-BcSlvdPy.js} +2 -2
- package/resources/fe-dist/assets/{erDiagram-TEJ5UH35-BCwWv-rO.js → erDiagram-TEJ5UH35-BNlad0c4.js} +2 -2
- package/resources/fe-dist/assets/{flowDiagram-I6XJVG4X-DEC2Z_fh.js → flowDiagram-I6XJVG4X-Zb1FLY00.js} +2 -2
- package/resources/fe-dist/assets/{ganttDiagram-6RSMTGT7-H1T5bCsY.js → ganttDiagram-6RSMTGT7-DPRPR5Is.js} +2 -2
- package/resources/fe-dist/assets/{gitGraphDiagram-PVQCEYII-DmZUfKfl.js → gitGraphDiagram-PVQCEYII-BENU2uEN.js} +2 -2
- package/resources/fe-dist/assets/index-CRCD4gPw.css +1 -0
- package/resources/fe-dist/assets/index-Den36xcn.js +488 -0
- package/resources/fe-dist/assets/{infoDiagram-5YYISTIA-fDOg9Qr5.js → infoDiagram-5YYISTIA-NfMlH21e.js} +2 -2
- package/resources/fe-dist/assets/{ishikawaDiagram-YF4QCWOH-QIvSJI3q.js → ishikawaDiagram-YF4QCWOH-CzK9-7uY.js} +2 -2
- package/resources/fe-dist/assets/{journeyDiagram-JHISSGLW-Iz7u4iH8.js → journeyDiagram-JHISSGLW-CIX5Ahuw.js} +2 -2
- package/resources/fe-dist/assets/{kanban-definition-UN3LZRKU-BYiFSFgn.js → kanban-definition-UN3LZRKU-C5Ccl5Cw.js} +2 -2
- package/resources/fe-dist/assets/{linear-DNHZFKop.js → linear-CBC08yeS.js} +2 -2
- package/resources/fe-dist/assets/markdown-preview-Bf_6UH9R.css +1 -0
- package/resources/fe-dist/assets/markdown-preview-Drd503bU.js +269 -0
- package/resources/fe-dist/assets/{mermaid.core-DUipsjFg.js → mermaid.core-DYl6mxS0.js} +6 -6
- package/resources/fe-dist/assets/{mindmap-definition-RKZ34NQL-tPbrKC3m.js → mindmap-definition-RKZ34NQL-ACR2SUDm.js} +2 -2
- package/resources/fe-dist/assets/{pieDiagram-4H26LBE5-26o8qBzb.js → pieDiagram-4H26LBE5-BuDDdwwy.js} +2 -2
- package/resources/fe-dist/assets/{quadrantDiagram-W4KKPZXB-BgpGo9Ak.js → quadrantDiagram-W4KKPZXB-CzM2Ydhy.js} +2 -2
- package/resources/fe-dist/assets/{refresh-cw-DdcimDhs.js → refresh-cw-DhzvbVDA.js} +2 -2
- package/resources/fe-dist/assets/{requirementDiagram-4Y6WPE33-BEfrxsDZ.js → requirementDiagram-4Y6WPE33-BveKh_kW.js} +2 -2
- package/resources/fe-dist/assets/{sankeyDiagram-5OEKKPKP-BuIeHyjh.js → sankeyDiagram-5OEKKPKP-BGQ6jtyE.js} +2 -2
- package/resources/fe-dist/assets/{sequenceDiagram-3UESZ5HK-CL0sinOn.js → sequenceDiagram-3UESZ5HK-D2fdqire.js} +2 -2
- package/resources/fe-dist/assets/{stateDiagram-AJRCARHV-BCq5X6hO.js → stateDiagram-AJRCARHV-DtuVBIq9.js} +2 -2
- package/resources/fe-dist/assets/stateDiagram-v2-BHNVJYJU-gun__PvU.js +2 -0
- package/resources/fe-dist/assets/{timeline-definition-PNZ67QCA-CnqqA91O.js → timeline-definition-PNZ67QCA-Dslo0JFS.js} +2 -2
- package/resources/fe-dist/assets/{vennDiagram-CIIHVFJN-BqFG3JXB.js → vennDiagram-CIIHVFJN-BLcoN4xU.js} +2 -2
- package/resources/fe-dist/assets/{wardley-L42UT6IY-DvfZKNwT.js → wardley-L42UT6IY-OsbD5r1L.js} +2 -2
- package/resources/fe-dist/assets/{wardleyDiagram-YWT4CUSO-DlABpMGt.js → wardleyDiagram-YWT4CUSO-B_33zIif.js} +2 -2
- package/resources/fe-dist/assets/{xychartDiagram-2RQKCTM6-BDiyUuus.js → xychartDiagram-2RQKCTM6-DcB27Ap1.js} +2 -2
- package/resources/fe-dist/fonts/GeistMonoNerdFontMono-Bold.woff2 +0 -0
- package/resources/fe-dist/fonts/GeistMonoNerdFontMono-Regular.woff2 +0 -0
- package/resources/fe-dist/index.html +2 -2
- package/resources/fe-dist/tmex-maskable.png +0 -0
- package/resources/fe-dist/tmex.png +0 -0
- package/resources/fe-dist/assets/DevicePage-5vkaNOjl.js +0 -26
- package/resources/fe-dist/assets/DevicesPage-CKnRUGQm.js +0 -2
- package/resources/fe-dist/assets/FilePage-Dj0cszD4.css +0 -1
- package/resources/fe-dist/assets/FilePage-Uj-tzGW7.js +0 -283
- package/resources/fe-dist/assets/SettingsPage-Cfzr_Phh.js +0 -22
- package/resources/fe-dist/assets/channel-DyLhDM_y.js +0 -2
- package/resources/fe-dist/assets/classDiagram-4FO5ZUOK-DA8DiM06.js +0 -2
- package/resources/fe-dist/assets/classDiagram-v2-Q7XG4LA2-DA8DiM06.js +0 -2
- package/resources/fe-dist/assets/index-OpBFduyh.js +0 -466
- package/resources/fe-dist/assets/index-yMgNjHUH.css +0 -1
- package/resources/fe-dist/assets/stateDiagram-v2-BHNVJYJU-DH2ctCND.js +0 -2
- package/resources/fe-dist/fonts/GeistMono-Bold.woff2 +0 -0
- package/resources/fe-dist/fonts/GeistMono-Regular.woff2 +0 -0
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SettingsPage-Bxat-d_V.js","assets/card-Duis2VHj.js","assets/refresh-cw-DhzvbVDA.js","assets/markdown-preview-Drd503bU.js","assets/markdown-preview-Bf_6UH9R.css","assets/DevicesPage-Bm7E9QAf.js","assets/DevicePage-B2xsa-ys.js","assets/FilePage-DtXS6Krk.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var PP=Object.defineProperty;var MT=e=>{throw TypeError(e)};var LP=(e,t,n)=>t in e?PP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var tt=(e,t,n)=>LP(e,typeof t!="symbol"?t+"":t,n),Zy=(e,t,n)=>t.has(e)||MT("Cannot "+n);var re=(e,t,n)=>(Zy(e,t,"read from private field"),n?n.call(e):t.get(e)),mt=(e,t,n)=>t.has(e)?MT("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Qe=(e,t,n,r)=>(Zy(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Ut=(e,t,n)=>(Zy(e,t,"access private method"),n);var kh=(e,t,n,r)=>({set _(o){Qe(e,t,o,n)},get _(){return re(e,t,r)}});function jP(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const a=Object.getOwnPropertyDescriptor(r,o);a&&Object.defineProperty(e,o,a.get?a:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(o){if(o.ep)return;o.ep=!0;const a=n(o);fetch(o.href,a)}})();const zP="modulepreload",FP=function(e){return"/"+e},OT={},rm=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){let l=function(d){return Promise.all(d.map(m=>Promise.resolve(m).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),f=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));o=l(n.map(d=>{if(d=FP(d),d in OT)return;OT[d]=!0;const m=d.endsWith(".css"),h=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${h}`))return;const y=document.createElement("link");if(y.rel=m?"stylesheet":zP,m||(y.as="script"),y.crossOrigin="",y.href=d,f&&y.setAttribute("nonce",f),document.head.appendChild(y),m)return new Promise((g,x)=>{y.addEventListener("load",g),y.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${d}`)))})}))}function a(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return o.then(l=>{for(const c of l||[])c.status==="rejected"&&a(c.reason);return t().catch(a)})};function im(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Jy={exports:{}},Lu={};/**
|
|
3
|
+
* @license React
|
|
4
|
+
* react-jsx-runtime.production.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/var NT;function BP(){if(NT)return Lu;NT=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,a){var l=null;if(a!==void 0&&(l=""+a),o.key!==void 0&&(l=""+o.key),"key"in o){a={};for(var c in o)c!=="key"&&(a[c]=o[c])}else a=o;return o=a.ref,{$$typeof:e,type:r,key:l,ref:o!==void 0?o:null,props:a}}return Lu.Fragment=t,Lu.jsx=n,Lu.jsxs=n,Lu}var AT;function UP(){return AT||(AT=1,Jy.exports=BP()),Jy.exports}var w=UP(),Dc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},HP={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Aa,Fx,OM,qP=(OM=class{constructor(){mt(this,Aa,HP);mt(this,Fx,!1)}setTimeoutProvider(e){Qe(this,Aa,e)}setTimeout(e,t){return re(this,Aa).setTimeout(e,t)}clearTimeout(e){re(this,Aa).clearTimeout(e)}setInterval(e,t){return re(this,Aa).setInterval(e,t)}clearInterval(e){re(this,Aa).clearInterval(e)}},Aa=new WeakMap,Fx=new WeakMap,OM),Ns=new qP;function VP(e){setTimeout(e,0)}var Ys=typeof window>"u"||"Deno"in globalThis;function kr(){}function $P(e,t){return typeof e=="function"?e(t):e}function yv(e){return typeof e=="number"&&e>=0&&e!==1/0}function BM(e,t){return Math.max(e+(t||0)-Date.now(),0)}function qa(e,t){return typeof e=="function"?e(t):e}function xi(e,t){return typeof e=="function"?e(t):e}function DT(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:a,queryKey:l,stale:c}=e;if(l){if(r){if(t.queryHash!==Bx(l,t.options))return!1}else if(!Sd(t.queryKey,l))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||o&&o!==t.state.fetchStatus||a&&!a(t))}function _T(e,t){const{exact:n,status:r,predicate:o,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Ks(t.options.mutationKey)!==Ks(a))return!1}else if(!Sd(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Bx(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ks)(e)}function Ks(e){return JSON.stringify(e,(t,n)=>bv(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Sd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Sd(e[n],t[n])):!1}var GP=Object.prototype.hasOwnProperty;function UM(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=IT(e)&&IT(t);if(!r&&!(bv(e)&&bv(t)))return t;const a=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),c=l.length,f=r?new Array(c):{};let d=0;for(let m=0;m<c;m++){const h=r?m:l[m],y=e[h],g=t[h];if(y===g){f[h]=y,(r?m<a:GP.call(e,h))&&d++;continue}if(y===null||g===null||typeof y!="object"||typeof g!="object"){f[h]=g;continue}const x=UM(y,g,n+1);f[h]=x,x===y&&d++}return a===c&&d===a?e:f}function Ep(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function IT(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function bv(e){if(!PT(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!PT(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function PT(e){return Object.prototype.toString.call(e)==="[object Object]"}function YP(e){return new Promise(t=>{Ns.setTimeout(t,e)})}function vv(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?UM(e,t):t}function KP(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function WP(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Ux=Symbol();function HM(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Ux?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Hx(e,t){return typeof e=="function"?e(...t):!!e}function XP(e,t,n){let r=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??(o=t()),r||(r=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),e}var Is,Da,dc,NM,QP=(NM=class extends Dc{constructor(){super();mt(this,Is);mt(this,Da);mt(this,dc);Qe(this,dc,t=>{if(!Ys&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){re(this,Da)||this.setEventListener(re(this,dc))}onUnsubscribe(){var t;this.hasListeners()||((t=re(this,Da))==null||t.call(this),Qe(this,Da,void 0))}setEventListener(t){var n;Qe(this,dc,t),(n=re(this,Da))==null||n.call(this),Qe(this,Da,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){re(this,Is)!==t&&(Qe(this,Is,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof re(this,Is)=="boolean"?re(this,Is):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Is=new WeakMap,Da=new WeakMap,dc=new WeakMap,NM),qx=new QP;function xv(){let e,t;const n=new Promise((o,a)=>{e=o,t=a});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}var ZP=VP;function JP(){let e=[],t=0,n=c=>{c()},r=c=>{c()},o=ZP;const a=c=>{t?e.push(c):o(()=>{n(c)})},l=()=>{const c=e;e=[],c.length&&o(()=>{r(()=>{c.forEach(f=>{n(f)})})})};return{batch:c=>{let f;t++;try{f=c()}finally{t--,t||l()}return f},batchCalls:c=>(...f)=>{a(()=>{c(...f)})},schedule:a,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{o=c}}}var Qn=JP(),fc,_a,hc,AM,eL=(AM=class extends Dc{constructor(){super();mt(this,fc,!0);mt(this,_a);mt(this,hc);Qe(this,hc,t=>{if(!Ys&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){re(this,_a)||this.setEventListener(re(this,hc))}onUnsubscribe(){var t;this.hasListeners()||((t=re(this,_a))==null||t.call(this),Qe(this,_a,void 0))}setEventListener(t){var n;Qe(this,hc,t),(n=re(this,_a))==null||n.call(this),Qe(this,_a,t(this.setOnline.bind(this)))}setOnline(t){re(this,fc)!==t&&(Qe(this,fc,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return re(this,fc)}},fc=new WeakMap,_a=new WeakMap,hc=new WeakMap,AM),Tp=new eL;function tL(e){return Math.min(1e3*2**e,3e4)}function qM(e){return(e??"online")==="online"?Tp.isOnline():!0}var wv=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function VM(e){let t=!1,n=0,r;const o=xv(),a=()=>o.status!=="pending",l=E=>{var R;if(!a()){const T=new wv(E);y(T),(R=e.onCancel)==null||R.call(e,T)}},c=()=>{t=!0},f=()=>{t=!1},d=()=>qx.isFocused()&&(e.networkMode==="always"||Tp.isOnline())&&e.canRun(),m=()=>qM(e.networkMode)&&e.canRun(),h=E=>{a()||(r==null||r(),o.resolve(E))},y=E=>{a()||(r==null||r(),o.reject(E))},g=()=>new Promise(E=>{var R;r=T=>{(a()||d())&&E(T)},(R=e.onPause)==null||R.call(e)}).then(()=>{var E;r=void 0,a()||(E=e.onContinue)==null||E.call(e)}),x=()=>{if(a())return;let E;const R=n===0?e.initialPromise:void 0;try{E=R??e.fn()}catch(T){E=Promise.reject(T)}Promise.resolve(E).then(h).catch(T=>{var O;if(a())return;const C=e.retry??(Ys?0:3),k=e.retryDelay??tL,M=typeof k=="function"?k(n,T):k,D=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,T);if(t||!D){y(T);return}n++,(O=e.onFail)==null||O.call(e,n,T),YP(M).then(()=>d()?void 0:g()).then(()=>{t?y(T):x()})})};return{promise:o,status:()=>o.status,cancel:l,continue:()=>(r==null||r(),o),cancelRetry:c,continueRetry:f,canStart:m,start:()=>(m()?x():g().then(x),o)}}var Ps,DM,$M=(DM=class{constructor(){mt(this,Ps)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),yv(this.gcTime)&&Qe(this,Ps,Ns.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ys?1/0:300*1e3))}clearGcTimeout(){re(this,Ps)&&(Ns.clearTimeout(re(this,Ps)),Qe(this,Ps,void 0))}},Ps=new WeakMap,DM),Ls,pc,bi,js,ar,Fd,zs,zi,Lo,_M,nL=(_M=class extends $M{constructor(t){super();mt(this,zi);mt(this,Ls);mt(this,pc);mt(this,bi);mt(this,js);mt(this,ar);mt(this,Fd);mt(this,zs);Qe(this,zs,!1),Qe(this,Fd,t.defaultOptions),this.setOptions(t.options),this.observers=[],Qe(this,js,t.client),Qe(this,bi,re(this,js).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Qe(this,Ls,jT(this.options)),this.state=t.state??re(this,Ls),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=re(this,ar))==null?void 0:t.promise}setOptions(t){if(this.options={...re(this,Fd),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=jT(this.options);n.data!==void 0&&(this.setState(LT(n.data,n.dataUpdatedAt)),Qe(this,Ls,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&re(this,bi).remove(this)}setData(t,n){const r=vv(this.state.data,t,this.options);return Ut(this,zi,Lo).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Ut(this,zi,Lo).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=re(this,ar))==null?void 0:r.promise;return(o=re(this,ar))==null||o.cancel(t),n?n.then(kr).catch(kr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(re(this,Ls))}isActive(){return this.observers.some(t=>xi(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ux||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>qa(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!BM(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=re(this,ar))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=re(this,ar))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),re(this,bi).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(re(this,ar)&&(re(this,zs)?re(this,ar).cancel({revert:!0}):re(this,ar).cancelRetry()),this.scheduleGc()),re(this,bi).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ut(this,zi,Lo).call(this,{type:"invalidate"})}async fetch(t,n){var f,d,m,h,y,g,x,E,R,T,C,k;if(this.state.fetchStatus!=="idle"&&((f=re(this,ar))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(re(this,ar))return re(this,ar).continueRetry(),re(this,ar).promise}if(t&&this.setOptions(t),!this.options.queryFn){const M=this.observers.find(D=>D.options.queryFn);M&&this.setOptions(M.options)}const r=new AbortController,o=M=>{Object.defineProperty(M,"signal",{enumerable:!0,get:()=>(Qe(this,zs,!0),r.signal)})},a=()=>{const M=HM(this.options,n),O=(()=>{const N={client:re(this,js),queryKey:this.queryKey,meta:this.meta};return o(N),N})();return Qe(this,zs,!1),this.options.persister?this.options.persister(M,O,this):M(O)},c=(()=>{const M={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:re(this,js),state:this.state,fetchFn:a};return o(M),M})();(d=this.options.behavior)==null||d.onFetch(c,this),Qe(this,pc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=c.fetchOptions)==null?void 0:m.meta))&&Ut(this,zi,Lo).call(this,{type:"fetch",meta:(h=c.fetchOptions)==null?void 0:h.meta}),Qe(this,ar,VM({initialPromise:n==null?void 0:n.initialPromise,fn:c.fetchFn,onCancel:M=>{M instanceof wv&&M.revert&&this.setState({...re(this,pc),fetchStatus:"idle"}),r.abort()},onFail:(M,D)=>{Ut(this,zi,Lo).call(this,{type:"failed",failureCount:M,error:D})},onPause:()=>{Ut(this,zi,Lo).call(this,{type:"pause"})},onContinue:()=>{Ut(this,zi,Lo).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0}));try{const M=await re(this,ar).start();if(M===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(M),(g=(y=re(this,bi).config).onSuccess)==null||g.call(y,M,this),(E=(x=re(this,bi).config).onSettled)==null||E.call(x,M,this.state.error,this),M}catch(M){if(M instanceof wv){if(M.silent)return re(this,ar).promise;if(M.revert){if(this.state.data===void 0)throw M;return this.state.data}}throw Ut(this,zi,Lo).call(this,{type:"error",error:M}),(T=(R=re(this,bi).config).onError)==null||T.call(R,M,this),(k=(C=re(this,bi).config).onSettled)==null||k.call(C,this.state.data,M,this),M}finally{this.scheduleGc()}}},Ls=new WeakMap,pc=new WeakMap,bi=new WeakMap,js=new WeakMap,ar=new WeakMap,Fd=new WeakMap,zs=new WeakMap,zi=new WeakSet,Lo=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...GM(r.data,this.options),fetchMeta:t.meta??null};case"success":const o={...r,...LT(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Qe(this,pc,t.manual?o:void 0),o;case"error":const a=t.error;return{...r,error:a,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Qn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),re(this,bi).notify({query:this,type:"updated",action:t})})},_M);function GM(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:qM(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function LT(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function jT(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var zr,on,Bd,Cr,Fs,mc,Uo,Ia,Ud,gc,yc,Bs,Us,Pa,bc,gn,Zu,Sv,Ev,Tv,Rv,Cv,kv,Mv,YM,IM,rL=(IM=class extends Dc{constructor(t,n){super();mt(this,gn);mt(this,zr);mt(this,on);mt(this,Bd);mt(this,Cr);mt(this,Fs);mt(this,mc);mt(this,Uo);mt(this,Ia);mt(this,Ud);mt(this,gc);mt(this,yc);mt(this,Bs);mt(this,Us);mt(this,Pa);mt(this,bc,new Set);this.options=n,Qe(this,zr,t),Qe(this,Ia,null),Qe(this,Uo,xv()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(re(this,on).addObserver(this),zT(re(this,on),this.options)?Ut(this,gn,Zu).call(this):this.updateResult(),Ut(this,gn,Rv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ov(re(this,on),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ov(re(this,on),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ut(this,gn,Cv).call(this),Ut(this,gn,kv).call(this),re(this,on).removeObserver(this)}setOptions(t){const n=this.options,r=re(this,on);if(this.options=re(this,zr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof xi(this.options.enabled,re(this,on))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ut(this,gn,Mv).call(this),re(this,on).setOptions(this.options),n._defaulted&&!Ep(this.options,n)&&re(this,zr).getQueryCache().notify({type:"observerOptionsUpdated",query:re(this,on),observer:this});const o=this.hasListeners();o&&FT(re(this,on),r,this.options,n)&&Ut(this,gn,Zu).call(this),this.updateResult(),o&&(re(this,on)!==r||xi(this.options.enabled,re(this,on))!==xi(n.enabled,re(this,on))||qa(this.options.staleTime,re(this,on))!==qa(n.staleTime,re(this,on)))&&Ut(this,gn,Sv).call(this);const a=Ut(this,gn,Ev).call(this);o&&(re(this,on)!==r||xi(this.options.enabled,re(this,on))!==xi(n.enabled,re(this,on))||a!==re(this,Pa))&&Ut(this,gn,Tv).call(this,a)}getOptimisticResult(t){const n=re(this,zr).getQueryCache().build(re(this,zr),t),r=this.createResult(n,t);return oL(this,r)&&(Qe(this,Cr,r),Qe(this,mc,this.options),Qe(this,Fs,re(this,on).state)),r}getCurrentResult(){return re(this,Cr)}trackResult(t,n){return new Proxy(t,{get:(r,o)=>(this.trackProp(o),n==null||n(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&re(this,Uo).status==="pending"&&re(this,Uo).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,o))})}trackProp(t){re(this,bc).add(t)}getCurrentQuery(){return re(this,on)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=re(this,zr).defaultQueryOptions(t),r=re(this,zr).getQueryCache().build(re(this,zr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Ut(this,gn,Zu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),re(this,Cr)))}createResult(t,n){var q;const r=re(this,on),o=this.options,a=re(this,Cr),l=re(this,Fs),c=re(this,mc),d=t!==r?t.state:re(this,Bd),{state:m}=t;let h={...m},y=!1,g;if(n._optimisticResults){const F=this.hasListeners(),G=!F&&zT(t,n),P=F&&FT(t,r,n,o);(G||P)&&(h={...h,...GM(m.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:x,errorUpdatedAt:E,status:R}=h;g=h.data;let T=!1;if(n.placeholderData!==void 0&&g===void 0&&R==="pending"){let F;a!=null&&a.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData)?(F=a.data,T=!0):F=typeof n.placeholderData=="function"?n.placeholderData((q=re(this,yc))==null?void 0:q.state.data,re(this,yc)):n.placeholderData,F!==void 0&&(R="success",g=vv(a==null?void 0:a.data,F,n),y=!0)}if(n.select&&g!==void 0&&!T)if(a&&g===(l==null?void 0:l.data)&&n.select===re(this,Ud))g=re(this,gc);else try{Qe(this,Ud,n.select),g=n.select(g),g=vv(a==null?void 0:a.data,g,n),Qe(this,gc,g),Qe(this,Ia,null)}catch(F){Qe(this,Ia,F)}re(this,Ia)&&(x=re(this,Ia),g=re(this,gc),E=Date.now(),R="error");const C=h.fetchStatus==="fetching",k=R==="pending",M=R==="error",D=k&&C,O=g!==void 0,_={status:R,fetchStatus:h.fetchStatus,isPending:k,isSuccess:R==="success",isError:M,isInitialLoading:D,isLoading:D,data:g,dataUpdatedAt:h.dataUpdatedAt,error:x,errorUpdatedAt:E,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>d.dataUpdateCount||h.errorUpdateCount>d.errorUpdateCount,isFetching:C,isRefetching:C&&!k,isLoadingError:M&&!O,isPaused:h.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:M&&O,isStale:Vx(t,n),refetch:this.refetch,promise:re(this,Uo),isEnabled:xi(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const F=_.data!==void 0,G=_.status==="error"&&!F,P=B=>{G?B.reject(_.error):F&&B.resolve(_.data)},U=()=>{const B=Qe(this,Uo,_.promise=xv());P(B)},H=re(this,Uo);switch(H.status){case"pending":t.queryHash===r.queryHash&&P(H);break;case"fulfilled":(G||_.data!==H.value)&&U();break;case"rejected":(!G||_.error!==H.reason)&&U();break}}return _}updateResult(){const t=re(this,Cr),n=this.createResult(re(this,on),this.options);if(Qe(this,Fs,re(this,on).state),Qe(this,mc,this.options),re(this,Fs).data!==void 0&&Qe(this,yc,re(this,on)),Ep(n,t))return;Qe(this,Cr,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!re(this,bc).size)return!0;const l=new Set(a??re(this,bc));return this.options.throwOnError&&l.add("error"),Object.keys(re(this,Cr)).some(c=>{const f=c;return re(this,Cr)[f]!==t[f]&&l.has(f)})};Ut(this,gn,YM).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ut(this,gn,Rv).call(this)}},zr=new WeakMap,on=new WeakMap,Bd=new WeakMap,Cr=new WeakMap,Fs=new WeakMap,mc=new WeakMap,Uo=new WeakMap,Ia=new WeakMap,Ud=new WeakMap,gc=new WeakMap,yc=new WeakMap,Bs=new WeakMap,Us=new WeakMap,Pa=new WeakMap,bc=new WeakMap,gn=new WeakSet,Zu=function(t){Ut(this,gn,Mv).call(this);let n=re(this,on).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(kr)),n},Sv=function(){Ut(this,gn,Cv).call(this);const t=qa(this.options.staleTime,re(this,on));if(Ys||re(this,Cr).isStale||!yv(t))return;const r=BM(re(this,Cr).dataUpdatedAt,t)+1;Qe(this,Bs,Ns.setTimeout(()=>{re(this,Cr).isStale||this.updateResult()},r))},Ev=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(re(this,on)):this.options.refetchInterval)??!1},Tv=function(t){Ut(this,gn,kv).call(this),Qe(this,Pa,t),!(Ys||xi(this.options.enabled,re(this,on))===!1||!yv(re(this,Pa))||re(this,Pa)===0)&&Qe(this,Us,Ns.setInterval(()=>{(this.options.refetchIntervalInBackground||qx.isFocused())&&Ut(this,gn,Zu).call(this)},re(this,Pa)))},Rv=function(){Ut(this,gn,Sv).call(this),Ut(this,gn,Tv).call(this,Ut(this,gn,Ev).call(this))},Cv=function(){re(this,Bs)&&(Ns.clearTimeout(re(this,Bs)),Qe(this,Bs,void 0))},kv=function(){re(this,Us)&&(Ns.clearInterval(re(this,Us)),Qe(this,Us,void 0))},Mv=function(){const t=re(this,zr).getQueryCache().build(re(this,zr),this.options);if(t===re(this,on))return;const n=re(this,on);Qe(this,on,t),Qe(this,Bd,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},YM=function(t){Qn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(re(this,Cr))}),re(this,zr).getQueryCache().notify({query:re(this,on),type:"observerResultsUpdated"})})},IM);function iL(e,t){return xi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function zT(e,t){return iL(e,t)||e.state.data!==void 0&&Ov(e,t,t.refetchOnMount)}function Ov(e,t,n){if(xi(t.enabled,e)!==!1&&qa(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Vx(e,t)}return!1}function FT(e,t,n,r){return(e!==t||xi(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Vx(e,n)}function Vx(e,t){return xi(t.enabled,e)!==!1&&e.isStaleByTime(qa(t.staleTime,e))}function oL(e,t){return!Ep(e.getCurrentResult(),t)}function BT(e){return{onFetch:(t,n)=>{var m,h,y,g,x;const r=t.options,o=(y=(h=(m=t.fetchOptions)==null?void 0:m.meta)==null?void 0:h.fetchMore)==null?void 0:y.direction,a=((g=t.state.data)==null?void 0:g.pages)||[],l=((x=t.state.data)==null?void 0:x.pageParams)||[];let c={pages:[],pageParams:[]},f=0;const d=async()=>{let E=!1;const R=k=>{XP(k,()=>t.signal,()=>E=!0)},T=HM(t.options,t.fetchOptions),C=async(k,M,D)=>{if(E)return Promise.reject();if(M==null&&k.pages.length)return Promise.resolve(k);const N=(()=>{const G={client:t.client,queryKey:t.queryKey,pageParam:M,direction:D?"backward":"forward",meta:t.options.meta};return R(G),G})(),_=await T(N),{maxPages:q}=t.options,F=D?WP:KP;return{pages:F(k.pages,_,q),pageParams:F(k.pageParams,M,q)}};if(o&&a.length){const k=o==="backward",M=k?aL:UT,D={pages:a,pageParams:l},O=M(r,D);c=await C(D,O,k)}else{const k=e??a.length;do{const M=f===0?l[0]??r.initialPageParam:UT(r,c);if(f>0&&M==null)break;c=await C(c,M),f++}while(f<k)}return c};t.options.persister?t.fetchFn=()=>{var E,R;return(R=(E=t.options).persister)==null?void 0:R.call(E,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=d}}}function UT(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function aL(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Hd,eo,vr,Hs,to,Ca,PM,sL=(PM=class extends $M{constructor(t){super();mt(this,to);mt(this,Hd);mt(this,eo);mt(this,vr);mt(this,Hs);Qe(this,Hd,t.client),this.mutationId=t.mutationId,Qe(this,vr,t.mutationCache),Qe(this,eo,[]),this.state=t.state||KM(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){re(this,eo).includes(t)||(re(this,eo).push(t),this.clearGcTimeout(),re(this,vr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Qe(this,eo,re(this,eo).filter(n=>n!==t)),this.scheduleGc(),re(this,vr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){re(this,eo).length||(this.state.status==="pending"?this.scheduleGc():re(this,vr).remove(this))}continue(){var t;return((t=re(this,Hs))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,c,f,d,m,h,y,g,x,E,R,T,C,k,M,D,O,N;const n=()=>{Ut(this,to,Ca).call(this,{type:"continue"})},r={client:re(this,Hd),meta:this.options.meta,mutationKey:this.options.mutationKey};Qe(this,Hs,VM({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(_,q)=>{Ut(this,to,Ca).call(this,{type:"failed",failureCount:_,error:q})},onPause:()=>{Ut(this,to,Ca).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>re(this,vr).canRun(this)}));const o=this.state.status==="pending",a=!re(this,Hs).canStart();try{if(o)n();else{Ut(this,to,Ca).call(this,{type:"pending",variables:t,isPaused:a}),re(this,vr).config.onMutate&&await re(this,vr).config.onMutate(t,this,r);const q=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t,r));q!==this.state.context&&Ut(this,to,Ca).call(this,{type:"pending",context:q,variables:t,isPaused:a})}const _=await re(this,Hs).start();return await((d=(f=re(this,vr).config).onSuccess)==null?void 0:d.call(f,_,t,this.state.context,this,r)),await((h=(m=this.options).onSuccess)==null?void 0:h.call(m,_,t,this.state.context,r)),await((g=(y=re(this,vr).config).onSettled)==null?void 0:g.call(y,_,null,this.state.variables,this.state.context,this,r)),await((E=(x=this.options).onSettled)==null?void 0:E.call(x,_,null,t,this.state.context,r)),Ut(this,to,Ca).call(this,{type:"success",data:_}),_}catch(_){try{await((T=(R=re(this,vr).config).onError)==null?void 0:T.call(R,_,t,this.state.context,this,r))}catch(q){Promise.reject(q)}try{await((k=(C=this.options).onError)==null?void 0:k.call(C,_,t,this.state.context,r))}catch(q){Promise.reject(q)}try{await((D=(M=re(this,vr).config).onSettled)==null?void 0:D.call(M,void 0,_,this.state.variables,this.state.context,this,r))}catch(q){Promise.reject(q)}try{await((N=(O=this.options).onSettled)==null?void 0:N.call(O,void 0,_,t,this.state.context,r))}catch(q){Promise.reject(q)}throw Ut(this,to,Ca).call(this,{type:"error",error:_}),_}finally{re(this,vr).runNext(this)}}},Hd=new WeakMap,eo=new WeakMap,vr=new WeakMap,Hs=new WeakMap,to=new WeakSet,Ca=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Qn.batch(()=>{re(this,eo).forEach(r=>{r.onMutationUpdate(t)}),re(this,vr).notify({mutation:this,type:"updated",action:t})})},PM);function KM(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ho,Fi,qd,LM,lL=(LM=class extends Dc{constructor(t={}){super();mt(this,Ho);mt(this,Fi);mt(this,qd);this.config=t,Qe(this,Ho,new Set),Qe(this,Fi,new Map),Qe(this,qd,0)}build(t,n,r){const o=new sL({client:t,mutationCache:this,mutationId:++kh(this,qd)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){re(this,Ho).add(t);const n=Mh(t);if(typeof n=="string"){const r=re(this,Fi).get(n);r?r.push(t):re(this,Fi).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(re(this,Ho).delete(t)){const n=Mh(t);if(typeof n=="string"){const r=re(this,Fi).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&re(this,Fi).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Mh(t);if(typeof n=="string"){const r=re(this,Fi).get(n),o=r==null?void 0:r.find(a=>a.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=Mh(t);if(typeof n=="string"){const o=(r=re(this,Fi).get(n))==null?void 0:r.find(a=>a!==t&&a.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Qn.batch(()=>{re(this,Ho).forEach(t=>{this.notify({type:"removed",mutation:t})}),re(this,Ho).clear(),re(this,Fi).clear()})}getAll(){return Array.from(re(this,Ho))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>_T(n,r))}findAll(t={}){return this.getAll().filter(n=>_T(t,n))}notify(t){Qn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Qn.batch(()=>Promise.all(t.map(n=>n.continue().catch(kr))))}},Ho=new WeakMap,Fi=new WeakMap,qd=new WeakMap,LM);function Mh(e){var t;return(t=e.options.scope)==null?void 0:t.id}var qo,La,Fr,Vo,Go,rp,Nv,jM,cL=(jM=class extends Dc{constructor(n,r){super();mt(this,Go);mt(this,qo);mt(this,La);mt(this,Fr);mt(this,Vo);Qe(this,qo,n),this.setOptions(r),this.bindMethods(),Ut(this,Go,rp).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var o;const r=this.options;this.options=re(this,qo).defaultMutationOptions(n),Ep(this.options,r)||re(this,qo).getMutationCache().notify({type:"observerOptionsUpdated",mutation:re(this,Fr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Ks(r.mutationKey)!==Ks(this.options.mutationKey)?this.reset():((o=re(this,Fr))==null?void 0:o.state.status)==="pending"&&re(this,Fr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=re(this,Fr))==null||n.removeObserver(this)}onMutationUpdate(n){Ut(this,Go,rp).call(this),Ut(this,Go,Nv).call(this,n)}getCurrentResult(){return re(this,La)}reset(){var n;(n=re(this,Fr))==null||n.removeObserver(this),Qe(this,Fr,void 0),Ut(this,Go,rp).call(this),Ut(this,Go,Nv).call(this)}mutate(n,r){var o;return Qe(this,Vo,r),(o=re(this,Fr))==null||o.removeObserver(this),Qe(this,Fr,re(this,qo).getMutationCache().build(re(this,qo),this.options)),re(this,Fr).addObserver(this),re(this,Fr).execute(n)}},qo=new WeakMap,La=new WeakMap,Fr=new WeakMap,Vo=new WeakMap,Go=new WeakSet,rp=function(){var r;const n=((r=re(this,Fr))==null?void 0:r.state)??KM();Qe(this,La,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Nv=function(n){Qn.batch(()=>{var r,o,a,l,c,f,d,m;if(re(this,Vo)&&this.hasListeners()){const h=re(this,La).variables,y=re(this,La).context,g={client:re(this,qo),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(o=(r=re(this,Vo)).onSuccess)==null||o.call(r,n.data,h,y,g)}catch(x){Promise.reject(x)}try{(l=(a=re(this,Vo)).onSettled)==null||l.call(a,n.data,null,h,y,g)}catch(x){Promise.reject(x)}}else if((n==null?void 0:n.type)==="error"){try{(f=(c=re(this,Vo)).onError)==null||f.call(c,n.error,h,y,g)}catch(x){Promise.reject(x)}try{(m=(d=re(this,Vo)).onSettled)==null||m.call(d,void 0,n.error,h,y,g)}catch(x){Promise.reject(x)}}}this.listeners.forEach(h=>{h(re(this,La))})})},jM),no,zM,uL=(zM=class extends Dc{constructor(t={}){super();mt(this,no);this.config=t,Qe(this,no,new Map)}build(t,n,r){const o=n.queryKey,a=n.queryHash??Bx(o,n);let l=this.get(a);return l||(l=new nL({client:t,queryKey:o,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(l)),l}add(t){re(this,no).has(t.queryHash)||(re(this,no).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=re(this,no).get(t.queryHash);n&&(t.destroy(),n===t&&re(this,no).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Qn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return re(this,no).get(t)}getAll(){return[...re(this,no).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>DT(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>DT(t,r)):n}notify(t){Qn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Qn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Qn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},no=new WeakMap,zM),Bn,ja,za,vc,xc,Fa,wc,Sc,FM,dL=(FM=class{constructor(e={}){mt(this,Bn);mt(this,ja);mt(this,za);mt(this,vc);mt(this,xc);mt(this,Fa);mt(this,wc);mt(this,Sc);Qe(this,Bn,e.queryCache||new uL),Qe(this,ja,e.mutationCache||new lL),Qe(this,za,e.defaultOptions||{}),Qe(this,vc,new Map),Qe(this,xc,new Map),Qe(this,Fa,0)}mount(){kh(this,Fa)._++,re(this,Fa)===1&&(Qe(this,wc,qx.subscribe(async e=>{e&&(await this.resumePausedMutations(),re(this,Bn).onFocus())})),Qe(this,Sc,Tp.subscribe(async e=>{e&&(await this.resumePausedMutations(),re(this,Bn).onOnline())})))}unmount(){var e,t;kh(this,Fa)._--,re(this,Fa)===0&&((e=re(this,wc))==null||e.call(this),Qe(this,wc,void 0),(t=re(this,Sc))==null||t.call(this),Qe(this,Sc,void 0))}isFetching(e){return re(this,Bn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return re(this,ja).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=re(this,Bn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=re(this,Bn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(qa(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return re(this,Bn).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=re(this,Bn).get(r.queryHash),a=o==null?void 0:o.state.data,l=$P(t,a);if(l!==void 0)return re(this,Bn).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return Qn.batch(()=>re(this,Bn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=re(this,Bn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=re(this,Bn);Qn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=re(this,Bn);return Qn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Qn.batch(()=>re(this,Bn).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(kr).catch(kr)}invalidateQueries(e,t={}){return Qn.batch(()=>(re(this,Bn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Qn.batch(()=>re(this,Bn).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let a=o.fetch(void 0,n);return n.throwOnError||(a=a.catch(kr)),o.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(kr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=re(this,Bn).build(this,t);return n.isStaleByTime(qa(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(kr).catch(kr)}fetchInfiniteQuery(e){return e.behavior=BT(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(kr).catch(kr)}ensureInfiniteQueryData(e){return e.behavior=BT(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Tp.isOnline()?re(this,ja).resumePausedMutations():Promise.resolve()}getQueryCache(){return re(this,Bn)}getMutationCache(){return re(this,ja)}getDefaultOptions(){return re(this,za)}setDefaultOptions(e){Qe(this,za,e)}setQueryDefaults(e,t){re(this,vc).set(Ks(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...re(this,vc).values()],n={};return t.forEach(r=>{Sd(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){re(this,xc).set(Ks(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...re(this,xc).values()],n={};return t.forEach(r=>{Sd(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...re(this,za).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Bx(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Ux&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...re(this,za).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){re(this,Bn).clear(),re(this,ja).clear()}},Bn=new WeakMap,ja=new WeakMap,za=new WeakMap,vc=new WeakMap,xc=new WeakMap,Fa=new WeakMap,wc=new WeakMap,Sc=new WeakMap,FM),eb={exports:{}},It={};/**
|
|
11
|
+
* @license React
|
|
12
|
+
* react.production.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/var HT;function fL(){if(HT)return It;HT=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),y=Symbol.iterator;function g($){return $===null||typeof $!="object"?null:($=y&&$[y]||$["@@iterator"],typeof $=="function"?$:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,R={};function T($,W,I){this.props=$,this.context=W,this.refs=R,this.updater=I||x}T.prototype.isReactComponent={},T.prototype.setState=function($,W){if(typeof $!="object"&&typeof $!="function"&&$!=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,$,W,"setState")},T.prototype.forceUpdate=function($){this.updater.enqueueForceUpdate(this,$,"forceUpdate")};function C(){}C.prototype=T.prototype;function k($,W,I){this.props=$,this.context=W,this.refs=R,this.updater=I||x}var M=k.prototype=new C;M.constructor=k,E(M,T.prototype),M.isPureReactComponent=!0;var D=Array.isArray;function O(){}var N={H:null,A:null,T:null,S:null},_=Object.prototype.hasOwnProperty;function q($,W,I){var Q=I.ref;return{$$typeof:e,type:$,key:W,ref:Q!==void 0?Q:null,props:I}}function F($,W){return q($.type,W,$.props)}function G($){return typeof $=="object"&&$!==null&&$.$$typeof===e}function P($){var W={"=":"=0",":":"=2"};return"$"+$.replace(/[=:]/g,function(I){return W[I]})}var U=/\/+/g;function H($,W){return typeof $=="object"&&$!==null&&$.key!=null?P(""+$.key):W.toString(36)}function B($){switch($.status){case"fulfilled":return $.value;case"rejected":throw $.reason;default:switch(typeof $.status=="string"?$.then(O,O):($.status="pending",$.then(function(W){$.status==="pending"&&($.status="fulfilled",$.value=W)},function(W){$.status==="pending"&&($.status="rejected",$.reason=W)})),$.status){case"fulfilled":return $.value;case"rejected":throw $.reason}}throw $}function j($,W,I,Q,le){var oe=typeof $;(oe==="undefined"||oe==="boolean")&&($=null);var Z=!1;if($===null)Z=!0;else switch(oe){case"bigint":case"string":case"number":Z=!0;break;case"object":switch($.$$typeof){case e:case t:Z=!0;break;case m:return Z=$._init,j(Z($._payload),W,I,Q,le)}}if(Z)return le=le($),Z=Q===""?"."+H($,0):Q,D(le)?(I="",Z!=null&&(I=Z.replace(U,"$&/")+"/"),j(le,W,I,"",function(Se){return Se})):le!=null&&(G(le)&&(le=F(le,I+(le.key==null||$&&$.key===le.key?"":(""+le.key).replace(U,"$&/")+"/")+Z)),W.push(le)),1;Z=0;var ue=Q===""?".":Q+":";if(D($))for(var ve=0;ve<$.length;ve++)Q=$[ve],oe=ue+H(Q,ve),Z+=j(Q,W,I,oe,le);else if(ve=g($),typeof ve=="function")for($=ve.call($),ve=0;!(Q=$.next()).done;)Q=Q.value,oe=ue+H(Q,ve++),Z+=j(Q,W,I,oe,le);else if(oe==="object"){if(typeof $.then=="function")return j(B($),W,I,Q,le);throw W=String($),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys($).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.")}return Z}function z($,W,I){if($==null)return $;var Q=[],le=0;return j($,Q,"","",function(oe){return W.call(I,oe,le++)}),Q}function V($){if($._status===-1){var W=$._result;W=W(),W.then(function(I){($._status===0||$._status===-1)&&($._status=1,$._result=I)},function(I){($._status===0||$._status===-1)&&($._status=2,$._result=I)}),$._status===-1&&($._status=0,$._result=W)}if($._status===1)return $._result.default;throw $._result}var K=typeof reportError=="function"?reportError:function($){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var W=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof $=="object"&&$!==null&&typeof $.message=="string"?String($.message):String($),error:$});if(!window.dispatchEvent(W))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",$);return}console.error($)},L={map:z,forEach:function($,W,I){z($,function(){W.apply(this,arguments)},I)},count:function($){var W=0;return z($,function(){W++}),W},toArray:function($){return z($,function(W){return W})||[]},only:function($){if(!G($))throw Error("React.Children.only expected to receive a single React element child.");return $}};return It.Activity=h,It.Children=L,It.Component=T,It.Fragment=n,It.Profiler=o,It.PureComponent=k,It.StrictMode=r,It.Suspense=f,It.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=N,It.__COMPILER_RUNTIME={__proto__:null,c:function($){return N.H.useMemoCache($)}},It.cache=function($){return function(){return $.apply(null,arguments)}},It.cacheSignal=function(){return null},It.cloneElement=function($,W,I){if($==null)throw Error("The argument must be a React element, but you passed "+$+".");var Q=E({},$.props),le=$.key;if(W!=null)for(oe in W.key!==void 0&&(le=""+W.key),W)!_.call(W,oe)||oe==="key"||oe==="__self"||oe==="__source"||oe==="ref"&&W.ref===void 0||(Q[oe]=W[oe]);var oe=arguments.length-2;if(oe===1)Q.children=I;else if(1<oe){for(var Z=Array(oe),ue=0;ue<oe;ue++)Z[ue]=arguments[ue+2];Q.children=Z}return q($.type,le,Q)},It.createContext=function($){return $={$$typeof:l,_currentValue:$,_currentValue2:$,_threadCount:0,Provider:null,Consumer:null},$.Provider=$,$.Consumer={$$typeof:a,_context:$},$},It.createElement=function($,W,I){var Q,le={},oe=null;if(W!=null)for(Q in W.key!==void 0&&(oe=""+W.key),W)_.call(W,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(le[Q]=W[Q]);var Z=arguments.length-2;if(Z===1)le.children=I;else if(1<Z){for(var ue=Array(Z),ve=0;ve<Z;ve++)ue[ve]=arguments[ve+2];le.children=ue}if($&&$.defaultProps)for(Q in Z=$.defaultProps,Z)le[Q]===void 0&&(le[Q]=Z[Q]);return q($,oe,le)},It.createRef=function(){return{current:null}},It.forwardRef=function($){return{$$typeof:c,render:$}},It.isValidElement=G,It.lazy=function($){return{$$typeof:m,_payload:{_status:-1,_result:$},_init:V}},It.memo=function($,W){return{$$typeof:d,type:$,compare:W===void 0?null:W}},It.startTransition=function($){var W=N.T,I={};N.T=I;try{var Q=$(),le=N.S;le!==null&&le(I,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(O,K)}catch(oe){K(oe)}finally{W!==null&&I.types!==null&&(W.types=I.types),N.T=W}},It.unstable_useCacheRefresh=function(){return N.H.useCacheRefresh()},It.use=function($){return N.H.use($)},It.useActionState=function($,W,I){return N.H.useActionState($,W,I)},It.useCallback=function($,W){return N.H.useCallback($,W)},It.useContext=function($){return N.H.useContext($)},It.useDebugValue=function(){},It.useDeferredValue=function($,W){return N.H.useDeferredValue($,W)},It.useEffect=function($,W){return N.H.useEffect($,W)},It.useEffectEvent=function($){return N.H.useEffectEvent($)},It.useId=function(){return N.H.useId()},It.useImperativeHandle=function($,W,I){return N.H.useImperativeHandle($,W,I)},It.useInsertionEffect=function($,W){return N.H.useInsertionEffect($,W)},It.useLayoutEffect=function($,W){return N.H.useLayoutEffect($,W)},It.useMemo=function($,W){return N.H.useMemo($,W)},It.useOptimistic=function($,W){return N.H.useOptimistic($,W)},It.useReducer=function($,W,I){return N.H.useReducer($,W,I)},It.useRef=function($){return N.H.useRef($)},It.useState=function($){return N.H.useState($)},It.useSyncExternalStore=function($,W,I){return N.H.useSyncExternalStore($,W,I)},It.useTransition=function(){return N.H.useTransition()},It.version="19.2.4",It}var qT;function Vd(){return qT||(qT=1,eb.exports=fL()),eb.exports}var v=Vd();const Fe=im(v),$x=jP({__proto__:null,default:Fe},[v]);var WM=v.createContext(void 0),Qa=e=>{const t=v.useContext(WM);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},hL=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),w.jsx(WM.Provider,{value:e,children:t})),XM=v.createContext(!1),pL=()=>v.useContext(XM);XM.Provider;function mL(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var gL=v.createContext(mL()),yL=()=>v.useContext(gL),bL=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Hx(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},vL=e=>{v.useEffect(()=>{e.clearReset()},[e])},xL=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||Hx(n,[e.error,r])),wL=e=>{if(e.suspense){const n=o=>o==="static"?o:Math.max(o??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...o)=>n(r(...o)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},SL=(e,t)=>e.isLoading&&e.isFetching&&!t,EL=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,VT=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function TL(e,t,n){var y,g,x,E;const r=pL(),o=yL(),a=Qa(),l=a.defaultQueryOptions(e);(g=(y=a.getDefaultOptions().queries)==null?void 0:y._experimental_beforeQuery)==null||g.call(y,l);const c=a.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",wL(l),bL(l,o,c),vL(o);const f=!a.getQueryCache().get(l.queryHash),[d]=v.useState(()=>new t(a,l)),m=d.getOptimisticResult(l),h=!r&&e.subscribed!==!1;if(v.useSyncExternalStore(v.useCallback(R=>{const T=h?d.subscribe(Qn.batchCalls(R)):kr;return d.updateResult(),T},[d,h]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),v.useEffect(()=>{d.setOptions(l)},[l,d]),EL(l,m))throw VT(l,d,o);if(xL({result:m,errorResetBoundary:o,throwOnError:l.throwOnError,query:c,suspense:l.suspense}))throw m.error;if((E=(x=a.getDefaultOptions().queries)==null?void 0:x._experimental_afterQuery)==null||E.call(x,l,m),l.experimental_prefetchInRender&&!Ys&&SL(m,r)){const R=f?VT(l,d,o):c==null?void 0:c.promise;R==null||R.catch(kr).finally(()=>{d.updateResult()})}return l.notifyOnChangeProps?m:d.trackResult(m)}function oi(e,t){return TL(e,rL)}function RL(e,t){const n=Qa(),r=n.getQueryCache();return v.useSyncExternalStore(v.useCallback(o=>r.subscribe(Qn.batchCalls(o)),[r]),()=>n.isFetching(e),()=>n.isFetching(e))}function Ed(e,t){const n=Qa(),[r]=v.useState(()=>new cL(n,e));v.useEffect(()=>{r.setOptions(e)},[r,e]);const o=v.useSyncExternalStore(v.useCallback(l=>r.subscribe(Qn.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=v.useCallback((l,c)=>{r.mutate(l,c).catch(kr)},[r]);if(o.error&&Hx(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:a,mutateAsync:o.mutate}}const CL={en_US:{translation:{common:{loading:"Loading...",save:"Save",saving:"Saving...",cancel:"Cancel",add:"Add",delete:"Delete",edit:"Edit",confirm:"Confirm",close:"Close",expand:"Expand",collapse:"Collapse",refresh:"Refresh",test:"Test",send:"Send",success:"Success",error:"Error",warning:"Warning",info:"Info",yes:"Yes",no:"No",enabled:"Enabled",disabled:"Disabled",pending:"Pending",authorized:"Authorized",unknown:"Unknown",empty:"Empty",none:"None",default:"Default",optional:"Optional",required:"Required",pwaInstallTitle:"Install as app",pwaInstallHintIOSSafari:'iOS Safari does not show an automatic install prompt. Tap Share, then "Add to Home Screen".',pwaInstallHintIOSChrome:'iOS Chrome does not show an automatic install prompt. Tap Share, then "Add to Home Screen".'},nav:{manageDevices:"Manage Devices",settings:"Settings",sidebarExpand:"Expand Sidebar",sidebarCollapse:"Collapse Sidebar",openSidebar:"Open Sidebar",closeSidebar:"Close Sidebar",jumpToLatest:"Jump to Latest",switchToEditor:"Switch to Editor Input",switchToDirect:"Switch to Direct Input",refreshPage:"Refresh Page",refreshPageConfirm:"Are you sure you want to refresh the page? Unsaved content will be lost."},device:{title:"Device Management",devices:"Devices",addDevice:"Add Device",addDeviceDescription:"Fill in device details and choose a connection method",addFirstDevice:"Add First Device",editDevice:"Edit Device",editDeviceDescription:"Update device configuration",sectionBasic:"Basic Info",sectionConnection:"Connection",sectionAuth:"Authentication",noDevices:"No Devices",noDevicesDescription:"Add a local or SSH device to get started",name:"Device Name",namePlaceholder:"e.g., My Server",type:"Type",typeLocal:"Local Device",typeSSH:"SSH Remote Device",typeSSHBadge:"SSH",host:"Host",hostPlaceholder:"example.com",port:"Port",username:"Username",usernamePlaceholder:"root",session:"Tmux Session Name",sessionPlaceholder:"tmex",sessionHint:'Leave empty to use default "tmex"',authMode:"Authentication Mode",authPassword:"Password",authKey:"Private Key",authAgent:"SSH Agent",authConfigRef:"SSH Config",sshConfigRefPlaceholder:"Host alias, e.g. my-server",sshConfigRefHint:"A Host alias from your ssh config, resolved via `ssh -G`. Not the path to the config file.",password:"Password",privateKey:"Private Key",privateKeyPlaceholder:"-----BEGIN OPENSSH PRIVATE KEY-----",privateKeyPassphrase:"Private Key Passphrase (Optional)",passphrase:"Passphrase",connect:"Connect",connected:"Connected",disconnect:"Disconnect",disconnected:"Disconnected",connecting:"Connecting...",dragHandle:"Drag to reorder device",reorderFailed:"Failed to reorder devices",deleteConfirm:"Delete this device?",deleteDescription:'Device "{{name}}" will be permanently removed. This action cannot be undone.',deleteSuccess:"Device deleted",createSuccess:"Device created",updateSuccess:"Device updated",deleteFailed:"Failed to delete device",createFailed:"Failed to create device",updateFailed:"Failed to update device",loadFailed:"Failed to load devices",localDevice:"Local Device",subtitle:"{{username}}@{{host}}:{{port}}",modify:"Modify Device",delete:"Delete"},terminal:{initializing:"Initializing terminal...",connecting:"Connecting to device...",initFailed:"Terminal initialization failed",inputPlaceholder:"Type command here...",clear:"Clear",deviceError:"Device Error",deviceErrorWithType:"[{{type}}] Device Error",noDeviceSelected:"No device selected",windowClosed:"Current window has been closed, please select a window from the sidebar.",paneClosed:"Current pane has been closed, please select a pane from the sidebar.",bellNotification:"Terminal Bell Notification",bellDescription:"Window {{window}} · Pane {{pane}}",bellFallback:"Received tmux bell",paneTitle:"Pane {{index}}",activePane:"Current Pane",activeWindow:"Current Window",editorPlaceholder:"Enter commands here...",editorClear:"Clear",editorSendWithEnter:"Send with Enter",editorSendLineByLine:"Send Line by Line",editorSend:"Send",sendShortcut:"Send {{key}}",inputModeDirect:"Direct Input",inputModeEditor:"Editor",newWindow:"New Window",closeWindow:"Close Window",closePane:"Close Pane",copy:"Copy",paste:"Paste",copied:"Copied to clipboard",copyFailed:"Copy failed",pasteFailed:"Could not read clipboard, check browser permissions",clearSelection:"Dismiss selection"},settings:{title:"System Settings",siteSettings:"Site Settings",siteName:"Site Name",siteNamePlaceholder:"tmex",siteUrl:"Site URL",siteUrlPlaceholder:"http://localhost:3000",bellThrottle:"Bell Throttle (seconds)",notificationThrottle:"Notification Throttle (seconds)",enableBrowserBellToast:"Enable Browser Bell Toast",enableBrowserNotificationToast:"Enable Browser Notification Toast",enableTelegramBellPush:"Enable Telegram Bell Push",enableTelegramNotificationPush:"Enable Telegram Notification Push",sshReconnectRetries:"SSH Reconnect Retries",sshReconnectDelay:"SSH Reconnect Delay (seconds)",language:"Language",languagePlaceholder:"Select language",language_en_US:"English",language_zh_CN:"简体中文",language_ja_JP:"日本語",theme:"Dark Mode",themeLight:"Light",themeDark:"Dark",siteTab:"Site",notificationsTab:"Notifications",tabGroup:{general:"General",devicesAndFiles:"Devices & Files",notifications:"Notifications",ai:"AI"},deviceManagement:{title:"Device Management",description:"Add, edit, and connect to your local and SSH devices.",openButton:"Open Device Management"},refreshToApply:"Refresh to apply language change",saveSettings:"Save Settings",settingsSaved:"Settings saved",saveFailed:"Failed to save settings",loadFailed:"Failed to load settings",restartGateway:"Restart Gateway",restartScheduled:"Gateway restart scheduled",restartConfirm:"Are you sure you want to restart Gateway? This will interrupt all active connections.",restartFailed:"Failed to restart gateway",sshReconnectMaxRetries:"SSH Reconnect Retries",llm:{title:"LLM Providers",name:"Name",namePlaceholder:"e.g. OpenAI",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.openai.com",baseUrlHint:"Adds /v1 automatically; end with / to keep the path as-is",protocol:"Protocol",apiKey:"API Key",apiKeyPlaceholder:"Enter API key",apiKeySetPlaceholder:"Already set, leave blank to keep",addProvider:"Add Provider",editProvider:"Edit Provider",formHint:"Configure the provider connection",models:"Models",modelsTitle:"Models for {{name}}",modelsHint:"Manage the available models for this provider: toggle and add manually",modelManual:"Manual",addModelPlaceholder:"Add a model ID",empty:"No providers yet",refreshModels:"Refresh Models",modelsCount:"{{total}} models",modelsNotFetched:"Models not fetched yet",modelsFetchFailed:"Failed to fetch models: {{error}}",deleteProvider:"Delete Provider",deleteConfirm:'Delete provider "{{name}}"?',defaults:"Global Defaults",defaultProvider:"Default Provider",defaultProviderNone:"Not set",defaultModel:"Default Model",defaultModelPlaceholder:"Type or pick a model ID",saveDefaults:"Save Defaults",loadFailed:"Failed to load LLM providers",createFailed:"Failed to create provider",updateFailed:"Failed to update provider",deleteFailed:"Failed to delete provider",refreshModelsFailed:"Failed to refresh models",settingsLoadFailed:"Failed to load LLM settings",settingsSaveFailed:"Failed to save LLM settings"},search:{title:"Search",provider:"Search Provider",responsesApiHint:"If your LLM provider uses the OpenAI Responses API protocol, it can use that API's built-in hosted search tool; the third-party search below is an optional supplement.",providerNone:"Disabled",tavilyApiKey:"Tavily API Key",braveApiKey:"Brave API Key",keyPlaceholder:"Enter API key",keySetPlaceholder:"Already set, leave blank to keep",clearKey:"Clear",clearKeyConfirm:"Clear this API key? You will need to enter it again.",loadFailed:"Failed to load search settings",saveFailed:"Failed to save search settings"},files:{title:"Files",description:"Per-device directories browsable in the Files tab. Local devices read directly; SSH devices use rsync.",addRoot:"Add directory",roots:"Directories",empty:"No directories configured",missing:"Device missing",modalAddTitle:"Add directory",modalEditTitle:"Edit directory",device:"Device",devicePlaceholder:"Select a device",noDevices:"No devices yet — add one first",path:"Path",pathPlaceholder:"/absolute/path/to/directory",pathHint:"Absolute path on the selected device.",enabled:"Enabled",addFailed:"Failed to add directory",updateFailed:"Failed to update directory",deleteFailed:"Failed to remove directory",toggleFailed:"Failed to update directory",deleteTitle:"Remove directory?",deleteDesc:'Remove "{{path}}" from the whitelist? Files under it will no longer be accessible.'},version:{title:"Version & Updates",currentVersion:"Current version",installMethod:"Install method",installMethodCli:"Installed via CLI",installMethodNonCli:"Not installed via CLI",deployment:"Deployment",deploymentLaunchd:"launchd (macOS)",deploymentSystemd:"systemd (Linux)",deploymentNone:"None",checkUpdate:"Check for updates",checking:"Checking…",upToDate:"You are on the latest version.",updateAvailable:"Update available: {{version}}",changelog:"Changelog",changelogUnavailable:"No changelog available for this version.",publishedAt:"Published {{date}}",upgrade:"Upgrade now",upgradeDisabledDev:"In-app update is disabled outside the production environment.",upgradeDisabledNonCli:"In-app update is only available for CLI installations.",upgradeWarningTitle:"Confirm upgrade",upgradeWarningBody:"Upgrading restarts the service and will interrupt your current session. It may also affect the survival of tmux processes managed by the service. Continue?",upgradeStarted:"Upgrade started",stateDownloading:"Downloading the new version…",stateExecuting:"Applying the upgrade, the service is restarting…",interruptNotice:"The connection will drop while the service restarts; it will recover shortly.",checkFailed:"Failed to check for updates",terminalHint:"Or upgrade from a terminal: npx tmex-cli@<version> upgrade"}},telegram:{title:"Telegram Bot Management",botName:"Bot Name",botNamePlaceholder:"e.g., ops-bot",botToken:"Bot Token",botTokenPlaceholder:"123456:AA...",addBot:"Add Bot",editBot:"Edit Bot",enableBot:"Enable Bot",allowAuthRequests:"Allow Authorization Requests",pendingChats:"Pending Authorization",chats:"Authorized Chats",authorizedChats:"Authorized",noPendingChats:"No pending chats",noAuthorizedChats:"No authorized chats",approve:"Approve",authorize:"Authorize",reject:"Reject",revokeAuth:"Revoke Authorization",testMessage:"Test Message",sendTestMessage:"Send Test Message",deleteBot:"Delete Bot",tokenOptional:"Token (leave empty to keep unchanged)",tokenPlaceholder:"Enter new token",botCreated:"Bot created",botUpdated:"Bot updated",botDeleted:"Bot deleted",authApproved:"Authorization approved",chatRemoved:"Chat removed",testMessageSent:"Test message sent",createFailed:"Failed to create bot",updateFailed:"Failed to update bot",deleteFailed:"Failed to delete bot",approveFailed:"Failed to approve authorization",removeFailed:"Failed to remove chat",testMessageFailed:"Failed to send test message",loadBotsFailed:"Failed to load bot list",loadChatsFailed:"Failed to load chat list",noBots:"No bots yet, add one first.",expand:"Expand",collapse:"Collapse",authCount:"{{authorized}} authorized / {{pending}} pending (max 8)",chatId:"Chat ID",applyTime:"Application Time",gatewayOnline:"🟢 Gateway online @ {{siteName}}",deviceConnectionError:`🔴 {{siteName}}: Connection error on device "{{deviceName}}" ({{host}}) [{{category}}]
|
|
19
|
+
{{error}}`,agentCredentialWarning:'⚠️ {{siteName}}: A message in agent session "{{sessionTitle}}" appears to contain credentials ({{types}}). It will be sent to the LLM and stored — risk of leakage.',authSuccess:"✅ Authorized. You will now receive notifications.",authPending:"⏳ Authorization request received. Please approve in tmex settings.",authFailed:"❌ Authorization request failed. Please contact administrator.",testMessageTemplate:`🧪 Test Message
|
|
20
|
+
Site: {{siteName}}
|
|
21
|
+
Time: {{time}}`,approveMessageTemplate:`✅ Authorized via tmex.
|
|
22
|
+
Bot: {{botName}}
|
|
23
|
+
Time: {{time}}`,botNotFound:"Bot not found or unavailable",botNotRunning:"Bot is not running or unavailable"},webhook:{title:"Webhooks",url:"Webhook URL",secret:"Secret",secretPlaceholder:"Used to sign payloads (HMAC-SHA256)",enabled:"Enabled",eventMask:"Events",add:"Add Webhook",empty:"No webhooks yet.",createFailed:"Failed to create webhook",deleteFailed:"Failed to delete webhook",loadFailed:"Failed to load webhooks"},sshError:{sshConfigRefNotSupported:"SSH Config reference is not supported in this version. Please use host + username with Agent/Key/Password authentication.",configRefNotSupported:"SSH Config reference is not supported in this version. Please use host + username with Agent/Key/Password authentication.",agentUnavailable:"SSH Agent unavailable: SSH_AUTH_SOCK not detected. Please check agent environment.",agentNoIdentity:"SSH Agent has no available keys. Please run ssh-add first.",agentNoIdentities:"SSH Agent has no available keys. Please run ssh-add first.",authFailed:"Authentication failed: incorrect username, password, or key. Please check device configuration.",authFailedGeneric:"Authentication failed: incorrect username, password, or key. Please check device configuration.",networkUnreachable:"Network unreachable: Please check routing, firewall, or VPN configuration.",connectionRefused:"Connection refused: Unable to connect to target host. Please check host address and port.",timeout:"Connection timeout: Unable to connect to device. Please check network or firewall settings.",connectionTimeout:"Connection timeout: Unable to connect to device. Please check network or firewall settings.",hostNotFound:"Host not found: Unable to resolve hostname. Please check DNS or hostname configuration.",handshakeFailed:"Handshake failed: Unable to establish secure connection. Possibly incompatible key exchange algorithm.",tmuxUnavailable:"Remote tmux unavailable or failed to start. Please ensure tmux is installed and available in the remote shell PATH.",connectionClosed:"Connection closed, attempting to reconnect",unknown:"Connection failed: {{message}}",reconnecting:"Connection interrupted, reconnecting in {{delay}} seconds ({{attempt}}/{{maxRetries}})",reconnectFailed:"Auto-reconnect failed, please retry manually",reconnected:"Device reconnected automatically"},deviceStatus:{reconnecting:"Reconnecting {{delay}}s",offline:"Offline",errorBadge:{authFailed:"Auth failed",agentUnavailable:"Agent unavailable",agentNoIdentity:"Agent has no keys",configRefNotSupported:"SSH Config unsupported",networkUnreachable:"Network unreachable",connectionRefused:"Refused",timeout:"Timeout",hostNotFound:"Host not found",handshakeFailed:"Handshake failed",tmuxUnavailable:"Tmux unavailable",connectionClosed:"Disconnected",unknown:"Connection error"}},websocket:{error:"WebSocket connection error",checkGateway:"Please check Gateway status",upgradeFailed:"Upgrade failed",invalidMessage:"Invalid message format"},wsError:{checkGateway:"Please check Gateway status"},apiError:{siteNameRequired:"Site name cannot be empty",siteUrlInvalid:"Site URL must start with http:// or https://",bellThrottleInvalid:"Bell throttle seconds must be between 0-300",sshRetriesInvalid:"SSH reconnect retries must be between 0-20",sshDelayInvalid:"SSH reconnect delay must be between 1-300 seconds",languageInvalid:"Language must be one of the supported locales",botNameRequired:"Bot name cannot be empty",botTokenRequired:"Bot token cannot be empty",missingFields:"Missing required fields",sshRequiresHost:"SSH device requires host or sshConfigRef",invalidRequest:"Invalid request",deviceNotFound:"Device not found",botNotFound:"Bot not found",chatNotFound:"Chat not found",urlAndSecretRequired:"URL and secret are required",notFound:"Not found",llmProviderNameRequired:"Provider name cannot be empty",llmProviderProtocolInvalid:"Protocol must be openai-chat or openai-responses",llmProviderBaseUrlInvalid:"Base URL must start with http:// or https://",llmProviderApiKeyRequired:"API key cannot be empty",llmProviderNotFound:"LLM provider not found",llmProviderDisabled:"LLM provider {{name}} is disabled",llmNoDefaultProvider:"No LLM provider specified and no default provider configured",llmNoDefaultModel:"No model specified and no default model configured",llmDefaultProviderNotFound:"Default provider does not exist",llmSearchProviderInvalid:"Search provider must be none, tavily or brave",llmFetchModelsFailed:"Failed to fetch model list: {{detail}}",agentSessionNotFound:"Agent session not found",agentSessionBusy:"Agent session is currently running, stop it or wait for completion",agentSessionAwaitingConfirmation:"Agent session has pending confirmations, resolve them first",agentDeviceRequired:"Device is required",agentPaneRequired:"Terminal pane is required",agentWriteModeInvalid:"Write mode must be confirm or auto",agentMaxStepsInvalid:"Max steps per turn must be between 1 and 100",agentProviderWebSearchRequiresResponses:"Provider built-in web search requires the openai-responses protocol",agentHostedToolUnknown:"Unknown hosted tool: {{name}}",agentHostedToolRequiresResponses:"Provider hosted tools require the openai-responses protocol",agentSessionOrphaned:"This agent session is orphaned (its terminal is gone) and is read-only",agentQueuedMessageNotFound:"Queued message not found",agentConfirmationNotFound:"Confirmation not found",agentConfirmationAlreadyDecided:"Confirmation has already been decided",agentMessageTextRequired:"Message text is required",watchRuleNotFound:"Watch rule not found",watchNameRequired:"Rule name is required",watchTriggerTypeInvalid:"Trigger type must be match, unchanged or llm",watchPatternRequired:"match/unchanged rules require a regular expression",watchPatternInvalid:"Invalid regular expression: {{detail}}",watchUnchangedMinutesInvalid:"unchanged rules require unchangedMinutes greater than 0",watchExtractGroupInvalid:"Capture group index must be an integer >= 0",watchConditionPromptRequired:"llm rules require a condition prompt",watchIntervalInvalid:"Sampling interval must be at least {{min}} seconds",watchNoMatchBehaviorInvalid:"No-match behavior must be reset or ignore",watchFireModeInvalid:"Fire mode must be once or repeat",watchCooldownInvalid:"Cooldown seconds must be an integer >= 0",watchAssistDescriptionRequired:"Please describe what to match",watchAssistModelUnavailable:"Model call failed: {{detail}}",fileRootInvalid:"Path must be an absolute, existing directory",fileOutsideRoots:"Path is outside the allowed directories",fileNotADirectory:"Not a directory",fileTooLarge:"File is too large",fileBinary:"Binary files are not supported",fileRootDeviceInvalid:"Invalid or unknown device",fileRootDuplicate:"This directory is already added for the device",upgradeNotAllowed:"In-app update is not available for this installation.",upgradeInProgress:"An upgrade is already in progress.",upgradeVersionRequired:"Target version is required.",updateCheckFailed:"Failed to query the npm registry."},notification:{clickToJump:"Click to jump to corresponding pane",eventType:{terminal_bell:"🔔 Terminal Bell",terminal_notification:"🔔 Terminal Notification",tmux_window_close:"🪟 Window Closed",tmux_pane_close:"📱 Pane Closed",device_tmux_missing:"⚠️ Tmux Missing",device_disconnect:"🔌 Device Disconnected",session_created:"🆕 Session Created",session_closed:"🚪 Session Closed",agent_confirmation_pending:"🤖 Agent Confirmation Pending",agent_turn_finished:"🤖 Agent Turn Finished",agent_error:"🤖 Agent Error",watch_triggered:"👁️ Watch Rule Triggered",watch_model_unavailable:"👁️ Watch Model Unavailable",watch_rule_error:"👁️ Watch Rule Error"},site:"Site",device:"Device",window:"Window",pane:"Pane",time:"Time",directLink:"Direct Link",message:"Message",paneTitle:"Title",process:"Process",telegramBell:{title:"🔔 Bell from {{siteName}}: {{terminalTopbarLabel}}",viewLink:"Click to view",terminalTopbarLabel:"Window {{window}} · Pane {{pane}} @ {{device}}"},telegramNotification:{},agent:{confirmationPending:'Agent "{{title}}" requests to run tool {{toolName}}, awaiting confirmation',turnFinished:'Agent "{{title}}" turn finished',error:'Agent "{{title}}" error: {{message}}'},watch:{matchTriggered:'Watch "{{name}}" matched: {{text}}',unchangedTriggered:'Watch "{{name}}" value "{{value}}" has been unchanged for {{minutes}} minutes',llmTriggered:'Watch "{{name}}" condition met: {{reason}}',summaryTriggered:'Watch "{{name}}": {{summary}}',unconfirmedSuffix:" (model unavailable, not LLM-confirmed)",modelUnavailable:'Watch "{{name}}" model call failed: {{message}}',ruleError:'Watch "{{name}}" failed {{count}} times in a row and has been disabled: {{message}}',paneGone:'Watch "{{name}}" pane ({{paneId}}) was destroyed; the rule has been removed'}},sidebar:{noWindows:"No windows",noDevices:"No devices",addDeviceLink:"Add Device",openSettingsLink:"Open Settings",openSettings:"Open Settings",manageDevices:"Manage Devices",settings:"Settings",currentWindow:"Current Window",currentPane:"Current Pane",newWindow:"Create Window",closeWindow:"Close Window",closePane:"Close Pane",addDevice:"Add Device",tab:{panes:"Panes",agent:"Agent",files:"Files"},orphanedSessions:"Orphaned sessions"},agent:{error:{streamStalled:"The model stopped responding (upstream stream stalled). Please retry."},model:{select:"Select model",placeholder:"Model",noProviders:"No models — configure a provider in Settings"},queue:{title:"Queued ({{count}})",steer:"Steer now",steerHint:"Interrupt the current step and inject the queue now",withdraw:"Withdraw"},orphan:{readonly:"This session is orphaned (its terminal is gone) — read-only",title:"Orphaned",process:"Process",startedAt:"Started"},files:{comingSoon:"Coming Soon"},panel:{title:"Agent",empty:"Select or create a session",inputPlaceholder:"Type a message…",send:"Send",stop:"Stop",retry:"Retry",scrollToBottom:"Scroll to bottom"},welcome:{title:"New Agent chat",subtitle:"Describe your task to start working in the selected terminal"},session:{none:"No session selected",new:"New agent session",switch:"Switch session",selectPaneHint:"Select a pane in the Panes tab to start a session",noSessions:"No sessions yet",showAll:"Show all sessions",rename:"Rename session",renameTitle:"Rename session",renamePlaceholder:"Session title",save:"Save",cancel:"Cancel",delete:"Delete session",deleteTitle:"Delete this session?",deleteDesc:'"{{title}}" and all its messages will be permanently deleted.',deleteConfirm:"Delete",createDisabledNoPane:"Open a terminal pane to create a session",privacyNotice:"Sessions send terminal screen content to the configured LLM service."},binding:{invalid:"Pane unavailable",mismatchTitle:"This session is bound to a different pane",goTo:"Go to pane",rebind:"Rebind here"},writeMode:{confirm:"Confirm writes",auto:"Auto execute"},confirm:{title:"Approval required",approve:"Allow",deny:"Deny"},tool:{input:"Input",result:"Result",screen:"Screen capture",send_input:"Send input",read_screen:"Read screen",web_search:"Web search",fetch_url:"Fetch URL",denied:"Denied"},reasoning:{title:"Reasoning"},toast:{errorTitle:'Agent "{{title}}" error',credentialWarningTitle:"Message may contain credentials",credentialWarningDescription:"Detected {{types}}. The content is not modified, but it will be sent to the LLM and stored — risk of leakage."}},window:{noWindows:"No windows",new:"New Window",close:"Close window",closePane:"Close pane",closeConfirmTitle:"Close this window?",closePaneConfirmTitle:"Close this pane?",closeConfirmDesc:'Processes running in "{{name}}" will be terminated. This action cannot be undone.',menu:"Window actions",dragHandle:"Drag to reorder window",dragHandlePane:"Drag to reorder pane",rename:"Rename window",renamePlaceholder:"Enter a name",renameDesc:"The custom name overrides the title set by the terminal and is kept until the gateway restarts.",renameReset:"Use automatic name"},watch:{title:"Watch rules",dialogDesc:"Monitor this pane's screen and get notified when conditions are met",openMonitor:"Watch this pane",rules:{empty:"No watch rules for this pane yet",addRule:"New rule",edit:"Edit",delete:"Delete",viewState:"Status",lastTriggered:"Last triggered: {{time}}",neverTriggered:"Never triggered",deleteTitle:"Delete this rule?",deleteDesc:'"{{name}}" will be permanently deleted.',deleteConfirm:"Delete"},type:{match:"Match",unchanged:"Stuck",llm:"LLM"},typeDesc:{match:"Trigger when a regex matches the screen",unchanged:"Trigger when an extracted value stays unchanged for N minutes (e.g. stalled download)",llm:"An LLM periodically checks the screen against a natural-language condition"},form:{createTitle:"New watch rule",editTitle:"Edit watch rule",name:"Rule name",namePlaceholder:"e.g. Download stalled",triggerType:"Trigger type",pattern:"Regular expression",patternPlaceholder:"e.g. (\\d+)%",flags:"Flags",flagsPlaceholder:"e.g. i",extractGroup:"Capture group index",extractGroupHint:"0 = whole match; the group value is tracked over time",unchangedMinutes:"Unchanged for (minutes)",noMatchBehavior:"When nothing matches",noMatchReset:"Reset timer (progress line gone = task done)",noMatchIgnore:"Ignore (keep last value)",conditionPrompt:"Condition (natural language)",conditionPromptPlaceholder:"e.g. The build has failed with a compile error",model:"Model",followGlobalDefault:"Follow global default",modelPlaceholder:"Model ID",modelRequiredHint:"This rule calls an LLM. Make sure the selected (or global default) model is available.",confirmWithLlm:"LLM double-check before notifying",confirmWithLlmDesc:"Reduce false positives; fails open if the model is unavailable",summarizeWithLlm:"LLM notification summary",summarizeWithLlmDesc:"Summarize the screen into the notification text",intervalSeconds:"Sampling interval (seconds)",intervalHint:"Minimum {{min}}s",fireMode:"Fire mode",fireOnce:"Once (auto-disable after firing)",fireRepeat:"Repeat",cooldownSeconds:"Cooldown (seconds)",enabled:"Enabled",assistLabel:"Generate regex from a description",assistPlaceholder:"e.g. match the download progress percentage",assistButton:"Generate",assistExplanation:"Explanation",assistPreview:"Matches on current screen",assistPreviewEmpty:"No matches on the current screen sample",create:"Create",save:"Save",providerUnavailable:"Original provider unavailable",providerDisabled:"disabled"},validation:{nameRequired:"Rule name is required",patternRequired:"Regular expression is required",patternInvalid:"Invalid regular expression: {{detail}}",unchangedMinutesInvalid:"Unchanged minutes must be greater than 0",conditionPromptRequired:"Condition prompt is required",intervalMin:"Sampling interval must be at least {{min}} seconds"},state:{title:"Rule status",back:"Back",lastSampledAt:"Last sampled",lastValue:"Last value",lastValueChangedAt:"Value last changed",lastTriggeredAt:"Last triggered",consecutiveErrors:"Consecutive errors",lastError:"Last error",samples:"Recent samples",samplesEmpty:"No samples yet",hit:"hit",none:"—"},toast:{created:"Watch rule created",updated:"Watch rule updated",deleted:"Watch rule deleted",triggeredTitle:"Watch triggered",openTerminal:"Open terminal",modelUnavailableTitle:"Watch model unavailable",modelUnavailableHint:"The rule keeps running with degraded behavior.",ruleErrorTitle:"Watch rule auto-disabled"},notifPermission:{title:"Enable browser notifications?",desc:"Get notified when watch rules trigger, even when this tab is in the background.",enable:"Enable",dismiss:"Not now"}},validation:{deviceNameRequired:"Device name is required",hostRequired:"Host is required for SSH devices",portRequired:"A valid port is required for SSH devices",usernameRequired:"Username is required for SSH devices",sshConfigRequired:"SSH config path is required for SSH devices"},files:{title:"Files",refresh:"Refresh file list",noRoots:"No accessible directories. Add one in Settings → Files.",emptyDir:"Empty",truncated:"Too many items — list truncated",download:"Download",error:{invalid:"Invalid request",outside_roots:"Path is outside the allowed directory",not_found:"No longer exists",not_a_directory:"Not a directory",is_directory:"This is a directory",too_large:"File is too large to preview",binary:"Binary file cannot be previewed",permission_denied:"Permission denied",device_not_found:"Device not found",root_not_found:"Directory entry not found",root_disabled:"This directory is disabled",connection_failed:"Failed to connect to the device",auth_unsupported:"Device auth method unsupported for files (use key or ssh-agent)",rsync_missing_local:"rsync is not installed on the server",rsync_missing_remote:"rsync is not installed on the remote device",timeout:"Timed out",unknown:"Failed to load"},retry:"Retry (collapse then expand)",menu:{copyAbsolute:"Copy absolute path",copyRelative:"Copy relative path",sendToAgent:"Send to Agent",expand:"Expand",collapse:"Collapse",upload:"Upload files here",open:"Open"},copied:"Copied to clipboard",copyFailed:"Copy failed",sendToAgent:{prompt:"Please work with this path: `{{path}}`"},upload:{uploading:"Uploading {{name}}…",success:"Uploaded {{name}}",fail:"Failed to upload {{name}}"},transfer:{legUserToTmex:"Browser → tmex",legTmexToServer:"tmex → Server",legServerToTmex:"Server → tmex",legTmexToUser:"tmex → Browser",cancel:"Cancel",canceled:"Canceled {{name}}",downloaded:"Downloaded {{name}}",downloadFailed:"Failed to download {{name}}",dragDownloadStarted:"Started downloading {{name}} (handled by browser)",tooLarge:"{{name}} exceeds the size limit ({{max}})"},agentLaunch:{connectFailed:"Failed to connect to the device",windowFailed:"Failed to create a window"},install:{button:"Install rsync",scopeLocal:"server",scopeRemote:"remote",prompt:"rsync is not installed on {{device}} ({{scope}}). Please install rsync using the appropriate command for this system (e.g. `brew install rsync`, `sudo apt-get install -y rsync`, or `sudo yum install -y rsync`), then reply once it is done."}},file:{invalidRef:"Invalid file reference",notFound:"File no longer exists",accessDenied:"Access denied",loadFailed:"Failed to load file",isDirectory:"This is a directory",notPreviewable:"Preview is not available for this file type",tooLarge:"File is too large to preview",binary:"Binary file cannot be previewed",download:"Download",openRaw:"Open raw"}}},zh_CN:{translation:{common:{loading:"加载中...",save:"保存",saving:"保存中...",cancel:"取消",add:"添加",delete:"删除",edit:"修改",confirm:"确认",close:"关闭",expand:"展开",collapse:"收起",refresh:"刷新",test:"测试",send:"发送",success:"成功",error:"错误",warning:"警告",info:"信息",yes:"是",no:"否",enabled:"已启用",disabled:"已禁用",pending:"待授权",authorized:"已授权",unknown:"未知",empty:"空",none:"无",default:"默认",optional:"可选",required:"必填",pwaInstallTitle:"安装为应用",pwaInstallHintIOSSafari:"iOS Safari 不会自动弹出安装提示。请点击「分享」,再选择「添加到主屏幕」。",pwaInstallHintIOSChrome:"iOS Chrome 不会自动弹出安装提示。请点击「分享」,再选择「添加到主屏幕」"},nav:{manageDevices:"管理设备",settings:"设置",sidebarExpand:"展开侧边栏",sidebarCollapse:"收起侧边栏",openSidebar:"打开侧边栏",closeSidebar:"关闭侧边栏",jumpToLatest:"跳转到最新",switchToEditor:"切换到编辑器输入",switchToDirect:"切换到直接输入",refreshPage:"刷新页面",refreshPageConfirm:"确定要刷新页面吗?未保存的内容将会丢失。"},device:{title:"设备管理",devices:"设备",addDevice:"添加设备",addDeviceDescription:"填写设备信息并选择连接方式",addFirstDevice:"添加第一个设备",editDevice:"修改设备",editDeviceDescription:"更新设备配置",sectionBasic:"基本信息",sectionConnection:"连接信息",sectionAuth:"认证信息",noDevices:"暂无设备",noDevicesDescription:"添加本地或 SSH 设备开始使用",name:"设备名称",namePlaceholder:"例如:我的服务器",type:"类型",typeLocal:"本地设备",typeSSH:"SSH 远程设备",typeSSHBadge:"SSH",host:"主机",hostPlaceholder:"example.com",port:"端口",username:"用户名",usernamePlaceholder:"root",session:"Tmux 会话名称",sessionPlaceholder:"tmex",sessionHint:'留空将使用默认值 "tmex"',authMode:"认证方式",authPassword:"密码",authKey:"私钥",authAgent:"SSH Agent",authConfigRef:"SSH Config",sshConfigRefPlaceholder:"Host 别名,如 my-server",sshConfigRefHint:"填 ssh config 里的 Host 别名,经 `ssh -G` 解析;不是 config 文件路径。",password:"密码",privateKey:"私钥",privateKeyPlaceholder:"-----BEGIN OPENSSH PRIVATE KEY-----",privateKeyPassphrase:"私钥密码(可选)",passphrase:"私钥密码(可选)",connect:"连接",connected:"已连接",disconnect:"断开",disconnected:"已断开",connecting:"连接中...",dragHandle:"拖动以调整设备顺序",reorderFailed:"设备排序失败",deleteConfirm:"删除此设备?",deleteDescription:'设备 "{{name}}" 将被永久移除,此操作无法撤销。',deleteSuccess:"设备已删除",createSuccess:"设备已创建",updateSuccess:"设备已更新",deleteFailed:"删除设备失败",createFailed:"创建设备失败",updateFailed:"更新设备失败",loadFailed:"加载设备列表失败",localDevice:"本地设备",subtitle:"{{username}}@{{host}}:{{port}}",modify:"修改设备",delete:"删除"},terminal:{initializing:"初始化终端...",connecting:"连接设备...",initFailed:"终端初始化失败",inputPlaceholder:"在此输入命令...",clear:"清空",deviceError:"设备错误",deviceErrorWithType:"[{{type}}] 设备错误",noDeviceSelected:"未选择设备",windowClosed:"当前窗口已关闭,请在侧边栏重新选择窗口。",paneClosed:"当前 Pane 已关闭,请在侧边栏重新选择 Pane。",bellNotification:"终端 Bell 提醒",bellDescription:"窗口 {{window}} · Pane {{pane}}",bellFallback:"收到 tmux bell",paneTitle:"Pane {{index}}",activePane:"当前 pane",activeWindow:"当前窗口",editorPlaceholder:"在此输入命令...",editorClear:"清空",editorSendWithEnter:"发送附带回车",editorSendLineByLine:"逐行发送",editorSend:"发送",sendShortcut:"发送 {{key}}",inputModeDirect:"直接输入",inputModeEditor:"编辑器",newWindow:"新建窗口",closeWindow:"关闭窗口",closePane:"关闭 pane",copy:"复制",paste:"粘贴",copied:"已复制到剪贴板",copyFailed:"复制失败",pasteFailed:"无法读取剪贴板,请检查浏览器权限",clearSelection:"取消选择"},settings:{title:"系统设置",siteSettings:"站点设置",siteName:"站点名称",siteNamePlaceholder:"tmex",siteUrl:"站点访问 URL",siteUrlPlaceholder:"http://localhost:3000",bellThrottle:"Bell 频控(秒)",notificationThrottle:"通知频控(秒)",enableBrowserBellToast:"开启浏览器 Bell Toast",enableBrowserNotificationToast:"开启浏览器通知 Toast",enableTelegramBellPush:"开启 Telegram Bell 推送",enableTelegramNotificationPush:"开启 Telegram 通知推送",sshReconnectRetries:"SSH 重连次数",sshReconnectDelay:"SSH 重连等待(秒)",language:"语言",languagePlaceholder:"选择语言",language_en_US:"English",language_zh_CN:"简体中文",language_ja_JP:"日本語",theme:"深色模式",themeLight:"浅色",themeDark:"深色",siteTab:"站点",notificationsTab:"通知",tabGroup:{general:"通用设置",devicesAndFiles:"设备与文件",notifications:"通知设置",ai:"AI 设置"},deviceManagement:{title:"设备管理",description:"添加、编辑并连接你的本地与 SSH 设备。",openButton:"打开设备管理"},refreshToApply:"刷新后生效",saveSettings:"保存设置",settingsSaved:"站点设置已保存",saveFailed:"保存设置失败",loadFailed:"加载设置失败",restartGateway:"重启 Gateway",restartScheduled:"Gateway 重启请求已发送",restartConfirm:"确定要重启 Gateway 吗?这将中断所有活动连接。",restartFailed:"重启请求失败",sshReconnectMaxRetries:"SSH 重连次数",llm:{title:"LLM 提供商",name:"名称",namePlaceholder:"如 OpenAI",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.openai.com",baseUrlHint:"默认自动补全 /v1;以 / 结尾则按原路径不补 /v1",protocol:"协议",apiKey:"API Key",apiKeyPlaceholder:"输入 API Key",apiKeySetPlaceholder:"已设置,留空不修改",addProvider:"添加提供商",editProvider:"编辑供应商",formHint:"配置供应商连接信息",models:"模型",modelsTitle:"{{name}} 的模型",modelsHint:"管理该供应商可用的模型,启停与手动添加",modelManual:"手动",addModelPlaceholder:"添加模型 ID",empty:"暂无提供商",refreshModels:"刷新模型",modelsCount:"{{total}} 个模型",modelsNotFetched:"尚未获取模型列表",modelsFetchFailed:"模型列表获取失败:{{error}}",deleteProvider:"删除提供商",deleteConfirm:"确定要删除提供商「{{name}}」吗?",defaults:"全局默认",defaultProvider:"默认提供商",defaultProviderNone:"未设置",defaultModel:"默认模型",defaultModelPlaceholder:"输入或选择模型 ID",saveDefaults:"保存默认设置",loadFailed:"加载 LLM 提供商失败",createFailed:"创建提供商失败",updateFailed:"更新提供商失败",deleteFailed:"删除提供商失败",refreshModelsFailed:"刷新模型失败",settingsLoadFailed:"加载 LLM 设置失败",settingsSaveFailed:"保存 LLM 设置失败"},search:{title:"搜索",provider:"搜索提供商",responsesApiHint:"若 LLM Provider 使用 OpenAI Responses API 协议,可直接使用其内置的 hosted 搜索工具;下方第三方搜索为可选补充。",providerNone:"不启用",tavilyApiKey:"Tavily API Key",braveApiKey:"Brave API Key",keyPlaceholder:"输入 API Key",keySetPlaceholder:"已设置,留空不修改",clearKey:"清除",clearKeyConfirm:"确定要清除此 API Key 吗?清除后需要重新填写。",loadFailed:"加载搜索设置失败",saveFailed:"保存搜索设置失败"},files:{title:"文件",description:"配置各设备下可在「文件」标签页浏览的目录。本地设备直接读取,SSH 设备走 rsync。",addRoot:"添加目录",roots:"目录",empty:"尚未配置任何目录",missing:"设备已失效",modalAddTitle:"添加目录",modalEditTitle:"编辑目录",device:"设备",devicePlaceholder:"选择设备",noDevices:"还没有设备,请先添加设备",path:"路径",pathPlaceholder:"/绝对路径/到/目录",pathHint:"所选设备上的绝对路径。",enabled:"启用",addFailed:"添加目录失败",updateFailed:"更新目录失败",deleteFailed:"移除目录失败",toggleFailed:"更新目录失败",deleteTitle:"移除目录?",deleteDesc:"将「{{path}}」移出白名单?该目录下的文件将不再可访问。"},version:{title:"版本与更新",currentVersion:"当前版本",installMethod:"安装方式",installMethodCli:"通过 CLI 安装",installMethodNonCli:"非 CLI 安装",deployment:"部署方式",deploymentLaunchd:"launchd(macOS)",deploymentSystemd:"systemd(Linux)",deploymentNone:"无",checkUpdate:"检查更新",checking:"检查中…",upToDate:"已是最新版本。",updateAvailable:"有可用更新:{{version}}",changelog:"更新日志",changelogUnavailable:"该版本暂无更新日志。",publishedAt:"发布于 {{date}}",upgrade:"立即升级",upgradeDisabledDev:"非 production 环境已禁用程序内更新。",upgradeDisabledNonCli:"程序内更新仅在通过 CLI 安装时可用。",upgradeWarningTitle:"确认升级",upgradeWarningBody:"升级会重启服务并中断当前访问,还可能影响该服务托管的 tmux 进程的存活。是否继续?",upgradeStarted:"升级已开始",stateDownloading:"正在下载新版本…",stateExecuting:"正在执行升级,服务即将重启…",interruptNotice:"服务重启期间连接会断开,稍候即可恢复。",checkFailed:"检查更新失败",terminalHint:"或通过终端升级:npx tmex-cli@<version> upgrade"}},telegram:{title:"Telegram Bot 管理",botName:"Bot 名称",botNamePlaceholder:"如:ops-bot",botToken:"Bot Token",botTokenPlaceholder:"123456:AA...",addBot:"新增 Bot",editBot:"编辑 Bot",enableBot:"启用 Bot",allowAuthRequests:"允许申请授权",pendingChats:"待授权",chats:"已授权",authorizedChats:"已授权",noPendingChats:"暂无待授权 chat",noAuthorizedChats:"暂无已授权 chat",approve:"批准",authorize:"授权",reject:"拒绝",revokeAuth:"撤销授权",testMessage:"测试消息",sendTestMessage:"发送测试消息",deleteBot:"删除 Bot",tokenOptional:"Token(留空不改)",tokenPlaceholder:"输入新 token",botCreated:"Bot 已创建",botUpdated:"Bot 已更新",botDeleted:"Bot 已删除",authApproved:"授权已批准",chatRemoved:"chat 已移除",testMessageSent:"测试消息已发送",createFailed:"新增 Bot 失败",updateFailed:"更新 Bot 失败",deleteFailed:"删除 Bot 失败",approveFailed:"批准授权失败",removeFailed:"删除 chat 失败",testMessageFailed:"发送测试消息失败",loadBotsFailed:"加载 Bot 列表失败",loadChatsFailed:"加载 chat 列表失败",noBots:"暂无 Bot,先添加一个。",expand:"展开",collapse:"收起",authCount:"已授权 {{authorized}} / 待授权 {{pending}}(总上限 8)",chatId:"chatId",applyTime:"申请时间",gatewayOnline:"🟢 Gateway online @ {{siteName}}",deviceConnectionError:`🔴 {{siteName}}:设备「{{deviceName}}」({{host}}) 连接异常 [{{category}}]
|
|
24
|
+
{{error}}`,agentCredentialWarning:"⚠️ {{siteName}}:Agent 会话「{{sessionTitle}}」的一条消息疑似包含凭证({{types}})。该内容将发送至 LLM 并存储,存在泄露风险。",authSuccess:"✅ 已授权,可接收通知。",authPending:"⏳ 已收到授权申请,请在 tmex 设置页审批。",authFailed:"❌ 授权申请失败,请联系管理员。",testMessageTemplate:`🧪 测试消息
|
|
25
|
+
站点:{{siteName}}
|
|
26
|
+
时间:{{time}}`,approveMessageTemplate:`✅ 已通过 tmex 授权。
|
|
27
|
+
Bot:{{botName}}
|
|
28
|
+
时间:{{time}}`,botNotFound:"Bot 未启动或不可用",botNotRunning:"Bot 未启动或不可用"},webhook:{title:"Webhooks",url:"Webhook 地址",secret:"密钥",secretPlaceholder:"用于签名(HMAC-SHA256)",enabled:"启用",eventMask:"事件",add:"添加 Webhook",empty:"暂无 Webhook。",createFailed:"创建 Webhook 失败",deleteFailed:"删除 Webhook 失败",loadFailed:"加载 Webhook 失败"},sshError:{sshConfigRefNotSupported:"当前版本暂不支持 SSH Config 引用,请改为填写 host + username,并选择 Agent/私钥/密码认证",configRefNotSupported:"当前版本暂不支持 SSH Config 引用,请改为填写 host + username,并选择 Agent/私钥/密码认证",agentUnavailable:"SSH Agent 不可用:未检测到 SSH_AUTH_SOCK,请检查 agent 环境",agentNoIdentity:"SSH Agent 未加载可用密钥,请先执行 ssh-add",agentNoIdentities:"SSH Agent 未加载可用密钥,请先执行 ssh-add",authFailed:"认证失败:用户名、密码或密钥不正确,请检查设备配置",authFailedGeneric:"认证失败:用户名、密码或密钥不正确,请检查设备配置",networkUnreachable:"网络不可达:请检查路由、防火墙或 VPN 配置",connectionRefused:"连接被拒绝:无法连接到目标主机,请检查主机地址和端口是否正确",timeout:"连接超时:无法连接到设备,请检查网络或防火墙设置",connectionTimeout:"连接超时:无法连接到设备,请检查网络或防火墙设置",hostNotFound:"主机未找到:无法解析主机地址,请检查 DNS 或主机名是否正确",handshakeFailed:"握手失败:无法建立安全连接,可能是密钥交换算法不兼容",tmuxUnavailable:"远端 tmux 不可用或启动失败,请检查远端是否已安装 tmux,且远端 shell PATH 可找到 tmux",connectionClosed:"连接已断开,尝试重连中",unknown:"连接失败:{{message}}",reconnecting:"连接中断,{{delay}} 秒后自动重连({{attempt}}/{{maxRetries}})",reconnectFailed:"自动重连失败,请手动重试",reconnected:"设备已自动重连"},deviceStatus:{reconnecting:"重连中 {{delay}}s",offline:"离线",errorBadge:{authFailed:"认证失败",agentUnavailable:"Agent 不可用",agentNoIdentity:"Agent 无密钥",configRefNotSupported:"不支持 SSH Config",networkUnreachable:"网络不可达",connectionRefused:"连接被拒",timeout:"连接超时",hostNotFound:"主机未找到",handshakeFailed:"握手失败",tmuxUnavailable:"tmux 不可用",connectionClosed:"连接已断开",unknown:"连接异常"}},websocket:{error:"WebSocket 连接错误",checkGateway:"请检查 Gateway 状态",upgradeFailed:"Upgrade failed",invalidMessage:"Invalid message format"},wsError:{checkGateway:"请检查 Gateway 状态"},apiError:{siteNameRequired:"站点名称不能为空",siteUrlInvalid:"站点 URL 必须以 http:// 或 https:// 开头",bellThrottleInvalid:"Bell 频控秒数需在 0-300 之间",sshRetriesInvalid:"SSH 重连次数需在 0-20 之间",sshDelayInvalid:"SSH 重连等待时间需在 1-300 秒之间",languageInvalid:"语言必须是受支持的区域设置之一",botNameRequired:"Bot 名称不能为空",botTokenRequired:"Bot token 不能为空",missingFields:"缺少必填字段",sshRequiresHost:"SSH 设备需要 host 或 sshConfigRef",invalidRequest:"请求无效",deviceNotFound:"Device not found",botNotFound:"Bot 不存在",chatNotFound:"Chat 不存在",urlAndSecretRequired:"URL and secret required",notFound:"Not found",llmProviderNameRequired:"Provider 名称不能为空",llmProviderProtocolInvalid:"协议必须是 openai-chat 或 openai-responses",llmProviderBaseUrlInvalid:"Base URL 必须以 http:// 或 https:// 开头",llmProviderApiKeyRequired:"API key 不能为空",llmProviderNotFound:"LLM provider 不存在",llmProviderDisabled:"LLM provider {{name}} 已被禁用",llmNoDefaultProvider:"未指定 LLM provider 且未配置默认 provider",llmNoDefaultModel:"未指定模型且未配置默认模型",llmDefaultProviderNotFound:"默认 provider 不存在",llmSearchProviderInvalid:"搜索服务必须是 none、tavily 或 brave",llmFetchModelsFailed:"拉取模型列表失败:{{detail}}",agentSessionNotFound:"Agent 会话不存在",agentSessionBusy:"Agent 会话正在运行中,请先停止或等待完成",agentSessionAwaitingConfirmation:"Agent 会话有待处理的确认请求,请先处理",agentDeviceRequired:"必须指定设备",agentPaneRequired:"必须指定终端 pane",agentWriteModeInvalid:"写入模式必须是 confirm 或 auto",agentMaxStepsInvalid:"每回合最大步数必须在 1-100 之间",agentProviderWebSearchRequiresResponses:"Provider 内置搜索仅支持 openai-responses 协议",agentHostedToolUnknown:"未知的 hosted 工具:{{name}}",agentHostedToolRequiresResponses:"Provider hosted 工具仅支持 openai-responses 协议",agentSessionOrphaned:"该 Agent 会话已孤立(绑定终端已不存在),仅可只读查看",agentQueuedMessageNotFound:"排队消息不存在",agentConfirmationNotFound:"确认请求不存在",agentConfirmationAlreadyDecided:"确认请求已被处理",agentMessageTextRequired:"消息内容不能为空",watchRuleNotFound:"Watch 规则不存在",watchNameRequired:"规则名称不能为空",watchTriggerTypeInvalid:"触发类型必须是 match、unchanged 或 llm",watchPatternRequired:"match/unchanged 规则必须提供正则表达式",watchPatternInvalid:"正则表达式无效:{{detail}}",watchUnchangedMinutesInvalid:"unchanged 规则的未变化分钟数必须大于 0",watchExtractGroupInvalid:"捕获组序号必须是不小于 0 的整数",watchConditionPromptRequired:"llm 规则必须提供条件描述",watchIntervalInvalid:"采样间隔不能小于 {{min}} 秒",watchNoMatchBehaviorInvalid:"无命中行为必须是 reset 或 ignore",watchFireModeInvalid:"触发模式必须是 once 或 repeat",watchCooldownInvalid:"冷却秒数必须是不小于 0 的整数",watchAssistDescriptionRequired:"请描述要匹配的内容",watchAssistModelUnavailable:"模型调用失败:{{detail}}",fileRootInvalid:"路径必须是已存在的绝对目录",fileOutsideRoots:"路径不在允许的目录范围内",fileNotADirectory:"不是目录",fileTooLarge:"文件过大",fileBinary:"不支持二进制文件",fileRootDeviceInvalid:"无效或未知的设备",fileRootDuplicate:"该设备下已添加过此目录",upgradeNotAllowed:"当前安装方式不支持程序内更新。",upgradeInProgress:"已有升级任务正在进行。",upgradeVersionRequired:"缺少目标版本号。",updateCheckFailed:"查询 npm registry 失败。"},notification:{clickToJump:"点击跳转到对应 Pane",eventType:{terminal_bell:"🔔 终端 Bell",terminal_notification:"🔔 终端通知",tmux_window_close:"🪟 窗口关闭",tmux_pane_close:"📱 Pane 关闭",device_tmux_missing:"⚠️ Tmux 不可用",device_disconnect:"🔌 设备断开",session_created:"🆕 会话创建",session_closed:"🚪 会话关闭",agent_confirmation_pending:"🤖 Agent 等待确认",agent_turn_finished:"🤖 Agent 回合完成",agent_error:"🤖 Agent 错误",watch_triggered:"👁️ Watch 规则触发",watch_model_unavailable:"👁️ Watch 模型不可用",watch_rule_error:"👁️ Watch 规则错误"},site:"站点",device:"设备",window:"窗口",pane:"Pane",time:"时间",directLink:"直达",message:"信息",paneTitle:"标题",process:"进程",telegramBell:{title:"🔔 来自 {{siteName}} 的 Bell:{{terminalTopbarLabel}}",viewLink:"点击查看",terminalTopbarLabel:"窗口 {{window}} · Pane {{pane}} @ {{device}}"},telegramNotification:{},agent:{confirmationPending:"Agent「{{title}}」请求执行工具 {{toolName}},等待确认",turnFinished:"Agent「{{title}}」回合完成",error:"Agent「{{title}}」出错:{{message}}"},watch:{matchTriggered:"监控「{{name}}」命中:{{text}}",unchangedTriggered:"监控「{{name}}」的值「{{value}}」已 {{minutes}} 分钟未变化",llmTriggered:"监控「{{name}}」条件满足:{{reason}}",summaryTriggered:"监控「{{name}}」:{{summary}}",unconfirmedSuffix:"(模型不可用,未经 LLM 二次确认)",modelUnavailable:"监控「{{name}}」模型调用失败:{{message}}",ruleError:"监控「{{name}}」连续失败 {{count}} 次,已自动停用:{{message}}",paneGone:"监控「{{name}}」的 Pane({{paneId}})已销毁,规则已自动删除"}},sidebar:{noWindows:"暂无窗口",noDevices:"暂无设备",addDeviceLink:"添加设备",openSettingsLink:"打开设置",openSettings:"打开设置",manageDevices:"管理设备",settings:"设置",currentWindow:"当前窗口",currentPane:"当前 pane",newWindow:"新建窗口",closeWindow:"关闭窗口",closePane:"关闭 pane",addDevice:"添加设备",tab:{panes:"Panes",agent:"Agent",files:"Files"},orphanedSessions:"孤立会话"},agent:{error:{streamStalled:"模型停止响应(上游流无响应),请重试。"},model:{select:"选择模型",placeholder:"模型",noProviders:"暂无模型 — 请先在设置中配置供应商"},queue:{title:"队列({{count}})",steer:"立即注入",steerHint:"中断当前步骤并立即注入队列",withdraw:"撤回"},orphan:{readonly:"该会话已孤立(绑定终端已不存在),仅可只读查看",title:"孤立会话",process:"进程",startedAt:"创建于"},files:{comingSoon:"Coming Soon"},panel:{title:"Agent",empty:"选择或创建一个会话",inputPlaceholder:"输入消息…",send:"发送",stop:"停止",retry:"重试",scrollToBottom:"回到底部"},welcome:{title:"新建 Agent 对话",subtitle:"向 Agent 描述你的需求,开始在所选终端中协作"},session:{none:"未选择会话",new:"新建 Agent 会话",switch:"切换会话",selectPaneHint:"请在 Panes 标签中选择一个 pane 来开启会话",noSessions:"暂无会话",showAll:"显示全部会话",rename:"重命名会话",renameTitle:"重命名会话",renamePlaceholder:"会话标题",save:"保存",cancel:"取消",delete:"删除会话",deleteTitle:"删除此会话?",deleteDesc:"“{{title}}”及其全部消息将被永久删除。",deleteConfirm:"删除",createDisabledNoPane:"请先打开一个终端 pane 再创建会话",privacyNotice:"会话将把终端屏幕内容发送给配置的 LLM 服务。"},binding:{invalid:"已失效",mismatchTitle:"此会话绑定的 pane 与当前终端不一致",goTo:"跳转过去",rebind:"重绑到当前"},writeMode:{confirm:"写入需确认",auto:"自动执行"},confirm:{title:"等待确认",approve:"允许",deny:"拒绝"},tool:{input:"输入",result:"结果",screen:"屏幕快照",send_input:"发送输入",read_screen:"读取屏幕",web_search:"网络搜索",fetch_url:"抓取网页",denied:"已拒绝"},reasoning:{title:"思考过程"},toast:{errorTitle:"Agent“{{title}}”出错",credentialWarningTitle:"消息疑似包含凭证",credentialWarningDescription:"检测到 {{types}}。内容不会被修改,但会发送至 LLM 并存储,存在泄露风险。"}},window:{noWindows:"暂无窗口",new:"新建窗口",close:"关闭窗口",closePane:"关闭面板",closeConfirmTitle:"关闭此窗口?",closePaneConfirmTitle:"关闭此面板?",closeConfirmDesc:'"{{name}}" 中运行的进程将被终止,此操作无法撤销。',menu:"窗口操作",dragHandle:"拖动以调整窗口顺序",dragHandlePane:"拖动以调整 pane 顺序",rename:"重命名窗口",renamePlaceholder:"输入名称",renameDesc:"自定义名称会覆盖终端设置的标题,并保留至 gateway 重启。",renameReset:"恢复自动名称"},watch:{title:"监控规则",dialogDesc:"监控该终端屏幕,条件满足时发送通知",openMonitor:"监控此终端",rules:{empty:"该终端还没有监控规则",addRule:"新建规则",edit:"编辑",delete:"删除",viewState:"状态",lastTriggered:"最近触发:{{time}}",neverTriggered:"从未触发",deleteTitle:"删除该规则?",deleteDesc:"“{{name}}”将被永久删除。",deleteConfirm:"删除"},type:{match:"匹配",unchanged:"卡住",llm:"LLM"},typeDesc:{match:"正则命中屏幕内容时触发",unchanged:"提取值连续 N 分钟不变时触发(如下载卡住)",llm:"由 LLM 周期查看屏幕并判断自然语言条件"},form:{createTitle:"新建监控规则",editTitle:"编辑监控规则",name:"规则名称",namePlaceholder:"如:下载卡住提醒",triggerType:"触发类型",pattern:"正则表达式",patternPlaceholder:"如:(\\d+)%",flags:"标志",flagsPlaceholder:"如:i",extractGroup:"捕获组序号",extractGroupHint:"0 = 整个匹配;该组的值将被持续跟踪",unchangedMinutes:"不变持续(分钟)",noMatchBehavior:"无命中时",noMatchReset:"重置计时(进度行消失视为任务结束)",noMatchIgnore:"忽略(保留上次值)",conditionPrompt:"条件(自然语言)",conditionPromptPlaceholder:"如:构建因编译错误而失败",model:"模型",followGlobalDefault:"跟随全局默认",modelPlaceholder:"模型 ID",modelRequiredHint:"该规则会调用 LLM,请确保所选(或全局默认)模型可用。",confirmWithLlm:"通知前 LLM 二次确认",confirmWithLlmDesc:"减少误报;模型不可用时直接通知",summarizeWithLlm:"LLM 生成通知摘要",summarizeWithLlmDesc:"由模型总结屏幕内容作为通知正文",intervalSeconds:"采样间隔(秒)",intervalHint:"最低 {{min}} 秒",fireMode:"触发模式",fireOnce:"单次(触发后自动停用)",fireRepeat:"重复",cooldownSeconds:"冷却时间(秒)",enabled:"启用",assistLabel:"用描述生成正则",assistPlaceholder:"如:匹配下载进度百分比",assistButton:"生成",assistExplanation:"说明",assistPreview:"当前屏幕命中",assistPreviewEmpty:"当前屏幕样本无命中",create:"创建",save:"保存",providerUnavailable:"原提供商已不可用",providerDisabled:"已禁用"},validation:{nameRequired:"规则名称不能为空",patternRequired:"正则表达式不能为空",patternInvalid:"正则表达式无效:{{detail}}",unchangedMinutesInvalid:"不变持续分钟数必须大于 0",conditionPromptRequired:"条件描述不能为空",intervalMin:"采样间隔不能低于 {{min}} 秒"},state:{title:"规则状态",back:"返回",lastSampledAt:"最近采样",lastValue:"最近值",lastValueChangedAt:"值最近变化",lastTriggeredAt:"最近触发",consecutiveErrors:"连续错误次数",lastError:"最近错误",samples:"近期样本",samplesEmpty:"暂无样本",hit:"命中",none:"—"},toast:{created:"监控规则已创建",updated:"监控规则已更新",deleted:"监控规则已删除",triggeredTitle:"监控触发",openTerminal:"打开终端",modelUnavailableTitle:"监控模型不可用",modelUnavailableHint:"规则将以降级方式继续运行。",ruleErrorTitle:"监控规则已自动停用"},notifPermission:{title:"启用浏览器通知?",desc:"即使页面在后台,监控触发时也能收到通知。",enable:"启用",dismiss:"暂不"}},validation:{deviceNameRequired:"设备名称为必填项",hostRequired:"SSH 设备需要填写主机地址",portRequired:"SSH 设备需要填写有效端口",usernameRequired:"SSH 设备需要填写用户名",sshConfigRequired:"SSH 设备需要填写 ssh config 路径"},files:{title:"文件",refresh:"刷新文件列表",noRoots:"没有可访问的目录。请在「设置 → 文件」中添加。",emptyDir:"空目录",truncated:"条目过多,列表已截断",download:"下载",error:{invalid:"无效请求",outside_roots:"路径超出允许的目录范围",not_found:"已不存在",not_a_directory:"不是目录",is_directory:"这是一个目录",too_large:"文件过大,无法预览",binary:"二进制文件无法预览",permission_denied:"无访问权限",device_not_found:"设备不存在",root_not_found:"目录项不存在",root_disabled:"该目录已禁用",connection_failed:"连接设备失败",auth_unsupported:"该设备的认证方式不支持文件访问(请用密钥或 ssh-agent)",rsync_missing_local:"服务器上未安装 rsync",rsync_missing_remote:"远程设备上未安装 rsync",timeout:"已超时",unknown:"加载失败"},retry:"重试(收起后再展开)",menu:{copyAbsolute:"复制绝对位置",copyRelative:"复制相对位置",sendToAgent:"发送到 Agent",expand:"展开",collapse:"收起",upload:"上传文件到这个文件夹",open:"打开"},copied:"已复制到剪贴板",copyFailed:"复制失败",sendToAgent:{prompt:"请处理这个路径:`{{path}}`"},upload:{uploading:"正在上传 {{name}}…",success:"已上传 {{name}}",fail:"上传 {{name}} 失败"},transfer:{legUserToTmex:"用户 → tmex",legTmexToServer:"tmex → 服务器",legServerToTmex:"服务器 → tmex",legTmexToUser:"tmex → 用户",cancel:"取消",canceled:"已取消 {{name}}",downloaded:"已下载 {{name}}",downloadFailed:"下载 {{name}} 失败",dragDownloadStarted:"已开始下载 {{name}}(由浏览器接管)",tooLarge:"{{name}} 超过大小上限({{max}})"},agentLaunch:{connectFailed:"连接设备失败",windowFailed:"创建窗口失败"},install:{button:"安装 rsync",scopeLocal:"服务器",scopeRemote:"远程",prompt:"设备 {{device}}({{scope}})上未检测到 rsync。请根据系统选择合适的命令安装 rsync(例如 `brew install rsync`、`sudo apt-get install -y rsync` 或 `sudo yum install -y rsync`),安装完成后回复我。"}},file:{invalidRef:"无效的文件引用",notFound:"文件已不存在",accessDenied:"无访问权限",loadFailed:"加载文件失败",isDirectory:"这是一个目录",notPreviewable:"该文件类型不支持预览",tooLarge:"文件过大,无法预览",binary:"二进制文件无法预览",download:"下载",openRaw:"打开原始文件"}}},ja_JP:{translation:{common:{loading:"読み込み中...",save:"保存",saving:"保存中...",cancel:"キャンセル",add:"追加",delete:"削除",edit:"編集",confirm:"確認",close:"閉じる",expand:"展開",collapse:"折りたたむ",refresh:"更新",test:"テスト",send:"送信",success:"成功",error:"エラー",warning:"警告",info:"情報",yes:"はい",no:"いいえ",enabled:"有効",disabled:"無効",pending:"保留中",authorized:"承認済み",unknown:"不明",empty:"空",none:"なし",default:"デフォルト",optional:"任意",required:"必須",pwaInstallTitle:"アプリとしてインストール",pwaInstallHintIOSSafari:"iOS Safari では自動的にインストールプロンプトが表示されません。共有ボタンをタップし、「ホーム画面に追加」を選択してください。",pwaInstallHintIOSChrome:"iOS Chrome では自動的にインストールプロンプトが表示されません。共有ボタンをタップし、「ホーム画面に追加」を選択してください。"},nav:{manageDevices:"デバイス管理",settings:"設定",sidebarExpand:"サイドバーを展開",sidebarCollapse:"サイドバーを折りたたむ",openSidebar:"サイドバーを開く",closeSidebar:"サイドバーを閉じる",jumpToLatest:"最新にジャンプ",switchToEditor:"エディタ入力に切り替え",switchToDirect:"直接入力に切り替え",refreshPage:"ページを更新",refreshPageConfirm:"ページを更新してもよろしいですか?保存されていない内容は失われます。"},device:{title:"デバイス管理",devices:"デバイス",addDevice:"デバイスを追加",addDeviceDescription:"デバイス情報を入力し、接続方法を選択してください",addFirstDevice:"最初のデバイスを追加",editDevice:"デバイスを編集",editDeviceDescription:"デバイス設定を更新",sectionBasic:"基本情報",sectionConnection:"接続情報",sectionAuth:"認証情報",noDevices:"デバイスがありません",noDevicesDescription:"ローカルまたは SSH デバイスを追加して開始",name:"デバイス名",namePlaceholder:"例:My Server",type:"タイプ",typeLocal:"ローカルデバイス",typeSSH:"SSH リモートデバイス",typeSSHBadge:"SSH",host:"ホスト",hostPlaceholder:"example.com",port:"ポート",username:"ユーザー名",usernamePlaceholder:"root",session:"Tmux セッション名",sessionPlaceholder:"tmex",sessionHint:"空の場合、デフォルトの「tmex」が使用されます",authMode:"認証モード",authPassword:"パスワード",authKey:"秘密鍵",authAgent:"SSH Agent",authConfigRef:"SSH Config",sshConfigRefPlaceholder:"Host エイリアス(例: my-server)",sshConfigRefHint:"ssh config の Host エイリアスを入力します。`ssh -G` で解決されます。config ファイルのパスではありません。",password:"パスワード",privateKey:"秘密鍵",privateKeyPlaceholder:"-----BEGIN OPENSSH PRIVATE KEY-----",privateKeyPassphrase:"秘密鍵のパスフレーズ(任意)",passphrase:"パスフレーズ",connect:"接続",connected:"接続済み",disconnect:"切断",disconnected:"切断済み",connecting:"接続中...",dragHandle:"ドラッグしてデバイスを並べ替え",reorderFailed:"デバイスの並べ替えに失敗しました",deleteConfirm:"このデバイスを削除しますか?",deleteDescription:"デバイス「{{name}}」は完全に削除されます。この操作は取り消せません。",deleteSuccess:"デバイスを削除しました",createSuccess:"デバイスを作成しました",updateSuccess:"デバイスを更新しました",deleteFailed:"デバイスの削除に失敗しました",createFailed:"デバイスの作成に失敗しました",updateFailed:"デバイスの更新に失敗しました",loadFailed:"デバイス一覧の読み込みに失敗しました",localDevice:"ローカルデバイス",subtitle:"{{username}}@{{host}}:{{port}}",modify:"デバイスを変更",delete:"削除"},terminal:{initializing:"ターミナルを初期化中...",connecting:"デバイスに接続中...",initFailed:"ターミナルの初期化に失敗しました",inputPlaceholder:"ここにコマンドを入力...",clear:"クリア",deviceError:"デバイスエラー",deviceErrorWithType:"[{{type}}] デバイスエラー",noDeviceSelected:"デバイスが選択されていません",windowClosed:"現在のウィンドウは閉じられました。サイドバーからウィンドウを選択してください。",paneClosed:"現在のペインは閉じられました。サイドバーからペインを選択してください。",bellNotification:"ターミナルベル通知",bellDescription:"ウィンドウ {{window}} · ペイン {{pane}}",bellFallback:"tmux ベルを受信",paneTitle:"ペイン {{index}}",activePane:"現在のペイン",activeWindow:"現在のウィンドウ",editorPlaceholder:"ここにコマンドを入力...",editorClear:"クリア",editorSendWithEnter:"Enter で送信",editorSendLineByLine:"1行ずつ送信",editorSend:"送信",sendShortcut:"{{key}} を送信",inputModeDirect:"直接入力",inputModeEditor:"エディタ",newWindow:"新規ウィンドウ",closeWindow:"ウィンドウを閉じる",closePane:"ペインを閉じる",copy:"コピー",paste:"貼り付け",copied:"クリップボードにコピーしました",copyFailed:"コピーに失敗しました",pasteFailed:"クリップボードを読み取れません。ブラウザの権限を確認してください",clearSelection:"選択を解除"},settings:{title:"システム設定",siteSettings:"サイト設定",siteName:"サイト名",siteNamePlaceholder:"tmex",siteUrl:"サイト URL",siteUrlPlaceholder:"http://localhost:3000",bellThrottle:"ベル制限(秒)",notificationThrottle:"通知制限(秒)",enableBrowserBellToast:"ブラウザベル Toast を有効にする",enableBrowserNotificationToast:"ブラウザ通知 Toast を有効にする",enableTelegramBellPush:"Telegram ベルプッシュを有効にする",enableTelegramNotificationPush:"Telegram 通知プッシュを有効にする",sshReconnectRetries:"SSH 再接続試行回数",sshReconnectDelay:"SSH 再接続待機(秒)",language:"言語",languagePlaceholder:"言語を選択",language_en_US:"English",language_zh_CN:"简体中文",language_ja_JP:"日本語",theme:"ダークモード",themeLight:"ライト",themeDark:"ダーク",siteTab:"サイト",notificationsTab:"通知",tabGroup:{general:"一般設定",devicesAndFiles:"デバイスとファイル",notifications:"通知設定",ai:"AI 設定"},deviceManagement:{title:"デバイス管理",description:"ローカルおよび SSH デバイスの追加・編集・接続を行います。",openButton:"デバイス管理を開く"},refreshToApply:"言語変更を適用するには更新してください",saveSettings:"設定を保存",settingsSaved:"設定を保存しました",saveFailed:"設定の保存に失敗しました",loadFailed:"設定の読み込みに失敗しました",restartGateway:"Gateway を再起動",restartScheduled:"Gateway の再起動が予定されました",restartConfirm:"Gateway を再起動してもよろしいですか?すべてのアクティブ接続が中断されます。",restartFailed:"Gateway の再起動に失敗しました",sshReconnectMaxRetries:"SSH 再接続試行回数",llm:{title:"LLM プロバイダー",name:"名前",namePlaceholder:"例: OpenAI",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.openai.com",baseUrlHint:"デフォルトで /v1 を自動補完。/ で終わるとパスをそのまま使用",protocol:"プロトコル",apiKey:"API キー",apiKeyPlaceholder:"API キーを入力",apiKeySetPlaceholder:"設定済み、空欄の場合は変更されません",addProvider:"プロバイダーを追加",editProvider:"プロバイダーを編集",formHint:"プロバイダーの接続を設定",models:"モデル",modelsTitle:"{{name}} のモデル",modelsHint:"このプロバイダーで利用するモデルを管理(有効化と手動追加)",modelManual:"手動",addModelPlaceholder:"モデル ID を追加",empty:"プロバイダーはまだありません",refreshModels:"モデルを更新",modelsCount:"{{total}} 個のモデル",modelsNotFetched:"モデル一覧は未取得です",modelsFetchFailed:"モデル一覧の取得に失敗しました:{{error}}",deleteProvider:"プロバイダーを削除",deleteConfirm:"プロバイダー「{{name}}」を削除しますか?",defaults:"グローバル既定",defaultProvider:"既定プロバイダー",defaultProviderNone:"未設定",defaultModel:"既定モデル",defaultModelPlaceholder:"モデル ID を入力または選択",saveDefaults:"既定を保存",loadFailed:"LLM プロバイダーの読み込みに失敗しました",createFailed:"プロバイダーの作成に失敗しました",updateFailed:"プロバイダーの更新に失敗しました",deleteFailed:"プロバイダーの削除に失敗しました",refreshModelsFailed:"モデルの更新に失敗しました",settingsLoadFailed:"LLM 設定の読み込みに失敗しました",settingsSaveFailed:"LLM 設定の保存に失敗しました"},search:{title:"検索",provider:"検索プロバイダー",responsesApiHint:"LLM プロバイダーが OpenAI Responses API プロトコルを使用している場合、その内蔵 hosted 検索ツールを利用できます。下記のサードパーティ検索は任意の補完です。",providerNone:"無効",tavilyApiKey:"Tavily API キー",braveApiKey:"Brave API キー",keyPlaceholder:"API キーを入力",keySetPlaceholder:"設定済み、空欄の場合は変更されません",clearKey:"クリア",clearKeyConfirm:"この API キーをクリアしますか?再度入力が必要になります。",loadFailed:"検索設定の読み込みに失敗しました",saveFailed:"検索設定の保存に失敗しました"},files:{title:"ファイル",description:"「ファイル」タブで閲覧できるデバイスごとのディレクトリを設定します。ローカルは直接読み取り、SSH は rsync を使用。",addRoot:"ディレクトリを追加",roots:"ディレクトリ",empty:"ディレクトリが設定されていません",missing:"デバイスが見つかりません",modalAddTitle:"ディレクトリを追加",modalEditTitle:"ディレクトリを編集",device:"デバイス",devicePlaceholder:"デバイスを選択",noDevices:"デバイスがありません。先に追加してください",path:"パス",pathPlaceholder:"/絶対パス/ディレクトリ",pathHint:"選択したデバイス上の絶対パス。",enabled:"有効",addFailed:"ディレクトリの追加に失敗しました",updateFailed:"ディレクトリの更新に失敗しました",deleteFailed:"ディレクトリの削除に失敗しました",toggleFailed:"ディレクトリの更新に失敗しました",deleteTitle:"ディレクトリを削除しますか?",deleteDesc:"「{{path}}」をホワイトリストから削除しますか?配下のファイルにアクセスできなくなります。"},version:{title:"バージョンと更新",currentVersion:"現在のバージョン",installMethod:"インストール方法",installMethodCli:"CLI でインストール",installMethodNonCli:"CLI 以外でインストール",deployment:"デプロイ方式",deploymentLaunchd:"launchd(macOS)",deploymentSystemd:"systemd(Linux)",deploymentNone:"なし",checkUpdate:"更新を確認",checking:"確認中…",upToDate:"最新バージョンです。",updateAvailable:"更新があります:{{version}}",changelog:"変更履歴",changelogUnavailable:"このバージョンの変更履歴はありません。",publishedAt:"公開日 {{date}}",upgrade:"今すぐ更新",upgradeDisabledDev:"production 以外の環境ではアプリ内更新は無効です。",upgradeDisabledNonCli:"アプリ内更新は CLI インストール時のみ利用できます。",upgradeWarningTitle:"更新の確認",upgradeWarningBody:"更新するとサービスが再起動し、現在のセッションが中断されます。サービスが管理する tmux プロセスの存続にも影響する可能性があります。続行しますか?",upgradeStarted:"更新を開始しました",stateDownloading:"新しいバージョンをダウンロード中…",stateExecuting:"更新を適用中、サービスを再起動しています…",interruptNotice:"サービス再起動中は接続が切断されますが、まもなく復旧します。",checkFailed:"更新の確認に失敗しました",terminalHint:"またはターミナルから更新:npx tmex-cli@<version> upgrade"}},telegram:{title:"Telegram Bot 管理",botName:"Bot 名",botNamePlaceholder:"例:ops-bot",botToken:"Bot Token",botTokenPlaceholder:"123456:AA...",addBot:"Bot を追加",editBot:"Bot を編集",enableBot:"Bot を有効にする",allowAuthRequests:"認証リクエストを許可",pendingChats:"承認待ち",chats:"承認済み",authorizedChats:"承認済み",noPendingChats:"承認待ちのチャットはありません",noAuthorizedChats:"承認済みのチャットはありません",approve:"承認",authorize:"認証",reject:"拒否",revokeAuth:"認証を取り消す",testMessage:"テストメッセージ",sendTestMessage:"テストメッセージを送信",deleteBot:"Bot を削除",tokenOptional:"Token(変更しない場合は空)",tokenPlaceholder:"新しい token を入力",botCreated:"Bot を作成しました",botUpdated:"Bot を更新しました",botDeleted:"Bot を削除しました",authApproved:"認証が承認されました",chatRemoved:"チャットを削除しました",testMessageSent:"テストメッセージを送信しました",createFailed:"Bot の作成に失敗しました",updateFailed:"Bot の更新に失敗しました",deleteFailed:"Bot の削除に失敗しました",approveFailed:"認証の承認に失敗しました",removeFailed:"チャットの削除に失敗しました",testMessageFailed:"テストメッセージの送信に失敗しました",loadBotsFailed:"Bot 一覧の読み込みに失敗しました",loadChatsFailed:"チャット一覧の読み込みに失敗しました",noBots:"Bot がありません。まず追加してください。",expand:"展開",collapse:"折りたたむ",authCount:"承認済み {{authorized}} / 承認待ち {{pending}}(最大 8)",chatId:"Chat ID",applyTime:"申請時間",gatewayOnline:"🟢 Gateway online @ {{siteName}}",deviceConnectionError:`🔴 {{siteName}}:デバイス「{{deviceName}}」({{host}}) で接続エラー [{{category}}]
|
|
29
|
+
{{error}}`,agentCredentialWarning:"⚠️ {{siteName}}:Agent セッション「{{sessionTitle}}」のメッセージに認証情報が含まれている可能性があります({{types}})。LLM に送信され保存されるため、漏洩のリスクがあります。",authSuccess:"✅ 承認されました。通知を受信できます。",authPending:"⏳ 認証リクエストを受信しました。tmex 設定ページで承認してください。",authFailed:"❌ 認証リクエストに失敗しました。管理者に連絡してください。",testMessageTemplate:`🧪 テストメッセージ
|
|
30
|
+
サイト:{{siteName}}
|
|
31
|
+
時間:{{time}}`,approveMessageTemplate:`✅ tmex で承認されました。
|
|
32
|
+
Bot:{{botName}}
|
|
33
|
+
時間:{{time}}`,botNotFound:"Bot が見つからないか利用できません",botNotRunning:"Bot が起動していないか利用できません"},webhook:{title:"Webhooks",url:"Webhook URL",secret:"シークレット",secretPlaceholder:"署名に使用(HMAC-SHA256)",enabled:"有効",eventMask:"イベント",add:"Webhook を追加",empty:"Webhook がありません。",createFailed:"Webhook の作成に失敗しました",deleteFailed:"Webhook の削除に失敗しました",loadFailed:"Webhook の読み込みに失敗しました"},sshError:{sshConfigRefNotSupported:"このバージョンでは SSH Config 参照はサポートされていません。host + username を使用し、Agent/秘密鍵/パスワード認証を選択してください。",configRefNotSupported:"このバージョンでは SSH Config 参照はサポートされていません。host + username を使用し、Agent/秘密鍵/パスワード認証を選択してください。",agentUnavailable:"SSH Agent が利用できません:SSH_AUTH_SOCK が検出されません。agent 環境を確認してください。",agentNoIdentity:"SSH Agent に利用可能な鍵がありません。ssh-add を実行してください。",agentNoIdentities:"SSH Agent に利用可能な鍵がありません。ssh-add を実行してください。",authFailed:"認証に失敗しました:ユーザー名、パスワード、または鍵が正しくありません。デバイス設定を確認してください。",authFailedGeneric:"認証に失敗しました:ユーザー名、パスワード、または鍵が正しくありません。デバイス設定を確認してください。",networkUnreachable:"ネットワークに到達できません:ルーティング、ファイアウォール、または VPN 設定を確認してください。",connectionRefused:"接続が拒否されました:ターゲットホストに接続できません。ホストアドレスとポートを確認してください。",timeout:"接続タイムアウト:デバイスに接続できません。ネットワークまたはファイアウォール設定を確認してください。",connectionTimeout:"接続タイムアウト:デバイスに接続できません。ネットワークまたはファイアウォール設定を確認してください。",hostNotFound:"ホストが見つかりません:ホスト名を解決できません。DNS またはホスト名設定を確認してください。",handshakeFailed:"ハンドシェイクに失敗しました:安全な接続を確立できません。キー交換アルゴリズムが互換性がない可能性があります。",tmuxUnavailable:"リモート tmux が利用できないか起動に失敗しました。tmux がインストールされ、リモート shell の PATH から参照できることを確認してください。",connectionClosed:"接続が切断されました。再接続を試みています",unknown:"接続に失敗しました:{{message}}",reconnecting:"接続が中断されました。{{delay}} 秒後に再接続します({{attempt}}/{{maxRetries}})",reconnectFailed:"自動再接続に失敗しました。手動で再試行してください",reconnected:"デバイスが自動的に再接続されました"},deviceStatus:{reconnecting:"再接続中 {{delay}}s",offline:"オフライン",errorBadge:{authFailed:"認証失敗",agentUnavailable:"Agent 利用不可",agentNoIdentity:"Agent に鍵なし",configRefNotSupported:"SSH Config 非対応",networkUnreachable:"ネットワーク不可達",connectionRefused:"接続拒否",timeout:"タイムアウト",hostNotFound:"ホスト未検出",handshakeFailed:"ハンドシェイク失敗",tmuxUnavailable:"tmux 利用不可",connectionClosed:"切断",unknown:"接続エラー"}},websocket:{error:"WebSocket 接続エラー",checkGateway:"Gateway 状態を確認してください",upgradeFailed:"アップグレードに失敗しました",invalidMessage:"無効なメッセージ形式"},wsError:{checkGateway:"Gateway 状態を確認してください"},apiError:{siteNameRequired:"サイト名は空にできません",siteUrlInvalid:"サイト URL は http:// または https:// で始まる必要があります",bellThrottleInvalid:"ベル制限秒数は 0-300 の間である必要があります",sshRetriesInvalid:"SSH 再接続試行回数は 0-20 の間である必要があります",sshDelayInvalid:"SSH 再接続待機時間は 1-300 秒の間である必要があります",languageInvalid:"言語はサポートされているロケールのいずれかである必要があります",botNameRequired:"Bot 名は空にできません",botTokenRequired:"Bot token は空にできません",missingFields:"必須フィールドがありません",sshRequiresHost:"SSH デバイスには host または sshConfigRef が必要です",invalidRequest:"無効なリクエスト",deviceNotFound:"デバイスが見つかりません",botNotFound:"Bot が見つかりません",chatNotFound:"チャットが見つかりません",urlAndSecretRequired:"URL とシークレットが必要です",notFound:"見つかりません",llmProviderNameRequired:"プロバイダー名は空にできません",llmProviderProtocolInvalid:"プロトコルは openai-chat または openai-responses である必要があります",llmProviderBaseUrlInvalid:"Base URL は http:// または https:// で始まる必要があります",llmProviderApiKeyRequired:"API key は空にできません",llmProviderNotFound:"LLM プロバイダーが見つかりません",llmProviderDisabled:"LLM プロバイダー {{name}} は無効化されています",llmNoDefaultProvider:"LLM プロバイダーが指定されておらず、デフォルトプロバイダーも設定されていません",llmNoDefaultModel:"モデルが指定されておらず、デフォルトモデルも設定されていません",llmDefaultProviderNotFound:"デフォルトプロバイダーが存在しません",llmSearchProviderInvalid:"検索プロバイダーは none、tavily、brave のいずれかである必要があります",llmFetchModelsFailed:"モデル一覧の取得に失敗しました:{{detail}}",agentSessionNotFound:"Agent セッションが存在しません",agentSessionBusy:"Agent セッションは実行中です。停止するか完了をお待ちください",agentSessionAwaitingConfirmation:"Agent セッションに未処理の確認リクエストがあります。先に処理してください",agentDeviceRequired:"デバイスを指定してください",agentPaneRequired:"ターミナル pane を指定してください",agentWriteModeInvalid:"書き込みモードは confirm または auto である必要があります",agentMaxStepsInvalid:"1 ターンあたりの最大ステップ数は 1〜100 の範囲で指定してください",agentProviderWebSearchRequiresResponses:"プロバイダ内蔵の Web 検索は openai-responses プロトコルのみ対応しています",agentHostedToolUnknown:"不明な hosted ツール: {{name}}",agentHostedToolRequiresResponses:"プロバイダの hosted ツールは openai-responses プロトコルのみ対応しています",agentSessionOrphaned:"この Agent セッションは孤立しており(端末が存在しません)、読み取り専用です",agentQueuedMessageNotFound:"キューのメッセージが存在しません",agentConfirmationNotFound:"確認リクエストが存在しません",agentConfirmationAlreadyDecided:"確認リクエストは既に処理済みです",agentMessageTextRequired:"メッセージ内容を入力してください",watchRuleNotFound:"Watch ルールが存在しません",watchNameRequired:"ルール名を入力してください",watchTriggerTypeInvalid:"トリガー種別は match、unchanged、llm のいずれかです",watchPatternRequired:"match/unchanged ルールには正規表現が必要です",watchPatternInvalid:"正規表現が無効です:{{detail}}",watchUnchangedMinutesInvalid:"unchanged ルールには 0 より大きい未変化分数が必要です",watchExtractGroupInvalid:"キャプチャグループ番号は 0 以上の整数で指定してください",watchConditionPromptRequired:"llm ルールには条件の説明が必要です",watchIntervalInvalid:"サンプリング間隔は {{min}} 秒以上で指定してください",watchNoMatchBehaviorInvalid:"非マッチ時の挙動は reset または ignore です",watchFireModeInvalid:"発火モードは once または repeat です",watchCooldownInvalid:"クールダウン秒数は 0 以上の整数で指定してください",watchAssistDescriptionRequired:"マッチさせたい内容を記述してください",watchAssistModelUnavailable:"モデル呼び出しに失敗しました:{{detail}}",fileRootInvalid:"絶対パスかつ既存のディレクトリを指定してください",fileOutsideRoots:"許可されたディレクトリの範囲外です",fileNotADirectory:"ディレクトリではありません",fileTooLarge:"ファイルが大きすぎます",fileBinary:"バイナリファイルはサポートされていません",fileRootDeviceInvalid:"無効または不明なデバイス",fileRootDuplicate:"このディレクトリはこのデバイスに既に追加されています",upgradeNotAllowed:"このインストールではアプリ内更新を利用できません。",upgradeInProgress:"すでに更新が進行中です。",upgradeVersionRequired:"対象バージョンが必要です。",updateCheckFailed:"npm registry の照会に失敗しました。"},notification:{clickToJump:"対応するペインにジャンプ",eventType:{terminal_bell:"🔔 ターミナルベル",terminal_notification:"🔔 ターミナル通知",tmux_window_close:"🪟 ウィンドウ閉じる",tmux_pane_close:"📱 ペイン閉じる",device_tmux_missing:"⚠️ Tmux がありません",device_disconnect:"🔌 デバイス切断",session_created:"🆕 セッション作成",session_closed:"🚪 セッション閉じる",agent_confirmation_pending:"🤖 エージェント確認待ち",agent_turn_finished:"🤖 エージェントターン完了",agent_error:"🤖 エージェントエラー",watch_triggered:"👁️ Watch ルール発動",watch_model_unavailable:"👁️ Watch モデル利用不可",watch_rule_error:"👁️ Watch ルールエラー"},site:"サイト",device:"デバイス",window:"ウィンドウ",pane:"ペイン",time:"時間",directLink:"直接リンク",message:"メッセージ",paneTitle:"タイトル",process:"プロセス",telegramBell:{title:"🔔 {{siteName}} からのベル:{{terminalTopbarLabel}}",viewLink:"表示",terminalTopbarLabel:"ウィンドウ {{window}} · ペイン {{pane}} @ {{device}}"},telegramNotification:{},agent:{confirmationPending:"Agent「{{title}}」がツール {{toolName}} の実行確認を求めています",turnFinished:"Agent「{{title}}」のターンが完了しました",error:"Agent「{{title}}」でエラーが発生しました:{{message}}"},watch:{matchTriggered:"Watch「{{name}}」がマッチしました:{{text}}",unchangedTriggered:"Watch「{{name}}」の値「{{value}}」が {{minutes}} 分間変化していません",llmTriggered:"Watch「{{name}}」の条件を満たしました:{{reason}}",summaryTriggered:"Watch「{{name}}」:{{summary}}",unconfirmedSuffix:"(モデル利用不可のため LLM 未確認)",modelUnavailable:"Watch「{{name}}」のモデル呼び出しに失敗しました:{{message}}",ruleError:"Watch「{{name}}」が {{count}} 回連続で失敗したため自動停止しました:{{message}}",paneGone:"Watch「{{name}}」のペイン({{paneId}})が破棄されたため、ルールを削除しました"}},sidebar:{noWindows:"ウィンドウがありません",noDevices:"デバイスがありません",addDeviceLink:"デバイスを追加",openSettingsLink:"設定を開く",openSettings:"設定を開く",manageDevices:"デバイス管理",settings:"設定",currentWindow:"現在のウィンドウ",currentPane:"現在のペイン",newWindow:"ウィンドウを作成",closeWindow:"ウィンドウを閉じる",closePane:"ペインを閉じる",addDevice:"デバイスを追加",tab:{panes:"Panes",agent:"Agent",files:"Files"},orphanedSessions:"孤立セッション"},agent:{error:{streamStalled:"モデルが応答を停止しました(上流ストリームが停止)。再試行してください。"},model:{select:"モデルを選択",placeholder:"モデル",noProviders:"モデルがありません — 設定でプロバイダーを構成してください"},queue:{title:"キュー({{count}})",steer:"今すぐ注入",steerHint:"現在のステップを中断してキューを今すぐ注入",withdraw:"取り消し"},orphan:{readonly:"このセッションは孤立しており(端末が存在しません)、読み取り専用です",title:"孤立セッション",process:"プロセス",startedAt:"作成日時"},files:{comingSoon:"Coming Soon"},panel:{title:"Agent",empty:"セッションを選択または作成してください",inputPlaceholder:"メッセージを入力…",send:"送信",stop:"停止",retry:"再試行",scrollToBottom:"最下部へ"},welcome:{title:"新しい Agent チャット",subtitle:"タスクを入力して、選択した端末での作業を始めましょう"},session:{none:"セッション未選択",new:"新規エージェントセッション",switch:"セッションを切り替え",selectPaneHint:"Panes タブでペインを選択してセッションを開始してください",noSessions:"セッションがありません",showAll:"すべてのセッションを表示",rename:"セッション名を変更",renameTitle:"セッション名を変更",renamePlaceholder:"セッション名",save:"保存",cancel:"キャンセル",delete:"セッションを削除",deleteTitle:"このセッションを削除しますか?",deleteDesc:"「{{title}}」とそのメッセージはすべて完全に削除されます。",deleteConfirm:"削除",createDisabledNoPane:"ターミナル pane を開いてからセッションを作成してください",privacyNotice:"セッションはターミナル画面の内容を設定済みの LLM サービスへ送信します。"},binding:{invalid:"無効",mismatchTitle:"このセッションは別の pane にバインドされています",goTo:"移動",rebind:"現在の pane に再バインド"},writeMode:{confirm:"書き込み確認",auto:"自動実行"},confirm:{title:"承認待ち",approve:"許可",deny:"拒否"},tool:{input:"入力",result:"結果",screen:"画面キャプチャ",send_input:"入力送信",read_screen:"画面読み取り",web_search:"Web 検索",fetch_url:"URL 取得",denied:"拒否されました"},reasoning:{title:"思考プロセス"},toast:{errorTitle:"Agent「{{title}}」でエラー",credentialWarningTitle:"メッセージに認証情報が含まれる可能性",credentialWarningDescription:"{{types}} を検出しました。内容は変更されませんが、LLM に送信され保存されるため、漏洩のリスクがあります。"}},window:{noWindows:"ウィンドウがありません",new:"新規ウィンドウ",close:"ウィンドウを閉じる",closePane:"ペインを閉じる",closeConfirmTitle:"このウィンドウを閉じますか?",closePaneConfirmTitle:"このペインを閉じますか?",closeConfirmDesc:'"{{name}}" で実行中のプロセスは終了されます。この操作は取り消せません。',menu:"ウィンドウ操作",dragHandle:"ドラッグしてウィンドウを並べ替え",dragHandlePane:"ドラッグしてペインを並べ替え",rename:"ウィンドウ名を変更",renamePlaceholder:"名前を入力",renameDesc:"カスタム名はターミナルが設定したタイトルを上書きし、ゲートウェイが再起動するまで保持されます。",renameReset:"自動名に戻す"},watch:{title:"監視ルール",dialogDesc:"このペインの画面を監視し、条件を満たしたら通知します",openMonitor:"このターミナルを監視",rules:{empty:"このペインにはまだ監視ルールがありません",addRule:"新規ルール",edit:"編集",delete:"削除",viewState:"状態",lastTriggered:"最終トリガー:{{time}}",neverTriggered:"未トリガー",deleteTitle:"このルールを削除しますか?",deleteDesc:"「{{name}}」は完全に削除されます。",deleteConfirm:"削除"},type:{match:"マッチ",unchanged:"停滞",llm:"LLM"},typeDesc:{match:"正規表現が画面にマッチしたらトリガー",unchanged:"抽出した値が N 分間変化しない場合にトリガー(例:ダウンロード停滞)",llm:"LLM が定期的に画面を確認し自然言語の条件を判定"},form:{createTitle:"監視ルールを作成",editTitle:"監視ルールを編集",name:"ルール名",namePlaceholder:"例:ダウンロード停滞アラート",triggerType:"トリガー種別",pattern:"正規表現",patternPlaceholder:"例:(\\d+)%",flags:"フラグ",flagsPlaceholder:"例:i",extractGroup:"キャプチャグループ番号",extractGroupHint:"0 = マッチ全体。このグループの値を追跡します",unchangedMinutes:"変化なし継続(分)",noMatchBehavior:"マッチしない場合",noMatchReset:"タイマーをリセット(進捗行の消失 = タスク完了)",noMatchIgnore:"無視(前回値を保持)",conditionPrompt:"条件(自然言語)",conditionPromptPlaceholder:"例:コンパイルエラーでビルドが失敗した",model:"モデル",followGlobalDefault:"グローバル既定に従う",modelPlaceholder:"モデル ID",modelRequiredHint:"このルールは LLM を呼び出します。選択した(またはグローバル既定の)モデルが利用可能か確認してください。",confirmWithLlm:"通知前に LLM で再確認",confirmWithLlmDesc:"誤検知を低減。モデル利用不可時はそのまま通知",summarizeWithLlm:"LLM による通知要約",summarizeWithLlmDesc:"画面内容をモデルが要約して通知本文にします",intervalSeconds:"サンプリング間隔(秒)",intervalHint:"最小 {{min}} 秒",fireMode:"発火モード",fireOnce:"一回(発火後に自動停止)",fireRepeat:"繰り返し",cooldownSeconds:"クールダウン(秒)",enabled:"有効",assistLabel:"説明から正規表現を生成",assistPlaceholder:"例:ダウンロード進捗のパーセンテージにマッチ",assistButton:"生成",assistExplanation:"説明",assistPreview:"現在の画面でのマッチ",assistPreviewEmpty:"現在の画面サンプルにマッチなし",create:"作成",save:"保存",providerUnavailable:"元のプロバイダーは利用できません",providerDisabled:"無効"},validation:{nameRequired:"ルール名は必須です",patternRequired:"正規表現は必須です",patternInvalid:"正規表現が無効です:{{detail}}",unchangedMinutesInvalid:"変化なし継続分は 0 より大きい必要があります",conditionPromptRequired:"条件の説明は必須です",intervalMin:"サンプリング間隔は {{min}} 秒以上にしてください"},state:{title:"ルール状態",back:"戻る",lastSampledAt:"最終サンプリング",lastValue:"最新値",lastValueChangedAt:"値の最終変化",lastTriggeredAt:"最終トリガー",consecutiveErrors:"連続エラー回数",lastError:"最新エラー",samples:"直近サンプル",samplesEmpty:"サンプルなし",hit:"ヒット",none:"—"},toast:{created:"監視ルールを作成しました",updated:"監視ルールを更新しました",deleted:"監視ルールを削除しました",triggeredTitle:"監視トリガー",openTerminal:"ターミナルを開く",modelUnavailableTitle:"監視モデル利用不可",modelUnavailableHint:"ルールは縮退動作で継続します。",ruleErrorTitle:"監視ルールを自動停止しました"},notifPermission:{title:"ブラウザ通知を有効にしますか?",desc:"タブがバックグラウンドでも監視トリガー時に通知を受け取れます。",enable:"有効にする",dismiss:"今はしない"}},validation:{deviceNameRequired:"デバイス名は必須です",hostRequired:"SSH デバイスにはホストアドレスが必要です",portRequired:"SSH デバイスには有効なポートが必要です",usernameRequired:"SSH デバイスにはユーザー名が必要です",sshConfigRequired:"SSH デバイスには ssh config のパスが必要です"},files:{title:"ファイル",refresh:"ファイル一覧を更新",noRoots:"アクセス可能なディレクトリがありません。「設定 → ファイル」で追加してください。",emptyDir:"空のディレクトリ",truncated:"項目が多すぎるため一覧を省略しました",download:"ダウンロード",error:{invalid:"不正なリクエスト",outside_roots:"許可されたディレクトリの範囲外です",not_found:"すでに存在しません",not_a_directory:"ディレクトリではありません",is_directory:"これはディレクトリです",too_large:"ファイルが大きすぎてプレビューできません",binary:"バイナリファイルはプレビューできません",permission_denied:"アクセスが拒否されました",device_not_found:"デバイスが見つかりません",root_not_found:"ディレクトリ項目が見つかりません",root_disabled:"このディレクトリは無効です",connection_failed:"デバイスへの接続に失敗しました",auth_unsupported:"このデバイスの認証方式はファイルアクセスに非対応です(鍵か ssh-agent を使用)",rsync_missing_local:"サーバーに rsync がインストールされていません",rsync_missing_remote:"リモートデバイスに rsync がインストールされていません",timeout:"タイムアウトしました",unknown:"読み込みに失敗しました"},retry:"再試行(折りたたんで再展開)",menu:{copyAbsolute:"絶対パスをコピー",copyRelative:"相対パスをコピー",sendToAgent:"Agent に送る",expand:"展開",collapse:"折りたたむ",upload:"このフォルダにアップロード",open:"開く"},copied:"クリップボードにコピーしました",copyFailed:"コピーに失敗しました",sendToAgent:{prompt:"このパスを処理してください:`{{path}}`"},upload:{uploading:"{{name}} をアップロード中…",success:"{{name}} をアップロードしました",fail:"{{name}} のアップロードに失敗しました"},transfer:{legUserToTmex:"ブラウザ → tmex",legTmexToServer:"tmex → サーバー",legServerToTmex:"サーバー → tmex",legTmexToUser:"tmex → ブラウザ",cancel:"キャンセル",canceled:"{{name}} をキャンセルしました",downloaded:"{{name}} をダウンロードしました",downloadFailed:"{{name}} のダウンロードに失敗しました",dragDownloadStarted:"{{name}} のダウンロードを開始(ブラウザが処理)",tooLarge:"{{name}} はサイズ上限({{max}})を超えています"},agentLaunch:{connectFailed:"デバイスへの接続に失敗しました",windowFailed:"ウィンドウの作成に失敗しました"},install:{button:"rsync をインストール",scopeLocal:"サーバー",scopeRemote:"リモート",prompt:"{{device}}({{scope}})に rsync が見つかりません。システムに合わせた方法で rsync をインストールし(例: `brew install rsync`、`sudo apt-get install -y rsync`、`sudo yum install -y rsync`)、完了したら返信してください。"}},file:{invalidRef:"無効なファイル参照です",notFound:"ファイルは存在しません",accessDenied:"アクセスが拒否されました",loadFailed:"ファイルの読み込みに失敗しました",isDirectory:"これはディレクトリです",notPreviewable:"このファイル形式はプレビューできません",tooLarge:"ファイルが大きすぎてプレビューできません",binary:"バイナリファイルはプレビューできません",download:"ダウンロード",openRaw:"元ファイルを開く"}}}},Gx="en_US",sre={locales:[{code:"en_US",name:"English",nativeName:"English",flag:"🇺🇸",isDefault:!0},{code:"zh_CN",name:"简体中文",nativeName:"简体中文",flag:"🇨🇳",isDefault:!1},{code:"ja_JP",name:"日本語",nativeName:"日本語",flag:"🇯🇵",isDefault:!1}]};function QM(e){return e.replace("_","-")}function kL(e,t){const n=(e==null?void 0:e.trim())||"unknown";return t?n:`${n}_dev`}var tb={},Rs={},Cs={},$T;function ML(){if($T)return Cs;$T=1,Object.defineProperty(Cs,"__esModule",{value:!0}),Cs.BinaryReader=Cs.BinaryWriter=void 0;class e{constructor(r=1024){tt(this,"buffer");tt(this,"view");tt(this,"offset",0);this.buffer=new Uint8Array(r),this.view=new DataView(this.buffer.buffer)}ensureCapacity(r){const o=this.offset+r;if(o<=this.buffer.length)return;let a=this.buffer.length;for(;a<o;)a*=2;const l=new Uint8Array(a);l.set(this.buffer),this.buffer=l,this.view=new DataView(this.buffer.buffer)}writeUint8(r){this.ensureCapacity(1),this.view.setUint8(this.offset,r),this.offset+=1}writeUint16(r){this.ensureCapacity(2),this.view.setUint16(this.offset,r,!0),this.offset+=2}writeUint32(r){this.ensureCapacity(4),this.view.setUint32(this.offset,r,!0),this.offset+=4}writeUint64(r){this.ensureCapacity(8),this.view.setBigUint64(this.offset,r,!0),this.offset+=8}writeUint128(r){this.ensureCapacity(16);const o=r&BigInt("0xFFFFFFFFFFFFFFFF"),a=r>>BigInt(64);this.writeUint64(o),this.writeUint64(a)}writeInt8(r){this.ensureCapacity(1),this.view.setInt8(this.offset,r),this.offset+=1}writeInt16(r){this.ensureCapacity(2),this.view.setInt16(this.offset,r,!0),this.offset+=2}writeInt32(r){this.ensureCapacity(4),this.view.setInt32(this.offset,r,!0),this.offset+=4}writeInt64(r){this.ensureCapacity(8),this.view.setBigInt64(this.offset,r,!0),this.offset+=8}writeInt128(r){this.ensureCapacity(16);const o=r&BigInt("0xFFFFFFFFFFFFFFFF"),a=r>>BigInt(64);this.writeInt64(o),this.writeInt64(a)}writeFloat32(r){this.ensureCapacity(4),this.view.setFloat32(this.offset,r,!0),this.offset+=4}writeFloat64(r){this.ensureCapacity(8),this.view.setFloat64(this.offset,r,!0),this.offset+=8}writeBool(r){this.writeUint8(r?1:0)}writeString(r){const o=new TextEncoder().encode(r);this.writeUint32(o.length),this.ensureCapacity(o.length),this.buffer.set(o,this.offset),this.offset+=o.length}getBuffer(){return this.buffer.slice(0,this.offset)}}Cs.BinaryWriter=e;class t{constructor(r){tt(this,"buffer");tt(this,"view");tt(this,"offset",0);this.buffer=r,this.view=new DataView(r.buffer,r.byteOffset,r.byteLength)}readUint8(){const r=this.view.getUint8(this.offset);return this.offset+=1,r}readUint16(){const r=this.view.getUint16(this.offset,!0);return this.offset+=2,r}readUint32(){const r=this.view.getUint32(this.offset,!0);return this.offset+=4,r}readUint64(){const r=this.view.getBigUint64(this.offset,!0);return this.offset+=8,r}readUint128(){const r=this.readUint64();return this.readUint64()<<BigInt(64)|r}readInt8(){const r=this.view.getInt8(this.offset);return this.offset+=1,r}readInt16(){const r=this.view.getInt16(this.offset,!0);return this.offset+=2,r}readInt32(){const r=this.view.getInt32(this.offset,!0);return this.offset+=4,r}readInt64(){const r=this.view.getBigInt64(this.offset,!0);return this.offset+=8,r}readInt128(){const r=this.readUint64();return this.readInt64()<<BigInt(64)|r}readFloat32(){const r=this.view.getFloat32(this.offset,!0);return this.offset+=4,r}readFloat64(){const r=this.view.getFloat64(this.offset,!0);return this.offset+=8,r}readBool(){return!!this.readUint8()}readString(){const r=this.readUint32(),o=this.buffer.slice(this.offset,this.offset+r);return this.offset+=r,new TextDecoder().decode(o)}getOffset(){return this.offset}}return Cs.BinaryReader=t,Cs}var nb={},GT;function OL(){return GT||(GT=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.registry=e.TypeRegistry=void 0;class t{constructor(){tt(this,"handlers",new Map)}register(r,o){this.handlers.set(r,o)}getHandler(r){const o=this.handlers.get(r);if(!o)throw new Error(`No handler registered for type: ${r}`);return o}}e.TypeRegistry=t,e.registry=new t,e.registry.register("u8",{write:(n,r)=>{if(r<0||r>255||!Number.isInteger(r))throw new Error("Value out of range for u8");n.writeUint8(r)},read:n=>n.readUint8()}),e.registry.register("u16",{write:(n,r)=>{if(r<0||r>65535||!Number.isInteger(r))throw new Error("Value out of range for u16");n.writeUint16(r)},read:n=>n.readUint16()}),e.registry.register("u32",{write:(n,r)=>{if(r<0||r>4294967295||!Number.isInteger(r))throw new Error("Value out of range for u32");n.writeUint32(r)},read:n=>n.readUint32()}),e.registry.register("u64",{write:(n,r)=>{if(r<0n||r>18446744073709551615n)throw new Error("Value out of range for u64");n.writeUint64(r)},read:n=>n.readUint64()}),e.registry.register("u128",{write:(n,r)=>{if(r<0n||r>340282366920938463463374607431768211455n)throw new Error("Value out of range for u128");n.writeUint128(r)},read:n=>n.readUint128()}),e.registry.register("i8",{write:(n,r)=>{if(r<-128||r>127||!Number.isInteger(r))throw new Error("Value out of range for i8");n.writeInt8(r)},read:n=>n.readInt8()}),e.registry.register("i16",{write:(n,r)=>{if(r<-32768||r>32767||!Number.isInteger(r))throw new Error("Value out of range for i16");n.writeInt16(r)},read:n=>n.readInt16()}),e.registry.register("i32",{write:(n,r)=>{if(r<-2147483648||r>2147483647||!Number.isInteger(r))throw new Error("Value out of range for i32");n.writeInt32(r)},read:n=>n.readInt32()}),e.registry.register("i64",{write:(n,r)=>{if(r<-9223372036854775808n||r>9223372036854775807n)throw new Error("Value out of range for i64");n.writeInt64(r)},read:n=>n.readInt64()}),e.registry.register("i128",{write:(n,r)=>{if(r<-170141183460469231731687303715884105728n||r>170141183460469231731687303715884105727n)throw new Error("Value out of range for i128");n.writeInt128(r)},read:n=>n.readInt128()}),e.registry.register("f32",{write:(n,r)=>n.writeFloat32(r),read:n=>n.readFloat32()}),e.registry.register("f64",{write:(n,r)=>{if(Number.isNaN(r))throw new Error("For portability reasons we do not allow serializing NaN values.");n.writeFloat64(r)},read:n=>n.readFloat64()}),e.registry.register("bool",{write:(n,r)=>n.writeBool(r),read:n=>n.readBool()}),e.registry.register("string",{write:(n,r)=>n.writeString(r),read:n=>n.readString()}),e.registry.register("unit",{write:()=>{},read:()=>({})}),e.registry.register("struct",{write:(n,r,o)=>{if(o)for(const[a,l]of Object.entries(o))e.registry.getHandler(l.type).write(n,r[a],l.options)},read:(n,r)=>{if(!r)return{};const o={};for(const[a,l]of Object.entries(r)){const c=e.registry.getHandler(l.type);o[a]=c.read(n,l.options)}return o}}),e.registry.register("vec",{write:(n,r,o)=>{if(!o)return;const{elementType:a,elementOptions:l}=o,c=(ArrayBuffer.isView(r),r.length);n.writeUint32(c);const f=e.registry.getHandler(a);if(ArrayBuffer.isView(r))for(let d=0;d<c;d++)f.write(n,r[d],l);else for(const d of r)f.write(n,d,l)},read:(n,r)=>{if(!r)return[];const{elementType:o,elementOptions:a}=r,l=n.readUint32(),c=e.registry.getHandler(o),f=Array.from({length:l},()=>c.read(n,a));switch(o){case"u8":return new Uint8Array(f);case"u16":return new Uint16Array(f);case"u32":return new Uint32Array(f);case"i8":return new Int8Array(f);case"i16":return new Int16Array(f);case"i32":return new Int32Array(f);case"i64":return new BigInt64Array(f);case"f32":return new Float32Array(f);case"f64":return new Float64Array(f);default:return f}}}),e.registry.register("set",{write:(n,r,o)=>{if(!o)return;const{elementType:a,elementOptions:l}=o,c=Array.from(r).sort();n.writeUint32(c.length);const f=e.registry.getHandler(a);for(const d of c)f.write(n,d,l)},read:(n,r)=>{if(!r)return new Set;const{elementType:o,elementOptions:a}=r,l=n.readUint32(),c=e.registry.getHandler(o),f=Array.from({length:l},()=>c.read(n,a));return new Set(f)}}),e.registry.register("map",{write:(n,r,o)=>{if(!o)return;const{keyType:a,keyOptions:l,valueType:c,valueOptions:f}=o,d=Array.from(r.entries()).sort();n.writeUint32(d.length);const m=e.registry.getHandler(a),h=e.registry.getHandler(c);for(const[y,g]of d)m.write(n,y,l),h.write(n,g,f)},read:(n,r)=>{if(!r)return new Map;const{keyType:o,keyOptions:a,valueType:l,valueOptions:c}=r,f=n.readUint32(),d=e.registry.getHandler(o),m=e.registry.getHandler(l),h=Array.from({length:f},()=>{const y=d.read(n,a),g=m.read(n,c);return[y,g]});return new Map(h)}}),e.registry.register("option",{write:(n,r,o)=>{if(!o)return;const{valueType:a,valueOptions:l}=o,c=r!==null;n.writeUint8(c?1:0),c&&e.registry.getHandler(a).write(n,r,l)},read:(n,r)=>{if(!r)return null;const{valueType:o,valueOptions:a}=r;return n.readUint8()===1?e.registry.getHandler(o).read(n,a):null}}),e.registry.register("enum",{write:(n,r,o)=>{if(!o)return;const a=Object.keys(r)[0],l=r[a],c=o.variants.find(f=>f.name===a);if(!c)throw new Error(`Unknown enum variant: ${a}`);n.writeUint8(c.index),c.type!=="unit"&&e.registry.getHandler(c.type).write(n,l,c.options)},read:(n,r)=>{if(!r)return{};const o=n.readUint8(),a=r.variants.find(f=>f.index===o);if(!a)throw new Error(`Unknown enum variant index: ${o}`);if(a.type==="unit")return{[a.name]:{}};const c=e.registry.getHandler(a.type).read(n,a.options);return{[a.name]:c}}}),e.registry.register("tuple",{write:(n,r,o)=>{if(o){if(r.length!==o.length)throw new Error(`Tuple length mismatch: expected ${o.length}, got ${r.length}`);for(let a=0;a<o.length;a++){const l=o[a];if(!l)throw new Error(`Missing type information for tuple element at index ${a}`);e.registry.getHandler(l.type).write(n,r[a],l.options)}}},read:(n,r)=>{if(!r)return[];const o=[];for(const a of r){const l=e.registry.getHandler(a.type);o.push(l.read(n,a.options))}return o}}),e.registry.register("array",{write:(n,r,o)=>{if(!o)return;const{elementType:a,elementOptions:l,length:c}=o;if(r.length!==c)throw new Error(`Array length mismatch: expected ${c}, got ${r.length}`);const f=e.registry.getHandler(a);for(const d of r)f.write(n,d,l)},read:(n,r)=>{if(!r)return[];const{elementType:o,elementOptions:a,length:l}=r,c=e.registry.getHandler(o);return Array.from({length:l},()=>c.read(n,a))}}),e.registry.register("bytes",{write:(n,r,o)=>{const a=r.length;if((o==null?void 0:o.length)!=null){if(a!==o.length)throw new Error(`Bytes length mismatch: expected ${o.length}, got ${a}`);for(let l=0;l<a;l++)n.writeUint8(r[l])}else{n.writeUint32(a);for(let l=0;l<a;l++)n.writeUint8(r[l])}},read:(n,r)=>{const o=(r==null?void 0:r.length)!=null?r.length:n.readUint32(),a=new Uint8Array(o);for(let l=0;l<o;l++)a[l]=n.readUint8();return a}}),e.registry.register("nativeEnum",{write:(n,r,o)=>{if(!o)return;const{valueToIndexMap:a}=o,l=r,c=a.get(l);if(c===void 0)throw new Error(`Invalid enum value: ${String(r)}`);n.writeUint8(c)},read:(n,r)=>{if(!r)return null;const{indexToValueMap:o}=r,a=n.readUint8(),l=o.get(a);if(l===void 0)throw new Error(`Invalid enum index: ${a}`);return l}})})(nb)),nb}var YT;function NL(){if(YT)return Rs;YT=1,Object.defineProperty(Rs,"__esModule",{value:!0}),Rs.b=Rs.Schema=void 0;const e=ML(),t=OL();class n{constructor(o,a,l){tt(this,"type");tt(this,"options");tt(this,"registry");this.type=o,this.options=a,this.registry=l}serialize(o){const a=new e.BinaryWriter;return this.registry.getHandler(this.type).write(a,o,this.options),a.getBuffer()}deserialize(o){const a=new e.BinaryReader(o);return this.registry.getHandler(this.type).read(a,this.options)}}return Rs.Schema=n,Rs.b={u8:()=>new n("u8",null,t.registry),u16:()=>new n("u16",null,t.registry),u32:()=>new n("u32",null,t.registry),u64:()=>new n("u64",null,t.registry),u128:()=>new n("u128",null,t.registry),i8:()=>new n("i8",null,t.registry),i16:()=>new n("i16",null,t.registry),i32:()=>new n("i32",null,t.registry),i64:()=>new n("i64",null,t.registry),i128:()=>new n("i128",null,t.registry),f32:()=>new n("f32",null,t.registry),f64:()=>new n("f64",null,t.registry),bool:()=>new n("bool",null,t.registry),string:()=>new n("string",null,t.registry),unit:()=>new n("unit",null,t.registry),vec:r=>new n("vec",{elementType:r.type,elementOptions:r.options},t.registry),hashSet:r=>new n("set",{elementType:r.type,elementOptions:r.options},t.registry),hashMap:(r,o)=>new n("map",{keyType:r.type,keyOptions:r.options,valueType:o.type,valueOptions:o.options},t.registry),option:r=>new n("option",{valueType:r.type,valueOptions:r.options},t.registry),array:(r,o)=>new n("array",{elementType:r.type,elementOptions:r.options,length:o},t.registry),bytes:r=>new n("bytes",r!=null?{length:r}:{},t.registry),enum:r=>{const o=Object.entries(r).map(([a,l],c)=>({index:c,name:a,type:l.type,options:l.options}));return new n("enum",{variants:o},t.registry)},struct:r=>{const o=Object.fromEntries(Object.entries(r).map(([a,l])=>[a,{type:l.type,options:l.options}]));return new n("struct",o,t.registry)},tuple:(...r)=>{const o=r.map(a=>({type:a.type,options:a.options}));return new n("tuple",o,t.registry)},nativeEnum:r=>{const o=Object.entries(r).filter(([m])=>typeof m=="string"&&Number.isNaN(Number(m))),a=o.map(([m,h])=>h),l=a.some(m=>typeof m=="string"),c=a.some(m=>typeof m=="number");if(l&&c)throw new Error("Mixed string/numeric enums are not supported");const f=new Map,d=new Map;if(o.forEach(([m,h],y)=>{f.set(h,y),d.set(y,h)}),o.length>255)throw new Error("Borsh only supports enums with up to 255 variants");return new n("nativeEnum",{enumObj:r,valueToIndexMap:f,indexToValueMap:d},t.registry)}},Rs}var KT;function AL(){return KT||(KT=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Schema=e.b=void 0;var t=NL();Object.defineProperty(e,"b",{enumerable:!0,get:function(){return t.b}}),Object.defineProperty(e,"Schema",{enumerable:!0,get:function(){return t.Schema}})})(tb)),tb}var se=AL();const DL=1,_L=2,IL=3,PL=4,LL=5,jL=257,zL=258,FL=259,BL=260,UL=261,HL=513,qL=514,VL=515,$L=516,GL=517,YL=518,KL=519,WL=520,XL=522,QL=523,ZL=524,JL=769,ej=770,tj=771,nj=772,rj=773,ij=774,oj=1025,aj=1026,sj=1281,lj=1537,cj=1538,uj=1539,dj=1793,fj=1,hj=2,pj=3,mj=4,gj=5,yj=6,bj=7,vj=8,xj=9,wj=10,Sj=11,Ej=12,Tj=13,Rj=1,Cj=2,kj=3,Mj=1001,ro=1002,Oj=1003,ZM=1004,ip=1005,Nj=1101,Aj=1102,Dj=1201,_j=1202,Ij=1301,Pj=1302,Lj=1401,jj={[Mj]:"Unsupported protocol version",[ro]:"Invalid frame format",[Oj]:"Unknown message kind",[ZM]:"Failed to decode payload",[ip]:"Frame exceeds maximum size",[Nj]:"Device not found",[Aj]:"Failed to connect device",[Dj]:"Tmux target not found",[_j]:"Tmux not ready",[Ij]:"Select conflict",[Pj]:"Select token mismatch",[Lj]:"Internal server error"};function zj(e){return jj[e]??`Unknown error code: ${e}`}class ni extends Error{constructor(t,n=!1,r){super(r??zj(t)),this.code=t,this.retryable=n,this.name="WsBorshError"}}const JM=se.b.struct({magic:se.b.bytes(2),version:se.b.u16(),kind:se.b.u16(),flags:se.b.u16(),seq:se.b.u32(),payload:se.b.bytes()}),Fj=se.b.option(se.b.u32()),Ec=se.b.option(se.b.u16()),Or=se.b.option(se.b.string()),Bj=se.b.struct({clientImpl:se.b.string(),clientVersion:se.b.string(),maxFrameBytes:se.b.u32(),supportsCompression:se.b.bool(),supportsDiffSnapshot:se.b.bool()}),Uj=se.b.struct({serverImpl:se.b.string(),serverVersion:se.b.string(),selectedVersion:se.b.u16(),maxFrameBytes:se.b.u32(),heartbeatIntervalMs:se.b.u32(),capabilities:se.b.vec(se.b.string())}),Hj=se.b.struct({nonce:se.b.u32(),timeMs:se.b.u64()});se.b.struct({refSeq:Fj,code:se.b.u16(),message:se.b.string(),retryable:se.b.bool()});const qj=se.b.struct({deviceId:se.b.string()}),Vj=se.b.struct({deviceId:se.b.string()}),$j=se.b.struct({deviceId:se.b.string()}),Gj=se.b.struct({deviceId:se.b.string()}),Yj=se.b.struct({deviceId:se.b.string(),eventType:se.b.u8(),errorType:Or,message:Or,rawMessage:Or}),Kj=se.b.struct({deviceId:se.b.string(),windowId:Or,paneId:Or,selectToken:se.b.bytes(16),wantHistory:se.b.bool(),cols:Ec,rows:Ec}),Wj=se.b.struct({deviceId:se.b.string(),windowId:se.b.string()}),Xj=se.b.struct({deviceId:se.b.string(),name:Or}),Qj=se.b.struct({deviceId:se.b.string(),windowId:se.b.string()}),Zj=se.b.struct({deviceId:se.b.string(),paneId:se.b.string()}),Jj=se.b.struct({deviceId:se.b.string(),windowId:se.b.string(),name:se.b.string()}),ez=se.b.struct({deviceId:se.b.string(),style:se.b.string()}),tz=se.b.struct({deviceId:se.b.string(),windowIds:se.b.vec(se.b.string())}),nz=se.b.struct({deviceId:se.b.string(),windowId:se.b.string(),paneIds:se.b.vec(se.b.string())}),rz=se.b.struct({deviceId:se.b.string(),eventType:se.b.u8(),eventData:se.b.bytes()}),iz=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),encoding:se.b.u8(),data:se.b.bytes(),isComposing:se.b.bool()}),oz=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),encoding:se.b.u8(),data:se.b.bytes(),isComposing:se.b.bool()}),e2=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),cols:se.b.u16(),rows:se.b.u16()}),az=e2,sz=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),encoding:se.b.u8(),data:se.b.bytes()}),lz=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),selectToken:se.b.bytes(16),encoding:se.b.u8(),alternateScreen:se.b.bool(),data:se.b.bytes()}),cz=se.b.struct({deviceId:se.b.string(),windowId:se.b.string(),paneId:se.b.string(),selectToken:se.b.bytes(16)}),uz=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),selectToken:se.b.bytes(16)}),t2=se.b.struct({chunkStreamId:se.b.u32(),originalKind:se.b.u16(),originalSeq:se.b.u32(),totalChunks:se.b.u16(),chunkIndex:se.b.u16(),data:se.b.bytes()}),dz=se.b.struct({id:se.b.string(),windowId:se.b.string(),index:se.b.u16(),title:Or,active:se.b.bool(),width:se.b.u16(),height:se.b.u16()}),fz=se.b.struct({id:se.b.string(),name:se.b.string(),customName:Or,index:se.b.u16(),active:se.b.bool(),panes:se.b.vec(dz)}),hz=se.b.struct({id:se.b.string(),name:se.b.string(),windows:se.b.vec(fz)}),pz=se.b.struct({deviceId:se.b.string(),session:se.b.option(hz)});se.b.struct({deviceId:se.b.string(),baseRevision:se.b.u32(),revision:se.b.u32(),diffFormat:se.b.u8(),diffBytes:se.b.bytes()});const mz=se.b.struct({sessionId:se.b.string()}),gz=se.b.struct({sessionId:se.b.string()}),yz=se.b.struct({sessionId:se.b.string(),seq:se.b.u32(),eventType:se.b.u8(),payload:se.b.bytes()}),bz=se.b.struct({ruleId:se.b.string(),deviceId:se.b.string(),paneId:se.b.string(),eventType:se.b.u8(),payload:se.b.bytes()}),vz=se.b.struct({windowId:se.b.string()}),xz=se.b.struct({windowId:se.b.string()}),wz=se.b.struct({windowId:se.b.string(),name:se.b.string()}),Sz=se.b.struct({windowId:se.b.string()}),Ez=se.b.struct({paneId:se.b.string(),windowId:se.b.string()}),Tz=se.b.struct({paneId:se.b.string()}),Rz=se.b.struct({windowId:se.b.string(),paneId:se.b.string()}),Cz=se.b.struct({windowId:se.b.string(),layout:se.b.string()}),kz=se.b.struct({windowId:Or,paneId:Or,windowIndex:Ec,paneIndex:Ec,paneUrl:Or}),Mz=se.b.struct({source:se.b.u8(),title:Or,body:se.b.string(),windowId:Or,paneId:Or,windowIndex:Ec,paneIndex:Ec,paneUrl:Or}),Td=new Uint8Array([84,88]),Oz=1;function op(e,t,n,r=0,o=Oz){const a={magic:Td,version:o,kind:e,flags:r,seq:n,payload:t};return JM.serialize(a)}function nr(e,t){return e.serialize(t)}function Nz(e){if(e.length<12)throw new ni(ro,!1,"Envelope too small");if(e[0]!==Td[0]||e[1]!==Td[1])throw new ni(ro,!1,"Invalid magic bytes");try{return JM.deserialize(e)}catch(t){throw new ni(ro,!1,t instanceof Error?t.message:"Failed to decode envelope")}}function Bo(e,t){try{return e.deserialize(t)}catch(n){throw new ni(ZM,!1,n instanceof Error?n.message:"Failed to decode payload")}}function Az(e,t){const n=t2.serialize(e);return op(1281,n,t)}function Dz(e){return t2.deserialize(e)}function _z(e){return e.length>=2&&e[0]===Td[0]&&e[1]===Td[1]}const Iz=5e3,WT=100,Av=1e3;class Pz{constructor(){tt(this,"streams",new Map);tt(this,"lastCleanup",Date.now())}addChunk(t){if(this.cleanup(),t.totalChunks>Av)throw new ni(ro,!1,`Too many chunks: ${t.totalChunks} > ${Av}`);if(t.chunkIndex>=t.totalChunks)throw new ni(ro,!1,`Chunk index out of bounds: ${t.chunkIndex} >= ${t.totalChunks}`);let n=this.streams.get(t.chunkStreamId);if(!n){if(this.streams.size>=WT&&(this.cleanup(!0),this.streams.size>=WT))throw new ni(ro,!1,"Too many concurrent chunk streams");n={chunks:new Map,totalChunks:t.totalChunks,createdAt:Date.now(),originalKind:t.originalKind,originalSeq:t.originalSeq},this.streams.set(t.chunkStreamId,n)}if(n.totalChunks!==t.totalChunks)throw this.streams.delete(t.chunkStreamId),new ni(ro,!1,"Chunk total count mismatch");if(n.chunks.has(t.chunkIndex))throw new ni(ro,!1,`Duplicate chunk index: ${t.chunkIndex}`);return n.chunks.set(t.chunkIndex,t),n.chunks.size===n.totalChunks?this.reassemble(t.chunkStreamId,n):null}reassemble(t,n){const r=[];let o=0;for(let c=0;c<n.totalChunks;c++){const f=n.chunks.get(c);if(!f)throw this.streams.delete(t),new ni(ro,!1,`Missing chunk index: ${c}`);r.push(f.data),o+=f.data.length}const a=new Uint8Array(o);let l=0;for(const c of r)a.set(c,l),l+=c.length;return this.streams.delete(t),{kind:n.originalKind,seq:n.originalSeq,payload:a}}cleanup(t=!1){const n=Date.now();if(!t&&n-this.lastCleanup<5e3)return;this.lastCleanup=n;const r=n-Iz;for(const[o,a]of this.streams)a.createdAt<r&&this.streams.delete(o)}getActiveStreamCount(){return this.streams.size}clear(){this.streams.clear()}}function Lz(e,t,n,r){const{maxFrameBytes:o,chunkStreamId:a}=r,l=16,c=18,f=o-l;if(f<=0)throw new ni(ip,!1,`maxFrameBytes too small: ${o}`);if(e.length<=f)return{chunks:[],totalChunks:0};const d=o-l-c;if(d<=0)throw new ni(ip,!1,`maxFrameBytes too small for chunking: ${o}`);const m=Math.ceil(e.length/d);if(m>Av)throw new ni(ip,!1,`Too many chunks: ${m}`);const h=[];for(let y=0;y<m;y++){const g=y*d,x=Math.min(g+d,e.length);h.push({chunkStreamId:a,originalKind:t,originalSeq:n,totalChunks:m,chunkIndex:y,data:e.slice(g,x)})}return{chunks:h,totalChunks:m}}let rb=1;function jz(){const e=rb;return rb=rb%4294967295+1,e}const zz={1:"osc9",2:"osc777",3:"osc1337",4:"osc99"};function Fz(e){const t=Yj.deserialize(e),n={1:"tmux-missing",2:"disconnected",3:"error",4:"reconnected"};return{deviceId:t.deviceId,type:n[t.eventType]??"error",errorType:t.errorType??void 0,message:t.message??void 0,rawMessage:t.rawMessage??void 0}}function Bz(e){const t=rz.deserialize(e),r={1:"window-add",2:"window-close",3:"window-renamed",4:"window-active",5:"pane-add",6:"pane-close",7:"pane-active",8:"layout-change",9:"bell",10:"output",11:"notification"}[t.eventType];if(!r)throw new Error(`Unknown tmux event type: ${t.eventType}`);return{deviceId:t.deviceId,type:r,data:Uz(r,t.eventData)}}function Uz(e,t){if(t.length===0)return{};try{switch(e){case"window-add":return vz.deserialize(t);case"window-close":return xz.deserialize(t);case"window-renamed":return wz.deserialize(t);case"window-active":return Sz.deserialize(t);case"pane-add":return Ez.deserialize(t);case"pane-close":return Tz.deserialize(t);case"pane-active":return Rz.deserialize(t);case"layout-change":return Cz.deserialize(t);case"bell":{const n=kz.deserialize(t);return{windowId:n.windowId??void 0,paneId:n.paneId??void 0,windowIndex:n.windowIndex??void 0,paneIndex:n.paneIndex??void 0,paneUrl:n.paneUrl??void 0}}case"notification":{const n=Mz.deserialize(t);return{source:zz[n.source]??"osc9",title:n.title??void 0,body:n.body,windowId:n.windowId??void 0,paneId:n.paneId??void 0,windowIndex:n.windowIndex??void 0,paneIndex:n.paneIndex??void 0,paneUrl:n.paneUrl??void 0}}default:return{}}}catch{return{}}}function Hz(e){const t=pz.deserialize(e);return{deviceId:t.deviceId,session:t.session?qz(t.session):null}}function qz(e){return{id:e.id,name:e.name,windows:e.windows.map(Vz)}}function Vz(e){return{id:e.id,name:e.name,customName:e.customName??void 0,index:e.index,active:e.active,panes:e.panes.map($z)}}function $z(e){return{id:e.id,windowId:e.windowId,index:e.index,title:e.title??void 0,active:e.active,width:e.width,height:e.height}}var ib={exports:{}},ju={},ob={exports:{}},ab={};/**
|
|
34
|
+
* @license React
|
|
35
|
+
* scheduler.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 XT;function Gz(){return XT||(XT=1,(function(e){function t(j,z){var V=j.length;j.push(z);e:for(;0<V;){var K=V-1>>>1,L=j[K];if(0<o(L,z))j[K]=z,j[V]=L,V=K;else break e}}function n(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var z=j[0],V=j.pop();if(V!==z){j[0]=V;e:for(var K=0,L=j.length,$=L>>>1;K<$;){var W=2*(K+1)-1,I=j[W],Q=W+1,le=j[Q];if(0>o(I,V))Q<L&&0>o(le,I)?(j[K]=le,j[Q]=V,K=Q):(j[K]=I,j[W]=V,K=W);else if(Q<L&&0>o(le,V))j[K]=le,j[Q]=V,K=Q;else break e}}return z}function o(j,z){var V=j.sortIndex-z.sortIndex;return V!==0?V:j.id-z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var f=[],d=[],m=1,h=null,y=3,g=!1,x=!1,E=!1,R=!1,T=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function M(j){for(var z=n(d);z!==null;){if(z.callback===null)r(d);else if(z.startTime<=j)r(d),z.sortIndex=z.expirationTime,t(f,z);else break;z=n(d)}}function D(j){if(E=!1,M(j),!x)if(n(f)!==null)x=!0,O||(O=!0,P());else{var z=n(d);z!==null&&B(D,z.startTime-j)}}var O=!1,N=-1,_=5,q=-1;function F(){return R?!0:!(e.unstable_now()-q<_)}function G(){if(R=!1,O){var j=e.unstable_now();q=j;var z=!0;try{e:{x=!1,E&&(E=!1,C(N),N=-1),g=!0;var V=y;try{t:{for(M(j),h=n(f);h!==null&&!(h.expirationTime>j&&F());){var K=h.callback;if(typeof K=="function"){h.callback=null,y=h.priorityLevel;var L=K(h.expirationTime<=j);if(j=e.unstable_now(),typeof L=="function"){h.callback=L,M(j),z=!0;break t}h===n(f)&&r(f),M(j)}else r(f);h=n(f)}if(h!==null)z=!0;else{var $=n(d);$!==null&&B(D,$.startTime-j),z=!1}}break e}finally{h=null,y=V,g=!1}z=void 0}}finally{z?P():O=!1}}}var P;if(typeof k=="function")P=function(){k(G)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,H=U.port2;U.port1.onmessage=G,P=function(){H.postMessage(null)}}else P=function(){T(G,0)};function B(j,z){N=T(function(){j(e.unstable_now())},z)}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(j){j.callback=null},e.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_=0<j?Math.floor(1e3/j):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(j){switch(y){case 1:case 2:case 3:var z=3;break;default:z=y}var V=y;y=z;try{return j()}finally{y=V}},e.unstable_requestPaint=function(){R=!0},e.unstable_runWithPriority=function(j,z){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var V=y;y=j;try{return z()}finally{y=V}},e.unstable_scheduleCallback=function(j,z,V){var K=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?K+V:K):V=K,j){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=V+L,j={id:m++,callback:z,priorityLevel:j,startTime:V,expirationTime:L,sortIndex:-1},V>K?(j.sortIndex=V,t(d,j),n(f)===null&&j===n(d)&&(E?(C(N),N=-1):E=!0,B(D,V-K))):(j.sortIndex=L,t(f,j),x||g||(x=!0,O||(O=!0,P()))),j},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(j){var z=y;return function(){var V=y;y=z;try{return j.apply(this,arguments)}finally{y=V}}}})(ab)),ab}var QT;function Yz(){return QT||(QT=1,ob.exports=Gz()),ob.exports}var sb={exports:{}},br={};/**
|
|
42
|
+
* @license React
|
|
43
|
+
* react-dom.production.js
|
|
44
|
+
*
|
|
45
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
46
|
+
*
|
|
47
|
+
* This source code is licensed under the MIT license found in the
|
|
48
|
+
* LICENSE file in the root directory of this source tree.
|
|
49
|
+
*/var ZT;function Kz(){if(ZT)return br;ZT=1;var e=Vd();function t(f){var d="https://react.dev/errors/"+f;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)d+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+d+" 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},o=Symbol.for("react.portal");function a(f,d,m){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:h==null?null:""+h,children:f,containerInfo:d,implementation:m}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(f,d){if(f==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return br.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,br.createPortal=function(f,d){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return a(f,d,null,m)},br.flushSync=function(f){var d=l.T,m=r.p;try{if(l.T=null,r.p=2,f)return f()}finally{l.T=d,r.p=m,r.d.f()}},br.preconnect=function(f,d){typeof f=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(f,d))},br.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},br.preinit=function(f,d){if(typeof f=="string"&&d&&typeof d.as=="string"){var m=d.as,h=c(m,d.crossOrigin),y=typeof d.integrity=="string"?d.integrity:void 0,g=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;m==="style"?r.d.S(f,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:h,integrity:y,fetchPriority:g}):m==="script"&&r.d.X(f,{crossOrigin:h,integrity:y,fetchPriority:g,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},br.preinitModule=function(f,d){if(typeof f=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var m=c(d.as,d.crossOrigin);r.d.M(f,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(f)},br.preload=function(f,d){if(typeof f=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var m=d.as,h=c(m,d.crossOrigin);r.d.L(f,m,{crossOrigin:h,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},br.preloadModule=function(f,d){if(typeof f=="string")if(d){var m=c(d.as,d.crossOrigin);r.d.m(f,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(f)},br.requestFormReset=function(f){r.d.r(f)},br.unstable_batchedUpdates=function(f,d){return f(d)},br.useFormState=function(f,d,m){return l.H.useFormState(f,d,m)},br.useFormStatus=function(){return l.H.useHostTransitionStatus()},br.version="19.2.4",br}var JT;function n2(){if(JT)return sb.exports;JT=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(),sb.exports=Kz(),sb.exports}/**
|
|
50
|
+
* @license React
|
|
51
|
+
* react-dom-client.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 eR;function Wz(){if(eR)return ju;eR=1;var e=Yz(),t=Vd(),n=n2();function r(i){var s="https://react.dev/errors/"+i;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)s+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+i+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function a(i){var s=i,u=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(u=s.return),i=s.return;while(i)}return s.tag===3?u:null}function l(i){if(i.tag===13){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function c(i){if(i.tag===31){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function f(i){if(a(i)!==i)throw Error(r(188))}function d(i){var s=i.alternate;if(!s){if(s=a(i),s===null)throw Error(r(188));return s!==i?null:i}for(var u=i,p=s;;){var b=u.return;if(b===null)break;var S=b.alternate;if(S===null){if(p=b.return,p!==null){u=p;continue}break}if(b.child===S.child){for(S=b.child;S;){if(S===u)return f(b),i;if(S===p)return f(b),s;S=S.sibling}throw Error(r(188))}if(u.return!==p.return)u=b,p=S;else{for(var A=!1,Y=b.child;Y;){if(Y===u){A=!0,u=b,p=S;break}if(Y===p){A=!0,p=b,u=S;break}Y=Y.sibling}if(!A){for(Y=S.child;Y;){if(Y===u){A=!0,u=S,p=b;break}if(Y===p){A=!0,p=S,u=b;break}Y=Y.sibling}if(!A)throw Error(r(189))}}if(u.alternate!==p)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?i:s}function m(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i;for(i=i.child;i!==null;){if(s=m(i),s!==null)return s;i=i.sibling}return null}var h=Object.assign,y=Symbol.for("react.element"),g=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),k=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),G=Symbol.iterator;function P(i){return i===null||typeof i!="object"?null:(i=G&&i[G]||i["@@iterator"],typeof i=="function"?i:null)}var U=Symbol.for("react.client.reference");function H(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===U?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case E:return"Fragment";case T:return"Profiler";case R:return"StrictMode";case D:return"Suspense";case O:return"SuspenseList";case q:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case x:return"Portal";case k:return i.displayName||"Context";case C:return(i._context.displayName||"Context")+".Consumer";case M:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case N:return s=i.displayName||null,s!==null?s:H(i.type)||"Memo";case _:s=i._payload,i=i._init;try{return H(i(s))}catch{}}return null}var B=Array.isArray,j=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V={pending:!1,data:null,method:null,action:null},K=[],L=-1;function $(i){return{current:i}}function W(i){0>L||(i.current=K[L],K[L]=null,L--)}function I(i,s){L++,K[L]=i.current,i.current=s}var Q=$(null),le=$(null),oe=$(null),Z=$(null);function ue(i,s){switch(I(oe,s),I(le,i),I(Q,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?QE(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=QE(s),i=ZE(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}W(Q),I(Q,i)}function ve(){W(Q),W(le),W(oe)}function Se(i){i.memoizedState!==null&&I(Z,i);var s=Q.current,u=ZE(s,i.type);s!==u&&(I(le,i),I(Q,u))}function Pe(i){le.current===i&&(W(Q),W(le)),Z.current===i&&(W(Z),Du._currentValue=V)}var te,he;function ye(i){if(te===void 0)try{throw Error()}catch(u){var s=u.stack.trim().match(/\n( *(at )?)/);te=s&&s[1]||"",he=-1<u.stack.indexOf(`
|
|
58
|
+
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
59
|
+
`+te+i+he}var Le=!1;function Oe(i,s){if(!i||Le)return"";Le=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(s){var Ie=function(){throw Error()};if(Object.defineProperty(Ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ie,[])}catch(we){var be=we}Reflect.construct(i,[],Ie)}else{try{Ie.call()}catch(we){be=we}i.call(Ie.prototype)}}else{try{throw Error()}catch(we){be=we}(Ie=i())&&typeof Ie.catch=="function"&&Ie.catch(function(){})}}catch(we){if(we&&be&&typeof we.stack=="string")return[we.stack,be.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=p.DetermineComponentFrameRoot(),A=S[0],Y=S[1];if(A&&Y){var ne=A.split(`
|
|
60
|
+
`),ge=Y.split(`
|
|
61
|
+
`);for(b=p=0;p<ne.length&&!ne[p].includes("DetermineComponentFrameRoot");)p++;for(;b<ge.length&&!ge[b].includes("DetermineComponentFrameRoot");)b++;if(p===ne.length||b===ge.length)for(p=ne.length-1,b=ge.length-1;1<=p&&0<=b&&ne[p]!==ge[b];)b--;for(;1<=p&&0<=b;p--,b--)if(ne[p]!==ge[b]){if(p!==1||b!==1)do if(p--,b--,0>b||ne[p]!==ge[b]){var Me=`
|
|
62
|
+
`+ne[p].replace(" at new "," at ");return i.displayName&&Me.includes("<anonymous>")&&(Me=Me.replace("<anonymous>",i.displayName)),Me}while(1<=p&&0<=b);break}}}finally{Le=!1,Error.prepareStackTrace=u}return(u=i?i.displayName||i.name:"")?ye(u):""}function Te(i,s){switch(i.tag){case 26:case 27:case 5:return ye(i.type);case 16:return ye("Lazy");case 13:return i.child!==s&&s!==null?ye("Suspense Fallback"):ye("Suspense");case 19:return ye("SuspenseList");case 0:case 15:return Oe(i.type,!1);case 11:return Oe(i.type.render,!1);case 1:return Oe(i.type,!0);case 31:return ye("Activity");default:return""}}function Ce(i){try{var s="",u=null;do s+=Te(i,u),u=i,i=i.return;while(i);return s}catch(p){return`
|
|
63
|
+
Error generating stack: `+p.message+`
|
|
64
|
+
`+p.stack}}var J=Object.prototype.hasOwnProperty,Ee=e.unstable_scheduleCallback,xe=e.unstable_cancelCallback,Be=e.unstable_shouldYield,Ve=e.unstable_requestPaint,_e=e.unstable_now,ut=e.unstable_getCurrentPriorityLevel,pe=e.unstable_ImmediatePriority,Re=e.unstable_UserBlockingPriority,ee=e.unstable_NormalPriority,fe=e.unstable_LowPriority,Ne=e.unstable_IdlePriority,Ue=e.log,$e=e.unstable_setDisableYieldValue,et=null,ze=null;function Ze(i){if(typeof Ue=="function"&&$e(i),ze&&typeof ze.setStrictMode=="function")try{ze.setStrictMode(et,i)}catch{}}var nt=Math.clz32?Math.clz32:bt,Ct=Math.log,zt=Math.LN2;function bt(i){return i>>>=0,i===0?32:31-(Ct(i)/zt|0)|0}var Dt=256,ot=262144,ft=4194304;function vt(i){var s=i&42;if(s!==0)return s;switch(i&-i){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 i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function Ke(i,s,u){var p=i.pendingLanes;if(p===0)return 0;var b=0,S=i.suspendedLanes,A=i.pingedLanes;i=i.warmLanes;var Y=p&134217727;return Y!==0?(p=Y&~S,p!==0?b=vt(p):(A&=Y,A!==0?b=vt(A):u||(u=Y&~i,u!==0&&(b=vt(u))))):(Y=p&~S,Y!==0?b=vt(Y):A!==0?b=vt(A):u||(u=p&~i,u!==0&&(b=vt(u)))),b===0?0:s!==0&&s!==b&&(s&S)===0&&(S=b&-b,u=s&-s,S>=u||S===32&&(u&4194048)!==0)?s:b}function Mt(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function Lt(i,s){switch(i){case 1:case 2:case 4:case 8:case 64:return s+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 s+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 kt(){var i=ft;return ft<<=1,(ft&62914560)===0&&(ft=4194304),i}function hn(i){for(var s=[],u=0;31>u;u++)s.push(i);return s}function qt(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Je(i,s,u,p,b,S){var A=i.pendingLanes;i.pendingLanes=u,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=u,i.entangledLanes&=u,i.errorRecoveryDisabledLanes&=u,i.shellSuspendCounter=0;var Y=i.entanglements,ne=i.expirationTimes,ge=i.hiddenUpdates;for(u=A&~u;0<u;){var Me=31-nt(u),Ie=1<<Me;Y[Me]=0,ne[Me]=-1;var be=ge[Me];if(be!==null)for(ge[Me]=null,Me=0;Me<be.length;Me++){var we=be[Me];we!==null&&(we.lane&=-536870913)}u&=~Ie}p!==0&&Ot(i,p,0),S!==0&&b===0&&i.tag!==0&&(i.suspendedLanes|=S&~(A&~s))}function Ot(i,s,u){i.pendingLanes|=s,i.suspendedLanes&=~s;var p=31-nt(s);i.entangledLanes|=s,i.entanglements[p]=i.entanglements[p]|1073741824|u&261930}function X(i,s){var u=i.entangledLanes|=s;for(i=i.entanglements;u;){var p=31-nt(u),b=1<<p;b&s|i[p]&s&&(i[p]|=s),u&=~b}}function ie(i,s){var u=s&-s;return u=(u&42)!==0?1:de(u),(u&(i.suspendedLanes|s))!==0?0:u}function de(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=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:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function ke(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function je(){var i=z.p;return i!==0?i:(i=window.event,i===void 0?32:wT(i.type))}function it(i,s){var u=z.p;try{return z.p=i,s()}finally{z.p=u}}var rt=Math.random().toString(36).slice(2),Ye="__reactFiber$"+rt,Xe="__reactProps$"+rt,at="__reactContainer$"+rt,Et="__reactEvents$"+rt,pt="__reactListeners$"+rt,Pt="__reactHandles$"+rt,Yt="__reactResources$"+rt,_n="__reactMarker$"+rt;function Ln(i){delete i[Ye],delete i[Xe],delete i[Et],delete i[pt],delete i[Pt]}function jn(i){var s=i[Ye];if(s)return s;for(var u=i.parentNode;u;){if(s=u[at]||u[Ye]){if(u=s.alternate,s.child!==null||u!==null&&u.child!==null)for(i=oT(i);i!==null;){if(u=i[Ye])return u;i=oT(i)}return s}i=u,u=i.parentNode}return null}function en(i){if(i=i[Ye]||i[at]){var s=i.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return i}return null}function ir(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i.stateNode;throw Error(r(33))}function Nr(i){var s=i[Yt];return s||(s=i[Yt]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Nn(i){i[_n]=!0}var Ni=new Set,Gr={};function Ai(i,s){li(i,s),li(i+"Capture",s)}function li(i,s){for(Gr[i]=s,i=0;i<s.length;i++)Ni.add(s[i])}var yo=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]*$"),as={},ss={};function tn(i){return J.call(ss,i)?!0:J.call(as,i)?!1:yo.test(i)?ss[i]=!0:(as[i]=!0,!1)}function qn(i,s,u){if(tn(s))if(u===null)i.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":i.removeAttribute(s);return;case"boolean":var p=s.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){i.removeAttribute(s);return}}i.setAttribute(s,""+u)}}function Di(i,s,u){if(u===null)i.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(s);return}i.setAttribute(s,""+u)}}function cr(i,s,u,p){if(p===null)i.removeAttribute(u);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(u);return}i.setAttributeNS(s,u,""+p)}}function nn(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function ls(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function gf(i,s,u){var p=Object.getOwnPropertyDescriptor(i.constructor.prototype,s);if(!i.hasOwnProperty(s)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var b=p.get,S=p.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return b.call(this)},set:function(A){u=""+A,S.call(this,A)}}),Object.defineProperty(i,s,{enumerable:p.enumerable}),{getValue:function(){return u},setValue:function(A){u=""+A},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function Kc(i){if(!i._valueTracker){var s=ls(i)?"checked":"value";i._valueTracker=gf(i,s,""+i[s])}}function V0(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var u=s.getValue(),p="";return i&&(p=ls(i)?i.checked?"true":"false":i.value),i=p,i!==u?(s.setValue(i),!0):!1}function yf(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var O_=/[\n"\\]/g;function ci(i){return i.replace(O_,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Gm(i,s,u,p,b,S,A,Y){i.name="",A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?i.type=A:i.removeAttribute("type"),s!=null?A==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+nn(s)):i.value!==""+nn(s)&&(i.value=""+nn(s)):A!=="submit"&&A!=="reset"||i.removeAttribute("value"),s!=null?Ym(i,A,nn(s)):u!=null?Ym(i,A,nn(u)):p!=null&&i.removeAttribute("value"),b==null&&S!=null&&(i.defaultChecked=!!S),b!=null&&(i.checked=b&&typeof b!="function"&&typeof b!="symbol"),Y!=null&&typeof Y!="function"&&typeof Y!="symbol"&&typeof Y!="boolean"?i.name=""+nn(Y):i.removeAttribute("name")}function $0(i,s,u,p,b,S,A,Y){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(i.type=S),s!=null||u!=null){if(!(S!=="submit"&&S!=="reset"||s!=null)){Kc(i);return}u=u!=null?""+nn(u):"",s=s!=null?""+nn(s):u,Y||s===i.value||(i.value=s),i.defaultValue=s}p=p??b,p=typeof p!="function"&&typeof p!="symbol"&&!!p,i.checked=Y?i.checked:!!p,i.defaultChecked=!!p,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(i.name=A),Kc(i)}function Ym(i,s,u){s==="number"&&yf(i.ownerDocument)===i||i.defaultValue===""+u||(i.defaultValue=""+u)}function ll(i,s,u,p){if(i=i.options,s){s={};for(var b=0;b<u.length;b++)s["$"+u[b]]=!0;for(u=0;u<i.length;u++)b=s.hasOwnProperty("$"+i[u].value),i[u].selected!==b&&(i[u].selected=b),b&&p&&(i[u].defaultSelected=!0)}else{for(u=""+nn(u),s=null,b=0;b<i.length;b++){if(i[b].value===u){i[b].selected=!0,p&&(i[b].defaultSelected=!0);return}s!==null||i[b].disabled||(s=i[b])}s!==null&&(s.selected=!0)}}function G0(i,s,u){if(s!=null&&(s=""+nn(s),s!==i.value&&(i.value=s),u==null)){i.defaultValue!==s&&(i.defaultValue=s);return}i.defaultValue=u!=null?""+nn(u):""}function Y0(i,s,u,p){if(s==null){if(p!=null){if(u!=null)throw Error(r(92));if(B(p)){if(1<p.length)throw Error(r(93));p=p[0]}u=p}u==null&&(u=""),s=u}u=nn(s),i.defaultValue=u,p=i.textContent,p===u&&p!==""&&p!==null&&(i.value=p),Kc(i)}function cl(i,s){if(s){var u=i.firstChild;if(u&&u===i.lastChild&&u.nodeType===3){u.nodeValue=s;return}}i.textContent=s}var N_=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 K0(i,s,u){var p=s.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?p?i.setProperty(s,""):s==="float"?i.cssFloat="":i[s]="":p?i.setProperty(s,u):typeof u!="number"||u===0||N_.has(s)?s==="float"?i.cssFloat=u:i[s]=(""+u).trim():i[s]=u+"px"}function W0(i,s,u){if(s!=null&&typeof s!="object")throw Error(r(62));if(i=i.style,u!=null){for(var p in u)!u.hasOwnProperty(p)||s!=null&&s.hasOwnProperty(p)||(p.indexOf("--")===0?i.setProperty(p,""):p==="float"?i.cssFloat="":i[p]="");for(var b in s)p=s[b],s.hasOwnProperty(b)&&u[b]!==p&&K0(i,b,p)}else for(var S in s)s.hasOwnProperty(S)&&K0(i,S,s[S])}function Km(i){if(i.indexOf("-")===-1)return!1;switch(i){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 A_=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"]]),D_=/^[\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 bf(i){return D_.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function bo(){}var Wm=null;function Xm(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var ul=null,dl=null;function X0(i){var s=en(i);if(s&&(i=s.stateNode)){var u=i[Xe]||null;e:switch(i=s.stateNode,s.type){case"input":if(Gm(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),s=u.name,u.type==="radio"&&s!=null){for(u=i;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+ci(""+s)+'"][type="radio"]'),s=0;s<u.length;s++){var p=u[s];if(p!==i&&p.form===i.form){var b=p[Xe]||null;if(!b)throw Error(r(90));Gm(p,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(s=0;s<u.length;s++)p=u[s],p.form===i.form&&V0(p)}break e;case"textarea":G0(i,u.value,u.defaultValue);break e;case"select":s=u.value,s!=null&&ll(i,!!u.multiple,s,!1)}}}var Qm=!1;function Q0(i,s,u){if(Qm)return i(s,u);Qm=!0;try{var p=i(s);return p}finally{if(Qm=!1,(ul!==null||dl!==null)&&(oh(),ul&&(s=ul,i=dl,dl=ul=null,X0(s),i)))for(s=0;s<i.length;s++)X0(i[s])}}function Wc(i,s){var u=i.stateNode;if(u===null)return null;var p=u[Xe]||null;if(p===null)return null;u=p[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(i=i.type,p=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!p;break e;default:i=!1}if(i)return null;if(u&&typeof u!="function")throw Error(r(231,s,typeof u));return u}var vo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Zm=!1;if(vo)try{var Xc={};Object.defineProperty(Xc,"passive",{get:function(){Zm=!0}}),window.addEventListener("test",Xc,Xc),window.removeEventListener("test",Xc,Xc)}catch{Zm=!1}var ta=null,Jm=null,vf=null;function Z0(){if(vf)return vf;var i,s=Jm,u=s.length,p,b="value"in ta?ta.value:ta.textContent,S=b.length;for(i=0;i<u&&s[i]===b[i];i++);var A=u-i;for(p=1;p<=A&&s[u-p]===b[S-p];p++);return vf=b.slice(i,1<p?1-p:void 0)}function xf(i){var s=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&s===13&&(i=13)):i=s,i===10&&(i=13),32<=i||i===13?i:0}function wf(){return!0}function J0(){return!1}function Ar(i){function s(u,p,b,S,A){this._reactName=u,this._targetInst=b,this.type=p,this.nativeEvent=S,this.target=A,this.currentTarget=null;for(var Y in i)i.hasOwnProperty(Y)&&(u=i[Y],this[Y]=u?u(S):S[Y]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?wf:J0,this.isPropagationStopped=J0,this}return h(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=wf)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=wf)},persist:function(){},isPersistent:wf}),s}var cs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sf=Ar(cs),Qc=h({},cs,{view:0,detail:0}),__=Ar(Qc),eg,tg,Zc,Ef=h({},Qc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rg,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Zc&&(Zc&&i.type==="mousemove"?(eg=i.screenX-Zc.screenX,tg=i.screenY-Zc.screenY):tg=eg=0,Zc=i),eg)},movementY:function(i){return"movementY"in i?i.movementY:tg}}),eS=Ar(Ef),I_=h({},Ef,{dataTransfer:0}),P_=Ar(I_),L_=h({},Qc,{relatedTarget:0}),ng=Ar(L_),j_=h({},cs,{animationName:0,elapsedTime:0,pseudoElement:0}),z_=Ar(j_),F_=h({},cs,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),B_=Ar(F_),U_=h({},cs,{data:0}),tS=Ar(U_),H_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},q_={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"},V_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $_(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=V_[i])?!!s[i]:!1}function rg(){return $_}var G_=h({},Qc,{key:function(i){if(i.key){var s=H_[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=xf(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?q_[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rg,charCode:function(i){return i.type==="keypress"?xf(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?xf(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),Y_=Ar(G_),K_=h({},Ef,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nS=Ar(K_),W_=h({},Qc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rg}),X_=Ar(W_),Q_=h({},cs,{propertyName:0,elapsedTime:0,pseudoElement:0}),Z_=Ar(Q_),J_=h({},Ef,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),eI=Ar(J_),tI=h({},cs,{newState:0,oldState:0}),nI=Ar(tI),rI=[9,13,27,32],ig=vo&&"CompositionEvent"in window,Jc=null;vo&&"documentMode"in document&&(Jc=document.documentMode);var iI=vo&&"TextEvent"in window&&!Jc,rS=vo&&(!ig||Jc&&8<Jc&&11>=Jc),iS=" ",oS=!1;function aS(i,s){switch(i){case"keyup":return rI.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function sS(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var fl=!1;function oI(i,s){switch(i){case"compositionend":return sS(s);case"keypress":return s.which!==32?null:(oS=!0,iS);case"textInput":return i=s.data,i===iS&&oS?null:i;default:return null}}function aI(i,s){if(fl)return i==="compositionend"||!ig&&aS(i,s)?(i=Z0(),vf=Jm=ta=null,fl=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return rS&&s.locale!=="ko"?null:s.data;default:return null}}var sI={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 lS(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!sI[i.type]:s==="textarea"}function cS(i,s,u,p){ul?dl?dl.push(p):dl=[p]:ul=p,s=fh(s,"onChange"),0<s.length&&(u=new Sf("onChange","change",null,u,p),i.push({event:u,listeners:s}))}var eu=null,tu=null;function lI(i){$E(i,0)}function Tf(i){var s=ir(i);if(V0(s))return i}function uS(i,s){if(i==="change")return s}var dS=!1;if(vo){var og;if(vo){var ag="oninput"in document;if(!ag){var fS=document.createElement("div");fS.setAttribute("oninput","return;"),ag=typeof fS.oninput=="function"}og=ag}else og=!1;dS=og&&(!document.documentMode||9<document.documentMode)}function hS(){eu&&(eu.detachEvent("onpropertychange",pS),tu=eu=null)}function pS(i){if(i.propertyName==="value"&&Tf(tu)){var s=[];cS(s,tu,i,Xm(i)),Q0(lI,s)}}function cI(i,s,u){i==="focusin"?(hS(),eu=s,tu=u,eu.attachEvent("onpropertychange",pS)):i==="focusout"&&hS()}function uI(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Tf(tu)}function dI(i,s){if(i==="click")return Tf(s)}function fI(i,s){if(i==="input"||i==="change")return Tf(s)}function hI(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var Yr=typeof Object.is=="function"?Object.is:hI;function nu(i,s){if(Yr(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var u=Object.keys(i),p=Object.keys(s);if(u.length!==p.length)return!1;for(p=0;p<u.length;p++){var b=u[p];if(!J.call(s,b)||!Yr(i[b],s[b]))return!1}return!0}function mS(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function gS(i,s){var u=mS(i);i=0;for(var p;u;){if(u.nodeType===3){if(p=i+u.textContent.length,i<=s&&p>=s)return{node:u,offset:s-i};i=p}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=mS(u)}}function yS(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?yS(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function bS(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=yf(i.document);s instanceof i.HTMLIFrameElement;){try{var u=typeof s.contentWindow.location.href=="string"}catch{u=!1}if(u)i=s.contentWindow;else break;s=yf(i.document)}return s}function sg(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}var pI=vo&&"documentMode"in document&&11>=document.documentMode,hl=null,lg=null,ru=null,cg=!1;function vS(i,s,u){var p=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;cg||hl==null||hl!==yf(p)||(p=hl,"selectionStart"in p&&sg(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),ru&&nu(ru,p)||(ru=p,p=fh(lg,"onSelect"),0<p.length&&(s=new Sf("onSelect","select",null,s,u),i.push({event:s,listeners:p}),s.target=hl)))}function us(i,s){var u={};return u[i.toLowerCase()]=s.toLowerCase(),u["Webkit"+i]="webkit"+s,u["Moz"+i]="moz"+s,u}var pl={animationend:us("Animation","AnimationEnd"),animationiteration:us("Animation","AnimationIteration"),animationstart:us("Animation","AnimationStart"),transitionrun:us("Transition","TransitionRun"),transitionstart:us("Transition","TransitionStart"),transitioncancel:us("Transition","TransitionCancel"),transitionend:us("Transition","TransitionEnd")},ug={},xS={};vo&&(xS=document.createElement("div").style,"AnimationEvent"in window||(delete pl.animationend.animation,delete pl.animationiteration.animation,delete pl.animationstart.animation),"TransitionEvent"in window||delete pl.transitionend.transition);function ds(i){if(ug[i])return ug[i];if(!pl[i])return i;var s=pl[i],u;for(u in s)if(s.hasOwnProperty(u)&&u in xS)return ug[i]=s[u];return i}var wS=ds("animationend"),SS=ds("animationiteration"),ES=ds("animationstart"),mI=ds("transitionrun"),gI=ds("transitionstart"),yI=ds("transitioncancel"),TS=ds("transitionend"),RS=new Map,dg="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(" ");dg.push("scrollEnd");function _i(i,s){RS.set(i,s),Ai(s,[i])}var Rf=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},ui=[],ml=0,fg=0;function Cf(){for(var i=ml,s=fg=ml=0;s<i;){var u=ui[s];ui[s++]=null;var p=ui[s];ui[s++]=null;var b=ui[s];ui[s++]=null;var S=ui[s];if(ui[s++]=null,p!==null&&b!==null){var A=p.pending;A===null?b.next=b:(b.next=A.next,A.next=b),p.pending=b}S!==0&&CS(u,b,S)}}function kf(i,s,u,p){ui[ml++]=i,ui[ml++]=s,ui[ml++]=u,ui[ml++]=p,fg|=p,i.lanes|=p,i=i.alternate,i!==null&&(i.lanes|=p)}function hg(i,s,u,p){return kf(i,s,u,p),Mf(i)}function fs(i,s){return kf(i,null,null,s),Mf(i)}function CS(i,s,u){i.lanes|=u;var p=i.alternate;p!==null&&(p.lanes|=u);for(var b=!1,S=i.return;S!==null;)S.childLanes|=u,p=S.alternate,p!==null&&(p.childLanes|=u),S.tag===22&&(i=S.stateNode,i===null||i._visibility&1||(b=!0)),i=S,S=S.return;return i.tag===3?(S=i.stateNode,b&&s!==null&&(b=31-nt(u),i=S.hiddenUpdates,p=i[b],p===null?i[b]=[s]:p.push(s),s.lane=u|536870912),S):null}function Mf(i){if(50<Ru)throw Ru=0,Sy=null,Error(r(185));for(var s=i.return;s!==null;)i=s,s=i.return;return i.tag===3?i.stateNode:null}var gl={};function bI(i,s,u,p){this.tag=i,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=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kr(i,s,u,p){return new bI(i,s,u,p)}function pg(i){return i=i.prototype,!(!i||!i.isReactComponent)}function xo(i,s){var u=i.alternate;return u===null?(u=Kr(i.tag,s,i.key,i.mode),u.elementType=i.elementType,u.type=i.type,u.stateNode=i.stateNode,u.alternate=i,i.alternate=u):(u.pendingProps=s,u.type=i.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=i.flags&65011712,u.childLanes=i.childLanes,u.lanes=i.lanes,u.child=i.child,u.memoizedProps=i.memoizedProps,u.memoizedState=i.memoizedState,u.updateQueue=i.updateQueue,s=i.dependencies,u.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},u.sibling=i.sibling,u.index=i.index,u.ref=i.ref,u.refCleanup=i.refCleanup,u}function kS(i,s){i.flags&=65011714;var u=i.alternate;return u===null?(i.childLanes=0,i.lanes=s,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=u.childLanes,i.lanes=u.lanes,i.child=u.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=u.memoizedProps,i.memoizedState=u.memoizedState,i.updateQueue=u.updateQueue,i.type=u.type,s=u.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),i}function Of(i,s,u,p,b,S){var A=0;if(p=i,typeof i=="function")pg(i)&&(A=1);else if(typeof i=="string")A=EP(i,u,Q.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case q:return i=Kr(31,u,s,b),i.elementType=q,i.lanes=S,i;case E:return hs(u.children,b,S,s);case R:A=8,b|=24;break;case T:return i=Kr(12,u,s,b|2),i.elementType=T,i.lanes=S,i;case D:return i=Kr(13,u,s,b),i.elementType=D,i.lanes=S,i;case O:return i=Kr(19,u,s,b),i.elementType=O,i.lanes=S,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case k:A=10;break e;case C:A=9;break e;case M:A=11;break e;case N:A=14;break e;case _:A=16,p=null;break e}A=29,u=Error(r(130,i===null?"null":typeof i,"")),p=null}return s=Kr(A,u,s,b),s.elementType=i,s.type=p,s.lanes=S,s}function hs(i,s,u,p){return i=Kr(7,i,p,s),i.lanes=u,i}function mg(i,s,u){return i=Kr(6,i,null,s),i.lanes=u,i}function MS(i){var s=Kr(18,null,null,0);return s.stateNode=i,s}function gg(i,s,u){return s=Kr(4,i.children!==null?i.children:[],i.key,s),s.lanes=u,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var OS=new WeakMap;function di(i,s){if(typeof i=="object"&&i!==null){var u=OS.get(i);return u!==void 0?u:(s={value:i,source:s,stack:Ce(s)},OS.set(i,s),s)}return{value:i,source:s,stack:Ce(s)}}var yl=[],bl=0,Nf=null,iu=0,fi=[],hi=0,na=null,Ki=1,Wi="";function wo(i,s){yl[bl++]=iu,yl[bl++]=Nf,Nf=i,iu=s}function NS(i,s,u){fi[hi++]=Ki,fi[hi++]=Wi,fi[hi++]=na,na=i;var p=Ki;i=Wi;var b=32-nt(p)-1;p&=~(1<<b),u+=1;var S=32-nt(s)+b;if(30<S){var A=b-b%5;S=(p&(1<<A)-1).toString(32),p>>=A,b-=A,Ki=1<<32-nt(s)+b|u<<b|p,Wi=S+i}else Ki=1<<S|u<<b|p,Wi=i}function yg(i){i.return!==null&&(wo(i,1),NS(i,1,0))}function bg(i){for(;i===Nf;)Nf=yl[--bl],yl[bl]=null,iu=yl[--bl],yl[bl]=null;for(;i===na;)na=fi[--hi],fi[hi]=null,Wi=fi[--hi],fi[hi]=null,Ki=fi[--hi],fi[hi]=null}function AS(i,s){fi[hi++]=Ki,fi[hi++]=Wi,fi[hi++]=na,Ki=s.id,Wi=s.overflow,na=i}var ur=null,Cn=null,rn=!1,ra=null,pi=!1,vg=Error(r(519));function ia(i){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ou(di(s,i)),vg}function DS(i){var s=i.stateNode,u=i.type,p=i.memoizedProps;switch(s[Ye]=i,s[Xe]=p,u){case"dialog":Wt("cancel",s),Wt("close",s);break;case"iframe":case"object":case"embed":Wt("load",s);break;case"video":case"audio":for(u=0;u<ku.length;u++)Wt(ku[u],s);break;case"source":Wt("error",s);break;case"img":case"image":case"link":Wt("error",s),Wt("load",s);break;case"details":Wt("toggle",s);break;case"input":Wt("invalid",s),$0(s,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":Wt("invalid",s);break;case"textarea":Wt("invalid",s),Y0(s,p.value,p.defaultValue,p.children)}u=p.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||s.textContent===""+u||p.suppressHydrationWarning===!0||WE(s.textContent,u)?(p.popover!=null&&(Wt("beforetoggle",s),Wt("toggle",s)),p.onScroll!=null&&Wt("scroll",s),p.onScrollEnd!=null&&Wt("scrollend",s),p.onClick!=null&&(s.onclick=bo),s=!0):s=!1,s||ia(i,!0)}function _S(i){for(ur=i.return;ur;)switch(ur.tag){case 5:case 31:case 13:pi=!1;return;case 27:case 3:pi=!0;return;default:ur=ur.return}}function vl(i){if(i!==ur)return!1;if(!rn)return _S(i),rn=!0,!1;var s=i.tag,u;if((u=s!==3&&s!==27)&&((u=s===5)&&(u=i.type,u=!(u!=="form"&&u!=="button")||jy(i.type,i.memoizedProps)),u=!u),u&&Cn&&ia(i),_S(i),s===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Cn=iT(i)}else if(s===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Cn=iT(i)}else s===27?(s=Cn,ba(i.type)?(i=Hy,Hy=null,Cn=i):Cn=s):Cn=ur?gi(i.stateNode.nextSibling):null;return!0}function ps(){Cn=ur=null,rn=!1}function xg(){var i=ra;return i!==null&&(Pr===null?Pr=i:Pr.push.apply(Pr,i),ra=null),i}function ou(i){ra===null?ra=[i]:ra.push(i)}var wg=$(null),ms=null,So=null;function oa(i,s,u){I(wg,s._currentValue),s._currentValue=u}function Eo(i){i._currentValue=wg.current,W(wg)}function Sg(i,s,u){for(;i!==null;){var p=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,p!==null&&(p.childLanes|=s)):p!==null&&(p.childLanes&s)!==s&&(p.childLanes|=s),i===u)break;i=i.return}}function Eg(i,s,u,p){var b=i.child;for(b!==null&&(b.return=i);b!==null;){var S=b.dependencies;if(S!==null){var A=b.child;S=S.firstContext;e:for(;S!==null;){var Y=S;S=b;for(var ne=0;ne<s.length;ne++)if(Y.context===s[ne]){S.lanes|=u,Y=S.alternate,Y!==null&&(Y.lanes|=u),Sg(S.return,u,i),p||(A=null);break e}S=Y.next}}else if(b.tag===18){if(A=b.return,A===null)throw Error(r(341));A.lanes|=u,S=A.alternate,S!==null&&(S.lanes|=u),Sg(A,u,i),A=null}else A=b.child;if(A!==null)A.return=b;else for(A=b;A!==null;){if(A===i){A=null;break}if(b=A.sibling,b!==null){b.return=A.return,A=b;break}A=A.return}b=A}}function xl(i,s,u,p){i=null;for(var b=s,S=!1;b!==null;){if(!S){if((b.flags&524288)!==0)S=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var A=b.alternate;if(A===null)throw Error(r(387));if(A=A.memoizedProps,A!==null){var Y=b.type;Yr(b.pendingProps.value,A.value)||(i!==null?i.push(Y):i=[Y])}}else if(b===Z.current){if(A=b.alternate,A===null)throw Error(r(387));A.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(i!==null?i.push(Du):i=[Du])}b=b.return}i!==null&&Eg(s,i,u,p),s.flags|=262144}function Af(i){for(i=i.firstContext;i!==null;){if(!Yr(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function gs(i){ms=i,So=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function dr(i){return IS(ms,i)}function Df(i,s){return ms===null&&gs(i),IS(i,s)}function IS(i,s){var u=s._currentValue;if(s={context:s,memoizedValue:u,next:null},So===null){if(i===null)throw Error(r(308));So=s,i.dependencies={lanes:0,firstContext:s},i.flags|=524288}else So=So.next=s;return u}var vI=typeof AbortController<"u"?AbortController:function(){var i=[],s=this.signal={aborted:!1,addEventListener:function(u,p){i.push(p)}};this.abort=function(){s.aborted=!0,i.forEach(function(u){return u()})}},xI=e.unstable_scheduleCallback,wI=e.unstable_NormalPriority,Gn={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Tg(){return{controller:new vI,data:new Map,refCount:0}}function au(i){i.refCount--,i.refCount===0&&xI(wI,function(){i.controller.abort()})}var su=null,Rg=0,wl=0,Sl=null;function SI(i,s){if(su===null){var u=su=[];Rg=0,wl=My(),Sl={status:"pending",value:void 0,then:function(p){u.push(p)}}}return Rg++,s.then(PS,PS),s}function PS(){if(--Rg===0&&su!==null){Sl!==null&&(Sl.status="fulfilled");var i=su;su=null,wl=0,Sl=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function EI(i,s){var u=[],p={status:"pending",value:null,reason:null,then:function(b){u.push(b)}};return i.then(function(){p.status="fulfilled",p.value=s;for(var b=0;b<u.length;b++)(0,u[b])(s)},function(b){for(p.status="rejected",p.reason=b,b=0;b<u.length;b++)(0,u[b])(void 0)}),p}var LS=j.S;j.S=function(i,s){vE=_e(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&SI(i,s),LS!==null&&LS(i,s)};var ys=$(null);function Cg(){var i=ys.current;return i!==null?i:Sn.pooledCache}function _f(i,s){s===null?I(ys,ys.current):I(ys,s.pool)}function jS(){var i=Cg();return i===null?null:{parent:Gn._currentValue,pool:i}}var El=Error(r(460)),kg=Error(r(474)),If=Error(r(542)),Pf={then:function(){}};function zS(i){return i=i.status,i==="fulfilled"||i==="rejected"}function FS(i,s,u){switch(u=i[u],u===void 0?i.push(s):u!==s&&(s.then(bo,bo),s=u),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,US(i),i;default:if(typeof s.status=="string")s.then(bo,bo);else{if(i=Sn,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=s,i.status="pending",i.then(function(p){if(s.status==="pending"){var b=s;b.status="fulfilled",b.value=p}},function(p){if(s.status==="pending"){var b=s;b.status="rejected",b.reason=p}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,US(i),i}throw vs=s,El}}function bs(i){try{var s=i._init;return s(i._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(vs=u,El):u}}var vs=null;function BS(){if(vs===null)throw Error(r(459));var i=vs;return vs=null,i}function US(i){if(i===El||i===If)throw Error(r(483))}var Tl=null,lu=0;function Lf(i){var s=lu;return lu+=1,Tl===null&&(Tl=[]),FS(Tl,i,s)}function cu(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function jf(i,s){throw s.$$typeof===y?Error(r(525)):(i=Object.prototype.toString.call(s),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i)))}function HS(i){function s(ce,ae){if(i){var me=ce.deletions;me===null?(ce.deletions=[ae],ce.flags|=16):me.push(ae)}}function u(ce,ae){if(!i)return null;for(;ae!==null;)s(ce,ae),ae=ae.sibling;return null}function p(ce){for(var ae=new Map;ce!==null;)ce.key!==null?ae.set(ce.key,ce):ae.set(ce.index,ce),ce=ce.sibling;return ae}function b(ce,ae){return ce=xo(ce,ae),ce.index=0,ce.sibling=null,ce}function S(ce,ae,me){return ce.index=me,i?(me=ce.alternate,me!==null?(me=me.index,me<ae?(ce.flags|=67108866,ae):me):(ce.flags|=67108866,ae)):(ce.flags|=1048576,ae)}function A(ce){return i&&ce.alternate===null&&(ce.flags|=67108866),ce}function Y(ce,ae,me,Ae){return ae===null||ae.tag!==6?(ae=mg(me,ce.mode,Ae),ae.return=ce,ae):(ae=b(ae,me),ae.return=ce,ae)}function ne(ce,ae,me,Ae){var gt=me.type;return gt===E?Me(ce,ae,me.props.children,Ae,me.key):ae!==null&&(ae.elementType===gt||typeof gt=="object"&>!==null&>.$$typeof===_&&bs(gt)===ae.type)?(ae=b(ae,me.props),cu(ae,me),ae.return=ce,ae):(ae=Of(me.type,me.key,me.props,null,ce.mode,Ae),cu(ae,me),ae.return=ce,ae)}function ge(ce,ae,me,Ae){return ae===null||ae.tag!==4||ae.stateNode.containerInfo!==me.containerInfo||ae.stateNode.implementation!==me.implementation?(ae=gg(me,ce.mode,Ae),ae.return=ce,ae):(ae=b(ae,me.children||[]),ae.return=ce,ae)}function Me(ce,ae,me,Ae,gt){return ae===null||ae.tag!==7?(ae=hs(me,ce.mode,Ae,gt),ae.return=ce,ae):(ae=b(ae,me),ae.return=ce,ae)}function Ie(ce,ae,me){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return ae=mg(""+ae,ce.mode,me),ae.return=ce,ae;if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case g:return me=Of(ae.type,ae.key,ae.props,null,ce.mode,me),cu(me,ae),me.return=ce,me;case x:return ae=gg(ae,ce.mode,me),ae.return=ce,ae;case _:return ae=bs(ae),Ie(ce,ae,me)}if(B(ae)||P(ae))return ae=hs(ae,ce.mode,me,null),ae.return=ce,ae;if(typeof ae.then=="function")return Ie(ce,Lf(ae),me);if(ae.$$typeof===k)return Ie(ce,Df(ce,ae),me);jf(ce,ae)}return null}function be(ce,ae,me,Ae){var gt=ae!==null?ae.key:null;if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return gt!==null?null:Y(ce,ae,""+me,Ae);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case g:return me.key===gt?ne(ce,ae,me,Ae):null;case x:return me.key===gt?ge(ce,ae,me,Ae):null;case _:return me=bs(me),be(ce,ae,me,Ae)}if(B(me)||P(me))return gt!==null?null:Me(ce,ae,me,Ae,null);if(typeof me.then=="function")return be(ce,ae,Lf(me),Ae);if(me.$$typeof===k)return be(ce,ae,Df(ce,me),Ae);jf(ce,me)}return null}function we(ce,ae,me,Ae,gt){if(typeof Ae=="string"&&Ae!==""||typeof Ae=="number"||typeof Ae=="bigint")return ce=ce.get(me)||null,Y(ae,ce,""+Ae,gt);if(typeof Ae=="object"&&Ae!==null){switch(Ae.$$typeof){case g:return ce=ce.get(Ae.key===null?me:Ae.key)||null,ne(ae,ce,Ae,gt);case x:return ce=ce.get(Ae.key===null?me:Ae.key)||null,ge(ae,ce,Ae,gt);case _:return Ae=bs(Ae),we(ce,ae,me,Ae,gt)}if(B(Ae)||P(Ae))return ce=ce.get(me)||null,Me(ae,ce,Ae,gt,null);if(typeof Ae.then=="function")return we(ce,ae,me,Lf(Ae),gt);if(Ae.$$typeof===k)return we(ce,ae,me,Df(ae,Ae),gt);jf(ae,Ae)}return null}function st(ce,ae,me,Ae){for(var gt=null,un=null,dt=ae,Ft=ae=0,Jt=null;dt!==null&&Ft<me.length;Ft++){dt.index>Ft?(Jt=dt,dt=null):Jt=dt.sibling;var dn=be(ce,dt,me[Ft],Ae);if(dn===null){dt===null&&(dt=Jt);break}i&&dt&&dn.alternate===null&&s(ce,dt),ae=S(dn,ae,Ft),un===null?gt=dn:un.sibling=dn,un=dn,dt=Jt}if(Ft===me.length)return u(ce,dt),rn&&wo(ce,Ft),gt;if(dt===null){for(;Ft<me.length;Ft++)dt=Ie(ce,me[Ft],Ae),dt!==null&&(ae=S(dt,ae,Ft),un===null?gt=dt:un.sibling=dt,un=dt);return rn&&wo(ce,Ft),gt}for(dt=p(dt);Ft<me.length;Ft++)Jt=we(dt,ce,Ft,me[Ft],Ae),Jt!==null&&(i&&Jt.alternate!==null&&dt.delete(Jt.key===null?Ft:Jt.key),ae=S(Jt,ae,Ft),un===null?gt=Jt:un.sibling=Jt,un=Jt);return i&&dt.forEach(function(Ea){return s(ce,Ea)}),rn&&wo(ce,Ft),gt}function wt(ce,ae,me,Ae){if(me==null)throw Error(r(151));for(var gt=null,un=null,dt=ae,Ft=ae=0,Jt=null,dn=me.next();dt!==null&&!dn.done;Ft++,dn=me.next()){dt.index>Ft?(Jt=dt,dt=null):Jt=dt.sibling;var Ea=be(ce,dt,dn.value,Ae);if(Ea===null){dt===null&&(dt=Jt);break}i&&dt&&Ea.alternate===null&&s(ce,dt),ae=S(Ea,ae,Ft),un===null?gt=Ea:un.sibling=Ea,un=Ea,dt=Jt}if(dn.done)return u(ce,dt),rn&&wo(ce,Ft),gt;if(dt===null){for(;!dn.done;Ft++,dn=me.next())dn=Ie(ce,dn.value,Ae),dn!==null&&(ae=S(dn,ae,Ft),un===null?gt=dn:un.sibling=dn,un=dn);return rn&&wo(ce,Ft),gt}for(dt=p(dt);!dn.done;Ft++,dn=me.next())dn=we(dt,ce,Ft,dn.value,Ae),dn!==null&&(i&&dn.alternate!==null&&dt.delete(dn.key===null?Ft:dn.key),ae=S(dn,ae,Ft),un===null?gt=dn:un.sibling=dn,un=dn);return i&&dt.forEach(function(IP){return s(ce,IP)}),rn&&wo(ce,Ft),gt}function wn(ce,ae,me,Ae){if(typeof me=="object"&&me!==null&&me.type===E&&me.key===null&&(me=me.props.children),typeof me=="object"&&me!==null){switch(me.$$typeof){case g:e:{for(var gt=me.key;ae!==null;){if(ae.key===gt){if(gt=me.type,gt===E){if(ae.tag===7){u(ce,ae.sibling),Ae=b(ae,me.props.children),Ae.return=ce,ce=Ae;break e}}else if(ae.elementType===gt||typeof gt=="object"&>!==null&>.$$typeof===_&&bs(gt)===ae.type){u(ce,ae.sibling),Ae=b(ae,me.props),cu(Ae,me),Ae.return=ce,ce=Ae;break e}u(ce,ae);break}else s(ce,ae);ae=ae.sibling}me.type===E?(Ae=hs(me.props.children,ce.mode,Ae,me.key),Ae.return=ce,ce=Ae):(Ae=Of(me.type,me.key,me.props,null,ce.mode,Ae),cu(Ae,me),Ae.return=ce,ce=Ae)}return A(ce);case x:e:{for(gt=me.key;ae!==null;){if(ae.key===gt)if(ae.tag===4&&ae.stateNode.containerInfo===me.containerInfo&&ae.stateNode.implementation===me.implementation){u(ce,ae.sibling),Ae=b(ae,me.children||[]),Ae.return=ce,ce=Ae;break e}else{u(ce,ae);break}else s(ce,ae);ae=ae.sibling}Ae=gg(me,ce.mode,Ae),Ae.return=ce,ce=Ae}return A(ce);case _:return me=bs(me),wn(ce,ae,me,Ae)}if(B(me))return st(ce,ae,me,Ae);if(P(me)){if(gt=P(me),typeof gt!="function")throw Error(r(150));return me=gt.call(me),wt(ce,ae,me,Ae)}if(typeof me.then=="function")return wn(ce,ae,Lf(me),Ae);if(me.$$typeof===k)return wn(ce,ae,Df(ce,me),Ae);jf(ce,me)}return typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint"?(me=""+me,ae!==null&&ae.tag===6?(u(ce,ae.sibling),Ae=b(ae,me),Ae.return=ce,ce=Ae):(u(ce,ae),Ae=mg(me,ce.mode,Ae),Ae.return=ce,ce=Ae),A(ce)):u(ce,ae)}return function(ce,ae,me,Ae){try{lu=0;var gt=wn(ce,ae,me,Ae);return Tl=null,gt}catch(dt){if(dt===El||dt===If)throw dt;var un=Kr(29,dt,null,ce.mode);return un.lanes=Ae,un.return=ce,un}finally{}}}var xs=HS(!0),qS=HS(!1),aa=!1;function Mg(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Og(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function sa(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function la(i,s,u){var p=i.updateQueue;if(p===null)return null;if(p=p.shared,(pn&2)!==0){var b=p.pending;return b===null?s.next=s:(s.next=b.next,b.next=s),p.pending=s,s=Mf(i),CS(i,null,u),s}return kf(i,p,s,u),Mf(i)}function uu(i,s,u){if(s=s.updateQueue,s!==null&&(s=s.shared,(u&4194048)!==0)){var p=s.lanes;p&=i.pendingLanes,u|=p,s.lanes=u,X(i,u)}}function Ng(i,s){var u=i.updateQueue,p=i.alternate;if(p!==null&&(p=p.updateQueue,u===p)){var b=null,S=null;if(u=u.firstBaseUpdate,u!==null){do{var A={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};S===null?b=S=A:S=S.next=A,u=u.next}while(u!==null);S===null?b=S=s:S=S.next=s}else b=S=s;u={baseState:p.baseState,firstBaseUpdate:b,lastBaseUpdate:S,shared:p.shared,callbacks:p.callbacks},i.updateQueue=u;return}i=u.lastBaseUpdate,i===null?u.firstBaseUpdate=s:i.next=s,u.lastBaseUpdate=s}var Ag=!1;function du(){if(Ag){var i=Sl;if(i!==null)throw i}}function fu(i,s,u,p){Ag=!1;var b=i.updateQueue;aa=!1;var S=b.firstBaseUpdate,A=b.lastBaseUpdate,Y=b.shared.pending;if(Y!==null){b.shared.pending=null;var ne=Y,ge=ne.next;ne.next=null,A===null?S=ge:A.next=ge,A=ne;var Me=i.alternate;Me!==null&&(Me=Me.updateQueue,Y=Me.lastBaseUpdate,Y!==A&&(Y===null?Me.firstBaseUpdate=ge:Y.next=ge,Me.lastBaseUpdate=ne))}if(S!==null){var Ie=b.baseState;A=0,Me=ge=ne=null,Y=S;do{var be=Y.lane&-536870913,we=be!==Y.lane;if(we?(Zt&be)===be:(p&be)===be){be!==0&&be===wl&&(Ag=!0),Me!==null&&(Me=Me.next={lane:0,tag:Y.tag,payload:Y.payload,callback:null,next:null});e:{var st=i,wt=Y;be=s;var wn=u;switch(wt.tag){case 1:if(st=wt.payload,typeof st=="function"){Ie=st.call(wn,Ie,be);break e}Ie=st;break e;case 3:st.flags=st.flags&-65537|128;case 0:if(st=wt.payload,be=typeof st=="function"?st.call(wn,Ie,be):st,be==null)break e;Ie=h({},Ie,be);break e;case 2:aa=!0}}be=Y.callback,be!==null&&(i.flags|=64,we&&(i.flags|=8192),we=b.callbacks,we===null?b.callbacks=[be]:we.push(be))}else we={lane:be,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null},Me===null?(ge=Me=we,ne=Ie):Me=Me.next=we,A|=be;if(Y=Y.next,Y===null){if(Y=b.shared.pending,Y===null)break;we=Y,Y=we.next,we.next=null,b.lastBaseUpdate=we,b.shared.pending=null}}while(!0);Me===null&&(ne=Ie),b.baseState=ne,b.firstBaseUpdate=ge,b.lastBaseUpdate=Me,S===null&&(b.shared.lanes=0),ha|=A,i.lanes=A,i.memoizedState=Ie}}function VS(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function $S(i,s){var u=i.callbacks;if(u!==null)for(i.callbacks=null,i=0;i<u.length;i++)VS(u[i],s)}var Rl=$(null),zf=$(0);function GS(i,s){i=Do,I(zf,i),I(Rl,s),Do=i|s.baseLanes}function Dg(){I(zf,Do),I(Rl,Rl.current)}function _g(){Do=zf.current,W(Rl),W(zf)}var Wr=$(null),mi=null;function ca(i){var s=i.alternate;I(Vn,Vn.current&1),I(Wr,i),mi===null&&(s===null||Rl.current!==null||s.memoizedState!==null)&&(mi=i)}function Ig(i){I(Vn,Vn.current),I(Wr,i),mi===null&&(mi=i)}function YS(i){i.tag===22?(I(Vn,Vn.current),I(Wr,i),mi===null&&(mi=i)):ua()}function ua(){I(Vn,Vn.current),I(Wr,Wr.current)}function Xr(i){W(Wr),mi===i&&(mi=null),W(Vn)}var Vn=$(0);function Ff(i){for(var s=i;s!==null;){if(s.tag===13){var u=s.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||By(u)||Uy(u)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var To=0,jt=null,vn=null,Yn=null,Bf=!1,Cl=!1,ws=!1,Uf=0,hu=0,kl=null,TI=0;function zn(){throw Error(r(321))}function Pg(i,s){if(s===null)return!1;for(var u=0;u<s.length&&u<i.length;u++)if(!Yr(i[u],s[u]))return!1;return!0}function Lg(i,s,u,p,b,S){return To=S,jt=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,j.H=i===null||i.memoizedState===null?N1:Qg,ws=!1,S=u(p,b),ws=!1,Cl&&(S=WS(s,u,p,b)),KS(i),S}function KS(i){j.H=gu;var s=vn!==null&&vn.next!==null;if(To=0,Yn=vn=jt=null,Bf=!1,hu=0,kl=null,s)throw Error(r(300));i===null||Kn||(i=i.dependencies,i!==null&&Af(i)&&(Kn=!0))}function WS(i,s,u,p){jt=i;var b=0;do{if(Cl&&(kl=null),hu=0,Cl=!1,25<=b)throw Error(r(301));if(b+=1,Yn=vn=null,i.updateQueue!=null){var S=i.updateQueue;S.lastEffect=null,S.events=null,S.stores=null,S.memoCache!=null&&(S.memoCache.index=0)}j.H=A1,S=s(u,p)}while(Cl);return S}function RI(){var i=j.H,s=i.useState()[0];return s=typeof s.then=="function"?pu(s):s,i=i.useState()[0],(vn!==null?vn.memoizedState:null)!==i&&(jt.flags|=1024),s}function jg(){var i=Uf!==0;return Uf=0,i}function zg(i,s,u){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~u}function Fg(i){if(Bf){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}Bf=!1}To=0,Yn=vn=jt=null,Cl=!1,hu=Uf=0,kl=null}function Tr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Yn===null?jt.memoizedState=Yn=i:Yn=Yn.next=i,Yn}function $n(){if(vn===null){var i=jt.alternate;i=i!==null?i.memoizedState:null}else i=vn.next;var s=Yn===null?jt.memoizedState:Yn.next;if(s!==null)Yn=s,vn=i;else{if(i===null)throw jt.alternate===null?Error(r(467)):Error(r(310));vn=i,i={memoizedState:vn.memoizedState,baseState:vn.baseState,baseQueue:vn.baseQueue,queue:vn.queue,next:null},Yn===null?jt.memoizedState=Yn=i:Yn=Yn.next=i}return Yn}function Hf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function pu(i){var s=hu;return hu+=1,kl===null&&(kl=[]),i=FS(kl,i,s),s=jt,(Yn===null?s.memoizedState:Yn.next)===null&&(s=s.alternate,j.H=s===null||s.memoizedState===null?N1:Qg),i}function qf(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return pu(i);if(i.$$typeof===k)return dr(i)}throw Error(r(438,String(i)))}function Bg(i){var s=null,u=jt.updateQueue;if(u!==null&&(s=u.memoCache),s==null){var p=jt.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(s={data:p.data.map(function(b){return b.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),u===null&&(u=Hf(),jt.updateQueue=u),u.memoCache=s,u=s.data[s.index],u===void 0)for(u=s.data[s.index]=Array(i),p=0;p<i;p++)u[p]=F;return s.index++,u}function Ro(i,s){return typeof s=="function"?s(i):s}function Vf(i){var s=$n();return Ug(s,vn,i)}function Ug(i,s,u){var p=i.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=u;var b=i.baseQueue,S=p.pending;if(S!==null){if(b!==null){var A=b.next;b.next=S.next,S.next=A}s.baseQueue=b=S,p.pending=null}if(S=i.baseState,b===null)i.memoizedState=S;else{s=b.next;var Y=A=null,ne=null,ge=s,Me=!1;do{var Ie=ge.lane&-536870913;if(Ie!==ge.lane?(Zt&Ie)===Ie:(To&Ie)===Ie){var be=ge.revertLane;if(be===0)ne!==null&&(ne=ne.next={lane:0,revertLane:0,gesture:null,action:ge.action,hasEagerState:ge.hasEagerState,eagerState:ge.eagerState,next:null}),Ie===wl&&(Me=!0);else if((To&be)===be){ge=ge.next,be===wl&&(Me=!0);continue}else Ie={lane:0,revertLane:ge.revertLane,gesture:null,action:ge.action,hasEagerState:ge.hasEagerState,eagerState:ge.eagerState,next:null},ne===null?(Y=ne=Ie,A=S):ne=ne.next=Ie,jt.lanes|=be,ha|=be;Ie=ge.action,ws&&u(S,Ie),S=ge.hasEagerState?ge.eagerState:u(S,Ie)}else be={lane:Ie,revertLane:ge.revertLane,gesture:ge.gesture,action:ge.action,hasEagerState:ge.hasEagerState,eagerState:ge.eagerState,next:null},ne===null?(Y=ne=be,A=S):ne=ne.next=be,jt.lanes|=Ie,ha|=Ie;ge=ge.next}while(ge!==null&&ge!==s);if(ne===null?A=S:ne.next=Y,!Yr(S,i.memoizedState)&&(Kn=!0,Me&&(u=Sl,u!==null)))throw u;i.memoizedState=S,i.baseState=A,i.baseQueue=ne,p.lastRenderedState=S}return b===null&&(p.lanes=0),[i.memoizedState,p.dispatch]}function Hg(i){var s=$n(),u=s.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=i;var p=u.dispatch,b=u.pending,S=s.memoizedState;if(b!==null){u.pending=null;var A=b=b.next;do S=i(S,A.action),A=A.next;while(A!==b);Yr(S,s.memoizedState)||(Kn=!0),s.memoizedState=S,s.baseQueue===null&&(s.baseState=S),u.lastRenderedState=S}return[S,p]}function XS(i,s,u){var p=jt,b=$n(),S=rn;if(S){if(u===void 0)throw Error(r(407));u=u()}else u=s();var A=!Yr((vn||b).memoizedState,u);if(A&&(b.memoizedState=u,Kn=!0),b=b.queue,$g(JS.bind(null,p,b,i),[i]),b.getSnapshot!==s||A||Yn!==null&&Yn.memoizedState.tag&1){if(p.flags|=2048,Ml(9,{destroy:void 0},ZS.bind(null,p,b,u,s),null),Sn===null)throw Error(r(349));S||(To&127)!==0||QS(p,s,u)}return u}function QS(i,s,u){i.flags|=16384,i={getSnapshot:s,value:u},s=jt.updateQueue,s===null?(s=Hf(),jt.updateQueue=s,s.stores=[i]):(u=s.stores,u===null?s.stores=[i]:u.push(i))}function ZS(i,s,u,p){s.value=u,s.getSnapshot=p,e1(s)&&t1(i)}function JS(i,s,u){return u(function(){e1(s)&&t1(i)})}function e1(i){var s=i.getSnapshot;i=i.value;try{var u=s();return!Yr(i,u)}catch{return!0}}function t1(i){var s=fs(i,2);s!==null&&Lr(s,i,2)}function qg(i){var s=Tr();if(typeof i=="function"){var u=i;if(i=u(),ws){Ze(!0);try{u()}finally{Ze(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:i},s}function n1(i,s,u,p){return i.baseState=u,Ug(i,vn,typeof p=="function"?p:Ro)}function CI(i,s,u,p,b){if(Yf(i))throw Error(r(485));if(i=s.action,i!==null){var S={payload:b,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(A){S.listeners.push(A)}};j.T!==null?u(!0):S.isTransition=!1,p(S),u=s.pending,u===null?(S.next=s.pending=S,r1(s,S)):(S.next=u.next,s.pending=u.next=S)}}function r1(i,s){var u=s.action,p=s.payload,b=i.state;if(s.isTransition){var S=j.T,A={};j.T=A;try{var Y=u(b,p),ne=j.S;ne!==null&&ne(A,Y),i1(i,s,Y)}catch(ge){Vg(i,s,ge)}finally{S!==null&&A.types!==null&&(S.types=A.types),j.T=S}}else try{S=u(b,p),i1(i,s,S)}catch(ge){Vg(i,s,ge)}}function i1(i,s,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(p){o1(i,s,p)},function(p){return Vg(i,s,p)}):o1(i,s,u)}function o1(i,s,u){s.status="fulfilled",s.value=u,a1(s),i.state=u,s=i.pending,s!==null&&(u=s.next,u===s?i.pending=null:(u=u.next,s.next=u,r1(i,u)))}function Vg(i,s,u){var p=i.pending;if(i.pending=null,p!==null){p=p.next;do s.status="rejected",s.reason=u,a1(s),s=s.next;while(s!==p)}i.action=null}function a1(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function s1(i,s){return s}function l1(i,s){if(rn){var u=Sn.formState;if(u!==null){e:{var p=jt;if(rn){if(Cn){t:{for(var b=Cn,S=pi;b.nodeType!==8;){if(!S){b=null;break t}if(b=gi(b.nextSibling),b===null){b=null;break t}}S=b.data,b=S==="F!"||S==="F"?b:null}if(b){Cn=gi(b.nextSibling),p=b.data==="F!";break e}}ia(p)}p=!1}p&&(s=u[0])}}return u=Tr(),u.memoizedState=u.baseState=s,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s1,lastRenderedState:s},u.queue=p,u=k1.bind(null,jt,p),p.dispatch=u,p=qg(!1),S=Xg.bind(null,jt,!1,p.queue),p=Tr(),b={state:s,dispatch:null,action:i,pending:null},p.queue=b,u=CI.bind(null,jt,b,S,u),b.dispatch=u,p.memoizedState=i,[s,u,!1]}function c1(i){var s=$n();return u1(s,vn,i)}function u1(i,s,u){if(s=Ug(i,s,s1)[0],i=Vf(Ro)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var p=pu(s)}catch(A){throw A===El?If:A}else p=s;s=$n();var b=s.queue,S=b.dispatch;return u!==s.memoizedState&&(jt.flags|=2048,Ml(9,{destroy:void 0},kI.bind(null,b,u),null)),[p,S,i]}function kI(i,s){i.action=s}function d1(i){var s=$n(),u=vn;if(u!==null)return u1(s,u,i);$n(),s=s.memoizedState,u=$n();var p=u.queue.dispatch;return u.memoizedState=i,[s,p,!1]}function Ml(i,s,u,p){return i={tag:i,create:u,deps:p,inst:s,next:null},s=jt.updateQueue,s===null&&(s=Hf(),jt.updateQueue=s),u=s.lastEffect,u===null?s.lastEffect=i.next=i:(p=u.next,u.next=i,i.next=p,s.lastEffect=i),i}function f1(){return $n().memoizedState}function $f(i,s,u,p){var b=Tr();jt.flags|=i,b.memoizedState=Ml(1|s,{destroy:void 0},u,p===void 0?null:p)}function Gf(i,s,u,p){var b=$n();p=p===void 0?null:p;var S=b.memoizedState.inst;vn!==null&&p!==null&&Pg(p,vn.memoizedState.deps)?b.memoizedState=Ml(s,S,u,p):(jt.flags|=i,b.memoizedState=Ml(1|s,S,u,p))}function h1(i,s){$f(8390656,8,i,s)}function $g(i,s){Gf(2048,8,i,s)}function MI(i){jt.flags|=4;var s=jt.updateQueue;if(s===null)s=Hf(),jt.updateQueue=s,s.events=[i];else{var u=s.events;u===null?s.events=[i]:u.push(i)}}function p1(i){var s=$n().memoizedState;return MI({ref:s,nextImpl:i}),function(){if((pn&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function m1(i,s){return Gf(4,2,i,s)}function g1(i,s){return Gf(4,4,i,s)}function y1(i,s){if(typeof s=="function"){i=i();var u=s(i);return function(){typeof u=="function"?u():s(null)}}if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function b1(i,s,u){u=u!=null?u.concat([i]):null,Gf(4,4,y1.bind(null,s,i),u)}function Gg(){}function v1(i,s){var u=$n();s=s===void 0?null:s;var p=u.memoizedState;return s!==null&&Pg(s,p[1])?p[0]:(u.memoizedState=[i,s],i)}function x1(i,s){var u=$n();s=s===void 0?null:s;var p=u.memoizedState;if(s!==null&&Pg(s,p[1]))return p[0];if(p=i(),ws){Ze(!0);try{i()}finally{Ze(!1)}}return u.memoizedState=[p,s],p}function Yg(i,s,u){return u===void 0||(To&1073741824)!==0&&(Zt&261930)===0?i.memoizedState=s:(i.memoizedState=u,i=wE(),jt.lanes|=i,ha|=i,u)}function w1(i,s,u,p){return Yr(u,s)?u:Rl.current!==null?(i=Yg(i,u,p),Yr(i,s)||(Kn=!0),i):(To&42)===0||(To&1073741824)!==0&&(Zt&261930)===0?(Kn=!0,i.memoizedState=u):(i=wE(),jt.lanes|=i,ha|=i,s)}function S1(i,s,u,p,b){var S=z.p;z.p=S!==0&&8>S?S:8;var A=j.T,Y={};j.T=Y,Xg(i,!1,s,u);try{var ne=b(),ge=j.S;if(ge!==null&&ge(Y,ne),ne!==null&&typeof ne=="object"&&typeof ne.then=="function"){var Me=EI(ne,p);mu(i,s,Me,Jr(i))}else mu(i,s,p,Jr(i))}catch(Ie){mu(i,s,{then:function(){},status:"rejected",reason:Ie},Jr())}finally{z.p=S,A!==null&&Y.types!==null&&(A.types=Y.types),j.T=A}}function OI(){}function Kg(i,s,u,p){if(i.tag!==5)throw Error(r(476));var b=E1(i).queue;S1(i,b,s,V,u===null?OI:function(){return T1(i),u(p)})}function E1(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:V},next:null};var u={};return s.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:u},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function T1(i){var s=E1(i);s.next===null&&(s=i.alternate.memoizedState),mu(i,s.next.queue,{},Jr())}function Wg(){return dr(Du)}function R1(){return $n().memoizedState}function C1(){return $n().memoizedState}function NI(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var u=Jr();i=sa(u);var p=la(s,i,u);p!==null&&(Lr(p,s,u),uu(p,s,u)),s={cache:Tg()},i.payload=s;return}s=s.return}}function AI(i,s,u){var p=Jr();u={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Yf(i)?M1(s,u):(u=hg(i,s,u,p),u!==null&&(Lr(u,i,p),O1(u,s,p)))}function k1(i,s,u){var p=Jr();mu(i,s,u,p)}function mu(i,s,u,p){var b={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Yf(i))M1(s,b);else{var S=i.alternate;if(i.lanes===0&&(S===null||S.lanes===0)&&(S=s.lastRenderedReducer,S!==null))try{var A=s.lastRenderedState,Y=S(A,u);if(b.hasEagerState=!0,b.eagerState=Y,Yr(Y,A))return kf(i,s,b,0),Sn===null&&Cf(),!1}catch{}finally{}if(u=hg(i,s,b,p),u!==null)return Lr(u,i,p),O1(u,s,p),!0}return!1}function Xg(i,s,u,p){if(p={lane:2,revertLane:My(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Yf(i)){if(s)throw Error(r(479))}else s=hg(i,u,p,2),s!==null&&Lr(s,i,2)}function Yf(i){var s=i.alternate;return i===jt||s!==null&&s===jt}function M1(i,s){Cl=Bf=!0;var u=i.pending;u===null?s.next=s:(s.next=u.next,u.next=s),i.pending=s}function O1(i,s,u){if((u&4194048)!==0){var p=s.lanes;p&=i.pendingLanes,u|=p,s.lanes=u,X(i,u)}}var gu={readContext:dr,use:qf,useCallback:zn,useContext:zn,useEffect:zn,useImperativeHandle:zn,useLayoutEffect:zn,useInsertionEffect:zn,useMemo:zn,useReducer:zn,useRef:zn,useState:zn,useDebugValue:zn,useDeferredValue:zn,useTransition:zn,useSyncExternalStore:zn,useId:zn,useHostTransitionStatus:zn,useFormState:zn,useActionState:zn,useOptimistic:zn,useMemoCache:zn,useCacheRefresh:zn};gu.useEffectEvent=zn;var N1={readContext:dr,use:qf,useCallback:function(i,s){return Tr().memoizedState=[i,s===void 0?null:s],i},useContext:dr,useEffect:h1,useImperativeHandle:function(i,s,u){u=u!=null?u.concat([i]):null,$f(4194308,4,y1.bind(null,s,i),u)},useLayoutEffect:function(i,s){return $f(4194308,4,i,s)},useInsertionEffect:function(i,s){$f(4,2,i,s)},useMemo:function(i,s){var u=Tr();s=s===void 0?null:s;var p=i();if(ws){Ze(!0);try{i()}finally{Ze(!1)}}return u.memoizedState=[p,s],p},useReducer:function(i,s,u){var p=Tr();if(u!==void 0){var b=u(s);if(ws){Ze(!0);try{u(s)}finally{Ze(!1)}}}else b=s;return p.memoizedState=p.baseState=b,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:b},p.queue=i,i=i.dispatch=AI.bind(null,jt,i),[p.memoizedState,i]},useRef:function(i){var s=Tr();return i={current:i},s.memoizedState=i},useState:function(i){i=qg(i);var s=i.queue,u=k1.bind(null,jt,s);return s.dispatch=u,[i.memoizedState,u]},useDebugValue:Gg,useDeferredValue:function(i,s){var u=Tr();return Yg(u,i,s)},useTransition:function(){var i=qg(!1);return i=S1.bind(null,jt,i.queue,!0,!1),Tr().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,u){var p=jt,b=Tr();if(rn){if(u===void 0)throw Error(r(407));u=u()}else{if(u=s(),Sn===null)throw Error(r(349));(Zt&127)!==0||QS(p,s,u)}b.memoizedState=u;var S={value:u,getSnapshot:s};return b.queue=S,h1(JS.bind(null,p,S,i),[i]),p.flags|=2048,Ml(9,{destroy:void 0},ZS.bind(null,p,S,u,s),null),u},useId:function(){var i=Tr(),s=Sn.identifierPrefix;if(rn){var u=Wi,p=Ki;u=(p&~(1<<32-nt(p)-1)).toString(32)+u,s="_"+s+"R_"+u,u=Uf++,0<u&&(s+="H"+u.toString(32)),s+="_"}else u=TI++,s="_"+s+"r_"+u.toString(32)+"_";return i.memoizedState=s},useHostTransitionStatus:Wg,useFormState:l1,useActionState:l1,useOptimistic:function(i){var s=Tr();s.memoizedState=s.baseState=i;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=u,s=Xg.bind(null,jt,!0,u),u.dispatch=s,[i,s]},useMemoCache:Bg,useCacheRefresh:function(){return Tr().memoizedState=NI.bind(null,jt)},useEffectEvent:function(i){var s=Tr(),u={impl:i};return s.memoizedState=u,function(){if((pn&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},Qg={readContext:dr,use:qf,useCallback:v1,useContext:dr,useEffect:$g,useImperativeHandle:b1,useInsertionEffect:m1,useLayoutEffect:g1,useMemo:x1,useReducer:Vf,useRef:f1,useState:function(){return Vf(Ro)},useDebugValue:Gg,useDeferredValue:function(i,s){var u=$n();return w1(u,vn.memoizedState,i,s)},useTransition:function(){var i=Vf(Ro)[0],s=$n().memoizedState;return[typeof i=="boolean"?i:pu(i),s]},useSyncExternalStore:XS,useId:R1,useHostTransitionStatus:Wg,useFormState:c1,useActionState:c1,useOptimistic:function(i,s){var u=$n();return n1(u,vn,i,s)},useMemoCache:Bg,useCacheRefresh:C1};Qg.useEffectEvent=p1;var A1={readContext:dr,use:qf,useCallback:v1,useContext:dr,useEffect:$g,useImperativeHandle:b1,useInsertionEffect:m1,useLayoutEffect:g1,useMemo:x1,useReducer:Hg,useRef:f1,useState:function(){return Hg(Ro)},useDebugValue:Gg,useDeferredValue:function(i,s){var u=$n();return vn===null?Yg(u,i,s):w1(u,vn.memoizedState,i,s)},useTransition:function(){var i=Hg(Ro)[0],s=$n().memoizedState;return[typeof i=="boolean"?i:pu(i),s]},useSyncExternalStore:XS,useId:R1,useHostTransitionStatus:Wg,useFormState:d1,useActionState:d1,useOptimistic:function(i,s){var u=$n();return vn!==null?n1(u,vn,i,s):(u.baseState=i,[i,u.queue.dispatch])},useMemoCache:Bg,useCacheRefresh:C1};A1.useEffectEvent=p1;function Zg(i,s,u,p){s=i.memoizedState,u=u(p,s),u=u==null?s:h({},s,u),i.memoizedState=u,i.lanes===0&&(i.updateQueue.baseState=u)}var Jg={enqueueSetState:function(i,s,u){i=i._reactInternals;var p=Jr(),b=sa(p);b.payload=s,u!=null&&(b.callback=u),s=la(i,b,p),s!==null&&(Lr(s,i,p),uu(s,i,p))},enqueueReplaceState:function(i,s,u){i=i._reactInternals;var p=Jr(),b=sa(p);b.tag=1,b.payload=s,u!=null&&(b.callback=u),s=la(i,b,p),s!==null&&(Lr(s,i,p),uu(s,i,p))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var u=Jr(),p=sa(u);p.tag=2,s!=null&&(p.callback=s),s=la(i,p,u),s!==null&&(Lr(s,i,u),uu(s,i,u))}};function D1(i,s,u,p,b,S,A){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(p,S,A):s.prototype&&s.prototype.isPureReactComponent?!nu(u,p)||!nu(b,S):!0}function _1(i,s,u,p){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(u,p),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(u,p),s.state!==i&&Jg.enqueueReplaceState(s,s.state,null)}function Ss(i,s){var u=s;if("ref"in s){u={};for(var p in s)p!=="ref"&&(u[p]=s[p])}if(i=i.defaultProps){u===s&&(u=h({},u));for(var b in i)u[b]===void 0&&(u[b]=i[b])}return u}function I1(i){Rf(i)}function P1(i){console.error(i)}function L1(i){Rf(i)}function Kf(i,s){try{var u=i.onUncaughtError;u(s.value,{componentStack:s.stack})}catch(p){setTimeout(function(){throw p})}}function j1(i,s,u){try{var p=i.onCaughtError;p(u.value,{componentStack:u.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function ey(i,s,u){return u=sa(u),u.tag=3,u.payload={element:null},u.callback=function(){Kf(i,s)},u}function z1(i){return i=sa(i),i.tag=3,i}function F1(i,s,u,p){var b=u.type.getDerivedStateFromError;if(typeof b=="function"){var S=p.value;i.payload=function(){return b(S)},i.callback=function(){j1(s,u,p)}}var A=u.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(i.callback=function(){j1(s,u,p),typeof b!="function"&&(pa===null?pa=new Set([this]):pa.add(this));var Y=p.stack;this.componentDidCatch(p.value,{componentStack:Y!==null?Y:""})})}function DI(i,s,u,p,b){if(u.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(s=u.alternate,s!==null&&xl(s,u,b,!0),u=Wr.current,u!==null){switch(u.tag){case 31:case 13:return mi===null?ah():u.alternate===null&&Fn===0&&(Fn=3),u.flags&=-257,u.flags|=65536,u.lanes=b,p===Pf?u.flags|=16384:(s=u.updateQueue,s===null?u.updateQueue=new Set([p]):s.add(p),Ry(i,p,b)),!1;case 22:return u.flags|=65536,p===Pf?u.flags|=16384:(s=u.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([p])},u.updateQueue=s):(u=s.retryQueue,u===null?s.retryQueue=new Set([p]):u.add(p)),Ry(i,p,b)),!1}throw Error(r(435,u.tag))}return Ry(i,p,b),ah(),!1}if(rn)return s=Wr.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=b,p!==vg&&(i=Error(r(422),{cause:p}),ou(di(i,u)))):(p!==vg&&(s=Error(r(423),{cause:p}),ou(di(s,u))),i=i.current.alternate,i.flags|=65536,b&=-b,i.lanes|=b,p=di(p,u),b=ey(i.stateNode,p,b),Ng(i,b),Fn!==4&&(Fn=2)),!1;var S=Error(r(520),{cause:p});if(S=di(S,u),Tu===null?Tu=[S]:Tu.push(S),Fn!==4&&(Fn=2),s===null)return!0;p=di(p,u),u=s;do{switch(u.tag){case 3:return u.flags|=65536,i=b&-b,u.lanes|=i,i=ey(u.stateNode,p,i),Ng(u,i),!1;case 1:if(s=u.type,S=u.stateNode,(u.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(pa===null||!pa.has(S))))return u.flags|=65536,b&=-b,u.lanes|=b,b=z1(b),F1(b,i,u,p),Ng(u,b),!1}u=u.return}while(u!==null);return!1}var ty=Error(r(461)),Kn=!1;function fr(i,s,u,p){s.child=i===null?qS(s,null,u,p):xs(s,i.child,u,p)}function B1(i,s,u,p,b){u=u.render;var S=s.ref;if("ref"in p){var A={};for(var Y in p)Y!=="ref"&&(A[Y]=p[Y])}else A=p;return gs(s),p=Lg(i,s,u,A,S,b),Y=jg(),i!==null&&!Kn?(zg(i,s,b),Co(i,s,b)):(rn&&Y&&yg(s),s.flags|=1,fr(i,s,p,b),s.child)}function U1(i,s,u,p,b){if(i===null){var S=u.type;return typeof S=="function"&&!pg(S)&&S.defaultProps===void 0&&u.compare===null?(s.tag=15,s.type=S,H1(i,s,S,p,b)):(i=Of(u.type,null,p,s,s.mode,b),i.ref=s.ref,i.return=s,s.child=i)}if(S=i.child,!cy(i,b)){var A=S.memoizedProps;if(u=u.compare,u=u!==null?u:nu,u(A,p)&&i.ref===s.ref)return Co(i,s,b)}return s.flags|=1,i=xo(S,p),i.ref=s.ref,i.return=s,s.child=i}function H1(i,s,u,p,b){if(i!==null){var S=i.memoizedProps;if(nu(S,p)&&i.ref===s.ref)if(Kn=!1,s.pendingProps=p=S,cy(i,b))(i.flags&131072)!==0&&(Kn=!0);else return s.lanes=i.lanes,Co(i,s,b)}return ny(i,s,u,p,b)}function q1(i,s,u,p){var b=p.children,S=i!==null?i.memoizedState:null;if(i===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((s.flags&128)!==0){if(S=S!==null?S.baseLanes|u:u,i!==null){for(p=s.child=i.child,b=0;p!==null;)b=b|p.lanes|p.childLanes,p=p.sibling;p=b&~S}else p=0,s.child=null;return V1(i,s,S,u,p)}if((u&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&_f(s,S!==null?S.cachePool:null),S!==null?GS(s,S):Dg(),YS(s);else return p=s.lanes=536870912,V1(i,s,S!==null?S.baseLanes|u:u,u,p)}else S!==null?(_f(s,S.cachePool),GS(s,S),ua(),s.memoizedState=null):(i!==null&&_f(s,null),Dg(),ua());return fr(i,s,b,u),s.child}function yu(i,s){return i!==null&&i.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function V1(i,s,u,p,b){var S=Cg();return S=S===null?null:{parent:Gn._currentValue,pool:S},s.memoizedState={baseLanes:u,cachePool:S},i!==null&&_f(s,null),Dg(),YS(s),i!==null&&xl(i,s,p,!0),s.childLanes=b,null}function Wf(i,s){return s=Qf({mode:s.mode,children:s.children},i.mode),s.ref=i.ref,i.child=s,s.return=i,s}function $1(i,s,u){return xs(s,i.child,null,u),i=Wf(s,s.pendingProps),i.flags|=2,Xr(s),s.memoizedState=null,i}function _I(i,s,u){var p=s.pendingProps,b=(s.flags&128)!==0;if(s.flags&=-129,i===null){if(rn){if(p.mode==="hidden")return i=Wf(s,p),s.lanes=536870912,yu(null,i);if(Ig(s),(i=Cn)?(i=rT(i,pi),i=i!==null&&i.data==="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:na!==null?{id:Ki,overflow:Wi}:null,retryLane:536870912,hydrationErrors:null},u=MS(i),u.return=s,s.child=u,ur=s,Cn=null)):i=null,i===null)throw ia(s);return s.lanes=536870912,null}return Wf(s,p)}var S=i.memoizedState;if(S!==null){var A=S.dehydrated;if(Ig(s),b)if(s.flags&256)s.flags&=-257,s=$1(i,s,u);else if(s.memoizedState!==null)s.child=i.child,s.flags|=128,s=null;else throw Error(r(558));else if(Kn||xl(i,s,u,!1),b=(u&i.childLanes)!==0,Kn||b){if(p=Sn,p!==null&&(A=ie(p,u),A!==0&&A!==S.retryLane))throw S.retryLane=A,fs(i,A),Lr(p,i,A),ty;ah(),s=$1(i,s,u)}else i=S.treeContext,Cn=gi(A.nextSibling),ur=s,rn=!0,ra=null,pi=!1,i!==null&&AS(s,i),s=Wf(s,p),s.flags|=4096;return s}return i=xo(i.child,{mode:p.mode,children:p.children}),i.ref=s.ref,s.child=i,i.return=s,i}function Xf(i,s){var u=s.ref;if(u===null)i!==null&&i.ref!==null&&(s.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(i===null||i.ref!==u)&&(s.flags|=4194816)}}function ny(i,s,u,p,b){return gs(s),u=Lg(i,s,u,p,void 0,b),p=jg(),i!==null&&!Kn?(zg(i,s,b),Co(i,s,b)):(rn&&p&&yg(s),s.flags|=1,fr(i,s,u,b),s.child)}function G1(i,s,u,p,b,S){return gs(s),s.updateQueue=null,u=WS(s,p,u,b),KS(i),p=jg(),i!==null&&!Kn?(zg(i,s,S),Co(i,s,S)):(rn&&p&&yg(s),s.flags|=1,fr(i,s,u,S),s.child)}function Y1(i,s,u,p,b){if(gs(s),s.stateNode===null){var S=gl,A=u.contextType;typeof A=="object"&&A!==null&&(S=dr(A)),S=new u(p,S),s.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=Jg,s.stateNode=S,S._reactInternals=s,S=s.stateNode,S.props=p,S.state=s.memoizedState,S.refs={},Mg(s),A=u.contextType,S.context=typeof A=="object"&&A!==null?dr(A):gl,S.state=s.memoizedState,A=u.getDerivedStateFromProps,typeof A=="function"&&(Zg(s,u,A,p),S.state=s.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(A=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),A!==S.state&&Jg.enqueueReplaceState(S,S.state,null),fu(s,p,S,b),du(),S.state=s.memoizedState),typeof S.componentDidMount=="function"&&(s.flags|=4194308),p=!0}else if(i===null){S=s.stateNode;var Y=s.memoizedProps,ne=Ss(u,Y);S.props=ne;var ge=S.context,Me=u.contextType;A=gl,typeof Me=="object"&&Me!==null&&(A=dr(Me));var Ie=u.getDerivedStateFromProps;Me=typeof Ie=="function"||typeof S.getSnapshotBeforeUpdate=="function",Y=s.pendingProps!==Y,Me||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(Y||ge!==A)&&_1(s,S,p,A),aa=!1;var be=s.memoizedState;S.state=be,fu(s,p,S,b),du(),ge=s.memoizedState,Y||be!==ge||aa?(typeof Ie=="function"&&(Zg(s,u,Ie,p),ge=s.memoizedState),(ne=aa||D1(s,u,ne,p,be,ge,A))?(Me||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(s.flags|=4194308)):(typeof S.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=p,s.memoizedState=ge),S.props=p,S.state=ge,S.context=A,p=ne):(typeof S.componentDidMount=="function"&&(s.flags|=4194308),p=!1)}else{S=s.stateNode,Og(i,s),A=s.memoizedProps,Me=Ss(u,A),S.props=Me,Ie=s.pendingProps,be=S.context,ge=u.contextType,ne=gl,typeof ge=="object"&&ge!==null&&(ne=dr(ge)),Y=u.getDerivedStateFromProps,(ge=typeof Y=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(A!==Ie||be!==ne)&&_1(s,S,p,ne),aa=!1,be=s.memoizedState,S.state=be,fu(s,p,S,b),du();var we=s.memoizedState;A!==Ie||be!==we||aa||i!==null&&i.dependencies!==null&&Af(i.dependencies)?(typeof Y=="function"&&(Zg(s,u,Y,p),we=s.memoizedState),(Me=aa||D1(s,u,Me,p,be,we,ne)||i!==null&&i.dependencies!==null&&Af(i.dependencies))?(ge||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(p,we,ne),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(p,we,ne)),typeof S.componentDidUpdate=="function"&&(s.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof S.componentDidUpdate!="function"||A===i.memoizedProps&&be===i.memoizedState||(s.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||A===i.memoizedProps&&be===i.memoizedState||(s.flags|=1024),s.memoizedProps=p,s.memoizedState=we),S.props=p,S.state=we,S.context=ne,p=Me):(typeof S.componentDidUpdate!="function"||A===i.memoizedProps&&be===i.memoizedState||(s.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||A===i.memoizedProps&&be===i.memoizedState||(s.flags|=1024),p=!1)}return S=p,Xf(i,s),p=(s.flags&128)!==0,S||p?(S=s.stateNode,u=p&&typeof u.getDerivedStateFromError!="function"?null:S.render(),s.flags|=1,i!==null&&p?(s.child=xs(s,i.child,null,b),s.child=xs(s,null,u,b)):fr(i,s,u,b),s.memoizedState=S.state,i=s.child):i=Co(i,s,b),i}function K1(i,s,u,p){return ps(),s.flags|=256,fr(i,s,u,p),s.child}var ry={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function iy(i){return{baseLanes:i,cachePool:jS()}}function oy(i,s,u){return i=i!==null?i.childLanes&~u:0,s&&(i|=Zr),i}function W1(i,s,u){var p=s.pendingProps,b=!1,S=(s.flags&128)!==0,A;if((A=S)||(A=i!==null&&i.memoizedState===null?!1:(Vn.current&2)!==0),A&&(b=!0,s.flags&=-129),A=(s.flags&32)!==0,s.flags&=-33,i===null){if(rn){if(b?ca(s):ua(),(i=Cn)?(i=rT(i,pi),i=i!==null&&i.data!=="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:na!==null?{id:Ki,overflow:Wi}:null,retryLane:536870912,hydrationErrors:null},u=MS(i),u.return=s,s.child=u,ur=s,Cn=null)):i=null,i===null)throw ia(s);return Uy(i)?s.lanes=32:s.lanes=536870912,null}var Y=p.children;return p=p.fallback,b?(ua(),b=s.mode,Y=Qf({mode:"hidden",children:Y},b),p=hs(p,b,u,null),Y.return=s,p.return=s,Y.sibling=p,s.child=Y,p=s.child,p.memoizedState=iy(u),p.childLanes=oy(i,A,u),s.memoizedState=ry,yu(null,p)):(ca(s),ay(s,Y))}var ne=i.memoizedState;if(ne!==null&&(Y=ne.dehydrated,Y!==null)){if(S)s.flags&256?(ca(s),s.flags&=-257,s=sy(i,s,u)):s.memoizedState!==null?(ua(),s.child=i.child,s.flags|=128,s=null):(ua(),Y=p.fallback,b=s.mode,p=Qf({mode:"visible",children:p.children},b),Y=hs(Y,b,u,null),Y.flags|=2,p.return=s,Y.return=s,p.sibling=Y,s.child=p,xs(s,i.child,null,u),p=s.child,p.memoizedState=iy(u),p.childLanes=oy(i,A,u),s.memoizedState=ry,s=yu(null,p));else if(ca(s),Uy(Y)){if(A=Y.nextSibling&&Y.nextSibling.dataset,A)var ge=A.dgst;A=ge,p=Error(r(419)),p.stack="",p.digest=A,ou({value:p,source:null,stack:null}),s=sy(i,s,u)}else if(Kn||xl(i,s,u,!1),A=(u&i.childLanes)!==0,Kn||A){if(A=Sn,A!==null&&(p=ie(A,u),p!==0&&p!==ne.retryLane))throw ne.retryLane=p,fs(i,p),Lr(A,i,p),ty;By(Y)||ah(),s=sy(i,s,u)}else By(Y)?(s.flags|=192,s.child=i.child,s=null):(i=ne.treeContext,Cn=gi(Y.nextSibling),ur=s,rn=!0,ra=null,pi=!1,i!==null&&AS(s,i),s=ay(s,p.children),s.flags|=4096);return s}return b?(ua(),Y=p.fallback,b=s.mode,ne=i.child,ge=ne.sibling,p=xo(ne,{mode:"hidden",children:p.children}),p.subtreeFlags=ne.subtreeFlags&65011712,ge!==null?Y=xo(ge,Y):(Y=hs(Y,b,u,null),Y.flags|=2),Y.return=s,p.return=s,p.sibling=Y,s.child=p,yu(null,p),p=s.child,Y=i.child.memoizedState,Y===null?Y=iy(u):(b=Y.cachePool,b!==null?(ne=Gn._currentValue,b=b.parent!==ne?{parent:ne,pool:ne}:b):b=jS(),Y={baseLanes:Y.baseLanes|u,cachePool:b}),p.memoizedState=Y,p.childLanes=oy(i,A,u),s.memoizedState=ry,yu(i.child,p)):(ca(s),u=i.child,i=u.sibling,u=xo(u,{mode:"visible",children:p.children}),u.return=s,u.sibling=null,i!==null&&(A=s.deletions,A===null?(s.deletions=[i],s.flags|=16):A.push(i)),s.child=u,s.memoizedState=null,u)}function ay(i,s){return s=Qf({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function Qf(i,s){return i=Kr(22,i,null,s),i.lanes=0,i}function sy(i,s,u){return xs(s,i.child,null,u),i=ay(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function X1(i,s,u){i.lanes|=s;var p=i.alternate;p!==null&&(p.lanes|=s),Sg(i.return,s,u)}function ly(i,s,u,p,b,S){var A=i.memoizedState;A===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:p,tail:u,tailMode:b,treeForkCount:S}:(A.isBackwards=s,A.rendering=null,A.renderingStartTime=0,A.last=p,A.tail=u,A.tailMode=b,A.treeForkCount=S)}function Q1(i,s,u){var p=s.pendingProps,b=p.revealOrder,S=p.tail;p=p.children;var A=Vn.current,Y=(A&2)!==0;if(Y?(A=A&1|2,s.flags|=128):A&=1,I(Vn,A),fr(i,s,p,u),p=rn?iu:0,!Y&&i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&X1(i,u,s);else if(i.tag===19)X1(i,u,s);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(b){case"forwards":for(u=s.child,b=null;u!==null;)i=u.alternate,i!==null&&Ff(i)===null&&(b=u),u=u.sibling;u=b,u===null?(b=s.child,s.child=null):(b=u.sibling,u.sibling=null),ly(s,!1,b,u,S,p);break;case"backwards":case"unstable_legacy-backwards":for(u=null,b=s.child,s.child=null;b!==null;){if(i=b.alternate,i!==null&&Ff(i)===null){s.child=b;break}i=b.sibling,b.sibling=u,u=b,b=i}ly(s,!0,u,null,S,p);break;case"together":ly(s,!1,null,null,void 0,p);break;default:s.memoizedState=null}return s.child}function Co(i,s,u){if(i!==null&&(s.dependencies=i.dependencies),ha|=s.lanes,(u&s.childLanes)===0)if(i!==null){if(xl(i,s,u,!1),(u&s.childLanes)===0)return null}else return null;if(i!==null&&s.child!==i.child)throw Error(r(153));if(s.child!==null){for(i=s.child,u=xo(i,i.pendingProps),s.child=u,u.return=s;i.sibling!==null;)i=i.sibling,u=u.sibling=xo(i,i.pendingProps),u.return=s;u.sibling=null}return s.child}function cy(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&Af(i)))}function II(i,s,u){switch(s.tag){case 3:ue(s,s.stateNode.containerInfo),oa(s,Gn,i.memoizedState.cache),ps();break;case 27:case 5:Se(s);break;case 4:ue(s,s.stateNode.containerInfo);break;case 10:oa(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,Ig(s),null;break;case 13:var p=s.memoizedState;if(p!==null)return p.dehydrated!==null?(ca(s),s.flags|=128,null):(u&s.child.childLanes)!==0?W1(i,s,u):(ca(s),i=Co(i,s,u),i!==null?i.sibling:null);ca(s);break;case 19:var b=(i.flags&128)!==0;if(p=(u&s.childLanes)!==0,p||(xl(i,s,u,!1),p=(u&s.childLanes)!==0),b){if(p)return Q1(i,s,u);s.flags|=128}if(b=s.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),I(Vn,Vn.current),p)break;return null;case 22:return s.lanes=0,q1(i,s,u,s.pendingProps);case 24:oa(s,Gn,i.memoizedState.cache)}return Co(i,s,u)}function Z1(i,s,u){if(i!==null)if(i.memoizedProps!==s.pendingProps)Kn=!0;else{if(!cy(i,u)&&(s.flags&128)===0)return Kn=!1,II(i,s,u);Kn=(i.flags&131072)!==0}else Kn=!1,rn&&(s.flags&1048576)!==0&&NS(s,iu,s.index);switch(s.lanes=0,s.tag){case 16:e:{var p=s.pendingProps;if(i=bs(s.elementType),s.type=i,typeof i=="function")pg(i)?(p=Ss(i,p),s.tag=1,s=Y1(null,s,i,p,u)):(s.tag=0,s=ny(null,s,i,p,u));else{if(i!=null){var b=i.$$typeof;if(b===M){s.tag=11,s=B1(null,s,i,p,u);break e}else if(b===N){s.tag=14,s=U1(null,s,i,p,u);break e}}throw s=H(i)||i,Error(r(306,s,""))}}return s;case 0:return ny(i,s,s.type,s.pendingProps,u);case 1:return p=s.type,b=Ss(p,s.pendingProps),Y1(i,s,p,b,u);case 3:e:{if(ue(s,s.stateNode.containerInfo),i===null)throw Error(r(387));p=s.pendingProps;var S=s.memoizedState;b=S.element,Og(i,s),fu(s,p,null,u);var A=s.memoizedState;if(p=A.cache,oa(s,Gn,p),p!==S.cache&&Eg(s,[Gn],u,!0),du(),p=A.element,S.isDehydrated)if(S={element:p,isDehydrated:!1,cache:A.cache},s.updateQueue.baseState=S,s.memoizedState=S,s.flags&256){s=K1(i,s,p,u);break e}else if(p!==b){b=di(Error(r(424)),s),ou(b),s=K1(i,s,p,u);break e}else{switch(i=s.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(Cn=gi(i.firstChild),ur=s,rn=!0,ra=null,pi=!0,u=qS(s,null,p,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(ps(),p===b){s=Co(i,s,u);break e}fr(i,s,p,u)}s=s.child}return s;case 26:return Xf(i,s),i===null?(u=cT(s.type,null,s.pendingProps,null))?s.memoizedState=u:rn||(u=s.type,i=s.pendingProps,p=hh(oe.current).createElement(u),p[Ye]=s,p[Xe]=i,hr(p,u,i),Nn(p),s.stateNode=p):s.memoizedState=cT(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return Se(s),i===null&&rn&&(p=s.stateNode=aT(s.type,s.pendingProps,oe.current),ur=s,pi=!0,b=Cn,ba(s.type)?(Hy=b,Cn=gi(p.firstChild)):Cn=b),fr(i,s,s.pendingProps.children,u),Xf(i,s),i===null&&(s.flags|=4194304),s.child;case 5:return i===null&&rn&&((b=p=Cn)&&(p=uP(p,s.type,s.pendingProps,pi),p!==null?(s.stateNode=p,ur=s,Cn=gi(p.firstChild),pi=!1,b=!0):b=!1),b||ia(s)),Se(s),b=s.type,S=s.pendingProps,A=i!==null?i.memoizedProps:null,p=S.children,jy(b,S)?p=null:A!==null&&jy(b,A)&&(s.flags|=32),s.memoizedState!==null&&(b=Lg(i,s,RI,null,null,u),Du._currentValue=b),Xf(i,s),fr(i,s,p,u),s.child;case 6:return i===null&&rn&&((i=u=Cn)&&(u=dP(u,s.pendingProps,pi),u!==null?(s.stateNode=u,ur=s,Cn=null,i=!0):i=!1),i||ia(s)),null;case 13:return W1(i,s,u);case 4:return ue(s,s.stateNode.containerInfo),p=s.pendingProps,i===null?s.child=xs(s,null,p,u):fr(i,s,p,u),s.child;case 11:return B1(i,s,s.type,s.pendingProps,u);case 7:return fr(i,s,s.pendingProps,u),s.child;case 8:return fr(i,s,s.pendingProps.children,u),s.child;case 12:return fr(i,s,s.pendingProps.children,u),s.child;case 10:return p=s.pendingProps,oa(s,s.type,p.value),fr(i,s,p.children,u),s.child;case 9:return b=s.type._context,p=s.pendingProps.children,gs(s),b=dr(b),p=p(b),s.flags|=1,fr(i,s,p,u),s.child;case 14:return U1(i,s,s.type,s.pendingProps,u);case 15:return H1(i,s,s.type,s.pendingProps,u);case 19:return Q1(i,s,u);case 31:return _I(i,s,u);case 22:return q1(i,s,u,s.pendingProps);case 24:return gs(s),p=dr(Gn),i===null?(b=Cg(),b===null&&(b=Sn,S=Tg(),b.pooledCache=S,S.refCount++,S!==null&&(b.pooledCacheLanes|=u),b=S),s.memoizedState={parent:p,cache:b},Mg(s),oa(s,Gn,b)):((i.lanes&u)!==0&&(Og(i,s),fu(s,null,null,u),du()),b=i.memoizedState,S=s.memoizedState,b.parent!==p?(b={parent:p,cache:p},s.memoizedState=b,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=b),oa(s,Gn,p)):(p=S.cache,oa(s,Gn,p),p!==b.cache&&Eg(s,[Gn],u,!0))),fr(i,s,s.pendingProps.children,u),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function ko(i){i.flags|=4}function uy(i,s,u,p,b){if((s=(i.mode&32)!==0)&&(s=!1),s){if(i.flags|=16777216,(b&335544128)===b)if(i.stateNode.complete)i.flags|=8192;else if(RE())i.flags|=8192;else throw vs=Pf,kg}else i.flags&=-16777217}function J1(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!pT(s))if(RE())i.flags|=8192;else throw vs=Pf,kg}function Zf(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?kt():536870912,i.lanes|=s,Dl|=s)}function bu(i,s){if(!rn)switch(i.tailMode){case"hidden":s=i.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?i.tail=null:u.sibling=null;break;case"collapsed":u=i.tail;for(var p=null;u!==null;)u.alternate!==null&&(p=u),u=u.sibling;p===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:p.sibling=null}}function kn(i){var s=i.alternate!==null&&i.alternate.child===i.child,u=0,p=0;if(s)for(var b=i.child;b!==null;)u|=b.lanes|b.childLanes,p|=b.subtreeFlags&65011712,p|=b.flags&65011712,b.return=i,b=b.sibling;else for(b=i.child;b!==null;)u|=b.lanes|b.childLanes,p|=b.subtreeFlags,p|=b.flags,b.return=i,b=b.sibling;return i.subtreeFlags|=p,i.childLanes=u,s}function PI(i,s,u){var p=s.pendingProps;switch(bg(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kn(s),null;case 1:return kn(s),null;case 3:return u=s.stateNode,p=null,i!==null&&(p=i.memoizedState.cache),s.memoizedState.cache!==p&&(s.flags|=2048),Eo(Gn),ve(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(i===null||i.child===null)&&(vl(s)?ko(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,xg())),kn(s),null;case 26:var b=s.type,S=s.memoizedState;return i===null?(ko(s),S!==null?(kn(s),J1(s,S)):(kn(s),uy(s,b,null,p,u))):S?S!==i.memoizedState?(ko(s),kn(s),J1(s,S)):(kn(s),s.flags&=-16777217):(i=i.memoizedProps,i!==p&&ko(s),kn(s),uy(s,b,i,p,u)),null;case 27:if(Pe(s),u=oe.current,b=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==p&&ko(s);else{if(!p){if(s.stateNode===null)throw Error(r(166));return kn(s),null}i=Q.current,vl(s)?DS(s):(i=aT(b,p,u),s.stateNode=i,ko(s))}return kn(s),null;case 5:if(Pe(s),b=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==p&&ko(s);else{if(!p){if(s.stateNode===null)throw Error(r(166));return kn(s),null}if(S=Q.current,vl(s))DS(s);else{var A=hh(oe.current);switch(S){case 1:S=A.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:S=A.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":S=A.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":S=A.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":S=A.createElement("div"),S.innerHTML="<script><\/script>",S=S.removeChild(S.firstChild);break;case"select":S=typeof p.is=="string"?A.createElement("select",{is:p.is}):A.createElement("select"),p.multiple?S.multiple=!0:p.size&&(S.size=p.size);break;default:S=typeof p.is=="string"?A.createElement(b,{is:p.is}):A.createElement(b)}}S[Ye]=s,S[Xe]=p;e:for(A=s.child;A!==null;){if(A.tag===5||A.tag===6)S.appendChild(A.stateNode);else if(A.tag!==4&&A.tag!==27&&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;A=A.return}A.sibling.return=A.return,A=A.sibling}s.stateNode=S;e:switch(hr(S,b,p),b){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&ko(s)}}return kn(s),uy(s,s.type,i===null?null:i.memoizedProps,s.pendingProps,u),null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==p&&ko(s);else{if(typeof p!="string"&&s.stateNode===null)throw Error(r(166));if(i=oe.current,vl(s)){if(i=s.stateNode,u=s.memoizedProps,p=null,b=ur,b!==null)switch(b.tag){case 27:case 5:p=b.memoizedProps}i[Ye]=s,i=!!(i.nodeValue===u||p!==null&&p.suppressHydrationWarning===!0||WE(i.nodeValue,u)),i||ia(s,!0)}else i=hh(i).createTextNode(p),i[Ye]=s,s.stateNode=i}return kn(s),null;case 31:if(u=s.memoizedState,i===null||i.memoizedState!==null){if(p=vl(s),u!==null){if(i===null){if(!p)throw Error(r(318));if(i=s.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[Ye]=s}else ps(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;kn(s),i=!1}else u=xg(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=u),i=!0;if(!i)return s.flags&256?(Xr(s),s):(Xr(s),null);if((s.flags&128)!==0)throw Error(r(558))}return kn(s),null;case 13:if(p=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(b=vl(s),p!==null&&p.dehydrated!==null){if(i===null){if(!b)throw Error(r(318));if(b=s.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[Ye]=s}else ps(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;kn(s),b=!1}else b=xg(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=b),b=!0;if(!b)return s.flags&256?(Xr(s),s):(Xr(s),null)}return Xr(s),(s.flags&128)!==0?(s.lanes=u,s):(u=p!==null,i=i!==null&&i.memoizedState!==null,u&&(p=s.child,b=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(b=p.alternate.memoizedState.cachePool.pool),S=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(S=p.memoizedState.cachePool.pool),S!==b&&(p.flags|=2048)),u!==i&&u&&(s.child.flags|=8192),Zf(s,s.updateQueue),kn(s),null);case 4:return ve(),i===null&&Dy(s.stateNode.containerInfo),kn(s),null;case 10:return Eo(s.type),kn(s),null;case 19:if(W(Vn),p=s.memoizedState,p===null)return kn(s),null;if(b=(s.flags&128)!==0,S=p.rendering,S===null)if(b)bu(p,!1);else{if(Fn!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(S=Ff(i),S!==null){for(s.flags|=128,bu(p,!1),i=S.updateQueue,s.updateQueue=i,Zf(s,i),s.subtreeFlags=0,i=u,u=s.child;u!==null;)kS(u,i),u=u.sibling;return I(Vn,Vn.current&1|2),rn&&wo(s,p.treeForkCount),s.child}i=i.sibling}p.tail!==null&&_e()>rh&&(s.flags|=128,b=!0,bu(p,!1),s.lanes=4194304)}else{if(!b)if(i=Ff(S),i!==null){if(s.flags|=128,b=!0,i=i.updateQueue,s.updateQueue=i,Zf(s,i),bu(p,!0),p.tail===null&&p.tailMode==="hidden"&&!S.alternate&&!rn)return kn(s),null}else 2*_e()-p.renderingStartTime>rh&&u!==536870912&&(s.flags|=128,b=!0,bu(p,!1),s.lanes=4194304);p.isBackwards?(S.sibling=s.child,s.child=S):(i=p.last,i!==null?i.sibling=S:s.child=S,p.last=S)}return p.tail!==null?(i=p.tail,p.rendering=i,p.tail=i.sibling,p.renderingStartTime=_e(),i.sibling=null,u=Vn.current,I(Vn,b?u&1|2:u&1),rn&&wo(s,p.treeForkCount),i):(kn(s),null);case 22:case 23:return Xr(s),_g(),p=s.memoizedState!==null,i!==null?i.memoizedState!==null!==p&&(s.flags|=8192):p&&(s.flags|=8192),p?(u&536870912)!==0&&(s.flags&128)===0&&(kn(s),s.subtreeFlags&6&&(s.flags|=8192)):kn(s),u=s.updateQueue,u!==null&&Zf(s,u.retryQueue),u=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),p=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),p!==u&&(s.flags|=2048),i!==null&&W(ys),null;case 24:return u=null,i!==null&&(u=i.memoizedState.cache),s.memoizedState.cache!==u&&(s.flags|=2048),Eo(Gn),kn(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function LI(i,s){switch(bg(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return Eo(Gn),ve(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return Pe(s),null;case 31:if(s.memoizedState!==null){if(Xr(s),s.alternate===null)throw Error(r(340));ps()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 13:if(Xr(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));ps()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return W(Vn),null;case 4:return ve(),null;case 10:return Eo(s.type),null;case 22:case 23:return Xr(s),_g(),i!==null&&W(ys),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return Eo(Gn),null;case 25:return null;default:return null}}function eE(i,s){switch(bg(s),s.tag){case 3:Eo(Gn),ve();break;case 26:case 27:case 5:Pe(s);break;case 4:ve();break;case 31:s.memoizedState!==null&&Xr(s);break;case 13:Xr(s);break;case 19:W(Vn);break;case 10:Eo(s.type);break;case 22:case 23:Xr(s),_g(),i!==null&&W(ys);break;case 24:Eo(Gn)}}function vu(i,s){try{var u=s.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var b=p.next;u=b;do{if((u.tag&i)===i){p=void 0;var S=u.create,A=u.inst;p=S(),A.destroy=p}u=u.next}while(u!==b)}}catch(Y){bn(s,s.return,Y)}}function da(i,s,u){try{var p=s.updateQueue,b=p!==null?p.lastEffect:null;if(b!==null){var S=b.next;p=S;do{if((p.tag&i)===i){var A=p.inst,Y=A.destroy;if(Y!==void 0){A.destroy=void 0,b=s;var ne=u,ge=Y;try{ge()}catch(Me){bn(b,ne,Me)}}}p=p.next}while(p!==S)}}catch(Me){bn(s,s.return,Me)}}function tE(i){var s=i.updateQueue;if(s!==null){var u=i.stateNode;try{$S(s,u)}catch(p){bn(i,i.return,p)}}}function nE(i,s,u){u.props=Ss(i.type,i.memoizedProps),u.state=i.memoizedState;try{u.componentWillUnmount()}catch(p){bn(i,s,p)}}function xu(i,s){try{var u=i.ref;if(u!==null){switch(i.tag){case 26:case 27:case 5:var p=i.stateNode;break;case 30:p=i.stateNode;break;default:p=i.stateNode}typeof u=="function"?i.refCleanup=u(p):u.current=p}}catch(b){bn(i,s,b)}}function Xi(i,s){var u=i.ref,p=i.refCleanup;if(u!==null)if(typeof p=="function")try{p()}catch(b){bn(i,s,b)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(b){bn(i,s,b)}else u.current=null}function rE(i){var s=i.type,u=i.memoizedProps,p=i.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":u.autoFocus&&p.focus();break e;case"img":u.src?p.src=u.src:u.srcSet&&(p.srcset=u.srcSet)}}catch(b){bn(i,i.return,b)}}function dy(i,s,u){try{var p=i.stateNode;iP(p,i.type,u,s),p[Xe]=s}catch(b){bn(i,i.return,b)}}function iE(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&ba(i.type)||i.tag===4}function fy(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||iE(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&ba(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function hy(i,s,u){var p=i.tag;if(p===5||p===6)i=i.stateNode,s?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(i,s):(s=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,s.appendChild(i),u=u._reactRootContainer,u!=null||s.onclick!==null||(s.onclick=bo));else if(p!==4&&(p===27&&ba(i.type)&&(u=i.stateNode,s=null),i=i.child,i!==null))for(hy(i,s,u),i=i.sibling;i!==null;)hy(i,s,u),i=i.sibling}function Jf(i,s,u){var p=i.tag;if(p===5||p===6)i=i.stateNode,s?u.insertBefore(i,s):u.appendChild(i);else if(p!==4&&(p===27&&ba(i.type)&&(u=i.stateNode),i=i.child,i!==null))for(Jf(i,s,u),i=i.sibling;i!==null;)Jf(i,s,u),i=i.sibling}function oE(i){var s=i.stateNode,u=i.memoizedProps;try{for(var p=i.type,b=s.attributes;b.length;)s.removeAttributeNode(b[0]);hr(s,p,u),s[Ye]=i,s[Xe]=u}catch(S){bn(i,i.return,S)}}var Mo=!1,Wn=!1,py=!1,aE=typeof WeakSet=="function"?WeakSet:Set,or=null;function jI(i,s){if(i=i.containerInfo,Py=xh,i=bS(i),sg(i)){if("selectionStart"in i)var u={start:i.selectionStart,end:i.selectionEnd};else e:{u=(u=i.ownerDocument)&&u.defaultView||window;var p=u.getSelection&&u.getSelection();if(p&&p.rangeCount!==0){u=p.anchorNode;var b=p.anchorOffset,S=p.focusNode;p=p.focusOffset;try{u.nodeType,S.nodeType}catch{u=null;break e}var A=0,Y=-1,ne=-1,ge=0,Me=0,Ie=i,be=null;t:for(;;){for(var we;Ie!==u||b!==0&&Ie.nodeType!==3||(Y=A+b),Ie!==S||p!==0&&Ie.nodeType!==3||(ne=A+p),Ie.nodeType===3&&(A+=Ie.nodeValue.length),(we=Ie.firstChild)!==null;)be=Ie,Ie=we;for(;;){if(Ie===i)break t;if(be===u&&++ge===b&&(Y=A),be===S&&++Me===p&&(ne=A),(we=Ie.nextSibling)!==null)break;Ie=be,be=Ie.parentNode}Ie=we}u=Y===-1||ne===-1?null:{start:Y,end:ne}}else u=null}u=u||{start:0,end:0}}else u=null;for(Ly={focusedElem:i,selectionRange:u},xh=!1,or=s;or!==null;)if(s=or,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,or=i;else for(;or!==null;){switch(s=or,S=s.alternate,i=s.flags,s.tag){case 0:if((i&4)!==0&&(i=s.updateQueue,i=i!==null?i.events:null,i!==null))for(u=0;u<i.length;u++)b=i[u],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&S!==null){i=void 0,u=s,b=S.memoizedProps,S=S.memoizedState,p=u.stateNode;try{var st=Ss(u.type,b);i=p.getSnapshotBeforeUpdate(st,S),p.__reactInternalSnapshotBeforeUpdate=i}catch(wt){bn(u,u.return,wt)}}break;case 3:if((i&1024)!==0){if(i=s.stateNode.containerInfo,u=i.nodeType,u===9)Fy(i);else if(u===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Fy(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=s.sibling,i!==null){i.return=s.return,or=i;break}or=s.return}}function sE(i,s,u){var p=u.flags;switch(u.tag){case 0:case 11:case 15:No(i,u),p&4&&vu(5,u);break;case 1:if(No(i,u),p&4)if(i=u.stateNode,s===null)try{i.componentDidMount()}catch(A){bn(u,u.return,A)}else{var b=Ss(u.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(b,s,i.__reactInternalSnapshotBeforeUpdate)}catch(A){bn(u,u.return,A)}}p&64&&tE(u),p&512&&xu(u,u.return);break;case 3:if(No(i,u),p&64&&(i=u.updateQueue,i!==null)){if(s=null,u.child!==null)switch(u.child.tag){case 27:case 5:s=u.child.stateNode;break;case 1:s=u.child.stateNode}try{$S(i,s)}catch(A){bn(u,u.return,A)}}break;case 27:s===null&&p&4&&oE(u);case 26:case 5:No(i,u),s===null&&p&4&&rE(u),p&512&&xu(u,u.return);break;case 12:No(i,u);break;case 31:No(i,u),p&4&&uE(i,u);break;case 13:No(i,u),p&4&&dE(i,u),p&64&&(i=u.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(u=GI.bind(null,u),fP(i,u))));break;case 22:if(p=u.memoizedState!==null||Mo,!p){s=s!==null&&s.memoizedState!==null||Wn,b=Mo;var S=Wn;Mo=p,(Wn=s)&&!S?Ao(i,u,(u.subtreeFlags&8772)!==0):No(i,u),Mo=b,Wn=S}break;case 30:break;default:No(i,u)}}function lE(i){var s=i.alternate;s!==null&&(i.alternate=null,lE(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&Ln(s)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var An=null,Dr=!1;function Oo(i,s,u){for(u=u.child;u!==null;)cE(i,s,u),u=u.sibling}function cE(i,s,u){if(ze&&typeof ze.onCommitFiberUnmount=="function")try{ze.onCommitFiberUnmount(et,u)}catch{}switch(u.tag){case 26:Wn||Xi(u,s),Oo(i,s,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Wn||Xi(u,s);var p=An,b=Dr;ba(u.type)&&(An=u.stateNode,Dr=!1),Oo(i,s,u),Ou(u.stateNode),An=p,Dr=b;break;case 5:Wn||Xi(u,s);case 6:if(p=An,b=Dr,An=null,Oo(i,s,u),An=p,Dr=b,An!==null)if(Dr)try{(An.nodeType===9?An.body:An.nodeName==="HTML"?An.ownerDocument.body:An).removeChild(u.stateNode)}catch(S){bn(u,s,S)}else try{An.removeChild(u.stateNode)}catch(S){bn(u,s,S)}break;case 18:An!==null&&(Dr?(i=An,tT(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,u.stateNode),Bl(i)):tT(An,u.stateNode));break;case 4:p=An,b=Dr,An=u.stateNode.containerInfo,Dr=!0,Oo(i,s,u),An=p,Dr=b;break;case 0:case 11:case 14:case 15:da(2,u,s),Wn||da(4,u,s),Oo(i,s,u);break;case 1:Wn||(Xi(u,s),p=u.stateNode,typeof p.componentWillUnmount=="function"&&nE(u,s,p)),Oo(i,s,u);break;case 21:Oo(i,s,u);break;case 22:Wn=(p=Wn)||u.memoizedState!==null,Oo(i,s,u),Wn=p;break;default:Oo(i,s,u)}}function uE(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{Bl(i)}catch(u){bn(s,s.return,u)}}}function dE(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Bl(i)}catch(u){bn(s,s.return,u)}}function zI(i){switch(i.tag){case 31:case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new aE),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new aE),s;default:throw Error(r(435,i.tag))}}function eh(i,s){var u=zI(i);s.forEach(function(p){if(!u.has(p)){u.add(p);var b=YI.bind(null,i,p);p.then(b,b)}})}function _r(i,s){var u=s.deletions;if(u!==null)for(var p=0;p<u.length;p++){var b=u[p],S=i,A=s,Y=A;e:for(;Y!==null;){switch(Y.tag){case 27:if(ba(Y.type)){An=Y.stateNode,Dr=!1;break e}break;case 5:An=Y.stateNode,Dr=!1;break e;case 3:case 4:An=Y.stateNode.containerInfo,Dr=!0;break e}Y=Y.return}if(An===null)throw Error(r(160));cE(S,A,b),An=null,Dr=!1,S=b.alternate,S!==null&&(S.return=null),b.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)fE(s,i),s=s.sibling}var Ii=null;function fE(i,s){var u=i.alternate,p=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:_r(s,i),Ir(i),p&4&&(da(3,i,i.return),vu(3,i),da(5,i,i.return));break;case 1:_r(s,i),Ir(i),p&512&&(Wn||u===null||Xi(u,u.return)),p&64&&Mo&&(i=i.updateQueue,i!==null&&(p=i.callbacks,p!==null&&(u=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=u===null?p:u.concat(p))));break;case 26:var b=Ii;if(_r(s,i),Ir(i),p&512&&(Wn||u===null||Xi(u,u.return)),p&4){var S=u!==null?u.memoizedState:null;if(p=i.memoizedState,u===null)if(p===null)if(i.stateNode===null){e:{p=i.type,u=i.memoizedProps,b=b.ownerDocument||b;t:switch(p){case"title":S=b.getElementsByTagName("title")[0],(!S||S[_n]||S[Ye]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=b.createElement(p),b.head.insertBefore(S,b.querySelector("head > title"))),hr(S,p,u),S[Ye]=i,Nn(S),p=S;break e;case"link":var A=fT("link","href",b).get(p+(u.href||""));if(A){for(var Y=0;Y<A.length;Y++)if(S=A[Y],S.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&S.getAttribute("rel")===(u.rel==null?null:u.rel)&&S.getAttribute("title")===(u.title==null?null:u.title)&&S.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){A.splice(Y,1);break t}}S=b.createElement(p),hr(S,p,u),b.head.appendChild(S);break;case"meta":if(A=fT("meta","content",b).get(p+(u.content||""))){for(Y=0;Y<A.length;Y++)if(S=A[Y],S.getAttribute("content")===(u.content==null?null:""+u.content)&&S.getAttribute("name")===(u.name==null?null:u.name)&&S.getAttribute("property")===(u.property==null?null:u.property)&&S.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&S.getAttribute("charset")===(u.charSet==null?null:u.charSet)){A.splice(Y,1);break t}}S=b.createElement(p),hr(S,p,u),b.head.appendChild(S);break;default:throw Error(r(468,p))}S[Ye]=i,Nn(S),p=S}i.stateNode=p}else hT(b,i.type,i.stateNode);else i.stateNode=dT(b,p,i.memoizedProps);else S!==p?(S===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):S.count--,p===null?hT(b,i.type,i.stateNode):dT(b,p,i.memoizedProps)):p===null&&i.stateNode!==null&&dy(i,i.memoizedProps,u.memoizedProps)}break;case 27:_r(s,i),Ir(i),p&512&&(Wn||u===null||Xi(u,u.return)),u!==null&&p&4&&dy(i,i.memoizedProps,u.memoizedProps);break;case 5:if(_r(s,i),Ir(i),p&512&&(Wn||u===null||Xi(u,u.return)),i.flags&32){b=i.stateNode;try{cl(b,"")}catch(st){bn(i,i.return,st)}}p&4&&i.stateNode!=null&&(b=i.memoizedProps,dy(i,b,u!==null?u.memoizedProps:b)),p&1024&&(py=!0);break;case 6:if(_r(s,i),Ir(i),p&4){if(i.stateNode===null)throw Error(r(162));p=i.memoizedProps,u=i.stateNode;try{u.nodeValue=p}catch(st){bn(i,i.return,st)}}break;case 3:if(gh=null,b=Ii,Ii=ph(s.containerInfo),_r(s,i),Ii=b,Ir(i),p&4&&u!==null&&u.memoizedState.isDehydrated)try{Bl(s.containerInfo)}catch(st){bn(i,i.return,st)}py&&(py=!1,hE(i));break;case 4:p=Ii,Ii=ph(i.stateNode.containerInfo),_r(s,i),Ir(i),Ii=p;break;case 12:_r(s,i),Ir(i);break;case 31:_r(s,i),Ir(i),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,eh(i,p)));break;case 13:_r(s,i),Ir(i),i.child.flags&8192&&i.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(nh=_e()),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,eh(i,p)));break;case 22:b=i.memoizedState!==null;var ne=u!==null&&u.memoizedState!==null,ge=Mo,Me=Wn;if(Mo=ge||b,Wn=Me||ne,_r(s,i),Wn=Me,Mo=ge,Ir(i),p&8192)e:for(s=i.stateNode,s._visibility=b?s._visibility&-2:s._visibility|1,b&&(u===null||ne||Mo||Wn||Es(i)),u=null,s=i;;){if(s.tag===5||s.tag===26){if(u===null){ne=u=s;try{if(S=ne.stateNode,b)A=S.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none";else{Y=ne.stateNode;var Ie=ne.memoizedProps.style,be=Ie!=null&&Ie.hasOwnProperty("display")?Ie.display:null;Y.style.display=be==null||typeof be=="boolean"?"":(""+be).trim()}}catch(st){bn(ne,ne.return,st)}}}else if(s.tag===6){if(u===null){ne=s;try{ne.stateNode.nodeValue=b?"":ne.memoizedProps}catch(st){bn(ne,ne.return,st)}}}else if(s.tag===18){if(u===null){ne=s;try{var we=ne.stateNode;b?nT(we,!0):nT(ne.stateNode,!1)}catch(st){bn(ne,ne.return,st)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===i)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;u===s&&(u=null),s=s.return}u===s&&(u=null),s.sibling.return=s.return,s=s.sibling}p&4&&(p=i.updateQueue,p!==null&&(u=p.retryQueue,u!==null&&(p.retryQueue=null,eh(i,u))));break;case 19:_r(s,i),Ir(i),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,eh(i,p)));break;case 30:break;case 21:break;default:_r(s,i),Ir(i)}}function Ir(i){var s=i.flags;if(s&2){try{for(var u,p=i.return;p!==null;){if(iE(p)){u=p;break}p=p.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var b=u.stateNode,S=fy(i);Jf(i,S,b);break;case 5:var A=u.stateNode;u.flags&32&&(cl(A,""),u.flags&=-33);var Y=fy(i);Jf(i,Y,A);break;case 3:case 4:var ne=u.stateNode.containerInfo,ge=fy(i);hy(i,ge,ne);break;default:throw Error(r(161))}}catch(Me){bn(i,i.return,Me)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function hE(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;hE(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),i=i.sibling}}function No(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)sE(i,s.alternate,s),s=s.sibling}function Es(i){for(i=i.child;i!==null;){var s=i;switch(s.tag){case 0:case 11:case 14:case 15:da(4,s,s.return),Es(s);break;case 1:Xi(s,s.return);var u=s.stateNode;typeof u.componentWillUnmount=="function"&&nE(s,s.return,u),Es(s);break;case 27:Ou(s.stateNode);case 26:case 5:Xi(s,s.return),Es(s);break;case 22:s.memoizedState===null&&Es(s);break;case 30:Es(s);break;default:Es(s)}i=i.sibling}}function Ao(i,s,u){for(u=u&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var p=s.alternate,b=i,S=s,A=S.flags;switch(S.tag){case 0:case 11:case 15:Ao(b,S,u),vu(4,S);break;case 1:if(Ao(b,S,u),p=S,b=p.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(ge){bn(p,p.return,ge)}if(p=S,b=p.updateQueue,b!==null){var Y=p.stateNode;try{var ne=b.shared.hiddenCallbacks;if(ne!==null)for(b.shared.hiddenCallbacks=null,b=0;b<ne.length;b++)VS(ne[b],Y)}catch(ge){bn(p,p.return,ge)}}u&&A&64&&tE(S),xu(S,S.return);break;case 27:oE(S);case 26:case 5:Ao(b,S,u),u&&p===null&&A&4&&rE(S),xu(S,S.return);break;case 12:Ao(b,S,u);break;case 31:Ao(b,S,u),u&&A&4&&uE(b,S);break;case 13:Ao(b,S,u),u&&A&4&&dE(b,S);break;case 22:S.memoizedState===null&&Ao(b,S,u),xu(S,S.return);break;case 30:break;default:Ao(b,S,u)}s=s.sibling}}function my(i,s){var u=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==u&&(i!=null&&i.refCount++,u!=null&&au(u))}function gy(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&au(i))}function Pi(i,s,u,p){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)pE(i,s,u,p),s=s.sibling}function pE(i,s,u,p){var b=s.flags;switch(s.tag){case 0:case 11:case 15:Pi(i,s,u,p),b&2048&&vu(9,s);break;case 1:Pi(i,s,u,p);break;case 3:Pi(i,s,u,p),b&2048&&(i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&au(i)));break;case 12:if(b&2048){Pi(i,s,u,p),i=s.stateNode;try{var S=s.memoizedProps,A=S.id,Y=S.onPostCommit;typeof Y=="function"&&Y(A,s.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(ne){bn(s,s.return,ne)}}else Pi(i,s,u,p);break;case 31:Pi(i,s,u,p);break;case 13:Pi(i,s,u,p);break;case 23:break;case 22:S=s.stateNode,A=s.alternate,s.memoizedState!==null?S._visibility&2?Pi(i,s,u,p):wu(i,s):S._visibility&2?Pi(i,s,u,p):(S._visibility|=2,Ol(i,s,u,p,(s.subtreeFlags&10256)!==0||!1)),b&2048&&my(A,s);break;case 24:Pi(i,s,u,p),b&2048&&gy(s.alternate,s);break;default:Pi(i,s,u,p)}}function Ol(i,s,u,p,b){for(b=b&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var S=i,A=s,Y=u,ne=p,ge=A.flags;switch(A.tag){case 0:case 11:case 15:Ol(S,A,Y,ne,b),vu(8,A);break;case 23:break;case 22:var Me=A.stateNode;A.memoizedState!==null?Me._visibility&2?Ol(S,A,Y,ne,b):wu(S,A):(Me._visibility|=2,Ol(S,A,Y,ne,b)),b&&ge&2048&&my(A.alternate,A);break;case 24:Ol(S,A,Y,ne,b),b&&ge&2048&&gy(A.alternate,A);break;default:Ol(S,A,Y,ne,b)}s=s.sibling}}function wu(i,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var u=i,p=s,b=p.flags;switch(p.tag){case 22:wu(u,p),b&2048&&my(p.alternate,p);break;case 24:wu(u,p),b&2048&&gy(p.alternate,p);break;default:wu(u,p)}s=s.sibling}}var Su=8192;function Nl(i,s,u){if(i.subtreeFlags&Su)for(i=i.child;i!==null;)mE(i,s,u),i=i.sibling}function mE(i,s,u){switch(i.tag){case 26:Nl(i,s,u),i.flags&Su&&i.memoizedState!==null&&TP(u,Ii,i.memoizedState,i.memoizedProps);break;case 5:Nl(i,s,u);break;case 3:case 4:var p=Ii;Ii=ph(i.stateNode.containerInfo),Nl(i,s,u),Ii=p;break;case 22:i.memoizedState===null&&(p=i.alternate,p!==null&&p.memoizedState!==null?(p=Su,Su=16777216,Nl(i,s,u),Su=p):Nl(i,s,u));break;default:Nl(i,s,u)}}function gE(i){var s=i.alternate;if(s!==null&&(i=s.child,i!==null)){s.child=null;do s=i.sibling,i.sibling=null,i=s;while(i!==null)}}function Eu(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var p=s[u];or=p,bE(p,i)}gE(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)yE(i),i=i.sibling}function yE(i){switch(i.tag){case 0:case 11:case 15:Eu(i),i.flags&2048&&da(9,i,i.return);break;case 3:Eu(i);break;case 12:Eu(i);break;case 22:var s=i.stateNode;i.memoizedState!==null&&s._visibility&2&&(i.return===null||i.return.tag!==13)?(s._visibility&=-3,th(i)):Eu(i);break;default:Eu(i)}}function th(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var p=s[u];or=p,bE(p,i)}gE(i)}for(i=i.child;i!==null;){switch(s=i,s.tag){case 0:case 11:case 15:da(8,s,s.return),th(s);break;case 22:u=s.stateNode,u._visibility&2&&(u._visibility&=-3,th(s));break;default:th(s)}i=i.sibling}}function bE(i,s){for(;or!==null;){var u=or;switch(u.tag){case 0:case 11:case 15:da(8,u,s);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var p=u.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:au(u.memoizedState.cache)}if(p=u.child,p!==null)p.return=u,or=p;else e:for(u=i;or!==null;){p=or;var b=p.sibling,S=p.return;if(lE(p),p===u){or=null;break e}if(b!==null){b.return=S,or=b;break e}or=S}}}var FI={getCacheForType:function(i){var s=dr(Gn),u=s.data.get(i);return u===void 0&&(u=i(),s.data.set(i,u)),u},cacheSignal:function(){return dr(Gn).controller.signal}},BI=typeof WeakMap=="function"?WeakMap:Map,pn=0,Sn=null,Kt=null,Zt=0,yn=0,Qr=null,fa=!1,Al=!1,yy=!1,Do=0,Fn=0,ha=0,Ts=0,by=0,Zr=0,Dl=0,Tu=null,Pr=null,vy=!1,nh=0,vE=0,rh=1/0,ih=null,pa=null,Jn=0,ma=null,_l=null,_o=0,xy=0,wy=null,xE=null,Ru=0,Sy=null;function Jr(){return(pn&2)!==0&&Zt!==0?Zt&-Zt:j.T!==null?My():je()}function wE(){if(Zr===0)if((Zt&536870912)===0||rn){var i=ot;ot<<=1,(ot&3932160)===0&&(ot=262144),Zr=i}else Zr=536870912;return i=Wr.current,i!==null&&(i.flags|=32),Zr}function Lr(i,s,u){(i===Sn&&(yn===2||yn===9)||i.cancelPendingCommit!==null)&&(Il(i,0),ga(i,Zt,Zr,!1)),qt(i,u),((pn&2)===0||i!==Sn)&&(i===Sn&&((pn&2)===0&&(Ts|=u),Fn===4&&ga(i,Zt,Zr,!1)),Qi(i))}function SE(i,s,u){if((pn&6)!==0)throw Error(r(327));var p=!u&&(s&127)===0&&(s&i.expiredLanes)===0||Mt(i,s),b=p?qI(i,s):Ty(i,s,!0),S=p;do{if(b===0){Al&&!p&&ga(i,s,0,!1);break}else{if(u=i.current.alternate,S&&!UI(u)){b=Ty(i,s,!1),S=!1;continue}if(b===2){if(S=s,i.errorRecoveryDisabledLanes&S)var A=0;else A=i.pendingLanes&-536870913,A=A!==0?A:A&536870912?536870912:0;if(A!==0){s=A;e:{var Y=i;b=Tu;var ne=Y.current.memoizedState.isDehydrated;if(ne&&(Il(Y,A).flags|=256),A=Ty(Y,A,!1),A!==2){if(yy&&!ne){Y.errorRecoveryDisabledLanes|=S,Ts|=S,b=4;break e}S=Pr,Pr=b,S!==null&&(Pr===null?Pr=S:Pr.push.apply(Pr,S))}b=A}if(S=!1,b!==2)continue}}if(b===1){Il(i,0),ga(i,s,0,!0);break}e:{switch(p=i,S=b,S){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:ga(p,s,Zr,!fa);break e;case 2:Pr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(b=nh+300-_e(),10<b)){if(ga(p,s,Zr,!fa),Ke(p,0,!0)!==0)break e;_o=s,p.timeoutHandle=JE(EE.bind(null,p,u,Pr,ih,vy,s,Zr,Ts,Dl,fa,S,"Throttled",-0,0),b);break e}EE(p,u,Pr,ih,vy,s,Zr,Ts,Dl,fa,S,null,-0,0)}}break}while(!0);Qi(i)}function EE(i,s,u,p,b,S,A,Y,ne,ge,Me,Ie,be,we){if(i.timeoutHandle=-1,Ie=s.subtreeFlags,Ie&8192||(Ie&16785408)===16785408){Ie={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:bo},mE(s,S,Ie);var st=(S&62914560)===S?nh-_e():(S&4194048)===S?vE-_e():0;if(st=RP(Ie,st),st!==null){_o=S,i.cancelPendingCommit=st(AE.bind(null,i,s,S,u,p,b,A,Y,ne,Me,Ie,null,be,we)),ga(i,S,A,!ge);return}}AE(i,s,S,u,p,b,A,Y,ne)}function UI(i){for(var s=i;;){var u=s.tag;if((u===0||u===11||u===15)&&s.flags&16384&&(u=s.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var p=0;p<u.length;p++){var b=u[p],S=b.getSnapshot;b=b.value;try{if(!Yr(S(),b))return!1}catch{return!1}}if(u=s.child,s.subtreeFlags&16384&&u!==null)u.return=s,s=u;else{if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function ga(i,s,u,p){s&=~by,s&=~Ts,i.suspendedLanes|=s,i.pingedLanes&=~s,p&&(i.warmLanes|=s),p=i.expirationTimes;for(var b=s;0<b;){var S=31-nt(b),A=1<<S;p[S]=-1,b&=~A}u!==0&&Ot(i,u,s)}function oh(){return(pn&6)===0?(Cu(0),!1):!0}function Ey(){if(Kt!==null){if(yn===0)var i=Kt.return;else i=Kt,So=ms=null,Fg(i),Tl=null,lu=0,i=Kt;for(;i!==null;)eE(i.alternate,i),i=i.return;Kt=null}}function Il(i,s){var u=i.timeoutHandle;u!==-1&&(i.timeoutHandle=-1,sP(u)),u=i.cancelPendingCommit,u!==null&&(i.cancelPendingCommit=null,u()),_o=0,Ey(),Sn=i,Kt=u=xo(i.current,null),Zt=s,yn=0,Qr=null,fa=!1,Al=Mt(i,s),yy=!1,Dl=Zr=by=Ts=ha=Fn=0,Pr=Tu=null,vy=!1,(s&8)!==0&&(s|=s&32);var p=i.entangledLanes;if(p!==0)for(i=i.entanglements,p&=s;0<p;){var b=31-nt(p),S=1<<b;s|=i[b],p&=~S}return Do=s,Cf(),u}function TE(i,s){jt=null,j.H=gu,s===El||s===If?(s=BS(),yn=3):s===kg?(s=BS(),yn=4):yn=s===ty?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,Qr=s,Kt===null&&(Fn=1,Kf(i,di(s,i.current)))}function RE(){var i=Wr.current;return i===null?!0:(Zt&4194048)===Zt?mi===null:(Zt&62914560)===Zt||(Zt&536870912)!==0?i===mi:!1}function CE(){var i=j.H;return j.H=gu,i===null?gu:i}function kE(){var i=j.A;return j.A=FI,i}function ah(){Fn=4,fa||(Zt&4194048)!==Zt&&Wr.current!==null||(Al=!0),(ha&134217727)===0&&(Ts&134217727)===0||Sn===null||ga(Sn,Zt,Zr,!1)}function Ty(i,s,u){var p=pn;pn|=2;var b=CE(),S=kE();(Sn!==i||Zt!==s)&&(ih=null,Il(i,s)),s=!1;var A=Fn;e:do try{if(yn!==0&&Kt!==null){var Y=Kt,ne=Qr;switch(yn){case 8:Ey(),A=6;break e;case 3:case 2:case 9:case 6:Wr.current===null&&(s=!0);var ge=yn;if(yn=0,Qr=null,Pl(i,Y,ne,ge),u&&Al){A=0;break e}break;default:ge=yn,yn=0,Qr=null,Pl(i,Y,ne,ge)}}HI(),A=Fn;break}catch(Me){TE(i,Me)}while(!0);return s&&i.shellSuspendCounter++,So=ms=null,pn=p,j.H=b,j.A=S,Kt===null&&(Sn=null,Zt=0,Cf()),A}function HI(){for(;Kt!==null;)ME(Kt)}function qI(i,s){var u=pn;pn|=2;var p=CE(),b=kE();Sn!==i||Zt!==s?(ih=null,rh=_e()+500,Il(i,s)):Al=Mt(i,s);e:do try{if(yn!==0&&Kt!==null){s=Kt;var S=Qr;t:switch(yn){case 1:yn=0,Qr=null,Pl(i,s,S,1);break;case 2:case 9:if(zS(S)){yn=0,Qr=null,OE(s);break}s=function(){yn!==2&&yn!==9||Sn!==i||(yn=7),Qi(i)},S.then(s,s);break e;case 3:yn=7;break e;case 4:yn=5;break e;case 7:zS(S)?(yn=0,Qr=null,OE(s)):(yn=0,Qr=null,Pl(i,s,S,7));break;case 5:var A=null;switch(Kt.tag){case 26:A=Kt.memoizedState;case 5:case 27:var Y=Kt;if(A?pT(A):Y.stateNode.complete){yn=0,Qr=null;var ne=Y.sibling;if(ne!==null)Kt=ne;else{var ge=Y.return;ge!==null?(Kt=ge,sh(ge)):Kt=null}break t}}yn=0,Qr=null,Pl(i,s,S,5);break;case 6:yn=0,Qr=null,Pl(i,s,S,6);break;case 8:Ey(),Fn=6;break e;default:throw Error(r(462))}}VI();break}catch(Me){TE(i,Me)}while(!0);return So=ms=null,j.H=p,j.A=b,pn=u,Kt!==null?0:(Sn=null,Zt=0,Cf(),Fn)}function VI(){for(;Kt!==null&&!Be();)ME(Kt)}function ME(i){var s=Z1(i.alternate,i,Do);i.memoizedProps=i.pendingProps,s===null?sh(i):Kt=s}function OE(i){var s=i,u=s.alternate;switch(s.tag){case 15:case 0:s=G1(u,s,s.pendingProps,s.type,void 0,Zt);break;case 11:s=G1(u,s,s.pendingProps,s.type.render,s.ref,Zt);break;case 5:Fg(s);default:eE(u,s),s=Kt=kS(s,Do),s=Z1(u,s,Do)}i.memoizedProps=i.pendingProps,s===null?sh(i):Kt=s}function Pl(i,s,u,p){So=ms=null,Fg(s),Tl=null,lu=0;var b=s.return;try{if(DI(i,b,s,u,Zt)){Fn=1,Kf(i,di(u,i.current)),Kt=null;return}}catch(S){if(b!==null)throw Kt=b,S;Fn=1,Kf(i,di(u,i.current)),Kt=null;return}s.flags&32768?(rn||p===1?i=!0:Al||(Zt&536870912)!==0?i=!1:(fa=i=!0,(p===2||p===9||p===3||p===6)&&(p=Wr.current,p!==null&&p.tag===13&&(p.flags|=16384))),NE(s,i)):sh(s)}function sh(i){var s=i;do{if((s.flags&32768)!==0){NE(s,fa);return}i=s.return;var u=PI(s.alternate,s,Do);if(u!==null){Kt=u;return}if(s=s.sibling,s!==null){Kt=s;return}Kt=s=i}while(s!==null);Fn===0&&(Fn=5)}function NE(i,s){do{var u=LI(i.alternate,i);if(u!==null){u.flags&=32767,Kt=u;return}if(u=i.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!s&&(i=i.sibling,i!==null)){Kt=i;return}Kt=i=u}while(i!==null);Fn=6,Kt=null}function AE(i,s,u,p,b,S,A,Y,ne){i.cancelPendingCommit=null;do lh();while(Jn!==0);if((pn&6)!==0)throw Error(r(327));if(s!==null){if(s===i.current)throw Error(r(177));if(S=s.lanes|s.childLanes,S|=fg,Je(i,u,S,A,Y,ne),i===Sn&&(Kt=Sn=null,Zt=0),_l=s,ma=i,_o=u,xy=S,wy=b,xE=p,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,KI(ee,function(){return LE(),null})):(i.callbackNode=null,i.callbackPriority=0),p=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||p){p=j.T,j.T=null,b=z.p,z.p=2,A=pn,pn|=4;try{jI(i,s,u)}finally{pn=A,z.p=b,j.T=p}}Jn=1,DE(),_E(),IE()}}function DE(){if(Jn===1){Jn=0;var i=ma,s=_l,u=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||u){u=j.T,j.T=null;var p=z.p;z.p=2;var b=pn;pn|=4;try{fE(s,i);var S=Ly,A=bS(i.containerInfo),Y=S.focusedElem,ne=S.selectionRange;if(A!==Y&&Y&&Y.ownerDocument&&yS(Y.ownerDocument.documentElement,Y)){if(ne!==null&&sg(Y)){var ge=ne.start,Me=ne.end;if(Me===void 0&&(Me=ge),"selectionStart"in Y)Y.selectionStart=ge,Y.selectionEnd=Math.min(Me,Y.value.length);else{var Ie=Y.ownerDocument||document,be=Ie&&Ie.defaultView||window;if(be.getSelection){var we=be.getSelection(),st=Y.textContent.length,wt=Math.min(ne.start,st),wn=ne.end===void 0?wt:Math.min(ne.end,st);!we.extend&&wt>wn&&(A=wn,wn=wt,wt=A);var ce=gS(Y,wt),ae=gS(Y,wn);if(ce&&ae&&(we.rangeCount!==1||we.anchorNode!==ce.node||we.anchorOffset!==ce.offset||we.focusNode!==ae.node||we.focusOffset!==ae.offset)){var me=Ie.createRange();me.setStart(ce.node,ce.offset),we.removeAllRanges(),wt>wn?(we.addRange(me),we.extend(ae.node,ae.offset)):(me.setEnd(ae.node,ae.offset),we.addRange(me))}}}}for(Ie=[],we=Y;we=we.parentNode;)we.nodeType===1&&Ie.push({element:we,left:we.scrollLeft,top:we.scrollTop});for(typeof Y.focus=="function"&&Y.focus(),Y=0;Y<Ie.length;Y++){var Ae=Ie[Y];Ae.element.scrollLeft=Ae.left,Ae.element.scrollTop=Ae.top}}xh=!!Py,Ly=Py=null}finally{pn=b,z.p=p,j.T=u}}i.current=s,Jn=2}}function _E(){if(Jn===2){Jn=0;var i=ma,s=_l,u=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||u){u=j.T,j.T=null;var p=z.p;z.p=2;var b=pn;pn|=4;try{sE(i,s.alternate,s)}finally{pn=b,z.p=p,j.T=u}}Jn=3}}function IE(){if(Jn===4||Jn===3){Jn=0,Ve();var i=ma,s=_l,u=_o,p=xE;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?Jn=5:(Jn=0,_l=ma=null,PE(i,i.pendingLanes));var b=i.pendingLanes;if(b===0&&(pa=null),ke(u),s=s.stateNode,ze&&typeof ze.onCommitFiberRoot=="function")try{ze.onCommitFiberRoot(et,s,void 0,(s.current.flags&128)===128)}catch{}if(p!==null){s=j.T,b=z.p,z.p=2,j.T=null;try{for(var S=i.onRecoverableError,A=0;A<p.length;A++){var Y=p[A];S(Y.value,{componentStack:Y.stack})}}finally{j.T=s,z.p=b}}(_o&3)!==0&&lh(),Qi(i),b=i.pendingLanes,(u&261930)!==0&&(b&42)!==0?i===Sy?Ru++:(Ru=0,Sy=i):Ru=0,Cu(0)}}function PE(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,au(s)))}function lh(){return DE(),_E(),IE(),LE()}function LE(){if(Jn!==5)return!1;var i=ma,s=xy;xy=0;var u=ke(_o),p=j.T,b=z.p;try{z.p=32>u?32:u,j.T=null,u=wy,wy=null;var S=ma,A=_o;if(Jn=0,_l=ma=null,_o=0,(pn&6)!==0)throw Error(r(331));var Y=pn;if(pn|=4,yE(S.current),pE(S,S.current,A,u),pn=Y,Cu(0,!1),ze&&typeof ze.onPostCommitFiberRoot=="function")try{ze.onPostCommitFiberRoot(et,S)}catch{}return!0}finally{z.p=b,j.T=p,PE(i,s)}}function jE(i,s,u){s=di(u,s),s=ey(i.stateNode,s,2),i=la(i,s,2),i!==null&&(qt(i,2),Qi(i))}function bn(i,s,u){if(i.tag===3)jE(i,i,u);else for(;s!==null;){if(s.tag===3){jE(s,i,u);break}else if(s.tag===1){var p=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(pa===null||!pa.has(p))){i=di(u,i),u=z1(2),p=la(s,u,2),p!==null&&(F1(u,p,s,i),qt(p,2),Qi(p));break}}s=s.return}}function Ry(i,s,u){var p=i.pingCache;if(p===null){p=i.pingCache=new BI;var b=new Set;p.set(s,b)}else b=p.get(s),b===void 0&&(b=new Set,p.set(s,b));b.has(u)||(yy=!0,b.add(u),i=$I.bind(null,i,s,u),s.then(i,i))}function $I(i,s,u){var p=i.pingCache;p!==null&&p.delete(s),i.pingedLanes|=i.suspendedLanes&u,i.warmLanes&=~u,Sn===i&&(Zt&u)===u&&(Fn===4||Fn===3&&(Zt&62914560)===Zt&&300>_e()-nh?(pn&2)===0&&Il(i,0):by|=u,Dl===Zt&&(Dl=0)),Qi(i)}function zE(i,s){s===0&&(s=kt()),i=fs(i,s),i!==null&&(qt(i,s),Qi(i))}function GI(i){var s=i.memoizedState,u=0;s!==null&&(u=s.retryLane),zE(i,u)}function YI(i,s){var u=0;switch(i.tag){case 31:case 13:var p=i.stateNode,b=i.memoizedState;b!==null&&(u=b.retryLane);break;case 19:p=i.stateNode;break;case 22:p=i.stateNode._retryCache;break;default:throw Error(r(314))}p!==null&&p.delete(s),zE(i,u)}function KI(i,s){return Ee(i,s)}var ch=null,Ll=null,Cy=!1,uh=!1,ky=!1,ya=0;function Qi(i){i!==Ll&&i.next===null&&(Ll===null?ch=Ll=i:Ll=Ll.next=i),uh=!0,Cy||(Cy=!0,XI())}function Cu(i,s){if(!ky&&uh){ky=!0;do for(var u=!1,p=ch;p!==null;){if(i!==0){var b=p.pendingLanes;if(b===0)var S=0;else{var A=p.suspendedLanes,Y=p.pingedLanes;S=(1<<31-nt(42|i)+1)-1,S&=b&~(A&~Y),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(u=!0,HE(p,S))}else S=Zt,S=Ke(p,p===Sn?S:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(S&3)===0||Mt(p,S)||(u=!0,HE(p,S));p=p.next}while(u);ky=!1}}function WI(){FE()}function FE(){uh=Cy=!1;var i=0;ya!==0&&aP()&&(i=ya);for(var s=_e(),u=null,p=ch;p!==null;){var b=p.next,S=BE(p,s);S===0?(p.next=null,u===null?ch=b:u.next=b,b===null&&(Ll=u)):(u=p,(i!==0||(S&3)!==0)&&(uh=!0)),p=b}Jn!==0&&Jn!==5||Cu(i),ya!==0&&(ya=0)}function BE(i,s){for(var u=i.suspendedLanes,p=i.pingedLanes,b=i.expirationTimes,S=i.pendingLanes&-62914561;0<S;){var A=31-nt(S),Y=1<<A,ne=b[A];ne===-1?((Y&u)===0||(Y&p)!==0)&&(b[A]=Lt(Y,s)):ne<=s&&(i.expiredLanes|=Y),S&=~Y}if(s=Sn,u=Zt,u=Ke(i,i===s?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),p=i.callbackNode,u===0||i===s&&(yn===2||yn===9)||i.cancelPendingCommit!==null)return p!==null&&p!==null&&xe(p),i.callbackNode=null,i.callbackPriority=0;if((u&3)===0||Mt(i,u)){if(s=u&-u,s===i.callbackPriority)return s;switch(p!==null&&xe(p),ke(u)){case 2:case 8:u=Re;break;case 32:u=ee;break;case 268435456:u=Ne;break;default:u=ee}return p=UE.bind(null,i),u=Ee(u,p),i.callbackPriority=s,i.callbackNode=u,s}return p!==null&&p!==null&&xe(p),i.callbackPriority=2,i.callbackNode=null,2}function UE(i,s){if(Jn!==0&&Jn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var u=i.callbackNode;if(lh()&&i.callbackNode!==u)return null;var p=Zt;return p=Ke(i,i===Sn?p:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),p===0?null:(SE(i,p,s),BE(i,_e()),i.callbackNode!=null&&i.callbackNode===u?UE.bind(null,i):null)}function HE(i,s){if(lh())return null;SE(i,s,!0)}function XI(){lP(function(){(pn&6)!==0?Ee(pe,WI):FE()})}function My(){if(ya===0){var i=wl;i===0&&(i=Dt,Dt<<=1,(Dt&261888)===0&&(Dt=256)),ya=i}return ya}function qE(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:bf(""+i)}function VE(i,s){var u=s.ownerDocument.createElement("input");return u.name=s.name,u.value=s.value,i.id&&u.setAttribute("form",i.id),s.parentNode.insertBefore(u,s),i=new FormData(i),u.parentNode.removeChild(u),i}function QI(i,s,u,p,b){if(s==="submit"&&u&&u.stateNode===b){var S=qE((b[Xe]||null).action),A=p.submitter;A&&(s=(s=A[Xe]||null)?qE(s.formAction):A.getAttribute("formAction"),s!==null&&(S=s,A=null));var Y=new Sf("action","action",null,p,b);i.push({event:Y,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(ya!==0){var ne=A?VE(b,A):new FormData(b);Kg(u,{pending:!0,data:ne,method:b.method,action:S},null,ne)}}else typeof S=="function"&&(Y.preventDefault(),ne=A?VE(b,A):new FormData(b),Kg(u,{pending:!0,data:ne,method:b.method,action:S},S,ne))},currentTarget:b}]})}}for(var Oy=0;Oy<dg.length;Oy++){var Ny=dg[Oy],ZI=Ny.toLowerCase(),JI=Ny[0].toUpperCase()+Ny.slice(1);_i(ZI,"on"+JI)}_i(wS,"onAnimationEnd"),_i(SS,"onAnimationIteration"),_i(ES,"onAnimationStart"),_i("dblclick","onDoubleClick"),_i("focusin","onFocus"),_i("focusout","onBlur"),_i(mI,"onTransitionRun"),_i(gI,"onTransitionStart"),_i(yI,"onTransitionCancel"),_i(TS,"onTransitionEnd"),li("onMouseEnter",["mouseout","mouseover"]),li("onMouseLeave",["mouseout","mouseover"]),li("onPointerEnter",["pointerout","pointerover"]),li("onPointerLeave",["pointerout","pointerover"]),Ai("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ai("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ai("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ai("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ai("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ai("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ku="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(" "),eP=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ku));function $E(i,s){s=(s&4)!==0;for(var u=0;u<i.length;u++){var p=i[u],b=p.event;p=p.listeners;e:{var S=void 0;if(s)for(var A=p.length-1;0<=A;A--){var Y=p[A],ne=Y.instance,ge=Y.currentTarget;if(Y=Y.listener,ne!==S&&b.isPropagationStopped())break e;S=Y,b.currentTarget=ge;try{S(b)}catch(Me){Rf(Me)}b.currentTarget=null,S=ne}else for(A=0;A<p.length;A++){if(Y=p[A],ne=Y.instance,ge=Y.currentTarget,Y=Y.listener,ne!==S&&b.isPropagationStopped())break e;S=Y,b.currentTarget=ge;try{S(b)}catch(Me){Rf(Me)}b.currentTarget=null,S=ne}}}}function Wt(i,s){var u=s[Et];u===void 0&&(u=s[Et]=new Set);var p=i+"__bubble";u.has(p)||(GE(s,i,2,!1),u.add(p))}function Ay(i,s,u){var p=0;s&&(p|=4),GE(u,i,p,s)}var dh="_reactListening"+Math.random().toString(36).slice(2);function Dy(i){if(!i[dh]){i[dh]=!0,Ni.forEach(function(u){u!=="selectionchange"&&(eP.has(u)||Ay(u,!1,i),Ay(u,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[dh]||(s[dh]=!0,Ay("selectionchange",!1,s))}}function GE(i,s,u,p){switch(wT(s)){case 2:var b=MP;break;case 8:b=OP;break;default:b=Yy}u=b.bind(null,s,u,i),b=void 0,!Zm||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(b=!0),p?b!==void 0?i.addEventListener(s,u,{capture:!0,passive:b}):i.addEventListener(s,u,!0):b!==void 0?i.addEventListener(s,u,{passive:b}):i.addEventListener(s,u,!1)}function _y(i,s,u,p,b){var S=p;if((s&1)===0&&(s&2)===0&&p!==null)e:for(;;){if(p===null)return;var A=p.tag;if(A===3||A===4){var Y=p.stateNode.containerInfo;if(Y===b)break;if(A===4)for(A=p.return;A!==null;){var ne=A.tag;if((ne===3||ne===4)&&A.stateNode.containerInfo===b)return;A=A.return}for(;Y!==null;){if(A=jn(Y),A===null)return;if(ne=A.tag,ne===5||ne===6||ne===26||ne===27){p=S=A;continue e}Y=Y.parentNode}}p=p.return}Q0(function(){var ge=S,Me=Xm(u),Ie=[];e:{var be=RS.get(i);if(be!==void 0){var we=Sf,st=i;switch(i){case"keypress":if(xf(u)===0)break e;case"keydown":case"keyup":we=Y_;break;case"focusin":st="focus",we=ng;break;case"focusout":st="blur",we=ng;break;case"beforeblur":case"afterblur":we=ng;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":we=eS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":we=P_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":we=X_;break;case wS:case SS:case ES:we=z_;break;case TS:we=Z_;break;case"scroll":case"scrollend":we=__;break;case"wheel":we=eI;break;case"copy":case"cut":case"paste":we=B_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":we=nS;break;case"toggle":case"beforetoggle":we=nI}var wt=(s&4)!==0,wn=!wt&&(i==="scroll"||i==="scrollend"),ce=wt?be!==null?be+"Capture":null:be;wt=[];for(var ae=ge,me;ae!==null;){var Ae=ae;if(me=Ae.stateNode,Ae=Ae.tag,Ae!==5&&Ae!==26&&Ae!==27||me===null||ce===null||(Ae=Wc(ae,ce),Ae!=null&&wt.push(Mu(ae,Ae,me))),wn)break;ae=ae.return}0<wt.length&&(be=new we(be,st,null,u,Me),Ie.push({event:be,listeners:wt}))}}if((s&7)===0){e:{if(be=i==="mouseover"||i==="pointerover",we=i==="mouseout"||i==="pointerout",be&&u!==Wm&&(st=u.relatedTarget||u.fromElement)&&(jn(st)||st[at]))break e;if((we||be)&&(be=Me.window===Me?Me:(be=Me.ownerDocument)?be.defaultView||be.parentWindow:window,we?(st=u.relatedTarget||u.toElement,we=ge,st=st?jn(st):null,st!==null&&(wn=a(st),wt=st.tag,st!==wn||wt!==5&&wt!==27&&wt!==6)&&(st=null)):(we=null,st=ge),we!==st)){if(wt=eS,Ae="onMouseLeave",ce="onMouseEnter",ae="mouse",(i==="pointerout"||i==="pointerover")&&(wt=nS,Ae="onPointerLeave",ce="onPointerEnter",ae="pointer"),wn=we==null?be:ir(we),me=st==null?be:ir(st),be=new wt(Ae,ae+"leave",we,u,Me),be.target=wn,be.relatedTarget=me,Ae=null,jn(Me)===ge&&(wt=new wt(ce,ae+"enter",st,u,Me),wt.target=me,wt.relatedTarget=wn,Ae=wt),wn=Ae,we&&st)t:{for(wt=tP,ce=we,ae=st,me=0,Ae=ce;Ae;Ae=wt(Ae))me++;Ae=0;for(var gt=ae;gt;gt=wt(gt))Ae++;for(;0<me-Ae;)ce=wt(ce),me--;for(;0<Ae-me;)ae=wt(ae),Ae--;for(;me--;){if(ce===ae||ae!==null&&ce===ae.alternate){wt=ce;break t}ce=wt(ce),ae=wt(ae)}wt=null}else wt=null;we!==null&&YE(Ie,be,we,wt,!1),st!==null&&wn!==null&&YE(Ie,wn,st,wt,!0)}}e:{if(be=ge?ir(ge):window,we=be.nodeName&&be.nodeName.toLowerCase(),we==="select"||we==="input"&&be.type==="file")var un=uS;else if(lS(be))if(dS)un=fI;else{un=uI;var dt=cI}else we=be.nodeName,!we||we.toLowerCase()!=="input"||be.type!=="checkbox"&&be.type!=="radio"?ge&&Km(ge.elementType)&&(un=uS):un=dI;if(un&&(un=un(i,ge))){cS(Ie,un,u,Me);break e}dt&&dt(i,be,ge),i==="focusout"&&ge&&be.type==="number"&&ge.memoizedProps.value!=null&&Ym(be,"number",be.value)}switch(dt=ge?ir(ge):window,i){case"focusin":(lS(dt)||dt.contentEditable==="true")&&(hl=dt,lg=ge,ru=null);break;case"focusout":ru=lg=hl=null;break;case"mousedown":cg=!0;break;case"contextmenu":case"mouseup":case"dragend":cg=!1,vS(Ie,u,Me);break;case"selectionchange":if(pI)break;case"keydown":case"keyup":vS(Ie,u,Me)}var Ft;if(ig)e:{switch(i){case"compositionstart":var Jt="onCompositionStart";break e;case"compositionend":Jt="onCompositionEnd";break e;case"compositionupdate":Jt="onCompositionUpdate";break e}Jt=void 0}else fl?aS(i,u)&&(Jt="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(Jt="onCompositionStart");Jt&&(rS&&u.locale!=="ko"&&(fl||Jt!=="onCompositionStart"?Jt==="onCompositionEnd"&&fl&&(Ft=Z0()):(ta=Me,Jm="value"in ta?ta.value:ta.textContent,fl=!0)),dt=fh(ge,Jt),0<dt.length&&(Jt=new tS(Jt,i,null,u,Me),Ie.push({event:Jt,listeners:dt}),Ft?Jt.data=Ft:(Ft=sS(u),Ft!==null&&(Jt.data=Ft)))),(Ft=iI?oI(i,u):aI(i,u))&&(Jt=fh(ge,"onBeforeInput"),0<Jt.length&&(dt=new tS("onBeforeInput","beforeinput",null,u,Me),Ie.push({event:dt,listeners:Jt}),dt.data=Ft)),QI(Ie,i,ge,u,Me)}$E(Ie,s)})}function Mu(i,s,u){return{instance:i,listener:s,currentTarget:u}}function fh(i,s){for(var u=s+"Capture",p=[];i!==null;){var b=i,S=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||S===null||(b=Wc(i,u),b!=null&&p.unshift(Mu(i,b,S)),b=Wc(i,s),b!=null&&p.push(Mu(i,b,S))),i.tag===3)return p;i=i.return}return[]}function tP(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function YE(i,s,u,p,b){for(var S=s._reactName,A=[];u!==null&&u!==p;){var Y=u,ne=Y.alternate,ge=Y.stateNode;if(Y=Y.tag,ne!==null&&ne===p)break;Y!==5&&Y!==26&&Y!==27||ge===null||(ne=ge,b?(ge=Wc(u,S),ge!=null&&A.unshift(Mu(u,ge,ne))):b||(ge=Wc(u,S),ge!=null&&A.push(Mu(u,ge,ne)))),u=u.return}A.length!==0&&i.push({event:s,listeners:A})}var nP=/\r\n?/g,rP=/\u0000|\uFFFD/g;function KE(i){return(typeof i=="string"?i:""+i).replace(nP,`
|
|
65
|
+
`).replace(rP,"")}function WE(i,s){return s=KE(s),KE(i)===s}function xn(i,s,u,p,b,S){switch(u){case"children":typeof p=="string"?s==="body"||s==="textarea"&&p===""||cl(i,p):(typeof p=="number"||typeof p=="bigint")&&s!=="body"&&cl(i,""+p);break;case"className":Di(i,"class",p);break;case"tabIndex":Di(i,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":Di(i,u,p);break;case"style":W0(i,p,S);break;case"data":if(s!=="object"){Di(i,"data",p);break}case"src":case"href":if(p===""&&(s!=="a"||u!=="href")){i.removeAttribute(u);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){i.removeAttribute(u);break}p=bf(""+p),i.setAttribute(u,p);break;case"action":case"formAction":if(typeof p=="function"){i.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 S=="function"&&(u==="formAction"?(s!=="input"&&xn(i,s,"name",b.name,b,null),xn(i,s,"formEncType",b.formEncType,b,null),xn(i,s,"formMethod",b.formMethod,b,null),xn(i,s,"formTarget",b.formTarget,b,null)):(xn(i,s,"encType",b.encType,b,null),xn(i,s,"method",b.method,b,null),xn(i,s,"target",b.target,b,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){i.removeAttribute(u);break}p=bf(""+p),i.setAttribute(u,p);break;case"onClick":p!=null&&(i.onclick=bo);break;case"onScroll":p!=null&&Wt("scroll",i);break;case"onScrollEnd":p!=null&&Wt("scrollend",i);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(u=p.__html,u!=null){if(b.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"multiple":i.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":i.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){i.removeAttribute("xlink:href");break}u=bf(""+p),i.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":p!=null&&typeof p!="function"&&typeof p!="symbol"?i.setAttribute(u,""+p):i.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":p&&typeof p!="function"&&typeof p!="symbol"?i.setAttribute(u,""):i.removeAttribute(u);break;case"capture":case"download":p===!0?i.setAttribute(u,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?i.setAttribute(u,p):i.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?i.setAttribute(u,p):i.removeAttribute(u);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?i.removeAttribute(u):i.setAttribute(u,p);break;case"popover":Wt("beforetoggle",i),Wt("toggle",i),qn(i,"popover",p);break;case"xlinkActuate":cr(i,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":cr(i,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":cr(i,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":cr(i,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":cr(i,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":cr(i,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":cr(i,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":cr(i,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":cr(i,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":qn(i,"is",p);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=A_.get(u)||u,qn(i,u,p))}}function Iy(i,s,u,p,b,S){switch(u){case"style":W0(i,p,S);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(u=p.__html,u!=null){if(b.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"children":typeof p=="string"?cl(i,p):(typeof p=="number"||typeof p=="bigint")&&cl(i,""+p);break;case"onScroll":p!=null&&Wt("scroll",i);break;case"onScrollEnd":p!=null&&Wt("scrollend",i);break;case"onClick":p!=null&&(i.onclick=bo);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Gr.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(b=u.endsWith("Capture"),s=u.slice(2,b?u.length-7:void 0),S=i[Xe]||null,S=S!=null?S[u]:null,typeof S=="function"&&i.removeEventListener(s,S,b),typeof p=="function")){typeof S!="function"&&S!==null&&(u in i?i[u]=null:i.hasAttribute(u)&&i.removeAttribute(u)),i.addEventListener(s,p,b);break e}u in i?i[u]=p:p===!0?i.setAttribute(u,""):qn(i,u,p)}}}function hr(i,s,u){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Wt("error",i),Wt("load",i);var p=!1,b=!1,S;for(S in u)if(u.hasOwnProperty(S)){var A=u[S];if(A!=null)switch(S){case"src":p=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:xn(i,s,S,A,u,null)}}b&&xn(i,s,"srcSet",u.srcSet,u,null),p&&xn(i,s,"src",u.src,u,null);return;case"input":Wt("invalid",i);var Y=S=A=b=null,ne=null,ge=null;for(p in u)if(u.hasOwnProperty(p)){var Me=u[p];if(Me!=null)switch(p){case"name":b=Me;break;case"type":A=Me;break;case"checked":ne=Me;break;case"defaultChecked":ge=Me;break;case"value":S=Me;break;case"defaultValue":Y=Me;break;case"children":case"dangerouslySetInnerHTML":if(Me!=null)throw Error(r(137,s));break;default:xn(i,s,p,Me,u,null)}}$0(i,S,Y,ne,ge,A,b,!1);return;case"select":Wt("invalid",i),p=A=S=null;for(b in u)if(u.hasOwnProperty(b)&&(Y=u[b],Y!=null))switch(b){case"value":S=Y;break;case"defaultValue":A=Y;break;case"multiple":p=Y;default:xn(i,s,b,Y,u,null)}s=S,u=A,i.multiple=!!p,s!=null?ll(i,!!p,s,!1):u!=null&&ll(i,!!p,u,!0);return;case"textarea":Wt("invalid",i),S=b=p=null;for(A in u)if(u.hasOwnProperty(A)&&(Y=u[A],Y!=null))switch(A){case"value":p=Y;break;case"defaultValue":b=Y;break;case"children":S=Y;break;case"dangerouslySetInnerHTML":if(Y!=null)throw Error(r(91));break;default:xn(i,s,A,Y,u,null)}Y0(i,p,b,S);return;case"option":for(ne in u)if(u.hasOwnProperty(ne)&&(p=u[ne],p!=null))switch(ne){case"selected":i.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:xn(i,s,ne,p,u,null)}return;case"dialog":Wt("beforetoggle",i),Wt("toggle",i),Wt("cancel",i),Wt("close",i);break;case"iframe":case"object":Wt("load",i);break;case"video":case"audio":for(p=0;p<ku.length;p++)Wt(ku[p],i);break;case"image":Wt("error",i),Wt("load",i);break;case"details":Wt("toggle",i);break;case"embed":case"source":case"link":Wt("error",i),Wt("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ge in u)if(u.hasOwnProperty(ge)&&(p=u[ge],p!=null))switch(ge){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:xn(i,s,ge,p,u,null)}return;default:if(Km(s)){for(Me in u)u.hasOwnProperty(Me)&&(p=u[Me],p!==void 0&&Iy(i,s,Me,p,u,void 0));return}}for(Y in u)u.hasOwnProperty(Y)&&(p=u[Y],p!=null&&xn(i,s,Y,p,u,null))}function iP(i,s,u,p){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,S=null,A=null,Y=null,ne=null,ge=null,Me=null;for(we in u){var Ie=u[we];if(u.hasOwnProperty(we)&&Ie!=null)switch(we){case"checked":break;case"value":break;case"defaultValue":ne=Ie;default:p.hasOwnProperty(we)||xn(i,s,we,null,p,Ie)}}for(var be in p){var we=p[be];if(Ie=u[be],p.hasOwnProperty(be)&&(we!=null||Ie!=null))switch(be){case"type":S=we;break;case"name":b=we;break;case"checked":ge=we;break;case"defaultChecked":Me=we;break;case"value":A=we;break;case"defaultValue":Y=we;break;case"children":case"dangerouslySetInnerHTML":if(we!=null)throw Error(r(137,s));break;default:we!==Ie&&xn(i,s,be,we,p,Ie)}}Gm(i,A,Y,ne,ge,Me,S,b);return;case"select":we=A=Y=be=null;for(S in u)if(ne=u[S],u.hasOwnProperty(S)&&ne!=null)switch(S){case"value":break;case"multiple":we=ne;default:p.hasOwnProperty(S)||xn(i,s,S,null,p,ne)}for(b in p)if(S=p[b],ne=u[b],p.hasOwnProperty(b)&&(S!=null||ne!=null))switch(b){case"value":be=S;break;case"defaultValue":Y=S;break;case"multiple":A=S;default:S!==ne&&xn(i,s,b,S,p,ne)}s=Y,u=A,p=we,be!=null?ll(i,!!u,be,!1):!!p!=!!u&&(s!=null?ll(i,!!u,s,!0):ll(i,!!u,u?[]:"",!1));return;case"textarea":we=be=null;for(Y in u)if(b=u[Y],u.hasOwnProperty(Y)&&b!=null&&!p.hasOwnProperty(Y))switch(Y){case"value":break;case"children":break;default:xn(i,s,Y,null,p,b)}for(A in p)if(b=p[A],S=u[A],p.hasOwnProperty(A)&&(b!=null||S!=null))switch(A){case"value":be=b;break;case"defaultValue":we=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==S&&xn(i,s,A,b,p,S)}G0(i,be,we);return;case"option":for(var st in u)if(be=u[st],u.hasOwnProperty(st)&&be!=null&&!p.hasOwnProperty(st))switch(st){case"selected":i.selected=!1;break;default:xn(i,s,st,null,p,be)}for(ne in p)if(be=p[ne],we=u[ne],p.hasOwnProperty(ne)&&be!==we&&(be!=null||we!=null))switch(ne){case"selected":i.selected=be&&typeof be!="function"&&typeof be!="symbol";break;default:xn(i,s,ne,be,p,we)}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 wt in u)be=u[wt],u.hasOwnProperty(wt)&&be!=null&&!p.hasOwnProperty(wt)&&xn(i,s,wt,null,p,be);for(ge in p)if(be=p[ge],we=u[ge],p.hasOwnProperty(ge)&&be!==we&&(be!=null||we!=null))switch(ge){case"children":case"dangerouslySetInnerHTML":if(be!=null)throw Error(r(137,s));break;default:xn(i,s,ge,be,p,we)}return;default:if(Km(s)){for(var wn in u)be=u[wn],u.hasOwnProperty(wn)&&be!==void 0&&!p.hasOwnProperty(wn)&&Iy(i,s,wn,void 0,p,be);for(Me in p)be=p[Me],we=u[Me],!p.hasOwnProperty(Me)||be===we||be===void 0&&we===void 0||Iy(i,s,Me,be,p,we);return}}for(var ce in u)be=u[ce],u.hasOwnProperty(ce)&&be!=null&&!p.hasOwnProperty(ce)&&xn(i,s,ce,null,p,be);for(Ie in p)be=p[Ie],we=u[Ie],!p.hasOwnProperty(Ie)||be===we||be==null&&we==null||xn(i,s,Ie,be,p,we)}function XE(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function oP(){if(typeof performance.getEntriesByType=="function"){for(var i=0,s=0,u=performance.getEntriesByType("resource"),p=0;p<u.length;p++){var b=u[p],S=b.transferSize,A=b.initiatorType,Y=b.duration;if(S&&Y&&XE(A)){for(A=0,Y=b.responseEnd,p+=1;p<u.length;p++){var ne=u[p],ge=ne.startTime;if(ge>Y)break;var Me=ne.transferSize,Ie=ne.initiatorType;Me&&XE(Ie)&&(ne=ne.responseEnd,A+=Me*(ne<Y?1:(Y-ge)/(ne-ge)))}if(--p,s+=8*(S+A)/(b.duration/1e3),i++,10<i)break}}if(0<i)return s/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var Py=null,Ly=null;function hh(i){return i.nodeType===9?i:i.ownerDocument}function QE(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function ZE(i,s){if(i===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&s==="foreignObject"?0:i}function jy(i,s){return i==="textarea"||i==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var zy=null;function aP(){var i=window.event;return i&&i.type==="popstate"?i===zy?!1:(zy=i,!0):(zy=null,!1)}var JE=typeof setTimeout=="function"?setTimeout:void 0,sP=typeof clearTimeout=="function"?clearTimeout:void 0,eT=typeof Promise=="function"?Promise:void 0,lP=typeof queueMicrotask=="function"?queueMicrotask:typeof eT<"u"?function(i){return eT.resolve(null).then(i).catch(cP)}:JE;function cP(i){setTimeout(function(){throw i})}function ba(i){return i==="head"}function tT(i,s){var u=s,p=0;do{var b=u.nextSibling;if(i.removeChild(u),b&&b.nodeType===8)if(u=b.data,u==="/$"||u==="/&"){if(p===0){i.removeChild(b),Bl(s);return}p--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")p++;else if(u==="html")Ou(i.ownerDocument.documentElement);else if(u==="head"){u=i.ownerDocument.head,Ou(u);for(var S=u.firstChild;S;){var A=S.nextSibling,Y=S.nodeName;S[_n]||Y==="SCRIPT"||Y==="STYLE"||Y==="LINK"&&S.rel.toLowerCase()==="stylesheet"||u.removeChild(S),S=A}}else u==="body"&&Ou(i.ownerDocument.body);u=b}while(u);Bl(s)}function nT(i,s){var u=i;i=0;do{var p=u.nextSibling;if(u.nodeType===1?s?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(s?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),p&&p.nodeType===8)if(u=p.data,u==="/$"){if(i===0)break;i--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||i++;u=p}while(u)}function Fy(i){var s=i.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var u=s;switch(s=s.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Fy(u),Ln(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}i.removeChild(u)}}function uP(i,s,u,p){for(;i.nodeType===1;){var b=u;if(i.nodeName.toLowerCase()!==s.toLowerCase()){if(!p&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(p){if(!i[_n])switch(s){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(S=i.getAttribute("rel"),S==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(S!==b.rel||i.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||i.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||i.getAttribute("title")!==(b.title==null?null:b.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(S=i.getAttribute("src"),(S!==(b.src==null?null:b.src)||i.getAttribute("type")!==(b.type==null?null:b.type)||i.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&S&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(s==="input"&&i.type==="hidden"){var S=b.name==null?null:""+b.name;if(b.type==="hidden"&&i.getAttribute("name")===S)return i}else return i;if(i=gi(i.nextSibling),i===null)break}return null}function dP(i,s,u){if(s==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!u||(i=gi(i.nextSibling),i===null))return null;return i}function rT(i,s){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!s||(i=gi(i.nextSibling),i===null))return null;return i}function By(i){return i.data==="$?"||i.data==="$~"}function Uy(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function fP(i,s){var u=i.ownerDocument;if(i.data==="$~")i._reactRetry=s;else if(i.data!=="$?"||u.readyState!=="loading")s();else{var p=function(){s(),u.removeEventListener("DOMContentLoaded",p)};u.addEventListener("DOMContentLoaded",p),i._reactRetry=p}}function gi(i){for(;i!=null;i=i.nextSibling){var s=i.nodeType;if(s===1||s===3)break;if(s===8){if(s=i.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return i}var Hy=null;function iT(i){i=i.nextSibling;for(var s=0;i;){if(i.nodeType===8){var u=i.data;if(u==="/$"||u==="/&"){if(s===0)return gi(i.nextSibling);s--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||s++}i=i.nextSibling}return null}function oT(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var u=i.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(s===0)return i;s--}else u!=="/$"&&u!=="/&"||s++}i=i.previousSibling}return null}function aT(i,s,u){switch(s=hh(u),i){case"html":if(i=s.documentElement,!i)throw Error(r(452));return i;case"head":if(i=s.head,!i)throw Error(r(453));return i;case"body":if(i=s.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function Ou(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);Ln(i)}var yi=new Map,sT=new Set;function ph(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Io=z.d;z.d={f:hP,r:pP,D:mP,C:gP,L:yP,m:bP,X:xP,S:vP,M:wP};function hP(){var i=Io.f(),s=oh();return i||s}function pP(i){var s=en(i);s!==null&&s.tag===5&&s.type==="form"?T1(s):Io.r(i)}var jl=typeof document>"u"?null:document;function lT(i,s,u){var p=jl;if(p&&typeof s=="string"&&s){var b=ci(s);b='link[rel="'+i+'"][href="'+b+'"]',typeof u=="string"&&(b+='[crossorigin="'+u+'"]'),sT.has(b)||(sT.add(b),i={rel:i,crossOrigin:u,href:s},p.querySelector(b)===null&&(s=p.createElement("link"),hr(s,"link",i),Nn(s),p.head.appendChild(s)))}}function mP(i){Io.D(i),lT("dns-prefetch",i,null)}function gP(i,s){Io.C(i,s),lT("preconnect",i,s)}function yP(i,s,u){Io.L(i,s,u);var p=jl;if(p&&i&&s){var b='link[rel="preload"][as="'+ci(s)+'"]';s==="image"&&u&&u.imageSrcSet?(b+='[imagesrcset="'+ci(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(b+='[imagesizes="'+ci(u.imageSizes)+'"]')):b+='[href="'+ci(i)+'"]';var S=b;switch(s){case"style":S=zl(i);break;case"script":S=Fl(i)}yi.has(S)||(i=h({rel:"preload",href:s==="image"&&u&&u.imageSrcSet?void 0:i,as:s},u),yi.set(S,i),p.querySelector(b)!==null||s==="style"&&p.querySelector(Nu(S))||s==="script"&&p.querySelector(Au(S))||(s=p.createElement("link"),hr(s,"link",i),Nn(s),p.head.appendChild(s)))}}function bP(i,s){Io.m(i,s);var u=jl;if(u&&i){var p=s&&typeof s.as=="string"?s.as:"script",b='link[rel="modulepreload"][as="'+ci(p)+'"][href="'+ci(i)+'"]',S=b;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=Fl(i)}if(!yi.has(S)&&(i=h({rel:"modulepreload",href:i},s),yi.set(S,i),u.querySelector(b)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Au(S)))return}p=u.createElement("link"),hr(p,"link",i),Nn(p),u.head.appendChild(p)}}}function vP(i,s,u){Io.S(i,s,u);var p=jl;if(p&&i){var b=Nr(p).hoistableStyles,S=zl(i);s=s||"default";var A=b.get(S);if(!A){var Y={loading:0,preload:null};if(A=p.querySelector(Nu(S)))Y.loading=5;else{i=h({rel:"stylesheet",href:i,"data-precedence":s},u),(u=yi.get(S))&&qy(i,u);var ne=A=p.createElement("link");Nn(ne),hr(ne,"link",i),ne._p=new Promise(function(ge,Me){ne.onload=ge,ne.onerror=Me}),ne.addEventListener("load",function(){Y.loading|=1}),ne.addEventListener("error",function(){Y.loading|=2}),Y.loading|=4,mh(A,s,p)}A={type:"stylesheet",instance:A,count:1,state:Y},b.set(S,A)}}}function xP(i,s){Io.X(i,s);var u=jl;if(u&&i){var p=Nr(u).hoistableScripts,b=Fl(i),S=p.get(b);S||(S=u.querySelector(Au(b)),S||(i=h({src:i,async:!0},s),(s=yi.get(b))&&Vy(i,s),S=u.createElement("script"),Nn(S),hr(S,"link",i),u.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},p.set(b,S))}}function wP(i,s){Io.M(i,s);var u=jl;if(u&&i){var p=Nr(u).hoistableScripts,b=Fl(i),S=p.get(b);S||(S=u.querySelector(Au(b)),S||(i=h({src:i,async:!0,type:"module"},s),(s=yi.get(b))&&Vy(i,s),S=u.createElement("script"),Nn(S),hr(S,"link",i),u.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},p.set(b,S))}}function cT(i,s,u,p){var b=(b=oe.current)?ph(b):null;if(!b)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(s=zl(u.href),u=Nr(b).hoistableStyles,p=u.get(s),p||(p={type:"style",instance:null,count:0,state:null},u.set(s,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){i=zl(u.href);var S=Nr(b).hoistableStyles,A=S.get(i);if(A||(b=b.ownerDocument||b,A={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(i,A),(S=b.querySelector(Nu(i)))&&!S._p&&(A.instance=S,A.state.loading=5),yi.has(i)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},yi.set(i,u),S||SP(b,i,u,A.state))),s&&p===null)throw Error(r(528,""));return A}if(s&&p!==null)throw Error(r(529,""));return null;case"script":return s=u.async,u=u.src,typeof u=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Fl(u),u=Nr(b).hoistableScripts,p=u.get(s),p||(p={type:"script",instance:null,count:0,state:null},u.set(s,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function zl(i){return'href="'+ci(i)+'"'}function Nu(i){return'link[rel="stylesheet"]['+i+"]"}function uT(i){return h({},i,{"data-precedence":i.precedence,precedence:null})}function SP(i,s,u,p){i.querySelector('link[rel="preload"][as="style"]['+s+"]")?p.loading=1:(s=i.createElement("link"),p.preload=s,s.addEventListener("load",function(){return p.loading|=1}),s.addEventListener("error",function(){return p.loading|=2}),hr(s,"link",u),Nn(s),i.head.appendChild(s))}function Fl(i){return'[src="'+ci(i)+'"]'}function Au(i){return"script[async]"+i}function dT(i,s,u){if(s.count++,s.instance===null)switch(s.type){case"style":var p=i.querySelector('style[data-href~="'+ci(u.href)+'"]');if(p)return s.instance=p,Nn(p),p;var b=h({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return p=(i.ownerDocument||i).createElement("style"),Nn(p),hr(p,"style",b),mh(p,u.precedence,i),s.instance=p;case"stylesheet":b=zl(u.href);var S=i.querySelector(Nu(b));if(S)return s.state.loading|=4,s.instance=S,Nn(S),S;p=uT(u),(b=yi.get(b))&&qy(p,b),S=(i.ownerDocument||i).createElement("link"),Nn(S);var A=S;return A._p=new Promise(function(Y,ne){A.onload=Y,A.onerror=ne}),hr(S,"link",p),s.state.loading|=4,mh(S,u.precedence,i),s.instance=S;case"script":return S=Fl(u.src),(b=i.querySelector(Au(S)))?(s.instance=b,Nn(b),b):(p=u,(b=yi.get(S))&&(p=h({},u),Vy(p,b)),i=i.ownerDocument||i,b=i.createElement("script"),Nn(b),hr(b,"link",p),i.head.appendChild(b),s.instance=b);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(p=s.instance,s.state.loading|=4,mh(p,u.precedence,i));return s.instance}function mh(i,s,u){for(var p=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=p.length?p[p.length-1]:null,S=b,A=0;A<p.length;A++){var Y=p[A];if(Y.dataset.precedence===s)S=Y;else if(S!==b)break}S?S.parentNode.insertBefore(i,S.nextSibling):(s=u.nodeType===9?u.head:u,s.insertBefore(i,s.firstChild))}function qy(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function Vy(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var gh=null;function fT(i,s,u){if(gh===null){var p=new Map,b=gh=new Map;b.set(u,p)}else b=gh,p=b.get(u),p||(p=new Map,b.set(u,p));if(p.has(i))return p;for(p.set(i,null),u=u.getElementsByTagName(i),b=0;b<u.length;b++){var S=u[b];if(!(S[_n]||S[Ye]||i==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var A=S.getAttribute(s)||"";A=i+A;var Y=p.get(A);Y?Y.push(S):p.set(A,[S])}}return p}function hT(i,s,u){i=i.ownerDocument||i,i.head.insertBefore(u,s==="title"?i.querySelector("head > title"):null)}function EP(i,s,u){if(u===1||s.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return i=s.disabled,typeof s.precedence=="string"&&i==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function pT(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function TP(i,s,u,p){if(u.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var b=zl(p.href),S=s.querySelector(Nu(b));if(S){s=S._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(i.count++,i=yh.bind(i),s.then(i,i)),u.state.loading|=4,u.instance=S,Nn(S);return}S=s.ownerDocument||s,p=uT(p),(b=yi.get(b))&&qy(p,b),S=S.createElement("link"),Nn(S);var A=S;A._p=new Promise(function(Y,ne){A.onload=Y,A.onerror=ne}),hr(S,"link",p),u.instance=S}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(u,s),(s=u.state.preload)&&(u.state.loading&3)===0&&(i.count++,u=yh.bind(i),s.addEventListener("load",u),s.addEventListener("error",u))}}var $y=0;function RP(i,s){return i.stylesheets&&i.count===0&&vh(i,i.stylesheets),0<i.count||0<i.imgCount?function(u){var p=setTimeout(function(){if(i.stylesheets&&vh(i,i.stylesheets),i.unsuspend){var S=i.unsuspend;i.unsuspend=null,S()}},6e4+s);0<i.imgBytes&&$y===0&&($y=62500*oP());var b=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&vh(i,i.stylesheets),i.unsuspend)){var S=i.unsuspend;i.unsuspend=null,S()}},(i.imgBytes>$y?50:800)+s);return i.unsuspend=u,function(){i.unsuspend=null,clearTimeout(p),clearTimeout(b)}}:null}function yh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)vh(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var bh=null;function vh(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,bh=new Map,s.forEach(CP,i),bh=null,yh.call(i))}function CP(i,s){if(!(s.state.loading&4)){var u=bh.get(i);if(u)var p=u.get(null);else{u=new Map,bh.set(i,u);for(var b=i.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<b.length;S++){var A=b[S];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(u.set(A.dataset.precedence,A),p=A)}p&&u.set(null,p)}b=s.instance,A=b.getAttribute("data-precedence"),S=u.get(A)||p,S===p&&u.set(null,b),u.set(A,b),this.count++,p=yh.bind(this),b.addEventListener("load",p),b.addEventListener("error",p),S?S.parentNode.insertBefore(b,S.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(b,i.firstChild)),s.state.loading|=4}}var Du={$$typeof:k,Provider:null,Consumer:null,_currentValue:V,_currentValue2:V,_threadCount:0};function kP(i,s,u,p,b,S,A,Y,ne){this.tag=1,this.containerInfo=i,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=hn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hn(0),this.hiddenUpdates=hn(null),this.identifierPrefix=p,this.onUncaughtError=b,this.onCaughtError=S,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ne,this.incompleteTransitions=new Map}function mT(i,s,u,p,b,S,A,Y,ne,ge,Me,Ie){return i=new kP(i,s,u,A,ne,ge,Me,Ie,Y),s=1,S===!0&&(s|=24),S=Kr(3,null,null,s),i.current=S,S.stateNode=i,s=Tg(),s.refCount++,i.pooledCache=s,s.refCount++,S.memoizedState={element:p,isDehydrated:u,cache:s},Mg(S),i}function gT(i){return i?(i=gl,i):gl}function yT(i,s,u,p,b,S){b=gT(b),p.context===null?p.context=b:p.pendingContext=b,p=sa(s),p.payload={element:u},S=S===void 0?null:S,S!==null&&(p.callback=S),u=la(i,p,s),u!==null&&(Lr(u,i,s),uu(u,i,s))}function bT(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<s?u:s}}function Gy(i,s){bT(i,s),(i=i.alternate)&&bT(i,s)}function vT(i){if(i.tag===13||i.tag===31){var s=fs(i,67108864);s!==null&&Lr(s,i,67108864),Gy(i,67108864)}}function xT(i){if(i.tag===13||i.tag===31){var s=Jr();s=de(s);var u=fs(i,s);u!==null&&Lr(u,i,s),Gy(i,s)}}var xh=!0;function MP(i,s,u,p){var b=j.T;j.T=null;var S=z.p;try{z.p=2,Yy(i,s,u,p)}finally{z.p=S,j.T=b}}function OP(i,s,u,p){var b=j.T;j.T=null;var S=z.p;try{z.p=8,Yy(i,s,u,p)}finally{z.p=S,j.T=b}}function Yy(i,s,u,p){if(xh){var b=Ky(p);if(b===null)_y(i,s,p,wh,u),ST(i,p);else if(AP(b,i,s,u,p))p.stopPropagation();else if(ST(i,p),s&4&&-1<NP.indexOf(i)){for(;b!==null;){var S=en(b);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var A=vt(S.pendingLanes);if(A!==0){var Y=S;for(Y.pendingLanes|=2,Y.entangledLanes|=2;A;){var ne=1<<31-nt(A);Y.entanglements[1]|=ne,A&=~ne}Qi(S),(pn&6)===0&&(rh=_e()+500,Cu(0))}}break;case 31:case 13:Y=fs(S,2),Y!==null&&Lr(Y,S,2),oh(),Gy(S,2)}if(S=Ky(p),S===null&&_y(i,s,p,wh,u),S===b)break;b=S}b!==null&&p.stopPropagation()}else _y(i,s,p,null,u)}}function Ky(i){return i=Xm(i),Wy(i)}var wh=null;function Wy(i){if(wh=null,i=jn(i),i!==null){var s=a(i);if(s===null)i=null;else{var u=s.tag;if(u===13){if(i=l(s),i!==null)return i;i=null}else if(u===31){if(i=c(s),i!==null)return i;i=null}else if(u===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null)}}return wh=i,null}function wT(i){switch(i){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(ut()){case pe:return 2;case Re:return 8;case ee:case fe:return 32;case Ne:return 268435456;default:return 32}default:return 32}}var Xy=!1,va=null,xa=null,wa=null,_u=new Map,Iu=new Map,Sa=[],NP="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 ST(i,s){switch(i){case"focusin":case"focusout":va=null;break;case"dragenter":case"dragleave":xa=null;break;case"mouseover":case"mouseout":wa=null;break;case"pointerover":case"pointerout":_u.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Iu.delete(s.pointerId)}}function Pu(i,s,u,p,b,S){return i===null||i.nativeEvent!==S?(i={blockedOn:s,domEventName:u,eventSystemFlags:p,nativeEvent:S,targetContainers:[b]},s!==null&&(s=en(s),s!==null&&vT(s)),i):(i.eventSystemFlags|=p,s=i.targetContainers,b!==null&&s.indexOf(b)===-1&&s.push(b),i)}function AP(i,s,u,p,b){switch(s){case"focusin":return va=Pu(va,i,s,u,p,b),!0;case"dragenter":return xa=Pu(xa,i,s,u,p,b),!0;case"mouseover":return wa=Pu(wa,i,s,u,p,b),!0;case"pointerover":var S=b.pointerId;return _u.set(S,Pu(_u.get(S)||null,i,s,u,p,b)),!0;case"gotpointercapture":return S=b.pointerId,Iu.set(S,Pu(Iu.get(S)||null,i,s,u,p,b)),!0}return!1}function ET(i){var s=jn(i.target);if(s!==null){var u=a(s);if(u!==null){if(s=u.tag,s===13){if(s=l(u),s!==null){i.blockedOn=s,it(i.priority,function(){xT(u)});return}}else if(s===31){if(s=c(u),s!==null){i.blockedOn=s,it(i.priority,function(){xT(u)});return}}else if(s===3&&u.stateNode.current.memoizedState.isDehydrated){i.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Sh(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var u=Ky(i.nativeEvent);if(u===null){u=i.nativeEvent;var p=new u.constructor(u.type,u);Wm=p,u.target.dispatchEvent(p),Wm=null}else return s=en(u),s!==null&&vT(s),i.blockedOn=u,!1;s.shift()}return!0}function TT(i,s,u){Sh(i)&&u.delete(s)}function DP(){Xy=!1,va!==null&&Sh(va)&&(va=null),xa!==null&&Sh(xa)&&(xa=null),wa!==null&&Sh(wa)&&(wa=null),_u.forEach(TT),Iu.forEach(TT)}function Eh(i,s){i.blockedOn===s&&(i.blockedOn=null,Xy||(Xy=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,DP)))}var Th=null;function RT(i){Th!==i&&(Th=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Th===i&&(Th=null);for(var s=0;s<i.length;s+=3){var u=i[s],p=i[s+1],b=i[s+2];if(typeof p!="function"){if(Wy(p||u)===null)continue;break}var S=en(u);S!==null&&(i.splice(s,3),s-=3,Kg(S,{pending:!0,data:b,method:u.method,action:p},p,b))}}))}function Bl(i){function s(ne){return Eh(ne,i)}va!==null&&Eh(va,i),xa!==null&&Eh(xa,i),wa!==null&&Eh(wa,i),_u.forEach(s),Iu.forEach(s);for(var u=0;u<Sa.length;u++){var p=Sa[u];p.blockedOn===i&&(p.blockedOn=null)}for(;0<Sa.length&&(u=Sa[0],u.blockedOn===null);)ET(u),u.blockedOn===null&&Sa.shift();if(u=(i.ownerDocument||i).$$reactFormReplay,u!=null)for(p=0;p<u.length;p+=3){var b=u[p],S=u[p+1],A=b[Xe]||null;if(typeof S=="function")A||RT(u);else if(A){var Y=null;if(S&&S.hasAttribute("formAction")){if(b=S,A=S[Xe]||null)Y=A.formAction;else if(Wy(b)!==null)continue}else Y=A.action;typeof Y=="function"?u[p+1]=Y:(u.splice(p,3),p-=3),RT(u)}}}function CT(){function i(S){S.canIntercept&&S.info==="react-transition"&&S.intercept({handler:function(){return new Promise(function(A){return b=A})},focusReset:"manual",scroll:"manual"})}function s(){b!==null&&(b(),b=null),p||setTimeout(u,20)}function u(){if(!p&&!navigation.transition){var S=navigation.currentEntry;S&&S.url!=null&&navigation.navigate(S.url,{state:S.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,b=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(u,100),function(){p=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),b!==null&&(b(),b=null)}}}function Qy(i){this._internalRoot=i}Rh.prototype.render=Qy.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));var u=s.current,p=Jr();yT(u,p,i,s,null,null)},Rh.prototype.unmount=Qy.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;yT(i.current,2,null,i,null,null),oh(),s[at]=null}};function Rh(i){this._internalRoot=i}Rh.prototype.unstable_scheduleHydration=function(i){if(i){var s=je();i={blockedOn:null,target:i,priority:s};for(var u=0;u<Sa.length&&s!==0&&s<Sa[u].priority;u++);Sa.splice(u,0,i),u===0&&ET(i)}};var kT=t.version;if(kT!=="19.2.4")throw Error(r(527,kT,"19.2.4"));z.findDOMNode=function(i){var s=i._reactInternals;if(s===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=d(s),i=i!==null?m(i):null,i=i===null?null:i.stateNode,i};var _P={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ch=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ch.isDisabled&&Ch.supportsFiber)try{et=Ch.inject(_P),ze=Ch}catch{}}return ju.createRoot=function(i,s){if(!o(i))throw Error(r(299));var u=!1,p="",b=I1,S=P1,A=L1;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(b=s.onUncaughtError),s.onCaughtError!==void 0&&(S=s.onCaughtError),s.onRecoverableError!==void 0&&(A=s.onRecoverableError)),s=mT(i,1,!1,null,null,u,p,null,b,S,A,CT),i[at]=s.current,Dy(i),new Qy(s)},ju.hydrateRoot=function(i,s,u){if(!o(i))throw Error(r(299));var p=!1,b="",S=I1,A=P1,Y=L1,ne=null;return u!=null&&(u.unstable_strictMode===!0&&(p=!0),u.identifierPrefix!==void 0&&(b=u.identifierPrefix),u.onUncaughtError!==void 0&&(S=u.onUncaughtError),u.onCaughtError!==void 0&&(A=u.onCaughtError),u.onRecoverableError!==void 0&&(Y=u.onRecoverableError),u.formState!==void 0&&(ne=u.formState)),s=mT(i,1,!0,s,u??null,p,b,ne,S,A,Y,CT),s.context=gT(null),u=s.current,p=Jr(),p=de(p),b=sa(p),b.callback=null,la(u,b,p),u=p,s.current.lanes=u,qt(s,u),Qi(s),i[at]=s.current,Dy(i),new Rh(s)},ju.version="19.2.4",ju}var tR;function Xz(){if(tR)return ib.exports;tR=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(),ib.exports=Wz(),ib.exports}var Qz=Xz();/**
|
|
66
|
+
* react-router v7.13.0
|
|
67
|
+
*
|
|
68
|
+
* Copyright (c) Remix Software Inc.
|
|
69
|
+
*
|
|
70
|
+
* This source code is licensed under the MIT license found in the
|
|
71
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
72
|
+
*
|
|
73
|
+
* @license MIT
|
|
74
|
+
*/var r2=e=>{throw TypeError(e)},Zz=(e,t,n)=>t.has(e)||r2("Cannot "+n),lb=(e,t,n)=>(Zz(e,t,"read from private field"),n?n.call(e):t.get(e)),Jz=(e,t,n)=>t.has(e)?r2("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),nR="popstate";function e4(e={}){function t(r,o){let{pathname:a,search:l,hash:c}=r.location;return Rd("",{pathname:a,search:l,hash:c},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:lo(o)}return n4(t,n,null,e)}function $t(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Zn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function t4(){return Math.random().toString(36).substring(2,10)}function rR(e,t){return{usr:e.state,key:e.key,idx:t}}function Rd(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Za(t):t,state:n,key:t&&t.key||r||t4()}}function lo({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Za(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function n4(e,t,n,r={}){let{window:o=document.defaultView,v5Compat:a=!1}=r,l=o.history,c="POP",f=null,d=m();d==null&&(d=0,l.replaceState({...l.state,idx:d},""));function m(){return(l.state||{idx:null}).idx}function h(){c="POP";let R=m(),T=R==null?null:R-d;d=R,f&&f({action:c,location:E.location,delta:T})}function y(R,T){c="PUSH";let C=Rd(E.location,R,T);d=m()+1;let k=rR(C,d),M=E.createHref(C);try{l.pushState(k,"",M)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;o.location.assign(M)}a&&f&&f({action:c,location:E.location,delta:1})}function g(R,T){c="REPLACE";let C=Rd(E.location,R,T);d=m();let k=rR(C,d),M=E.createHref(C);l.replaceState(k,"",M),a&&f&&f({action:c,location:E.location,delta:0})}function x(R){return i2(R)}let E={get action(){return c},get location(){return e(o,l)},listen(R){if(f)throw new Error("A history only accepts one active listener");return o.addEventListener(nR,h),f=R,()=>{o.removeEventListener(nR,h),f=null}},createHref(R){return t(o,R)},createURL:x,encodeLocation(R){let T=x(R);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:y,replace:g,go(R){return l.go(R)}};return E}function i2(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),$t(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:lo(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Ju,iR=class{constructor(e){if(Jz(this,Ju,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(lb(this,Ju).has(e))return lb(this,Ju).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){lb(this,Ju).set(e,t)}};Ju=new WeakMap;var r4=new Set(["lazy","caseSensitive","path","id","index","children"]);function i4(e){return r4.has(e)}var o4=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function a4(e){return o4.has(e)}function s4(e){return e.index===!0}function Cd(e,t,n=[],r={},o=!1){return e.map((a,l)=>{let c=[...n,String(l)],f=typeof a.id=="string"?a.id:c.join("-");if($t(a.index!==!0||!a.children,"Cannot specify children on an index route"),$t(o||!r[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),s4(a)){let d={...a,id:f};return r[f]=oR(d,t(d)),d}else{let d={...a,id:f,children:void 0};return r[f]=oR(d,t(d)),a.children&&(d.children=Cd(a.children,t,c,r,o)),d}})}function oR(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Oa(e,t,n="/"){return ed(e,t,n,!1)}function ed(e,t,n,r){let o=typeof t=="string"?Za(t):t,a=Ci(o.pathname||"/",n);if(a==null)return null;let l=o2(e);c4(l);let c=null;for(let f=0;c==null&&f<l.length;++f){let d=s2(a);c=b4(l[f],d,r)}return c}function l4(e,t){let{route:n,pathname:r,params:o}=e;return{id:n.id,pathname:r,params:o,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function o2(e,t=[],n=[],r="",o=!1){let a=(l,c,f=o,d)=>{let m={relativePath:d===void 0?l.path||"":d,caseSensitive:l.caseSensitive===!0,childrenIndex:c,route:l};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&f)return;$t(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let h=oo([r,m.relativePath]),y=n.concat(m);l.children&&l.children.length>0&&($t(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),o2(l.children,t,y,h,f)),!(l.path==null&&!l.index)&&t.push({path:h,score:g4(h,l.index),routesMeta:y})};return e.forEach((l,c)=>{var f;if(l.path===""||!((f=l.path)!=null&&f.includes("?")))a(l,c);else for(let d of a2(l.path))a(l,c,!0,d)}),t}function a2(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return o?[a,""]:[a];let l=a2(r.join("/")),c=[];return c.push(...l.map(f=>f===""?a:[a,f].join("/"))),o&&c.push(...l),c.map(f=>e.startsWith("/")&&f===""?"/":f)}function c4(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:y4(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var u4=/^:[\w-]+$/,d4=3,f4=2,h4=1,p4=10,m4=-2,aR=e=>e==="*";function g4(e,t){let n=e.split("/"),r=n.length;return n.some(aR)&&(r+=m4),t&&(r+=f4),n.filter(o=>!aR(o)).reduce((o,a)=>o+(u4.test(a)?d4:a===""?h4:p4),r)}function y4(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function b4(e,t,n=!1){let{routesMeta:r}=e,o={},a="/",l=[];for(let c=0;c<r.length;++c){let f=r[c],d=c===r.length-1,m=a==="/"?t:t.slice(a.length)||"/",h=Ws({path:f.relativePath,caseSensitive:f.caseSensitive,end:d},m),y=f.route;if(!h&&d&&n&&!r[r.length-1].route.index&&(h=Ws({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},m)),!h)return null;Object.assign(o,h.params),l.push({params:o,pathname:oo([a,h.pathname]),pathnameBase:S4(oo([a,h.pathnameBase])),route:y}),h.pathnameBase!=="/"&&(a=oo([a,h.pathnameBase]))}return l}function Ws(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=v4(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let a=o[0],l=a.replace(/(.)\/+$/,"$1"),c=o.slice(1);return{params:r.reduce((d,{paramName:m,isOptional:h},y)=>{if(m==="*"){let x=c[y]||"";l=a.slice(0,a.length-x.length).replace(/(.)\/+$/,"$1")}const g=c[y];return h&&!g?d[m]=void 0:d[m]=(g||"").replace(/%2F/g,"/"),d},{}),pathname:a,pathnameBase:l,pattern:e}}function v4(e,t=!1,n=!0){Zn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,c,f)=>(r.push({paramName:c,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function s2(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Zn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ci(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function x4({basename:e,pathname:t}){return t==="/"?e:oo([e,t])}var l2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Yx=e=>l2.test(e);function w4(e,t="/"){let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Za(e):e,a;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?a=sR(n.substring(1),"/"):a=sR(n,t)):a=t,{pathname:a,search:E4(r),hash:T4(o)}}function sR(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function cb(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function c2(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Kx(e){let t=c2(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Wx(e,t,n,r=!1){let o;typeof e=="string"?o=Za(e):(o={...e},$t(!o.pathname||!o.pathname.includes("?"),cb("?","pathname","search",o)),$t(!o.pathname||!o.pathname.includes("#"),cb("#","pathname","hash",o)),$t(!o.search||!o.search.includes("#"),cb("#","search","hash",o)));let a=e===""||o.pathname==="",l=a?"/":o.pathname,c;if(l==null)c=n;else{let h=t.length-1;if(!r&&l.startsWith("..")){let y=l.split("/");for(;y[0]==="..";)y.shift(),h-=1;o.pathname=y.join("/")}c=h>=0?t[h]:"/"}let f=w4(o,c),d=l&&l!=="/"&&l.endsWith("/"),m=(a||l===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(d||m)&&(f.pathname+="/"),f}var oo=e=>e.join("/").replace(/\/\/+/g,"/"),S4=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),E4=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,T4=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,$d=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function kd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Gd(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var u2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function d2(e,t){let n=e;if(typeof n!="string"||!l2.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,o=!1;if(u2)try{let a=new URL(window.location.href),l=n.startsWith("//")?new URL(a.protocol+n):new URL(n),c=Ci(l.pathname,t);l.origin===a.origin&&c!=null?n=c+l.search+l.hash:o=!0}catch{Zn(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:o,to:n}}var Ba=Symbol("Uninstrumented");function R4(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(o=>o({id:t.id,index:t.index,path:t.path,instrument(a){let l=Object.keys(n);for(let c of l)a[c]&&n[c].push(a[c])}}));let r={};if(typeof t.lazy=="function"&&n.lazy.length>0){let o=Ql(n.lazy,t.lazy,()=>{});o&&(r.lazy=o)}if(typeof t.lazy=="object"){let o=t.lazy;["middleware","loader","action"].forEach(a=>{let l=o[a],c=n[`lazy.${a}`];if(typeof l=="function"&&c.length>0){let f=Ql(c,l,()=>{});f&&(r.lazy=Object.assign(r.lazy||{},{[a]:f}))}})}return["loader","action"].forEach(o=>{let a=t[o];if(typeof a=="function"&&n[o].length>0){let l=a[Ba]??a,c=Ql(n[o],l,(...f)=>lR(f[0]));c&&(o==="loader"&&l.hydrate===!0&&(c.hydrate=!0),c[Ba]=l,r[o]=c)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(o=>{let a=o[Ba]??o,l=Ql(n.middleware,a,(...c)=>lR(c[0]));return l?(l[Ba]=a,l):o})),r}function C4(e,t){let n={navigate:[],fetch:[]};if(t.forEach(r=>r({instrument(o){let a=Object.keys(o);for(let l of a)o[l]&&n[l].push(o[l])}})),n.navigate.length>0){let r=e.navigate[Ba]??e.navigate,o=Ql(n.navigate,r,(...a)=>{let[l,c]=a;return{to:typeof l=="number"||typeof l=="string"?l:l?lo(l):".",...cR(e,c??{})}});o&&(o[Ba]=r,e.navigate=o)}if(n.fetch.length>0){let r=e.fetch[Ba]??e.fetch,o=Ql(n.fetch,r,(...a)=>{let[l,,c,f]=a;return{href:c??".",fetcherKey:l,...cR(e,f??{})}});o&&(o[Ba]=r,e.fetch=o)}return e}function Ql(e,t,n){return e.length===0?null:async(...r)=>{let o=await f2(e,n(...r),()=>t(...r),e.length-1);if(o.type==="error")throw o.value;return o.value}}async function f2(e,t,n,r){let o=e[r],a;if(o){let l,c=async()=>(l?console.error("You cannot call instrumented handlers more than once"):l=f2(e,t,n,r-1),a=await l,$t(a,"Expected a result"),a.type==="error"&&a.value instanceof Error?{status:"error",error:a.value}:{status:"success",error:void 0});try{await o(c,t)}catch(f){console.error("An instrumentation function threw an error:",f)}l||await c(),await l}else try{a={type:"success",value:await n()}}catch(l){a={type:"error",value:l}}return a||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function lR(e){let{request:t,context:n,params:r,unstable_pattern:o}=e;return{request:k4(t),params:{...r},unstable_pattern:o,context:M4(n)}}function cR(e,t){return{currentUrl:lo(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function k4(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function M4(e){if(N4(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var O4=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function N4(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===O4}var h2=["POST","PUT","PATCH","DELETE"],A4=new Set(h2),D4=["GET",...h2],_4=new Set(D4),p2=new Set([301,302,303,307,308]),I4=new Set([307,308]),ub={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},P4={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},zu={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},L4=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),m2="remix-router-transitions",g2=Symbol("ResetLoaderData");function j4(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";$t(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],o=e.mapRouteProperties||L4,a=o;if(e.unstable_instrumentations){let X=e.unstable_instrumentations;a=ie=>({...o(ie),...R4(X.map(de=>de.route).filter(Boolean),ie)})}let l={},c=Cd(e.routes,a,void 0,l),f,d=e.basename||"/";d.startsWith("/")||(d=`/${d}`);let m=e.dataStrategy||H4,h={...e.future},y=null,g=new Set,x=null,E=null,R=null,T=e.hydrationData!=null,C=Oa(c,e.history.location,d),k=!1,M=null,D;if(C==null&&!e.patchRoutesOnNavigation){let X=vi(404,{pathname:e.history.location.pathname}),{matches:ie,route:de}=Oh(c);D=!0,C=ie,M={[de.id]:X}}else if(C&&!e.hydrationData&&kt(C,c,e.history.location.pathname).active&&(C=null),C)if(C.some(X=>X.route.lazy))D=!1;else if(!C.some(X=>Xx(X.route)))D=!0;else{let X=e.hydrationData?e.hydrationData.loaderData:null,ie=e.hydrationData?e.hydrationData.errors:null;if(ie){let de=C.findIndex(ke=>ie[ke.route.id]!==void 0);D=C.slice(0,de+1).every(ke=>!_v(ke.route,X,ie))}else D=C.every(de=>!_v(de.route,X,ie))}else{D=!1,C=[];let X=kt(null,c,e.history.location.pathname);X.active&&X.matches&&(k=!0,C=X.matches)}let O,N={historyAction:e.history.action,location:e.history.location,matches:C,initialized:D,navigation:ub,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||M,fetchers:new Map,blockers:new Map},_="POP",q=null,F=!1,G,P=!1,U=new Map,H=null,B=!1,j=!1,z=new Set,V=new Map,K=0,L=-1,$=new Map,W=new Set,I=new Map,Q=new Map,le=new Set,oe=new Map,Z,ue=null;function ve(){if(y=e.history.listen(({action:X,location:ie,delta:de})=>{if(Z){Z(),Z=void 0;return}Zn(oe.size===0||de!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ke=ot({currentLocation:N.location,nextLocation:ie,historyAction:X});if(ke&&de!=null){let je=new Promise(it=>{Z=it});e.history.go(de*-1),Dt(ke,{state:"blocked",location:ie,proceed(){Dt(ke,{state:"proceeding",proceed:void 0,reset:void 0,location:ie}),je.then(()=>e.history.go(de))},reset(){let it=new Map(N.blockers);it.set(ke,zu),te({blockers:it})}}),q==null||q.resolve(),q=null;return}return Oe(X,ie)}),n){a5(t,U);let X=()=>s5(t,U);t.addEventListener("pagehide",X),H=()=>t.removeEventListener("pagehide",X)}return N.initialized||Oe("POP",N.location,{initialHydration:!0}),O}function Se(){y&&y(),H&&H(),g.clear(),G&&G.abort(),N.fetchers.forEach((X,ie)=>$e(ie)),N.blockers.forEach((X,ie)=>bt(ie))}function Pe(X){return g.add(X),()=>g.delete(X)}function te(X,ie={}){X.matches&&(X.matches=X.matches.map(je=>{let it=l[je.route.id],rt=je.route;return rt.element!==it.element||rt.errorElement!==it.errorElement||rt.hydrateFallbackElement!==it.hydrateFallbackElement?{...je,route:it}:je})),N={...N,...X};let de=[],ke=[];N.fetchers.forEach((je,it)=>{je.state==="idle"&&(le.has(it)?de.push(it):ke.push(it))}),le.forEach(je=>{!N.fetchers.has(je)&&!V.has(je)&&de.push(je)}),[...g].forEach(je=>je(N,{deletedFetchers:de,newErrors:X.errors??null,viewTransitionOpts:ie.viewTransitionOpts,flushSync:ie.flushSync===!0})),de.forEach(je=>$e(je)),ke.forEach(je=>N.fetchers.delete(je))}function he(X,ie,{flushSync:de}={}){var Et,pt;let ke=N.actionData!=null&&N.navigation.formMethod!=null&&xr(N.navigation.formMethod)&&N.navigation.state==="loading"&&((Et=X.state)==null?void 0:Et._isRedirect)!==!0,je;ie.actionData?Object.keys(ie.actionData).length>0?je=ie.actionData:je=null:ke?je=N.actionData:je=null;let it=ie.loaderData?vR(N.loaderData,ie.loaderData,ie.matches||[],ie.errors):N.loaderData,rt=N.blockers;rt.size>0&&(rt=new Map(rt),rt.forEach((Pt,Yt)=>rt.set(Yt,zu)));let Ye=B?!1:Lt(X,ie.matches||N.matches),Xe=F===!0||N.navigation.formMethod!=null&&xr(N.navigation.formMethod)&&((pt=X.state)==null?void 0:pt._isRedirect)!==!0;f&&(c=f,f=void 0),B||_==="POP"||(_==="PUSH"?e.history.push(X,X.state):_==="REPLACE"&&e.history.replace(X,X.state));let at;if(_==="POP"){let Pt=U.get(N.location.pathname);Pt&&Pt.has(X.pathname)?at={currentLocation:N.location,nextLocation:X}:U.has(X.pathname)&&(at={currentLocation:X,nextLocation:N.location})}else if(P){let Pt=U.get(N.location.pathname);Pt?Pt.add(X.pathname):(Pt=new Set([X.pathname]),U.set(N.location.pathname,Pt)),at={currentLocation:N.location,nextLocation:X}}te({...ie,actionData:je,loaderData:it,historyAction:_,location:X,initialized:!0,navigation:ub,revalidation:"idle",restoreScrollPosition:Ye,preventScrollReset:Xe,blockers:rt},{viewTransitionOpts:at,flushSync:de===!0}),_="POP",F=!1,P=!1,B=!1,j=!1,q==null||q.resolve(),q=null,ue==null||ue.resolve(),ue=null}async function ye(X,ie){if(q==null||q.resolve(),q=null,typeof X=="number"){q||(q=ER());let Yt=q.promise;return e.history.go(X),Yt}let de=Dv(N.location,N.matches,d,X,ie==null?void 0:ie.fromRouteId,ie==null?void 0:ie.relative),{path:ke,submission:je,error:it}=uR(!1,de,ie),rt=N.location,Ye=Rd(N.location,ke,ie&&ie.state);Ye={...Ye,...e.history.encodeLocation(Ye)};let Xe=ie&&ie.replace!=null?ie.replace:void 0,at="PUSH";Xe===!0?at="REPLACE":Xe===!1||je!=null&&xr(je.formMethod)&&je.formAction===N.location.pathname+N.location.search&&(at="REPLACE");let Et=ie&&"preventScrollReset"in ie?ie.preventScrollReset===!0:void 0,pt=(ie&&ie.flushSync)===!0,Pt=ot({currentLocation:rt,nextLocation:Ye,historyAction:at});if(Pt){Dt(Pt,{state:"blocked",location:Ye,proceed(){Dt(Pt,{state:"proceeding",proceed:void 0,reset:void 0,location:Ye}),ye(X,ie)},reset(){let Yt=new Map(N.blockers);Yt.set(Pt,zu),te({blockers:Yt})}});return}await Oe(at,Ye,{submission:je,pendingError:it,preventScrollReset:Et,replace:ie&&ie.replace,enableViewTransition:ie&&ie.viewTransition,flushSync:pt,callSiteDefaultShouldRevalidate:ie&&ie.unstable_defaultShouldRevalidate})}function Le(){ue||(ue=ER()),Re(),te({revalidation:"loading"});let X=ue.promise;return N.navigation.state==="submitting"?X:N.navigation.state==="idle"?(Oe(N.historyAction,N.location,{startUninterruptedRevalidation:!0}),X):(Oe(_||N.historyAction,N.navigation.location,{overrideNavigation:N.navigation,enableViewTransition:P===!0}),X)}async function Oe(X,ie,de){G&&G.abort(),G=null,_=X,B=(de&&de.startUninterruptedRevalidation)===!0,Mt(N.location,N.matches),F=(de&&de.preventScrollReset)===!0,P=(de&&de.enableViewTransition)===!0;let ke=f||c,je=de&&de.overrideNavigation,it=de!=null&&de.initialHydration&&N.matches&&N.matches.length>0&&!k?N.matches:Oa(ke,ie,d),rt=(de&&de.flushSync)===!0;if(it&&N.initialized&&!j&&X4(N.location,ie)&&!(de&&de.submission&&xr(de.submission.formMethod))){he(ie,{matches:it},{flushSync:rt});return}let Ye=kt(it,ke,ie.pathname);if(Ye.active&&Ye.matches&&(it=Ye.matches),!it){let{error:Ln,notFoundMatches:jn,route:en}=ft(ie.pathname);he(ie,{matches:jn,loaderData:{},errors:{[en.id]:Ln}},{flushSync:rt});return}G=new AbortController;let Xe=Kl(e.history,ie,G.signal,de&&de.submission),at=e.getContext?await e.getContext():new iR,Et;if(de&&de.pendingError)Et=[Na(it).route.id,{type:"error",error:de.pendingError}];else if(de&&de.submission&&xr(de.submission.formMethod)){let Ln=await Te(Xe,ie,de.submission,it,at,Ye.active,de&&de.initialHydration===!0,{replace:de.replace,flushSync:rt});if(Ln.shortCircuited)return;if(Ln.pendingActionResult){let[jn,en]=Ln.pendingActionResult;if(ti(en)&&kd(en.error)&&en.error.status===404){G=null,he(ie,{matches:Ln.matches,loaderData:{},errors:{[jn]:en.error}});return}}it=Ln.matches||it,Et=Ln.pendingActionResult,je=db(ie,de.submission),rt=!1,Ye.active=!1,Xe=Kl(e.history,Xe.url,Xe.signal)}let{shortCircuited:pt,matches:Pt,loaderData:Yt,errors:_n}=await Ce(Xe,ie,it,at,Ye.active,je,de&&de.submission,de&&de.fetcherSubmission,de&&de.replace,de&&de.initialHydration===!0,rt,Et,de&&de.callSiteDefaultShouldRevalidate);pt||(G=null,he(ie,{matches:Pt||it,...xR(Et),loaderData:Yt,errors:_n}))}async function Te(X,ie,de,ke,je,it,rt,Ye={}){Re();let Xe=i5(ie,de);if(te({navigation:Xe},{flushSync:Ye.flushSync===!0}),it){let pt=await hn(ke,ie.pathname,X.signal);if(pt.type==="aborted")return{shortCircuited:!0};if(pt.type==="error"){if(pt.partialMatches.length===0){let{matches:Yt,route:_n}=Oh(c);return{matches:Yt,pendingActionResult:[_n.id,{type:"error",error:pt.error}]}}let Pt=Na(pt.partialMatches).route.id;return{matches:pt.partialMatches,pendingActionResult:[Pt,{type:"error",error:pt.error}]}}else if(pt.matches)ke=pt.matches;else{let{notFoundMatches:Pt,error:Yt,route:_n}=ft(ie.pathname);return{matches:Pt,pendingActionResult:[_n.id,{type:"error",error:Yt}]}}}let at,Et=ap(ke,ie);if(!Et.route.action&&!Et.route.lazy)at={type:"error",error:vi(405,{method:X.method,pathname:ie.pathname,routeId:Et.route.id})};else{let pt=ec(a,l,X,ke,Et,rt?[]:r,je),Pt=await ut(X,pt,je,null);if(at=Pt[Et.route.id],!at){for(let Yt of ke)if(Pt[Yt.route.id]){at=Pt[Yt.route.id];break}}if(X.signal.aborted)return{shortCircuited:!0}}if(As(at)){let pt;return Ye&&Ye.replace!=null?pt=Ye.replace:pt=gR(at.response.headers.get("Location"),new URL(X.url),d,e.history)===N.location.pathname+N.location.search,await _e(X,at,!0,{submission:de,replace:pt}),{shortCircuited:!0}}if(ti(at)){let pt=Na(ke,Et.route.id);return(Ye&&Ye.replace)!==!0&&(_="PUSH"),{matches:ke,pendingActionResult:[pt.route.id,at,Et.route.id]}}return{matches:ke,pendingActionResult:[Et.route.id,at]}}async function Ce(X,ie,de,ke,je,it,rt,Ye,Xe,at,Et,pt,Pt){let Yt=it||db(ie,rt),_n=rt||Ye||SR(Yt),Ln=!B&&!at;if(je){if(Ln){let qn=J(pt);te({navigation:Yt,...qn!==void 0?{actionData:qn}:{}},{flushSync:Et})}let tn=await hn(de,ie.pathname,X.signal);if(tn.type==="aborted")return{shortCircuited:!0};if(tn.type==="error"){if(tn.partialMatches.length===0){let{matches:Di,route:cr}=Oh(c);return{matches:Di,loaderData:{},errors:{[cr.id]:tn.error}}}let qn=Na(tn.partialMatches).route.id;return{matches:tn.partialMatches,loaderData:{},errors:{[qn]:tn.error}}}else if(tn.matches)de=tn.matches;else{let{error:qn,notFoundMatches:Di,route:cr}=ft(ie.pathname);return{matches:Di,loaderData:{},errors:{[cr.id]:qn}}}}let jn=f||c,{dsMatches:en,revalidatingFetchers:ir}=dR(X,ke,a,l,e.history,N,de,_n,ie,at?[]:r,at===!0,j,z,le,I,W,jn,d,e.patchRoutesOnNavigation!=null,pt,Pt);if(L=++K,!e.dataStrategy&&!en.some(tn=>tn.shouldLoad)&&!en.some(tn=>tn.route.middleware&&tn.route.middleware.length>0)&&ir.length===0){let tn=nt();return he(ie,{matches:de,loaderData:{},errors:pt&&ti(pt[1])?{[pt[0]]:pt[1].error}:null,...xR(pt),...tn?{fetchers:new Map(N.fetchers)}:{}},{flushSync:Et}),{shortCircuited:!0}}if(Ln){let tn={};if(!je){tn.navigation=Yt;let qn=J(pt);qn!==void 0&&(tn.actionData=qn)}ir.length>0&&(tn.fetchers=Ee(ir)),te(tn,{flushSync:Et})}ir.forEach(tn=>{ze(tn.key),tn.controller&&V.set(tn.key,tn.controller)});let Nr=()=>ir.forEach(tn=>ze(tn.key));G&&G.signal.addEventListener("abort",Nr);let{loaderResults:Nn,fetcherResults:Ni}=await pe(en,ir,X,ke);if(X.signal.aborted)return{shortCircuited:!0};G&&G.signal.removeEventListener("abort",Nr),ir.forEach(tn=>V.delete(tn.key));let Gr=Nh(Nn);if(Gr)return await _e(X,Gr.result,!0,{replace:Xe}),{shortCircuited:!0};if(Gr=Nh(Ni),Gr)return W.add(Gr.key),await _e(X,Gr.result,!0,{replace:Xe}),{shortCircuited:!0};let{loaderData:Ai,errors:li}=bR(N,de,Nn,pt,ir,Ni);at&&N.errors&&(li={...N.errors,...li});let yo=nt(),as=Ct(L),ss=yo||as||ir.length>0;return{matches:de,loaderData:Ai,errors:li,...ss?{fetchers:new Map(N.fetchers)}:{}}}function J(X){if(X&&!ti(X[1]))return{[X[0]]:X[1].data};if(N.actionData)return Object.keys(N.actionData).length===0?null:N.actionData}function Ee(X){return X.forEach(ie=>{let de=N.fetchers.get(ie.key),ke=Fu(void 0,de?de.data:void 0);N.fetchers.set(ie.key,ke)}),new Map(N.fetchers)}async function xe(X,ie,de,ke){ze(X);let je=(ke&&ke.flushSync)===!0,it=f||c,rt=Dv(N.location,N.matches,d,de,ie,ke==null?void 0:ke.relative),Ye=Oa(it,rt,d),Xe=kt(Ye,it,rt);if(Xe.active&&Xe.matches&&(Ye=Xe.matches),!Ye){fe(X,ie,vi(404,{pathname:rt}),{flushSync:je});return}let{path:at,submission:Et,error:pt}=uR(!0,rt,ke);if(pt){fe(X,ie,pt,{flushSync:je});return}let Pt=e.getContext?await e.getContext():new iR,Yt=(ke&&ke.preventScrollReset)===!0;if(Et&&xr(Et.formMethod)){await Be(X,ie,at,Ye,Pt,Xe.active,je,Yt,Et,ke&&ke.unstable_defaultShouldRevalidate);return}I.set(X,{routeId:ie,path:at}),await Ve(X,ie,at,Ye,Pt,Xe.active,je,Yt,Et)}async function Be(X,ie,de,ke,je,it,rt,Ye,Xe,at){Re(),I.delete(X);let Et=N.fetchers.get(X);ee(X,o5(Xe,Et),{flushSync:rt});let pt=new AbortController,Pt=Kl(e.history,de,pt.signal,Xe);if(it){let nn=await hn(ke,new URL(Pt.url).pathname,Pt.signal,X);if(nn.type==="aborted")return;if(nn.type==="error"){fe(X,ie,nn.error,{flushSync:rt});return}else if(nn.matches)ke=nn.matches;else{fe(X,ie,vi(404,{pathname:de}),{flushSync:rt});return}}let Yt=ap(ke,de);if(!Yt.route.action&&!Yt.route.lazy){let nn=vi(405,{method:Xe.formMethod,pathname:de,routeId:ie});fe(X,ie,nn,{flushSync:rt});return}V.set(X,pt);let _n=K,Ln=ec(a,l,Pt,ke,Yt,r,je),jn=await ut(Pt,Ln,je,X),en=jn[Yt.route.id];if(!en){for(let nn of Ln)if(jn[nn.route.id]){en=jn[nn.route.id];break}}if(Pt.signal.aborted){V.get(X)===pt&&V.delete(X);return}if(le.has(X)){if(As(en)||ti(en)){ee(X,jo(void 0));return}}else{if(As(en))if(V.delete(X),L>_n){ee(X,jo(void 0));return}else return W.add(X),ee(X,Fu(Xe)),_e(Pt,en,!1,{fetcherSubmission:Xe,preventScrollReset:Ye});if(ti(en)){fe(X,ie,en.error);return}}let ir=N.navigation.location||N.location,Nr=Kl(e.history,ir,pt.signal),Nn=f||c,Ni=N.navigation.state!=="idle"?Oa(Nn,N.navigation.location,d):N.matches;$t(Ni,"Didn't find any matches after fetcher action");let Gr=++K;$.set(X,Gr);let Ai=Fu(Xe,en.data);N.fetchers.set(X,Ai);let{dsMatches:li,revalidatingFetchers:yo}=dR(Nr,je,a,l,e.history,N,Ni,Xe,ir,r,!1,j,z,le,I,W,Nn,d,e.patchRoutesOnNavigation!=null,[Yt.route.id,en],at);yo.filter(nn=>nn.key!==X).forEach(nn=>{let ls=nn.key,gf=N.fetchers.get(ls),Kc=Fu(void 0,gf?gf.data:void 0);N.fetchers.set(ls,Kc),ze(ls),nn.controller&&V.set(ls,nn.controller)}),te({fetchers:new Map(N.fetchers)});let as=()=>yo.forEach(nn=>ze(nn.key));pt.signal.addEventListener("abort",as);let{loaderResults:ss,fetcherResults:tn}=await pe(li,yo,Nr,je);if(pt.signal.aborted)return;if(pt.signal.removeEventListener("abort",as),$.delete(X),V.delete(X),yo.forEach(nn=>V.delete(nn.key)),N.fetchers.has(X)){let nn=jo(en.data);N.fetchers.set(X,nn)}let qn=Nh(ss);if(qn)return _e(Nr,qn.result,!1,{preventScrollReset:Ye});if(qn=Nh(tn),qn)return W.add(qn.key),_e(Nr,qn.result,!1,{preventScrollReset:Ye});let{loaderData:Di,errors:cr}=bR(N,Ni,ss,void 0,yo,tn);Ct(Gr),N.navigation.state==="loading"&&Gr>L?($t(_,"Expected pending action"),G&&G.abort(),he(N.navigation.location,{matches:Ni,loaderData:Di,errors:cr,fetchers:new Map(N.fetchers)})):(te({errors:cr,loaderData:vR(N.loaderData,Di,Ni,cr),fetchers:new Map(N.fetchers)}),j=!1)}async function Ve(X,ie,de,ke,je,it,rt,Ye,Xe){let at=N.fetchers.get(X);ee(X,Fu(Xe,at?at.data:void 0),{flushSync:rt});let Et=new AbortController,pt=Kl(e.history,de,Et.signal);if(it){let en=await hn(ke,new URL(pt.url).pathname,pt.signal,X);if(en.type==="aborted")return;if(en.type==="error"){fe(X,ie,en.error,{flushSync:rt});return}else if(en.matches)ke=en.matches;else{fe(X,ie,vi(404,{pathname:de}),{flushSync:rt});return}}let Pt=ap(ke,de);V.set(X,Et);let Yt=K,_n=ec(a,l,pt,ke,Pt,r,je),jn=(await ut(pt,_n,je,X))[Pt.route.id];if(V.get(X)===Et&&V.delete(X),!pt.signal.aborted){if(le.has(X)){ee(X,jo(void 0));return}if(As(jn))if(L>Yt){ee(X,jo(void 0));return}else{W.add(X),await _e(pt,jn,!1,{preventScrollReset:Ye});return}if(ti(jn)){fe(X,ie,jn.error);return}ee(X,jo(jn.data))}}async function _e(X,ie,de,{submission:ke,fetcherSubmission:je,preventScrollReset:it,replace:rt}={}){de||(q==null||q.resolve(),q=null),ie.response.headers.has("X-Remix-Revalidate")&&(j=!0);let Ye=ie.response.headers.get("Location");$t(Ye,"Expected a Location header on the redirect Response"),Ye=gR(Ye,new URL(X.url),d,e.history);let Xe=Rd(N.location,Ye,{_isRedirect:!0});if(n){let _n=!1;if(ie.response.headers.has("X-Remix-Reload-Document"))_n=!0;else if(Yx(Ye)){const Ln=i2(Ye,!0);_n=Ln.origin!==t.location.origin||Ci(Ln.pathname,d)==null}if(_n){rt?t.location.replace(Ye):t.location.assign(Ye);return}}G=null;let at=rt===!0||ie.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Et,formAction:pt,formEncType:Pt}=N.navigation;!ke&&!je&&Et&&pt&&Pt&&(ke=SR(N.navigation));let Yt=ke||je;if(I4.has(ie.response.status)&&Yt&&xr(Yt.formMethod))await Oe(at,Xe,{submission:{...Yt,formAction:Ye},preventScrollReset:it||F,enableViewTransition:de?P:void 0});else{let _n=db(Xe,ke);await Oe(at,Xe,{overrideNavigation:_n,fetcherSubmission:je,preventScrollReset:it||F,enableViewTransition:de?P:void 0})}}async function ut(X,ie,de,ke){var rt;let je,it={};try{je=await V4(m,X,ie,ke,de,!1)}catch(Ye){return ie.filter(Xe=>Xe.shouldLoad).forEach(Xe=>{it[Xe.route.id]={type:"error",error:Ye}}),it}if(X.signal.aborted)return it;if(!xr(X.method))for(let Ye of ie){if(((rt=je[Ye.route.id])==null?void 0:rt.type)==="error")break;!je.hasOwnProperty(Ye.route.id)&&!N.loaderData.hasOwnProperty(Ye.route.id)&&(!N.errors||!N.errors.hasOwnProperty(Ye.route.id))&&Ye.shouldCallHandler()&&(je[Ye.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${Ye.route.id}`)})}for(let[Ye,Xe]of Object.entries(je))if(e5(Xe)){let at=Xe.result;it[Ye]={type:"redirect",response:K4(at,X,Ye,ie,d)}}else it[Ye]=await Y4(Xe);return it}async function pe(X,ie,de,ke){let je=ut(de,X,ke,null),it=Promise.all(ie.map(async Xe=>{if(Xe.matches&&Xe.match&&Xe.request&&Xe.controller){let Et=(await ut(Xe.request,Xe.matches,ke,Xe.key))[Xe.match.route.id];return{[Xe.key]:Et}}else return Promise.resolve({[Xe.key]:{type:"error",error:vi(404,{pathname:Xe.path})}})})),rt=await je,Ye=(await it).reduce((Xe,at)=>Object.assign(Xe,at),{});return{loaderResults:rt,fetcherResults:Ye}}function Re(){j=!0,I.forEach((X,ie)=>{V.has(ie)&&z.add(ie),ze(ie)})}function ee(X,ie,de={}){N.fetchers.set(X,ie),te({fetchers:new Map(N.fetchers)},{flushSync:(de&&de.flushSync)===!0})}function fe(X,ie,de,ke={}){let je=Na(N.matches,ie);$e(X),te({errors:{[je.route.id]:de},fetchers:new Map(N.fetchers)},{flushSync:(ke&&ke.flushSync)===!0})}function Ne(X){return Q.set(X,(Q.get(X)||0)+1),le.has(X)&&le.delete(X),N.fetchers.get(X)||P4}function Ue(X,ie){ze(X,ie==null?void 0:ie.reason),ee(X,jo(null))}function $e(X){let ie=N.fetchers.get(X);V.has(X)&&!(ie&&ie.state==="loading"&&$.has(X))&&ze(X),I.delete(X),$.delete(X),W.delete(X),le.delete(X),z.delete(X),N.fetchers.delete(X)}function et(X){let ie=(Q.get(X)||0)-1;ie<=0?(Q.delete(X),le.add(X)):Q.set(X,ie),te({fetchers:new Map(N.fetchers)})}function ze(X,ie){let de=V.get(X);de&&(de.abort(ie),V.delete(X))}function Ze(X){for(let ie of X){let de=Ne(ie),ke=jo(de.data);N.fetchers.set(ie,ke)}}function nt(){let X=[],ie=!1;for(let de of W){let ke=N.fetchers.get(de);$t(ke,`Expected fetcher: ${de}`),ke.state==="loading"&&(W.delete(de),X.push(de),ie=!0)}return Ze(X),ie}function Ct(X){let ie=[];for(let[de,ke]of $)if(ke<X){let je=N.fetchers.get(de);$t(je,`Expected fetcher: ${de}`),je.state==="loading"&&(ze(de),$.delete(de),ie.push(de))}return Ze(ie),ie.length>0}function zt(X,ie){let de=N.blockers.get(X)||zu;return oe.get(X)!==ie&&oe.set(X,ie),de}function bt(X){N.blockers.delete(X),oe.delete(X)}function Dt(X,ie){let de=N.blockers.get(X)||zu;$t(de.state==="unblocked"&&ie.state==="blocked"||de.state==="blocked"&&ie.state==="blocked"||de.state==="blocked"&&ie.state==="proceeding"||de.state==="blocked"&&ie.state==="unblocked"||de.state==="proceeding"&&ie.state==="unblocked",`Invalid blocker state transition: ${de.state} -> ${ie.state}`);let ke=new Map(N.blockers);ke.set(X,ie),te({blockers:ke})}function ot({currentLocation:X,nextLocation:ie,historyAction:de}){if(oe.size===0)return;oe.size>1&&Zn(!1,"A router only supports one blocker at a time");let ke=Array.from(oe.entries()),[je,it]=ke[ke.length-1],rt=N.blockers.get(je);if(!(rt&&rt.state==="proceeding")&&it({currentLocation:X,nextLocation:ie,historyAction:de}))return je}function ft(X){let ie=vi(404,{pathname:X}),de=f||c,{matches:ke,route:je}=Oh(de);return{notFoundMatches:ke,route:je,error:ie}}function vt(X,ie,de){if(x=X,R=ie,E=de||null,!T&&N.navigation===ub){T=!0;let ke=Lt(N.location,N.matches);ke!=null&&te({restoreScrollPosition:ke})}return()=>{x=null,R=null,E=null}}function Ke(X,ie){return E&&E(X,ie.map(ke=>l4(ke,N.loaderData)))||X.key}function Mt(X,ie){if(x&&R){let de=Ke(X,ie);x[de]=R()}}function Lt(X,ie){if(x){let de=Ke(X,ie),ke=x[de];if(typeof ke=="number")return ke}return null}function kt(X,ie,de){if(e.patchRoutesOnNavigation)if(X){if(Object.keys(X[0].params).length>0)return{active:!0,matches:ed(ie,de,d,!0)}}else return{active:!0,matches:ed(ie,de,d,!0)||[]};return{active:!1,matches:null}}async function hn(X,ie,de,ke){if(!e.patchRoutesOnNavigation)return{type:"success",matches:X};let je=X;for(;;){let it=f==null,rt=f||c,Ye=l;try{await e.patchRoutesOnNavigation({signal:de,path:ie,matches:je,fetcherKey:ke,patch:(Et,pt)=>{de.aborted||fR(Et,pt,rt,Ye,a,!1)}})}catch(Et){return{type:"error",error:Et,partialMatches:je}}finally{it&&!de.aborted&&(c=[...c])}if(de.aborted)return{type:"aborted"};let Xe=Oa(rt,ie,d),at=null;if(Xe){if(Object.keys(Xe[0].params).length===0)return{type:"success",matches:Xe};if(at=ed(rt,ie,d,!0),!(at&&je.length<at.length&&qt(je,at.slice(0,je.length))))return{type:"success",matches:Xe}}if(at||(at=ed(rt,ie,d,!0)),!at||qt(je,at))return{type:"success",matches:null};je=at}}function qt(X,ie){return X.length===ie.length&&X.every((de,ke)=>de.route.id===ie[ke].route.id)}function Je(X){l={},f=Cd(X,a,void 0,l)}function Ot(X,ie,de=!1){let ke=f==null;fR(X,ie,f||c,l,a,de),ke&&(c=[...c],te({}))}return O={get basename(){return d},get future(){return h},get state(){return N},get routes(){return c},get window(){return t},initialize:ve,subscribe:Pe,enableScrollRestoration:vt,navigate:ye,fetch:xe,revalidate:Le,createHref:X=>e.history.createHref(X),encodeLocation:X=>e.history.encodeLocation(X),getFetcher:Ne,resetFetcher:Ue,deleteFetcher:et,dispose:Se,getBlocker:zt,deleteBlocker:bt,patchRoutes:Ot,_internalFetchControllers:V,_internalSetRoutes:Je,_internalSetStateDoNotUseOrYouWillBreakYourApp(X){te(X)}},e.unstable_instrumentations&&(O=C4(O,e.unstable_instrumentations.map(X=>X.router).filter(Boolean))),O}function z4(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Dv(e,t,n,r,o,a){let l,c;if(o){l=[];for(let d of t)if(l.push(d),d.route.id===o){c=d;break}}else l=t,c=t[t.length-1];let f=Wx(r||".",Kx(l),Ci(e.pathname,n)||e.pathname,a==="path");if(r==null&&(f.search=e.search,f.hash=e.hash),(r==null||r===""||r===".")&&c){let d=Zx(f.search);if(c.route.index&&!d)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!c.route.index&&d){let m=new URLSearchParams(f.search),h=m.getAll("index");m.delete("index"),h.filter(g=>g).forEach(g=>m.append("index",g));let y=m.toString();f.search=y?`?${y}`:""}}return n!=="/"&&(f.pathname=x4({basename:n,pathname:f.pathname})),lo(f)}function uR(e,t,n){if(!n||!z4(n))return{path:t};if(n.formMethod&&!r5(n.formMethod))return{path:t,error:vi(405,{method:n.formMethod})};let r=()=>({path:t,error:vi(400,{type:"invalid-body"})}),a=(n.formMethod||"get").toUpperCase(),l=S2(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!xr(a))return r();let h=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((y,[g,x])=>`${y}${g}=${x}
|
|
75
|
+
`,""):String(n.body);return{path:t,submission:{formMethod:a,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:h}}}else if(n.formEncType==="application/json"){if(!xr(a))return r();try{let h=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:a,formAction:l,formEncType:n.formEncType,formData:void 0,json:h,text:void 0}}}catch{return r()}}}$t(typeof FormData=="function","FormData is not available in this environment");let c,f;if(n.formData)c=Pv(n.formData),f=n.formData;else if(n.body instanceof FormData)c=Pv(n.body),f=n.body;else if(n.body instanceof URLSearchParams)c=n.body,f=yR(c);else if(n.body==null)c=new URLSearchParams,f=new FormData;else try{c=new URLSearchParams(n.body),f=yR(c)}catch{return r()}let d={formMethod:a,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(xr(d.formMethod))return{path:t,submission:d};let m=Za(t);return e&&m.search&&Zx(m.search)&&c.append("index",""),m.search=`?${c}`,{path:lo(m),submission:d}}function dR(e,t,n,r,o,a,l,c,f,d,m,h,y,g,x,E,R,T,C,k,M){var B;let D=k?ti(k[1])?k[1].error:k[1].data:void 0,O=o.createURL(a.location),N=o.createURL(f),_;if(m&&a.errors){let j=Object.keys(a.errors)[0];_=l.findIndex(z=>z.route.id===j)}else if(k&&ti(k[1])){let j=k[0];_=l.findIndex(z=>z.route.id===j)-1}let q=k?k[1].statusCode:void 0,F=q&&q>=400,G={currentUrl:O,currentParams:((B=a.matches[0])==null?void 0:B.params)||{},nextUrl:N,nextParams:l[0].params,...c,actionResult:D,actionStatus:q},P=Gd(l),U=l.map((j,z)=>{let{route:V}=j,K=null;if(_!=null&&z>_?K=!1:V.lazy?K=!0:Xx(V)?m?K=_v(V,a.loaderData,a.errors):F4(a.loaderData,a.matches[z],j)&&(K=!0):K=!1,K!==null)return Iv(n,r,e,P,j,d,t,K);let L=!1;typeof M=="boolean"?L=M:F?L=!1:(h||O.pathname+O.search===N.pathname+N.search||O.search!==N.search||B4(a.matches[z],j))&&(L=!0);let $={...G,defaultShouldRevalidate:L},W=ad(j,$);return Iv(n,r,e,P,j,d,t,W,$,M)}),H=[];return x.forEach((j,z)=>{if(m||!l.some(le=>le.route.id===j.routeId)||g.has(z))return;let V=a.fetchers.get(z),K=V&&V.state!=="idle"&&V.data===void 0,L=Oa(R,j.path,T);if(!L){if(C&&K)return;H.push({key:z,routeId:j.routeId,path:j.path,matches:null,match:null,request:null,controller:null});return}if(E.has(z))return;let $=ap(L,j.path),W=new AbortController,I=Kl(o,j.path,W.signal),Q=null;if(y.has(z))y.delete(z),Q=ec(n,r,I,L,$,d,t);else if(K)h&&(Q=ec(n,r,I,L,$,d,t));else{let le;typeof M=="boolean"?le=M:F?le=!1:le=h;let oe={...G,defaultShouldRevalidate:le};ad($,oe)&&(Q=ec(n,r,I,L,$,d,t,oe))}Q&&H.push({key:z,routeId:j.routeId,path:j.path,matches:Q,match:$,request:I,controller:W})}),{dsMatches:U,revalidatingFetchers:H}}function Xx(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function _v(e,t,n){if(e.lazy)return!0;if(!Xx(e))return!1;let r=t!=null&&e.id in t,o=n!=null&&n[e.id]!==void 0;return!r&&o?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!o}function F4(e,t,n){let r=!t||n.route.id!==t.route.id,o=!e.hasOwnProperty(n.route.id);return r||o}function B4(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function ad(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function fR(e,t,n,r,o,a){let l;if(e){let d=r[e];$t(d,`No route found to patch children into: routeId = ${e}`),d.children||(d.children=[]),l=d.children}else l=n;let c=[],f=[];if(t.forEach(d=>{let m=l.find(h=>y2(d,h));m?f.push({existingRoute:m,newRoute:d}):c.push(d)}),c.length>0){let d=Cd(c,o,[e||"_","patch",String((l==null?void 0:l.length)||"0")],r);l.push(...d)}if(a&&f.length>0)for(let d=0;d<f.length;d++){let{existingRoute:m,newRoute:h}=f[d],y=m,[g]=Cd([h],o,[],{},!0);Object.assign(y,{element:g.element?g.element:y.element,errorElement:g.errorElement?g.errorElement:y.errorElement,hydrateFallbackElement:g.hydrateFallbackElement?g.hydrateFallbackElement:y.hydrateFallbackElement})}}function y2(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var o;return(o=t.children)==null?void 0:o.some(a=>y2(n,a))}):!1}var hR=new WeakMap,b2=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let o=n[t.id];if($t(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let a=o.lazy[e];if(!a)return;let l=hR.get(o);l||(l={},hR.set(o,l));let c=l[e];if(c)return c;let f=(async()=>{let d=i4(e),h=o[e]!==void 0&&e!=="hasErrorBoundary";if(d)Zn(!d,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),l[e]=Promise.resolve();else if(h)Zn(!1,`Route "${o.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let y=await a();y!=null&&(Object.assign(o,{[e]:y}),Object.assign(o,r(o)))}typeof o.lazy=="object"&&(o.lazy[e]=void 0,Object.values(o.lazy).every(y=>y===void 0)&&(o.lazy=void 0))})();return l[e]=f,f},pR=new WeakMap;function U4(e,t,n,r,o){let a=n[e.id];if($t(a,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=pR.get(a);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let h=(async()=>{$t(typeof e.lazy=="function","No lazy route function found");let y=await e.lazy(),g={};for(let x in y){let E=y[x];if(E===void 0)continue;let R=a4(x),C=a[x]!==void 0&&x!=="hasErrorBoundary";R?Zn(!R,"Route property "+x+" is not a supported property to be returned from a lazy route function. This property will be ignored."):C?Zn(!C,`Route "${a.id}" has a static property "${x}" defined but its lazy function is also returning a value for this property. The lazy route property "${x}" will be ignored.`):g[x]=E}Object.assign(a,g),Object.assign(a,{...r(a),lazy:void 0})})();return pR.set(a,h),h.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:h}}let l=Object.keys(e.lazy),c=[],f;for(let m of l){if(o&&o.includes(m))continue;let h=b2({key:m,route:e,manifest:n,mapRouteProperties:r});h&&(c.push(h),m===t&&(f=h))}let d=c.length>0?Promise.all(c).then(()=>{}):void 0;return d==null||d.catch(()=>{}),f==null||f.catch(()=>{}),{lazyRoutePromise:d,lazyHandlerPromise:f}}async function mR(e){let t=e.matches.filter(o=>o.shouldLoad),n={};return(await Promise.all(t.map(o=>o.resolve()))).forEach((o,a)=>{n[t[a].route.id]=o}),n}async function H4(e){return e.matches.some(t=>t.route.middleware)?v2(e,()=>mR(e)):mR(e)}function v2(e,t){return q4(e,t,r=>{if(n5(r))throw r;return r},Z4,n);function n(r,o,a){if(a)return Promise.resolve(Object.assign(a.value,{[o]:{type:"error",result:r}}));{let{matches:l}=e,c=Math.min(Math.max(l.findIndex(d=>d.route.id===o),0),Math.max(l.findIndex(d=>d.shouldCallHandler()),0)),f=Na(l,l[c].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:r}})}}}async function q4(e,t,n,r,o){let{matches:a,request:l,params:c,context:f,unstable_pattern:d}=e,m=a.flatMap(y=>y.route.middleware?y.route.middleware.map(g=>[y.route.id,g]):[]);return await x2({request:l,params:c,context:f,unstable_pattern:d},m,t,n,r,o)}async function x2(e,t,n,r,o,a,l=0){let{request:c}=e;if(c.signal.aborted)throw c.signal.reason??new Error(`Request aborted: ${c.method} ${c.url}`);let f=t[l];if(!f)return await n();let[d,m]=f,h,y=async()=>{if(h)throw new Error("You may only call `next()` once per middleware");try{return h={value:await x2(e,t,n,r,o,a,l+1)},h.value}catch(g){return h={value:await a(g,d,h)},h.value}};try{let g=await m(e,y),x=g!=null?r(g):void 0;return o(x)?x:h?x??h.value:(h={value:await y()},h.value)}catch(g){return await a(g,d,h)}}function w2(e,t,n,r,o){let a=b2({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),l=U4(r.route,xr(n.method)?"action":"loader",t,e,o);return{middleware:a,route:l.lazyRoutePromise,handler:l.lazyHandlerPromise}}function Iv(e,t,n,r,o,a,l,c,f=null,d){let m=!1,h=w2(e,t,n,o,a);return{...o,_lazyPromises:h,shouldLoad:c,shouldRevalidateArgs:f,shouldCallHandler(y){return m=!0,f?typeof d=="boolean"?ad(o,{...f,defaultShouldRevalidate:d}):typeof y=="boolean"?ad(o,{...f,defaultShouldRevalidate:y}):ad(o,f):c},resolve(y){let{lazy:g,loader:x,middleware:E}=o.route,R=m||c||y&&!xr(n.method)&&(g||x),T=E&&E.length>0&&!x&&!g;return R&&(xr(n.method)||!T)?$4({request:n,unstable_pattern:r,match:o,lazyHandlerPromise:h==null?void 0:h.handler,lazyRoutePromise:h==null?void 0:h.route,handlerOverride:y,scopedContext:l}):Promise.resolve({type:"data",result:void 0})}}}function ec(e,t,n,r,o,a,l,c=null){return r.map(f=>f.route.id!==o.route.id?{...f,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:w2(e,t,n,f,a),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Iv(e,t,n,Gd(r),f,a,l,!0,c))}async function V4(e,t,n,r,o,a){n.some(d=>{var m;return(m=d._lazyPromises)==null?void 0:m.middleware})&&await Promise.all(n.map(d=>{var m;return(m=d._lazyPromises)==null?void 0:m.middleware}));let l={request:t,unstable_pattern:Gd(n),params:n[0].params,context:o,matches:n},f=await e({...l,fetcherKey:r,runClientMiddleware:d=>{let m=l;return v2(m,()=>d({...m,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(d=>{var m,h;return[(m=d._lazyPromises)==null?void 0:m.handler,(h=d._lazyPromises)==null?void 0:h.route]}))}catch{}return f}async function $4({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:o,handlerOverride:a,scopedContext:l}){let c,f,d=xr(e.method),m=d?"action":"loader",h=y=>{let g,x=new Promise((T,C)=>g=C);f=()=>g(),e.signal.addEventListener("abort",f);let E=T=>typeof y!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${m}" [routeId: ${n.route.id}]`)):y({request:e,unstable_pattern:t,params:n.params,context:l},...T!==void 0?[T]:[]),R=(async()=>{try{return{type:"data",result:await(a?a(C=>E(C)):E())}}catch(T){return{type:"error",result:T}}})();return Promise.race([R,x])};try{let y=d?n.route.action:n.route.loader;if(r||o)if(y){let g,[x]=await Promise.all([h(y).catch(E=>{g=E}),r,o]);if(g!==void 0)throw g;c=x}else{await r;let g=d?n.route.action:n.route.loader;if(g)[c]=await Promise.all([h(g),o]);else if(m==="action"){let x=new URL(e.url),E=x.pathname+x.search;throw vi(405,{method:e.method,pathname:E,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(y)c=await h(y);else{let g=new URL(e.url),x=g.pathname+g.search;throw vi(404,{pathname:x})}}catch(y){return{type:"error",result:y}}finally{f&&e.signal.removeEventListener("abort",f)}return c}async function G4(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function Y4(e){var r,o,a,l,c;let{result:t,type:n}=e;if(Qx(t)){let f;try{f=await G4(t)}catch(d){return{type:"error",error:d}}return n==="error"?{type:"error",error:new $d(t.status,t.statusText,f),statusCode:t.status,headers:t.headers}:{type:"data",data:f,statusCode:t.status,headers:t.headers}}return n==="error"?wR(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(r=t.init)==null?void 0:r.status,headers:(o=t.init)!=null&&o.headers?new Headers(t.init.headers):void 0}:{type:"error",error:Q4(t),statusCode:kd(t)?t.status:void 0,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:kd(t)?t.status:void 0}:wR(t)?{type:"data",data:t.data,statusCode:(l=t.init)==null?void 0:l.status,headers:(c=t.init)!=null&&c.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function K4(e,t,n,r,o){let a=e.headers.get("Location");if($t(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!Yx(a)){let l=r.slice(0,r.findIndex(c=>c.route.id===n)+1);a=Dv(new URL(t.url),l,o,a),e.headers.set("Location",a)}return e}function gR(e,t,n,r){let o=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(Yx(e)){let a=e,l=a.startsWith("//")?new URL(t.protocol+a):new URL(a);if(o.includes(l.protocol))throw new Error("Invalid redirect location");let c=Ci(l.pathname,n)!=null;if(l.origin===t.origin&&c)return l.pathname+l.search+l.hash}try{let a=r.createURL(e);if(o.includes(a.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Kl(e,t,n,r){let o=e.createURL(S2(t)).toString(),a={signal:n};if(r&&xr(r.formMethod)){let{formMethod:l,formEncType:c}=r;a.method=l.toUpperCase(),c==="application/json"?(a.headers=new Headers({"Content-Type":c}),a.body=JSON.stringify(r.json)):c==="text/plain"?a.body=r.text:c==="application/x-www-form-urlencoded"&&r.formData?a.body=Pv(r.formData):a.body=r.formData}return new Request(o,a)}function Pv(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function yR(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function W4(e,t,n,r=!1,o=!1){let a={},l=null,c,f=!1,d={},m=n&&ti(n[1])?n[1].error:void 0;return e.forEach(h=>{if(!(h.route.id in t))return;let y=h.route.id,g=t[y];if($t(!As(g),"Cannot handle redirect results in processLoaderData"),ti(g)){let x=g.error;if(m!==void 0&&(x=m,m=void 0),l=l||{},o)l[y]=x;else{let E=Na(e,y);l[E.route.id]==null&&(l[E.route.id]=x)}r||(a[y]=g2),f||(f=!0,c=kd(g.error)?g.error.status:500),g.headers&&(d[y]=g.headers)}else a[y]=g.data,g.statusCode&&g.statusCode!==200&&!f&&(c=g.statusCode),g.headers&&(d[y]=g.headers)}),m!==void 0&&n&&(l={[n[0]]:m},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:l,statusCode:c||200,loaderHeaders:d}}function bR(e,t,n,r,o,a){let{loaderData:l,errors:c}=W4(t,n,r);return o.filter(f=>!f.matches||f.matches.some(d=>d.shouldLoad)).forEach(f=>{let{key:d,match:m,controller:h}=f;if(h&&h.signal.aborted)return;let y=a[d];if($t(y,"Did not find corresponding fetcher result"),ti(y)){let g=Na(e.matches,m==null?void 0:m.route.id);c&&c[g.route.id]||(c={...c,[g.route.id]:y.error}),e.fetchers.delete(d)}else if(As(y))$t(!1,"Unhandled fetcher revalidation redirect");else{let g=jo(y.data);e.fetchers.set(d,g)}}),{loaderData:l,errors:c}}function vR(e,t,n,r){let o=Object.entries(t).filter(([,a])=>a!==g2).reduce((a,[l,c])=>(a[l]=c,a),{});for(let a of n){let l=a.route.id;if(!t.hasOwnProperty(l)&&e.hasOwnProperty(l)&&a.route.loader&&(o[l]=e[l]),r&&r.hasOwnProperty(l))break}return o}function xR(e){return e?ti(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Na(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function Oh(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function vi(e,{pathname:t,routeId:n,method:r,type:o,message:a}={}){let l="Unknown Server Error",c="Unknown @remix-run/router error";return e===400?(l="Bad Request",r&&t&&n?c=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:o==="invalid-body"&&(c="Unable to encode submission body")):e===403?(l="Forbidden",c=`Route "${n}" does not match URL "${t}"`):e===404?(l="Not Found",c=`No route matches URL "${t}"`):e===405&&(l="Method Not Allowed",r&&t&&n?c=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(c=`Invalid request method "${r.toUpperCase()}"`)),new $d(e||500,l,new Error(c),!0)}function Nh(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,o]=t[n];if(As(o))return{key:r,result:o}}}function S2(e){let t=typeof e=="string"?Za(e):e;return lo({...t,hash:""})}function X4(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Q4(e){var t,n;return new $d(((t=e.init)==null?void 0:t.status)??500,((n=e.init)==null?void 0:n.statusText)??"Internal Server Error",e.data)}function Z4(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&J4(n))}function J4(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function e5(e){return Qx(e.result)&&p2.has(e.result.status)}function ti(e){return e.type==="error"}function As(e){return(e&&e.type)==="redirect"}function wR(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Qx(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function t5(e){return p2.has(e)}function n5(e){return Qx(e)&&t5(e.status)&&e.headers.has("Location")}function r5(e){return _4.has(e.toUpperCase())}function xr(e){return A4.has(e.toUpperCase())}function Zx(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function ap(e,t){let n=typeof t=="string"?Za(t).search:t.search;if(e[e.length-1].route.index&&Zx(n||""))return e[e.length-1];let r=c2(e);return r[r.length-1]}function SR(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:a,json:l}=e;if(!(!t||!n||!r)){if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(l!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:l,text:void 0}}}function db(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function i5(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Fu(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function o5(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function jo(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function a5(e,t){try{let n=e.sessionStorage.getItem(m2);if(n){let r=JSON.parse(n);for(let[o,a]of Object.entries(r||{}))a&&Array.isArray(a)&&t.set(o,new Set(a||[]))}}catch{}}function s5(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(m2,JSON.stringify(n))}catch(r){Zn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function ER(){let e,t,n=new Promise((r,o)=>{e=async a=>{r(a);try{await n}catch{}},t=async a=>{o(a);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var al=v.createContext(null);al.displayName="DataRouter";var Yd=v.createContext(null);Yd.displayName="DataRouterState";var E2=v.createContext(!1);function l5(){return v.useContext(E2)}var Jx=v.createContext({isTransitioning:!1});Jx.displayName="ViewTransition";var T2=v.createContext(new Map);T2.displayName="Fetchers";var c5=v.createContext(null);c5.displayName="Await";var Oi=v.createContext(null);Oi.displayName="Navigation";var om=v.createContext(null);om.displayName="Location";var $i=v.createContext({outlet:null,matches:[],isDataRoute:!1});$i.displayName="Route";var ew=v.createContext(null);ew.displayName="RouteError";var R2="REACT_ROUTER_ERROR",u5="REDIRECT",d5="ROUTE_ERROR_RESPONSE";function f5(e){if(e.startsWith(`${R2}:${u5}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function h5(e){if(e.startsWith(`${R2}:${d5}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new $d(t.status,t.statusText,t.data)}catch{}}function p5(e,{relative:t}={}){$t(_c(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=v.useContext(Oi),{hash:o,pathname:a,search:l}=Wd(e,{relative:t}),c=a;return n!=="/"&&(c=a==="/"?n:oo([n,a])),r.createHref({pathname:c,search:l,hash:o})}function _c(){return v.useContext(om)!=null}function Gi(){return $t(_c(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(om).location}function m5(e){$t(_c(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=Gi();return v.useMemo(()=>Ws(e,s2(t)),[t,e])}var C2="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function k2(e){v.useContext(Oi).static||v.useLayoutEffect(e)}function Kd(){let{isDataRoute:e}=v.useContext($i);return e?A5():g5()}function g5(){$t(_c(),"useNavigate() may be used only in the context of a <Router> component.");let e=v.useContext(al),{basename:t,navigator:n}=v.useContext(Oi),{matches:r}=v.useContext($i),{pathname:o}=Gi(),a=JSON.stringify(Kx(r)),l=v.useRef(!1);return k2(()=>{l.current=!0}),v.useCallback((f,d={})=>{if(Zn(l.current,C2),!l.current)return;if(typeof f=="number"){n.go(f);return}let m=Wx(f,JSON.parse(a),o,d.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:oo([t,m.pathname])),(d.replace?n.replace:n.push)(m,d.state,d)},[t,n,a,o,e])}var y5=v.createContext(null);function b5(e){let t=v.useContext($i).outlet;return v.useMemo(()=>t&&v.createElement(y5.Provider,{value:e},t),[t,e])}function v5(){let{matches:e}=v.useContext($i),t=e[e.length-1];return t?t.params:{}}function Wd(e,{relative:t}={}){let{matches:n}=v.useContext($i),{pathname:r}=Gi(),o=JSON.stringify(Kx(n));return v.useMemo(()=>Wx(e,JSON.parse(o),r,t==="path"),[e,o,r,t])}function x5(e,t,n,r,o){$t(_c(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=v.useContext(Oi),{matches:l}=v.useContext($i),c=l[l.length-1],f=c?c.params:{},d=c?c.pathname:"/",m=c?c.pathnameBase:"/",h=c&&c.route;{let C=h&&h.path||"";O2(d,!h||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${C}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
76
|
+
|
|
77
|
+
Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let y=Gi(),g;g=y;let x=g.pathname||"/",E=x;if(m!=="/"){let C=m.replace(/^\//,"").split("/");E="/"+x.replace(/^\//,"").split("/").slice(C.length).join("/")}let R=Oa(e,{pathname:E});return Zn(h||R!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Zn(R==null||R[R.length-1].route.element!==void 0||R[R.length-1].route.Component!==void 0||R[R.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),R5(R&&R.map(C=>Object.assign({},C,{params:Object.assign({},f,C.params),pathname:oo([m,a.encodeLocation?a.encodeLocation(C.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?m:oo([m,a.encodeLocation?a.encodeLocation(C.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathnameBase])})),l,n,r,o)}function w5(){let e=N5(),t=kd(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},a={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:a},"ErrorBoundary")," or"," ",v.createElement("code",{style:a},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:o},n):null,l)}var S5=v.createElement(w5,null),M2=class extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=h5(e.digest);n&&(e=n)}let t=e!==void 0?v.createElement($i.Provider,{value:this.props.routeContext},v.createElement(ew.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?v.createElement(E5,{error:e},t):t}};M2.contextType=E2;var fb=new WeakMap;function E5({children:e,error:t}){let{basename:n}=v.useContext(Oi);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=f5(t.digest);if(r){let o=fb.get(t);if(o)throw o;let a=d2(r.location,n);if(u2&&!fb.get(t))if(a.isExternal||r.reloadDocument)window.location.href=a.absoluteURL||a.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:r.replace}));throw fb.set(t,l),l}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function T5({routeContext:e,match:t,children:n}){let r=v.useContext(al);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement($i.Provider,{value:e},n)}function R5(e,t=[],n=null,r=null,o=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,l=n==null?void 0:n.errors;if(l!=null){let m=a.findIndex(h=>h.route.id&&(l==null?void 0:l[h.route.id])!==void 0);$t(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),a=a.slice(0,Math.min(a.length,m+1))}let c=!1,f=-1;if(n)for(let m=0;m<a.length;m++){let h=a[m];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(f=m),h.route.id){let{loaderData:y,errors:g}=n,x=h.route.loader&&!y.hasOwnProperty(h.route.id)&&(!g||g[h.route.id]===void 0);if(h.route.lazy||x){c=!0,f>=0?a=a.slice(0,f+1):a=[a[0]];break}}}let d=n&&r?(m,h)=>{var y,g;r(m,{location:n.location,params:((g=(y=n.matches)==null?void 0:y[0])==null?void 0:g.params)??{},unstable_pattern:Gd(n.matches),errorInfo:h})}:void 0;return a.reduceRight((m,h,y)=>{let g,x=!1,E=null,R=null;n&&(g=l&&h.route.id?l[h.route.id]:void 0,E=h.route.errorElement||S5,c&&(f<0&&y===0?(O2("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,R=null):f===y&&(x=!0,R=h.route.hydrateFallbackElement||null)));let T=t.concat(a.slice(0,y+1)),C=()=>{let k;return g?k=E:x?k=R:h.route.Component?k=v.createElement(h.route.Component,null):h.route.element?k=h.route.element:k=m,v.createElement(T5,{match:h,routeContext:{outlet:m,matches:T,isDataRoute:n!=null},children:k})};return n&&(h.route.ErrorBoundary||h.route.errorElement||y===0)?v.createElement(M2,{location:n.location,revalidation:n.revalidation,component:E,error:g,children:C(),routeContext:{outlet:null,matches:T,isDataRoute:!0},onError:d}):C()},null)}function tw(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function C5(e){let t=v.useContext(al);return $t(t,tw(e)),t}function k5(e){let t=v.useContext(Yd);return $t(t,tw(e)),t}function M5(e){let t=v.useContext($i);return $t(t,tw(e)),t}function nw(e){let t=M5(e),n=t.matches[t.matches.length-1];return $t(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function O5(){return nw("useRouteId")}function N5(){var r;let e=v.useContext(ew),t=k5("useRouteError"),n=nw("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function A5(){let{router:e}=C5("useNavigate"),t=nw("useNavigate"),n=v.useRef(!1);return k2(()=>{n.current=!0}),v.useCallback(async(o,a={})=>{Zn(n.current,C2),n.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...a}))},[e,t])}var TR={};function O2(e,t,n){!t&&!TR[e]&&(TR[e]=!0,Zn(!1,n))}var RR={};function CR(e,t){!e&&!RR[t]&&(RR[t]=!0,console.warn(t))}var D5="useOptimistic",kR=$x[D5],_5=()=>{};function I5(e){return kR?kR(e):[e,_5]}function P5(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Zn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:v.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Zn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:v.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Zn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:v.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var L5=["HydrateFallback","hydrateFallbackElement"],j5=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function z5({router:e,flushSync:t,onError:n,unstable_useTransitions:r}){r=l5()||r;let[a,l]=v.useState(e.state),[c,f]=I5(a),[d,m]=v.useState(),[h,y]=v.useState({isTransitioning:!1}),[g,x]=v.useState(),[E,R]=v.useState(),[T,C]=v.useState(),k=v.useRef(new Map),M=v.useCallback((_,{deletedFetchers:q,newErrors:F,flushSync:G,viewTransitionOpts:P})=>{F&&n&&Object.values(F).forEach(H=>{var B;return n(H,{location:_.location,params:((B=_.matches[0])==null?void 0:B.params)??{},unstable_pattern:Gd(_.matches)})}),_.fetchers.forEach((H,B)=>{H.data!==void 0&&k.current.set(B,H.data)}),q.forEach(H=>k.current.delete(H)),CR(G===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let U=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(CR(P==null||U,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!P||!U){t&&G?t(()=>l(_)):r===!1?l(_):v.startTransition(()=>{r===!0&&f(H=>MR(H,_)),l(_)});return}if(t&&G){t(()=>{E&&(g==null||g.resolve(),E.skipTransition()),y({isTransitioning:!0,flushSync:!0,currentLocation:P.currentLocation,nextLocation:P.nextLocation})});let H=e.window.document.startViewTransition(()=>{t(()=>l(_))});H.finished.finally(()=>{t(()=>{x(void 0),R(void 0),m(void 0),y({isTransitioning:!1})})}),t(()=>R(H));return}E?(g==null||g.resolve(),E.skipTransition(),C({state:_,currentLocation:P.currentLocation,nextLocation:P.nextLocation})):(m(_),y({isTransitioning:!0,flushSync:!1,currentLocation:P.currentLocation,nextLocation:P.nextLocation}))},[e.window,t,E,g,r,f,n]);v.useLayoutEffect(()=>e.subscribe(M),[e,M]),v.useEffect(()=>{h.isTransitioning&&!h.flushSync&&x(new j5)},[h]),v.useEffect(()=>{if(g&&d&&e.window){let _=d,q=g.promise,F=e.window.document.startViewTransition(async()=>{r===!1?l(_):v.startTransition(()=>{r===!0&&f(G=>MR(G,_)),l(_)}),await q});F.finished.finally(()=>{x(void 0),R(void 0),m(void 0),y({isTransitioning:!1})}),R(F)}},[d,g,e.window,r,f]),v.useEffect(()=>{g&&d&&c.location.key===d.location.key&&g.resolve()},[g,E,c.location,d]),v.useEffect(()=>{!h.isTransitioning&&T&&(m(T.state),y({isTransitioning:!0,flushSync:!1,currentLocation:T.currentLocation,nextLocation:T.nextLocation}),C(void 0))},[h.isTransitioning,T]);let D=v.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:_=>e.navigate(_),push:(_,q,F)=>e.navigate(_,{state:q,preventScrollReset:F==null?void 0:F.preventScrollReset}),replace:(_,q,F)=>e.navigate(_,{replace:!0,state:q,preventScrollReset:F==null?void 0:F.preventScrollReset})}),[e]),O=e.basename||"/",N=v.useMemo(()=>({router:e,navigator:D,static:!1,basename:O,onError:n}),[e,D,O,n]);return v.createElement(v.Fragment,null,v.createElement(al.Provider,{value:N},v.createElement(Yd.Provider,{value:c},v.createElement(T2.Provider,{value:k.current},v.createElement(Jx.Provider,{value:h},v.createElement(H5,{basename:O,location:c.location,navigationType:c.historyAction,navigator:D,unstable_useTransitions:r},v.createElement(F5,{routes:e.routes,future:e.future,state:c,onError:n})))))),null)}function MR(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var F5=v.memo(B5);function B5({routes:e,future:t,state:n,onError:r}){return x5(e,void 0,n,r,t)}function U5(e){return b5(e.context)}function H5({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:a=!1,unstable_useTransitions:l}){$t(!_c(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),f=v.useMemo(()=>({basename:c,navigator:o,static:a,unstable_useTransitions:l,future:{}}),[c,o,a,l]);typeof n=="string"&&(n=Za(n));let{pathname:d="/",search:m="",hash:h="",state:y=null,key:g="default"}=n,x=v.useMemo(()=>{let E=Ci(d,c);return E==null?null:{location:{pathname:E,search:m,hash:h,state:y,key:g},navigationType:r}},[c,d,m,h,y,g,r]);return Zn(x!=null,`<Router basename="${c}"> is not able to match the URL "${d}${m}${h}" because it does not start with the basename, so the <Router> won't render anything.`),x==null?null:v.createElement(Oi.Provider,{value:f},v.createElement(om.Provider,{children:t,value:x}))}var sp="get",lp="application/x-www-form-urlencoded";function am(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function q5(e){return am(e)&&e.tagName.toLowerCase()==="button"}function V5(e){return am(e)&&e.tagName.toLowerCase()==="form"}function $5(e){return am(e)&&e.tagName.toLowerCase()==="input"}function G5(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Y5(e,t){return e.button===0&&(!t||t==="_self")&&!G5(e)}var Ah=null;function K5(){if(Ah===null)try{new FormData(document.createElement("form"),0),Ah=!1}catch{Ah=!0}return Ah}var W5=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function hb(e){return e!=null&&!W5.has(e)?(Zn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${lp}"`),null):e}function X5(e,t){let n,r,o,a,l;if(V5(e)){let c=e.getAttribute("action");r=c?Ci(c,t):null,n=e.getAttribute("method")||sp,o=hb(e.getAttribute("enctype"))||lp,a=new FormData(e)}else if(q5(e)||$5(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||c.getAttribute("action");if(r=f?Ci(f,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||sp,o=hb(e.getAttribute("formenctype"))||hb(c.getAttribute("enctype"))||lp,a=new FormData(c,e),!K5()){let{name:d,type:m,value:h}=e;if(m==="image"){let y=d?`${d}.`:"";a.append(`${y}x`,"0"),a.append(`${y}y`,"0")}else d&&a.append(d,h)}}else{if(am(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=sp,r=null,o=lp,l=e}return a&&o==="text/plain"&&(l=a,a=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:a,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function rw(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Q5(e,t,n,r){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${r}`:o.pathname=`${o.pathname}.${r}`:o.pathname==="/"?o.pathname=`_root.${r}`:t&&Ci(o.pathname,t)==="/"?o.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${r}`,o}async function Z5(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function J5(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function e3(e,t,n){let r=await Promise.all(e.map(async o=>{let a=t.routes[o.route.id];if(a){let l=await Z5(a,n);return l.links?l.links():[]}return[]}));return i3(r.flat(1).filter(J5).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function OR(e,t,n,r,o,a){let l=(f,d)=>n[d]?f.route.id!==n[d].route.id:!0,c=(f,d)=>{var m;return n[d].pathname!==f.pathname||((m=n[d].route.path)==null?void 0:m.endsWith("*"))&&n[d].params["*"]!==f.params["*"]};return a==="assets"?t.filter((f,d)=>l(f,d)||c(f,d)):a==="data"?t.filter((f,d)=>{var h;let m=r.routes[f.route.id];if(!m||!m.hasLoader)return!1;if(l(f,d)||c(f,d))return!0;if(f.route.shouldRevalidate){let y=f.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((h=n[0])==null?void 0:h.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function t3(e,t,{includeHydrateFallback:n}={}){return n3(e.map(r=>{let o=t.routes[r.route.id];if(!o)return[];let a=[o.module];return o.clientActionModule&&(a=a.concat(o.clientActionModule)),o.clientLoaderModule&&(a=a.concat(o.clientLoaderModule)),n&&o.hydrateFallbackModule&&(a=a.concat(o.hydrateFallbackModule)),o.imports&&(a=a.concat(o.imports)),a}).flat(1))}function n3(e){return[...new Set(e)]}function r3(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function i3(e,t){let n=new Set;return new Set(t),e.reduce((r,o)=>{let a=JSON.stringify(r3(o));return n.has(a)||(n.add(a),r.push({key:a,link:o})),r},[])}function N2(){let e=v.useContext(al);return rw(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function o3(){let e=v.useContext(Yd);return rw(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var iw=v.createContext(void 0);iw.displayName="FrameworkContext";function A2(){let e=v.useContext(iw);return rw(e,"You must render this element inside a <HydratedRouter> element"),e}function a3(e,t){let n=v.useContext(iw),[r,o]=v.useState(!1),[a,l]=v.useState(!1),{onFocus:c,onBlur:f,onMouseEnter:d,onMouseLeave:m,onTouchStart:h}=t,y=v.useRef(null);v.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let E=T=>{T.forEach(C=>{l(C.isIntersecting)})},R=new IntersectionObserver(E,{threshold:.5});return y.current&&R.observe(y.current),()=>{R.disconnect()}}},[e]),v.useEffect(()=>{if(r){let E=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(E)}}},[r]);let g=()=>{o(!0)},x=()=>{o(!1),l(!1)};return n?e!=="intent"?[a,y,{}]:[a,y,{onFocus:Bu(c,g),onBlur:Bu(f,x),onMouseEnter:Bu(d,g),onMouseLeave:Bu(m,x),onTouchStart:Bu(h,g)}]:[!1,y,{}]}function Bu(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function s3({page:e,...t}){let{router:n}=N2(),r=v.useMemo(()=>Oa(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?v.createElement(c3,{page:e,matches:r,...t}):null}function l3(e){let{manifest:t,routeModules:n}=A2(),[r,o]=v.useState([]);return v.useEffect(()=>{let a=!1;return e3(e,t,n).then(l=>{a||o(l)}),()=>{a=!0}},[e,t,n]),r}function c3({page:e,matches:t,...n}){let r=Gi(),{future:o,manifest:a,routeModules:l}=A2(),{basename:c}=N2(),{loaderData:f,matches:d}=o3(),m=v.useMemo(()=>OR(e,t,d,a,r,"data"),[e,t,d,a,r]),h=v.useMemo(()=>OR(e,t,d,a,r,"assets"),[e,t,d,a,r]),y=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let E=new Set,R=!1;if(t.forEach(C=>{var M;let k=a.routes[C.route.id];!k||!k.hasLoader||(!m.some(D=>D.route.id===C.route.id)&&C.route.id in f&&((M=l[C.route.id])!=null&&M.shouldRevalidate)||k.hasClientLoader?R=!0:E.add(C.route.id))}),E.size===0)return[];let T=Q5(e,c,o.unstable_trailingSlashAwareDataRequests,"data");return R&&E.size>0&&T.searchParams.set("_routes",t.filter(C=>E.has(C.route.id)).map(C=>C.route.id).join(",")),[T.pathname+T.search]},[c,o.unstable_trailingSlashAwareDataRequests,f,r,a,m,t,e,l]),g=v.useMemo(()=>t3(h,a),[h,a]),x=l3(h);return v.createElement(v.Fragment,null,y.map(E=>v.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...n})),g.map(E=>v.createElement("link",{key:E,rel:"modulepreload",href:E,...n})),x.map(({key:E,link:R})=>v.createElement("link",{key:E,nonce:n.nonce,...R,crossOrigin:R.crossOrigin??n.crossOrigin})))}function u3(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var d3=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{d3&&(window.__reactRouterVersion="7.13.0")}catch{}function f3(e,t){return j4({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:e4({window:t==null?void 0:t.window}),hydrationData:h3(),routes:e,mapRouteProperties:P5,hydrationRouteProperties:L5,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window,unstable_instrumentations:t==null?void 0:t.unstable_instrumentations}).initialize()}function h3(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:p3(e.errors)}),e}function p3(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,o]of t)if(o&&o.__type==="RouteErrorResponse")n[r]=new $d(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let a=window[o.__subType];if(typeof a=="function")try{let l=new a(o.message);l.stack="",n[r]=l}catch{}}if(n[r]==null){let a=new Error(o.message);a.stack="",n[r]=a}}else n[r]=o;return n}var D2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ow=v.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:o,reloadDocument:a,replace:l,state:c,target:f,to:d,preventScrollReset:m,viewTransition:h,unstable_defaultShouldRevalidate:y,...g},x){let{basename:E,unstable_useTransitions:R}=v.useContext(Oi),T=typeof d=="string"&&D2.test(d),C=d2(d,E);d=C.to;let k=p5(d,{relative:o}),[M,D,O]=a3(r,g),N=b3(d,{replace:l,state:c,target:f,preventScrollReset:m,relative:o,viewTransition:h,unstable_defaultShouldRevalidate:y,unstable_useTransitions:R});function _(F){t&&t(F),F.defaultPrevented||N(F)}let q=v.createElement("a",{...g,...O,href:C.absoluteURL||k,onClick:C.isExternal||a?t:_,ref:u3(x,D),target:f,"data-discover":!T&&n==="render"?"true":void 0});return M&&!T?v.createElement(v.Fragment,null,q,v.createElement(s3,{page:k})):q});ow.displayName="Link";var m3=v.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:o=!1,style:a,to:l,viewTransition:c,children:f,...d},m){let h=Wd(l,{relative:d.relative}),y=Gi(),g=v.useContext(Yd),{navigator:x,basename:E}=v.useContext(Oi),R=g!=null&&E3(h)&&c===!0,T=x.encodeLocation?x.encodeLocation(h).pathname:h.pathname,C=y.pathname,k=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;n||(C=C.toLowerCase(),k=k?k.toLowerCase():null,T=T.toLowerCase()),k&&E&&(k=Ci(k,E)||k);const M=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let D=C===T||!o&&C.startsWith(T)&&C.charAt(M)==="/",O=k!=null&&(k===T||!o&&k.startsWith(T)&&k.charAt(T.length)==="/"),N={isActive:D,isPending:O,isTransitioning:R},_=D?t:void 0,q;typeof r=="function"?q=r(N):q=[r,D?"active":null,O?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let F=typeof a=="function"?a(N):a;return v.createElement(ow,{...d,"aria-current":_,className:q,ref:m,style:F,to:l,viewTransition:c},typeof f=="function"?f(N):f)});m3.displayName="NavLink";var g3=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:a,method:l=sp,action:c,onSubmit:f,relative:d,preventScrollReset:m,viewTransition:h,unstable_defaultShouldRevalidate:y,...g},x)=>{let{unstable_useTransitions:E}=v.useContext(Oi),R=w3(),T=S3(c,{relative:d}),C=l.toLowerCase()==="get"?"get":"post",k=typeof c=="string"&&D2.test(c),M=D=>{if(f&&f(D),D.defaultPrevented)return;D.preventDefault();let O=D.nativeEvent.submitter,N=(O==null?void 0:O.getAttribute("formmethod"))||l,_=()=>R(O||D.currentTarget,{fetcherKey:t,method:N,navigate:n,replace:o,state:a,relative:d,preventScrollReset:m,viewTransition:h,unstable_defaultShouldRevalidate:y});E&&n!==!1?v.startTransition(()=>_()):_()};return v.createElement("form",{ref:x,method:C,action:T,onSubmit:r?f:M,...g,"data-discover":!k&&e==="render"?"true":void 0})});g3.displayName="Form";function y3(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function _2(e){let t=v.useContext(al);return $t(t,y3(e)),t}function b3(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:a,viewTransition:l,unstable_defaultShouldRevalidate:c,unstable_useTransitions:f}={}){let d=Kd(),m=Gi(),h=Wd(e,{relative:a});return v.useCallback(y=>{if(Y5(y,t)){y.preventDefault();let g=n!==void 0?n:lo(m)===lo(h),x=()=>d(e,{replace:g,state:r,preventScrollReset:o,relative:a,viewTransition:l,unstable_defaultShouldRevalidate:c});f?v.startTransition(()=>x()):x()}},[m,d,h,n,r,t,e,o,a,l,c,f])}var v3=0,x3=()=>`__${String(++v3)}__`;function w3(){let{router:e}=_2("useSubmit"),{basename:t}=v.useContext(Oi),n=O5(),r=e.fetch,o=e.navigate;return v.useCallback(async(a,l={})=>{let{action:c,method:f,encType:d,formData:m,body:h}=X5(a,t);if(l.navigate===!1){let y=l.fetcherKey||x3();await r(y,n,l.action||c,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:m,body:h,formMethod:l.method||f,formEncType:l.encType||d,flushSync:l.flushSync})}else await o(l.action||c,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:m,body:h,formMethod:l.method||f,formEncType:l.encType||d,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,o,t,n])}function S3(e,{relative:t}={}){let{basename:n}=v.useContext(Oi),r=v.useContext($i);$t(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),a={...Wd(e||".",{relative:t})},l=Gi();if(e==null){a.search=l.search;let c=new URLSearchParams(a.search),f=c.getAll("index");if(f.some(m=>m==="")){c.delete("index"),f.filter(h=>h).forEach(h=>c.append("index",h));let m=c.toString();a.search=m?`?${m}`:""}}return(!e||e===".")&&o.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(a.pathname=a.pathname==="/"?n:oo([n,a.pathname])),lo(a)}function E3(e,{relative:t}={}){let n=v.useContext(Jx);$t(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=_2("useViewTransitionState"),o=Wd(e,{relative:t});if(!n.isTransitioning)return!1;let a=Ci(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=Ci(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ws(o.pathname,l)!=null||Ws(o.pathname,a)!=null}var yr=n2();const T3=im(yr);function R3(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 C3=e=>{switch(e){case"success":return O3;case"info":return A3;case"warning":return N3;case"error":return D3;default:return null}},k3=Array(12).fill(0),M3=({visible:e,className:t})=>Fe.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Fe.createElement("div",{className:"sonner-spinner"},k3.map((n,r)=>Fe.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),O3=Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Fe.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"})),N3=Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Fe.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"})),A3=Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Fe.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"})),D3=Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Fe.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"})),_3=Fe.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"},Fe.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Fe.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),I3=()=>{const[e,t]=Fe.useState(document.hidden);return Fe.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Lv=1;class P3{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,...o}=t,a=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Lv++,l=this.toasts.find(f=>f.id===a),c=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),l?this.toasts=this.toasts.map(f=>f.id===a?(this.publish({...f,...t,id:a,title:r}),{...f,...t,id:a,dismissible:c,title:r}):f):this.addToast({title:r,...o,dismissible:c,id:a}),a},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 o=Promise.resolve(t instanceof Function?t():t);let a=r!==void 0,l;const c=o.then(async d=>{if(l=["resolve",d],Fe.isValidElement(d))a=!1,this.create({id:r,type:"default",message:d});else if(j3(d)&&!d.ok){a=!1;const h=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,y=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,x=typeof h=="object"&&!Fe.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:y,...x})}else if(d instanceof Error){a=!1;const h=typeof n.error=="function"?await n.error(d):n.error,y=typeof n.description=="function"?await n.description(d):n.description,x=typeof h=="object"&&!Fe.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:y,...x})}else if(n.success!==void 0){a=!1;const h=typeof n.success=="function"?await n.success(d):n.success,y=typeof n.description=="function"?await n.description(d):n.description,x=typeof h=="object"&&!Fe.isValidElement(h)?h:{message:h};this.create({id:r,type:"success",description:y,...x})}}).catch(async d=>{if(l=["reject",d],n.error!==void 0){a=!1;const m=typeof n.error=="function"?await n.error(d):n.error,h=typeof n.description=="function"?await n.description(d):n.description,g=typeof m=="object"&&!Fe.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:h,...g})}}).finally(()=>{a&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),f=()=>new Promise((d,m)=>c.then(()=>l[0]==="reject"?m(l[1]):d(l[1])).catch(m));return typeof r!="string"&&typeof r!="number"?{unwrap:f}:Object.assign(r,{unwrap:f})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||Lv++;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 Br=new P3,L3=(e,t)=>{const n=(t==null?void 0:t.id)||Lv++;return Br.addToast({title:e,...t,id:n}),n},j3=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",z3=L3,F3=()=>Br.toasts,B3=()=>Br.getActiveToasts(),Bt=Object.assign(z3,{success:Br.success,info:Br.info,warning:Br.warning,error:Br.error,custom:Br.custom,message:Br.message,promise:Br.promise,dismiss:Br.dismiss,loading:Br.loading},{getHistory:F3,getToasts:B3});R3("[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 Dh(e){return e.label!==void 0}const U3=3,H3="24px",q3="16px",NR=4e3,V3=356,$3=14,G3=45,Y3=200;function Zi(...e){return e.filter(Boolean).join(" ")}function K3(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const W3=e=>{var t,n,r,o,a,l,c,f,d;const{invert:m,toast:h,unstyled:y,interacting:g,setHeights:x,visibleToasts:E,heights:R,index:T,toasts:C,expanded:k,removeToast:M,defaultRichColors:D,closeButton:O,style:N,cancelButtonStyle:_,actionButtonStyle:q,className:F="",descriptionClassName:G="",duration:P,position:U,gap:H,expandByDefault:B,classNames:j,icons:z,closeButtonAriaLabel:V="Close toast"}=e,[K,L]=Fe.useState(null),[$,W]=Fe.useState(null),[I,Q]=Fe.useState(!1),[le,oe]=Fe.useState(!1),[Z,ue]=Fe.useState(!1),[ve,Se]=Fe.useState(!1),[Pe,te]=Fe.useState(!1),[he,ye]=Fe.useState(0),[Le,Oe]=Fe.useState(0),Te=Fe.useRef(h.duration||P||NR),Ce=Fe.useRef(null),J=Fe.useRef(null),Ee=T===0,xe=T+1<=E,Be=h.type,Ve=h.dismissible!==!1,_e=h.className||"",ut=h.descriptionClassName||"",pe=Fe.useMemo(()=>R.findIndex(Ke=>Ke.toastId===h.id)||0,[R,h.id]),Re=Fe.useMemo(()=>{var Ke;return(Ke=h.closeButton)!=null?Ke:O},[h.closeButton,O]),ee=Fe.useMemo(()=>h.duration||P||NR,[h.duration,P]),fe=Fe.useRef(0),Ne=Fe.useRef(0),Ue=Fe.useRef(0),$e=Fe.useRef(null),[et,ze]=U.split("-"),Ze=Fe.useMemo(()=>R.reduce((Ke,Mt,Lt)=>Lt>=pe?Ke:Ke+Mt.height,0),[R,pe]),nt=I3(),Ct=h.invert||m,zt=Be==="loading";Ne.current=Fe.useMemo(()=>pe*H+Ze,[pe,Ze]),Fe.useEffect(()=>{Te.current=ee},[ee]),Fe.useEffect(()=>{Q(!0)},[]),Fe.useEffect(()=>{const Ke=J.current;if(Ke){const Mt=Ke.getBoundingClientRect().height;return Oe(Mt),x(Lt=>[{toastId:h.id,height:Mt,position:h.position},...Lt]),()=>x(Lt=>Lt.filter(kt=>kt.toastId!==h.id))}},[x,h.id]),Fe.useLayoutEffect(()=>{if(!I)return;const Ke=J.current,Mt=Ke.style.height;Ke.style.height="auto";const Lt=Ke.getBoundingClientRect().height;Ke.style.height=Mt,Oe(Lt),x(kt=>kt.find(qt=>qt.toastId===h.id)?kt.map(qt=>qt.toastId===h.id?{...qt,height:Lt}:qt):[{toastId:h.id,height:Lt,position:h.position},...kt])},[I,h.title,h.description,x,h.id,h.jsx,h.action,h.cancel]);const bt=Fe.useCallback(()=>{oe(!0),ye(Ne.current),x(Ke=>Ke.filter(Mt=>Mt.toastId!==h.id)),setTimeout(()=>{M(h)},Y3)},[h,M,x,Ne]);Fe.useEffect(()=>{if(h.promise&&Be==="loading"||h.duration===1/0||h.type==="loading")return;let Ke;return k||g||nt?(()=>{if(Ue.current<fe.current){const kt=new Date().getTime()-fe.current;Te.current=Te.current-kt}Ue.current=new Date().getTime()})():(()=>{Te.current!==1/0&&(fe.current=new Date().getTime(),Ke=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),bt()},Te.current))})(),()=>clearTimeout(Ke)},[k,g,h,Be,nt,bt]),Fe.useEffect(()=>{h.delete&&(bt(),h.onDismiss==null||h.onDismiss.call(h,h))},[bt,h.delete]);function Dt(){var Ke;if(z!=null&&z.loading){var Mt;return Fe.createElement("div",{className:Zi(j==null?void 0:j.loader,h==null||(Mt=h.classNames)==null?void 0:Mt.loader,"sonner-loader"),"data-visible":Be==="loading"},z.loading)}return Fe.createElement(M3,{className:Zi(j==null?void 0:j.loader,h==null||(Ke=h.classNames)==null?void 0:Ke.loader),visible:Be==="loading"})}const ot=h.icon||(z==null?void 0:z[Be])||C3(Be);var ft,vt;return Fe.createElement("li",{tabIndex:0,ref:J,className:Zi(F,_e,j==null?void 0:j.toast,h==null||(t=h.classNames)==null?void 0:t.toast,j==null?void 0:j.default,j==null?void 0:j[Be],h==null||(n=h.classNames)==null?void 0:n[Be]),"data-sonner-toast":"","data-rich-colors":(ft=h.richColors)!=null?ft:D,"data-styled":!(h.jsx||h.unstyled||y),"data-mounted":I,"data-promise":!!h.promise,"data-swiped":Pe,"data-removed":le,"data-visible":xe,"data-y-position":et,"data-x-position":ze,"data-index":T,"data-front":Ee,"data-swiping":Z,"data-dismissible":Ve,"data-type":Be,"data-invert":Ct,"data-swipe-out":ve,"data-swipe-direction":$,"data-expanded":!!(k||B&&I),"data-testid":h.testId,style:{"--index":T,"--toasts-before":T,"--z-index":C.length-T,"--offset":`${le?he:Ne.current}px`,"--initial-height":B?"auto":`${Le}px`,...N,...h.style},onDragEnd:()=>{ue(!1),L(null),$e.current=null},onPointerDown:Ke=>{Ke.button!==2&&(zt||!Ve||(Ce.current=new Date,ye(Ne.current),Ke.target.setPointerCapture(Ke.pointerId),Ke.target.tagName!=="BUTTON"&&(ue(!0),$e.current={x:Ke.clientX,y:Ke.clientY})))},onPointerUp:()=>{var Ke,Mt,Lt;if(ve||!Ve)return;$e.current=null;const kt=Number(((Ke=J.current)==null?void 0:Ke.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),hn=Number(((Mt=J.current)==null?void 0:Mt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),qt=new Date().getTime()-((Lt=Ce.current)==null?void 0:Lt.getTime()),Je=K==="x"?kt:hn,Ot=Math.abs(Je)/qt;if(Math.abs(Je)>=G3||Ot>.11){ye(Ne.current),h.onDismiss==null||h.onDismiss.call(h,h),W(K==="x"?kt>0?"right":"left":hn>0?"down":"up"),bt(),Se(!0);return}else{var X,ie;(X=J.current)==null||X.style.setProperty("--swipe-amount-x","0px"),(ie=J.current)==null||ie.style.setProperty("--swipe-amount-y","0px")}te(!1),ue(!1),L(null)},onPointerMove:Ke=>{var Mt,Lt,kt;if(!$e.current||!Ve||((Mt=window.getSelection())==null?void 0:Mt.toString().length)>0)return;const qt=Ke.clientY-$e.current.y,Je=Ke.clientX-$e.current.x;var Ot;const X=(Ot=e.swipeDirections)!=null?Ot:K3(U);!K&&(Math.abs(Je)>1||Math.abs(qt)>1)&&L(Math.abs(Je)>Math.abs(qt)?"x":"y");let ie={x:0,y:0};const de=ke=>1/(1.5+Math.abs(ke)/20);if(K==="y"){if(X.includes("top")||X.includes("bottom"))if(X.includes("top")&&qt<0||X.includes("bottom")&&qt>0)ie.y=qt;else{const ke=qt*de(qt);ie.y=Math.abs(ke)<Math.abs(qt)?ke:qt}}else if(K==="x"&&(X.includes("left")||X.includes("right")))if(X.includes("left")&&Je<0||X.includes("right")&&Je>0)ie.x=Je;else{const ke=Je*de(Je);ie.x=Math.abs(ke)<Math.abs(Je)?ke:Je}(Math.abs(ie.x)>0||Math.abs(ie.y)>0)&&te(!0),(Lt=J.current)==null||Lt.style.setProperty("--swipe-amount-x",`${ie.x}px`),(kt=J.current)==null||kt.style.setProperty("--swipe-amount-y",`${ie.y}px`)}},Re&&!h.jsx&&Be!=="loading"?Fe.createElement("button",{"aria-label":V,"data-disabled":zt,"data-close-button":!0,onClick:zt||!Ve?()=>{}:()=>{bt(),h.onDismiss==null||h.onDismiss.call(h,h)},className:Zi(j==null?void 0:j.closeButton,h==null||(r=h.classNames)==null?void 0:r.closeButton)},(vt=z==null?void 0:z.close)!=null?vt:_3):null,(Be||h.icon||h.promise)&&h.icon!==null&&((z==null?void 0:z[Be])!==null||h.icon)?Fe.createElement("div",{"data-icon":"",className:Zi(j==null?void 0:j.icon,h==null||(o=h.classNames)==null?void 0:o.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||Dt():null,h.type!=="loading"?ot:null):null,Fe.createElement("div",{"data-content":"",className:Zi(j==null?void 0:j.content,h==null||(a=h.classNames)==null?void 0:a.content)},Fe.createElement("div",{"data-title":"",className:Zi(j==null?void 0:j.title,h==null||(l=h.classNames)==null?void 0:l.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?Fe.createElement("div",{"data-description":"",className:Zi(G,ut,j==null?void 0:j.description,h==null||(c=h.classNames)==null?void 0:c.description)},typeof h.description=="function"?h.description():h.description):null),Fe.isValidElement(h.cancel)?h.cancel:h.cancel&&Dh(h.cancel)?Fe.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||_,onClick:Ke=>{Dh(h.cancel)&&Ve&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,Ke),bt())},className:Zi(j==null?void 0:j.cancelButton,h==null||(f=h.classNames)==null?void 0:f.cancelButton)},h.cancel.label):null,Fe.isValidElement(h.action)?h.action:h.action&&Dh(h.action)?Fe.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||q,onClick:Ke=>{Dh(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,Ke),!Ke.defaultPrevented&&bt())},className:Zi(j==null?void 0:j.actionButton,h==null||(d=h.classNames)==null?void 0:d.actionButton)},h.action.label):null)};function AR(){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 X3(e,t){const n={};return[e,t].forEach((r,o)=>{const a=o===1,l=a?"--mobile-offset":"--offset",c=a?q3:H3;function f(d){["top","right","bottom","left"].forEach(m=>{n[`${l}-${m}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?f(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${l}-${d}`]=c:n[`${l}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):f(c)}),n}const Q3=Fe.forwardRef(function(t,n){const{id:r,invert:o,position:a="bottom-right",hotkey:l=["altKey","KeyT"],expand:c,closeButton:f,className:d,offset:m,mobileOffset:h,theme:y="light",richColors:g,duration:x,style:E,visibleToasts:R=U3,toastOptions:T,dir:C=AR(),gap:k=$3,icons:M,containerAriaLabel:D="Notifications"}=t,[O,N]=Fe.useState([]),_=Fe.useMemo(()=>r?O.filter(I=>I.toasterId===r):O.filter(I=>!I.toasterId),[O,r]),q=Fe.useMemo(()=>Array.from(new Set([a].concat(_.filter(I=>I.position).map(I=>I.position)))),[_,a]),[F,G]=Fe.useState([]),[P,U]=Fe.useState(!1),[H,B]=Fe.useState(!1),[j,z]=Fe.useState(y!=="system"?y:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),V=Fe.useRef(null),K=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),L=Fe.useRef(null),$=Fe.useRef(!1),W=Fe.useCallback(I=>{N(Q=>{var le;return(le=Q.find(oe=>oe.id===I.id))!=null&&le.delete||Br.dismiss(I.id),Q.filter(({id:oe})=>oe!==I.id)})},[]);return Fe.useEffect(()=>Br.subscribe(I=>{if(I.dismiss){requestAnimationFrame(()=>{N(Q=>Q.map(le=>le.id===I.id?{...le,delete:!0}:le))});return}setTimeout(()=>{T3.flushSync(()=>{N(Q=>{const le=Q.findIndex(oe=>oe.id===I.id);return le!==-1?[...Q.slice(0,le),{...Q[le],...I},...Q.slice(le+1)]:[I,...Q]})})})}),[O]),Fe.useEffect(()=>{if(y!=="system"){z(y);return}if(y==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z("dark"):z("light")),typeof window>"u")return;const I=window.matchMedia("(prefers-color-scheme: dark)");try{I.addEventListener("change",({matches:Q})=>{z(Q?"dark":"light")})}catch{I.addListener(({matches:le})=>{try{z(le?"dark":"light")}catch(oe){console.error(oe)}})}},[y]),Fe.useEffect(()=>{O.length<=1&&U(!1)},[O]),Fe.useEffect(()=>{const I=Q=>{var le;if(l.every(ue=>Q[ue]||Q.code===ue)){var Z;U(!0),(Z=V.current)==null||Z.focus()}Q.code==="Escape"&&(document.activeElement===V.current||(le=V.current)!=null&&le.contains(document.activeElement))&&U(!1)};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[l]),Fe.useEffect(()=>{if(V.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,$.current=!1)}},[V.current]),Fe.createElement("section",{ref:n,"aria-label":`${D} ${K}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},q.map((I,Q)=>{var le;const[oe,Z]=I.split("-");return _.length?Fe.createElement("ol",{key:I,dir:C==="auto"?AR():C,tabIndex:-1,ref:V,className:d,"data-sonner-toaster":!0,"data-sonner-theme":j,"data-y-position":oe,"data-x-position":Z,style:{"--front-toast-height":`${((le=F[0])==null?void 0:le.height)||0}px`,"--width":`${V3}px`,"--gap":`${k}px`,...E,...X3(m,h)},onBlur:ue=>{$.current&&!ue.currentTarget.contains(ue.relatedTarget)&&($.current=!1,L.current&&(L.current.focus({preventScroll:!0}),L.current=null))},onFocus:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||$.current||($.current=!0,L.current=ue.relatedTarget)},onMouseEnter:()=>U(!0),onMouseMove:()=>U(!0),onMouseLeave:()=>{H||U(!1)},onDragEnd:()=>U(!1),onPointerDown:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||B(!0)},onPointerUp:()=>B(!1)},_.filter(ue=>!ue.position&&Q===0||ue.position===I).map((ue,ve)=>{var Se,Pe;return Fe.createElement(W3,{key:ue.id,icons:M,index:ve,toast:ue,defaultRichColors:g,duration:(Se=T==null?void 0:T.duration)!=null?Se:x,className:T==null?void 0:T.className,descriptionClassName:T==null?void 0:T.descriptionClassName,invert:o,visibleToasts:R,closeButton:(Pe=T==null?void 0:T.closeButton)!=null?Pe:f,interacting:H,position:I,style:T==null?void 0:T.style,unstyled:T==null?void 0:T.unstyled,classNames:T==null?void 0:T.classNames,cancelButtonStyle:T==null?void 0:T.cancelButtonStyle,actionButtonStyle:T==null?void 0:T.actionButtonStyle,closeButtonAriaLabel:T==null?void 0:T.closeButtonAriaLabel,removeToast:W,toasts:_.filter(te=>te.position==ue.position),heights:F.filter(te=>te.position==ue.position),setHeights:G,expandByDefault:c,gap:k,expanded:P,swipeDirections:t.swipeDirections})})):null}))}),Nt=e=>typeof e=="string",Uu=()=>{let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n},DR=e=>e==null?"":""+e,Z3=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},J3=/###/g,_R=e=>e&&e.indexOf("###")>-1?e.replace(J3,"."):e,IR=e=>!e||Nt(e),sd=(e,t,n)=>{const r=Nt(t)?t.split("."):t;let o=0;for(;o<r.length-1;){if(IR(e))return{};const a=_R(r[o]);!e[a]&&n&&(e[a]=new n),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={},++o}return IR(e)?{}:{obj:e,k:_R(r[o])}},PR=(e,t,n)=>{const{obj:r,k:o}=sd(e,t,Object);if(r!==void 0||t.length===1){r[o]=n;return}let a=t[t.length-1],l=t.slice(0,t.length-1),c=sd(e,l,Object);for(;c.obj===void 0&&l.length;)a=`${l[l.length-1]}.${a}`,l=l.slice(0,l.length-1),c=sd(e,l,Object),c!=null&&c.obj&&typeof c.obj[`${c.k}.${a}`]<"u"&&(c.obj=void 0);c.obj[`${c.k}.${a}`]=n},eF=(e,t,n,r)=>{const{obj:o,k:a}=sd(e,t,Object);o[a]=o[a]||[],o[a].push(n)},Rp=(e,t)=>{const{obj:n,k:r}=sd(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},tF=(e,t,n)=>{const r=Rp(e,n);return r!==void 0?r:Rp(t,n)},I2=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?Nt(e[r])||e[r]instanceof String||Nt(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):I2(e[r],t[r],n):e[r]=t[r]);return e},Ul=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var nF={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const rF=e=>Nt(e)?e.replace(/[&<>"'\/]/g,t=>nF[t]):e;class iF{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 oF=[" ",",","?","!",";"],aF=new iF(20),sF=(e,t,n)=>{t=t||"",n=n||"";const r=oF.filter(l=>t.indexOf(l)<0&&n.indexOf(l)<0);if(r.length===0)return!0;const o=aF.getRegExp(`(${r.map(l=>l==="?"?"\\?":l).join("|")})`);let a=!o.test(e);if(!a){const l=e.indexOf(n);l>0&&!o.test(e.substring(0,l))&&(a=!0)}return a},jv=(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 o=e;for(let a=0;a<r.length;){if(!o||typeof o!="object")return;let l,c="";for(let f=a;f<r.length;++f)if(f!==a&&(c+=n),c+=r[f],l=o[c],l!==void 0){if(["string","number","boolean"].indexOf(typeof l)>-1&&f<r.length-1)continue;a+=f-a+1;break}o=l}return o},Md=e=>e==null?void 0:e.replace("_","-"),lF={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 Cp{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||lF,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,o){return o&&!this.debug?null:(Nt(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new Cp(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Cp(this.logger,t)}}var io=new Cp;class sm{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const o=this.observers[r].get(n)||0;this.observers[r].set(n,o+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([o,a])=>{for(let l=0;l<a;l++)o(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([o,a])=>{for(let l=0;l<a;l++)o.apply(o,[t,...n])})}}class LR extends sm{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.indexOf(t)<0&&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,o={}){var d,m;const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,l=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let c;t.indexOf(".")>-1?c=t.split("."):(c=[t,n],r&&(Array.isArray(r)?c.push(...r):Nt(r)&&a?c.push(...r.split(a)):c.push(r)));const f=Rp(this.data,c);return!f&&!n&&!r&&t.indexOf(".")>-1&&(t=c[0],n=c[1],r=c.slice(2).join(".")),f||!l||!Nt(r)?f:jv((m=(d=this.data)==null?void 0:d[t])==null?void 0:m[n],r,a)}addResource(t,n,r,o,a={silent:!1}){const l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let c=[t,n];r&&(c=c.concat(l?r.split(l):r)),t.indexOf(".")>-1&&(c=t.split("."),o=n,n=c[1]),this.addNamespaces(n),PR(this.data,c,o),a.silent||this.emit("added",t,n,r,o)}addResources(t,n,r,o={silent:!1}){for(const a in r)(Nt(r[a])||Array.isArray(r[a]))&&this.addResource(t,n,a,r[a],{silent:!0});o.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,o,a,l={silent:!1,skipCopy:!1}){let c=[t,n];t.indexOf(".")>-1&&(c=t.split("."),o=r,r=n,n=c[1]),this.addNamespaces(n);let f=Rp(this.data,c)||{};l.skipCopy||(r=JSON.parse(JSON.stringify(r))),o?I2(f,r,a):f={...f,...r},PR(this.data,c,f),l.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(o=>n[o]&&Object.keys(n[o]).length>0)}toJSON(){return this.data}}var P2={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(a=>{var l;t=((l=this.processors[a])==null?void 0:l.process(t,n,r,o))??t}),t}};const L2=Symbol("i18next/PATH_KEY");function cF(){const e=[],t=Object.create(null);let n;return t.get=(r,o)=>{var a;return(a=n==null?void 0:n.revoke)==null||a.call(n),o===L2?e:(e.push(o),n=Proxy.revocable(r,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function zv(e,t){const{[L2]:n}=e(cF());return n.join((t==null?void 0:t.keySeparator)??".")}const jR={},pb=e=>!Nt(e)&&typeof e!="boolean"&&typeof e!="number";class kp extends sm{constructor(t,n={}){super(),Z3(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=io.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const r={...n};if(t==null)return!1;const o=this.resolve(t,r);if((o==null?void 0:o.res)===void 0)return!1;const a=pb(o.res);return!(r.returnObjects===!1&&a)}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let a=n.ns||this.options.defaultNS||[];const l=r&&t.indexOf(r)>-1,c=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!sF(t,r,o);if(l&&!c){const f=t.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:t,namespaces:Nt(a)?[a]:a};const d=t.split(r);(r!==o||r===o&&this.options.ns.indexOf(d[0])>-1)&&(a=d.shift()),t=d.join(o)}return{key:t,namespaces:Nt(a)?[a]:a}}translate(t,n,r){let o=typeof n=="object"?{...n}:n;if(typeof o!="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),typeof o=="object"&&(o={...o}),o||(o={}),t==null)return"";typeof t=="function"&&(t=zv(t,{...this.options,...o})),Array.isArray(t)||(t=[String(t)]);const a=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,l=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,{key:c,namespaces:f}=this.extractFromKey(t[t.length-1],o),d=f[f.length-1];let m=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;m===void 0&&(m=":");const h=o.lng||this.language,y=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((h==null?void 0:h.toLowerCase())==="cimode")return y?a?{res:`${d}${m}${c}`,usedKey:c,exactUsedKey:c,usedLng:h,usedNS:d,usedParams:this.getUsedParamsDetails(o)}:`${d}${m}${c}`:a?{res:c,usedKey:c,exactUsedKey:c,usedLng:h,usedNS:d,usedParams:this.getUsedParamsDetails(o)}:c;const g=this.resolve(t,o);let x=g==null?void 0:g.res;const E=(g==null?void 0:g.usedKey)||c,R=(g==null?void 0:g.exactUsedKey)||c,T=["[object Number]","[object Function]","[object RegExp]"],C=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,k=!this.i18nFormat||this.i18nFormat.handleAsObject,M=o.count!==void 0&&!Nt(o.count),D=kp.hasDefaultValue(o),O=M?this.pluralResolver.getSuffix(h,o.count,o):"",N=o.ordinal&&M?this.pluralResolver.getSuffix(h,o.count,{ordinal:!1}):"",_=M&&!o.ordinal&&o.count===0,q=_&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${O}`]||o[`defaultValue${N}`]||o.defaultValue;let F=x;k&&!x&&D&&(F=q);const G=pb(F),P=Object.prototype.toString.apply(F);if(k&&F&&G&&T.indexOf(P)<0&&!(Nt(C)&&Array.isArray(F))){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const U=this.options.returnedObjectHandler?this.options.returnedObjectHandler(E,F,{...o,ns:f}):`key '${c} (${this.language})' returned an object instead of string.`;return a?(g.res=U,g.usedParams=this.getUsedParamsDetails(o),g):U}if(l){const U=Array.isArray(F),H=U?[]:{},B=U?R:E;for(const j in F)if(Object.prototype.hasOwnProperty.call(F,j)){const z=`${B}${l}${j}`;D&&!x?H[j]=this.translate(z,{...o,defaultValue:pb(q)?q[j]:void 0,joinArrays:!1,ns:f}):H[j]=this.translate(z,{...o,joinArrays:!1,ns:f}),H[j]===z&&(H[j]=F[j])}x=H}}else if(k&&Nt(C)&&Array.isArray(x))x=x.join(C),x&&(x=this.extendTranslation(x,t,o,r));else{let U=!1,H=!1;!this.isValidLookup(x)&&D&&(U=!0,x=q),this.isValidLookup(x)||(H=!0,x=c);const j=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&H?void 0:x,z=D&&q!==x&&this.options.updateMissing;if(H||U||z){if(this.logger.log(z?"updateKey":"missingKey",h,d,c,z?q:x),l){const $=this.resolve(c,{...o,keySeparator:!1});$&&$.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 V=[];const K=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&K&&K[0])for(let $=0;$<K.length;$++)V.push(K[$]);else this.options.saveMissingTo==="all"?V=this.languageUtils.toResolveHierarchy(o.lng||this.language):V.push(o.lng||this.language);const L=($,W,I)=>{var le;const Q=D&&I!==x?I:j;this.options.missingKeyHandler?this.options.missingKeyHandler($,d,W,Q,z,o):(le=this.backendConnector)!=null&&le.saveMissing&&this.backendConnector.saveMissing($,d,W,Q,z,o),this.emit("missingKey",$,d,W,x)};this.options.saveMissing&&(this.options.saveMissingPlurals&&M?V.forEach($=>{const W=this.pluralResolver.getSuffixes($,o);_&&o[`defaultValue${this.options.pluralSeparator}zero`]&&W.indexOf(`${this.options.pluralSeparator}zero`)<0&&W.push(`${this.options.pluralSeparator}zero`),W.forEach(I=>{L([$],c+I,o[`defaultValue${I}`]||q)})}):L(V,c,q))}x=this.extendTranslation(x,t,o,g,r),H&&x===c&&this.options.appendNamespaceToMissingKey&&(x=`${d}${m}${c}`),(H||U)&&this.options.parseMissingKeyHandler&&(x=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${d}${m}${c}`:c,U?x:void 0,o))}return a?(g.res=x,g.usedParams=this.getUsedParamsDetails(o),g):x}extendTranslation(t,n,r,o,a){var f,d;if((f=this.i18nFormat)!=null&&f.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const m=Nt(t)&&(((d=r==null?void 0:r.interpolation)==null?void 0:d.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(m){const g=t.match(this.interpolator.nestingRegexp);h=g&&g.length}let y=r.replace&&!Nt(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(y={...this.options.interpolation.defaultVariables,...y}),t=this.interpolator.interpolate(t,y,r.lng||this.language||o.usedLng,r),m){const g=t.match(this.interpolator.nestingRegexp),x=g&&g.length;h<x&&(r.nest=!1)}!r.lng&&o&&o.res&&(r.lng=this.language||o.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,(...g)=>(a==null?void 0:a[0])===g[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${g[0]} in key: ${n[0]}`),null):this.translate(...g,n),r)),r.interpolation&&this.interpolator.reset()}const l=r.postProcess||this.options.postProcess,c=Nt(l)?[l]:l;return t!=null&&(c!=null&&c.length)&&r.applyPostProcessor!==!1&&(t=P2.handle(c,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,n={}){let r,o,a,l,c;return Nt(t)&&(t=[t]),t.forEach(f=>{if(this.isValidLookup(r))return;const d=this.extractFromKey(f,n),m=d.key;o=m;let h=d.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const y=n.count!==void 0&&!Nt(n.count),g=y&&!n.ordinal&&n.count===0,x=n.context!==void 0&&(Nt(n.context)||typeof n.context=="number")&&n.context!=="",E=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);h.forEach(R=>{var T,C;this.isValidLookup(r)||(c=R,!jR[`${E[0]}-${R}`]&&((T=this.utils)!=null&&T.hasLoadedNamespace)&&!((C=this.utils)!=null&&C.hasLoadedNamespace(c))&&(jR[`${E[0]}-${R}`]=!0,this.logger.warn(`key "${o}" for languages "${E.join(", ")}" won't get resolved as namespace "${c}" 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!!!")),E.forEach(k=>{var O;if(this.isValidLookup(r))return;l=k;const M=[m];if((O=this.i18nFormat)!=null&&O.addLookupKeys)this.i18nFormat.addLookupKeys(M,m,k,R,n);else{let N;y&&(N=this.pluralResolver.getSuffix(k,n.count,n));const _=`${this.options.pluralSeparator}zero`,q=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(y&&(n.ordinal&&N.indexOf(q)===0&&M.push(m+N.replace(q,this.options.pluralSeparator)),M.push(m+N),g&&M.push(m+_)),x){const F=`${m}${this.options.contextSeparator||"_"}${n.context}`;M.push(F),y&&(n.ordinal&&N.indexOf(q)===0&&M.push(F+N.replace(q,this.options.pluralSeparator)),M.push(F+N),g&&M.push(F+_))}}let D;for(;D=M.pop();)this.isValidLookup(r)||(a=D,r=this.getResource(k,R,D,n))}))})}),{res:r,usedKey:o,exactUsedKey:a,usedLng:l,usedNS:c}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r,o={}){var a;return(a=this.i18nFormat)!=null&&a.getResource?this.i18nFormat.getResource(t,n,r,o):this.resourceStore.getResource(t,n,r,o)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!Nt(t.replace);let o=r?t.replace:t;if(r&&typeof t.count<"u"&&(o.count=t.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!r){o={...o};for(const a of n)delete o[a]}return o}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class zR{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=io.create("languageUtils")}getScriptPartFromCode(t){if(t=Md(t),!t||t.indexOf("-")<0)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=Md(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(Nt(t)&&t.indexOf("-")>-1){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.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const o=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(o))&&(n=o)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const o=this.getScriptPartFromCode(r);if(this.isSupportedCode(o))return n=o;const a=this.getLanguagePartFromCode(r);if(this.isSupportedCode(a))return n=a;n=this.options.supportedLngs.find(l=>{if(l===a)return l;if(!(l.indexOf("-")<0&&a.indexOf("-")<0)&&(l.indexOf("-")>0&&a.indexOf("-")<0&&l.substring(0,l.indexOf("-"))===a||l.indexOf(a)===0&&a.length>1))return l})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),Nt(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),o=[],a=l=>{l&&(this.isSupportedCode(l)?o.push(l):this.logger.warn(`rejecting language code not found in supportedLngs: ${l}`))};return Nt(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(t))):Nt(t)&&a(this.formatLanguageCode(t)),r.forEach(l=>{o.indexOf(l)<0&&a(this.formatLanguageCode(l))}),o}}const FR={zero:0,one:1,two:2,few:3,many:4,other:5},BR={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class uF{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=io.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const r=Md(t==="dev"?"en":t),o=n.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:r,type:o});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let l;try{l=new Intl.PluralRules(r,{type:o})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),BR;if(!t.match(/-|_/))return BR;const f=this.languageUtils.getLanguagePartFromCode(t);l=this.getRule(f,n)}return this.pluralRulesCache[a]=l,l}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(o=>`${n}${o}`)}getSuffixes(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((o,a)=>FR[o]-FR[a]).map(o=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(t,n,r={}){const o=this.getRule(t,r);return o?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${o.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const UR=(e,t,n,r=".",o=!0)=>{let a=tF(e,t,n);return!a&&o&&Nt(n)&&(a=jv(e,n,r),a===void 0&&(a=jv(t,n,r))),a},mb=e=>e.replace(/\$/g,"$$$$");class HR{constructor(t={}){var n;this.logger=io.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:o,prefix:a,prefixEscaped:l,suffix:c,suffixEscaped:f,formatSeparator:d,unescapeSuffix:m,unescapePrefix:h,nestingPrefix:y,nestingPrefixEscaped:g,nestingSuffix:x,nestingSuffixEscaped:E,nestingOptionsSeparator:R,maxReplaces:T,alwaysFormat:C}=t.interpolation;this.escape=n!==void 0?n:rF,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=a?Ul(a):l||"{{",this.suffix=c?Ul(c):f||"}}",this.formatSeparator=d||",",this.unescapePrefix=m?"":h||"-",this.unescapeSuffix=this.unescapePrefix?"":m||"",this.nestingPrefix=y?Ul(y):g||Ul("$t("),this.nestingSuffix=x?Ul(x):E||Ul(")"),this.nestingOptionsSeparator=R||",",this.maxReplaces=T||1e3,this.alwaysFormat=C!==void 0?C:!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,o){var g;let a,l,c;const f=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},d=x=>{if(x.indexOf(this.formatSeparator)<0){const C=UR(n,f,x,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(C,void 0,r,{...o,...n,interpolationkey:x}):C}const E=x.split(this.formatSeparator),R=E.shift().trim(),T=E.join(this.formatSeparator).trim();return this.format(UR(n,f,R,this.options.keySeparator,this.options.ignoreJSONStructure),T,r,{...o,...n,interpolationkey:R})};this.resetRegExp();const m=(o==null?void 0:o.missingInterpolationHandler)||this.options.missingInterpolationHandler,h=((g=o==null?void 0:o.interpolation)==null?void 0:g.skipOnVariables)!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:x=>mb(x)},{regex:this.regexp,safeValue:x=>this.escapeValue?mb(this.escape(x)):mb(x)}].forEach(x=>{for(c=0;a=x.regex.exec(t);){const E=a[1].trim();if(l=d(E),l===void 0)if(typeof m=="function"){const T=m(t,a,o);l=Nt(T)?T:""}else if(o&&Object.prototype.hasOwnProperty.call(o,E))l="";else if(h){l=a[0];continue}else this.logger.warn(`missed to pass in variable ${E} for interpolating ${t}`),l="";else!Nt(l)&&!this.useRawValueToEscape&&(l=DR(l));const R=x.safeValue(l);if(t=t.replace(a[0],R),h?(x.regex.lastIndex+=l.length,x.regex.lastIndex-=a[0].length):x.regex.lastIndex=0,c++,c>=this.maxReplaces)break}}),t}nest(t,n,r={}){let o,a,l;const c=(f,d)=>{const m=this.nestingOptionsSeparator;if(f.indexOf(m)<0)return f;const h=f.split(new RegExp(`${m}[ ]*{`));let y=`{${h[1]}`;f=h[0],y=this.interpolate(y,l);const g=y.match(/'/g),x=y.match(/"/g);(((g==null?void 0:g.length)??0)%2===0&&!x||x.length%2!==0)&&(y=y.replace(/'/g,'"'));try{l=JSON.parse(y),d&&(l={...d,...l})}catch(E){return this.logger.warn(`failed parsing options string in nesting for key ${f}`,E),`${f}${m}${y}`}return l.defaultValue&&l.defaultValue.indexOf(this.prefix)>-1&&delete l.defaultValue,f};for(;o=this.nestingRegexp.exec(t);){let f=[];l={...r},l=l.replace&&!Nt(l.replace)?l.replace:l,l.applyPostProcessor=!1,delete l.defaultValue;const d=/{.*}/.test(o[1])?o[1].lastIndexOf("}")+1:o[1].indexOf(this.formatSeparator);if(d!==-1&&(f=o[1].slice(d).split(this.formatSeparator).map(m=>m.trim()).filter(Boolean),o[1]=o[1].slice(0,d)),a=n(c.call(this,o[1].trim(),l),l),a&&o[0]===t&&!Nt(a))return a;Nt(a)||(a=DR(a)),a||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),a=""),f.length&&(a=f.reduce((m,h)=>this.format(m,h,r.lng,{...r,interpolationkey:o[1].trim()}),a.trim())),t=t.replace(o[0],a),this.regexp.lastIndex=0}return t}}const dF=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);t==="currency"&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):t==="relativetime"&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(l=>{if(l){const[c,...f]=l.split(":"),d=f.join(":").trim().replace(/^'+|'+$/g,""),m=c.trim();n[m]||(n[m]=d),d==="false"&&(n[m]=!1),d==="true"&&(n[m]=!0),isNaN(d)||(n[m]=parseInt(d,10))}})}return{formatName:t,formatOptions:n}},qR=e=>{const t={};return(n,r,o)=>{let a=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(a={...a,[o.interpolationkey]:void 0});const l=r+JSON.stringify(a);let c=t[l];return c||(c=e(Md(r),o),t[l]=c),c(n)}},fF=e=>(t,n,r)=>e(Md(n),r)(t);class hF{constructor(t={}){this.logger=io.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?qR:fF;this.formats={number:r((o,a)=>{const l=new Intl.NumberFormat(o,{...a});return c=>l.format(c)}),currency:r((o,a)=>{const l=new Intl.NumberFormat(o,{...a,style:"currency"});return c=>l.format(c)}),datetime:r((o,a)=>{const l=new Intl.DateTimeFormat(o,{...a});return c=>l.format(c)}),relativetime:r((o,a)=>{const l=new Intl.RelativeTimeFormat(o,{...a});return c=>l.format(c,a.range||"day")}),list:r((o,a)=>{const l=new Intl.ListFormat(o,{...a});return c=>l.format(c)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=qR(n)}format(t,n,r,o={}){const a=n.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(c=>c.indexOf(")")>-1)){const c=a.findIndex(f=>f.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,c)].join(this.formatSeparator)}return a.reduce((c,f)=>{var h;const{formatName:d,formatOptions:m}=dF(f);if(this.formats[d]){let y=c;try{const g=((h=o==null?void 0:o.formatParams)==null?void 0:h[o.interpolationkey])||{},x=g.locale||g.lng||o.locale||o.lng||r;y=this.formats[d](c,x,{...m,...o,...g})}catch(g){this.logger.warn(g)}return y}else this.logger.warn(`there was no format function for ${d}`);return c},t)}}const pF=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class mF extends sm{constructor(t,n,r,o={}){var a,l;super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=o,this.logger=io.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],(l=(a=this.backend)==null?void 0:a.init)==null||l.call(a,r,o.backend,o)}queueLoad(t,n,r,o){const a={},l={},c={},f={};return t.forEach(d=>{let m=!0;n.forEach(h=>{const y=`${d}|${h}`;!r.reload&&this.store.hasResourceBundle(d,h)?this.state[y]=2:this.state[y]<0||(this.state[y]===1?l[y]===void 0&&(l[y]=!0):(this.state[y]=1,m=!1,l[y]===void 0&&(l[y]=!0),a[y]===void 0&&(a[y]=!0),f[h]===void 0&&(f[h]=!0)))}),m||(c[d]=!0)}),(Object.keys(a).length||Object.keys(l).length)&&this.queue.push({pending:l,pendingCount:Object.keys(l).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(a),pending:Object.keys(l),toLoadLanguages:Object.keys(c),toLoadNamespaces:Object.keys(f)}}loaded(t,n,r){const o=t.split("|"),a=o[0],l=o[1];n&&this.emit("failedLoading",a,l,n),!n&&r&&this.store.addResourceBundle(a,l,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const c={};this.queue.forEach(f=>{eF(f.loaded,[a],l),pF(f,t),n&&f.errors.push(n),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(d=>{c[d]||(c[d]={});const m=f.loaded[d];m.length&&m.forEach(h=>{c[d][h]===void 0&&(c[d][h]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(f=>!f.done)}read(t,n,r,o=0,a=this.retryTimeout,l){if(!t.length)return l(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:o,wait:a,callback:l});return}this.readingCalls++;const c=(d,m)=>{if(this.readingCalls--,this.waitingReads.length>0){const h=this.waitingReads.shift();this.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(d&&m&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,o+1,a*2,l)},a);return}l(d,m)},f=this.backend[r].bind(this.backend);if(f.length===2){try{const d=f(t,n);d&&typeof d.then=="function"?d.then(m=>c(null,m)).catch(c):c(null,d)}catch(d){c(d)}return}return f(t,n,c)}prepareLoading(t,n,r={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();Nt(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Nt(n)&&(n=[n]);const a=this.queueLoad(t,n,r,o);if(!a.toLoad.length)return a.pending.length||o(),null;a.toLoad.forEach(l=>{this.loadOne(l)})}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("|"),o=r[0],a=r[1];this.read(o,a,"read",void 0,void 0,(l,c)=>{l&&this.logger.warn(`${n}loading namespace ${a} for language ${o} failed`,l),!l&&c&&this.logger.log(`${n}loaded namespace ${a} for language ${o}`,c),this.loaded(t,l,c)})}saveMissing(t,n,r,o,a,l={},c=()=>{}){var f,d,m,h,y;if((d=(f=this.services)==null?void 0:f.utils)!=null&&d.hasLoadedNamespace&&!((h=(m=this.services)==null?void 0:m.utils)!=null&&h.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((y=this.backend)!=null&&y.create){const g={...l,isUpdate:a},x=this.backend.create.bind(this.backend);if(x.length<6)try{let E;x.length===5?E=x(t,n,r,o,g):E=x(t,n,r,o),E&&typeof E.then=="function"?E.then(R=>c(null,R)).catch(c):c(null,E)}catch(E){c(E)}else x(t,n,r,o,c,g)}!t||!t[0]||this.store.addResource(t[0],n,r,o)}}}const gb=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",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]),Nt(e[1])&&(t.defaultValue=e[1]),Nt(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,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),VR=e=>{var t,n;return Nt(e.ns)&&(e.ns=[e.ns]),Nt(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Nt(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),((n=(t=e.supportedLngs)==null?void 0:t.indexOf)==null?void 0:n.call(t,"cimode"))<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e},_h=()=>{},gF=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})},yF=e=>{var t,n,r,o,a,l,c,f,d;return!!(((r=(n=(t=e==null?void 0:e.modules)==null?void 0:t.backend)==null?void 0:n.name)==null?void 0:r.indexOf("Locize"))>0||((c=(l=(a=(o=e==null?void 0:e.modules)==null?void 0:o.backend)==null?void 0:a.constructor)==null?void 0:l.name)==null?void 0:c.indexOf("Locize"))>0||(d=(f=e==null?void 0:e.options)==null?void 0:f.backend)!=null&&d.backends&&e.options.backend.backends.some(m=>{var h,y,g;return((h=m==null?void 0:m.name)==null?void 0:h.indexOf("Locize"))>0||((g=(y=m==null?void 0:m.constructor)==null?void 0:y.name)==null?void 0:g.indexOf("Locize"))>0}))};class ld extends sm{constructor(t={},n){if(super(),this.options=VR(t),this.services={},this.logger=io,this.modules={external:[]},gF(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&&(Nt(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=gb();this.options={...r,...this.options,...VR(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),this.options.showSupportNotice!==!1&&!yF(this)&&typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is maintained with support from locize.com — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙");const o=d=>d?typeof d=="function"?new d:d:null;if(!this.options.isClone){this.modules.logger?io.init(o(this.modules.logger),this.options):io.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:d=hF;const m=new zR(this.options);this.store=new LR(this.options.resources,this.options);const h=this.services;h.logger=io,h.resourceStore=this.store,h.languageUtils=m,h.pluralResolver=new uF(m,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),d&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(h.formatter=o(d),h.formatter.init&&h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new HR(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new mF(o(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",(g,...x)=>{this.emit(g,...x)}),this.modules.languageDetector&&(h.languageDetector=o(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=o(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new kp(this.services,this.options),this.translator.on("*",(g,...x)=>{this.emit(g,...x)}),this.modules.external.forEach(g=>{g.init&&g.init(this)})}if(this.format=this.options.interpolation.format,n||(n=_h),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[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(d=>{this[d]=(...m)=>this.store[d](...m)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=(...m)=>(this.store[d](...m),this)});const c=Uu(),f=()=>{const d=(m,h)=>{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),c.resolve(h),n(m,h)};if(this.languages&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initAsync?f():setTimeout(f,0),c}loadResources(t,n=_h){var a,l;let r=n;const o=Nt(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if((o==null?void 0:o.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const c=[],f=d=>{if(!d||d==="cimode")return;this.services.languageUtils.toResolveHierarchy(d).forEach(h=>{h!=="cimode"&&c.indexOf(h)<0&&c.push(h)})};o?f(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(m=>f(m)),(l=(a=this.options.preload)==null?void 0:a.forEach)==null||l.call(a,d=>f(d)),this.services.backendConnector.load(c,this.options.ns,d=>{!d&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(d)})}else r(null)}reloadResources(t,n,r){const o=Uu();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=_h),this.services.backendConnector.reload(t,n,a=>{o.resolve(),r(a)}),o}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"&&P2.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"].indexOf(t)>-1)){for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,n){this.isLanguageChangingTo=t;const r=Uu();this.emit("languageChanging",t);const o=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},a=(c,f)=>{f?this.isLanguageChangingTo===t&&(o(f),this.translator.changeLanguage(f),this.isLanguageChangingTo=void 0,this.emit("languageChanged",f),this.logger.log("languageChanged",f)):this.isLanguageChangingTo=void 0,r.resolve((...d)=>this.t(...d)),n&&n(c,(...d)=>this.t(...d))},l=c=>{var m,h;!t&&!c&&this.services.languageDetector&&(c=[]);const f=Nt(c)?c:c&&c[0],d=this.store.hasLanguageSomeTranslations(f)?f:this.services.languageUtils.getBestMatchFromCodes(Nt(c)?[c]:c);d&&(this.language||o(d),this.translator.language||this.translator.changeLanguage(d),(h=(m=this.services.languageDetector)==null?void 0:m.cacheUserLanguage)==null||h.call(m,d)),this.loadResources(d,y=>{a(y,d)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?l(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(l):this.services.languageDetector.detect(l):l(t),r}getFixedT(t,n,r){const o=(a,l,...c)=>{let f;typeof l!="object"?f=this.options.overloadTranslationOptionHandler([a,l].concat(c)):f={...l},f.lng=f.lng||o.lng,f.lngs=f.lngs||o.lngs,f.ns=f.ns||o.ns,f.keyPrefix!==""&&(f.keyPrefix=f.keyPrefix||r||o.keyPrefix);const d=this.options.keySeparator||".";let m;return f.keyPrefix&&Array.isArray(a)?m=a.map(h=>(typeof h=="function"&&(h=zv(h,{...this.options,...l})),`${f.keyPrefix}${d}${h}`)):(typeof a=="function"&&(a=zv(a,{...this.options,...l})),m=f.keyPrefix?`${f.keyPrefix}${d}${a}`:a),this.t(m,f)};return Nt(t)?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=r,o}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],o=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const l=(c,f)=>{const d=this.services.backendConnector.state[`${c}|${f}`];return d===-1||d===0||d===2};if(n.precheck){const c=n.precheck(this,l);if(c!==void 0)return c}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||l(r,t)&&(!o||l(a,t)))}loadNamespaces(t,n){const r=Uu();return this.options.ns?(Nt(t)&&(t=[t]),t.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=Uu();Nt(t)&&(t=[t]);const o=this.options.preload||[],a=t.filter(l=>o.indexOf(l)<0&&this.services.languageUtils.isSupportedCode(l));return a.length?(this.options.preload=o.concat(a),this.loadResources(l=>{r.resolve(),n&&n(l)}),r):(n&&n(),Promise.resolve())}dir(t){var o,a;if(t||(t=this.resolvedLanguage||(((o=this.languages)==null?void 0:o.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const l=new Intl.Locale(t);if(l&&l.getTextInfo){const c=l.getTextInfo();if(c&&c.direction)return c.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=((a=this.services)==null?void 0:a.languageUtils)||new zR(gb());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const r=new ld(t,n);return r.createInstance=ld.createInstance,r}cloneInstance(t={},n=_h){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const o={...this.options,...t,isClone:!0},a=new ld(o);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),["store","services","language"].forEach(c=>{a[c]=this[c]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r){const c=Object.keys(this.store.data).reduce((f,d)=>(f[d]={...this.store.data[d]},f[d]=Object.keys(f[d]).reduce((m,h)=>(m[h]={...f[d][h]},m),f[d]),f),{});a.store=new LR(c,o),a.services.resourceStore=a.store}if(t.interpolation){const f={...gb().interpolation,...this.options.interpolation,...t.interpolation},d={...o,interpolation:f};a.services.interpolator=new HR(d)}return a.translator=new kp(a.services,o),a.translator.on("*",(c,...f)=>{a.emit(c,...f)}),a.init(o,n),a.translator.options=o,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Qt=ld.createInstance();Qt.createInstance;Qt.dir;Qt.init;Qt.loadResources;Qt.reloadResources;Qt.use;Qt.changeLanguage;Qt.getFixedT;Qt.t;Qt.exists;Qt.setDefaultNamespace;Qt.hasLoadedNamespace;Qt.loadNamespaces;Qt.loadLanguages;const bF=(e,t,n,r)=>{var a,l,c,f;const o=[n,{code:t,...r||{}}];if((l=(a=e==null?void 0:e.services)==null?void 0:a.logger)!=null&&l.forward)return e.services.logger.forward(o,"warn","react-i18next::",!0);Xs(o[0])&&(o[0]=`react-i18next:: ${o[0]}`),(f=(c=e==null?void 0:e.services)==null?void 0:c.logger)!=null&&f.warn?e.services.logger.warn(...o):console!=null&&console.warn&&console.warn(...o)},$R={},j2=(e,t,n,r)=>{Xs(n)&&$R[n]||(Xs(n)&&($R[n]=new Date),bF(e,t,n,r))},z2=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},Fv=(e,t,n)=>{e.loadNamespaces(t,z2(e,n))},GR=(e,t,n,r)=>{if(Xs(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Fv(e,n,r);n.forEach(o=>{e.options.ns.indexOf(o)<0&&e.options.ns.push(o)}),e.loadLanguages(t,z2(e,r))},vF=(e,t,n={})=>!t.languages||!t.languages.length?(j2(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,o)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!o(r.isLanguageChangingTo,e))return!1}}),Xs=e=>typeof e=="string",xF=e=>typeof e=="object"&&e!==null,wF=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,SF={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},EF=e=>SF[e],TF=e=>e.replace(wF,EF);let Bv={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:TF,transDefaultProps:void 0};const RF=(e={})=>{Bv={...Bv,...e}},CF=()=>Bv;let F2;const kF=e=>{F2=e},MF=()=>F2,OF={type:"3rdParty",init(e){RF(e.options.react),kF(e)}},NF=v.createContext();class AF{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var yb={exports:{}},bb={};/**
|
|
78
|
+
* @license React
|
|
79
|
+
* use-sync-external-store-shim.production.js
|
|
80
|
+
*
|
|
81
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the MIT license found in the
|
|
84
|
+
* LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/var YR;function DF(){if(YR)return bb;YR=1;var e=Vd();function t(h,y){return h===y&&(h!==0||1/h===1/y)||h!==h&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function c(h,y){var g=y(),x=r({inst:{value:g,getSnapshot:y}}),E=x[0].inst,R=x[1];return a(function(){E.value=g,E.getSnapshot=y,f(E)&&R({inst:E})},[h,g,y]),o(function(){return f(E)&&R({inst:E}),h(function(){f(E)&&R({inst:E})})},[h]),l(g),g}function f(h){var y=h.getSnapshot;h=h.value;try{var g=y();return!n(h,g)}catch{return!0}}function d(h,y){return y()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:c;return bb.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,bb}var KR;function B2(){return KR||(KR=1,yb.exports=DF()),yb.exports}var aw=B2();const _F=(e,t)=>Xs(t)?t:xF(t)&&Xs(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e,IF={t:_F,ready:!1},PF=()=>()=>{},mn=(e,t={})=>{var q,F,G;const{i18n:n}=t,{i18n:r,defaultNS:o}=v.useContext(NF)||{},a=n||r||MF();a&&!a.reportNamespaces&&(a.reportNamespaces=new AF),a||j2(a,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const l=v.useMemo(()=>{var P;return{...CF(),...(P=a==null?void 0:a.options)==null?void 0:P.react,...t}},[a,t]),{useSuspense:c,keyPrefix:f}=l,d=o||((q=a==null?void 0:a.options)==null?void 0:q.defaultNS),m=Xs(d)?[d]:d||["translation"],h=v.useMemo(()=>m,m);(G=(F=a==null?void 0:a.reportNamespaces)==null?void 0:F.addUsedNamespaces)==null||G.call(F,h);const y=v.useRef(0),g=v.useCallback(P=>{if(!a)return PF;const{bindI18n:U,bindI18nStore:H}=l,B=()=>{y.current+=1,P()};return U&&a.on(U,B),H&&a.store.on(H,B),()=>{U&&U.split(" ").forEach(j=>a.off(j,B)),H&&H.split(" ").forEach(j=>a.store.off(j,B))}},[a,l]),x=v.useRef(),E=v.useCallback(()=>{if(!a)return IF;const P=!!(a.isInitialized||a.initializedStoreOnce)&&h.every(V=>vF(V,a,l)),U=t.lng||a.language,H=y.current,B=x.current;if(B&&B.ready===P&&B.lng===U&&B.keyPrefix===f&&B.revision===H)return B;const z={t:a.getFixedT(U,l.nsMode==="fallback"?h:h[0],f),ready:P,lng:U,keyPrefix:f,revision:H};return x.current=z,z},[a,h,f,l,t.lng]),[R,T]=v.useState(0),{t:C,ready:k}=aw.useSyncExternalStore(g,E,E);v.useEffect(()=>{if(a&&!k&&!c){const P=()=>T(U=>U+1);t.lng?GR(a,t.lng,h,P):Fv(a,h,P)}},[a,t.lng,h,k,c,R]);const M=a||{},D=v.useRef(null),O=v.useRef(),N=P=>{const U=Object.getOwnPropertyDescriptors(P);U.__original&&delete U.__original;const H=Object.create(Object.getPrototypeOf(P),U);if(!Object.prototype.hasOwnProperty.call(H,"__original"))try{Object.defineProperty(H,"__original",{value:P,writable:!1,enumerable:!1,configurable:!1})}catch{}return H},_=v.useMemo(()=>{const P=M,U=P==null?void 0:P.language;let H=P;P&&(D.current&&D.current.__original===P?O.current!==U?(H=N(P),D.current=H,O.current=U):H=D.current:(H=N(P),D.current=H,O.current=U));const B=[C,H,k];return B.t=C,B.i18n=H,B.ready=k,B},[C,M,k,M.resolvedLanguage,M.language,M.languages]);if(a&&c&&!k)throw new Promise(P=>{const U=()=>P();t.lng?GR(a,t.lng,h,U):Fv(a,h,U)});return _};function LF(){const e=navigator.language;return e.startsWith("zh")?"zh_CN":e.startsWith("ja")?"ja_JP":Gx}Qt.use(OF).init({resources:CL,lng:LF(),fallbackLng:Gx,interpolation:{escapeValue:!1},returnNull:!1});function Uv(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const cd={};function ki(e,t,n,r,o){let a={...Hv(e,cd)};return t&&(a=td(a,t)),n&&(a=td(a,n)),r&&(a=td(a,r)),o&&(a=td(a,o)),a}function jF(e){if(e.length===0)return cd;if(e.length===1)return Hv(e[0],cd);let t={...Hv(e[0],cd)};for(let n=1;n<e.length;n+=1)t=td(t,e[n]);return t}function td(e,t){return U2(t)?t(e):zF(e,t)}function zF(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=Uv(e.style,r);break}case"className":{e[n]=H2(e.className,r);break}default:FF(n,r)?e[n]=BF(e[n],r):e[n]=r}}return e}function FF(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),o=e.charCodeAt(2);return n===111&&r===110&&o>=65&&o<=90&&(typeof t=="function"||typeof t>"u")}function U2(e){return typeof e=="function"}function Hv(e,t){return U2(e)?e(t):e??cd}function BF(e,t){return t?e?n=>{if(UF(n)){const o=n;qv(o);const a=t(o);return o.baseUIHandlerPrevented||e==null||e(o),a}const r=t(n);return e==null||e(n),r}:t:e}function qv(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function H2(e,t){return t?e?t+" "+e:t:e}function UF(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Rn(e,...t){const n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",e.toString()),t.forEach(r=>n.searchParams.append("args[]",r)),`Base UI error #${e}; visit ${n} for the full message.`}const WR={};function rr(e,t){const n=v.useRef(WR);return n.current===WR&&(n.current=e(t)),n}function Hi(e,t,n,r){const o=rr(q2).current;return qF(o,e,t,n,r)&&V2(o,[e,t,n,r]),o.callback}function HF(e){const t=rr(q2).current;return VF(t,e)&&V2(t,e),t.callback}function q2(){return{callback:null,cleanup:null,refs:[]}}function qF(e,t,n,r,o){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==o}function VF(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function V2(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let o=0;o<t.length;o+=1){const a=t[o];if(a!=null)switch(typeof a){case"function":{const l=a(n);typeof l=="function"&&(r[o]=l);break}case"object":{a.current=n;break}}}e.cleanup=()=>{for(let o=0;o<t.length;o+=1){const a=t[o];if(a!=null)switch(typeof a){case"function":{const l=r[o];typeof l=="function"?l():a(null);break}case"object":{a.current=null;break}}}}}}}const $F=parseInt(v.version,10);function sw(e){return $F>=e}function XR(e){if(!v.isValidElement(e))return null;const t=e,n=t.props;return(sw(19)?n==null?void 0:n.ref:t.ref)??null}function GF(e,t){const n={};for(const r in e){const o=e[r];if(t!=null&&t.hasOwnProperty(r)){const a=t[r](o);a!=null&&Object.assign(n,a);continue}o===!0?n[`data-${r.toLowerCase()}`]="":o&&(n[`data-${r.toLowerCase()}`]=o.toString())}return n}function YF(e,t){return typeof e=="function"?e(t):e}function KF(e,t){return typeof e=="function"?e(t):e}function Ur(){}const Ka=Object.freeze([]),Pn=Object.freeze({}),WF=500,XF=500,QF={style:{transition:"none"}},ZF="data-base-ui-click-trigger",$2={fallbackAxisSide:"none"},G2={fallbackAxisSide:"end"},JF={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function At(e,t,n={}){const r=t.render,o=eB(t,n);if(n.enabled===!1)return null;const a=n.state??Pn;return nB(e,r,o,a)}function eB(e,t={}){const{className:n,style:r,render:o}=e,{state:a=Pn,ref:l,props:c,stateAttributesMapping:f,enabled:d=!0}=t,m=d?YF(n,a):void 0,h=d?KF(r,a):void 0,y=d?GF(a,f):Pn,g=d?Uv(y,Array.isArray(c)?jF(c):c)??Pn:Pn;return typeof document<"u"&&(d?Array.isArray(l)?g.ref=HF([g.ref,XR(o),...l]):g.ref=Hi(g.ref,XR(o),l):Hi(null,null)),d?(m!==void 0&&(g.className=H2(g.className,m)),h!==void 0&&(g.style=Uv(g.style,h)),g):Pn}const tB=Symbol.for("react.lazy");function nB(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const o=ki(n,t.props);o.ref=n.ref;let a=t;return(a==null?void 0:a.$$typeof)===tB&&(a=v.Children.toArray(t)[0]),v.cloneElement(a,o)}if(e&&typeof e=="string")return rB(e,n);throw new Error(Rn(8))}function rB(e,t){return e==="button"?v.createElement("button",{type:"button",...t,key:t.key}):e==="img"?v.createElement("img",{alt:"",...t,key:t.key}):v.createElement(e,t)}function lm(e){return At(e.defaultTagName??"div",e,e)}function Y2(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Y2(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function K2(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Y2(e))&&(r&&(r+=" "),r+=t);return r}const QR=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ZR=K2,cm=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return ZR(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:a}=t,l=Object.keys(o).map(d=>{const m=n==null?void 0:n[d],h=a==null?void 0:a[d];if(m===null)return null;const y=QR(m)||QR(h);return o[d][y]}),c=n&&Object.entries(n).reduce((d,m)=>{let[h,y]=m;return y===void 0||(d[h]=y),d},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,m)=>{let{class:h,className:y,...g}=m;return Object.entries(g).every(x=>{let[E,R]=x;return Array.isArray(R)?R.includes({...a,...c}[E]):{...a,...c}[E]===R})?[...d,h,y]:d},[]);return ZR(e,l,f,n==null?void 0:n.class,n==null?void 0:n.className)},vb=768;function iB(){const[e,t]=v.useState(void 0);return v.useEffect(()=>{const n=window.matchMedia(`(max-width: ${vb-1}px)`),r=()=>{t(window.innerWidth<vb)};return n.addEventListener("change",r),t(window.innerWidth<vb),()=>n.removeEventListener("change",r)},[]),!!e}const oB=(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},aB=(e,t)=>({classGroupId:e,validator:t}),W2=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Mp="-",JR=[],sB="arbitrary..",lB=e=>{const t=uB(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return cB(l);const c=l.split(Mp),f=c[0]===""&&c.length>1?1:0;return X2(c,f,t)},getConflictingClassGroupIds:(l,c)=>{if(c){const f=r[l],d=n[l];return f?d?oB(d,f):f:d||JR}return n[l]||JR}}},X2=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],a=n.nextPart.get(o);if(a){const d=X2(e,t+1,a);if(d)return d}const l=n.validators;if(l===null)return;const c=t===0?e.join(Mp):e.slice(t).join(Mp),f=l.length;for(let d=0;d<f;d++){const m=l[d];if(m.validator(c))return m.classGroupId}},cB=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?sB+r:void 0})(),uB=e=>{const{theme:t,classGroups:n}=e;return dB(n,t)},dB=(e,t)=>{const n=W2();for(const r in e){const o=e[r];lw(o,n,r,t)}return n},lw=(e,t,n,r)=>{const o=e.length;for(let a=0;a<o;a++){const l=e[a];fB(l,t,n,r)}},fB=(e,t,n,r)=>{if(typeof e=="string"){hB(e,t,n);return}if(typeof e=="function"){pB(e,t,n,r);return}mB(e,t,n,r)},hB=(e,t,n)=>{const r=e===""?t:Q2(t,e);r.classGroupId=n},pB=(e,t,n,r)=>{if(gB(e)){lw(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(aB(n,e))},mB=(e,t,n,r)=>{const o=Object.entries(e),a=o.length;for(let l=0;l<a;l++){const[c,f]=o[l];lw(f,Q2(t,c),n,r)}},Q2=(e,t)=>{let n=e;const r=t.split(Mp),o=r.length;for(let a=0;a<o;a++){const l=r[a];let c=n.nextPart.get(l);c||(c=W2(),n.nextPart.set(l,c)),n=c}return n},gB=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,yB=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(a,l)=>{n[a]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let l=n[a];if(l!==void 0)return l;if((l=r[a])!==void 0)return o(a,l),l},set(a,l){a in n?n[a]=l:o(a,l)}}},Vv="!",eC=":",bB=[],tC=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),vB=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const a=[];let l=0,c=0,f=0,d;const m=o.length;for(let E=0;E<m;E++){const R=o[E];if(l===0&&c===0){if(R===eC){a.push(o.slice(f,E)),f=E+1;continue}if(R==="/"){d=E;continue}}R==="["?l++:R==="]"?l--:R==="("?c++:R===")"&&c--}const h=a.length===0?o:o.slice(f);let y=h,g=!1;h.endsWith(Vv)?(y=h.slice(0,-1),g=!0):h.startsWith(Vv)&&(y=h.slice(1),g=!0);const x=d&&d>f?d-f:void 0;return tC(a,g,y,x)};if(t){const o=t+eC,a=r;r=l=>l.startsWith(o)?a(l.slice(o.length)):tC(bB,!1,l,void 0,!0)}if(n){const o=r;r=a=>n({className:a,parseClassName:o})}return r},xB=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let a=0;a<n.length;a++){const l=n[a],c=l[0]==="[",f=t.has(l);c||f?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(l)):o.push(l)}return o.length>0&&(o.sort(),r.push(...o)),r}},wB=e=>({cache:yB(e.cacheSize),parseClassName:vB(e),sortModifiers:xB(e),...lB(e)}),SB=/\s+/,EB=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:a}=t,l=[],c=e.trim().split(SB);let f="";for(let d=c.length-1;d>=0;d-=1){const m=c[d],{isExternal:h,modifiers:y,hasImportantModifier:g,baseClassName:x,maybePostfixModifierPosition:E}=n(m);if(h){f=m+(f.length>0?" "+f:f);continue}let R=!!E,T=r(R?x.substring(0,E):x);if(!T){if(!R){f=m+(f.length>0?" "+f:f);continue}if(T=r(x),!T){f=m+(f.length>0?" "+f:f);continue}R=!1}const C=y.length===0?"":y.length===1?y[0]:a(y).join(":"),k=g?C+Vv:C,M=k+T;if(l.indexOf(M)>-1)continue;l.push(M);const D=o(T,R);for(let O=0;O<D.length;++O){const N=D[O];l.push(k+N)}f=m+(f.length>0?" "+f:f)}return f},TB=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=Z2(n))&&(o&&(o+=" "),o+=r);return o},Z2=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Z2(e[r]))&&(n&&(n+=" "),n+=t);return n},RB=(e,...t)=>{let n,r,o,a;const l=f=>{const d=t.reduce((m,h)=>h(m),e());return n=wB(d),r=n.cache.get,o=n.cache.set,a=c,c(f)},c=f=>{const d=r(f);if(d)return d;const m=EB(f,n);return o(f,m),m};return a=l,(...f)=>a(TB(...f))},CB=[],er=e=>{const t=n=>n[e]||CB;return t.isThemeGetter=!0,t},J2=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,eO=/^\((?:(\w[\w-]*):)?(.+)\)$/i,kB=/^\d+\/\d+$/,MB=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,OB=/\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$/,NB=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,AB=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,DB=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Hl=e=>kB.test(e),Vt=e=>!!e&&!Number.isNaN(Number(e)),Ta=e=>!!e&&Number.isInteger(Number(e)),xb=e=>e.endsWith("%")&&Vt(e.slice(0,-1)),Po=e=>MB.test(e),_B=()=>!0,IB=e=>OB.test(e)&&!NB.test(e),tO=()=>!1,PB=e=>AB.test(e),LB=e=>DB.test(e),jB=e=>!lt(e)&&!ct(e),zB=e=>Ic(e,iO,tO),lt=e=>J2.test(e),ks=e=>Ic(e,oO,IB),wb=e=>Ic(e,qB,Vt),nC=e=>Ic(e,nO,tO),FB=e=>Ic(e,rO,LB),Ih=e=>Ic(e,aO,PB),ct=e=>eO.test(e),Hu=e=>Pc(e,oO),BB=e=>Pc(e,VB),rC=e=>Pc(e,nO),UB=e=>Pc(e,iO),HB=e=>Pc(e,rO),Ph=e=>Pc(e,aO,!0),Ic=(e,t,n)=>{const r=J2.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Pc=(e,t,n=!1)=>{const r=eO.exec(e);return r?r[1]?t(r[1]):n:!1},nO=e=>e==="position"||e==="percentage",rO=e=>e==="image"||e==="url",iO=e=>e==="length"||e==="size"||e==="bg-size",oO=e=>e==="length",qB=e=>e==="number",VB=e=>e==="family-name",aO=e=>e==="shadow",$B=()=>{const e=er("color"),t=er("font"),n=er("text"),r=er("font-weight"),o=er("tracking"),a=er("leading"),l=er("breakpoint"),c=er("container"),f=er("spacing"),d=er("radius"),m=er("shadow"),h=er("inset-shadow"),y=er("text-shadow"),g=er("drop-shadow"),x=er("blur"),E=er("perspective"),R=er("aspect"),T=er("ease"),C=er("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...M(),ct,lt],O=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],_=()=>[ct,lt,f],q=()=>[Hl,"full","auto",..._()],F=()=>[Ta,"none","subgrid",ct,lt],G=()=>["auto",{span:["full",Ta,ct,lt]},Ta,ct,lt],P=()=>[Ta,"auto",ct,lt],U=()=>["auto","min","max","fr",ct,lt],H=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],B=()=>["start","end","center","stretch","center-safe","end-safe"],j=()=>["auto",..._()],z=()=>[Hl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",..._()],V=()=>[e,ct,lt],K=()=>[...M(),rC,nC,{position:[ct,lt]}],L=()=>["no-repeat",{repeat:["","x","y","space","round"]}],$=()=>["auto","cover","contain",UB,zB,{size:[ct,lt]}],W=()=>[xb,Hu,ks],I=()=>["","none","full",d,ct,lt],Q=()=>["",Vt,Hu,ks],le=()=>["solid","dashed","dotted","double"],oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Z=()=>[Vt,xb,rC,nC],ue=()=>["","none",x,ct,lt],ve=()=>["none",Vt,ct,lt],Se=()=>["none",Vt,ct,lt],Pe=()=>[Vt,ct,lt],te=()=>[Hl,"full",..._()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Po],breakpoint:[Po],color:[_B],container:[Po],"drop-shadow":[Po],ease:["in","out","in-out"],font:[jB],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Po],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Po],shadow:[Po],spacing:["px",Vt],text:[Po],"text-shadow":[Po],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Hl,lt,ct,R]}],container:["container"],columns:[{columns:[Vt,lt,ct,c]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"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:D()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:q()}],"inset-x":[{"inset-x":q()}],"inset-y":[{"inset-y":q()}],start:[{start:q()}],end:[{end:q()}],top:[{top:q()}],right:[{right:q()}],bottom:[{bottom:q()}],left:[{left:q()}],visibility:["visible","invisible","collapse"],z:[{z:[Ta,"auto",ct,lt]}],basis:[{basis:[Hl,"full","auto",c,..._()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Vt,Hl,"auto","initial","none",lt]}],grow:[{grow:["",Vt,ct,lt]}],shrink:[{shrink:["",Vt,ct,lt]}],order:[{order:[Ta,"first","last","none",ct,lt]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:G()}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:G()}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":U()}],"auto-rows":[{"auto-rows":U()}],gap:[{gap:_()}],"gap-x":[{"gap-x":_()}],"gap-y":[{"gap-y":_()}],"justify-content":[{justify:[...H(),"normal"]}],"justify-items":[{"justify-items":[...B(),"normal"]}],"justify-self":[{"justify-self":["auto",...B()]}],"align-content":[{content:["normal",...H()]}],"align-items":[{items:[...B(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...B(),{baseline:["","last"]}]}],"place-content":[{"place-content":H()}],"place-items":[{"place-items":[...B(),"baseline"]}],"place-self":[{"place-self":["auto",...B()]}],p:[{p:_()}],px:[{px:_()}],py:[{py:_()}],ps:[{ps:_()}],pe:[{pe:_()}],pt:[{pt:_()}],pr:[{pr:_()}],pb:[{pb:_()}],pl:[{pl:_()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":_()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":_()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],w:[{w:[c,"screen",...z()]}],"min-w":[{"min-w":[c,"screen","none",...z()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...z()]}],h:[{h:["screen","lh",...z()]}],"min-h":[{"min-h":["screen","lh","none",...z()]}],"max-h":[{"max-h":["screen","lh",...z()]}],"font-size":[{text:["base",n,Hu,ks]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ct,wb]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",xb,lt]}],"font-family":[{font:[BB,lt,t]}],"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:[o,ct,lt]}],"line-clamp":[{"line-clamp":[Vt,"none",ct,wb]}],leading:[{leading:[a,..._()]}],"list-image":[{"list-image":["none",ct,lt]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ct,lt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:V()}],"text-color":[{text:V()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:[Vt,"from-font","auto",ct,ks]}],"text-decoration-color":[{decoration:V()}],"underline-offset":[{"underline-offset":[Vt,"auto",ct,lt]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:_()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ct,lt]}],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",ct,lt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:K()}],"bg-repeat":[{bg:L()}],"bg-size":[{bg:$()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ta,ct,lt],radial:["",ct,lt],conic:[Ta,ct,lt]},HB,FB]}],"bg-color":[{bg:V()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:V()}],"gradient-via":[{via:V()}],"gradient-to":[{to:V()}],rounded:[{rounded:I()}],"rounded-s":[{"rounded-s":I()}],"rounded-e":[{"rounded-e":I()}],"rounded-t":[{"rounded-t":I()}],"rounded-r":[{"rounded-r":I()}],"rounded-b":[{"rounded-b":I()}],"rounded-l":[{"rounded-l":I()}],"rounded-ss":[{"rounded-ss":I()}],"rounded-se":[{"rounded-se":I()}],"rounded-ee":[{"rounded-ee":I()}],"rounded-es":[{"rounded-es":I()}],"rounded-tl":[{"rounded-tl":I()}],"rounded-tr":[{"rounded-tr":I()}],"rounded-br":[{"rounded-br":I()}],"rounded-bl":[{"rounded-bl":I()}],"border-w":[{border:Q()}],"border-w-x":[{"border-x":Q()}],"border-w-y":[{"border-y":Q()}],"border-w-s":[{"border-s":Q()}],"border-w-e":[{"border-e":Q()}],"border-w-t":[{"border-t":Q()}],"border-w-r":[{"border-r":Q()}],"border-w-b":[{"border-b":Q()}],"border-w-l":[{"border-l":Q()}],"divide-x":[{"divide-x":Q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...le(),"hidden","none"]}],"divide-style":[{divide:[...le(),"hidden","none"]}],"border-color":[{border:V()}],"border-color-x":[{"border-x":V()}],"border-color-y":[{"border-y":V()}],"border-color-s":[{"border-s":V()}],"border-color-e":[{"border-e":V()}],"border-color-t":[{"border-t":V()}],"border-color-r":[{"border-r":V()}],"border-color-b":[{"border-b":V()}],"border-color-l":[{"border-l":V()}],"divide-color":[{divide:V()}],"outline-style":[{outline:[...le(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Vt,ct,lt]}],"outline-w":[{outline:["",Vt,Hu,ks]}],"outline-color":[{outline:V()}],shadow:[{shadow:["","none",m,Ph,Ih]}],"shadow-color":[{shadow:V()}],"inset-shadow":[{"inset-shadow":["none",h,Ph,Ih]}],"inset-shadow-color":[{"inset-shadow":V()}],"ring-w":[{ring:Q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:V()}],"ring-offset-w":[{"ring-offset":[Vt,ks]}],"ring-offset-color":[{"ring-offset":V()}],"inset-ring-w":[{"inset-ring":Q()}],"inset-ring-color":[{"inset-ring":V()}],"text-shadow":[{"text-shadow":["none",y,Ph,Ih]}],"text-shadow-color":[{"text-shadow":V()}],opacity:[{opacity:[Vt,ct,lt]}],"mix-blend":[{"mix-blend":[...oe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":oe()}],"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":[Vt]}],"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":V()}],"mask-image-linear-to-color":[{"mask-linear-to":V()}],"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":V()}],"mask-image-t-to-color":[{"mask-t-to":V()}],"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":V()}],"mask-image-r-to-color":[{"mask-r-to":V()}],"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":V()}],"mask-image-b-to-color":[{"mask-b-to":V()}],"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":V()}],"mask-image-l-to-color":[{"mask-l-to":V()}],"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":V()}],"mask-image-x-to-color":[{"mask-x-to":V()}],"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":V()}],"mask-image-y-to-color":[{"mask-y-to":V()}],"mask-image-radial":[{"mask-radial":[ct,lt]}],"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":V()}],"mask-image-radial-to-color":[{"mask-radial-to":V()}],"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":M()}],"mask-image-conic-pos":[{"mask-conic":[Vt]}],"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":V()}],"mask-image-conic-to-color":[{"mask-conic-to":V()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:K()}],"mask-repeat":[{mask:L()}],"mask-size":[{mask:$()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ct,lt]}],filter:[{filter:["","none",ct,lt]}],blur:[{blur:ue()}],brightness:[{brightness:[Vt,ct,lt]}],contrast:[{contrast:[Vt,ct,lt]}],"drop-shadow":[{"drop-shadow":["","none",g,Ph,Ih]}],"drop-shadow-color":[{"drop-shadow":V()}],grayscale:[{grayscale:["",Vt,ct,lt]}],"hue-rotate":[{"hue-rotate":[Vt,ct,lt]}],invert:[{invert:["",Vt,ct,lt]}],saturate:[{saturate:[Vt,ct,lt]}],sepia:[{sepia:["",Vt,ct,lt]}],"backdrop-filter":[{"backdrop-filter":["","none",ct,lt]}],"backdrop-blur":[{"backdrop-blur":ue()}],"backdrop-brightness":[{"backdrop-brightness":[Vt,ct,lt]}],"backdrop-contrast":[{"backdrop-contrast":[Vt,ct,lt]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Vt,ct,lt]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Vt,ct,lt]}],"backdrop-invert":[{"backdrop-invert":["",Vt,ct,lt]}],"backdrop-opacity":[{"backdrop-opacity":[Vt,ct,lt]}],"backdrop-saturate":[{"backdrop-saturate":[Vt,ct,lt]}],"backdrop-sepia":[{"backdrop-sepia":["",Vt,ct,lt]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":_()}],"border-spacing-x":[{"border-spacing-x":_()}],"border-spacing-y":[{"border-spacing-y":_()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ct,lt]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Vt,"initial",ct,lt]}],ease:[{ease:["linear","initial",T,ct,lt]}],delay:[{delay:[Vt,ct,lt]}],animate:[{animate:["none",C,ct,lt]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[E,ct,lt]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:ve()}],"rotate-x":[{"rotate-x":ve()}],"rotate-y":[{"rotate-y":ve()}],"rotate-z":[{"rotate-z":ve()}],scale:[{scale:Se()}],"scale-x":[{"scale-x":Se()}],"scale-y":[{"scale-y":Se()}],"scale-z":[{"scale-z":Se()}],"scale-3d":["scale-3d"],skew:[{skew:Pe()}],"skew-x":[{"skew-x":Pe()}],"skew-y":[{"skew-y":Pe()}],transform:[{transform:[ct,lt,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:te()}],"translate-x":[{"translate-x":te()}],"translate-y":[{"translate-y":te()}],"translate-z":[{"translate-z":te()}],"translate-none":["translate-none"],accent:[{accent:V()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:V()}],"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",ct,lt]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":_()}],"scroll-mx":[{"scroll-mx":_()}],"scroll-my":[{"scroll-my":_()}],"scroll-ms":[{"scroll-ms":_()}],"scroll-me":[{"scroll-me":_()}],"scroll-mt":[{"scroll-mt":_()}],"scroll-mr":[{"scroll-mr":_()}],"scroll-mb":[{"scroll-mb":_()}],"scroll-ml":[{"scroll-ml":_()}],"scroll-p":[{"scroll-p":_()}],"scroll-px":[{"scroll-px":_()}],"scroll-py":[{"scroll-py":_()}],"scroll-ps":[{"scroll-ps":_()}],"scroll-pe":[{"scroll-pe":_()}],"scroll-pt":[{"scroll-pt":_()}],"scroll-pr":[{"scroll-pr":_()}],"scroll-pb":[{"scroll-pb":_()}],"scroll-pl":[{"scroll-pl":_()}],"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",ct,lt]}],fill:[{fill:["none",...V()]}],"stroke-w":[{stroke:[Vt,Hu,ks,wb]}],stroke:[{stroke:["none",...V()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-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-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-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-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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},GB=RB($B);function De(...e){return GB(K2(e))}function um(){return typeof window<"u"}function Ja(e){return cw(e)?(e.nodeName||"").toLowerCase():"#document"}function Hn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ho(e){var t;return(t=(cw(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function cw(e){return um()?e instanceof Node||e instanceof Hn(e).Node:!1}function fn(e){return um()?e instanceof Element||e instanceof Hn(e).Element:!1}function On(e){return um()?e instanceof HTMLElement||e instanceof Hn(e).HTMLElement:!1}function $v(e){return!um()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Hn(e).ShadowRoot}const YB=new Set(["inline","contents"]);function es(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=si(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!YB.has(o)}const KB=new Set(["table","td","th"]);function WB(e){return KB.has(Ja(e))}const XB=[":popover-open",":modal"];function dm(e){return XB.some(t=>{try{return e.matches(t)}catch{return!1}})}const QB=["transform","translate","scale","rotate","perspective"],ZB=["transform","translate","scale","rotate","perspective","filter"],JB=["paint","layout","strict","content"];function uw(e){const t=fm(),n=fn(e)?si(e):e;return QB.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||ZB.some(r=>(n.willChange||"").includes(r))||JB.some(r=>(n.contain||"").includes(r))}function eU(e){let t=co(e);for(;On(t)&&!ao(t);){if(uw(t))return t;if(dm(t))return null;t=co(t)}return null}function fm(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const tU=new Set(["html","body","#document"]);function ao(e){return tU.has(Ja(e))}function si(e){return Hn(e).getComputedStyle(e)}function hm(e){return fn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function co(e){if(Ja(e)==="html")return e;const t=e.assignedSlot||e.parentNode||$v(e)&&e.host||ho(e);return $v(t)?t.host:t}function sO(e){const t=co(e);return ao(t)?e.ownerDocument?e.ownerDocument.body:e.body:On(t)&&es(t)?t:sO(t)}function Va(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=sO(e),a=o===((r=e.ownerDocument)==null?void 0:r.body),l=Hn(o);if(a){const c=Gv(l);return t.concat(l,l.visualViewport||[],es(o)?o:[],c&&n?Va(c):[])}return t.concat(o,Va(o,[],n))}function Gv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Sb=$x[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],nU=Sb&&Sb!==v.useLayoutEffect?Sb:e=>e();function Ge(e){const t=rr(rU).current;return t.next=e,nU(t.effect),t.trampoline}function rU(){const e={next:void 0,callback:iU,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function iU(){}const oU={...$x},aU=()=>{},qe=typeof document<"u"?v.useLayoutEffect:aU,lO=v.createContext(void 0);function dw(e=!1){const t=v.useContext(lO);if(t===void 0&&!e)throw new Error(Rn(16));return t}function sU(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:o=0,isNativeButton:a}=e,l=r&&t!==!1,c=r&&t===!1;return{props:v.useMemo(()=>{const d={onKeyDown(m){n&&t&&m.key!=="Tab"&&m.preventDefault()}};return r||(d.tabIndex=o,!a&&n&&(d.tabIndex=t?o:-1)),(a&&(t||l)||!a&&n)&&(d["aria-disabled"]=n),a&&(!t||c)&&(d.disabled=n),d},[r,n,t,l,c,a,o])}}function Wo(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:o=!0}=e,a=v.useRef(null),l=dw(!0)!==void 0,c=Ge(()=>{const y=a.current;return!!((y==null?void 0:y.tagName)==="A"&&(y!=null&&y.href))}),{props:f}=sU({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:r,isNativeButton:o}),d=v.useCallback(()=>{const y=a.current;lU(y)&&l&&t&&f.disabled===void 0&&y.disabled&&(y.disabled=!1)},[t,f.disabled,l]);qe(d,[d]);const m=v.useCallback((y={})=>{const{onClick:g,onMouseDown:x,onKeyUp:E,onKeyDown:R,onPointerDown:T,...C}=y;return ki({type:o?"button":void 0,onClick(M){if(t){M.preventDefault();return}g==null||g(M)},onMouseDown(M){t||x==null||x(M)},onKeyDown(M){if(t||(qv(M),R==null||R(M)),M.baseUIHandlerPrevented)return;const D=M.target===M.currentTarget&&!o&&!c()&&!t,O=M.key==="Enter",N=M.key===" ";D&&((N||O)&&M.preventDefault(),O&&(g==null||g(M)))},onKeyUp(M){t||(qv(M),E==null||E(M)),!M.baseUIHandlerPrevented&&M.target===M.currentTarget&&!o&&!t&&M.key===" "&&(g==null||g(M))},onPointerDown(M){if(t){M.preventDefault();return}T==null||T(M)}},o?void 0:{role:"button"},f,C)},[t,f,o,c]),h=Ge(y=>{a.current=y,d()});return{getButtonProps:m,buttonRef:h}}function lU(e){return On(e)&&e.tagName==="BUTTON"}const cU=v.forwardRef(function(t,n){const{render:r,className:o,disabled:a=!1,focusableWhenDisabled:l=!1,nativeButton:c=!0,...f}=t,{getButtonProps:d,buttonRef:m}=Wo({disabled:a,focusableWhenDisabled:l,native:c});return At("button",t,{state:{disabled:a},ref:[n,m],props:[f,d]})}),uU=cm("focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground",destructive:"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function Ht({className:e,variant:t="default",size:n="default",...r}){return w.jsx(cU,{"data-slot":"button",className:De(uU({variant:t,size:n,className:e})),...r})}let iC=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const dU={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},fw={valid(e){return e===null?null:e?{[iC.valid]:""}:{[iC.invalid]:""}}},fU=v.createContext({invalid:void 0,name:void 0,validityData:{state:dU,errors:[],error:"",value:"",initialValue:null},setValidityData:Ur,disabled:void 0,touched:!1,setTouched:Ur,dirty:!1,setDirty:Ur,filled:!1,setFilled:Ur,focused:!1,setFocused:Ur,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=Pn)=>e,getInputValidationProps:(e=Pn)=>e,inputRef:{current:null},commit:async()=>{}}});function Lc(e=!0){const t=v.useContext(fU);if(t.setValidityData===Ur&&!e)throw new Error(Rn(28));return t}const hU=v.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Ur,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function hw(){return v.useContext(hU)}let oC=0;function pU(e,t="mui"){const[n,r]=v.useState(e),o=e||n;return v.useEffect(()=>{n==null&&(oC+=1,r(`${t}-${oC}`))},[n,t]),o}const aC=oU.useId;function ts(e,t){if(aC!==void 0){const n=aC();return e??(t?`${t}-${n}`:n)}return pU(e,t)}function Yi(e){return ts(e,"base-ui")}const mU=v.createContext({controlId:void 0,registerControlId:Ur,labelId:void 0,setLabelId:Ur,messageIds:[],setMessageIds:Ur,getDescriptionProps:e=>e});function pm(){return v.useContext(mU)}const gU=[];function mm(e){v.useEffect(e,gU)}const qu=0;class uo{constructor(){tt(this,"currentId",qu);tt(this,"clear",()=>{this.currentId!==qu&&(clearTimeout(this.currentId),this.currentId=qu)});tt(this,"disposeEffect",()=>this.clear)}static create(){return new uo}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=qu,n()},t)}isStarted(){return this.currentId!==qu}}function Dn(){const e=rr(uo.create).current;return mm(e.disposeEffect),e}function yU(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function Gt(e){return(e==null?void 0:e.ownerDocument)||document}const jc=typeof navigator<"u",Eb=vU(),cO=wU(),uO=xU(),gm=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),dO=Eb.platform==="MacIntel"&&Eb.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Eb.platform),fO=jc&&/apple/i.test(navigator.vendor),Yv=jc&&/android/i.test(cO)||/android/i.test(uO),bU=jc&&cO.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,hO=uO.includes("jsdom/");function vU(){if(!jc)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e!=null&&e.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function xU(){if(!jc)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function wU(){if(!jc)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}const Kv="data-base-ui-focusable",pO="active",mO="selected",gO="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",$a="ArrowLeft",Ga="ArrowRight",pw="ArrowUp",Xd="ArrowDown";function ri(e){var n;let t=e.activeElement;for(;((n=t==null?void 0:t.shadowRoot)==null?void 0:n.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function Tt(e,t){var r;if(!e||!t)return!1;const n=(r=t.getRootNode)==null?void 0:r.call(t);if(e.contains(t))return!0;if(n&&$v(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Op(e,t){if(!fn(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(Tt(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function gr(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Li(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function SU(e){return e.matches("html,body")}function ym(e){return On(e)&&e.matches(gO)}function Wv(e){return e?e.getAttribute("role")==="combobox"&&ym(e):!1}function EU(e){if(!e||hO)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Od(e){return e?e.hasAttribute(Kv)?e:e.querySelector(`[${Kv}]`)||e:null}function qs(e,t,n=!0){return e.filter(o=>{var a;return o.parentId===t&&(!n||((a=o.context)==null?void 0:a.open))}).flatMap(o=>[o,...qs(e,o.id,n)])}function sC(e,t){var o;let n=[],r=(o=e.find(a=>a.id===t))==null?void 0:o.parentId;for(;r;){const a=e.find(l=>l.id===r);r=a==null?void 0:a.parentId,a&&(n=n.concat(a))}return n}function mr(e){e.preventDefault(),e.stopPropagation()}function TU(e){return"nativeEvent"in e}function yO(e){return e.pointerType===""&&e.isTrusted?!0:Yv&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function bO(e){return hO?!1:!Yv&&e.width===0&&e.height===0||Yv&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Qs(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function vO(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const RU=["top","right","bottom","left"],Tc=Math.min,ii=Math.max,Np=Math.round,Zl=Math.floor,so=e=>({x:e,y:e}),CU={left:"right",right:"left",bottom:"top",top:"bottom"},kU={start:"end",end:"start"};function Xv(e,t,n){return ii(e,Tc(t,n))}function Yo(e,t){return typeof e=="function"?e(t):e}function Hr(e){return e.split("-")[0]}function ns(e){return e.split("-")[1]}function mw(e){return e==="x"?"y":"x"}function gw(e){return e==="y"?"height":"width"}const MU=new Set(["top","bottom"]);function Ei(e){return MU.has(Hr(e))?"y":"x"}function yw(e){return mw(Ei(e))}function OU(e,t,n){n===void 0&&(n=!1);const r=ns(e),o=yw(e),a=gw(o);let l=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(l=Ap(l)),[l,Ap(l)]}function NU(e){const t=Ap(e);return[Qv(e),t,Qv(t)]}function Qv(e){return e.replace(/start|end/g,t=>kU[t])}const lC=["left","right"],cC=["right","left"],AU=["top","bottom"],DU=["bottom","top"];function _U(e,t,n){switch(e){case"top":case"bottom":return n?t?cC:lC:t?lC:cC;case"left":case"right":return t?AU:DU;default:return[]}}function IU(e,t,n,r){const o=ns(e);let a=_U(Hr(e),n==="start",r);return o&&(a=a.map(l=>l+"-"+o),t&&(a=a.concat(a.map(Qv)))),a}function Ap(e){return e.replace(/left|right|bottom|top/g,t=>CU[t])}function PU(e){return{top:0,right:0,bottom:0,left:0,...e}}function xO(e){return typeof e!="number"?PU(e):{top:e,right:e,bottom:e,left:e}}function Dp(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Lh(e,t,n){return Math.floor(e/t)!==n}function tc(e,t){return t<0||t>=e.current.length}function cp(e,t){return pr(e,{disabledIndices:t})}function Zv(e,t){return pr(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function pr(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:o=1}={}){let a=t;do a+=n?-o:o;while(a>=0&&a<=e.current.length-1&&Ya(e,a,r));return a}function wO(e,{event:t,orientation:n,loopFocus:r,rtl:o,cols:a,disabledIndices:l,minIndex:c,maxIndex:f,prevIndex:d,stopEvent:m=!1}){let h=d;const y=[],g={};let x=!1;{let T=null,C=-1;e.current.forEach((k,M)=>{if(k==null)return;const D=k.closest('[role="row"]');D&&(x=!0),(D!==T||C===-1)&&(T=D,C+=1,y[C]=[]),y[C].push(M),g[M]=C})}const E=x&&y.length>0&&y.some(T=>T.length!==a);function R(T){if(!E||d===-1)return;const C=g[d];if(C==null)return;const k=y[C].indexOf(d);let M=T==="up"?C-1:C+1;r&&(M<0?M=y.length-1:M>=y.length&&(M=0));const D=new Set;for(;M>=0&&M<y.length&&!D.has(M);){D.add(M);const O=y[M];if(O.length===0){M=T==="up"?M-1:M+1;continue}const N=Math.min(k,O.length-1);for(let _=N;_>=0;_-=1){const q=O[_];if(!Ya(e,q,l))return q}M=T==="up"?M-1:M+1,r&&(M<0?M=y.length-1:M>=y.length&&(M=0))}}if(t.key===pw){const T=R("up");if(T!==void 0)m&&mr(t),h=T;else{if(m&&mr(t),d===-1)h=f;else if(h=pr(e,{startingIndex:h,amount:a,decrement:!0,disabledIndices:l}),r&&(d-a<c||h<0)){const C=d%a,k=f%a,M=f-(k-C);k===C?h=f:h=k>C?M:M-a}tc(e,h)&&(h=d)}}if(t.key===Xd){const T=R("down");T!==void 0?(m&&mr(t),h=T):(m&&mr(t),d===-1?h=c:(h=pr(e,{startingIndex:d,amount:a,disabledIndices:l}),r&&d+a>f&&(h=pr(e,{startingIndex:d%a-a,amount:a,disabledIndices:l}))),tc(e,h)&&(h=d))}if(n==="both"){const T=Zl(d/a);t.key===(o?$a:Ga)&&(m&&mr(t),d%a!==a-1?(h=pr(e,{startingIndex:d,disabledIndices:l}),r&&Lh(h,a,T)&&(h=pr(e,{startingIndex:d-d%a-1,disabledIndices:l}))):r&&(h=pr(e,{startingIndex:d-d%a-1,disabledIndices:l})),Lh(h,a,T)&&(h=d)),t.key===(o?Ga:$a)&&(m&&mr(t),d%a!==0?(h=pr(e,{startingIndex:d,decrement:!0,disabledIndices:l}),r&&Lh(h,a,T)&&(h=pr(e,{startingIndex:d+(a-d%a),decrement:!0,disabledIndices:l}))):r&&(h=pr(e,{startingIndex:d+(a-d%a),decrement:!0,disabledIndices:l})),Lh(h,a,T)&&(h=d));const C=Zl(f/a)===T;tc(e,h)&&(r&&C?h=t.key===(o?Ga:$a)?f:pr(e,{startingIndex:d-d%a-1,disabledIndices:l}):h=d)}return h}function SO(e,t,n){const r=[];let o=0;return e.forEach(({width:a,height:l},c)=>{let f=!1;for(n&&(o=0);!f;){const d=[];for(let m=0;m<a;m+=1)for(let h=0;h<l;h+=1)d.push(o+m+h*t);o%t+a<=t&&d.every(m=>r[m]==null)?(d.forEach(m=>{r[m]=c}),f=!0):o+=1}}),[...r]}function EO(e,t,n,r,o){if(e===-1)return-1;const a=n.indexOf(e),l=t[e];switch(o){case"tl":return a;case"tr":return l?a+l.width-1:a;case"bl":return l?a+(l.height-1)*r:a;case"br":return n.lastIndexOf(e);default:return-1}}function TO(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function Ya(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const r=e.current[t];return r?r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true":!1}/*!
|
|
86
|
+
* tabbable 6.4.0
|
|
87
|
+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
88
|
+
*/var LU=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],_p=LU.join(","),RO=typeof Element>"u",Rc=RO?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ip=!RO&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},Pp=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),a=o===""||o==="true",l=a||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Pp(t.parentNode));return l},jU=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},CO=function(t,n,r){if(Pp(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(_p));return n&&Rc.call(t,_p)&&o.unshift(t),o=o.filter(r),o},Lp=function(t,n,r){for(var o=[],a=Array.from(t);a.length;){var l=a.shift();if(!Pp(l,!1))if(l.tagName==="SLOT"){var c=l.assignedElements(),f=c.length?c:l.children,d=Lp(f,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:l,candidates:d})}else{var m=Rc.call(l,_p);m&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var h=l.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(l),y=!Pp(h,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(h&&y){var g=Lp(h===!0?l.children:h.children,!0,r);r.flatten?o.push.apply(o,g):o.push({scopeParent:l,candidates:g})}else a.unshift.apply(a,l.children)}}return o},kO=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},MO=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||jU(t))&&!kO(t)?0:t.tabIndex},zU=function(t,n){var r=MO(t);return r<0&&n&&!kO(t)?0:r},FU=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},OO=function(t){return t.tagName==="INPUT"},BU=function(t){return OO(t)&&t.type==="hidden"},UU=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},HU=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},qU=function(t){if(!t.name)return!0;var n=t.form||Ip(t),r=function(c){return n.querySelectorAll('input[type="radio"][name="'+c+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(l){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",l.message),!1}var a=HU(o,t.form);return!a||a===t},VU=function(t){return OO(t)&&t.type==="radio"},$U=function(t){return VU(t)&&!qU(t)},GU=function(t){var n,r=t&&Ip(t),o=(n=r)===null||n===void 0?void 0:n.host,a=!1;if(r&&r!==t){var l,c,f;for(a=!!((l=o)!==null&&l!==void 0&&(c=l.ownerDocument)!==null&&c!==void 0&&c.contains(o)||t!=null&&(f=t.ownerDocument)!==null&&f!==void 0&&f.contains(t));!a&&o;){var d,m,h;r=Ip(o),o=(d=r)===null||d===void 0?void 0:d.host,a=!!((m=o)!==null&&m!==void 0&&(h=m.ownerDocument)!==null&&h!==void 0&&h.contains(o))}}return a},uC=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},YU=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var a=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!a}if(getComputedStyle(t).visibility==="hidden")return!0;var l=Rc.call(t,"details>summary:first-of-type"),c=l?t.parentElement:t;if(Rc.call(c,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var f=t;t;){var d=t.parentElement,m=Ip(t);if(d&&!d.shadowRoot&&o(d)===!0)return uC(t);t.assignedSlot?t=t.assignedSlot:!d&&m!==t.ownerDocument?t=m.host:t=d}t=f}if(GU(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return uC(t);return!1},KU=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return Rc.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},Jv=function(t,n){return!(n.disabled||BU(n)||YU(n,t)||UU(n)||KU(n))},ex=function(t,n){return!($U(n)||MO(n)<0||!Jv(t,n))},WU=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},NO=function(t){var n=[],r=[];return t.forEach(function(o,a){var l=!!o.scopeParent,c=l?o.scopeParent:o,f=zU(c,l),d=l?NO(o.candidates):c;f===0?l?n.push.apply(n,d):n.push(c):r.push({documentOrder:a,tabIndex:f,item:o,isScope:l,content:d})}),r.sort(FU).reduce(function(o,a){return a.isScope?o.push.apply(o,a.content):o.push(a.content),o},[]).concat(n)},Qd=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Lp([t],n.includeContainer,{filter:ex.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:WU}):r=CO(t,n.includeContainer,ex.bind(null,n)),NO(r)},XU=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Lp([t],n.includeContainer,{filter:Jv.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=CO(t,n.includeContainer,Jv.bind(null,n)),r},AO=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Rc.call(t,_p)===!1?!1:ex(n,t)};const zc=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function DO(e,t){const n=Qd(e,zc()),r=n.length;if(r===0)return;const o=ri(Gt(e)),a=n.indexOf(o),l=a===-1?t===1?0:r-1:a+t;return n[l]}function bw(e){return DO(Gt(e).body,1)||e}function _O(e){return DO(Gt(e).body,-1)||e}function IO(e,t){if(!e)return null;const n=Qd(Gt(e).body,zc()),r=n.length;if(r===0)return null;const o=n.indexOf(e);if(o===-1)return null;const a=(o+t+r)%r;return n[a]}function QU(e){return IO(e,1)}function ZU(e){return IO(e,-1)}function nc(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Tt(n,r)}function JU(e){Qd(e,zc()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function dC(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const jh=null;class eH{constructor(){tt(this,"callbacks",[]);tt(this,"callbacksCount",0);tt(this,"nextId",1);tt(this,"startId",1);tt(this,"isScheduled",!1);tt(this,"tick",t=>{var o;this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let a=0;a<n.length;a+=1)(o=n[a])==null||o.call(n,t)})}request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const zh=new eH;class Un{constructor(){tt(this,"currentId",jh);tt(this,"cancel",()=>{this.currentId!==jh&&(zh.cancel(this.currentId),this.currentId=jh)});tt(this,"disposeEffect",()=>this.cancel)}static create(){return new Un}static request(t){return zh.request(t)}static cancel(t){return zh.cancel(t)}request(t){this.cancel(),this.currentId=zh.request(()=>{this.currentId=jh,t()})}}function Zd(){const e=rr(Un.create).current;return mm(e.disposeEffect),e}function zo(e){return e==null?e:"current"in e?e.current:e}let Zs=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const tH={[Zs.startingStyle]:""},nH={[Zs.endingStyle]:""},Xo={transitionStatus(e){return e==="starting"?tH:e==="ending"?nH:null}};function PO(e,t=!1,n=!0){const r=Zd();return Ge((o,a=null)=>{r.cancel();function l(){yr.flushSync(o)}const c=zo(e);if(c==null)return;const f=c;if(typeof f.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)o();else{let d=function(){const h=Zs.startingStyle;if(!f.hasAttribute(h)){r.request(m);return}const y=new MutationObserver(()=>{f.hasAttribute(h)||(y.disconnect(),m())});y.observe(f,{attributes:!0,attributeFilter:[h]}),a==null||a.addEventListener("abort",()=>y.disconnect(),{once:!0})},m=function(){Promise.all(f.getAnimations().map(h=>h.finished)).then(()=>{a!=null&&a.aborted||l()}).catch(()=>{const h=f.getAnimations();if(n){if(a!=null&&a.aborted)return;l()}else h.length>0&&h.some(y=>y.pending||y.playState!=="finished")&&m()})};if(t){d();return}r.request(m)}})}function Qo(e){const{enabled:t=!0,open:n,ref:r,onComplete:o}=e,a=Ge(o),l=PO(r,n,!1);v.useEffect(()=>{if(!t)return;const c=new AbortController;return l(a,c.signal),()=>{c.abort()}},[t,n,a,l])}function Jd(e,t=!1,n=!1){const[r,o]=v.useState(e&&t?"idle":void 0),[a,l]=v.useState(e);return e&&!a&&(l(!0),o("starting")),!e&&a&&r!=="ending"&&!n&&o("ending"),!e&&!a&&r==="ending"&&o(void 0),qe(()=>{if(!e&&a&&r!=="ending"&&n){const c=Un.request(()=>{o("ending")});return()=>{Un.cancel(c)}}},[e,a,r,n]),qe(()=>{if(!e||t)return;const c=Un.request(()=>{o(void 0)});return()=>{Un.cancel(c)}},[t,e]),qe(()=>{if(!e||!t)return;e&&a&&r!=="idle"&&o("starting");const c=Un.request(()=>{o("idle")});return()=>{Un.cancel(c)}},[t,e,a,o,r]),v.useMemo(()=>({mounted:a,setMounted:l,transitionStatus:r}),[a,r])}function Cc({controlled:e,default:t,name:n,state:r="value"}){const{current:o}=v.useRef(e!==void 0),[a,l]=v.useState(t),c=o?e:a,f=v.useCallback(d=>{o||l(d)},[]);return[c,f]}function bm(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:o,registerControlId:a}=pm(),l=Yi(t),c=n?o:void 0,f=rr(()=>Symbol("labelable-control")),d=v.useRef(!1),m=v.useRef(t!=null),h=Ge(()=>{!d.current||a===Ur||(d.current=!1,a(f.current,void 0))});return qe(()=>{if(a===Ur)return;let y;if(n){const g=r==null?void 0:r.current;fn(g)&&g.closest("label")!=null?y=t??null:y=c??l}else if(t!=null)m.current=!0,y=t;else if(m.current)y=l;else{h();return}if(y===void 0){h();return}d.current=!0,a(f.current,y)},[t,r,c,a,n,l,f,h]),v.useEffect(()=>h,[h]),o??l}function vw(e){const{enabled:t=!0,value:n,id:r,name:o,controlRef:a,commit:l}=e,{formRef:c}=hw(),{invalid:f,markedDirtyRef:d,validityData:m,setValidityData:h}=Lc(),y=Ge(e.getValue);qe(()=>{if(!t)return;let g=n;g===void 0&&(g=y()),m.initialValue===null&&g!==null&&h(x=>({...x,initialValue:g}))},[t,h,n,m.initialValue,y]),qe(()=>{!t||!r||c.current.fields.set(r,{getValue:y,name:o,controlRef:a,validityData:yU(m,f),validate(g=!0){let x=n;x===void 0&&(x=y()),d.current=!0,g?yr.flushSync(()=>l(x)):l(x)}})},[l,a,t,c,y,r,f,d,o,m,n]),qe(()=>{const g=c.current.fields;return()=>{r&&g.delete(r)}},[c,r])}const qi="none",Wa="trigger-press",wr="trigger-hover",rc="trigger-focus",vm="outside-press",ud="item-press",rH="close-press",Js="focus-out",xm="escape-key",up="list-navigation",xw="cancel-open",dp="sibling-open",iH="disabled",ww="imperative-action",oH="window-resize";function yt(e,t,n,r){let o=!1,a=!1;const l=r??Pn;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){a=!0},get isCanceled(){return o},get isPropagationAllowed(){return a},trigger:n,...l}}const aH=v.forwardRef(function(t,n){const{render:r,className:o,id:a,name:l,value:c,disabled:f=!1,onValueChange:d,defaultValue:m,autoFocus:h=!1,...y}=t,{state:g,name:x,disabled:E,setTouched:R,setDirty:T,validityData:C,setFocused:k,setFilled:M,validationMode:D,validation:O}=Lc(),N=E||f,_=x??l,q={...g,disabled:N},{labelId:F}=pm(),G=bm({id:a});qe(()=>{var V;const z=c!=null;(V=O.inputRef.current)!=null&&V.value||z&&c!==""?M(!0):z&&c===""&&M(!1)},[O.inputRef,M,c]);const P=v.useRef(null);qe(()=>{h&&P.current===ri(Gt(P.current))&&k(!0)},[h,k]);const[U]=Cc({controlled:c,default:m,name:"FieldControl",state:"value"}),H=c!==void 0,B=H?U:void 0;return vw({id:G,name:_,commit:O.commit,value:B,getValue:()=>{var z;return(z=O.inputRef.current)==null?void 0:z.value},controlRef:O.inputRef}),At("input",t,{ref:[n,P],state:q,props:[{id:G,disabled:N,name:_,ref:O.inputRef,"aria-labelledby":F,autoFocus:h,...H?{value:B}:{defaultValue:m},onChange(z){const V=z.currentTarget.value;d==null||d(V,yt(qi,z.nativeEvent)),T(V!==C.initialValue),M(V!=="")},onFocus(){k(!0)},onBlur(z){R(!0),k(!1),D==="onBlur"&&O.commit(z.currentTarget.value)},onKeyDown(z){z.currentTarget.tagName==="INPUT"&&z.key==="Enter"&&(R(!0),O.commit(z.currentTarget.value))}},O.getInputValidationProps(),y],stateAttributesMapping:fw})}),sH=v.forwardRef(function(t,n){return w.jsx(aH,{ref:n,...t})});function ji({className:e,type:t,...n}){return w.jsx(sH,{type:t,"data-slot":"input",className:De("dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 h-8 rounded-lg border bg-transparent px-2.5 py-1 text-base transition-colors file:h-6 file:text-sm file:font-medium focus-visible:ring-2 aria-invalid:ring-2 md:text-sm file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",e),...n})}const Sw=v.forwardRef(function(t,n){const{className:r,render:o,orientation:a="horizontal",...l}=t;return At("div",t,{state:{orientation:a},ref:n,props:[{role:"separator","aria-orientation":a},l]})});function lH({className:e,orientation:t="horizontal",...n}){return w.jsx(Sw,{"data-slot":"separator",orientation:t,className:De("bg-border shrink-0 data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",e),...n})}const Ew=v.createContext(void 0);function rs(e){const t=v.useContext(Ew);if(e===!1&&t===void 0)throw new Error(Rn(27));return t}let Ds=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Zs.startingStyle]="startingStyle",e[e.endingStyle=Zs.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),jp=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const cH={[jp.popupOpen]:""},uH={[jp.popupOpen]:"",[jp.pressed]:""},dH={[Ds.open]:""},fH={[Ds.closed]:""},hH={[Ds.anchorHidden]:""},LO={open(e){return e?cH:null}},zp={open(e){return e?uH:null}},po={open(e){return e?dH:fH},anchorHidden(e){return e?hH:null}},pH={...po,...Xo},Tw=v.forwardRef(function(t,n){const{render:r,className:o,forceRender:a=!1,...l}=t,{store:c}=rs(),f=c.useState("open"),d=c.useState("nested"),m=c.useState("mounted"),h=c.useState("transitionStatus");return At("div",t,{state:{open:f,transitionStatus:h},ref:[c.context.backdropRef,n],stateAttributesMapping:pH,props:[{role:"presentation",hidden:!m,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:a||!d})}),wm=v.forwardRef(function(t,n){const{render:r,className:o,disabled:a=!1,nativeButton:l=!0,...c}=t,{store:f}=rs(),d=f.useState("open");function m(x){d&&f.setOpen(!1,yt(rH,x.nativeEvent))}const{getButtonProps:h,buttonRef:y}=Wo({disabled:a,native:l});return At("button",t,{state:{disabled:a},ref:[n,y],props:[{onClick:m},c,h]})}),Rw=v.forwardRef(function(t,n){const{render:r,className:o,id:a,...l}=t,{store:c}=rs(),f=Yi(a);return c.useSyncedValueWithCleanup("descriptionElementId",f),At("p",t,{ref:n,props:[{id:f},l]})});function lr(e){const t=rr(mH,e).current;return t.next=e,qe(t.effect),t}function mH(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function jO(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}class Cw{constructor(){tt(this,"nodesRef",{current:[]});tt(this,"events",jO())}addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const zO=v.createContext(null),FO=v.createContext(null),Zo=()=>{var e;return((e=v.useContext(zO))==null?void 0:e.id)||null},is=e=>{const t=v.useContext(FO);return e??t};function BO(e){const t=ts(),n=is(e),r=Zo();return qe(()=>{if(!t)return;const o={id:t,parentId:r};return n==null||n.addNode(o),()=>{n==null||n.removeNode(o)}},[n,t,r]),t}function gH(e){const{children:t,id:n}=e,r=Zo();return w.jsx(zO.Provider,{value:v.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function yH(e){const{children:t,externalTree:n}=e,r=rr(()=>n??new Cw).current;return w.jsx(FO.Provider,{value:r,children:t})}function kc(e){return`data-base-ui-${e}`}function fp(e,t,n){if(n&&!Qs(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r==null?void 0:r[t]}return e==null?void 0:e[t]}const bH=v.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new uo,currentIdRef:{current:null},currentContextRef:{current:null}});function vH(e,t={open:!1}){const n="rootStore"in e?e.rootStore:e,r=n.useState("floatingId"),{open:o}=t,a=v.useContext(bH),{currentIdRef:l,delayRef:c,timeoutMs:f,initialDelayRef:d,currentContextRef:m,hasProvider:h,timeout:y}=a,[g,x]=v.useState(!1);return qe(()=>{function E(){var R;x(!1),(R=m.current)==null||R.setIsInstantPhase(!1),l.current=null,m.current=null,c.current=d.current}if(l.current&&!o&&l.current===r){if(x(!1),f){const R=r;return y.start(f,()=>{n.select("open")||l.current&&l.current!==R||E()}),()=>{y.clear()}}E()}},[o,r,l,c,f,d,m,y,n]),qe(()=>{if(!o)return;const E=m.current,R=l.current;y.clear(),m.current={onOpenChange:n.setOpen,setIsInstantPhase:x},l.current=r,c.current={open:0,close:fp(d.current,"close")},R!==null&&R!==r?(x(!0),E==null||E.setIsInstantPhase(!0),E==null||E.onOpenChange(!1,yt(qi))):(x(!1),E==null||E.setIsInstantPhase(!1))},[o,r,n,l,c,f,d,m,y]),qe(()=>()=>{m.current=null},[m]),v.useMemo(()=>({hasProvider:h,delayRef:c,isInstantPhase:g}),[h,c,g])}const UO={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Sm={...UO,position:"fixed",top:0,left:0},HO={...UO,position:"absolute"},Mc=v.forwardRef(function(t,n){const[r,o]=v.useState();qe(()=>{fO&&o("button")},[]);const a={tabIndex:0,role:r};return w.jsx("span",{...t,ref:n,style:Sm,"aria-hidden":r?void 0:!0,...a,"data-base-ui-focus-guard":""})});let fC=0;function dd(e,t={}){const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(fC);const a=()=>e==null?void 0:e.focus({preventScroll:n});o?a():fC=requestAnimationFrame(a)}const ic={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function hC(e){return e==="inert"?ic.inert:e==="aria-hidden"?ic["aria-hidden"]:ic.none}let Fh=new WeakSet,Bh={},Tb=0;const qO=e=>e&&(e.host||qO(e.parentNode)),xH=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=qO(n);return e.contains(r)?r:null}).filter(n=>n!=null);function wH(e,t,n,r){const o="data-base-ui-inert",a=r?"inert":n?"aria-hidden":null,l=xH(t,e),c=new Set,f=new Set(l),d=[];Bh[o]||(Bh[o]=new WeakMap);const m=Bh[o];l.forEach(h),y(t),c.clear();function h(g){!g||c.has(g)||(c.add(g),g.parentNode&&h(g.parentNode))}function y(g){!g||f.has(g)||[].forEach.call(g.children,x=>{if(Ja(x)!=="script")if(c.has(x))y(x);else{const E=a?x.getAttribute(a):null,R=E!==null&&E!=="false",T=hC(a),C=(T.get(x)||0)+1,k=(m.get(x)||0)+1;T.set(x,C),m.set(x,k),d.push(x),C===1&&R&&Fh.add(x),k===1&&x.setAttribute(o,""),!R&&a&&x.setAttribute(a,a==="inert"?"":"true")}})}return Tb+=1,()=>{d.forEach(g=>{const x=hC(a),R=(x.get(g)||0)-1,T=(m.get(g)||0)-1;x.set(g,R),m.set(g,T),R||(!Fh.has(g)&&a&&g.removeAttribute(a),Fh.delete(g)),T||g.removeAttribute(o)}),Tb-=1,Tb||(ic.inert=new WeakMap,ic["aria-hidden"]=new WeakMap,ic.none=new WeakMap,Fh=new WeakSet,Bh={})}}function SH(e,t=!1,n=!1){const r=Gt(e[0]).body;return wH(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const VO=v.createContext(null),$O=()=>v.useContext(VO),EH=kc("portal");function GO(e={}){const{ref:t,container:n,componentProps:r=Pn,elementProps:o}=e,a=ts(),l=$O(),c=l==null?void 0:l.portalNode,[f,d]=v.useState(null),[m,h]=v.useState(null),y=Ge(R=>{R!==null&&h(R)}),g=v.useRef(null);qe(()=>{if(n===null){g.current&&(g.current=null,h(null),d(null));return}if(a==null)return;const R=(n&&(cw(n)?n:n.current))??c??document.body;if(R==null){g.current&&(g.current=null,h(null),d(null));return}g.current!==R&&(g.current=R,h(null),d(R))},[n,c,a]);const x=At("div",r,{ref:[t,y],props:[{id:a,[EH]:""},o]});return{portalNode:m,portalSubtree:f&&x?yr.createPortal(x,f):null}}const kw=v.forwardRef(function(t,n){const{children:r,container:o,className:a,render:l,renderGuards:c,...f}=t,{portalNode:d,portalSubtree:m}=GO({container:o,ref:n,componentProps:t,elementProps:f}),h=v.useRef(null),y=v.useRef(null),g=v.useRef(null),x=v.useRef(null),[E,R]=v.useState(null),T=E==null?void 0:E.modal,C=E==null?void 0:E.open,k=typeof c=="boolean"?c:!!E&&!E.modal&&E.open&&!!d;v.useEffect(()=>{if(!d||T)return;function D(O){d&&O.relatedTarget&&nc(O)&&(O.type==="focusin"?dC:JU)(d)}return d.addEventListener("focusin",D,!0),d.addEventListener("focusout",D,!0),()=>{d.removeEventListener("focusin",D,!0),d.removeEventListener("focusout",D,!0)}},[d,T]),v.useEffect(()=>{!d||C||dC(d)},[C,d]);const M=v.useMemo(()=>({beforeOutsideRef:h,afterOutsideRef:y,beforeInsideRef:g,afterInsideRef:x,portalNode:d,setFocusManagerState:R}),[d]);return w.jsxs(v.Fragment,{children:[m,w.jsxs(VO.Provider,{value:M,children:[k&&d&&w.jsx(Mc,{"data-type":"outside",ref:h,onFocus:D=>{var O;if(nc(D,d))(O=g.current)==null||O.focus();else{const N=E?E.domReference:null,_=_O(N);_==null||_.focus()}}}),k&&d&&w.jsx("span",{"aria-owns":d.id,style:JF}),d&&yr.createPortal(r,d),k&&d&&w.jsx(Mc,{"data-type":"outside",ref:y,onFocus:D=>{var O;if(nc(D,d))(O=x.current)==null||O.focus();else{const N=E?E.domReference:null,_=bw(N);_==null||_.focus(),E!=null&&E.closeOnFocusOut&&(E==null||E.onOpenChange(!1,yt(Js,D.nativeEvent)))}}})]})]})});function TH(e,t){const n=Hn(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const pC=20;let Ua=[];function Mw(){Ua=Ua.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function RH(e){Mw(),e&&Ja(e)!=="body"&&(Ua.push(new WeakRef(e)),Ua.length>pC&&(Ua=Ua.slice(-pC)))}function Rb(){var e;return Mw(),(e=Ua[Ua.length-1])==null?void 0:e.deref()}function CH(e){if(!e)return null;const t=zc();return AO(e,t)?e:Qd(e,t)[0]||e}function kH(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():si(e).display!=="none"}function mC(e,t){var l;if(!t.current.includes("floating")&&!((l=e.getAttribute("role"))!=null&&l.includes("dialog")))return;const n=zc(),o=XU(e,n).filter(c=>{const f=c.getAttribute("data-tabindex")||"";return AO(c,n)||c.hasAttribute("data-tabindex")&&!f.startsWith("-")}),a=e.getAttribute("tabindex");t.current.includes("floating")||o.length===0?a!=="0"&&e.setAttribute("tabindex","0"):(a!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Ow(e){const{context:t,children:n,disabled:r=!1,initialFocus:o=!0,returnFocus:a=!0,restoreFocus:l=!1,modal:c=!0,closeOnFocusOut:f=!0,openInteractionType:d="",nextFocusableElement:m,previousFocusableElement:h,beforeContentFocusGuardRef:y,externalTree:g}=e,x="rootStore"in t?t.rootStore:t,E=x.useState("open"),R=x.useState("domReferenceElement"),T=x.useState("floatingElement"),{events:C,dataRef:k}=x.context,M=Ge(()=>{var he;return(he=k.current.floatingContext)==null?void 0:he.nodeId}),D=o===!1,O=Wv(R)&&D,N=v.useRef(["content"]),_=lr(o),q=lr(a),F=lr(d),G=is(g),P=$O(),U=v.useRef(null),H=v.useRef(null),B=v.useRef(!1),j=v.useRef(!1),z=v.useRef(!1),V=v.useRef(-1),K=v.useRef(""),L=v.useRef(""),$=v.useRef(null),W=v.useRef(null),I=Hi($,y,P==null?void 0:P.beforeInsideRef),Q=Hi(W,P==null?void 0:P.afterInsideRef),le=Dn(),oe=Dn(),Z=Zd(),ue=P!=null,ve=Od(T),Se=Ge((he=ve)=>he?Qd(he,zc()):[]),Pe=Ge(he=>{const ye=Se(he);return N.current.map(()=>ye).filter(Boolean).flat()});v.useEffect(()=>{if(r||!c)return;function he(Le){Le.key==="Tab"&&Tt(ve,ri(Gt(ve)))&&Se().length===0&&!O&&mr(Le)}const ye=Gt(ve);return ye.addEventListener("keydown",he),()=>{ye.removeEventListener("keydown",he)}},[r,R,ve,c,N,O,Se,Pe]),v.useEffect(()=>{if(r||!E)return;const he=Gt(ve);function ye(){z.current=!1}function Le(Te){const Ce=gr(Te),J=Tt(T,Ce)||Tt(R,Ce)||Tt(P==null?void 0:P.portalNode,Ce);z.current=!J,L.current=Te.pointerType||"keyboard",Ce!=null&&Ce.closest(`[${ZF}]`)&&(j.current=!0)}function Oe(){L.current="keyboard"}return he.addEventListener("pointerdown",Le,!0),he.addEventListener("pointerup",ye,!0),he.addEventListener("pointercancel",ye,!0),he.addEventListener("keydown",Oe,!0),()=>{he.removeEventListener("pointerdown",Le,!0),he.removeEventListener("pointerup",ye,!0),he.removeEventListener("pointercancel",ye,!0),he.removeEventListener("keydown",Oe,!0)}},[r,T,R,ve,E,P]),v.useEffect(()=>{if(r||!f)return;const he=Gt(ve);function ye(){j.current=!0,oe.start(0,()=>{j.current=!1})}function Le(Ee){const xe=gr(Ee),Ve=Se().indexOf(xe);Ve!==-1&&(V.current=Ve)}function Oe(Ee){const xe=Ee.relatedTarget,Be=Ee.currentTarget,Ve=gr(Ee);queueMicrotask(()=>{const _e=M(),ut=x.context.triggerElements,pe=(xe==null?void 0:xe.hasAttribute(kc("focus-guard")))&&[$.current,W.current,P==null?void 0:P.beforeInsideRef.current,P==null?void 0:P.afterInsideRef.current,P==null?void 0:P.beforeOutsideRef.current,P==null?void 0:P.afterOutsideRef.current,zo(h),zo(m)].includes(xe),Re=!(Tt(R,xe)||Tt(T,xe)||Tt(xe,T)||Tt(P==null?void 0:P.portalNode,xe)||xe!=null&&ut.hasElement(xe)||ut.hasMatchingElement(ee=>Tt(ee,xe))||pe||G&&(qs(G.nodesRef.current,_e).find(ee=>{var fe,Ne;return Tt((fe=ee.context)==null?void 0:fe.elements.floating,xe)||Tt((Ne=ee.context)==null?void 0:Ne.elements.domReference,xe)})||sC(G.nodesRef.current,_e).find(ee=>{var fe,Ne,Ue;return[(fe=ee.context)==null?void 0:fe.elements.floating,Od((Ne=ee.context)==null?void 0:Ne.elements.floating)].includes(xe)||((Ue=ee.context)==null?void 0:Ue.elements.domReference)===xe})));if(Be===R&&ve&&mC(ve,N),l&&Be!==R&&!kH(Ve)&&ri(he)===he.body){if(On(ve)&&(ve.focus(),l==="popup")){Z.request(()=>{ve.focus()});return}const ee=V.current,fe=Se(),Ne=fe[ee]||fe[fe.length-1]||ve;On(Ne)&&Ne.focus()}if(k.current.insideReactTree){k.current.insideReactTree=!1;return}(O||!c)&&xe&&Re&&!j.current&&(O||xe!==Rb())&&(B.current=!0,x.setOpen(!1,yt(Js,Ee)))})}function Te(){z.current||(k.current.insideReactTree=!0,le.start(0,()=>{k.current.insideReactTree=!1}))}const Ce=On(R)?R:null,J=[];if(!(!T&&!Ce))return Ce&&(Ce.addEventListener("focusout",Oe),Ce.addEventListener("pointerdown",ye),J.push(()=>{Ce.removeEventListener("focusout",Oe),Ce.removeEventListener("pointerdown",ye)})),T&&(T.addEventListener("focusin",Le),T.addEventListener("focusout",Oe),P&&(T.addEventListener("focusout",Te,!0),J.push(()=>{T.removeEventListener("focusout",Te,!0)})),J.push(()=>{T.removeEventListener("focusin",Le),T.removeEventListener("focusout",Oe)})),()=>{J.forEach(Ee=>{Ee()})}},[r,R,T,ve,c,G,P,x,f,l,Se,O,M,N,k,le,oe,Z,m,h]),v.useEffect(()=>{var Te,Ce,J;if(r||!T||!E)return;const he=Array.from(((Te=P==null?void 0:P.portalNode)==null?void 0:Te.querySelectorAll(`[${kc("portal")}]`))||[]),Le=(J=(Ce=(G?sC(G.nodesRef.current,M()):[]).find(Ee=>{var xe;return Wv(((xe=Ee.context)==null?void 0:xe.elements.domReference)||null)}))==null?void 0:Ce.context)==null?void 0:J.elements.domReference,Oe=[T,Le,...he,U.current,H.current,$.current,W.current,P==null?void 0:P.beforeOutsideRef.current,P==null?void 0:P.afterOutsideRef.current,zo(h),zo(m),O?R:null].filter(Ee=>Ee!=null);return SH(Oe,c||O)},[E,r,R,T,c,N,P,O,G,M,m,h]),qe(()=>{if(!E||r||!On(ve))return;const he=Gt(ve),ye=ri(he);queueMicrotask(()=>{const Le=Pe(ve),Oe=_.current,Te=typeof Oe=="function"?Oe(F.current||""):Oe;if(Te===void 0||Te===!1)return;let Ce;Te===!0||Te===null?Ce=Le[0]||ve:Ce=zo(Te),Ce=Ce||Le[0]||ve,!Tt(ve,ye)&&dd(Ce,{preventScroll:Ce===ve})})},[r,E,ve,D,Pe,_,F]),qe(()=>{if(r||!ve)return;const he=Gt(ve),ye=ri(he);RH(ye);function Le(Ce){if(Ce.open||(K.current=TH(Ce.nativeEvent,L.current)),Ce.reason===wr&&Ce.nativeEvent.type==="mouseleave"&&(B.current=!0),Ce.reason===vm)if(Ce.nested)B.current=!1;else if(yO(Ce.nativeEvent)||bO(Ce.nativeEvent))B.current=!1;else{let J=!1;document.createElement("div").focus({get preventScroll(){return J=!0,!1}}),J?B.current=!1:B.current=!0}}C.on("openchange",Le);const Oe=he.createElement("span");Oe.setAttribute("tabindex","-1"),Oe.setAttribute("aria-hidden","true"),Object.assign(Oe.style,Sm),ue&&R&&R.insertAdjacentElement("afterend",Oe);function Te(){const Ce=q.current;let J=typeof Ce=="function"?Ce(K.current):Ce;if(J===void 0||J===!1)return null;if(J===null&&(J=!0),typeof J=="boolean"){const xe=R||Rb();return xe&&xe.isConnected?xe:Oe}const Ee=R||Rb()||Oe;return zo(J)||Ee}return()=>{C.off("openchange",Le);const Ce=ri(he),J=Tt(T,Ce)||G&&qs(G.nodesRef.current,M(),!1).some(xe=>{var Be;return Tt((Be=xe.context)==null?void 0:Be.elements.floating,Ce)}),Ee=Te();queueMicrotask(()=>{const xe=CH(Ee),Be=typeof q.current!="boolean";q.current&&!B.current&&On(xe)&&(!(!Be&&xe!==Ce&&Ce!==he.body)||J)&&xe.focus({preventScroll:!0}),Oe.remove(),B.current=!1})}},[r,T,ve,q,k,C,G,ue,R,M]),qe(()=>{if(!gm||E||!T)return;const he=ri(Gt(T));!On(he)||!ym(he)||Tt(T,he)&&he.blur()},[E,T]),qe(()=>{if(!(r||!P))return P.setFocusManagerState({modal:c,closeOnFocusOut:f,open:E,onOpenChange:x.setOpen,domReference:R}),()=>{P.setFocusManagerState(null)}},[r,P,c,E,x,f,R]),qe(()=>{if(!(r||!ve))return mC(ve,N),()=>{queueMicrotask(Mw)}},[r,ve,N]);const te=!r&&(c?!O:!0)&&(ue||c);return w.jsxs(v.Fragment,{children:[te&&w.jsx(Mc,{"data-type":"inside",ref:I,onFocus:he=>{var ye;if(c){const Le=Pe();dd(Le[Le.length-1])}else if(P!=null&&P.portalNode)if(B.current=!1,nc(he,P.portalNode)){const Le=bw(R);Le==null||Le.focus()}else(ye=zo(h??P.beforeOutsideRef))==null||ye.focus()}}),n,te&&w.jsx(Mc,{"data-type":"inside",ref:Q,onFocus:he=>{var ye;if(c)dd(Pe()[0]);else if(P!=null&&P.portalNode)if(f&&(B.current=!0),nc(he,P.portalNode)){const Le=_O(R);Le==null||Le.focus()}else(ye=zo(m??P.afterOutsideRef))==null||ye.focus()}})]})}function YO(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,{enabled:o=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,stickIfOpen:f=!0,touchOpenDelay:d=0,reason:m=Wa}=t,h=v.useRef(void 0),y=Zd(),g=Dn(),x=v.useMemo(()=>({onPointerDown(E){h.current=E.pointerType},onMouseDown(E){const R=h.current,T=E.nativeEvent,C=n.select("open");if(E.button!==0||a==="click"||Qs(R,!0)&&c)return;const k=r.current.openEvent,M=k==null?void 0:k.type,D=n.select("domReferenceElement")!==E.currentTarget,O=C&&D||!(C&&l&&(!(k&&f)||M==="click"||M==="mousedown"));if(ym(T.target)){const _=yt(m,T,T.target);O&&R==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,_)}):n.setOpen(O,_);return}const N=E.currentTarget;y.request(()=>{const _=yt(m,T,N);O&&R==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,_)}):n.setOpen(O,_)})},onClick(E){if(a==="mousedown-only")return;const R=h.current;if(a==="mousedown"&&R){h.current=void 0;return}if(Qs(R,!0)&&c)return;const T=n.select("open"),C=r.current.openEvent,k=n.select("domReferenceElement")!==E.currentTarget,M=T&&k||!(T&&l&&(!(C&&f)||vO(C))),D=yt(m,E.nativeEvent,E.currentTarget);M&&R==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,D)}):n.setOpen(M,D)},onKeyDown(){h.current=void 0}}),[r,a,c,n,f,l,y,g,d,m]);return v.useMemo(()=>o?{reference:x}:Pn,[o,x])}function MH(e,t){let n=null,r=null,o=!1;return{contextElement:e||void 0,getBoundingClientRect(){var g;const a=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},l=t.axis==="x"||t.axis==="both",c=t.axis==="y"||t.axis==="both",f=["mouseenter","mousemove"].includes(((g=t.dataRef.current.openEvent)==null?void 0:g.type)||"")&&t.pointerType!=="touch";let d=a.width,m=a.height,h=a.x,y=a.y;return n==null&&t.x&&l&&(n=a.x-t.x),r==null&&t.y&&c&&(r=a.y-t.y),h-=n||0,y-=r||0,d=0,m=0,!o||f?(d=t.axis==="y"?a.width:0,m=t.axis==="x"?a.height:0,h=l&&t.x!=null?t.x:h,y=c&&t.y!=null?t.y:y):o&&!f&&(m=t.axis==="x"?a.height:m,d=t.axis==="y"?a.width:d),o=!0,{width:d,height:m,x:h,y,top:y,right:h+d,bottom:y+m,left:h}}}}function gC(e){return e!=null&&e.clientX!=null}function OH(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),a=n.useState("domReferenceElement"),l=n.context.dataRef,{enabled:c=!0,axis:f="both"}=t,d=v.useRef(!1),m=v.useRef(null),[h,y]=v.useState(),[g,x]=v.useState([]),E=Ge((M,D,O)=>{d.current||l.current.openEvent&&!gC(l.current.openEvent)||n.set("positionReference",MH(O??a,{x:M,y:D,axis:f,dataRef:l,pointerType:h}))}),R=Ge(M=>{r?m.current||x([]):E(M.clientX,M.clientY,M.currentTarget)}),T=Qs(h)?o:r,C=v.useCallback(()=>{if(!T||!c)return;const M=Hn(o);function D(O){const N=gr(O);Tt(o,N)?(M.removeEventListener("mousemove",D),m.current=null):E(O.clientX,O.clientY)}if(!l.current.openEvent||gC(l.current.openEvent)){M.addEventListener("mousemove",D);const O=()=>{M.removeEventListener("mousemove",D),m.current=null};return m.current=O,O}n.set("positionReference",a)},[T,c,o,l,a,n,E]);v.useEffect(()=>C(),[C,g]),v.useEffect(()=>{c&&!o&&(d.current=!1)},[c,o]),v.useEffect(()=>{!c&&r&&(d.current=!0)},[c,r]);const k=v.useMemo(()=>{function M(D){y(D.pointerType)}return{onPointerDown:M,onPointerEnter:M,onMouseMove:R,onMouseEnter:R}},[R]);return v.useMemo(()=>c?{reference:k,trigger:k}:{},[c,k])}function yC(e,t,n){let{reference:r,floating:o}=e;const a=Ei(t),l=yw(t),c=gw(l),f=Hr(t),d=a==="y",m=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,y=r[c]/2-o[c]/2;let g;switch(f){case"top":g={x:m,y:r.y-o.height};break;case"bottom":g={x:m,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:h};break;case"left":g={x:r.x-o.width,y:h};break;default:g={x:r.x,y:r.y}}switch(ns(t)){case"start":g[l]-=y*(n&&d?-1:1);break;case"end":g[l]+=y*(n&&d?-1:1);break}return g}async function NH(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:a,rects:l,elements:c,strategy:f}=e,{boundary:d="clippingAncestors",rootBoundary:m="viewport",elementContext:h="floating",altBoundary:y=!1,padding:g=0}=Yo(t,e),x=xO(g),R=c[y?h==="floating"?"reference":"floating":h],T=Dp(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(R)))==null||n?R:R.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(c.floating)),boundary:d,rootBoundary:m,strategy:f})),C=h==="floating"?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,k=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c.floating)),M=await(a.isElement==null?void 0:a.isElement(k))?await(a.getScale==null?void 0:a.getScale(k))||{x:1,y:1}:{x:1,y:1},D=Dp(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:C,offsetParent:k,strategy:f}):C);return{top:(T.top-D.top+x.top)/M.y,bottom:(D.bottom-T.bottom+x.bottom)/M.y,left:(T.left-D.left+x.left)/M.x,right:(D.right-T.right+x.right)/M.x}}const AH=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:l}=n,c=a.filter(Boolean),f=await(l.isRTL==null?void 0:l.isRTL(t));let d=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:m,y:h}=yC(d,r,f),y=r,g={},x=0;for(let R=0;R<c.length;R++){var E;const{name:T,fn:C}=c[R],{x:k,y:M,data:D,reset:O}=await C({x:m,y:h,initialPlacement:r,placement:y,strategy:o,middlewareData:g,rects:d,platform:{...l,detectOverflow:(E=l.detectOverflow)!=null?E:NH},elements:{reference:e,floating:t}});m=k??m,h=M??h,g={...g,[T]:{...g[T],...D}},O&&x<=50&&(x++,typeof O=="object"&&(O.placement&&(y=O.placement),O.rects&&(d=O.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:o}):O.rects),{x:m,y:h}=yC(d,y,f)),R=-1)}return{x:m,y:h,placement:y,strategy:o,middlewareData:g}},DH=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:a,rects:l,initialPlacement:c,platform:f,elements:d}=t,{mainAxis:m=!0,crossAxis:h=!0,fallbackPlacements:y,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:E=!0,...R}=Yo(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const T=Hr(o),C=Ei(c),k=Hr(c)===c,M=await(f.isRTL==null?void 0:f.isRTL(d.floating)),D=y||(k||!E?[Ap(c)]:NU(c)),O=x!=="none";!y&&O&&D.push(...IU(c,E,x,M));const N=[c,...D],_=await f.detectOverflow(t,R),q=[];let F=((r=a.flip)==null?void 0:r.overflows)||[];if(m&&q.push(_[T]),h){const H=OU(o,l,M);q.push(_[H[0]],_[H[1]])}if(F=[...F,{placement:o,overflows:q}],!q.every(H=>H<=0)){var G,P;const H=(((G=a.flip)==null?void 0:G.index)||0)+1,B=N[H];if(B&&(!(h==="alignment"?C!==Ei(B):!1)||F.every(V=>Ei(V.placement)===C?V.overflows[0]>0:!0)))return{data:{index:H,overflows:F},reset:{placement:B}};let j=(P=F.filter(z=>z.overflows[0]<=0).sort((z,V)=>z.overflows[1]-V.overflows[1])[0])==null?void 0:P.placement;if(!j)switch(g){case"bestFit":{var U;const z=(U=F.filter(V=>{if(O){const K=Ei(V.placement);return K===C||K==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(K=>K>0).reduce((K,L)=>K+L,0)]).sort((V,K)=>V[1]-K[1])[0])==null?void 0:U[0];z&&(j=z);break}case"initialPlacement":j=c;break}if(o!==j)return{reset:{placement:j}}}return{}}}};function bC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function vC(e){return RU.some(t=>e[t]>=0)}const _H=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...a}=Yo(e,t);switch(o){case"referenceHidden":{const l=await r.detectOverflow(t,{...a,elementContext:"reference"}),c=bC(l,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:vC(c)}}}case"escaped":{const l=await r.detectOverflow(t,{...a,altBoundary:!0}),c=bC(l,n.floating);return{data:{escapedOffsets:c,escaped:vC(c)}}}default:return{}}}}},KO=new Set(["left","top"]);async function IH(e,t){const{placement:n,platform:r,elements:o}=e,a=await(r.isRTL==null?void 0:r.isRTL(o.floating)),l=Hr(n),c=ns(n),f=Ei(n)==="y",d=KO.has(l)?-1:1,m=a&&f?-1:1,h=Yo(t,e);let{mainAxis:y,crossAxis:g,alignmentAxis:x}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof x=="number"&&(g=c==="end"?x*-1:x),f?{x:g*m,y:y*d}:{x:y*d,y:g*m}}const PH=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:a,placement:l,middlewareData:c}=t,f=await IH(t,e);return l===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:o+f.x,y:a+f.y,data:{...f,placement:l}}}}},LH=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:a}=t,{mainAxis:l=!0,crossAxis:c=!1,limiter:f={fn:T=>{let{x:C,y:k}=T;return{x:C,y:k}}},...d}=Yo(e,t),m={x:n,y:r},h=await a.detectOverflow(t,d),y=Ei(Hr(o)),g=mw(y);let x=m[g],E=m[y];if(l){const T=g==="y"?"top":"left",C=g==="y"?"bottom":"right",k=x+h[T],M=x-h[C];x=Xv(k,x,M)}if(c){const T=y==="y"?"top":"left",C=y==="y"?"bottom":"right",k=E+h[T],M=E-h[C];E=Xv(k,E,M)}const R=f.fn({...t,[g]:x,[y]:E});return{...R,data:{x:R.x-n,y:R.y-r,enabled:{[g]:l,[y]:c}}}}}},jH=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:a,middlewareData:l}=t,{offset:c=0,mainAxis:f=!0,crossAxis:d=!0}=Yo(e,t),m={x:n,y:r},h=Ei(o),y=mw(h);let g=m[y],x=m[h];const E=Yo(c,t),R=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:0,crossAxis:0,...E};if(f){const k=y==="y"?"height":"width",M=a.reference[y]-a.floating[k]+R.mainAxis,D=a.reference[y]+a.reference[k]-R.mainAxis;g<M?g=M:g>D&&(g=D)}if(d){var T,C;const k=y==="y"?"width":"height",M=KO.has(Hr(o)),D=a.reference[h]-a.floating[k]+(M&&((T=l.offset)==null?void 0:T[h])||0)+(M?0:R.crossAxis),O=a.reference[h]+a.reference[k]+(M?0:((C=l.offset)==null?void 0:C[h])||0)-(M?R.crossAxis:0);x<D?x=D:x>O&&(x=O)}return{[y]:g,[h]:x}}}},zH=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:a,platform:l,elements:c}=t,{apply:f=()=>{},...d}=Yo(e,t),m=await l.detectOverflow(t,d),h=Hr(o),y=ns(o),g=Ei(o)==="y",{width:x,height:E}=a.floating;let R,T;h==="top"||h==="bottom"?(R=h,T=y===(await(l.isRTL==null?void 0:l.isRTL(c.floating))?"start":"end")?"left":"right"):(T=h,R=y==="end"?"top":"bottom");const C=E-m.top-m.bottom,k=x-m.left-m.right,M=Tc(E-m[R],C),D=Tc(x-m[T],k),O=!t.middlewareData.shift;let N=M,_=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(_=k),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(N=C),O&&!y){const F=ii(m.left,0),G=ii(m.right,0),P=ii(m.top,0),U=ii(m.bottom,0);g?_=x-2*(F!==0||G!==0?F+G:ii(m.left,m.right)):N=E-2*(P!==0||U!==0?P+U:ii(m.top,m.bottom))}await f({...t,availableWidth:_,availableHeight:N});const q=await l.getDimensions(c.floating);return x!==q.width||E!==q.height?{reset:{rects:!0}}:{}}}};function WO(e){const t=si(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=On(e),a=o?e.offsetWidth:n,l=o?e.offsetHeight:r,c=Np(n)!==a||Np(r)!==l;return c&&(n=a,r=l),{width:n,height:r,$:c}}function Nw(e){return fn(e)?e:e.contextElement}function oc(e){const t=Nw(e);if(!On(t))return so(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:a}=WO(t);let l=(a?Np(n.width):n.width)/r,c=(a?Np(n.height):n.height)/o;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const FH=so(0);function XO(e){const t=Hn(e);return!fm()||!t.visualViewport?FH:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function BH(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Hn(e)?!1:t}function el(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),a=Nw(e);let l=so(1);t&&(r?fn(r)&&(l=oc(r)):l=oc(e));const c=BH(a,n,r)?XO(a):so(0);let f=(o.left+c.x)/l.x,d=(o.top+c.y)/l.y,m=o.width/l.x,h=o.height/l.y;if(a){const y=Hn(a),g=r&&fn(r)?Hn(r):r;let x=y,E=Gv(x);for(;E&&r&&g!==x;){const R=oc(E),T=E.getBoundingClientRect(),C=si(E),k=T.left+(E.clientLeft+parseFloat(C.paddingLeft))*R.x,M=T.top+(E.clientTop+parseFloat(C.paddingTop))*R.y;f*=R.x,d*=R.y,m*=R.x,h*=R.y,f+=k,d+=M,x=Hn(E),E=Gv(x)}}return Dp({width:m,height:h,x:f,y:d})}function Em(e,t){const n=hm(e).scrollLeft;return t?t.left+n:el(ho(e)).left+n}function QO(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Em(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function UH(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const a=o==="fixed",l=ho(r),c=t?dm(t.floating):!1;if(r===l||c&&a)return n;let f={scrollLeft:0,scrollTop:0},d=so(1);const m=so(0),h=On(r);if((h||!h&&!a)&&((Ja(r)!=="body"||es(l))&&(f=hm(r)),On(r))){const g=el(r);d=oc(r),m.x=g.x+r.clientLeft,m.y=g.y+r.clientTop}const y=l&&!h&&!a?QO(l,f):so(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-f.scrollLeft*d.x+m.x+y.x,y:n.y*d.y-f.scrollTop*d.y+m.y+y.y}}function HH(e){return Array.from(e.getClientRects())}function qH(e){const t=ho(e),n=hm(e),r=e.ownerDocument.body,o=ii(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=ii(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Em(e);const c=-n.scrollTop;return si(r).direction==="rtl"&&(l+=ii(t.clientWidth,r.clientWidth)-o),{width:o,height:a,x:l,y:c}}const xC=25;function VH(e,t){const n=Hn(e),r=ho(e),o=n.visualViewport;let a=r.clientWidth,l=r.clientHeight,c=0,f=0;if(o){a=o.width,l=o.height;const m=fm();(!m||m&&t==="fixed")&&(c=o.offsetLeft,f=o.offsetTop)}const d=Em(r);if(d<=0){const m=r.ownerDocument,h=m.body,y=getComputedStyle(h),g=m.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,x=Math.abs(r.clientWidth-h.clientWidth-g);x<=xC&&(a-=x)}else d<=xC&&(a+=d);return{width:a,height:l,x:c,y:f}}const $H=new Set(["absolute","fixed"]);function GH(e,t){const n=el(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,a=On(e)?oc(e):so(1),l=e.clientWidth*a.x,c=e.clientHeight*a.y,f=o*a.x,d=r*a.y;return{width:l,height:c,x:f,y:d}}function wC(e,t,n){let r;if(t==="viewport")r=VH(e,n);else if(t==="document")r=qH(ho(e));else if(fn(t))r=GH(t,n);else{const o=XO(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Dp(r)}function ZO(e,t){const n=co(e);return n===t||!fn(n)||ao(n)?!1:si(n).position==="fixed"||ZO(n,t)}function YH(e,t){const n=t.get(e);if(n)return n;let r=Va(e,[],!1).filter(c=>fn(c)&&Ja(c)!=="body"),o=null;const a=si(e).position==="fixed";let l=a?co(e):e;for(;fn(l)&&!ao(l);){const c=si(l),f=uw(l);!f&&c.position==="fixed"&&(o=null),(a?!f&&!o:!f&&c.position==="static"&&!!o&&$H.has(o.position)||es(l)&&!f&&ZO(e,l))?r=r.filter(m=>m!==l):o=c,l=co(l)}return t.set(e,r),r}function KH(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const l=[...n==="clippingAncestors"?dm(t)?[]:YH(t,this._c):[].concat(n),r],c=l[0],f=l.reduce((d,m)=>{const h=wC(t,m,o);return d.top=ii(h.top,d.top),d.right=Tc(h.right,d.right),d.bottom=Tc(h.bottom,d.bottom),d.left=ii(h.left,d.left),d},wC(t,c,o));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function WH(e){const{width:t,height:n}=WO(e);return{width:t,height:n}}function XH(e,t,n){const r=On(t),o=ho(t),a=n==="fixed",l=el(e,!0,a,t);let c={scrollLeft:0,scrollTop:0};const f=so(0);function d(){f.x=Em(o)}if(r||!r&&!a)if((Ja(t)!=="body"||es(o))&&(c=hm(t)),r){const g=el(t,!0,a,t);f.x=g.x+t.clientLeft,f.y=g.y+t.clientTop}else o&&d();a&&!r&&o&&d();const m=o&&!r&&!a?QO(o,c):so(0),h=l.left+c.scrollLeft-f.x-m.x,y=l.top+c.scrollTop-f.y-m.y;return{x:h,y,width:l.width,height:l.height}}function Cb(e){return si(e).position==="static"}function SC(e,t){if(!On(e)||si(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ho(e)===n&&(n=n.ownerDocument.body),n}function JO(e,t){const n=Hn(e);if(dm(e))return n;if(!On(e)){let o=co(e);for(;o&&!ao(o);){if(fn(o)&&!Cb(o))return o;o=co(o)}return n}let r=SC(e,t);for(;r&&WB(r)&&Cb(r);)r=SC(r,t);return r&&ao(r)&&Cb(r)&&!uw(r)?n:r||eU(e)||n}const QH=async function(e){const t=this.getOffsetParent||JO,n=this.getDimensions,r=await n(e.floating);return{reference:XH(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ZH(e){return si(e).direction==="rtl"}const JH={convertOffsetParentRelativeRectToViewportRelativeRect:UH,getDocumentElement:ho,getClippingRect:KH,getOffsetParent:JO,getElementRects:QH,getClientRects:HH,getDimensions:WH,getScale:oc,isElement:fn,isRTL:ZH};function eN(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function e6(e,t){let n=null,r;const o=ho(e);function a(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function l(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),a();const d=e.getBoundingClientRect(),{left:m,top:h,width:y,height:g}=d;if(c||t(),!y||!g)return;const x=Zl(h),E=Zl(o.clientWidth-(m+y)),R=Zl(o.clientHeight-(h+g)),T=Zl(m),k={rootMargin:-x+"px "+-E+"px "+-R+"px "+-T+"px",threshold:ii(0,Tc(1,f))||1};let M=!0;function D(O){const N=O[0].intersectionRatio;if(N!==f){if(!M)return l();N?l(!1,N):r=setTimeout(()=>{l(!1,1e-7)},1e3)}N===1&&!eN(d,e.getBoundingClientRect())&&l(),M=!1}try{n=new IntersectionObserver(D,{...k,root:o.ownerDocument})}catch{n=new IntersectionObserver(D,k)}n.observe(e)}return l(!0),a}function EC(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,d=Nw(e),m=o||a?[...d?Va(d):[],...Va(t)]:[];m.forEach(T=>{o&&T.addEventListener("scroll",n,{passive:!0}),a&&T.addEventListener("resize",n)});const h=d&&c?e6(d,n):null;let y=-1,g=null;l&&(g=new ResizeObserver(T=>{let[C]=T;C&&C.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var k;(k=g)==null||k.observe(t)})),n()}),d&&!f&&g.observe(d),g.observe(t));let x,E=f?el(e):null;f&&R();function R(){const T=el(e);E&&!eN(E,T)&&n(),E=T,x=requestAnimationFrame(R)}return n(),()=>{var T;m.forEach(C=>{o&&C.removeEventListener("scroll",n),a&&C.removeEventListener("resize",n)}),h==null||h(),(T=g)==null||T.disconnect(),g=null,f&&cancelAnimationFrame(x)}}const t6=PH,n6=LH,r6=DH,i6=zH,o6=_H,a6=jH,s6=(e,t,n)=>{const r=new Map,o={platform:JH,...n},a={...o.platform,_c:r};return AH(e,t,{...o,platform:a})};var l6=typeof document<"u",c6=function(){},hp=l6?v.useLayoutEffect:c6;function Fp(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,o;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(!Fp(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const a=o[r];if(!(a==="_owner"&&e.$$typeof)&&!Fp(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function tN(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function TC(e,t){const n=tN(e);return Math.round(t*n)/n}function kb(e){const t=v.useRef(e);return hp(()=>{t.current=e}),t}function u6(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:a,floating:l}={},transform:c=!0,whileElementsMounted:f,open:d}=e,[m,h]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,g]=v.useState(r);Fp(y,r)||g(r);const[x,E]=v.useState(null),[R,T]=v.useState(null),C=v.useCallback(V=>{V!==O.current&&(O.current=V,E(V))},[]),k=v.useCallback(V=>{V!==N.current&&(N.current=V,T(V))},[]),M=a||x,D=l||R,O=v.useRef(null),N=v.useRef(null),_=v.useRef(m),q=f!=null,F=kb(f),G=kb(o),P=kb(d),U=v.useCallback(()=>{if(!O.current||!N.current)return;const V={placement:t,strategy:n,middleware:y};G.current&&(V.platform=G.current),s6(O.current,N.current,V).then(K=>{const L={...K,isPositioned:P.current!==!1};H.current&&!Fp(_.current,L)&&(_.current=L,yr.flushSync(()=>{h(L)}))})},[y,t,n,G,P]);hp(()=>{d===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,h(V=>({...V,isPositioned:!1})))},[d]);const H=v.useRef(!1);hp(()=>(H.current=!0,()=>{H.current=!1}),[]),hp(()=>{if(M&&(O.current=M),D&&(N.current=D),M&&D){if(F.current)return F.current(M,D,U);U()}},[M,D,U,F,q]);const B=v.useMemo(()=>({reference:O,floating:N,setReference:C,setFloating:k}),[C,k]),j=v.useMemo(()=>({reference:M,floating:D}),[M,D]),z=v.useMemo(()=>{const V={position:n,left:0,top:0};if(!j.floating)return V;const K=TC(j.floating,m.x),L=TC(j.floating,m.y);return c?{...V,transform:"translate("+K+"px, "+L+"px)",...tN(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:L}},[n,c,j.floating,m.x,m.y]);return v.useMemo(()=>({...m,update:U,refs:B,elements:j,floatingStyles:z}),[m,U,B,j,z])}const d6=(e,t)=>({...t6(e),options:[e,t]}),f6=(e,t)=>({...n6(e),options:[e,t]}),h6=(e,t)=>({...a6(e),options:[e,t]}),p6=(e,t)=>({...r6(e),options:[e,t]}),m6=(e,t)=>({...i6(e),options:[e,t]}),g6=(e,t)=>({...o6(e),options:[e,t]}),y6={intentional:"onClick",sloppy:"onPointerDown"};function b6(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function Tm(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),a=n.useState("referenceElement"),l=n.useState("domReferenceElement"),{onOpenChange:c,dataRef:f}=n.context,{enabled:d=!0,escapeKey:m=!0,outsidePress:h=!0,outsidePressEvent:y="sloppy",referencePress:g=!1,referencePressEvent:x="sloppy",ancestorScroll:E=!1,bubbles:R,externalTree:T}=t,C=is(T),k=Ge(typeof h=="function"?h:()=>!1),M=typeof h=="function"?k:h,D=v.useRef(!1),{escapeKey:O,outsidePress:N}=b6(R),_=v.useRef(null),q=Dn(),F=Dn(),G=Ge(()=>{F.clear(),f.current.insideReactTree=!1}),P=v.useRef(!1),U=v.useRef(""),H=Ge(te=>{U.current=te.pointerType}),B=Ge(()=>{const te=U.current,he=te==="pen"||!te?"mouse":te,ye=typeof y=="function"?y():y;return typeof ye=="string"?ye:ye[he]}),j=Ge(te=>{var Te;if(!r||!d||!m||te.key!=="Escape"||P.current)return;const he=(Te=f.current.floatingContext)==null?void 0:Te.nodeId,ye=C?qs(C.nodesRef.current,he):[];if(!O&&ye.length>0){let Ce=!0;if(ye.forEach(J=>{var Ee;(Ee=J.context)!=null&&Ee.open&&!J.context.dataRef.current.__escapeKeyBubbles&&(Ce=!1)}),!Ce)return}const Le=TU(te)?te.nativeEvent:te,Oe=yt(xm,Le);n.setOpen(!1,Oe),!O&&!Oe.isPropagationAllowed&&te.stopPropagation()}),z=Ge(te=>{const he=B();return he==="intentional"&&te.type!=="click"||he==="sloppy"&&te.type==="click"}),V=Ge(()=>{f.current.insideReactTree=!0,F.start(0,G)}),K=Ge((te,he=!1)=>{var Be;if(z(te)){G();return}if(f.current.insideReactTree){G();return}if(B()==="intentional"&&he||typeof M=="function"&&!M(te))return;const ye=gr(te),Le=`[${kc("inert")}]`,Oe=Gt(n.select("floatingElement")).querySelectorAll(Le),Te=n.context.triggerElements;if(ye&&(Te.hasElement(ye)||Te.hasMatchingElement(Ve=>Tt(Ve,ye))))return;let Ce=fn(ye)?ye:null;for(;Ce&&!ao(Ce);){const Ve=co(Ce);if(ao(Ve)||!fn(Ve))break;Ce=Ve}if(Oe.length&&fn(ye)&&!SU(ye)&&!Tt(ye,n.select("floatingElement"))&&Array.from(Oe).every(Ve=>!Tt(Ce,Ve)))return;if(On(ye)&&!("touches"in te)){const Ve=ao(ye),_e=si(ye),ut=/auto|scroll/,pe=Ve||ut.test(_e.overflowX),Re=Ve||ut.test(_e.overflowY),ee=pe&&ye.clientWidth>0&&ye.scrollWidth>ye.clientWidth,fe=Re&&ye.clientHeight>0&&ye.scrollHeight>ye.clientHeight,Ne=_e.direction==="rtl",Ue=fe&&(Ne?te.offsetX<=ye.offsetWidth-ye.clientWidth:te.offsetX>ye.clientWidth),$e=ee&&te.offsetY>ye.clientHeight;if(Ue||$e)return}const J=(Be=f.current.floatingContext)==null?void 0:Be.nodeId,Ee=C&&qs(C.nodesRef.current,J).some(Ve=>{var _e;return Li(te,(_e=Ve.context)==null?void 0:_e.elements.floating)});if(Li(te,n.select("floatingElement"))||Li(te,n.select("domReferenceElement"))||Ee)return;const xe=C?qs(C.nodesRef.current,J):[];if(xe.length>0){let Ve=!0;if(xe.forEach(_e=>{var ut;(ut=_e.context)!=null&&ut.open&&!_e.context.dataRef.current.__outsidePressBubbles&&(Ve=!1)}),!Ve)return}n.setOpen(!1,yt(vm,te)),G()}),L=Ge(te=>{B()!=="sloppy"||te.pointerType==="touch"||!n.select("open")||!d||Li(te,n.select("floatingElement"))||Li(te,n.select("domReferenceElement"))||K(te)}),$=Ge(te=>{if(B()!=="sloppy"||!n.select("open")||!d||Li(te,n.select("floatingElement"))||Li(te,n.select("domReferenceElement")))return;const he=te.touches[0];he&&(_.current={startTime:Date.now(),startX:he.clientX,startY:he.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},q.start(1e3,()=>{_.current&&(_.current.dismissOnTouchEnd=!1,_.current.dismissOnMouseDown=!1)}))}),W=Ge(te=>{const he=gr(te);function ye(){$(te),he==null||he.removeEventListener(te.type,ye)}he==null||he.addEventListener(te.type,ye)}),I=Ge(te=>{const he=D.current;if(D.current=!1,q.clear(),te.type==="mousedown"&&_.current&&!_.current.dismissOnMouseDown)return;const ye=gr(te);function Le(){te.type==="pointerdown"?L(te):K(te,he),ye==null||ye.removeEventListener(te.type,Le)}ye==null||ye.addEventListener(te.type,Le)}),Q=Ge(te=>{if(B()!=="sloppy"||!_.current||Li(te,n.select("floatingElement"))||Li(te,n.select("domReferenceElement")))return;const he=te.touches[0];if(!he)return;const ye=Math.abs(he.clientX-_.current.startX),Le=Math.abs(he.clientY-_.current.startY),Oe=Math.sqrt(ye*ye+Le*Le);Oe>5&&(_.current.dismissOnTouchEnd=!0),Oe>10&&(K(te),q.clear(),_.current=null)}),le=Ge(te=>{const he=gr(te);function ye(){Q(te),he==null||he.removeEventListener(te.type,ye)}he==null||he.addEventListener(te.type,ye)}),oe=Ge(te=>{B()!=="sloppy"||!_.current||Li(te,n.select("floatingElement"))||Li(te,n.select("domReferenceElement"))||(_.current.dismissOnTouchEnd&&K(te),q.clear(),_.current=null)}),Z=Ge(te=>{const he=gr(te);function ye(){oe(te),he==null||he.removeEventListener(te.type,ye)}he==null||he.addEventListener(te.type,ye)});v.useEffect(()=>{if(!r||!d)return;f.current.__escapeKeyBubbles=O,f.current.__outsidePressBubbles=N;const te=new uo;function he(Ce){n.setOpen(!1,yt(qi,Ce))}function ye(){te.clear(),P.current=!0}function Le(){te.start(fm()?5:0,()=>{P.current=!1})}const Oe=Gt(o);Oe.addEventListener("pointerdown",H,!0),m&&(Oe.addEventListener("keydown",j),Oe.addEventListener("compositionstart",ye),Oe.addEventListener("compositionend",Le)),M&&(Oe.addEventListener("click",I,!0),Oe.addEventListener("pointerdown",I,!0),Oe.addEventListener("touchstart",W,!0),Oe.addEventListener("touchmove",le,!0),Oe.addEventListener("touchend",Z,!0),Oe.addEventListener("mousedown",I,!0));let Te=[];return E&&(fn(l)&&(Te=Va(l)),fn(o)&&(Te=Te.concat(Va(o))),!fn(a)&&a&&a.contextElement&&(Te=Te.concat(Va(a.contextElement)))),Te=Te.filter(Ce=>{var J;return Ce!==((J=Oe.defaultView)==null?void 0:J.visualViewport)}),Te.forEach(Ce=>{Ce.addEventListener("scroll",he,{passive:!0})}),()=>{Oe.removeEventListener("pointerdown",H,!0),m&&(Oe.removeEventListener("keydown",j),Oe.removeEventListener("compositionstart",ye),Oe.removeEventListener("compositionend",Le)),M&&(Oe.removeEventListener("click",I,!0),Oe.removeEventListener("pointerdown",I,!0),Oe.removeEventListener("touchstart",W,!0),Oe.removeEventListener("touchmove",le,!0),Oe.removeEventListener("touchend",Z,!0),Oe.removeEventListener("mousedown",I,!0)),Te.forEach(Ce=>{Ce.removeEventListener("scroll",he)}),te.clear(),D.current=!1}},[f,o,a,l,m,M,r,c,E,d,O,N,j,K,I,L,W,le,Z,H,n]),v.useEffect(G,[M,G]);const ue=v.useMemo(()=>({onKeyDown:j,...g&&{[y6[x]]:te=>{n.setOpen(!1,yt(Wa,te.nativeEvent))},...x!=="intentional"&&{onClick(te){n.setOpen(!1,yt(Wa,te.nativeEvent))}}}}),[j,n,g,x]),ve=Ge(te=>{const he=gr(te.nativeEvent);!Tt(n.select("floatingElement"),he)||te.button!==0||(D.current=!0)}),Se=Ge(te=>{!r||!d||te.button!==0||(D.current=!0)}),Pe=v.useMemo(()=>({onKeyDown:j,onPointerDown:ve,onMouseDown:ve,onMouseUp:ve,onClickCapture:V,onMouseDownCapture(te){V(),Se(te)},onPointerDownCapture(te){V(),Se(te)},onMouseUpCapture:V,onTouchEndCapture:V,onTouchMoveCapture:V}),[j,ve,V,Se]);return v.useMemo(()=>d?{reference:ue,floating:Pe,trigger:ue}:{},[d,ue,Pe])}var Bp=Symbol("NOT_FOUND");function v6(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function x6(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function w6(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var RC=e=>Array.isArray(e)?e:[e];function S6(e){const t=Array.isArray(e[0])?e[0]:e;return w6(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function E6(e,t){const n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}function T6(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Bp},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function R6(e,t){let n=[];function r(c){const f=n.findIndex(d=>t(c,d.key));if(f>-1){const d=n[f];return f>0&&(n.splice(f,1),n.unshift(d)),d.value}return Bp}function o(c,f){r(c)===Bp&&(n.unshift({key:c,value:f}),n.length>e&&n.pop())}function a(){return n}function l(){n=[]}return{get:r,put:o,getEntries:a,clear:l}}var C6=(e,t)=>e===t;function k6(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:o}=n;for(let a=0;a<o;a++)if(!e(n[a],r[a]))return!1;return!0}}function M6(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=C6,maxSize:o=1,resultEqualityCheck:a}=n,l=k6(r);let c=0;const f=o<=1?T6(l):R6(o,l);function d(){let m=f.get(arguments);if(m===Bp){if(m=e.apply(null,arguments),c++,a){const y=f.getEntries().find(g=>a(g.value,m));y&&(m=y.value,c!==0&&c--)}f.put(arguments,m)}return m}return d.clearCache=()=>{f.clear(),d.resetResultsCount()},d.resultsCount=()=>c,d.resetResultsCount=()=>{c=0},d}var O6=class{constructor(e){this.value=e}deref(){return this.value}},N6=typeof WeakRef<"u"?WeakRef:O6,A6=0,CC=1;function Uh(){return{s:A6,v:void 0,o:null,p:null}}function nN(e,t={}){let n=Uh();const{resultEqualityCheck:r}=t;let o,a=0;function l(){var h;let c=n;const{length:f}=arguments;for(let y=0,g=f;y<g;y++){const x=arguments[y];if(typeof x=="function"||typeof x=="object"&&x!==null){let E=c.o;E===null&&(c.o=E=new WeakMap);const R=E.get(x);R===void 0?(c=Uh(),E.set(x,c)):c=R}else{let E=c.p;E===null&&(c.p=E=new Map);const R=E.get(x);R===void 0?(c=Uh(),E.set(x,c)):c=R}}const d=c;let m;if(c.s===CC)m=c.v;else if(m=e.apply(null,arguments),a++,r){const y=((h=o==null?void 0:o.deref)==null?void 0:h.call(o))??o;y!=null&&r(y,m)&&(m=y,a!==0&&a--),o=typeof m=="object"&&m!==null||typeof m=="function"?new N6(m):m}return d.s=CC,d.v=m,m}return l.clearCache=()=>{n=Uh(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}function rN(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...o)=>{let a=0,l=0,c,f={},d=o.pop();typeof d=="object"&&(f=d,d=o.pop()),v6(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const m={...n,...f},{memoize:h,memoizeOptions:y=[],argsMemoize:g=nN,argsMemoizeOptions:x=[]}=m,E=RC(y),R=RC(x),T=S6(o),C=h(function(){return a++,d.apply(null,arguments)},...E),k=g(function(){l++;const D=E6(T,arguments);return c=C.apply(null,D),c},...R);return Object.assign(k,{resultFunc:d,memoizedResultFunc:C,dependencies:T,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>c,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:h,argsMemoize:g})};return Object.assign(r,{withTypes:()=>r}),r}var D6=rN(nN),_6=Object.assign((e,t=D6)=>{x6(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(a=>e[a]);return t(r,(...a)=>a.reduce((l,c,f)=>(l[n[f]]=c,l),{}))},{withTypes:()=>_6});rN({memoize:M6,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const We=(e,t,n,r,o,a,...l)=>{if(l.length>0)throw new Error(Rn(1));let c;if(e)c=e;else throw new Error("Missing arguments");return c};var Mb={exports:{}},Ob={};/**
|
|
89
|
+
* @license React
|
|
90
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
91
|
+
*
|
|
92
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
93
|
+
*
|
|
94
|
+
* This source code is licensed under the MIT license found in the
|
|
95
|
+
* LICENSE file in the root directory of this source tree.
|
|
96
|
+
*/var kC;function I6(){if(kC)return Ob;kC=1;var e=Vd(),t=B2();function n(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,a=e.useRef,l=e.useEffect,c=e.useMemo,f=e.useDebugValue;return Ob.useSyncExternalStoreWithSelector=function(d,m,h,y,g){var x=a(null);if(x.current===null){var E={hasValue:!1,value:null};x.current=E}else E=x.current;x=c(function(){function T(O){if(!C){if(C=!0,k=O,O=y(O),g!==void 0&&E.hasValue){var N=E.value;if(g(N,O))return M=N}return M=O}if(N=M,r(k,O))return N;var _=y(O);return g!==void 0&&g(N,_)?(k=O,N):(k=O,M=_)}var C=!1,k,M,D=h===void 0?null:h;return[function(){return T(m())},D===null?void 0:function(){return T(D())}]},[m,h,y,g]);var R=o(d,x[0],x[1]);return l(function(){E.hasValue=!0,E.value=R},[R]),f(R),R},Ob}var MC;function P6(){return MC||(MC=1,Mb.exports=I6()),Mb.exports}var L6=P6();const tx=[];let nx;function j6(){return nx}function z6(e){tx.push(e)}function Aw(e){const t=(n,r)=>{const o=rr(F6).current;let a;try{nx=o;for(const l of tx)l.before(o);a=e(n,r);for(const l of tx)l.after(o);o.didInitialize=!0}finally{nx=void 0}return a};return t.displayName=e.displayName||e.name,t}function iN(e){return v.forwardRef(Aw(e))}function F6(){return{didInitialize:!1}}const B6=sw(19),U6=B6?q6:V6;function Rt(e,t,n,r,o){return U6(e,t,n,r,o)}function H6(e,t,n,r,o){const a=v.useCallback(()=>t(e.getSnapshot(),n,r,o),[e,t,n,r,o]);return aw.useSyncExternalStore(e.subscribe,a,a)}z6({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],o=r.selector(r.store.state,r.a1,r.a2,r.a3);(r.didChange||!Object.is(r.value,o))&&(t=!0,r.value=o,r.didChange=!1)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const o of e.syncHooks)n.add(o.store);const r=[];for(const o of n)r.push(o.subscribe(t));return()=>{for(const o of r)o()}}),aw.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function q6(e,t,n,r,o){const a=j6();if(!a)return H6(e,t,n,r,o);const l=a.syncIndex;a.syncIndex+=1;let c;return a.didInitialize?(c=a.syncHooks[l],(c.store!==e||c.selector!==t||!Object.is(c.a1,n)||!Object.is(c.a2,r)||!Object.is(c.a3,o))&&(c.store!==e&&(a.didChangeStore=!0),c.store=e,c.selector=t,c.a1=n,c.a2=r,c.a3=o,c.didChange=!0)):(c={store:e,selector:t,a1:n,a2:r,a3:o,value:t(e.getSnapshot(),n,r,o),didChange:!1},a.syncHooks.push(c)),c.value}function V6(e,t,n,r,o){return L6.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,a=>t(a,n,r,o))}class oN{constructor(t){tt(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));tt(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,o){return Rt(this,t,n,r,o)}}class Rm extends oN{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){v.useDebugValue(t),qe(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const r=this;qe(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);qe(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){v.useDebugValue(t);const r=n!==void 0;qe(()=>{r&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,r])}select(t,n,r,o){const a=this.selectors[t];return a(this.state,n,r,o)}useState(t,n,r,o){return v.useDebugValue(t),Rt(this,this.selectors[t],n,r,o)}useContextCallback(t,n){v.useDebugValue(t);const r=Ge(n??Ur);this.context[t]=r}useStateSetter(t){const n=v.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let o=r(this.state);return n(o,o,this),this.subscribe(a=>{const l=r(a);if(!Object.is(o,l)){const c=o;o=l,n(l,c,this)}})}}const $6={open:We(e=>e.open),domReferenceElement:We(e=>e.domReferenceElement),referenceElement:We(e=>e.positionReference??e.referenceElement),floatingElement:We(e=>e.floatingElement),floatingId:We(e=>e.floatingId)};class Dw extends Rm{constructor(n){const{nested:r,noEmit:o,onOpenChange:a,triggerElements:l,...c}=n;super({...c,positionReference:c.referenceElement,domReferenceElement:c.referenceElement},{onOpenChange:a,dataRef:{current:{}},events:jO(),nested:r,noEmit:o,triggerElements:l},$6);tt(this,"setOpen",(n,r)=>{var o,a;if((!n||!this.state.open||vO(r.event))&&(this.context.dataRef.current.openEvent=n?r.event:void 0),!this.context.noEmit){const l={open:n,reason:r.reason,nativeEvent:r.event,nested:this.context.nested,triggerElement:r.trigger};this.context.events.emit("openchange",l)}(a=(o=this.context).onOpenChange)==null||a.call(o,n,r)})}}function G6(e,t){const n=v.useRef(null),r=v.useRef(null);return v.useCallback(o=>{if(e!==void 0){if(n.current!==null){const a=n.current,l=r.current,c=t.context.triggerElements.getById(a);l&&c===l&&t.context.triggerElements.delete(a),n.current=null,r.current=null}o!==null&&(n.current=e,r.current=o,t.context.triggerElements.add(e,o))}},[t,e])}function aN(e,t,n,r){const o=n.useState("isMountedByTrigger",e),a=G6(e,n),l=Ge(c=>{if(a(c),!c||!n.select("open"))return;const f=n.select("activeTriggerId");if(f===e){n.update({activeTriggerElement:c,...r});return}f==null&&n.update({activeTriggerId:e,activeTriggerElement:c,...r})});return qe(()=>{o&&n.update({activeTriggerElement:t.current,...r})},[o,n,t,...Object.values(r)]),{registerTrigger:l,isMountedByThisTrigger:o}}function _w(e){const t=e.useState("open");qe(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[r,o]=n.value;e.update({activeTriggerId:r,activeTriggerElement:o})}}},[t,e])}function Iw(e,t,n){const{mounted:r,setMounted:o,transitionStatus:a}=Jd(e);t.useSyncedValues({mounted:r,transitionStatus:a});const l=Ge(()=>{var f,d;o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n==null||n(),(d=(f=t.context).onOpenChangeComplete)==null||d.call(f,!1)}),c=t.useState("preventUnmountingOnClose");return Qo({enabled:!c,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:a}}class ef{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);r!==n&&(r!==void 0&&this.elementsSet.delete(r),this.elementsSet.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function Y6(){return new Dw({open:!1,floatingElement:null,referenceElement:null,triggerElements:new ef,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function Pw(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:Y6(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Pn,inactiveTriggerProps:Pn,popupProps:Pn}}const Hh=We(e=>e.triggerIdProp??e.activeTriggerId),Lw={open:We(e=>e.openProp??e.open),mounted:We(e=>e.mounted),transitionStatus:We(e=>e.transitionStatus),floatingRootContext:We(e=>e.floatingRootContext),preventUnmountingOnClose:We(e=>e.preventUnmountingOnClose),payload:We(e=>e.payload),activeTriggerId:Hh,activeTriggerElement:We(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:We((e,t)=>t!==void 0&&Hh(e)===t),isOpenedByTrigger:We((e,t)=>t!==void 0&&Hh(e)===t&&e.open),isMountedByTrigger:We((e,t)=>t!==void 0&&Hh(e)===t&&e.mounted),triggerProps:We((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:We(e=>e.popupProps),popupElement:We(e=>e.popupElement),positionerElement:We(e=>e.positionerElement)};function sN(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,o=ts(),a=Zo()!=null,l=rr(()=>new Dw({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new ef,floatingId:o,nested:a,noEmit:!1})).current;return qe(()=>{const c={open:t,floatingId:o};r.reference!==void 0&&(c.referenceElement=r.reference,c.domReferenceElement=fn(r.reference)?r.reference:null),r.floating!==void 0&&(c.floatingElement=r.floating),l.update(c)},[t,o,r.reference,r.floating,l]),l.context.onOpenChange=n,l.context.nested=a,l.context.noEmit=!1,l}function K6(e={}){const{nodeId:t,externalTree:n}=e,r=sN(e),o=e.rootContext||r,a={reference:o.useState("referenceElement"),floating:o.useState("floatingElement"),domReference:o.useState("domReferenceElement")},[l,c]=v.useState(null),f=v.useRef(null),d=is(n);qe(()=>{a.domReference&&(f.current=a.domReference)},[a.domReference]);const m=u6({...e,elements:{...a,...l&&{reference:l}}}),h=v.useCallback(N=>{const _=fn(N)?{getBoundingClientRect:()=>N.getBoundingClientRect(),getClientRects:()=>N.getClientRects(),contextElement:N}:N;c(_),m.refs.setReference(_)},[m.refs]),[y,g]=v.useState(null),[x,E]=v.useState(null);o.useSyncedValue("referenceElement",y),o.useSyncedValue("domReferenceElement",fn(y)?y:null),o.useSyncedValue("floatingElement",x);const R=v.useCallback(N=>{(fn(N)||N===null)&&(f.current=N,g(N)),(fn(m.refs.reference.current)||m.refs.reference.current===null||N!==null&&!fn(N))&&m.refs.setReference(N)},[m.refs,g]),T=v.useCallback(N=>{E(N),m.refs.setFloating(N)},[m.refs]),C=v.useMemo(()=>({...m.refs,setReference:R,setFloating:T,setPositionReference:h,domReference:f}),[m.refs,R,T,h]),k=v.useMemo(()=>({...m.elements,domReference:a.domReference}),[m.elements,a.domReference]),M=o.useState("open"),D=o.useState("floatingId"),O=v.useMemo(()=>({...m,dataRef:o.context.dataRef,open:M,onOpenChange:o.setOpen,events:o.context.events,floatingId:D,refs:C,elements:k,nodeId:t,rootStore:o}),[m,C,k,t,o,M,D]);return qe(()=>{o.context.dataRef.current.floatingContext=O;const N=d==null?void 0:d.nodesRef.current.find(_=>_.id===t);N&&(N.context=O)}),v.useMemo(()=>({...m,context:O,refs:C,elements:k,rootStore:o}),[m,C,k,O,o])}function jw(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:o}=e,a=ts(),l=Zo()!=null,c=t.useState("open"),f=t.useState("activeTriggerElement"),d=t.useState(r?"popupElement":"positionerElement"),m=t.context.triggerElements,h=rr(()=>new Dw({open:c,referenceElement:f,floatingElement:d,triggerElements:m,onOpenChange:o,floatingId:a,nested:l,noEmit:n})).current;return qe(()=>{const y={open:c,floatingId:a,referenceElement:f,floatingElement:d};fn(f)&&(y.domReferenceElement=f),h.state.positionReference===h.state.referenceElement&&(y.positionReference=f),h.update(y)},[c,a,f,d,h]),h.context.onOpenChange=o,h.context.nested=l,h.context.noEmit=n,h}const Nb=bU&&fO;function lN(e,t={}){const n="rootStore"in e?e.rootStore:e,{events:r,dataRef:o}=n.context,{enabled:a=!0,delay:l}=t,c=v.useRef(!1),f=v.useRef(null),d=Dn(),m=v.useRef(!0);v.useEffect(()=>{const y=n.select("domReferenceElement");if(!a)return;const g=Hn(y);function x(){const T=n.select("domReferenceElement");!n.select("open")&&On(T)&&T===ri(Gt(T))&&(c.current=!0)}function E(){m.current=!0}function R(){m.current=!1}return g.addEventListener("blur",x),Nb&&(g.addEventListener("keydown",E,!0),g.addEventListener("pointerdown",R,!0)),()=>{g.removeEventListener("blur",x),Nb&&(g.removeEventListener("keydown",E,!0),g.removeEventListener("pointerdown",R,!0))}},[n,a]),v.useEffect(()=>{if(!a)return;function y(g){if(g.reason===Wa||g.reason===xm){const x=n.select("domReferenceElement");fn(x)&&(f.current=x,c.current=!0)}}return r.on("openchange",y),()=>{r.off("openchange",y)}},[r,a,n]);const h=v.useMemo(()=>({onMouseLeave(){c.current=!1,f.current=null},onFocus(y){const g=y.currentTarget;if(c.current){if(f.current===g)return;c.current=!1,f.current=null}const x=gr(y.nativeEvent);if(fn(x)){if(Nb&&!y.relatedTarget){if(!m.current&&!ym(x))return}else if(!EU(x))return}const E=Op(y.relatedTarget,n.context.triggerElements),{nativeEvent:R,currentTarget:T}=y,C=typeof l=="function"?l():l;if(n.select("open")&&E||C===0||C===void 0){n.setOpen(!0,yt(rc,R,T));return}d.start(C,()=>{c.current||n.setOpen(!0,yt(rc,R,T))})},onBlur(y){c.current=!1,f.current=null;const g=y.relatedTarget,x=y.nativeEvent,E=fn(g)&&g.hasAttribute(kc("focus-guard"))&&g.getAttribute("data-type")==="outside";d.start(0,()=>{var k;const R=n.select("domReferenceElement"),T=ri(R?R.ownerDocument:document);!g&&T===R||Tt((k=o.current.floatingContext)==null?void 0:k.refs.floating.current,T)||Tt(R,T)||E||Op(g??T,n.context.triggerElements)||n.setOpen(!1,yt(rc,x))})}}),[o,n,d,l]);return v.useMemo(()=>a?{reference:h,trigger:h}:{},[a,h])}const rx=kc("safe-polygon"),W6=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${gO}`;function X6(e){return e?!!e.closest(W6):!1}class zw{constructor(){tt(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});tt(this,"disposeEffect",()=>this.dispose);this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.unbindMouseMove=()=>{},this.restTimeoutPending=!1,this.openChangeTimeout=new uo,this.restTimeout=new uo,this.handleCloseOptions=void 0}static create(){return new zw}}function cN(e){const t=rr(zw.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||(n.hoverInteractionState=t),mm(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}const Q6=new Set(["click","mousedown"]);function uN(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),a=n.useState("domReferenceElement"),{dataRef:l}=n.context,{enabled:c=!0,closeDelay:f=0}=t,d=cN(n),m=is(),h=Zo(),y=Ge(()=>d.interactedInside?!0:l.current.openEvent?Q6.has(l.current.openEvent.type):!1),g=Ge(()=>{var M;const k=(M=l.current.openEvent)==null?void 0:M.type;return(k==null?void 0:k.includes("mouse"))&&k!=="mousedown"}),x=Ge(k=>Op(k,n.context.triggerElements)),E=v.useCallback((k,M=!0)=>{const D=Z6(f,d.pointerType);D&&!d.handler?d.openChangeTimeout.start(D,()=>n.setOpen(!1,yt(wr,k))):M&&(d.openChangeTimeout.clear(),n.setOpen(!1,yt(wr,k)))},[f,n,d]),R=Ge(()=>{d.unbindMouseMove(),d.handler=void 0}),T=Ge(()=>{if(d.performedPointerEventsMutation){const k=Gt(o).body;k.style.pointerEvents="",k.removeAttribute(rx),d.performedPointerEventsMutation=!1}}),C=Ge(k=>{const M=gr(k);if(!X6(M)){d.interactedInside=!1;return}d.interactedInside=!0});qe(()=>{r||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,R(),T())},[r,d,R,T]),v.useEffect(()=>()=>{R()},[R]),v.useEffect(()=>T,[T]),qe(()=>{var k,M,D;if(c&&r&&(k=d.handleCloseOptions)!=null&&k.blockPointerEvents&&g()&&fn(a)&&o){d.performedPointerEventsMutation=!0;const O=Gt(o).body;O.setAttribute(rx,"");const N=a,_=o,q=(D=(M=m==null?void 0:m.nodesRef.current.find(F=>F.id===h))==null?void 0:M.context)==null?void 0:D.elements.floating;return q&&(q.style.pointerEvents=""),O.style.pointerEvents="none",N.style.pointerEvents="auto",_.style.pointerEvents="auto",()=>{O.style.pointerEvents="",N.style.pointerEvents="",_.style.pointerEvents=""}}},[c,r,a,o,d,g,m,h]),v.useEffect(()=>{if(!c)return;function k(N){y()||!l.current.floatingContext||!n.select("open")||x(N.relatedTarget)||(T(),R(),y()||E(N))}function M(N){var _;d.openChangeTimeout.clear(),T(),(_=d.handler)==null||_.call(d,N),R()}function D(N){y()||E(N,!1)}const O=o;return O&&(O.addEventListener("mouseleave",k),O.addEventListener("mouseenter",M),O.addEventListener("mouseleave",D),O.addEventListener("pointerdown",C,!0)),()=>{O&&(O.removeEventListener("mouseleave",k),O.removeEventListener("mouseenter",M),O.removeEventListener("mouseleave",D),O.removeEventListener("pointerdown",C,!0))}},[c,o,n,l,y,x,E,T,R,C,d])}function Z6(e,t){return t&&!Qs(t)?0:typeof e=="function"?e():e}function Ab(e){return typeof e=="function"?e():e}const J6={current:null};function dN(e,t={}){var F;const n="rootStore"in e?e.rootStore:e,{dataRef:r,events:o}=n.context,{enabled:a=!0,delay:l=0,handleClose:c=null,mouseOnly:f=!1,restMs:d=0,move:m=!0,triggerElementRef:h=J6,externalTree:y,isActiveTrigger:g=!0}=t,x=is(y),E=cN(n),R=lr(c),T=lr(l),C=lr(d),k=lr(a);g&&(E.handleCloseOptions=(F=R.current)==null?void 0:F.__options);const M=Ge(()=>E.interactedInside?!0:r.current.openEvent?["click","mousedown"].includes(r.current.openEvent.type):!1),D=Ge(G=>Op(G,n.context.triggerElements)),O=v.useCallback((G,P=!0)=>{const U=fp(T.current,"close",E.pointerType);U&&!E.handler?E.openChangeTimeout.start(U,()=>n.setOpen(!1,yt(wr,G))):P&&(E.openChangeTimeout.clear(),n.setOpen(!1,yt(wr,G)))},[T,n,E]),N=Ge(()=>{E.unbindMouseMove(),E.handler=void 0}),_=Ge(()=>{if(E.performedPointerEventsMutation){const G=Gt(n.select("domReferenceElement")).body;G.style.pointerEvents="",G.removeAttribute(rx),E.performedPointerEventsMutation=!1}});v.useEffect(()=>{if(!a)return;function G(P){P.open||(E.openChangeTimeout.clear(),E.restTimeout.clear(),E.blockMouseMove=!0,E.restTimeoutPending=!1)}return o.on("openchange",G),()=>{o.off("openchange",G)}},[a,o,E]);const q=Ge(G=>{var U;if(M()||!r.current.floatingContext||D(G.relatedTarget))return;const P=h.current;(U=R.current)==null||U.call(R,{...r.current.floatingContext,tree:x,x:G.clientX,y:G.clientY,onClose(){_(),N(),!M()&&P===n.select("domReferenceElement")&&O(G)}})(G)});return v.useEffect(()=>{if(!a)return;const G=h.current??(g?n.select("domReferenceElement"):null);if(!fn(G))return;function P(B){if(E.openChangeTimeout.clear(),E.blockMouseMove=!1,f&&!Qs(E.pointerType)||Ab(C.current)>0&&!fp(T.current,"open"))return;const j=fp(T.current,"open",E.pointerType),z=n.select("domReferenceElement"),V=n.context.triggerElements,K=(V.hasElement(B.target)||V.hasMatchingElement(I=>Tt(I,B.target)))&&(!z||!Tt(z,B.target)),L=B.currentTarget??null,$=n.select("open"),W=!$||K;K&&$?n.setOpen(!0,yt(wr,B,L)):j?E.openChangeTimeout.start(j,()=>{W&&n.setOpen(!0,yt(wr,B,L))}):W&&n.setOpen(!0,yt(wr,B,L))}function U(B){if(M()){_();return}E.unbindMouseMove();const j=n.select("domReferenceElement"),z=Gt(j);if(E.restTimeout.clear(),E.restTimeoutPending=!1,D(B.relatedTarget))return;if(R.current&&r.current.floatingContext){n.select("open")||E.openChangeTimeout.clear();const K=h.current;E.handler=R.current({...r.current.floatingContext,tree:x,x:B.clientX,y:B.clientY,onClose(){_(),N(),k.current&&!M()&&K===n.select("domReferenceElement")&&O(B,!0)}});const L=E.handler;L(B),z.addEventListener("mousemove",L),E.unbindMouseMove=()=>{z.removeEventListener("mousemove",L)};return}(E.pointerType==="touch"?!Tt(n.select("floatingElement"),B.relatedTarget):!0)&&O(B)}function H(B){q(B)}return n.select("open")&&G.addEventListener("mouseleave",H),m&&G.addEventListener("mousemove",P,{once:!0}),G.addEventListener("mouseenter",P),G.addEventListener("mouseleave",U),()=>{G.removeEventListener("mouseleave",H),m&&G.removeEventListener("mousemove",P),G.removeEventListener("mouseenter",P),G.removeEventListener("mouseleave",U)}},[N,_,r,T,O,n,a,R,q,E,g,M,D,f,m,C,h,x,k]),v.useMemo(()=>{if(!a)return;function G(P){E.pointerType=P.pointerType}return{onPointerDown:G,onPointerEnter:G,onMouseMove(P){const{nativeEvent:U}=P,H=P.currentTarget,B=n.select("domReferenceElement"),j=n.context.triggerElements,z=n.select("open"),V=(j.hasElement(P.target)||j.hasMatchingElement(L=>Tt(L,P.target)))&&(!B||!Tt(B,P.target));if(f&&!Qs(E.pointerType)||z&&!V||Ab(C.current)===0||!V&&E.restTimeoutPending&&P.movementX**2+P.movementY**2<2)return;E.restTimeout.clear();function K(){if(E.restTimeoutPending=!1,M())return;const L=n.select("open");!E.blockMouseMove&&(!L||V)&&n.setOpen(!0,yt(wr,U,H))}E.pointerType==="touch"?yr.flushSync(()=>{K()}):V&&z?K():(E.restTimeoutPending=!0,E.restTimeout.start(Ab(C.current),K))}}},[a,E,M,f,n,C])}function tf(e=[]){const t=e.map(d=>d==null?void 0:d.reference),n=e.map(d=>d==null?void 0:d.floating),r=e.map(d=>d==null?void 0:d.item),o=e.map(d=>d==null?void 0:d.trigger),a=v.useCallback(d=>qh(d,e,"reference"),t),l=v.useCallback(d=>qh(d,e,"floating"),n),c=v.useCallback(d=>qh(d,e,"item"),r),f=v.useCallback(d=>qh(d,e,"trigger"),o);return v.useMemo(()=>({getReferenceProps:a,getFloatingProps:l,getItemProps:c,getTriggerProps:f}),[a,l,c,f])}function qh(e,t,n){var l;const r=new Map,o=n==="item",a={};n==="floating"&&(a.tabIndex=-1,a[Kv]="");for(const c in e)o&&e&&(c===pO||c===mO)||(a[c]=e[c]);for(let c=0;c<t.length;c+=1){let f;const d=(l=t[c])==null?void 0:l[n];typeof d=="function"?f=e?d(e):null:f=d,f&&OC(a,f,o,r)}return OC(a,e,o,r),a}function OC(e,t,n,r){var o;for(const a in t){const l=t[a];n&&(a===pO||a===mO)||(a.startsWith("on")?(r.has(a)||r.set(a,[]),typeof l=="function"&&((o=r.get(a))==null||o.push(l),e[a]=(...c)=>{var f;return(f=r.get(a))==null?void 0:f.map(d=>d(...c)).find(d=>d!==void 0)})):e[a]=l)}}const e8="Escape";function Cm(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Vh(e,t){return Cm(t,e===pw||e===Xd,e===$a||e===Ga)}function Db(e,t,n){return Cm(t,e===Xd,n?e===$a:e===Ga)||e==="Enter"||e===" "||e===""}function t8(e,t,n){return Cm(t,n?e===$a:e===Ga,e===Xd)}function n8(e,t,n,r){const o=n?e===Ga:e===$a,a=e===pw;return t==="both"||t==="horizontal"&&r&&r>1?e===e8:Cm(t,o,a)}function fN(e,t){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),a=n.useState("domReferenceElement"),l=n.context.dataRef,{listRef:c,activeIndex:f,onNavigate:d=()=>{},enabled:m=!0,selectedIndex:h=null,allowEscape:y=!1,loopFocus:g=!1,nested:x=!1,rtl:E=!1,virtual:R=!1,focusItemOnOpen:T="auto",focusItemOnHover:C=!0,openOnArrowKeyDown:k=!0,disabledIndices:M=void 0,orientation:D="vertical",parentOrientation:O,cols:N=1,id:_,resetOnPointerLeave:q=!0,externalTree:F}=t,G=Od(o),P=lr(G),U=Zo(),H=is(F);qe(()=>{l.current.orientation=D},[l,D]);const B=Wv(a),j=v.useRef(T),z=v.useRef(h??-1),V=v.useRef(null),K=v.useRef(!0),L=Ge(J=>{d(z.current===-1?null:z.current,J)}),$=v.useRef(L),W=v.useRef(!!o),I=v.useRef(r),Q=v.useRef(!1),le=v.useRef(!1),oe=lr(M),Z=lr(r),ue=lr(h),ve=lr(q),Se=Ge(()=>{function J(Ve){R?H==null||H.events.emit("virtualfocus",Ve):dd(Ve,{sync:Q.current,preventScroll:!0})}const Ee=c.current[z.current],xe=le.current;Ee&&J(Ee),(Q.current?Ve=>Ve():requestAnimationFrame)(()=>{var ut;const Ve=c.current[z.current]||Ee;if(!Ve)return;Ee||J(Ve),te&&(xe||!K.current)&&((ut=Ve.scrollIntoView)==null||ut.call(Ve,{block:"nearest",inline:"nearest"}))})});qe(()=>{m&&(r&&o?(z.current=h??-1,j.current&&h!=null&&(le.current=!0,L())):W.current&&(z.current=-1,$.current()))},[m,r,o,h,L]),qe(()=>{if(m){if(!r){Q.current=!1;return}if(o)if(f==null){if(Q.current=!1,ue.current!=null)return;if(W.current&&(z.current=-1,Se()),(!I.current||!W.current)&&j.current&&(V.current!=null||j.current===!0&&V.current==null)){let J=0;const Ee=()=>{c.current[0]==null?(J<2&&(J?requestAnimationFrame:queueMicrotask)(Ee),J+=1):(z.current=V.current==null||Db(V.current,D,E)||x?cp(c):Zv(c),V.current=null,L())};Ee()}}else tc(c,f)||(z.current=f,Se(),le.current=!1)}},[m,r,o,f,ue,x,c,D,E,L,Se,oe]),qe(()=>{var Ve,_e;if(!m||o||!H||R||!W.current)return;const J=H.nodesRef.current,Ee=(_e=(Ve=J.find(ut=>ut.id===U))==null?void 0:Ve.context)==null?void 0:_e.elements.floating,xe=ri(Gt(o)),Be=J.some(ut=>ut.context&&Tt(ut.context.elements.floating,xe));Ee&&!Be&&K.current&&Ee.focus({preventScroll:!0})},[m,o,H,U,R]),qe(()=>{$.current=L,I.current=r,W.current=!!o}),qe(()=>{r||(V.current=null,j.current=T)},[r,T]);const Pe=f!=null,te=v.useMemo(()=>{function J(xe){if(!Z.current)return;const Be=c.current.indexOf(xe.currentTarget);Be!==-1&&z.current!==Be&&(z.current=Be,L(xe))}return{onFocus(xe){Q.current=!0,J(xe)},onClick:({currentTarget:xe})=>xe.focus({preventScroll:!0}),onMouseMove(xe){Q.current=!0,le.current=!1,C&&J(xe)},onPointerLeave(xe){var Ve;if(!Z.current||!K.current||xe.pointerType==="touch")return;Q.current=!0;const Be=xe.relatedTarget;!C||c.current.includes(Be)||ve.current&&(dd(null,{sync:!0}),z.current=-1,L(xe),R||(Ve=P.current)==null||Ve.focus({preventScroll:!0}))}}},[Z,P,C,c,L,ve,R]),he=v.useCallback(()=>{var J,Ee,xe;return O??((xe=(Ee=(J=H==null?void 0:H.nodesRef.current.find(Be=>Be.id===U))==null?void 0:J.context)==null?void 0:Ee.dataRef)==null?void 0:xe.current.orientation)},[U,H,O]),ye=Ge(J=>{if(K.current=!1,Q.current=!0,J.which===229||!Z.current&&J.currentTarget===P.current)return;if(x&&n8(J.key,D,E,N)){Vh(J.key,he())||mr(J),n.setOpen(!1,yt(up,J.nativeEvent)),On(a)&&(R?H==null||H.events.emit("virtualfocus",a):a.focus());return}const Ee=z.current,xe=cp(c,M),Be=Zv(c,M);if(B||(J.key==="Home"&&(mr(J),z.current=xe,L(J)),J.key==="End"&&(mr(J),z.current=Be,L(J))),N>1){const Ve=Array.from({length:c.current.length},()=>({width:1,height:1})),_e=SO(Ve,N,!1),ut=_e.findIndex(ee=>ee!=null&&!Ya(c,ee,M)),pe=_e.reduce((ee,fe,Ne)=>fe!=null&&!Ya(c,fe,M)?Ne:ee,-1),Re=_e[wO({current:_e.map(ee=>ee!=null?c.current[ee]:null)},{event:J,orientation:D,loopFocus:g,rtl:E,cols:N,disabledIndices:TO([...(typeof M!="function"?M:null)||c.current.map((ee,fe)=>Ya(c,fe,M)?fe:void 0),void 0],_e),minIndex:ut,maxIndex:pe,prevIndex:EO(z.current>Be?xe:z.current,Ve,_e,N,J.key===Xd?"bl":J.key===(E?$a:Ga)?"tr":"tl"),stopEvent:!0})];if(Re!=null&&(z.current=Re,L(J)),D==="both")return}if(Vh(J.key,D)){if(mr(J),r&&!R&&ri(J.currentTarget.ownerDocument)===J.currentTarget){z.current=Db(J.key,D,E)?xe:Be,L(J);return}Db(J.key,D,E)?g?Ee>=Be?y&&Ee!==c.current.length?z.current=-1:(Q.current=!1,z.current=xe):z.current=pr(c,{startingIndex:Ee,disabledIndices:M}):z.current=Math.min(Be,pr(c,{startingIndex:Ee,disabledIndices:M})):g?Ee<=xe?y&&Ee!==-1?z.current=c.current.length:(Q.current=!1,z.current=Be):z.current=pr(c,{startingIndex:Ee,decrement:!0,disabledIndices:M}):z.current=Math.max(xe,pr(c,{startingIndex:Ee,decrement:!0,disabledIndices:M})),tc(c,z.current)&&(z.current=-1),L(J)}}),Le=v.useMemo(()=>R&&r&&Pe&&{"aria-activedescendant":`${_}-${f}`},[R,r,Pe,_,f]),Oe=v.useMemo(()=>({"aria-orientation":D==="both"?void 0:D,...B?{}:Le,onKeyDown(J){if(J.key==="Tab"&&J.shiftKey&&r&&!R){const Ee=gr(J.nativeEvent);if(Ee&&!Tt(P.current,Ee))return;mr(J),n.setOpen(!1,yt(Js,J.nativeEvent)),On(a)&&a.focus();return}ye(J)},onPointerMove(){K.current=!0}}),[Le,ye,P,D,B,n,r,R,a]),Te=v.useMemo(()=>{function J(xe){T==="auto"&&yO(xe.nativeEvent)&&(j.current=!R)}function Ee(xe){j.current=T,T==="auto"&&bO(xe.nativeEvent)&&(j.current=!0)}return{onKeyDown(xe){const Be=n.select("open");K.current=!1;const Ve=xe.key.startsWith("Arrow"),_e=t8(xe.key,he(),E),ut=Vh(xe.key,D),pe=(x?_e:ut)||xe.key==="Enter"||xe.key.trim()==="";if(R&&Be)return ye(xe);if(!(!Be&&!k&&Ve)){if(pe){const Re=Vh(xe.key,he());V.current=x&&Re?null:xe.key}if(x){_e&&(mr(xe),Be?(z.current=cp(c,oe.current),L(xe)):n.setOpen(!0,yt(up,xe.nativeEvent,xe.currentTarget)));return}ut&&(ue.current!=null&&(z.current=ue.current),mr(xe),!Be&&k?n.setOpen(!0,yt(up,xe.nativeEvent,xe.currentTarget)):ye(xe),Be&&L(xe))}},onFocus(xe){n.select("open")&&!R&&(z.current=-1,L(xe))},onPointerDown:Ee,onPointerEnter:Ee,onMouseDown:J,onClick:J}},[ye,oe,T,c,x,L,n,k,D,he,E,ue,R]),Ce=v.useMemo(()=>({...Le,...Te}),[Le,Te]);return v.useMemo(()=>m?{reference:Ce,floating:Oe,item:te,trigger:Te}:{},[m,Ce,Oe,Te,te])}const r8=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function hN(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingId"),a=n.useState("domReferenceElement"),l=n.useState("floatingElement"),{role:c="dialog"}=t,f=ts(),d=(a==null?void 0:a.id)||f,m=v.useMemo(()=>{var C;return((C=Od(l))==null?void 0:C.id)||o},[l,o]),h=r8.get(c)??c,g=Zo()!=null,x=v.useMemo(()=>h==="tooltip"||c==="label"?Pn:{"aria-haspopup":h==="alertdialog"?"dialog":h,"aria-expanded":"false",...h==="listbox"&&{role:"combobox"},...h==="menu"&&g&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[h,g,c]),E=v.useMemo(()=>h==="tooltip"||c==="label"?{[`aria-${c==="label"?"labelledby":"describedby"}`]:r?m:void 0}:{...x,"aria-expanded":r?"true":"false","aria-controls":r?m:void 0,...h==="menu"&&{id:d}},[h,m,r,d,c,x]),R=v.useMemo(()=>{const C={id:m,...h&&{role:h}};return h==="tooltip"||c==="label"?C:{...C,...h==="menu"&&{"aria-labelledby":d}}},[h,m,d,c]),T=v.useCallback(({active:C,selected:k})=>{const M={role:"option",...C&&{id:`${m}-fui-option`}};switch(c){case"select":case"combobox":return{...M,"aria-selected":k}}return{}},[m,c]);return v.useMemo(()=>({reference:E,floating:R,item:T,trigger:x}),[E,R,x,T])}function pN(e,t){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,o=n.useState("open"),{listRef:a,activeIndex:l,onMatch:c,onTypingChange:f,enabled:d=!0,resetMs:m=750,selectedIndex:h=null}=t,y=Dn(),g=v.useRef(""),x=v.useRef(h??l??-1),E=v.useRef(null);qe(()=>{!o&&h!==null||(y.clear(),E.current=null,g.current!==""&&(g.current=""))},[o,h,y]),qe(()=>{o&&g.current===""&&(x.current=h??l??-1)},[o,h,l]);const R=Ge(D=>{D?r.current.typing||(r.current.typing=D,f==null||f(D)):r.current.typing&&(r.current.typing=D,f==null||f(D))}),T=Ge(D=>{function O(P,U,H){const B=U.find(j=>(j==null?void 0:j.toLocaleLowerCase().indexOf(H.toLocaleLowerCase()))===0);return B?P.indexOf(B):-1}const N=a.current;if(g.current.length>0&&g.current[0]!==" "&&(O(N,N,g.current)===-1?R(!1):D.key===" "&&mr(D)),N==null||D.key.length!==1||D.ctrlKey||D.metaKey||D.altKey)return;o&&D.key!==" "&&(mr(D),R(!0));const _=g.current==="";_&&(x.current=h??l??-1),N.every(P=>{var U,H;return P?((U=P[0])==null?void 0:U.toLocaleLowerCase())!==((H=P[1])==null?void 0:H.toLocaleLowerCase()):!0})&&g.current===D.key&&(g.current="",x.current=E.current),g.current+=D.key,y.start(m,()=>{g.current="",x.current=E.current,R(!1)});const F=_?h??l??-1:x.current,G=O(N,[...N.slice((F||0)+1),...N.slice(0,(F||0)+1)],g.current);G!==-1?(c==null||c(G),E.current=G):D.key!==" "&&(g.current="",R(!1))}),C=Ge(D=>{const O=D.relatedTarget,N=n.select("domReferenceElement"),_=n.select("floatingElement"),q=Tt(N,O),F=Tt(_,O);q||F||(y.clear(),g.current="",x.current=E.current,R(!1))}),k=v.useMemo(()=>({onKeyDown:T,onBlur:C}),[T,C]),M=v.useMemo(()=>({onKeyDown:T,onKeyUp(D){D.key===" "&&R(!1)},onBlur:C}),[T,C,R]);return v.useMemo(()=>d?{reference:k,floating:M}:{},[d,k,M])}function NC(e,t){const[n,r]=e;let o=!1;const a=t.length;for(let l=0,c=a-1;l<a;c=l++){const[f,d]=t[l]||[0,0],[m,h]=t[c]||[0,0];d>=r!=h>=r&&n<=(m-f)*(r-d)/(h-d)+f&&(o=!o)}return o}function i8(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function mN(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,o=new uo;let a=!1,l=null,c=null,f=typeof performance<"u"?performance.now():0;function d(h,y){const g=performance.now(),x=g-f;if(l===null||c===null||x===0)return l=h,c=y,f=g,null;const E=h-l,R=y-c,C=Math.sqrt(E*E+R*R)/x;return l=h,c=y,f=g,C}const m=({x:h,y,placement:g,elements:x,onClose:E,nodeId:R,tree:T})=>function(k){function M(){o.clear(),E()}if(o.clear(),!x.domReference||!x.floating||g==null||h==null||y==null)return;const{clientX:D,clientY:O}=k,N=[D,O],_=gr(k),q=k.type==="mouseleave",F=Tt(x.floating,_),G=Tt(x.domReference,_),P=x.domReference.getBoundingClientRect(),U=x.floating.getBoundingClientRect(),H=g.split("-")[0],B=h>U.right-U.width/2,j=y>U.bottom-U.height/2,z=i8(N,P),V=U.width>P.width,K=U.height>P.height,L=(V?P:U).left,$=(V?P:U).right,W=(K?P:U).top,I=(K?P:U).bottom;if(F&&(a=!0,!q))return;if(G&&(a=!1),G&&!q){a=!0;return}if(q&&fn(k.relatedTarget)&&Tt(x.floating,k.relatedTarget)||T&&qs(T.nodesRef.current,R).some(({context:oe})=>oe==null?void 0:oe.open))return;if(H==="top"&&y>=P.bottom-1||H==="bottom"&&y<=P.top+1||H==="left"&&h>=P.right-1||H==="right"&&h<=P.left+1)return M();let Q=[];switch(H){case"top":Q=[[L,P.top+1],[L,U.bottom-1],[$,U.bottom-1],[$,P.top+1]];break;case"bottom":Q=[[L,U.top+1],[L,P.bottom-1],[$,P.bottom-1],[$,U.top+1]];break;case"left":Q=[[U.right-1,I],[U.right-1,W],[P.left+1,W],[P.left+1,I]];break;case"right":Q=[[P.right-1,I],[P.right-1,W],[U.left+1,W],[U.left+1,I]];break}function le([oe,Z]){switch(H){case"top":{const ue=[V?oe+t/2:B?oe+t*4:oe-t*4,Z+t+1],ve=[V?oe-t/2:B?oe+t*4:oe-t*4,Z+t+1],Se=[[U.left,B||V?U.bottom-t:U.top],[U.right,B?V?U.bottom-t:U.top:U.bottom-t]];return[ue,ve,...Se]}case"bottom":{const ue=[V?oe+t/2:B?oe+t*4:oe-t*4,Z-t],ve=[V?oe-t/2:B?oe+t*4:oe-t*4,Z-t],Se=[[U.left,B||V?U.top+t:U.bottom],[U.right,B?V?U.top+t:U.bottom:U.top+t]];return[ue,ve,...Se]}case"left":{const ue=[oe+t+1,K?Z+t/2:j?Z+t*4:Z-t*4],ve=[oe+t+1,K?Z-t/2:j?Z+t*4:Z-t*4];return[...[[j||K?U.right-t:U.left,U.top],[j?K?U.right-t:U.left:U.right-t,U.bottom]],ue,ve]}case"right":{const ue=[oe-t,K?Z+t/2:j?Z+t*4:Z-t*4],ve=[oe-t,K?Z-t/2:j?Z+t*4:Z-t*4],Se=[[j||K?U.left+t:U.right,U.top],[j?K?U.left+t:U.right:U.left+t,U.bottom]];return[ue,ve,...Se]}default:return[]}}if(!NC([D,O],Q)){if(a&&!z)return M();if(!q&&r){const oe=d(k.clientX,k.clientY);if(oe!==null&&oe<.1)return M()}NC([D,O],le([h,y]))?!a&&r&&o.start(40,M):M()}};return m.__options={blockPointerEvents:n},m}let o8=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),a8=(function(e){return e[e.open=Ds.open]="open",e[e.closed=Ds.closed]="closed",e[e.startingStyle=Ds.startingStyle]="startingStyle",e[e.endingStyle=Ds.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const gN=v.createContext(void 0);function s8(){const e=v.useContext(gN);if(e===void 0)throw new Error(Rn(26));return e}const ac="ArrowUp",_s="ArrowDown",Nd="ArrowLeft",sc="ArrowRight",nf="Home",rf="End",yN=new Set([Nd,sc]),l8=new Set([Nd,sc,nf,rf]),bN=new Set([ac,_s]),c8=new Set([ac,_s,nf,rf]),vN=new Set([...yN,...bN]),u8=new Set([...vN,nf,rf]),Fw=new Set([ac,_s,Nd,sc,nf,rf]),d8="Shift",f8="Control",h8="Alt",p8="Meta",m8=new Set([d8,f8,h8,p8]);function g8(e){return On(e)&&e.tagName==="INPUT"}function AC(e){return!!(g8(e)&&e.selectionStart!=null||On(e)&&e.tagName==="TEXTAREA")}function DC(e,t,n,r){if(!e||!t||!t.scrollTo)return;let o=e.scrollLeft,a=e.scrollTop;const l=e.clientWidth<e.scrollWidth,c=e.clientHeight<e.scrollHeight;if(l&&r!=="vertical"){const f=_C(e,t,"left"),d=$h(e),m=$h(t);n==="ltr"&&(f+t.offsetWidth+m.scrollMarginRight>e.scrollLeft+e.clientWidth-d.scrollPaddingRight?o=f+t.offsetWidth+m.scrollMarginRight-e.clientWidth+d.scrollPaddingRight:f-m.scrollMarginLeft<e.scrollLeft+d.scrollPaddingLeft&&(o=f-m.scrollMarginLeft-d.scrollPaddingLeft)),n==="rtl"&&(f-m.scrollMarginRight<e.scrollLeft+d.scrollPaddingLeft?o=f-m.scrollMarginLeft-d.scrollPaddingLeft:f+t.offsetWidth+m.scrollMarginRight>e.scrollLeft+e.clientWidth-d.scrollPaddingRight&&(o=f+t.offsetWidth+m.scrollMarginRight-e.clientWidth+d.scrollPaddingRight))}if(c&&r!=="horizontal"){const f=_C(e,t,"top"),d=$h(e),m=$h(t);f-m.scrollMarginTop<e.scrollTop+d.scrollPaddingTop?a=f-m.scrollMarginTop-d.scrollPaddingTop:f+t.offsetHeight+m.scrollMarginBottom>e.scrollTop+e.clientHeight-d.scrollPaddingBottom&&(a=f+t.offsetHeight+m.scrollMarginBottom-e.clientHeight+d.scrollPaddingBottom)}e.scrollTo({left:o,top:a,behavior:"auto"})}function _C(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);)t=t.offsetParent;return o}function $h(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}const y8={...po,...Xo,nestedDialogOpen(e){return e?{[a8.nestedDialogOpen]:""}:null}},Bw=v.forwardRef(function(t,n){const{className:r,finalFocus:o,initialFocus:a,render:l,...c}=t,{store:f}=rs(),d=f.useState("descriptionElementId"),m=f.useState("disablePointerDismissal"),h=f.useState("floatingRootContext"),y=f.useState("popupProps"),g=f.useState("modal"),x=f.useState("mounted"),E=f.useState("nested"),R=f.useState("nestedOpenDialogCount"),T=f.useState("open"),C=f.useState("openMethod"),k=f.useState("titleElementId"),M=f.useState("transitionStatus"),D=f.useState("role");s8(),Qo({open:T,ref:f.context.popupRef,onComplete(){var G,P;T&&((P=(G=f.context).onOpenChangeComplete)==null||P.call(G,!0))}});function O(G){return G==="touch"?f.context.popupRef.current:!0}const N=a===void 0?O:a,_=R>0,F=At("div",t,{state:{open:T,nested:E,transitionStatus:M,nestedDialogOpen:_},props:[y,{"aria-labelledby":k??void 0,"aria-describedby":d??void 0,role:D,tabIndex:-1,hidden:!x,onKeyDown(G){Fw.has(G.key)&&G.stopPropagation()},style:{[o8.nestedDialogs]:R}},c],ref:[n,f.context.popupRef,f.useStateSetter("popupElement")],stateAttributesMapping:y8});return w.jsx(Ow,{context:h,openInteractionType:C,disabled:!x,closeOnFocusOut:!m,initialFocus:N,returnFocus:o,modal:g!==!1,restoreFocus:"popup",children:F})});function Uw(e){return sw(19)?e:e?"true":void 0}const Hw=v.forwardRef(function(t,n){const{cutout:r,...o}=t;let a;if(r){const l=r==null?void 0:r.getBoundingClientRect();a=`polygon(
|
|
97
|
+
0% 0%,
|
|
98
|
+
100% 0%,
|
|
99
|
+
100% 100%,
|
|
100
|
+
0% 100%,
|
|
101
|
+
0% 0%,
|
|
102
|
+
${l.left}px ${l.top}px,
|
|
103
|
+
${l.left}px ${l.bottom}px,
|
|
104
|
+
${l.right}px ${l.bottom}px,
|
|
105
|
+
${l.right}px ${l.top}px,
|
|
106
|
+
${l.left}px ${l.top}px
|
|
107
|
+
)`}return w.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:a}})}),qw=v.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,{store:a}=rs(),l=a.useState("mounted"),c=a.useState("modal"),f=a.useState("open");return l||r?w.jsx(gN.Provider,{value:r,children:w.jsxs(kw,{ref:n,...o,children:[l&&c===!0&&w.jsx(Hw,{ref:a.context.internalBackdropRef,inert:Uw(!f)}),t.children]})}):null});function km(e){const t=v.useRef(!0);t.current&&(t.current=!1,e())}let IC={},PC={},LC="";function b8(e){if(typeof document>"u")return!1;const t=Gt(e);return Hn(t).innerWidth-t.documentElement.clientWidth>0}function v8(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Gt(e),r=n.documentElement,o=n.body,a=es(r)?r:o,l=a.style.overflowY,c=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",a.style.overflowY="scroll";const f=a.offsetWidth;a.style.overflowY="hidden";const d=a.offsetWidth;return a.style.overflowY=l,r.style.scrollbarGutter=c,f===d}function x8(e){const t=Gt(e),n=t.documentElement,r=t.body,o=es(n)?n:r,a={overflowY:o.style.overflowY,overflowX:o.style.overflowX};return Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,a)}}function w8(e){var y;const t=Gt(e),n=t.documentElement,r=t.body,o=Hn(n);let a=0,l=0,c=!1;const f=Un.create();if(gm&&(((y=o.visualViewport)==null?void 0:y.scale)??1)!==1)return()=>{};function d(){const g=o.getComputedStyle(n),x=o.getComputedStyle(r),T=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";a=n.scrollTop,l=n.scrollLeft,IC={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},LC=n.style.scrollBehavior,PC={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const C=n.scrollHeight>n.clientHeight,k=n.scrollWidth>n.clientWidth,M=g.overflowY==="scroll"||x.overflowY==="scroll",D=g.overflowX==="scroll"||x.overflowX==="scroll",O=Math.max(0,o.innerWidth-r.clientWidth),N=Math.max(0,o.innerHeight-r.clientHeight),_=parseFloat(x.marginTop)+parseFloat(x.marginBottom),q=parseFloat(x.marginLeft)+parseFloat(x.marginRight),F=es(n)?n:r;if(c=v8(e),c){n.style.scrollbarGutter=T,F.style.overflowY="hidden",F.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:T,overflowY:"hidden",overflowX:"hidden"}),(C||M)&&(n.style.overflowY="scroll"),(k||D)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:_||N?`calc(100dvh - ${_+N}px)`:"100dvh",width:q||O?`calc(100vw - ${q+O}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=a,r.scrollLeft=l,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function m(){Object.assign(n.style,IC),Object.assign(r.style,PC),c||(n.scrollTop=a,n.scrollLeft=l,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=LC)}function h(){m(),f.request(d)}return d(),o.addEventListener("resize",h),()=>{f.cancel(),m(),typeof o.removeEventListener=="function"&&o.removeEventListener("resize",h)}}class S8{constructor(){tt(this,"lockCount",0);tt(this,"restore",null);tt(this,"timeoutLock",uo.create());tt(this,"timeoutUnlock",uo.create());tt(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});tt(this,"unlock",()=>{var t;this.lockCount===0&&this.restore&&((t=this.restore)==null||t.call(this),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const r=Gt(t).documentElement,o=Hn(r).getComputedStyle(r).overflowY;if(o==="hidden"||o==="clip"){this.restore=Ur;return}const a=dO||!b8(t);this.restore=a?x8(t):w8(t)}}const E8=new S8;function Vw(e=!0,t=null){qe(()=>{if(e)return E8.acquire(t)},[e,t])}function T8(e){const t=v.useRef(""),n=v.useCallback(o=>{o.defaultPrevented||(t.current=o.pointerType,e(o,o.pointerType))},[e]);return{onClick:v.useCallback(o=>{if(o.detail===0){e(o,"keyboard");return}"pointerType"in o?e(o,o.pointerType):e(o,t.current),t.current=""},[e]),onPointerDown:n}}function $w(e){const[t,n]=v.useState(null),r=Ge((c,f)=>{e||n(f||(dO?"touch":""))}),o=v.useCallback(()=>{n(null)},[]),{onClick:a,onPointerDown:l}=T8(r);return v.useMemo(()=>({openMethod:t,reset:o,triggerProps:{onClick:a,onPointerDown:l}}),[t,o,a,l])}function xN(e){const{store:t,parentContext:n,actionsRef:r}=e,o=t.useState("open"),a=t.useState("disablePointerDismissal"),l=t.useState("modal"),c=t.useState("popupElement"),{openMethod:f,triggerProps:d,reset:m}=$w(o);_w(t);const{forceUnmount:h}=Iw(o,t,()=>{m()}),y=Ge(F=>{const G=yt(F);return G.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},G}),g=v.useCallback(()=>{t.setOpen(!1,y(ww))},[t,y]);v.useImperativeHandle(r,()=>({unmount:h,close:g}),[h,g]);const x=jw({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[E,R]=v.useState(0),T=E===0,C=hN(x),k=Tm(x,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:l==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(F){if(!t.context.outsidePressEnabledRef.current||"button"in F&&F.button!==0||"touches"in F&&F.touches.length!==1)return!1;const G=gr(F);if(T&&!a){const P=G;return l&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===P||t.context.backdropRef.current===P||Tt(P,c)&&!(P!=null&&P.hasAttribute("data-base-ui-portal")):!0}return!1},escapeKey:T});Vw(o&&l===!0,c);const{getReferenceProps:M,getFloatingProps:D,getTriggerProps:O}=tf([C,k]);t.useContextCallback("onNestedDialogOpen",F=>{R(F+1)}),t.useContextCallback("onNestedDialogClose",()=>{R(0)}),v.useEffect(()=>(n!=null&&n.onNestedDialogOpen&&o&&n.onNestedDialogOpen(E),n!=null&&n.onNestedDialogClose&&!o&&n.onNestedDialogClose(),()=>{n!=null&&n.onNestedDialogClose&&o&&n.onNestedDialogClose()}),[o,n,E]);const N=v.useMemo(()=>M(d),[M,d]),_=v.useMemo(()=>O(d),[O,d]),q=v.useMemo(()=>D(),[D]);t.useSyncedValues({openMethod:f,activeTriggerProps:N,inactiveTriggerProps:_,popupProps:q,floatingRootContext:x,nestedOpenDialogCount:E})}const R8={...Lw,modal:We(e=>e.modal),nested:We(e=>e.nested),nestedOpenDialogCount:We(e=>e.nestedOpenDialogCount),disablePointerDismissal:We(e=>e.disablePointerDismissal),openMethod:We(e=>e.openMethod),descriptionElementId:We(e=>e.descriptionElementId),titleElementId:We(e=>e.titleElementId),viewportElement:We(e=>e.viewportElement),role:We(e=>e.role)};class wN extends Rm{constructor(n){super(C8(n),{popupRef:v.createRef(),backdropRef:v.createRef(),internalBackdropRef:v.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new ef,onOpenChange:void 0,onOpenChangeComplete:void 0},R8);tt(this,"setOpen",(n,r)=>{var c,f,d,m;if(r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&r.trigger==null&&this.state.activeTriggerId!=null&&(r.trigger=this.state.activeTriggerElement??void 0),(f=(c=this.context).onOpenChange)==null||f.call(c,n,r),r.isCanceled)return;const o={open:n,nativeEvent:r.event,reason:r.reason,nested:this.state.nested};(d=this.state.floatingRootContext.context.events)==null||d.emit("openchange",o);const a={open:n},l=((m=r.trigger)==null?void 0:m.id)??null;(l||n)&&(a.activeTriggerId=l,a.activeTriggerElement=r.trigger??null),this.update(a)})}}function C8(e={}){return{...Pw(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function SN(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:o,onOpenChangeComplete:a,disablePointerDismissal:l=!1,modal:c=!0,actionsRef:f,handle:d,triggerId:m,defaultTriggerId:h=null}=e,y=rs(!0),g=!!y,x=rr(()=>(d==null?void 0:d.store)??new wN({open:r,openProp:n,activeTriggerId:h,triggerIdProp:m,modal:c,disablePointerDismissal:l,nested:g})).current;km(()=>{n===void 0&&x.state.open===!1&&r===!0&&x.update({open:!0,activeTriggerId:h})}),x.useControlledProp("openProp",n),x.useControlledProp("triggerIdProp",m),x.useSyncedValues({disablePointerDismissal:l,nested:g,modal:c}),x.useContextCallback("onOpenChange",o),x.useContextCallback("onOpenChangeComplete",a);const E=x.useState("payload");xN({store:x,actionsRef:f,parentContext:y==null?void 0:y.store.context});const R=v.useMemo(()=>({store:x}),[x]);return w.jsx(Ew.Provider,{value:R,children:typeof t=="function"?t({payload:E}):t})}const Gw=v.forwardRef(function(t,n){const{render:r,className:o,id:a,...l}=t,{store:c}=rs(),f=Yi(a);return c.useSyncedValueWithCleanup("titleElementId",f),At("h2",t,{ref:n,props:[{id:f},l]})});/**
|
|
108
|
+
* @license lucide-react v0.564.0 - ISC
|
|
109
|
+
*
|
|
110
|
+
* This source code is licensed under the ISC license.
|
|
111
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
112
|
+
*/const EN=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
113
|
+
* @license lucide-react v0.564.0 - ISC
|
|
114
|
+
*
|
|
115
|
+
* This source code is licensed under the ISC license.
|
|
116
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
+
*/const k8=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
118
|
+
* @license lucide-react v0.564.0 - ISC
|
|
119
|
+
*
|
|
120
|
+
* This source code is licensed under the ISC license.
|
|
121
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
+
*/const M8=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
|
|
123
|
+
* @license lucide-react v0.564.0 - ISC
|
|
124
|
+
*
|
|
125
|
+
* This source code is licensed under the ISC license.
|
|
126
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
+
*/const jC=e=>{const t=M8(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
128
|
+
* @license lucide-react v0.564.0 - ISC
|
|
129
|
+
*
|
|
130
|
+
* This source code is licensed under the ISC license.
|
|
131
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
132
|
+
*/var O8={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"};/**
|
|
133
|
+
* @license lucide-react v0.564.0 - ISC
|
|
134
|
+
*
|
|
135
|
+
* This source code is licensed under the ISC license.
|
|
136
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
+
*/const N8=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
|
|
138
|
+
* @license lucide-react v0.564.0 - ISC
|
|
139
|
+
*
|
|
140
|
+
* This source code is licensed under the ISC license.
|
|
141
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
+
*/const A8=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:a,iconNode:l,...c},f)=>v.createElement("svg",{ref:f,...O8,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:EN("lucide",o),...!a&&!N8(c)&&{"aria-hidden":"true"},...c},[...l.map(([d,m])=>v.createElement(d,m)),...Array.isArray(a)?a:[a]]));/**
|
|
143
|
+
* @license lucide-react v0.564.0 - ISC
|
|
144
|
+
*
|
|
145
|
+
* This source code is licensed under the ISC license.
|
|
146
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
+
*/const ht=(e,t)=>{const n=v.forwardRef(({className:r,...o},a)=>v.createElement(A8,{ref:a,iconNode:t,className:EN(`lucide-${k8(jC(e))}`,`lucide-${e}`,r),...o}));return n.displayName=jC(e),n};/**
|
|
148
|
+
* @license lucide-react v0.564.0 - ISC
|
|
149
|
+
*
|
|
150
|
+
* This source code is licensed under the ISC license.
|
|
151
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
+
*/const D8=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],_8=ht("activity",D8);/**
|
|
153
|
+
* @license lucide-react v0.564.0 - ISC
|
|
154
|
+
*
|
|
155
|
+
* This source code is licensed under the ISC license.
|
|
156
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
+
*/const I8=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],P8=ht("arrow-down",I8);/**
|
|
158
|
+
* @license lucide-react v0.564.0 - ISC
|
|
159
|
+
*
|
|
160
|
+
* This source code is licensed under the ISC license.
|
|
161
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
+
*/const L8=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],j8=ht("arrow-left",L8);/**
|
|
163
|
+
* @license lucide-react v0.564.0 - ISC
|
|
164
|
+
*
|
|
165
|
+
* This source code is licensed under the ISC license.
|
|
166
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
+
*/const z8=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],F8=ht("bell",z8);/**
|
|
168
|
+
* @license lucide-react v0.564.0 - ISC
|
|
169
|
+
*
|
|
170
|
+
* This source code is licensed under the ISC license.
|
|
171
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
+
*/const B8=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Mm=ht("bot",B8);/**
|
|
173
|
+
* @license lucide-react v0.564.0 - ISC
|
|
174
|
+
*
|
|
175
|
+
* This source code is licensed under the ISC license.
|
|
176
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
+
*/const U8=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],H8=ht("brain",U8);/**
|
|
178
|
+
* @license lucide-react v0.564.0 - ISC
|
|
179
|
+
*
|
|
180
|
+
* This source code is licensed under the ISC license.
|
|
181
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
182
|
+
*/const q8=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Up=ht("check",q8);/**
|
|
183
|
+
* @license lucide-react v0.564.0 - ISC
|
|
184
|
+
*
|
|
185
|
+
* This source code is licensed under the ISC license.
|
|
186
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
187
|
+
*/const V8=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],TN=ht("chevron-down",V8);/**
|
|
188
|
+
* @license lucide-react v0.564.0 - ISC
|
|
189
|
+
*
|
|
190
|
+
* This source code is licensed under the ISC license.
|
|
191
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
192
|
+
*/const $8=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],of=ht("chevron-right",$8);/**
|
|
193
|
+
* @license lucide-react v0.564.0 - ISC
|
|
194
|
+
*
|
|
195
|
+
* This source code is licensed under the ISC license.
|
|
196
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
197
|
+
*/const G8=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Y8=ht("chevron-up",G8);/**
|
|
198
|
+
* @license lucide-react v0.564.0 - ISC
|
|
199
|
+
*
|
|
200
|
+
* This source code is licensed under the ISC license.
|
|
201
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
202
|
+
*/const K8=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],W8=ht("chevrons-up-down",K8);/**
|
|
203
|
+
* @license lucide-react v0.564.0 - ISC
|
|
204
|
+
*
|
|
205
|
+
* This source code is licensed under the ISC license.
|
|
206
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
207
|
+
*/const X8=[["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"}]],fd=ht("circle-alert",X8);/**
|
|
208
|
+
* @license lucide-react v0.564.0 - ISC
|
|
209
|
+
*
|
|
210
|
+
* This source code is licensed under the ISC license.
|
|
211
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
212
|
+
*/const Q8=[["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"}]],Z8=ht("copy",Q8);/**
|
|
213
|
+
* @license lucide-react v0.564.0 - ISC
|
|
214
|
+
*
|
|
215
|
+
* This source code is licensed under the ISC license.
|
|
216
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
217
|
+
*/const J8=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],e9=ht("download",J8);/**
|
|
218
|
+
* @license lucide-react v0.564.0 - ISC
|
|
219
|
+
*
|
|
220
|
+
* This source code is licensed under the ISC license.
|
|
221
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
222
|
+
*/const t9=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],RN=ht("ellipsis-vertical",t9);/**
|
|
223
|
+
* @license lucide-react v0.564.0 - ISC
|
|
224
|
+
*
|
|
225
|
+
* This source code is licensed under the ISC license.
|
|
226
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
227
|
+
*/const n9=[["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"}]],r9=ht("ellipsis",n9);/**
|
|
228
|
+
* @license lucide-react v0.564.0 - ISC
|
|
229
|
+
*
|
|
230
|
+
* This source code is licensed under the ISC license.
|
|
231
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
232
|
+
*/const i9=[["path",{d:"M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5",key:"4pqfef"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 12v-1",key:"1ej8lb"}],["path",{d:"M8 18v-2",key:"qcmpov"}],["path",{d:"M8 7V6",key:"1nbb54"}],["circle",{cx:"8",cy:"20",r:"2",key:"ckkr5m"}]],o9=ht("file-archive",i9);/**
|
|
233
|
+
* @license lucide-react v0.564.0 - ISC
|
|
234
|
+
*
|
|
235
|
+
* This source code is licensed under the ISC license.
|
|
236
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
237
|
+
*/const a9=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],s9=ht("file-braces",a9);/**
|
|
238
|
+
* @license lucide-react v0.564.0 - ISC
|
|
239
|
+
*
|
|
240
|
+
* This source code is licensed under the ISC license.
|
|
241
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
242
|
+
*/const l9=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],c9=ht("file-code",l9);/**
|
|
243
|
+
* @license lucide-react v0.564.0 - ISC
|
|
244
|
+
*
|
|
245
|
+
* This source code is licensed under the ISC license.
|
|
246
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
247
|
+
*/const u9=[["path",{d:"M4 6.835V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-.343",key:"1vfytu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M2 19a2 2 0 0 1 4 0v1a2 2 0 0 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 0 1-4 0v-1a2 2 0 0 1 4 0",key:"1etmh7"}]],d9=ht("file-headphone",u9);/**
|
|
248
|
+
* @license lucide-react v0.564.0 - ISC
|
|
249
|
+
*
|
|
250
|
+
* This source code is licensed under the ISC license.
|
|
251
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
252
|
+
*/const f9=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]],h9=ht("file-image",f9);/**
|
|
253
|
+
* @license lucide-react v0.564.0 - ISC
|
|
254
|
+
*
|
|
255
|
+
* This source code is licensed under the ISC license.
|
|
256
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
257
|
+
*/const p9=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z",key:"1tzo1f"}]],m9=ht("file-play",p9);/**
|
|
258
|
+
* @license lucide-react v0.564.0 - ISC
|
|
259
|
+
*
|
|
260
|
+
* This source code is licensed under the ISC license.
|
|
261
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
262
|
+
*/const g9=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],_b=ht("file-text",g9);/**
|
|
263
|
+
* @license lucide-react v0.564.0 - ISC
|
|
264
|
+
*
|
|
265
|
+
* This source code is licensed under the ISC license.
|
|
266
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
267
|
+
*/const y9=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],b9=ht("file",y9);/**
|
|
268
|
+
* @license lucide-react v0.564.0 - ISC
|
|
269
|
+
*
|
|
270
|
+
* This source code is licensed under the ISC license.
|
|
271
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
272
|
+
*/const v9=[["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"}],["path",{d:"M2 10h20",key:"1ir3d8"}]],x9=ht("folder-closed",v9);/**
|
|
273
|
+
* @license lucide-react v0.564.0 - ISC
|
|
274
|
+
*
|
|
275
|
+
* This source code is licensed under the ISC license.
|
|
276
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
277
|
+
*/const w9=[["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"}]],CN=ht("folder-open",w9);/**
|
|
278
|
+
* @license lucide-react v0.564.0 - ISC
|
|
279
|
+
*
|
|
280
|
+
* This source code is licensed under the ISC license.
|
|
281
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
282
|
+
*/const S9=[["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"}]],E9=ht("folder",S9);/**
|
|
283
|
+
* @license lucide-react v0.564.0 - ISC
|
|
284
|
+
*
|
|
285
|
+
* This source code is licensed under the ISC license.
|
|
286
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
287
|
+
*/const T9=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Om=ht("globe",T9);/**
|
|
288
|
+
* @license lucide-react v0.564.0 - ISC
|
|
289
|
+
*
|
|
290
|
+
* This source code is licensed under the ISC license.
|
|
291
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
292
|
+
*/const R9=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Yw=ht("grip-vertical",R9);/**
|
|
293
|
+
* @license lucide-react v0.564.0 - ISC
|
|
294
|
+
*
|
|
295
|
+
* This source code is licensed under the ISC license.
|
|
296
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
297
|
+
*/const C9=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],k9=ht("history",C9);/**
|
|
298
|
+
* @license lucide-react v0.564.0 - ISC
|
|
299
|
+
*
|
|
300
|
+
* This source code is licensed under the ISC license.
|
|
301
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
302
|
+
*/const M9=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],O9=ht("keyboard",M9);/**
|
|
303
|
+
* @license lucide-react v0.564.0 - ISC
|
|
304
|
+
*
|
|
305
|
+
* This source code is licensed under the ISC license.
|
|
306
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
307
|
+
*/const N9=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],A9=ht("link",N9);/**
|
|
308
|
+
* @license lucide-react v0.564.0 - ISC
|
|
309
|
+
*
|
|
310
|
+
* This source code is licensed under the ISC license.
|
|
311
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
312
|
+
*/const D9=[["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"M3 10a2 2 0 0 0 2 2h3",key:"1npucw"}],["path",{d:"M3 5v12a2 2 0 0 0 2 2h3",key:"x1gjn2"}]],_9=ht("list-tree",D9);/**
|
|
313
|
+
* @license lucide-react v0.564.0 - ISC
|
|
314
|
+
*
|
|
315
|
+
* This source code is licensed under the ISC license.
|
|
316
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
317
|
+
*/const I9=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],tl=ht("loader-circle",I9);/**
|
|
318
|
+
* @license lucide-react v0.564.0 - ISC
|
|
319
|
+
*
|
|
320
|
+
* This source code is licensed under the ISC license.
|
|
321
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
322
|
+
*/const P9=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],L9=ht("menu",P9);/**
|
|
323
|
+
* @license lucide-react v0.564.0 - ISC
|
|
324
|
+
*
|
|
325
|
+
* This source code is licensed under the ISC license.
|
|
326
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
327
|
+
*/const j9=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],af=ht("monitor",j9);/**
|
|
328
|
+
* @license lucide-react v0.564.0 - ISC
|
|
329
|
+
*
|
|
330
|
+
* This source code is licensed under the ISC license.
|
|
331
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
332
|
+
*/const z9=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],F9=ht("moon",z9);/**
|
|
333
|
+
* @license lucide-react v0.564.0 - ISC
|
|
334
|
+
*
|
|
335
|
+
* This source code is licensed under the ISC license.
|
|
336
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
337
|
+
*/const B9=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],U9=ht("panel-left",B9);/**
|
|
338
|
+
* @license lucide-react v0.564.0 - ISC
|
|
339
|
+
*
|
|
340
|
+
* This source code is licensed under the ISC license.
|
|
341
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
342
|
+
*/const H9=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],q9=ht("panels-top-left",H9);/**
|
|
343
|
+
* @license lucide-react v0.564.0 - ISC
|
|
344
|
+
*
|
|
345
|
+
* This source code is licensed under the ISC license.
|
|
346
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
347
|
+
*/const V9=[["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"}]],Nm=ht("pencil",V9);/**
|
|
348
|
+
* @license lucide-react v0.564.0 - ISC
|
|
349
|
+
*
|
|
350
|
+
* This source code is licensed under the ISC license.
|
|
351
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
352
|
+
*/const $9=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Am=ht("plus",$9);/**
|
|
353
|
+
* @license lucide-react v0.564.0 - ISC
|
|
354
|
+
*
|
|
355
|
+
* This source code is licensed under the ISC license.
|
|
356
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
357
|
+
*/const G9=[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Y9=ht("power-off",G9);/**
|
|
358
|
+
* @license lucide-react v0.564.0 - ISC
|
|
359
|
+
*
|
|
360
|
+
* This source code is licensed under the ISC license.
|
|
361
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
362
|
+
*/const K9=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],W9=ht("power",K9);/**
|
|
363
|
+
* @license lucide-react v0.564.0 - ISC
|
|
364
|
+
*
|
|
365
|
+
* This source code is licensed under the ISC license.
|
|
366
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
367
|
+
*/const X9=[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]],Q9=ht("radar",X9);/**
|
|
368
|
+
* @license lucide-react v0.564.0 - ISC
|
|
369
|
+
*
|
|
370
|
+
* This source code is licensed under the ISC license.
|
|
371
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
372
|
+
*/const Z9=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],J9=ht("refresh-ccw",Z9);/**
|
|
373
|
+
* @license lucide-react v0.564.0 - ISC
|
|
374
|
+
*
|
|
375
|
+
* This source code is licensed under the ISC license.
|
|
376
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
377
|
+
*/const eq=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],kN=ht("rotate-cw",eq);/**
|
|
378
|
+
* @license lucide-react v0.564.0 - ISC
|
|
379
|
+
*
|
|
380
|
+
* This source code is licensed under the ISC license.
|
|
381
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
382
|
+
*/const tq=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],nq=ht("search",tq);/**
|
|
383
|
+
* @license lucide-react v0.564.0 - ISC
|
|
384
|
+
*
|
|
385
|
+
* This source code is licensed under the ISC license.
|
|
386
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
387
|
+
*/const rq=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],zC=ht("send",rq);/**
|
|
388
|
+
* @license lucide-react v0.564.0 - ISC
|
|
389
|
+
*
|
|
390
|
+
* This source code is licensed under the ISC license.
|
|
391
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
392
|
+
*/const iq=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],oq=ht("settings",iq);/**
|
|
393
|
+
* @license lucide-react v0.564.0 - ISC
|
|
394
|
+
*
|
|
395
|
+
* This source code is licensed under the ISC license.
|
|
396
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
397
|
+
*/const aq=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],MN=ht("sparkles",aq);/**
|
|
398
|
+
* @license lucide-react v0.564.0 - ISC
|
|
399
|
+
*
|
|
400
|
+
* This source code is licensed under the ISC license.
|
|
401
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
402
|
+
*/const sq=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],lq=ht("square",sq);/**
|
|
403
|
+
* @license lucide-react v0.564.0 - ISC
|
|
404
|
+
*
|
|
405
|
+
* This source code is licensed under the ISC license.
|
|
406
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
407
|
+
*/const cq=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],uq=ht("sun",cq);/**
|
|
408
|
+
* @license lucide-react v0.564.0 - ISC
|
|
409
|
+
*
|
|
410
|
+
* This source code is licensed under the ISC license.
|
|
411
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
412
|
+
*/const dq=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],fq=ht("terminal",dq);/**
|
|
413
|
+
* @license lucide-react v0.564.0 - ISC
|
|
414
|
+
*
|
|
415
|
+
* This source code is licensed under the ISC license.
|
|
416
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
417
|
+
*/const hq=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],ON=ht("trash-2",hq);/**
|
|
418
|
+
* @license lucide-react v0.564.0 - ISC
|
|
419
|
+
*
|
|
420
|
+
* This source code is licensed under the ISC license.
|
|
421
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
422
|
+
*/const pq=[["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"}]],mq=ht("triangle-alert",pq);/**
|
|
423
|
+
* @license lucide-react v0.564.0 - ISC
|
|
424
|
+
*
|
|
425
|
+
* This source code is licensed under the ISC license.
|
|
426
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
427
|
+
*/const gq=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],yq=ht("upload",gq);/**
|
|
428
|
+
* @license lucide-react v0.564.0 - ISC
|
|
429
|
+
*
|
|
430
|
+
* This source code is licensed under the ISC license.
|
|
431
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
432
|
+
*/const bq=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],vq=ht("wrench",bq);/**
|
|
433
|
+
* @license lucide-react v0.564.0 - ISC
|
|
434
|
+
*
|
|
435
|
+
* This source code is licensed under the ISC license.
|
|
436
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
437
|
+
*/const xq=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ko=ht("x",xq);/**
|
|
438
|
+
* @license lucide-react v0.564.0 - ISC
|
|
439
|
+
*
|
|
440
|
+
* This source code is licensed under the ISC license.
|
|
441
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
442
|
+
*/const wq=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],NN=ht("zap",wq);function Sq({...e}){return w.jsx(SN,{"data-slot":"sheet",...e})}function Eq({...e}){return w.jsx(qw,{"data-slot":"sheet-portal",...e})}function Tq({className:e,...t}){return w.jsx(Tw,{"data-slot":"sheet-overlay",className:De("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50",e),...t})}const Rq="data-[side=right]:data-closed:slide-out-to-right-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=top]:data-closed:slide-out-to-top-10 data-[side=top]:data-open:slide-in-from-top-10 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=bottom]:data-open:slide-in-from-bottom-10";function Cq({className:e,children:t,side:n="right",showCloseButton:r=!0,animation:o="slide",...a}){return w.jsxs(Eq,{children:[w.jsx(Tq,{}),w.jsxs(Bw,{"data-slot":"sheet-content","data-side":n,className:De("bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 fixed z-50 flex flex-col gap-4 bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",o==="slide"&&Rq,o==="bottom-up"&&"data-open:slide-in-from-bottom-16 data-closed:slide-out-to-bottom-16",o==="top-down"&&"data-open:slide-in-from-top-16 data-closed:slide-out-to-top-16",e),...a,children:[t,r&&w.jsxs(wm,{"data-slot":"sheet-close",render:w.jsx(Ht,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[w.jsx(Ko,{}),w.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function kq({className:e,...t}){return w.jsx("div",{"data-slot":"sheet-header",className:De("gap-0.5 p-4 flex flex-col",e),...t})}function Mq({className:e,...t}){return w.jsx(Gw,{"data-slot":"sheet-title",className:De("text-foreground text-base font-medium",e),...t})}function Oq({className:e,...t}){return w.jsx(Rw,{"data-slot":"sheet-description",className:De("text-muted-foreground text-sm",e),...t})}const AN=v.createContext(void 0);function sf(e){const t=v.useContext(AN);if(t===void 0&&!e)throw new Error(Rn(72));return t}const Nq={...Lw,disabled:We(e=>e.disabled),instantType:We(e=>e.instantType),isInstantPhase:We(e=>e.isInstantPhase),trackCursorAxis:We(e=>e.trackCursorAxis),disableHoverablePopup:We(e=>e.disableHoverablePopup),lastOpenChangeReason:We(e=>e.openChangeReason),closeDelay:We(e=>e.closeDelay),hasViewport:We(e=>e.hasViewport)};class Kw extends Rm{constructor(n){super({...Aq(),...n},{popupRef:v.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new ef},Nq);tt(this,"setOpen",(n,r)=>{var d,m;const o=r.reason,a=o===wr,l=n&&o===rc,c=!n&&(o===Wa||o===xm);if(r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},(m=(d=this.context).onOpenChange)==null||m.call(d,n,r),r.isCanceled)return;const f=()=>{var g;const h={open:n,openChangeReason:o};l?h.instantType="focus":c?h.instantType="dismiss":o===wr&&(h.instantType=void 0);const y=((g=r.trigger)==null?void 0:g.id)??null;(y||n)&&(h.activeTriggerId=y,h.activeTriggerElement=r.trigger??null),this.update(h)};a?yr.flushSync(f):f()})}static useStore(n,r){const o=rr(()=>new Kw(r)).current,a=n??o,l=jw({popupStore:a,onOpenChange:a.setOpen});return a.state.floatingRootContext=l,a}}function Aq(){return{...Pw(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeDelay:0,hasViewport:!1}}const Dq=Aw(function(t){const{disabled:n=!1,defaultOpen:r=!1,open:o,disableHoverablePopup:a=!1,trackCursorAxis:l="none",actionsRef:c,onOpenChange:f,onOpenChangeComplete:d,handle:m,triggerId:h,defaultTriggerId:y=null,children:g}=t,x=Kw.useStore(m==null?void 0:m.store,{open:r,openProp:o,activeTriggerId:y,triggerIdProp:h});km(()=>{o===void 0&&x.state.open===!1&&r===!0&&x.update({open:!0,activeTriggerId:y})}),x.useControlledProp("openProp",o),x.useControlledProp("triggerIdProp",h),x.useContextCallback("onOpenChange",f),x.useContextCallback("onOpenChangeComplete",d);const E=x.useState("open"),R=!n&&E,T=x.useState("activeTriggerId"),C=x.useState("payload");x.useSyncedValues({trackCursorAxis:l,disableHoverablePopup:a}),qe(()=>{E&&n&&x.setOpen(!1,yt(iH))},[E,n,x]),x.useSyncedValue("disabled",n),_w(x);const{forceUnmount:k,transitionStatus:M}=Iw(R,x),D=x.useState("isInstantPhase"),O=x.useState("instantType"),N=x.useState("lastOpenChangeReason"),_=v.useRef(null);qe(()=>{M==="ending"&&N===qi||M!=="ending"&&D?(O!=="delay"&&(_.current=O),x.set("instantType","delay")):_.current!==null&&(x.set("instantType",_.current),_.current=null)},[M,D,N,O,x]),qe(()=>{R&&T==null&&x.set("payload",void 0)},[x,T,R]);const q=v.useCallback(()=>{x.setOpen(!1,_q(x,ww))},[x]);v.useImperativeHandle(c,()=>({unmount:k,close:q}),[k,q]);const F=x.useState("floatingRootContext"),G=Tm(F,{enabled:!n,referencePress:!0}),P=OH(F,{enabled:!n&&l!=="none",axis:l==="none"?void 0:l}),{getReferenceProps:U,getFloatingProps:H,getTriggerProps:B}=tf([G,P]),j=v.useMemo(()=>U(),[U]),z=v.useMemo(()=>B(),[B]),V=v.useMemo(()=>H(),[H]);return x.useSyncedValues({activeTriggerProps:j,inactiveTriggerProps:z,popupProps:V}),w.jsx(AN.Provider,{value:x,children:typeof g=="function"?g({payload:C}):g})});function _q(e,t){const n=yt(t);return n.preventUnmountOnClose=()=>{e.set("preventUnmountingOnClose",!0)},n}const Iq=v.createContext(void 0);function Pq(){return v.useContext(Iq)}let Lq=(function(e){return e[e.popupOpen=jp.popupOpen]="popupOpen",e.triggerDisabled="data-trigger-disabled",e})({});const jq=600,zq=iN(function(t,n){const{className:r,render:o,handle:a,payload:l,disabled:c,delay:f,closeDelay:d,id:m,...h}=t,y=sf(!0),g=(a==null?void 0:a.store)??y;if(!g)throw new Error(Rn(82));const x=Yi(m),E=g.useState("isTriggerActive",x),R=g.useState("isOpenedByTrigger",x),T=g.useState("floatingRootContext"),C=v.useRef(null),k=f??jq,M=d??0,{registerTrigger:D,isMountedByThisTrigger:O}=aN(x,C,g,{payload:l,closeDelay:M}),N=Pq(),{delayRef:_,isInstantPhase:q,hasProvider:F}=vH(T,{open:R});g.useSyncedValue("isInstantPhase",q);const G=g.useState("disabled"),P=c??G,U=g.useState("trackCursorAxis"),H=g.useState("disableHoverablePopup"),B=dN(T,{enabled:!P,mouseOnly:!0,move:!1,handleClose:!H&&U!=="both"?mN():null,restMs(){const L=N==null?void 0:N.delay,$=typeof _.current=="object"?_.current.open:void 0;let W=k;return F&&($!==0?W=f??L??k:W=0),W},delay(){const L=typeof _.current=="object"?_.current.close:void 0;let $=M;return d==null&&F&&($=L),{close:$}},triggerElementRef:C,isActiveTrigger:E}),j=lN(T,{enabled:!P}).reference,z={open:R},V=g.useState("triggerProps",O);return At("button",t,{state:z,ref:[n,D,C],props:[B,j,V,{id:x,[Lq.triggerDisabled]:P?"":void 0},h],stateAttributesMapping:LO})}),DN=v.createContext(void 0);function Fq(){const e=v.useContext(DN);if(e===void 0)throw new Error(Rn(70));return e}const Bq=v.forwardRef(function(t,n){const{children:r,container:o,className:a,render:l,...c}=t,{portalNode:f,portalSubtree:d}=GO({container:o,ref:n,componentProps:t,elementProps:c});return!d&&!f?null:w.jsxs(v.Fragment,{children:[d,f&&yr.createPortal(r,f)]})}),Uq=v.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t;return sf().useState("mounted")||r?w.jsx(DN.Provider,{value:r,children:w.jsx(Bq,{ref:n,...o})}):null}),_N=v.createContext(void 0);function IN(){const e=v.useContext(_N);if(e===void 0)throw new Error(Rn(71));return e}const Hq=v.createContext(void 0);function Fc(){const e=v.useContext(Hq);return(e==null?void 0:e.direction)??"ltr"}const qq=e=>({name:"arrow",options:e,async fn(t){var K,L;const{x:n,y:r,placement:o,rects:a,platform:l,elements:c,middlewareData:f}=t,{element:d,padding:m=0,offsetParent:h="real"}=Yo(e,t)||{};if(d==null)return{};const y=xO(m),g={x:n,y:r},x=yw(o),E=gw(x),R=await l.getDimensions(d),T=x==="y",C=T?"top":"left",k=T?"bottom":"right",M=T?"clientHeight":"clientWidth",D=a.reference[E]+a.reference[x]-g[x]-a.floating[E],O=g[x]-a.reference[x],N=h==="real"?await((K=l.getOffsetParent)==null?void 0:K.call(l,d)):c.floating;let _=c.floating[M]||a.floating[E];(!_||!await((L=l.isElement)==null?void 0:L.call(l,N)))&&(_=c.floating[M]||a.floating[E]);const q=D/2-O/2,F=_/2-R[E]/2-1,G=Math.min(y[C],F),P=Math.min(y[k],F),U=G,H=_-R[E]-P,B=_/2-R[E]/2+q,j=Xv(U,B,H),z=!f.arrow&&ns(o)!=null&&B!==j&&a.reference[E]/2-(B<U?G:P)-R[E]/2<0,V=z?B<U?B-U:B-H:0;return{[x]:g[x]+V,data:{[x]:j,centerOffset:B-j-V,...z&&{alignmentOffset:V}},reset:z}}}),Vq=(e,t)=>({...qq(e),options:[e,t]}),$q={name:"hide",async fn(e){var c;const{width:t,height:n,x:r,y:o}=e.rects.reference,a=t===0&&n===0&&r===0&&o===0;return{data:{referenceHidden:((c=(await g6().fn(e)).data)==null?void 0:c.referenceHidden)||a}}}},pp={sideX:"left",sideY:"top"},Gq={name:"adaptiveOrigin",async fn(e){var C,k;const{x:t,y:n,rects:{floating:r},elements:{floating:o},platform:a,strategy:l,placement:c}=e,f=Hn(o),d=f.getComputedStyle(o);if(!(d.transitionDuration!=="0s"&&d.transitionDuration!==""))return{x:t,y:n,data:pp};const h=await((C=a.getOffsetParent)==null?void 0:C.call(a,o));let y={width:0,height:0};if(l==="fixed"&&(f!=null&&f.visualViewport))y={width:f.visualViewport.width,height:f.visualViewport.height};else if(h===f){const M=Gt(o);y={width:M.documentElement.clientWidth,height:M.documentElement.clientHeight}}else await((k=a.isElement)==null?void 0:k.call(a,h))&&(y=await a.getDimensions(h));const g=Hr(c);let x=t,E=n;g==="left"&&(x=y.width-(t+r.width)),g==="top"&&(E=y.height-(n+r.height));const R=g==="left"?"right":pp.sideX,T=g==="top"?"bottom":pp.sideY;return{x,y:E,data:{sideX:R,sideY:T}}}};function PN(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function FC(e,t,n){const{rects:r,placement:o}=e;return{side:PN(t,Hr(o),n),align:ns(o)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Ww(e){var Ct,zt;const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:o=0,align:a="center",alignOffset:l=0,collisionBoundary:c,collisionPadding:f=5,sticky:d=!1,arrowPadding:m=5,disableAnchorTracking:h=!1,keepMounted:y=!1,floatingRootContext:g,mounted:x,collisionAvoidance:E,shiftCrossAxis:R=!1,nodeId:T,adaptiveOrigin:C,lazyFlip:k=!1,externalTree:M}=e,[D,O]=v.useState(null);!x&&D!==null&&O(null);const N=E.side||"flip",_=E.align||"flip",q=E.fallbackAxisSide||"end",F=typeof t=="function"?t:void 0,G=Ge(F),P=F?G:t,U=lr(t),B=Fc()==="rtl",j=D||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":B?"left":"right","inline-start":B?"right":"left"}[r],z=a==="center"?j:`${j}-${a}`;let V=f;const K=1,L=r==="bottom"?K:0,$=r==="top"?K:0,W=r==="right"?K:0,I=r==="left"?K:0;typeof V=="number"?V={top:V+L,right:V+I,bottom:V+$,left:V+W}:V&&(V={top:(V.top||0)+L,right:(V.right||0)+I,bottom:(V.bottom||0)+$,left:(V.left||0)+W});const Q={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:V},le=v.useRef(null),oe=lr(o),Z=lr(l),Se=[d6(bt=>{const Dt=FC(bt,r,B),ot=typeof oe.current=="function"?oe.current(Dt):oe.current,ft=typeof Z.current=="function"?Z.current(Dt):Z.current;return{mainAxis:ot,crossAxis:ft,alignmentAxis:ft}},[typeof o!="function"?o:0,typeof l!="function"?l:0,B,r])],Pe=_==="none"&&N!=="shift",te=!Pe&&(d||R||N==="shift"),he=N==="none"?null:p6({...Q,padding:{top:V.top+K,right:V.right+K,bottom:V.bottom+K,left:V.left+K},mainAxis:!R&&N==="flip",crossAxis:_==="flip"?"alignment":!1,fallbackAxisSideDirection:q}),ye=Pe?null:f6(bt=>{const Dt=Gt(bt.elements.floating).documentElement;return{...Q,rootBoundary:R?{x:0,y:0,width:Dt.clientWidth,height:Dt.clientHeight}:void 0,mainAxis:_!=="none",crossAxis:te,limiter:d||R?void 0:h6(ot=>{if(!le.current)return{};const{width:ft,height:vt}=le.current.getBoundingClientRect(),Ke=Ei(Hr(ot.placement)),Mt=Ke==="y"?ft:vt,Lt=Ke==="y"?V.left+V.right:V.top+V.bottom;return{offset:Mt/2+Lt/2}})}},[Q,d,R,V,_]);N==="shift"||_==="shift"||a==="center"?Se.push(ye,he):Se.push(he,ye),Se.push(m6({...Q,apply({elements:{floating:bt},rects:{reference:Dt},availableWidth:ot,availableHeight:ft}){const vt=bt.style;vt.setProperty("--available-width",`${ot}px`),vt.setProperty("--available-height",`${ft}px`),vt.setProperty("--anchor-width",`${Dt.width}px`),vt.setProperty("--anchor-height",`${Dt.height}px`)}}),Vq(()=>({element:le.current||document.createElement("div"),padding:m,offsetParent:"floating"}),[m]),{name:"transformOrigin",fn(bt){var Xe,at,Et;const{elements:Dt,middlewareData:ot,placement:ft,rects:vt,y:Ke}=bt,Mt=Hr(ft),Lt=Ei(Mt),kt=le.current,hn=((Xe=ot.arrow)==null?void 0:Xe.x)||0,qt=((at=ot.arrow)==null?void 0:at.y)||0,Je=(kt==null?void 0:kt.clientWidth)||0,Ot=(kt==null?void 0:kt.clientHeight)||0,X=hn+Je/2,ie=qt+Ot/2,de=Math.abs(((Et=ot.shift)==null?void 0:Et.y)||0),ke=vt.reference.height/2,je=typeof o=="function"?o(FC(bt,r,B)):o,it=de>je,rt={top:`${X}px calc(100% + ${je}px)`,bottom:`${X}px ${-je}px`,left:`calc(100% + ${je}px) ${ie}px`,right:`${-je}px ${ie}px`}[Mt],Ye=`${X}px ${vt.reference.y+ke-Ke}px`;return Dt.floating.style.setProperty("--transform-origin",te&&Lt==="y"&&it?Ye:rt),{}}},$q,C),qe(()=>{!x&&g&&g.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[x,g]);const Le=v.useMemo(()=>({elementResize:!h&&typeof ResizeObserver<"u",layoutShift:!h&&typeof IntersectionObserver<"u"}),[h]),{refs:Oe,elements:Te,x:Ce,y:J,middlewareData:Ee,update:xe,placement:Be,context:Ve,isPositioned:_e,floatingStyles:ut}=K6({rootContext:g,placement:z,middleware:Se,strategy:n,whileElementsMounted:y?void 0:(...bt)=>EC(...bt,Le),nodeId:T,externalTree:M}),{sideX:pe,sideY:Re}=Ee.adaptiveOrigin||pp,ee=_e?n:"fixed",fe=v.useMemo(()=>{const bt=C?{position:ee,[pe]:Ce,[Re]:J}:{position:ee,...ut};return _e||(bt.opacity=0),bt},[C,ee,pe,Ce,Re,J,ut,_e]),Ne=v.useRef(null);qe(()=>{if(!x)return;const bt=U.current,Dt=typeof bt=="function"?bt():bt,ft=(BC(Dt)?Dt.current:Dt)||null||null;ft!==Ne.current&&(Oe.setPositionReference(ft),Ne.current=ft)},[x,Oe,P,U]),v.useEffect(()=>{if(!x)return;const bt=U.current;typeof bt!="function"&&BC(bt)&&bt.current!==Ne.current&&(Oe.setPositionReference(bt.current),Ne.current=bt.current)},[x,Oe,P,U]),v.useEffect(()=>{if(y&&x&&Te.domReference&&Te.floating)return EC(Te.domReference,Te.floating,xe,Le)},[y,x,Te,xe,Le]);const Ue=Hr(Be),$e=PN(r,Ue,B),et=ns(Be)||"center",ze=!!((Ct=Ee.hide)!=null&&Ct.referenceHidden);qe(()=>{k&&x&&_e&&O(Ue)},[k,x,_e,Ue]);const Ze=v.useMemo(()=>{var bt,Dt;return{position:"absolute",top:(bt=Ee.arrow)==null?void 0:bt.y,left:(Dt=Ee.arrow)==null?void 0:Dt.x}},[Ee.arrow]),nt=((zt=Ee.arrow)==null?void 0:zt.centerOffset)!==0;return v.useMemo(()=>({positionerStyles:fe,arrowStyles:Ze,arrowRef:le,arrowUncentered:nt,side:$e,align:et,physicalSide:Ue,anchorHidden:ze,refs:Oe,context:Ve,isPositioned:_e,update:xe}),[fe,Ze,le,nt,$e,et,Ue,ze,Oe,Ve,_e,xe])}function BC(e){return e!=null&&"current"in e}function Bc(e){return e==="starting"?QF:Pn}const Yq=v.forwardRef(function(t,n){const{render:r,className:o,anchor:a,positionMethod:l="absolute",side:c="top",align:f="center",sideOffset:d=0,alignOffset:m=0,collisionBoundary:h="clipping-ancestors",collisionPadding:y=5,arrowPadding:g=5,sticky:x=!1,disableAnchorTracking:E=!1,collisionAvoidance:R=G2,...T}=t,C=sf(),k=Fq(),M=C.useState("open"),D=C.useState("mounted"),O=C.useState("trackCursorAxis"),N=C.useState("disableHoverablePopup"),_=C.useState("floatingRootContext"),q=C.useState("instantType"),F=C.useState("transitionStatus"),G=C.useState("hasViewport"),P=Ww({anchor:a,positionMethod:l,floatingRootContext:_,mounted:D,side:c,sideOffset:d,align:f,alignOffset:m,collisionBoundary:h,collisionPadding:y,sticky:x,arrowPadding:g,disableAnchorTracking:E,keepMounted:k,collisionAvoidance:R,adaptiveOrigin:G?Gq:void 0}),U=v.useMemo(()=>{const z={};return(!M||O==="both"||N)&&(z.pointerEvents="none"),{role:"presentation",hidden:!D,style:{...P.positionerStyles,...z}}},[M,O,N,D,P.positionerStyles]),H=v.useMemo(()=>({open:M,side:P.side,align:P.align,anchorHidden:P.anchorHidden,instant:O!=="none"?"tracking-cursor":q}),[M,P.side,P.align,P.anchorHidden,O,q]),B=v.useMemo(()=>({...H,arrowRef:P.arrowRef,arrowStyles:P.arrowStyles,arrowUncentered:P.arrowUncentered}),[H,P.arrowRef,P.arrowStyles,P.arrowUncentered]),j=At("div",t,{state:H,props:[U,Bc(F),T],ref:[n,C.useStateSetter("positionerElement")],stateAttributesMapping:po});return w.jsx(_N.Provider,{value:B,children:j})}),Kq={...po,...Xo},Wq=v.forwardRef(function(t,n){const{className:r,render:o,...a}=t,l=sf(),{side:c,align:f}=IN(),d=l.useState("open"),m=l.useState("instantType"),h=l.useState("transitionStatus"),y=l.useState("popupProps"),g=l.useState("floatingRootContext");Qo({open:d,ref:l.context.popupRef,onComplete(){var C,k;d&&((k=(C=l.context).onOpenChangeComplete)==null||k.call(C,!0))}});const x=l.useState("disabled"),E=l.useState("closeDelay");return uN(g,{enabled:!x,closeDelay:E}),At("div",t,{state:{open:d,side:c,align:f,instant:m,transitionStatus:h},ref:[n,l.context.popupRef,l.useStateSetter("popupElement")],props:[y,Bc(h),a],stateAttributesMapping:Kq})}),Xq=v.forwardRef(function(t,n){const{className:r,render:o,...a}=t,c=sf().useState("instantType"),{open:f,arrowRef:d,side:m,align:h,arrowUncentered:y,arrowStyles:g}=IN();return At("div",t,{state:{open:f,side:m,align:h,uncentered:y,instant:c},ref:[n,d],props:[{style:g,"aria-hidden":!0},a],stateAttributesMapping:po})});function Qq({...e}){return w.jsx(Dq,{"data-slot":"tooltip",...e})}function Zq({...e}){return w.jsx(zq,{"data-slot":"tooltip-trigger",...e})}function Jq({className:e,side:t="top",sideOffset:n=4,align:r="center",alignOffset:o=0,children:a,...l}){return w.jsx(Uq,{children:w.jsx(Yq,{align:r,alignOffset:o,side:t,sideOffset:n,className:"isolate z-50",children:w.jsxs(Wq,{"data-slot":"tooltip-content",className:De("data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 rounded-md px-3 py-1.5 text-xs data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 bg-foreground text-background z-50 w-fit max-w-xs origin-(--transform-origin)",e),...l,children:[a,w.jsx(Xq,{className:"size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 bg-foreground fill-foreground z-50 data-[side=bottom]:top-1 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}const e7="sidebar_state",t7=3600*24*7,Ib="100vw",n7="3rem",r7="b",Vu=320,Hp=320,i7=450,Pb="tmex_sidebar_width";function o7(){const e=typeof window>"u"?Number.POSITIVE_INFINITY:window.innerWidth;return Math.max(Hp,e-i7)}function Gh(e){return Math.min(o7(),Math.max(Hp,Math.round(e)))}const LN=v.createContext(null);function qr(){const e=v.useContext(LN);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function a7({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:o,children:a,...l}){const c=iB(),[f,d]=v.useState(!1),m=v.useRef(Vu),[h,y]=v.useState(()=>{if(typeof window>"u")return Vu;const _=Number(window.localStorage.getItem(Pb)),q=Number.isFinite(_)&&_>0?Math.max(Hp,Math.round(_)):Vu;return m.current=q,Gh(q)}),[g,x]=v.useState(!1),E=v.useCallback(_=>{const q=Math.max(Hp,Math.round(_));m.current=q,y(Gh(_)),window.localStorage.setItem(Pb,String(q))},[]),R=v.useCallback(()=>{m.current=Vu,y(Gh(Vu)),window.localStorage.removeItem(Pb)},[]);v.useEffect(()=>{const _=()=>{y(Gh(m.current))};return window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)},[]);const[T,C]=v.useState(e),k=t??T,M=v.useCallback(_=>{const q=typeof _=="function"?_(k):_;n?n(q):C(q),document.cookie=`${e7}=${q}; path=/; max-age=${t7}`},[n,k]),D=v.useCallback(()=>c?d(_=>!_):M(_=>!_),[c,M,d]);v.useEffect(()=>{const _=q=>{q.defaultPrevented||q.target instanceof HTMLElement&&q.target.closest(".xterm")||q.key===r7&&(q.metaKey||q.ctrlKey)&&(q.preventDefault(),D())};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[D]);const O=k?"expanded":"collapsed",N=v.useMemo(()=>({state:O,open:k,setOpen:M,isMobile:c,openMobile:f,setOpenMobile:d,toggleSidebar:D,width:h,setWidth:E,resetWidth:R,isResizing:g,setIsResizing:x}),[O,k,M,c,f,d,D,h,E,R,g]);return w.jsx(LN.Provider,{value:N,children:w.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":`${h}px`,"--sidebar-width-icon":n7,...o},className:De("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...l,children:a})})}function s7({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:o,dir:a,...l}){const{isMobile:c,state:f,openMobile:d,setOpenMobile:m,isResizing:h}=qr();return n==="none"?w.jsx("div",{"data-slot":"sidebar",className:De("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...l,children:o}):c?w.jsx(Sq,{open:d,onOpenChange:m,...l,children:w.jsxs(Cq,{dir:a,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true","data-testid":"mobile-sidebar-sheet",className:"bg-sidebar text-sidebar-foreground p-0 [&>button]:hidden border-none",style:{"--sidebar-width":Ib,width:Ib,maxWidth:Ib},side:e,animation:"top-down",children:[w.jsxs(kq,{className:"sr-only",children:[w.jsx(Mq,{children:"Sidebar"}),w.jsx(Oq,{children:"Displays the mobile sidebar."})]}),w.jsx("div",{className:"flex h-full w-full flex-col","data-testid":"sidebar",style:{paddingBottom:"var(--tmex-safe-area-bottom)"},children:o})]})}):w.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":f,"data-collapsible":f==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[w.jsx("div",{"data-slot":"sidebar-gap",className:De(!h&&"transition-[width] duration-200 ease-linear","relative w-(--sidebar-width) bg-transparent","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),w.jsxs("div",{"data-slot":"sidebar-container","data-side":e,className:De(!h&&"transition-[left,right,width] duration-200 ease-linear","fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...l,children:[w.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner","data-testid":"sidebar",className:"bg-sidebar group-data-[variant=floating]:ring-sidebar-border group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 flex size-full flex-col",style:{paddingBottom:"var(--tmex-safe-area-bottom)"},children:o}),f==="expanded"&&w.jsx(l7,{side:e})]})]})}function l7({side:e}){const{width:t,setWidth:n,resetWidth:r,setIsResizing:o}=qr(),a=v.useRef(null);return w.jsx("div",{"data-slot":"sidebar-resizer","data-testid":"sidebar-resizer","aria-hidden":"true",className:De("absolute inset-y-0 z-30 w-2 cursor-col-resize touch-none select-none","after:absolute after:inset-y-0 after:w-[2px] after:bg-transparent hover:after:bg-sidebar-border active:after:bg-sidebar-border",e==="left"?"-right-1 after:right-[3px]":"-left-1 after:left-[3px]"),onPointerDown:l=>{l.preventDefault(),a.current={pointerId:l.pointerId,startX:l.clientX,startWidth:t},l.currentTarget.setPointerCapture(l.pointerId),o(!0)},onPointerMove:l=>{const c=a.current;if(!c||c.pointerId!==l.pointerId)return;const f=l.clientX-c.startX;n(c.startWidth+(e==="left"?f:-f))},onPointerUp:l=>{var c;((c=a.current)==null?void 0:c.pointerId)===l.pointerId&&(a.current=null,o(!1))},onPointerCancel:l=>{var c;((c=a.current)==null?void 0:c.pointerId)===l.pointerId&&(a.current=null,o(!1))},onDoubleClick:r})}function c7({className:e,onClick:t,...n}){const{toggleSidebar:r,isMobile:o}=qr();return w.jsxs(Ht,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:De(e),onClick:a=>{t==null||t(a),r()},...n,children:[o?w.jsx(L9,{}):w.jsx(U9,{}),w.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function u7({className:e,...t}){return w.jsx("main",{"data-slot":"sidebar-inset",className:De("bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 relative flex w-full flex-1 flex-col",e),...t})}function d7({className:e,...t}){return w.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:De("gap-2 p-2 flex flex-col",e),...t})}function f7({className:e,...t}){return w.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:De("gap-2 p-2 flex flex-col",e),...t})}function h7({className:e,...t}){return w.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:De("no-scrollbar gap-0 flex min-h-0 flex-1 flex-col overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function Xw({className:e,...t}){return w.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:De("p-2 relative flex w-full min-w-0 flex-col",e),...t})}function p7({className:e,...t}){return w.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:De("gap-0 flex w-full min-w-0 flex-col",e),...t})}function m7({className:e,...t}){return w.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:De("group/menu-item relative",e),...t})}const g7=cm("ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground gap-2 rounded-md p-2 text-left text-sm transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! focus-visible:ring-2 data-active:font-medium peer/menu-button flex w-full items-center overflow-hidden outline-hidden group/menu-button disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function y7({render:e,isActive:t=!1,variant:n="default",size:r="default",tooltip:o,className:a,...l}){const{isMobile:c,state:f}=qr(),d=lm({defaultTagName:"button",props:ki({className:De(g7({variant:n,size:r}),a)},l),render:o?Zq:e,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:r,active:t}});return o?(typeof o=="string"&&(o={children:o}),w.jsxs(Qq,{children:[d,w.jsx(Jq,{side:"right",align:"center",hidden:f!=="collapsed"||c,...o})]})):d}function b7({className:e,render:t,showOnHover:n=!1,...r}){return lm({defaultTagName:"button",props:ki({className:De("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 aspect-square w-5 rounded-md p-0 peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 focus-visible:ring-2 [&>svg]:size-4 flex items-center justify-center outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 md:after:hidden [&>svg]:shrink-0",n&&"peer-data-active/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 aria-expanded:opacity-100 md:opacity-0",e)},r),render:t,state:{slot:"sidebar-menu-action",sidebar:"menu-action"}})}function v7({className:e,...t}){return w.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:De("border-sidebar-border mx-3.5 translate-x-px gap-1 border-l px-2.5 py-0.5 group-data-[collapsible=icon]:hidden flex min-w-0 flex-col",e),...t})}function x7({className:e,...t}){return w.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:De("group/menu-sub-item relative",e),...t})}function w7({render:e,size:t="md",isActive:n=!1,className:r,...o}){return lm({defaultTagName:"a",props:ki({className:De("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground h-7 gap-2 rounded-md px-2 focus-visible:ring-2 data-[size=md]:text-sm data-[size=sm]:text-xs [&>svg]:size-4 flex min-w-0 -translate-x-px items-center overflow-hidden outline-hidden group-data-[collapsible=icon]:hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:shrink-0",r)},o),render:e,state:{slot:"sidebar-menu-sub-button",sidebar:"menu-sub-button",size:t,active:n}})}let mp=null;function UC(e){mp=e}function S7(e,t){mp==null||mp(e,t)}let nd=null;function HC(e){nd=e}function E7(){nd!=null&&nd.isMobile&&nd.setOpenMobile(!0)}function T7(){const e=Kd(),{isMobile:t,setOpenMobile:n}=qr();return v.useEffect(()=>(UC((r,o)=>e(r,o??{})),()=>UC(null)),[e]),v.useEffect(()=>(HC({isMobile:t,setOpenMobile:n}),()=>HC(null)),[t,n]),null}const R7={background:"#e1e1e1",foreground:"#616161",cursor:"#616161",selectionBackground:"rgba(97, 97, 97, 0.25)",black:"#171717",red:"#bf2172",green:"#009799",yellow:"#9a7200",blue:"#007299",magenta:"#9b1d72",cyan:"#007173",white:"#d9d9d9",brightBlack:"#4e4e4e",brightRed:"#e12672",brightGreen:"#00bddf",brightYellow:"#ffdd00",brightBlue:"#7299bc",brightMagenta:"#e17899",brightCyan:"#6fbcbd",brightWhite:"#f1f1f1"},C7={background:"#262626",foreground:"#d0d0d0",cursor:"#c5c5c5",selectionBackground:"rgba(197, 197, 197, 0.25)",black:"#000000",red:"#ba3c3c",green:"#5d876d",yellow:"#d5a54e",blue:"#887c8d",magenta:"#cd6d6d",cyan:"#618484",white:"#cfcdc3",brightBlack:"#000000",brightRed:"#ea7171",brightGreen:"#7aab7a",brightYellow:"#d1d194",brightBlue:"#afa3b5",brightMagenta:"#e29f9f",brightCyan:"#a0aea3",brightWhite:"#d0d0d0"};function k7(e){const t=e==="light"?R7:C7;return`fg=${t.foreground},bg=${t.background}`}const jN=["GeistMonoTmex","NotoSansSymbols2Tmex"],lre=`${jN.join(", ")}, monospace`;let ql=null;function cre(){var t;if(ql)return ql;const e=(t=globalThis.document)==null?void 0:t.fonts;return e!=null&&e.load?(ql=Promise.all(jN.flatMap(n=>[e.load(`13px ${n}`),e.load(`bold 13px ${n}`)])).then(()=>{}).catch(()=>{}),ql):(ql=Promise.resolve(),ql)}const M7=`${typeof window<"u"&&window.location.protocol==="https:"?"wss:":"ws:"}//${typeof window<"u"?window.location.host:""}/ws`,O7={clientImpl:"tmex-fe",clientVersion:"0.1.0",maxFrameBytes:1048576,reconnectDelayMs:1e3,maxReconnectAttempts:5,heartbeatIntervalMs:15e3};class N7{constructor(t={}){tt(this,"ws",null);tt(this,"options");tt(this,"state","IDLE");tt(this,"seq",0);tt(this,"chunkReassembler",new Pz);tt(this,"reconnectAttempts",0);tt(this,"reconnectTimer",null);tt(this,"heartbeatTimer",null);tt(this,"messageHandlers",new Set);tt(this,"stateChangeHandlers",new Set);tt(this,"errorHandlers",new Set);tt(this,"pendingMessages",[]);tt(this,"maxPendingMessages",100);this.options={...O7,...t}}setState(t){if(this.state!==t){console.log(`[borsh-client] State: ${this.state} -> ${t}`),this.state=t;for(const n of this.stateChangeHandlers)try{n(t)}catch(r){console.error("[borsh-client] State change handler error:",r)}t==="READY"&&this.flushPendingMessages()}}getState(){return this.state}isReady(){return this.state==="READY"}onMessage(t){return this.messageHandlers.add(t),()=>this.messageHandlers.delete(t)}onStateChange(t){return this.stateChangeHandlers.add(t),()=>this.stateChangeHandlers.delete(t)}onError(t){return this.errorHandlers.add(t),()=>this.errorHandlers.delete(t)}connect(){var t,n;if(!(((t=this.ws)==null?void 0:t.readyState)===WebSocket.OPEN||((n=this.ws)==null?void 0:n.readyState)===WebSocket.CONNECTING)){this.setState("WS_CONNECTING");try{this.ws=new WebSocket(M7),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{this.sendHello()},this.ws.onmessage=r=>{this.handleMessage(r.data)},this.ws.onclose=()=>{this.handleClose()},this.ws.onerror=()=>{this.handleError(new Error("WebSocket error"))}}catch(r){this.handleError(r instanceof Error?r:new Error(String(r)))}}}disconnect(){this.setState("CLOSED"),this.clearTimers(),this.ws&&(this.ws.close(),this.ws=null)}handleMessage(t){if(typeof t=="string")return;const n=new Uint8Array(t);if(!_z(n)){console.warn("[borsh-client] Received message without magic, ignoring");return}try{const r=Nz(n);if(r.kind===sj){const o=Dz(r.payload),a=this.chunkReassembler.addChunk(o);a&&this.dispatchMessage({kind:a.kind,seq:a.seq,payload:a.payload});return}if(r.kind===_L){this.handleHelloS2C(r.payload);return}if(r.kind===PL)return;this.dispatchMessage({kind:r.kind,seq:r.seq,payload:r.payload})}catch(r){console.error("[borsh-client] Failed to decode message:",r)}}dispatchMessage(t){for(const n of this.messageHandlers)try{n(t)}catch(r){console.error("[borsh-client] Message handler error:",r)}}handleHelloS2C(t){try{const n=Bo(Uj,t);console.log("[borsh-client] HELLO_S2C received:",n),this.setState("READY"),this.startHeartbeat(),this.reconnectAttempts=0}catch(n){console.error("[borsh-client] Failed to decode HELLO_S2C:",n),this.handleError(new Error("HELLO negotiation failed"))}}handleClose(){this.stopHeartbeat(),this.state!=="CLOSED"&&(this.reconnectAttempts<this.options.maxReconnectAttempts?this.scheduleReconnect():(this.setState("CLOSED"),this.handleError(new Error("Max reconnection attempts reached"))))}handleError(t){console.error("[borsh-client] Error:",t);for(const n of this.errorHandlers)try{n(t)}catch(r){console.error("[borsh-client] Error handler error:",r)}}sendHello(){const t={clientImpl:this.options.clientImpl,clientVersion:this.options.clientVersion,maxFrameBytes:this.options.maxFrameBytes,supportsCompression:!1,supportsDiffSnapshot:!1},n=nr(Bj,t),r=this.nextSeq(),o=op(DL,n,r);this.sendRaw(o),this.setState("HELLO_NEGOTIATING")}send(t,n){if(!this.isReady())return this.pendingMessages.length<this.maxPendingMessages&&this.pendingMessages.push({kind:t,payload:n}),!1;const r=this.nextSeq(),o=Lz(n,t,r,{maxFrameBytes:this.options.maxFrameBytes,chunkStreamId:jz()});if(o.totalChunks===0){const a=op(t,n,r);this.sendRaw(a)}else for(const a of o.chunks){const l=Az(a,this.nextSeq());this.sendRaw(l)}return!0}sendRaw(t){var n;((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN&&this.ws.send(t)}flushPendingMessages(){for(;this.pendingMessages.length>0;){const t=this.pendingMessages.shift();t&&this.send(t.kind,t.payload)}}startHeartbeat(){this.stopHeartbeat(),this.heartbeatTimer=setInterval(()=>{this.sendPing()},this.options.heartbeatIntervalMs)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}sendPing(){if(!this.isReady())return;const t={nonce:Math.floor(Math.random()*4294967295),timeMs:BigInt(Date.now())},n=nr(Hj,t),r=this.nextSeq(),o=op(IL,n,r);this.sendRaw(o)}scheduleReconnect(){if(this.reconnectTimer)return;this.reconnectAttempts++,this.setState("RECONNECT_BACKOFF");const t=Math.min(this.options.reconnectDelayMs*2**(this.reconnectAttempts-1),3e4);console.log(`[borsh-client] Reconnecting in ${t}ms (attempt ${this.reconnectAttempts})`),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},t)}clearTimers(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.stopHeartbeat()}nextSeq(){return this.seq=(this.seq+1)%4294967295,this.seq}}let Lb=null;function In(){return Lb||(Lb=new N7),Lb}class A7{constructor(t={}){tt(this,"transactions",new Map);tt(this,"outputGates",new Map);tt(this,"deferredResets",new Set);tt(this,"deferredHistories",new Map);tt(this,"deferredFlushes",new Map);tt(this,"deferredOutputs",new Map);tt(this,"callbacks");tt(this,"ackTimeoutMs",1500);tt(this,"liveResumeTimeoutMs",2e3);tt(this,"timers",new Map);this.callbacks=t}setCallbacks(t){this.callbacks=t;for(const n of this.transactions.keys())this.replayDeferred(n);for(const n of this.deferredResets)this.replayDeferred(n);for(const n of this.deferredHistories.keys())this.replayDeferred(n);for(const n of this.deferredFlushes.keys())this.replayDeferred(n);for(const n of this.deferredOutputs.keys())this.replayDeferred(n)}getTransaction(t){return this.transactions.get(t)}getState(t){var n;return((n=this.transactions.get(t))==null?void 0:n.state)??"STABLE"}isStable(t){return this.getState(t)==="STABLE"}isBuffering(t){var n;return((n=this.outputGates.get(t))==null?void 0:n.state)==="BUFFERING"}dispatch(t){switch(t.type){case"SELECT_START":this.handleSelectStart(t);break;case"SWITCH_ACK":this.handleSwitchAck(t);break;case"HISTORY":this.handleHistory(t);break;case"LIVE_RESUME":this.handleLiveResume(t);break;case"OUTPUT":this.handleOutput(t);break;case"SELECT_FAILED":this.handleSelectFailed(t);break}}handleSelectStart(t){const{deviceId:n,windowId:r,paneId:o,selectToken:a,wantHistory:l}=t;this.cancelTransaction(n),this.clearDeferred(n);const c={state:"SELECTING",deviceId:n,windowId:r,paneId:o,selectToken:new Uint8Array(a),wantHistory:l,startedAt:Date.now()};this.transactions.set(n,c),this.startOutputBuffering(n),this.setTimer(n,()=>{this.handleTimeout(n,"ack")},this.ackTimeoutMs)}handleSwitchAck(t){const{deviceId:n,selectToken:r}=t,o=this.transactions.get(n);!o||!this.validateToken(o.selectToken,r)||o.state==="SELECTING"&&(this.clearTimer(n),o.state="ACKED",this.callbacks.onResetTerminal?this.callbacks.onResetTerminal(n):this.deferredResets.add(n),this.setTimer(n,()=>{this.handleTimeout(n,"live")},this.liveResumeTimeoutMs))}handleHistory(t){const{deviceId:n,selectToken:r,data:o}=t,a=this.transactions.get(n);!a||!this.validateToken(a.selectToken,r)||a.state==="ACKED"&&(a.state="HISTORY_APPLIED",this.callbacks.onApplyHistory?this.callbacks.onApplyHistory(n,o,t.alternateScreen):this.deferredHistories.set(n,{data:o,alternateScreen:t.alternateScreen}),this.setTimer(n,()=>{this.handleTimeout(n,"live")},this.liveResumeTimeoutMs))}handleLiveResume(t){const{deviceId:n,selectToken:r}=t,o=this.transactions.get(n);if(!o||!this.validateToken(o.selectToken,r)||o.state!=="ACKED"&&o.state!=="HISTORY_APPLIED")return;this.clearTimer(n),o.state="LIVE";const a=this.stopOutputBuffering(n);this.completeTransaction(n),this.callbacks.onFlushBuffer?this.callbacks.onFlushBuffer(n,a):a.length>0&&this.deferredFlushes.set(n,a),this.replayDeferred(n)}handleOutput(t){const{deviceId:n,paneId:r,data:o}=t,a=this.transactions.get(n);if(a&&a.paneId!==r)return;if(this.isBuffering(n)){this.bufferOutput(n,o);return}if(this.callbacks.onOutput){this.callbacks.onOutput(n,r,o);return}const l=this.deferredOutputs.get(n)??[];l.push({paneId:r,data:new Uint8Array(o)}),this.deferredOutputs.set(n,l)}handleSelectFailed(t){const{deviceId:n}=t;this.failTransaction(n)}handleTimeout(t,n){console.warn(`[select-sm] Timeout at ${n} for ${t}`),this.failTransaction(t)}completeTransaction(t){const n=this.transactions.get(t);n&&(n.state="STABLE",this.transactions.delete(t))}failTransaction(t){var r,o;const n=this.transactions.get(t);n&&(n.state="SELECT_FAILED",this.stopOutputBuffering(t),(o=(r=this.callbacks).onSelectFailed)==null||o.call(r,t),this.transactions.delete(t),this.clearTimer(t),this.clearDeferred(t))}cancelTransaction(t){this.transactions.get(t)&&(this.stopOutputBuffering(t),this.transactions.delete(t),this.clearTimer(t),this.clearDeferred(t))}startOutputBuffering(t){this.outputGates.set(t,{state:"BUFFERING",buffer:[]})}stopOutputBuffering(t){const n=this.outputGates.get(t);if(!n)return[];const r=[...n.buffer];return this.outputGates.delete(t),r}bufferOutput(t,n){const r=this.outputGates.get(t);r&&(r.buffer.length>=1e3&&r.buffer.shift(),r.buffer.push(new Uint8Array(n)))}validateToken(t,n){if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==n[r])return!1;return!0}replayDeferred(t){var a,l;this.deferredResets.has(t)&&(this.deferredResets.delete(t),(l=(a=this.callbacks).onResetTerminal)==null||l.call(a,t));const n=this.deferredHistories.get(t);n!==void 0&&this.callbacks.onApplyHistory&&(this.callbacks.onApplyHistory(t,n.data,n.alternateScreen),this.deferredHistories.delete(t));const r=this.deferredFlushes.get(t);r&&this.callbacks.onFlushBuffer&&(this.callbacks.onFlushBuffer(t,r),this.deferredFlushes.delete(t));const o=this.deferredOutputs.get(t);if(o&&this.callbacks.onOutput){for(const c of o)this.callbacks.onOutput(t,c.paneId,c.data);this.deferredOutputs.delete(t)}}clearDeferred(t){this.deferredResets.delete(t),this.deferredHistories.delete(t),this.deferredFlushes.delete(t),this.deferredOutputs.delete(t)}setTimer(t,n,r){this.clearTimer(t);const o=setTimeout(n,r);this.timers.set(t,o)}clearTimer(t){const n=this.timers.get(t);n&&(clearTimeout(n),this.timers.delete(t))}cleanup(t){this.cancelTransaction(t),this.outputGates.delete(t),this.clearDeferred(t)}cleanupAll(){for(const t of this.transactions.keys())this.cleanup(t);this.transactions.clear(),this.outputGates.clear(),this.deferredResets.clear(),this.deferredHistories.clear(),this.deferredFlushes.clear(),this.deferredOutputs.clear();for(const t of this.timers.values())clearTimeout(t);this.timers.clear()}}let $u=null;function Ad(e){return $u?(e&&$u.setCallbacks(e),$u):($u=new A7(e),$u)}function D7(){return crypto.getRandomValues(new Uint8Array(16))}function zN(e){const t=nr(qj,{deviceId:e});return{kind:jL,payload:t}}function _7(e){const t=nr($j,{deviceId:e});return{kind:FL,payload:t}}function I7(e){const t=nr(Kj,{deviceId:e.deviceId,windowId:e.windowId??null,paneId:e.paneId??null,selectToken:e.selectToken,wantHistory:e.wantHistory,cols:e.cols??null,rows:e.rows??null});return{kind:HL,payload:t}}function P7(e,t){const n=nr(Wj,{deviceId:e,windowId:t});return{kind:qL,payload:n}}function L7(e,t){const n=nr(Xj,{deviceId:e,name:t??null});return{kind:VL,payload:n}}function j7(e,t){const n=nr(Qj,{deviceId:e,windowId:t});return{kind:$L,payload:n}}function z7(e,t){const n=nr(Zj,{deviceId:e,paneId:t});return{kind:GL,payload:n}}function F7(e,t,n){const r=nr(Jj,{deviceId:e,windowId:t,name:n});return{kind:YL,payload:r}}function B7(e,t){const n=nr(ez,{deviceId:e,style:t});return{kind:XL,payload:n}}function U7(e,t){const n=nr(tz,{deviceId:e,windowIds:t});return{kind:QL,payload:n}}function H7(e,t,n){const r=nr(nz,{deviceId:e,windowId:t,paneIds:n});return{kind:ZL,payload:r}}function q7(e,t,n,r=!1){const o=new TextEncoder,a=nr(iz,{deviceId:e,paneId:t,encoding:2,data:o.encode(n),isComposing:r});return{kind:JL,payload:a}}function V7(e,t,n){const r=new TextEncoder,o=nr(oz,{deviceId:e,paneId:t,encoding:2,data:r.encode(n),isComposing:!1});return{kind:ej,payload:o}}function $7(e,t,n,r){const o=nr(e2,{deviceId:e,paneId:t,cols:n,rows:r});return{kind:tj,payload:o}}function G7(e,t,n,r){const o=nr(az,{deviceId:e,paneId:t,cols:n,rows:r});return{kind:nj,payload:o}}function Y7(e){const t=nr(mz,{sessionId:e});return{kind:lj,payload:t}}function K7(e){const t=nr(gz,{sessionId:e});return{kind:cj,payload:t}}const qC=e=>{let t;const n=new Set,r=(d,m)=>{const h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){const y=t;t=m??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(g=>g(t,y))}},o=()=>t,c={setState:r,getState:o,getInitialState:()=>f,subscribe:d=>(n.add(d),()=>n.delete(d))},f=t=e(r,o,c);return c},W7=(e=>e?qC(e):qC),X7=e=>e;function Q7(e,t=X7){const n=Fe.useSyncExternalStore(e.subscribe,Fe.useCallback(()=>t(e.getState()),[e,t]),Fe.useCallback(()=>t(e.getInitialState()),[e,t]));return Fe.useDebugValue(n),n}const VC=e=>{const t=W7(e),n=r=>Q7(t,r);return Object.assign(n,t),n},lf=(e=>e?VC(e):VC),jb={siteName:"tmex",siteUrl:typeof window<"u"?window.location.origin:"http://localhost:9663",bellThrottleSeconds:6,notificationThrottleSeconds:3,enableBrowserBellToast:!0,enableBrowserNotificationToast:!0,enableTelegramBellPush:!0,enableTelegramNotificationPush:!0,sshReconnectMaxRetries:2,sshReconnectDelaySeconds:10,language:Gx,updatedAt:new Date(0).toISOString()};async function $C(){const e=await fetch("/api/settings/site");if(!e.ok)throw new Error("Failed to load site settings");return(await e.json()).settings}const nl=lf((e,t)=>({settings:null,loading:!1,fetchSettings:async()=>{const n=t().settings;if(n)return n;e({loading:!0});try{const r=await $C();return e({settings:r,loading:!1}),Qt.changeLanguage(r.language),r}catch(r){return console.error("[site] failed to fetch settings:",r),e({settings:jb,loading:!1}),Qt.changeLanguage(jb.language),jb}},refreshSettings:async()=>{e({loading:!0});try{const n=await $C();return e({settings:n,loading:!1}),Qt.changeLanguage(n.language),n}catch(n){throw console.error("[site] failed to refresh settings:",n),e({loading:!1}),n}}}));function Z7(e){const t=typeof e.windowIndex=="number"?`Window ${e.windowIndex}`:typeof e.windowId=="string"&&e.windowId?`Window ${e.windowId}`:"",n=typeof e.paneIndex=="number"?`Pane ${e.paneIndex}`:typeof e.paneId=="string"&&e.paneId?`Pane ${e.paneId}`:"";return[t,n].filter(Boolean).join(" · ")}function J7(e){const t=typeof e.title=="string"&&e.title?e.title:"Terminal Notification",n=Z7(e),r=typeof e.body=="string"&&e.body?e.body:typeof e.source=="string"&&e.source?`From ${e.source}`:"Terminal notification";return{title:t,description:n?`${n}
|
|
443
|
+
${r}`:r}}function eV(e,t){let n;try{n=e()}catch{return}return{getItem:o=>{var a;const l=f=>f===null?null:JSON.parse(f,void 0),c=(a=n.getItem(o))!=null?a:null;return c instanceof Promise?c.then(l):l(c)},setItem:(o,a)=>n.setItem(o,JSON.stringify(a,void 0)),removeItem:o=>n.removeItem(o)}}const ix=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return ix(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return ix(r)(n)}}}},tV=(e,t)=>(n,r,o)=>{let a={storage:eV(()=>window.localStorage),partialize:R=>R,version:0,merge:(R,T)=>({...T,...R}),...t},l=!1,c=0;const f=new Set,d=new Set;let m=a.storage;if(!m)return e((...R)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...R)},r,o);const h=()=>{const R=a.partialize({...r()});return m.setItem(a.name,{state:R,version:a.version})},y=o.setState;o.setState=(R,T)=>(y(R,T),h());const g=e((...R)=>(n(...R),h()),r,o);o.getInitialState=()=>g;let x;const E=()=>{var R,T;if(!m)return;const C=++c;l=!1,f.forEach(M=>{var D;return M((D=r())!=null?D:g)});const k=((T=a.onRehydrateStorage)==null?void 0:T.call(a,(R=r())!=null?R:g))||void 0;return ix(m.getItem.bind(m))(a.name).then(M=>{if(M)if(typeof M.version=="number"&&M.version!==a.version){if(a.migrate){const D=a.migrate(M.state,M.version);return D instanceof Promise?D.then(O=>[!0,O]):[!0,D]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,M.state];return[!1,void 0]}).then(M=>{var D;if(C!==c)return;const[O,N]=M;if(x=a.merge(N,(D=r())!=null?D:g),n(x,!0),O)return h()}).then(()=>{C===c&&(k==null||k(x,void 0),x=r(),l=!0,d.forEach(M=>M(x)))}).catch(M=>{C===c&&(k==null||k(void 0,M))})};return o.persist={setOptions:R=>{a={...a,...R},R.storage&&(m=R.storage)},clearStorage:()=>{m==null||m.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>E(),hasHydrated:()=>l,onHydrate:R=>(f.add(R),()=>{f.delete(R)}),onFinishHydration:R=>(d.add(R),()=>{d.delete(R)})},a.skipHydration||E(),x||g},Qw=tV,Mi=lf()(Qw(e=>({sidebarCollapsed:!1,sidebarTab:"panes",inputMode:"direct",editorSendWithEnter:!0,theme:"dark",editorHistory:[],editorDrafts:{},setSidebarCollapsed:t=>e({sidebarCollapsed:t}),setSidebarTab:t=>e({sidebarTab:t}),setInputMode:t=>e({inputMode:t}),setEditorSendWithEnter:t=>e({editorSendWithEnter:t}),setTheme:t=>e({theme:t}),addEditorHistory:t=>e(n=>({editorHistory:[t,...n.editorHistory.slice(0,49)]})),setEditorDraft:(t,n)=>e(r=>({editorDrafts:{...r.editorDrafts,[t]:n}})),removeEditorDraft:t=>e(n=>{if(!(t in n.editorDrafts))return n;const r={...n.editorDrafts};return delete r[t],{editorDrafts:r}})}),{name:"tmex-ui",partialize:e=>({sidebarCollapsed:e.sidebarCollapsed,inputMode:e.inputMode,editorSendWithEnter:e.editorSendWithEnter,theme:e.theme,editorHistory:e.editorHistory,editorDrafts:e.editorDrafts}),merge:(e,t)=>{const{sidebarTab:n,...r}=e??{};return{...t,...r}}})),nV=500,GC=new Map,zb=new Map;function FN(e){const t=Date.now(),n=GC.get(e);return n!==void 0&&t-n<nV?!0:(GC.set(e,t),!1)}let YC=!1;function Fb(e){const t=k7(Mi.getState().theme),n=B7(e,t);In().send(n.kind,n.payload)}function Bb(e,t){if(typeof e!="number"||typeof t!="number")return null;const n=Math.max(2,Math.floor(e)),r=Math.max(2,Math.floor(t));return{cols:n,rows:r}}function rV(e,t){if(YC)return;YC=!0;const n=In(),r=a=>{const l=t().selectedPanes[a];!l||Ad().getTransaction(a)||t().selectPane(a,l.windowId,l.paneId)};n.onStateChange(a=>{e({socketReady:a==="READY"})}),n.onMessage(a=>{const l=Ad();switch(a.kind){case zL:{const c=Bo(Vj,a.payload);e(f=>({deviceConnected:{...f.deviceConnected,[c.deviceId]:!0},deviceErrors:{...f.deviceErrors,[c.deviceId]:void 0},deviceReconnecting:{...f.deviceReconnecting,[c.deviceId]:void 0}})),Fb(c.deviceId),r(c.deviceId);return}case BL:{const c=Bo(Gj,a.payload);l.cleanup(c.deviceId),e(f=>({deviceConnected:{...f.deviceConnected,[c.deviceId]:!1}}));return}case UL:{const c=Fz(a.payload);iV(e,c),c.type==="reconnected"&&(Fb(c.deviceId),r(c.deviceId));return}case WL:{const c=Hz(a.payload);e(f=>({snapshots:{...f.snapshots,[c.deviceId]:c}}));return}case KL:{const c=Bz(a.payload);oV(e,c);return}case oj:{const c=Bo(cz,a.payload);l.dispatch({type:"SWITCH_ACK",deviceId:c.deviceId,selectToken:c.selectToken});return}case ij:{const c=Bo(lz,a.payload),f=new TextDecoder().decode(c.data);l.dispatch({type:"HISTORY",deviceId:c.deviceId,selectToken:c.selectToken,data:f,alternateScreen:c.alternateScreen});return}case aj:{const c=Bo(uz,a.payload);l.dispatch({type:"LIVE_RESUME",deviceId:c.deviceId,selectToken:c.selectToken});return}case rj:{const c=Bo(sz,a.payload);l.dispatch({type:"OUTPUT",deviceId:c.deviceId,paneId:c.paneId,data:c.data});return}case LL:return}}),n.onError(a=>{console.error("[tmux] borsh ws error:",a),e({socketReady:!1}),Bt.error("WebSocket Connection Error",{description:"Please check Gateway status"})}),n.onStateChange(a=>{if(a!=="READY")return;const l=t().connectedDevices;for(const c of l){if(FN(c))continue;const f=zN(c);n.send(f.kind,f.payload)}});let o=Mi.getState().theme;Mi.subscribe(a=>{if(a.theme===o)return;o=a.theme;const l=t();for(const c of l.connectedDevices)l.deviceConnected[c]&&Fb(c)})}function iV(e,t){if(t.type==="error"){const n=t.message??"Device Error",r=t.errorType??"unknown";if(r==="reconnecting"){e(o=>({deviceReconnecting:{...o.deviceReconnecting,[t.deviceId]:{message:n,at:Date.now()}}}));return}e(o=>{const a=o.deviceErrors[t.deviceId];return(!a||a.type!==r)&&Bt.error(n),{deviceErrors:{...o.deviceErrors,[t.deviceId]:{message:n,type:r,rawMessage:t.rawMessage,at:Date.now()}},deviceReconnecting:{...o.deviceReconnecting,[t.deviceId]:void 0}}});return}if(t.type==="disconnected"){Ad().cleanup(t.deviceId),e(n=>({deviceConnected:{...n.deviceConnected,[t.deviceId]:!1}}));return}t.type==="reconnected"&&e(n=>({deviceConnected:{...n.deviceConnected,[t.deviceId]:!0},deviceErrors:{...n.deviceErrors,[t.deviceId]:void 0},deviceReconnecting:{...n.deviceReconnecting,[t.deviceId]:void 0}}))}function oV(e,t){if(t.type==="bell"){console.log("[tmex] bell",t.data);const n=nl.getState().settings;if((n==null?void 0:n.enableBrowserBellToast)===!1)return;const r=t.data??{},o="Terminal Bell",a=[typeof r.windowIndex=="number"?`Window ${r.windowIndex}`:void 0,typeof r.paneIndex=="number"?`Pane ${r.paneIndex}`:void 0].filter(Boolean).join(" · "),l=typeof r.paneUrl=="string"?r.paneUrl:void 0;Bt(o,{description:a||"Received tmux bell",action:l?{label:"Open",onClick:()=>{window.location.href=l}}:void 0})}if(t.type==="notification"){console.log("[tmex] notification",t.data);const n=nl.getState().settings;if((n==null?void 0:n.enableBrowserNotificationToast)===!1)return;const r=t.data??{},{title:o,description:a}=J7(r),l=typeof r.paneUrl=="string"?r.paneUrl:void 0;Bt(o,{description:a,action:l?{label:"Open",onClick:()=>{window.location.href=l}}:void 0})}if(t.type==="pane-active"){const n=t.data;n!=null&&n.windowId&&(n!=null&&n.paneId)&&e(r=>({activePaneFromEvent:{...r.activePaneFromEvent,[t.deviceId]:{windowId:n.windowId,paneId:n.paneId}}}))}}const Mn=lf((e,t)=>({socketReady:!1,snapshots:{},connectedDevices:new Set,deviceConnected:{},deviceErrors:{},deviceReconnecting:{},selectedPanes:{},activePaneFromEvent:{},pendingCreateWindowAt:{},ensureSocketConnected(){rV(e,t),In().connect()},connectDevice(n){if(!n||(e(o=>{const a=new Set(o.connectedDevices);return a.add(n),{connectedDevices:a}}),t().ensureSocketConnected(),FN(n)))return;const r=zN(n);In().send(r.kind,r.payload)},disconnectDevice(n){if(!n)return;e(o=>{const a=new Set(o.connectedDevices);return a.delete(n),{connectedDevices:a}}),Ad().cleanup(n);const r=_7(n);In().send(r.kind,r.payload)},clearDeviceError(n){e(r=>({deviceErrors:{...r.deviceErrors,[n]:void 0},deviceReconnecting:{...r.deviceReconnecting,[n]:void 0}}))},hydrateDeviceErrors(n){e(r=>{const o={...r.deviceErrors};for(const a of n)o[a.deviceId]||!a.lastError||!a.lastErrorType||(o[a.deviceId]={message:a.lastError,type:a.lastErrorType,at:0});return{deviceErrors:o}})},selectPane(n,r,o,a){if(!n||!r||!o)return;e(m=>({selectedPanes:{...m.selectedPanes,[n]:{windowId:r,paneId:o}}}));const l=D7(),c=!0;Ad().dispatch({type:"SELECT_START",deviceId:n,windowId:r,paneId:o,selectToken:l,wantHistory:c});const f=Bb(a==null?void 0:a.cols,a==null?void 0:a.rows)??zb.get(n)??null,d=I7({deviceId:n,windowId:r,paneId:o,selectToken:l,wantHistory:c,cols:f==null?void 0:f.cols,rows:f==null?void 0:f.rows});In().send(d.kind,d.payload)},selectWindow(n,r){if(!n||!r)return;const o=P7(n,r);In().send(o.kind,o.payload)},sendInput(n,r,o,a=!1){if(!n||!r)return;const l=q7(n,r,o,a);In().send(l.kind,l.payload)},resizePane(n,r,o,a){if(!n||!r)return;const l=Bb(o,a);l&&zb.set(n,{...l,at:Date.now()});const c=$7(n,r,o,a);In().send(c.kind,c.payload)},syncPaneSize(n,r,o,a){if(!n||!r)return;const l=Bb(o,a);l&&zb.set(n,{...l,at:Date.now()});const c=G7(n,r,o,a);In().send(c.kind,c.payload)},paste(n,r,o){if(!n||!r)return;const a=V7(n,r,o);In().send(a.kind,a.payload)},createWindow(n,r){if(!n)return;const o=L7(n,r);In().send(o.kind,o.payload),e(a=>({pendingCreateWindowAt:{...a.pendingCreateWindowAt,[n]:Date.now()}}))},clearPendingCreateWindow(n){n&&e(r=>{if(r.pendingCreateWindowAt[n]===void 0)return r;const o={...r.pendingCreateWindowAt};return delete o[n],{pendingCreateWindowAt:o}})},closeWindow(n,r){if(!n||!r)return;const o=j7(n,r);In().send(o.kind,o.payload)},closePane(n,r){if(!n||!r)return;const o=z7(n,r);In().send(o.kind,o.payload)},renameWindow(n,r,o){if(!n||!r)return;const a=F7(n,r,o);In().send(a.kind,a.payload)},reorderWindows(n,r){if(!n||r.length===0)return;e(a=>{const l=a.snapshots[n],c=l==null?void 0:l.session;if(!c)return{};const f=new Map(c.windows.map(h=>[h.id,h])),d=r.map(h=>f.get(h)).filter(h=>h!==void 0),m=c.windows.filter(h=>!r.includes(h.id));return{snapshots:{...a.snapshots,[n]:{...l,session:{...c,windows:[...d,...m]}}}}});const o=U7(n,r);In().send(o.kind,o.payload)},reorderPanes(n,r,o){if(!n||!r||o.length===0)return;e(l=>{const c=l.snapshots[n],f=c==null?void 0:c.session;if(!f)return{};const d=f.windows.map(m=>{if(m.id!==r)return m;const h=new Map(m.panes.map(x=>[x.id,x])),y=o.map(x=>h.get(x)).filter(x=>x!==void 0),g=m.panes.filter(x=>!o.includes(x.id));return{...m,panes:[...y,...g]}});return{snapshots:{...l.snapshots,[n]:{...c,session:{...f,windows:d}}}}});const a=H7(n,r,o);In().send(a.kind,a.payload)}})),KC="tmex:connectedDevices",BN=v.createContext(null);function aV(){const e=v.useContext(BN);if(!e)throw new Error("useGlobalDevice must be used within GlobalDeviceProvider");return e}function sV({children:e}){const t=Gi(),[n,r]=v.useState(()=>{try{const h=localStorage.getItem(KC);if(h){const y=JSON.parse(h);return new Set(y)}}catch{}return new Set}),o=Mn(h=>h.connectDevice),a=Mn(h=>h.disconnectDevice),l=Mn(h=>h.connectedDevices);v.useEffect(()=>{try{localStorage.setItem(KC,JSON.stringify([...n]))}catch{}},[n]),v.useEffect(()=>{const h=t.pathname.match(/^\/devices\/([^/]+)/),y=h==null?void 0:h[1];y&&!l.has(y)&&o(y)},[t.pathname,l,o]);const c=v.useCallback(h=>{r(y=>{const g=new Set(y);return g.add(h),g}),l.has(h)||o(h)},[l,o]),f=v.useCallback(h=>{r(y=>{const g=new Set(y);return g.delete(h),g}),l.has(h)&&a(h)},[l,a]),d=v.useCallback((h,y)=>{y?f(h):c(h)},[c,f]),m=v.useMemo(()=>({persistedDevices:n,connectDevice:c,disconnectDevice:f,toggleDevice:d}),[n,c,f,d]);return w.jsx(BN.Provider,{value:m,children:e})}const UN=v.createContext(void 0);function lV(){const e=v.useContext(UN);if(e===void 0)throw new Error(Rn(63));return e}let WC=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const HN={...fw,checked(e){return e?{[WC.checked]:""}:{[WC.unchecked]:""}}};function qN(e,t){const n=v.useRef(e),r=Ge(t);qe(()=>{n.current!==e&&r(n.current)},[e,r]),qe(()=>{n.current=e},[e])}const cV=v.forwardRef(function(t,n){const{checked:r,className:o,defaultChecked:a,id:l,inputRef:c,name:f,nativeButton:d=!1,onCheckedChange:m,readOnly:h=!1,required:y=!1,disabled:g=!1,render:x,uncheckedValue:E,value:R,...T}=t,{clearErrors:C}=hw(),{state:k,setTouched:M,setDirty:D,validityData:O,setFilled:N,setFocused:_,shouldValidateOnChange:q,validationMode:F,disabled:G,name:P,validation:U}=Lc(),{labelId:H}=pm(),B=G||g,j=P??f,z=Ge(m),V=v.useRef(null),K=Hi(V,c,U.inputRef),L=v.useRef(null),$=Yi(),W=bm({id:l,implicit:!1,controlRef:L}),I=d?void 0:W,[Q,le]=Cc({controlled:r,default:!!a,name:"Switch",state:"checked"});vw({id:$,commit:U.commit,value:Q,controlRef:L,name:j,getValue:()=>Q}),qe(()=>{V.current&&N(V.current.checked)},[V,N]),qN(Q,()=>{C(j),D(Q!==O.initialValue),N(Q),q()?U.commit(Q):U.commit(Q,!0)});const{getButtonProps:oe,buttonRef:Z}=Wo({disabled:B,native:d}),ue={id:d?W:$,role:"switch","aria-checked":Q,"aria-readonly":h||void 0,"aria-required":y||void 0,"aria-labelledby":H,onFocus(){B||_(!0)},onBlur(){const te=V.current;!te||B||(M(!0),_(!1),F==="onBlur"&&U.commit(te.checked))},onClick(te){var he;h||B||(te.preventDefault(),(he=V.current)==null||he.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:te.shiftKey,ctrlKey:te.ctrlKey,altKey:te.altKey,metaKey:te.metaKey})))}},ve=v.useMemo(()=>ki({checked:Q,disabled:B,id:I,name:j,required:y,style:j?HO:Sm,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:K,onChange(te){if(te.nativeEvent.defaultPrevented)return;const he=te.target.checked,ye=yt(qi,te.nativeEvent);z==null||z(he,ye),!ye.isCanceled&&le(he)},onFocus(){var te;(te=L.current)==null||te.focus()}},U.getInputValidationProps,R!==void 0?{value:R}:Pn),[Q,B,K,I,j,z,y,le,U,R]),Se=v.useMemo(()=>({...k,checked:Q,disabled:B,readOnly:h,required:y}),[k,Q,B,h,y]),Pe=At("span",t,{state:Se,ref:[n,L,Z],props:[ue,U.getValidationProps,T,oe],stateAttributesMapping:HN});return w.jsxs(UN.Provider,{value:Se,children:[Pe,!Q&&j&&E!==void 0&&w.jsx("input",{type:"hidden",name:j,value:E}),w.jsx("input",{...ve})]})}),uV=v.forwardRef(function(t,n){const{render:r,className:o,...a}=t,{state:l}=Lc(),c=lV(),f={...l,...c};return At("span",t,{state:f,ref:n,stateAttributesMapping:HN,props:a})});function qp({className:e,size:t="default",...n}){return w.jsx(cV,{"data-slot":"switch","data-size":t,className:De("data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent focus-visible:ring-3 aria-invalid:ring-3 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...n,children:w.jsx(uV,{"data-slot":"switch-thumb",className:"bg-background dark:data-unchecked:bg-foreground dark:data-checked:bg-primary-foreground rounded-full group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 pointer-events-none block ring-0 transition-transform"})})}function Zw({className:e,...t}){return w.jsx("textarea",{"data-slot":"textarea",className:De("border-input dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 rounded-lg border bg-transparent px-2.5 py-2 text-base transition-colors focus-visible:ring-2 aria-invalid:ring-2 md:text-sm placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})}function rd(){return{texts:[],reasonings:[],toolCalls:[],staleBarrier:!1}}function lc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function VN(e){if(lc(e)&&typeof e.type=="string")switch(e.type){case"text":case"json":if("value"in e)return{value:e.value,isError:!1,denied:!1};break;case"error-text":case"error-json":if("value"in e)return{value:e.value,isError:!0,denied:!1};break;case"execution-denied":return{value:typeof e.reason=="string"?e.reason:void 0,isError:!1,denied:!0}}return{value:e,isError:!1,denied:!1}}function $N(e){return typeof e=="string"?e:Array.isArray(e)?e.map(t=>lc(t)&&typeof t.text=="string"?t.text:"").filter(Boolean).join(`
|
|
444
|
+
`):""}function dV(e){const t=[],n=new Map;for(const r of e){const o=lc(r.content)?r.content:null;if(!o)continue;const a=o.content;switch(r.role){case"user":{const l=$N(a);l&&t.push({kind:"user",key:`m${r.seq}`,text:l});break}case"assistant":{if(typeof a=="string"){a&&t.push({kind:"assistant-text",key:`m${r.seq}`,text:a,streaming:!1});break}if(!Array.isArray(a))break;a.forEach((l,c)=>{if(!lc(l))return;const f=`m${r.seq}p${c}`;if(l.type==="text"&&typeof l.text=="string"&&l.text){t.push({kind:"assistant-text",key:f,text:l.text,streaming:!1});return}if(l.type==="reasoning"&&typeof l.text=="string"&&l.text){t.push({kind:"reasoning",key:f,text:l.text,streaming:!1});return}if(l.type==="tool-call"&&typeof l.toolCallId=="string"){const d={toolCallId:l.toolCallId,toolName:typeof l.toolName=="string"?l.toolName:"unknown",input:l.input,isError:!1,denied:!1,resolved:!1};n.set(d.toolCallId,d),t.push({kind:"tool-call",key:f,call:d})}});break}case"tool":{if(!Array.isArray(a))break;for(const l of a){if(!lc(l)||l.type!=="tool-result")continue;const c=typeof l.toolCallId=="string"?l.toolCallId:"",f=n.get(c),{value:d,isError:m,denied:h}=VN(l.output);f&&(f.output=d,f.isError=m,f.denied=h,f.resolved=!0)}break}}}return{blocks:t,toolBlocksById:n}}function fV(e,t){const{blocks:n,toolBlocksById:r}=dV(e??[]);if(!t)return n;for(const o of t.toolCalls){const a=r.get(o.toolCallId);if(a){!a.resolved&&o.resolved&&(a.output=o.output,a.isError=o.isError,a.denied=o.denied,a.resolved=!0);continue}n.push({kind:"tool-call",key:`live-tool-${o.toolCallId}`,call:o})}for(const o of t.reasonings)o.text&&n.push({kind:"reasoning",key:`live-reasoning-${o.messageId}`,text:o.text,streaming:!0});for(const o of t.texts)o.text&&n.push({kind:"assistant-text",key:`live-text-${o.messageId}`,text:o.text,streaming:!0});return n}function ox(e){return!e||e.length===0?-1:e[e.length-1].seq}function hV(e){if(!e)return null;for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role!=="user")continue;const r=lc(n.content)?n.content:null,o=r?$N(r.content):"";if(o)return o}return null}async function Rr(e,t){try{return(await e.json()).error??t}catch{return t}}function Gu(e){return Object.values(e).filter(t=>!!t).sort((t,n)=>t.updatedAt<n.updatedAt?1:-1).map(t=>t.id)}function XC(e,t){if(!e||e.length===0)return[...t].sort((r,o)=>r.seq-o.seq);const n=new Map;for(const r of e)n.set(r.seq,r);for(const r of t)n.set(r.seq,r);return[...n.values()].sort((r,o)=>r.seq-o.seq)}let QC=!1;const ka=new Set,pV=40,Vs=new Map;let Yu=null;const mV=120,hd=new Map,Ub=new Set,ax=new Set;function gV(e){const t=hd.get(e);t&&(clearTimeout(t),hd.delete(e)),Vs.delete(e),ax.delete(e)}function sx(e){const t=Y7(e);In().send(t.kind,t.payload)}function ZC(e){const t=K7(e);In().send(t.kind,t.payload)}function JC(e,t,n,r){let o=Vs.get(e);o||(o={texts:new Map,reasonings:new Map},Vs.set(e,o));const a=o[t];a.set(n,(a.get(n)??"")+r)}function yV(e){const t=()=>{if(Yu&&(clearTimeout(Yu),Yu=null),Vs.size===0)return;const r=new Map(Vs);Vs.clear(),e(o=>{const a={...o.inProgress};for(const[l,c]of r){const f=a[l]??rd(),d={...f,texts:[...f.texts],reasonings:[...f.reasonings]};for(const m of["texts","reasonings"])for(const[h,y]of c[m]){const g=d[m],x=g.findIndex(E=>E.messageId===h);x>=0?g[x]={...g[x],text:g[x].text+y}:g.push({messageId:h,text:y,stale:!1})}a[l]=d}return{inProgress:a}})};return{flush:t,schedule:()=>{Yu||(Yu=setTimeout(t,pV))}}}function bV(e,t){if(QC)return;QC=!0;const n=In(),r=yV(e),o=R=>{hd.get(R)||hd.set(R,setTimeout(()=>{hd.delete(R),t().loadHistory(R)},mV))},a=(R,T)=>{Vs.delete(R),e(k=>{const M=k.sessions[R],D=rd();return T.inProgressText&&D.texts.push({messageId:"__sync__",text:T.inProgressText,stale:!1}),T.inProgressReasoning&&D.reasonings.push({messageId:"__sync_reasoning__",text:T.inProgressReasoning,stale:!1}),{sessions:M?{...k.sessions,[R]:{...M,status:T.status,lastError:T.lastError}}:k.sessions,inProgress:{...k.inProgress,[R]:D},pendingConfirmations:{...k.pendingConfirmations,[R]:T.pendingConfirmations.map(O=>({id:O.confirmationId,toolCallId:O.toolCallId,toolName:O.toolName,input:O.input,createdAt:O.createdAt}))},queued:{...k.queued,[R]:T.queuedMessages.map(O=>({id:O.id,sessionId:R,seq:O.seq,text:O.text,createdAt:O.createdAt}))}}});const C=t();(T.lastMessageSeq>ox(C.messages[R])||!C.historyLoaded[R])&&C.loadHistory(R)},l=(R,T)=>{const C=!!t().sessions[R];if(e(k=>{const M=k.sessions[R];return M?{sessions:{...k.sessions,[R]:{...M,status:T.status,lastError:T.lastError!==void 0?T.lastError:M.lastError}}}:k}),!C){t().loadSessions();return}t().refreshSession(R)},c=(R,T)=>{r.flush(),e(C=>{const k=C.inProgress[R]??rd(),M=[...k.toolCalls],D=M.findIndex(N=>N.toolCallId===T.toolCallId),O={toolCallId:T.toolCallId,toolName:T.toolName,input:T.input,isError:!1,denied:!1,resolved:!1,stale:!1};return D>=0?M[D]={...M[D],...O}:M.push(O),{inProgress:{...C.inProgress,[R]:{...k,toolCalls:M}}}})},f=(R,T)=>{r.flush();const{value:C,isError:k,denied:M}=VN(T.output);e(D=>{const O=D.inProgress[R]??rd(),N=[...O.toolCalls],_=N.findIndex(q=>q.toolCallId===T.toolCallId);return _>=0?N[_]={...N[_],output:C,isError:!!T.isError||k,denied:M,resolved:!0}:N.push({toolCallId:T.toolCallId,toolName:T.toolName,input:void 0,output:C,isError:!!T.isError||k,denied:M,resolved:!0,stale:O.staleBarrier}),{inProgress:{...D.inProgress,[R]:{...O,toolCalls:N}}}})},d=(R,T)=>{e(C=>{const k=C.pendingConfirmations[R]??[];return k.some(M=>M.id===T.confirmationId)?C:{pendingConfirmations:{...C.pendingConfirmations,[R]:[...k,{id:T.confirmationId,toolCallId:T.toolCallId,toolName:T.toolName,input:T.input,createdAt:new Date().toISOString()}]}}})},m=(R,T)=>{e(C=>{const k=C.pendingConfirmations[R];return!k||!k.some(M=>M.id===T.confirmationId)?C:{pendingConfirmations:{...C.pendingConfirmations,[R]:k.filter(M=>M.id!==T.confirmationId)}}})},h=(R,T)=>{r.flush(),(T.role==="assistant"||T.role==="tool")&&e(C=>{const k=C.inProgress[R];return k?{inProgress:{...C.inProgress,[R]:{texts:k.texts.map(M=>({...M,stale:!0})),reasonings:k.reasonings.map(M=>({...M,stale:!0})),toolCalls:k.toolCalls.map(M=>M.resolved?{...M,stale:!0}:M),staleBarrier:!0}}}:C}),o(R)},y=(R,T)=>{r.flush(),e(C=>{const k=C.sessions[R];return{sessions:k?{...C.sessions,[R]:{...k,status:T.sessionStatus}}:C.sessions,inProgress:{...C.inProgress,[R]:rd()}}}),T.lastMessageSeq>ox(t().messages[R])&&o(R)},g=(R,T)=>{const C=t().sessions[R];Bt.error(Qt.t("agent.toast.errorTitle",{title:(C==null?void 0:C.title)??"Agent"}),{description:T.message})},x=(R,T)=>{Bt.warning(Qt.t("agent.toast.credentialWarningTitle"),{description:Qt.t("agent.toast.credentialWarningDescription",{types:T.types.join(", ")}),duration:1e4})},E=(R,T)=>{e(C=>({queued:{...C.queued,[R]:T.queued.map(k=>({id:k.id,sessionId:R,seq:k.seq,text:k.text,createdAt:k.createdAt}))}}))};n.onMessage(R=>{if(R.kind!==uj)return;let T;try{T=Bo(yz,R.payload)}catch(M){console.error("[agent] failed to decode AGENT_EVENT:",M);return}let C;try{C=JSON.parse(new TextDecoder().decode(T.payload))}catch(M){console.error("[agent] failed to parse AGENT_EVENT payload:",M);return}const k=T.sessionId;switch(T.eventType){case fj:a(k,C);return;case hj:l(k,C);return;case pj:{const M=C;JC(k,"texts",M.messageId,M.delta),r.schedule();return}case mj:{const M=C;JC(k,"reasonings",M.messageId,M.delta),r.schedule();return}case gj:c(k,C);return;case yj:f(k,C);return;case bj:d(k,C);return;case vj:m(k,C);return;case xj:h(k,C);return;case wj:g(k,C);return;case Sj:y(k,C);return;case Ej:x(k,C);return;case Tj:E(k,C);return;default:return}}),n.onStateChange(R=>{if(R!=="READY")return;for(const C of ka)sx(C);const T=t().activeSessionId;T&&t().loadHistory(T)})}const sn=lf()(Qw((e,t)=>({sessions:{},sessionOrder:[],sessionsLoaded:!1,activeSessionId:null,messages:{},historyLoaded:{},inProgress:{},pendingConfirmations:{},queued:{},sending:{},draft:null,defaultWriteMode:"confirm",ensureInitialized(){bV(e,t),In().connect();const n=t().activeSessionId;n&&!ka.has(n)&&(ka.add(n),sx(n))},async loadSessions(){try{const n=await fetch("/api/agent/sessions");if(!n.ok)throw new Error(await Rr(n,"Failed to load agent sessions"));const r=await n.json();e(()=>{const a={};for(const l of r.sessions)a[l.id]=l;return{sessions:a,sessionOrder:Gu(a),sessionsLoaded:!0}});const o=t();o.activeSessionId&&!o.sessions[o.activeSessionId]&&o.setActiveSession(null)}catch(n){console.error("[agent] loadSessions failed:",n)}},async refreshSession(n){try{const r=await fetch(`/api/agent/sessions/${n}`);if(r.status===404){await t().loadSessions();return}if(!r.ok)throw new Error(await Rr(r,"Failed to load agent session"));const o=await r.json();e(a=>{const l={...a.sessions,[n]:o.session};return{sessions:l,sessionOrder:Gu(l)}})}catch(r){console.error("[agent] refreshSession failed:",r)}},setActiveSession(n){const r=t().activeSessionId;r!==n&&(r&&ka.has(r)&&(ka.delete(r),ZC(r)),e({activeSessionId:n,draft:null}),n&&(ka.add(n),sx(n),t().historyLoaded[n]||t().loadHistory(n)))},async createSession(n,r,o){try{const a=await fetch("/api/agent/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceId:n,paneId:r,...(o==null?void 0:o.providerId)!==void 0?{providerId:o.providerId}:{},...(o==null?void 0:o.modelId)!==void 0&&o.modelId!==null?{modelId:o.modelId}:{},...(o==null?void 0:o.providerHostedTools)!==void 0?{providerHostedTools:o.providerHostedTools}:{},...(o==null?void 0:o.originPaneTitle)!==void 0?{originPaneTitle:o.originPaneTitle}:{},writeMode:(o==null?void 0:o.writeMode)??t().defaultWriteMode})});if(!a.ok)throw new Error(await Rr(a,"Failed to create agent session"));const c=(await a.json()).session;return e(f=>{const d={...f.sessions,[c.id]:c};return{sessions:d,sessionOrder:Gu(d),messages:{...f.messages,[c.id]:[]},historyLoaded:{...f.historyLoaded,[c.id]:!0}}}),t().setActiveSession(c.id),c}catch(a){return Bt.error(a instanceof Error?a.message:String(a)),null}},async renameSession(n,r){try{const o=await fetch(`/api/agent/sessions/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:r})});if(!o.ok)throw new Error(await Rr(o,"Failed to rename agent session"));const a=await o.json();return e(l=>{const c={...l.sessions,[n]:a.session};return{sessions:c,sessionOrder:Gu(c)}}),!0}catch(o){return Bt.error(o instanceof Error?o.message:String(o)),!1}},async deleteSession(n){try{const r=await fetch(`/api/agent/sessions/${n}`,{method:"DELETE"});if(!r.ok)throw new Error(await Rr(r,"Failed to delete agent session"));return t().activeSessionId===n&&t().setActiveSession(null),gV(n),e(o=>{const a={...o.sessions};delete a[n];const l={...o.messages};delete l[n];const c={...o.historyLoaded};delete c[n];const f={...o.inProgress};delete f[n];const d={...o.pendingConfirmations};delete d[n];const m={...o.queued};return delete m[n],{sessions:a,sessionOrder:Gu(a),messages:l,historyLoaded:c,inProgress:f,pendingConfirmations:d,queued:m}}),!0}catch(r){return Bt.error(r instanceof Error?r.message:String(r)),!1}},async setWriteMode(n,r){try{const o=await fetch(`/api/agent/sessions/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({writeMode:r})});if(!o.ok)throw new Error(await Rr(o,"Failed to update write mode"));const a=await o.json();e(l=>({sessions:{...l.sessions,[n]:a.session}}))}catch(o){Bt.error(o instanceof Error?o.message:String(o))}},setDefaultWriteMode(n){e({defaultWriteMode:n})},async setSessionModel(n,r,o){try{const a=await fetch(`/api/agent/sessions/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerId:r,modelId:o})});if(!a.ok)throw new Error(await Rr(a,"Failed to update model"));const l=await a.json();e(c=>({sessions:{...c.sessions,[n]:l.session}}))}catch(a){Bt.error(a instanceof Error?a.message:String(a))}},async rebindPane(n,r){try{const o=await fetch(`/api/agent/sessions/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({paneId:r})});if(!o.ok)throw new Error(await Rr(o,"Failed to rebind pane"));const a=await o.json();e(l=>({sessions:{...l.sessions,[n]:a.session}}))}catch(o){Bt.error(o instanceof Error?o.message:String(o))}},async loadHistory(n){if(Ub.has(n)){ax.add(n);return}Ub.add(n);try{const r=t(),o=r.historyLoaded[n]?ox(r.messages[n]):-1,a=o>=0?`?afterSeq=${o}`:"",l=await fetch(`/api/agent/sessions/${n}/messages${a}`);if(!l.ok)throw new Error(await Rr(l,"Failed to load agent messages"));const c=await l.json();e(f=>{const d=XC(o>=0?f.messages[n]:void 0,c.messages),m=f.inProgress[n],h=m&&{texts:m.texts.filter(y=>!y.stale),reasonings:m.reasonings.filter(y=>!y.stale),toolCalls:m.toolCalls.filter(y=>!y.stale),staleBarrier:!1};return{messages:{...f.messages,[n]:d},historyLoaded:{...f.historyLoaded,[n]:!0},inProgress:h?{...f.inProgress,[n]:h}:f.inProgress}})}catch(r){console.error("[agent] loadHistory failed:",r)}finally{Ub.delete(n),ax.delete(n)&&t().loadHistory(n)}},async sendMessage(n,r){e(o=>({sending:{...o.sending,[n]:!0}}));try{const o=await fetch(`/api/agent/sessions/${n}/messages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:r})});if(!o.ok)throw new Error(await Rr(o,"Failed to send message"));const a=await o.json();if(a.message){const l=a.message;e(c=>{const f=c.sessions[n];return{messages:{...c.messages,[n]:XC(c.messages[n],[l])},sessions:f?{...c.sessions,[n]:{...f,status:"running",lastError:null}}:c.sessions}})}return!0}catch(o){return Bt.error(o instanceof Error?o.message:String(o)),!1}finally{e(o=>({sending:{...o.sending,[n]:!1}}))}},async enqueueMessage(n,r,o=!1){try{const a=await fetch(`/api/agent/sessions/${n}/queue`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:r,steer:o})});if(!a.ok)throw new Error(await Rr(a,"Failed to queue message"))}catch(a){Bt.error(a instanceof Error?a.message:String(a))}},async editQueuedMessage(n,r,o){try{const a=await fetch(`/api/agent/queue/${r}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:o})});if(!a.ok)throw new Error(await Rr(a,"Failed to edit queued message"))}catch(a){Bt.error(a instanceof Error?a.message:String(a))}},async withdrawQueuedMessage(n,r){try{const o=await fetch(`/api/agent/queue/${r}`,{method:"DELETE"});if(!o.ok)throw new Error(await Rr(o,"Failed to withdraw queued message"))}catch(o){Bt.error(o instanceof Error?o.message:String(o))}},startDraft(n,r,o,a){const l=t().activeSessionId;l&&ka.has(l)&&(ka.delete(l),ZC(l)),e({activeSessionId:null,draft:{deviceId:n,paneId:r,providerId:null,modelId:null,paneTitle:o,prompt:a??null}})},updateDraft(n){e(r=>r.draft?{draft:{...r.draft,...n}}:r)},clearDraft(){e({draft:null})},async materializeDraft(){const n=t().draft;return n?await t().createSession(n.deviceId,n.paneId,{providerId:n.providerId,modelId:n.modelId,originPaneTitle:n.paneTitle}):null},async stopSession(n){try{const r=await fetch(`/api/agent/sessions/${n}/stop`,{method:"POST"});if(!r.ok)throw new Error(await Rr(r,"Failed to stop agent session"));const o=await r.json();if(o.session){const a=o.session;e(l=>({sessions:{...l.sessions,[n]:a}}))}}catch(r){Bt.error(r instanceof Error?r.message:String(r))}},async decideConfirmation(n,r,o,a){const l=()=>{e(c=>{const f=c.pendingConfirmations[n];return f?{pendingConfirmations:{...c.pendingConfirmations,[n]:f.filter(d=>d.id!==r)}}:c})};try{const c=await fetch(`/api/agent/confirmations/${r}/decide`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a===void 0?{approved:o}:{approved:o,reason:a})});if(c.status===409){l();try{const f=await fetch(`/api/agent/sessions/${n}/confirmations`);if(f.ok){const d=await f.json();e(m=>({pendingConfirmations:{...m.pendingConfirmations,[n]:d.confirmations.map(h=>({id:h.id,toolCallId:h.toolCallId,toolName:h.toolName,input:h.input,createdAt:h.createdAt}))}}))}}catch{}return}if(!c.ok)throw new Error(await Rr(c,"Failed to decide confirmation"));l()}catch(c){Bt.error(c instanceof Error?c.message:String(c))}}}),{name:"tmex-agent",partialize:e=>({activeSessionId:e.activeSessionId,defaultWriteMode:e.defaultWriteMode})}));function vV(){const e=nl.getState().settings;return(e==null?void 0:e.siteName)||"tmex"}function ek(e){const t=e==null?void 0:e.trim();return t&&t.length>0?t:"?"}function xV({paneIdx:e,windowIdx:t,paneTitle:n,windowName:r,windowCustomName:o,deviceName:a}){const l=t??"?",c=e??"?",f=ek(o??n??r),d=ek(a);return`${l}/${c}: ${f}@${d}`}function Jw(e){var c,f;const t=(c=e.customName)==null?void 0:c.trim(),n=e.panes.find(d=>d.active)??e.panes[0],r=e.name.trim(),o=(f=n==null?void 0:n.title)==null?void 0:f.trim(),a=t||o||r;return{title:a,processName:!!r&&r!==a?r:void 0}}function wV(e){const{title:t,processName:n}=Jw(e);return n?`${n}: ${t}`:t}function ure(e){const t=vV();return e!=null&&e.trim()?`[${t}]${e}`:t}function dre(){}function fre(e){const t=[],n=String(e||"");let r=n.indexOf(","),o=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const l=n.slice(o,r).trim();(l||!a)&&t.push(l),o=r+1,r=n.indexOf(",",o)}return t}function SV(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const EV=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,TV=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,RV={};function tk(e,t){return(RV.jsx?TV:EV).test(e)}const CV=/[ \t\n\f\r]/g;function kV(e){return typeof e=="object"?e.type==="text"?nk(e.value):!1:nk(e)}function nk(e){return e.replace(CV,"")===""}class cf{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}cf.prototype.normal={};cf.prototype.property={};cf.prototype.space=void 0;function GN(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new cf(n,r,t)}function lx(e){return e.toLowerCase()}class Vr{constructor(t,n){this.attribute=n,this.property=t}}Vr.prototype.attribute="";Vr.prototype.booleanish=!1;Vr.prototype.boolean=!1;Vr.prototype.commaOrSpaceSeparated=!1;Vr.prototype.commaSeparated=!1;Vr.prototype.defined=!1;Vr.prototype.mustUseProperty=!1;Vr.prototype.number=!1;Vr.prototype.overloadedBoolean=!1;Vr.prototype.property="";Vr.prototype.spaceSeparated=!1;Vr.prototype.space=void 0;let MV=0;const _t=sl(),Xn=sl(),cx=sl(),He=sl(),En=sl(),$s=sl(),ei=sl();function sl(){return 2**++MV}const ux=Object.freeze(Object.defineProperty({__proto__:null,boolean:_t,booleanish:Xn,commaOrSpaceSeparated:ei,commaSeparated:$s,number:He,overloadedBoolean:cx,spaceSeparated:En},Symbol.toStringTag,{value:"Module"})),Hb=Object.keys(ux);class e0 extends Vr{constructor(t,n,r,o){let a=-1;if(super(t,n),rk(this,"space",o),typeof r=="number")for(;++a<Hb.length;){const l=Hb[a];rk(this,Hb[a],(r&ux[l])===ux[l])}}}e0.prototype.defined=!0;function rk(e,t,n){n&&(e[t]=n)}function Uc(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const a=new e0(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[lx(r)]=r,n[lx(a.attribute)]=r}return new cf(t,n,e.space)}const YN=Uc({properties:{ariaActiveDescendant:null,ariaAtomic:Xn,ariaAutoComplete:null,ariaBusy:Xn,ariaChecked:Xn,ariaColCount:He,ariaColIndex:He,ariaColSpan:He,ariaControls:En,ariaCurrent:null,ariaDescribedBy:En,ariaDetails:null,ariaDisabled:Xn,ariaDropEffect:En,ariaErrorMessage:null,ariaExpanded:Xn,ariaFlowTo:En,ariaGrabbed:Xn,ariaHasPopup:null,ariaHidden:Xn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:En,ariaLevel:He,ariaLive:null,ariaModal:Xn,ariaMultiLine:Xn,ariaMultiSelectable:Xn,ariaOrientation:null,ariaOwns:En,ariaPlaceholder:null,ariaPosInSet:He,ariaPressed:Xn,ariaReadOnly:Xn,ariaRelevant:null,ariaRequired:Xn,ariaRoleDescription:En,ariaRowCount:He,ariaRowIndex:He,ariaRowSpan:He,ariaSelected:Xn,ariaSetSize:He,ariaSort:null,ariaValueMax:He,ariaValueMin:He,ariaValueNow:He,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function KN(e,t){return t in e?e[t]:t}function WN(e,t){return KN(e,t.toLowerCase())}const OV=Uc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:$s,acceptCharset:En,accessKey:En,action:null,allow:null,allowFullScreen:_t,allowPaymentRequest:_t,allowUserMedia:_t,alpha:_t,alt:null,as:null,async:_t,autoCapitalize:null,autoComplete:En,autoFocus:_t,autoPlay:_t,blocking:En,capture:null,charSet:null,checked:_t,cite:null,className:En,closedBy:null,colorSpace:null,cols:He,colSpan:He,command:null,commandFor:null,content:null,contentEditable:Xn,controls:_t,controlsList:En,coords:He|$s,crossOrigin:null,data:null,dateTime:null,decoding:null,default:_t,defer:_t,dir:null,dirName:null,disabled:_t,download:cx,draggable:Xn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:_t,formTarget:null,headers:En,height:He,hidden:cx,high:He,href:null,hrefLang:null,htmlFor:En,httpEquiv:En,id:null,imageSizes:null,imageSrcSet:null,inert:_t,inputMode:null,integrity:null,is:null,isMap:_t,itemId:null,itemProp:En,itemRef:En,itemScope:_t,itemType:En,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:_t,low:He,manifest:null,max:null,maxLength:He,media:null,method:null,min:null,minLength:He,multiple:_t,muted:_t,name:null,nonce:null,noModule:_t,noValidate:_t,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:_t,optimum:He,pattern:null,ping:En,placeholder:null,playsInline:_t,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:_t,referrerPolicy:null,rel:En,required:_t,reversed:_t,rows:He,rowSpan:He,sandbox:En,scope:null,scoped:_t,seamless:_t,selected:_t,shadowRootClonable:_t,shadowRootCustomElementRegistry:_t,shadowRootDelegatesFocus:_t,shadowRootMode:null,shadowRootSerializable:_t,shape:null,size:He,sizes:null,slot:null,span:He,spellCheck:Xn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:He,step:null,style:null,tabIndex:He,target:null,title:null,translate:null,type:null,typeMustMatch:_t,useMap:null,value:Xn,width:He,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:En,axis:null,background:null,bgColor:null,border:He,borderColor:null,bottomMargin:He,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:_t,declare:_t,event:null,face:null,frame:null,frameBorder:null,hSpace:He,leftMargin:He,link:null,longDesc:null,lowSrc:null,marginHeight:He,marginWidth:He,noResize:_t,noHref:_t,noShade:_t,noWrap:_t,object:null,profile:null,prompt:null,rev:null,rightMargin:He,rules:null,scheme:null,scrolling:Xn,standby:null,summary:null,text:null,topMargin:He,valueType:null,version:null,vAlign:null,vLink:null,vSpace:He,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:_t,disablePictureInPicture:_t,disableRemotePlayback:_t,exportParts:$s,part:En,prefix:null,property:null,results:He,security:null,unselectable:null},space:"html",transform:WN}),NV=Uc({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ei,accentHeight:He,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:He,amplitude:He,arabicForm:null,ascent:He,attributeName:null,attributeType:null,azimuth:He,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:He,by:null,calcMode:null,capHeight:He,className:En,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:He,diffuseConstant:He,direction:null,display:null,dur:null,divisor:He,dominantBaseline:null,download:_t,dx:null,dy:null,edgeMode:null,editable:null,elevation:He,enableBackground:null,end:null,event:null,exponent:He,externalResourcesRequired:null,fill:null,fillOpacity:He,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:$s,g2:$s,glyphName:$s,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:He,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:He,horizOriginX:He,horizOriginY:He,id:null,ideographic:He,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:He,k:He,k1:He,k2:He,k3:He,k4:He,kernelMatrix:ei,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:He,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:He,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:He,overlineThickness:He,paintOrder:null,panose1:null,path:null,pathLength:He,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:En,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:He,pointsAtY:He,pointsAtZ:He,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ei,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ei,rev:ei,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ei,requiredFeatures:ei,requiredFonts:ei,requiredFormats:ei,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:He,specularExponent:He,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:He,strikethroughThickness:He,string:null,stroke:null,strokeDashArray:ei,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:He,strokeOpacity:He,strokeWidth:null,style:null,surfaceScale:He,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ei,tabIndex:He,tableValues:null,target:null,targetX:He,targetY:He,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ei,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:He,underlineThickness:He,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:He,values:null,vAlphabetic:He,vMathematical:He,vectorEffect:null,vHanging:He,vIdeographic:He,version:null,vertAdvY:He,vertOriginX:He,vertOriginY:He,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:He,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:KN}),XN=Uc({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),QN=Uc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:WN}),ZN=Uc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),AV={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},DV=/[A-Z]/g,ik=/-[a-z]/g,_V=/^data[-\w.:]+$/i;function IV(e,t){const n=lx(t);let r=t,o=Vr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&_V.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(ik,LV);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!ik.test(a)){let l=a.replace(DV,PV);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}o=e0}return new o(r,t)}function PV(e){return"-"+e.toLowerCase()}function LV(e){return e.charAt(1).toUpperCase()}const jV=GN([YN,OV,XN,QN,ZN],"html"),t0=GN([YN,NV,XN,QN,ZN],"svg");function hre(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function zV(e){return e.join(" ").trim()}var Vl={},qb,ok;function FV(){if(ok)return qb;ok=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,f=`
|
|
445
|
+
`,d="/",m="*",h="",y="comment",g="declaration";function x(R,T){if(typeof R!="string")throw new TypeError("First argument must be a string");if(!R)return[];T=T||{};var C=1,k=1;function M(H){var B=H.match(t);B&&(C+=B.length);var j=H.lastIndexOf(f);k=~j?H.length-j:k+H.length}function D(){var H={line:C,column:k};return function(B){return B.position=new O(H),q(),B}}function O(H){this.start=H,this.end={line:C,column:k},this.source=T.source}O.prototype.content=R;function N(H){var B=new Error(T.source+":"+C+":"+k+": "+H);if(B.reason=H,B.filename=T.source,B.line=C,B.column=k,B.source=R,!T.silent)throw B}function _(H){var B=H.exec(R);if(B){var j=B[0];return M(j),R=R.slice(j.length),B}}function q(){_(n)}function F(H){var B;for(H=H||[];B=G();)B!==!1&&H.push(B);return H}function G(){var H=D();if(!(d!=R.charAt(0)||m!=R.charAt(1))){for(var B=2;h!=R.charAt(B)&&(m!=R.charAt(B)||d!=R.charAt(B+1));)++B;if(B+=2,h===R.charAt(B-1))return N("End of comment missing");var j=R.slice(2,B-2);return k+=2,M(j),R=R.slice(B),k+=2,H({type:y,comment:j})}}function P(){var H=D(),B=_(r);if(B){if(G(),!_(o))return N("property missing ':'");var j=_(a),z=H({type:g,property:E(B[0].replace(e,h)),value:j?E(j[0].replace(e,h)):h});return _(l),z}}function U(){var H=[];F(H);for(var B;B=P();)B!==!1&&(H.push(B),F(H));return H}return q(),U()}function E(R){return R?R.replace(c,h):h}return qb=x,qb}var ak;function BV(){if(ak)return Vl;ak=1;var e=Vl&&Vl.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Vl,"__esModule",{value:!0}),Vl.default=n;const t=e(FV());function n(r,o){let a=null;if(!r||typeof r!="string")return a;const l=(0,t.default)(r),c=typeof o=="function";return l.forEach(f=>{if(f.type!=="declaration")return;const{property:d,value:m}=f;c?o(d,m,f):m&&(a=a||{},a[d]=m)}),a}return Vl}var Ku={},sk;function UV(){if(sk)return Ku;sk=1,Object.defineProperty(Ku,"__esModule",{value:!0}),Ku.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,a=function(d){return!d||n.test(d)||e.test(d)},l=function(d,m){return m.toUpperCase()},c=function(d,m){return"".concat(m,"-")},f=function(d,m){return m===void 0&&(m={}),a(d)?d:(d=d.toLowerCase(),m.reactCompat?d=d.replace(o,c):d=d.replace(r,c),d.replace(t,l))};return Ku.camelCase=f,Ku}var Wu,lk;function HV(){if(lk)return Wu;lk=1;var e=Wu&&Wu.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(BV()),n=UV();function r(o,a){var l={};return!o||typeof o!="string"||(0,t.default)(o,function(c,f){c&&f&&(l[(0,n.camelCase)(c,a)]=f)}),l}return r.default=r,Wu=r,Wu}var qV=HV();const VV=im(qV),JN=eA("end"),n0=eA("start");function eA(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function $V(e){const t=n0(e),n=JN(e);if(t&&n)return{start:t,end:n}}function pd(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ck(e.position):"start"in e||"end"in e?ck(e):"line"in e||"column"in e?dx(e):""}function dx(e){return uk(e&&e.line)+":"+uk(e&&e.column)}function ck(e){return dx(e&&e.start)+"-"+dx(e&&e.end)}function uk(e){return e&&typeof e=="number"?e:1}class Er extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",a={},l=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?o=t:!a.cause&&t&&(l=!0,o=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const f=r.indexOf(":");f===-1?a.ruleId=r:(a.source=r.slice(0,f),a.ruleId=r.slice(f+1))}if(!a.place&&a.ancestors&&a.ancestors){const f=a.ancestors[a.ancestors.length-1];f&&(a.place=f.position)}const c=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=c?c.line:void 0,this.name=pd(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=l&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Er.prototype.file="";Er.prototype.name="";Er.prototype.reason="";Er.prototype.message="";Er.prototype.stack="";Er.prototype.column=void 0;Er.prototype.line=void 0;Er.prototype.ancestors=void 0;Er.prototype.cause=void 0;Er.prototype.fatal=void 0;Er.prototype.place=void 0;Er.prototype.ruleId=void 0;Er.prototype.source=void 0;const r0={}.hasOwnProperty,GV=new Map,YV=/[A-Z]/g,KV=new Set(["table","tbody","thead","tfoot","tr"]),WV=new Set(["td","th"]),tA="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function XV(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=i$(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=r$(n,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?t0:jV,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=nA(o,e,void 0);return a&&typeof a!="string"?a:o.create(e,o.Fragment,{children:a||void 0},void 0)}function nA(e,t,n){if(t.type==="element")return QV(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return ZV(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return e$(e,t,n);if(t.type==="mdxjsEsm")return JV(e,t);if(t.type==="root")return t$(e,t,n);if(t.type==="text")return n$(e,t)}function QV(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=t0,e.schema=o),e.ancestors.push(t);const a=iA(e,t.tagName,!1),l=o$(e,t);let c=o0(e,t);return KV.has(t.tagName)&&(c=c.filter(function(f){return typeof f=="string"?!kV(f):!0})),rA(e,l,a,t),i0(l,c),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function ZV(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Dd(e,t.position)}function JV(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Dd(e,t.position)}function e$(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=t0,e.schema=o),e.ancestors.push(t);const a=t.name===null?e.Fragment:iA(e,t.name,!0),l=a$(e,t),c=o0(e,t);return rA(e,l,a,t),i0(l,c),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function t$(e,t,n){const r={};return i0(r,o0(e,t)),e.create(t,e.Fragment,r,n)}function n$(e,t){return t.value}function rA(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function i0(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function r$(e,t,n){return r;function r(o,a,l,c){const d=Array.isArray(l.children)?n:t;return c?d(a,l,c):d(a,l)}}function i$(e,t){return n;function n(r,o,a,l){const c=Array.isArray(a.children),f=n0(r);return t(o,a,l,c,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function o$(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&r0.call(t.properties,o)){const a=s$(e,o,t.properties[o]);if(a){const[l,c]=a;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&WV.has(t.tagName)?r=c:n[l]=c}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function a$(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const l=a.expression;l.type;const c=l.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else Dd(e,t.position);else{const o=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,a=e.evaluater.evaluateExpression(c.expression)}else Dd(e,t.position);else a=r.value===null?!0:r.value;n[o]=a}return n}function o0(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:GV;for(;++r<t.children.length;){const a=t.children[r];let l;if(e.passKeys){const f=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(f){const d=o.get(f)||0;l=f+"-"+d,o.set(f,d+1)}}const c=nA(e,a,l);c!==void 0&&n.push(c)}return n}function s$(e,t,n){const r=IV(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?SV(n):zV(n)),r.property==="style"){let o=typeof n=="object"?n:l$(e,String(n));return e.stylePropertyNameCase==="css"&&(o=c$(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?AV[r.property]||r.property:r.attribute,n]}}function l$(e,t){try{return VV(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,o=new Er("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=tA+"#cannot-parse-style-attribute",o}}function iA(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let a=-1,l;for(;++a<o.length;){const c=tk(o[a])?{type:"Identifier",name:o[a]}:{type:"Literal",value:o[a]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(a&&c.type==="Literal"),optional:!1}:c}r=l}else r=tk(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return r0.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);Dd(e)}function Dd(e,t){const n=new Er("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=tA+"#cannot-handle-mdx-estrees-without-createevaluater",n}function c$(e){const t={};let n;for(n in e)r0.call(e,n)&&(t[u$(n)]=e[n]);return t}function u$(e){let t=e.replace(YV,d$);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function d$(e){return"-"+e.toLowerCase()}const Vb={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},f$={};function a0(e,t){const n=f$,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return oA(e,r,o)}function oA(e,t,n){if(h$(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return dk(e.children,t,n)}return Array.isArray(e)?dk(e,t,n):""}function dk(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=oA(e[o],t,n);return r.join("")}function h$(e){return!!(e&&typeof e=="object")}const fk=document.createElement("i");function s0(e){const t="&"+e+";";fk.innerHTML=t;const n=fk.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ai(e,t,n,r){const o=e.length;let a=0,l;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);a<r.length;)l=r.slice(a,a+1e4),l.unshift(t,0),e.splice(...l),a+=1e4,t+=1e4}function Si(e,t){return e.length>0?(ai(e,e.length,0,t),e):t}const hk={}.hasOwnProperty;function aA(e){const t={};let n=-1;for(;++n<e.length;)p$(t,e[n]);return t}function p$(e,t){let n;for(n in t){const o=(hk.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){hk.call(o,l)||(o[l]=[]);const c=a[l];m$(o[l],Array.isArray(c)?c:c?[c]:[])}}}function m$(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ai(e,0,0,r)}function sA(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Ui(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Mr=os(/[A-Za-z]/),Sr=os(/[\dA-Za-z]/),g$=os(/[#-'*+\--9=?A-Z^-~]/);function Vp(e){return e!==null&&(e<32||e===127)}const fx=os(/\d/),y$=os(/[\dA-Fa-f]/),b$=os(/[!-/:-@[-`{-~]/);function xt(e){return e!==null&&e<-2}function Tn(e){return e!==null&&(e<0||e===32)}function Xt(e){return e===-2||e===-1||e===32}const Dm=os(new RegExp("\\p{P}|\\p{S}","u")),rl=os(/\s/);function os(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Hc(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const a=e.charCodeAt(n);let l="";if(a===37&&Sr(e.charCodeAt(n+1))&&Sr(e.charCodeAt(n+2)))o=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(l=String.fromCharCode(a));else if(a>55295&&a<57344){const c=e.charCodeAt(n+1);a<56320&&c>56319&&c<57344?(l=String.fromCharCode(a,c),o=1):l="�"}else l=String.fromCharCode(a);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+o+1,l=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function ln(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(f){return Xt(f)?(e.enter(n),c(f)):t(f)}function c(f){return Xt(f)&&a++<o?(e.consume(f),c):(e.exit(n),t(f))}}const v$={tokenize:x$};function x$(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),ln(e,t,"linePrefix")}function o(c){return e.enter("paragraph"),a(c)}function a(c){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,l(c)}function l(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return xt(c)?(e.consume(c),e.exit("chunkText"),a):(e.consume(c),l)}}const w$={tokenize:S$},pk={tokenize:E$};function S$(e){const t=this,n=[];let r=0,o,a,l;return c;function c(k){if(r<n.length){const M=n[r];return t.containerState=M[1],e.attempt(M[0].continuation,f,d)(k)}return d(k)}function f(k){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&C();const M=t.events.length;let D=M,O;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){O=t.events[D][1].end;break}T(r);let N=M;for(;N<t.events.length;)t.events[N][1].end={...O},N++;return ai(t.events,D+1,0,t.events.slice(M)),t.events.length=N,d(k)}return c(k)}function d(k){if(r===n.length){if(!o)return y(k);if(o.currentConstruct&&o.currentConstruct.concrete)return x(k);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(pk,m,h)(k)}function m(k){return o&&C(),T(r),y(k)}function h(k){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,x(k)}function y(k){return t.containerState={},e.attempt(pk,g,x)(k)}function g(k){return r++,n.push([t.currentConstruct,t.containerState]),y(k)}function x(k){if(k===null){o&&C(),T(0),e.consume(k);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:a}),E(k)}function E(k){if(k===null){R(e.exit("chunkFlow"),!0),T(0),e.consume(k);return}return xt(k)?(e.consume(k),R(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(k),E)}function R(k,M){const D=t.sliceStream(k);if(M&&D.push(null),k.previous=a,a&&(a.next=k),a=k,o.defineSkip(k.start),o.write(D),t.parser.lazy[k.start.line]){let O=o.events.length;for(;O--;)if(o.events[O][1].start.offset<l&&(!o.events[O][1].end||o.events[O][1].end.offset>l))return;const N=t.events.length;let _=N,q,F;for(;_--;)if(t.events[_][0]==="exit"&&t.events[_][1].type==="chunkFlow"){if(q){F=t.events[_][1].end;break}q=!0}for(T(r),O=N;O<t.events.length;)t.events[O][1].end={...F},O++;ai(t.events,_+1,0,t.events.slice(N)),t.events.length=O}}function T(k){let M=n.length;for(;M-- >k;){const D=n[M];t.containerState=D[1],D[0].exit.call(t,e)}n.length=k}function C(){o.write([null]),a=void 0,o=void 0,t.containerState._closeFlow=void 0}}function E$(e,t,n){return ln(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Oc(e){if(e===null||Tn(e)||rl(e))return 1;if(Dm(e))return 2}function _m(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const a=e[o].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const hx={name:"attention",resolveAll:T$,tokenize:R$};function T$(e,t){let n=-1,r,o,a,l,c,f,d,m;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;f=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},y={...e[n][1].start};mk(h,-f),mk(y,f),l={type:f>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},c={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},a={type:f>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},o={type:f>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},e[r][1].end={...l.start},e[n][1].start={...c.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=Si(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=Si(d,[["enter",o,t],["enter",l,t],["exit",l,t],["enter",a,t]]),d=Si(d,_m(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=Si(d,[["exit",a,t],["enter",c,t],["exit",c,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,d=Si(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,ai(e,r-1,n-r+3,d),n=r+d.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function R$(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=Oc(r);let a;return l;function l(f){return a=f,e.enter("attentionSequence"),c(f)}function c(f){if(f===a)return e.consume(f),c;const d=e.exit("attentionSequence"),m=Oc(f),h=!m||m===2&&o||n.includes(f),y=!o||o===2&&m||n.includes(r);return d._open=!!(a===42?h:h&&(o||!y)),d._close=!!(a===42?y:y&&(m||!h)),t(f)}}function mk(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const C$={name:"autolink",tokenize:k$};function k$(e,t,n){let r=0;return o;function o(g){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(g){return Mr(g)?(e.consume(g),l):g===64?n(g):d(g)}function l(g){return g===43||g===45||g===46||Sr(g)?(r=1,c(g)):d(g)}function c(g){return g===58?(e.consume(g),r=0,f):(g===43||g===45||g===46||Sr(g))&&r++<32?(e.consume(g),c):(r=0,d(g))}function f(g){return g===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):g===null||g===32||g===60||Vp(g)?n(g):(e.consume(g),f)}function d(g){return g===64?(e.consume(g),m):g$(g)?(e.consume(g),d):n(g)}function m(g){return Sr(g)?h(g):n(g)}function h(g){return g===46?(e.consume(g),r=0,m):g===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):y(g)}function y(g){if((g===45||Sr(g))&&r++<63){const x=g===45?y:h;return e.consume(g),x}return n(g)}}const uf={partial:!0,tokenize:M$};function M$(e,t,n){return r;function r(a){return Xt(a)?ln(e,o,"linePrefix")(a):o(a)}function o(a){return a===null||xt(a)?t(a):n(a)}}const lA={continuation:{tokenize:N$},exit:A$,name:"blockQuote",tokenize:O$};function O$(e,t,n){const r=this;return o;function o(l){if(l===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),a}return n(l)}function a(l){return Xt(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function N$(e,t,n){const r=this;return o;function o(l){return Xt(l)?ln(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(lA,t,n)(l)}}function A$(e){e.exit("blockQuote")}const cA={name:"characterEscape",tokenize:D$};function D$(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),o}function o(a){return b$(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const uA={name:"characterReference",tokenize:_$};function _$(e,t,n){const r=this;let o=0,a,l;return c;function c(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),f}function f(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),a=31,l=Sr,m(h))}function d(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,l=y$,m):(e.enter("characterReferenceValue"),a=7,l=fx,m(h))}function m(h){if(h===59&&o){const y=e.exit("characterReferenceValue");return l===Sr&&!s0(r.sliceSerialize(y))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(h)&&o++<a?(e.consume(h),m):n(h)}}const gk={partial:!0,tokenize:P$},yk={concrete:!0,name:"codeFenced",tokenize:I$};function I$(e,t,n){const r=this,o={partial:!0,tokenize:D};let a=0,l=0,c;return f;function f(O){return d(O)}function d(O){const N=r.events[r.events.length-1];return a=N&&N[1].type==="linePrefix"?N[2].sliceSerialize(N[1],!0).length:0,c=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(O)}function m(O){return O===c?(l++,e.consume(O),m):l<3?n(O):(e.exit("codeFencedFenceSequence"),Xt(O)?ln(e,h,"whitespace")(O):h(O))}function h(O){return O===null||xt(O)?(e.exit("codeFencedFence"),r.interrupt?t(O):e.check(gk,E,M)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(O))}function y(O){return O===null||xt(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(O)):Xt(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ln(e,g,"whitespace")(O)):O===96&&O===c?n(O):(e.consume(O),y)}function g(O){return O===null||xt(O)?h(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(O))}function x(O){return O===null||xt(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(O)):O===96&&O===c?n(O):(e.consume(O),x)}function E(O){return e.attempt(o,M,R)(O)}function R(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),T}function T(O){return a>0&&Xt(O)?ln(e,C,"linePrefix",a+1)(O):C(O)}function C(O){return O===null||xt(O)?e.check(gk,E,M)(O):(e.enter("codeFlowValue"),k(O))}function k(O){return O===null||xt(O)?(e.exit("codeFlowValue"),C(O)):(e.consume(O),k)}function M(O){return e.exit("codeFenced"),t(O)}function D(O,N,_){let q=0;return F;function F(B){return O.enter("lineEnding"),O.consume(B),O.exit("lineEnding"),G}function G(B){return O.enter("codeFencedFence"),Xt(B)?ln(O,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):P(B)}function P(B){return B===c?(O.enter("codeFencedFenceSequence"),U(B)):_(B)}function U(B){return B===c?(q++,O.consume(B),U):q>=l?(O.exit("codeFencedFenceSequence"),Xt(B)?ln(O,H,"whitespace")(B):H(B)):_(B)}function H(B){return B===null||xt(B)?(O.exit("codeFencedFence"),N(B)):_(B)}}}function P$(e,t,n){const r=this;return o;function o(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const $b={name:"codeIndented",tokenize:j$},L$={partial:!0,tokenize:z$};function j$(e,t,n){const r=this;return o;function o(d){return e.enter("codeIndented"),ln(e,a,"linePrefix",5)(d)}function a(d){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(d):n(d)}function l(d){return d===null?f(d):xt(d)?e.attempt(L$,l,f)(d):(e.enter("codeFlowValue"),c(d))}function c(d){return d===null||xt(d)?(e.exit("codeFlowValue"),l(d)):(e.consume(d),c)}function f(d){return e.exit("codeIndented"),t(d)}}function z$(e,t,n){const r=this;return o;function o(l){return r.parser.lazy[r.now().line]?n(l):xt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):ln(e,a,"linePrefix",5)(l)}function a(l){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):xt(l)?o(l):n(l)}}const F$={name:"codeText",previous:U$,resolve:B$,tokenize:H$};function B$(e){let t=e.length-4,n=3,r,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)o===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(o=r):(r===t||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),t-=r-o-2,r=o+2),o=void 0);return e}function U$(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function H$(e,t,n){let r=0,o,a;return l;function l(h){return e.enter("codeText"),e.enter("codeTextSequence"),c(h)}function c(h){return h===96?(e.consume(h),r++,c):(e.exit("codeTextSequence"),f(h))}function f(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),f):h===96?(a=e.enter("codeTextSequence"),o=0,m(h)):xt(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("codeTextData"),d(h))}function d(h){return h===null||h===32||h===96||xt(h)?(e.exit("codeTextData"),f(h)):(e.consume(h),d)}function m(h){return h===96?(e.consume(h),o++,m):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(a.type="codeTextData",d(h))}}class q${constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const o=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&Xu(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Xu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Xu(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Xu(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Xu(this.left,n.reverse())}}}function Xu(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function dA(e){const t={};let n=-1,r,o,a,l,c,f,d;const m=new q$(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(r=m.get(n),n&&r[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(f=r[1]._tokenizer.events,a=0,a<f.length&&f[a][1].type==="lineEndingBlank"&&(a+=2),a<f.length&&f[a][1].type==="content"))for(;++a<f.length&&f[a][1].type!=="content";)f[a][1].type==="chunkText"&&(f[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,V$(m,n)),n=t[n],d=!0);else if(r[1]._container){for(a=n,o=void 0;a--;)if(l=m.get(a),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(o&&(m.get(o)[1].type="lineEndingBlank"),l[1].type="lineEnding",o=a);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;o&&(r[1].end={...m.get(o)[1].start},c=m.slice(o,n),c.unshift(r),m.splice(o,n-o+1,c))}}return ai(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!d}function V$(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const a=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const c=l.events,f=[],d={};let m,h,y=-1,g=n,x=0,E=0;const R=[E];for(;g;){for(;e.get(++o)[1]!==g;);a.push(o),g._tokenizer||(m=r.sliceStream(g),g.next||m.push(null),h&&l.defineSkip(g.start),g._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(m),g._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),h=g,g=g.next}for(g=n;++y<c.length;)c[y][0]==="exit"&&c[y-1][0]==="enter"&&c[y][1].type===c[y-1][1].type&&c[y][1].start.line!==c[y][1].end.line&&(E=y+1,R.push(E),g._tokenizer=void 0,g.previous=void 0,g=g.next);for(l.events=[],g?(g._tokenizer=void 0,g.previous=void 0):R.pop(),y=R.length;y--;){const T=c.slice(R[y],R[y+1]),C=a.pop();f.push([C,C+T.length-1]),e.splice(C,2,T)}for(f.reverse(),y=-1;++y<f.length;)d[x+f[y][0]]=x+f[y][1],x+=f[y][1]-f[y][0]-1;return d}const $$={resolve:Y$,tokenize:K$},G$={partial:!0,tokenize:W$};function Y$(e){return dA(e),e}function K$(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(c)}function o(c){return c===null?a(c):xt(c)?e.check(G$,l,a)(c):(e.consume(c),o)}function a(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function l(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}function W$(e,t,n){const r=this;return o;function o(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),ln(e,a,"linePrefix")}function a(l){if(l===null||xt(l))return n(l);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function fA(e,t,n,r,o,a,l,c,f){const d=f||Number.POSITIVE_INFINITY;let m=0;return h;function h(T){return T===60?(e.enter(r),e.enter(o),e.enter(a),e.consume(T),e.exit(a),y):T===null||T===32||T===41||Vp(T)?n(T):(e.enter(r),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),E(T))}function y(T){return T===62?(e.enter(a),e.consume(T),e.exit(a),e.exit(o),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),g(T))}function g(T){return T===62?(e.exit("chunkString"),e.exit(c),y(T)):T===null||T===60||xt(T)?n(T):(e.consume(T),T===92?x:g)}function x(T){return T===60||T===62||T===92?(e.consume(T),g):g(T)}function E(T){return!m&&(T===null||T===41||Tn(T))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(r),t(T)):m<d&&T===40?(e.consume(T),m++,E):T===41?(e.consume(T),m--,E):T===null||T===32||T===40||Vp(T)?n(T):(e.consume(T),T===92?R:E)}function R(T){return T===40||T===41||T===92?(e.consume(T),E):E(T)}}function hA(e,t,n,r,o,a){const l=this;let c=0,f;return d;function d(g){return e.enter(r),e.enter(o),e.consume(g),e.exit(o),e.enter(a),m}function m(g){return c>999||g===null||g===91||g===93&&!f||g===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(g):g===93?(e.exit(a),e.enter(o),e.consume(g),e.exit(o),e.exit(r),t):xt(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===null||g===91||g===93||xt(g)||c++>999?(e.exit("chunkString"),m(g)):(e.consume(g),f||(f=!Xt(g)),g===92?y:h)}function y(g){return g===91||g===92||g===93?(e.consume(g),c++,h):h(g)}}function pA(e,t,n,r,o,a){let l;return c;function c(y){return y===34||y===39||y===40?(e.enter(r),e.enter(o),e.consume(y),e.exit(o),l=y===40?41:y,f):n(y)}function f(y){return y===l?(e.enter(o),e.consume(y),e.exit(o),e.exit(r),t):(e.enter(a),d(y))}function d(y){return y===l?(e.exit(a),f(l)):y===null?n(y):xt(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),ln(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===l||y===null||xt(y)?(e.exit("chunkString"),d(y)):(e.consume(y),y===92?h:m)}function h(y){return y===l||y===92?(e.consume(y),m):m(y)}}function md(e,t){let n;return r;function r(o){return xt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):Xt(o)?ln(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const X$={name:"definition",tokenize:Z$},Q$={partial:!0,tokenize:J$};function Z$(e,t,n){const r=this;let o;return a;function a(g){return e.enter("definition"),l(g)}function l(g){return hA.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function c(g){return o=Ui(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),f):n(g)}function f(g){return Tn(g)?md(e,d)(g):d(g)}function d(g){return fA(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function m(g){return e.attempt(Q$,h,h)(g)}function h(g){return Xt(g)?ln(e,y,"whitespace")(g):y(g)}function y(g){return g===null||xt(g)?(e.exit("definition"),r.parser.defined.push(o),t(g)):n(g)}}function J$(e,t,n){return r;function r(c){return Tn(c)?md(e,o)(c):n(c)}function o(c){return pA(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function a(c){return Xt(c)?ln(e,l,"whitespace")(c):l(c)}function l(c){return c===null||xt(c)?t(c):n(c)}}const eG={name:"hardBreakEscape",tokenize:tG};function tG(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),o}function o(a){return xt(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const nG={name:"headingAtx",resolve:rG,tokenize:iG};function rG(e,t){let n=e.length-2,r=3,o,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ai(e,r,n-r+1,[["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t]])),e}function iG(e,t,n){let r=0;return o;function o(m){return e.enter("atxHeading"),a(m)}function a(m){return e.enter("atxHeadingSequence"),l(m)}function l(m){return m===35&&r++<6?(e.consume(m),l):m===null||Tn(m)?(e.exit("atxHeadingSequence"),c(m)):n(m)}function c(m){return m===35?(e.enter("atxHeadingSequence"),f(m)):m===null||xt(m)?(e.exit("atxHeading"),t(m)):Xt(m)?ln(e,c,"whitespace")(m):(e.enter("atxHeadingText"),d(m))}function f(m){return m===35?(e.consume(m),f):(e.exit("atxHeadingSequence"),c(m))}function d(m){return m===null||m===35||Tn(m)?(e.exit("atxHeadingText"),c(m)):(e.consume(m),d)}}const oG=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],bk=["pre","script","style","textarea"],aG={concrete:!0,name:"htmlFlow",resolveTo:cG,tokenize:uG},sG={partial:!0,tokenize:fG},lG={partial:!0,tokenize:dG};function cG(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function uG(e,t,n){const r=this;let o,a,l,c,f;return d;function d(I){return m(I)}function m(I){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(I),h}function h(I){return I===33?(e.consume(I),y):I===47?(e.consume(I),a=!0,E):I===63?(e.consume(I),o=3,r.interrupt?t:L):Mr(I)?(e.consume(I),l=String.fromCharCode(I),R):n(I)}function y(I){return I===45?(e.consume(I),o=2,g):I===91?(e.consume(I),o=5,c=0,x):Mr(I)?(e.consume(I),o=4,r.interrupt?t:L):n(I)}function g(I){return I===45?(e.consume(I),r.interrupt?t:L):n(I)}function x(I){const Q="CDATA[";return I===Q.charCodeAt(c++)?(e.consume(I),c===Q.length?r.interrupt?t:P:x):n(I)}function E(I){return Mr(I)?(e.consume(I),l=String.fromCharCode(I),R):n(I)}function R(I){if(I===null||I===47||I===62||Tn(I)){const Q=I===47,le=l.toLowerCase();return!Q&&!a&&bk.includes(le)?(o=1,r.interrupt?t(I):P(I)):oG.includes(l.toLowerCase())?(o=6,Q?(e.consume(I),T):r.interrupt?t(I):P(I)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(I):a?C(I):k(I))}return I===45||Sr(I)?(e.consume(I),l+=String.fromCharCode(I),R):n(I)}function T(I){return I===62?(e.consume(I),r.interrupt?t:P):n(I)}function C(I){return Xt(I)?(e.consume(I),C):F(I)}function k(I){return I===47?(e.consume(I),F):I===58||I===95||Mr(I)?(e.consume(I),M):Xt(I)?(e.consume(I),k):F(I)}function M(I){return I===45||I===46||I===58||I===95||Sr(I)?(e.consume(I),M):D(I)}function D(I){return I===61?(e.consume(I),O):Xt(I)?(e.consume(I),D):k(I)}function O(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),f=I,N):Xt(I)?(e.consume(I),O):_(I)}function N(I){return I===f?(e.consume(I),f=null,q):I===null||xt(I)?n(I):(e.consume(I),N)}function _(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||Tn(I)?D(I):(e.consume(I),_)}function q(I){return I===47||I===62||Xt(I)?k(I):n(I)}function F(I){return I===62?(e.consume(I),G):n(I)}function G(I){return I===null||xt(I)?P(I):Xt(I)?(e.consume(I),G):n(I)}function P(I){return I===45&&o===2?(e.consume(I),j):I===60&&o===1?(e.consume(I),z):I===62&&o===4?(e.consume(I),$):I===63&&o===3?(e.consume(I),L):I===93&&o===5?(e.consume(I),K):xt(I)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(sG,W,U)(I)):I===null||xt(I)?(e.exit("htmlFlowData"),U(I)):(e.consume(I),P)}function U(I){return e.check(lG,H,W)(I)}function H(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),B}function B(I){return I===null||xt(I)?U(I):(e.enter("htmlFlowData"),P(I))}function j(I){return I===45?(e.consume(I),L):P(I)}function z(I){return I===47?(e.consume(I),l="",V):P(I)}function V(I){if(I===62){const Q=l.toLowerCase();return bk.includes(Q)?(e.consume(I),$):P(I)}return Mr(I)&&l.length<8?(e.consume(I),l+=String.fromCharCode(I),V):P(I)}function K(I){return I===93?(e.consume(I),L):P(I)}function L(I){return I===62?(e.consume(I),$):I===45&&o===2?(e.consume(I),L):P(I)}function $(I){return I===null||xt(I)?(e.exit("htmlFlowData"),W(I)):(e.consume(I),$)}function W(I){return e.exit("htmlFlow"),t(I)}}function dG(e,t,n){const r=this;return o;function o(l){return xt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):n(l)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function fG(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(uf,t,n)}}const hG={name:"htmlText",tokenize:pG};function pG(e,t,n){const r=this;let o,a,l;return c;function c(L){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(L),f}function f(L){return L===33?(e.consume(L),d):L===47?(e.consume(L),D):L===63?(e.consume(L),k):Mr(L)?(e.consume(L),_):n(L)}function d(L){return L===45?(e.consume(L),m):L===91?(e.consume(L),a=0,x):Mr(L)?(e.consume(L),C):n(L)}function m(L){return L===45?(e.consume(L),g):n(L)}function h(L){return L===null?n(L):L===45?(e.consume(L),y):xt(L)?(l=h,z(L)):(e.consume(L),h)}function y(L){return L===45?(e.consume(L),g):h(L)}function g(L){return L===62?j(L):L===45?y(L):h(L)}function x(L){const $="CDATA[";return L===$.charCodeAt(a++)?(e.consume(L),a===$.length?E:x):n(L)}function E(L){return L===null?n(L):L===93?(e.consume(L),R):xt(L)?(l=E,z(L)):(e.consume(L),E)}function R(L){return L===93?(e.consume(L),T):E(L)}function T(L){return L===62?j(L):L===93?(e.consume(L),T):E(L)}function C(L){return L===null||L===62?j(L):xt(L)?(l=C,z(L)):(e.consume(L),C)}function k(L){return L===null?n(L):L===63?(e.consume(L),M):xt(L)?(l=k,z(L)):(e.consume(L),k)}function M(L){return L===62?j(L):k(L)}function D(L){return Mr(L)?(e.consume(L),O):n(L)}function O(L){return L===45||Sr(L)?(e.consume(L),O):N(L)}function N(L){return xt(L)?(l=N,z(L)):Xt(L)?(e.consume(L),N):j(L)}function _(L){return L===45||Sr(L)?(e.consume(L),_):L===47||L===62||Tn(L)?q(L):n(L)}function q(L){return L===47?(e.consume(L),j):L===58||L===95||Mr(L)?(e.consume(L),F):xt(L)?(l=q,z(L)):Xt(L)?(e.consume(L),q):j(L)}function F(L){return L===45||L===46||L===58||L===95||Sr(L)?(e.consume(L),F):G(L)}function G(L){return L===61?(e.consume(L),P):xt(L)?(l=G,z(L)):Xt(L)?(e.consume(L),G):q(L)}function P(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),o=L,U):xt(L)?(l=P,z(L)):Xt(L)?(e.consume(L),P):(e.consume(L),H)}function U(L){return L===o?(e.consume(L),o=void 0,B):L===null?n(L):xt(L)?(l=U,z(L)):(e.consume(L),U)}function H(L){return L===null||L===34||L===39||L===60||L===61||L===96?n(L):L===47||L===62||Tn(L)?q(L):(e.consume(L),H)}function B(L){return L===47||L===62||Tn(L)?q(L):n(L)}function j(L){return L===62?(e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),t):n(L)}function z(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),V}function V(L){return Xt(L)?ln(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):K(L)}function K(L){return e.enter("htmlTextData"),l(L)}}const l0={name:"labelEnd",resolveAll:bG,resolveTo:vG,tokenize:xG},mG={tokenize:wG},gG={tokenize:SG},yG={tokenize:EG};function bG(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const o=r.type==="labelImage"?4:2;r.type="data",t+=o}}return e.length!==n.length&&ai(e,0,e.length,n),e}function vG(e,t){let n=e.length,r=0,o,a,l,c;for(;n--;)if(o=e[n][1],a){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(a=n,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(l=n);const f={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[a][1].start},end:{...e[l][1].end}},m={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[l-2][1].start}};return c=[["enter",f,t],["enter",d,t]],c=Si(c,e.slice(a+1,a+r+3)),c=Si(c,[["enter",m,t]]),c=Si(c,_m(t.parser.constructs.insideSpan.null,e.slice(a+r+4,l-3),t)),c=Si(c,[["exit",m,t],e[l-2],e[l-1],["exit",d,t]]),c=Si(c,e.slice(l+1)),c=Si(c,[["exit",f,t]]),ai(e,a,e.length,c),e}function xG(e,t,n){const r=this;let o=r.events.length,a,l;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){a=r.events[o][1];break}return c;function c(y){return a?a._inactive?h(y):(l=r.parser.defined.includes(Ui(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),f):n(y)}function f(y){return y===40?e.attempt(mG,m,l?m:h)(y):y===91?e.attempt(gG,m,l?d:h)(y):l?m(y):h(y)}function d(y){return e.attempt(yG,m,h)(y)}function m(y){return t(y)}function h(y){return a._balanced=!0,n(y)}}function wG(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),o}function o(h){return Tn(h)?md(e,a)(h):a(h)}function a(h){return h===41?m(h):fA(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function l(h){return Tn(h)?md(e,f)(h):m(h)}function c(h){return n(h)}function f(h){return h===34||h===39||h===40?pA(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):m(h)}function d(h){return Tn(h)?md(e,m)(h):m(h)}function m(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function SG(e,t,n){const r=this;return o;function o(c){return hA.call(r,e,a,l,"reference","referenceMarker","referenceString")(c)}function a(c){return r.parser.defined.includes(Ui(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function EG(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),o}function o(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const TG={name:"labelStartImage",resolveAll:l0.resolveAll,tokenize:RG};function RG(e,t,n){const r=this;return o;function o(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),a}function a(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const CG={name:"labelStartLink",resolveAll:l0.resolveAll,tokenize:kG};function kG(e,t,n){const r=this;return o;function o(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),a}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const Gb={name:"lineEnding",tokenize:MG};function MG(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ln(e,t,"linePrefix")}}const gp={name:"thematicBreak",tokenize:OG};function OG(e,t,n){let r=0,o;return a;function a(d){return e.enter("thematicBreak"),l(d)}function l(d){return o=d,c(d)}function c(d){return d===o?(e.enter("thematicBreakSequence"),f(d)):r>=3&&(d===null||xt(d))?(e.exit("thematicBreak"),t(d)):n(d)}function f(d){return d===o?(e.consume(d),r++,f):(e.exit("thematicBreakSequence"),Xt(d)?ln(e,c,"whitespace")(d):c(d))}}const jr={continuation:{tokenize:_G},exit:PG,name:"list",tokenize:DG},NG={partial:!0,tokenize:LG},AG={partial:!0,tokenize:IG};function DG(e,t,n){const r=this,o=r.events[r.events.length-1];let a=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,l=0;return c;function c(g){const x=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:fx(g)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(gp,n,d)(g):d(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(g)}return n(g)}function f(g){return fx(g)&&++l<10?(e.consume(g),f):(!r.interrupt||l<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),d(g)):n(g)}function d(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(uf,r.interrupt?n:m,e.attempt(NG,y,h))}function m(g){return r.containerState.initialBlankLine=!0,a++,y(g)}function h(g){return Xt(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),y):n(g)}function y(g){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function _G(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(uf,o,a);function o(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ln(e,t,"listItemIndent",r.containerState.size+1)(c)}function a(c){return r.containerState.furtherBlankLines||!Xt(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(AG,t,l)(c))}function l(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,ln(e,e.attempt(jr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function IG(e,t,n){const r=this;return ln(e,o,"listItemIndent",r.containerState.size+1);function o(a){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(a):n(a)}}function PG(e){e.exit(this.containerState.type)}function LG(e,t,n){const r=this;return ln(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(a){const l=r.events[r.events.length-1];return!Xt(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const vk={name:"setextUnderline",resolveTo:jG,tokenize:zG};function jG(e,t){let n=e.length,r,o,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",a?(e.splice(o,0,["enter",l,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function zG(e,t,n){const r=this;let o;return a;function a(d){let m=r.events.length,h;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){h=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),o=d,l(d)):n(d)}function l(d){return e.enter("setextHeadingLineSequence"),c(d)}function c(d){return d===o?(e.consume(d),c):(e.exit("setextHeadingLineSequence"),Xt(d)?ln(e,f,"lineSuffix")(d):f(d))}function f(d){return d===null||xt(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const FG={tokenize:BG};function BG(e){const t=this,n=e.attempt(uf,r,e.attempt(this.parser.constructs.flowInitial,o,ln(e,e.attempt(this.parser.constructs.flow,o,e.attempt($$,o)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const UG={resolveAll:gA()},HG=mA("string"),qG=mA("text");function mA(e){return{resolveAll:gA(e==="text"?VG:void 0),tokenize:t};function t(n){const r=this,o=this.parser.constructs[e],a=n.attempt(o,l,c);return l;function l(m){return d(m)?a(m):c(m)}function c(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),f}function f(m){return d(m)?(n.exit("data"),a(m)):(n.consume(m),f)}function d(m){if(m===null)return!0;const h=o[m];let y=-1;if(h)for(;++y<h.length;){const g=h[y];if(!g.previous||g.previous.call(r,r.previous))return!0}return!1}}}function gA(e){return t;function t(n,r){let o=-1,a;for(;++o<=n.length;)a===void 0?n[o]&&n[o][1].type==="data"&&(a=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==a+2&&(n[a][1].end=n[o-1][1].end,n.splice(a+2,o-a-2),o=a+2),a=void 0);return e?e(n,r):n}}function VG(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],o=t.sliceStream(r);let a=o.length,l=-1,c=0,f;for(;a--;){const d=o[a];if(typeof d=="string"){for(l=d.length;d.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(d===-2)f=!0,c++;else if(d!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const d={type:n===e.length||f||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:r.start._bufferIndex+l,_index:r.start._index+a,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const $G={42:jr,43:jr,45:jr,48:jr,49:jr,50:jr,51:jr,52:jr,53:jr,54:jr,55:jr,56:jr,57:jr,62:lA},GG={91:X$},YG={[-2]:$b,[-1]:$b,32:$b},KG={35:nG,42:gp,45:[vk,gp],60:aG,61:vk,95:gp,96:yk,126:yk},WG={38:uA,92:cA},XG={[-5]:Gb,[-4]:Gb,[-3]:Gb,33:TG,38:uA,42:hx,60:[C$,hG],91:CG,92:[eG,cA],93:l0,95:hx,96:F$},QG={null:[hx,UG]},ZG={null:[42,95]},JG={null:[]},eY=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:ZG,contentInitial:GG,disable:JG,document:$G,flow:KG,flowInitial:YG,insideSpan:QG,string:WG,text:XG},Symbol.toStringTag,{value:"Module"}));function tY(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},a=[];let l=[],c=[];const f={attempt:N(D),check:N(O),consume:C,enter:k,exit:M,interrupt:N(O,{interrupt:!0})},d={code:null,containerState:{},defineSkip:E,events:[],now:x,parser:e,previous:null,sliceSerialize:y,sliceStream:g,write:h};let m=t.tokenize.call(d,f);return t.resolveAll&&a.push(t),d;function h(G){return l=Si(l,G),R(),l[l.length-1]!==null?[]:(_(t,0),d.events=_m(a,d.events,d),d.events)}function y(G,P){return rY(g(G),P)}function g(G){return nY(l,G)}function x(){const{_bufferIndex:G,_index:P,line:U,column:H,offset:B}=r;return{_bufferIndex:G,_index:P,line:U,column:H,offset:B}}function E(G){o[G.line]=G.column,F()}function R(){let G;for(;r._index<l.length;){const P=l[r._index];if(typeof P=="string")for(G=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===G&&r._bufferIndex<P.length;)T(P.charCodeAt(r._bufferIndex));else T(P)}}function T(G){m=m(G)}function C(G){xt(G)?(r.line++,r.column=1,r.offset+=G===-3?2:1,F()):G!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=G}function k(G,P){const U=P||{};return U.type=G,U.start=x(),d.events.push(["enter",U,d]),c.push(U),U}function M(G){const P=c.pop();return P.end=x(),d.events.push(["exit",P,d]),P}function D(G,P){_(G,P.from)}function O(G,P){P.restore()}function N(G,P){return U;function U(H,B,j){let z,V,K,L;return Array.isArray(H)?W(H):"tokenize"in H?W([H]):$(H);function $(oe){return Z;function Z(ue){const ve=ue!==null&&oe[ue],Se=ue!==null&&oe.null,Pe=[...Array.isArray(ve)?ve:ve?[ve]:[],...Array.isArray(Se)?Se:Se?[Se]:[]];return W(Pe)(ue)}}function W(oe){return z=oe,V=0,oe.length===0?j:I(oe[V])}function I(oe){return Z;function Z(ue){return L=q(),K=oe,oe.partial||(d.currentConstruct=oe),oe.name&&d.parser.constructs.disable.null.includes(oe.name)?le():oe.tokenize.call(P?Object.assign(Object.create(d),P):d,f,Q,le)(ue)}}function Q(oe){return G(K,L),B}function le(oe){return L.restore(),++V<z.length?I(z[V]):j}}}function _(G,P){G.resolveAll&&!a.includes(G)&&a.push(G),G.resolve&&ai(d.events,P,d.events.length-P,G.resolve(d.events.slice(P),d)),G.resolveTo&&(d.events=G.resolveTo(d.events,d))}function q(){const G=x(),P=d.previous,U=d.currentConstruct,H=d.events.length,B=Array.from(c);return{from:H,restore:j};function j(){r=G,d.previous=P,d.currentConstruct=U,d.events.length=H,c=B,F()}}function F(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function nY(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,a=t.end._bufferIndex;let l;if(n===o)l=[e[n].slice(r,a)];else{if(l=e.slice(n,o),r>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(r):l.shift()}a>0&&l.push(e[o].slice(0,a))}return l}function rY(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const a=e[n];let l;if(typeof a=="string")l=a;else switch(a){case-5:{l="\r";break}case-4:{l=`
|
|
446
|
+
`;break}case-3:{l=`\r
|
|
447
|
+
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&o)continue;l=" ";break}default:l=String.fromCharCode(a)}o=a===-2,r.push(l)}return r.join("")}function iY(e){const r={constructs:aA([eY,...(e||{}).extensions||[]]),content:o(v$),defined:[],document:o(w$),flow:o(FG),lazy:{},string:o(HG),text:o(qG)};return r;function o(a){return l;function l(c){return tY(r,a,c)}}}function oY(e){for(;!dA(e););return e}const xk=/[\0\t\n\r]/g;function aY(){let e=1,t="",n=!0,r;return o;function o(a,l,c){const f=[];let d,m,h,y,g;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),h=0,t="",n&&(a.charCodeAt(0)===65279&&h++,n=void 0);h<a.length;){if(xk.lastIndex=h,d=xk.exec(a),y=d&&d.index!==void 0?d.index:a.length,g=a.charCodeAt(y),!d){t=a.slice(h);break}if(g===10&&h===y&&r)f.push(-3),r=void 0;else switch(r&&(f.push(-5),r=void 0),h<y&&(f.push(a.slice(h,y)),e+=y-h),g){case 0:{f.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,f.push(-2);e++<m;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:r=!0,e=1}h=y+1}return c&&(r&&f.push(-5),t&&f.push(t),f.push(null)),f}}const sY=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function lY(e){return e.replace(sY,cY)}function cY(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),a=o===120||o===88;return sA(n.slice(a?2:1),a?16:10)}return s0(n)||e}const yA={}.hasOwnProperty;function uY(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),dY(n)(oY(iY(n).document().write(aY()(e,t,!0))))}function dY(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(J),autolinkProtocol:q,autolinkEmail:q,atxHeading:a(Le),blockQuote:a(Se),characterEscape:q,characterReference:q,codeFenced:a(Pe),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(Pe,l),codeText:a(te,l),codeTextData:q,data:q,codeFlowValue:q,definition:a(he),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(ye),hardBreakEscape:a(Oe),hardBreakTrailing:a(Oe),htmlFlow:a(Te,l),htmlFlowData:q,htmlText:a(Te,l),htmlTextData:q,image:a(Ce),label:l,link:a(J),listItem:a(xe),listItemValue:y,listOrdered:a(Ee,h),listUnordered:a(Ee),paragraph:a(Be),reference:I,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(Le),strong:a(Ve),thematicBreak:a(ut)},exit:{atxHeading:f(),atxHeadingSequence:D,autolink:f(),autolinkEmail:ve,autolinkProtocol:ue,blockQuote:f(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:le,characterReferenceMarkerNumeric:le,characterReferenceValue:oe,characterReference:Z,codeFenced:f(R),codeFencedFence:E,codeFencedFenceInfo:g,codeFencedFenceMeta:x,codeFlowValue:F,codeIndented:f(T),codeText:f(B),codeTextData:F,data:F,definition:f(),definitionDestinationString:M,definitionLabelString:C,definitionTitleString:k,emphasis:f(),hardBreakEscape:f(P),hardBreakTrailing:f(P),htmlFlow:f(U),htmlFlowData:F,htmlText:f(H),htmlTextData:F,image:f(z),label:K,labelText:V,lineEnding:G,link:f(j),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:Q,resourceDestinationString:L,resourceTitleString:$,resource:W,setextHeading:f(_),setextHeadingLineSequence:N,setextHeadingText:O,strong:f(),thematicBreak:f()}};bA(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(pe){let Re={type:"root",children:[]};const ee={stack:[Re],tokenStack:[],config:t,enter:c,exit:d,buffer:l,resume:m,data:n},fe=[];let Ne=-1;for(;++Ne<pe.length;)if(pe[Ne][1].type==="listOrdered"||pe[Ne][1].type==="listUnordered")if(pe[Ne][0]==="enter")fe.push(Ne);else{const Ue=fe.pop();Ne=o(pe,Ue,Ne)}for(Ne=-1;++Ne<pe.length;){const Ue=t[pe[Ne][0]];yA.call(Ue,pe[Ne][1].type)&&Ue[pe[Ne][1].type].call(Object.assign({sliceSerialize:pe[Ne][2].sliceSerialize},ee),pe[Ne][1])}if(ee.tokenStack.length>0){const Ue=ee.tokenStack[ee.tokenStack.length-1];(Ue[1]||wk).call(ee,void 0,Ue[0])}for(Re.position={start:Ra(pe.length>0?pe[0][1].start:{line:1,column:1,offset:0}),end:Ra(pe.length>0?pe[pe.length-2][1].end:{line:1,column:1,offset:0})},Ne=-1;++Ne<t.transforms.length;)Re=t.transforms[Ne](Re)||Re;return Re}function o(pe,Re,ee){let fe=Re-1,Ne=-1,Ue=!1,$e,et,ze,Ze;for(;++fe<=ee;){const nt=pe[fe];switch(nt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{nt[0]==="enter"?Ne++:Ne--,Ze=void 0;break}case"lineEndingBlank":{nt[0]==="enter"&&($e&&!Ze&&!Ne&&!ze&&(ze=fe),Ze=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ze=void 0}if(!Ne&&nt[0]==="enter"&&nt[1].type==="listItemPrefix"||Ne===-1&&nt[0]==="exit"&&(nt[1].type==="listUnordered"||nt[1].type==="listOrdered")){if($e){let Ct=fe;for(et=void 0;Ct--;){const zt=pe[Ct];if(zt[1].type==="lineEnding"||zt[1].type==="lineEndingBlank"){if(zt[0]==="exit")continue;et&&(pe[et][1].type="lineEndingBlank",Ue=!0),zt[1].type="lineEnding",et=Ct}else if(!(zt[1].type==="linePrefix"||zt[1].type==="blockQuotePrefix"||zt[1].type==="blockQuotePrefixWhitespace"||zt[1].type==="blockQuoteMarker"||zt[1].type==="listItemIndent"))break}ze&&(!et||ze<et)&&($e._spread=!0),$e.end=Object.assign({},et?pe[et][1].start:nt[1].end),pe.splice(et||fe,0,["exit",$e,nt[2]]),fe++,ee++}if(nt[1].type==="listItemPrefix"){const Ct={type:"listItem",_spread:!1,start:Object.assign({},nt[1].start),end:void 0};$e=Ct,pe.splice(fe,0,["enter",Ct,nt[2]]),fe++,ee++,ze=void 0,Ze=!0}}}return pe[Re][1]._spread=Ue,ee}function a(pe,Re){return ee;function ee(fe){c.call(this,pe(fe),fe),Re&&Re.call(this,fe)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(pe,Re,ee){this.stack[this.stack.length-1].children.push(pe),this.stack.push(pe),this.tokenStack.push([Re,ee||void 0]),pe.position={start:Ra(Re.start),end:void 0}}function f(pe){return Re;function Re(ee){pe&&pe.call(this,ee),d.call(this,ee)}}function d(pe,Re){const ee=this.stack.pop(),fe=this.tokenStack.pop();if(fe)fe[0].type!==pe.type&&(Re?Re.call(this,pe,fe[0]):(fe[1]||wk).call(this,pe,fe[0]));else throw new Error("Cannot close `"+pe.type+"` ("+pd({start:pe.start,end:pe.end})+"): it’s not open");ee.position.end=Ra(pe.end)}function m(){return a0(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function y(pe){if(this.data.expectingFirstListItemValue){const Re=this.stack[this.stack.length-2];Re.start=Number.parseInt(this.sliceSerialize(pe),10),this.data.expectingFirstListItemValue=void 0}}function g(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.lang=pe}function x(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.meta=pe}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function R(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.value=pe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function T(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.value=pe.replace(/(\r?\n|\r)$/g,"")}function C(pe){const Re=this.resume(),ee=this.stack[this.stack.length-1];ee.label=Re,ee.identifier=Ui(this.sliceSerialize(pe)).toLowerCase()}function k(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.title=pe}function M(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.url=pe}function D(pe){const Re=this.stack[this.stack.length-1];if(!Re.depth){const ee=this.sliceSerialize(pe).length;Re.depth=ee}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function N(pe){const Re=this.stack[this.stack.length-1];Re.depth=this.sliceSerialize(pe).codePointAt(0)===61?1:2}function _(){this.data.setextHeadingSlurpLineEnding=void 0}function q(pe){const ee=this.stack[this.stack.length-1].children;let fe=ee[ee.length-1];(!fe||fe.type!=="text")&&(fe=_e(),fe.position={start:Ra(pe.start),end:void 0},ee.push(fe)),this.stack.push(fe)}function F(pe){const Re=this.stack.pop();Re.value+=this.sliceSerialize(pe),Re.position.end=Ra(pe.end)}function G(pe){const Re=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ee=Re.children[Re.children.length-1];ee.position.end=Ra(pe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Re.type)&&(q.call(this,pe),F.call(this,pe))}function P(){this.data.atHardBreak=!0}function U(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.value=pe}function H(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.value=pe}function B(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.value=pe}function j(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const Re=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=Re,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function z(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const Re=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=Re,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function V(pe){const Re=this.sliceSerialize(pe),ee=this.stack[this.stack.length-2];ee.label=lY(Re),ee.identifier=Ui(Re).toLowerCase()}function K(){const pe=this.stack[this.stack.length-1],Re=this.resume(),ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,ee.type==="link"){const fe=pe.children;ee.children=fe}else ee.alt=Re}function L(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.url=pe}function $(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.title=pe}function W(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function Q(pe){const Re=this.resume(),ee=this.stack[this.stack.length-1];ee.label=Re,ee.identifier=Ui(this.sliceSerialize(pe)).toLowerCase(),this.data.referenceType="full"}function le(pe){this.data.characterReferenceType=pe.type}function oe(pe){const Re=this.sliceSerialize(pe),ee=this.data.characterReferenceType;let fe;ee?(fe=sA(Re,ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):fe=s0(Re);const Ne=this.stack[this.stack.length-1];Ne.value+=fe}function Z(pe){const Re=this.stack.pop();Re.position.end=Ra(pe.end)}function ue(pe){F.call(this,pe);const Re=this.stack[this.stack.length-1];Re.url=this.sliceSerialize(pe)}function ve(pe){F.call(this,pe);const Re=this.stack[this.stack.length-1];Re.url="mailto:"+this.sliceSerialize(pe)}function Se(){return{type:"blockquote",children:[]}}function Pe(){return{type:"code",lang:null,meta:null,value:""}}function te(){return{type:"inlineCode",value:""}}function he(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ye(){return{type:"emphasis",children:[]}}function Le(){return{type:"heading",depth:0,children:[]}}function Oe(){return{type:"break"}}function Te(){return{type:"html",value:""}}function Ce(){return{type:"image",title:null,url:"",alt:null}}function J(){return{type:"link",title:null,url:"",children:[]}}function Ee(pe){return{type:"list",ordered:pe.type==="listOrdered",start:null,spread:pe._spread,children:[]}}function xe(pe){return{type:"listItem",spread:pe._spread,checked:null,children:[]}}function Be(){return{type:"paragraph",children:[]}}function Ve(){return{type:"strong",children:[]}}function _e(){return{type:"text",value:""}}function ut(){return{type:"thematicBreak"}}}function Ra(e){return{line:e.line,column:e.column,offset:e.offset}}function bA(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?bA(e,r):fY(e,r)}}function fY(e,t){let n;for(n in t)if(yA.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function wk(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+pd({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+pd({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+pd({start:t.start,end:t.end})+") is still open")}function hY(e){const t=this;t.parser=n;function n(r){return uY(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function pY(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function mY(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
448
|
+
`}]}function gY(e,t){const n=t.value?t.value+`
|
|
449
|
+
`:"",r={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(r.className=["language-"+o[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function yY(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bY(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vY(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=Hc(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let l,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=a+1,c+=1,e.footnoteCounts.set(r,c);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,f);const d={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,d),e.applyData(t,d)}function xY(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function wY(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function vA(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),a=o[0];a&&a.type==="text"?a.value="["+a.value:o.unshift({type:"text",value:"["});const l=o[o.length-1];return l&&l.type==="text"?l.value+=r:o.push({type:"text",value:r}),o}function SY(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return vA(e,t);const o={src:Hc(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const a={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,a),e.applyData(t,a)}function EY(e,t){const n={src:Hc(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function TY(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function RY(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return vA(e,t);const o={href:Hc(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const a={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function CY(e,t){const n={href:Hc(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function kY(e,t,n){const r=e.all(t),o=n?MY(n):xA(t),a={},l=[];if(typeof t.checked=="boolean"){const m=r[0];let h;m&&m.type==="element"&&m.tagName==="p"?h=m:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const m=r[c];(o||c!==0||m.type!=="element"||m.tagName!=="p")&&l.push({type:"text",value:`
|
|
450
|
+
`}),m.type==="element"&&m.tagName==="p"&&!o?l.push(...m.children):l.push(m)}const f=r[r.length-1];f&&(o||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
|
|
451
|
+
`});const d={type:"element",tagName:"li",properties:a,children:l};return e.patch(t,d),e.applyData(t,d)}function MY(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=xA(n[r])}return t}function xA(e){const t=e.spread;return t??e.children.length>1}function OY(e,t){const n={},r=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o<r.length;){const l=r[o];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function NY(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function AY(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function DY(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _Y(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),o.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=n0(t.children[1]),f=JN(t.children[t.children.length-1]);c&&f&&(l.position={start:c,end:f}),o.push(l)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,a),e.applyData(t,a)}function IY(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,c=l?l.length:t.children.length;let f=-1;const d=[];for(;++f<c;){const h=t.children[f],y={},g=l?l[f]:void 0;g&&(y.align=g);let x={type:"element",tagName:a,properties:y,children:[]};h&&(x.children=e.all(h),e.patch(h,x),x=e.applyData(h,x)),d.push(x)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,m),e.applyData(t,m)}function PY(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Sk=9,Ek=32;function LY(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const a=[];for(;r;)a.push(Tk(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return a.push(Tk(t.slice(o),o>0,!1)),a.join("")}function Tk(e,t,n){let r=0,o=e.length;if(t){let a=e.codePointAt(r);for(;a===Sk||a===Ek;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(o-1);for(;a===Sk||a===Ek;)o--,a=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function jY(e,t){const n={type:"text",value:LY(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function zY(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const FY={blockquote:pY,break:mY,code:gY,delete:yY,emphasis:bY,footnoteReference:vY,heading:xY,html:wY,imageReference:SY,image:EY,inlineCode:TY,linkReference:RY,link:CY,listItem:kY,list:OY,paragraph:NY,root:AY,strong:DY,table:_Y,tableCell:PY,tableRow:IY,text:jY,thematicBreak:zY,toml:Yh,yaml:Yh,definition:Yh,footnoteDefinition:Yh};function Yh(){}const wA=-1,Im=0,gd=1,$p=2,c0=3,u0=4,d0=5,f0=6,SA=7,EA=8,BY=typeof self=="object"?self:globalThis,Rk=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new BY[e](t)},UY=(e,t)=>{const n=(o,a)=>(e.set(a,o),o),r=o=>{if(e.has(o))return e.get(o);const[a,l]=t[o];switch(a){case Im:case wA:return n(l,o);case gd:{const c=n([],o);for(const f of l)c.push(r(f));return c}case $p:{const c=n({},o);for(const[f,d]of l)c[r(f)]=r(d);return c}case c0:return n(new Date(l),o);case u0:{const{source:c,flags:f}=l;return n(new RegExp(c,f),o)}case d0:{const c=n(new Map,o);for(const[f,d]of l)c.set(r(f),r(d));return c}case f0:{const c=n(new Set,o);for(const f of l)c.add(r(f));return c}case SA:{const{name:c,message:f}=l;return n(Rk(c,f),o)}case EA:return n(BigInt(l),o);case"BigInt":return n(Object(BigInt(l)),o);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:c}=new Uint8Array(l);return n(new DataView(c),l)}}return n(Rk(a,l),o)};return r},Ck=e=>UY(new Map,e)(0),$l="",{toString:HY}={},{keys:qY}=Object,Qu=e=>{const t=typeof e;if(t!=="object"||!e)return[Im,t];const n=HY.call(e).slice(8,-1);switch(n){case"Array":return[gd,$l];case"Object":return[$p,$l];case"Date":return[c0,$l];case"RegExp":return[u0,$l];case"Map":return[d0,$l];case"Set":return[f0,$l];case"DataView":return[gd,n]}return n.includes("Array")?[gd,n]:n.includes("Error")?[SA,n]:[$p,n]},Kh=([e,t])=>e===Im&&(t==="function"||t==="symbol"),VY=(e,t,n,r)=>{const o=(l,c)=>{const f=r.push(l)-1;return n.set(c,f),f},a=l=>{if(n.has(l))return n.get(l);let[c,f]=Qu(l);switch(c){case Im:{let m=l;switch(f){case"bigint":c=EA,m=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);m=null;break;case"undefined":return o([wA],l)}return o([c,m],l)}case gd:{if(f){let y=l;return f==="DataView"?y=new Uint8Array(l.buffer):f==="ArrayBuffer"&&(y=new Uint8Array(l)),o([f,[...y]],l)}const m=[],h=o([c,m],l);for(const y of l)m.push(a(y));return h}case $p:{if(f)switch(f){case"BigInt":return o([f,l.toString()],l);case"Boolean":case"Number":case"String":return o([f,l.valueOf()],l)}if(t&&"toJSON"in l)return a(l.toJSON());const m=[],h=o([c,m],l);for(const y of qY(l))(e||!Kh(Qu(l[y])))&&m.push([a(y),a(l[y])]);return h}case c0:return o([c,l.toISOString()],l);case u0:{const{source:m,flags:h}=l;return o([c,{source:m,flags:h}],l)}case d0:{const m=[],h=o([c,m],l);for(const[y,g]of l)(e||!(Kh(Qu(y))||Kh(Qu(g))))&&m.push([a(y),a(g)]);return h}case f0:{const m=[],h=o([c,m],l);for(const y of l)(e||!Kh(Qu(y)))&&m.push(a(y));return h}}const{message:d}=l;return o([c,{name:f,message:d}],l)};return a},kk=(e,{json:t,lossy:n}={})=>{const r=[];return VY(!(t||n),!!t,new Map,r)(e),r},Gp=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Ck(kk(e,t)):structuredClone(e):(e,t)=>Ck(kk(e,t));function $Y(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function GY(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function YY(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||$Y,r=e.options.footnoteBackLabel||GY,o=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let f=-1;for(;++f<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[f]);if(!d)continue;const m=e.all(d),h=String(d.identifier).toUpperCase(),y=Hc(h.toLowerCase());let g=0;const x=[],E=e.footnoteCounts.get(h);for(;E!==void 0&&++g<=E;){x.length>0&&x.push({type:"text",value:" "});let C=typeof n=="string"?n:n(f,g);typeof C=="string"&&(C={type:"text",value:C}),x.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(f,g),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const R=m[m.length-1];if(R&&R.type==="element"&&R.tagName==="p"){const C=R.children[R.children.length-1];C&&C.type==="text"?C.value+=" ":R.children.push({type:"text",value:" "}),R.children.push(...x)}else m.push(...x);const T={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(m,!0)};e.patch(d,T),c.push(T)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Gp(l),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
452
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
|
|
453
|
+
`}]}}const Pm=(function(e){if(e==null)return QY;if(typeof e=="function")return Lm(e);if(typeof e=="object")return Array.isArray(e)?KY(e):WY(e);if(typeof e=="string")return XY(e);throw new Error("Expected function, string, or object as test")});function KY(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Pm(e[n]);return Lm(r);function r(...o){let a=-1;for(;++a<t.length;)if(t[a].apply(this,o))return!0;return!1}}function WY(e){const t=e;return Lm(n);function n(r){const o=r;let a;for(a in e)if(o[a]!==t[a])return!1;return!0}}function XY(e){return Lm(t);function t(n){return n&&n.type===e}}function Lm(e){return t;function t(n,r,o){return!!(ZY(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function QY(){return!0}function ZY(e){return e!==null&&typeof e=="object"&&"type"in e}const TA=[],JY=!0,px=!1,eK="skip";function RA(e,t,n,r){let o;typeof t=="function"&&typeof n!="function"?(r=n,n=t):o=t;const a=Pm(o),l=r?-1:1;c(e,void 0,[])();function c(f,d,m){const h=f&&typeof f=="object"?f:{};if(typeof h.type=="string"){const g=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(f.type+(g?"<"+g+">":""))+")"})}return y;function y(){let g=TA,x,E,R;if((!t||a(f,d,m[m.length-1]||void 0))&&(g=tK(n(f,m)),g[0]===px))return g;if("children"in f&&f.children){const T=f;if(T.children&&g[0]!==eK)for(E=(r?T.children.length:-1)+l,R=m.concat(T);E>-1&&E<T.children.length;){const C=T.children[E];if(x=c(C,E,R)(),x[0]===px)return x;E=typeof x[1]=="number"?x[1]:E+l}}return g}}}function tK(e){return Array.isArray(e)?e:typeof e=="number"?[JY,e]:e==null?TA:[e]}function h0(e,t,n,r){let o,a,l;typeof t=="function"&&typeof n!="function"?(a=void 0,l=t,o=n):(a=t,l=n,o=r),RA(e,a,c,o);function c(f,d){const m=d[d.length-1],h=m?m.children.indexOf(f):void 0;return l(f,h,m)}}const mx={}.hasOwnProperty,nK={};function rK(e,t){const n=t||nK,r=new Map,o=new Map,a=new Map,l={...FY,...n.handlers},c={all:d,applyData:oK,definitionById:r,footnoteById:o,footnoteCounts:a,footnoteOrder:[],handlers:l,one:f,options:n,patch:iK,wrap:sK};return h0(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const h=m.type==="definition"?r:o,y=String(m.identifier).toUpperCase();h.has(y)||h.set(y,m)}}),c;function f(m,h){const y=m.type,g=c.handlers[y];if(mx.call(c.handlers,y)&&g)return g(c,m,h);if(c.options.passThrough&&c.options.passThrough.includes(y)){if("children"in m){const{children:E,...R}=m,T=Gp(R);return T.children=c.all(m),T}return Gp(m)}return(c.options.unknownHandler||aK)(c,m,h)}function d(m){const h=[];if("children"in m){const y=m.children;let g=-1;for(;++g<y.length;){const x=c.one(y[g],m);if(x){if(g&&y[g-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=Mk(x.value)),!Array.isArray(x)&&x.type==="element")){const E=x.children[0];E&&E.type==="text"&&(E.value=Mk(E.value))}Array.isArray(x)?h.push(...x):h.push(x)}}}return h}}function iK(e,t){e.position&&(t.position=$V(e))}function oK(e,t){let n=t;if(e&&e.data){const r=e.data.hName,o=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&a&&Object.assign(n.properties,Gp(a)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function aK(e,t){const n=t.data||{},r="value"in t&&!(mx.call(n,"hProperties")||mx.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function sK(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
454
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
455
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
456
|
+
`}),n}function Mk(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Ok(e,t){const n=rK(e,t),r=n.one(e,void 0),o=YY(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&a.children.push({type:"text",value:`
|
|
457
|
+
`},o),a}function lK(e,t){return e&&"run"in e?async function(n,r){const o=Ok(n,{file:r,...t});await e.run(o,r)}:function(n,r){return Ok(n,{file:r,...e||t})}}function Nk(e){if(e)throw e}var Yb,Ak;function cK(){if(Ak)return Yb;Ak=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},a=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var m=e.call(d,"constructor"),h=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!m&&!h)return!1;var y;for(y in d);return typeof y>"u"||e.call(d,y)},l=function(d,m){n&&m.name==="__proto__"?n(d,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):d[m.name]=m.newValue},c=function(d,m){if(m==="__proto__")if(e.call(d,m)){if(r)return r(d,m).value}else return;return d[m]};return Yb=function f(){var d,m,h,y,g,x,E=arguments[0],R=1,T=arguments.length,C=!1;for(typeof E=="boolean"&&(C=E,E=arguments[1]||{},R=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});R<T;++R)if(d=arguments[R],d!=null)for(m in d)h=c(E,m),y=c(d,m),E!==y&&(C&&y&&(a(y)||(g=o(y)))?(g?(g=!1,x=h&&o(h)?h:[]):x=h&&a(h)?h:{},l(E,{name:m,newValue:f(C,x,y)})):typeof y<"u"&&l(E,{name:m,newValue:y}));return E},Yb}var uK=cK();const Kb=im(uK);function gx(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function dK(){const e=[],t={run:n,use:r};return t;function n(...o){let a=-1;const l=o.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...o);function c(f,...d){const m=e[++a];let h=-1;if(f){l(f);return}for(;++h<o.length;)(d[h]===null||d[h]===void 0)&&(d[h]=o[h]);o=d,m?fK(m,c)(...d):l(null,...d)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function fK(e,t){let n;return r;function r(...l){const c=e.length>l.length;let f;c&&l.push(o);try{f=e.apply(this,l)}catch(d){const m=d;if(c&&n)throw m;return o(m)}c||(f&&f.then&&typeof f.then=="function"?f.then(a,o):f instanceof Error?o(f):a(f))}function o(l,...c){n||(n=!0,t(l,...c))}function a(l){o(null,l)}}const Ji={basename:hK,dirname:pK,extname:mK,join:gK,sep:"/"};function hK(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');df(e);let n=0,r=-1,o=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(a){n=o+1;break}}else r<0&&(a=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,c=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(a){n=o+1;break}}else l<0&&(a=!0,l=o+1),c>-1&&(e.codePointAt(o)===t.codePointAt(c--)?c<0&&(r=o):(c=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function pK(e){if(df(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function mK(e){df(e);let t=e.length,n=-1,r=0,o=-1,a=0,l;for(;t--;){const c=e.codePointAt(t);if(c===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),c===46?o<0?o=t:a!==1&&(a=1):o>-1&&(a=-1)}return o<0||n<0||a===0||a===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function gK(...e){let t=-1,n;for(;++t<e.length;)df(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":yK(n)}function yK(e){df(e);const t=e.codePointAt(0)===47;let n=bK(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function bK(e,t){let n="",r=0,o=-1,a=0,l=-1,c,f;for(;++l<=e.length;){if(l<e.length)c=e.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(o===l-1||a===1))if(o!==l-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",r=0):(n=n.slice(0,f),r=n.length-1-n.lastIndexOf("/")),o=l,a=0;continue}}else if(n.length>0){n="",r=0,o=l,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,l):n=e.slice(o+1,l),r=l-o-1;o=l,a=0}else c===46&&a>-1?a++:a=-1}return n}function df(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const vK={cwd:xK};function xK(){return"/"}function yx(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function wK(e){if(typeof e=="string")e=new URL(e);else if(!yx(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return SK(e)}function SK(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const Wb=["history","path","basename","stem","extname","dirname"];class CA{constructor(t){let n;t?yx(t)?n={path:t}:typeof t=="string"||EK(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":vK.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Wb.length;){const a=Wb[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let o;for(o in n)Wb.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?Ji.basename(this.path):void 0}set basename(t){Qb(t,"basename"),Xb(t,"basename"),this.path=Ji.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ji.dirname(this.path):void 0}set dirname(t){Dk(this.basename,"dirname"),this.path=Ji.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ji.extname(this.path):void 0}set extname(t){if(Xb(t,"extname"),Dk(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ji.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){yx(t)&&(t=wK(t)),Qb(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ji.basename(this.path,this.extname):void 0}set stem(t){Qb(t,"stem"),Xb(t,"stem"),this.path=Ji.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const o=this.message(t,n,r);throw o.fatal=!0,o}info(t,n,r){const o=this.message(t,n,r);return o.fatal=void 0,o}message(t,n,r){const o=new Er(t,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Xb(e,t){if(e&&e.includes(Ji.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ji.sep+"`")}function Qb(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Dk(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function EK(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const TK=(function(e){const r=this.constructor.prototype,o=r[e],a=function(){return o.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),RK={}.hasOwnProperty;class p0 extends TK{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=dK()}copy(){const t=new p0;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Kb(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(ev("data",this.frozen),this.namespace[t]=n,this):RK.call(this.namespace,t)&&this.namespace[t]||void 0:t?(ev("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const o=n.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Wh(t),r=this.parser||this.Parser;return Zb("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Zb("process",this.parser||this.Parser),Jb("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(a,l){const c=Wh(t),f=r.parse(c);r.run(f,c,function(m,h,y){if(m||!h||!y)return d(m);const g=h,x=r.stringify(g,y);MK(x)?y.value=x:y.result=x,d(m,y)});function d(m,h){m||!h?l(m):a?a(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),Zb("processSync",this.parser||this.Parser),Jb("processSync",this.compiler||this.Compiler),this.process(t,o),Ik("processSync","process",n),r;function o(a,l){n=!0,Nk(a),r=l}}run(t,n,r){_k(t),this.freeze();const o=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(l,c){const f=Wh(n);o.run(t,f,d);function d(m,h,y){const g=h||t;m?c(m):l?l(g):r(void 0,g,y)}}}runSync(t,n){let r=!1,o;return this.run(t,n,a),Ik("runSync","run",r),o;function a(l,c){Nk(l),o=c,r=!0}}stringify(t,n){this.freeze();const r=Wh(n),o=this.compiler||this.Compiler;return Jb("stringify",o),_k(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(ev("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(d){if(typeof d=="function")f(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[m,...h]=d;f(m,h)}else l(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function l(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(d.plugins),d.settings&&(o.settings=Kb(!0,o.settings,d.settings))}function c(d){let m=-1;if(d!=null)if(Array.isArray(d))for(;++m<d.length;){const h=d[m];a(h)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function f(d,m){let h=-1,y=-1;for(;++h<r.length;)if(r[h][0]===d){y=h;break}if(y===-1)r.push([d,...m]);else if(m.length>0){let[g,...x]=m;const E=r[y][1];gx(E)&&gx(g)&&(g=Kb(!0,E,g)),r[y]=[d,g,...x]}}}}const CK=new p0().freeze();function Zb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Jb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ev(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function _k(e){if(!gx(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Ik(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Wh(e){return kK(e)?e:new CA(e)}function kK(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function MK(e){return typeof e=="string"||OK(e)}function OK(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const NK="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Pk=[],Lk={allowDangerousHtml:!0},AK=/^(https?|ircs?|mailto|xmpp)$/i,DK=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function _K(e){const t=IK(e),n=PK(e);return LK(t.runSync(t.parse(n),n),e)}function IK(e){const t=e.rehypePlugins||Pk,n=e.remarkPlugins||Pk,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Lk}:Lk;return CK().use(hY).use(n).use(lK,r).use(t)}function PK(e){const t=e.children||"",n=new CA;return typeof t=="string"&&(n.value=t),n}function LK(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,a=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,f=t.urlTransform||jK;for(const m of DK)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+NK+m.id,void 0);return h0(e,d),XV(e,{Fragment:w.Fragment,components:o,ignoreInvalidStyle:!0,jsx:w.jsx,jsxs:w.jsxs,passKeys:!0,passNode:!0});function d(m,h,y){if(m.type==="raw"&&y&&typeof h=="number")return l?y.children.splice(h,1):y.children[h]={type:"text",value:m.value},h;if(m.type==="element"){let g;for(g in Vb)if(Object.hasOwn(Vb,g)&&Object.hasOwn(m.properties,g)){const x=m.properties[g],E=Vb[g];(E===null||E.includes(m.tagName))&&(m.properties[g]=f(String(x||""),g,m))}}if(m.type==="element"){let g=n?!n.includes(m.tagName):a?a.includes(m.tagName):!1;if(!g&&r&&typeof h=="number"&&(g=!r(m,h,y)),g&&y&&typeof h=="number")return c&&m.children?y.children.splice(h,1,...m.children):y.children.splice(h,1),h}}}function jK(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||r!==-1&&t>r||AK.test(e.slice(0,t))?e:""}function jk(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,o=n.indexOf(t);for(;o!==-1;)r++,o=n.indexOf(t,o+t.length);return r}function zK(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function FK(e,t,n){const o=Pm((n||{}).ignore||[]),a=BK(t);let l=-1;for(;++l<a.length;)RA(e,"text",c);function c(d,m){let h=-1,y;for(;++h<m.length;){const g=m[h],x=y?y.children:void 0;if(o(g,x?x.indexOf(g):void 0,y))return;y=g}if(y)return f(d,m)}function f(d,m){const h=m[m.length-1],y=a[l][0],g=a[l][1];let x=0;const R=h.children.indexOf(d);let T=!1,C=[];y.lastIndex=0;let k=y.exec(d.value);for(;k;){const M=k.index,D={index:k.index,input:k.input,stack:[...m,d]};let O=g(...k,D);if(typeof O=="string"&&(O=O.length>0?{type:"text",value:O}:void 0),O===!1?y.lastIndex=M+1:(x!==M&&C.push({type:"text",value:d.value.slice(x,M)}),Array.isArray(O)?C.push(...O):O&&C.push(O),x=M+k[0].length,T=!0),!y.global)break;k=y.exec(d.value)}return T?(x<d.value.length&&C.push({type:"text",value:d.value.slice(x)}),h.children.splice(R,1,...C)):C=[d],R+C.length}}function BK(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const o=n[r];t.push([UK(o[0]),HK(o[1])])}return t}function UK(e){return typeof e=="string"?new RegExp(zK(e),"g"):e}function HK(e){return typeof e=="function"?e:function(){return e}}const tv="phrasing",nv=["autolink","link","image","label"];function qK(){return{transforms:[XK],enter:{literalAutolink:$K,literalAutolinkEmail:rv,literalAutolinkHttp:rv,literalAutolinkWww:rv},exit:{literalAutolink:WK,literalAutolinkEmail:KK,literalAutolinkHttp:GK,literalAutolinkWww:YK}}}function VK(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:tv,notInConstruct:nv},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:tv,notInConstruct:nv},{character:":",before:"[ps]",after:"\\/",inConstruct:tv,notInConstruct:nv}]}}function $K(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function rv(e){this.config.enter.autolinkProtocol.call(this,e)}function GK(e){this.config.exit.autolinkProtocol.call(this,e)}function YK(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function KK(e){this.config.exit.autolinkEmail.call(this,e)}function WK(e){this.exit(e)}function XK(e){FK(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,QK],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),ZK]],{ignore:["link","linkReference"]})}function QK(e,t,n,r,o){let a="";if(!kA(o)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!JK(n)))return!1;const l=eW(n+r);if(!l[0])return!1;const c={type:"link",title:null,url:a+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[c,{type:"text",value:l[1]}]:c}function ZK(e,t,n,r){return!kA(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function JK(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function eW(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const o=jk(e,"(");let a=jk(e,")");for(;r!==-1&&o>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function kA(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||rl(n)||Dm(n))&&(!t||n!==47)}MA.peek=cW;function tW(){this.buffer()}function nW(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function rW(){this.buffer()}function iW(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function oW(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ui(this.sliceSerialize(e)).toLowerCase(),n.label=t}function aW(e){this.exit(e)}function sW(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ui(this.sliceSerialize(e)).toLowerCase(),n.label=t}function lW(e){this.exit(e)}function cW(){return"["}function MA(e,t,n,r){const o=n.createTracker(r);let a=o.move("[^");const l=n.enter("footnoteReference"),c=n.enter("reference");return a+=o.move(n.safe(n.associationId(e),{after:"]",before:a})),c(),l(),a+=o.move("]"),a}function uW(){return{enter:{gfmFootnoteCallString:tW,gfmFootnoteCall:nW,gfmFootnoteDefinitionLabelString:rW,gfmFootnoteDefinition:iW},exit:{gfmFootnoteCallString:oW,gfmFootnoteCall:aW,gfmFootnoteDefinitionLabelString:sW,gfmFootnoteDefinition:lW}}}function dW(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:MA},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,o,a,l){const c=a.createTracker(l);let f=c.move("[^");const d=a.enter("footnoteDefinition"),m=a.enter("label");return f+=c.move(a.safe(a.associationId(r),{before:f,after:"]"})),m(),f+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),f+=c.move((t?`
|
|
458
|
+
`:" ")+a.indentLines(a.containerFlow(r,c.current()),t?OA:fW))),d(),f}}function fW(e,t,n){return t===0?e:OA(e,t,n)}function OA(e,t,n){return(n?"":" ")+e}const hW=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];NA.peek=bW;function pW(){return{canContainEols:["delete"],enter:{strikethrough:gW},exit:{strikethrough:yW}}}function mW(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:hW}],handlers:{delete:NA}}}function gW(e){this.enter({type:"delete",children:[]},e)}function yW(e){this.exit(e)}function NA(e,t,n,r){const o=n.createTracker(r),a=n.enter("strikethrough");let l=o.move("~~");return l+=n.containerPhrasing(e,{...o.current(),before:l,after:"~"}),l+=o.move("~~"),a(),l}function bW(){return"~"}function vW(e){return e.length}function xW(e,t){const n=t||{},r=(n.align||[]).concat(),o=n.stringLength||vW,a=[],l=[],c=[],f=[];let d=0,m=-1;for(;++m<e.length;){const E=[],R=[];let T=-1;for(e[m].length>d&&(d=e[m].length);++T<e[m].length;){const C=wW(e[m][T]);if(n.alignDelimiters!==!1){const k=o(C);R[T]=k,(f[T]===void 0||k>f[T])&&(f[T]=k)}E.push(C)}l[m]=E,c[m]=R}let h=-1;if(typeof r=="object"&&"length"in r)for(;++h<d;)a[h]=zk(r[h]);else{const E=zk(r);for(;++h<d;)a[h]=E}h=-1;const y=[],g=[];for(;++h<d;){const E=a[h];let R="",T="";E===99?(R=":",T=":"):E===108?R=":":E===114&&(T=":");let C=n.alignDelimiters===!1?1:Math.max(1,f[h]-R.length-T.length);const k=R+"-".repeat(C)+T;n.alignDelimiters!==!1&&(C=R.length+C+T.length,C>f[h]&&(f[h]=C),g[h]=C),y[h]=k}l.splice(1,0,y),c.splice(1,0,g),m=-1;const x=[];for(;++m<l.length;){const E=l[m],R=c[m];h=-1;const T=[];for(;++h<d;){const C=E[h]||"";let k="",M="";if(n.alignDelimiters!==!1){const D=f[h]-(R[h]||0),O=a[h];O===114?k=" ".repeat(D):O===99?D%2?(k=" ".repeat(D/2+.5),M=" ".repeat(D/2-.5)):(k=" ".repeat(D/2),M=k):M=" ".repeat(D)}n.delimiterStart!==!1&&!h&&T.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&C==="")&&(n.delimiterStart!==!1||h)&&T.push(" "),n.alignDelimiters!==!1&&T.push(k),T.push(C),n.alignDelimiters!==!1&&T.push(M),n.padding!==!1&&T.push(" "),(n.delimiterEnd!==!1||h!==d-1)&&T.push("|")}x.push(n.delimiterEnd===!1?T.join("").replace(/ +$/,""):T.join(""))}return x.join(`
|
|
459
|
+
`)}function wW(e){return e==null?"":String(e)}function zk(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function SW(e,t,n,r){const o=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const l=n.indentLines(n.containerFlow(e,a.current()),EW);return o(),l}function EW(e,t,n){return">"+(n?"":" ")+e}function TW(e,t){return Fk(e,t.inConstruct,!0)&&!Fk(e,t.notInConstruct,!1)}function Fk(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Bk(e,t,n,r){let o=-1;for(;++o<n.unsafe.length;)if(n.unsafe[o].character===`
|
|
460
|
+
`&&TW(n.stack,n.unsafe[o]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
461
|
+
`}function RW(e,t){const n=String(e);let r=n.indexOf(t),o=r,a=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===o?++a>l&&(l=a):a=1,o=r+t.length,r=n.indexOf(t,o);return l}function CW(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function kW(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function MW(e,t,n,r){const o=kW(n),a=e.value||"",l=o==="`"?"GraveAccent":"Tilde";if(CW(e,n)){const h=n.enter("codeIndented"),y=n.indentLines(a,OW);return h(),y}const c=n.createTracker(r),f=o.repeat(Math.max(RW(a,o)+1,3)),d=n.enter("codeFenced");let m=c.move(f);if(e.lang){const h=n.enter(`codeFencedLang${l}`);m+=c.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...c.current()})),h()}if(e.lang&&e.meta){const h=n.enter(`codeFencedMeta${l}`);m+=c.move(" "),m+=c.move(n.safe(e.meta,{before:m,after:`
|
|
462
|
+
`,encode:["`"],...c.current()})),h()}return m+=c.move(`
|
|
463
|
+
`),a&&(m+=c.move(a+`
|
|
464
|
+
`)),m+=c.move(f),d(),m}function OW(e,t,n){return(n?"":" ")+e}function m0(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function NW(e,t,n,r){const o=m0(n),a=o==='"'?"Quote":"Apostrophe",l=n.enter("definition");let c=n.enter("label");const f=n.createTracker(r);let d=f.move("[");return d+=f.move(n.safe(n.associationId(e),{before:d,after:"]",...f.current()})),d+=f.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(c=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":`
|
|
465
|
+
`,...f.current()}))),c(),e.title&&(c=n.enter(`title${a}`),d+=f.move(" "+o),d+=f.move(n.safe(e.title,{before:d,after:o,...f.current()})),d+=f.move(o),c()),l(),d}function AW(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function _d(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Yp(e,t,n){const r=Oc(e),o=Oc(t);return r===void 0?o===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}AA.peek=DW;function AA(e,t,n,r){const o=AW(n),a=n.enter("emphasis"),l=n.createTracker(r),c=l.move(o);let f=l.move(n.containerPhrasing(e,{after:o,before:c,...l.current()}));const d=f.charCodeAt(0),m=Yp(r.before.charCodeAt(r.before.length-1),d,o);m.inside&&(f=_d(d)+f.slice(1));const h=f.charCodeAt(f.length-1),y=Yp(r.after.charCodeAt(0),h,o);y.inside&&(f=f.slice(0,-1)+_d(h));const g=l.move(o);return a(),n.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},c+f+g}function DW(e,t,n){return n.options.emphasis||"*"}function _W(e,t){let n=!1;return h0(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,px}),!!((!e.depth||e.depth<3)&&a0(e)&&(t.options.setext||n))}function IW(e,t,n,r){const o=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(_W(e,n)){const m=n.enter("headingSetext"),h=n.enter("phrasing"),y=n.containerPhrasing(e,{...a.current(),before:`
|
|
466
|
+
`,after:`
|
|
467
|
+
`});return h(),m(),y+`
|
|
468
|
+
`+(o===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
|
|
469
|
+
`))+1))}const l="#".repeat(o),c=n.enter("headingAtx"),f=n.enter("phrasing");a.move(l+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
|
|
470
|
+
`,...a.current()});return/^[\t ]/.test(d)&&(d=_d(d.charCodeAt(0))+d.slice(1)),d=d?l+" "+d:l,n.options.closeAtx&&(d+=" "+l),f(),c(),d}DA.peek=PW;function DA(e){return e.value||""}function PW(){return"<"}_A.peek=LW;function _A(e,t,n,r){const o=m0(n),a=o==='"'?"Quote":"Apostrophe",l=n.enter("image");let c=n.enter("label");const f=n.createTracker(r);let d=f.move("![");return d+=f.move(n.safe(e.alt,{before:d,after:"]",...f.current()})),d+=f.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(c=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":")",...f.current()}))),c(),e.title&&(c=n.enter(`title${a}`),d+=f.move(" "+o),d+=f.move(n.safe(e.title,{before:d,after:o,...f.current()})),d+=f.move(o),c()),d+=f.move(")"),l(),d}function LW(){return"!"}IA.peek=jW;function IA(e,t,n,r){const o=e.referenceType,a=n.enter("imageReference");let l=n.enter("label");const c=n.createTracker(r);let f=c.move("![");const d=n.safe(e.alt,{before:f,after:"]",...c.current()});f+=c.move(d+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const h=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return l(),n.stack=m,a(),o==="full"||!d||d!==h?f+=c.move(h+"]"):o==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function jW(){return"!"}PA.peek=zW;function PA(e,t,n){let r=e.value||"",o="`",a=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const l=n.unsafe[a],c=n.compilePattern(l);let f;if(l.atBreak)for(;f=c.exec(r);){let d=f.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(f.index+1)}}return o+r+o}function zW(){return"`"}function LA(e,t){const n=a0(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}jA.peek=FW;function jA(e,t,n,r){const o=m0(n),a=o==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let c,f;if(LA(e,n)){const m=n.stack;n.stack=[],c=n.enter("autolink");let h=l.move("<");return h+=l.move(n.containerPhrasing(e,{before:h,after:">",...l.current()})),h+=l.move(">"),c(),n.stack=m,h}c=n.enter("link"),f=n.enter("label");let d=l.move("[");return d+=l.move(n.containerPhrasing(e,{before:d,after:"](",...l.current()})),d+=l.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),d+=l.move("<"),d+=l.move(n.safe(e.url,{before:d,after:">",...l.current()})),d+=l.move(">")):(f=n.enter("destinationRaw"),d+=l.move(n.safe(e.url,{before:d,after:e.title?" ":")",...l.current()}))),f(),e.title&&(f=n.enter(`title${a}`),d+=l.move(" "+o),d+=l.move(n.safe(e.title,{before:d,after:o,...l.current()})),d+=l.move(o),f()),d+=l.move(")"),c(),d}function FW(e,t,n){return LA(e,n)?"<":"["}zA.peek=BW;function zA(e,t,n,r){const o=e.referenceType,a=n.enter("linkReference");let l=n.enter("label");const c=n.createTracker(r);let f=c.move("[");const d=n.containerPhrasing(e,{before:f,after:"]",...c.current()});f+=c.move(d+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const h=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return l(),n.stack=m,a(),o==="full"||!d||d!==h?f+=c.move(h+"]"):o==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function BW(){return"["}function g0(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function UW(e){const t=g0(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function HW(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function FA(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function qW(e,t,n,r){const o=n.enter("list"),a=n.bulletCurrent;let l=e.ordered?HW(n):g0(n);const c=e.ordered?l==="."?")":".":UW(n);let f=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&m&&(!m.children||!m.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),FA(n)===l&&m){let h=-1;for(;++h<e.children.length;){const y=e.children[h];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(l=c),n.bulletCurrent=l;const d=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=a,o(),d}function VW(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function $W(e,t,n,r){const o=VW(n);let a=n.bulletCurrent||g0(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let l=a.length+1;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const c=n.createTracker(r);c.move(a+" ".repeat(l-a.length)),c.shift(l);const f=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,c.current()),m);return f(),d;function m(h,y,g){return y?(g?"":" ".repeat(l))+h:(g?a:a+" ".repeat(l-a.length))+h}}function GW(e,t,n,r){const o=n.enter("paragraph"),a=n.enter("phrasing"),l=n.containerPhrasing(e,r);return a(),o(),l}const YW=Pm(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function KW(e,t,n,r){return(e.children.some(function(l){return YW(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function WW(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}BA.peek=XW;function BA(e,t,n,r){const o=WW(n),a=n.enter("strong"),l=n.createTracker(r),c=l.move(o+o);let f=l.move(n.containerPhrasing(e,{after:o,before:c,...l.current()}));const d=f.charCodeAt(0),m=Yp(r.before.charCodeAt(r.before.length-1),d,o);m.inside&&(f=_d(d)+f.slice(1));const h=f.charCodeAt(f.length-1),y=Yp(r.after.charCodeAt(0),h,o);y.inside&&(f=f.slice(0,-1)+_d(h));const g=l.move(o+o);return a(),n.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},c+f+g}function XW(e,t,n){return n.options.strong||"*"}function QW(e,t,n,r){return n.safe(e.value,r)}function ZW(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function JW(e,t,n){const r=(FA(n)+(n.options.ruleSpaces?" ":"")).repeat(ZW(n));return n.options.ruleSpaces?r.slice(0,-1):r}const UA={blockquote:SW,break:Bk,code:MW,definition:NW,emphasis:AA,hardBreak:Bk,heading:IW,html:DA,image:_A,imageReference:IA,inlineCode:PA,link:jA,linkReference:zA,list:qW,listItem:$W,paragraph:GW,root:KW,strong:BA,text:QW,thematicBreak:JW};function eX(){return{enter:{table:tX,tableData:Uk,tableHeader:Uk,tableRow:rX},exit:{codeText:iX,table:nX,tableData:iv,tableHeader:iv,tableRow:iv}}}function tX(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function nX(e){this.exit(e),this.data.inTable=void 0}function rX(e){this.enter({type:"tableRow",children:[]},e)}function iv(e){this.exit(e)}function Uk(e){this.enter({type:"tableCell",children:[]},e)}function iX(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,oX));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function oX(e,t){return t==="|"?t:e}function aX(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,o=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
471
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:l,tableCell:f,tableRow:c}};function l(g,x,E,R){return d(m(g,E,R),g.align)}function c(g,x,E,R){const T=h(g,E,R),C=d([T]);return C.slice(0,C.indexOf(`
|
|
472
|
+
`))}function f(g,x,E,R){const T=E.enter("tableCell"),C=E.enter("phrasing"),k=E.containerPhrasing(g,{...R,before:a,after:a});return C(),T(),k}function d(g,x){return xW(g,{align:x,alignDelimiters:r,padding:n,stringLength:o})}function m(g,x,E){const R=g.children;let T=-1;const C=[],k=x.enter("table");for(;++T<R.length;)C[T]=h(R[T],x,E);return k(),C}function h(g,x,E){const R=g.children;let T=-1;const C=[],k=x.enter("tableRow");for(;++T<R.length;)C[T]=f(R[T],g,x,E);return k(),C}function y(g,x,E){let R=UA.inlineCode(g,x,E);return E.stack.includes("tableCell")&&(R=R.replace(/\|/g,"\\$&")),R}}function sX(){return{exit:{taskListCheckValueChecked:Hk,taskListCheckValueUnchecked:Hk,paragraph:cX}}}function lX(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:uX}}}function Hk(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function cX(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const o=t.children;let a=-1,l;for(;++a<o.length;){const c=o[a];if(c.type==="paragraph"){l=c;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function uX(e,t,n,r){const o=e.children[0],a=typeof e.checked=="boolean"&&o&&o.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",c=n.createTracker(r);a&&c.move(l);let f=UA.listItem(e,t,n,{...r,...c.current()});return a&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),f;function d(m){return m+l}}function dX(){return[qK(),uW(),pW(),eX(),sX()]}function fX(e){return{extensions:[VK(),dW(e),mW(),aX(e),lX()]}}const hX={tokenize:vX,partial:!0},HA={tokenize:xX,partial:!0},qA={tokenize:wX,partial:!0},VA={tokenize:SX,partial:!0},pX={tokenize:EX,partial:!0},$A={name:"wwwAutolink",tokenize:yX,previous:YA},GA={name:"protocolAutolink",tokenize:bX,previous:KA},Jo={name:"emailAutolink",tokenize:gX,previous:WA},mo={};function mX(){return{text:mo}}let Ms=48;for(;Ms<123;)mo[Ms]=Jo,Ms++,Ms===58?Ms=65:Ms===91&&(Ms=97);mo[43]=Jo;mo[45]=Jo;mo[46]=Jo;mo[95]=Jo;mo[72]=[Jo,GA];mo[104]=[Jo,GA];mo[87]=[Jo,$A];mo[119]=[Jo,$A];function gX(e,t,n){const r=this;let o,a;return l;function l(h){return!bx(h)||!WA.call(r,r.previous)||y0(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(h))}function c(h){return bx(h)?(e.consume(h),c):h===64?(e.consume(h),f):n(h)}function f(h){return h===46?e.check(pX,m,d)(h):h===45||h===95||Sr(h)?(a=!0,e.consume(h),f):m(h)}function d(h){return e.consume(h),o=!0,f}function m(h){return a&&o&&Mr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function yX(e,t,n){const r=this;return o;function o(l){return l!==87&&l!==119||!YA.call(r,r.previous)||y0(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(hX,e.attempt(HA,e.attempt(qA,a),n),n)(l))}function a(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function bX(e,t,n){const r=this;let o="",a=!1;return l;function l(h){return(h===72||h===104)&&KA.call(r,r.previous)&&!y0(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(h),e.consume(h),c):n(h)}function c(h){if(Mr(h)&&o.length<5)return o+=String.fromCodePoint(h),e.consume(h),c;if(h===58){const y=o.toLowerCase();if(y==="http"||y==="https")return e.consume(h),f}return n(h)}function f(h){return h===47?(e.consume(h),a?d:(a=!0,f)):n(h)}function d(h){return h===null||Vp(h)||Tn(h)||rl(h)||Dm(h)?n(h):e.attempt(HA,e.attempt(qA,m),n)(h)}function m(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function vX(e,t,n){let r=0;return o;function o(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),o):l===46&&r===3?(e.consume(l),a):n(l)}function a(l){return l===null?n(l):t(l)}}function xX(e,t,n){let r,o,a;return l;function l(d){return d===46||d===95?e.check(VA,f,c)(d):d===null||Tn(d)||rl(d)||d!==45&&Dm(d)?f(d):(a=!0,e.consume(d),l)}function c(d){return d===95?r=!0:(o=r,r=void 0),e.consume(d),l}function f(d){return o||r||!a?n(d):t(d)}}function wX(e,t){let n=0,r=0;return o;function o(l){return l===40?(n++,e.consume(l),o):l===41&&r<n?a(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(VA,t,a)(l):l===null||Tn(l)||rl(l)?t(l):(e.consume(l),o)}function a(l){return l===41&&r++,e.consume(l),o}}function SX(e,t,n){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),r):c===38?(e.consume(c),a):c===93?(e.consume(c),o):c===60||c===null||Tn(c)||rl(c)?t(c):n(c)}function o(c){return c===null||c===40||c===91||Tn(c)||rl(c)?t(c):r(c)}function a(c){return Mr(c)?l(c):n(c)}function l(c){return c===59?(e.consume(c),r):Mr(c)?(e.consume(c),l):n(c)}}function EX(e,t,n){return r;function r(a){return e.consume(a),o}function o(a){return Sr(a)?n(a):t(a)}}function YA(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Tn(e)}function KA(e){return!Mr(e)}function WA(e){return!(e===47||bx(e))}function bx(e){return e===43||e===45||e===46||e===95||Sr(e)}function y0(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const TX={tokenize:DX,partial:!0};function RX(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:OX,continuation:{tokenize:NX},exit:AX}},text:{91:{name:"gfmFootnoteCall",tokenize:MX},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:CX,resolveTo:kX}}}}function CX(e,t,n){const r=this;let o=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;o--;){const f=r.events[o][1];if(f.type==="labelImage"){l=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return c;function c(f){if(!l||!l._balanced)return n(f);const d=Ui(r.sliceSerialize({start:l.end,end:r.now()}));return d.codePointAt(0)!==94||!a.includes(d.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function kX(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},c=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...c),e}function MX(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,l;return c;function c(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),f}function f(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(h){if(a>999||h===93&&!l||h===null||h===91||Tn(h))return n(h);if(h===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return o.includes(Ui(r.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return Tn(h)||(l=!0),a++,e.consume(h),h===92?m:d}function m(h){return h===91||h===92||h===93?(e.consume(h),a++,d):d(h)}}function OX(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,l=0,c;return f;function f(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(x)}function m(x){if(l>999||x===93&&!c||x===null||x===91||Tn(x))return n(x);if(x===93){e.exit("chunkString");const E=e.exit("gfmFootnoteDefinitionLabelString");return a=Ui(r.sliceSerialize(E)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return Tn(x)||(c=!0),l++,e.consume(x),x===92?h:m}function h(x){return x===91||x===92||x===93?(e.consume(x),l++,m):m(x)}function y(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),o.includes(a)||o.push(a),ln(e,g,"gfmFootnoteDefinitionWhitespace")):n(x)}function g(x){return t(x)}}function NX(e,t,n){return e.check(uf,t,e.attempt(TX,t,n))}function AX(e){e.exit("gfmFootnoteDefinition")}function DX(e,t,n){const r=this;return ln(e,o,"gfmFootnoteDefinitionIndent",5);function o(a){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(a):n(a)}}function _X(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:o};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function o(l,c){let f=-1;for(;++f<l.length;)if(l[f][0]==="enter"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._close){let d=f;for(;d--;)if(l[d][0]==="exit"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._open&&l[f][1].end.offset-l[f][1].start.offset===l[d][1].end.offset-l[d][1].start.offset){l[f][1].type="strikethroughSequence",l[d][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},l[d][1].start),end:Object.assign({},l[f][1].end)},h={type:"strikethroughText",start:Object.assign({},l[d][1].end),end:Object.assign({},l[f][1].start)},y=[["enter",m,c],["enter",l[d][1],c],["exit",l[d][1],c],["enter",h,c]],g=c.parser.constructs.insideSpan.null;g&&ai(y,y.length,0,_m(g,l.slice(d+1,f),c)),ai(y,y.length,0,[["exit",h,c],["enter",l[f][1],c],["exit",l[f][1],c],["exit",m,c]]),ai(l,d-1,f-d+3,y),f=d+y.length-2;break}}for(f=-1;++f<l.length;)l[f][1].type==="strikethroughSequenceTemporary"&&(l[f][1].type="data");return l}function a(l,c,f){const d=this.previous,m=this.events;let h=0;return y;function y(x){return d===126&&m[m.length-1][1].type!=="characterEscape"?f(x):(l.enter("strikethroughSequenceTemporary"),g(x))}function g(x){const E=Oc(d);if(x===126)return h>1?f(x):(l.consume(x),h++,g);if(h<2&&!n)return f(x);const R=l.exit("strikethroughSequenceTemporary"),T=Oc(x);return R._open=!T||T===2&&!!E,R._close=!E||E===2&&!!T,c(x)}}}class IX{constructor(){this.map=[]}add(t,n,r){PX(this,t,n,r)}consume(t){if(this.map.sort(function(a,l){return a[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let o=r.pop();for(;o;){for(const a of o)t.push(a);o=r.pop()}this.map.length=0}}function PX(e,t,n,r){let o=0;if(!(n===0&&r.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=n,e.map[o][2].push(...r);return}o+=1}e.map.push([t,n,r])}}function LX(e,t){let n=!1;const r=[];for(;t<e.length;){const o=e[t];if(n){if(o[0]==="enter")o[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function jX(){return{flow:{null:{name:"table",tokenize:zX,resolveAll:FX}}}}function zX(e,t,n){const r=this;let o=0,a=0,l;return c;function c(F){let G=r.events.length-1;for(;G>-1;){const H=r.events[G][1].type;if(H==="lineEnding"||H==="linePrefix")G--;else break}const P=G>-1?r.events[G][1].type:null,U=P==="tableHead"||P==="tableRow"?O:f;return U===O&&r.parser.lazy[r.now().line]?n(F):U(F)}function f(F){return e.enter("tableHead"),e.enter("tableRow"),d(F)}function d(F){return F===124||(l=!0,a+=1),m(F)}function m(F){return F===null?n(F):xt(F)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),g):n(F):Xt(F)?ln(e,m,"whitespace")(F):(a+=1,l&&(l=!1,o+=1),F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),l=!0,m):(e.enter("data"),h(F)))}function h(F){return F===null||F===124||Tn(F)?(e.exit("data"),m(F)):(e.consume(F),F===92?y:h)}function y(F){return F===92||F===124?(e.consume(F),h):h(F)}function g(F){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(F):(e.enter("tableDelimiterRow"),l=!1,Xt(F)?ln(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):x(F))}function x(F){return F===45||F===58?R(F):F===124?(l=!0,e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),E):D(F)}function E(F){return Xt(F)?ln(e,R,"whitespace")(F):R(F)}function R(F){return F===58?(a+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),T):F===45?(a+=1,T(F)):F===null||xt(F)?M(F):D(F)}function T(F){return F===45?(e.enter("tableDelimiterFiller"),C(F)):D(F)}function C(F){return F===45?(e.consume(F),C):F===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),k):(e.exit("tableDelimiterFiller"),k(F))}function k(F){return Xt(F)?ln(e,M,"whitespace")(F):M(F)}function M(F){return F===124?x(F):F===null||xt(F)?!l||o!==a?D(F):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(F)):D(F)}function D(F){return n(F)}function O(F){return e.enter("tableRow"),N(F)}function N(F){return F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),N):F===null||xt(F)?(e.exit("tableRow"),t(F)):Xt(F)?ln(e,N,"whitespace")(F):(e.enter("data"),_(F))}function _(F){return F===null||F===124||Tn(F)?(e.exit("data"),N(F)):(e.consume(F),F===92?q:_)}function q(F){return F===92||F===124?(e.consume(F),_):_(F)}}function FX(e,t){let n=-1,r=!0,o=0,a=[0,0,0,0],l=[0,0,0,0],c=!1,f=0,d,m,h;const y=new IX;for(;++n<e.length;){const g=e[n],x=g[1];g[0]==="enter"?x.type==="tableHead"?(c=!1,f!==0&&(qk(y,t,f,d,m),m=void 0,f=0),d={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},y.add(n,0,[["enter",d,t]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(r=!0,h=void 0,a=[0,0,0,0],l=[0,n+1,0,0],c&&(c=!1,m={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},y.add(n,0,[["enter",m,t]])),o=x.type==="tableDelimiterRow"?2:m?3:1):o&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(a[1]!==0&&(l[0]=l[1],h=Xh(y,t,a,o,void 0,h),a=[0,0,0,0]),l[2]=n)):x.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(l[0]=l[1],h=Xh(y,t,a,o,void 0,h)),a=l,l=[a[1],n,0,0])):x.type==="tableHead"?(c=!0,f=n):x.type==="tableRow"||x.type==="tableDelimiterRow"?(f=n,a[1]!==0?(l[0]=l[1],h=Xh(y,t,a,o,n,h)):l[1]!==0&&(h=Xh(y,t,l,o,n,h)),o=0):o&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(l[3]=n)}for(f!==0&&qk(y,t,f,d,m),y.consume(t.events),n=-1;++n<t.events.length;){const g=t.events[n];g[0]==="enter"&&g[1].type==="table"&&(g[1]._align=LX(t.events,n))}return e}function Xh(e,t,n,r,o,a){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(a.end=Object.assign({},Wl(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const f=Wl(t.events,n[1]);if(a={type:l,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const d=Wl(t.events,n[2]),m=Wl(t.events,n[3]),h={type:c,start:Object.assign({},d),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){const y=t.events[n[2]],g=t.events[n[3]];if(y[1].end=Object.assign({},g[1].end),y[1].type="chunkText",y[1].contentType="text",n[3]>n[2]+1){const x=n[2]+1,E=n[3]-n[2]-1;e.add(x,E,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return o!==void 0&&(a.end=Object.assign({},Wl(t.events,o)),e.add(o,0,[["exit",a,t]]),a=void 0),a}function qk(e,t,n,r,o){const a=[],l=Wl(t.events,n);o&&(o.end=Object.assign({},l),a.push(["exit",o,t])),r.end=Object.assign({},l),a.push(["exit",r,t]),e.add(n+1,0,a)}function Wl(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const BX={name:"tasklistCheck",tokenize:HX};function UX(){return{text:{91:BX}}}function HX(e,t,n){const r=this;return o;function o(f){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),a)}function a(f){return Tn(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),l):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),l):n(f)}function l(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(f)}function c(f){return xt(f)?t(f):Xt(f)?e.check({tokenize:qX},t,n)(f):n(f)}}function qX(e,t,n){return ln(e,r,"whitespace");function r(o){return o===null?n(o):t(o)}}function VX(e){return aA([mX(),RX(),_X(e),jX(),UX()])}const $X={};function GX(e){const t=this,n=e||$X,r=t.data(),o=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);o.push(VX(n)),a.push(dX()),l.push(fX(n))}function YX(e){const t=e.split(`
|
|
473
|
+
`),n=[];let r=[],o=!1;const a=()=>{const l=r.join(`
|
|
474
|
+
`);l.trim()&&n.push(l),r=[]};for(const l of t){if(/^\s*(```|~~~)/.test(l)){o=!o,r.push(l);continue}if(!o&&l.trim()===""){a();continue}r.push(l)}return a(),n}const KX={a:({node:e,...t})=>w.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline underline-offset-2 break-all"}),pre:({node:e,...t})=>w.jsx("pre",{...t,className:"bg-muted overflow-x-auto rounded-md p-2 font-mono text-xs leading-relaxed"}),code:({node:e,className:t,...n})=>w.jsx("code",{...n,className:De("bg-muted rounded px-1 font-mono text-xs",t)}),ul:({node:e,...t})=>w.jsx("ul",{...t,className:"list-disc pl-5"}),ol:({node:e,...t})=>w.jsx("ol",{...t,className:"list-decimal pl-5"}),blockquote:({node:e,...t})=>w.jsx("blockquote",{...t,className:"border-border text-muted-foreground border-l-2 pl-2"}),h1:({node:e,...t})=>w.jsx("h1",{...t,className:"text-base font-semibold"}),h2:({node:e,...t})=>w.jsx("h2",{...t,className:"text-sm font-semibold"}),h3:({node:e,...t})=>w.jsx("h3",{...t,className:"text-sm font-semibold"}),table:({node:e,...t})=>w.jsx("div",{className:"overflow-x-auto",children:w.jsx("table",{...t,className:"border-border w-full border-collapse border text-xs"})}),th:({node:e,...t})=>w.jsx("th",{...t,className:"border-border bg-muted border px-2 py-1 text-left"}),td:({node:e,...t})=>w.jsx("td",{...t,className:"border-border border px-2 py-1"})},WX=v.memo(function({content:t}){return w.jsx(_K,{remarkPlugins:[GX],components:KX,children:t})});function XX({text:e,streaming:t=!1,className:n}){const r=v.useMemo(()=>YX(e),[e]);return w.jsxs("div",{className:De("flex min-w-0 flex-col gap-2 text-sm leading-relaxed",n),children:[r.map((o,a)=>w.jsx(WX,{content:o},a)),t&&w.jsx("span",{"data-testid":"agent-streaming-cursor",className:"bg-foreground inline-block h-4 w-2 animate-pulse self-start"})]})}function QX({text:e,streaming:t=!1,className:n}){return w.jsx("div",{"data-testid":"agent-assistant-message",className:De("min-w-0 max-w-full self-start",n),children:w.jsx(XX,{text:e,streaming:t})})}function ZX(e){const{open:t,defaultOpen:n,onOpenChange:r,disabled:o}=e,a=t!==void 0,[l,c]=Cc({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:f,setMounted:d,transitionStatus:m}=Jd(l,!0,!0),[h,y]=v.useState(l),[{height:g,width:x},E]=v.useState({height:void 0,width:void 0}),R=Yi(),[T,C]=v.useState(),k=T??R,[M,D]=v.useState(!1),[O,N]=v.useState(!1),_=v.useRef(null),q=v.useRef(null),F=v.useRef(null),G=v.useRef(null),P=PO(G,!1),U=Ge(H=>{const B=!l,j=yt(Wa,H.nativeEvent);if(r(B,j),j.isCanceled)return;const z=G.current;q.current==="css-animation"&&z!=null&&z.style.removeProperty("animation-name"),!M&&!O&&(q.current!=null&&q.current!=="css-animation"&&!f&&B&&d(!0),q.current==="css-animation"&&(!h&&B&&y(!0),!f&&B&&d(!0))),c(B),q.current==="none"&&f&&!B&&d(!1)});return qe(()=>{a&&q.current==="none"&&!O&&!l&&d(!1)},[a,O,l,t,d]),v.useMemo(()=>({abortControllerRef:_,animationTypeRef:q,disabled:o,handleTrigger:U,height:g,mounted:f,open:l,panelId:k,panelRef:G,runOnceAnimationsFinish:P,setDimensions:E,setHiddenUntilFound:D,setKeepMounted:N,setMounted:d,setOpen:c,setPanelIdState:C,setVisible:y,transitionDimensionRef:F,transitionStatus:m,visible:h,width:x}),[_,q,o,U,g,f,l,k,G,P,E,D,N,d,c,y,F,m,h,x])}const XA=v.createContext(void 0);function QA(){const e=v.useContext(XA);if(e===void 0)throw new Error(Rn(15));return e}let yd=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Zs.startingStyle]="startingStyle",e[e.endingStyle=Zs.endingStyle]="endingStyle",e})({}),JX=(function(e){return e.panelOpen="data-panel-open",e})({});const eQ={[yd.open]:""},tQ={[yd.closed]:""},nQ={open(e){return e?{[JX.panelOpen]:""}:null}},rQ={open(e){return e?eQ:tQ}},ZA={...rQ,...Xo},iQ=v.forwardRef(function(t,n){const{render:r,className:o,defaultOpen:a=!1,disabled:l=!1,onOpenChange:c,open:f,...d}=t,m=Ge(c),h=ZX({open:f,defaultOpen:a,onOpenChange:m,disabled:l}),y=v.useMemo(()=>({open:h.open,disabled:h.disabled,transitionStatus:h.transitionStatus}),[h.open,h.disabled,h.transitionStatus]),g=v.useMemo(()=>({...h,onOpenChange:m,state:y}),[h,m,y]),x=At("div",t,{state:y,ref:n,props:d,stateAttributesMapping:ZA});return w.jsx(XA.Provider,{value:g,children:x})}),oQ={...nQ,...Xo},aQ=v.forwardRef(function(t,n){const{panelId:r,open:o,handleTrigger:a,state:l,disabled:c}=QA(),{className:f,disabled:d=c,id:m,render:h,nativeButton:y=!0,...g}=t,{getButtonProps:x,buttonRef:E}=Wo({disabled:d,focusableWhenDisabled:!0,native:y}),R=v.useMemo(()=>({"aria-controls":o?r:void 0,"aria-expanded":o,onClick:a}),[r,o,a]);return At("button",t,{state:l,ref:[n,E],props:[R,g,x],stateAttributesMapping:oQ})});let sQ=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e})({});function lQ(e){const{abortControllerRef:t,animationTypeRef:n,externalRef:r,height:o,hiddenUntilFound:a,keepMounted:l,id:c,mounted:f,onOpenChange:d,open:m,panelRef:h,runOnceAnimationsFinish:y,setDimensions:g,setMounted:x,setOpen:E,setVisible:R,transitionDimensionRef:T,visible:C,width:k}=e,M=v.useRef(!1),D=v.useRef(null),O=v.useRef(m),N=v.useRef(m),_=Zd(),q=v.useMemo(()=>n.current==="css-animation"?!C:!m&&!f,[m,f,C,n]),F=Ge(P=>{if(!P)return;if(n.current==null||T.current==null){const B=getComputedStyle(P),j=B.animationName!=="none"&&B.animationName!=="",z=B.transitionDuration!=="0s"&&B.transitionDuration!=="";j&&z||(B.animationName==="none"&&B.transitionDuration!=="0s"?n.current="css-transition":B.animationName!=="none"&&B.transitionDuration==="0s"?n.current="css-animation":n.current="none"),P.getAttribute(sQ.orientation)==="horizontal"||B.transitionProperty.indexOf("width")>-1?T.current="width":T.current="height"}if(n.current!=="css-transition")return;(o===void 0||k===void 0)&&(g({height:P.scrollHeight,width:P.scrollWidth}),N.current&&P.style.setProperty("transition-duration","0s"));let U=-1,H=-1;return U=Un.request(()=>{N.current=!1,H=Un.request(()=>{setTimeout(()=>{P.style.removeProperty("transition-duration")})})}),()=>{Un.cancel(U),Un.cancel(H)}}),G=Hi(r,h,F);return qe(()=>{if(n.current!=="css-transition")return;const P=h.current;if(!P)return;let U=-1;if(t.current!=null&&(t.current.abort(),t.current=null),m){const H={"justify-content":P.style.justifyContent,"align-items":P.style.alignItems,"align-content":P.style.alignContent,"justify-items":P.style.justifyItems};Object.keys(H).forEach(B=>{P.style.setProperty(B,"initial","important")}),!N.current&&!l&&P.setAttribute(yd.startingStyle,""),g({height:P.scrollHeight,width:P.scrollWidth}),U=Un.request(()=>{Object.entries(H).forEach(([B,j])=>{j===""?P.style.removeProperty(B):P.style.setProperty(B,j)})})}else{if(P.scrollHeight===0&&P.scrollWidth===0)return;g({height:P.scrollHeight,width:P.scrollWidth});const H=new AbortController;t.current=H;const B=H.signal;let j=null;const z=yd.endingStyle;return j=new MutationObserver(V=>{V.some(L=>L.type==="attributes"&&L.attributeName===z)&&(j==null||j.disconnect(),j=null,y(()=>{g({height:0,width:0}),P.style.removeProperty("content-visibility"),x(!1),t.current===H&&(t.current=null)},B))}),j.observe(P,{attributes:!0,attributeFilter:[z]}),()=>{j==null||j.disconnect(),_.cancel(),t.current===H&&(H.abort(),t.current=null)}}return()=>{Un.cancel(U)}},[t,n,_,a,l,f,m,h,y,g,x]),qe(()=>{if(n.current!=="css-animation")return;const P=h.current;P&&(D.current=P.style.animationName||D.current,P.style.setProperty("animation-name","none"),g({height:P.scrollHeight,width:P.scrollWidth}),!O.current&&!M.current&&P.style.removeProperty("animation-name"),m?(t.current!=null&&(t.current.abort(),t.current=null),x(!0),R(!0)):(t.current=new AbortController,y(()=>{x(!1),R(!1),t.current=null},t.current.signal)))},[t,n,m,h,y,g,x,R,C]),mm(()=>{const P=Un.request(()=>{O.current=!1});return()=>Un.cancel(P)}),qe(()=>{if(!a)return;const P=h.current;if(!P)return;let U=-1,H=-1;return m&&M.current&&(P.style.transitionDuration="0s",g({height:P.scrollHeight,width:P.scrollWidth}),U=Un.request(()=>{M.current=!1,H=Un.request(()=>{setTimeout(()=>{P.style.removeProperty("transition-duration")})})})),()=>{Un.cancel(U),Un.cancel(H)}},[a,m,h,g]),qe(()=>{const P=h.current;P&&a&&q&&(P.setAttribute("hidden","until-found"),n.current==="css-transition"&&P.setAttribute(yd.startingStyle,""))},[a,q,n,h]),v.useEffect(function(){const U=h.current;if(!U)return;function H(B){M.current=!0,E(!0),d(!0,yt(qi,B))}return U.addEventListener("beforematch",H),()=>{U.removeEventListener("beforematch",H)}},[d,h,E]),v.useMemo(()=>({props:{hidden:q,id:c,ref:G}}),[q,c,G])}let Vk=(function(e){return e.collapsiblePanelHeight="--collapsible-panel-height",e.collapsiblePanelWidth="--collapsible-panel-width",e})({});const cQ=v.forwardRef(function(t,n){const{className:r,hiddenUntilFound:o,keepMounted:a,render:l,id:c,...f}=t,{abortControllerRef:d,animationTypeRef:m,height:h,mounted:y,onOpenChange:g,open:x,panelId:E,panelRef:R,runOnceAnimationsFinish:T,setDimensions:C,setHiddenUntilFound:k,setKeepMounted:M,setMounted:D,setPanelIdState:O,setOpen:N,setVisible:_,state:q,transitionDimensionRef:F,visible:G,width:P,transitionStatus:U}=QA(),H=o??!1,B=a??!1;qe(()=>{if(c)return O(c),()=>{O(void 0)}},[c,O]),qe(()=>{k(H)},[k,H]),qe(()=>{M(B)},[M,B]);const{props:j}=lQ({abortControllerRef:d,animationTypeRef:m,externalRef:n,height:h,hiddenUntilFound:H,id:E,keepMounted:B,mounted:y,onOpenChange:g,open:x,panelRef:R,runOnceAnimationsFinish:T,setDimensions:C,setMounted:D,setOpen:N,setVisible:_,transitionDimensionRef:F,visible:G,width:P});Qo({open:x&&U==="idle",ref:R,onComplete(){x&&C({height:void 0,width:void 0})}});const z=v.useMemo(()=>({...q,transitionStatus:U}),[q,U]),V=At("div",t,{state:z,ref:[n,R],props:[j,{style:{[Vk.collapsiblePanelHeight]:h===void 0?"auto":`${h}px`,[Vk.collapsiblePanelWidth]:P===void 0?"auto":`${P}px`}},f],stateAttributesMapping:ZA});return B||H||!B&&y?V:null});function jm({...e}){return w.jsx(iQ,{"data-slot":"collapsible",...e})}function zm({...e}){return w.jsx(aQ,{"data-slot":"collapsible-trigger",...e})}function Fm({...e}){return w.jsx(cQ,{"data-slot":"collapsible-content",...e})}function uQ({text:e,streaming:t=!1,className:n}){const{t:r}=mn();return w.jsxs(jm,{"data-testid":"agent-reasoning-block",className:De("min-w-0 max-w-full self-start",n),children:[w.jsxs(zm,{className:"text-muted-foreground hover:text-foreground group flex items-center gap-1 text-xs",children:[w.jsx(of,{className:"size-3 transition-transform group-data-[panel-open]:rotate-90"}),w.jsx(H8,{className:"size-3"}),w.jsx("span",{children:r("agent.reasoning.title")}),t&&w.jsx(tl,{className:"size-3 animate-spin"})]}),w.jsx(Fm,{children:w.jsx("div",{className:"text-muted-foreground border-border mt-1 border-l-2 pl-2 text-xs whitespace-pre-wrap break-words",children:e})})]})}const dQ=cm("h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive overflow-hidden group/badge",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function il({className:e,variant:t="default",render:n,...r}){return lm({defaultTagName:"span",props:ki({className:De(dQ({className:e,variant:t}))},r),render:n,state:{slot:"badge",variant:t}})}function Xa(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function vx(e){if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function fQ(e){return Xa(e.output)&&typeof e.output.error=="string"?e.output.error:e.isError?vx(e.output):null}function hQ(e){switch(e){case"send_input":return w.jsx(O9,{className:"size-3.5"});case"read_screen":return w.jsx(af,{className:"size-3.5"});case"web_search":return w.jsx(nq,{className:"size-3.5"});case"fetch_url":return w.jsx(Om,{className:"size-3.5"});default:return w.jsx(vq,{className:"size-3.5"})}}function Nc({label:e,text:t}){return w.jsxs(jm,{children:[w.jsxs(zm,{className:"text-muted-foreground hover:text-foreground group flex items-center gap-1 text-xs",children:[w.jsx(of,{className:"size-3 transition-transform group-data-[panel-open]:rotate-90"}),w.jsx("span",{children:e})]}),w.jsx(Fm,{children:w.jsx("pre",{className:"bg-muted mt-1 max-h-64 overflow-auto rounded-md p-2 font-mono text-xs whitespace-pre-wrap break-all",children:t})})]})}function pQ(e){if(typeof e!="string")return null;try{const t=JSON.parse(e);return Array.isArray(t)?t.filter(Xa).map(n=>({title:typeof n.title=="string"?n.title:"",url:typeof n.url=="string"?n.url:"",snippet:typeof n.snippet=="string"?n.snippet:""})).filter(n=>n.url):null}catch{return null}}function mQ({call:e}){const{t}=mn(),n=Xa(e.input)?e.input:{},r=typeof n.text=="string"?n.text:"",o=Array.isArray(n.keys)?n.keys.filter(c=>typeof c=="string"):[],a=Xa(e.output)?e.output:{},l=typeof a.screenTail=="string"?a.screenTail:"";return w.jsxs("div",{className:"flex flex-col gap-1.5",children:[r&&w.jsx("pre",{className:"bg-muted max-h-40 overflow-auto rounded-md p-2 font-mono text-xs whitespace-pre-wrap break-all",children:r}),o.length>0&&w.jsx("div",{className:"flex flex-wrap items-center gap-1",children:o.map((c,f)=>w.jsx(il,{variant:"outline",className:"font-mono",children:c},`${f}-${c}`))}),l&&w.jsx(Nc,{label:t("agent.tool.result"),text:l})]})}function gQ({call:e}){const{t}=mn(),n=Xa(e.output)?e.output:{},r=typeof n.screen=="string"?n.screen:"";return r?w.jsx(Nc,{label:t("agent.tool.screen"),text:r}):null}function yQ({call:e}){const{t}=mn(),n=Xa(e.input)?e.input:{},r=typeof n.query=="string"?n.query:"",o=e.resolved&&!e.isError&&!e.denied?pQ(e.output):null;return w.jsxs("div",{className:"flex flex-col gap-1.5",children:[r&&w.jsxs("p",{className:"text-muted-foreground text-xs break-words",children:["“",r,"”"]}),o&&o.length>0&&w.jsx("ul",{className:"flex flex-col gap-1",children:o.map(a=>w.jsxs("li",{className:"min-w-0 text-xs",children:[w.jsx("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary block truncate underline underline-offset-2",title:a.title||a.url,children:a.title||a.url}),a.snippet&&w.jsx("p",{className:"text-muted-foreground line-clamp-2 break-words",children:a.snippet})]},a.url))}),e.resolved&&!e.isError&&!e.denied&&!o&&typeof e.output=="string"&&w.jsx(Nc,{label:t("agent.tool.result"),text:e.output})]})}function bQ({call:e}){const{t}=mn(),n=Xa(e.input)?e.input:{},r=typeof n.url=="string"?n.url:"",o=typeof e.output=="string"?e.output:"";return w.jsxs("div",{className:"flex flex-col gap-1.5",children:[r&&w.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"text-primary block truncate text-xs underline underline-offset-2",title:r,children:r}),e.resolved&&!e.isError&&!e.denied&&o&&w.jsx(Nc,{label:t("agent.tool.result"),text:o})]})}const vQ=/^[A-Za-z0-9+/]{256,}={0,2}$/,xQ=/^https?:\/\/\S+\.(png|jpe?g|webp|gif)(\?\S*)?$/i;function wQ(e){return typeof e!="string"||e.length===0?null:e.startsWith("data:image/")||xQ.test(e)?e:vQ.test(e.replace(/\s/g,""))?`data:image/png;base64,${e.replace(/\s/g,"")}`:null}function SQ(e){if(!e.resolved||e.isError||e.denied)return[];const t=[],n=(r,o)=>{if(t.length>=8||o>3)return;const a=wQ(r);if(a){t.push(a);return}if(Array.isArray(r)){for(const l of r)n(l,o+1);return}if(Xa(r))for(const l of["result","image","images","url","b64_json","data"])l in r&&n(r[l],o+1)};return n(e.output,0),[...new Set(t)]}function EQ({images:e}){return e.length===0?null:w.jsx("div",{className:"flex flex-wrap gap-2",children:e.map((t,n)=>w.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"block",children:w.jsx("img",{src:t,alt:"generated",className:"max-h-64 max-w-full rounded-md border border-border object-contain",loading:"lazy"})},n))})}function TQ({call:e,hideOutput:t}){const{t:n}=mn();return w.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.input!==void 0&&w.jsx(Nc,{label:n("agent.tool.input"),text:vx(e.input)}),!t&&e.resolved&&!e.isError&&!e.denied&&e.output!==void 0&&w.jsx(Nc,{label:n("agent.tool.result"),text:vx(e.output)})]})}function RQ({call:e,confirmationId:t,onDecide:n,className:r}){const{t:o}=mn(),a=!!t&&!e.resolved,l=e.resolved&&e.denied,c=e.resolved&&!l?fQ(e):null,f=!e.resolved&&!a,d=l&&typeof e.output=="string"?e.output:"",m=`agent.tool.${e.toolName}`,h=["send_input","read_screen","web_search","fetch_url"].includes(e.toolName)?o(m):e.toolName,y=SQ(e);return w.jsxs("div",{"data-testid":`agent-tool-card-${e.toolCallId}`,"data-tool-name":e.toolName,"data-tool-denied":l||void 0,className:De("border-border bg-card flex max-w-full min-w-0 flex-col gap-1.5 self-start rounded-lg border p-2",c!==null&&"border-destructive/50",l&&"opacity-80",r),children:[w.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium",children:[hQ(e.toolName),w.jsx("span",{className:"min-w-0 truncate",children:h}),f&&w.jsx(tl,{className:"text-muted-foreground size-3 animate-spin"}),e.resolved&&!l&&c===null&&w.jsx(Up,{className:"size-3 text-emerald-500"}),c!==null&&w.jsx(fd,{className:"text-destructive size-3"}),l&&w.jsxs("span",{className:"text-destructive flex items-center gap-0.5",children:[w.jsx(Ko,{className:"size-3"}),o("agent.tool.denied")]})]}),e.toolName==="send_input"&&w.jsx(mQ,{call:e}),e.toolName==="read_screen"&&w.jsx(gQ,{call:e}),e.toolName==="web_search"&&w.jsx(yQ,{call:e}),e.toolName==="fetch_url"&&w.jsx(bQ,{call:e}),!["send_input","read_screen","web_search","fetch_url"].includes(e.toolName)&&w.jsx(TQ,{call:e,hideOutput:y.length>0}),w.jsx(EQ,{images:y}),c!==null&&w.jsx("p",{className:"text-destructive text-xs break-words whitespace-pre-wrap",children:c}),d&&w.jsx("p",{className:"text-muted-foreground text-xs break-words whitespace-pre-wrap",children:d}),a&&t&&w.jsxs("div",{"data-testid":`agent-tool-approval-${e.toolCallId}`,className:"flex items-center gap-2 pt-1",children:[w.jsx("span",{className:"text-muted-foreground min-w-0 flex-1 text-xs",children:o("agent.confirm.title")}),w.jsxs(Ht,{"data-testid":"agent-confirm-approve",size:"xs",variant:"secondary",onClick:()=>n==null?void 0:n(t,!0),children:[w.jsx(Up,{}),o("agent.confirm.approve")]}),w.jsxs(Ht,{"data-testid":"agent-confirm-deny",size:"xs",variant:"destructive",onClick:()=>n==null?void 0:n(t,!1),children:[w.jsx(Ko,{}),o("agent.confirm.deny")]})]})]})}function CQ({text:e,className:t}){return w.jsx("div",{"data-testid":"agent-user-message",className:De("bg-primary text-primary-foreground max-w-[85%] self-end rounded-2xl px-3 py-2 text-sm whitespace-pre-wrap break-words",t),children:e})}const kQ=48;function MQ(){return w.jsxs("div",{"data-testid":"agent-running-indicator",className:"flex items-center gap-1 self-start px-1",children:[w.jsx("span",{className:"bg-muted-foreground size-1.5 animate-pulse rounded-full"}),w.jsx("span",{className:"bg-muted-foreground size-1.5 animate-pulse rounded-full [animation-delay:150ms]"}),w.jsx("span",{className:"bg-muted-foreground size-1.5 animate-pulse rounded-full [animation-delay:300ms]"})]})}function OQ({blocks:e,running:t,emptyText:n,confirmationByToolCallId:r,onDecide:o,className:a}){const{t:l}=mn(),c=v.useRef(null),f=v.useRef(!0),[d,m]=v.useState(!1),h=()=>{const g=c.current;g&&(g.scrollTop=g.scrollHeight,f.current=!0,m(!1))};v.useEffect(()=>{if(f.current){const g=c.current;g&&(g.scrollTop=g.scrollHeight)}else m(!0)},[e,t]);const y=()=>{const g=c.current;if(!g)return;const E=g.scrollHeight-g.scrollTop-g.clientHeight<kQ;f.current=E,m(!E)};return e.length===0&&!t?w.jsx("div",{"data-testid":"agent-chat-thread",className:De("flex min-h-0 flex-1 items-center justify-center p-4",a),children:w.jsx("p",{className:"text-muted-foreground text-sm",children:n})}):w.jsxs("div",{className:De("relative min-h-0 flex-1",a),children:[w.jsx("div",{ref:c,"data-testid":"agent-chat-thread",className:"h-full overflow-y-auto p-3",onScroll:y,children:w.jsxs("div",{className:"flex flex-col gap-3",children:[e.map(g=>{switch(g.kind){case"user":return w.jsx(CQ,{text:g.text},g.key);case"assistant-text":return w.jsx(QX,{text:g.text,streaming:g.streaming},g.key);case"reasoning":return w.jsx(uQ,{text:g.text,streaming:g.streaming},g.key);case"tool-call":return w.jsx(RQ,{call:g.call,confirmationId:r.get(g.call.toolCallId),onDecide:o},g.key);default:return null}}),t&&w.jsx(MQ,{})]})}),d&&w.jsx(Ht,{"data-testid":"agent-scroll-to-bottom",size:"icon-sm",variant:"secondary",className:"absolute right-3 bottom-3 z-10 rounded-full shadow-md",onClick:h,"aria-label":l("agent.panel.scrollToBottom"),children:w.jsx(P8,{})})]})}const JA=v.createContext(null),eD=v.createContext(null);function go(){const e=v.useContext(JA);if(e===null)throw new Error(Rn(60));return e}function tD(){const e=v.useContext(eD);if(e===null)throw new Error(Rn(61));return e}const NQ=(e,t)=>Object.is(e,t);function Ac(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function AQ(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:Ac(t,r,n))}function bd(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:Ac(r,t,n))}function DQ(e,t,n){return e.filter(r=>!Ac(t,r,n))}function xx(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function nD(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function _Q(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(nD(e)){for(const t of e)for(const n of t.items)if(n&&n.value==null&&n.label!=null)return!0;return!1}for(const t of e)if(t&&t.value==null&&t.label!=null)return!0;return!1}function IQ(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return xx(e)}function Xl(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?xx(e.value):xx(e)}function rD(e,t,n){function r(){return IQ(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){const o=nD(t)?t.flatMap(a=>a.items):t;if(e==null||typeof e!="object"){const a=o.find(l=>l.value===e);return a&&a.label!=null?a.label:r()}if("value"in e){const a=o.find(l=>l&&l.value===e.value);if(a&&a.label!=null)return a.label}}return r()}function PQ(e,t,n){return e.reduce((r,o,a)=>(a>0&&r.push(", "),r.push(w.jsx(v.Fragment,{children:rD(o,t,n)},a)),r),[])}const St={id:We(e=>e.id),modal:We(e=>e.modal),multiple:We(e=>e.multiple),items:We(e=>e.items),itemToStringLabel:We(e=>e.itemToStringLabel),itemToStringValue:We(e=>e.itemToStringValue),isItemEqualToValue:We(e=>e.isItemEqualToValue),value:We(e=>e.value),hasSelectedValue:We(e=>{const{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Xl(t,r)!==""}),hasNullItemLabel:We((e,t)=>t?_Q(e.items):!1),open:We(e=>e.open),mounted:We(e=>e.mounted),forceMount:We(e=>e.forceMount),transitionStatus:We(e=>e.transitionStatus),openMethod:We(e=>e.openMethod),activeIndex:We(e=>e.activeIndex),selectedIndex:We(e=>e.selectedIndex),isActive:We((e,t)=>e.activeIndex===t),isSelected:We((e,t,n)=>{const r=e.isItemEqualToValue,o=e.value;return e.multiple?Array.isArray(o)&&o.some(a=>Ac(n,a,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:Ac(n,o,r)}),isSelectedByFocus:We((e,t)=>e.selectedIndex===t),popupProps:We(e=>e.popupProps),triggerProps:We(e=>e.triggerProps),triggerElement:We(e=>e.triggerElement),positionerElement:We(e=>e.positionerElement),listElement:We(e=>e.listElement),scrollUpArrowVisible:We(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:We(e=>e.scrollDownArrowVisible),hasScrollArrows:We(e=>e.hasScrollArrows)};function LQ(e){const{id:t,value:n,defaultValue:r=null,onValueChange:o,open:a,defaultOpen:l=!1,onOpenChange:c,name:f,autoComplete:d,disabled:m=!1,readOnly:h=!1,required:y=!1,modal:g=!0,actionsRef:x,inputRef:E,onOpenChangeComplete:R,items:T,multiple:C=!1,itemToStringLabel:k,itemToStringValue:M,isItemEqualToValue:D=NQ,highlightItemOnHover:O=!0,children:N}=e,{clearErrors:_}=hw(),{setDirty:q,setTouched:F,setFocused:G,shouldValidateOnChange:P,validityData:U,setFilled:H,name:B,disabled:j,validation:z,validationMode:V}=Lc(),K=bm({id:t}),L=j||m,$=B??f,[W,I]=Cc({controlled:n,default:C?r??Ka:r,name:"Select",state:"value"}),[Q,le]=Cc({controlled:a,default:l,name:"Select",state:"open"}),oe=v.useRef([]),Z=v.useRef([]),ue=v.useRef(null),ve=v.useRef(null),Se=v.useRef(0),Pe=v.useRef(null),te=v.useRef([]),he=v.useRef(!1),ye=v.useRef(!1),Le=v.useRef(null),Oe=v.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),Te=v.useRef(!1),{mounted:Ce,setMounted:J,transitionStatus:Ee}=Jd(Q),{openMethod:xe,triggerProps:Be,reset:Ve}=$w(Q),_e=rr(()=>new oN({id:K,modal:g,multiple:C,itemToStringLabel:k,itemToStringValue:M,isItemEqualToValue:D,value:W,open:Q,mounted:Ce,transitionStatus:Ee,items:T,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,ut=Rt(_e,St.activeIndex),pe=Rt(_e,St.selectedIndex),Re=Rt(_e,St.triggerElement),ee=Rt(_e,St.positionerElement),fe=v.useMemo(()=>C&&Array.isArray(W)&&W.length===0?"":Xl(W,M),[C,W,M]),Ne=v.useMemo(()=>C&&Array.isArray(W)?W.map(Je=>Xl(Je,M)):Xl(W,M),[C,W,M]),Ue=lr(_e.state.triggerElement);vw({id:K,commit:z.commit,value:W,controlRef:Ue,name:$,getValue:()=>Ne});const $e=v.useRef(W);qe(()=>{W!==$e.current&&_e.set("forceMount",!0)},[_e,W]),qe(()=>{H(C?Array.isArray(W)&&W.length>0:W!=null)},[C,W,H]),qe(function(){if(Q)return;const Ot=te.current;if(C){const ie=Array.isArray(W)?W:[];if(ie.length===0){_e.set("selectedIndex",null);return}const de=ie[ie.length-1],ke=bd(Ot,de,D);_e.set("selectedIndex",ke===-1?null:ke);return}const X=bd(Ot,W,D);_e.set("selectedIndex",X===-1?null:X)},[C,Q,W,te,D,_e]),qN(W,()=>{_($),q(W!==U.initialValue),P()?z.commit(W):z.commit(W,!0)});const et=Ge((Je,Ot)=>{if(c==null||c(Je,Ot),!Ot.isCanceled&&(le(Je),!Je&&(Ot.reason===Js||Ot.reason===vm)&&(F(!0),G(!1),V==="onBlur"&&z.commit(W)),!Je&&_e.state.activeIndex!==null)){const X=oe.current[_e.state.activeIndex];queueMicrotask(()=>{X==null||X.setAttribute("tabindex","-1")})}}),ze=Ge(()=>{J(!1),_e.set("activeIndex",null),Ve(),R==null||R(!1)});Qo({enabled:!x,open:Q,ref:ue,onComplete(){Q||ze()}}),v.useImperativeHandle(x,()=>({unmount:ze}),[ze]);const Ze=Ge((Je,Ot)=>{o==null||o(Je,Ot),!Ot.isCanceled&&I(Je)}),nt=Ge(()=>{const Je=_e.state.listElement||ue.current;if(!Je)return;const Ot=Je.scrollTop,X=Je.scrollTop+Je.clientHeight,ie=Ot>1,de=X<Je.scrollHeight-1;_e.state.scrollUpArrowVisible!==ie&&_e.set("scrollUpArrowVisible",ie),_e.state.scrollDownArrowVisible!==de&&_e.set("scrollDownArrowVisible",de)}),Ct=sN({open:Q,onOpenChange:et,elements:{reference:Re,floating:ee}}),zt=YO(Ct,{enabled:!h&&!L,event:"mousedown"}),bt=Tm(Ct,{bubbles:!1}),Dt=fN(Ct,{enabled:!h&&!L,listRef:oe,activeIndex:ut,selectedIndex:pe,disabledIndices:Ka,onNavigate(Je){Je===null&&!Q||_e.set("activeIndex",Je)},focusItemOnHover:!1}),ot=pN(Ct,{enabled:!h&&!L&&(Q||!C),listRef:Z,activeIndex:ut,selectedIndex:pe,onMatch(Je){Q?_e.set("activeIndex",Je):Ze(te.current[Je],yt("none"))},onTypingChange(Je){he.current=Je}}),{getReferenceProps:ft,getFloatingProps:vt,getItemProps:Ke}=tf([zt,bt,Dt,ot]),Mt=v.useMemo(()=>ki(ft(),Be,K?{id:K}:Pn),[ft,Be,K]);km(()=>{_e.update({popupProps:vt(),triggerProps:Mt})}),qe(()=>{_e.update({id:K,modal:g,multiple:C,value:W,open:Q,mounted:Ce,transitionStatus:Ee,popupProps:vt(),triggerProps:Mt,items:T,itemToStringLabel:k,itemToStringValue:M,isItemEqualToValue:D,openMethod:xe})},[_e,K,g,C,W,Q,Ce,Ee,vt,Mt,T,k,M,D,xe]);const Lt=v.useMemo(()=>({store:_e,name:$,required:y,disabled:L,readOnly:h,multiple:C,itemToStringLabel:k,itemToStringValue:M,highlightItemOnHover:O,setValue:Ze,setOpen:et,listRef:oe,popupRef:ue,scrollHandlerRef:ve,handleScrollArrowVisibility:nt,scrollArrowsMountedCountRef:Se,getItemProps:Ke,events:Ct.context.events,valueRef:Pe,valuesRef:te,labelsRef:Z,typingRef:he,selectionRef:Oe,selectedItemTextRef:Le,validation:z,onOpenChangeComplete:R,keyboardActiveRef:ye,alignItemWithTriggerActiveRef:Te,initialValueRef:$e}),[_e,$,y,L,h,C,k,M,O,Ze,et,Ke,Ct.context.events,z,R,nt]),kt=Hi(E,z.inputRef),hn=C&&Array.isArray(W)&&W.length>0,qt=v.useMemo(()=>!C||!Array.isArray(W)||!$?null:W.map(Je=>{const Ot=Xl(Je,M);return w.jsx("input",{type:"hidden",name:$,value:Ot},Ot)}),[C,W,$,M]);return w.jsx(JA.Provider,{value:Lt,children:w.jsxs(eD.Provider,{value:Ct,children:[N,w.jsx("input",{...z.getInputValidationProps({onFocus(){var Je;(Je=_e.state.triggerElement)==null||Je.focus({focusVisible:!0})},onChange(Je){if(Je.nativeEvent.defaultPrevented)return;const Ot=Je.target.value,X=yt(qi,Je.nativeEvent);function ie(){if(C)return;const de=te.current.find(ke=>Xl(ke,M).toLowerCase()===Ot.toLowerCase());de!=null&&(q(de!==U.initialValue),Ze(de,X),P()&&z.commit(de))}_e.set("forceMount",!0),queueMicrotask(ie)}}),name:C?void 0:$,autoComplete:d,value:fe,disabled:L,required:y&&!hn,readOnly:h,ref:kt,style:$?HO:Sm,tabIndex:-1,"aria-hidden":!0}),qt]})})}function iD(e){const t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),r=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||r.content!=="none"))return t;const a=parseFloat(n.width)||0,l=parseFloat(n.height)||0,c=parseFloat(r.width)||0,f=parseFloat(r.height)||0,d=Math.max(t.width,a,c),m=Math.max(t.height,l,f),h=d-t.width,y=m-t.height;return{left:t.left-h/2,right:t.right+h/2,top:t.top-y/2,bottom:t.bottom+y/2}}const Qh=2,jQ=400,$k=200,zQ={...zp,...fw,value:()=>null},FQ=v.forwardRef(function(t,n){const{render:r,className:o,id:a,disabled:l=!1,nativeButton:c=!0,...f}=t,{setTouched:d,setFocused:m,validationMode:h,state:y,disabled:g}=Lc(),{labelId:x}=pm(),{store:E,setOpen:R,selectionRef:T,validation:C,readOnly:k,required:M,alignItemWithTriggerActiveRef:D,disabled:O,keyboardActiveRef:N}=go(),_=g||O||l,q=Rt(E,St.open),F=Rt(E,St.value),G=Rt(E,St.triggerProps),P=Rt(E,St.positionerElement),U=Rt(E,St.listElement),H=Rt(E,St.id),B=Rt(E,St.hasSelectedValue),j=!B&&q,z=Rt(E,St.hasNullItemLabel,j),V=a??H;bm({id:V});const K=lr(P),L=v.useRef(null),{getButtonProps:$,buttonRef:W}=Wo({disabled:_,native:c}),I=Ge(te=>{E.set("triggerElement",te)}),Q=Hi(n,L,W,I),le=Dn(),oe=Dn(),Z=Dn(),ue=Dn();v.useEffect(()=>{if(q)return!(B||z)?Z.start(jQ,()=>{T.current.allowUnselectedMouseUp=!0,T.current.allowSelectedMouseUp=!0}):ue.start($k,()=>{T.current.allowUnselectedMouseUp=!0,Z.start($k,()=>{T.current.allowSelectedMouseUp=!0})}),()=>{Z.clear(),ue.clear()};T.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},oe.clear()},[q,B,z,T,oe,Z,ue]);const ve=v.useMemo(()=>{var te;return(U==null?void 0:U.id)??((te=Od(P))==null?void 0:te.id)},[U,P]),Se=ki(G,{id:V,role:"combobox","aria-expanded":q?"true":"false","aria-haspopup":"listbox","aria-controls":q?ve:void 0,"aria-labelledby":x,"aria-readonly":k||void 0,"aria-required":M||void 0,tabIndex:_?-1:0,ref:Q,onFocus(te){m(!0),q&&D.current&&R(!1,yt(qi,te.nativeEvent)),le.start(0,()=>{E.set("forceMount",!0)})},onBlur(te){Tt(P,te.relatedTarget)||(d(!0),m(!1),h==="onBlur"&&C.commit(F))},onPointerMove(){N.current=!1},onKeyDown(){N.current=!0},onMouseDown(te){if(q)return;const he=Gt(te.currentTarget);function ye(Le){if(!L.current)return;const Oe=Le.target;if(Tt(L.current,Oe)||Tt(K.current,Oe)||Oe===L.current)return;const Te=iD(L.current);Le.clientX>=Te.left-Qh&&Le.clientX<=Te.right+Qh&&Le.clientY>=Te.top-Qh&&Le.clientY<=Te.bottom+Qh||R(!1,yt(xw,Le))}oe.start(0,()=>{he.addEventListener("mouseup",ye,{once:!0})})}},C.getValidationProps,f,$);Se.role="combobox";const Pe={...y,open:q,disabled:_,value:F,readOnly:k,placeholder:!B};return At("button",t,{ref:[n,L],state:Pe,stateAttributesMapping:zQ,props:Se})}),BQ={value:()=>null},UQ=v.forwardRef(function(t,n){const{className:r,render:o,children:a,placeholder:l,...c}=t,{store:f,valueRef:d}=go(),m=Rt(f,St.value),h=Rt(f,St.items),y=Rt(f,St.itemToStringLabel),g=Rt(f,St.hasSelectedValue),x=!g&&l!=null&&a==null,E=Rt(f,St.hasNullItemLabel,x),R={value:m,placeholder:!g};let T=null;return typeof a=="function"?T=a(m):a!=null?T=a:!g&&l!=null&&!E?T=l:Array.isArray(m)?T=PQ(m,h,y):T=rD(m,h,y),At("span",t,{state:R,ref:[n,d],props:[{children:T},c],stateAttributesMapping:BQ})}),HQ=v.forwardRef(function(t,n){const{className:r,render:o,...a}=t,{store:l}=go(),f={open:Rt(l,St.open)};return At("span",t,{state:f,ref:n,props:[{"aria-hidden":!0,children:"▼"},a],stateAttributesMapping:LO})}),qQ=v.createContext(void 0),VQ=v.forwardRef(function(t,n){const{store:r}=go(),o=Rt(r,St.mounted),a=Rt(r,St.forceMount);return o||a?w.jsx(qQ.Provider,{value:!0,children:w.jsx(kw,{ref:n,...t})}):null}),oD=v.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function $Q(){return v.useContext(oD)}function Bm(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:o}=e,a=Ge(o),l=v.useRef(0),c=rr(YQ).current,f=rr(GQ).current,[d,m]=v.useState(0),h=v.useRef(d),y=Ge((T,C)=>{f.set(T,C??null),h.current+=1,m(h.current)}),g=Ge(T=>{f.delete(T),h.current+=1,m(h.current)}),x=v.useMemo(()=>{const T=new Map;return Array.from(f.keys()).filter(k=>k.isConnected).sort(KQ).forEach((k,M)=>{const D=f.get(k)??{};T.set(k,{...D,index:M})}),T},[f,d]);qe(()=>{if(typeof MutationObserver!="function"||x.size===0)return;const T=new MutationObserver(C=>{const k=new Set,M=D=>k.has(D)?k.delete(D):k.add(D);C.forEach(D=>{D.removedNodes.forEach(M),D.addedNodes.forEach(M)}),k.size===0&&(h.current+=1,m(h.current))});return x.forEach((C,k)=>{k.parentElement&&T.observe(k.parentElement,{childList:!0})}),()=>{T.disconnect()}},[x]),qe(()=>{h.current===d&&(n.current.length!==x.size&&(n.current.length=x.size),r&&r.current.length!==x.size&&(r.current.length=x.size),l.current=x.size),a(x)},[a,x,n,r,d]),qe(()=>()=>{n.current=[]},[n]),qe(()=>()=>{r&&(r.current=[])},[r]);const E=Ge(T=>(c.add(T),()=>{c.delete(T)}));qe(()=>{c.forEach(T=>T(x))},[c,x]);const R=v.useMemo(()=>({register:y,unregister:g,subscribeMapChange:E,elementsRef:n,labelsRef:r,nextIndexRef:l}),[y,g,E,n,r,l]);return w.jsx(oD.Provider,{value:R,children:t})}function GQ(){return new Map}function YQ(){return new Set}function KQ(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const aD=v.createContext(void 0);function b0(){const e=v.useContext(aD);if(!e)throw new Error(Rn(59));return e}function Kp(e,t){e&&Object.assign(e.style,t)}const sD={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},WQ={position:"fixed"},XQ=v.forwardRef(function(t,n){const{anchor:r,positionMethod:o="absolute",className:a,render:l,side:c="bottom",align:f="center",sideOffset:d=0,alignOffset:m=0,collisionBoundary:h="clipping-ancestors",collisionPadding:y,arrowPadding:g=5,sticky:x=!1,disableAnchorTracking:E,alignItemWithTrigger:R=!0,collisionAvoidance:T=$2,...C}=t,{store:k,listRef:M,labelsRef:D,alignItemWithTriggerActiveRef:O,selectedItemTextRef:N,valuesRef:_,initialValueRef:q,popupRef:F,setValue:G}=go(),P=tD(),U=Rt(k,St.open),H=Rt(k,St.mounted),B=Rt(k,St.modal),j=Rt(k,St.value),z=Rt(k,St.openMethod),V=Rt(k,St.positionerElement),K=Rt(k,St.triggerElement),L=Rt(k,St.isItemEqualToValue),$=Rt(k,St.transitionStatus),W=v.useRef(null),I=v.useRef(null),[Q,le]=v.useState(R),oe=H&&Q&&z!=="touch";!H&&Q!==R&&le(R),qe(()=>{H||(St.scrollUpArrowVisible(k.state)&&k.set("scrollUpArrowVisible",!1),St.scrollDownArrowVisible(k.state)&&k.set("scrollDownArrowVisible",!1))},[k,H]),v.useImperativeHandle(O,()=>oe),Vw((oe||B)&&U&&z!=="touch",K);const Z=Ww({anchor:r,floatingRootContext:P,positionMethod:o,mounted:H,side:c,sideOffset:d,align:f,alignOffset:m,arrowPadding:g,collisionBoundary:h,collisionPadding:y,sticky:x,disableAnchorTracking:E??oe,collisionAvoidance:T,keepMounted:!0}),ue=oe?"none":Z.side,ve=oe?WQ:Z.positionerStyles,Se=v.useMemo(()=>{const Te={};return U||(Te.pointerEvents="none"),{role:"presentation",hidden:!H,style:{...ve,...Te}}},[U,H,ve]),Pe={open:U,side:ue,align:Z.align,anchorHidden:Z.anchorHidden},te=Ge(Te=>{k.set("positionerElement",Te)}),he=At("div",t,{ref:[n,te],state:Pe,stateAttributesMapping:po,props:[Se,Bc($),C]}),ye=v.useRef(0),Le=Ge(Te=>{if(Te.size===0&&ye.current===0||_.current.length===0)return;const Ce=ye.current;if(ye.current=Te.size,Te.size===Ce)return;const J=yt(qi);if(Ce!==0&&!k.state.multiple&&j!==null&&bd(_.current,j,L)===-1){const xe=q.current,Ve=xe!=null&&bd(_.current,xe,L)!==-1?xe:null;G(Ve,J),Ve===null&&(k.set("selectedIndex",null),N.current=null)}if(Ce!==0&&k.state.multiple&&Array.isArray(j)){const Ee=Be=>bd(_.current,Be,L)!==-1,xe=j.filter(Be=>Ee(Be));(xe.length!==j.length||xe.some(Be=>!AQ(j,Be,L)))&&(G(xe,J),xe.length===0&&(k.set("selectedIndex",null),N.current=null))}if(U&&oe){k.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Ee={height:""};Kp(V,Ee),Kp(F.current,Ee)}}),Oe=v.useMemo(()=>({...Z,side:ue,alignItemWithTriggerActive:oe,setControlledAlignItemWithTrigger:le,scrollUpArrowRef:W,scrollDownArrowRef:I}),[Z,ue,oe,le]);return w.jsx(Bm,{elementsRef:M,labelsRef:D,onMapChange:Le,children:w.jsxs(aD.Provider,{value:Oe,children:[H&&B&&w.jsx(Hw,{inert:Uw(!U),cutout:K}),he]})})});function lD(e){const t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}const Zh="base-ui-disable-scrollbar",Id={className:Zh,getElement(e){return w.jsx("style",{nonce:e,href:Zh,precedence:"base-ui:low",children:`.${Zh}{scrollbar-width:none}.${Zh}::-webkit-scrollbar{display:none}`})}},QQ=v.createContext(void 0);function cD(e){return v.useContext(QQ)}function $o(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const ZQ=v.createContext(void 0),JQ={disableStyleElements:!1};function uD(){return v.useContext(ZQ)??JQ}const Os=1,eZ={...po,...Xo},tZ=v.forwardRef(function(t,n){const{render:r,className:o,finalFocus:a,...l}=t,{store:c,popupRef:f,onOpenChangeComplete:d,setOpen:m,valueRef:h,selectedItemTextRef:y,keyboardActiveRef:g,multiple:x,handleScrollArrowVisibility:E,scrollHandlerRef:R,highlightItemOnHover:T}=go(),{side:C,align:k,alignItemWithTriggerActive:M,setControlledAlignItemWithTrigger:D,scrollDownArrowRef:O,scrollUpArrowRef:N}=b0(),_=cD()!=null,q=tD(),{nonce:F,disableStyleElements:G}=uD(),P=Dn(),U=Rt(c,St.id),H=Rt(c,St.open),B=Rt(c,St.mounted),j=Rt(c,St.popupProps),z=Rt(c,St.transitionStatus),V=Rt(c,St.triggerElement),K=Rt(c,St.positionerElement),L=Rt(c,St.listElement),$=v.useRef(0),W=v.useRef(!1),I=v.useRef(0),Q=v.useRef(!1),le=v.useRef({}),oe=Zd(),Z=Ge(Pe=>{if(!K||!f.current||!Q.current)return;if(W.current||!M){E();return}const te=K.style.top==="0px",he=K.style.bottom==="0px",ye=K.getBoundingClientRect().height,Le=Gt(K),Oe=getComputedStyle(K),Te=parseFloat(Oe.marginTop),Ce=parseFloat(Oe.marginBottom),J=Gk(getComputedStyle(f.current)),Ee=Math.min(Le.documentElement.clientHeight-Te-Ce,J),xe=Pe.scrollTop,Be=Yk(Pe);let Ve=0,_e=null,ut=!1,pe=!1;const Re=fe=>{K.style.height=`${fe}px`},ee=(fe,Ne)=>{const Ue=$o(fe,0,Ee-ye);Ue>0&&Re(ye+Ue),Pe.scrollTop=Ne,Ee-(ye+Ue)<=Os&&(W.current=!0),E()};if(te){const fe=Be-xe,Ne=ye+fe,Ue=Math.min(Ne,Ee);if(Ve=Ue,fe<=Os){ee(fe,Be);return}Ee-Ue>Os?pe=!0:ut=!0}else if(he){const fe=xe,Ne=ye+fe,Ue=Math.min(Ne,Ee),$e=Ne-Ee;if(Ve=Ue,fe<=Os){ee(fe,0);return}Ee-Ue>Os?_e=0:(ut=!0,xe<Be&&(_e=xe-(fe-$e)))}if(Ve=Math.ceil(Ve),Ve!==0&&Re(Ve),pe||_e!=null){const fe=Yk(Pe),Ne=pe?fe:$o(_e,0,fe);Math.abs(Pe.scrollTop-Ne)>Os&&(Pe.scrollTop=Ne)}(ut||Ve>=Ee-Os)&&(W.current=!0),E()});v.useImperativeHandle(R,()=>Z,[Z]),Qo({open:H,ref:f,onComplete(){H&&(d==null||d(!0))}});const ue={open:H,transitionStatus:z,side:C,align:k};qe(()=>{!K||!f.current||Object.keys(le.current).length||(le.current={top:K.style.top||"0",left:K.style.left||"0",right:K.style.right,height:K.style.height,bottom:K.style.bottom,minHeight:K.style.minHeight,maxHeight:K.style.maxHeight,marginTop:K.style.marginTop,marginBottom:K.style.marginBottom})},[f,K]),qe(()=>{H||M||(Q.current=!1,W.current=!1,$.current=0,I.current=0,Kp(K,le.current))},[H,M,K,f]),qe(()=>{const Pe=f.current;if(!(!H||!V||!K||!Pe||c.state.transitionStatus==="ending")){if(!M){Q.current=!0,oe.request(E),Pe.style.removeProperty("--transform-origin");return}queueMicrotask(()=>{var he;const te=nZ(Pe);Pe.style.removeProperty("--transform-origin");try{const ye=getComputedStyle(K),Le=getComputedStyle(Pe),Oe=Gt(V),Te=Hn(K),Ce=V.getBoundingClientRect(),J=K.getBoundingClientRect(),Ee=Ce.left,xe=Ce.height,Be=L||Pe,Ve=Be.scrollHeight,_e=parseFloat(Le.borderBottomWidth),ut=parseFloat(ye.marginTop)||10,pe=parseFloat(ye.marginBottom)||10,Re=parseFloat(ye.minHeight)||100,ee=Gk(Le),fe=5,Ne=5,Ue=20,$e=Oe.documentElement.clientHeight-ut-pe,et=Oe.documentElement.clientWidth,ze=$e-Ce.bottom+xe,Ze=y.current,nt=h.current;let Ct,zt=0,bt=0;if(Ze&&nt){const Ot=nt.getBoundingClientRect();Ct=Ze.getBoundingClientRect();const X=Ot.left-Ee,ie=Ct.left-J.left,de=Ot.top-Ce.top+Ot.height/2,ke=Ct.top-J.top+Ct.height/2;zt=X-ie,bt=ke-de}const Dt=ze+bt+pe+_e;let ot=Math.min($e,Dt);const ft=$e-ut-pe,vt=Dt-ot,Ke=Math.max(fe,Ee+zt),Mt=et-Ne,Lt=Math.max(0,Ke+J.width-Mt);K.style.left=`${Ke-Lt}px`,K.style.height=`${ot}px`,K.style.maxHeight="auto",K.style.marginTop=`${ut}px`,K.style.marginBottom=`${pe}px`,Pe.style.height="100%";const kt=Be.scrollHeight-Be.clientHeight,hn=vt>=kt;hn&&(ot=Math.min($e,J.height)-(vt-kt));const qt=Ce.top<Ue||Ce.bottom>$e-Ue||ot<Math.min(Ve,Re),Je=(((he=Te.visualViewport)==null?void 0:he.scale)??1)!==1&&gm;if(qt||Je){Q.current=!0,Kp(K,le.current),yr.flushSync(()=>D(!1));return}if(hn){const Ot=Math.max(0,$e-Dt);K.style.top=J.height>=ft?"0":`${Ot}px`,K.style.height=`${ot}px`,Be.scrollTop=Be.scrollHeight-Be.clientHeight,$.current=Math.max(Re,ot)}else K.style.bottom="0",$.current=Math.max(Re,ot),Be.scrollTop=vt;if(Ct){const Ot=J.top,X=J.height,ie=Ct.top+Ct.height/2,de=X>0?(ie-Ot)/X*100:50,ke=$o(de,0,100);Pe.style.setProperty("--transform-origin",`50% ${ke}%`)}($.current===$e||ot>=ee)&&(W.current=!0),E(),setTimeout(()=>{Q.current=!0})}finally{te()}})}},[c,H,K,V,h,y,f,E,M,D,oe,O,N,L]),v.useEffect(()=>{if(!M||!K||!H)return;const Pe=Hn(K);function te(he){m(!1,yt(oH,he))}return Pe.addEventListener("resize",te),()=>{Pe.removeEventListener("resize",te)}},[m,M,K,H]);const ve={...L?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":x||void 0,id:`${U}-list`},onKeyDown(Pe){g.current=!0,_&&Fw.has(Pe.key)&&Pe.stopPropagation()},onMouseMove(){g.current=!1},onPointerLeave(Pe){if(!T||lD(Pe)||Pe.pointerType==="touch")return;const te=Pe.currentTarget;P.start(0,()=>{c.set("activeIndex",null),te.focus({preventScroll:!0})})},onScroll(Pe){L||Z(Pe.currentTarget)},...M&&{style:L?{height:"100%"}:sD}},Se=At("div",t,{ref:[n,f],state:ue,stateAttributesMapping:eZ,props:[j,ve,Bc(z),{className:!L&&M?Id.className:void 0},l]});return w.jsxs(v.Fragment,{children:[!G&&Id.getElement(F),w.jsx(Ow,{context:q,modal:!1,disabled:!B,returnFocus:a,restoreFocus:!0,children:Se})]})});function Gk(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function Yk(e){return Math.max(0,e.scrollHeight-e.clientHeight)}const Kk=[["transform","none"],["scale","1"],["translate","0 0"]];function nZ(e){const{style:t}=e,n={};for(const[r,o]of Kk)n[r]=t.getPropertyValue(r),t.setProperty(r,o,"important");return()=>{for(const[r]of Kk){const o=n[r];o?t.setProperty(r,o):t.removeProperty(r)}}}const rZ=v.forwardRef(function(t,n){const{className:r,render:o,...a}=t,{store:l,scrollHandlerRef:c}=go(),{alignItemWithTriggerActive:f}=b0(),d=Rt(l,St.hasScrollArrows),m=Rt(l,St.openMethod),h=Rt(l,St.multiple),g={id:`${Rt(l,St.id)}-list`,role:"listbox","aria-multiselectable":h||void 0,onScroll(E){var R;(R=c.current)==null||R.call(c,E.currentTarget)},...f&&{style:sD},className:d&&m!=="touch"?Id.className:void 0},x=Ge(E=>{l.set("listElement",E)});return At("div",t,{ref:[n,x],props:[g,a]})});let dD=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function v0(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:o,index:a}=e,{register:l,unregister:c,subscribeMapChange:f,elementsRef:d,labelsRef:m,nextIndexRef:h}=$Q(),y=v.useRef(-1),[g,x]=v.useState(a??(o===dD.GuessFromOrder?()=>{if(y.current===-1){const T=h.current;h.current+=1,y.current=T}return y.current}:-1)),E=v.useRef(null),R=v.useCallback(T=>{var C;if(E.current=T,g!==-1&&T!==null&&(d.current[g]=T,m)){const k=t!==void 0;m.current[g]=k?t:((C=r==null?void 0:r.current)==null?void 0:C.textContent)??T.textContent}},[g,d,m,t,r]);return qe(()=>{if(a!=null)return;const T=E.current;if(T)return l(T,n),()=>{c(T)}},[a,l,c,n]),qe(()=>{if(a==null)return f(T=>{var k;const C=E.current?(k=T.get(E.current))==null?void 0:k.index:null;C!=null&&x(C)})},[a,f,x]),v.useMemo(()=>({ref:R,index:g}),[g,R])}const fD=v.createContext(void 0);function x0(){const e=v.useContext(fD);if(!e)throw new Error(Rn(57));return e}const iZ=v.memo(v.forwardRef(function(t,n){const{render:r,className:o,value:a=null,label:l,disabled:c=!1,nativeButton:f=!1,...d}=t,m=v.useRef(null),h=v0({label:l,textRef:m,indexGuessBehavior:dD.GuessFromOrder}),{store:y,getItemProps:g,setOpen:x,setValue:E,selectionRef:R,typingRef:T,valuesRef:C,keyboardActiveRef:k,multiple:M,highlightItemOnHover:D}=go(),O=Dn(),N=Rt(y,St.isActive,h.index),_=Rt(y,St.isSelected,h.index,a),q=Rt(y,St.isSelectedByFocus,h.index),F=Rt(y,St.isItemEqualToValue),G=h.index,P=G!==-1,U=v.useRef(null),H=lr(G);qe(()=>{if(!P)return;const oe=C.current;return oe[G]=a,()=>{delete oe[G]}},[P,G,a,C]),qe(()=>{if(!P)return;const oe=y.state.value;let Z=oe;M&&Array.isArray(oe)&&oe.length>0&&(Z=oe[oe.length-1]),Z!==void 0&&Ac(a,Z,F)&&y.set("selectedIndex",G)},[P,G,M,F,y,a]);const B={disabled:c,selected:_,highlighted:N},j=g({active:N,selected:_});j.onFocus=void 0,j.id=void 0;const z=v.useRef(null),V=v.useRef("mouse"),K=v.useRef(!1),{getButtonProps:L,buttonRef:$}=Wo({disabled:c,focusableWhenDisabled:!0,native:f});function W(oe){const Z=y.state.value;if(M){const ue=Array.isArray(Z)?Z:[],ve=_?DQ(ue,a,F):[...ue,a];E(ve,yt(ud,oe))}else E(a,yt(ud,oe)),x(!1,yt(ud,oe))}const I={role:"option","aria-selected":_,tabIndex:N?0:-1,onFocus(){y.set("activeIndex",G)},onMouseEnter(){!k.current&&y.state.selectedIndex===null&&D&&y.set("activeIndex",G)},onMouseMove(){D&&y.set("activeIndex",G)},onMouseLeave(oe){!D||k.current||lD(oe)||O.start(0,()=>{y.state.activeIndex===G&&y.set("activeIndex",null)})},onTouchStart(){R.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(oe){z.current=oe.key,y.set("activeIndex",G)},onClick(oe){K.current=!1,!(oe.type==="keydown"&&z.current===null)&&(c||z.current===" "&&T.current||V.current!=="touch"&&!N||(z.current=null,W(oe.nativeEvent)))},onPointerEnter(oe){V.current=oe.pointerType},onPointerDown(oe){V.current=oe.pointerType,K.current=!0},onMouseUp(oe){if(c)return;if(K.current){K.current=!1;return}const Z=!R.current.allowSelectedMouseUp&&_,ue=!R.current.allowUnselectedMouseUp&&!_;Z||ue||V.current!=="touch"&&!N||W(oe.nativeEvent)}},Q=At("div",t,{ref:[$,n,h.ref,U],state:B,props:[j,I,d,L]}),le=v.useMemo(()=>({selected:_,indexRef:H,textRef:m,selectedByFocus:q,hasRegistered:P}),[_,H,m,q,P]);return w.jsx(fD.Provider,{value:le,children:Q})})),oZ=v.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:o}=x0();return r||o?w.jsx(aZ,{...t,ref:n}):null}),aZ=v.memo(v.forwardRef((e,t)=>{const{render:n,className:r,keepMounted:o,...a}=e,{selected:l}=x0(),c=v.useRef(null),{transitionStatus:f,setMounted:d}=Jd(l),h=At("span",e,{ref:[t,c],state:{selected:l,transitionStatus:f},props:[{"aria-hidden":!0,children:"✔️"},a],stateAttributesMapping:Xo});return Qo({open:l,ref:c,onComplete(){l||d(!1)}}),h})),sZ=v.memo(v.forwardRef(function(t,n){const{indexRef:r,textRef:o,selectedByFocus:a,hasRegistered:l}=x0(),{selectedItemTextRef:c}=go(),{className:f,render:d,...m}=t,h=v.useCallback(g=>{if(!g||!l)return;const x=c.current===null||!c.current.isConnected;(a||x&&r.current===0)&&(c.current=g)},[c,r,a,l]);return At("div",t,{ref:[h,n,o],props:m})})),hD=v.forwardRef(function(t,n){const{render:r,className:o,direction:a,keepMounted:l=!1,...c}=t,{store:f,popupRef:d,listRef:m,handleScrollArrowVisibility:h,scrollArrowsMountedCountRef:y}=go(),{side:g,scrollDownArrowRef:x,scrollUpArrowRef:E}=b0(),R=a==="up"?St.scrollUpArrowVisible:St.scrollDownArrowVisible,T=Rt(f,R),C=Rt(f,St.openMethod),k=T&&C!=="touch",M=Dn(),D=a==="up"?E:x,{transitionStatus:O,setMounted:N}=Jd(k);qe(()=>(y.current+=1,f.state.hasScrollArrows||f.set("hasScrollArrows",!0),()=>{y.current=Math.max(0,y.current-1),y.current===0&&f.state.hasScrollArrows&&f.set("hasScrollArrows",!1)}),[f,y]),Qo({open:k,ref:D,onComplete(){k||N(!1)}});const F=At("div",t,{ref:[n,D],state:{direction:a,visible:k,side:g,transitionStatus:O},props:[{"aria-hidden":!0,children:a==="up"?"▲":"▼",style:{position:"absolute"},onMouseMove(P){if(P.movementX===0&&P.movementY===0||M.isStarted())return;f.set("activeIndex",null);function U(){var V;const H=f.state.listElement??d.current;if(!H)return;f.set("activeIndex",null),h();const B=H.scrollTop===0,j=Math.round(H.scrollTop+H.clientHeight)>=H.scrollHeight;if(m.current.length===0&&(a==="up"?f.set("scrollUpArrowVisible",!B):f.set("scrollDownArrowVisible",!j)),a==="up"&&B||a==="down"&&j){M.clear();return}if((f.state.listElement||d.current)&&m.current&&m.current.length>0){const K=m.current,L=((V=D.current)==null?void 0:V.offsetHeight)||0;if(a==="up"){let $=0;const W=H.scrollTop+L;for(let Q=0;Q<K.length;Q+=1){const le=K[Q];if(le&&le.offsetTop>=W){$=Q;break}}const I=Math.max(0,$-1);if(I<$){const Q=K[I];Q&&(H.scrollTop=Math.max(0,Q.offsetTop-L))}else H.scrollTop=0}else{let $=K.length-1;const W=H.scrollTop+H.clientHeight-L;for(let Q=0;Q<K.length;Q+=1){const le=K[Q];if(le&&le.offsetTop+le.offsetHeight>W){$=Math.max(0,Q-1);break}}const I=Math.min(K.length-1,$+1);if(I>$){const Q=K[I];Q&&(H.scrollTop=Q.offsetTop+Q.offsetHeight-H.clientHeight+L)}else H.scrollTop=H.scrollHeight-H.clientHeight}}M.start(40,U)}M.start(40,U)},onMouseLeave(){M.clear()}},c]});return k||l?F:null}),lZ=v.forwardRef(function(t,n){return w.jsx(hD,{...t,ref:n,direction:"down"})}),cZ=v.forwardRef(function(t,n){return w.jsx(hD,{...t,ref:n,direction:"up"})}),pD=v.createContext(void 0);function uZ(){const e=v.useContext(pD);if(e===void 0)throw new Error(Rn(56));return e}const dZ=v.forwardRef(function(t,n){const{className:r,render:o,...a}=t,[l,c]=v.useState(),f=v.useMemo(()=>({labelId:l,setLabelId:c}),[l,c]),d=At("div",t,{ref:n,props:[{role:"group","aria-labelledby":l},a]});return w.jsx(pD.Provider,{value:f,children:d})}),fZ=v.forwardRef(function(t,n){const{className:r,render:o,id:a,...l}=t,{setLabelId:c}=uZ(),f=Yi(a);return qe(()=>{c(f)},[f,c]),At("div",t,{ref:n,props:[{id:f},l]})}),yp=LQ;function hZ({className:e,...t}){return w.jsx(dZ,{"data-slot":"select-group",className:De("scroll-my-1 p-1",e),...t})}function ov({className:e,...t}){return w.jsx(UQ,{"data-slot":"select-value",className:De("flex flex-1 text-left",e),...t})}function bp({className:e,size:t="default",children:n,...r}){return w.jsxs(FQ,{"data-slot":"select-trigger","data-size":t,className:De("border-input data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-lg border bg-transparent py-2 pr-2 pl-2.5 text-sm transition-colors select-none focus-visible:ring-2 aria-invalid:ring-2 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-4 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...r,children:[n,w.jsx(HQ,{render:w.jsx(TN,{className:"text-muted-foreground size-4 pointer-events-none"})})]})}function vp({className:e,children:t,side:n="bottom",sideOffset:r=4,align:o="center",alignOffset:a=0,alignItemWithTrigger:l=!0,...c}){return w.jsx(VQ,{children:w.jsx(XQ,{side:n,sideOffset:r,align:o,alignOffset:a,alignItemWithTrigger:l,className:"isolate z-50",children:w.jsxs(tZ,{"data-slot":"select-content","data-align-trigger":l,className:De("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 min-w-36 rounded-lg shadow-md ring-1 duration-100 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto data-[align-trigger=true]:animate-none",e),...c,children:[w.jsx(mZ,{}),w.jsx(rZ,{children:t}),w.jsx(gZ,{})]})})})}function pZ({className:e,...t}){return w.jsx(fZ,{"data-slot":"select-label",className:De("text-muted-foreground px-1.5 py-1 text-xs",e),...t})}function Fo({className:e,children:t,...n}){return w.jsxs(iZ,{"data-slot":"select-item",className:De("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[w.jsx(sZ,{className:"flex flex-1 gap-2 shrink-0 whitespace-nowrap",children:t}),w.jsx(oZ,{render:w.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:w.jsx(Up,{className:"pointer-events-none"})})]})}function mZ({className:e,...t}){return w.jsx(cZ,{"data-slot":"select-scroll-up-button",className:De("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4 top-0 w-full",e),...t,children:w.jsx(Y8,{})})}function gZ({className:e,...t}){return w.jsx(lZ,{"data-slot":"select-scroll-down-button",className:De("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4 bottom-0 w-full",e),...t,children:w.jsx(TN,{})})}const wx="::";function Wk(e,t){return`${e??""}${wx}${t}`}function yZ(e){const t=e.indexOf(wx);return t<0?{providerId:null,modelId:e}:{providerId:e.slice(0,t)||null,modelId:e.slice(t+wx.length)}}function bZ({providerId:e,modelId:t,onChange:n,disabled:r,className:o}){var E;const{t:a}=mn(),{data:l}=oi({queryKey:["llm-providers"],queryFn:async()=>{const R=await fetch("/api/llm/providers");if(!R.ok)throw new Error("Failed to load providers");return await R.json()},throwOnError:!1}),{data:c}=oi({queryKey:["llm-settings"],queryFn:async()=>{const R=await fetch("/api/llm/settings");if(!R.ok)throw new Error("Failed to load settings");return await R.json()},throwOnError:!1}),f=((l==null?void 0:l.providers)??[]).filter(R=>R.enabled&&R.models.length>0),d=e??(c==null?void 0:c.settings.defaultProviderId)??null,m=t??(c==null?void 0:c.settings.defaultModelId)??null,h=m?Wk(d,m):"",y=f.some(R=>R.id===d&&R.models.includes(m??"")),g=((E=f.find(R=>R.id===d))==null?void 0:E.name)??null,x=m?g?`${g}/${m}`:m:a("agent.model.placeholder");return w.jsxs(yp,{value:h,onValueChange:R=>{if(typeof R!="string"||!R)return;const T=yZ(R);n(T.providerId,T.modelId)},disabled:r||f.length===0,children:[w.jsx(bp,{size:"sm",className:De("h-7 w-full min-w-0 border-transparent bg-transparent text-muted-foreground text-xs hover:border-border/40 dark:bg-transparent dark:hover:bg-transparent",o),"data-testid":"agent-model-picker","aria-label":a("agent.model.select"),children:w.jsx("span",{className:"min-w-0 truncate",children:x})}),w.jsxs(vp,{children:[!y&&m&&w.jsx(Fo,{value:h,className:"text-muted-foreground",children:m}),f.map(R=>w.jsxs(hZ,{children:[w.jsx(pZ,{children:R.name}),R.models.map(T=>w.jsx(Fo,{value:Wk(R.id,T),children:T},`${R.id}:${T}`))]},R.id))]})]})}function vZ({queued:e,onEdit:t,onWithdraw:n,onSteer:r}){const{t:o}=mn(),[a,l]=v.useState(null),[c,f]=v.useState("");if(e.length===0)return null;const d=h=>{l(h.id),f(h.text)},m=h=>{const y=c.trim();y&&t(h,y),l(null)};return w.jsxs("div",{"data-testid":"agent-queue",className:"bg-muted/50 mx-3 mb-2 flex shrink-0 flex-col gap-1.5 rounded-xl px-2.5 py-2",children:[w.jsxs("div",{className:"flex items-center justify-between",children:[w.jsx("span",{className:"text-muted-foreground text-xs font-medium",children:o("agent.queue.title",{count:e.length})}),w.jsxs(Ht,{"data-testid":"agent-queue-steer",size:"xs",variant:"outline",onClick:r,title:o("agent.queue.steerHint"),children:[w.jsx(NN,{}),o("agent.queue.steer")]})]}),w.jsx("ul",{className:"flex flex-col gap-1",children:e.map(h=>w.jsx("li",{"data-testid":`agent-queue-item-${h.id}`,className:"bg-background/60 flex items-start gap-1.5 rounded-lg px-2 py-1",children:a===h.id?w.jsxs(w.Fragment,{children:[w.jsx(Zw,{value:c,onChange:y=>f(y.target.value),onKeyDown:y=>{y.key==="Enter"&&!y.shiftKey&&(y.preventDefault(),m(h.id)),y.key==="Escape"&&l(null)},rows:1,className:"max-h-32 min-h-7 flex-1 resize-none text-xs",autoFocus:!0}),w.jsx(Ht,{size:"icon-sm",variant:"ghost",onClick:()=>m(h.id),"aria-label":o("common.save"),children:w.jsx(Up,{})})]}):w.jsxs(w.Fragment,{children:[w.jsx("span",{className:"min-w-0 flex-1 truncate text-xs",children:h.text}),w.jsx(Ht,{size:"icon-sm",variant:"ghost",onClick:()=>d(h),"aria-label":o("common.edit"),children:w.jsx(Nm,{})}),w.jsx(Ht,{"data-testid":`agent-queue-withdraw-${h.id}`,size:"icon-sm",variant:"ghost",onClick:()=>n(h.id),"aria-label":o("agent.queue.withdraw"),children:w.jsx(Ko,{})})]})},h.id))})]})}function xZ({onSend:e,onSteer:t,onStop:n,running:r,steerable:o,disabled:a,modelPicker:l,writeModeControl:c}){const{t:f}=mn(),[d,m]=v.useState(""),h=sn(E=>{var R;return((R=E.draft)==null?void 0:R.prompt)??null}),y=v.useRef(null);v.useEffect(()=>{h&&h!==y.current&&(y.current=h,m(h))},[h]);const g=()=>{const E=d.trim();!E||a||(e==null||e(E),m(""))},x=()=>{const E=d.trim();!E||a||(t==null||t(E),m(""))};return w.jsxs("div",{"data-testid":"agent-chat-input",className:"bg-chat-surface flex shrink-0 flex-col gap-2 mx-3 mb-2.5 rounded-xl mt-1.5 focus-within:ring-1 focus-within:ring-ring/30",children:[w.jsx(Zw,{"data-testid":"agent-chat-input-textarea",value:d,onChange:E=>m(E.target.value),onKeyDown:E=>{E.key==="Enter"&&!E.shiftKey&&!E.nativeEvent.isComposing&&(E.preventDefault(),g())},placeholder:f("agent.panel.inputPlaceholder"),disabled:a,className:"max-h-40 min-h-[4.5rem] w-full resize-none border-transparent bg-transparent p-3 text-[13px] shadow-none focus-visible:border-transparent focus-visible:ring-0 disabled:bg-transparent dark:bg-transparent dark:disabled:bg-transparent",rows:3}),w.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2 px-2.5 pb-2.5",children:[w.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[c,l&&w.jsx("div",{className:"min-w-0 flex-1",children:l})]}),r?w.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[o&&w.jsx(Ht,{"data-testid":"agent-chat-steer",size:"icon",variant:"outline",disabled:a||d.trim().length===0,onClick:x,"aria-label":f("agent.queue.steer"),title:f("agent.queue.steerHint"),children:w.jsx(NN,{})}),w.jsx(Ht,{"data-testid":"agent-chat-send",size:"icon",variant:"secondary",disabled:a||d.trim().length===0,onClick:g,"aria-label":f("agent.panel.send"),children:w.jsx(zC,{})}),w.jsx(Ht,{"data-testid":"agent-chat-stop",size:"icon",variant:"destructive",onClick:()=>n==null?void 0:n(),"aria-label":f("agent.panel.stop"),children:w.jsx(lq,{})})]}):w.jsx(Ht,{"data-testid":"agent-chat-send",size:"icon",className:"ml-auto shrink-0",disabled:a||d.trim().length===0,onClick:g,"aria-label":f("agent.panel.send"),children:w.jsx(zC,{})})]})]})}function wZ(e,t,n){var a;if(!e.deviceId||!e.paneId)return null;const r=((a=n==null?void 0:n.find(l=>l.id===e.deviceId))==null?void 0:a.name)??null,o=t[e.deviceId];if(!(o!=null&&o.session))return{label:`${e.paneId}@${r??"?"}`,state:"unknown",windowId:null};for(const l of o.session.windows){const c=l.panes.find(f=>f.id===e.paneId);if(c)return{label:xV({paneIdx:c.index,windowIdx:l.index,paneTitle:c.title,windowName:l.name,windowCustomName:l.customName,deviceName:r}),state:"valid",windowId:l.id}}return{label:`${e.paneId}@${r??"?"}`,state:"invalid",windowId:null}}function SZ(){var oe;const{t:e}=mn(),t=Kd(),n=Mi(Z=>Z.setSidebarTab),r=m5("/devices/:deviceId/windows/:windowId/panes/:paneId"),o=(r==null?void 0:r.params.deviceId)??null,a=(r==null?void 0:r.params.paneId)??null,l=sn(Z=>Z.sessions),c=sn(Z=>Z.activeSessionId),f=sn(Z=>Z.draft),d=sn(Z=>Z.activeSessionId?Z.messages[Z.activeSessionId]:void 0),m=sn(Z=>Z.activeSessionId?Z.inProgress[Z.activeSessionId]:void 0),h=sn(Z=>Z.activeSessionId?Z.pendingConfirmations[Z.activeSessionId]:void 0),y=sn(Z=>Z.activeSessionId?Z.sending[Z.activeSessionId]:void 0),g=sn(Z=>Z.activeSessionId?Z.queued[Z.activeSessionId]:void 0),x=sn(Z=>Z.defaultWriteMode),E=Mn(Z=>Z.snapshots),{data:R}=oi({queryKey:["devices"],queryFn:async()=>{const Z=await fetch("/api/devices");if(!Z.ok)throw new Error("Failed to load devices");return Z.json()},throwOnError:!1});v.useEffect(()=>{const Z=sn.getState();Z.ensureInitialized(),Z.loadSessions()},[]);const T=c?l[c]:void 0,C=v.useMemo(()=>{var ue,ve;if(!o||!a)return null;const Z=(ve=(ue=E[o])==null?void 0:ue.session)==null?void 0:ve.windows;for(const Se of Z??[]){const Pe=Se.panes.find(te=>te.id===a);if(Pe)return Pe.title??null}return null},[o,a,E]);v.useEffect(()=>{!T&&!f&&o&&a&&sn.getState().startDraft(o,a,C)},[T,f,o,a,C]);const k=v.useMemo(()=>{const Z=new Map;for(const ue of h??[])Z.set(ue.toolCallId,ue.id);return Z},[h]),M=v.useMemo(()=>{const Z=fV(d,m),ue=new Set;for(const Se of Z)Se.kind==="tool-call"&&ue.add(Se.call.toolCallId);const ve=[];for(const Se of h??[])ue.has(Se.toolCallId)||ve.push({kind:"tool-call",key:`confirmation-${Se.id}`,call:{toolCallId:Se.toolCallId,toolName:Se.toolName,input:Se.input,isError:!1,denied:!1,resolved:!1}});return ve.length>0?[...Z,...ve]:Z},[d,m,h]),D=T??(f?{deviceId:f.deviceId,paneId:f.paneId}:null),O=D?wZ(D,E,R==null?void 0:R.devices):null,N=!!(T&&a&&o&&(T.paneId!==a||T.deviceId!==o)),_=(T==null?void 0:T.status)==="running",q=hV(d),F=!!(T&&(!T.deviceId||!((oe=R==null?void 0:R.devices)!=null&&oe.some(Z=>Z.id===T.deviceId))||(O==null?void 0:O.state)==="invalid")),G=g??[],P=(Z,ue)=>{c&&sn.getState().decideConfirmation(c,Z,ue)},U=()=>{if(T!=null&&T.deviceId){if((O==null?void 0:O.state)==="valid"&&O.windowId&&T.paneId){t(`/devices/${T.deviceId}/windows/${O.windowId}/panes/${encodeURIComponent(T.paneId)}`);return}(O==null?void 0:O.state)==="unknown"&&t(`/devices/${T.deviceId}`)}},H=()=>{!o||!a||sn.getState().startDraft(o,a,C)},B=(Z,ue)=>{T?sn.getState().setSessionModel(T.id,Z,ue):f&&sn.getState().updateDraft({providerId:Z,modelId:ue})},j=Z=>{const ue=sn.getState();if(T){T.status==="running"?ue.enqueueMessage(T.id,Z):ue.sendMessage(T.id,Z);return}f&&(async()=>{const ve=await ue.materializeDraft();ve&&await ue.sendMessage(ve.id,Z)})()},z=Z=>{T&&sn.getState().enqueueMessage(T.id,Z,!0)},V=()=>{if(!T)return;const Z=G[0];if(!Z)return;const ue=sn.getState();(async()=>(await ue.withdrawQueuedMessage(T.id,Z.id),await ue.enqueueMessage(T.id,Z.text,!0)))()},K=T?T.providerId:(f==null?void 0:f.providerId)??null,L=T?T.modelId:(f==null?void 0:f.modelId)??null,$=!!(T||f),W=!!(f&&!T),I=T?T.writeMode:x,Q=!!(T&&((d==null?void 0:d.length)??0)>0),le=F||!$||(T==null?void 0:T.status)==="waiting_confirmation"||!!y;return w.jsxs("div",{"data-testid":"agent-tab",className:"flex h-full min-h-0 flex-col",children:[w.jsxs("div",{className:"flex shrink-0 items-center gap-2 px-3 py-2",children:[O?w.jsxs("button",{type:"button","data-testid":"agent-binding-chip","data-binding-state":O.state,className:De("border-border flex min-w-0 items-center gap-1 rounded-full border px-2 py-0.5 text-xs",T&&O.state==="valid"?"hover:bg-muted cursor-pointer":"text-muted-foreground",O.state==="invalid"&&"opacity-60"),onClick:U,disabled:!T||O.state==="invalid",children:[w.jsx(fq,{className:"size-3 shrink-0"}),w.jsx("span",{className:"min-w-0 truncate",children:O.label}),O.state==="invalid"&&w.jsxs("span",{className:"shrink-0",children:["· ",e("agent.binding.invalid")]})]}):w.jsx("div",{className:"min-w-0 flex-1"}),w.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[w.jsx(Ht,{"data-testid":"agent-session-switch",size:"icon-sm",variant:"ghost",onClick:()=>n("panes"),"aria-label":e("agent.session.switch"),title:e("agent.session.switch"),children:w.jsx(_9,{})}),Q&&w.jsx(Ht,{"data-testid":"agent-session-new",size:"icon-sm",variant:"ghost",disabled:!o||!a,onClick:H,"aria-label":e("agent.session.new"),title:e(!o||!a?"agent.session.selectPaneHint":"agent.session.new"),children:w.jsx(Am,{})})]})]}),F&&w.jsxs("div",{"data-testid":"agent-orphan-banner",className:"bg-muted/50 text-muted-foreground mx-3 mb-1.5 flex shrink-0 items-start gap-2 rounded-lg px-2 py-1.5 text-xs",children:[w.jsx(fd,{className:"mt-0.5 size-3.5 shrink-0"}),w.jsx("span",{className:"min-w-0 flex-1",children:e("agent.orphan.readonly")})]}),T&&!F&&N&&w.jsxs("div",{"data-testid":"agent-pane-mismatch",className:"bg-muted/50 mx-3 mb-1.5 flex shrink-0 flex-wrap items-center gap-2 rounded-lg px-2 py-1.5 text-xs",children:[w.jsx(fd,{className:"text-muted-foreground size-3.5 shrink-0"}),w.jsx("span",{className:"text-muted-foreground min-w-0 flex-1",children:e("agent.binding.mismatchTitle")}),(O==null?void 0:O.state)==="valid"&&w.jsx(Ht,{"data-testid":"agent-binding-goto",size:"xs",variant:"outline",onClick:U,children:e("agent.binding.goTo")}),a&&w.jsx(Ht,{"data-testid":"agent-binding-rebind",size:"xs",variant:"outline",onClick:()=>{sn.getState().rebindPane(T.id,a)},children:e("agent.binding.rebind")})]}),(T==null?void 0:T.status)==="error"&&T.lastError&&w.jsxs("div",{"data-testid":"agent-error-banner",className:"bg-destructive/10 text-destructive mx-3 mb-1.5 flex shrink-0 items-start gap-2 rounded-lg px-2 py-1.5 text-xs",children:[w.jsx(fd,{className:"mt-0.5 size-3.5 shrink-0"}),w.jsx("span",{className:"min-w-0 flex-1 break-words",children:T.lastError}),q&&!F&&w.jsx(Ht,{"data-testid":"agent-error-retry",size:"xs",variant:"outline",className:"shrink-0",disabled:!!y,onClick:()=>{sn.getState().sendMessage(T.id,q)},children:e("agent.panel.retry")})]}),!W&&w.jsx(OQ,{blocks:T?M:[],running:!!_,emptyText:e($?"agent.panel.empty":"agent.session.selectPaneHint"),confirmationByToolCallId:k,onDecide:P,className:"bg-chat-surface mx-3 mb-2 overflow-hidden rounded-xl"},(T==null?void 0:T.id)??(f?"draft":"none")),T&&!F&&G.length>0&&w.jsx(vZ,{queued:G,onEdit:(Z,ue)=>void sn.getState().editQueuedMessage(T.id,Z,ue),onWithdraw:Z=>void sn.getState().withdrawQueuedMessage(T.id,Z),onSteer:V}),$&&w.jsxs("div",{className:W?"flex min-h-0 flex-1 flex-col justify-center":"contents",children:[W&&w.jsxs("div",{className:"flex flex-col items-center gap-2 px-6 pb-6 text-center",children:[w.jsx(MN,{className:"text-muted-foreground size-9"}),w.jsx("h3",{className:"text-sm font-medium",children:e("agent.welcome.title")}),w.jsx("p",{className:"text-muted-foreground text-xs",children:e("agent.welcome.subtitle")})]}),w.jsx(xZ,{disabled:le,running:!!_,steerable:!!T,onSend:j,onSteer:z,onStop:()=>{T&&sn.getState().stopSession(T.id)},modelPicker:w.jsx(bZ,{providerId:K,modelId:L,onChange:B,disabled:_}),writeModeControl:w.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[w.jsx("span",{className:"text-muted-foreground text-xs",children:e(I==="auto"?"agent.writeMode.auto":"agent.writeMode.confirm")}),w.jsx(qp,{"data-testid":"agent-write-mode-switch",checked:I==="auto",disabled:!!T&&F,onCheckedChange:Z=>{const ue=Z?"auto":"confirm";sn.getState().setDefaultWriteMode(ue),T&&sn.getState().setWriteMode(T.id,ue)}})]})})]})]})}const EZ=0,TZ={Backquote:1,Backslash:2,BracketLeft:3,BracketRight:4,Comma:5,Digit0:6,Digit1:7,Digit2:8,Digit3:9,Digit4:10,Digit5:11,Digit6:12,Digit7:13,Digit8:14,Digit9:15,Equal:16,IntlBackslash:17,IntlRo:18,IntlYen:19,KeyA:20,KeyB:21,KeyC:22,KeyD:23,KeyE:24,KeyF:25,KeyG:26,KeyH:27,KeyI:28,KeyJ:29,KeyK:30,KeyL:31,KeyM:32,KeyN:33,KeyO:34,KeyP:35,KeyQ:36,KeyR:37,KeyS:38,KeyT:39,KeyU:40,KeyV:41,KeyW:42,KeyX:43,KeyY:44,KeyZ:45,Minus:46,Period:47,Quote:48,Semicolon:49,Slash:50,AltLeft:51,AltRight:52,Backspace:53,CapsLock:54,ContextMenu:55,ControlLeft:56,ControlRight:57,Enter:58,MetaLeft:59,MetaRight:60,ShiftLeft:61,ShiftRight:62,Space:63,Tab:64,Convert:65,KanaMode:66,NonConvert:67,Delete:68,End:69,Help:70,Home:71,Insert:72,PageDown:73,PageUp:74,ArrowDown:75,ArrowLeft:76,ArrowRight:77,ArrowUp:78,NumLock:79,Numpad0:80,Numpad1:81,Numpad2:82,Numpad3:83,Numpad4:84,Numpad5:85,Numpad6:86,Numpad7:87,Numpad8:88,Numpad9:89,NumpadAdd:90,NumpadBackspace:91,NumpadClear:92,NumpadClearEntry:93,NumpadComma:94,NumpadDecimal:95,NumpadDivide:96,NumpadEnter:97,NumpadEqual:98,NumpadMemoryAdd:99,NumpadMemoryClear:100,NumpadMemoryRecall:101,NumpadMemoryStore:102,NumpadMemorySubtract:103,NumpadMultiply:104,NumpadParenLeft:105,NumpadParenRight:106,NumpadSubtract:107,NumpadSeparator:108,NumpadUp:109,NumpadDown:110,NumpadRight:111,NumpadLeft:112,NumpadBegin:113,NumpadHome:114,NumpadEnd:115,NumpadInsert:116,NumpadDelete:117,NumpadPageUp:118,NumpadPageDown:119,Escape:120,F1:121,F2:122,F3:123,F4:124,F5:125,F6:126,F7:127,F8:128,F9:129,F10:130,F11:131,F12:132,F13:133,F14:134,F15:135,F16:136,F17:137,F18:138,F19:139,F20:140,F21:141,F22:142,F23:143,F24:144,F25:145,Fn:146,FnLock:147,PrintScreen:148,ScrollLock:149,Pause:150,BrowserBack:151,BrowserFavorites:152,BrowserForward:153,BrowserHome:154,BrowserRefresh:155,BrowserSearch:156,BrowserStop:157,Eject:158,LaunchApp1:159,LaunchApp2:160,LaunchMail:161,MediaPlayPause:162,MediaSelect:163,MediaStop:164,MediaTrackNext:165,MediaTrackPrevious:166,Power:167,Sleep:168,AudioVolumeDown:169,AudioVolumeMute:170,AudioVolumeUp:171,WakeUp:172,Copy:173,Cut:174,Paste:175},w0={Backquote:"`",Backslash:"\\",BracketLeft:"[",BracketRight:"]",Comma:",",Equal:"=",Minus:"-",Period:".",Quote:"'",Semicolon:";",Slash:"/",Space:" ",IntlBackslash:"\\",IntlYen:"¥",IntlRo:"\\"};for(let e=0;e<=9;e+=1)w0[`Digit${e}`]=String(e);for(let e=0;e<26;e+=1){const t=String.fromCharCode(65+e),n=String.fromCharCode(97+e);w0[`Key${t}`]=n}function pre(e){return TZ[e]??EZ}function mre(e){const t=w0[e];return t?t.codePointAt(0)??null:null}function mD(){var t;if(typeof navigator>"u")return!1;const e=((t=navigator.userAgentData)==null?void 0:t.platform)??navigator.platform??"";return/mac|iphone|ipad|ipod/iu.test(e)?!0:/mac os x/iu.test(navigator.userAgent??"")}function RZ(e){return e.altKey?!1:!!(mD()?e.metaKey:e.ctrlKey)}function CZ(e){return RZ(e)}function gre(e){return CZ(e)&&e.key.toLowerCase()==="c"}function yre(e){return e.shiftKey&&e.key==="Insert"&&!e.ctrlKey&&!e.altKey&&!e.metaKey?!0:e.altKey||e.key.toLowerCase()!=="v"?!1:!!(mD()?e.metaKey:e.ctrlKey)}async function gD(e){var n;if(!e)return;if(typeof navigator<"u"&&((n=navigator.clipboard)!=null&&n.writeText))try{await navigator.clipboard.writeText(e);return}catch{}if(typeof document>"u"||typeof document.execCommand!="function")throw new Error("clipboard unavailable");const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly","true"),t.style.position="fixed",t.style.left="-9999px",t.style.top="0",document.body.appendChild(t);try{if(t.select(),!document.execCommand("copy"))throw new Error("execCommand copy failed")}finally{t.remove()}}async function bre(e){e&&await gD(e)}function vre(e,t){return!t||!e.clipboardData?!1:(e.clipboardData.setData("text/plain",t),e.preventDefault(),!0)}const kZ=new URL("/assets/ghostty-vt-BKQMf-5X.wasm",import.meta.url).href,xp=0,Xk=-3,MZ=11,OZ=12,NZ=13,AZ=14,DZ=1,_Z=2,IZ=9,PZ=1,LZ=0,jZ=1,zZ=2,FZ=0,BZ=1,UZ=2,HZ=4,qZ=2004,VZ=9,$Z=1e3,GZ=1002,YZ=1003,KZ=1005,Qk=1006,WZ=1015,Zk=1016;let av=null;function cn(e,t){if(e!==xp)throw new Error(`${t} failed with result ${e}`)}function yD(e){const t=e.trim().replace(/^#/,"");if(t.length!==6)throw new Error(`expected #RRGGBB color, received: ${e}`);return[Number.parseInt(t.slice(0,2),16),Number.parseInt(t.slice(2,4),16),Number.parseInt(t.slice(4,6),16)]}function XZ(e){const n=[...[e.black,e.red,e.green,e.yellow,e.blue,e.magenta,e.cyan,e.white,e.brightBlack,e.brightRed,e.brightGreen,e.brightYellow,e.brightBlue,e.brightMagenta,e.brightCyan,e.brightWhite].map(yD)],r=[0,95,135,175,215,255];for(const o of r)for(const a of r)for(const l of r)n.push([o,a,l]);for(let o=0;o<24;o+=1){const a=8+o*10;n.push([a,a,a])}return n}function QZ(e){let t=0;return e&1&&(t+=4),e&4&&(t+=8),e&2&&(t+=16),t}function sv(e){return e<0||e>223?null:String.fromCharCode(e+32)}function ZZ(e){switch(e){case 1:return 0;case 3:return 1;case 2:return 2;case 4:return 64;case 5:return 65;case 6:return 66;case 7:return 67;case 8:return 128;case 9:return 129;case null:case void 0:return 3;default:return null}}function xre(e){var n,r;let t=0;return e.shiftKey&&(t|=1),e.ctrlKey&&(t|=2),e.altKey&&(t|=4),e.metaKey&&(t|=8),(n=e.getModifierState)!=null&&n.call(e,"CapsLock")&&(t|=16),(r=e.getModifierState)!=null&&r.call(e,"NumLock")&&(t|=32),t}class JZ{constructor(t,n,r){this.bindings=t,this.typeName=n,this.ptr=r}get view(){return this.bindings.view(this.ptr,this.bindings.typeSize(this.typeName))}free(){this.bindings.freeBytes(this.ptr,this.bindings.typeSize(this.typeName))}}class eJ{constructor(t,n){tt(this,"exports");tt(this,"layout");tt(this,"decoder",new TextDecoder);tt(this,"encoder",new TextEncoder);this.exports=t,this.layout=n}buffer(){return this.exports.memory.buffer}bytes(t=0,n=this.buffer().byteLength-t){return new Uint8Array(this.buffer(),t,n)}view(t=0,n=this.buffer().byteLength-t){return new DataView(this.buffer(),t,n)}typeSize(t){const n=this.layout[t];if(!n)throw new Error(`unknown ghostty type: ${t}`);return n.size}field(t,n){const r=this.layout[t],o=r==null?void 0:r.fields[n];if(!r||!o)throw new Error(`unknown ghostty field: ${t}.${n}`);return o}allocStruct(t){const n=this.allocBytes(this.typeSize(t));return this.bytes(n,this.typeSize(t)).fill(0),new JZ(this,t,n)}allocBytes(t){return this.exports.ghostty_wasm_alloc_u8_array(t)}freeBytes(t,n){this.exports.ghostty_wasm_free_u8_array(t,n)}allocOpaque(){return this.exports.ghostty_wasm_alloc_opaque()}freeOpaque(t){this.exports.ghostty_wasm_free_opaque(t)}allocU8(){return this.exports.ghostty_wasm_alloc_u8()}freeU8(t){this.exports.ghostty_wasm_free_u8(t)}allocUsize(){return this.exports.ghostty_wasm_alloc_usize()}freeUsize(t){this.exports.ghostty_wasm_free_usize(t)}readPointer(t){return this.view().getUint32(t,!0)}readU8(t){return this.view().getUint8(t)}readUsize(t){return this.view().getUint32(t,!0)}readU64(t){return this.view().getBigUint64(t,!0)}setField(t,n,r,o){const a=this.field(n,r),l=a.offset;switch(a.type){case"u8":case"bool":t.setUint8(l,Number(o));return;case"u16":t.setUint16(l,Number(o),!0);return;case"u32":t.setUint32(l,Number(o),!0);return;case"u64":t.setBigUint64(l,BigInt(o),!0);return;case"usize":{t.setUint32(l,Number(o),!0);return}case"i32":case"enum":t.setInt32(l,Number(o),!0);return;default:throw new Error(`unsupported field type ${n}.${r}: ${a.type}`)}}writeString(t){const n=this.encoder.encode(t),r=this.allocBytes(n.length);return this.bytes(r,n.length).set(n),{ptr:r,len:n.length,free:()=>this.freeBytes(r,n.length)}}writeBytes(t){const n=this.allocBytes(t.length);return this.bytes(n,t.length).set(t),{ptr:n,len:t.length,free:()=>this.freeBytes(n,t.length)}}readOwnedUtf8(t,n){return this.decoder.decode(this.bytes(t,n))}createTerminal(t,n,r){const o=this.allocStruct("GhosttyTerminalOptions");this.setField(o.view,"GhosttyTerminalOptions","cols",t),this.setField(o.view,"GhosttyTerminalOptions","rows",n),this.setField(o.view,"GhosttyTerminalOptions","max_scrollback",r);const a=this.allocOpaque();try{return cn(this.exports.ghostty_terminal_new(0,a,o.ptr),"ghostty_terminal_new"),this.readPointer(a)}finally{o.free(),this.freeOpaque(a)}}freeTerminal(t){this.exports.ghostty_terminal_free(t)}writeVt(t,n){const r=typeof n=="string"?this.encoder.encode(n):n,o=this.writeBytes(r);try{this.exports.ghostty_terminal_vt_write(t,o.ptr,o.len)}finally{o.free()}}resetTerminal(t){this.exports.ghostty_terminal_reset(t)}resizeTerminal(t,n,r,o){cn(this.exports.ghostty_terminal_resize(t,n,r,Math.max(1,Math.round(o.width)),Math.max(1,Math.round(o.height))),"ghostty_terminal_resize")}scrollViewportDelta(t,n){const r=this.allocStruct("GhosttyTerminalScrollViewport");try{this.setField(r.view,"GhosttyTerminalScrollViewport","tag",zZ),r.view.setBigInt64(this.field("GhosttyTerminalScrollViewport","value").offset,BigInt(n),!0),this.exports.ghostty_terminal_scroll_viewport(t,r.ptr)}finally{r.free()}}scrollViewportTop(t){const n=this.allocStruct("GhosttyTerminalScrollViewport");try{this.setField(n.view,"GhosttyTerminalScrollViewport","tag",LZ),this.exports.ghostty_terminal_scroll_viewport(t,n.ptr)}finally{n.free()}}scrollViewportBottom(t){const n=this.allocStruct("GhosttyTerminalScrollViewport");try{this.setField(n.view,"GhosttyTerminalScrollViewport","tag",jZ),this.exports.ghostty_terminal_scroll_viewport(t,n.ptr)}finally{n.free()}}setTerminalTheme(t,n){const r=this.allocStruct("GhosttyColorRgb"),o=this.allocStruct("GhosttyColorRgb"),a=this.allocStruct("GhosttyColorRgb"),l=XZ(n),c=this.allocBytes(l.length*3),f=(m,h)=>{const[y,g,x]=yD(h);this.setField(m.view,"GhosttyColorRgb","r",y),this.setField(m.view,"GhosttyColorRgb","g",g),this.setField(m.view,"GhosttyColorRgb","b",x)};f(r,n.foreground),f(o,n.background),f(a,n.cursor);const d=this.bytes(c,l.length*3);l.forEach(([m,h,y],g)=>{const x=g*3;d[x]=m,d[x+1]=h,d[x+2]=y});try{cn(this.exports.ghostty_terminal_set(t,MZ,r.ptr),"ghostty_terminal_set(foreground)"),cn(this.exports.ghostty_terminal_set(t,OZ,o.ptr),"ghostty_terminal_set(background)"),cn(this.exports.ghostty_terminal_set(t,NZ,a.ptr),"ghostty_terminal_set(cursor)"),cn(this.exports.ghostty_terminal_set(t,AZ,c),"ghostty_terminal_set(palette)")}finally{r.free(),o.free(),a.free(),this.freeBytes(c,l.length*3)}}readTerminalSize(t){const n=this.allocBytes(2),r=this.allocBytes(2);try{return cn(this.exports.ghostty_terminal_get(t,DZ,n),"ghostty_terminal_get(cols)"),cn(this.exports.ghostty_terminal_get(t,_Z,r),"ghostty_terminal_get(rows)"),{cols:this.view().getUint16(n,!0),rows:this.view().getUint16(r,!0)}}finally{this.freeBytes(n,2),this.freeBytes(r,2)}}readScrollbar(t){const n=this.allocStruct("GhosttyTerminalScrollbar");try{return cn(this.exports.ghostty_terminal_get(t,IZ,n.ptr),"ghostty_terminal_get(scrollbar)"),{total:Number(n.view.getBigUint64(this.field("GhosttyTerminalScrollbar","total").offset,!0)),offset:Number(n.view.getBigUint64(this.field("GhosttyTerminalScrollbar","offset").offset,!0)),len:Number(n.view.getBigUint64(this.field("GhosttyTerminalScrollbar","len").offset,!0))}}finally{n.free()}}isTerminalModeEnabled(t,n){const r=this.allocU8();try{return cn(this.exports.ghostty_terminal_mode_get(t,n,r),"ghostty_terminal_mode_get"),this.readU8(r)!==0}finally{this.freeU8(r)}}setTerminalMode(t,n,r){cn(this.exports.ghostty_terminal_mode_set(t,n,r?1:0),"ghostty_terminal_mode_set")}createFormatter(t,n,r){const o=this.allocStruct("GhosttyFormatterTerminalOptions"),a=this.field("GhosttyFormatterTerminalOptions","extra").offset,l=this.view(o.ptr+a,this.typeSize("GhosttyFormatterTerminalExtra")),c=this.field("GhosttyFormatterTerminalExtra","screen").offset,f=this.view(o.ptr+a+c,this.typeSize("GhosttyFormatterScreenExtra")),d=this.allocOpaque();try{this.setField(o.view,"GhosttyFormatterTerminalOptions","size",this.typeSize("GhosttyFormatterTerminalOptions")),this.setField(o.view,"GhosttyFormatterTerminalOptions","emit",n),this.setField(o.view,"GhosttyFormatterTerminalOptions","unwrap",r.unwrap),this.setField(o.view,"GhosttyFormatterTerminalOptions","trim",r.trim),this.setField(l,"GhosttyFormatterTerminalExtra","size",this.typeSize("GhosttyFormatterTerminalExtra")),this.setField(l,"GhosttyFormatterTerminalExtra","palette",r.includePalette),this.setField(f,"GhosttyFormatterScreenExtra","size",this.typeSize("GhosttyFormatterScreenExtra"));const m=this.field("GhosttyFormatterTerminalOptions","selection").offset;return o.view.setUint32(m,r.selectionPtr??0,!0),cn(this.exports.ghostty_formatter_terminal_new(0,d,t,o.ptr),"ghostty_formatter_terminal_new"),this.readPointer(d)}finally{o.free(),this.freeOpaque(d)}}freeFormatter(t){this.exports.ghostty_formatter_free(t)}resolveViewportGridRef(t,n,r){const o=this.allocStruct("GhosttyPoint"),a=this.allocStruct("GhosttyGridRef");try{this.setField(o.view,"GhosttyPoint","tag",PZ);const l=this.field("GhosttyPoint","value").offset,c=this.view(o.ptr+l,this.typeSize("GhosttyPointCoordinate"));return this.setField(c,"GhosttyPointCoordinate","x",n),this.setField(c,"GhosttyPointCoordinate","y",r),this.exports.ghostty_terminal_grid_ref(t,o.ptr,a.ptr)!==xp?(a.free(),null):a}finally{o.free()}}createViewportSelection(t,n,r){const o=Math.max(1,Math.floor(n)),a=Math.max(1,Math.floor(r)),l=this.resolveViewportGridRef(t,0,0);if(!l)return null;let c=null;for(let d=a-1;d>=0&&(c=this.resolveViewportGridRef(t,o-1,d),!c);d-=1);if(!c)return l.free(),null;const f=this.allocStruct("GhosttySelection");try{this.setField(f.view,"GhosttySelection","size",this.typeSize("GhosttySelection")),this.setField(f.view,"GhosttySelection","rectangle",!1);const d=this.field("GhosttySelection","start").offset,m=this.field("GhosttySelection","end").offset;return this.bytes(f.ptr+d,this.typeSize("GhosttyGridRef")).set(this.bytes(l.ptr,this.typeSize("GhosttyGridRef"))),this.bytes(f.ptr+m,this.typeSize("GhosttyGridRef")).set(this.bytes(c.ptr,this.typeSize("GhosttyGridRef"))),f}finally{l.free(),c.free()}}formatViewport(t,n,r,o){const a=this.readTerminalSize(t),l=this.createViewportSelection(t,Math.max(1,Math.min(a.cols,o.cols)),Math.max(1,Math.min(a.rows,o.rows))),c=this.createFormatter(t,n,{...r,selectionPtr:(l==null?void 0:l.ptr)??null});try{return this.formatFormatter(c)}finally{this.freeFormatter(c),l==null||l.free()}}formatFormatter(t){const n=this.allocOpaque(),r=this.allocUsize();try{cn(this.exports.ghostty_formatter_format_alloc(t,0,n,r),"ghostty_formatter_format_alloc");const o=this.readPointer(n),a=this.readUsize(r),l=this.buffer().byteLength;try{if(a===0||o===0)return"";if(o<0||o>l||a>l-o)throw new Error(`ghostty_formatter_format_alloc returned invalid slice ptr=${o} len=${a} mem=${l}`);return this.readOwnedUtf8(o,a)}finally{a>0&&o!==0&&this.exports.ghostty_free(0,o,a)}}finally{this.freeOpaque(n),this.freeUsize(r)}}createRenderState(){const t=this.allocOpaque();try{return cn(this.exports.ghostty_render_state_new(0,t),"ghostty_render_state_new"),this.readPointer(t)}finally{this.freeOpaque(t)}}freeRenderState(t){this.exports.ghostty_render_state_free(t)}updateRenderState(t,n){cn(this.exports.ghostty_render_state_update(t,n),"ghostty_render_state_update")}getRenderStateValueResult(t,n,r){return this.exports.ghostty_render_state_get(t,n,r)}getRenderStateValue(t,n,r){cn(this.getRenderStateValueResult(t,n,r),"ghostty_render_state_get")}setRenderStateValue(t,n,r){cn(this.exports.ghostty_render_state_set(t,n,r),"ghostty_render_state_set")}getRenderStateColors(t,n){cn(this.exports.ghostty_render_state_colors_get(t,n),"ghostty_render_state_colors_get")}createRenderStateRowIterator(){const t=this.allocOpaque();try{return cn(this.exports.ghostty_render_state_row_iterator_new(0,t),"ghostty_render_state_row_iterator_new"),this.readPointer(t)}finally{this.freeOpaque(t)}}freeRenderStateRowIterator(t){this.exports.ghostty_render_state_row_iterator_free(t)}bindRenderStateRowIterator(t,n){const r=this.allocOpaque();try{this.view(r,4).setUint32(0,n,!0),this.getRenderStateValue(t,4,r)}finally{this.freeOpaque(r)}}nextRenderStateRowIterator(t){return this.exports.ghostty_render_state_row_iterator_next(t)!==0}getRenderStateRowValueResult(t,n,r){return this.exports.ghostty_render_state_row_get(t,n,r)}getRenderStateRowValue(t,n,r){cn(this.getRenderStateRowValueResult(t,n,r),"ghostty_render_state_row_get")}setRenderStateRowValue(t,n,r){cn(this.exports.ghostty_render_state_row_set(t,n,r),"ghostty_render_state_row_set")}createRenderStateRowCells(){const t=this.allocOpaque();try{return cn(this.exports.ghostty_render_state_row_cells_new(0,t),"ghostty_render_state_row_cells_new"),this.readPointer(t)}finally{this.freeOpaque(t)}}freeRenderStateRowCells(t){this.exports.ghostty_render_state_row_cells_free(t)}bindRenderStateRowCells(t,n){const r=this.allocOpaque();try{this.view(r,4).setUint32(0,n,!0),this.getRenderStateRowValue(t,3,r)}finally{this.freeOpaque(r)}}nextRenderStateRowCell(t){return this.exports.ghostty_render_state_row_cells_next(t)!==0}selectRenderStateRowCell(t,n){cn(this.exports.ghostty_render_state_row_cells_select(t,n),"ghostty_render_state_row_cells_select")}getRenderStateRowCellValueResult(t,n,r){return this.exports.ghostty_render_state_row_cells_get(t,n,r)}getRenderStateRowCellValue(t,n,r){cn(this.getRenderStateRowCellValueResult(t,n,r),"ghostty_render_state_row_cells_get")}getRawRowValueResult(t,n,r){return this.exports.ghostty_row_get(t,n,r)}getRawRowValue(t,n,r){cn(this.getRawRowValueResult(t,n,r),"ghostty_row_get")}getRawCellValueResult(t,n,r){return this.exports.ghostty_cell_get(t,n,r)}getRawCellValue(t,n,r){cn(this.getRawCellValueResult(t,n,r),"ghostty_cell_get")}createKeyEncoder(){const t=this.allocOpaque();try{return cn(this.exports.ghostty_key_encoder_new(0,t),"ghostty_key_encoder_new"),this.readPointer(t)}finally{this.freeOpaque(t)}}freeKeyEncoder(t){this.exports.ghostty_key_encoder_free(t)}createMouseEncoder(){const t=this.allocOpaque(),n=this.allocU8();try{cn(this.exports.ghostty_mouse_encoder_new(0,t),"ghostty_mouse_encoder_new");const r=this.readPointer(t);return this.view().setUint8(n,1),this.exports.ghostty_mouse_encoder_setopt(r,HZ,n),r}finally{this.freeU8(n),this.freeOpaque(t)}}freeMouseEncoder(t){this.exports.ghostty_mouse_encoder_free(t)}resetMouseEncoder(t){this.exports.ghostty_mouse_encoder_reset(t)}encodeMouseEvent(t,n,r){const o=this.isTerminalModeEnabled(n,YZ),a=this.isTerminalModeEnabled(n,GZ),l=this.isTerminalModeEnabled(n,$Z),c=this.isTerminalModeEnabled(n,VZ);if(!o&&!a&&!l&&!c||r.action==="motion"&&!(o||a&&r.anyButtonPressed)||c&&r.action!=="press"||!o&&!a&&!c&&r.action==="motion")return null;const f=ZZ(r.button);if(f===null)return null;const d=Math.max(1,Math.floor(r.x/Math.max(1,r.cellWidth))+1),m=Math.max(1,Math.floor(r.y/Math.max(1,r.cellHeight))+1),h=Math.round(r.x+1),y=Math.round(r.y+1);let g=r.action==="release"&&!this.isTerminalModeEnabled(n,Qk)&&!this.isTerminalModeEnabled(n,Zk)?3:f;if(r.action==="motion"&&(g+=32),g+=QZ(r.mods),this.isTerminalModeEnabled(n,Zk)){const x=r.action==="release"?"m":"M";return`\x1B[<${g};${h};${y}${x}`}if(this.isTerminalModeEnabled(n,Qk)){const x=r.action==="release"?"m":"M";return`\x1B[<${g};${d};${m}${x}`}if(this.isTerminalModeEnabled(n,WZ))return`\x1B[${g};${d};${m}M`;if(this.isTerminalModeEnabled(n,KZ)||l||a||o||c){const x=sv(g),E=sv(d),R=sv(m);return!x||!E||!R?null:`\x1B[M${x}${E}${R}`}return null}encodeKeyEvent(t,n,r){if(r.keyCode<=0)return null;const o=this.allocOpaque();let a=0,l=null;try{return cn(this.exports.ghostty_key_event_new(0,o),"ghostty_key_event_new"),a=this.readPointer(o),this.exports.ghostty_key_encoder_setopt_from_terminal(t,n),this.exports.ghostty_key_event_set_action(a,r.action==="release"?FZ:r.action==="repeat"?UZ:BZ),this.exports.ghostty_key_event_set_key(a,r.keyCode),this.exports.ghostty_key_event_set_mods(a,r.mods),this.exports.ghostty_key_event_set_consumed_mods(a,0),this.exports.ghostty_key_event_set_composing(a,r.composing?1:0),r.utf8&&(l=this.writeString(r.utf8),this.exports.ghostty_key_event_set_utf8(a,l.ptr,l.len)),typeof r.unshiftedCodepoint=="number"&&this.exports.ghostty_key_event_set_unshifted_codepoint(a,r.unshiftedCodepoint),this.encodeKeyHandle(t,a)}finally{l==null||l.free(),a!==0&&this.exports.ghostty_key_event_free(a),this.freeOpaque(o)}}encodeKeyHandle(t,n){const r=this.allocUsize();try{const o=this.exports.ghostty_key_encoder_encode(t,n,0,0,r);o!==Xk&&o!==xp&&cn(o,"ghostty_key_encoder_encode(size)");const a=Math.max(0,this.readUsize(r));if(a===0)return null;const l=this.allocBytes(a),c=this.allocUsize();try{cn(this.exports.ghostty_key_encoder_encode(t,n,l,a,c),"ghostty_key_encoder_encode");const f=this.readUsize(c);return f===0?null:this.readOwnedUtf8(l,f)}finally{this.freeBytes(l,a),this.freeUsize(c)}}finally{this.freeUsize(r)}}encodePaste(t,n){const r=this.writeString(n),o=this.allocUsize();try{const a=this.isTerminalModeEnabled(t,qZ),l=this.exports.ghostty_paste_encode(r.ptr,r.len,a?1:0,0,0,o);l!==Xk&&l!==xp&&cn(l,"ghostty_paste_encode(size)");const c=Math.max(0,this.readUsize(o));if(c===0)return"";const f=this.allocBytes(c),d=this.allocUsize();try{return cn(this.exports.ghostty_paste_encode(r.ptr,r.len,a?1:0,f,c,d),"ghostty_paste_encode"),this.readOwnedUtf8(f,this.readUsize(d))}finally{this.freeBytes(f,c),this.freeUsize(d)}}finally{r.free(),this.freeUsize(o)}}}async function tJ(e){const t=e.startsWith("file://"),n=t?decodeURIComponent(new URL(e).pathname):e;if((t||n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||/^[A-Za-z]:[\\/]/.test(n))&&typeof Bun<"u")return Bun.file(n).arrayBuffer();const o=await fetch(e);if(!o.ok)throw new Error(`failed to load ghostty wasm: ${o.status} ${o.statusText}`);return o.arrayBuffer()}async function wre(){return av||(av=(async()=>{const e=await tJ(kZ),n=(await WebAssembly.instantiate(e,{env:{log(){}}})).instance.exports,r=new Uint8Array(n.memory.buffer),o=n.ghostty_type_json();let a=o;for(;r[a]!==0;)a+=1;const l=JSON.parse(new TextDecoder().decode(r.subarray(o,a)));return new eJ(n,l)})()),av}const bD=v.createContext(void 0);function qc(e=!0){const t=v.useContext(bD);if(t===void 0&&!e)throw new Error(Rn(25));return t}const vD=v.createContext(void 0);function xD(e){const t=v.useContext(vD);if(t===void 0&&!e)throw new Error(Rn(33));return t}const S0=v.createContext(void 0);function ea(e){const t=v.useContext(S0);if(t===void 0&&!e)throw new Error(Rn(36));return t}const nJ={...po,...Xo},rJ=v.forwardRef(function(t,n){const{className:r,render:o,...a}=t,{store:l}=ea(),c=l.useState("open"),f=l.useState("mounted"),d=l.useState("transitionStatus"),m=l.useState("lastOpenChangeReason"),h=qc(),y={open:c,transitionStatus:d};return At("div",t,{ref:h!=null&&h.backdropRef?[n,h.backdropRef]:n,state:y,stateAttributesMapping:nJ,props:[{role:"presentation",hidden:!f,style:{pointerEvents:m===wr?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},a]})});function iJ(e){const{closeOnClick:t,highlighted:n,id:r,nodeId:o,store:a,itemRef:l,itemMetadata:c}=e,{events:f}=a.useState("floatingTreeRoot"),d=qc(!0),m=d!==void 0;return v.useMemo(()=>({id:r,role:"menuitem",tabIndex:n?0:-1,onMouseMove(h){o&&f.emit("itemhover",{nodeId:o,target:h.currentTarget})},onClick(h){t&&f.emit("close",{domEvent:h,reason:ud})},onMouseUp(h){if(d){const y=d.initialCursorPointRef.current;if(d.initialCursorPointRef.current=null,m&&y&&Math.abs(h.clientX-y.x)<=1&&Math.abs(h.clientY-y.y)<=1)return}l.current&&a.context.allowMouseUpTriggerRef.current&&(!m||h.button===2)&&(!c||c.type==="regular-item")&&l.current.click()}}),[t,n,r,f,o,a,l,d,m,c])}const oJ={type:"regular-item"};function aJ(e){const{closeOnClick:t,disabled:n=!1,highlighted:r,id:o,store:a,nativeButton:l,itemMetadata:c,nodeId:f}=e,d=v.useRef(null),{getButtonProps:m,buttonRef:h}=Wo({disabled:n,focusableWhenDisabled:!0,native:l}),y=iJ({closeOnClick:t,highlighted:r,id:o,nodeId:f,store:a,itemRef:d,itemMetadata:c}),g=v.useCallback(E=>ki(y,{onMouseEnter(){c.type==="submenu-trigger"&&c.setActive()},onKeyUp(R){R.key===" "&&a.context.typingRef.current&&R.preventBaseUIHandler()}},E,m),[y,m,a,c]),x=Hi(d,h);return v.useMemo(()=>({getItemProps:g,itemRef:x}),[g,x])}const wD=v.forwardRef(function(t,n){const{render:r,className:o,id:a,label:l,nativeButton:c=!1,disabled:f=!1,closeOnClick:d=!0,...m}=t,h=v0({label:l}),y=xD(!0),g=Yi(a),{store:x}=ea(),E=x.useState("isActive",h.index),R=x.useState("itemProps"),{getItemProps:T,itemRef:C}=aJ({closeOnClick:d,disabled:f,highlighted:E,id:g,store:x,nativeButton:c,nodeId:y==null?void 0:y.nodeId,itemMetadata:oJ});return At("div",t,{state:{disabled:f,highlighted:E},props:[R,m,T],ref:[C,n,h.ref]})}),sJ={...po,...Xo},SD=v.forwardRef(function(t,n){const{render:r,className:o,finalFocus:a,...l}=t,{store:c}=ea(),{side:f,align:d}=xD(),m=cD()!=null,h=c.useState("open"),y=c.useState("transitionStatus"),g=c.useState("popupProps"),x=c.useState("mounted"),E=c.useState("instantType"),R=c.useState("activeTriggerElement"),T=c.useState("parent"),C=c.useState("lastOpenChangeReason"),k=c.useState("rootId"),M=c.useState("floatingRootContext"),D=c.useState("floatingTreeRoot"),O=c.useState("closeDelay"),N=c.useState("activeTriggerElement"),_=T.type==="context-menu";Qo({open:h,ref:c.context.popupRef,onComplete(){var H,B;h&&((B=(H=c.context).onOpenChangeComplete)==null||B.call(H,!0))}}),v.useEffect(()=>{function H(B){c.setOpen(!1,yt(B.reason,B.domEvent))}return D.events.on("close",H),()=>{D.events.off("close",H)}},[D.events,c]);const q=c.useState("hoverEnabled"),F=c.useState("disabled");uN(M,{enabled:q&&!F&&!_&&T.type!=="menubar",closeDelay:O});const G={transitionStatus:y,side:f,align:d,open:h,nested:T.type==="menu",instant:E},P=At("div",t,{state:G,ref:[n,c.context.popupRef],stateAttributesMapping:sJ,props:[g,{onKeyDown(H){m&&Fw.has(H.key)&&H.stopPropagation()}},Bc(y),l,{"data-rootownerid":k}]});let U=T.type===void 0||_;return(R||T.type==="menubar"&&C!==vm)&&(U=!0),w.jsx(Ow,{context:M,modal:_,disabled:!x,returnFocus:a===void 0?U:a,initialFocus:T.type!=="menu",restoreFocus:!0,externalTree:T.type!=="menubar"?D:void 0,previousFocusableElement:N,nextFocusableElement:T.type===void 0?c.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:T.type===void 0?c.context.beforeContentFocusGuardRef:void 0,children:P})}),ED=v.createContext(void 0);function lJ(){const e=v.useContext(ED);if(e===void 0)throw new Error(Rn(32));return e}const TD=v.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,{store:a}=ea();return a.useState("mounted")||r?w.jsx(ED.Provider,{value:r,children:w.jsx(kw,{ref:n,...o})}):null}),RD=v.forwardRef(function(t,n){var Pe;const{anchor:r,positionMethod:o="absolute",className:a,render:l,side:c,align:f,sideOffset:d=0,alignOffset:m=0,collisionBoundary:h="clipping-ancestors",collisionPadding:y=5,arrowPadding:g=5,sticky:x=!1,disableAnchorTracking:E=!1,collisionAvoidance:R=$2,...T}=t,{store:C}=ea(),k=lJ(),M=qc(!0),D=C.useState("parent"),O=C.useState("floatingRootContext"),N=C.useState("floatingTreeRoot"),_=C.useState("mounted"),q=C.useState("open"),F=C.useState("modal"),G=C.useState("activeTriggerElement"),P=C.useState("transitionStatus"),U=C.useState("lastOpenChangeReason"),H=C.useState("floatingNodeId"),B=C.useState("floatingParentNodeId");let j=r,z=d,V=m,K=f,L=R;D.type==="context-menu"&&(j=r??((Pe=D.context)==null?void 0:Pe.anchor),K=K??"start",!c&&K!=="center"&&(V=t.alignOffset??2,z=t.sideOffset??-5));let $=c,W=K;D.type==="menu"?($=$??"inline-end",W=W??"start",L=t.collisionAvoidance??G2):D.type==="menubar"&&($=$??"bottom",W=W??"start");const I=D.type==="context-menu",Q=Ww({anchor:j,floatingRootContext:O,positionMethod:M?"fixed":o,mounted:_,side:$,sideOffset:z,align:W,alignOffset:V,arrowPadding:I?0:g,collisionBoundary:h,collisionPadding:y,sticky:x,nodeId:H,keepMounted:k,disableAnchorTracking:E,collisionAvoidance:L,shiftCrossAxis:I&&!("side"in L&&L.side==="flip"),externalTree:N}),le=v.useMemo(()=>{const te={};return q||(te.pointerEvents="none"),{role:"presentation",hidden:!_,style:{...Q.positionerStyles,...te}}},[q,_,Q.positionerStyles]);v.useEffect(()=>{function te(he){he.open&&(he.parentNodeId===H&&C.set("hoverEnabled",!1),he.nodeId!==H&&he.parentNodeId===C.select("floatingParentNodeId")&&C.setOpen(!1,yt(dp)))}return N.events.on("menuopenchange",te),()=>{N.events.off("menuopenchange",te)}},[C,N.events,H]),v.useEffect(()=>{if(C.select("floatingParentNodeId")==null)return;function te(he){if(he.open||he.nodeId!==C.select("floatingParentNodeId"))return;const ye=he.reason??dp;C.setOpen(!1,yt(ye))}return N.events.on("menuopenchange",te),()=>{N.events.off("menuopenchange",te)}},[N.events,C]),v.useEffect(()=>{function te(he){!q||he.nodeId!==C.select("floatingParentNodeId")||he.target&&G&&G!==he.target&&C.setOpen(!1,yt(dp))}return N.events.on("itemhover",te),()=>{N.events.off("itemhover",te)}},[N.events,q,G,C]),v.useEffect(()=>{const te={open:q,nodeId:H,parentNodeId:B,reason:C.select("lastOpenChangeReason")};N.events.emit("menuopenchange",te)},[N.events,q,C,H,B]);const oe={open:q,side:Q.side,align:Q.align,anchorHidden:Q.anchorHidden,nested:D.type==="menu"},Z=v.useMemo(()=>({side:Q.side,align:Q.align,arrowRef:Q.arrowRef,arrowUncentered:Q.arrowUncentered,arrowStyles:Q.arrowStyles,nodeId:Q.context.nodeId}),[Q.side,Q.align,Q.arrowRef,Q.arrowUncentered,Q.arrowStyles,Q.context.nodeId]),ue=At("div",t,{state:oe,stateAttributesMapping:po,ref:[n,C.useStateSetter("positionerElement")],props:[le,Bc(P),T]}),ve=_&&D.type!=="menu"&&(D.type!=="menubar"&&F&&U!==wr||D.type==="menubar"&&D.context.modal);let Se=null;return D.type==="menubar"?Se=D.context.contentElement:D.type===void 0&&(Se=G),w.jsxs(vD.Provider,{value:Z,children:[ve&&w.jsx(Hw,{ref:D.type==="context-menu"||D.type==="nested-context-menu"?D.context.internalBackdropRef:null,inert:Uw(!q),cutout:Se}),w.jsx(gH,{id:H,children:w.jsx(Bm,{elementsRef:C.context.itemDomElements,labelsRef:C.context.itemLabels,children:ue})})]})}),cJ=v.createContext(null);function CD(e){return v.useContext(cJ)}const uJ={...Lw,disabled:We(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:We(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),allowMouseEnter:We(e=>e.allowMouseEnter),stickIfOpen:We(e=>e.stickIfOpen),parent:We(e=>e.parent),rootId:We(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:We(e=>e.activeIndex),isActive:We((e,t)=>e.activeIndex===t),hoverEnabled:We(e=>e.hoverEnabled),instantType:We(e=>e.instantType),lastOpenChangeReason:We(e=>e.openChangeReason),floatingTreeRoot:We(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:We(e=>e.floatingNodeId),floatingParentNodeId:We(e=>e.floatingParentNodeId),itemProps:We(e=>e.itemProps),closeDelay:We(e=>e.closeDelay),keyboardEventRelay:We(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class E0 extends Rm{constructor(n){super({...dJ(),...n},{positionerRef:v.createRef(),popupRef:v.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:v.createRef(),beforeContentFocusGuardRef:v.createRef(),onOpenChangeComplete:void 0,triggerElements:new ef},uJ);tt(this,"unsubscribeParentListener",null);this.unsubscribeParentListener=this.observe("parent",r=>{var o;if((o=this.unsubscribeParentListener)==null||o.call(this),r.type==="menu"){this.unsubscribeParentListener=r.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=r.store.context.allowMouseUpTriggerRef;return}r.type!==void 0&&(this.context.allowMouseUpTriggerRef=r.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(n,r){this.state.floatingRootContext.context.events.emit("setOpen",{open:n,eventDetails:r})}static useStore(n,r){const o=rr(()=>new E0(r)).current;return n??o}}function dJ(){return{...Pw(),disabled:!1,modal:!0,allowMouseEnter:!1,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Cw,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Pn,keyboardEventRelay:void 0,closeDelay:0}}const fJ=v.createContext(void 0);function hJ(){return v.useContext(fJ)}const kD=Aw(function(t){const{children:n,open:r,onOpenChange:o,onOpenChangeComplete:a,defaultOpen:l=!1,disabled:c=!1,modal:f,loopFocus:d=!0,orientation:m="vertical",actionsRef:h,closeParentOnEsc:y=!1,handle:g,triggerId:x,defaultTriggerId:E=null,highlightItemOnHover:R=!0}=t,T=qc(!0),C=ea(!0),k=CD(!0),M=hJ(),D=v.useMemo(()=>M&&C?{type:"menu",store:C.store}:k?{type:"menubar",context:k}:T&&!C?{type:"context-menu",context:T}:{type:void 0},[T,C,k,M]),O=E0.useStore(g==null?void 0:g.store,{open:l,openProp:r,activeTriggerId:E,triggerIdProp:x,parent:D});km(()=>{r===void 0&&O.state.open===!1&&l===!0&&O.update({open:!0,activeTriggerId:E})}),O.useControlledProp("openProp",r),O.useControlledProp("triggerIdProp",x),O.useContextCallback("onOpenChangeComplete",a);const N=O.useState("floatingTreeRoot"),_=BO(N),q=Zo();qe(()=>{T&&!C?O.update({parent:{type:"context-menu",context:T},floatingNodeId:_,floatingParentNodeId:q}):C&&O.update({floatingNodeId:_,floatingParentNodeId:q})},[T,C,_,q,O]);const F=O.useState("open"),G=O.useState("activeTriggerElement"),P=O.useState("positionerElement"),U=O.useState("hoverEnabled"),H=O.useState("modal"),B=O.useState("disabled"),j=O.useState("lastOpenChangeReason"),z=O.useState("parent"),V=O.useState("activeIndex"),K=O.useState("payload"),L=O.useState("floatingParentNodeId"),$=v.useRef(null),W=L!=null;let I;O.useSyncedValues({disabled:c,modal:z.type===void 0?f:void 0,rootId:ts()});const{openMethod:Q,triggerProps:le,reset:oe}=$w(F);_w(O);const{forceUnmount:Z}=Iw(F,O,()=>{O.update({allowMouseEnter:!1,stickIfOpen:!0}),oe()}),ue=v.useRef(z.type!=="context-menu"),ve=Dn();v.useEffect(()=>{if(F||($.current=null),z.type==="context-menu"){if(!F){ve.clear(),ue.current=!1;return}ve.start(500,()=>{ue.current=!0})}},[ve,F,z.type]),Vw(F&&H&&j!==wr&&Q!=="touch",P),qe(()=>{!F&&!U&&O.set("hoverEnabled",!0)},[F,U,O]);const Se=v.useRef(!0),Pe=Dn(),te=Ge((ze,Ze)=>{var vt;const nt=Ze.reason;if(F===ze&&Ze.trigger===G&&j===nt||(Ze.preventUnmountOnClose=()=>{O.set("preventUnmountingOnClose",!0)},!ze&&Ze.trigger==null&&(Ze.trigger=G??void 0),o==null||o(ze,Ze),Ze.isCanceled))return;const Ct={open:ze,nativeEvent:Ze.event,reason:Ze.reason,nested:W};I==null||I.emit("openchange",Ct);const zt=Ze.event;if(ze===!1&&(zt==null?void 0:zt.type)==="click"&&zt.pointerType==="touch"&&!Se.current)return;if(!ze&&V!==null){const Ke=O.context.itemDomElements.current[V];queueMicrotask(()=>{Ke==null||Ke.setAttribute("tabindex","-1")})}ze&&nt===rc?(Se.current=!1,Pe.start(300,()=>{Se.current=!0})):(Se.current=!0,Pe.clear());const bt=(nt===Wa||nt===ud)&&zt.detail===0&&(zt==null?void 0:zt.isTrusted),Dt=!ze&&(nt===xm||nt==null),ot={open:ze,openChangeReason:nt};$.current=Ze.event??null;const ft=((vt=Ze.trigger)==null?void 0:vt.id)??null;(ft||ze)&&(ot.activeTriggerId=ft,ot.activeTriggerElement=Ze.trigger??null),O.update(ot),z.type==="menubar"&&(nt===rc||nt===Js||nt===wr||nt===up||nt===dp)?O.set("instantType","group"):bt||Dt?O.set("instantType",bt?"click":"dismiss"):O.set("instantType",void 0)}),he=v.useCallback(ze=>{const Ze=yt(ze);return Ze.preventUnmountOnClose=()=>{O.set("preventUnmountingOnClose",!0)},Ze},[O]),ye=v.useCallback(()=>{O.setOpen(!1,he(ww))},[O,he]);v.useImperativeHandle(h,()=>({unmount:Z,close:ye}),[Z,ye]);let Le;z.type==="context-menu"&&(Le=z.context),v.useImperativeHandle(Le==null?void 0:Le.positionerRef,()=>P,[P]),v.useImperativeHandle(Le==null?void 0:Le.actionsRef,()=>({setOpen:te}),[te]);const Oe=jw({popupStore:O,onOpenChange:te});I=Oe.context.events,v.useEffect(()=>{const ze=({open:Ze,eventDetails:nt})=>te(Ze,nt);return I.on("setOpen",ze),()=>{I==null||I.off("setOpen",ze)}},[I,te]);const Te=Tm(Oe,{enabled:!B,bubbles:{escapeKey:y&&z.type==="menu"},outsidePress(){var ze;return z.type!=="context-menu"||((ze=$.current)==null?void 0:ze.type)==="contextmenu"?!0:ue.current},externalTree:W?N:void 0}),Ce=hN(Oe,{role:"menu"}),J=Fc(),Ee=v.useCallback(ze=>{O.select("activeIndex")!==ze&&O.set("activeIndex",ze)},[O]),xe=fN(Oe,{enabled:!B,listRef:O.context.itemDomElements,activeIndex:V,nested:z.type!==void 0,loopFocus:d,orientation:m,parentOrientation:z.type==="menubar"?z.context.orientation:void 0,rtl:J==="rtl",disabledIndices:Ka,onNavigate:Ee,openOnArrowKeyDown:z.type!=="context-menu",externalTree:W?N:void 0,focusItemOnHover:R}),Be=v.useCallback(ze=>{O.context.typingRef.current=ze},[O]),Ve=pN(Oe,{listRef:O.context.itemLabels,activeIndex:V,resetMs:WF,onMatch:ze=>{F&&ze!==V&&O.set("activeIndex",ze)},onTypingChange:Be}),{getReferenceProps:_e,getFloatingProps:ut,getItemProps:pe,getTriggerProps:Re}=tf([Te,Ce,xe,Ve]),ee=v.useMemo(()=>{const ze=ki(_e(),{onMouseMove(){O.set("allowMouseEnter",!0)}},le);return delete ze.role,ze},[_e,O,le]),fe=v.useMemo(()=>{const ze=Re();if(!ze)return ze;const Ze=ki(ze,le);return delete Ze.role,delete Ze["aria-controls"],Ze},[Re,le]),Ne=v.useMemo(()=>ut({onMouseMove(){O.set("allowMouseEnter",!0),z.type==="menu"&&O.set("hoverEnabled",!1)},onClick(){O.select("hoverEnabled")&&O.set("hoverEnabled",!1)},onKeyDown(ze){const Ze=O.select("keyboardEventRelay");Ze&&!ze.isPropagationStopped()&&Ze(ze)}}),[ut,z.type,O]),Ue=v.useMemo(()=>pe(),[pe]);O.useSyncedValues({floatingRootContext:Oe,activeTriggerProps:ee,inactiveTriggerProps:fe,popupProps:Ne,itemProps:Ue});const $e=v.useMemo(()=>({store:O,parent:D}),[O,D]),et=w.jsx(S0.Provider,{value:$e,children:typeof n=="function"?n({payload:K}):n});return z.type===void 0||z.type==="context-menu"?w.jsx(yH,{externalTree:N,children:et}):et});function MD(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=dw(),{ref:o,index:a}=v0(e),l=n===a,c=v.useRef(null),f=Hi(o,c);return{compositeProps:v.useMemo(()=>({tabIndex:l?0:-1,onFocus(){r(a)},onMouseMove(){const m=c.current;if(!t||!m)return;const h=m.hasAttribute("disabled")||m.ariaDisabled==="true";!l&&!h&&m.focus()}}),[l,r,a,t]),compositeRef:f,index:a}}function pJ(e){const{render:t,className:n,state:r=Pn,props:o=Ka,refs:a=Ka,metadata:l,stateAttributesMapping:c,tag:f="div",...d}=e,{compositeProps:m,compositeRef:h}=MD({metadata:l});return At(f,e,{state:r,ref:[...a,h],props:[m,...o,d],stateAttributesMapping:c})}function T0(e){if(On(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!ao(e))return T0(co(e))}function mJ(e){const{enabled:t=!0,mouseDownAction:n,open:r}=e,o=v.useRef(!1);return v.useMemo(()=>t?{onMouseDown:a=>{(n==="open"&&!r||n==="close"&&r)&&(o.current=!0,Gt(a.currentTarget).addEventListener("click",()=>{o.current=!1},{once:!0}))},onClick:a=>{o.current&&(o.current=!1,a.preventBaseUIHandler())}}:Pn,[t,n,r])}const Jh=2,gJ=iN(function(t,n){const{render:r,className:o,disabled:a=!1,nativeButton:l=!0,id:c,openOnHover:f,delay:d=100,closeDelay:m=0,handle:h,payload:y,...g}=t,x=ea(!0),E=(h==null?void 0:h.store)??(x==null?void 0:x.store);if(!E)throw new Error(Rn(85));const R=Yi(c),T=E.useState("isTriggerActive",R),C=E.useState("floatingRootContext"),k=E.useState("isOpenedByTrigger",R),M=v.useRef(null),D=bJ(),O=dw(!0),N=is(),_=v.useMemo(()=>N??new Cw,[N]),q=BO(_),F=Zo(),{registerTrigger:G,isMountedByThisTrigger:P}=aN(R,M,E,{payload:y,closeDelay:m,parent:D,floatingTreeRoot:_,floatingNodeId:q,floatingParentNodeId:F,keyboardEventRelay:O==null?void 0:O.relayKeyboardEvent}),U=D.type==="menubar",H=E.useState("disabled"),B=a||H||U&&D.context.disabled,{getButtonProps:j,buttonRef:z}=Wo({disabled:B,native:l});v.useEffect(()=>{!k&&D.type===void 0&&(E.context.allowMouseUpTriggerRef.current=!1)},[E,k,D.type]);const V=v.useRef(null),K=Dn(),L=Ge(Te=>{if(!V.current)return;K.clear(),E.context.allowMouseUpTriggerRef.current=!1;const Ce=Te.target;if(Tt(V.current,Ce)||Tt(E.select("positionerElement"),Ce)||Ce===V.current||Ce!=null&&T0(Ce)===E.select("rootId"))return;const J=iD(V.current);Te.clientX>=J.left-Jh&&Te.clientX<=J.right+Jh&&Te.clientY>=J.top-Jh&&Te.clientY<=J.bottom+Jh||_.events.emit("close",{domEvent:Te,reason:xw})});v.useEffect(()=>{k&&E.select("lastOpenChangeReason")===wr&&Gt(V.current).addEventListener("mouseup",L,{once:!0})},[k,L,E]);const $=U&&D.context.hasSubmenuOpen,I=dN(C,{enabled:(f??$)&&!B&&D.type!=="context-menu"&&(!U||$&&!P),handleClose:mN({blockPointerEvents:!U}),mouseOnly:!0,move:!1,restMs:D.type===void 0?d:void 0,delay:{close:m},triggerElementRef:M,externalTree:_,isActiveTrigger:T}),Q=yJ(k,E.select("lastOpenChangeReason")),le=YO(C,{enabled:!B&&D.type!=="context-menu",event:k&&U?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:D.type===void 0?Q:!1}),oe=lN(C,{enabled:!B&&$}),Z=mJ({open:k,enabled:U,mouseDownAction:"open"}),ue=tf([le,oe]),ve={disabled:B,open:k},Se=E.useState("triggerProps",P),Pe=[V,n,z,G,M],te=[ue.getReferenceProps(),I??Pn,Se,{"aria-haspopup":"menu",id:R,onMouseDown:Te=>{if(E.select("open"))return;K.start(200,()=>{E.context.allowMouseUpTriggerRef.current=!0}),Gt(Te.currentTarget).addEventListener("mouseup",L,{once:!0})}},U?{role:"menuitem"}:{},Z,g,j],he=v.useRef(null),ye=Ge(Te=>{yr.flushSync(()=>{E.setOpen(!1,yt(Js,Te.nativeEvent,Te.currentTarget))});const Ce=ZU(he.current);Ce==null||Ce.focus()}),Le=Ge(Te=>{var J;const Ce=E.select("positionerElement");if(Ce&&nc(Te,Ce))(J=E.context.beforeContentFocusGuardRef.current)==null||J.focus();else{yr.flushSync(()=>{E.setOpen(!1,yt(Js,Te.nativeEvent,Te.currentTarget))});let Ee=QU(E.context.triggerFocusTargetRef.current||M.current);for(;Ee!==null&&Tt(Ce,Ee);){const xe=Ee;if(Ee=bw(Ee),Ee===xe)break}Ee==null||Ee.focus()}}),Oe=At("button",t,{enabled:!U,stateAttributesMapping:zp,state:ve,ref:Pe,props:te});return U?w.jsx(pJ,{tag:"button",render:r,className:o,state:ve,refs:Pe,props:te,stateAttributesMapping:zp}):k?w.jsxs(v.Fragment,{children:[w.jsx(Mc,{ref:he,onFocus:ye},`${R}-pre-focus-guard`),w.jsx(v.Fragment,{children:Oe},R),w.jsx(Mc,{ref:E.context.triggerFocusTargetRef,onFocus:Le},`${R}-post-focus-guard`)]}):w.jsx(v.Fragment,{children:Oe},R)});function yJ(e,t){const n=Dn(),[r,o]=v.useState(!1);return qe(()=>{e&&t==="trigger-hover"?(o(!0),n.start(XF,()=>{o(!1)})):e||(n.clear(),o(!1))},[e,t,n]),r}function bJ(){const e=qc(!0),t=ea(!0),n=CD();return v.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}function vJ(e){const[t,n]=v.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),r=v.useRef(null),o=v.useRef(null),a=v.useRef(null),l=v.useRef(null),c=v.useRef(!0),f=v.useRef(null),d=ts(),m=v.useMemo(()=>({anchor:t,setAnchor:n,actionsRef:a,backdropRef:r,internalBackdropRef:o,positionerRef:l,allowMouseUpTriggerRef:c,initialCursorPointRef:f,rootId:d}),[t,d]);return w.jsx(bD.Provider,{value:m,children:w.jsx(S0.Provider,{value:void 0,children:w.jsx(kD,{...e})})})}const Jk=500,xJ=v.forwardRef(function(t,n){const{render:r,className:o,...a}=t,{setAnchor:l,actionsRef:c,internalBackdropRef:f,backdropRef:d,positionerRef:m,allowMouseUpTriggerRef:h,initialCursorPointRef:y,rootId:g}=qc(!1),{store:x}=ea(!1),E=x.useState("open"),R=x.useState("disabled"),T=v.useRef(null),C=v.useRef(null),k=Dn(),M=Dn(),D=v.useRef(!1);function O(U,H,B){var z;const j=B.type.startsWith("touch");y.current={x:U,y:H},l({getBoundingClientRect(){return DOMRect.fromRect({width:j?10:0,height:j?10:0,x:U,y:H})}}),D.current=!1,(z=c.current)==null||z.setOpen(!0,yt(Wa,B)),M.start(Jk,()=>{D.current=!0})}function N(U){if(R)return;h.current=!0,mr(U),O(U.clientX,U.clientY,U.nativeEvent),Gt(T.current).addEventListener("mouseup",B=>{var z;if(h.current=!1,!D.current)return;M.clear(),D.current=!1;const j=gr(B);Tt(m.current,j)||g&&j&&T0(j)===g||(z=c.current)==null||z.setOpen(!1,yt(xw,B))},{once:!0})}function _(U){if(!R&&(h.current=!1,U.touches.length===1)){U.stopPropagation();const H=U.touches[0];C.current={x:H.clientX,y:H.clientY},k.start(Jk,()=>{C.current&&O(C.current.x,C.current.y,U.nativeEvent)})}}function q(U){if(k.isStarted()&&C.current&&U.touches.length===1){const H=U.touches[0],B=10,j=Math.abs(H.clientX-C.current.x),z=Math.abs(H.clientY-C.current.y);(j>B||z>B)&&k.clear()}}function F(){k.clear(),C.current=null}return v.useEffect(()=>{function U(B){if(R)return;const z=gr(B);(Tt(T.current,z)||Tt(f.current,z)||Tt(d.current,z))&&B.preventDefault()}const H=Gt(T.current);return H.addEventListener("contextmenu",U),()=>{H.removeEventListener("contextmenu",U)}},[d,R,f]),At("div",t,{state:{open:E},ref:[T,n],props:[{onContextMenu:N,onTouchStart:_,onTouchMove:q,onTouchEnd:F,onTouchCancel:F,style:{WebkitTouchCallout:"none"}},a],stateAttributesMapping:zp})});function OD({...e}){return w.jsx(vJ,{"data-slot":"context-menu",...e})}function ND({...e}){return w.jsx(xJ,{"data-slot":"context-menu-trigger",...e})}function AD({className:e,sideOffset:t=4,...n}){const{side:r,align:o,alignOffset:a,...l}=n;return w.jsx(TD,{children:w.jsx(RD,{className:"isolate z-50 outline-none",sideOffset:t,side:r,align:o,alignOffset:a,children:w.jsx(SD,{"data-slot":"context-menu-content",className:De("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-44 max-w-[min(22rem,calc(100vw-1.5rem))] rounded-lg p-1 shadow-md ring-1 duration-100 z-50 max-h-(--available-height) w-auto origin-(--transform-origin) overflow-x-hidden overflow-y-auto outline-none data-closed:overflow-hidden",e),...l})})})}function Gs({className:e,inset:t,variant:n="default",...r}){return w.jsx(wD,{"data-slot":"context-menu-item","data-inset":t,"data-variant":n,className:De("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground gap-1.5 rounded-md px-1.5 py-1 text-sm data-inset:pl-7 [&_svg:not([class*='size-'])]:size-4 group/context-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [@media(any-pointer:coarse)]:py-2",e),...r})}function Wp({className:e,...t}){return w.jsx(Sw,{"data-slot":"context-menu-separator",className:De("bg-border -mx-1 my-1 h-px",e),...t})}const DD=v.createContext(void 0);function Um(){const e=v.useContext(DD);if(e===void 0)throw new Error(Rn(53));return e}let Xp=(function(e){return e.scrollAreaCornerHeight="--scroll-area-corner-height",e.scrollAreaCornerWidth="--scroll-area-corner-width",e})({});const ep=500,eM=16;function Ti(e,t,n){if(!e)return 0;const r=getComputedStyle(e),o=n==="x"?"Inline":"Block";return n==="x"&&t==="margin"?parseFloat(r[`${t}InlineStart`])*2:parseFloat(r[`${t}${o}Start`])+parseFloat(r[`${t}${o}End`])}let wJ=(function(e){return e.orientation="data-orientation",e.hovering="data-hovering",e.scrolling="data-scrolling",e.hasOverflowX="data-has-overflow-x",e.hasOverflowY="data-has-overflow-y",e.overflowXStart="data-overflow-x-start",e.overflowXEnd="data-overflow-x-end",e.overflowYStart="data-overflow-y-start",e.overflowYEnd="data-overflow-y-end",e})({}),Gl=(function(e){return e.scrolling="data-scrolling",e.hasOverflowX="data-has-overflow-x",e.hasOverflowY="data-has-overflow-y",e.overflowXStart="data-overflow-x-start",e.overflowXEnd="data-overflow-x-end",e.overflowYStart="data-overflow-y-start",e.overflowYEnd="data-overflow-y-end",e})({});const R0={hasOverflowX:e=>e?{[Gl.hasOverflowX]:""}:null,hasOverflowY:e=>e?{[Gl.hasOverflowY]:""}:null,overflowXStart:e=>e?{[Gl.overflowXStart]:""}:null,overflowXEnd:e=>e?{[Gl.overflowXEnd]:""}:null,overflowYStart:e=>e?{[Gl.overflowYStart]:""}:null,overflowYEnd:e=>e?{[Gl.overflowYEnd]:""}:null,cornerHidden:()=>null},SJ={x:0,y:0},tM={width:0,height:0},EJ={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},TJ={x:!1,y:!1,corner:!1},RJ=v.forwardRef(function(t,n){const{render:r,className:o,overflowEdgeThreshold:a,...l}=t,c=CJ(a),f=Yi(),d=Dn(),m=Dn(),{nonce:h,disableStyleElements:y}=uD(),[g,x]=v.useState(!1),[E,R]=v.useState(!1),[T,C]=v.useState(!1),[k,M]=v.useState(!1),[D,O]=v.useState(tM),[N,_]=v.useState(tM),[q,F]=v.useState(EJ),[G,P]=v.useState(TJ),U=v.useRef(null),H=v.useRef(null),B=v.useRef(null),j=v.useRef(null),z=v.useRef(null),V=v.useRef(null),K=v.useRef(null),L=v.useRef(!1),$=v.useRef(0),W=v.useRef(0),I=v.useRef(0),Q=v.useRef(0),le=v.useRef("vertical"),oe=v.useRef(SJ),Z=Ge(Te=>{const Ce=Te.x-oe.current.x,J=Te.y-oe.current.y;oe.current=Te,J!==0&&(C(!0),d.start(ep,()=>{C(!1)})),Ce!==0&&(R(!0),m.start(ep,()=>{R(!1)}))}),ue=Ge(Te=>{Te.button===0&&(L.current=!0,$.current=Te.clientY,W.current=Te.clientX,le.current=Te.currentTarget.getAttribute(wJ.orientation),H.current&&(I.current=H.current.scrollTop,Q.current=H.current.scrollLeft),z.current&&le.current==="vertical"&&z.current.setPointerCapture(Te.pointerId),V.current&&le.current==="horizontal"&&V.current.setPointerCapture(Te.pointerId))}),ve=Ge(Te=>{if(!L.current)return;const Ce=Te.clientY-$.current,J=Te.clientX-W.current;if(H.current){const Ee=H.current.scrollHeight,xe=H.current.clientHeight,Be=H.current.scrollWidth,Ve=H.current.clientWidth;if(z.current&&B.current&&le.current==="vertical"){const _e=Ti(B.current,"padding","y"),ut=Ti(z.current,"margin","y"),pe=z.current.offsetHeight,Re=B.current.offsetHeight-pe-_e-ut,ee=Ce/Re;H.current.scrollTop=I.current+ee*(Ee-xe),Te.preventDefault(),C(!0),d.start(ep,()=>{C(!1)})}if(V.current&&j.current&&le.current==="horizontal"){const _e=Ti(j.current,"padding","x"),ut=Ti(V.current,"margin","x"),pe=V.current.offsetWidth,Re=j.current.offsetWidth-pe-_e-ut,ee=J/Re;H.current.scrollLeft=Q.current+ee*(Be-Ve),Te.preventDefault(),R(!0),m.start(ep,()=>{R(!1)})}}}),Se=Ge(Te=>{L.current=!1,z.current&&le.current==="vertical"&&z.current.releasePointerCapture(Te.pointerId),V.current&&le.current==="horizontal"&&V.current.releasePointerCapture(Te.pointerId)});function Pe(Te){M(Te.pointerType==="touch")}function te(Te){if(Pe(Te),Te.pointerType!=="touch"){const Ce=Tt(U.current,Te.target);x(Ce)}}const he=v.useMemo(()=>({scrolling:E||T,hasOverflowX:!G.x,hasOverflowY:!G.y,overflowXStart:q.xStart,overflowXEnd:q.xEnd,overflowYStart:q.yStart,overflowYEnd:q.yEnd,cornerHidden:G.corner}),[E,T,G.x,G.y,G.corner,q]),ye={role:"presentation",onPointerEnter:te,onPointerMove:te,onPointerDown:Pe,onPointerLeave(){x(!1)},style:{position:"relative",[Xp.scrollAreaCornerHeight]:`${D.height}px`,[Xp.scrollAreaCornerWidth]:`${D.width}px`}},Le=At("div",t,{state:he,ref:[n,U],props:[ye,l],stateAttributesMapping:R0}),Oe=v.useMemo(()=>({handlePointerDown:ue,handlePointerMove:ve,handlePointerUp:Se,handleScroll:Z,cornerSize:D,setCornerSize:O,thumbSize:N,setThumbSize:_,touchModality:k,cornerRef:K,scrollingX:E,setScrollingX:R,scrollingY:T,setScrollingY:C,hovering:g,setHovering:x,viewportRef:H,rootRef:U,scrollbarYRef:B,scrollbarXRef:j,thumbYRef:z,thumbXRef:V,rootId:f,hiddenState:G,setHiddenState:P,overflowEdges:q,setOverflowEdges:F,viewportState:he,overflowEdgeThreshold:c}),[ue,ve,Se,Z,D,N,k,E,R,T,C,g,x,f,G,q,he,c]);return w.jsxs(DD.Provider,{value:Oe,children:[!y&&Id.getElement(h),Le]})});function CJ(e){if(typeof e=="number"){const t=Math.max(0,e);return{xStart:t,xEnd:t,yStart:t,yEnd:t}}return{xStart:Math.max(0,(e==null?void 0:e.xStart)||0),xEnd:Math.max(0,(e==null?void 0:e.xEnd)||0),yStart:Math.max(0,(e==null?void 0:e.yStart)||0),yEnd:Math.max(0,(e==null?void 0:e.yEnd)||0)}}const kJ=v.createContext(void 0);function MJ(e,t){if(typeof IntersectionObserver>"u")return()=>{};const n=new IntersectionObserver(r=>{r.forEach(o=>{o.intersectionRatio>0&&(t(),n.disconnect())})});return n.observe(e),()=>{n.disconnect()}}let Ha=(function(e){return e.scrollAreaOverflowXStart="--scroll-area-overflow-x-start",e.scrollAreaOverflowXEnd="--scroll-area-overflow-x-end",e.scrollAreaOverflowYStart="--scroll-area-overflow-y-start",e.scrollAreaOverflowYEnd="--scroll-area-overflow-y-end",e})({});const nM=1;function rM(e,t){if(t<=0)return 0;const n=$o(e,0,t),r=n,o=t-n,a=r<=nM,l=o<=nM;return a&&l?r<=o?0:t:a?0:l?t:n}let iM=!1;function OJ(){iM||gm||(typeof CSS<"u"&&"registerProperty"in CSS&&[Ha.scrollAreaOverflowXStart,Ha.scrollAreaOverflowXEnd,Ha.scrollAreaOverflowYStart,Ha.scrollAreaOverflowYEnd].forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),iM=!0)}const NJ=v.forwardRef(function(t,n){const{render:r,className:o,...a}=t,{viewportRef:l,scrollbarYRef:c,scrollbarXRef:f,thumbYRef:d,thumbXRef:m,cornerRef:h,cornerSize:y,setCornerSize:g,setThumbSize:x,rootId:E,setHiddenState:R,hiddenState:T,handleScroll:C,setHovering:k,setOverflowEdges:M,overflowEdges:D,overflowEdgeThreshold:O,scrollingX:N,scrollingY:_}=Um(),q=Fc(),F=v.useRef(!0),G=Dn(),P=Dn(),U=Ge(()=>{const K=l.current,L=c.current,$=f.current,W=d.current,I=m.current,Q=h.current;if(!K)return;const le=K.scrollHeight,oe=K.scrollWidth,Z=K.clientHeight,ue=K.clientWidth,ve=K.scrollTop,Se=K.scrollLeft;if(le===0||oe===0)return;const Pe=Z>=le,te=ue>=oe,he=ue/oe,ye=Z/le,Le=Math.max(0,oe-ue),Oe=Math.max(0,le-Z);let Te=0,Ce=0;if(!te){let ot=0;q==="rtl"?ot=$o(-Se,0,Le):ot=$o(Se,0,Le),Te=rM(ot,Le),Ce=Le-Te}const J=Pe?0:$o(ve,0,Oe),Ee=Pe?0:rM(J,Oe),xe=Pe?0:Oe-Ee,Be=te?0:ue,Ve=Pe?0:Z;let _e=0,ut=0;!te&&!Pe&&(_e=(L==null?void 0:L.offsetWidth)||0,ut=($==null?void 0:$.offsetHeight)||0);const pe=y.width===0&&y.height===0,Re=pe?_e:0,ee=pe?ut:0,fe=Ti($,"padding","x"),Ne=Ti(L,"padding","y"),Ue=Ti(I,"margin","x"),$e=Ti(W,"margin","y"),et=Be-fe-Ue,ze=Ve-Ne-$e,Ze=$?Math.min($.offsetWidth-Re,et):et,nt=L?Math.min(L.offsetHeight-ee,ze):ze,Ct=Math.max(eM,Ze*he),zt=Math.max(eM,nt*ye);if(x(ot=>ot.height===zt&&ot.width===Ct?ot:{width:Ct,height:zt}),L&&W){const ot=L.offsetHeight-zt-Ne-$e,ft=le-Z,vt=ft===0?0:ve/ft,Ke=Math.min(ot,Math.max(0,vt*ot));W.style.transform=`translate3d(0,${Ke}px,0)`}if($&&I){const ot=$.offsetWidth-Ct-fe-Ue,ft=oe-ue,vt=ft===0?0:Se/ft,Ke=q==="rtl"?$o(vt*ot,-ot,0):$o(vt*ot,0,ot);I.style.transform=`translate3d(${Ke}px,0,0)`}const bt=[[Ha.scrollAreaOverflowXStart,Te],[Ha.scrollAreaOverflowXEnd,Ce],[Ha.scrollAreaOverflowYStart,Ee],[Ha.scrollAreaOverflowYEnd,xe]];for(const[ot,ft]of bt)K.style.setProperty(ot,`${ft}px`);Q&&(te||Pe?g({width:0,height:0}):!te&&!Pe&&g({width:_e,height:ut})),R(ot=>{const ft=Pe||te;return ot.y===Pe&&ot.x===te&&ot.corner===ft?ot:{y:Pe,x:te,corner:ft}});const Dt={xStart:!te&&Te>O.xStart,xEnd:!te&&Ce>O.xEnd,yStart:!Pe&&Ee>O.yStart,yEnd:!Pe&&xe>O.yEnd};M(ot=>ot.xStart===Dt.xStart&&ot.xEnd===Dt.xEnd&&ot.yStart===Dt.yStart&&ot.yEnd===Dt.yEnd?ot:Dt)});qe(()=>{if(!l.current)return;OJ();let K=!1;return MJ(l.current,()=>{if(!K){K=!0;return}U()})},[U,l]),qe(()=>{queueMicrotask(U)},[U,T,q]),qe(()=>{var K;(K=l.current)!=null&&K.matches(":hover")&&k(!0)},[l,k]),v.useEffect(()=>{const K=l.current;if(typeof ResizeObserver>"u"||!K)return;let L=!1;const $=new ResizeObserver(()=>{if(!L){L=!0;return}U()});return $.observe(K),P.start(0,()=>{const W=K.getAnimations({subtree:!0});W.length!==0&&Promise.allSettled(W.map(I=>I.finished)).then(U).catch(()=>{})}),()=>{$.disconnect(),P.clear()}},[U,l,P]);function H(){F.current=!1}const B={role:"presentation",...E&&{"data-id":`${E}-viewport`},...(!T.x||!T.y)&&{tabIndex:0},className:Id.className,style:{overflow:"scroll"},onScroll(){l.current&&(U(),F.current||C({x:l.current.scrollLeft,y:l.current.scrollTop}),G.start(100,()=>{F.current=!0}))},onWheel:H,onTouchMove:H,onPointerMove:H,onPointerEnter:H,onKeyDown:H},j=v.useMemo(()=>({scrolling:N||_,hasOverflowX:!T.x,hasOverflowY:!T.y,overflowXStart:D.xStart,overflowXEnd:D.xEnd,overflowYStart:D.yStart,overflowYEnd:D.yEnd,cornerHidden:T.corner}),[N,_,T.x,T.y,T.corner,D]),z=At("div",t,{ref:[n,l],state:j,props:[B,a],stateAttributesMapping:R0}),V=v.useMemo(()=>({computeThumbPosition:U}),[U]);return w.jsx(kJ.Provider,{value:V,children:z})}),_D=v.createContext(void 0);function AJ(){const e=v.useContext(_D);if(e===void 0)throw new Error(Rn(54));return e}let Qp=(function(e){return e.scrollAreaThumbHeight="--scroll-area-thumb-height",e.scrollAreaThumbWidth="--scroll-area-thumb-width",e})({});const DJ=v.forwardRef(function(t,n){const{render:r,className:o,orientation:a="vertical",keepMounted:l=!1,...c}=t,{hovering:f,scrollingX:d,scrollingY:m,hiddenState:h,overflowEdges:y,scrollbarYRef:g,scrollbarXRef:x,viewportRef:E,thumbYRef:R,thumbXRef:T,handlePointerDown:C,handlePointerUp:k,rootId:M,thumbSize:D}=Um(),O={hovering:f,scrolling:{horizontal:d,vertical:m}[a],orientation:a,hasOverflowX:!h.x,hasOverflowY:!h.y,overflowXStart:y.xStart,overflowXEnd:y.xEnd,overflowYStart:y.yStart,overflowYEnd:y.yEnd,cornerHidden:h.corner},N=Fc();v.useEffect(()=>{const U=E.current,H=a==="vertical"?g.current:x.current;if(!H)return;function B(j){if(!(!U||!H||j.ctrlKey)){if(j.preventDefault(),a==="vertical"){if(U.scrollTop===0&&j.deltaY<0)return}else if(U.scrollLeft===0&&j.deltaX<0)return;if(a==="vertical"){if(U.scrollTop===U.scrollHeight-U.clientHeight&&j.deltaY>0)return}else if(U.scrollLeft===U.scrollWidth-U.clientWidth&&j.deltaX>0)return;a==="vertical"?U.scrollTop+=j.deltaY:U.scrollLeft+=j.deltaX}}return H.addEventListener("wheel",B,{passive:!1}),()=>{H.removeEventListener("wheel",B)}},[a,x,g,E]);const _={...M&&{"data-id":`${M}-scrollbar`},onPointerDown(U){if(U.button===0&&U.currentTarget===U.target&&E.current){if(R.current&&g.current&&a==="vertical"){const H=Ti(R.current,"margin","y"),B=Ti(g.current,"padding","y"),j=R.current.offsetHeight,z=g.current.getBoundingClientRect(),V=U.clientY-z.top-j/2-B+H/2,K=E.current.scrollHeight,L=E.current.clientHeight,$=g.current.offsetHeight-j-B-H,I=V/$*(K-L);E.current.scrollTop=I}if(T.current&&x.current&&a==="horizontal"){const H=Ti(T.current,"margin","x"),B=Ti(x.current,"padding","x"),j=T.current.offsetWidth,z=x.current.getBoundingClientRect(),V=U.clientX-z.left-j/2-B+H/2,K=E.current.scrollWidth,L=E.current.clientWidth,$=x.current.offsetWidth-j-B-H,W=V/$;let I;N==="rtl"?(I=(1-W)*(K-L),E.current.scrollLeft<=0&&(I=-I)):I=W*(K-L),E.current.scrollLeft=I}C(U)}},onPointerUp:k,style:{position:"absolute",touchAction:"none",WebkitUserSelect:"none",userSelect:"none",...a==="vertical"&&{top:0,bottom:`var(${Xp.scrollAreaCornerHeight})`,insetInlineEnd:0,[Qp.scrollAreaThumbHeight]:`${D.height}px`},...a==="horizontal"&&{insetInlineStart:0,insetInlineEnd:`var(${Xp.scrollAreaCornerWidth})`,bottom:0,[Qp.scrollAreaThumbWidth]:`${D.width}px`}}},q=At("div",t,{ref:[n,a==="vertical"?g:x],state:O,props:[_,c],stateAttributesMapping:R0}),F=v.useMemo(()=>({orientation:a}),[a]),G=a==="vertical"?h.y:h.x;return l||!G?w.jsx(_D.Provider,{value:F,children:q}):null}),_J=v.forwardRef(function(t,n){const{render:r,className:o,...a}=t,{thumbYRef:l,thumbXRef:c,handlePointerDown:f,handlePointerMove:d,handlePointerUp:m,setScrollingX:h,setScrollingY:y}=Um(),{orientation:g}=AJ();return At("div",t,{ref:[n,g==="vertical"?l:c],state:{orientation:g},props:[{onPointerDown:f,onPointerMove:d,onPointerUp(R){g==="vertical"&&y(!1),g==="horizontal"&&h(!1),m(R)},style:{...g==="vertical"&&{height:`var(${Qp.scrollAreaThumbHeight})`},...g==="horizontal"&&{width:`var(${Qp.scrollAreaThumbWidth})`}}},a]})}),IJ=v.forwardRef(function(t,n){const{render:r,className:o,...a}=t,{cornerRef:l,cornerSize:c,hiddenState:f}=Um(),d=At("div",t,{ref:[n,l],props:[{style:{position:"absolute",bottom:0,insetInlineEnd:0,width:c.width,height:c.height}},a]});return f.corner?null:d});function ID({className:e,children:t,...n}){return w.jsxs(RJ,{"data-slot":"scroll-area",className:De("relative",e),...n,children:[w.jsx(NJ,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),w.jsx(PJ,{}),w.jsx(IJ,{})]})}function PJ({className:e,orientation:t="vertical",...n}){return w.jsx(DJ,{"data-slot":"scroll-area-scrollbar","data-orientation":t,orientation:t,className:De("data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent flex touch-none p-px transition-colors select-none","[@media(any-pointer:coarse)]:hidden",e),...n,children:w.jsx(_J,{"data-slot":"scroll-area-thumb",className:"rounded-full bg-border relative flex-1"})})}function wp(e,t){return`${e}
|
|
475
|
+
${t}`}const id=lf()(Qw(e=>({expanded:{},toggle:(t,n)=>e(r=>{const o=wp(t,n),a={...r.expanded};return a[o]?delete a[o]:a[o]=!0,{expanded:a}}),expand:(t,n)=>e(r=>{const o=wp(t,n);return r.expanded[o]?r:{expanded:{...r.expanded,[o]:!0}}}),collapse:(t,n)=>e(r=>{const o=wp(t,n);if(!r.expanded[o])return r;const a={...r.expanded};return delete a[o],{expanded:a}}),pruneRoot:t=>e(n=>{const r=`${t}
|
|
476
|
+
`,o={};for(const a of Object.keys(n.expanded))a.startsWith(r)||(o[a]=n.expanded[a]);return{expanded:o}}),pruneStaleRoots:t=>e(n=>{const r=new Set(t),o={};let a=!1;for(const l of Object.keys(n.expanded)){const c=l.slice(0,l.indexOf(`
|
|
477
|
+
`));r.has(c)?o[l]=n.expanded[l]:a=!0}return a?{expanded:o}:n})}),{name:"tmex-file-tree",partialize:e=>({expanded:e.expanded})}));function LJ(e){const t=new TextEncoder().encode(e);let n="";for(const r of t)n+=String.fromCharCode(r);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function jJ(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.length%4===0?"":"=".repeat(4-t.length%4),r=atob(t+n),o=new Uint8Array(r.length);for(let a=0;a<r.length;a++)o[a]=r.charCodeAt(a);return new TextDecoder().decode(o)}function zJ(e,t){return LJ(`${e}
|
|
478
|
+
${t}`)}function FJ(e){try{const t=jJ(e),n=t.indexOf(`
|
|
479
|
+
`);return n<0?null:{rootId:t.slice(0,n),path:t.slice(n+1)}}catch{return null}}function BJ(e,t){return`/file/${zJ(e,t)}`}function C0(e,t,n){const r=new URLSearchParams({rootId:t});return n!=null&&r.set("path",n),`/api/files/${e}?${r.toString()}`}function Sre(e,t,n=!1){const r=new URLSearchParams({rootId:e,path:t});return n&&r.set("download","1"),`/api/files/raw?${r.toString()}`}function UJ(e,t){return`/api/files/download?${new URLSearchParams({rootId:e,path:t}).toString()}`}function Bi(e){if(!Number.isFinite(e)||e<0)return"0 B";if(e<1024)return`${e} B`;const t=["KB","MB","GB","TB"];let n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;const o=n>=100?0:n>=10?1:2;return`${n.toFixed(o)} ${t[r]}`}function PD(e){return`${Bi(e)}/s`}class Pd extends Error{constructor(n,r,o){super(r);tt(this,"status");tt(this,"code");this.name="FileApiError",this.status=n,this.code=o}}async function Ri(e){let t=`HTTP ${e.status}`,n;try{const r=await e.json();r.error&&(t=r.error),n=r.code}catch{}return new Pd(e.status,t,n)}async function HJ(){const e=await fetch("/api/files/roots");if(!e.ok)throw await Ri(e);return await e.json()}async function Ere(e){const t=await fetch("/api/files/roots",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await Ri(t);return await t.json()}async function Tre(e,t){const n=await fetch(`/api/files/roots/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw await Ri(n);return await n.json()}async function Rre(e){const t=await fetch(`/api/files/roots/${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok)throw await Ri(t)}async function qJ(e,t){const n=await fetch(C0("list",e,t));if(!n.ok)throw await Ri(n);return await n.json()}async function Cre(e,t){const n=await fetch(C0("stat",e,t));if(!n.ok)throw await Ri(n);return await n.json()}async function kre(e,t){const n=await fetch(C0("content",e,t));if(!n.ok)throw await Ri(n);return await n.json()}const VJ=8*1024*1024;async function $J(e,t,n,r={}){const{onLeg:o,signal:a}=r,l=()=>{if(a!=null&&a.aborted)throw new DOMException("Aborted","AbortError")},c=n.size,f=x=>`${Bi(x)} / ${Bi(c)}`,d={rootId:e,path:t,name:n.name,size:c},m=await fetch("/api/files/upload/init",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d),signal:a});if(!m.ok)throw await Ri(m);const{uploadId:h,chunkSize:y}=await m.json(),g=y>0?y:VJ;try{o==null||o(1,{pct:c===0?100:0,detail:f(0)});const x=performance.now();let E=0;for(;E<c;){l();const D=Math.min(E+g,c),O=await fetch(`/api/files/upload/${h}?offset=${E}`,{method:"PUT",body:n.slice(E,D),signal:a});if(!O.ok)throw await Ri(O);E=D;const N=(performance.now()-x)/1e3;o==null||o(1,{pct:Math.round(E/c*100),rate:N>0?PD(E/N):void 0,detail:f(E)})}o==null||o(1,{pct:100,detail:f(c)}),l(),o==null||o(2,{pct:0,detail:f(0)});const R=await fetch(`/api/files/upload/${h}/commit`,{method:"POST",signal:a});if(!R.ok||!R.body)throw await Ri(R);const T=R.body.getReader(),C=new TextDecoder;let k="",M=!1;for(;;){const{done:D,value:O}=await T.read();if(D)break;k+=C.decode(O,{stream:!0});const N=k.split(`
|
|
480
|
+
`);k=N.pop()??"";for(const _ of N){if(!_.trim())continue;const q=JSON.parse(_);if(q.type==="progress")o==null||o(2,{pct:q.pct,rate:q.rate,detail:f(q.transferred)});else if(q.type==="done")M=!0;else if(q.type==="error")throw new Pd(500,q.detail??q.code,q.code)}}if(!M)throw new Pd(500,"unknown","unknown");o==null||o(2,{pct:100,detail:f(c)})}catch(x){try{await fetch(`/api/files/upload/${h}`,{method:"DELETE"})}catch{}throw x}}async function GJ(e,t,n,r={}){const{onLeg:o,signal:a}=r;o==null||o(1,{pct:0});const l=await fetch("/api/files/download/prepare",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({rootId:e,path:t}),signal:a});if(!l.ok||!l.body)throw await Ri(l);const c=l.body.getReader(),f=new TextDecoder;let d="",m="",h=0,y=n,g=null;for(;;){const{done:x,value:E}=await c.read();if(x)break;d+=f.decode(E,{stream:!0});const R=d.split(`
|
|
481
|
+
`);d=R.pop()??"";for(const T of R){if(!T.trim())continue;const C=JSON.parse(T);C.type==="progress"?o==null||o(1,{pct:C.pct??0,rate:C.rate,detail:C.transferred!=null?Bi(C.transferred):void 0}):C.type==="done"?(m=C.downloadId??"",h=C.size??0,y=C.name??n):C.type==="error"&&(g=new Pd(500,C.detail??C.code??"unknown",C.code))}}if(g)throw g;if(!m)throw new Pd(500,"unknown","unknown");o==null||o(1,{pct:100,detail:Bi(h)});try{const x=_=>`${Bi(_)} / ${Bi(h)}`;o==null||o(2,{pct:0,detail:x(0)});const E=await fetch(`/api/files/download/${m}/content`,{signal:a});if(!E.ok||!E.body)throw await Ri(E);const R=Number(E.headers.get("Content-Length")??String(h)),T=E.body.getReader(),C=[];let k=0;const M=performance.now();for(;;){const{done:_,value:q}=await T.read();if(_)break;C.push(q),k+=q.byteLength;const F=(performance.now()-M)/1e3;o==null||o(2,{pct:R>0?Math.round(k/R*100):0,rate:F>0?PD(k/F):void 0,detail:`${Bi(k)} / ${Bi(R)}`})}const D=new Blob(C),O=URL.createObjectURL(D),N=document.createElement("a");N.href=O,N.download=y,document.body.appendChild(N),N.click(),N.remove(),URL.revokeObjectURL(O),o==null||o(2,{pct:100,detail:x(h)})}catch(x){try{await fetch(`/api/files/download/${m}`,{method:"DELETE"})}catch{}throw x}}const YJ=new Set(["json","jsonc","json5"]);function LD(e,t){if(e.type==="dir"||e.category==="directory")return t!=null&&t.expanded?CN:E9;const n=e.name.toLowerCase().split(".").pop()??"";switch(e.category){case"code":return YJ.has(n)?s9:c9;case"markdown":return _b;case"image":return h9;case"pdf":return _b;case"archive":return o9;case"audio":return d9;case"video":return m9;case"text":return _b;default:return b9}}function jD(e){switch(e){case"directory":return"text-muted-foreground";case"code":return"text-blue-500/80 dark:text-blue-400/80";case"markdown":return"text-foreground/70";case"image":return"text-emerald-500/80 dark:text-emerald-400/80";case"pdf":return"text-red-500/70 dark:text-red-400/70";case"archive":return"text-amber-500/80 dark:text-amber-400/80";case"audio":return"text-purple-500/70 dark:text-purple-400/70";case"video":return"text-pink-500/70 dark:text-pink-400/70";default:return"text-muted-foreground"}}function Mre(e){return e}function k0(e){return encodeURIComponent(e)}const KJ=12e3,WJ=12e3,XJ=120;let lv=!1;function QJ(e){var n,r;const t=((r=(n=Mn.getState().snapshots[e])==null?void 0:n.session)==null?void 0:r.windows)??[];return new Set(t.map(o=>o.id))}function ZJ(e,t){var r,o;const n=((o=(r=Mn.getState().snapshots[e])==null?void 0:r.session)==null?void 0:o.windows)??[];for(const a of n)if(!t.has(a.id)&&a.panes.length>0){const l=a.panes.find(c=>c.active)??a.panes[0];return{windowId:a.id,paneId:l.id,paneTitle:l.title??null}}return null}async function oM(e,t){const n=Date.now();for(;Date.now()-n<t;){const r=e();if(r)return r;await new Promise(o=>setTimeout(o,XJ))}return null}function JJ(e,t){return Qt.t("files.install.prompt",{device:e,scope:t?Qt.t("files.install.scopeRemote"):Qt.t("files.install.scopeLocal")})}function eee(e){return Qt.t("files.sendToAgent.prompt",{path:e})}async function zD(e,t){if(!lv){lv=!0;try{const n=Mn.getState();if(!n.connectedDevices.has(e)&&(n.connectDevice(e),!await oM(()=>{var l;return(l=Mn.getState().snapshots[e])!=null&&l.session?!0:null},KJ))){Bt.error(Qt.t("files.agentLaunch.connectFailed"));return}const r=QJ(e);n.createWindow(e);const o=await oM(()=>ZJ(e,r),WJ);if(!o){Bt.error(Qt.t("files.agentLaunch.windowFailed"));return}sn.getState().startDraft(e,o.paneId,o.paneTitle,t),S7(`/devices/${e}/windows/${o.windowId}/panes/${k0(o.paneId)}`,{replace:!0}),Mi.getState().setSidebarTab("agent"),E7()}finally{lv=!1}}}function tee(e,t){return zD(e,t)}function nee(e,t){return zD(e,eee(t))}function ree({value:e=0,className:t}){const n=Math.max(0,Math.min(100,e));return w.jsx("div",{className:De("bg-secondary relative h-1.5 w-full overflow-hidden rounded-full",t),children:w.jsx("div",{className:"bg-primary h-full rounded-full transition-[width] duration-150",style:{width:`${n}%`}})})}function aM(e,t){return e==="upload"?t===1?Qt.t("files.transfer.legUserToTmex"):Qt.t("files.transfer.legTmexToServer"):t===1?Qt.t("files.transfer.legServerToTmex"):Qt.t("files.transfer.legTmexToUser")}function sM({label:e,leg:t}){const n=[t.rate,t.detail].filter(Boolean).join(" · ");return w.jsxs("div",{className:"flex flex-col gap-1",children:[w.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs text-muted-foreground",children:[w.jsx("span",{className:"truncate",children:e}),w.jsx("span",{className:"shrink-0 tabular-nums",children:n})]}),w.jsx(ree,{value:t.pct})]})}function iee({m:e}){return w.jsxs("div",{className:"flex w-full flex-col gap-2","data-testid":"transfer-toast",children:[w.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:e.fileName}),w.jsx(sM,{label:aM(e.direction,1),leg:e.legs[0]}),w.jsx(sM,{label:aM(e.direction,2),leg:e.legs[1]})]})}function FD(e,t,n){const r=`transfer-${e}-${performance.now()}`,o={fileName:e,direction:t,legs:[{pct:0},{pct:0}]};let a=0;const l=()=>{const c={...o,legs:[{...o.legs[0]},{...o.legs[1]}]};Bt(w.jsx(iee,{m:c}),{id:r,duration:Number.POSITIVE_INFINITY,dismissible:!1,closeButton:!1,action:{label:Qt.t("files.transfer.cancel"),onClick:()=>n()},classNames:{content:"flex-1"}})};return l(),{leg(c,f){o.legs[c-1]=f;const d=performance.now();f.pct<100&&d-a<100||(a=d,l())},success(c){Bt.success(w.jsx("span",{"data-testid":"transfer-toast",children:c}),{id:r,duration:4e3,dismissible:!0,closeButton:!0})},fail(c){Bt.error(w.jsx("span",{"data-testid":"transfer-toast",children:c}),{id:r,duration:Number.POSITIVE_INFINITY,dismissible:!0,closeButton:!0})},cancel(){Bt.dismiss(r)}}}const oee=2*1024*1024*1024,BD=12,aee=2e3,see=3e4;function lee(e){const t=e.lastIndexOf("/");return t<=0?"/":e.slice(0,t)}function cee(e,t){if(t===e)return".";const n=e==="/"?"/":`${e}/`;return t.startsWith(n)?t.slice(n.length):t}async function lM(e,t,n){try{await gD(e),Bt.success(t)}catch{Bt.error(n)}}function Jl(e){return Array.from(e.dataTransfer.types).includes("Files")}function UD({deviceId:e,absPath:t,rootPath:n}){const{t:r}=mn();return w.jsxs(w.Fragment,{children:[w.jsxs(Gs,{onClick:()=>void lM(t,r("files.copied"),r("files.copyFailed")),children:[w.jsx(Z8,{}),r("files.menu.copyAbsolute")]}),w.jsxs(Gs,{onClick:()=>void lM(cee(n,t),r("files.copied"),r("files.copyFailed")),children:[w.jsx(A9,{}),r("files.menu.copyRelative")]}),w.jsxs(Gs,{onClick:()=>void nee(e,t),children:[w.jsx(Mm,{}),r("files.menu.sendToAgent")]})]})}function HD({root:e,absPath:t,size:n}){const r=e.deviceType==="ssh"?Om:af;return w.jsxs("div",{className:"px-1.5 pt-1 pb-1.5",children:[w.jsxs("div",{className:"flex items-center justify-between gap-2 text-[10px] text-muted-foreground",children:[w.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[w.jsx(r,{className:"h-3 w-3 shrink-0"}),w.jsx("span",{className:"truncate",children:e.deviceName??e.deviceId})]}),n!=null&&w.jsx("span",{className:"shrink-0 tabular-nums",children:Bi(n)})]}),w.jsx("div",{className:"mt-0.5 font-mono text-[11px] break-all text-foreground/70",children:t})]})}function uee(){const e=Gi();return v.useMemo(()=>{const t=Ws("/file/:ref",e.pathname);return t!=null&&t.params.ref?FJ(t.params.ref):null},[e.pathname])}function dee(e){return`files.error.${e??"unknown"}`}function fee(){var h,y,g,x;const{t:e}=mn(),t=Qa(),n=RL({queryKey:["files"]}),r=id(E=>E.pruneStaleRoots),o=oi({queryKey:["files","roots"],queryFn:HJ,refetchOnWindowFocus:!0}),a=oi({queryKey:["devices"],queryFn:async()=>{const E=await fetch("/api/devices");if(!E.ok)throw new Error("devices");return await E.json()}}),l=oi({queryKey:["llm-providers"],queryFn:async()=>{const E=await fetch("/api/llm/providers");if(!E.ok)throw new Error("providers");return await E.json()},throwOnError:!1}),c=oi({queryKey:["system","info"],queryFn:async()=>{const E=await fetch("/api/system/info");if(!E.ok)throw new Error("system");return await E.json()},throwOnError:!1}),f=v.useMemo(()=>{var E;return(((E=o.data)==null?void 0:E.roots)??[]).filter(R=>R.enabled)},[o.data]);v.useEffect(()=>{o.data&&r(o.data.roots.map(E=>E.id))},[o.data,r]);const d={llmConfigured:(((h=l.data)==null?void 0:h.providers)??[]).length>0,localDeviceId:((g=(y=a.data)==null?void 0:y.devices.find(E=>E.type==="local"))==null?void 0:g.id)??null,transferMaxBytes:((x=c.data)==null?void 0:x.transferMaxBytes)??oee},m=()=>void t.invalidateQueries({queryKey:["files"]});return w.jsxs(Xw,{className:"flex min-h-0 flex-1 flex-col pt-0","data-testid":"files-tab",children:[w.jsxs("div",{className:"flex items-center justify-between gap-2 px-2 pb-1.5",children:[w.jsx("span",{className:"truncate text-xs font-medium text-muted-foreground",children:e("files.title")}),w.jsx(Ht,{variant:"ghost",size:"icon-xs",onClick:m,title:e("files.refresh"),"data-testid":"files-refresh",children:w.jsx(kN,{className:De("h-3.5 w-3.5",n>0&&"animate-spin")})})]}),w.jsx(ID,{className:"min-h-0 flex-1",children:w.jsxs("div",{onDragOver:E=>{Jl(E)&&E.preventDefault()},onDrop:E=>{Jl(E)&&E.preventDefault()},className:"space-y-0.5 pr-1 pb-2 select-none [-webkit-touch-callout:none] [-webkit-user-select:none]",children:[f.map(E=>w.jsx(qD,{root:E,rootId:E.id,path:E.path,depth:0,isRoot:!0,ctx:d},E.id)),o.isLoading&&w.jsx("div",{className:"px-2 py-3 text-center text-xs text-muted-foreground",children:e("common.loading")}),!o.isLoading&&f.length===0&&w.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:e("files.noRoots")})]})})]})}function hee({root:e}){const t=e.deviceType==="ssh"?Om:af;return w.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-[10px] text-muted-foreground/70",children:[w.jsx(t,{className:"h-3 w-3"}),w.jsx("span",{className:"max-w-24 truncate",children:e.deviceName??"—"})]})}function qD({root:e,rootId:t,path:n,depth:r,isRoot:o,ctx:a}){var _,q,F;const{t:l}=mn(),c=wp(t,n),f=id(G=>!!G.expanded[c]),d=id(G=>G.toggle),m=id(G=>G.expand),h=Qa(),y=v.useRef(null),g=v.useRef(0),[x,E]=v.useState(!1),R=()=>{g.current=0,E(!1)},T=async G=>{if(G.length!==0){for(const P of G){if(P.size>a.transferMaxBytes){Bt.error(l("files.transfer.tooLarge",{name:P.name,max:Bi(a.transferMaxBytes)}));continue}const U=new AbortController,H=FD(P.name,"upload",()=>U.abort());try{await $J(t,n,P,{onLeg:H.leg,signal:U.signal}),H.success(l("files.upload.success",{name:P.name}))}catch{U.signal.aborted?H.cancel():H.fail(l("files.upload.fail",{name:P.name}))}}m(t,n),h.invalidateQueries({queryKey:["files","list",t,n]})}},C=oi({queryKey:["files","list",t,n],queryFn:()=>qJ(t,n),enabled:f,staleTime:aee,retry:!1,refetchOnWindowFocus:!0,refetchInterval:G=>G.state.status==="error"?!1:see,refetchIntervalInBackground:!1}),k=(_=C.error)==null?void 0:_.code,M=v.useRef(null);v.useEffect(()=>{if(!(k==="rsync_missing_local"||k==="rsync_missing_remote")){M.current=null;return}if(M.current===c)return;M.current=c;const P=k==="rsync_missing_remote",U=P||e.deviceType==="local"?e.deviceId:a.localDeviceId,H=`rsync-missing-${c}`;Bt.error(l(dee(k)),{id:H,description:e.deviceName?`${e.deviceName}`:void 0,action:a.llmConfigured&&U?{label:l("files.install.button"),onClick:()=>{Bt.dismiss(H),tee(U,JJ(e.deviceName??e.deviceId,P))}}:void 0})},[k,c,e,a.llmConfigured,a.localDeviceId,l]),v.useEffect(()=>{if(!C.data)return;const G=new Set(C.data.entries.filter(H=>H.type==="dir").map(H=>H.path)),P=id.getState(),U=`${t}
|
|
482
|
+
`;for(const H of Object.keys(P.expanded)){if(!H.startsWith(U))continue;const B=H.slice(U.length);B!==n&&lee(B)===n&&!G.has(B)&&P.collapse(t,B)}},[C.data,t,n]);const D=LD({category:"directory",name:e.name,type:"dir"},{expanded:f}),O=r*BD+4,N=O+18;return w.jsxs("div",{children:[w.jsxs(OD,{children:[w.jsx(ND,{render:w.jsxs("button",{type:"button",onClick:()=>d(t,n),onDragEnter:G=>{Jl(G)&&(G.preventDefault(),g.current+=1,E(!0))},onDragOver:G=>{Jl(G)&&(G.preventDefault(),G.dataTransfer.dropEffect="copy")},onDragLeave:G=>{Jl(G)&&(g.current-=1,g.current<=0&&R())},onDrop:G=>{Jl(G)&&(G.preventDefault(),R(),T(Array.from(G.dataTransfer.files)))},"data-testid":`file-dir-${t}-${n}`,style:{paddingLeft:O},className:De("flex w-full min-w-0 items-center gap-1.5 rounded-md py-1 pr-2 text-left transition-colors hover:bg-sidebar-accent data-[popup-open]:bg-sidebar-accent data-[pressed]:bg-sidebar-accent [@media(any-pointer:coarse)]:py-1.5",o?"font-medium text-foreground":"text-foreground",x&&"bg-primary/15 ring-1 ring-primary/40 ring-inset"),children:[w.jsx(of,{className:De("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform",f&&"rotate-90")}),w.jsx(D,{className:De("h-4 w-4 shrink-0",o?"text-muted-foreground":jD("directory"))}),w.jsx("span",{className:"min-w-0 flex-1 truncate text-xs",children:o?e.name:mee(n)}),o&&w.jsx(hee,{root:e})]})}),w.jsxs(AD,{children:[w.jsx(HD,{root:e,absPath:n}),w.jsx(Wp,{}),w.jsxs(Gs,{onClick:()=>d(t,n),children:[w.jsx(W8,{}),l(f?"files.menu.collapse":"files.menu.expand")]}),w.jsxs(Gs,{onClick:()=>{var G;return(G=y.current)==null?void 0:G.click()},children:[w.jsx(yq,{}),l("files.menu.upload")]}),w.jsx(Wp,{}),w.jsx(UD,{deviceId:e.deviceId,absPath:n,rootPath:e.path})]})]}),w.jsx("input",{ref:y,type:"file",multiple:!0,hidden:!0,onChange:G=>{const P=Array.from(G.target.files??[]);G.target.value="",T(P)}}),f&&w.jsxs("div",{children:[(C.isLoading||C.isFetching&&!C.data)&&w.jsxs("div",{style:{paddingLeft:N},className:"flex items-center gap-1.5 py-1 text-[11px] text-muted-foreground",children:[w.jsx(tl,{className:"h-3 w-3 animate-spin"}),l("common.loading")]}),C.isError&&w.jsx(pee,{code:k,indent:N,onRetry:()=>void C.refetch()}),(q=C.data)==null?void 0:q.entries.map(G=>G.type==="dir"?w.jsx(qD,{root:e,rootId:t,path:G.path,depth:r+1,isRoot:!1,ctx:a},G.path):w.jsx(gee,{entry:G,root:e,depth:r+1},G.path)),C.data&&C.data.entries.length===0&&w.jsx("div",{style:{paddingLeft:N},className:"py-1 text-[11px] text-muted-foreground/70",children:l("files.emptyDir")}),((F=C.data)==null?void 0:F.truncated)&&w.jsx("div",{style:{paddingLeft:N},className:"py-1 text-[11px] text-muted-foreground/70",children:l("files.truncated")})]})]})}function pee({code:e,indent:t,onRetry:n}){const{t:r}=mn();return w.jsxs("div",{style:{paddingLeft:t},className:"flex items-start gap-1.5 py-1 pr-2 text-[11px] text-destructive/80",children:[w.jsx(mq,{className:"mt-0.5 h-3 w-3 shrink-0"}),w.jsx("span",{className:"min-w-0 flex-1",children:r(`files.error.${e??"unknown"}`)}),w.jsx("button",{type:"button",onClick:n,className:"shrink-0 text-muted-foreground hover:text-foreground",title:r("files.retry"),children:w.jsx(kN,{className:"h-3 w-3"})})]})}function mee(e){const t=e.lastIndexOf("/");return(t>=0?e.slice(t+1):e)||e}function gee({entry:e,root:t,depth:n}){const{t:r}=mn(),o=Kd(),{isMobile:a,setOpenMobile:l}=qr(),c=uee(),f=t.id,d=(c==null?void 0:c.rootId)===f&&(c==null?void 0:c.path)===e.path,m=LD(e),h=n*BD+4+18,y=()=>{o(BJ(f,e.path)),a&&l(!1)},g=async()=>{const x=new AbortController,E=FD(e.name,"download",()=>x.abort());try{await GJ(f,e.path,e.name,{onLeg:E.leg,signal:x.signal}),E.success(r("files.transfer.downloaded",{name:e.name}))}catch{x.signal.aborted?E.cancel():E.fail(r("files.transfer.downloadFailed",{name:e.name}))}};return w.jsxs(OD,{children:[w.jsx(ND,{render:w.jsxs("button",{type:"button",draggable:!0,onClick:y,onDragStart:x=>{const E=window.location.origin+UJ(f,e.path);x.dataTransfer.setData("DownloadURL",`application/octet-stream:${e.name}:${E}`),x.dataTransfer.effectAllowed="copy"},onDragEnd:x=>{x.dataTransfer.dropEffect==="copy"&&Bt(r("files.transfer.dragDownloadStarted",{name:e.name}))},"data-testid":`file-item-${f}-${e.path}`,title:e.name,style:{paddingLeft:h},className:De("flex w-full min-w-0 items-center gap-1.5 rounded-md py-1 pr-2 text-left transition-colors data-[pressed]:bg-sidebar-accent [@media(any-pointer:coarse)]:py-1.5",d?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-sidebar-accent hover:text-foreground data-[popup-open]:bg-sidebar-accent data-[popup-open]:text-foreground"),children:[w.jsx(m,{className:De("h-4 w-4 shrink-0",d?"text-primary":jD(e.category))}),w.jsx("span",{className:"min-w-0 flex-1 truncate text-xs",children:e.name}),e.isSymlink&&w.jsx("span",{className:"shrink-0 text-[9px] text-muted-foreground/60",title:"symlink",children:"↗"})]})}),w.jsxs(AD,{children:[w.jsx(HD,{root:t,absPath:e.path,size:e.size}),w.jsx(Wp,{}),w.jsxs(Gs,{onClick:y,children:[w.jsx(CN,{}),r("files.menu.open")]}),w.jsxs(Gs,{onClick:()=>void g(),"data-testid":`file-download-${f}-${e.path}`,children:[w.jsx(e9,{}),r("files.download")]}),w.jsx(Wp,{}),w.jsx(UD,{deviceId:t.deviceId,absPath:e.path,rootPath:t.path})]})]})}const VD=v.createContext(void 0);function $D(){const e=v.useContext(VD);if(e===void 0)throw new Error(Rn(64));return e}let yee=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const GD={tabActivationDirection:e=>({[yee.activationDirection]:e})},bee=v.forwardRef(function(t,n){const{className:r,defaultValue:o=0,onValueChange:a,orientation:l="horizontal",render:c,value:f,...d}=t,m=Fc(),h=Object.hasOwn(t,"defaultValue"),y=v.useRef([]),[g,x]=v.useState(()=>new Map),[E,R]=Cc({controlled:f,default:o,name:"Tabs",state:"value"}),T=f!==void 0,[C,k]=v.useState(()=>new Map),[M,D]=v.useState("none"),O=Ge((z,V)=>{a==null||a(z,V),!V.isCanceled&&(R(z),D(V.activationDirection))}),N=Ge((z,V)=>{x(K=>{if(K.get(z)===V)return K;const L=new Map(K);return L.set(z,V),L})}),_=Ge((z,V)=>{x(K=>{if(!K.has(z)||K.get(z)!==V)return K;const L=new Map(K);return L.delete(z),L})}),q=v.useCallback(z=>g.get(z),[g]),F=v.useCallback(z=>{for(const V of C.values())if(z===(V==null?void 0:V.value))return V==null?void 0:V.id},[C]),G=v.useCallback(z=>{if(z===void 0)return null;for(const[V,K]of C.entries())if(K!=null&&z===(K.value??K.index))return V;return null},[C]),P=v.useMemo(()=>({direction:m,getTabElementBySelectedValue:G,getTabIdByPanelValue:F,getTabPanelIdByValue:q,onValueChange:O,orientation:l,registerMountedTabPanel:N,setTabMap:k,unregisterMountedTabPanel:_,tabActivationDirection:M,value:E}),[m,G,F,q,O,l,N,k,_,M,E]),U=v.useMemo(()=>{for(const z of C.values())if(z!=null&&z.value===E)return z},[C,E]),H=v.useMemo(()=>{for(const z of C.values())if(z!=null&&!z.disabled)return z.value},[C]);qe(()=>{if(T||C.size===0)return;const z=U==null?void 0:U.disabled,V=U==null&&E!==null;if(h&&z&&E===o||!z&&!V)return;const L=H??null;E!==L&&(R(L),D("none"))},[o,H,h,T,U,D,R,C,E]);const j=At("div",t,{state:{orientation:l,tabActivationDirection:M},ref:n,props:d,stateAttributesMapping:GD});return w.jsx(VD.Provider,{value:P,children:w.jsx(Bm,{elementsRef:y,children:j})})}),YD="data-composite-item-active",KD=v.createContext(void 0);function vee(){const e=v.useContext(KD);if(e===void 0)throw new Error(Rn(65));return e}const xee=v.forwardRef(function(t,n){const{className:r,disabled:o=!1,render:a,value:l,id:c,nativeButton:f=!0,...d}=t,{value:m,getTabPanelIdByValue:h,orientation:y}=$D(),{activateOnFocus:g,highlightedTabIndex:x,onTabActivation:E,setHighlightedTabIndex:R,tabsListElement:T}=vee(),C=Yi(c),k=v.useMemo(()=>({disabled:o,id:C,value:l}),[o,C,l]),{compositeProps:M,compositeRef:D,index:O}=MD({metadata:k}),N=l===m,_=v.useRef(!1);qe(()=>{if(_.current){_.current=!1;return}if(!(N&&O>-1&&x!==O))return;const K=T;if(K!=null){const L=ri(Gt(K));if(L&&Tt(K,L))return}o||R(O)},[N,O,x,R,o,T]);const{getButtonProps:q,buttonRef:F}=Wo({disabled:o,native:f,focusableWhenDisabled:!0}),G=h(l),P=v.useRef(!1),U=v.useRef(!1);function H(K){N||o||E(l,yt(qi,K.nativeEvent,void 0,{activationDirection:"none"}))}function B(K){N||(O>-1&&!o&&R(O),!o&&g&&(!P.current||P.current&&U.current)&&E(l,yt(qi,K.nativeEvent,void 0,{activationDirection:"none"})))}function j(K){if(N||o)return;P.current=!0;function L(){P.current=!1,U.current=!1}(!K.button||K.button===0)&&(U.current=!0,Gt(K.currentTarget).addEventListener("pointerup",L,{once:!0}))}return At("button",t,{state:{disabled:o,active:N,orientation:y},ref:[n,F,D],props:[M,{role:"tab","aria-controls":G,"aria-selected":N,id:C,onClick:H,onFocus:B,onPointerDown:j,[YD]:N?"":void 0,onKeyDownCapture(){_.current=!0}},d,q]})});function wee(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const See=[];function Eee(e){const{itemSizes:t,cols:n=1,loopFocus:r=!0,dense:o=!1,orientation:a="both",direction:l,highlightedIndex:c,onHighlightedIndexChange:f,rootRef:d,enableHomeAndEndKeys:m=!1,stopEventPropagation:h=!1,disabledIndices:y,modifierKeys:g=See}=e,[x,E]=v.useState(0),R=n>1,T=v.useRef(null),C=Hi(T,d),k=v.useRef([]),M=v.useRef(!1),D=c??x,O=Ge((q,F=!1)=>{if((f??E)(q),F){const G=k.current[q];DC(T.current,G,l,a)}}),N=Ge(q=>{if(q.size===0||M.current)return;M.current=!0;const F=Array.from(q.keys()),G=F.find(U=>U==null?void 0:U.hasAttribute(YD))??null,P=G?F.indexOf(G):-1;P!==-1&&O(P),DC(T.current,G,l,a)}),_=v.useMemo(()=>({"aria-orientation":a==="both"?void 0:a,ref:C,onFocus(q){!T.current||!AC(q.target)||q.target.setSelectionRange(0,q.target.value.length??0)},onKeyDown(q){const F=m?u8:vN;if(!F.has(q.key)||Tee(q,g)||!T.current)return;const P=l==="rtl",U=P?Nd:sc,H={horizontal:U,vertical:_s,both:U}[a],B=P?sc:Nd,j={horizontal:B,vertical:ac,both:B}[a];if(AC(q.target)&&!wee(q.target)){const I=q.target.selectionStart,Q=q.target.selectionEnd,le=q.target.value??"";if(I==null||q.shiftKey||I!==Q||q.key!==j&&I<le.length||q.key!==H&&I>0)return}let z=D;const V=cp(k,y),K=Zv(k,y);if(R){const I=t||Array.from({length:k.current.length},()=>({width:1,height:1})),Q=SO(I,n,o),le=Q.findIndex(Z=>Z!=null&&!Ya(k,Z,y)),oe=Q.reduce((Z,ue,ve)=>ue!=null&&!Ya(k,ue,y)?ve:Z,-1);z=Q[wO({current:Q.map(Z=>Z?k.current[Z]:null)},{event:q,orientation:a,loopFocus:r,cols:n,disabledIndices:TO([...y||k.current.map((Z,ue)=>Ya(k,ue)?ue:void 0),void 0],Q),minIndex:le,maxIndex:oe,prevIndex:EO(D>K?V:D,I,Q,n,q.key===_s?"bl":q.key===sc?"tr":"tl"),rtl:P})]}const L={horizontal:[U],vertical:[_s],both:[U,_s]}[a],$={horizontal:[B],vertical:[ac],both:[B,ac]}[a],W=R?F:{horizontal:m?l8:yN,vertical:m?c8:bN,both:F}[a];m&&(q.key===nf?z=V:q.key===rf&&(z=K)),z===D&&(L.includes(q.key)||$.includes(q.key))&&(r&&z===K&&L.includes(q.key)?z=V:r&&z===V&&$.includes(q.key)?z=K:z=pr(k,{startingIndex:z,decrement:$.includes(q.key),disabledIndices:y})),z!==D&&!tc(k,z)&&(h&&q.stopPropagation(),W.has(q.key)&&q.preventDefault(),O(z,!0),queueMicrotask(()=>{var I;(I=k.current[z])==null||I.focus()}))}}),[n,o,l,y,k,m,D,R,t,r,C,g,O,a,h]);return v.useMemo(()=>({props:_,highlightedIndex:D,onHighlightedIndexChange:O,elementsRef:k,disabledIndices:y,onMapChange:N,relayKeyboardEvent:_.onKeyDown}),[_,D,O,k,y,N])}function Tee(e,t){for(const n of m8.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function Ree(e){const{render:t,className:n,refs:r=Ka,props:o=Ka,state:a=Pn,stateAttributesMapping:l,highlightedIndex:c,onHighlightedIndexChange:f,orientation:d,dense:m,itemSizes:h,loopFocus:y,cols:g,enableHomeAndEndKeys:x,onMapChange:E,stopEventPropagation:R=!0,rootRef:T,disabledIndices:C,modifierKeys:k,highlightItemOnHover:M=!1,tag:D="div",...O}=e,N=Fc(),{props:_,highlightedIndex:q,onHighlightedIndexChange:F,elementsRef:G,onMapChange:P,relayKeyboardEvent:U}=Eee({itemSizes:h,cols:g,loopFocus:y,dense:m,orientation:d,highlightedIndex:c,onHighlightedIndexChange:f,rootRef:T,stopEventPropagation:R,enableHomeAndEndKeys:x,direction:N,disabledIndices:C,modifierKeys:k}),H=At(D,e,{state:a,ref:r,props:[_,...o,O],stateAttributesMapping:l}),B=v.useMemo(()=>({highlightedIndex:q,onHighlightedIndexChange:F,highlightItemOnHover:M,relayKeyboardEvent:U}),[q,F,M,U]);return w.jsx(lO.Provider,{value:B,children:w.jsx(Bm,{elementsRef:G,onMapChange:j=>{E==null||E(j),P(j)},children:H})})}const Cee=v.forwardRef(function(t,n){const{activateOnFocus:r=!1,className:o,loopFocus:a=!0,render:l,...c}=t,{getTabElementBySelectedValue:f,onValueChange:d,orientation:m,value:h,setTabMap:y,tabActivationDirection:g}=$D(),[x,E]=v.useState(0),[R,T]=v.useState(null),C=kee(h,m,R,f),k=Ge((N,_)=>{if(N!==h){const q=C(N);_.activationDirection=q,d(N,_)}}),M={orientation:m,tabActivationDirection:g},D={"aria-orientation":m==="vertical"?"vertical":void 0,role:"tablist"},O=v.useMemo(()=>({activateOnFocus:r,highlightedTabIndex:x,onTabActivation:k,setHighlightedTabIndex:E,tabsListElement:R,value:h}),[r,x,k,E,R,h]);return w.jsx(KD.Provider,{value:O,children:w.jsx(Ree,{render:l,className:o,state:M,refs:[n,T],props:[D,c],stateAttributesMapping:GD,highlightedIndex:x,enableHomeAndEndKeys:!0,loopFocus:a,orientation:m,onHighlightedIndexChange:E,onMapChange:y,disabledIndices:Ka})})});function cM(e,t){const{left:n,top:r}=e.getBoundingClientRect(),{left:o,top:a}=t.getBoundingClientRect(),l=n-o,c=r-a;return{left:l,top:c}}function kee(e,t,n,r){const[o,a]=v.useState(null);return qe(()=>{if(e==null||n==null){a(null);return}const l=r(e);if(l==null){a(null);return}const{left:c,top:f}=cM(l,n);a(t==="horizontal"?c:f)},[t,r,n,e]),v.useCallback(l=>{if(l===e)return"none";if(l==null)return a(null),"none";if(l!=null&&n!=null){const c=r(l);if(c!=null){const{left:f,top:d}=cM(c,n);if(o==null)return a(t==="horizontal"?f:d),"none";if(t==="horizontal"){if(f<o)return a(f),"left";if(f>o)return a(f),"right"}else{if(d<o)return a(d),"up";if(d>o)return a(d),"down"}}}return"none"},[r,t,o,n,e])}function Mee({className:e,orientation:t="horizontal",...n}){return w.jsx(bee,{"data-slot":"tabs","data-orientation":t,className:De("gap-2 group/tabs flex data-horizontal:flex-col",e),...n})}const Oee=cm("rounded-lg p-[3px] group-data-horizontal/tabs:h-8 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function Nee({className:e,variant:t="default",...n}){return w.jsx(Cee,{"data-slot":"tabs-list","data-variant":t,className:De(Oee({variant:t}),e),...n})}function cv({className:e,...t}){return w.jsx(xee,{"data-slot":"tabs-trigger",className:De("gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg:not([class*='size-'])]:size-4 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background dark:data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 data-active:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",e),...t})}function Zp({children:e,onClick:t,...n}){const{isMobile:r,setOpenMobile:o}=qr(),a=l=>{r&&o(!1),t==null||t(l)};return w.jsx(ow,{...n,onClick:a,children:e})}function Aee({items:e}){const{t}=mn();return w.jsx(Xw,{children:w.jsx(p7,{children:e.map(n=>{var r,o;return w.jsxs(jm,{defaultOpen:n.isActive,render:w.jsx(m7,{}),children:[w.jsx(Zp,{to:n.url,children:w.jsxs(y7,{tooltip:t(n.title),children:[w.jsx(n.icon,{}),w.jsx("span",{children:t(n.title)})]})}),(r=n.items)!=null&&r.length?w.jsxs(w.Fragment,{children:[w.jsxs(zm,{render:w.jsx(b7,{className:"data-[state=open]:rotate-90"}),children:[w.jsx(of,{}),w.jsx("span",{className:"sr-only",children:"Toggle"})]}),w.jsx(Fm,{children:w.jsx(v7,{children:(o=n.items)==null?void 0:o.map(a=>w.jsx(x7,{children:w.jsx(Zp,{to:a.url,children:w.jsx(w7,{children:w.jsx("span",{children:t(a.title)})})})},a.title))})})]}):null]},n.title)})})})}const Dee={auth_failed:"authFailed",agent_unavailable:"agentUnavailable",agent_no_identity:"agentNoIdentity",ssh_config_ref_not_supported:"configRefNotSupported",network_unreachable:"networkUnreachable",connection_refused:"connectionRefused",timeout:"timeout",host_not_found:"hostNotFound",handshake_failed:"handshakeFailed",tmux_unavailable:"tmuxUnavailable",connection_closed:"connectionClosed"};function _ee({deviceId:e,className:t}){const{t:n}=mn(),r=Mn(a=>a.deviceReconnecting[e]),o=Mn(a=>a.deviceErrors[e]);if(r)return w.jsxs(il,{variant:"outline",title:r.message,className:De("h-5 gap-1 border-amber-400/40 bg-amber-500/10 px-1.5 text-[10px] font-normal text-amber-700 dark:text-amber-300",t),children:[w.jsx(J9,{className:"h-3 w-3 animate-spin"}),w.jsx("span",{className:"truncate max-w-[120px]",children:r.message})]});if(o){const a=Dee[o.type]??"unknown",l=n(`deviceStatus.errorBadge.${a}`),c=[l,o.message,o.rawMessage].filter(Boolean).join(`
|
|
483
|
+
`);return w.jsxs(il,{variant:"outline",title:c,className:De("h-5 gap-1 border-red-400/40 bg-red-500/10 px-1.5 text-[10px] font-normal text-red-700 dark:text-red-300",t),children:[w.jsx(fd,{className:"h-3 w-3"}),w.jsx("span",{className:"truncate max-w-[120px]",children:l})]})}return null}function Iee(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:o,onOpenChangeComplete:a,actionsRef:l,handle:c,triggerId:f,defaultTriggerId:d=null}=e,m=rs(),h=!!m,y=rr(()=>(c==null?void 0:c.store)??new wN({open:r,openProp:n,activeTriggerId:d,triggerIdProp:f,modal:!0,disablePointerDismissal:!0,nested:h,role:"alertdialog"})).current;y.useControlledProp("openProp",n),y.useControlledProp("triggerIdProp",f),y.useSyncedValue("nested",h),y.useContextCallback("onOpenChange",o),y.useContextCallback("onOpenChangeComplete",a);const g=y.useState("payload");xN({store:y,actionsRef:l,parentContext:m==null?void 0:m.store.context});const x=v.useMemo(()=>({store:y}),[y]);return w.jsx(Ew.Provider,{value:x,children:typeof t=="function"?t({payload:g}):t})}function Sx({...e}){return w.jsx(Iee,{"data-slot":"alert-dialog",...e})}function Pee({...e}){return w.jsx(qw,{"data-slot":"alert-dialog-portal",...e})}function Lee({className:e,...t}){return w.jsx(Tw,{"data-slot":"alert-dialog-overlay",className:De("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",e),...t})}function Ex({className:e,size:t="default",...n}){return w.jsxs(Pee,{children:[w.jsx(Lee,{}),w.jsx(Bw,{"data-slot":"alert-dialog-content","data-size":t,className:De("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 bg-background ring-foreground/10 gap-4 rounded-xl p-4 ring-1 duration-100 data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 outline-none",e),...n})]})}function Tx({className:e,...t}){return w.jsx("div",{"data-slot":"alert-dialog-header",className:De("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...t})}function Rx({className:e,...t}){return w.jsx("div",{"data-slot":"alert-dialog-footer",className:De("bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...t})}function uM({className:e,...t}){return w.jsx("div",{"data-slot":"alert-dialog-media",className:De("bg-muted mb-2 inline-flex size-10 items-center justify-center rounded-md sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6",e),...t})}function Cx({className:e,...t}){return w.jsx(Gw,{"data-slot":"alert-dialog-title",className:De("text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...t})}function kx({className:e,...t}){return w.jsx(Rw,{"data-slot":"alert-dialog-description",className:De("text-muted-foreground *:[a]:hover:text-foreground text-sm text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3",e),...t})}function Mx({className:e,...t}){return w.jsx(Ht,{"data-slot":"alert-dialog-action",className:De(e),...t})}function Ox({className:e,variant:t="outline",size:n="default",...r}){return w.jsx(wm,{"data-slot":"alert-dialog-cancel",className:De(e),render:w.jsx(Ht,{variant:t,size:n}),...r})}function Nx({...e}){return w.jsx(SN,{"data-slot":"dialog",...e})}function jee({...e}){return w.jsx(qw,{"data-slot":"dialog-portal",...e})}function zee({className:e,...t}){return w.jsx(Tw,{"data-slot":"dialog-overlay",className:De("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",e),...t})}function Ax({className:e,children:t,showCloseButton:n=!0,...r}){return w.jsxs(jee,{children:[w.jsx(zee,{}),w.jsxs(Bw,{"data-slot":"dialog-content",className:De("bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-sm ring-1 duration-100 sm:max-w-sm fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none",e),...r,children:[t,n&&w.jsxs(wm,{"data-slot":"dialog-close",render:w.jsx(Ht,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[w.jsx(Ko,{}),w.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Dx({className:e,...t}){return w.jsx("div",{"data-slot":"dialog-header",className:De("gap-2 flex flex-col",e),...t})}function dM({className:e,showCloseButton:t=!1,children:n,...r}){return w.jsxs("div",{"data-slot":"dialog-footer",className:De("bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r,children:[n,t&&w.jsx(wm,{render:w.jsx(Ht,{variant:"outline"}),children:"Close"})]})}function _x({className:e,...t}){return w.jsx(Gw,{"data-slot":"dialog-title",className:De("text-base leading-none font-medium",e),...t})}function WD({className:e,...t}){return w.jsx(Rw,{"data-slot":"dialog-description",className:De("text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3",e),...t})}function M0({...e}){return w.jsx(kD,{"data-slot":"dropdown-menu",...e})}function O0({...e}){return w.jsx(gJ,{"data-slot":"dropdown-menu-trigger",...e})}function N0({align:e="start",alignOffset:t=0,side:n="bottom",sideOffset:r=4,backdrop:o=!1,className:a,...l}){return w.jsxs(TD,{children:[o&&w.jsx(rJ,{className:"fixed inset-0 z-50"}),w.jsx(RD,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:n,sideOffset:r,children:w.jsx(SD,{"data-slot":"dropdown-menu-content",className:De("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto outline-none data-closed:overflow-hidden",a),...l})})]})}function cc({className:e,inset:t,variant:n="default",...r}){return w.jsx(wD,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:De("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground gap-1.5 rounded-md px-1.5 py-1 text-sm data-inset:pl-7 [&_svg:not([class*='size-'])]:size-4 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...r})}function Ore({className:e,...t}){return w.jsx(Sw,{"data-slot":"dropdown-menu-separator",className:De("bg-border -mx-1 my-1 h-px",e),...t})}const Fee=(e,t)=>["watch-rules",e,t],XD=e=>["watch-rule-state",e];async function Vc(e,t){try{return(await e.json()).error??t}catch{return t}}async function Bee(e,t){const n=new URLSearchParams({deviceId:e,paneId:t}),r=await fetch(`/api/watch/rules?${n}`);if(!r.ok)throw new Error(await Vc(r,"Failed to load watch rules"));return(await r.json()).rules}async function Uee(e){const t=await fetch("/api/watch/rules",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await Vc(t,"Failed to create watch rule"));return await t.json()}async function QD(e,t){const n=await fetch(`/api/watch/rules/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error(await Vc(n,"Failed to update watch rule"));return await n.json()}async function Hee(e){const t=await fetch(`/api/watch/rules/${e}`,{method:"DELETE"});if(!t.ok)throw new Error(await Vc(t,"Failed to delete watch rule"))}async function ZD(e){const t=await fetch(`/api/watch/rules/${e}/state`);if(!t.ok)throw new Error(await Vc(t,"Failed to load watch rule state"));return await t.json()}async function qee(e){const t=await fetch("/api/watch/assist-regex",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await Vc(t,"Failed to generate regex"));return await t.json()}const Vee=["match","unchanged","llm"],uv="__default__";function fM(e){return e==="llm"?30:5}function $ee({deviceId:e,paneId:t,rule:n,onSaved:r,onCancel:o}){var Ce;const{t:a}=mn(),l=v.useId(),[c,f]=v.useState((n==null?void 0:n.name)??""),[d,m]=v.useState((n==null?void 0:n.triggerType)??"match"),[h,y]=v.useState((n==null?void 0:n.pattern)??""),[g,x]=v.useState((n==null?void 0:n.patternFlags)??""),[E,R]=v.useState((n==null?void 0:n.extractGroup)??0),[T,C]=v.useState((n==null?void 0:n.unchangedMinutes)??10),[k,M]=v.useState((n==null?void 0:n.noMatchBehavior)??"reset"),[D,O]=v.useState((n==null?void 0:n.conditionPrompt)??""),[N,_]=v.useState((n==null?void 0:n.providerId)??null),[q,F]=v.useState((n==null?void 0:n.modelId)??""),[G,P]=v.useState((n==null?void 0:n.confirmWithLlm)??!1),[U,H]=v.useState((n==null?void 0:n.summarizeWithLlm)??!1),[B,j]=v.useState((n==null?void 0:n.intervalSeconds)??30),[z,V]=v.useState((n==null?void 0:n.fireMode)??"once"),[K,L]=v.useState((n==null?void 0:n.cooldownSeconds)??600),[$,W]=v.useState(""),[I,Q]=v.useState(null),oe=((Ce=oi({queryKey:["llm-providers"],queryFn:async()=>{const J=await fetch("/api/llm/providers");if(!J.ok)throw new Error("Failed to load providers");return await J.json()},throwOnError:!1}).data)==null?void 0:Ce.providers)??[],Z=oe.filter(J=>J.enabled),ue=oe.find(J=>J.id===N),ve=(ue==null?void 0:ue.models)??[],Se=d==="match"||d==="unchanged",Pe=d==="llm"||G||U,te=fM(d),he=J=>{m(J);const Ee=fM(J);j(xe=>xe<Ee?J==="llm"?60:30:xe)},ye=()=>{if(!c.trim())return a("watch.validation.nameRequired");if(Se){if(!h)return a("watch.validation.patternRequired");try{new RegExp(h,g.replace(/g/g,""))}catch(J){return a("watch.validation.patternInvalid",{detail:J instanceof Error?J.message:String(J)})}if(d==="unchanged"&&(!T||T<=0))return a("watch.validation.unchangedMinutesInvalid")}else if(!D.trim())return a("watch.validation.conditionPromptRequired");return!Number.isInteger(B)||B<te?a("watch.validation.intervalMin",{min:te}):null},Le=Ed({mutationFn:async()=>{const J={name:c.trim(),triggerType:d,pattern:Se?h:null,patternFlags:Se?g:"",extractGroup:E,conditionPrompt:d==="llm"?D:null,providerId:N,modelId:N&&q.trim()||null,confirmWithLlm:Se?G:!1,summarizeWithLlm:Se?U:!1,intervalSeconds:B,unchangedMinutes:d==="unchanged"?T:null,noMatchBehavior:k,fireMode:z,cooldownSeconds:K};if(n){const xe=J;return await QD(n.id,xe),!1}const Ee={...J,deviceId:e,paneId:t,enabled:!0};return await Uee(Ee),!0},onSuccess:J=>{Bt.success(a(J?"watch.toast.created":"watch.toast.updated")),r(J)},onError:J=>{Bt.error(J instanceof Error?J.message:String(J))}}),Oe=Ed({mutationFn:async()=>qee({description:$.trim(),deviceId:e,paneId:t,providerId:N,modelId:N&&q.trim()||null}),onSuccess:J=>{y(J.pattern),x(J.flags),R(J.extractGroup),Q(J)},onError:J=>{Bt.error(J instanceof Error?J.message:String(J))}}),Te=()=>{const J=ye();if(J){Bt.error(J);return}Le.mutate()};return w.jsxs("form",{"data-testid":"watch-rule-form",className:"space-y-4",onSubmit:J=>{J.preventDefault(),Te()},children:[w.jsxs("div",{className:"space-y-2",children:[w.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-name`,children:a("watch.form.name")}),w.jsx(ji,{id:`${l}-name`,"data-testid":"watch-form-name",value:c,maxLength:120,onChange:J=>f(J.target.value),placeholder:a("watch.form.namePlaceholder")})]}),w.jsxs("div",{className:"space-y-2",children:[w.jsx("span",{className:"block text-sm font-medium",children:a("watch.form.triggerType")}),w.jsx("div",{className:"grid gap-2",children:Vee.map(J=>w.jsxs("button",{type:"button","data-testid":`watch-form-type-${J}`,onClick:()=>he(J),className:De("rounded-lg border px-3 py-2 text-left transition-colors",d===J?"border-primary/50 bg-primary/10":"border-border hover:bg-accent/40"),children:[w.jsx("span",{className:"block text-sm font-medium",children:a(`watch.type.${J}`)}),w.jsx("span",{className:"block text-xs text-muted-foreground",children:a(`watch.typeDesc.${J}`)})]},J))})]}),Se&&w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"space-y-2 rounded-lg border border-dashed border-border p-3",children:[w.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-assist`,children:a("watch.form.assistLabel")}),w.jsxs("div",{className:"flex gap-2",children:[w.jsx(ji,{id:`${l}-assist`,"data-testid":"watch-form-assist-input",value:$,onChange:J=>W(J.target.value),placeholder:a("watch.form.assistPlaceholder")}),w.jsxs(Ht,{type:"button",variant:"secondary","data-testid":"watch-form-assist-generate",disabled:!$.trim()||Oe.isPending,onClick:()=>Oe.mutate(),children:[Oe.isPending?w.jsx(tl,{className:"h-4 w-4 animate-spin"}):w.jsx(MN,{className:"h-4 w-4"}),a("watch.form.assistButton")]})]}),I&&w.jsxs("div",{className:"space-y-1 text-xs","data-testid":"watch-form-assist-result",children:[w.jsxs("p",{className:"text-muted-foreground",children:[w.jsxs("span",{className:"font-medium text-foreground",children:[a("watch.form.assistExplanation"),":"]})," ",I.explanation]}),w.jsxs("p",{className:"font-medium text-foreground",children:[a("watch.form.assistPreview"),":"]}),I.preview.length===0?w.jsx("p",{className:"text-muted-foreground",children:a("watch.form.assistPreviewEmpty")}):w.jsx("ul",{className:"max-h-24 space-y-0.5 overflow-y-auto",children:I.preview.map((J,Ee)=>w.jsx("li",{className:"truncate rounded bg-muted px-1.5 py-0.5 font-mono",children:J},Ee))})]})]}),w.jsxs("div",{className:"grid grid-cols-[1fr_5rem] gap-2",children:[w.jsxs("div",{className:"space-y-2",children:[w.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-pattern`,children:a("watch.form.pattern")}),w.jsx(ji,{id:`${l}-pattern`,"data-testid":"watch-form-pattern",value:h,onChange:J=>y(J.target.value),placeholder:a("watch.form.patternPlaceholder"),className:"font-mono"})]}),w.jsxs("div",{className:"space-y-2",children:[w.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-flags`,children:a("watch.form.flags")}),w.jsx(ji,{id:`${l}-flags`,"data-testid":"watch-form-flags",value:g,onChange:J=>x(J.target.value),placeholder:a("watch.form.flagsPlaceholder"),className:"font-mono"})]})]})]}),d==="unchanged"&&w.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[w.jsxs("div",{className:"space-y-2",children:[w.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-extract-group`,children:a("watch.form.extractGroup")}),w.jsx(ji,{id:`${l}-extract-group`,"data-testid":"watch-form-extract-group",type:"number",min:0,step:1,value:E,onChange:J=>R(Math.max(0,Number(J.target.value)||0))}),w.jsx("p",{className:"text-xs text-muted-foreground",children:a("watch.form.extractGroupHint")})]}),w.jsxs("div",{className:"space-y-2",children:[w.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-unchanged-minutes`,children:a("watch.form.unchangedMinutes")}),w.jsx(ji,{id:`${l}-unchanged-minutes`,"data-testid":"watch-form-unchanged-minutes",type:"number",min:1,step:1,value:T,onChange:J=>C(Math.max(1,Number(J.target.value)||1))})]}),w.jsxs("div",{className:"col-span-2 space-y-2",children:[w.jsx("span",{className:"block text-sm font-medium",children:a("watch.form.noMatchBehavior")}),w.jsxs(yp,{value:k,onValueChange:J=>{(J==="reset"||J==="ignore")&&M(J)},children:[w.jsx(bp,{className:"w-full","data-testid":"watch-form-no-match-behavior",children:w.jsx(ov,{children:a(k==="reset"?"watch.form.noMatchReset":"watch.form.noMatchIgnore")})}),w.jsxs(vp,{children:[w.jsx(Fo,{value:"reset",children:a("watch.form.noMatchReset")}),w.jsx(Fo,{value:"ignore",children:a("watch.form.noMatchIgnore")})]})]})]})]}),d==="llm"&&w.jsxs("div",{className:"space-y-2",children:[w.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-condition`,children:a("watch.form.conditionPrompt")}),w.jsx(Zw,{id:`${l}-condition`,"data-testid":"watch-form-condition-prompt",value:D,onChange:J=>O(J.target.value),placeholder:a("watch.form.conditionPromptPlaceholder"),rows:3})]}),w.jsxs("div",{className:"space-y-2",children:[w.jsx("span",{className:"block text-sm font-medium",children:a("watch.form.model")}),w.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[w.jsxs(yp,{value:N??uv,onValueChange:J=>{if(!J)return;const Ee=J===uv?null:J;_(Ee),Ee===null&&F("")},children:[w.jsx(bp,{className:"w-full","data-testid":"watch-form-provider",children:w.jsx(ov,{children:N?(ue==null?void 0:ue.name)??a("watch.form.providerUnavailable"):a("watch.form.followGlobalDefault")})}),w.jsxs(vp,{children:[w.jsx(Fo,{value:uv,children:a("watch.form.followGlobalDefault")}),N&&!Z.some(J=>J.id===N)&&w.jsx(Fo,{value:N,children:ue?`${ue.name} (${a("watch.form.providerDisabled")})`:a("watch.form.providerUnavailable")}),Z.map(J=>w.jsx(Fo,{value:J.id,children:J.name},J.id))]})]}),w.jsx(ji,{"data-testid":"watch-form-model",list:`${l}-model-options`,value:q,disabled:!N,onChange:J=>F(J.target.value),placeholder:a("watch.form.modelPlaceholder")}),w.jsx("datalist",{id:`${l}-model-options`,children:ve.map(J=>w.jsx("option",{value:J},J))})]}),Pe&&w.jsx("p",{className:"rounded-md bg-primary/10 px-2 py-1.5 text-xs text-primary","data-testid":"watch-form-model-hint",children:a("watch.form.modelRequiredHint")})]}),Se&&w.jsxs("div",{className:"space-y-3",children:[w.jsxs("div",{className:"flex items-center justify-between gap-2",children:[w.jsxs("div",{children:[w.jsx("span",{className:"block text-sm font-medium",children:a("watch.form.confirmWithLlm")}),w.jsx("span",{className:"block text-xs text-muted-foreground",children:a("watch.form.confirmWithLlmDesc")})]}),w.jsx(qp,{checked:G,onCheckedChange:J=>P(!!J),"data-testid":"watch-form-confirm-llm"})]}),w.jsxs("div",{className:"flex items-center justify-between gap-2",children:[w.jsxs("div",{children:[w.jsx("span",{className:"block text-sm font-medium",children:a("watch.form.summarizeWithLlm")}),w.jsx("span",{className:"block text-xs text-muted-foreground",children:a("watch.form.summarizeWithLlmDesc")})]}),w.jsx(qp,{checked:U,onCheckedChange:J=>H(!!J),"data-testid":"watch-form-summarize-llm"})]})]}),w.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[w.jsxs("div",{className:"space-y-2",children:[w.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-interval`,children:a("watch.form.intervalSeconds")}),w.jsx(ji,{id:`${l}-interval`,"data-testid":"watch-form-interval",type:"number",min:te,step:1,value:B,onChange:J=>j(Number(J.target.value)||0)}),w.jsx("p",{className:"text-xs text-muted-foreground",children:a("watch.form.intervalHint",{min:te})})]}),w.jsxs("div",{className:"space-y-2",children:[w.jsx("span",{className:"block text-sm font-medium",children:a("watch.form.fireMode")}),w.jsxs(yp,{value:z,onValueChange:J=>{(J==="once"||J==="repeat")&&V(J)},children:[w.jsx(bp,{className:"w-full","data-testid":"watch-form-fire-mode",children:w.jsx(ov,{children:a(z==="once"?"watch.form.fireOnce":"watch.form.fireRepeat")})}),w.jsxs(vp,{children:[w.jsx(Fo,{value:"once",children:a("watch.form.fireOnce")}),w.jsx(Fo,{value:"repeat",children:a("watch.form.fireRepeat")})]})]}),z==="repeat"&&w.jsx(ji,{"data-testid":"watch-form-cooldown",type:"number",min:0,step:1,value:K,onChange:J=>L(Math.max(0,Number(J.target.value)||0)),"aria-label":a("watch.form.cooldownSeconds"),placeholder:a("watch.form.cooldownSeconds")})]})]}),w.jsxs("div",{className:"flex justify-end gap-2",children:[w.jsx(Ht,{type:"button",variant:"outline",onClick:o,"data-testid":"watch-form-cancel",children:a("common.cancel")}),w.jsxs(Ht,{type:"submit",disabled:Le.isPending,"data-testid":"watch-form-save",children:[Le.isPending&&w.jsx(tl,{className:"h-4 w-4 animate-spin"}),a(n?"watch.form.save":"watch.form.create")]})]})]})}function od(e){if(!e)return null;const t=new Date(e);return Number.isNaN(t.getTime())?null:t.toLocaleString()}function Gee({open:e,onOpenChange:t,deviceId:n,paneId:r}){const{t:o}=mn(),a=Qa(),[l,c]=v.useState({mode:"list"}),[f,d]=v.useState(null),[m,h]=v.useState(!1);v.useEffect(()=>{e||(c({mode:"list"}),d(null),h(!1))},[e]);const y=oi({queryKey:Fee(n,r),queryFn:()=>Bee(n,r),enabled:e,throwOnError:!1}),g=()=>{a.invalidateQueries({queryKey:["watch-rules"]})},x=Ed({mutationFn:async({rule:C,enabled:k})=>{await QD(C.id,{enabled:k})},onSuccess:g,onError:C=>{Bt.error(C instanceof Error?C.message:String(C)),g()}}),E=Ed({mutationFn:async C=>{await Hee(C.id)},onSuccess:()=>{Bt.success(o("watch.toast.deleted")),g()},onError:C=>{Bt.error(C instanceof Error?C.message:String(C))}}),R=C=>{g(),c({mode:"list"}),C&&typeof Notification<"u"&&Notification.permission==="default"&&h(!0)},T=y.data??[];return w.jsxs(w.Fragment,{children:[w.jsx(Nx,{open:e,onOpenChange:t,children:w.jsxs(Ax,{className:"sm:max-w-lg max-h-[85dvh] grid-rows-[auto_minmax(0,1fr)]","data-testid":"watch-dialog",children:[w.jsxs(Dx,{children:[w.jsxs(_x,{children:[l.mode==="list"&&o("watch.title"),l.mode==="form"&&(l.rule?o("watch.form.editTitle"):o("watch.form.createTitle")),l.mode==="state"&&o("watch.state.title")]}),w.jsx(WD,{children:l.mode==="list"?o("watch.dialogDesc"):null})]}),w.jsxs("div",{className:"min-h-0 overflow-y-auto pr-1",children:[l.mode==="list"&&w.jsxs("div",{className:"space-y-3",children:[m&&w.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-primary/30 bg-primary/10 p-3","data-testid":"watch-notif-banner",children:[w.jsx(F8,{className:"mt-0.5 h-4 w-4 shrink-0 text-primary"}),w.jsxs("div",{className:"min-w-0 flex-1",children:[w.jsx("p",{className:"text-sm font-medium",children:o("watch.notifPermission.title")}),w.jsx("p",{className:"text-xs text-muted-foreground",children:o("watch.notifPermission.desc")}),w.jsxs("div",{className:"mt-2 flex gap-2",children:[w.jsx(Ht,{size:"sm","data-testid":"watch-notif-enable",onClick:()=>{Notification.requestPermission().finally(()=>h(!1))},children:o("watch.notifPermission.enable")}),w.jsx(Ht,{size:"sm",variant:"ghost",onClick:()=>h(!1),children:o("watch.notifPermission.dismiss")})]})]})]}),y.isLoading&&w.jsx("div",{className:"flex justify-center py-6",children:w.jsx(tl,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),!y.isLoading&&T.length===0&&w.jsx("p",{className:"py-6 text-center text-sm text-muted-foreground","data-testid":"watch-rules-empty",children:o("watch.rules.empty")}),T.map(C=>w.jsx(Yee,{rule:C,onToggle:k=>x.mutate({rule:C,enabled:k}),onEdit:()=>c({mode:"form",rule:C}),onViewState:()=>c({mode:"state",rule:C}),onDelete:()=>d(C)},C.id)),w.jsxs(Ht,{variant:"outline",className:"w-full","data-testid":"watch-rule-add",onClick:()=>c({mode:"form",rule:null}),children:[w.jsx(Am,{className:"h-4 w-4"}),o("watch.rules.addRule")]})]}),l.mode==="form"&&w.jsx($ee,{deviceId:n,paneId:r,rule:l.rule,onSaved:R,onCancel:()=>c({mode:"list"})}),l.mode==="state"&&w.jsx(Kee,{rule:l.rule,onBack:()=>c({mode:"list"})})]})]})}),w.jsx(Sx,{open:f!==null,onOpenChange:C=>!C&&d(null),children:w.jsxs(Ex,{"data-testid":"watch-rule-delete-dialog",children:[w.jsxs(Tx,{children:[w.jsx(Cx,{children:o("watch.rules.deleteTitle")}),w.jsx(kx,{children:o("watch.rules.deleteDesc",{name:(f==null?void 0:f.name)??""})})]}),w.jsxs(Rx,{children:[w.jsx(Ox,{children:o("common.cancel")}),w.jsx(Mx,{variant:"destructive","data-testid":"watch-rule-delete-confirm",onClick:()=>{f&&E.mutate(f),d(null)},children:o("watch.rules.deleteConfirm")})]})]})})]})}function Yee({rule:e,onToggle:t,onEdit:n,onViewState:r,onDelete:o}){var f,d;const{t:a}=mn(),l=oi({queryKey:XD(e.id),queryFn:()=>ZD(e.id),throwOnError:!1}),c=od((d=(f=l.data)==null?void 0:f.state)==null?void 0:d.lastTriggeredAt);return w.jsxs("div",{className:"rounded-lg border border-border p-3","data-testid":`watch-rule-item-${e.id}`,"data-rule-name":e.name,children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:e.name}),w.jsx(il,{variant:"secondary",children:a(`watch.type.${e.triggerType}`)}),w.jsx(qp,{checked:e.enabled,onCheckedChange:m=>t(!!m),"data-testid":`watch-rule-toggle-${e.id}`})]}),w.jsxs("div",{className:"mt-2 flex items-center justify-between gap-2",children:[w.jsx("span",{className:"truncate text-xs text-muted-foreground",children:c?a("watch.rules.lastTriggered",{time:c}):a("watch.rules.neverTriggered")}),w.jsxs("div",{className:"flex shrink-0 gap-1",children:[w.jsx(Ht,{variant:"ghost",size:"icon-xs",onClick:r,title:a("watch.rules.viewState"),"aria-label":a("watch.rules.viewState"),"data-testid":`watch-rule-state-${e.id}`,children:w.jsx(_8,{className:"h-3.5 w-3.5"})}),w.jsx(Ht,{variant:"ghost",size:"icon-xs",onClick:n,title:a("watch.rules.edit"),"aria-label":a("watch.rules.edit"),"data-testid":`watch-rule-edit-${e.id}`,children:w.jsx(Nm,{className:"h-3.5 w-3.5"})}),w.jsx(Ht,{variant:"ghost",size:"icon-xs",onClick:o,title:a("watch.rules.delete"),"aria-label":a("watch.rules.delete"),"data-testid":`watch-rule-delete-${e.id}`,children:w.jsx(ON,{className:"h-3.5 w-3.5 text-destructive"})})]})]})]})}function Kee({rule:e,onBack:t}){var f,d;const{t:n}=mn(),r=oi({queryKey:XD(e.id),queryFn:()=>ZD(e.id),refetchInterval:5e3,throwOnError:!1}),o=((f=r.data)==null?void 0:f.state)??null,a=((d=r.data)==null?void 0:d.samples)??[],l=n("watch.state.none"),c=[{label:n("watch.state.lastSampledAt"),value:od(o==null?void 0:o.lastSampledAt)??l},{label:n("watch.state.lastValue"),value:(o==null?void 0:o.lastValue)??l},{label:n("watch.state.lastValueChangedAt"),value:od(o==null?void 0:o.lastValueChangedAt)??l},{label:n("watch.state.lastTriggeredAt"),value:od(o==null?void 0:o.lastTriggeredAt)??l},{label:n("watch.state.consecutiveErrors"),value:o?String(o.consecutiveErrors):l},{label:n("watch.state.lastError"),value:(o==null?void 0:o.lastError)??l}];return w.jsxs("div",{className:"space-y-3","data-testid":"watch-rule-state-view",children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx(Ht,{variant:"ghost",size:"icon-sm",onClick:t,"aria-label":n("watch.state.back"),children:w.jsx(j8,{className:"h-4 w-4"})}),w.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:e.name}),w.jsx(il,{variant:"secondary",children:n(`watch.type.${e.triggerType}`)})]}),r.isLoading?w.jsx("div",{className:"flex justify-center py-6",children:w.jsx(tl,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):w.jsxs(w.Fragment,{children:[w.jsx("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 text-sm",children:c.map(m=>w.jsxs("div",{className:"contents",children:[w.jsx("dt",{className:"text-muted-foreground",children:m.label}),w.jsx("dd",{className:"min-w-0 break-all",children:m.value})]},m.label))}),w.jsxs("div",{className:"space-y-1.5",children:[w.jsx("p",{className:"text-sm font-medium",children:n("watch.state.samples")}),a.length===0?w.jsx("p",{className:"text-xs text-muted-foreground",children:n("watch.state.samplesEmpty")}):w.jsx("ul",{className:"max-h-48 space-y-0.5 overflow-y-auto text-xs",children:[...a].reverse().map(m=>w.jsxs("li",{className:"flex items-center gap-2 rounded bg-muted/60 px-2 py-1",children:[w.jsx("span",{className:"shrink-0 font-mono text-muted-foreground",children:od(m.at)??m.at}),w.jsx("span",{className:"min-w-0 flex-1 truncate font-mono",children:m.value??l}),m.hit&&w.jsx(il,{variant:"default",className:"h-4 px-1 text-[10px]",children:n("watch.state.hit")})]},m.at))})]})]})]})}function Wee(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return v.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const Hm=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function $c(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function A0(e){return"nodeType"in e}function $r(e){var t,n;return e?$c(e)?e:A0(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function D0(e){const{Document:t}=$r(e);return e instanceof t}function ff(e){return $c(e)?!1:e instanceof $r(e).HTMLElement}function JD(e){return e instanceof $r(e).SVGElement}function Gc(e){return e?$c(e)?e.document:A0(e)?D0(e)?e:ff(e)||JD(e)?e.ownerDocument:document:document:document}const fo=Hm?v.useLayoutEffect:v.useEffect;function _0(e){const t=v.useRef(e);return fo(()=>{t.current=e}),v.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function Xee(){const e=v.useRef(null),t=v.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=v.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Ld(e,t){t===void 0&&(t=[e]);const n=v.useRef(e);return fo(()=>{n.current!==e&&(n.current=e)},t),n}function hf(e,t){const n=v.useRef();return v.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Jp(e){const t=_0(e),n=v.useRef(null),r=v.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,r]}function Ix(e){const t=v.useRef();return v.useEffect(()=>{t.current=e},[e]),t.current}let dv={};function pf(e,t){return v.useMemo(()=>{if(t)return t;const n=dv[e]==null?0:dv[e]+1;return dv[e]=n,e+"-"+n},[e,t])}function e_(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((a,l)=>{const c=Object.entries(l);for(const[f,d]of c){const m=a[f];m!=null&&(a[f]=m+e*d)}return a},{...t})}}const uc=e_(1),jd=e_(-1);function Qee(e){return"clientX"in e&&"clientY"in e}function I0(e){if(!e)return!1;const{KeyboardEvent:t}=$r(e.target);return t&&e instanceof t}function Zee(e){if(!e)return!1;const{TouchEvent:t}=$r(e.target);return t&&e instanceof t}function Px(e){if(Zee(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Qee(e)?{x:e.clientX,y:e.clientY}:null}const ol=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[ol.Translate.toString(e),ol.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),hM="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Jee(e){return e.matches(hM)?e:e.querySelector(hM)}const ete={display:"none"};function tte(e){let{id:t,value:n}=e;return Fe.createElement("div",{id:t,style:ete},n)}function nte(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Fe.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function rte(){const[e,t]=v.useState("");return{announce:v.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const t_=v.createContext(null);function ite(e){const t=v.useContext(t_);v.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function ote(){const[e]=v.useState(()=>new Set),t=v.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[v.useCallback(r=>{let{type:o,event:a}=r;e.forEach(l=>{var c;return(c=l[o])==null?void 0:c.call(l,a)})},[e]),t]}const ate={draggable:`
|
|
484
|
+
To pick up a draggable item, press the space bar.
|
|
485
|
+
While dragging, use the arrow keys to move the item.
|
|
486
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
487
|
+
`},ste={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function lte(e){let{announcements:t=ste,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=ate}=e;const{announce:a,announcement:l}=rte(),c=pf("DndLiveRegion"),[f,d]=v.useState(!1);if(v.useEffect(()=>{d(!0)},[]),ite(v.useMemo(()=>({onDragStart(h){let{active:y}=h;a(t.onDragStart({active:y}))},onDragMove(h){let{active:y,over:g}=h;t.onDragMove&&a(t.onDragMove({active:y,over:g}))},onDragOver(h){let{active:y,over:g}=h;a(t.onDragOver({active:y,over:g}))},onDragEnd(h){let{active:y,over:g}=h;a(t.onDragEnd({active:y,over:g}))},onDragCancel(h){let{active:y,over:g}=h;a(t.onDragCancel({active:y,over:g}))}}),[a,t])),!f)return null;const m=Fe.createElement(Fe.Fragment,null,Fe.createElement(tte,{id:r,value:o.draggable}),Fe.createElement(nte,{id:c,announcement:l}));return n?yr.createPortal(m,n):m}var tr;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(tr||(tr={}));function em(){}function fv(e,t){return v.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function cte(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return v.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Vi=Object.freeze({x:0,y:0});function n_(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function r_(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function ute(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function pM(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function i_(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function mM(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const P0=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=mM(t,t.left,t.top),a=[];for(const l of r){const{id:c}=l,f=n.get(c);if(f){const d=n_(mM(f),o);a.push({id:c,data:{droppableContainer:l,value:d}})}}return a.sort(r_)},dte=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=pM(t),a=[];for(const l of r){const{id:c}=l,f=n.get(c);if(f){const d=pM(f),m=o.reduce((y,g,x)=>y+n_(d[x],g),0),h=Number((m/4).toFixed(4));a.push({id:c,data:{droppableContainer:l,value:h}})}}return a.sort(r_)};function fte(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),l=o-r,c=a-n;if(r<o&&n<a){const f=t.width*t.height,d=e.width*e.height,m=l*c,h=m/(f+d-m);return Number(h.toFixed(4))}return 0}const hte=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const a of r){const{id:l}=a,c=n.get(l);if(c){const f=fte(c,t);f>0&&o.push({id:l,data:{droppableContainer:a,value:f}})}}return o.sort(ute)};function pte(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function o_(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Vi}function mte(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return o.reduce((l,c)=>({...l,top:l.top+e*c.y,bottom:l.bottom+e*c.y,left:l.left+e*c.x,right:l.right+e*c.x}),{...n})}}const gte=mte(1);function yte(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function bte(e,t,n){const r=yte(t);if(!r)return e;const{scaleX:o,scaleY:a,x:l,y:c}=r,f=e.left-l-(1-o)*parseFloat(n),d=e.top-c-(1-a)*parseFloat(n.slice(n.indexOf(" ")+1)),m=o?e.width/o:e.width,h=a?e.height/a:e.height;return{width:m,height:h,top:d,right:f+m,bottom:d+h,left:f}}const vte={ignoreTransform:!1};function Yc(e,t){t===void 0&&(t=vte);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:m}=$r(e).getComputedStyle(e);d&&(n=bte(n,d,m))}const{top:r,left:o,width:a,height:l,bottom:c,right:f}=n;return{top:r,left:o,width:a,height:l,bottom:c,right:f}}function gM(e){return Yc(e,{ignoreTransform:!0})}function xte(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function wte(e,t){return t===void 0&&(t=$r(e).getComputedStyle(e)),t.position==="fixed"}function Ste(e,t){t===void 0&&(t=$r(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const a=t[o];return typeof a=="string"?n.test(a):!1})}function qm(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(D0(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!ff(o)||JD(o)||n.includes(o))return n;const a=$r(e).getComputedStyle(o);return o!==e&&Ste(o,a)&&n.push(o),wte(o,a)?n:r(o.parentNode)}return e?r(e):n}function a_(e){const[t]=qm(e,1);return t??null}function hv(e){return!Hm||!e?null:$c(e)?e:A0(e)?D0(e)||e===Gc(e).scrollingElement?window:ff(e)?e:null:null}function s_(e){return $c(e)?e.scrollX:e.scrollLeft}function l_(e){return $c(e)?e.scrollY:e.scrollTop}function Lx(e){return{x:s_(e),y:l_(e)}}var sr;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(sr||(sr={}));function c_(e){return!Hm||!e?!1:e===document.scrollingElement}function u_(e){const t={x:0,y:0},n=c_(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,a=e.scrollLeft<=t.x,l=e.scrollTop>=r.y,c=e.scrollLeft>=r.x;return{isTop:o,isLeft:a,isBottom:l,isRight:c,maxScroll:r,minScroll:t}}const Ete={x:.2,y:.2};function Tte(e,t,n,r,o){let{top:a,left:l,right:c,bottom:f}=n;r===void 0&&(r=10),o===void 0&&(o=Ete);const{isTop:d,isBottom:m,isLeft:h,isRight:y}=u_(e),g={x:0,y:0},x={x:0,y:0},E={height:t.height*o.y,width:t.width*o.x};return!d&&a<=t.top+E.height?(g.y=sr.Backward,x.y=r*Math.abs((t.top+E.height-a)/E.height)):!m&&f>=t.bottom-E.height&&(g.y=sr.Forward,x.y=r*Math.abs((t.bottom-E.height-f)/E.height)),!y&&c>=t.right-E.width?(g.x=sr.Forward,x.x=r*Math.abs((t.right-E.width-c)/E.width)):!h&&l<=t.left+E.width&&(g.x=sr.Backward,x.x=r*Math.abs((t.left+E.width-l)/E.width)),{direction:g,speed:x}}function Rte(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:l}=window;return{top:0,left:0,right:a,bottom:l,width:a,height:l}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function d_(e){return e.reduce((t,n)=>uc(t,Lx(n)),Vi)}function Cte(e){return e.reduce((t,n)=>t+s_(n),0)}function kte(e){return e.reduce((t,n)=>t+l_(n),0)}function Mte(e,t){if(t===void 0&&(t=Yc),!e)return;const{top:n,left:r,bottom:o,right:a}=t(e);a_(e)&&(o<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Ote=[["x",["left","right"],Cte],["y",["top","bottom"],kte]];class L0{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=qm(n),o=d_(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,l,c]of Ote)for(const f of l)Object.defineProperty(this,f,{get:()=>{const d=c(r),m=o[a]-d;return this.rect[f]+m},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class vd{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function Nte(e){const{EventTarget:t}=$r(e);return e instanceof t?e:Gc(e)}function pv(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var wi;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(wi||(wi={}));function yM(e){e.preventDefault()}function Ate(e){e.stopPropagation()}var an;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(an||(an={}));const f_={start:[an.Space,an.Enter],cancel:[an.Esc],end:[an.Space,an.Enter,an.Tab]},Dte=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case an.Right:return{...n,x:n.x+25};case an.Left:return{...n,x:n.x-25};case an.Down:return{...n,y:n.y+25};case an.Up:return{...n,y:n.y-25}}};class j0{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new vd(Gc(n)),this.windowListeners=new vd($r(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(wi.Resize,this.handleCancel),this.windowListeners.add(wi.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(wi.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Mte(r),n(Vi)}handleKeyDown(t){if(I0(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:a=f_,coordinateGetter:l=Dte,scrollBehavior:c="smooth"}=o,{code:f}=t;if(a.end.includes(f)){this.handleEnd(t);return}if(a.cancel.includes(f)){this.handleCancel(t);return}const{collisionRect:d}=r.current,m=d?{x:d.left,y:d.top}:Vi;this.referenceCoordinates||(this.referenceCoordinates=m);const h=l(t,{active:n,context:r.current,currentCoordinates:m});if(h){const y=jd(h,m),g={x:0,y:0},{scrollableAncestors:x}=r.current;for(const E of x){const R=t.code,{isTop:T,isRight:C,isLeft:k,isBottom:M,maxScroll:D,minScroll:O}=u_(E),N=Rte(E),_={x:Math.min(R===an.Right?N.right-N.width/2:N.right,Math.max(R===an.Right?N.left:N.left+N.width/2,h.x)),y:Math.min(R===an.Down?N.bottom-N.height/2:N.bottom,Math.max(R===an.Down?N.top:N.top+N.height/2,h.y))},q=R===an.Right&&!C||R===an.Left&&!k,F=R===an.Down&&!M||R===an.Up&&!T;if(q&&_.x!==h.x){const G=E.scrollLeft+y.x,P=R===an.Right&&G<=D.x||R===an.Left&&G>=O.x;if(P&&!y.y){E.scrollTo({left:G,behavior:c});return}P?g.x=E.scrollLeft-G:g.x=R===an.Right?E.scrollLeft-D.x:E.scrollLeft-O.x,g.x&&E.scrollBy({left:-g.x,behavior:c});break}else if(F&&_.y!==h.y){const G=E.scrollTop+y.y,P=R===an.Down&&G<=D.y||R===an.Up&&G>=O.y;if(P&&!y.x){E.scrollTo({top:G,behavior:c});return}P?g.y=E.scrollTop-G:g.y=R===an.Down?E.scrollTop-D.y:E.scrollTop-O.y,g.y&&E.scrollBy({top:-g.y,behavior:c});break}}this.handleMove(t,uc(jd(h,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}j0.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=f_,onActivation:o}=t,{active:a}=n;const{code:l}=e.nativeEvent;if(r.start.includes(l)){const c=a.activatorNode.current;return c&&e.target!==c?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function bM(e){return!!(e&&"distance"in e)}function vM(e){return!!(e&&"delay"in e)}class z0{constructor(t,n,r){var o;r===void 0&&(r=Nte(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:a}=t,{target:l}=a;this.props=t,this.events=n,this.document=Gc(l),this.documentListeners=new vd(this.document),this.listeners=new vd(r),this.windowListeners=new vd($r(l)),this.initialCoordinates=(o=Px(a))!=null?o:Vi,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(wi.Resize,this.handleCancel),this.windowListeners.add(wi.DragStart,yM),this.windowListeners.add(wi.VisibilityChange,this.handleCancel),this.windowListeners.add(wi.ContextMenu,yM),this.documentListeners.add(wi.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(vM(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(bM(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(wi.Click,Ate,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(wi.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:a}=this,{onMove:l,options:{activationConstraint:c}}=a;if(!o)return;const f=(n=Px(t))!=null?n:Vi,d=jd(o,f);if(!r&&c){if(bM(c)){if(c.tolerance!=null&&pv(d,c.tolerance))return this.handleCancel();if(pv(d,c.distance))return this.handleStart()}if(vM(c)&&pv(d,c.tolerance))return this.handleCancel();this.handlePending(c,d);return}t.cancelable&&t.preventDefault(),l(f)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===an.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const _te={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class h_ extends z0{constructor(t){const{event:n}=t,r=Gc(n.target);super(t,_te,r)}}h_.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const Ite={move:{name:"mousemove"},end:{name:"mouseup"}};var jx;(function(e){e[e.RightClick=2]="RightClick"})(jx||(jx={}));class p_ extends z0{constructor(t){super(t,Ite,Gc(t.event.target))}}p_.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===jx.RightClick?!1:(r==null||r({event:n}),!0)}}];const mv={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class m_ extends z0{constructor(t){super(t,mv)}static setup(){return window.addEventListener(mv.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(mv.move.name,t)};function t(){}}}m_.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r==null||r({event:n}),!0)}}];var xd;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(xd||(xd={}));var tm;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(tm||(tm={}));function Pte(e){let{acceleration:t,activator:n=xd.Pointer,canScroll:r,draggingRect:o,enabled:a,interval:l=5,order:c=tm.TreeOrder,pointerCoordinates:f,scrollableAncestors:d,scrollableAncestorRects:m,delta:h,threshold:y}=e;const g=jte({delta:h,disabled:!a}),[x,E]=Xee(),R=v.useRef({x:0,y:0}),T=v.useRef({x:0,y:0}),C=v.useMemo(()=>{switch(n){case xd.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case xd.DraggableRect:return o}},[n,o,f]),k=v.useRef(null),M=v.useCallback(()=>{const O=k.current;if(!O)return;const N=R.current.x*T.current.x,_=R.current.y*T.current.y;O.scrollBy(N,_)},[]),D=v.useMemo(()=>c===tm.TreeOrder?[...d].reverse():d,[c,d]);v.useEffect(()=>{if(!a||!d.length||!C){E();return}for(const O of D){if((r==null?void 0:r(O))===!1)continue;const N=d.indexOf(O),_=m[N];if(!_)continue;const{direction:q,speed:F}=Tte(O,_,C,t,y);for(const G of["x","y"])g[G][q[G]]||(F[G]=0,q[G]=0);if(F.x>0||F.y>0){E(),k.current=O,x(M,l),R.current=F,T.current=q;return}}R.current={x:0,y:0},T.current={x:0,y:0},E()},[t,M,r,E,a,l,JSON.stringify(C),JSON.stringify(g),x,d,D,m,JSON.stringify(y)])}const Lte={x:{[sr.Backward]:!1,[sr.Forward]:!1},y:{[sr.Backward]:!1,[sr.Forward]:!1}};function jte(e){let{delta:t,disabled:n}=e;const r=Ix(t);return hf(o=>{if(n||!r||!o)return Lte;const a={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[sr.Backward]:o.x[sr.Backward]||a.x===-1,[sr.Forward]:o.x[sr.Forward]||a.x===1},y:{[sr.Backward]:o.y[sr.Backward]||a.y===-1,[sr.Forward]:o.y[sr.Forward]||a.y===1}}},[n,t,r])}function zte(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return hf(o=>{var a;return t==null?null:(a=r??o)!=null?a:null},[r,t])}function Fte(e,t){return v.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,a=o.activators.map(l=>({eventName:l.eventName,handler:t(l.handler,r)}));return[...n,...a]},[]),[e,t])}var zd;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(zd||(zd={}));var zx;(function(e){e.Optimized="optimized"})(zx||(zx={}));const xM=new Map;function Bte(e,t){let{dragging:n,dependencies:r,config:o}=t;const[a,l]=v.useState(null),{frequency:c,measure:f,strategy:d}=o,m=v.useRef(e),h=R(),y=Ld(h),g=v.useCallback(function(T){T===void 0&&(T=[]),!y.current&&l(C=>C===null?T:C.concat(T.filter(k=>!C.includes(k))))},[y]),x=v.useRef(null),E=hf(T=>{if(h&&!n)return xM;if(!T||T===xM||m.current!==e||a!=null){const C=new Map;for(let k of e){if(!k)continue;if(a&&a.length>0&&!a.includes(k.id)&&k.rect.current){C.set(k.id,k.rect.current);continue}const M=k.node.current,D=M?new L0(f(M),M):null;k.rect.current=D,D&&C.set(k.id,D)}return C}return T},[e,a,n,h,f]);return v.useEffect(()=>{m.current=e},[e]),v.useEffect(()=>{h||g()},[n,h]),v.useEffect(()=>{a&&a.length>0&&l(null)},[JSON.stringify(a)]),v.useEffect(()=>{h||typeof c!="number"||x.current!==null||(x.current=setTimeout(()=>{g(),x.current=null},c))},[c,h,g,...r]),{droppableRects:E,measureDroppableContainers:g,measuringScheduled:a!=null};function R(){switch(d){case zd.Always:return!1;case zd.BeforeDragging:return n;default:return!n}}}function g_(e,t){return hf(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Ute(e,t){return g_(e,t)}function Hte(e){let{callback:t,disabled:n}=e;const r=_0(t),o=v.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(r)},[r,n]);return v.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Vm(e){let{callback:t,disabled:n}=e;const r=_0(t),o=v.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(r)},[n]);return v.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function qte(e){return new L0(Yc(e),e)}function wM(e,t,n){t===void 0&&(t=qte);const[r,o]=v.useState(null);function a(){o(f=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=f??n)!=null?d:null}const m=t(e);return JSON.stringify(f)===JSON.stringify(m)?f:m})}const l=Hte({callback(f){if(e)for(const d of f){const{type:m,target:h}=d;if(m==="childList"&&h instanceof HTMLElement&&h.contains(e)){a();break}}}}),c=Vm({callback:a});return fo(()=>{a(),e?(c==null||c.observe(e),l==null||l.observe(document.body,{childList:!0,subtree:!0})):(c==null||c.disconnect(),l==null||l.disconnect())},[e]),r}function Vte(e){const t=g_(e);return o_(e,t)}const SM=[];function $te(e){const t=v.useRef(e),n=hf(r=>e?r&&r!==SM&&e&&t.current&&e.parentNode===t.current.parentNode?r:qm(e):SM,[e]);return v.useEffect(()=>{t.current=e},[e]),n}function Gte(e){const[t,n]=v.useState(null),r=v.useRef(e),o=v.useCallback(a=>{const l=hv(a.target);l&&n(c=>c?(c.set(l,Lx(l)),new Map(c)):null)},[]);return v.useEffect(()=>{const a=r.current;if(e!==a){l(a);const c=e.map(f=>{const d=hv(f);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,Lx(d)]):null}).filter(f=>f!=null);n(c.length?new Map(c):null),r.current=e}return()=>{l(e),l(a)};function l(c){c.forEach(f=>{const d=hv(f);d==null||d.removeEventListener("scroll",o)})}},[o,e]),v.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,l)=>uc(a,l),Vi):d_(e):Vi,[e,t])}function EM(e,t){t===void 0&&(t=[]);const n=v.useRef(null);return v.useEffect(()=>{n.current=null},t),v.useEffect(()=>{const r=e!==Vi;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?jd(e,n.current):Vi}function Yte(e){v.useEffect(()=>{if(!Hm)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function Kte(e,t){return v.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:a}=r;return n[o]=l=>{a(l,t)},n},{}),[e,t])}function y_(e){return v.useMemo(()=>e?xte(e):null,[e])}const TM=[];function Wte(e,t){t===void 0&&(t=Yc);const[n]=e,r=y_(n?$r(n):null),[o,a]=v.useState(TM);function l(){a(()=>e.length?e.map(f=>c_(f)?r:new L0(t(f),f)):TM)}const c=Vm({callback:l});return fo(()=>{c==null||c.disconnect(),l(),e.forEach(f=>c==null?void 0:c.observe(f))},[e]),o}function Xte(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ff(t)?t:e}function Qte(e){let{measure:t}=e;const[n,r]=v.useState(null),o=v.useCallback(d=>{for(const{target:m}of d)if(ff(m)){r(h=>{const y=t(m);return h?{...h,width:y.width,height:y.height}:y});break}},[t]),a=Vm({callback:o}),l=v.useCallback(d=>{const m=Xte(d);a==null||a.disconnect(),m&&(a==null||a.observe(m)),r(m?t(m):null)},[t,a]),[c,f]=Jp(l);return v.useMemo(()=>({nodeRef:c,rect:n,setRef:f}),[n,c,f])}const Zte=[{sensor:h_,options:{}},{sensor:j0,options:{}}],Jte={current:{}},Sp={draggable:{measure:gM},droppable:{measure:gM,strategy:zd.WhileDragging,frequency:zx.Optimized},dragOverlay:{measure:Yc}};class wd extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const ene={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new wd,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:em},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Sp,measureDroppableContainers:em,windowRect:null,measuringScheduled:!1},tne={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:em,draggableNodes:new Map,over:null,measureDroppableContainers:em},$m=v.createContext(tne),b_=v.createContext(ene);function nne(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new wd}}}function rne(e,t){switch(t.type){case tr.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case tr.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case tr.DragEnd:case tr.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case tr.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new wd(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case tr.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;const l=new wd(e.droppable.containers);return l.set(n,{...a,disabled:o}),{...e,droppable:{...e.droppable,containers:l}}}case tr.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const a=new wd(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function ine(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=v.useContext($m),a=Ix(r),l=Ix(n==null?void 0:n.id);return v.useEffect(()=>{if(!t&&!r&&a&&l!=null){if(!I0(a)||document.activeElement===a.target)return;const c=o.get(l);if(!c)return;const{activatorNode:f,node:d}=c;if(!f.current&&!d.current)return;requestAnimationFrame(()=>{for(const m of[f.current,d.current]){if(!m)continue;const h=Jee(m);if(h){h.focus();break}}})}},[r,t,o,l,a]),null}function one(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,a)=>a({transform:o,...r}),n):n}function ane(e){return v.useMemo(()=>({draggable:{...Sp.draggable,...e==null?void 0:e.draggable},droppable:{...Sp.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Sp.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function sne(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const a=v.useRef(!1),{x:l,y:c}=typeof o=="boolean"?{x:o,y:o}:o;fo(()=>{if(!l&&!c||!t){a.current=!1;return}if(a.current||!r)return;const d=t==null?void 0:t.node.current;if(!d||d.isConnected===!1)return;const m=n(d),h=o_(m,r);if(l||(h.x=0),c||(h.y=0),a.current=!0,Math.abs(h.x)>0||Math.abs(h.y)>0){const y=a_(d);y&&y.scrollBy({top:h.y,left:h.x})}},[t,l,c,r,n])}const v_=v.createContext({...Vi,scaleX:1,scaleY:1});var Ma;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ma||(Ma={}));const F0=v.memo(function(t){var n,r,o,a;let{id:l,accessibility:c,autoScroll:f=!0,children:d,sensors:m=Zte,collisionDetection:h=hte,measuring:y,modifiers:g,...x}=t;const E=v.useReducer(rne,void 0,nne),[R,T]=E,[C,k]=ote(),[M,D]=v.useState(Ma.Uninitialized),O=M===Ma.Initialized,{draggable:{active:N,nodes:_,translate:q},droppable:{containers:F}}=R,G=N!=null?_.get(N):null,P=v.useRef({initial:null,translated:null}),U=v.useMemo(()=>{var ft;return N!=null?{id:N,data:(ft=G==null?void 0:G.data)!=null?ft:Jte,rect:P}:null},[N,G]),H=v.useRef(null),[B,j]=v.useState(null),[z,V]=v.useState(null),K=Ld(x,Object.values(x)),L=pf("DndDescribedBy",l),$=v.useMemo(()=>F.getEnabled(),[F]),W=ane(y),{droppableRects:I,measureDroppableContainers:Q,measuringScheduled:le}=Bte($,{dragging:O,dependencies:[q.x,q.y],config:W.droppable}),oe=zte(_,N),Z=v.useMemo(()=>z?Px(z):null,[z]),ue=ot(),ve=Ute(oe,W.draggable.measure);sne({activeNode:N!=null?_.get(N):null,config:ue.layoutShiftCompensation,initialRect:ve,measure:W.draggable.measure});const Se=wM(oe,W.draggable.measure,ve),Pe=wM(oe?oe.parentElement:null),te=v.useRef({activatorEvent:null,active:null,activeNode:oe,collisionRect:null,collisions:null,droppableRects:I,draggableNodes:_,draggingNode:null,draggingNodeRect:null,droppableContainers:F,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),he=F.getNodeFor((n=te.current.over)==null?void 0:n.id),ye=Qte({measure:W.dragOverlay.measure}),Le=(r=ye.nodeRef.current)!=null?r:oe,Oe=O?(o=ye.rect)!=null?o:Se:null,Te=!!(ye.nodeRef.current&&ye.rect),Ce=Vte(Te?null:Se),J=y_(Le?$r(Le):null),Ee=$te(O?he??oe:null),xe=Wte(Ee),Be=one(g,{transform:{x:q.x-Ce.x,y:q.y-Ce.y,scaleX:1,scaleY:1},activatorEvent:z,active:U,activeNodeRect:Se,containerNodeRect:Pe,draggingNodeRect:Oe,over:te.current.over,overlayNodeRect:ye.rect,scrollableAncestors:Ee,scrollableAncestorRects:xe,windowRect:J}),Ve=Z?uc(Z,q):null,_e=Gte(Ee),ut=EM(_e),pe=EM(_e,[Se]),Re=uc(Be,ut),ee=Oe?gte(Oe,Be):null,fe=U&&ee?h({active:U,collisionRect:ee,droppableRects:I,droppableContainers:$,pointerCoordinates:Ve}):null,Ne=i_(fe,"id"),[Ue,$e]=v.useState(null),et=Te?Be:uc(Be,pe),ze=pte(et,(a=Ue==null?void 0:Ue.rect)!=null?a:null,Se),Ze=v.useRef(null),nt=v.useCallback((ft,vt)=>{let{sensor:Ke,options:Mt}=vt;if(H.current==null)return;const Lt=_.get(H.current);if(!Lt)return;const kt=ft.nativeEvent,hn=new Ke({active:H.current,activeNode:Lt,event:kt,options:Mt,context:te,onAbort(Je){if(!_.get(Je))return;const{onDragAbort:X}=K.current,ie={id:Je};X==null||X(ie),C({type:"onDragAbort",event:ie})},onPending(Je,Ot,X,ie){if(!_.get(Je))return;const{onDragPending:ke}=K.current,je={id:Je,constraint:Ot,initialCoordinates:X,offset:ie};ke==null||ke(je),C({type:"onDragPending",event:je})},onStart(Je){const Ot=H.current;if(Ot==null)return;const X=_.get(Ot);if(!X)return;const{onDragStart:ie}=K.current,de={activatorEvent:kt,active:{id:Ot,data:X.data,rect:P}};yr.unstable_batchedUpdates(()=>{ie==null||ie(de),D(Ma.Initializing),T({type:tr.DragStart,initialCoordinates:Je,active:Ot}),C({type:"onDragStart",event:de}),j(Ze.current),V(kt)})},onMove(Je){T({type:tr.DragMove,coordinates:Je})},onEnd:qt(tr.DragEnd),onCancel:qt(tr.DragCancel)});Ze.current=hn;function qt(Je){return async function(){const{active:X,collisions:ie,over:de,scrollAdjustedTranslate:ke}=te.current;let je=null;if(X&&ke){const{cancelDrop:it}=K.current;je={activatorEvent:kt,active:X,collisions:ie,delta:ke,over:de},Je===tr.DragEnd&&typeof it=="function"&&await Promise.resolve(it(je))&&(Je=tr.DragCancel)}H.current=null,yr.unstable_batchedUpdates(()=>{T({type:Je}),D(Ma.Uninitialized),$e(null),j(null),V(null),Ze.current=null;const it=Je===tr.DragEnd?"onDragEnd":"onDragCancel";if(je){const rt=K.current[it];rt==null||rt(je),C({type:it,event:je})}})}}},[_]),Ct=v.useCallback((ft,vt)=>(Ke,Mt)=>{const Lt=Ke.nativeEvent,kt=_.get(Mt);if(H.current!==null||!kt||Lt.dndKit||Lt.defaultPrevented)return;const hn={active:kt};ft(Ke,vt.options,hn)===!0&&(Lt.dndKit={capturedBy:vt.sensor},H.current=Mt,nt(Ke,vt))},[_,nt]),zt=Fte(m,Ct);Yte(m),fo(()=>{Se&&M===Ma.Initializing&&D(Ma.Initialized)},[Se,M]),v.useEffect(()=>{const{onDragMove:ft}=K.current,{active:vt,activatorEvent:Ke,collisions:Mt,over:Lt}=te.current;if(!vt||!Ke)return;const kt={active:vt,activatorEvent:Ke,collisions:Mt,delta:{x:Re.x,y:Re.y},over:Lt};yr.unstable_batchedUpdates(()=>{ft==null||ft(kt),C({type:"onDragMove",event:kt})})},[Re.x,Re.y]),v.useEffect(()=>{const{active:ft,activatorEvent:vt,collisions:Ke,droppableContainers:Mt,scrollAdjustedTranslate:Lt}=te.current;if(!ft||H.current==null||!vt||!Lt)return;const{onDragOver:kt}=K.current,hn=Mt.get(Ne),qt=hn&&hn.rect.current?{id:hn.id,rect:hn.rect.current,data:hn.data,disabled:hn.disabled}:null,Je={active:ft,activatorEvent:vt,collisions:Ke,delta:{x:Lt.x,y:Lt.y},over:qt};yr.unstable_batchedUpdates(()=>{$e(qt),kt==null||kt(Je),C({type:"onDragOver",event:Je})})},[Ne]),fo(()=>{te.current={activatorEvent:z,active:U,activeNode:oe,collisionRect:ee,collisions:fe,droppableRects:I,draggableNodes:_,draggingNode:Le,draggingNodeRect:Oe,droppableContainers:F,over:Ue,scrollableAncestors:Ee,scrollAdjustedTranslate:Re},P.current={initial:Oe,translated:ee}},[U,oe,fe,ee,_,Le,Oe,I,F,Ue,Ee,Re]),Pte({...ue,delta:q,draggingRect:ee,pointerCoordinates:Ve,scrollableAncestors:Ee,scrollableAncestorRects:xe});const bt=v.useMemo(()=>({active:U,activeNode:oe,activeNodeRect:Se,activatorEvent:z,collisions:fe,containerNodeRect:Pe,dragOverlay:ye,draggableNodes:_,droppableContainers:F,droppableRects:I,over:Ue,measureDroppableContainers:Q,scrollableAncestors:Ee,scrollableAncestorRects:xe,measuringConfiguration:W,measuringScheduled:le,windowRect:J}),[U,oe,Se,z,fe,Pe,ye,_,F,I,Ue,Q,Ee,xe,W,le,J]),Dt=v.useMemo(()=>({activatorEvent:z,activators:zt,active:U,activeNodeRect:Se,ariaDescribedById:{draggable:L},dispatch:T,draggableNodes:_,over:Ue,measureDroppableContainers:Q}),[z,zt,U,Se,T,L,_,Ue,Q]);return Fe.createElement(t_.Provider,{value:k},Fe.createElement($m.Provider,{value:Dt},Fe.createElement(b_.Provider,{value:bt},Fe.createElement(v_.Provider,{value:ze},d)),Fe.createElement(ine,{disabled:(c==null?void 0:c.restoreFocus)===!1})),Fe.createElement(lte,{...c,hiddenTextDescribedById:L}));function ot(){const ft=(B==null?void 0:B.autoScrollEnabled)===!1,vt=typeof f=="object"?f.enabled===!1:f===!1,Ke=O&&!ft&&!vt;return typeof f=="object"?{...f,enabled:Ke}:{enabled:Ke}}}),lne=v.createContext(null),RM="button",cne="Draggable";function une(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const a=pf(cne),{activators:l,activatorEvent:c,active:f,activeNodeRect:d,ariaDescribedById:m,draggableNodes:h,over:y}=v.useContext($m),{role:g=RM,roleDescription:x="draggable",tabIndex:E=0}=o??{},R=(f==null?void 0:f.id)===t,T=v.useContext(R?v_:lne),[C,k]=Jp(),[M,D]=Jp(),O=Kte(l,t),N=Ld(n);fo(()=>(h.set(t,{id:t,key:a,node:C,activatorNode:M,data:N}),()=>{const q=h.get(t);q&&q.key===a&&h.delete(t)}),[h,t]);const _=v.useMemo(()=>({role:g,tabIndex:E,"aria-disabled":r,"aria-pressed":R&&g===RM?!0:void 0,"aria-roledescription":x,"aria-describedby":m.draggable}),[r,g,E,R,x,m.draggable]);return{active:f,activatorEvent:c,activeNodeRect:d,attributes:_,isDragging:R,listeners:r?void 0:O,node:C,over:y,setNodeRef:k,setActivatorNodeRef:D,transform:T}}function dne(){return v.useContext(b_)}const fne="Droppable",hne={timeout:25};function pne(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const a=pf(fne),{active:l,dispatch:c,over:f,measureDroppableContainers:d}=v.useContext($m),m=v.useRef({disabled:n}),h=v.useRef(!1),y=v.useRef(null),g=v.useRef(null),{disabled:x,updateMeasurementsFor:E,timeout:R}={...hne,...o},T=Ld(E??r),C=v.useCallback(()=>{if(!h.current){h.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{d(Array.isArray(T.current)?T.current:[T.current]),g.current=null},R)},[R]),k=Vm({callback:C,disabled:x||!l}),M=v.useCallback((_,q)=>{k&&(q&&(k.unobserve(q),h.current=!1),_&&k.observe(_))},[k]),[D,O]=Jp(M),N=Ld(t);return v.useEffect(()=>{!k||!D.current||(k.disconnect(),h.current=!1,k.observe(D.current))},[D,k]),v.useEffect(()=>(c({type:tr.RegisterDroppable,element:{id:r,key:a,disabled:n,node:D,rect:y,data:N}}),()=>c({type:tr.UnregisterDroppable,key:a,id:r})),[r]),v.useEffect(()=>{n!==m.current.disabled&&(c({type:tr.SetDroppableDisabled,id:r,key:a,disabled:n}),m.current.disabled=n)},[r,a,n,c]),{active:l,rect:y,isOver:(f==null?void 0:f.id)===r,node:D,over:f,setNodeRef:O}}function mf(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function mne(e,t){return e.reduce((n,r,o)=>{const a=t.get(r);return a&&(n[o]=a),n},Array(e.length))}function tp(e){return e!==null&&e>=0}function gne(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function yne(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const x_=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const a=mf(t,r,n),l=t[o],c=a[o];return!c||!l?null:{x:c.left-l.left,y:c.top-l.top,scaleX:c.width/l.width,scaleY:c.height/l.height}},np={scaleX:1,scaleY:1},B0=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:a,overIndex:l}=e;const c=(t=a[n])!=null?t:r;if(!c)return null;if(o===n){const d=a[l];return d?{x:0,y:n<l?d.top+d.height-(c.top+c.height):d.top-c.top,...np}:null}const f=bne(a,o,n);return o>n&&o<=l?{x:0,y:-c.height-f,...np}:o<n&&o>=l?{x:0,y:c.height+f,...np}:{x:0,y:0,...np}};function bne(e,t,n){const r=e[t],o=e[t-1],a=e[t+1];return r?n<t?o?r.top-(o.top+o.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const w_="Sortable",S_=Fe.createContext({activeIndex:-1,containerId:w_,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:x_,disabled:{draggable:!1,droppable:!1}});function U0(e){let{children:t,id:n,items:r,strategy:o=x_,disabled:a=!1}=e;const{active:l,dragOverlay:c,droppableRects:f,over:d,measureDroppableContainers:m}=dne(),h=pf(w_,n),y=c.rect!==null,g=v.useMemo(()=>r.map(O=>typeof O=="object"&&"id"in O?O.id:O),[r]),x=l!=null,E=l?g.indexOf(l.id):-1,R=d?g.indexOf(d.id):-1,T=v.useRef(g),C=!gne(g,T.current),k=R!==-1&&E===-1||C,M=yne(a);fo(()=>{C&&x&&m(g)},[C,g,x,m]),v.useEffect(()=>{T.current=g},[g]);const D=v.useMemo(()=>({activeIndex:E,containerId:h,disabled:M,disableTransforms:k,items:g,overIndex:R,useDragOverlay:y,sortedRects:mne(g,f),strategy:o}),[E,h,M.draggable,M.droppable,k,g,R,f,y,o]);return Fe.createElement(S_.Provider,{value:D},t)}const vne=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return mf(n,r,o).indexOf(t)},xne=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:a,newIndex:l,previousItems:c,previousContainerId:f,transition:d}=e;return!d||!r||c!==a&&o===l?!1:n?!0:l!==o&&t===f},wne={duration:200,easing:"ease"},E_="transform",Sne=ol.Transition.toString({property:E_,duration:0,easing:"linear"}),Ene={roleDescription:"sortable"};function Tne(e){let{disabled:t,index:n,node:r,rect:o}=e;const[a,l]=v.useState(null),c=v.useRef(n);return fo(()=>{if(!t&&n!==c.current&&r.current){const f=o.current;if(f){const d=Yc(r.current,{ignoreTransform:!0}),m={x:f.left-d.left,y:f.top-d.top,scaleX:f.width/d.width,scaleY:f.height/d.height};(m.x||m.y)&&l(m)}}n!==c.current&&(c.current=n)},[t,n,r,o]),v.useEffect(()=>{a&&l(null)},[a]),a}function H0(e){let{animateLayoutChanges:t=xne,attributes:n,disabled:r,data:o,getNewIndex:a=vne,id:l,strategy:c,resizeObserverConfig:f,transition:d=wne}=e;const{items:m,containerId:h,activeIndex:y,disabled:g,disableTransforms:x,sortedRects:E,overIndex:R,useDragOverlay:T,strategy:C}=v.useContext(S_),k=Rne(r,g),M=m.indexOf(l),D=v.useMemo(()=>({sortable:{containerId:h,index:M,items:m},...o}),[h,o,M,m]),O=v.useMemo(()=>m.slice(m.indexOf(l)),[m,l]),{rect:N,node:_,isOver:q,setNodeRef:F}=pne({id:l,data:D,disabled:k.droppable,resizeObserverConfig:{updateMeasurementsFor:O,...f}}),{active:G,activatorEvent:P,activeNodeRect:U,attributes:H,setNodeRef:B,listeners:j,isDragging:z,over:V,setActivatorNodeRef:K,transform:L}=une({id:l,data:D,attributes:{...Ene,...n},disabled:k.draggable}),$=Wee(F,B),W=!!G,I=W&&!x&&tp(y)&&tp(R),Q=!T&&z,le=Q&&I?L:null,Z=I?le??(c??C)({rects:E,activeNodeRect:U,activeIndex:y,overIndex:R,index:M}):null,ue=tp(y)&&tp(R)?a({id:l,items:m,activeIndex:y,overIndex:R}):M,ve=G==null?void 0:G.id,Se=v.useRef({activeId:ve,items:m,newIndex:ue,containerId:h}),Pe=m!==Se.current.items,te=t({active:G,containerId:h,isDragging:z,isSorting:W,id:l,index:M,items:m,newIndex:Se.current.newIndex,previousItems:Se.current.items,previousContainerId:Se.current.containerId,transition:d,wasDragging:Se.current.activeId!=null}),he=Tne({disabled:!te,index:M,node:_,rect:N});return v.useEffect(()=>{W&&Se.current.newIndex!==ue&&(Se.current.newIndex=ue),h!==Se.current.containerId&&(Se.current.containerId=h),m!==Se.current.items&&(Se.current.items=m)},[W,ue,h,m]),v.useEffect(()=>{if(ve===Se.current.activeId)return;if(ve!=null&&Se.current.activeId==null){Se.current.activeId=ve;return}const Le=setTimeout(()=>{Se.current.activeId=ve},50);return()=>clearTimeout(Le)},[ve]),{active:G,activeIndex:y,attributes:H,data:D,rect:N,index:M,newIndex:ue,items:m,isOver:q,isSorting:W,isDragging:z,listeners:j,node:_,overIndex:R,over:V,setNodeRef:$,setActivatorNodeRef:K,setDroppableNodeRef:F,setDraggableNodeRef:B,transform:he??Z,transition:ye()};function ye(){if(he||Pe&&Se.current.newIndex===M)return Sne;if(!(Q&&!I0(P)||!d)&&(W||te))return ol.Transition.toString({...d,property:E_})}}function Rne(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}function nm(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const Cne=[an.Down,an.Right,an.Up,an.Left],kne=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:a,over:l,scrollableAncestors:c}}=t;if(Cne.includes(e.code)){if(e.preventDefault(),!n||!r)return;const f=[];a.getEnabled().forEach(h=>{if(!h||h!=null&&h.disabled)return;const y=o.get(h.id);if(y)switch(e.code){case an.Down:r.top<y.top&&f.push(h);break;case an.Up:r.top>y.top&&f.push(h);break;case an.Left:r.left>y.left&&f.push(h);break;case an.Right:r.left<y.left&&f.push(h);break}});const d=dte({collisionRect:r,droppableRects:o,droppableContainers:f});let m=i_(d,"id");if(m===(l==null?void 0:l.id)&&d.length>1&&(m=d[1].id),m!=null){const h=a.get(n.id),y=a.get(m),g=y?o.get(y.id):null,x=y==null?void 0:y.node.current;if(x&&g&&h&&y){const R=qm(x).some((O,N)=>c[N]!==O),T=T_(h,y),C=Mne(h,y),k=R||!T?{x:0,y:0}:{x:C?r.width-g.width:0,y:C?r.height-g.height:0},M={x:g.left,y:g.top};return k.x&&k.y?M:jd(M,k)}}}};function T_(e,t){return!nm(e)||!nm(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Mne(e,t){return!nm(e)||!nm(t)||!T_(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function R_({status:e}){return w.jsx("span",{className:De("size-2 shrink-0 rounded-full",e==="running"?"bg-emerald-500 animate-pulse":e==="error"?"bg-destructive":e==="waiting_confirmation"?"bg-amber-500":"bg-muted-foreground/40")})}function q0(){return cte(fv(p_,{activationConstraint:{distance:8}}),fv(m_,{activationConstraint:{delay:250,tolerance:5}}),fv(j0,{coordinateGetter:kne}))}function One(){const{t:e}=mn(),t=Gi(),n=Kd(),{isMobile:r,setOpenMobile:o}=qr(),{toggleDevice:a}=aV(),l=sn(ee=>ee.sessions),c=sn(ee=>ee.activeSessionId),f=Mi(ee=>ee.setSidebarTab);v.useEffect(()=>{const ee=sn.getState();ee.ensureInitialized(),ee.loadSessions()},[]);const d=Ws("/devices/:deviceId/windows/:windowId/panes/:paneId",t.pathname),m=d==null?void 0:d.params.deviceId,h=d==null?void 0:d.params.windowId,y=d==null?void 0:d.params.paneId,g=Mn(ee=>ee.snapshots),x=Mn(ee=>ee.connectedDevices),E=Mn(ee=>ee.closeWindow),R=Mn(ee=>ee.closePane),T=Mn(ee=>ee.renameWindow),C=nl(ee=>{var fe;return((fe=ee.settings)==null?void 0:fe.language)??"en_US"}),{data:k}=oi({queryKey:["devices"],queryFn:async()=>{const ee=await fetch("/api/devices");if(!ee.ok)throw new Error("Failed to fetch devices");return ee.json()},throwOnError:!1}),M=Mn(ee=>ee.hydrateDeviceErrors);v.useEffect(()=>{k!=null&&k.devices&&M(k.devices.map(ee=>({deviceId:ee.id,lastError:ee.lastError??null,lastErrorType:ee.lastErrorType??null})))},[k,M]);const D=v.useCallback((ee,fe)=>{n(ee,{replace:(fe==null?void 0:fe.replace)??!0}),r&&!(fe!=null&&fe.keepSidebarOpen)&&o(!1)},[n,r,o]),O=v.useCallback((ee,fe,Ne,Ue)=>{F.current=null,window.dispatchEvent(new CustomEvent("tmex:user-initiated-selection",{detail:{deviceId:ee,windowId:fe,paneId:Ne}})),D(`/devices/${ee}/windows/${fe}/panes/${k0(Ne)}`,{keepSidebarOpen:Ue==null?void 0:Ue.keepSidebarOpen})},[D]),N=v.useCallback(ee=>{var fe,Ne;if(sn.getState().setActiveSession(ee.id),f("agent"),ee.deviceId&&ee.paneId){const Ue=(Ne=(fe=Mn.getState().snapshots[ee.deviceId])==null?void 0:fe.session)==null?void 0:Ne.windows,$e=Ue==null?void 0:Ue.find(et=>et.panes.some(ze=>ze.id===ee.paneId));$e&&O(ee.deviceId,$e.id,ee.paneId,{keepSidebarOpen:!0})}},[f,O]),_=v.useCallback((ee,fe,Ne)=>{O(ee,fe,Ne.id,{keepSidebarOpen:!0}),sn.getState().startDraft(ee,Ne.id,Ne.title??null),f("agent")},[O,f]),q=Mn(ee=>ee.selectWindow),F=v.useRef(null);v.useEffect(()=>{var Ze,nt;const ee=F.current;if(!ee)return;if(Date.now()-ee.at>5e3){F.current=null;return}const{deviceId:fe,windowId:Ne}=ee,Ue=g[fe],$e=(Ze=Ue==null?void 0:Ue.session)==null?void 0:Ze.windows;if(!$e)return;const et=$e.find(Ct=>Ct.id===Ne);if(!((nt=et==null?void 0:et.panes)!=null&&nt.length))return;F.current=null;const ze=et.panes.find(Ct=>Ct.active)??et.panes[0];O(fe,Ne,ze.id)},[g,O]);const G=v.useCallback((ee,fe,Ne)=>{q(ee,fe);const Ue=Ne.find($e=>$e.active)??Ne[0];Ue?(O(ee,fe,Ue.id),F.current=null):F.current={deviceId:ee,windowId:fe,at:Date.now()}},[O,q]),P=v.useCallback((ee,fe)=>{fe?ee===m&&D("/devices"):D(`/devices/${ee}`),a(ee,fe)},[a,m,D]),U=v.useCallback((ee,fe)=>{ee===m&&fe===h&&D("/devices"),E(ee,fe)},[E,m,h,D]),[H,B]=v.useState(null),j=v.useCallback((ee,fe)=>{var $e,et;const Ne=(et=($e=Mn.getState().snapshots[ee])==null?void 0:$e.session)==null?void 0:et.windows,Ue=Ne==null?void 0:Ne.find(ze=>ze.id===fe);B({kind:"window",deviceId:ee,windowId:fe,name:Ue?wV(Ue):""})},[]),z=v.useCallback((ee,fe,Ne)=>{var et,ze,Ze,nt;const Ue=(ze=(et=Mn.getState().snapshots[ee])==null?void 0:et.session)==null?void 0:ze.windows,$e=(nt=(Ze=Ue==null?void 0:Ue.find(Ct=>Ct.id===fe))==null?void 0:Ze.panes)==null?void 0:nt.find(Ct=>Ct.id===Ne);B({kind:"pane",deviceId:ee,paneId:Ne,name:($e==null?void 0:$e.title)||`Pane ${($e==null?void 0:$e.index)??""}`})},[]),V=v.useCallback(()=>{H&&(H.kind==="window"?U(H.deviceId,H.windowId):R(H.deviceId,H.paneId),B(null))},[H,U,R]),[K,L]=v.useState(null),[$,W]=v.useState(""),I=v.useCallback((ee,fe)=>{var $e,et;const Ne=(et=($e=Mn.getState().snapshots[ee])==null?void 0:$e.session)==null?void 0:et.windows,Ue=Ne==null?void 0:Ne.find(ze=>ze.id===fe);Ue&&(W(Ue.customName??Jw(Ue).title),L({deviceId:ee,windowId:fe,hasCustomName:!!Ue.customName}))},[]),Q=v.useCallback(()=>{if(!K)return;const ee=$.trim();ee&&(T(K.deviceId,K.windowId,ee),L(null))},[K,$,T]),le=v.useCallback(()=>{K&&(T(K.deviceId,K.windowId,""),L(null))},[K,T]),oe=v.useCallback(ee=>{Mn.getState().createWindow(ee)},[]),[Z,ue]=v.useState(null),ve=v.useCallback((ee,fe)=>{ue({deviceId:ee,paneId:fe})},[]),[Se,Pe]=v.useState(null),[te,he]=v.useState(""),[ye,Le]=v.useState(null),Oe=v.useCallback(ee=>{he(ee.title),Pe(ee)},[]),Te=v.useCallback(()=>{if(!Se)return;const ee=te.trim();ee&&(sn.getState().renameSession(Se.id,ee),Pe(null))},[Se,te]),Ce=v.useCallback(ee=>{Le(ee)},[]),J=v.useCallback(()=>{ye&&(sn.getState().deleteSession(ye.id),Le(null))},[ye]),Ee=Qa(),xe=q0(),Be=Ed({mutationFn:async ee=>{const fe=await fetch("/api/devices/order",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceIds:ee})});if(!fe.ok)throw new Error("Failed to reorder devices");return fe.json()},onMutate:async ee=>{await Ee.cancelQueries({queryKey:["devices"]});const fe=Ee.getQueryData(["devices"]);if(fe){const Ne=new Map(fe.devices.map(et=>[et.id,et])),Ue=ee.map((et,ze)=>{const Ze=Ne.get(et);return Ze?{...Ze,sortOrder:ze}:void 0}).filter(et=>et!==void 0),$e=fe.devices.filter(et=>!ee.includes(et.id));Ee.setQueryData(["devices"],{devices:[...Ue,...$e]})}return{previous:fe}},onError:(ee,fe,Ne)=>{Ne!=null&&Ne.previous&&Ee.setQueryData(["devices"],Ne.previous),Bt.error(e("device.reorderFailed"))},onSettled:()=>{Ee.invalidateQueries({queryKey:["devices"]})}}),Ve=(k==null?void 0:k.devices)??[],_e=v.useMemo(()=>[...Ve].sort((ee,fe)=>ee.sortOrder-fe.sortOrder||ee.name.localeCompare(fe.name,QM(C),{numeric:!0,sensitivity:"base"})),[Ve,C]),ut=v.useCallback(ee=>{const{active:fe,over:Ne}=ee;if(!Ne||fe.id===Ne.id)return;const Ue=_e.map(ze=>ze.id),$e=Ue.indexOf(String(fe.id)),et=Ue.indexOf(String(Ne.id));$e<0||et<0||Be.mutate(mf(Ue,$e,et))},[_e,Be]),{sessionsByPane:pe,orphanSessions:Re}=v.useMemo(()=>{const ee=new Set(Ve.map($e=>$e.id)),fe=new Map,Ne=[],Ue=Object.values(l).filter($e=>!!$e).sort(($e,et)=>$e.updatedAt<et.updatedAt?1:-1);for(const $e of Ue){if(!$e.deviceId||!$e.paneId||!ee.has($e.deviceId)){Ne.push($e);continue}const et=`${$e.deviceId}:${$e.paneId}`,ze=fe.get(et);ze?ze.push($e):fe.set(et,[$e])}return{sessionsByPane:fe,orphanSessions:Ne}},[l,Ve]);return w.jsxs(Xw,{className:"flex flex-col flex-1 min-h-0 pt-0",children:[w.jsx(F0,{sensors:xe,collisionDetection:P0,onDragEnd:ut,children:w.jsx(ID,{className:"flex-1 min-h-0",children:w.jsxs("div",{className:"space-y-1.5 pb-2 pt-1 select-none [-webkit-user-select:none] [-webkit-touch-callout:none]",children:[w.jsx(U0,{items:_e.map(ee=>ee.id),strategy:B0,children:_e.map(ee=>{var fe,Ne;return w.jsx(Nne,{device:ee,windows:((Ne=(fe=g[ee.id])==null?void 0:fe.session)==null?void 0:Ne.windows)??null,isConnected:x.has(ee.id),isSelected:ee.id===m,selectedWindowId:h,selectedPaneId:y,onConnectToggle:()=>P(ee.id,x.has(ee.id)),onCreateWindow:oe,onCloseWindow:j,onClosePane:z,onRenameWindow:I,onPaneClick:O,onWindowClick:G,onWatchPane:ve,sessionsByPane:pe,activeSessionId:c,onSelectSession:N,onCreateSessionForPane:_,onRenameSession:Oe,onDeleteSession:Ce},ee.id)})}),_e.length===0&&w.jsx("div",{className:"text-center text-sm text-muted-foreground py-4",children:e("sidebar.noDevices")}),Re.length>0&&w.jsx(_ne,{sessions:Re,activeSessionId:c,onSelectSession:N,onRenameSession:Oe,onDeleteSession:Ce})]})})}),w.jsx(Sx,{open:H!==null,onOpenChange:ee=>!ee&&B(null),children:w.jsxs(Ex,{children:[w.jsxs(Tx,{children:[w.jsx(uM,{className:"bg-destructive/10",children:w.jsx(Ko,{className:"h-5 w-5 text-destructive"})}),w.jsx(Cx,{children:(H==null?void 0:H.kind)==="pane"?e("window.closePaneConfirmTitle"):e("window.closeConfirmTitle")}),w.jsx(kx,{children:e("window.closeConfirmDesc",{name:(H==null?void 0:H.name)??""})})]}),w.jsxs(Rx,{children:[w.jsx(Ox,{children:e("common.cancel")}),w.jsx(Mx,{variant:"destructive",disabled:!H,onClick:V,children:e("common.close")})]})]})}),w.jsx(Nx,{open:K!==null,onOpenChange:ee=>!ee&&L(null),children:w.jsx(Ax,{"data-testid":"window-rename-dialog",children:w.jsxs("form",{onSubmit:ee=>{ee.preventDefault(),Q()},children:[w.jsxs(Dx,{children:[w.jsx(_x,{children:e("window.rename")}),w.jsx(WD,{children:e("window.renameDesc")})]}),w.jsx("div",{className:"py-4",children:w.jsx(ji,{autoFocus:!0,maxLength:64,value:$,onChange:ee=>W(ee.target.value),placeholder:e("window.renamePlaceholder"),"data-testid":"window-rename-input"})}),w.jsxs(dM,{children:[(K==null?void 0:K.hasCustomName)&&w.jsx(Ht,{type:"button",variant:"ghost",onClick:le,"data-testid":"window-rename-reset",children:e("window.renameReset")}),w.jsx(Ht,{type:"button",variant:"outline",onClick:()=>L(null),children:e("common.cancel")}),w.jsx(Ht,{type:"submit",disabled:!$.trim(),"data-testid":"window-rename-save",children:e("common.save")})]})]})})}),w.jsx(Nx,{open:Se!==null,onOpenChange:ee=>!ee&&Pe(null),children:w.jsx(Ax,{"data-testid":"agent-session-rename-dialog",children:w.jsxs("form",{onSubmit:ee=>{ee.preventDefault(),Te()},children:[w.jsx(Dx,{children:w.jsx(_x,{children:e("agent.session.renameTitle")})}),w.jsx("div",{className:"py-4",children:w.jsx(ji,{autoFocus:!0,maxLength:120,value:te,onChange:ee=>he(ee.target.value),placeholder:e("agent.session.renamePlaceholder"),"data-testid":"agent-session-rename-input"})}),w.jsxs(dM,{children:[w.jsx(Ht,{type:"button",variant:"outline",onClick:()=>Pe(null),children:e("agent.session.cancel")}),w.jsx(Ht,{type:"submit",disabled:!te.trim(),"data-testid":"agent-session-rename-save",children:e("agent.session.save")})]})]})})}),w.jsx(Sx,{open:ye!==null,onOpenChange:ee=>!ee&&Le(null),children:w.jsxs(Ex,{children:[w.jsxs(Tx,{children:[w.jsx(uM,{className:"bg-destructive/10",children:w.jsx(Ko,{className:"h-5 w-5 text-destructive"})}),w.jsx(Cx,{children:e("agent.session.deleteTitle")}),w.jsx(kx,{children:e("agent.session.deleteDesc",{title:(ye==null?void 0:ye.title)??""})})]}),w.jsxs(Rx,{children:[w.jsx(Ox,{children:e("common.cancel")}),w.jsx(Mx,{variant:"destructive",disabled:!ye,onClick:J,"data-testid":"agent-session-delete-confirm",children:e("agent.session.deleteConfirm")})]})]})}),Z&&w.jsx(Gee,{open:!0,onOpenChange:ee=>!ee&&ue(null),deviceId:Z.deviceId,paneId:Z.paneId})]})}function Nne({device:e,windows:t,isConnected:n,isSelected:r,selectedWindowId:o,selectedPaneId:a,onConnectToggle:l,onCreateWindow:c,onCloseWindow:f,onClosePane:d,onRenameWindow:m,onPaneClick:h,onWindowClick:y,onWatchPane:g,sessionsByPane:x,activeSessionId:E,onSelectSession:R,onCreateSessionForPane:T,onRenameSession:C,onDeleteSession:k}){const{t:M}=mn(),D=e.type==="local"?af:Om,{attributes:O,listeners:N,setNodeRef:_,setActivatorNodeRef:q,transform:F,transition:G,isDragging:P}=H0({id:e.id}),U=q0(),H=B=>{const{active:j,over:z}=B;if(!z||j.id===z.id||!t)return;const V=t.map($=>$.id),K=V.indexOf(String(j.id)),L=V.indexOf(String(z.id));K<0||L<0||Mn.getState().reorderWindows(e.id,mf(V,K,L))};return w.jsxs("div",{ref:_,style:{transform:ol.Translate.toString(F),transition:G},"data-testid":`device-item-${e.id}`,className:De("group/device rounded-xl border border-border/60 overflow-hidden",r?"bg-chat-surface":n?"bg-muted/40":"bg-muted/20",P&&"opacity-60 shadow-lg"),onClick:n?void 0:l,children:[w.jsxs("div",{className:"relative px-3 py-1.5",children:[r&&w.jsx("span",{className:"absolute left-0 top-0 bottom-0 w-0.5 bg-muted-foreground/70"}),w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("button",{type:"button",ref:q,...O,...N,"aria-label":M("device.dragHandle"),onClick:B=>B.stopPropagation(),className:"touch-none cursor-grab shrink-0 -ml-1 text-muted-foreground/50 hover:text-muted-foreground opacity-100",children:w.jsx(Yw,{className:"h-3.5 w-3.5 [@media(any-pointer:coarse)]:h-5 [@media(any-pointer:coarse)]:w-5"})}),w.jsx(D,{className:"h-4 w-4 text-muted-foreground shrink-0"}),w.jsx("span",{className:"flex-1 truncate text-xs font-medium",children:e.name}),w.jsx(_ee,{deviceId:e.id,className:"shrink-0"}),w.jsx("div",{className:De("h-2 w-2 rounded-full shrink-0",n?"bg-emerald-500":"bg-gray-400")}),w.jsx(Ht,{variant:"ghost",size:"icon-xs",onClick:B=>{B.stopPropagation(),l()},"data-testid":n?`device-disconnect-${e.id}`:`device-connect-${e.id}`,title:M(n?"device.disconnect":"device.connect"),children:n?w.jsx(Y9,{className:"h-3.5 w-3.5 text-orange-500"}):w.jsx(W9,{className:"h-3.5 w-3.5 text-emerald-500"})})]})]}),n&&w.jsxs("div",{className:"p-1.5 space-y-1.5 [@media(any-pointer:coarse)]:space-y-2",children:[!t&&w.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1.5 text-center",children:M("device.connecting")}),(t==null?void 0:t.length)===0&&w.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1.5 text-center",children:M("window.noWindows")}),t&&t.length>0&&w.jsx(F0,{sensors:U,collisionDetection:P0,onDragEnd:H,children:w.jsx(U0,{items:t.map(B=>B.id),strategy:B0,children:t.map(B=>w.jsx(Ane,{deviceId:e.id,window:B,isSelected:B.id===o,selectedPaneId:a,onPaneClick:h,onWindowClick:y,onCloseWindow:f,onClosePane:d,onRenameWindow:m,onWatchPane:g,sessionsByPane:x,activeSessionId:E,onSelectSession:R,onCreateSessionForPane:T,onRenameSession:C,onDeleteSession:k},B.id))})}),w.jsxs("button",{type:"button","data-testid":`window-create-${e.id}`,onPointerDown:B=>B.stopPropagation(),onMouseDown:B=>B.stopPropagation(),onClick:()=>c(e.id),className:"w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left transition-colors text-muted-foreground hover:text-foreground hover:bg-accent/30 border border-dashed border-border/50 hover:border-border",children:[w.jsx(Am,{className:"h-3.5 w-3.5 shrink-0"}),w.jsx("span",{className:"text-xs",children:M("window.new")})]})]})]})}function Ane({deviceId:e,window:t,isSelected:n,selectedPaneId:r,onPaneClick:o,onWindowClick:a,onCloseWindow:l,onClosePane:c,onRenameWindow:f,onWatchPane:d,sessionsByPane:m,activeSessionId:h,onSelectSession:y,onCreateSessionForPane:g,onRenameSession:x,onDeleteSession:E}){const{t:R}=mn(),{isMobile:T}=qr(),C=t.panes.length>1,k=Jw(t),M=t.panes.find(B=>B.id===r),D=n&&!!M,{attributes:O,listeners:N,setNodeRef:_,setActivatorNodeRef:q,transform:F,transition:G,isDragging:P}=H0({id:t.id}),U=q0(),H=B=>{const{active:j,over:z}=B;if(!z||j.id===z.id)return;const V=t.panes.map($=>$.id),K=V.indexOf(String(j.id)),L=V.indexOf(String(z.id));K<0||L<0||Mn.getState().reorderPanes(e,t.id,mf(V,K,L))};return w.jsxs("div",{ref:_,style:{transform:ol.Translate.toString(F),transition:G},className:De("space-y-1",P&&"opacity-60"),children:[w.jsxs("div",{className:"group relative flex items-center gap-1",children:[w.jsx("button",{type:"button",ref:q,...O,...N,"aria-label":R("window.dragHandle"),onClick:B=>B.stopPropagation(),className:De("touch-none cursor-grab shrink-0 flex items-center justify-center text-muted-foreground/50 hover:text-muted-foreground opacity-100",T?"h-9 w-4":"h-6 w-3.5 [@media(any-pointer:coarse)]:h-9 [@media(any-pointer:coarse)]:w-4"),children:w.jsx(Yw,{className:De(T?"h-4 w-4":"h-3.5 w-3.5")})}),w.jsxs("button",{type:"button",onClick:()=>a(e,t.id,t.panes),"data-testid":`window-item-${t.id}`,className:De("flex-1 min-w-0 flex items-center gap-2 px-2 py-1.5 rounded-lg text-left transition-colors pr-7 [@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:pr-12",T&&"py-2.5 pr-13",D?"bg-primary/10 text-primary":t.active?"bg-accent text-accent-foreground":"hover:bg-accent/50 text-foreground"),children:[w.jsx(il,{variant:D?"default":"outline",className:"h-5 text-[10px] px-1.5 shrink-0",children:t.index}),w.jsxs("span",{className:"flex-1 min-w-0",children:[w.jsx("span",{className:"font-mono text-[11px] leading-tight font-medium line-clamp-2 [overflow-wrap:break-word]",children:k.title}),k.processName&&w.jsx("span",{className:"font-mono text-[10.5px] leading-tight text-muted-foreground line-clamp-1 break-all",children:k.processName})]})]}),w.jsxs(M0,{children:[w.jsx(O0,{"data-testid":`window-menu-${t.id}`,"aria-label":R("window.menu"),title:R("window.menu"),className:De("absolute top-1/2 -translate-y-1/2 flex items-center justify-center rounded text-muted-foreground hover:bg-background hover:text-foreground transition-opacity data-popup-open:opacity-100",T?"h-11 w-11 right-0 rounded-lg bg-background/40 opacity-100":"h-5 w-5 right-1.5 [@media(any-pointer:coarse)]:h-10 [@media(any-pointer:coarse)]:w-10 [@media(any-pointer:coarse)]:right-0.5 [@media(any-pointer:coarse)]:rounded-lg",D?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100"),children:w.jsx(RN,{className:De(T?"h-5 w-5":"h-3.5 w-3.5 [@media(any-pointer:coarse)]:h-4.5 [@media(any-pointer:coarse)]:w-4.5")})}),w.jsxs(N0,{align:"end",backdrop:!0,className:"w-auto min-w-36 [@media(any-pointer:coarse)]:min-w-48",children:[w.jsxs(cc,{"data-testid":`window-menu-rename-${t.id}`,className:De("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",T&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>f(e,t.id),children:[w.jsx(Nm,{className:De("h-4 w-4",T&&"h-5 w-5")}),R("window.rename")]}),w.jsxs(cc,{"data-testid":`window-menu-new-session-${t.id}`,className:De("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",T&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>g(e,t.id,M||t.panes[0]),children:[w.jsx(Am,{className:De("h-4 w-4",T&&"h-5 w-5")}),R("agent.session.new")]}),w.jsxs(cc,{variant:"destructive","data-testid":`window-menu-close-${t.id}`,className:De("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",T&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>l(e,t.id),children:[w.jsx(Ko,{className:De("h-4 w-4",T&&"h-5 w-5")}),R("window.close")]})]})]})]}),C&&w.jsx("div",{className:"ml-4 pl-2 border-l border-border/50 space-y-1 [@media(any-pointer:coarse)]:space-y-1.5",children:w.jsx(F0,{sensors:U,collisionDetection:P0,onDragEnd:H,children:w.jsx(U0,{items:t.panes.map(B=>B.id),strategy:B0,children:t.panes.map(B=>w.jsx(Dne,{deviceId:e,windowId:t.id,pane:B,isActive:B.id===r,isMobile:T,onPaneClick:o,onClosePane:c,onWatchPane:d,sessions:m.get(`${e}:${B.id}`),activeSessionId:h,onSelectSession:y,onRenameSession:x,onDeleteSession:E},B.id))})})}),!C&&t.panes[0]&&w.jsx("div",{className:"ml-[36px] pl-2 border-l border-border/50",children:w.jsx(k_,{sessions:m.get(`${e}:${t.panes[0].id}`),activeSessionId:h,onSelectSession:y,onRenameSession:x,onDeleteSession:E})})]})}function Dne({deviceId:e,windowId:t,pane:n,isActive:r,isMobile:o,onPaneClick:a,onClosePane:l,onWatchPane:c,sessions:f,activeSessionId:d,onSelectSession:m,onRenameSession:h,onDeleteSession:y}){const{t:g}=mn(),{attributes:x,listeners:E,setNodeRef:R,setActivatorNodeRef:T,transform:C,transition:k,isDragging:M}=H0({id:n.id});return w.jsxs("div",{ref:R,style:{transform:ol.Translate.toString(C),transition:k},className:De("group relative",M&&"opacity-60"),children:[w.jsxs("div",{className:"flex items-center gap-1",children:[w.jsx("button",{type:"button",ref:T,...x,...E,"aria-label":g("window.dragHandlePane"),onClick:D=>D.stopPropagation(),className:De("touch-none cursor-grab shrink-0 flex items-center justify-center text-muted-foreground/50 hover:text-muted-foreground opacity-100",o?"h-9 w-4":"h-6 w-3 [@media(any-pointer:coarse)]:h-9 [@media(any-pointer:coarse)]:w-4"),children:w.jsx(Yw,{className:De(o?"h-4 w-4":"h-3 w-3")})}),w.jsxs("button",{type:"button",onClick:()=>a(e,t,n.id),"data-testid":`pane-item-${n.id}`,className:De("flex-1 min-w-0 flex items-center gap-2 px-2 py-1 rounded-lg text-left transition-colors pr-13 [@media(any-pointer:coarse)]:py-2 [@media(any-pointer:coarse)]:pr-21",o&&"py-2.5 pr-24",r?"bg-primary/10 text-primary":n.active?"bg-accent text-accent-foreground":"hover:bg-accent/30 text-muted-foreground"),children:[w.jsx("span",{className:"text-[10px] font-mono opacity-60 w-4",children:n.index}),w.jsx("span",{className:"flex-1 text-xs line-clamp-2 break-all",children:n.title||`Pane ${n.index}`})]})]}),w.jsxs(M0,{children:[w.jsx(O0,{"data-testid":`pane-menu-${n.id}`,"aria-label":g("watch.openMonitor"),className:De("absolute top-1/2 -translate-y-1/2 flex items-center justify-center rounded text-muted-foreground hover:bg-background hover:text-foreground transition-opacity data-popup-open:opacity-100",o?"h-11 w-11 right-11 rounded-lg bg-background/40 opacity-100":"h-5 w-5 right-7 [@media(any-pointer:coarse)]:h-10 [@media(any-pointer:coarse)]:w-10 [@media(any-pointer:coarse)]:right-10.5 [@media(any-pointer:coarse)]:rounded-lg",r?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100"),children:w.jsx(RN,{className:De(o?"h-5 w-5":"h-3.5 w-3.5")})}),w.jsx(N0,{align:"end",backdrop:!0,className:"w-auto min-w-36 [@media(any-pointer:coarse)]:min-w-48",children:w.jsxs(cc,{"data-testid":`pane-watch-${n.id}`,className:De("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",o&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>c(e,n.id),children:[w.jsx(Q9,{className:De("h-4 w-4",o&&"h-5 w-5")}),g("watch.openMonitor")]})})]}),w.jsx("button",{type:"button",onClick:D=>{D.stopPropagation(),l(e,t,n.id)},"data-testid":`pane-close-${n.id}`,className:De("absolute top-1/2 -translate-y-1/2 flex items-center justify-center rounded text-muted-foreground hover:bg-background hover:text-foreground transition-opacity",o?"h-11 w-11 right-0 rounded-lg bg-background/40 opacity-100":"h-5 w-5 right-1.5 [@media(any-pointer:coarse)]:h-10 [@media(any-pointer:coarse)]:w-10 [@media(any-pointer:coarse)]:right-0.5 [@media(any-pointer:coarse)]:rounded-lg",r?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100"),title:g("window.closePane"),children:w.jsx("span",{className:De("leading-none",o?"text-base":"text-xs"),children:"×"})}),w.jsx(k_,{sessions:f,activeSessionId:d,onSelectSession:m,onRenameSession:h,onDeleteSession:y})]})}function C_({session:e,onRenameSession:t,onDeleteSession:n,className:r,enlargeOnTouch:o=!1}){const{t:a}=mn(),{isMobile:l}=qr(),c=o&&l;return w.jsxs(M0,{children:[w.jsx(O0,{render:w.jsx(Ht,{variant:"ghost",size:"icon-sm","data-testid":`agent-session-menu-${e.id}`,"aria-label":a("agent.session.rename"),onClick:f=>f.stopPropagation(),className:De("size-5 shrink-0 text-muted-foreground transition-opacity data-popup-open:opacity-100",l?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100",c&&"size-9",r)}),children:w.jsx(r9,{className:De("size-3.5",c&&"size-5")})}),w.jsxs(N0,{align:"end",backdrop:!0,className:"w-auto min-w-36 [@media(any-pointer:coarse)]:min-w-48",children:[w.jsxs(cc,{"data-testid":"agent-session-rename",className:De("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",l&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>t(e),children:[w.jsx(Nm,{className:De("h-4 w-4",l&&"h-5 w-5")}),a("agent.session.rename")]}),w.jsxs(cc,{variant:"destructive","data-testid":"agent-session-delete",className:De("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",l&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>n(e),children:[w.jsx(ON,{className:De("h-4 w-4",l&&"h-5 w-5")}),a("agent.session.delete")]})]})]})}function k_({sessions:e,activeSessionId:t,onSelectSession:n,onRenameSession:r,onDeleteSession:o}){const{isMobile:a}=qr();return w.jsx("div",{className:"mt-1 space-y-0.5 [@media(any-pointer:coarse)]:space-y-1",children:e==null?void 0:e.map(l=>{const c=l.id===t;return w.jsxs("div",{className:"group relative",children:[w.jsxs("button",{type:"button","data-testid":`agent-session-item-${l.id}`,onClick:()=>n(l),className:De("w-full flex items-center gap-1.5 px-2 py-1 pr-7 rounded-md text-left transition-colors [@media(any-pointer:coarse)]:min-h-11 [@media(any-pointer:coarse)]:py-2 [@media(any-pointer:coarse)]:pr-12",a&&"min-h-11 py-2 pr-12",c?"bg-primary/10 text-primary":"hover:bg-accent/30 text-muted-foreground"),children:[w.jsx(Mm,{className:"size-3 shrink-0 opacity-70"}),w.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px]",children:l.title}),w.jsx(R_,{status:l.status})]}),w.jsx("div",{className:"absolute right-0.5 top-1/2 -translate-y-1/2",children:w.jsx(C_,{session:l,onRenameSession:r,onDeleteSession:o,enlargeOnTouch:!0})})]},l.id)})})}function _ne({sessions:e,activeSessionId:t,onSelectSession:n,onRenameSession:r,onDeleteSession:o}){const{t:a}=mn(),[l,c]=v.useState(!1),f=nl(d=>{var m;return((m=d.settings)==null?void 0:m.language)??"en_US"});return w.jsxs(jm,{open:l,onOpenChange:c,className:"rounded-xl border border-border/60 bg-muted/20",children:[w.jsxs(zm,{"data-testid":"agent-orphan-sessions-trigger",className:"flex w-full items-center gap-2 px-3 py-1.5 text-left",children:[w.jsx(k9,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),w.jsx("span",{className:"flex-1 truncate text-xs font-medium text-muted-foreground",children:a("agent.orphan.title",{count:e.length})}),w.jsx(of,{className:De("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform",l&&"rotate-90")})]}),w.jsx(Fm,{className:"space-y-0.5 px-1.5 pb-1.5",children:e.map(d=>{const m=d.id===t,h=[d.originPaneTitle,d.originProcessName,d.createdAt?new Date(d.createdAt).toLocaleString(QM(f)):null].filter(y=>!!y);return w.jsxs("div",{className:"group relative",children:[w.jsxs("button",{type:"button","data-testid":`agent-orphan-session-${d.id}`,onClick:()=>n(d),className:De("w-full flex flex-col gap-0.5 px-2 py-1.5 pr-7 rounded-lg text-left transition-colors",m?"bg-primary/10 text-primary":"hover:bg-accent/30"),children:[w.jsxs("span",{className:"flex items-center gap-1.5",children:[w.jsx(Mm,{className:"size-3 shrink-0 opacity-70"}),w.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px]",children:d.title}),w.jsx(R_,{status:d.status})]}),h.length>0&&w.jsx("span",{className:"truncate pl-[18px] text-[10px] text-muted-foreground",children:h.join(" · ")})]}),w.jsx("div",{className:"absolute right-0.5 top-1.5",children:w.jsx(C_,{session:d,onRenameSession:r,onDeleteSession:o})})]},d.id)})})]})}function Ine(){const{t:e}=mn(),{isMobile:t,setOpenMobile:n}=qr(),r=nl(m=>{var h;return(h=m.settings)==null?void 0:h.siteName}),o=nl(m=>m.fetchSettings);v.useEffect(()=>{o()},[o]);const a=r??"tmex",l=Mi(m=>m.theme),c=Mi(m=>m.setTheme),f=l==="dark",d=()=>{const m=f?"light":"dark";c(m),document.documentElement.classList.toggle("dark",m==="dark")};return w.jsxs("div",{className:"flex items-center gap-2 px-2",children:[t&&w.jsx("button",{type:"button","data-testid":"mobile-sidebar-close",onClick:()=>n(!1),className:"inline-flex h-8 w-8 ml-[-8px] shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent hover:text-foreground","aria-label":e("nav.closeSidebar"),title:e("nav.closeSidebar"),children:w.jsx(Ko,{className:"h-4 w-4"})}),w.jsxs(Zp,{to:"/",className:"flex flex-1 items-center gap-3 overflow-hidden",children:[w.jsx("div",{className:"h-8 w-8 shrink-0 overflow-hidden rounded-lg border-2 border-black",children:w.jsx("img",{src:"/logo.png",alt:a,className:"h-full w-full object-cover"})}),w.jsx("span",{className:"truncate text-sm font-semibold tracking-tight",children:a})]}),w.jsx("button",{type:"button",onClick:d,className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent hover:text-foreground","aria-label":e(f?"settings.themeLight":"settings.themeDark"),title:e(f?"settings.themeLight":"settings.themeDark"),children:f?w.jsx(uq,{className:"h-4 w-4"}):w.jsx(F9,{className:"h-4 w-4"})}),w.jsx(Zp,{to:"/settings",className:"inline-flex h-8 w-8 mr-[-8px] shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent hover:text-foreground","aria-label":e("sidebar.settings"),title:e("sidebar.settings"),children:w.jsx(oq,{className:"h-4 w-4"})})]})}const gv="rounded-lg data-active:bg-background data-active:text-foreground data-active:border-transparent group-data-[variant=default]/tabs-list:data-active:shadow-none dark:data-active:bg-input/60 dark:data-active:border-transparent text-[13px] transition-colors duration-200 [&_svg:not([class*='size-'])]:size-[15px]",Pne=[{title:"nav.manageDevices",url:"/devices",icon:af}];function Lne({...e}){const{t}=mn(),n=Mi(o=>o.sidebarTab),r=Mi(o=>o.setSidebarTab);return w.jsxs(s7,{variant:"inset",...e,children:[w.jsx("div",{className:"h-[var(--tmex-safe-area-top)]"}),w.jsxs(d7,{className:"gap-5 pt-3 pb-0",children:[w.jsx(Ine,{}),w.jsx(Mee,{className:"mb-2.5",value:n,onValueChange:o=>r(o),children:w.jsxs(Nee,{className:"w-full p-1 rounded-xl border border-border/60 group-data-horizontal/tabs:h-11",children:[w.jsxs(cv,{value:"panes","data-testid":"sidebar-tab-panes",className:gv,children:[w.jsx(q9,{}),t("sidebar.tab.panes")]}),w.jsxs(cv,{value:"agent","data-testid":"sidebar-tab-agent",className:gv,children:[w.jsx(Mm,{}),t("sidebar.tab.agent")]}),w.jsxs(cv,{value:"files","data-testid":"sidebar-tab-files",className:gv,children:[w.jsx(x9,{}),t("sidebar.tab.files")]})]})})]}),w.jsxs(h7,{className:"flex min-h-0 flex-col overflow-hidden",children:[n==="panes"&&w.jsx(One,{}),n==="agent"&&w.jsx(SZ,{}),n==="files"&&w.jsx(fee,{})]}),n==="panes"&&w.jsxs(f7,{children:[w.jsx(Aee,{items:Pne}),w.jsx("div",{className:"h-[var(--tmex-safe-area-bottom)]"})]})]})}let CM=!1;function jne(e,t,n){var o,a,l;let r=n;if(!r){const c=(a=(o=Mn.getState().snapshots[e])==null?void 0:o.session)==null?void 0:a.windows;r=(l=c==null?void 0:c.find(f=>f.panes.some(d=>d.id===t)))==null?void 0:l.id}return r?`/devices/${e}/windows/${r}/panes/${k0(t)}`:`/devices/${e}`}function zne(e,t){const n=e.getQueriesData({queryKey:["watch-rules"]});for(const[,r]of n){const o=r==null?void 0:r.find(a=>a.id===t);if(o)return o.name}return null}async function Fne(e,t){var r;const n=zne(e,t);if(n)return n;try{const o=await fetch(`/api/watch/rules/${t}`);return o.ok?((r=(await o.json()).rule)==null?void 0:r.name)??null:null}catch{return null}}function Bne(e,t,n){if(!(typeof Notification>"u"||Notification.permission!=="granted"))try{const r=new Notification(e,{body:t});r.onclick=()=>{window.focus(),window.location.href=n}}catch{}}function Une(e,t){e.invalidateQueries({queryKey:["watch-rules"]}),e.invalidateQueries({queryKey:["watch-rule-state",t]})}async function Hne(e,t,n,r,o){const l=await Fne(e,t)??Qt.t("watch.toast.triggeredTitle"),c=o.summary||o.matchedText||"",f=c.length>200?`${c.slice(0,200)}…`:c,d=jne(n,r,o.windowId);Bt(l,{description:f,action:{label:Qt.t("watch.toast.openTerminal"),onClick:()=>{window.location.href=d}}}),Bne(l,f,d)}function qne(e){if(CM)return;CM=!0,In().onMessage(n=>{if(n.kind!==dj)return;let r;try{r=Bo(bz,n.payload)}catch(a){console.error("[watch] failed to decode WATCH_EVENT:",a);return}let o;try{o=JSON.parse(new TextDecoder().decode(r.payload))}catch(a){console.error("[watch] failed to parse WATCH_EVENT payload:",a);return}switch(Une(e,r.ruleId),r.eventType){case Rj:Hne(e,r.ruleId,r.deviceId,r.paneId,o);return;case Cj:{const a=o;Bt.warning(Qt.t("watch.toast.modelUnavailableTitle"),{description:`${a.message} ${Qt.t("watch.toast.modelUnavailableHint")}`});return}case kj:{const a=o;Bt.error(Qt.t("watch.toast.ruleErrorTitle"),{description:a.message});return}default:return}})}function Vne(){const e=Qa();return v.useEffect(()=>{qne(e),In().connect()},[e]),null}const $ne=60,Gne=.02;function Yne(e){if(Math.abs(e.viewportScale-1)>Gne)return 0;const t=Math.round(e.windowInnerHeight-e.viewportHeight-e.viewportOffsetTop);return t>=$ne?t:0}function Nre(){if(typeof navigator>"u")return!1;const e=navigator.userAgent,t=/iPad|iPhone|iPod/.test(e),n=navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1;return t||n}function Kne(){return typeof window>"u"||typeof navigator>"u"?!1:"ontouchstart"in window||navigator.maxTouchPoints>0}function Wne(e){const[t,n]=v.useState(0);return v.useEffect(()=>{if(!Kne())return;const r=window.visualViewport;if(!r)return;let o=null;const a=()=>{if(e){n(0);return}const c=document.activeElement;if(!(c instanceof Element&&c.closest("[data-virtual-keyboard-avoid]")!==null)){n(0);return}n(Yne({windowInnerHeight:window.innerHeight,viewportHeight:r.height,viewportOffsetTop:r.offsetTop,viewportScale:r.scale}))},l=()=>{o===null&&(o=window.requestAnimationFrame(()=>{o=null,a()}))};return a(),r.addEventListener("resize",l),r.addEventListener("scroll",l),window.addEventListener("resize",l),document.addEventListener("focusin",l),document.addEventListener("focusout",l),()=>{r.removeEventListener("resize",l),r.removeEventListener("scroll",l),window.removeEventListener("resize",l),document.removeEventListener("focusin",l),document.removeEventListener("focusout",l),o!==null&&window.cancelAnimationFrame(o)}},[e]),t}console.info(`tmex ${kL("0.12.0",!0)}`);function Xne(){var e;try{const t=localStorage.getItem("tmex-ui");if(!t){document.documentElement.classList.add("dark");return}const n=JSON.parse(t),r=(e=n==null?void 0:n.state)==null?void 0:e.theme,o=r==="dark"||r===void 0;document.documentElement.classList.toggle("dark",o)}catch{document.documentElement.classList.add("dark")}}Xne();const Qne=new dL({defaultOptions:{queries:{staleTime:5e3,retry:1}}});function Zne(){const{openMobile:e}=qr(),t=Mi(n=>n.theme);return v.useEffect(()=>{const n=e?"--sidebar":"--background";document.body.style.backgroundColor=`var(${n})`,requestAnimationFrame(()=>{var a;const o=getComputedStyle(document.body).backgroundColor;(a=document.querySelector('meta[name="theme-color"]'))==null||a.setAttribute("content",o)})},[e,t]),null}function Jne(){const e=Mi(t=>t.theme);return w.jsx(Q3,{theme:e,richColors:!0,position:"top-right",closeButton:!0,offset:{top:"calc(16px + env(safe-area-inset-top, 0px))",right:"16px",bottom:"16px",left:"16px"},mobileOffset:{top:"calc(12px + env(safe-area-inset-top, 0px))",right:"12px",bottom:"12px",left:"12px"},toastOptions:{duration:6e3}})}function ere(){return w.jsxs(sV,{children:[w.jsx(Vne,{}),w.jsxs(a7,{children:[w.jsx(Zne,{}),w.jsx(T7,{}),w.jsx(Lne,{}),w.jsx(tre,{})]})]})}function tre(){const{openMobile:e}=qr(),t=Wne(e);return w.jsxs(u7,{className:"h-dvh overflow-hidden md:h-[calc(100dvh-1rem)]",style:t>0?{transform:`translateY(-${t}px)`,transition:"transform 0.12s ease-out"}:void 0,children:[w.jsx(U5,{}),w.jsx("div",{style:{height:t>0?0:"var(--tmex-safe-area-bottom)",transition:"height 0.12s ease-out"}})]})}function Yl({moduleLoader:e}){const[t,n]=v.useState(null),r=v5();v.useEffect(()=>{e().then(n)},[e]);const o=t==null?void 0:t.default,a=t==null?void 0:t.PageTitle,l=t==null?void 0:t.PageActions;return w.jsxs(w.Fragment,{children:[w.jsxs("header",{className:"sticky top-0 z-10 flex h-12 md:h-16 shrink-0 items-center justify-between gap-2 bg-background/95 backdrop-blur-sm","data-testid":"mobile-topbar",children:[w.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 px-4",children:[w.jsx(c7,{className:"-ml-1 shrink-0","data-testid":"mobile-sidebar-open"}),w.jsx(lH,{orientation:"vertical",className:"mr-2 shrink-0 data-[orientation=vertical]:h-4"}),w.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:a?w.jsx(a,{...r}):""})]}),w.jsx("div",{className:"flex shrink-0 items-center gap-1 px-4",children:l&&w.jsx(l,{...r})})]}),w.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-4 !pt-0 p-2 md:p-4",children:w.jsx("div",{className:"bg-muted/50 min-h-0 flex-1 overflow-auto overscroll-auto rounded-xl [-webkit-overflow-scrolling:touch]",children:o?w.jsx(o,{}):null})})]})}const nre=()=>rm(()=>import("./SettingsPage-Bxat-d_V.js"),__vite__mapDeps([0,1,2,3,4])),kM=()=>rm(()=>import("./DevicesPage-Bm7E9QAf.js"),__vite__mapDeps([5,1])),MM=()=>rm(()=>import("./DevicePage-B2xsa-ys.js"),__vite__mapDeps([6,2])),rre=()=>rm(()=>import("./FilePage-DtXS6Krk.js"),__vite__mapDeps([7,3,4])),ire=f3([{path:"/",Component:ere,children:[{index:!0,element:w.jsx(Yl,{moduleLoader:kM})},{path:"devices",element:w.jsx(Yl,{moduleLoader:kM})},{path:"devices/:deviceId",element:w.jsx(Yl,{moduleLoader:MM})},{path:"devices/:deviceId/windows/:windowId/panes/:paneId",element:w.jsx(Yl,{moduleLoader:MM})},{path:"settings",element:w.jsx(Yl,{moduleLoader:nre})},{path:"file/:ref",element:w.jsx(Yl,{moduleLoader:rre})}]}]),M_=document.getElementById("root");if(!M_)throw new Error("Root element not found");Qz.createRoot(M_).render(w.jsx(v.StrictMode,{children:w.jsxs(hL,{client:Qne,children:[w.jsx(z5,{router:ire}),w.jsx(Jne,{})]})}));export{wre as $,Sx as A,Ht as B,Nx as C,M0 as D,r9 as E,Ax as F,Om as G,Dx as H,_x as I,WD as J,ji as K,ow as L,af as M,yp as N,bp as O,Am as P,ov as Q,vp as R,lH as S,ON as T,Fo as U,Zw as V,dM as W,De as X,ht as Y,NN as Z,im as _,Qa as a,t0 as a$,RZ as a0,gre as a1,bre as a2,yre as a3,vre as a4,pre as a5,mre as a6,xre as a7,Z8 as a8,Ko as a9,HJ as aA,e9 as aB,mq as aC,oq as aD,F8 as aE,MN as aF,Mee as aG,Nee as aH,cv as aI,gv as aJ,sre as aK,Qt as aL,FJ as aM,kN as aN,Sre as aO,Bi as aP,FD as aQ,GJ as aR,kre as aS,Cre as aT,Pm as aU,h0 as aV,IV as aW,hre as aX,fre as aY,lx as aZ,jV as a_,C7 as aa,R7 as ab,cre as ac,Ad as ad,gD as ae,lre as af,v5 as ag,Kd as ah,Mre as ai,Mi as aj,Nre as ak,xV as al,k0 as am,ure as an,tl as ao,qp as ap,zC as aq,O9 as ar,Q9 as as,Gee as at,Bee as au,Fee as av,Tre as aw,Pd as ax,Rre as ay,Ere as az,nl as b,RA as b0,eK as b1,dre as b2,RW as b3,ln as b4,xt as b5,rm as b6,_K as b7,GX as b8,oi as c,Mn as d,Ed as e,Ex as f,Tx as g,uM as h,Cx as i,w as j,kx as k,Rx as l,Ox as m,Mx as n,Bt as o,O0 as p,N0 as q,v as r,cc as s,QM as t,mn as u,Nm as v,Ore as w,il as x,_ee as y,uU as z};
|
|
488
|
+
//# sourceMappingURL=index-Den36xcn.js.map
|