tmex-cli 0.11.0 → 0.12.2

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.
Files changed (82) hide show
  1. package/CHANGELOG.md +22 -12
  2. package/dist/runtime/server.js +752 -48
  3. package/package.json +1 -1
  4. package/resources/fe-dist/assets/DevicePage-B0fQ6yWB.js +25 -0
  5. package/resources/fe-dist/assets/DevicesPage-C7THDzTX.js +2 -0
  6. package/resources/fe-dist/assets/{FilePage-YWma96aj.js → FilePage-D8V8P2IA.js} +8 -8
  7. package/resources/fe-dist/assets/{SettingsPage-LhUD03Ln.js → SettingsPage-BOTyBhHH.js} +8 -8
  8. package/resources/fe-dist/assets/{arc-DLVa298O.js → arc-DcujnLz7.js} +2 -2
  9. package/resources/fe-dist/assets/architectureDiagram-3BPJPVTR-i8499Wfc.js +37 -0
  10. package/resources/fe-dist/assets/{blockDiagram-GPEHLZMM-BTwwkzZh.js → blockDiagram-GPEHLZMM-BFh4xZY2.js} +2 -2
  11. package/resources/fe-dist/assets/{c4Diagram-AAUBKEIU-xvTqXxl9.js → c4Diagram-AAUBKEIU-nUyGK7Ke.js} +2 -2
  12. package/resources/fe-dist/assets/{card-cbVDy0Xp.js → card-BkRqR9zz.js} +2 -2
  13. package/resources/fe-dist/assets/channel-DqmfsuLY.js +2 -0
  14. package/resources/fe-dist/assets/{chunk-2J33WTMH-Blr6l1Nk.js → chunk-2J33WTMH-z2oMKYMn.js} +2 -2
  15. package/resources/fe-dist/assets/{chunk-4BX2VUAB-D_Y2TeLg.js → chunk-4BX2VUAB-CCD_pyAh.js} +2 -2
  16. package/resources/fe-dist/assets/{chunk-55IACEB6-CimNoYDH.js → chunk-55IACEB6-Dx2_9d-z.js} +2 -2
  17. package/resources/fe-dist/assets/{chunk-727SXJPM-JPYDN0Cb.js → chunk-727SXJPM-DA36poir.js} +2 -2
  18. package/resources/fe-dist/assets/{chunk-AQP2D5EJ-Cb3NZBib.js → chunk-AQP2D5EJ-CQoXkVd4.js} +2 -2
  19. package/resources/fe-dist/assets/{chunk-FMBD7UC4-DyZ7Ot2F.js → chunk-FMBD7UC4-A6Yn7A44.js} +2 -2
  20. package/resources/fe-dist/assets/{chunk-ND2GUHAM-SU6Ea3wF.js → chunk-ND2GUHAM-BsNl2EMT.js} +2 -2
  21. package/resources/fe-dist/assets/{chunk-QZHKN3VN-B6qXX6sU.js → chunk-QZHKN3VN-BM_QNxf6.js} +2 -2
  22. package/resources/fe-dist/assets/classDiagram-4FO5ZUOK-D3Z9BeOE.js +2 -0
  23. package/resources/fe-dist/assets/classDiagram-v2-Q7XG4LA2-D3Z9BeOE.js +2 -0
  24. package/resources/fe-dist/assets/cose-bilkent-S5V4N54A-1lMO_Dod.js +2 -0
  25. package/resources/fe-dist/assets/{dagre-BM42HDAG-Ckrx9BXZ.js → dagre-BM42HDAG-C9Up3ckQ.js} +2 -2
  26. package/resources/fe-dist/assets/{diagram-2AECGRRQ-DTnZtf2k.js → diagram-2AECGRRQ-CtuDndmY.js} +2 -2
  27. package/resources/fe-dist/assets/{diagram-5GNKFQAL-DBpgZj4a.js → diagram-5GNKFQAL-BQfskK8S.js} +2 -2
  28. package/resources/fe-dist/assets/{diagram-KO2AKTUF-CfijYCeY.js → diagram-KO2AKTUF-CGJi8q81.js} +2 -2
  29. package/resources/fe-dist/assets/{diagram-LMA3HP47-D7nBmQ-E.js → diagram-LMA3HP47-DAMQIoLQ.js} +2 -2
  30. package/resources/fe-dist/assets/{diagram-OG6HWLK6-Bi8sHV0O.js → diagram-OG6HWLK6-D2s__dFc.js} +2 -2
  31. package/resources/fe-dist/assets/{erDiagram-TEJ5UH35-DcoDesO2.js → erDiagram-TEJ5UH35-_UJYLIQN.js} +2 -2
  32. package/resources/fe-dist/assets/{flowDiagram-I6XJVG4X-Bbcl9kxS.js → flowDiagram-I6XJVG4X-DN-qktDh.js} +2 -2
  33. package/resources/fe-dist/assets/ganttDiagram-6RSMTGT7-CNuuuhXX.js +293 -0
  34. package/resources/fe-dist/assets/{gitGraphDiagram-PVQCEYII-x3wpNQcW.js → gitGraphDiagram-PVQCEYII-Qar2sVRo.js} +2 -2
  35. package/resources/fe-dist/assets/index-BhU3LRKb.css +1 -0
  36. package/resources/fe-dist/assets/index-Ra6pj0rt.js +488 -0
  37. package/resources/fe-dist/assets/{infoDiagram-5YYISTIA-Bl6cgwVb.js → infoDiagram-5YYISTIA-2e6tU_v9.js} +2 -2
  38. package/resources/fe-dist/assets/{ishikawaDiagram-YF4QCWOH-BfQ7aZxN.js → ishikawaDiagram-YF4QCWOH-BghKvoM4.js} +2 -2
  39. package/resources/fe-dist/assets/{journeyDiagram-JHISSGLW-DSwQzmdL.js → journeyDiagram-JHISSGLW-D-cHSGb_.js} +2 -2
  40. package/resources/fe-dist/assets/{kanban-definition-UN3LZRKU-B1aWDl4E.js → kanban-definition-UN3LZRKU-BE6Cb-OK.js} +2 -2
  41. package/resources/fe-dist/assets/{linear-CfhRC4iX.js → linear-CwDBnUH0.js} +2 -2
  42. package/resources/fe-dist/assets/{markdown-preview-CfBRMViB.js → markdown-preview-BlQiC8ND.js} +4 -4
  43. package/resources/fe-dist/assets/{mermaid.core-M-o4g4TO.js → mermaid.core-DDMkLXrp.js} +6 -6
  44. package/resources/fe-dist/assets/{mindmap-definition-RKZ34NQL-D976sxOA.js → mindmap-definition-RKZ34NQL-C9xVR7Ut.js} +2 -2
  45. package/resources/fe-dist/assets/{pieDiagram-4H26LBE5-PVQ3-EB6.js → pieDiagram-4H26LBE5-DW_4RcBv.js} +2 -2
  46. package/resources/fe-dist/assets/{quadrantDiagram-W4KKPZXB-BNEFhYNq.js → quadrantDiagram-W4KKPZXB-DoIrZmk2.js} +2 -2
  47. package/resources/fe-dist/assets/{requirementDiagram-4Y6WPE33-B7Zd2lpN.js → requirementDiagram-4Y6WPE33-CYcJSuPe.js} +2 -2
  48. package/resources/fe-dist/assets/{sankeyDiagram-5OEKKPKP-D_Td4j-B.js → sankeyDiagram-5OEKKPKP-CrIkKM6h.js} +2 -2
  49. package/resources/fe-dist/assets/{sequenceDiagram-3UESZ5HK-DQSVX5mL.js → sequenceDiagram-3UESZ5HK-DgzGHhGk.js} +2 -2
  50. package/resources/fe-dist/assets/{stateDiagram-AJRCARHV-C0PNCTfs.js → stateDiagram-AJRCARHV-C6Dhr3fY.js} +2 -2
  51. package/resources/fe-dist/assets/stateDiagram-v2-BHNVJYJU-BiSh2azE.js +2 -0
  52. package/resources/fe-dist/assets/terminal-settings-panel-CpnmWQtf.js +9 -0
  53. package/resources/fe-dist/assets/{timeline-definition-PNZ67QCA-BlMj8Fl1.js → timeline-definition-PNZ67QCA-jJ1iauQ0.js} +2 -2
  54. package/resources/fe-dist/assets/{vennDiagram-CIIHVFJN-DuGxwZiq.js → vennDiagram-CIIHVFJN-DLRoaoJ9.js} +2 -2
  55. package/resources/fe-dist/assets/{wardley-L42UT6IY-4VhWbg10.js → wardley-L42UT6IY-CykeHWp8.js} +2 -2
  56. package/resources/fe-dist/assets/{wardleyDiagram-YWT4CUSO-Bu4k6xIx.js → wardleyDiagram-YWT4CUSO-U22jzD8a.js} +2 -2
  57. package/resources/fe-dist/assets/{xychartDiagram-2RQKCTM6-Cv88IDWh.js → xychartDiagram-2RQKCTM6-CiXS9PJ2.js} +2 -2
  58. package/resources/fe-dist/fonts/generated/blex-mono/blex-mono-bold.woff2 +0 -0
  59. package/resources/fe-dist/fonts/generated/blex-mono/blex-mono-regular.woff2 +0 -0
  60. package/resources/fe-dist/fonts/generated/fira-code/fira-code-bold.woff2 +0 -0
  61. package/resources/fe-dist/fonts/generated/fira-code/fira-code-regular.woff2 +0 -0
  62. package/resources/fe-dist/fonts/generated/jetbrains-mono/jetbrains-mono-bold.woff2 +0 -0
  63. package/resources/fe-dist/fonts/generated/jetbrains-mono/jetbrains-mono-regular.woff2 +0 -0
  64. package/resources/fe-dist/fonts/generated/noto-sans-mono/noto-sans-mono-bold.woff2 +0 -0
  65. package/resources/fe-dist/fonts/generated/noto-sans-mono/noto-sans-mono-regular.woff2 +0 -0
  66. package/resources/fe-dist/fonts/generated/victor-mono/victor-mono-bold.woff2 +0 -0
  67. package/resources/fe-dist/fonts/generated/victor-mono/victor-mono-regular.woff2 +0 -0
  68. package/resources/fe-dist/fonts/generated/zed-mono/zed-mono-bold.woff2 +0 -0
  69. package/resources/fe-dist/fonts/generated/zed-mono/zed-mono-regular.woff2 +0 -0
  70. package/resources/fe-dist/index.html +2 -2
  71. package/resources/fe-dist/assets/DevicePage-fGI-do8S.js +0 -26
  72. package/resources/fe-dist/assets/DevicesPage-kGrzwhGj.js +0 -2
  73. package/resources/fe-dist/assets/architectureDiagram-3BPJPVTR-EOUpuRby.js +0 -37
  74. package/resources/fe-dist/assets/channel-DbG6qNF6.js +0 -2
  75. package/resources/fe-dist/assets/classDiagram-4FO5ZUOK-rB1DgxOZ.js +0 -2
  76. package/resources/fe-dist/assets/classDiagram-v2-Q7XG4LA2-rB1DgxOZ.js +0 -2
  77. package/resources/fe-dist/assets/cose-bilkent-S5V4N54A-BAyMopHS.js +0 -2
  78. package/resources/fe-dist/assets/ganttDiagram-6RSMTGT7-BM8Y7jwp.js +0 -293
  79. package/resources/fe-dist/assets/index-cfY8KuW7.js +0 -466
  80. package/resources/fe-dist/assets/index-vcS0VPIW.css +0 -1
  81. package/resources/fe-dist/assets/refresh-cw-cfX5JiIH.js +0 -7
  82. package/resources/fe-dist/assets/stateDiagram-v2-BHNVJYJU-CB5OePKf.js +0 -2
@@ -0,0 +1,488 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SettingsPage-BOTyBhHH.js","assets/card-BkRqR9zz.js","assets/terminal-settings-panel-CpnmWQtf.js","assets/markdown-preview-BlQiC8ND.js","assets/markdown-preview-Bf_6UH9R.css","assets/DevicesPage-C7THDzTX.js","assets/DevicePage-B0fQ6yWB.js","assets/FilePage-D8V8P2IA.js"])))=>i.map(i=>d[i]);
2
+ var HP=Object.defineProperty;var NT=e=>{throw TypeError(e)};var qP=(e,t,n)=>t in e?HP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var tt=(e,t,n)=>qP(e,typeof t!="symbol"?t+"":t,n),Jy=(e,t,n)=>t.has(e)||NT("Cannot "+n);var re=(e,t,n)=>(Jy(e,t,"read from private field"),n?n.call(e):t.get(e)),mt=(e,t,n)=>t.has(e)?NT("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Qe=(e,t,n,r)=>(Jy(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Ut=(e,t,n)=>(Jy(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 VP(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 $P="modulepreload",GP=function(e){return"/"+e},AT={},im=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=GP(d),d in AT)return;AT[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":$P,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 om(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var eb={exports:{}},Pu={};/**
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 DT;function YP(){if(DT)return Pu;DT=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 Pu.Fragment=t,Pu.jsx=n,Pu.jsxs=n,Pu}var _T;function KP(){return _T||(_T=1,eb.exports=YP()),eb.exports}var w=KP(),Ac=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(){}},WP={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Aa,Ux,IM,XP=(IM=class{constructor(){mt(this,Aa,WP);mt(this,Ux,!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,Ux=new WeakMap,IM),Ns=new XP;function QP(e){setTimeout(e,0)}var Ys=typeof window>"u"||"Deno"in globalThis;function kr(){}function ZP(e,t){return typeof e=="function"?e(t):e}function vv(e){return typeof e=="number"&&e>=0&&e!==1/0}function $M(e,t){return Math.max(e+(t||0)-Date.now(),0)}function qa(e,t){return typeof e=="function"?e(t):e}function wi(e,t){return typeof e=="function"?e(t):e}function IT(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:a,queryKey:l,stale:c}=e;if(l){if(r){if(t.queryHash!==Hx(l,t.options))return!1}else if(!wd(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 PT(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(!wd(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Hx(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ks)(e)}function Ks(e){return JSON.stringify(e,(t,n)=>xv(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function wd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>wd(e[n],t[n])):!1}var JP=Object.prototype.hasOwnProperty;function GM(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=LT(e)&&LT(t);if(!r&&!(xv(e)&&xv(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:JP.call(e,h))&&d++;continue}if(y===null||g===null||typeof y!="object"||typeof g!="object"){f[h]=g;continue}const x=GM(y,g,n+1);f[h]=x,x===y&&d++}return a===c&&d===a?e:f}function Tp(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 LT(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function xv(e){if(!jT(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!jT(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function jT(e){return Object.prototype.toString.call(e)==="[object Object]"}function eL(e){return new Promise(t=>{Ns.setTimeout(t,e)})}function wv(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?GM(e,t):t}function tL(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function nL(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var qx=Symbol();function YM(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===qx?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Vx(e,t){return typeof e=="function"?e(...t):!!e}function rL(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,uc,PM,iL=(PM=class extends Ac{constructor(){super();mt(this,Is);mt(this,Da);mt(this,uc);Qe(this,uc,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,uc))}onUnsubscribe(){var t;this.hasListeners()||((t=re(this,Da))==null||t.call(this),Qe(this,Da,void 0))}setEventListener(t){var n;Qe(this,uc,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,uc=new WeakMap,PM),$x=new iL;function Sv(){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 oL=QP;function aL(){let e=[],t=0,n=c=>{c()},r=c=>{c()},o=oL;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=aL(),dc,_a,fc,LM,sL=(LM=class extends Ac{constructor(){super();mt(this,dc,!0);mt(this,_a);mt(this,fc);Qe(this,fc,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,fc))}onUnsubscribe(){var t;this.hasListeners()||((t=re(this,_a))==null||t.call(this),Qe(this,_a,void 0))}setEventListener(t){var n;Qe(this,fc,t),(n=re(this,_a))==null||n.call(this),Qe(this,_a,t(this.setOnline.bind(this)))}setOnline(t){re(this,dc)!==t&&(Qe(this,dc,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return re(this,dc)}},dc=new WeakMap,_a=new WeakMap,fc=new WeakMap,LM),Rp=new sL;function lL(e){return Math.min(1e3*2**e,3e4)}function KM(e){return(e??"online")==="online"?Rp.isOnline():!0}var Ev=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function WM(e){let t=!1,n=0,r;const o=Sv(),a=()=>o.status!=="pending",l=E=>{var R;if(!a()){const T=new Ev(E);y(T),(R=e.onCancel)==null||R.call(e,T)}},c=()=>{t=!0},f=()=>{t=!1},d=()=>$x.isFocused()&&(e.networkMode==="always"||Rp.isOnline())&&e.canRun(),m=()=>KM(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??lL,M=typeof k=="function"?k(n,T):k,A=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,T);if(t||!A){y(T);return}n++,(O=e.onFail)==null||O.call(e,n,T),eL(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,jM,XM=(jM=class{constructor(){mt(this,Ps)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),vv(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,jM),Ls,hc,vi,js,ar,Fd,zs,zi,Lo,zM,cL=(zM=class extends XM{constructor(t){super();mt(this,zi);mt(this,Ls);mt(this,hc);mt(this,vi);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,vi,re(this,js).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Qe(this,Ls,FT(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=FT(this.options);n.data!==void 0&&(this.setState(zT(n.data,n.dataUpdatedAt)),Qe(this,Ls,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&re(this,vi).remove(this)}setData(t,n){const r=wv(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=>wi(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===qx||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:!$M(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,vi).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,vi).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(A=>A.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=YM(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,hc,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,WM({initialPromise:n==null?void 0:n.initialPromise,fn:c.fetchFn,onCancel:M=>{M instanceof Ev&&M.revert&&this.setState({...re(this,hc),fetchStatus:"idle"}),r.abort()},onFail:(M,A)=>{Ut(this,zi,Lo).call(this,{type:"failed",failureCount:M,error:A})},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,vi).config).onSuccess)==null||g.call(y,M,this),(E=(x=re(this,vi).config).onSettled)==null||E.call(x,M,this.state.error,this),M}catch(M){if(M instanceof Ev){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,vi).config).onError)==null||T.call(R,M,this),(k=(C=re(this,vi).config).onSettled)==null||k.call(C,this.state.data,M,this),M}finally{this.scheduleGc()}}},Ls=new WeakMap,hc=new WeakMap,vi=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,...QM(r.data,this.options),fetchMeta:t.meta??null};case"success":const o={...r,...zT(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Qe(this,hc,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,vi).notify({query:this,type:"updated",action:t})})},zM);function QM(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:KM(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function zT(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function FT(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 Fr,on,Bd,Cr,Fs,pc,Uo,Ia,Ud,mc,gc,Bs,Us,Pa,yc,gn,Qu,Tv,Rv,Cv,kv,Mv,Ov,Nv,ZM,FM,uL=(FM=class extends Ac{constructor(t,n){super();mt(this,gn);mt(this,Fr);mt(this,on);mt(this,Bd);mt(this,Cr);mt(this,Fs);mt(this,pc);mt(this,Uo);mt(this,Ia);mt(this,Ud);mt(this,mc);mt(this,gc);mt(this,Bs);mt(this,Us);mt(this,Pa);mt(this,yc,new Set);this.options=n,Qe(this,Fr,t),Qe(this,Ia,null),Qe(this,Uo,Sv()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(re(this,on).addObserver(this),BT(re(this,on),this.options)?Ut(this,gn,Qu).call(this):this.updateResult(),Ut(this,gn,kv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Av(re(this,on),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Av(re(this,on),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ut(this,gn,Mv).call(this),Ut(this,gn,Ov).call(this),re(this,on).removeObserver(this)}setOptions(t){const n=this.options,r=re(this,on);if(this.options=re(this,Fr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof wi(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,Nv).call(this),re(this,on).setOptions(this.options),n._defaulted&&!Tp(this.options,n)&&re(this,Fr).getQueryCache().notify({type:"observerOptionsUpdated",query:re(this,on),observer:this});const o=this.hasListeners();o&&UT(re(this,on),r,this.options,n)&&Ut(this,gn,Qu).call(this),this.updateResult(),o&&(re(this,on)!==r||wi(this.options.enabled,re(this,on))!==wi(n.enabled,re(this,on))||qa(this.options.staleTime,re(this,on))!==qa(n.staleTime,re(this,on)))&&Ut(this,gn,Tv).call(this);const a=Ut(this,gn,Rv).call(this);o&&(re(this,on)!==r||wi(this.options.enabled,re(this,on))!==wi(n.enabled,re(this,on))||a!==re(this,Pa))&&Ut(this,gn,Cv).call(this,a)}getOptimisticResult(t){const n=re(this,Fr).getQueryCache().build(re(this,Fr),t),r=this.createResult(n,t);return fL(this,r)&&(Qe(this,Cr,r),Qe(this,pc,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,yc).add(t)}getCurrentQuery(){return re(this,on)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=re(this,Fr).defaultQueryOptions(t),r=re(this,Fr).getQueryCache().build(re(this,Fr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Ut(this,gn,Qu).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,pc),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&&BT(t,n),P=F&&UT(t,r,n,o);(G||P)&&(h={...h,...QM(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,gc))==null?void 0:q.state.data,re(this,gc)):n.placeholderData,F!==void 0&&(R="success",g=wv(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,mc);else try{Qe(this,Ud,n.select),g=n.select(g),g=wv(a==null?void 0:a.data,g,n),Qe(this,mc,g),Qe(this,Ia,null)}catch(F){Qe(this,Ia,F)}re(this,Ia)&&(x=re(this,Ia),g=re(this,mc),E=Date.now(),R="error");const C=h.fetchStatus==="fetching",k=R==="pending",M=R==="error",A=k&&C,O=g!==void 0,_={status:R,fetchStatus:h.fetchStatus,isPending:k,isSuccess:R==="success",isError:M,isInitialLoading:A,isLoading:A,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:Gx(t,n),refetch:this.refetch,promise:re(this,Uo),isEnabled:wi(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=Sv());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,pc,this.options),re(this,Fs).data!==void 0&&Qe(this,gc,re(this,on)),Tp(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,yc).size)return!0;const l=new Set(a??re(this,yc));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,ZM).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ut(this,gn,kv).call(this)}},Fr=new WeakMap,on=new WeakMap,Bd=new WeakMap,Cr=new WeakMap,Fs=new WeakMap,pc=new WeakMap,Uo=new WeakMap,Ia=new WeakMap,Ud=new WeakMap,mc=new WeakMap,gc=new WeakMap,Bs=new WeakMap,Us=new WeakMap,Pa=new WeakMap,yc=new WeakMap,gn=new WeakSet,Qu=function(t){Ut(this,gn,Nv).call(this);let n=re(this,on).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(kr)),n},Tv=function(){Ut(this,gn,Mv).call(this);const t=qa(this.options.staleTime,re(this,on));if(Ys||re(this,Cr).isStale||!vv(t))return;const r=$M(re(this,Cr).dataUpdatedAt,t)+1;Qe(this,Bs,Ns.setTimeout(()=>{re(this,Cr).isStale||this.updateResult()},r))},Rv=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(re(this,on)):this.options.refetchInterval)??!1},Cv=function(t){Ut(this,gn,Ov).call(this),Qe(this,Pa,t),!(Ys||wi(this.options.enabled,re(this,on))===!1||!vv(re(this,Pa))||re(this,Pa)===0)&&Qe(this,Us,Ns.setInterval(()=>{(this.options.refetchIntervalInBackground||$x.isFocused())&&Ut(this,gn,Qu).call(this)},re(this,Pa)))},kv=function(){Ut(this,gn,Tv).call(this),Ut(this,gn,Cv).call(this,Ut(this,gn,Rv).call(this))},Mv=function(){re(this,Bs)&&(Ns.clearTimeout(re(this,Bs)),Qe(this,Bs,void 0))},Ov=function(){re(this,Us)&&(Ns.clearInterval(re(this,Us)),Qe(this,Us,void 0))},Nv=function(){const t=re(this,Fr).getQueryCache().build(re(this,Fr),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))},ZM=function(t){Qn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(re(this,Cr))}),re(this,Fr).getQueryCache().notify({query:re(this,on),type:"observerResultsUpdated"})})},FM);function dL(e,t){return wi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function BT(e,t){return dL(e,t)||e.state.data!==void 0&&Av(e,t,t.refetchOnMount)}function Av(e,t,n){if(wi(t.enabled,e)!==!1&&qa(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Gx(e,t)}return!1}function UT(e,t,n,r){return(e!==t||wi(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Gx(e,n)}function Gx(e,t){return wi(t.enabled,e)!==!1&&e.isStaleByTime(qa(t.staleTime,e))}function fL(e,t){return!Tp(e.getCurrentResult(),t)}function HT(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=>{rL(k,()=>t.signal,()=>E=!0)},T=YM(t.options,t.fetchOptions),C=async(k,M,A)=>{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:A?"backward":"forward",meta:t.options.meta};return R(G),G})(),_=await T(N),{maxPages:q}=t.options,F=A?nL:tL;return{pages:F(k.pages,_,q),pageParams:F(k.pageParams,M,q)}};if(o&&a.length){const k=o==="backward",M=k?hL:qT,A={pages:a,pageParams:l},O=M(r,A);c=await C(A,O,k)}else{const k=e??a.length;do{const M=f===0?l[0]??r.initialPageParam:qT(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 qT(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 hL(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,BM,pL=(BM=class extends XM{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||JM(),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,A,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,WM({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((A=(M=re(this,vr).config).onSettled)==null?void 0:A.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})})},BM);function JM(){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,UM,mL=(UM=class extends Ac{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 pL({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=>PT(n,r))}findAll(t={}){return this.getAll().filter(n=>PT(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,UM);function Mh(e){var t;return(t=e.options.scope)==null?void 0:t.id}var qo,La,Br,Vo,Go,ip,Dv,HM,gL=(HM=class extends Ac{constructor(n,r){super();mt(this,Go);mt(this,qo);mt(this,La);mt(this,Br);mt(this,Vo);Qe(this,qo,n),this.setOptions(r),this.bindMethods(),Ut(this,Go,ip).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),Tp(this.options,r)||re(this,qo).getMutationCache().notify({type:"observerOptionsUpdated",mutation:re(this,Br),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Ks(r.mutationKey)!==Ks(this.options.mutationKey)?this.reset():((o=re(this,Br))==null?void 0:o.state.status)==="pending"&&re(this,Br).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=re(this,Br))==null||n.removeObserver(this)}onMutationUpdate(n){Ut(this,Go,ip).call(this),Ut(this,Go,Dv).call(this,n)}getCurrentResult(){return re(this,La)}reset(){var n;(n=re(this,Br))==null||n.removeObserver(this),Qe(this,Br,void 0),Ut(this,Go,ip).call(this),Ut(this,Go,Dv).call(this)}mutate(n,r){var o;return Qe(this,Vo,r),(o=re(this,Br))==null||o.removeObserver(this),Qe(this,Br,re(this,qo).getMutationCache().build(re(this,qo),this.options)),re(this,Br).addObserver(this),re(this,Br).execute(n)}},qo=new WeakMap,La=new WeakMap,Br=new WeakMap,Vo=new WeakMap,Go=new WeakSet,ip=function(){var r;const n=((r=re(this,Br))==null?void 0:r.state)??JM();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})},Dv=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))})})},HM),no,qM,yL=(qM=class extends Ac{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??Hx(o,n);let l=this.get(a);return l||(l=new cL({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=>IT(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>IT(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,qM),Bn,ja,za,bc,vc,Fa,xc,wc,VM,bL=(VM=class{constructor(e={}){mt(this,Bn);mt(this,ja);mt(this,za);mt(this,bc);mt(this,vc);mt(this,Fa);mt(this,xc);mt(this,wc);Qe(this,Bn,e.queryCache||new yL),Qe(this,ja,e.mutationCache||new mL),Qe(this,za,e.defaultOptions||{}),Qe(this,bc,new Map),Qe(this,vc,new Map),Qe(this,Fa,0)}mount(){kh(this,Fa)._++,re(this,Fa)===1&&(Qe(this,xc,$x.subscribe(async e=>{e&&(await this.resumePausedMutations(),re(this,Bn).onFocus())})),Qe(this,wc,Rp.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,xc))==null||e.call(this),Qe(this,xc,void 0),(t=re(this,wc))==null||t.call(this),Qe(this,wc,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=ZP(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=HT(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(kr).catch(kr)}ensureInfiniteQueryData(e){return e.behavior=HT(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Rp.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,bc).set(Ks(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...re(this,bc).values()],n={};return t.forEach(r=>{wd(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){re(this,vc).set(Ks(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...re(this,vc).values()],n={};return t.forEach(r=>{wd(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=Hx(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===qx&&(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,bc=new WeakMap,vc=new WeakMap,Fa=new WeakMap,xc=new WeakMap,wc=new WeakMap,VM),tb={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 VT;function vL(){if(VT)return It;VT=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 A=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,A(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(A($))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 $T;function Vd(){return $T||($T=1,tb.exports=vL()),tb.exports}var v=Vd();const Fe=om(v),Yx=VP({__proto__:null,default:Fe},[v]);var e2=v.createContext(void 0),Qa=e=>{const t=v.useContext(e2);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},xL=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),w.jsx(e2.Provider,{value:e,children:t})),t2=v.createContext(!1),wL=()=>v.useContext(t2);t2.Provider;function SL(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var EL=v.createContext(SL()),TL=()=>v.useContext(EL),RL=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Vx(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},CL=e=>{v.useEffect(()=>{e.clearReset()},[e])},kL=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||Vx(n,[e.error,r])),ML=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))}},OL=(e,t)=>e.isLoading&&e.isFetching&&!t,NL=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,GT=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function AL(e,t,n){var y,g,x,E;const r=wL(),o=TL(),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",ML(l),RL(l,o,c),CL(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]),NL(l,m))throw GT(l,d,o);if(kL({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&&OL(m,r)){const R=f?GT(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 ai(e,t){return AL(e,uL)}function DL(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 Sd(e,t){const n=Qa(),[r]=v.useState(()=>new gL(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&&Vx(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:a,mutateAsync:o.mutate}}const _L={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:{keyboardBehavior:{title:"Keyboard Behavior",description:"How the page makes room for the on-screen keyboard",modeLift:"Shift page",modeLiftDesc:"Move the whole page up; terminal size stays the same",modeResize:"Resize terminal",modeResizeDesc:"Shrink the terminal to fit above the keyboard (changes the remote window size)",modeFollow:"Follow cursor",modeFollowDesc:"Shift just enough to keep the cursor right above the keyboard; terminal size stays the same"},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",terminal:"Terminal"},terminal:{title:"Terminal Settings",description:"Adjust the terminal font size, line height, family, and mobile keyboard avoidance. The font family applies to all monospaced text across the app.",fontSize:"Font Size",lineHeight:"Line Height",fontFamily:"Font",preview:"Preview",savedInBrowser:"These settings are saved in this browser only."},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:{keyboardBehavior:{title:"键盘行为",description:"选择手机键盘弹出时页面的避让方式",modeLift:"页面平移",modeLiftDesc:"键盘弹出时整页上移,终端大小不变",modeResize:"终端缩放",modeResizeDesc:"缩小终端铺满键盘上方区域(会调整远端窗口行数)",modeFollow:"光标对齐",modeFollowDesc:"按光标位置上移,光标始终在键盘正上方,终端大小不变"},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",terminal:"终端"},terminal:{title:"终端设置",description:"调整终端的字号、行高、字体与手机键盘避让行为。字体选择对全应用所有等宽文本生效。",fontSize:"字号",lineHeight:"行高",fontFamily:"字体",preview:"预览",savedInBrowser:"这些设置仅保存在当前浏览器中。"},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:{keyboardBehavior:{title:"キーボード動作",description:"ソフトウェアキーボード表示時のページの回避方法",modeLift:"ページ移動",modeLiftDesc:"キーボード表示時にページ全体を上に移動(端末サイズは不変)",modeResize:"端末リサイズ",modeResizeDesc:"キーボード上の領域に合わせて端末を縮小(リモートの行数が変わります)",modeFollow:"カーソル追従",modeFollowDesc:"カーソルがキーボードの真上に来るよう移動(端末サイズは不変)"},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",terminal:"ターミナル"},terminal:{title:"ターミナル設定",description:"ターミナルのフォントサイズ・行の高さ・フォント、モバイルのキーボード回避を調整します。フォントの選択はアプリ全体の等幅テキストに適用されます。",fontSize:"フォントサイズ",lineHeight:"行の高さ",fontFamily:"フォント",preview:"プレビュー",savedInBrowser:"これらの設定はこのブラウザにのみ保存されます。"},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:"元ファイルを開く"}}}},Kx="en_US",Cre={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 n2(e){return e.replace("_","-")}function IL(e,t){const n=(e==null?void 0:e.trim())||"unknown";return t?n:`${n}_dev`}var nb={},Rs={},Cs={},YT;function PL(){if(YT)return Cs;YT=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 rb={},KT;function LL(){return KT||(KT=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}})})(rb)),rb}var WT;function jL(){if(WT)return Rs;WT=1,Object.defineProperty(Rs,"__esModule",{value:!0}),Rs.b=Rs.Schema=void 0;const e=PL(),t=LL();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 XT;function zL(){return XT||(XT=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Schema=e.b=void 0;var t=jL();Object.defineProperty(e,"b",{enumerable:!0,get:function(){return t.b}}),Object.defineProperty(e,"Schema",{enumerable:!0,get:function(){return t.Schema}})})(nb)),nb}var se=zL();const FL=1,BL=2,UL=3,HL=4,qL=5,VL=257,$L=258,GL=259,YL=260,KL=261,WL=513,XL=514,QL=515,ZL=516,JL=517,ej=518,tj=519,nj=520,rj=522,ij=523,oj=524,aj=769,sj=770,lj=771,cj=772,uj=773,dj=774,fj=1025,hj=1026,pj=1281,mj=1537,gj=1538,yj=1539,bj=1793,vj=1,xj=2,wj=3,Sj=4,Ej=5,Tj=6,Rj=7,Cj=8,kj=9,Mj=10,Oj=11,Nj=12,Aj=13,Dj=1,_j=2,Ij=3,Pj=1001,ro=1002,Lj=1003,r2=1004,op=1005,jj=1101,zj=1102,Fj=1201,Bj=1202,Uj=1301,Hj=1302,qj=1401,Vj={[Pj]:"Unsupported protocol version",[ro]:"Invalid frame format",[Lj]:"Unknown message kind",[r2]:"Failed to decode payload",[op]:"Frame exceeds maximum size",[jj]:"Device not found",[zj]:"Failed to connect device",[Fj]:"Tmux target not found",[Bj]:"Tmux not ready",[Uj]:"Select conflict",[Hj]:"Select token mismatch",[qj]:"Internal server error"};function $j(e){return Vj[e]??`Unknown error code: ${e}`}class ri extends Error{constructor(t,n=!1,r){super(r??$j(t)),this.code=t,this.retryable=n,this.name="WsBorshError"}}const i2=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()}),Gj=se.b.option(se.b.u32()),Sc=se.b.option(se.b.u16()),Or=se.b.option(se.b.string()),Yj=se.b.struct({clientImpl:se.b.string(),clientVersion:se.b.string(),maxFrameBytes:se.b.u32(),supportsCompression:se.b.bool(),supportsDiffSnapshot:se.b.bool()}),Kj=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())}),Wj=se.b.struct({nonce:se.b.u32(),timeMs:se.b.u64()});se.b.struct({refSeq:Gj,code:se.b.u16(),message:se.b.string(),retryable:se.b.bool()});const Xj=se.b.struct({deviceId:se.b.string()}),Qj=se.b.struct({deviceId:se.b.string()}),Zj=se.b.struct({deviceId:se.b.string()}),Jj=se.b.struct({deviceId:se.b.string()}),ez=se.b.struct({deviceId:se.b.string(),eventType:se.b.u8(),errorType:Or,message:Or,rawMessage:Or}),tz=se.b.struct({deviceId:se.b.string(),windowId:Or,paneId:Or,selectToken:se.b.bytes(16),wantHistory:se.b.bool(),cols:Sc,rows:Sc}),nz=se.b.struct({deviceId:se.b.string(),windowId:se.b.string()}),rz=se.b.struct({deviceId:se.b.string(),name:Or}),iz=se.b.struct({deviceId:se.b.string(),windowId:se.b.string()}),oz=se.b.struct({deviceId:se.b.string(),paneId:se.b.string()}),az=se.b.struct({deviceId:se.b.string(),windowId:se.b.string(),name:se.b.string()}),sz=se.b.struct({deviceId:se.b.string(),style:se.b.string()}),lz=se.b.struct({deviceId:se.b.string(),windowIds:se.b.vec(se.b.string())}),cz=se.b.struct({deviceId:se.b.string(),windowId:se.b.string(),paneIds:se.b.vec(se.b.string())}),uz=se.b.struct({deviceId:se.b.string(),eventType:se.b.u8(),eventData:se.b.bytes()}),dz=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),encoding:se.b.u8(),data:se.b.bytes(),isComposing:se.b.bool()}),fz=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),encoding:se.b.u8(),data:se.b.bytes(),isComposing:se.b.bool()}),o2=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),cols:se.b.u16(),rows:se.b.u16()}),hz=o2,pz=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),encoding:se.b.u8(),data:se.b.bytes()}),mz=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()}),gz=se.b.struct({deviceId:se.b.string(),windowId:se.b.string(),paneId:se.b.string(),selectToken:se.b.bytes(16)}),yz=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),selectToken:se.b.bytes(16)}),a2=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()}),bz=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()}),vz=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(bz)}),xz=se.b.struct({id:se.b.string(),name:se.b.string(),windows:se.b.vec(vz)}),wz=se.b.struct({deviceId:se.b.string(),session:se.b.option(xz)});se.b.struct({deviceId:se.b.string(),baseRevision:se.b.u32(),revision:se.b.u32(),diffFormat:se.b.u8(),diffBytes:se.b.bytes()});const Sz=se.b.struct({sessionId:se.b.string()}),Ez=se.b.struct({sessionId:se.b.string()}),Tz=se.b.struct({sessionId:se.b.string(),seq:se.b.u32(),eventType:se.b.u8(),payload:se.b.bytes()}),Rz=se.b.struct({ruleId:se.b.string(),deviceId:se.b.string(),paneId:se.b.string(),eventType:se.b.u8(),payload:se.b.bytes()}),Cz=se.b.struct({windowId:se.b.string()}),kz=se.b.struct({windowId:se.b.string()}),Mz=se.b.struct({windowId:se.b.string(),name:se.b.string()}),Oz=se.b.struct({windowId:se.b.string()}),Nz=se.b.struct({paneId:se.b.string(),windowId:se.b.string()}),Az=se.b.struct({paneId:se.b.string()}),Dz=se.b.struct({windowId:se.b.string(),paneId:se.b.string()}),_z=se.b.struct({windowId:se.b.string(),layout:se.b.string()}),Iz=se.b.struct({windowId:Or,paneId:Or,windowIndex:Sc,paneIndex:Sc,paneUrl:Or}),Pz=se.b.struct({source:se.b.u8(),title:Or,body:se.b.string(),windowId:Or,paneId:Or,windowIndex:Sc,paneIndex:Sc,paneUrl:Or}),Ed=new Uint8Array([84,88]),Lz=1;function ap(e,t,n,r=0,o=Lz){const a={magic:Ed,version:o,kind:e,flags:r,seq:n,payload:t};return i2.serialize(a)}function nr(e,t){return e.serialize(t)}function jz(e){if(e.length<12)throw new ri(ro,!1,"Envelope too small");if(e[0]!==Ed[0]||e[1]!==Ed[1])throw new ri(ro,!1,"Invalid magic bytes");try{return i2.deserialize(e)}catch(t){throw new ri(ro,!1,t instanceof Error?t.message:"Failed to decode envelope")}}function Bo(e,t){try{return e.deserialize(t)}catch(n){throw new ri(r2,!1,n instanceof Error?n.message:"Failed to decode payload")}}function zz(e,t){const n=a2.serialize(e);return ap(1281,n,t)}function Fz(e){return a2.deserialize(e)}function Bz(e){return e.length>=2&&e[0]===Ed[0]&&e[1]===Ed[1]}const Uz=5e3,QT=100,_v=1e3;class Hz{constructor(){tt(this,"streams",new Map);tt(this,"lastCleanup",Date.now())}addChunk(t){if(this.cleanup(),t.totalChunks>_v)throw new ri(ro,!1,`Too many chunks: ${t.totalChunks} > ${_v}`);if(t.chunkIndex>=t.totalChunks)throw new ri(ro,!1,`Chunk index out of bounds: ${t.chunkIndex} >= ${t.totalChunks}`);let n=this.streams.get(t.chunkStreamId);if(!n){if(this.streams.size>=QT&&(this.cleanup(!0),this.streams.size>=QT))throw new ri(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 ri(ro,!1,"Chunk total count mismatch");if(n.chunks.has(t.chunkIndex))throw new ri(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 ri(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-Uz;for(const[o,a]of this.streams)a.createdAt<r&&this.streams.delete(o)}getActiveStreamCount(){return this.streams.size}clear(){this.streams.clear()}}function qz(e,t,n,r){const{maxFrameBytes:o,chunkStreamId:a}=r,l=16,c=18,f=o-l;if(f<=0)throw new ri(op,!1,`maxFrameBytes too small: ${o}`);if(e.length<=f)return{chunks:[],totalChunks:0};const d=o-l-c;if(d<=0)throw new ri(op,!1,`maxFrameBytes too small for chunking: ${o}`);const m=Math.ceil(e.length/d);if(m>_v)throw new ri(op,!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 ib=1;function Vz(){const e=ib;return ib=ib%4294967295+1,e}const $z={1:"osc9",2:"osc777",3:"osc1337",4:"osc99"};function Gz(e){const t=ez.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 Yz(e){const t=uz.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:Kz(r,t.eventData)}}function Kz(e,t){if(t.length===0)return{};try{switch(e){case"window-add":return Cz.deserialize(t);case"window-close":return kz.deserialize(t);case"window-renamed":return Mz.deserialize(t);case"window-active":return Oz.deserialize(t);case"pane-add":return Nz.deserialize(t);case"pane-close":return Az.deserialize(t);case"pane-active":return Dz.deserialize(t);case"layout-change":return _z.deserialize(t);case"bell":{const n=Iz.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=Pz.deserialize(t);return{source:$z[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 Wz(e){const t=wz.deserialize(e);return{deviceId:t.deviceId,session:t.session?Xz(t.session):null}}function Xz(e){return{id:e.id,name:e.name,windows:e.windows.map(Qz)}}function Qz(e){return{id:e.id,name:e.name,customName:e.customName??void 0,index:e.index,active:e.active,panes:e.panes.map(Zz)}}function Zz(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 ob={exports:{}},Lu={},ab={exports:{}},sb={};/**
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 ZT;function Jz(){return ZT||(ZT=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 A(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(A,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(A,$.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(A,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}}}})(sb)),sb}var JT;function e4(){return JT||(JT=1,ab.exports=Jz()),ab.exports}var lb={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 eR;function t4(){if(eR)return br;eR=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 tR;function s2(){if(tR)return lb.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(),lb.exports=t4(),lb.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 nR;function n4(){if(nR)return Lu;nR=1;var e=e4(),t=Vd(),n=s2();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 D=!1,Y=b.child;Y;){if(Y===u){D=!0,u=b,p=S;break}if(Y===p){D=!0,p=b,u=S;break}Y=Y.sibling}if(!D){for(Y=S.child;Y;){if(Y===u){D=!0,u=S,p=b;break}if(Y===p){D=!0,p=S,u=b;break}Y=Y.sibling}if(!D)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"),A=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 A: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)?JE(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=JE(s),i=eT(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=eT(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),Au._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(),D=S[0],Y=S[1];if(D&&Y){var ne=D.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,D=i.pingedLanes;i=i.warmLanes;var Y=p&134217727;return Y!==0?(p=Y&~S,p!==0?b=vt(p):(D&=Y,D!==0?b=vt(D):u||(u=Y&~i,u!==0&&(b=vt(u))))):(Y=p&~S,Y!==0?b=vt(Y):D!==0?b=vt(D):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 D=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=D&~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&~(D&~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:ET(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=sT(i);i!==null;){if(u=i[Ye])return u;i=sT(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 Ar(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,Yr={};function Ai(i,s){ci(i,s),ci(i+"Capture",s)}function ci(i,s){for(Yr[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(D){u=""+D,S.call(this,D)}}),Object.defineProperty(i,s,{enumerable:p.enumerable}),{getValue:function(){return u},setValue:function(D){u=""+D},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function Yc(i){if(!i._valueTracker){var s=ls(i)?"checked":"value";i._valueTracker=gf(i,s,""+i[s])}}function G0(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 L_=/[\n"\\]/g;function ui(i){return i.replace(L_,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Ym(i,s,u,p,b,S,D,Y){i.name="",D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?i.type=D:i.removeAttribute("type"),s!=null?D==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+nn(s)):i.value!==""+nn(s)&&(i.value=""+nn(s)):D!=="submit"&&D!=="reset"||i.removeAttribute("value"),s!=null?Km(i,D,nn(s)):u!=null?Km(i,D,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 Y0(i,s,u,p,b,S,D,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)){Yc(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,D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(i.name=D),Yc(i)}function Km(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 K0(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 W0(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),Yc(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 j_=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 X0(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||j_.has(s)?s==="float"?i.cssFloat=u:i[s]=(""+u).trim():i[s]=u+"px"}function Q0(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&&X0(i,b,p)}else for(var S in s)s.hasOwnProperty(S)&&X0(i,S,s[S])}function Wm(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 z_=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"]]),F_=/^[\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 F_.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function bo(){}var Xm=null;function Qm(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 Z0(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(Ym(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="'+ui(""+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));Ym(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&&G0(p)}break e;case"textarea":K0(i,u.value,u.defaultValue);break e;case"select":s=u.value,s!=null&&ll(i,!!u.multiple,s,!1)}}}var Zm=!1;function J0(i,s,u){if(Zm)return i(s,u);Zm=!0;try{var p=i(s);return p}finally{if(Zm=!1,(ul!==null||dl!==null)&&(oh(),ul&&(s=ul,i=dl,dl=ul=null,Z0(s),i)))for(s=0;s<i.length;s++)Z0(i[s])}}function Kc(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"),Jm=!1;if(vo)try{var Wc={};Object.defineProperty(Wc,"passive",{get:function(){Jm=!0}}),window.addEventListener("test",Wc,Wc),window.removeEventListener("test",Wc,Wc)}catch{Jm=!1}var ta=null,eg=null,vf=null;function eS(){if(vf)return vf;var i,s=eg,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 D=u-i;for(p=1;p<=D&&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 tS(){return!1}function Dr(i){function s(u,p,b,S,D){this._reactName=u,this._targetInst=b,this.type=p,this.nativeEvent=S,this.target=D,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:tS,this.isPropagationStopped=tS,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=Dr(cs),Xc=h({},cs,{view:0,detail:0}),B_=Dr(Xc),tg,ng,Qc,Ef=h({},Xc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ig,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!==Qc&&(Qc&&i.type==="mousemove"?(tg=i.screenX-Qc.screenX,ng=i.screenY-Qc.screenY):ng=tg=0,Qc=i),tg)},movementY:function(i){return"movementY"in i?i.movementY:ng}}),nS=Dr(Ef),U_=h({},Ef,{dataTransfer:0}),H_=Dr(U_),q_=h({},Xc,{relatedTarget:0}),rg=Dr(q_),V_=h({},cs,{animationName:0,elapsedTime:0,pseudoElement:0}),$_=Dr(V_),G_=h({},cs,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),Y_=Dr(G_),K_=h({},cs,{data:0}),rS=Dr(K_),W_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},X_={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"},Q_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Z_(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=Q_[i])?!!s[i]:!1}function ig(){return Z_}var J_=h({},Xc,{key:function(i){if(i.key){var s=W_[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"?X_[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ig,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}}),eI=Dr(J_),tI=h({},Ef,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),iS=Dr(tI),nI=h({},Xc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ig}),rI=Dr(nI),iI=h({},cs,{propertyName:0,elapsedTime:0,pseudoElement:0}),oI=Dr(iI),aI=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}),sI=Dr(aI),lI=h({},cs,{newState:0,oldState:0}),cI=Dr(lI),uI=[9,13,27,32],og=vo&&"CompositionEvent"in window,Zc=null;vo&&"documentMode"in document&&(Zc=document.documentMode);var dI=vo&&"TextEvent"in window&&!Zc,oS=vo&&(!og||Zc&&8<Zc&&11>=Zc),aS=" ",sS=!1;function lS(i,s){switch(i){case"keyup":return uI.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cS(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var fl=!1;function fI(i,s){switch(i){case"compositionend":return cS(s);case"keypress":return s.which!==32?null:(sS=!0,aS);case"textInput":return i=s.data,i===aS&&sS?null:i;default:return null}}function hI(i,s){if(fl)return i==="compositionend"||!og&&lS(i,s)?(i=eS(),vf=eg=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 oS&&s.locale!=="ko"?null:s.data;default:return null}}var pI={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 uS(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!pI[i.type]:s==="textarea"}function dS(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 Jc=null,eu=null;function mI(i){YE(i,0)}function Tf(i){var s=ir(i);if(G0(s))return i}function fS(i,s){if(i==="change")return s}var hS=!1;if(vo){var ag;if(vo){var sg="oninput"in document;if(!sg){var pS=document.createElement("div");pS.setAttribute("oninput","return;"),sg=typeof pS.oninput=="function"}ag=sg}else ag=!1;hS=ag&&(!document.documentMode||9<document.documentMode)}function mS(){Jc&&(Jc.detachEvent("onpropertychange",gS),eu=Jc=null)}function gS(i){if(i.propertyName==="value"&&Tf(eu)){var s=[];dS(s,eu,i,Qm(i)),J0(mI,s)}}function gI(i,s,u){i==="focusin"?(mS(),Jc=s,eu=u,Jc.attachEvent("onpropertychange",gS)):i==="focusout"&&mS()}function yI(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Tf(eu)}function bI(i,s){if(i==="click")return Tf(s)}function vI(i,s){if(i==="input"||i==="change")return Tf(s)}function xI(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var Kr=typeof Object.is=="function"?Object.is:xI;function tu(i,s){if(Kr(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)||!Kr(i[b],s[b]))return!1}return!0}function yS(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function bS(i,s){var u=yS(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=yS(u)}}function vS(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?vS(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function xS(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 lg(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 wI=vo&&"documentMode"in document&&11>=document.documentMode,hl=null,cg=null,nu=null,ug=!1;function wS(i,s,u){var p=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;ug||hl==null||hl!==yf(p)||(p=hl,"selectionStart"in p&&lg(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}),nu&&tu(nu,p)||(nu=p,p=fh(cg,"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")},dg={},SS={};vo&&(SS=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(dg[i])return dg[i];if(!pl[i])return i;var s=pl[i],u;for(u in s)if(s.hasOwnProperty(u)&&u in SS)return dg[i]=s[u];return i}var ES=ds("animationend"),TS=ds("animationiteration"),RS=ds("animationstart"),SI=ds("transitionrun"),EI=ds("transitionstart"),TI=ds("transitioncancel"),CS=ds("transitionend"),kS=new Map,fg="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(" ");fg.push("scrollEnd");function _i(i,s){kS.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)},di=[],ml=0,hg=0;function Cf(){for(var i=ml,s=hg=ml=0;s<i;){var u=di[s];di[s++]=null;var p=di[s];di[s++]=null;var b=di[s];di[s++]=null;var S=di[s];if(di[s++]=null,p!==null&&b!==null){var D=p.pending;D===null?b.next=b:(b.next=D.next,D.next=b),p.pending=b}S!==0&&MS(u,b,S)}}function kf(i,s,u,p){di[ml++]=i,di[ml++]=s,di[ml++]=u,di[ml++]=p,hg|=p,i.lanes|=p,i=i.alternate,i!==null&&(i.lanes|=p)}function pg(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 MS(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<Tu)throw Tu=0,Ey=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 RI(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 Wr(i,s,u,p){return new RI(i,s,u,p)}function mg(i){return i=i.prototype,!(!i||!i.isReactComponent)}function xo(i,s){var u=i.alternate;return u===null?(u=Wr(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 OS(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 D=0;if(p=i,typeof i=="function")mg(i)&&(D=1);else if(typeof i=="string")D=NP(i,u,Q.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case q:return i=Wr(31,u,s,b),i.elementType=q,i.lanes=S,i;case E:return hs(u.children,b,S,s);case R:D=8,b|=24;break;case T:return i=Wr(12,u,s,b|2),i.elementType=T,i.lanes=S,i;case A:return i=Wr(13,u,s,b),i.elementType=A,i.lanes=S,i;case O:return i=Wr(19,u,s,b),i.elementType=O,i.lanes=S,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case k:D=10;break e;case C:D=9;break e;case M:D=11;break e;case N:D=14;break e;case _:D=16,p=null;break e}D=29,u=Error(r(130,i===null?"null":typeof i,"")),p=null}return s=Wr(D,u,s,b),s.elementType=i,s.type=p,s.lanes=S,s}function hs(i,s,u,p){return i=Wr(7,i,p,s),i.lanes=u,i}function gg(i,s,u){return i=Wr(6,i,null,s),i.lanes=u,i}function NS(i){var s=Wr(18,null,null,0);return s.stateNode=i,s}function yg(i,s,u){return s=Wr(4,i.children!==null?i.children:[],i.key,s),s.lanes=u,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var AS=new WeakMap;function fi(i,s){if(typeof i=="object"&&i!==null){var u=AS.get(i);return u!==void 0?u:(s={value:i,source:s,stack:Ce(s)},AS.set(i,s),s)}return{value:i,source:s,stack:Ce(s)}}var yl=[],bl=0,Nf=null,ru=0,hi=[],pi=0,na=null,Ki=1,Wi="";function wo(i,s){yl[bl++]=ru,yl[bl++]=Nf,Nf=i,ru=s}function DS(i,s,u){hi[pi++]=Ki,hi[pi++]=Wi,hi[pi++]=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 D=b-b%5;S=(p&(1<<D)-1).toString(32),p>>=D,b-=D,Ki=1<<32-nt(s)+b|u<<b|p,Wi=S+i}else Ki=1<<S|u<<b|p,Wi=i}function bg(i){i.return!==null&&(wo(i,1),DS(i,1,0))}function vg(i){for(;i===Nf;)Nf=yl[--bl],yl[bl]=null,ru=yl[--bl],yl[bl]=null;for(;i===na;)na=hi[--pi],hi[pi]=null,Wi=hi[--pi],hi[pi]=null,Ki=hi[--pi],hi[pi]=null}function _S(i,s){hi[pi++]=Ki,hi[pi++]=Wi,hi[pi++]=na,Ki=s.id,Wi=s.overflow,na=i}var ur=null,Cn=null,rn=!1,ra=null,mi=!1,xg=Error(r(519));function ia(i){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw iu(fi(s,i)),xg}function IS(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<Cu.length;u++)Wt(Cu[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),Y0(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),W0(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||QE(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 PS(i){for(ur=i.return;ur;)switch(ur.tag){case 5:case 31:case 13:mi=!1;return;case 27:case 3:mi=!0;return;default:ur=ur.return}}function vl(i){if(i!==ur)return!1;if(!rn)return PS(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")||zy(i.type,i.memoizedProps)),u=!u),u&&Cn&&ia(i),PS(i),s===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Cn=aT(i)}else if(s===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Cn=aT(i)}else s===27?(s=Cn,ba(i.type)?(i=qy,qy=null,Cn=i):Cn=s):Cn=ur?yi(i.stateNode.nextSibling):null;return!0}function ps(){Cn=ur=null,rn=!1}function wg(){var i=ra;return i!==null&&(Lr===null?Lr=i:Lr.push.apply(Lr,i),ra=null),i}function iu(i){ra===null?ra=[i]:ra.push(i)}var Sg=$(null),ms=null,So=null;function oa(i,s,u){I(Sg,s._currentValue),s._currentValue=u}function Eo(i){i._currentValue=Sg.current,W(Sg)}function Eg(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 Tg(i,s,u,p){var b=i.child;for(b!==null&&(b.return=i);b!==null;){var S=b.dependencies;if(S!==null){var D=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),Eg(S.return,u,i),p||(D=null);break e}S=Y.next}}else if(b.tag===18){if(D=b.return,D===null)throw Error(r(341));D.lanes|=u,S=D.alternate,S!==null&&(S.lanes|=u),Eg(D,u,i),D=null}else D=b.child;if(D!==null)D.return=b;else for(D=b;D!==null;){if(D===i){D=null;break}if(b=D.sibling,b!==null){b.return=D.return,D=b;break}D=D.return}b=D}}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 D=b.alternate;if(D===null)throw Error(r(387));if(D=D.memoizedProps,D!==null){var Y=b.type;Kr(b.pendingProps.value,D.value)||(i!==null?i.push(Y):i=[Y])}}else if(b===Z.current){if(D=b.alternate,D===null)throw Error(r(387));D.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(i!==null?i.push(Au):i=[Au])}b=b.return}i!==null&&Tg(s,i,u,p),s.flags|=262144}function Af(i){for(i=i.firstContext;i!==null;){if(!Kr(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 LS(ms,i)}function Df(i,s){return ms===null&&gs(i),LS(i,s)}function LS(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 CI=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()})}},kI=e.unstable_scheduleCallback,MI=e.unstable_NormalPriority,Gn={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Rg(){return{controller:new CI,data:new Map,refCount:0}}function ou(i){i.refCount--,i.refCount===0&&kI(MI,function(){i.controller.abort()})}var au=null,Cg=0,wl=0,Sl=null;function OI(i,s){if(au===null){var u=au=[];Cg=0,wl=Oy(),Sl={status:"pending",value:void 0,then:function(p){u.push(p)}}}return Cg++,s.then(jS,jS),s}function jS(){if(--Cg===0&&au!==null){Sl!==null&&(Sl.status="fulfilled");var i=au;au=null,wl=0,Sl=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function NI(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 zS=j.S;j.S=function(i,s){wE=_e(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&OI(i,s),zS!==null&&zS(i,s)};var ys=$(null);function kg(){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 FS(){var i=kg();return i===null?null:{parent:Gn._currentValue,pool:i}}var El=Error(r(460)),Mg=Error(r(474)),If=Error(r(542)),Pf={then:function(){}};function BS(i){return i=i.status,i==="fulfilled"||i==="rejected"}function US(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,qS(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,qS(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 HS(){if(vs===null)throw Error(r(459));var i=vs;return vs=null,i}function qS(i){if(i===El||i===If)throw Error(r(483))}var Tl=null,su=0;function Lf(i){var s=su;return su+=1,Tl===null&&(Tl=[]),US(Tl,i,s)}function lu(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 VS(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 D(ce){return i&&ce.alternate===null&&(ce.flags|=67108866),ce}function Y(ce,ae,me,Ae){return ae===null||ae.tag!==6?(ae=gg(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"&&gt!==null&&gt.$$typeof===_&&bs(gt)===ae.type)?(ae=b(ae,me.props),lu(ae,me),ae.return=ce,ae):(ae=Of(me.type,me.key,me.props,null,ce.mode,Ae),lu(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=yg(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=gg(""+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),lu(me,ae),me.return=ce,me;case x:return ae=yg(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(UP){return s(ce,UP)}),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"&&gt!==null&&gt.$$typeof===_&&bs(gt)===ae.type){u(ce,ae.sibling),Ae=b(ae,me.props),lu(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),lu(Ae,me),Ae.return=ce,ce=Ae)}return D(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=yg(me,ce.mode,Ae),Ae.return=ce,ce=Ae}return D(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=gg(me,ce.mode,Ae),Ae.return=ce,ce=Ae),D(ce)):u(ce,ae)}return function(ce,ae,me,Ae){try{su=0;var gt=wn(ce,ae,me,Ae);return Tl=null,gt}catch(dt){if(dt===El||dt===If)throw dt;var un=Wr(29,dt,null,ce.mode);return un.lanes=Ae,un.return=ce,un}finally{}}}var xs=VS(!0),$S=VS(!1),aa=!1;function Og(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ng(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),MS(i,null,u),s}return kf(i,p,s,u),Mf(i)}function cu(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 Ag(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 D={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};S===null?b=S=D:S=S.next=D,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 Dg=!1;function uu(){if(Dg){var i=Sl;if(i!==null)throw i}}function du(i,s,u,p){Dg=!1;var b=i.updateQueue;aa=!1;var S=b.firstBaseUpdate,D=b.lastBaseUpdate,Y=b.shared.pending;if(Y!==null){b.shared.pending=null;var ne=Y,ge=ne.next;ne.next=null,D===null?S=ge:D.next=ge,D=ne;var Me=i.alternate;Me!==null&&(Me=Me.updateQueue,Y=Me.lastBaseUpdate,Y!==D&&(Y===null?Me.firstBaseUpdate=ge:Y.next=ge,Me.lastBaseUpdate=ne))}if(S!==null){var Ie=b.baseState;D=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&&(Dg=!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,D|=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|=D,i.lanes=D,i.memoizedState=Ie}}function GS(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function YS(i,s){var u=i.callbacks;if(u!==null)for(i.callbacks=null,i=0;i<u.length;i++)GS(u[i],s)}var Rl=$(null),zf=$(0);function KS(i,s){i=Do,I(zf,i),I(Rl,s),Do=i|s.baseLanes}function _g(){I(zf,Do),I(Rl,Rl.current)}function Ig(){Do=zf.current,W(Rl),W(zf)}var Xr=$(null),gi=null;function ca(i){var s=i.alternate;I(Vn,Vn.current&1),I(Xr,i),gi===null&&(s===null||Rl.current!==null||s.memoizedState!==null)&&(gi=i)}function Pg(i){I(Vn,Vn.current),I(Xr,i),gi===null&&(gi=i)}function WS(i){i.tag===22?(I(Vn,Vn.current),I(Xr,i),gi===null&&(gi=i)):ua()}function ua(){I(Vn,Vn.current),I(Xr,Xr.current)}function Qr(i){W(Xr),gi===i&&(gi=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||Uy(u)||Hy(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,fu=0,kl=null,AI=0;function zn(){throw Error(r(321))}function Lg(i,s){if(s===null)return!1;for(var u=0;u<s.length&&u<i.length;u++)if(!Kr(i[u],s[u]))return!1;return!0}function jg(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?D1:Zg,ws=!1,S=u(p,b),ws=!1,Cl&&(S=QS(s,u,p,b)),XS(i),S}function XS(i){j.H=mu;var s=vn!==null&&vn.next!==null;if(To=0,Yn=vn=jt=null,Bf=!1,fu=0,kl=null,s)throw Error(r(300));i===null||Kn||(i=i.dependencies,i!==null&&Af(i)&&(Kn=!0))}function QS(i,s,u,p){jt=i;var b=0;do{if(Cl&&(kl=null),fu=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=_1,S=s(u,p)}while(Cl);return S}function DI(){var i=j.H,s=i.useState()[0];return s=typeof s.then=="function"?hu(s):s,i=i.useState()[0],(vn!==null?vn.memoizedState:null)!==i&&(jt.flags|=1024),s}function zg(){var i=Uf!==0;return Uf=0,i}function Fg(i,s,u){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~u}function Bg(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,fu=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 hu(i){var s=fu;return fu+=1,kl===null&&(kl=[]),i=US(kl,i,s),s=jt,(Yn===null?s.memoizedState:Yn.next)===null&&(s=s.alternate,j.H=s===null||s.memoizedState===null?D1:Zg),i}function qf(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return hu(i);if(i.$$typeof===k)return dr(i)}throw Error(r(438,String(i)))}function Ug(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 Hg(s,vn,i)}function Hg(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 D=b.next;b.next=S.next,S.next=D}s.baseQueue=b=S,p.pending=null}if(S=i.baseState,b===null)i.memoizedState=S;else{s=b.next;var Y=D=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,D=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,D=S):ne=ne.next=be,jt.lanes|=Ie,ha|=Ie;ge=ge.next}while(ge!==null&&ge!==s);if(ne===null?D=S:ne.next=Y,!Kr(S,i.memoizedState)&&(Kn=!0,Me&&(u=Sl,u!==null)))throw u;i.memoizedState=S,i.baseState=D,i.baseQueue=ne,p.lastRenderedState=S}return b===null&&(p.lanes=0),[i.memoizedState,p.dispatch]}function qg(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 D=b=b.next;do S=i(S,D.action),D=D.next;while(D!==b);Kr(S,s.memoizedState)||(Kn=!0),s.memoizedState=S,s.baseQueue===null&&(s.baseState=S),u.lastRenderedState=S}return[S,p]}function ZS(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 D=!Kr((vn||b).memoizedState,u);if(D&&(b.memoizedState=u,Kn=!0),b=b.queue,Gg(t1.bind(null,p,b,i),[i]),b.getSnapshot!==s||D||Yn!==null&&Yn.memoizedState.tag&1){if(p.flags|=2048,Ml(9,{destroy:void 0},e1.bind(null,p,b,u,s),null),Sn===null)throw Error(r(349));S||(To&127)!==0||JS(p,s,u)}return u}function JS(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 e1(i,s,u,p){s.value=u,s.getSnapshot=p,n1(s)&&r1(i)}function t1(i,s,u){return u(function(){n1(s)&&r1(i)})}function n1(i){var s=i.getSnapshot;i=i.value;try{var u=s();return!Kr(i,u)}catch{return!0}}function r1(i){var s=fs(i,2);s!==null&&jr(s,i,2)}function Vg(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 i1(i,s,u,p){return i.baseState=u,Hg(i,vn,typeof p=="function"?p:Ro)}function _I(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(D){S.listeners.push(D)}};j.T!==null?u(!0):S.isTransition=!1,p(S),u=s.pending,u===null?(S.next=s.pending=S,o1(s,S)):(S.next=u.next,s.pending=u.next=S)}}function o1(i,s){var u=s.action,p=s.payload,b=i.state;if(s.isTransition){var S=j.T,D={};j.T=D;try{var Y=u(b,p),ne=j.S;ne!==null&&ne(D,Y),a1(i,s,Y)}catch(ge){$g(i,s,ge)}finally{S!==null&&D.types!==null&&(S.types=D.types),j.T=S}}else try{S=u(b,p),a1(i,s,S)}catch(ge){$g(i,s,ge)}}function a1(i,s,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(p){s1(i,s,p)},function(p){return $g(i,s,p)}):s1(i,s,u)}function s1(i,s,u){s.status="fulfilled",s.value=u,l1(s),i.state=u,s=i.pending,s!==null&&(u=s.next,u===s?i.pending=null:(u=u.next,s.next=u,o1(i,u)))}function $g(i,s,u){var p=i.pending;if(i.pending=null,p!==null){p=p.next;do s.status="rejected",s.reason=u,l1(s),s=s.next;while(s!==p)}i.action=null}function l1(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function c1(i,s){return s}function u1(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=mi;b.nodeType!==8;){if(!S){b=null;break t}if(b=yi(b.nextSibling),b===null){b=null;break t}}S=b.data,b=S==="F!"||S==="F"?b:null}if(b){Cn=yi(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:c1,lastRenderedState:s},u.queue=p,u=O1.bind(null,jt,p),p.dispatch=u,p=Vg(!1),S=Qg.bind(null,jt,!1,p.queue),p=Tr(),b={state:s,dispatch:null,action:i,pending:null},p.queue=b,u=_I.bind(null,jt,b,S,u),b.dispatch=u,p.memoizedState=i,[s,u,!1]}function d1(i){var s=$n();return f1(s,vn,i)}function f1(i,s,u){if(s=Hg(i,s,c1)[0],i=Vf(Ro)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var p=hu(s)}catch(D){throw D===El?If:D}else p=s;s=$n();var b=s.queue,S=b.dispatch;return u!==s.memoizedState&&(jt.flags|=2048,Ml(9,{destroy:void 0},II.bind(null,b,u),null)),[p,S,i]}function II(i,s){i.action=s}function h1(i){var s=$n(),u=vn;if(u!==null)return f1(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 p1(){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&&Lg(p,vn.memoizedState.deps)?b.memoizedState=Ml(s,S,u,p):(jt.flags|=i,b.memoizedState=Ml(1|s,S,u,p))}function m1(i,s){$f(8390656,8,i,s)}function Gg(i,s){Gf(2048,8,i,s)}function PI(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 g1(i){var s=$n().memoizedState;return PI({ref:s,nextImpl:i}),function(){if((pn&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function y1(i,s){return Gf(4,2,i,s)}function b1(i,s){return Gf(4,4,i,s)}function v1(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 x1(i,s,u){u=u!=null?u.concat([i]):null,Gf(4,4,v1.bind(null,s,i),u)}function Yg(){}function w1(i,s){var u=$n();s=s===void 0?null:s;var p=u.memoizedState;return s!==null&&Lg(s,p[1])?p[0]:(u.memoizedState=[i,s],i)}function S1(i,s){var u=$n();s=s===void 0?null:s;var p=u.memoizedState;if(s!==null&&Lg(s,p[1]))return p[0];if(p=i(),ws){Ze(!0);try{i()}finally{Ze(!1)}}return u.memoizedState=[p,s],p}function Kg(i,s,u){return u===void 0||(To&1073741824)!==0&&(Zt&261930)===0?i.memoizedState=s:(i.memoizedState=u,i=EE(),jt.lanes|=i,ha|=i,u)}function E1(i,s,u,p){return Kr(u,s)?u:Rl.current!==null?(i=Kg(i,u,p),Kr(i,s)||(Kn=!0),i):(To&42)===0||(To&1073741824)!==0&&(Zt&261930)===0?(Kn=!0,i.memoizedState=u):(i=EE(),jt.lanes|=i,ha|=i,s)}function T1(i,s,u,p,b){var S=z.p;z.p=S!==0&&8>S?S:8;var D=j.T,Y={};j.T=Y,Qg(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=NI(ne,p);pu(i,s,Me,ei(i))}else pu(i,s,p,ei(i))}catch(Ie){pu(i,s,{then:function(){},status:"rejected",reason:Ie},ei())}finally{z.p=S,D!==null&&Y.types!==null&&(D.types=Y.types),j.T=D}}function LI(){}function Wg(i,s,u,p){if(i.tag!==5)throw Error(r(476));var b=R1(i).queue;T1(i,b,s,V,u===null?LI:function(){return C1(i),u(p)})}function R1(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 C1(i){var s=R1(i);s.next===null&&(s=i.alternate.memoizedState),pu(i,s.next.queue,{},ei())}function Xg(){return dr(Au)}function k1(){return $n().memoizedState}function M1(){return $n().memoizedState}function jI(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var u=ei();i=sa(u);var p=la(s,i,u);p!==null&&(jr(p,s,u),cu(p,s,u)),s={cache:Rg()},i.payload=s;return}s=s.return}}function zI(i,s,u){var p=ei();u={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Yf(i)?N1(s,u):(u=pg(i,s,u,p),u!==null&&(jr(u,i,p),A1(u,s,p)))}function O1(i,s,u){var p=ei();pu(i,s,u,p)}function pu(i,s,u,p){var b={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Yf(i))N1(s,b);else{var S=i.alternate;if(i.lanes===0&&(S===null||S.lanes===0)&&(S=s.lastRenderedReducer,S!==null))try{var D=s.lastRenderedState,Y=S(D,u);if(b.hasEagerState=!0,b.eagerState=Y,Kr(Y,D))return kf(i,s,b,0),Sn===null&&Cf(),!1}catch{}finally{}if(u=pg(i,s,b,p),u!==null)return jr(u,i,p),A1(u,s,p),!0}return!1}function Qg(i,s,u,p){if(p={lane:2,revertLane:Oy(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Yf(i)){if(s)throw Error(r(479))}else s=pg(i,u,p,2),s!==null&&jr(s,i,2)}function Yf(i){var s=i.alternate;return i===jt||s!==null&&s===jt}function N1(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 A1(i,s,u){if((u&4194048)!==0){var p=s.lanes;p&=i.pendingLanes,u|=p,s.lanes=u,X(i,u)}}var mu={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};mu.useEffectEvent=zn;var D1={readContext:dr,use:qf,useCallback:function(i,s){return Tr().memoizedState=[i,s===void 0?null:s],i},useContext:dr,useEffect:m1,useImperativeHandle:function(i,s,u){u=u!=null?u.concat([i]):null,$f(4194308,4,v1.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=zI.bind(null,jt,i),[p.memoizedState,i]},useRef:function(i){var s=Tr();return i={current:i},s.memoizedState=i},useState:function(i){i=Vg(i);var s=i.queue,u=O1.bind(null,jt,s);return s.dispatch=u,[i.memoizedState,u]},useDebugValue:Yg,useDeferredValue:function(i,s){var u=Tr();return Kg(u,i,s)},useTransition:function(){var i=Vg(!1);return i=T1.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||JS(p,s,u)}b.memoizedState=u;var S={value:u,getSnapshot:s};return b.queue=S,m1(t1.bind(null,p,S,i),[i]),p.flags|=2048,Ml(9,{destroy:void 0},e1.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=AI++,s="_"+s+"r_"+u.toString(32)+"_";return i.memoizedState=s},useHostTransitionStatus:Xg,useFormState:u1,useActionState:u1,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=Qg.bind(null,jt,!0,u),u.dispatch=s,[i,s]},useMemoCache:Ug,useCacheRefresh:function(){return Tr().memoizedState=jI.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)}}},Zg={readContext:dr,use:qf,useCallback:w1,useContext:dr,useEffect:Gg,useImperativeHandle:x1,useInsertionEffect:y1,useLayoutEffect:b1,useMemo:S1,useReducer:Vf,useRef:p1,useState:function(){return Vf(Ro)},useDebugValue:Yg,useDeferredValue:function(i,s){var u=$n();return E1(u,vn.memoizedState,i,s)},useTransition:function(){var i=Vf(Ro)[0],s=$n().memoizedState;return[typeof i=="boolean"?i:hu(i),s]},useSyncExternalStore:ZS,useId:k1,useHostTransitionStatus:Xg,useFormState:d1,useActionState:d1,useOptimistic:function(i,s){var u=$n();return i1(u,vn,i,s)},useMemoCache:Ug,useCacheRefresh:M1};Zg.useEffectEvent=g1;var _1={readContext:dr,use:qf,useCallback:w1,useContext:dr,useEffect:Gg,useImperativeHandle:x1,useInsertionEffect:y1,useLayoutEffect:b1,useMemo:S1,useReducer:qg,useRef:p1,useState:function(){return qg(Ro)},useDebugValue:Yg,useDeferredValue:function(i,s){var u=$n();return vn===null?Kg(u,i,s):E1(u,vn.memoizedState,i,s)},useTransition:function(){var i=qg(Ro)[0],s=$n().memoizedState;return[typeof i=="boolean"?i:hu(i),s]},useSyncExternalStore:ZS,useId:k1,useHostTransitionStatus:Xg,useFormState:h1,useActionState:h1,useOptimistic:function(i,s){var u=$n();return vn!==null?i1(u,vn,i,s):(u.baseState=i,[i,u.queue.dispatch])},useMemoCache:Ug,useCacheRefresh:M1};_1.useEffectEvent=g1;function Jg(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 ey={enqueueSetState:function(i,s,u){i=i._reactInternals;var p=ei(),b=sa(p);b.payload=s,u!=null&&(b.callback=u),s=la(i,b,p),s!==null&&(jr(s,i,p),cu(s,i,p))},enqueueReplaceState:function(i,s,u){i=i._reactInternals;var p=ei(),b=sa(p);b.tag=1,b.payload=s,u!=null&&(b.callback=u),s=la(i,b,p),s!==null&&(jr(s,i,p),cu(s,i,p))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var u=ei(),p=sa(u);p.tag=2,s!=null&&(p.callback=s),s=la(i,p,u),s!==null&&(jr(s,i,u),cu(s,i,u))}};function I1(i,s,u,p,b,S,D){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(p,S,D):s.prototype&&s.prototype.isPureReactComponent?!tu(u,p)||!tu(b,S):!0}function P1(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&&ey.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 L1(i){Rf(i)}function j1(i){console.error(i)}function z1(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 F1(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 ty(i,s,u){return u=sa(u),u.tag=3,u.payload={element:null},u.callback=function(){Kf(i,s)},u}function B1(i){return i=sa(i),i.tag=3,i}function U1(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(){F1(s,u,p)}}var D=u.stateNode;D!==null&&typeof D.componentDidCatch=="function"&&(i.callback=function(){F1(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 FI(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=Xr.current,u!==null){switch(u.tag){case 31:case 13:return gi===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),Cy(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)),Cy(i,p,b)),!1}throw Error(r(435,u.tag))}return Cy(i,p,b),ah(),!1}if(rn)return s=Xr.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=b,p!==xg&&(i=Error(r(422),{cause:p}),iu(fi(i,u)))):(p!==xg&&(s=Error(r(423),{cause:p}),iu(fi(s,u))),i=i.current.alternate,i.flags|=65536,b&=-b,i.lanes|=b,p=fi(p,u),b=ty(i.stateNode,p,b),Ag(i,b),Fn!==4&&(Fn=2)),!1;var S=Error(r(520),{cause:p});if(S=fi(S,u),Eu===null?Eu=[S]:Eu.push(S),Fn!==4&&(Fn=2),s===null)return!0;p=fi(p,u),u=s;do{switch(u.tag){case 3:return u.flags|=65536,i=b&-b,u.lanes|=i,i=ty(u.stateNode,p,i),Ag(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=B1(b),U1(b,i,u,p),Ag(u,b),!1}u=u.return}while(u!==null);return!1}var ny=Error(r(461)),Kn=!1;function fr(i,s,u,p){s.child=i===null?$S(s,null,u,p):xs(s,i.child,u,p)}function H1(i,s,u,p,b){u=u.render;var S=s.ref;if("ref"in p){var D={};for(var Y in p)Y!=="ref"&&(D[Y]=p[Y])}else D=p;return gs(s),p=jg(i,s,u,D,S,b),Y=zg(),i!==null&&!Kn?(Fg(i,s,b),Co(i,s,b)):(rn&&Y&&bg(s),s.flags|=1,fr(i,s,p,b),s.child)}function q1(i,s,u,p,b){if(i===null){var S=u.type;return typeof S=="function"&&!mg(S)&&S.defaultProps===void 0&&u.compare===null?(s.tag=15,s.type=S,V1(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,!uy(i,b)){var D=S.memoizedProps;if(u=u.compare,u=u!==null?u:tu,u(D,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 V1(i,s,u,p,b){if(i!==null){var S=i.memoizedProps;if(tu(S,p)&&i.ref===s.ref)if(Kn=!1,s.pendingProps=p=S,uy(i,b))(i.flags&131072)!==0&&(Kn=!0);else return s.lanes=i.lanes,Co(i,s,b)}return ry(i,s,u,p,b)}function $1(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 G1(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?KS(s,S):_g(),WS(s);else return p=s.lanes=536870912,G1(i,s,S!==null?S.baseLanes|u:u,u,p)}else S!==null?(_f(s,S.cachePool),KS(s,S),ua(),s.memoizedState=null):(i!==null&&_f(s,null),_g(),ua());return fr(i,s,b,u),s.child}function gu(i,s){return i!==null&&i.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function G1(i,s,u,p,b){var S=kg();return S=S===null?null:{parent:Gn._currentValue,pool:S},s.memoizedState={baseLanes:u,cachePool:S},i!==null&&_f(s,null),_g(),WS(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 Y1(i,s,u){return xs(s,i.child,null,u),i=Wf(s,s.pendingProps),i.flags|=2,Qr(s),s.memoizedState=null,i}function BI(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,gu(null,i);if(Pg(s),(i=Cn)?(i=oT(i,mi),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=NS(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 D=S.dehydrated;if(Pg(s),b)if(s.flags&256)s.flags&=-257,s=Y1(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&&(D=ie(p,u),D!==0&&D!==S.retryLane))throw S.retryLane=D,fs(i,D),jr(p,i,D),ny;ah(),s=Y1(i,s,u)}else i=S.treeContext,Cn=yi(D.nextSibling),ur=s,rn=!0,ra=null,mi=!1,i!==null&&_S(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 ry(i,s,u,p,b){return gs(s),u=jg(i,s,u,p,void 0,b),p=zg(),i!==null&&!Kn?(Fg(i,s,b),Co(i,s,b)):(rn&&p&&bg(s),s.flags|=1,fr(i,s,u,b),s.child)}function K1(i,s,u,p,b,S){return gs(s),s.updateQueue=null,u=QS(s,p,u,b),XS(i),p=zg(),i!==null&&!Kn?(Fg(i,s,S),Co(i,s,S)):(rn&&p&&bg(s),s.flags|=1,fr(i,s,u,S),s.child)}function W1(i,s,u,p,b){if(gs(s),s.stateNode===null){var S=gl,D=u.contextType;typeof D=="object"&&D!==null&&(S=dr(D)),S=new u(p,S),s.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=ey,s.stateNode=S,S._reactInternals=s,S=s.stateNode,S.props=p,S.state=s.memoizedState,S.refs={},Og(s),D=u.contextType,S.context=typeof D=="object"&&D!==null?dr(D):gl,S.state=s.memoizedState,D=u.getDerivedStateFromProps,typeof D=="function"&&(Jg(s,u,D,p),S.state=s.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(D=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),D!==S.state&&ey.enqueueReplaceState(S,S.state,null),du(s,p,S,b),uu(),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;D=gl,typeof Me=="object"&&Me!==null&&(D=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!==D)&&P1(s,S,p,D),aa=!1;var be=s.memoizedState;S.state=be,du(s,p,S,b),uu(),ge=s.memoizedState,Y||be!==ge||aa?(typeof Ie=="function"&&(Jg(s,u,Ie,p),ge=s.memoizedState),(ne=aa||I1(s,u,ne,p,be,ge,D))?(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=D,p=ne):(typeof S.componentDidMount=="function"&&(s.flags|=4194308),p=!1)}else{S=s.stateNode,Ng(i,s),D=s.memoizedProps,Me=Ss(u,D),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"||(D!==Ie||be!==ne)&&P1(s,S,p,ne),aa=!1,be=s.memoizedState,S.state=be,du(s,p,S,b),uu();var we=s.memoizedState;D!==Ie||be!==we||aa||i!==null&&i.dependencies!==null&&Af(i.dependencies)?(typeof Y=="function"&&(Jg(s,u,Y,p),we=s.memoizedState),(Me=aa||I1(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"||D===i.memoizedProps&&be===i.memoizedState||(s.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||D===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"||D===i.memoizedProps&&be===i.memoizedState||(s.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||D===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 X1(i,s,u,p){return ps(),s.flags|=256,fr(i,s,u,p),s.child}var iy={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function oy(i){return{baseLanes:i,cachePool:FS()}}function ay(i,s,u){return i=i!==null?i.childLanes&~u:0,s&&(i|=Jr),i}function Q1(i,s,u){var p=s.pendingProps,b=!1,S=(s.flags&128)!==0,D;if((D=S)||(D=i!==null&&i.memoizedState===null?!1:(Vn.current&2)!==0),D&&(b=!0,s.flags&=-129),D=(s.flags&32)!==0,s.flags&=-33,i===null){if(rn){if(b?ca(s):ua(),(i=Cn)?(i=oT(i,mi),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=NS(i),u.return=s,s.child=u,ur=s,Cn=null)):i=null,i===null)throw ia(s);return Hy(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=oy(u),p.childLanes=ay(i,D,u),s.memoizedState=iy,gu(null,p)):(ca(s),sy(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=ly(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=oy(u),p.childLanes=ay(i,D,u),s.memoizedState=iy,s=gu(null,p));else if(ca(s),Hy(Y)){if(D=Y.nextSibling&&Y.nextSibling.dataset,D)var ge=D.dgst;D=ge,p=Error(r(419)),p.stack="",p.digest=D,iu({value:p,source:null,stack:null}),s=ly(i,s,u)}else if(Kn||xl(i,s,u,!1),D=(u&i.childLanes)!==0,Kn||D){if(D=Sn,D!==null&&(p=ie(D,u),p!==0&&p!==ne.retryLane))throw ne.retryLane=p,fs(i,p),jr(D,i,p),ny;Uy(Y)||ah(),s=ly(i,s,u)}else Uy(Y)?(s.flags|=192,s.child=i.child,s=null):(i=ne.treeContext,Cn=yi(Y.nextSibling),ur=s,rn=!0,ra=null,mi=!1,i!==null&&_S(s,i),s=sy(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,gu(null,p),p=s.child,Y=i.child.memoizedState,Y===null?Y=oy(u):(b=Y.cachePool,b!==null?(ne=Gn._currentValue,b=b.parent!==ne?{parent:ne,pool:ne}:b):b=FS(),Y={baseLanes:Y.baseLanes|u,cachePool:b}),p.memoizedState=Y,p.childLanes=ay(i,D,u),s.memoizedState=iy,gu(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&&(D=s.deletions,D===null?(s.deletions=[i],s.flags|=16):D.push(i)),s.child=u,s.memoizedState=null,u)}function sy(i,s){return s=Qf({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function Qf(i,s){return i=Wr(22,i,null,s),i.lanes=0,i}function ly(i,s,u){return xs(s,i.child,null,u),i=sy(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function Z1(i,s,u){i.lanes|=s;var p=i.alternate;p!==null&&(p.lanes|=s),Eg(i.return,s,u)}function cy(i,s,u,p,b,S){var D=i.memoizedState;D===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:p,tail:u,tailMode:b,treeForkCount:S}:(D.isBackwards=s,D.rendering=null,D.renderingStartTime=0,D.last=p,D.tail=u,D.tailMode=b,D.treeForkCount=S)}function J1(i,s,u){var p=s.pendingProps,b=p.revealOrder,S=p.tail;p=p.children;var D=Vn.current,Y=(D&2)!==0;if(Y?(D=D&1|2,s.flags|=128):D&=1,I(Vn,D),fr(i,s,p,u),p=rn?ru:0,!Y&&i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Z1(i,u,s);else if(i.tag===19)Z1(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),cy(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}cy(s,!0,u,null,S,p);break;case"together":cy(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 uy(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&Af(i)))}function UI(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,Pg(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?Q1(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 J1(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,$1(i,s,u,s.pendingProps);case 24:oa(s,Gn,i.memoizedState.cache)}return Co(i,s,u)}function eE(i,s,u){if(i!==null)if(i.memoizedProps!==s.pendingProps)Kn=!0;else{if(!uy(i,u)&&(s.flags&128)===0)return Kn=!1,UI(i,s,u);Kn=(i.flags&131072)!==0}else Kn=!1,rn&&(s.flags&1048576)!==0&&DS(s,ru,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")mg(i)?(p=Ss(i,p),s.tag=1,s=W1(null,s,i,p,u)):(s.tag=0,s=ry(null,s,i,p,u));else{if(i!=null){var b=i.$$typeof;if(b===M){s.tag=11,s=H1(null,s,i,p,u);break e}else if(b===N){s.tag=14,s=q1(null,s,i,p,u);break e}}throw s=H(i)||i,Error(r(306,s,""))}}return s;case 0:return ry(i,s,s.type,s.pendingProps,u);case 1:return p=s.type,b=Ss(p,s.pendingProps),W1(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,Ng(i,s),du(s,p,null,u);var D=s.memoizedState;if(p=D.cache,oa(s,Gn,p),p!==S.cache&&Tg(s,[Gn],u,!0),uu(),p=D.element,S.isDehydrated)if(S={element:p,isDehydrated:!1,cache:D.cache},s.updateQueue.baseState=S,s.memoizedState=S,s.flags&256){s=X1(i,s,p,u);break e}else if(p!==b){b=fi(Error(r(424)),s),iu(b),s=X1(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=yi(i.firstChild),ur=s,rn=!0,ra=null,mi=!0,u=$S(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=dT(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=dT(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return Se(s),i===null&&rn&&(p=s.stateNode=lT(s.type,s.pendingProps,oe.current),ur=s,mi=!0,b=Cn,ba(s.type)?(qy=b,Cn=yi(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=yP(p,s.type,s.pendingProps,mi),p!==null?(s.stateNode=p,ur=s,Cn=yi(p.firstChild),mi=!1,b=!0):b=!1),b||ia(s)),Se(s),b=s.type,S=s.pendingProps,D=i!==null?i.memoizedProps:null,p=S.children,zy(b,S)?p=null:D!==null&&zy(b,D)&&(s.flags|=32),s.memoizedState!==null&&(b=jg(i,s,DI,null,null,u),Au._currentValue=b),Xf(i,s),fr(i,s,p,u),s.child;case 6:return i===null&&rn&&((i=u=Cn)&&(u=bP(u,s.pendingProps,mi),u!==null?(s.stateNode=u,ur=s,Cn=null,i=!0):i=!1),i||ia(s)),null;case 13:return Q1(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 H1(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 q1(i,s,s.type,s.pendingProps,u);case 15:return V1(i,s,s.type,s.pendingProps,u);case 19:return J1(i,s,u);case 31:return BI(i,s,u);case 22:return $1(i,s,u,s.pendingProps);case 24:return gs(s),p=dr(Gn),i===null?(b=kg(),b===null&&(b=Sn,S=Rg(),b.pooledCache=S,S.refCount++,S!==null&&(b.pooledCacheLanes|=u),b=S),s.memoizedState={parent:p,cache:b},Og(s),oa(s,Gn,b)):((i.lanes&u)!==0&&(Ng(i,s),du(s,null,null,u),uu()),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&&Tg(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 dy(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(kE())i.flags|=8192;else throw vs=Pf,Mg}else i.flags&=-16777217}function tE(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!gT(s))if(kE())i.flags|=8192;else throw vs=Pf,Mg}function Zf(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?kt():536870912,i.lanes|=s,Dl|=s)}function yu(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 HI(i,s,u){var p=s.pendingProps;switch(vg(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,wg())),kn(s),null;case 26:var b=s.type,S=s.memoizedState;return i===null?(ko(s),S!==null?(kn(s),tE(s,S)):(kn(s),dy(s,b,null,p,u))):S?S!==i.memoizedState?(ko(s),kn(s),tE(s,S)):(kn(s),s.flags&=-16777217):(i=i.memoizedProps,i!==p&&ko(s),kn(s),dy(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)?IS(s):(i=lT(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))IS(s);else{var D=hh(oe.current);switch(S){case 1:S=D.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:S=D.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":S=D.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":S=D.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":S=D.createElement("div"),S.innerHTML="<script><\/script>",S=S.removeChild(S.firstChild);break;case"select":S=typeof p.is=="string"?D.createElement("select",{is:p.is}):D.createElement("select"),p.multiple?S.multiple=!0:p.size&&(S.size=p.size);break;default:S=typeof p.is=="string"?D.createElement(b,{is:p.is}):D.createElement(b)}}S[Ye]=s,S[Xe]=p;e:for(D=s.child;D!==null;){if(D.tag===5||D.tag===6)S.appendChild(D.stateNode);else if(D.tag!==4&&D.tag!==27&&D.child!==null){D.child.return=D,D=D.child;continue}if(D===s)break e;for(;D.sibling===null;){if(D.return===null||D.return===s)break e;D=D.return}D.sibling.return=D.return,D=D.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),dy(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||QE(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=wg(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=u),i=!0;if(!i)return s.flags&256?(Qr(s),s):(Qr(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=wg(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=b),b=!0;if(!b)return s.flags&256?(Qr(s),s):(Qr(s),null)}return Qr(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&&_y(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)yu(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,yu(p,!1),i=S.updateQueue,s.updateQueue=i,Zf(s,i),s.subtreeFlags=0,i=u,u=s.child;u!==null;)OS(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,yu(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),yu(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,yu(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 Qr(s),Ig(),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 qI(i,s){switch(vg(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(Qr(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(Qr(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 Qr(s),Ig(),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 nE(i,s){switch(vg(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&&Qr(s);break;case 13:Qr(s);break;case 19:W(Vn);break;case 10:Eo(s.type);break;case 22:case 23:Qr(s),Ig(),i!==null&&W(ys);break;case 24:Eo(Gn)}}function bu(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,D=u.inst;p=S(),D.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 D=p.inst,Y=D.destroy;if(Y!==void 0){D.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 rE(i){var s=i.updateQueue;if(s!==null){var u=i.stateNode;try{YS(s,u)}catch(p){bn(i,i.return,p)}}}function iE(i,s,u){u.props=Ss(i.type,i.memoizedProps),u.state=i.memoizedState;try{u.componentWillUnmount()}catch(p){bn(i,s,p)}}function vu(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 oE(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 fy(i,s,u){try{var p=i.stateNode;dP(p,i.type,u,s),p[Xe]=s}catch(b){bn(i,i.return,b)}}function aE(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&ba(i.type)||i.tag===4}function hy(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||aE(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 py(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(py(i,s,u),i=i.sibling;i!==null;)py(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 sE(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,my=!1,lE=typeof WeakSet=="function"?WeakSet:Set,or=null;function VI(i,s){if(i=i.containerInfo,Ly=xh,i=xS(i),lg(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 D=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=D+b),Ie!==S||p!==0&&Ie.nodeType!==3||(ne=D+p),Ie.nodeType===3&&(D+=Ie.nodeValue.length),(we=Ie.firstChild)!==null;)be=Ie,Ie=we;for(;;){if(Ie===i)break t;if(be===u&&++ge===b&&(Y=D),be===S&&++Me===p&&(ne=D),(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(jy={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)By(i);else if(u===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":By(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 cE(i,s,u){var p=u.flags;switch(u.tag){case 0:case 11:case 15:No(i,u),p&4&&bu(5,u);break;case 1:if(No(i,u),p&4)if(i=u.stateNode,s===null)try{i.componentDidMount()}catch(D){bn(u,u.return,D)}else{var b=Ss(u.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(b,s,i.__reactInternalSnapshotBeforeUpdate)}catch(D){bn(u,u.return,D)}}p&64&&rE(u),p&512&&vu(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{YS(i,s)}catch(D){bn(u,u.return,D)}}break;case 27:s===null&&p&4&&sE(u);case 26:case 5:No(i,u),s===null&&p&4&&oE(u),p&512&&vu(u,u.return);break;case 12:No(i,u);break;case 31:No(i,u),p&4&&fE(i,u);break;case 13:No(i,u),p&4&&hE(i,u),p&64&&(i=u.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(u=JI.bind(null,u),vP(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 uE(i){var s=i.alternate;s!==null&&(i.alternate=null,uE(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,_r=!1;function Oo(i,s,u){for(u=u.child;u!==null;)dE(i,s,u),u=u.sibling}function dE(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=_r;ba(u.type)&&(An=u.stateNode,_r=!1),Oo(i,s,u),Mu(u.stateNode),An=p,_r=b;break;case 5:Wn||Xi(u,s);case 6:if(p=An,b=_r,An=null,Oo(i,s,u),An=p,_r=b,An!==null)if(_r)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&&(_r?(i=An,rT(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,u.stateNode),Bl(i)):rT(An,u.stateNode));break;case 4:p=An,b=_r,An=u.stateNode.containerInfo,_r=!0,Oo(i,s,u),An=p,_r=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"&&iE(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 fE(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 hE(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 $I(i){switch(i.tag){case 31:case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new lE),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new lE),s;default:throw Error(r(435,i.tag))}}function eh(i,s){var u=$I(i);s.forEach(function(p){if(!u.has(p)){u.add(p);var b=eP.bind(null,i,p);p.then(b,b)}})}function Ir(i,s){var u=s.deletions;if(u!==null)for(var p=0;p<u.length;p++){var b=u[p],S=i,D=s,Y=D;e:for(;Y!==null;){switch(Y.tag){case 27:if(ba(Y.type)){An=Y.stateNode,_r=!1;break e}break;case 5:An=Y.stateNode,_r=!1;break e;case 3:case 4:An=Y.stateNode.containerInfo,_r=!0;break e}Y=Y.return}if(An===null)throw Error(r(160));dE(S,D,b),An=null,_r=!1,S=b.alternate,S!==null&&(S.return=null),b.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)pE(s,i),s=s.sibling}var Ii=null;function pE(i,s){var u=i.alternate,p=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Ir(s,i),Pr(i),p&4&&(da(3,i,i.return),bu(3,i),da(5,i,i.return));break;case 1:Ir(s,i),Pr(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(Ir(s,i),Pr(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 D=pT("link","href",b).get(p+(u.href||""));if(D){for(var Y=0;Y<D.length;Y++)if(S=D[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)){D.splice(Y,1);break t}}S=b.createElement(p),hr(S,p,u),b.head.appendChild(S);break;case"meta":if(D=pT("meta","content",b).get(p+(u.content||""))){for(Y=0;Y<D.length;Y++)if(S=D[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)){D.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 mT(b,i.type,i.stateNode);else i.stateNode=hT(b,p,i.memoizedProps);else S!==p?(S===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):S.count--,p===null?mT(b,i.type,i.stateNode):hT(b,p,i.memoizedProps)):p===null&&i.stateNode!==null&&fy(i,i.memoizedProps,u.memoizedProps)}break;case 27:Ir(s,i),Pr(i),p&512&&(Wn||u===null||Xi(u,u.return)),u!==null&&p&4&&fy(i,i.memoizedProps,u.memoizedProps);break;case 5:if(Ir(s,i),Pr(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,fy(i,b,u!==null?u.memoizedProps:b)),p&1024&&(my=!0);break;case 6:if(Ir(s,i),Pr(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),Ir(s,i),Ii=b,Pr(i),p&4&&u!==null&&u.memoizedState.isDehydrated)try{Bl(s.containerInfo)}catch(st){bn(i,i.return,st)}my&&(my=!1,mE(i));break;case 4:p=Ii,Ii=ph(i.stateNode.containerInfo),Ir(s,i),Pr(i),Ii=p;break;case 12:Ir(s,i),Pr(i);break;case 31:Ir(s,i),Pr(i),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,eh(i,p)));break;case 13:Ir(s,i),Pr(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,Ir(s,i),Wn=Me,Mo=ge,Pr(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)D=S.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.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?iT(we,!0):iT(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:Ir(s,i),Pr(i),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,eh(i,p)));break;case 30:break;case 21:break;default:Ir(s,i),Pr(i)}}function Pr(i){var s=i.flags;if(s&2){try{for(var u,p=i.return;p!==null;){if(aE(p)){u=p;break}p=p.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var b=u.stateNode,S=hy(i);Jf(i,S,b);break;case 5:var D=u.stateNode;u.flags&32&&(cl(D,""),u.flags&=-33);var Y=hy(i);Jf(i,Y,D);break;case 3:case 4:var ne=u.stateNode.containerInfo,ge=hy(i);py(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 mE(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;mE(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;)cE(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"&&iE(s,s.return,u),Es(s);break;case 27:Mu(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,D=S.flags;switch(S.tag){case 0:case 11:case 15:Ao(b,S,u),bu(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++)GS(ne[b],Y)}catch(ge){bn(p,p.return,ge)}}u&&D&64&&rE(S),vu(S,S.return);break;case 27:sE(S);case 26:case 5:Ao(b,S,u),u&&p===null&&D&4&&oE(S),vu(S,S.return);break;case 12:Ao(b,S,u);break;case 31:Ao(b,S,u),u&&D&4&&fE(b,S);break;case 13:Ao(b,S,u),u&&D&4&&hE(b,S);break;case 22:S.memoizedState===null&&Ao(b,S,u),vu(S,S.return);break;case 30:break;default:Ao(b,S,u)}s=s.sibling}}function gy(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&&ou(u))}function yy(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&ou(i))}function Pi(i,s,u,p){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)gE(i,s,u,p),s=s.sibling}function gE(i,s,u,p){var b=s.flags;switch(s.tag){case 0:case 11:case 15:Pi(i,s,u,p),b&2048&&bu(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&&ou(i)));break;case 12:if(b&2048){Pi(i,s,u,p),i=s.stateNode;try{var S=s.memoizedProps,D=S.id,Y=S.onPostCommit;typeof Y=="function"&&Y(D,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,D=s.alternate,s.memoizedState!==null?S._visibility&2?Pi(i,s,u,p):xu(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&&gy(D,s);break;case 24:Pi(i,s,u,p),b&2048&&yy(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,D=s,Y=u,ne=p,ge=D.flags;switch(D.tag){case 0:case 11:case 15:Ol(S,D,Y,ne,b),bu(8,D);break;case 23:break;case 22:var Me=D.stateNode;D.memoizedState!==null?Me._visibility&2?Ol(S,D,Y,ne,b):xu(S,D):(Me._visibility|=2,Ol(S,D,Y,ne,b)),b&&ge&2048&&gy(D.alternate,D);break;case 24:Ol(S,D,Y,ne,b),b&&ge&2048&&yy(D.alternate,D);break;default:Ol(S,D,Y,ne,b)}s=s.sibling}}function xu(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:xu(u,p),b&2048&&gy(p.alternate,p);break;case 24:xu(u,p),b&2048&&yy(p.alternate,p);break;default:xu(u,p)}s=s.sibling}}var wu=8192;function Nl(i,s,u){if(i.subtreeFlags&wu)for(i=i.child;i!==null;)yE(i,s,u),i=i.sibling}function yE(i,s,u){switch(i.tag){case 26:Nl(i,s,u),i.flags&wu&&i.memoizedState!==null&&AP(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=wu,wu=16777216,Nl(i,s,u),wu=p):Nl(i,s,u));break;default:Nl(i,s,u)}}function bE(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 Su(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,xE(p,i)}bE(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)vE(i),i=i.sibling}function vE(i){switch(i.tag){case 0:case 11:case 15:Su(i),i.flags&2048&&da(9,i,i.return);break;case 3:Su(i);break;case 12:Su(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)):Su(i);break;default:Su(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,xE(p,i)}bE(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 xE(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:ou(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(uE(p),p===u){or=null;break e}if(b!==null){b.return=S,or=b;break e}or=S}}}var GI={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}},YI=typeof WeakMap=="function"?WeakMap:Map,pn=0,Sn=null,Kt=null,Zt=0,yn=0,Zr=null,fa=!1,Al=!1,by=!1,Do=0,Fn=0,ha=0,Ts=0,vy=0,Jr=0,Dl=0,Eu=null,Lr=null,xy=!1,nh=0,wE=0,rh=1/0,ih=null,pa=null,Jn=0,ma=null,_l=null,_o=0,wy=0,Sy=null,SE=null,Tu=0,Ey=null;function ei(){return(pn&2)!==0&&Zt!==0?Zt&-Zt:j.T!==null?Oy():je()}function EE(){if(Jr===0)if((Zt&536870912)===0||rn){var i=ot;ot<<=1,(ot&3932160)===0&&(ot=262144),Jr=i}else Jr=536870912;return i=Xr.current,i!==null&&(i.flags|=32),Jr}function jr(i,s,u){(i===Sn&&(yn===2||yn===9)||i.cancelPendingCommit!==null)&&(Il(i,0),ga(i,Zt,Jr,!1)),qt(i,u),((pn&2)===0||i!==Sn)&&(i===Sn&&((pn&2)===0&&(Ts|=u),Fn===4&&ga(i,Zt,Jr,!1)),Qi(i))}function TE(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?XI(i,s):Ry(i,s,!0),S=p;do{if(b===0){Al&&!p&&ga(i,s,0,!1);break}else{if(u=i.current.alternate,S&&!KI(u)){b=Ry(i,s,!1),S=!1;continue}if(b===2){if(S=s,i.errorRecoveryDisabledLanes&S)var D=0;else D=i.pendingLanes&-536870913,D=D!==0?D:D&536870912?536870912:0;if(D!==0){s=D;e:{var Y=i;b=Eu;var ne=Y.current.memoizedState.isDehydrated;if(ne&&(Il(Y,D).flags|=256),D=Ry(Y,D,!1),D!==2){if(by&&!ne){Y.errorRecoveryDisabledLanes|=S,Ts|=S,b=4;break e}S=Lr,Lr=b,S!==null&&(Lr===null?Lr=S:Lr.push.apply(Lr,S))}b=D}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,Jr,!fa);break e;case 2:Lr=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,Jr,!fa),Ke(p,0,!0)!==0)break e;_o=s,p.timeoutHandle=tT(RE.bind(null,p,u,Lr,ih,xy,s,Jr,Ts,Dl,fa,S,"Throttled",-0,0),b);break e}RE(p,u,Lr,ih,xy,s,Jr,Ts,Dl,fa,S,null,-0,0)}}break}while(!0);Qi(i)}function RE(i,s,u,p,b,S,D,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},yE(s,S,Ie);var st=(S&62914560)===S?nh-_e():(S&4194048)===S?wE-_e():0;if(st=DP(Ie,st),st!==null){_o=S,i.cancelPendingCommit=st(_E.bind(null,i,s,S,u,p,b,D,Y,ne,Me,Ie,null,be,we)),ga(i,S,D,!ge);return}}_E(i,s,S,u,p,b,D,Y,ne)}function KI(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(!Kr(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&=~vy,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),D=1<<S;p[S]=-1,b&=~D}u!==0&&Ot(i,u,s)}function oh(){return(pn&6)===0?(Ru(0),!1):!0}function Ty(){if(Kt!==null){if(yn===0)var i=Kt.return;else i=Kt,So=ms=null,Bg(i),Tl=null,su=0,i=Kt;for(;i!==null;)nE(i.alternate,i),i=i.return;Kt=null}}function Il(i,s){var u=i.timeoutHandle;u!==-1&&(i.timeoutHandle=-1,pP(u)),u=i.cancelPendingCommit,u!==null&&(i.cancelPendingCommit=null,u()),_o=0,Ty(),Sn=i,Kt=u=xo(i.current,null),Zt=s,yn=0,Zr=null,fa=!1,Al=Mt(i,s),by=!1,Dl=Jr=vy=Ts=ha=Fn=0,Lr=Eu=null,xy=!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 CE(i,s){jt=null,j.H=mu,s===El||s===If?(s=HS(),yn=3):s===Mg?(s=HS(),yn=4):yn=s===ny?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,Zr=s,Kt===null&&(Fn=1,Kf(i,fi(s,i.current)))}function kE(){var i=Xr.current;return i===null?!0:(Zt&4194048)===Zt?gi===null:(Zt&62914560)===Zt||(Zt&536870912)!==0?i===gi:!1}function ME(){var i=j.H;return j.H=mu,i===null?mu:i}function OE(){var i=j.A;return j.A=GI,i}function ah(){Fn=4,fa||(Zt&4194048)!==Zt&&Xr.current!==null||(Al=!0),(ha&134217727)===0&&(Ts&134217727)===0||Sn===null||ga(Sn,Zt,Jr,!1)}function Ry(i,s,u){var p=pn;pn|=2;var b=ME(),S=OE();(Sn!==i||Zt!==s)&&(ih=null,Il(i,s)),s=!1;var D=Fn;e:do try{if(yn!==0&&Kt!==null){var Y=Kt,ne=Zr;switch(yn){case 8:Ty(),D=6;break e;case 3:case 2:case 9:case 6:Xr.current===null&&(s=!0);var ge=yn;if(yn=0,Zr=null,Pl(i,Y,ne,ge),u&&Al){D=0;break e}break;default:ge=yn,yn=0,Zr=null,Pl(i,Y,ne,ge)}}WI(),D=Fn;break}catch(Me){CE(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()),D}function WI(){for(;Kt!==null;)NE(Kt)}function XI(i,s){var u=pn;pn|=2;var p=ME(),b=OE();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=Zr;t:switch(yn){case 1:yn=0,Zr=null,Pl(i,s,S,1);break;case 2:case 9:if(BS(S)){yn=0,Zr=null,AE(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:BS(S)?(yn=0,Zr=null,AE(s)):(yn=0,Zr=null,Pl(i,s,S,7));break;case 5:var D=null;switch(Kt.tag){case 26:D=Kt.memoizedState;case 5:case 27:var Y=Kt;if(D?gT(D):Y.stateNode.complete){yn=0,Zr=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,Zr=null,Pl(i,s,S,5);break;case 6:yn=0,Zr=null,Pl(i,s,S,6);break;case 8:Ty(),Fn=6;break e;default:throw Error(r(462))}}QI();break}catch(Me){CE(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 QI(){for(;Kt!==null&&!Be();)NE(Kt)}function NE(i){var s=eE(i.alternate,i,Do);i.memoizedProps=i.pendingProps,s===null?sh(i):Kt=s}function AE(i){var s=i,u=s.alternate;switch(s.tag){case 15:case 0:s=K1(u,s,s.pendingProps,s.type,void 0,Zt);break;case 11:s=K1(u,s,s.pendingProps,s.type.render,s.ref,Zt);break;case 5:Bg(s);default:nE(u,s),s=Kt=OS(s,Do),s=eE(u,s,Do)}i.memoizedProps=i.pendingProps,s===null?sh(i):Kt=s}function Pl(i,s,u,p){So=ms=null,Bg(s),Tl=null,su=0;var b=s.return;try{if(FI(i,b,s,u,Zt)){Fn=1,Kf(i,fi(u,i.current)),Kt=null;return}}catch(S){if(b!==null)throw Kt=b,S;Fn=1,Kf(i,fi(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=Xr.current,p!==null&&p.tag===13&&(p.flags|=16384))),DE(s,i)):sh(s)}function sh(i){var s=i;do{if((s.flags&32768)!==0){DE(s,fa);return}i=s.return;var u=HI(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 DE(i,s){do{var u=qI(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 _E(i,s,u,p,b,S,D,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|=hg,Je(i,u,S,D,Y,ne),i===Sn&&(Kt=Sn=null,Zt=0),_l=s,ma=i,_o=u,wy=S,Sy=b,SE=p,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,tP(ee,function(){return zE(),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,D=pn,pn|=4;try{VI(i,s,u)}finally{pn=D,z.p=b,j.T=p}}Jn=1,IE(),PE(),LE()}}function IE(){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{pE(s,i);var S=jy,D=xS(i.containerInfo),Y=S.focusedElem,ne=S.selectionRange;if(D!==Y&&Y&&Y.ownerDocument&&vS(Y.ownerDocument.documentElement,Y)){if(ne!==null&&lg(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&&(D=wn,wn=wt,wt=D);var ce=bS(Y,wt),ae=bS(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=!!Ly,jy=Ly=null}finally{pn=b,z.p=p,j.T=u}}i.current=s,Jn=2}}function PE(){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{cE(i,s.alternate,s)}finally{pn=b,z.p=p,j.T=u}}Jn=3}}function LE(){if(Jn===4||Jn===3){Jn=0,Ve();var i=ma,s=_l,u=_o,p=SE;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?Jn=5:(Jn=0,_l=ma=null,jE(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,D=0;D<p.length;D++){var Y=p[D];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===Ey?Tu++:(Tu=0,Ey=i):Tu=0,Ru(0)}}function jE(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,ou(s)))}function lh(){return IE(),PE(),LE(),zE()}function zE(){if(Jn!==5)return!1;var i=ma,s=wy;wy=0;var u=ke(_o),p=j.T,b=z.p;try{z.p=32>u?32:u,j.T=null,u=Sy,Sy=null;var S=ma,D=_o;if(Jn=0,_l=ma=null,_o=0,(pn&6)!==0)throw Error(r(331));var Y=pn;if(pn|=4,vE(S.current),gE(S,S.current,D,u),pn=Y,Ru(0,!1),ze&&typeof ze.onPostCommitFiberRoot=="function")try{ze.onPostCommitFiberRoot(et,S)}catch{}return!0}finally{z.p=b,j.T=p,jE(i,s)}}function FE(i,s,u){s=fi(u,s),s=ty(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)FE(i,i,u);else for(;s!==null;){if(s.tag===3){FE(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=fi(u,i),u=B1(2),p=la(s,u,2),p!==null&&(U1(u,p,s,i),qt(p,2),Qi(p));break}}s=s.return}}function Cy(i,s,u){var p=i.pingCache;if(p===null){p=i.pingCache=new YI;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)||(by=!0,b.add(u),i=ZI.bind(null,i,s,u),s.then(i,i))}function ZI(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):vy|=u,Dl===Zt&&(Dl=0)),Qi(i)}function BE(i,s){s===0&&(s=kt()),i=fs(i,s),i!==null&&(qt(i,s),Qi(i))}function JI(i){var s=i.memoizedState,u=0;s!==null&&(u=s.retryLane),BE(i,u)}function eP(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),BE(i,u)}function tP(i,s){return Ee(i,s)}var ch=null,Ll=null,ky=!1,uh=!1,My=!1,ya=0;function Qi(i){i!==Ll&&i.next===null&&(Ll===null?ch=Ll=i:Ll=Ll.next=i),uh=!0,ky||(ky=!0,rP())}function Ru(i,s){if(!My&&uh){My=!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 D=p.suspendedLanes,Y=p.pingedLanes;S=(1<<31-nt(42|i)+1)-1,S&=b&~(D&~Y),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(u=!0,VE(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,VE(p,S));p=p.next}while(u);My=!1}}function nP(){UE()}function UE(){uh=ky=!1;var i=0;ya!==0&&hP()&&(i=ya);for(var s=_e(),u=null,p=ch;p!==null;){var b=p.next,S=HE(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||Ru(i),ya!==0&&(ya=0)}function HE(i,s){for(var u=i.suspendedLanes,p=i.pingedLanes,b=i.expirationTimes,S=i.pendingLanes&-62914561;0<S;){var D=31-nt(S),Y=1<<D,ne=b[D];ne===-1?((Y&u)===0||(Y&p)!==0)&&(b[D]=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=qE.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 qE(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:(TE(i,p,s),HE(i,_e()),i.callbackNode!=null&&i.callbackNode===u?qE.bind(null,i):null)}function VE(i,s){if(lh())return null;TE(i,s,!0)}function rP(){mP(function(){(pn&6)!==0?Ee(pe,nP):UE()})}function Oy(){if(ya===0){var i=wl;i===0&&(i=Dt,Dt<<=1,(Dt&261888)===0&&(Dt=256)),ya=i}return ya}function $E(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:bf(""+i)}function GE(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 iP(i,s,u,p,b){if(s==="submit"&&u&&u.stateNode===b){var S=$E((b[Xe]||null).action),D=p.submitter;D&&(s=(s=D[Xe]||null)?$E(s.formAction):D.getAttribute("formAction"),s!==null&&(S=s,D=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=D?GE(b,D):new FormData(b);Wg(u,{pending:!0,data:ne,method:b.method,action:S},null,ne)}}else typeof S=="function"&&(Y.preventDefault(),ne=D?GE(b,D):new FormData(b),Wg(u,{pending:!0,data:ne,method:b.method,action:S},S,ne))},currentTarget:b}]})}}for(var Ny=0;Ny<fg.length;Ny++){var Ay=fg[Ny],oP=Ay.toLowerCase(),aP=Ay[0].toUpperCase()+Ay.slice(1);_i(oP,"on"+aP)}_i(ES,"onAnimationEnd"),_i(TS,"onAnimationIteration"),_i(RS,"onAnimationStart"),_i("dblclick","onDoubleClick"),_i("focusin","onFocus"),_i("focusout","onBlur"),_i(SI,"onTransitionRun"),_i(EI,"onTransitionStart"),_i(TI,"onTransitionCancel"),_i(CS,"onTransitionEnd"),ci("onMouseEnter",["mouseout","mouseover"]),ci("onMouseLeave",["mouseout","mouseover"]),ci("onPointerEnter",["pointerout","pointerover"]),ci("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 Cu="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(" "),sP=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Cu));function YE(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 D=p.length-1;0<=D;D--){var Y=p[D],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(D=0;D<p.length;D++){if(Y=p[D],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)||(KE(s,i,2,!1),u.add(p))}function Dy(i,s,u){var p=0;s&&(p|=4),KE(u,i,p,s)}var dh="_reactListening"+Math.random().toString(36).slice(2);function _y(i){if(!i[dh]){i[dh]=!0,Ni.forEach(function(u){u!=="selectionchange"&&(sP.has(u)||Dy(u,!1,i),Dy(u,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[dh]||(s[dh]=!0,Dy("selectionchange",!1,s))}}function KE(i,s,u,p){switch(ET(s)){case 2:var b=PP;break;case 8:b=LP;break;default:b=Ky}u=b.bind(null,s,u,i),b=void 0,!Jm||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 Iy(i,s,u,p,b){var S=p;if((s&1)===0&&(s&2)===0&&p!==null)e:for(;;){if(p===null)return;var D=p.tag;if(D===3||D===4){var Y=p.stateNode.containerInfo;if(Y===b)break;if(D===4)for(D=p.return;D!==null;){var ne=D.tag;if((ne===3||ne===4)&&D.stateNode.containerInfo===b)return;D=D.return}for(;Y!==null;){if(D=jn(Y),D===null)return;if(ne=D.tag,ne===5||ne===6||ne===26||ne===27){p=S=D;continue e}Y=Y.parentNode}}p=p.return}J0(function(){var ge=S,Me=Qm(u),Ie=[];e:{var be=kS.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=eI;break;case"focusin":st="focus",we=rg;break;case"focusout":st="blur",we=rg;break;case"beforeblur":case"afterblur":we=rg;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=nS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":we=H_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":we=rI;break;case ES:case TS:case RS:we=$_;break;case CS:we=oI;break;case"scroll":case"scrollend":we=B_;break;case"wheel":we=sI;break;case"copy":case"cut":case"paste":we=Y_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":we=iS;break;case"toggle":case"beforetoggle":we=cI}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=Kc(ae,ce),Ae!=null&&wt.push(ku(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!==Xm&&(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=nS,Ae="onMouseLeave",ce="onMouseEnter",ae="mouse",(i==="pointerout"||i==="pointerover")&&(wt=iS,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=lP,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&&WE(Ie,be,we,wt,!1),st!==null&&wn!==null&&WE(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=fS;else if(uS(be))if(hS)un=vI;else{un=yI;var dt=gI}else we=be.nodeName,!we||we.toLowerCase()!=="input"||be.type!=="checkbox"&&be.type!=="radio"?ge&&Wm(ge.elementType)&&(un=fS):un=bI;if(un&&(un=un(i,ge))){dS(Ie,un,u,Me);break e}dt&&dt(i,be,ge),i==="focusout"&&ge&&be.type==="number"&&ge.memoizedProps.value!=null&&Km(be,"number",be.value)}switch(dt=ge?ir(ge):window,i){case"focusin":(uS(dt)||dt.contentEditable==="true")&&(hl=dt,cg=ge,nu=null);break;case"focusout":nu=cg=hl=null;break;case"mousedown":ug=!0;break;case"contextmenu":case"mouseup":case"dragend":ug=!1,wS(Ie,u,Me);break;case"selectionchange":if(wI)break;case"keydown":case"keyup":wS(Ie,u,Me)}var Ft;if(og)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?lS(i,u)&&(Jt="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(Jt="onCompositionStart");Jt&&(oS&&u.locale!=="ko"&&(fl||Jt!=="onCompositionStart"?Jt==="onCompositionEnd"&&fl&&(Ft=eS()):(ta=Me,eg="value"in ta?ta.value:ta.textContent,fl=!0)),dt=fh(ge,Jt),0<dt.length&&(Jt=new rS(Jt,i,null,u,Me),Ie.push({event:Jt,listeners:dt}),Ft?Jt.data=Ft:(Ft=cS(u),Ft!==null&&(Jt.data=Ft)))),(Ft=dI?fI(i,u):hI(i,u))&&(Jt=fh(ge,"onBeforeInput"),0<Jt.length&&(dt=new rS("onBeforeInput","beforeinput",null,u,Me),Ie.push({event:dt,listeners:Jt}),dt.data=Ft)),iP(Ie,i,ge,u,Me)}YE(Ie,s)})}function ku(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=Kc(i,u),b!=null&&p.unshift(ku(i,b,S)),b=Kc(i,s),b!=null&&p.push(ku(i,b,S))),i.tag===3)return p;i=i.return}return[]}function lP(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function WE(i,s,u,p,b){for(var S=s._reactName,D=[];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=Kc(u,S),ge!=null&&D.unshift(ku(u,ge,ne))):b||(ge=Kc(u,S),ge!=null&&D.push(ku(u,ge,ne)))),u=u.return}D.length!==0&&i.push({event:s,listeners:D})}var cP=/\r\n?/g,uP=/\u0000|\uFFFD/g;function XE(i){return(typeof i=="string"?i:""+i).replace(cP,`
65
+ `).replace(uP,"")}function QE(i,s){return s=XE(s),XE(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":Q0(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=z_.get(u)||u,qn(i,u,p))}}function Py(i,s,u,p,b,S){switch(u){case"style":Q0(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(!Yr.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 D=u[S];if(D!=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,D,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=D=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":D=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)}}Y0(i,S,Y,ne,ge,D,b,!1);return;case"select":Wt("invalid",i),p=D=S=null;for(b in u)if(u.hasOwnProperty(b)&&(Y=u[b],Y!=null))switch(b){case"value":S=Y;break;case"defaultValue":D=Y;break;case"multiple":p=Y;default:xn(i,s,b,Y,u,null)}s=S,u=D,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(D in u)if(u.hasOwnProperty(D)&&(Y=u[D],Y!=null))switch(D){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,D,Y,u,null)}W0(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<Cu.length;p++)Wt(Cu[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(Wm(s)){for(Me in u)u.hasOwnProperty(Me)&&(p=u[Me],p!==void 0&&Py(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 dP(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,D=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":D=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)}}Ym(i,D,Y,ne,ge,Me,S,b);return;case"select":we=D=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":D=S;default:S!==ne&&xn(i,s,b,S,p,ne)}s=Y,u=D,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(D in p)if(b=p[D],S=u[D],p.hasOwnProperty(D)&&(b!=null||S!=null))switch(D){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,D,b,p,S)}K0(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(Wm(s)){for(var wn in u)be=u[wn],u.hasOwnProperty(wn)&&be!==void 0&&!p.hasOwnProperty(wn)&&Py(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||Py(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 ZE(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function fP(){if(typeof performance.getEntriesByType=="function"){for(var i=0,s=0,u=performance.getEntriesByType("resource"),p=0;p<u.length;p++){var b=u[p],S=b.transferSize,D=b.initiatorType,Y=b.duration;if(S&&Y&&ZE(D)){for(D=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&&ZE(Ie)&&(ne=ne.responseEnd,D+=Me*(ne<Y?1:(Y-ge)/(ne-ge)))}if(--p,s+=8*(S+D)/(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 Ly=null,jy=null;function hh(i){return i.nodeType===9?i:i.ownerDocument}function JE(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 eT(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 zy(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 Fy=null;function hP(){var i=window.event;return i&&i.type==="popstate"?i===Fy?!1:(Fy=i,!0):(Fy=null,!1)}var tT=typeof setTimeout=="function"?setTimeout:void 0,pP=typeof clearTimeout=="function"?clearTimeout:void 0,nT=typeof Promise=="function"?Promise:void 0,mP=typeof queueMicrotask=="function"?queueMicrotask:typeof nT<"u"?function(i){return nT.resolve(null).then(i).catch(gP)}:tT;function gP(i){setTimeout(function(){throw i})}function ba(i){return i==="head"}function rT(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")Mu(i.ownerDocument.documentElement);else if(u==="head"){u=i.ownerDocument.head,Mu(u);for(var S=u.firstChild;S;){var D=S.nextSibling,Y=S.nodeName;S[_n]||Y==="SCRIPT"||Y==="STYLE"||Y==="LINK"&&S.rel.toLowerCase()==="stylesheet"||u.removeChild(S),S=D}}else u==="body"&&Mu(i.ownerDocument.body);u=b}while(u);Bl(s)}function iT(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 By(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":By(u),Ln(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}i.removeChild(u)}}function yP(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=yi(i.nextSibling),i===null)break}return null}function bP(i,s,u){if(s==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!u||(i=yi(i.nextSibling),i===null))return null;return i}function oT(i,s){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!s||(i=yi(i.nextSibling),i===null))return null;return i}function Uy(i){return i.data==="$?"||i.data==="$~"}function Hy(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function vP(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 yi(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 qy=null;function aT(i){i=i.nextSibling;for(var s=0;i;){if(i.nodeType===8){var u=i.data;if(u==="/$"||u==="/&"){if(s===0)return yi(i.nextSibling);s--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||s++}i=i.nextSibling}return null}function sT(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 lT(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 Mu(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);Ln(i)}var bi=new Map,cT=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:xP,r:wP,D:SP,C:EP,L:TP,m:RP,X:kP,S:CP,M:MP};function xP(){var i=Io.f(),s=oh();return i||s}function wP(i){var s=en(i);s!==null&&s.tag===5&&s.type==="form"?C1(s):Io.r(i)}var jl=typeof document>"u"?null:document;function uT(i,s,u){var p=jl;if(p&&typeof s=="string"&&s){var b=ui(s);b='link[rel="'+i+'"][href="'+b+'"]',typeof u=="string"&&(b+='[crossorigin="'+u+'"]'),cT.has(b)||(cT.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 SP(i){Io.D(i),uT("dns-prefetch",i,null)}function EP(i,s){Io.C(i,s),uT("preconnect",i,s)}function TP(i,s,u){Io.L(i,s,u);var p=jl;if(p&&i&&s){var b='link[rel="preload"][as="'+ui(s)+'"]';s==="image"&&u&&u.imageSrcSet?(b+='[imagesrcset="'+ui(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(b+='[imagesizes="'+ui(u.imageSizes)+'"]')):b+='[href="'+ui(i)+'"]';var S=b;switch(s){case"style":S=zl(i);break;case"script":S=Fl(i)}bi.has(S)||(i=h({rel:"preload",href:s==="image"&&u&&u.imageSrcSet?void 0:i,as:s},u),bi.set(S,i),p.querySelector(b)!==null||s==="style"&&p.querySelector(Ou(S))||s==="script"&&p.querySelector(Nu(S))||(s=p.createElement("link"),hr(s,"link",i),Nn(s),p.head.appendChild(s)))}}function RP(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="'+ui(p)+'"][href="'+ui(i)+'"]',S=b;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=Fl(i)}if(!bi.has(S)&&(i=h({rel:"modulepreload",href:i},s),bi.set(S,i),u.querySelector(b)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Nu(S)))return}p=u.createElement("link"),hr(p,"link",i),Nn(p),u.head.appendChild(p)}}}function CP(i,s,u){Io.S(i,s,u);var p=jl;if(p&&i){var b=Ar(p).hoistableStyles,S=zl(i);s=s||"default";var D=b.get(S);if(!D){var Y={loading:0,preload:null};if(D=p.querySelector(Ou(S)))Y.loading=5;else{i=h({rel:"stylesheet",href:i,"data-precedence":s},u),(u=bi.get(S))&&Vy(i,u);var ne=D=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(D,s,p)}D={type:"stylesheet",instance:D,count:1,state:Y},b.set(S,D)}}}function kP(i,s){Io.X(i,s);var u=jl;if(u&&i){var p=Ar(u).hoistableScripts,b=Fl(i),S=p.get(b);S||(S=u.querySelector(Nu(b)),S||(i=h({src:i,async:!0},s),(s=bi.get(b))&&$y(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 MP(i,s){Io.M(i,s);var u=jl;if(u&&i){var p=Ar(u).hoistableScripts,b=Fl(i),S=p.get(b);S||(S=u.querySelector(Nu(b)),S||(i=h({src:i,async:!0,type:"module"},s),(s=bi.get(b))&&$y(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 dT(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=Ar(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=Ar(b).hoistableStyles,D=S.get(i);if(D||(b=b.ownerDocument||b,D={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(i,D),(S=b.querySelector(Ou(i)))&&!S._p&&(D.instance=S,D.state.loading=5),bi.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},bi.set(i,u),S||OP(b,i,u,D.state))),s&&p===null)throw Error(r(528,""));return D}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=Ar(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="'+ui(i)+'"'}function Ou(i){return'link[rel="stylesheet"]['+i+"]"}function fT(i){return h({},i,{"data-precedence":i.precedence,precedence:null})}function OP(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="'+ui(i)+'"]'}function Nu(i){return"script[async]"+i}function hT(i,s,u){if(s.count++,s.instance===null)switch(s.type){case"style":var p=i.querySelector('style[data-href~="'+ui(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(Ou(b));if(S)return s.state.loading|=4,s.instance=S,Nn(S),S;p=fT(u),(b=bi.get(b))&&Vy(p,b),S=(i.ownerDocument||i).createElement("link"),Nn(S);var D=S;return D._p=new Promise(function(Y,ne){D.onload=Y,D.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(Nu(S)))?(s.instance=b,Nn(b),b):(p=u,(b=bi.get(S))&&(p=h({},u),$y(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,D=0;D<p.length;D++){var Y=p[D];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 Vy(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function $y(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 pT(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 D=S.getAttribute(s)||"";D=i+D;var Y=p.get(D);Y?Y.push(S):p.set(D,[S])}}return p}function mT(i,s,u){i=i.ownerDocument||i,i.head.insertBefore(u,s==="title"?i.querySelector("head > title"):null)}function NP(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 gT(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function AP(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(Ou(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=fT(p),(b=bi.get(b))&&Vy(p,b),S=S.createElement("link"),Nn(S);var D=S;D._p=new Promise(function(Y,ne){D.onload=Y,D.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 Gy=0;function DP(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&&Gy===0&&(Gy=62500*fP());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>Gy?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(_P,i),bh=null,yh.call(i))}function _P(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 D=b[S];(D.nodeName==="LINK"||D.getAttribute("media")!=="not all")&&(u.set(D.dataset.precedence,D),p=D)}p&&u.set(null,p)}b=s.instance,D=b.getAttribute("data-precedence"),S=u.get(D)||p,S===p&&u.set(null,b),u.set(D,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 Au={$$typeof:k,Provider:null,Consumer:null,_currentValue:V,_currentValue2:V,_threadCount:0};function IP(i,s,u,p,b,S,D,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=D,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ne,this.incompleteTransitions=new Map}function yT(i,s,u,p,b,S,D,Y,ne,ge,Me,Ie){return i=new IP(i,s,u,D,ne,ge,Me,Ie,Y),s=1,S===!0&&(s|=24),S=Wr(3,null,null,s),i.current=S,S.stateNode=i,s=Rg(),s.refCount++,i.pooledCache=s,s.refCount++,S.memoizedState={element:p,isDehydrated:u,cache:s},Og(S),i}function bT(i){return i?(i=gl,i):gl}function vT(i,s,u,p,b,S){b=bT(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&&(jr(u,i,s),cu(u,i,s))}function xT(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<s?u:s}}function Yy(i,s){xT(i,s),(i=i.alternate)&&xT(i,s)}function wT(i){if(i.tag===13||i.tag===31){var s=fs(i,67108864);s!==null&&jr(s,i,67108864),Yy(i,67108864)}}function ST(i){if(i.tag===13||i.tag===31){var s=ei();s=de(s);var u=fs(i,s);u!==null&&jr(u,i,s),Yy(i,s)}}var xh=!0;function PP(i,s,u,p){var b=j.T;j.T=null;var S=z.p;try{z.p=2,Ky(i,s,u,p)}finally{z.p=S,j.T=b}}function LP(i,s,u,p){var b=j.T;j.T=null;var S=z.p;try{z.p=8,Ky(i,s,u,p)}finally{z.p=S,j.T=b}}function Ky(i,s,u,p){if(xh){var b=Wy(p);if(b===null)Iy(i,s,p,wh,u),TT(i,p);else if(zP(b,i,s,u,p))p.stopPropagation();else if(TT(i,p),s&4&&-1<jP.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 D=vt(S.pendingLanes);if(D!==0){var Y=S;for(Y.pendingLanes|=2,Y.entangledLanes|=2;D;){var ne=1<<31-nt(D);Y.entanglements[1]|=ne,D&=~ne}Qi(S),(pn&6)===0&&(rh=_e()+500,Ru(0))}}break;case 31:case 13:Y=fs(S,2),Y!==null&&jr(Y,S,2),oh(),Yy(S,2)}if(S=Wy(p),S===null&&Iy(i,s,p,wh,u),S===b)break;b=S}b!==null&&p.stopPropagation()}else Iy(i,s,p,null,u)}}function Wy(i){return i=Qm(i),Xy(i)}var wh=null;function Xy(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 ET(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 Qy=!1,va=null,xa=null,wa=null,Du=new Map,_u=new Map,Sa=[],jP="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 TT(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":Du.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":_u.delete(s.pointerId)}}function Iu(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&&wT(s)),i):(i.eventSystemFlags|=p,s=i.targetContainers,b!==null&&s.indexOf(b)===-1&&s.push(b),i)}function zP(i,s,u,p,b){switch(s){case"focusin":return va=Iu(va,i,s,u,p,b),!0;case"dragenter":return xa=Iu(xa,i,s,u,p,b),!0;case"mouseover":return wa=Iu(wa,i,s,u,p,b),!0;case"pointerover":var S=b.pointerId;return Du.set(S,Iu(Du.get(S)||null,i,s,u,p,b)),!0;case"gotpointercapture":return S=b.pointerId,_u.set(S,Iu(_u.get(S)||null,i,s,u,p,b)),!0}return!1}function RT(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(){ST(u)});return}}else if(s===31){if(s=c(u),s!==null){i.blockedOn=s,it(i.priority,function(){ST(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=Wy(i.nativeEvent);if(u===null){u=i.nativeEvent;var p=new u.constructor(u.type,u);Xm=p,u.target.dispatchEvent(p),Xm=null}else return s=en(u),s!==null&&wT(s),i.blockedOn=u,!1;s.shift()}return!0}function CT(i,s,u){Sh(i)&&u.delete(s)}function FP(){Qy=!1,va!==null&&Sh(va)&&(va=null),xa!==null&&Sh(xa)&&(xa=null),wa!==null&&Sh(wa)&&(wa=null),Du.forEach(CT),_u.forEach(CT)}function Eh(i,s){i.blockedOn===s&&(i.blockedOn=null,Qy||(Qy=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,FP)))}var Th=null;function kT(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(Xy(p||u)===null)continue;break}var S=en(u);S!==null&&(i.splice(s,3),s-=3,Wg(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),Du.forEach(s),_u.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);)RT(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],D=b[Xe]||null;if(typeof S=="function")D||kT(u);else if(D){var Y=null;if(S&&S.hasAttribute("formAction")){if(b=S,D=S[Xe]||null)Y=D.formAction;else if(Xy(b)!==null)continue}else Y=D.action;typeof Y=="function"?u[p+1]=Y:(u.splice(p,3),p-=3),kT(u)}}}function MT(){function i(S){S.canIntercept&&S.info==="react-transition"&&S.intercept({handler:function(){return new Promise(function(D){return b=D})},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 Zy(i){this._internalRoot=i}Rh.prototype.render=Zy.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));var u=s.current,p=ei();vT(u,p,i,s,null,null)},Rh.prototype.unmount=Zy.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;vT(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&&RT(i)}};var OT=t.version;if(OT!=="19.2.4")throw Error(r(527,OT,"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 BP={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(BP),ze=Ch}catch{}}return Lu.createRoot=function(i,s){if(!o(i))throw Error(r(299));var u=!1,p="",b=L1,S=j1,D=z1;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&&(D=s.onRecoverableError)),s=yT(i,1,!1,null,null,u,p,null,b,S,D,MT),i[at]=s.current,_y(i),new Zy(s)},Lu.hydrateRoot=function(i,s,u){if(!o(i))throw Error(r(299));var p=!1,b="",S=L1,D=j1,Y=z1,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&&(D=u.onCaughtError),u.onRecoverableError!==void 0&&(Y=u.onRecoverableError),u.formState!==void 0&&(ne=u.formState)),s=yT(i,1,!0,s,u??null,p,b,ne,S,D,Y,MT),s.context=bT(null),u=s.current,p=ei(),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,_y(i),new Rh(s)},Lu.version="19.2.4",Lu}var rR;function r4(){if(rR)return ob.exports;rR=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(),ob.exports=n4(),ob.exports}var i4=r4();/**
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 l2=e=>{throw TypeError(e)},o4=(e,t,n)=>t.has(e)||l2("Cannot "+n),cb=(e,t,n)=>(o4(e,t,"read from private field"),n?n.call(e):t.get(e)),a4=(e,t,n)=>t.has(e)?l2("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),iR="popstate";function s4(e={}){function t(r,o){let{pathname:a,search:l,hash:c}=r.location;return Td("",{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 c4(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 l4(){return Math.random().toString(36).substring(2,10)}function oR(e,t){return{usr:e.state,key:e.key,idx:t}}function Td(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||l4()}}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 c4(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=Td(E.location,R,T);d=m()+1;let k=oR(C,d),M=E.createHref(C);try{l.pushState(k,"",M)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;o.location.assign(M)}a&&f&&f({action:c,location:E.location,delta:1})}function g(R,T){c="REPLACE";let C=Td(E.location,R,T);d=m();let k=oR(C,d),M=E.createHref(C);l.replaceState(k,"",M),a&&f&&f({action:c,location:E.location,delta:0})}function x(R){return c2(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(iR,h),f=R,()=>{o.removeEventListener(iR,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 c2(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 Zu,aR=class{constructor(e){if(a4(this,Zu,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(cb(this,Zu).has(e))return cb(this,Zu).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){cb(this,Zu).set(e,t)}};Zu=new WeakMap;var u4=new Set(["lazy","caseSensitive","path","id","index","children"]);function d4(e){return u4.has(e)}var f4=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function h4(e){return f4.has(e)}function p4(e){return e.index===!0}function Rd(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`),p4(a)){let d={...a,id:f};return r[f]=sR(d,t(d)),d}else{let d={...a,id:f,children:void 0};return r[f]=sR(d,t(d)),a.children&&(d.children=Rd(a.children,t,c,r,o)),d}})}function sR(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 Ju(e,t,n,!1)}function Ju(e,t,n,r){let o=typeof t=="string"?Za(t):t,a=ki(o.pathname||"/",n);if(a==null)return null;let l=u2(e);g4(l);let c=null;for(let f=0;c==null&&f<l.length;++f){let d=f2(a);c=R4(l[f],d,r)}return c}function m4(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 u2(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}".`),u2(l.children,t,y,h,f)),!(l.path==null&&!l.index)&&t.push({path:h,score:E4(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 d2(l.path))a(l,c,!0,d)}),t}function d2(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=d2(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 g4(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:T4(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var y4=/^:[\w-]+$/,b4=3,v4=2,x4=1,w4=10,S4=-2,lR=e=>e==="*";function E4(e,t){let n=e.split("/"),r=n.length;return n.some(lR)&&(r+=S4),t&&(r+=v4),n.filter(o=>!lR(o)).reduce((o,a)=>o+(y4.test(a)?b4:a===""?x4:w4),r)}function T4(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 R4(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:O4(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]=C4(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 C4(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 f2(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 ki(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 k4({basename:e,pathname:t}){return t==="/"?e:oo([e,t])}var h2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Wx=e=>h2.test(e);function M4(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=cR(n.substring(1),"/"):a=cR(n,t)):a=t,{pathname:a,search:N4(r),hash:A4(o)}}function cR(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 ub(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 p2(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Xx(e){let t=p2(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Qx(e,t,n,r=!1){let o;typeof e=="string"?o=Za(e):(o={...e},$t(!o.pathname||!o.pathname.includes("?"),ub("?","pathname","search",o)),$t(!o.pathname||!o.pathname.includes("#"),ub("#","pathname","hash",o)),$t(!o.search||!o.search.includes("#"),ub("#","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=M4(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,"/"),O4=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),N4=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,A4=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 Cd(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 m2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function g2(e,t){let n=e;if(typeof n!="string"||!h2.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,o=!1;if(m2)try{let a=new URL(window.location.href),l=n.startsWith("//")?new URL(a.protocol+n):new URL(n),c=ki(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 D4(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=Xl(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=Xl(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=Xl(n[o],l,(...f)=>uR(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=Xl(n.middleware,a,(...c)=>uR(c[0]));return l?(l[Ba]=a,l):o})),r}function _4(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=Xl(n.navigate,r,(...a)=>{let[l,c]=a;return{to:typeof l=="number"||typeof l=="string"?l:l?lo(l):".",...dR(e,c??{})}});o&&(o[Ba]=r,e.navigate=o)}if(n.fetch.length>0){let r=e.fetch[Ba]??e.fetch,o=Xl(n.fetch,r,(...a)=>{let[l,,c,f]=a;return{href:c??".",fetcherKey:l,...dR(e,f??{})}});o&&(o[Ba]=r,e.fetch=o)}return e}function Xl(e,t,n){return e.length===0?null:async(...r)=>{let o=await y2(e,n(...r),()=>t(...r),e.length-1);if(o.type==="error")throw o.value;return o.value}}async function y2(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=y2(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 uR(e){let{request:t,context:n,params:r,unstable_pattern:o}=e;return{request:I4(t),params:{...r},unstable_pattern:o,context:P4(n)}}function dR(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 I4(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function P4(e){if(j4(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var L4=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function j4(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")===L4}var b2=["POST","PUT","PATCH","DELETE"],z4=new Set(b2),F4=["GET",...b2],B4=new Set(F4),v2=new Set([301,302,303,307,308]),U4=new Set([307,308]),db={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},H4={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ju={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},q4=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),x2="remix-router-transitions",w2=Symbol("ResetLoaderData");function V4(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||q4,a=o;if(e.unstable_instrumentations){let X=e.unstable_instrumentations;a=ie=>({...o(ie),...D4(X.map(de=>de.route).filter(Boolean),ie)})}let l={},c=Rd(e.routes,a,void 0,l),f,d=e.basename||"/";d.startsWith("/")||(d=`/${d}`);let m=e.dataStrategy||W4,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,A;if(C==null&&!e.patchRoutesOnNavigation){let X=xi(404,{pathname:e.history.location.pathname}),{matches:ie,route:de}=Oh(c);A=!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))A=!1;else if(!C.some(X=>Zx(X.route)))A=!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);A=C.slice(0,de+1).every(ke=>!Pv(ke.route,X,ie))}else A=C.every(de=>!Pv(de.route,X,ie))}else{A=!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:A,navigation:db,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,ju),te({blockers:it})}}),q==null||q.resolve(),q=null;return}return Oe(X,ie)}),n){hF(t,U);let X=()=>pF(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?wR(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,ju)));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:db,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=RR());let Yt=q.promise;return e.history.go(X),Yt}let de=Iv(N.location,N.matches,d,X,ie==null?void 0:ie.fromRouteId,ie==null?void 0:ie.relative),{path:ke,submission:je,error:it}=fR(!1,de,ie),rt=N.location,Ye=Td(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,ju),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=RR()),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&&rF(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=Yl(e.history,ie,G.signal,de&&de.submission),at=e.getContext?await e.getContext():new aR,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(ni(en)&&Cd(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=fb(ie,de.submission),rt=!1,Ye.active=!1,Xe=Yl(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,...SR(Et),loaderData:Yt,errors:_n}))}async function Te(X,ie,de,ke,je,it,rt,Ye={}){Re();let Xe=dF(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=sp(ke,ie);if(!Et.route.action&&!Et.route.lazy)at={type:"error",error:xi(405,{method:X.method,pathname:ie.pathname,routeId:Et.route.id})};else{let pt=Jl(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=bR(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(ni(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||fb(ie,rt),_n=rt||Ye||TR(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}=hR(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&&ni(pt[1])?{[pt[0]]:pt[1].error}:null,...SR(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 Ar=()=>ir.forEach(tn=>ze(tn.key));G&&G.signal.addEventListener("abort",Ar);let{loaderResults:Nn,fetcherResults:Ni}=await pe(en,ir,X,ke);if(X.signal.aborted)return{shortCircuited:!0};G&&G.signal.removeEventListener("abort",Ar),ir.forEach(tn=>V.delete(tn.key));let Yr=Nh(Nn);if(Yr)return await _e(X,Yr.result,!0,{replace:Xe}),{shortCircuited:!0};if(Yr=Nh(Ni),Yr)return W.add(Yr.key),await _e(X,Yr.result,!0,{replace:Xe}),{shortCircuited:!0};let{loaderData:Ai,errors:ci}=xR(N,de,Nn,pt,ir,Ni);at&&N.errors&&(ci={...N.errors,...ci});let yo=nt(),as=Ct(L),ss=yo||as||ir.length>0;return{matches:de,loaderData:Ai,errors:ci,...ss?{fetchers:new Map(N.fetchers)}:{}}}function J(X){if(X&&!ni(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=zu(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=Iv(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,xi(404,{pathname:rt}),{flushSync:je});return}let{path:at,submission:Et,error:pt}=fR(!0,rt,ke);if(pt){fe(X,ie,pt,{flushSync:je});return}let Pt=e.getContext?await e.getContext():new aR,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,fF(Xe,Et),{flushSync:rt});let pt=new AbortController,Pt=Yl(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,xi(404,{pathname:de}),{flushSync:rt});return}}let Yt=sp(ke,de);if(!Yt.route.action&&!Yt.route.lazy){let nn=xi(405,{method:Xe.formMethod,pathname:de,routeId:ie});fe(X,ie,nn,{flushSync:rt});return}V.set(X,pt);let _n=K,Ln=Jl(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)||ni(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,zu(Xe)),_e(Pt,en,!1,{fetcherSubmission:Xe,preventScrollReset:Ye});if(ni(en)){fe(X,ie,en.error);return}}let ir=N.navigation.location||N.location,Ar=Yl(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 Yr=++K;$.set(X,Yr);let Ai=zu(Xe,en.data);N.fetchers.set(X,Ai);let{dsMatches:ci,revalidatingFetchers:yo}=hR(Ar,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),Yc=zu(void 0,gf?gf.data:void 0);N.fetchers.set(ls,Yc),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(ci,yo,Ar,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(Ar,qn.result,!1,{preventScrollReset:Ye});if(qn=Nh(tn),qn)return W.add(qn.key),_e(Ar,qn.result,!1,{preventScrollReset:Ye});let{loaderData:Di,errors:cr}=xR(N,Ni,ss,void 0,yo,tn);Ct(Yr),N.navigation.state==="loading"&&Yr>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:wR(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,zu(Xe,at?at.data:void 0),{flushSync:rt});let Et=new AbortController,pt=Yl(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,xi(404,{pathname:de}),{flushSync:rt});return}}let Pt=sp(ke,de);V.set(X,Et);let Yt=K,_n=Jl(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(ni(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=bR(Ye,new URL(X.url),d,e.history);let Xe=Td(N.location,Ye,{_isRedirect:!0});if(n){let _n=!1;if(ie.response.headers.has("X-Remix-Reload-Document"))_n=!0;else if(Wx(Ye)){const Ln=c2(Ye,!0);_n=Ln.origin!==t.location.origin||ki(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=TR(N.navigation));let Yt=ke||je;if(U4.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=fb(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 Q4(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(sF(Xe)){let at=Xe.result;it[Ye]={type:"redirect",response:tF(at,X,Ye,ie,d)}}else it[Ye]=await eF(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:xi(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)||H4}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)||ju;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)||ju;$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=xi(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===db){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=>m4(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:Ju(ie,de,d,!0)}}else return{active:!0,matches:Ju(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||pR(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=Ju(rt,ie,d,!0),!(at&&je.length<at.length&&qt(je,at.slice(0,je.length))))return{type:"success",matches:Xe}}if(at||(at=Ju(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=Rd(X,a,void 0,l)}function Ot(X,ie,de=!1){let ke=f==null;pR(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=_4(O,e.unstable_instrumentations.map(X=>X.router).filter(Boolean))),O}function $4(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Iv(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=Qx(r||".",Xx(l),ki(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=ew(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=k4({basename:n,pathname:f.pathname})),lo(f)}function fR(e,t,n){if(!n||!$4(n))return{path:t};if(n.formMethod&&!uF(n.formMethod))return{path:t,error:xi(405,{method:n.formMethod})};let r=()=>({path:t,error:xi(400,{type:"invalid-body"})}),a=(n.formMethod||"get").toUpperCase(),l=k2(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=jv(n.formData),f=n.formData;else if(n.body instanceof FormData)c=jv(n.body),f=n.body;else if(n.body instanceof URLSearchParams)c=n.body,f=vR(c);else if(n.body==null)c=new URLSearchParams,f=new FormData;else try{c=new URLSearchParams(n.body),f=vR(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&&ew(m.search)&&c.append("index",""),m.search=`?${c}`,{path:lo(m),submission:d}}function hR(e,t,n,r,o,a,l,c,f,d,m,h,y,g,x,E,R,T,C,k,M){var B;let A=k?ni(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&&ni(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:A,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:Zx(V)?m?K=Pv(V,a.loaderData,a.errors):G4(a.loaderData,a.matches[z],j)&&(K=!0):K=!1,K!==null)return Lv(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||Y4(a.matches[z],j))&&(L=!0);let $={...G,defaultShouldRevalidate:L},W=od(j,$);return Lv(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 $=sp(L,j.path),W=new AbortController,I=Yl(o,j.path,W.signal),Q=null;if(y.has(z))y.delete(z),Q=Jl(n,r,I,L,$,d,t);else if(K)h&&(Q=Jl(n,r,I,L,$,d,t));else{let le;typeof M=="boolean"?le=M:F?le=!1:le=h;let oe={...G,defaultShouldRevalidate:le};od($,oe)&&(Q=Jl(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 Zx(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Pv(e,t,n){if(e.lazy)return!0;if(!Zx(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 G4(e,t,n){let r=!t||n.route.id!==t.route.id,o=!e.hasOwnProperty(n.route.id);return r||o}function Y4(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function od(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function pR(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=>S2(d,h));m?f.push({existingRoute:m,newRoute:d}):c.push(d)}),c.length>0){let d=Rd(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]=Rd([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 S2(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=>S2(n,a))}):!1}var mR=new WeakMap,E2=({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=mR.get(o);l||(l={},mR.set(o,l));let c=l[e];if(c)return c;let f=(async()=>{let d=d4(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},gR=new WeakMap;function K4(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=gR.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=h4(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 gR.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=E2({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 yR(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 W4(e){return e.matches.some(t=>t.route.middleware)?T2(e,()=>yR(e)):yR(e)}function T2(e,t){return X4(e,t,r=>{if(cF(r))throw r;return r},oF,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 X4(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 R2({request:l,params:c,context:f,unstable_pattern:d},m,t,n,r,o)}async function R2(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 R2(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 C2(e,t,n,r,o){let a=E2({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),l=K4(r.route,xr(n.method)?"action":"loader",t,e,o);return{middleware:a,route:l.lazyRoutePromise,handler:l.lazyHandlerPromise}}function Lv(e,t,n,r,o,a,l,c,f=null,d){let m=!1,h=C2(e,t,n,o,a);return{...o,_lazyPromises:h,shouldLoad:c,shouldRevalidateArgs:f,shouldCallHandler(y){return m=!0,f?typeof d=="boolean"?od(o,{...f,defaultShouldRevalidate:d}):typeof y=="boolean"?od(o,{...f,defaultShouldRevalidate:y}):od(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)?Z4({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 Jl(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:C2(e,t,n,f,a),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Lv(e,t,n,Gd(r),f,a,l,!0,c))}async function Q4(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 T2(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 Z4({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 xi(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 xi(404,{pathname:x})}}catch(y){return{type:"error",result:y}}finally{f&&e.signal.removeEventListener("abort",f)}return c}async function J4(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 eF(e){var r,o,a,l,c;let{result:t,type:n}=e;if(Jx(t)){let f;try{f=await J4(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"?ER(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:iF(t),statusCode:Cd(t)?t.status:void 0,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Cd(t)?t.status:void 0}:ER(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 tF(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"),!Wx(a)){let l=r.slice(0,r.findIndex(c=>c.route.id===n)+1);a=Iv(new URL(t.url),l,o,a),e.headers.set("Location",a)}return e}function bR(e,t,n,r){let o=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(Wx(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=ki(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 Yl(e,t,n,r){let o=e.createURL(k2(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=jv(r.formData):a.body=r.formData}return new Request(o,a)}function jv(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function vR(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function nF(e,t,n,r=!1,o=!1){let a={},l=null,c,f=!1,d={},m=n&&ni(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"),ni(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]=w2),f||(f=!0,c=Cd(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 xR(e,t,n,r,o,a){let{loaderData:l,errors:c}=nF(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"),ni(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 wR(e,t,n,r){let o=Object.entries(t).filter(([,a])=>a!==w2).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 SR(e){return e?ni(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 xi(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 k2(e){let t=typeof e=="string"?Za(e):e;return lo({...t,hash:""})}function rF(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function iF(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 oF(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&aF(n))}function aF(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function sF(e){return Jx(e.result)&&v2.has(e.result.status)}function ni(e){return e.type==="error"}function As(e){return(e&&e.type)==="redirect"}function ER(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Jx(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function lF(e){return v2.has(e)}function cF(e){return Jx(e)&&lF(e.status)&&e.headers.has("Location")}function uF(e){return B4.has(e.toUpperCase())}function xr(e){return z4.has(e.toUpperCase())}function ew(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function sp(e,t){let n=typeof t=="string"?Za(t).search:t.search;if(e[e.length-1].route.index&&ew(n||""))return e[e.length-1];let r=p2(e);return r[r.length-1]}function TR(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 fb(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 dF(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 zu(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 fF(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 hF(e,t){try{let n=e.sessionStorage.getItem(x2);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 pF(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(x2,JSON.stringify(n))}catch(r){Zn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function RR(){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 M2=v.createContext(!1);function mF(){return v.useContext(M2)}var tw=v.createContext({isTransitioning:!1});tw.displayName="ViewTransition";var O2=v.createContext(new Map);O2.displayName="Fetchers";var gF=v.createContext(null);gF.displayName="Await";var Oi=v.createContext(null);Oi.displayName="Navigation";var am=v.createContext(null);am.displayName="Location";var $i=v.createContext({outlet:null,matches:[],isDataRoute:!1});$i.displayName="Route";var nw=v.createContext(null);nw.displayName="RouteError";var N2="REACT_ROUTER_ERROR",yF="REDIRECT",bF="ROUTE_ERROR_RESPONSE";function vF(e){if(e.startsWith(`${N2}:${yF}:{`))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 xF(e){if(e.startsWith(`${N2}:${bF}:{`))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 wF(e,{relative:t}={}){$t(Dc(),"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 Dc(){return v.useContext(am)!=null}function Gi(){return $t(Dc(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(am).location}function SF(e){$t(Dc(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=Gi();return v.useMemo(()=>Ws(e,f2(t)),[t,e])}var A2="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function D2(e){v.useContext(Oi).static||v.useLayoutEffect(e)}function Kd(){let{isDataRoute:e}=v.useContext($i);return e?zF():EF()}function EF(){$t(Dc(),"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(Xx(r)),l=v.useRef(!1);return D2(()=>{l.current=!0}),v.useCallback((f,d={})=>{if(Zn(l.current,A2),!l.current)return;if(typeof f=="number"){n.go(f);return}let m=Qx(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 TF=v.createContext(null);function RF(e){let t=v.useContext($i).outlet;return v.useMemo(()=>t&&v.createElement(TF.Provider,{value:e},t),[t,e])}function CF(){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(Xx(n));return v.useMemo(()=>Qx(e,JSON.parse(o),r,t==="path"),[e,o,r,t])}function kF(e,t,n,r,o){$t(Dc(),"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||"";I2(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.`),DF(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 MF(){let e=jF(),t=Cd(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 OF=v.createElement(MF,null),_2=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=xF(e.digest);n&&(e=n)}let t=e!==void 0?v.createElement($i.Provider,{value:this.props.routeContext},v.createElement(nw.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?v.createElement(NF,{error:e},t):t}};_2.contextType=M2;var hb=new WeakMap;function NF({children:e,error:t}){let{basename:n}=v.useContext(Oi);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=vF(t.digest);if(r){let o=hb.get(t);if(o)throw o;let a=g2(r.location,n);if(m2&&!hb.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 hb.set(t,l),l}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function AF({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 DF(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||OF,c&&(f<0&&y===0?(I2("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(AF,{match:h,routeContext:{outlet:m,matches:T,isDataRoute:n!=null},children:k})};return n&&(h.route.ErrorBoundary||h.route.errorElement||y===0)?v.createElement(_2,{location:n.location,revalidation:n.revalidation,component:E,error:g,children:C(),routeContext:{outlet:null,matches:T,isDataRoute:!0},onError:d}):C()},null)}function rw(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function _F(e){let t=v.useContext(al);return $t(t,rw(e)),t}function IF(e){let t=v.useContext(Yd);return $t(t,rw(e)),t}function PF(e){let t=v.useContext($i);return $t(t,rw(e)),t}function iw(e){let t=PF(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 LF(){return iw("useRouteId")}function jF(){var r;let e=v.useContext(nw),t=IF("useRouteError"),n=iw("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function zF(){let{router:e}=_F("useNavigate"),t=iw("useNavigate"),n=v.useRef(!1);return D2(()=>{n.current=!0}),v.useCallback(async(o,a={})=>{Zn(n.current,A2),n.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...a}))},[e,t])}var CR={};function I2(e,t,n){!t&&!CR[e]&&(CR[e]=!0,Zn(!1,n))}var kR={};function MR(e,t){!e&&!kR[t]&&(kR[t]=!0,console.warn(t))}var FF="useOptimistic",OR=Yx[FF],BF=()=>{};function UF(e){return OR?OR(e):[e,BF]}function HF(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 qF=["HydrateFallback","hydrateFallbackElement"],VF=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 $F({router:e,flushSync:t,onError:n,unstable_useTransitions:r}){r=mF()||r;let[a,l]=v.useState(e.state),[c,f]=UF(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)),MR(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(MR(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=>NR(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 VF)},[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=>NR(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 A=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:A,static:!1,basename:O,onError:n}),[e,A,O,n]);return v.createElement(v.Fragment,null,v.createElement(al.Provider,{value:N},v.createElement(Yd.Provider,{value:c},v.createElement(O2.Provider,{value:k.current},v.createElement(tw.Provider,{value:h},v.createElement(WF,{basename:O,location:c.location,navigationType:c.historyAction,navigator:A,unstable_useTransitions:r},v.createElement(GF,{routes:e.routes,future:e.future,state:c,onError:n})))))),null)}function NR(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 GF=v.memo(YF);function YF({routes:e,future:t,state:n,onError:r}){return kF(e,void 0,n,r,t)}function KF(e){return RF(e.context)}function WF({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:a=!1,unstable_useTransitions:l}){$t(!Dc(),"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=ki(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(am.Provider,{children:t,value:x}))}var lp="get",cp="application/x-www-form-urlencoded";function sm(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function XF(e){return sm(e)&&e.tagName.toLowerCase()==="button"}function QF(e){return sm(e)&&e.tagName.toLowerCase()==="form"}function ZF(e){return sm(e)&&e.tagName.toLowerCase()==="input"}function JF(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function e5(e,t){return e.button===0&&(!t||t==="_self")&&!JF(e)}var Ah=null;function t5(){if(Ah===null)try{new FormData(document.createElement("form"),0),Ah=!1}catch{Ah=!0}return Ah}var n5=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function pb(e){return e!=null&&!n5.has(e)?(Zn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${cp}"`),null):e}function r5(e,t){let n,r,o,a,l;if(QF(e)){let c=e.getAttribute("action");r=c?ki(c,t):null,n=e.getAttribute("method")||lp,o=pb(e.getAttribute("enctype"))||cp,a=new FormData(e)}else if(XF(e)||ZF(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?ki(f,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||lp,o=pb(e.getAttribute("formenctype"))||pb(c.getAttribute("enctype"))||cp,a=new FormData(c,e),!t5()){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(sm(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=lp,r=null,o=cp,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 ow(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function i5(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&&ki(o.pathname,t)==="/"?o.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${r}`,o}async function o5(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 a5(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 s5(e,t,n){let r=await Promise.all(e.map(async o=>{let a=t.routes[o.route.id];if(a){let l=await o5(a,n);return l.links?l.links():[]}return[]}));return d5(r.flat(1).filter(a5).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function AR(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 l5(e,t,{includeHydrateFallback:n}={}){return c5(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 c5(e){return[...new Set(e)]}function u5(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function d5(e,t){let n=new Set;return new Set(t),e.reduce((r,o)=>{let a=JSON.stringify(u5(o));return n.has(a)||(n.add(a),r.push({key:a,link:o})),r},[])}function P2(){let e=v.useContext(al);return ow(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function f5(){let e=v.useContext(Yd);return ow(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var aw=v.createContext(void 0);aw.displayName="FrameworkContext";function L2(){let e=v.useContext(aw);return ow(e,"You must render this element inside a <HydratedRouter> element"),e}function h5(e,t){let n=v.useContext(aw),[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:Fu(c,g),onBlur:Fu(f,x),onMouseEnter:Fu(d,g),onMouseLeave:Fu(m,x),onTouchStart:Fu(h,g)}]:[!1,y,{}]}function Fu(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function p5({page:e,...t}){let{router:n}=P2(),r=v.useMemo(()=>Oa(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?v.createElement(g5,{page:e,matches:r,...t}):null}function m5(e){let{manifest:t,routeModules:n}=L2(),[r,o]=v.useState([]);return v.useEffect(()=>{let a=!1;return s5(e,t,n).then(l=>{a||o(l)}),()=>{a=!0}},[e,t,n]),r}function g5({page:e,matches:t,...n}){let r=Gi(),{future:o,manifest:a,routeModules:l}=L2(),{basename:c}=P2(),{loaderData:f,matches:d}=f5(),m=v.useMemo(()=>AR(e,t,d,a,r,"data"),[e,t,d,a,r]),h=v.useMemo(()=>AR(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(A=>A.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=i5(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(()=>l5(h,a),[h,a]),x=m5(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 y5(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var b5=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{b5&&(window.__reactRouterVersion="7.13.0")}catch{}function v5(e,t){return V4({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:s4({window:t==null?void 0:t.window}),hydrationData:x5(),routes:e,mapRouteProperties:HF,hydrationRouteProperties:qF,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 x5(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:w5(e.errors)}),e}function w5(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 j2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,sw=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"&&j2.test(d),C=g2(d,E);d=C.to;let k=wF(d,{relative:o}),[M,A,O]=h5(r,g),N=R5(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:y5(x,A),target:f,"data-discover":!T&&n==="render"?"true":void 0});return M&&!T?v.createElement(v.Fragment,null,q,v.createElement(p5,{page:k})):q});sw.displayName="Link";var S5=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&&N5(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=ki(k,E)||k);const M=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let A=C===T||!o&&C.startsWith(T)&&C.charAt(M)==="/",O=k!=null&&(k===T||!o&&k.startsWith(T)&&k.charAt(T.length)==="/"),N={isActive:A,isPending:O,isTransitioning:R},_=A?t:void 0,q;typeof r=="function"?q=r(N):q=[r,A?"active":null,O?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let F=typeof a=="function"?a(N):a;return v.createElement(sw,{...d,"aria-current":_,className:q,ref:m,style:F,to:l,viewTransition:c},typeof f=="function"?f(N):f)});S5.displayName="NavLink";var E5=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:a,method:l=lp,action:c,onSubmit:f,relative:d,preventScrollReset:m,viewTransition:h,unstable_defaultShouldRevalidate:y,...g},x)=>{let{unstable_useTransitions:E}=v.useContext(Oi),R=M5(),T=O5(c,{relative:d}),C=l.toLowerCase()==="get"?"get":"post",k=typeof c=="string"&&j2.test(c),M=A=>{if(f&&f(A),A.defaultPrevented)return;A.preventDefault();let O=A.nativeEvent.submitter,N=(O==null?void 0:O.getAttribute("formmethod"))||l,_=()=>R(O||A.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})});E5.displayName="Form";function T5(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function z2(e){let t=v.useContext(al);return $t(t,T5(e)),t}function R5(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(e5(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 C5=0,k5=()=>`__${String(++C5)}__`;function M5(){let{router:e}=z2("useSubmit"),{basename:t}=v.useContext(Oi),n=LF(),r=e.fetch,o=e.navigate;return v.useCallback(async(a,l={})=>{let{action:c,method:f,encType:d,formData:m,body:h}=r5(a,t);if(l.navigate===!1){let y=l.fetcherKey||k5();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 O5(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 N5(e,{relative:t}={}){let n=v.useContext(tw);$t(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=z2("useViewTransitionState"),o=Wd(e,{relative:t});if(!n.isTransitioning)return!1;let a=ki(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=ki(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ws(o.pathname,l)!=null||Ws(o.pathname,a)!=null}var yr=s2();const A5=om(yr);function D5(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 _5=e=>{switch(e){case"success":return L5;case"info":return z5;case"warning":return j5;case"error":return F5;default:return null}},I5=Array(12).fill(0),P5=({visible:e,className:t})=>Fe.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Fe.createElement("div",{className:"sonner-spinner"},I5.map((n,r)=>Fe.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),L5=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"})),j5=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"})),z5=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"})),F5=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"})),B5=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"})),U5=()=>{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 zv=1;class H5{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:zv++,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(V5(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)||zv++;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 Ur=new H5,q5=(e,t)=>{const n=(t==null?void 0:t.id)||zv++;return Ur.addToast({title:e,...t,id:n}),n},V5=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",$5=q5,G5=()=>Ur.toasts,Y5=()=>Ur.getActiveToasts(),Bt=Object.assign($5,{success:Ur.success,info:Ur.info,warning:Ur.warning,error:Ur.error,custom:Ur.custom,message:Ur.message,promise:Ur.promise,dismiss:Ur.dismiss,loading:Ur.loading},{getHistory:G5,getToasts:Y5});D5("[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 K5=3,W5="24px",X5="16px",DR=4e3,Q5=356,Z5=14,J5=45,e3=200;function Zi(...e){return e.filter(Boolean).join(" ")}function t3(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const n3=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:A,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||DR),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||DR,[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=U5(),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)},e3)},[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(P5,{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])||_5(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:A,"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)>=J5||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:t3(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:B5):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 _R(){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 r3(e,t){const n={};return[e,t].forEach((r,o)=>{const a=o===1,l=a?"--mobile-offset":"--offset",c=a?X5:W5;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 i3=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=K5,toastOptions:T,dir:C=_R(),gap:k=Z5,icons:M,containerAriaLabel:A="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||Ur.dismiss(I.id),Q.filter(({id:oe})=>oe!==I.id)})},[]);return Fe.useEffect(()=>Ur.subscribe(I=>{if(I.dismiss){requestAnimationFrame(()=>{N(Q=>Q.map(le=>le.id===I.id?{...le,delete:!0}:le))});return}setTimeout(()=>{A5.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":`${A} ${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"?_R():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":`${Q5}px`,"--gap":`${k}px`,...E,...r3(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(n3,{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",Bu=()=>{let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n},IR=e=>e==null?"":""+e,o3=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},a3=/###/g,PR=e=>e&&e.indexOf("###")>-1?e.replace(a3,"."):e,LR=e=>!e||Nt(e),ad=(e,t,n)=>{const r=Nt(t)?t.split("."):t;let o=0;for(;o<r.length-1;){if(LR(e))return{};const a=PR(r[o]);!e[a]&&n&&(e[a]=new n),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={},++o}return LR(e)?{}:{obj:e,k:PR(r[o])}},jR=(e,t,n)=>{const{obj:r,k:o}=ad(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=ad(e,l,Object);for(;c.obj===void 0&&l.length;)a=`${l[l.length-1]}.${a}`,l=l.slice(0,l.length-1),c=ad(e,l,Object),c!=null&&c.obj&&typeof c.obj[`${c.k}.${a}`]<"u"&&(c.obj=void 0);c.obj[`${c.k}.${a}`]=n},s3=(e,t,n,r)=>{const{obj:o,k:a}=ad(e,t,Object);o[a]=o[a]||[],o[a].push(n)},Cp=(e,t)=>{const{obj:n,k:r}=ad(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},l3=(e,t,n)=>{const r=Cp(e,n);return r!==void 0?r:Cp(t,n)},F2=(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]):F2(e[r],t[r],n):e[r]=t[r]);return e},Ul=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var c3={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const u3=e=>Nt(e)?e.replace(/[&<>"'\/]/g,t=>c3[t]):e;class d3{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 f3=[" ",",","?","!",";"],h3=new d3(20),p3=(e,t,n)=>{t=t||"",n=n||"";const r=f3.filter(l=>t.indexOf(l)<0&&n.indexOf(l)<0);if(r.length===0)return!0;const o=h3.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},Fv=(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},kd=e=>e==null?void 0:e.replace("_","-"),m3={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 kp{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||m3,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 kp(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new kp(this.logger,t)}}var io=new kp;class lm{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 zR extends lm{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=Cp(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:Fv((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),jR(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=Cp(this.data,c)||{};l.skipCopy||(r=JSON.parse(JSON.stringify(r))),o?F2(f,r,a):f={...f,...r},jR(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 B2={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 U2=Symbol("i18next/PATH_KEY");function g3(){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===U2?e:(e.push(o),n=Proxy.revocable(r,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Bv(e,t){const{[U2]:n}=e(g3());return n.join((t==null?void 0:t.keySeparator)??".")}const FR={},mb=e=>!Nt(e)&&typeof e!="boolean"&&typeof e!="number";class Mp extends lm{constructor(t,n={}){super(),o3(["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=mb(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&&!p3(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=Bv(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),A=Mp.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&&A&&(F=q);const G=mb(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}`;A&&!x?H[j]=this.translate(z,{...o,defaultValue:mb(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)&&A&&(U=!0,x=q),this.isValidLookup(x)||(H=!0,x=c);const j=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&H?void 0:x,z=A&&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=A&&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=B2.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,!FR[`${E[0]}-${R}`]&&((T=this.utils)!=null&&T.hasLoadedNamespace)&&!((C=this.utils)!=null&&C.hasLoadedNamespace(c))&&(FR[`${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 A;for(;A=M.pop();)this.isValidLookup(r)||(a=A,r=this.getResource(k,R,A,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 BR{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=io.create("languageUtils")}getScriptPartFromCode(t){if(t=kd(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=kd(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 UR={zero:0,one:1,two:2,few:3,many:4,other:5},HR={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class y3{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=io.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const r=kd(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!"),HR;if(!t.match(/-|_/))return HR;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)=>UR[o]-UR[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 qR=(e,t,n,r=".",o=!0)=>{let a=l3(e,t,n);return!a&&o&&Nt(n)&&(a=Fv(e,n,r),a===void 0&&(a=Fv(t,n,r))),a},gb=e=>e.replace(/\$/g,"$$$$");class VR{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:u3,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=qR(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(qR(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=>gb(x)},{regex:this.regexp,safeValue:x=>this.escapeValue?gb(this.escape(x)):gb(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=IR(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=IR(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 b3=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}},$R=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(kd(r),o),t[l]=c),c(n)}},v3=e=>(t,n,r)=>e(kd(n),r)(t);class x3{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?$R:v3;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()]=$R(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}=b3(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 w3=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class S3 extends lm{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=>{s3(f.loaded,[a],l),w3(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 yb=()=>({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}),GR=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=()=>{},E3=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})},T3=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 sd extends lm{constructor(t={},n){if(super(),this.options=GR(t),this.services={},this.logger=io,this.modules={external:[]},E3(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=yb();this.options={...r,...this.options,...GR(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&&!T3(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=x3;const m=new BR(this.options);this.store=new zR(this.options.resources,this.options);const h=this.services;h.logger=io,h.resourceStore=this.store,h.languageUtils=m,h.pluralResolver=new y3(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 VR(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new S3(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 Mp(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=Bu(),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=Bu();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"&&B2.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=Bu();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=Bv(h,{...this.options,...l})),`${f.keyPrefix}${d}${h}`)):(typeof a=="function"&&(a=Bv(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=Bu();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=Bu();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 BR(yb());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 sd(t,n);return r.createInstance=sd.createInstance,r}cloneInstance(t={},n=_h){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const o={...this.options,...t,isClone:!0},a=new sd(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 zR(c,o),a.services.resourceStore=a.store}if(t.interpolation){const f={...yb().interpolation,...this.options.interpolation,...t.interpolation},d={...o,interpolation:f};a.services.interpolator=new VR(d)}return a.translator=new Mp(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=sd.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 R3=(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)},YR={},H2=(e,t,n,r)=>{Xs(n)&&YR[n]||(Xs(n)&&(YR[n]=new Date),R3(e,t,n,r))},q2=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},Uv=(e,t,n)=>{e.loadNamespaces(t,q2(e,n))},KR=(e,t,n,r)=>{if(Xs(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Uv(e,n,r);n.forEach(o=>{e.options.ns.indexOf(o)<0&&e.options.ns.push(o)}),e.loadLanguages(t,q2(e,r))},C3=(e,t,n={})=>!t.languages||!t.languages.length?(H2(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",k3=e=>typeof e=="object"&&e!==null,M3=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,O3={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},N3=e=>O3[e],A3=e=>e.replace(M3,N3);let Hv={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:A3,transDefaultProps:void 0};const D3=(e={})=>{Hv={...Hv,...e}},_3=()=>Hv;let V2;const I3=e=>{V2=e},P3=()=>V2,L3={type:"3rdParty",init(e){D3(e.options.react),I3(e)}},j3=v.createContext();class z3{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var bb={exports:{}},vb={};/**
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 WR;function F3(){if(WR)return vb;WR=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 vb.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,vb}var XR;function $2(){return XR||(XR=1,bb.exports=F3()),bb.exports}var lw=$2();const B3=(e,t)=>Xs(t)?t:k3(t)&&Xs(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e,U3={t:B3,ready:!1},H3=()=>()=>{},mn=(e,t={})=>{var q,F,G;const{i18n:n}=t,{i18n:r,defaultNS:o}=v.useContext(j3)||{},a=n||r||P3();a&&!a.reportNamespaces&&(a.reportNamespaces=new z3),a||H2(a,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const l=v.useMemo(()=>{var P;return{..._3(),...(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 H3;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 U3;const P=!!(a.isInitialized||a.initializedStoreOnce)&&h.every(V=>C3(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}=lw.useSyncExternalStore(g,E,E);v.useEffect(()=>{if(a&&!k&&!c){const P=()=>T(U=>U+1);t.lng?KR(a,t.lng,h,P):Uv(a,h,P)}},[a,t.lng,h,k,c,R]);const M=a||{},A=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&&(A.current&&A.current.__original===P?O.current!==U?(H=N(P),A.current=H,O.current=U):H=A.current:(H=N(P),A.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?KR(a,t.lng,h,U):Uv(a,h,U)});return _};function q3(){const e=navigator.language;return e.startsWith("zh")?"zh_CN":e.startsWith("ja")?"ja_JP":Kx}Qt.use(L3).init({resources:_L,lng:q3(),fallbackLng:Kx,interpolation:{escapeValue:!1},returnNull:!1});function qv(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const ld={};function Mi(e,t,n,r,o){let a={...Vv(e,ld)};return t&&(a=ed(a,t)),n&&(a=ed(a,n)),r&&(a=ed(a,r)),o&&(a=ed(a,o)),a}function V3(e){if(e.length===0)return ld;if(e.length===1)return Vv(e[0],ld);let t={...Vv(e[0],ld)};for(let n=1;n<e.length;n+=1)t=ed(t,e[n]);return t}function ed(e,t){return G2(t)?t(e):$3(e,t)}function $3(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=qv(e.style,r);break}case"className":{e[n]=Y2(e.className,r);break}default:G3(n,r)?e[n]=Y3(e[n],r):e[n]=r}}return e}function G3(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 G2(e){return typeof e=="function"}function Vv(e,t){return G2(e)?e(t):e??ld}function Y3(e,t){return t?e?n=>{if(K3(n)){const o=n;$v(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 $v(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Y2(e,t){return t?e?t+" "+e:t:e}function K3(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 QR={};function rr(e,t){const n=v.useRef(QR);return n.current===QR&&(n.current=e(t)),n}function Hi(e,t,n,r){const o=rr(K2).current;return X3(o,e,t,n,r)&&W2(o,[e,t,n,r]),o.callback}function W3(e){const t=rr(K2).current;return Q3(t,e)&&W2(t,e),t.callback}function K2(){return{callback:null,cleanup:null,refs:[]}}function X3(e,t,n,r,o){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==o}function Q3(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function W2(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 Z3=parseInt(v.version,10);function cw(e){return Z3>=e}function ZR(e){if(!v.isValidElement(e))return null;const t=e,n=t.props;return(cw(19)?n==null?void 0:n.ref:t.ref)??null}function J3(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 eB(e,t){return typeof e=="function"?e(t):e}function tB(e,t){return typeof e=="function"?e(t):e}function Hr(){}const Ka=Object.freeze([]),Pn=Object.freeze({}),nB=500,rB=500,iB={style:{transition:"none"}},oB="data-base-ui-click-trigger",X2={fallbackAxisSide:"none"},Q2={fallbackAxisSide:"end"},aB={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function At(e,t,n={}){const r=t.render,o=sB(t,n);if(n.enabled===!1)return null;const a=n.state??Pn;return cB(e,r,o,a)}function sB(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?eB(n,a):void 0,h=d?tB(r,a):void 0,y=d?J3(a,f):Pn,g=d?qv(y,Array.isArray(c)?V3(c):c)??Pn:Pn;return typeof document<"u"&&(d?Array.isArray(l)?g.ref=W3([g.ref,ZR(o),...l]):g.ref=Hi(g.ref,ZR(o),l):Hi(null,null)),d?(m!==void 0&&(g.className=Y2(g.className,m)),h!==void 0&&(g.style=qv(g.style,h)),g):Pn}const lB=Symbol.for("react.lazy");function cB(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const o=Mi(n,t.props);o.ref=n.ref;let a=t;return(a==null?void 0:a.$$typeof)===lB&&(a=v.Children.toArray(t)[0]),v.cloneElement(a,o)}if(e&&typeof e=="string")return uB(e,n);throw new Error(Rn(8))}function uB(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 cm(e){return At(e.defaultTagName??"div",e,e)}function Z2(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=Z2(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function J2(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Z2(e))&&(r&&(r+=" "),r+=t);return r}const JR=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,eC=J2,um=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return eC(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=JR(m)||JR(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 eC(e,l,f,n==null?void 0:n.class,n==null?void 0:n.className)},xb=768;function dB(){const[e,t]=v.useState(void 0);return v.useEffect(()=>{const n=window.matchMedia(`(max-width: ${xb-1}px)`),r=()=>{t(window.innerWidth<xb)};return n.addEventListener("change",r),t(window.innerWidth<xb),()=>n.removeEventListener("change",r)},[]),!!e}const fB=(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},hB=(e,t)=>({classGroupId:e,validator:t}),eO=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Op="-",tC=[],pB="arbitrary..",mB=e=>{const t=yB(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return gB(l);const c=l.split(Op),f=c[0]===""&&c.length>1?1:0;return tO(c,f,t)},getConflictingClassGroupIds:(l,c)=>{if(c){const f=r[l],d=n[l];return f?d?fB(d,f):f:d||tC}return n[l]||tC}}},tO=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],a=n.nextPart.get(o);if(a){const d=tO(e,t+1,a);if(d)return d}const l=n.validators;if(l===null)return;const c=t===0?e.join(Op):e.slice(t).join(Op),f=l.length;for(let d=0;d<f;d++){const m=l[d];if(m.validator(c))return m.classGroupId}},gB=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?pB+r:void 0})(),yB=e=>{const{theme:t,classGroups:n}=e;return bB(n,t)},bB=(e,t)=>{const n=eO();for(const r in e){const o=e[r];uw(o,n,r,t)}return n},uw=(e,t,n,r)=>{const o=e.length;for(let a=0;a<o;a++){const l=e[a];vB(l,t,n,r)}},vB=(e,t,n,r)=>{if(typeof e=="string"){xB(e,t,n);return}if(typeof e=="function"){wB(e,t,n,r);return}SB(e,t,n,r)},xB=(e,t,n)=>{const r=e===""?t:nO(t,e);r.classGroupId=n},wB=(e,t,n,r)=>{if(EB(e)){uw(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(hB(n,e))},SB=(e,t,n,r)=>{const o=Object.entries(e),a=o.length;for(let l=0;l<a;l++){const[c,f]=o[l];uw(f,nO(t,c),n,r)}},nO=(e,t)=>{let n=e;const r=t.split(Op),o=r.length;for(let a=0;a<o;a++){const l=r[a];let c=n.nextPart.get(l);c||(c=eO(),n.nextPart.set(l,c)),n=c}return n},EB=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,TB=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)}}},Gv="!",nC=":",RB=[],rC=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),CB=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===nC){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(Gv)?(y=h.slice(0,-1),g=!0):h.startsWith(Gv)&&(y=h.slice(1),g=!0);const x=d&&d>f?d-f:void 0;return rC(a,g,y,x)};if(t){const o=t+nC,a=r;r=l=>l.startsWith(o)?a(l.slice(o.length)):rC(RB,!1,l,void 0,!0)}if(n){const o=r;r=a=>n({className:a,parseClassName:o})}return r},kB=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}},MB=e=>({cache:TB(e.cacheSize),parseClassName:CB(e),sortModifiers:kB(e),...mB(e)}),OB=/\s+/,NB=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:a}=t,l=[],c=e.trim().split(OB);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+Gv:C,M=k+T;if(l.indexOf(M)>-1)continue;l.push(M);const A=o(T,R);for(let O=0;O<A.length;++O){const N=A[O];l.push(k+N)}f=m+(f.length>0?" "+f:f)}return f},AB=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=rO(n))&&(o&&(o+=" "),o+=r);return o},rO=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=rO(e[r]))&&(n&&(n+=" "),n+=t);return n},DB=(e,...t)=>{let n,r,o,a;const l=f=>{const d=t.reduce((m,h)=>h(m),e());return n=MB(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=NB(f,n);return o(f,m),m};return a=l,(...f)=>a(AB(...f))},_B=[],er=e=>{const t=n=>n[e]||_B;return t.isThemeGetter=!0,t},iO=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,oO=/^\((?:(\w[\w-]*):)?(.+)\)$/i,IB=/^\d+\/\d+$/,PB=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,LB=/\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$/,jB=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,zB=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,FB=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Hl=e=>IB.test(e),Vt=e=>!!e&&!Number.isNaN(Number(e)),Ta=e=>!!e&&Number.isInteger(Number(e)),wb=e=>e.endsWith("%")&&Vt(e.slice(0,-1)),Po=e=>PB.test(e),BB=()=>!0,UB=e=>LB.test(e)&&!jB.test(e),aO=()=>!1,HB=e=>zB.test(e),qB=e=>FB.test(e),VB=e=>!lt(e)&&!ct(e),$B=e=>_c(e,cO,aO),lt=e=>iO.test(e),ks=e=>_c(e,uO,UB),Sb=e=>_c(e,XB,Vt),iC=e=>_c(e,sO,aO),GB=e=>_c(e,lO,qB),Ih=e=>_c(e,dO,HB),ct=e=>oO.test(e),Uu=e=>Ic(e,uO),YB=e=>Ic(e,QB),oC=e=>Ic(e,sO),KB=e=>Ic(e,cO),WB=e=>Ic(e,lO),Ph=e=>Ic(e,dO,!0),_c=(e,t,n)=>{const r=iO.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ic=(e,t,n=!1)=>{const r=oO.exec(e);return r?r[1]?t(r[1]):n:!1},sO=e=>e==="position"||e==="percentage",lO=e=>e==="image"||e==="url",cO=e=>e==="length"||e==="size"||e==="bg-size",uO=e=>e==="length",XB=e=>e==="number",QB=e=>e==="family-name",dO=e=>e==="shadow",ZB=()=>{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"],A=()=>[...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(),oC,iC,{position:[ct,lt]}],L=()=>["no-repeat",{repeat:["","x","y","space","round"]}],$=()=>["auto","cover","contain",KB,$B,{size:[ct,lt]}],W=()=>[wb,Uu,ks],I=()=>["","none","full",d,ct,lt],Q=()=>["",Vt,Uu,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,wb,oC,iC],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:[BB],container:[Po],"drop-shadow":[Po],ease:["in","out","in-out"],font:[VB],"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:A()}],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,Uu,ks]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ct,Sb]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",wb,lt]}],"font-family":[{font:[YB,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,Sb]}],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]},WB,GB]}],"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,Uu,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":A()}],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:A()}],"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,Uu,ks,Sb]}],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"]}},JB=DB(ZB);function De(...e){return JB(J2(e))}function dm(){return typeof window<"u"}function Ja(e){return dw(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=(dw(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function dw(e){return dm()?e instanceof Node||e instanceof Hn(e).Node:!1}function fn(e){return dm()?e instanceof Element||e instanceof Hn(e).Element:!1}function On(e){return dm()?e instanceof HTMLElement||e instanceof Hn(e).HTMLElement:!1}function Yv(e){return!dm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Hn(e).ShadowRoot}const eU=new Set(["inline","contents"]);function es(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=li(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!eU.has(o)}const tU=new Set(["table","td","th"]);function nU(e){return tU.has(Ja(e))}const rU=[":popover-open",":modal"];function fm(e){return rU.some(t=>{try{return e.matches(t)}catch{return!1}})}const iU=["transform","translate","scale","rotate","perspective"],oU=["transform","translate","scale","rotate","perspective","filter"],aU=["paint","layout","strict","content"];function fw(e){const t=hm(),n=fn(e)?li(e):e;return iU.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)||oU.some(r=>(n.willChange||"").includes(r))||aU.some(r=>(n.contain||"").includes(r))}function sU(e){let t=co(e);for(;On(t)&&!ao(t);){if(fw(t))return t;if(fm(t))return null;t=co(t)}return null}function hm(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const lU=new Set(["html","body","#document"]);function ao(e){return lU.has(Ja(e))}function li(e){return Hn(e).getComputedStyle(e)}function pm(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||Yv(e)&&e.host||ho(e);return Yv(t)?t.host:t}function fO(e){const t=co(e);return ao(t)?e.ownerDocument?e.ownerDocument.body:e.body:On(t)&&es(t)?t:fO(t)}function Va(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=fO(e),a=o===((r=e.ownerDocument)==null?void 0:r.body),l=Hn(o);if(a){const c=Kv(l);return t.concat(l,l.visualViewport||[],es(o)?o:[],c&&n?Va(c):[])}return t.concat(o,Va(o,[],n))}function Kv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Eb=Yx[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],cU=Eb&&Eb!==v.useLayoutEffect?Eb:e=>e();function Ge(e){const t=rr(uU).current;return t.next=e,cU(t.effect),t.trampoline}function uU(){const e={next:void 0,callback:dU,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function dU(){}const fU={...Yx},hU=()=>{},qe=typeof document<"u"?v.useLayoutEffect:hU,hO=v.createContext(void 0);function hw(e=!1){const t=v.useContext(hO);if(t===void 0&&!e)throw new Error(Rn(16));return t}function pU(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=hw(!0)!==void 0,c=Ge(()=>{const y=a.current;return!!((y==null?void 0:y.tagName)==="A"&&(y!=null&&y.href))}),{props:f}=pU({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:r,isNativeButton:o}),d=v.useCallback(()=>{const y=a.current;mU(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 Mi({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||($v(M),R==null||R(M)),M.baseUIHandlerPrevented)return;const A=M.target===M.currentTarget&&!o&&!c()&&!t,O=M.key==="Enter",N=M.key===" ";A&&((N||O)&&M.preventDefault(),O&&(g==null||g(M)))},onKeyUp(M){t||($v(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 mU(e){return On(e)&&e.tagName==="BUTTON"}const gU=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]})}),yU=um("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(gU,{"data-slot":"button",className:De(yU({variant:t,size:n,className:e})),...r})}let aC=(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 bU={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},pw={valid(e){return e===null?null:e?{[aC.valid]:""}:{[aC.invalid]:""}}},vU=v.createContext({invalid:void 0,name:void 0,validityData:{state:bU,errors:[],error:"",value:"",initialValue:null},setValidityData:Hr,disabled:void 0,touched:!1,setTouched:Hr,dirty:!1,setDirty:Hr,filled:!1,setFilled:Hr,focused:!1,setFocused:Hr,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 Pc(e=!0){const t=v.useContext(vU);if(t.setValidityData===Hr&&!e)throw new Error(Rn(28));return t}const xU=v.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Hr,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function mw(){return v.useContext(xU)}let sC=0;function wU(e,t="mui"){const[n,r]=v.useState(e),o=e||n;return v.useEffect(()=>{n==null&&(sC+=1,r(`${t}-${sC}`))},[n,t]),o}const lC=fU.useId;function ts(e,t){if(lC!==void 0){const n=lC();return e??(t?`${t}-${n}`:n)}return wU(e,t)}function Yi(e){return ts(e,"base-ui")}const SU=v.createContext({controlId:void 0,registerControlId:Hr,labelId:void 0,setLabelId:Hr,messageIds:[],setMessageIds:Hr,getDescriptionProps:e=>e});function mm(){return v.useContext(SU)}const EU=[];function gm(e){v.useEffect(e,EU)}const Hu=0;class uo{constructor(){tt(this,"currentId",Hu);tt(this,"clear",()=>{this.currentId!==Hu&&(clearTimeout(this.currentId),this.currentId=Hu)});tt(this,"disposeEffect",()=>this.clear)}static create(){return new uo}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Hu,n()},t)}isStarted(){return this.currentId!==Hu}}function Dn(){const e=rr(uo.create).current;return gm(e.disposeEffect),e}function TU(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function Gt(e){return(e==null?void 0:e.ownerDocument)||document}const Lc=typeof navigator<"u",Tb=CU(),pO=MU(),mO=kU(),ym=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),gO=Tb.platform==="MacIntel"&&Tb.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Tb.platform),yO=Lc&&/apple/i.test(navigator.vendor),Wv=Lc&&/android/i.test(pO)||/android/i.test(mO),RU=Lc&&pO.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,bO=mO.includes("jsdom/");function CU(){if(!Lc)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 kU(){if(!Lc)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function MU(){if(!Lc)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}const Xv="data-base-ui-focusable",vO="active",xO="selected",wO="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",$a="ArrowLeft",Ga="ArrowRight",gw="ArrowUp",Xd="ArrowDown";function ii(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&&Yv(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Np(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 OU(e){return e.matches("html,body")}function bm(e){return On(e)&&e.matches(wO)}function Qv(e){return e?e.getAttribute("role")==="combobox"&&bm(e):!1}function NU(e){if(!e||bO)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Md(e){return e?e.hasAttribute(Xv)?e:e.querySelector(`[${Xv}]`)||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 cC(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 AU(e){return"nativeEvent"in e}function SO(e){return e.pointerType===""&&e.isTrusted?!0:Wv&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function EO(e){return bO?!1:!Wv&&e.width===0&&e.height===0||Wv&&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 TO(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const DU=["top","right","bottom","left"],Ec=Math.min,oi=Math.max,Ap=Math.round,Ql=Math.floor,so=e=>({x:e,y:e}),_U={left:"right",right:"left",bottom:"top",top:"bottom"},IU={start:"end",end:"start"};function Zv(e,t,n){return oi(e,Ec(t,n))}function Yo(e,t){return typeof e=="function"?e(t):e}function qr(e){return e.split("-")[0]}function ns(e){return e.split("-")[1]}function yw(e){return e==="x"?"y":"x"}function bw(e){return e==="y"?"height":"width"}const PU=new Set(["top","bottom"]);function Ti(e){return PU.has(qr(e))?"y":"x"}function vw(e){return yw(Ti(e))}function LU(e,t,n){n===void 0&&(n=!1);const r=ns(e),o=vw(e),a=bw(o);let l=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(l=Dp(l)),[l,Dp(l)]}function jU(e){const t=Dp(e);return[Jv(e),t,Jv(t)]}function Jv(e){return e.replace(/start|end/g,t=>IU[t])}const uC=["left","right"],dC=["right","left"],zU=["top","bottom"],FU=["bottom","top"];function BU(e,t,n){switch(e){case"top":case"bottom":return n?t?dC:uC:t?uC:dC;case"left":case"right":return t?zU:FU;default:return[]}}function UU(e,t,n,r){const o=ns(e);let a=BU(qr(e),n==="start",r);return o&&(a=a.map(l=>l+"-"+o),t&&(a=a.concat(a.map(Jv)))),a}function Dp(e){return e.replace(/left|right|bottom|top/g,t=>_U[t])}function HU(e){return{top:0,right:0,bottom:0,left:0,...e}}function RO(e){return typeof e!="number"?HU(e):{top:e,right:e,bottom:e,left:e}}function _p(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 ec(e,t){return t<0||t>=e.current.length}function up(e,t){return pr(e,{disabledIndices:t})}function ex(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 CO(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 A=k.closest('[role="row"]');A&&(x=!0),(A!==T||C===-1)&&(T=A,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 A=new Set;for(;M>=0&&M<y.length&&!A.has(M);){A.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===gw){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}ec(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}))),ec(e,h)&&(h=d))}if(n==="both"){const T=Ql(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=Ql(f/a)===T;ec(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 kO(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 MO(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 OO(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 qU=["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] *)"],Ip=qU.join(","),NO=typeof Element>"u",Tc=NO?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Pp=!NO&&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},Lp=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]"):Lp(t.parentNode));return l},VU=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},AO=function(t,n,r){if(Lp(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Ip));return n&&Tc.call(t,Ip)&&o.unshift(t),o=o.filter(r),o},jp=function(t,n,r){for(var o=[],a=Array.from(t);a.length;){var l=a.shift();if(!Lp(l,!1))if(l.tagName==="SLOT"){var c=l.assignedElements(),f=c.length?c:l.children,d=jp(f,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:l,candidates:d})}else{var m=Tc.call(l,Ip);m&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var h=l.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(l),y=!Lp(h,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(h&&y){var g=jp(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},DO=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},_O=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||VU(t))&&!DO(t)?0:t.tabIndex},$U=function(t,n){var r=_O(t);return r<0&&n&&!DO(t)?0:r},GU=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},IO=function(t){return t.tagName==="INPUT"},YU=function(t){return IO(t)&&t.type==="hidden"},KU=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},WU=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},XU=function(t){if(!t.name)return!0;var n=t.form||Pp(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=WU(o,t.form);return!a||a===t},QU=function(t){return IO(t)&&t.type==="radio"},ZU=function(t){return QU(t)&&!XU(t)},JU=function(t){var n,r=t&&Pp(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=Pp(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},fC=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},eH=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=Tc.call(t,"details>summary:first-of-type"),c=l?t.parentElement:t;if(Tc.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=Pp(t);if(d&&!d.shadowRoot&&o(d)===!0)return fC(t);t.assignedSlot?t=t.assignedSlot:!d&&m!==t.ownerDocument?t=m.host:t=d}t=f}if(JU(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return fC(t);return!1},tH=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 Tc.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},tx=function(t,n){return!(n.disabled||YU(n)||eH(n,t)||KU(n)||tH(n))},nx=function(t,n){return!(ZU(n)||_O(n)<0||!tx(t,n))},nH=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},PO=function(t){var n=[],r=[];return t.forEach(function(o,a){var l=!!o.scopeParent,c=l?o.scopeParent:o,f=$U(c,l),d=l?PO(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(GU).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=jp([t],n.includeContainer,{filter:nx.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:nH}):r=AO(t,n.includeContainer,nx.bind(null,n)),PO(r)},rH=function(t,n){n=n||{};var r;return n.getShadowRoot?r=jp([t],n.includeContainer,{filter:tx.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=AO(t,n.includeContainer,tx.bind(null,n)),r},LO=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Tc.call(t,Ip)===!1?!1:nx(n,t)};const jc=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function jO(e,t){const n=Qd(e,jc()),r=n.length;if(r===0)return;const o=ii(Gt(e)),a=n.indexOf(o),l=a===-1?t===1?0:r-1:a+t;return n[l]}function xw(e){return jO(Gt(e).body,1)||e}function zO(e){return jO(Gt(e).body,-1)||e}function FO(e,t){if(!e)return null;const n=Qd(Gt(e).body,jc()),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 iH(e){return FO(e,1)}function oH(e){return FO(e,-1)}function tc(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Tt(n,r)}function aH(e){Qd(e,jc()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function hC(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 sH{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 sH;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 gm(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 lH={[Zs.startingStyle]:""},cH={[Zs.endingStyle]:""},Xo={transitionStatus(e){return e==="starting"?lH:e==="ending"?cH:null}};function BO(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=BO(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 Rc({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 vm(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:o,registerControlId:a}=mm(),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===Hr||(d.current=!1,a(f.current,void 0))});return qe(()=>{if(a===Hr)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 ww(e){const{enabled:t=!0,value:n,id:r,name:o,controlRef:a,commit:l}=e,{formRef:c}=mw(),{invalid:f,markedDirtyRef:d,validityData:m,setValidityData:h}=Pc(),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:TU(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",nc="trigger-focus",xm="outside-press",cd="item-press",uH="close-press",Js="focus-out",wm="escape-key",dp="list-navigation",Sw="cancel-open",fp="sibling-open",dH="disabled",Ew="imperative-action",fH="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 hH=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:A,validation:O}=Pc(),N=E||f,_=x??l,q={...g,disabled:N},{labelId:F}=mm(),G=vm({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===ii(Gt(P.current))&&k(!0)},[h,k]);const[U]=Rc({controlled:c,default:m,name:"FieldControl",state:"value"}),H=c!==void 0,B=H?U:void 0;return ww({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),A==="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:pw})}),pH=v.forwardRef(function(t,n){return w.jsx(hH,{ref:n,...t})});function ji({className:e,type:t,...n}){return w.jsx(pH,{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 Tw=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 mH({className:e,orientation:t="horizontal",...n}){return w.jsx(Tw,{"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 Rw=v.createContext(void 0);function rs(e){const t=v.useContext(Rw);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})({}),zp=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const gH={[zp.popupOpen]:""},yH={[zp.popupOpen]:"",[zp.pressed]:""},bH={[Ds.open]:""},vH={[Ds.closed]:""},xH={[Ds.anchorHidden]:""},UO={open(e){return e?gH:null}},Fp={open(e){return e?yH:null}},po={open(e){return e?bH:vH},anchorHidden(e){return e?xH:null}},wH={...po,...Xo},Cw=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:wH,props:[{role:"presentation",hidden:!m,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:a||!d})}),Sm=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(uH,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]})}),kw=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(SH,e).current;return t.next=e,qe(t.effect),t}function SH(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function HO(){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 Mw{constructor(){tt(this,"nodesRef",{current:[]});tt(this,"events",HO())}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 qO=v.createContext(null),VO=v.createContext(null),Zo=()=>{var e;return((e=v.useContext(qO))==null?void 0:e.id)||null},is=e=>{const t=v.useContext(VO);return e??t};function $O(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 EH(e){const{children:t,id:n}=e,r=Zo();return w.jsx(qO.Provider,{value:v.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function TH(e){const{children:t,externalTree:n}=e,r=rr(()=>n??new Mw).current;return w.jsx(VO.Provider,{value:r,children:t})}function Cc(e){return`data-base-ui-${e}`}function hp(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 RH=v.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new uo,currentIdRef:{current:null},currentContextRef:{current:null}});function CH(e,t={open:!1}){const n="rootStore"in e?e.rootStore:e,r=n.useState("floatingId"),{open:o}=t,a=v.useContext(RH),{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:hp(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 GO={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Em={...GO,position:"fixed",top:0,left:0},YO={...GO,position:"absolute"},kc=v.forwardRef(function(t,n){const[r,o]=v.useState();qe(()=>{yO&&o("button")},[]);const a={tabIndex:0,role:r};return w.jsx("span",{...t,ref:n,style:Em,"aria-hidden":r?void 0:!0,...a,"data-base-ui-focus-guard":""})});let pC=0;function ud(e,t={}){const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(pC);const a=()=>e==null?void 0:e.focus({preventScroll:n});o?a():pC=requestAnimationFrame(a)}const rc={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function mC(e){return e==="inert"?rc.inert:e==="aria-hidden"?rc["aria-hidden"]:rc.none}let Fh=new WeakSet,Bh={},Rb=0;const KO=e=>e&&(e.host||KO(e.parentNode)),kH=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=KO(n);return e.contains(r)?r:null}).filter(n=>n!=null);function MH(e,t,n,r){const o="data-base-ui-inert",a=r?"inert":n?"aria-hidden":null,l=kH(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=mC(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 Rb+=1,()=>{d.forEach(g=>{const x=mC(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)}),Rb-=1,Rb||(rc.inert=new WeakMap,rc["aria-hidden"]=new WeakMap,rc.none=new WeakMap,Fh=new WeakSet,Bh={})}}function OH(e,t=!1,n=!1){const r=Gt(e[0]).body;return MH(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const WO=v.createContext(null),XO=()=>v.useContext(WO),NH=Cc("portal");function QO(e={}){const{ref:t,container:n,componentProps:r=Pn,elementProps:o}=e,a=ts(),l=XO(),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&&(dw(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,[NH]:""},o]});return{portalNode:m,portalSubtree:f&&x?yr.createPortal(x,f):null}}const Ow=v.forwardRef(function(t,n){const{children:r,container:o,className:a,render:l,renderGuards:c,...f}=t,{portalNode:d,portalSubtree:m}=QO({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 A(O){d&&O.relatedTarget&&tc(O)&&(O.type==="focusin"?hC:aH)(d)}return d.addEventListener("focusin",A,!0),d.addEventListener("focusout",A,!0),()=>{d.removeEventListener("focusin",A,!0),d.removeEventListener("focusout",A,!0)}},[d,T]),v.useEffect(()=>{!d||C||hC(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(WO.Provider,{value:M,children:[k&&d&&w.jsx(kc,{"data-type":"outside",ref:h,onFocus:A=>{var O;if(tc(A,d))(O=g.current)==null||O.focus();else{const N=E?E.domReference:null,_=zO(N);_==null||_.focus()}}}),k&&d&&w.jsx("span",{"aria-owns":d.id,style:aB}),d&&yr.createPortal(r,d),k&&d&&w.jsx(kc,{"data-type":"outside",ref:y,onFocus:A=>{var O;if(tc(A,d))(O=x.current)==null||O.focus();else{const N=E?E.domReference:null,_=xw(N);_==null||_.focus(),E!=null&&E.closeOnFocusOut&&(E==null||E.onOpenChange(!1,yt(Js,A.nativeEvent)))}}})]})]})});function AH(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 gC=20;let Ua=[];function Nw(){Ua=Ua.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function DH(e){Nw(),e&&Ja(e)!=="body"&&(Ua.push(new WeakRef(e)),Ua.length>gC&&(Ua=Ua.slice(-gC)))}function Cb(){var e;return Nw(),(e=Ua[Ua.length-1])==null?void 0:e.deref()}function _H(e){if(!e)return null;const t=jc();return LO(e,t)?e:Qd(e,t)[0]||e}function IH(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():li(e).display!=="none"}function yC(e,t){var l;if(!t.current.includes("floating")&&!((l=e.getAttribute("role"))!=null&&l.includes("dialog")))return;const n=jc(),o=rH(e,n).filter(c=>{const f=c.getAttribute("data-tabindex")||"";return LO(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 Aw(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}),A=o===!1,O=Qv(R)&&A,N=v.useRef(["content"]),_=lr(o),q=lr(a),F=lr(d),G=is(g),P=XO(),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=Md(T),Se=Ge((he=ve)=>he?Qd(he,jc()):[]),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,ii(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(`[${oB}]`)&&(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(Cc("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)})||cC(G.nodesRef.current,_e).find(ee=>{var fe,Ne,Ue;return[(fe=ee.context)==null?void 0:fe.elements.floating,Md((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&&yC(ve,N),l&&Be!==R&&!IH(Ve)&&ii(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!==Cb())&&(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(`[${Cc("portal")}]`))||[]),Le=(J=(Ce=(G?cC(G.nodesRef.current,M()):[]).find(Ee=>{var xe;return Qv(((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 OH(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=ii(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)&&ud(Ce,{preventScroll:Ce===ve})})},[r,E,ve,A,Pe,_,F]),qe(()=>{if(r||!ve)return;const he=Gt(ve),ye=ii(he);DH(ye);function Le(Ce){if(Ce.open||(K.current=AH(Ce.nativeEvent,L.current)),Ce.reason===wr&&Ce.nativeEvent.type==="mouseleave"&&(B.current=!0),Ce.reason===xm)if(Ce.nested)B.current=!1;else if(SO(Ce.nativeEvent)||EO(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,Em),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||Cb();return xe&&xe.isConnected?xe:Oe}const Ee=R||Cb()||Oe;return zo(J)||Ee}return()=>{C.off("openchange",Le);const Ce=ii(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=_H(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(!ym||E||!T)return;const he=ii(Gt(T));!On(he)||!bm(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 yC(ve,N),()=>{queueMicrotask(Nw)}},[r,ve,N]);const te=!r&&(c?!O:!0)&&(ue||c);return w.jsxs(v.Fragment,{children:[te&&w.jsx(kc,{"data-type":"inside",ref:I,onFocus:he=>{var ye;if(c){const Le=Pe();ud(Le[Le.length-1])}else if(P!=null&&P.portalNode)if(B.current=!1,tc(he,P.portalNode)){const Le=xw(R);Le==null||Le.focus()}else(ye=zo(h??P.beforeOutsideRef))==null||ye.focus()}}),n,te&&w.jsx(kc,{"data-type":"inside",ref:Q,onFocus:he=>{var ye;if(c)ud(Pe()[0]);else if(P!=null&&P.portalNode)if(f&&(B.current=!0),tc(he,P.portalNode)){const Le=zO(R);Le==null||Le.focus()}else(ye=zo(m??P.afterOutsideRef))==null||ye.focus()}})]})}function ZO(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,A=n.select("domReferenceElement")!==E.currentTarget,O=C&&A||!(C&&l&&(!(k&&f)||M==="click"||M==="mousedown"));if(bm(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)||TO(C))),A=yt(m,E.nativeEvent,E.currentTarget);M&&R==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,A)}):n.setOpen(M,A)},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 PH(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 bC(e){return e!=null&&e.clientX!=null}function LH(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,A,O)=>{d.current||l.current.openEvent&&!bC(l.current.openEvent)||n.set("positionReference",PH(O??a,{x:M,y:A,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 A(O){const N=gr(O);Tt(o,N)?(M.removeEventListener("mousemove",A),m.current=null):E(O.clientX,O.clientY)}if(!l.current.openEvent||bC(l.current.openEvent)){M.addEventListener("mousemove",A);const O=()=>{M.removeEventListener("mousemove",A),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(A){y(A.pointerType)}return{onPointerDown:M,onPointerEnter:M,onMouseMove:R,onMouseEnter:R}},[R]);return v.useMemo(()=>c?{reference:k,trigger:k}:{},[c,k])}function vC(e,t,n){let{reference:r,floating:o}=e;const a=Ti(t),l=vw(t),c=bw(l),f=qr(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 jH(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=RO(g),R=c[y?h==="floating"?"reference":"floating":h],T=_p(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},A=_p(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:C,offsetParent:k,strategy:f}):C);return{top:(T.top-A.top+x.top)/M.y,bottom:(A.bottom-T.bottom+x.bottom)/M.y,left:(T.left-A.left+x.left)/M.x,right:(A.right-T.right+x.right)/M.x}}const zH=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}=vC(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:A,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:jH},elements:{reference:e,floating:t}});m=k??m,h=M??h,g={...g,[T]:{...g[T],...A}},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}=vC(d,y,f)),R=-1)}return{x:m,y:h,placement:y,strategy:o,middlewareData:g}},FH=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=qr(o),C=Ti(c),k=qr(c)===c,M=await(f.isRTL==null?void 0:f.isRTL(d.floating)),A=y||(k||!E?[Dp(c)]:jU(c)),O=x!=="none";!y&&O&&A.push(...UU(c,E,x,M));const N=[c,...A],_=await f.detectOverflow(t,R),q=[];let F=((r=a.flip)==null?void 0:r.overflows)||[];if(m&&q.push(_[T]),h){const H=LU(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!==Ti(B):!1)||F.every(V=>Ti(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=Ti(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 xC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function wC(e){return DU.some(t=>e[t]>=0)}const BH=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=xC(l,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:wC(c)}}}case"escaped":{const l=await r.detectOverflow(t,{...a,altBoundary:!0}),c=xC(l,n.floating);return{data:{escapedOffsets:c,escaped:wC(c)}}}default:return{}}}}},JO=new Set(["left","top"]);async function UH(e,t){const{placement:n,platform:r,elements:o}=e,a=await(r.isRTL==null?void 0:r.isRTL(o.floating)),l=qr(n),c=ns(n),f=Ti(n)==="y",d=JO.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 HH=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 UH(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}}}}},qH=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=Ti(qr(o)),g=yw(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=Zv(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=Zv(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}}}}}},VH=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=Ti(o),y=yw(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,A=a.reference[y]+a.reference[k]-R.mainAxis;g<M?g=M:g>A&&(g=A)}if(d){var T,C;const k=y==="y"?"width":"height",M=JO.has(qr(o)),A=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<A?x=A:x>O&&(x=O)}return{[y]:g,[h]:x}}}},$H=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=qr(o),y=ns(o),g=Ti(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=Ec(E-m[R],C),A=Ec(x-m[T],k),O=!t.middlewareData.shift;let N=M,_=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(_=k),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(N=C),O&&!y){const F=oi(m.left,0),G=oi(m.right,0),P=oi(m.top,0),U=oi(m.bottom,0);g?_=x-2*(F!==0||G!==0?F+G:oi(m.left,m.right)):N=E-2*(P!==0||U!==0?P+U:oi(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 eN(e){const t=li(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=Ap(n)!==a||Ap(r)!==l;return c&&(n=a,r=l),{width:n,height:r,$:c}}function Dw(e){return fn(e)?e:e.contextElement}function ic(e){const t=Dw(e);if(!On(t))return so(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:a}=eN(t);let l=(a?Ap(n.width):n.width)/r,c=(a?Ap(n.height):n.height)/o;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const GH=so(0);function tN(e){const t=Hn(e);return!hm()||!t.visualViewport?GH:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function YH(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=Dw(e);let l=so(1);t&&(r?fn(r)&&(l=ic(r)):l=ic(e));const c=YH(a,n,r)?tN(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=Kv(x);for(;E&&r&&g!==x;){const R=ic(E),T=E.getBoundingClientRect(),C=li(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=Kv(x)}}return _p({width:m,height:h,x:f,y:d})}function Tm(e,t){const n=pm(e).scrollLeft;return t?t.left+n:el(ho(e)).left+n}function nN(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Tm(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function KH(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const a=o==="fixed",l=ho(r),c=t?fm(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=pm(r)),On(r))){const g=el(r);d=ic(r),m.x=g.x+r.clientLeft,m.y=g.y+r.clientTop}const y=l&&!h&&!a?nN(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 WH(e){return Array.from(e.getClientRects())}function XH(e){const t=ho(e),n=pm(e),r=e.ownerDocument.body,o=oi(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=oi(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Tm(e);const c=-n.scrollTop;return li(r).direction==="rtl"&&(l+=oi(t.clientWidth,r.clientWidth)-o),{width:o,height:a,x:l,y:c}}const SC=25;function QH(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=hm();(!m||m&&t==="fixed")&&(c=o.offsetLeft,f=o.offsetTop)}const d=Tm(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<=SC&&(a-=x)}else d<=SC&&(a+=d);return{width:a,height:l,x:c,y:f}}const ZH=new Set(["absolute","fixed"]);function JH(e,t){const n=el(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,a=On(e)?ic(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 EC(e,t,n){let r;if(t==="viewport")r=QH(e,n);else if(t==="document")r=XH(ho(e));else if(fn(t))r=JH(t,n);else{const o=tN(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return _p(r)}function rN(e,t){const n=co(e);return n===t||!fn(n)||ao(n)?!1:li(n).position==="fixed"||rN(n,t)}function e6(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=li(e).position==="fixed";let l=a?co(e):e;for(;fn(l)&&!ao(l);){const c=li(l),f=fw(l);!f&&c.position==="fixed"&&(o=null),(a?!f&&!o:!f&&c.position==="static"&&!!o&&ZH.has(o.position)||es(l)&&!f&&rN(e,l))?r=r.filter(m=>m!==l):o=c,l=co(l)}return t.set(e,r),r}function t6(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const l=[...n==="clippingAncestors"?fm(t)?[]:e6(t,this._c):[].concat(n),r],c=l[0],f=l.reduce((d,m)=>{const h=EC(t,m,o);return d.top=oi(h.top,d.top),d.right=Ec(h.right,d.right),d.bottom=Ec(h.bottom,d.bottom),d.left=oi(h.left,d.left),d},EC(t,c,o));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function n6(e){const{width:t,height:n}=eN(e);return{width:t,height:n}}function r6(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=Tm(o)}if(r||!r&&!a)if((Ja(t)!=="body"||es(o))&&(c=pm(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?nN(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 kb(e){return li(e).position==="static"}function TC(e,t){if(!On(e)||li(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ho(e)===n&&(n=n.ownerDocument.body),n}function iN(e,t){const n=Hn(e);if(fm(e))return n;if(!On(e)){let o=co(e);for(;o&&!ao(o);){if(fn(o)&&!kb(o))return o;o=co(o)}return n}let r=TC(e,t);for(;r&&nU(r)&&kb(r);)r=TC(r,t);return r&&ao(r)&&kb(r)&&!fw(r)?n:r||sU(e)||n}const i6=async function(e){const t=this.getOffsetParent||iN,n=this.getDimensions,r=await n(e.floating);return{reference:r6(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function o6(e){return li(e).direction==="rtl"}const a6={convertOffsetParentRelativeRectToViewportRelativeRect:KH,getDocumentElement:ho,getClippingRect:t6,getOffsetParent:iN,getElementRects:i6,getClientRects:WH,getDimensions:n6,getScale:ic,isElement:fn,isRTL:o6};function oN(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function s6(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=Ql(h),E=Ql(o.clientWidth-(m+y)),R=Ql(o.clientHeight-(h+g)),T=Ql(m),k={rootMargin:-x+"px "+-E+"px "+-R+"px "+-T+"px",threshold:oi(0,Ec(1,f))||1};let M=!0;function A(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&&!oN(d,e.getBoundingClientRect())&&l(),M=!1}try{n=new IntersectionObserver(A,{...k,root:o.ownerDocument})}catch{n=new IntersectionObserver(A,k)}n.observe(e)}return l(!0),a}function RC(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=Dw(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?s6(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&&!oN(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 l6=HH,c6=qH,u6=FH,d6=$H,f6=BH,h6=VH,p6=(e,t,n)=>{const r=new Map,o={platform:a6,...n},a={...o.platform,_c:r};return zH(e,t,{...o,platform:a})};var m6=typeof document<"u",g6=function(){},pp=m6?v.useLayoutEffect:g6;function Bp(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(!Bp(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)&&!Bp(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function aN(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function CC(e,t){const n=aN(e);return Math.round(t*n)/n}function Mb(e){const t=v.useRef(e);return pp(()=>{t.current=e}),t}function y6(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);Bp(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,A=l||R,O=v.useRef(null),N=v.useRef(null),_=v.useRef(m),q=f!=null,F=Mb(f),G=Mb(o),P=Mb(d),U=v.useCallback(()=>{if(!O.current||!N.current)return;const V={placement:t,strategy:n,middleware:y};G.current&&(V.platform=G.current),p6(O.current,N.current,V).then(K=>{const L={...K,isPositioned:P.current!==!1};H.current&&!Bp(_.current,L)&&(_.current=L,yr.flushSync(()=>{h(L)}))})},[y,t,n,G,P]);pp(()=>{d===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,h(V=>({...V,isPositioned:!1})))},[d]);const H=v.useRef(!1);pp(()=>(H.current=!0,()=>{H.current=!1}),[]),pp(()=>{if(M&&(O.current=M),A&&(N.current=A),M&&A){if(F.current)return F.current(M,A,U);U()}},[M,A,U,F,q]);const B=v.useMemo(()=>({reference:O,floating:N,setReference:C,setFloating:k}),[C,k]),j=v.useMemo(()=>({reference:M,floating:A}),[M,A]),z=v.useMemo(()=>{const V={position:n,left:0,top:0};if(!j.floating)return V;const K=CC(j.floating,m.x),L=CC(j.floating,m.y);return c?{...V,transform:"translate("+K+"px, "+L+"px)",...aN(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 b6=(e,t)=>({...l6(e),options:[e,t]}),v6=(e,t)=>({...c6(e),options:[e,t]}),x6=(e,t)=>({...h6(e),options:[e,t]}),w6=(e,t)=>({...u6(e),options:[e,t]}),S6=(e,t)=>({...d6(e),options:[e,t]}),E6=(e,t)=>({...f6(e),options:[e,t]}),T6={intentional:"onClick",sloppy:"onPointerDown"};function R6(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 Rm(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,A=v.useRef(!1),{escapeKey:O,outsidePress:N}=R6(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=AU(te)?te.nativeEvent:te,Oe=yt(wm,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=`[${Cc("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)&&!OU(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=li(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(xm,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=A.current;if(A.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(hm()?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(),A.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&&{[T6[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||(A.current=!0)}),Se=Ge(te=>{!r||!d||te.button!==0||(A.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 Up=Symbol("NOT_FOUND");function C6(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function k6(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function M6(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 kC=e=>Array.isArray(e)?e:[e];function O6(e){const t=Array.isArray(e[0])?e[0]:e;return M6(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function N6(e,t){const n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}function A6(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Up},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function D6(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 Up}function o(c,f){r(c)===Up&&(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 _6=(e,t)=>e===t;function I6(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 P6(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=_6,maxSize:o=1,resultEqualityCheck:a}=n,l=I6(r);let c=0;const f=o<=1?A6(l):D6(o,l);function d(){let m=f.get(arguments);if(m===Up){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 L6=class{constructor(e){this.value=e}deref(){return this.value}},j6=typeof WeakRef<"u"?WeakRef:L6,z6=0,MC=1;function Uh(){return{s:z6,v:void 0,o:null,p:null}}function sN(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===MC)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 j6(m):m}return d.s=MC,d.v=m,m}return l.clearCache=()=>{n=Uh(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}function lN(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()),C6(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const m={...n,...f},{memoize:h,memoizeOptions:y=[],argsMemoize:g=sN,argsMemoizeOptions:x=[]}=m,E=kC(y),R=kC(x),T=O6(o),C=h(function(){return a++,d.apply(null,arguments)},...E),k=g(function(){l++;const A=N6(T,arguments);return c=C.apply(null,A),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 F6=lN(sN),B6=Object.assign((e,t=F6)=>{k6(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:()=>B6});lN({memoize:P6,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 Ob={exports:{}},Nb={};/**
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 OC;function U6(){if(OC)return Nb;OC=1;var e=Vd(),t=$2();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 Nb.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,A=h===void 0?null:h;return[function(){return T(m())},A===null?void 0:function(){return T(A())}]},[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},Nb}var NC;function H6(){return NC||(NC=1,Ob.exports=U6()),Ob.exports}var q6=H6();const rx=[];let ix;function V6(){return ix}function $6(e){rx.push(e)}function _w(e){const t=(n,r)=>{const o=rr(G6).current;let a;try{ix=o;for(const l of rx)l.before(o);a=e(n,r);for(const l of rx)l.after(o);o.didInitialize=!0}finally{ix=void 0}return a};return t.displayName=e.displayName||e.name,t}function cN(e){return v.forwardRef(_w(e))}function G6(){return{didInitialize:!1}}const Y6=cw(19),K6=Y6?X6:Q6;function Rt(e,t,n,r,o){return K6(e,t,n,r,o)}function W6(e,t,n,r,o){const a=v.useCallback(()=>t(e.getSnapshot(),n,r,o),[e,t,n,r,o]);return lw.useSyncExternalStore(e.subscribe,a,a)}$6({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()}}),lw.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function X6(e,t,n,r,o){const a=V6();if(!a)return W6(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 Q6(e,t,n,r,o){return q6.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,a=>t(a,n,r,o))}class uN{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 Cm extends uN{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??Hr);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 Z6={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 Iw extends Cm{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:HO(),nested:r,noEmit:o,triggerElements:l},Z6);tt(this,"setOpen",(n,r)=>{var o,a;if((!n||!this.state.open||TO(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 J6(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 dN(e,t,n,r){const o=n.useState("isMountedByTrigger",e),a=J6(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 Pw(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 Lw(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 e8(){return new Iw({open:!1,floatingElement:null,referenceElement:null,triggerElements:new ef,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function jw(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:e8(),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),zw={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 fN(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,o=ts(),a=Zo()!=null,l=rr(()=>new Iw({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 t8(e={}){const{nodeId:t,externalTree:n}=e,r=fN(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=y6({...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"),A=o.useState("floatingId"),O=v.useMemo(()=>({...m,dataRef:o.context.dataRef,open:M,onOpenChange:o.setOpen,events:o.context.events,floatingId:A,refs:C,elements:k,nodeId:t,rootStore:o}),[m,C,k,t,o,M,A]);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 Fw(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 Iw({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 Ab=RU&&yO;function hN(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===ii(Gt(T))&&(c.current=!0)}function E(){m.current=!0}function R(){m.current=!1}return g.addEventListener("blur",x),Ab&&(g.addEventListener("keydown",E,!0),g.addEventListener("pointerdown",R,!0)),()=>{g.removeEventListener("blur",x),Ab&&(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===wm){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(Ab&&!y.relatedTarget){if(!m.current&&!bm(x))return}else if(!NU(x))return}const E=Np(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(nc,R,T));return}d.start(C,()=>{c.current||n.setOpen(!0,yt(nc,R,T))})},onBlur(y){c.current=!1,f.current=null;const g=y.relatedTarget,x=y.nativeEvent,E=fn(g)&&g.hasAttribute(Cc("focus-guard"))&&g.getAttribute("data-type")==="outside";d.start(0,()=>{var k;const R=n.select("domReferenceElement"),T=ii(R?R.ownerDocument:document);!g&&T===R||Tt((k=o.current.floatingContext)==null?void 0:k.refs.floating.current,T)||Tt(R,T)||E||Np(g??T,n.context.triggerElements)||n.setOpen(!1,yt(nc,x))})}}),[o,n,d,l]);return v.useMemo(()=>a?{reference:h,trigger:h}:{},[a,h])}const ox=Cc("safe-polygon"),n8=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${wO}`;function r8(e){return e?!!e.closest(n8):!1}class Bw{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 Bw}}function pN(e){const t=rr(Bw.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||(n.hoverInteractionState=t),gm(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}const i8=new Set(["click","mousedown"]);function mN(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=pN(n),m=is(),h=Zo(),y=Ge(()=>d.interactedInside?!0:l.current.openEvent?i8.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=>Np(k,n.context.triggerElements)),E=v.useCallback((k,M=!0)=>{const A=o8(f,d.pointerType);A&&!d.handler?d.openChangeTimeout.start(A,()=>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(ox),d.performedPointerEventsMutation=!1}}),C=Ge(k=>{const M=gr(k);if(!r8(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,A;if(c&&r&&(k=d.handleCloseOptions)!=null&&k.blockPointerEvents&&g()&&fn(a)&&o){d.performedPointerEventsMutation=!0;const O=Gt(o).body;O.setAttribute(ox,"");const N=a,_=o,q=(A=(M=m==null?void 0:m.nodesRef.current.find(F=>F.id===h))==null?void 0:M.context)==null?void 0:A.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 A(N){y()||E(N,!1)}const O=o;return O&&(O.addEventListener("mouseleave",k),O.addEventListener("mouseenter",M),O.addEventListener("mouseleave",A),O.addEventListener("pointerdown",C,!0)),()=>{O&&(O.removeEventListener("mouseleave",k),O.removeEventListener("mouseenter",M),O.removeEventListener("mouseleave",A),O.removeEventListener("pointerdown",C,!0))}},[c,o,n,l,y,x,E,T,R,C,d])}function o8(e,t){return t&&!Qs(t)?0:typeof e=="function"?e():e}function Db(e){return typeof e=="function"?e():e}const a8={current:null};function gN(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=a8,externalTree:y,isActiveTrigger:g=!0}=t,x=is(y),E=pN(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),A=Ge(G=>Np(G,n.context.triggerElements)),O=v.useCallback((G,P=!0)=>{const U=hp(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(ox),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||A(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)||Db(C.current)>0&&!hp(T.current,"open"))return;const j=hp(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,A(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,A,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||Db(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(Db(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[Xv]="");for(const c in e)o&&e&&(c===vO||c===xO)||(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&&AC(a,f,o,r)}return AC(a,e,o,r),a}function AC(e,t,n,r){var o;for(const a in t){const l=t[a];n&&(a===vO||a===xO)||(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 s8="Escape";function km(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Vh(e,t){return km(t,e===gw||e===Xd,e===$a||e===Ga)}function _b(e,t,n){return km(t,e===Xd,n?e===$a:e===Ga)||e==="Enter"||e===" "||e===""}function l8(e,t,n){return km(t,n?e===$a:e===Ga,e===Xd)}function c8(e,t,n,r){const o=n?e===Ga:e===$a,a=e===gw;return t==="both"||t==="horizontal"&&r&&r>1?e===s8:km(t,o,a)}function yN(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:A="vertical",parentOrientation:O,cols:N=1,id:_,resetOnPointerLeave:q=!0,externalTree:F}=t,G=Md(o),P=lr(G),U=Zo(),H=is(F);qe(()=>{l.current.orientation=A},[l,A]);const B=Qv(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):ud(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||_b(V.current,A,E)||x?up(c):ex(c),V.current=null,L())};Ee()}}else ec(c,f)||(z.current=f,Se(),le.current=!1)}},[m,r,o,f,ue,x,c,A,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=ii(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&&(ud(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&&c8(J.key,A,E,N)){Vh(J.key,he())||mr(J),n.setOpen(!1,yt(dp,J.nativeEvent)),On(a)&&(R?H==null||H.events.emit("virtualfocus",a):a.focus());return}const Ee=z.current,xe=up(c,M),Be=ex(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=kO(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[CO({current:_e.map(ee=>ee!=null?c.current[ee]:null)},{event:J,orientation:A,loopFocus:g,rtl:E,cols:N,disabledIndices:OO([...(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:MO(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)),A==="both")return}if(Vh(J.key,A)){if(mr(J),r&&!R&&ii(J.currentTarget.ownerDocument)===J.currentTarget){z.current=_b(J.key,A,E)?xe:Be,L(J);return}_b(J.key,A,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})),ec(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":A==="both"?void 0:A,...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,A,B,n,r,R,a]),Te=v.useMemo(()=>{function J(xe){T==="auto"&&SO(xe.nativeEvent)&&(j.current=!R)}function Ee(xe){j.current=T,T==="auto"&&EO(xe.nativeEvent)&&(j.current=!0)}return{onKeyDown(xe){const Be=n.select("open");K.current=!1;const Ve=xe.key.startsWith("Arrow"),_e=l8(xe.key,he(),E),ut=Vh(xe.key,A),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=up(c,oe.current),L(xe)):n.setOpen(!0,yt(dp,xe.nativeEvent,xe.currentTarget)));return}ut&&(ue.current!=null&&(z.current=ue.current),mr(xe),!Be&&k?n.setOpen(!0,yt(dp,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,A,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 u8=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function bN(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=Md(l))==null?void 0:C.id)||o},[l,o]),h=u8.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 vN(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(A=>{A?r.current.typing||(r.current.typing=A,f==null||f(A)):r.current.typing&&(r.current.typing=A,f==null||f(A))}),T=Ge(A=>{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):A.key===" "&&mr(A)),N==null||A.key.length!==1||A.ctrlKey||A.metaKey||A.altKey)return;o&&A.key!==" "&&(mr(A),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===A.key&&(g.current="",x.current=E.current),g.current+=A.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):A.key!==" "&&(g.current="",R(!1))}),C=Ge(A=>{const O=A.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(A){A.key===" "&&R(!1)},onBlur:C}),[T,C,R]);return v.useMemo(()=>d?{reference:k,floating:M}:{},[d,k,M])}function DC(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 d8(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function xN(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:A,clientY:O}=k,N=[A,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=d8(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(!DC([A,O],Q)){if(a&&!z)return M();if(!q&&r){const oe=d(k.clientX,k.clientY);if(oe!==null&&oe<.1)return M()}DC([A,O],le([h,y]))?!a&&r&&o.start(40,M):M()}};return m.__options={blockPointerEvents:n},m}let f8=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),h8=(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 wN=v.createContext(void 0);function p8(){const e=v.useContext(wN);if(e===void 0)throw new Error(Rn(26));return e}const oc="ArrowUp",_s="ArrowDown",Od="ArrowLeft",ac="ArrowRight",nf="Home",rf="End",SN=new Set([Od,ac]),m8=new Set([Od,ac,nf,rf]),EN=new Set([oc,_s]),g8=new Set([oc,_s,nf,rf]),TN=new Set([...SN,...EN]),y8=new Set([...TN,nf,rf]),Uw=new Set([oc,_s,Od,ac,nf,rf]),b8="Shift",v8="Control",x8="Alt",w8="Meta",S8=new Set([b8,v8,x8,w8]);function E8(e){return On(e)&&e.tagName==="INPUT"}function _C(e){return!!(E8(e)&&e.selectionStart!=null||On(e)&&e.tagName==="TEXTAREA")}function IC(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=PC(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=PC(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 PC(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 T8={...po,...Xo,nestedDialogOpen(e){return e?{[h8.nestedDialogOpen]:""}:null}},Hw=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"),A=f.useState("role");p8(),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:A,tabIndex:-1,hidden:!x,onKeyDown(G){Uw.has(G.key)&&G.stopPropagation()},style:{[f8.nestedDialogs]:R}},c],ref:[n,f.context.popupRef,f.useStateSetter("popupElement")],stateAttributesMapping:T8});return w.jsx(Aw,{context:h,openInteractionType:C,disabled:!x,closeOnFocusOut:!m,initialFocus:N,returnFocus:o,modal:g!==!1,restoreFocus:"popup",children:F})});function qw(e){return cw(19)?e:e?"true":void 0}const Vw=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}})}),$w=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(wN.Provider,{value:r,children:w.jsxs(Ow,{ref:n,...o,children:[l&&c===!0&&w.jsx(Vw,{ref:a.context.internalBackdropRef,inert:qw(!f)}),t.children]})}):null});function Mm(e){const t=v.useRef(!0);t.current&&(t.current=!1,e())}let LC={},jC={},zC="";function R8(e){if(typeof document>"u")return!1;const t=Gt(e);return Hn(t).innerWidth-t.documentElement.clientWidth>0}function C8(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 k8(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 M8(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(ym&&(((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,LC={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},zC=n.style.scrollBehavior,jC={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",A=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=C8(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||A)&&(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,LC),Object.assign(r.style,jC),c||(n.scrollTop=a,n.scrollLeft=l,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=zC)}function h(){m(),f.request(d)}return d(),o.addEventListener("resize",h),()=>{f.cancel(),m(),typeof o.removeEventListener=="function"&&o.removeEventListener("resize",h)}}class O8{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=Hr;return}const a=gO||!R8(t);this.restore=a?k8(t):M8(t)}}const N8=new O8;function Gw(e=!0,t=null){qe(()=>{if(e)return N8.acquire(t)},[e,t])}function A8(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 Yw(e){const[t,n]=v.useState(null),r=Ge((c,f)=>{e||n(f||(gO?"touch":""))}),o=v.useCallback(()=>{n(null)},[]),{onClick:a,onPointerDown:l}=A8(r);return v.useMemo(()=>({openMethod:t,reset:o,triggerProps:{onClick:a,onPointerDown:l}}),[t,o,a,l])}function RN(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}=Yw(o);Pw(t);const{forceUnmount:h}=Lw(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(Ew))},[t,y]);v.useImperativeHandle(r,()=>({unmount:h,close:g}),[h,g]);const x=Fw({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[E,R]=v.useState(0),T=E===0,C=bN(x),k=Rm(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});Gw(o&&l===!0,c);const{getReferenceProps:M,getFloatingProps:A,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(()=>A(),[A]);t.useSyncedValues({openMethod:f,activeTriggerProps:N,inactiveTriggerProps:_,popupProps:q,floatingRootContext:x,nestedOpenDialogCount:E})}const D8={...zw,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 CN extends Cm{constructor(n){super(_8(n),{popupRef:v.createRef(),backdropRef:v.createRef(),internalBackdropRef:v.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new ef,onOpenChange:void 0,onOpenChangeComplete:void 0},D8);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 _8(e={}){return{...jw(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function kN(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 CN({open:r,openProp:n,activeTriggerId:h,triggerIdProp:m,modal:c,disablePointerDismissal:l,nested:g})).current;Mm(()=>{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");RN({store:x,actionsRef:f,parentContext:y==null?void 0:y.store.context});const R=v.useMemo(()=>({store:x}),[x]);return w.jsx(Rw.Provider,{value:R,children:typeof t=="function"?t({payload:E}):t})}const Kw=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 MN=(...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 I8=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 P8=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 FC=e=>{const t=P8(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 L8={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 j8=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 z8=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,...L8,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:MN("lucide",o),...!a&&!j8(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(z8,{ref:a,iconNode:t,className:MN(`lucide-${I8(FC(e))}`,`lucide-${e}`,r),...o}));return n.displayName=FC(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 F8=[["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"}]],B8=ht("activity",F8);/**
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 U8=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],H8=ht("arrow-down",U8);/**
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 q8=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],V8=ht("arrow-left",q8);/**
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 $8=[["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"}]],G8=ht("bell",$8);/**
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 Y8=[["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"}]],Om=ht("bot",Y8);/**
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 K8=[["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"}]],W8=ht("brain",K8);/**
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 X8=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Hp=ht("check",X8);/**
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 Q8=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ON=ht("chevron-down",Q8);/**
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 Z8=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],of=ht("chevron-right",Z8);/**
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 J8=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],e9=ht("chevron-up",J8);/**
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 t9=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],n9=ht("chevrons-up-down",t9);/**
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 r9=[["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"}]],dd=ht("circle-alert",r9);/**
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 i9=[["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"}]],o9=ht("copy",i9);/**
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 a9=[["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"}]],s9=ht("download",a9);/**
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 l9=[["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"}]],NN=ht("ellipsis-vertical",l9);/**
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 c9=[["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"}]],u9=ht("ellipsis",c9);/**
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 d9=[["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"}]],f9=ht("file-archive",d9);/**
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 h9=[["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"}]],p9=ht("file-braces",h9);/**
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 m9=[["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"}]],g9=ht("file-code",m9);/**
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 y9=[["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"}]],b9=ht("file-headphone",y9);/**
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 v9=[["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"}]],x9=ht("file-image",v9);/**
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 w9=[["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"}]],S9=ht("file-play",w9);/**
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 E9=[["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"}]],Ib=ht("file-text",E9);/**
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 T9=[["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"}]],R9=ht("file",T9);/**
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 C9=[["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"}]],k9=ht("folder-closed",C9);/**
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 M9=[["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"}]],AN=ht("folder-open",M9);/**
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 O9=[["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"}]],N9=ht("folder",O9);/**
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 A9=[["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"}]],Nm=ht("globe",A9);/**
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 D9=[["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"}]],Ww=ht("grip-vertical",D9);/**
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 _9=[["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"}]],I9=ht("history",_9);/**
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 P9=[["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"}]],L9=ht("keyboard",P9);/**
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 j9=[["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"}]],z9=ht("link",j9);/**
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 F9=[["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"}]],B9=ht("list-tree",F9);/**
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 U9=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],tl=ht("loader-circle",U9);/**
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 H9=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],q9=ht("menu",H9);/**
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 V9=[["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",V9);/**
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 $9=[["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"}]],G9=ht("moon",$9);/**
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 Y9=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],K9=ht("panel-left",Y9);/**
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 W9=[["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"}]],X9=ht("panels-top-left",W9);/**
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 Q9=[["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"}]],Am=ht("pencil",Q9);/**
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 Z9=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Dm=ht("plus",Z9);/**
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 J9=[["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"}]],eq=ht("power-off",J9);/**
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 tq=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],nq=ht("power",tq);/**
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 rq=[["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"}]],iq=ht("radar",rq);/**
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 oq=[["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"}]],aq=ht("refresh-ccw",oq);/**
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 sq=[["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"}]],DN=ht("rotate-cw",sq);/**
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 lq=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],cq=ht("search",lq);/**
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 uq=[["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"}]],BC=ht("send",uq);/**
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 dq=[["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"}]],fq=ht("settings",dq);/**
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 hq=[["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"}]],_N=ht("sparkles",hq);/**
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 pq=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],mq=ht("square",pq);/**
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 gq=[["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"}]],yq=ht("sun",gq);/**
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 bq=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],vq=ht("terminal",bq);/**
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 xq=[["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"}]],IN=ht("trash-2",xq);/**
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 wq=[["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"}]],Sq=ht("triangle-alert",wq);/**
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 Eq=[["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"}]],Tq=ht("upload",Eq);/**
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 Rq=[["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"}]],Cq=ht("wrench",Rq);/**
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 kq=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ko=ht("x",kq);/**
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 Mq=[["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"}]],PN=ht("zap",Mq);function Oq({...e}){return w.jsx(kN,{"data-slot":"sheet",...e})}function Nq({...e}){return w.jsx($w,{"data-slot":"sheet-portal",...e})}function Aq({className:e,...t}){return w.jsx(Cw,{"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 Dq="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 _q({className:e,children:t,side:n="right",showCloseButton:r=!0,animation:o="slide",...a}){return w.jsxs(Nq,{children:[w.jsx(Aq,{}),w.jsxs(Hw,{"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"&&Dq,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(Sm,{"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 Iq({className:e,...t}){return w.jsx("div",{"data-slot":"sheet-header",className:De("gap-0.5 p-4 flex flex-col",e),...t})}function Pq({className:e,...t}){return w.jsx(Kw,{"data-slot":"sheet-title",className:De("text-foreground text-base font-medium",e),...t})}function Lq({className:e,...t}){return w.jsx(kw,{"data-slot":"sheet-description",className:De("text-muted-foreground text-sm",e),...t})}const LN=v.createContext(void 0);function sf(e){const t=v.useContext(LN);if(t===void 0&&!e)throw new Error(Rn(72));return t}const jq={...zw,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 Xw extends Cm{constructor(n){super({...zq(),...n},{popupRef:v.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new ef},jq);tt(this,"setOpen",(n,r)=>{var d,m;const o=r.reason,a=o===wr,l=n&&o===nc,c=!n&&(o===Wa||o===wm);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 Xw(r)).current,a=n??o,l=Fw({popupStore:a,onOpenChange:a.setOpen});return a.state.floatingRootContext=l,a}}function zq(){return{...jw(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeDelay:0,hasViewport:!1}}const Fq=_w(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=Xw.useStore(m==null?void 0:m.store,{open:r,openProp:o,activeTriggerId:y,triggerIdProp:h});Mm(()=>{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(dH))},[E,n,x]),x.useSyncedValue("disabled",n),Pw(x);const{forceUnmount:k,transitionStatus:M}=Lw(R,x),A=x.useState("isInstantPhase"),O=x.useState("instantType"),N=x.useState("lastOpenChangeReason"),_=v.useRef(null);qe(()=>{M==="ending"&&N===qi||M!=="ending"&&A?(O!=="delay"&&(_.current=O),x.set("instantType","delay")):_.current!==null&&(x.set("instantType",_.current),_.current=null)},[M,A,N,O,x]),qe(()=>{R&&T==null&&x.set("payload",void 0)},[x,T,R]);const q=v.useCallback(()=>{x.setOpen(!1,Bq(x,Ew))},[x]);v.useImperativeHandle(c,()=>({unmount:k,close:q}),[k,q]);const F=x.useState("floatingRootContext"),G=Rm(F,{enabled:!n,referencePress:!0}),P=LH(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(LN.Provider,{value:x,children:typeof g=="function"?g({payload:C}):g})});function Bq(e,t){const n=yt(t);return n.preventUnmountOnClose=()=>{e.set("preventUnmountingOnClose",!0)},n}const Uq=v.createContext(void 0);function Hq(){return v.useContext(Uq)}let qq=(function(e){return e[e.popupOpen=zp.popupOpen]="popupOpen",e.triggerDisabled="data-trigger-disabled",e})({});const Vq=600,$q=cN(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??Vq,M=d??0,{registerTrigger:A,isMountedByThisTrigger:O}=dN(x,C,g,{payload:l,closeDelay:M}),N=Hq(),{delayRef:_,isInstantPhase:q,hasProvider:F}=CH(T,{open:R});g.useSyncedValue("isInstantPhase",q);const G=g.useState("disabled"),P=c??G,U=g.useState("trackCursorAxis"),H=g.useState("disableHoverablePopup"),B=gN(T,{enabled:!P,mouseOnly:!0,move:!1,handleClose:!H&&U!=="both"?xN():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=hN(T,{enabled:!P}).reference,z={open:R},V=g.useState("triggerProps",O);return At("button",t,{state:z,ref:[n,A,C],props:[B,j,V,{id:x,[qq.triggerDisabled]:P?"":void 0},h],stateAttributesMapping:UO})}),jN=v.createContext(void 0);function Gq(){const e=v.useContext(jN);if(e===void 0)throw new Error(Rn(70));return e}const Yq=v.forwardRef(function(t,n){const{children:r,container:o,className:a,render:l,...c}=t,{portalNode:f,portalSubtree:d}=QO({container:o,ref:n,componentProps:t,elementProps:c});return!d&&!f?null:w.jsxs(v.Fragment,{children:[d,f&&yr.createPortal(r,f)]})}),Kq=v.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t;return sf().useState("mounted")||r?w.jsx(jN.Provider,{value:r,children:w.jsx(Yq,{ref:n,...o})}):null}),zN=v.createContext(void 0);function FN(){const e=v.useContext(zN);if(e===void 0)throw new Error(Rn(71));return e}const Wq=v.createContext(void 0);function zc(){const e=v.useContext(Wq);return(e==null?void 0:e.direction)??"ltr"}const Xq=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=RO(m),g={x:n,y:r},x=vw(o),E=bw(x),R=await l.getDimensions(d),T=x==="y",C=T?"top":"left",k=T?"bottom":"right",M=T?"clientHeight":"clientWidth",A=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=A/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=Zv(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}}}),Qq=(e,t)=>({...Xq(e),options:[e,t]}),Zq={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 E6().fn(e)).data)==null?void 0:c.referenceHidden)||a}}}},mp={sideX:"left",sideY:"top"},Jq={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:mp};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=qr(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":mp.sideX,T=g==="top"?"bottom":mp.sideY;return{x,y:E,data:{sideX:R,sideY:T}}}};function BN(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 UC(e,t,n){const{rects:r,placement:o}=e;return{side:BN(t,qr(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 Qw(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,[A,O]=v.useState(null);!x&&A!==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=zc()==="rtl",j=A||{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=[b6(bt=>{const Dt=UC(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:w6({...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:v6(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:x6(ot=>{if(!le.current)return{};const{width:ft,height:vt}=le.current.getBoundingClientRect(),Ke=Ti(qr(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(S6({...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`)}}),Qq(()=>({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=qr(ft),Lt=Ti(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(UC(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),{}}},Zq,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}=t8({rootContext:g,placement:z,middleware:Se,strategy:n,whileElementsMounted:y?void 0:(...bt)=>RC(...bt,Le),nodeId:T,externalTree:M}),{sideX:pe,sideY:Re}=Ee.adaptiveOrigin||mp,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=(HC(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"&&HC(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 RC(Te.domReference,Te.floating,xe,Le)},[y,x,Te,xe,Le]);const Ue=qr(Be),$e=BN(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 HC(e){return e!=null&&"current"in e}function Fc(e){return e==="starting"?iB:Pn}const e7=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=Q2,...T}=t,C=sf(),k=Gq(),M=C.useState("open"),A=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=Qw({anchor:a,positionMethod:l,floatingRootContext:_,mounted:A,side:c,sideOffset:d,align:f,alignOffset:m,collisionBoundary:h,collisionPadding:y,sticky:x,arrowPadding:g,disableAnchorTracking:E,keepMounted:k,collisionAvoidance:R,adaptiveOrigin:G?Jq:void 0}),U=v.useMemo(()=>{const z={};return(!M||O==="both"||N)&&(z.pointerEvents="none"),{role:"presentation",hidden:!A,style:{...P.positionerStyles,...z}}},[M,O,N,A,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,Fc(F),T],ref:[n,C.useStateSetter("positionerElement")],stateAttributesMapping:po});return w.jsx(zN.Provider,{value:B,children:j})}),t7={...po,...Xo},n7=v.forwardRef(function(t,n){const{className:r,render:o,...a}=t,l=sf(),{side:c,align:f}=FN(),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 mN(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,Fc(h),a],stateAttributesMapping:t7})}),r7=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}=FN();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 i7({...e}){return w.jsx(Fq,{"data-slot":"tooltip",...e})}function o7({...e}){return w.jsx($q,{"data-slot":"tooltip-trigger",...e})}function a7({className:e,side:t="top",sideOffset:n=4,align:r="center",alignOffset:o=0,children:a,...l}){return w.jsx(Kq,{children:w.jsx(e7,{align:r,alignOffset:o,side:t,sideOffset:n,className:"isolate z-50",children:w.jsxs(n7,{"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(r7,{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 s7="sidebar_state",l7=3600*24*7,Pb="100vw",c7="3rem",u7="b",qu=320,qp=320,d7=450,Lb="tmex_sidebar_width";function f7(){const e=typeof window>"u"?Number.POSITIVE_INFINITY:window.innerWidth;return Math.max(qp,e-d7)}function Gh(e){return Math.min(f7(),Math.max(qp,Math.round(e)))}const UN=v.createContext(null);function Vr(){const e=v.useContext(UN);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function h7({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:o,children:a,...l}){const c=dB(),[f,d]=v.useState(!1),m=v.useRef(qu),[h,y]=v.useState(()=>{if(typeof window>"u")return qu;const _=Number(window.localStorage.getItem(Lb)),q=Number.isFinite(_)&&_>0?Math.max(qp,Math.round(_)):qu;return m.current=q,Gh(q)}),[g,x]=v.useState(!1),E=v.useCallback(_=>{const q=Math.max(qp,Math.round(_));m.current=q,y(Gh(_)),window.localStorage.setItem(Lb,String(q))},[]),R=v.useCallback(()=>{m.current=qu,y(Gh(qu)),window.localStorage.removeItem(Lb)},[]);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=`${s7}=${q}; path=/; max-age=${l7}`},[n,k]),A=v.useCallback(()=>c?d(_=>!_):M(_=>!_),[c,M,d]);v.useEffect(()=>{const _=q=>{q.defaultPrevented||q.target instanceof HTMLElement&&q.target.closest(".xterm")||q.key===u7&&(q.metaKey||q.ctrlKey)&&(q.preventDefault(),A())};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[A]);const O=k?"expanded":"collapsed",N=v.useMemo(()=>({state:O,open:k,setOpen:M,isMobile:c,openMobile:f,setOpenMobile:d,toggleSidebar:A,width:h,setWidth:E,resetWidth:R,isResizing:g,setIsResizing:x}),[O,k,M,c,f,d,A,h,E,R,g]);return w.jsx(UN.Provider,{value:N,children:w.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":`${h}px`,"--sidebar-width-icon":c7,...o},className:De("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...l,children:a})})}function p7({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}=Vr();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(Oq,{open:d,onOpenChange:m,...l,children:w.jsxs(_q,{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":Pb,width:Pb,maxWidth:Pb},side:e,animation:"top-down",children:[w.jsxs(Iq,{className:"sr-only",children:[w.jsx(Pq,{children:"Sidebar"}),w.jsx(Lq,{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(m7,{side:e})]})]})}function m7({side:e}){const{width:t,setWidth:n,resetWidth:r,setIsResizing:o}=Vr(),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 g7({className:e,onClick:t,...n}){const{toggleSidebar:r,isMobile:o}=Vr();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(q9,{}):w.jsx(K9,{}),w.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function y7({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 b7({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 v7({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 x7({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 Zw({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 w7({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 S7({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 E7=um("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 T7({render:e,isActive:t=!1,variant:n="default",size:r="default",tooltip:o,className:a,...l}){const{isMobile:c,state:f}=Vr(),d=cm({defaultTagName:"button",props:Mi({className:De(E7({variant:n,size:r}),a)},l),render:o?o7:e,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:r,active:t}});return o?(typeof o=="string"&&(o={children:o}),w.jsxs(i7,{children:[d,w.jsx(a7,{side:"right",align:"center",hidden:f!=="collapsed"||c,...o})]})):d}function R7({className:e,render:t,showOnHover:n=!1,...r}){return cm({defaultTagName:"button",props:Mi({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 C7({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 k7({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 M7({render:e,size:t="md",isActive:n=!1,className:r,...o}){return cm({defaultTagName:"a",props:Mi({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 gp=null;function qC(e){gp=e}function O7(e,t){gp==null||gp(e,t)}let td=null;function VC(e){td=e}function N7(){td!=null&&td.isMobile&&td.setOpenMobile(!0)}function A7(){const e=Kd(),{isMobile:t,setOpenMobile:n}=Vr();return v.useEffect(()=>(qC((r,o)=>e(r,o??{})),()=>qC(null)),[e]),v.useEffect(()=>(VC({isMobile:t,setOpenMobile:n}),()=>VC(null)),[t,n]),null}const D7={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"},_7={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 I7(e){const t=e==="light"?D7:_7;return`fg=${t.foreground},bg=${t.background}`}const P7=`${typeof window<"u"&&window.location.protocol==="https:"?"wss:":"ws:"}//${typeof window<"u"?window.location.host:""}/ws`,L7={clientImpl:"tmex-fe",clientVersion:"0.1.0",maxFrameBytes:1048576,reconnectDelayMs:1e3,maxReconnectAttempts:5,heartbeatIntervalMs:15e3};class j7{constructor(t={}){tt(this,"ws",null);tt(this,"options");tt(this,"state","IDLE");tt(this,"seq",0);tt(this,"chunkReassembler",new Hz);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={...L7,...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(P7),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(!Bz(n)){console.warn("[borsh-client] Received message without magic, ignoring");return}try{const r=jz(n);if(r.kind===pj){const o=Fz(r.payload),a=this.chunkReassembler.addChunk(o);a&&this.dispatchMessage({kind:a.kind,seq:a.seq,payload:a.payload});return}if(r.kind===BL){this.handleHelloS2C(r.payload);return}if(r.kind===HL)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(Kj,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(Yj,t),r=this.nextSeq(),o=ap(FL,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=qz(n,t,r,{maxFrameBytes:this.options.maxFrameBytes,chunkStreamId:Vz()});if(o.totalChunks===0){const a=ap(t,n,r);this.sendRaw(a)}else for(const a of o.chunks){const l=zz(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(Wj,t),r=this.nextSeq(),o=ap(UL,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 jb=null;function In(){return jb||(jb=new j7),jb}class z7{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 Vu=null;function Nd(e){return Vu?(e&&Vu.setCallbacks(e),Vu):(Vu=new z7(e),Vu)}function F7(){return crypto.getRandomValues(new Uint8Array(16))}function HN(e){const t=nr(Xj,{deviceId:e});return{kind:VL,payload:t}}function B7(e){const t=nr(Zj,{deviceId:e});return{kind:GL,payload:t}}function U7(e){const t=nr(tz,{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:WL,payload:t}}function H7(e,t){const n=nr(nz,{deviceId:e,windowId:t});return{kind:XL,payload:n}}function q7(e,t){const n=nr(rz,{deviceId:e,name:t??null});return{kind:QL,payload:n}}function V7(e,t){const n=nr(iz,{deviceId:e,windowId:t});return{kind:ZL,payload:n}}function $7(e,t){const n=nr(oz,{deviceId:e,paneId:t});return{kind:JL,payload:n}}function G7(e,t,n){const r=nr(az,{deviceId:e,windowId:t,name:n});return{kind:ej,payload:r}}function Y7(e,t){const n=nr(sz,{deviceId:e,style:t});return{kind:rj,payload:n}}function K7(e,t){const n=nr(lz,{deviceId:e,windowIds:t});return{kind:ij,payload:n}}function W7(e,t,n){const r=nr(cz,{deviceId:e,windowId:t,paneIds:n});return{kind:oj,payload:r}}function X7(e,t,n,r=!1){const o=new TextEncoder,a=nr(dz,{deviceId:e,paneId:t,encoding:2,data:o.encode(n),isComposing:r});return{kind:aj,payload:a}}function Q7(e,t,n){const r=new TextEncoder,o=nr(fz,{deviceId:e,paneId:t,encoding:2,data:r.encode(n),isComposing:!1});return{kind:sj,payload:o}}function Z7(e,t,n,r){const o=nr(o2,{deviceId:e,paneId:t,cols:n,rows:r});return{kind:lj,payload:o}}function J7(e,t,n,r){const o=nr(hz,{deviceId:e,paneId:t,cols:n,rows:r});return{kind:cj,payload:o}}function eV(e){const t=nr(Sz,{sessionId:e});return{kind:mj,payload:t}}function tV(e){const t=nr(Ez,{sessionId:e});return{kind:gj,payload:t}}const $C=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},nV=(e=>e?$C(e):$C),rV=e=>e;function iV(e,t=rV){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 GC=e=>{const t=nV(e),n=r=>iV(t,r);return Object.assign(n,t),n},lf=(e=>e?GC(e):GC),zb={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:Kx,updatedAt:new Date(0).toISOString()};async function YC(){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 YC();return e({settings:r,loading:!1}),Qt.changeLanguage(r.language),r}catch(r){return console.error("[site] failed to fetch settings:",r),e({settings:zb,loading:!1}),Qt.changeLanguage(zb.language),zb}},refreshSettings:async()=>{e({loading:!0});try{const n=await YC();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 oV(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 aV(e){const t=typeof e.title=="string"&&e.title?e.title:"Terminal Notification",n=oV(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}}const Fb=[{id:"geist-mono",displayName:"Geist Mono",cssFamily:"GeistMonoTmex",bundled:!0,isDefault:!0,files:{regular:"/fonts/GeistMonoNerdFontMono-Regular.woff2",bold:"/fonts/GeistMonoNerdFontMono-Bold.woff2"}},{id:"jetbrains-mono",displayName:"JetBrains Mono",cssFamily:"JetBrainsMonoTmex",bundled:!0,files:{regular:"/fonts/generated/jetbrains-mono/jetbrains-mono-regular.woff2",bold:"/fonts/generated/jetbrains-mono/jetbrains-mono-bold.woff2"}},{id:"fira-code",displayName:"Fira Code",cssFamily:"FiraCodeTmex",bundled:!0,files:{regular:"/fonts/generated/fira-code/fira-code-regular.woff2",bold:"/fonts/generated/fira-code/fira-code-bold.woff2"}},{id:"blex-mono",displayName:"Blex Mono (IBM Plex Mono)",cssFamily:"BlexMonoTmex",bundled:!0,files:{regular:"/fonts/generated/blex-mono/blex-mono-regular.woff2",bold:"/fonts/generated/blex-mono/blex-mono-bold.woff2"}},{id:"noto-sans-mono",displayName:"Noto Sans Mono",cssFamily:"NotoSansMTmex",bundled:!0,files:{regular:"/fonts/generated/noto-sans-mono/noto-sans-mono-regular.woff2",bold:"/fonts/generated/noto-sans-mono/noto-sans-mono-bold.woff2"}},{id:"zed-mono",displayName:"Zed Mono",cssFamily:"ZedMonoTmex",bundled:!0,files:{regular:"/fonts/generated/zed-mono/zed-mono-regular.woff2",bold:"/fonts/generated/zed-mono/zed-mono-bold.woff2"}},{id:"victor-mono",displayName:"Victor Mono",cssFamily:"VictorMonoTmex",bundled:!0,files:{regular:"/fonts/generated/victor-mono/victor-mono-regular.woff2",bold:"/fonts/generated/victor-mono/victor-mono-bold.woff2"}}],qN="geist-mono";function sV(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 ax=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return ax(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return ax(r)(n)}}}},lV=(e,t)=>(n,r,o)=>{let a={storage:sV(()=>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 A;return M((A=r())!=null?A:g)});const k=((T=a.onRehydrateStorage)==null?void 0:T.call(a,(R=r())!=null?R:g))||void 0;return ax(m.getItem.bind(m))(a.name).then(M=>{if(M)if(typeof M.version=="number"&&M.version!==a.version){if(a.migrate){const A=a.migrate(M.state,M.version);return A instanceof Promise?A.then(O=>[!0,O]):[!0,A]}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 A;if(C!==c)return;const[O,N]=M;if(x=a.merge(N,(A=r())!=null?A: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},Jw=lV,cV=13,uV=1.2,Nr=lf()(Jw(e=>({sidebarCollapsed:!1,sidebarTab:"panes",inputMode:"direct",editorSendWithEnter:!0,theme:"dark",keyboardBehaviorMode:"follow",editorHistory:[],editorDrafts:{},terminalFontSize:cV,terminalLineHeight:uV,terminalFontId:qN,setSidebarCollapsed:t=>e({sidebarCollapsed:t}),setSidebarTab:t=>e({sidebarTab:t}),setInputMode:t=>e({inputMode:t}),setKeyboardBehaviorMode:t=>e({keyboardBehaviorMode:t}),setEditorSendWithEnter:t=>e({editorSendWithEnter:t}),setTheme:t=>e({theme:t}),setTerminalFontSize:t=>e({terminalFontSize:t}),setTerminalLineHeight:t=>e({terminalLineHeight:t}),setTerminalFontId:t=>e({terminalFontId: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,keyboardBehaviorMode:e.keyboardBehaviorMode,editorHistory:e.editorHistory,editorDrafts:e.editorDrafts,terminalFontSize:e.terminalFontSize,terminalLineHeight:e.terminalLineHeight,terminalFontId:e.terminalFontId}),merge:(e,t)=>{const{sidebarTab:n,...r}=e??{};return{...t,...r}}})),dV=500,KC=new Map,Bb=new Map;function VN(e){const t=Date.now(),n=KC.get(e);return n!==void 0&&t-n<dV?!0:(KC.set(e,t),!1)}let WC=!1;function Ub(e){const t=I7(Nr.getState().theme),n=Y7(e,t);In().send(n.kind,n.payload)}function Hb(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 fV(e,t){if(WC)return;WC=!0;const n=In(),r=a=>{const l=t().selectedPanes[a];!l||Nd().getTransaction(a)||t().selectPane(a,l.windowId,l.paneId)};n.onStateChange(a=>{e({socketReady:a==="READY"})}),n.onMessage(a=>{const l=Nd();switch(a.kind){case $L:{const c=Bo(Qj,a.payload);e(f=>({deviceConnected:{...f.deviceConnected,[c.deviceId]:!0},deviceErrors:{...f.deviceErrors,[c.deviceId]:void 0},deviceReconnecting:{...f.deviceReconnecting,[c.deviceId]:void 0}})),Ub(c.deviceId),r(c.deviceId);return}case YL:{const c=Bo(Jj,a.payload);l.cleanup(c.deviceId),e(f=>({deviceConnected:{...f.deviceConnected,[c.deviceId]:!1}}));return}case KL:{const c=Gz(a.payload);hV(e,c),c.type==="reconnected"&&(Ub(c.deviceId),r(c.deviceId));return}case nj:{const c=Wz(a.payload);e(f=>({snapshots:{...f.snapshots,[c.deviceId]:c}}));return}case tj:{const c=Yz(a.payload);pV(e,c);return}case fj:{const c=Bo(gz,a.payload);l.dispatch({type:"SWITCH_ACK",deviceId:c.deviceId,selectToken:c.selectToken});return}case dj:{const c=Bo(mz,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 hj:{const c=Bo(yz,a.payload);l.dispatch({type:"LIVE_RESUME",deviceId:c.deviceId,selectToken:c.selectToken});return}case uj:{const c=Bo(pz,a.payload);l.dispatch({type:"OUTPUT",deviceId:c.deviceId,paneId:c.paneId,data:c.data});return}case qL: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(VN(c))continue;const f=HN(c);n.send(f.kind,f.payload)}});let o=Nr.getState().theme;Nr.subscribe(a=>{if(a.theme===o)return;o=a.theme;const l=t();for(const c of l.connectedDevices)l.deviceConnected[c]&&Ub(c)})}function hV(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"){Nd().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 pV(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}=aV(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(){fV(e,t),In().connect()},connectDevice(n){if(!n||(e(o=>{const a=new Set(o.connectedDevices);return a.add(n),{connectedDevices:a}}),t().ensureSocketConnected(),VN(n)))return;const r=HN(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}}),Nd().cleanup(n);const r=B7(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=F7(),c=!0;Nd().dispatch({type:"SELECT_START",deviceId:n,windowId:r,paneId:o,selectToken:l,wantHistory:c});const f=Hb(a==null?void 0:a.cols,a==null?void 0:a.rows)??Bb.get(n)??null,d=U7({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=H7(n,r);In().send(o.kind,o.payload)},sendInput(n,r,o,a=!1){if(!n||!r)return;const l=X7(n,r,o,a);In().send(l.kind,l.payload)},resizePane(n,r,o,a){if(!n||!r)return;const l=Hb(o,a);l&&Bb.set(n,{...l,at:Date.now()});const c=Z7(n,r,o,a);In().send(c.kind,c.payload)},syncPaneSize(n,r,o,a){if(!n||!r)return;const l=Hb(o,a);l&&Bb.set(n,{...l,at:Date.now()});const c=J7(n,r,o,a);In().send(c.kind,c.payload)},paste(n,r,o){if(!n||!r)return;const a=Q7(n,r,o);In().send(a.kind,a.payload)},createWindow(n,r){if(!n)return;const o=q7(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=V7(n,r);In().send(o.kind,o.payload)},closePane(n,r){if(!n||!r)return;const o=$7(n,r);In().send(o.kind,o.payload)},renameWindow(n,r,o){if(!n||!r)return;const a=G7(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=K7(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=W7(n,r,o);In().send(a.kind,a.payload)}})),XC="tmex:connectedDevices",$N=v.createContext(null);function mV(){const e=v.useContext($N);if(!e)throw new Error("useGlobalDevice must be used within GlobalDeviceProvider");return e}function gV({children:e}){const t=Gi(),[n,r]=v.useState(()=>{try{const h=localStorage.getItem(XC);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(XC,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($N.Provider,{value:m,children:e})}const GN=v.createContext(void 0);function yV(){const e=v.useContext(GN);if(e===void 0)throw new Error(Rn(63));return e}let QC=(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 YN={...pw,checked(e){return e?{[QC.checked]:""}:{[QC.unchecked]:""}}};function KN(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 bV=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}=mw(),{state:k,setTouched:M,setDirty:A,validityData:O,setFilled:N,setFocused:_,shouldValidateOnChange:q,validationMode:F,disabled:G,name:P,validation:U}=Pc(),{labelId:H}=mm(),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=vm({id:l,implicit:!1,controlRef:L}),I=d?void 0:W,[Q,le]=Rc({controlled:r,default:!!a,name:"Switch",state:"checked"});ww({id:$,commit:U.commit,value:Q,controlRef:L,name:j,getValue:()=>Q}),qe(()=>{V.current&&N(V.current.checked)},[V,N]),KN(Q,()=>{C(j),A(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(()=>Mi({checked:Q,disabled:B,id:I,name:j,required:y,style:j?YO:Em,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:YN});return w.jsxs(GN.Provider,{value:Se,children:[Pe,!Q&&j&&E!==void 0&&w.jsx("input",{type:"hidden",name:j,value:E}),w.jsx("input",{...ve})]})}),vV=v.forwardRef(function(t,n){const{render:r,className:o,...a}=t,{state:l}=Pc(),c=yV(),f={...l,...c};return At("span",t,{state:f,ref:n,stateAttributesMapping:YN,props:a})});function Vp({className:e,size:t="default",...n}){return w.jsx(bV,{"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(vV,{"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 e0({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 nd(){return{texts:[],reasonings:[],toolCalls:[],staleBarrier:!1}}function sc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function WN(e){if(sc(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 XN(e){return typeof e=="string"?e:Array.isArray(e)?e.map(t=>sc(t)&&typeof t.text=="string"?t.text:"").filter(Boolean).join(`
444
+ `):""}function xV(e){const t=[],n=new Map;for(const r of e){const o=sc(r.content)?r.content:null;if(!o)continue;const a=o.content;switch(r.role){case"user":{const l=XN(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(!sc(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(!sc(l)||l.type!=="tool-result")continue;const c=typeof l.toolCallId=="string"?l.toolCallId:"",f=n.get(c),{value:d,isError:m,denied:h}=WN(l.output);f&&(f.output=d,f.isError=m,f.denied=h,f.resolved=!0)}break}}}return{blocks:t,toolBlocksById:n}}function wV(e,t){const{blocks:n,toolBlocksById:r}=xV(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 sx(e){return!e||e.length===0?-1:e[e.length-1].seq}function SV(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=sc(n.content)?n.content:null,o=r?XN(r.content):"";if(o)return o}return null}async function Rr(e,t){try{return(await e.json()).error??t}catch{return t}}function $u(e){return Object.values(e).filter(t=>!!t).sort((t,n)=>t.updatedAt<n.updatedAt?1:-1).map(t=>t.id)}function ZC(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 JC=!1;const ka=new Set,EV=40,Vs=new Map;let Gu=null;const TV=120,fd=new Map,qb=new Set,lx=new Set;function RV(e){const t=fd.get(e);t&&(clearTimeout(t),fd.delete(e)),Vs.delete(e),lx.delete(e)}function cx(e){const t=eV(e);In().send(t.kind,t.payload)}function ek(e){const t=tV(e);In().send(t.kind,t.payload)}function tk(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 CV(e){const t=()=>{if(Gu&&(clearTimeout(Gu),Gu=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]??nd(),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:()=>{Gu||(Gu=setTimeout(t,EV))}}}function kV(e,t){if(JC)return;JC=!0;const n=In(),r=CV(e),o=R=>{fd.get(R)||fd.set(R,setTimeout(()=>{fd.delete(R),t().loadHistory(R)},TV))},a=(R,T)=>{Vs.delete(R),e(k=>{const M=k.sessions[R],A=nd();return T.inProgressText&&A.texts.push({messageId:"__sync__",text:T.inProgressText,stale:!1}),T.inProgressReasoning&&A.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]:A},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>sx(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]??nd(),M=[...k.toolCalls],A=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 A>=0?M[A]={...M[A],...O}:M.push(O),{inProgress:{...C.inProgress,[R]:{...k,toolCalls:M}}}})},f=(R,T)=>{r.flush();const{value:C,isError:k,denied:M}=WN(T.output);e(A=>{const O=A.inProgress[R]??nd(),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:{...A.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]:nd()}}}),T.lastMessageSeq>sx(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!==yj)return;let T;try{T=Bo(Tz,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 vj:a(k,C);return;case xj:l(k,C);return;case wj:{const M=C;tk(k,"texts",M.messageId,M.delta),r.schedule();return}case Sj:{const M=C;tk(k,"reasonings",M.messageId,M.delta),r.schedule();return}case Ej:c(k,C);return;case Tj:f(k,C);return;case Rj:d(k,C);return;case Cj:m(k,C);return;case kj:h(k,C);return;case Mj:g(k,C);return;case Oj:y(k,C);return;case Nj:x(k,C);return;case Aj:E(k,C);return;default:return}}),n.onStateChange(R=>{if(R!=="READY")return;for(const C of ka)cx(C);const T=t().activeSessionId;T&&t().loadHistory(T)})}const sn=lf()(Jw((e,t)=>({sessions:{},sessionOrder:[],sessionsLoaded:!1,activeSessionId:null,messages:{},historyLoaded:{},inProgress:{},pendingConfirmations:{},queued:{},sending:{},draft:null,defaultWriteMode:"confirm",ensureInitialized(){kV(e,t),In().connect();const n=t().activeSessionId;n&&!ka.has(n)&&(ka.add(n),cx(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:$u(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:$u(l)}})}catch(r){console.error("[agent] refreshSession failed:",r)}},setActiveSession(n){const r=t().activeSessionId;r!==n&&(r&&ka.has(r)&&(ka.delete(r),ek(r)),e({activeSessionId:n,draft:null}),n&&(ka.add(n),cx(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:$u(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:$u(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),RV(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:$u(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(qb.has(n)){lx.add(n);return}qb.add(n);try{const r=t(),o=r.historyLoaded[n]?sx(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=ZC(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{qb.delete(n),lx.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]:ZC(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),ek(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 MV(){const e=nl.getState().settings;return(e==null?void 0:e.siteName)||"tmex"}function nk(e){const t=e==null?void 0:e.trim();return t&&t.length>0?t:"?"}function OV({paneIdx:e,windowIdx:t,paneTitle:n,windowName:r,windowCustomName:o,deviceName:a}){const l=t??"?",c=e??"?",f=nk(o??n??r),d=nk(a);return`${l}/${c}: ${f}@${d}`}function t0(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 NV(e){const{title:t,processName:n}=t0(e);return n?`${n}: ${t}`:t}function kre(e){const t=MV();return e!=null&&e.trim()?`[${t}]${e}`:t}function Mre(){}function Ore(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 AV(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const DV=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_V=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,IV={};function rk(e,t){return(IV.jsx?_V:DV).test(e)}const PV=/[ \t\n\f\r]/g;function LV(e){return typeof e=="object"?e.type==="text"?ik(e.value):!1:ik(e)}function ik(e){return e.replace(PV,"")===""}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 QN(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 ux(e){return e.toLowerCase()}class $r{constructor(t,n){this.attribute=n,this.property=t}}$r.prototype.attribute="";$r.prototype.booleanish=!1;$r.prototype.boolean=!1;$r.prototype.commaOrSpaceSeparated=!1;$r.prototype.commaSeparated=!1;$r.prototype.defined=!1;$r.prototype.mustUseProperty=!1;$r.prototype.number=!1;$r.prototype.overloadedBoolean=!1;$r.prototype.property="";$r.prototype.spaceSeparated=!1;$r.prototype.space=void 0;let jV=0;const _t=sl(),Xn=sl(),dx=sl(),He=sl(),En=sl(),$s=sl(),ti=sl();function sl(){return 2**++jV}const fx=Object.freeze(Object.defineProperty({__proto__:null,boolean:_t,booleanish:Xn,commaOrSpaceSeparated:ti,commaSeparated:$s,number:He,overloadedBoolean:dx,spaceSeparated:En},Symbol.toStringTag,{value:"Module"})),Vb=Object.keys(fx);class n0 extends $r{constructor(t,n,r,o){let a=-1;if(super(t,n),ok(this,"space",o),typeof r=="number")for(;++a<Vb.length;){const l=Vb[a];ok(this,Vb[a],(r&fx[l])===fx[l])}}}n0.prototype.defined=!0;function ok(e,t,n){n&&(e[t]=n)}function Bc(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const a=new n0(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[ux(r)]=r,n[ux(a.attribute)]=r}return new cf(t,n,e.space)}const ZN=Bc({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 JN(e,t){return t in e?e[t]:t}function eA(e,t){return JN(e,t.toLowerCase())}const zV=Bc({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:dx,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:dx,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:eA}),FV=Bc({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:ti,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:ti,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:ti,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ti,rev:ti,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ti,requiredFeatures:ti,requiredFonts:ti,requiredFormats:ti,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:ti,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:ti,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:ti,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:JN}),tA=Bc({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()}}),nA=Bc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:eA}),rA=Bc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),BV={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"},UV=/[A-Z]/g,ak=/-[a-z]/g,HV=/^data[-\w.:]+$/i;function qV(e,t){const n=ux(t);let r=t,o=$r;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&HV.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(ak,$V);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!ak.test(a)){let l=a.replace(UV,VV);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}o=n0}return new o(r,t)}function VV(e){return"-"+e.toLowerCase()}function $V(e){return e.charAt(1).toUpperCase()}const GV=QN([ZN,zV,tA,nA,rA],"html"),r0=QN([ZN,FV,tA,nA,rA],"svg");function Nre(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function YV(e){return e.join(" ").trim()}var ql={},$b,sk;function KV(){if(sk)return $b;sk=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 A(){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=A();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=A(),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 $b=x,$b}var lk;function WV(){if(lk)return ql;lk=1;var e=ql&&ql.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ql,"__esModule",{value:!0}),ql.default=n;const t=e(KV());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 ql}var Yu={},ck;function XV(){if(ck)return Yu;ck=1,Object.defineProperty(Yu,"__esModule",{value:!0}),Yu.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 Yu.camelCase=f,Yu}var Ku,uk;function QV(){if(uk)return Ku;uk=1;var e=Ku&&Ku.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(WV()),n=XV();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,Ku=r,Ku}var ZV=QV();const JV=om(ZV),iA=oA("end"),i0=oA("start");function oA(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 e$(e){const t=i0(e),n=iA(e);if(t&&n)return{start:t,end:n}}function hd(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?dk(e.position):"start"in e||"end"in e?dk(e):"line"in e||"column"in e?hx(e):""}function hx(e){return fk(e&&e.line)+":"+fk(e&&e.column)}function dk(e){return hx(e&&e.start)+"-"+hx(e&&e.end)}function fk(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=hd(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 o0={}.hasOwnProperty,t$=new Map,n$=/[A-Z]/g,r$=new Set(["table","tbody","thead","tfoot","tr"]),i$=new Set(["td","th"]),aA="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function o$(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=h$(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=f$(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"?r0:GV,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=sA(o,e,void 0);return a&&typeof a!="string"?a:o.create(e,o.Fragment,{children:a||void 0},void 0)}function sA(e,t,n){if(t.type==="element")return a$(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return s$(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return c$(e,t,n);if(t.type==="mdxjsEsm")return l$(e,t);if(t.type==="root")return u$(e,t,n);if(t.type==="text")return d$(e,t)}function a$(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=r0,e.schema=o),e.ancestors.push(t);const a=cA(e,t.tagName,!1),l=p$(e,t);let c=s0(e,t);return r$.has(t.tagName)&&(c=c.filter(function(f){return typeof f=="string"?!LV(f):!0})),lA(e,l,a,t),a0(l,c),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function s$(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)}Ad(e,t.position)}function l$(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ad(e,t.position)}function c$(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=r0,e.schema=o),e.ancestors.push(t);const a=t.name===null?e.Fragment:cA(e,t.name,!0),l=m$(e,t),c=s0(e,t);return lA(e,l,a,t),a0(l,c),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function u$(e,t,n){const r={};return a0(r,s0(e,t)),e.create(t,e.Fragment,r,n)}function d$(e,t){return t.value}function lA(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function a0(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function f$(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 h$(e,t){return n;function n(r,o,a,l){const c=Array.isArray(a.children),f=i0(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 p$(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&o0.call(t.properties,o)){const a=g$(e,o,t.properties[o]);if(a){const[l,c]=a;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&i$.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 m$(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 Ad(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 Ad(e,t.position);else a=r.value===null?!0:r.value;n[o]=a}return n}function s0(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:t$;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=sA(e,a,l);c!==void 0&&n.push(c)}return n}function g$(e,t,n){const r=qV(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?AV(n):YV(n)),r.property==="style"){let o=typeof n=="object"?n:y$(e,String(n));return e.stylePropertyNameCase==="css"&&(o=b$(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?BV[r.property]||r.property:r.attribute,n]}}function y$(e,t){try{return JV(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=aA+"#cannot-parse-style-attribute",o}}function cA(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=rk(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=rk(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return o0.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);Ad(e)}function Ad(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=aA+"#cannot-handle-mdx-estrees-without-createevaluater",n}function b$(e){const t={};let n;for(n in e)o0.call(e,n)&&(t[v$(n)]=e[n]);return t}function v$(e){let t=e.replace(n$,x$);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function x$(e){return"-"+e.toLowerCase()}const Gb={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"]},w$={};function l0(e,t){const n=w$,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return uA(e,r,o)}function uA(e,t,n){if(S$(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 hk(e.children,t,n)}return Array.isArray(e)?hk(e,t,n):""}function hk(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=uA(e[o],t,n);return r.join("")}function S$(e){return!!(e&&typeof e=="object")}const pk=document.createElement("i");function c0(e){const t="&"+e+";";pk.innerHTML=t;const n=pk.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function si(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 Ei(e,t){return e.length>0?(si(e,e.length,0,t),e):t}const mk={}.hasOwnProperty;function dA(e){const t={};let n=-1;for(;++n<e.length;)E$(t,e[n]);return t}function E$(e,t){let n;for(n in t){const o=(mk.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){mk.call(o,l)||(o[l]=[]);const c=a[l];T$(o[l],Array.isArray(c)?c:c?[c]:[])}}}function T$(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);si(e,0,0,r)}function fA(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]/),R$=os(/[#-'*+\--9=?A-Z^-~]/);function $p(e){return e!==null&&(e<32||e===127)}const px=os(/\d/),C$=os(/[\dA-Fa-f]/),k$=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 _m=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 Uc(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 M$={tokenize:O$};function O$(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 N$={tokenize:A$},gk={tokenize:D$};function A$(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 A=M,O;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){O=t.events[A][1].end;break}T(r);let N=M;for(;N<t.events.length;)t.events[N][1].end={...O},N++;return si(t.events,A+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(gk,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(gk,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 A=t.sliceStream(k);if(M&&A.push(null),k.previous=a,a&&(a.next=k),a=k,o.defineSkip(k.start),o.write(A),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++;si(t.events,_+1,0,t.events.slice(N)),t.events.length=O}}function T(k){let M=n.length;for(;M-- >k;){const A=n[M];t.containerState=A[1],A[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 D$(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 Mc(e){if(e===null||Tn(e)||rl(e))return 1;if(_m(e))return 2}function Im(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 mx={name:"attention",resolveAll:_$,tokenize:I$};function _$(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};yk(h,-f),yk(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=Ei(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=Ei(d,[["enter",o,t],["enter",l,t],["exit",l,t],["enter",a,t]]),d=Ei(d,Im(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=Ei(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=Ei(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,si(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 I$(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=Mc(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=Mc(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 yk(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const P$={name:"autolink",tokenize:L$};function L$(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||$p(g)?n(g):(e.consume(g),f)}function d(g){return g===64?(e.consume(g),m):R$(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:j$};function j$(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 hA={continuation:{tokenize:F$},exit:B$,name:"blockQuote",tokenize:z$};function z$(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 F$(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(hA,t,n)(l)}}function B$(e){e.exit("blockQuote")}const pA={name:"characterEscape",tokenize:U$};function U$(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 k$(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const mA={name:"characterReference",tokenize:H$};function H$(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=C$,m):(e.enter("characterReferenceValue"),a=7,l=px,m(h))}function m(h){if(h===59&&o){const y=e.exit("characterReferenceValue");return l===Sr&&!c0(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 bk={partial:!0,tokenize:V$},vk={concrete:!0,name:"codeFenced",tokenize:q$};function q$(e,t,n){const r=this,o={partial:!0,tokenize:A};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(bk,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(bk,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 A(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 V$(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 Yb={name:"codeIndented",tokenize:G$},$$={partial:!0,tokenize:Y$};function G$(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,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 Y$(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 K$={name:"codeText",previous:X$,resolve:W$,tokenize:Q$};function W$(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 X$(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Q$(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 Z${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&&Wu(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),Wu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Wu(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);Wu(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Wu(this.left,n.reverse())}}}function Wu(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 gA(e){const t={};let n=-1,r,o,a,l,c,f,d;const m=new Z$(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,J$(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 si(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!d}function J$(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 eG={resolve:nG,tokenize:rG},tG={partial:!0,tokenize:iG};function nG(e){return gA(e),e}function rG(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(tG,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 iG(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 yA(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||$p(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||$p(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 bA(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 vA(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 pd(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 oG={name:"definition",tokenize:sG},aG={partial:!0,tokenize:lG};function sG(e,t,n){const r=this;let o;return a;function a(g){return e.enter("definition"),l(g)}function l(g){return bA.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)?pd(e,d)(g):d(g)}function d(g){return yA(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function m(g){return e.attempt(aG,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 lG(e,t,n){return r;function r(c){return Tn(c)?pd(e,o)(c):n(c)}function o(c){return vA(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 cG={name:"hardBreakEscape",tokenize:uG};function uG(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 dG={name:"headingAtx",resolve:fG,tokenize:hG};function fG(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"},si(e,r,n-r+1,[["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t]])),e}function hG(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 pG=["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"],xk=["pre","script","style","textarea"],mG={concrete:!0,name:"htmlFlow",resolveTo:bG,tokenize:vG},gG={partial:!0,tokenize:wG},yG={partial:!0,tokenize:xG};function bG(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 vG(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&&xk.includes(le)?(o=1,r.interrupt?t(I):P(I)):pG.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):A(I)}function A(I){return I===61?(e.consume(I),O):Xt(I)?(e.consume(I),A):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)?A(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(gG,W,U)(I)):I===null||xt(I)?(e.exit("htmlFlowData"),U(I)):(e.consume(I),P)}function U(I){return e.check(yG,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 xk.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 xG(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 wG(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(uf,t,n)}}const SG={name:"htmlText",tokenize:EG};function EG(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),A):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 A(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 u0={name:"labelEnd",resolveAll:kG,resolveTo:MG,tokenize:OG},TG={tokenize:NG},RG={tokenize:AG},CG={tokenize:DG};function kG(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&&si(e,0,e.length,n),e}function MG(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=Ei(c,e.slice(a+1,a+r+3)),c=Ei(c,[["enter",m,t]]),c=Ei(c,Im(t.parser.constructs.insideSpan.null,e.slice(a+r+4,l-3),t)),c=Ei(c,[["exit",m,t],e[l-2],e[l-1],["exit",d,t]]),c=Ei(c,e.slice(l+1)),c=Ei(c,[["exit",f,t]]),si(e,a,e.length,c),e}function OG(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(TG,m,l?m:h)(y):y===91?e.attempt(RG,m,l?d:h)(y):l?m(y):h(y)}function d(y){return e.attempt(CG,m,h)(y)}function m(y){return t(y)}function h(y){return a._balanced=!0,n(y)}}function NG(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)?pd(e,a)(h):a(h)}function a(h){return h===41?m(h):yA(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function l(h){return Tn(h)?pd(e,f)(h):m(h)}function c(h){return n(h)}function f(h){return h===34||h===39||h===40?vA(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):m(h)}function d(h){return Tn(h)?pd(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 AG(e,t,n){const r=this;return o;function o(c){return bA.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 DG(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 _G={name:"labelStartImage",resolveAll:u0.resolveAll,tokenize:IG};function IG(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 PG={name:"labelStartLink",resolveAll:u0.resolveAll,tokenize:LG};function LG(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 Kb={name:"lineEnding",tokenize:jG};function jG(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ln(e,t,"linePrefix")}}const yp={name:"thematicBreak",tokenize:zG};function zG(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 zr={continuation:{tokenize:HG},exit:VG,name:"list",tokenize:UG},FG={partial:!0,tokenize:$G},BG={partial:!0,tokenize:qG};function UG(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:px(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(yp,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 px(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(FG,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 HG(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(BG,t,l)(c))}function l(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,ln(e,e.attempt(zr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function qG(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 VG(e){e.exit(this.containerState.type)}function $G(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 wk={name:"setextUnderline",resolveTo:GG,tokenize:YG};function GG(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 YG(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 KG={tokenize:WG};function WG(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(eG,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 XG={resolveAll:wA()},QG=xA("string"),ZG=xA("text");function xA(e){return{resolveAll:wA(e==="text"?JG: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 wA(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 JG(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 eY={42:zr,43:zr,45:zr,48:zr,49:zr,50:zr,51:zr,52:zr,53:zr,54:zr,55:zr,56:zr,57:zr,62:hA},tY={91:oG},nY={[-2]:Yb,[-1]:Yb,32:Yb},rY={35:dG,42:yp,45:[wk,yp],60:mG,61:wk,95:yp,96:vk,126:vk},iY={38:mA,92:pA},oY={[-5]:Kb,[-4]:Kb,[-3]:Kb,33:_G,38:mA,42:mx,60:[P$,SG],91:PG,92:[cG,pA],93:u0,95:mx,96:K$},aY={null:[mx,XG]},sY={null:[42,95]},lY={null:[]},cY=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:sY,contentInitial:tY,disable:lY,document:eY,flow:rY,flowInitial:nY,insideSpan:aY,string:iY,text:oY},Symbol.toStringTag,{value:"Module"}));function uY(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(A),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=Ei(l,G),R(),l[l.length-1]!==null?[]:(_(t,0),d.events=Im(a,d.events,d),d.events)}function y(G,P){return fY(g(G),P)}function g(G){return dY(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 A(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&&si(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 dY(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 fY(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 hY(e){const r={constructs:dA([cY,...(e||{}).extensions||[]]),content:o(M$),defined:[],document:o(N$),flow:o(KG),lazy:{},string:o(QG),text:o(ZG)};return r;function o(a){return l;function l(c){return uY(r,a,c)}}}function pY(e){for(;!gA(e););return e}const Sk=/[\0\t\n\r]/g;function mY(){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(Sk.lastIndex=h,d=Sk.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 gY=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function yY(e){return e.replace(gY,bY)}function bY(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),a=o===120||o===88;return fA(n.slice(a?2:1),a?16:10)}return c0(n)||e}const SA={}.hasOwnProperty;function vY(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),xY(n)(pY(hY(n).document().write(mY()(e,t,!0))))}function xY(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:A,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()}};EA(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]];SA.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]||Ek).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]||Ek).call(this,pe,fe[0]));else throw new Error("Cannot close `"+pe.type+"` ("+hd({start:pe.start,end:pe.end})+"): it’s not open");ee.position.end=Ra(pe.end)}function m(){return l0(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 A(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=yY(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=fA(Re,ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):fe=c0(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 EA(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?EA(e,r):wY(e,r)}}function wY(e,t){let n;for(n in t)if(SA.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 Ek(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+hd({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+hd({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+hd({start:t.start,end:t.end})+") is still open")}function SY(e){const t=this;t.parser=n;function n(r){return vY(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function EY(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 TY(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
448
+ `}]}function RY(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 CY(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kY(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function MY(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=Uc(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 OY(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 NY(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function TA(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 AY(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return TA(e,t);const o={src:Uc(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 DY(e,t){const n={src:Uc(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 _Y(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 IY(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return TA(e,t);const o={href:Uc(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 PY(e,t){const n={href:Uc(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 LY(e,t,n){const r=e.all(t),o=n?jY(n):RA(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 jY(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=RA(n[r])}return t}function RA(e){const t=e.spread;return t??e.children.length>1}function zY(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 FY(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function BY(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function UY(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function HY(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=i0(t.children[1]),f=iA(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 qY(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 VY(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Tk=9,Rk=32;function $Y(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const a=[];for(;r;)a.push(Ck(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return a.push(Ck(t.slice(o),o>0,!1)),a.join("")}function Ck(e,t,n){let r=0,o=e.length;if(t){let a=e.codePointAt(r);for(;a===Tk||a===Rk;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(o-1);for(;a===Tk||a===Rk;)o--,a=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function GY(e,t){const n={type:"text",value:$Y(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function YY(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const KY={blockquote:EY,break:TY,code:RY,delete:CY,emphasis:kY,footnoteReference:MY,heading:OY,html:NY,imageReference:AY,image:DY,inlineCode:_Y,linkReference:IY,link:PY,listItem:LY,list:zY,paragraph:FY,root:BY,strong:UY,table:HY,tableCell:VY,tableRow:qY,text:GY,thematicBreak:YY,toml:Yh,yaml:Yh,definition:Yh,footnoteDefinition:Yh};function Yh(){}const CA=-1,Pm=0,md=1,Gp=2,d0=3,f0=4,h0=5,p0=6,kA=7,MA=8,WY=typeof self=="object"?self:globalThis,kk=(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 WY[e](t)},XY=(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 Pm:case CA:return n(l,o);case md:{const c=n([],o);for(const f of l)c.push(r(f));return c}case Gp:{const c=n({},o);for(const[f,d]of l)c[r(f)]=r(d);return c}case d0:return n(new Date(l),o);case f0:{const{source:c,flags:f}=l;return n(new RegExp(c,f),o)}case h0:{const c=n(new Map,o);for(const[f,d]of l)c.set(r(f),r(d));return c}case p0:{const c=n(new Set,o);for(const f of l)c.add(r(f));return c}case kA:{const{name:c,message:f}=l;return n(kk(c,f),o)}case MA: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(kk(a,l),o)};return r},Mk=e=>XY(new Map,e)(0),Vl="",{toString:QY}={},{keys:ZY}=Object,Xu=e=>{const t=typeof e;if(t!=="object"||!e)return[Pm,t];const n=QY.call(e).slice(8,-1);switch(n){case"Array":return[md,Vl];case"Object":return[Gp,Vl];case"Date":return[d0,Vl];case"RegExp":return[f0,Vl];case"Map":return[h0,Vl];case"Set":return[p0,Vl];case"DataView":return[md,n]}return n.includes("Array")?[md,n]:n.includes("Error")?[kA,n]:[Gp,n]},Kh=([e,t])=>e===Pm&&(t==="function"||t==="symbol"),JY=(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]=Xu(l);switch(c){case Pm:{let m=l;switch(f){case"bigint":c=MA,m=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);m=null;break;case"undefined":return o([CA],l)}return o([c,m],l)}case md:{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 Gp:{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 ZY(l))(e||!Kh(Xu(l[y])))&&m.push([a(y),a(l[y])]);return h}case d0:return o([c,l.toISOString()],l);case f0:{const{source:m,flags:h}=l;return o([c,{source:m,flags:h}],l)}case h0:{const m=[],h=o([c,m],l);for(const[y,g]of l)(e||!(Kh(Xu(y))||Kh(Xu(g))))&&m.push([a(y),a(g)]);return h}case p0:{const m=[],h=o([c,m],l);for(const y of l)(e||!Kh(Xu(y)))&&m.push(a(y));return h}}const{message:d}=l;return o([c,{name:f,message:d}],l)};return a},Ok=(e,{json:t,lossy:n}={})=>{const r=[];return JY(!(t||n),!!t,new Map,r)(e),r},Yp=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Mk(Ok(e,t)):structuredClone(e):(e,t)=>Mk(Ok(e,t));function eK(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 tK(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function nK(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||eK,r=e.options.footnoteBackLabel||tK,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=Uc(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:{...Yp(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 Lm=(function(e){if(e==null)return aK;if(typeof e=="function")return jm(e);if(typeof e=="object")return Array.isArray(e)?rK(e):iK(e);if(typeof e=="string")return oK(e);throw new Error("Expected function, string, or object as test")});function rK(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Lm(e[n]);return jm(r);function r(...o){let a=-1;for(;++a<t.length;)if(t[a].apply(this,o))return!0;return!1}}function iK(e){const t=e;return jm(n);function n(r){const o=r;let a;for(a in e)if(o[a]!==t[a])return!1;return!0}}function oK(e){return jm(t);function t(n){return n&&n.type===e}}function jm(e){return t;function t(n,r,o){return!!(sK(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function aK(){return!0}function sK(e){return e!==null&&typeof e=="object"&&"type"in e}const OA=[],lK=!0,gx=!1,cK="skip";function NA(e,t,n,r){let o;typeof t=="function"&&typeof n!="function"?(r=n,n=t):o=t;const a=Lm(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=OA,x,E,R;if((!t||a(f,d,m[m.length-1]||void 0))&&(g=uK(n(f,m)),g[0]===gx))return g;if("children"in f&&f.children){const T=f;if(T.children&&g[0]!==cK)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]===gx)return x;E=typeof x[1]=="number"?x[1]:E+l}}return g}}}function uK(e){return Array.isArray(e)?e:typeof e=="number"?[lK,e]:e==null?OA:[e]}function m0(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),NA(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 yx={}.hasOwnProperty,dK={};function fK(e,t){const n=t||dK,r=new Map,o=new Map,a=new Map,l={...KY,...n.handlers},c={all:d,applyData:pK,definitionById:r,footnoteById:o,footnoteCounts:a,footnoteOrder:[],handlers:l,one:f,options:n,patch:hK,wrap:gK};return m0(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(yx.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=Yp(R);return T.children=c.all(m),T}return Yp(m)}return(c.options.unknownHandler||mK)(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=Nk(x.value)),!Array.isArray(x)&&x.type==="element")){const E=x.children[0];E&&E.type==="text"&&(E.value=Nk(E.value))}Array.isArray(x)?h.push(...x):h.push(x)}}}return h}}function hK(e,t){e.position&&(t.position=e$(e))}function pK(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,Yp(a)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function mK(e,t){const n=t.data||{},r="value"in t&&!(yx.call(n,"hProperties")||yx.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 gK(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 Nk(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Ak(e,t){const n=fK(e,t),r=n.one(e,void 0),o=nK(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 yK(e,t){return e&&"run"in e?async function(n,r){const o=Ak(n,{file:r,...t});await e.run(o,r)}:function(n,r){return Ak(n,{file:r,...e||t})}}function Dk(e){if(e)throw e}var Wb,_k;function bK(){if(_k)return Wb;_k=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 Wb=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},Wb}var vK=bK();const Xb=om(vK);function bx(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 xK(){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?wK(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 wK(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:SK,dirname:EK,extname:TK,join:RK,sep:"/"};function SK(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 EK(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 TK(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 RK(...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?".":CK(n)}function CK(e){df(e);const t=e.codePointAt(0)===47;let n=kK(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function kK(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 MK={cwd:OK};function OK(){return"/"}function vx(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function NK(e){if(typeof e=="string")e=new URL(e);else if(!vx(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 AK(e)}function AK(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 Qb=["history","path","basename","stem","extname","dirname"];class AA{constructor(t){let n;t?vx(t)?n={path:t}:typeof t=="string"||DK(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":MK.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Qb.length;){const a=Qb[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)Qb.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?Ji.basename(this.path):void 0}set basename(t){Jb(t,"basename"),Zb(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){Ik(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(Zb(t,"extname"),Ik(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){vx(t)&&(t=NK(t)),Jb(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){Jb(t,"stem"),Zb(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 Zb(e,t){if(e&&e.includes(Ji.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ji.sep+"`")}function Jb(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Ik(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function DK(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const _K=(function(e){const r=this.constructor.prototype,o=r[e],a=function(){return o.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),IK={}.hasOwnProperty;class g0 extends _K{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=xK()}copy(){const t=new g0;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Xb(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(nv("data",this.frozen),this.namespace[t]=n,this):IK.call(this.namespace,t)&&this.namespace[t]||void 0:t?(nv("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 ev("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),ev("process",this.parser||this.Parser),tv("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);jK(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(),ev("processSync",this.parser||this.Parser),tv("processSync",this.compiler||this.Compiler),this.process(t,o),Lk("processSync","process",n),r;function o(a,l){n=!0,Dk(a),r=l}}run(t,n,r){Pk(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),Lk("runSync","run",r),o;function a(l,c){Dk(l),o=c,r=!0}}stringify(t,n){this.freeze();const r=Wh(n),o=this.compiler||this.Compiler;return tv("stringify",o),Pk(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(nv("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=Xb(!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];bx(E)&&bx(g)&&(g=Xb(!0,E,g)),r[y]=[d,g,...x]}}}}const PK=new g0().freeze();function ev(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function tv(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function nv(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 Pk(e){if(!bx(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Lk(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Wh(e){return LK(e)?e:new AA(e)}function LK(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function jK(e){return typeof e=="string"||zK(e)}function zK(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const FK="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",jk=[],zk={allowDangerousHtml:!0},BK=/^(https?|ircs?|mailto|xmpp)$/i,UK=[{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 HK(e){const t=qK(e),n=VK(e);return $K(t.runSync(t.parse(n),n),e)}function qK(e){const t=e.rehypePlugins||jk,n=e.remarkPlugins||jk,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...zk}:zk;return PK().use(SY).use(n).use(yK,r).use(t)}function VK(e){const t=e.children||"",n=new AA;return typeof t=="string"&&(n.value=t),n}function $K(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,a=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,f=t.urlTransform||GK;for(const m of UK)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+FK+m.id,void 0);return m0(e,d),o$(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 Gb)if(Object.hasOwn(Gb,g)&&Object.hasOwn(m.properties,g)){const x=m.properties[g],E=Gb[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 GK(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||BK.test(e.slice(0,t))?e:""}function Fk(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 YK(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function KK(e,t,n){const o=Lm((n||{}).ignore||[]),a=WK(t);let l=-1;for(;++l<a.length;)NA(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,A={index:k.index,input:k.input,stack:[...m,d]};let O=g(...k,A);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 WK(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([XK(o[0]),QK(o[1])])}return t}function XK(e){return typeof e=="string"?new RegExp(YK(e),"g"):e}function QK(e){return typeof e=="function"?e:function(){return e}}const rv="phrasing",iv=["autolink","link","image","label"];function ZK(){return{transforms:[oW],enter:{literalAutolink:eW,literalAutolinkEmail:ov,literalAutolinkHttp:ov,literalAutolinkWww:ov},exit:{literalAutolink:iW,literalAutolinkEmail:rW,literalAutolinkHttp:tW,literalAutolinkWww:nW}}}function JK(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:rv,notInConstruct:iv},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:rv,notInConstruct:iv},{character:":",before:"[ps]",after:"\\/",inConstruct:rv,notInConstruct:iv}]}}function eW(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function ov(e){this.config.enter.autolinkProtocol.call(this,e)}function tW(e){this.config.exit.autolinkProtocol.call(this,e)}function nW(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 rW(e){this.config.exit.autolinkEmail.call(this,e)}function iW(e){this.exit(e)}function oW(e){KK(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,aW],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),sW]],{ignore:["link","linkReference"]})}function aW(e,t,n,r,o){let a="";if(!DA(o)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!lW(n)))return!1;const l=cW(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 sW(e,t,n,r){return!DA(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function lW(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 cW(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=Fk(e,"(");let a=Fk(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 DA(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||rl(n)||_m(n))&&(!t||n!==47)}_A.peek=bW;function uW(){this.buffer()}function dW(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function fW(){this.buffer()}function hW(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function pW(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 mW(e){this.exit(e)}function gW(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 yW(e){this.exit(e)}function bW(){return"["}function _A(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 vW(){return{enter:{gfmFootnoteCallString:uW,gfmFootnoteCall:dW,gfmFootnoteDefinitionLabelString:fW,gfmFootnoteDefinition:hW},exit:{gfmFootnoteCallString:pW,gfmFootnoteCall:mW,gfmFootnoteDefinitionLabelString:gW,gfmFootnoteDefinition:yW}}}function xW(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:_A},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?IA:wW))),d(),f}}function wW(e,t,n){return t===0?e:IA(e,t,n)}function IA(e,t,n){return(n?"":" ")+e}const SW=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];PA.peek=kW;function EW(){return{canContainEols:["delete"],enter:{strikethrough:RW},exit:{strikethrough:CW}}}function TW(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:SW}],handlers:{delete:PA}}}function RW(e){this.enter({type:"delete",children:[]},e)}function CW(e){this.exit(e)}function PA(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 kW(){return"~"}function MW(e){return e.length}function OW(e,t){const n=t||{},r=(n.align||[]).concat(),o=n.stringLength||MW,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=NW(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]=Bk(r[h]);else{const E=Bk(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 A=f[h]-(R[h]||0),O=a[h];O===114?k=" ".repeat(A):O===99?A%2?(k=" ".repeat(A/2+.5),M=" ".repeat(A/2-.5)):(k=" ".repeat(A/2),M=k):M=" ".repeat(A)}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 NW(e){return e==null?"":String(e)}function Bk(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 AW(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()),DW);return o(),l}function DW(e,t,n){return">"+(n?"":" ")+e}function _W(e,t){return Uk(e,t.inConstruct,!0)&&!Uk(e,t.notInConstruct,!1)}function Uk(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 Hk(e,t,n,r){let o=-1;for(;++o<n.unsafe.length;)if(n.unsafe[o].character===`
460
+ `&&_W(n.stack,n.unsafe[o]))return/[ \t]/.test(r.before)?"":" ";return`\\
461
+ `}function IW(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 PW(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 LW(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 jW(e,t,n,r){const o=LW(n),a=e.value||"",l=o==="`"?"GraveAccent":"Tilde";if(PW(e,n)){const h=n.enter("codeIndented"),y=n.indentLines(a,zW);return h(),y}const c=n.createTracker(r),f=o.repeat(Math.max(IW(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 zW(e,t,n){return(n?"":" ")+e}function y0(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 FW(e,t,n,r){const o=y0(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 BW(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 Dd(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Kp(e,t,n){const r=Mc(e),o=Mc(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}}LA.peek=UW;function LA(e,t,n,r){const o=BW(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=Kp(r.before.charCodeAt(r.before.length-1),d,o);m.inside&&(f=Dd(d)+f.slice(1));const h=f.charCodeAt(f.length-1),y=Kp(r.after.charCodeAt(0),h,o);y.inside&&(f=f.slice(0,-1)+Dd(h));const g=l.move(o);return a(),n.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},c+f+g}function UW(e,t,n){return n.options.emphasis||"*"}function HW(e,t){let n=!1;return m0(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,gx}),!!((!e.depth||e.depth<3)&&l0(e)&&(t.options.setext||n))}function qW(e,t,n,r){const o=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(HW(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=Dd(d.charCodeAt(0))+d.slice(1)),d=d?l+" "+d:l,n.options.closeAtx&&(d+=" "+l),f(),c(),d}jA.peek=VW;function jA(e){return e.value||""}function VW(){return"<"}zA.peek=$W;function zA(e,t,n,r){const o=y0(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 $W(){return"!"}FA.peek=GW;function FA(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 GW(){return"!"}BA.peek=YW;function BA(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 YW(){return"`"}function UA(e,t){const n=l0(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))}HA.peek=KW;function HA(e,t,n,r){const o=y0(n),a=o==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let c,f;if(UA(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 KW(e,t,n){return UA(e,n)?"<":"["}qA.peek=WW;function qA(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 WW(){return"["}function b0(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 XW(e){const t=b0(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 QW(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 VA(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 ZW(e,t,n,r){const o=n.enter("list"),a=n.bulletCurrent;let l=e.ordered?QW(n):b0(n);const c=e.ordered?l==="."?")":".":XW(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),VA(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 JW(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 eX(e,t,n,r){const o=JW(n);let a=n.bulletCurrent||b0(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 tX(e,t,n,r){const o=n.enter("paragraph"),a=n.enter("phrasing"),l=n.containerPhrasing(e,r);return a(),o(),l}const nX=Lm(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function rX(e,t,n,r){return(e.children.some(function(l){return nX(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function iX(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}$A.peek=oX;function $A(e,t,n,r){const o=iX(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=Kp(r.before.charCodeAt(r.before.length-1),d,o);m.inside&&(f=Dd(d)+f.slice(1));const h=f.charCodeAt(f.length-1),y=Kp(r.after.charCodeAt(0),h,o);y.inside&&(f=f.slice(0,-1)+Dd(h));const g=l.move(o+o);return a(),n.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},c+f+g}function oX(e,t,n){return n.options.strong||"*"}function aX(e,t,n,r){return n.safe(e.value,r)}function sX(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 lX(e,t,n){const r=(VA(n)+(n.options.ruleSpaces?" ":"")).repeat(sX(n));return n.options.ruleSpaces?r.slice(0,-1):r}const GA={blockquote:AW,break:Hk,code:jW,definition:FW,emphasis:LA,hardBreak:Hk,heading:qW,html:jA,image:zA,imageReference:FA,inlineCode:BA,link:HA,linkReference:qA,list:ZW,listItem:eX,paragraph:tX,root:rX,strong:$A,text:aX,thematicBreak:lX};function cX(){return{enter:{table:uX,tableData:qk,tableHeader:qk,tableRow:fX},exit:{codeText:hX,table:dX,tableData:av,tableHeader:av,tableRow:av}}}function uX(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 dX(e){this.exit(e),this.data.inTable=void 0}function fX(e){this.enter({type:"tableRow",children:[]},e)}function av(e){this.exit(e)}function qk(e){this.enter({type:"tableCell",children:[]},e)}function hX(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,pX));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function pX(e,t){return t==="|"?t:e}function mX(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 OW(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=GA.inlineCode(g,x,E);return E.stack.includes("tableCell")&&(R=R.replace(/\|/g,"\\$&")),R}}function gX(){return{exit:{taskListCheckValueChecked:Vk,taskListCheckValueUnchecked:Vk,paragraph:bX}}}function yX(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:vX}}}function Vk(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function bX(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 vX(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=GA.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 xX(){return[ZK(),vW(),EW(),cX(),gX()]}function wX(e){return{extensions:[JK(),xW(e),TW(),mX(e),yX()]}}const SX={tokenize:MX,partial:!0},YA={tokenize:OX,partial:!0},KA={tokenize:NX,partial:!0},WA={tokenize:AX,partial:!0},EX={tokenize:DX,partial:!0},XA={name:"wwwAutolink",tokenize:CX,previous:ZA},QA={name:"protocolAutolink",tokenize:kX,previous:JA},Jo={name:"emailAutolink",tokenize:RX,previous:eD},mo={};function TX(){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,QA];mo[104]=[Jo,QA];mo[87]=[Jo,XA];mo[119]=[Jo,XA];function RX(e,t,n){const r=this;let o,a;return l;function l(h){return!xx(h)||!eD.call(r,r.previous)||v0(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(h))}function c(h){return xx(h)?(e.consume(h),c):h===64?(e.consume(h),f):n(h)}function f(h){return h===46?e.check(EX,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 CX(e,t,n){const r=this;return o;function o(l){return l!==87&&l!==119||!ZA.call(r,r.previous)||v0(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(SX,e.attempt(YA,e.attempt(KA,a),n),n)(l))}function a(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function kX(e,t,n){const r=this;let o="",a=!1;return l;function l(h){return(h===72||h===104)&&JA.call(r,r.previous)&&!v0(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||$p(h)||Tn(h)||rl(h)||_m(h)?n(h):e.attempt(YA,e.attempt(KA,m),n)(h)}function m(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function MX(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 OX(e,t,n){let r,o,a;return l;function l(d){return d===46||d===95?e.check(WA,f,c)(d):d===null||Tn(d)||rl(d)||d!==45&&_m(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 NX(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(WA,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 AX(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 DX(e,t,n){return r;function r(a){return e.consume(a),o}function o(a){return Sr(a)?n(a):t(a)}}function ZA(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Tn(e)}function JA(e){return!Mr(e)}function eD(e){return!(e===47||xx(e))}function xx(e){return e===43||e===45||e===46||e===95||Sr(e)}function v0(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 _X={tokenize:UX,partial:!0};function IX(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:zX,continuation:{tokenize:FX},exit:BX}},text:{91:{name:"gfmFootnoteCall",tokenize:jX},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:PX,resolveTo:LX}}}}function PX(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 LX(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 jX(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 zX(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 FX(e,t,n){return e.check(uf,t,e.attempt(_X,t,n))}function BX(e){e.exit("gfmFootnoteDefinition")}function UX(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 HX(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&&si(y,y.length,0,Im(g,l.slice(d+1,f),c)),si(y,y.length,0,[["exit",h,c],["enter",l[f][1],c],["exit",l[f][1],c],["exit",m,c]]),si(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=Mc(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=Mc(x);return R._open=!T||T===2&&!!E,R._close=!E||E===2&&!!T,c(x)}}}class qX{constructor(){this.map=[]}add(t,n,r){VX(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 VX(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 $X(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 GX(){return{flow:{null:{name:"table",tokenize:YX,resolveAll:KX}}}}function YX(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):A(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):A(F)}function T(F){return F===45?(e.enter("tableDelimiterFiller"),C(F)):A(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?A(F):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(F)):A(F)}function A(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 KX(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 qX;for(;++n<e.length;){const g=e[n],x=g[1];g[0]==="enter"?x.type==="tableHead"?(c=!1,f!==0&&($k(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&&$k(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=$X(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({},Kl(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const f=Kl(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=Kl(t.events,n[2]),m=Kl(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({},Kl(t.events,o)),e.add(o,0,[["exit",a,t]]),a=void 0),a}function $k(e,t,n,r,o){const a=[],l=Kl(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 Kl(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const WX={name:"tasklistCheck",tokenize:QX};function XX(){return{text:{91:WX}}}function QX(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:ZX},t,n)(f):n(f)}}function ZX(e,t,n){return ln(e,r,"whitespace");function r(o){return o===null?n(o):t(o)}}function JX(e){return dA([TX(),IX(),HX(e),GX(),XX()])}const eQ={};function tQ(e){const t=this,n=e||eQ,r=t.data(),o=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);o.push(JX(n)),a.push(xX()),l.push(wX(n))}function nQ(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 rQ={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"})},iQ=v.memo(function({content:t}){return w.jsx(HK,{remarkPlugins:[tQ],components:rQ,children:t})});function oQ({text:e,streaming:t=!1,className:n}){const r=v.useMemo(()=>nQ(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(iQ,{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 aQ({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(oQ,{text:e,streaming:t})})}function sQ(e){const{open:t,defaultOpen:n,onOpenChange:r,disabled:o}=e,a=t!==void 0,[l,c]=Rc({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,A]=v.useState(!1),[O,N]=v.useState(!1),_=v.useRef(null),q=v.useRef(null),F=v.useRef(null),G=v.useRef(null),P=BO(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:A,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,A,N,d,c,y,F,m,h,x])}const tD=v.createContext(void 0);function nD(){const e=v.useContext(tD);if(e===void 0)throw new Error(Rn(15));return e}let gd=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Zs.startingStyle]="startingStyle",e[e.endingStyle=Zs.endingStyle]="endingStyle",e})({}),lQ=(function(e){return e.panelOpen="data-panel-open",e})({});const cQ={[gd.open]:""},uQ={[gd.closed]:""},dQ={open(e){return e?{[lQ.panelOpen]:""}:null}},fQ={open(e){return e?cQ:uQ}},rD={...fQ,...Xo},hQ=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=sQ({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:rD});return w.jsx(tD.Provider,{value:g,children:x})}),pQ={...dQ,...Xo},mQ=v.forwardRef(function(t,n){const{panelId:r,open:o,handleTrigger:a,state:l,disabled:c}=nD(),{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:pQ})});let gQ=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e})({});function yQ(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),A=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(gQ.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(gd.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=gd.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&&(A.current=P.style.animationName||A.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]),gm(()=>{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(gd.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 Gk=(function(e){return e.collapsiblePanelHeight="--collapsible-panel-height",e.collapsiblePanelWidth="--collapsible-panel-width",e})({});const bQ=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:A,setPanelIdState:O,setOpen:N,setVisible:_,state:q,transitionDimensionRef:F,visible:G,width:P,transitionStatus:U}=nD(),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}=yQ({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:A,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:{[Gk.collapsiblePanelHeight]:h===void 0?"auto":`${h}px`,[Gk.collapsiblePanelWidth]:P===void 0?"auto":`${P}px`}},f],stateAttributesMapping:rD});return B||H||!B&&y?V:null});function zm({...e}){return w.jsx(hQ,{"data-slot":"collapsible",...e})}function Fm({...e}){return w.jsx(mQ,{"data-slot":"collapsible-trigger",...e})}function Bm({...e}){return w.jsx(bQ,{"data-slot":"collapsible-content",...e})}function vQ({text:e,streaming:t=!1,className:n}){const{t:r}=mn();return w.jsxs(zm,{"data-testid":"agent-reasoning-block",className:De("min-w-0 max-w-full self-start",n),children:[w.jsxs(Fm,{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(W8,{className:"size-3"}),w.jsx("span",{children:r("agent.reasoning.title")}),t&&w.jsx(tl,{className:"size-3 animate-spin"})]}),w.jsx(Bm,{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 xQ=um("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 cm({defaultTagName:"span",props:Mi({className:De(xQ({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 wx(e){if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function wQ(e){return Xa(e.output)&&typeof e.output.error=="string"?e.output.error:e.isError?wx(e.output):null}function SQ(e){switch(e){case"send_input":return w.jsx(L9,{className:"size-3.5"});case"read_screen":return w.jsx(af,{className:"size-3.5"});case"web_search":return w.jsx(cq,{className:"size-3.5"});case"fetch_url":return w.jsx(Nm,{className:"size-3.5"});default:return w.jsx(Cq,{className:"size-3.5"})}}function Oc({label:e,text:t}){return w.jsxs(zm,{children:[w.jsxs(Fm,{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(Bm,{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 EQ(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 TQ({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(Oc,{label:t("agent.tool.result"),text:l})]})}function RQ({call:e}){const{t}=mn(),n=Xa(e.output)?e.output:{},r=typeof n.screen=="string"?n.screen:"";return r?w.jsx(Oc,{label:t("agent.tool.screen"),text:r}):null}function CQ({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?EQ(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(Oc,{label:t("agent.tool.result"),text:e.output})]})}function kQ({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(Oc,{label:t("agent.tool.result"),text:o})]})}const MQ=/^[A-Za-z0-9+/]{256,}={0,2}$/,OQ=/^https?:\/\/\S+\.(png|jpe?g|webp|gif)(\?\S*)?$/i;function NQ(e){return typeof e!="string"||e.length===0?null:e.startsWith("data:image/")||OQ.test(e)?e:MQ.test(e.replace(/\s/g,""))?`data:image/png;base64,${e.replace(/\s/g,"")}`:null}function AQ(e){if(!e.resolved||e.isError||e.denied)return[];const t=[],n=(r,o)=>{if(t.length>=8||o>3)return;const a=NQ(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 DQ({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 _Q({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(Oc,{label:n("agent.tool.input"),text:wx(e.input)}),!t&&e.resolved&&!e.isError&&!e.denied&&e.output!==void 0&&w.jsx(Oc,{label:n("agent.tool.result"),text:wx(e.output)})]})}function IQ({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?wQ(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=AQ(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:[SQ(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(Hp,{className:"size-3 text-emerald-500"}),c!==null&&w.jsx(dd,{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(TQ,{call:e}),e.toolName==="read_screen"&&w.jsx(RQ,{call:e}),e.toolName==="web_search"&&w.jsx(CQ,{call:e}),e.toolName==="fetch_url"&&w.jsx(kQ,{call:e}),!["send_input","read_screen","web_search","fetch_url"].includes(e.toolName)&&w.jsx(_Q,{call:e,hideOutput:y.length>0}),w.jsx(DQ,{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(Hp,{}),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 PQ({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 LQ=48;function jQ(){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 zQ({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<LQ;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(PQ,{text:g.text},g.key);case"assistant-text":return w.jsx(aQ,{text:g.text,streaming:g.streaming},g.key);case"reasoning":return w.jsx(vQ,{text:g.text,streaming:g.streaming},g.key);case"tool-call":return w.jsx(IQ,{call:g.call,confirmationId:r.get(g.call.toolCallId),onDecide:o},g.key);default:return null}}),t&&w.jsx(jQ,{})]})}),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(H8,{})})]})}const iD=v.createContext(null),oD=v.createContext(null);function go(){const e=v.useContext(iD);if(e===null)throw new Error(Rn(60));return e}function aD(){const e=v.useContext(oD);if(e===null)throw new Error(Rn(61));return e}const FQ=(e,t)=>Object.is(e,t);function Nc(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function BQ(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:Nc(t,r,n))}function yd(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:Nc(r,t,n))}function UQ(e,t,n){return e.filter(r=>!Nc(t,r,n))}function Sx(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function sD(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function HQ(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(sD(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 qQ(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 Sx(e)}function Wl(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Sx(e.value):Sx(e)}function lD(e,t,n){function r(){return qQ(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=sD(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 VQ(e,t,n){return e.reduce((r,o,a)=>(a>0&&r.push(", "),r.push(w.jsx(v.Fragment,{children:lD(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:Wl(t,r)!==""}),hasNullItemLabel:We((e,t)=>t?HQ(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=>Nc(n,a,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:Nc(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 $Q(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:A=FQ,highlightItemOnHover:O=!0,children:N}=e,{clearErrors:_}=mw(),{setDirty:q,setTouched:F,setFocused:G,shouldValidateOnChange:P,validityData:U,setFilled:H,name:B,disabled:j,validation:z,validationMode:V}=Pc(),K=vm({id:t}),L=j||m,$=B??f,[W,I]=Rc({controlled:n,default:C?r??Ka:r,name:"Select",state:"value"}),[Q,le]=Rc({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}=Yw(Q),_e=rr(()=>new uN({id:K,modal:g,multiple:C,itemToStringLabel:k,itemToStringValue:M,isItemEqualToValue:A,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?"":Wl(W,M),[C,W,M]),Ne=v.useMemo(()=>C&&Array.isArray(W)?W.map(Je=>Wl(Je,M)):Wl(W,M),[C,W,M]),Ue=lr(_e.state.triggerElement);ww({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=yd(Ot,de,A);_e.set("selectedIndex",ke===-1?null:ke);return}const X=yd(Ot,W,A);_e.set("selectedIndex",X===-1?null:X)},[C,Q,W,te,A,_e]),KN(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===xm)&&(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=fN({open:Q,onOpenChange:et,elements:{reference:Re,floating:ee}}),zt=ZO(Ct,{enabled:!h&&!L,event:"mousedown"}),bt=Rm(Ct,{bubbles:!1}),Dt=yN(Ct,{enabled:!h&&!L,listRef:oe,activeIndex:ut,selectedIndex:pe,disabledIndices:Ka,onNavigate(Je){Je===null&&!Q||_e.set("activeIndex",Je)},focusItemOnHover:!1}),ot=vN(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(()=>Mi(ft(),Be,K?{id:K}:Pn),[ft,Be,K]);Mm(()=>{_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:A,openMethod:xe})},[_e,K,g,C,W,Q,Ce,Ee,vt,Mt,T,k,M,A,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=Wl(Je,M);return w.jsx("input",{type:"hidden",name:$,value:Ot},Ot)}),[C,W,$,M]);return w.jsx(iD.Provider,{value:Lt,children:w.jsxs(oD.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=>Wl(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:$?YO:Em,tabIndex:-1,"aria-hidden":!0}),qt]})})}function cD(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,GQ=400,Yk=200,YQ={...Fp,...pw,value:()=>null},KQ=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}=Pc(),{labelId:x}=mm(),{store:E,setOpen:R,selectionRef:T,validation:C,readOnly:k,required:M,alignItemWithTriggerActiveRef:A,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;vm({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(GQ,()=>{T.current.allowUnselectedMouseUp=!0,T.current.allowSelectedMouseUp=!0}):ue.start(Yk,()=>{T.current.allowUnselectedMouseUp=!0,Z.start(Yk,()=>{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=Md(P))==null?void 0:te.id)},[U,P]),Se=Mi(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&&A.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=cD(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(Sw,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:YQ,props:Se})}),WQ={value:()=>null},XQ=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=VQ(m,h,y):T=lD(m,h,y),At("span",t,{state:R,ref:[n,d],props:[{children:T},c],stateAttributesMapping:WQ})}),QQ=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:UO})}),ZQ=v.createContext(void 0),JQ=v.forwardRef(function(t,n){const{store:r}=go(),o=Rt(r,St.mounted),a=Rt(r,St.forceMount);return o||a?w.jsx(ZQ.Provider,{value:!0,children:w.jsx(Ow,{ref:n,...t})}):null}),uD=v.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function eZ(){return v.useContext(uD)}function Um(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:o}=e,a=Ge(o),l=v.useRef(0),c=rr(nZ).current,f=rr(tZ).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(rZ).forEach((k,M)=>{const A=f.get(k)??{};T.set(k,{...A,index:M})}),T},[f,d]);qe(()=>{if(typeof MutationObserver!="function"||x.size===0)return;const T=new MutationObserver(C=>{const k=new Set,M=A=>k.has(A)?k.delete(A):k.add(A);C.forEach(A=>{A.removedNodes.forEach(M),A.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(uD.Provider,{value:R,children:t})}function tZ(){return new Map}function nZ(){return new Set}function rZ(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 dD=v.createContext(void 0);function x0(){const e=v.useContext(dD);if(!e)throw new Error(Rn(59));return e}function Wp(e,t){e&&Object.assign(e.style,t)}const fD={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},iZ={position:"fixed"},oZ=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=X2,...C}=t,{store:k,listRef:M,labelsRef:A,alignItemWithTriggerActiveRef:O,selectedItemTextRef:N,valuesRef:_,initialValueRef:q,popupRef:F,setValue:G}=go(),P=aD(),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),Gw((oe||B)&&U&&z!=="touch",K);const Z=Qw({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?iZ: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,Fc($),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&&yd(_.current,j,L)===-1){const xe=q.current,Ve=xe!=null&&yd(_.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=>yd(_.current,Be,L)!==-1,xe=j.filter(Be=>Ee(Be));(xe.length!==j.length||xe.some(Be=>!BQ(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:""};Wp(V,Ee),Wp(F.current,Ee)}}),Oe=v.useMemo(()=>({...Z,side:ue,alignItemWithTriggerActive:oe,setControlledAlignItemWithTrigger:le,scrollUpArrowRef:W,scrollDownArrowRef:I}),[Z,ue,oe,le]);return w.jsx(Um,{elementsRef:M,labelsRef:A,onMapChange:Le,children:w.jsxs(dD.Provider,{value:Oe,children:[H&&B&&w.jsx(Vw,{inert:qw(!U),cutout:K}),he]})})});function hD(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",_d={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}`})}},aZ=v.createContext(void 0);function pD(e){return v.useContext(aZ)}function $o(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const sZ=v.createContext(void 0),lZ={disableStyleElements:!1};function mD(){return v.useContext(sZ)??lZ}const Os=1,cZ={...po,...Xo},uZ=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:A,scrollDownArrowRef:O,scrollUpArrowRef:N}=x0(),_=pD()!=null,q=aD(),{nonce:F,disableStyleElements:G}=mD(),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=Kk(getComputedStyle(f.current)),Ee=Math.min(Le.documentElement.clientHeight-Te-Ce,J),xe=Pe.scrollTop,Be=Wk(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=Wk(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,Wp(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=dZ(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=Kk(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&&ym;if(qt||Je){Q.current=!0,Wp(K,le.current),yr.flushSync(()=>A(!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,A,oe,O,N,L]),v.useEffect(()=>{if(!M||!K||!H)return;const Pe=Hn(K);function te(he){m(!1,yt(fH,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,_&&Uw.has(Pe.key)&&Pe.stopPropagation()},onMouseMove(){g.current=!1},onPointerLeave(Pe){if(!T||hD(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%"}:fD}},Se=At("div",t,{ref:[n,f],state:ue,stateAttributesMapping:cZ,props:[j,ve,Fc(z),{className:!L&&M?_d.className:void 0},l]});return w.jsxs(v.Fragment,{children:[!G&&_d.getElement(F),w.jsx(Aw,{context:q,modal:!1,disabled:!B,returnFocus:a,restoreFocus:!0,children:Se})]})});function Kk(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function Wk(e){return Math.max(0,e.scrollHeight-e.clientHeight)}const Xk=[["transform","none"],["scale","1"],["translate","0 0"]];function dZ(e){const{style:t}=e,n={};for(const[r,o]of Xk)n[r]=t.getPropertyValue(r),t.setProperty(r,o,"important");return()=>{for(const[r]of Xk){const o=n[r];o?t.setProperty(r,o):t.removeProperty(r)}}}const fZ=v.forwardRef(function(t,n){const{className:r,render:o,...a}=t,{store:l,scrollHandlerRef:c}=go(),{alignItemWithTriggerActive:f}=x0(),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:fD},className:d&&m!=="touch"?_d.className:void 0},x=Ge(E=>{l.set("listElement",E)});return At("div",t,{ref:[n,x],props:[g,a]})});let gD=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function w0(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}=eZ(),y=v.useRef(-1),[g,x]=v.useState(a??(o===gD.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 yD=v.createContext(void 0);function S0(){const e=v.useContext(yD);if(!e)throw new Error(Rn(57));return e}const hZ=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=w0({label:l,textRef:m,indexGuessBehavior:gD.GuessFromOrder}),{store:y,getItemProps:g,setOpen:x,setValue:E,selectionRef:R,typingRef:T,valuesRef:C,keyboardActiveRef:k,multiple:M,highlightItemOnHover:A}=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&&Nc(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=_?UQ(ue,a,F):[...ue,a];E(ve,yt(cd,oe))}else E(a,yt(cd,oe)),x(!1,yt(cd,oe))}const I={role:"option","aria-selected":_,tabIndex:N?0:-1,onFocus(){y.set("activeIndex",G)},onMouseEnter(){!k.current&&y.state.selectedIndex===null&&A&&y.set("activeIndex",G)},onMouseMove(){A&&y.set("activeIndex",G)},onMouseLeave(oe){!A||k.current||hD(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(yD.Provider,{value:le,children:Q})})),pZ=v.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:o}=S0();return r||o?w.jsx(mZ,{...t,ref:n}):null}),mZ=v.memo(v.forwardRef((e,t)=>{const{render:n,className:r,keepMounted:o,...a}=e,{selected:l}=S0(),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})),gZ=v.memo(v.forwardRef(function(t,n){const{indexRef:r,textRef:o,selectedByFocus:a,hasRegistered:l}=S0(),{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})})),bD=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}=x0(),R=a==="up"?St.scrollUpArrowVisible:St.scrollDownArrowVisible,T=Rt(f,R),C=Rt(f,St.openMethod),k=T&&C!=="touch",M=Dn(),A=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:A,onComplete(){k||N(!1)}});const F=At("div",t,{ref:[n,A],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=A.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}),yZ=v.forwardRef(function(t,n){return w.jsx(bD,{...t,ref:n,direction:"down"})}),bZ=v.forwardRef(function(t,n){return w.jsx(bD,{...t,ref:n,direction:"up"})}),vD=v.createContext(void 0);function vZ(){const e=v.useContext(vD);if(e===void 0)throw new Error(Rn(56));return e}const xZ=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(vD.Provider,{value:f,children:d})}),wZ=v.forwardRef(function(t,n){const{className:r,render:o,id:a,...l}=t,{setLabelId:c}=vZ(),f=Yi(a);return qe(()=>{c(f)},[f,c]),At("div",t,{ref:n,props:[{id:f},l]})}),bp=$Q;function SZ({className:e,...t}){return w.jsx(xZ,{"data-slot":"select-group",className:De("scroll-my-1 p-1",e),...t})}function sv({className:e,...t}){return w.jsx(XQ,{"data-slot":"select-value",className:De("flex flex-1 text-left",e),...t})}function vp({className:e,size:t="default",children:n,...r}){return w.jsxs(KQ,{"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(QQ,{render:w.jsx(ON,{className:"text-muted-foreground size-4 pointer-events-none"})})]})}function xp({className:e,children:t,side:n="bottom",sideOffset:r=4,align:o="center",alignOffset:a=0,alignItemWithTrigger:l=!0,...c}){return w.jsx(JQ,{children:w.jsx(oZ,{side:n,sideOffset:r,align:o,alignOffset:a,alignItemWithTrigger:l,className:"isolate z-50",children:w.jsxs(uZ,{"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(TZ,{}),w.jsx(fZ,{children:t}),w.jsx(RZ,{})]})})})}function EZ({className:e,...t}){return w.jsx(wZ,{"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(hZ,{"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(gZ,{className:"flex flex-1 gap-2 shrink-0 whitespace-nowrap",children:t}),w.jsx(pZ,{render:w.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:w.jsx(Hp,{className:"pointer-events-none"})})]})}function TZ({className:e,...t}){return w.jsx(bZ,{"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(e9,{})})}function RZ({className:e,...t}){return w.jsx(yZ,{"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(ON,{})})}const Ex="::";function Qk(e,t){return`${e??""}${Ex}${t}`}function CZ(e){const t=e.indexOf(Ex);return t<0?{providerId:null,modelId:e}:{providerId:e.slice(0,t)||null,modelId:e.slice(t+Ex.length)}}function kZ({providerId:e,modelId:t,onChange:n,disabled:r,className:o}){var E;const{t:a}=mn(),{data:l}=ai({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}=ai({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?Qk(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(bp,{value:h,onValueChange:R=>{if(typeof R!="string"||!R)return;const T=CZ(R);n(T.providerId,T.modelId)},disabled:r||f.length===0,children:[w.jsx(vp,{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(xp,{children:[!y&&m&&w.jsx(Fo,{value:h,className:"text-muted-foreground",children:m}),f.map(R=>w.jsxs(SZ,{children:[w.jsx(EZ,{children:R.name}),R.models.map(T=>w.jsx(Fo,{value:Qk(R.id,T),children:T},`${R.id}:${T}`))]},R.id))]})]})}function MZ({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(PN,{}),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(e0,{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(Hp,{})})]}):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(Am,{})}),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 OZ({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(e0,{"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(PN,{})}),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(BC,{})}),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(mq,{})})]}):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(BC,{})})]})]})}function NZ(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:OV({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 AZ(){var oe;const{t:e}=mn(),t=Kd(),n=Nr(Z=>Z.setSidebarTab),r=SF("/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}=ai({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=wV(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]),A=T??(f?{deviceId:f.deviceId,paneId:f.paneId}:null),O=A?NZ(A,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=SV(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(vq,{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(B9,{})}),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(Dm,{})})]})]}),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(dd,{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(dd,{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(dd,{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(zQ,{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(MZ,{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(_N,{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(OZ,{disabled:le,running:!!_,steerable:!!T,onSend:j,onSteer:z,onStop:()=>{T&&sn.getState().stopSession(T.id)},modelPicker:w.jsx(kZ,{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(Vp,{"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 DZ=0,_Z={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},E0={Backquote:"`",Backslash:"\\",BracketLeft:"[",BracketRight:"]",Comma:",",Equal:"=",Minus:"-",Period:".",Quote:"'",Semicolon:";",Slash:"/",Space:" ",IntlBackslash:"\\",IntlYen:"¥",IntlRo:"\\"};for(let e=0;e<=9;e+=1)E0[`Digit${e}`]=String(e);for(let e=0;e<26;e+=1){const t=String.fromCharCode(65+e),n=String.fromCharCode(97+e);E0[`Key${t}`]=n}function Are(e){return _Z[e]??DZ}function Dre(e){const t=E0[e];return t?t.codePointAt(0)??null:null}const IZ=new URL("/assets/ghostty-vt-BKQMf-5X.wasm",import.meta.url).href,wp=0,Zk=-3,PZ=11,LZ=12,jZ=13,zZ=14,FZ=1,BZ=2,UZ=9,HZ=1,qZ=0,VZ=1,$Z=2,GZ=0,YZ=1,KZ=2,WZ=4,XZ=2004,QZ=9,ZZ=1e3,JZ=1002,eJ=1003,tJ=1005,Jk=1006,nJ=1015,eM=1016;let lv=null;function cn(e,t){if(e!==wp)throw new Error(`${t} failed with result ${e}`)}function xD(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 rJ(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(xD)],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 iJ(e){let t=0;return e&1&&(t+=4),e&4&&(t+=8),e&2&&(t+=16),t}function cv(e){return e<0||e>223?null:String.fromCharCode(e+32)}function oJ(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 _re(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 aJ{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 sJ{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 aJ(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",$Z),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",qZ),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",VZ),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=rJ(n),c=this.allocBytes(l.length*3),f=(m,h)=>{const[y,g,x]=xD(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,PZ,r.ptr),"ghostty_terminal_set(foreground)"),cn(this.exports.ghostty_terminal_set(t,LZ,o.ptr),"ghostty_terminal_set(background)"),cn(this.exports.ghostty_terminal_set(t,jZ,a.ptr),"ghostty_terminal_set(cursor)"),cn(this.exports.ghostty_terminal_set(t,zZ,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,FZ,n),"ghostty_terminal_get(cols)"),cn(this.exports.ghostty_terminal_get(t,BZ,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,UZ,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",HZ);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)!==wp?(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,WZ,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,eJ),a=this.isTerminalModeEnabled(n,JZ),l=this.isTerminalModeEnabled(n,ZZ),c=this.isTerminalModeEnabled(n,QZ);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=oJ(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,Jk)&&!this.isTerminalModeEnabled(n,eM)?3:f;if(r.action==="motion"&&(g+=32),g+=iJ(r.mods),this.isTerminalModeEnabled(n,eM)){const x=r.action==="release"?"m":"M";return`\x1B[<${g};${h};${y}${x}`}if(this.isTerminalModeEnabled(n,Jk)){const x=r.action==="release"?"m":"M";return`\x1B[<${g};${d};${m}${x}`}if(this.isTerminalModeEnabled(n,nJ))return`\x1B[${g};${d};${m}M`;if(this.isTerminalModeEnabled(n,tJ)||l||a||o||c){const x=cv(g),E=cv(d),R=cv(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"?GZ:r.action==="repeat"?KZ:YZ),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!==Zk&&o!==wp&&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,XZ),l=this.exports.ghostty_paste_encode(r.ptr,r.len,a?1:0,0,0,o);l!==Zk&&l!==wp&&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 lJ(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 Ire(){return lv||(lv=(async()=>{const e=await lJ(IZ),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 sJ(n,l)})()),lv}function wD(){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 cJ(e){return e.altKey?!1:!!(wD()?e.metaKey:e.ctrlKey)}function uJ(e){return cJ(e)}function Pre(e){return uJ(e)&&e.key.toLowerCase()==="c"}function Lre(e){return e.shiftKey&&e.key==="Insert"&&!e.ctrlKey&&!e.altKey&&!e.metaKey?!0:e.altKey||e.key.toLowerCase()!=="v"?!1:!!(wD()?e.metaKey:e.ctrlKey)}async function SD(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 jre(e){e&&await SD(e)}function zre(e,t){return!t||!e.clipboardData?!1:(e.clipboardData.setData("text/plain",t),e.preventDefault(),!0)}const ED=v.createContext(void 0);function Hc(e=!0){const t=v.useContext(ED);if(t===void 0&&!e)throw new Error(Rn(25));return t}const TD=v.createContext(void 0);function RD(e){const t=v.useContext(TD);if(t===void 0&&!e)throw new Error(Rn(33));return t}const T0=v.createContext(void 0);function ea(e){const t=v.useContext(T0);if(t===void 0&&!e)throw new Error(Rn(36));return t}const dJ={...po,...Xo},fJ=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=Hc(),y={open:c,transitionStatus:d};return At("div",t,{ref:h!=null&&h.backdropRef?[n,h.backdropRef]:n,state:y,stateAttributesMapping:dJ,props:[{role:"presentation",hidden:!f,style:{pointerEvents:m===wr?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},a]})});function hJ(e){const{closeOnClick:t,highlighted:n,id:r,nodeId:o,store:a,itemRef:l,itemMetadata:c}=e,{events:f}=a.useState("floatingTreeRoot"),d=Hc(!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:cd})},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 pJ={type:"regular-item"};function mJ(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=hJ({closeOnClick:t,highlighted:r,id:o,nodeId:f,store:a,itemRef:d,itemMetadata:c}),g=v.useCallback(E=>Mi(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 CD=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=w0({label:l}),y=RD(!0),g=Yi(a),{store:x}=ea(),E=x.useState("isActive",h.index),R=x.useState("itemProps"),{getItemProps:T,itemRef:C}=mJ({closeOnClick:d,disabled:f,highlighted:E,id:g,store:x,nativeButton:c,nodeId:y==null?void 0:y.nodeId,itemMetadata:pJ});return At("div",t,{state:{disabled:f,highlighted:E},props:[R,m,T],ref:[C,n,h.ref]})}),gJ={...po,...Xo},kD=v.forwardRef(function(t,n){const{render:r,className:o,finalFocus:a,...l}=t,{store:c}=ea(),{side:f,align:d}=RD(),m=pD()!=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"),A=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 A.events.on("close",H),()=>{A.events.off("close",H)}},[A.events,c]);const q=c.useState("hoverEnabled"),F=c.useState("disabled");mN(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:gJ,props:[g,{onKeyDown(H){m&&Uw.has(H.key)&&H.stopPropagation()}},Fc(y),l,{"data-rootownerid":k}]});let U=T.type===void 0||_;return(R||T.type==="menubar"&&C!==xm)&&(U=!0),w.jsx(Aw,{context:M,modal:_,disabled:!x,returnFocus:a===void 0?U:a,initialFocus:T.type!=="menu",restoreFocus:!0,externalTree:T.type!=="menubar"?A: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})}),MD=v.createContext(void 0);function yJ(){const e=v.useContext(MD);if(e===void 0)throw new Error(Rn(32));return e}const OD=v.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,{store:a}=ea();return a.useState("mounted")||r?w.jsx(MD.Provider,{value:r,children:w.jsx(Ow,{ref:n,...o})}):null}),ND=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=X2,...T}=t,{store:C}=ea(),k=yJ(),M=Hc(!0),A=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;A.type==="context-menu"&&(j=r??((Pe=A.context)==null?void 0:Pe.anchor),K=K??"start",!c&&K!=="center"&&(V=t.alignOffset??2,z=t.sideOffset??-5));let $=c,W=K;A.type==="menu"?($=$??"inline-end",W=W??"start",L=t.collisionAvoidance??Q2):A.type==="menubar"&&($=$??"bottom",W=W??"start");const I=A.type==="context-menu",Q=Qw({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(fp)))}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??fp;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(fp))}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:A.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,Fc(P),T]}),ve=_&&A.type!=="menu"&&(A.type!=="menubar"&&F&&U!==wr||A.type==="menubar"&&A.context.modal);let Se=null;return A.type==="menubar"?Se=A.context.contentElement:A.type===void 0&&(Se=G),w.jsxs(TD.Provider,{value:Z,children:[ve&&w.jsx(Vw,{ref:A.type==="context-menu"||A.type==="nested-context-menu"?A.context.internalBackdropRef:null,inert:qw(!q),cutout:Se}),w.jsx(EH,{id:H,children:w.jsx(Um,{elementsRef:C.context.itemDomElements,labelsRef:C.context.itemLabels,children:ue})})]})}),bJ=v.createContext(null);function AD(e){return v.useContext(bJ)}const vJ={...zw,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 R0 extends Cm{constructor(n){super({...xJ(),...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},vJ);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 R0(r)).current;return n??o}}function xJ(){return{...jw(),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 Mw,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Pn,keyboardEventRelay:void 0,closeDelay:0}}const wJ=v.createContext(void 0);function SJ(){return v.useContext(wJ)}const DD=_w(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=Hc(!0),C=ea(!0),k=AD(!0),M=SJ(),A=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=R0.useStore(g==null?void 0:g.store,{open:l,openProp:r,activeTriggerId:E,triggerIdProp:x,parent:A});Mm(()=>{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"),_=$O(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}=Yw(F);Pw(O);const{forceUnmount:Z}=Lw(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]),Gw(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===nc?(Se.current=!1,Pe.start(300,()=>{Se.current=!0})):(Se.current=!0,Pe.clear());const bt=(nt===Wa||nt===cd)&&zt.detail===0&&(zt==null?void 0:zt.isTrusted),Dt=!ze&&(nt===wm||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===nc||nt===Js||nt===wr||nt===dp||nt===fp)?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(Ew))},[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=Fw({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=Rm(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=bN(Oe,{role:"menu"}),J=zc(),Ee=v.useCallback(ze=>{O.select("activeIndex")!==ze&&O.set("activeIndex",ze)},[O]),xe=yN(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=vN(Oe,{listRef:O.context.itemLabels,activeIndex:V,resetMs:nB,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=Mi(_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=Mi(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:A}),[O,A]),et=w.jsx(T0.Provider,{value:$e,children:typeof n=="function"?n({payload:K}):n});return z.type===void 0||z.type==="context-menu"?w.jsx(TH,{externalTree:N,children:et}):et});function _D(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=hw(),{ref:o,index:a}=w0(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 EJ(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}=_D({metadata:l});return At(f,e,{state:r,ref:[...a,h],props:[m,...o,d],stateAttributesMapping:c})}function C0(e){if(On(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!ao(e))return C0(co(e))}function TJ(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,RJ=cN(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),A=kJ(),O=hw(!0),N=is(),_=v.useMemo(()=>N??new Mw,[N]),q=$O(_),F=Zo(),{registerTrigger:G,isMountedByThisTrigger:P}=dN(R,M,E,{payload:y,closeDelay:m,parent:A,floatingTreeRoot:_,floatingNodeId:q,floatingParentNodeId:F,keyboardEventRelay:O==null?void 0:O.relayKeyboardEvent}),U=A.type==="menubar",H=E.useState("disabled"),B=a||H||U&&A.context.disabled,{getButtonProps:j,buttonRef:z}=Wo({disabled:B,native:l});v.useEffect(()=>{!k&&A.type===void 0&&(E.context.allowMouseUpTriggerRef.current=!1)},[E,k,A.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&&C0(Ce)===E.select("rootId"))return;const J=cD(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:Sw})});v.useEffect(()=>{k&&E.select("lastOpenChangeReason")===wr&&Gt(V.current).addEventListener("mouseup",L,{once:!0})},[k,L,E]);const $=U&&A.context.hasSubmenuOpen,I=gN(C,{enabled:(f??$)&&!B&&A.type!=="context-menu"&&(!U||$&&!P),handleClose:xN({blockPointerEvents:!U}),mouseOnly:!0,move:!1,restMs:A.type===void 0?d:void 0,delay:{close:m},triggerElementRef:M,externalTree:_,isActiveTrigger:T}),Q=CJ(k,E.select("lastOpenChangeReason")),le=ZO(C,{enabled:!B&&A.type!=="context-menu",event:k&&U?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:A.type===void 0?Q:!1}),oe=hN(C,{enabled:!B&&$}),Z=TJ({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=oH(he.current);Ce==null||Ce.focus()}),Le=Ge(Te=>{var J;const Ce=E.select("positionerElement");if(Ce&&tc(Te,Ce))(J=E.context.beforeContentFocusGuardRef.current)==null||J.focus();else{yr.flushSync(()=>{E.setOpen(!1,yt(Js,Te.nativeEvent,Te.currentTarget))});let Ee=iH(E.context.triggerFocusTargetRef.current||M.current);for(;Ee!==null&&Tt(Ce,Ee);){const xe=Ee;if(Ee=xw(Ee),Ee===xe)break}Ee==null||Ee.focus()}}),Oe=At("button",t,{enabled:!U,stateAttributesMapping:Fp,state:ve,ref:Pe,props:te});return U?w.jsx(EJ,{tag:"button",render:r,className:o,state:ve,refs:Pe,props:te,stateAttributesMapping:Fp}):k?w.jsxs(v.Fragment,{children:[w.jsx(kc,{ref:he,onFocus:ye},`${R}-pre-focus-guard`),w.jsx(v.Fragment,{children:Oe},R),w.jsx(kc,{ref:E.context.triggerFocusTargetRef,onFocus:Le},`${R}-post-focus-guard`)]}):w.jsx(v.Fragment,{children:Oe},R)});function CJ(e,t){const n=Dn(),[r,o]=v.useState(!1);return qe(()=>{e&&t==="trigger-hover"?(o(!0),n.start(rB,()=>{o(!1)})):e||(n.clear(),o(!1))},[e,t,n]),r}function kJ(){const e=Hc(!0),t=ea(!0),n=AD();return v.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}function MJ(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(ED.Provider,{value:m,children:w.jsx(T0.Provider,{value:void 0,children:w.jsx(DD,{...e})})})}const tM=500,OJ=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}=Hc(!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(),A=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})}}),A.current=!1,(z=c.current)==null||z.setOpen(!0,yt(Wa,B)),M.start(tM,()=>{A.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,!A.current)return;M.clear(),A.current=!1;const j=gr(B);Tt(m.current,j)||g&&j&&C0(j)===g||(z=c.current)==null||z.setOpen(!1,yt(Sw,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(tM,()=>{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:Fp})});function ID({...e}){return w.jsx(MJ,{"data-slot":"context-menu",...e})}function PD({...e}){return w.jsx(OJ,{"data-slot":"context-menu-trigger",...e})}function LD({className:e,sideOffset:t=4,...n}){const{side:r,align:o,alignOffset:a,...l}=n;return w.jsx(OD,{children:w.jsx(ND,{className:"isolate z-50 outline-none",sideOffset:t,side:r,align:o,alignOffset:a,children:w.jsx(kD,{"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(CD,{"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 Xp({className:e,...t}){return w.jsx(Tw,{"data-slot":"context-menu-separator",className:De("bg-border -mx-1 my-1 h-px",e),...t})}const jD=v.createContext(void 0);function Hm(){const e=v.useContext(jD);if(e===void 0)throw new Error(Rn(53));return e}let Qp=(function(e){return e.scrollAreaCornerHeight="--scroll-area-corner-height",e.scrollAreaCornerWidth="--scroll-area-corner-width",e})({});const ep=500,nM=16;function Ri(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 NJ=(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})({}),$l=(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 k0={hasOverflowX:e=>e?{[$l.hasOverflowX]:""}:null,hasOverflowY:e=>e?{[$l.hasOverflowY]:""}:null,overflowXStart:e=>e?{[$l.overflowXStart]:""}:null,overflowXEnd:e=>e?{[$l.overflowXEnd]:""}:null,overflowYStart:e=>e?{[$l.overflowYStart]:""}:null,overflowYEnd:e=>e?{[$l.overflowYEnd]:""}:null,cornerHidden:()=>null},AJ={x:0,y:0},rM={width:0,height:0},DJ={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},_J={x:!1,y:!1,corner:!1},IJ=v.forwardRef(function(t,n){const{render:r,className:o,overflowEdgeThreshold:a,...l}=t,c=PJ(a),f=Yi(),d=Dn(),m=Dn(),{nonce:h,disableStyleElements:y}=mD(),[g,x]=v.useState(!1),[E,R]=v.useState(!1),[T,C]=v.useState(!1),[k,M]=v.useState(!1),[A,O]=v.useState(rM),[N,_]=v.useState(rM),[q,F]=v.useState(DJ),[G,P]=v.useState(_J),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(AJ),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(NJ.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=Ri(B.current,"padding","y"),ut=Ri(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=Ri(j.current,"padding","x"),ut=Ri(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",[Qp.scrollAreaCornerHeight]:`${A.height}px`,[Qp.scrollAreaCornerWidth]:`${A.width}px`}},Le=At("div",t,{state:he,ref:[n,U],props:[ye,l],stateAttributesMapping:k0}),Oe=v.useMemo(()=>({handlePointerDown:ue,handlePointerMove:ve,handlePointerUp:Se,handleScroll:Z,cornerSize:A,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,A,N,k,E,R,T,C,g,x,f,G,q,he,c]);return w.jsxs(jD.Provider,{value:Oe,children:[!y&&_d.getElement(h),Le]})});function PJ(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 LJ=v.createContext(void 0);function jJ(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 iM=1;function oM(e,t){if(t<=0)return 0;const n=$o(e,0,t),r=n,o=t-n,a=r<=iM,l=o<=iM;return a&&l?r<=o?0:t:a?0:l?t:n}let aM=!1;function zJ(){aM||ym||(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{}}),aM=!0)}const FJ=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:A,overflowEdgeThreshold:O,scrollingX:N,scrollingY:_}=Hm(),q=zc(),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=oM(ot,Le),Ce=Le-Te}const J=Pe?0:$o(ve,0,Oe),Ee=Pe?0:oM(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=Ri($,"padding","x"),Ne=Ri(L,"padding","y"),Ue=Ri(I,"margin","x"),$e=Ri(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(nM,Ze*he),zt=Math.max(nM,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;zJ();let K=!1;return jJ(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:_d.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:A.xStart,overflowXEnd:A.xEnd,overflowYStart:A.yStart,overflowYEnd:A.yEnd,cornerHidden:T.corner}),[N,_,T.x,T.y,T.corner,A]),z=At("div",t,{ref:[n,l],state:j,props:[B,a],stateAttributesMapping:k0}),V=v.useMemo(()=>({computeThumbPosition:U}),[U]);return w.jsx(LJ.Provider,{value:V,children:z})}),zD=v.createContext(void 0);function BJ(){const e=v.useContext(zD);if(e===void 0)throw new Error(Rn(54));return e}let Zp=(function(e){return e.scrollAreaThumbHeight="--scroll-area-thumb-height",e.scrollAreaThumbWidth="--scroll-area-thumb-width",e})({});const UJ=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:A}=Hm(),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=zc();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=Ri(R.current,"margin","y"),B=Ri(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=Ri(T.current,"margin","x"),B=Ri(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(${Qp.scrollAreaCornerHeight})`,insetInlineEnd:0,[Zp.scrollAreaThumbHeight]:`${A.height}px`},...a==="horizontal"&&{insetInlineStart:0,insetInlineEnd:`var(${Qp.scrollAreaCornerWidth})`,bottom:0,[Zp.scrollAreaThumbWidth]:`${A.width}px`}}},q=At("div",t,{ref:[n,a==="vertical"?g:x],state:O,props:[_,c],stateAttributesMapping:k0}),F=v.useMemo(()=>({orientation:a}),[a]),G=a==="vertical"?h.y:h.x;return l||!G?w.jsx(zD.Provider,{value:F,children:q}):null}),HJ=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}=Hm(),{orientation:g}=BJ();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(${Zp.scrollAreaThumbHeight})`},...g==="horizontal"&&{width:`var(${Zp.scrollAreaThumbWidth})`}}},a]})}),qJ=v.forwardRef(function(t,n){const{render:r,className:o,...a}=t,{cornerRef:l,cornerSize:c,hiddenState:f}=Hm(),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 FD({className:e,children:t,...n}){return w.jsxs(IJ,{"data-slot":"scroll-area",className:De("relative",e),...n,children:[w.jsx(FJ,{"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(VJ,{}),w.jsx(qJ,{})]})}function VJ({className:e,orientation:t="vertical",...n}){return w.jsx(UJ,{"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(HJ,{"data-slot":"scroll-area-thumb",className:"rounded-full bg-border relative flex-1"})})}function Sp(e,t){return`${e}
475
+ ${t}`}const rd=lf()(Jw(e=>({expanded:{},toggle:(t,n)=>e(r=>{const o=Sp(t,n),a={...r.expanded};return a[o]?delete a[o]:a[o]=!0,{expanded:a}}),expand:(t,n)=>e(r=>{const o=Sp(t,n);return r.expanded[o]?r:{expanded:{...r.expanded,[o]:!0}}}),collapse:(t,n)=>e(r=>{const o=Sp(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 $J(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 GJ(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 YJ(e,t){return $J(`${e}
478
+ ${t}`)}function KJ(e){try{const t=GJ(e),n=t.indexOf(`
479
+ `);return n<0?null:{rootId:t.slice(0,n),path:t.slice(n+1)}}catch{return null}}function WJ(e,t){return`/file/${YJ(e,t)}`}function M0(e,t,n){const r=new URLSearchParams({rootId:t});return n!=null&&r.set("path",n),`/api/files/${e}?${r.toString()}`}function Fre(e,t,n=!1){const r=new URLSearchParams({rootId:e,path:t});return n&&r.set("download","1"),`/api/files/raw?${r.toString()}`}function XJ(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 BD(e){return`${Bi(e)}/s`}class Id 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 Ci(e){let t=`HTTP ${e.status}`,n;try{const r=await e.json();r.error&&(t=r.error),n=r.code}catch{}return new Id(e.status,t,n)}async function QJ(){const e=await fetch("/api/files/roots");if(!e.ok)throw await Ci(e);return await e.json()}async function Bre(e){const t=await fetch("/api/files/roots",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await Ci(t);return await t.json()}async function Ure(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 Ci(n);return await n.json()}async function Hre(e){const t=await fetch(`/api/files/roots/${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok)throw await Ci(t)}async function ZJ(e,t){const n=await fetch(M0("list",e,t));if(!n.ok)throw await Ci(n);return await n.json()}async function qre(e,t){const n=await fetch(M0("stat",e,t));if(!n.ok)throw await Ci(n);return await n.json()}async function Vre(e,t){const n=await fetch(M0("content",e,t));if(!n.ok)throw await Ci(n);return await n.json()}const JJ=8*1024*1024;async function eee(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 Ci(m);const{uploadId:h,chunkSize:y}=await m.json(),g=y>0?y:JJ;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 A=Math.min(E+g,c),O=await fetch(`/api/files/upload/${h}?offset=${E}`,{method:"PUT",body:n.slice(E,A),signal:a});if(!O.ok)throw await Ci(O);E=A;const N=(performance.now()-x)/1e3;o==null||o(1,{pct:Math.round(E/c*100),rate:N>0?BD(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 Ci(R);const T=R.body.getReader(),C=new TextDecoder;let k="",M=!1;for(;;){const{done:A,value:O}=await T.read();if(A)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 Id(500,q.detail??q.code,q.code)}}if(!M)throw new Id(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 tee(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 Ci(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 Id(500,C.detail??C.code??"unknown",C.code))}}if(g)throw g;if(!m)throw new Id(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 Ci(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?BD(k/F):void 0,detail:`${Bi(k)} / ${Bi(R)}`})}const A=new Blob(C),O=URL.createObjectURL(A),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 nee=new Set(["json","jsonc","json5"]);function UD(e,t){if(e.type==="dir"||e.category==="directory")return t!=null&&t.expanded?AN:N9;const n=e.name.toLowerCase().split(".").pop()??"";switch(e.category){case"code":return nee.has(n)?p9:g9;case"markdown":return Ib;case"image":return x9;case"pdf":return Ib;case"archive":return f9;case"audio":return b9;case"video":return S9;case"text":return Ib;default:return R9}}function HD(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 $re(e){return e}function O0(e){return encodeURIComponent(e)}const ree=12e3,iee=12e3,oee=120;let uv=!1;function aee(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 see(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 sM(e,t){const n=Date.now();for(;Date.now()-n<t;){const r=e();if(r)return r;await new Promise(o=>setTimeout(o,oee))}return null}function lee(e,t){return Qt.t("files.install.prompt",{device:e,scope:t?Qt.t("files.install.scopeRemote"):Qt.t("files.install.scopeLocal")})}function cee(e){return Qt.t("files.sendToAgent.prompt",{path:e})}async function qD(e,t){if(!uv){uv=!0;try{const n=Mn.getState();if(!n.connectedDevices.has(e)&&(n.connectDevice(e),!await sM(()=>{var l;return(l=Mn.getState().snapshots[e])!=null&&l.session?!0:null},ree))){Bt.error(Qt.t("files.agentLaunch.connectFailed"));return}const r=aee(e);n.createWindow(e);const o=await sM(()=>see(e,r),iee);if(!o){Bt.error(Qt.t("files.agentLaunch.windowFailed"));return}sn.getState().startDraft(e,o.paneId,o.paneTitle,t),O7(`/devices/${e}/windows/${o.windowId}/panes/${O0(o.paneId)}`,{replace:!0}),Nr.getState().setSidebarTab("agent"),N7()}finally{uv=!1}}}function uee(e,t){return qD(e,t)}function dee(e,t){return qD(e,cee(t))}function fee({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 lM(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 cM({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(fee,{value:t.pct})]})}function hee({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(cM,{label:lM(e.direction,1),leg:e.legs[0]}),w.jsx(cM,{label:lM(e.direction,2),leg:e.legs[1]})]})}function VD(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(hee,{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 pee=2*1024*1024*1024,$D=12,mee=2e3,gee=3e4;function yee(e){const t=e.lastIndexOf("/");return t<=0?"/":e.slice(0,t)}function bee(e,t){if(t===e)return".";const n=e==="/"?"/":`${e}/`;return t.startsWith(n)?t.slice(n.length):t}async function uM(e,t,n){try{await SD(e),Bt.success(t)}catch{Bt.error(n)}}function Zl(e){return Array.from(e.dataTransfer.types).includes("Files")}function GD({deviceId:e,absPath:t,rootPath:n}){const{t:r}=mn();return w.jsxs(w.Fragment,{children:[w.jsxs(Gs,{onClick:()=>void uM(t,r("files.copied"),r("files.copyFailed")),children:[w.jsx(o9,{}),r("files.menu.copyAbsolute")]}),w.jsxs(Gs,{onClick:()=>void uM(bee(n,t),r("files.copied"),r("files.copyFailed")),children:[w.jsx(z9,{}),r("files.menu.copyRelative")]}),w.jsxs(Gs,{onClick:()=>void dee(e,t),children:[w.jsx(Om,{}),r("files.menu.sendToAgent")]})]})}function YD({root:e,absPath:t,size:n}){const r=e.deviceType==="ssh"?Nm: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 vee(){const e=Gi();return v.useMemo(()=>{const t=Ws("/file/:ref",e.pathname);return t!=null&&t.params.ref?KJ(t.params.ref):null},[e.pathname])}function xee(e){return`files.error.${e??"unknown"}`}function wee(){var h,y,g,x;const{t:e}=mn(),t=Qa(),n=DL({queryKey:["files"]}),r=rd(E=>E.pruneStaleRoots),o=ai({queryKey:["files","roots"],queryFn:QJ,refetchOnWindowFocus:!0}),a=ai({queryKey:["devices"],queryFn:async()=>{const E=await fetch("/api/devices");if(!E.ok)throw new Error("devices");return await E.json()}}),l=ai({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=ai({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)??pee},m=()=>void t.invalidateQueries({queryKey:["files"]});return w.jsxs(Zw,{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(DN,{className:De("h-3.5 w-3.5",n>0&&"animate-spin")})})]}),w.jsx(FD,{className:"min-h-0 flex-1",children:w.jsxs("div",{onDragOver:E=>{Zl(E)&&E.preventDefault()},onDrop:E=>{Zl(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(KD,{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 See({root:e}){const t=e.deviceType==="ssh"?Nm: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 KD({root:e,rootId:t,path:n,depth:r,isRoot:o,ctx:a}){var _,q,F;const{t:l}=mn(),c=Sp(t,n),f=rd(G=>!!G.expanded[c]),d=rd(G=>G.toggle),m=rd(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=VD(P.name,"upload",()=>U.abort());try{await eee(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=ai({queryKey:["files","list",t,n],queryFn:()=>ZJ(t,n),enabled:f,staleTime:mee,retry:!1,refetchOnWindowFocus:!0,refetchInterval:G=>G.state.status==="error"?!1:gee,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(xee(k)),{id:H,description:e.deviceName?`${e.deviceName}`:void 0,action:a.llmConfigured&&U?{label:l("files.install.button"),onClick:()=>{Bt.dismiss(H),uee(U,lee(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=rd.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&&yee(B)===n&&!G.has(B)&&P.collapse(t,B)}},[C.data,t,n]);const A=UD({category:"directory",name:e.name,type:"dir"},{expanded:f}),O=r*$D+4,N=O+18;return w.jsxs("div",{children:[w.jsxs(ID,{children:[w.jsx(PD,{render:w.jsxs("button",{type:"button",onClick:()=>d(t,n),onDragEnter:G=>{Zl(G)&&(G.preventDefault(),g.current+=1,E(!0))},onDragOver:G=>{Zl(G)&&(G.preventDefault(),G.dataTransfer.dropEffect="copy")},onDragLeave:G=>{Zl(G)&&(g.current-=1,g.current<=0&&R())},onDrop:G=>{Zl(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(A,{className:De("h-4 w-4 shrink-0",o?"text-muted-foreground":HD("directory"))}),w.jsx("span",{className:"min-w-0 flex-1 truncate text-xs",children:o?e.name:Tee(n)}),o&&w.jsx(See,{root:e})]})}),w.jsxs(LD,{children:[w.jsx(YD,{root:e,absPath:n}),w.jsx(Xp,{}),w.jsxs(Gs,{onClick:()=>d(t,n),children:[w.jsx(n9,{}),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(Tq,{}),l("files.menu.upload")]}),w.jsx(Xp,{}),w.jsx(GD,{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(Eee,{code:k,indent:N,onRetry:()=>void C.refetch()}),(q=C.data)==null?void 0:q.entries.map(G=>G.type==="dir"?w.jsx(KD,{root:e,rootId:t,path:G.path,depth:r+1,isRoot:!1,ctx:a},G.path):w.jsx(Ree,{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 Eee({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(Sq,{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(DN,{className:"h-3 w-3"})})]})}function Tee(e){const t=e.lastIndexOf("/");return(t>=0?e.slice(t+1):e)||e}function Ree({entry:e,root:t,depth:n}){const{t:r}=mn(),o=Kd(),{isMobile:a,setOpenMobile:l}=Vr(),c=vee(),f=t.id,d=(c==null?void 0:c.rootId)===f&&(c==null?void 0:c.path)===e.path,m=UD(e),h=n*$D+4+18,y=()=>{o(WJ(f,e.path)),a&&l(!1)},g=async()=>{const x=new AbortController,E=VD(e.name,"download",()=>x.abort());try{await tee(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(ID,{children:[w.jsx(PD,{render:w.jsxs("button",{type:"button",draggable:!0,onClick:y,onDragStart:x=>{const E=window.location.origin+XJ(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":HD(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(LD,{children:[w.jsx(YD,{root:t,absPath:e.path,size:e.size}),w.jsx(Xp,{}),w.jsxs(Gs,{onClick:y,children:[w.jsx(AN,{}),r("files.menu.open")]}),w.jsxs(Gs,{onClick:()=>void g(),"data-testid":`file-download-${f}-${e.path}`,children:[w.jsx(s9,{}),r("files.download")]}),w.jsx(Xp,{}),w.jsx(GD,{deviceId:t.deviceId,absPath:e.path,rootPath:t.path})]})]})}const WD=v.createContext(void 0);function XD(){const e=v.useContext(WD);if(e===void 0)throw new Error(Rn(64));return e}let Cee=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const QD={tabActivationDirection:e=>({[Cee.activationDirection]:e})},kee=v.forwardRef(function(t,n){const{className:r,defaultValue:o=0,onValueChange:a,orientation:l="horizontal",render:c,value:f,...d}=t,m=zc(),h=Object.hasOwn(t,"defaultValue"),y=v.useRef([]),[g,x]=v.useState(()=>new Map),[E,R]=Rc({controlled:f,default:o,name:"Tabs",state:"value"}),T=f!==void 0,[C,k]=v.useState(()=>new Map),[M,A]=v.useState("none"),O=Ge((z,V)=>{a==null||a(z,V),!V.isCanceled&&(R(z),A(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),A("none"))},[o,H,h,T,U,A,R,C,E]);const j=At("div",t,{state:{orientation:l,tabActivationDirection:M},ref:n,props:d,stateAttributesMapping:QD});return w.jsx(WD.Provider,{value:P,children:w.jsx(Um,{elementsRef:y,children:j})})}),ZD="data-composite-item-active",JD=v.createContext(void 0);function Mee(){const e=v.useContext(JD);if(e===void 0)throw new Error(Rn(65));return e}const Oee=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}=XD(),{activateOnFocus:g,highlightedTabIndex:x,onTabActivation:E,setHighlightedTabIndex:R,tabsListElement:T}=Mee(),C=Yi(c),k=v.useMemo(()=>({disabled:o,id:C,value:l}),[o,C,l]),{compositeProps:M,compositeRef:A,index:O}=_D({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=ii(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,A],props:[M,{role:"tab","aria-controls":G,"aria-selected":N,id:C,onClick:H,onFocus:B,onPointerDown:j,[ZD]:N?"":void 0,onKeyDownCapture(){_.current=!0}},d,q]})});function Nee(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const Aee=[];function Dee(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=Aee}=e,[x,E]=v.useState(0),R=n>1,T=v.useRef(null),C=Hi(T,d),k=v.useRef([]),M=v.useRef(!1),A=c??x,O=Ge((q,F=!1)=>{if((f??E)(q),F){const G=k.current[q];IC(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(ZD))??null,P=G?F.indexOf(G):-1;P!==-1&&O(P),IC(T.current,G,l,a)}),_=v.useMemo(()=>({"aria-orientation":a==="both"?void 0:a,ref:C,onFocus(q){!T.current||!_C(q.target)||q.target.setSelectionRange(0,q.target.value.length??0)},onKeyDown(q){const F=m?y8:TN;if(!F.has(q.key)||_ee(q,g)||!T.current)return;const P=l==="rtl",U=P?Od:ac,H={horizontal:U,vertical:_s,both:U}[a],B=P?ac:Od,j={horizontal:B,vertical:oc,both:B}[a];if(_C(q.target)&&!Nee(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=A;const V=up(k,y),K=ex(k,y);if(R){const I=t||Array.from({length:k.current.length},()=>({width:1,height:1})),Q=kO(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[CO({current:Q.map(Z=>Z?k.current[Z]:null)},{event:q,orientation:a,loopFocus:r,cols:n,disabledIndices:OO([...y||k.current.map((Z,ue)=>Ya(k,ue)?ue:void 0),void 0],Q),minIndex:le,maxIndex:oe,prevIndex:MO(A>K?V:A,I,Q,n,q.key===_s?"bl":q.key===ac?"tr":"tl"),rtl:P})]}const L={horizontal:[U],vertical:[_s],both:[U,_s]}[a],$={horizontal:[B],vertical:[oc],both:[B,oc]}[a],W=R?F:{horizontal:m?m8:SN,vertical:m?g8:EN,both:F}[a];m&&(q.key===nf?z=V:q.key===rf&&(z=K)),z===A&&(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!==A&&!ec(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,A,R,t,r,C,g,O,a,h]);return v.useMemo(()=>({props:_,highlightedIndex:A,onHighlightedIndexChange:O,elementsRef:k,disabledIndices:y,onMapChange:N,relayKeyboardEvent:_.onKeyDown}),[_,A,O,k,y,N])}function _ee(e,t){for(const n of S8.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function Iee(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:A="div",...O}=e,N=zc(),{props:_,highlightedIndex:q,onHighlightedIndexChange:F,elementsRef:G,onMapChange:P,relayKeyboardEvent:U}=Dee({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(A,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(hO.Provider,{value:B,children:w.jsx(Um,{elementsRef:G,onMapChange:j=>{E==null||E(j),P(j)},children:H})})}const Pee=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}=XD(),[x,E]=v.useState(0),[R,T]=v.useState(null),C=Lee(h,m,R,f),k=Ge((N,_)=>{if(N!==h){const q=C(N);_.activationDirection=q,d(N,_)}}),M={orientation:m,tabActivationDirection:g},A={"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(JD.Provider,{value:O,children:w.jsx(Iee,{render:l,className:o,state:M,refs:[n,T],props:[A,c],stateAttributesMapping:QD,highlightedIndex:x,enableHomeAndEndKeys:!0,loopFocus:a,orientation:m,onHighlightedIndexChange:E,onMapChange:y,disabledIndices:Ka})})});function dM(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 Lee(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}=dM(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}=dM(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 jee({className:e,orientation:t="horizontal",...n}){return w.jsx(kee,{"data-slot":"tabs","data-orientation":t,className:De("gap-2 group/tabs flex data-horizontal:flex-col",e),...n})}const zee=um("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 Fee({className:e,variant:t="default",...n}){return w.jsx(Pee,{"data-slot":"tabs-list","data-variant":t,className:De(zee({variant:t}),e),...n})}function dv({className:e,...t}){return w.jsx(Oee,{"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 Jp({children:e,onClick:t,...n}){const{isMobile:r,setOpenMobile:o}=Vr(),a=l=>{r&&o(!1),t==null||t(l)};return w.jsx(sw,{...n,onClick:a,children:e})}function Bee({items:e}){const{t}=mn();return w.jsx(Zw,{children:w.jsx(w7,{children:e.map(n=>{var r,o;return w.jsxs(zm,{defaultOpen:n.isActive,render:w.jsx(S7,{}),children:[w.jsx(Jp,{to:n.url,children:w.jsxs(T7,{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(Fm,{render:w.jsx(R7,{className:"data-[state=open]:rotate-90"}),children:[w.jsx(of,{}),w.jsx("span",{className:"sr-only",children:"Toggle"})]}),w.jsx(Bm,{children:w.jsx(C7,{children:(o=n.items)==null?void 0:o.map(a=>w.jsx(k7,{children:w.jsx(Jp,{to:a.url,children:w.jsx(M7,{children:w.jsx("span",{children:t(a.title)})})})},a.title))})})]}):null]},n.title)})})})}const Uee={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 Hee({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(aq,{className:"h-3 w-3 animate-spin"}),w.jsx("span",{className:"truncate max-w-[120px]",children:r.message})]});if(o){const a=Uee[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(dd,{className:"h-3 w-3"}),w.jsx("span",{className:"truncate max-w-[120px]",children:l})]})}return null}function qee(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 CN({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");RN({store:y,actionsRef:l,parentContext:m==null?void 0:m.store.context});const x=v.useMemo(()=>({store:y}),[y]);return w.jsx(Rw.Provider,{value:x,children:typeof t=="function"?t({payload:g}):t})}function Tx({...e}){return w.jsx(qee,{"data-slot":"alert-dialog",...e})}function Vee({...e}){return w.jsx($w,{"data-slot":"alert-dialog-portal",...e})}function $ee({className:e,...t}){return w.jsx(Cw,{"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 Rx({className:e,size:t="default",...n}){return w.jsxs(Vee,{children:[w.jsx($ee,{}),w.jsx(Hw,{"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 Cx({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 kx({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 fM({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 Mx({className:e,...t}){return w.jsx(Kw,{"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 Ox({className:e,...t}){return w.jsx(kw,{"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 Nx({className:e,...t}){return w.jsx(Ht,{"data-slot":"alert-dialog-action",className:De(e),...t})}function Ax({className:e,variant:t="outline",size:n="default",...r}){return w.jsx(Sm,{"data-slot":"alert-dialog-cancel",className:De(e),render:w.jsx(Ht,{variant:t,size:n}),...r})}function Dx({...e}){return w.jsx(kN,{"data-slot":"dialog",...e})}function Gee({...e}){return w.jsx($w,{"data-slot":"dialog-portal",...e})}function Yee({className:e,...t}){return w.jsx(Cw,{"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 _x({className:e,children:t,showCloseButton:n=!0,...r}){return w.jsxs(Gee,{children:[w.jsx(Yee,{}),w.jsxs(Hw,{"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(Sm,{"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 Ix({className:e,...t}){return w.jsx("div",{"data-slot":"dialog-header",className:De("gap-2 flex flex-col",e),...t})}function hM({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(Sm,{render:w.jsx(Ht,{variant:"outline"}),children:"Close"})]})}function Px({className:e,...t}){return w.jsx(Kw,{"data-slot":"dialog-title",className:De("text-base leading-none font-medium",e),...t})}function e_({className:e,...t}){return w.jsx(kw,{"data-slot":"dialog-description",className:De("text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3",e),...t})}function N0({...e}){return w.jsx(DD,{"data-slot":"dropdown-menu",...e})}function A0({...e}){return w.jsx(RJ,{"data-slot":"dropdown-menu-trigger",...e})}function D0({align:e="start",alignOffset:t=0,side:n="bottom",sideOffset:r=4,backdrop:o=!1,className:a,...l}){return w.jsxs(OD,{children:[o&&w.jsx(fJ,{className:"fixed inset-0 z-50"}),w.jsx(ND,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:n,sideOffset:r,children:w.jsx(kD,{"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 lc({className:e,inset:t,variant:n="default",...r}){return w.jsx(CD,{"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 Gre({className:e,...t}){return w.jsx(Tw,{"data-slot":"dropdown-menu-separator",className:De("bg-border -mx-1 my-1 h-px",e),...t})}const Kee=(e,t)=>["watch-rules",e,t],t_=e=>["watch-rule-state",e];async function qc(e,t){try{return(await e.json()).error??t}catch{return t}}async function Wee(e,t){const n=new URLSearchParams({deviceId:e,paneId:t}),r=await fetch(`/api/watch/rules?${n}`);if(!r.ok)throw new Error(await qc(r,"Failed to load watch rules"));return(await r.json()).rules}async function Xee(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 qc(t,"Failed to create watch rule"));return await t.json()}async function n_(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 qc(n,"Failed to update watch rule"));return await n.json()}async function Qee(e){const t=await fetch(`/api/watch/rules/${e}`,{method:"DELETE"});if(!t.ok)throw new Error(await qc(t,"Failed to delete watch rule"))}async function r_(e){const t=await fetch(`/api/watch/rules/${e}/state`);if(!t.ok)throw new Error(await qc(t,"Failed to load watch rule state"));return await t.json()}async function Zee(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 qc(t,"Failed to generate regex"));return await t.json()}const Jee=["match","unchanged","llm"],fv="__default__";function pM(e){return e==="llm"?30:5}function ete({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"),[A,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=ai({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=pM(d),he=J=>{m(J);const Ee=pM(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(!A.trim())return a("watch.validation.conditionPromptRequired");return!Number.isInteger(B)||B<te?a("watch.validation.intervalMin",{min:te}):null},Le=Sd({mutationFn:async()=>{const J={name:c.trim(),triggerType:d,pattern:Se?h:null,patternFlags:Se?g:"",extractGroup:E,conditionPrompt:d==="llm"?A: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 n_(n.id,xe),!1}const Ee={...J,deviceId:e,paneId:t,enabled:!0};return await Xee(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=Sd({mutationFn:async()=>Zee({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:Jee.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(_N,{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(bp,{value:k,onValueChange:J=>{(J==="reset"||J==="ignore")&&M(J)},children:[w.jsx(vp,{className:"w-full","data-testid":"watch-form-no-match-behavior",children:w.jsx(sv,{children:a(k==="reset"?"watch.form.noMatchReset":"watch.form.noMatchIgnore")})}),w.jsxs(xp,{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(e0,{id:`${l}-condition`,"data-testid":"watch-form-condition-prompt",value:A,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(bp,{value:N??fv,onValueChange:J=>{if(!J)return;const Ee=J===fv?null:J;_(Ee),Ee===null&&F("")},children:[w.jsx(vp,{className:"w-full","data-testid":"watch-form-provider",children:w.jsx(sv,{children:N?(ue==null?void 0:ue.name)??a("watch.form.providerUnavailable"):a("watch.form.followGlobalDefault")})}),w.jsxs(xp,{children:[w.jsx(Fo,{value:fv,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(Vp,{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(Vp,{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(bp,{value:z,onValueChange:J=>{(J==="once"||J==="repeat")&&V(J)},children:[w.jsx(vp,{className:"w-full","data-testid":"watch-form-fire-mode",children:w.jsx(sv,{children:a(z==="once"?"watch.form.fireOnce":"watch.form.fireRepeat")})}),w.jsxs(xp,{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 id(e){if(!e)return null;const t=new Date(e);return Number.isNaN(t.getTime())?null:t.toLocaleString()}function tte({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=ai({queryKey:Kee(n,r),queryFn:()=>Wee(n,r),enabled:e,throwOnError:!1}),g=()=>{a.invalidateQueries({queryKey:["watch-rules"]})},x=Sd({mutationFn:async({rule:C,enabled:k})=>{await n_(C.id,{enabled:k})},onSuccess:g,onError:C=>{Bt.error(C instanceof Error?C.message:String(C)),g()}}),E=Sd({mutationFn:async C=>{await Qee(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(Dx,{open:e,onOpenChange:t,children:w.jsxs(_x,{className:"sm:max-w-lg max-h-[85dvh] grid-rows-[auto_minmax(0,1fr)]","data-testid":"watch-dialog",children:[w.jsxs(Ix,{children:[w.jsxs(Px,{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(e_,{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(G8,{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(nte,{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(Dm,{className:"h-4 w-4"}),o("watch.rules.addRule")]})]}),l.mode==="form"&&w.jsx(ete,{deviceId:n,paneId:r,rule:l.rule,onSaved:R,onCancel:()=>c({mode:"list"})}),l.mode==="state"&&w.jsx(rte,{rule:l.rule,onBack:()=>c({mode:"list"})})]})]})}),w.jsx(Tx,{open:f!==null,onOpenChange:C=>!C&&d(null),children:w.jsxs(Rx,{"data-testid":"watch-rule-delete-dialog",children:[w.jsxs(Cx,{children:[w.jsx(Mx,{children:o("watch.rules.deleteTitle")}),w.jsx(Ox,{children:o("watch.rules.deleteDesc",{name:(f==null?void 0:f.name)??""})})]}),w.jsxs(kx,{children:[w.jsx(Ax,{children:o("common.cancel")}),w.jsx(Nx,{variant:"destructive","data-testid":"watch-rule-delete-confirm",onClick:()=>{f&&E.mutate(f),d(null)},children:o("watch.rules.deleteConfirm")})]})]})})]})}function nte({rule:e,onToggle:t,onEdit:n,onViewState:r,onDelete:o}){var f,d;const{t:a}=mn(),l=ai({queryKey:t_(e.id),queryFn:()=>r_(e.id),throwOnError:!1}),c=id((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(Vp,{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(B8,{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(Am,{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(IN,{className:"h-3.5 w-3.5 text-destructive"})})]})]})]})}function rte({rule:e,onBack:t}){var f,d;const{t:n}=mn(),r=ai({queryKey:t_(e.id),queryFn:()=>r_(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:id(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:id(o==null?void 0:o.lastValueChangedAt)??l},{label:n("watch.state.lastTriggeredAt"),value:id(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(V8,{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:id(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 ite(){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 qm=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Vc(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function _0(e){return"nodeType"in e}function Gr(e){var t,n;return e?Vc(e)?e:_0(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function I0(e){const{Document:t}=Gr(e);return e instanceof t}function ff(e){return Vc(e)?!1:e instanceof Gr(e).HTMLElement}function i_(e){return e instanceof Gr(e).SVGElement}function $c(e){return e?Vc(e)?e.document:_0(e)?I0(e)?e:ff(e)||i_(e)?e.ownerDocument:document:document:document}const fo=qm?v.useLayoutEffect:v.useEffect;function P0(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 ote(){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 Pd(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 em(e){const t=P0(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 Lx(e){const t=v.useRef();return v.useEffect(()=>{t.current=e},[e]),t.current}let hv={};function pf(e,t){return v.useMemo(()=>{if(t)return t;const n=hv[e]==null?0:hv[e]+1;return hv[e]=n,e+"-"+n},[e,t])}function o_(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 cc=o_(1),Ld=o_(-1);function ate(e){return"clientX"in e&&"clientY"in e}function L0(e){if(!e)return!1;const{KeyboardEvent:t}=Gr(e.target);return t&&e instanceof t}function ste(e){if(!e)return!1;const{TouchEvent:t}=Gr(e.target);return t&&e instanceof t}function jx(e){if(ste(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 ate(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}}}),mM="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function lte(e){return e.matches(mM)?e:e.querySelector(mM)}const cte={display:"none"};function ute(e){let{id:t,value:n}=e;return Fe.createElement("div",{id:t,style:cte},n)}function dte(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 fte(){const[e,t]=v.useState("");return{announce:v.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const a_=v.createContext(null);function hte(e){const t=v.useContext(a_);v.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function pte(){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 mte={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
+ `},gte={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 yte(e){let{announcements:t=gte,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=mte}=e;const{announce:a,announcement:l}=fte(),c=pf("DndLiveRegion"),[f,d]=v.useState(!1);if(v.useEffect(()=>{d(!0)},[]),hte(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(ute,{id:r,value:o.draggable}),Fe.createElement(dte,{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 tm(){}function pv(e,t){return v.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function bte(){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 s_(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function l_(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function vte(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function gM(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 c_(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function yM(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 j0=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=yM(t,t.left,t.top),a=[];for(const l of r){const{id:c}=l,f=n.get(c);if(f){const d=s_(yM(f),o);a.push({id:c,data:{droppableContainer:l,value:d}})}}return a.sort(l_)},xte=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=gM(t),a=[];for(const l of r){const{id:c}=l,f=n.get(c);if(f){const d=gM(f),m=o.reduce((y,g,x)=>y+s_(d[x],g),0),h=Number((m/4).toFixed(4));a.push({id:c,data:{droppableContainer:l,value:h}})}}return a.sort(l_)};function wte(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 Ste=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=wte(c,t);f>0&&o.push({id:l,data:{droppableContainer:a,value:f}})}}return o.sort(vte)};function Ete(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function u_(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Vi}function Tte(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 Rte=Tte(1);function Cte(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 kte(e,t,n){const r=Cte(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 Mte={ignoreTransform:!1};function Gc(e,t){t===void 0&&(t=Mte);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:m}=Gr(e).getComputedStyle(e);d&&(n=kte(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 bM(e){return Gc(e,{ignoreTransform:!0})}function Ote(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Nte(e,t){return t===void 0&&(t=Gr(e).getComputedStyle(e)),t.position==="fixed"}function Ate(e,t){t===void 0&&(t=Gr(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 Vm(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(I0(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!ff(o)||i_(o)||n.includes(o))return n;const a=Gr(e).getComputedStyle(o);return o!==e&&Ate(o,a)&&n.push(o),Nte(o,a)?n:r(o.parentNode)}return e?r(e):n}function d_(e){const[t]=Vm(e,1);return t??null}function mv(e){return!qm||!e?null:Vc(e)?e:_0(e)?I0(e)||e===$c(e).scrollingElement?window:ff(e)?e:null:null}function f_(e){return Vc(e)?e.scrollX:e.scrollLeft}function h_(e){return Vc(e)?e.scrollY:e.scrollTop}function zx(e){return{x:f_(e),y:h_(e)}}var sr;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(sr||(sr={}));function p_(e){return!qm||!e?!1:e===document.scrollingElement}function m_(e){const t={x:0,y:0},n=p_(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 Dte={x:.2,y:.2};function _te(e,t,n,r,o){let{top:a,left:l,right:c,bottom:f}=n;r===void 0&&(r=10),o===void 0&&(o=Dte);const{isTop:d,isBottom:m,isLeft:h,isRight:y}=m_(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 Ite(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 g_(e){return e.reduce((t,n)=>cc(t,zx(n)),Vi)}function Pte(e){return e.reduce((t,n)=>t+f_(n),0)}function Lte(e){return e.reduce((t,n)=>t+h_(n),0)}function jte(e,t){if(t===void 0&&(t=Gc),!e)return;const{top:n,left:r,bottom:o,right:a}=t(e);d_(e)&&(o<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const zte=[["x",["left","right"],Pte],["y",["top","bottom"],Lte]];class z0{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=Vm(n),o=g_(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,l,c]of zte)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 bd{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 Fte(e){const{EventTarget:t}=Gr(e);return e instanceof t?e:$c(e)}function gv(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 Si;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Si||(Si={}));function vM(e){e.preventDefault()}function Bte(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 y_={start:[an.Space,an.Enter],cancel:[an.Esc],end:[an.Space,an.Enter,an.Tab]},Ute=(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 F0{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 bd($c(n)),this.windowListeners=new bd(Gr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Si.Resize,this.handleCancel),this.windowListeners.add(Si.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Si.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&jte(r),n(Vi)}handleKeyDown(t){if(L0(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:a=y_,coordinateGetter:l=Ute,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=Ld(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:A,minScroll:O}=m_(E),N=Ite(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<=A.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-A.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<=A.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-A.y:E.scrollTop-O.y,g.y&&E.scrollBy({top:-g.y,behavior:c});break}}this.handleMove(t,cc(Ld(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()}}F0.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=y_,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 xM(e){return!!(e&&"distance"in e)}function wM(e){return!!(e&&"delay"in e)}class B0{constructor(t,n,r){var o;r===void 0&&(r=Fte(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=$c(l),this.documentListeners=new bd(this.document),this.listeners=new bd(r),this.windowListeners=new bd(Gr(l)),this.initialCoordinates=(o=jx(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(Si.Resize,this.handleCancel),this.windowListeners.add(Si.DragStart,vM),this.windowListeners.add(Si.VisibilityChange,this.handleCancel),this.windowListeners.add(Si.ContextMenu,vM),this.documentListeners.add(Si.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(wM(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(xM(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(Si.Click,Bte,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Si.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=jx(t))!=null?n:Vi,d=Ld(o,f);if(!r&&c){if(xM(c)){if(c.tolerance!=null&&gv(d,c.tolerance))return this.handleCancel();if(gv(d,c.distance))return this.handleStart()}if(wM(c)&&gv(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 Hte={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class b_ extends B0{constructor(t){const{event:n}=t,r=$c(n.target);super(t,Hte,r)}}b_.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 qte={move:{name:"mousemove"},end:{name:"mouseup"}};var Fx;(function(e){e[e.RightClick=2]="RightClick"})(Fx||(Fx={}));class v_ extends B0{constructor(t){super(t,qte,$c(t.event.target))}}v_.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Fx.RightClick?!1:(r==null||r({event:n}),!0)}}];const yv={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class x_ extends B0{constructor(t){super(t,yv)}static setup(){return window.addEventListener(yv.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(yv.move.name,t)};function t(){}}}x_.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 vd;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(vd||(vd={}));var nm;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(nm||(nm={}));function Vte(e){let{acceleration:t,activator:n=vd.Pointer,canScroll:r,draggingRect:o,enabled:a,interval:l=5,order:c=nm.TreeOrder,pointerCoordinates:f,scrollableAncestors:d,scrollableAncestorRects:m,delta:h,threshold:y}=e;const g=Gte({delta:h,disabled:!a}),[x,E]=ote(),R=v.useRef({x:0,y:0}),T=v.useRef({x:0,y:0}),C=v.useMemo(()=>{switch(n){case vd.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case vd.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,_)},[]),A=v.useMemo(()=>c===nm.TreeOrder?[...d].reverse():d,[c,d]);v.useEffect(()=>{if(!a||!d.length||!C){E();return}for(const O of A){if((r==null?void 0:r(O))===!1)continue;const N=d.indexOf(O),_=m[N];if(!_)continue;const{direction:q,speed:F}=_te(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,A,m,JSON.stringify(y)])}const $te={x:{[sr.Backward]:!1,[sr.Forward]:!1},y:{[sr.Backward]:!1,[sr.Forward]:!1}};function Gte(e){let{delta:t,disabled:n}=e;const r=Lx(t);return hf(o=>{if(n||!r||!o)return $te;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 Yte(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 Kte(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 jd;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(jd||(jd={}));var Bx;(function(e){e.Optimized="optimized"})(Bx||(Bx={}));const SM=new Map;function Wte(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=Pd(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 SM;if(!T||T===SM||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,A=M?new z0(f(M),M):null;k.rect.current=A,A&&C.set(k.id,A)}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 jd.Always:return!1;case jd.BeforeDragging:return n;default:return!n}}}function w_(e,t){return hf(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Xte(e,t){return w_(e,t)}function Qte(e){let{callback:t,disabled:n}=e;const r=P0(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 $m(e){let{callback:t,disabled:n}=e;const r=P0(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 Zte(e){return new z0(Gc(e),e)}function EM(e,t,n){t===void 0&&(t=Zte);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=Qte({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=$m({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 Jte(e){const t=w_(e);return u_(e,t)}const TM=[];function ene(e){const t=v.useRef(e),n=hf(r=>e?r&&r!==TM&&e&&t.current&&e.parentNode===t.current.parentNode?r:Vm(e):TM,[e]);return v.useEffect(()=>{t.current=e},[e]),n}function tne(e){const[t,n]=v.useState(null),r=v.useRef(e),o=v.useCallback(a=>{const l=mv(a.target);l&&n(c=>c?(c.set(l,zx(l)),new Map(c)):null)},[]);return v.useEffect(()=>{const a=r.current;if(e!==a){l(a);const c=e.map(f=>{const d=mv(f);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,zx(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=mv(f);d==null||d.removeEventListener("scroll",o)})}},[o,e]),v.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,l)=>cc(a,l),Vi):g_(e):Vi,[e,t])}function RM(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?Ld(e,n.current):Vi}function nne(e){v.useEffect(()=>{if(!qm)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 rne(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 S_(e){return v.useMemo(()=>e?Ote(e):null,[e])}const CM=[];function ine(e,t){t===void 0&&(t=Gc);const[n]=e,r=S_(n?Gr(n):null),[o,a]=v.useState(CM);function l(){a(()=>e.length?e.map(f=>p_(f)?r:new z0(t(f),f)):CM)}const c=$m({callback:l});return fo(()=>{c==null||c.disconnect(),l(),e.forEach(f=>c==null?void 0:c.observe(f))},[e]),o}function one(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ff(t)?t:e}function ane(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=$m({callback:o}),l=v.useCallback(d=>{const m=one(d);a==null||a.disconnect(),m&&(a==null||a.observe(m)),r(m?t(m):null)},[t,a]),[c,f]=em(l);return v.useMemo(()=>({nodeRef:c,rect:n,setRef:f}),[n,c,f])}const sne=[{sensor:b_,options:{}},{sensor:F0,options:{}}],lne={current:{}},Ep={draggable:{measure:bM},droppable:{measure:bM,strategy:jd.WhileDragging,frequency:Bx.Optimized},dragOverlay:{measure:Gc}};class xd 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 cne={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new xd,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:tm},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ep,measureDroppableContainers:tm,windowRect:null,measuringScheduled:!1},une={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:tm,draggableNodes:new Map,over:null,measureDroppableContainers:tm},Gm=v.createContext(une),E_=v.createContext(cne);function dne(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new xd}}}function fne(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 xd(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 xd(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 xd(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function hne(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=v.useContext(Gm),a=Lx(r),l=Lx(n==null?void 0:n.id);return v.useEffect(()=>{if(!t&&!r&&a&&l!=null){if(!L0(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=lte(m);if(h){h.focus();break}}})}},[r,t,o,l,a]),null}function pne(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,a)=>a({transform:o,...r}),n):n}function mne(e){return v.useMemo(()=>({draggable:{...Ep.draggable,...e==null?void 0:e.draggable},droppable:{...Ep.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Ep.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 gne(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=u_(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=d_(d);y&&y.scrollBy({top:h.y,left:h.x})}},[t,l,c,r,n])}const T_=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 U0=v.memo(function(t){var n,r,o,a;let{id:l,accessibility:c,autoScroll:f=!0,children:d,sensors:m=sne,collisionDetection:h=Ste,measuring:y,modifiers:g,...x}=t;const E=v.useReducer(fne,void 0,dne),[R,T]=E,[C,k]=pte(),[M,A]=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:lne,rect:P}:null},[N,G]),H=v.useRef(null),[B,j]=v.useState(null),[z,V]=v.useState(null),K=Pd(x,Object.values(x)),L=pf("DndDescribedBy",l),$=v.useMemo(()=>F.getEnabled(),[F]),W=mne(y),{droppableRects:I,measureDroppableContainers:Q,measuringScheduled:le}=Wte($,{dragging:O,dependencies:[q.x,q.y],config:W.droppable}),oe=Yte(_,N),Z=v.useMemo(()=>z?jx(z):null,[z]),ue=ot(),ve=Xte(oe,W.draggable.measure);gne({activeNode:N!=null?_.get(N):null,config:ue.layoutShiftCompensation,initialRect:ve,measure:W.draggable.measure});const Se=EM(oe,W.draggable.measure,ve),Pe=EM(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=ane({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=Jte(Te?null:Se),J=S_(Le?Gr(Le):null),Ee=ene(O?he??oe:null),xe=ine(Ee),Be=pne(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?cc(Z,q):null,_e=tne(Ee),ut=RM(_e),pe=RM(_e,[Se]),Re=cc(Be,ut),ee=Oe?Rte(Oe,Be):null,fe=U&&ee?h({active:U,collisionRect:ee,droppableRects:I,droppableContainers:$,pointerCoordinates:Ve}):null,Ne=c_(fe,"id"),[Ue,$e]=v.useState(null),et=Te?Be:cc(Be,pe),ze=Ete(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),A(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}),A(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=Kte(m,Ct);nne(m),fo(()=>{Se&&M===Ma.Initializing&&A(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]),Vte({...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(a_.Provider,{value:k},Fe.createElement(Gm.Provider,{value:Dt},Fe.createElement(E_.Provider,{value:bt},Fe.createElement(T_.Provider,{value:ze},d)),Fe.createElement(hne,{disabled:(c==null?void 0:c.restoreFocus)===!1})),Fe.createElement(yte,{...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}}}),yne=v.createContext(null),kM="button",bne="Draggable";function vne(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const a=pf(bne),{activators:l,activatorEvent:c,active:f,activeNodeRect:d,ariaDescribedById:m,draggableNodes:h,over:y}=v.useContext(Gm),{role:g=kM,roleDescription:x="draggable",tabIndex:E=0}=o??{},R=(f==null?void 0:f.id)===t,T=v.useContext(R?T_:yne),[C,k]=em(),[M,A]=em(),O=rne(l,t),N=Pd(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===kM?!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:A,transform:T}}function xne(){return v.useContext(E_)}const wne="Droppable",Sne={timeout:25};function Ene(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const a=pf(wne),{active:l,dispatch:c,over:f,measureDroppableContainers:d}=v.useContext(Gm),m=v.useRef({disabled:n}),h=v.useRef(!1),y=v.useRef(null),g=v.useRef(null),{disabled:x,updateMeasurementsFor:E,timeout:R}={...Sne,...o},T=Pd(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=$m({callback:C,disabled:x||!l}),M=v.useCallback((_,q)=>{k&&(q&&(k.unobserve(q),h.current=!1),_&&k.observe(_))},[k]),[A,O]=em(M),N=Pd(t);return v.useEffect(()=>{!k||!A.current||(k.disconnect(),h.current=!1,k.observe(A.current))},[A,k]),v.useEffect(()=>(c({type:tr.RegisterDroppable,element:{id:r,key:a,disabled:n,node:A,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:A,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 Tne(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 Rne(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 Cne(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const R_=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},H0=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=kne(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 kne(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 C_="Sortable",k_=Fe.createContext({activeIndex:-1,containerId:C_,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:R_,disabled:{draggable:!1,droppable:!1}});function q0(e){let{children:t,id:n,items:r,strategy:o=R_,disabled:a=!1}=e;const{active:l,dragOverlay:c,droppableRects:f,over:d,measureDroppableContainers:m}=xne(),h=pf(C_,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=!Rne(g,T.current),k=R!==-1&&E===-1||C,M=Cne(a);fo(()=>{C&&x&&m(g)},[C,g,x,m]),v.useEffect(()=>{T.current=g},[g]);const A=v.useMemo(()=>({activeIndex:E,containerId:h,disabled:M,disableTransforms:k,items:g,overIndex:R,useDragOverlay:y,sortedRects:Tne(g,f),strategy:o}),[E,h,M.draggable,M.droppable,k,g,R,f,y,o]);return Fe.createElement(k_.Provider,{value:A},t)}const Mne=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return mf(n,r,o).indexOf(t)},One=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},Nne={duration:200,easing:"ease"},M_="transform",Ane=ol.Transition.toString({property:M_,duration:0,easing:"linear"}),Dne={roleDescription:"sortable"};function _ne(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=Gc(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 V0(e){let{animateLayoutChanges:t=One,attributes:n,disabled:r,data:o,getNewIndex:a=Mne,id:l,strategy:c,resizeObserverConfig:f,transition:d=Nne}=e;const{items:m,containerId:h,activeIndex:y,disabled:g,disableTransforms:x,sortedRects:E,overIndex:R,useDragOverlay:T,strategy:C}=v.useContext(k_),k=Ine(r,g),M=m.indexOf(l),A=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}=Ene({id:l,data:A,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}=vne({id:l,data:A,attributes:{...Dne,...n},disabled:k.draggable}),$=ite(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=_ne({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:A,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 Ane;if(!(Q&&!L0(P)||!d)&&(W||te))return ol.Transition.toString({...d,property:M_})}}function Ine(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 rm(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 Pne=[an.Down,an.Right,an.Up,an.Left],Lne=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:a,over:l,scrollableAncestors:c}}=t;if(Pne.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=xte({collisionRect:r,droppableRects:o,droppableContainers:f});let m=c_(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=Vm(x).some((O,N)=>c[N]!==O),T=O_(h,y),C=jne(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:Ld(M,k)}}}};function O_(e,t){return!rm(e)||!rm(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function jne(e,t){return!rm(e)||!rm(t)||!O_(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function N_({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 $0(){return bte(pv(v_,{activationConstraint:{distance:8}}),pv(x_,{activationConstraint:{delay:250,tolerance:5}}),pv(F0,{coordinateGetter:Lne}))}function zne(){const{t:e}=mn(),t=Gi(),n=Kd(),{isMobile:r,setOpenMobile:o}=Vr(),{toggleDevice:a}=mV(),l=sn(ee=>ee.sessions),c=sn(ee=>ee.activeSessionId),f=Nr(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}=ai({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 A=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}})),A(`/devices/${ee}/windows/${fe}/panes/${O0(Ne)}`,{keepSidebarOpen:Ue==null?void 0:Ue.keepSidebarOpen})},[A]),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&&A("/devices"):A(`/devices/${ee}`),a(ee,fe)},[a,m,A]),U=v.useCallback((ee,fe)=>{ee===m&&fe===h&&A("/devices"),E(ee,fe)},[E,m,h,A]),[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?NV(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??t0(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=$0(),Be=Sd({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,n2(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(Zw,{className:"flex flex-col flex-1 min-h-0 pt-0",children:[w.jsx(U0,{sensors:xe,collisionDetection:j0,onDragEnd:ut,children:w.jsx(FD,{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(q0,{items:_e.map(ee=>ee.id),strategy:H0,children:_e.map(ee=>{var fe,Ne;return w.jsx(Fne,{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(Hne,{sessions:Re,activeSessionId:c,onSelectSession:N,onRenameSession:Oe,onDeleteSession:Ce})]})})}),w.jsx(Tx,{open:H!==null,onOpenChange:ee=>!ee&&B(null),children:w.jsxs(Rx,{children:[w.jsxs(Cx,{children:[w.jsx(fM,{className:"bg-destructive/10",children:w.jsx(Ko,{className:"h-5 w-5 text-destructive"})}),w.jsx(Mx,{children:(H==null?void 0:H.kind)==="pane"?e("window.closePaneConfirmTitle"):e("window.closeConfirmTitle")}),w.jsx(Ox,{children:e("window.closeConfirmDesc",{name:(H==null?void 0:H.name)??""})})]}),w.jsxs(kx,{children:[w.jsx(Ax,{children:e("common.cancel")}),w.jsx(Nx,{variant:"destructive",disabled:!H,onClick:V,children:e("common.close")})]})]})}),w.jsx(Dx,{open:K!==null,onOpenChange:ee=>!ee&&L(null),children:w.jsx(_x,{"data-testid":"window-rename-dialog",children:w.jsxs("form",{onSubmit:ee=>{ee.preventDefault(),Q()},children:[w.jsxs(Ix,{children:[w.jsx(Px,{children:e("window.rename")}),w.jsx(e_,{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(hM,{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(Dx,{open:Se!==null,onOpenChange:ee=>!ee&&Pe(null),children:w.jsx(_x,{"data-testid":"agent-session-rename-dialog",children:w.jsxs("form",{onSubmit:ee=>{ee.preventDefault(),Te()},children:[w.jsx(Ix,{children:w.jsx(Px,{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(hM,{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(Tx,{open:ye!==null,onOpenChange:ee=>!ee&&Le(null),children:w.jsxs(Rx,{children:[w.jsxs(Cx,{children:[w.jsx(fM,{className:"bg-destructive/10",children:w.jsx(Ko,{className:"h-5 w-5 text-destructive"})}),w.jsx(Mx,{children:e("agent.session.deleteTitle")}),w.jsx(Ox,{children:e("agent.session.deleteDesc",{title:(ye==null?void 0:ye.title)??""})})]}),w.jsxs(kx,{children:[w.jsx(Ax,{children:e("common.cancel")}),w.jsx(Nx,{variant:"destructive",disabled:!ye,onClick:J,"data-testid":"agent-session-delete-confirm",children:e("agent.session.deleteConfirm")})]})]})}),Z&&w.jsx(tte,{open:!0,onOpenChange:ee=>!ee&&ue(null),deviceId:Z.deviceId,paneId:Z.paneId})]})}function Fne({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(),A=e.type==="local"?af:Nm,{attributes:O,listeners:N,setNodeRef:_,setActivatorNodeRef:q,transform:F,transition:G,isDragging:P}=V0({id:e.id}),U=$0(),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(Ww,{className:"h-3.5 w-3.5 [@media(any-pointer:coarse)]:h-5 [@media(any-pointer:coarse)]:w-5"})}),w.jsx(A,{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(Hee,{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(eq,{className:"h-3.5 w-3.5 text-orange-500"}):w.jsx(nq,{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(U0,{sensors:U,collisionDetection:j0,onDragEnd:H,children:w.jsx(q0,{items:t.map(B=>B.id),strategy:H0,children:t.map(B=>w.jsx(Bne,{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(Dm,{className:"h-3.5 w-3.5 shrink-0"}),w.jsx("span",{className:"text-xs",children:M("window.new")})]})]})]})}function Bne({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}=Vr(),C=t.panes.length>1,k=t0(t),M=t.panes.find(B=>B.id===r),A=n&&!!M,{attributes:O,listeners:N,setNodeRef:_,setActivatorNodeRef:q,transform:F,transition:G,isDragging:P}=V0({id:t.id}),U=$0(),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(Ww,{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",A?"bg-primary/10 text-primary":t.active?"bg-accent text-accent-foreground":"hover:bg-accent/50 text-foreground"),children:[w.jsx(il,{variant:A?"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(N0,{children:[w.jsx(A0,{"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",A?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100"),children:w.jsx(NN,{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(D0,{align:"end",backdrop:!0,className:"w-auto min-w-36 [@media(any-pointer:coarse)]:min-w-48",children:[w.jsxs(lc,{"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(Am,{className:De("h-4 w-4",T&&"h-5 w-5")}),R("window.rename")]}),w.jsxs(lc,{"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(Dm,{className:De("h-4 w-4",T&&"h-5 w-5")}),R("agent.session.new")]}),w.jsxs(lc,{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(U0,{sensors:U,collisionDetection:j0,onDragEnd:H,children:w.jsx(q0,{items:t.panes.map(B=>B.id),strategy:H0,children:t.panes.map(B=>w.jsx(Une,{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(D_,{sessions:m.get(`${e}:${t.panes[0].id}`),activeSessionId:h,onSelectSession:y,onRenameSession:x,onDeleteSession:E})})]})}function Une({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}=V0({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:A=>A.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(Ww,{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(N0,{children:[w.jsx(A0,{"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(NN,{className:De(o?"h-5 w-5":"h-3.5 w-3.5")})}),w.jsx(D0,{align:"end",backdrop:!0,className:"w-auto min-w-36 [@media(any-pointer:coarse)]:min-w-48",children:w.jsxs(lc,{"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(iq,{className:De("h-4 w-4",o&&"h-5 w-5")}),g("watch.openMonitor")]})})]}),w.jsx("button",{type:"button",onClick:A=>{A.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(D_,{sessions:f,activeSessionId:d,onSelectSession:m,onRenameSession:h,onDeleteSession:y})]})}function A_({session:e,onRenameSession:t,onDeleteSession:n,className:r,enlargeOnTouch:o=!1}){const{t:a}=mn(),{isMobile:l}=Vr(),c=o&&l;return w.jsxs(N0,{children:[w.jsx(A0,{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(u9,{className:De("size-3.5",c&&"size-5")})}),w.jsxs(D0,{align:"end",backdrop:!0,className:"w-auto min-w-36 [@media(any-pointer:coarse)]:min-w-48",children:[w.jsxs(lc,{"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(Am,{className:De("h-4 w-4",l&&"h-5 w-5")}),a("agent.session.rename")]}),w.jsxs(lc,{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(IN,{className:De("h-4 w-4",l&&"h-5 w-5")}),a("agent.session.delete")]})]})]})}function D_({sessions:e,activeSessionId:t,onSelectSession:n,onRenameSession:r,onDeleteSession:o}){const{isMobile:a}=Vr();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(Om,{className:"size-3 shrink-0 opacity-70"}),w.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px]",children:l.title}),w.jsx(N_,{status:l.status})]}),w.jsx("div",{className:"absolute right-0.5 top-1/2 -translate-y-1/2",children:w.jsx(A_,{session:l,onRenameSession:r,onDeleteSession:o,enlargeOnTouch:!0})})]},l.id)})})}function Hne({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(zm,{open:l,onOpenChange:c,className:"rounded-xl border border-border/60 bg-muted/20",children:[w.jsxs(Fm,{"data-testid":"agent-orphan-sessions-trigger",className:"flex w-full items-center gap-2 px-3 py-1.5 text-left",children:[w.jsx(I9,{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(Bm,{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(n2(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(Om,{className:"size-3 shrink-0 opacity-70"}),w.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px]",children:d.title}),w.jsx(N_,{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(A_,{session:d,onRenameSession:r,onDeleteSession:o})})]},d.id)})})]})}function qne(){const{t:e}=mn(),{isMobile:t,setOpenMobile:n}=Vr(),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=Nr(m=>m.theme),c=Nr(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(Jp,{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(yq,{className:"h-4 w-4"}):w.jsx(G9,{className:"h-4 w-4"})}),w.jsx(Jp,{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(fq,{className:"h-4 w-4"})})]})}const bv="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]",Vne=[{title:"nav.manageDevices",url:"/devices",icon:af}];function $ne({...e}){const{t}=mn(),n=Nr(o=>o.sidebarTab),r=Nr(o=>o.setSidebarTab);return w.jsxs(p7,{variant:"inset",...e,children:[w.jsx("div",{className:"h-[var(--tmex-safe-area-top)]"}),w.jsxs(b7,{className:"gap-5 pt-3 pb-0",children:[w.jsx(qne,{}),w.jsx(jee,{className:"mb-2.5",value:n,onValueChange:o=>r(o),children:w.jsxs(Fee,{className:"w-full p-1 rounded-xl border border-border/60 group-data-horizontal/tabs:h-11",children:[w.jsxs(dv,{value:"panes","data-testid":"sidebar-tab-panes",className:bv,children:[w.jsx(X9,{}),t("sidebar.tab.panes")]}),w.jsxs(dv,{value:"agent","data-testid":"sidebar-tab-agent",className:bv,children:[w.jsx(Om,{}),t("sidebar.tab.agent")]}),w.jsxs(dv,{value:"files","data-testid":"sidebar-tab-files",className:bv,children:[w.jsx(k9,{}),t("sidebar.tab.files")]})]})})]}),w.jsxs(x7,{className:"flex min-h-0 flex-col overflow-hidden",children:[n==="panes"&&w.jsx(zne,{}),n==="agent"&&w.jsx(AZ,{}),n==="files"&&w.jsx(wee,{})]}),n==="panes"&&w.jsxs(v7,{children:[w.jsx(Bee,{items:Vne}),w.jsx("div",{className:"h-[var(--tmex-safe-area-bottom)]"})]})]})}let MM=!1;function Gne(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/${O0(t)}`:`/devices/${e}`}function Yne(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 Kne(e,t){var r;const n=Yne(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 Wne(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 Xne(e,t){e.invalidateQueries({queryKey:["watch-rules"]}),e.invalidateQueries({queryKey:["watch-rule-state",t]})}async function Qne(e,t,n,r,o){const l=await Kne(e,t)??Qt.t("watch.toast.triggeredTitle"),c=o.summary||o.matchedText||"",f=c.length>200?`${c.slice(0,200)}…`:c,d=Gne(n,r,o.windowId);Bt(l,{description:f,action:{label:Qt.t("watch.toast.openTerminal"),onClick:()=>{window.location.href=d}}}),Wne(l,f,d)}function Zne(e){if(MM)return;MM=!0,In().onMessage(n=>{if(n.kind!==bj)return;let r;try{r=Bo(Rz,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(Xne(e,r.ruleId),r.eventType){case Dj:Qne(e,r.ruleId,r.deviceId,r.paneId,o);return;case _j:{const a=o;Bt.warning(Qt.t("watch.toast.modelUnavailableTitle"),{description:`${a.message} ${Qt.t("watch.toast.modelUnavailableHint")}`});return}case Ij:{const a=o;Bt.error(Qt.t("watch.toast.ruleErrorTitle"),{description:a.message});return}default:return}})}function Jne(){const e=Qa();return v.useEffect(()=>{Zne(e),In().connect()},[e]),null}let zd=null;function Yre(e){zd=e}function Kre(e){zd===e&&(zd=null)}function ere(){return zd?zd():null}const tre=60,nre=.02;function rre(e){if(Math.abs(e.viewportScale-1)>nre)return 0;const t=Math.round(e.windowInnerHeight-e.viewportHeight-e.viewportOffsetTop);return t>=tre?t:0}function ire(e){const t=e.windowInnerHeight-e.inset,r=e.cursorBottomClientY+e.appliedOffset+e.margin-t,o=e.maxOffset??e.inset;return Math.min(Math.max(0,Math.round(r)),o)}function Wre(){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 ore(){return typeof window>"u"||typeof navigator>"u"?!1:"ontouchstart"in window||navigator.maxTouchPoints>0}const rp={strategy:"none"},are=8,sre=60,lre='[data-slot="sidebar-inset"]',OM=".terminal-shortcuts-strip",NM="--tmex-kb-shortcut-lift";function cre(e,t){return e.strategy!==t.strategy?!1:e.strategy==="transform"&&t.strategy==="transform"?Math.abs(e.offset-t.offset)<1:e.strategy==="height"&&t.strategy==="height"?Math.abs(e.height-t.height)<1:!0}function ure(e,t){const[n,r]=v.useState(rp);return v.useEffect(()=>{if(!ore())return;const o=window.visualViewport;if(!o)return;let a=null,l=null,c=rp,f=null,d=0;const m=A=>{cre(c,A)||(c=A,r(A))},h=()=>{if((!f||!f.isConnected)&&(f=document.querySelector(lre)),!f)return 0;const A=window.getComputedStyle(f).transform;if(!A||A==="none")return 0;try{return-new DOMMatrix(A).m42}catch{return 0}},y=A=>{d=Math.round(A),document.documentElement.style.setProperty(NM,`${d}px`)},g=A=>{const O=document.querySelector(OM);if(!O){y(0);return}const N=O.getBoundingClientRect().bottom,_=window.innerHeight-A;y(d+(N-_))},x=()=>{const A=document.querySelector(OM);return A?A.offsetHeight:0},E=()=>{if(e)return 0;const A=document.activeElement;return A instanceof Element&&A.closest("[data-virtual-keyboard-avoid]")!==null?rre({windowInnerHeight:window.innerHeight,viewportHeight:o.height,viewportOffsetTop:o.offsetTop,viewportScale:o.scale}):0},R=()=>{const A=E();if(A<=0){y(0),m(rp),k();return}if(t==="resize"){y(0);const O=window.innerHeight-A;O>=sre?m({strategy:"height",height:O}):m({strategy:"transform",offset:A}),k();return}if(t==="follow"){const O=ere();if(O){const N=x(),_=ire({cursorBottomClientY:O.bottom,appliedOffset:h(),windowInnerHeight:window.innerHeight,inset:A,margin:are+N,maxOffset:A+N});m(_>0?{strategy:"transform",offset:_}:rp),g(A)}else y(0),m({strategy:"transform",offset:A});C();return}y(0),m({strategy:"transform",offset:A}),k()},T=()=>{l=null,R()},C=()=>{l===null&&(l=window.requestAnimationFrame(T))},k=()=>{l!==null&&(window.cancelAnimationFrame(l),l=null)},M=()=>{a===null&&(a=window.requestAnimationFrame(()=>{a=null,R()}))};return R(),o.addEventListener("resize",M),o.addEventListener("scroll",M),window.addEventListener("resize",M),document.addEventListener("focusin",M),document.addEventListener("focusout",M),()=>{o.removeEventListener("resize",M),o.removeEventListener("scroll",M),window.removeEventListener("resize",M),document.removeEventListener("focusin",M),document.removeEventListener("focusout",M),a!==null&&window.cancelAnimationFrame(a),k(),document.documentElement.style.removeProperty(NM)}},[e,t]),n}const __="NotoSansSymbols2Tmex";function I_(e){return Fb.find(t=>t.id===e)??Fb.find(t=>t.id===qN)??Fb[0]}function dre(e){return`${I_(e).cssFamily}, ${__}, monospace`}const AM=new Set;function fre(e){const t=globalThis.document;if(!t||!e.files||AM.has(e.cssFamily))return;const n=t.createElement("style");n.dataset.tmexFont=e.id,n.textContent=`@font-face{font-family:${e.cssFamily};src:url("${e.files.regular}") format("woff2");font-weight:400;font-style:normal;font-display:swap}@font-face{font-family:${e.cssFamily};src:url("${e.files.bold}") format("woff2");font-weight:700;font-style:normal;font-display:swap}`,t.head.appendChild(n),AM.add(e.cssFamily)}async function hre(e,t){var o;const n=(o=globalThis.document)==null?void 0:o.fonts;if(!(n!=null&&n.load))return;const r=I_(e);r.isDefault||fre(r);try{await Promise.all([r.cssFamily,__].flatMap(a=>[n.load(`${t}px ${a}`),n.load(`bold ${t}px ${a}`)]))}catch{}}function pre(){const e=Nr(n=>n.terminalFontId),t=Nr(n=>n.terminalFontSize);v.useEffect(()=>{hre(e,t);const n=globalThis.document;n==null||n.documentElement.style.setProperty("--font-mono",dre(e))},[e,t])}console.info(`tmex ${IL("0.12.2",!0)}`);function mre(){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")}}mre();const gre=new bL({defaultOptions:{queries:{staleTime:5e3,retry:1}}});function yre(){const{openMobile:e}=Vr(),t=Nr(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 bre(){const e=Nr(t=>t.theme);return w.jsx(i3,{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 vre(){return pre(),w.jsxs(gV,{children:[w.jsx(Jne,{}),w.jsxs(h7,{children:[w.jsx(yre,{}),w.jsx(A7,{}),w.jsx($ne,{}),w.jsx(xre,{})]})]})}function xre(){const{openMobile:e}=Vr(),t=Nr(a=>a.keyboardBehaviorMode),n=ure(e,t),r=n.strategy!=="none",o=n.strategy==="transform"?{transform:`translateY(-${n.offset}px)`,transition:t==="follow"?void 0:"transform 0.12s ease-out"}:n.strategy==="height"?{height:`${n.height}px`,transition:"height 0.12s ease-out"}:void 0;return w.jsxs(y7,{className:"h-dvh overflow-hidden md:h-[calc(100dvh-1rem)]",style:o,children:[w.jsx(KF,{}),w.jsx("div",{style:{height:r?0:"var(--tmex-safe-area-bottom)",transition:"height 0.12s ease-out"}})]})}function Gl({moduleLoader:e}){const[t,n]=v.useState(null),r=CF();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(g7,{className:"-ml-1 shrink-0","data-testid":"mobile-sidebar-open"}),w.jsx(mH,{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 wre=()=>im(()=>import("./SettingsPage-BOTyBhHH.js"),__vite__mapDeps([0,1,2,3,4])),DM=()=>im(()=>import("./DevicesPage-C7THDzTX.js"),__vite__mapDeps([5,1])),_M=()=>im(()=>import("./DevicePage-B0fQ6yWB.js"),__vite__mapDeps([6,2])),Sre=()=>im(()=>import("./FilePage-D8V8P2IA.js"),__vite__mapDeps([7,3,4])),Ere=v5([{path:"/",Component:vre,children:[{index:!0,element:w.jsx(Gl,{moduleLoader:DM})},{path:"devices",element:w.jsx(Gl,{moduleLoader:DM})},{path:"devices/:deviceId",element:w.jsx(Gl,{moduleLoader:_M})},{path:"devices/:deviceId/windows/:windowId/panes/:paneId",element:w.jsx(Gl,{moduleLoader:_M})},{path:"settings",element:w.jsx(Gl,{moduleLoader:wre})},{path:"file/:ref",element:w.jsx(Gl,{moduleLoader:Sre})}]}]),P_=document.getElementById("root");if(!P_)throw new Error("Root element not found");i4.createRoot(P_).render(w.jsx(v.StrictMode,{children:w.jsxs(xL,{client:gre,children:[w.jsx($F,{router:Ere}),w.jsx(bre,{})]})}));export{cJ as $,Tx as A,Ht as B,Dx as C,N0 as D,u9 as E,_x as F,Nm as G,Ix as H,Px as I,e_ as J,ji as K,sw as L,af as M,bp as N,vp as O,Dm as P,sv as Q,xp as R,mH as S,IN as T,Fo as U,e0 as V,hM as W,De as X,ht as Y,PN as Z,Ire as _,Qa as a,tee as a$,Pre as a0,jre as a1,Lre as a2,zre as a3,Are as a4,Dre as a5,_re as a6,Nr as a7,hre as a8,D7 as a9,BC as aA,L9 as aB,iq as aC,tte as aD,Wee as aE,Kee as aF,Ure as aG,Id as aH,Hre as aI,Bre as aJ,QJ as aK,s9 as aL,Sq as aM,fq as aN,G8 as aO,_N as aP,jee as aQ,Fee as aR,dv as aS,bv as aT,Cre as aU,Qt as aV,KJ as aW,DN as aX,Fre as aY,Bi as aZ,VD as a_,_7 as aa,dre as ab,I_ as ac,Fb as ad,Hp as ae,om as af,Oq as ag,_q as ah,Iq as ai,Pq as aj,Lq as ak,o9 as al,Ko as am,Kre as an,Nd as ao,SD as ap,Yre as aq,CF as ar,Kd as as,$re as at,Wre as au,OV as av,O0 as aw,kre as ax,tl as ay,Vp as az,nl as b,Vre as b0,qre as b1,Lm as b2,m0 as b3,qV as b4,Nre as b5,Ore as b6,ux as b7,GV as b8,r0 as b9,NA as ba,cK as bb,Mre as bc,IW as bd,ln as be,xt as bf,im as bg,HK as bh,tQ as bi,ai as c,Mn as d,Sd as e,Rx as f,Cx as g,fM as h,Mx as i,w as j,Ox as k,kx as l,Ax as m,Nx as n,Bt as o,A0 as p,D0 as q,v as r,lc as s,n2 as t,mn as u,Am as v,Gre as w,il as x,Hee as y,yU as z};
488
+ //# sourceMappingURL=index-Ra6pj0rt.js.map