@txnlab/use-wallet-ui-react 0.4.1 → 0.4.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.
- package/dist/cjs/index.cjs +25 -15
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +4639 -4612
- package/dist/esm/index.js.map +1 -1
- package/dist/style.css +60 -92
- package/package.json +14 -14
- package/src/theme.css +20 -0
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var fs=e=>{throw TypeError(e)};var xo=(e,t,n)=>t.has(e)||fs("Cannot "+n);var P=(e,t,n)=>(xo(e,t,"read from private field"),n?n.call(e):t.get(e)),J=(e,t,n)=>t.has(e)?fs("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),q=(e,t,n,r)=>(xo(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),ie=(e,t,n)=>(xo(e,t,"access private method"),n);var Rr=(e,t,n,r)=>({set _(o){q(e,t,o,n)},get _(){return P(e,t,r)}});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("react/jsx-runtime"),O=require("react"),Bt=require("react-dom"),xt=require("@txnlab/use-wallet-react");var Eo=typeof document<"u"?document.currentScript:null;function Qa(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const I=Qa(O),Bn=Qa(Bt),mu=()=>{typeof window>"u"||typeof document>"u"||(typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(()=>{ds()}):setTimeout(ds,0))},ds=()=>{try{if(document.getElementById("wallet-ui-fonts"))return;const t=document.createElement("style");t.id="wallet-ui-fonts";let n="";try{n=new URL("data:font/woff2;base64,d09GMk9UVE8AABnsAAwAAAAAKwgAABmgAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAADag4GhAbnH4cCgZgAFoBNgIkA4IMBAYFihkHIBsuKiMRNnv1IpD99YFNZLqC1f8AB3etT0P+1qLM2Z0ME7eg/IHrzXFQl94QC4tIDIUan3x9cxlPjoNhIgy8yDxCklmIaO0/q2dm9/fOwptHeISoEDS7E/KMupCQcXERLjYsFFIT//09uve8yMsHykwEA5iJZiZYqJUqnTpWClKu6Rme3+Y/GNQl6k4Geo8XLtNdwmrEwsZrYxSijU4XmTgWkS5bly66L/vs70H/lutfWf36tpQJjnUnYMkOMq/DE0JabAh2WX0Crh4dj0/Pz9k/Kgk84Fbu0pmhs3lVUaAiRlqH3U1L3aGiCabBrCaa/eeyJzN/UbcBP8edE5fL/dJJyjrRdIIqXD/hE3kG9WrcuE+/zJxAnfBgTvlj6lRO7f+31putCnEn7GZyToVAOEDh43JiRHXV75m+81KZ9A/2f6eD3OFJJ9kNAAuzhD4ALBdYLhu3Z9UKZ7/bXeHYdJjO5xTvAUnWDZHnp2620fTfZ38HlZlnNONTmrGUGnO9mQihyFAFJ9B1uPmRjEvVB1mZQ55J/eeUP18cc+foBee9yvVZ5eZp4Ds38+Xeczcj97XIi+3PZnJXBz9URtyrsX3nVuyyfbAL7xWevoqL4BpmdNh3MU6CtPaEHv3G2PDfCKhqA0FZFyLEb8zKCycvtDelhXoop1r8f7lYiZ8R89JpXWsWp90gq3Rz14mlZ5feWzq99IMyokwbt+llDpeV7iPLZpd9ZfqT1pm2yZRl+mj+g77T/NKzFmOp510vH68Qr2yv93oV1gh9uu7UCR0PhXm/8BE+C3yO+zz19fQd4Pu3b4bva9GWaxU55VrxFpW7UX4Qf4nAXGFMheMVHlf4bRN1bdyFiNQ5mzqzSMN/u37rf+95UbHwdvenx32pB4+nr1SllZCyfb7XhuS4o6uXjIs78nAh6Pt8qfelwyP5dJdnl0JR3TFlcK2dYtI9r3wXMuAIv6QzC6pngXG0Ixv+PrBCtnjsQGuzbdDaZbv3H9lupJimhvVrrZCNsG4/dep8ZA5AUi/LMdVU2FBTkN+463iGPTYbSJO2WqN85PSBiPPn165qaxs10Gq1D1wHqjb1m0KXbM8QrYjIjSRikl1FT7kTR8MGGTzoskk3bXmXdNIt5pjs/bZfcs80SYZ2XLtEtyjtFb20fxo1yUeUkYbJKe7Mkprafv2rwf/yHAa4d5glQXGOz+u62yRPaFrIJc337jBJbw8N2vH2ILr0LqVx0g7u3XPwUOieNUDwH3dheDCpgZN1fer2EkNAUC8bmojllk1NRIhx3oCITDEuGBIR7/JO/8DlkZkmzmwGRBIMdLC6XcBpBxeMtlRdPWwx+ZPUr5wG7tr+Tu1+Q6oHn2emv5aCeVAPQ2suN6wWyy9Fzy4srGlMB2SjM/TSbpeu67/Mzsk3NyYA9iLJxNu6emnl8oIfYuFsJNWfG1RZx6G5ptDKdD/3E1JkYz+CNid3TMejBtQG9SNO5kZnZMV6eQhVk5oQCsXSiG+bIcgFCIpC4FxBG9DTQwtK+lCFWUoUamk4f0gY8HzDXTSkU5pSqt6nailtqpnE1M0kTCg8AoCLQuChsJIaCKwnhGKHJzsB3ARuG030DR9E7oRHOCgCvsOCQH4B4VwS5uUAXoBoH3y3VwORg6h7ERpyuSwAKFMV9QW/b9fjndGGXLk4rKzL0dvkEV4WZPIQ4p+l1R0ZOSmqMtlnfUSGbNJHMOfnjul01ABuUD3ihDY6Yyo2STICZG9RepFX4cHkXnqxrV+7zbT84zU2ay/4gBCubdoM07gJvttDz2ZruYbXSDj3fBAhK+z/32OTDx3QSiBtCAMbWGOvg9U4OjAliTvDi4OwL3ChXMciUowbs5qFHIhMM27VtYhrEFcTzYyaF1AjeoC1OfcIHxJJYPuueiEUeRgKYnqsbDCktQ0R3EFk/fNgKAaE8hOJtkMFuSOyyMTbM9yPD7vxDajuqcyEo21mhFco9B2nG4/mzXR6DgnowDexn6480IaSRr7Du+uNWDCDoqaydu/q1dYpOaUemWKd8hGSWuyvoWMMao6+odHIDOp1r0GR7/2O6oa7DGsk8JvJk1NSy81JgByaTED7AkTiAI+FiPl+Nef3rS1X/4kF9r/+2brVZiQUrL732L+abhE5G+l3rh5zZCFytXXN2pVd1W3AJo+4L9LmtfWZ6xvHtCCrVrifXzJ4JSHrTNEoU8SBEOtisHede/C8utFmWUu9RpxtPx6NEI5jqf9giDQirI53IlNvv/KHfM931Nak5bp+biVPSk0rr0qswwsPDeeCshV2kQYVUxkG/OEb5pS/DteDSEOFcCiL4fG6sQXoblFkf+NJxjcjFp6RZqecuXwzeTIxD4GPQfpKtZeMqBi4Z3PyJd9YA+tBA8wH8p4aIh1hshpCRh7qmWQRq8MHOXqAC7SDh+Oqx1He9oDnHiqA2+Mm7tkA51t9jxzgbAAPOTjlLFkjKgTZa6BSUiu58BZPdL19MF5/cheutQMXnkRSFX1ziTxgXA/JhrEDItLPqG8XKzovjgwyoRivIVvRD/0h+isHC7f/Zy7HkCU96A2sXAO3rYnQm9yIQjOh7lbSzlfvPD+ULcLrnqI0OeG8QP6vlhU5VfS9Jb3D3iKiulUzAR9NOEeycQh/SStvTUR3i6pdnrQvZzBY9f6ByK6GLZT+KmHD7rSDY0+w5YzIKGOEOhVAZ2SCiUObIc4E4uKUuhEc6qrjO03Ov9ZYx3EDceuW4HRY4zf3ySQCbN9UQBverfsu/BlyTACxiCo1udqxA8gHjplzxkBaAu/Yi8TkeUhfn1ALPC1mZ/SpHFmBfV4ZWKw0U3vcQCe1EaXWfTwKrjMz7Xk7LHJl8bTVM29WtwGZPEJimfecVl4WJwtqWb0j0XGyAPyibWsD/YhBjr7QSTlUl/vwKS/1HkVWcwPAbKFJDvo/AS/JfQdvuk+wH5tzqwJY6yKDCNvnG5Fmzl8/l6n19OZAJjYfm6WziMk2pe5xDljA/hf84L3sAXhfGfS10aG1jXmyrqVdC1+lFt3KiZxjWgjgY+D2W9ynd8WwPaozSKFraiGsEbVY54AxE1QAUDpVZC7whNmmDYkyeu1dg0EKW9cHZHK6PclhyNWLEt3BGxBCTR4ir33hnQK6Fr5urA9q3iIwS2eI+bbfJH/pV5fwZ/jIB7z8gNMv+MFr0ePvhw0CC1xX3Z4jkz8Sb9x/c4qxSzHTtsNbjhzyh+qV6p+preQHBu1encEK2oAR25DPHS/anRJdJLucODPDBgRnfR3sAECjwS5eAg1bFPAXbgCaATCQJN+Zzh08cNbyFmzRrbqpQG1MCzULmrd8I93ZD+15q/AcMGYDhICUn1RszvLkWYVb44a2c00GKGi5143bGWcTrTYdSW9faonuZ9lwZC1CuRF692saFBWKpi+HqJGP1GTxk/xI71bunQLOzX/ZWB/UslUgoTOENXyQwxcGKX2qEyitoAHv81LvVtZS3QgwU+iQAGVpep2YefuaIyjMwnWg7EqIP6iItJrrpn9dR7+HoG4MwqVBXmryB8nejSXf9nBfdshzh+Qm3C4qBcpv+qC6iXVRIfg4GDu0+QeTfPs1vei9oU4JbbenKauG1SMBNDEy3FeHuWWfbXBWAorAHjxDL1kiwoyFXCKT8sggY5laovIVmoSbvisLai8DLLBzGFdwkQuMbjkmt/sllM4SdV7qHQc35dWBOZcuPZExTT+tvKW5miEf1tex1eSRB52pRecb6NiWHsYnF3VPmxxOiDimsKqFt+QFq7CYUT7AR/E6BFmvLZPr61hi8u6bhMw71+3jglO9NbnEAwvo6kKD4t6YjyLgxAt+CN/ygwwicFeXM9w77lqNgR/TFjnhDegjHUq6F7xKK7r/yDkouEWAMdoQTH6ILNhLtzXR5evz7NStsLHiOe6tuRXJG5aDsswm2Y/Nv14BWfuTDG4i64Xu88sJXrXMHUfFJ3NQizAWkQ6zCoPs2l+ULmd70uzCzfEyIq/XqvrCLq/n8cVrQvr5BIeFy0GTfFhSLl6S74m2fb9adS98JQdLY4ajvh7k6IX4wqsl8Dp3ePspzWWtYO3dSHHbAcoce3gx94klF2IT7Sf+IO+v9YiCDBNIOIVYp8s7X1KgqICsvPKTZOy3nqyPjK4LKmbv9rdHHc85E7vYPBuBzFwTDiwiUlHyerM+Sv+qHxaC/YTlWUhk2CTpjLohhMGy+cB6i+C0g/Rg1PwZ+3hdZ8CnGnSgs0zT1yzeYWAgLCCxwIQKO5rQPLNYYCOZh/nqFTuBUgdaJitPbN5gsikpyXrgDYLlQrUrMW311f/e/P1snN0il9sz3SHIHUJN9N5MYuLty6o4Te0tF5IZPSQYMuOc5/I1uZPcliZ+pkWqTKDmNVIlFWp5RLudXtJVtkF0JW7vcWExL8SpGjFGAlveXo3/VfkvhaKlWxPOfxj/Hr6viZ7hvrpHmNofwipBZWASAksh8f/KuSwmlTnzv9tTpd4N6sgQQ5rmRNF/vPwIPDapAwFFL8NrG9xnrhk9rk7WkRBe9vh0wostBobkJyRLDOOZguwS48nauYpGj1AVwaGAY6rRpuOxvqMCSKsSbByPn93JSUTZwM31cItIYOwFC5F47mwAkogYdECIaKgvmlEjCA/pFCNIHqqpVdI9MJWXxrRsNeQeyjrCDOz/Ry9eFnQgVgtO/jrYkQ+EpC9EGJhQ0FKTHxA54Pvkkf2qkeqETH4lmXZo/5Zt+wx3EdiASPKtV0TgFE62sJviGJS0/8kO4ZVUBxydNQQgjq9v5V76JcXj8DcMV/C+NSmpraTyQ/P9lJRrF5NnGHJqqoxFCJerXxTLbKQ7OdBvsJIzce86AH0koU8Zr8IyxeWDG0ezjr6Qgn7QLQZKs1szerxiAWpXtqYlXJcVps3LybNYdMYgJ32cSd58Ej8zL8NUmxY7fO/9qQYVRnxTGBFEbHwMpxbF/zT+rV+MiLDwYBKHTSeK16xC/CHR8sFB4I4PwkHBV4G9vyNeCcbzbUKUb/GBPc5OVSVhtZEsZkNbT3KKbHgxDGXA49zmA8uGNNWD3dBEPILTVprVrY0Aln8qe3Fs5Tupo+PCh1YZ9RVHL0xo1e9R8TvfMYRWUMKejRAUB34h2ggb3JmFGxwY3e3wlCdRjAErXZ83wmcduV39tYL/pvcoQA/4TPQMY1NRE9hg27ghbL3nETPgf2+/Kk6am2tHIDeIH8Pu0aNiotwEa9T+J9rEDwF4g9i7lpoSEfmlR9DR27ed6beAdF3/fUwcEB1XBjtuwy32KFvYo247SJrOtbcj/A3d+Yf7MrctiVDbT7IW5mXWlYNJ2wbhT/ARjJJWMInpU2qaPBKiDNnFRRe1C0fzTj31B+WABwxU4AGdSDkif2zxIxZpD+k+LDXf15/s1e0QT/zqWWDXH30131NzzjiMyMsapYz1a4kzCvIra1NSK3eePJEYdRXIKyHu2SNdx+zv6s5Ivns7Y7wxy1ShH2U3Z8DHlRm4dzcBYyxRc/2v10XufcEPxg2khBHr2ubdXNhcCei2U1OZ/rvXIZBiZRPIR+eeTnUYhyLKbvlns229P4XX6bX9K7ecGh0HfLnwZx/igFVSzeAHfGb5sVs3U9NvXU8LiNMXFSUCwX8TiSpioQuxD+DAHfVHDkdHpjmnby8prqsvRu5qL6dy0l34FxAtLQ0agR5gqaswbW7fuXDvth17jS0bNts2+M9obk6fhnSjg/b6nXNw2+XupOwLLYIpDIZexOG7a5Yy2EHXdyc9CdtORXkH7D0Y3qHR/A7dsrL1/6u92ccb0FbAO4De9fEB9o6Pr3KI82/4b6lV8PDw/FPbtk9WWWPr8MlzD520x2atjPefl+qtLntKlCM5Zca2srK6hrLyHQ0HgTcqhaKW2UO0LFVlpwrr2nvYebIKORoBTTcgzO+AzhHu2ol476sv9IZk6hewYE6tR0knWHX0ey8iyuWIiovQdDqVdC98lVZ490H6YGjt5UjeLCzdOTtFZ2HnaG5Qud5GoMKblaBSY+44Y9Vp3hFCKyBwcWah6GgvioAKqvDWgU9gYSu5P/Z3SQXA/QprfX4EjqSZrl6uk1XexOE5t3PxML/dTBPPR8iBmHbrJQOzGY42hXeg3pT9zYo4rh9Qvh0DFPowheFSG01FEtc1OmzIwRqGET17hfRiEaRuNuK3Hu/Jq4ZfqFSVicA8xOwY8k2NahSgxSmLpBEH7Wwxml2dk/YUQ7OIBuiS17RYvKNT3EErqK8bGAXwkYxAOGVg2mbz/p7StJUVPl22lwhkz2S/hdszBMTv8whOCaq2U1oBfB7jOb4xckvOgrRmJrvYLIXTWJ6ly4/rdBwnkBN76Pgdjf4it9isZx2IpQnWde16sFLOZQRfMC6JAKqLzygxxMs3RkCxGKQGD5JIp1uTQuPNLOKgv4SiR6HHrpT1OGPQGo/VPCBtp9hEWA2QWjBHZjraEwQXG4f5Ql28BOO0kUg2CUogg7ura7RnjuS7YXd4xlEV9is1ZJAKLM2PSUKPogolkBttNmejpeTwzvfV0ZdLGU5trXXbc5Nt69FDqg6e5VjAf9piEvxtQRK048pqveIQCOEtrUldJNOyw1SogFIe1JGVml1wbl5oLGCAB+eK9cVopoJHYZROOB0G+7vFac9MMIC/GsGncf3KDuxnGmBdbmGBHzryT2qSXaXWuXUpY3SpkvmkXc5lqikUTQFXl6VWtVO76vQJYcoxYnrkX2E9yEt4klNgW1ZHN1sWUiAiUXA+7YtsyzAXgI3UGjN29cJgcPj+1wGoCLRpoZFrjn2X1GnRZr16U2AtiBuPQ8IetOJw1DJk82PsJqcG/chiL7H94oGjwsDJLjRdCGReYUVEwzfDnK1Upx6FFobifu3rQ+6ZEkUMcvKFDwQiN8agKsD05AOQomaQzHTDd7AaEE0ZkUMnwQXYLj4y+YFtEe2JWEIW+U0OGBs8tjECY1TVOT9gc8m+dNmnTgEWcfaQdz136VR2cVfb0QBVnE0bgENsyz2GQYNk6b0i75iwNiMsArRYpVKsmivZhrxHYcbn1qWjpnMhb+Fkwl/mRmkMrLBI6x5Pmpplr0yrleWwf3K63SYD7il0LlUr+SJzsdNIP8QptZNyobvZ9IZdmk7ahnItzJnAJadzA/I3FlzDVOJ4EWhWWpahUppNJDb1QXwolfU4Kd2Q2S8Nt68YNIxpzCwr0TW9ckc4MMcya56ZHcm8yilSqzRS2qQqexU9QMrB5mgU6jItWVS4Ol1VtZqqsA+3Cay+KsGgxbqQFM1DfGpDMGt6WqmCMtO9ze1zh7qjw1KdGcEW4yO752bvBMjXEuOMEGALOrSXCZDZZ7hI61jGr6zOCkVR1SQante1L6eW63OxMtbiClDx3vt4h6B+o5oJb78DjnKcvfaC/Y4RjjjuJHbijpmw5+h+naXakmQqcoKZBVhuFW+NtZast0dB7BV5oJYIyKGU4WVOKEFNBRvTKuwtHCQxpcb2Ce9RcUsuj9NVgI5M0hYE0cFpJwjNfCYXPVV4SwJ7Y8tcEOIMoJFmcSEyW6rUGi3kpKPrnpS6rrBRnqfOdckjGjRe0IrXarTJ9RKvRtUql7umpoT/vD19A0MjY1OrLDOzwkpta0y0sHJNzI35ZshccNhj4KDIrGVb2TyJaurH3adYYJqHDAy55lqTNuy4vLuoq6VHpP9SkEB7C7mMVFDAbjhIFzbKLnO+axjcte8EQcPofFeJ8iBzVfeVtZ6hzyYJlQ6JcUdkrddpMYFL55R3NwYFdzBcpR5lRHHNU8/7UnpvubdrdacgT/LFyaHDK4+A5X6PoackNQdnKZGGyMWW2+qAO94W/JfZbLsTHpd9H+Qte0liQb+TnHRcbk/Gvzf472Er+jf1rm8Bvvyt/7eRMWDOX3d3he0cfQdV/HdEaJvNh+o+0+ywP8P9CBnpcI5YnrMNUZTe+LQVB6PhyIKZBtmii/5yeI2AaeBXDy3A3yZHybb1c/Wyzb7MsnoeQhaJseP6YuMEMI/FjkRkmiJp1tSTnYsb7fCDtX4Fpk7iHWtUDEY4k4mwRDOkLRAynmb5Mg3WB7HMHwHuaslWWiYwyCSrppUmkG4ypFRoYrQiFqsipojJbLm/hT9b588ms916XMcpWFnHktgXZEpU9iknOKW8qXMqaHuiMju9UbnkE6Uan6rC3Oeq1PfdgJWqHfTb7RuT8cOTE5MCzyc1UWI0+5Wj06O8vXNHBSvDUZln8VO55Zmv1CydqnAwPaq0cTEHrFRtHa32K/I66+wDu/SwMwpT2AeJlcbj3B7HDzzb8iPAgofLV8FP1136XJzjoLlZWGs2huMHwen9DIYJ3r7Xbq3X7Q57g9sCuZqti5/6z/w846F8NO+YsXBqua79CMRYdendMazwN2SjBH+TZfCYvBpFpF8shoGzh40Gzz2A6AVf7nLrg3reOgpLlmZcnlSA+9MRUKAqNm5pdAkA8q5DwI1cpgWHJjiihnjC8mngikDhHmADBhBlaCFMNHY5CrOHu2FzjPemBgtoGTX0grGZE7CcNjMoVpNU021DLENNTwIc4pDdwQb0IxP1SERWt6mJpmHYW9kmMyEArCUJNEYX6FWtYrhdBLedP2yLOQJ7gZxJ2SAiDCgGooEDOGC6BAva2BZrqlF3hLwbq4Kjd7c50QS/YOT4xnhPnI09uzcNFEIKJnpq0MiRBfiiVaYQKYnJR3nEdcIUXEVtRxFD/fJXJFhkOVIV1ZMC",typeof document>"u"?require("url").pathToFileURL(__filename).href:Eo&&Eo.tagName.toUpperCase()==="SCRIPT"&&Eo.src||new URL("index.cjs",document.baseURI).href).toString()}catch(r){console.warn("Could not resolve font URL. Using fallback styling.",r)}t.textContent=`
|
|
1
|
+
"use strict";var Js=e=>{throw TypeError(e)};var po=(e,t,n)=>t.has(e)||Js("Cannot "+n);var P=(e,t,n)=>(po(e,t,"read from private field"),n?n.call(e):t.get(e)),Y=(e,t,n)=>t.has(e)?Js("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),z=(e,t,n,r)=>(po(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),se=(e,t,n)=>(po(e,t,"access private method"),n);var Sr=(e,t,n,r)=>({set _(o){z(e,t,o,n)},get _(){return P(e,t,r)}});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("react/jsx-runtime"),A=require("react"),mn=require("react-dom"),St=require("@txnlab/use-wallet-react");var mo=typeof document<"u"?document.currentScript:null;function Ha(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const N=Ha(A),Vn=Ha(mn),du=()=>{typeof window>"u"||typeof document>"u"||(typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(()=>{Zs()}):setTimeout(Zs,0))},Zs=()=>{try{if(document.getElementById("wallet-ui-fonts"))return;const t=document.createElement("style");t.id="wallet-ui-fonts";let n="";try{n=new URL("data:font/woff2;base64,d09GMk9UVE8AABnsAAwAAAAAKwgAABmgAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAADag4GhAbnH4cCgZgAFoBNgIkA4IMBAYFihkHIBsuKiMRNnv1IpD99YFNZLqC1f8AB3etT0P+1qLM2Z0ME7eg/IHrzXFQl94QC4tIDIUan3x9cxlPjoNhIgy8yDxCklmIaO0/q2dm9/fOwptHeISoEDS7E/KMupCQcXERLjYsFFIT//09uve8yMsHykwEA5iJZiZYqJUqnTpWClKu6Rme3+Y/GNQl6k4Geo8XLtNdwmrEwsZrYxSijU4XmTgWkS5bly66L/vs70H/lutfWf36tpQJjnUnYMkOMq/DE0JabAh2WX0Crh4dj0/Pz9k/Kgk84Fbu0pmhs3lVUaAiRlqH3U1L3aGiCabBrCaa/eeyJzN/UbcBP8edE5fL/dJJyjrRdIIqXD/hE3kG9WrcuE+/zJxAnfBgTvlj6lRO7f+31putCnEn7GZyToVAOEDh43JiRHXV75m+81KZ9A/2f6eD3OFJJ9kNAAuzhD4ALBdYLhu3Z9UKZ7/bXeHYdJjO5xTvAUnWDZHnp2620fTfZ38HlZlnNONTmrGUGnO9mQihyFAFJ9B1uPmRjEvVB1mZQ55J/eeUP18cc+foBee9yvVZ5eZp4Ds38+Xeczcj97XIi+3PZnJXBz9URtyrsX3nVuyyfbAL7xWevoqL4BpmdNh3MU6CtPaEHv3G2PDfCKhqA0FZFyLEb8zKCycvtDelhXoop1r8f7lYiZ8R89JpXWsWp90gq3Rz14mlZ5feWzq99IMyokwbt+llDpeV7iPLZpd9ZfqT1pm2yZRl+mj+g77T/NKzFmOp510vH68Qr2yv93oV1gh9uu7UCR0PhXm/8BE+C3yO+zz19fQd4Pu3b4bva9GWaxU55VrxFpW7UX4Qf4nAXGFMheMVHlf4bRN1bdyFiNQ5mzqzSMN/u37rf+95UbHwdvenx32pB4+nr1SllZCyfb7XhuS4o6uXjIs78nAh6Pt8qfelwyP5dJdnl0JR3TFlcK2dYtI9r3wXMuAIv6QzC6pngXG0Ixv+PrBCtnjsQGuzbdDaZbv3H9lupJimhvVrrZCNsG4/dep8ZA5AUi/LMdVU2FBTkN+463iGPTYbSJO2WqN85PSBiPPn165qaxs10Gq1D1wHqjb1m0KXbM8QrYjIjSRikl1FT7kTR8MGGTzoskk3bXmXdNIt5pjs/bZfcs80SYZ2XLtEtyjtFb20fxo1yUeUkYbJKe7Mkprafv2rwf/yHAa4d5glQXGOz+u62yRPaFrIJc337jBJbw8N2vH2ILr0LqVx0g7u3XPwUOieNUDwH3dheDCpgZN1fer2EkNAUC8bmojllk1NRIhx3oCITDEuGBIR7/JO/8DlkZkmzmwGRBIMdLC6XcBpBxeMtlRdPWwx+ZPUr5wG7tr+Tu1+Q6oHn2emv5aCeVAPQ2suN6wWyy9Fzy4srGlMB2SjM/TSbpeu67/Mzsk3NyYA9iLJxNu6emnl8oIfYuFsJNWfG1RZx6G5ptDKdD/3E1JkYz+CNid3TMejBtQG9SNO5kZnZMV6eQhVk5oQCsXSiG+bIcgFCIpC4FxBG9DTQwtK+lCFWUoUamk4f0gY8HzDXTSkU5pSqt6nailtqpnE1M0kTCg8AoCLQuChsJIaCKwnhGKHJzsB3ARuG030DR9E7oRHOCgCvsOCQH4B4VwS5uUAXoBoH3y3VwORg6h7ERpyuSwAKFMV9QW/b9fjndGGXLk4rKzL0dvkEV4WZPIQ4p+l1R0ZOSmqMtlnfUSGbNJHMOfnjul01ABuUD3ihDY6Yyo2STICZG9RepFX4cHkXnqxrV+7zbT84zU2ay/4gBCubdoM07gJvttDz2ZruYbXSDj3fBAhK+z/32OTDx3QSiBtCAMbWGOvg9U4OjAliTvDi4OwL3ChXMciUowbs5qFHIhMM27VtYhrEFcTzYyaF1AjeoC1OfcIHxJJYPuueiEUeRgKYnqsbDCktQ0R3EFk/fNgKAaE8hOJtkMFuSOyyMTbM9yPD7vxDajuqcyEo21mhFco9B2nG4/mzXR6DgnowDexn6480IaSRr7Du+uNWDCDoqaydu/q1dYpOaUemWKd8hGSWuyvoWMMao6+odHIDOp1r0GR7/2O6oa7DGsk8JvJk1NSy81JgByaTED7AkTiAI+FiPl+Nef3rS1X/4kF9r/+2brVZiQUrL732L+abhE5G+l3rh5zZCFytXXN2pVd1W3AJo+4L9LmtfWZ6xvHtCCrVrifXzJ4JSHrTNEoU8SBEOtisHede/C8utFmWUu9RpxtPx6NEI5jqf9giDQirI53IlNvv/KHfM931Nak5bp+biVPSk0rr0qswwsPDeeCshV2kQYVUxkG/OEb5pS/DteDSEOFcCiL4fG6sQXoblFkf+NJxjcjFp6RZqecuXwzeTIxD4GPQfpKtZeMqBi4Z3PyJd9YA+tBA8wH8p4aIh1hshpCRh7qmWQRq8MHOXqAC7SDh+Oqx1He9oDnHiqA2+Mm7tkA51t9jxzgbAAPOTjlLFkjKgTZa6BSUiu58BZPdL19MF5/cheutQMXnkRSFX1ziTxgXA/JhrEDItLPqG8XKzovjgwyoRivIVvRD/0h+isHC7f/Zy7HkCU96A2sXAO3rYnQm9yIQjOh7lbSzlfvPD+ULcLrnqI0OeG8QP6vlhU5VfS9Jb3D3iKiulUzAR9NOEeycQh/SStvTUR3i6pdnrQvZzBY9f6ByK6GLZT+KmHD7rSDY0+w5YzIKGOEOhVAZ2SCiUObIc4E4uKUuhEc6qrjO03Ov9ZYx3EDceuW4HRY4zf3ySQCbN9UQBverfsu/BlyTACxiCo1udqxA8gHjplzxkBaAu/Yi8TkeUhfn1ALPC1mZ/SpHFmBfV4ZWKw0U3vcQCe1EaXWfTwKrjMz7Xk7LHJl8bTVM29WtwGZPEJimfecVl4WJwtqWb0j0XGyAPyibWsD/YhBjr7QSTlUl/vwKS/1HkVWcwPAbKFJDvo/AS/JfQdvuk+wH5tzqwJY6yKDCNvnG5Fmzl8/l6n19OZAJjYfm6WziMk2pe5xDljA/hf84L3sAXhfGfS10aG1jXmyrqVdC1+lFt3KiZxjWgjgY+D2W9ynd8WwPaozSKFraiGsEbVY54AxE1QAUDpVZC7whNmmDYkyeu1dg0EKW9cHZHK6PclhyNWLEt3BGxBCTR4ir33hnQK6Fr5urA9q3iIwS2eI+bbfJH/pV5fwZ/jIB7z8gNMv+MFr0ePvhw0CC1xX3Z4jkz8Sb9x/c4qxSzHTtsNbjhzyh+qV6p+preQHBu1encEK2oAR25DPHS/anRJdJLucODPDBgRnfR3sAECjwS5eAg1bFPAXbgCaATCQJN+Zzh08cNbyFmzRrbqpQG1MCzULmrd8I93ZD+15q/AcMGYDhICUn1RszvLkWYVb44a2c00GKGi5143bGWcTrTYdSW9faonuZ9lwZC1CuRF692saFBWKpi+HqJGP1GTxk/xI71bunQLOzX/ZWB/UslUgoTOENXyQwxcGKX2qEyitoAHv81LvVtZS3QgwU+iQAGVpep2YefuaIyjMwnWg7EqIP6iItJrrpn9dR7+HoG4MwqVBXmryB8nejSXf9nBfdshzh+Qm3C4qBcpv+qC6iXVRIfg4GDu0+QeTfPs1vei9oU4JbbenKauG1SMBNDEy3FeHuWWfbXBWAorAHjxDL1kiwoyFXCKT8sggY5laovIVmoSbvisLai8DLLBzGFdwkQuMbjkmt/sllM4SdV7qHQc35dWBOZcuPZExTT+tvKW5miEf1tex1eSRB52pRecb6NiWHsYnF3VPmxxOiDimsKqFt+QFq7CYUT7AR/E6BFmvLZPr61hi8u6bhMw71+3jglO9NbnEAwvo6kKD4t6YjyLgxAt+CN/ygwwicFeXM9w77lqNgR/TFjnhDegjHUq6F7xKK7r/yDkouEWAMdoQTH6ILNhLtzXR5evz7NStsLHiOe6tuRXJG5aDsswm2Y/Nv14BWfuTDG4i64Xu88sJXrXMHUfFJ3NQizAWkQ6zCoPs2l+ULmd70uzCzfEyIq/XqvrCLq/n8cVrQvr5BIeFy0GTfFhSLl6S74m2fb9adS98JQdLY4ajvh7k6IX4wqsl8Dp3ePspzWWtYO3dSHHbAcoce3gx94klF2IT7Sf+IO+v9YiCDBNIOIVYp8s7X1KgqICsvPKTZOy3nqyPjK4LKmbv9rdHHc85E7vYPBuBzFwTDiwiUlHyerM+Sv+qHxaC/YTlWUhk2CTpjLohhMGy+cB6i+C0g/Rg1PwZ+3hdZ8CnGnSgs0zT1yzeYWAgLCCxwIQKO5rQPLNYYCOZh/nqFTuBUgdaJitPbN5gsikpyXrgDYLlQrUrMW311f/e/P1snN0il9sz3SHIHUJN9N5MYuLty6o4Te0tF5IZPSQYMuOc5/I1uZPcliZ+pkWqTKDmNVIlFWp5RLudXtJVtkF0JW7vcWExL8SpGjFGAlveXo3/VfkvhaKlWxPOfxj/Hr6viZ7hvrpHmNofwipBZWASAksh8f/KuSwmlTnzv9tTpd4N6sgQQ5rmRNF/vPwIPDapAwFFL8NrG9xnrhk9rk7WkRBe9vh0wostBobkJyRLDOOZguwS48nauYpGj1AVwaGAY6rRpuOxvqMCSKsSbByPn93JSUTZwM31cItIYOwFC5F47mwAkogYdECIaKgvmlEjCA/pFCNIHqqpVdI9MJWXxrRsNeQeyjrCDOz/Ry9eFnQgVgtO/jrYkQ+EpC9EGJhQ0FKTHxA54Pvkkf2qkeqETH4lmXZo/5Zt+wx3EdiASPKtV0TgFE62sJviGJS0/8kO4ZVUBxydNQQgjq9v5V76JcXj8DcMV/C+NSmpraTyQ/P9lJRrF5NnGHJqqoxFCJerXxTLbKQ7OdBvsJIzce86AH0koU8Zr8IyxeWDG0ezjr6Qgn7QLQZKs1szerxiAWpXtqYlXJcVps3LybNYdMYgJ32cSd58Ej8zL8NUmxY7fO/9qQYVRnxTGBFEbHwMpxbF/zT+rV+MiLDwYBKHTSeK16xC/CHR8sFB4I4PwkHBV4G9vyNeCcbzbUKUb/GBPc5OVSVhtZEsZkNbT3KKbHgxDGXA49zmA8uGNNWD3dBEPILTVprVrY0Aln8qe3Fs5Tupo+PCh1YZ9RVHL0xo1e9R8TvfMYRWUMKejRAUB34h2ggb3JmFGxwY3e3wlCdRjAErXZ83wmcduV39tYL/pvcoQA/4TPQMY1NRE9hg27ghbL3nETPgf2+/Kk6am2tHIDeIH8Pu0aNiotwEa9T+J9rEDwF4g9i7lpoSEfmlR9DR27ed6beAdF3/fUwcEB1XBjtuwy32KFvYo247SJrOtbcj/A3d+Yf7MrctiVDbT7IW5mXWlYNJ2wbhT/ARjJJWMInpU2qaPBKiDNnFRRe1C0fzTj31B+WABwxU4AGdSDkif2zxIxZpD+k+LDXf15/s1e0QT/zqWWDXH30131NzzjiMyMsapYz1a4kzCvIra1NSK3eePJEYdRXIKyHu2SNdx+zv6s5Ivns7Y7wxy1ShH2U3Z8DHlRm4dzcBYyxRc/2v10XufcEPxg2khBHr2ubdXNhcCei2U1OZ/rvXIZBiZRPIR+eeTnUYhyLKbvlns229P4XX6bX9K7ecGh0HfLnwZx/igFVSzeAHfGb5sVs3U9NvXU8LiNMXFSUCwX8TiSpioQuxD+DAHfVHDkdHpjmnby8prqsvRu5qL6dy0l34FxAtLQ0agR5gqaswbW7fuXDvth17jS0bNts2+M9obk6fhnSjg/b6nXNw2+XupOwLLYIpDIZexOG7a5Yy2EHXdyc9CdtORXkH7D0Y3qHR/A7dsrL1/6u92ccb0FbAO4De9fEB9o6Pr3KI82/4b6lV8PDw/FPbtk9WWWPr8MlzD520x2atjPefl+qtLntKlCM5Zca2srK6hrLyHQ0HgTcqhaKW2UO0LFVlpwrr2nvYebIKORoBTTcgzO+AzhHu2ol476sv9IZk6hewYE6tR0knWHX0ey8iyuWIiovQdDqVdC98lVZ490H6YGjt5UjeLCzdOTtFZ2HnaG5Qud5GoMKblaBSY+44Y9Vp3hFCKyBwcWah6GgvioAKqvDWgU9gYSu5P/Z3SQXA/QprfX4EjqSZrl6uk1XexOE5t3PxML/dTBPPR8iBmHbrJQOzGY42hXeg3pT9zYo4rh9Qvh0DFPowheFSG01FEtc1OmzIwRqGET17hfRiEaRuNuK3Hu/Jq4ZfqFSVicA8xOwY8k2NahSgxSmLpBEH7Wwxml2dk/YUQ7OIBuiS17RYvKNT3EErqK8bGAXwkYxAOGVg2mbz/p7StJUVPl22lwhkz2S/hdszBMTv8whOCaq2U1oBfB7jOb4xckvOgrRmJrvYLIXTWJ6ly4/rdBwnkBN76Pgdjf4it9isZx2IpQnWde16sFLOZQRfMC6JAKqLzygxxMs3RkCxGKQGD5JIp1uTQuPNLOKgv4SiR6HHrpT1OGPQGo/VPCBtp9hEWA2QWjBHZjraEwQXG4f5Ql28BOO0kUg2CUogg7ura7RnjuS7YXd4xlEV9is1ZJAKLM2PSUKPogolkBttNmejpeTwzvfV0ZdLGU5trXXbc5Nt69FDqg6e5VjAf9piEvxtQRK048pqveIQCOEtrUldJNOyw1SogFIe1JGVml1wbl5oLGCAB+eK9cVopoJHYZROOB0G+7vFac9MMIC/GsGncf3KDuxnGmBdbmGBHzryT2qSXaXWuXUpY3SpkvmkXc5lqikUTQFXl6VWtVO76vQJYcoxYnrkX2E9yEt4klNgW1ZHN1sWUiAiUXA+7YtsyzAXgI3UGjN29cJgcPj+1wGoCLRpoZFrjn2X1GnRZr16U2AtiBuPQ8IetOJw1DJk82PsJqcG/chiL7H94oGjwsDJLjRdCGReYUVEwzfDnK1Upx6FFobifu3rQ+6ZEkUMcvKFDwQiN8agKsD05AOQomaQzHTDd7AaEE0ZkUMnwQXYLj4y+YFtEe2JWEIW+U0OGBs8tjECY1TVOT9gc8m+dNmnTgEWcfaQdz136VR2cVfb0QBVnE0bgENsyz2GQYNk6b0i75iwNiMsArRYpVKsmivZhrxHYcbn1qWjpnMhb+Fkwl/mRmkMrLBI6x5Pmpplr0yrleWwf3K63SYD7il0LlUr+SJzsdNIP8QptZNyobvZ9IZdmk7ahnItzJnAJadzA/I3FlzDVOJ4EWhWWpahUppNJDb1QXwolfU4Kd2Q2S8Nt68YNIxpzCwr0TW9ckc4MMcya56ZHcm8yilSqzRS2qQqexU9QMrB5mgU6jItWVS4Ol1VtZqqsA+3Cay+KsGgxbqQFM1DfGpDMGt6WqmCMtO9ze1zh7qjw1KdGcEW4yO752bvBMjXEuOMEGALOrSXCZDZZ7hI61jGr6zOCkVR1SQante1L6eW63OxMtbiClDx3vt4h6B+o5oJb78DjnKcvfaC/Y4RjjjuJHbijpmw5+h+naXakmQqcoKZBVhuFW+NtZast0dB7BV5oJYIyKGU4WVOKEFNBRvTKuwtHCQxpcb2Ce9RcUsuj9NVgI5M0hYE0cFpJwjNfCYXPVV4SwJ7Y8tcEOIMoJFmcSEyW6rUGi3kpKPrnpS6rrBRnqfOdckjGjRe0IrXarTJ9RKvRtUql7umpoT/vD19A0MjY1OrLDOzwkpta0y0sHJNzI35ZshccNhj4KDIrGVb2TyJaurH3adYYJqHDAy55lqTNuy4vLuoq6VHpP9SkEB7C7mMVFDAbjhIFzbKLnO+axjcte8EQcPofFeJ8iBzVfeVtZ6hzyYJlQ6JcUdkrddpMYFL55R3NwYFdzBcpR5lRHHNU8/7UnpvubdrdacgT/LFyaHDK4+A5X6PoackNQdnKZGGyMWW2+qAO94W/JfZbLsTHpd9H+Qte0liQb+TnHRcbk/Gvzf472Er+jf1rm8Bvvyt/7eRMWDOX3d3he0cfQdV/HdEaJvNh+o+0+ywP8P9CBnpcI5YnrMNUZTe+LQVB6PhyIKZBtmii/5yeI2AaeBXDy3A3yZHybb1c/Wyzb7MsnoeQhaJseP6YuMEMI/FjkRkmiJp1tSTnYsb7fCDtX4Fpk7iHWtUDEY4k4mwRDOkLRAynmb5Mg3WB7HMHwHuaslWWiYwyCSrppUmkG4ypFRoYrQiFqsipojJbLm/hT9b588ms916XMcpWFnHktgXZEpU9iknOKW8qXMqaHuiMju9UbnkE6Uan6rC3Oeq1PfdgJWqHfTb7RuT8cOTE5MCzyc1UWI0+5Wj06O8vXNHBSvDUZln8VO55Zmv1CydqnAwPaq0cTEHrFRtHa32K/I66+wDu/SwMwpT2AeJlcbj3B7HDzzb8iPAgofLV8FP1136XJzjoLlZWGs2huMHwen9DIYJ3r7Xbq3X7Q57g9sCuZqti5/6z/w846F8NO+YsXBqua79CMRYdendMazwN2SjBH+TZfCYvBpFpF8shoGzh40Gzz2A6AVf7nLrg3reOgpLlmZcnlSA+9MRUKAqNm5pdAkA8q5DwI1cpgWHJjiihnjC8mngikDhHmADBhBlaCFMNHY5CrOHu2FzjPemBgtoGTX0grGZE7CcNjMoVpNU021DLENNTwIc4pDdwQb0IxP1SERWt6mJpmHYW9kmMyEArCUJNEYX6FWtYrhdBLedP2yLOQJ7gZxJ2SAiDCgGooEDOGC6BAva2BZrqlF3hLwbq4Kjd7c50QS/YOT4xnhPnI09uzcNFEIKJnpq0MiRBfiiVaYQKYnJR3nEdcIUXEVtRxFD/fJXJFhkOVIV1ZMC",typeof document>"u"?require("url").pathToFileURL(__filename).href:mo&&mo.tagName.toUpperCase()==="SCRIPT"&&mo.src||new URL("index.cjs",document.baseURI).href).toString()}catch(r){console.warn("Could not resolve font URL. Using fallback styling.",r)}t.textContent=`
|
|
2
2
|
@font-face {
|
|
3
3
|
font-family: 'Aeonik';
|
|
4
4
|
src: url('${n}') format('woff2');
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
.wallet-custom-font {
|
|
11
11
|
font-family: 'Aeonik', system-ui, sans-serif !important;
|
|
12
12
|
}
|
|
13
|
-
`,document.head.appendChild(t),console.log("Wallet UI fonts loaded")}catch(e){console.warn("Failed to load custom fonts, using system fonts instead",e)}},gu=()=>{typeof window<"u"&&mu()};function Ka(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=Ka(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function vu(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Ka(e))&&(r&&(r+=" "),r+=t);return r}const Ii="-",bu=e=>{const t=wu(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(Ii);return a[0]===""&&a.length!==1&&a.shift(),Ya(a,t)||yu(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},Ya=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Ya(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(Ii);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId},hs=/^\[(.+)\]$/,yu=e=>{if(hs.test(e)){const t=hs.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},wu=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const o in n)Ko(n[o],r,o,t);return r},Ko=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:ps(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(xu(o)){Ko(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{Ko(s,ps(t,i),n,r)})})},ps=(e,t)=>{let n=e;return t.split(Ii).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},xu=e=>e.isThemeGetter,Eu=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}},Yo="!",Xo=":",Ru=Xo.length,Su=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const i=[];let s=0,a=0,l=0,c;for(let x=0;x<o.length;x++){let b=o[x];if(s===0&&a===0){if(b===Xo){i.push(o.slice(l,x)),l=x+Ru;continue}if(b==="/"){c=x;continue}}b==="["?s++:b==="]"?s--:b==="("?a++:b===")"&&a--}const d=i.length===0?o:o.substring(l),h=Cu(d),m=h!==d,f=c&&c>l?c-l:void 0;return{modifiers:i,hasImportantModifier:m,baseClassName:h,maybePostfixModifierPosition:f}};if(t){const o=t+Xo,i=r;r=s=>s.startsWith(o)?i(s.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:s,maybePostfixModifierPosition:void 0}}if(n){const o=r;r=i=>n({className:i,parseClassName:o})}return r},Cu=e=>e.endsWith(Yo)?e.substring(0,e.length-1):e.startsWith(Yo)?e.substring(1):e,Ou=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const o=[];let i=[];return r.forEach(s=>{s[0]==="["||t[s]?(o.push(...i.sort(),s),i=[]):i.push(s)}),o.push(...i.sort()),o}},Au=e=>({cache:Eu(e.cacheSize),parseClassName:Su(e),sortModifiers:Ou(e),...bu(e)}),ku=/\s+/,Tu=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:i}=t,s=[],a=e.trim().split(ku);let l="";for(let c=a.length-1;c>=0;c-=1){const d=a[c],{isExternal:h,modifiers:m,hasImportantModifier:f,baseClassName:x,maybePostfixModifierPosition:b}=n(d);if(h){l=d+(l.length>0?" "+l:l);continue}let R=!!b,$=r(R?x.substring(0,b):x);if(!$){if(!R){l=d+(l.length>0?" "+l:l);continue}if($=r(x),!$){l=d+(l.length>0?" "+l:l);continue}R=!1}const w=i(m).join(":"),T=f?w+Yo:w,N=T+$;if(s.includes(N))continue;s.push(N);const D=o($,R);for(let j=0;j<D.length;++j){const W=D[j];s.push(T+W)}l=d+(l.length>0?" "+l:l)}return l};function Fu(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Xa(t))&&(r&&(r+=" "),r+=n);return r}const Xa=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Xa(e[r]))&&(n&&(n+=" "),n+=t);return n};function Pu(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((d,h)=>h(d),e());return n=Au(c),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const d=Tu(l,n);return o(l,d),d}return function(){return i(Fu.apply(null,arguments))}}const ve=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ja=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Za=/^\((?:(\w[\w-]*):)?(.+)\)$/i,$u=/^\d+\/\d+$/,Mu=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Iu=/\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$/,Du=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Nu=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Lu=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,vn=e=>$u.test(e),oe=e=>!!e&&!Number.isNaN(Number(e)),Ot=e=>!!e&&Number.isInteger(Number(e)),Ro=e=>e.endsWith("%")&&oe(e.slice(0,-1)),gt=e=>Mu.test(e),ju=()=>!0,Bu=e=>Iu.test(e)&&!Du.test(e),el=()=>!1,Hu=e=>Nu.test(e),Wu=e=>Lu.test(e),Uu=e=>!z(e)&&!G(e),Vu=e=>Vn(e,rl,el),z=e=>Ja.test(e),Gt=e=>Vn(e,ol,Bu),So=e=>Vn(e,Qu,oe),ms=e=>Vn(e,tl,el),qu=e=>Vn(e,nl,Wu),Sr=e=>Vn(e,il,Hu),G=e=>Za.test(e),Kn=e=>qn(e,ol),zu=e=>qn(e,Ku),gs=e=>qn(e,tl),Gu=e=>qn(e,rl),_u=e=>qn(e,nl),Cr=e=>qn(e,il,!0),Vn=(e,t,n)=>{const r=Ja.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},qn=(e,t,n=!1)=>{const r=Za.exec(e);return r?r[1]?t(r[1]):n:!1},tl=e=>e==="position"||e==="percentage",nl=e=>e==="image"||e==="url",rl=e=>e==="length"||e==="size"||e==="bg-size",ol=e=>e==="length",Qu=e=>e==="number",Ku=e=>e==="family-name",il=e=>e==="shadow",Yu=()=>{const e=ve("color"),t=ve("font"),n=ve("text"),r=ve("font-weight"),o=ve("tracking"),i=ve("leading"),s=ve("breakpoint"),a=ve("container"),l=ve("spacing"),c=ve("radius"),d=ve("shadow"),h=ve("inset-shadow"),m=ve("text-shadow"),f=ve("drop-shadow"),x=ve("blur"),b=ve("perspective"),R=ve("aspect"),$=ve("ease"),w=ve("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...N(),G,z],j=()=>["auto","hidden","clip","visible","scroll"],W=()=>["auto","contain","none"],u=()=>[G,z,l],p=()=>[vn,"full","auto",...u()],g=()=>[Ot,"none","subgrid",G,z],C=()=>["auto",{span:["full",Ot,G,z]},Ot,G,z],S=()=>[Ot,"auto",G,z],A=()=>["auto","min","max","fr",G,z],k=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],v=()=>["start","end","center","stretch","center-safe","end-safe"],E=()=>["auto",...u()],F=()=>[vn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...u()],y=()=>[e,G,z],M=()=>[...N(),gs,ms,{position:[G,z]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",Gu,Vu,{size:[G,z]}],H=()=>[Ro,Kn,Gt],_=()=>["","none","full",c,G,z],ee=()=>["",oe,Kn,Gt],Z=()=>["solid","dashed","dotted","double"],Y=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],U=()=>[oe,Ro,gs,ms],ae=()=>["","none",x,G,z],ge=()=>["none",oe,G,z],Ee=()=>["none",oe,G,z],Q=()=>[oe,G,z],ne=()=>[vn,"full",...u()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[gt],breakpoint:[gt],color:[ju],container:[gt],"drop-shadow":[gt],ease:["in","out","in-out"],font:[Uu],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[gt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[gt],shadow:[gt],spacing:["px",oe],text:[gt],"text-shadow":[gt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",vn,z,G,R]}],container:["container"],columns:[{columns:[oe,z,G,a]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:D()}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:W()}],"overscroll-x":[{"overscroll-x":W()}],"overscroll-y":[{"overscroll-y":W()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:p()}],"inset-x":[{"inset-x":p()}],"inset-y":[{"inset-y":p()}],start:[{start:p()}],end:[{end:p()}],top:[{top:p()}],right:[{right:p()}],bottom:[{bottom:p()}],left:[{left:p()}],visibility:["visible","invisible","collapse"],z:[{z:[Ot,"auto",G,z]}],basis:[{basis:[vn,"full","auto",a,...u()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[oe,vn,"auto","initial","none",z]}],grow:[{grow:["",oe,G,z]}],shrink:[{shrink:["",oe,G,z]}],order:[{order:[Ot,"first","last","none",G,z]}],"grid-cols":[{"grid-cols":g()}],"col-start-end":[{col:C()}],"col-start":[{"col-start":S()}],"col-end":[{"col-end":S()}],"grid-rows":[{"grid-rows":g()}],"row-start-end":[{row:C()}],"row-start":[{"row-start":S()}],"row-end":[{"row-end":S()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":A()}],"auto-rows":[{"auto-rows":A()}],gap:[{gap:u()}],"gap-x":[{"gap-x":u()}],"gap-y":[{"gap-y":u()}],"justify-content":[{justify:[...k(),"normal"]}],"justify-items":[{"justify-items":[...v(),"normal"]}],"justify-self":[{"justify-self":["auto",...v()]}],"align-content":[{content:["normal",...k()]}],"align-items":[{items:[...v(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...v(),{baseline:["","last"]}]}],"place-content":[{"place-content":k()}],"place-items":[{"place-items":[...v(),"baseline"]}],"place-self":[{"place-self":["auto",...v()]}],p:[{p:u()}],px:[{px:u()}],py:[{py:u()}],ps:[{ps:u()}],pe:[{pe:u()}],pt:[{pt:u()}],pr:[{pr:u()}],pb:[{pb:u()}],pl:[{pl:u()}],m:[{m:E()}],mx:[{mx:E()}],my:[{my:E()}],ms:[{ms:E()}],me:[{me:E()}],mt:[{mt:E()}],mr:[{mr:E()}],mb:[{mb:E()}],ml:[{ml:E()}],"space-x":[{"space-x":u()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":u()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],w:[{w:[a,"screen",...F()]}],"min-w":[{"min-w":[a,"screen","none",...F()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh",...F()]}],"font-size":[{text:["base",n,Kn,Gt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,G,So]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ro,z]}],"font-family":[{font:[zu,z,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,G,z]}],"line-clamp":[{"line-clamp":[oe,"none",G,So]}],leading:[{leading:[i,...u()]}],"list-image":[{"list-image":["none",G,z]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",G,z]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:y()}],"text-color":[{text:y()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:[oe,"from-font","auto",G,Gt]}],"text-decoration-color":[{decoration:y()}],"underline-offset":[{"underline-offset":[oe,"auto",G,z]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:u()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",G,z]}],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",G,z]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:M()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ot,G,z],radial:["",G,z],conic:[Ot,G,z]},_u,qu]}],"bg-color":[{bg:y()}],"gradient-from-pos":[{from:H()}],"gradient-via-pos":[{via:H()}],"gradient-to-pos":[{to:H()}],"gradient-from":[{from:y()}],"gradient-via":[{via:y()}],"gradient-to":[{to:y()}],rounded:[{rounded:_()}],"rounded-s":[{"rounded-s":_()}],"rounded-e":[{"rounded-e":_()}],"rounded-t":[{"rounded-t":_()}],"rounded-r":[{"rounded-r":_()}],"rounded-b":[{"rounded-b":_()}],"rounded-l":[{"rounded-l":_()}],"rounded-ss":[{"rounded-ss":_()}],"rounded-se":[{"rounded-se":_()}],"rounded-ee":[{"rounded-ee":_()}],"rounded-es":[{"rounded-es":_()}],"rounded-tl":[{"rounded-tl":_()}],"rounded-tr":[{"rounded-tr":_()}],"rounded-br":[{"rounded-br":_()}],"rounded-bl":[{"rounded-bl":_()}],"border-w":[{border:ee()}],"border-w-x":[{"border-x":ee()}],"border-w-y":[{"border-y":ee()}],"border-w-s":[{"border-s":ee()}],"border-w-e":[{"border-e":ee()}],"border-w-t":[{"border-t":ee()}],"border-w-r":[{"border-r":ee()}],"border-w-b":[{"border-b":ee()}],"border-w-l":[{"border-l":ee()}],"divide-x":[{"divide-x":ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Z(),"hidden","none"]}],"divide-style":[{divide:[...Z(),"hidden","none"]}],"border-color":[{border:y()}],"border-color-x":[{"border-x":y()}],"border-color-y":[{"border-y":y()}],"border-color-s":[{"border-s":y()}],"border-color-e":[{"border-e":y()}],"border-color-t":[{"border-t":y()}],"border-color-r":[{"border-r":y()}],"border-color-b":[{"border-b":y()}],"border-color-l":[{"border-l":y()}],"divide-color":[{divide:y()}],"outline-style":[{outline:[...Z(),"none","hidden"]}],"outline-offset":[{"outline-offset":[oe,G,z]}],"outline-w":[{outline:["",oe,Kn,Gt]}],"outline-color":[{outline:y()}],shadow:[{shadow:["","none",d,Cr,Sr]}],"shadow-color":[{shadow:y()}],"inset-shadow":[{"inset-shadow":["none",h,Cr,Sr]}],"inset-shadow-color":[{"inset-shadow":y()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:y()}],"ring-offset-w":[{"ring-offset":[oe,Gt]}],"ring-offset-color":[{"ring-offset":y()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":y()}],"text-shadow":[{"text-shadow":["none",m,Cr,Sr]}],"text-shadow-color":[{"text-shadow":y()}],opacity:[{opacity:[oe,G,z]}],"mix-blend":[{"mix-blend":[...Y(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Y()}],"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":[oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":U()}],"mask-image-linear-to-pos":[{"mask-linear-to":U()}],"mask-image-linear-from-color":[{"mask-linear-from":y()}],"mask-image-linear-to-color":[{"mask-linear-to":y()}],"mask-image-t-from-pos":[{"mask-t-from":U()}],"mask-image-t-to-pos":[{"mask-t-to":U()}],"mask-image-t-from-color":[{"mask-t-from":y()}],"mask-image-t-to-color":[{"mask-t-to":y()}],"mask-image-r-from-pos":[{"mask-r-from":U()}],"mask-image-r-to-pos":[{"mask-r-to":U()}],"mask-image-r-from-color":[{"mask-r-from":y()}],"mask-image-r-to-color":[{"mask-r-to":y()}],"mask-image-b-from-pos":[{"mask-b-from":U()}],"mask-image-b-to-pos":[{"mask-b-to":U()}],"mask-image-b-from-color":[{"mask-b-from":y()}],"mask-image-b-to-color":[{"mask-b-to":y()}],"mask-image-l-from-pos":[{"mask-l-from":U()}],"mask-image-l-to-pos":[{"mask-l-to":U()}],"mask-image-l-from-color":[{"mask-l-from":y()}],"mask-image-l-to-color":[{"mask-l-to":y()}],"mask-image-x-from-pos":[{"mask-x-from":U()}],"mask-image-x-to-pos":[{"mask-x-to":U()}],"mask-image-x-from-color":[{"mask-x-from":y()}],"mask-image-x-to-color":[{"mask-x-to":y()}],"mask-image-y-from-pos":[{"mask-y-from":U()}],"mask-image-y-to-pos":[{"mask-y-to":U()}],"mask-image-y-from-color":[{"mask-y-from":y()}],"mask-image-y-to-color":[{"mask-y-to":y()}],"mask-image-radial":[{"mask-radial":[G,z]}],"mask-image-radial-from-pos":[{"mask-radial-from":U()}],"mask-image-radial-to-pos":[{"mask-radial-to":U()}],"mask-image-radial-from-color":[{"mask-radial-from":y()}],"mask-image-radial-to-color":[{"mask-radial-to":y()}],"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":N()}],"mask-image-conic-pos":[{"mask-conic":[oe]}],"mask-image-conic-from-pos":[{"mask-conic-from":U()}],"mask-image-conic-to-pos":[{"mask-conic-to":U()}],"mask-image-conic-from-color":[{"mask-conic-from":y()}],"mask-image-conic-to-color":[{"mask-conic-to":y()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:M()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",G,z]}],filter:[{filter:["","none",G,z]}],blur:[{blur:ae()}],brightness:[{brightness:[oe,G,z]}],contrast:[{contrast:[oe,G,z]}],"drop-shadow":[{"drop-shadow":["","none",f,Cr,Sr]}],"drop-shadow-color":[{"drop-shadow":y()}],grayscale:[{grayscale:["",oe,G,z]}],"hue-rotate":[{"hue-rotate":[oe,G,z]}],invert:[{invert:["",oe,G,z]}],saturate:[{saturate:[oe,G,z]}],sepia:[{sepia:["",oe,G,z]}],"backdrop-filter":[{"backdrop-filter":["","none",G,z]}],"backdrop-blur":[{"backdrop-blur":ae()}],"backdrop-brightness":[{"backdrop-brightness":[oe,G,z]}],"backdrop-contrast":[{"backdrop-contrast":[oe,G,z]}],"backdrop-grayscale":[{"backdrop-grayscale":["",oe,G,z]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[oe,G,z]}],"backdrop-invert":[{"backdrop-invert":["",oe,G,z]}],"backdrop-opacity":[{"backdrop-opacity":[oe,G,z]}],"backdrop-saturate":[{"backdrop-saturate":[oe,G,z]}],"backdrop-sepia":[{"backdrop-sepia":["",oe,G,z]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":u()}],"border-spacing-x":[{"border-spacing-x":u()}],"border-spacing-y":[{"border-spacing-y":u()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",G,z]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[oe,"initial",G,z]}],ease:[{ease:["linear","initial",$,G,z]}],delay:[{delay:[oe,G,z]}],animate:[{animate:["none",w,G,z]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,G,z]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:ge()}],"rotate-x":[{"rotate-x":ge()}],"rotate-y":[{"rotate-y":ge()}],"rotate-z":[{"rotate-z":ge()}],scale:[{scale:Ee()}],"scale-x":[{"scale-x":Ee()}],"scale-y":[{"scale-y":Ee()}],"scale-z":[{"scale-z":Ee()}],"scale-3d":["scale-3d"],skew:[{skew:Q()}],"skew-x":[{"skew-x":Q()}],"skew-y":[{"skew-y":Q()}],transform:[{transform:[G,z,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ne()}],"translate-x":[{"translate-x":ne()}],"translate-y":[{"translate-y":ne()}],"translate-z":[{"translate-z":ne()}],"translate-none":["translate-none"],accent:[{accent:y()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:y()}],"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",G,z]}],"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":u()}],"scroll-mx":[{"scroll-mx":u()}],"scroll-my":[{"scroll-my":u()}],"scroll-ms":[{"scroll-ms":u()}],"scroll-me":[{"scroll-me":u()}],"scroll-mt":[{"scroll-mt":u()}],"scroll-mr":[{"scroll-mr":u()}],"scroll-mb":[{"scroll-mb":u()}],"scroll-ml":[{"scroll-ml":u()}],"scroll-p":[{"scroll-p":u()}],"scroll-px":[{"scroll-px":u()}],"scroll-py":[{"scroll-py":u()}],"scroll-ps":[{"scroll-ps":u()}],"scroll-pe":[{"scroll-pe":u()}],"scroll-pt":[{"scroll-pt":u()}],"scroll-pr":[{"scroll-pr":u()}],"scroll-pb":[{"scroll-pb":u()}],"scroll-pl":[{"scroll-pl":u()}],"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",G,z]}],fill:[{fill:["none",...y()]}],"stroke-w":[{stroke:[oe,Kn,Gt,So]}],stroke:[{stroke:["none",...y()]}],"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"]}},Xu=Pu(Yu);function En(...e){return Xu(vu(e))}const Di=O.forwardRef(({className:e="",children:t,style:n,...r},o)=>L.jsx("button",{ref:o,className:En("bg-[var(--wui-color-primary)] transition-colors hover:bg-[var(--wui-color-primary-hover)] text-[var(--wui-color-primary-text)] font-bold py-2.5 px-4 rounded-xl cursor-pointer disabled:opacity-50 wallet-custom-font",e),style:n,...r,type:"button",children:t||"Connect Wallet"}));Di.displayName="ConnectWalletButton";function no(){return typeof window<"u"}function qt(e){return sl(e)?(e.nodeName||"").toLowerCase():"#document"}function Ne(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function dt(e){var t;return(t=(sl(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function sl(e){return no()?e instanceof Node||e instanceof Ne(e).Node:!1}function de(e){return no()?e instanceof Element||e instanceof Ne(e).Element:!1}function be(e){return no()?e instanceof HTMLElement||e instanceof Ne(e).HTMLElement:!1}function Jo(e){return!no()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ne(e).ShadowRoot}const Ju=new Set(["inline","contents"]);function pr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ze(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Ju.has(o)}const Zu=new Set(["table","td","th"]);function ef(e){return Zu.has(qt(e))}const tf=[":popover-open",":modal"];function ro(e){return tf.some(t=>{try{return e.matches(t)}catch{return!1}})}const nf=["transform","translate","scale","rotate","perspective"],rf=["transform","translate","scale","rotate","perspective","filter"],of=["paint","layout","strict","content"];function Ni(e){const t=oo(),n=de(e)?ze(e):e;return nf.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)||rf.some(r=>(n.willChange||"").includes(r))||of.some(r=>(n.contain||"").includes(r))}function sf(e){let t=Et(e);for(;be(t)&&!wt(t);){if(Ni(t))return t;if(ro(t))return null;t=Et(t)}return null}function oo(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const af=new Set(["html","body","#document"]);function wt(e){return af.has(qt(e))}function ze(e){return Ne(e).getComputedStyle(e)}function io(e){return de(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Et(e){if(qt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Jo(e)&&e.host||dt(e);return Jo(t)?t.host:t}function al(e){const t=Et(e);return wt(t)?e.ownerDocument?e.ownerDocument.body:e.body:be(t)&&pr(t)?t:al(t)}function Ht(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=al(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Ne(o);if(i){const a=Zo(s);return t.concat(s,s.visualViewport||[],pr(o)?o:[],a&&n?Ht(a):[])}return t.concat(o,Ht(o,[],n))}function Zo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Hr=Math.min,ln=Math.max,Wr=Math.round,Or=Math.floor,lt=e=>({x:e,y:e}),lf={left:"right",right:"left",bottom:"top",top:"bottom"},cf={start:"end",end:"start"};function vs(e,t,n){return ln(e,Hr(t,n))}function so(e,t){return typeof e=="function"?e(t):e}function un(e){return e.split("-")[0]}function ao(e){return e.split("-")[1]}function ll(e){return e==="x"?"y":"x"}function cl(e){return e==="y"?"height":"width"}const uf=new Set(["top","bottom"]);function jt(e){return uf.has(un(e))?"y":"x"}function ul(e){return ll(jt(e))}function ff(e,t,n){n===void 0&&(n=!1);const r=ao(e),o=ul(e),i=cl(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Ur(s)),[s,Ur(s)]}function df(e){const t=Ur(e);return[ei(e),t,ei(t)]}function ei(e){return e.replace(/start|end/g,t=>cf[t])}const bs=["left","right"],ys=["right","left"],hf=["top","bottom"],pf=["bottom","top"];function mf(e,t,n){switch(e){case"top":case"bottom":return n?t?ys:bs:t?bs:ys;case"left":case"right":return t?hf:pf;default:return[]}}function gf(e,t,n,r){const o=ao(e);let i=mf(un(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(ei)))),i}function Ur(e){return e.replace(/left|right|bottom|top/g,t=>lf[t])}function vf(e){return{top:0,right:0,bottom:0,left:0,...e}}function bf(e){return typeof e!="number"?vf(e):{top:e,right:e,bottom:e,left:e}}function Vr(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}}/*!
|
|
13
|
+
`,document.head.appendChild(t),console.log("Wallet UI fonts loaded")}catch(e){console.warn("Failed to load custom fonts, using system fonts instead",e)}},hu=()=>{typeof window<"u"&&du()};function Ua(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=Ua(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function pu(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Ua(e))&&(r&&(r+=" "),r+=t);return r}const mu=(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},gu=(e,t)=>({classGroupId:e,validator:t}),Va=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ur="-",ei=[],vu="arbitrary..",bu=e=>{const t=wu(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return yu(i);const a=i.split(Ur),l=a[0]===""&&a.length>1?1:0;return za(a,l,t)},getConflictingClassGroupIds:(i,a)=>{if(a){const l=r[i],c=n[i];return l?c?mu(c,l):l:c||ei}return n[i]||ei}}},za=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const c=za(e,t+1,s);if(c)return c}const i=n.validators;if(i===null)return;const a=t===0?e.join(Ur):e.slice(t).join(Ur),l=i.length;for(let c=0;c<l;c++){const d=i[c];if(d.validator(a))return d.classGroupId}},yu=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?vu+r:void 0})(),wu=e=>{const{theme:t,classGroups:n}=e;return xu(n,t)},xu=(e,t)=>{const n=Va();for(const r in e){const o=e[r];xs(o,n,r,t)}return n},xs=(e,t,n,r)=>{const o=e.length;for(let s=0;s<o;s++){const i=e[s];Eu(i,t,n,r)}},Eu=(e,t,n,r)=>{if(typeof e=="string"){Ru(e,t,n);return}if(typeof e=="function"){Su(e,t,n,r);return}Cu(e,t,n,r)},Ru=(e,t,n)=>{const r=e===""?t:qa(t,e);r.classGroupId=n},Su=(e,t,n,r)=>{if(Ou(e)){xs(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(gu(n,e))},Cu=(e,t,n,r)=>{const o=Object.entries(e),s=o.length;for(let i=0;i<s;i++){const[a,l]=o[i];xs(l,qa(t,a),n,r)}},qa=(e,t)=>{let n=e;const r=t.split(Ur),o=r.length;for(let s=0;s<o;s++){const i=r[s];let a=n.nextPart.get(i);a||(a=Va(),n.nextPart.set(i,a)),n=a}return n},Ou=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Au=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(s,i)=>{n[s]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let i=n[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return o(s,i),i},set(s,i){s in n?n[s]=i:o(s,i)}}},Ho="!",ti=":",Tu=[],ni=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),ku=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let i=0,a=0,l=0,c;const d=o.length;for(let y=0;y<d;y++){const R=o[y];if(i===0&&a===0){if(R===ti){s.push(o.slice(l,y)),l=y+1;continue}if(R==="/"){c=y;continue}}R==="["?i++:R==="]"?i--:R==="("?a++:R===")"&&a--}const h=s.length===0?o:o.slice(l);let p=h,f=!1;h.endsWith(Ho)?(p=h.slice(0,-1),f=!0):h.startsWith(Ho)&&(p=h.slice(1),f=!0);const w=c&&c>l?c-l:void 0;return ni(s,f,p,w)};if(t){const o=t+ti,s=r;r=i=>i.startsWith(o)?s(i.slice(o.length)):ni(Tu,!1,i,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},Pu=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let s=0;s<n.length;s++){const i=n[s],a=i[0]==="[",l=t.has(i);a||l?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(i)):o.push(i)}return o.length>0&&(o.sort(),r.push(...o)),r}},Fu=e=>({cache:Au(e.cacheSize),parseClassName:ku(e),sortModifiers:Pu(e),...bu(e)}),Iu=/\s+/,Mu=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,i=[],a=e.trim().split(Iu);let l="";for(let c=a.length-1;c>=0;c-=1){const d=a[c],{isExternal:h,modifiers:p,hasImportantModifier:f,baseClassName:w,maybePostfixModifierPosition:y}=n(d);if(h){l=d+(l.length>0?" "+l:l);continue}let R=!!y,k=r(R?w.substring(0,y):w);if(!k){if(!R){l=d+(l.length>0?" "+l:l);continue}if(k=r(w),!k){l=d+(l.length>0?" "+l:l);continue}R=!1}const x=p.length===0?"":p.length===1?p[0]:s(p).join(":"),F=f?x+Ho:x,$=F+k;if(i.indexOf($)>-1)continue;i.push($);const D=o(k,R);for(let j=0;j<D.length;++j){const W=D[j];i.push(F+W)}l=d+(l.length>0?" "+l:l)}return l},$u=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=_a(n))&&(o&&(o+=" "),o+=r);return o},_a=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=_a(e[r]))&&(n&&(n+=" "),n+=t);return n},Nu=(e,...t)=>{let n,r,o,s;const i=l=>{const c=t.reduce((d,h)=>h(d),e());return n=Fu(c),r=n.cache.get,o=n.cache.set,s=a,a(l)},a=l=>{const c=r(l);if(c)return c;const d=Mu(l,n);return o(l,d),d};return s=i,(...l)=>s($u(...l))},Du=[],ye=e=>{const t=n=>n[e]||Du;return t.isThemeGetter=!0,t},Ga=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Qa=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Lu=/^\d+\/\d+$/,ju=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Bu=/\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$/,Wu=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Hu=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Uu=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,En=e=>Lu.test(e),re=e=>!!e&&!Number.isNaN(Number(e)),Pt=e=>!!e&&Number.isInteger(Number(e)),go=e=>e.endsWith("%")&&re(e.slice(0,-1)),yt=e=>ju.test(e),Vu=()=>!0,zu=e=>Bu.test(e)&&!Wu.test(e),Ka=()=>!1,qu=e=>Hu.test(e),_u=e=>Uu.test(e),Gu=e=>!q(e)&&!_(e),Qu=e=>_n(e,Ja,Ka),q=e=>Ga.test(e),Xt=e=>_n(e,Za,zu),vo=e=>_n(e,Zu,re),ri=e=>_n(e,Ya,Ka),Ku=e=>_n(e,Xa,_u),Cr=e=>_n(e,el,qu),_=e=>Qa.test(e),Jn=e=>Gn(e,Za),Yu=e=>Gn(e,ef),oi=e=>Gn(e,Ya),Xu=e=>Gn(e,Ja),Ju=e=>Gn(e,Xa),Or=e=>Gn(e,el,!0),_n=(e,t,n)=>{const r=Ga.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Gn=(e,t,n=!1)=>{const r=Qa.exec(e);return r?r[1]?t(r[1]):n:!1},Ya=e=>e==="position"||e==="percentage",Xa=e=>e==="image"||e==="url",Ja=e=>e==="length"||e==="size"||e==="bg-size",Za=e=>e==="length",Zu=e=>e==="number",ef=e=>e==="family-name",el=e=>e==="shadow",tf=()=>{const e=ye("color"),t=ye("font"),n=ye("text"),r=ye("font-weight"),o=ye("tracking"),s=ye("leading"),i=ye("breakpoint"),a=ye("container"),l=ye("spacing"),c=ye("radius"),d=ye("shadow"),h=ye("inset-shadow"),p=ye("text-shadow"),f=ye("drop-shadow"),w=ye("blur"),y=ye("perspective"),R=ye("aspect"),k=ye("ease"),x=ye("animate"),F=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...$(),_,q],j=()=>["auto","hidden","clip","visible","scroll"],W=()=>["auto","contain","none"],u=()=>[_,q,l],g=()=>[En,"full","auto",...u()],m=()=>[Pt,"none","subgrid",_,q],C=()=>["auto",{span:["full",Pt,_,q]},Pt,_,q],O=()=>[Pt,"auto",_,q],T=()=>["auto","min","max","fr",_,q],S=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],b=()=>["start","end","center","stretch","center-safe","end-safe"],E=()=>["auto",...u()],I=()=>[En,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...u()],v=()=>[e,_,q],M=()=>[...$(),oi,ri,{position:[_,q]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",Xu,Qu,{size:[_,q]}],G=()=>[go,Jn,Xt],U=()=>["","none","full",c,_,q],Z=()=>["",re,Jn,Xt],Q=()=>["solid","dashed","dotted","double"],H=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>[re,go,oi,ri],Ae=()=>["","none",w,_,q],Fe=()=>["none",re,_,q],Le=()=>["none",re,_,q],be=()=>[re,_,q],J=()=>[En,"full",...u()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[yt],breakpoint:[yt],color:[Vu],container:[yt],"drop-shadow":[yt],ease:["in","out","in-out"],font:[Gu],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[yt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[yt],shadow:[yt],spacing:["px",re],text:[yt],"text-shadow":[yt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",En,q,_,R]}],container:["container"],columns:[{columns:[re,q,_,a]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:D()}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:W()}],"overscroll-x":[{"overscroll-x":W()}],"overscroll-y":[{"overscroll-y":W()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:g()}],"inset-x":[{"inset-x":g()}],"inset-y":[{"inset-y":g()}],start:[{start:g()}],end:[{end:g()}],top:[{top:g()}],right:[{right:g()}],bottom:[{bottom:g()}],left:[{left:g()}],visibility:["visible","invisible","collapse"],z:[{z:[Pt,"auto",_,q]}],basis:[{basis:[En,"full","auto",a,...u()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[re,En,"auto","initial","none",q]}],grow:[{grow:["",re,_,q]}],shrink:[{shrink:["",re,_,q]}],order:[{order:[Pt,"first","last","none",_,q]}],"grid-cols":[{"grid-cols":m()}],"col-start-end":[{col:C()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":m()}],"row-start-end":[{row:C()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":T()}],"auto-rows":[{"auto-rows":T()}],gap:[{gap:u()}],"gap-x":[{"gap-x":u()}],"gap-y":[{"gap-y":u()}],"justify-content":[{justify:[...S(),"normal"]}],"justify-items":[{"justify-items":[...b(),"normal"]}],"justify-self":[{"justify-self":["auto",...b()]}],"align-content":[{content:["normal",...S()]}],"align-items":[{items:[...b(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...b(),{baseline:["","last"]}]}],"place-content":[{"place-content":S()}],"place-items":[{"place-items":[...b(),"baseline"]}],"place-self":[{"place-self":["auto",...b()]}],p:[{p:u()}],px:[{px:u()}],py:[{py:u()}],ps:[{ps:u()}],pe:[{pe:u()}],pt:[{pt:u()}],pr:[{pr:u()}],pb:[{pb:u()}],pl:[{pl:u()}],m:[{m:E()}],mx:[{mx:E()}],my:[{my:E()}],ms:[{ms:E()}],me:[{me:E()}],mt:[{mt:E()}],mr:[{mr:E()}],mb:[{mb:E()}],ml:[{ml:E()}],"space-x":[{"space-x":u()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":u()}],"space-y-reverse":["space-y-reverse"],size:[{size:I()}],w:[{w:[a,"screen",...I()]}],"min-w":[{"min-w":[a,"screen","none",...I()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...I()]}],h:[{h:["screen","lh",...I()]}],"min-h":[{"min-h":["screen","lh","none",...I()]}],"max-h":[{"max-h":["screen","lh",...I()]}],"font-size":[{text:["base",n,Jn,Xt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,_,vo]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",go,q]}],"font-family":[{font:[Yu,q,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,_,q]}],"line-clamp":[{"line-clamp":[re,"none",_,vo]}],leading:[{leading:[s,...u()]}],"list-image":[{"list-image":["none",_,q]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",_,q]}],"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:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:[re,"from-font","auto",_,Xt]}],"text-decoration-color":[{decoration:v()}],"underline-offset":[{"underline-offset":[re,"auto",_,q]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:u()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",_,q]}],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",_,q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:M()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Pt,_,q],radial:["",_,q],conic:[Pt,_,q]},Ju,Ku]}],"bg-color":[{bg:v()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:v()}],"gradient-via":[{via:v()}],"gradient-to":[{to:v()}],rounded:[{rounded:U()}],"rounded-s":[{"rounded-s":U()}],"rounded-e":[{"rounded-e":U()}],"rounded-t":[{"rounded-t":U()}],"rounded-r":[{"rounded-r":U()}],"rounded-b":[{"rounded-b":U()}],"rounded-l":[{"rounded-l":U()}],"rounded-ss":[{"rounded-ss":U()}],"rounded-se":[{"rounded-se":U()}],"rounded-ee":[{"rounded-ee":U()}],"rounded-es":[{"rounded-es":U()}],"rounded-tl":[{"rounded-tl":U()}],"rounded-tr":[{"rounded-tr":U()}],"rounded-br":[{"rounded-br":U()}],"rounded-bl":[{"rounded-bl":U()}],"border-w":[{border:Z()}],"border-w-x":[{"border-x":Z()}],"border-w-y":[{"border-y":Z()}],"border-w-s":[{"border-s":Z()}],"border-w-e":[{"border-e":Z()}],"border-w-t":[{"border-t":Z()}],"border-w-r":[{"border-r":Z()}],"border-w-b":[{"border-b":Z()}],"border-w-l":[{"border-l":Z()}],"divide-x":[{"divide-x":Z()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Z()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Q(),"hidden","none"]}],"divide-style":[{divide:[...Q(),"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:[...Q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[re,_,q]}],"outline-w":[{outline:["",re,Jn,Xt]}],"outline-color":[{outline:v()}],shadow:[{shadow:["","none",d,Or,Cr]}],"shadow-color":[{shadow:v()}],"inset-shadow":[{"inset-shadow":["none",h,Or,Cr]}],"inset-shadow-color":[{"inset-shadow":v()}],"ring-w":[{ring:Z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:v()}],"ring-offset-w":[{"ring-offset":[re,Xt]}],"ring-offset-color":[{"ring-offset":v()}],"inset-ring-w":[{"inset-ring":Z()}],"inset-ring-color":[{"inset-ring":v()}],"text-shadow":[{"text-shadow":["none",p,Or,Cr]}],"text-shadow-color":[{"text-shadow":v()}],opacity:[{opacity:[re,_,q]}],"mix-blend":[{"mix-blend":[...H(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":H()}],"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":[re]}],"mask-image-linear-from-pos":[{"mask-linear-from":K()}],"mask-image-linear-to-pos":[{"mask-linear-to":K()}],"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":K()}],"mask-image-t-to-pos":[{"mask-t-to":K()}],"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":K()}],"mask-image-r-to-pos":[{"mask-r-to":K()}],"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":K()}],"mask-image-b-to-pos":[{"mask-b-to":K()}],"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":K()}],"mask-image-l-to-pos":[{"mask-l-to":K()}],"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":K()}],"mask-image-x-to-pos":[{"mask-x-to":K()}],"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":K()}],"mask-image-y-to-pos":[{"mask-y-to":K()}],"mask-image-y-from-color":[{"mask-y-from":v()}],"mask-image-y-to-color":[{"mask-y-to":v()}],"mask-image-radial":[{"mask-radial":[_,q]}],"mask-image-radial-from-pos":[{"mask-radial-from":K()}],"mask-image-radial-to-pos":[{"mask-radial-to":K()}],"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":$()}],"mask-image-conic-pos":[{"mask-conic":[re]}],"mask-image-conic-from-pos":[{"mask-conic-from":K()}],"mask-image-conic-to-pos":[{"mask-conic-to":K()}],"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:M()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",_,q]}],filter:[{filter:["","none",_,q]}],blur:[{blur:Ae()}],brightness:[{brightness:[re,_,q]}],contrast:[{contrast:[re,_,q]}],"drop-shadow":[{"drop-shadow":["","none",f,Or,Cr]}],"drop-shadow-color":[{"drop-shadow":v()}],grayscale:[{grayscale:["",re,_,q]}],"hue-rotate":[{"hue-rotate":[re,_,q]}],invert:[{invert:["",re,_,q]}],saturate:[{saturate:[re,_,q]}],sepia:[{sepia:["",re,_,q]}],"backdrop-filter":[{"backdrop-filter":["","none",_,q]}],"backdrop-blur":[{"backdrop-blur":Ae()}],"backdrop-brightness":[{"backdrop-brightness":[re,_,q]}],"backdrop-contrast":[{"backdrop-contrast":[re,_,q]}],"backdrop-grayscale":[{"backdrop-grayscale":["",re,_,q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[re,_,q]}],"backdrop-invert":[{"backdrop-invert":["",re,_,q]}],"backdrop-opacity":[{"backdrop-opacity":[re,_,q]}],"backdrop-saturate":[{"backdrop-saturate":[re,_,q]}],"backdrop-sepia":[{"backdrop-sepia":["",re,_,q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":u()}],"border-spacing-x":[{"border-spacing-x":u()}],"border-spacing-y":[{"border-spacing-y":u()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",_,q]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[re,"initial",_,q]}],ease:[{ease:["linear","initial",k,_,q]}],delay:[{delay:[re,_,q]}],animate:[{animate:["none",x,_,q]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,_,q]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:Fe()}],"rotate-x":[{"rotate-x":Fe()}],"rotate-y":[{"rotate-y":Fe()}],"rotate-z":[{"rotate-z":Fe()}],scale:[{scale:Le()}],"scale-x":[{"scale-x":Le()}],"scale-y":[{"scale-y":Le()}],"scale-z":[{"scale-z":Le()}],"scale-3d":["scale-3d"],skew:[{skew:be()}],"skew-x":[{"skew-x":be()}],"skew-y":[{"skew-y":be()}],transform:[{transform:[_,q,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:J()}],"translate-x":[{"translate-x":J()}],"translate-y":[{"translate-y":J()}],"translate-z":[{"translate-z":J()}],"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",_,q]}],"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":u()}],"scroll-mx":[{"scroll-mx":u()}],"scroll-my":[{"scroll-my":u()}],"scroll-ms":[{"scroll-ms":u()}],"scroll-me":[{"scroll-me":u()}],"scroll-mt":[{"scroll-mt":u()}],"scroll-mr":[{"scroll-mr":u()}],"scroll-mb":[{"scroll-mb":u()}],"scroll-ml":[{"scroll-ml":u()}],"scroll-p":[{"scroll-p":u()}],"scroll-px":[{"scroll-px":u()}],"scroll-py":[{"scroll-py":u()}],"scroll-ps":[{"scroll-ps":u()}],"scroll-pe":[{"scroll-pe":u()}],"scroll-pt":[{"scroll-pt":u()}],"scroll-pr":[{"scroll-pr":u()}],"scroll-pb":[{"scroll-pb":u()}],"scroll-pl":[{"scroll-pl":u()}],"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",_,q]}],fill:[{fill:["none",...v()]}],"stroke-w":[{stroke:[re,Jn,Xt,vo]}],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"]}},nf=Nu(tf);function ir(...e){return nf(pu(e))}const Es=A.forwardRef(({className:e="",children:t,style:n,...r},o)=>L.jsx("button",{ref:o,className:ir("bg-[var(--wui-color-primary)] transition-colors hover:bg-[var(--wui-color-primary-hover)] text-[var(--wui-color-primary-text)] font-bold py-2.5 px-4 rounded-xl cursor-pointer disabled:opacity-50 wallet-custom-font",e),style:n,...r,type:"button",children:t||"Connect Wallet"}));Es.displayName="ConnectWalletButton";function to(){return typeof window<"u"}function ot(e){return Rs(e)?(e.nodeName||"").toLowerCase():"#document"}function ge(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function we(e){var t;return(t=(Rs(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Rs(e){return to()?e instanceof Node||e instanceof ge(e).Node:!1}function oe(e){return to()?e instanceof Element||e instanceof ge(e).Element:!1}function ce(e){return to()?e instanceof HTMLElement||e instanceof ge(e).HTMLElement:!1}function Uo(e){return!to()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ge(e).ShadowRoot}const rf=new Set(["inline","contents"]);function Gt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=me(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!rf.has(o)}const of=new Set(["table","td","th"]);function tl(e){return of.has(ot(e))}const sf=[":popover-open",":modal"];function wn(e){return sf.some(t=>{try{return e.matches(t)}catch{return!1}})}const af=["transform","translate","scale","rotate","perspective"],lf=["transform","translate","scale","rotate","perspective","filter"],cf=["paint","layout","strict","content"];function yr(e){const t=Qn(),n=oe(e)?me(e):e;return af.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)||lf.some(r=>(n.willChange||"").includes(r))||cf.some(r=>(n.contain||"").includes(r))}function nl(e){let t=De(e);for(;ce(t)&&!Ue(t);){if(yr(t))return t;if(wn(t))return null;t=De(t)}return null}function Qn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const uf=new Set(["html","body","#document"]);function Ue(e){return uf.has(ot(e))}function me(e){return ge(e).getComputedStyle(e)}function Qt(e){return oe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function De(e){if(ot(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Uo(e)&&e.host||we(e);return Uo(t)?t.host:t}function rl(e){const t=De(e);return Ue(t)?e.ownerDocument?e.ownerDocument.body:e.body:ce(t)&&Gt(t)?t:rl(t)}function rt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=rl(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=ge(o);if(s){const a=ar(i);return t.concat(i,i.visualViewport||[],Gt(o)?o:[],a&&n?rt(a):[])}return t.concat(o,rt(o,[],n))}function ar(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const ht=Math.min,pe=Math.max,Ct=Math.round,Ht=Math.floor,ve=e=>({x:e,y:e}),ff={left:"right",right:"left",bottom:"top",top:"bottom"},df={start:"end",end:"start"};function Vr(e,t,n){return pe(e,ht(t,n))}function mt(e,t){return typeof e=="function"?e(t):e}function Ve(e){return e.split("-")[0]}function xn(e){return e.split("-")[1]}function Ss(e){return e==="x"?"y":"x"}function Cs(e){return e==="y"?"height":"width"}const hf=new Set(["top","bottom"]);function Oe(e){return hf.has(Ve(e))?"y":"x"}function Os(e){return Ss(Oe(e))}function ol(e,t,n){n===void 0&&(n=!1);const r=xn(e),o=Os(e),s=Cs(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=lr(i)),[i,lr(i)]}function sl(e){const t=lr(e);return[Vo(e),t,Vo(t)]}function Vo(e){return e.replace(/start|end/g,t=>df[t])}const si=["left","right"],ii=["right","left"],pf=["top","bottom"],mf=["bottom","top"];function gf(e,t,n){switch(e){case"top":case"bottom":return n?t?ii:si:t?si:ii;case"left":case"right":return t?pf:mf;default:return[]}}function il(e,t,n,r){const o=xn(e);let s=gf(Ve(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Vo)))),s}function lr(e){return e.replace(/left|right|bottom|top/g,t=>ff[t])}function vf(e){return{top:0,right:0,bottom:0,left:0,...e}}function al(e){return typeof e!="number"?vf(e):{top:e,right:e,bottom:e,left:e}}function qt(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}}/*!
|
|
14
14
|
* tabbable 6.2.0
|
|
15
15
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
16
|
-
*/var yf=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],qr=yf.join(","),fl=typeof Element>"u",Hn=fl?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,zr=!fl&&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},Gr=function e(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"),i=o===""||o==="true",s=i||n&&t&&e(t.parentNode);return s},wf=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},dl=function(t,n,r){if(Gr(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(qr));return n&&Hn.call(t,qr)&&o.unshift(t),o=o.filter(r),o},hl=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!Gr(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,c=e(l,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:s,candidates:c})}else{var d=Hn.call(s,qr);d&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var h=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),m=!Gr(h,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(h&&m){var f=e(h===!0?s.children:h.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:s,candidates:f})}else i.unshift.apply(i,s.children)}}return o},pl=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},ml=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||wf(t))&&!pl(t)?0:t.tabIndex},xf=function(t,n){var r=ml(t);return r<0&&n&&!pl(t)?0:r},Ef=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},gl=function(t){return t.tagName==="INPUT"},Rf=function(t){return gl(t)&&t.type==="hidden"},Sf=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},Cf=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},Of=function(t){if(!t.name)return!0;var n=t.form||zr(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},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(s){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",s.message),!1}var i=Cf(o,t.form);return!i||i===t},Af=function(t){return gl(t)&&t.type==="radio"},kf=function(t){return Af(t)&&!Of(t)},Tf=function(t){var n,r=t&&zr(t),o=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var s,a,l;for(i=!!((s=o)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!i&&o;){var c,d,h;r=zr(o),o=(c=r)===null||c===void 0?void 0:c.host,i=!!((d=o)!==null&&d!==void 0&&(h=d.ownerDocument)!==null&&h!==void 0&&h.contains(o))}}return i},ws=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},Ff=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=Hn.call(t,"details>summary:first-of-type"),s=i?t.parentElement:t;if(Hn.call(s,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var a=t;t;){var l=t.parentElement,c=zr(t);if(l&&!l.shadowRoot&&o(l)===!0)return ws(t);t.assignedSlot?t=t.assignedSlot:!l&&c!==t.ownerDocument?t=c.host:t=l}t=a}if(Tf(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return ws(t);return!1},Pf=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 Hn.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},ti=function(t,n){return!(n.disabled||Gr(n)||Rf(n)||Ff(n,t)||Sf(n)||Pf(n))},ni=function(t,n){return!(kf(n)||ml(n)<0||!ti(t,n))},$f=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Mf=function e(t){var n=[],r=[];return t.forEach(function(o,i){var s=!!o.scopeParent,a=s?o.scopeParent:o,l=xf(a,s),c=s?e(o.candidates):a;l===0?s?n.push.apply(n,c):n.push(a):r.push({documentOrder:i,tabIndex:l,item:o,isScope:s,content:c})}),r.sort(Ef).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},lo=function(t,n){n=n||{};var r;return n.getShadowRoot?r=hl([t],n.includeContainer,{filter:ni.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:$f}):r=dl(t,n.includeContainer,ni.bind(null,n)),Mf(r)},If=function(t,n){n=n||{};var r;return n.getShadowRoot?r=hl([t],n.includeContainer,{filter:ti.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=dl(t,n.includeContainer,ti.bind(null,n)),r},vl=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Hn.call(t,qr)===!1?!1:ni(n,t)};function bl(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function yl(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function Df(){return/apple/i.test(navigator.vendor)}function ri(){const e=/android/i;return e.test(bl())||e.test(yl())}function Nf(){return yl().includes("jsdom/")}const xs="data-floating-ui-focusable",Lf="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function yn(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Ie(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Jo(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Tt(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Co(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 jf(e){return e.matches("html,body")}function Ke(e){return(e==null?void 0:e.ownerDocument)||document}function wl(e){return be(e)&&e.matches(Lf)}function Es(e){return e?e.getAttribute("role")==="combobox"&&wl(e):!1}function oi(e){return e?e.hasAttribute(xs)?e:e.querySelector("["+xs+"]")||e:null}function Rn(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var i;return o.parentId===t&&(!n||((i=o.context)==null?void 0:i.open))}).flatMap(o=>[o,...Rn(e,o.id,n)])}function Rs(e,t){var n;let r=[],o=(n=e.find(i=>i.id===t))==null?void 0:n.parentId;for(;o;){const i=e.find(s=>s.id===o);o=i==null?void 0:i.parentId,i&&(r=r.concat(i))}return r}function Oo(e){e.preventDefault(),e.stopPropagation()}function Bf(e){return"nativeEvent"in e}function Hf(e){return e.mozInputSource===0&&e.isTrusted?!0:ri()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Wf(e){return Nf()?!1:!ri()&&e.width===0&&e.height===0||ri()&&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 Ss(e,t){return["mouse","pen"].includes(e)}var Uf=typeof document<"u",Vf=function(){},De=Uf?O.useLayoutEffect:Vf;const qf={...I};function Ao(e){const t=I.useRef(e);return De(()=>{t.current=e}),t}const zf=qf.useInsertionEffect,Gf=zf||(e=>e());function st(e){const t=I.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Gf(()=>{t.current=e}),I.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)},[])}const mr=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function xl(e,t){const n=lo(e,mr()),r=n.length;if(r===0)return;const o=yn(Ke(e)),i=n.indexOf(o),s=i===-1?t===1?0:r-1:i+t;return n[s]}function El(e){return xl(Ke(e).body,1)||e}function Rl(e){return xl(Ke(e).body,-1)||e}function er(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Ie(n,r)}function _f(e){lo(e,mr()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Cs(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function Os(e,t,n){let{reference:r,floating:o}=e;const i=jt(t),s=ul(t),a=cl(s),l=un(t),c=i==="y",d=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,m=r[a]/2-o[a]/2;let f;switch(l){case"top":f={x:d,y:r.y-o.height};break;case"bottom":f={x:d,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:h};break;case"left":f={x:r.x-o.width,y:h};break;default:f={x:r.x,y:r.y}}switch(ao(t)){case"start":f[s]-=m*(n&&c?-1:1);break;case"end":f[s]+=m*(n&&c?-1:1);break}return f}const Qf=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:h}=Os(c,r,l),m=r,f={},x=0;for(let b=0;b<a.length;b++){const{name:R,fn:$}=a[b],{x:w,y:T,data:N,reset:D}=await $({x:d,y:h,initialPlacement:r,placement:m,strategy:o,middlewareData:f,rects:c,platform:s,elements:{reference:e,floating:t}});d=w??d,h=T??h,f={...f,[R]:{...f[R],...N}},D&&x<=50&&(x++,typeof D=="object"&&(D.placement&&(m=D.placement),D.rects&&(c=D.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):D.rects),{x:d,y:h}=Os(c,m,l)),b=-1)}return{x:d,y:h,placement:m,strategy:o,middlewareData:f}};async function Sl(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:m=!1,padding:f=0}=so(t,e),x=bf(f),R=a[m?h==="floating"?"reference":"floating":h],$=Vr(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(R)))==null||n?R:R.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),w=h==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,T=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),N=await(i.isElement==null?void 0:i.isElement(T))?await(i.getScale==null?void 0:i.getScale(T))||{x:1,y:1}:{x:1,y:1},D=Vr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:T,strategy:l}):w);return{top:($.top-D.top+x.top)/N.y,bottom:(D.bottom-$.bottom+x.bottom)/N.y,left:($.left-D.left+x.left)/N.x,right:(D.right-$.right+x.right)/N.x}}const Kf=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:b=!0,...R}=so(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const $=un(o),w=jt(a),T=un(a)===a,N=await(l.isRTL==null?void 0:l.isRTL(c.floating)),D=m||(T||!b?[Ur(a)]:df(a)),j=x!=="none";!m&&j&&D.push(...gf(a,b,x,N));const W=[a,...D],u=await Sl(t,R),p=[];let g=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&p.push(u[$]),h){const k=ff(o,s,N);p.push(u[k[0]],u[k[1]])}if(g=[...g,{placement:o,overflows:p}],!p.every(k=>k<=0)){var C,S;const k=(((C=i.flip)==null?void 0:C.index)||0)+1,v=W[k];if(v&&(!(h==="alignment"?w!==jt(v):!1)||g.every(y=>y.overflows[0]>0&&jt(y.placement)===w)))return{data:{index:k,overflows:g},reset:{placement:v}};let E=(S=g.filter(F=>F.overflows[0]<=0).sort((F,y)=>F.overflows[1]-y.overflows[1])[0])==null?void 0:S.placement;if(!E)switch(f){case"bestFit":{var A;const F=(A=g.filter(y=>{if(j){const M=jt(y.placement);return M===w||M==="y"}return!0}).map(y=>[y.placement,y.overflows.filter(M=>M>0).reduce((M,B)=>M+B,0)]).sort((y,M)=>y[1]-M[1])[0])==null?void 0:A[0];F&&(E=F);break}case"initialPlacement":E=a;break}if(o!==E)return{reset:{placement:E}}}return{}}}},Yf=new Set(["left","top"]);async function Xf(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=un(n),a=ao(n),l=jt(n)==="y",c=Yf.has(s)?-1:1,d=i&&l?-1:1,h=so(t,e);let{mainAxis:m,crossAxis:f,alignmentAxis:x}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof x=="number"&&(f=a==="end"?x*-1:x),l?{x:f*d,y:m*c}:{x:m*c,y:f*d}}const Jf=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await Xf(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},Zf=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:R=>{let{x:$,y:w}=R;return{x:$,y:w}}},...l}=so(e,t),c={x:n,y:r},d=await Sl(t,l),h=jt(un(o)),m=ll(h);let f=c[m],x=c[h];if(i){const R=m==="y"?"top":"left",$=m==="y"?"bottom":"right",w=f+d[R],T=f-d[$];f=vs(w,f,T)}if(s){const R=h==="y"?"top":"left",$=h==="y"?"bottom":"right",w=x+d[R],T=x-d[$];x=vs(w,x,T)}const b=a.fn({...t,[m]:f,[h]:x});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[m]:i,[h]:s}}}}}};function Cl(e){const t=ze(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=be(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Wr(n)!==i||Wr(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Li(e){return de(e)?e:e.contextElement}function Sn(e){const t=Li(e);if(!be(t))return lt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Cl(t);let s=(i?Wr(n.width):n.width)/r,a=(i?Wr(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const ed=lt(0);function Ol(e){const t=Ne(e);return!oo()||!t.visualViewport?ed:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function td(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ne(e)?!1:t}function fn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Li(e);let s=lt(1);t&&(r?de(r)&&(s=Sn(r)):s=Sn(e));const a=td(i,n,r)?Ol(i):lt(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,d=o.width/s.x,h=o.height/s.y;if(i){const m=Ne(i),f=r&&de(r)?Ne(r):r;let x=m,b=Zo(x);for(;b&&r&&f!==x;){const R=Sn(b),$=b.getBoundingClientRect(),w=ze(b),T=$.left+(b.clientLeft+parseFloat(w.paddingLeft))*R.x,N=$.top+(b.clientTop+parseFloat(w.paddingTop))*R.y;l*=R.x,c*=R.y,d*=R.x,h*=R.y,l+=T,c+=N,x=Ne(b),b=Zo(x)}}return Vr({width:d,height:h,x:l,y:c})}function ji(e,t){const n=io(e).scrollLeft;return t?t.left+n:fn(dt(e)).left+n}function Al(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:ji(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function nd(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=dt(r),a=t?ro(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=lt(1);const d=lt(0),h=be(r);if((h||!h&&!i)&&((qt(r)!=="body"||pr(s))&&(l=io(r)),be(r))){const f=fn(r);c=Sn(r),d.x=f.x+r.clientLeft,d.y=f.y+r.clientTop}const m=s&&!h&&!i?Al(s,l,!0):lt(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+m.x,y:n.y*c.y-l.scrollTop*c.y+d.y+m.y}}function rd(e){return Array.from(e.getClientRects())}function od(e){const t=dt(e),n=io(e),r=e.ownerDocument.body,o=ln(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=ln(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+ji(e);const a=-n.scrollTop;return ze(r).direction==="rtl"&&(s+=ln(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function id(e,t){const n=Ne(e),r=dt(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=oo();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}const sd=new Set(["absolute","fixed"]);function ad(e,t){const n=fn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=be(e)?Sn(e):lt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function As(e,t,n){let r;if(t==="viewport")r=id(e,n);else if(t==="document")r=od(dt(e));else if(de(t))r=ad(t,n);else{const o=Ol(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Vr(r)}function kl(e,t){const n=Et(e);return n===t||!de(n)||wt(n)?!1:ze(n).position==="fixed"||kl(n,t)}function ld(e,t){const n=t.get(e);if(n)return n;let r=Ht(e,[],!1).filter(a=>de(a)&&qt(a)!=="body"),o=null;const i=ze(e).position==="fixed";let s=i?Et(e):e;for(;de(s)&&!wt(s);){const a=ze(s),l=Ni(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&sd.has(o.position)||pr(s)&&!l&&kl(e,s))?r=r.filter(d=>d!==s):o=a,s=Et(s)}return t.set(e,r),r}function cd(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?ro(t)?[]:ld(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,d)=>{const h=As(t,d,o);return c.top=ln(h.top,c.top),c.right=Hr(h.right,c.right),c.bottom=Hr(h.bottom,c.bottom),c.left=ln(h.left,c.left),c},As(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function ud(e){const{width:t,height:n}=Cl(e);return{width:t,height:n}}function fd(e,t,n){const r=be(t),o=dt(t),i=n==="fixed",s=fn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=lt(0);function c(){l.x=ji(o)}if(r||!r&&!i)if((qt(t)!=="body"||pr(o))&&(a=io(t)),r){const f=fn(t,!0,i,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else o&&c();i&&!r&&o&&c();const d=o&&!r&&!i?Al(o,a):lt(0),h=s.left+a.scrollLeft-l.x-d.x,m=s.top+a.scrollTop-l.y-d.y;return{x:h,y:m,width:s.width,height:s.height}}function ko(e){return ze(e).position==="static"}function ks(e,t){if(!be(e)||ze(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return dt(e)===n&&(n=n.ownerDocument.body),n}function Tl(e,t){const n=Ne(e);if(ro(e))return n;if(!be(e)){let o=Et(e);for(;o&&!wt(o);){if(de(o)&&!ko(o))return o;o=Et(o)}return n}let r=ks(e,t);for(;r&&ef(r)&&ko(r);)r=ks(r,t);return r&&wt(r)&&ko(r)&&!Ni(r)?n:r||sf(e)||n}const dd=async function(e){const t=this.getOffsetParent||Tl,n=this.getDimensions,r=await n(e.floating);return{reference:fd(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function hd(e){return ze(e).direction==="rtl"}const pd={convertOffsetParentRelativeRectToViewportRelativeRect:nd,getDocumentElement:dt,getClippingRect:cd,getOffsetParent:Tl,getElementRects:dd,getClientRects:rd,getDimensions:ud,getScale:Sn,isElement:de,isRTL:hd};function Fl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function md(e,t){let n=null,r;const o=dt(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:d,top:h,width:m,height:f}=c;if(a||t(),!m||!f)return;const x=Or(h),b=Or(o.clientWidth-(d+m)),R=Or(o.clientHeight-(h+f)),$=Or(d),T={rootMargin:-x+"px "+-b+"px "+-R+"px "+-$+"px",threshold:ln(0,Hr(1,l))||1};let N=!0;function D(j){const W=j[0].intersectionRatio;if(W!==l){if(!N)return s();W?s(!1,W):r=setTimeout(()=>{s(!1,1e-7)},1e3)}W===1&&!Fl(c,e.getBoundingClientRect())&&s(),N=!1}try{n=new IntersectionObserver(D,{...T,root:o.ownerDocument})}catch{n=new IntersectionObserver(D,T)}n.observe(e)}return s(!0),i}function gd(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Li(e),d=o||i?[...c?Ht(c):[],...Ht(t)]:[];d.forEach($=>{o&&$.addEventListener("scroll",n,{passive:!0}),i&&$.addEventListener("resize",n)});const h=c&&a?md(c,n):null;let m=-1,f=null;s&&(f=new ResizeObserver($=>{let[w]=$;w&&w.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var T;(T=f)==null||T.observe(t)})),n()}),c&&!l&&f.observe(c),f.observe(t));let x,b=l?fn(e):null;l&&R();function R(){const $=fn(e);b&&!Fl(b,$)&&n(),b=$,x=requestAnimationFrame(R)}return n(),()=>{var $;d.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),h==null||h(),($=f)==null||$.disconnect(),f=null,l&&cancelAnimationFrame(x)}}const vd=Jf,bd=Zf,yd=Kf,wd=(e,t,n)=>{const r=new Map,o={platform:pd,...n},i={...o.platform,_c:r};return Qf(e,t,{...o,platform:i})};var xd=typeof document<"u",Ed=function(){},jr=xd?O.useLayoutEffect:Ed;function _r(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(!_r(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 i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!_r(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Pl(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ts(e,t){const n=Pl(e);return Math.round(t*n)/n}function To(e){const t=I.useRef(e);return jr(()=>{t.current=e}),t}function Rd(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[d,h]=I.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,f]=I.useState(r);_r(m,r)||f(r);const[x,b]=I.useState(null),[R,$]=I.useState(null),w=I.useCallback(y=>{y!==j.current&&(j.current=y,b(y))},[]),T=I.useCallback(y=>{y!==W.current&&(W.current=y,$(y))},[]),N=i||x,D=s||R,j=I.useRef(null),W=I.useRef(null),u=I.useRef(d),p=l!=null,g=To(l),C=To(o),S=To(c),A=I.useCallback(()=>{if(!j.current||!W.current)return;const y={placement:t,strategy:n,middleware:m};C.current&&(y.platform=C.current),wd(j.current,W.current,y).then(M=>{const B={...M,isPositioned:S.current!==!1};k.current&&!_r(u.current,B)&&(u.current=B,Bn.flushSync(()=>{h(B)}))})},[m,t,n,C,S]);jr(()=>{c===!1&&u.current.isPositioned&&(u.current.isPositioned=!1,h(y=>({...y,isPositioned:!1})))},[c]);const k=I.useRef(!1);jr(()=>(k.current=!0,()=>{k.current=!1}),[]),jr(()=>{if(N&&(j.current=N),D&&(W.current=D),N&&D){if(g.current)return g.current(N,D,A);A()}},[N,D,A,g,p]);const v=I.useMemo(()=>({reference:j,floating:W,setReference:w,setFloating:T}),[w,T]),E=I.useMemo(()=>({reference:N,floating:D}),[N,D]),F=I.useMemo(()=>{const y={position:n,left:0,top:0};if(!E.floating)return y;const M=Ts(E.floating,d.x),B=Ts(E.floating,d.y);return a?{...y,transform:"translate("+M+"px, "+B+"px)",...Pl(E.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:B}},[n,a,E.floating,d.x,d.y]);return I.useMemo(()=>({...d,update:A,refs:v,elements:E,floatingStyles:F}),[d,A,v,E,F])}const Sd=(e,t)=>({...vd(e),options:[e,t]}),Cd=(e,t)=>({...bd(e),options:[e,t]}),Od=(e,t)=>({...yd(e),options:[e,t]});function Ad(e){const t=I.useRef(void 0),n=I.useCallback(r=>{const o=e.map(i=>{if(i!=null){if(typeof i=="function"){const s=i,a=s(r);return typeof a=="function"?a:()=>{s(null)}}return i.current=r,()=>{i.current=null}}});return()=>{o.forEach(i=>i==null?void 0:i())}},e);return I.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}const kd="data-floating-ui-focusable",Fs="active",Ps="selected",Td={...I};let $s=!1,Fd=0;const Ms=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Fd++;function Pd(){const[e,t]=I.useState(()=>$s?Ms():void 0);return De(()=>{e==null&&t(Ms())},[]),I.useEffect(()=>{$s=!0},[]),e}const $d=Td.useId,Wn=$d||Pd;let ii;process.env.NODE_ENV!=="production"&&(ii=new Set);function Md(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=ii)!=null&&e.has(o))){var i;(i=ii)==null||i.add(o),console.error(o)}}function Id(){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)}}}const Dd=I.createContext(null),Nd=I.createContext(null),$l=()=>{var e;return((e=I.useContext(Dd))==null?void 0:e.id)||null},Bi=()=>I.useContext(Nd);function rr(e){return"data-floating-ui-"+e}function Ld(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}let Is=0;function bn(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Is);const i=()=>e==null?void 0:e.focus({preventScroll:n});o?i():Is=requestAnimationFrame(i)}function jd(e){return(e==null?void 0:e.ownerDocument)||document}const Cn={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Ds(e){return e==="inert"?Cn.inert:e==="aria-hidden"?Cn["aria-hidden"]:Cn.none}let Ar=new WeakSet,kr={},Fo=0;const Bd=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,Ml=e=>e&&(e.host||Ml(e.parentNode)),Hd=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Ml(n);return e.contains(r)?r:null}).filter(n=>n!=null);function Wd(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,s=Hd(t,e),a=new Set,l=new Set(s),c=[];kr[o]||(kr[o]=new WeakMap);const d=kr[o];s.forEach(h),m(t),a.clear();function h(f){!f||a.has(f)||(a.add(f),f.parentNode&&h(f.parentNode))}function m(f){!f||l.has(f)||[].forEach.call(f.children,x=>{if(qt(x)!=="script")if(a.has(x))m(x);else{const b=i?x.getAttribute(i):null,R=b!==null&&b!=="false",$=Ds(i),w=($.get(x)||0)+1,T=(d.get(x)||0)+1;$.set(x,w),d.set(x,T),c.push(x),w===1&&R&&Ar.add(x),T===1&&x.setAttribute(o,""),!R&&i&&x.setAttribute(i,i==="inert"?"":"true")}})}return Fo++,()=>{c.forEach(f=>{const x=Ds(i),R=(x.get(f)||0)-1,$=(d.get(f)||0)-1;x.set(f,R),d.set(f,$),R||(!Ar.has(f)&&i&&f.removeAttribute(i),Ar.delete(f)),$||f.removeAttribute(o)}),Fo--,Fo||(Cn.inert=new WeakMap,Cn["aria-hidden"]=new WeakMap,Cn.none=new WeakMap,Ar=new WeakSet,kr={})}}function Ns(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=jd(e[0]).body;return Wd(e.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))),r,t,n)}const co={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Qr=I.forwardRef(function(t,n){const[r,o]=I.useState();De(()=>{Df()&&o("button")},[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[rr("focus-guard")]:"",style:co};return L.jsx("span",{...t,...i})}),Il=I.createContext(null),Ls=rr("portal");function Ud(e){e===void 0&&(e={});const{id:t,root:n}=e,r=Wn(),o=Nl(),[i,s]=I.useState(null),a=I.useRef(null);return De(()=>()=>{i==null||i.remove(),queueMicrotask(()=>{a.current=null})},[i]),De(()=>{if(!r||a.current)return;const l=t?document.getElementById(t):null;if(!l)return;const c=document.createElement("div");c.id=r,c.setAttribute(Ls,""),l.appendChild(c),a.current=c,s(c)},[t,r]),De(()=>{if(n===null||!r||a.current)return;let l=n||(o==null?void 0:o.portalNode);l&&!de(l)&&(l=l.current),l=l||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,l.appendChild(c));const d=document.createElement("div");d.id=r,d.setAttribute(Ls,""),l=c||l,l.appendChild(d),a.current=d,s(d)},[t,n,r,o]),i}function Dl(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,i=Ud({id:n,root:r}),[s,a]=I.useState(null),l=I.useRef(null),c=I.useRef(null),d=I.useRef(null),h=I.useRef(null),m=s==null?void 0:s.modal,f=s==null?void 0:s.open,x=!!s&&!s.modal&&s.open&&o&&!!(r||i);return I.useEffect(()=>{if(!i||!o||m)return;function b(R){i&&er(R)&&(R.type==="focusin"?Cs:_f)(i)}return i.addEventListener("focusin",b,!0),i.addEventListener("focusout",b,!0),()=>{i.removeEventListener("focusin",b,!0),i.removeEventListener("focusout",b,!0)}},[i,o,m]),I.useEffect(()=>{i&&(f||Cs(i))},[f,i]),L.jsxs(Il.Provider,{value:I.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:d,afterInsideRef:h,portalNode:i,setFocusManagerState:a}),[o,i]),children:[x&&i&&L.jsx(Qr,{"data-type":"outside",ref:l,onFocus:b=>{if(er(b,i)){var R;(R=d.current)==null||R.focus()}else{const $=s?s.domReference:null,w=Rl($);w==null||w.focus()}}}),x&&i&&L.jsx("span",{"aria-owns":i.id,style:co}),i&&Bn.createPortal(t,i),x&&i&&L.jsx(Qr,{"data-type":"outside",ref:c,onFocus:b=>{if(er(b,i)){var R;(R=h.current)==null||R.focus()}else{const $=s?s.domReference:null,w=El($);w==null||w.focus(),s!=null&&s.closeOnFocusOut&&(s==null||s.onOpenChange(!1,b.nativeEvent,"focus-out"))}}})]})}const Nl=()=>I.useContext(Il);function js(e){return I.useMemo(()=>t=>{e.forEach(n=>{n&&(n.current=t)})},e)}const Vd=20;let Qt=[];function qd(e){Qt=Qt.filter(t=>t.isConnected),e&&qt(e)!=="body"&&(Qt.push(e),Qt.length>Vd&&(Qt=Qt.slice(-20)))}function Bs(){return Qt.slice().reverse().find(e=>e.isConnected)}function zd(e){const t=mr();return vl(e,t)?e:lo(e,t)[0]||e}function Hs(e,t){var n;if(!t.current.includes("floating")&&!((n=e.getAttribute("role"))!=null&&n.includes("dialog")))return;const r=mr(),i=If(e,r).filter(a=>{const l=a.getAttribute("data-tabindex")||"";return vl(a,r)||a.hasAttribute("data-tabindex")&&!l.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||i.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const Gd=I.forwardRef(function(t,n){return L.jsx("button",{...t,type:"button",ref:n,tabIndex:-1,style:co})});function Ll(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:i=!0,initialFocus:s=0,returnFocus:a=!0,restoreFocus:l=!1,modal:c=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:h=!0,outsideElementsInert:m=!1,getInsideElements:f=()=>[]}=e,{open:x,onOpenChange:b,events:R,dataRef:$,elements:{domReference:w,floating:T}}=t,N=st(()=>{var Q;return(Q=$.current.floatingContext)==null?void 0:Q.nodeId}),D=st(f),j=typeof s=="number"&&s<0,W=Es(w)&&j,u=Bd(),p=u?i:!0,g=!p||u&&m,C=Ao(o),S=Ao(s),A=Ao(a),k=Bi(),v=Nl(),E=I.useRef(null),F=I.useRef(null),y=I.useRef(!1),M=I.useRef(!1),B=I.useRef(-1),V=v!=null,H=oi(T),_=st(function(Q){return Q===void 0&&(Q=H),Q?lo(Q,mr()):[]}),ee=st(Q=>{const ne=_(Q);return C.current.map(X=>w&&X==="reference"?w:H&&X==="floating"?H:ne).filter(Boolean).flat()});I.useEffect(()=>{if(r||!c)return;function Q(X){if(X.key==="Tab"){Ie(H,yn(Ke(H)))&&_().length===0&&!W&&Oo(X);const K=ee(),re=Tt(X);C.current[0]==="reference"&&re===w&&(Oo(X),X.shiftKey?bn(K[K.length-1]):bn(K[1])),C.current[1]==="floating"&&re===H&&X.shiftKey&&(Oo(X),bn(K[0]))}}const ne=Ke(H);return ne.addEventListener("keydown",Q),()=>{ne.removeEventListener("keydown",Q)}},[r,w,H,c,C,W,_,ee]),I.useEffect(()=>{if(r||!T)return;function Q(ne){const X=Tt(ne),re=_().indexOf(X);re!==-1&&(B.current=re)}return T.addEventListener("focusin",Q),()=>{T.removeEventListener("focusin",Q)}},[r,T,_]),I.useEffect(()=>{if(r||!h)return;function Q(){M.current=!0,setTimeout(()=>{M.current=!1})}function ne(X){const K=X.relatedTarget,re=X.currentTarget,Re=Tt(X);queueMicrotask(()=>{const tt=N(),mt=!(Ie(w,K)||Ie(T,K)||Ie(K,T)||Ie(v==null?void 0:v.portalNode,K)||K!=null&&K.hasAttribute(rr("focus-guard"))||k&&(Rn(k.nodesRef.current,tt).find(he=>{var me,Ct;return Ie((me=he.context)==null?void 0:me.elements.floating,K)||Ie((Ct=he.context)==null?void 0:Ct.elements.domReference,K)})||Rs(k.nodesRef.current,tt).find(he=>{var me,Ct,us;return[(me=he.context)==null?void 0:me.elements.floating,oi((Ct=he.context)==null?void 0:Ct.elements.floating)].includes(K)||((us=he.context)==null?void 0:us.elements.domReference)===K})));if(re===w&&H&&Hs(H,C),l&&re!==w&&!(Re!=null&&Re.isConnected)&&yn(Ke(H))===Ke(H).body){be(H)&&H.focus();const he=B.current,me=_(),Ct=me[he]||me[me.length-1]||H;be(Ct)&&Ct.focus()}if($.current.insideReactTree){$.current.insideReactTree=!1;return}(W||!c)&&K&&mt&&!M.current&&K!==Bs()&&(y.current=!0,b(!1,X,"focus-out"))})}if(T&&be(w))return w.addEventListener("focusout",ne),w.addEventListener("pointerdown",Q),T.addEventListener("focusout",ne),()=>{w.removeEventListener("focusout",ne),w.removeEventListener("pointerdown",Q),T.removeEventListener("focusout",ne)}},[r,w,T,H,c,k,v,b,h,l,_,W,N,C,$]);const Z=I.useRef(null),Y=I.useRef(null),U=js([Z,v==null?void 0:v.beforeInsideRef]),ae=js([Y,v==null?void 0:v.afterInsideRef]);I.useEffect(()=>{var Q,ne;if(r||!T)return;const X=Array.from((v==null||(Q=v.portalNode)==null?void 0:Q.querySelectorAll("["+rr("portal")+"]"))||[]),K=k?Rs(k.nodesRef.current,N()):[],re=k&&!c?K.map(he=>{var me;return(me=he.context)==null?void 0:me.elements.floating}):[],Re=(ne=K.find(he=>{var me;return Es(((me=he.context)==null?void 0:me.elements.domReference)||null)}))==null||(ne=ne.context)==null?void 0:ne.elements.domReference,tt=[T,Re,...X,...re,...D(),E.current,F.current,Z.current,Y.current,v==null?void 0:v.beforeOutsideRef.current,v==null?void 0:v.afterOutsideRef.current,C.current.includes("reference")||W?w:null].filter(he=>he!=null),mt=c||W?Ns(tt,!g,g):Ns(tt);return()=>{mt()}},[r,w,T,c,C,v,W,p,g,k,N,D]),De(()=>{if(r||!be(H))return;const Q=Ke(H),ne=yn(Q);queueMicrotask(()=>{const X=ee(H),K=S.current,re=(typeof K=="number"?X[K]:K.current)||H,Re=Ie(H,ne);!j&&!Re&&x&&bn(re,{preventScroll:re===H})})},[r,x,H,j,ee,S]),De(()=>{if(r||!H)return;const Q=Ke(H),ne=yn(Q);qd(ne);function X(Re){let{reason:tt,event:mt,nested:he}=Re;if(["hover","safe-polygon"].includes(tt)&&mt.type==="mouseleave"&&(y.current=!0),tt==="outside-press")if(he)y.current=!1;else if(Hf(mt)||Wf(mt))y.current=!1;else{let me=!1;document.createElement("div").focus({get preventScroll(){return me=!0,!1}}),me?y.current=!1:y.current=!0}}R.on("openchange",X);const K=Q.createElement("span");K.setAttribute("tabindex","-1"),K.setAttribute("aria-hidden","true"),Object.assign(K.style,co),V&&w&&w.insertAdjacentElement("afterend",K);function re(){if(typeof A.current=="boolean"){const Re=w||Bs();return Re&&Re.isConnected?Re:K}return A.current.current||K}return()=>{R.off("openchange",X);const Re=yn(Q),tt=Ie(T,Re)||k&&Rn(k.nodesRef.current,N(),!1).some(he=>{var me;return Ie((me=he.context)==null?void 0:me.elements.floating,Re)}),mt=re();queueMicrotask(()=>{const he=zd(mt);A.current&&!y.current&&be(he)&&(!(he!==Re&&Re!==Q.body)||tt)&&he.focus({preventScroll:!0}),K.remove()})}},[r,T,H,A,$,R,k,V,w,N]),I.useEffect(()=>{queueMicrotask(()=>{y.current=!1})},[r]),De(()=>{if(!r&&v)return v.setFocusManagerState({modal:c,closeOnFocusOut:h,open:x,onOpenChange:b,domReference:w}),()=>{v.setFocusManagerState(null)}},[r,v,c,x,b,h,w]),De(()=>{r||H&&Hs(H,C)},[r,H,C]);function ge(Q){return r||!d||!c?null:L.jsx(Gd,{ref:Q==="start"?E:F,onClick:ne=>b(!1,ne.nativeEvent),children:typeof d=="string"?d:"Dismiss"})}const Ee=!r&&p&&(c?!W:!0)&&(V||c);return L.jsxs(L.Fragment,{children:[Ee&&L.jsx(Qr,{"data-type":"inside",ref:U,onFocus:Q=>{if(c){const X=ee();bn(o[0]==="reference"?X[0]:X[X.length-1])}else if(v!=null&&v.preserveTabOrder&&v.portalNode)if(y.current=!1,er(Q,v.portalNode)){const X=El(w);X==null||X.focus()}else{var ne;(ne=v.beforeOutsideRef.current)==null||ne.focus()}}}),!W&&ge("start"),n,ge("end"),Ee&&L.jsx(Qr,{"data-type":"inside",ref:ae,onFocus:Q=>{if(c)bn(ee()[0]);else if(v!=null&&v.preserveTabOrder&&v.portalNode)if(h&&(y.current=!0),er(Q,v.portalNode)){const X=Rl(w);X==null||X.focus()}else{var ne;(ne=v.afterOutsideRef.current)==null||ne.focus()}}})]})}let Tr=0;const Ws="--floating-ui-scrollbar-width";function _d(){const e=bl(),t=/iP(hone|ad|od)|iOS/.test(e)||e==="MacIntel"&&navigator.maxTouchPoints>1,n=document.body.style,o=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",i=window.innerWidth-document.documentElement.clientWidth,s=n.left?parseFloat(n.left):window.scrollX,a=n.top?parseFloat(n.top):window.scrollY;if(n.overflow="hidden",n.setProperty(Ws,i+"px"),i&&(n[o]=i+"px"),t){var l,c;const d=((l=window.visualViewport)==null?void 0:l.offsetLeft)||0,h=((c=window.visualViewport)==null?void 0:c.offsetTop)||0;Object.assign(n,{position:"fixed",top:-(a-Math.floor(h))+"px",left:-(s-Math.floor(d))+"px",right:"0"})}return()=>{Object.assign(n,{overflow:"",[o]:""}),n.removeProperty(Ws),t&&(Object.assign(n,{position:"",top:"",left:"",right:""}),window.scrollTo(s,a))}}let Us=()=>{};const Qd=I.forwardRef(function(t,n){const{lockScroll:r=!1,...o}=t;return De(()=>{if(r)return Tr++,Tr===1&&(Us=_d()),()=>{Tr--,Tr===0&&Us()}},[r]),L.jsx("div",{ref:n,...o,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}})});function Vs(e){return be(e.target)&&e.target.tagName==="BUTTON"}function Kd(e){return be(e.target)&&e.target.tagName==="A"}function qs(e){return wl(e)}function jl(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:s=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:d=!0,stickIfOpen:h=!0}=t,m=I.useRef(),f=I.useRef(!1),x=I.useMemo(()=>({onPointerDown(b){m.current=b.pointerType},onMouseDown(b){const R=m.current;b.button===0&&a!=="click"&&(Ss(R)&&c||(n&&l&&(!(o.current.openEvent&&h)||o.current.openEvent.type==="mousedown")?r(!1,b.nativeEvent,"click"):(b.preventDefault(),r(!0,b.nativeEvent,"click"))))},onClick(b){const R=m.current;if(a==="mousedown"&&m.current){m.current=void 0;return}Ss(R)&&c||(n&&l&&(!(o.current.openEvent&&h)||o.current.openEvent.type==="click")?r(!1,b.nativeEvent,"click"):r(!0,b.nativeEvent,"click"))},onKeyDown(b){m.current=void 0,!(b.defaultPrevented||!d||Vs(b))&&(b.key===" "&&!qs(i)&&(b.preventDefault(),f.current=!0),!Kd(b)&&b.key==="Enter"&&r(!(n&&l),b.nativeEvent,"click"))},onKeyUp(b){b.defaultPrevented||!d||Vs(b)||qs(i)||b.key===" "&&f.current&&(f.current=!1,r(!(n&&l),b.nativeEvent,"click"))}}),[o,i,a,c,d,r,n,h,l]);return I.useMemo(()=>s?{reference:x}:{},[s,x])}const Yd={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Xd={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},zs=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function Bl(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:d=!1,referencePressEvent:h="pointerdown",ancestorScroll:m=!1,bubbles:f,capture:x}=t,b=Bi(),R=st(typeof l=="function"?l:()=>!1),$=typeof l=="function"?R:l,w=I.useRef(!1),{escapeKey:T,outsidePress:N}=zs(f),{escapeKey:D,outsidePress:j}=zs(x),W=I.useRef(!1),u=I.useRef(-1),p=st(v=>{var E;if(!n||!s||!a||v.key!=="Escape"||W.current)return;const F=(E=i.current.floatingContext)==null?void 0:E.nodeId,y=b?Rn(b.nodesRef.current,F):[];if(!T&&(v.stopPropagation(),y.length>0)){let M=!0;if(y.forEach(B=>{var V;if((V=B.context)!=null&&V.open&&!B.context.dataRef.current.__escapeKeyBubbles){M=!1;return}}),!M)return}r(!1,Bf(v)?v.nativeEvent:v,"escape-key")}),g=st(v=>{var E;const F=()=>{var y;p(v),(y=Tt(v))==null||y.removeEventListener("keydown",F)};(E=Tt(v))==null||E.addEventListener("keydown",F)}),C=st(v=>{var E;const F=i.current.insideReactTree;i.current.insideReactTree=!1;const y=w.current;if(w.current=!1,c==="click"&&y||F||typeof $=="function"&&!$(v))return;const M=Tt(v),B="["+rr("inert")+"]",V=Ke(o.floating).querySelectorAll(B);let H=de(M)?M:null;for(;H&&!wt(H);){const Y=Et(H);if(wt(Y)||!de(Y))break;H=Y}if(V.length&&de(M)&&!jf(M)&&!Ie(M,o.floating)&&Array.from(V).every(Y=>!Ie(H,Y)))return;if(be(M)&&k){const Y=wt(M),U=ze(M),ae=/auto|scroll/,ge=Y||ae.test(U.overflowX),Ee=Y||ae.test(U.overflowY),Q=ge&&M.clientWidth>0&&M.scrollWidth>M.clientWidth,ne=Ee&&M.clientHeight>0&&M.scrollHeight>M.clientHeight,X=U.direction==="rtl",K=ne&&(X?v.offsetX<=M.offsetWidth-M.clientWidth:v.offsetX>M.clientWidth),re=Q&&v.offsetY>M.clientHeight;if(K||re)return}const _=(E=i.current.floatingContext)==null?void 0:E.nodeId,ee=b&&Rn(b.nodesRef.current,_).some(Y=>{var U;return Co(v,(U=Y.context)==null?void 0:U.elements.floating)});if(Co(v,o.floating)||Co(v,o.domReference)||ee)return;const Z=b?Rn(b.nodesRef.current,_):[];if(Z.length>0){let Y=!0;if(Z.forEach(U=>{var ae;if((ae=U.context)!=null&&ae.open&&!U.context.dataRef.current.__outsidePressBubbles){Y=!1;return}}),!Y)return}r(!1,v,"outside-press")}),S=st(v=>{var E;const F=()=>{var y;C(v),(y=Tt(v))==null||y.removeEventListener(c,F)};(E=Tt(v))==null||E.addEventListener(c,F)});I.useEffect(()=>{if(!n||!s)return;i.current.__escapeKeyBubbles=T,i.current.__outsidePressBubbles=N;let v=-1;function E(V){r(!1,V,"ancestor-scroll")}function F(){window.clearTimeout(v),W.current=!0}function y(){v=window.setTimeout(()=>{W.current=!1},oo()?5:0)}const M=Ke(o.floating);a&&(M.addEventListener("keydown",D?g:p,D),M.addEventListener("compositionstart",F),M.addEventListener("compositionend",y)),$&&M.addEventListener(c,j?S:C,j);let B=[];return m&&(de(o.domReference)&&(B=Ht(o.domReference)),de(o.floating)&&(B=B.concat(Ht(o.floating))),!de(o.reference)&&o.reference&&o.reference.contextElement&&(B=B.concat(Ht(o.reference.contextElement)))),B=B.filter(V=>{var H;return V!==((H=M.defaultView)==null?void 0:H.visualViewport)}),B.forEach(V=>{V.addEventListener("scroll",E,{passive:!0})}),()=>{a&&(M.removeEventListener("keydown",D?g:p,D),M.removeEventListener("compositionstart",F),M.removeEventListener("compositionend",y)),$&&M.removeEventListener(c,j?S:C,j),B.forEach(V=>{V.removeEventListener("scroll",E)}),window.clearTimeout(v)}},[i,o,a,$,c,n,r,m,s,T,N,p,D,g,C,j,S]),I.useEffect(()=>{i.current.insideReactTree=!1},[i,$,c]);const A=I.useMemo(()=>({onKeyDown:p,...d&&{[Yd[h]]:v=>{r(!1,v.nativeEvent,"reference-press")},...h!=="click"&&{onClick(v){r(!1,v.nativeEvent,"reference-press")}}}}),[p,r,d,h]),k=I.useMemo(()=>({onKeyDown:p,onMouseDown(){w.current=!0},onMouseUp(){w.current=!0},[Xd[c]]:()=>{i.current.insideReactTree=!0},onBlurCapture(){b||(Ld(u),i.current.insideReactTree=!0,u.current=window.setTimeout(()=>{i.current.insideReactTree=!1}))}}),[p,c,i,b]);return I.useMemo(()=>s?{reference:A,floating:k}:{},[s,A,k])}function Jd(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Wn(),i=I.useRef({}),[s]=I.useState(()=>Id()),a=$l()!=null;if(process.env.NODE_ENV!=="production"){const f=r.reference;f&&!de(f)&&Md("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=I.useState(r.reference),d=st((f,x,b)=>{i.current.openEvent=f?x:void 0,s.emit("openchange",{open:f,event:x,reason:b,nested:a}),n==null||n(f,x,b)}),h=I.useMemo(()=>({setPositionReference:c}),[]),m=I.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return I.useMemo(()=>({dataRef:i,open:t,onOpenChange:d,elements:m,events:s,floatingId:o,refs:h}),[t,d,m,s,o,h])}function Hl(e){e===void 0&&(e={});const{nodeId:t}=e,n=Jd({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=I.useState(null),[a,l]=I.useState(null),d=(o==null?void 0:o.domReference)||i,h=I.useRef(null),m=Bi();De(()=>{d&&(h.current=d)},[d]);const f=Rd({...e,elements:{...o,...a&&{reference:a}}}),x=I.useCallback(T=>{const N=de(T)?{getBoundingClientRect:()=>T.getBoundingClientRect(),getClientRects:()=>T.getClientRects(),contextElement:T}:T;l(N),f.refs.setReference(N)},[f.refs]),b=I.useCallback(T=>{(de(T)||T===null)&&(h.current=T,s(T)),(de(f.refs.reference.current)||f.refs.reference.current===null||T!==null&&!de(T))&&f.refs.setReference(T)},[f.refs]),R=I.useMemo(()=>({...f.refs,setReference:b,setPositionReference:x,domReference:h}),[f.refs,b,x]),$=I.useMemo(()=>({...f.elements,domReference:d}),[f.elements,d]),w=I.useMemo(()=>({...f,...r,refs:R,elements:$,nodeId:t}),[f,R,$,t,r]);return De(()=>{r.dataRef.current.floatingContext=w;const T=m==null?void 0:m.nodesRef.current.find(N=>N.id===t);T&&(T.context=w)}),I.useMemo(()=>({...f,context:w,refs:R,elements:$}),[f,R,$,w])}function Po(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[Fs]:s,[Ps]:a,...l}=e;i=l}return{...n==="floating"&&{tabIndex:-1,[kd]:""},...i,...t.map(s=>{const a=s?s[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((s,a)=>(a&&Object.entries(a).forEach(l=>{let[c,d]=l;if(!(o&&[Fs,Ps].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof d=="function"){var h;(h=r.get(c))==null||h.push(d),s[c]=function(){for(var m,f=arguments.length,x=new Array(f),b=0;b<f;b++)x[b]=arguments[b];return(m=r.get(c))==null?void 0:m.map(R=>R(...x)).find(R=>R!==void 0)}}}else s[c]=d}),s),{})}}function Wl(e){e===void 0&&(e=[]);const t=e.map(a=>a==null?void 0:a.reference),n=e.map(a=>a==null?void 0:a.floating),r=e.map(a=>a==null?void 0:a.item),o=I.useCallback(a=>Po(a,e,"reference"),t),i=I.useCallback(a=>Po(a,e,"floating"),n),s=I.useCallback(a=>Po(a,e,"item"),r);return I.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s}),[o,i,s])}const Zd=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function eh(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:i,floatingId:s}=e,{enabled:a=!0,role:l="dialog"}=t,c=Wn(),d=((n=i.domReference)==null?void 0:n.id)||c,h=I.useMemo(()=>{var w;return((w=oi(i.floating))==null?void 0:w.id)||s},[i.floating,s]),m=(r=Zd.get(l))!=null?r:l,x=$l()!=null,b=I.useMemo(()=>m==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:o?h:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":m==="alertdialog"?"dialog":m,"aria-controls":o?h:void 0,...m==="listbox"&&{role:"combobox"},...m==="menu"&&{id:d},...m==="menu"&&x&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[m,h,x,o,d,l]),R=I.useMemo(()=>{const w={id:h,...m&&{role:m}};return m==="tooltip"||l==="label"?w:{...w,...m==="menu"&&{"aria-labelledby":d}}},[m,h,d,l]),$=I.useCallback(w=>{let{active:T,selected:N}=w;const D={role:"option",...T&&{id:h+"-fui-option"}};switch(l){case"select":return{...D,"aria-selected":T&&N};case"combobox":return{...D,"aria-selected":N}}return{}},[h,l]);return I.useMemo(()=>a?{reference:b,floating:R,item:$}:{},[a,b,R,$])}var gr=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(){}},dn=typeof window>"u"||"Deno"in globalThis;function $e(){}function th(e,t){return typeof e=="function"?e(t):e}function si(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ul(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Wt(e,t){return typeof e=="function"?e(t):e}function Ye(e,t){return typeof e=="function"?e(t):e}function Gs(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==Hi(s,t.options))return!1}else if(!ir(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||i&&!i(t))}function _s(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(or(t.options.mutationKey)!==or(i))return!1}else if(!ir(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Hi(e,t){return((t==null?void 0:t.queryKeyHashFn)||or)(e)}function or(e){return JSON.stringify(e,(t,n)=>ci(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function ir(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>ir(e[n],t[n])):!1}function ai(e,t){if(e===t)return e;const n=Qs(e)&&Qs(t);if(n||ci(e)&&ci(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{},l=new Set(r);let c=0;for(let d=0;d<s;d++){const h=n?d:i[d];(!n&&l.has(h)||n)&&e[h]===void 0&&t[h]===void 0?(a[h]=void 0,c++):(a[h]=ai(e[h],t[h]),a[h]===e[h]&&e[h]!==void 0&&c++)}return o===s&&c===o?e:a}return t}function li(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 Qs(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ci(e){if(!Ks(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Ks(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Ks(e){return Object.prototype.toString.call(e)==="[object Object]"}function nh(e){return new Promise(t=>{setTimeout(t,e)})}function ui(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return ai(e,t)}catch(r){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`),r}return ai(e,t)}return t}function rh(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function oh(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Kr=Symbol();function Vl(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Kr&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Kr?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ih(e,t){return typeof e=="function"?e(...t):!!e}var Jt,Ft,An,Ba,sh=(Ba=class extends gr{constructor(){super();J(this,Jt);J(this,Ft);J(this,An);q(this,An,t=>{if(!dn&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){P(this,Ft)||this.setEventListener(P(this,An))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,Ft))==null||t.call(this),q(this,Ft,void 0))}setEventListener(t){var n;q(this,An,t),(n=P(this,Ft))==null||n.call(this),q(this,Ft,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){P(this,Jt)!==t&&(q(this,Jt,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof P(this,Jt)=="boolean"?P(this,Jt):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Jt=new WeakMap,Ft=new WeakMap,An=new WeakMap,Ba),Wi=new sh,kn,Pt,Tn,Ha,ah=(Ha=class extends gr{constructor(){super();J(this,kn,!0);J(this,Pt);J(this,Tn);q(this,Tn,t=>{if(!dn&&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(){P(this,Pt)||this.setEventListener(P(this,Tn))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,Pt))==null||t.call(this),q(this,Pt,void 0))}setEventListener(t){var n;q(this,Tn,t),(n=P(this,Pt))==null||n.call(this),q(this,Pt,t(this.setOnline.bind(this)))}setOnline(t){P(this,kn)!==t&&(q(this,kn,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return P(this,kn)}},kn=new WeakMap,Pt=new WeakMap,Tn=new WeakMap,Ha),Yr=new ah;function fi(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});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}function lh(e){return Math.min(1e3*2**e,3e4)}function ql(e){return(e??"online")==="online"?Yr.isOnline():!0}var zl=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function $o(e){return e instanceof zl}function Gl(e){let t=!1,n=0,r=!1,o;const i=fi(),s=b=>{var R;r||(m(new zl(b)),(R=e.abort)==null||R.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>Wi.isFocused()&&(e.networkMode==="always"||Yr.isOnline())&&e.canRun(),d=()=>ql(e.networkMode)&&e.canRun(),h=b=>{var R;r||(r=!0,(R=e.onSuccess)==null||R.call(e,b),o==null||o(),i.resolve(b))},m=b=>{var R;r||(r=!0,(R=e.onError)==null||R.call(e,b),o==null||o(),i.reject(b))},f=()=>new Promise(b=>{var R;o=$=>{(r||c())&&b($)},(R=e.onPause)==null||R.call(e)}).then(()=>{var b;o=void 0,r||(b=e.onContinue)==null||b.call(e)}),x=()=>{if(r)return;let b;const R=n===0?e.initialPromise:void 0;try{b=R??e.fn()}catch($){b=Promise.reject($)}Promise.resolve(b).then(h).catch($=>{var j;if(r)return;const w=e.retry??(dn?0:3),T=e.retryDelay??lh,N=typeof T=="function"?T(n,$):T,D=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,$);if(t||!D){m($);return}n++,(j=e.onFail)==null||j.call(e,n,$),nh(N).then(()=>c()?void 0:f()).then(()=>{t?m($):x()})})};return{promise:i,cancel:s,continue:()=>(o==null||o(),i),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?x():f().then(x),i)}}var ch=e=>setTimeout(e,0);function uh(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=ch;const i=a=>{t?e.push(a):o(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||s()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var Se=uh(),Zt,Wa,_l=(Wa=class{constructor(){J(this,Zt)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),si(this.gcTime)&&q(this,Zt,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(dn?1/0:5*60*1e3))}clearGcTimeout(){P(this,Zt)&&(clearTimeout(P(this,Zt)),q(this,Zt,void 0))}},Zt=new WeakMap,Wa),Fn,en,Ue,tn,Ce,ur,nn,_e,bt,Ua,fh=(Ua=class extends _l{constructor(t){super();J(this,_e);J(this,Fn);J(this,en);J(this,Ue);J(this,tn);J(this,Ce);J(this,ur);J(this,nn);q(this,nn,!1),q(this,ur,t.defaultOptions),this.setOptions(t.options),this.observers=[],q(this,tn,t.client),q(this,Ue,P(this,tn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,q(this,Fn,dh(this.options)),this.state=t.state??P(this,Fn),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=P(this,Ce))==null?void 0:t.promise}setOptions(t){this.options={...P(this,ur),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&P(this,Ue).remove(this)}setData(t,n){const r=ui(this.state.data,t,this.options);return ie(this,_e,bt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){ie(this,_e,bt).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=P(this,Ce))==null?void 0:r.promise;return(o=P(this,Ce))==null||o.cancel(t),n?n.then($e).catch($e):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(P(this,Fn))}isActive(){return this.observers.some(t=>Ye(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Kr||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Wt(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:!Ul(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=P(this,Ce))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=P(this,Ce))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),P(this,Ue).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(P(this,Ce)&&(P(this,nn)?P(this,Ce).cancel({revert:!0}):P(this,Ce).cancelRetry()),this.scheduleGc()),P(this,Ue).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ie(this,_e,bt).call(this,{type:"invalidate"})}fetch(t,n){var c,d,h;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(P(this,Ce))return P(this,Ce).continueRetry(),P(this,Ce).promise}if(t&&this.setOptions(t),!this.options.queryFn){const m=this.observers.find(f=>f.options.queryFn);m&&this.setOptions(m.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(q(this,nn,!0),r.signal)})},i=()=>{const m=Vl(this.options,n),x=(()=>{const b={client:P(this,tn),queryKey:this.queryKey,meta:this.meta};return o(b),b})();return q(this,nn,!1),this.options.persister?this.options.persister(m,x,this):m(x)},a=(()=>{const m={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:P(this,tn),state:this.state,fetchFn:i};return o(m),m})();(c=this.options.behavior)==null||c.onFetch(a,this),q(this,en,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=a.fetchOptions)==null?void 0:d.meta))&&ie(this,_e,bt).call(this,{type:"fetch",meta:(h=a.fetchOptions)==null?void 0:h.meta});const l=m=>{var f,x,b,R;$o(m)&&m.silent||ie(this,_e,bt).call(this,{type:"error",error:m}),$o(m)||((x=(f=P(this,Ue).config).onError)==null||x.call(f,m,this),(R=(b=P(this,Ue).config).onSettled)==null||R.call(b,this.state.data,m,this)),this.scheduleGc()};return q(this,Ce,Gl({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:m=>{var f,x,b,R;if(m===void 0){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(m)}catch($){l($);return}(x=(f=P(this,Ue).config).onSuccess)==null||x.call(f,m,this),(R=(b=P(this,Ue).config).onSettled)==null||R.call(b,m,this.state.error,this),this.scheduleGc()},onError:l,onFail:(m,f)=>{ie(this,_e,bt).call(this,{type:"failed",failureCount:m,error:f})},onPause:()=>{ie(this,_e,bt).call(this,{type:"pause"})},onContinue:()=>{ie(this,_e,bt).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),P(this,Ce).start()}},Fn=new WeakMap,en=new WeakMap,Ue=new WeakMap,tn=new WeakMap,Ce=new WeakMap,ur=new WeakMap,nn=new WeakMap,_e=new WeakSet,bt=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,...Ql(r.data,this.options),fetchMeta:t.meta??null};case"success":return q(this,en,void 0),{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return $o(o)&&o.revert&&P(this,en)?{...P(this,en),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Se.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),P(this,Ue).notify({query:this,type:"updated",action:t})})},Ua);function Ql(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ql(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function dh(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 rt,Va,hh=(Va=class extends gr{constructor(t={}){super();J(this,rt);this.config=t,q(this,rt,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??Hi(o,n);let s=this.get(i);return s||(s=new fh({client:t,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){P(this,rt).has(t.queryHash)||(P(this,rt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=P(this,rt).get(t.queryHash);n&&(t.destroy(),n===t&&P(this,rt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Se.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return P(this,rt).get(t)}getAll(){return[...P(this,rt).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Gs(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Gs(t,r)):n}notify(t){Se.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Se.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Se.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},rt=new WeakMap,Va),ot,ke,rn,it,kt,qa,ph=(qa=class extends _l{constructor(t){super();J(this,it);J(this,ot);J(this,ke);J(this,rn);this.mutationId=t.mutationId,q(this,ke,t.mutationCache),q(this,ot,[]),this.state=t.state||mh(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){P(this,ot).includes(t)||(P(this,ot).push(t),this.clearGcTimeout(),P(this,ke).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){q(this,ot,P(this,ot).filter(n=>n!==t)),this.scheduleGc(),P(this,ke).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){P(this,ot).length||(this.state.status==="pending"?this.scheduleGc():P(this,ke).remove(this))}continue(){var t;return((t=P(this,rn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,a,l,c,d,h,m,f,x,b,R,$,w,T,N,D,j,W,u;const n=()=>{ie(this,it,kt).call(this,{type:"continue"})};q(this,rn,Gl({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(p,g)=>{ie(this,it,kt).call(this,{type:"failed",failureCount:p,error:g})},onPause:()=>{ie(this,it,kt).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>P(this,ke).canRun(this)}));const r=this.state.status==="pending",o=!P(this,rn).canStart();try{if(r)n();else{ie(this,it,kt).call(this,{type:"pending",variables:t,isPaused:o}),await((s=(i=P(this,ke).config).onMutate)==null?void 0:s.call(i,t,this));const g=await((l=(a=this.options).onMutate)==null?void 0:l.call(a,t));g!==this.state.context&&ie(this,it,kt).call(this,{type:"pending",context:g,variables:t,isPaused:o})}const p=await P(this,rn).start();return await((d=(c=P(this,ke).config).onSuccess)==null?void 0:d.call(c,p,t,this.state.context,this)),await((m=(h=this.options).onSuccess)==null?void 0:m.call(h,p,t,this.state.context)),await((x=(f=P(this,ke).config).onSettled)==null?void 0:x.call(f,p,null,this.state.variables,this.state.context,this)),await((R=(b=this.options).onSettled)==null?void 0:R.call(b,p,null,t,this.state.context)),ie(this,it,kt).call(this,{type:"success",data:p}),p}catch(p){try{throw await((w=($=P(this,ke).config).onError)==null?void 0:w.call($,p,t,this.state.context,this)),await((N=(T=this.options).onError)==null?void 0:N.call(T,p,t,this.state.context)),await((j=(D=P(this,ke).config).onSettled)==null?void 0:j.call(D,void 0,p,this.state.variables,this.state.context,this)),await((u=(W=this.options).onSettled)==null?void 0:u.call(W,void 0,p,t,this.state.context)),p}finally{ie(this,it,kt).call(this,{type:"error",error:p})}}finally{P(this,ke).runNext(this)}}},ot=new WeakMap,ke=new WeakMap,rn=new WeakMap,it=new WeakSet,kt=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),Se.batch(()=>{P(this,ot).forEach(r=>{r.onMutationUpdate(t)}),P(this,ke).notify({mutation:this,type:"updated",action:t})})},qa);function mh(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var yt,Qe,fr,za,gh=(za=class extends gr{constructor(t={}){super();J(this,yt);J(this,Qe);J(this,fr);this.config=t,q(this,yt,new Set),q(this,Qe,new Map),q(this,fr,0)}build(t,n,r){const o=new ph({mutationCache:this,mutationId:++Rr(this,fr)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){P(this,yt).add(t);const n=Fr(t);if(typeof n=="string"){const r=P(this,Qe).get(n);r?r.push(t):P(this,Qe).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(P(this,yt).delete(t)){const n=Fr(t);if(typeof n=="string"){const r=P(this,Qe).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&P(this,Qe).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Fr(t);if(typeof n=="string"){const r=P(this,Qe).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=Fr(t);if(typeof n=="string"){const o=(r=P(this,Qe).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Se.batch(()=>{P(this,yt).forEach(t=>{this.notify({type:"removed",mutation:t})}),P(this,yt).clear(),P(this,Qe).clear()})}getAll(){return Array.from(P(this,yt))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>_s(n,r))}findAll(t={}){return this.getAll().filter(n=>_s(t,n))}notify(t){Se.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Se.batch(()=>Promise.all(t.map(n=>n.continue().catch($e))))}},yt=new WeakMap,Qe=new WeakMap,fr=new WeakMap,za);function Fr(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Ys(e){return{onFetch:(t,n)=>{var d,h,m,f,x;const r=t.options,o=(m=(h=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:h.fetchMore)==null?void 0:m.direction,i=((f=t.state.data)==null?void 0:f.pages)||[],s=((x=t.state.data)==null?void 0:x.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let b=!1;const R=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(t.signal.aborted?b=!0:t.signal.addEventListener("abort",()=>{b=!0}),t.signal)})},$=Vl(t.options,t.fetchOptions),w=async(T,N,D)=>{if(b)return Promise.reject();if(N==null&&T.pages.length)return Promise.resolve(T);const W=(()=>{const C={client:t.client,queryKey:t.queryKey,pageParam:N,direction:D?"backward":"forward",meta:t.options.meta};return R(C),C})(),u=await $(W),{maxPages:p}=t.options,g=D?oh:rh;return{pages:g(T.pages,u,p),pageParams:g(T.pageParams,N,p)}};if(o&&i.length){const T=o==="backward",N=T?vh:Xs,D={pages:i,pageParams:s},j=N(r,D);a=await w(D,j,T)}else{const T=e??i.length;do{const N=l===0?s[0]??r.initialPageParam:Xs(r,a);if(l>0&&N==null)break;a=await w(a,N),l++}while(l<T)}return a};t.options.persister?t.fetchFn=()=>{var b,R;return(R=(b=t.options).persister)==null?void 0:R.call(b,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Xs(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 vh(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 pe,$t,Mt,Pn,$n,It,Mn,In,Ga,bh=(Ga=class{constructor(e={}){J(this,pe);J(this,$t);J(this,Mt);J(this,Pn);J(this,$n);J(this,It);J(this,Mn);J(this,In);q(this,pe,e.queryCache||new hh),q(this,$t,e.mutationCache||new gh),q(this,Mt,e.defaultOptions||{}),q(this,Pn,new Map),q(this,$n,new Map),q(this,It,0)}mount(){Rr(this,It)._++,P(this,It)===1&&(q(this,Mn,Wi.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,pe).onFocus())})),q(this,In,Yr.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,pe).onOnline())})))}unmount(){var e,t;Rr(this,It)._--,P(this,It)===0&&((e=P(this,Mn))==null||e.call(this),q(this,Mn,void 0),(t=P(this,In))==null||t.call(this),q(this,In,void 0))}isFetching(e){return P(this,pe).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return P(this,$t).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=P(this,pe).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=P(this,pe).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Wt(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return P(this,pe).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=P(this,pe).get(r.queryHash),i=o==null?void 0:o.state.data,s=th(t,i);if(s!==void 0)return P(this,pe).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return Se.batch(()=>P(this,pe).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=P(this,pe).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=P(this,pe);Se.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=P(this,pe);return Se.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Se.batch(()=>P(this,pe).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then($e).catch($e)}invalidateQueries(e,t={}){return Se.batch(()=>(P(this,pe).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=Se.batch(()=>P(this,pe).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch($e)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then($e)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=P(this,pe).build(this,t);return n.isStaleByTime(Wt(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then($e).catch($e)}fetchInfiniteQuery(e){return e.behavior=Ys(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then($e).catch($e)}ensureInfiniteQueryData(e){return e.behavior=Ys(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Yr.isOnline()?P(this,$t).resumePausedMutations():Promise.resolve()}getQueryCache(){return P(this,pe)}getMutationCache(){return P(this,$t)}getDefaultOptions(){return P(this,Mt)}setDefaultOptions(e){q(this,Mt,e)}setQueryDefaults(e,t){P(this,Pn).set(or(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...P(this,Pn).values()],n={};return t.forEach(r=>{ir(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){P(this,$n).set(or(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...P(this,$n).values()],n={};return t.forEach(r=>{ir(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...P(this,Mt).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Hi(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===Kr&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...P(this,Mt).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){P(this,pe).clear(),P(this,$t).clear()}},pe=new WeakMap,$t=new WeakMap,Mt=new WeakMap,Pn=new WeakMap,$n=new WeakMap,It=new WeakMap,Mn=new WeakMap,In=new WeakMap,Ga),Pe,se,dr,Te,on,Dn,Dt,Nt,hr,Nn,Ln,sn,an,Lt,jn,le,Yn,di,hi,pi,mi,gi,vi,bi,Kl,_a,yh=(_a=class extends gr{constructor(t,n){super();J(this,le);J(this,Pe);J(this,se);J(this,dr);J(this,Te);J(this,on);J(this,Dn);J(this,Dt);J(this,Nt);J(this,hr);J(this,Nn);J(this,Ln);J(this,sn);J(this,an);J(this,Lt);J(this,jn,new Set);this.options=n,q(this,Pe,t),q(this,Nt,null),q(this,Dt,fi()),this.options.experimental_prefetchInRender||P(this,Dt).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(P(this,se).addObserver(this),Js(P(this,se),this.options)?ie(this,le,Yn).call(this):this.updateResult(),ie(this,le,mi).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return yi(P(this,se),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return yi(P(this,se),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ie(this,le,gi).call(this),ie(this,le,vi).call(this),P(this,se).removeObserver(this)}setOptions(t){const n=this.options,r=P(this,se);if(this.options=P(this,Pe).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ye(this.options.enabled,P(this,se))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ie(this,le,bi).call(this),P(this,se).setOptions(this.options),n._defaulted&&!li(this.options,n)&&P(this,Pe).getQueryCache().notify({type:"observerOptionsUpdated",query:P(this,se),observer:this});const o=this.hasListeners();o&&Zs(P(this,se),r,this.options,n)&&ie(this,le,Yn).call(this),this.updateResult(),o&&(P(this,se)!==r||Ye(this.options.enabled,P(this,se))!==Ye(n.enabled,P(this,se))||Wt(this.options.staleTime,P(this,se))!==Wt(n.staleTime,P(this,se)))&&ie(this,le,di).call(this);const i=ie(this,le,hi).call(this);o&&(P(this,se)!==r||Ye(this.options.enabled,P(this,se))!==Ye(n.enabled,P(this,se))||i!==P(this,Lt))&&ie(this,le,pi).call(this,i)}getOptimisticResult(t){const n=P(this,Pe).getQueryCache().build(P(this,Pe),t),r=this.createResult(n,t);return xh(this,r)&&(q(this,Te,r),q(this,Dn,this.options),q(this,on,P(this,se).state)),r}getCurrentResult(){return P(this,Te)}trackResult(t,n){return new Proxy(t,{get:(r,o)=>(this.trackProp(o),n==null||n(o),Reflect.get(r,o))})}trackProp(t){P(this,jn).add(t)}getCurrentQuery(){return P(this,se)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=P(this,Pe).defaultQueryOptions(t),r=P(this,Pe).getQueryCache().build(P(this,Pe),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ie(this,le,Yn).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),P(this,Te)))}createResult(t,n){var p;const r=P(this,se),o=this.options,i=P(this,Te),s=P(this,on),a=P(this,Dn),c=t!==r?t.state:P(this,dr),{state:d}=t;let h={...d},m=!1,f;if(n._optimisticResults){const g=this.hasListeners(),C=!g&&Js(t,n),S=g&&Zs(t,r,n,o);(C||S)&&(h={...h,...Ql(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:x,errorUpdatedAt:b,status:R}=h;f=h.data;let $=!1;if(n.placeholderData!==void 0&&f===void 0&&R==="pending"){let g;i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(g=i.data,$=!0):g=typeof n.placeholderData=="function"?n.placeholderData((p=P(this,Ln))==null?void 0:p.state.data,P(this,Ln)):n.placeholderData,g!==void 0&&(R="success",f=ui(i==null?void 0:i.data,g,n),m=!0)}if(n.select&&f!==void 0&&!$)if(i&&f===(s==null?void 0:s.data)&&n.select===P(this,hr))f=P(this,Nn);else try{q(this,hr,n.select),f=n.select(f),f=ui(i==null?void 0:i.data,f,n),q(this,Nn,f),q(this,Nt,null)}catch(g){q(this,Nt,g)}P(this,Nt)&&(x=P(this,Nt),f=P(this,Nn),b=Date.now(),R="error");const w=h.fetchStatus==="fetching",T=R==="pending",N=R==="error",D=T&&w,j=f!==void 0,u={status:R,fetchStatus:h.fetchStatus,isPending:T,isSuccess:R==="success",isError:N,isInitialLoading:D,isLoading:D,data:f,dataUpdatedAt:h.dataUpdatedAt,error:x,errorUpdatedAt:b,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>c.dataUpdateCount||h.errorUpdateCount>c.errorUpdateCount,isFetching:w,isRefetching:w&&!T,isLoadingError:N&&!j,isPaused:h.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:N&&j,isStale:Ui(t,n),refetch:this.refetch,promise:P(this,Dt)};if(this.options.experimental_prefetchInRender){const g=A=>{u.status==="error"?A.reject(u.error):u.data!==void 0&&A.resolve(u.data)},C=()=>{const A=q(this,Dt,u.promise=fi());g(A)},S=P(this,Dt);switch(S.status){case"pending":t.queryHash===r.queryHash&&g(S);break;case"fulfilled":(u.status==="error"||u.data!==S.value)&&C();break;case"rejected":(u.status!=="error"||u.error!==S.reason)&&C();break}}return u}updateResult(){const t=P(this,Te),n=this.createResult(P(this,se),this.options);if(q(this,on,P(this,se).state),q(this,Dn,this.options),P(this,on).data!==void 0&&q(this,Ln,P(this,se)),li(n,t))return;q(this,Te,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,i=typeof o=="function"?o():o;if(i==="all"||!i&&!P(this,jn).size)return!0;const s=new Set(i??P(this,jn));return this.options.throwOnError&&s.add("error"),Object.keys(P(this,Te)).some(a=>{const l=a;return P(this,Te)[l]!==t[l]&&s.has(l)})};ie(this,le,Kl).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ie(this,le,mi).call(this)}},Pe=new WeakMap,se=new WeakMap,dr=new WeakMap,Te=new WeakMap,on=new WeakMap,Dn=new WeakMap,Dt=new WeakMap,Nt=new WeakMap,hr=new WeakMap,Nn=new WeakMap,Ln=new WeakMap,sn=new WeakMap,an=new WeakMap,Lt=new WeakMap,jn=new WeakMap,le=new WeakSet,Yn=function(t){ie(this,le,bi).call(this);let n=P(this,se).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch($e)),n},di=function(){ie(this,le,gi).call(this);const t=Wt(this.options.staleTime,P(this,se));if(dn||P(this,Te).isStale||!si(t))return;const r=Ul(P(this,Te).dataUpdatedAt,t)+1;q(this,sn,setTimeout(()=>{P(this,Te).isStale||this.updateResult()},r))},hi=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(P(this,se)):this.options.refetchInterval)??!1},pi=function(t){ie(this,le,vi).call(this),q(this,Lt,t),!(dn||Ye(this.options.enabled,P(this,se))===!1||!si(P(this,Lt))||P(this,Lt)===0)&&q(this,an,setInterval(()=>{(this.options.refetchIntervalInBackground||Wi.isFocused())&&ie(this,le,Yn).call(this)},P(this,Lt)))},mi=function(){ie(this,le,di).call(this),ie(this,le,pi).call(this,ie(this,le,hi).call(this))},gi=function(){P(this,sn)&&(clearTimeout(P(this,sn)),q(this,sn,void 0))},vi=function(){P(this,an)&&(clearInterval(P(this,an)),q(this,an,void 0))},bi=function(){const t=P(this,Pe).getQueryCache().build(P(this,Pe),this.options);if(t===P(this,se))return;const n=P(this,se);q(this,se,t),q(this,dr,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Kl=function(t){Se.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(P(this,Te))}),P(this,Pe).getQueryCache().notify({query:P(this,se),type:"observerResultsUpdated"})})},_a);function wh(e,t){return Ye(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Js(e,t){return wh(e,t)||e.state.data!==void 0&&yi(e,t,t.refetchOnMount)}function yi(e,t,n){if(Ye(t.enabled,e)!==!1&&Wt(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Ui(e,t)}return!1}function Zs(e,t,n,r){return(e!==t||Ye(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Ui(e,n)}function Ui(e,t){return Ye(t.enabled,e)!==!1&&e.isStaleByTime(Wt(t.staleTime,e))}function xh(e,t){return!li(e.getCurrentResult(),t)}var Yl=I.createContext(void 0),Xl=e=>{const t=I.useContext(Yl);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Jl=({client:e,children:t})=>(I.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),L.jsx(Yl.Provider,{value:e,children:t})),Eh=I.createContext(!1),Rh=()=>I.useContext(Eh);function Sh(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ch=I.createContext(Sh()),Oh=()=>I.useContext(Ch),Ah=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},kh=e=>{I.useEffect(()=>{e.clearReset()},[e])},Th=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||ih(n,[e.error,r])),Fh=e=>{if(e.suspense){const t=r=>r==="static"?r:Math.max(r??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...r)=>t(n(...r)):t(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Ph=(e,t)=>e.isLoading&&e.isFetching&&!t,$h=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,ea=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Mh(e,t,n){var h,m,f,x,b;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=Rh(),o=Oh(),i=Xl(),s=i.defaultQueryOptions(e);(m=(h=i.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||m.call(h,s),process.env.NODE_ENV!=="production"&&(s.queryFn||console.error(`[${s.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),s._optimisticResults=r?"isRestoring":"optimistic",Fh(s),Ah(s,o),kh(o);const a=!i.getQueryCache().get(s.queryHash),[l]=I.useState(()=>new t(i,s)),c=l.getOptimisticResult(s),d=!r&&e.subscribed!==!1;if(I.useSyncExternalStore(I.useCallback(R=>{const $=d?l.subscribe(Se.batchCalls(R)):$e;return l.updateResult(),$},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),I.useEffect(()=>{l.setOptions(s)},[s,l]),$h(s,c))throw ea(s,l,o);if(Th({result:c,errorResetBoundary:o,throwOnError:s.throwOnError,query:i.getQueryCache().get(s.queryHash),suspense:s.suspense}))throw c.error;if((x=(f=i.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||x.call(f,s,c),s.experimental_prefetchInRender&&!dn&&Ph(c,r)){const R=a?ea(s,l,o):(b=i.getQueryCache().get(s.queryHash))==null?void 0:b.promise;R==null||R.catch($e).finally(()=>{l.updateResult()})}return s.notifyOnChangeProps?c:l.trackResult(c)}function Vi(e,t){return Mh(e,yh)}function Zl(e){const[t,n]=O.useState(()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");return O.useEffect(()=>{if(e!=="system")return;const r=window.matchMedia("(prefers-color-scheme: dark)");n(r.matches?"dark":"light");const o=i=>{n(i.matches?"dark":"light")};return r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[e]),e==="system"?t:e}const ta="wallet-ui-theme-styles",Ih=`
|
|
16
|
+
*/var bf=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],zr=bf.join(","),ll=typeof Element>"u",zn=ll?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,qr=!ll&&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},_r=function e(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"),s=o===""||o==="true",i=s||n&&t&&e(t.parentNode);return i},yf=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},cl=function(t,n,r){if(_r(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(zr));return n&&zn.call(t,zr)&&o.unshift(t),o=o.filter(r),o},ul=function e(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!_r(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),l=a.length?a:i.children,c=e(l,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:i,candidates:c})}else{var d=zn.call(i,zr);d&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var h=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),p=!_r(h,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(h&&p){var f=e(h===!0?i.children:h.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:i,candidates:f})}else s.unshift.apply(s,i.children)}}return o},fl=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},dl=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||yf(t))&&!fl(t)?0:t.tabIndex},wf=function(t,n){var r=dl(t);return r<0&&n&&!fl(t)?0:r},xf=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},hl=function(t){return t.tagName==="INPUT"},Ef=function(t){return hl(t)&&t.type==="hidden"},Rf=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},Sf=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},Cf=function(t){if(!t.name)return!0;var n=t.form||qr(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},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(i){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",i.message),!1}var s=Sf(o,t.form);return!s||s===t},Of=function(t){return hl(t)&&t.type==="radio"},Af=function(t){return Of(t)&&!Cf(t)},Tf=function(t){var n,r=t&&qr(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,a,l;for(s=!!((i=o)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!s&&o;){var c,d,h;r=qr(o),o=(c=r)===null||c===void 0?void 0:c.host,s=!!((d=o)!==null&&d!==void 0&&(h=d.ownerDocument)!==null&&h!==void 0&&h.contains(o))}}return s},ai=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},kf=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var s=zn.call(t,"details>summary:first-of-type"),i=s?t.parentElement:t;if(zn.call(i,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var a=t;t;){var l=t.parentElement,c=qr(t);if(l&&!l.shadowRoot&&o(l)===!0)return ai(t);t.assignedSlot?t=t.assignedSlot:!l&&c!==t.ownerDocument?t=c.host:t=l}t=a}if(Tf(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return ai(t);return!1},Pf=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 zn.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},zo=function(t,n){return!(n.disabled||_r(n)||Ef(n)||kf(n,t)||Rf(n)||Pf(n))},qo=function(t,n){return!(Af(n)||dl(n)<0||!zo(t,n))},Ff=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},If=function e(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,a=i?o.scopeParent:o,l=wf(a,i),c=i?e(o.candidates):a;l===0?i?n.push.apply(n,c):n.push(a):r.push({documentOrder:s,tabIndex:l,item:o,isScope:i,content:c})}),r.sort(xf).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},no=function(t,n){n=n||{};var r;return n.getShadowRoot?r=ul([t],n.includeContainer,{filter:qo.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Ff}):r=cl(t,n.includeContainer,qo.bind(null,n)),If(r)},Mf=function(t,n){n=n||{};var r;return n.getShadowRoot?r=ul([t],n.includeContainer,{filter:zo.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=cl(t,n.includeContainer,zo.bind(null,n)),r},pl=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return zn.call(t,zr)===!1?!1:qo(n,t)};function ml(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function gl(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function $f(){return/apple/i.test(navigator.vendor)}function _o(){const e=/android/i;return e.test(ml())||e.test(gl())}function Nf(){return gl().includes("jsdom/")}const li="data-floating-ui-focusable",Df="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Sn(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function We(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Uo(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Mt(e){return"composedPath"in e?e.composedPath()[0]:e.target}function bo(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 Lf(e){return e.matches("html,body")}function nt(e){return(e==null?void 0:e.ownerDocument)||document}function vl(e){return ce(e)&&e.matches(Df)}function ci(e){return e?e.getAttribute("role")==="combobox"&&vl(e):!1}function Go(e){return e?e.hasAttribute(li)?e:e.querySelector("["+li+"]")||e:null}function An(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var s;return o.parentId===t&&(!n||((s=o.context)==null?void 0:s.open))}).flatMap(o=>[o,...An(e,o.id,n)])}function ui(e,t){var n;let r=[],o=(n=e.find(s=>s.id===t))==null?void 0:n.parentId;for(;o;){const s=e.find(i=>i.id===o);o=s==null?void 0:s.parentId,s&&(r=r.concat(s))}return r}function yo(e){e.preventDefault(),e.stopPropagation()}function jf(e){return"nativeEvent"in e}function Bf(e){return e.mozInputSource===0&&e.isTrusted?!0:_o()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Wf(e){return Nf()?!1:!_o()&&e.width===0&&e.height===0||_o()&&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 fi(e,t){return["mouse","pen"].includes(e)}var Hf=typeof document<"u",Uf=function(){},He=Hf?A.useLayoutEffect:Uf;const Vf={...N};function wo(e){const t=N.useRef(e);return He(()=>{t.current=e}),t}const zf=Vf.useInsertionEffect,qf=zf||(e=>e());function dt(e){const t=N.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return qf(()=>{t.current=e}),N.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)},[])}const wr=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function bl(e,t){const n=no(e,wr()),r=n.length;if(r===0)return;const o=Sn(nt(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function yl(e){return bl(nt(e).body,1)||e}function wl(e){return bl(nt(e).body,-1)||e}function rr(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!We(n,r)}function _f(e){no(e,wr()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function di(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function hi(e,t,n){let{reference:r,floating:o}=e;const s=Oe(t),i=Os(t),a=Cs(i),l=Ve(t),c=s==="y",d=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let f;switch(l){case"top":f={x:d,y:r.y-o.height};break;case"bottom":f={x:d,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:h};break;case"left":f={x:r.x-o.width,y:h};break;default:f={x:r.x,y:r.y}}switch(xn(t)){case"start":f[i]-=p*(n&&c?-1:1);break;case"end":f[i]+=p*(n&&c?-1:1);break}return f}const Gf=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:h}=hi(c,r,l),p=r,f={},w=0;for(let y=0;y<a.length;y++){const{name:R,fn:k}=a[y],{x,y:F,data:$,reset:D}=await k({x:d,y:h,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:c,platform:i,elements:{reference:e,floating:t}});d=x??d,h=F??h,f={...f,[R]:{...f[R],...$}},D&&w<=50&&(w++,typeof D=="object"&&(D.placement&&(p=D.placement),D.rects&&(c=D.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):D.rects),{x:d,y:h}=hi(c,p,l)),y=-1)}return{x:d,y:h,placement:p,strategy:o,middlewareData:f}};async function xl(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:p=!1,padding:f=0}=mt(t,e),w=al(f),R=a[p?h==="floating"?"reference":"floating":h],k=qt(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(R)))==null||n?R:R.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),x=h==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,F=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),$=await(s.isElement==null?void 0:s.isElement(F))?await(s.getScale==null?void 0:s.getScale(F))||{x:1,y:1}:{x:1,y:1},D=qt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:F,strategy:l}):x);return{top:(k.top-D.top+w.top)/$.y,bottom:(D.bottom-k.bottom+w.bottom)/$.y,left:(k.left-D.left+w.left)/$.x,right:(D.right-k.right+w.right)/$.x}}const Qf=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:y=!0,...R}=mt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const k=Ve(o),x=Oe(a),F=Ve(a)===a,$=await(l.isRTL==null?void 0:l.isRTL(c.floating)),D=p||(F||!y?[lr(a)]:sl(a)),j=w!=="none";!p&&j&&D.push(...il(a,y,w,$));const W=[a,...D],u=await xl(t,R),g=[];let m=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&g.push(u[k]),h){const S=ol(o,i,$);g.push(u[S[0]],u[S[1]])}if(m=[...m,{placement:o,overflows:g}],!g.every(S=>S<=0)){var C,O;const S=(((C=s.flip)==null?void 0:C.index)||0)+1,b=W[S];if(b&&(!(h==="alignment"?x!==Oe(b):!1)||m.every(v=>Oe(v.placement)===x?v.overflows[0]>0:!0)))return{data:{index:S,overflows:m},reset:{placement:b}};let E=(O=m.filter(I=>I.overflows[0]<=0).sort((I,v)=>I.overflows[1]-v.overflows[1])[0])==null?void 0:O.placement;if(!E)switch(f){case"bestFit":{var T;const I=(T=m.filter(v=>{if(j){const M=Oe(v.placement);return M===x||M==="y"}return!0}).map(v=>[v.placement,v.overflows.filter(M=>M>0).reduce((M,B)=>M+B,0)]).sort((v,M)=>v[1]-M[1])[0])==null?void 0:T[0];I&&(E=I);break}case"initialPlacement":E=a;break}if(o!==E)return{reset:{placement:E}}}return{}}}},Kf=new Set(["left","top"]);async function Yf(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Ve(n),a=xn(n),l=Oe(n)==="y",c=Kf.has(i)?-1:1,d=s&&l?-1:1,h=mt(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:w}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof w=="number"&&(f=a==="end"?w*-1:w),l?{x:f*d,y:p*c}:{x:p*c,y:f*d}}const Xf=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await Yf(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},Jf=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:R=>{let{x:k,y:x}=R;return{x:k,y:x}}},...l}=mt(e,t),c={x:n,y:r},d=await xl(t,l),h=Oe(Ve(o)),p=Ss(h);let f=c[p],w=c[h];if(s){const R=p==="y"?"top":"left",k=p==="y"?"bottom":"right",x=f+d[R],F=f-d[k];f=Vr(x,f,F)}if(i){const R=h==="y"?"top":"left",k=h==="y"?"bottom":"right",x=w+d[R],F=w-d[k];w=Vr(x,w,F)}const y=a.fn({...t,[p]:f,[h]:w});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[p]:s,[h]:i}}}}}};function El(e){const t=me(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ce(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Ct(n)!==s||Ct(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function As(e){return oe(e)?e:e.contextElement}function Tn(e){const t=As(e);if(!ce(t))return ve(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=El(t);let i=(s?Ct(n.width):n.width)/r,a=(s?Ct(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Zf=ve(0);function Rl(e){const t=ge(e);return!Qn()||!t.visualViewport?Zf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ed(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ge(e)?!1:t}function gn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=As(e);let i=ve(1);t&&(r?oe(r)&&(i=Tn(r)):i=Tn(e));const a=ed(s,n,r)?Rl(s):ve(0);let l=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,d=o.width/i.x,h=o.height/i.y;if(s){const p=ge(s),f=r&&oe(r)?ge(r):r;let w=p,y=ar(w);for(;y&&r&&f!==w;){const R=Tn(y),k=y.getBoundingClientRect(),x=me(y),F=k.left+(y.clientLeft+parseFloat(x.paddingLeft))*R.x,$=k.top+(y.clientTop+parseFloat(x.paddingTop))*R.y;l*=R.x,c*=R.y,d*=R.x,h*=R.y,l+=F,c+=$,w=ge(y),y=ar(w)}}return qt({width:d,height:h,x:l,y:c})}function ro(e,t){const n=Qt(e).scrollLeft;return t?t.left+n:gn(we(e)).left+n}function Sl(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ro(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function td(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=we(r),a=t?wn(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=ve(1);const d=ve(0),h=ce(r);if((h||!h&&!s)&&((ot(r)!=="body"||Gt(i))&&(l=Qt(r)),ce(r))){const f=gn(r);c=Tn(r),d.x=f.x+r.clientLeft,d.y=f.y+r.clientTop}const p=i&&!h&&!s?Sl(i,l):ve(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+p.x,y:n.y*c.y-l.scrollTop*c.y+d.y+p.y}}function nd(e){return Array.from(e.getClientRects())}function rd(e){const t=we(e),n=Qt(e),r=e.ownerDocument.body,o=pe(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=pe(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+ro(e);const a=-n.scrollTop;return me(r).direction==="rtl"&&(i+=pe(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const pi=25;function od(e,t){const n=ge(e),r=we(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const d=Qn();(!d||d&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=ro(r);if(c<=0){const d=r.ownerDocument,h=d.body,p=getComputedStyle(h),f=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,w=Math.abs(r.clientWidth-h.clientWidth-f);w<=pi&&(s-=w)}else c<=pi&&(s+=c);return{width:s,height:i,x:a,y:l}}const sd=new Set(["absolute","fixed"]);function id(e,t){const n=gn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=ce(e)?Tn(e):ve(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,c=r*s.y;return{width:i,height:a,x:l,y:c}}function mi(e,t,n){let r;if(t==="viewport")r=od(e,n);else if(t==="document")r=rd(we(e));else if(oe(t))r=id(t,n);else{const o=Rl(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return qt(r)}function Cl(e,t){const n=De(e);return n===t||!oe(n)||Ue(n)?!1:me(n).position==="fixed"||Cl(n,t)}function ad(e,t){const n=t.get(e);if(n)return n;let r=rt(e,[],!1).filter(a=>oe(a)&&ot(a)!=="body"),o=null;const s=me(e).position==="fixed";let i=s?De(e):e;for(;oe(i)&&!Ue(i);){const a=me(i),l=yr(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&sd.has(o.position)||Gt(i)&&!l&&Cl(e,i))?r=r.filter(d=>d!==i):o=a,i=De(i)}return t.set(e,r),r}function ld(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?wn(t)?[]:ad(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((c,d)=>{const h=mi(t,d,o);return c.top=pe(h.top,c.top),c.right=ht(h.right,c.right),c.bottom=ht(h.bottom,c.bottom),c.left=pe(h.left,c.left),c},mi(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function cd(e){const{width:t,height:n}=El(e);return{width:t,height:n}}function ud(e,t,n){const r=ce(t),o=we(t),s=n==="fixed",i=gn(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=ve(0);function c(){l.x=ro(o)}if(r||!r&&!s)if((ot(t)!=="body"||Gt(o))&&(a=Qt(t)),r){const f=gn(t,!0,s,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else o&&c();s&&!r&&o&&c();const d=o&&!r&&!s?Sl(o,a):ve(0),h=i.left+a.scrollLeft-l.x-d.x,p=i.top+a.scrollTop-l.y-d.y;return{x:h,y:p,width:i.width,height:i.height}}function xo(e){return me(e).position==="static"}function gi(e,t){if(!ce(e)||me(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return we(e)===n&&(n=n.ownerDocument.body),n}function Ol(e,t){const n=ge(e);if(wn(e))return n;if(!ce(e)){let o=De(e);for(;o&&!Ue(o);){if(oe(o)&&!xo(o))return o;o=De(o)}return n}let r=gi(e,t);for(;r&&tl(r)&&xo(r);)r=gi(r,t);return r&&Ue(r)&&xo(r)&&!yr(r)?n:r||nl(e)||n}const fd=async function(e){const t=this.getOffsetParent||Ol,n=this.getDimensions,r=await n(e.floating);return{reference:ud(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function dd(e){return me(e).direction==="rtl"}const hd={convertOffsetParentRelativeRectToViewportRelativeRect:td,getDocumentElement:we,getClippingRect:ld,getOffsetParent:Ol,getElementRects:fd,getClientRects:nd,getDimensions:cd,getScale:Tn,isElement:oe,isRTL:dd};function Al(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function pd(e,t){let n=null,r;const o=we(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const c=e.getBoundingClientRect(),{left:d,top:h,width:p,height:f}=c;if(a||t(),!p||!f)return;const w=Ht(h),y=Ht(o.clientWidth-(d+p)),R=Ht(o.clientHeight-(h+f)),k=Ht(d),F={rootMargin:-w+"px "+-y+"px "+-R+"px "+-k+"px",threshold:pe(0,ht(1,l))||1};let $=!0;function D(j){const W=j[0].intersectionRatio;if(W!==l){if(!$)return i();W?i(!1,W):r=setTimeout(()=>{i(!1,1e-7)},1e3)}W===1&&!Al(c,e.getBoundingClientRect())&&i(),$=!1}try{n=new IntersectionObserver(D,{...F,root:o.ownerDocument})}catch{n=new IntersectionObserver(D,F)}n.observe(e)}return i(!0),s}function md(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=As(e),d=o||s?[...c?rt(c):[],...rt(t)]:[];d.forEach(k=>{o&&k.addEventListener("scroll",n,{passive:!0}),s&&k.addEventListener("resize",n)});const h=c&&a?pd(c,n):null;let p=-1,f=null;i&&(f=new ResizeObserver(k=>{let[x]=k;x&&x.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var F;(F=f)==null||F.observe(t)})),n()}),c&&!l&&f.observe(c),f.observe(t));let w,y=l?gn(e):null;l&&R();function R(){const k=gn(e);y&&!Al(y,k)&&n(),y=k,w=requestAnimationFrame(R)}return n(),()=>{var k;d.forEach(x=>{o&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),h==null||h(),(k=f)==null||k.disconnect(),f=null,l&&cancelAnimationFrame(w)}}const gd=Xf,vd=Jf,bd=Qf,yd=(e,t,n)=>{const r=new Map,o={platform:hd,...n},s={...o.platform,_c:r};return Gf(e,t,{...o,platform:s})};var wd=typeof document<"u",xd=function(){},Lr=wd?A.useLayoutEffect:xd;function Gr(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(!Gr(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 s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Gr(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Tl(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function vi(e,t){const n=Tl(e);return Math.round(t*n)/n}function Eo(e){const t=N.useRef(e);return Lr(()=>{t.current=e}),t}function Ed(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[d,h]=N.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,f]=N.useState(r);Gr(p,r)||f(r);const[w,y]=N.useState(null),[R,k]=N.useState(null),x=N.useCallback(v=>{v!==j.current&&(j.current=v,y(v))},[]),F=N.useCallback(v=>{v!==W.current&&(W.current=v,k(v))},[]),$=s||w,D=i||R,j=N.useRef(null),W=N.useRef(null),u=N.useRef(d),g=l!=null,m=Eo(l),C=Eo(o),O=Eo(c),T=N.useCallback(()=>{if(!j.current||!W.current)return;const v={placement:t,strategy:n,middleware:p};C.current&&(v.platform=C.current),yd(j.current,W.current,v).then(M=>{const B={...M,isPositioned:O.current!==!1};S.current&&!Gr(u.current,B)&&(u.current=B,Vn.flushSync(()=>{h(B)}))})},[p,t,n,C,O]);Lr(()=>{c===!1&&u.current.isPositioned&&(u.current.isPositioned=!1,h(v=>({...v,isPositioned:!1})))},[c]);const S=N.useRef(!1);Lr(()=>(S.current=!0,()=>{S.current=!1}),[]),Lr(()=>{if($&&(j.current=$),D&&(W.current=D),$&&D){if(m.current)return m.current($,D,T);T()}},[$,D,T,m,g]);const b=N.useMemo(()=>({reference:j,floating:W,setReference:x,setFloating:F}),[x,F]),E=N.useMemo(()=>({reference:$,floating:D}),[$,D]),I=N.useMemo(()=>{const v={position:n,left:0,top:0};if(!E.floating)return v;const M=vi(E.floating,d.x),B=vi(E.floating,d.y);return a?{...v,transform:"translate("+M+"px, "+B+"px)",...Tl(E.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:B}},[n,a,E.floating,d.x,d.y]);return N.useMemo(()=>({...d,update:T,refs:b,elements:E,floatingStyles:I}),[d,T,b,E,I])}const Rd=(e,t)=>({...gd(e),options:[e,t]}),Sd=(e,t)=>({...vd(e),options:[e,t]}),Cd=(e,t)=>({...bd(e),options:[e,t]});function Od(e){const t=N.useRef(void 0),n=N.useCallback(r=>{const o=e.map(s=>{if(s!=null){if(typeof s=="function"){const i=s,a=i(r);return typeof a=="function"?a:()=>{i(null)}}return s.current=r,()=>{s.current=null}}});return()=>{o.forEach(s=>s==null?void 0:s())}},e);return N.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}const Ad="data-floating-ui-focusable",bi="active",yi="selected",Td={...N};let wi=!1,kd=0;const xi=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+kd++;function Pd(){const[e,t]=N.useState(()=>wi?xi():void 0);return He(()=>{e==null&&t(xi())},[]),N.useEffect(()=>{wi=!0},[]),e}const Fd=Td.useId,qn=Fd||Pd;let Qo;process.env.NODE_ENV!=="production"&&(Qo=new Set);function Id(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=Qo)!=null&&e.has(o))){var s;(s=Qo)==null||s.add(o),console.error(o)}}function Md(){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)}}}const $d=N.createContext(null),Nd=N.createContext(null),kl=()=>{var e;return((e=N.useContext($d))==null?void 0:e.id)||null},Ts=()=>N.useContext(Nd);function cr(e){return"data-floating-ui-"+e}function Dd(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}let Ei=0;function Rn(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Ei);const s=()=>e==null?void 0:e.focus({preventScroll:n});o?s():Ei=requestAnimationFrame(s)}function Ld(e){return(e==null?void 0:e.ownerDocument)||document}const kn={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Ri(e){return e==="inert"?kn.inert:e==="aria-hidden"?kn["aria-hidden"]:kn.none}let Ar=new WeakSet,Tr={},Ro=0;const jd=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,Pl=e=>e&&(e.host||Pl(e.parentNode)),Bd=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Pl(n);return e.contains(r)?r:null}).filter(n=>n!=null);function Wd(e,t,n,r){const o="data-floating-ui-inert",s=r?"inert":n?"aria-hidden":null,i=Bd(t,e),a=new Set,l=new Set(i),c=[];Tr[o]||(Tr[o]=new WeakMap);const d=Tr[o];i.forEach(h),p(t),a.clear();function h(f){!f||a.has(f)||(a.add(f),f.parentNode&&h(f.parentNode))}function p(f){!f||l.has(f)||[].forEach.call(f.children,w=>{if(ot(w)!=="script")if(a.has(w))p(w);else{const y=s?w.getAttribute(s):null,R=y!==null&&y!=="false",k=Ri(s),x=(k.get(w)||0)+1,F=(d.get(w)||0)+1;k.set(w,x),d.set(w,F),c.push(w),x===1&&R&&Ar.add(w),F===1&&w.setAttribute(o,""),!R&&s&&w.setAttribute(s,s==="inert"?"":"true")}})}return Ro++,()=>{c.forEach(f=>{const w=Ri(s),R=(w.get(f)||0)-1,k=(d.get(f)||0)-1;w.set(f,R),d.set(f,k),R||(!Ar.has(f)&&s&&f.removeAttribute(s),Ar.delete(f)),k||f.removeAttribute(o)}),Ro--,Ro||(kn.inert=new WeakMap,kn["aria-hidden"]=new WeakMap,kn.none=new WeakMap,Ar=new WeakSet,Tr={})}}function Si(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=Ld(e[0]).body;return Wd(e.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))),r,t,n)}const oo={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Qr=N.forwardRef(function(t,n){const[r,o]=N.useState();He(()=>{$f()&&o("button")},[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[cr("focus-guard")]:"",style:oo};return L.jsx("span",{...t,...s})}),Fl=N.createContext(null),Ci=cr("portal");function Hd(e){e===void 0&&(e={});const{id:t,root:n}=e,r=qn(),o=Ml(),[s,i]=N.useState(null),a=N.useRef(null);return He(()=>()=>{s==null||s.remove(),queueMicrotask(()=>{a.current=null})},[s]),He(()=>{if(!r||a.current)return;const l=t?document.getElementById(t):null;if(!l)return;const c=document.createElement("div");c.id=r,c.setAttribute(Ci,""),l.appendChild(c),a.current=c,i(c)},[t,r]),He(()=>{if(n===null||!r||a.current)return;let l=n||(o==null?void 0:o.portalNode);l&&!Rs(l)&&(l=l.current),l=l||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,l.appendChild(c));const d=document.createElement("div");d.id=r,d.setAttribute(Ci,""),l=c||l,l.appendChild(d),a.current=d,i(d)},[t,n,r,o]),s}function Il(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,s=Hd({id:n,root:r}),[i,a]=N.useState(null),l=N.useRef(null),c=N.useRef(null),d=N.useRef(null),h=N.useRef(null),p=i==null?void 0:i.modal,f=i==null?void 0:i.open,w=!!i&&!i.modal&&i.open&&o&&!!(r||s);return N.useEffect(()=>{if(!s||!o||p)return;function y(R){s&&rr(R)&&(R.type==="focusin"?di:_f)(s)}return s.addEventListener("focusin",y,!0),s.addEventListener("focusout",y,!0),()=>{s.removeEventListener("focusin",y,!0),s.removeEventListener("focusout",y,!0)}},[s,o,p]),N.useEffect(()=>{s&&(f||di(s))},[f,s]),L.jsxs(Fl.Provider,{value:N.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:d,afterInsideRef:h,portalNode:s,setFocusManagerState:a}),[o,s]),children:[w&&s&&L.jsx(Qr,{"data-type":"outside",ref:l,onFocus:y=>{if(rr(y,s)){var R;(R=d.current)==null||R.focus()}else{const k=i?i.domReference:null,x=wl(k);x==null||x.focus()}}}),w&&s&&L.jsx("span",{"aria-owns":s.id,style:oo}),s&&Vn.createPortal(t,s),w&&s&&L.jsx(Qr,{"data-type":"outside",ref:c,onFocus:y=>{if(rr(y,s)){var R;(R=h.current)==null||R.focus()}else{const k=i?i.domReference:null,x=yl(k);x==null||x.focus(),i!=null&&i.closeOnFocusOut&&(i==null||i.onOpenChange(!1,y.nativeEvent,"focus-out"))}}})]})}const Ml=()=>N.useContext(Fl);function Oi(e){return N.useMemo(()=>t=>{e.forEach(n=>{n&&(n.current=t)})},e)}const Ud=20;let Ut=[];function ks(){Ut=Ut.filter(e=>e.isConnected)}function Vd(e){ks(),e&&ot(e)!=="body"&&(Ut.push(e),Ut.length>Ud&&(Ut=Ut.slice(-20)))}function Ai(){return ks(),Ut[Ut.length-1]}function zd(e){const t=wr();return pl(e,t)?e:no(e,t)[0]||e}function Ti(e,t){var n;if(!t.current.includes("floating")&&!((n=e.getAttribute("role"))!=null&&n.includes("dialog")))return;const r=wr(),s=Mf(e,r).filter(a=>{const l=a.getAttribute("data-tabindex")||"";return pl(a,r)||a.hasAttribute("data-tabindex")&&!l.startsWith("-")}),i=e.getAttribute("tabindex");t.current.includes("floating")||s.length===0?i!=="0"&&e.setAttribute("tabindex","0"):(i!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const qd=N.forwardRef(function(t,n){return L.jsx("button",{...t,type:"button",ref:n,tabIndex:-1,style:oo})});function $l(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:s=!0,initialFocus:i=0,returnFocus:a=!0,restoreFocus:l=!1,modal:c=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:h=!0,outsideElementsInert:p=!1,getInsideElements:f=()=>[]}=e,{open:w,onOpenChange:y,events:R,dataRef:k,elements:{domReference:x,floating:F}}=t,$=dt(()=>{var J;return(J=k.current.floatingContext)==null?void 0:J.nodeId}),D=dt(f),j=typeof i=="number"&&i<0,W=ci(x)&&j,u=jd(),g=u?s:!0,m=!g||u&&p,C=wo(o),O=wo(i),T=wo(a),S=Ts(),b=Ml(),E=N.useRef(null),I=N.useRef(null),v=N.useRef(!1),M=N.useRef(!1),B=N.useRef(-1),V=N.useRef(-1),G=b!=null,U=Go(F),Z=dt(function(J){return J===void 0&&(J=U),J?no(J,wr()):[]}),Q=dt(J=>{const te=Z(J);return C.current.map(X=>x&&X==="reference"?x:U&&X==="floating"?U:te).filter(Boolean).flat()});N.useEffect(()=>{if(r||!c)return;function J(X){if(X.key==="Tab"){We(U,Sn(nt(U)))&&Z().length===0&&!W&&yo(X);const ee=Q(),Re=Mt(X);C.current[0]==="reference"&&Re===x&&(yo(X),X.shiftKey?Rn(ee[ee.length-1]):Rn(ee[1])),C.current[1]==="floating"&&Re===U&&X.shiftKey&&(yo(X),Rn(ee[0]))}}const te=nt(U);return te.addEventListener("keydown",J),()=>{te.removeEventListener("keydown",J)}},[r,x,U,c,C,W,Z,Q]),N.useEffect(()=>{if(r||!F)return;function J(te){const X=Mt(te),Re=Z().indexOf(X);Re!==-1&&(B.current=Re)}return F.addEventListener("focusin",J),()=>{F.removeEventListener("focusin",J)}},[r,F,Z]),N.useEffect(()=>{if(r||!h)return;function J(){M.current=!0,setTimeout(()=>{M.current=!1})}function te(Re){const le=Re.relatedTarget,vt=Re.currentTarget,qe=Mt(Re);queueMicrotask(()=>{const je=$(),Yt=!(We(x,le)||We(F,le)||We(le,F)||We(b==null?void 0:b.portalNode,le)||le!=null&&le.hasAttribute(cr("focus-guard"))||S&&(An(S.nodesRef.current,je).find(Tt=>{var bt,kt;return We((bt=Tt.context)==null?void 0:bt.elements.floating,le)||We((kt=Tt.context)==null?void 0:kt.elements.domReference,le)})||ui(S.nodesRef.current,je).find(Tt=>{var bt,kt,Xs;return[(bt=Tt.context)==null?void 0:bt.elements.floating,Go((kt=Tt.context)==null?void 0:kt.elements.floating)].includes(le)||((Xs=Tt.context)==null?void 0:Xs.elements.domReference)===le})));if(vt===x&&U&&Ti(U,C),l&&vt!==x&&!(qe!=null&&qe.isConnected)&&Sn(nt(U))===nt(U).body){ce(U)&&U.focus();const Tt=B.current,bt=Z(),kt=bt[Tt]||bt[bt.length-1]||U;ce(kt)&&kt.focus()}if(k.current.insideReactTree){k.current.insideReactTree=!1;return}(W||!c)&&le&&Yt&&!M.current&&le!==Ai()&&(v.current=!0,y(!1,Re,"focus-out"))})}const X=!!(!S&&b);function ee(){Dd(V),k.current.insideReactTree=!0,V.current=window.setTimeout(()=>{k.current.insideReactTree=!1})}if(F&&ce(x))return x.addEventListener("focusout",te),x.addEventListener("pointerdown",J),F.addEventListener("focusout",te),X&&F.addEventListener("focusout",ee,!0),()=>{x.removeEventListener("focusout",te),x.removeEventListener("pointerdown",J),F.removeEventListener("focusout",te),X&&F.removeEventListener("focusout",ee,!0)}},[r,x,F,U,c,S,b,y,h,l,Z,W,$,C,k]);const H=N.useRef(null),K=N.useRef(null),Ae=Oi([H,b==null?void 0:b.beforeInsideRef]),Fe=Oi([K,b==null?void 0:b.afterInsideRef]);N.useEffect(()=>{var J,te;if(r||!F)return;const X=Array.from((b==null||(J=b.portalNode)==null?void 0:J.querySelectorAll("["+cr("portal")+"]"))||[]),Re=(te=(S?ui(S.nodesRef.current,$()):[]).find(qe=>{var je;return ci(((je=qe.context)==null?void 0:je.elements.domReference)||null)}))==null||(te=te.context)==null?void 0:te.elements.domReference,le=[F,Re,...X,...D(),E.current,I.current,H.current,K.current,b==null?void 0:b.beforeOutsideRef.current,b==null?void 0:b.afterOutsideRef.current,C.current.includes("reference")||W?x:null].filter(qe=>qe!=null),vt=c||W?Si(le,!m,m):Si(le);return()=>{vt()}},[r,x,F,c,C,b,W,g,m,S,$,D]),He(()=>{if(r||!ce(U))return;const J=nt(U),te=Sn(J);queueMicrotask(()=>{const X=Q(U),ee=O.current,Re=(typeof ee=="number"?X[ee]:ee.current)||U,le=We(U,te);!j&&!le&&w&&Rn(Re,{preventScroll:Re===U})})},[r,w,U,j,Q,O]),He(()=>{if(r||!U)return;const J=nt(U),te=Sn(J);Vd(te);function X(le){let{reason:vt,event:qe,nested:je}=le;if(["hover","safe-polygon"].includes(vt)&&qe.type==="mouseleave"&&(v.current=!0),vt==="outside-press")if(je)v.current=!1;else if(Bf(qe)||Wf(qe))v.current=!1;else{let Yt=!1;document.createElement("div").focus({get preventScroll(){return Yt=!0,!1}}),Yt?v.current=!1:v.current=!0}}R.on("openchange",X);const ee=J.createElement("span");ee.setAttribute("tabindex","-1"),ee.setAttribute("aria-hidden","true"),Object.assign(ee.style,oo),G&&x&&x.insertAdjacentElement("afterend",ee);function Re(){if(typeof T.current=="boolean"){const le=x||Ai();return le&&le.isConnected?le:ee}return T.current.current||ee}return()=>{R.off("openchange",X);const le=Sn(J),vt=We(F,le)||S&&An(S.nodesRef.current,$(),!1).some(je=>{var Yt;return We((Yt=je.context)==null?void 0:Yt.elements.floating,le)}),qe=Re();queueMicrotask(()=>{const je=zd(qe);T.current&&!v.current&&ce(je)&&(!(je!==le&&le!==J.body)||vt)&&je.focus({preventScroll:!0}),ee.remove()})}},[r,F,U,T,k,R,S,G,x,$]),N.useEffect(()=>(queueMicrotask(()=>{v.current=!1}),()=>{queueMicrotask(ks)}),[r]),He(()=>{if(!r&&b)return b.setFocusManagerState({modal:c,closeOnFocusOut:h,open:w,onOpenChange:y,domReference:x}),()=>{b.setFocusManagerState(null)}},[r,b,c,w,y,h,x]),He(()=>{r||U&&Ti(U,C)},[r,U,C]);function Le(J){return r||!d||!c?null:L.jsx(qd,{ref:J==="start"?E:I,onClick:te=>y(!1,te.nativeEvent),children:typeof d=="string"?d:"Dismiss"})}const be=!r&&g&&(c?!W:!0)&&(G||c);return L.jsxs(L.Fragment,{children:[be&&L.jsx(Qr,{"data-type":"inside",ref:Ae,onFocus:J=>{if(c){const X=Q();Rn(o[0]==="reference"?X[0]:X[X.length-1])}else if(b!=null&&b.preserveTabOrder&&b.portalNode)if(v.current=!1,rr(J,b.portalNode)){const X=yl(x);X==null||X.focus()}else{var te;(te=b.beforeOutsideRef.current)==null||te.focus()}}}),!W&&Le("start"),n,Le("end"),be&&L.jsx(Qr,{"data-type":"inside",ref:Fe,onFocus:J=>{if(c)Rn(Q()[0]);else if(b!=null&&b.preserveTabOrder&&b.portalNode)if(h&&(v.current=!0),rr(J,b.portalNode)){const X=wl(x);X==null||X.focus()}else{var te;(te=b.afterOutsideRef.current)==null||te.focus()}}})]})}let kr=0;const ki="--floating-ui-scrollbar-width";function _d(){const e=ml(),t=/iP(hone|ad|od)|iOS/.test(e)||e==="MacIntel"&&navigator.maxTouchPoints>1,n=document.body.style,o=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",s=window.innerWidth-document.documentElement.clientWidth,i=n.left?parseFloat(n.left):window.scrollX,a=n.top?parseFloat(n.top):window.scrollY;if(n.overflow="hidden",n.setProperty(ki,s+"px"),s&&(n[o]=s+"px"),t){var l,c;const d=((l=window.visualViewport)==null?void 0:l.offsetLeft)||0,h=((c=window.visualViewport)==null?void 0:c.offsetTop)||0;Object.assign(n,{position:"fixed",top:-(a-Math.floor(h))+"px",left:-(i-Math.floor(d))+"px",right:"0"})}return()=>{Object.assign(n,{overflow:"",[o]:""}),n.removeProperty(ki),t&&(Object.assign(n,{position:"",top:"",left:"",right:""}),window.scrollTo(i,a))}}let Pi=()=>{};const Gd=N.forwardRef(function(t,n){const{lockScroll:r=!1,...o}=t;return He(()=>{if(r)return kr++,kr===1&&(Pi=_d()),()=>{kr--,kr===0&&Pi()}},[r]),L.jsx("div",{ref:n,...o,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}})});function Fi(e){return ce(e.target)&&e.target.tagName==="BUTTON"}function Qd(e){return ce(e.target)&&e.target.tagName==="A"}function Ii(e){return vl(e)}function Nl(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:s}}=e,{enabled:i=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:d=!0,stickIfOpen:h=!0}=t,p=N.useRef(),f=N.useRef(!1),w=N.useMemo(()=>({onPointerDown(y){p.current=y.pointerType},onMouseDown(y){const R=p.current;y.button===0&&a!=="click"&&(fi(R)&&c||(n&&l&&(!(o.current.openEvent&&h)||o.current.openEvent.type==="mousedown")?r(!1,y.nativeEvent,"click"):(y.preventDefault(),r(!0,y.nativeEvent,"click"))))},onClick(y){const R=p.current;if(a==="mousedown"&&p.current){p.current=void 0;return}fi(R)&&c||(n&&l&&(!(o.current.openEvent&&h)||o.current.openEvent.type==="click")?r(!1,y.nativeEvent,"click"):r(!0,y.nativeEvent,"click"))},onKeyDown(y){p.current=void 0,!(y.defaultPrevented||!d||Fi(y))&&(y.key===" "&&!Ii(s)&&(y.preventDefault(),f.current=!0),!Qd(y)&&y.key==="Enter"&&r(!(n&&l),y.nativeEvent,"click"))},onKeyUp(y){y.defaultPrevented||!d||Fi(y)||Ii(s)||y.key===" "&&f.current&&(f.current=!1,r(!(n&&l),y.nativeEvent,"click"))}}),[o,s,a,c,d,r,n,h,l]);return N.useMemo(()=>i?{reference:w}:{},[i,w])}const Kd={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Yd={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Mi=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function Dl(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:i=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:d=!1,referencePressEvent:h="pointerdown",ancestorScroll:p=!1,bubbles:f,capture:w}=t,y=Ts(),R=dt(typeof l=="function"?l:()=>!1),k=typeof l=="function"?R:l,x=N.useRef(!1),{escapeKey:F,outsidePress:$}=Mi(f),{escapeKey:D,outsidePress:j}=Mi(w),W=N.useRef(!1),u=dt(S=>{var b;if(!n||!i||!a||S.key!=="Escape"||W.current)return;const E=(b=s.current.floatingContext)==null?void 0:b.nodeId,I=y?An(y.nodesRef.current,E):[];if(!F&&(S.stopPropagation(),I.length>0)){let v=!0;if(I.forEach(M=>{var B;if((B=M.context)!=null&&B.open&&!M.context.dataRef.current.__escapeKeyBubbles){v=!1;return}}),!v)return}r(!1,jf(S)?S.nativeEvent:S,"escape-key")}),g=dt(S=>{var b;const E=()=>{var I;u(S),(I=Mt(S))==null||I.removeEventListener("keydown",E)};(b=Mt(S))==null||b.addEventListener("keydown",E)}),m=dt(S=>{var b;const E=s.current.insideReactTree;s.current.insideReactTree=!1;const I=x.current;if(x.current=!1,c==="click"&&I||E||typeof k=="function"&&!k(S))return;const v=Mt(S),M="["+cr("inert")+"]",B=nt(o.floating).querySelectorAll(M);let V=oe(v)?v:null;for(;V&&!Ue(V);){const Q=De(V);if(Ue(Q)||!oe(Q))break;V=Q}if(B.length&&oe(v)&&!Lf(v)&&!We(v,o.floating)&&Array.from(B).every(Q=>!We(V,Q)))return;if(ce(v)&&T){const Q=Ue(v),H=me(v),K=/auto|scroll/,Ae=Q||K.test(H.overflowX),Fe=Q||K.test(H.overflowY),Le=Ae&&v.clientWidth>0&&v.scrollWidth>v.clientWidth,be=Fe&&v.clientHeight>0&&v.scrollHeight>v.clientHeight,J=H.direction==="rtl",te=be&&(J?S.offsetX<=v.offsetWidth-v.clientWidth:S.offsetX>v.clientWidth),X=Le&&S.offsetY>v.clientHeight;if(te||X)return}const G=(b=s.current.floatingContext)==null?void 0:b.nodeId,U=y&&An(y.nodesRef.current,G).some(Q=>{var H;return bo(S,(H=Q.context)==null?void 0:H.elements.floating)});if(bo(S,o.floating)||bo(S,o.domReference)||U)return;const Z=y?An(y.nodesRef.current,G):[];if(Z.length>0){let Q=!0;if(Z.forEach(H=>{var K;if((K=H.context)!=null&&K.open&&!H.context.dataRef.current.__outsidePressBubbles){Q=!1;return}}),!Q)return}r(!1,S,"outside-press")}),C=dt(S=>{var b;const E=()=>{var I;m(S),(I=Mt(S))==null||I.removeEventListener(c,E)};(b=Mt(S))==null||b.addEventListener(c,E)});N.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=F,s.current.__outsidePressBubbles=$;let S=-1;function b(B){r(!1,B,"ancestor-scroll")}function E(){window.clearTimeout(S),W.current=!0}function I(){S=window.setTimeout(()=>{W.current=!1},Qn()?5:0)}const v=nt(o.floating);a&&(v.addEventListener("keydown",D?g:u,D),v.addEventListener("compositionstart",E),v.addEventListener("compositionend",I)),k&&v.addEventListener(c,j?C:m,j);let M=[];return p&&(oe(o.domReference)&&(M=rt(o.domReference)),oe(o.floating)&&(M=M.concat(rt(o.floating))),!oe(o.reference)&&o.reference&&o.reference.contextElement&&(M=M.concat(rt(o.reference.contextElement)))),M=M.filter(B=>{var V;return B!==((V=v.defaultView)==null?void 0:V.visualViewport)}),M.forEach(B=>{B.addEventListener("scroll",b,{passive:!0})}),()=>{a&&(v.removeEventListener("keydown",D?g:u,D),v.removeEventListener("compositionstart",E),v.removeEventListener("compositionend",I)),k&&v.removeEventListener(c,j?C:m,j),M.forEach(B=>{B.removeEventListener("scroll",b)}),window.clearTimeout(S)}},[s,o,a,k,c,n,r,p,i,F,$,u,D,g,m,j,C]),N.useEffect(()=>{s.current.insideReactTree=!1},[s,k,c]);const O=N.useMemo(()=>({onKeyDown:u,...d&&{[Kd[h]]:S=>{r(!1,S.nativeEvent,"reference-press")},...h!=="click"&&{onClick(S){r(!1,S.nativeEvent,"reference-press")}}}}),[u,r,d,h]),T=N.useMemo(()=>({onKeyDown:u,onMouseDown(){x.current=!0},onMouseUp(){x.current=!0},[Yd[c]]:()=>{s.current.insideReactTree=!0}}),[u,c,s]);return N.useMemo(()=>i?{reference:O,floating:T}:{},[i,O,T])}function Xd(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=qn(),s=N.useRef({}),[i]=N.useState(()=>Md()),a=kl()!=null;if(process.env.NODE_ENV!=="production"){const f=r.reference;f&&!oe(f)&&Id("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=N.useState(r.reference),d=dt((f,w,y)=>{s.current.openEvent=f?w:void 0,i.emit("openchange",{open:f,event:w,reason:y,nested:a}),n==null||n(f,w,y)}),h=N.useMemo(()=>({setPositionReference:c}),[]),p=N.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return N.useMemo(()=>({dataRef:s,open:t,onOpenChange:d,elements:p,events:i,floatingId:o,refs:h}),[t,d,p,i,o,h])}function Ll(e){e===void 0&&(e={});const{nodeId:t}=e,n=Xd({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=N.useState(null),[a,l]=N.useState(null),d=(o==null?void 0:o.domReference)||s,h=N.useRef(null),p=Ts();He(()=>{d&&(h.current=d)},[d]);const f=Ed({...e,elements:{...o,...a&&{reference:a}}}),w=N.useCallback(F=>{const $=oe(F)?{getBoundingClientRect:()=>F.getBoundingClientRect(),getClientRects:()=>F.getClientRects(),contextElement:F}:F;l($),f.refs.setReference($)},[f.refs]),y=N.useCallback(F=>{(oe(F)||F===null)&&(h.current=F,i(F)),(oe(f.refs.reference.current)||f.refs.reference.current===null||F!==null&&!oe(F))&&f.refs.setReference(F)},[f.refs]),R=N.useMemo(()=>({...f.refs,setReference:y,setPositionReference:w,domReference:h}),[f.refs,y,w]),k=N.useMemo(()=>({...f.elements,domReference:d}),[f.elements,d]),x=N.useMemo(()=>({...f,...r,refs:R,elements:k,nodeId:t}),[f,R,k,t,r]);return He(()=>{r.dataRef.current.floatingContext=x;const F=p==null?void 0:p.nodesRef.current.find($=>$.id===t);F&&(F.context=x)}),N.useMemo(()=>({...f,context:x,refs:R,elements:k}),[f,R,k,x])}function So(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[bi]:i,[yi]:a,...l}=e;s=l}return{...n==="floating"&&{tabIndex:-1,[Ad]:""},...s,...t.map(i=>{const a=i?i[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((i,a)=>(a&&Object.entries(a).forEach(l=>{let[c,d]=l;if(!(o&&[bi,yi].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof d=="function"){var h;(h=r.get(c))==null||h.push(d),i[c]=function(){for(var p,f=arguments.length,w=new Array(f),y=0;y<f;y++)w[y]=arguments[y];return(p=r.get(c))==null?void 0:p.map(R=>R(...w)).find(R=>R!==void 0)}}}else i[c]=d}),i),{})}}function jl(e){e===void 0&&(e=[]);const t=e.map(a=>a==null?void 0:a.reference),n=e.map(a=>a==null?void 0:a.floating),r=e.map(a=>a==null?void 0:a.item),o=N.useCallback(a=>So(a,e,"reference"),t),s=N.useCallback(a=>So(a,e,"floating"),n),i=N.useCallback(a=>So(a,e,"item"),r);return N.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}const Jd=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Zd(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:s,floatingId:i}=e,{enabled:a=!0,role:l="dialog"}=t,c=qn(),d=((n=s.domReference)==null?void 0:n.id)||c,h=N.useMemo(()=>{var x;return((x=Go(s.floating))==null?void 0:x.id)||i},[s.floating,i]),p=(r=Jd.get(l))!=null?r:l,w=kl()!=null,y=N.useMemo(()=>p==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:o?h:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":p==="alertdialog"?"dialog":p,"aria-controls":o?h:void 0,...p==="listbox"&&{role:"combobox"},...p==="menu"&&{id:d},...p==="menu"&&w&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[p,h,w,o,d,l]),R=N.useMemo(()=>{const x={id:h,...p&&{role:p}};return p==="tooltip"||l==="label"?x:{...x,...p==="menu"&&{"aria-labelledby":d}}},[p,h,d,l]),k=N.useCallback(x=>{let{active:F,selected:$}=x;const D={role:"option",...F&&{id:h+"-fui-option"}};switch(l){case"select":case"combobox":return{...D,"aria-selected":$}}return{}},[h,l]);return N.useMemo(()=>a?{reference:y,floating:R,item:k}:{},[a,y,R,k])}var xr=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(){}},eh={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},lt,rn,Fa,th=(Fa=class{constructor(){Y(this,lt,eh);Y(this,rn,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&P(this,rn)&&e!==P(this,lt)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:P(this,lt),provider:e}),z(this,lt,e),process.env.NODE_ENV!=="production"&&z(this,rn,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&z(this,rn,!0),P(this,lt).setTimeout(e,t)}clearTimeout(e){P(this,lt).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&z(this,rn,!0),P(this,lt).setInterval(e,t)}clearInterval(e){P(this,lt).clearInterval(e)}},lt=new WeakMap,rn=new WeakMap,Fa),en=new th;function nh(e){setTimeout(e,0)}var vn=typeof window>"u"||"Deno"in globalThis;function $e(){}function rh(e,t){return typeof e=="function"?e(t):e}function Ko(e){return typeof e=="number"&&e>=0&&e!==1/0}function Bl(e,t){return Math.max(e+(t||0)-Date.now(),0)}function zt(e,t){return typeof e=="function"?e(t):e}function Xe(e,t){return typeof e=="function"?e(t):e}function $i(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==Ps(i,t.options))return!1}else if(!fr(t.queryKey,i))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function Ni(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(ur(t.options.mutationKey)!==ur(s))return!1}else if(!fr(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Ps(e,t){return((t==null?void 0:t.queryKeyHashFn)||ur)(e)}function ur(e){return JSON.stringify(e,(t,n)=>Jo(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function fr(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>fr(e[n],t[n])):!1}var oh=Object.prototype.hasOwnProperty;function Yo(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Di(e)&&Di(t);if(!r&&!(Jo(e)&&Jo(t)))return t;const s=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),a=i.length,l=r?new Array(a):{};let c=0;for(let d=0;d<a;d++){const h=r?d:i[d],p=e[h],f=t[h];if(p===f){l[h]=p,(r?d<s:oh.call(e,h))&&c++;continue}if(p===null||f===null||typeof p!="object"||typeof f!="object"){l[h]=f;continue}const w=Yo(p,f,n+1);l[h]=w,w===p&&c++}return s===a&&c===s?e:l}function Xo(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 Di(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Jo(e){if(!Li(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Li(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Li(e){return Object.prototype.toString.call(e)==="[object Object]"}function sh(e){return new Promise(t=>{en.setTimeout(t,e)})}function Zo(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return Yo(e,t)}catch(r){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`),r}return Yo(e,t)}return t}function ih(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function ah(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Kr=Symbol();function Wl(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Kr&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Kr?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Hl(e,t){return typeof e=="function"?e(...t):!!e}function lh(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 on,$t,Fn,Ia,ch=(Ia=class extends xr{constructor(){super();Y(this,on);Y(this,$t);Y(this,Fn);z(this,Fn,t=>{if(!vn&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){P(this,$t)||this.setEventListener(P(this,Fn))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,$t))==null||t.call(this),z(this,$t,void 0))}setEventListener(t){var n;z(this,Fn,t),(n=P(this,$t))==null||n.call(this),z(this,$t,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){P(this,on)!==t&&(z(this,on,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof P(this,on)=="boolean"?P(this,on):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},on=new WeakMap,$t=new WeakMap,Fn=new WeakMap,Ia),Fs=new ch;function es(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});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 uh=nh;function fh(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=uh;const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||i()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var Se=fh(),In,Nt,Mn,Ma,dh=(Ma=class extends xr{constructor(){super();Y(this,In,!0);Y(this,Nt);Y(this,Mn);z(this,Mn,t=>{if(!vn&&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(){P(this,Nt)||this.setEventListener(P(this,Mn))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,Nt))==null||t.call(this),z(this,Nt,void 0))}setEventListener(t){var n;z(this,Mn,t),(n=P(this,Nt))==null||n.call(this),z(this,Nt,t(this.setOnline.bind(this)))}setOnline(t){P(this,In)!==t&&(z(this,In,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return P(this,In)}},In=new WeakMap,Nt=new WeakMap,Mn=new WeakMap,Ma),Yr=new dh;function hh(e){return Math.min(1e3*2**e,3e4)}function Ul(e){return(e??"online")==="online"?Yr.isOnline():!0}var ts=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Vl(e){let t=!1,n=0,r;const o=es(),s=()=>o.status!=="pending",i=y=>{var R;if(!s()){const k=new ts(y);p(k),(R=e.onCancel)==null||R.call(e,k)}},a=()=>{t=!0},l=()=>{t=!1},c=()=>Fs.isFocused()&&(e.networkMode==="always"||Yr.isOnline())&&e.canRun(),d=()=>Ul(e.networkMode)&&e.canRun(),h=y=>{s()||(r==null||r(),o.resolve(y))},p=y=>{s()||(r==null||r(),o.reject(y))},f=()=>new Promise(y=>{var R;r=k=>{(s()||c())&&y(k)},(R=e.onPause)==null||R.call(e)}).then(()=>{var y;r=void 0,s()||(y=e.onContinue)==null||y.call(e)}),w=()=>{if(s())return;let y;const R=n===0?e.initialPromise:void 0;try{y=R??e.fn()}catch(k){y=Promise.reject(k)}Promise.resolve(y).then(h).catch(k=>{var j;if(s())return;const x=e.retry??(vn?0:3),F=e.retryDelay??hh,$=typeof F=="function"?F(n,k):F,D=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,k);if(t||!D){p(k);return}n++,(j=e.onFail)==null||j.call(e,n,k),sh($).then(()=>c()?void 0:f()).then(()=>{t?p(k):w()})})};return{promise:o,status:()=>o.status,cancel:i,continue:()=>(r==null||r(),o),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?w():f().then(w),o)}}var sn,$a,zl=($a=class{constructor(){Y(this,sn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ko(this.gcTime)&&z(this,sn,en.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(vn?1/0:300*1e3))}clearGcTimeout(){P(this,sn)&&(en.clearTimeout(P(this,sn)),z(this,sn,void 0))}},sn=new WeakMap,$a),an,$n,Ye,ln,xe,pr,cn,et,xt,Na,ph=(Na=class extends zl{constructor(t){super();Y(this,et);Y(this,an);Y(this,$n);Y(this,Ye);Y(this,ln);Y(this,xe);Y(this,pr);Y(this,cn);z(this,cn,!1),z(this,pr,t.defaultOptions),this.setOptions(t.options),this.observers=[],z(this,ln,t.client),z(this,Ye,P(this,ln).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,z(this,an,Bi(this.options)),this.state=t.state??P(this,an),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=P(this,xe))==null?void 0:t.promise}setOptions(t){if(this.options={...P(this,pr),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Bi(this.options);n.data!==void 0&&(this.setState(ji(n.data,n.dataUpdatedAt)),z(this,an,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&P(this,Ye).remove(this)}setData(t,n){const r=Zo(this.state.data,t,this.options);return se(this,et,xt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){se(this,et,xt).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=P(this,xe))==null?void 0:r.promise;return(o=P(this,xe))==null||o.cancel(t),n?n.then($e).catch($e):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(P(this,an))}isActive(){return this.observers.some(t=>Xe(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Kr||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>zt(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:!Bl(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=P(this,xe))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=P(this,xe))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),P(this,Ye).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(P(this,xe)&&(P(this,cn)?P(this,xe).cancel({revert:!0}):P(this,xe).cancelRetry()),this.scheduleGc()),P(this,Ye).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||se(this,et,xt).call(this,{type:"invalidate"})}async fetch(t,n){var l,c,d,h,p,f,w,y,R,k,x,F;if(this.state.fetchStatus!=="idle"&&((l=P(this,xe))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(P(this,xe))return P(this,xe).continueRetry(),P(this,xe).promise}if(t&&this.setOptions(t),!this.options.queryFn){const $=this.observers.find(D=>D.options.queryFn);$&&this.setOptions($.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o=$=>{Object.defineProperty($,"signal",{enumerable:!0,get:()=>(z(this,cn,!0),r.signal)})},s=()=>{const $=Wl(this.options,n),j=(()=>{const W={client:P(this,ln),queryKey:this.queryKey,meta:this.meta};return o(W),W})();return z(this,cn,!1),this.options.persister?this.options.persister($,j,this):$(j)},a=(()=>{const $={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:P(this,ln),state:this.state,fetchFn:s};return o($),$})();(c=this.options.behavior)==null||c.onFetch(a,this),z(this,$n,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=a.fetchOptions)==null?void 0:d.meta))&&se(this,et,xt).call(this,{type:"fetch",meta:(h=a.fetchOptions)==null?void 0:h.meta}),z(this,xe,Vl({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:$=>{$ instanceof ts&&$.revert&&this.setState({...P(this,$n),fetchStatus:"idle"}),r.abort()},onFail:($,D)=>{se(this,et,xt).call(this,{type:"failed",failureCount:$,error:D})},onPause:()=>{se(this,et,xt).call(this,{type:"pause"})},onContinue:()=>{se(this,et,xt).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const $=await P(this,xe).start();if($===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData($),(f=(p=P(this,Ye).config).onSuccess)==null||f.call(p,$,this),(y=(w=P(this,Ye).config).onSettled)==null||y.call(w,$,this.state.error,this),$}catch($){if($ instanceof ts){if($.silent)return P(this,xe).promise;if($.revert){if(this.state.data===void 0)throw $;return this.state.data}}throw se(this,et,xt).call(this,{type:"error",error:$}),(k=(R=P(this,Ye).config).onError)==null||k.call(R,$,this),(F=(x=P(this,Ye).config).onSettled)==null||F.call(x,this.state.data,$,this),$}finally{this.scheduleGc()}}},an=new WeakMap,$n=new WeakMap,Ye=new WeakMap,ln=new WeakMap,xe=new WeakMap,pr=new WeakMap,cn=new WeakMap,et=new WeakSet,xt=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,...ql(r.data,this.options),fetchMeta:t.meta??null};case"success":const o={...r,...ji(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return z(this,$n,t.manual?o:void 0),o;case"error":const s=t.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Se.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),P(this,Ye).notify({query:this,type:"updated",action:t})})},Na);function ql(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ul(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function ji(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Bi(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 Me,ie,mr,Te,un,Nn,Et,Dt,gr,Dn,Ln,fn,dn,Lt,jn,ae,Zn,ns,rs,os,ss,is,as,ls,_l,Da,mh=(Da=class extends xr{constructor(t,n){super();Y(this,ae);Y(this,Me);Y(this,ie);Y(this,mr);Y(this,Te);Y(this,un);Y(this,Nn);Y(this,Et);Y(this,Dt);Y(this,gr);Y(this,Dn);Y(this,Ln);Y(this,fn);Y(this,dn);Y(this,Lt);Y(this,jn,new Set);this.options=n,z(this,Me,t),z(this,Dt,null),z(this,Et,es()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(P(this,ie).addObserver(this),Wi(P(this,ie),this.options)?se(this,ae,Zn).call(this):this.updateResult(),se(this,ae,ss).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return cs(P(this,ie),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return cs(P(this,ie),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,se(this,ae,is).call(this),se(this,ae,as).call(this),P(this,ie).removeObserver(this)}setOptions(t){const n=this.options,r=P(this,ie);if(this.options=P(this,Me).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Xe(this.options.enabled,P(this,ie))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");se(this,ae,ls).call(this),P(this,ie).setOptions(this.options),n._defaulted&&!Xo(this.options,n)&&P(this,Me).getQueryCache().notify({type:"observerOptionsUpdated",query:P(this,ie),observer:this});const o=this.hasListeners();o&&Hi(P(this,ie),r,this.options,n)&&se(this,ae,Zn).call(this),this.updateResult(),o&&(P(this,ie)!==r||Xe(this.options.enabled,P(this,ie))!==Xe(n.enabled,P(this,ie))||zt(this.options.staleTime,P(this,ie))!==zt(n.staleTime,P(this,ie)))&&se(this,ae,ns).call(this);const s=se(this,ae,rs).call(this);o&&(P(this,ie)!==r||Xe(this.options.enabled,P(this,ie))!==Xe(n.enabled,P(this,ie))||s!==P(this,Lt))&&se(this,ae,os).call(this,s)}getOptimisticResult(t){const n=P(this,Me).getQueryCache().build(P(this,Me),t),r=this.createResult(n,t);return vh(this,r)&&(z(this,Te,r),z(this,Nn,this.options),z(this,un,P(this,ie).state)),r}getCurrentResult(){return P(this,Te)}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&&P(this,Et).status==="pending"&&P(this,Et).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,o))})}trackProp(t){P(this,jn).add(t)}getCurrentQuery(){return P(this,ie)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=P(this,Me).defaultQueryOptions(t),r=P(this,Me).getQueryCache().build(P(this,Me),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return se(this,ae,Zn).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),P(this,Te)))}createResult(t,n){var g;const r=P(this,ie),o=this.options,s=P(this,Te),i=P(this,un),a=P(this,Nn),c=t!==r?t.state:P(this,mr),{state:d}=t;let h={...d},p=!1,f;if(n._optimisticResults){const m=this.hasListeners(),C=!m&&Wi(t,n),O=m&&Hi(t,r,n,o);(C||O)&&(h={...h,...ql(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:w,errorUpdatedAt:y,status:R}=h;f=h.data;let k=!1;if(n.placeholderData!==void 0&&f===void 0&&R==="pending"){let m;s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(m=s.data,k=!0):m=typeof n.placeholderData=="function"?n.placeholderData((g=P(this,Ln))==null?void 0:g.state.data,P(this,Ln)):n.placeholderData,m!==void 0&&(R="success",f=Zo(s==null?void 0:s.data,m,n),p=!0)}if(n.select&&f!==void 0&&!k)if(s&&f===(i==null?void 0:i.data)&&n.select===P(this,gr))f=P(this,Dn);else try{z(this,gr,n.select),f=n.select(f),f=Zo(s==null?void 0:s.data,f,n),z(this,Dn,f),z(this,Dt,null)}catch(m){z(this,Dt,m)}P(this,Dt)&&(w=P(this,Dt),f=P(this,Dn),y=Date.now(),R="error");const x=h.fetchStatus==="fetching",F=R==="pending",$=R==="error",D=F&&x,j=f!==void 0,u={status:R,fetchStatus:h.fetchStatus,isPending:F,isSuccess:R==="success",isError:$,isInitialLoading:D,isLoading:D,data:f,dataUpdatedAt:h.dataUpdatedAt,error:w,errorUpdatedAt:y,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>c.dataUpdateCount||h.errorUpdateCount>c.errorUpdateCount,isFetching:x,isRefetching:x&&!F,isLoadingError:$&&!j,isPaused:h.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:$&&j,isStale:Is(t,n),refetch:this.refetch,promise:P(this,Et),isEnabled:Xe(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const m=u.data!==void 0,C=u.status==="error"&&!m,O=b=>{C?b.reject(u.error):m&&b.resolve(u.data)},T=()=>{const b=z(this,Et,u.promise=es());O(b)},S=P(this,Et);switch(S.status){case"pending":t.queryHash===r.queryHash&&O(S);break;case"fulfilled":(C||u.data!==S.value)&&T();break;case"rejected":(!C||u.error!==S.reason)&&T();break}}return u}updateResult(){const t=P(this,Te),n=this.createResult(P(this,ie),this.options);if(z(this,un,P(this,ie).state),z(this,Nn,this.options),P(this,un).data!==void 0&&z(this,Ln,P(this,ie)),Xo(n,t))return;z(this,Te,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,s=typeof o=="function"?o():o;if(s==="all"||!s&&!P(this,jn).size)return!0;const i=new Set(s??P(this,jn));return this.options.throwOnError&&i.add("error"),Object.keys(P(this,Te)).some(a=>{const l=a;return P(this,Te)[l]!==t[l]&&i.has(l)})};se(this,ae,_l).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&se(this,ae,ss).call(this)}},Me=new WeakMap,ie=new WeakMap,mr=new WeakMap,Te=new WeakMap,un=new WeakMap,Nn=new WeakMap,Et=new WeakMap,Dt=new WeakMap,gr=new WeakMap,Dn=new WeakMap,Ln=new WeakMap,fn=new WeakMap,dn=new WeakMap,Lt=new WeakMap,jn=new WeakMap,ae=new WeakSet,Zn=function(t){se(this,ae,ls).call(this);let n=P(this,ie).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch($e)),n},ns=function(){se(this,ae,is).call(this);const t=zt(this.options.staleTime,P(this,ie));if(vn||P(this,Te).isStale||!Ko(t))return;const r=Bl(P(this,Te).dataUpdatedAt,t)+1;z(this,fn,en.setTimeout(()=>{P(this,Te).isStale||this.updateResult()},r))},rs=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(P(this,ie)):this.options.refetchInterval)??!1},os=function(t){se(this,ae,as).call(this),z(this,Lt,t),!(vn||Xe(this.options.enabled,P(this,ie))===!1||!Ko(P(this,Lt))||P(this,Lt)===0)&&z(this,dn,en.setInterval(()=>{(this.options.refetchIntervalInBackground||Fs.isFocused())&&se(this,ae,Zn).call(this)},P(this,Lt)))},ss=function(){se(this,ae,ns).call(this),se(this,ae,os).call(this,se(this,ae,rs).call(this))},is=function(){P(this,fn)&&(en.clearTimeout(P(this,fn)),z(this,fn,void 0))},as=function(){P(this,dn)&&(en.clearInterval(P(this,dn)),z(this,dn,void 0))},ls=function(){const t=P(this,Me).getQueryCache().build(P(this,Me),this.options);if(t===P(this,ie))return;const n=P(this,ie);z(this,ie,t),z(this,mr,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},_l=function(t){Se.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(P(this,Te))}),P(this,Me).getQueryCache().notify({query:P(this,ie),type:"observerResultsUpdated"})})},Da);function gh(e,t){return Xe(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Wi(e,t){return gh(e,t)||e.state.data!==void 0&&cs(e,t,t.refetchOnMount)}function cs(e,t,n){if(Xe(t.enabled,e)!==!1&&zt(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Is(e,t)}return!1}function Hi(e,t,n,r){return(e!==t||Xe(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Is(e,n)}function Is(e,t){return Xe(t.enabled,e)!==!1&&e.isStaleByTime(zt(t.staleTime,e))}function vh(e,t){return!Xo(e.getCurrentResult(),t)}function Ui(e){return{onFetch:(t,n)=>{var d,h,p,f,w;const r=t.options,o=(p=(h=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:h.fetchMore)==null?void 0:p.direction,s=((f=t.state.data)==null?void 0:f.pages)||[],i=((w=t.state.data)==null?void 0:w.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let y=!1;const R=F=>{lh(F,()=>t.signal,()=>y=!0)},k=Wl(t.options,t.fetchOptions),x=async(F,$,D)=>{if(y)return Promise.reject();if($==null&&F.pages.length)return Promise.resolve(F);const W=(()=>{const C={client:t.client,queryKey:t.queryKey,pageParam:$,direction:D?"backward":"forward",meta:t.options.meta};return R(C),C})(),u=await k(W),{maxPages:g}=t.options,m=D?ah:ih;return{pages:m(F.pages,u,g),pageParams:m(F.pageParams,$,g)}};if(o&&s.length){const F=o==="backward",$=F?bh:Vi,D={pages:s,pageParams:i},j=$(r,D);a=await x(D,j,F)}else{const F=e??s.length;do{const $=l===0?i[0]??r.initialPageParam:Vi(r,a);if(l>0&&$==null)break;a=await x(a,$),l++}while(l<F)}return a};t.options.persister?t.fetchFn=()=>{var y,R;return(R=(y=t.options).persister)==null?void 0:R.call(y,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Vi(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 bh(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 vr,ct,ke,hn,ut,It,La,yh=(La=class extends zl{constructor(t){super();Y(this,ut);Y(this,vr);Y(this,ct);Y(this,ke);Y(this,hn);z(this,vr,t.client),this.mutationId=t.mutationId,z(this,ke,t.mutationCache),z(this,ct,[]),this.state=t.state||wh(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){P(this,ct).includes(t)||(P(this,ct).push(t),this.clearGcTimeout(),P(this,ke).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){z(this,ct,P(this,ct).filter(n=>n!==t)),this.scheduleGc(),P(this,ke).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){P(this,ct).length||(this.state.status==="pending"?this.scheduleGc():P(this,ke).remove(this))}continue(){var t;return((t=P(this,hn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,a,l,c,d,h,p,f,w,y,R,k,x,F,$,D,j,W,u,g;const n=()=>{se(this,ut,It).call(this,{type:"continue"})},r={client:P(this,vr),meta:this.options.meta,mutationKey:this.options.mutationKey};z(this,hn,Vl({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(m,C)=>{se(this,ut,It).call(this,{type:"failed",failureCount:m,error:C})},onPause:()=>{se(this,ut,It).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>P(this,ke).canRun(this)}));const o=this.state.status==="pending",s=!P(this,hn).canStart();try{if(o)n();else{se(this,ut,It).call(this,{type:"pending",variables:t,isPaused:s}),await((a=(i=P(this,ke).config).onMutate)==null?void 0:a.call(i,t,this,r));const C=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t,r));C!==this.state.context&&se(this,ut,It).call(this,{type:"pending",context:C,variables:t,isPaused:s})}const m=await P(this,hn).start();return await((h=(d=P(this,ke).config).onSuccess)==null?void 0:h.call(d,m,t,this.state.context,this,r)),await((f=(p=this.options).onSuccess)==null?void 0:f.call(p,m,t,this.state.context,r)),await((y=(w=P(this,ke).config).onSettled)==null?void 0:y.call(w,m,null,this.state.variables,this.state.context,this,r)),await((k=(R=this.options).onSettled)==null?void 0:k.call(R,m,null,t,this.state.context,r)),se(this,ut,It).call(this,{type:"success",data:m}),m}catch(m){try{await((F=(x=P(this,ke).config).onError)==null?void 0:F.call(x,m,t,this.state.context,this,r))}catch(C){Promise.reject(C)}try{await((D=($=this.options).onError)==null?void 0:D.call($,m,t,this.state.context,r))}catch(C){Promise.reject(C)}try{await((W=(j=P(this,ke).config).onSettled)==null?void 0:W.call(j,void 0,m,this.state.variables,this.state.context,this,r))}catch(C){Promise.reject(C)}try{await((g=(u=this.options).onSettled)==null?void 0:g.call(u,void 0,m,t,this.state.context,r))}catch(C){Promise.reject(C)}throw se(this,ut,It).call(this,{type:"error",error:m}),m}finally{P(this,ke).runNext(this)}}},vr=new WeakMap,ct=new WeakMap,ke=new WeakMap,hn=new WeakMap,ut=new WeakSet,It=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),Se.batch(()=>{P(this,ct).forEach(r=>{r.onMutationUpdate(t)}),P(this,ke).notify({mutation:this,type:"updated",action:t})})},La);function wh(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Rt,tt,br,ja,xh=(ja=class extends xr{constructor(t={}){super();Y(this,Rt);Y(this,tt);Y(this,br);this.config=t,z(this,Rt,new Set),z(this,tt,new Map),z(this,br,0)}build(t,n,r){const o=new yh({client:t,mutationCache:this,mutationId:++Sr(this,br)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){P(this,Rt).add(t);const n=Pr(t);if(typeof n=="string"){const r=P(this,tt).get(n);r?r.push(t):P(this,tt).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(P(this,Rt).delete(t)){const n=Pr(t);if(typeof n=="string"){const r=P(this,tt).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&P(this,tt).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Pr(t);if(typeof n=="string"){const r=P(this,tt).get(n),o=r==null?void 0:r.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=Pr(t);if(typeof n=="string"){const o=(r=P(this,tt).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Se.batch(()=>{P(this,Rt).forEach(t=>{this.notify({type:"removed",mutation:t})}),P(this,Rt).clear(),P(this,tt).clear()})}getAll(){return Array.from(P(this,Rt))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Ni(n,r))}findAll(t={}){return this.getAll().filter(n=>Ni(t,n))}notify(t){Se.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Se.batch(()=>Promise.all(t.map(n=>n.continue().catch($e))))}},Rt=new WeakMap,tt=new WeakMap,br=new WeakMap,ja);function Pr(e){var t;return(t=e.options.scope)==null?void 0:t.id}var ft,Ba,Eh=(Ba=class extends xr{constructor(t={}){super();Y(this,ft);this.config=t,z(this,ft,new Map)}build(t,n,r){const o=n.queryKey,s=n.queryHash??Ps(o,n);let i=this.get(s);return i||(i=new ph({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){P(this,ft).has(t.queryHash)||(P(this,ft).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=P(this,ft).get(t.queryHash);n&&(t.destroy(),n===t&&P(this,ft).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Se.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return P(this,ft).get(t)}getAll(){return[...P(this,ft).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>$i(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>$i(t,r)):n}notify(t){Se.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Se.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Se.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ft=new WeakMap,Ba),de,jt,Bt,Bn,Wn,Wt,Hn,Un,Wa,Rh=(Wa=class{constructor(e={}){Y(this,de);Y(this,jt);Y(this,Bt);Y(this,Bn);Y(this,Wn);Y(this,Wt);Y(this,Hn);Y(this,Un);z(this,de,e.queryCache||new Eh),z(this,jt,e.mutationCache||new xh),z(this,Bt,e.defaultOptions||{}),z(this,Bn,new Map),z(this,Wn,new Map),z(this,Wt,0)}mount(){Sr(this,Wt)._++,P(this,Wt)===1&&(z(this,Hn,Fs.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,de).onFocus())})),z(this,Un,Yr.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,de).onOnline())})))}unmount(){var e,t;Sr(this,Wt)._--,P(this,Wt)===0&&((e=P(this,Hn))==null||e.call(this),z(this,Hn,void 0),(t=P(this,Un))==null||t.call(this),z(this,Un,void 0))}isFetching(e){return P(this,de).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return P(this,jt).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=P(this,de).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=P(this,de).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(zt(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return P(this,de).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=P(this,de).get(r.queryHash),s=o==null?void 0:o.state.data,i=rh(t,s);if(i!==void 0)return P(this,de).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Se.batch(()=>P(this,de).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=P(this,de).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=P(this,de);Se.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=P(this,de);return Se.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Se.batch(()=>P(this,de).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then($e).catch($e)}invalidateQueries(e,t={}){return Se.batch(()=>(P(this,de).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=Se.batch(()=>P(this,de).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch($e)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then($e)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=P(this,de).build(this,t);return n.isStaleByTime(zt(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then($e).catch($e)}fetchInfiniteQuery(e){return e.behavior=Ui(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then($e).catch($e)}ensureInfiniteQueryData(e){return e.behavior=Ui(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Yr.isOnline()?P(this,jt).resumePausedMutations():Promise.resolve()}getQueryCache(){return P(this,de)}getMutationCache(){return P(this,jt)}getDefaultOptions(){return P(this,Bt)}setDefaultOptions(e){z(this,Bt,e)}setQueryDefaults(e,t){P(this,Bn).set(ur(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...P(this,Bn).values()],n={};return t.forEach(r=>{fr(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){P(this,Wn).set(ur(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...P(this,Wn).values()],n={};return t.forEach(r=>{fr(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...P(this,Bt).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ps(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===Kr&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...P(this,Bt).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){P(this,de).clear(),P(this,jt).clear()}},de=new WeakMap,jt=new WeakMap,Bt=new WeakMap,Bn=new WeakMap,Wn=new WeakMap,Wt=new WeakMap,Hn=new WeakMap,Un=new WeakMap,Wa),Gl=N.createContext(void 0),Ql=e=>{const t=N.useContext(Gl);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Kl=({client:e,children:t})=>(N.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),L.jsx(Gl.Provider,{value:e,children:t})),Sh=N.createContext(!1),Ch=()=>N.useContext(Sh);function Oh(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ah=N.createContext(Oh()),Th=()=>N.useContext(Ah),kh=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Hl(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Ph=e=>{N.useEffect(()=>{e.clearReset()},[e])},Fh=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||Hl(n,[e.error,r])),Ih=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))}},Mh=(e,t)=>e.isLoading&&e.isFetching&&!t,$h=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,zi=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Nh(e,t,n){var p,f,w,y;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=Ch(),o=Th(),s=Ql(),i=s.defaultQueryOptions(e);(f=(p=s.getDefaultOptions().queries)==null?void 0:p._experimental_beforeQuery)==null||f.call(p,i);const a=s.getQueryCache().get(i.queryHash);process.env.NODE_ENV!=="production"&&(i.queryFn||console.error(`[${i.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),i._optimisticResults=r?"isRestoring":"optimistic",Ih(i),kh(i,o,a),Ph(o);const l=!s.getQueryCache().get(i.queryHash),[c]=N.useState(()=>new t(s,i)),d=c.getOptimisticResult(i),h=!r&&e.subscribed!==!1;if(N.useSyncExternalStore(N.useCallback(R=>{const k=h?c.subscribe(Se.batchCalls(R)):$e;return c.updateResult(),k},[c,h]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),N.useEffect(()=>{c.setOptions(i)},[i,c]),$h(i,d))throw zi(i,c,o);if(Fh({result:d,errorResetBoundary:o,throwOnError:i.throwOnError,query:a,suspense:i.suspense}))throw d.error;if((y=(w=s.getDefaultOptions().queries)==null?void 0:w._experimental_afterQuery)==null||y.call(w,i,d),i.experimental_prefetchInRender&&!vn&&Mh(d,r)){const R=l?zi(i,c,o):a==null?void 0:a.promise;R==null||R.catch($e).finally(()=>{c.updateResult()})}return i.notifyOnChangeProps?d:c.trackResult(d)}function Ms(e,t){return Nh(e,mh)}function Yl(e){const[t,n]=A.useState(()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");return A.useEffect(()=>{if(e!=="system")return;const r=window.matchMedia("(prefers-color-scheme: dark)");n(r.matches?"dark":"light");const o=s=>{n(s.matches?"dark":"light")};return r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[e]),e==="system"?t:e}const qi="wallet-ui-theme-styles",Dh=`
|
|
17
17
|
--wui-color-primary: #2d2df1;
|
|
18
18
|
--wui-color-primary-hover: #2929d9;
|
|
19
19
|
--wui-color-primary-text: #ffffff;
|
|
@@ -28,7 +28,12 @@
|
|
|
28
28
|
--wui-color-link: rgba(45, 45, 241, 0.8);
|
|
29
29
|
--wui-color-link-hover: #2d2df1;
|
|
30
30
|
--wui-color-overlay: rgba(0, 0, 0, 0.3);
|
|
31
|
-
|
|
31
|
+
--wui-color-danger-bg: #fee2e2;
|
|
32
|
+
--wui-color-danger-bg-hover: #fecaca;
|
|
33
|
+
--wui-color-danger-text: #b91c1c;
|
|
34
|
+
--wui-color-avatar-bg: #e5e7eb;
|
|
35
|
+
--wui-color-avatar-icon: #9ca3af;
|
|
36
|
+
`,Co=`
|
|
32
37
|
--wui-color-primary: #bfbff9;
|
|
33
38
|
--wui-color-primary-hover: #d4d4fa;
|
|
34
39
|
--wui-color-primary-text: #001324;
|
|
@@ -43,32 +48,37 @@
|
|
|
43
48
|
--wui-color-link: #6c6cf1;
|
|
44
49
|
--wui-color-link-hover: #8080f3;
|
|
45
50
|
--wui-color-overlay: rgba(0, 0, 0, 0.5);
|
|
46
|
-
|
|
51
|
+
--wui-color-danger-bg: rgba(127, 29, 29, 0.4);
|
|
52
|
+
--wui-color-danger-bg-hover: rgba(127, 29, 29, 0.6);
|
|
53
|
+
--wui-color-danger-text: #fca5a5;
|
|
54
|
+
--wui-color-avatar-bg: #192a39;
|
|
55
|
+
--wui-color-avatar-icon: #6b7280;
|
|
56
|
+
`;function Lh(){if(document.getElementById(qi))return;const e=document.createElement("style");e.id=qi,e.textContent=`
|
|
47
57
|
/* Light mode (default) */
|
|
48
58
|
[data-wallet-ui] {
|
|
49
|
-
${
|
|
59
|
+
${Dh}
|
|
50
60
|
}
|
|
51
61
|
|
|
52
62
|
/* Dark mode via data-theme attribute (explicit) */
|
|
53
63
|
[data-wallet-ui][data-theme='dark'] {
|
|
54
|
-
${
|
|
64
|
+
${Co}
|
|
55
65
|
}
|
|
56
66
|
|
|
57
67
|
/* Dark mode via .dark class on ancestor (Tailwind convention) */
|
|
58
68
|
.dark [data-wallet-ui]:not([data-theme='light']) {
|
|
59
|
-
${
|
|
69
|
+
${Co}
|
|
60
70
|
}
|
|
61
71
|
|
|
62
72
|
/* Dark mode via system preference (when theme="system" or no explicit theme) */
|
|
63
73
|
@media (prefers-color-scheme: dark) {
|
|
64
74
|
[data-wallet-ui]:not([data-theme='light']):not([data-theme='dark']) {
|
|
65
|
-
${
|
|
75
|
+
${Co}
|
|
66
76
|
}
|
|
67
77
|
}
|
|
68
|
-
`,document.head.appendChild(e)}const Nh=()=>new bh({defaultOptions:{queries:{staleTime:5*60*1e3,gcTime:60*60*1e3,refetchOnWindowFocus:!0,refetchInterval:10*60*1e3,retry:(e,t)=>t instanceof Error&&t.message.includes("404")?!1:e<3}}}),ec=O.createContext(void 0);function Lh({enabled:e,nfdView:t}){const n=Xl(),{activeAddress:r,activeWallet:o,algodClient:i}=xt.useWallet(),{activeNetwork:s}=xt.useNetwork(),a=O.useRef(null);return O.useEffect(()=>{if(!e){a.current=r;return}const l=a.current===null&&r!==null&&o!==null&&o.accounts!==void 0&&o.accounts.length>0&&i!==void 0;if(a.current=r,!l)return;console.log(`[WalletUI] Prefetching data for all accounts in wallet ${o.id}`);const c=o.accounts.map(d=>d.address);if(c.length>0){const h=[];for(let m=0;m<c.length;m+=20)h.push(c.slice(m,m+20));h.forEach(async m=>{const x=s==="testnet"?"https://api.testnet.nf.domains":"https://api.nf.domains",b=new URLSearchParams;m.forEach(R=>{b.append("address",R)}),b.append("view",t);try{const R=await fetch(`${x}/nfd/lookup?${b.toString()}`,{method:"GET",headers:{Accept:"application/json"}});if(!R.ok&&R.status!==404)throw new Error(`NFD prefetch lookup failed: ${R.statusText}`);const $=R.status===404?{}:await R.json();m.forEach(w=>{const T=$[w]||null;n.setQueryData(["nfd",w,s,t],T)})}catch(R){console.error("Error prefetching NFD data:",R)}})}c.forEach(d=>{n.prefetchQuery({queryKey:["account-balance",d],queryFn:async()=>{try{const h=await i.accountInformation(d).do();return Number(h.amount)}catch(h){throw new Error(`Error fetching account balance: ${h}`)}}})})},[r,o,s,t,i,n,e]),null}function jh({children:e,queryClient:t,enablePrefetching:n=!0,prefetchNfdView:r="thumbnail",theme:o="system"}){const i=O.useMemo(()=>t||Nh(),[t]),s=Zl(o);O.useEffect(()=>{Dh()},[]);const a=O.useMemo(()=>({queryClient:i,theme:o,resolvedTheme:s}),[i,o,s]),l=o==="system"?void 0:o,c=L.jsx(ec.Provider,{value:a,children:L.jsxs("div",{"data-wallet-ui":!0,"data-theme":l,children:[L.jsx(Lh,{enabled:n,nfdView:r}),e]})});return t?c:L.jsx(Jl,{client:i,children:c})}function uo(){const e=O.useContext(ec);if(e===void 0)throw new Error("useWalletUI must be used within a WalletUIProvider");return e}function tc({wallets:e,handleWalletClick:t}){return L.jsxs("ul",{className:"space-y-1.5",children:[e.map(n=>L.jsx("li",{children:L.jsxs("button",{onClick:()=>t(n),className:"flex w-full items-center gap-3 py-1.5 px-1.5 text-left text-[var(--wui-color-text)] transition-colors hover:bg-[var(--wui-color-bg-hover)] rounded-xl",children:[L.jsx("div",{className:"flex-shrink-0 h-8 w-8 rounded-md overflow-hidden bg-[var(--wui-color-bg-secondary)] flex items-center justify-center",children:L.jsx("img",{src:n.metadata.icon,alt:`${n.metadata.name} icon`,className:"h-8 w-8 object-contain rounded-md"})}),L.jsx("span",{className:"text-lg font-bold wallet-custom-font",children:n.metadata.name})]})},n.id)),e.length===0&&L.jsx("p",{className:"text-center text-[var(--wui-color-text-secondary)]",children:"No wallets found."})]})}function nc({children:e}){const[t,n]=O.useState(!1),[r,o]=O.useState(null),{wallets:i,activeAddress:s}=xt.useWallet(),{theme:a}=uo(),l=a==="system"?void 0:a,{refs:c,context:d}=Hl({open:t,onOpenChange:u=>{u&&s||(u?(n(!0),o("starting"),requestAnimationFrame(()=>{o("entered")})):(o("exiting"),setTimeout(()=>{n(!1),o(null)},150)))}}),h=jl(d),m=Bl(d,{outsidePressEvent:"mousedown"}),f=eh(d,{role:"dialog"}),{getReferenceProps:x,getFloatingProps:b}=Wl([h,m,f]),R=Wn(),$=Wn(),w=async u=>{try{await u.connect(),d.onOpenChange(!1)}catch(p){console.error(`Error connecting to ${u.metadata.name}:`,p),d.onOpenChange(!1)}},T=u=>{s||d.onOpenChange(!0)},N=e||L.jsx(Di,{}),D=Ad([c.setReference,N.ref||null]),j={...x(),ref:D,onClick:T},W=O.cloneElement(N,j);return L.jsxs(L.Fragment,{children:[W,L.jsx(Dl,{id:"wallet-dialog-portal",children:t&&L.jsx("div",{"data-wallet-ui":!0,"data-wallet-ui-scope":!0,"data-theme":l,children:L.jsx(Qd,{className:"grid place-items-center px-4 z-50 transition-opacity duration-150 ease-in-out bg-[var(--wui-color-overlay)] data-[state=starting]:opacity-0 data-[state=exiting]:opacity-0 data-[state=entered]:opacity-100","data-state":r,lockScroll:!0,children:L.jsx(Ll,{context:d,modal:!0,children:L.jsxs("div",{ref:c.setFloating,...b({"aria-labelledby":R,"aria-describedby":$}),"data-state":r,className:"w-full max-w-sm rounded-3xl bg-[var(--wui-color-bg)] shadow-xl transform transition-all duration-150 ease-in-out data-[state=starting]:opacity-0 data-[state=starting]:scale-90 data-[state=exiting]:opacity-0 data-[state=exiting]:scale-90 data-[state=entered]:opacity-100 data-[state=entered]:scale-100",style:{marginTop:"-0.5rem"},children:[L.jsxs("div",{className:"relative flex items-center px-6 pt-5 pb-4",children:[L.jsx("h2",{id:R,className:"text-xl font-bold text-[var(--wui-color-text)] wallet-custom-font",children:"Connect a Wallet"}),L.jsx("button",{onClick:()=>d.onOpenChange(!1),className:"absolute right-4 rounded-full bg-[var(--wui-color-bg-tertiary)] p-2 text-[var(--wui-color-text-secondary)] hover:brightness-90 transition-all","aria-label":"Close dialog",children:L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:L.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),L.jsx("div",{className:"px-4 pb-3",children:L.jsx(tc,{wallets:i,handleWalletClick:w})}),L.jsxs("div",{className:"px-6 py-5 border-t border-[var(--wui-color-border)] flex items-center justify-between",children:[L.jsx("span",{className:"text-[var(--wui-color-text-secondary)] text-sm",children:"Need an Algorand wallet?"}),L.jsx("a",{href:"https://algorand.co/wallets",className:"text-[var(--wui-color-link)] font-medium text-sm hover:text-[var(--wui-color-link-hover)]",target:"_blank",rel:"noopener noreferrer",children:"Start here →"})]})]})})})})})]})}var Bh=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Io=Math.ceil,He=Math.floor,Fe="[BigNumber Error] ",na=Fe+"Number primitive has more than 15 significant digits: ",Ge=1e14,te=14,ra=9007199254740991,Do=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],At=1e7,Me=1e9;function rc(e){var t,n,r,o=w.prototype={constructor:w,toString:null,valueOf:null},i=new w(1),s=20,a=4,l=-7,c=21,d=-1e7,h=1e7,m=!1,f=1,x=0,b={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},R="0123456789abcdefghijklmnopqrstuvwxyz",$=!0;function w(u,p){var g,C,S,A,k,v,E,F,y=this;if(!(y instanceof w))return new w(u,p);if(p==null){if(u&&u._isBigNumber===!0){y.s=u.s,!u.c||u.e>h?y.c=y.e=null:u.e<d?y.c=[y.e=0]:(y.e=u.e,y.c=u.c.slice());return}if((v=typeof u=="number")&&u*0==0){if(y.s=1/u<0?(u=-u,-1):1,u===~~u){for(A=0,k=u;k>=10;k/=10,A++);A>h?y.c=y.e=null:(y.e=A,y.c=[u]);return}F=String(u)}else{if(!Bh.test(F=String(u)))return r(y,F,v);y.s=F.charCodeAt(0)==45?(F=F.slice(1),-1):1}(A=F.indexOf("."))>-1&&(F=F.replace(".","")),(k=F.search(/e/i))>0?(A<0&&(A=k),A+=+F.slice(k+1),F=F.substring(0,k)):A<0&&(A=F.length)}else{if(fe(p,2,R.length,"Base"),p==10&&$)return y=new w(u),j(y,s+y.e+1,a);if(F=String(u),v=typeof u=="number"){if(u*0!=0)return r(y,F,v,p);if(y.s=1/u<0?(F=F.slice(1),-1):1,w.DEBUG&&F.replace(/^0\.0*|\./,"").length>15)throw Error(na+u)}else y.s=F.charCodeAt(0)===45?(F=F.slice(1),-1):1;for(g=R.slice(0,p),A=k=0,E=F.length;k<E;k++)if(g.indexOf(C=F.charAt(k))<0){if(C=="."){if(k>A){A=E;continue}}else if(!S&&(F==F.toUpperCase()&&(F=F.toLowerCase())||F==F.toLowerCase()&&(F=F.toUpperCase()))){S=!0,k=-1,A=0;continue}return r(y,String(u),v,p)}v=!1,F=n(F,p,10,y.s),(A=F.indexOf("."))>-1?F=F.replace(".",""):A=F.length}for(k=0;F.charCodeAt(k)===48;k++);for(E=F.length;F.charCodeAt(--E)===48;);if(F=F.slice(k,++E)){if(E-=k,v&&w.DEBUG&&E>15&&(u>ra||u!==He(u)))throw Error(na+y.s*u);if((A=A-k-1)>h)y.c=y.e=null;else if(A<d)y.c=[y.e=0];else{if(y.e=A,y.c=[],k=(A+1)%te,A<0&&(k+=te),k<E){for(k&&y.c.push(+F.slice(0,k)),E-=te;k<E;)y.c.push(+F.slice(k,k+=te));k=te-(F=F.slice(k)).length}else k-=E;for(;k--;F+="0");y.c.push(+F)}}else y.c=[y.e=0]}w.clone=rc,w.ROUND_UP=0,w.ROUND_DOWN=1,w.ROUND_CEIL=2,w.ROUND_FLOOR=3,w.ROUND_HALF_UP=4,w.ROUND_HALF_DOWN=5,w.ROUND_HALF_EVEN=6,w.ROUND_HALF_CEIL=7,w.ROUND_HALF_FLOOR=8,w.EUCLID=9,w.config=w.set=function(u){var p,g;if(u!=null)if(typeof u=="object"){if(u.hasOwnProperty(p="DECIMAL_PLACES")&&(g=u[p],fe(g,0,Me,p),s=g),u.hasOwnProperty(p="ROUNDING_MODE")&&(g=u[p],fe(g,0,8,p),a=g),u.hasOwnProperty(p="EXPONENTIAL_AT")&&(g=u[p],g&&g.pop?(fe(g[0],-1e9,0,p),fe(g[1],0,Me,p),l=g[0],c=g[1]):(fe(g,-1e9,Me,p),l=-(c=g<0?-g:g))),u.hasOwnProperty(p="RANGE"))if(g=u[p],g&&g.pop)fe(g[0],-1e9,-1,p),fe(g[1],1,Me,p),d=g[0],h=g[1];else if(fe(g,-1e9,Me,p),g)d=-(h=g<0?-g:g);else throw Error(Fe+p+" cannot be zero: "+g);if(u.hasOwnProperty(p="CRYPTO"))if(g=u[p],g===!!g)if(g)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))m=g;else throw m=!g,Error(Fe+"crypto unavailable");else m=g;else throw Error(Fe+p+" not true or false: "+g);if(u.hasOwnProperty(p="MODULO_MODE")&&(g=u[p],fe(g,0,9,p),f=g),u.hasOwnProperty(p="POW_PRECISION")&&(g=u[p],fe(g,0,Me,p),x=g),u.hasOwnProperty(p="FORMAT"))if(g=u[p],typeof g=="object")b=g;else throw Error(Fe+p+" not an object: "+g);if(u.hasOwnProperty(p="ALPHABET"))if(g=u[p],typeof g=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(g))$=g.slice(0,10)=="0123456789",R=g;else throw Error(Fe+p+" invalid: "+g)}else throw Error(Fe+"Object expected: "+u);return{DECIMAL_PLACES:s,ROUNDING_MODE:a,EXPONENTIAL_AT:[l,c],RANGE:[d,h],CRYPTO:m,MODULO_MODE:f,POW_PRECISION:x,FORMAT:b,ALPHABET:R}},w.isBigNumber=function(u){if(!u||u._isBigNumber!==!0)return!1;if(!w.DEBUG)return!0;var p,g,C=u.c,S=u.e,A=u.s;e:if({}.toString.call(C)=="[object Array]"){if((A===1||A===-1)&&S>=-1e9&&S<=Me&&S===He(S)){if(C[0]===0){if(S===0&&C.length===1)return!0;break e}if(p=(S+1)%te,p<1&&(p+=te),String(C[0]).length==p){for(p=0;p<C.length;p++)if(g=C[p],g<0||g>=Ge||g!==He(g))break e;if(g!==0)return!0}}}else if(C===null&&S===null&&(A===null||A===1||A===-1))return!0;throw Error(Fe+"Invalid BigNumber: "+u)},w.maximum=w.max=function(){return N(arguments,-1)},w.minimum=w.min=function(){return N(arguments,1)},w.random=function(){var u=9007199254740992,p=Math.random()*u&2097151?function(){return He(Math.random()*u)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(g){var C,S,A,k,v,E=0,F=[],y=new w(i);if(g==null?g=s:fe(g,0,Me),k=Io(g/te),m)if(crypto.getRandomValues){for(C=crypto.getRandomValues(new Uint32Array(k*=2));E<k;)v=C[E]*131072+(C[E+1]>>>11),v>=9e15?(S=crypto.getRandomValues(new Uint32Array(2)),C[E]=S[0],C[E+1]=S[1]):(F.push(v%1e14),E+=2);E=k/2}else if(crypto.randomBytes){for(C=crypto.randomBytes(k*=7);E<k;)v=(C[E]&31)*281474976710656+C[E+1]*1099511627776+C[E+2]*4294967296+C[E+3]*16777216+(C[E+4]<<16)+(C[E+5]<<8)+C[E+6],v>=9e15?crypto.randomBytes(7).copy(C,E):(F.push(v%1e14),E+=7);E=k/7}else throw m=!1,Error(Fe+"crypto unavailable");if(!m)for(;E<k;)v=p(),v<9e15&&(F[E++]=v%1e14);for(k=F[--E],g%=te,k&&g&&(v=Do[te-g],F[E]=He(k/v)*v);F[E]===0;F.pop(),E--);if(E<0)F=[A=0];else{for(A=-1;F[0]===0;F.splice(0,1),A-=te);for(E=1,v=F[0];v>=10;v/=10,E++);E<te&&(A-=te-E)}return y.e=A,y.c=F,y}}(),w.sum=function(){for(var u=1,p=arguments,g=new w(p[0]);u<p.length;)g=g.plus(p[u++]);return g},n=function(){var u="0123456789";function p(g,C,S,A){for(var k,v=[0],E,F=0,y=g.length;F<y;){for(E=v.length;E--;v[E]*=C);for(v[0]+=A.indexOf(g.charAt(F++)),k=0;k<v.length;k++)v[k]>S-1&&(v[k+1]==null&&(v[k+1]=0),v[k+1]+=v[k]/S|0,v[k]%=S)}return v.reverse()}return function(g,C,S,A,k){var v,E,F,y,M,B,V,H,_=g.indexOf("."),ee=s,Z=a;for(_>=0&&(y=x,x=0,g=g.replace(".",""),H=new w(C),B=H.pow(g.length-_),x=y,H.c=p(vt(je(B.c),B.e,"0"),10,S,u),H.e=H.c.length),V=p(g,C,S,k?(v=R,u):(v=u,R)),F=y=V.length;V[--y]==0;V.pop());if(!V[0])return v.charAt(0);if(_<0?--F:(B.c=V,B.e=F,B.s=A,B=t(B,H,ee,Z,S),V=B.c,M=B.r,F=B.e),E=F+ee+1,_=V[E],y=S/2,M=M||E<0||V[E+1]!=null,M=Z<4?(_!=null||M)&&(Z==0||Z==(B.s<0?3:2)):_>y||_==y&&(Z==4||M||Z==6&&V[E-1]&1||Z==(B.s<0?8:7)),E<1||!V[0])g=M?vt(v.charAt(1),-ee,v.charAt(0)):v.charAt(0);else{if(V.length=E,M)for(--S;++V[--E]>S;)V[E]=0,E||(++F,V=[1].concat(V));for(y=V.length;!V[--y];);for(_=0,g="";_<=y;g+=v.charAt(V[_++]));g=vt(g,F,v.charAt(0))}return g}}(),t=function(){function u(C,S,A){var k,v,E,F,y=0,M=C.length,B=S%At,V=S/At|0;for(C=C.slice();M--;)E=C[M]%At,F=C[M]/At|0,k=V*E+F*B,v=B*E+k%At*At+y,y=(v/A|0)+(k/At|0)+V*F,C[M]=v%A;return y&&(C=[y].concat(C)),C}function p(C,S,A,k){var v,E;if(A!=k)E=A>k?1:-1;else for(v=E=0;v<A;v++)if(C[v]!=S[v]){E=C[v]>S[v]?1:-1;break}return E}function g(C,S,A,k){for(var v=0;A--;)C[A]-=v,v=C[A]<S[A]?1:0,C[A]=v*k+C[A]-S[A];for(;!C[0]&&C.length>1;C.splice(0,1));}return function(C,S,A,k,v){var E,F,y,M,B,V,H,_,ee,Z,Y,U,ae,ge,Ee,Q,ne,X=C.s==S.s?1:-1,K=C.c,re=S.c;if(!K||!K[0]||!re||!re[0])return new w(!C.s||!S.s||(K?re&&K[0]==re[0]:!re)?NaN:K&&K[0]==0||!re?X*0:X/0);for(_=new w(X),ee=_.c=[],F=C.e-S.e,X=A+F+1,v||(v=Ge,F=We(C.e/te)-We(S.e/te),X=X/te|0),y=0;re[y]==(K[y]||0);y++);if(re[y]>(K[y]||0)&&F--,X<0)ee.push(1),M=!0;else{for(ge=K.length,Q=re.length,y=0,X+=2,B=He(v/(re[0]+1)),B>1&&(re=u(re,B,v),K=u(K,B,v),Q=re.length,ge=K.length),ae=Q,Z=K.slice(0,Q),Y=Z.length;Y<Q;Z[Y++]=0);ne=re.slice(),ne=[0].concat(ne),Ee=re[0],re[1]>=v/2&&Ee++;do{if(B=0,E=p(re,Z,Q,Y),E<0){if(U=Z[0],Q!=Y&&(U=U*v+(Z[1]||0)),B=He(U/Ee),B>1)for(B>=v&&(B=v-1),V=u(re,B,v),H=V.length,Y=Z.length;p(V,Z,H,Y)==1;)B--,g(V,Q<H?ne:re,H,v),H=V.length,E=1;else B==0&&(E=B=1),V=re.slice(),H=V.length;if(H<Y&&(V=[0].concat(V)),g(Z,V,Y,v),Y=Z.length,E==-1)for(;p(re,Z,Q,Y)<1;)B++,g(Z,Q<Y?ne:re,Y,v),Y=Z.length}else E===0&&(B++,Z=[0]);ee[y++]=B,Z[0]?Z[Y++]=K[ae]||0:(Z=[K[ae]],Y=1)}while((ae++<ge||Z[0]!=null)&&X--);M=Z[0]!=null,ee[0]||ee.splice(0,1)}if(v==Ge){for(y=1,X=ee[0];X>=10;X/=10,y++);j(_,A+(_.e=y+F*te-1)+1,k,M)}else _.e=F,_.r=+M;return _}}();function T(u,p,g,C){var S,A,k,v,E;if(g==null?g=a:fe(g,0,8),!u.c)return u.toString();if(S=u.c[0],k=u.e,p==null)E=je(u.c),E=C==1||C==2&&(k<=l||k>=c)?$r(E,k):vt(E,k,"0");else if(u=j(new w(u),p,g),A=u.e,E=je(u.c),v=E.length,C==1||C==2&&(p<=A||A<=l)){for(;v<p;E+="0",v++);E=$r(E,A)}else if(p-=k,E=vt(E,A,"0"),A+1>v){if(--p>0)for(E+=".";p--;E+="0");}else if(p+=A-v,p>0)for(A+1==v&&(E+=".");p--;E+="0");return u.s<0&&S?"-"+E:E}function N(u,p){for(var g,C,S=1,A=new w(u[0]);S<u.length;S++)C=new w(u[S]),(!C.s||(g=_t(A,C))===p||g===0&&A.s===p)&&(A=C);return A}function D(u,p,g){for(var C=1,S=p.length;!p[--S];p.pop());for(S=p[0];S>=10;S/=10,C++);return(g=C+g*te-1)>h?u.c=u.e=null:g<d?u.c=[u.e=0]:(u.e=g,u.c=p),u}r=function(){var u=/^(-?)0([xbo])(?=\w[\w.]*$)/i,p=/^([^.]+)\.$/,g=/^\.([^.]+)$/,C=/^-?(Infinity|NaN)$/,S=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(A,k,v,E){var F,y=v?k:k.replace(S,"");if(C.test(y))A.s=isNaN(y)?null:y<0?-1:1;else{if(!v&&(y=y.replace(u,function(M,B,V){return F=(V=V.toLowerCase())=="x"?16:V=="b"?2:8,!E||E==F?B:M}),E&&(F=E,y=y.replace(p,"$1").replace(g,"0.$1")),k!=y))return new w(y,F);if(w.DEBUG)throw Error(Fe+"Not a"+(E?" base "+E:"")+" number: "+k);A.s=null}A.c=A.e=null}}();function j(u,p,g,C){var S,A,k,v,E,F,y,M=u.c,B=Do;if(M){e:{for(S=1,v=M[0];v>=10;v/=10,S++);if(A=p-S,A<0)A+=te,k=p,E=M[F=0],y=He(E/B[S-k-1]%10);else if(F=Io((A+1)/te),F>=M.length)if(C){for(;M.length<=F;M.push(0));E=y=0,S=1,A%=te,k=A-te+1}else break e;else{for(E=v=M[F],S=1;v>=10;v/=10,S++);A%=te,k=A-te+S,y=k<0?0:He(E/B[S-k-1]%10)}if(C=C||p<0||M[F+1]!=null||(k<0?E:E%B[S-k-1]),C=g<4?(y||C)&&(g==0||g==(u.s<0?3:2)):y>5||y==5&&(g==4||C||g==6&&(A>0?k>0?E/B[S-k]:0:M[F-1])%10&1||g==(u.s<0?8:7)),p<1||!M[0])return M.length=0,C?(p-=u.e+1,M[0]=B[(te-p%te)%te],u.e=-p||0):M[0]=u.e=0,u;if(A==0?(M.length=F,v=1,F--):(M.length=F+1,v=B[te-A],M[F]=k>0?He(E/B[S-k]%B[k])*v:0),C)for(;;)if(F==0){for(A=1,k=M[0];k>=10;k/=10,A++);for(k=M[0]+=v,v=1;k>=10;k/=10,v++);A!=v&&(u.e++,M[0]==Ge&&(M[0]=1));break}else{if(M[F]+=v,M[F]!=Ge)break;M[F--]=0,v=1}for(A=M.length;M[--A]===0;M.pop());}u.e>h?u.c=u.e=null:u.e<d&&(u.c=[u.e=0])}return u}function W(u){var p,g=u.e;return g===null?u.toString():(p=je(u.c),p=g<=l||g>=c?$r(p,g):vt(p,g,"0"),u.s<0?"-"+p:p)}return o.absoluteValue=o.abs=function(){var u=new w(this);return u.s<0&&(u.s=1),u},o.comparedTo=function(u,p){return _t(this,new w(u,p))},o.decimalPlaces=o.dp=function(u,p){var g,C,S,A=this;if(u!=null)return fe(u,0,Me),p==null?p=a:fe(p,0,8),j(new w(A),u+A.e+1,p);if(!(g=A.c))return null;if(C=((S=g.length-1)-We(this.e/te))*te,S=g[S])for(;S%10==0;S/=10,C--);return C<0&&(C=0),C},o.dividedBy=o.div=function(u,p){return t(this,new w(u,p),s,a)},o.dividedToIntegerBy=o.idiv=function(u,p){return t(this,new w(u,p),0,1)},o.exponentiatedBy=o.pow=function(u,p){var g,C,S,A,k,v,E,F,y,M=this;if(u=new w(u),u.c&&!u.isInteger())throw Error(Fe+"Exponent not an integer: "+W(u));if(p!=null&&(p=new w(p)),v=u.e>14,!M.c||!M.c[0]||M.c[0]==1&&!M.e&&M.c.length==1||!u.c||!u.c[0])return y=new w(Math.pow(+W(M),v?u.s*(2-Pr(u)):+W(u))),p?y.mod(p):y;if(E=u.s<0,p){if(p.c?!p.c[0]:!p.s)return new w(NaN);C=!E&&M.isInteger()&&p.isInteger(),C&&(M=M.mod(p))}else{if(u.e>9&&(M.e>0||M.e<-1||(M.e==0?M.c[0]>1||v&&M.c[1]>=24e7:M.c[0]<8e13||v&&M.c[0]<=9999975e7)))return A=M.s<0&&Pr(u)?-0:0,M.e>-1&&(A=1/A),new w(E?1/A:A);x&&(A=Io(x/te+2))}for(v?(g=new w(.5),E&&(u.s=1),F=Pr(u)):(S=Math.abs(+W(u)),F=S%2),y=new w(i);;){if(F){if(y=y.times(M),!y.c)break;A?y.c.length>A&&(y.c.length=A):C&&(y=y.mod(p))}if(S){if(S=He(S/2),S===0)break;F=S%2}else if(u=u.times(g),j(u,u.e+1,1),u.e>14)F=Pr(u);else{if(S=+W(u),S===0)break;F=S%2}M=M.times(M),A?M.c&&M.c.length>A&&(M.c.length=A):C&&(M=M.mod(p))}return C?y:(E&&(y=i.div(y)),p?y.mod(p):A?j(y,x,a,k):y)},o.integerValue=function(u){var p=new w(this);return u==null?u=a:fe(u,0,8),j(p,p.e+1,u)},o.isEqualTo=o.eq=function(u,p){return _t(this,new w(u,p))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(u,p){return _t(this,new w(u,p))>0},o.isGreaterThanOrEqualTo=o.gte=function(u,p){return(p=_t(this,new w(u,p)))===1||p===0},o.isInteger=function(){return!!this.c&&We(this.e/te)>this.c.length-2},o.isLessThan=o.lt=function(u,p){return _t(this,new w(u,p))<0},o.isLessThanOrEqualTo=o.lte=function(u,p){return(p=_t(this,new w(u,p)))===-1||p===0},o.isNaN=function(){return!this.s},o.isNegative=function(){return this.s<0},o.isPositive=function(){return this.s>0},o.isZero=function(){return!!this.c&&this.c[0]==0},o.minus=function(u,p){var g,C,S,A,k=this,v=k.s;if(u=new w(u,p),p=u.s,!v||!p)return new w(NaN);if(v!=p)return u.s=-p,k.plus(u);var E=k.e/te,F=u.e/te,y=k.c,M=u.c;if(!E||!F){if(!y||!M)return y?(u.s=-p,u):new w(M?k:NaN);if(!y[0]||!M[0])return M[0]?(u.s=-p,u):new w(y[0]?k:a==3?-0:0)}if(E=We(E),F=We(F),y=y.slice(),v=E-F){for((A=v<0)?(v=-v,S=y):(F=E,S=M),S.reverse(),p=v;p--;S.push(0));S.reverse()}else for(C=(A=(v=y.length)<(p=M.length))?v:p,v=p=0;p<C;p++)if(y[p]!=M[p]){A=y[p]<M[p];break}if(A&&(S=y,y=M,M=S,u.s=-u.s),p=(C=M.length)-(g=y.length),p>0)for(;p--;y[g++]=0);for(p=Ge-1;C>v;){if(y[--C]<M[C]){for(g=C;g&&!y[--g];y[g]=p);--y[g],y[C]+=Ge}y[C]-=M[C]}for(;y[0]==0;y.splice(0,1),--F);return y[0]?D(u,y,F):(u.s=a==3?-1:1,u.c=[u.e=0],u)},o.modulo=o.mod=function(u,p){var g,C,S=this;return u=new w(u,p),!S.c||!u.s||u.c&&!u.c[0]?new w(NaN):!u.c||S.c&&!S.c[0]?new w(S):(f==9?(C=u.s,u.s=1,g=t(S,u,0,3),u.s=C,g.s*=C):g=t(S,u,0,f),u=S.minus(g.times(u)),!u.c[0]&&f==1&&(u.s=S.s),u)},o.multipliedBy=o.times=function(u,p){var g,C,S,A,k,v,E,F,y,M,B,V,H,_,ee,Z=this,Y=Z.c,U=(u=new w(u,p)).c;if(!Y||!U||!Y[0]||!U[0])return!Z.s||!u.s||Y&&!Y[0]&&!U||U&&!U[0]&&!Y?u.c=u.e=u.s=null:(u.s*=Z.s,!Y||!U?u.c=u.e=null:(u.c=[0],u.e=0)),u;for(C=We(Z.e/te)+We(u.e/te),u.s*=Z.s,E=Y.length,M=U.length,E<M&&(H=Y,Y=U,U=H,S=E,E=M,M=S),S=E+M,H=[];S--;H.push(0));for(_=Ge,ee=At,S=M;--S>=0;){for(g=0,B=U[S]%ee,V=U[S]/ee|0,k=E,A=S+k;A>S;)F=Y[--k]%ee,y=Y[k]/ee|0,v=V*F+y*B,F=B*F+v%ee*ee+H[A]+g,g=(F/_|0)+(v/ee|0)+V*y,H[A--]=F%_;H[A]=g}return g?++C:H.splice(0,1),D(u,H,C)},o.negated=function(){var u=new w(this);return u.s=-u.s||null,u},o.plus=function(u,p){var g,C=this,S=C.s;if(u=new w(u,p),p=u.s,!S||!p)return new w(NaN);if(S!=p)return u.s=-p,C.minus(u);var A=C.e/te,k=u.e/te,v=C.c,E=u.c;if(!A||!k){if(!v||!E)return new w(S/0);if(!v[0]||!E[0])return E[0]?u:new w(v[0]?C:S*0)}if(A=We(A),k=We(k),v=v.slice(),S=A-k){for(S>0?(k=A,g=E):(S=-S,g=v),g.reverse();S--;g.push(0));g.reverse()}for(S=v.length,p=E.length,S-p<0&&(g=E,E=v,v=g,p=S),S=0;p;)S=(v[--p]=v[p]+E[p]+S)/Ge|0,v[p]=Ge===v[p]?0:v[p]%Ge;return S&&(v=[S].concat(v),++k),D(u,v,k)},o.precision=o.sd=function(u,p){var g,C,S,A=this;if(u!=null&&u!==!!u)return fe(u,1,Me),p==null?p=a:fe(p,0,8),j(new w(A),u,p);if(!(g=A.c))return null;if(S=g.length-1,C=S*te+1,S=g[S]){for(;S%10==0;S/=10,C--);for(S=g[0];S>=10;S/=10,C++);}return u&&A.e+1>C&&(C=A.e+1),C},o.shiftedBy=function(u){return fe(u,-9007199254740991,ra),this.times("1e"+u)},o.squareRoot=o.sqrt=function(){var u,p,g,C,S,A=this,k=A.c,v=A.s,E=A.e,F=s+4,y=new w("0.5");if(v!==1||!k||!k[0])return new w(!v||v<0&&(!k||k[0])?NaN:k?A:1/0);if(v=Math.sqrt(+W(A)),v==0||v==1/0?(p=je(k),(p.length+E)%2==0&&(p+="0"),v=Math.sqrt(+p),E=We((E+1)/2)-(E<0||E%2),v==1/0?p="5e"+E:(p=v.toExponential(),p=p.slice(0,p.indexOf("e")+1)+E),g=new w(p)):g=new w(v+""),g.c[0]){for(E=g.e,v=E+F,v<3&&(v=0);;)if(S=g,g=y.times(S.plus(t(A,S,F,1))),je(S.c).slice(0,v)===(p=je(g.c)).slice(0,v))if(g.e<E&&--v,p=p.slice(v-3,v+1),p=="9999"||!C&&p=="4999"){if(!C&&(j(S,S.e+s+2,0),S.times(S).eq(A))){g=S;break}F+=4,v+=4,C=1}else{(!+p||!+p.slice(1)&&p.charAt(0)=="5")&&(j(g,g.e+s+2,1),u=!g.times(g).eq(A));break}}return j(g,g.e+s+1,a,u)},o.toExponential=function(u,p){return u!=null&&(fe(u,0,Me),u++),T(this,u,p,1)},o.toFixed=function(u,p){return u!=null&&(fe(u,0,Me),u=u+this.e+1),T(this,u,p)},o.toFormat=function(u,p,g){var C,S=this;if(g==null)u!=null&&p&&typeof p=="object"?(g=p,p=null):u&&typeof u=="object"?(g=u,u=p=null):g=b;else if(typeof g!="object")throw Error(Fe+"Argument not an object: "+g);if(C=S.toFixed(u,p),S.c){var A,k=C.split("."),v=+g.groupSize,E=+g.secondaryGroupSize,F=g.groupSeparator||"",y=k[0],M=k[1],B=S.s<0,V=B?y.slice(1):y,H=V.length;if(E&&(A=v,v=E,E=A,H-=A),v>0&&H>0){for(A=H%v||v,y=V.substr(0,A);A<H;A+=v)y+=F+V.substr(A,v);E>0&&(y+=F+V.slice(A)),B&&(y="-"+y)}C=M?y+(g.decimalSeparator||"")+((E=+g.fractionGroupSize)?M.replace(new RegExp("\\d{"+E+"}\\B","g"),"$&"+(g.fractionGroupSeparator||"")):M):y}return(g.prefix||"")+C+(g.suffix||"")},o.toFraction=function(u){var p,g,C,S,A,k,v,E,F,y,M,B,V=this,H=V.c;if(u!=null&&(v=new w(u),!v.isInteger()&&(v.c||v.s!==1)||v.lt(i)))throw Error(Fe+"Argument "+(v.isInteger()?"out of range: ":"not an integer: ")+W(v));if(!H)return new w(V);for(p=new w(i),F=g=new w(i),C=E=new w(i),B=je(H),A=p.e=B.length-V.e-1,p.c[0]=Do[(k=A%te)<0?te+k:k],u=!u||v.comparedTo(p)>0?A>0?p:F:v,k=h,h=1/0,v=new w(B),E.c[0]=0;y=t(v,p,0,1),S=g.plus(y.times(C)),S.comparedTo(u)!=1;)g=C,C=S,F=E.plus(y.times(S=F)),E=S,p=v.minus(y.times(S=p)),v=S;return S=t(u.minus(g),C,0,1),E=E.plus(S.times(F)),g=g.plus(S.times(C)),E.s=F.s=V.s,A=A*2,M=t(F,C,A,a).minus(V).abs().comparedTo(t(E,g,A,a).minus(V).abs())<1?[F,C]:[E,g],h=k,M},o.toNumber=function(){return+W(this)},o.toPrecision=function(u,p){return u!=null&&fe(u,1,Me),T(this,u,p,2)},o.toString=function(u){var p,g=this,C=g.s,S=g.e;return S===null?C?(p="Infinity",C<0&&(p="-"+p)):p="NaN":(u==null?p=S<=l||S>=c?$r(je(g.c),S):vt(je(g.c),S,"0"):u===10&&$?(g=j(new w(g),s+S+1,a),p=vt(je(g.c),g.e,"0")):(fe(u,2,R.length,"Base"),p=n(vt(je(g.c),S,"0"),10,u,C,!0)),C<0&&g.c[0]&&(p="-"+p)),p},o.valueOf=o.toJSON=function(){return W(this)},o._isBigNumber=!0,o[Symbol.toStringTag]="BigNumber",o[Symbol.for("nodejs.util.inspect.custom")]=o.valueOf,e!=null&&w.set(e),w}function We(e){var t=e|0;return e>0||e===t?t:t-1}function je(e){for(var t,n,r=1,o=e.length,i=e[0]+"";r<o;){for(t=e[r++]+"",n=te-t.length;n--;t="0"+t);i+=t}for(o=i.length;i.charCodeAt(--o)===48;);return i.slice(0,o+1||1)}function _t(e,t){var n,r,o=e.c,i=t.c,s=e.s,a=t.s,l=e.e,c=t.e;if(!s||!a)return null;if(n=o&&!o[0],r=i&&!i[0],n||r)return n?r?0:-a:s;if(s!=a)return s;if(n=s<0,r=l==c,!o||!i)return r?0:!o^n?1:-1;if(!r)return l>c^n?1:-1;for(a=(l=o.length)<(c=i.length)?l:c,s=0;s<a;s++)if(o[s]!=i[s])return o[s]>i[s]^n?1:-1;return l==c?0:l>c^n?1:-1}function fe(e,t,n,r){if(e<t||e>n||e!==He(e))throw Error(Fe+(r||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Pr(e){var t=e.c.length-1;return We(e.e/te)==t&&e.c[t]%2!=0}function $r(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function vt(e,t,n){var r,o;if(t<0){for(o=n+".";++t;o+=n);e=o+e}else if(r=e.length,++t>r){for(o=n,t-=r;--t;o+=n);e+=o}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}rc();const Hh=100000n,Wh=(e,t={})=>{const{style:n="decimal",compact:r=!1,fractionDigits:o,adaptiveDecimals:i=!1}=t,s=typeof e=="string"?Number(e):e,a=typeof s=="bigint"?s<0n?-s:s:Math.abs(s),l=r==="auto"?a>=Hh:r,c=typeof s=="bigint"?Number(s):s,d=i&&c!==0&&Math.abs(c)<Math.pow(10,-(o??2)),h=new Intl.NumberFormat("en-US",{style:n,...n==="currency"&&{currency:"USD"},maximumFractionDigits:d?20:o??2,minimumFractionDigits:d?0:o??2});if(!l)return d?h.format(oa(c)):h.format(s);const m=[{threshold:1e12,suffix:"T",divisor:1e12},{threshold:1e9,suffix:"B",divisor:1e9},{threshold:1e6,suffix:"M",divisor:1e6},{threshold:1e3,suffix:"K",divisor:1e3}].find(f=>a>=f.threshold);if(m){const f=new Intl.NumberFormat("en-US",{style:n,...n==="currency"&&{currency:"USD"},maximumFractionDigits:o??1,minimumFractionDigits:o??1}),x=Number(s)/m.divisor;return f.format(x)+m.suffix}return d?h.format(oa(c)):h.format(s)};function oa(e){if(e===0)return 0;const t=e.toExponential().split("e"),n=parseInt(t[1]),r=Math.abs(n);return Number(e.toFixed(r))}function Xn(e,t=5,n=5){return e?e.length<=t+n?e:`${e.slice(0,t)}...${e.slice(-n)}`:""}function qi(e={}){const{activeAddress:t}=xt.useWallet(),{activeNetwork:n}=xt.useNetwork(),{enabled:r=!0,view:o="thumbnail"}=e;return Vi({queryKey:["nfd",t,n,o],queryFn:async({signal:i})=>{if(!t)return null;const l=await fetch(`${n==="testnet"?"https://api.testnet.nf.domains":"https://api.nf.domains"}/nfd/lookup?address=${encodeURIComponent(t)}&view=${o}`,{method:"GET",headers:{Accept:"application/json"},signal:i});if(l.status===404)return null;if(!l.ok)throw new Error(`NFD lookup failed: ${l.statusText}`);return(await l.json())[t]},enabled:r&&!!t,retry:(i,s)=>s instanceof Error&&s.message.includes("404")?!1:i<3,refetchOnWindowFocus:!0})}const ia="https://ipfs.algonode.dev",Uh=async e=>{if(!e.startsWith("ipfs://"))return e;const t=e.replace("ipfs://",""),n=`https://images.nf.domains/ipfs/${t}`,r=`${ia}/ipfs/${t}`,o=i=>i.startsWith("image/");try{const i=await fetch(n,{method:"HEAD"});if(i.ok){const s=i.headers.get("content-type");if(s&&o(s))return n}}catch{console.info(`CID ${t} is not cached on images.nf.domains, trying IPFS gateway...`)}try{const i=await fetch(r,{method:"HEAD"});if(i.ok){const s=i.headers.get("content-type");if(s&&o(s))return r;if(s==="application/json")try{const c=(await(await fetch(r)).json()).image;if(c){if(c.startsWith("ipfs://")){const d=c.replace("ipfs://",""),h=`${ia}/ipfs/${d}`,m=await fetch(h,{method:"HEAD"});if(m.ok){const f=m.headers.get("content-type");if(f&&o(f))return h}}else if(c.startsWith("http"))try{const d=await fetch(c,{method:"HEAD"});if(d.ok){const h=d.headers.get("content-type");if(h&&o(h))return c}}catch{console.error("Error checking HTTP image URL")}}}catch{console.error("Error processing JSON metadata")}}}catch{console.error(`Error checking gateway for CID ${t}`)}return r};function zi({nfd:e,alt:t,className:n,size:r=40,fallback:o,lightOnly:i=!1}){var d,h,m,f;const s=((h=(d=e==null?void 0:e.properties)==null?void 0:d.userDefined)==null?void 0:h.avatar)||((f=(m=e==null?void 0:e.properties)==null?void 0:m.verified)==null?void 0:f.avatar)||null,a=t||(e==null?void 0:e.name)||"NFD Avatar",{data:l,isLoading:c}=Vi({queryKey:["nfd-avatar",s],queryFn:async()=>s?s.startsWith("https://")&&!s.includes("/ipfs/")?s:s.startsWith("ipfs://")||s.includes("/ipfs/")?await Uh(s):s:null,enabled:!!s,staleTime:60*60*1e3,gcTime:24*60*60*1e3});return c||!l?o?L.jsx(L.Fragment,{children:o}):L.jsx("div",{className:En("flex items-center justify-center rounded-full",i?"bg-gray-200 dark:bg-gray-200":"bg-gray-200 dark:bg-[#192A39]",n),style:{width:`${r}px`,height:`${r}px`},"aria-label":a,role:"img",children:L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:En("text-gray-400",!i&&"dark:text-gray-500"),style:{width:`${Math.max(r/2,12)}px`,height:`${Math.max(r/2,12)}px`},children:L.jsx("path",{fillRule:"evenodd",d:"M7.5 6a4.5 4.5 0 119 0 4.5 4.5 0 01-9 0zM3.751 20.105a8.25 8.25 0 0116.498 0 .75.75 0 01-.437.695A18.683 18.683 0 0112 22.5c-2.786 0-5.433-.608-7.812-1.7a.75.75 0 01-.437-.695z",clipRule:"evenodd"})})}):L.jsx("img",{src:l,alt:a,className:En("rounded-full",n),style:{width:`${r}px`,height:`${r}px`,objectFit:"cover"},loading:"lazy"})}const fo=O.forwardRef(({className:e="",children:t,style:n,...r},o)=>{var c;const{activeAddress:i}=xt.useWallet(),s=qi({enabled:!!i}),a=((c=s.data)==null?void 0:c.name)??null;return L.jsx("button",{ref:o,className:En("flex items-center py-2.5 pl-3 md:pl-3.5 pr-3 bg-[var(--wui-color-primary)] text-[var(--wui-color-primary-text)] rounded-xl cursor-pointer font-bold",e),style:n,disabled:!1,...r,type:"button",children:t||L.jsxs("div",{className:"flex items-center",children:[i&&L.jsx("div",{className:"mr-1 md:mr-2 h-6 w-6 overflow-hidden",children:L.jsx(zi,{nfd:s.data,alt:`${a||i} avatar`,size:24,lightOnly:!0})}),L.jsx("span",{className:"hidden md:block max-w-[160px] truncate",children:a||(i?Xn(i,6,4):"Connect")}),i&&L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 16 16",fill:"none",className:"ml-1.5 mt-0.5","aria-hidden":"true",children:L.jsx("path",{d:"M4 6L8 10L12 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})})});fo.displayName="ConnectedWalletButton";const oc=typeof document<"u"?O.useLayoutEffect:()=>{};function Vh(e){const t=O.useRef(null);return oc(()=>{t.current=e},[e]),O.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const zt=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},Yt=e=>e&&"window"in e&&e.window===e?e:zt(e).defaultView||window;function qh(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function zh(e){return qh(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let Gh=!1;function Gi(){return Gh}function ic(e,t){if(!Gi())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:zh(n)?n=n.host:n=n.parentNode}return!1}const wi=(e=document)=>{var t;if(!Gi())return e.activeElement;let n=e.activeElement;for(;n&&"shadowRoot"in n&&(!((t=n.shadowRoot)===null||t===void 0)&&t.activeElement);)n=n.shadowRoot.activeElement;return n};function sc(e){return Gi()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function ho(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function _i(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function Rt(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const Qi=Rt(function(){return _i(/^Mac/i)}),_h=Rt(function(){return _i(/^iPhone/i)}),Qh=Rt(function(){return _i(/^iPad/i)||Qi()&&navigator.maxTouchPoints>1}),Kh=Rt(function(){return _h()||Qh()});Rt(function(){return Qi()||Kh()});Rt(function(){return ho(/AppleWebKit/i)&&!Yh()});const Yh=Rt(function(){return ho(/Chrome/i)}),Xh=Rt(function(){return ho(/Android/i)});Rt(function(){return ho(/Firefox/i)});function ac(){let e=O.useRef(new Map),t=O.useCallback((o,i,s,a)=>{let l=a!=null&&a.once?(...c)=>{e.current.delete(s),s(...c)}:s;e.current.set(s,{type:i,eventTarget:o,fn:l,options:a}),o.addEventListener(i,l,a)},[]),n=O.useCallback((o,i,s,a)=>{var l;let c=((l=e.current.get(s))===null||l===void 0?void 0:l.fn)||s;o.removeEventListener(i,c,a),e.current.delete(s)},[]),r=O.useCallback(()=>{e.current.forEach((o,i)=>{n(o.eventTarget,o.type,i,o.options)})},[n]);return O.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function Jh(e){return e.mozInputSource===0&&e.isTrusted?!0:Xh()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function lc(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function Zh(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function cc(e){let t=O.useRef({isFocused:!1,observer:null});oc(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=Vh(r=>{e==null||e(r)});return O.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let o=r.target,i=s=>{if(t.current.isFocused=!1,o.disabled){let a=lc(s);n(a)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};o.addEventListener("focusout",i,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&o.disabled){var s;(s=t.current.observer)===null||s===void 0||s.disconnect();let a=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:a})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:a}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[n])}let ep=!1,vr=null,xi=new Set,tr=new Map,hn=!1,Ei=!1;const tp={Tab:!0,Escape:!0};function Ki(e,t){for(let n of xi)n(e,t)}function np(e){return!(e.metaKey||!Qi()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Xr(e){hn=!0,np(e)&&(vr="keyboard",Ki("keyboard",e))}function Ve(e){vr="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(hn=!0,Ki("pointer",e))}function uc(e){Jh(e)&&(hn=!0,vr="virtual")}function fc(e){e.target===window||e.target===document||ep||!e.isTrusted||(!hn&&!Ei&&(vr="virtual",Ki("virtual",e)),hn=!1,Ei=!1)}function dc(){hn=!1,Ei=!0}function Ri(e){if(typeof window>"u"||typeof document>"u"||tr.get(Yt(e)))return;const t=Yt(e),n=zt(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){hn=!0,r.apply(this,arguments)},n.addEventListener("keydown",Xr,!0),n.addEventListener("keyup",Xr,!0),n.addEventListener("click",uc,!0),t.addEventListener("focus",fc,!0),t.addEventListener("blur",dc,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",Ve,!0),n.addEventListener("pointermove",Ve,!0),n.addEventListener("pointerup",Ve,!0)):process.env.NODE_ENV==="test"&&(n.addEventListener("mousedown",Ve,!0),n.addEventListener("mousemove",Ve,!0),n.addEventListener("mouseup",Ve,!0)),t.addEventListener("beforeunload",()=>{hc(e)},{once:!0}),tr.set(t,{focus:r})}const hc=(e,t)=>{const n=Yt(e),r=zt(e);t&&r.removeEventListener("DOMContentLoaded",t),tr.has(n)&&(n.HTMLElement.prototype.focus=tr.get(n).focus,r.removeEventListener("keydown",Xr,!0),r.removeEventListener("keyup",Xr,!0),r.removeEventListener("click",uc,!0),n.removeEventListener("focus",fc,!0),n.removeEventListener("blur",dc,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",Ve,!0),r.removeEventListener("pointermove",Ve,!0),r.removeEventListener("pointerup",Ve,!0)):process.env.NODE_ENV==="test"&&(r.removeEventListener("mousedown",Ve,!0),r.removeEventListener("mousemove",Ve,!0),r.removeEventListener("mouseup",Ve,!0)),tr.delete(n))};function rp(e){const t=zt(e);let n;return t.readyState!=="loading"?Ri(e):(n=()=>{Ri(e)},t.addEventListener("DOMContentLoaded",n)),()=>hc(e,n)}typeof document<"u"&&rp();function pc(){return vr!=="pointer"}const op=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function ip(e,t,n){let r=zt(n==null?void 0:n.target);const o=typeof window<"u"?Yt(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,i=typeof window<"u"?Yt(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,s=typeof window<"u"?Yt(n==null?void 0:n.target).HTMLElement:HTMLElement,a=typeof window<"u"?Yt(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||r.activeElement instanceof o&&!op.has(r.activeElement.type)||r.activeElement instanceof i||r.activeElement instanceof s&&r.activeElement.isContentEditable,!(e&&t==="keyboard"&&n instanceof a&&!tp[n.key])}function sp(e,t,n){Ri(),O.useEffect(()=>{let r=(o,i)=>{ip(!!(n!=null&&n.isTextInput),o,i)&&e(pc())};return xi.add(r),()=>{xi.delete(r)}},t)}function ap(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const i=O.useCallback(l=>{if(l.target===l.currentTarget)return r&&r(l),o&&o(!1),!0},[r,o]),s=cc(i),a=O.useCallback(l=>{const c=zt(l.target),d=c?wi(c):wi();l.target===l.currentTarget&&d===sc(l.nativeEvent)&&(n&&n(l),o&&o(!0),s(l))},[o,n,s]);return{focusProps:{onFocus:!t&&(n||o||r)?a:void 0,onBlur:!t&&(r||o)?i:void 0}}}function lp(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,i=O.useRef({isFocusWithin:!1}),{addGlobalListener:s,removeAllGlobalListeners:a}=ac(),l=O.useCallback(h=>{h.currentTarget.contains(h.target)&&i.current.isFocusWithin&&!h.currentTarget.contains(h.relatedTarget)&&(i.current.isFocusWithin=!1,a(),n&&n(h),o&&o(!1))},[n,o,i,a]),c=cc(l),d=O.useCallback(h=>{if(!h.currentTarget.contains(h.target))return;const m=zt(h.target),f=wi(m);if(!i.current.isFocusWithin&&f===sc(h.nativeEvent)){r&&r(h),o&&o(!0),i.current.isFocusWithin=!0,c(h);let x=h.currentTarget;s(m,"focus",b=>{if(i.current.isFocusWithin&&!ic(x,b.target)){let R=new m.defaultView.FocusEvent("blur",{relatedTarget:b.target});Zh(R,x);let $=lc(R);l($)}},{capture:!0})}},[r,o,c,s,l]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:d,onBlur:l}}}let Jr=!1,No=0;function Si(){Jr=!0,setTimeout(()=>{Jr=!1},50)}function sa(e){e.pointerType==="touch"&&Si()}function cp(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",sa):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",Si),No++,()=>{No--,!(No>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",sa):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",Si))}}function up(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[i,s]=O.useState(!1),a=O.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;O.useEffect(cp,[]);let{addGlobalListener:l,removeAllGlobalListeners:c}=ac(),{hoverProps:d,triggerHoverEnd:h}=O.useMemo(()=>{let m=(b,R)=>{if(a.pointerType=R,o||R==="touch"||a.isHovered||!b.currentTarget.contains(b.target))return;a.isHovered=!0;let $=b.currentTarget;a.target=$,l(zt(b.target),"pointerover",w=>{a.isHovered&&a.target&&!ic(a.target,w.target)&&f(w,w.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:$,pointerType:R}),n&&n(!0),s(!0)},f=(b,R)=>{let $=a.target;a.pointerType="",a.target=null,!(R==="touch"||!a.isHovered||!$)&&(a.isHovered=!1,c(),r&&r({type:"hoverend",target:$,pointerType:R}),n&&n(!1),s(!1))},x={};return typeof PointerEvent<"u"?(x.onPointerEnter=b=>{Jr&&b.pointerType==="mouse"||m(b,b.pointerType)},x.onPointerLeave=b=>{!o&&b.currentTarget.contains(b.target)&&f(b,b.pointerType)}):process.env.NODE_ENV==="test"&&(x.onTouchStart=()=>{a.ignoreEmulatedMouseEvents=!0},x.onMouseEnter=b=>{!a.ignoreEmulatedMouseEvents&&!Jr&&m(b,"mouse"),a.ignoreEmulatedMouseEvents=!1},x.onMouseLeave=b=>{!o&&b.currentTarget.contains(b.target)&&f(b,"mouse")}),{hoverProps:x,triggerHoverEnd:f}},[t,n,r,o,a,l,c]);return O.useEffect(()=>{o&&h({currentTarget:a.target},a.pointerType)},[o]),{hoverProps:d,isHovered:i}}function fp(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=O.useRef({isFocused:!1,isFocusVisible:t||pc()}),[i,s]=O.useState(!1),[a,l]=O.useState(()=>o.current.isFocused&&o.current.isFocusVisible),c=O.useCallback(()=>l(o.current.isFocused&&o.current.isFocusVisible),[]),d=O.useCallback(f=>{o.current.isFocused=f,s(f),c()},[c]);sp(f=>{o.current.isFocusVisible=f,c()},[],{isTextInput:n});let{focusProps:h}=ap({isDisabled:r,onFocusChange:d}),{focusWithinProps:m}=lp({isDisabled:!r,onFocusWithinChange:d});return{isFocused:i,isFocusVisible:a,focusProps:r?m:h}}var dp=Object.defineProperty,hp=(e,t,n)=>t in e?dp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Lo=(e,t,n)=>(hp(e,typeof t!="symbol"?t+"":t,n),n);let pp=class{constructor(){Lo(this,"current",this.detect()),Lo(this,"handoffState","pending"),Lo(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},cn=new pp;function br(e){var t,n;return cn.isServer?null:e?"ownerDocument"in e?e.ownerDocument:"current"in e?(n=(t=e.current)==null?void 0:t.ownerDocument)!=null?n:document:null:document}function mc(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Je(){let e=[],t={addEventListener(n,r,o,i){return n.addEventListener(r,o,i),t.add(()=>n.removeEventListener(r,o,i))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return mc(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let i=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:i})})},group(n){let r=Je();return n(r),this.add(()=>r.dispose())},add(n){return e.includes(n)||e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let o of e.splice(r,1))o()}},dispose(){for(let n of e.splice(0))n()}};return t}function yr(){let[e]=O.useState(Je);return O.useEffect(()=>()=>e.dispose(),[e]),e}let xe=(e,t)=>{cn.isServer?O.useEffect(e,t):O.useLayoutEffect(e,t)};function zn(e){let t=O.useRef(e);return xe(()=>{t.current=e},[e]),t}let ce=function(e){let t=zn(e);return O.useCallback((...n)=>t.current(...n),[t])};function mp(e){let t=e.width/2,n=e.height/2;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function gp(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function vp({disabled:e=!1}={}){let t=O.useRef(null),[n,r]=O.useState(!1),o=yr(),i=ce(()=>{t.current=null,r(!1),o.dispose()}),s=ce(a=>{if(o.dispose(),t.current===null){t.current=a.currentTarget,r(!0);{let l=br(a.currentTarget);o.addEventListener(l,"pointerup",i,!1),o.addEventListener(l,"pointermove",c=>{if(t.current){let d=mp(c);r(gp(d,t.current.getBoundingClientRect()))}},!1),o.addEventListener(l,"pointercancel",i,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:s,onPointerUp:i,onClick:i}}}let bp=O.createContext(void 0);function Yi(){return O.useContext(bp)}function aa(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function ut(e,t,...n){if(e in t){let o=t[e];return typeof o=="function"?o(...n):o}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,ut),r}var Ci=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Ci||{}),yp=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(yp||{});function Ze(){let e=xp();return O.useCallback(t=>wp({mergeRefs:e,...t}),[e])}function wp({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:s,mergeRefs:a}){a=a??Ep;let l=gc(t,e);if(i)return Mr(l,n,r,s,a);let c=o??0;if(c&2){let{static:d=!1,...h}=l;if(d)return Mr(h,n,r,s,a)}if(c&1){let{unmount:d=!0,...h}=l;return ut(d?0:1,{0(){return null},1(){return Mr({...h,hidden:!0,style:{display:"none"}},n,r,s,a)}})}return Mr(l,n,r,s,a)}function Mr(e,t={},n,r,o){let{as:i=n,children:s,refName:a="ref",...l}=jo(e,["unmount","static"]),c=e.ref!==void 0?{[a]:e.ref}:{},d=typeof s=="function"?s(t):s;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(t)),l["aria-labelledby"]&&l["aria-labelledby"]===l.id&&(l["aria-labelledby"]=void 0);let h={};if(t){let m=!1,f=[];for(let[x,b]of Object.entries(t))typeof b=="boolean"&&(m=!0),b===!0&&f.push(x.replace(/([A-Z])/g,R=>`-${R.toLowerCase()}`));if(m){h["data-headlessui-state"]=f.join(" ");for(let x of f)h[`data-${x}`]=""}}if(i===O.Fragment&&(Object.keys(Kt(l)).length>0||Object.keys(Kt(h)).length>0))if(!O.isValidElement(d)||Array.isArray(d)&&d.length>1){if(Object.keys(Kt(l)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(Kt(l)).concat(Object.keys(Kt(h))).map(m=>` - ${m}`).join(`
|
|
69
|
-
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(
|
|
78
|
+
`,document.head.appendChild(e)}const jh=()=>new Rh({defaultOptions:{queries:{staleTime:300*1e3,gcTime:3600*1e3,refetchOnWindowFocus:!0,refetchInterval:600*1e3,retry:(e,t)=>t instanceof Error&&t.message.includes("404")?!1:e<3}}}),Xl=A.createContext(void 0);function Bh({enabled:e,nfdView:t}){const n=Ql(),{activeAddress:r,activeWallet:o,algodClient:s}=St.useWallet(),{activeNetwork:i}=St.useNetwork(),a=A.useRef(null);return A.useEffect(()=>{if(!e){a.current=r;return}const l=a.current===null&&r!==null&&o!==null&&o.accounts!==void 0&&o.accounts.length>0&&s!==void 0;if(a.current=r,!l)return;console.log(`[WalletUI] Prefetching data for all accounts in wallet ${o.id}`);const c=o.accounts.map(d=>d.address);if(c.length>0){const h=[];for(let p=0;p<c.length;p+=20)h.push(c.slice(p,p+20));h.forEach(async p=>{const w=i==="testnet"?"https://api.testnet.nf.domains":"https://api.nf.domains",y=new URLSearchParams;p.forEach(R=>{y.append("address",R)}),y.append("view",t);try{const R=await fetch(`${w}/nfd/lookup?${y.toString()}`,{method:"GET",headers:{Accept:"application/json"}});if(!R.ok&&R.status!==404)throw new Error(`NFD prefetch lookup failed: ${R.statusText}`);const k=R.status===404?{}:await R.json();p.forEach(x=>{const F=k[x]||null;n.setQueryData(["nfd",x,i,t],F)})}catch(R){console.error("Error prefetching NFD data:",R)}})}c.forEach(d=>{n.prefetchQuery({queryKey:["account-balance",d],queryFn:async()=>{try{const h=await s.accountInformation(d).do();return Number(h.amount)}catch(h){throw new Error(`Error fetching account balance: ${h}`)}}})})},[r,o,i,t,s,n,e]),null}function Wh({children:e,queryClient:t,enablePrefetching:n=!0,prefetchNfdView:r="thumbnail",theme:o="system"}){const s=A.useMemo(()=>t||jh(),[t]),i=Yl(o);A.useEffect(()=>{Lh()},[]);const a=A.useMemo(()=>({queryClient:s,theme:o,resolvedTheme:i}),[s,o,i]),l=o==="system"?void 0:o,c=L.jsx(Xl.Provider,{value:a,children:L.jsxs("div",{"data-wallet-ui":!0,"data-theme":l,children:[L.jsx(Bh,{enabled:n,nfdView:r}),e]})});return t?c:L.jsx(Kl,{client:s,children:c})}function so(){const e=A.useContext(Xl);if(e===void 0)throw new Error("useWalletUI must be used within a WalletUIProvider");return e}function Jl({wallets:e,handleWalletClick:t}){return L.jsxs("ul",{className:"space-y-1.5",children:[e.map(n=>L.jsx("li",{children:L.jsxs("button",{onClick:()=>t(n),className:"flex w-full items-center gap-3 py-1.5 px-1.5 text-left text-(--wui-color-text) transition-colors hover:bg-(--wui-color-bg-hover) rounded-xl",children:[L.jsx("div",{className:"shrink-0 h-8 w-8 rounded-md overflow-hidden bg-(--wui-color-bg-secondary) flex items-center justify-center",children:L.jsx("img",{src:n.metadata.icon,alt:`${n.metadata.name} icon`,className:"h-8 w-8 object-contain rounded-md"})}),L.jsx("span",{className:"text-lg font-bold wallet-custom-font",children:n.metadata.name})]})},n.id)),e.length===0&&L.jsx("p",{className:"text-center text-(--wui-color-text-secondary)",children:"No wallets found."})]})}function Zl({children:e}){const[t,n]=A.useState(!1),[r,o]=A.useState(null),{wallets:s,activeAddress:i}=St.useWallet(),{theme:a}=so(),l=a==="system"?void 0:a,{refs:c,context:d}=Ll({open:t,onOpenChange:u=>{u&&i||(u?(n(!0),o("starting"),requestAnimationFrame(()=>{o("entered")})):(o("exiting"),setTimeout(()=>{n(!1),o(null)},150)))}}),h=Nl(d),p=Dl(d,{outsidePressEvent:"mousedown"}),f=Zd(d,{role:"dialog"}),{getReferenceProps:w,getFloatingProps:y}=jl([h,p,f]),R=qn(),k=qn(),x=async u=>{try{await u.connect(),d.onOpenChange(!1)}catch(g){console.error(`Error connecting to ${u.metadata.name}:`,g),d.onOpenChange(!1)}},F=u=>{i||d.onOpenChange(!0)},$=e||L.jsx(Es,{}),D=Od([c.setReference,$.ref||null]),j={...w(),ref:D,onClick:F},W=A.cloneElement($,j);return L.jsxs(L.Fragment,{children:[W,L.jsx(Il,{id:"wallet-dialog-portal",children:t&&L.jsx("div",{"data-wallet-ui":!0,"data-wallet-ui-scope":!0,"data-theme":l,children:L.jsx(Gd,{className:"grid place-items-center px-4 z-50 transition-opacity duration-150 ease-in-out bg-(--wui-color-overlay) data-[state=starting]:opacity-0 data-[state=exiting]:opacity-0 data-[state=entered]:opacity-100","data-state":r,lockScroll:!0,children:L.jsx($l,{context:d,modal:!0,children:L.jsxs("div",{ref:c.setFloating,...y({"aria-labelledby":R,"aria-describedby":k}),"data-state":r,className:"w-full max-w-sm rounded-3xl bg-(--wui-color-bg) shadow-xl transform transition-all duration-150 ease-in-out data-[state=starting]:opacity-0 data-[state=starting]:scale-90 data-[state=exiting]:opacity-0 data-[state=exiting]:scale-90 data-[state=entered]:opacity-100 data-[state=entered]:scale-100",style:{marginTop:"-0.5rem"},children:[L.jsxs("div",{className:"relative flex items-center px-6 pt-5 pb-4",children:[L.jsx("h2",{id:R,className:"text-xl font-bold text-(--wui-color-text) wallet-custom-font",children:"Connect a Wallet"}),L.jsx("button",{onClick:()=>d.onOpenChange(!1),className:"absolute right-4 rounded-full bg-(--wui-color-bg-tertiary) p-2 text-(--wui-color-text-secondary) hover:brightness-90 transition-all","aria-label":"Close dialog",children:L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:L.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),L.jsx("div",{className:"px-4 pb-3",children:L.jsx(Jl,{wallets:s,handleWalletClick:x})}),L.jsxs("div",{className:"px-6 py-5 border-t border-(--wui-color-border) flex items-center justify-between",children:[L.jsx("span",{className:"text-(--wui-color-text-secondary) text-sm",children:"Need an Algorand wallet?"}),L.jsx("a",{href:"https://algorand.co/wallets",className:"text-(--wui-color-link) font-medium text-sm hover:text-(--wui-color-link-hover)",target:"_blank",rel:"noopener noreferrer",children:"Start here →"})]})]})})})})})]})}var Hh=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Oo=Math.ceil,Qe=Math.floor,Ie="[BigNumber Error] ",_i=Ie+"Number primitive has more than 15 significant digits: ",Ze=1e14,ne=14,Gi=9007199254740991,Ao=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Ft=1e7,Be=1e9;function ec(e){var t,n,r,o=x.prototype={constructor:x,toString:null,valueOf:null},s=new x(1),i=20,a=4,l=-7,c=21,d=-1e7,h=1e7,p=!1,f=1,w=0,y={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},R="0123456789abcdefghijklmnopqrstuvwxyz",k=!0;function x(u,g){var m,C,O,T,S,b,E,I,v=this;if(!(v instanceof x))return new x(u,g);if(g==null){if(u&&u._isBigNumber===!0){v.s=u.s,!u.c||u.e>h?v.c=v.e=null:u.e<d?v.c=[v.e=0]:(v.e=u.e,v.c=u.c.slice());return}if((b=typeof u=="number")&&u*0==0){if(v.s=1/u<0?(u=-u,-1):1,u===~~u){for(T=0,S=u;S>=10;S/=10,T++);T>h?v.c=v.e=null:(v.e=T,v.c=[u]);return}I=String(u)}else{if(!Hh.test(I=String(u)))return r(v,I,b);v.s=I.charCodeAt(0)==45?(I=I.slice(1),-1):1}(T=I.indexOf("."))>-1&&(I=I.replace(".","")),(S=I.search(/e/i))>0?(T<0&&(T=S),T+=+I.slice(S+1),I=I.substring(0,S)):T<0&&(T=I.length)}else{if(fe(g,2,R.length,"Base"),g==10&&k)return v=new x(u),j(v,i+v.e+1,a);if(I=String(u),b=typeof u=="number"){if(u*0!=0)return r(v,I,b,g);if(v.s=1/u<0?(I=I.slice(1),-1):1,x.DEBUG&&I.replace(/^0\.0*|\./,"").length>15)throw Error(_i+u)}else v.s=I.charCodeAt(0)===45?(I=I.slice(1),-1):1;for(m=R.slice(0,g),T=S=0,E=I.length;S<E;S++)if(m.indexOf(C=I.charAt(S))<0){if(C=="."){if(S>T){T=E;continue}}else if(!O&&(I==I.toUpperCase()&&(I=I.toLowerCase())||I==I.toLowerCase()&&(I=I.toUpperCase()))){O=!0,S=-1,T=0;continue}return r(v,String(u),b,g)}b=!1,I=n(I,g,10,v.s),(T=I.indexOf("."))>-1?I=I.replace(".",""):T=I.length}for(S=0;I.charCodeAt(S)===48;S++);for(E=I.length;I.charCodeAt(--E)===48;);if(I=I.slice(S,++E)){if(E-=S,b&&x.DEBUG&&E>15&&(u>Gi||u!==Qe(u)))throw Error(_i+v.s*u);if((T=T-S-1)>h)v.c=v.e=null;else if(T<d)v.c=[v.e=0];else{if(v.e=T,v.c=[],S=(T+1)%ne,T<0&&(S+=ne),S<E){for(S&&v.c.push(+I.slice(0,S)),E-=ne;S<E;)v.c.push(+I.slice(S,S+=ne));S=ne-(I=I.slice(S)).length}else S-=E;for(;S--;I+="0");v.c.push(+I)}}else v.c=[v.e=0]}x.clone=ec,x.ROUND_UP=0,x.ROUND_DOWN=1,x.ROUND_CEIL=2,x.ROUND_FLOOR=3,x.ROUND_HALF_UP=4,x.ROUND_HALF_DOWN=5,x.ROUND_HALF_EVEN=6,x.ROUND_HALF_CEIL=7,x.ROUND_HALF_FLOOR=8,x.EUCLID=9,x.config=x.set=function(u){var g,m;if(u!=null)if(typeof u=="object"){if(u.hasOwnProperty(g="DECIMAL_PLACES")&&(m=u[g],fe(m,0,Be,g),i=m),u.hasOwnProperty(g="ROUNDING_MODE")&&(m=u[g],fe(m,0,8,g),a=m),u.hasOwnProperty(g="EXPONENTIAL_AT")&&(m=u[g],m&&m.pop?(fe(m[0],-1e9,0,g),fe(m[1],0,Be,g),l=m[0],c=m[1]):(fe(m,-1e9,Be,g),l=-(c=m<0?-m:m))),u.hasOwnProperty(g="RANGE"))if(m=u[g],m&&m.pop)fe(m[0],-1e9,-1,g),fe(m[1],1,Be,g),d=m[0],h=m[1];else if(fe(m,-1e9,Be,g),m)d=-(h=m<0?-m:m);else throw Error(Ie+g+" cannot be zero: "+m);if(u.hasOwnProperty(g="CRYPTO"))if(m=u[g],m===!!m)if(m)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))p=m;else throw p=!m,Error(Ie+"crypto unavailable");else p=m;else throw Error(Ie+g+" not true or false: "+m);if(u.hasOwnProperty(g="MODULO_MODE")&&(m=u[g],fe(m,0,9,g),f=m),u.hasOwnProperty(g="POW_PRECISION")&&(m=u[g],fe(m,0,Be,g),w=m),u.hasOwnProperty(g="FORMAT"))if(m=u[g],typeof m=="object")y=m;else throw Error(Ie+g+" not an object: "+m);if(u.hasOwnProperty(g="ALPHABET"))if(m=u[g],typeof m=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(m))k=m.slice(0,10)=="0123456789",R=m;else throw Error(Ie+g+" invalid: "+m)}else throw Error(Ie+"Object expected: "+u);return{DECIMAL_PLACES:i,ROUNDING_MODE:a,EXPONENTIAL_AT:[l,c],RANGE:[d,h],CRYPTO:p,MODULO_MODE:f,POW_PRECISION:w,FORMAT:y,ALPHABET:R}},x.isBigNumber=function(u){if(!u||u._isBigNumber!==!0)return!1;if(!x.DEBUG)return!0;var g,m,C=u.c,O=u.e,T=u.s;e:if({}.toString.call(C)=="[object Array]"){if((T===1||T===-1)&&O>=-1e9&&O<=Be&&O===Qe(O)){if(C[0]===0){if(O===0&&C.length===1)return!0;break e}if(g=(O+1)%ne,g<1&&(g+=ne),String(C[0]).length==g){for(g=0;g<C.length;g++)if(m=C[g],m<0||m>=Ze||m!==Qe(m))break e;if(m!==0)return!0}}}else if(C===null&&O===null&&(T===null||T===1||T===-1))return!0;throw Error(Ie+"Invalid BigNumber: "+u)},x.maximum=x.max=function(){return $(arguments,-1)},x.minimum=x.min=function(){return $(arguments,1)},x.random=(function(){var u=9007199254740992,g=Math.random()*u&2097151?function(){return Qe(Math.random()*u)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(m){var C,O,T,S,b,E=0,I=[],v=new x(s);if(m==null?m=i:fe(m,0,Be),S=Oo(m/ne),p)if(crypto.getRandomValues){for(C=crypto.getRandomValues(new Uint32Array(S*=2));E<S;)b=C[E]*131072+(C[E+1]>>>11),b>=9e15?(O=crypto.getRandomValues(new Uint32Array(2)),C[E]=O[0],C[E+1]=O[1]):(I.push(b%1e14),E+=2);E=S/2}else if(crypto.randomBytes){for(C=crypto.randomBytes(S*=7);E<S;)b=(C[E]&31)*281474976710656+C[E+1]*1099511627776+C[E+2]*4294967296+C[E+3]*16777216+(C[E+4]<<16)+(C[E+5]<<8)+C[E+6],b>=9e15?crypto.randomBytes(7).copy(C,E):(I.push(b%1e14),E+=7);E=S/7}else throw p=!1,Error(Ie+"crypto unavailable");if(!p)for(;E<S;)b=g(),b<9e15&&(I[E++]=b%1e14);for(S=I[--E],m%=ne,S&&m&&(b=Ao[ne-m],I[E]=Qe(S/b)*b);I[E]===0;I.pop(),E--);if(E<0)I=[T=0];else{for(T=-1;I[0]===0;I.splice(0,1),T-=ne);for(E=1,b=I[0];b>=10;b/=10,E++);E<ne&&(T-=ne-E)}return v.e=T,v.c=I,v}})(),x.sum=function(){for(var u=1,g=arguments,m=new x(g[0]);u<g.length;)m=m.plus(g[u++]);return m},n=(function(){var u="0123456789";function g(m,C,O,T){for(var S,b=[0],E,I=0,v=m.length;I<v;){for(E=b.length;E--;b[E]*=C);for(b[0]+=T.indexOf(m.charAt(I++)),S=0;S<b.length;S++)b[S]>O-1&&(b[S+1]==null&&(b[S+1]=0),b[S+1]+=b[S]/O|0,b[S]%=O)}return b.reverse()}return function(m,C,O,T,S){var b,E,I,v,M,B,V,G,U=m.indexOf("."),Z=i,Q=a;for(U>=0&&(v=w,w=0,m=m.replace(".",""),G=new x(C),B=G.pow(m.length-U),w=v,G.c=g(wt(_e(B.c),B.e,"0"),10,O,u),G.e=G.c.length),V=g(m,C,O,S?(b=R,u):(b=u,R)),I=v=V.length;V[--v]==0;V.pop());if(!V[0])return b.charAt(0);if(U<0?--I:(B.c=V,B.e=I,B.s=T,B=t(B,G,Z,Q,O),V=B.c,M=B.r,I=B.e),E=I+Z+1,U=V[E],v=O/2,M=M||E<0||V[E+1]!=null,M=Q<4?(U!=null||M)&&(Q==0||Q==(B.s<0?3:2)):U>v||U==v&&(Q==4||M||Q==6&&V[E-1]&1||Q==(B.s<0?8:7)),E<1||!V[0])m=M?wt(b.charAt(1),-Z,b.charAt(0)):b.charAt(0);else{if(V.length=E,M)for(--O;++V[--E]>O;)V[E]=0,E||(++I,V=[1].concat(V));for(v=V.length;!V[--v];);for(U=0,m="";U<=v;m+=b.charAt(V[U++]));m=wt(m,I,b.charAt(0))}return m}})(),t=(function(){function u(C,O,T){var S,b,E,I,v=0,M=C.length,B=O%Ft,V=O/Ft|0;for(C=C.slice();M--;)E=C[M]%Ft,I=C[M]/Ft|0,S=V*E+I*B,b=B*E+S%Ft*Ft+v,v=(b/T|0)+(S/Ft|0)+V*I,C[M]=b%T;return v&&(C=[v].concat(C)),C}function g(C,O,T,S){var b,E;if(T!=S)E=T>S?1:-1;else for(b=E=0;b<T;b++)if(C[b]!=O[b]){E=C[b]>O[b]?1:-1;break}return E}function m(C,O,T,S){for(var b=0;T--;)C[T]-=b,b=C[T]<O[T]?1:0,C[T]=b*S+C[T]-O[T];for(;!C[0]&&C.length>1;C.splice(0,1));}return function(C,O,T,S,b){var E,I,v,M,B,V,G,U,Z,Q,H,K,Ae,Fe,Le,be,J,te=C.s==O.s?1:-1,X=C.c,ee=O.c;if(!X||!X[0]||!ee||!ee[0])return new x(!C.s||!O.s||(X?ee&&X[0]==ee[0]:!ee)?NaN:X&&X[0]==0||!ee?te*0:te/0);for(U=new x(te),Z=U.c=[],I=C.e-O.e,te=T+I+1,b||(b=Ze,I=Ke(C.e/ne)-Ke(O.e/ne),te=te/ne|0),v=0;ee[v]==(X[v]||0);v++);if(ee[v]>(X[v]||0)&&I--,te<0)Z.push(1),M=!0;else{for(Fe=X.length,be=ee.length,v=0,te+=2,B=Qe(b/(ee[0]+1)),B>1&&(ee=u(ee,B,b),X=u(X,B,b),be=ee.length,Fe=X.length),Ae=be,Q=X.slice(0,be),H=Q.length;H<be;Q[H++]=0);J=ee.slice(),J=[0].concat(J),Le=ee[0],ee[1]>=b/2&&Le++;do{if(B=0,E=g(ee,Q,be,H),E<0){if(K=Q[0],be!=H&&(K=K*b+(Q[1]||0)),B=Qe(K/Le),B>1)for(B>=b&&(B=b-1),V=u(ee,B,b),G=V.length,H=Q.length;g(V,Q,G,H)==1;)B--,m(V,be<G?J:ee,G,b),G=V.length,E=1;else B==0&&(E=B=1),V=ee.slice(),G=V.length;if(G<H&&(V=[0].concat(V)),m(Q,V,H,b),H=Q.length,E==-1)for(;g(ee,Q,be,H)<1;)B++,m(Q,be<H?J:ee,H,b),H=Q.length}else E===0&&(B++,Q=[0]);Z[v++]=B,Q[0]?Q[H++]=X[Ae]||0:(Q=[X[Ae]],H=1)}while((Ae++<Fe||Q[0]!=null)&&te--);M=Q[0]!=null,Z[0]||Z.splice(0,1)}if(b==Ze){for(v=1,te=Z[0];te>=10;te/=10,v++);j(U,T+(U.e=v+I*ne-1)+1,S,M)}else U.e=I,U.r=+M;return U}})();function F(u,g,m,C){var O,T,S,b,E;if(m==null?m=a:fe(m,0,8),!u.c)return u.toString();if(O=u.c[0],S=u.e,g==null)E=_e(u.c),E=C==1||C==2&&(S<=l||S>=c)?Ir(E,S):wt(E,S,"0");else if(u=j(new x(u),g,m),T=u.e,E=_e(u.c),b=E.length,C==1||C==2&&(g<=T||T<=l)){for(;b<g;E+="0",b++);E=Ir(E,T)}else if(g-=S,E=wt(E,T,"0"),T+1>b){if(--g>0)for(E+=".";g--;E+="0");}else if(g+=T-b,g>0)for(T+1==b&&(E+=".");g--;E+="0");return u.s<0&&O?"-"+E:E}function $(u,g){for(var m,C,O=1,T=new x(u[0]);O<u.length;O++)C=new x(u[O]),(!C.s||(m=Jt(T,C))===g||m===0&&T.s===g)&&(T=C);return T}function D(u,g,m){for(var C=1,O=g.length;!g[--O];g.pop());for(O=g[0];O>=10;O/=10,C++);return(m=C+m*ne-1)>h?u.c=u.e=null:m<d?u.c=[u.e=0]:(u.e=m,u.c=g),u}r=(function(){var u=/^(-?)0([xbo])(?=\w[\w.]*$)/i,g=/^([^.]+)\.$/,m=/^\.([^.]+)$/,C=/^-?(Infinity|NaN)$/,O=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(T,S,b,E){var I,v=b?S:S.replace(O,"");if(C.test(v))T.s=isNaN(v)?null:v<0?-1:1;else{if(!b&&(v=v.replace(u,function(M,B,V){return I=(V=V.toLowerCase())=="x"?16:V=="b"?2:8,!E||E==I?B:M}),E&&(I=E,v=v.replace(g,"$1").replace(m,"0.$1")),S!=v))return new x(v,I);if(x.DEBUG)throw Error(Ie+"Not a"+(E?" base "+E:"")+" number: "+S);T.s=null}T.c=T.e=null}})();function j(u,g,m,C){var O,T,S,b,E,I,v,M=u.c,B=Ao;if(M){e:{for(O=1,b=M[0];b>=10;b/=10,O++);if(T=g-O,T<0)T+=ne,S=g,E=M[I=0],v=Qe(E/B[O-S-1]%10);else if(I=Oo((T+1)/ne),I>=M.length)if(C){for(;M.length<=I;M.push(0));E=v=0,O=1,T%=ne,S=T-ne+1}else break e;else{for(E=b=M[I],O=1;b>=10;b/=10,O++);T%=ne,S=T-ne+O,v=S<0?0:Qe(E/B[O-S-1]%10)}if(C=C||g<0||M[I+1]!=null||(S<0?E:E%B[O-S-1]),C=m<4?(v||C)&&(m==0||m==(u.s<0?3:2)):v>5||v==5&&(m==4||C||m==6&&(T>0?S>0?E/B[O-S]:0:M[I-1])%10&1||m==(u.s<0?8:7)),g<1||!M[0])return M.length=0,C?(g-=u.e+1,M[0]=B[(ne-g%ne)%ne],u.e=-g||0):M[0]=u.e=0,u;if(T==0?(M.length=I,b=1,I--):(M.length=I+1,b=B[ne-T],M[I]=S>0?Qe(E/B[O-S]%B[S])*b:0),C)for(;;)if(I==0){for(T=1,S=M[0];S>=10;S/=10,T++);for(S=M[0]+=b,b=1;S>=10;S/=10,b++);T!=b&&(u.e++,M[0]==Ze&&(M[0]=1));break}else{if(M[I]+=b,M[I]!=Ze)break;M[I--]=0,b=1}for(T=M.length;M[--T]===0;M.pop());}u.e>h?u.c=u.e=null:u.e<d&&(u.c=[u.e=0])}return u}function W(u){var g,m=u.e;return m===null?u.toString():(g=_e(u.c),g=m<=l||m>=c?Ir(g,m):wt(g,m,"0"),u.s<0?"-"+g:g)}return o.absoluteValue=o.abs=function(){var u=new x(this);return u.s<0&&(u.s=1),u},o.comparedTo=function(u,g){return Jt(this,new x(u,g))},o.decimalPlaces=o.dp=function(u,g){var m,C,O,T=this;if(u!=null)return fe(u,0,Be),g==null?g=a:fe(g,0,8),j(new x(T),u+T.e+1,g);if(!(m=T.c))return null;if(C=((O=m.length-1)-Ke(this.e/ne))*ne,O=m[O])for(;O%10==0;O/=10,C--);return C<0&&(C=0),C},o.dividedBy=o.div=function(u,g){return t(this,new x(u,g),i,a)},o.dividedToIntegerBy=o.idiv=function(u,g){return t(this,new x(u,g),0,1)},o.exponentiatedBy=o.pow=function(u,g){var m,C,O,T,S,b,E,I,v,M=this;if(u=new x(u),u.c&&!u.isInteger())throw Error(Ie+"Exponent not an integer: "+W(u));if(g!=null&&(g=new x(g)),b=u.e>14,!M.c||!M.c[0]||M.c[0]==1&&!M.e&&M.c.length==1||!u.c||!u.c[0])return v=new x(Math.pow(+W(M),b?u.s*(2-Fr(u)):+W(u))),g?v.mod(g):v;if(E=u.s<0,g){if(g.c?!g.c[0]:!g.s)return new x(NaN);C=!E&&M.isInteger()&&g.isInteger(),C&&(M=M.mod(g))}else{if(u.e>9&&(M.e>0||M.e<-1||(M.e==0?M.c[0]>1||b&&M.c[1]>=24e7:M.c[0]<8e13||b&&M.c[0]<=9999975e7)))return T=M.s<0&&Fr(u)?-0:0,M.e>-1&&(T=1/T),new x(E?1/T:T);w&&(T=Oo(w/ne+2))}for(b?(m=new x(.5),E&&(u.s=1),I=Fr(u)):(O=Math.abs(+W(u)),I=O%2),v=new x(s);;){if(I){if(v=v.times(M),!v.c)break;T?v.c.length>T&&(v.c.length=T):C&&(v=v.mod(g))}if(O){if(O=Qe(O/2),O===0)break;I=O%2}else if(u=u.times(m),j(u,u.e+1,1),u.e>14)I=Fr(u);else{if(O=+W(u),O===0)break;I=O%2}M=M.times(M),T?M.c&&M.c.length>T&&(M.c.length=T):C&&(M=M.mod(g))}return C?v:(E&&(v=s.div(v)),g?v.mod(g):T?j(v,w,a,S):v)},o.integerValue=function(u){var g=new x(this);return u==null?u=a:fe(u,0,8),j(g,g.e+1,u)},o.isEqualTo=o.eq=function(u,g){return Jt(this,new x(u,g))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(u,g){return Jt(this,new x(u,g))>0},o.isGreaterThanOrEqualTo=o.gte=function(u,g){return(g=Jt(this,new x(u,g)))===1||g===0},o.isInteger=function(){return!!this.c&&Ke(this.e/ne)>this.c.length-2},o.isLessThan=o.lt=function(u,g){return Jt(this,new x(u,g))<0},o.isLessThanOrEqualTo=o.lte=function(u,g){return(g=Jt(this,new x(u,g)))===-1||g===0},o.isNaN=function(){return!this.s},o.isNegative=function(){return this.s<0},o.isPositive=function(){return this.s>0},o.isZero=function(){return!!this.c&&this.c[0]==0},o.minus=function(u,g){var m,C,O,T,S=this,b=S.s;if(u=new x(u,g),g=u.s,!b||!g)return new x(NaN);if(b!=g)return u.s=-g,S.plus(u);var E=S.e/ne,I=u.e/ne,v=S.c,M=u.c;if(!E||!I){if(!v||!M)return v?(u.s=-g,u):new x(M?S:NaN);if(!v[0]||!M[0])return M[0]?(u.s=-g,u):new x(v[0]?S:a==3?-0:0)}if(E=Ke(E),I=Ke(I),v=v.slice(),b=E-I){for((T=b<0)?(b=-b,O=v):(I=E,O=M),O.reverse(),g=b;g--;O.push(0));O.reverse()}else for(C=(T=(b=v.length)<(g=M.length))?b:g,b=g=0;g<C;g++)if(v[g]!=M[g]){T=v[g]<M[g];break}if(T&&(O=v,v=M,M=O,u.s=-u.s),g=(C=M.length)-(m=v.length),g>0)for(;g--;v[m++]=0);for(g=Ze-1;C>b;){if(v[--C]<M[C]){for(m=C;m&&!v[--m];v[m]=g);--v[m],v[C]+=Ze}v[C]-=M[C]}for(;v[0]==0;v.splice(0,1),--I);return v[0]?D(u,v,I):(u.s=a==3?-1:1,u.c=[u.e=0],u)},o.modulo=o.mod=function(u,g){var m,C,O=this;return u=new x(u,g),!O.c||!u.s||u.c&&!u.c[0]?new x(NaN):!u.c||O.c&&!O.c[0]?new x(O):(f==9?(C=u.s,u.s=1,m=t(O,u,0,3),u.s=C,m.s*=C):m=t(O,u,0,f),u=O.minus(m.times(u)),!u.c[0]&&f==1&&(u.s=O.s),u)},o.multipliedBy=o.times=function(u,g){var m,C,O,T,S,b,E,I,v,M,B,V,G,U,Z,Q=this,H=Q.c,K=(u=new x(u,g)).c;if(!H||!K||!H[0]||!K[0])return!Q.s||!u.s||H&&!H[0]&&!K||K&&!K[0]&&!H?u.c=u.e=u.s=null:(u.s*=Q.s,!H||!K?u.c=u.e=null:(u.c=[0],u.e=0)),u;for(C=Ke(Q.e/ne)+Ke(u.e/ne),u.s*=Q.s,E=H.length,M=K.length,E<M&&(G=H,H=K,K=G,O=E,E=M,M=O),O=E+M,G=[];O--;G.push(0));for(U=Ze,Z=Ft,O=M;--O>=0;){for(m=0,B=K[O]%Z,V=K[O]/Z|0,S=E,T=O+S;T>O;)I=H[--S]%Z,v=H[S]/Z|0,b=V*I+v*B,I=B*I+b%Z*Z+G[T]+m,m=(I/U|0)+(b/Z|0)+V*v,G[T--]=I%U;G[T]=m}return m?++C:G.splice(0,1),D(u,G,C)},o.negated=function(){var u=new x(this);return u.s=-u.s||null,u},o.plus=function(u,g){var m,C=this,O=C.s;if(u=new x(u,g),g=u.s,!O||!g)return new x(NaN);if(O!=g)return u.s=-g,C.minus(u);var T=C.e/ne,S=u.e/ne,b=C.c,E=u.c;if(!T||!S){if(!b||!E)return new x(O/0);if(!b[0]||!E[0])return E[0]?u:new x(b[0]?C:O*0)}if(T=Ke(T),S=Ke(S),b=b.slice(),O=T-S){for(O>0?(S=T,m=E):(O=-O,m=b),m.reverse();O--;m.push(0));m.reverse()}for(O=b.length,g=E.length,O-g<0&&(m=E,E=b,b=m,g=O),O=0;g;)O=(b[--g]=b[g]+E[g]+O)/Ze|0,b[g]=Ze===b[g]?0:b[g]%Ze;return O&&(b=[O].concat(b),++S),D(u,b,S)},o.precision=o.sd=function(u,g){var m,C,O,T=this;if(u!=null&&u!==!!u)return fe(u,1,Be),g==null?g=a:fe(g,0,8),j(new x(T),u,g);if(!(m=T.c))return null;if(O=m.length-1,C=O*ne+1,O=m[O]){for(;O%10==0;O/=10,C--);for(O=m[0];O>=10;O/=10,C++);}return u&&T.e+1>C&&(C=T.e+1),C},o.shiftedBy=function(u){return fe(u,-9007199254740991,Gi),this.times("1e"+u)},o.squareRoot=o.sqrt=function(){var u,g,m,C,O,T=this,S=T.c,b=T.s,E=T.e,I=i+4,v=new x("0.5");if(b!==1||!S||!S[0])return new x(!b||b<0&&(!S||S[0])?NaN:S?T:1/0);if(b=Math.sqrt(+W(T)),b==0||b==1/0?(g=_e(S),(g.length+E)%2==0&&(g+="0"),b=Math.sqrt(+g),E=Ke((E+1)/2)-(E<0||E%2),b==1/0?g="5e"+E:(g=b.toExponential(),g=g.slice(0,g.indexOf("e")+1)+E),m=new x(g)):m=new x(b+""),m.c[0]){for(E=m.e,b=E+I,b<3&&(b=0);;)if(O=m,m=v.times(O.plus(t(T,O,I,1))),_e(O.c).slice(0,b)===(g=_e(m.c)).slice(0,b))if(m.e<E&&--b,g=g.slice(b-3,b+1),g=="9999"||!C&&g=="4999"){if(!C&&(j(O,O.e+i+2,0),O.times(O).eq(T))){m=O;break}I+=4,b+=4,C=1}else{(!+g||!+g.slice(1)&&g.charAt(0)=="5")&&(j(m,m.e+i+2,1),u=!m.times(m).eq(T));break}}return j(m,m.e+i+1,a,u)},o.toExponential=function(u,g){return u!=null&&(fe(u,0,Be),u++),F(this,u,g,1)},o.toFixed=function(u,g){return u!=null&&(fe(u,0,Be),u=u+this.e+1),F(this,u,g)},o.toFormat=function(u,g,m){var C,O=this;if(m==null)u!=null&&g&&typeof g=="object"?(m=g,g=null):u&&typeof u=="object"?(m=u,u=g=null):m=y;else if(typeof m!="object")throw Error(Ie+"Argument not an object: "+m);if(C=O.toFixed(u,g),O.c){var T,S=C.split("."),b=+m.groupSize,E=+m.secondaryGroupSize,I=m.groupSeparator||"",v=S[0],M=S[1],B=O.s<0,V=B?v.slice(1):v,G=V.length;if(E&&(T=b,b=E,E=T,G-=T),b>0&&G>0){for(T=G%b||b,v=V.substr(0,T);T<G;T+=b)v+=I+V.substr(T,b);E>0&&(v+=I+V.slice(T)),B&&(v="-"+v)}C=M?v+(m.decimalSeparator||"")+((E=+m.fractionGroupSize)?M.replace(new RegExp("\\d{"+E+"}\\B","g"),"$&"+(m.fractionGroupSeparator||"")):M):v}return(m.prefix||"")+C+(m.suffix||"")},o.toFraction=function(u){var g,m,C,O,T,S,b,E,I,v,M,B,V=this,G=V.c;if(u!=null&&(b=new x(u),!b.isInteger()&&(b.c||b.s!==1)||b.lt(s)))throw Error(Ie+"Argument "+(b.isInteger()?"out of range: ":"not an integer: ")+W(b));if(!G)return new x(V);for(g=new x(s),I=m=new x(s),C=E=new x(s),B=_e(G),T=g.e=B.length-V.e-1,g.c[0]=Ao[(S=T%ne)<0?ne+S:S],u=!u||b.comparedTo(g)>0?T>0?g:I:b,S=h,h=1/0,b=new x(B),E.c[0]=0;v=t(b,g,0,1),O=m.plus(v.times(C)),O.comparedTo(u)!=1;)m=C,C=O,I=E.plus(v.times(O=I)),E=O,g=b.minus(v.times(O=g)),b=O;return O=t(u.minus(m),C,0,1),E=E.plus(O.times(I)),m=m.plus(O.times(C)),E.s=I.s=V.s,T=T*2,M=t(I,C,T,a).minus(V).abs().comparedTo(t(E,m,T,a).minus(V).abs())<1?[I,C]:[E,m],h=S,M},o.toNumber=function(){return+W(this)},o.toPrecision=function(u,g){return u!=null&&fe(u,1,Be),F(this,u,g,2)},o.toString=function(u){var g,m=this,C=m.s,O=m.e;return O===null?C?(g="Infinity",C<0&&(g="-"+g)):g="NaN":(u==null?g=O<=l||O>=c?Ir(_e(m.c),O):wt(_e(m.c),O,"0"):u===10&&k?(m=j(new x(m),i+O+1,a),g=wt(_e(m.c),m.e,"0")):(fe(u,2,R.length,"Base"),g=n(wt(_e(m.c),O,"0"),10,u,C,!0)),C<0&&m.c[0]&&(g="-"+g)),g},o.valueOf=o.toJSON=function(){return W(this)},o._isBigNumber=!0,o[Symbol.toStringTag]="BigNumber",o[Symbol.for("nodejs.util.inspect.custom")]=o.valueOf,e!=null&&x.set(e),x}function Ke(e){var t=e|0;return e>0||e===t?t:t-1}function _e(e){for(var t,n,r=1,o=e.length,s=e[0]+"";r<o;){for(t=e[r++]+"",n=ne-t.length;n--;t="0"+t);s+=t}for(o=s.length;s.charCodeAt(--o)===48;);return s.slice(0,o+1||1)}function Jt(e,t){var n,r,o=e.c,s=t.c,i=e.s,a=t.s,l=e.e,c=t.e;if(!i||!a)return null;if(n=o&&!o[0],r=s&&!s[0],n||r)return n?r?0:-a:i;if(i!=a)return i;if(n=i<0,r=l==c,!o||!s)return r?0:!o^n?1:-1;if(!r)return l>c^n?1:-1;for(a=(l=o.length)<(c=s.length)?l:c,i=0;i<a;i++)if(o[i]!=s[i])return o[i]>s[i]^n?1:-1;return l==c?0:l>c^n?1:-1}function fe(e,t,n,r){if(e<t||e>n||e!==Qe(e))throw Error(Ie+(r||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Fr(e){var t=e.c.length-1;return Ke(e.e/ne)==t&&e.c[t]%2!=0}function Ir(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function wt(e,t,n){var r,o;if(t<0){for(o=n+".";++t;o+=n);e=o+e}else if(r=e.length,++t>r){for(o=n,t-=r;--t;o+=n);e+=o}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}ec();const Uh=100000n,Vh=(e,t={})=>{const{style:n="decimal",compact:r=!1,fractionDigits:o,adaptiveDecimals:s=!1}=t,i=typeof e=="string"?Number(e):e,a=typeof i=="bigint"?i<0n?-i:i:Math.abs(i),l=r==="auto"?a>=Uh:r,c=typeof i=="bigint"?Number(i):i,d=s&&c!==0&&Math.abs(c)<Math.pow(10,-(o??2)),h=new Intl.NumberFormat("en-US",{style:n,...n==="currency"&&{currency:"USD"},maximumFractionDigits:d?20:o??2,minimumFractionDigits:d?0:o??2});if(!l)return d?h.format(Qi(c)):h.format(i);const p=[{threshold:1e12,suffix:"T",divisor:1e12},{threshold:1e9,suffix:"B",divisor:1e9},{threshold:1e6,suffix:"M",divisor:1e6},{threshold:1e3,suffix:"K",divisor:1e3}].find(f=>a>=f.threshold);if(p){const f=new Intl.NumberFormat("en-US",{style:n,...n==="currency"&&{currency:"USD"},maximumFractionDigits:o??1,minimumFractionDigits:o??1}),w=Number(i)/p.divisor;return f.format(w)+p.suffix}return d?h.format(Qi(c)):h.format(i)};function Qi(e){if(e===0)return 0;const t=e.toExponential().split("e"),n=parseInt(t[1]),r=Math.abs(n);return Number(e.toFixed(r))}function er(e,t=5,n=5){return e?e.length<=t+n?e:`${e.slice(0,t)}...${e.slice(-n)}`:""}function $s(e={}){const{activeAddress:t}=St.useWallet(),{activeNetwork:n}=St.useNetwork(),{enabled:r=!0,view:o="thumbnail"}=e;return Ms({queryKey:["nfd",t,n,o],queryFn:async({signal:s})=>{if(!t)return null;const l=await fetch(`${n==="testnet"?"https://api.testnet.nf.domains":"https://api.nf.domains"}/nfd/lookup?address=${encodeURIComponent(t)}&view=${o}`,{method:"GET",headers:{Accept:"application/json"},signal:s});if(l.status===404)return null;if(!l.ok)throw new Error(`NFD lookup failed: ${l.statusText}`);return(await l.json())[t]},enabled:r&&!!t,retry:(s,i)=>i instanceof Error&&i.message.includes("404")?!1:s<3,refetchOnWindowFocus:!0})}const Ki="https://ipfs.algonode.dev",zh=async e=>{if(!e.startsWith("ipfs://"))return e;const t=e.replace("ipfs://",""),n=`https://images.nf.domains/ipfs/${t}`,r=`${Ki}/ipfs/${t}`,o=s=>s.startsWith("image/");try{const s=await fetch(n,{method:"HEAD"});if(s.ok){const i=s.headers.get("content-type");if(i&&o(i))return n}}catch{console.info(`CID ${t} is not cached on images.nf.domains, trying IPFS gateway...`)}try{const s=await fetch(r,{method:"HEAD"});if(s.ok){const i=s.headers.get("content-type");if(i&&o(i))return r;if(i==="application/json")try{const c=(await(await fetch(r)).json()).image;if(c){if(c.startsWith("ipfs://")){const d=c.replace("ipfs://",""),h=`${Ki}/ipfs/${d}`,p=await fetch(h,{method:"HEAD"});if(p.ok){const f=p.headers.get("content-type");if(f&&o(f))return h}}else if(c.startsWith("http"))try{const d=await fetch(c,{method:"HEAD"});if(d.ok){const h=d.headers.get("content-type");if(h&&o(h))return c}}catch{console.error("Error checking HTTP image URL")}}}catch{console.error("Error processing JSON metadata")}}}catch{console.error(`Error checking gateway for CID ${t}`)}return r};function Ns({nfd:e,alt:t,className:n,size:r=40,fallback:o,lightOnly:s=!1}){var d,h,p,f;const i=((h=(d=e==null?void 0:e.properties)==null?void 0:d.userDefined)==null?void 0:h.avatar)||((f=(p=e==null?void 0:e.properties)==null?void 0:p.verified)==null?void 0:f.avatar)||null,a=t||(e==null?void 0:e.name)||"NFD Avatar",{data:l,isLoading:c}=Ms({queryKey:["nfd-avatar",i],queryFn:async()=>i?i.startsWith("https://")&&!i.includes("/ipfs/")?i:i.startsWith("ipfs://")||i.includes("/ipfs/")?await zh(i):i:null,enabled:!!i,staleTime:3600*1e3,gcTime:1440*60*1e3});return c||!l?o?L.jsx(L.Fragment,{children:o}):L.jsx("div",{className:ir("flex items-center justify-center rounded-full",n),style:{width:`${r}px`,height:`${r}px`,backgroundColor:s?"#e5e7eb":"var(--wui-color-avatar-bg)"},"aria-label":a,role:"img",children:L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",style:{width:`${Math.max(r/2,12)}px`,height:`${Math.max(r/2,12)}px`,color:s?"#9ca3af":"var(--wui-color-avatar-icon)"},children:L.jsx("path",{fillRule:"evenodd",d:"M7.5 6a4.5 4.5 0 119 0 4.5 4.5 0 01-9 0zM3.751 20.105a8.25 8.25 0 0116.498 0 .75.75 0 01-.437.695A18.683 18.683 0 0112 22.5c-2.786 0-5.433-.608-7.812-1.7a.75.75 0 01-.437-.695z",clipRule:"evenodd"})})}):L.jsx("img",{src:l,alt:a,className:ir("rounded-full",n),style:{width:`${r}px`,height:`${r}px`,objectFit:"cover"},loading:"lazy"})}const io=A.forwardRef(({className:e="",children:t,style:n,...r},o)=>{var c;const{activeAddress:s}=St.useWallet(),i=$s({enabled:!!s}),a=((c=i.data)==null?void 0:c.name)??null;return L.jsx("button",{ref:o,className:ir("flex items-center py-2.5 pl-3 md:pl-3.5 pr-3 bg-[var(--wui-color-primary)] text-[var(--wui-color-primary-text)] rounded-xl cursor-pointer font-bold",e),style:n,disabled:!1,...r,type:"button",children:t||L.jsxs("div",{className:"flex items-center",children:[s&&L.jsx("div",{className:"mr-1 md:mr-2 h-6 w-6 overflow-hidden",children:L.jsx(Ns,{nfd:i.data,alt:`${a||s} avatar`,size:24,lightOnly:!0})}),L.jsx("span",{className:"hidden md:block max-w-[160px] truncate",children:a||(s?er(s,6,4):"Connect")}),s&&L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 16 16",fill:"none",className:"ml-1.5 mt-0.5","aria-hidden":"true",children:L.jsx("path",{d:"M4 6L8 10L12 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})})});io.displayName="ConnectedWalletButton";const tc=typeof document<"u"?A.useLayoutEffect:()=>{};function qh(e){const t=A.useRef(null);return tc(()=>{t.current=e},[e]),A.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const Kt=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},tn=e=>e&&"window"in e&&e.window===e?e:Kt(e).defaultView||window;function _h(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function Gh(e){return _h(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let Qh=!1;function Ds(){return Qh}function nc(e,t){if(!Ds())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:Gh(n)?n=n.host:n=n.parentNode}return!1}const us=(e=document)=>{var t;if(!Ds())return e.activeElement;let n=e.activeElement;for(;n&&"shadowRoot"in n&&(!((t=n.shadowRoot)===null||t===void 0)&&t.activeElement);)n=n.shadowRoot.activeElement;return n};function rc(e){return Ds()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function ao(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function Ls(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function Ot(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const js=Ot(function(){return Ls(/^Mac/i)}),Kh=Ot(function(){return Ls(/^iPhone/i)}),Yh=Ot(function(){return Ls(/^iPad/i)||js()&&navigator.maxTouchPoints>1}),Xh=Ot(function(){return Kh()||Yh()});Ot(function(){return js()||Xh()});Ot(function(){return ao(/AppleWebKit/i)&&!Jh()});const Jh=Ot(function(){return ao(/Chrome/i)}),Zh=Ot(function(){return ao(/Android/i)});Ot(function(){return ao(/Firefox/i)});function oc(){let e=A.useRef(new Map),t=A.useCallback((o,s,i,a)=>{let l=a!=null&&a.once?(...c)=>{e.current.delete(i),i(...c)}:i;e.current.set(i,{type:s,eventTarget:o,fn:l,options:a}),o.addEventListener(s,l,a)},[]),n=A.useCallback((o,s,i,a)=>{var l;let c=((l=e.current.get(i))===null||l===void 0?void 0:l.fn)||i;o.removeEventListener(s,c,a),e.current.delete(i)},[]),r=A.useCallback(()=>{e.current.forEach((o,s)=>{n(o.eventTarget,o.type,s,o.options)})},[n]);return A.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function ep(e){return e.mozInputSource===0&&e.isTrusted?!0:Zh()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function sc(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function tp(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function ic(e){let t=A.useRef({isFocused:!1,observer:null});tc(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=qh(r=>{e==null||e(r)});return A.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let o=r.target,s=i=>{if(t.current.isFocused=!1,o.disabled){let a=sc(i);n(a)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};o.addEventListener("focusout",s,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&o.disabled){var i;(i=t.current.observer)===null||i===void 0||i.disconnect();let a=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:a})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:a}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[n])}let np=!1,Er=null,fs=new Set,or=new Map,bn=!1,ds=!1;const rp={Tab:!0,Escape:!0};function Bs(e,t){for(let n of fs)n(e,t)}function op(e){return!(e.metaKey||!js()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Xr(e){bn=!0,op(e)&&(Er="keyboard",Bs("keyboard",e))}function Je(e){Er="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(bn=!0,Bs("pointer",e))}function ac(e){ep(e)&&(bn=!0,Er="virtual")}function lc(e){e.target===window||e.target===document||np||!e.isTrusted||(!bn&&!ds&&(Er="virtual",Bs("virtual",e)),bn=!1,ds=!1)}function cc(){bn=!1,ds=!0}function hs(e){if(typeof window>"u"||typeof document>"u"||or.get(tn(e)))return;const t=tn(e),n=Kt(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){bn=!0,r.apply(this,arguments)},n.addEventListener("keydown",Xr,!0),n.addEventListener("keyup",Xr,!0),n.addEventListener("click",ac,!0),t.addEventListener("focus",lc,!0),t.addEventListener("blur",cc,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",Je,!0),n.addEventListener("pointermove",Je,!0),n.addEventListener("pointerup",Je,!0)):process.env.NODE_ENV==="test"&&(n.addEventListener("mousedown",Je,!0),n.addEventListener("mousemove",Je,!0),n.addEventListener("mouseup",Je,!0)),t.addEventListener("beforeunload",()=>{uc(e)},{once:!0}),or.set(t,{focus:r})}const uc=(e,t)=>{const n=tn(e),r=Kt(e);t&&r.removeEventListener("DOMContentLoaded",t),or.has(n)&&(n.HTMLElement.prototype.focus=or.get(n).focus,r.removeEventListener("keydown",Xr,!0),r.removeEventListener("keyup",Xr,!0),r.removeEventListener("click",ac,!0),n.removeEventListener("focus",lc,!0),n.removeEventListener("blur",cc,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",Je,!0),r.removeEventListener("pointermove",Je,!0),r.removeEventListener("pointerup",Je,!0)):process.env.NODE_ENV==="test"&&(r.removeEventListener("mousedown",Je,!0),r.removeEventListener("mousemove",Je,!0),r.removeEventListener("mouseup",Je,!0)),or.delete(n))};function sp(e){const t=Kt(e);let n;return t.readyState!=="loading"?hs(e):(n=()=>{hs(e)},t.addEventListener("DOMContentLoaded",n)),()=>uc(e,n)}typeof document<"u"&&sp();function fc(){return Er!=="pointer"}const ip=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function ap(e,t,n){let r=Kt(n==null?void 0:n.target);const o=typeof window<"u"?tn(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,s=typeof window<"u"?tn(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,i=typeof window<"u"?tn(n==null?void 0:n.target).HTMLElement:HTMLElement,a=typeof window<"u"?tn(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||r.activeElement instanceof o&&!ip.has(r.activeElement.type)||r.activeElement instanceof s||r.activeElement instanceof i&&r.activeElement.isContentEditable,!(e&&t==="keyboard"&&n instanceof a&&!rp[n.key])}function lp(e,t,n){hs(),A.useEffect(()=>{let r=(o,s)=>{ap(!!(n!=null&&n.isTextInput),o,s)&&e(fc())};return fs.add(r),()=>{fs.delete(r)}},t)}function cp(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const s=A.useCallback(l=>{if(l.target===l.currentTarget)return r&&r(l),o&&o(!1),!0},[r,o]),i=ic(s),a=A.useCallback(l=>{const c=Kt(l.target),d=c?us(c):us();l.target===l.currentTarget&&d===rc(l.nativeEvent)&&(n&&n(l),o&&o(!0),i(l))},[o,n,i]);return{focusProps:{onFocus:!t&&(n||o||r)?a:void 0,onBlur:!t&&(r||o)?s:void 0}}}function up(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,s=A.useRef({isFocusWithin:!1}),{addGlobalListener:i,removeAllGlobalListeners:a}=oc(),l=A.useCallback(h=>{h.currentTarget.contains(h.target)&&s.current.isFocusWithin&&!h.currentTarget.contains(h.relatedTarget)&&(s.current.isFocusWithin=!1,a(),n&&n(h),o&&o(!1))},[n,o,s,a]),c=ic(l),d=A.useCallback(h=>{if(!h.currentTarget.contains(h.target))return;const p=Kt(h.target),f=us(p);if(!s.current.isFocusWithin&&f===rc(h.nativeEvent)){r&&r(h),o&&o(!0),s.current.isFocusWithin=!0,c(h);let w=h.currentTarget;i(p,"focus",y=>{if(s.current.isFocusWithin&&!nc(w,y.target)){let R=new p.defaultView.FocusEvent("blur",{relatedTarget:y.target});tp(R,w);let k=sc(R);l(k)}},{capture:!0})}},[r,o,c,i,l]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:d,onBlur:l}}}let Jr=!1,To=0;function ps(){Jr=!0,setTimeout(()=>{Jr=!1},50)}function Yi(e){e.pointerType==="touch"&&ps()}function fp(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",Yi):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",ps),To++,()=>{To--,!(To>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",Yi):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",ps))}}function dp(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[s,i]=A.useState(!1),a=A.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;A.useEffect(fp,[]);let{addGlobalListener:l,removeAllGlobalListeners:c}=oc(),{hoverProps:d,triggerHoverEnd:h}=A.useMemo(()=>{let p=(y,R)=>{if(a.pointerType=R,o||R==="touch"||a.isHovered||!y.currentTarget.contains(y.target))return;a.isHovered=!0;let k=y.currentTarget;a.target=k,l(Kt(y.target),"pointerover",x=>{a.isHovered&&a.target&&!nc(a.target,x.target)&&f(x,x.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:k,pointerType:R}),n&&n(!0),i(!0)},f=(y,R)=>{let k=a.target;a.pointerType="",a.target=null,!(R==="touch"||!a.isHovered||!k)&&(a.isHovered=!1,c(),r&&r({type:"hoverend",target:k,pointerType:R}),n&&n(!1),i(!1))},w={};return typeof PointerEvent<"u"?(w.onPointerEnter=y=>{Jr&&y.pointerType==="mouse"||p(y,y.pointerType)},w.onPointerLeave=y=>{!o&&y.currentTarget.contains(y.target)&&f(y,y.pointerType)}):process.env.NODE_ENV==="test"&&(w.onTouchStart=()=>{a.ignoreEmulatedMouseEvents=!0},w.onMouseEnter=y=>{!a.ignoreEmulatedMouseEvents&&!Jr&&p(y,"mouse"),a.ignoreEmulatedMouseEvents=!1},w.onMouseLeave=y=>{!o&&y.currentTarget.contains(y.target)&&f(y,"mouse")}),{hoverProps:w,triggerHoverEnd:f}},[t,n,r,o,a,l,c]);return A.useEffect(()=>{o&&h({currentTarget:a.target},a.pointerType)},[o]),{hoverProps:d,isHovered:s}}function hp(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=A.useRef({isFocused:!1,isFocusVisible:t||fc()}),[s,i]=A.useState(!1),[a,l]=A.useState(()=>o.current.isFocused&&o.current.isFocusVisible),c=A.useCallback(()=>l(o.current.isFocused&&o.current.isFocusVisible),[]),d=A.useCallback(f=>{o.current.isFocused=f,i(f),c()},[c]);lp(f=>{o.current.isFocusVisible=f,c()},[],{isTextInput:n});let{focusProps:h}=cp({isDisabled:r,onFocusChange:d}),{focusWithinProps:p}=up({isDisabled:!r,onFocusWithinChange:d});return{isFocused:s,isFocusVisible:a,focusProps:r?p:h}}var pp=Object.defineProperty,mp=(e,t,n)=>t in e?pp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ko=(e,t,n)=>(mp(e,typeof t!="symbol"?t+"":t,n),n);let gp=class{constructor(){ko(this,"current",this.detect()),ko(this,"handoffState","pending"),ko(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},pn=new gp;function lo(e){var t;return pn.isServer?null:e==null?document:(t=e==null?void 0:e.ownerDocument)!=null?t:document}function Zr(e){var t,n;return pn.isServer?null:e==null?document:(n=(t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))!=null?n:document}function dc(e){var t,n;return(n=(t=Zr(e))==null?void 0:t.activeElement)!=null?n:null}function vp(e){return dc(e)===e}function hc(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function ze(){let e=[],t={addEventListener(n,r,o,s){return n.addEventListener(r,o,s),t.add(()=>n.removeEventListener(r,o,s))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return hc(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let s=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:s})})},group(n){let r=ze();return n(r),this.add(()=>r.dispose())},add(n){return e.includes(n)||e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let o of e.splice(r,1))o()}},dispose(){for(let n of e.splice(0))n()}};return t}function Kn(){let[e]=A.useState(ze);return A.useEffect(()=>()=>e.dispose(),[e]),e}let Pe=(e,t)=>{pn.isServer?A.useEffect(e,t):A.useLayoutEffect(e,t)};function Yn(e){let t=A.useRef(e);return Pe(()=>{t.current=e},[e]),t}let ue=function(e){let t=Yn(e);return A.useCallback((...n)=>t.current(...n),[t])};function bp(e){let t=e.width/2,n=e.height/2;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function yp(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function wp({disabled:e=!1}={}){let t=A.useRef(null),[n,r]=A.useState(!1),o=Kn(),s=ue(()=>{t.current=null,r(!1),o.dispose()}),i=ue(a=>{if(o.dispose(),t.current===null){t.current=a.currentTarget,r(!0);{let l=lo(a.currentTarget);o.addEventListener(l,"pointerup",s,!1),o.addEventListener(l,"pointermove",c=>{if(t.current){let d=bp(c);r(yp(d,t.current.getBoundingClientRect()))}},!1),o.addEventListener(l,"pointercancel",s,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:i,onPointerUp:s,onClick:s}}}function _t(e){return A.useMemo(()=>e,Object.values(e))}let xp=A.createContext(void 0);function Ws(){return A.useContext(xp)}function Xi(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function pt(e,t,...n){if(e in t){let o=t[e];return typeof o=="function"?o(...n):o}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,pt),r}var ms=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(ms||{}),Ep=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Ep||{});function st(){let e=Sp();return A.useCallback(t=>Rp({mergeRefs:e,...t}),[e])}function Rp({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:s=!0,name:i,mergeRefs:a}){a=a??Cp;let l=pc(t,e);if(s)return Mr(l,n,r,i,a);let c=o??0;if(c&2){let{static:d=!1,...h}=l;if(d)return Mr(h,n,r,i,a)}if(c&1){let{unmount:d=!0,...h}=l;return pt(d?0:1,{0(){return null},1(){return Mr({...h,hidden:!0,style:{display:"none"}},n,r,i,a)}})}return Mr(l,n,r,i,a)}function Mr(e,t={},n,r,o){let{as:s=n,children:i,refName:a="ref",...l}=Po(e,["unmount","static"]),c=e.ref!==void 0?{[a]:e.ref}:{},d=typeof i=="function"?i(t):i;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(t)),l["aria-labelledby"]&&l["aria-labelledby"]===l.id&&(l["aria-labelledby"]=void 0);let h={};if(t){let p=!1,f=[];for(let[w,y]of Object.entries(t))typeof y=="boolean"&&(p=!0),y===!0&&f.push(w.replace(/([A-Z])/g,R=>`-${R.toLowerCase()}`));if(p){h["data-headlessui-state"]=f.join(" ");for(let w of f)h[`data-${w}`]=""}}if(jr(s)&&(Object.keys(Zt(l)).length>0||Object.keys(Zt(h)).length>0))if(!A.isValidElement(d)||Array.isArray(d)&&d.length>1||Ap(d)){if(Object.keys(Zt(l)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(Zt(l)).concat(Object.keys(Zt(h))).map(p=>` - ${p}`).join(`
|
|
79
|
+
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(p=>` - ${p}`).join(`
|
|
70
80
|
`)].join(`
|
|
71
|
-
`))}else{let m=d.props,f=m==null?void 0:m.className,x=typeof f=="function"?(...$)=>aa(f(...$),l.className):aa(f,l.className),b=x?{className:x}:{},R=gc(d.props,Kt(jo(l,["ref"])));for(let $ in h)$ in R&&delete h[$];return O.cloneElement(d,Object.assign({},R,h,c,{ref:o(Rp(d),c.ref)},b))}return O.createElement(i,Object.assign({},jo(l,["ref"]),i!==O.Fragment&&c,i!==O.Fragment&&h),d)}function xp(){let e=O.useRef([]),t=O.useCallback(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function Ep(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function gc(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[o=>{var i;return(i=o==null?void 0:o.preventDefault)==null?void 0:i.call(o)}]);for(let r in n)Object.assign(t,{[r](o,...i){let s=n[r];for(let a of s){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;a(o,...i)}}});return t}function vc(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];for(let r in n)Object.assign(t,{[r](...o){let i=n[r];for(let s of i)s==null||s(...o)}});return t}function et(e){var t;return Object.assign(O.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Kt(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function jo(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function Rp(e){return O.version.split(".")[0]>="19"?e.props.ref:e.ref}function Sp(e,t,n){let[r,o]=O.useState(n),i=e!==void 0,s=O.useRef(i),a=O.useRef(!1),l=O.useRef(!1);return i&&!s.current&&!a.current?(a.current=!0,s.current=i,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!i&&s.current&&!l.current&&(l.current=!0,s.current=i,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[i?e:r,ce(c=>(i||o(c),t==null?void 0:t(c)))]}function Cp(e){let[t]=O.useState(e);return t}function bc(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))wc(n,yc(t,r),o);return n}function yc(e,t){return e?e+"["+t+"]":t}function wc(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())wc(e,yc(t,r.toString()),o);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):bc(n,t,e)}function Op(e){var t,n;let r=(t=e==null?void 0:e.form)!=null?t:e.closest("form");if(r){for(let o of r.elements)if(o!==e&&(o.tagName==="INPUT"&&o.type==="submit"||o.tagName==="BUTTON"&&o.type==="submit"||o.nodeName==="INPUT"&&o.type==="image")){o.click();return}(n=r.requestSubmit)==null||n.call(r)}}let Ap="span";var Xi=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Xi||{});function kp(e,t){var n;let{features:r=1,...o}=e,i={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return Ze()({ourProps:i,theirProps:o,slot:{},defaultTag:Ap,name:"Hidden"})}let xc=et(kp),Tp=O.createContext(null);function Fp({children:e}){let t=O.useContext(Tp);if(!t)return O.createElement(O.Fragment,null,e);let{target:n}=t;return n?Bt.createPortal(O.createElement(O.Fragment,null,e),n):null}function Pp({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[i,s]=O.useState(null),a=yr();return O.useEffect(()=>{if(r&&i)return a.addEventListener(i,"reset",r)},[i,t,r]),O.createElement(Fp,null,O.createElement($p,{setForm:s,formId:t}),bc(e).map(([l,c])=>O.createElement(xc,{features:Xi.Hidden,...Kt({key:l,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:l,value:c,...o})})))}function $p({setForm:e,formId:t}){return O.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:O.createElement(xc,{features:Xi.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let Mp=O.createContext(void 0);function Ec(){return O.useContext(Mp)}function Ji(e){return typeof e!="object"||e===null?!1:"nodeType"in e}function po(e){return Ji(e)&&"tagName"in e}function St(e){return po(e)&&"accessKey"in e}function wn(e){return po(e)&&"tabIndex"in e}function Ip(e){return po(e)&&"style"in e}function Dp(e){return St(e)&&e.nodeName==="IFRAME"}function Rc(e){return St(e)&&e.nodeName==="INPUT"}function la(e){return St(e)&&e.nodeName==="LABEL"}function Np(e){return St(e)&&e.nodeName==="FIELDSET"}function Sc(e){return St(e)&&e.nodeName==="LEGEND"}function Lp(e){return po(e)?e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function jp(e){let t=e.parentElement,n=null;for(;t&&!Np(t);)Sc(t)&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&Bp(n)?!1:r}function Bp(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(Sc(t))return!1;t=t.previousElementSibling}return!0}let Cc=Symbol();function Hp(e,t=!0){return Object.assign(e,{[Cc]:t})}function ht(...e){let t=O.useRef(e);O.useEffect(()=>{t.current=e},[e]);let n=ce(r=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||(r==null?void 0:r[Cc]))?void 0:n}let Zi=O.createContext(null);Zi.displayName="DescriptionContext";function Oc(){let e=O.useContext(Zi);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Oc),t}return e}function Wp(){var e,t;return(t=(e=O.useContext(Zi))==null?void 0:e.value)!=null?t:void 0}let Up="p";function Vp(e,t){let n=O.useId(),r=Yi(),{id:o=`headlessui-description-${n}`,...i}=e,s=Oc(),a=ht(t);xe(()=>s.register(o),[o,s.register]);let l=r||!1,c=O.useMemo(()=>({...s.slot,disabled:l}),[s.slot,l]),d={ref:a,...s.props,id:o};return Ze()({ourProps:d,theirProps:i,slot:c,defaultTag:Up,name:s.name||"Description"})}let qp=et(Vp);Object.assign(qp,{});var ye=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(ye||{});let mo=O.createContext(null);mo.displayName="LabelContext";function Ac(){let e=O.useContext(mo);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Ac),t}return e}function kc(e){var t,n,r;let o=(n=(t=O.useContext(mo))==null?void 0:t.value)!=null?n:void 0;return((r=e==null?void 0:e.length)!=null?r:0)>0?[o,...e].filter(Boolean).join(" "):o}function zp({inherit:e=!1}={}){let t=kc(),[n,r]=O.useState([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,O.useMemo(()=>function(i){let s=ce(l=>(r(c=>[...c,l]),()=>r(c=>{let d=c.slice(),h=d.indexOf(l);return h!==-1&&d.splice(h,1),d}))),a=O.useMemo(()=>({register:s,slot:i.slot,name:i.name,props:i.props,value:i.value}),[s,i.slot,i.name,i.props,i.value]);return O.createElement(mo.Provider,{value:a},i.children)},[r])]}let Gp="label";function _p(e,t){var n;let r=O.useId(),o=Ac(),i=Ec(),s=Yi(),{id:a=`headlessui-label-${r}`,htmlFor:l=i??((n=o.props)==null?void 0:n.htmlFor),passive:c=!1,...d}=e,h=ht(t);xe(()=>o.register(a),[a,o.register]);let m=ce(R=>{let $=R.currentTarget;if(!(R.target!==R.currentTarget&&Lp(R.target))&&(la($)&&R.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(R),la($))){let w=document.getElementById($.htmlFor);if(w){let T=w.getAttribute("disabled");if(T==="true"||T==="")return;let N=w.getAttribute("aria-disabled");if(N==="true"||N==="")return;(Rc(w)&&(w.type==="file"||w.type==="radio"||w.type==="checkbox")||w.role==="radio"||w.role==="checkbox"||w.role==="switch")&&w.click(),w.focus({preventScroll:!0})}}}),f=s||!1,x=O.useMemo(()=>({...o.slot,disabled:f}),[o.slot,f]),b={ref:h,...o.props,id:a,htmlFor:l,onClick:m};return c&&("onClick"in b&&(delete b.htmlFor,delete b.onClick),"onClick"in d&&delete d.onClick),Ze()({ourProps:b,theirProps:d,slot:x,defaultTag:l?Gp:"div",name:o.name||"Label"})}let Qp=et(_p),Tc=Object.assign(Qp,{});function Kp(e,t){return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&"id"in e&&"id"in t?e.id===t.id:e===t}function Yp(e=Kp){return O.useCallback((t,n)=>{if(typeof e=="string"){let r=e;return(t==null?void 0:t[r])===(n==null?void 0:n[r])}return e(t,n)},[e])}function Xp(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function Jp(e,t=!1){let[n,r]=O.useReducer(()=>({}),{}),o=O.useMemo(()=>Xp(e),[e,n]);return xe(()=>{if(!e)return;let i=new ResizeObserver(r);return i.observe(e),()=>{i.disconnect()}},[e]),t?{width:`${o.width}px`,height:`${o.height}px`}:o}let Fc=class extends Map{constructor(t){super(),this.factory=t}get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t),this.set(t,n)),n}};var Zp=Object.defineProperty,em=(e,t,n)=>t in e?Zp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tm=(e,t,n)=>(em(e,t+"",n),n),Pc=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Be=(e,t,n)=>(Pc(e,t,"read from private field"),n?n.call(e):t.get(e)),Bo=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},ca=(e,t,n,r)=>(Pc(e,t,"write to private field"),t.set(e,n),n),nt,Jn,Zn;let $c=class{constructor(t){Bo(this,nt,{}),Bo(this,Jn,new Fc(()=>new Set)),Bo(this,Zn,new Set),tm(this,"disposables",Je()),ca(this,nt,t)}dispose(){this.disposables.dispose()}get state(){return Be(this,nt)}subscribe(t,n){let r={selector:t,callback:n,current:t(Be(this,nt))};return Be(this,Zn).add(r),this.disposables.add(()=>{Be(this,Zn).delete(r)})}on(t,n){return Be(this,Jn).get(t).add(n),this.disposables.add(()=>{Be(this,Jn).get(t).delete(n)})}send(t){let n=this.reduce(Be(this,nt),t);if(n!==Be(this,nt)){ca(this,nt,n);for(let r of Be(this,Zn)){let o=r.selector(Be(this,nt));Mc(r.current,o)||(r.current=o,r.callback(o))}for(let r of Be(this,Jn).get(t.type))r(Be(this,nt),t)}}};nt=new WeakMap,Jn=new WeakMap,Zn=new WeakMap;function Mc(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null?!1:Array.isArray(e)&&Array.isArray(t)?e.length!==t.length?!1:Ho(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size!==t.size?!1:Ho(e.entries(),t.entries()):ua(e)&&ua(t)?Ho(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function Ho(e,t){do{let n=e.next(),r=t.next();if(n.done&&r.done)return!0;if(n.done||r.done||!Object.is(n.value,r.value))return!1}while(!0)}function ua(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function Wo(e){let[t,n]=e(),r=Je();return(...o)=>{t(...o),r.dispose(),r.microTask(n)}}var nm=Object.defineProperty,rm=(e,t,n)=>t in e?nm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fa=(e,t,n)=>(rm(e,typeof t!="symbol"?t+"":t,n),n),Ic=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(Ic||{});let om={0(e,t){let n=t.id,r=e.stack,o=e.stack.indexOf(n);if(o!==-1){let i=e.stack.slice();return i.splice(o,1),i.push(n),r=i,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(r===-1)return e;let o=e.stack.slice();return o.splice(r,1),{...e,stack:o}}},im=class Dc extends $c{constructor(){super(...arguments),fa(this,"actions",{push:t=>this.send({type:0,id:t}),pop:t=>this.send({type:1,id:t})}),fa(this,"selectors",{isTop:(t,n)=>t.stack[t.stack.length-1]===n,inStack:(t,n)=>t.stack.includes(n)})}static new(){return new Dc({stack:[]})}reduce(t,n){return ut(n.type,om,t,n)}};const es=new Fc(()=>im.new());var Ir={exports:{}},Uo={};/**
|
|
81
|
+
`))}else{let p=d.props,f=p==null?void 0:p.className,w=typeof f=="function"?(...k)=>Xi(f(...k),l.className):Xi(f,l.className),y=w?{className:w}:{},R=pc(d.props,Zt(Po(l,["ref"])));for(let k in h)k in R&&delete h[k];return A.cloneElement(d,Object.assign({},R,h,c,{ref:o(Op(d),c.ref)},y))}return A.createElement(s,Object.assign({},Po(l,["ref"]),!jr(s)&&c,!jr(s)&&h),d)}function Sp(){let e=A.useRef([]),t=A.useCallback(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function Cp(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function pc(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[o=>{var s;return(s=o==null?void 0:o.preventDefault)==null?void 0:s.call(o)}]);for(let r in n)Object.assign(t,{[r](o,...s){let i=n[r];for(let a of i){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;a(o,...s)}}});return t}function mc(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];for(let r in n)Object.assign(t,{[r](...o){let s=n[r];for(let i of s)i==null||i(...o)}});return t}function it(e){var t;return Object.assign(A.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Zt(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Po(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function Op(e){return A.version.split(".")[0]>="19"?e.props.ref:e.ref}function jr(e){return e===A.Fragment||e===Symbol.for("react.fragment")}function Ap(e){return jr(e.type)}function Tp(e,t,n){let[r,o]=A.useState(n),s=e!==void 0,i=A.useRef(s),a=A.useRef(!1),l=A.useRef(!1);return s&&!i.current&&!a.current?(a.current=!0,i.current=s,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!s&&i.current&&!l.current&&(l.current=!0,i.current=s,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[s?e:r,ue(c=>(s||mn.flushSync(()=>o(c)),t==null?void 0:t(c)))]}function kp(e){let[t]=A.useState(e);return t}function gc(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))bc(n,vc(t,r),o);return n}function vc(e,t){return e?e+"["+t+"]":t}function bc(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())bc(e,vc(t,r.toString()),o);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):Fp(n)&&!A.isValidElement(n)&&gc(n,t,e)}function Pp(e){var t,n;let r=(t=e==null?void 0:e.form)!=null?t:e.closest("form");if(r){for(let o of r.elements)if(o!==e&&(o.tagName==="INPUT"&&o.type==="submit"||o.tagName==="BUTTON"&&o.type==="submit"||o.nodeName==="INPUT"&&o.type==="image")){o.click();return}(n=r.requestSubmit)==null||n.call(r)}}function Fp(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}let Ip="span";var Hs=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Hs||{});function Mp(e,t){var n;let{features:r=1,...o}=e,s={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return st()({ourProps:s,theirProps:o,slot:{},defaultTag:Ip,name:"Hidden"})}let yc=it(Mp),$p=A.createContext(null);function Np({children:e}){let t=A.useContext($p);if(!t)return A.createElement(A.Fragment,null,e);let{target:n}=t;return n?mn.createPortal(A.createElement(A.Fragment,null,e),n):null}function Dp({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[s,i]=A.useState(null),a=Kn();return A.useEffect(()=>{if(r&&s)return a.addEventListener(s,"reset",r)},[s,t,r]),A.createElement(Np,null,A.createElement(Lp,{setForm:i,formId:t}),gc(e).map(([l,c])=>A.createElement(yc,{features:Hs.Hidden,...Zt({key:l,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:l,value:c,...o})})))}function Lp({setForm:e,formId:t}){return A.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:A.createElement(yc,{features:Hs.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let jp=A.createContext(void 0);function wc(){return A.useContext(jp)}function xc(e){return typeof e!="object"||e===null?!1:"nodeType"in e}function co(e){return xc(e)&&"tagName"in e}function At(e){return co(e)&&"accessKey"in e}function Cn(e){return co(e)&&"tabIndex"in e}function Bp(e){return co(e)&&"style"in e}function Wp(e){return At(e)&&e.nodeName==="IFRAME"}function Ec(e){return At(e)&&e.nodeName==="INPUT"}function Ji(e){return At(e)&&e.nodeName==="LABEL"}function Hp(e){return At(e)&&e.nodeName==="FIELDSET"}function Rc(e){return At(e)&&e.nodeName==="LEGEND"}function Up(e){return co(e)?e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function Zi(e){let t=e.parentElement,n=null;for(;t&&!Hp(t);)Rc(t)&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&Vp(n)?!1:r}function Vp(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(Rc(t))return!1;t=t.previousElementSibling}return!0}let Sc=Symbol();function zp(e,t=!0){return Object.assign(e,{[Sc]:t})}function gt(...e){let t=A.useRef(e);A.useEffect(()=>{t.current=e},[e]);let n=ue(r=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||(r==null?void 0:r[Sc]))?void 0:n}let Us=A.createContext(null);Us.displayName="DescriptionContext";function Cc(){let e=A.useContext(Us);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Cc),t}return e}function qp(){var e,t;return(t=(e=A.useContext(Us))==null?void 0:e.value)!=null?t:void 0}let _p="p";function Gp(e,t){let n=A.useId(),r=Ws(),{id:o=`headlessui-description-${n}`,...s}=e,i=Cc(),a=gt(t);Pe(()=>i.register(o),[o,i.register]);let l=_t({...i.slot,disabled:r||!1}),c={ref:a,...i.props,id:o};return st()({ourProps:c,theirProps:s,slot:l,defaultTag:_p,name:i.name||"Description"})}let Qp=it(Gp);Object.assign(Qp,{});var Ee=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(Ee||{});let uo=A.createContext(null);uo.displayName="LabelContext";function Oc(){let e=A.useContext(uo);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Oc),t}return e}function Ac(e){var t,n,r;let o=(n=(t=A.useContext(uo))==null?void 0:t.value)!=null?n:void 0;return((r=e==null?void 0:e.length)!=null?r:0)>0?[o,...e].filter(Boolean).join(" "):o}function Kp({inherit:e=!1}={}){let t=Ac(),[n,r]=A.useState([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,A.useMemo(()=>function(s){let i=ue(l=>(r(c=>[...c,l]),()=>r(c=>{let d=c.slice(),h=d.indexOf(l);return h!==-1&&d.splice(h,1),d}))),a=A.useMemo(()=>({register:i,slot:s.slot,name:s.name,props:s.props,value:s.value}),[i,s.slot,s.name,s.props,s.value]);return A.createElement(uo.Provider,{value:a},s.children)},[r])]}let Yp="label";function Xp(e,t){var n;let r=A.useId(),o=Oc(),s=wc(),i=Ws(),{id:a=`headlessui-label-${r}`,htmlFor:l=s??((n=o.props)==null?void 0:n.htmlFor),passive:c=!1,...d}=e,h=gt(t);Pe(()=>o.register(a),[a,o.register]);let p=ue(y=>{let R=y.currentTarget;if(!(y.target!==y.currentTarget&&Up(y.target))&&(Ji(R)&&y.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(y),Ji(R))){let k=document.getElementById(R.htmlFor);if(k){let x=k.getAttribute("disabled");if(x==="true"||x==="")return;let F=k.getAttribute("aria-disabled");if(F==="true"||F==="")return;(Ec(k)&&(k.type==="file"||k.type==="radio"||k.type==="checkbox")||k.role==="radio"||k.role==="checkbox"||k.role==="switch")&&k.click(),k.focus({preventScroll:!0})}}}),f=_t({...o.slot,disabled:i||!1}),w={ref:h,...o.props,id:a,htmlFor:l,onClick:p};return c&&("onClick"in w&&(delete w.htmlFor,delete w.onClick),"onClick"in d&&delete d.onClick),st()({ourProps:w,theirProps:d,slot:f,defaultTag:l?Yp:"div",name:o.name||"Label"})}let Jp=it(Xp),Tc=Object.assign(Jp,{});function Zp(e,t){return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&"id"in e&&"id"in t?e.id===t.id:e===t}function em(e=Zp){return A.useCallback((t,n)=>{if(typeof e=="string"){let r=e;return(t==null?void 0:t[r])===(n==null?void 0:n[r])}return e(t,n)},[e])}function ea(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function tm(e,t,n=!1){let[r,o]=A.useState(()=>ea(t));return Pe(()=>{if(!t||!e)return;let s=ze();return s.requestAnimationFrame(function i(){s.requestAnimationFrame(i),o(a=>{let l=ea(t);return l.width===a.width&&l.height===a.height?a:l})}),()=>{s.dispose()}},[t,e]),n?{width:`${r.width}px`,height:`${r.height}px`}:r}var kc=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(kc||{});function nm(e){let t=A.useRef(null),n=ue(o=>{t.current=o.pointerType,!Zi(o.currentTarget)&&o.pointerType==="mouse"&&o.button===kc.Left&&(o.preventDefault(),e(o))}),r=ue(o=>{t.current!=="mouse"&&(Zi(o.currentTarget)||e(o))});return{onPointerDown:n,onClick:r}}let Pc=class extends Map{constructor(t){super(),this.factory=t}get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t),this.set(t,n)),n}};var rm=Object.defineProperty,om=(e,t,n)=>t in e?rm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sm=(e,t,n)=>(om(e,t+"",n),n),Fc=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Ge=(e,t,n)=>(Fc(e,t,"read from private field"),n?n.call(e):t.get(e)),Fo=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},ta=(e,t,n,r)=>(Fc(e,t,"write to private field"),t.set(e,n),n),at,tr,nr;let Ic=class{constructor(t){Fo(this,at,{}),Fo(this,tr,new Pc(()=>new Set)),Fo(this,nr,new Set),sm(this,"disposables",ze()),ta(this,at,t),pn.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return Ge(this,at)}subscribe(t,n){if(pn.isServer)return()=>{};let r={selector:t,callback:n,current:t(Ge(this,at))};return Ge(this,nr).add(r),this.disposables.add(()=>{Ge(this,nr).delete(r)})}on(t,n){return pn.isServer?()=>{}:(Ge(this,tr).get(t).add(n),this.disposables.add(()=>{Ge(this,tr).get(t).delete(n)}))}send(t){let n=this.reduce(Ge(this,at),t);if(n!==Ge(this,at)){ta(this,at,n);for(let r of Ge(this,nr)){let o=r.selector(Ge(this,at));Mc(r.current,o)||(r.current=o,r.callback(o))}for(let r of Ge(this,tr).get(t.type))r(Ge(this,at),t)}}};at=new WeakMap,tr=new WeakMap,nr=new WeakMap;function Mc(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null?!1:Array.isArray(e)&&Array.isArray(t)?e.length!==t.length?!1:Io(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size!==t.size?!1:Io(e.entries(),t.entries()):na(e)&&na(t)?Io(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function Io(e,t){do{let n=e.next(),r=t.next();if(n.done&&r.done)return!0;if(n.done||r.done||!Object.is(n.value,r.value))return!1}while(!0)}function na(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function Mo(e){let[t,n]=e(),r=ze();return(...o)=>{t(...o),r.dispose(),r.microTask(n)}}var im=Object.defineProperty,am=(e,t,n)=>t in e?im(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ra=(e,t,n)=>(am(e,typeof t!="symbol"?t+"":t,n),n),$c=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))($c||{});let lm={0(e,t){let n=t.id,r=e.stack,o=e.stack.indexOf(n);if(o!==-1){let s=e.stack.slice();return s.splice(o,1),s.push(n),r=s,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(r===-1)return e;let o=e.stack.slice();return o.splice(r,1),{...e,stack:o}}},cm=class Nc extends Ic{constructor(){super(...arguments),ra(this,"actions",{push:t=>this.send({type:0,id:t}),pop:t=>this.send({type:1,id:t})}),ra(this,"selectors",{isTop:(t,n)=>t.stack[t.stack.length-1]===n,inStack:(t,n)=>t.stack.includes(n)})}static new(){return new Nc({stack:[]})}reduce(t,n){return pt(n.type,lm,t,n)}};const Vs=new Pc(()=>cm.new());var $r={exports:{}},$o={};/**
|
|
72
82
|
* @license React
|
|
73
83
|
* use-sync-external-store-with-selector.production.js
|
|
74
84
|
*
|
|
@@ -76,7 +86,7 @@
|
|
|
76
86
|
*
|
|
77
87
|
* This source code is licensed under the MIT license found in the
|
|
78
88
|
* LICENSE file in the root directory of this source tree.
|
|
79
|
-
*/var
|
|
89
|
+
*/var oa;function um(){if(oa)return $o;oa=1;var e=A;function t(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,o=e.useRef,s=e.useEffect,i=e.useMemo,a=e.useDebugValue;return $o.useSyncExternalStoreWithSelector=function(l,c,d,h,p){var f=o(null);if(f.current===null){var w={hasValue:!1,value:null};f.current=w}else w=f.current;f=i(function(){function R(D){if(!k){if(k=!0,x=D,D=h(D),p!==void 0&&w.hasValue){var j=w.value;if(p(j,D))return F=j}return F=D}if(j=F,n(x,D))return j;var W=h(D);return p!==void 0&&p(j,W)?(x=D,j):(x=D,F=W)}var k=!1,x,F,$=d===void 0?null:d;return[function(){return R(c())},$===null?void 0:function(){return R($())}]},[c,d,h,p]);var y=r(l,f[0],f[1]);return s(function(){w.hasValue=!0,w.value=y},[y]),a(y),y},$o}var No={};/**
|
|
80
90
|
* @license React
|
|
81
91
|
* use-sync-external-store-with-selector.development.js
|
|
82
92
|
*
|
|
@@ -84,6 +94,6 @@
|
|
|
84
94
|
*
|
|
85
95
|
* This source code is licensed under the MIT license found in the
|
|
86
96
|
* LICENSE file in the root directory of this source tree.
|
|
87
|
-
*/var ha;function am(){return ha||(ha=1,process.env.NODE_ENV!=="production"&&function(){function e(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=O,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,i=t.useEffect,s=t.useMemo,a=t.useDebugValue;Vo.useSyncExternalStoreWithSelector=function(l,c,d,h,m){var f=o(null);if(f.current===null){var x={hasValue:!1,value:null};f.current=x}else x=f.current;f=s(function(){function R(D){if(!$){if($=!0,w=D,D=h(D),m!==void 0&&x.hasValue){var j=x.value;if(m(j,D))return T=j}return T=D}if(j=T,n(w,D))return j;var W=h(D);return m!==void 0&&m(j,W)?(w=D,j):(w=D,T=W)}var $=!1,w,T,N=d===void 0?null:d;return[function(){return R(c())},N===null?void 0:function(){return R(N())}]},[c,d,h,m]);var b=r(l,f[0],f[1]);return i(function(){x.hasValue=!0,x.value=b},[b]),a(b),b},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Vo}var pa;function lm(){return pa||(pa=1,process.env.NODE_ENV==="production"?Ir.exports=sm():Ir.exports=am()),Ir.exports}var cm=lm();function qe(e,t,n=Mc){return cm.useSyncExternalStoreWithSelector(ce(r=>e.subscribe(um,r)),ce(()=>e.state),ce(()=>e.state),ce(t),n)}function um(e){return e}function Nc(e,t){let n=O.useId(),r=es.get(t),[o,i]=qe(r,O.useCallback(s=>[r.selectors.isTop(s,n),r.selectors.inStack(s,n)],[r,n]));return xe(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),e?i?o:!0:!1}let Oi=new Map,nr=new Map;function ma(e){var t;let n=(t=nr.get(e))!=null?t:0;return nr.set(e,n+1),n!==0?()=>ga(e):(Oi.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>ga(e))}function ga(e){var t;let n=(t=nr.get(e))!=null?t:1;if(n===1?nr.delete(e):nr.set(e,n-1),n!==1)return;let r=Oi.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,Oi.delete(e))}function fm(e,{allowed:t,disallowed:n}={}){let r=Nc(e,"inert-others");xe(()=>{var o,i;if(!r)return;let s=Je();for(let l of(o=n==null?void 0:n())!=null?o:[])l&&s.add(ma(l));let a=(i=t==null?void 0:t())!=null?i:[];for(let l of a){if(!l)continue;let c=br(l);if(!c)continue;let d=l.parentElement;for(;d&&d!==c.body;){for(let h of d.children)a.some(m=>h.contains(m))||s.add(ma(h));d=d.parentElement}}return s.dispose},[r,t,n])}function dm(e,t,n){let r=zn(o=>{let i=o.getBoundingClientRect();i.x===0&&i.y===0&&i.width===0&&i.height===0&&n()});O.useEffect(()=>{if(!e)return;let o=t===null?null:St(t)?t:t.current;if(!o)return;let i=Je();if(typeof ResizeObserver<"u"){let s=new ResizeObserver(()=>r.current(o));s.observe(o),i.add(()=>s.disconnect())}if(typeof IntersectionObserver<"u"){let s=new IntersectionObserver(()=>r.current(o));s.observe(o),i.add(()=>s.disconnect())}return()=>i.dispose()},[t,r,e])}let Ai=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),hm=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var ki=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(ki||{}),pm=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(pm||{}),mm=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(mm||{});function Lc(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Ai)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function gm(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(hm)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var ts=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(ts||{});function jc(e,t=0){var n;return e===((n=br(e))==null?void 0:n.body)?!1:ut(t,{0(){return e.matches(Ai)},1(){let r=e;for(;r!==null;){if(r.matches(Ai))return!0;r=r.parentElement}return!1}})}var vm=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(vm||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let bm=["textarea","input"].join(",");function ym(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,bm))!=null?n:!1}function Bc(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),i=t(r);if(o===null||i===null)return 0;let s=o.compareDocumentPosition(i);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function wm(e,t){return xm(Lc(),t,{relativeTo:e})}function xm(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let i=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,s=Array.isArray(e)?n?Bc(e):e:t&64?gm(e):Lc(e);o.length>0&&s.length>1&&(s=s.filter(f=>!o.some(x=>x!=null&&"current"in x?(x==null?void 0:x.current)===f:x===f))),r=r??i.activeElement;let a=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,s.indexOf(r))-1;if(t&4)return Math.max(0,s.indexOf(r))+1;if(t&8)return s.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=t&32?{preventScroll:!0}:{},d=0,h=s.length,m;do{if(d>=h||d+h<=0)return 0;let f=l+d;if(t&16)f=(f+h)%h;else{if(f<0)return 3;if(f>=h)return 1}m=s[f],m==null||m.focus(c),d+=a}while(m!==i.activeElement);return t&6&&ym(m)&&m.select(),2}function Hc(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Em(){return/Android/gi.test(window.navigator.userAgent)}function va(){return Hc()||Em()}function xn(e,t,n,r){let o=zn(n);O.useEffect(()=>{if(!e)return;function i(s){o.current(s)}return document.addEventListener(t,i,r),()=>document.removeEventListener(t,i,r)},[e,t,r])}function Rm(e,t,n,r){let o=zn(n);O.useEffect(()=>{if(!e)return;function i(s){o.current(s)}return window.addEventListener(t,i,r),()=>window.removeEventListener(t,i,r)},[e,t,r])}const ba=30;function Sm(e,t,n){let r=zn(n),o=O.useCallback(function(a,l){if(a.defaultPrevented)return;let c=l(a);if(c===null||!c.getRootNode().contains(c)||!c.isConnected)return;let d=function h(m){return typeof m=="function"?h(m()):Array.isArray(m)||m instanceof Set?m:[m]}(t);for(let h of d)if(h!==null&&(h.contains(c)||a.composed&&a.composedPath().includes(h)))return;return!jc(c,ts.Loose)&&c.tabIndex!==-1&&a.preventDefault(),r.current(a,c)},[r,t]),i=O.useRef(null);xn(e,"pointerdown",a=>{var l,c;va()||(i.current=((c=(l=a.composedPath)==null?void 0:l.call(a))==null?void 0:c[0])||a.target)},!0),xn(e,"pointerup",a=>{if(va()||!i.current)return;let l=i.current;return i.current=null,o(a,()=>l)},!0);let s=O.useRef({x:0,y:0});xn(e,"touchstart",a=>{s.current.x=a.touches[0].clientX,s.current.y=a.touches[0].clientY},!0),xn(e,"touchend",a=>{let l={x:a.changedTouches[0].clientX,y:a.changedTouches[0].clientY};if(!(Math.abs(l.x-s.current.x)>=ba||Math.abs(l.y-s.current.y)>=ba))return o(a,()=>wn(a.target)?a.target:null)},!0),Rm(e,"blur",a=>o(a,()=>Dp(window.document.activeElement)?window.document.activeElement:null),!0)}function Ti(...e){return O.useMemo(()=>br(...e),[...e])}var Cm=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(Cm||{});const Dr={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},Om=200;function Am(e,{trigger:t,action:n,close:r,select:o}){let i=O.useRef(null);xn(e&&t!==null,"pointerdown",s=>{Ji(s==null?void 0:s.target)&&t!=null&&t.contains(s.target)&&(i.current=new Date)}),xn(e&&t!==null,"pointerup",s=>{if(i.current===null||!wn(s.target))return;let a=n(s),l=new Date().getTime()-i.current.getTime();switch(i.current=null,a.kind){case 0:return;case 1:{l>Om&&(o(a.target),r());break}case 2:{r();break}}},{capture:!0})}function km(e,t){return O.useMemo(()=>{var n;if(e.type)return e.type;let r=(n=e.as)!=null?n:"button";if(typeof r=="string"&&r.toLowerCase()==="button"||(t==null?void 0:t.tagName)==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function Tm(e){return O.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function Fm(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...i){let s=t[o].call(n,...i);s&&(n=s,r.forEach(a=>a()))}}}function Pm(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=(n=t.defaultView)!=null?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),i=Math.max(0,e-o);n.style(r,"paddingRight",`${i}px`)}}}function $m(){return Hc()?{before({doc:e,d:t,meta:n}){function r(o){return n.containers.flatMap(i=>i()).some(i=>i.contains(o))}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let a=Je();a.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>a.dispose()))}let i=(o=window.scrollY)!=null?o:window.pageYOffset,s=null;t.addEventListener(e,"click",a=>{if(wn(a.target))try{let l=a.target.closest("a");if(!l)return;let{hash:c}=new URL(l.href),d=e.querySelector(c);wn(d)&&!r(d)&&(s=d)}catch{}},!0),t.addEventListener(e,"touchstart",a=>{if(wn(a.target)&&Ip(a.target))if(r(a.target)){let l=a.target;for(;l.parentElement&&r(l.parentElement);)l=l.parentElement;t.style(l,"overscrollBehavior","contain")}else t.style(a.target,"touchAction","none")}),t.addEventListener(e,"touchmove",a=>{if(wn(a.target)){if(Rc(a.target))return;if(r(a.target)){let l=a.target;for(;l.parentElement&&l.dataset.headlessuiPortal!==""&&!(l.scrollHeight>l.clientHeight||l.scrollWidth>l.clientWidth);)l=l.parentElement;l.dataset.headlessuiPortal===""&&a.preventDefault()}else a.preventDefault()}},{passive:!1}),t.add(()=>{var a;let l=(a=window.scrollY)!=null?a:window.pageYOffset;i!==l&&window.scrollTo(0,i),s&&s.isConnected&&(s.scrollIntoView({block:"nearest"}),s=null)})})}}:{}}function Mm(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function Im(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Xt=Fm(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:Je(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:Im(n)},o=[$m(),Pm(),Mm()];o.forEach(({before:i})=>i==null?void 0:i(r)),o.forEach(({after:i})=>i==null?void 0:i(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Xt.subscribe(()=>{let e=Xt.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",o=n.count!==0;(o&&!r||!o&&r)&&Xt.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Xt.dispatch("TEARDOWN",n)}});function Dm(e,t,n=()=>({containers:[]})){let r=Tm(Xt),o=t?r.get(t):void 0,i=o?o.count>0:!1;return xe(()=>{if(!(!t||!e))return Xt.dispatch("PUSH",t,n),()=>Xt.dispatch("POP",t,n)},[e,t]),i}function Nm(e,t,n=()=>[document.body]){let r=Nc(e,"scroll-lock");Dm(r,t,o=>{var i;return{containers:[...(i=o.containers)!=null?i:[],n]}})}function ya(e){return[e.screenX,e.screenY]}function Lm(){let e=O.useRef([-1,-1]);return{wasMoved(t){let n=ya(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=ya(t)}}}function jm(e=0){let[t,n]=O.useState(e),r=O.useCallback(l=>n(l),[t]),o=O.useCallback(l=>n(c=>c|l),[t]),i=O.useCallback(l=>(t&l)===l,[t]),s=O.useCallback(l=>n(c=>c&~l),[n]),a=O.useCallback(l=>n(c=>c^l),[n]);return{flags:t,setFlag:r,addFlag:o,hasFlag:i,removeFlag:s,toggleFlag:a}}var wa,xa;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((wa=process==null?void 0:process.env)==null?void 0:wa.NODE_ENV)==="test"&&typeof((xa=Element==null?void 0:Element.prototype)==null?void 0:xa.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
|
|
88
|
-
`)),[]});var Bm=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(Bm||{});function Hm(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function Wm(e,t,n,r){let[o,i]=O.useState(n),{hasFlag:s,addFlag:a,removeFlag:l}=jm(e&&o?3:0),c=O.useRef(!1),d=O.useRef(!1),h=yr();return xe(()=>{var m;if(e){if(n&&i(!0),!t){n&&a(3);return}return(m=void 0)==null||m.call(r,n),Um(t,{inFlight:c,prepare(){d.current?d.current=!1:d.current=c.current,c.current=!0,!d.current&&(n?(a(3),l(4)):(a(4),l(2)))},run(){d.current?n?(l(3),a(4)):(l(4),a(3)):n?l(1):a(1)},done(){var f;d.current&&typeof t.getAnimations=="function"&&t.getAnimations().length>0||(c.current=!1,l(7),n||i(!1),(f=void 0)==null||f.call(r,n))}})}},[e,n,t,h]),e?[o,{closed:s(1),enter:s(2),leave:s(4),transition:s(2)||s(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function Um(e,{prepare:t,run:n,done:r,inFlight:o}){let i=Je();return qm(e,{prepare:t,inFlight:o}),i.nextFrame(()=>{n(),i.requestAnimationFrame(()=>{i.add(Vm(e,r))})}),i.dispose}function Vm(e,t){var n,r;let o=Je();if(!e)return o.dispose;let i=!1;o.add(()=>{i=!0});let s=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(a=>a instanceof CSSTransition))!=null?r:[];return s.length===0?(t(),o.dispose):(Promise.allSettled(s.map(a=>a.finished)).then(()=>{i||t()}),o.dispose)}function qm(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition="none",n(),e.style.transition=r}function go(){return typeof window<"u"}function Gn(e){return Wc(e)?(e.nodeName||"").toLowerCase():"#document"}function Le(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function pt(e){var t;return(t=(Wc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Wc(e){return go()?e instanceof Node||e instanceof Le(e).Node:!1}function Ae(e){return go()?e instanceof Element||e instanceof Le(e).Element:!1}function ft(e){return go()?e instanceof HTMLElement||e instanceof Le(e).HTMLElement:!1}function Ea(e){return!go()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Le(e).ShadowRoot}function wr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Xe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function zm(e){return["table","td","th"].includes(Gn(e))}function vo(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function ns(e){const t=rs(),n=Ae(e)?Xe(e):e;return["transform","translate","scale","rotate","perspective"].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)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Gm(e){let t=Ut(e);for(;ft(t)&&!Un(t);){if(ns(t))return t;if(vo(t))return null;t=Ut(t)}return null}function rs(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Un(e){return["html","body","#document"].includes(Gn(e))}function Xe(e){return Le(e).getComputedStyle(e)}function bo(e){return Ae(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ut(e){if(Gn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ea(e)&&e.host||pt(e);return Ea(t)?t.host:t}function Uc(e){const t=Ut(e);return Un(t)?e.ownerDocument?e.ownerDocument.body:e.body:ft(t)&&wr(t)?t:Uc(t)}function sr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Uc(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Le(o);if(i){const a=Fi(s);return t.concat(s,s.visualViewport||[],wr(o)?o:[],a&&n?sr(a):[])}return t.concat(o,sr(o,[],n))}function Fi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function _m(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}const pn=Math.min,Oe=Math.max,ar=Math.round,Nr=Math.floor,ct=e=>({x:e,y:e}),Qm={left:"right",right:"left",bottom:"top",top:"bottom"},Km={start:"end",end:"start"};function Ra(e,t,n){return Oe(e,pn(t,n))}function _n(e,t){return typeof e=="function"?e(t):e}function Vt(e){return e.split("-")[0]}function xr(e){return e.split("-")[1]}function Vc(e){return e==="x"?"y":"x"}function qc(e){return e==="y"?"height":"width"}function mn(e){return["top","bottom"].includes(Vt(e))?"y":"x"}function zc(e){return Vc(mn(e))}function Ym(e,t,n){n===void 0&&(n=!1);const r=xr(e),o=zc(e),i=qc(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Zr(s)),[s,Zr(s)]}function Xm(e){const t=Zr(e);return[Pi(e),t,Pi(t)]}function Pi(e){return e.replace(/start|end/g,t=>Km[t])}function Jm(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function Zm(e,t,n,r){const o=xr(e);let i=Jm(Vt(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Pi)))),i}function Zr(e){return e.replace(/left|right|bottom|top/g,t=>Qm[t])}function eg(e){return{top:0,right:0,bottom:0,left:0,...e}}function tg(e){return typeof e!="number"?eg(e):{top:e,right:e,bottom:e,left:e}}function eo(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 Sa(e,t,n){let{reference:r,floating:o}=e;const i=mn(t),s=zc(t),a=qc(s),l=Vt(t),c=i==="y",d=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,m=r[a]/2-o[a]/2;let f;switch(l){case"top":f={x:d,y:r.y-o.height};break;case"bottom":f={x:d,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:h};break;case"left":f={x:r.x-o.width,y:h};break;default:f={x:r.x,y:r.y}}switch(xr(t)){case"start":f[s]-=m*(n&&c?-1:1);break;case"end":f[s]+=m*(n&&c?-1:1);break}return f}const ng=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:h}=Sa(c,r,l),m=r,f={},x=0;for(let b=0;b<a.length;b++){const{name:R,fn:$}=a[b],{x:w,y:T,data:N,reset:D}=await $({x:d,y:h,initialPlacement:r,placement:m,strategy:o,middlewareData:f,rects:c,platform:s,elements:{reference:e,floating:t}});d=w??d,h=T??h,f={...f,[R]:{...f[R],...N}},D&&x<=50&&(x++,typeof D=="object"&&(D.placement&&(m=D.placement),D.rects&&(c=D.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):D.rects),{x:d,y:h}=Sa(c,m,l)),b=-1)}return{x:d,y:h,placement:m,strategy:o,middlewareData:f}};async function yo(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:m=!1,padding:f=0}=_n(t,e),x=tg(f),R=a[m?h==="floating"?"reference":"floating":h],$=eo(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(R)))==null||n?R:R.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),w=h==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,T=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),N=await(i.isElement==null?void 0:i.isElement(T))?await(i.getScale==null?void 0:i.getScale(T))||{x:1,y:1}:{x:1,y:1},D=eo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:T,strategy:l}):w);return{top:($.top-D.top+x.top)/N.y,bottom:(D.bottom-$.bottom+x.bottom)/N.y,left:($.left-D.left+x.left)/N.x,right:(D.right-$.right+x.right)/N.x}}const rg=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:b=!0,...R}=_n(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const $=Vt(o),w=mn(a),T=Vt(a)===a,N=await(l.isRTL==null?void 0:l.isRTL(c.floating)),D=m||(T||!b?[Zr(a)]:Xm(a)),j=x!=="none";!m&&j&&D.push(...Zm(a,b,x,N));const W=[a,...D],u=await yo(t,R),p=[];let g=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&p.push(u[$]),h){const k=Ym(o,s,N);p.push(u[k[0]],u[k[1]])}if(g=[...g,{placement:o,overflows:p}],!p.every(k=>k<=0)){var C,S;const k=(((C=i.flip)==null?void 0:C.index)||0)+1,v=W[k];if(v)return{data:{index:k,overflows:g},reset:{placement:v}};let E=(S=g.filter(F=>F.overflows[0]<=0).sort((F,y)=>F.overflows[1]-y.overflows[1])[0])==null?void 0:S.placement;if(!E)switch(f){case"bestFit":{var A;const F=(A=g.filter(y=>{if(j){const M=mn(y.placement);return M===w||M==="y"}return!0}).map(y=>[y.placement,y.overflows.filter(M=>M>0).reduce((M,B)=>M+B,0)]).sort((y,M)=>y[1]-M[1])[0])==null?void 0:A[0];F&&(E=F);break}case"initialPlacement":E=a;break}if(o!==E)return{reset:{placement:E}}}return{}}}};async function og(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Vt(n),a=xr(n),l=mn(n)==="y",c=["left","top"].includes(s)?-1:1,d=i&&l?-1:1,h=_n(t,e);let{mainAxis:m,crossAxis:f,alignmentAxis:x}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof x=="number"&&(f=a==="end"?x*-1:x),l?{x:f*d,y:m*c}:{x:m*c,y:f*d}}const ig=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await og(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},sg=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:R=>{let{x:$,y:w}=R;return{x:$,y:w}}},...l}=_n(e,t),c={x:n,y:r},d=await yo(t,l),h=mn(Vt(o)),m=Vc(h);let f=c[m],x=c[h];if(i){const R=m==="y"?"top":"left",$=m==="y"?"bottom":"right",w=f+d[R],T=f-d[$];f=Ra(w,f,T)}if(s){const R=h==="y"?"top":"left",$=h==="y"?"bottom":"right",w=x+d[R],T=x-d[$];x=Ra(w,x,T)}const b=a.fn({...t,[m]:f,[h]:x});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[m]:i,[h]:s}}}}}},ag=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=_n(e,t),d=await yo(t,c),h=Vt(o),m=xr(o),f=mn(o)==="y",{width:x,height:b}=i.floating;let R,$;h==="top"||h==="bottom"?(R=h,$=m===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):($=h,R=m==="end"?"top":"bottom");const w=b-d.top-d.bottom,T=x-d.left-d.right,N=pn(b-d[R],w),D=pn(x-d[$],T),j=!t.middlewareData.shift;let W=N,u=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(u=T),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(W=w),j&&!m){const g=Oe(d.left,0),C=Oe(d.right,0),S=Oe(d.top,0),A=Oe(d.bottom,0);f?u=x-2*(g!==0||C!==0?g+C:Oe(d.left,d.right)):W=b-2*(S!==0||A!==0?S+A:Oe(d.top,d.bottom))}await l({...t,availableWidth:u,availableHeight:W});const p=await s.getDimensions(a.floating);return x!==p.width||b!==p.height?{reset:{rects:!0}}:{}}}};function Gc(e){const t=Xe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ft(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=ar(n)!==i||ar(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function os(e){return Ae(e)?e:e.contextElement}function On(e){const t=os(e);if(!ft(t))return ct(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Gc(t);let s=(i?ar(n.width):n.width)/r,a=(i?ar(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const lg=ct(0);function _c(e){const t=Le(e);return!rs()||!t.visualViewport?lg:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function cg(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Le(e)?!1:t}function gn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=os(e);let s=ct(1);t&&(r?Ae(r)&&(s=On(r)):s=On(e));const a=cg(i,n,r)?_c(i):ct(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,d=o.width/s.x,h=o.height/s.y;if(i){const m=Le(i),f=r&&Ae(r)?Le(r):r;let x=m,b=Fi(x);for(;b&&r&&f!==x;){const R=On(b),$=b.getBoundingClientRect(),w=Xe(b),T=$.left+(b.clientLeft+parseFloat(w.paddingLeft))*R.x,N=$.top+(b.clientTop+parseFloat(w.paddingTop))*R.y;l*=R.x,c*=R.y,d*=R.x,h*=R.y,l+=T,c+=N,x=Le(b),b=Fi(x)}}return eo({width:d,height:h,x:l,y:c})}function is(e,t){const n=bo(e).scrollLeft;return t?t.left+n:gn(pt(e)).left+n}function Qc(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:is(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function ug(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=pt(r),a=t?vo(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=ct(1);const d=ct(0),h=ft(r);if((h||!h&&!i)&&((Gn(r)!=="body"||wr(s))&&(l=bo(r)),ft(r))){const f=gn(r);c=On(r),d.x=f.x+r.clientLeft,d.y=f.y+r.clientTop}const m=s&&!h&&!i?Qc(s,l,!0):ct(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+m.x,y:n.y*c.y-l.scrollTop*c.y+d.y+m.y}}function fg(e){return Array.from(e.getClientRects())}function dg(e){const t=pt(e),n=bo(e),r=e.ownerDocument.body,o=Oe(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Oe(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+is(e);const a=-n.scrollTop;return Xe(r).direction==="rtl"&&(s+=Oe(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function hg(e,t){const n=Le(e),r=pt(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=rs();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function pg(e,t){const n=gn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=ft(e)?On(e):ct(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function Ca(e,t,n){let r;if(t==="viewport")r=hg(e,n);else if(t==="document")r=dg(pt(e));else if(Ae(t))r=pg(t,n);else{const o=_c(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return eo(r)}function Kc(e,t){const n=Ut(e);return n===t||!Ae(n)||Un(n)?!1:Xe(n).position==="fixed"||Kc(n,t)}function mg(e,t){const n=t.get(e);if(n)return n;let r=sr(e,[],!1).filter(a=>Ae(a)&&Gn(a)!=="body"),o=null;const i=Xe(e).position==="fixed";let s=i?Ut(e):e;for(;Ae(s)&&!Un(s);){const a=Xe(s),l=ns(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||wr(s)&&!l&&Kc(e,s))?r=r.filter(d=>d!==s):o=a,s=Ut(s)}return t.set(e,r),r}function gg(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?vo(t)?[]:mg(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,d)=>{const h=Ca(t,d,o);return c.top=Oe(h.top,c.top),c.right=pn(h.right,c.right),c.bottom=pn(h.bottom,c.bottom),c.left=Oe(h.left,c.left),c},Ca(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function vg(e){const{width:t,height:n}=Gc(e);return{width:t,height:n}}function bg(e,t,n){const r=ft(t),o=pt(t),i=n==="fixed",s=gn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=ct(0);if(r||!r&&!i)if((Gn(t)!=="body"||wr(o))&&(a=bo(t)),r){const m=gn(t,!0,i,t);l.x=m.x+t.clientLeft,l.y=m.y+t.clientTop}else o&&(l.x=is(o));const c=o&&!r&&!i?Qc(o,a):ct(0),d=s.left+a.scrollLeft-l.x-c.x,h=s.top+a.scrollTop-l.y-c.y;return{x:d,y:h,width:s.width,height:s.height}}function qo(e){return Xe(e).position==="static"}function Oa(e,t){if(!ft(e)||Xe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return pt(e)===n&&(n=n.ownerDocument.body),n}function Yc(e,t){const n=Le(e);if(vo(e))return n;if(!ft(e)){let o=Ut(e);for(;o&&!Un(o);){if(Ae(o)&&!qo(o))return o;o=Ut(o)}return n}let r=Oa(e,t);for(;r&&zm(r)&&qo(r);)r=Oa(r,t);return r&&Un(r)&&qo(r)&&!ns(r)?n:r||Gm(e)||n}const yg=async function(e){const t=this.getOffsetParent||Yc,n=this.getDimensions,r=await n(e.floating);return{reference:bg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function wg(e){return Xe(e).direction==="rtl"}const xg={convertOffsetParentRelativeRectToViewportRelativeRect:ug,getDocumentElement:pt,getClippingRect:gg,getOffsetParent:Yc,getElementRects:yg,getClientRects:fg,getDimensions:vg,getScale:On,isElement:Ae,isRTL:wg};function Xc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Eg(e,t){let n=null,r;const o=pt(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:d,top:h,width:m,height:f}=c;if(a||t(),!m||!f)return;const x=Nr(h),b=Nr(o.clientWidth-(d+m)),R=Nr(o.clientHeight-(h+f)),$=Nr(d),T={rootMargin:-x+"px "+-b+"px "+-R+"px "+-$+"px",threshold:Oe(0,pn(1,l))||1};let N=!0;function D(j){const W=j[0].intersectionRatio;if(W!==l){if(!N)return s();W?s(!1,W):r=setTimeout(()=>{s(!1,1e-7)},1e3)}W===1&&!Xc(c,e.getBoundingClientRect())&&s(),N=!1}try{n=new IntersectionObserver(D,{...T,root:o.ownerDocument})}catch{n=new IntersectionObserver(D,T)}n.observe(e)}return s(!0),i}function Rg(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=os(e),d=o||i?[...c?sr(c):[],...sr(t)]:[];d.forEach($=>{o&&$.addEventListener("scroll",n,{passive:!0}),i&&$.addEventListener("resize",n)});const h=c&&a?Eg(c,n):null;let m=-1,f=null;s&&(f=new ResizeObserver($=>{let[w]=$;w&&w.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var T;(T=f)==null||T.observe(t)})),n()}),c&&!l&&f.observe(c),f.observe(t));let x,b=l?gn(e):null;l&&R();function R(){const $=gn(e);b&&!Xc(b,$)&&n(),b=$,x=requestAnimationFrame(R)}return n(),()=>{var $;d.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),h==null||h(),($=f)==null||$.disconnect(),f=null,l&&cancelAnimationFrame(x)}}const zo=yo,Sg=ig,Cg=sg,Og=rg,Ag=ag,kg=(e,t,n)=>{const r=new Map,o={platform:xg,...n},i={...o.platform,_c:r};return ng(e,t,{...o,platform:i})};var Br=typeof document<"u"?O.useLayoutEffect:O.useEffect;function to(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(!to(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 i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!to(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Jc(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Aa(e,t){const n=Jc(e);return Math.round(t*n)/n}function Go(e){const t=I.useRef(e);return Br(()=>{t.current=e}),t}function Tg(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[d,h]=I.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,f]=I.useState(r);to(m,r)||f(r);const[x,b]=I.useState(null),[R,$]=I.useState(null),w=I.useCallback(y=>{y!==j.current&&(j.current=y,b(y))},[]),T=I.useCallback(y=>{y!==W.current&&(W.current=y,$(y))},[]),N=i||x,D=s||R,j=I.useRef(null),W=I.useRef(null),u=I.useRef(d),p=l!=null,g=Go(l),C=Go(o),S=Go(c),A=I.useCallback(()=>{if(!j.current||!W.current)return;const y={placement:t,strategy:n,middleware:m};C.current&&(y.platform=C.current),kg(j.current,W.current,y).then(M=>{const B={...M,isPositioned:S.current!==!1};k.current&&!to(u.current,B)&&(u.current=B,Bn.flushSync(()=>{h(B)}))})},[m,t,n,C,S]);Br(()=>{c===!1&&u.current.isPositioned&&(u.current.isPositioned=!1,h(y=>({...y,isPositioned:!1})))},[c]);const k=I.useRef(!1);Br(()=>(k.current=!0,()=>{k.current=!1}),[]),Br(()=>{if(N&&(j.current=N),D&&(W.current=D),N&&D){if(g.current)return g.current(N,D,A);A()}},[N,D,A,g,p]);const v=I.useMemo(()=>({reference:j,floating:W,setReference:w,setFloating:T}),[w,T]),E=I.useMemo(()=>({reference:N,floating:D}),[N,D]),F=I.useMemo(()=>{const y={position:n,left:0,top:0};if(!E.floating)return y;const M=Aa(E.floating,d.x),B=Aa(E.floating,d.y);return a?{...y,transform:"translate("+M+"px, "+B+"px)",...Jc(E.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:B}},[n,a,E.floating,d.x,d.y]);return I.useMemo(()=>({...d,update:A,refs:v,elements:E,floatingStyles:F}),[d,A,v,E,F])}const Zc=(e,t)=>({...Sg(e),options:[e,t]}),Fg=(e,t)=>({...Cg(e),options:[e,t]}),Pg=(e,t)=>({...Og(e),options:[e,t]}),$g=(e,t)=>({...Ag(e),options:[e,t]}),eu={...I},Mg=eu.useInsertionEffect,Ig=Mg||(e=>e());function tu(e){const t=I.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Ig(()=>{t.current=e}),I.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)},[])}var $i=typeof document<"u"?O.useLayoutEffect:O.useEffect;let ka=!1,Dg=0;const Ta=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Dg++;function Ng(){const[e,t]=I.useState(()=>ka?Ta():void 0);return $i(()=>{e==null&&t(Ta())},[]),I.useEffect(()=>{ka=!0},[]),e}const Lg=eu.useId,jg=Lg||Ng;let lr;process.env.NODE_ENV!=="production"&&(lr=new Set);function Bg(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=lr)!=null&&e.has(o))){var i;(i=lr)==null||i.add(o),console.warn(o)}}function Hg(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=lr)!=null&&e.has(o))){var i;(i=lr)==null||i.add(o),console.error(o)}}function Wg(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const Ug=I.createContext(null),Vg=I.createContext(null),qg=()=>{var e;return((e=I.useContext(Ug))==null?void 0:e.id)||null},zg=()=>I.useContext(Vg),Gg="data-floating-ui-focusable";function _g(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=jg(),i=I.useRef({}),[s]=I.useState(()=>Wg()),a=qg()!=null;if(process.env.NODE_ENV!=="production"){const f=r.reference;f&&!Ae(f)&&Hg("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=I.useState(r.reference),d=tu((f,x,b)=>{i.current.openEvent=f?x:void 0,s.emit("openchange",{open:f,event:x,reason:b,nested:a}),n==null||n(f,x,b)}),h=I.useMemo(()=>({setPositionReference:c}),[]),m=I.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return I.useMemo(()=>({dataRef:i,open:t,onOpenChange:d,elements:m,events:s,floatingId:o,refs:h}),[t,d,m,s,o,h])}function Qg(e){e===void 0&&(e={});const{nodeId:t}=e,n=_g({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=I.useState(null),[a,l]=I.useState(null),d=(o==null?void 0:o.domReference)||i,h=I.useRef(null),m=zg();$i(()=>{d&&(h.current=d)},[d]);const f=Tg({...e,elements:{...o,...a&&{reference:a}}}),x=I.useCallback(T=>{const N=Ae(T)?{getBoundingClientRect:()=>T.getBoundingClientRect(),contextElement:T}:T;l(N),f.refs.setReference(N)},[f.refs]),b=I.useCallback(T=>{(Ae(T)||T===null)&&(h.current=T,s(T)),(Ae(f.refs.reference.current)||f.refs.reference.current===null||T!==null&&!Ae(T))&&f.refs.setReference(T)},[f.refs]),R=I.useMemo(()=>({...f.refs,setReference:b,setPositionReference:x,domReference:h}),[f.refs,b,x]),$=I.useMemo(()=>({...f.elements,domReference:d}),[f.elements,d]),w=I.useMemo(()=>({...f,...r,refs:R,elements:$,nodeId:t}),[f,R,$,t,r]);return $i(()=>{r.dataRef.current.floatingContext=w;const T=m==null?void 0:m.nodesRef.current.find(N=>N.id===t);T&&(T.context=w)}),I.useMemo(()=>({...f,context:w,refs:R,elements:$}),[f,R,$,w])}const Fa="active",Pa="selected";function _o(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[Fa]:s,[Pa]:a,...l}=e;i=l}return{...n==="floating"&&{tabIndex:-1,[Gg]:""},...i,...t.map(s=>{const a=s?s[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((s,a)=>(a&&Object.entries(a).forEach(l=>{let[c,d]=l;if(!(o&&[Fa,Pa].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof d=="function"){var h;(h=r.get(c))==null||h.push(d),s[c]=function(){for(var m,f=arguments.length,x=new Array(f),b=0;b<f;b++)x[b]=arguments[b];return(m=r.get(c))==null?void 0:m.map(R=>R(...x)).find(R=>R!==void 0)}}}else s[c]=d}),s),{})}}function Kg(e){e===void 0&&(e=[]);const t=e.map(a=>a==null?void 0:a.reference),n=e.map(a=>a==null?void 0:a.floating),r=e.map(a=>a==null?void 0:a.item),o=I.useCallback(a=>_o(a,e,"reference"),t),i=I.useCallback(a=>_o(a,e,"floating"),n),s=I.useCallback(a=>_o(a,e,"item"),r);return I.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s}),[o,i,s])}function $a(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const Yg=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:i=0,index:s=0,minItemsVisible:a=4,referenceOverflowThreshold:l=0,scrollRef:c,...d}=_n(e,t),{rects:h,elements:{floating:m}}=t,f=n.current[s],x=(c==null?void 0:c.current)||m,b=m.clientTop||x.clientTop,R=m.clientTop!==0,$=x.clientTop!==0,w=m===x;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||Bg('`placement` side must be "bottom" when using the `inner`',"middleware.")),!f)return{};const T={...t,...await Zc(-f.offsetTop-m.clientTop-h.reference.height/2-f.offsetHeight/2-i).fn(t)},N=await zo($a(T,x.scrollHeight+b+m.clientTop),d),D=await zo(T,{...d,elementContext:"reference"}),j=Oe(0,N.top),W=T.y+j,g=(x.scrollHeight>x.clientHeight?C=>C:ar)(Oe(0,x.scrollHeight+(R&&w||$?b*2:0)-j-Oe(0,N.bottom)));if(x.style.maxHeight=g+"px",x.scrollTop=j,o){const C=x.offsetHeight<f.offsetHeight*pn(a,n.current.length)-1||D.top>=-l||D.bottom>=-l;Bn.flushSync(()=>o(C))}return r&&(r.current=await zo($a({...T,y:W},x.offsetHeight+b+m.clientTop),d)),{y:W}}});function Xg(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:i,scrollRef:s,onChange:a}=t,l=tu(a),c=I.useRef(!1),d=I.useRef(null),h=I.useRef(null);I.useEffect(()=>{if(!o)return;function f(b){if(b.ctrlKey||!x||i.current==null)return;const R=b.deltaY,$=i.current.top>=-.5,w=i.current.bottom>=-.5,T=x.scrollHeight-x.clientHeight,N=R<0?-1:1,D=R<0?"max":"min";x.scrollHeight<=x.clientHeight||(!$&&R>0||!w&&R<0?(b.preventDefault(),Bn.flushSync(()=>{l(j=>j+Math[D](R,T*N))})):/firefox/i.test(_m())&&(x.scrollTop+=R))}const x=(s==null?void 0:s.current)||r.floating;if(n&&x)return x.addEventListener("wheel",f),requestAnimationFrame(()=>{d.current=x.scrollTop,i.current!=null&&(h.current={...i.current})}),()=>{d.current=null,h.current=null,x.removeEventListener("wheel",f)}},[o,n,r.floating,i,s,l]);const m=I.useMemo(()=>({onKeyDown(){c.current=!0},onWheel(){c.current=!1},onPointerMove(){c.current=!1},onScroll(){const f=(s==null?void 0:s.current)||r.floating;if(!(!i.current||!f||!c.current)){if(d.current!==null){const x=f.scrollTop-d.current;(i.current.bottom<-.5&&x<-1||i.current.top<-.5&&x>1)&&Bn.flushSync(()=>l(b=>b+x))}requestAnimationFrame(()=>{d.current=f.scrollTop})}}}),[r.floating,l,i,s]);return I.useMemo(()=>o?{floating:m}:{},[o,m])}let Qn=O.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});Qn.displayName="FloatingContext";let ss=O.createContext(null);ss.displayName="PlacementContext";function Jg(e){return O.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function Zg(){return O.useContext(Qn).setReference}function ev(){return O.useContext(Qn).getReferenceProps}function tv(){let{getFloatingProps:e,slot:t}=O.useContext(Qn);return O.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function nv(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=O.useContext(ss),n=O.useMemo(()=>e,[JSON.stringify(e,(o,i)=>{var s;return(s=i==null?void 0:i.outerHTML)!=null?s:i})]);xe(()=>{t==null||t(n??null)},[t,n]);let r=O.useContext(Qn);return O.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let Ma=4;function rv({children:e,enabled:t=!0}){let[n,r]=O.useState(null),[o,i]=O.useState(0),s=O.useRef(null),[a,l]=O.useState(null);ov(a);let c=t&&n!==null&&a!==null,{to:d="bottom",gap:h=0,offset:m=0,padding:f=0,inner:x}=iv(n,a),[b,R="center"]=d.split(" ");xe(()=>{c&&i(0)},[c]);let{refs:$,floatingStyles:w,context:T}=Qg({open:c,placement:b==="selection"?R==="center"?"bottom":`bottom-${R}`:R==="center"?`${b}`:`${b}-${R}`,strategy:"absolute",transform:!1,middleware:[Zc({mainAxis:b==="selection"?0:h,crossAxis:m}),Fg({padding:f}),b!=="selection"&&Pg({padding:f}),b==="selection"&&x?Yg({...x,padding:f,overflowRef:s,offset:o,minItemsVisible:Ma,referenceOverflowThreshold:f,onFallbackChange(C){var S,A;if(!C)return;let k=T.elements.floating;if(!k)return;let v=parseFloat(getComputedStyle(k).scrollPaddingBottom)||0,E=Math.min(Ma,k.childElementCount),F=0,y=0;for(let M of(A=(S=T.elements.floating)==null?void 0:S.childNodes)!=null?A:[])if(St(M)){let B=M.offsetTop,V=B+M.clientHeight+v,H=k.scrollTop,_=H+k.clientHeight;if(B>=H&&V<=_)E--;else{y=Math.max(0,Math.min(V,_)-Math.max(B,H)),F=M.clientHeight;break}}E>=1&&i(M=>{let B=F*E-y+v;return M>=B?M:B})}}):null,$g({padding:f,apply({availableWidth:C,availableHeight:S,elements:A}){Object.assign(A.floating.style,{overflow:"auto",maxWidth:`${C}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${S}px)`})}})].filter(Boolean),whileElementsMounted:Rg}),[N=b,D=R]=T.placement.split("-");b==="selection"&&(N="selection");let j=O.useMemo(()=>({anchor:[N,D].filter(Boolean).join(" ")}),[N,D]),W=Xg(T,{overflowRef:s,onChange:i}),{getReferenceProps:u,getFloatingProps:p}=Kg([W]),g=ce(C=>{l(C),$.setFloating(C)});return I.createElement(ss.Provider,{value:r},I.createElement(Qn.Provider,{value:{setFloating:g,setReference:$.setReference,styles:w,getReferenceProps:u,getFloatingProps:p,slot:j}},e))}function ov(e){xe(()=>{if(!e)return;let t=new MutationObserver(()=>{let n=window.getComputedStyle(e).maxHeight,r=parseFloat(n);if(isNaN(r))return;let o=parseInt(n);isNaN(o)||r!==o&&(e.style.maxHeight=`${Math.ceil(r)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function iv(e,t){var n,r,o;let i=Qo((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),s=Qo((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),a=Qo((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:i,offset:s,padding:a}}function Qo(e,t,n=void 0){let r=yr(),o=ce((l,c)=>{if(l==null)return[n,null];if(typeof l=="number")return[l,null];if(typeof l=="string"){if(!c)return[n,null];let d=Ia(l,c);return[d,h=>{let m=nu(l);{let f=m.map(x=>window.getComputedStyle(c).getPropertyValue(x));r.requestAnimationFrame(function x(){r.nextFrame(x);let b=!1;for(let[$,w]of m.entries()){let T=window.getComputedStyle(c).getPropertyValue(w);if(f[$]!==T){f[$]=T,b=!0;break}}if(!b)return;let R=Ia(l,c);d!==R&&(h(R),d=R)})}return r.dispose}]}return[n,null]}),i=O.useMemo(()=>o(e,t)[0],[e,t]),[s=i,a]=O.useState();return xe(()=>{let[l,c]=o(e,t);if(a(l),!!c)return c(a)},[e,t]),s}function nu(e){let t=/var\((.*)\)/.exec(e);if(t){let n=t[1].indexOf(",");if(n===-1)return[t[1]];let r=t[1].slice(0,n).trim(),o=t[1].slice(n+1).trim();return o?[r,...nu(o)]:[r]}return[]}function Ia(e,t){let n=document.createElement("div");t.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",e,"important");let r=parseFloat(window.getComputedStyle(n).marginTop)||0;return t.removeChild(n),r}function sv(e,t){let[n,r]=O.useState(t);return!e&&n!==t&&r(t),e?n:t}let as=O.createContext(null);as.displayName="OpenClosedContext";var cr=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(cr||{});function av(){return O.useContext(as)}function lv({value:e,children:t}){return O.createElement(as.Provider,{value:e},t)}function cv(e){throw new Error("Unexpected object: "+e)}var ue=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(ue||{});function Lr(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=r??-1;switch(e.focus){case 0:{for(let i=0;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 1:{o===-1&&(o=n.length);for(let i=o-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 2:{for(let i=o+1;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 3:{for(let i=n.length-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 4:{for(let i=0;i<n.length;++i)if(t.resolveId(n[i],i,n)===e.id)return i;return r}case 5:return null;default:cv(e)}}function ru(e){let t=ce(e),n=O.useRef(!1);O.useEffect(()=>(n.current=!1,()=>{n.current=!0,mc(()=>{n.current&&t()})}),[t])}function uv(){let e=typeof document>"u";return"useSyncExternalStore"in I?(t=>t.useSyncExternalStore)(I)(()=>()=>{},()=>!1,()=>!e):!1}function fv(){let e=uv(),[t,n]=I.useState(cn.isHandoffComplete);return t&&cn.isHandoffComplete===!1&&n(!1),I.useEffect(()=>{t!==!0&&n(!0)},[t]),I.useEffect(()=>cn.handoff(),[]),e?!1:t}let dv=O.createContext(!1);function hv(){return O.useContext(dv)}function pv(e){let t=hv(),n=O.useContext(iu),[r,o]=O.useState(()=>{var i;if(!t&&n!==null)return(i=n.current)!=null?i:null;if(cn.isServer)return null;let s=e==null?void 0:e.getElementById("headlessui-portal-root");if(s)return s;if(e===null)return null;let a=e.createElement("div");return a.setAttribute("id","headlessui-portal-root"),e.body.appendChild(a)});return O.useEffect(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),O.useEffect(()=>{t||n!==null&&o(n.current)},[n,o,t]),r}let ou=O.Fragment,mv=et(function(e,t){let{ownerDocument:n=null,...r}=e,o=O.useRef(null),i=ht(Hp(f=>{o.current=f}),t),s=Ti(o),a=n??s,l=pv(a),[c]=O.useState(()=>{var f;return cn.isServer?null:(f=a==null?void 0:a.createElement("div"))!=null?f:null}),d=O.useContext(yv),h=fv();xe(()=>{!l||!c||l.contains(c)||(c.setAttribute("data-headlessui-portal",""),l.appendChild(c))},[l,c]),xe(()=>{if(c&&d)return d.register(c)},[d,c]),ru(()=>{var f;!l||!c||(Ji(c)&&l.contains(c)&&l.removeChild(c),l.childNodes.length<=0&&((f=l.parentElement)==null||f.removeChild(l)))});let m=Ze();return h?!l||!c?null:Bt.createPortal(m({ourProps:{ref:i},theirProps:r,slot:{},defaultTag:ou,name:"Portal"}),c):null});function gv(e,t){let n=ht(t),{enabled:r=!0,ownerDocument:o,...i}=e,s=Ze();return r?O.createElement(mv,{...i,ownerDocument:o,ref:n}):s({ourProps:{ref:n},theirProps:i,slot:{},defaultTag:ou,name:"Portal"})}let vv=O.Fragment,iu=O.createContext(null);function bv(e,t){let{target:n,...r}=e,o={ref:ht(t)},i=Ze();return O.createElement(iu.Provider,{value:n},i({ourProps:o,theirProps:r,defaultTag:vv,name:"Popover.Group"}))}let yv=O.createContext(null),wv=et(gv),xv=et(bv),Ev=Object.assign(wv,{Group:xv});function Rv(e,t){let n=O.useRef({left:0,top:0});if(xe(()=>{if(!t)return;let o=t.getBoundingClientRect();o&&(n.current=o)},[e,t]),t==null||!e||t===document.activeElement)return!1;let r=t.getBoundingClientRect();return r.top!==n.current.top||r.left!==n.current.left}let Da=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Na(e){var t,n;let r=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!St(o))return r;let i=!1;for(let a of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))a.remove(),i=!0;let s=i?(n=o.innerText)!=null?n:"":r;return Da.test(s)&&(s=s.replace(Da,"")),s}function Sv(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let r=n.split(" ").map(o=>{let i=document.getElementById(o);if(i){let s=i.getAttribute("aria-label");return typeof s=="string"?s.trim():Na(i).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return Na(e).trim()}function Cv(e){let t=O.useRef(""),n=O.useRef("");return ce(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(t.current===o)return n.current;let i=Sv(r).trim().toLowerCase();return t.current=o,n.current=i,i})}var Ov=Object.defineProperty,Av=(e,t,n)=>t in e?Ov(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,La=(e,t,n)=>(Av(e,typeof t!="symbol"?t+"":t,n),n),we=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(we||{}),at=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(at||{}),Mi=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Mi||{}),su=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterOptions=5]="RegisterOptions",e[e.UnregisterOptions=6]="UnregisterOptions",e[e.SetButtonElement=7]="SetButtonElement",e[e.SetOptionsElement=8]="SetOptionsElement",e[e.SortOptions=9]="SortOptions",e))(su||{});function ja(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=Bc(t(e.options.slice()),i=>i.dataRef.current.domRef.current),o=n?r.indexOf(n):null;return o===-1&&(o=null),{options:r,activeOptionIndex:o}}let kv={1(e){return e.dataRef.current.disabled||e.listboxState===1?e:{...e,activeOptionIndex:null,pendingFocus:{focus:ue.Nothing},listboxState:1,__demoMode:!1}},0(e,t){if(e.dataRef.current.disabled||e.listboxState===0)return e;let n=e.activeOptionIndex,{isSelected:r}=e.dataRef.current,o=e.options.findIndex(i=>r(i.dataRef.current.value));return o!==-1&&(n=o),{...e,pendingFocus:t.focus,listboxState:0,activeOptionIndex:n,__demoMode:!1}},2(e,t){var n,r,o,i,s;if(e.dataRef.current.disabled||e.listboxState===1)return e;let a={...e,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===ue.Nothing)return{...a,activeOptionIndex:null};if(t.focus===ue.Specific)return{...a,activeOptionIndex:e.options.findIndex(d=>d.id===t.id)};if(t.focus===ue.Previous){let d=e.activeOptionIndex;if(d!==null){let h=e.options[d].dataRef.current.domRef,m=Lr(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:f=>f.id,resolveDisabled:f=>f.dataRef.current.disabled});if(m!==null){let f=e.options[m].dataRef.current.domRef;if(((r=h.current)==null?void 0:r.previousElementSibling)===f.current||((o=f.current)==null?void 0:o.previousElementSibling)===null)return{...a,activeOptionIndex:m}}}}else if(t.focus===ue.Next){let d=e.activeOptionIndex;if(d!==null){let h=e.options[d].dataRef.current.domRef,m=Lr(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:f=>f.id,resolveDisabled:f=>f.dataRef.current.disabled});if(m!==null){let f=e.options[m].dataRef.current.domRef;if(((i=h.current)==null?void 0:i.nextElementSibling)===f.current||((s=f.current)==null?void 0:s.nextElementSibling)===null)return{...a,activeOptionIndex:m}}}}let l=ja(e),c=Lr(t,{resolveItems:()=>l.options,resolveActiveIndex:()=>l.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled});return{...a,...l,activeOptionIndex:c}},3:(e,t)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let n=e.searchQuery!==""?0:1,r=e.searchQuery+t.value.toLowerCase(),o=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find(s=>{var a;return!s.dataRef.current.disabled&&((a=s.dataRef.current.textValue)==null?void 0:a.startsWith(r))}),i=o?e.options.indexOf(o):-1;return i===-1||i===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:i,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5:(e,t)=>{let n=e.options.concat(t.options),r=e.activeOptionIndex;if(e.pendingFocus.focus!==ue.Nothing&&(r=Lr(e.pendingFocus,{resolveItems:()=>n,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled})),e.activeOptionIndex===null){let{isSelected:o}=e.dataRef.current;if(o){let i=n.findIndex(s=>o==null?void 0:o(s.dataRef.current.value));i!==-1&&(r=i)}}return{...e,options:n,activeOptionIndex:r,pendingFocus:{focus:ue.Nothing},pendingShouldSort:!0}},6:(e,t)=>{let n=e.options,r=[],o=new Set(t.options);for(let[i,s]of n.entries())if(o.has(s.id)&&(r.push(i),o.delete(s.id),o.size===0))break;if(r.length>0){n=n.slice();for(let i of r.reverse())n.splice(i,1)}return{...e,options:n,activationTrigger:1}},7:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},8:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element},9:e=>e.pendingShouldSort?{...e,...ja(e),pendingShouldSort:!1}:e};class ls extends $c{constructor(t){super(t),La(this,"actions",{onChange:n=>{let{onChange:r,compare:o,mode:i,value:s}=this.state.dataRef.current;return ut(i,{0:()=>r==null?void 0:r(n),1:()=>{let a=s.slice(),l=a.findIndex(c=>o(c,n));return l===-1?a.push(n):a.splice(l,1),r==null?void 0:r(a)}})},registerOption:Wo(()=>{let n=[],r=new Set;return[(o,i)=>{r.has(i)||(r.add(i),n.push({id:o,dataRef:i}))},()=>(r.clear(),this.send({type:5,options:n.splice(0)}))]}),unregisterOption:Wo(()=>{let n=[];return[r=>n.push(r),()=>{this.send({type:6,options:n.splice(0)})}]}),goToOption:Wo(()=>{let n=null;return[(r,o)=>{n={type:2,...r,trigger:o}},()=>n&&this.send(n)]}),closeListbox:()=>{this.send({type:1})},openListbox:n=>{this.send({type:0,focus:n})},selectActiveOption:()=>{if(this.state.activeOptionIndex!==null){let{dataRef:n,id:r}=this.state.options[this.state.activeOptionIndex];this.actions.onChange(n.current.value),this.send({type:2,focus:ue.Specific,id:r})}},selectOption:n=>{let r=this.state.options.find(o=>o.id===n);r&&this.actions.onChange(r.dataRef.current.value)},search:n=>{this.send({type:3,value:n})},clearSearch:()=>{this.send({type:4})},setButtonElement:n=>{this.send({type:7,element:n})},setOptionsElement:n=>{this.send({type:8,element:n})}}),La(this,"selectors",{activeDescendantId(n){var r;let o=n.activeOptionIndex,i=n.options;return o===null||(r=i[o])==null?void 0:r.id},isActive(n,r){var o;let i=n.activeOptionIndex,s=n.options;return i!==null?((o=s[i])==null?void 0:o.id)===r:!1},shouldScrollIntoView(n,r){return n.__demoMode||n.listboxState!==0||n.activationTrigger===0?!1:this.isActive(n,r)}}),this.on(5,()=>{requestAnimationFrame(()=>{this.send({type:9})})});{let n=this.state.id,r=es.get(null);this.disposables.add(r.on(Ic.Push,o=>{!r.selectors.isTop(o,n)&&this.state.listboxState===0&&this.actions.closeListbox()})),this.on(0,()=>r.actions.push(n)),this.on(1,()=>r.actions.pop(n))}}static new({id:t,__demoMode:n=!1}){return new ls({id:t,dataRef:{current:{}},listboxState:n?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:ue.Nothing},__demoMode:n})}reduce(t,n){return ut(n.type,kv,t,n)}}const au=O.createContext(null);function cs(e){let t=O.useContext(au);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,lu),n}return t}function lu({id:e,__demoMode:t=!1}){let n=O.useMemo(()=>ls.new({id:e,__demoMode:t}),[]);return ru(()=>n.dispose()),n}let wo=O.createContext(null);wo.displayName="ListboxDataContext";function Er(e){let t=O.useContext(wo);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Er),n}return t}let Tv=O.Fragment;function Fv(e,t){let n=O.useId(),r=Yi(),{value:o,defaultValue:i,form:s,name:a,onChange:l,by:c,invalid:d=!1,disabled:h=r||!1,horizontal:m=!1,multiple:f=!1,__demoMode:x=!1,...b}=e;const R=m?"horizontal":"vertical";let $=ht(t),w=Cp(i),[T=f?[]:void 0,N]=Sp(o,l,w),D=lu({id:n,__demoMode:x}),j=O.useRef({static:!1,hold:!1}),W=O.useRef(new Map),u=Yp(c),p=O.useCallback(H=>ut(g.mode,{[at.Multi]:()=>T.some(_=>u(_,H)),[at.Single]:()=>u(T,H)}),[T]),g=O.useMemo(()=>({value:T,disabled:h,invalid:d,mode:f?at.Multi:at.Single,orientation:R,onChange:N,compare:u,isSelected:p,optionsPropsRef:j,listRef:W}),[T,h,d,f,R,N,u,p,j,W]);xe(()=>{D.state.dataRef.current=g},[g]);let C=qe(D,H=>H.listboxState),S=es.get(null),A=qe(S,O.useCallback(H=>S.selectors.isTop(H,n),[S,n])),[k,v]=qe(D,H=>[H.buttonElement,H.optionsElement]);Sm(A,[k,v],(H,_)=>{D.send({type:su.CloseListbox}),jc(_,ts.Loose)||(H.preventDefault(),k==null||k.focus())});let E=O.useMemo(()=>({open:C===we.Open,disabled:h,invalid:d,value:T}),[C,h,d,T]),[F,y]=zp({inherit:!0}),M={ref:$},B=O.useCallback(()=>{if(w!==void 0)return N==null?void 0:N(w)},[N,w]),V=Ze();return O.createElement(y,{value:F,props:{htmlFor:k==null?void 0:k.id},slot:{open:C===we.Open,disabled:h}},O.createElement(rv,null,O.createElement(au.Provider,{value:D},O.createElement(wo.Provider,{value:g},O.createElement(lv,{value:ut(C,{[we.Open]:cr.Open,[we.Closed]:cr.Closed})},a!=null&&T!=null&&O.createElement(Pp,{disabled:h,data:{[a]:T},form:s,onReset:B}),V({ourProps:M,theirProps:b,slot:E,defaultTag:Tv,name:"Listbox"}))))))}let Pv="button";function $v(e,t){let n=O.useId(),r=Ec(),o=Er("Listbox.Button"),i=cs("Listbox.Button"),{id:s=r||`headlessui-listbox-button-${n}`,disabled:a=o.disabled||!1,autoFocus:l=!1,...c}=e,d=ht(t,Zg(),i.actions.setButtonElement),h=ev(),[m,f,x]=qe(i,v=>[v.listboxState,v.buttonElement,v.optionsElement]),b=m===we.Open;Am(b,{trigger:f,action:O.useCallback(v=>{if(f!=null&&f.contains(v.target))return Dr.Ignore;let E=v.target.closest('[role="option"]:not([data-disabled])');return St(E)?Dr.Select(E):x!=null&&x.contains(v.target)?Dr.Ignore:Dr.Close},[f,x]),close:i.actions.closeListbox,select:i.actions.selectActiveOption});let R=ce(v=>{switch(v.key){case ye.Enter:Op(v.currentTarget);break;case ye.Space:case ye.ArrowDown:v.preventDefault(),i.actions.openListbox({focus:o.value?ue.Nothing:ue.First});break;case ye.ArrowUp:v.preventDefault(),i.actions.openListbox({focus:o.value?ue.Nothing:ue.Last});break}}),$=ce(v=>{switch(v.key){case ye.Space:v.preventDefault();break}}),w=ce(v=>{var E;if(v.button===0){if(jp(v.currentTarget))return v.preventDefault();i.state.listboxState===we.Open?(Bt.flushSync(()=>i.actions.closeListbox()),(E=i.state.buttonElement)==null||E.focus({preventScroll:!0})):(v.preventDefault(),i.actions.openListbox({focus:ue.Nothing}))}}),T=ce(v=>v.preventDefault()),N=kc([s]),D=Wp(),{isFocusVisible:j,focusProps:W}=fp({autoFocus:l}),{isHovered:u,hoverProps:p}=up({isDisabled:a}),{pressed:g,pressProps:C}=vp({disabled:a}),S=O.useMemo(()=>({open:m===we.Open,active:g||m===we.Open,disabled:a,invalid:o.invalid,value:o.value,hover:u,focus:j,autofocus:l}),[m,o.value,a,u,j,g,o.invalid,l]),A=qe(i,v=>v.listboxState===we.Open),k=vc(h(),{ref:d,id:s,type:km(e,f),"aria-haspopup":"listbox","aria-controls":x==null?void 0:x.id,"aria-expanded":A,"aria-labelledby":N,"aria-describedby":D,disabled:a||void 0,autoFocus:l,onKeyDown:R,onKeyUp:$,onKeyPress:T,onPointerDown:w},W,p,C);return Ze()({ourProps:k,theirProps:c,slot:S,defaultTag:Pv,name:"Listbox.Button"})}let cu=O.createContext(!1),Mv="div",Iv=Ci.RenderStrategy|Ci.Static;function Dv(e,t){let n=O.useId(),{id:r=`headlessui-listbox-options-${n}`,anchor:o,portal:i=!1,modal:s=!0,transition:a=!1,...l}=e,c=Jg(o),[d,h]=O.useState(null);c&&(i=!0);let m=Er("Listbox.Options"),f=cs("Listbox.Options"),[x,b,R,$]=qe(f,U=>[U.listboxState,U.buttonElement,U.optionsElement,U.__demoMode]),w=Ti(b),T=Ti(R),N=av(),[D,j]=Wm(a,d,N!==null?(N&cr.Open)===cr.Open:x===we.Open);dm(D,b,f.actions.closeListbox);let W=$?!1:s&&x===we.Open;Nm(W,T);let u=$?!1:s&&x===we.Open;fm(u,{allowed:O.useCallback(()=>[b,R],[b,R])});let p=x!==we.Open,g=Rv(p,b)?!1:D,C=D&&x===we.Closed,S=sv(C,m.value),A=ce(U=>m.compare(S,U)),k=qe(f,U=>{var ae;if(c==null||!((ae=c==null?void 0:c.to)!=null&&ae.includes("selection")))return null;let ge=U.options.findIndex(Ee=>A(Ee.dataRef.current.value));return ge===-1&&(ge=0),ge}),v=(()=>{if(c==null)return;if(k===null)return{...c,inner:void 0};let U=Array.from(m.listRef.current.values());return{...c,inner:{listRef:{current:U},index:k}}})(),[E,F]=nv(v),y=tv(),M=ht(t,c?E:null,f.actions.setOptionsElement,h),B=yr();O.useEffect(()=>{var U;let ae=R;ae&&x===we.Open&&ae!==((U=br(ae))==null?void 0:U.activeElement)&&(ae==null||ae.focus({preventScroll:!0}))},[x,R]);let V=ce(U=>{var ae,ge;switch(B.dispose(),U.key){case ye.Space:if(f.state.searchQuery!=="")return U.preventDefault(),U.stopPropagation(),f.actions.search(U.key);case ye.Enter:if(U.preventDefault(),U.stopPropagation(),f.state.activeOptionIndex!==null){let{dataRef:Ee}=f.state.options[f.state.activeOptionIndex];f.actions.onChange(Ee.current.value)}m.mode===at.Single&&(Bt.flushSync(()=>f.actions.closeListbox()),(ae=f.state.buttonElement)==null||ae.focus({preventScroll:!0}));break;case ut(m.orientation,{vertical:ye.ArrowDown,horizontal:ye.ArrowRight}):return U.preventDefault(),U.stopPropagation(),f.actions.goToOption({focus:ue.Next});case ut(m.orientation,{vertical:ye.ArrowUp,horizontal:ye.ArrowLeft}):return U.preventDefault(),U.stopPropagation(),f.actions.goToOption({focus:ue.Previous});case ye.Home:case ye.PageUp:return U.preventDefault(),U.stopPropagation(),f.actions.goToOption({focus:ue.First});case ye.End:case ye.PageDown:return U.preventDefault(),U.stopPropagation(),f.actions.goToOption({focus:ue.Last});case ye.Escape:U.preventDefault(),U.stopPropagation(),Bt.flushSync(()=>f.actions.closeListbox()),(ge=f.state.buttonElement)==null||ge.focus({preventScroll:!0});return;case ye.Tab:U.preventDefault(),U.stopPropagation(),Bt.flushSync(()=>f.actions.closeListbox()),wm(f.state.buttonElement,U.shiftKey?ki.Previous:ki.Next);break;default:U.key.length===1&&(f.actions.search(U.key),B.setTimeout(()=>f.actions.clearSearch(),350));break}}),H=qe(f,U=>{var ae;return(ae=U.buttonElement)==null?void 0:ae.id}),_=O.useMemo(()=>({open:x===we.Open}),[x]),ee=vc(c?y():{},{id:r,ref:M,"aria-activedescendant":qe(f,f.selectors.activeDescendantId),"aria-multiselectable":m.mode===at.Multi?!0:void 0,"aria-labelledby":H,"aria-orientation":m.orientation,onKeyDown:V,role:"listbox",tabIndex:x===we.Open?0:void 0,style:{...l.style,...F,"--button-width":Jp(b,!0).width},...Hm(j)}),Z=Ze(),Y=O.useMemo(()=>m.mode===at.Multi?m:{...m,isSelected:A},[m,A]);return O.createElement(Ev,{enabled:i?e.static||D:!1,ownerDocument:w},O.createElement(wo.Provider,{value:Y},Z({ourProps:ee,theirProps:l,slot:_,defaultTag:Mv,features:Iv,visible:g,name:"Listbox.Options"})))}let Nv="div";function Lv(e,t){let n=O.useId(),{id:r=`headlessui-listbox-option-${n}`,disabled:o=!1,value:i,...s}=e,a=O.useContext(cu)===!0,l=Er("Listbox.Option"),c=cs("Listbox.Option"),d=qe(c,g=>c.selectors.isActive(g,r)),h=l.isSelected(i),m=O.useRef(null),f=Cv(m),x=zn({disabled:o,value:i,domRef:m,get textValue(){return f()}}),b=ht(t,m,g=>{g?l.listRef.current.set(r,g):l.listRef.current.delete(r)}),R=qe(c,g=>c.selectors.shouldScrollIntoView(g,r));xe(()=>{if(R)return Je().requestAnimationFrame(()=>{var g,C;(C=(g=m.current)==null?void 0:g.scrollIntoView)==null||C.call(g,{block:"nearest"})})},[R,m]),xe(()=>{if(!a)return c.actions.registerOption(r,x),()=>c.actions.unregisterOption(r)},[x,r,a]);let $=ce(g=>{var C;if(o)return g.preventDefault();c.actions.onChange(i),l.mode===at.Single&&(Bt.flushSync(()=>c.actions.closeListbox()),(C=c.state.buttonElement)==null||C.focus({preventScroll:!0}))}),w=ce(()=>{if(o)return c.actions.goToOption({focus:ue.Nothing});c.actions.goToOption({focus:ue.Specific,id:r})}),T=Lm(),N=ce(g=>{T.update(g),!o&&(d||c.actions.goToOption({focus:ue.Specific,id:r},Mi.Pointer))}),D=ce(g=>{T.wasMoved(g)&&(o||d||c.actions.goToOption({focus:ue.Specific,id:r},Mi.Pointer))}),j=ce(g=>{T.wasMoved(g)&&(o||d&&c.actions.goToOption({focus:ue.Nothing}))}),W=O.useMemo(()=>({active:d,focus:d,selected:h,disabled:o,selectedOption:h&&a}),[d,h,o,a]),u=a?{}:{id:r,ref:b,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":h,disabled:void 0,onClick:$,onFocus:w,onPointerEnter:N,onMouseEnter:N,onPointerMove:D,onMouseMove:D,onPointerLeave:j,onMouseLeave:j},p=Ze();return!h&&a?null:p({ourProps:u,theirProps:s,slot:W,defaultTag:Nv,name:"Listbox.Option"})}let jv=O.Fragment;function Bv(e,t){let{options:n,placeholder:r,...o}=e,i={ref:ht(t)},s=Er("ListboxSelectedOption"),a=O.useMemo(()=>({}),[]),l=s.value===void 0||s.value===null||s.mode===at.Multi&&Array.isArray(s.value)&&s.value.length===0,c=Ze();return O.createElement(cu.Provider,{value:!0},c({ourProps:i,theirProps:{...o,children:O.createElement(O.Fragment,null,r&&l?r:n)},slot:a,defaultTag:jv,name:"ListboxSelectedOption"}))}let Hv=et(Fv),uu=et($v),Wv=Tc,fu=et(Dv),du=et(Lv),Uv=et(Bv),Vv=Object.assign(Hv,{Button:uu,Label:Wv,Options:fu,Option:du,SelectedOption:Uv});function hu(e={}){const{activeAddress:t,algodClient:n}=xt.useWallet(),{enabled:r=!0}=e;return Vi({queryKey:["account-info",t],queryFn:async()=>{if(!t||!n)return null;try{return await n.accountInformation(t).do()}catch(o){throw new Error(`Error fetching account information: ${o}`)}},enabled:r&&!!t&&!!n,refetchOnWindowFocus:!0})}function qv({className:e,scale:t=.85}){return L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:En("inline-block align-baseline",e),style:{width:`${t}em`,height:`${t}em`},"aria-label":"Algorand",fill:"currentColor",children:L.jsx("path",{d:"M23.98 23.99h-3.75l-2.44-9.07-5.25 9.07H8.34l8.1-14.04-1.3-4.88L4.22 24H.02L13.88 0h3.67l1.61 5.96h3.79l-2.59 4.5 3.62 13.53z"})})}function zv({children:e}){var v;const{activeAddress:t,activeWallet:n}=xt.useWallet(),{theme:r}=uo(),[o,i]=O.useState(!1),[s,a]=O.useState(!1),[l,c]=O.useState(()=>{const E=localStorage.getItem("uwui:balance-preference");return E?E==="available":!1}),d=r==="system"?void 0:r,h=qi({enabled:!!t}),m=((v=h.data)==null?void 0:v.name)??null,{data:f}=hu({enabled:!!t}),x=O.useMemo(()=>!f||f.amount===void 0?null:Number(f.amount)/1e6,[f]),b=O.useMemo(()=>{if(!f||f.amount===void 0||f.minBalance===void 0)return null;const E=Number(f.amount)-Number(f.minBalance);return Math.max(0,E/1e6)},[f]),R=l?b:x,{refs:$,floatingStyles:w,context:T}=Hl({open:o,onOpenChange:i,placement:"bottom-end",middleware:[Sd(8),Od(),Cd()],whileElementsMounted:gd}),N=jl(T),D=Bl(T,{outsidePressEvent:"mousedown"}),{getReferenceProps:j,getFloatingProps:W}=Wl([N,D]),u=Wn(),p=()=>{t&&(navigator.clipboard.writeText(t),a(!0),setTimeout(()=>a(!1),2e3))},g=async()=>{if(n)try{await n.disconnect(),i(!1)}catch(E){console.error("Error disconnecting wallet:",E)}},C=E=>{n&&n.setActiveAccount&&n.setActiveAccount(E)},S=()=>{const E=!l;c(E),localStorage.setItem("uwui:balance-preference",E?"available":"total")},A=e||L.jsx(fo,{}),k=O.cloneElement(A,j({ref:$.setReference}));return L.jsxs(L.Fragment,{children:[k,o&&L.jsx(Dl,{children:L.jsx(Ll,{context:T,modal:!1,children:L.jsx("div",{"data-wallet-ui":!0,"data-wallet-ui-scope":!0,"data-theme":d,children:L.jsx("div",{ref:$.setFloating,style:w,...W(),"aria-labelledby":u,className:"z-50 w-80 rounded-xl bg-[var(--wui-color-bg)] shadow-xl border border-[var(--wui-color-border)]",children:L.jsxs("div",{className:"p-4",children:[L.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[L.jsx("div",{className:"h-12 w-12 overflow-hidden",children:L.jsx(zi,{nfd:h.data,alt:`${m||t} avatar`,size:48})}),L.jsxs("div",{children:[L.jsx("h3",{id:u,className:"text-lg font-bold text-[var(--wui-color-text)] max-w-[220px] truncate wallet-custom-font",children:m||(t?Xn(t,6,4):"My Wallet")}),m&&t&&L.jsx("p",{className:"text-sm text-[var(--wui-color-text-secondary)]",children:Xn(t,6,4)})]})]}),L.jsx("div",{className:"mb-4 bg-[var(--wui-color-bg-secondary)] rounded-lg p-3",children:L.jsxs("div",{className:"flex justify-between items-center",children:[R!==null&&L.jsxs("span",{className:"text-base font-medium text-[var(--wui-color-text)] flex items-center gap-1",children:[Wh(R,{fractionDigits:4}),L.jsx(qv,{})]}),L.jsxs("button",{onClick:S,className:"flex items-center gap-1 text-sm text-[var(--wui-color-text-secondary)] bg-[var(--wui-color-bg-tertiary)] py-1 pl-2.5 pr-2 rounded-md hover:brightness-90 transition-all focus:outline-none",title:l?"Show total balance":"Show available balance",children:[l?"Available":"Total",L.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"ml-0.5 opacity-80",children:[L.jsx("path",{d:"m17 10-5-5-5 5"}),L.jsx("path",{d:"m17 14-5 5-5-5"})]})]})]})}),n&&n.accounts&&n.accounts.length>1&&L.jsx("div",{className:"mb-4",children:L.jsxs(Vv,{value:t||"",onChange:C,children:[L.jsx(Tc,{className:"block text-sm font-medium text-[var(--wui-color-text-secondary)] mb-1",children:"Select Account"}),L.jsxs("div",{className:"relative mt-1",children:[L.jsxs(uu,{className:"grid w-full cursor-default grid-cols-1 rounded-lg border border-[var(--wui-color-border)] bg-[var(--wui-color-bg-secondary)] py-2 px-3 text-left text-[var(--wui-color-text)] shadow-sm focus:outline-none focus:ring-2 focus:ring-[var(--wui-color-primary)] focus:border-transparent text-sm",children:[L.jsx("span",{className:"col-start-1 row-start-1 truncate pr-8",children:t?Xn(t,6,4):"Select account"}),L.jsx("span",{className:"col-start-1 row-start-1 self-center justify-self-end",children:L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"text-[var(--wui-color-text-secondary)]","aria-hidden":"true",children:L.jsx("path",{d:"M4 6L8 10L12 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),L.jsx(fu,{transition:!0,className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-[var(--wui-color-bg-secondary)] py-1 shadow-lg ring-1 ring-black/5 focus:outline-none text-sm data-[closed]:data-[leave]:opacity-0 data-[leave]:transition data-[leave]:duration-100 data-[leave]:ease-in",children:n.accounts.map(E=>L.jsxs(du,{value:E.address,className:"group relative cursor-default select-none py-2 pl-3 pr-9 text-[var(--wui-color-text)] data-[focus]:bg-[var(--wui-color-bg-hover)] data-[focus]:outline-none",children:[L.jsx("span",{className:"block truncate font-normal group-data-[selected]:font-medium",children:Xn(E.address,6,4)}),L.jsx("span",{className:"absolute inset-y-0 right-0 flex items-center pr-3 text-[var(--wui-color-primary)] group-[&:not([data-selected])]:hidden",children:L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"h-5 w-5","aria-hidden":"true",children:L.jsx("path",{d:"M13.3334 4L6.00008 11.3333L2.66675 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]},E.address))})]})]})}),L.jsx("div",{className:"border-t border-[var(--wui-color-border)] mt-2 mb-2"}),n&&L.jsxs("div",{className:"mb-2 flex items-center gap-2 px-1 py-0.5",children:[L.jsx("div",{className:"h-5 w-5 overflow-hidden rounded flex items-center justify-center",children:n.metadata.icon?L.jsx("img",{src:n.metadata.icon,alt:`${n.metadata.name} icon`,className:"max-w-full max-h-full"}):L.jsx("div",{className:"h-5 w-5 rounded-full bg-[var(--wui-color-bg-tertiary)] flex items-center justify-center",children:L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-3 w-3 text-[var(--wui-color-text-tertiary)]",viewBox:"0 0 20 20",fill:"currentColor",children:L.jsx("path",{fillRule:"evenodd",d:"M17 9c0-.55-.45-1-1-1h-4c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1h4c.55 0 1-.45 1-1V9zm-1 0v8h-4V9h4zM8 4c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v13c0 .55.45 1 1 1h4c.55 0 1-.45 1-1V4zM3 3h4v14H3V3z",clipRule:"evenodd"})})})}),L.jsx("p",{className:"text-sm text-[var(--wui-color-text-secondary)]",children:n.metadata.name})]}),L.jsx("div",{className:"border-t border-[var(--wui-color-border)] mb-3 mt-2"}),L.jsxs("div",{className:"flex gap-2",children:[L.jsx("button",{onClick:p,className:"flex-1 py-2 px-4 bg-[var(--wui-color-bg-tertiary)] text-[var(--wui-color-text-secondary)] font-medium rounded-xl hover:brightness-90 transition-all text-sm flex items-center justify-center",title:"Copy address",children:s?L.jsxs(L.Fragment,{children:[L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-green-500 mr-1.5",viewBox:"0 0 20 20",fill:"currentColor",children:L.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),"Copied"]}):L.jsxs(L.Fragment,{children:[L.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-1.5",viewBox:"0 0 20 20",fill:"currentColor",children:[L.jsx("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),L.jsx("path",{d:"M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"})]}),"Copy"]})}),L.jsx("button",{onClick:g,className:"flex-1 py-2 px-4 bg-red-100 dark:bg-red-900/40 text-red-700 dark:text-red-300 font-medium rounded-xl hover:bg-red-200 dark:hover:bg-red-800/60 transition-colors text-sm",children:"Disconnect"})]})]})})})})})]})}function pu(e){const{queryClient:t}=uo();return L.jsx(Jl,{client:t,children:L.jsx(zv,{...e})})}function Gv(){const{activeAddress:e}=xt.useWallet();return e?L.jsx(pu,{children:L.jsx(fo,{})}):L.jsx(nc,{})}gu();exports.ConnectWalletButton=Di;exports.ConnectWalletMenu=nc;exports.ConnectedWalletButton=fo;exports.ConnectedWalletMenu=pu;exports.NfdAvatar=zi;exports.WalletButton=Gv;exports.WalletList=tc;exports.WalletUIProvider=jh;exports.useAccountInfo=hu;exports.useNfd=qi;exports.useResolvedTheme=Zl;exports.useWalletUI=uo;
|
|
97
|
+
*/var sa;function fm(){return sa||(sa=1,process.env.NODE_ENV!=="production"&&(function(){function e(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=A,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,s=t.useEffect,i=t.useMemo,a=t.useDebugValue;No.useSyncExternalStoreWithSelector=function(l,c,d,h,p){var f=o(null);if(f.current===null){var w={hasValue:!1,value:null};f.current=w}else w=f.current;f=i(function(){function R(D){if(!k){if(k=!0,x=D,D=h(D),p!==void 0&&w.hasValue){var j=w.value;if(p(j,D))return F=j}return F=D}if(j=F,n(x,D))return j;var W=h(D);return p!==void 0&&p(j,W)?(x=D,j):(x=D,F=W)}var k=!1,x,F,$=d===void 0?null:d;return[function(){return R(c())},$===null?void 0:function(){return R($())}]},[c,d,h,p]);var y=r(l,f[0],f[1]);return s(function(){w.hasValue=!0,w.value=y},[y]),a(y),y},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),No}var ia;function dm(){return ia||(ia=1,process.env.NODE_ENV==="production"?$r.exports=um():$r.exports=fm()),$r.exports}var hm=dm();function Ne(e,t,n=Mc){return hm.useSyncExternalStoreWithSelector(ue(r=>e.subscribe(pm,r)),ue(()=>e.state),ue(()=>e.state),ue(t),n)}function pm(e){return e}function Dc(e,t){let n=A.useId(),r=Vs.get(t),[o,s]=Ne(r,A.useCallback(i=>[r.selectors.isTop(i,n),r.selectors.inStack(i,n)],[r,n]));return Pe(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),e?s?o:!0:!1}let gs=new Map,sr=new Map;function aa(e){var t;let n=(t=sr.get(e))!=null?t:0;return sr.set(e,n+1),n!==0?()=>la(e):(gs.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>la(e))}function la(e){var t;let n=(t=sr.get(e))!=null?t:1;if(n===1?sr.delete(e):sr.set(e,n-1),n!==1)return;let r=gs.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,gs.delete(e))}function mm(e,{allowed:t,disallowed:n}={}){let r=Dc(e,"inert-others");Pe(()=>{var o,s;if(!r)return;let i=ze();for(let l of(o=n==null?void 0:n())!=null?o:[])l&&i.add(aa(l));let a=(s=t==null?void 0:t())!=null?s:[];for(let l of a){if(!l)continue;let c=lo(l);if(!c)continue;let d=l.parentElement;for(;d&&d!==c.body;){for(let h of d.children)a.some(p=>h.contains(p))||i.add(aa(h));d=d.parentElement}}return i.dispose},[r,t,n])}function gm(e,t,n){let r=Yn(o=>{let s=o.getBoundingClientRect();s.x===0&&s.y===0&&s.width===0&&s.height===0&&n()});A.useEffect(()=>{if(!e)return;let o=t===null?null:At(t)?t:t.current;if(!o)return;let s=ze();if(typeof ResizeObserver<"u"){let i=new ResizeObserver(()=>r.current(o));i.observe(o),s.add(()=>i.disconnect())}if(typeof IntersectionObserver<"u"){let i=new IntersectionObserver(()=>r.current(o));i.observe(o),s.add(()=>i.disconnect())}return()=>s.dispose()},[t,r,e])}let vs=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","details>summary","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),vm=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var bs=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(bs||{}),bm=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(bm||{}),ym=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(ym||{});function Lc(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(vs)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function wm(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(vm)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var zs=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(zs||{});function jc(e,t=0){var n;return e===((n=lo(e))==null?void 0:n.body)?!1:pt(t,{0(){return e.matches(vs)},1(){let r=e;for(;r!==null;){if(r.matches(vs))return!0;r=r.parentElement}return!1}})}var xm=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(xm||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let Em=["textarea","input"].join(",");function Rm(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Em))!=null?n:!1}function Bc(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),s=t(r);if(o===null||s===null)return 0;let i=o.compareDocumentPosition(s);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Sm(e,t,n=e===null?document.body:Zr(e)){return Cm(Lc(n),t,{relativeTo:e})}function Cm(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let s=Array.isArray(e)?e.length>0?Zr(e[0]):document:Zr(e),i=Array.isArray(e)?n?Bc(e):e:t&64?wm(e):Lc(e);o.length>0&&i.length>1&&(i=i.filter(f=>!o.some(w=>w!=null&&"current"in w?(w==null?void 0:w.current)===f:w===f))),r=r??(s==null?void 0:s.activeElement);let a=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,i.indexOf(r))-1;if(t&4)return Math.max(0,i.indexOf(r))+1;if(t&8)return i.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=t&32?{preventScroll:!0}:{},d=0,h=i.length,p;do{if(d>=h||d+h<=0)return 0;let f=l+d;if(t&16)f=(f+h)%h;else{if(f<0)return 3;if(f>=h)return 1}p=i[f],p==null||p.focus(c),d+=a}while(p!==dc(p));return t&6&&Rm(p)&&p.select(),2}function Wc(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Om(){return/Android/gi.test(window.navigator.userAgent)}function ca(){return Wc()||Om()}function On(e,t,n,r){let o=Yn(n);A.useEffect(()=>{if(!e)return;function s(i){o.current(i)}return document.addEventListener(t,s,r),()=>document.removeEventListener(t,s,r)},[e,t,r])}function Am(e,t,n,r){let o=Yn(n);A.useEffect(()=>{if(!e)return;function s(i){o.current(i)}return window.addEventListener(t,s,r),()=>window.removeEventListener(t,s,r)},[e,t,r])}const ua=30;function Tm(e,t,n){let r=Yn(n),o=A.useCallback(function(a,l){if(a.defaultPrevented)return;let c=l(a);if(c===null||!c.getRootNode().contains(c)||!c.isConnected)return;let d=(function h(p){return typeof p=="function"?h(p()):Array.isArray(p)||p instanceof Set?p:[p]})(t);for(let h of d)if(h!==null&&(h.contains(c)||a.composed&&a.composedPath().includes(h)))return;return!jc(c,zs.Loose)&&c.tabIndex!==-1&&a.preventDefault(),r.current(a,c)},[r,t]),s=A.useRef(null);On(e,"pointerdown",a=>{var l,c;ca()||(s.current=((c=(l=a.composedPath)==null?void 0:l.call(a))==null?void 0:c[0])||a.target)},!0),On(e,"pointerup",a=>{if(ca()||!s.current)return;let l=s.current;return s.current=null,o(a,()=>l)},!0);let i=A.useRef({x:0,y:0});On(e,"touchstart",a=>{i.current.x=a.touches[0].clientX,i.current.y=a.touches[0].clientY},!0),On(e,"touchend",a=>{let l={x:a.changedTouches[0].clientX,y:a.changedTouches[0].clientY};if(!(Math.abs(l.x-i.current.x)>=ua||Math.abs(l.y-i.current.y)>=ua))return o(a,()=>Cn(a.target)?a.target:null)},!0),Am(e,"blur",a=>o(a,()=>Wp(window.document.activeElement)?window.document.activeElement:null),!0)}function ys(...e){return A.useMemo(()=>lo(...e),[...e])}var km=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(km||{});const Nr={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},Pm=200,fa=5;function Fm(e,{trigger:t,action:n,close:r,select:o}){let s=A.useRef(null),i=A.useRef(null),a=A.useRef(null);On(e&&t!==null,"pointerdown",l=>{xc(l==null?void 0:l.target)&&t!=null&&t.contains(l.target)&&(i.current=l.x,a.current=l.y,s.current=l.timeStamp)}),On(e&&t!==null,"pointerup",l=>{var c,d;let h=s.current;if(h===null||(s.current=null,!Cn(l.target))||Math.abs(l.x-((c=i.current)!=null?c:l.x))<fa&&Math.abs(l.y-((d=a.current)!=null?d:l.y))<fa)return;let p=n(l);switch(p.kind){case 0:return;case 1:{l.timeStamp-h>Pm&&(o(p.target),r());break}case 2:{r();break}}},{capture:!0})}function Im(e,t){return A.useMemo(()=>{var n;if(e.type)return e.type;let r=(n=e.as)!=null?n:"button";if(typeof r=="string"&&r.toLowerCase()==="button"||(t==null?void 0:t.tagName)==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function Mm(e){return A.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function $m(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...s){let i=t[o].call(n,...s);i&&(n=i,r.forEach(a=>a()))}}}function Nm(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=(n=t.defaultView)!=null?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),s=Math.max(0,e-o);n.style(r,"paddingRight",`${s}px`)}}}function Dm(){return Wc()?{before({doc:e,d:t,meta:n}){function r(o){for(let s of n().containers)for(let i of s())if(i.contains(o))return!0;return!1}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let a=ze();a.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>a.dispose()))}let s=(o=window.scrollY)!=null?o:window.pageYOffset,i=null;t.addEventListener(e,"click",a=>{if(Cn(a.target))try{let l=a.target.closest("a");if(!l)return;let{hash:c}=new URL(l.href),d=e.querySelector(c);Cn(d)&&!r(d)&&(i=d)}catch{}},!0),t.group(a=>{t.addEventListener(e,"touchstart",l=>{if(a.dispose(),Cn(l.target)&&Bp(l.target))if(r(l.target)){let c=l.target;for(;c.parentElement&&r(c.parentElement);)c=c.parentElement;a.style(c,"overscrollBehavior","contain")}else a.style(l.target,"touchAction","none")})}),t.addEventListener(e,"touchmove",a=>{if(Cn(a.target)){if(Ec(a.target))return;if(r(a.target)){let l=a.target;for(;l.parentElement&&l.dataset.headlessuiPortal!==""&&!(l.scrollHeight>l.clientHeight||l.scrollWidth>l.clientWidth);)l=l.parentElement;l.dataset.headlessuiPortal===""&&a.preventDefault()}else a.preventDefault()}},{passive:!1}),t.add(()=>{var a;let l=(a=window.scrollY)!=null?a:window.pageYOffset;s!==l&&window.scrollTo(0,s),i&&i.isConnected&&(i.scrollIntoView({block:"nearest"}),i=null)})})}}:{}}function Lm(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function da(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let nn=$m(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:ze(),meta:new Set,computedMeta:{}};return r.count++,r.meta.add(t),r.computedMeta=da(r.meta),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t),n.computedMeta=da(n.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta(){return e.computedMeta}},n=[Dm(),Nm(),Lm()];n.forEach(({before:r})=>r==null?void 0:r(t)),n.forEach(({after:r})=>r==null?void 0:r(t))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});nn.subscribe(()=>{let e=nn.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",o=n.count!==0;(o&&!r||!o&&r)&&nn.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&nn.dispatch("TEARDOWN",n)}});function jm(e,t,n=()=>({containers:[]})){let r=Mm(nn),o=t?r.get(t):void 0,s=o?o.count>0:!1;return Pe(()=>{if(!(!t||!e))return nn.dispatch("PUSH",t,n),()=>nn.dispatch("POP",t,n)},[e,t]),s}function Bm(e,t,n=()=>[document.body]){let r=Dc(e,"scroll-lock");jm(r,t,o=>{var s;return{containers:[...(s=o.containers)!=null?s:[],n]}})}function ha(e){return[e.screenX,e.screenY]}function Wm(){let e=A.useRef([-1,-1]);return{wasMoved(t){let n=ha(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=ha(t)}}}function Hm(e=0){let[t,n]=A.useState(e),r=A.useCallback(l=>n(l),[]),o=A.useCallback(l=>n(c=>c|l),[]),s=A.useCallback(l=>(t&l)===l,[t]),i=A.useCallback(l=>n(c=>c&~l),[]),a=A.useCallback(l=>n(c=>c^l),[]);return{flags:t,setFlag:r,addFlag:o,hasFlag:s,removeFlag:i,toggleFlag:a}}var pa,ma;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((pa=process==null?void 0:process.env)==null?void 0:pa.NODE_ENV)==="test"&&typeof((ma=Element==null?void 0:Element.prototype)==null?void 0:ma.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
|
|
98
|
+
`)),[]});var Um=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(Um||{});function Vm(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function zm(e,t,n,r){let[o,s]=A.useState(n),{hasFlag:i,addFlag:a,removeFlag:l}=Hm(e&&o?3:0),c=A.useRef(!1),d=A.useRef(!1),h=Kn();return Pe(()=>{var p;if(e){if(n&&s(!0),!t){n&&a(3);return}return(p=void 0)==null||p.call(r,n),qm(t,{inFlight:c,prepare(){d.current?d.current=!1:d.current=c.current,c.current=!0,!d.current&&(n?(a(3),l(4)):(a(4),l(2)))},run(){d.current?n?(l(3),a(4)):(l(4),a(3)):n?l(1):a(1)},done(){var f;d.current&&Qm(t)||(c.current=!1,l(7),n||s(!1),(f=void 0)==null||f.call(r,n))}})}},[e,n,t,h]),e?[o,{closed:i(1),enter:i(2),leave:i(4),transition:i(2)||i(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function qm(e,{prepare:t,run:n,done:r,inFlight:o}){let s=ze();return Gm(e,{prepare:t,inFlight:o}),s.nextFrame(()=>{n(),s.requestAnimationFrame(()=>{s.add(_m(e,r))})}),s.dispose}function _m(e,t){var n,r;let o=ze();if(!e)return o.dispose;let s=!1;o.add(()=>{s=!0});let i=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(a=>a instanceof CSSTransition))!=null?r:[];return i.length===0?(t(),o.dispose):(Promise.allSettled(i.map(a=>a.finished)).then(()=>{s||t()}),o.dispose)}function Gm(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition="none",n(),e.style.transition=r}function Qm(e){var t,n;return((n=(t=e.getAnimations)==null?void 0:t.call(e))!=null?n:[]).some(r=>r instanceof CSSTransition&&r.playState!=="finished")}function Km(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function ga(e,t,n){let{reference:r,floating:o}=e;const s=Oe(t),i=Os(t),a=Cs(i),l=Ve(t),c=s==="y",d=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let f;switch(l){case"top":f={x:d,y:r.y-o.height};break;case"bottom":f={x:d,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:h};break;case"left":f={x:r.x-o.width,y:h};break;default:f={x:r.x,y:r.y}}switch(xn(t)){case"start":f[i]-=p*(n&&c?-1:1);break;case"end":f[i]+=p*(n&&c?-1:1);break}return f}const Ym=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:h}=ga(c,r,l),p=r,f={},w=0;for(let y=0;y<a.length;y++){const{name:R,fn:k}=a[y],{x,y:F,data:$,reset:D}=await k({x:d,y:h,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:c,platform:i,elements:{reference:e,floating:t}});d=x??d,h=F??h,f={...f,[R]:{...f[R],...$}},D&&w<=50&&(w++,typeof D=="object"&&(D.placement&&(p=D.placement),D.rects&&(c=D.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):D.rects),{x:d,y:h}=ga(c,p,l)),y=-1)}return{x:d,y:h,placement:p,strategy:o,middlewareData:f}};async function fo(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:p=!1,padding:f=0}=mt(t,e),w=al(f),R=a[p?h==="floating"?"reference":"floating":h],k=qt(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(R)))==null||n?R:R.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),x=h==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,F=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),$=await(s.isElement==null?void 0:s.isElement(F))?await(s.getScale==null?void 0:s.getScale(F))||{x:1,y:1}:{x:1,y:1},D=qt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:F,strategy:l}):x);return{top:(k.top-D.top+w.top)/$.y,bottom:(D.bottom-k.bottom+w.bottom)/$.y,left:(k.left-D.left+w.left)/$.x,right:(D.right-k.right+w.right)/$.x}}const Xm=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:y=!0,...R}=mt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const k=Ve(o),x=Oe(a),F=Ve(a)===a,$=await(l.isRTL==null?void 0:l.isRTL(c.floating)),D=p||(F||!y?[lr(a)]:sl(a)),j=w!=="none";!p&&j&&D.push(...il(a,y,w,$));const W=[a,...D],u=await fo(t,R),g=[];let m=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&g.push(u[k]),h){const S=ol(o,i,$);g.push(u[S[0]],u[S[1]])}if(m=[...m,{placement:o,overflows:g}],!g.every(S=>S<=0)){var C,O;const S=(((C=s.flip)==null?void 0:C.index)||0)+1,b=W[S];if(b&&(!(h==="alignment"?x!==Oe(b):!1)||m.every(v=>v.overflows[0]>0&&Oe(v.placement)===x)))return{data:{index:S,overflows:m},reset:{placement:b}};let E=(O=m.filter(I=>I.overflows[0]<=0).sort((I,v)=>I.overflows[1]-v.overflows[1])[0])==null?void 0:O.placement;if(!E)switch(f){case"bestFit":{var T;const I=(T=m.filter(v=>{if(j){const M=Oe(v.placement);return M===x||M==="y"}return!0}).map(v=>[v.placement,v.overflows.filter(M=>M>0).reduce((M,B)=>M+B,0)]).sort((v,M)=>v[1]-M[1])[0])==null?void 0:T[0];I&&(E=I);break}case"initialPlacement":E=a;break}if(o!==E)return{reset:{placement:E}}}return{}}}},Jm=new Set(["left","top"]);async function Zm(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Ve(n),a=xn(n),l=Oe(n)==="y",c=Jm.has(i)?-1:1,d=s&&l?-1:1,h=mt(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:w}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof w=="number"&&(f=a==="end"?w*-1:w),l?{x:f*d,y:p*c}:{x:p*c,y:f*d}}const eg=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await Zm(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},tg=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:R=>{let{x:k,y:x}=R;return{x:k,y:x}}},...l}=mt(e,t),c={x:n,y:r},d=await fo(t,l),h=Oe(Ve(o)),p=Ss(h);let f=c[p],w=c[h];if(s){const R=p==="y"?"top":"left",k=p==="y"?"bottom":"right",x=f+d[R],F=f-d[k];f=Vr(x,f,F)}if(i){const R=h==="y"?"top":"left",k=h==="y"?"bottom":"right",x=w+d[R],F=w-d[k];w=Vr(x,w,F)}const y=a.fn({...t,[p]:f,[h]:w});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[p]:s,[h]:i}}}}}},ng=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:l=()=>{},...c}=mt(e,t),d=await fo(t,c),h=Ve(o),p=xn(o),f=Oe(o)==="y",{width:w,height:y}=s.floating;let R,k;h==="top"||h==="bottom"?(R=h,k=p===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(k=h,R=p==="end"?"top":"bottom");const x=y-d.top-d.bottom,F=w-d.left-d.right,$=ht(y-d[R],x),D=ht(w-d[k],F),j=!t.middlewareData.shift;let W=$,u=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(u=F),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(W=x),j&&!p){const m=pe(d.left,0),C=pe(d.right,0),O=pe(d.top,0),T=pe(d.bottom,0);f?u=w-2*(m!==0||C!==0?m+C:pe(d.left,d.right)):W=y-2*(O!==0||T!==0?O+T:pe(d.top,d.bottom))}await l({...t,availableWidth:u,availableHeight:W});const g=await i.getDimensions(a.floating);return w!==g.width||y!==g.height?{reset:{rects:!0}}:{}}}};function Hc(e){const t=me(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ce(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Ct(n)!==s||Ct(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function qs(e){return oe(e)?e:e.contextElement}function Pn(e){const t=qs(e);if(!ce(t))return ve(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Hc(t);let i=(s?Ct(n.width):n.width)/r,a=(s?Ct(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const rg=ve(0);function Uc(e){const t=ge(e);return!Qn()||!t.visualViewport?rg:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function og(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ge(e)?!1:t}function yn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=qs(e);let i=ve(1);t&&(r?oe(r)&&(i=Pn(r)):i=Pn(e));const a=og(s,n,r)?Uc(s):ve(0);let l=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,d=o.width/i.x,h=o.height/i.y;if(s){const p=ge(s),f=r&&oe(r)?ge(r):r;let w=p,y=ar(w);for(;y&&r&&f!==w;){const R=Pn(y),k=y.getBoundingClientRect(),x=me(y),F=k.left+(y.clientLeft+parseFloat(x.paddingLeft))*R.x,$=k.top+(y.clientTop+parseFloat(x.paddingTop))*R.y;l*=R.x,c*=R.y,d*=R.x,h*=R.y,l+=F,c+=$,w=ge(y),y=ar(w)}}return qt({width:d,height:h,x:l,y:c})}function _s(e,t){const n=Qt(e).scrollLeft;return t?t.left+n:yn(we(e)).left+n}function Vc(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:_s(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function sg(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=we(r),a=t?wn(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=ve(1);const d=ve(0),h=ce(r);if((h||!h&&!s)&&((ot(r)!=="body"||Gt(i))&&(l=Qt(r)),ce(r))){const f=yn(r);c=Pn(r),d.x=f.x+r.clientLeft,d.y=f.y+r.clientTop}const p=i&&!h&&!s?Vc(i,l,!0):ve(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+p.x,y:n.y*c.y-l.scrollTop*c.y+d.y+p.y}}function ig(e){return Array.from(e.getClientRects())}function ag(e){const t=we(e),n=Qt(e),r=e.ownerDocument.body,o=pe(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=pe(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+_s(e);const a=-n.scrollTop;return me(r).direction==="rtl"&&(i+=pe(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function lg(e,t){const n=ge(e),r=we(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const c=Qn();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:i,x:a,y:l}}const cg=new Set(["absolute","fixed"]);function ug(e,t){const n=yn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=ce(e)?Pn(e):ve(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,c=r*s.y;return{width:i,height:a,x:l,y:c}}function va(e,t,n){let r;if(t==="viewport")r=lg(e,n);else if(t==="document")r=ag(we(e));else if(oe(t))r=ug(t,n);else{const o=Uc(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return qt(r)}function zc(e,t){const n=De(e);return n===t||!oe(n)||Ue(n)?!1:me(n).position==="fixed"||zc(n,t)}function fg(e,t){const n=t.get(e);if(n)return n;let r=rt(e,[],!1).filter(a=>oe(a)&&ot(a)!=="body"),o=null;const s=me(e).position==="fixed";let i=s?De(e):e;for(;oe(i)&&!Ue(i);){const a=me(i),l=yr(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&cg.has(o.position)||Gt(i)&&!l&&zc(e,i))?r=r.filter(d=>d!==i):o=a,i=De(i)}return t.set(e,r),r}function dg(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?wn(t)?[]:fg(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((c,d)=>{const h=va(t,d,o);return c.top=pe(h.top,c.top),c.right=ht(h.right,c.right),c.bottom=ht(h.bottom,c.bottom),c.left=pe(h.left,c.left),c},va(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function hg(e){const{width:t,height:n}=Hc(e);return{width:t,height:n}}function pg(e,t,n){const r=ce(t),o=we(t),s=n==="fixed",i=yn(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=ve(0);function c(){l.x=_s(o)}if(r||!r&&!s)if((ot(t)!=="body"||Gt(o))&&(a=Qt(t)),r){const f=yn(t,!0,s,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else o&&c();s&&!r&&o&&c();const d=o&&!r&&!s?Vc(o,a):ve(0),h=i.left+a.scrollLeft-l.x-d.x,p=i.top+a.scrollTop-l.y-d.y;return{x:h,y:p,width:i.width,height:i.height}}function Do(e){return me(e).position==="static"}function ba(e,t){if(!ce(e)||me(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return we(e)===n&&(n=n.ownerDocument.body),n}function qc(e,t){const n=ge(e);if(wn(e))return n;if(!ce(e)){let o=De(e);for(;o&&!Ue(o);){if(oe(o)&&!Do(o))return o;o=De(o)}return n}let r=ba(e,t);for(;r&&tl(r)&&Do(r);)r=ba(r,t);return r&&Ue(r)&&Do(r)&&!yr(r)?n:r||nl(e)||n}const mg=async function(e){const t=this.getOffsetParent||qc,n=this.getDimensions,r=await n(e.floating);return{reference:pg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function gg(e){return me(e).direction==="rtl"}const vg={convertOffsetParentRelativeRectToViewportRelativeRect:sg,getDocumentElement:we,getClippingRect:dg,getOffsetParent:qc,getElementRects:mg,getClientRects:ig,getDimensions:hg,getScale:Pn,isElement:oe,isRTL:gg};function _c(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bg(e,t){let n=null,r;const o=we(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const c=e.getBoundingClientRect(),{left:d,top:h,width:p,height:f}=c;if(a||t(),!p||!f)return;const w=Ht(h),y=Ht(o.clientWidth-(d+p)),R=Ht(o.clientHeight-(h+f)),k=Ht(d),F={rootMargin:-w+"px "+-y+"px "+-R+"px "+-k+"px",threshold:pe(0,ht(1,l))||1};let $=!0;function D(j){const W=j[0].intersectionRatio;if(W!==l){if(!$)return i();W?i(!1,W):r=setTimeout(()=>{i(!1,1e-7)},1e3)}W===1&&!_c(c,e.getBoundingClientRect())&&i(),$=!1}try{n=new IntersectionObserver(D,{...F,root:o.ownerDocument})}catch{n=new IntersectionObserver(D,F)}n.observe(e)}return i(!0),s}function yg(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=qs(e),d=o||s?[...c?rt(c):[],...rt(t)]:[];d.forEach(k=>{o&&k.addEventListener("scroll",n,{passive:!0}),s&&k.addEventListener("resize",n)});const h=c&&a?bg(c,n):null;let p=-1,f=null;i&&(f=new ResizeObserver(k=>{let[x]=k;x&&x.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var F;(F=f)==null||F.observe(t)})),n()}),c&&!l&&f.observe(c),f.observe(t));let w,y=l?yn(e):null;l&&R();function R(){const k=yn(e);y&&!_c(y,k)&&n(),y=k,w=requestAnimationFrame(R)}return n(),()=>{var k;d.forEach(x=>{o&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),h==null||h(),(k=f)==null||k.disconnect(),f=null,l&&cancelAnimationFrame(w)}}const Lo=fo,wg=eg,xg=tg,Eg=Xm,Rg=ng,Sg=(e,t,n)=>{const r=new Map,o={platform:vg,...n},s={...o.platform,_c:r};return Ym(e,t,{...o,platform:s})};var Cg=typeof document<"u",Og=function(){},Br=Cg?A.useLayoutEffect:Og;function eo(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(!eo(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 s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!eo(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Gc(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ya(e,t){const n=Gc(e);return Math.round(t*n)/n}function jo(e){const t=N.useRef(e);return Br(()=>{t.current=e}),t}function Ag(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[d,h]=N.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,f]=N.useState(r);eo(p,r)||f(r);const[w,y]=N.useState(null),[R,k]=N.useState(null),x=N.useCallback(v=>{v!==j.current&&(j.current=v,y(v))},[]),F=N.useCallback(v=>{v!==W.current&&(W.current=v,k(v))},[]),$=s||w,D=i||R,j=N.useRef(null),W=N.useRef(null),u=N.useRef(d),g=l!=null,m=jo(l),C=jo(o),O=jo(c),T=N.useCallback(()=>{if(!j.current||!W.current)return;const v={placement:t,strategy:n,middleware:p};C.current&&(v.platform=C.current),Sg(j.current,W.current,v).then(M=>{const B={...M,isPositioned:O.current!==!1};S.current&&!eo(u.current,B)&&(u.current=B,Vn.flushSync(()=>{h(B)}))})},[p,t,n,C,O]);Br(()=>{c===!1&&u.current.isPositioned&&(u.current.isPositioned=!1,h(v=>({...v,isPositioned:!1})))},[c]);const S=N.useRef(!1);Br(()=>(S.current=!0,()=>{S.current=!1}),[]),Br(()=>{if($&&(j.current=$),D&&(W.current=D),$&&D){if(m.current)return m.current($,D,T);T()}},[$,D,T,m,g]);const b=N.useMemo(()=>({reference:j,floating:W,setReference:x,setFloating:F}),[x,F]),E=N.useMemo(()=>({reference:$,floating:D}),[$,D]),I=N.useMemo(()=>{const v={position:n,left:0,top:0};if(!E.floating)return v;const M=ya(E.floating,d.x),B=ya(E.floating,d.y);return a?{...v,transform:"translate("+M+"px, "+B+"px)",...Gc(E.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:B}},[n,a,E.floating,d.x,d.y]);return N.useMemo(()=>({...d,update:T,refs:b,elements:E,floatingStyles:I}),[d,T,b,E,I])}const Qc=(e,t)=>({...wg(e),options:[e,t]}),Tg=(e,t)=>({...xg(e),options:[e,t]}),kg=(e,t)=>({...Eg(e),options:[e,t]}),Pg=(e,t)=>({...Rg(e),options:[e,t]}),Kc={...N},Fg=Kc.useInsertionEffect,Ig=Fg||(e=>e());function Yc(e){const t=N.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Ig(()=>{t.current=e}),N.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)},[])}var ws=typeof document<"u"?A.useLayoutEffect:A.useEffect;let wa=!1,Mg=0;const xa=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Mg++;function $g(){const[e,t]=N.useState(()=>wa?xa():void 0);return ws(()=>{e==null&&t(xa())},[]),N.useEffect(()=>{wa=!0},[]),e}const Ng=Kc.useId,Dg=Ng||$g;let dr;process.env.NODE_ENV!=="production"&&(dr=new Set);function Lg(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=dr)!=null&&e.has(o))){var s;(s=dr)==null||s.add(o),console.warn(o)}}function jg(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=dr)!=null&&e.has(o))){var s;(s=dr)==null||s.add(o),console.error(o)}}function Bg(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const Wg=N.createContext(null),Hg=N.createContext(null),Ug=()=>{var e;return((e=N.useContext(Wg))==null?void 0:e.id)||null},Vg=()=>N.useContext(Hg),zg="data-floating-ui-focusable";function qg(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Dg(),s=N.useRef({}),[i]=N.useState(()=>Bg()),a=Ug()!=null;if(process.env.NODE_ENV!=="production"){const f=r.reference;f&&!oe(f)&&jg("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=N.useState(r.reference),d=Yc((f,w,y)=>{s.current.openEvent=f?w:void 0,i.emit("openchange",{open:f,event:w,reason:y,nested:a}),n==null||n(f,w,y)}),h=N.useMemo(()=>({setPositionReference:c}),[]),p=N.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return N.useMemo(()=>({dataRef:s,open:t,onOpenChange:d,elements:p,events:i,floatingId:o,refs:h}),[t,d,p,i,o,h])}function _g(e){e===void 0&&(e={});const{nodeId:t}=e,n=qg({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=N.useState(null),[a,l]=N.useState(null),d=(o==null?void 0:o.domReference)||s,h=N.useRef(null),p=Vg();ws(()=>{d&&(h.current=d)},[d]);const f=Ag({...e,elements:{...o,...a&&{reference:a}}}),w=N.useCallback(F=>{const $=oe(F)?{getBoundingClientRect:()=>F.getBoundingClientRect(),contextElement:F}:F;l($),f.refs.setReference($)},[f.refs]),y=N.useCallback(F=>{(oe(F)||F===null)&&(h.current=F,i(F)),(oe(f.refs.reference.current)||f.refs.reference.current===null||F!==null&&!oe(F))&&f.refs.setReference(F)},[f.refs]),R=N.useMemo(()=>({...f.refs,setReference:y,setPositionReference:w,domReference:h}),[f.refs,y,w]),k=N.useMemo(()=>({...f.elements,domReference:d}),[f.elements,d]),x=N.useMemo(()=>({...f,...r,refs:R,elements:k,nodeId:t}),[f,R,k,t,r]);return ws(()=>{r.dataRef.current.floatingContext=x;const F=p==null?void 0:p.nodesRef.current.find($=>$.id===t);F&&(F.context=x)}),N.useMemo(()=>({...f,context:x,refs:R,elements:k}),[f,R,k,x])}const Ea="active",Ra="selected";function Bo(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[Ea]:i,[Ra]:a,...l}=e;s=l}return{...n==="floating"&&{tabIndex:-1,[zg]:""},...s,...t.map(i=>{const a=i?i[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((i,a)=>(a&&Object.entries(a).forEach(l=>{let[c,d]=l;if(!(o&&[Ea,Ra].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof d=="function"){var h;(h=r.get(c))==null||h.push(d),i[c]=function(){for(var p,f=arguments.length,w=new Array(f),y=0;y<f;y++)w[y]=arguments[y];return(p=r.get(c))==null?void 0:p.map(R=>R(...w)).find(R=>R!==void 0)}}}else i[c]=d}),i),{})}}function Gg(e){e===void 0&&(e=[]);const t=e.map(a=>a==null?void 0:a.reference),n=e.map(a=>a==null?void 0:a.floating),r=e.map(a=>a==null?void 0:a.item),o=N.useCallback(a=>Bo(a,e,"reference"),t),s=N.useCallback(a=>Bo(a,e,"floating"),n),i=N.useCallback(a=>Bo(a,e,"item"),r);return N.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}function Sa(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const Qg=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:s=0,index:i=0,minItemsVisible:a=4,referenceOverflowThreshold:l=0,scrollRef:c,...d}=mt(e,t),{rects:h,elements:{floating:p}}=t,f=n.current[i],w=(c==null?void 0:c.current)||p,y=p.clientTop||w.clientTop,R=p.clientTop!==0,k=w.clientTop!==0,x=p===w;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||Lg('`placement` side must be "bottom" when using the `inner`',"middleware.")),!f)return{};const F={...t,...await Qc(-f.offsetTop-p.clientTop-h.reference.height/2-f.offsetHeight/2-s).fn(t)},$=await Lo(Sa(F,w.scrollHeight+y+p.clientTop),d),D=await Lo(F,{...d,elementContext:"reference"}),j=pe(0,$.top),W=F.y+j,m=(w.scrollHeight>w.clientHeight?C=>C:Ct)(pe(0,w.scrollHeight+(R&&x||k?y*2:0)-j-pe(0,$.bottom)));if(w.style.maxHeight=m+"px",w.scrollTop=j,o){const C=w.offsetHeight<f.offsetHeight*ht(a,n.current.length)-1||D.top>=-l||D.bottom>=-l;Vn.flushSync(()=>o(C))}return r&&(r.current=await Lo(Sa({...F,y:W},w.offsetHeight+y+p.clientTop),d)),{y:W}}});function Kg(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:s,scrollRef:i,onChange:a}=t,l=Yc(a),c=N.useRef(!1),d=N.useRef(null),h=N.useRef(null);N.useEffect(()=>{if(!o)return;function f(y){if(y.ctrlKey||!w||s.current==null)return;const R=y.deltaY,k=s.current.top>=-.5,x=s.current.bottom>=-.5,F=w.scrollHeight-w.clientHeight,$=R<0?-1:1,D=R<0?"max":"min";w.scrollHeight<=w.clientHeight||(!k&&R>0||!x&&R<0?(y.preventDefault(),Vn.flushSync(()=>{l(j=>j+Math[D](R,F*$))})):/firefox/i.test(Km())&&(w.scrollTop+=R))}const w=(i==null?void 0:i.current)||r.floating;if(n&&w)return w.addEventListener("wheel",f),requestAnimationFrame(()=>{d.current=w.scrollTop,s.current!=null&&(h.current={...s.current})}),()=>{d.current=null,h.current=null,w.removeEventListener("wheel",f)}},[o,n,r.floating,s,i,l]);const p=N.useMemo(()=>({onKeyDown(){c.current=!0},onWheel(){c.current=!1},onPointerMove(){c.current=!1},onScroll(){const f=(i==null?void 0:i.current)||r.floating;if(!(!s.current||!f||!c.current)){if(d.current!==null){const w=f.scrollTop-d.current;(s.current.bottom<-.5&&w<-1||s.current.top<-.5&&w>1)&&Vn.flushSync(()=>l(y=>y+w))}requestAnimationFrame(()=>{d.current=f.scrollTop})}}}),[r.floating,l,s,i]);return N.useMemo(()=>o?{floating:p}:{},[o,p])}let Xn=A.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});Xn.displayName="FloatingContext";let Gs=A.createContext(null);Gs.displayName="PlacementContext";function Yg(e){return A.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function Xg(){return A.useContext(Xn).setReference}function Jg(){return A.useContext(Xn).getReferenceProps}function Zg(){let{getFloatingProps:e,slot:t}=A.useContext(Xn);return A.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function ev(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=A.useContext(Gs),n=A.useMemo(()=>e,[JSON.stringify(e,(o,s)=>{var i;return(i=s==null?void 0:s.outerHTML)!=null?i:s})]);Pe(()=>{t==null||t(n??null)},[t,n]);let r=A.useContext(Xn);return A.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let Ca=4;function tv({children:e,enabled:t=!0}){let[n,r]=A.useState(null),[o,s]=A.useState(0),i=A.useRef(null),[a,l]=A.useState(null);nv(a);let c=t&&n!==null&&a!==null,{to:d="bottom",gap:h=0,offset:p=0,padding:f=0,inner:w}=rv(n,a),[y,R="center"]=d.split(" ");Pe(()=>{c&&s(0)},[c]);let{refs:k,floatingStyles:x,context:F}=_g({open:c,placement:y==="selection"?R==="center"?"bottom":`bottom-${R}`:R==="center"?`${y}`:`${y}-${R}`,strategy:"absolute",transform:!1,middleware:[Qc({mainAxis:y==="selection"?0:h,crossAxis:p}),Tg({padding:f}),y!=="selection"&&kg({padding:f}),y==="selection"&&w?Qg({...w,padding:f,overflowRef:i,offset:o,minItemsVisible:Ca,referenceOverflowThreshold:f,onFallbackChange(C){var O,T;if(!C)return;let S=F.elements.floating;if(!S)return;let b=parseFloat(getComputedStyle(S).scrollPaddingBottom)||0,E=Math.min(Ca,S.childElementCount),I=0,v=0;for(let M of(T=(O=F.elements.floating)==null?void 0:O.childNodes)!=null?T:[])if(At(M)){let B=M.offsetTop,V=B+M.clientHeight+b,G=S.scrollTop,U=G+S.clientHeight;if(B>=G&&V<=U)E--;else{v=Math.max(0,Math.min(V,U)-Math.max(B,G)),I=M.clientHeight;break}}E>=1&&s(M=>{let B=I*E-v+b;return M>=B?M:B})}}):null,Pg({padding:f,apply({availableWidth:C,availableHeight:O,elements:T}){Object.assign(T.floating.style,{overflow:"auto",maxWidth:`${C}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${O}px)`})}})].filter(Boolean),whileElementsMounted:yg}),[$=y,D=R]=F.placement.split("-");y==="selection"&&($="selection");let j=A.useMemo(()=>({anchor:[$,D].filter(Boolean).join(" ")}),[$,D]),W=Kg(F,{overflowRef:i,onChange:s}),{getReferenceProps:u,getFloatingProps:g}=Gg([W]),m=ue(C=>{l(C),k.setFloating(C)});return N.createElement(Gs.Provider,{value:r},N.createElement(Xn.Provider,{value:{setFloating:m,setReference:k.setReference,styles:x,getReferenceProps:u,getFloatingProps:g,slot:j}},e))}function nv(e){Pe(()=>{if(!e)return;let t=new MutationObserver(()=>{let n=window.getComputedStyle(e).maxHeight,r=parseFloat(n);if(isNaN(r))return;let o=parseInt(n);isNaN(o)||r!==o&&(e.style.maxHeight=`${Math.ceil(r)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function rv(e,t){var n,r,o;let s=Wo((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),i=Wo((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),a=Wo((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:s,offset:i,padding:a}}function Wo(e,t,n=void 0){let r=Kn(),o=ue((l,c)=>{if(l==null)return[n,null];if(typeof l=="number")return[l,null];if(typeof l=="string"){if(!c)return[n,null];let d=Oa(l,c);return[d,h=>{let p=Xc(l);{let f=p.map(w=>window.getComputedStyle(c).getPropertyValue(w));r.requestAnimationFrame(function w(){r.nextFrame(w);let y=!1;for(let[k,x]of p.entries()){let F=window.getComputedStyle(c).getPropertyValue(x);if(f[k]!==F){f[k]=F,y=!0;break}}if(!y)return;let R=Oa(l,c);d!==R&&(h(R),d=R)})}return r.dispose}]}return[n,null]}),s=A.useMemo(()=>o(e,t)[0],[e,t]),[i=s,a]=A.useState();return Pe(()=>{let[l,c]=o(e,t);if(a(l),!!c)return c(a)},[e,t]),i}function Xc(e){let t=/var\((.*)\)/.exec(e);if(t){let n=t[1].indexOf(",");if(n===-1)return[t[1]];let r=t[1].slice(0,n).trim(),o=t[1].slice(n+1).trim();return o?[r,...Xc(o)]:[r]}return[]}function Oa(e,t){let n=document.createElement("div");t.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",e,"important");let r=parseFloat(window.getComputedStyle(n).marginTop)||0;return t.removeChild(n),r}function ov({children:e,freeze:t},n){let r=Jc(t,e);return A.isValidElement(r)?A.cloneElement(r,{ref:n}):A.createElement(A.Fragment,null,r)}A.forwardRef(ov);function Jc(e,t){let[n,r]=A.useState(t);return!e&&n!==t&&r(t),e?n:t}let Qs=A.createContext(null);Qs.displayName="OpenClosedContext";var hr=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(hr||{});function sv(){return A.useContext(Qs)}function iv({value:e,children:t}){return A.createElement(Qs.Provider,{value:e},t)}function av(e){throw new Error("Unexpected object: "+e)}var he=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(he||{});function Dr(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=r??-1;switch(e.focus){case 0:{for(let s=0;s<n.length;++s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 1:{o===-1&&(o=n.length);for(let s=o-1;s>=0;--s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 2:{for(let s=o+1;s<n.length;++s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 3:{for(let s=n.length-1;s>=0;--s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 4:{for(let s=0;s<n.length;++s)if(t.resolveId(n[s],s,n)===e.id)return s;return r}case 5:return null;default:av(e)}}function Zc(e){let t=ue(e),n=A.useRef(!1);A.useEffect(()=>(n.current=!1,()=>{n.current=!0,hc(()=>{n.current&&t()})}),[t])}let lv=A.createContext(!1);function cv(){return A.useContext(lv)}function uv(e){let t=cv(),n=A.useContext(tu),[r,o]=A.useState(()=>{var s;if(!t&&n!==null)return(s=n.current)!=null?s:null;if(pn.isServer)return null;let i=e==null?void 0:e.getElementById("headlessui-portal-root");if(i)return i;if(e===null)return null;let a=e.createElement("div");return a.setAttribute("id","headlessui-portal-root"),e.body.appendChild(a)});return A.useEffect(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),A.useEffect(()=>{t||n!==null&&o(n.current)},[n,o,t]),r}let eu=A.Fragment,fv=it(function(e,t){let{ownerDocument:n=null,...r}=e,o=A.useRef(null),s=gt(zp(p=>{o.current=p}),t),i=ys(o.current),a=n??i,l=uv(a),c=A.useContext(mv),d=Kn(),h=st();return Zc(()=>{var p;l&&l.childNodes.length<=0&&((p=l.parentElement)==null||p.removeChild(l))}),l?mn.createPortal(A.createElement("div",{"data-headlessui-portal":"",ref:p=>{d.dispose(),c&&p&&d.add(c.register(p))}},h({ourProps:{ref:s},theirProps:r,slot:{},defaultTag:eu,name:"Portal"})),l):null});function dv(e,t){let n=gt(t),{enabled:r=!0,ownerDocument:o,...s}=e,i=st();return r?A.createElement(fv,{...s,ownerDocument:o,ref:n}):i({ourProps:{ref:n},theirProps:s,slot:{},defaultTag:eu,name:"Portal"})}let hv=A.Fragment,tu=A.createContext(null);function pv(e,t){let{target:n,...r}=e,o={ref:gt(t)},s=st();return A.createElement(tu.Provider,{value:n},s({ourProps:o,theirProps:r,defaultTag:hv,name:"Popover.Group"}))}let mv=A.createContext(null),gv=it(dv),vv=it(pv),bv=Object.assign(gv,{Group:vv});const Wr={Idle:{kind:"Idle"},Tracked:e=>({kind:"Tracked",position:e}),Moved:{kind:"Moved"}};function nu(e){let t=e.getBoundingClientRect();return`${t.x},${t.y}`}function yv(e,t,n){let r=ze();if(t.kind==="Tracked"){let o=function(){s!==nu(e)&&(r.dispose(),n())},{position:s}=t,i=new ResizeObserver(o);i.observe(e),r.add(()=>i.disconnect()),r.addEventListener(window,"scroll",o,{passive:!0}),r.addEventListener(window,"resize",o)}return()=>r.dispose()}let Aa=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Ta(e){var t,n;let r=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!At(o))return r;let s=!1;for(let a of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))a.remove(),s=!0;let i=s?(n=o.innerText)!=null?n:"":r;return Aa.test(i)&&(i=i.replace(Aa,"")),i}function wv(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let r=n.split(" ").map(o=>{let s=document.getElementById(o);if(s){let i=s.getAttribute("aria-label");return typeof i=="string"?i.trim():Ta(s).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return Ta(e).trim()}function xv(e){let t=A.useRef(""),n=A.useRef("");return ue(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(t.current===o)return n.current;let s=wv(r).trim().toLowerCase();return t.current=o,n.current=s,s})}var Ev=Object.defineProperty,Rv=(e,t,n)=>t in e?Ev(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ka=(e,t,n)=>(Rv(e,typeof t!="symbol"?t+"":t,n),n),Ce=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Ce||{}),Vt=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Vt||{}),Hr=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Hr||{}),ru=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.SelectOption=5]="SelectOption",e[e.RegisterOptions=6]="RegisterOptions",e[e.UnregisterOptions=7]="UnregisterOptions",e[e.SetButtonElement=8]="SetButtonElement",e[e.SetOptionsElement=9]="SetOptionsElement",e[e.SortOptions=10]="SortOptions",e[e.MarkButtonAsMoved=11]="MarkButtonAsMoved",e))(ru||{});function Pa(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=Bc(t(e.options.slice()),s=>s.dataRef.current.domRef.current),o=n?r.indexOf(n):null;return o===-1&&(o=null),{options:r,activeOptionIndex:o}}let Sv={1(e){if(e.dataRef.current.disabled||e.listboxState===1)return e;let t=e.buttonElement?Wr.Tracked(nu(e.buttonElement)):e.buttonPositionState;return{...e,activeOptionIndex:null,pendingFocus:{focus:he.Nothing},listboxState:1,__demoMode:!1,buttonPositionState:t}},0(e,t){if(e.dataRef.current.disabled||e.listboxState===0)return e;let n=e.activeOptionIndex,{isSelected:r}=e.dataRef.current,o=e.options.findIndex(s=>r(s.dataRef.current.value));return o!==-1&&(n=o),{...e,frozenValue:!1,pendingFocus:t.focus,listboxState:0,activeOptionIndex:n,__demoMode:!1,buttonPositionState:Wr.Idle}},2(e,t){var n,r,o,s,i;if(e.dataRef.current.disabled||e.listboxState===1)return e;let a={...e,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===he.Nothing)return{...a,activeOptionIndex:null};if(t.focus===he.Specific)return{...a,activeOptionIndex:e.options.findIndex(d=>d.id===t.id)};if(t.focus===he.Previous){let d=e.activeOptionIndex;if(d!==null){let h=e.options[d].dataRef.current.domRef,p=Dr(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:f=>f.id,resolveDisabled:f=>f.dataRef.current.disabled});if(p!==null){let f=e.options[p].dataRef.current.domRef;if(((r=h.current)==null?void 0:r.previousElementSibling)===f.current||((o=f.current)==null?void 0:o.previousElementSibling)===null)return{...a,activeOptionIndex:p}}}}else if(t.focus===he.Next){let d=e.activeOptionIndex;if(d!==null){let h=e.options[d].dataRef.current.domRef,p=Dr(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:f=>f.id,resolveDisabled:f=>f.dataRef.current.disabled});if(p!==null){let f=e.options[p].dataRef.current.domRef;if(((s=h.current)==null?void 0:s.nextElementSibling)===f.current||((i=f.current)==null?void 0:i.nextElementSibling)===null)return{...a,activeOptionIndex:p}}}}let l=Pa(e),c=Dr(t,{resolveItems:()=>l.options,resolveActiveIndex:()=>l.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled});return{...a,...l,activeOptionIndex:c}},3:(e,t)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let n=e.searchQuery!==""?0:1,r=e.searchQuery+t.value.toLowerCase(),o=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find(i=>{var a;return!i.dataRef.current.disabled&&((a=i.dataRef.current.textValue)==null?void 0:a.startsWith(r))}),s=o?e.options.indexOf(o):-1;return s===-1||s===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:s,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5(e){return e.dataRef.current.mode===0?{...e,frozenValue:!0}:{...e}},6:(e,t)=>{let n=e.options.concat(t.options),r=e.activeOptionIndex;if(e.pendingFocus.focus!==he.Nothing&&(r=Dr(e.pendingFocus,{resolveItems:()=>n,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled})),e.activeOptionIndex===null){let{isSelected:o}=e.dataRef.current;if(o){let s=n.findIndex(i=>o==null?void 0:o(i.dataRef.current.value));s!==-1&&(r=s)}}return{...e,options:n,activeOptionIndex:r,pendingFocus:{focus:he.Nothing},pendingShouldSort:!0}},7:(e,t)=>{let n=e.options,r=[],o=new Set(t.options);for(let[s,i]of n.entries())if(o.has(i.id)&&(r.push(s),o.delete(i.id),o.size===0))break;if(r.length>0){n=n.slice();for(let s of r.reverse())n.splice(s,1)}return{...e,options:n,activationTrigger:1}},8:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},9:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element},10:e=>e.pendingShouldSort?{...e,...Pa(e),pendingShouldSort:!1}:e,11(e){return e.buttonPositionState.kind!=="Tracked"?e:{...e,buttonPositionState:Wr.Moved}}};class Ks extends Ic{constructor(t){super(t),ka(this,"actions",{onChange:n=>{let{onChange:r,compare:o,mode:s,value:i}=this.state.dataRef.current;return pt(s,{0:()=>r==null?void 0:r(n),1:()=>{let a=i.slice(),l=a.findIndex(c=>o(c,n));return l===-1?a.push(n):a.splice(l,1),r==null?void 0:r(a)}})},registerOption:Mo(()=>{let n=[],r=new Set;return[(o,s)=>{r.has(s)||(r.add(s),n.push({id:o,dataRef:s}))},()=>(r.clear(),this.send({type:6,options:n.splice(0)}))]}),unregisterOption:Mo(()=>{let n=[];return[r=>n.push(r),()=>{this.send({type:7,options:n.splice(0)})}]}),goToOption:Mo(()=>{let n=null;return[(r,o)=>{n={type:2,...r,trigger:o}},()=>n&&this.send(n)]}),closeListbox:()=>{this.send({type:1})},openListbox:n=>{this.send({type:0,focus:n})},selectActiveOption:()=>{var n;if(this.state.activeOptionIndex!==null){let{dataRef:r}=this.state.options[this.state.activeOptionIndex];this.actions.selectOption(r.current.value)}else this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(n=this.state.buttonElement)==null||n.focus({preventScroll:!0}))},selectOption:n=>{this.send({type:5,value:n})},search:n=>{this.send({type:3,value:n})},clearSearch:()=>{this.send({type:4})},setButtonElement:n=>{this.send({type:8,element:n})},setOptionsElement:n=>{this.send({type:9,element:n})}}),ka(this,"selectors",{activeDescendantId(n){var r;let o=n.activeOptionIndex,s=n.options;return o===null||(r=s[o])==null?void 0:r.id},isActive(n,r){var o;let s=n.activeOptionIndex,i=n.options;return s!==null?((o=i[s])==null?void 0:o.id)===r:!1},hasFrozenValue(n){return n.frozenValue},shouldScrollIntoView(n,r){return n.__demoMode||n.listboxState!==0||n.activationTrigger===0?!1:this.isActive(n,r)},didButtonMove(n){return n.buttonPositionState.kind==="Moved"}}),this.on(6,()=>{requestAnimationFrame(()=>{this.send({type:10})})});{let n=this.state.id,r=Vs.get(null);this.disposables.add(r.on($c.Push,o=>{!r.selectors.isTop(o,n)&&this.state.listboxState===0&&this.actions.closeListbox()})),this.on(0,()=>r.actions.push(n)),this.on(1,()=>r.actions.pop(n))}this.disposables.group(n=>{this.on(1,r=>{r.buttonElement&&(n.dispose(),n.add(yv(r.buttonElement,r.buttonPositionState,()=>{this.send({type:11})})))})}),this.on(5,(n,r)=>{var o;this.actions.onChange(r.value),this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(o=this.state.buttonElement)==null||o.focus({preventScroll:!0}))})}static new({id:t,__demoMode:n=!1}){return new Ks({id:t,dataRef:{current:{}},listboxState:n?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:he.Nothing},frozenValue:!1,__demoMode:n,buttonPositionState:Wr.Idle})}reduce(t,n){return pt(n.type,Sv,t,n)}}const ou=A.createContext(null);function Ys(e){let t=A.useContext(ou);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,su),n}return t}function su({id:e,__demoMode:t=!1}){let n=A.useMemo(()=>Ks.new({id:e,__demoMode:t}),[]);return Zc(()=>n.dispose()),n}let ho=A.createContext(null);ho.displayName="ListboxDataContext";function Rr(e){let t=A.useContext(ho);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Rr),n}return t}let Cv=A.Fragment;function Ov(e,t){let n=A.useId(),r=Ws(),{value:o,defaultValue:s,form:i,name:a,onChange:l,by:c,invalid:d=!1,disabled:h=r||!1,horizontal:p=!1,multiple:f=!1,__demoMode:w=!1,...y}=e;const R=p?"horizontal":"vertical";let k=gt(t),x=kp(s),[F=f?[]:void 0,$]=Tp(o,l,x),D=su({id:n,__demoMode:w}),j=A.useRef({static:!1,hold:!1}),W=A.useRef(new Map),u=em(c),g=A.useCallback(G=>pt(m.mode,{[Vt.Multi]:()=>F.some(U=>u(U,G)),[Vt.Single]:()=>u(F,G)}),[F]),m=_t({value:F,disabled:h,invalid:d,mode:f?Vt.Multi:Vt.Single,orientation:R,onChange:$,compare:u,isSelected:g,optionsPropsRef:j,listRef:W});Pe(()=>{D.state.dataRef.current=m},[m]);let C=Ne(D,G=>G.listboxState),O=Vs.get(null),T=Ne(O,A.useCallback(G=>O.selectors.isTop(G,n),[O,n])),[S,b]=Ne(D,G=>[G.buttonElement,G.optionsElement]);Tm(T,[S,b],(G,U)=>{D.send({type:ru.CloseListbox}),jc(U,zs.Loose)||(G.preventDefault(),S==null||S.focus())});let E=_t({open:C===Ce.Open,disabled:h,invalid:d,value:F}),[I,v]=Kp({inherit:!0}),M={ref:k},B=A.useCallback(()=>{if(x!==void 0)return $==null?void 0:$(x)},[$,x]),V=st();return A.createElement(v,{value:I,props:{htmlFor:S==null?void 0:S.id},slot:{open:C===Ce.Open,disabled:h}},A.createElement(tv,null,A.createElement(ou.Provider,{value:D},A.createElement(ho.Provider,{value:m},A.createElement(iv,{value:pt(C,{[Ce.Open]:hr.Open,[Ce.Closed]:hr.Closed})},a!=null&&F!=null&&A.createElement(Dp,{disabled:h,data:{[a]:F},form:i,onReset:B}),V({ourProps:M,theirProps:y,slot:E,defaultTag:Cv,name:"Listbox"}))))))}let Av="button";function Tv(e,t){let n=A.useId(),r=wc(),o=Rr("Listbox.Button"),s=Ys("Listbox.Button"),{id:i=r||`headlessui-listbox-button-${n}`,disabled:a=o.disabled||!1,autoFocus:l=!1,...c}=e,d=gt(t,Xg(),s.actions.setButtonElement),h=Jg(),[p,f,w]=Ne(s,b=>[b.listboxState,b.buttonElement,b.optionsElement]),y=p===Ce.Open;Fm(y,{trigger:f,action:A.useCallback(b=>{if(f!=null&&f.contains(b.target))return Nr.Ignore;let E=b.target.closest('[role="option"]:not([data-disabled])');return At(E)?Nr.Select(E):w!=null&&w.contains(b.target)?Nr.Ignore:Nr.Close},[f,w]),close:s.actions.closeListbox,select:s.actions.selectActiveOption});let R=ue(b=>{switch(b.key){case Ee.Enter:Pp(b.currentTarget);break;case Ee.Space:case Ee.ArrowDown:b.preventDefault(),s.actions.openListbox({focus:o.value?he.Nothing:he.First});break;case Ee.ArrowUp:b.preventDefault(),s.actions.openListbox({focus:o.value?he.Nothing:he.Last});break}}),k=ue(b=>{switch(b.key){case Ee.Space:b.preventDefault();break}}),x=nm(b=>{var E;s.state.listboxState===Ce.Open?(mn.flushSync(()=>s.actions.closeListbox()),(E=s.state.buttonElement)==null||E.focus({preventScroll:!0})):(b.preventDefault(),s.actions.openListbox({focus:he.Nothing}))}),F=ue(b=>b.preventDefault()),$=Ac([i]),D=qp(),{isFocusVisible:j,focusProps:W}=hp({autoFocus:l}),{isHovered:u,hoverProps:g}=dp({isDisabled:a}),{pressed:m,pressProps:C}=wp({disabled:a}),O=_t({open:p===Ce.Open,active:m||p===Ce.Open,disabled:a,invalid:o.invalid,value:o.value,hover:u,focus:j,autofocus:l}),T=Ne(s,b=>b.listboxState===Ce.Open),S=mc(h(),{ref:d,id:i,type:Im(e,f),"aria-haspopup":"listbox","aria-controls":w==null?void 0:w.id,"aria-expanded":T,"aria-labelledby":$,"aria-describedby":D,disabled:a||void 0,autoFocus:l,onKeyDown:R,onKeyUp:k,onKeyPress:F},x,W,g,C);return st()({ourProps:S,theirProps:c,slot:O,defaultTag:Av,name:"Listbox.Button"})}let iu=A.createContext(!1),kv="div",Pv=ms.RenderStrategy|ms.Static;function Fv(e,t){let n=A.useId(),{id:r=`headlessui-listbox-options-${n}`,anchor:o,portal:s=!1,modal:i=!0,transition:a=!1,...l}=e,c=Yg(o),[d,h]=A.useState(null);c&&(s=!0);let p=Rr("Listbox.Options"),f=Ys("Listbox.Options"),[w,y,R,k]=Ne(f,H=>[H.listboxState,H.buttonElement,H.optionsElement,H.__demoMode]),x=ys(y),F=ys(R),$=sv(),[D,j]=zm(a,d,$!==null?($&hr.Open)===hr.Open:w===Ce.Open);gm(D,y,f.actions.closeListbox);let W=k?!1:i&&w===Ce.Open;Bm(W,F);let u=k?!1:i&&w===Ce.Open;mm(u,{allowed:A.useCallback(()=>[y,R],[y,R])});let g=Ne(f,f.selectors.didButtonMove)?!1:D,m=Ne(f,f.selectors.hasFrozenValue)&&!e.static,C=Jc(m,p.value),O=A.useCallback(H=>p.compare(C,H),[p.compare,C]),T=Ne(f,H=>{var K;if(c==null||!((K=c==null?void 0:c.to)!=null&&K.includes("selection")))return null;let Ae=H.options.findIndex(Fe=>O(Fe.dataRef.current.value));return Ae===-1&&(Ae=0),Ae}),S=(()=>{if(c==null)return;if(T===null)return{...c,inner:void 0};let H=Array.from(p.listRef.current.values());return{...c,inner:{listRef:{current:H},index:T}}})(),[b,E]=ev(S),I=Zg(),v=gt(t,c?b:null,f.actions.setOptionsElement,h),M=Kn();A.useEffect(()=>{let H=R;H&&w===Ce.Open&&(vp(H)||H==null||H.focus({preventScroll:!0}))},[w,R]);let B=ue(H=>{var K;switch(M.dispose(),H.key){case Ee.Space:if(f.state.searchQuery!=="")return H.preventDefault(),H.stopPropagation(),f.actions.search(H.key);case Ee.Enter:H.preventDefault(),H.stopPropagation(),f.actions.selectActiveOption();break;case pt(p.orientation,{vertical:Ee.ArrowDown,horizontal:Ee.ArrowRight}):return H.preventDefault(),H.stopPropagation(),f.actions.goToOption({focus:he.Next});case pt(p.orientation,{vertical:Ee.ArrowUp,horizontal:Ee.ArrowLeft}):return H.preventDefault(),H.stopPropagation(),f.actions.goToOption({focus:he.Previous});case Ee.Home:case Ee.PageUp:return H.preventDefault(),H.stopPropagation(),f.actions.goToOption({focus:he.First});case Ee.End:case Ee.PageDown:return H.preventDefault(),H.stopPropagation(),f.actions.goToOption({focus:he.Last});case Ee.Escape:H.preventDefault(),H.stopPropagation(),mn.flushSync(()=>f.actions.closeListbox()),(K=f.state.buttonElement)==null||K.focus({preventScroll:!0});return;case Ee.Tab:H.preventDefault(),H.stopPropagation(),mn.flushSync(()=>f.actions.closeListbox()),Sm(f.state.buttonElement,H.shiftKey?bs.Previous:bs.Next);break;default:H.key.length===1&&(f.actions.search(H.key),M.setTimeout(()=>f.actions.clearSearch(),350));break}}),V=Ne(f,H=>{var K;return(K=H.buttonElement)==null?void 0:K.id}),G=_t({open:w===Ce.Open}),U=mc(c?I():{},{id:r,ref:v,"aria-activedescendant":Ne(f,f.selectors.activeDescendantId),"aria-multiselectable":p.mode===Vt.Multi?!0:void 0,"aria-labelledby":V,"aria-orientation":p.orientation,onKeyDown:B,role:"listbox",tabIndex:w===Ce.Open?0:void 0,style:{...l.style,...E,"--button-width":tm(D,y,!0).width},...Vm(j)}),Z=st(),Q=A.useMemo(()=>p.mode===Vt.Multi?p:{...p,isSelected:O},[p,O]);return A.createElement(bv,{enabled:s?e.static||D:!1,ownerDocument:x},A.createElement(ho.Provider,{value:Q},Z({ourProps:U,theirProps:l,slot:G,defaultTag:kv,features:Pv,visible:g,name:"Listbox.Options"})))}let Iv="div";function Mv(e,t){let n=A.useId(),{id:r=`headlessui-listbox-option-${n}`,disabled:o=!1,value:s,...i}=e,a=A.useContext(iu)===!0,l=Rr("Listbox.Option"),c=Ys("Listbox.Option"),d=Ne(c,m=>c.selectors.isActive(m,r)),h=l.isSelected(s),p=A.useRef(null),f=xv(p),w=Yn({disabled:o,value:s,domRef:p,get textValue(){return f()}}),y=gt(t,p,m=>{m?l.listRef.current.set(r,m):l.listRef.current.delete(r)}),R=Ne(c,m=>c.selectors.shouldScrollIntoView(m,r));Pe(()=>{if(R)return ze().requestAnimationFrame(()=>{var m,C;(C=(m=p.current)==null?void 0:m.scrollIntoView)==null||C.call(m,{block:"nearest"})})},[R,p]),Pe(()=>{if(!a)return c.actions.registerOption(r,w),()=>c.actions.unregisterOption(r)},[w,r,a]);let k=ue(m=>{if(o)return m.preventDefault();c.actions.selectOption(s)}),x=ue(()=>{if(o)return c.actions.goToOption({focus:he.Nothing});c.actions.goToOption({focus:he.Specific,id:r})}),F=Wm(),$=ue(m=>F.update(m)),D=ue(m=>{F.wasMoved(m)&&(o||d&&c.state.activationTrigger===Hr.Pointer||c.actions.goToOption({focus:he.Specific,id:r},Hr.Pointer))}),j=ue(m=>{F.wasMoved(m)&&(o||d&&c.state.activationTrigger===Hr.Pointer&&c.actions.goToOption({focus:he.Nothing}))}),W=_t({active:d,focus:d,selected:h,disabled:o,selectedOption:h&&a}),u=a?{}:{id:r,ref:y,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":h,disabled:void 0,onClick:k,onFocus:x,onPointerEnter:$,onMouseEnter:$,onPointerMove:D,onMouseMove:D,onPointerLeave:j,onMouseLeave:j},g=st();return!h&&a?null:g({ourProps:u,theirProps:i,slot:W,defaultTag:Iv,name:"Listbox.Option"})}let $v=A.Fragment;function Nv(e,t){let{options:n,placeholder:r,...o}=e,s={ref:gt(t)},i=Rr("ListboxSelectedOption"),a=_t({}),l=i.value===void 0||i.value===null||i.mode===Vt.Multi&&Array.isArray(i.value)&&i.value.length===0,c=st();return A.createElement(iu.Provider,{value:!0},c({ourProps:s,theirProps:{...o,children:A.createElement(A.Fragment,null,r&&l?r:n)},slot:a,defaultTag:$v,name:"ListboxSelectedOption"}))}let Dv=it(Ov),au=it(Tv),Lv=Tc,lu=it(Fv),cu=it(Mv),jv=it(Nv),Bv=Object.assign(Dv,{Button:au,Label:Lv,Options:lu,Option:cu,SelectedOption:jv});function uu(e={}){const{activeAddress:t,algodClient:n}=St.useWallet(),{enabled:r=!0}=e;return Ms({queryKey:["account-info",t],queryFn:async()=>{if(!t||!n)return null;try{return await n.accountInformation(t).do()}catch(o){throw new Error(`Error fetching account information: ${o}`)}},enabled:r&&!!t&&!!n,refetchOnWindowFocus:!0})}function Wv({className:e,scale:t=.85}){return L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:ir("inline-block align-baseline",e),style:{width:`${t}em`,height:`${t}em`},"aria-label":"Algorand",fill:"currentColor",children:L.jsx("path",{d:"M23.98 23.99h-3.75l-2.44-9.07-5.25 9.07H8.34l8.1-14.04-1.3-4.88L4.22 24H.02L13.88 0h3.67l1.61 5.96h3.79l-2.59 4.5 3.62 13.53z"})})}function Hv({children:e}){var b;const{activeAddress:t,activeWallet:n}=St.useWallet(),{theme:r}=so(),[o,s]=A.useState(!1),[i,a]=A.useState(!1),[l,c]=A.useState(()=>{const E=localStorage.getItem("uwui:balance-preference");return E?E==="available":!1}),d=r==="system"?void 0:r,h=$s({enabled:!!t}),p=((b=h.data)==null?void 0:b.name)??null,{data:f}=uu({enabled:!!t}),w=A.useMemo(()=>!f||f.amount===void 0?null:Number(f.amount)/1e6,[f]),y=A.useMemo(()=>{if(!f||f.amount===void 0||f.minBalance===void 0)return null;const E=Number(f.amount)-Number(f.minBalance);return Math.max(0,E/1e6)},[f]),R=l?y:w,{refs:k,floatingStyles:x,context:F}=Ll({open:o,onOpenChange:s,placement:"bottom-end",middleware:[Rd(8),Cd(),Sd()],whileElementsMounted:md}),$=Nl(F),D=Dl(F,{outsidePressEvent:"mousedown"}),{getReferenceProps:j,getFloatingProps:W}=jl([$,D]),u=qn(),g=()=>{t&&(navigator.clipboard.writeText(t),a(!0),setTimeout(()=>a(!1),2e3))},m=async()=>{if(n)try{await n.disconnect(),s(!1)}catch(E){console.error("Error disconnecting wallet:",E)}},C=E=>{n&&n.setActiveAccount&&n.setActiveAccount(E)},O=()=>{const E=!l;c(E),localStorage.setItem("uwui:balance-preference",E?"available":"total")},T=e||L.jsx(io,{}),S=A.cloneElement(T,j({ref:k.setReference}));return L.jsxs(L.Fragment,{children:[S,o&&L.jsx(Il,{children:L.jsx($l,{context:F,modal:!1,children:L.jsx("div",{"data-wallet-ui":!0,"data-wallet-ui-scope":!0,"data-theme":d,children:L.jsx("div",{ref:k.setFloating,style:x,...W(),"aria-labelledby":u,className:"z-50 w-80 rounded-xl bg-(--wui-color-bg) shadow-xl border border-(--wui-color-border)",children:L.jsxs("div",{className:"p-4",children:[L.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[L.jsx("div",{className:"h-12 w-12 overflow-hidden",children:L.jsx(Ns,{nfd:h.data,alt:`${p||t} avatar`,size:48})}),L.jsxs("div",{children:[L.jsx("h3",{id:u,className:"text-lg font-bold text-(--wui-color-text) max-w-[220px] truncate wallet-custom-font",children:p||(t?er(t,6,4):"My Wallet")}),p&&t&&L.jsx("p",{className:"text-sm text-(--wui-color-text-secondary)",children:er(t,6,4)})]})]}),L.jsx("div",{className:"mb-4 bg-(--wui-color-bg-secondary) rounded-lg p-3",children:L.jsxs("div",{className:"flex justify-between items-center",children:[R!==null&&L.jsxs("span",{className:"text-base font-medium text-(--wui-color-text) flex items-center gap-1",children:[Vh(R,{fractionDigits:4}),L.jsx(Wv,{})]}),L.jsxs("button",{onClick:O,className:"flex items-center gap-1 text-sm text-(--wui-color-text-secondary) bg-(--wui-color-bg-tertiary) py-1 pl-2.5 pr-2 rounded-md hover:brightness-90 transition-all focus:outline-none",title:l?"Show total balance":"Show available balance",children:[l?"Available":"Total",L.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"ml-0.5 opacity-80",children:[L.jsx("path",{d:"m17 10-5-5-5 5"}),L.jsx("path",{d:"m17 14-5 5-5-5"})]})]})]})}),n&&n.accounts&&n.accounts.length>1&&L.jsx("div",{className:"mb-4",children:L.jsxs(Bv,{value:t||"",onChange:C,children:[L.jsx(Tc,{className:"block text-sm font-medium text-(--wui-color-text-secondary) mb-1",children:"Select Account"}),L.jsxs("div",{className:"relative mt-1",children:[L.jsxs(au,{className:"grid w-full cursor-default grid-cols-1 rounded-lg border border-(--wui-color-border) bg-(--wui-color-bg-secondary) py-2 px-3 text-left text-(--wui-color-text) shadow-sm focus:outline-none focus:ring-2 focus:ring-(--wui-color-primary) focus:border-transparent text-sm",children:[L.jsx("span",{className:"col-start-1 row-start-1 truncate pr-8",children:t?er(t,6,4):"Select account"}),L.jsx("span",{className:"col-start-1 row-start-1 self-center justify-self-end",children:L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"text-(--wui-color-text-secondary)","aria-hidden":"true",children:L.jsx("path",{d:"M4 6L8 10L12 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),L.jsx(lu,{transition:!0,className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-(--wui-color-bg-secondary) py-1 shadow-lg ring-1 ring-black/5 focus:outline-none text-sm data-closed:data-leave:opacity-0 data-leave:transition data-leave:duration-100 data-leave:ease-in",children:n.accounts.map(E=>L.jsxs(cu,{value:E.address,className:"group relative cursor-default select-none py-2 pl-3 pr-9 text-(--wui-color-text) data-focus:bg-(--wui-color-bg-hover) data-focus:outline-none",children:[L.jsx("span",{className:"block truncate font-normal group-data-selected:font-medium",children:er(E.address,6,4)}),L.jsx("span",{className:"absolute inset-y-0 right-0 flex items-center pr-3 text-(--wui-color-primary) group-[&:not([data-selected])]:hidden",children:L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"h-5 w-5","aria-hidden":"true",children:L.jsx("path",{d:"M13.3334 4L6.00008 11.3333L2.66675 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]},E.address))})]})]})}),L.jsx("div",{className:"border-t border-(--wui-color-border) mt-2 mb-2"}),n&&L.jsxs("div",{className:"mb-2 flex items-center gap-2 px-1 py-0.5",children:[L.jsx("div",{className:"h-5 w-5 overflow-hidden rounded flex items-center justify-center",children:n.metadata.icon?L.jsx("img",{src:n.metadata.icon,alt:`${n.metadata.name} icon`,className:"max-w-full max-h-full"}):L.jsx("div",{className:"h-5 w-5 rounded-full bg-(--wui-color-bg-tertiary) flex items-center justify-center",children:L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-3 w-3 text-(--wui-color-text-tertiary)",viewBox:"0 0 20 20",fill:"currentColor",children:L.jsx("path",{fillRule:"evenodd",d:"M17 9c0-.55-.45-1-1-1h-4c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1h4c.55 0 1-.45 1-1V9zm-1 0v8h-4V9h4zM8 4c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v13c0 .55.45 1 1 1h4c.55 0 1-.45 1-1V4zM3 3h4v14H3V3z",clipRule:"evenodd"})})})}),L.jsx("p",{className:"text-sm text-(--wui-color-text-secondary)",children:n.metadata.name})]}),L.jsx("div",{className:"border-t border-(--wui-color-border) mb-3 mt-2"}),L.jsxs("div",{className:"flex gap-2",children:[L.jsx("button",{onClick:g,className:"flex-1 py-2 px-4 bg-(--wui-color-bg-tertiary) text-(--wui-color-text-secondary) font-medium rounded-xl hover:brightness-90 transition-all text-sm flex items-center justify-center",title:"Copy address",children:i?L.jsxs(L.Fragment,{children:[L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-green-500 mr-1.5",viewBox:"0 0 20 20",fill:"currentColor",children:L.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),"Copied"]}):L.jsxs(L.Fragment,{children:[L.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-1.5",viewBox:"0 0 20 20",fill:"currentColor",children:[L.jsx("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),L.jsx("path",{d:"M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"})]}),"Copy"]})}),L.jsx("button",{onClick:m,className:"flex-1 py-2 px-4 bg-(--wui-color-danger-bg) text-(--wui-color-danger-text) font-medium rounded-xl hover:bg-(--wui-color-danger-bg-hover) transition-colors text-sm",children:"Disconnect"})]})]})})})})})]})}function fu(e){const{queryClient:t}=so();return L.jsx(Kl,{client:t,children:L.jsx(Hv,{...e})})}function Uv(){const{activeAddress:e}=St.useWallet();return e?L.jsx(fu,{children:L.jsx(io,{})}):L.jsx(Zl,{})}hu();exports.ConnectWalletButton=Es;exports.ConnectWalletMenu=Zl;exports.ConnectedWalletButton=io;exports.ConnectedWalletMenu=fu;exports.NfdAvatar=Ns;exports.WalletButton=Uv;exports.WalletList=Jl;exports.WalletUIProvider=Wh;exports.useAccountInfo=uu;exports.useNfd=$s;exports.useResolvedTheme=Yl;exports.useWalletUI=so;
|
|
89
99
|
//# sourceMappingURL=index.cjs.map
|